@clickview/exchange 0.38.0 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/bundles.json +1 -1
  2. package/dist/css/{772-exchange-048a248cd1.chunk.css → 226-exchange-9ab9f14b3c.chunk.css} +2 -2
  3. package/dist/css/{298-exchange-36ee7a5172.chunk.css → 298-exchange-78ece5c7c5.chunk.css} +1 -1
  4. package/dist/css/{494-exchange-949a42ef69.chunk.css → 494-exchange-02d7a0249c.chunk.css} +1 -1
  5. package/dist/css/{68-exchange-0883d117eb.chunk.css → 68-exchange-b5eaf8af44.chunk.css} +1 -1
  6. package/dist/css/{254-exchange-248800a47a.chunk.css → 761-exchange-5b8b71b399.chunk.css} +3 -3
  7. package/dist/css/{127-exchange-1597f7f5b3.chunk.css → 904-exchange-0eab318199.chunk.css} +1 -1
  8. package/dist/languages/en.json +1 -1
  9. package/dist/scripts/{439-c871c22a06-exchange.chunk.js → 127-fff9e00092-exchange.chunk.js} +1 -1
  10. package/dist/scripts/156-a369c2a765-exchange.chunk.js +1 -0
  11. package/dist/scripts/{212-46db7351e8-exchange.chunk.js → 212-fe4ed18ba6-exchange.chunk.js} +1 -1
  12. package/dist/scripts/226-310258d590-exchange.chunk.js +1 -0
  13. package/dist/scripts/{267-47957cd5f0-exchange.chunk.js → 267-a69e20c67b-exchange.chunk.js} +1 -1
  14. package/dist/scripts/306-a3f68f6b22-exchange.chunk.js +1 -0
  15. package/dist/scripts/312-a4692307fb-exchange.chunk.js +1 -0
  16. package/dist/scripts/325-c441427324-exchange.chunk.js +1 -0
  17. package/dist/scripts/{332-4165dd2ddf-exchange.chunk.js → 332-a15f8f6329-exchange.chunk.js} +1 -1
  18. package/dist/scripts/356-ee94674043-exchange.chunk.js +1 -0
  19. package/dist/scripts/{442-dc834d87f2-exchange.chunk.js → 442-7d8c06bafa-exchange.chunk.js} +1 -1
  20. package/dist/scripts/484-5995380059-exchange.chunk.js +1 -0
  21. package/dist/scripts/494-6454060c57-exchange.chunk.js +2 -0
  22. package/dist/scripts/497-2c41a372b8-exchange.chunk.js +2 -0
  23. package/dist/scripts/536-0463f74012-exchange.chunk.js +1 -0
  24. package/dist/scripts/611-ab7180cf35-exchange.chunk.js +1 -0
  25. package/dist/scripts/669-f8db61a3b5-exchange.chunk.js +1 -0
  26. package/dist/scripts/759-5eebceaaef-exchange.chunk.js +1 -0
  27. package/dist/scripts/761-88c0dfbffd-exchange.chunk.js +2 -0
  28. package/dist/scripts/773-7409ad2920-exchange.chunk.js +2 -0
  29. package/dist/scripts/851-416bd6edca-exchange.chunk.js +2 -0
  30. package/dist/scripts/88-dff85bddb4-exchange.chunk.js +1 -0
  31. package/dist/scripts/881-0889a79d75-exchange.chunk.js +1 -0
  32. package/dist/scripts/{127-1ae1177487-exchange.chunk.js → 904-f35313974a-exchange.chunk.js} +1 -1
  33. package/dist/scripts/979-e7bc1b2deb-exchange.chunk.js +2 -0
  34. package/dist/scripts/bundle-087cf63970.min.js +2 -0
  35. package/package.json +1 -1
  36. package/dist/scripts/117-5800f118cb-exchange.chunk.js +0 -1
  37. package/dist/scripts/19-d84c0d31fa-exchange.chunk.js +0 -1
  38. package/dist/scripts/21-b353c515d0-exchange.chunk.js +0 -1
  39. package/dist/scripts/248-c72189e1a9-exchange.chunk.js +0 -1
  40. package/dist/scripts/252-fede1c9c5f-exchange.chunk.js +0 -1
  41. package/dist/scripts/254-0dba9826de-exchange.chunk.js +0 -2
  42. package/dist/scripts/273-2e824e0028-exchange.chunk.js +0 -1
  43. package/dist/scripts/312-07b9cc55a2-exchange.chunk.js +0 -1
  44. package/dist/scripts/485-32f080b04f-exchange.chunk.js +0 -1
  45. package/dist/scripts/494-2e1780fda8-exchange.chunk.js +0 -2
  46. package/dist/scripts/497-c06dfdaf1f-exchange.chunk.js +0 -2
  47. package/dist/scripts/507-961c4e7d55-exchange.chunk.js +0 -1
  48. package/dist/scripts/531-a928896064-exchange.chunk.js +0 -1
  49. package/dist/scripts/715-97c7f172ea-exchange.chunk.js +0 -1
  50. package/dist/scripts/772-a6bfa35480-exchange.chunk.js +0 -1
  51. package/dist/scripts/773-7b18693a7b-exchange.chunk.js +0 -2
  52. package/dist/scripts/774-b41826139d-exchange.chunk.js +0 -1
  53. package/dist/scripts/851-2bd54ad8e1-exchange.chunk.js +0 -2
  54. package/dist/scripts/979-3127808424-exchange.chunk.js +0 -2
  55. package/dist/scripts/bundle-587267e017.min.js +0 -2
  56. /package/dist/css/{507-exchange-8c1b8716b3.chunk.css → 306-exchange-8c1b8716b3.chunk.css} +0 -0
  57. /package/dist/css/{531-exchange-cbf2bb5621.chunk.css → 611-exchange-cbf2bb5621.chunk.css} +0 -0
  58. /package/dist/css/{19-exchange-e80e6c6649.chunk.css → 669-exchange-e80e6c6649.chunk.css} +0 -0
  59. /package/dist/css/{273-exchange-015d6143ca.chunk.css → 759-exchange-015d6143ca.chunk.css} +0 -0
  60. /package/dist/css/{774-exchange-6d2304419c.chunk.css → 88-exchange-6d2304419c.chunk.css} +0 -0
  61. /package/dist/scripts/{298-c81581c503-exchange.chunk.js → 298-42afa6070d-exchange.chunk.js} +0 -0
  62. /package/dist/scripts/{457-bf45e6e452-exchange.chunk.js → 457-3fdb89469c-exchange.chunk.js} +0 -0
  63. /package/dist/scripts/{254-0dba9826de-exchange.chunk.js.LICENSE.txt → 494-6454060c57-exchange.chunk.js.LICENSE.txt} +0 -0
  64. /package/dist/scripts/{494-2e1780fda8-exchange.chunk.js.LICENSE.txt → 497-2c41a372b8-exchange.chunk.js.LICENSE.txt} +0 -0
  65. /package/dist/scripts/{68-a832d9eaa7-exchange.chunk.js → 68-36307cb673-exchange.chunk.js} +0 -0
  66. /package/dist/scripts/{497-c06dfdaf1f-exchange.chunk.js.LICENSE.txt → 761-88c0dfbffd-exchange.chunk.js.LICENSE.txt} +0 -0
  67. /package/dist/scripts/{773-7b18693a7b-exchange.chunk.js.LICENSE.txt → 773-7409ad2920-exchange.chunk.js.LICENSE.txt} +0 -0
  68. /package/dist/scripts/{851-2bd54ad8e1-exchange.chunk.js.LICENSE.txt → 851-416bd6edca-exchange.chunk.js.LICENSE.txt} +0 -0
  69. /package/dist/scripts/{979-3127808424-exchange.chunk.js.LICENSE.txt → 979-e7bc1b2deb-exchange.chunk.js.LICENSE.txt} +0 -0
  70. /package/dist/scripts/{bundle-587267e017.min.js.LICENSE.txt → bundle-087cf63970.min.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 254-0dba9826de-exchange.chunk.js.LICENSE.txt */
2
- (self.webpackChunk_clickview_exchange=self.webpackChunk_clickview_exchange||[]).push([[254],{66090:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{O:()=>i});var i={isNumber:function(e){return i.isType(e,"number")},isString:function(e){return i.isType(e,"string")},isType:function(e,t){return r(e)===t}}},23455:(e,t,n)=>{"use strict";n.d(t,{h:()=>a});var r=n(32735),i=n(81886),o=n(20470);function a(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.useEffect((function(){t.length&&t.some(i.Q.Ry.isStatusCodeError)&&i.Q.Ry.throw(new o.x)}),t)}},74237:(e,t,n)=>{"use strict";n.d(t,{T:()=>l});var r=n(97395),i=n(49985),o=n(65858);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(){u=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},c=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),u=new L(r||[]);return i(a,"_invoke",{value:C(e,n,u)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",b={};function g(){}function w(){}function O(){}var S={};f(S,c,(function(){return this}));var k=Object.getPrototypeOf,N=k&&k(k(R([])));N&&N!==n&&r.call(N,c)&&(S=N);var P=O.prototype=g.prototype=Object.create(S);function j(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,u,c){var l=h(e[i],e,o);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==a(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,u,c)}),(function(e){n("throw",e,u,c)})):t.resolve(f).then((function(e){s.value=e,u(s)}),(function(e){return n("throw",e,u,c)}))}c(l.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function C(t,n,r){var i=y;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=T(u,r);if(c){if(c===b)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===y)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var l=h(t,n,r);if("normal"===l.type){if(i=r.done?m:v,l.arg===b)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=m,r.method="throw",r.arg=l.arg)}}}function T(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var o=h(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,b;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function R(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(a(t)+" is not iterable")}return w.prototype=O,i(P,"constructor",{value:O,configurable:!0}),i(O,"constructor",{value:w,configurable:!0}),w.displayName=f(O,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,f(e,s,"GeneratorFunction")),e.prototype=Object.create(P),e},t.awrap=function(e){return{__await:e}},j(E.prototype),f(E.prototype,l,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new E(p(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},j(P),f(P,s,"Generator"),f(P,c,(function(){return this})),f(P,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=R,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),b}},t}var c=null,l={getVideoDownloadUrl:function(e,t){return r._.safeUrlConcat(r._.makeHttps(e),"/download?token=".concat(t))},downloadResource:function(e,t,n,r){var a,u=c;c||(u=c=document.createElement("iframe"),document.body.appendChild(u),u.style.display="none"),u.src=e.url,r||i.k.logUserAction(Object.assign({id:null==e?void 0:e.id,name:null==e?void 0:e.name,resourceType:null===(a=null==e?void 0:e.metadata)||void 0===a?void 0:a.resourceType},t),Object.assign({actionType:o.Vw.Download,entity:o.py.Resource,workflowPhase:o.eu.Complete},n))},downloadBlob:function(e,t){return n=this,r=void 0,i=void 0,o=u().mark((function n(){var r,i,o;return u().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,fetch(e);case 2:if((r=n.sent).ok){n.next=5;break}throw new Error("Error downloading file");case 5:return n.t0=URL,n.next=8,r.blob();case 8:n.t1=n.sent,i=n.t0.createObjectURL.call(n.t0,n.t1),(o=document.createElement("a")).href=i,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.setTimeout((function(){return URL.revokeObjectURL(i)}),100);case 17:case"end":return n.stop()}}),n)})),new(i||(i=Promise))((function(e,t){function a(e){try{c(o.next(e))}catch(e){t(e)}}function u(e){try{c(o.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,u)}c((o=o.apply(n,r||[])).next())}));var n,r,i,o}}},7017:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(32735),i=n(83345);const o={adFreeBadge:"xUXHs",small:"rqFjv"};var a="tv.adFreeBadge";function u(e){return r.createElement("div",{className:"".concat(o.adFreeBadge," ").concat(e.small?o.small:""," ").concat(e.className||""," d-flex align-items-center rounded bg-red text-white fw-semibold px-1 font-size-sm")},r.createElement(i.x,{namespace:a,phrase:"adFree"}))}},69435:(e,t,n)=>{"use strict";n.d(t,{J:()=>o});var r=n(32735);const i={channelBadge:"Ud_W9",small:"A0WD4"};function o(e){return r.createElement("div",{className:"".concat(i.channelBadge," ").concat(e.small?i.small:""," ").concat(e.className||"")},r.createElement("img",{className:"h-100 align-baseline",src:e.logoUrl}))}},65972:(e,t,n)=>{"use strict";n.d(t,{B:()=>u});var r=n(32735),i=n(14965),o=n(55667);const a={programTimeBadge:"Avu4L",small:"a1Wkd",hover:"fbzDz"};function u(e){var t=e.program.timeZone||e.program.region.timeZone,n=(0,o.h)(e.program.startTime,t),u=(0,o.h)(e.program.stopTime,t);return r.createElement("div",{className:"".concat(a.programTimeBadge," ").concat(e.small?"".concat(a.small," align-items-end"):"align-items-center"," ").concat(e.hover?a.hover:""," ").concat(e.className||""," d-flex bg-white text-nowrap border border-dark rounded-pill px-2")},r.createElement("span",null,e.showDate&&"".concat(i.O.format(n,"D MMM")," @ "),i.O.format(n,"hh:mma"),e.showEndTime&&" - ".concat(i.O.format(u,"hh:mma"))))}},55667:(e,t,n)=>{"use strict";n.d(t,{h:()=>o});var r=n(14965),i={"AUS Eastern Standard Time":"Australia/Sydney","W. Australia Standard Time":"Australia/Perth","E. Australia Standard Time":"Australia/Brisbane","Cen. Australia Standard Time":"Australia/Adelaide","New Zealand Standard Time":"Pacific/Auckland","GMT Standard Time":"Europe/London"};function o(e,t){return r.O.getUtcTimeByTimezone(e,"YYYY-MM-DDTHH:mm:ss",i[t])}},1557:(e,t,n)=>{"use strict";n.d(t,{$:()=>c});var r=n(32735),i=n(11607),o=n(83914),a=n(35223);const u={overlay:"Ux3Um",close:"D1Gyv",preview:"IGttc"};function c(e){return r.createElement(r.Fragment,null,r.createElement("div",{className:"".concat(u.overlay," ").concat(u.preview," d-flex align-items-center justify-content-start")},r.createElement(o.x,{svgName:a.vn.VisibleOn,size:o.S.Large})),r.createElement(i.L,{className:"".concat(u.overlay," ").concat(u.close," d-flex align-items-center justify-content-center"),onClick:e.closePopup},r.createElement(o.x,{svgName:a.vn.Close,size:o.S.Large})))}},84034:(e,t,n)=>{"use strict";n.d(t,{d:()=>G});var r=n(32735),i=n(42648),o=n(78259),a=n(65858),u=n(18967),c=n(16831),l=n(17464),s=n(42029),f=n(83345),p=n(49439);const h={copyrightDisclaimer:"z8YoI",overlayContainer:"eJDbJ"};function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var v="shared.copyrightDisclaimer",d=150;function m(e){var t,n,i,o=(n=(0,p.L)({}),i=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(n,i)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(n,i)||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.")}()),a=o[0],u=o[1];return r.createElement("div",{ref:a,className:e.className},r.createElement("p",{className:"".concat(h.copyrightDisclaimer," ").concat(null!==(t=e.phraseClassName)&&void 0!==t?t:"mb-1")},r.createElement(f.x,{namespace:v,phrase:"copyrightDisclaimer"})),r.createElement(s.Z,{target:a.current,show:u,placement:e.overflowPlacement&&function(){var e;return document.documentElement.clientHeight-(null===(e=a.current)||void 0===e?void 0:e.getBoundingClientRect().bottom)<d}()?e.overflowPlacement:e.placement},r.createElement("div",{className:"".concat(h.overlayContainer," mw-100 bg-white border rounded-3 p-2")},r.createElement("p",null,r.createElement(f.x,{namespace:v,phrase:"warning"})),r.createElement("p",{className:"fw-semibold mb-0"},r.createElement(f.x,{namespace:v,phrase:"sharing"})))))}var b=n(82302),g=n(1048),w=n(66090);function O(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e)||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 S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function k(e){var t=e.page,n=e.totalPages,r=w.O.isNumber(t)&&t>0&&t<n&&t+1,i=w.O.isNumber(t)&&t>1&&t-1,o={};if(r&&r<=n&&(o.next=r.toString()),i&&(o.previous=i.toString()),!g.t.isEmpty(o))return o}var N={isEmpty:function(e){return e&&!(e.data&&e.data.length)},length:function(e){return e&&e.data&&e.data.length},at:function(e,t){if(e&&e.data&&e.data.length&&!(t>e.data.length))return e.data[t]},get:function(e,t){if(e&&e.data&&e.data.length)return e.data.find((function(e){return e.id&&e.id.toString()===t}))},flattenCollections:function(e){if(e&&e.length){var t=[];return e.forEach((function(e){t=[].concat(O(t),O(e.data))})),t}},getNextCursor:function(e){return e.pagination&&e.pagination.cursors&&e.pagination.cursors.next},convertLegacyPaginatedCollection:function(e){if(e)return{data:e.data,pagination:{cursors:k(e.pagination),limit:e.pagination.pageSize}}},hasData:function(e){return!N.isEmpty(e)}},P=n(23481),j=n(16035),E=n(44829),C=n(2096);function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _(e){var t;switch(null===(t=e.tagType)||void 0===t?void 0:t.toLowerCase()){case E.Q.Pedagogy:return 0;case E.Q.Skill:return 1;default:return 2}}function x(e){if(!e.tags)return r.createElement(r.Fragment,null);var t,n=(t=e.tags,function(e){if(Array.isArray(e))return T(e)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}(t)||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.")}()).sort((function(e,t){return _(e)-_(t)}));return r.createElement("div",{className:"".concat(C.Z.tagList," ").concat(e.className)},n.map((function(t){var n="function"==typeof e.getAppLink?e.getAppLink(t):null,i="function"==typeof e.onRemove?function(){return e.onRemove(t)}:null,o="function"==typeof e.onClick?function(){return e.onClick(t)}:null;return r.createElement(j.z,{key:t.id||t.name,tag:t,appLink:n,themeColours:e.themeColours,onRemove:i,onClick:o})})))}function L(e){var t=e.label,n=e.items;if(!(n&&n.data&&n.data.length))return r.createElement(r.Fragment,null);var i=n.data.map((function(e){return e.name})).join(", ");return r.createElement("div",{className:"mb-2"},t,": ",i)}var R="exchange.detailsSection",I=P.T.encloseNamespace(R);function M(e){var t,n,i,o,a,u,c,l,s,p,h=e.video,y=e.hasPPDD,v=e.description;return r.createElement("div",{className:v?"col-md-5 ps-md-3 pt-3 pt-md-0":"col-12"},r.createElement("h2",{className:"h6 mb-2"},r.createElement(f.x,{namespace:R,phrase:"details"})),y&&r.createElement("div",null,r.createElement(L,{label:I("productionCompanies",{smartCount:null===(n=null===(t=h.productionCompanies)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length}),items:h.productionCompanies}),r.createElement(L,{label:I("distributors",{smartCount:null===(o=null===(i=h.distributors)||void 0===i?void 0:i.data)||void 0===o?void 0:o.length}),items:h.distributors}),r.createElement(L,{label:I("producers",{smartCount:null===(u=null===(a=h.producers)||void 0===a?void 0:a.data)||void 0===u?void 0:u.length}),items:h.producers}),r.createElement(L,{label:I("directors",{smartCount:null===(l=null===(c=h.directors)||void 0===c?void 0:c.data)||void 0===l?void 0:l.length}),items:h.directors})),!!(null===(p=null===(s=h.tags)||void 0===s?void 0:s.data)||void 0===p?void 0:p.length)&&r.createElement(x,{tags:h.tags.data}))}var B=n(55215),D=n(7017),A=n(69435),F=n(65972);const z={previewBadge:"JA0mN",previewAlert:"qFT4M"};var Z="exchange.previewVideoDetails",V=200;function G(e){var t,n,s,p,h,y=e.title,v=e.description,d=e.video,g=e.videoActions,w=function(e){return!!e&&!N.isEmpty(e)},O=!!(null==d?void 0:d.series),S=!!(null===(t=null==d?void 0:d.rating)||void 0===t?void 0:t.value)||!!(null==d?void 0:d.productionYear)||e.program,k=w(null==d?void 0:d.productionCompanies)||w(null==d?void 0:d.producers)||w(null==d?void 0:d.distributors)||w(null==d?void 0:d.directors),P=!!v,j=k||!!(null===(s=null===(n=null==d?void 0:d.tags)||void 0===n?void 0:n.data)||void 0===s?void 0:s.length);return r.createElement("div",{className:"p-3"},r.createElement("div",{className:"".concat(O||S?"mb-3":"mb-2"," position-relative")},r.createElement("div",{className:"w-100"},r.createElement("div",{className:"ms-2 float-end"},r.createElement(u.e,{actions:g,actionsDropdownClassName:"btn btn-outline-dark px-1"})),!!d&&r.createElement(b.$,{type:"series",video:d,appLink:(0,B.cL)(d.series),className:"text-wrap",analyticsOptions:{location:a.LZ.PlayPage}}),r.createElement("h1",{className:"h4 mb-1 ".concat(O||S?"":"mb-0 pt-2")},r.createElement("span",{className:"align-self-center"},y))),S&&r.createElement(l.c,null,r.createElement(c.C,{type:c.g.Rating,data:null==d?void 0:d.rating,className:"".concat(z.previewBadge," fw-semibold py-0 font-size-normal align-items-center px-2")}),r.createElement(c.C,{type:c.g.ProductionYear,data:null==d?void 0:d.productionYear,className:"".concat(z.previewBadge," fw-semibold font-size-sm align-items-center px-1")}),(null===(p=e.program)||void 0===p?void 0:p.channelLogoUrl)&&r.createElement(A.J,{logoUrl:e.program.channelLogoUrl,className:"me-1"}),(null===(h=e.program)||void 0===h?void 0:h.hasAdsFree)&&r.createElement(D.Z,{className:"me-1"}),e.program&&r.createElement(F.B,{program:e.program,showDate:!0,showEndTime:!0}))),r.createElement("div",null,r.createElement(i.$B,{autoHeight:!0,autoHeightMax:V},r.createElement("div",{className:"row g-0"},P&&r.createElement("div",{className:j?"border-end pe-3 col-md-7":"col-12"},r.createElement("div",{className:"d-flex align-items-center"},r.createElement("h2",{className:"h6 mb-2"},r.createElement(f.x,{namespace:Z,phrase:"description"}))),r.createElement("p",{className:"mb-2",dangerouslySetInnerHTML:{__html:o.O.linkifyText(v,{nl2br:!0})}})),j&&r.createElement(M,{video:d,hasPPDD:k,description:v}))),e.video&&r.createElement("div",{className:"row"},r.createElement("div",{className:"".concat(k?"d-md-block col-7":""," d-none")}),r.createElement("div",{className:"".concat(k?"col-md-5 ps-md-3":"ps-2 "," ")},r.createElement(m,{placement:k?"bottom-end":"bottom-start",overflowPlacement:k?"top-end":"top-start"})))))}},41026:(e,t,n)=>{"use strict";n.d(t,{L:()=>DO});var r=n(32735),i=(n(39682),n(76032));function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}function s(e,t,n){return t=y(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}function p(e,t,n,r){var i=h(y(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},h.apply(null,arguments)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function v(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}var m=function(e){function t(e,n){return a(this,t),s(this,t,[e,n])}return v(t,e),c(t,[{key:"handleClick",value:function(e){var n=this;p(t,"handleClick",this,3)([e]),this.requestAnimationFrame((function(){n.options_.item.showCollapsibleMenu()}))}},{key:"createEl",value:function(e,n,r){if(!this.options_.item)return p(t,"createEl",this,3)([e,n,r]);var o=this.options_.item.getCollabsibleName(),a=this.options_.item.getCollabsibleValue(),u=this.options_.item.className,c='<span class="vjs-menu-item-text">'.concat(o,"</span>");this.valueHolder_=i.Z.dom.createEl("span",{innerHTML:a});var l=p(t,"createEl",this,3)([e,{className:"vjs-menu-item cv-cog-menu-item ".concat(a?"cv-has-cog-value":""," ").concat(u||"").trim(),innerHTML:c},r]);return l.appendChild(this.valueHolder_),l}},{key:"updateCollapsibleValue",value:function(){this.valueHolder_.innerHTML=this.options_.item.getCollabsibleValue()}}])}(i.Z.getComponent("MenuItem")),b=function(e){function t(e,n){var r;return a(this,t),(r=s(this,t,[e,n])).controlText("Settings"),r}return v(t,e),c(t,[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-cog-menu-button ".concat(p(t,"buildWrapperCSSClass",this,3)([]))}},{key:"buildCSSClass",value:function(){return"cv-cog-button ".concat(p(t,"buildCSSClass",this,3)([]))}},{key:"pressButton",value:function(){this.player_.options_.deferMenus?this.player_.deferMenusPlugin().deferMenu():(this.menu.children_.forEach((function(e){e.updateCollapsibleValue&&e.updateCollapsibleValue()})),p(t,"pressButton",this,3)([]))}},{key:"createItems",value:function(){for(var e,t=this,n=[],r=0;r<this.options_.items.length;r++){var i=this.options_.items[r];i.isCollabsible&&i.showInCollabsibleMenu()&&i.isCollapsed&&n.push(new m(this.player_,{item:i}))}return(null===(e=this.additionalItems)||void 0===e?void 0:e.length)&&this.additionalItems.forEach((function(e){var r,i=new e.ctor(t.player_,Object.assign(Object.assign({},t.options_),null!==(r=e.options)&&void 0!==r?r:{}));n.splice(e.index,0,i)})),n}},{key:"update",value:function(){p(t,"update",this,3)([]),this.player_.trigger("resizemenus")}},{key:"addItem",value:function(e){this.additionalItems||(this.additionalItems=[]),this.additionalItems.some((function(t){return t.name===e.name}))||(this.additionalItems.push(e),this.update())}}])}(i.Z.getComponent("MenuButton"));function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,O(r.key),r)}}function O(e){var t=function(e){if("object"!=g(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==g(t)?t:t+""}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}function k(){return k="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=N(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},k.apply(null,arguments)}function N(e){return N=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},N(e)}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},P(e,t)}i.Z.registerComponent("cogButton",b);var j=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=N(t),function(e,t){if(t&&("object"==g(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,S()?Reflect.construct(t,n||[],N(e).constructor):t.apply(e,n))}(this,t,[e,n])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&P(e,t)}(t,e),n=t,r=[{key:"createEl",value:function(){return i.Z.dom.createEl("li",{className:"vjs-menu-item cv-collapsible-menu-heading cv-divider-after-menu-item",innerHTML:'<span class="vjs-menu-item-text">'.concat(this.localize(this.options_.label),"</span>"),tabIndex:-1})}},{key:"handleClick",value:function(e){var n,r,i,o=this;(n=t,r=this,"function"==typeof(i=k(N(1&3?n.prototype:n),"handleClick",r))?function(e){return i.apply(r,e)}:i)([e]),this.options_.onClickBack?this.options_.onClickBack():this.requestAnimationFrame((function(){o.player_.getChild("collapserator").getChild("cogButton").pressButton()}))}}],r&&w(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("MenuItem"));function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function C(){return C="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=M(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},C.apply(null,arguments)}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L(r.key),r)}}function x(e,t,n){return t&&_(e.prototype,t),n&&_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function L(e){var t=function(e){if("object"!=E(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==E(t)?t:t+""}function R(e,t,n){return t=M(t),function(e,t){if(t&&("object"==E(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,I()?Reflect.construct(t,n||[],M(e).constructor):t.apply(e,n))}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(I=function(){return!!e})()}function M(e){return M=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},M(e)}function B(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&D(e,t)}function D(e,t){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D(e,t)}var A=i.Z.getComponent("MenuItem"),F=i.Z.getComponent("MenuButton"),z=["large","medium","small"],Z=function(e){function t(e,n){return T(this,t),R(this,t,[e,n])}return B(t,e),x(t,[{key:"handleClick",value:function(){this.player_.textTrackSettings.setSizeSetting(this.options_.value)}}])}(A),V=function(e){function t(e,n){var r;return T(this,t),(r=R(this,t,[e,n])).alwaysCollapsed=!0,r.isCollapsed=!1,r.isCollabsible=!0,r.player_.ready((function(){r.update()})),r}return B(t,e),x(t,[{key:"createItems",value:function(){var e=this,t=this.player_.textTrackSettings;if(t){var n=t.getSizeSetting(),r=[new j(this.player_,{label:"Caption Text Size",onClickBack:function(){e.requestAnimationFrame((function(){e.player_.getChild("collapserator").getChild("subsCapsButton").pressButton()}))}})];return z.map((function(t){r.push(new Z(e.player_,{label:t.charAt(0).toUpperCase()+t.substring(1),selectable:!0,multiSelectable:!1,selected:t===n,value:t}))})),r}}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat((e=t,n=this,"function"==typeof(r=C(M(1&3?e.prototype:e),"buildWrapperCSSClass",n))?function(e){return r.apply(n,e)}:r)([]));var e,n,r}},{key:"getCollabsibleName",value:function(){return"Subtitle Size"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!1}},{key:"showCollapsibleMenu",value:function(){F.prototype.handleClick.apply(this)}}])}(F);i.Z.registerComponent("SubtitleSizeButton",V);var G=n(28400);function U(e,t,n,r){if(!e.length)return[];for(var i=[],o=e.length-1;o>=0;o--){var a=e[o];if(a.kind===t){if(n&&a.label!==n)continue;if(r&&a.language!==r)continue;i.push(a)}}return i}function K(e,t,n,r,i){e.kind===t&&(n&&e.label!==n||i&&e.language!==i||(e.loaded_?r(e):e.one("loadeddata",(function(){r(e)}))))}function q(e){if(null==e?void 0:e.cues.length)for(var t=0;t<e.cues.length;t++){var n=e.cues[t];(null==n?void 0:n.text)&&(n.text=G.m.sanitize(n.text))}}function H(e,t,n,r,i){var o=e.textTracks(),a=U(o,t,n,i)[0];if(a)K(a,t,n,r);else{var u=function(e){K(e.track,t,n,r),o.removeEventListener("addtrack",u)};o.addEventListener("addtrack",u),e.one("dispose",(function(){o.removeEventListener("addtrack",u)}))}}function W(e,t,n,r,i){var o=e.textTracks(),a=U(o,t,n,i);a.length&&a.forEach((function(e){return K(e,t,n,r,i)}));var u=function(e){K(e.track,t,n,r,i)};o.addEventListener("addtrack",u),e.one("dispose",(function(){o.removeEventListener("addtrack",u)}))}var Y={getTrack:function(e,t,n,r){return U(e.textTracks(),t,n,r)[0]},useChapters:function(e,t){H(e,"chapters",null,t)},useMetadataTrack:function(e,t,n){H(e,"metadata",t,n,null)},useMetadataTracks:function(e,t,n,r){W(e,"metadata",t,n,r)},useSubtitles:function(e,t,n){W(e,"subtitles",null,t,n)},getCurrentTextTrack:function(e){return this.findTrackByPredicate(e,(function(e){return"showing"===e.mode}))},findTrackByPredicate:function(e,t){if(!e)return null;for(var n=e.textTracks(),r=0;r<n.length;r++){var i=n[r];if(t(i))return i}return null},forEachTrack:function(e,t){if(e)for(var n=e.textTracks(),r=0;r<n.length;r++)t(n[r])},sanitizeTrack:function(e,t){if(e&&t)if(e.loaded)q(e);else{var n=function(){return q(e)};e.addEventListener("loadeddata",n),t.one("dispose",(function(){e.removeEventListener("loadeddata",n)}))}},activeTextTrack:function(e){"disabled"===e.mode&&"subtitles"===e.kind&&(e.mode="hidden")}},Q=function(e,t,n){var r,i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,a=function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];var l=!1,s=function(){r=null,s=null,e.apply(this,u)};return!r&&n&&(e.apply(i,u),l=!0),o.clearTimeout(r),r=o.setTimeout(s,t),l};return a.cancel=function(){o.clearTimeout(r),r=null},a};function J(e){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J(e)}function X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,te(r.key),r)}}function ee(e,t,n){return t&&$(e.prototype,t),n&&$(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function te(e){var t=function(e){if("object"!=J(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=J(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==J(t)?t:t+""}function ne(e,t,n){return t=ae(t),function(e,t){if(t&&("object"==J(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,re()?Reflect.construct(t,n||[],ae(e).constructor):t.apply(e,n))}function re(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(re=function(){return!!e})()}function ie(e,t,n,r){var i=oe(ae(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function oe(){return oe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ae(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},oe.apply(null,arguments)}function ae(e){return ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ae(e)}function ue(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ce(e,t)}function ce(e,t){return ce=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ce(e,t)}var le=i.Z.getComponent("MenuItem"),se=function(e){function t(e,n){var r;return X(this,t),(r=ne(this,t,[e,n])).onChange=Q(r.onChange,100,!1,r),r.bindEventListeners(),r}return ue(t,e),ee(t,[{key:"createEl",value:function(){var e=this.localize("Search");return ie(t,"createEl",this,3)(["li",{className:"vjs-menu-item cv-search-input-menu-item-container ".concat(this.options_.className||"").trim(),innerHTML:'\n <div class="cv-search-input-menu-item">\n <span class="cv-search-icon">\n <svg viewBox="0 0 24 24">\n <path d="M15.803 14.306l3.917 3.954a1 1 0 0 1-.007 1.417l-.018.018-.018.018a.997.997 0 0 1-1.41 0l-3.918-3.953-.3.214c-1.14.713-2.323 1.07-3.549 1.07-1.796 0-3.328-.642-4.597-1.925C4.634 13.836 4 12.296 4 10.5c0-1.796.634-3.328 1.903-4.597C7.172 4.634 8.704 4 10.5 4c1.796 0 3.329.634 4.597 1.903 1.27 1.269 1.904 2.801 1.904 4.597a6.447 6.447 0 0 1-1.027 3.507l-.17.3zM10.5 5.368c-1.425 0-2.637.5-3.635 1.497-.998.998-1.497 2.21-1.497 3.635 0 1.426.5 2.637 1.497 3.635.998.998 2.21 1.497 3.635 1.497 1.426 0 2.637-.499 3.635-1.497 1.027-1.026 1.54-2.238 1.54-3.635 0-1.397-.513-2.608-1.54-3.635-.998-.998-2.21-1.497-3.635-1.497z"/>\n </svg>\n </span><input placeholder="'.concat(e,'" type="text" autocomplete="off" spellcheck="false" aria-label="').concat(e,'" />\n </div>\n ')}])}},{key:"focus",value:function(){this.$("input").focus()}},{key:"handleClick",value:function(e){e.stopImmediatePropagation(),this.$("input").focus()}},{key:"handleKeyDown",value:function(){this.focus()}},{key:"bindEventListeners",value:function(){var e=this,t=this.$("input");this.onChange=this.onChange.bind(this),t.addEventListener("keyup",this.onChange),t.addEventListener("blur",(function(t){e.options_.menuButton.menu.handleBlur(t)}))}},{key:"onChange",value:function(e){var t=e.target;this.options_.search(t.value)}}])}(le);i.Z.registerComponent("SearchInputMenuItem",se);var fe=function(e){function t(){return X(this,t),ne(this,t,arguments)}return ue(t,e),ee(t,[{key:"createEl",value:function(e,n,r){return ie(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:"vjs-menu-item cv-no-results"}),r])}},{key:"setLabel",value:function(e){var t=this.$(".vjs-menu-item-text");t&&(t.innerHTML=e)}}])}(le);function pe(e){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pe(e)}function he(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ye(r.key),r)}}function ye(e){var t=function(e){if("object"!=pe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=pe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pe(t)?t:t+""}function ve(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ve=function(){return!!e})()}function de(e){return de=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},de(e)}function me(e,t){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},me(e,t)}i.Z.registerComponent("NoMatchingResultsMenuItem",fe);var be=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=de(t),function(e,t){if(t&&("object"==pe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ve()?Reflect.construct(t,n||[],de(e).constructor):t.apply(e,n))}(this,t,[e,n])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&me(e,t)}(t,e),n=t,(r=[{key:"update",value:function(e,t){var n=this;if(null==e?void 0:e.length){var r=[],i=0;e.forEach((function(e){var o=n.options_.label.substr(i,e);o&&r.push(o),r.push('<span class="cv-highlight">'),r.push(n.options_.label.substr(e,t)),r.push("</span>"),i=e+t})),r.push(this.options_.label.substring(i,this.options_.label.length)),this.el().innerHTML='<span class="vjs-menu-item-text">'.concat(r.join(""),"</span>")}else this.el().innerHTML='<span class="vjs-menu-item-text">'.concat(this.options_.label,"</span>")}},{key:"handleClick",value:function(e){e.stopImmediatePropagation(),this.player_.currentTime(this.options_.cue.startTime)}}])&&he(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("MenuItem"));function ge(e){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ge(e)}function we(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Oe(r.key),r)}}function Oe(e){var t=function(e){if("object"!=ge(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ge(t)?t:t+""}function Se(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Se=function(){return!!e})()}function ke(e,t,n,r){var i=Ne(Pe(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Ne(){return Ne="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Pe(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Ne.apply(null,arguments)}function Pe(e){return Pe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pe(e)}function je(e,t){return je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},je(e,t)}var Ee=i.Z.getComponent("MenuButton"),Ce=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Pe(t),function(e,t){if(t&&("object"==ge(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Se()?Reflect.construct(t,n||[],Pe(e).constructor):t.apply(e,n))}(this,t,[e,n])).alwaysCollapsed=!0,r.isCollapsed=!1,r.isCollabsible=!0,r.update=r.update.bind(r),r.search=r.search.bind(r),r.player_.textTracks().addEventListener("selectedlanguagechange",r.update),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&je(e,t)}(t,e),n=t,(r=[{key:"bindTrackEvents",value:function(e){var t=this;e.removeEventListener("loadeddata",this.update),e.addEventListener("loadeddata",this.update),this.player_.one("dispose",(function(){e.removeEventListener("loadeddata",t.update)}))}},{key:"createItems",value:function(){var e,t=Y.getCurrentTextTrack(this.player_);if(t){if(null===(e=t.cues)||void 0===e?void 0:e.length){for(var n=[new se(this.player_,{menuButton:this,search:this.search})],r=0;r<t.cues.length;r++){var i=t.cues[r];n.push(new be(this.player_,{cue:i,label:i.text,selected:!1,multiSelectable:!1}))}var o=new fe(this.player_,{label:"No matching results",selected:!1,selectable:!1,multiSelectable:!1});return o.hide(),n.push(o),n}this.bindTrackEvents(t)}}},{key:"search",value:function(e){var t;e=e.trim();var n=Y.getCurrentTextTrack(this.player_);if(null===(t=null==n?void 0:n.cues)||void 0===t?void 0:t.length){var r=this.findMatches(e,n);this.toggleItemVisibility(e,r),this.toggleNoResults(e,r)}}},{key:"findMatches",value:function(e,t){var n={};if(!e)return n;for(var r=new RegExp(e,"gi"),i=0;i<t.cues.length;i++){for(var o=t.cues[i].text,a=[],u=void 0;u=r.exec(o);)a.push(u.index);a.length&&(n[i]=a)}return n}},{key:"toggleItemVisibility",value:function(e,t){this.menu.children_.slice(1,this.menu.children_.length-1).forEach((function(n,r){!e||t[r]?n.show():n.hide(),n.update(t[r],e.length)}))}},{key:"toggleNoResults",value:function(e,t){var n=this.menu.children_[this.menu.children_.length-1];!e||Object.keys(t).length?n.hide():n.show()}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-big cv-subtitle-search-button ".concat(ke(t,"buildWrapperCSSClass",this,3)([]))}},{key:"update",value:function(){ke(t,"update",this,3)([]),this.player_.trigger("resizemenus")}},{key:"pressButton",value:function(){ke(t,"pressButton",this,3)([]);var e=this.menu.children_[0];(null==e?void 0:e.focus)&&(null==e||e.focus())}},{key:"getCollabsibleName",value:function(){return"Subtitle Size"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!1}},{key:"showCollapsibleMenu",value:function(){Ee.prototype.handleClick.apply(this)}}])&&we(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ee);function Te(e){return Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Te(e)}function _e(){return _e="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=De(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},_e.apply(null,arguments)}function xe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Le(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ie(r.key),r)}}function Re(e,t,n){return t&&Le(e.prototype,t),n&&Le(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ie(e){var t=function(e){if("object"!=Te(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Te(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Te(t)?t:t+""}function Me(e,t,n){return t=De(t),function(e,t){if(t&&("object"==Te(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Be()?Reflect.construct(t,n||[],De(e).constructor):t.apply(e,n))}function Be(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Be=function(){return!!e})()}function De(e){return De=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},De(e)}function Ae(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fe(e,t)}function Fe(e,t){return Fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fe(e,t)}i.Z.registerComponent("subtitleSearchButton",Ce);var ze=i.Z.getComponent("MenuItem"),Ze=i.Z.getComponent("MenuButton"),Ve=[{label:"Play / Pause",type:"play-pause"},{label:"Volume",type:"volume"},{label:"Mute",type:"mute"},{label:"Toggle fullscreen",type:"fullscreen"},{label:"Exit fullscreen",type:"exit-fullscreen"},{label:"Toggle theatre mode",type:"theatre-mode"}],Ge=function(e){function t(e,n){return xe(this,t),Me(this,t,[e,n])}return Ae(t,e),Re(t,[{key:"createEl",value:function(){return i.Z.dom.createEl("li",{className:"vjs-menu-item",tabIndex:-1,innerHTML:'\n <span class="vjs-menu-item-text">'.concat(this.options_.label,"</span>\n <span>").concat(this.getDisplayHtml(this.options_.type),"\n ")})}},{key:"getDisplayHtml",value:function(e){switch(e){case"play-pause":return'<span class="cv-keyboard-button">Spacebar</span>';case"volume":return'<span class="cv-keyboard-button">Shift</span> + \n <span class="cv-keyboard-button cv-single-key">&uArr;</span> / \n <span class="cv-keyboard-button">Shift</span> +\n <span class="cv-keyboard-button cv-single-key">&dArr;</span>';case"mute":return'<span class="cv-keyboard-button cv-single-key">m</span>';case"fullscreen":return'<span class="cv-keyboard-button cv-single-key">f</span>';case"exit-fullscreen":return'<span class="cv-keyboard-button cv-single-key">esc</span>';case"theatre-mode":return'<span class="cv-keyboard-button cv-single-key">t</span>'}return""}}])}(ze),Ue=function(e){function t(){var e;return xe(this,t),(e=Me(this,t,arguments)).alwaysCollapsed=!0,e.isCollapsed=!1,e.isCollabsible=!0,e}return Ae(t,e),Re(t,[{key:"createItems",value:function(){var e=this,t=[];return t.push(new j(this.player_,{label:"Keyboard Shortcuts"})),Ve.forEach((function(n){t.push(new Ge(e.player_,n))})),t}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-keyboard-shortcuts ".concat((e=t,n=this,"function"==typeof(r=_e(De(1&3?e.prototype:e),"buildWrapperCSSClass",n))?function(e){return r.apply(n,e)}:r)([]));var e,n,r}},{key:"getCollabsibleName",value:function(){return"Keyboard Shortcuts"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!this.player_.options_.mobile}},{key:"showCollapsibleMenu",value:function(){Ze.prototype.handleClick.apply(this)}}])}(Ze);function Ke(e){return Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ke(e)}function qe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,He(r.key),r)}}function He(e){var t=function(e){if("object"!=Ke(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ke(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ke(t)?t:t+""}function We(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(We=function(){return!!e})()}function Ye(e,t,n,r){var i=Qe(Je(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Qe(){return Qe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Je(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Qe.apply(null,arguments)}function Je(e){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Je(e)}function Xe(e,t){return Xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xe(e,t)}i.Z.registerComponent("KeyboardShortcutsButton",Ue);var $e="cv-collapsed",et=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Je(t),function(e,t){if(t&&("object"==Ke(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,We()?Reflect.construct(t,n||[],Je(e).constructor):t.apply(e,n))}(this,t,[e,n])).addChild("cogButton",{items:r.children_},r.children_.length-1),r.update=r.update.bind(r),r.player_.on("cv-updatecog",r.update),r.player_.on("playerresize",r.update),r.player_.one("play",r.update),r.player_.on("dispose",(function(){r.player_.off("cv-updatecog",r.update),r.player_.off("playerresize",r.update),r.player_.off("play",r.update)})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xe(e,t)}(t,e),n=t,(r=[{key:"toggleHidden",value:function(e){for(var t=0;t<this.children_.length;t++){var n=this.children_[t];n.isCollabsible&&(n.alwaysCollapsed||e?(n.isCollapsed=!0,n.addClass($e)):(n.isCollapsed=!1,n.removeClass($e)))}this.getChild("cogButton").update()}},{key:"update",value:function(){var e=this.player_.isFullscreen(),t=this.player_.whiteboardModePlugin().side,n=this.player_.el().getBoundingClientRect(),r=!e||"left"!==t&&"right"!==t?n.width:n.height;if(r){this.addClass("cv-collapsorator-ready");var i=r<(!e||"left"!==t&&"right"!==t&&"top"!==t?600:1200);this.player_.options_.deferMenus&&(i=!0),this.toggleHidden(i)}}},{key:"buildCSSClass",value:function(){return"cv-collapsorator ".concat(Ye(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,r){return Ye(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}}])&&qe(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));i.Z.registerComponent("collapserator",et);var tt=["playToggle","volumePanel","customControlSpacer","playbackRateMenuButton","chaptersButton","qualityButton","keyboardShortcutsButton","subsCapsButton","whiteboardModeButton","subtitleSizeButton","subtitleSearchButton","fullscreenToggle"],nt=n(57900),rt=n(86790),it=n(65858),ot=n(50873);function at(e){return at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},at(e)}function ut(){ut=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==at(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(at(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function ct(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lt(r.key),r)}}function lt(e){var t=function(e){if("object"!=at(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=at(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==at(t)?t:t+""}var st=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=t,this.initialize()},(t=[{key:"logStream",value:function(){var e="v:".concat(this.options.videoId);nt.SG.cacheExists(e)||(this.collectionApiClient.log({type:it.Vw.WebPlayerStream,actionContext:this.getActionContext(),data:this.getAnalyticsData(),eventVersion:it.eq.V3}),nt.SG&&nt.SG.cacheSet(e,null,300))}},{key:"logVideoProgress",value:function(e){var t=this,n=this.getAnalyticsData();this.collectionApiClient.log(e.map((function(e){return{type:it.Vw.StreamProgress,actionContext:t.getActionContext(),data:Object.assign(Object.assign({},n),{progress:e}),eventVersion:it.eq.V2}})))}},{key:"logUserAction",value:function(e,t){var n=Object.assign(Object.assign({},this.getAnalyticsData()),e),r=Object.assign(Object.assign({},this.getActionContext()),t);this.collectionApiClient.log({type:t.actionType,data:n,actionContext:r,eventVersion:t.eventVersion||it.eq.V2})}},{key:"getAnalyticsData",value:function(){var e=Object.assign({video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache}},this.options.additionalAnalyticsData||{});this.options.shareId&&(e.video.shareId=this.options.shareId);var t=this.getEntityType();return t===it.py.Interactive?e.interactive={id:+this.options.mediaId}:t===it.py.Clip&&(e.clip={id:+this.options.mediaId}),e}},{key:"initialize",value:function(){this.setupCollectionApiClient()}},{key:"setupCollectionApiClient",value:function(){var e=this;this.collectionApiClient=new rt.q({productName:"player.web",productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:function(){return e.getCurrentUser()},shouldLog:ot.k.shouldLog,formatData:ot.k.formatData})}},{key:"getCurrentUser",value:function(){return e=this,t=void 0,n=void 0,r=ut().mark((function e(){return ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{id:this.options.userId,customerId:this.options.customerId,sessionId:this.options.authSessionId});case 1:case"end":return e.stop()}}),e,this)})),new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}));var e,t,n,r}},{key:"getActionContext",value:function(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?it.MC.Embedded:void 0,workflowPhase:void 0}}},{key:"getEntityType",value:function(){switch(this.options.mediaType){case"MasterVideo":return it.py.Video;case"MasterInteractive":return it.py.Interactive;case"MasterClip":return it.py.Clip}}},{key:"getLocationContext",value:function(){switch(this.options.playerType){case"player":return it.LZ.Player;case"interactive-player":return it.LZ.InteractivePlayer;case"create-clip-player":return it.LZ.CreateClipPlayer}}}])&&ct(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function ft(e){return ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ft(e)}function pt(e){var t="function"==typeof Map?new Map:void 0;return pt=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(ht())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&yt(i,n.prototype),i}(e,arguments,vt(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),yt(n,e)},pt(e)}function ht(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ht=function(){return!!e})()}function yt(e,t){return yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yt(e,t)}function vt(e){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vt(e)}var dt=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=vt(t),function(e,t){if(t&&("object"==ft(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ht()?Reflect.construct(t,n||[],vt(e).constructor):t.apply(e,n))}(this,t,[(null==n?void 0:n.title)||"Ajax error"])).url=e,r.response=n,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yt(e,t)}(t,e),n=t,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(pt(Error));function mt(e){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mt(e)}function bt(){bt=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==mt(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(mt(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function gt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wt(r.key),r)}}function wt(e){var t=function(e){if("object"!=mt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mt(t)?t:t+""}var Ot,St=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))},kt=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tokens={gateway:null}},t=[{key:"get",value:function(e,t){return St(this,void 0,void 0,bt().mark((function n(){return bt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.t0=this,n.next=3,fetch(e,{method:"GET",mode:"cors",headers:this.getHeaders(t)});case 3:return n.t1=n.sent,n.next=6,n.t0.parseResponse.call(n.t0,n.t1);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n,this)})))}},{key:"delete",value:function(e,t){return St(this,void 0,void 0,bt().mark((function n(){return bt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,fetch(e,{method:"DELETE",headers:this.getHeaders(t)});case 2:case"end":return n.stop()}}),n,this)})))}},{key:"post",value:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return St(this,void 0,void 0,bt().mark((function i(){var o;return bt().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,fetch(e,{method:"POST",headers:this.getHeaders(n),body:t,mode:"cors"});case 2:if(o=i.sent,!r){i.next=7;break}return i.next=6,this.parseResponse(o);case 6:return i.abrupt("return",i.sent);case 7:case"end":return i.stop()}}),i,this)})))}},{key:"put",value:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return St(this,void 0,void 0,bt().mark((function i(){var o;return bt().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,fetch(e,{method:"PUT",headers:this.getHeaders(n),body:t,mode:"cors"});case 2:if(o=i.sent,!r){i.next=7;break}return i.next=6,this.parseResponse(o);case 6:return i.abrupt("return",i.sent);case 7:case"end":return i.stop()}}),i,this)})))}},{key:"setToken",value:function(e,t){this.tokens[e]=t}},{key:"getHeaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={"Content-Type":"application/json"};return this.tokens[e.tokenName]&&(t.authorization="Bearer ".concat(this.tokens[e.tokenName])),t}},{key:"parseResponse",value:function(e){return St(this,void 0,void 0,bt().mark((function t(){var n,r;return bt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(404!==e.status){t.next=2;break}return t.abrupt("return",null);case 2:if(e.ok){t.next=15;break}return t.prev=3,t.next=6,e.json();case 6:n=t.sent,t.next=12;break;case 9:throw t.prev=9,t.t0=t.catch(3),new dt(e.url);case 12:throw t.prev=12,new dt(e.url,n);case 15:return t.next=17,e.json();case 17:return r=t.sent,t.abrupt("return",r);case 19:case"end":return t.stop()}}),t,null,[[3,9,12,15]])})))}}],t&&gt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()),Nt=n(19389),Pt=n.n(Nt);function jt(e){return jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jt(e)}function Et(e,t,n){return(t=function(e){var t=function(e){if("object"!=jt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ct(e){e.paused()?e.play():e.pause()}function Tt(e,t){e.currentTime(e.currentTime()+t)}function _t(e,t){e.volume(e.volume()+t)}var xt,Lt=(Et(Et(Et(Et(Et(Et(Et(Et(Et(Et(Ot={},"f",(function(e){document[e.fsApi_.fullscreenEnabled]&&(e.isFullscreen()?e.exitFullscreen():e.requestFullscreen())})),"m",(function(e){var t=e.volume(),n=e.lastVolume_();if(0===t){var r=n<.1?.1:n;e.volume(r),e.muted(!1)}else e.muted(!e.muted())})),"k",Ct),"space",Ct),"t",(function(e){var t=e.theatreModePlugin().getTheatreMode();e.theatreModePlugin().toggleTheatreMode(!t,{shouldLog:!0})})),"left",(function(e){return Tt(e,-5)})),"right",(function(e){return Tt(e,5)})),"j",(function(e){return Tt(e,-10)})),"l",(function(e){return Tt(e,10)})),"up",(function(e){return _t(e,.05)})),Et(Ot,"down",(function(e){return _t(e,-.05)})));!function(e){e.PhysicallyChapteredVideo="physically-chaptered-video"}(xt||(xt={}));var Rt=n(83765);function It(e){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(e)}function Mt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Bt(r.key),r)}}function Bt(e){var t=function(e){if("object"!=It(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=It(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==It(t)?t:t+""}function Dt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dt=function(){return!!e})()}function At(){return At="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Ft(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},At.apply(null,arguments)}function Ft(e){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ft(e)}function zt(e,t){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zt(e,t)}n(35571);var Zt=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Ft(t),function(e,t){if(t&&("object"==It(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Dt()?Reflect.construct(t,n||[],Ft(e).constructor):t.apply(e,n))}(this,t,[e])).options=n,r.configureMenuDimensions=r.configureMenuDimensions.bind(r),r.initialize(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zt(e,t)}(t,e),n=t,r=[{key:"initialize",value:function(){this.player.ready(this.configureMenuDimensions),this.player.one("play",this.configureMenuDimensions),this.player.on("resize",this.configureMenuDimensions),this.player.on("fullscreenchange",this.configureMenuDimensions),this.player.on("resizemenus",this.configureMenuDimensions),this.player.on("ready",this.configureMenuDimensions)}},{key:"dispose",value:function(){var e,n,r;this.player.off("resize",this.configureMenuDimensions),this.player.off("fullscreenchange",this.configureMenuDimensions),this.player.off("resizemenus",this.configureMenuDimensions),this.player.off("ready",this.configureMenuDimensions),(e=t,n=this,"function"==typeof(r=At(Ft(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}},{key:"configureMenuDimensions",value:function(){var e=this,t=function(t){if(!e.options.mobile){var n=e.player.getChild("collapserator"),r=n.getChild("volumePanel"),i=n.children_.indexOf(r);n.removeChild(r),n.addChild("volumePanel",{inline:t},i),e.player.trigger("volumechange")}},n=this.player.isFullscreen();if(n&&!this.options.mobile){var r=this.player.whiteboardModePlugin().side;if(t("top"!==r),"left"===r||"right"===r||"top"===r){var i=this.player.currentWidth();return void this.player.el().querySelectorAll(".vjs-menu").forEach((function(e){e.style.paddingTop=null,e.style.marginBottom=null,e.style.width="calc(".concat(i,"px - 4em)")}))}}n||t(!0);var o=this.player.currentWidth(),a=this.player.currentHeight()/o*100,u=this.player.el().querySelector(".cv-collapsorator"),c=this.player.el().querySelectorAll(".vjs-menu"),l=u&&u.offsetHeight;l?("CreateClipSeekBar"===this.options.seekBarName&&(l+=22),c&&c.length&&c.forEach((function(t){!n&&e.options.overflowControls?t.style.paddingTop="80%":t.style.paddingTop="calc(".concat(a,"% - ").concat(l,"px)"),t.style.marginBottom="".concat(l,"px"),t.style.width=null,t.querySelector(".vjs-menu-content")&&(o<=450?e.player.addClass("cv-player-small"):e.player.removeClass("cv-player-small"))}))):this.player.one("play",this.configureMenuDimensions)}}],r&&Mt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));i.Z.registerPlugin("configureMenuDimensionsPlugin",Zt);var Vt="cv-persisttest",Gt=function(){try{return window.localStorage.setItem(Vt,"cv-player-storage-test"),window.localStorage.removeItem(Vt),!0}catch(e){return!1}},Ut=function(e){return window.localStorage.getItem(e)},Kt=function(e,t){window.localStorage.setItem(e,t)};function qt(e){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qt(e)}function Ht(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Wt(r.key),r)}}function Wt(e){var t=function(e){if("object"!=qt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=qt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==qt(t)?t:t+""}function Yt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yt=function(){return!!e})()}function Qt(){return Qt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Jt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Qt.apply(null,arguments)}function Jt(e){return Jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Jt(e)}function Xt(e,t){return Xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xt(e,t)}var $t=i.Z.getPlugin("plugin"),en="cvplayer-volume",tn="cvplayer-mute",nn=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=Jt(t),function(e,t){if(t&&("object"==qt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Yt()?Reflect.construct(t,n||[],Jt(e).constructor):t.apply(e,n))}(this,t,[e])).enabled=!0,n.player.ready((function(){return n.initialize()})),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xt(e,t)}(t,e),n=t,r=[{key:"initialize",value:function(){this.player.options_.mobile?this.removeVolumeControl():Gt()&&(this.saveVolumeState=this.saveVolumeState.bind(this),this.player.on("volumechange",this.saveVolumeState),this.applyUserPreferences())}},{key:"applyUserPreferences",value:function(){var e=Ut(en),t=Ut(tn);e&&this.player.volume(+e),t&&this.player.muted("true"===t)}},{key:"saveVolumeState",value:function(){this.enabled&&(Kt(en,this.player.volume().toString()),Kt(tn,this.player.muted().toString()))}},{key:"removeVolumeControl",value:function(){this.player.volume(1);var e=this.player.getChild("collapserator"),t=e.getChild("volumePanel");e.removeChild(t)}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1}},{key:"dispose",value:function(){var e,n,r;this.player.off("volumechange",this.saveVolumeState),(e=t,n=this,"function"==typeof(r=Qt(Jt(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}}],r&&Ht(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}($t);function rn(e){return rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rn(e)}function on(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,an(r.key),r)}}function an(e){var t=function(e){if("object"!=rn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rn(t)?t:t+""}function un(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(un=function(){return!!e})()}function cn(e){return cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cn(e)}function ln(e,t){return ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ln(e,t)}i.Z.registerPlugin("persistVolumePlugin",nn);var sn=i.Z.getPlugin("plugin"),fn="cvplayer-playback-rate",pn=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=cn(t),function(e,t){if(t&&("object"==rn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,un()?Reflect.construct(t,n||[],cn(e).constructor):t.apply(e,n))}(this,t,[e])).options=n,r.player.dataLoaded((function(){return r.initialize()})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ln(e,t)}(t,e),n=t,(r=[{key:"initialize",value:function(){var e,t=this;if(Gt()){this.savePlaybackRate=this.savePlaybackRate.bind(this),this.player.on("ratechange",this.savePlaybackRate),this.one("dispose",(function(){t.player.off("ratechange",t.savePlaybackRate)}));var n=+Ut(fn);(null===(e=this.player.options_.playbackRates)||void 0===e?void 0:e.some((function(e){return e===n})))&&this.player.playbackRate(n)}}},{key:"savePlaybackRate",value:function(){var e,t=this.player.playbackRate().toString();Kt(fn,t),null===(e=this.options.analyticsService)||void 0===e||e.logUserAction({rate:t},{actionType:it.Vw.Select,workflowPhase:it.eu.Complete,descriptor:it.UX.ChangeSpeed,entity:it.py.PlaybackSpeed,eventVersion:it.eq.V3})}}])&&on(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(sn);function hn(e){return hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hn(e)}function yn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vn(r.key),r)}}function vn(e){var t=function(e){if("object"!=hn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=hn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==hn(t)?t:t+""}function dn(e,t){if(t&&("object"==hn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function mn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mn=function(){return!!e})()}function bn(e){return bn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bn(e)}function gn(e,t){return gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gn(e,t)}i.Z.registerPlugin("persistPlaybackRatePlugin",pn);var wn=function(e){function t(e){var n,r,i,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,o=[e],i=bn(i=t),(n=dn(r,mn()?Reflect.construct(i,o||[],bn(r).constructor):i.apply(r,o))).fullscreenBecauseOfRotate=!1,n.player.supportsFullScreen()?(n.onRotate=n.onRotate.bind(n),n.onFullscreenChange=n.onFullscreenChange.bind(n),n.player.ready((function(){return n.initialize()})),n):dn(n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gn(e,t)}(t,e),n=t,(r=[{key:"initialize",value:function(){this.player.on("fullscreenchange",this.onFullscreenChange),window.addEventListener("orientationchange",this.onRotate)}},{key:"dispose",value:function(){this.player.off("fullscreenchange",this.onFullscreenChange),window.removeEventListener("orientationchange",this.onRotate)}},{key:"onFullscreenChange",value:function(){this.player.isFullscreen()||(this.fullscreenBecauseOfRotate=!1)}},{key:"onRotate",value:function(){var e=this.getAngle();90===e||-90===e||270===e?(this.player.requestFullscreen(),this.fullscreenBecauseOfRotate=!0):this.fullscreenBecauseOfRotate&&this.player.isFullscreen()&&this.player.exitFullscreen()}},{key:"getAngle",value:function(){var e,t;return"number"==typeof(null===(t=null===(e=window.screen)||void 0===e?void 0:e.orientation)||void 0===t?void 0:t.angle)?window.screen.orientation.angle:0}}])&&yn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));i.Z.registerPlugin("fullscreenOnRotatePlugin",wn);var On="\n <svg viewBox='0 0 434 71'>\n <g>\n <path fill='#FFFFFF' d='M114.44 56.57l3.5 3.5a32.87 32.87 0 0 1-25.16 11.26c-19.63 0-33.62-15.54-33.62-35.16C59.16 16.55 73.16 1 92.78 1a32.31 32.31 0 0 1 24.19 10.4l-3.6 3.3a27.32 27.32 0 0 0-20.59-8.74c-16.91 0-28.39 13.5-28.39 30.21s11.48 30.21 28.39 30.21a28.08 28.08 0 0 0 21.66-9.81zM126.64 1h4.55v70.22h-4.73L126.64 1zm17.3 10.6a3.7 3.7 0 1 1 0 7.4 3.7 3.7 0 0 1 0-7.4zm-2.41 15.07h4.81v44.56h-4.81V26.67zm48 33.15l3.33 3.15a21.8 21.8 0 0 1-17.31 8.61c-12.59 0-21.76-10-21.76-22.22 0-12.22 9.17-22.22 21.76-22.22a21.84 21.84 0 0 1 16.85 8l-3.43 3.06a17.15 17.15 0 0 0-13.42-6.3c-10.09 0-16.76 8.15-16.76 17.5s6.67 17.5 16.76 17.5a17.38 17.38 0 0 0 13.98-7.08zm14.99-9.33v20.74h-4.73V1.01h4.73v47.75l20.74-19.02h6.64l-21.56 19.84L234 71.23h-7.01l-22.47-20.74z'/>\n <path fill='#F8981D' d='M304.09 19.4a5.56 5.56 0 1 1 0-11.12 5.56 5.56 0 0 1 0 11.12zm-5.56 7.27h11.11v44.56h-11.11V26.67zm61.42 22.15c0 .81 0 2.42-.09 4h-31.75c.8 3.77 5.2 8.61 11.93 8.61a17.11 17.11 0 0 0 11.66-4.31l5.38 8.16a27.23 27.23 0 0 1-17 6.1c-12.92 0-22.88-9.87-22.88-22.34s9.06-22.33 21.35-22.33c11.62-.04 21.4 9.02 21.4 22.11zm-10.77-3.76c-.18-3.68-3.58-8.62-10.67-8.62-6.91 0-10.05 4.85-10.4 8.62h21.07zM385.92 71h-6.42l-19.64-44.37h13.97l9.16 23.98 9.72-23.98h8.31l9.63 23.98 9.16-23.98h13.97L414.24 71h-6.52l-10.85-23.7L385.92 71zm-120.22.35h-6L226.11 1.01h17.01l19.42 44.18 18.08-44.18h16.91L265.7 71.35zM0 1l41 35L0 71V1z'/>\n </g>\n </svg>\n";function Sn(e){return Sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sn(e)}function kn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Nn(r.key),r)}}function Nn(e){var t=function(e){if("object"!=Sn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Sn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Sn(t)?t:t+""}function Pn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pn=function(){return!!e})()}function jn(e){return jn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jn(e)}function En(e,t){return En=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},En(e,t)}var Cn=function(e){function t(e,n){var r,i,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=jn(t),function(e,t){if(t&&("object"==Sn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Pn()?Reflect.construct(t,n||[],jn(e).constructor):t.apply(e,n))}(this,t,[e,n])).update=(i=r.update.bind(r),o=window.performance.now(),function(){var e=window.performance.now();e-o>=1e3&&(i.apply(void 0,arguments),o=e)}),e.on("timeupdate",r.update),e.one("dispose",(function(){e.off("timeupdate",r.update),r.el_.removeEventListener("click",r.pause)})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&En(e,t)}(t,e),n=t,(r=[{key:"update",value:function(){var e=this.player_.currentTime();this.el_.href=this.options_.getExternalLink({currentTime:Math.round(e)})}},{key:"buildCSSClass",value:function(){return"cv-open-externally-button"}},{key:"createEl",value:function(){var e={innerHTML:On,className:this.buildCSSClass()},t={type:"button",href:this.options_.getExternalLink({currentTime:0}),target:"_blank"},n=i.Z.dom.createEl("a",e,t);return this.createControlTextEl(n),n.addEventListener("click",this.pause.bind(this)),n}},{key:"pause",value:function(){this.player_.pause()}}])&&kn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Button"));function Tn(e){return Tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tn(e)}function _n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,xn(r.key),r)}}function xn(e){var t=function(e){if("object"!=Tn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Tn(t)?t:t+""}function Ln(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ln=function(){return!!e})()}function Rn(e){return Rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rn(e)}function In(e,t){return In=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},In(e,t)}Cn.prototype.controlText_="Open in ClickView",i.Z.registerComponent("OpenExternallyButton",Cn);var Mn=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Rn(t),function(e,t){if(t&&("object"==Tn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ln()?Reflect.construct(t,n||[],Rn(e).constructor):t.apply(e,n))}(this,t,[e,n])).options=n,e.ready((function(){return r.onReady()})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&In(e,t)}(t,e),n=t,(r=[{key:"onReady",value:function(){var e=this.player.getChild("collapserator"),t=e.getChild("customControlSpacer"),n=e.children_.indexOf(t);e.addChild("OpenExternallyButton",{getExternalLink:this.options.getExternalLink},n+1)}}])&&_n(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function Bn(e){return Bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bn(e)}function Dn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,An(r.key),r)}}function An(e){var t=function(e){if("object"!=Bn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Bn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Bn(t)?t:t+""}function Fn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fn=function(){return!!e})()}function zn(e,t,n,r){var i=Zn(Vn(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Zn(){return Zn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Vn(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Zn.apply(null,arguments)}function Vn(e){return Vn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vn(e)}function Gn(e,t){return Gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gn(e,t)}i.Z.registerPlugin("openExternallyPlugin",Mn);var Un=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Vn(t),function(e,t){if(t&&("object"==Bn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fn()?Reflect.construct(t,n||[],Vn(e).constructor):t.apply(e,n))}(this,t,[e,n])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gn(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-touch-control-ui ".concat(zn(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,r){return zn(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"setUi",value:function(e,t){var n=this,r=e>0,i=r?"cv-touch-right":"cv-touch-left";this.el_.className=this.buildCSSClass()+" cv-ui-touch-active",this.el_.innerHTML="\n <div class='".concat(i,"'>\n <div class='cv-touch-text'>\n ").concat(r?"+":"").concat(10*e,"s\n </div>\n </div>\n "),window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){n.removeText()}),t)}},{key:"removeText",value:function(){this.el_.className=this.buildCSSClass(),this.el_.innerHTML=""}}])&&Dn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("component"));function Kn(e){return Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kn(e)}function qn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Hn(r.key),r)}}function Hn(e){var t=function(e){if("object"!=Kn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Kn(t)?t:t+""}function Wn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wn=function(){return!!e})()}function Yn(){return Yn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Qn(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Yn.apply(null,arguments)}function Qn(e){return Qn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qn(e)}function Jn(e,t){return Jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jn(e,t)}i.Z.registerComponent("TouchControls",Un);var Xn=i.Z.getPlugin("plugin"),$n=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=Qn(t),function(e,t){if(t&&("object"==Kn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Wn()?Reflect.construct(t,n||[],Qn(e).constructor):t.apply(e,n))}(this,t,[e])).doubleTouchCount=0,n.seekStartTime=0,n.directionModifier=0,n.bindFunctions(),n.player.ready((function(){return n.initialize()})),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jn(e,t)}(t,e),n=t,r=[{key:"bindFunctions",value:function(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.reBindEventListeners=this.reBindEventListeners.bind(this),this.unBindEventListeners=this.unBindEventListeners.bind(this)}},{key:"initialize",value:function(){var e=this;this.player.addChild("TouchControls"),this.touchControls=this.player.getChild("TouchControls"),this.player.on("ready",this.reBindEventListeners),this.one("dispose",(function(){e.player.off("ready",e.reBindEventListeners)})),this.reBindEventListeners()}},{key:"reBindEventListeners",value:function(){this.unBindEventListeners(),this.tech=this.player.tech(!0),"Html5"===this.tech.name()&&(this.tech.on("touchstart",this.onTouchStart),this.tech.on("touchend",this.onTouchEnd))}},{key:"unBindEventListeners",value:function(){this.tech&&"Html5"===this.tech.name()&&(this.tech.off("touchstart",this.onTouchStart),this.tech.off("touchend",this.onTouchEnd))}},{key:"dispose",value:function(){var e,n,r;(e=t,n=this,"function"==typeof(r=Yn(Qn(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([]),this.unBindEventListeners()}},{key:"onTouchStart",value:function(e){this.touchStartTime=e.timeStamp,this.userActive=this.player.userActive()}},{key:"onTouchEnd",value:function(e){var t=this;if(e.changedTouches.length){if(e.timeStamp-this.lastTouchTime<300)return this.onDoubleTouch(e),void(this.lastTouchTime=e.timeStamp);this.resetProperties(),this.lastTouchTime=e.timeStamp,e.timeStamp-this.touchStartTime<300&&window.setTimeout((function(){t.doubleTouchCount||(t.player.paused()?t.player.play():t.userActive&&t.player.pause())}),300)}}},{key:"resetProperties",value:function(){this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0}},{key:"onDoubleTouch",value:function(e){var t=this.player.el().getBoundingClientRect(),n=t.left+t.width/2;if(0===this.doubleTouchCount&&(this.seekStartTime=this.player.currentTime(),e.changedTouches[0].pageX<n?this.directionModifier=-1:this.directionModifier=1),this.doubleTouchCount++,this.directionModifier<0){if(10*this.doubleTouchCount>this.seekStartTime+10)return;return this.touchControls.setUi(-this.doubleTouchCount,900),void this.player.currentTime(this.player.currentTime()-10)}var r=this.player.duration()-this.seekStartTime;10*this.doubleTouchCount>r+10||(this.touchControls.setUi(this.doubleTouchCount,900),this.player.currentTime(this.player.currentTime()+10))}}],r&&qn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Xn);function er(e){return er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},er(e)}function tr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nr(r.key),r)}}function nr(e){var t=function(e){if("object"!=er(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=er(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==er(t)?t:t+""}i.Z.registerPlugin("touchControls",$n);var rr=function(){return e=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=n.id,this.plugin=t,this.source=n,this.enabled=this.enabled.bind(this)},(t=[{key:"enabled",value:function(e){return void 0===e?this.plugin.currentSource===this.source:(e&&this.plugin.setSource(this.source.id),e)}}])&&tr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function ir(e){return ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ir(e)}function or(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ar(r.key),r)}}function ar(e){var t=function(e){if("object"!=ir(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ir(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ir(t)?t:t+""}function ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ur=function(){return!!e})()}function cr(e){return cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cr(e)}function lr(e,t){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lr(e,t)}var sr=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=cr(t),function(e,t){if(t&&("object"==ir(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ur()?Reflect.construct(t,n||[],cr(e).constructor):t.apply(e,n))}(this,t,[e])).options_=n,r.player.ready((function(){return r.initialize()})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lr(e,t)}(t,e),n=t,r=[{key:"initialize",value:function(){var e=this;this.sources=[],this.qualityLevels=this.player.qualityLevels(),this.populateSources(this.options_.sources),this.onQualityChange=this.onQualityChange.bind(this),this.qualityLevels.on("change",this.onQualityChange),this.player.one("dispose",(function(){e.qualityLevels.off("change",e.onQualityChange)}))}},{key:"currentSource",get:function(){return this._currentSource}},{key:"onQualityChange",value:function(){var e=this.qualityLevels[this.qualityLevels.selectedIndex];this.player.trigger("cv-quality-change",e.id)}},{key:"setSource",value:function(e){var t=this,n=this.getSourceById(e);if(null===n)return this.currentSource;var r=this.player.currentTime(),i=!this.player.paused();this._currentSource=n;var o=this.player.playbackRate(),a=this.player.hasStarted();return this.player.src({src:n.url,type:n.mimeType}),this.player.one("loadedmetadata",(function(){t.player.playbackRate(o),t.player.currentTime()!==r&&t.player.currentTime(r),i&&t.player.play(),a&&t.player.hasStarted(!0)})),this.trigger({event:"sourcechange",source:n}),this.sourceChangeUpdateQualityLevels(n),n}},{key:"getSourceById",value:function(e){return this.sources.find((function(t){return t.id===e}))}},{key:"repopulateSources",value:function(e){for(var t=null;this.qualityLevels.length;)this.qualityLevels[0].enabled&&(t=this.qualityLevels[0].id),this.qualityLevels.removeQualityLevel(this.qualityLevels[0]);this.sources=[],this.populateSources(e,t)}},{key:"sortSources",value:function(e){return e.sort((function(e,t){return e.id===t.id?0:+e.id>+t.id?-1:1}))}},{key:"populateSources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=null;(e=this.sortSources(e)).forEach((function(e){t.qualityLevels.addQualityLevel(new rr(t,e)),t.sources.push(e),t.trigger({event:"addsource",source:e}),null===n?e.default&&(r=e):e.id===n&&(r=e)})),null===r&&(r=this.sources[0]),null!==r&&this.setSource(r.id)}},{key:"sourceChangeUpdateQualityLevels",value:function(e){for(var t=this.qualityLevels,n=-1,r=0;r<t.length;r++)if(t[r].id===e.id){n=r;break}t.selectedIndex_=n,t.trigger({selectedIndex:n,type:"change"})}}],r&&or(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function fr(e){return fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fr(e)}function pr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hr(r.key),r)}}function hr(e){var t=function(e){if("object"!=fr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fr(t)?t:t+""}i.Z.registerPlugin("progressiveFiles",sr);var yr=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"getKnownProfiles",value:function(){return["1080","720","480","360","240"]}},{key:"enableProfileOrNextBest",value:function(e,t){var n=e.getQualityLevelById(t);if(n||(n=this.getNextBestQuality(e,t)),!n)return null;for(var r=0;r<e.length;r++){var i=e[r];i.enabled=n.id===i.id}return n}},{key:"getNextBestQuality",value:function(e,t){var n=this.getKnownProfiles(),r=n.indexOf(t);if(r>=0){for(var i=r+1;i<n.length;i++){var o=n[i],a=e.getQualityLevelById(o);if(a)return a}for(var u=r-1;u>0;u--){var c=n[u],l=e.getQualityLevelById(c);if(l)return l}}return null}}],null&&pr(e.prototype,null),t&&pr(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function vr(e){return vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vr(e)}function dr(){dr=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==vr(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(vr(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function mr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,br(r.key),r)}}function br(e){var t=function(e){if("object"!=vr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vr(t)?t:t+""}var gr=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t.name,this.playbackProfile=t.playbackProfile,this.address=new URL(t.httpsAddress)},(t=[{key:"getUrl",value:function(e){return e?this.address+"cache?file="+encodeURIComponent(e):null}},{key:"ping",value:function(){return e=this,t=void 0,n=void 0,r=dr().mark((function e(){var t,n,r,i;return dr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new AbortController,n=setTimeout((function(){return t.abort()}),1e3),e.prev=3,e.next=6,fetch(this.address+"ping",{method:"GET",mode:"cors",signal:t.signal});case 6:return r=e.sent,e.next=9,r.text();case 9:return i=e.sent,clearTimeout(n),e.abrupt("return","PONG"===i);case 14:return e.prev=14,e.t0=e.catch(3),e.abrupt("return",!1);case 17:case"end":return e.stop()}}),e,this,[[3,14]])})),new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}));var e,t,n,r}}])&&mr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function wr(e){return wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wr(e)}function Or(){Or=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==wr(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(wr(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function Sr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kr(r.key),r)}}function kr(e){var t=function(e){if("object"!=wr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=wr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==wr(t)?t:t+""}var Nr=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.player=t,this.logger=i.Z.log.createLogger("localcache")},(t=[{key:"setSource",value:function(e,t){return n=this,r=void 0,i=void 0,o=Or().mark((function n(){var r;return Or().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.player.localCache||void 0===(null==e?void 0:e.src)){n.next=5;break}return n.next=3,this.player.localCache().getActiveLocalCache();case 3:null!==(r=n.sent)&&(this.logger.debug("Using Local Cache",r),e.src=r.getUrl(e.src));case 5:t(null,e);case 6:case"end":return n.stop()}}),n,this)})),new(i||(i=Promise))((function(e,t){function a(e){try{c(o.next(e))}catch(e){t(e)}}function u(e){try{c(o.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,u)}c((o=o.apply(n,r||[])).next())}));var n,r,i,o}}])&&Sr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Pr(e){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pr(e)}function jr(){jr=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Pr(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(Pr(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function Er(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Cr(r.key),r)}}function Cr(e){var t=function(e){if("object"!=Pr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pr(t)?t:t+""}function Tr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tr=function(){return!!e})()}function _r(){return _r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=xr(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},_r.apply(null,arguments)}function xr(e){return xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xr(e)}function Lr(e,t){return Lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lr(e,t)}i.Z.use("*",(function(e){return new Nr(e)}));var Rr='<?xml version="1.0" encoding="UTF-8"?><svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.9"><g id="Local-Cache" transform="translate(2.000000, 2.000000)"><rect id="Rectangle" fill="#FFFFFF" x="0" y="2.4" width="18.8" height="15.2"></rect><ellipse id="Oval" fill="#FFFFFF" cx="9.4" cy="2.4" rx="9.4" ry="2.4"></ellipse><ellipse id="Oval-Copy" fill="#FFFFFF" cx="9.4" cy="17.6" rx="9.4" ry="2.4"></ellipse><g id="Logo/Circle" transform="translate(2.500000, 3.000000)"><circle id="Oval" fill="#FFFFFF" cx="7" cy="7" r="7"></circle><polygon id="Fill-1" fill="#F8981D" points="4.66666667 2.33333333 4.66666667 11.4245258 10.0383286 6.87866667"></polygon></g></g></g></svg>',Ir=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=xr(t),function(e,t){if(t&&("object"==Pr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Tr()?Reflect.construct(t,n||[],xr(e).constructor):t.apply(e,n))}(this,t,[e,n])).hide(),r.onLocalCacheChange=r.onLocalCacheChange.bind(r),e.ready((function(){r.initialize()})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lr(e,t)}(t,e),n=t,r=[{key:"createEl",value:function(){return(e=t,n=this,"function"==typeof(r=_r(xr(1&3?e.prototype:e),"createEl",n))?function(e){return r.apply(n,e)}:r)(["div",{className:"vjs-local-cache-indicator",innerHTML:'<div class="vjs-local-cache-indicator-icon">'.concat(Rr,"</div>")},{title:"Streaming from ClickView Local Cache"}]);var e,n,r}},{key:"initialize",value:function(){var e=this;this.localCachePlugin=this.player_.localCache(),this.localCachePlugin&&(this.localCachePlugin.on("localcachechanged",this.onLocalCacheChange),this.player_.on("dispose",(function(){e.localCachePlugin.off("localcachechanged",e.onLocalCacheChange)})),this.onLocalCacheChange())}},{key:"onLocalCacheChange",value:function(){return e=this,t=void 0,n=void 0,r=jr().mark((function e(){return jr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localCachePlugin.getActiveLocalCache();case 2:e.sent?this.show():this.hide();case 4:case"end":return e.stop()}}),e,this)})),new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}));var e,t,n,r}}],r&&Er(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function Mr(e){return Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mr(e)}function Br(){Br=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Mr(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(Mr(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function Dr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ar(r.key),r)}}function Ar(e){var t=function(e){if("object"!=Mr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Mr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mr(t)?t:t+""}function Fr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fr=function(){return!!e})()}function zr(){return zr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Zr(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},zr.apply(null,arguments)}function Zr(e){return Zr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zr(e)}function Vr(e,t){return Vr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vr(e,t)}i.Z.registerComponent("localCacheIndicator",Ir);var Gr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))},Ur=function(e){function t(e,n){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Zr(t),function(e,t){if(t&&("object"==Mr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fr()?Reflect.construct(t,n||[],Zr(e).constructor):t.apply(e,n))}(this,t,[e])).logger_=i.Z.log.createLogger("localcache"),void 0===n)throw Error("no options defined");return r.localCaches_=n.localCacheAddresses.map((function(e){return new gr(e)})),r.player.ready((function(){r.initialize(),n.enabled&&r.enable()})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vr(e,t)}(t,e),n=t,r=[{key:"isEnabled",get:function(){return this.enabled_}},{key:"enable",value:function(){this.enabled_=!0,this.resetActiveLocalCache()}},{key:"disable",value:function(){this.enabled_=!1}},{key:"getActiveLocalCache",value:function(){return this.enabled_?this.activeLocalCache_:null}},{key:"resetActiveLocalCache",value:function(){this.clearActiveLocalCache(),this.activeLocalCache_=this.getActiveLocalCacheInternal()}},{key:"clearActiveLocalCache",value:function(){this.activeLocalCache_&&(this.activeLocalCache_=null,this.onLocalCacheChange(null))}},{key:"removeLocalCache",value:function(e){this.localCaches_=this.localCaches_.filter((function(t){return t!==e}))}},{key:"dispose",value:function(){var e,n,r;(e=t,n=this,"function"==typeof(r=zr(Zr(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}},{key:"initialize",value:function(){this.player.controlBar.addChild("localCacheIndicator")}},{key:"handleNetworkError",value:function(){return Gr(this,void 0,void 0,Br().mark((function e(){var t;return Br().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getActiveLocalCache();case 2:if(!(t=e.sent)){e.next=8;break}return e.next=6,t.ping();case 6:e.sent&&this.removeLocalCache(t);case 8:return this.resetActiveLocalCache(),e.next=11,this.getActiveLocalCache();case 11:return this.resetSource(),e.abrupt("return",!0);case 13:case"end":return e.stop()}}),e,this)})))}},{key:"resetSource",value:function(){for(var e=this.player.qualityLevels(),t=0;t<e.length;t++)e[t].enabled&&(e[t].enabled=!0)}},{key:"getActiveLocalCacheInternal",value:function(){return Gr(this,void 0,void 0,Br().mark((function e(){var t,n,r,i=this;return Br().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],n=function(e){return Gr(i,void 0,void 0,Br().mark((function n(){return Br().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.ping();case 2:if(!n.sent){n.next=4;break}t.push(e);case 4:case"end":return n.stop()}}),n)})))},e.next=4,Promise.all(this.localCaches_.map((function(e){return n(e)})));case 4:if(!(t.length>0)){e.next=8;break}return r=t[0],this.onLocalCacheChange(r),e.abrupt("return",r);case 8:return e.abrupt("return",null);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"onLocalCacheChange",value:function(e){this.logger_.debug("Local Cache changed",e),this.trigger("localcachechanged",{localCache:e});var t=!1;e&&e.playbackProfile&&(this.logger_.debug("Changing active profile for local cache",e.playbackProfile),yr.enableProfileOrNextBest(this.player.qualityLevels(),e.playbackProfile),t=!0),t||this.player.src(this.player.src())}}],r&&Dr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function Kr(e){return Kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kr(e)}function qr(){qr=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Kr(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(Kr(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function Hr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Wr(r.key),r)}}function Wr(e){var t=function(e){if("object"!=Kr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Kr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Kr(t)?t:t+""}function Yr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yr=function(){return!!e})()}function Qr(){return Qr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Jr(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Qr.apply(null,arguments)}function Jr(e){return Jr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Jr(e)}function Xr(e,t){return Xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xr(e,t)}i.Z.registerPlugin("localCache",Ur);var $r=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))},ei=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Jr(t),function(e,t){if(t&&("object"==Kr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Yr()?Reflect.construct(t,n||[],Jr(e).constructor):t.apply(e,n))}(this,t,[e])).playerApi=n.playerApi,r.fileToken=n.fileToken,r.logger=i.Z.log.createLogger("video-signature-expiry-plugin"),r.bindErrorHandlers(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xr(e,t)}(t,e),n=t,r=[{key:"bindErrorHandlers",value:function(){this.onError=this.onError.bind(this),this.player.on("error",this.onError)}},{key:"dispose",value:function(){var e,n,r;this.player.off("error",this.onError),(e=t,n=this,"function"==typeof(r=Qr(Jr(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}},{key:"onError",value:function(){return $r(this,void 0,void 0,qr().mark((function e(){var t,n=this;return qr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=this.player.error().code)===MediaError.MEDIA_ERR_NETWORK||t===MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.player.localCache().getActiveLocalCache();case 5:if(!e.sent){e.next=8;break}return this.callErrorHandler((function(){return n.player.localCache().handleNetworkError()})),e.abrupt("return");case 8:this.callErrorHandler((function(){return n.handleVideoSignatureExpiry()}));case 9:case"end":return e.stop()}}),e,this)})))}},{key:"handleVideoSignatureExpiry",value:function(){return $r(this,void 0,void 0,qr().mark((function e(){var t,n;return qr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.playerApi&&this.fileToken){e.next=2;break}return e.abrupt("return",!1);case 2:if(!(this.refetchedSourcesTimestamp+9e5>Date.now())){e.next=4;break}return e.abrupt("return",!1);case 4:return this.refetchedSourcesTimestamp=Date.now(),t=null,e.prev=6,this.logger.debug("Detected expired mp4 urls, attempting to refetch"),n="".concat(this.playerApi.origin,"/api/files?fileToken=").concat(this.fileToken),e.next=11,kt.get(n);case 11:t=e.sent,e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(6),this.logger.error("Failed to refetch expired mp4 urls"),e.abrupt("return",!1);case 18:return this.logger.debug("Mp4 urls successfully refetched"),this.player.progressiveFiles().repopulateSources(t.progressive.map((function(e){return{id:e.profile,mimeType:e.mimeType,url:e.url}}))),this.fileToken=t.fileToken,e.abrupt("return",!0);case 22:case"end":return e.stop()}}),e,this,[[6,14]])})))}},{key:"callErrorHandler",value:function(e){return $r(this,void 0,void 0,qr().mark((function t(){var n,r,i,o,a=this;return qr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.player.currentTime(),r=!this.player.paused(),i=this.player.playbackRate(),o=function(){a.player.playbackRate(i),a.player.currentTime(n),r&&a.player.play(),a.player.error(null)},this.player.one("loadedmetadata",o),t.next=7,e();case 7:if(!t.sent){t.next=9;break}return t.abrupt("return");case 9:this.player.off("loadedmetadata",o);case 10:case"end":return t.stop()}}),t,this)})))}}],r&&Hr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function ti(e){return ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ti(e)}function ni(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ri(r.key),r)}}function ri(e){var t=function(e){if("object"!=ti(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ti(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ti(t)?t:t+""}function ii(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ii=function(){return!!e})()}function oi(e){return oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oi(e)}function ai(e,t){return ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ai(e,t)}i.Z.registerPlugin("handleNetworkErrors",ei);var ui=i.Z.getPlugin("plugin"),ci="cvplayer-show-subtitles",li="cvplayer-selected-language",si="cvplayer-subtitle-size",fi=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=oi(t),function(e,t){if(t&&("object"==ti(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ii()?Reflect.construct(t,n||[],oi(e).constructor):t.apply(e,n))}(this,t,[e])).options=n,r.initialize(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ai(e,t)}(t,e),n=t,(r=[{key:"initialize",value:function(){this.applyUserPreferences=this.applyUserPreferences.bind(this),this.player.textTracks().length&&(this.bindEventListeners(),this.applyUserPreferences())}},{key:"applyUserPreferences",value:function(){var e=!!this.options.showSubtitles,t=this.safeGet(ci);if("true"===t&&(e=!0),"false"===t&&(e=!1),e){var n=this.guessWhichTrack();n&&(n.mode="showing")}else this.hideSubtitles();var r=this.safeGet(si);r||(r=this.options.subtitleSize),this.player.options_.mobile&&(r="medium"),r&&this.player.textTrackSettings.setSizeSetting(r)}},{key:"safeGet",value:function(e){if(Gt())return Ut(e)}},{key:"onSelectedLanguageChange",value:function(){for(var e,t,n=this.player.textTracks(),r=0;r<n.length;r++){var i=n[r];if("showing"===i.mode)return Kt(ci,"true"),Kt(li,i.language),void(null===(e=this.options.analyticsService)||void 0===e||e.logUserAction({language:i.language},{actionType:it.Vw.Select,entity:it.py.Subtitle,workflowPhase:it.eu.Complete,descriptor:it.DL.On}))}var o;Kt(ci,"false"),o=li,window.localStorage.removeItem(o),null===(t=this.options.analyticsService)||void 0===t||t.logUserAction({language:""},{actionType:it.Vw.Select,entity:it.py.Subtitle,workflowPhase:it.eu.Complete,descriptor:it.DL.Off,eventVersion:it.eq.V3})}},{key:"bindEventListeners",value:function(){var e=this;Gt()&&(this.onSelectedLanguageChange=this.onSelectedLanguageChange.bind(this),this.onChangeSubtitleSize=this.onChangeSubtitleSize.bind(this),this.player.on("cv:languageselected",this.onSelectedLanguageChange),this.player.on("changesubtitlesize",this.onChangeSubtitleSize),this.one("dispose",(function(){e.player.off("cv:languageselected",e.onSelectedLanguageChange),e.player.off("changesubtitlesize",e.onChangeSubtitleSize)})))}},{key:"onChangeSubtitleSize",value:function(){var e=this.player.textTrackSettings.getSizeSetting();Kt(si,e)}},{key:"guessWhichTrack",value:function(){for(var e,t,n=this.safeGet(li)||window.navigator.language,r=this.getLanguageParts(n),i=r.language,o=r.country,a=this.player.textTracks(),u=0;u<a.length;u++){var c=a[u],l=this.getLanguageParts(c.language),s=l.language,f=l.country;if(s===i&&(e=c,f||(t=c),f===o))return e}return t||e||null}},{key:"getLanguageParts",value:function(e){var t=e.toLowerCase().split("-");return{language:t[0],country:t[1]}}},{key:"hideSubtitles",value:function(){for(var e=this.player.textTracks(),t=0;t<e.length;t++)e[t].mode="hidden"}},{key:"previewModeSubtitles",value:function(){var e=this.guessWhichTrack();e&&(e.mode="showing"),this.player.off("changesubtitlesize",this.onChangeSubtitleSize),this.player.textTrackSettings.setSizeSetting("large"),this.player.on("changesubtitlesize",this.onChangeSubtitleSize)}}])&&ni(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ui);function pi(e){return pi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pi(e)}function hi(){hi=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==pi(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(pi(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function yi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vi(r.key),r)}}function vi(e){var t=function(e){if("object"!=pi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=pi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pi(t)?t:t+""}function di(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(di=function(){return!!e})()}function mi(e){return mi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mi(e)}function bi(e,t){return bi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bi(e,t)}i.Z.registerPlugin("persistSubtitleSettingsPlugin",fi);var gi=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))},wi=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=mi(t),function(e,t){if(t&&("object"==pi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,di()?Reflect.construct(t,n||[],mi(e).constructor):t.apply(e,n))}(this,t,[e])).options=n,r.player.ready((function(){return r.initialize()})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bi(e,t)}(t,e),n=t,(r=[{key:"initialize",value:function(){return gi(this,void 0,void 0,hi().mark((function e(){var t,n,r,i,o=this;return hi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getActiveLocalCache();case 2:if(t=e.sent,(n=t?this.options.playbackProfileLocalCache:this.options.playbackProfile)||(n="1080"),Gt()&&(r=Ut(this.getStorageKey(!!t)))&&(n=r),i=this.player.qualityLevels(),(null==t?void 0:t.playbackProfile)||yr.enableProfileOrNextBest(i,n),Gt()){e.next=10;break}return e.abrupt("return");case 10:this.onQualityLevelsChange=this.onQualityLevelsChange.bind(this),i.on("change",this.onQualityLevelsChange),this.on("dispose",(function(){i.off("change",o.onQualityLevelsChange)}));case 13:case"end":return e.stop()}}),e,this)})))}},{key:"onQualityLevelsChange",value:function(){var e;return gi(this,void 0,void 0,hi().mark((function t(){var n,r,i;return hi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.isLocalCacheActive();case 2:n=t.sent,r=this.player.qualityLevels(),i=r[r.selectedIndex],Kt(this.getStorageKey(n),i.id),null===(e=this.options.analyticsService)||void 0===e||e.logUserAction({quality:i.id},{actionType:it.Vw.Select,workflowPhase:it.eu.Complete,descriptor:it.UX.ChangeResolution,entity:it.py.Resolution,eventVersion:it.eq.V3});case 7:case"end":return t.stop()}}),t,this)})))}},{key:"isLocalCacheActive",value:function(){return gi(this,void 0,void 0,hi().mark((function e(){return hi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.player.localCache().getActiveLocalCache();case 2:return e.abrupt("return",!!e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"getActiveLocalCache",value:function(){return this.player.localCache().getActiveLocalCache()}},{key:"getStorageKey",value:function(e){return e?"cvplayer-localcache-playback-quality":"cvplayer-playback-quality"}}])&&yi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function Oi(e){return Oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oi(e)}function Si(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ki(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ni(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ji(r.key),r)}}function Pi(e,t,n){return t&&Ni(e.prototype,t),n&&Ni(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ji(e){var t=function(e){if("object"!=Oi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Oi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Oi(t)?t:t+""}function Ei(e,t,n){return t=Ti(t),function(e,t){if(t&&("object"==Oi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ci()?Reflect.construct(t,n||[],Ti(e).constructor):t.apply(e,n))}function Ci(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ci=function(){return!!e})()}function Ti(e){return Ti=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ti(e)}function _i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xi(e,t)}function xi(e,t){return xi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xi(e,t)}i.Z.registerPlugin("persistQualitySettingsPlugin",wi);var Li=i.Z.getComponent("Component"),Ri=function(e){function t(e,n){return ki(this,t),Ei(this,t,[e,n])}return _i(t,e),Pi(t,[{key:"createEl",value:function(){return i.Z.dom.createEl("div",{className:"cv-progress-reporter-item"})}},{key:"update",value:function(){var e=this.options_.event,t=this.player_.duration(),n=(e.end.time-e.start.time)/t;this.el_.style.width=100*n+"%";var r=e.start.time/t;this.el_.style.left=100*r+"%"}}])}(Li),Ii=function(e){function t(){var e;return ki(this,t),(e=Ei(this,t,arguments)).events_=[],e}return _i(t,e),Pi(t,[{key:"update",value:function(){for(var e=this,t=this.children(),n=t.length;n>0;n--)this.removeChild(t[n]);this.events_.forEach((function(t){var n=new Ri(e.player(),{event:t});e.addChild(n),n.update()}))}},{key:"addEvents",value:function(e){var t,n;(t=this.events_).push.apply(t,function(e){if(Array.isArray(e))return Si(e)}(n=e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return Si(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Si(e,t):void 0}}(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.")}()),this.update()}},{key:"createEl",value:function(){return i.Z.dom.createEl("div",{className:"cv-progress-reporter-display"})}}])}(Li);function Mi(e){return Mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mi(e)}function Bi(e,t,n){return(t=Ai(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Di(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ai(r.key),r)}}function Ai(e){var t=function(e){if("object"!=Mi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Mi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mi(t)?t:t+""}function Fi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fi=function(){return!!e})()}function zi(e){return zi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zi(e)}function Zi(e,t){return Zi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zi(e,t)}var Vi=i.Z.getPlugin("plugin"),Gi="play",Ui="playing",Ki="pause",qi="seekstart",Hi="ended",Wi="pausedseek",Yi=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=zi(t),function(e,t){if(t&&("object"==Mi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fi()?Reflect.construct(t,n||[],zi(e).constructor):t.apply(e,n))}(this,t,[e,n])).eventBuffer=[],r.latestTime=0,r.lastPlayingTime=0,r.isPlaying=!1,r.isSeeking=!1,r.hasEnded=!1,r.shouldLogPlayOnTimeUpdate=!1,r.options=n,r.player.ready((function(){return r.initialize()})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zi(e,t)}(t,e),n=t,r=[{key:"initialize",value:function(){this.validateOptions(),this.bindListeners(),this.startInterval(),this.addEasterEgg()}},{key:"validateOptions",value:function(){if("function"!=typeof this.options.onFlush)throw new Error("Please provide the onFlush option")}},{key:"bindListeners",value:function(){var e=this,t=Bi(Bi(Bi(Bi(Bi(Bi({},Gi,(function(){return e.onPlay()})),Ki,(function(){return e.onPause()})),"timeupdate",(function(){return e.onTimeUpdate()})),"seeking",(function(){return e.onSeeking()})),Hi,(function(){return e.onEnded()})),Ui,(function(){return e.onPlaying()})),n=Object.keys(t);n.forEach((function(n){return e.player.on(n,t[n])})),this.one("dispose",(function(){n.forEach((function(n){return e.player.off(n,t[n])}))}))}},{key:"startInterval",value:function(){var e=this,t=this.options.interval||5e3;this.interval=window.setInterval((function(){return e.flushBuffer()}),t),this.player.one("dispose",(function(){return window.clearInterval(e.interval)}))}},{key:"addEasterEgg",value:function(){var e,t,n=this,r="",i=function(t){"ArrowUpArrowUpArrowDownArrowDownArrowLeftArrowRightArrowLeftArrowRightba"===(r+=t.key)&&n.addDisplay(),window.clearTimeout(e),e=window.setTimeout((function(){r=""}),500)},o=!1,a=function(){o=!0,t=window.setTimeout((function(){o&&n.addDisplay()}),1e4)};function u(){o=!1,window.clearTimeout(t)}this.player.el().addEventListener("keyup",i);var c=this.player.getChild("Collapserator").getChild("PlayToggle");c.on("touchstart",a),c.on("touchend",u),this.player.one("dispose",(function(){var e,t;null===(t=null===(e=n.player)||void 0===e?void 0:e.el())||void 0===t||t.removeEventListener("keyup",i),c.off("touchstart",a),c.off("touchend",u)}))}},{key:"addDisplay",value:function(){var e=this;this.progressReporterDisplay||(this.progressReporterDisplay=new Ii(this.player),this.player.addChild(this.progressReporterDisplay),this.player.options_.inactivityTimeout=0,this.player.one("dispose",(function(){e.progressReporterDisplay=void 0})))}},{key:"onPlay",value:function(){return this.isPlaying=!0,this.isSeeking?(this.logEvent("seekend"),void(this.isSeeking=!1)):this.hasEnded?(this.shouldLogPlayOnTimeUpdate=!0,void(this.hasEnded=!1)):void this.logEvent(Gi)}},{key:"onPause",value:function(){var e=this;this.isSeeking||(this.pauseTimeout=window.setTimeout((function(){e.isPlaying=!1,e.logEvent(Ki),delete e.pauseTimeout}),50))}},{key:"onTimeUpdate",value:function(){this.shouldLogPlayOnTimeUpdate&&(this.shouldLogPlayOnTimeUpdate=!1,this.logEvent(Gi)),this.isPlaying&&!this.isSeeking&&this.logEvent(Ui)}},{key:"onSeeking",value:function(){this.pauseTimeout&&(this.latestTime=this.previousLatestTime,window.clearTimeout(this.pauseTimeout),delete this.pauseTimeout),this.isPlaying||this.logEvent(Wi),!this.isSeeking&&this.isPlaying&&(this.isSeeking=!0,this.logEvent(qi))}},{key:"onEnded",value:function(){this.hasEnded=!0,this.logEvent(Hi)}},{key:"onPlaying",value:function(){this.isSeeking=!1,this.isPlaying=!0}},{key:"logEvent",value:function(e){if(this.player){var t=this.player.currentTime();e===qi&&(t=this.latestTime),this.previousLatestTime=this.latestTime,this.latestTime=this.player.currentTime(),this.eventBuffer.push({time:t,type:e})}}},{key:"shouldUseCarriedOverTime",value:function(e){return this.lastPlayingTime&&(e===Ui||e===Gi)}},{key:"shouldSaveCarriedOverTime",value:function(e){return e===Ui||e===Ki}},{key:"shouldClearCarriedOverTime",value:function(e){return e===Hi||e===Wi}},{key:"flushBuffer",value:function(){for(var e,t,n=[],r={};this.eventBuffer.length;){var i=this.eventBuffer.shift();this.shouldClearCarriedOverTime(i.type)?delete this.lastPlayingTime:r.start?i.type===Ui&&this.eventBuffer.length>0||(this.shouldSaveCarriedOverTime(i.type)&&(this.lastPlayingTime=i.time),r.end=i,n.push(r),r={}):(this.shouldUseCarriedOverTime(i.type)&&(i.time=this.lastPlayingTime,delete this.lastPlayingTime),r.start=i)}this.eventBuffer=[],n.length&&this.validateEvents(n)&&(this.options.onFlush(n),null===(e=this.player)||void 0===e||e.trigger("progressflush"),null===(t=this.progressReporterDisplay)||void 0===t||t.addEvents(n))}},{key:"validateEvents",value:function(e){var t=0;e.forEach((function(e){t+=e.end.time-e.start.time}));var n=this.options.interval||5e3;return n/=1e3,n+=.5,n*=this.player.playbackRate(),t<n}}],r&&Di(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Vi);function Qi(e){return Qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qi(e)}function Ji(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Xi(r.key),r)}}function Xi(e){var t=function(e){if("object"!=Qi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Qi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qi(t)?t:t+""}function $i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($i=function(){return!!e})()}function eo(e){return eo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},eo(e)}function to(e,t){return to=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},to(e,t)}i.Z.registerPlugin("progressReporterPlugin",Yi);var no=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=eo(t),function(e,t){if(t&&("object"==Qi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$i()?Reflect.construct(t,n||[],eo(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&to(e,t)}(t,e),n=t,(r=[{key:"createEl",value:function(){return i.Z.dom.createEl("span",{innerHTML:'<span class="vjs-icon-placeholder"></span>',className:"cv-drag-handle vjs-control vjs-button"},{})}}])&&Ji(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component")),ro=["top","left","right","bottom"],io={top:"Top",left:"Left",right:"Right",bottom:"Bottom"};function oo(e){return oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oo(e)}function ao(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lo(r.key),r)}}function co(e,t,n){return t&&uo(e.prototype,t),n&&uo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lo(e){var t=function(e){if("object"!=oo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=oo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oo(t)?t:t+""}function so(e,t,n){return t=ho(t),function(e,t){if(t&&("object"==oo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fo()?Reflect.construct(t,n||[],ho(e).constructor):t.apply(e,n))}function fo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fo=function(){return!!e})()}function po(){return po="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ho(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},po.apply(null,arguments)}function ho(e){return ho=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ho(e)}function yo(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vo(e,t)}function vo(e,t){return vo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vo(e,t)}var mo=i.Z.getComponent("Component"),bo=function(e){function t(e,n){var r;return ao(this,t),(r=so(this,t,[e,n])).bindEventListeners(),r}return yo(t,e),co(t,[{key:"createEl",value:function(){return(e=t,n=this,"function"==typeof(r=po(ho(1&3?e.prototype:e),"createEl",n))?function(e){return r.apply(n,e)}:r)(["div",{},{class:"cv-drop-target cv-drop-".concat(this.options_.side)}]);var e,n,r}},{key:"bindEventListeners",value:function(){var e=this,t=this.el(),n=function(t){t.preventDefault(),t.dataTransfer.dropEffect="move",e.addClass("cv-drag-over")},r=function(t){t.preventDefault(),e.removeClass("cv-drag-over"),e.player_.whiteboardModePlugin().setWhiteboardMode(e.options_.side)},i=function(){e.removeClass("cv-drag-over")};t.addEventListener("dragover",n),t.addEventListener("drop",r),t.addEventListener("dragleave",i),this.on("dispose",(function(){t.removeEventListener("dragover",n),t.removeEventListener("drop",r),t.removeEventListener("dragleave",i)}))}}])}(mo),go=function(e){function t(e,n){var r;return ao(this,t),(r=so(this,t,[e,n])).addChildren(),r}return yo(t,e),co(t,[{key:"addChildren",value:function(){var e=this;ro.forEach((function(t){e.addChild(new bo(e.player_,{side:t}))}))}}])}(mo);function wo(e){return wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wo(e)}function Oo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,So(r.key),r)}}function So(e){var t=function(e){if("object"!=wo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=wo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==wo(t)?t:t+""}function ko(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ko=function(){return!!e})()}function No(e){return No=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},No(e)}function Po(e,t){return Po=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Po(e,t)}var jo=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=No(t),function(e,t){if(t&&("object"==wo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ko()?Reflect.construct(t,n||[],No(e).constructor):t.apply(e,n))}(this,t,[e,n])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Po(e,t)}(t,e),n=t,(r=[{key:"handleClick",value:function(){this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)}}])&&Oo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("MenuItem"));function Eo(e){return Eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eo(e)}function Co(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,To(r.key),r)}}function To(e){var t=function(e){if("object"!=Eo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Eo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Eo(t)?t:t+""}function _o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_o=function(){return!!e})()}function xo(){return xo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Lo(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},xo.apply(null,arguments)}function Lo(e){return Lo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Lo(e)}function Ro(e,t){return Ro=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ro(e,t)}var Io=i.Z.getComponent("MenuButton"),Mo=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Lo(t),function(e,t){if(t&&("object"==Eo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,_o()?Reflect.construct(t,n||[],Lo(e).constructor):t.apply(e,n))}(this,t,arguments)).alwaysCollapsed=!0,e.isCollapsed=!1,e.isCollabsible=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ro(e,t)}(t,e),n=t,r=[{key:"createItems",value:function(){var e=this,t=this.player_.whiteboardModePlugin().side,n=[new j(this.player_,{label:"Video Controls"})];return ro.forEach((function(r){n.push(new jo(e.player_,{side:r,label:io[r],selectable:!0,multiSelectable:!1,selected:r===t}))})),n}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat((e=t,n=this,"function"==typeof(r=xo(Lo(1&3?e.prototype:e),"buildWrapperCSSClass",n))?function(e){return r.apply(n,e)}:r)([]));var e,n,r}},{key:"getCollabsibleName",value:function(){return"Video Controls"}},{key:"getCollabsibleValue",value:function(){var e=this.player_.whiteboardModePlugin().side;return io[e]}},{key:"showInCollabsibleMenu",value:function(){return!!this.player_.whiteboardModePlugin().isEnabled()&&this.player_.isFullscreen()}},{key:"showCollapsibleMenu",value:function(){Io.prototype.handleClick.apply(this)}}],r&&Co(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Io);function Bo(e){return Bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bo(e)}function Do(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ao(r.key),r)}}function Ao(e){var t=function(e){if("object"!=Bo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Bo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Bo(t)?t:t+""}function Fo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fo=function(){return!!e})()}function zo(e){return zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zo(e)}function Zo(e,t){return Zo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zo(e,t)}var Vo="cv-whiteboard-side",Go=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=zo(t),function(e,t){if(t&&("object"==Bo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fo()?Reflect.construct(t,n||[],zo(e).constructor):t.apply(e,n))}(this,t,[e])).side="bottom",n.enabled=!0,n.player.ready((function(){n.initialize()})),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zo(e,t)}(t,e),n=t,r=[{key:"initialize",value:function(){if(!this.player.options_.mobile){if(Gt()){var e=Ut(Vo);e&&(this.side=e)}this.initCollapserator(),this.initDragTargets(),this.initFullscreenListener()}}},{key:"initCollapserator",value:function(){var e,t,n=this;if(!(null===(t=(e=this.player).viewTranscriptPlugin)||void 0===t?void 0:t.call(e).isTranscriptOn())){var r=this.player.getChild("collapserator");this.dragHandle=new no(this.player),this.button=new Mo(this.player),r.addChild(this.dragHandle),r.addChild(this.button),this.player.trigger("cv-updatecog");var i=function(){n.player.isFullscreen()&&r.el().setAttribute("draggable","true")},o=function(){n.player.isFullscreen()&&r.el().setAttribute("draggable","false")},a=function(e){n.player.isFullscreen()&&(n.player.addClass("cv-dragging"),e.dataTransfer.setData("text/plain","handle"))},u=function(){n.player.isFullscreen()&&(n.player.removeClass("cv-dragging"),r.el().setAttribute("draggable","false"))};this.dragHandle.el().addEventListener("mousedown",i),this.dragHandle.el().addEventListener("mouseup",o),r.el().addEventListener("dragstart",a),r.el().addEventListener("dragend",u),this.on("dispose",(function(){n.dragHandle.el().removeEventListener("mousedown",i),n.dragHandle.el().removeEventListener("mouseup",o),r.el().removeEventListener("dragstart",a),r.el().removeEventListener("dragend",u)}))}}},{key:"initDragTargets",value:function(){this.player.addChild(new go(this.player))}},{key:"initFullscreenListener",value:function(){var e=this;this.update=this.update.bind(this),this.player.on("fullscreenchange",this.update),this.player.on("cv-transcript-toggle",this.update),this.one("dispose",(function(){e.player.off("fullscreenchange",e.update)}))}},{key:"setWhiteboardMode",value:function(e){this.side=e,this.button.update(),Gt()&&Kt(Vo,e),this.player.trigger("cv-whiteboard-change"),this.update()}},{key:"setEnabled",value:function(e){this.enabled=e,this.update()}},{key:"isEnabled",value:function(){return this.enabled}},{key:"getSide",value:function(){return this.isEnabled()?this.side:"bottom"}},{key:"update",value:function(){var e,t;if(this.player.removeClass("cv-whiteboard-top"),this.player.removeClass("cv-whiteboard-left"),this.player.removeClass("cv-whiteboard-right"),i.Z.dom.removeClass(window.document.documentElement,"cv-whiteboard-html-font-size"),this.player.trigger("resizemenus"),this.player.trigger("cv-updatecog"),this.isEnabled()){null===(t=this.dragHandle)||void 0===t||t.show();var n=this.getSide();this.player.isFullscreen()&&"bottom"!==n&&(this.player.addClass("cv-whiteboard-".concat(n)),i.Z.dom.addClass(window.document.documentElement,"cv-whiteboard-html-font-size"))}else null===(e=this.dragHandle)||void 0===e||e.hide()}}],r&&Do(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function Uo(e){return Uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uo(e)}function Ko(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qo(r.key),r)}}function qo(e){var t=function(e){if("object"!=Uo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Uo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Uo(t)?t:t+""}function Ho(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ho=function(){return!!e})()}function Wo(e){return Wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wo(e)}function Yo(e,t){return Yo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yo(e,t)}i.Z.registerPlugin("whiteboardModePlugin",Go);var Qo=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Wo(t),function(e,t){if(t&&("object"==Uo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ho()?Reflect.construct(t,n||[],Wo(e).constructor):t.apply(e,n))}(this,t,[e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yo(e,t)}(t,e),n=t,(r=[{key:"deferMenu",value:function(){var e={subtitles:this.buildSubtitles(),qualities:this.buildQualities(),playbackSpeeds:this.buildPlaybackSpeeds()};this.player.trigger("cv-defer-menus",e)}},{key:"buildSubtitles",value:function(){for(var e=[],t=!1,n=this.player.textTracks(),r=0;r<n.length;r++){var i=n[r],o="showing"===i.mode;e.unshift({id:i.label,name:i.label,selected:o}),o&&(t=!0)}return e.push({id:null,name:"Off",selected:!t}),e}},{key:"buildQualities",value:function(){for(var e=[],t=this.player.qualityLevels(),n=0;n<t.length;n++){var r=t[n];e.push({id:r.id,name:r.id+"p",selected:r.enabled})}return e}},{key:"buildPlaybackSpeeds",value:function(){var e=this.player.playbackRate();return this.player.options_.playbackRates.map((function(t){return{id:t,name:t+"x"+(1===t?" (Normal)":""),selected:e===t}}))}}])&&Ko(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));i.Z.registerPlugin("deferMenusPlugin",Qo);var Jo="PreventScrubbingTooltip";function Xo(e){return Xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xo(e)}function $o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ea(r.key),r)}}function ea(e){var t=function(e){if("object"!=Xo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Xo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xo(t)?t:t+""}function ta(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ta=function(){return!!e})()}function na(e,t,n,r){var i=ra(ia(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function ra(){return ra="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ia(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},ra.apply(null,arguments)}function ia(e){return ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ia(e)}function oa(e,t){return oa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oa(e,t)}var aa=i.Z.getComponent("Component"),ua="cv-prevent-scrubbing-tooltip-show",ca="cv-prevent-scrubbing-tooltip-remove-transition",la=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=ia(t),function(e,t){if(t&&("object"==Xo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ta()?Reflect.construct(t,n||[],ia(e).constructor):t.apply(e,n))}(this,t,arguments)).isShowing=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oa(e,t)}(t,e),n=t,r=[{key:"buildCSSClass",value:function(){return"cv-prevent-scrubbing-tooltip ".concat(na(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,r){return na(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass(),innerText:"No skipping ahead!"}),r])}},{key:"show",value:function(){this.isShowing||(this.player_.userActive(!0),this.addClass(ua),this.isShowing=!0)}},{key:"hide",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isShowing&&(t&&(this.addClass(ca),window.requestAnimationFrame((function(){e.removeClass(ca)}))),this.player_.userActive(!1),this.removeClass(ua),this.isShowing=!1)}}],r&&$o(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(aa);function sa(e){return sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sa(e)}function fa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pa(r.key),r)}}function pa(e){var t=function(e){if("object"!=sa(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=sa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sa(t)?t:t+""}function ha(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ha=function(){return!!e})()}function ya(){return ya="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=va(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},ya.apply(null,arguments)}function va(e){return va=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},va(e)}function da(e,t){return da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},da(e,t)}i.Z.registerComponent(Jo,la);var ma=function(e){function t(e,n){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=va(t),function(e,t){if(t&&("object"==sa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ha()?Reflect.construct(t,n||[],va(e).constructor):t.apply(e,n))}(this,t,[e])).isEnabled=!1,r.isPreviewing=!1;var i=null!=n?n:{},o=i.furthestVisitedTime,a=void 0===o?0:o,u=i.isEnabled,c=void 0!==u&&u;return r.playerCurrentTimeFn=r.player.currentTime.bind(e),r.player.currentTime=r.currentTime.bind(r),r.onTimeUpdate=r.onTimeUpdate.bind(r),r.furthestVisitedTime=a,r.isEnabled=c,c&&r.enable(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&da(e,t)}(t,e),n=t,r=[{key:"dispose",value:function(){var e,n,r;this.player.currentTime=this.playerCurrentTimeFn,this.isEnabled&&(this.disable(),(e=t,n=this,"function"==typeof(r=ya(va(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([]))}},{key:"togglePreview",value:function(e){if(e){if(this.configurePreview(),this.isEnabled)return;this.enable(),this.isPreviewing=!0}else this.disable(),this.isPreviewing=!1}},{key:"configurePreview",value:function(){this.player.currentTime(0),this.furthestVisitedTime=0}},{key:"enable",value:function(){this.player.on("timeupdate",this.onTimeUpdate),this.getProgressControl().addChild(Jo),this.isEnabled=!0}},{key:"disable",value:function(){this.player.off("timeupdate",this.onTimeUpdate),this.getProgressControl().removeChild(this.getPreventScrubbingTooltip()),this.isEnabled=!1}},{key:"getProgressControl",value:function(){return this.player.controlBar.getChild("progressControl")}},{key:"onTimeUpdate",value:function(){var e=this.playerCurrentTimeFn();e>this.furthestVisitedTime&&(this.furthestVisitedTime=e)}},{key:"currentTime",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];if("number"!=typeof e)return this.playerCurrentTimeFn.apply(this,[e].concat(r));if(this.isEnabled){var o=this.getPreventScrubbingTooltip(),a=null===(t=this.getSeekBar())||void 0===t?void 0:t.getChild("MouseTimeDisplay");if(e>this.furthestVisitedTime)return o.show(),Q(o.hide,1e3,!1,o)(),null==a||a.hide(),void this.playerCurrentTimeFn(this.furthestVisitedTime,r);null==a||a.show(),o.hide(!0),this.playerCurrentTimeFn(e,r)}else this.playerCurrentTimeFn.apply(this,[e].concat(r))}},{key:"getPreventScrubbingTooltip",value:function(){return this.getProgressControl().getChild(Jo)}},{key:"getSeekBar",value:function(){var e;return null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar")}}],r&&fa(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function ba(e){return ba="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ba(e)}function ga(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wa(r.key),r)}}function wa(e){var t=function(e){if("object"!=ba(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ba(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ba(t)?t:t+""}function Oa(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Oa=function(){return!!e})()}function Sa(e){return Sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sa(e)}function ka(e,t){return ka=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ka(e,t)}i.Z.registerPlugin("preventScrubbingPlugin",ma);var Na=i.Z.getComponent("Button"),Pa="cv-muted",ja=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=Sa(t),function(e,t){if(t&&("object"==ba(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Oa()?Reflect.construct(t,n||[],Sa(e).constructor):t.apply(e,n))}(this,t,[e])).update(),n.update=n.update.bind(n),e.on("volumechange",n.update),e.on("dispose",(function(){return e.off("volumechange",n.update)})),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ka(e,t)}(t,e),n=t,(r=[{key:"handleClick",value:function(){this.player_.muted(!this.player_.muted()),this.update()}},{key:"update",value:function(){this.player_.muted()?this.addClass(Pa):this.removeClass(Pa)}},{key:"buildCSSClass",value:function(){return"cv-mute-button cv-muted"}}])&&ga(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Na);function Ea(e){return Ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ea(e)}function Ca(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ta(r.key),r)}}function Ta(e){var t=function(e){if("object"!=Ea(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ea(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ea(t)?t:t+""}function _a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_a=function(){return!!e})()}function xa(){return xa="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=La(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},xa.apply(null,arguments)}function La(e){return La=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},La(e)}function Ra(e,t){return Ra=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ra(e,t)}i.Z.registerComponent("muteButton",ja),ja.prototype.controlText_="Mute";var Ia,Ma=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=La(t),function(e,t){if(t&&("object"==Ea(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,_a()?Reflect.construct(t,n||[],La(e).constructor):t.apply(e,n))}(this,t,[e,n]))._onClickHandler=n.onClickHandler,r.bindEventListeners(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ra(e,t)}(t,e),n=t,r=[{key:"createEl",value:function(){return i.Z.dom.createEl("div",{className:"cv-player-overlay"})}},{key:"handleClick",value:function(e){"function"==typeof this._onClickHandler&&(e.stopImmediatePropagation(),this._onClickHandler())}},{key:"dispose",value:function(){var e,n,r;this.off("click",this.handleClick),(e=t,n=this,"function"==typeof(r=xa(La(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}},{key:"bindEventListeners",value:function(){this.on("click",this.handleClick)}}],r&&Ca(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function Ba(e){return Ba="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ba(e)}function Da(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Aa(r.key),r)}}function Aa(e){var t=function(e){if("object"!=Ba(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ba(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ba(t)?t:t+""}function Fa(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fa=function(){return!!e})()}function za(e){return za=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},za(e)}function Za(e,t){return Za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Za(e,t)}i.Z.registerComponent("playerOverlay",Ma),function(e){e.Default="play",e.Hover="hover"}(Ia||(Ia={}));var Va=i.Z.getPlugin("plugin"),Ga="cv-preview-mode",Ua=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=za(t),function(e,t){if(t&&("object"==Ba(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fa()?Reflect.construct(t,n||[],za(e).constructor):t.apply(e,n))}(this,t,[e])).buttonAdded=!1,n.mode=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Za(e,t)}(t,e),n=t,(r=[{key:"getMode",value:function(){return this.mode}},{key:"setPlayerMode",value:function(e,t){var n=this.mode;if(this.mode=e,e===Ia.Hover)return this.buttonAdded||this.addButtons(t),this.player.addClass(Ga),this.enableSubtites(),this.mute(),this.removeActivityTimeout(),void this.player.trigger("resize");n===Ia.Hover&&(this.player.removeClass(Ga),this.disableSubtitles(),this.unmute(),this.restoreActivityTimeout(),this.player.trigger("resize"))}},{key:"addButtons",value:function(e){var t=new ja(this.player),n=new Ma(this.player,{onClickHandler:e});this.player.addChild(t),this.player.addChild(n),this.buttonAdded=!0}},{key:"enableSubtites",value:function(){var e=this;this.player.dataLoaded((function(){return e.player.persistSubtitleSettingsPlugin().previewModeSubtitles()}))}},{key:"disableSubtitles",value:function(){var e=this;this.player.dataLoaded((function(){return e.player.persistSubtitleSettingsPlugin().applyUserPreferences()}))}},{key:"mute",value:function(){var e=this;this.player.ready((function(){e.player.persistVolumePlugin().disable(),e.player.muted(!0)}))}},{key:"unmute",value:function(){var e=this;this.player.ready((function(){e.player.persistVolumePlugin().applyUserPreferences(),e.player.persistVolumePlugin().enable()}))}},{key:"removeActivityTimeout",value:function(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}},{key:"restoreActivityTimeout",value:function(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}}])&&Da(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Va);function Ka(e){return Ka="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ka(e)}function qa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ha(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ya(r.key),r)}}function Wa(e,t,n){return t&&Ha(e.prototype,t),n&&Ha(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ya(e){var t=function(e){if("object"!=Ka(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ka(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ka(t)?t:t+""}function Qa(e,t,n){return t=Xa(t),function(e,t){if(t&&("object"==Ka(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ja()?Reflect.construct(t,n||[],Xa(e).constructor):t.apply(e,n))}function Ja(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ja=function(){return!!e})()}function Xa(e){return Xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xa(e)}function $a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eu(e,t)}function eu(e,t){return eu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eu(e,t)}i.Z.registerPlugin("playerModePlugin",Ua);var tu=i.Z.getComponent("Component"),nu=i.Z.getComponent("ClickableComponent"),ru=function(e){function t(){return qa(this,t),Qa(this,t,arguments)}return $a(t,e),Wa(t,[{key:"createEl",value:function(){return tu.prototype.createEl.call(this,"span",{className:"cv-favourite-button-svg",innerHTML:"<span class='cv-favourite-heart'>".concat('\n <svg version="1.1" viewBox="0 0 24 24">\n <path id="Heart-Filled" d="m18.833 5.9735c-0.78916-0.95022-1.8839-1.4735-3.0826-1.4735-1.6859 0-2.7532 1.0685-3.3517 1.9648-0.15528 0.2326-0.28738 0.46582-0.39828 0.68529-0.11091-0.21946-0.24297-0.45269-0.39828-0.68529-0.5985-0.89636-1.6658-1.9648-3.3517-1.9648-1.1987 0-2.2935 0.52333-3.0827 1.4735-0.75275 0.90644-1.1673 2.1204-1.1673 3.4183 0 1.4128 0.51978 2.7268 1.6358 4.1353 0.99741 1.2588 2.4323 2.5564 4.0939 4.0589 0.61916 0.5599 1.2594 1.1389 1.9411 1.7718l0.02047 0.01903c0.08837 0.08211 0.19856 0.12313 0.30875 0.12313s0.22038-0.04105 0.30875-0.12313l0.02047-0.01903c0.68166-0.63289 1.3219-1.2119 1.9412-1.7719 1.6615-1.5024 3.0964-2.8 4.0938-4.0588 1.116-1.4085 1.6358-2.7225 1.6358-4.1353 0-1.2979-0.41459-2.5119-1.1674-3.4183z"/>\n </svg>\n',"</span><span class='cv-favourite-outline'>").concat('\n <svg version="1.1" viewBox="0 0 24 24">\n <path id="Shape" d="m18.959 5.9741c-0.76992-0.92705-1.9357-1.5351-3.1052-1.5351-1.6448 0-2.8808 0.74937-3.4647 1.6238-0.15149 0.22693-0.28074 0.55125-0.38894 0.76537-0.10821-0.21411-0.23718-0.53844-0.38871-0.76537-0.58391-0.87451-1.8205-1.6238-3.4653-1.6238-1.1695 0-2.2376 0.60808-3.0075 1.5351-0.7344 0.88434-1.1388 1.9712-1.1388 3.2374 0 1.3784 0.50711 3.0509 1.5959 4.4251 0.97309 1.2281 2.373 2.4941 3.9941 3.9599 0.60406 0.54625 1.2285 1.1104 1.8936 1.7278l0.01997 0.01934c0.08622 0.08011 0.38931 0.21727 0.49681 0.21727 0.1075 0 0.40992-0.13796 0.49614-0.21804l0.0201-0.0178c0.66504-0.61746 1.2897-1.1824 1.8939-1.7287 1.621-1.4658 3.0209-2.7317 3.994-3.9598 1.0888-1.3742 1.5955-3.0467 1.5955-4.4251 0-1.2663-0.30646-2.3531-1.0409-3.2374zm-5.337 10.688c-0.51948 0.47226-1.0567 0.95549-1.6218 1.4768-0.56507-0.52124-1.101-1.0059-1.6219-1.4769-3.1725-2.8689-5.2684-4.7641-5.2684-7.2556 0-1.0298 0.32333-1.9863 0.91044-2.6933 0.59385-0.71497 1.4183-1.1088 2.3213-1.1088 1.254 0 2.0645 0.81976 2.5237 1.5074 0.41187 0.61679 0.62678 1.2385 0.70006 1.4772 0.06131 0.19978 0.23683 0.33499 0.43482 0.33499s0.37351-0.1352 0.43482-0.33499c0.07329-0.23867 0.28821-0.86044 0.70006-1.4773 0.45914-0.68766 1.2698-1.5074 2.5237-1.5074 0.90309 0 1.7274 0.39377 2.3213 1.1088 0.58714 0.70695 0.91047 1.6634 0.91047 2.6933 0 2.4914-2.1035 4.3783-5.2685 7.2557z" stroke-width=".97562"/>\n </svg>\n',"</span>")})}}])}(tu),iu=function(e){function t(e,n){var r;return qa(this,t),(r=Qa(this,t,[e,n])).isFavourited=n.isFavourited,r.renderIcon(),r.update(),r}return $a(t,e),Wa(t,[{key:"renderIcon",value:function(){this.icon&&this.removeChild(this.icon),this.icon=new ru(this.player_),this.addChild(this.icon)}},{key:"update",value:function(){this.isFavourited?this.addClass("cv-favourited"):this.removeClass("cv-favourited")}},{key:"createEl",value:function(e,t,n){t=Object.assign({innerHTML:"",className:"cv-favourite-button"},t),n=Object.assign({type:"button"},n);var r=tu.prototype.createEl.call(this,"button",t,n);return this.createControlTextEl(r),r}},{key:"handleClick",value:function(){this.isFavourited=!this.isFavourited,this.update(),this.options_.onClick&&this.options_.onClick(this.isFavourited)}}])}(nu);function ou(e){return ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ou(e)}function au(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,uu(r.key),r)}}function uu(e){var t=function(e){if("object"!=ou(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ou(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ou(t)?t:t+""}function cu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cu=function(){return!!e})()}function lu(e){return lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lu(e)}function su(e,t){return su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},su(e,t)}iu.prototype.controlText_="Favourite";var fu=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=lu(t),function(e,t){if(t&&("object"==ou(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,cu()?Reflect.construct(t,n||[],lu(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&su(e,t)}(t,e),n=t,(r=[{key:"setFavourite",value:function(e,t){if(!this.initialized){var n=new iu(this.player,{isFavourited:e,onClick:t});this.player.addChild(n),this.initialized=!0}}}])&&au(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function pu(e){return pu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pu(e)}function hu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,yu(r.key),r)}}function yu(e){var t=function(e){if("object"!=pu(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=pu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pu(t)?t:t+""}function vu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vu=function(){return!!e})()}function du(e,t,n,r){var i=mu(bu(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function mu(){return mu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=bu(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},mu.apply(null,arguments)}function bu(e){return bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bu(e)}function gu(e,t){return gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gu(e,t)}i.Z.registerPlugin("favouritePlugin",fu);var wu=i.Z.getComponent("MenuButton"),Ou="Theatre mode (t)",Su="Default mode",ku="cv-theatre-mode-button",Nu=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=bu(t),function(e,t){if(t&&("object"==pu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,vu()?Reflect.construct(t,n||[],bu(e).constructor):t.apply(e,n))}(this,t,[e,n])).alwaysCollapsed=!1,r.isCollapsed=!1,r.isCollabsible=!0,r.updateControlText(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gu(e,t)}(t,e),n=t,(r=[{key:"getCollabsibleName",value:function(){return""}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!(window.innerWidth<992)}},{key:"showCollapsibleMenu",value:function(){du(t,"handleClick",this,3)([null])}},{key:"buildCSSClass",value:function(){return"cv-default-mode-button ".concat(du(t,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-big ".concat(du(t,"buildWrapperCSSClass",this,3)([]))}},{key:"handleClick",value:function(){this.player_.theatreModePlugin().toggleTheatreMode(void 0,{shouldLog:!0}),this.updateControlText()}},{key:"updateControlText",value:function(){this.player().theatreModePlugin().getTheatreMode()?this.controlText(Su):this.controlText(Ou)}}])&&hu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(wu);function Pu(e){return Pu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pu(e)}function ju(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Eu(r.key),r)}}function Eu(e){var t=function(e){if("object"!=Pu(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Pu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pu(t)?t:t+""}function Cu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cu=function(){return!!e})()}function Tu(){return Tu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=_u(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Tu.apply(null,arguments)}function _u(e){return _u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_u(e)}function xu(e,t){return xu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xu(e,t)}i.Z.registerComponent("theatreModeButton",Nu);var Lu=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=_u(t),function(e,t){if(t&&("object"==Pu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Cu()?Reflect.construct(t,n||[],_u(e).constructor):t.apply(e,n))}(this,t,[e,n])).options=n,r.bindListeners(),e.ready((function(){return r.onReady()})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xu(e,t)}(t,e),n=t,r=[{key:"bindListeners",value:function(){this.onResize=this.onResize.bind(this),this.onFullscreenChange=this.onFullscreenChange.bind(this),this.player.on("playerresize",this.onResize),this.player.on("fullscreenchange",this.onFullscreenChange)}},{key:"onReady",value:function(){var e;if(this.options&&!(window.innerWidth<992)&&this.getCollapserator()){this.button=this.createButton();var t=this.options.theatreMode;t&&(null===(e=this.button)||void 0===e||e.addClass(ku),this.options.onRequestTheatreMode(t))}}},{key:"dispose",value:function(){var e,n,r;this.player.off("playerresize",this.onResize),this.player.off("fullscreenchange",this.onFullscreenChange),(e=t,n=this,"function"==typeof(r=Tu(_u(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}},{key:"toggleTheatreMode",value:function(e,t){var n,r;if(this.options){var i=this.options.theatreMode,o=void 0!==e?e:!i;if(this.options.onRequestTheatreMode(o),this.options.theatreMode=o,this.button)return i!==o&&(null==t?void 0:t.shouldLog)&&(null===(n=this.analyticsService)||void 0===n||n.logUserAction({id:this.options.playbackObject.videoId,name:this.options.playbackObject.title},{actionType:it.Vw.Click,descriptor:o?it.UX.EnableTheatreMode:it.UX.DisableTheatreMode,entity:it.py.Video})),o?(i||this.player.fill(!0),this.button.addClass(ku),this.button.updateControlText(Ou),o):(i&&this.player.fluid(!0),null===(r=this.button)||void 0===r||r.removeClass(ku),this.button.updateControlText(Su),this.player.viewTranscriptPlugin&&this.player.viewTranscriptPlugin().toggleTranscript(!1,{shouldLog:!1}),o)}}},{key:"onResize",value:function(){var e,t;window.innerWidth<992?null===(e=this.button)||void 0===e||e.hide():this.player.isFullscreen()||(this.button||(this.button=this.createButton()),null===(t=this.button)||void 0===t||t.show())}},{key:"createButton",value:function(){var e=this.getCollapserator();return(null==e?void 0:e.getChild("theatreModeButton"))||e.addChild("theatreModeButton",{},e.children_.length-3),null==e?void 0:e.getChild("theatreModeButton")}},{key:"onFullscreenChange",value:function(){var e,t;this.player.isFullscreen()?null===(e=this.button)||void 0===e||e.hide():null===(t=this.button)||void 0===t||t.show()}},{key:"getCollapserator",value:function(){return this.player.getChild("collapserator")}},{key:"getTheatreMode",value:function(){return this.options.theatreMode}},{key:"registerAnalytics",value:function(e){this.analyticsService=e}}],r&&ju(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));i.Z.registerPlugin("theatreModePlugin",Lu);var Ru=n(18204),Iu=i.Z.getComponent("Menu"),Mu=Iu.prototype.createEl;Iu.prototype.createEl=function(){var e=Mu.call(this);return this.simpleBar=new Ru.Z(this.contentEl(),{autoHide:!1}),e};var Bu=Iu.prototype.contentEl;Iu.prototype.contentEl=function(){return this.simpleBar?this.simpleBar.getContentElement():Bu.call(this)};var Du=Iu.prototype.dispose;Iu.prototype.dispose=function(){this.simpleBar&&(this.simpleBar.unMount(),delete this.simpleBar),Du.call(this)};var Au=Iu.prototype.addItem;Iu.prototype.addItem=function(e){Au.call(this,e),this.simpleBar.recalculate()};var Fu=Iu.prototype.lockShowing;Iu.prototype.lockShowing=function(){Fu.call(this),this.simpleBar.recalculate()},Iu.prototype.recalculateScrollBar=function(){this.simpleBar.recalculate()};var zu=Iu.prototype.handleBlur;function Zu(e){return Zu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zu(e)}function Vu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gu(r.key),r)}}function Gu(e){var t=function(e){if("object"!=Zu(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Zu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Zu(t)?t:t+""}function Uu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Uu=function(){return!!e})()}function Ku(e){return Ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ku(e)}function qu(e,t){return qu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qu(e,t)}Iu.prototype.handleBlur=function(e){var t=e.relatedTarget||document.activeElement;this.el().contains(t)||zu.call(this,e)};var Hu=i.Z.getComponent("Menu"),Wu=i.Z.getComponent("Component"),Yu=i.Z.getComponent("MenuButton"),Qu=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Ku(t),function(e,t){if(t&&("object"==Zu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Uu()?Reflect.construct(t,n||[],Ku(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qu(e,t)}(t,e),n=t,(r=[{key:"createMenu",value:function(){var e,t=new Hu(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var n=i.Z.dom.createEl("li",{className:"vjs-menu-title",innerHTML:(e=this.options_.title,"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))),tabIndex:-1});this.hideThreshold_+=1;var r=new Wu(this.player_,{el:n});t.addItem(r)}if(this.items=this.createItems(),this.items)for(var o=0;o<this.items.length;o++)t.addItem(this.items[o]);return t}}])&&Vu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Yu),Ju=Yu.prototype.pressButton;Yu.prototype.pressButton=function(){Ju.call(this),this.inactivityTimeout=this.player_.cache_.inactivityTimeout,this.player_.cache_.inactivityTimeout=0,this.player_.options_.inactivityTimeout=0};var Xu=Yu.prototype.unpressButton;function $u(e){return $u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$u(e)}function ec(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tc(r.key),r)}}function tc(e){var t=function(e){if("object"!=$u(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=$u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==$u(t)?t:t+""}function nc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nc=function(){return!!e})()}function rc(e,t,n,r){var i=ic(oc(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function ic(){return ic="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=oc(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},ic.apply(null,arguments)}function oc(e){return oc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oc(e)}function ac(e,t){return ac=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ac(e,t)}Yu.prototype.unpressButton=function(){Xu.call(this),this.player_.cache_.inactivityTimeout=this.inactivityTimeout,this.player_.options_.inactivityTimeout=this.inactivityTimeout,this.player_.reportUserActivity()},i.Z.registerComponent("MenuButton",Qu);var uc=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=oc(t),function(e,t){if(t&&("object"==$u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,nc()?Reflect.construct(t,n||[],oc(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ac(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-time-wrapper ".concat(rc(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,r){return rc(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}}])&&ec(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function cc(e){return cc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cc(e)}function lc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sc(r.key),r)}}function sc(e){var t=function(e){if("object"!=cc(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=cc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cc(t)?t:t+""}function fc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fc=function(){return!!e})()}function pc(e){return pc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pc(e)}function hc(e,t){return hc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hc(e,t)}uc.prototype.options_={children:["currentTimeDisplay","remainingTimeDisplay"]},i.Z.registerComponent("TimeWrapper",uc);var yc=i.Z.getComponent("SeekBar"),vc=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=pc(t),function(e,t){if(t&&("object"==cc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fc()?Reflect.construct(t,n||[],pc(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hc(e,t)}(t,e),n=t,(r=[{key:"handleMouseDown",value:function(e){var t=this.player_.preventScrubbingPlugin();t.isEnabled&&this.getMouseTime(e)>t.furthestVisitedTime||(yc.prototype.handleMouseDown.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"))}},{key:"handleMouseMove",value:function(e){yc.prototype.handleMouseMove.call(this,e),this.update()}},{key:"getPercent",value:function(){var e=this.player_.currentTime()/this.player_.duration();return e>=1?1:e}},{key:"handleMouseUp",value:function(e){var t=this;yc.prototype.handleMouseUp.call(this,e),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){t.player_.removeClass("cv-disable-play-pause-feedback")}),500)}},{key:"clamp",value:function(e,t,n){return Math.min(Math.max(e,t),n)}},{key:"getMouseTime",value:function(e){return this.clamp(yc.prototype.calculateDistance.call(this,e).x,0,1)*this.player_.duration()}}])&&lc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yc);function dc(e){return dc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dc(e)}function mc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bc(r.key),r)}}function bc(e){var t=function(e){if("object"!=dc(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=dc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==dc(t)?t:t+""}function gc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gc=function(){return!!e})()}function wc(e,t,n,r){var i=Oc(Sc(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Oc(){return Oc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Sc(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Oc.apply(null,arguments)}function Sc(e){return Sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sc(e)}function kc(e,t){return kc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kc(e,t)}i.Z.registerComponent("SeekBar",vc);var Nc=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Sc(t),function(e,t){if(t&&("object"==dc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,gc()?Reflect.construct(t,n||[],Sc(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kc(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-load-progress ".concat(wc(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,r){return wc(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"update",value:function(e){this.el_.style.width=100*e+"%"}}])&&mc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function Pc(e){return Pc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pc(e)}function jc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ec(r.key),r)}}function Ec(e){var t=function(e){if("object"!=Pc(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Pc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pc(t)?t:t+""}function Cc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cc=function(){return!!e})()}function Tc(e,t,n,r){var i=_c(xc(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function _c(){return _c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=xc(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},_c.apply(null,arguments)}function xc(e){return xc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xc(e)}function Lc(e,t){return Lc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lc(e,t)}var Rc=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=xc(t),function(e,t){if(t&&("object"==Pc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Cc()?Reflect.construct(t,n||[],xc(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lc(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-play-progress ".concat(Tc(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,r){return Tc(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"update",value:function(e){e>0&&e<1?this.addClass("cv-current"):this.removeClass("cv-current"),this.el_.style.width=100*e+"%"}}])&&jc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function Ic(e){return Ic="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ic(e)}function Mc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Bc(r.key),r)}}function Bc(e){var t=function(e){if("object"!=Ic(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ic(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ic(t)?t:t+""}function Dc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dc=function(){return!!e})()}function Ac(e,t,n,r){var i=Fc(zc(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Fc(){return Fc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=zc(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Fc.apply(null,arguments)}function zc(e){return zc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zc(e)}function Zc(e,t){return Zc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zc(e,t)}var Vc=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=zc(t),function(e,t){if(t&&("object"==Ic(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Dc()?Reflect.construct(t,n||[],zc(e).constructor):t.apply(e,n))}(this,t,[e,n])).playProgress=new Rc(r.player_),r.addChild(r.playProgress),r.loadProgress=new Nc(r.player_),r.addChild(r.loadProgress),r.update(),r.updateBuffered(0),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zc(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-item ".concat(Ac(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,r){return Ac(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"getCurrentTime",value:function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}},{key:"update",value:function(){var e=this.player_.duration()||3600,t=this.options_.endTime-this.options_.startTime;if(e!==this.duration_){var n=t/e;this.el_.style.width=100*n+"%";var r=this.options_.startTime/e;this.el_.style.left=100*r+"%",this.duration_=e}var i=this.getCurrentTime();i<this.options_.startTime?this.playProgress.update(0):i>this.options_.endTime?this.playProgress.update(1):this.playProgress.update((i-this.options_.startTime)/t)}},{key:"updateBuffered",value:function(e){var t=this.options_.endTime-this.options_.startTime;e<this.options_.startTime?this.loadProgress.update(0):e>this.options_.endTime?this.loadProgress.update(1):this.loadProgress.update((e-this.options_.startTime)/t)}}])&&Mc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function Gc(e){for(var t=e.buffered(),n=e.currentTime(),r=0,i=0;i<t.length;i++){var o=t.start(i),a=t.end(i);if(o<=n&&a>=n){r=a;break}}return r}function Uc(e){return Uc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uc(e)}function Kc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qc(r.key),r)}}function qc(e){var t=function(e){if("object"!=Uc(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Uc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Uc(t)?t:t+""}function Hc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Hc=function(){return!!e})()}function Wc(e,t,n,r){var i=Yc(Qc(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Yc(){return Yc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Qc(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Yc.apply(null,arguments)}function Qc(e){return Qc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qc(e)}function Jc(e,t){return Jc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jc(e,t)}var Xc=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Qc(t),function(e,t){if(t&&("object"==Uc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Hc()?Reflect.construct(t,n||[],Qc(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jc(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-items ".concat(Wc(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,r){return Wc(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"update",value:function(){this.children_.forEach((function(e){e.update()}))}},{key:"updateBuffered",value:function(){var e=this;this.children_.forEach((function(t){t.updateBuffered(Gc(e.player_))}))}}])&&Kc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function $c(e){return $c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$c(e)}function el(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tl(r.key),r)}}function tl(e){var t=function(e){if("object"!=$c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=$c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==$c(t)?t:t+""}function nl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nl=function(){return!!e})()}function rl(e,t,n,r){var i=il(ol(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function il(){return il="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ol(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},il.apply(null,arguments)}function ol(e){return ol=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ol(e)}function al(e,t){return al=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},al(e,t)}var ul=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=ol(t),function(e,t){if(t&&("object"==$c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,nl()?Reflect.construct(t,n||[],ol(e).constructor):t.apply(e,n))}(this,t,[e,n])).onDurationChange=r.onDurationChange.bind(r),r.createChapterItems=r.createChapterItems.bind(r),r.updateBuffered=r.updateBuffered.bind(r),Y.useChapters(r.player_,r.createChapterItems),r.player_.on("durationchange",r.onDurationChange),r.player_.on("progress",r.updateBuffered),r.createChapterItems(),r.update(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&al(e,t)}(t,e),n=t,(r=[{key:"dispose",value:function(){this.player_.off("durationchange",this.onDurationChange),this.player_.off("progress",this.updateBuffered),rl(t,"dispose",this,3)([])}},{key:"createEl",value:function(){return i.Z.dom.createEl("div",{className:"vjs-progress-holder cv-chapter-seek-bar"},{"aria-label":this.localize("Progress Bar"),role:"progressbar"})}},{key:"onDurationChange",value:function(){this.createChapterItems(),this.update()}},{key:"update",value:function(){var e=rl(t,"update",this,3)([]);return this.chapterBarItems&&this.chapterBarItems.update(),e}},{key:"updateBuffered",value:function(){this.chapterBarItems.updateBuffered()}},{key:"bindUpdateListener",value:function(e){var t=this,n=function(){t.createChapterItems(),t.updateBuffered()};e.addEventListener("cv:cuechange",n),this.player_.one("dispose",(function(){return e.removeEventListener("cv:cuechange",n)}))}},{key:"createChapterItems",value:function(e){var t,n;e&&(this.track_||this.bindUpdateListener(e),this.track_=e);var r=new Xc(this.player_);if((null===(n=null===(t=this.track_)||void 0===t?void 0:t.cues)||void 0===n?void 0:n.length)&&!this.options_.ignoreChapters)for(var i=0;i<this.track_.cues.length;i++){var o=this.track_.cues[i],a=o.startTime,u=o.endTime,c=this.player_.duration();c&&(i===this.track_.cues.length-1&&o.endTime<this.player_.duration()&&(u=this.player_.duration()),u>c&&(u=c));var l=new Vc(this.player_,{startTime:a,endTime:u});if(r.addChild(l),c&&u===c)break}else r.addChild(new Vc(this.player_,{startTime:0,endTime:this.player_.duration()||3600}));this.chapterBarItems&&this.removeChild(this.chapterBarItems),this.chapterBarItems=r,this.addChild(this.chapterBarItems)}}])&&el(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("SeekBar"));function cl(e){return cl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cl(e)}function ll(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sl(r.key),r)}}function sl(e){var t=function(e){if("object"!=cl(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=cl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cl(t)?t:t+""}function fl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fl=function(){return!!e})()}function pl(){return pl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=hl(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},pl.apply(null,arguments)}function hl(e){return hl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hl(e)}function yl(e,t){return yl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yl(e,t)}ul.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"},i.Z.browser.IS_IOS||i.Z.browser.IS_ANDROID||ul.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),i.Z.registerComponent("ChapterSeekBar",ul);var vl=i.Z.getComponent("ProgressControl"),dl="seekBar",ml=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=hl(t),function(e,t){if(t&&("object"==cl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fl()?Reflect.construct(t,n||[],hl(e).constructor):t.apply(e,n))}(this,t,arguments)).seekBarName_=dl,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yl(e,t)}(t,e),n=t,r=[{key:"setSeekBarName",value:function(e){this.seekBarName_=e}},{key:"getChild",value:function(e){return(null==e?void 0:e.toLowerCase())===dl.toLowerCase()&&(e=this.seekBarName_),(n=t,r=this,"function"==typeof(i=pl(hl(1&3?n.prototype:n),"getChild",r))?function(e){return i.apply(r,e)}:i)([e]);var n,r,i}}],r&&ll(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(vl);function bl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;e=e<0?0:e;var n=Math.floor(e%60),r=Math.floor(e/60%60),i=Math.floor(e/3600),o=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(i=r=n="-"),(i=i>0||a>0?i+":":"")+(r=((i||o>=10)&&r<10?"0"+r:r)+":")+(n<10?"0"+n:n)}function gl(e){return gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gl(e)}function wl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ol(r.key),r)}}function Ol(e){var t=function(e){if("object"!=gl(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=gl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==gl(t)?t:t+""}function Sl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sl=function(){return!!e})()}function kl(){return kl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Nl(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},kl.apply(null,arguments)}function Nl(e){return Nl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nl(e)}function Pl(e,t){return Pl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pl(e,t)}ml.prototype.options_={children:[]},i.Z.registerComponent("ProgressControl",ml);var jl=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Nl(t),function(e,t){if(t&&("object"==gl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Sl()?Reflect.construct(t,n||[],Nl(e).constructor):t.apply(e,n))}(this,t,[e,n])).hasCustomChapterText=!1,Y.useChapters(r.player_,(function(e){r.track_=e})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pl(e,t)}(t,e),n=t,r=[{key:"createEl",value:function(){var e,n,r,o=(e=t,n=this,"function"==typeof(r=kl(Nl(1&3?e.prototype:e),"createEl",n))?function(e){return r.apply(n,e)}:r)([]);return this.chapter_=i.Z.dom.createEl("div"),o.appendChild(this.chapter_),this.time_=i.Z.dom.createEl("div"),o.appendChild(this.time_),o}},{key:"updateTime",value:function(e){var t=this.player_.duration();if(i.Z.dom.textContent(this.time_,bl(e,t)),this.track_&&!this.hasCustomChapterText){for(var n=0;n<this.track_.cues.length;n++){var r=this.track_.cues[n],o=r.endTime||t;if(r.startTime<=e&&o>=e)return void i.Z.dom.textContent(this.chapter_,r.text)}i.Z.dom.textContent(this.chapter_,"")}}},{key:"clearChapterContent",value:function(){i.Z.dom.textContent(this.chapter_,"")}},{key:"updateText",value:function(e){i.Z.dom.textContent(this.time_,e)}},{key:"setCustomChapterText",value:function(e){this.hasCustomChapterText=!!e,i.Z.dom.textContent(this.chapter_,null!=e?e:"")}}],r&&wl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("TimeTooltip"));function El(e){return El="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},El(e)}function Cl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Tl(r.key),r)}}function Tl(e){var t=function(e){if("object"!=El(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=El(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==El(t)?t:t+""}function _l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_l=function(){return!!e})()}function xl(){return xl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Ll(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},xl.apply(null,arguments)}function Ll(e){return Ll=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ll(e)}function Rl(e,t){return Rl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Rl(e,t)}i.Z.registerComponent("TimeTooltip",jl);var Il=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Ll(t),function(e,t){if(t&&("object"==El(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,_l()?Reflect.construct(t,n||[],Ll(e).constructor):t.apply(e,n))}(this,t,[e,n])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rl(e,t)}(t,e),n=t,r=[{key:"setTrack",value:function(e){this.track_=e}},{key:"createEl",value:function(){var e,n,r,o=(e=t,n=this,"function"==typeof(r=xl(Ll(1&3?e.prototype:e),"createEl",n))?function(e){return r.apply(n,e)}:r)(["div",{className:"cv-thumbnail-display"}]);return this.img_=i.Z.dom.createEl("img"),o.appendChild(this.img_),o}},{key:"enable",value:function(){this.addClass("cv-thumbnail-display-enabled")}},{key:"disable",value:function(){this.removeClass("cv-thumbnail-display-enabled")}},{key:"parseImageLink",value:function(e){var t=e.indexOf("#");if(-1===t)return{src:e,w:0,h:0,x:0,y:0};var n=e.substr(0,t),r=e.substr(t+1);if("xywh="!==r.substr(0,5))return{src:e,w:0,h:0,x:0,y:0};var i=this.getScale(),o=r.substr(5).split(",");return{src:n,w:parseInt(o[2])*i,h:parseInt(o[3])*i,x:parseInt(o[0])*i,y:parseInt(o[1])*i}}},{key:"getScale",value:function(){var e=this.options_.scaleFactor,t=this.player_.whiteboardModePlugin().side;return this.player_.isFullscreen()&&"bottom"!==t&&(e*=2),e}},{key:"update",value:function(e){var t,n;if(null===(n=null===(t=this.track_)||void 0===t?void 0:t.cues)||void 0===n?void 0:n.length){for(var r,i=e,o=0;o<this.track_.cues.length;){var a=this.track_.cues[o];if(a.startTime<=i&&a.endTime>=i){r=this.parseImageLink(a.text);break}o++}if(null==r?void 0:r.src){this.enable();var u=r,c=u.src,l=u.w,s=u.h,f=u.x,p=u.y,h=this.getScale();this.img_.src=c,this.img_.style.left=-f+"px",this.img_.style.top=-p+"px",this.img_.style.transformOrigin="0 0",this.img_.style.transform="scale(".concat(h,")"),this.el_.style.width=l+"px",this.el_.style.height=s+"px"}else this.disable()}}}],r&&Cl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function Ml(e){return Ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ml(e)}function Bl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dl(r.key),r)}}function Dl(e){var t=function(e){if("object"!=Ml(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ml(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ml(t)?t:t+""}function Al(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Al=function(){return!!e})()}function Fl(e){return Fl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fl(e)}function zl(e,t){return zl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zl(e,t)}Il.prototype.options_={scaleFactor:1},i.Z.registerComponent("ThumbnailDisplay",Il);var Zl=i.Z.getComponent("MouseTimeDisplay"),Vl="cv-mouse-time-display-force-show",Gl=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=function(e,t,n){return t=Fl(t),function(e,t){if(t&&("object"==Ml(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Al()?Reflect.construct(t,n||[],Fl(e).constructor):t.apply(e,n))}(this,t,[e,n]),Y.useMetadataTrack(r.player_,"thumbnails",(function(e){r.getChild("ThumbnailDisplay").setTrack(e)})),r.update=r.update.bind(r),r.player_.on("durationchange",r.update),r.player_.one("dispose",(function(){r.player_.off("durationchange",r.update)})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zl(e,t)}(t,e),n=t,(r=[{key:"update",value:function(e,t){var n=this;this.requestAnimationFrame((function(){var r=n.getChild("TimeTooltip"),i=n.getChild("ThumbnailDisplay"),o=t*n.player_.duration(),a=n.player_.preventScrubbingPlugin(),u=n.player_.controlBar.getChild("progressControl").getChild(Jo),c=!1;a.isEnabled&&(c=o>a.furthestVisitedTime),c?(n.hide(),u.show(),Q(u.hide,1e3,!1,u)()):(n.show(),u&&u.hide(!0),i.update(o),r.updateTime(o));var l=n.el_.getBoundingClientRect();n.el_.style.marginLeft=-l.width/2+"px";var s=e.width*t;s<l.width/2?n.el_.style.left=l.width/2+"px":s>e.width-l.width/2?n.el_.style.left=e.width-l.width/2+"px":n.el_.style.left=e.width*t+"px"}))}},{key:"forceShow",value:function(){this.addClass(Vl)}},{key:"removeForceShow",value:function(){this.removeClass(Vl)}}])&&Bl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Zl);function Ul(e){return Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ul(e)}function Kl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ql(r.key),r)}}function ql(e){var t=function(e){if("object"!=Ul(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ul(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ul(t)?t:t+""}function Hl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Hl=function(){return!!e})()}function Wl(){return Wl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Yl(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Wl.apply(null,arguments)}function Yl(e){return Yl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yl(e)}function Ql(e,t){return Ql=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ql(e,t)}Gl.prototype.options_={children:["ThumbnailDisplay","TimeTooltip"]},i.Z.registerComponent("MouseTimeDisplay",Gl);var Jl=i.Z.getComponent("ChaptersTrackMenuItem"),Xl=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Yl(t),function(e,t){if(t&&("object"==Ul(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Hl()?Reflect.construct(t,n||[],Yl(e).constructor):t.apply(e,n))}(this,t,[e,n])).nonIconControl=!1,r.thumbnailDisplay=new Il(r.player_,{scaleFactor:.5}),r.el().insertBefore(r.thumbnailDisplay.el(),r.el().firstChild),Y.useMetadataTrack(r.player_,"thumbnails",(function(e){r.addClass("cv-has-thumbnails"),r.thumbnailDisplay.setTrack(e),r.thumbnailDisplay.update(r.options_.cue.startTime)})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ql(e,t)}(t,e),n=t,r=[{key:"update",value:function(){this.player_&&Jl.prototype.update.call(this)}},{key:"buildCSSClass",value:function(){return"vjs-menu-item cv-chapter-menu-item"}},{key:"createEl",value:function(e,n,r){return this.nonIconControl=!0,(i=t,o=this,"function"==typeof(a=Wl(Yl(1&3?i.prototype:i),"createEl",o))?function(e){return a.apply(o,e)}:a)(["li",Object.assign({className:this.buildCSSClass(),innerHTML:this.getInnerHTML(),tabIndex:-1},n),r]);var i,o,a}},{key:"getInnerHTML",value:function(){var e=this.player_.duration();return'<span class="vjs-menu-item-text cv-chapter-menu-item-text">'+"<p>".concat(this.localize(this.options_.label),"</p>")+"<p>(".concat(bl(this.options_.cue.startTime,e),")</p>")+"</span>"}}],r&&Kl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Jl);function $l(e){return $l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$l(e)}function es(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ts(r.key),r)}}function ts(e){var t=function(e){if("object"!=$l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=$l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==$l(t)?t:t+""}function ns(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ns=function(){return!!e})()}function rs(e,t,n,r){var i=is(os(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function is(){return is="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=os(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},is.apply(null,arguments)}function os(e){return os=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},os(e)}function as(e,t){return as=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},as(e,t)}var us=function(e){function t(e,n,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(e,t,n){return t=os(t),function(e,t){if(t&&("object"==$l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ns()?Reflect.construct(t,n||[],os(e).constructor):t.apply(e,n))}(this,t,[e,n,r])).alwaysCollapsed=!1,i.isCollapsed=!1,i.isCollabsible=!0,i.update=i.update.bind(i),i.player_.on("cv-whiteboard-change",i.update),i.player_.on("fullscreenchange",i.update),i.player_.on("dispose",(function(){i.player_.off("cv-whiteboard-change",i.update),i.player_.off("fullscreenchange",i.update)})),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&as(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-chapters-button ".concat(rs(t,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-big ".concat(rs(t,"buildWrapperCSSClass",this,3)([]))}},{key:"createItems",value:function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var n=0,r=t.length;n<r;n++){var i=t[n],o=new Xl(this.player_,{track:this.track_,cue:i});e.push(o)}return e}},{key:"setTrack",value:function(e){var n=this;if(rs(t,"setTrack",this,3)([e]),this.track_&&"chapters"===this.track_.kind){e.one("loadeddata",this.update);var r=function(){n.update(),n.player_.trigger("resizemenus")};e.on("cv:cuechange",r),this.player_.one("dispose",(function(){return e.off("cv:cueupdate",r)}))}}},{key:"update",value:function(e){rs(t,"update",this,3)([e])}},{key:"getCollabsibleName",value:function(){return"Chapters"}},{key:"getCollabsibleValue",value:function(){var e=this.track_.activeCues[0];return(null==e?void 0:e.text)||""}},{key:"showInCollabsibleMenu",value:function(){if(!this.track_)return!1;var e=this.track_.cues;return!(!e||!e.length)}},{key:"showCollapsibleMenu",value:function(){this.handleClick(null)}}])&&es(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("ChaptersButton"));function cs(e){return cs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cs(e)}function ls(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ss(r.key),r)}}function ss(e){var t=function(e){if("object"!=cs(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=cs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cs(t)?t:t+""}function fs(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fs=function(){return!!e})()}function ps(){return ps="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=hs(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},ps.apply(null,arguments)}function hs(e){return hs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hs(e)}function ys(e,t){return ys=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ys(e,t)}i.Z.registerComponent("ChaptersButton",us);var vs=i.Z.getComponent("OffTextTrackMenuItem"),ds=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n.track={player:e,kind:n.kind,kinds:n.kinds,default:!1,mode:"hidden"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiSelectable=!1,function(e,t,n){return t=hs(t),function(e,t){if(t&&("object"==cs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fs()?Reflect.construct(t,n||[],hs(e).constructor):t.apply(e,n))}(this,t,[e,n])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ys(e,t)}(t,e),n=t,r=[{key:"handleClick",value:function(e){vs.prototype.handleClick.call(this,e);for(var t=this.player_.textTracks(),n=0;n<t.length;n++){var r=t[n];"subtitles"===r.kind&&(r.mode="hidden")}this.player_.trigger("cv:languageselected")}},{key:"createEl",value:function(e,n,r){return(i=t,o=this,"function"==typeof(a=ps(hs(1&3?i.prototype:i),"createEl",o))?function(e){return a.apply(o,e)}:a)(["li",Object.assign(Object.assign({className:"vjs-menu-item",tabIndex:-1},n),{innerHTML:'<span class="vjs-menu-item-text">Off</span>'}),r]);var i,o,a}}],r&&ls(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(vs);function ms(e){return ms="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ms(e)}function bs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gs(r.key),r)}}function gs(e){var t=function(e){if("object"!=ms(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ms(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ms(t)?t:t+""}function ws(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ws=function(){return!!e})()}function Os(e){return Os=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Os(e)}function Ss(e,t){return Ss=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ss(e,t)}i.Z.registerComponent("OffTextTrackMenuItem",ds);var ks=i.Z.getComponent("TextTrackButton"),Ns=i.Z.getComponent("TextTrackMenuItem"),Ps=i.Z.getComponent("OffTextTrackMenuItem"),js=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Os(t),function(e,t){if(t&&("object"==ms(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ws()?Reflect.construct(t,n||[],Os(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ss(e,t)}(t,e),n=t,r=[{key:"createItems",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ns;this.label_&&(e="".concat(this.label_," off")),t.push(new Ps(this.player_,{kinds:this.kinds_,kind:this.kind_,label:e})),this.hideThreshold_+=1;var r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i<r.length;i++){var o=r[i];if(this.kinds_.indexOf(o.kind)>-1){var a=new n(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});a.addClass("vjs-".concat(o.kind,"-menu-item")),t.push(a)}}return this.player().trigger("resizemenus"),t}}],r&&bs(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ks);i.Z.registerComponent("TextTrackButton",js);var Es=n(16951),Cs=n(83983),Ts=n.n(Cs),_s=n(56050),xs=n(81886),Ls=n(23481);const Rs=JSON.parse('{"aa":{"englishName":"Afar","nativeName":"Qafar"},"aa-dj":{"englishName":"Afar (Djibouti)","nativeName":"Qafar (Yabuuti)"},"aa-er":{"englishName":"Afar (Eritrea)","nativeName":"Qafar (Eretria)"},"aa-et":{"englishName":"Afar (Ethiopia)","nativeName":"Qafar (Otobbia)"},"af":{"englishName":"Afrikaans","nativeName":"Afrikaans"},"af-na":{"englishName":"Afrikaans (Namibia)","nativeName":"Afrikaans (Namibië)"},"af-za":{"englishName":"Afrikaans (South Africa)","nativeName":"Afrikaans (Suid-Afrika)"},"agq":{"englishName":"Aghem","nativeName":"Aghem"},"agq-cm":{"englishName":"Aghem (Cameroon)","nativeName":"Aghem (K� m� lûŋ)"},"ak":{"englishName":"Akan","nativeName":"Akan"},"ak-gh":{"englishName":"Akan (Ghana)","nativeName":"Akan (Gaana)"},"am":{"englishName":"Amharic","nativeName":"�� ማርኛ"},"am-et":{"englishName":"Amharic (Ethiopia)","nativeName":"�� ማርኛ (ኢትዮጵያ)"},"ar":{"englishName":"Arabic","nativeName":"العربية"},"ar-001":{"englishName":"Arabic (World)","nativeName":"العربية (العالم)"},"ar-ae":{"englishName":"Arabic (United Arab Emirates)","nativeName":"العربية (الإمارات العربية المتحدة)"},"ar-bh":{"englishName":"Arabic (Bahrain)","nativeName":"العربية (البحرين)"},"ar-dj":{"englishName":"Arabic (Djibouti)","nativeName":"العربية (جيبوتي)"},"ar-dz":{"englishName":"Arabic (Algeria)","nativeName":"العربية (الجزائر)"},"ar-eg":{"englishName":"Arabic (Egypt)","nativeName":"العربية (مصر)"},"ar-er":{"englishName":"Arabic (Eritrea)","nativeName":"العربية (إريتريا)"},"ar-il":{"englishName":"Arabic (Israel)","nativeName":"العربية (إسرائيل)"},"ar-iq":{"englishName":"Arabic (Iraq)","nativeName":"العربية (العراق)"},"ar-jo":{"englishName":"Arabic (Jordan)","nativeName":"العربية (الأردن)"},"ar-km":{"englishName":"Arabic (Comoros)","nativeName":"العربية (جزر القمر)"},"ar-kw":{"englishName":"Arabic (Kuwait)","nativeName":"العربية (الكويت)"},"ar-lb":{"englishName":"Arabic (Lebanon)","nativeName":"العربية (لبنان)"},"ar-ly":{"englishName":"Arabic (Libya)","nativeName":"العربية (ليبيا)"},"ar-ma":{"englishName":"Arabic (Morocco)","nativeName":"العربية (المملكة المغربية)"},"ar-mr":{"englishName":"Arabic (Mauritania)","nativeName":"العربية (موريتانيا)"},"ar-om":{"englishName":"Arabic (Oman)","nativeName":"العربية (عمان)"},"ar-ps":{"englishName":"Arabic (Palestinian Authority)","nativeName":"العربية (السلطة الفلسطينية)"},"ar-qa":{"englishName":"Arabic (Qatar)","nativeName":"العربية (قطر)"},"ar-sa":{"englishName":"Arabic (Saudi Arabia)","nativeName":"العربية (المملكة العربية السعودية)"},"ar-sd":{"englishName":"Arabic (Sudan)","nativeName":"العربية (السودان)"},"ar-so":{"englishName":"Arabic (Somalia)","nativeName":"العربية (الصومال)"},"ar-ss":{"englishName":"Arabic (South Sudan)","nativeName":"العربية (جنوب السودان)"},"ar-sy":{"englishName":"Arabic (Syria)","nativeName":"العربية (سوريا)"},"ar-td":{"englishName":"Arabic (Chad)","nativeName":"العربية (تشاد)"},"ar-tn":{"englishName":"Arabic (Tunisia)","nativeName":"العربية (تونس)"},"ar-ye":{"englishName":"Arabic (Yemen)","nativeName":"العربية (اليمن)"},"arn":{"englishName":"Mapudungun","nativeName":"Mapudungun"},"arn-cl":{"englishName":"Mapudungun (Chile)","nativeName":"Mapudungun (Chile)"},"as":{"englishName":"Assamese","nativeName":"অসমীয়া"},"as-in":{"englishName":"Assamese (India)","nativeName":"অসমীয়া (ভাৰত)"},"asa":{"englishName":"Asu","nativeName":"Kipare"},"asa-tz":{"englishName":"Asu (Tanzania)","nativeName":"Kipare (Tadhania)"},"ast":{"englishName":"Asturian","nativeName":"asturianu"},"ast-es":{"englishName":"Asturian (Spain)","nativeName":"asturianu (España)"},"az":{"englishName":"Azerbaijani","nativeName":"azÉ™rbaycan dili"},"az-cyrl":{"englishName":"Azerbaijani (Cyrillic)","nativeName":"Азәрбајҹан дили"},"az-cyrl-az":{"englishName":"Azerbaijani (Cyrillic, Azerbaijan)","nativeName":"Азәрбајҹан дили (Азәрбајҹан)"},"az-latn":{"englishName":"Azerbaijani (Latin)","nativeName":"AzÉ™rbaycan dili"},"az-latn-az":{"englishName":"Azerbaijani (Latin, Azerbaijan)","nativeName":"AzÉ™rbaycan dili (AzÉ™rbaycan)"},"ba":{"englishName":"Bashkir","nativeName":"Башҡорт"},"ba-ru":{"englishName":"Bashkir (Russia)","nativeName":"Башҡорт (� әсәй)"},"bas":{"englishName":"Basaa","nativeName":"Ɓ� s� a"},"bas-cm":{"englishName":"Basaa (Cameroon)","nativeName":"Ɓ� s� a (K� mɛ̀rûn)"},"be":{"englishName":"Belarusian","nativeName":"Беларуская"},"be-by":{"englishName":"Belarusian (Belarus)","nativeName":"Беларуская (Беларусь)"},"bem":{"englishName":"Bemba","nativeName":"Ichibemba"},"bem-zm":{"englishName":"Bemba (Zambia)","nativeName":"Ichibemba (Zambia)"},"bez":{"englishName":"Bena","nativeName":"Hibena"},"bez-tz":{"englishName":"Bena (Tanzania)","nativeName":"Hibena (Hutanzania)"},"bg":{"englishName":"Bulgarian","nativeName":"български"},"bg-bg":{"englishName":"Bulgarian (Bulgaria)","nativeName":"български (България)"},"bin":{"englishName":"Edo","nativeName":"Ẹ̀dó"},"bin-ng":{"englishName":"Edo (Nigeria)","nativeName":"Ẹ̀dó (Nigeria)"},"bm":{"englishName":"Bamanankan","nativeName":"bamanakan"},"bm-latn":{"englishName":"Bamanankan (Latin)","nativeName":"bamanakan"},"bm-latn-ml":{"englishName":"Bamanankan (Latin, Mali)","nativeName":"bamanakan (Mali)"},"bn":{"englishName":"Bangla","nativeName":"বাংলা"},"bn-bd":{"englishName":"Bangla (Bangladesh)","nativeName":"বাংলা (বাংলাদেশ)"},"bn-in":{"englishName":"Bangla (India)","nativeName":"বাংলা (ভারত)"},"bo":{"englishName":"Tibetan","nativeName":"བོད་ཡིག"},"bo-cn":{"englishName":"Tibetan (China)","nativeName":"བོད་ཡིག (ཀྲུང་ཧྭ་མི་དམངས་སྤྱི་མཐུན་རྒྱལ་ཁབ།)"},"bo-in":{"englishName":"Tibetan (India)","nativeName":"བོད་སྐད་ (རྒྱ་གར་)"},"br":{"englishName":"Breton","nativeName":"brezhoneg"},"br-fr":{"englishName":"Breton (France)","nativeName":"brezhoneg (Frañs)"},"brx":{"englishName":"Bodo","nativeName":"बड़ो"},"brx-in":{"englishName":"Bodo (India)","nativeName":"बड़ो (भारत)"},"bs":{"englishName":"Bosnian","nativeName":"bosanski"},"bs-cyrl":{"englishName":"Bosnian (Cyrillic)","nativeName":"босански"},"bs-cyrl-ba":{"englishName":"Bosnian (Cyrillic, Bosnia and Herzegovina)","nativeName":"босански (Босна и Херцеговина)"},"bs-latn":{"englishName":"Bosnian (Latin)","nativeName":"bosanski"},"bs-latn-ba":{"englishName":"Bosnian (Latin, Bosnia and Herzegovina)","nativeName":"bosanski (Bosna i Hercegovina)"},"byn":{"englishName":"Blin","nativeName":"ብሊን"},"byn-er":{"englishName":"Blin (Eritrea)","nativeName":"ብሊን (ኤርትራ)"},"ca":{"englishName":"Catalan","nativeName":"catal� "},"ca-ad":{"englishName":"Catalan (Andorra)","nativeName":"catal� (Andorra)"},"ca-es":{"englishName":"Catalan (Catalan)","nativeName":"catal� (catal� )"},"ca-es-valencia":{"englishName":"Valencian (Spain)","nativeName":"valenci� (Espanya)"},"ca-fr":{"englishName":"Catalan (France)","nativeName":"catal� (França)"},"ca-it":{"englishName":"Catalan (Italy)","nativeName":"catal� (It� lia)"},"ce":{"englishName":"Chechen","nativeName":"нохчийн"},"ce-ru":{"englishName":"Chechen (Russia)","nativeName":"нохчийн (� осси)"},"cgg":{"englishName":"Chiga","nativeName":"Rukiga"},"cgg-ug":{"englishName":"Chiga (Uganda)","nativeName":"Rukiga (Uganda)"},"chr":{"englishName":"Cherokee","nativeName":"ᏣᎳᎩ"},"chr-cher":{"englishName":"Cherokee","nativeName":"ᏣᎳᎩ"},"chr-cher-us":{"englishName":"Cherokee (Cherokee)","nativeName":"ᏣᎳᎩ (ᏣᎳᎩ)"},"co":{"englishName":"Corsican","nativeName":"Corsu"},"co-fr":{"englishName":"Corsican (France)","nativeName":"Corsu (Francia)"},"cs":{"englishName":"Czech","nativeName":"čeÅ¡tina"},"cs-cz":{"englishName":"Czech (Czech Republic)","nativeName":"čeÅ¡tina (ÄŒeská republika)"},"cu":{"englishName":"Church Slavic","nativeName":"церковнослове́нскїй"},"cu-ru":{"englishName":"Church Slavic (Russia)","nativeName":"церковнослове́нскїй (рѡссі́а)"},"cy":{"englishName":"Welsh","nativeName":"Cymraeg"},"cy-gb":{"englishName":"Welsh (United Kingdom)","nativeName":"Cymraeg (Y Deyrnas Unedig)"},"da":{"englishName":"Danish","nativeName":"dansk"},"da-dk":{"englishName":"Danish (Denmark)","nativeName":"dansk (Danmark)"},"da-gl":{"englishName":"Danish (Greenland)","nativeName":"dansk (Grønland)"},"dav":{"englishName":"Taita","nativeName":"Kitaita"},"dav-ke":{"englishName":"Taita (Kenya)","nativeName":"Kitaita (Kenya)"},"de":{"englishName":"German","nativeName":"Deutsch"},"de-at":{"englishName":"German (Austria)","nativeName":"Deutsch (Österreich)"},"de-be":{"englishName":"German (Belgium)","nativeName":"Deutsch (Belgien)"},"de-ch":{"englishName":"German (Switzerland)","nativeName":"Deutsch (Schweiz)"},"de-de":{"englishName":"German (Germany)","nativeName":"Deutsch (Deutschland)"},"de-li":{"englishName":"German (Liechtenstein)","nativeName":"Deutsch (Liechtenstein)"},"de-lu":{"englishName":"German (Luxembourg)","nativeName":"Deutsch (Luxemburg)"},"dje":{"englishName":"Zarma","nativeName":"Zarmaciine"},"dje-ne":{"englishName":"Zarma (Niger)","nativeName":"Zarmaciine (Nižer)"},"dsb":{"englishName":"Lower Sorbian","nativeName":"dolnoserbšćina"},"dsb-de":{"englishName":"Lower Sorbian (Germany)","nativeName":"dolnoserbšćina (Nimska)"},"dua":{"englishName":"Duala","nativeName":"duálá"},"dua-cm":{"englishName":"Duala (Cameroon)","nativeName":"duálá (Cameroun)"},"dv":{"englishName":"Divehi","nativeName":"ދިވެހިބަސް"},"dv-mv":{"englishName":"Divehi (Maldives)","nativeName":"ދިވެހިބަސް (Þ‹Þ¨ÞˆÞ¬Þ€Þ¨ ÞƒÞ§Þ‡Þ°Þ–Þ¬)"},"dyo":{"englishName":"Jola-Fonyi","nativeName":"joola"},"dyo-sn":{"englishName":"Jola-Fonyi (Senegal)","nativeName":"joola (Senegal)"},"dz":{"englishName":"Dzongkha","nativeName":"རྫོང་ཁ"},"dz-bt":{"englishName":"Dzongkha (Bhutan)","nativeName":"རྫོང་ཁ (�� བྲུག)"},"ebu":{"englishName":"Embu","nativeName":"KÄ©embu"},"ebu-ke":{"englishName":"Embu (Kenya)","nativeName":"KÄ©embu (Kenya)"},"ee":{"englishName":"Ewe","nativeName":"EÊ‹egbe"},"ee-gh":{"englishName":"Ewe (Ghana)","nativeName":"EÊ‹egbe (Ghana nutome)"},"ee-tg":{"englishName":"Ewe (Togo)","nativeName":"EÊ‹egbe (Togo nutome)"},"el":{"englishName":"Greek","nativeName":"Ελληνικά"},"el-cy":{"englishName":"Greek (Cyprus)","nativeName":"Ελληνικά (Κύπρος)"},"el-gr":{"englishName":"Greek (Greece)","nativeName":"Ελληνικά (Ελλάδα)"},"en":{"englishName":"English","nativeName":"English"},"en-001":{"englishName":"English (World)","nativeName":"English (World)"},"en-029":{"englishName":"English (Caribbean)","nativeName":"English (Caribbean)"},"en-150":{"englishName":"English (Europe)","nativeName":"English (Europe)"},"en-ag":{"englishName":"English (Antigua and Barbuda)","nativeName":"English (Antigua and Barbuda)"},"en-ai":{"englishName":"English (Anguilla)","nativeName":"English (Anguilla)"},"en-as":{"englishName":"English (American Samoa)","nativeName":"English (American Samoa)"},"en-at":{"englishName":"English (Austria)","nativeName":"English (Austria)"},"en-au":{"englishName":"English (Australia)","nativeName":"English (Australia)"},"en-bb":{"englishName":"English (Barbados)","nativeName":"English (Barbados)"},"en-be":{"englishName":"English (Belgium)","nativeName":"English (Belgium)"},"en-bi":{"englishName":"English (Burundi)","nativeName":"English (Burundi)"},"en-bm":{"englishName":"English (Bermuda)","nativeName":"English (Bermuda)"},"en-bs":{"englishName":"English (Bahamas)","nativeName":"English (Bahamas)"},"en-bw":{"englishName":"English (Botswana)","nativeName":"English (Botswana)"},"en-bz":{"englishName":"English (Belize)","nativeName":"English (Belize)"},"en-ca":{"englishName":"English (Canada)","nativeName":"English (Canada)"},"en-cc":{"englishName":"English (Cocos (Keeling) Islands)","nativeName":"English (Cocos (Keeling) Islands)"},"en-ch":{"englishName":"English (Switzerland)","nativeName":"English (Switzerland)"},"en-ck":{"englishName":"English (Cook Islands)","nativeName":"English (Cook Islands)"},"en-cm":{"englishName":"English (Cameroon)","nativeName":"English (Cameroon)"},"en-cx":{"englishName":"English (Christmas Island)","nativeName":"English (Christmas Island)"},"en-cy":{"englishName":"English (Cyprus)","nativeName":"English (Cyprus)"},"en-de":{"englishName":"English (Germany)","nativeName":"English (Germany)"},"en-dk":{"englishName":"English (Denmark)","nativeName":"English (Denmark)"},"en-dm":{"englishName":"English (Dominica)","nativeName":"English (Dominica)"},"en-er":{"englishName":"English (Eritrea)","nativeName":"English (Eritrea)"},"en-fi":{"englishName":"English (Finland)","nativeName":"English (Finland)"},"en-fj":{"englishName":"English (Fiji)","nativeName":"English (Fiji)"},"en-fk":{"englishName":"English (Falkland Islands)","nativeName":"English (Falkland Islands)"},"en-fm":{"englishName":"English (Micronesia)","nativeName":"English (Micronesia)"},"en-gb":{"englishName":"English (United Kingdom)","nativeName":"English (United Kingdom)"},"en-gd":{"englishName":"English (Grenada)","nativeName":"English (Grenada)"},"en-gg":{"englishName":"English (Guernsey)","nativeName":"English (Guernsey)"},"en-gh":{"englishName":"English (Ghana)","nativeName":"English (Ghana)"},"en-gi":{"englishName":"English (Gibraltar)","nativeName":"English (Gibraltar)"},"en-gm":{"englishName":"English (Gambia)","nativeName":"English (Gambia)"},"en-gu":{"englishName":"English (Guam)","nativeName":"English (Guam)"},"en-gy":{"englishName":"English (Guyana)","nativeName":"English (Guyana)"},"en-hk":{"englishName":"English (Hong Kong SAR)","nativeName":"English (Hong Kong SAR)"},"en-id":{"englishName":"English (Indonesia)","nativeName":"English (Indonesia)"},"en-ie":{"englishName":"English (Ireland)","nativeName":"English (Ireland)"},"en-il":{"englishName":"English (Israel)","nativeName":"English (Israel)"},"en-im":{"englishName":"English (Isle of Man)","nativeName":"English (Isle of Man)"},"en-in":{"englishName":"English (India)","nativeName":"English (India)"},"en-io":{"englishName":"English (British Indian Ocean Territory)","nativeName":"English (British Indian Ocean Territory)"},"en-je":{"englishName":"English (Jersey)","nativeName":"English (Jersey)"},"en-jm":{"englishName":"English (Jamaica)","nativeName":"English (Jamaica)"},"en-ke":{"englishName":"English (Kenya)","nativeName":"English (Kenya)"},"en-ki":{"englishName":"English (Kiribati)","nativeName":"English (Kiribati)"},"en-kn":{"englishName":"English (Saint Kitts and Nevis)","nativeName":"English (Saint Kitts and Nevis)"},"en-ky":{"englishName":"English (Cayman Islands)","nativeName":"English (Cayman Islands)"},"en-lc":{"englishName":"English (Saint Lucia)","nativeName":"English (Saint Lucia)"},"en-lr":{"englishName":"English (Liberia)","nativeName":"English (Liberia)"},"en-ls":{"englishName":"English (Lesotho)","nativeName":"English (Lesotho)"},"en-mg":{"englishName":"English (Madagascar)","nativeName":"English (Madagascar)"},"en-mh":{"englishName":"English (Marshall Islands)","nativeName":"English (Marshall Islands)"},"en-mo":{"englishName":"English (Macao SAR)","nativeName":"English (Macao SAR)"},"en-mp":{"englishName":"English (Northern Mariana Islands)","nativeName":"English (Northern Mariana Islands)"},"en-ms":{"englishName":"English (Montserrat)","nativeName":"English (Montserrat)"},"en-mt":{"englishName":"English (Malta)","nativeName":"English (Malta)"},"en-mu":{"englishName":"English (Mauritius)","nativeName":"English (Mauritius)"},"en-mw":{"englishName":"English (Malawi)","nativeName":"English (Malawi)"},"en-my":{"englishName":"English (Malaysia)","nativeName":"English (Malaysia)"},"en-na":{"englishName":"English (Namibia)","nativeName":"English (Namibia)"},"en-nf":{"englishName":"English (Norfolk Island)","nativeName":"English (Norfolk Island)"},"en-ng":{"englishName":"English (Nigeria)","nativeName":"English (Nigeria)"},"en-nl":{"englishName":"English (Netherlands)","nativeName":"English (Netherlands)"},"en-nr":{"englishName":"English (Nauru)","nativeName":"English (Nauru)"},"en-nu":{"englishName":"English (Niue)","nativeName":"English (Niue)"},"en-nz":{"englishName":"English (New Zealand)","nativeName":"English (New Zealand)"},"en-pg":{"englishName":"English (Papua New Guinea)","nativeName":"English (Papua New Guinea)"},"en-ph":{"englishName":"English (Philippines)","nativeName":"English (Philippines)"},"en-pk":{"englishName":"English (Pakistan)","nativeName":"English (Pakistan)"},"en-pn":{"englishName":"English (Pitcairn Islands)","nativeName":"English (Pitcairn Islands)"},"en-pr":{"englishName":"English (Puerto Rico)","nativeName":"English (Puerto Rico)"},"en-pw":{"englishName":"English (Palau)","nativeName":"English (Palau)"},"en-rw":{"englishName":"English (Rwanda)","nativeName":"English (Rwanda)"},"en-sb":{"englishName":"English (Solomon Islands)","nativeName":"English (Solomon Islands)"},"en-sc":{"englishName":"English (Seychelles)","nativeName":"English (Seychelles)"},"en-sd":{"englishName":"English (Sudan)","nativeName":"English (Sudan)"},"en-se":{"englishName":"English (Sweden)","nativeName":"English (Sweden)"},"en-sg":{"englishName":"English (Singapore)","nativeName":"English (Singapore)"},"en-sh":{"englishName":"English (St Helena, Ascension, Tristan da Cunha)","nativeName":"English (St Helena, Ascension, Tristan da Cunha)"},"en-si":{"englishName":"English (Slovenia)","nativeName":"English (Slovenia)"},"en-sl":{"englishName":"English (Sierra Leone)","nativeName":"English (Sierra Leone)"},"en-ss":{"englishName":"English (South Sudan)","nativeName":"English (South Sudan)"},"en-sx":{"englishName":"English (Sint Maarten)","nativeName":"English (Sint Maarten)"},"en-sz":{"englishName":"English (Swaziland)","nativeName":"English (Swaziland)"},"en-tc":{"englishName":"English (Turks and Caicos Islands)","nativeName":"English (Turks and Caicos Islands)"},"en-tk":{"englishName":"English (Tokelau)","nativeName":"English (Tokelau)"},"en-to":{"englishName":"English (Tonga)","nativeName":"English (Tonga)"},"en-tt":{"englishName":"English (Trinidad and Tobago)","nativeName":"English (Trinidad and Tobago)"},"en-tv":{"englishName":"English (Tuvalu)","nativeName":"English (Tuvalu)"},"en-tz":{"englishName":"English (Tanzania)","nativeName":"English (Tanzania)"},"en-ug":{"englishName":"English (Uganda)","nativeName":"English (Uganda)"},"en-um":{"englishName":"English (U.S. Outlying Islands)","nativeName":"English (U.S. Outlying Islands)"},"en-us":{"englishName":"English (United States)","nativeName":"English (United States)"},"en-vc":{"englishName":"English (Saint Vincent and the Grenadines)","nativeName":"English (Saint Vincent and the Grenadines)"},"en-vg":{"englishName":"English (British Virgin Islands)","nativeName":"English (British Virgin Islands)"},"en-vi":{"englishName":"English (U.S. Virgin Islands)","nativeName":"English (U.S. Virgin Islands)"},"en-vu":{"englishName":"English (Vanuatu)","nativeName":"English (Vanuatu)"},"en-ws":{"englishName":"English (Samoa)","nativeName":"English (Samoa)"},"en-za":{"englishName":"English (South Africa)","nativeName":"English (South Africa)"},"en-zm":{"englishName":"English (Zambia)","nativeName":"English (Zambia)"},"en-zw":{"englishName":"English (Zimbabwe)","nativeName":"English (Zimbabwe)"},"eo":{"englishName":"Esperanto","nativeName":"esperanto"},"eo-001":{"englishName":"Esperanto (World)","nativeName":"esperanto (World)"},"es":{"englishName":"Spanish","nativeName":"español"},"es-419":{"englishName":"Spanish (Latin America)","nativeName":"español (Latinoamérica)"},"es-ar":{"englishName":"Spanish (Argentina)","nativeName":"español (Argentina)"},"es-bo":{"englishName":"Spanish (Bolivia)","nativeName":"español (Bolivia)"},"es-cl":{"englishName":"Spanish (Chile)","nativeName":"español (Chile)"},"es-co":{"englishName":"Spanish (Colombia)","nativeName":"español (Colombia)"},"es-cr":{"englishName":"Spanish (Costa Rica)","nativeName":"español (Costa Rica)"},"es-cu":{"englishName":"Spanish (Cuba)","nativeName":"español (Cuba)"},"es-do":{"englishName":"Spanish (Dominican Republic)","nativeName":"español (República Dominicana)"},"es-ec":{"englishName":"Spanish (Ecuador)","nativeName":"español (Ecuador)"},"es-es":{"englishName":"Spanish (Spain, International Sort)","nativeName":"español (España, alfabetización internacional)"},"es-gq":{"englishName":"Spanish (Equatorial Guinea)","nativeName":"español (Guinea Ecuatorial)"},"es-gt":{"englishName":"Spanish (Guatemala)","nativeName":"español (Guatemala)"},"es-hn":{"englishName":"Spanish (Honduras)","nativeName":"español (Honduras)"},"es-mx":{"englishName":"Spanish (Mexico)","nativeName":"español (México)"},"es-ni":{"englishName":"Spanish (Nicaragua)","nativeName":"español (Nicaragua)"},"es-pa":{"englishName":"Spanish (Panama)","nativeName":"español (Panamá)"},"es-pe":{"englishName":"Spanish (Peru)","nativeName":"español (Perú)"},"es-ph":{"englishName":"Spanish (Philippines)","nativeName":"español (Filipinas)"},"es-pr":{"englishName":"Spanish (Puerto Rico)","nativeName":"español (Puerto Rico)"},"es-py":{"englishName":"Spanish (Paraguay)","nativeName":"español (Paraguay)"},"es-sv":{"englishName":"Spanish (El Salvador)","nativeName":"español (El Salvador)"},"es-us":{"englishName":"Spanish (United States)","nativeName":"español (Estados Unidos)"},"es-uy":{"englishName":"Spanish (Uruguay)","nativeName":"español (Uruguay)"},"es-ve":{"englishName":"Spanish (Venezuela)","nativeName":"español (Venezuela)"},"et":{"englishName":"Estonian","nativeName":"eesti"},"et-ee":{"englishName":"Estonian (Estonia)","nativeName":"eesti (Eesti)"},"eu":{"englishName":"Basque","nativeName":"euskara"},"eu-es":{"englishName":"Basque (Basque)","nativeName":"euskara (euskara)"},"ewo":{"englishName":"Ewondo","nativeName":"ewondo"},"ewo-cm":{"englishName":"Ewondo (Cameroon)","nativeName":"ewondo (KamÉ™rún)"},"fa":{"englishName":"Persian","nativeName":"فارسى"},"fa-ir":{"englishName":"Persian (Iran)","nativeName":"فارسى (ایران)"},"ff":{"englishName":"Fulah","nativeName":"Fulah"},"ff-cm":{"englishName":"Fulah (Cameroon)","nativeName":"Pulaar (Kameruun)"},"ff-gn":{"englishName":"Fulah (Guinea)","nativeName":"Pulaar (Gine)"},"ff-latn":{"englishName":"Fulah","nativeName":"Fulah"},"ff-latn-sn":{"englishName":"Fulah (Latin, Senegal)","nativeName":"Fulah (Sénégal)"},"ff-mr":{"englishName":"Fulah (Mauritania)","nativeName":"Pulaar (Muritani)"},"ff-ng":{"englishName":"Fulah (Nigeria)","nativeName":"Pulaar (Nigeria)"},"fi":{"englishName":"Finnish","nativeName":"suomi"},"fi-fi":{"englishName":"Finnish (Finland)","nativeName":"suomi (Suomi)"},"fil":{"englishName":"Filipino","nativeName":"Filipino"},"fil-ph":{"englishName":"Filipino (Philippines)","nativeName":"Filipino (Pilipinas)"},"fo":{"englishName":"Faroese","nativeName":"føroyskt"},"fo-dk":{"englishName":"Faroese (Denmark)","nativeName":"føroyskt (Danmark)"},"fo-fo":{"englishName":"Faroese (Faroe Islands)","nativeName":"føroyskt (Føroyar)"},"fr":{"englishName":"French","nativeName":"français"},"fr-029":{"englishName":"French (Caribbean)","nativeName":"français (caraïbes)"},"fr-be":{"englishName":"French (Belgium)","nativeName":"français (Belgique)"},"fr-bf":{"englishName":"French (Burkina Faso)","nativeName":"français (Burkina Faso)"},"fr-bi":{"englishName":"French (Burundi)","nativeName":"français (Burundi)"},"fr-bj":{"englishName":"French (Benin)","nativeName":"français (Bénin)"},"fr-bl":{"englishName":"French (Saint Barthélemy)","nativeName":"français (Saint-Barthélemy)"},"fr-ca":{"englishName":"French (Canada)","nativeName":"français (Canada)"},"fr-cd":{"englishName":"French (Congo DRC)","nativeName":"français (Congo, République démocratique du)"},"fr-cf":{"englishName":"French (Central African Republic)","nativeName":"français (République centrafricaine)"},"fr-cg":{"englishName":"French (Congo)","nativeName":"français (Congo)"},"fr-ch":{"englishName":"French (Switzerland)","nativeName":"français (Suisse)"},"fr-ci":{"englishName":"French (Côte d’Ivoire)","nativeName":"français (Côte d’Ivoire)"},"fr-cm":{"englishName":"French (Cameroon)","nativeName":"français (Cameroun)"},"fr-dj":{"englishName":"French (Djibouti)","nativeName":"français (Djibouti)"},"fr-dz":{"englishName":"French (Algeria)","nativeName":"français (Algérie)"},"fr-fr":{"englishName":"French (France)","nativeName":"français (France)"},"fr-ga":{"englishName":"French (Gabon)","nativeName":"français (Gabon)"},"fr-gf":{"englishName":"French (French Guiana)","nativeName":"français (Guyane française)"},"fr-gn":{"englishName":"French (Guinea)","nativeName":"français (Guinée)"},"fr-gp":{"englishName":"French (Guadeloupe)","nativeName":"français (Guadeloupe)"},"fr-gq":{"englishName":"French (Equatorial Guinea)","nativeName":"français (Guinée équatoriale)"},"fr-ht":{"englishName":"French (Haiti)","nativeName":"français (Haïti)"},"fr-km":{"englishName":"French (Comoros)","nativeName":"français (Comores)"},"fr-lu":{"englishName":"French (Luxembourg)","nativeName":"français (Luxembourg)"},"fr-ma":{"englishName":"French (Morocco)","nativeName":"français (Maroc)"},"fr-mc":{"englishName":"French (Monaco)","nativeName":"français (Monaco)"},"fr-mf":{"englishName":"French (Saint Martin)","nativeName":"français (Saint-Martin)"},"fr-mg":{"englishName":"French (Madagascar)","nativeName":"français (Madagascar)"},"fr-ml":{"englishName":"French (Mali)","nativeName":"français (Mali)"},"fr-mq":{"englishName":"French (Martinique)","nativeName":"français (Martinique)"},"fr-mr":{"englishName":"French (Mauritania)","nativeName":"français (Mauritanie)"},"fr-mu":{"englishName":"French (Mauritius)","nativeName":"français (Maurice)"},"fr-nc":{"englishName":"French (New Caledonia)","nativeName":"français (Nouvelle-Calédonie)"},"fr-ne":{"englishName":"French (Niger)","nativeName":"français (Niger)"},"fr-pf":{"englishName":"French (French Polynesia)","nativeName":"français (Polynésie française)"},"fr-pm":{"englishName":"French (Saint Pierre and Miquelon)","nativeName":"français (Saint-Pierre-et-Miquelon)"},"fr-re":{"englishName":"French (Réunion)","nativeName":"français (La Réunion)"},"fr-rw":{"englishName":"French (Rwanda)","nativeName":"français (Rwanda)"},"fr-sc":{"englishName":"French (Seychelles)","nativeName":"français (Seychelles)"},"fr-sn":{"englishName":"French (Senegal)","nativeName":"français (Sénégal)"},"fr-sy":{"englishName":"French (Syria)","nativeName":"français (Syrie)"},"fr-td":{"englishName":"French (Chad)","nativeName":"français (Tchad)"},"fr-tg":{"englishName":"French (Togo)","nativeName":"français (Togo)"},"fr-tn":{"englishName":"French (Tunisia)","nativeName":"français (Tunisie)"},"fr-vu":{"englishName":"French (Vanuatu)","nativeName":"français (Vanuatu)"},"fr-wf":{"englishName":"French (Wallis and Futuna)","nativeName":"français (Wallis-et-Futuna)"},"fr-yt":{"englishName":"French (Mayotte)","nativeName":"français (Mayotte)"},"fur":{"englishName":"Friulian","nativeName":"furlan"},"fur-it":{"englishName":"Friulian (Italy)","nativeName":"furlan (Italie)"},"fy":{"englishName":"Western Frisian","nativeName":"Frysk"},"fy-nl":{"englishName":"Western Frisian (Netherlands)","nativeName":"Frysk (Nederlân)"},"ga":{"englishName":"Irish","nativeName":"Gaeilge"},"ga-ie":{"englishName":"Irish (Ireland)","nativeName":"Gaeilge (Éire)"},"gd":{"englishName":"Scottish Gaelic","nativeName":"G� idhlig"},"gd-gb":{"englishName":"Scottish Gaelic (United Kingdom)","nativeName":"G� idhlig (An Rìoghachd Aonaichte)"},"gl":{"englishName":"Galician","nativeName":"galego"},"gl-es":{"englishName":"Galician (Galician)","nativeName":"galego (galego)"},"gn":{"englishName":"Guarani","nativeName":"Avañe’ẽ"},"gn-py":{"englishName":"Guarani (Paraguay)","nativeName":"Avañe’ẽ (Paraguái)"},"gsw":{"englishName":"Alsatian","nativeName":"Elsässisch"},"gsw-ch":{"englishName":"Alsatian (Switzerland)","nativeName":"Elsässisch (Schwiiz)"},"gsw-fr":{"englishName":"Alsatian (France)","nativeName":"Elsässisch (Fr� nkrisch)"},"gsw-li":{"englishName":"Alsatian (Liechtenstein)","nativeName":"Elsässisch (Liächteschtäi)"},"gu":{"englishName":"Gujarati","nativeName":"ગુજરાતી"},"gu-in":{"englishName":"Gujarati (India)","nativeName":"ગુજરાતી (ભારત)"},"guz":{"englishName":"Gusii","nativeName":"Ekegusii"},"guz-ke":{"englishName":"Gusii (Kenya)","nativeName":"Ekegusii (Kenya)"},"gv":{"englishName":"Manx","nativeName":"Gaelg"},"gv-im":{"englishName":"Manx (Isle of Man)","nativeName":"Gaelg (Ellan Vannin)"},"ha":{"englishName":"Hausa","nativeName":"Hausa"},"ha-latn":{"englishName":"Hausa (Latin)","nativeName":"Hausa"},"ha-latn-gh":{"englishName":"Hausa (Latin, Ghana)","nativeName":"Hausa (Gana)"},"ha-latn-ne":{"englishName":"Hausa (Latin, Niger)","nativeName":"Hausa (Nijar)"},"ha-latn-ng":{"englishName":"Hausa (Latin, Nigeria)","nativeName":"Hausa (Najeriya)"},"haw":{"englishName":"Hawaiian","nativeName":"ʻŌlelo HawaiÊ»i"},"haw-us":{"englishName":"Hawaiian (United States)","nativeName":"ʻŌlelo HawaiÊ»i (Ê»Amelika Hui PÅ« Ê»Ia)"},"he":{"englishName":"Hebrew","nativeName":"עברית"},"he-il":{"englishName":"Hebrew (Israel)","nativeName":"עברית (ישראל)"},"hi":{"englishName":"Hindi","nativeName":"हिंदी"},"hi-in":{"englishName":"Hindi (India)","nativeName":"हिंदी (भारत)"},"hr":{"englishName":"Croatian","nativeName":"hrvatski"},"hr-ba":{"englishName":"Croatian (Bosnia and Herzegovina)","nativeName":"hrvatski (Bosna i Hercegovina)"},"hr-hr":{"englishName":"Croatian (Croatia)","nativeName":"hrvatski (Hrvatska)"},"hsb":{"englishName":"Upper Sorbian","nativeName":"hornjoserbšćina"},"hsb-de":{"englishName":"Upper Sorbian (Germany)","nativeName":"hornjoserbšćina (NÄ›mska)"},"hu":{"englishName":"Hungarian","nativeName":"magyar"},"hu-hu":{"englishName":"Hungarian (Hungary)","nativeName":"magyar (Magyarország)"},"hy":{"englishName":"Armenian","nativeName":"Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶"},"hy-am":{"englishName":"Armenian (Armenia)","nativeName":"Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶ (Õ€Õ¡ÕµÕ¡Õ½Õ¿Õ¡Õ¶)"},"ia":{"englishName":"Interlingua","nativeName":"interlingua"},"ia-001":{"englishName":"Interlingua (World)","nativeName":"interlingua (World)"},"ia-fr":{"englishName":"Interlingua (France)","nativeName":"interlingua (Francia)"},"ibb":{"englishName":"Ibibio","nativeName":"Ibibio-Efik"},"ibb-ng":{"englishName":"Ibibio (Nigeria)","nativeName":"Ibibio-Efik (Nigeria)"},"id":{"englishName":"Indonesian","nativeName":"Indonesia"},"id-id":{"englishName":"Indonesian (Indonesia)","nativeName":"Indonesia (Indonesia)"},"ig":{"englishName":"Igbo","nativeName":"Igbo"},"ig-ng":{"englishName":"Igbo (Nigeria)","nativeName":"Igbo (Nigeria)"},"ii":{"englishName":"Yi","nativeName":"ꆈ�� ꁱꂷ"},"ii-cn":{"englishName":"Yi (China)","nativeName":"ꆈ�� ꁱꂷ (ꍏꉸꏓꂱꇭꉼꇩ)"},"is":{"englishName":"Icelandic","nativeName":"íslenska"},"is-is":{"englishName":"Icelandic (Iceland)","nativeName":"íslenska (Ísland)"},"it":{"englishName":"Italian","nativeName":"italiano"},"it-ch":{"englishName":"Italian (Switzerland)","nativeName":"italiano (Svizzera)"},"it-it":{"englishName":"Italian (Italy)","nativeName":"italiano (Italia)"},"it-sm":{"englishName":"Italian (San Marino)","nativeName":"italiano (San Marino)"},"iu":{"englishName":"Inuktitut","nativeName":"Inuktitut"},"iu-cans":{"englishName":"Inuktitut (Syllabics)","nativeName":"ᐃᓄᒃᑎᑐᑦ"},"iu-cans-ca":{"englishName":"Inuktitut (Syllabics, Canada)","nativeName":"ᐃᓄᒃᑎᑐᑦ (ᑲᓇᑕᒥ)"},"iu-latn":{"englishName":"Inuktitut (Latin)","nativeName":"Inuktitut"},"iu-latn-ca":{"englishName":"Inuktitut (Latin, Canada)","nativeName":"Inuktitut (Kanatami)"},"ja":{"englishName":"Japanese","nativeName":"日本語"},"ja-jp":{"englishName":"Japanese (Japan)","nativeName":"日本語 (日本)"},"jgo":{"englishName":"Ngomba","nativeName":"Ndaꞌa"},"jgo-cm":{"englishName":"Ngomba (Cameroon)","nativeName":"Ndaꞌa (KamÉ›lûn)"},"jmc":{"englishName":"Machame","nativeName":"Kimachame"},"jmc-tz":{"englishName":"Machame (Tanzania)","nativeName":"Kimachame (Tanzania)"},"jv":{"englishName":"Javanese","nativeName":"Basa Jawa"},"jv-java":{"englishName":"Javanese (Javanese)","nativeName":"ꦧꦱꦗꦮ"},"jv-java-id":{"englishName":"Javanese (Javanese, Indonesia)","nativeName":"ꦧꦱꦗꦮ (Indonesia)"},"jv-latn":{"englishName":"Javanese","nativeName":"Basa Jawa"},"jv-latn-id":{"englishName":"Javanese (Indonesia)","nativeName":"Basa Jawa (Indonesia)"},"ka":{"englishName":"Georgian","nativeName":"ქა�� თული"},"ka-ge":{"englishName":"Georgian (Georgia)","nativeName":"ქა�� თული (საქა�� თველო)"},"kab":{"englishName":"Kabyle","nativeName":"Taqbaylit"},"kab-dz":{"englishName":"Kabyle (Algeria)","nativeName":"Taqbaylit (Lezzayer)"},"kam":{"englishName":"Kamba","nativeName":"Kikamba"},"kam-ke":{"englishName":"Kamba (Kenya)","nativeName":"Kikamba (Kenya)"},"kde":{"englishName":"Makonde","nativeName":"Chimakonde"},"kde-tz":{"englishName":"Makonde (Tanzania)","nativeName":"Chimakonde (Tanzania)"},"kea":{"englishName":"Kabuverdianu","nativeName":"kabuverdianu"},"kea-cv":{"englishName":"Kabuverdianu (Cabo Verde)","nativeName":"kabuverdianu (Kabu Verdi)"},"khq":{"englishName":"Koyra Chiini","nativeName":"Koyra ciini"},"khq-ml":{"englishName":"Koyra Chiini (Mali)","nativeName":"Koyra ciini (Maali)"},"ki":{"englishName":"Kikuyu","nativeName":"Gikuyu"},"ki-ke":{"englishName":"Kikuyu (Kenya)","nativeName":"Gikuyu (Kenya)"},"kk":{"englishName":"Kazakh","nativeName":"қазақ тілі"},"kk-kz":{"englishName":"Kazakh (Kazakhstan)","nativeName":"қазақ тілі (Қазақстан)"},"kkj":{"englishName":"Kako","nativeName":"kakÉ”"},"kkj-cm":{"englishName":"Kako (Cameroon)","nativeName":"kakÉ” (KamÉ›run)"},"kl":{"englishName":"Greenlandic","nativeName":"kalaallisut"},"kl-gl":{"englishName":"Greenlandic (Greenland)","nativeName":"kalaallisut (Kalaallit Nunaat)"},"kln":{"englishName":"Kalenjin","nativeName":"Kalenjin"},"kln-ke":{"englishName":"Kalenjin (Kenya)","nativeName":"Kalenjin (Emetab Kenya)"},"km":{"englishName":"Khmer","nativeName":"ភាសាខ្មែរ"},"km-kh":{"englishName":"Khmer (Cambodia)","nativeName":"ភាសាខ្មែរ (កម្ពុជា)"},"kn":{"englishName":"Kannada","nativeName":"ಕನ್ನಡ"},"kn-in":{"englishName":"Kannada (India)","nativeName":"ಕನ್ನಡ (ಭಾರತ)"},"ko":{"englishName":"Korean","nativeName":"한국어"},"ko-kp":{"englishName":"Korean (North Korea)","nativeName":"한국어 (조�� 민주주의인민공화국)"},"ko-kr":{"englishName":"Korean (Korea)","nativeName":"한국어(대한민국)"},"kok":{"englishName":"Konkani","nativeName":"कोंकणी"},"kok-in":{"englishName":"Konkani (India)","nativeName":"कोंकणी (भारत)"},"kr":{"englishName":"Kanuri","nativeName":"Kanuri"},"kr-ng":{"englishName":"Kanuri (Nigeria)","nativeName":"Kanuri (Nigeria)"},"ks":{"englishName":"Kashmiri","nativeName":"کٲشُر"},"ks-arab":{"englishName":"Kashmiri (Perso-Arabic)","nativeName":"کٲشُر"},"ks-arab-in":{"englishName":"Kashmiri (Perso-Arabic)","nativeName":"کٲشُر (اَربی)"},"ks-deva":{"englishName":"Kashmiri (Devanagari)","nativeName":"कॉशुर"},"ks-deva-in":{"englishName":"Kashmiri (Devanagari, India)","nativeName":"कॉशुर (India)"},"ksb":{"englishName":"Shambala","nativeName":"Kishambaa"},"ksb-tz":{"englishName":"Shambala (Tanzania)","nativeName":"Kishambaa (Tanzania)"},"ksf":{"englishName":"Bafia","nativeName":"rikpa"},"ksf-cm":{"englishName":"Bafia (Cameroon)","nativeName":"rikpa (kamÉ›rún)"},"ksh":{"englishName":"Ripuarian","nativeName":"Kölsch"},"ksh-de":{"englishName":"Ripuarian (Germany)","nativeName":"Kölsch (Doütschland)"},"ku":{"englishName":"Central Kurdish","nativeName":"کوردیی ناوەڕاست"},"ku-arab":{"englishName":"Central Kurdish","nativeName":"کوردیی ناوەڕاست"},"ku-arab-iq":{"englishName":"Central Kurdish (Iraq)","nativeName":"کوردیی ناوەڕاست (کوردستان)"},"ku-arab-ir":{"englishName":"Kurdish (Perso-Arabic, Iran)","nativeName":"کوردی (ئێران)"},"kw":{"englishName":"Cornish","nativeName":"kernewek"},"kw-gb":{"englishName":"Cornish (United Kingdom)","nativeName":"kernewek (Rywvaneth Unys)"},"ky":{"englishName":"Kyrgyz","nativeName":"Кыргыз"},"ky-kg":{"englishName":"Kyrgyz (Kyrgyzstan)","nativeName":"Кыргыз (Кыргызстан)"},"la":{"englishName":"Latin","nativeName":"lingua latÄ«na"},"la-001":{"englishName":"Latin (World)","nativeName":"lingua latÄ«na (World)"},"lag":{"englishName":"Langi","nativeName":"Kɨlaangi"},"lag-tz":{"englishName":"Langi (Tanzania)","nativeName":"Kɨlaangi (Taansanía)"},"lb":{"englishName":"Luxembourgish","nativeName":"Lëtzebuergesch"},"lb-lu":{"englishName":"Luxembourgish (Luxembourg)","nativeName":"Lëtzebuergesch (Lëtzebuerg)"},"lg":{"englishName":"Ganda","nativeName":"Luganda"},"lg-ug":{"englishName":"Ganda (Uganda)","nativeName":"Luganda (Yuganda)"},"lkt":{"englishName":"Lakota","nativeName":"Lakȟólʼiyapi"},"lkt-us":{"englishName":"Lakota (United States)","nativeName":"Lakȟólʼiyapi (MílahaÅ‹ska TÈŸamákÈŸočhe)"},"ln":{"englishName":"Lingala","nativeName":"lingála"},"ln-ao":{"englishName":"Lingala (Angola)","nativeName":"lingála (Angóla)"},"ln-cd":{"englishName":"Lingala (Congo DRC)","nativeName":"lingála (Repibiki demokratiki ya Kongó)"},"ln-cf":{"englishName":"Lingala (Central African Republic)","nativeName":"lingála (Repibiki ya Afríka ya Káti)"},"ln-cg":{"englishName":"Lingala (Congo)","nativeName":"lingála (Kongo)"},"lo":{"englishName":"Lao","nativeName":"ລາວ"},"lo-la":{"englishName":"Lao (Laos)","nativeName":"ລາວ (ລາວ)"},"lrc":{"englishName":"Northern Luri","nativeName":"لۊری شومالی"},"lrc-iq":{"englishName":"Northern Luri (Iraq)","nativeName":"لۊری شومالی (Iraq)"},"lrc-ir":{"englishName":"Northern Luri (Iran)","nativeName":"لۊری شومالی (Iran)"},"lt":{"englishName":"Lithuanian","nativeName":"lietuvių"},"lt-lt":{"englishName":"Lithuanian (Lithuania)","nativeName":"lietuvių (Lietuva)"},"lu":{"englishName":"Luba-Katanga","nativeName":"Tshiluba"},"lu-cd":{"englishName":"Luba-Katanga (Congo DRC)","nativeName":"Tshiluba (Ditunga wa Kongu)"},"luo":{"englishName":"Luo","nativeName":"Dholuo"},"luo-ke":{"englishName":"Luo (Kenya)","nativeName":"Dholuo (Kenya)"},"luy":{"englishName":"Luyia","nativeName":"Luluhia"},"luy-ke":{"englishName":"Luyia (Kenya)","nativeName":"Luluhia (Kenya)"},"lv":{"englishName":"Latvian","nativeName":"latvieÅ¡u"},"lv-lv":{"englishName":"Latvian (Latvia)","nativeName":"latvieÅ¡u (Latvija)"},"mas":{"englishName":"Masai","nativeName":"Maa"},"mas-ke":{"englishName":"Masai (Kenya)","nativeName":"Maa (Kenya)"},"mas-tz":{"englishName":"Masai (Tanzania)","nativeName":"Maa (Tansania)"},"mer":{"englishName":"Meru","nativeName":"KÄ©mÄ©rÅ©"},"mer-ke":{"englishName":"Meru (Kenya)","nativeName":"KÄ©mÄ©rÅ© (Kenya)"},"mfe":{"englishName":"Morisyen","nativeName":"kreol morisien"},"mfe-mu":{"englishName":"Morisyen (Mauritius)","nativeName":"kreol morisien (Moris)"},"mg":{"englishName":"Malagasy","nativeName":"Malagasy"},"mg-mg":{"englishName":"Malagasy (Madagascar)","nativeName":"Malagasy (Madagasikara)"},"mgh":{"englishName":"Makhuwa-Meetto","nativeName":"Makua"},"mgh-mz":{"englishName":"Makhuwa-Meetto (Mozambique)","nativeName":"Makua (Umozambiki)"},"mgo":{"englishName":"Metaʼ","nativeName":"metaʼ"},"mgo-cm":{"englishName":"Metaʼ (Cameroon)","nativeName":"metaʼ (Kamalun)"},"mi":{"englishName":"Maori","nativeName":"Reo Māori"},"mi-nz":{"englishName":"Maori (New Zealand)","nativeName":"Reo Māori (Aotearoa)"},"mk":{"englishName":"Macedonian","nativeName":"македонски"},"mk-mk":{"englishName":"Macedonian (Macedonia, FYRO)","nativeName":"македонски (� епублика Македонија)"},"ml":{"englishName":"Malayalam","nativeName":"മലയാളം"},"ml-in":{"englishName":"Malayalam (India)","nativeName":"മലയാളം (ഇന്ത്യ)"},"mn":{"englishName":"Mongolian","nativeName":"Монгол хэл"},"mn-cyrl":{"englishName":"Mongolian","nativeName":"монгол"},"mn-mn":{"englishName":"Mongolian (Mongolia)","nativeName":"монгол (Монгол)"},"mn-mong":{"englishName":"Mongolian (Traditional Mongolian)","nativeName":"� �� �� �� �� �� �� � � �� �� �� �"},"mn-mong-cn":{"englishName":"Mongolian (Traditional Mongolian, China)","nativeName":"� �� �� �� �� �� �� � � �� �� �� � (� �� �� �� �� �� � � �� � �� �� � �� �� � �� � � �� �� �� �� � �� � � � �� � � � �� �� �� �)"},"mn-mong-mn":{"englishName":"Mongolian (Traditional Mongolian, Mongolia)","nativeName":"� �� �� �� �� �� �� � � �� �� �� � (� �� �� �� �� �� �� � � �� �� �� �)"},"mni":{"englishName":"Manipuri","nativeName":"মৈতৈলোন্"},"mni-in":{"englishName":"Manipuri (India)","nativeName":"মৈতৈলোন্ (India)"},"moh":{"englishName":"Mohawk","nativeName":"Kanien’kéha"},"moh-ca":{"englishName":"Mohawk (Mohawk)","nativeName":"Kanien\'kéha"},"mr":{"englishName":"Marathi","nativeName":"मरा�� ी"},"mr-in":{"englishName":"Marathi (India)","nativeName":"मरा�� ी (भारत)"},"ms":{"englishName":"Malay","nativeName":"Bahasa Melayu"},"ms-bn":{"englishName":"Malay (Brunei)","nativeName":"Bahasa Melayu (Brunei)"},"ms-my":{"englishName":"Malay (Malaysia)","nativeName":"Bahasa Melayu (Malaysia)"},"ms-sg":{"englishName":"Malay (Singapore)","nativeName":"Bahasa Melayu (Singapura)"},"mt":{"englishName":"Maltese","nativeName":"Malti"},"mt-mt":{"englishName":"Maltese (Malta)","nativeName":"Malti (Malta)"},"mua":{"englishName":"Mundang","nativeName":"MUNDAÅŠ"},"mua-cm":{"englishName":"Mundang (Cameroon)","nativeName":"MUNDAÅŠ (kameruÅ‹)"},"my":{"englishName":"Burmese","nativeName":"ဗမာ"},"my-mm":{"englishName":"Burmese (Myanmar)","nativeName":"ဗမာ (မြန်မာ)"},"mzn":{"englishName":"Mazanderani","nativeName":"مازرونی"},"mzn-ir":{"englishName":"Mazanderani (Iran)","nativeName":"مازرونی (ایران)"},"naq":{"englishName":"Nama","nativeName":"Khoekhoegowab"},"naq-na":{"englishName":"Nama (Namibia)","nativeName":"Khoekhoegowab (Namibiab)"},"nb":{"englishName":"Norwegian BokmÃ¥l","nativeName":"norsk bokmÃ¥l"},"nb-no":{"englishName":"Norwegian BokmÃ¥l (Norway)","nativeName":"norsk bokmÃ¥l (Norge)"},"nb-sj":{"englishName":"Norwegian BokmÃ¥l (Svalbard and Jan Mayen)","nativeName":"norsk bokmÃ¥l (Svalbard og Jan Mayen)"},"nd":{"englishName":"North Ndebele","nativeName":"isiNdebele"},"nd-zw":{"englishName":"North Ndebele (Zimbabwe)","nativeName":"isiNdebele (Zimbabwe)"},"ne":{"englishName":"Nepali","nativeName":"नेपाली"},"ne-in":{"englishName":"Nepali (India)","nativeName":"नेपाली (भारत)"},"ne-np":{"englishName":"Nepali (Nepal)","nativeName":"नेपाली (नेपाल)"},"nl":{"englishName":"Dutch","nativeName":"Nederlands"},"nl-aw":{"englishName":"Dutch (Aruba)","nativeName":"Nederlands (Aruba)"},"nl-be":{"englishName":"Dutch (Belgium)","nativeName":"Nederlands (België)"},"nl-bq":{"englishName":"Dutch (Bonaire, Sint Eustatius and Saba)","nativeName":"Nederlands (Bonaire, Sint Eustatius en Saba)"},"nl-cw":{"englishName":"Dutch (Curaçao)","nativeName":"Nederlands (Curaçao)"},"nl-nl":{"englishName":"Dutch (Netherlands)","nativeName":"Nederlands (Nederland)"},"nl-sr":{"englishName":"Dutch (Suriname)","nativeName":"Nederlands (Suriname)"},"nl-sx":{"englishName":"Dutch (Sint Maarten)","nativeName":"Nederlands (Sint-Maarten)"},"nmg":{"englishName":"Kwasio","nativeName":"Kwasio"},"nmg-cm":{"englishName":"Kwasio (Cameroon)","nativeName":"Kwasio (Kamerun)"},"nn":{"englishName":"Norwegian Nynorsk","nativeName":"nynorsk"},"nn-no":{"englishName":"Norwegian Nynorsk (Norway)","nativeName":"nynorsk (Noreg)"},"nnh":{"englishName":"Ngiemboon","nativeName":"Shwóŋò ngiembɔɔn"},"nnh-cm":{"englishName":"Ngiemboon (Cameroon)","nativeName":"Shwóŋò ngiembɔɔn (K� malûm)"},"no":{"englishName":"Norwegian","nativeName":"norsk"},"nqo":{"englishName":"N\'ko","nativeName":"ߒߞߏ"},"nqo-gn":{"englishName":"N\'ko (Guinea)","nativeName":"ߒߞߏ (ߖߌ߬ߣߍ߬ ߞߊ߲ߓߍ߲)"},"nr":{"englishName":"South Ndebele","nativeName":"isiNdebele"},"nr-za":{"englishName":"South Ndebele (South Africa)","nativeName":"isiNdebele (South Africa)"},"nso":{"englishName":"Sesotho sa Leboa","nativeName":"Sesotho sa Leboa"},"nso-za":{"englishName":"Sesotho sa Leboa (South Africa)","nativeName":"Sesotho sa Leboa (Afrika Borwa)"},"nus":{"englishName":"Nuer","nativeName":"Thok Nath"},"nus-ss":{"englishName":"Nuer (South Sudan)","nativeName":"Thok Nath (South Sudan)"},"nyn":{"englishName":"Nyankole","nativeName":"Runyankore"},"nyn-ug":{"englishName":"Nyankole (Uganda)","nativeName":"Runyankore (Uganda)"},"oc":{"englishName":"Occitan","nativeName":"Occitan"},"oc-fr":{"englishName":"Occitan (France)","nativeName":"Occitan (França)"},"om":{"englishName":"Oromo","nativeName":"Oromoo"},"om-et":{"englishName":"Oromo (Ethiopia)","nativeName":"Oromoo (Itoophiyaa)"},"om-ke":{"englishName":"Oromo (Kenya)","nativeName":"Oromoo (Keeniyaa)"},"or":{"englishName":"Odia","nativeName":"ଓଡ଼ିଆ"},"or-in":{"englishName":"Odia (India)","nativeName":"ଓଡ଼ିଆ (ଭାରତ)"},"os":{"englishName":"Ossetian","nativeName":"Ирон æвзаг"},"os-ge":{"englishName":"Ossetian (Georgia)","nativeName":"Ирон æвзаг (Гуырдзыстон)"},"os-ru":{"englishName":"Ossetian (Russia)","nativeName":"Ирон æвзаг (Уӕрӕсе)"},"pa":{"englishName":"Punjabi","nativeName":"ਪੰਜਾਬੀ"},"pa-arab":{"englishName":"Punjabi","nativeName":"پنجابی"},"pa-arab-pk":{"englishName":"Punjabi (Pakistan)","nativeName":"پنجابی (پاکستان)"},"pa-in":{"englishName":"Punjabi (India)","nativeName":"ਪੰਜਾਬੀ (ਭਾਰਤ)"},"pap":{"englishName":"Papiamento","nativeName":"Papiamentu"},"pap-029":{"englishName":"Papiamento (Caribbean)","nativeName":"Papiamentu (Caribbean)"},"pl":{"englishName":"Polish","nativeName":"polski"},"pl-pl":{"englishName":"Polish (Poland)","nativeName":"polski (Polska)"},"prg":{"englishName":"Prussian","nativeName":"prÅ«siskan"},"prg-001":{"englishName":"Prussian (World)","nativeName":"prÅ«siskan (swÄ«tai)"},"prs":{"englishName":"Dari","nativeName":"درى"},"prs-af":{"englishName":"Dari (Afghanistan)","nativeName":"درى (افغانستان)"},"ps":{"englishName":"Pashto","nativeName":"پښتو"},"ps-af":{"englishName":"Pashto (Afghanistan)","nativeName":"پښتو (افغانستان)"},"pt":{"englishName":"Portuguese","nativeName":"português"},"pt-ao":{"englishName":"Portuguese (Angola)","nativeName":"português (Angola)"},"pt-br":{"englishName":"Portuguese (Brazil)","nativeName":"português (Brasil)"},"pt-cv":{"englishName":"Portuguese (Cabo Verde)","nativeName":"português (Cabo Verde)"},"pt-gw":{"englishName":"Portuguese (Guinea-Bissau)","nativeName":"português (Guiné-Bissau)"},"pt-mo":{"englishName":"Portuguese (Macao SAR)","nativeName":"português (RAE de Macau)"},"pt-mz":{"englishName":"Portuguese (Mozambique)","nativeName":"português (Moçambique)"},"pt-pt":{"englishName":"Portuguese (Portugal)","nativeName":"português (Portugal)"},"pt-st":{"englishName":"Portuguese (São Tomé and Príncipe)","nativeName":"português (São Tomé e Príncipe)"},"pt-tl":{"englishName":"Portuguese (Timor-Leste)","nativeName":"português (Timor-Leste)"},"quc":{"englishName":"K\'iche\'","nativeName":"K\'iche\'"},"quc-latn":{"englishName":"K\'iche\'","nativeName":"K\'iche\'"},"quc-latn-gt":{"englishName":"K\'iche\' (Guatemala)","nativeName":"K\'iche\' (Guatemala)"},"quz":{"englishName":"Quechua","nativeName":"runasimi"},"quz-bo":{"englishName":"Quechua (Bolivia)","nativeName":"runasimi (Qullasuyu)"},"quz-ec":{"englishName":"Quichua (Ecuador)","nativeName":"runa shimi (Ecuador Suyu)"},"quz-pe":{"englishName":"Quechua (Peru)","nativeName":"runasimi (Peru)"},"rm":{"englishName":"Romansh","nativeName":"rumantsch"},"rm-ch":{"englishName":"Romansh (Switzerland)","nativeName":"rumantsch (Svizra)"},"rn":{"englishName":"Rundi","nativeName":"Ikirundi"},"rn-bi":{"englishName":"Rundi (Burundi)","nativeName":"Ikirundi (Uburundi)"},"ro":{"englishName":"Romanian","nativeName":"română"},"ro-md":{"englishName":"Romanian (Moldova)","nativeName":"română (Republica Moldova)"},"ro-ro":{"englishName":"Romanian (Romania)","nativeName":"română (România)"},"rof":{"englishName":"Rombo","nativeName":"Kihorombo"},"rof-tz":{"englishName":"Rombo (Tanzania)","nativeName":"Kihorombo (Tanzania)"},"ru":{"englishName":"Russian","nativeName":"русский"},"ru-by":{"englishName":"Russian (Belarus)","nativeName":"русский (Беларусь)"},"ru-kg":{"englishName":"Russian (Kyrgyzstan)","nativeName":"русский (Киргизия)"},"ru-kz":{"englishName":"Russian (Kazakhstan)","nativeName":"русский (Казахстан)"},"ru-md":{"englishName":"Russian (Moldova)","nativeName":"русский (Молдова)"},"ru-ru":{"englishName":"Russian (Russia)","nativeName":"русский (� оссия)"},"ru-ua":{"englishName":"Russian (Ukraine)","nativeName":"русский (Украина)"},"rw":{"englishName":"Kinyarwanda","nativeName":"Kinyarwanda"},"rw-rw":{"englishName":"Kinyarwanda (Rwanda)","nativeName":"Kinyarwanda (Rwanda)"},"rwk":{"englishName":"Rwa","nativeName":"Kiruwa"},"rwk-tz":{"englishName":"Rwa (Tanzania)","nativeName":"Kiruwa (Tanzania)"},"sa":{"englishName":"Sanskrit","nativeName":"संस्कृत"},"sa-in":{"englishName":"Sanskrit (India)","nativeName":"संस्कृत (भारतम्)"},"sah":{"englishName":"Sakha","nativeName":"Саха"},"sah-ru":{"englishName":"Sakha (Russia)","nativeName":"Саха (� оссия)"},"saq":{"englishName":"Samburu","nativeName":"Kisampur"},"saq-ke":{"englishName":"Samburu (Kenya)","nativeName":"Kisampur (Kenya)"},"sbp":{"englishName":"Sangu","nativeName":"Ishisangu"},"sbp-tz":{"englishName":"Sangu (Tanzania)","nativeName":"Ishisangu (Tansaniya)"},"sd":{"englishName":"Sindhi","nativeName":"سنڌي"},"sd-arab":{"englishName":"Sindhi","nativeName":"سنڌي"},"sd-arab-pk":{"englishName":"Sindhi (Pakistan)","nativeName":"سنڌي (پاکستان)"},"sd-deva":{"englishName":"Sindhi (Devanagari)","nativeName":"सिन्धी"},"sd-deva-in":{"englishName":"Sindhi (Devanagari, India)","nativeName":"सिन्धी (India)"},"se":{"englishName":"Northern Sami","nativeName":"davvisámegiella"},"se-fi":{"englishName":"Sami, Northern (Finland)","nativeName":"davvisámegiella (Suopma)"},"se-no":{"englishName":"Sami, Northern (Norway)","nativeName":"davvisámegiella (Norga)"},"se-se":{"englishName":"Sami, Northern (Sweden)","nativeName":"davvisámegiella (Ruoŧŧa)"},"seh":{"englishName":"Sena","nativeName":"sena"},"seh-mz":{"englishName":"Sena (Mozambique)","nativeName":"sena (Moçambique)"},"ses":{"englishName":"Koyraboro Senni","nativeName":"Koyraboro senni"},"ses-ml":{"englishName":"Koyraboro Senni (Mali)","nativeName":"Koyraboro senni (Maali)"},"sg":{"englishName":"Sango","nativeName":"Sängö"},"sg-cf":{"englishName":"Sango (Central African Republic)","nativeName":"Sängö (Ködörösêse tî Bêafrîka)"},"shi":{"englishName":"Tachelhit","nativeName":"ⵜⴰⵛⵍⵃⵉⵜ"},"shi-latn":{"englishName":"Tachelhit (Latin)","nativeName":"Tashelḥiyt"},"shi-latn-ma":{"englishName":"Tachelhit (Latin, Morocco)","nativeName":"Tashelḥiyt (lmÉ£rib)"},"shi-tfng":{"englishName":"Tachelhit (Tifinagh)","nativeName":"ⵜⴰⵛⵍⵃⵉⵜ"},"shi-tfng-ma":{"englishName":"Tachelhit (Tifinagh, Morocco)","nativeName":"ⵜⴰⵛⵍⵃⵉⵜ (ⵍⵎⵖⵔⵉⴱ)"},"si":{"englishName":"Sinhala","nativeName":"සිංහල"},"si-lk":{"englishName":"Sinhala (Sri Lanka)","nativeName":"සිංහල (ශ්‍රී ලංකාව)"},"sk":{"englishName":"Slovak","nativeName":"slovenčina"},"sk-sk":{"englishName":"Slovak (Slovakia)","nativeName":"slovenčina (Slovensko)"},"sl":{"englishName":"Slovenian","nativeName":"slovenščina"},"sl-si":{"englishName":"Slovenian (Slovenia)","nativeName":"slovenščina (Slovenija)"},"sma":{"englishName":"Sami (Southern)","nativeName":"Ã¥arjelsaemiengïele"},"sma-no":{"englishName":"Sami, Southern (Norway)","nativeName":"Ã¥arjelsaemiengïele (Nöörje)"},"sma-se":{"englishName":"Sami, Southern (Sweden)","nativeName":"Ã¥arjelsaemiengïele (Sveerje)"},"smj":{"englishName":"Sami (Lule)","nativeName":"julevusámegiella"},"smj-no":{"englishName":"Sami, Lule (Norway)","nativeName":"julevusámegiella (Vuodna)"},"smj-se":{"englishName":"Sami, Lule (Sweden)","nativeName":"julevusámegiella (Svierik)"},"smn":{"englishName":"Sami (Inari)","nativeName":"anarâškielâ"},"smn-fi":{"englishName":"Sami, Inari (Finland)","nativeName":"anarâškielâ (Suomâ)"},"sms":{"englishName":"Sami (Skolt)","nativeName":"sää´mÇ©iõll"},"sms-fi":{"englishName":"Sami, Skolt (Finland)","nativeName":"sää´mÇ©iõll (Lää´ddjânnam)"},"sn":{"englishName":"Shona","nativeName":"chiShona"},"sn-latn":{"englishName":"Shona (Latin)","nativeName":"chiShona (Latin)"},"sn-latn-zw":{"englishName":"Shona (Latin, Zimbabwe)","nativeName":"chiShona (Zimbabwe)"},"so":{"englishName":"Somali","nativeName":"Soomaali"},"so-dj":{"englishName":"Somali (Djibouti)","nativeName":"Soomaali (Jabuuti)"},"so-et":{"englishName":"Somali (Ethiopia)","nativeName":"Soomaali (Itoobiya)"},"so-ke":{"englishName":"Somali (Kenya)","nativeName":"Soomaali (Kiiniya)"},"so-so":{"englishName":"Somali (Somalia)","nativeName":"Soomaali (Soomaaliya)"},"sq":{"englishName":"Albanian","nativeName":"shqip"},"sq-al":{"englishName":"Albanian (Albania)","nativeName":"shqip (Shqipëri)"},"sq-mk":{"englishName":"Albanian (Macedonia, FYRO)","nativeName":"shqip (Republika e Maqedonisë)"},"sq-xk":{"englishName":"Albanian (Kosovo)","nativeName":"shqip (Kosovë)"},"sr":{"englishName":"Serbian","nativeName":"srpski"},"sr-cyrl":{"englishName":"Serbian (Cyrillic)","nativeName":"српски"},"sr-cyrl-ba":{"englishName":"Serbian (Cyrillic, Bosnia and Herzegovina)","nativeName":"српски (Босна и Херцеговина)"},"sr-cyrl-me":{"englishName":"Serbian (Cyrillic, Montenegro)","nativeName":"српски (Црна Гора)"},"sr-cyrl-rs":{"englishName":"Serbian (Cyrillic, Serbia)","nativeName":"српски (Србија)"},"sr-cyrl-xk":{"englishName":"Serbian (Cyrillic, Kosovo)","nativeName":"српски (Косово)"},"sr-latn":{"englishName":"Serbian (Latin)","nativeName":"srpski"},"sr-latn-ba":{"englishName":"Serbian (Latin, Bosnia and Herzegovina)","nativeName":"srpski (Bosna i Hercegovina)"},"sr-latn-me":{"englishName":"Serbian (Latin, Montenegro)","nativeName":"srpski (Crna Gora)"},"sr-latn-rs":{"englishName":"Serbian (Latin, Serbia)","nativeName":"srpski (Srbija)"},"sr-latn-xk":{"englishName":"Serbian (Latin, Kosovo)","nativeName":"srpski (Kosovo)"},"ss":{"englishName":"siSwati","nativeName":"Siswati"},"ss-sz":{"englishName":"siSwati (Swaziland)","nativeName":"siSwati (Swaziland)"},"ss-za":{"englishName":"siSwati (South Africa)","nativeName":"siSwati (South Africa)"},"ssy":{"englishName":"Saho","nativeName":"Saho"},"ssy-er":{"englishName":"Saho (Eritrea)","nativeName":"Saho (Eretria)"},"st":{"englishName":"Sesotho","nativeName":"Sesotho"},"st-ls":{"englishName":"Sesotho (Lesotho)","nativeName":"Sesotho (Lesotho)"},"st-za":{"englishName":"Sesotho (South Africa)","nativeName":"Sesotho (South Africa)"},"sv":{"englishName":"Swedish","nativeName":"svenska"},"sv-ax":{"englishName":"Swedish (Ã…land Islands)","nativeName":"svenska (Ã…land)"},"sv-fi":{"englishName":"Swedish (Finland)","nativeName":"svenska (Finland)"},"sv-se":{"englishName":"Swedish (Sweden)","nativeName":"svenska (Sverige)"},"sw":{"englishName":"Kiswahili","nativeName":"Kiswahili"},"sw-cd":{"englishName":"Kiswahili (Congo DRC)","nativeName":"Kiswahili (Jamhuri ya Kidemokrasia ya Kongo)"},"sw-ke":{"englishName":"Kiswahili (Kenya)","nativeName":"Kiswahili (Kenya)"},"sw-tz":{"englishName":"Kiswahili (Tanzania)","nativeName":"Kiswahili (Tanzania)"},"sw-ug":{"englishName":"Kiswahili (Uganda)","nativeName":"Kiswahili (Uganda)"},"syr":{"englishName":"Syriac","nativeName":"ܣܘܪܝܝܐ"},"syr-sy":{"englishName":"Syriac (Syria)","nativeName":"ܣܘܪܝܝܐ (ܣܘܪܝܐ)"},"ta":{"englishName":"Tamil","nativeName":"தமிழ்"},"ta-in":{"englishName":"Tamil (India)","nativeName":"தமிழ் (இந்தியா)"},"ta-lk":{"englishName":"Tamil (Sri Lanka)","nativeName":"தமிழ் (இலங்கை)"},"ta-my":{"englishName":"Tamil (Malaysia)","nativeName":"தமிழ் (மலேசியா)"},"ta-sg":{"englishName":"Tamil (Singapore)","nativeName":"தமிழ் (சிங்கப்பூர்)"},"te":{"englishName":"Telugu","nativeName":"తెలుగు"},"te-in":{"englishName":"Telugu (India)","nativeName":"తెలుగు (భారత దేశం)"},"teo":{"englishName":"Teso","nativeName":"Kiteso"},"teo-ke":{"englishName":"Teso (Kenya)","nativeName":"Kiteso (Kenia)"},"teo-ug":{"englishName":"Teso (Uganda)","nativeName":"Kiteso (Uganda)"},"tg":{"englishName":"Tajik","nativeName":"Тоҷикӣ"},"tg-cyrl":{"englishName":"Tajik (Cyrillic)","nativeName":"Тоҷикӣ"},"tg-cyrl-tj":{"englishName":"Tajik (Cyrillic, Tajikistan)","nativeName":"Тоҷикӣ (Тоҷикистон)"},"th":{"englishName":"Thai","nativeName":"ไทย"},"th-th":{"englishName":"Thai (Thailand)","nativeName":"ไทย (ไทย)"},"ti":{"englishName":"Tigrinya","nativeName":"ትግርኛ"},"ti-er":{"englishName":"Tigrinya (Eritrea)","nativeName":"ትግርኛ (ኤርትራ)"},"ti-et":{"englishName":"Tigrinya (Ethiopia)","nativeName":"ትግርኛ (ኢትዮጵያ)"},"tig":{"englishName":"Tigre","nativeName":"ትግረ"},"tig-er":{"englishName":"Tigre (Eritrea)","nativeName":"ትግረ (ኤርትራ)"},"tk":{"englishName":"Turkmen","nativeName":"Türkmen dili"},"tk-tm":{"englishName":"Turkmen (Turkmenistan)","nativeName":"Türkmen dili (Türkmenistan)"},"tn":{"englishName":"Setswana","nativeName":"Setswana"},"tn-bw":{"englishName":"Setswana (Botswana)","nativeName":"Setswana (Botswana)"},"tn-za":{"englishName":"Setswana (South Africa)","nativeName":"Setswana (Aforika Borwa)"},"to":{"englishName":"Tongan","nativeName":"lea fakatonga"},"to-to":{"englishName":"Tongan (Tonga)","nativeName":"lea fakatonga (Tonga)"},"tr":{"englishName":"Turkish","nativeName":"Türkçe"},"tr-cy":{"englishName":"Turkish (Cyprus)","nativeName":"Türkçe (Kıbrıs)"},"tr-tr":{"englishName":"Turkish (Turkey)","nativeName":"Türkçe (Türkiye)"},"ts":{"englishName":"Tsonga","nativeName":"Xitsonga"},"ts-za":{"englishName":"Xitsonga (South Africa)","nativeName":"Xitsonga (South Africa)"},"tt":{"englishName":"Tatar","nativeName":"Татар"},"tt-ru":{"englishName":"Tatar (Russia)","nativeName":"Татар (� оссия)"},"twq":{"englishName":"Tasawaq","nativeName":"Tasawaq senni"},"twq-ne":{"englishName":"Tasawaq (Niger)","nativeName":"Tasawaq senni (Nižer)"},"tzm":{"englishName":"Central Atlas Tamazight","nativeName":"TamaziÉ£t n laá¹­laá¹£"},"tzm-arab":{"englishName":"Central Atlas Tamazight (Arabic)","nativeName":"أطلس المركزية التامازيتية"},"tzm-arab-ma":{"englishName":"Central Atlas Tamazight (Arabic, Morocco)","nativeName":"أطلس المركزية التامازيتية (Morocco)"},"tzm-latn":{"englishName":"Central Atlas Tamazight (Latin)","nativeName":"TamaziÉ£t n laá¹­laá¹£"},"tzm-latn-dz":{"englishName":"Central Atlas Tamazight (Latin, Algeria)","nativeName":"TamaziÉ£t n laá¹­laá¹£ (Djazaïr)"},"tzm-latn-ma":{"englishName":"Central Atlas Tamazight (Latin, Morocco)","nativeName":"TamaziÉ£t n laá¹­laá¹£ (Meṛṛuk)"},"tzm-tfng":{"englishName":"Central Atlas Tamazight (Tifinagh)","nativeName":"ⵜⴰⵎⴰⵣⵉⵖⵜ"},"tzm-tfng-ma":{"englishName":"Central Atlas Tamazight (Tifinagh, Morocco)","nativeName":"ⵜⴰⵎⴰⵣⵉⵖⵜ (ⵍⵎⵖⵔⵉⴱ)"},"ug":{"englishName":"Uyghur","nativeName":"ئۇيغۇرچە"},"ug-cn":{"englishName":"Uyghur (China)","nativeName":"ئۇيغۇرچە (جۇڭخۇا خەلق جۇمھۇرىيىتى)"},"uk":{"englishName":"Ukrainian","nativeName":"українська"},"uk-ua":{"englishName":"Ukrainian (Ukraine)","nativeName":"українська (Україна)"},"ur":{"englishName":"Urdu","nativeName":"اُردو"},"ur-in":{"englishName":"Urdu (India)","nativeName":"اردو (بھارت)"},"ur-pk":{"englishName":"Urdu (Pakistan)","nativeName":"اُردو (پاکستان)"},"uz":{"englishName":"Uzbek","nativeName":"o‘zbek"},"uz-arab":{"englishName":"Uzbek (Perso-Arabic)","nativeName":"اوزبیک"},"uz-arab-af":{"englishName":"Uzbek (Perso-Arabic, Afghanistan)","nativeName":"اوزبیک (افغانستان)"},"uz-cyrl":{"englishName":"Uzbek (Cyrillic)","nativeName":"Ўзбек"},"uz-cyrl-uz":{"englishName":"Uzbek (Cyrillic, Uzbekistan)","nativeName":"Ўзбек (Ўзбекистон)"},"uz-latn":{"englishName":"Uzbek (Latin)","nativeName":"o‘zbek"},"uz-latn-uz":{"englishName":"Uzbek (Latin, Uzbekistan)","nativeName":"o‘zbek (OÊ»zbekiston)"},"vai":{"englishName":"Vai","nativeName":"ꕙꔤ"},"vai-latn":{"englishName":"Vai (Latin)","nativeName":"Vai"},"vai-latn-lr":{"englishName":"Vai (Latin, Liberia)","nativeName":"Vai (Laibhiya)"},"vai-vaii":{"englishName":"Vai (Vai)","nativeName":"ꕙꔤ"},"vai-vaii-lr":{"englishName":"Vai (Vai, Liberia)","nativeName":"ꕙꔤ (ꕞꔤꔫꕩ)"},"ve":{"englishName":"Venda","nativeName":"Tshivenḓa"},"ve-za":{"englishName":"Venda (South Africa)","nativeName":"Tshivenḓa (South Africa)"},"vi":{"englishName":"Vietnamese","nativeName":"Tiếng Việt"},"vi-vn":{"englishName":"Vietnamese (Vietnam)","nativeName":"Tiếng Việt (Việt Nam)"},"vo":{"englishName":"Volapük","nativeName":"Volapük"},"vo-001":{"englishName":"Volapük (World)","nativeName":"Volapük (World)"},"vun":{"englishName":"Vunjo","nativeName":"Kyivunjo"},"vun-tz":{"englishName":"Vunjo (Tanzania)","nativeName":"Kyivunjo (Tanzania)"},"wae":{"englishName":"Walser","nativeName":"Walser"},"wae-ch":{"englishName":"Walser (Switzerland)","nativeName":"Walser (Schwiz)"},"wal":{"englishName":"Wolaytta","nativeName":"ወላይታቱ"},"wal-et":{"englishName":"Wolaytta (Ethiopia)","nativeName":"ወላይታቱ (ኢትዮጵያ)"},"wo":{"englishName":"Wolof","nativeName":"Wolof"},"wo-sn":{"englishName":"Wolof (Senegal)","nativeName":"Wolof (Senegaal)"},"xh":{"englishName":"isiXhosa","nativeName":"isiXhosa"},"xh-za":{"englishName":"isiXhosa (South Africa)","nativeName":"isiXhosa (eMzantsi Afrika)"},"xog":{"englishName":"Soga","nativeName":"Olusoga"},"xog-ug":{"englishName":"Soga (Uganda)","nativeName":"Olusoga (Yuganda)"},"yav":{"englishName":"Yangben","nativeName":"nuasue"},"yav-cm":{"englishName":"Yangben (Cameroon)","nativeName":"nuasue (Kemelún)"},"yi":{"englishName":"Yiddish","nativeName":"ייִדיש"},"yi-001":{"englishName":"Yiddish (World)","nativeName":"ייִדיש (וועלט)"},"yo":{"englishName":"Yoruba","nativeName":"Èdè Yorùbá"},"yo-bj":{"englishName":"Yoruba (Benin)","nativeName":"Èdè Yorùbá (Orílɛ́ède Bɛ̀nɛ̀)"},"yo-ng":{"englishName":"Yoruba (Nigeria)","nativeName":"Èdè Yorùbá (Orílẹ́ède N� ìjírí� )"},"zgh":{"englishName":"Standard Moroccan Tamazight","nativeName":"ⵜⴰⵎⴰⵣⵉⵖⵜ"},"zgh-tfng":{"englishName":"Standard Moroccan Tamazight (Tifinagh)","nativeName":"ⵜⴰⵎⴰⵣⵉⵖⵜ"},"zgh-tfng-ma":{"englishName":"Standard Moroccan Tamazight (Tifinagh, Morocco)","nativeName":"ⵜⴰⵎⴰⵣⵉⵖⵜ (ⵍⵎⵖⵔⵉⴱ)"},"zh":{"englishName":"Chinese","nativeName":"中文"},"zh-cn":{"englishName":"Chinese (Simplified, China)","nativeName":"中文(中国)"},"zh-hans":{"englishName":"Chinese (Simplified)","nativeName":"中文(简体)"},"zh-hans-hk":{"englishName":"Chinese (Simplified Han, Hong Kong SAR)","nativeName":"中文 (香港特别行政区)"},"zh-hans-mo":{"englishName":"Chinese (Simplified Han, Macao SAR)","nativeName":"中文 (澳门特别行政区)"},"zh-hant":{"englishName":"Chinese (Traditional)","nativeName":"中文(繁體)"},"zh-hk":{"englishName":"Chinese (Traditional, Hong Kong SAR)","nativeName":"中文(香港特別行政區)"},"zh-mo":{"englishName":"Chinese (Traditional, Macao SAR)","nativeName":"中文(澳門特別行政區)"},"zh-sg":{"englishName":"Chinese (Simplified, Singapore)","nativeName":"中文(新�� 坡)"},"zh-tw":{"englishName":"Chinese (Traditional, Taiwan)","nativeName":"中文(台灣)"},"zu":{"englishName":"isiZulu","nativeName":"isiZulu"},"zu-za":{"englishName":"isiZulu (South Africa)","nativeName":"isiZulu (i-South Africa)"},"zh-chs":{"englishName":"Chinese (Simplified) Legacy","nativeName":"中文(简体) 旧版"},"zh-cht":{"englishName":"Chinese (Traditional) Legacy","nativeName":"中文(繁體) 舊版"}}');function Is(e){return Rs[e.toLowerCase()]}var Ms=function(e){var t,n,r;return null===(t=Is(-1===(r=(n=e).indexOf("-"))?n:n.substring(0,r)))||void 0===t?void 0:t.englishName},Bs=function(e,t){var n,r,i=e.language;return r=(null==t?void 0:t.filter((function(e){return e.language!==i}))).length>0?function(e){var t;return null===(t=Is(e))||void 0===t?void 0:t.englishName}(i):Ms(i),(null===(n=e.metadata)||void 0===n?void 0:n.autoGenerated)?Ls.T.getPhrase("shared.shared-utils","autoGeneratedSubtitle",{name:r}):r},Ds={ALLOWED_TAGS:["i","b","u","ruby","rt"]},As="en-US",Fs=new Map,zs={getLanguagesOptions:function(e){if(!e)return[];var t=e.filter((function(e){return!e.customer}));return t.map((function(e){return{label:Bs(e,t),value:e.language,id:e.id}})).sort((function(e,t){var n=e.value.includes(Vs)?1:0;return(t.value.includes(Vs)?1:0)-n}))},transformVtt:function(e){if(!e)return[];var t=[],n=new(Ts().WebVTT.Parser)(window,Ts().WebVTT.StringDecoder()),r=[];return n.oncue=function(e){r.push(e)},n.onparsingerror=function(e){t.push(e)},n.parse(e),n.flush(),t.length>0&&xs.Q.Ry.throw(new _s.H("Failed to parse vtt, ".concat(t.map((function(e){return e.message}))))),r},createTextTrackList:function(e,t){var n=document.createElement("video"),r=n.addTextTrack("subtitles",t?Ms(t):"English",t||As);return e.forEach((function(e){r.addCue(e)})),n.textTracks},attachCuesToPlayer:function(e,t,n){var r;if(t){var i=null===(r=null==e?void 0:e.addTranscript)||void 0===r?void 0:r.call(e,n||As),o=zs.transformVtt(t);return null==o||o.forEach((function(e){null==i||i.addCue(e)})),i}},transformVttToTextTrackList:function(e,t,n){var r="".concat(n,"-").concat(t);if(Fs.has(r))return Fs.get(r);if(!e)return null;var i=zs.transformVtt(e),o=zs.createTextTrackList(i,t);return Fs.set(r,o),o},sanitizeCueText:function(e){return(0,Es.sanitize)(e,Ds)}},Zs="transcript-selected-language",Vs="en";function Gs(e){var t,n;return(null===(t=e.find((function(e){return e.language.includes(Vs)})))||void 0===t?void 0:t.language)||(null===(n=e[0])||void 0===n?void 0:n.language)}var Us=n(42648),Ks=n(6620),qs=n(74097),Hs=n(75896);function Ws(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ys(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ys(e,t):void 0}}(e,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 Ys(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Qs=/\n/g;var Js=n(49985),Xs=n(11607),$s=n(83914),ef=n(26354),tf=n(35223);function nf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var rf=Ls.T.encloseNamespace("shared.copyContentIconButton");function of(e){var t,n,i=(t=r.useState(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(t,n)||function(e,t){if(e){if("string"==typeof e)return nf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nf(e,t):void 0}}(t,n)||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.")}()),o=i[0],a=i[1];return r.useEffect((function(){if(o){var e=window.setTimeout((function(){a(!1)}),1e3);return function(){return window.clearTimeout(e)}}}),[o]),r.createElement(ef.u,{title:rf(o?"copied":"copy"),spanHack:!0,spanHackClassName:e.tooltipClassName||""},r.createElement(Xs.L,{"aria-label":"Copy to clipboard",className:e.visible?"QzREy":"_LaKg",onClick:function(t){t.stopPropagation(),navigator.clipboard.writeText(e.copyableContent).then((function(){var t;a(!0),null===(t=e.onClick)||void 0===t||t.call(e)}))}},r.createElement($s.x,{svgName:tf.vn.Copy,size:$s.S.Small})))}var af=n(49439),uf=n(93264);const cf={timePoint:"VOCS4",wide:"ewc3a",item:"sbTZM",inPlayer:"ZSsXf"};function lf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sf(e){var t,n,i=e.currentTimePoint===e.timePoint,o=(t=(0,af.X)(),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(t,n)||function(e,t){if(e){if("string"==typeof e)return lf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lf(e,t):void 0}}(t,n)||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.")}()),a=o[0],u=o[1];return r.createElement("div",Object.assign({},e.isAuthenticated&&{role:"button"},{className:"d-flex p-2 align-items-center cursor-pointer rounded text-dark ".concat(e.inPlayer?cf.inPlayer:""," ").concat(e.isAuthenticated?"cursor-pointer":""," ").concat(cf.item," ").concat(i?"bg-gray-100":""),id:e.timePoint.toString(),onClick:function(){e.onClick(),Js.k.logUserAction(Object.assign(Object.assign({},e.analyticsData),{cueIndex:e.cueIndex}),Object.assign(Object.assign({},e.analyticsOptions),{descriptor:it.XX.TranscriptTimepoint,actionType:it.Vw.Click}))},ref:a}),r.createElement("div",{className:"d-flex flex-column align-items-center"},r.createElement("div",{className:"bg-light-blue text-info rounded-pill d-inline py-1 text-center ".concat(cf.timePoint," ").concat(e.wideTimeTag?cf.wide:""," ").concat(i?"bg-white":"")},uf.T.ToDisplayDuration(1e3*e.timePoint))),r.createElement("div",{className:"".concat(cf.transcript," ms-3 w-100")},e.nodes.map((function(t,n){var i=zs.sanitizeCueText(t.text);return null===t.searchResultIndex?r.createElement("span",{key:n,dangerouslySetInnerHTML:{__html:i}}):r.createElement("mark",{className:"".concat(cf.mark," ").concat(t.searchResultIndex===e.currentSearchResultIndex?"bg-orange":"bg-yellow"),key:n,dangerouslySetInnerHTML:{__html:i}})}))),r.createElement(of,{copyableContent:e.transcript,visible:u,onClick:function(){Js.k.logUserAction(Object.assign(Object.assign({},e.analyticsData),{cueIndex:e.cueIndex}),Object.assign(Object.assign({},e.analyticsOptions),{actionType:it.Vw.Copy}))}}))}function ff(e){var t,n,i=e.cuesToDisplay.some((function(e){return e.startTime>=3600})),o=new Map;return e.chapters.forEach((function(t,n){var r=e.cuesToDisplay.findIndex((function(e){return e.startTime>t.startTime}));o.set(r,n)})),r.createElement("div",{className:"w-100 position-relative",style:{height:e.virtualizer.getTotalSize()}},r.createElement("div",{className:"w-100 position-absolute top-0 start-0",style:{transform:"translateY(".concat(null!==(n=null===(t=e.items[0])||void 0===t?void 0:t.start)&&void 0!==n?n:0,"px)")}},e.items.map((function(t){var n,a=t.index,u=e.cuesToDisplay[a],c=!1,l="";return o.has(a)&&(c=!0,l=e.chapters[o.get(a)].name),r.createElement("div",{className:e.inPlayer?"":"px-3",key:u.startTime,ref:e.virtualizer.measureElement,"data-index":a},c&&r.createElement("h3",{className:"".concat(0!==o.get(a)?"mt-2":""," my-2 h6 ").concat(e.inPlayer?"px-2":"")},r.createElement("span",null,o.get(a)+1,". ",l)),r.createElement(sf,{timePoint:u.startTime,transcript:u.text,nodes:u.nodes,onClick:function(){return e.onClickTranscriptionItem(u)},currentTimePoint:null===(n=e.timepoint)||void 0===n?void 0:n.startTime,currentSearchResultIndex:e.currentSearchResultIndex,wideTimeTag:!!i,inPlayer:e.inPlayer,analyticsOptions:e.analyticsOptions,analyticsData:e.analyticsData,cueIndex:a,isAuthenticated:e.isAuthenticated}))}))))}n(32102),n(97395);var pf=n(79014);var hf=Ls.T.encloseNamespace("playPage.transcriptSearchBar");function yf(e){var t=r.useRef(null);function n(t){Js.k.logUserAction(Object.assign(Object.assign({},e.analyticsData),{query:t}),Object.assign(Object.assign({},e.analyticsOptions),{actionType:it.Vw.Search,descriptor:t?it.uG.SearchTranscript:it.uG.ResetResults}))}var i=r.useCallback(pf.q.debounce((function(e){return n(e)}),500),[]);function o(){Js.k.logUserAction(Object.assign(Object.assign({},e.analyticsData),{query:e.query}),Object.assign(Object.assign({},e.analyticsOptions),{actionType:it.Vw.Search,descriptor:it.uG.NextResult})),e.currentSearchResultIndex===e.totalSearchResults-1?e.jumpToSearchResult(0):e.jumpToSearchResult(e.currentSearchResultIndex+1)}function a(){Js.k.logUserAction(Object.assign(Object.assign({},e.analyticsData),{query:e.query}),Object.assign(Object.assign({},e.analyticsOptions),{actionType:it.Vw.Search,descriptor:it.uG.PreviousResult})),0===e.currentSearchResultIndex?e.jumpToSearchResult(e.totalSearchResults-1):e.jumpToSearchResult(e.currentSearchResultIndex-1)}function u(e){var n;e.keepFocus||null===(n=t.current)||void 0===n||n.focus(),o()}function c(e){var n;e.keepFocus||null===(n=t.current)||void 0===n||n.focus(),a()}return r.createElement("div",{className:"form-control py-0 px-1 d-flex align-items-center border border-dark ".concat("XfIEh"),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.focus()},role:"search"},r.createElement("div",{"aria-hidden":"true"},r.createElement($s.x,{svgName:tf.vn.Search})),r.createElement("input",{className:"form-control border-0 px-1 ".concat("MAoRJ"),value:e.query,onChange:function(t){i(t.target.value),e.onSearch(t.target.value)},autoComplete:"off",placeholder:hf("searchPlaceholder"),ref:t,onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),e.shiftKey?a():o())}}),!!e.query&&r.createElement("div",{className:"d-flex align-items-center"},r.createElement("div",null,e.totalSearchResults?"".concat(e.currentSearchResultIndex+1,"/").concat(e.totalSearchResults):"0/0"),r.createElement(Xs.L,{"aria-label":hf("previousResult"),onClick:function(){return c({keepFocus:!1})},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||c({keepFocus:!0})}},r.createElement($s.x,{svgName:tf.vn.ChevronUp})),r.createElement(Xs.L,{"aria-label":hf("nextResult"),onClick:function(){return u({keepFocus:!1})},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||u({keepFocus:!0})}},r.createElement($s.x,{svgName:tf.vn.ChevronDown})),r.createElement(Xs.L,{"aria-label":hf("clearSearch"),onClick:function(){var r;n(""),null===(r=t.current)||void 0===r||r.focus(),e.onSearch("")}},r.createElement($s.x,{svgName:tf.vn.Close}))))}n(83345);var vf,df,mf=n(69883),bf=n(79967),gf=n(74237);n(62400),(df=vf||(vf={})).Resources="resources",df.Interactives="interactives",df.Video="video",df.Clips="clips",df.CurriculumLinks="curriculum-links",df.VideoDetails="video-details",df.RelatedVideos="related-videos",df.ClippedFrom="clipped-from",df.Transcript="transcript",Ls.T.encloseNamespace("shared.playPageTranscription");var wf=n(8935);const Of={languageSelect:"rHbhp",inputWithoutHighlight:"nJvbl"};function Sf(e){return Sf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sf(e)}function kf(){kf=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Sf(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(Sf(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function Nf(e){var t,n,i=null===(t=e.languageOptions[0])||void 0===t?void 0:t.label,o=e.track.src,a=(0,mf.Z)();return r.createElement("div",{className:"d-flex px-1 mb-3"},r.createElement(yf,{query:e.searchQuery,currentSearchResultIndex:e.currentSearchResultIndex,onSearch:e.onSearch,totalSearchResults:e.totalSearchResults,jumpToSearchResult:e.jumpToSearchResult,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions}),r.createElement(ef.u,{spanHack:!0,title:e.languageOptions.length>1?"":"Only available in ".concat(i)},r.createElement(wf.Z,null,r.createElement(wf.Z.Toggle,{className:"text-dark ".concat(Of.languageSelect),id:"language-select",disabled:(null===(n=e.languageOptions)||void 0===n?void 0:n.length)<=1,variant:"outline-dark"},r.createElement($s.x,{svgName:tf.vn.Globe})),r.createElement(wf.Z.Menu,{className:Of.menu,"aria-labelledby":"language-select"},e.languageOptions.map((function(t,n){return r.createElement(wf.Z.Item,{key:n,onClick:function(){var n;null===(n=e.onChangeLanguage)||void 0===n||n.call(e,t.value),Js.k.logUserAction(Object.assign(Object.assign({},e.analyticsData),{language:t.value,previousLanguageName:e.selectedLanguage}),Object.assign(Object.assign({},e.analyticsOptions),{actionType:it.Vw.Select}))},className:"cursor-pointer",active:t.value===e.selectedLanguage},t.label)}))))),r.createElement(qs.h,{svgName:tf.vn.Download,onClick:function(){return t=this,n=void 0,r=void 0,i=kf().mark((function t(){return kf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Js.k.logUserAction(e.analyticsData,Object.assign(Object.assign({},e.analyticsOptions),{actionType:it.Vw.Download})),t.prev=1,t.next=4,gf.T.downloadBlob(o,"Subtitles-".concat(e.selectedLanguage,".vtt"));case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),a.error("Error downloading transcript");case 9:case"end":return t.stop()}}),t,null,[[1,6]])})),new(r||(r=Promise))((function(e,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function u(e){try{c(i.throw(e))}catch(e){o(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,u)}c((i=i.apply(t,n||[])).next())}));var t,n,r,i},className:"position-relative d-flex align-items-center text-dark"}))}var Pf=n(44645);function jf(e){return jf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jf(e)}function Ef(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_f(r.key),r)}}function Tf(e,t,n){return t&&Cf(e.prototype,t),n&&Cf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _f(e){var t=function(e){if("object"!=jf(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jf(t)?t:t+""}function xf(e,t,n){return t=If(t),function(e,t){if(t&&("object"==jf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Lf()?Reflect.construct(t,n||[],If(e).constructor):t.apply(e,n))}function Lf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lf=function(){return!!e})()}function Rf(){return Rf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=If(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Rf.apply(null,arguments)}function If(e){return If=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},If(e)}function Mf(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bf(e,t)}function Bf(e,t){return Bf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Bf(e,t)}var Df=function(e){function t(e,n){return Ef(this,t),xf(this,t,[e,n])}return Mf(t,e),Tf(t,[{key:"dispose",value:function(){var e,n,r,i=this;setImmediate((function(){var e;null===(e=i.root)||void 0===e||e.unmount()})),(e=t,n=this,"function"==typeof(r=Rf(If(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}}])}(i.Z.getComponent("Component")),Af={tagName:"div"};function Ff(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Af;if(!e)throw new Error("componentCtor is required");var n=function(n){function r(){return Ef(this,r),xf(this,r,arguments)}return Mf(r,n),Tf(r,[{key:"createEl",value:function(){var n=i.Z.dom.createEl(t.tagName,t.properties,t.attributes),r=(0,Pf.s)(n);return r.render(e(this.player_,this.options_)),this.root=r,n}}])}(Df);return n}function zf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Zf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zf(e,t):void 0}}(e,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 Zf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Vf(e){var t=Ut(Zs)||Gs(e.allTracks),n=r.useState((function(){return e.allTracks.find((function(e){return e.language===t}))||e.allTracks.find((function(t){return t.language===Gs(e.allTracks)}))})),i=zf(n,2),o=i[0],a=i[1],u=zf(r.useState(t),2),c=u[0],l=u[1],s=zf(r.useState(-1),2),f=s[0],p=s[1],h=zf(r.useState(!0),2),y=h[0],v=h[1],d=zf(r.useState([]),2),m=d[0],b=d[1],g=r.useMemo((function(){return Array.from((null==o?void 0:o.cues)||[])}),[c]),w={videoId:e.playbackObject.videoId,videoName:e.playbackObject.title,language:c},O={location:it.LZ.Player,entity:it.py.Transcript},S=e.player.hasStarted();!function(e){function t(t){var n=Array.from((null==t?void 0:t.activeCues)||[]);if(n.length){var r=e.cuesToDisplay.findIndex((function(e){return e.startTime===Hs.m.last(n).startTime}));-1!==r?e.setCurrentCueIndex(r):e.setCurrentCueIndex(null)}}function n(){t(e.currentTranscriptTrack)}r.useEffect((function(){e.hasStarted&&t(e.currentTranscriptTrack)}),[e.hasStarted]),r.useEffect((function(){return e.currentTranscriptTrack&&e.currentTranscriptTrack.addEventListener("cuechange",n),function(){var t;return null===(t=e.currentTranscriptTrack)||void 0===t?void 0:t.removeEventListener("cuechange",n)}}),[e.currentTranscriptTrack])}({currentTranscriptTrack:o,cuesToDisplay:g,setCurrentCueIndex:p,hasStarted:S});var k=r.useRef(),N=(0,Ks.MG)({count:m.length,getScrollElement:function(){var e;return null===(e=k.current)||void 0===e?void 0:e.view},estimateSize:function(){return 40},enabled:m.length>0}),P=N.getVirtualItems(),j=function(e,t,n){function i(e){n&&n.scrollToIndex(e,{align:"start"})}return r.useEffect((function(){t&&"number"==typeof e&&i(e)}),[e,t,n]),i}(f,y,N),E=function(e){var t=e.cuesToDisplay,n=e.resetHighlightedCues,i=e.setHighlightedCues,o=e.scrollToCue,a=Ws(r.useState(""),2),u=a[0],c=a[1],l=Ws(r.useState(null),2),s=l[0],f=l[1],p=Ws(r.useState(0),2),h=p[0],y=p[1],v=Ws(r.useTransition(),2)[1];return{isSearching:null!==s,searchQuery:u,onSearch:function(e){c(e),0!==h&&y(0),v((function(){!function(e){if(!e.length)return f(null),void n();var r=new RegExp(e.replace(Qs," "),"gi"),a=[],u=0,c=t.map((function(e,t){var n=e.text,i=n.replace(Qs," ").matchAll(r);if(0===i.length)return Object.assign(e,{nodes:[{text:n,searchResultIndex:null}]});var o=[],c=0;return i.forEach((function(e,r){var i=e[0],l=e.index;l>c&&o.push({text:n.substring(c,l),searchResultIndex:null}),o.push({text:i,searchResultIndex:u}),u++,a.push({cueIndex:t,cueMatchIndex:r}),c=l+i.length})),c<n.length&&o.push({text:n.substring(c),searchResultIndex:null}),Object.assign(e,{nodes:o})}));f(a),i(c),a.length&&o(a[0].cueIndex)}(e)}))},jumpToSearchResult:function(e){var t=s[e];t&&(y(e),o(t.cueIndex))},totalSearchResults:null==s?void 0:s.length,currentSearchResultIndex:h,resetSearchResults:function(){f(null),c(""),y(0),n()}}}({cuesToDisplay:g,resetHighlightedCues:F,setHighlightedCues:b,scrollToCue:j}),C=E.isSearching,T=E.searchQuery,_=E.totalSearchResults,x=E.jumpToSearchResult,L=E.onSearch,R=E.currentSearchResultIndex,I=E.resetSearchResults,M=e.player.paused(),B=zf((0,af.X)(),2),D=B[0],A=B[1];function F(){b(g.map((function(e){return Object.assign(e,{nodes:[{text:e.text,searchResultIndex:null}]})})))}return r.useEffect((function(){v(!A&&!C&&S&&!M)}),[A,C,S,M]),r.useEffect((function(){F()}),[g]),o&&g.length?r.createElement("div",{ref:D,className:"cv-transcript py-3 px-2 ".concat(e.showTranscript?"cv-open":"")},r.createElement("div",{className:"text-dark d-flex justify-content-between px-1"},r.createElement("h3",null,"Transcript"),r.createElement(qs.h,{svgName:tf.vn.Close,onClick:function(){e.toggleTranscript(!1)},ariaLabel:"Close transcript"})),r.createElement(Nf,{selectedLanguage:c,languageOptions:e.languageOptions,onChangeLanguage:function(t){a(e.allTracks.find((function(e){return e.language===t}))),l(t),Kt(Zs,t),I()},track:o,onSearch:L,searchQuery:T,currentSearchResultIndex:R,totalSearchResults:_,jumpToSearchResult:x,analyticsData:w,analyticsOptions:O}),r.createElement("div",{className:"cv-transcript-list-wrapper text-dark"},r.createElement(Us.ZP,{ref:k},r.createElement(ff,{timepoint:g[f],onClickTranscriptionItem:function(t){var n;null===(n=e.setStartTime)||void 0===n||n.call(e,t.startTime)},cuesToDisplay:m,chapters:e.chapters,currentSearchResultIndex:R,inPlayer:!0,virtualizer:N,items:P,analyticsOptions:O,analyticsData:w,isAuthenticated:!1})))):r.createElement(r.Fragment,null)}function Gf(e){return Gf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gf(e)}function Uf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Kf(r.key),r)}}function Kf(e){var t=function(e){if("object"!=Gf(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Gf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Gf(t)?t:t+""}function qf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qf=function(){return!!e})()}function Hf(){return Hf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Wf(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Hf.apply(null,arguments)}function Wf(e){return Wf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wf(e)}function Yf(e,t){return Yf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yf(e,t)}i.Z.registerComponent("Transcript",Ff((function(e,t){return r.createElement(Vf,Object.assign({player:e},t))})));var Qf=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=Wf(t),function(e,t){if(t&&("object"==Gf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qf()?Reflect.construct(t,n||[],Wf(e).constructor):t.apply(e,n))}(this,t,[e])).allClickViewTracks=[],n.player=e,n.bindListeners(),e.ready((function(){return n.initialize()})),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yf(e,t)}(t,e),n=t,r=[{key:"bindListeners",value:function(){var e=this;this.onResize=this.onResize.bind(this),Y.useMetadataTracks(this.player,"transcript",(function(){return e.player.trigger("resizemenus")})),this.player.on("playerresize",this.onResize)}},{key:"dispose",value:function(){var e,n,r;this.player.off("playerresize",this.onResize),(e=t,n=this,"function"==typeof(r=Hf(Wf(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}},{key:"initialize",value:function(){Y.useSubtitles(this.player,this.onTrackLoaded.bind(this)),Y.useChapters(this.player,this.onChaptersLoaded.bind(this))}},{key:"onChaptersLoaded",value:function(e){this.chapterTrack=e}},{key:"onTrackLoaded",value:function(e){var t=e.isClickViewProduced;!this.allClickViewTracks.find((function(t){return t.language===e.language}))&&t&&this.allClickViewTracks.push(e),this.languageOptions=this.buildOptions(this.allClickViewTracks)}},{key:"buildOptions",value:function(e){return e.map((function(e){return{label:e.label,value:e.language}})).sort((function(e,t){var n=e.value.includes(Vs)?1:0;return(t.value.includes(Vs)?1:0)-n}))}},{key:"buildComponentProps",value:function(e,t,n){var r,i=Array.from((null===(r=this.chapterTrack)||void 0===r?void 0:r.cues)||[]).map((function(e){return{endTimeStamp:e.endTime,startTime:e.startTime,name:e.text}}));return{showTranscript:e,languageOptions:this.languageOptions,toggleTranscript:function(e){return t(e,{shouldLog:!0})},allTracks:this.allClickViewTracks,setStartTime:n,chapters:i,playbackObject:this.playbackObject}}},{key:"addChildren",value:function(e){if(this.component)return this.component.show(),this.component;var t=this.toggleTranscript.bind(this),n=this.setStartTime.bind(this),r=this.buildComponentProps(e,t,n);this.component=this.player.addChild("Transcript",r)}},{key:"toggleTranscript",value:function(e,t){var n,r,i,o=void 0!==e?e:!this.showTranscript;this.showTranscript=o,o?(null===(n=this.player.theatreModePlugin())||void 0===n||n.toggleTheatreMode(!0,{shouldLog:!1}),this.addChildren(!0),this.player.addClass("cv-transcript-plugin")):(null===(r=this.component)||void 0===r||r.hide(),this.player.removeClass("cv-transcript-plugin")),this.player.whiteboardModePlugin&&this.player.whiteboardModePlugin().setEnabled(!o),this.player.trigger("cv-transcript-toggle",o),this.player.trigger("resizemenus"),this.player.trigger("playerresize"),(null==t?void 0:t.shouldLog)&&(null===(i=this.analyticsService)||void 0===i||i.logUserAction({videoId:this.playbackObject.videoId,videoName:this.playbackObject.title},{actionType:it.Vw.Click,descriptor:o?it.UX.ShowTranscript:it.UX.HideTranscript,entity:it.py.Transcript}))}},{key:"setStartTime",value:function(e){this.player.currentTime(e)}},{key:"isTranscriptOn",value:function(){return!!this.showTranscript}},{key:"onResize",value:function(){window.innerWidth<992?this.player.addClass("hide-transcript"):this.showTranscript&&this.player.removeClass("hide-transcript")}},{key:"registerAnalytics",value:function(e,t){this.analyticsService=e,this.playbackObject=t}}],r&&Uf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function Jf(e){return Jf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jf(e)}function Xf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,$f(r.key),r)}}function $f(e){var t=function(e){if("object"!=Jf(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Jf(t)?t:t+""}function ep(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ep=function(){return!!e})()}function tp(e){return tp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tp(e)}function np(e,t){return np=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},np(e,t)}i.Z.registerPlugin("viewTranscriptPlugin",Qf);var rp=i.Z.getComponent("SubsCapsMenuItem"),ip=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=tp(t),function(e,t){if(t&&("object"==Jf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ep()?Reflect.construct(t,n||[],tp(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&np(e,t)}(t,e),n=t,(r=[{key:"handleClick",value:function(e){rp.prototype.handleClick.call(this,e);for(var t=this.player_.textTracks(),n=0;n<t.length;n++){var r=t[n];"subtitles"===r.kind&&"disabled"===r.mode&&(r.mode="hidden")}this.player_.trigger("cv:languageselected")}}])&&Xf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(rp);function op(e){return op="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},op(e)}function ap(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,up(r.key),r)}}function up(e){var t=function(e){if("object"!=op(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=op(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==op(t)?t:t+""}function cp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cp=function(){return!!e})()}function lp(e){return lp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lp(e)}function sp(e,t){return sp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sp(e,t)}var fp=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r={};r.track={player:e,kind:"subtitle",label:"Search Captions",selectable:!1,default:!1,mode:"disabled"},r.selectable=!1,r.name="SubtitleSearchMenuItem",(n=function(e,t,n){return t=lp(t),function(e,t){if(t&&("object"==op(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,cp()?Reflect.construct(t,n||[],lp(e).constructor):t.apply(e,n))}(this,t,[e,r])).addClass("vjs-texttrack-settings"),n.addClass("cv-subtitle-search-menu-item"),n.controlText(", opens subtitle search"),n.toggleEnabled=n.toggleEnabled.bind(n);var i=n.player_.textTracks();return i.addEventListener("selectedlanguagechange",n.toggleEnabled),n.player_.one("dispose",(function(){i.removeEventListener("selectedlanguagechange",n.toggleEnabled)})),n.toggleEnabled(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sp(e,t)}(t,e),n=t,(r=[{key:"toggleEnabled",value:function(){var e;if(this.player_){var t=Y.getCurrentTextTrack(this.player_);t?(null===(e=t.cues)||void 0===e?void 0:e.length)?this.removeClass("vjs-disabled"):(this.bindTrackEvents(t),this.addClass("vjs-disabled")):this.addClass("vjs-disabled")}}},{key:"bindTrackEvents",value:function(e){var t=this;e.removeEventListener("loadeddata",this.toggleEnabled),e.addEventListener("loadeddata",this.toggleEnabled),this.player_.one("dispose",(function(){e.removeEventListener("loadeddata",t.toggleEnabled)}))}},{key:"handleClick",value:function(){var e,t=this,n=Y.getCurrentTextTrack(this.player_);(null===(e=null==n?void 0:n.cues)||void 0===e?void 0:e.length)&&this.requestAnimationFrame((function(){t.player_.getChild("collapserator").getChild("subtitleSearchButton").showCollapsibleMenu()}))}}])&&ap(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("TextTrackMenuItem"));function pp(e){return pp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pp(e)}function hp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,yp(r.key),r)}}function yp(e){var t=function(e){if("object"!=pp(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=pp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pp(t)?t:t+""}function vp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vp=function(){return!!e})()}function dp(e){return dp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dp(e)}function mp(e,t){return mp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mp(e,t)}var bp=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r={};return r.track={player:e,kind:"subtitle",label:"Caption Text Size",selectable:!1,default:!1,mode:"disabled"},r.selectable=!1,r.name="SubtitleSizeMenuItem",(n=function(e,t,n){return t=dp(t),function(e,t){if(t&&("object"==pp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,vp()?Reflect.construct(t,n||[],dp(e).constructor):t.apply(e,n))}(this,t,[e,r])).addClass("vjs-texttrack-settings"),n.addClass("cv-divider-after-menu-item"),n.addClass("cv-subtitle-size-menu-item"),n.controlText(", opens subtitle size settings"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mp(e,t)}(t,e),n=t,(r=[{key:"handleClick",value:function(){var e=this;this.requestAnimationFrame((function(){e.player_.getChild("collapserator").getChild("subtitleSizeButton").showCollapsibleMenu()}))}}])&&hp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("TextTrackMenuItem"));function gp(e){return gp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gp(e)}function wp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Op(r.key),r)}}function Op(e){var t=function(e){if("object"!=gp(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=gp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==gp(t)?t:t+""}function Sp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sp=function(){return!!e})()}function kp(e){return kp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kp(e)}function Np(e,t){return Np=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Np(e,t)}var Pp=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r={};return r.track={player:e,kind:"subtitle",label:"Video Transcript",selectable:!1,default:!1,mode:"disabled"},r.selectable=!1,r.name="TranscriptMenuItem",(n=function(e,t,n){return t=kp(t),function(e,t){if(t&&("object"==gp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Sp()?Reflect.construct(t,n||[],kp(e).constructor):t.apply(e,n))}(this,t,[e,r])).transcriptOn=n.player_.viewTranscriptPlugin&&n.player_.viewTranscriptPlugin().isTranscriptOn(),n.bindEventListeners(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Np(e,t)}(t,e),n=t,(r=[{key:"bindEventListeners",value:function(){var e=this,t=this.toggleListener.bind(this),n=this.onResize.bind(this);this.player_.on("cv-transcript-toggle",t),this.player_.on("playerresize",n),this.on("dispose",(function(){e.player_.off("cv-transcript-toggle",t),e.player_.off("playerresize",n)}))}},{key:"onResize",value:function(){var e=window.innerWidth<992;this.item&&(this.item.style.display=e?"none":"block")}},{key:"handleToggleListener",value:function(){this.transcriptOn?this.toggleOff():this.toggleOn()}},{key:"toggleListener",value:function(e,t){var n,r;t?(this.transcriptOn=!0,i.Z.dom.addClass(this.toggleEl,"on")):(this.transcriptOn=!1,null===(r=(n=i.Z.dom).removeClass)||void 0===r||r.call(n,this.toggleEl,"on"))}},{key:"toggleOn",value:function(){var e,t;this.transcriptOn=!0,i.Z.dom.addClass(this.toggleEl,"on"),this.player_.viewTranscriptPlugin&&(null===(t=null===(e=this.player_.viewTranscriptPlugin())||void 0===e?void 0:e.toggleTranscript)||void 0===t||t.call(e,!0,{shouldLog:!0})),this.player_.whiteboardModePlugin&&this.player_.whiteboardModePlugin().setEnabled(!1)}},{key:"toggleOff",value:function(){var e,t,n,r;this.transcriptOn=!1,null===(t=(e=i.Z.dom).removeClass)||void 0===t||t.call(e,this.toggleEl,"on"),this.player_.viewTranscriptPlugin&&(null===(r=null===(n=this.player_.viewTranscriptPlugin())||void 0===n?void 0:n.toggleTranscript)||void 0===r||r.call(n,!1,{shouldLog:!0}))}},{key:"createEl",value:function(e,t,n){return this.handlerBound||(this.handleToggleListener=this.handleToggleListener.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggleListener),this.toggleEl=i.Z.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggleListener),this.item=i.Z.dom.createEl("li",{className:"vjs-menu-item cv-transcript-toggle",innerHTML:'\n <span class="vjs-menu-item-text">Video Transcript</span>\n <span class="cv-toggle-container"></span>\n <span class="vjs-control-text" aria-live="polite">, opens transcript</span>\n '},n),this.item.children[1].appendChild(this.toggleEl),this.item}}])&&wp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("TextTrackMenuItem"));function jp(e){return jp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jp(e)}function Ep(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Cp(r.key),r)}}function Cp(e){var t=function(e){if("object"!=jp(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=jp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jp(t)?t:t+""}function Tp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tp=function(){return!!e})()}function _p(){return _p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=xp(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},_p.apply(null,arguments)}function xp(e){return xp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xp(e)}function Lp(e,t){return Lp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lp(e,t)}i.Z.registerComponent("ToggleTranscriptMenuItem",Pp);var Rp=i.Z.getComponent("TextTrackButton"),Ip=i.Z.getComponent("SubsCapsButton"),Mp=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=xp(t),function(e,t){if(t&&("object"==jp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Tp()?Reflect.construct(t,n||[],xp(e).constructor):t.apply(e,n))}(this,t,arguments)).alwaysCollapsed=!1,e.isCollapsed=!1,e.isCollabsible=!0,e.className="cv-subs-caps-menu-button",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lp(e,t)}(t,e),n=t,r=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat((e=t,n=this,"function"==typeof(r=_p(xp(1&3?e.prototype:e),"buildWrapperCSSClass",n))?function(e){return r.apply(n,e)}:r)([]));var e,n,r}},{key:"createItems",value:function(){var e=[];if(!this.player_.options_.mobile){var t=this.player().textTracks(),n=Array.from(t||[]).some((function(e){return"subtitles"===e.kind}));this.player_.options_.allowTheatreMode&&!!n&&this.player_.viewTranscriptPlugin&&window.innerWidth>=992&&e.push(new Pp(this.player_)),e.push(new fp(this.player_)),e.push(new bp(this.player_)),this.hideThreshold_=this.hideThreshold_+2}return this.player().trigger("resizemenus"),Rp.prototype.createItems.call(this,e,ip)}},{key:"getCollabsibleName",value:function(){return"Subtitles"}},{key:"getCollabsibleValue",value:function(){for(var e=this.player_.textTracks(),t=0;t<e.length;t++){var n=e[t];if(this.kinds_.indexOf(n.kind)>-1&&"showing"===n.mode)return n.label}return"Off"}},{key:"showInCollabsibleMenu",value:function(){for(var e=this.player_.textTracks(),t=0;t<e.length;t++){var n=e[t];if(this.kinds_.indexOf(n.kind)>-1)return!0}return!1}},{key:"showCollapsibleMenu",value:function(){Ip.prototype.handleClick.apply(this)}}],r&&Ep(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ip);function Bp(e){return Bp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bp(e)}function Dp(){Dp=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Bp(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(Bp(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function Ap(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Fp(r.key),r)}}function Fp(e){var t=function(e){if("object"!=Bp(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Bp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Bp(t)?t:t+""}function zp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zp=function(){return!!e})()}function Zp(e){return Zp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zp(e)}function Vp(e,t){return Vp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vp(e,t)}i.Z.registerComponent("SubsCapsButton",Mp);var Gp="<span class='vjs-local-cache-indicator-icon' title='Streaming from ClickView Local Cache'>".concat(Rr,"</span>"),Up=function(e){function t(e,n){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Zp(t),function(e,t){if(t&&("object"==Bp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,zp()?Reflect.construct(t,n||[],Zp(e).constructor):t.apply(e,n))}(this,t,[e,n])).qualityId=n.qualityId;var i=e.qualityLevels(),o=r.handleQualityChange.bind(r);return i.on("change",o),e.one("dispose",(function(){i.off("change",o)})),r.handleLocalCacheChange=r.handleLocalCacheChange.bind(r),r.player_.ready((function(){r.player_&&(r.player_.on("localcachechanged",r.handleLocalCacheChange),r.player_.one("dispose",(function(){var e;null===(e=r.player_)||void 0===e||e.off("localcachechanged",r.handleLocalCacheChange)})),r.handleLocalCacheChange())})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vp(e,t)}(t,e),n=t,(r=[{key:"handleLocalCacheChange",value:function(){return e=this,t=void 0,n=void 0,r=Dp().mark((function e(){var t,n;return Dp().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.player_.localCache(),e.next=3,t.getActiveLocalCache();case 3:if(null==(n=e.sent)?void 0:n.playbackProfile){e.next=9;break}return this.show(),this.enable(),this.setLabel(this.options_.label),e.abrupt("return");case 9:n.playbackProfile!==this.qualityId?this.disable():this.setLabel(this.options_.label+Gp);case 10:case"end":return e.stop()}}),e,this)})),new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}));var e,t,n,r}},{key:"setLabel",value:function(e){var t=this.$(".vjs-menu-item-text");t&&(t.innerHTML=e)}},{key:"buildCSSClass",value:function(){return"vjs-menu-item cv-quality-menu-item"}},{key:"handleClick",value:function(){for(var e=this.player_.qualityLevels(),t=0;t<e.length;t++){var n=e[t];n.enabled=n.id===this.qualityId}}},{key:"handleQualityChange",value:function(){if(this.player_){var e=this.player_.qualityLevels(),t=e[e.selectedIndex],n=t&&t.id===this.qualityId;n!==this.isSelected_&&this.selected(n)}}}])&&Ap(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("MenuItem"));function Kp(e){return Kp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kp(e)}function qp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Hp(r.key),r)}}function Hp(e){var t=function(e){if("object"!=Kp(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Kp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Kp(t)?t:t+""}function Wp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wp=function(){return!!e})()}function Yp(e,t,n,r){var i=Qp(Jp(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Qp(){return Qp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Jp(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Qp.apply(null,arguments)}function Jp(e){return Jp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Jp(e)}function Xp(e,t){return Xp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xp(e,t)}var $p={144:"144p (Preview)",240:"240p",360:"360p",480:"480p",720:"720p",1080:"1080p"},eh=i.Z.getComponent("MenuButton"),th=function(e){function t(e,n){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Jp(t),function(e,t){if(t&&("object"==Kp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Wp()?Reflect.construct(t,n||[],Jp(e).constructor):t.apply(e,n))}(this,t,[e,n])).alwaysCollapsed=!0,r.isCollapsed=!1,r.isCollabsible=!0,r.className="cv-quality-menu-button";var i=r.player_.qualityLevels(),o=r.update.bind(r);return i.on("addqualitylevel",o),i.on("removequalitylevel",o),e.one("dispose",(function(){i.removeEventListener("addqualitylevel",o),i.removeEventListener("removequalitylevel",o)})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xp(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-quality-button ".concat(Yp(t,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small vjs-quality-button cv-has-left-icons ".concat(Yp(t,"buildWrapperCSSClass",this,3)([]))}},{key:"createItems",value:function(){var e=[],t=this.player_.qualityLevels();e.push(new j(this.player_,{label:"Quality"}));for(var n=0;n<t.length;n++){var r=t[n];if(r){var i=$p[r.id];i&&e.push(new Up(this.player_,{qualityId:r.id,label:i,selectable:!0,multiSelectable:!1}))}}return e}},{key:"getCollabsibleName",value:function(){return"Quality"}},{key:"getCollabsibleValue",value:function(){var e=this.player_.qualityLevels(),t=e[e.selectedIndex];return t?$p[t.id]:""}},{key:"showInCollabsibleMenu",value:function(){return!!this.player_.qualityLevels().length}},{key:"showCollapsibleMenu",value:function(){eh.prototype.handleClick.apply(this)}}])&&qp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(eh);function nh(e){return nh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nh(e)}function rh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ih(r.key),r)}}function ih(e){var t=function(e){if("object"!=nh(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=nh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nh(t)?t:t+""}function oh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oh=function(){return!!e})()}function ah(){return ah="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=uh(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},ah.apply(null,arguments)}function uh(e){return uh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uh(e)}function ch(e,t){return ch=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ch(e,t)}i.Z.registerComponent("QualityButton",th);var lh=i.Z.getComponent("Menu"),sh=i.Z.getComponent("MenuButton"),fh=i.Z.getComponent("PlaybackRateMenuItem"),ph=i.Z.getComponent("PlaybackRateMenuButton"),hh=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=uh(t),function(e,t){if(t&&("object"==nh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,oh()?Reflect.construct(t,n||[],uh(e).constructor):t.apply(e,n))}(this,t,arguments)).alwaysCollapsed=!0,e.isCollapsed=!1,e.isCollabsible=!0,e.className="cv-playback-rate-menu-button",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ch(e,t)}(t,e),n=t,r=[{key:"createEl",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=sh.prototype.createEl).apply.apply(e,[this].concat(n))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat((e=t,n=this,"function"==typeof(r=ah(uh(1&3?e.prototype:e),"buildWrapperCSSClass",n))?function(e){return r.apply(n,e)}:r)([]));var e,n,r}},{key:"createMenu",value:function(){var e=new lh(this.player(),{menuButton:this});e.addItem(new j(this.player_,{label:"Playback Speed"}));var t=this.playbackRates();if(t)for(var n=0;n<t.length;n++){var r=t[n]+"x";1===t[n]&&(r+=" (Normal)"),e.addItem(new fh(this.player(),{rate:r}))}return e}},{key:"handleClick",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=sh.prototype.handleClick).apply.apply(e,[this].concat(n))}},{key:"updateLabel",value:function(){var e;this.setupLabelEl();for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=ph.prototype.updateLabel).apply.apply(e,[this].concat(n))}},{key:"setupLabelEl",value:function(){if(!this.labelEl_){var e=this.$("button");e&&(this.labelEl_=i.Z.dom.createEl("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_))}}},{key:"getCollabsibleName",value:function(){return"Playback Speed"}},{key:"getCollabsibleValue",value:function(){return this.player().playbackRate()+"x"}},{key:"showInCollabsibleMenu",value:function(){return!!this.playbackRates()}},{key:"showCollapsibleMenu",value:function(){this.handleClick(null)}}],r&&rh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ph);function yh(e){return yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yh(e)}function vh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,dh(r.key),r)}}function dh(e){var t=function(e){if("object"!=yh(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=yh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yh(t)?t:t+""}function mh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mh=function(){return!!e})()}function bh(e){return bh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bh(e)}function gh(e,t){return gh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gh(e,t)}i.Z.registerComponent("PlaybackRateMenuButton",hh);var wh=i.Z.getComponent("TextTrackSettings"),Oh={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",edgeStyle:void 0,fontFamily:"proportionalSansSerif",fontPercent:1,textOpacity:"1",windowColor:"#000",windowOpacity:"0"},Sh={small:Oh,medium:Object.assign(Object.assign({},Oh),{fontPercent:1.5}),large:Object.assign(Object.assign({},Oh),{fontPercent:2})},kh=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=bh(t),function(e,t){if(t&&("object"==yh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,mh()?Reflect.construct(t,n||[],bh(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gh(e,t)}(t,e),n=t,(r=[{key:"setSizeSetting",value:function(e){var t=this;this.size_=e,this.player_.getChild("textTrackDisplay").updateDisplay();var n=this.player_.getChild("collapserator").getChild("subtitleSizeButton");this.player_.trigger("changesubtitlesize",this.size_),window.requestAnimationFrame((function(){n.update(),t.player_.trigger("resizemenus")}))}},{key:"getSizeSetting",value:function(){return this.size_||"small"}},{key:"getValues",value:function(){return Sh[this.size_]?Sh[this.size_]:Oh}}])&&vh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(wh);function Nh(e){return Nh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nh(e)}function Ph(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,jh(r.key),r)}}function jh(e){var t=function(e){if("object"!=Nh(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Nh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Nh(t)?t:t+""}function Eh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Eh=function(){return!!e})()}function Ch(e,t,n,r){var i=Th(_h(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Th(){return Th="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=_h(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Th.apply(null,arguments)}function _h(e){return _h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_h(e)}function xh(e,t){return xh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xh(e,t)}i.Z.registerComponent("TextTrackSettings",kh);var Lh=window.navigator&&window.navigator.userAgent||"",Rh=(/iPod/i.test(Lh),/Android/i.test(Lh),i.Z.getComponent("Player")),Ih=function(e){function t(e,n){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=_h(t),function(e,t){if(t&&("object"==Nh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Eh()?Reflect.construct(t,n||[],_h(e).constructor):t.apply(e,n))}(this,t,[e,n]))._dataLoaded=!1,n.mobile&&r.addClass("cv-mobile-player");var i=function(){return r._dataLoaded=!0};return r.on("cv-playback-data-loaded",i),r.on("dispose",(function(){return r.off("cv-playback-data-loaded",i)})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xh(e,t)}(t,e),n=t,r=[{key:"dataLoaded",value:function(e){var t=this;this._dataLoaded?e():(this.one("cv-playback-data-loaded",e),this.one("dispose",(function(){t.off("cv-playback-data-loaded",e)})))}},{key:"lock",value:function(e){this.callback_=e}},{key:"unlock",value:function(){delete this.callback_}},{key:"currentTime",value:function(e,n){var r=this;if("number"!=typeof e||!this.callback_||n)return Ch(t,"currentTime",this,3)([e]);this.callback_((function(){r.unlock(),r.currentTime(e)}))}},{key:"play",value:function(){var e=this;if(!this.callback_)return Ch(t,"play",this,3)([]);this.callback_((function(){e.unlock(),e.play()}))}},{key:"createEl",value:function(){var e=this,n=Ch(t,"createEl",this,3)([]);return this.videoContainer||(this.videoContainer=i.Z.dom.createEl("div",{className:"cv-video-wrapper"}),n.appendChild(this.videoContainer)),Array.from(n.childNodes).forEach((function(t){return t!==e.videoContainer&&e.videoContainer.appendChild(t)})),n}},{key:"addChild",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,i=Ch(t,"addChild",this,3)([e,n,r]),o=i.el();return o&&this.videoContainer.appendChild(o),i}},{key:"updateStyleEl_",value:function(){if(Rh.prototype.updateStyleEl_.call(this),this.options_.fluid){var e=this.el_.parentNode;if(e&&this.options_.setMaxHeight){var t=this.aspectRatio();if(void 0!==t&&"auto"!==t||(t=this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9"),this.player_.playerModePlugin().getMode()===Ia.Hover)return e.style.removeProperty("maxWidth"),void e.style.removeProperty("margin");var n=t.split(":"),r=+n[1]/+n[0];e.style.maxWidth=85/r+"vh",e.style.margin="0 auto"}}}},{key:"listenForUserActivity_",value:function(){var e=this;Rh.prototype.listenForUserActivity_.call(this);var t=this.getChild("collapserator");t.on("mouseenter",(function(){e.player().cache_.inactivityTimeout=e.player().options_.inactivityTimeout,e.player().options_.inactivityTimeout=0})),t.on("mouseleave",(function(){e.player().options_.inactivityTimeout=e.player().cache_.inactivityTimeout}))}}],r&&Ph(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Rh);function Mh(e){return Mh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mh(e)}function Bh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dh(r.key),r)}}function Dh(e){var t=function(e){if("object"!=Mh(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Mh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mh(t)?t:t+""}function Ah(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ah=function(){return!!e})()}function Fh(e){return Fh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fh(e)}function zh(e,t){return zh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zh(e,t)}Ih.prototype.options_=Object.assign(Object.assign({},Rh.prototype.options_),{setMaxHeight:!0}),i.Z.registerComponent("player",Ih);var Zh=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Fh(t),function(e,t){if(t&&("object"==Mh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ah()?Reflect.construct(t,n||[],Fh(e).constructor):t.apply(e,n))}(this,t,[e,n])).player_.addClass("cv-disable-play-pause-feedback"),r.onFirstPlay=r.onFirstPlay.bind(r),r.player_.one("play",r.onFirstPlay),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zh(e,t)}(t,e),n=t,(r=[{key:"dispose",value:function(){this.player_.off("play",this.onFirstPlay)}},{key:"onFirstPlay",value:function(){var e=this;window.setTimeout((function(){e.player_.isDisposed()||e.player_.removeClass("cv-disable-play-pause-feedback")}),500)}},{key:"createEl",value:function(){return i.Z.dom.createEl("div",{className:"cv-play-pause-feedback"})}}])&&Bh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function Vh(e){return Vh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vh(e)}function Gh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Uh(r.key),r)}}function Uh(e){var t=function(e){if("object"!=Vh(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Vh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vh(t)?t:t+""}function Kh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kh=function(){return!!e})()}function qh(e){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qh(e)}function Hh(e,t){return Hh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hh(e,t)}i.Z.registerComponent("PlayPauseFeedback",Zh);var Wh=i.Z.getComponent("PlayToggle"),Yh=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=qh(t),function(e,t){if(t&&("object"==Vh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Kh()?Reflect.construct(t,n||[],qh(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hh(e,t)}(t,e),n=t,(r=[{key:"handleClick",value:function(e){var t=this;Wh.prototype.handleClick.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){t.player_.removeClass("cv-disable-play-pause-feedback")}),500)}}])&&Gh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Wh);function Qh(e){return Qh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qh(e)}function Jh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Xh(r.key),r)}}function Xh(e){var t=function(e){if("object"!=Qh(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Qh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qh(t)?t:t+""}function $h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($h=function(){return!!e})()}function ey(e){return ey=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ey(e)}function ty(e,t){return ty=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ty(e,t)}i.Z.registerComponent("PlayToggle",Yh);var ny=i.Z.getComponent("TextTrackDisplay"),ry=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=ey(t),function(e,t){if(t&&("object"==Qh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$h()?Reflect.construct(t,n||[],ey(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ty(e,t)}(t,e),n=t,(r=[{key:"updateDisplayState",value:function(e){ny.prototype.updateDisplayState.call(this,e);for(var t=this.player_.textTrackSettings.getValues(),n=e.activeCues,r=n.length;r--;){var i=n[r];if(i){var o=i.displayState;if(t.fontPercent&&1!==t.fontPercent){var a=.025*this.el().getBoundingClientRect().width*100/100;o.style.fontSize=a*t.fontPercent+"px"}}}}}])&&Jh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ny);function iy(e){return iy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iy(e)}function oy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ay(r.key),r)}}function ay(e){var t=function(e){if("object"!=iy(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=iy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==iy(t)?t:t+""}function uy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uy=function(){return!!e})()}function cy(e){return cy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cy(e)}function ly(e,t){return ly=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ly(e,t)}i.Z.registerComponent("TextTrackDisplay",ry);var sy=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=cy(t),function(e,t){if(t&&("object"==iy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,uy()?Reflect.construct(t,n||[],cy(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ly(e,t)}(t,e),n=t,(r=[{key:"createEl",value:function(){return i.Z.dom.createEl("div",{className:"cv-control-bar-gradient-container",innerHTML:'<div class="cv-control-bar-gradient"></div>'})}}])&&oy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function fy(e){return fy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fy(e)}function py(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hy(r.key),r)}}function hy(e){var t=function(e){if("object"!=fy(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=fy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fy(t)?t:t+""}function yy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yy=function(){return!!e})()}function vy(e,t,n,r){var i=dy(my(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function dy(){return dy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=my(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},dy.apply(null,arguments)}function my(e){return my=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},my(e)}function by(e,t){return by=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},by(e,t)}i.Z.registerComponent("ControlBarGradient",sy);var gy=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=my(t),function(e,t){if(t&&("object"==fy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,yy()?Reflect.construct(t,n||[],my(e).constructor):t.apply(e,n))}(this,t,[e,n])).options_=n,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&by(e,t)}(t,e),n=t,(r=[{key:"createEl",value:function(){var e=this.options_.title;if(!this.options_.seriesName)return vy(t,"createEl",this,3)(["h1",{innerHTML:e}]);var n=this.buildSeasonEpisodeString();return n?(e="<div class='cv-splash-series'>".concat(this.options_.seriesName.toUpperCase()," ").concat(n,"</div>")+e,vy(t,"createEl",this,3)(["h1",{innerHTML:e}])):(e="<div class='cv-splash-series'>".concat(this.options_.seriesName.toUpperCase(),"</div>")+e,vy(t,"createEl",this,3)(["h1",{innerHTML:e}]))}},{key:"buildSeasonEpisodeString",value:function(){if(!this.options_.seasonNumber||!this.options_.episodeNumber)return"";var e=this.padNumber(this.options_.seasonNumber,2),t=this.padNumber(this.options_.episodeNumber,2);return"S".concat(e," • E").concat(t)}},{key:"padNumber",value:function(e,t){var n=e.toString();if(n.length>=t)return n;for(t-=n.length;t>0;)n="0"+n,t--;return n}}])&&py(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function wy(e){return wy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wy(e)}function Oy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Sy(r.key),r)}}function Sy(e){var t=function(e){if("object"!=wy(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=wy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==wy(t)?t:t+""}function ky(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ky=function(){return!!e})()}function Ny(){return Ny="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Py(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Ny.apply(null,arguments)}function Py(e){return Py=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Py(e)}function jy(e,t){return jy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jy(e,t)}var Ey=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Py(t),function(e,t){if(t&&("object"==wy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ky()?Reflect.construct(t,n||[],Py(e).constructor):t.apply(e,n))}(this,t,[e,n])).options_=n,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jy(e,t)}(t,e),n=t,r=[{key:"buildCSSClass",value:function(){return"cv-splash-rating ".concat((e=this.options_.ratingValue)?function(e){switch(!0){case e<32:return"cv-rating-purple";case e<48:return"cv-rating-green";case e<80:return"cv-rating-blue";case e<96:return"cv-rating-red";case e<128:return"cv-rating-pink";case e>=128:return"cv-rating-yellow";default:return""}}(e):"");var e}},{key:"createEl",value:function(e,n,r){return this.options_.ratingCode?(i=t,o=this,"function"==typeof(a=Ny(Py(1&3?i.prototype:i),"createEl",o))?function(e){return a.apply(o,e)}:a)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass(),innerHTML:this.options_.ratingCode}),r]):null;var i,o,a}}],r&&Oy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function Cy(e){return Cy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cy(e)}function Ty(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_y(r.key),r)}}function _y(e){var t=function(e){if("object"!=Cy(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Cy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Cy(t)?t:t+""}function xy(e,t){if(t&&("object"==Cy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ly(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ly=function(){return!!e})()}function Ry(e){return Ry=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ry(e)}function Iy(e,t){return Iy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Iy(e,t)}var My=function(e){function t(e,n){var r,i,o,a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i=this,a=[e,n],o=Ry(o=t),r=xy(i,Ly()?Reflect.construct(o,a||[],Ry(i).constructor):o.apply(i,a)),n.embed?(r.addChild(new gy(e,n)),r.addChild(new Ey(e,n)),r):xy(r,r)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Iy(e,t)}(t,e),n=t,(r=[{key:"createEl",value:function(){return i.Z.dom.createEl("div",{className:"cv-splash-metadata"})}}])&&Ty(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function By(e){return By="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},By(e)}function Dy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ay(r.key),r)}}function Ay(e){var t=function(e){if("object"!=By(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=By(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==By(t)?t:t+""}function Fy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fy=function(){return!!e})()}function zy(e){return zy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zy(e)}function Zy(e,t){return Zy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zy(e,t)}var Vy=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=zy(t),function(e,t){if(t&&("object"==By(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fy()?Reflect.construct(t,n||[],zy(e).constructor):t.apply(e,n))}(this,t,[e,n])).addChild(new My(e,n)),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zy(e,t)}(t,e),n=t,(r=[{key:"createEl",value:function(){var e="<div class='cv-splash-mask'></div>";return this.options_.embed&&(e+="<div class='cv-splash-logo'>".concat(On,"</div>")),i.Z.dom.createEl("div",{className:"vjs-poster cv-embed-splash cv-embed-splash-black",tabIndex:-1,innerHTML:e})}},{key:"setSrc",value:function(e){var t="";e&&(t='url("'.concat(e,'")')),this.el_.style.backgroundImage=t}}])&&Dy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("posterImage"));function Gy(e){return Gy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gy(e)}function Uy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ky(r.key),r)}}function Ky(e){var t=function(e){if("object"!=Gy(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Gy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Gy(t)?t:t+""}function qy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qy=function(){return!!e})()}function Hy(e){return Hy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hy(e)}function Wy(e,t){return Wy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Wy(e,t)}i.Z.registerComponent("posterImage",Vy);var Yy=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Hy(t),function(e,t){if(t&&("object"==Gy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qy()?Reflect.construct(t,n||[],Hy(e).constructor):t.apply(e,n))}(this,t,[e,n])).el().prepend(r.getErrorImage()),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wy(e,t)}(t,e),n=t,(r=[{key:"getErrorImage",value:function(){return i.Z.dom.createEl("div",{className:"cv-error-image",innerHTML:'\n <svg viewBox="0 0 301 185" xmlns="http://www.w3.org/2000/svg">\n <path d="M267.393 36.6514V167.906C267.393 168.182 267.169 168.406 266.893 168.406H32C31.7239 168.406 31.5 168.182 31.5 167.906V36.6514C31.5 36.3752 31.7239 36.1514 32 36.1514H80.5C80.7761 36.1514 81 36.3752 81 36.6514V57.7196C81 58.7622 82.0375 59.4868 83.0164 59.1279L95.7377 54.4634C95.9961 54.3687 96.2825 54.5006 96.3785 54.7585L102.094 70.1194C102.677 71.6866 105 71.2685 105 69.5964V48.4925C105 47.7632 104.475 47.1396 103.757 47.0146L94.2479 45.3609C93.9436 45.308 93.7596 44.9946 93.8616 44.7031L96.7376 36.4862C96.8077 36.2856 96.997 36.1514 97.2095 36.1514H266.893C267.169 36.1514 267.393 36.3752 267.393 36.6514Z" stroke="white"/>\n <path d="M163.296 101.777L149.437 90.1217C148.275 89.1441 146.5 89.9705 146.5 91.4894V113.664C146.5 115.141 148.191 115.98 149.367 115.087L163.226 104.569C164.139 103.876 164.173 102.515 163.296 101.777Z" stroke="white" stroke-linecap="round"/>\n <path d="M295.53 23.0783L277.524 26.2801L283.252 32.7192L274.855 38.9079L292.861 35.7061L287.133 29.2671L295.53 23.0783Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M268.06 2.91764L254.192 14.8403L262.401 17.4661L258.324 27.0679L272.192 15.1453L263.983 12.5194L268.06 2.91764Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n '})}}])&&Uy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("ErrorDisplay"));function Qy(e){return Qy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qy(e)}function Jy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Xy(r.key),r)}}function Xy(e){var t=function(e){if("object"!=Qy(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Qy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qy(t)?t:t+""}function $y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($y=function(){return!!e})()}function ev(e){return ev=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ev(e)}function tv(e,t){return tv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},tv(e,t)}i.Z.registerComponent("ErrorDisplay",Yy);var nv=i.Z.getComponent("FullscreenToggle"),rv="Fullscreen (f)",iv=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=ev(t),function(e,t){if(t&&("object"==Qy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$y()?Reflect.construct(t,n||[],ev(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tv(e,t)}(t,e),n=t,(r=[{key:"handleFullscreenChange",value:function(){nv.prototype.handleFullscreenChange.call(this),this.controlText(rv)}}])&&Jy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(nv);i.Z.registerComponent("FullscreenToggle",iv),iv.prototype.controlText_=rv;var ov=n(67453),av=n(54610);function uv(e){return uv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uv(e)}function cv(){cv=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==uv(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(uv(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function lv(e){return function(e){if(Array.isArray(e))return sv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return sv(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sv(e,t):void 0}}(e)||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 sv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pv(r.key),r)}}function pv(e){var t=function(e){if("object"!=uv(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=uv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==uv(t)?t:t+""}var hv,yv=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))},vv=i.Z.getComponent("Player"),dv=function(){return e=function e(t,n){var r=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamLogged=!1,this.options=i.Z.obj.merge({},e.options_,n),null===this.options.playerApi)throw new Error("PlayerApi required");this.initialize(),this.createEl(t),this.buildVideoJs(),this.options.splash&&this.setupSplash(this.options.splash),this.bindEventListeners(),this.setupSeekBar(),this.fetchConfig(),this.logStream=this.logStream.bind(this),this.player.ready((function(){r._configurePlugins(),r.options.setup&&r.options.setup(r.options,r.player),r.fetch().catch((function(e){return r.handleFetchError(e)}))}))},(t=[{key:"initialize",value:function(){}},{key:"_configurePlugins",value:function(){this.player.configureMenuDimensionsPlugin({mobile:this.options.mobile,overflowControls:this.options.overflowControls,seekBarName:this.getSeekBarName()}),this.player.progressReporterPlugin({onFlush:this.onFlushProgress=this.onFlushProgress.bind(this)}),this.player.persistVolumePlugin(),!this.options.mobile&&this.options.allowFullscreen&&this.player.fullscreenOnRotatePlugin(),this.player.touchControls(),this.options.getExternalLink&&this.player.openExternallyPlugin({getExternalLink:this.options.getExternalLink}),this.configurePlugins()}},{key:"configurePlugins",value:function(){}},{key:"onFlushProgress",value:function(e){var t;null===(t=this.analyticsService)||void 0===t||t.logVideoProgress(e)}},{key:"buildVideoJs",value:function(){return this.player=(0,i.Z)(this.el,this.getPlayerOptions())}},{key:"getInactivityTimeout",value:function(){if("number"==typeof this.options.inactivityTimeout)return this.options.inactivityTimeout;var e=500;return(this.options.mobile||i.Z.browser.IS_IOS||i.Z.browser.IS_ANDROID)&&(e=3e3),e}},{key:"getFluid",value:function(){return!this.options.theatreMode&&!this.options.embed&&!this.options.mobile}},{key:"getFill",value:function(){return!!this.options.theatreMode||!(!this.options.embed&&!this.options.mobile)}},{key:"getPlayerOptions",value:function(){var e=this,t=vv.prototype.options_.children;return t=t.filter((function(e){return"bigPlayButton"!==e&&"posterImage"!==e})),{controls:this.options.controls,fluid:this.getFluid(),fill:this.getFill(),inactivityTimeout:this.getInactivityTimeout(),controlBar:{children:["timeWrapper","progressControl"]},children:[].concat(lv(t),[{name:"collapserator",children:tt.filter((function(t){return!("fullscreenToggle"===t&&!e.options.allowFullscreen)}))},"playPauseFeedback","controlBarGradient"]),userActions:{hotkeys:function(t){return function(e,t,n){if(!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)){var r=Pt()(e);if(("t"!==r||n.allowTheatreMode)&&("f"!==r||n.allowFullscreen)&&Lt[r]){Lt[r](t,e);var i=function(e){var t=e.target;return"video"===t.tagName.toLowerCase()||!!["video-js","vjs-tech"].find((function(e){return t.classList.contains(e)}))}(e),o=["space"].includes(r);(i||o)&&(e.preventDefault(),e.stopPropagation())}}}(t,e.player,e.options)}},playbackRates:this.options.playbackRates,techOrder:["html5"],html5:{nativeTextTracks:!1},playsinline:!0,aspectRatio:this.options.aspectRatio,mobile:this.options.mobile,allowTheatreMode:this.options.allowTheatreMode,deferMenus:this.options.deferMenus,muted:this.options.muted,devicesConfig:this.options.devicesConfig}}},{key:"getPlaybackObject",value:function(){return yv(this,void 0,void 0,cv().mark((function e(){var t,n,r=this;return cv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.options.offlinePlaybackObject){e.next=2;break}return e.abrupt("return",this.options.offlinePlaybackObject);case 2:if(t=this.options.fetch,void 0===this.options.fetch&&(t=function(e){var t="".concat(r.options.playerApi.origin,"/api/playback?viewKey=").concat(e);return kt.get(t)}),this.options.viewKey){e.next=6;break}throw new Error("Please specify a viewKey or a fetch function");case 6:return e.next=8,t(this.options.viewKey);case 8:if(n=e.sent){e.next=11;break}throw new Error("Error fetching playback object");case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,this)})))}},{key:"setChaptersInternal",value:function(e,t){var n=Y.getTrack(this.player,"chapters",null);n||(n=this.player.addTextTrack("chapters")),lv(n.cues.cues_).forEach((function(e){return n.removeCue(e)})),e.forEach((function(e){n.addCue({startTime:e.timestamp,endTime:e.endTimestamp,text:e.name})})),t&&n.trigger({type:"cv:cuechange",target:n}),n.trigger({type:"loadeddata",target:n})}},{key:"setChapters",value:function(e){this.setChaptersInternal(e,!0)}},{key:"setPlayerMode",value:function(e,t){this.player.playerModePlugin().setPlayerMode(e,t)}},{key:"setFavourite",value:function(e,t){this.player.favouritePlugin().setFavourite(e,t)}},{key:"fetch",value:function(){var e,t,n,r,i;return yv(this,void 0,void 0,cv().mark((function o(){var a,u,c,l=this;return cv().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getPlaybackObject();case 2:if(a=o.sent,!this.isDisposed()){o.next=5;break}return o.abrupt("return");case 5:u="MasterClip"===a.mediaType,c=null===(e=a.additionalData)||void 0===e?void 0:e.clipData,(null===(n=null===(t=a.chapters)||void 0===t?void 0:t.list)||void 0===n?void 0:n.length)>0&&!u&&!c&&this.setChaptersInternal(a.chapters.list,!1),this.player.localCache({localCacheAddresses:null!==(r=a.localCacheAddresses)&&void 0!==r?r:[],enabled:null===(i=this.options.enableLocalCache)||void 0===i||i}),this.player.progressiveFiles({sources:a.files.progressive.map((function(e){return{id:e.profile,mimeType:e.mimeType,url:e.url}}))}),this.player.handleNetworkErrors({playerApi:this.options.playerApi,fileToken:a.files.fileToken}),a.subtitles.list.length>0&&a.subtitles.list.forEach((function(e){if("text/vtt"===e.mimeType){var t=l.player.addRemoteTextTrack({kind:"subtitles",src:e.url,language:e.language,label:e.label},!0);t.track.isClickViewProduced=e.isClickViewProduced,Y.sanitizeTrack(t.track,l.player),Y.activeTextTrack(t.track)}})),a.posterUrl&&this.player.poster(ov.j.createUrl(a.posterUrl,{size:av.h2.Large})),this.setupSplash({title:a.title,posterUrl:a.posterUrl,episodeNumber:a.episodeNumber,ratingCode:a.ratingCode,seasonNumber:a.seasonNumber,seriesName:a.seriesName}),this.additionalSetup(a),this.handleAutoplay(a),this.options.startTime&&(this.player.currentTime(this.options.startTime),this.player.one("canplay",(function(){l.player.currentTime(l.options.startTime)}))),this.player.trigger("cv-playback-data-loaded",a);case 18:case"end":return o.stop()}}),o,this)})))}},{key:"handleFetchError",value:function(e){var t,n=e.message;e instanceof dt&&(null===(t=e.response)||void 0===t?void 0:t.type)===xt.PhysicallyChapteredVideo&&(n="Video cannot be played because it is either corrupt or damaged."),this.player.error(n),this.options.onError&&this.options.onError(e)}},{key:"fetchConfig",value:function(){return yv(this,void 0,void 0,cv().mark((function e(){var t;return cv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(hv||this.options.fetch||this.options.offlinePlaybackObject)){e.next=2;break}return e.abrupt("return");case 2:return t="".concat(this.options.playerApi.origin,"/api/config"),e.next=5,kt.get(t);case 5:if(hv=e.sent,!this.isDisposed()){e.next=8;break}return e.abrupt("return");case 8:this.trigger("config:loaded");case 9:case"end":return e.stop()}}),e,this)})))}},{key:"additionalSetup",value:function(e){var t,n=this;this.player.whiteboardModePlugin(),this.player.deferMenusPlugin();var r=this.options.enableLocalCache&&!!(null===(t=e.localCacheAddresses)||void 0===t?void 0:t.length);hv?this.setupAnalyticsService(e,r):this.one("config:loaded",(function(){return n.setupAnalyticsService(e,r)})),this.analyticsService||!this.isAnalyticsEnabled()?this.setupAnalyticsDependentPlugins(e):this.one("analytics:loaded",(function(){return n.setupAnalyticsDependentPlugins(e)}))}},{key:"setupAnalyticsService",value:function(e,t){this.options.eventLogging&&(this.analyticsService=new st({collectionApiUrls:hv.collectionApi.urls,collectionApiClientId:hv.collectionApi.clientId,productVersion:"1.32.0-rc.0",authSessionId:e.viewerAuthSessionId,videoId:e.videoId,mediaId:e.mediaId,userId:e.viewerId,shareId:e.shareId,customerId:e.viewerCustomerId,mediaType:e.mediaType,playerType:this.getAnalyticsPlayerType(),isEmbedded:this.options.embed,isUsingLocalCache:t,additionalAnalyticsData:this.getAdditionalAnalyticsData(e),regionName:e.instanceRegion||this.options.sharerInstanceRegion||Rt.M.CvApSoutheast1}),this.on("timeupdate",this.logStream),this.trigger("analytics:loaded"))}},{key:"setupAnalyticsDependentPlugins",value:function(e){var t,n,r,i;this.player.persistSubtitleSettingsPlugin({showSubtitles:null===(t=e.settings)||void 0===t?void 0:t.showSubtitles,subtitleSize:null===(n=e.settings)||void 0===n?void 0:n.playbackSubtitleSizeDefault,analyticsService:this.analyticsService}),this.player.persistQualitySettingsPlugin({playbackProfile:null===(r=e.settings)||void 0===r?void 0:r.playbackProfile,playbackProfileLocalCache:null===(i=e.settings)||void 0===i?void 0:i.playbackProfileLocalCache,analyticsService:this.analyticsService}),this.player.persistPlaybackRatePlugin({analyticsService:this.analyticsService})}},{key:"getAdditionalAnalyticsData",value:function(e){return{}}},{key:"isAnalyticsEnabled",value:function(){return!this.options.fetch&&!this.options.offlinePlaybackObject&&this.options.eventLogging}},{key:"handleAutoplay",value:function(e){var t=this;this.options.autoplay&&this.player.ready((function(){t.player.play().catch((function(){t.isDisposed()||t.showSplash()}))}))}},{key:"logStream",value:function(){this.analyticsService&&(this.player.currentTime()<3||this.streamLogged||(this.analyticsService.logStream(),this.streamLogged=!0,this.off("timeupdate",this.logStream)))}},{key:"getAnalyticsPlayerType",value:function(){return"player"}},{key:"createEl",value:function(e){var t;"string"==typeof e?(e=function(e){return 0===e.indexOf("#")?e.slice(1):e}(e),t=i.Z.dom.$("#"+e)):t=e;var n="video-js";return this.getPlayerClassName()&&(n+=" ".concat(this.getPlayerClassName())),this.el=i.Z.dom.createEl("video",{},{class:n}),t.appendChild(this.el),this.el}},{key:"getPlayerClassName",value:function(){return""}},{key:"on",value:function(e,t){this.player.on(e,t)}},{key:"one",value:function(e,t){this.player.one(e,t)}},{key:"off",value:function(e,t){this.player.off(e,t)}},{key:"trigger",value:function(e,t){return this.player.trigger(e,t)}},{key:"dispose",value:function(){this.player.dispose()}},{key:"ready",value:function(e){this.player.ready(e)}},{key:"isDisposed",value:function(){return this.player.isDisposed()}},{key:"play",value:function(){this.player.play()}},{key:"pause",value:function(){this.player.pause()}},{key:"isPaused",value:function(){return this.player.paused()}},{key:"currentTime",value:function(e){return this.player.currentTime(e)}},{key:"muted",value:function(e){return this.player.muted(e)}},{key:"duration",value:function(){return this.player.duration()}},{key:"isFullscreen",value:function(){return this.player.isFullscreen()}},{key:"requestFullscreen",value:function(){this.player.requestFullscreen()}},{key:"exitFullscreen",value:function(){this.player.exitFullscreen()}},{key:"playbackRate",value:function(e){return this.player.playbackRate(e)}},{key:"quality",value:function(e){for(var t=this.player.qualityLevels(),n=0;n<t.length;n++){var r=t[n];if(e)r.enabled=r.id===e.toString();else if(r.enabled)return r.id}}},{key:"subtitles",value:function(e){for(var t=this.player.textTracks(),n=0;n<t.length;n++){var r=t[n];if(void 0===e){if("showing"===r.mode)return r.label}else r.label===e?r.mode="showing":r.mode="hidden"}}},{key:"bindEventListeners",value:function(){var e=this,t=function(e){return e.preventDefault()};if(this.showSplash=this.showSplash.bind(this),this.hideSplash=this.hideSplash.bind(this),this.player.on("ended",this.showSplash),this.player.on("play",this.hideSplash),this.player.tech(!0).on("contextmenu",t),this.player.one("dispose",(function(){e.off("ended",e.showSplash),e.off("play",e.hideSplash),e.player.tech(!0).off("contextmenu",t)})),this.options.hotkeyElQuerySelector){var n=i.Z.dom.$(this.options.hotkeyElQuerySelector);n&&(this.player.on(n,"keydown",this.player.handleKeyDown),this.player.one("dispose",(function(){e.player.off(n,"keydown",e.player.handleKeyDown)})))}}},{key:"setupSeekBar",value:function(){var e=this.getSeekBarName(),t=this.player.controlBar.getChild("progressControl");t.addChild(e,this.getSeekBarOptions()),t.setSeekBarName(e)}},{key:"setupSplash",value:function(e){this._splashAdded||(this._splashAdded=!0,this.player.addChild("posterImage",Object.assign({embed:this.options.embed},e)),this.player.addChild("bigPlayButton"),this.options.autoplay?this.hideSplash():this.showSplash())}},{key:"showSplash",value:function(){this.player.hasStarted(!1),this.player.getChild("posterImage").show(),this.player.getChild("bigPlayButton").show()}},{key:"hideSplash",value:function(){this.player.getChild("posterImage").hide(),this.player.getChild("bigPlayButton").hide()}},{key:"getSeekBarOptions",value:function(){return{}}},{key:"getSeekBarName",value:function(){return"ChapterSeekBar"}}])&&fv(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function mv(e){return mv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mv(e)}function bv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gv(r.key),r)}}function gv(e){var t=function(e){if("object"!=mv(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mv(t)?t:t+""}function wv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wv=function(){return!!e})()}function Ov(){return Ov="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Sv(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Ov.apply(null,arguments)}function Sv(e){return Sv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sv(e)}function kv(e,t){return kv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kv(e,t)}dv.options_={viewKey:null,controls:!0,playbackRates:[.25,.5,.75,1,1.25,1.5,1.75,2],playerApi:new URL("http://localhost:52000"),enableLocalCache:!0,eventLogging:!0,allowFullscreen:!0};var Nv=function(e){function t(e,n){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=function(e,t,n){return t=Sv(t),function(e,t){if(t&&("object"==mv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,wv()?Reflect.construct(t,n||[],Sv(e).constructor):t.apply(e,n))}(this,t,[e]),void 0===n.startTime)throw Error("Invalid clip start");if(void 0===n.endTime)throw Error("Invalid clip end");if(n.startTime>n.endTime)throw Error("Clip start cannot be greater than clip end");return r._clipStart=parseFloat(n.startTime.toPrecision(4)),r._clipEnd=parseFloat(n.endTime.toPrecision(4)),r.playerEndedFn=r.player.ended.bind(e),r.playerDurationFn=r.player.duration.bind(e),r.playerCurrentTimeFn=r.player.currentTime.bind(e),r.playerbufferedFn=r.player.buffered.bind(e),r.player.ended=r.ended.bind(r),r.player.duration=r.duration.bind(r),r.player.currentTime=r.currentTime.bind(r),r.player.buffered=r.buffered.bind(r),r.initialize(),r.player.ready((function(){r.player.trigger("durationchange")})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kv(e,t)}(t,e),n=t,r=[{key:"clipStart",get:function(){var e=this.playerDurationFn();return this._clipStart>e?e:this._clipStart}},{key:"clipEnd",get:function(){var e=this.playerDurationFn();return e<=0?this._clipEnd:this._clipEnd>e?e:this._clipEnd}},{key:"dispose",value:function(){var e,n,r;this.player.off("timeupdate",this.onTimeUpdate),this.player.off("play",this.onPlay),this.player.ended=this.playerEndedFn,this.player.duration=this.playerDurationFn,this.player.currentTime=this.playerCurrentTimeFn,this.player.buffered=this.playerbufferedFn,this.player.trigger("durationchange"),(e=t,n=this,"function"==typeof(r=Ov(Sv(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}},{key:"initialize",value:function(){this.onTimeUpdate=this.onTimeUpdate.bind(this),this.onPlay=this.onPlay.bind(this),this.player.on("timeupdate",this.onTimeUpdate),this.player.on("play",this.onPlay)}},{key:"onPlay",value:function(){this._isEnded&&this.player.currentTime(0)}},{key:"onTimeUpdate",value:function(){var e=this.getCurrentTime(!1);e>this.clipEnd?this._isEnded||(this.player.pause(),this.player.trigger("ended"),this._isEnded=!0):(this._isEnded=!1,e<this.clipStart-10&&this.playerCurrentTimeFn(this.clipStart,!0))}},{key:"ended",value:function(){return this.getCurrentTime(!1)>this.clipEnd}},{key:"duration",value:function(e){return e&&e>0&&(this.playerDurationFn()?console.info("The duration of the player has already been set. This is a no-op."):this.playerDurationFn(e)),this.clipEnd-this.clipStart}},{key:"currentTime",value:function(e){if("number"!=typeof e)return this.getCurrentTime(!0);for(var t=e+this.clipStart,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.playerCurrentTimeFn(t,r)}},{key:"getCurrentTime",value:function(e){var t=this.playerCurrentTimeFn(),n=0;return t>=this.clipStart&&(n=t-this.clipStart),this.player.getCache().currentTime=n,e?n:t}},{key:"buffered",value:function(){for(var e=this.playerbufferedFn(),t=[],n=0;n<e.length;n++)t[n]=[Math.max(0,e.start(n)-this.clipStart),Math.min(Math.max(0,e.end(n)-this.clipStart),this.player.duration())];return i.Z.createTimeRanges(t)}}],r&&bv(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function Pv(e){return Pv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pv(e)}function jv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ev(r.key),r)}}function Ev(e){var t=function(e){if("object"!=Pv(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Pv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pv(t)?t:t+""}function Cv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cv=function(){return!!e})()}function Tv(){return Tv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=_v(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Tv.apply(null,arguments)}function _v(e){return _v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_v(e)}function xv(e,t){return xv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xv(e,t)}i.Z.registerPlugin("clipPlugin",Nv);var Lv=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=_v(t),function(e,t){if(t&&("object"==Pv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Cv()?Reflect.construct(t,n||[],_v(e).constructor):t.apply(e,n))}(this,t,arguments)).alwaysCollapsed=!1,e.isCollapsed=!1,e.isCollabsible=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xv(e,t)}(t,e),n=t,r=[{key:"buildCSSClass",value:function(){return"cv-create-clip-button"}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){var e,n,r;(e=t,n=this,"function"==typeof(r=Tv(_v(1&3?e.prototype:e),"handleClick",n))?function(e){return r.apply(n,e)}:r)([null])}}],r&&jv(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Button"));function Rv(e){return Rv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rv(e)}function Iv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mv(r.key),r)}}function Mv(e){var t=function(e){if("object"!=Rv(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Rv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rv(t)?t:t+""}function Bv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bv=function(){return!!e})()}function Dv(e){return Dv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dv(e)}function Av(e,t){return Av=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Av(e,t)}Lv.prototype.controlText_="Create Clip",i.Z.registerComponent("CreateClipButton",Lv);var Fv=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Dv(t),function(e,t){if(t&&("object"==Rv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Bv()?Reflect.construct(t,n||[],Dv(e).constructor):t.apply(e,n))}(this,t,[e,n])).options=n,e.ready((function(){return r.onReady()})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Av(e,t)}(t,e),n=t,(r=[{key:"onReady",value:function(){var e,t=this.player.getChild("collapserator"),n=null===(e=null==t?void 0:t.children())||void 0===e?void 0:e.findIndex((function(e){return"CustomControlSpacer"===e.name()}));n&&-1!==n&&t.addChild("CreateClipButton",{clickHandler:this.options.onClick},n+1)}}])&&Iv(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function zv(e){return zv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zv(e)}function Zv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Vv(r.key),r)}}function Vv(e){var t=function(e){if("object"!=zv(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=zv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zv(t)?t:t+""}function Gv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gv=function(){return!!e})()}function Uv(e){return Uv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Uv(e)}function Kv(e,t){return Kv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kv(e,t)}i.Z.registerPlugin("createClipButtonPlugin",Fv);var qv=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Uv(t),function(e,t){if(t&&("object"==zv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Gv()?Reflect.construct(t,n||[],Uv(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kv(e,t)}(t,e),n=t,(r=[{key:"handlePictureInPictureEnabledChange",value:function(){this.enable()}}])&&Zv(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("PictureInPictureToggle"));function Hv(e){return Hv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hv(e)}function Wv(){Wv=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Hv(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(Hv(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function Yv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Qv(r.key),r)}}function Qv(e){var t=function(e){if("object"!=Hv(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Hv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Hv(t)?t:t+""}function Jv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jv=function(){return!!e})()}function Xv(){return Xv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=$v(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Xv.apply(null,arguments)}function $v(e){return $v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$v(e)}function ed(e,t){return ed=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ed(e,t)}i.Z.registerComponent("PictureInPictureToggle",qv);var td=i.Z.getComponent("PlayToggle"),nd=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=$v(t),function(e,t){if(t&&("object"==Hv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Jv()?Reflect.construct(t,n||[],$v(e).constructor):t.apply(e,n))}(this,t,[e,n])).options=n,r.bindFunctions(),e.ready((function(){return r.initialize()})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ed(e,t)}(t,e),n=t,r=[{key:"bindFunctions",value:function(){this.requestPictureInPicture=this.requestPictureInPicture.bind(this),this.exitPictureInPicture=this.exitPictureInPicture.bind(this),this.onPlayerResize=this.onPlayerResize.bind(this),this.playerRequestPictureInPictureFn=this.player.requestPictureInPicture,this.playerExitPictureInPictureFn=this.player.exitPictureInPicture,this.player.requestPictureInPicture=this.requestPictureInPicture,this.player.exitPictureInPicture=this.exitPictureInPicture}},{key:"initialize",value:function(){var e=this,t=this.player.getChild("collapserator"),n=t.children().findIndex((function(e){var t;return"fullscreentoggle"===(null===(t=e.name())||void 0===t?void 0:t.toLowerCase())}));-1===n&&(n=t.children().length-1),this.toggle=t.addChild("pictureInPictureToggle",{},n),this.toggle.enable(),this.player.on("playerresize",this.onPlayerResize),this.player.on("dispose",(function(){var t;null===(t=e.player)||void 0===t||t.off("playerresize",e.onPlayerResize)}))}},{key:"togglePictureInPicture",value:function(e){if(e!==this.player.isInPictureInPicture()){var t=e?"enterpictureinpicture":"leavepictureinpicture";this.player.isInPictureInPicture(e),this.player.trigger(t),e?this.addPipStyles():this.removePipStyles()}}},{key:"onPlayerResize",value:function(){var e,t;if(!this.player.isInPictureInPicture()){var n=this.player.el().getBoundingClientRect();0!==n.width&&(n.width<800?null===(e=this.toggle)||void 0===e||e.hide():null===(t=this.toggle)||void 0===t||t.show())}}},{key:"addPipStyles",value:function(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new td(this.player),this.playToggle.addClass("cv-pip-play-toggle"),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}},{key:"removePipStyles",value:function(){this.player.removeClass("cv-picture-in-picture"),this.player.removeChild(this.playToggle),delete this.playToggle}},{key:"requestPictureInPicture",value:function(){var e;this.togglePictureInPicture(!0),"function"==typeof(null===(e=this.options)||void 0===e?void 0:e.onRequestPictureInPicture)&&this.options.onRequestPictureInPicture(!0)}},{key:"exitPictureInPicture",value:function(){return e=this,t=void 0,n=void 0,r=Wv().mark((function e(){return Wv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles();case 3:case"end":return e.stop()}}),e,this)})),new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}));var e,t,n,r}},{key:"dispose",value:function(){var e,n,r;this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,(e=t,n=this,"function"==typeof(r=Xv($v(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}}],r&&Yv(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function rd(e){return rd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rd(e)}function id(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,od(r.key),r)}}function od(e){var t=function(e){if("object"!=rd(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=rd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rd(t)?t:t+""}i.Z.registerPlugin("pictureInPicture",nd);var ad=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.listeners={}},t=[{key:"subscribe",value:function(e,t){this.registerListener(e,t)}},{key:"subscribeOnce",value:function(e,t){this.registerListener(e,t,1)}},{key:"unsubscribe",value:function(e,t){this.deregisterListener(e,t)}},{key:"trigger",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.triggerCallbacks(e,n)}},{key:"registerListener",value:function(e,t,n){var r;if("string"!=typeof e)throw new Error("Event name must be a string");if("function"!=typeof t)throw new Error("Event callback must be a function");if(n&&"number"!=typeof n)throw new Error("Execution limit must be a number or undefined");this.listeners[e]=null!==(r=this.listeners[e])&&void 0!==r?r:[],this.listeners[e].push({callback:t,executionLimit:n})}},{key:"deregisterListener",value:function(e,t){var n;if("string"!=typeof e)throw new Error("Event name must be a string");if(t&&"function"!=typeof t)throw new Error("Event callback must be a function");if(t){var r=null===(n=this.listeners[e])||void 0===n?void 0:n.findIndex((function(e){return e.callback===t}));"number"==typeof r&&-1!==r&&(this.listeners[e].splice(r,1),0===this.listeners[e].length&&delete this.listeners[e])}else this.listeners[e]=[]}},{key:"triggerCallbacks",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];if(this.listeners[e]){var o=[];this.listeners[e].forEach((function(e){var t,n;"number"==typeof e.executionLimit&&(e.executionCount=null!==(n=e.executionCount)&&void 0!==n?n:0,e.executionCount++,e.executionCount===e.executionLimit&&o.push(e.callback)),(t=e.callback).apply.apply(t,[null].concat(r))})),o.length&&o.forEach((function(n){return t.deregisterListener(e,n)}))}}}],t&&id(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());function ud(e){return ud="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ud(e)}function cd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ld(r.key),r)}}function ld(e){var t=function(e){if("object"!=ud(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ud(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ud(t)?t:t+""}function sd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sd=function(){return!!e})()}function fd(e,t,n,r){var i=pd(hd(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function pd(){return pd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=hd(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},pd.apply(null,arguments)}function hd(e){return hd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hd(e)}function yd(e,t){return yd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yd(e,t)}var vd=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=hd(t),function(e,t){if(t&&("object"==ud(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,sd()?Reflect.construct(t,n||[],hd(e).constructor):t.apply(e,n))}(this,t,[e,n])).hasBuffered=!1,r.hasPlayed=!1,r.eventsService=ad,r.pointOfInterest=n.pointOfInterest,r.onMouseOver=r.onMouseOver.bind(r),r.onMouseLeave=r.onMouseLeave.bind(r),r.onGlancePointOfInterestMouseEnter=r.onGlancePointOfInterestMouseEnter.bind(r),r.onGlancePointOfInterestMouseLeave=r.onGlancePointOfInterestMouseLeave.bind(r),r.initialize(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yd(e,t)}(t,e),n=t,(r=[{key:"initialize",value:function(){this.setPosition(),this.bindListeners()}},{key:"buildCSSClass",value:function(){return"cv-point-of-interest-indicator ".concat(fd(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,r){return fd(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"bindListeners",value:function(){this.on("mouseover",this.onMouseOver),this.on("mouseleave",this.onMouseLeave),this.eventsService.subscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.subscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"dispose",value:function(){this.eventsService.unsubscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"getPointOfInterestTime",value:function(){return this.pointOfInterest.startTime}},{key:"setPosition",value:function(){var e=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/e*100+"%"}},{key:"updateBuffered",value:function(e){var t=this.getPointOfInterestTime()<=e;if(t!==this.hasBuffered){this.hasBuffered=t;var n="cv-point-of-interest-indicator-buffered";this.hasBuffered?this.addClass(n):this.removeClass(n)}}},{key:"updatePlaybackProgress",value:function(e){var t=this.getPointOfInterestTime()<=e;if(t!==this.hasPlayed){this.hasPlayed=t;var n="cv-point-of-interest-indicator-played";t?this.addClass(n):this.removeClass(n)}}},{key:"toggleVisibility",value:function(e){var t="cv-point-of-interest-indicator-hidden";e?this.removeClass(t):this.addClass(t)}},{key:"onMouseOver",value:function(){this.setTimeTooltipText(),this.eventsService.trigger("player:poi:mouseover",this.pointOfInterest)}},{key:"onMouseLeave",value:function(){this.clearTimeTooltipText(),this.eventsService.trigger("player:poi:mouseleave")}},{key:"onGlancePointOfInterestMouseEnter",value:function(e){e.id===this.pointOfInterest.id&&(this.addClass("cv-point-of-interest-indicator-highlight"),this.setTimeTooltipTime(),this.setTimeTooltipText(),this.positionMouseTimeDisplay(),this.showMouseTimeDisplay())}},{key:"onGlancePointOfInterestMouseLeave",value:function(){this.removeClass("cv-point-of-interest-indicator-highlight"),this.hideMouseTimeDisplay()}},{key:"setTimeTooltipText",value:function(){var e;null===(e=this.getTimeTooltip())||void 0===e||e.setCustomChapterText(this.pointOfInterest.description)}},{key:"clearTimeTooltipText",value:function(){var e;null===(e=this.getTimeTooltip())||void 0===e||e.setCustomChapterText()}},{key:"setTimeTooltipTime",value:function(){var e=this.getTimeTooltip();null==e||e.updateTime(this.getPointOfInterestTime())}},{key:"positionMouseTimeDisplay",value:function(){var e,t,n=null===(e=this.getSeekBar())||void 0===e?void 0:e.el();if(n){var r=i.Z.dom.findPosition(n),o=this.getPointOfInterestTime()/this.player().duration();null===(t=this.getMouseTimeDisplay())||void 0===t||t.update(r,o)}}},{key:"showMouseTimeDisplay",value:function(){var e;null===(e=this.getMouseTimeDisplay())||void 0===e||e.forceShow()}},{key:"hideMouseTimeDisplay",value:function(){var e;null===(e=this.getMouseTimeDisplay())||void 0===e||e.removeForceShow()}},{key:"getSeekBar",value:function(){var e;return null===(e=this.player().controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar")}},{key:"getMouseTimeDisplay",value:function(){var e;return null===(e=this.getSeekBar())||void 0===e?void 0:e.getChild("MouseTimeDisplay")}},{key:"getTimeTooltip",value:function(){var e;return null===(e=this.getMouseTimeDisplay())||void 0===e?void 0:e.getChild("TimeTooltip")}}])&&cd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function dd(e){return dd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dd(e)}function md(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bd(r.key),r)}}function bd(e){var t=function(e){if("object"!=dd(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=dd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==dd(t)?t:t+""}function gd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gd=function(){return!!e})()}function wd(){return wd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Od(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},wd.apply(null,arguments)}function Od(e){return Od=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Od(e)}function Sd(e,t){return Sd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Sd(e,t)}var kd=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Od(t),function(e,t){if(t&&("object"==dd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,gd()?Reflect.construct(t,n||[],Od(e).constructor):t.apply(e,n))}(this,t,[e,n])).pointsOfInterestVisible=n.pointsOfInterestVisible,r.toggle(r.pointsOfInterestVisible),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sd(e,t)}(t,e),n=t,r=[{key:"handleToggle",value:function(){this.toggle(!this.pointsOfInterestVisible)}},{key:"toggle",value:function(e){e?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){i.Z.dom.addClass(this.toggleEl,"on"),i.Z.dom.setAttribute(this.toggleEl,"aria-checked","true"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"toggleOff",value:function(){i.Z.dom.removeClass(this.toggleEl,"on"),i.Z.dom.setAttribute(this.toggleEl,"aria-checked","false"),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"handleClick",value:function(e){e.stopImmediatePropagation()}},{key:"createEl",value:function(e,n,r){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=i.Z.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),i.Z.dom.setAttribute(this.toggleEl,"id","poi-toggle"),i.Z.dom.setAttribute(this.toggleEl,"role","switch"),this.toggleEl.addEventListener("click",this.handleToggle);var o,a,u,c=(o=t,a=this,"function"==typeof(u=wd(Od(1&3?o.prototype:o),"createEl",a))?function(e){return u.apply(a,e)}:u)([e,{className:"vjs-menu-item cv-cog-menu-item cv-poi-toggle",innerHTML:'\n <label for="poi-toggle" class="vjs-menu-item-text">Points of Interest</label>\n <span class="cv-toggle-container"></span>'},r]);return c.children[1].appendChild(this.toggleEl),c}}],r&&md(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("MenuItem"));function Nd(e){return Nd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nd(e)}function Pd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,jd(r.key),r)}}function jd(e){var t=function(e){if("object"!=Nd(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Nd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Nd(t)?t:t+""}function Ed(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ed=function(){return!!e})()}function Cd(e){return Cd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Cd(e)}function Td(e,t){return Td=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Td(e,t)}i.Z.registerComponent("PointsOfInterestMenuItem",kd);var _d,xd=i.Z.getPlugin("plugin"),Ld="cvplayer-points-of-interest",Rd=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Cd(t),function(e,t){if(t&&("object"==Nd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ed()?Reflect.construct(t,n||[],Cd(e).constructor):t.apply(e,n))}(this,t,[e])).pointOfInterestIndicators=[],r.enabled=!0,r.pointsOfInterest=null==n?void 0:n.pointsOfInterest,r.initialize=r.initialize.bind(r),r.updateBuffered=r.updateBuffered.bind(r),r.updatePlaybackProgress=r.updatePlaybackProgress.bind(r),r.player.one("loadedmetadata",(function(){return r.player.ready(r.initialize)})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Td(e,t)}(t,e),n=t,(r=[{key:"initialize",value:function(){this.pointsOfInterest&&(Gt()&&"false"===Ut(Ld)&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}},{key:"bindListeners",value:function(){var e=this;this.player.on("progress",this.updateBuffered),this.player.on("timeupdate",this.updatePlaybackProgress),this.player.on("dispose",(function(){var t,n;null===(t=e.player)||void 0===t||t.off("progress",e.updateBuffered),null===(n=e.player)||void 0===n||n.off("timeupdate",e.updatePlaybackProgress)}))}},{key:"togglePointsOfInterest",value:function(e){Kt(Ld,e.toString()),this.pointOfInterestIndicators.forEach((function(t){return t.toggleVisibility(e)}))}},{key:"setupTrack",value:function(){var e=this.player.addTextTrack("metadata","pointsofinterest");this.pointsOfInterest.forEach((function(t){e.addCue({startTime:t.startTime,endTime:t.endTime,text:t.description})})),e.trigger({type:"loadeddata",target:e})}},{key:"createPointOfInterestIndicators",value:function(){var e,t=this,n=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar");this.pointsOfInterest.forEach((function(e){var r=new vd(t.player,{pointOfInterest:e});t.pointOfInterestIndicators.push(r),n.addChild(r)}))}},{key:"addMenuItem",value:function(){var e;(null===(e=this.player.getChild("collapserator"))||void 0===e?void 0:e.getChild("cogButton")).addItem({index:0,ctor:kd,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}},{key:"updateBuffered",value:function(){var e=this;this.pointOfInterestIndicators.forEach((function(t){return t.updateBuffered(Gc(e.player))}))}},{key:"updatePlaybackProgress",value:function(){var e=this;this.pointOfInterestIndicators.forEach((function(t){return t.updatePlaybackProgress(e.player.currentTime())}))}}])&&Pd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(xd);function Id(e){return Id="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Id(e)}function Md(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Bd(r.key),r)}}function Bd(e){var t=function(e){if("object"!=Id(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Id(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Id(t)?t:t+""}function Dd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dd=function(){return!!e})()}function Ad(e){return Ad=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ad(e)}function Fd(e,t){return Fd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fd(e,t)}i.Z.registerPlugin("pointsOfInterestPlugin",Rd),function(e){e.None="None",e.Complete="Complete",e.Incomplete="Incomplete"}(_d||(_d={}));var zd=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Ad(t),function(e,t){if(t&&("object"==Id(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Dd()?Reflect.construct(t,n||[],Ad(e).constructor):t.apply(e,n))}(this,t,[e,n])).update(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fd(e,t)}(t,e),n=t,r=[{key:"update",value:function(){this.options_.activityStatus===_d.Complete?this.addClass("cv-activity-completed"):this.removeClass("cv-activity-completed")}},{key:"handleClick",value:function(){if(this.options_.activityStatus=this.getToggledActivityStatus(),this.update(),this.options_.clickHandler){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.options_.clickHandler.call(this,t)}}},{key:"buildCSSClass",value:function(){return"cv-activity-status-button"}},{key:"getToggledActivityStatus",value:function(){return this.options_.activityStatus===_d.None||this.options_.activityStatus===_d.Incomplete?_d.Complete:this.options_.activityStatus===_d.Complete?_d.Incomplete:void 0}}],r&&Md(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Button"));function Zd(e){return Zd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zd(e)}function Vd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gd(r.key),r)}}function Gd(e){var t=function(e){if("object"!=Zd(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Zd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Zd(t)?t:t+""}function Ud(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ud=function(){return!!e})()}function Kd(e){return Kd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Kd(e)}function qd(e,t){return qd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qd(e,t)}zd.prototype.controlText_="Complete";var Hd=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Kd(t),function(e,t){if(t&&("object"==Zd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ud()?Reflect.construct(t,n||[],Kd(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qd(e,t)}(t,e),n=t,(r=[{key:"setActivityStatus",value:function(e,t){var n=this;e!==this.activityStatus&&(this.activityStatus=e,this.onToggleStatus=t,this.player.ready((function(){n.renderActivityStatusButton()})))}},{key:"renderActivityStatusButton",value:function(){this.button&&this.player.removeChild(this.button),this.button=new zd(this.player,{activityStatus:this.activityStatus,clickHandler:this.onToggleStatus}),this.player.addChild(this.button)}}])&&Vd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function Wd(e){return Wd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wd(e)}function Yd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Qd(r.key),r)}}function Qd(e){var t=function(e){if("object"!=Wd(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Wd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Wd(t)?t:t+""}function Jd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jd=function(){return!!e})()}function Xd(e,t,n,r){var i=$d(em(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function $d(){return $d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=em(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},$d.apply(null,arguments)}function em(e){return em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},em(e)}function tm(e,t){return tm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},tm(e,t)}i.Z.registerPlugin("activityStatusPlugin",Hd);var nm=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=em(t),function(e,t){if(t&&("object"==Wd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Jd()?Reflect.construct(t,n||[],em(e).constructor):t.apply(e,n))}(this,t,[e,n])).initialize(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tm(e,t)}(t,e),n=t,(r=[{key:"initialize",value:function(){this.setPosition()}},{key:"buildCSSClass",value:function(){return"cv-range-indicator ".concat(Xd(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,r){return Xd(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"setPosition",value:function(){var e=this.player().duration();this.el_.style.left=this.options_.time/e*100+"%"}}])&&Yd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function rm(e){return rm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rm(e)}function im(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,om(r.key),r)}}function om(e){var t=function(e){if("object"!=rm(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=rm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rm(t)?t:t+""}function am(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(am=function(){return!!e})()}function um(e,t,n,r){var i=cm(lm(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function cm(){return cm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=lm(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},cm.apply(null,arguments)}function lm(e){return lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lm(e)}function sm(e,t){return sm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sm(e,t)}var fm=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=lm(t),function(e,t){if(t&&("object"==rm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,am()?Reflect.construct(t,n||[],lm(e).constructor):t.apply(e,n))}(this,t,[e,n])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sm(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-replay-view-button ".concat(um(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,r){return um(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{innerHTML:'<span class="'.concat(this.options_.iconClassName,'"></span><span>').concat(this.options_.label,"</span>"),className:this.buildCSSClass()}),r])}},{key:"handleClick",value:function(){this.options_.onPress()}}])&&im(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("ClickableComponent"));function pm(e){return pm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pm(e)}function hm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ym(r.key),r)}}function ym(e){var t=function(e){if("object"!=pm(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=pm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pm(t)?t:t+""}function vm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vm=function(){return!!e})()}function dm(e,t,n,r){var i=mm(bm(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function mm(){return mm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=bm(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},mm.apply(null,arguments)}function bm(e){return bm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bm(e)}function gm(e,t){return gm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gm(e,t)}var wm=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=bm(t),function(e,t){if(t&&("object"==pm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,vm()?Reflect.construct(t,n||[],bm(e).constructor):t.apply(e,n))}(this,t,[e,n])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gm(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-replay-view ".concat(dm(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(e,n,r){var o=dm(t,"createEl",this,3)([e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r]),a=i.Z.dom.createEl("h5",{innerHTML:this.localize("This clip has finished"),className:"cv-replay-heading"}),u=i.Z.dom.createEl("div",{className:"cv-button-container"}),c=new fm(this.player_,{label:this.localize("Replay clip"),iconClassName:"cv-replay-icon",onPress:this.options_.onReplayPress}),l=new fm(this.player_,{label:this.localize("Continue watching"),iconClassName:"cv-continue-icon",onPress:this.options_.onContinuePress});return o.appendChild(a),o.appendChild(u),u.appendChild(c.el()),u.appendChild(l.el()),o}}])&&hm(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function Om(e){return Om="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Om(e)}function Sm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,km(r.key),r)}}function km(e){var t=function(e){if("object"!=Om(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Om(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Om(t)?t:t+""}function Nm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nm=function(){return!!e})()}function Pm(){return Pm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=jm(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Pm.apply(null,arguments)}function jm(e){return jm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jm(e)}function Em(e,t){return Em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Em(e,t)}var Cm=function(e){function t(e,n){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=jm(t),function(e,t){if(t&&("object"==Om(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Nm()?Reflect.construct(t,n||[],jm(e).constructor):t.apply(e,n))}(this,t,[e,n])).startTime=parseFloat(n.startTime.toPrecision(4)),r.endTime=parseFloat(n.endTime.toPrecision(4)),r.dismissed=!1,r.startTime>r.endTime)throw Error("Range start cannot be greater than range end");return r.bindFunctions(),r.initialize(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Em(e,t)}(t,e),n=t,r=[{key:"bindFunctions",value:function(){this.onReady=this.onReady.bind(this),this.onTimeUpdateOrSeeked=this.onTimeUpdateOrSeeked.bind(this),this.onReplayPress=this.onReplayPress.bind(this),this.onContinuePress=this.onContinuePress.bind(this)}},{key:"initialize",value:function(){var e=this;this.player.one("loadedmetadata",(function(){return e.player.ready(e.onReady)})),this.player.on("timeupdate",this.onTimeUpdateOrSeeked),this.player.on("seeked",this.onTimeUpdateOrSeeked)}},{key:"onReady",value:function(){this.addCssClasses(),this.showRangeIndicators(),this.addMaskToProgressBar()}},{key:"onTimeUpdateOrSeeked",value:function(){if(!this.dismissed){var e=this.player.currentTime();if(!(e<this.startTime))return e>this.endTime?(this.showReplayView(),this.disablePlayToggle(),this.player.pause(),void this.player.currentTime(this.endTime)):void 0;this.player.currentTime(this.startTime)}}},{key:"onReplayPress",value:function(){this.player.currentTime(this.startTime),this.player.play(),this.hideReplayView(),this.enablePlayToggle()}},{key:"onContinuePress",value:function(){this.dismissed=!0,this.player.play(),this.hideRangeIndicators(),this.removeMaskFromProgressBar(),this.hideReplayView(),this.enablePlayToggle(),this.removeCssClasses()}},{key:"showRangeIndicators",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar");this.startTimeIndicator||(this.startTimeIndicator=new nm(this.player,{time:this.startTime}),null==t||t.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new nm(this.player,{time:this.endTime}),null==t||t.addChild(this.endTimeIndicator))}},{key:"hideRangeIndicators",value:function(){var e,t;null===(e=this.startTimeIndicator)||void 0===e||e.hide(),null===(t=this.endTimeIndicator)||void 0===t||t.hide()}},{key:"addMaskToProgressBar",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar"),n=null==t?void 0:t.el().getElementsByClassName("cv-chapter-bar-items");if(n&&n.length){var r=n[0],i=this.player.duration(),o=this.startTime/i*100,a=100-this.endTime/i*100;r.style.clipPath="inset(".concat(-5,"em ").concat(a,"% ").concat(-5,"em ").concat(o,"%)")}}},{key:"removeMaskFromProgressBar",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar"),n=null==t?void 0:t.el().getElementsByClassName("cv-chapter-bar-items");n&&n.length&&(n[0].style.clipPath="")}},{key:"showReplayView",value:function(){this.replayView||(this.replayView=new wm(this.player,{onContinuePress:this.onContinuePress,onReplayPress:this.onReplayPress}),this.player.addChild(this.replayView)),this.replayView.show()}},{key:"hideReplayView",value:function(){var e;null===(e=this.replayView)||void 0===e||e.hide()}},{key:"getPlayToggle",value:function(){var e=this.player.getChild("collapserator");return null==e?void 0:e.getChild("PlayToggle")}},{key:"enablePlayToggle",value:function(){var e=this.getPlayToggle();e&&e.enable()}},{key:"disablePlayToggle",value:function(){var e=this.getPlayToggle();e&&e.disable()}},{key:"addCssClasses",value:function(){this.player.addClass("cv-range-indicator-plugin")}},{key:"removeCssClasses",value:function(){this.player.removeClass("cv-range-indicator-plugin")}},{key:"dispose",value:function(){var e,n,r,i,o,a;this.removeCssClasses(),this.player.off("timeupdate",this.onTimeUpdateOrSeeked),this.player.off("seeked",this.onTimeUpdateOrSeeked),null===(e=this.startTimeIndicator)||void 0===e||e.dispose(),null===(n=this.endTimeIndicator)||void 0===n||n.dispose(),null===(r=this.replayView)||void 0===r||r.dispose(),(i=t,o=this,"function"==typeof(a=Pm(jm(1&3?i.prototype:i),"dispose",o))?function(e){return a.apply(o,e)}:a)([])}}],r&&Sm(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));i.Z.registerPlugin("rangeIndicatorPlugin",Cm);var Tm=function(){var e,t,n;return null!==(n=null===(t=null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)||void 0===t?void 0:t.call(e))&&void 0!==n?n:Math.random().toString()};function _m(e){return _m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_m(e)}function xm(){xm=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==_m(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(_m(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function Lm(e){return function(e){if(Array.isArray(e))return Rm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Rm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rm(e,t):void 0}}(e)||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 Rm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Im(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mm(r.key),r)}}function Mm(e){var t=function(e){if("object"!=_m(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_m(t)?t:t+""}function Bm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bm=function(){return!!e})()}function Dm(e,t,n,r){var i=Am(Fm(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Am(){return Am="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Fm(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Am.apply(null,arguments)}function Fm(e){return Fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fm(e)}function zm(e,t){return zm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zm(e,t)}var Zm,Vm,Gm=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Fm(t),function(e,t){if(t&&("object"==_m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Bm()?Reflect.construct(t,n||[],Fm(e).constructor):t.apply(e,n))}(this,t,[e,n])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zm(e,t)}(t,e),n=t,(r=[{key:"getPlayerOptions",value:function(){var e,n=Dm(t,"getPlayerOptions",this,3)([]);return(null===(e=n.devicesConfig)||void 0===e?void 0:e.canUserCastToDevices)?Object.assign(Object.assign({},n),{techOrder:["devices"].concat(Lm(n.techOrder)),devices:{instanceId:Tm()}}):n}},{key:"configurePlugins",value:function(){var e;try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),(null===(e=this.options.pointsOfInterest)||void 0===e?void 0:e.length)&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest})}catch(e){console.log("failed to register plugins",e)}}},{key:"setNextVideo",value:function(e,t,n){this.player.nextVideoPlugin&&this.player.nextVideoPlugin().setNextVideo(e,t,n)}},{key:"togglePictureInPicture",value:function(e){var t=this.player.pictureInPicture();t&&t.togglePictureInPicture(e)}},{key:"toggleTheatreMode",value:function(e){var t=this.player.theatreModePlugin();t&&t.toggleTheatreMode(e,{shouldLog:!0})}},{key:"toggleTranscript",value:function(e){if(this.player.viewTranscriptPlugin){var t=this.player.viewTranscriptPlugin();t&&t.toggleTranscript(e)}}},{key:"hasStarted",value:function(){return this.player.hasStarted()}},{key:"additionalSetup",value:function(e){var n,r,i,o,a=this,u=Object.create(null,{additionalSetup:{get:function(){return Dm(t,"additionalSetup",a,1)}}});return n=this,r=void 0,i=void 0,o=xm().mark((function t(){var n;return xm().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin({onRequestTheatreMode:this.options.onRequestTheatreMode,theatreMode:this.options.theatreMode,playbackObject:e}),u.additionalSetup.call(this,e),this.options.showResources&&e.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:e.resources.list,imageCdnUrl:this.options.imageCdnUrl}),"MasterClip"!==e.mediaType){t.next=8;break}if(null!==(n=e.additionalData)){t.next=7;break}throw Error("Invalid clip data");case 7:this.player.clipPlugin({startTime:n.startTime,endTime:n.endTime});case 8:"MasterVideo"===e.mediaType&&this.options.startTime&&this.options.endTime&&this.player.rangeIndicatorPlugin({startTime:this.options.startTime,endTime:this.options.endTime});case 9:case"end":return t.stop()}}),t,this)})),new(i||(i=Promise))((function(e,t){function a(e){try{c(o.next(e))}catch(e){t(e)}}function u(e){try{c(o.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(a,u)}c((o=o.apply(n,r||[])).next())}))}},{key:"setupAnalyticsDependentPlugins",value:function(e){var n;Dm(t,"setupAnalyticsDependentPlugins",this,3)([e]),this.options.allowTheatreMode&&this.player.viewTranscriptPlugin().registerAnalytics(this.analyticsService,e),this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin().registerAnalytics(this.analyticsService),(null===(n=this.options.devicesConfig)||void 0===n?void 0:n.canUserCastToDevices)&&this.player.devicesPlugin&&this.player.devicesPlugin(Object.assign(Object.assign({},this.options.devicesConfig),{userId:parseInt(e.viewerId),title:e.title,analyticsService:this.analyticsService}))}},{key:"setActivityStatus",value:function(e,t){this.player.activityStatusPlugin().setActivityStatus(e,t)}},{key:"addTranscript",value:function(e){return Y.getTrack(this.player,"metadata","transcript",e)?null:this.player.addTextTrack("metadata","transcript",e)}},{key:"useCurrentTranscript",value:function(e,t){return Y.useMetadataTracks(this.player,"transcript",e,t)}}])&&Im(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(dv),Um=n(33937);function Km(e){return Km="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Km(e)}function qm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Hm(r.key),r)}}function Hm(e){var t=function(e){if("object"!=Km(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Km(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Km(t)?t:t+""}!function(e){e.AppleTv="apple-tv",e.Vivi="vivi"}(Zm||(Zm={})),function(e){e.Available="available",e.Offline="offline",e.Busy="busy"}(Vm||(Vm={}));var Wm=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this[Symbol.toStringTag]=t[Symbol.toStringTag],this.innerPromise=t,this.onTimeout=n,this.bindFunctions()}return t=e,r=[{key:"reject",value:function(t){return new e(Promise.reject(t))}},{key:"fromPromise",value:function(t){return new e(t)}}],(n=[{key:"bindFunctions",value:function(){this.timeout=this.timeout.bind(this),this.then=this.then.bind(this),this.catch=this.catch.bind(this),this.finally=this.finally.bind(this)}},{key:"timeout",value:function(e){var t=this;return new Promise((function(n,r){t.then(n).catch(r).finally((function(){return clearTimeout(i)}));var i=setTimeout((function(){var e;null===(e=t.onTimeout)||void 0===e||e.call(t),r(new Error("Promise timed out"))}),e)}))}},{key:"then",value:function(e,t){return this.innerPromise.then(e,t)}},{key:"catch",value:function(e){return this.innerPromise.catch(e)}},{key:"finally",value:function(e){return this.innerPromise.finally(e)}}])&&qm(t.prototype,n),r&&qm(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,r}();function Ym(e){return Ym="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ym(e)}function Qm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,$m(r.key),r)}}function Xm(e,t,n){return t&&Jm(e.prototype,t),n&&Jm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $m(e){var t=function(e){if("object"!=Ym(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ym(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ym(t)?t:t+""}Symbol.toStringTag;var eb=function(){return Xm((function e(){Qm(this,e),this.callbacks=[],this.predicates=[],this.controller=new AbortController,this.signal=this.controller.signal,this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.isDisposed=this.isDisposed.bind(this)}),[{key:"trigger",value:function(e){var t=this;this.callbacks.forEach((function(n,r){var i=t.predicates[r];i&&!i(e)||n(e)}))}},{key:"on",value:function(e){var t=this;this.isDisposed()&&console.warn("This EventChannel instance been disposed - this is a no-op");var n=this.callbacks.length;this.callbacks[n]=e,this.predicates[n]=function(){return!0};var r=function(){t.off(e)};return{off:r,filter:function(e){return t.predicates[n]=e,r}}}},{key:"one",value:function(){var e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return this.isDisposed()?Wm.reject(new Error("This EventChannel instance has been disposed")):new Wm(new Promise((function(r,i){e=t.on((function(n){t.signal.removeEventListener("abort",o),e(),r(n)})).filter(n);var o=function(){e(),i(new Error("Aborted while waiting for message"))};t.signal.addEventListener("abort",o,{once:!0})})),(function(){e()}))}},{key:"off",value:function(e){var t=this.callbacks.indexOf(e);-1!==t&&(this.callbacks.splice(t,1),this.predicates.splice(t,1))}},{key:"dispose",value:function(){this.callbacks.length=0,this.predicates.length=0,this.controller.abort()}},{key:"isDisposed",value:function(){return this.signal.aborted}}])}(),tb=function(){return Xm((function e(){Qm(this,e),this.channels={},this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.getChannel=this.getChannel.bind(this)}),[{key:"trigger",value:function(e,t){this.getChannel(e).trigger(t)}},{key:"on",value:function(e,t){return this.getChannel(e).on(t)}},{key:"one",value:function(e,t){return this.getChannel(e).one(t)}},{key:"off",value:function(e,t){this.getChannel(e).off(t)}},{key:"dispose",value:function(){this.trigger("dispose",nb.void),Object.values(this.channels).forEach((function(e){return e.dispose()})),this.channels={}}},{key:"getChannel",value:function(e){return this.channels[e]||(this.channels[e]=new eb),this.channels[e]}}])}(),nb={void:void 0};function rb(e){return rb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rb(e)}function ib(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ob(r.key),r)}}function ob(e){var t=function(e){if("object"!=rb(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=rb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rb(t)?t:t+""}var ab,ub,cb,lb=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bindFunctions()},(t=[{key:"bindFunctions",value:function(){this.schedule=this.schedule.bind(this),this.every=this.every.bind(this),this.trigger=this.trigger.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this)}},{key:"schedule",value:function(e){return this.task=e,this}},{key:"every",value:function(e){return this.intervalInMilliseconds=e,this}},{key:"trigger",value:function(){var e;return null===(e=this.task)||void 0===e||e.call(this,this),this}},{key:"start",value:function(){var e=this;return this.intervalId||(this.intervalId=setInterval((function(){return e.trigger()}),this.intervalInMilliseconds)),this}},{key:"stop",value:function(){return this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this}}])&&ib(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),sb=function(e,t){return e._lastModified||(e._lastModified={}),new Proxy(e,{set:function(n,r,i,o){var a=e._lastModified[r.toString()];return!!(a&&Date.now()<a+t)||Reflect.set(n,r,i,o)}})},fb=function(e){return e._lastModified||(e._lastModified={}),new Proxy(e,{set:function(t,n,r,i){return e._lastModified[n.toString()]=Date.now(),Reflect.set(t,n,r,i)}})};function pb(e){return pb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pb(e)}function hb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vb(r.key),r)}}function yb(e,t,n){return t&&hb(e.prototype,t),n&&hb(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vb(e){var t=function(e){if("object"!=pb(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=pb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pb(t)?t:t+""}!function(e){e[e.Offline=0]="Offline",e[e.Online=1]="Online",e[e.Locked=2]="Locked",e[e.Suspended=3]="Suspended"}(ab||(ab={})),function(e){e[e.PlaybackStatusChange=0]="PlaybackStatusChange",e[e.PositionChange=1]="PositionChange"}(ub||(ub={})),function(e){e.Begin="BEGIN",e.Play="PLAY",e.Pause="PAUSE",e.Load="LOAD",e.Scan="SCAN",e.Stop="STOP"}(cb||(cb={}));var db=yb((function e(t,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.title=t,this.device=n,this.locked=!1,this.position=0,this.playbackStatus=cb.Load,this.debounced=sb(this,2e3),fb(this)}));function mb(e){return mb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mb(e)}function bb(){bb=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==mb(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(mb(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function gb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wb(r.key),r)}}function wb(e){var t=function(e){if("object"!=mb(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mb(t)?t:t+""}function Ob(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ob=function(){return!!e})()}function Sb(){return Sb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=kb(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Sb.apply(null,arguments)}function kb(e){return kb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kb(e)}function Nb(e,t){return Nb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nb(e,t)}var Pb=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=kb(t),function(e,t){if(t&&("object"==mb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ob()?Reflect.construct(t,n||[],kb(e).constructor):t.apply(e,n))}(this,t)).client=e,r.localState=new db(n.title,n.device),r.bindFunctions(),r.initialize(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nb(e,t)}(t,e),n=t,r=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleDisconnected=this.handleDisconnected.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handlePlaybackChange=this.handlePlaybackChange.bind(this),this.handlePositionChange=this.handlePositionChange.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}},{key:"initialize",value:function(){this.client.on("dispose",this.dispose),this.client.on("disconnected",this.handleDisconnected),this.client.on("message",this.handleAllVideoMessages)}},{key:"dispose",value:function(){var e,n,r;this.client.off("dispose",this.dispose),this.client.off("disconnected",this.handleDisconnected),this.client.off("message",this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch((function(e){return console.error(e)})),(e=t,n=this,"function"==typeof(r=Sb(kb(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}},{key:"handleDisconnected",value:function(){this.trigger("error",new Error("The connection to the Apple TV has been lost and cannot be recovered"))}},{key:"handleAllVideoMessages",value:function(e){if(e.deviceId===this.getDevice().id){var t=this.localState.debounced;switch(e.event){case ub.PlaybackStatusChange:this.handlePlaybackChange(t,e);break;case ub.PositionChange:this.handlePositionChange(t,e)}}}},{key:"handlePlaybackChange",value:function(e,t){e.playbackStatus!==t.params.playbackStatus&&(e.playbackStatus=t.params.playbackStatus,this.trigger("playingchange",nb.void),e.playbackStatus===cb.Stop&&this.dispose())}},{key:"handlePositionChange",value:function(e,t){e.position!==t.params.position&&(e.position=t.params.position,this.trigger("positionchange",nb.void))}},{key:"loadSource",value:function(){return e=this,t=void 0,n=void 0,r=bb().mark((function e(){return bb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.localState.locked){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.client.lock(this.getDevice().id);case 5:return this.localState.locked=!0,e.next=8,this.client.loadVideo(this.getDevice().id);case 8:this.trigger("sourceloaded",nb.void),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),console.error(e.t0),this.trigger("error",new Error("Could not load video on Apple TV device"));case 15:case"end":return e.stop()}}),e,this,[[0,11]])})),new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}));var e,t,n,r}},{key:"play",value:function(){this.localState.locked&&this.localState.playbackStatus!==cb.Play&&(this.localState.playbackStatus=cb.Play,this.client.play(this.getDevice().id),this.trigger("playingchange",nb.void))}},{key:"pause",value:function(){this.localState.locked&&this.localState.playbackStatus!==cb.Pause&&(this.localState.playbackStatus=cb.Pause,this.client.pause(this.getDevice().id),this.trigger("playingchange",nb.void))}},{key:"seek",value:function(e){this.localState.locked&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger("positionchange",nb.void))}},{key:"setVolume",value:function(){console.info("Setting the volume is not supported on Apple TV")}},{key:"setMuted",value:function(){console.info("Muting is not supported on Apple TV")}},{key:"setSubtitles",value:function(){console.info("Subtitles are not supported on Apple TV")}},{key:"isPlaying",value:function(){return this.localState.playbackStatus===cb.Play||this.localState.playbackStatus===cb.Begin||this.localState.playbackStatus===cb.Load}},{key:"isPlaybackFinished",value:function(){return this.localState.playbackStatus===cb.Stop}},{key:"getPosition",value:function(){return this.localState.position}},{key:"getDuration",value:function(){}},{key:"getVolume",value:function(){return 1}},{key:"getMuted",value:function(){return!1}},{key:"getSubtitles",value:function(){}},{key:"getDevice",value:function(){return this.localState.device}},{key:"getTitle",value:function(){return this.localState.title}}],r&&gb(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(tb);function jb(e){return jb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jb(e)}function Eb(){Eb=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==jb(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(jb(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function Cb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Tb(r.key),r)}}function Tb(e){var t=function(e){if("object"!=jb(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=jb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jb(t)?t:t+""}function _b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_b=function(){return!!e})()}function xb(){return xb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Lb(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},xb.apply(null,arguments)}function Lb(e){return Lb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Lb(e)}function Rb(e,t){return Rb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Rb(e,t)}var Ib,Mb,Bb,Db=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))};!function(e){e.DeviceList="DeviceList",e.DeviceStateChange="DeviceStateChange",e.Paired="Paired",e.Unpaired="Unpaired",e.PlayStatusChange="PlayStatusChange",e.TimeSync="TimeSync"}(Ib||(Ib={})),function(e){e.Command="Command",e.Pair="Pair",e.Unpair="Unpair",e.RenameDevice="Renamedevice",e.Subscribe="Subscribe",e.Lock="Lock"}(Mb||(Mb={})),function(e){e[e.Connecting=0]="Connecting",e[e.Connected=1]="Connected",e[e.Reconnecting=2]="Reconnecting",e[e.Disconnected=4]="Disconnected"}(Bb||(Bb={}));var Ab=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=Lb(t),function(e,t){if(t&&("object"==jb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,_b()?Reflect.construct(t,n||[],Lb(e).constructor):t.apply(e,n))}(this,t)).options=e,n.accessToken=void 0,n.devices=[],n.heartbeat=new lb,n.bindFunctions(),n.initialize(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rb(e,t)}(t,e),n=t,r=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.connect=this.connect.bind(this),this.subscribe=this.subscribe.bind(this),this.tryFixConnection=this.tryFixConnection.bind(this),this.invoke=this.invoke.bind(this),this.invokeDebounced=Q(this.invoke,500,!0),this.handleDeviceList=this.handleDeviceList.bind(this),this.handleDeviceStateChange=this.handleDeviceStateChange.bind(this),this.handleDevicePaired=this.handleDevicePaired.bind(this),this.handleDeviceUnpaired=this.handleDeviceUnpaired.bind(this),this.handlePlayStatusChange=this.handlePlayStatusChange.bind(this),this.handleTimeSync=this.handleTimeSync.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.lock=this.lock.bind(this),this.loadVideo=this.loadVideo.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.stop=this.stop.bind(this),this.pair=this.pair.bind(this),this.unpair=this.unpair.bind(this),this.renameDevice=this.renameDevice.bind(this)}},{key:"initialize",value:function(){return Db(this,void 0,void 0,Eb().mark((function e(){return Eb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.options.fetchAccessToken();case 3:return this.accessToken=e.sent,this.connection=(0,Um.OB)(this.accessToken.host,{logging:!1}),this.hubProxy=this.connection.createHubProxy("DeviceUserHub"),this.hubProxy.on(Ib.DeviceList,this.handleDeviceList),this.hubProxy.on(Ib.DeviceStateChange,this.handleDeviceStateChange),this.hubProxy.on(Ib.Paired,this.handleDevicePaired),this.hubProxy.on(Ib.Unpaired,this.handleDeviceUnpaired),this.hubProxy.on(Ib.PlayStatusChange,this.handlePlayStatusChange),this.hubProxy.on(Ib.TimeSync,this.handleTimeSync),e.next=14,this.connect();case 14:return e.next=16,this.subscribe(this.accessToken.token);case 16:this.heartbeat.schedule(this.tryFixConnection).every(5e3).start(),e.next=23;break;case 19:e.prev=19,e.t0=e.catch(0),console.error(e.t0),this.trigger("error",new Error("Could not connect to Online API"));case 23:case"end":return e.stop()}}),e,this,[[0,19]])})))}},{key:"connect",value:function(){return Db(this,void 0,void 0,Eb().mark((function e(){var t=this;return Eb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.connection.start({jsonp:!1,withCredentials:!1}).done((function(){return e()})).fail((function(){return n(new Error("Could not connect to SignalR hub"))}))})));case 1:case"end":return e.stop()}}),e)})))}},{key:"subscribe",value:function(e){return Db(this,void 0,void 0,Eb().mark((function t(){return Eb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.invoke(Mb.Subscribe,e);case 2:if(t.sent){t.next=5;break}throw new Error("The subscription request was rejected by Online API");case 5:case"end":return t.stop()}}),t,this)})))}},{key:"tryFixConnection",value:function(){return Db(this,void 0,void 0,Eb().mark((function e(){return Eb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connection.state===Bb.Disconnected){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,this.heartbeat.stop(),e.next=6,this.options.fetchAccessToken();case 6:return this.accessToken=e.sent,e.next=9,this.connect();case 9:return e.next=11,this.subscribe(this.accessToken.token);case 11:e.next=17;break;case 13:e.prev=13,e.t0=e.catch(2),console.warn(e.t0),console.warn("Could not reconnect to Online API");case 17:return e.prev=17,this.heartbeat.start(),e.finish(17);case 20:case"end":return e.stop()}}),e,this,[[2,13,17,20]])})))}},{key:"invoke",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Db(this,void 0,void 0,Eb().mark((function t(){var r,i=this;return Eb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Promise((function(t,r){var o,a;(null===(a=i.hubProxy)||void 0===a?void 0:(o=a).invoke.apply(o,[e].concat(n))).done(t).fail(r)})),t.abrupt("return",Wm.fromPromise(r).timeout(2e4));case 2:case"end":return t.stop()}}),t)})))}},{key:"handleDeviceList",value:function(e){this.devices=e.filter((function(e){return"vivi"!==e.type})).map(t.convertToGenericDevice),this.trigger("deviceschange",nb.void)}},{key:"handleDeviceStateChange",value:function(e){var n=this.devices.findIndex((function(t){return t.id===e.deviceId}));n>=0&&(this.devices[n]=t.convertToGenericDevice(e),this.trigger("deviceschange",nb.void))}},{key:"handleDevicePaired",value:function(e){"vivi"!==e.type&&(this.devices.push(t.convertToGenericDevice(e)),this.trigger("deviceschange",nb.void))}},{key:"handleDeviceUnpaired",value:function(e){this.devices=this.devices.filter((function(t){return t.id!==e})),this.trigger("deviceschange",nb.void)}},{key:"handlePlayStatusChange",value:function(e,t){this.trigger("message",{event:ub.PlaybackStatusChange,deviceId:e,params:{playbackStatus:t.commandType}})}},{key:"handleTimeSync",value:function(e,t){this.trigger("message",{event:ub.PositionChange,deviceId:e,params:{position:t}})}},{key:"dispose",value:function(){var e,n,r;this.hubProxy.off(Ib.DeviceList,this.handleDeviceList),this.hubProxy.off(Ib.DeviceStateChange,this.handleDeviceStateChange),this.hubProxy.off(Ib.Paired,this.handleDevicePaired),this.hubProxy.off(Ib.Unpaired,this.handleDeviceUnpaired),this.hubProxy.off(Ib.PlayStatusChange,this.handlePlayStatusChange),this.hubProxy.off(Ib.TimeSync,this.handleTimeSync),this.hubProxy.connection.stop(!1,!0),this.heartbeat.stop(),(e=t,n=this,"function"==typeof(r=xb(Lb(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}},{key:"canCastToDevice",value:function(e){return e===Zm.AppleTv}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(e){return new Pb(this,e)}},{key:"lock",value:function(e){var t;return Db(this,void 0,void 0,Eb().mark((function n(){return Eb().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.invoke(Mb.Lock,e,this.options.userId,null!==(t=this.options.username)&&void 0!==t?t:"");case 2:if(n.sent){n.next=5;break}throw new Error("Could not lock device");case 5:case"end":return n.stop()}}),n,this)})))}},{key:"loadVideo",value:function(e){return Db(this,void 0,void 0,Eb().mark((function t(){return Eb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.options.trackingCode){t.next=2;break}throw new Error("Tracking code must be provided to cast videos");case 2:return t.next=4,this.invoke(Mb.Command,{DeviceId:e,CommandType:cb.Play,Data:this.options.trackingCode});case 4:case"end":return t.stop()}}),t,this)})))}},{key:"play",value:function(e){return Db(this,void 0,void 0,Eb().mark((function t(){return Eb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.invoke(Mb.Command,{DeviceId:e,CommandType:cb.Play});case 2:case"end":return t.stop()}}),t,this)})))}},{key:"pause",value:function(e){return Db(this,void 0,void 0,Eb().mark((function t(){return Eb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.invoke(Mb.Command,{DeviceId:e,CommandType:cb.Pause});case 2:case"end":return t.stop()}}),t,this)})))}},{key:"seek",value:function(e,t){this.invokeDebounced(Mb.Command,{DeviceId:e,CommandType:cb.Play,Params:"1,".concat(Math.trunc(t))})}},{key:"stop",value:function(e){return Db(this,void 0,void 0,Eb().mark((function t(){return Eb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.invoke(Mb.Command,{DeviceId:e,CommandType:cb.Stop});case 2:case"end":return t.stop()}}),t,this)})))}},{key:"pair",value:function(e){return Db(this,void 0,void 0,Eb().mark((function t(){var n;return Eb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.invoke(Mb.Pair,e);case 2:if(n=t.sent){t.next=5;break}throw new Error("Could not pair device");case 5:return t.abrupt("return",n);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"unpair",value:function(e){return Db(this,void 0,void 0,Eb().mark((function t(){return Eb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.invoke(Mb.Unpair,e);case 2:case"end":return t.stop()}}),t,this)})))}},{key:"renameDevice",value:function(e){var t=e.deviceId,n=e.deviceName;return Db(this,void 0,void 0,Eb().mark((function e(){return Eb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(Mb.RenameDevice,t,n);case 2:if(e.sent){e.next=5;break}throw new Error("Could not rename device");case 5:case"end":return e.stop()}}),e,this)})))}}],i=[{key:"convertToGenericDeviceStatus",value:function(e){switch(e){case ab.Online:return Vm.Available;case ab.Locked:return Vm.Busy;case ab.Suspended:case ab.Offline:return Vm.Offline}}},{key:"convertToGenericDevice",value:function(e){return{id:e.deviceId,name:e.name,type:Zm.AppleTv,status:t.convertToGenericDeviceStatus(e.status)}}}],r&&Cb(n.prototype,r),i&&Cb(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(tb);function Fb(e){return Fb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fb(e)}function zb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Zb(r.key),r)}}function Zb(e){var t=function(e){if("object"!=Fb(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Fb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fb(t)?t:t+""}var Vb={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""},Gb=function(){return e=function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vb;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bindFunctions(),this.url=t,this.options=Object.assign(Object.assign({},Vb),r),this.webSocket=this.connect(),this.heartbeat=(new lb).schedule((function(){return n.send(n.options.heartbeatMessage)})).every(this.options.heartbeatIntervalInMillseconds)},(t=[{key:"bindFunctions",value:function(){this.cleanup=this.cleanup.bind(this),this.handleOpen=this.handleOpen.bind(this),this.handleMessage=this.handleMessage.bind(this),this.handleClose=this.handleClose.bind(this),this.handleError=this.handleError.bind(this),this.connect=this.connect.bind(this),this.send=this.send.bind(this),this.dipose=this.dipose.bind(this)}},{key:"cleanup",value:function(){this.heartbeat.stop(),this.webSocket.removeEventListener("error",this.handleError),this.webSocket.removeEventListener("message",this.handleMessage),this.webSocket.removeEventListener("open",this.handleOpen),this.webSocket.removeEventListener("close",this.handleClose)}},{key:"handleOpen",value:function(e){var t;null===(t=this.onOpen)||void 0===t||t.call(this,e),this.options.heartbeatEnabled&&this.heartbeat.start()}},{key:"handleMessage",value:function(e){var t;null===(t=this.onMessage)||void 0===t||t.call(this,e)}},{key:"handleClose",value:function(e){var t,n=this;null===(t=this.onClose)||void 0===t||t.call(this,e),this.cleanup(),setTimeout((function(){n.webSocket=n.connect()}),this.options.reconnectIntervalInMilliseconds)}},{key:"handleError",value:function(e){var t;null===(t=this.onError)||void 0===t||t.call(this,e),this.handleClose()}},{key:"connect",value:function(){var e=new WebSocket(this.url);return e.addEventListener("open",this.handleOpen),e.addEventListener("message",this.handleMessage),e.addEventListener("close",this.handleClose),e.addEventListener("error",this.handleError),e}},{key:"send",value:function(e){this.webSocket.send(e)}},{key:"dipose",value:function(){this.cleanup(),this.webSocket.close()}}])&&zb(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Ub(e){return Ub="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ub(e)}function Kb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qb(r.key),r)}}function qb(e){var t=function(e){if("object"!=Ub(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ub(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ub(t)?t:t+""}var Hb,Wb=function(){return e=function e(t,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._timerStartedAt=0,this.position=0,this.duration=void 0,this.playing=!1,this.mute=!1,this.videoSource="",this.subtitleSource="",this.subtitles=!1,this.volume=0,this.title=t,this.device=n,this.ready=!1,this.playbackFinished=!1,this.debounced=sb(this,2e3),fb(this)},(t=[{key:"position",get:function(){return this._position+this.getTimerDurationInSeconds()},set:function(e){this._position=e,this.restartTimer()}},{key:"playing",get:function(){return this._playing},set:function(e){this._playing=e,e?this.restartTimer():(this._position+=this.getTimerDurationInSeconds(),this.stopTimer())}},{key:"restartTimer",value:function(){this._timerStartedAt=Date.now()}},{key:"stopTimer",value:function(){this._timerStartedAt=0}},{key:"getTimerDurationInSeconds",value:function(){return this._timerStartedAt?(Date.now()-this._timerStartedAt)/1e3:0}}])&&Kb(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Yb(e){return Yb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yb(e)}function Qb(){Qb=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Yb(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(Yb(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function Jb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Xb(r.key),r)}}function Xb(e){var t=function(e){if("object"!=Yb(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Yb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Yb(t)?t:t+""}function $b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($b=function(){return!!e})()}function eg(){return eg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=tg(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},eg.apply(null,arguments)}function tg(e){return tg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tg(e)}function ng(e,t){return ng=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ng(e,t)}!function(e){e.Update="update",e.Volume="volume",e.Playing="playing",e.Paused="paused",e.NewChapter="new_chapter",e.Stopped="stopped",e.Ready="ready",e.Mute="mute",e.Finished="finished",e.Subtitles="subtitles"}(Hb||(Hb={}));var rg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))},ig=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=tg(t),function(e,t){if(t&&("object"==Yb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$b()?Reflect.construct(t,n||[],tg(e).constructor):t.apply(e,n))}(this,t)).client=e,r.localState=new Wb(n.title,n.device),r.bindFunctions(),r.initialize(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ng(e,t)}(t,e),n=t,r=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleClientConnected=this.handleClientConnected.bind(this),this.handleDisconnectMessage=this.handleDisconnectMessage.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handleUpdateMessage=this.handleUpdateMessage.bind(this),this.handleVolumeMessage=this.handleVolumeMessage.bind(this),this.handlePlayingMessage=this.handlePlayingMessage.bind(this),this.handlePausedMessage=this.handlePausedMessage.bind(this),this.handleFinishedMessage=this.handleFinishedMessage.bind(this),this.handleNewChapterMessage=this.handleNewChapterMessage.bind(this),this.handleStoppedMessage=this.handleStoppedMessage.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}},{key:"initialize",value:function(){var e=this;this.client.on("dispose",this.dispose),this.client.on("connected",this.handleClientConnected),this.client.on("message",this.handleDisconnectMessage).filter((function(t){return t.source===e.getDevice().id&&"disconnect"===t.message.type})),this.client.on("message",this.handleAllVideoMessages).filter((function(t){return t.source===e.getDevice().id&&"video_event"===t.message.type}))}},{key:"dispose",value:function(){var e,n,r;this.client.off("dispose",this.dispose),this.client.off("connected",this.handleClientConnected),this.client.off("message",this.handleDisconnectMessage),this.client.off("message",this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch((function(e){return console.error(e)})),(e=t,n=this,"function"==typeof(r=eg(tg(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}},{key:"handleClientConnected",value:function(){return rg(this,void 0,void 0,Qb().mark((function e(){return Qb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.client.joinRoom(this.getDevice().id);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),this.trigger("error",e.t0);case 8:case"end":return e.stop()}}),e,this,[[0,5]])})))}},{key:"handleDisconnectMessage",value:function(){this.dispose()}},{key:"handleAllVideoMessages",value:function(e){var t=this.localState.debounced,n=e.message.payload.params||{};switch(e.message.payload.event){case Hb.Update:this.handleUpdateMessage(t,n);break;case Hb.NewChapter:this.handleNewChapterMessage(t,n);break;case Hb.Volume:this.handleVolumeMessage(t,n);break;case Hb.Playing:this.handlePlayingMessage(t);break;case Hb.Paused:this.handlePausedMessage(t);break;case Hb.Finished:this.handleFinishedMessage(t);break;case Hb.Stopped:this.handleStoppedMessage()}}},{key:"handleUpdateMessage",value:function(e,t){e.duration!==t.duration&&(e.duration=t.duration,this.trigger("durationchange",nb.void)),e.position!==t.position&&(e.position=t.position,this.trigger("positionchange",nb.void)),e.subtitles!==t.subtitles&&(e.subtitles=t.subtitles,this.trigger("subtitleschange",nb.void))}},{key:"handleVolumeMessage",value:function(e,t){e.volume!==t.level&&(e.volume=t.level,e.mute=0===t.level,this.trigger("volumechange",nb.void))}},{key:"handlePlayingMessage",value:function(e){!0!==e.playing&&(e.playing=!0,e.playbackFinished=!1,this.trigger("playingchange",nb.void))}},{key:"handlePausedMessage",value:function(e){!1!==e.playing&&(e.playing=!1,this.trigger("playingchange",nb.void))}},{key:"handleFinishedMessage",value:function(e){!0!==e.playbackFinished&&(e.playing=!1,e.playbackFinished=!0,this.trigger("playingchange",nb.void))}},{key:"handleNewChapterMessage",value:function(e,t){var n,r=(null!==(n=t.queue)&&void 0!==n?n:[]).find((function(t){return t.url===e.videoSource}));if(!r)return console.info("The device is no longer playing the source we loaded - disposing the session"),void this.dispose();e.subtitleSource!==r.suburl&&(e.subtitleSource=r.suburl,this.trigger("subtitleschange",nb.void))}},{key:"handleStoppedMessage",value:function(){this.dispose()}},{key:"loadSource",value:function(e,t){return rg(this,void 0,void 0,Qb().mark((function n(){var r,i;return Qb().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.localState.videoSource!==e||this.localState.subtitleSource!==t){n.next=2;break}return n.abrupt("return");case 2:return n.prev=2,r=this.getDevice().id,i=this.getPosition(),this.localState.videoSource=e,this.localState.subtitleSource=t,this.localState.ready=!1,n.next=10,this.client.joinRoom(r);case 10:return n.next=12,this.client.loadQueue({title:this.getTitle(),roomId:r,videoSource:e,subtitleSource:t});case 12:this.localState.ready=!0,this.trigger("sourceloaded",nb.void),i>0&&this.seek(i),t&&this.setSubtitles(t),n.next=22;break;case 18:n.prev=18,n.t0=n.catch(2),console.error(n.t0),this.trigger("error",new Error("Could not load video on Vivi device"));case 22:case"end":return n.stop()}}),n,this,[[2,18]])})))}},{key:"play",value:function(){this.localState.ready&&!0!==this.localState.playing&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger("playingchange",nb.void))}},{key:"pause",value:function(){this.localState.ready&&!1!==this.localState.playing&&(this.localState.playing=!1,this.client.pause(this.getDevice().id),this.trigger("playingchange",nb.void))}},{key:"seek",value:function(e){this.localState.ready&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger("positionchange",nb.void))}},{key:"setVolume",value:function(e){this.localState.ready&&this.localState.volume!==e&&(this.localState.volume=e,this.client.setVolume(this.getDevice().id,e),this.trigger("volumechange",nb.void))}},{key:"setMuted",value:function(e){this.localState.ready&&this.localState.mute!==e&&(this.localState.mute=e,this.client.setMuted(this.getDevice().id,e),this.trigger("volumechange",nb.void))}},{key:"setSubtitles",value:function(e){return rg(this,void 0,void 0,Qb().mark((function t(){var n;return Qb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.localState.ready){t.next=2;break}return t.abrupt("return");case 2:if(!e){t.next=5;break}return t.next=5,this.loadSource(this.localState.videoSource,e);case 5:n=!!e,this.localState.subtitles!==n&&(this.localState.subtitles=n,this.client.setSubtitles(this.getDevice().id,n),this.trigger("subtitleschange",nb.void));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"isPlaying",value:function(){return this.localState.playing}},{key:"isPlaybackFinished",value:function(){return this.localState.playbackFinished}},{key:"getPosition",value:function(){return this.localState.position}},{key:"getDuration",value:function(){return this.localState.duration}},{key:"getVolume",value:function(){return this.localState.volume}},{key:"getMuted",value:function(){return this.localState.mute}},{key:"getSubtitles",value:function(){if(this.localState.subtitles)return this.localState.subtitleSource}},{key:"getDevice",value:function(){return this.localState.device}},{key:"getTitle",value:function(){return this.localState.title}}],r&&Jb(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(tb);function og(e){return og="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},og(e)}function ag(){ag=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),u=new _(r||[]);return i(a,"_invoke",{value:j(e,n,u)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(x([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=g.prototype=m.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,a,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==og(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function j(t,n,r){var i=p;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=f(t,n,r);if("normal"===l.type){if(i=r.done?v:h,l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function E(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(og(t)+" is not iterable")}return b.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},N(P.prototype),l(P.prototype,u,(function(){return this})),t.AsyncIterator=P,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new P(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},N(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}function ug(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cg(r.key),r)}}function cg(e){var t=function(e){if("object"!=og(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=og(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==og(t)?t:t+""}function lg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lg=function(){return!!e})()}function sg(){return sg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=fg(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},sg.apply(null,arguments)}function fg(e){return fg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fg(e)}function pg(e,t){return pg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pg(e,t)}var hg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))},yg=1e4,vg=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=fg(t),function(e,t){if(t&&("object"==og(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,lg()?Reflect.construct(t,n||[],fg(e).constructor):t.apply(e,n))}(this,t)).options=e,n.accessToken="",n.devices=[],n.devicesFingerprint="",n.deviceDiscovery=new lb,n.bindFunctions(),n.initialize(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pg(e,t)}(t,e),n=t,r=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=Q(this.sendMessage,500,!0),this.beginDeviceDiscovery=this.beginDeviceDiscovery.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.authenticateWithVivi=this.authenticateWithVivi.bind(this),this.getRoomList=this.getRoomList.bind(this),this.joinRoom=this.joinRoom.bind(this),this.query=this.query.bind(this),this.loadQueue=this.loadQueue.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.stop=this.stop.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.setMuted=this.setMuted.bind(this),this.setSubtitles=this.setSubtitles.bind(this)}},{key:"initialize",value:function(){var e=this;this.webSocket=new Gb(this.options.url),this.webSocket.onMessage=function(t){return e.trigger("message",JSON.parse(t.data))},this.webSocket.onOpen=function(){return hg(e,void 0,void 0,ag().mark((function e(){return ag().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.options.fetchAccessToken();case 3:return this.accessToken=e.sent,e.next=6,this.authenticateWithVivi();case 6:this.beginDeviceDiscovery(),this.trigger("connected",nb.void),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(0),console.error(e.t0),this.trigger("error",new Error("Could not connect to Vivi"));case 14:case"end":return e.stop()}}),e,this,[[0,10]])})))}}},{key:"sendMessage",value:function(e){var t;null===(t=this.webSocket)||void 0===t||t.send(JSON.stringify(e))}},{key:"beginDeviceDiscovery",value:function(){var e=this;this.deviceDiscovery.every(1e4).schedule((function(){return hg(e,void 0,void 0,ag().mark((function e(){var n,r,i,o;return ag().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getRoomList();case 3:if(n=e.sent,(r=t.calculateFingerprint(n))!==this.devicesFingerprint){e.next=7;break}return e.abrupt("return");case 7:i=new Set(n.map((function(e){var t;return null!==(t=e.organisation)&&void 0!==t?t:""}))).size,o=new Set(n.map((function(e){var t;return null!==(t=e.location)&&void 0!==t?t:""}))).size,this.devices=n.map((function(e){return{id:e.id,name:e.name,schoolName:i>1?e.organisation:"",description:o>1?e.location:"",type:Zm.Vivi,status:Vm.Available}})),this.devicesFingerprint=r,this.trigger("deviceschange",nb.void),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),console.warn(e.t0);case 17:case"end":return e.stop()}}),e,this,[[0,14]])})))})).trigger().start()}},{key:"dispose",value:function(){var e,n,r,i;this.deviceDiscovery.stop(),null===(e=this.webSocket)||void 0===e||e.dipose(),(n=t,r=this,"function"==typeof(i=sg(fg(1&3?n.prototype:n),"dispose",r))?function(e){return i.apply(r,e)}:i)([])}},{key:"canCastToDevice",value:function(e){return e===Zm.Vivi}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(e){return new ig(this,e)}},{key:"authenticateWithVivi",value:function(){return hg(this,void 0,void 0,ag().mark((function e(){return ag().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:"relay",message:{token:this.accessToken,type:"identify_video_api"}}),e.next=3,this.one("message",(function(e){return"video_api_identified"===e.message.type})).timeout(yg).catch((function(){throw new Error("Failed to authenticate with Vivi")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"getRoomList",value:function(){return hg(this,void 0,void 0,ag().mark((function e(){var t;return ag().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:"relay",message:{type:"video_api_rooms"}}),e.next=3,this.one("message",(function(e){return"video_api_rooms"===e.message.type})).timeout(yg).catch((function(){throw new Error("Failed to fetch rooms")}));case 3:return t=e.sent,e.abrupt("return",t.message.rooms||[]);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"joinRoom",value:function(e){return hg(this,void 0,void 0,ag().mark((function t(){return ag().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:"relay",message:{destination_type:"box",new_destination:e,token:this.accessToken,type:"connect"}}),t.next=3,this.one("message",(function(t){return t.source===e&&"connect"===t.message.type||"error"===t.message.type&&"already_connected"===t.message.error_type||void 0})).timeout(yg).catch((function(){throw new Error("Failed to join room")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"query",value:function(e){return hg(this,void 0,void 0,ag().mark((function n(){var r;return ag().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=t.createAckId(),this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:r,name:"query"}}),n.next=4,this.one("message",(function(e){return e.message.ack_id===r})).timeout(yg).catch((function(){throw new Error("Failed to fetch query")}));case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),n,this)})))}},{key:"loadQueue",value:function(e){var n=e.roomId,r=e.title,i=e.videoSource,o=e.subtitleSource;return hg(this,void 0,void 0,ag().mark((function e(){return ag().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:n,message:{type:"message_with_ack",ack_id:t.createAckId(),name:"queue_load",payload:{urls:[{title:r,url:i,suburl:o}]}}}),e.next=3,this.one("message",(function(e){var t;return e.source===n&&"ready"===(null===(t=e.message.payload)||void 0===t?void 0:t.event)})).timeout(yg).catch((function(){throw new Error("Failed to load media")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"play",value:function(e){return hg(this,void 0,void 0,ag().mark((function t(){return ag().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:e,message:{type:"message",name:"video_play",payload:{}}}),t.next=3,this.one("message",(function(t){var n;return t.source===e&&"playing"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(yg).catch((function(){throw new Error("Failed to play video")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"pause",value:function(e){return hg(this,void 0,void 0,ag().mark((function t(){return ag().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:e,message:{type:"message",name:"video_pause"}}),t.next=3,this.one("message",(function(t){var n;return t.source===e&&"paused"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(yg).catch((function(){throw new Error("Failed to pause video")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"stop",value:function(e){return hg(this,void 0,void 0,ag().mark((function t(){return ag().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:e,message:{type:"message",name:"video_stop"}}),t.next=3,this.one("message",(function(t){var n;return t.source===e&&"stopped"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(yg).catch((function(){throw new Error("Failed to stop video")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"seek",value:function(e,t){return hg(this,void 0,void 0,ag().mark((function n(){return ag().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.sendMessageDebounced({destination:e,message:{type:"message",name:"video_seek",payload:{position:t}}})){n.next=4;break}return n.next=4,this.one("message",(function(t){var n;return t.source===e&&"playing"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(yg).catch((function(){throw new Error("Failed to seek video")}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"setVolume",value:function(e,t){return hg(this,void 0,void 0,ag().mark((function n(){return ag().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.sendMessageDebounced({destination:e,message:{type:"message",name:"set_volume",payload:{volume:t}}})){n.next=4;break}return n.next=4,this.one("message",(function(t){var n;return t.source===e&&"volume"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(yg).catch((function(){throw new Error("Failed to set volume")}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"setMuted",value:function(e,t){return hg(this,void 0,void 0,ag().mark((function n(){return ag().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.sendMessage({destination:e,message:{type:"message",name:"set_mute",payload:{mute:t}}}),n.next=3,this.one("message",(function(t){var n;return t.source===e&&"mute"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(yg).catch((function(){throw new Error("Failed to set mute")}));case 3:case"end":return n.stop()}}),n,this)})))}},{key:"setSubtitles",value:function(e,n){return hg(this,void 0,void 0,ag().mark((function r(){var i;return ag().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=t.createAckId(),this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:i,name:"set_subtitles",payload:{subtitles:n}}}),r.next=4,this.one("message",(function(t){var n;return t.source===e&&"subtitles"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(yg).catch((function(){throw new Error("Failed to set subtitles")}));case 4:case"end":return r.stop()}}),r,this)})))}}],i=[{key:"createAckId",value:function(){return Tm()}},{key:"calculateFingerprint",value:function(e){return e.map((function(e){return e.id})).sort().join(",")}}],r&&ug(n.prototype,r),i&&ug(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(tb);function dg(e){return dg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dg(e)}function mg(e){return function(e){if(Array.isArray(e))return bg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return bg(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bg(e,t):void 0}}(e)||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 bg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wg(r.key),r)}}function wg(e){var t=function(e){if("object"!=dg(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=dg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==dg(t)?t:t+""}function Og(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Og=function(){return!!e})()}function Sg(){return Sg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=kg(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Sg.apply(null,arguments)}function kg(e){return kg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kg(e)}function Ng(e,t){return Ng=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ng(e,t)}var Pg=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=kg(t),function(e,t){if(t&&("object"==dg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Og()?Reflect.construct(t,n||[],kg(e).constructor):t.apply(e,n))}(this,t)).instanceId=e,n.clients=[],n.bindFunctions(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ng(e,t)}(t,e),n=t,r=[{key:"bindFunctions",value:function(){this.addClient=this.addClient.bind(this),this.hasInstanceOfClient=this.hasInstanceOfClient.bind(this),this.startCastSession=this.startCastSession.bind(this),this.gatherAndPublishDevices=this.gatherAndPublishDevices.bind(this),this.dispose=this.dispose.bind(this)}},{key:"addClient",value:function(e){var t=this;e.on("deviceschange",this.gatherAndPublishDevices),e.on("error",(function(e){return t.trigger("error",e)})),this.clients.push(e)}},{key:"hasInstanceOfClient",value:function(e){return this.clients.some((function(t){return t instanceof e}))}},{key:"startCastSession",value:function(e){var t=this;if(this.castSession){if(this.castSession.getDevice().id===e.device.id)return void console.info("A session with device ".concat(e.device.id," already exists - this is a no-op"));this.castSession.dispose()}var n=this.clients.find((function(t){return t.canCastToDevice(e.device.type)}));n&&(this.castSession=n.startCastSession(e),this.castSession.on("error",(function(e){t.castSession.dispose(),t.trigger("error",e)})),this.castSession.on("dispose",(function(){t.castSession=void 0,t.trigger("castsessionchange",void 0)})),this.trigger("castsessionchange",this.castSession))}},{key:"getCastSession",value:function(){return this.castSession}},{key:"gatherAndPublishDevices",value:function(){var e=this.clients.map((function(e){return e.getDevices()})).reduce((function(e,t){return[].concat(mg(e),mg(t))}),[]);this.trigger("deviceschange",e)}},{key:"dispose",value:function(){var e,n,r,i;null===(e=this.castSession)||void 0===e||e.dispose(),this.clients.forEach((function(e){return e.dispose()})),this.castSession=void 0,this.clients=[],(n=t,r=this,"function"==typeof(i=Sg(kg(1&3?n.prototype:n),"dispose",r))?function(e){return i.apply(r,e)}:i)([])}}],i=[{key:"getOrCreateInstance",value:function(e){if(!e)throw new Error("instanceId is required");return this.instances[e]||(this.instances[e]=new t(e)),this.instances[e]}},{key:"disposeAndRemoveInstance",value:function(e){e.dispose(),delete this.instances[e.instanceId]}},{key:"isActive",value:function(){return Object.keys(this.instances).length>0}}],r&&gg(n.prototype,r),i&&gg(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(tb);function jg(e){return jg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jg(e)}function Eg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Cg(r.key),r)}}function Cg(e){var t=function(e){if("object"!=jg(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=jg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jg(t)?t:t+""}function Tg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tg=function(){return!!e})()}function _g(e,t,n,r){var i=xg(Lg(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function xg(){return xg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Lg(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},xg.apply(null,arguments)}function Lg(e){return Lg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Lg(e)}function Rg(e,t){return Rg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Rg(e,t)}Pg.instances={};var Ig=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Lg(t),function(e,t){if(t&&("object"==jg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Tg()?Reflect.construct(t,n||[],Lg(e).constructor):t.apply(e,n))}(this,t,[e,n])).isVisible=r.isVisible.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rg(e,t)}(t,e),n=t,(r=[{key:"createEl",value:function(){var e,n,r=_g(t,"createEl",this,3)(["li",{className:"vjs-menu-item cv-device-menu-item"}]),o=i.Z.dom.createEl("div",{className:"cv-device-menu-item-body",innerHTML:'\n <span class="cv-device-icon '.concat({vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"}[this.options_.type],'"></span>\n <div>\n <span class="vjs-menu-item-text">').concat(this.options_.label,'</span>\n <span class="vjs-menu-item-text cv-device-truncated-text">').concat(null!==(e=this.options_.schoolName)&&void 0!==e?e:"",'</span>\n <span class="vjs-menu-item-text cv-device-truncated-text cv-device-description">').concat(null!==(n=this.options_.description)&&void 0!==n?n:"","</span>\n </div>\n ")});return r.replaceChildren(o),r}},{key:"handleClick",value:function(){this.options_.onClick()}},{key:"show",value:function(){_g(t,"show",this,3)([])}},{key:"hide",value:function(){_g(t,"hide",this,3)([])}},{key:"isVisible",value:function(){return!_g(t,"hasClass",this,3)(["vjs-hidden"])}}])&&Eg(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("MenuItem"));function Mg(e){return Mg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mg(e)}function Bg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dg(r.key),r)}}function Dg(e){var t=function(e){if("object"!=Mg(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Mg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mg(t)?t:t+""}function Ag(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ag=function(){return!!e})()}function Fg(e){return Fg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fg(e)}function zg(e,t){return zg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zg(e,t)}var Zg=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Fg(t),function(e,t){if(t&&("object"==Mg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ag()?Reflect.construct(t,n||[],Fg(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zg(e,t)}(t,e),n=t,(r=[{key:"createEl",value:function(){var e=Mu.apply(this),t=this.contentEl_;return this.contentWrapper=i.Z.dom.createEl("div",{className:"vjs-menu-content"}),e.className="vjs-menu cv-devices-menu",t.className="cv-devices-menu-item-list",e.removeChild(t),e.appendChild(this.contentWrapper),this.contentWrapper.appendChild(t),this.simpleBar=new Ru.Z(t,{autoHide:!1}),e}},{key:"addCta",value:function(e){this.ctaElement?console.warn("CTA has already been added to the menu - this is a no-op"):(this.ctaElement=e.el(),this.contentWrapper.prepend(this.ctaElement),this.el().classList.add("has-cta"))}},{key:"removeCta",value:function(){this.ctaElement&&(this.contentWrapper.removeChild(this.ctaElement),this.el().classList.remove("has-cta"))}}])&&Bg(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Menu"));function Vg(e){var t=e.inactiveIntegrations,n=e.canUserManageIntegrations,i=e.player,o=e.onDismiss,a=e.onInstall,u=e.onLearnMore,c=e.onContactSupport;if(0===t.length)return r.createElement(r.Fragment,null);var l,s=function(e){return i.localize(e)},f=function(e){return-1!==t.indexOf(e)};return l=f(Zm.AppleTv)&&f(Zm.Vivi)?"vivi_and_apple_tv":f(Zm.Vivi)?"vivi":"apple_tv",r.createElement("div",{className:"cv-devices-cta",tabIndex:-1},r.createElement(Gg,{context:l,localize:s,onDismiss:function(){return o(l)}}),r.createElement(Ug,{context:l}),r.createElement(Kg,{context:l,canUserManageIntegrations:n,localize:s,onContactSupport:function(){return c(l)},onInstall:function(){return a(l)},onLearnMore:function(){return u(l)}}))}function Gg(e){var t=e.context,n=e.localize,i=e.onDismiss;return r.createElement("div",{className:"cv-devices-cta-header"},r.createElement("span",{className:"cv-devices-badge"},n("New")),r.createElement("span",{className:"cv-devices-title"},"vivi_and_apple_tv"===t&&n("Cast to Vivi and Apple TV"),"vivi"===t&&n("Cast to Vivi"),"apple_tv"===t&&n("Cast to Apple TV")),r.createElement("span",{className:"cv-devices-close",onClick:i},r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"white",d:"M11.9588 10.6413L16.3612 6.34478C16.7361 5.97191 17.3439 5.97191 17.7188 6.34478C18.0937 6.71764 18.0937 7.32218 17.7188 7.69505L13.3165 11.9916L17.7188 16.3701C18.0937 16.7429 18.0937 17.3475 17.7188 17.7203C17.3439 18.0932 16.7361 18.0932 16.3612 17.7203L11.9588 13.3419L7.63882 17.7203C7.26392 18.0932 6.65608 18.0932 6.28118 17.7203C5.90627 17.3475 5.90627 16.7429 6.28118 16.3701L10.6012 11.9916L6.28118 7.62993C5.90627 7.25706 5.90627 6.65252 6.28118 6.27965C6.65608 5.90678 7.26392 5.90678 7.63882 6.27965L11.9588 10.6413Z"}))))}function Ug(e){var t=e.context,n="vivi_and_apple_tv"===t?"bg-vivi-and-apple":"vivi"===t?"bg-vivi":"bg-apple";return r.createElement("div",{className:"cv-devices-cta-body ".concat(n)},("vivi_and_apple_tv"===t||"apple_tv"===t)&&r.createElement("div",{className:"cv-devices-icon-container"},r.createElement("span",{className:"cv-devices-icon apple"})),("vivi_and_apple_tv"===t||"vivi"===t)&&r.createElement("div",{className:"cv-devices-icon-container"},r.createElement("span",{className:"cv-devices-icon vivi"})))}function Kg(e){var t=e.context,n=e.canUserManageIntegrations,i=e.localize,o=e.onInstall,a=e.onLearnMore,u=e.onContactSupport;return n?r.createElement("div",{className:"cv-devices-cta-footer"},r.createElement("span",null,"vivi_and_apple_tv"===t&&i("Discover our new device integrations to make presenting in the classroom easy!"),"vivi"===t&&i("Discover our new Vivi integration."),"apple_tv"===t&&i("Discover our new Apple TV integration.")),r.createElement("br",null),r.createElement("span",{className:"cv-devices-link",onClick:o},i("Click here to install"))):r.createElement("div",{className:"cv-devices-cta-footer"},r.createElement("span",null,"vivi_and_apple_tv"===t&&i("Cast to Vivi and Apple TV is now available! Please contact "),"vivi"===t&&i("Cast to Vivi is now available! Please contact "),"apple_tv"===t&&i("Cast to Apple TV is now available! Please contact ")),r.createElement("span",{className:"cv-devices-link",onClick:u},"ClickView Support"),r.createElement("span",null,"vivi_and_apple_tv"===t&&i(" or your administrator to set up Apple TV and Vivi."),"vivi"===t&&i(" or your administrator to set up Vivi."),"apple_tv"===t&&i(" or your administrator to set up Apple TV.")),r.createElement("br",null),r.createElement("span",{className:"cv-devices-link",onClick:a},"Learn more"))}function qg(e){return qg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qg(e)}function Hg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Wg(r.key),r)}}function Wg(e){var t=function(e){if("object"!=qg(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=qg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==qg(t)?t:t+""}function Yg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yg=function(){return!!e})()}function Qg(e,t,n,r){var i=Jg(Xg(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Jg(){return Jg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Xg(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Jg.apply(null,arguments)}function Xg(e){return Xg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xg(e)}function $g(e,t){return $g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$g(e,t)}i.Z.registerComponent("DevicesMenu",Zg),i.Z.registerComponent("DevicesCta",Ff((function(e,t){return r.createElement(Vg,Object.assign({player:e},t))}),{properties:{className:"cv-devices-cta-wrapper"}}));var ew=i.Z.getComponent("DevicesCta"),tw=i.Z.getComponent("MenuButton"),nw=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Xg(t),function(e,t){if(t&&("object"==qg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Yg()?Reflect.construct(t,n||[],Xg(e).constructor):t.apply(e,n))}(this,t,[e,n])).alwaysCollapsed=!1,r.isCollapsed=!1,r.isCollabsible=!0,r.className="cv-devices-menu-button",r.searchText="",r.devices=[],r.castSession=void 0,r.bindFunctions(),r.bindEventListeners(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$g(e,t)}(t,e),n=t,r=[{key:"bindFunctions",value:function(){this.bindEventListeners=this.bindEventListeners.bind(this),this.setDevices=this.setDevices.bind(this),this.setCastSession=this.setCastSession.bind(this),this.setSearchText=this.setSearchText.bind(this),this.getDeviceMenuItems=this.getDeviceMenuItems.bind(this),this.showNotificationBadge=this.showNotificationBadge.bind(this),this.hideNotificationBadge=this.hideNotificationBadge.bind(this),this.render=this.render.bind(this),this.removeMenuItems=this.removeMenuItems.bind(this),this.addMenuItemsForDevices=this.addMenuItemsForDevices.bind(this),this.shouldShowSearchInput=this.shouldShowSearchInput.bind(this),this.toggleSearchInput=this.toggleSearchInput.bind(this),this.toggleDeviceMenuItems=this.toggleDeviceMenuItems.bind(this),this.toggleEmptyStatePlaceholder=this.toggleEmptyStatePlaceholder.bind(this)}},{key:"bindEventListeners",value:function(){var e=this,t=this.$("button"),n=function(t){e.menu.handleBlur(t)};t.addEventListener("blur",n),this.one("dispose",(function(){var r;t.removeEventListener("blur",n),null===(r=e.cta)||void 0===r||r.dispose()}))}},{key:"createEl",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=tw.prototype.createEl).apply.apply(e,[this].concat(n))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-devices-button ".concat(Qg(t,"buildWrapperCSSClass",this,3)([]))}},{key:"createMenu",value:function(){var e=this,t=new Zg(this.player_,{menuButton:this});if(!this.options_.ctaOptions.hasBeenDismissed&&this.options_.ctaOptions.inactiveIntegrations.length>0){var n=this.options_.ctaOptions,r=n.onDismiss,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(n,["onDismiss"]);this.cta=new ew(this.player(),Object.assign(Object.assign({},i),{onDismiss:function(n){e.hideNotificationBadge(),t.removeCta(),r(n)}})),this.showNotificationBadge(),t.addCta(this.cta)}return this.createItems().forEach((function(e){return t.addItem(e)})),t}},{key:"createItems",value:function(){var e=this,t=[];return this.headingItem=new j(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new se(this.player_,{menuButton:this,search:function(t){return e.setSearchText(t)},className:"cv-devices-search-input"}),this.emptyPlaceholder=new fe(this.player_,{label:"No devices found",selected:!1,selectable:!1,multiSelectable:!1}),this.headingItem.show(),this.searchInputItem.hide(),this.emptyPlaceholder.show(),t.push(this.headingItem,this.searchInputItem,this.emptyPlaceholder),t}},{key:"pressButton",value:function(){var e;Qg(t,"pressButton",this,3)([]),this.shouldShowSearchInput()&&(null===(e=this.searchInputItem)||void 0===e||e.focus())}},{key:"setDevices",value:function(e){this.devices=e,this.render()}},{key:"setCastSession",value:function(e){this.castSession=e,this.render()}},{key:"setSearchText",value:function(e){this.searchText=e,this.render()}},{key:"getDeviceMenuItems",value:function(){return this.menu.children_.filter((function(e){return e instanceof Ig}))}},{key:"showNotificationBadge",value:function(){this.addClass("notification-badge")}},{key:"hideNotificationBadge",value:function(){this.removeClass("notification-badge")}},{key:"render",value:function(){this.removeMenuItems(this.getDeviceMenuItems()),this.addMenuItemsForDevices(this.devices),this.toggleSearchInput(),this.toggleDeviceMenuItems(),this.toggleEmptyStatePlaceholder()}},{key:"removeMenuItems",value:function(e){var t=this;e.forEach((function(e){t.menu.removeChild(e),e.dispose()}))}},{key:"addMenuItemsForDevices",value:function(e){var t=this;e.sort((function(e,t){var n,r,i,o,a="".concat(e.type).concat(null!==(n=e.schoolName)&&void 0!==n?n:"").concat(null!==(r=e.description)&&void 0!==r?r:"").concat(e.name),u="".concat(t.type).concat(null!==(i=t.schoolName)&&void 0!==i?i:"").concat(null!==(o=t.description)&&void 0!==o?o:"").concat(t.name);return a.localeCompare(u)})).forEach((function(e){var n=new Ig(t.player(),{id:e.id,label:e.name,schoolName:e.schoolName,description:e.description,selected:!1,multiSelectable:!1,selectable:!0,available:e.status===Vm.Available,type:e.type,onClick:function(){t.options_.onDeviceMenuItemClick(n,e)}});t.menu.addItem(n)}))}},{key:"shouldShowSearchInput",value:function(){return this.getDeviceMenuItems().length>=20}},{key:"toggleSearchInput",value:function(){this.shouldShowSearchInput()?(this.searchInputItem.show(),this.menu.addClass("vertical-fill")):(this.searchInputItem.hide(),this.menu.removeClass("vertical-fill"))}},{key:"toggleDeviceMenuItems",value:function(){var e=this,t=this.getDeviceMenuItems(),n=this.shouldShowSearchInput(),r=this.searchText.toLowerCase();t.forEach((function(t){var i,o,a,u=e.devices.find((function(e){return e.id===t.options_.id}));if(u){var c=u.status===Vm.Available,l=u.id===(null===(i=e.castSession)||void 0===i?void 0:i.getDevice().id),s=!n||-1!=="".concat(u.name," ").concat(null!==(o=u.schoolName)&&void 0!==o?o:""," ").concat(null!==(a=u.description)&&void 0!==a?a:"").trim().toLowerCase().indexOf(r);c?t.enable():t.disable(),s?t.show():t.hide(),l?t.selected(!0):t.selected(!1)}}))}},{key:"toggleEmptyStatePlaceholder",value:function(){var e=this.getDeviceMenuItems();e.filter((function(e){return e.isVisible()})).length?this.emptyPlaceholder.hide():this.emptyPlaceholder.show(),e.length?this.emptyPlaceholder.setLabel(this.localize("No matching results")):this.emptyPlaceholder.setLabel(this.localize("No devices found"))}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){var e,t;return null!==(t=null===(e=this.castSession)||void 0===e?void 0:e.getDevice().name)&&void 0!==t?t:" "}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){this.handleClick()}},{key:"handleClick",value:function(){Qg(t,"handleClick",this,3)([null]),this.options_.onClick()}}],r&&Hg(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(tw);function rw(e){return rw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rw(e)}function iw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ow(r.key),r)}}function ow(e){var t=function(e){if("object"!=rw(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=rw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rw(t)?t:t+""}function aw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(aw=function(){return!!e})()}function uw(){return uw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=cw(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},uw.apply(null,arguments)}function cw(e){return cw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cw(e)}function lw(e,t){return lw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lw(e,t)}nw.prototype.controlText_="Devices",i.Z.registerComponent("DevicesButton",nw);var sw=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=cw(t),function(e,t){if(t&&("object"==rw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,aw()?Reflect.construct(t,n||[],cw(e).constructor):t.apply(e,n))}(this,t,[null,e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lw(e,t)}(t,e),n=t,r=[{key:"createEl",value:function(){return(e=t,n=this,"function"==typeof(r=uw(cw(1&3?e.prototype:e),"createEl",n))?function(e){return r.apply(n,e)}:r)(["div",{className:"cv-devices-tech"}]);var e,n,r}},{key:"setPoster",value:function(e){this.poster=e,this.update()}},{key:"setDevice",value:function(e){this.device=e,this.update()}},{key:"update",value:function(){var e,t,n,r,i=this;this.el_.innerHTML='\n <div class="cv-devices-content">\n <p>'.concat(this.localize("Currently playing on"),'</p>\n <h2><span class="cv-device-icon ').concat({vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"}[null!==(t=null===(e=this.device)||void 0===e?void 0:e.type)&&void 0!==t?t:Zm.Vivi],'"></span>').concat(null!==(r=null===(n=this.device)||void 0===n?void 0:n.name)&&void 0!==r?r:"",'</h2>\n </div>\n <div class="cv-devices-background" style="background-image: url(').concat(this.poster,')"></div>\n ');var o=document.createElement("button"),a=function(e){e.stopPropagation(),i.options_.onStopCasting()};o.onclick=a,o.ontouchstart=a,o.className="stop-casting-button",o.innerHTML=this.localize("Stop casting"),this.el_.querySelector(".cv-devices-content").appendChild(o)}},{key:"play",value:function(){}}],r&&iw(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("Component"));function fw(e){return fw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fw(e)}function pw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hw(r.key),r)}}function hw(e){var t=function(e){if("object"!=fw(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=fw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fw(t)?t:t+""}function yw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yw=function(){return!!e})()}function vw(e,t,n,r){var i=dw(mw(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function dw(){return dw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=mw(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},dw.apply(null,arguments)}function mw(e){return mw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mw(e)}function bw(e,t){return bw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bw(e,t)}var gw=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=mw(t),function(e,t){if(t&&("object"==fw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,yw()?Reflect.construct(t,n||[],mw(e).constructor):t.apply(e,n))}(this,t,[e,n])).featuresVolumeControl=!0,r.featuresPlaybackRate=!1,r.movingMediaElementInDOM=!1,r.featuresFullscreenResize=!0,r.featuresTimeupdateEvents=!0,r.featuresProgressEvents=!1,r.featuresNativeTextTracks=!1,r.featuresNativeAudioTracks=!1,r.featuresNativeVideoTracks=!1,r.featuresMuteControl=!0,r.featuresSourceset=!1,r.videojsPlayer=(0,i.Z)(r.options_.playerId),r.bindFunctions(),r.bindEventListeners(),r.ready((function(){r.setSource(r.options_.source)})),r.triggerReady(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bw(e,t)}(t,e),n=t,r=[{key:"bindFunctions",value:function(){this.bindEventListeners=this.bindEventListeners.bind(this),this.onTextTrackChanged=this.onTextTrackChanged.bind(this),this.getSelectedTextTrack=this.getSelectedTextTrack.bind(this),this.setSelectedTextTrack=this.setSelectedTextTrack.bind(this),this.showUI=this.showUI.bind(this),this.hideUI=this.hideUI.bind(this),this.dispose=this.dispose.bind(this),this.setSource=this.setSource.bind(this),this.getCastSession=this.getCastSession.bind(this)}},{key:"bindEventListeners",value:function(){var e=this,t=this.getCastSession();t&&(this.textTracks().on("change",this.onTextTrackChanged),this.videojsPlayer.one("ended",(function(){t.dispose()})),t.on("durationchange",(function(){e.trigger("durationchange")})),t.on("dispose",(function(){e.trigger("ended"),e.hideUI()})),t.on("playingchange",(function(){t.isPlaying()?(e.trigger("play"),e.trigger("playing")):e.trigger("pause")})),t.on("volumechange",(function(){e.trigger("volumechange")})),t.on("sourceloaded",(function(){e.trigger("loadeddata")})),t.on("subtitleschange",(function(){e.setSelectedTextTrack(t.getSubtitles())})))}},{key:"onTextTrackChanged",value:function(){var e,t=this.getSelectedTextTrack();null===(e=this.getCastSession())||void 0===e||e.setSubtitles(null==t?void 0:t.src)}},{key:"getSelectedTextTrack",value:function(){return Y.findTrackByPredicate(this.videojsPlayer.player_,(function(e){return"showing"===e.mode&&!!e.src}))}},{key:"setSelectedTextTrack",value:function(e){Y.forEachTrack(this.videojsPlayer.player_,(function(t){t.src===e?t.mode="showing":t.mode="hidden"}))}},{key:"showUI",value:function(e){this.ui&&(this.ui.setPoster(this.options_.poster),this.ui.setDevice(e),this.ui.show())}},{key:"hideUI",value:function(){var e;null===(e=this.ui)||void 0===e||e.hide()}},{key:"dispose",value:function(){this.textTracks().off("change",this.onTextTrackChanged);var e=this.getCastSession();e&&e.dispose(),vw(t,"cleanupAutoTextTracks",this,3)([]),vw(t,"dispose",this,3)([])}},{key:"createEl",value:function(){var e=this;return this.ui=this.ui||new sw({onStopCasting:function(){var t;null===(t=e.getCastSession())||void 0===t||t.dispose()}}),this.ui.el()}},{key:"setSource",value:function(e){var t=this.getCastSession();if(t){this.showUI(t.getDevice()),this.trigger("loadstart");var n=this.getSelectedTextTrack();t.loadSource(e.src,null==n?void 0:n.src)}}},{key:"addRemoteTextTrack",value:function(e){return vw(t,"addRemoteTextTrack",this,3)([e,!0])}},{key:"getCastSession",value:function(){var e;return Pg.getOrCreateInstance(null!==(e=this.options_.instanceId)&&void 0!==e?e:"").getCastSession()}},{key:"play",value:function(){var e;null===(e=this.getCastSession())||void 0===e||e.play()}},{key:"pause",value:function(){var e;null===(e=this.getCastSession())||void 0===e||e.pause()}},{key:"paused",value:function(){var e;return!1===(null===(e=this.getCastSession())||void 0===e?void 0:e.isPlaying())}},{key:"ended",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.isPlaybackFinished())&&void 0!==t&&t}},{key:"setCurrentTime",value:function(e){var t;null===(t=this.getCastSession())||void 0===t||t.seek(null!=e?e:0)}},{key:"currentTime",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}},{key:"duration",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.getDuration())&&void 0!==t?t:this.videojsPlayer.duration()}},{key:"volume",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.getVolume())&&void 0!==t?t:1}},{key:"setVolume",value:function(e){var t;null===(t=this.getCastSession())||void 0===t||t.setVolume(e)}},{key:"muted",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.getMuted())&&void 0!==t&&t}},{key:"setMuted",value:function(e){var t;null===(t=this.getCastSession())||void 0===t||t.setMuted(e)}},{key:"buffered",value:function(){}},{key:"seekable",value:function(){return i.Z.createTimeRanges(0,this.duration())}},{key:"playbackRate",value:function(){return 1}},{key:"readyState",value:function(){return 4}},{key:"controls",value:function(){return!1}},{key:"playsinline",value:function(){return!0}},{key:"supportsFullScreen",value:function(){return!0}},{key:"setAutoplay",value:function(){}},{key:"preload",value:function(){}},{key:"load",value:function(){}},{key:"setPlaybackRate",value:function(){}}],o=[{key:"canPlayType",value:function(){return""}},{key:"canPlaySource",value:function(e,t){var n;return!!Pg.getOrCreateInstance(null!==(n=null==t?void 0:t.instanceId)&&void 0!==n?n:"").getCastSession()}},{key:"isSupported",value:function(){return Pg.isActive()}}],r&&pw(n.prototype,r),o&&pw(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(i.Z.getComponent("Tech"));function ww(e){return ww="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ww(e)}function Ow(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Sw(r.key),r)}}function Sw(e){var t=function(e){if("object"!=ww(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ww(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ww(t)?t:t+""}function kw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kw=function(){return!!e})()}function Nw(){return Nw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Pw(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Nw.apply(null,arguments)}function Pw(e){return Pw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pw(e)}function jw(e,t){return jw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jw(e,t)}i.Z.registerTech("devices",gw);var Ew=function(e){function t(e,n){var r,i,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Pw(t),function(e,t){if(t&&("object"==ww(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,kw()?Reflect.construct(t,n||[],Pw(e).constructor):t.apply(e,n))}(this,t,[e,n])).options=n,r.instanceId=null!==(o=null===(i=r.player.options_.devices)||void 0===i?void 0:i.instanceId)&&void 0!==o?o:"",r.bindFunctions(),r.initialize(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jw(e,t)}(t,e),n=t,r=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.onReady=this.onReady.bind(this),this.onDevicesChanged=this.onDevicesChanged.bind(this),this.onCastSessionChanged=this.onCastSessionChanged.bind(this),this.onDevicesError=this.onDevicesError.bind(this),this.addViviClient=this.addViviClient.bind(this),this.addAppleTvClient=this.addAppleTvClient.bind(this),this.reloadTech=this.reloadTech.bind(this),this.getSessionManager=this.getSessionManager.bind(this),this.dispose=this.dispose.bind(this)}},{key:"initialize",value:function(){this.player.ready(this.onReady)}},{key:"onReady",value:function(){var e=this,t=this.player.getChild("collapserator"),n=null==t?void 0:t.children().findIndex((function(e){return"CustomControlSpacer"===e.name()})),r=null==t?void 0:t.children().findIndex((function(e){return"OpenExternallyButton"===e.name()})),i=Math.max(n,r)+1,o=this.getSessionManager();if(t&&n&&-1!==n&&o){o.on("deviceschange",this.onDevicesChanged),o.on("castsessionchange",this.onCastSessionChanged),o.on("error",this.onDevicesError);var a=this.options.ctaOptions,u=this.options.vivi,c=[];this.options.appleTv.enabled||c.push(Zm.AppleTv),u.enabled&&u.accountConnected||c.push(Zm.Vivi);var l={onClick:function(){e.addViviClient(o),e.addAppleTvClient(o)},onDeviceMenuItemClick:function(t,n){var r;o.startCastSession({device:n,title:e.options.title}),null===(r=e.options.analyticsService)||void 0===r||r.logUserAction(n,{actionType:it.Vw.Select,workflowPhase:it.eu.Complete,descriptor:it.UX.ChangeDevice,entity:it.py.Device,eventVersion:it.eq.V3})},ctaOptions:Object.assign(Object.assign({},a),{inactiveIntegrations:c})};this.devicesButton=t.addChild("DevicesButton",l,i)}}},{key:"onDevicesChanged",value:function(e){var t;null===(t=this.devicesButton)||void 0===t||t.setDevices(e)}},{key:"onCastSessionChanged",value:function(e){var t;null===(t=this.devicesButton)||void 0===t||t.setCastSession(e),this.reloadTech(),e?(this.player.addClass("cv-device-casting"),this.player.addClass("cv-device-".concat(e.getDevice().type)),this.player.isFullscreen()&&this.player.exitFullscreen()):(this.player.removeClass("cv-device-casting"),this.player.removeClass("cv-device-".concat(Zm.AppleTv)),this.player.removeClass("cv-device-".concat(Zm.Vivi)))}},{key:"onDevicesError",value:function(e){this.player.error(e.message),this.player.pause()}},{key:"addViviClient",value:function(e){if(this.options.vivi.enabled&&this.options.vivi.accountConnected&&this.options.vivi.apiUrl&&!e.hasInstanceOfClient(vg)){var t=new vg({url:this.options.vivi.apiUrl,fetchAccessToken:this.options.vivi.fetchAccessToken});e.addClient(t)}}},{key:"addAppleTvClient",value:function(e){if(this.options.appleTv.enabled&&this.options.trackingCode&&this.options.userId&&!e.hasInstanceOfClient(Ab)){var t=new Ab({fetchAccessToken:this.options.appleTv.fetchAccessToken,trackingCode:this.options.trackingCode,userId:this.options.userId});e.addClient(t)}}},{key:"reloadTech",value:function(){var e=this.player,t=e.currentSources(),n=e.volume(),r=e.muted(),i=e.currentTime(),o=e.paused();e.src(t),e.one("playing",(function(){e.volume(n),e.muted(r),e.currentTime(i),o?e.pause():e.play()}))}},{key:"getSessionManager",value:function(){if(this.instanceId)return Pg.getOrCreateInstance(this.instanceId)}},{key:"dispose",value:function(){var e,n,r,i=this.getSessionManager();i&&(i.off("deviceschange",this.onDevicesChanged),i.off("castsessionchange",this.onCastSessionChanged),i.off("error",this.onDevicesError),Pg.disposeAndRemoveInstance(i),(e=t,n=this,"function"==typeof(r=Nw(Pw(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([]))}}],r&&Ow(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));function Cw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Tw(e){var t,n,i,o=r.useRef(e.player.duration()-e.player.currentTime()),a=(n=r.useState(o.current),i=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(n,i)||function(e,t){if(e){if("string"==typeof e)return Cw(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cw(e,t):void 0}}(n,i)||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.")}()),u=a[0],c=a[1];function l(){var t=e.player.duration()-e.player.currentTime();c(t),t>o.current&&(o.current=t)}if(r.useEffect((function(){return e.player.on("timeupdate",l),function(){e.player.off("timeupdate",l)}}),[]),!e.nextVideo||!e.onPlayNext)return r.createElement(r.Fragment,null);var s=Math.ceil(u),f=1===s?"second":"seconds";return r.createElement(r.Fragment,null,r.createElement("div",{className:"cv-up-next-container"},r.createElement("div",{className:"cv-cancel-up-next cursor-pointer",role:"button",onClick:e.onCancel},"×"),r.createElement("div",{className:"cv-up-next-heading"},"Up next in ",s," ",f,":"),r.createElement("div",{className:"cv-up-next-image cursor-pointer",onClick:e.onPlayNext,style:{backgroundImage:"url(".concat(null===(t=e.nextVideo)||void 0===t?void 0:t.thumbnailUrl,")")}}),r.createElement("div",{className:"cv-up-next-title"},e.nextVideo.name)))}function _w(e){return _w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_w(e)}function xw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Lw(r.key),r)}}function Lw(e){var t=function(e){if("object"!=_w(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_w(t)?t:t+""}function Rw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rw=function(){return!!e})()}function Iw(){return Iw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Mw(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Iw.apply(null,arguments)}function Mw(e){return Mw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mw(e)}function Bw(e,t){return Bw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Bw(e,t)}i.Z.registerPlugin("devicesPlugin",Ew),i.Z.registerComponent("UpNext",Ff((function(e,t){return r.createElement(Tw,Object.assign({player:e},t))})));var Dw=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=Mw(t),function(e,t){if(t&&("object"==_w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Rw()?Reflect.construct(t,n||[],Mw(e).constructor):t.apply(e,n))}(this,t,[e,n])).playNext=e.nextVideoPlugin().getShouldPlayNext(),r.toggle(r.playNext),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bw(e,t)}(t,e),n=t,r=[{key:"handleToggle",value:function(){this.toggle(!this.playNext)}},{key:"toggle",value:function(e){e?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){this.playNext=!0,i.Z.dom.addClass(this.toggleEl,"on"),this.player_.nextVideoPlugin().setShouldPlayNext(this.playNext,!0)}},{key:"toggleOff",value:function(){this.playNext=!1,i.Z.dom.removeClass(this.toggleEl,"on"),this.player_.nextVideoPlugin().setShouldPlayNext(this.playNext,!0)}},{key:"handleClick",value:function(e){e.stopImmediatePropagation()}},{key:"createEl",value:function(e,n,r){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=i.Z.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);var o,a,u,c=(o=t,a=this,"function"==typeof(u=Iw(Mw(1&3?o.prototype:o),"createEl",a))?function(e){return u.apply(a,e)}:u)([e,{className:"vjs-menu-item cv-cog-menu-item cv-play-next-toggle",innerHTML:'\n <span class="vjs-menu-item-text">Play next video</span>\n <span class="cv-toggle-container"></span>'},r]);return c.children[1].appendChild(this.toggleEl),c}}],r&&xw(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("MenuItem"));function Aw(e){return Aw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Aw(e)}function Fw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zw(r.key),r)}}function zw(e){var t=function(e){if("object"!=Aw(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Aw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Aw(t)?t:t+""}function Zw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zw=function(){return!!e})()}function Vw(){return Vw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Gw(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Vw.apply(null,arguments)}function Gw(e){return Gw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gw(e)}function Uw(e,t){return Uw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Uw(e,t)}i.Z.registerComponent("NextVideoMenuItem",Dw);var Kw="cv-persisttest",qw="cv-play-next-video",Hw=i.Z.getPlugin("plugin"),Ww=(i.Z.getComponent("MenuItem"),i.Z.getComponent("NextVideoMenuItem")),Yw=function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=Gw(t),function(e,t){if(t&&("object"==Aw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Zw()?Reflect.construct(t,n||[],Gw(e).constructor):t.apply(e,n))}(this,t,[e])).setShouldPlayNext=n.setShouldPlayNext.bind(n),n.getShouldPlayNext=n.getShouldPlayNext.bind(n),n.getChapterTrack=n.getChapterTrack.bind(n),n.onTimeUpdate=n.onTimeUpdate.bind(n),n.hasLocalStorage=n.testHasLocalStorage(),n.shouldPlayNextVideo=!1,n.hasLocalStorage){var r=window.localStorage.getItem(qw);n.shouldPlayNextVideo="true"===r}return e.ready((function(){n.initialize()})),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uw(e,t)}(t,e),n=t,r=[{key:"initialize",value:function(){this.player.isDisposed()||this.bindListeners()}},{key:"getChapterTrack",value:function(){return Y.getTrack(this.player,"chapters",null)}},{key:"setNextVideo",value:function(e,t,n){var r;this.nextVideo=e,this.callback=n,t&&this.setShouldPlayNext(!0),(null===(r=this.player.getChild("collapserator"))||void 0===r?void 0:r.getChild("cogButton")).addItem({index:0,ctor:Ww,name:"NextVideoMenuItem"})}},{key:"getShouldPlayNext",value:function(){return this.shouldPlayNextVideo}},{key:"setShouldPlayNext",value:function(e,t){this.shouldPlayNextVideo=e,this.hasLocalStorage&&t&&window.localStorage.setItem(qw,e.toString())}},{key:"bindListeners",value:function(){this.player.on("timeupdate",this.onTimeUpdate)}},{key:"dispose",value:function(){var e,n,r;this.player.off("timeupdate",this.onTimeUpdate),this.hideUpNext(),(e=t,n=this,"function"==typeof(r=Vw(Gw(1&3?e.prototype:e),"dispose",n))?function(e){return r.apply(n,e)}:r)([])}},{key:"onTimeUpdate",value:function(){var e,t;if(!this.player.pictureInPicture||!this.player.isInPictureInPicture())if(this.getShouldPlayNext()){if(this.player.ended())return this.callback(),void this.hideUpNext();if(!(this.player.duration()<=0||this.upNextRendered&&this.player.currentTime()>this.upNextTimepoint)){var n=this.getChapterTrack(),r=(null===(e=null==n?void 0:n.activeCues)||void 0===e?void 0:e.length)&&n.activeCues[0];"credits"===(null===(t=null==r?void 0:r.text)||void 0===t?void 0:t.toLowerCase())||this.player.currentTime()>=this.player.duration()-5?this.showUpNext():this.hideUpNext()}}else this.hideUpNext()}},{key:"showUpNext",value:function(){var e=this;this.upNextRendered||(this.upNextRendered=!0,this.upNextTimepoint=this.player.currentTime(),this.player.addChild("UpNext",{nextVideo:this.nextVideo,onPlayNext:this.callback,onCancel:function(){e.hideUpNext(),e.setShouldPlayNext(!1)}}))}},{key:"hideUpNext",value:function(){if(this.upNextRendered){this.upNextRendered=!1,this.upNextTimepoint=null;var e=this.player.getChild("UpNext");e&&(this.player.removeChild(e),e.dispose())}}},{key:"testHasLocalStorage",value:function(){try{return window.localStorage.setItem(Kw,"persistPlayNext"),window.localStorage.removeItem(Kw),!0}catch(e){return!1}}}],r&&Fw(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Hw);i.Z.registerPlugin("nextVideoPlugin",Yw);var Qw=n(39202),Jw=n(28825),Xw=n(86073),$w=n(1164),eO=n(45778),tO=n(87611);var nO={width:200,resizeType:av.Nq.Cover};function rO(e){var t;return eO.G.isResource(e)?e.metadata.type===$w.L.Pdf||(null===(t=e.pdf)||void 0===t?void 0:t.url)?av.__.Pdf:av.__.Thumbnails:av.__.Link}function iO(e){var t,n,i,o=null,a=0;eO.G.isResource(e.resource)&&(o=e.resource.metadata,a=null!==(i=null===(n=null===(t=e.resource.thumbnail)||void 0===t?void 0:t.metadata)||void 0===n?void 0:n.rotation)&&void 0!==i?i:0);var u=function(e,t){var n,r,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:nO,a=rO(t);if("thumbnail"in t&&(null===(n=t.thumbnail)||void 0===n?void 0:n.url))return ov.j.createUrl(null===(r=t.thumbnail)||void 0===r?void 0:r.url,Object.assign({},o));var u=Xw._.safeUrlConcat(e,"/v1/previews");return eO.G.isResource(t)?a===av.__.Pdf?t.metadata.type===$w.L.Pdf?ov.j.createResourceImage(u,t.url,Object.assign({},o)):ov.j.createResourceImage(u,null===(i=t.pdf)||void 0===i?void 0:i.url,Object.assign({},o)):t.metadata.type!==$w.L.Zip?ov.j.createUrl(t.url,{size:av.h2.Medium,resizeType:av.Nq.Cover}):"/images/zip-resource.png":ov.j.createResourceImage(u,t.url,Object.assign({},o))}(e.imageCdnUrl,e.resource,e.dynamicRatioImageOptions);return r.createElement(tO.Z,{data:u,imageType:rO(e.resource),imageStyle:{transform:"rotate(".concat(a,"deg)")},alt:e.resource.name,errorFallbackImageSrc:e.imageErrorFallbackUrl,errorFallbackImageClassName:"Xy4zX",imageClassName:(null==o?void 0:o.type)===$w.L.Image?"".concat("z4O5p"," ").concat("FFgf3"):"",preload:e.preloadImage,preventLoad:!e.preloadImage})}var oO=n(26117),aO=n(52999),uO=n(71063),cO=n(4594);function lO(e){var t,n,i,o,a=null;"metadata"in e.data&&(a=e.data.metadata);var u=eO.G.isType(e.data,cO.E.Resource);return r.createElement(r.Fragment,null,r.createElement("div",{className:"OnJDH"},r.createElement("div",{className:"CIFy7"},r.createElement("div",{className:function(t){var n,r="\n d-flex flex-column align-items-center justify-content-end rounded-3 h-100\n position-relative ".concat(function(e){switch(e){case"atom-guide":return"X39wU";case"student-activity":return"X9pMl";case"teacher-pack":return"_tdVE";case"additional-materials":return"qRVUo";default:return"_18JaV"}}(t)," ").concat("oUZPD");return(null===(n=e.theme)||void 0===n?void 0:n.containerClass)?r+=" ".concat(e.theme.containerClass):r+=" pt-3 px-3",e.applyHoverState&&(r+=" ".concat("xRYhX")),r}(null==a?void 0:a.resourceType)},"above"===e.titlePosition&&r.createElement(ef.u,{title:e.data.name},r.createElement("h3",{className:"text-center text-break h5 mb-3 ".concat("g5NWS")},r.createElement("span",{className:"clamp-1"},e.data.name))),r.createElement("div",{className:"\n ".concat(null!==(n=null===(t=e.theme)||void 0===t?void 0:t.thumbnailContainerClass)&&void 0!==n?n:""," w-75 overflow-hidden \n ").concat("EDiGi"," ").concat("above"===e.titlePosition?"e9ejn":""," \n ").concat("I9E5O","\n ")},r.createElement(iO,{resource:e.data,imageCdnUrl:e.imageCdnUrl,imageErrorFallbackUrl:e.imageErrorFallbackUrl,preloadImage:e.preloadImage})),u&&e.onClickDownload&&"normal"===e.actionBehaviour&&r.createElement("div",{className:"jzGAm"},r.createElement(Xs.L,{onClick:function(t){return e.onClickDownload(t,e.data)},className:"".concat("fbb_e"," d-flex align-items-center justify-content-center")},r.createElement($s.x,{svgName:tf.vn.Download}))),!e.hideTypeBadge&&u&&r.createElement(aO.y,{typeId:cO.E.Resource})))),"below"===e.titlePosition&&r.createElement("div",{className:"mt-1 ".concat("Cpjs3")},eO.G.isType(e.data,cO.E.Resource)&&!!(null===(o=null===(i=e.data)||void 0===i?void 0:i.metadata)||void 0===o?void 0:o.resourceType)&&r.createElement(oO.m,null,function(e){switch(e){case"additional-materials":return"Additional Materials";case"atom-guide":return"ATOM Guide";case"teacher-pack":return"Teacher Pack";case"student-activity":return"Student Activity";default:return"N/A"}}(e.data.metadata.resourceType)),r.createElement("h3",{className:"h6 clamp-2"},e.data.name)))}function sO(e){return sO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sO(e)}function fO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pO(r.key),r)}}function pO(e){var t=function(e){if("object"!=sO(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=sO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sO(t)?t:t+""}function hO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hO=function(){return!!e})()}function yO(){return yO="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=vO(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},yO.apply(null,arguments)}function vO(e){return vO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vO(e)}function dO(e,t){return dO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dO(e,t)}function mO(e){return r.createElement("div",{className:"cv-resource-item"},r.createElement(lO,{data:e.resource,imageCdnUrl:e.imageCdnUrl,titlePosition:"above",hideTypeBadge:!0}))}lO.defaultProps={preloadImage:!0,actionBehaviour:"normal"},r.memo((function(e){var t,n,i,o,a=(t=e.data,n=e.actionBehaviour,o=(0,bf.k)(),"public"===n||!o.xs&&!o.sm&&"resource"===t.type&&"metadata"in t&&(t.metadata.type===$w.L.Image||(t.metadata.type===$w.L.Pdf?!!t.url:!!(null===(i=t.pdf)||void 0===i?void 0:i.url)))),u=Object.assign(Object.assign({},e.analyticsData),e.data),c=Object.assign(Object.assign({},e.analyticsOptions),{actionType:it.Vw.Click,entity:e.data.typeId===cO.E.Resource?it.py.Resource:it.py.Link});function l(){Js.k.logUserAction(u,c)}var s,f=Object.assign(Object.assign({},e),{applyHoverState:a||!!e.data.url});return r.createElement("div",{className:"px-1 flex-shrink-0 ".concat("tqUFn"," ").concat("play-page"===e.location?"V2RwX":"o7j7p"," ").concat(uO.M.RESOURCE_ITEM_SELECTOR)},(s="d-block no-decoration","link"===e.data.type?r.createElement("a",{href:e.data.url,target:"_blank",className:s,onClick:l},r.createElement(lO,Object.assign({},f))):a?"public"===e.actionBehaviour?r.createElement("div",{className:"".concat(s," cursor-pointer d-inline"),onClick:function(){l(),Qw.C$.trigger(e.getAppLink(e.data))}},r.createElement(lO,Object.assign({},f))):r.createElement(Jw.F,{appLink:e.getAppLink(e.data),className:s,analyticsData:u,analyticsOptions:c},r.createElement(lO,Object.assign({},f))):e.data.url?r.createElement("a",{href:e.data.url,className:s,onClick:l},r.createElement(lO,Object.assign({},f))):r.createElement("div",{className:s},r.createElement(lO,Object.assign({},f)))))}));var bO=Ff((function(e,t){return r.createElement(mO,Object.assign({},t))})),gO=function(e){function t(e,n){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=function(e,t,n){return t=vO(t),function(e,t){if(t&&("object"==sO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hO()?Reflect.construct(t,n||[],vO(e).constructor):t.apply(e,n))}(this,t,[e,n]);var i=new bO(e,{resource:n.resource,imageCdnUrl:n.imageCdnUrl});return r.addChild(i),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dO(e,t)}(t,e),n=t,r=[{key:"createEl",value:function(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;return(n=t,r=this,"function"==typeof(i=yO(vO(1&3?n.prototype:n),"createEl",r))?function(e){return i.apply(r,e)}:i)([e,Object.assign(Object.assign({},o),{className:"".concat(o.className," cv-resource-menu-item")}),a])}},{key:"handleClick",value:function(e){e.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}}],r&&fO(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("MenuItem"));function wO(e){return wO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wO(e)}function OO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,SO(r.key),r)}}function SO(e){var t=function(e){if("object"!=wO(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=wO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==wO(t)?t:t+""}function kO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kO=function(){return!!e})()}function NO(e,t,n,r){var i=PO(jO(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function PO(){return PO="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=jO(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},PO.apply(null,arguments)}function jO(e){return jO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jO(e)}function EO(e,t){return EO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},EO(e,t)}var CO=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=jO(t),function(e,t){if(t&&("object"==wO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,kO()?Reflect.construct(t,n||[],jO(e).constructor):t.apply(e,n))}(this,t,arguments)).alwaysCollapsed=!1,e.isCollapsed=!1,e.isCollabsible=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&EO(e,t)}(t,e),n=t,(r=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-resources-button-wrapper ".concat(NO(t,"buildWrapperCSSClass",this,3)([]))}},{key:"buildCSSClass",value:function(){return"cv-resources-button ".concat(NO(t,"buildCSSClass",this,3)([]))}},{key:"update",value:function(){NO(t,"update",this,3)([])}},{key:"createItems",value:function(){var e=this,t=[];return t.push(new j(this.player_,{label:"Resources"})),this.options_.resources.forEach((function(n){var r=new gO(e.player(),{resource:n,imageCdnUrl:e.options_.imageCdnUrl,downloadResource:function(t){return e.downloadResource(t)},label:n.name});t.push(r)})),t}},{key:"downloadResource",value:function(e){"link"!==e.type?this.getDownloadIframe().src=e.url:Qw.Ab.PageLoad(e.url,!0)}},{key:"getDownloadIframe",value:function(){return this.downloadIframe||(this.downloadIframe=i.Z.dom.createEl("iframe"),this.downloadIframe.style.display="none",i.Z.dom.appendContent(i.Z.dom.$("body"),this.downloadIframe)),this.downloadIframe}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){NO(t,"handleClick",this,3)([null])}}])&&OO(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getComponent("MenuButton"));function TO(e){return TO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},TO(e)}function _O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,xO(r.key),r)}}function xO(e){var t=function(e){if("object"!=TO(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=TO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==TO(t)?t:t+""}function LO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(LO=function(){return!!e})()}function RO(e){return RO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},RO(e)}function IO(e,t){return IO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},IO(e,t)}CO.prototype.controlText_="Resources",i.Z.registerComponent("ResourcesButton",CO);var MO=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t,n){return t=RO(t),function(e,t){if(t&&("object"==TO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,LO()?Reflect.construct(t,n||[],RO(e).constructor):t.apply(e,n))}(this,t,[e,n])).options=n,e.ready((function(){return r.onReady()})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&IO(e,t)}(t,e),n=t,(r=[{key:"onReady",value:function(){if(this.options.resources.length){var e=this.player.getChild("collapserator");e.addChild("ResourcesButton",{resources:this.options.resources,imageCdnUrl:this.options.imageCdnUrl},e.children_.length-4)}}}])&&_O(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Z.getPlugin("plugin"));i.Z.registerPlugin("resourcesPlugin",MO);var BO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function DO(e){var t=e.className,n=void 0===t?"":t,i=e.playerApi,o=e.onReady,a=e.onDispose,u=BO(e,["className","playerApi","onReady","onDispose"]),c=r.useRef(null);return r.useEffect((function(){if(c){var e=new Gm(c.current,Object.assign(Object.assign({},u),{playerApi:i}));return o&&e.ready((function(){o(function(e){return new Proxy(e,{get:function(e,t,n){if("off"===t||!e.isDisposed())return Reflect.get(e,t,n)}})}(e))})),a&&e.one("dispose",a),function(){null==e||e.dispose()}}}),[e.viewKey]),r.createElement("div",{ref:c,className:n})}},58421:()=>{}}]);