@clickview/exchange 0.29.0 → 0.30.0-rc.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 (24) hide show
  1. package/dist/bundles.json +1 -1
  2. package/dist/css/{468-exchange-0b2793ed29.chunk.css → 468-exchange-f8a9f96550.chunk.css} +1 -1
  3. package/dist/css/{53-exchange-9ccfcbced8.chunk.css → 53-exchange-d174373016.chunk.css} +1 -1
  4. package/dist/css/{813-exchange-ea3655a8c9.chunk.css → 813-exchange-29dbe6dabb.chunk.css} +1 -1
  5. package/dist/languages/en.json +1 -1
  6. package/dist/scripts/127-95224d9dfe-exchange.chunk.js +1 -0
  7. package/dist/scripts/193-502b72bfdb-exchange.chunk.js +1 -0
  8. package/dist/scripts/{236-b57ee9e8c9-exchange.chunk.js → 236-7a5c6c9d0a-exchange.chunk.js} +1 -1
  9. package/dist/scripts/457-8238630fc6-exchange.chunk.js +1 -0
  10. package/dist/scripts/{540-415a921810-exchange.chunk.js → 540-b4de36c6c8-exchange.chunk.js} +2 -2
  11. package/dist/scripts/813-5eb2d0a844-exchange.chunk.js +2 -0
  12. package/dist/scripts/{899-d571d619a3-exchange.chunk.js → 899-ec215f91c3-exchange.chunk.js} +1 -1
  13. package/dist/scripts/bundle-f7f758368a.min.js +2 -0
  14. package/package.json +1 -1
  15. package/dist/scripts/127-0a1374af6b-exchange.chunk.js +0 -1
  16. package/dist/scripts/193-4231f1ceb2-exchange.chunk.js +0 -1
  17. package/dist/scripts/457-0c219a9a18-exchange.chunk.js +0 -1
  18. package/dist/scripts/813-120f94afda-exchange.chunk.js +0 -2
  19. package/dist/scripts/bundle-918a66054e.min.js +0 -2
  20. /package/dist/scripts/{468-8de2c5cdb4-exchange.chunk.js → 468-c8eb68716b-exchange.chunk.js} +0 -0
  21. /package/dist/scripts/{53-8bf7d4cbb5-exchange.chunk.js → 53-3483739d48-exchange.chunk.js} +0 -0
  22. /package/dist/scripts/{540-415a921810-exchange.chunk.js.LICENSE.txt → 540-b4de36c6c8-exchange.chunk.js.LICENSE.txt} +0 -0
  23. /package/dist/scripts/{813-120f94afda-exchange.chunk.js.LICENSE.txt → 813-5eb2d0a844-exchange.chunk.js.LICENSE.txt} +0 -0
  24. /package/dist/scripts/{bundle-918a66054e.min.js.LICENSE.txt → bundle-f7f758368a.min.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 813-120f94afda-exchange.chunk.js.LICENSE.txt */
2
- (self.webpackChunk_clickview_exchange=self.webpackChunk_clickview_exchange||[]).push([[813],{66090:(t,e,n)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.d(e,{O:()=>o});var o={isNumber:function(t){return o.isType(t,"number")},isString:function(t){return o.isType(t,"string")},isType:function(t,e){return r(t)===e}}},16035:(t,e,n)=>{"use strict";n.d(e,{z:()=>l});var r=n(32735),o=n(23481),i=n(57408),a=n(44829),u=n(86319),c=o.T.encloseNamespace("shared.tags");function l(t){var e,n,o=t.tag,l=t.appLink,s=t.onClick,f=t.disabled,p=t.tagClass,y=void 0===p?"tag":p,h=o.name.toLowerCase(),d=null===(e=o.tagType)||void 0===e?void 0:e.toLowerCase(),v=d===a.Q.Normal&&t.themeColours&&!!(null===(n=t.themeColours)||void 0===n?void 0:n.secondary),b="rounded-pill py-1 px-2 my-1 me-1 ".concat(y," ").concat(function(t,e){switch(t){case a.Q.Pedagogy:case a.Q.Skill:return"pedagogy-tag text-white";case a.Q.Hidden:return"hidden-tag fw-normal";case a.Q.Normal:return e?"":"bg-gray-100 fw-normal";default:return""}}(d,v));v&&(b+=" text-white"),!l&&!s||f||(b+=" cursor-pointer"),f&&(b+=" "+u.Z.disabled),t.onRemove&&(b+=" "+u.Z.badge),l||(b+=" d-inline-block");var m=v?{backgroundColor:t.themeColours.secondary}:{};return l?r.createElement(i.F,{onClick:s,appLink:l,className:b,title:h,style:m},r.createElement("span",{className:"text-truncate text-nowrap"},h)):r.createElement("button",{onClick:s,className:b,title:h,style:m,"aria-label":"".concat(c("ariaFilter")," ").concat(h)},r.createElement("span",{className:"text-truncate text-nowrap"},h,t.onRemove&&r.createElement("button",{onClick:t.onRemove,className:"".concat(u.Z.close," btn-close font-size-normal"),role:"button","aria-label":"Close"})))}},44829:(t,e,n)=>{"use strict";var r,o;n.d(e,{Q:()=>r}),function(t){t.Normal="normal",t.Pedagogy="pedagogy",t.Hidden="hidden",t.Skill="skill",t.Curation="curation"}(r||(r={})),function(t){t[t.Normal=0]="Normal",t[t.Pedagogy=1]="Pedagogy",t[t.Hidden=2]="Hidden",t[t.Skill=3]="Skill",t[t.Curation=4]="Curation"}(o||(o={}))},98064:(t,e,n)=>{"use strict";n.d(e,{D:()=>u});var r=n(99940),o=n(97395),i=n(75896),a=n(62803),u={domainLibraries:function(t,e,n,r){return{url:o._.urlBuilder("/api/domain/v2/me/libraries",{type:t,maxCategoryDepth:0}),key:"libraries:".concat(t.sort().join(":")),formatData:function(t){return t.map((function(t){return t.data}))},success:e,error:n,always:r}},libraryRequestLibraries:function(){return{url:"{gateway}/v1/library-requests/libraries",key:"libraries"}},librariesWithCategories:function(){return{url:o._.urlBuilder("/api/domain/v2/me/libraries",{type:["sharedLibrary","customLibrary","unpublishedCustomLibrary"],maxCategoryDepth:5}),key:"libraries:with:categories",normalize:!1}},librariesWithOwnerLogos:function(t,e,n,r){return t.sort(),{url:o._.urlBuilder("/api/domain/v2/objects",{query:a.v.LIBRARY_COLLECTION,id:t}),key:"libraries:owner:logo:".concat(t.join(",")),success:e,error:n,always:r}},library:function(t,e,n,r){return{url:o._.urlBuilder("{gateway}/v1/objects/".concat(t),{query:a.v.LIBRARY}),key:"library:".concat(t),success:e,error:n,always:r}},exchange:function(t){return{url:o._.urlBuilder("{gateway}/v1/objects/".concat(t),{query:"categorytree"}),key:"exchange"}},streamableLearning:function(){return{url:"{gateway}/v1/streamable-learning-library",key:"streamable:learning"}},librarySubscribers:function(t,e){var n={};return e&&(n.cursor=e),{url:o._.urlBuilder("{gateway}/v1/library-requests/libraries/".concat(t,"/subscribers"),n),key:"library:subscribers:".concat(t,":").concat(e)}},libraryOwner:function(t){return{url:"{gateway}/v1/library-requests/libraries/".concat(t,"/subscribers?ownerOnly=true"),key:"library:owner:".concat(t),formatData:function(t){return i.m.first(t.data)}}},updateSubscriberPermissions:function(t,e,n,o,i){return{url:"{gateway}/v1/libraries/".concat(t,"/library-request-permissions"),key:"update:subscriber:permissions:".concat(t,":").concat(e),type:r.k.PUT,data:{customerId:e,granted:n},invalidationKeys:["library:owner:".concat(t),"library:subscribers:".concat(t)],success:o,error:i}},removeSubscriber:function(t,e,n,o){return{url:"{gateway}/v1/objects/".concat(t,"/subscribedcustomers?memberId=").concat(e),key:"revoke:subscription:".concat(t,":").concat(e),type:r.k.DELETE,invalidationKeys:["library:subscribers:".concat(t)],success:n,error:o}},folder:function(t,e,n,r){return{url:"{gateway}/v1/objects/".concat(t,"?query=banner,libraries"),key:"library:folder:".concat(t),success:e,error:n,always:r}},videoFolders:function(t){return{url:"{gateway}/v1/objects/".concat(t,"/categories?query=libraries"),key:"video:folders:".concat(t)}},folderParentTree:function(t,e,n,r){return{url:"/api/domain/v2/categories/".concat(t,"/parent-tree?includeAll=false"),key:"folder:parent:tree".concat(t),success:e,error:n,always:r}},childFolders:function(t,e,n,r,o){var i="{gateway}/v1/objects/".concat(t,"/categories?query={limit:100}thumbnail"),a="child:folders:".concat(t);return e&&(i+="&cursor=".concat(e),a+=":".concat(e)),{url:i,key:a,formatData:function(t){var e=t.data.sort((function(t,e){return t.name.toLowerCase().localeCompare(e.name.toLowerCase())}));return Object.assign(Object.assign({},t),{data:e})},success:n,error:r,always:o}},addToLibrary:function(t,e){var n=["folder","videos",t.metadata.destinationCategoryId,e].filter((function(t){return!!t})).join(":");return{url:"{gateway}/v1/library-requests",key:"add:".concat(t.objectId,":to:").concat(t.destinationLibraryId,":").concat(t.metadata.destinationCategoryId),type:r.k.POST,data:t,invalidationKeys:n}},libraries:function(){return{url:"{gateway}/v1/users/me/libraries",key:"objects:libraries"}}}},23455:(t,e,n)=>{"use strict";n.d(e,{h:()=>a});var r=n(32735),o=n(81886),i=n(20470);function a(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.useEffect((function(){e.length&&e.some(o.Q.Ry.isStatusCodeError)&&o.Q.Ry.throw(new i.x)}),e)}},45778:(t,e,n)=>{"use strict";n.d(e,{G:()=>o});var r=n(4594),o={isType:function(t,e){var n;return(null==t?void 0:t.typeId)?t.typeId===e:(null===(n=null==t?void 0:t.type)||void 0===n?void 0:n.toLowerCase())===r.E[e].toLowerCase()},isResource:function(t){return o.isType(t,r.E.Resource)},isClassification:function(t){return"Subject"===t.type}}},55215:(t,e,n)=>{"use strict";n.d(e,{a5:()=>d,cL:()=>h,lS:()=>y,Bf:()=>v});var r=n(23481),o=n(28400),i=(n(7733),n(23788)),a=n(20354),u=n(98064);function c(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return l(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):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.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var s=n(73818),f=n(82329),p=r.T.encloseNamespace("exchange.exchangeUtils");function y(t){return{application:f.O.EXCHANGE,action:s.e.Exchange.PREVIEW,args:[t.id,o.m.slugify(t.name)]}}function h(t,e){return(null==t?void 0:t.id)?{application:f.O.EXCHANGE,action:s.e.Exchange.SERIES,args:[t.id,o.m.slugify(t.name)],params:{sort:null!=e?e:i.D.Series}}:null}function d(t,e){return t?{application:f.O.EXCHANGE,action:s.e.Exchange.FOLDER,args:[t.id,o.m.slugify(t.name)],params:{sort:e}}:null}function v(t,e){return function(t){var e,n,r=t.folderId,o=t.firstItem,i=t.lastItem,l=t.getAppLink,s=a.a.useBasicFetch(u.D.folderParentTree(r));if(!(null===(n=null===(e=s.data)||void 0===e?void 0:e.children)||void 0===n?void 0:n.length))return[];for(var f=s.data.children.map((function(t){return{node:t,path:[t]}})),p=[],y=function(){var t=f.pop(),e=t.node,n=t.path;e.data.id.toString()===r.toString()&&(p=n.map((function(t){return{name:t.data.name,appLink:l(t)}}))),e.children&&f.push.apply(f,c(e.children.map((function(t){return{node:t,path:[].concat(c(n),[t])}}))))};f.length;)y();return o&&p.unshift(o),i&&p.push(i),p[p.length-1].active=!0,p}({folderId:t,getAppLink:function(t){return d(t.data,e)},firstItem:{name:p("exchangeArchive"),appLink:{application:f.O.EXCHANGE,action:s.e.Exchange.INDEX}}})}},52527:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(32735),o=n(83345);const i={adFreeBadge:"xUXHs",small:"rqFjv"};var a="tv.adFreeBadge";function u(t){return r.createElement("div",{className:"".concat(i.adFreeBadge," ").concat(t.small?i.small:""," ").concat(t.className||""," d-flex align-items-center rounded bg-red text-white fw-semibold px-1 font-size-sm")},r.createElement(o.x,{namespace:a,phrase:"adFree"}))}},89913:(t,e,n)=>{"use strict";n.d(e,{J:()=>i});var r=n(32735);const o={channelBadge:"Ud_W9",small:"A0WD4"};function i(t){return r.createElement("div",{className:"".concat(o.channelBadge," ").concat(t.small?o.small:""," ").concat(t.className||"")},r.createElement("img",{className:"h-100 align-baseline",src:t.logoUrl}))}},7022:(t,e,n)=>{"use strict";n.d(e,{B:()=>u});var r=n(32735),o=n(110),i=n(55667);const a={programTimeBadge:"Avu4L",small:"a1Wkd",hover:"fbzDz"};function u(t){var e=t.program.timeZone||t.program.region.timeZone,n=(0,i.h)(t.program.startTime,e),u=(0,i.h)(t.program.stopTime,e);return r.createElement("div",{className:"".concat(a.programTimeBadge," ").concat(t.small?"".concat(a.small," align-items-end"):"align-items-center"," ").concat(t.hover?a.hover:""," ").concat(t.className||""," d-flex bg-white text-nowrap border border-dark rounded-pill px-2")},r.createElement("span",null,t.showDate&&"".concat(o.O.format(n,"D MMM")," @ "),o.O.format(n,"hh:mma"),t.showEndTime&&" - ".concat(o.O.format(u,"hh:mma"))))}},55667:(t,e,n)=>{"use strict";n.d(e,{h:()=>i});var r=n(110),o={"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 i(t,e){return r.O.getUtcTimeByTimezone(t,"YYYY-MM-DDTHH:mm:ss",o[e])}},57264:(t,e,n)=>{"use strict";n.d(e,{$:()=>c});var r=n(32735),o=n(11607),i=n(83914),a=n(35223);const u={overlay:"Ux3Um",close:"D1Gyv",preview:"IGttc"};function c(t){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(i.x,{svgName:a.vn.VisibleOn,size:i.S.Large})),r.createElement(o.L,{className:"".concat(u.overlay," ").concat(u.close," d-flex align-items-center justify-content-center"),onClick:t.closePopup},r.createElement(i.x,{svgName:a.vn.Close,size:i.S.Large})))}},15899:(t,e,n)=>{"use strict";n.d(e,{d:()=>U});var r=n(32735),o=n(42648),i=n(78259),a=n(65858),u=n(64887),c=n(28203),l=n(17464),s=n(42029),f=n(83345),p=n(49439);const y={copyrightDisclaimer:"z8YoI",overlayContainer:"eJDbJ"};function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var d="shared.copyrightDisclaimer",v=150;function b(t){var e,n,o,i=(n=(0,p.L)({}),o=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(n,o)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}}(n,o)||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=i[0],u=i[1];return r.createElement("div",{ref:a,className:t.className},r.createElement("p",{className:"".concat(y.copyrightDisclaimer," ").concat(null!==(e=t.phraseClassName)&&void 0!==e?e:"mb-1")},r.createElement(f.x,{namespace:d,phrase:"copyrightDisclaimer"})),r.createElement(s.Z,{target:a.current,show:u,placement:t.overflowPlacement&&function(){var t;return document.documentElement.clientHeight-(null===(t=a.current)||void 0===t?void 0:t.getBoundingClientRect().bottom)<v}()?t.overflowPlacement:t.placement},r.createElement("div",{className:"".concat(y.overlayContainer," mw-100 bg-white border rounded-3 p-2")},r.createElement("p",null,r.createElement(f.x,{namespace:d,phrase:"warning"})),r.createElement("p",{className:"fw-semibold mb-0"},r.createElement(f.x,{namespace:d,phrase:"sharing"})))))}var m=n(17034),g=n(1048),w=n(66090);function O(t){return function(t){if(Array.isArray(t))return P(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return P(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):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.")}()}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function S(t){var e=t.page,n=t.totalPages,r=w.O.isNumber(e)&&e>0&&e<n&&e+1,o=w.O.isNumber(e)&&e>1&&e-1,i={};if(r&&r<=n&&(i.next=r.toString()),o&&(i.previous=o.toString()),!g.t.isEmpty(i))return i}var j={isEmpty:function(t){return t&&!(t.data&&t.data.length)},length:function(t){return t&&t.data&&t.data.length},at:function(t,e){if(t&&t.data&&t.data.length&&!(e>t.data.length))return t.data[e]},get:function(t,e){if(t&&t.data&&t.data.length)return t.data.find((function(t){return t.id&&t.id.toString()===e}))},flattenCollections:function(t){if(t&&t.length){var e=[];return t.forEach((function(t){e=[].concat(O(e),O(t.data))})),e}},getNextCursor:function(t){return t.pagination&&t.pagination.cursors&&t.pagination.cursors.next},convertLegacyPaginatedCollection:function(t){if(t)return{data:t.data,pagination:{cursors:S(t.pagination),limit:t.pagination.pageSize}}},hasData:function(t){return!j.isEmpty(t)}},k=n(23481),_=n(16035),E=n(44829),C=n(86319);function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function x(t){var e;switch(null===(e=t.tagType)||void 0===e?void 0:e.toLowerCase()){case E.Q.Pedagogy:return 0;case E.Q.Skill:return 1;default:return 2}}function L(t){if(!t.tags)return r.createElement(r.Fragment,null);var e,n=(e=t.tags,function(t){if(Array.isArray(t))return T(t)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(t,e):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.")}()).sort((function(t,e){return x(t)-x(e)}));return r.createElement("div",{className:"".concat(C.Z.tagList," ").concat(t.className)},n.map((function(e){var n="function"==typeof t.getAppLink?t.getAppLink(e):null,o="function"==typeof t.onRemove?function(){return t.onRemove(e)}:null,i="function"==typeof t.onClick?function(){return t.onClick(e)}:null;return r.createElement(_.z,{key:e.id||e.name,tag:e,appLink:n,themeColours:t.themeColours,onRemove:o,onClick:i})})))}function R(t){var e=t.label,n=t.items;if(!(n&&n.data&&n.data.length))return r.createElement(r.Fragment,null);var o=n.data.map((function(t){return t.name})).join(", ");return r.createElement("div",{className:"mb-2"},e,": ",o)}var I="exchange.detailsSection",D=k.T.encloseNamespace(I);function B(t){var e,n,o,i,a,u,c,l,s,p,y=t.video,h=t.hasPPDD,d=t.description;return r.createElement("div",{className:d?"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:I,phrase:"details"})),h&&r.createElement("div",null,r.createElement(R,{label:D("productionCompanies",{smartCount:null===(n=null===(e=y.productionCompanies)||void 0===e?void 0:e.data)||void 0===n?void 0:n.length}),items:y.productionCompanies}),r.createElement(R,{label:D("distributors",{smartCount:null===(i=null===(o=y.distributors)||void 0===o?void 0:o.data)||void 0===i?void 0:i.length}),items:y.distributors}),r.createElement(R,{label:D("producers",{smartCount:null===(u=null===(a=y.producers)||void 0===a?void 0:a.data)||void 0===u?void 0:u.length}),items:y.producers}),r.createElement(R,{label:D("directors",{smartCount:null===(l=null===(c=y.directors)||void 0===c?void 0:c.data)||void 0===l?void 0:l.length}),items:y.directors})),!!(null===(p=null===(s=y.tags)||void 0===s?void 0:s.data)||void 0===p?void 0:p.length)&&r.createElement(L,{tags:y.tags.data}))}var N=n(55215),M=n(52527),A=n(89913),F=n(7022);const Z={previewBadge:"JA0mN",previewAlert:"qFT4M"};var V="exchange.previewVideoDetails",z=200;function U(t){var e,n,s,p,y,h=t.title,d=t.description,v=t.video,g=t.videoActions,w=function(t){return!!t&&!j.isEmpty(t)},O=!!(null==v?void 0:v.series),P=!!(null===(e=null==v?void 0:v.rating)||void 0===e?void 0:e.value)||!!(null==v?void 0:v.productionYear)||t.program,S=w(null==v?void 0:v.productionCompanies)||w(null==v?void 0:v.producers)||w(null==v?void 0:v.distributors)||w(null==v?void 0:v.directors),k=!!d,_=S||!!(null===(s=null===(n=null==v?void 0:v.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||P?"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"})),!!v&&r.createElement(m.$,{type:"series",video:v,appLink:(0,N.cL)(v.series),className:"text-wrap",analyticsOptions:{location:a.LZ.PlayPage}}),r.createElement("h1",{className:"h4 mb-1 ".concat(O||P?"":"mb-0 pt-2")},r.createElement("span",{className:"align-self-center"},h))),P&&r.createElement(l.c,null,r.createElement(c.C,{type:c.g.Rating,data:null==v?void 0:v.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==v?void 0:v.productionYear,className:"".concat(Z.previewBadge," fw-semibold font-size-sm align-items-center px-1")}),(null===(p=t.program)||void 0===p?void 0:p.channelLogoUrl)&&r.createElement(A.J,{logoUrl:t.program.channelLogoUrl,className:"me-1"}),(null===(y=t.program)||void 0===y?void 0:y.hasAdsFree)&&r.createElement(M.Z,{className:"me-1"}),t.program&&r.createElement(F.B,{program:t.program,showDate:!0,showEndTime:!0}))),r.createElement("div",null,r.createElement(o.$B,{autoHeight:!0,autoHeightMax:z},r.createElement("div",{className:"row g-0"},k&&r.createElement("div",{className:_?"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:V,phrase:"description"}))),r.createElement("p",{className:"mb-2",dangerouslySetInnerHTML:{__html:i.O.linkifyText(d,{nl2br:!0})}})),_&&r.createElement(B,{video:v,hasPPDD:S,description:d}))),t.video&&r.createElement("div",{className:"row"},r.createElement("div",{className:"".concat(S?"d-md-block col-7":""," d-none")}),r.createElement("div",{className:"".concat(S?"col-md-5 ps-md-3":"ps-2 "," ")},r.createElement(b,{placement:S?"bottom-end":"bottom-start",overflowPlacement:S?"top-end":"top-start"})))))}},79279:(t,e,n)=>{"use strict";n.d(e,{L:()=>Kg});var r=n(32735),o=(n(73549),n(42612));function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,l(r.key),r)}}function c(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}function s(t,e,n){return e=h(e),function(t,e){if(e&&("object"==i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,f()?Reflect.construct(e,n||[],h(t).constructor):e.apply(t,n))}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(f=function(){return!!t})()}function p(t,e,n,r){var o=y(h(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function y(){return y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},y.apply(null,arguments)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}var b=function(t){function e(t,n){return a(this,e),s(this,e,[t,n])}return d(e,t),c(e,[{key:"handleClick",value:function(t){var n=this;p(e,"handleClick",this,3)([t]),this.requestAnimationFrame((function(){n.options_.item.showCollapsibleMenu()}))}},{key:"createEl",value:function(t,n,r){if(!this.options_.item)return p(e,"createEl",this,3)([t,n,r]);var i=this.options_.item.getCollabsibleName(),a=this.options_.item.getCollabsibleValue(),u=this.options_.item.className,c='<span class="vjs-menu-item-text">'.concat(i,"</span>");this.valueHolder_=o.Z.dom.createEl("span",{innerHTML:a});var l=p(e,"createEl",this,3)([t,{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()}}])}(o.Z.getComponent("MenuItem")),m=function(t){function e(t,n){var r;return a(this,e),(r=s(this,e,[t,n])).controlText("Settings"),r}return d(e,t),c(e,[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-cog-menu-button ".concat(p(e,"buildWrapperCSSClass",this,3)([]))}},{key:"buildCSSClass",value:function(){return"cv-cog-button ".concat(p(e,"buildCSSClass",this,3)([]))}},{key:"pressButton",value:function(){this.player_.options_.deferMenus?this.player_.deferMenusPlugin().deferMenu():(this.menu.children_.forEach((function(t){t.updateCollapsibleValue&&t.updateCollapsibleValue()})),p(e,"pressButton",this,3)([]))}},{key:"createItems",value:function(){for(var t,e=this,n=[],r=0;r<this.options_.items.length;r++){var o=this.options_.items[r];o.isCollabsible&&o.showInCollabsibleMenu()&&o.isCollapsed&&n.push(new b(this.player_,{item:o}))}return(null===(t=this.additionalItems)||void 0===t?void 0:t.length)&&this.additionalItems.forEach((function(t){var r,o=new t.ctor(e.player_,Object.assign(Object.assign({},e.options_),null!==(r=t.options)&&void 0!==r?r:{}));n.splice(t.index,0,o)})),n}},{key:"update",value:function(){p(e,"update",this,3)([]),this.player_.trigger("resizemenus")}},{key:"addItem",value:function(t){this.additionalItems||(this.additionalItems=[]),this.additionalItems.some((function(e){return e.name===t.name}))||(this.additionalItems.push(t),this.update())}}])}(o.Z.getComponent("MenuButton"));function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function w(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,O(r.key),r)}}function O(t){var e=function(t){if("object"!=g(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==g(e)?e:e+""}function P(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(P=function(){return!!t})()}function S(){return S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=j(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},S.apply(null,arguments)}function j(t){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},j(t)}function k(t,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},k(t,e)}o.Z.registerComponent("cogButton",m);var _=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=j(e),function(t,e){if(e&&("object"==g(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,P()?Reflect.construct(e,n||[],j(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&k(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(){return o.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(t){var n,r,o,i=this;(n=e,r=this,"function"==typeof(o=S(j(1&3?n.prototype:n),"handleClick",r))?function(t){return o.apply(r,t)}:o)([t]),this.options_.onClickBack?this.options_.onClickBack():this.requestAnimationFrame((function(){i.player_.getChild("collapserator").getChild("cogButton").pressButton()}))}}],r&&w(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function C(){return C="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=B(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},C.apply(null,arguments)}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,R(r.key),r)}}function L(t,e,n){return e&&x(t.prototype,e),n&&x(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function R(t){var e=function(t){if("object"!=E(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==E(e)?e:e+""}function I(t,e,n){return e=B(e),function(t,e){if(e&&("object"==E(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,D()?Reflect.construct(e,n||[],B(t).constructor):e.apply(t,n))}function D(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(D=function(){return!!t})()}function B(t){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},B(t)}function N(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&M(t,e)}function M(t,e){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},M(t,e)}var A=o.Z.getComponent("MenuItem"),F=o.Z.getComponent("MenuButton"),Z=["large","medium","small"],V=function(t){function e(t,n){return T(this,e),I(this,e,[t,n])}return N(e,t),L(e,[{key:"handleClick",value:function(){this.player_.textTrackSettings.setSizeSetting(this.options_.value)}}])}(A),z=function(t){function e(t,n){var r;return T(this,e),(r=I(this,e,[t,n])).alwaysCollapsed=!0,r.isCollapsed=!1,r.isCollabsible=!0,r.player_.ready((function(){r.update()})),r}return N(e,t),L(e,[{key:"createItems",value:function(){var t=this,e=this.player_.textTrackSettings;if(e){var n=e.getSizeSetting(),r=[new _(this.player_,{label:"Caption Text Size",onClickBack:function(){t.requestAnimationFrame((function(){t.player_.getChild("collapserator").getChild("subsCapsButton").pressButton()}))}})];return Z.map((function(e){r.push(new V(t.player_,{label:e.charAt(0).toUpperCase()+e.substring(1),selectable:!0,multiSelectable:!1,selected:e===n,value:e}))})),r}}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat((t=e,n=this,"function"==typeof(r=C(B(1&3?t.prototype:t),"buildWrapperCSSClass",n))?function(t){return r.apply(n,t)}:r)([]));var t,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);o.Z.registerComponent("SubtitleSizeButton",z);var U=n(28400);function G(t,e,n){if(t.length)for(var r=t.length-1;r>=0;r--){var o=t[r];if(o.kind===e){if(n&&o.label!==n)continue;return o}}}function q(t,e,n,r){t.kind===e&&(n&&t.label!==n||(t.loaded_?r(t):t.one("loadeddata",(function(){r(t)}))))}function H(t){if(null==t?void 0:t.cues.length)for(var e=0;e<t.cues.length;e++){var n=t.cues[e];(null==n?void 0:n.text)&&(n.text=U.m.sanitize(n.text))}}var W={getTrack:function(t,e,n){return G(t.textTracks(),e,n)},useTrack:function(t,e,n,r){var o=t.textTracks(),i=G(o,e,n);if(i)q(i,e,n,r);else{var a=function(t){q(t.track,e,n,r)};o.addEventListener("addtrack",a),t.one("dispose",(function(){o.removeEventListener("addtrack",a)}))}},getCurrentTextTrack:function(t){return this.findTrackByPredicate(t,(function(t){return"showing"===t.mode}))},findTrackByPredicate:function(t,e){if(!t)return null;for(var n=t.textTracks(),r=0;r<n.length;r++){var o=n[r];if(e(o))return o}return null},forEachTrack:function(t,e){if(t)for(var n=t.textTracks(),r=0;r<n.length;r++)e(n[r])},sanitizeTrack:function(t,e){if(t&&e)if(t.loaded)H(t);else{var n=function(){return H(t)};t.addEventListener("loadeddata",n),e.one("dispose",(function(){t.removeEventListener("loadeddata",n)}))}}},Q=function(t,e,n){var r,o=this,i=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,t.apply(this,u)};return!r&&n&&(t.apply(o,u),l=!0),i.clearTimeout(r),r=i.setTimeout(s,e),l};return a.cancel=function(){i.clearTimeout(r),r=null},a};function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function $(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function K(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,J(r.key),r)}}function X(t,e,n){return e&&K(t.prototype,e),n&&K(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function J(t){var e=function(t){if("object"!=Y(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Y(e)?e:e+""}function tt(t,e,n){return e=ot(e),function(t,e){if(e&&("object"==Y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,et()?Reflect.construct(e,n||[],ot(t).constructor):e.apply(t,n))}function et(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(et=function(){return!!t})()}function nt(t,e,n,r){var o=rt(ot(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function rt(){return rt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ot(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},rt.apply(null,arguments)}function ot(t){return ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ot(t)}function it(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&at(t,e)}function at(t,e){return at=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},at(t,e)}var ut=o.Z.getComponent("MenuItem"),ct=function(t){function e(t,n){var r;return $(this,e),(r=tt(this,e,[t,n])).onChange=Q(r.onChange,100,!1,r),r.bindEventListeners(),r}return it(e,t),X(e,[{key:"createEl",value:function(){var t=this.localize("Search");return nt(e,"createEl",this,3)(["li",{className:"vjs-menu-item ".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(t,'" type="text" autocomplete="off" spellcheck="false" aria-label="').concat(t,'" />\n </div>\n ')}])}},{key:"focus",value:function(){this.$("input").focus()}},{key:"handleClick",value:function(t){t.stopImmediatePropagation(),this.$("input").focus()}},{key:"handleKeyDown",value:function(){this.focus()}},{key:"bindEventListeners",value:function(){var t=this,e=this.$("input");this.onChange=this.onChange.bind(this),e.addEventListener("keyup",this.onChange),e.addEventListener("blur",(function(e){t.options_.menuButton.menu.handleBlur(e)}))}},{key:"onChange",value:function(t){var e=t.target;this.options_.search(e.value)}}])}(ut);o.Z.registerComponent("SearchInputMenuItem",ct);var lt=function(t){function e(){return $(this,e),tt(this,e,arguments)}return it(e,t),X(e,[{key:"createEl",value:function(t,n,r){return nt(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:"vjs-menu-item cv-no-results"}),r])}},{key:"setLabel",value:function(t){var e=this.$(".vjs-menu-item-text");e&&(e.innerHTML=t)}}])}(ut);function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function ft(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pt(r.key),r)}}function pt(t){var e=function(t){if("object"!=st(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=st(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==st(e)?e:e+""}function yt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yt=function(){return!!t})()}function ht(t){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ht(t)}function dt(t,e){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dt(t,e)}o.Z.registerComponent("NoMatchingResultsMenuItem",lt);var vt=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=ht(e),function(t,e){if(e&&("object"==st(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,yt()?Reflect.construct(e,n||[],ht(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dt(t,e)}(e,t),n=e,(r=[{key:"update",value:function(t,e){var n=this;if(null==t?void 0:t.length){var r=[],o=0;t.forEach((function(t){var i=n.options_.label.substr(o,t);i&&r.push(i),r.push('<span class="cv-highlight">'),r.push(n.options_.label.substr(t,e)),r.push("</span>"),o=t+e})),r.push(this.options_.label.substring(o,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(t){t.stopImmediatePropagation(),this.player_.currentTime(this.options_.cue.startTime)}}])&&ft(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function bt(t){return bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bt(t)}function mt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gt(r.key),r)}}function gt(t){var e=function(t){if("object"!=bt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bt(e)?e:e+""}function wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wt=function(){return!!t})()}function Ot(t,e,n,r){var o=Pt(St(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Pt(){return Pt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=St(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Pt.apply(null,arguments)}function St(t){return St=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},St(t)}function jt(t,e){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jt(t,e)}var kt=o.Z.getComponent("MenuButton"),_t=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=St(e),function(t,e){if(e&&("object"==bt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wt()?Reflect.construct(e,n||[],St(t).constructor):e.apply(t,n))}(this,e,[t,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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jt(t,e)}(e,t),n=e,(r=[{key:"bindTrackEvents",value:function(t){var e=this;t.removeEventListener("loadeddata",this.update),t.addEventListener("loadeddata",this.update),this.player_.one("dispose",(function(){t.removeEventListener("loadeddata",e.update)}))}},{key:"createItems",value:function(){var t,e=W.getCurrentTextTrack(this.player_);if(e){if(null===(t=e.cues)||void 0===t?void 0:t.length){for(var n=[new ct(this.player_,{menuButton:this,search:this.search})],r=0;r<e.cues.length;r++){var o=e.cues[r];n.push(new vt(this.player_,{cue:o,label:o.text,selected:!1,multiSelectable:!1}))}var i=new lt(this.player_,{label:"No matching results",selected:!1,selectable:!1,multiSelectable:!1});return i.hide(),n.push(i),n}this.bindTrackEvents(e)}}},{key:"search",value:function(t){var e;t=t.trim();var n=W.getCurrentTextTrack(this.player_);if(null===(e=null==n?void 0:n.cues)||void 0===e?void 0:e.length){var r=this.findMatches(t,n);this.toggleItemVisibility(t,r),this.toggleNoResults(t,r)}}},{key:"findMatches",value:function(t,e){var n={};if(!t)return n;for(var r=new RegExp(t,"gi"),o=0;o<e.cues.length;o++){for(var i=e.cues[o].text,a=[],u=void 0;u=r.exec(i);)a.push(u.index);a.length&&(n[o]=a)}return n}},{key:"toggleItemVisibility",value:function(t,e){this.menu.children_.slice(1,this.menu.children_.length-1).forEach((function(n,r){!t||e[r]?n.show():n.hide(),n.update(e[r],t.length)}))}},{key:"toggleNoResults",value:function(t,e){var n=this.menu.children_[this.menu.children_.length-1];!t||Object.keys(e).length?n.hide():n.show()}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-big cv-subtitle-search-button ".concat(Ot(e,"buildWrapperCSSClass",this,3)([]))}},{key:"update",value:function(){Ot(e,"update",this,3)([]),this.player_.trigger("resizemenus")}},{key:"pressButton",value:function(){Ot(e,"pressButton",this,3)([]);var t=this.menu.children_[0];(null==t?void 0:t.focus)&&(null==t||t.focus())}},{key:"getCollabsibleName",value:function(){return"Subtitle Size"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!1}},{key:"showCollapsibleMenu",value:function(){kt.prototype.handleClick.apply(this)}}])&&mt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(kt);function Et(t){return Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(t)}function Ct(){return Ct="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Bt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ct.apply(null,arguments)}function Tt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Rt(r.key),r)}}function Lt(t,e,n){return e&&xt(t.prototype,e),n&&xt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rt(t){var e=function(t){if("object"!=Et(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Et(e)?e:e+""}function It(t,e,n){return e=Bt(e),function(t,e){if(e&&("object"==Et(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Dt()?Reflect.construct(e,n||[],Bt(t).constructor):e.apply(t,n))}function Dt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Dt=function(){return!!t})()}function Bt(t){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bt(t)}function Nt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mt(t,e)}function Mt(t,e){return Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mt(t,e)}o.Z.registerComponent("subtitleSearchButton",_t);var At=o.Z.getComponent("MenuItem"),Ft=o.Z.getComponent("MenuButton"),Zt=[{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"}],Vt=function(t){function e(t,n){return Tt(this,e),It(this,e,[t,n])}return Nt(e,t),Lt(e,[{key:"createEl",value:function(){return o.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(t){switch(t){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>'}return""}}])}(At),zt=function(t){function e(){var t;return Tt(this,e),(t=It(this,e,arguments)).alwaysCollapsed=!0,t.isCollapsed=!1,t.isCollabsible=!0,t}return Nt(e,t),Lt(e,[{key:"createItems",value:function(){var t=this,e=[];return e.push(new _(this.player_,{label:"Keyboard Shortcuts"})),Zt.forEach((function(n){e.push(new Vt(t.player_,n))})),e}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-keyboard-shortcuts ".concat((t=e,n=this,"function"==typeof(r=Ct(Bt(1&3?t.prototype:t),"buildWrapperCSSClass",n))?function(t){return r.apply(n,t)}:r)([]));var t,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(){Ft.prototype.handleClick.apply(this)}}])}(Ft);function Ut(t){return Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ut(t)}function Gt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qt(r.key),r)}}function qt(t){var e=function(t){if("object"!=Ut(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ut(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ut(e)?e:e+""}function Ht(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ht=function(){return!!t})()}function Wt(t,e,n,r){var o=Qt(Yt(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Qt(){return Qt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Yt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Qt.apply(null,arguments)}function Yt(t){return Yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yt(t)}function $t(t,e){return $t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$t(t,e)}o.Z.registerComponent("KeyboardShortcutsButton",zt);var Kt="cv-collapsed",Xt=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Yt(e),function(t,e){if(e&&("object"==Ut(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ht()?Reflect.construct(e,n||[],Yt(t).constructor):e.apply(t,n))}(this,e,[t,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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$t(t,e)}(e,t),n=e,(r=[{key:"toggleHidden",value:function(t){for(var e=0;e<this.children_.length;e++){var n=this.children_[e];n.isCollabsible&&(n.alwaysCollapsed||t?(n.isCollapsed=!0,n.addClass(Kt)):(n.isCollapsed=!1,n.removeClass(Kt)))}this.getChild("cogButton").update()}},{key:"update",value:function(){var t=this.player_.isFullscreen(),e=this.player_.whiteboardModePlugin().side,n=this.player_.el().getBoundingClientRect(),r=!t||"left"!==e&&"right"!==e?n.width:n.height;if(r){this.addClass("cv-collapsorator-ready");var o=r<(!t||"left"!==e&&"right"!==e&&"top"!==e?600:1200);this.player_.options_.deferMenus&&(o=!0),this.toggleHidden(o)}}},{key:"buildCSSClass",value:function(){return"cv-collapsorator ".concat(Wt(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return Wt(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}}])&&Gt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));o.Z.registerComponent("collapserator",Xt);var Jt=["playToggle","volumePanel","customControlSpacer","playbackRateMenuButton","chaptersButton","qualityButton","keyboardShortcutsButton","subsCapsButton","whiteboardModeButton","subtitleSizeButton","subtitleSearchButton","fullscreenToggle"],te=n(57900),ee=n(52881),ne=n(65858),re=n(50873);function oe(t){return oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oe(t)}function ie(){ie=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==oe(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(oe(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function ae(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ue(r.key),r)}}function ue(t){var e=function(t){if("object"!=oe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oe(e)?e:e+""}var ce=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.initialize()},(e=[{key:"logStream",value:function(){var t="v:".concat(this.options.videoId);te.SG.cacheExists(t)||(this.collectionApiClient.log({type:ne.Vw.WebPlayerStream,actionContext:this.getActionContext(),data:this.getAnalyticsData(),eventVersion:ne.eq.V3}),te.SG&&te.SG.cacheSet(t,null,300))}},{key:"logVideoProgress",value:function(t){var e=this,n=this.getAnalyticsData();this.collectionApiClient.log(t.map((function(t){return{type:ne.Vw.StreamProgress,actionContext:e.getActionContext(),data:Object.assign(Object.assign({},n),{progress:t}),eventVersion:ne.eq.V2}})))}},{key:"logUserAction",value:function(t,e){var n=Object.assign(Object.assign({},this.getAnalyticsData()),t),r=Object.assign(Object.assign({},this.getActionContext()),e);this.collectionApiClient.log({type:e.actionType,data:n,actionContext:r,eventVersion:e.eventVersion||ne.eq.V2})}},{key:"getAnalyticsData",value:function(){var t=Object.assign({video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache}},this.options.additionalAnalyticsData||{});this.options.shareId&&(t.video.shareId=this.options.shareId);var e=this.getEntityType();return e===ne.py.Interactive?t.interactive={id:+this.options.mediaId}:e===ne.py.Clip&&(t.clip={id:+this.options.mediaId}),t}},{key:"initialize",value:function(){this.setupCollectionApiClient()}},{key:"setupCollectionApiClient",value:function(){var t=this;this.collectionApiClient=new ee.q({productName:"player.web",productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:function(){return t.getCurrentUser()},shouldLog:re.k.shouldLog,formatData:re.k.formatData})}},{key:"getCurrentUser",value:function(){return t=this,e=void 0,n=void 0,r=ie().mark((function t(){return ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{id:this.options.userId,customerId:this.options.customerId});case 1:case"end":return t.stop()}}),t,this)})),new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}},{key:"getActionContext",value:function(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?ne.MC.Embedded:void 0,workflowPhase:void 0}}},{key:"getEntityType",value:function(){switch(this.options.mediaType){case"MasterVideo":return ne.py.Video;case"MasterInteractive":return ne.py.Interactive;case"MasterClip":return ne.py.Clip}}},{key:"getLocationContext",value:function(){switch(this.options.playerType){case"player":return ne.LZ.Player;case"interactive-player":return ne.LZ.InteractivePlayer;case"create-clip-player":return ne.LZ.CreateClipPlayer}}}])&&ae(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function le(t){return le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},le(t)}function se(t){var e="function"==typeof Map?new Map:void 0;return se=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(fe())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&pe(o,n.prototype),o}(t,arguments,ye(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),pe(n,t)},se(t)}function fe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(fe=function(){return!!t})()}function pe(t,e){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pe(t,e)}function ye(t){return ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ye(t)}var he=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=ye(e),function(t,e){if(e&&("object"==le(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,fe()?Reflect.construct(e,n||[],ye(t).constructor):e.apply(t,n))}(this,e,[(null==n?void 0:n.title)||"Ajax error"])).url=t,r.response=n,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pe(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(se(Error));function de(t){return de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},de(t)}function ve(){ve=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==de(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(de(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function be(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,me(r.key),r)}}function me(t){var e=function(t){if("object"!=de(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=de(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==de(e)?e:e+""}var ge=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},we=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.tokens={gateway:null}},e=[{key:"get",value:function(t,e){return ge(this,void 0,void 0,ve().mark((function n(){return ve().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.t0=this,n.next=3,fetch(t,{method:"GET",mode:"cors",headers:this.getHeaders(e)});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(t,e){return ge(this,void 0,void 0,ve().mark((function n(){return ve().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,fetch(t,{method:"DELETE",headers:this.getHeaders(e)});case 2:case"end":return n.stop()}}),n,this)})))}},{key:"post",value:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return ge(this,void 0,void 0,ve().mark((function o(){var i;return ve().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,fetch(t,{method:"POST",headers:this.getHeaders(n),body:e,mode:"cors"});case 2:if(i=o.sent,!r){o.next=7;break}return o.next=6,this.parseResponse(i);case 6:return o.abrupt("return",o.sent);case 7:case"end":return o.stop()}}),o,this)})))}},{key:"put",value:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return ge(this,void 0,void 0,ve().mark((function o(){var i;return ve().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,fetch(t,{method:"PUT",headers:this.getHeaders(n),body:e,mode:"cors"});case 2:if(i=o.sent,!r){o.next=7;break}return o.next=6,this.parseResponse(i);case 6:return o.abrupt("return",o.sent);case 7:case"end":return o.stop()}}),o,this)})))}},{key:"setToken",value:function(t,e){this.tokens[t]=e}},{key:"getHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={"Content-Type":"application/json"};return this.tokens[t.tokenName]&&(e.authorization="Bearer ".concat(this.tokens[t.tokenName])),e}},{key:"parseResponse",value:function(t){return ge(this,void 0,void 0,ve().mark((function e(){var n,r;return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(404!==t.status){e.next=2;break}return e.abrupt("return",null);case 2:if(t.ok){e.next=15;break}return e.prev=3,e.next=6,t.json();case 6:n=e.sent,e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(3),new he(t.url);case 12:throw e.prev=12,new he(t.url,n);case 15:return e.next=17,t.json();case 17:return r=e.sent,e.abrupt("return",r);case 19:case"end":return e.stop()}}),e,null,[[3,9,12,15]])})))}}],e&&be(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}()),Oe=n(19389),Pe=n.n(Oe);function Se(t){return Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(t)}function je(t,e,n){return(e=function(t){var e=function(t){if("object"!=Se(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Se(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ke(t){t.paused()?t.play():t.pause()}function _e(t,e){t.currentTime(t.currentTime()+e)}function Ee(t,e){t.volume(t.volume()+e)}var Ce,Te=je(je(je(je(je(je(je(je(je(je({},"f",(function(t){document[t.fsApi_.fullscreenEnabled]&&(t.isFullscreen()?t.exitFullscreen():t.requestFullscreen())})),"m",(function(t){var e=t.volume(),n=t.lastVolume_();if(0===e){var r=n<.1?.1:n;t.volume(r),t.muted(!1)}else t.muted(!t.muted())})),"k",ke),"space",ke),"left",(function(t){return _e(t,-5)})),"right",(function(t){return _e(t,5)})),"j",(function(t){return _e(t,-10)})),"l",(function(t){return _e(t,10)})),"up",(function(t){return Ee(t,.05)})),"down",(function(t){return Ee(t,-.05)}));!function(t){t.PhysicallyChapteredVideo="physically-chaptered-video"}(Ce||(Ce={}));var xe=n(83765);function Le(t){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(t)}function Re(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ie(r.key),r)}}function Ie(t){var e=function(t){if("object"!=Le(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Le(e)?e:e+""}function De(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(De=function(){return!!t})()}function Be(){return Be="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ne(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Be.apply(null,arguments)}function Ne(t){return Ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ne(t)}function Me(t,e){return Me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Me(t,e)}n(52002);var Ae=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Ne(e),function(t,e){if(e&&("object"==Le(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,De()?Reflect.construct(e,n||[],Ne(t).constructor):e.apply(t,n))}(this,e,[t])).options=n,r.configureMenuDimensions=r.configureMenuDimensions.bind(r),r.initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Me(t,e)}(e,t),n=e,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 t,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),(t=e,n=this,"function"==typeof(r=Be(Ne(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"configureMenuDimensions",value:function(){var t=this,e=function(e){if(!t.options.mobile){var n=t.player.getChild("collapserator"),r=n.getChild("volumePanel"),o=n.children_.indexOf(r);n.removeChild(r),n.addChild("volumePanel",{inline:e},o),t.player.trigger("volumechange")}},n=this.player.isFullscreen();if(n&&!this.options.mobile){var r=this.player.whiteboardModePlugin().side;if(e("top"!==r),"left"===r||"right"===r||"top"===r){var o=this.player.currentWidth();return void this.player.el().querySelectorAll(".vjs-menu").forEach((function(t){t.style.paddingTop=null,t.style.marginBottom=null,t.style.width="calc(".concat(o,"px - 4em)")}))}}n||e(!0);var i=this.player.currentWidth(),a=this.player.currentHeight()/i*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(e){!n&&t.options.overflowControls?e.style.paddingTop="80%":e.style.paddingTop="calc(".concat(a,"% - ").concat(l,"px)"),e.style.marginBottom="".concat(l,"px"),e.style.width=null,e.querySelector(".vjs-menu-content")&&(i<=450?t.player.addClass("cv-player-small"):t.player.removeClass("cv-player-small"))}))):this.player.one("play",this.configureMenuDimensions)}}],r&&Re(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("configureMenuDimensionsPlugin",Ae);var Fe="cv-persisttest",Ze=function(){try{return window.localStorage.setItem(Fe,"cv-player-storage-test"),window.localStorage.removeItem(Fe),!0}catch(t){return!1}},Ve=function(t){return window.localStorage.getItem(t)},ze=function(t,e){window.localStorage.setItem(t,e)};function Ue(t){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(t)}function Ge(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qe(r.key),r)}}function qe(t){var e=function(t){if("object"!=Ue(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ue(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ue(e)?e:e+""}function He(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(He=function(){return!!t})()}function We(){return We="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Qe(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},We.apply(null,arguments)}function Qe(t){return Qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qe(t)}function Ye(t,e){return Ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ye(t,e)}var $e=o.Z.getPlugin("plugin"),Ke="cvplayer-volume",Xe="cvplayer-mute",Je=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Qe(e),function(t,e){if(e&&("object"==Ue(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,He()?Reflect.construct(e,n||[],Qe(t).constructor):e.apply(t,n))}(this,e,[t])).enabled=!0,n.player.ready((function(){return n.initialize()})),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ye(t,e)}(e,t),n=e,r=[{key:"initialize",value:function(){this.player.options_.mobile?this.removeVolumeControl():Ze()&&(this.saveVolumeState=this.saveVolumeState.bind(this),this.player.on("volumechange",this.saveVolumeState),this.applyUserPreferences())}},{key:"applyUserPreferences",value:function(){var t=Ve(Ke),e=Ve(Xe);t&&this.player.volume(+t),e&&this.player.muted("true"===e)}},{key:"saveVolumeState",value:function(){this.enabled&&(ze(Ke,this.player.volume().toString()),ze(Xe,this.player.muted().toString()))}},{key:"removeVolumeControl",value:function(){this.player.volume(1);var t=this.player.getChild("collapserator"),e=t.getChild("volumePanel");t.removeChild(e)}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1}},{key:"dispose",value:function(){var t,n,r;this.player.off("volumechange",this.saveVolumeState),(t=e,n=this,"function"==typeof(r=We(Qe(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}}],r&&Ge(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}($e);function tn(t){return tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tn(t)}function en(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nn(r.key),r)}}function nn(t){var e=function(t){if("object"!=tn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tn(e)?e:e+""}function rn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(rn=function(){return!!t})()}function on(t){return on=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},on(t)}function an(t,e){return an=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},an(t,e)}o.Z.registerPlugin("persistVolumePlugin",Je);var un=o.Z.getPlugin("plugin"),cn="cvplayer-playback-rate",ln=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=on(e),function(t,e){if(e&&("object"==tn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,rn()?Reflect.construct(e,n||[],on(t).constructor):e.apply(t,n))}(this,e,[t])).options=n,r.player.dataLoaded((function(){return r.initialize()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&an(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){var t,e=this;if(Ze()){this.savePlaybackRate=this.savePlaybackRate.bind(this),this.player.on("ratechange",this.savePlaybackRate),this.one("dispose",(function(){e.player.off("ratechange",e.savePlaybackRate)}));var n=+Ve(cn);(null===(t=this.player.options_.playbackRates)||void 0===t?void 0:t.some((function(t){return t===n})))&&this.player.playbackRate(n)}}},{key:"savePlaybackRate",value:function(){var t,e=this.player.playbackRate().toString();ze(cn,e),null===(t=this.options.analyticsService)||void 0===t||t.logUserAction({rate:e},{actionType:ne.Vw.Select,workflowPhase:ne.eu.Complete,descriptor:ne.UX.ChangeSpeed,entity:ne.py.PlaybackSpeed,eventVersion:ne.eq.V3})}}])&&en(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(un);function sn(t){return sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sn(t)}function fn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pn(r.key),r)}}function pn(t){var e=function(t){if("object"!=sn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=sn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sn(e)?e:e+""}function yn(t,e){if(e&&("object"==sn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function hn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(hn=function(){return!!t})()}function dn(t){return dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dn(t)}function vn(t,e){return vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vn(t,e)}o.Z.registerPlugin("persistPlaybackRatePlugin",ln);var bn=function(t){function e(t){var n,r,o,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=this,i=[t],o=dn(o=e),(n=yn(r,hn()?Reflect.construct(o,i||[],dn(r).constructor):o.apply(r,i))).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):yn(n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vn(t,e)}(e,t),n=e,(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 t=this.getAngle();90===t||-90===t||270===t?(this.player.requestFullscreen(),this.fullscreenBecauseOfRotate=!0):this.fullscreenBecauseOfRotate&&this.player.isFullscreen()&&this.player.exitFullscreen()}},{key:"getAngle",value:function(){var t,e;return"number"==typeof(null===(e=null===(t=window.screen)||void 0===t?void 0:t.orientation)||void 0===e?void 0:e.angle)?window.screen.orientation.angle:0}}])&&fn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("fullscreenOnRotatePlugin",bn);var mn="\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 gn(t){return gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gn(t)}function wn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,On(r.key),r)}}function On(t){var e=function(t){if("object"!=gn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=gn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gn(e)?e:e+""}function Pn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Pn=function(){return!!t})()}function Sn(t){return Sn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sn(t)}function jn(t,e){return jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jn(t,e)}var kn=function(t){function e(t,n){var r,o,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Sn(e),function(t,e){if(e&&("object"==gn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Pn()?Reflect.construct(e,n||[],Sn(t).constructor):e.apply(t,n))}(this,e,[t,n])).update=(o=r.update.bind(r),i=window.performance.now(),function(){var t=window.performance.now();t-i>=1e3&&(o.apply(void 0,arguments),i=t)}),t.on("timeupdate",r.update),t.one("dispose",(function(){t.off("timeupdate",r.update),r.el_.removeEventListener("click",r.pause)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jn(t,e)}(e,t),n=e,(r=[{key:"update",value:function(){var t=this.player_.currentTime();this.el_.href=this.options_.getExternalLink({currentTime:Math.round(t)})}},{key:"buildCSSClass",value:function(){return"cv-open-externally-button"}},{key:"createEl",value:function(){var t={innerHTML:mn,className:this.buildCSSClass()},e={type:"button",href:this.options_.getExternalLink({currentTime:0}),target:"_blank"},n=o.Z.dom.createEl("a",t,e);return this.createControlTextEl(n),n.addEventListener("click",this.pause.bind(this)),n}},{key:"pause",value:function(){this.player_.pause()}}])&&wn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Button"));function _n(t){return _n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_n(t)}function En(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Cn(r.key),r)}}function Cn(t){var e=function(t){if("object"!=_n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=_n(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_n(e)?e:e+""}function Tn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Tn=function(){return!!t})()}function xn(t){return xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xn(t)}function Ln(t,e){return Ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ln(t,e)}kn.prototype.controlText_="Open in ClickView",o.Z.registerComponent("OpenExternallyButton",kn);var Rn=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=xn(e),function(t,e){if(e&&("object"==_n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Tn()?Reflect.construct(e,n||[],xn(t).constructor):e.apply(t,n))}(this,e,[t,n])).options=n,t.ready((function(){return r.onReady()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ln(t,e)}(e,t),n=e,(r=[{key:"onReady",value:function(){var t=this.player.getChild("collapserator"),e=t.getChild("customControlSpacer"),n=t.children_.indexOf(e);t.addChild("OpenExternallyButton",{getExternalLink:this.options.getExternalLink},n+1)}}])&&En(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function In(t){return In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},In(t)}function Dn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bn(r.key),r)}}function Bn(t){var e=function(t){if("object"!=In(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=In(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==In(e)?e:e+""}function Nn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Nn=function(){return!!t})()}function Mn(t,e,n,r){var o=An(Fn(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function An(){return An="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Fn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},An.apply(null,arguments)}function Fn(t){return Fn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fn(t)}function Zn(t,e){return Zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zn(t,e)}o.Z.registerPlugin("openExternallyPlugin",Rn);var Vn=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Fn(e),function(t,e){if(e&&("object"==In(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Nn()?Reflect.construct(e,n||[],Fn(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zn(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-touch-control-ui ".concat(Mn(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return Mn(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"setUi",value:function(t,e){var n=this,r=t>0,o=r?"cv-touch-right":"cv-touch-left";this.el_.className=this.buildCSSClass()+" cv-ui-touch-active",this.el_.innerHTML="\n <div class='".concat(o,"'>\n <div class='cv-touch-text'>\n ").concat(r?"+":"").concat(10*t,"s\n </div>\n </div>\n "),window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){n.removeText()}),e)}},{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}(o.Z.getComponent("component"));function zn(t){return zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zn(t)}function Un(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Gn(r.key),r)}}function Gn(t){var e=function(t){if("object"!=zn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zn(e)?e:e+""}function qn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qn=function(){return!!t})()}function Hn(){return Hn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Wn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Hn.apply(null,arguments)}function Wn(t){return Wn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wn(t)}function Qn(t,e){return Qn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qn(t,e)}o.Z.registerComponent("TouchControls",Vn);var Yn=o.Z.getPlugin("plugin"),$n=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Wn(e),function(t,e){if(e&&("object"==zn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qn()?Reflect.construct(e,n||[],Wn(t).constructor):e.apply(t,n))}(this,e,[t])).doubleTouchCount=0,n.seekStartTime=0,n.directionModifier=0,n.bindFunctions(),n.player.ready((function(){return n.initialize()})),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qn(t,e)}(e,t),n=e,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 t=this;this.player.addChild("TouchControls"),this.touchControls=this.player.getChild("TouchControls"),this.player.on("ready",this.reBindEventListeners),this.one("dispose",(function(){t.player.off("ready",t.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 t,n,r;(t=e,n=this,"function"==typeof(r=Hn(Wn(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([]),this.unBindEventListeners()}},{key:"onTouchStart",value:function(t){this.touchStartTime=t.timeStamp,this.userActive=this.player.userActive()}},{key:"onTouchEnd",value:function(t){var e=this;if(t.changedTouches.length){if(t.timeStamp-this.lastTouchTime<300)return this.onDoubleTouch(t),void(this.lastTouchTime=t.timeStamp);this.resetProperties(),this.lastTouchTime=t.timeStamp,t.timeStamp-this.touchStartTime<300&&window.setTimeout((function(){e.doubleTouchCount||(e.player.paused()?e.player.play():e.userActive&&e.player.pause())}),300)}}},{key:"resetProperties",value:function(){this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0}},{key:"onDoubleTouch",value:function(t){var e=this.player.el().getBoundingClientRect(),n=e.left+e.width/2;if(0===this.doubleTouchCount&&(this.seekStartTime=this.player.currentTime(),t.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&&Un(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Yn);function Kn(t){return Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kn(t)}function Xn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jn(r.key),r)}}function Jn(t){var e=function(t){if("object"!=Kn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Kn(e)?e:e+""}o.Z.registerPlugin("touchControls",$n);var tr=function(){return t=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=n.id,this.plugin=e,this.source=n,this.enabled=this.enabled.bind(this)},(e=[{key:"enabled",value:function(t){return void 0===t?this.plugin.currentSource===this.source:(t&&this.plugin.setSource(this.source.id),t)}}])&&Xn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function er(t){return er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},er(t)}function nr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rr(r.key),r)}}function rr(t){var e=function(t){if("object"!=er(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=er(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==er(e)?e:e+""}function or(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(or=function(){return!!t})()}function ir(t){return ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ir(t)}function ar(t,e){return ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ar(t,e)}var ur=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=ir(e),function(t,e){if(e&&("object"==er(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,or()?Reflect.construct(e,n||[],ir(t).constructor):e.apply(t,n))}(this,e,[t])).options_=n,r.player.ready((function(){return r.initialize()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ar(t,e)}(e,t),n=e,r=[{key:"initialize",value:function(){var t=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(){t.qualityLevels.off("change",t.onQualityChange)}))}},{key:"currentSource",get:function(){return this._currentSource}},{key:"onQualityChange",value:function(){var t=this.qualityLevels[this.qualityLevels.selectedIndex];this.player.trigger("cv-quality-change",t.id)}},{key:"setSource",value:function(t){var e=this,n=this.getSourceById(t);if(null===n)return this.currentSource;var r=this.player.currentTime(),o=!this.player.paused();this._currentSource=n;var i=this.player.playbackRate();return this.player.src({src:n.url,type:n.mimeType}),this.player.one("loadedmetadata",(function(){e.player.playbackRate(i),e.player.currentTime()!==r&&e.player.currentTime(r),o&&e.player.play()})),this.trigger({event:"sourcechange",source:n}),this.sourceChangeUpdateQualityLevels(n),n}},{key:"getSourceById",value:function(t){return this.sources.find((function(e){return e.id===t}))}},{key:"repopulateSources",value:function(t){for(var e=null;this.qualityLevels.length;)this.qualityLevels[0].enabled&&(e=this.qualityLevels[0].id),this.qualityLevels.removeQualityLevel(this.qualityLevels[0]);this.sources=[],this.populateSources(t,e)}},{key:"sortSources",value:function(t){return t.sort((function(t,e){return t.id===e.id?0:+t.id>+e.id?-1:1}))}},{key:"populateSources",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=null;(t=this.sortSources(t)).forEach((function(t){e.qualityLevels.addQualityLevel(new tr(e,t)),e.sources.push(t),e.trigger({event:"addsource",source:t}),null===n?t.default&&(r=t):t.id===n&&(r=t)})),null===r&&(r=this.sources[0]),null!==r&&this.setSource(r.id)}},{key:"sourceChangeUpdateQualityLevels",value:function(t){for(var e=this.qualityLevels,n=-1,r=0;r<e.length;r++)if(e[r].id===t.id){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})}}],r&&nr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function cr(t){return cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(t)}function lr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,sr(r.key),r)}}function sr(t){var e=function(t){if("object"!=cr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=cr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cr(e)?e:e+""}o.Z.registerPlugin("progressiveFiles",ur);var fr=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"getKnownProfiles",value:function(){return["1080","720","480","360","240"]}},{key:"enableProfileOrNextBest",value:function(t,e){var n=t.getQualityLevelById(e);if(n||(n=this.getNextBestQuality(t,e)),!n)return null;for(var r=0;r<t.length;r++){var o=t[r];o.enabled=n.id===o.id}return n}},{key:"getNextBestQuality",value:function(t,e){var n=this.getKnownProfiles(),r=n.indexOf(e);if(r>=0){for(var o=r+1;o<n.length;o++){var i=n[o],a=t.getQualityLevelById(i);if(a)return a}for(var u=r-1;u>0;u--){var c=n[u],l=t.getQualityLevelById(c);if(l)return l}}return null}}],null&&lr(t.prototype,null),e&&lr(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function pr(t){return pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pr(t)}function yr(){yr=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==pr(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(pr(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function hr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,dr(r.key),r)}}function dr(t){var e=function(t){if("object"!=pr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pr(e)?e:e+""}var vr=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e.name,this.playbackProfile=e.playbackProfile,this.address=new URL(e.httpsAddress)},(e=[{key:"getUrl",value:function(t){return t?this.address+"cache?file="+encodeURIComponent(t):null}},{key:"ping",value:function(){return t=this,e=void 0,n=void 0,r=yr().mark((function t(){var e,n,r,o;return yr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new AbortController,n=setTimeout((function(){return e.abort()}),1e3),t.prev=3,t.next=6,fetch(this.address+"ping",{method:"GET",mode:"cors",signal:e.signal});case 6:return r=t.sent,t.next=9,r.text();case 9:return o=t.sent,clearTimeout(n),t.abrupt("return","PONG"===o);case 14:return t.prev=14,t.t0=t.catch(3),t.abrupt("return",!1);case 17:case"end":return t.stop()}}),t,this,[[3,14]])})),new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}}])&&hr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function br(t){return br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},br(t)}function mr(){mr=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==br(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(br(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function gr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wr(r.key),r)}}function wr(t){var e=function(t){if("object"!=br(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=br(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==br(e)?e:e+""}var Or=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.player=e,this.logger=o.Z.log.createLogger("localcache")},(e=[{key:"setSource",value:function(t,e){return n=this,r=void 0,o=void 0,i=mr().mark((function n(){var r;return mr().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.player.localCache||void 0===(null==t?void 0:t.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),t.src=r.getUrl(t.src));case 5:e(null,t);case 6:case"end":return n.stop()}}),n,this)})),new(o||(o=Promise))((function(t,e){function a(t){try{c(i.next(t))}catch(t){e(t)}}function u(t){try{c(i.throw(t))}catch(t){e(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(a,u)}c((i=i.apply(n,r||[])).next())}));var n,r,o,i}}])&&gr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Pr(t){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(t)}function Sr(){Sr=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Pr(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Pr(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function jr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,kr(r.key),r)}}function kr(t){var e=function(t){if("object"!=Pr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pr(e)?e:e+""}function _r(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_r=function(){return!!t})()}function Er(){return Er="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Cr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Er.apply(null,arguments)}function Cr(t){return Cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Cr(t)}function Tr(t,e){return Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tr(t,e)}o.Z.use("*",(function(t){return new Or(t)}));var xr='<?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>',Lr=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Cr(e),function(t,e){if(e&&("object"==Pr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,_r()?Reflect.construct(e,n||[],Cr(t).constructor):e.apply(t,n))}(this,e,[t,n])).hide(),r.onLocalCacheChange=r.onLocalCacheChange.bind(r),t.ready((function(){r.initialize()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tr(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(){return(t=e,n=this,"function"==typeof(r=Er(Cr(1&3?t.prototype:t),"createEl",n))?function(t){return r.apply(n,t)}:r)(["div",{className:"vjs-local-cache-indicator",innerHTML:'<div class="vjs-local-cache-indicator-icon">'.concat(xr,"</div>"),title:"Streaming from ClickView Local Cache"}]);var t,n,r}},{key:"initialize",value:function(){var t=this;this.localCachePlugin=this.player_.localCache(),this.localCachePlugin&&(this.localCachePlugin.on("localcachechanged",this.onLocalCacheChange),this.player_.on("dispose",(function(){t.localCachePlugin.off("localcachechanged",t.onLocalCacheChange)})),this.onLocalCacheChange())}},{key:"onLocalCacheChange",value:function(){return t=this,e=void 0,n=void 0,r=Sr().mark((function t(){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.localCachePlugin.getActiveLocalCache();case 2:t.sent?this.show():this.hide();case 4:case"end":return t.stop()}}),t,this)})),new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}}],r&&jr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Rr(t){return Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(t)}function Ir(){Ir=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Rr(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Rr(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Br(r.key),r)}}function Br(t){var e=function(t){if("object"!=Rr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rr(e)?e:e+""}function Nr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Nr=function(){return!!t})()}function Mr(){return Mr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ar(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Mr.apply(null,arguments)}function Ar(t){return Ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ar(t)}function Fr(t,e){return Fr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fr(t,e)}o.Z.registerComponent("localCacheIndicator",Lr);var Zr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},Vr=function(t){function e(t,n){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Ar(e),function(t,e){if(e&&("object"==Rr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Nr()?Reflect.construct(e,n||[],Ar(t).constructor):e.apply(t,n))}(this,e,[t])).logger_=o.Z.log.createLogger("localcache"),void 0===n)throw Error("no options defined");return r.localCaches_=n.localCacheAddresses.map((function(t){return new vr(t)})),r.player.ready((function(){r.initialize(),n.enabled&&r.enable()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fr(t,e)}(e,t),n=e,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(t){this.localCaches_=this.localCaches_.filter((function(e){return e!==t}))}},{key:"dispose",value:function(){var t,n,r;(t=e,n=this,"function"==typeof(r=Mr(Ar(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"initialize",value:function(){this.player.controlBar.addChild("localCacheIndicator")}},{key:"handleNetworkError",value:function(){return Zr(this,void 0,void 0,Ir().mark((function t(){var e;return Ir().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getActiveLocalCache();case 2:if(!(e=t.sent)){t.next=8;break}return t.next=6,e.ping();case 6:t.sent&&this.removeLocalCache(e);case 8:return this.resetActiveLocalCache(),t.next=11,this.getActiveLocalCache();case 11:return this.resetSource(),t.abrupt("return",!0);case 13:case"end":return t.stop()}}),t,this)})))}},{key:"resetSource",value:function(){for(var t=this.player.qualityLevels(),e=0;e<t.length;e++)t[e].enabled&&(t[e].enabled=!0)}},{key:"getActiveLocalCacheInternal",value:function(){return Zr(this,void 0,void 0,Ir().mark((function t(){var e,n,r,o=this;return Ir().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=[],n=function(t){return Zr(o,void 0,void 0,Ir().mark((function n(){return Ir().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.ping();case 2:if(!n.sent){n.next=4;break}e.push(t);case 4:case"end":return n.stop()}}),n)})))},t.next=4,Promise.all(this.localCaches_.map((function(t){return n(t)})));case 4:if(!(e.length>0)){t.next=8;break}return r=e[0],this.onLocalCacheChange(r),t.abrupt("return",r);case 8:return t.abrupt("return",null);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"onLocalCacheChange",value:function(t){this.logger_.debug("Local Cache changed",t),this.trigger("localcachechanged",{localCache:t});var e=!1;t&&t.playbackProfile&&(this.logger_.debug("Changing active profile for local cache",t.playbackProfile),fr.enableProfileOrNextBest(this.player.qualityLevels(),t.playbackProfile),e=!0),e||this.player.src(this.player.src())}}],r&&Dr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function zr(t){return zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zr(t)}function Ur(){Ur=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==zr(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(zr(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Gr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qr(r.key),r)}}function qr(t){var e=function(t){if("object"!=zr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zr(e)?e:e+""}function Hr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hr=function(){return!!t})()}function Wr(){return Wr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Qr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Wr.apply(null,arguments)}function Qr(t){return Qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qr(t)}function Yr(t,e){return Yr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yr(t,e)}o.Z.registerPlugin("localCache",Vr);var $r=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},Kr=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Qr(e),function(t,e){if(e&&("object"==zr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Hr()?Reflect.construct(e,n||[],Qr(t).constructor):e.apply(t,n))}(this,e,[t])).playerApi=n.playerApi,r.fileToken=n.fileToken,r.logger=o.Z.log.createLogger("video-signature-expiry-plugin"),r.bindErrorHandlers(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Yr(t,e)}(e,t),n=e,r=[{key:"bindErrorHandlers",value:function(){this.onError=this.onError.bind(this),this.player.on("error",this.onError)}},{key:"dispose",value:function(){var t,n,r;this.player.off("error",this.onError),(t=e,n=this,"function"==typeof(r=Wr(Qr(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"onError",value:function(){return $r(this,void 0,void 0,Ur().mark((function t(){var e,n=this;return Ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=this.player.error().code)===MediaError.MEDIA_ERR_NETWORK||e===MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,this.player.localCache().getActiveLocalCache();case 5:if(!t.sent){t.next=8;break}return this.callErrorHandler((function(){return n.player.localCache().handleNetworkError()})),t.abrupt("return");case 8:this.callErrorHandler((function(){return n.handleVideoSignatureExpiry()}));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"handleVideoSignatureExpiry",value:function(){return $r(this,void 0,void 0,Ur().mark((function t(){var e,n;return Ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.playerApi&&this.fileToken){t.next=2;break}return t.abrupt("return",!1);case 2:if(!(this.refetchedSourcesTimestamp+9e5>Date.now())){t.next=4;break}return t.abrupt("return",!1);case 4:return this.refetchedSourcesTimestamp=Date.now(),e=null,t.prev=6,this.logger.debug("Detected expired mp4 urls, attempting to refetch"),n="".concat(this.playerApi.origin,"/api/files?fileToken=").concat(this.fileToken),t.next=11,we.get(n);case 11:e=t.sent,t.next=18;break;case 14:return t.prev=14,t.t0=t.catch(6),this.logger.error("Failed to refetch expired mp4 urls"),t.abrupt("return",!1);case 18:return this.logger.debug("Mp4 urls successfully refetched"),this.player.progressiveFiles().repopulateSources(e.progressive.map((function(t){return{id:t.profile,mimeType:t.mimeType,url:t.url}}))),this.fileToken=e.fileToken,t.abrupt("return",!0);case 22:case"end":return t.stop()}}),t,this,[[6,14]])})))}},{key:"callErrorHandler",value:function(t){return $r(this,void 0,void 0,Ur().mark((function e(){var n,r,o,i,a=this;return Ur().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.player.currentTime(),r=!this.player.paused(),o=this.player.playbackRate(),i=function(){a.player.playbackRate(o),a.player.currentTime(n),r&&a.player.play(),a.player.error(null)},this.player.one("loadedmetadata",i),e.next=7,t();case 7:if(!e.sent){e.next=9;break}return e.abrupt("return");case 9:this.player.off("loadedmetadata",i);case 10:case"end":return e.stop()}}),e,this)})))}}],r&&Gr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function Xr(t){return Xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xr(t)}function Jr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,to(r.key),r)}}function to(t){var e=function(t){if("object"!=Xr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Xr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xr(e)?e:e+""}function eo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(eo=function(){return!!t})()}function no(t){return no=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},no(t)}function ro(t,e){return ro=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ro(t,e)}o.Z.registerPlugin("handleNetworkErrors",Kr);var oo=o.Z.getPlugin("plugin"),io="cvplayer-show-subtitles",ao="cvplayer-selected-language",uo="cvplayer-subtitle-size",co=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=no(e),function(t,e){if(e&&("object"==Xr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,eo()?Reflect.construct(e,n||[],no(t).constructor):e.apply(t,n))}(this,e,[t])).options=n,r.initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ro(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){this.applyUserPreferences=this.applyUserPreferences.bind(this),this.player.textTracks().length&&(this.bindEventListeners(),this.applyUserPreferences())}},{key:"applyUserPreferences",value:function(){var t=!!this.options.showSubtitles,e=this.safeGet(io);if("true"===e&&(t=!0),"false"===e&&(t=!1),t){var n=this.guessWhichTrack();n&&(n.mode="showing")}else this.disableSubtitles();var r=this.safeGet(uo);r||(r=this.options.subtitleSize),this.player.options_.mobile&&(r="medium"),r&&this.player.textTrackSettings.setSizeSetting(r)}},{key:"safeGet",value:function(t){if(Ze())return Ve(t)}},{key:"onSelectedLanguageChange",value:function(){for(var t,e,n=this.player.textTracks(),r=0;r<n.length;r++){var o=n[r];if("showing"===o.mode)return ze(io,"true"),ze(ao,o.language),void(null===(t=this.options.analyticsService)||void 0===t||t.logUserAction({language:o.language},{actionType:ne.Vw.Select,entity:ne.py.Subtitle,workflowPhase:ne.eu.Complete,descriptor:ne.DL.On}))}var i;ze(io,"false"),i=ao,window.localStorage.removeItem(i),null===(e=this.options.analyticsService)||void 0===e||e.logUserAction({language:""},{actionType:ne.Vw.Select,entity:ne.py.Subtitle,workflowPhase:ne.eu.Complete,descriptor:ne.DL.Off,eventVersion:ne.eq.V3})}},{key:"bindEventListeners",value:function(){var t=this;Ze()&&(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(){t.player.off("cv:languageselected",t.onSelectedLanguageChange),t.player.off("changesubtitlesize",t.onChangeSubtitleSize)})))}},{key:"onChangeSubtitleSize",value:function(){var t=this.player.textTrackSettings.getSizeSetting();ze(uo,t)}},{key:"guessWhichTrack",value:function(){for(var t,e,n=this.safeGet(ao)||window.navigator.language,r=this.getLanguageParts(n),o=r.language,i=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===o&&(t=c,f||(e=c),f===i))return t}return e||t||null}},{key:"getLanguageParts",value:function(t){var e=t.toLowerCase().split("-");return{language:e[0],country:e[1]}}},{key:"disableSubtitles",value:function(){for(var t=this.player.textTracks(),e=0;e<t.length;e++)t[e].mode="disabled"}},{key:"previewModeSubtitles",value:function(){var t=this.guessWhichTrack();t&&(t.mode="showing"),this.player.off("changesubtitlesize",this.onChangeSubtitleSize),this.player.textTrackSettings.setSizeSetting("large"),this.player.on("changesubtitlesize",this.onChangeSubtitleSize)}}])&&Jr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(oo);function lo(t){return lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lo(t)}function so(){so=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==lo(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(lo(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function fo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,po(r.key),r)}}function po(t){var e=function(t){if("object"!=lo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=lo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lo(e)?e:e+""}function yo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yo=function(){return!!t})()}function ho(t){return ho=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ho(t)}function vo(t,e){return vo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vo(t,e)}o.Z.registerPlugin("persistSubtitleSettingsPlugin",co);var bo=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},mo=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=ho(e),function(t,e){if(e&&("object"==lo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,yo()?Reflect.construct(e,n||[],ho(t).constructor):e.apply(t,n))}(this,e,[t])).options=n,r.player.ready((function(){return r.initialize()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vo(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){return bo(this,void 0,void 0,so().mark((function t(){var e,n,r,o,i=this;return so().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getActiveLocalCache();case 2:if(e=t.sent,(n=e?this.options.playbackProfileLocalCache:this.options.playbackProfile)||(n="1080"),Ze()&&(r=Ve(this.getStorageKey(!!e)))&&(n=r),o=this.player.qualityLevels(),(null==e?void 0:e.playbackProfile)||fr.enableProfileOrNextBest(o,n),Ze()){t.next=10;break}return t.abrupt("return");case 10:this.onQualityLevelsChange=this.onQualityLevelsChange.bind(this),o.on("change",this.onQualityLevelsChange),this.on("dispose",(function(){o.off("change",i.onQualityLevelsChange)}));case 13:case"end":return t.stop()}}),t,this)})))}},{key:"onQualityLevelsChange",value:function(){var t;return bo(this,void 0,void 0,so().mark((function e(){var n,r,o;return so().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isLocalCacheActive();case 2:n=e.sent,r=this.player.qualityLevels(),o=r[r.selectedIndex],ze(this.getStorageKey(n),o.id),null===(t=this.options.analyticsService)||void 0===t||t.logUserAction({quality:o.id},{actionType:ne.Vw.Select,workflowPhase:ne.eu.Complete,descriptor:ne.UX.ChangeResolution,entity:ne.py.Resolution,eventVersion:ne.eq.V3});case 7:case"end":return e.stop()}}),e,this)})))}},{key:"isLocalCacheActive",value:function(){return bo(this,void 0,void 0,so().mark((function t(){return so().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.player.localCache().getActiveLocalCache();case 2:return t.abrupt("return",!!t.sent);case 3:case"end":return t.stop()}}),t,this)})))}},{key:"getActiveLocalCache",value:function(){return this.player.localCache().getActiveLocalCache()}},{key:"getStorageKey",value:function(t){return t?"cvplayer-localcache-playback-quality":"cvplayer-playback-quality"}}])&&fo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function go(t){return go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},go(t)}function wo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Oo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Po(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,jo(r.key),r)}}function So(t,e,n){return e&&Po(t.prototype,e),n&&Po(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function jo(t){var e=function(t){if("object"!=go(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=go(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==go(e)?e:e+""}function ko(t,e,n){return e=Eo(e),function(t,e){if(e&&("object"==go(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,_o()?Reflect.construct(e,n||[],Eo(t).constructor):e.apply(t,n))}function _o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_o=function(){return!!t})()}function Eo(t){return Eo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Eo(t)}function Co(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&To(t,e)}function To(t,e){return To=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},To(t,e)}o.Z.registerPlugin("persistQualitySettingsPlugin",mo);var xo=o.Z.getComponent("Component"),Lo=function(t){function e(t,n){return Oo(this,e),ko(this,e,[t,n])}return Co(e,t),So(e,[{key:"createEl",value:function(){return o.Z.dom.createEl("div",{className:"cv-progress-reporter-item"})}},{key:"update",value:function(){var t=this.options_.event,e=this.player_.duration(),n=(t.end.time-t.start.time)/e;this.el_.style.width=100*n+"%";var r=t.start.time/e;this.el_.style.left=100*r+"%"}}])}(xo),Ro=function(t){function e(){var t;return Oo(this,e),(t=ko(this,e,arguments)).events_=[],t}return Co(e,t),So(e,[{key:"update",value:function(){for(var t=this,e=this.children(),n=e.length;n>0;n--)this.removeChild(e[n]);this.events_.forEach((function(e){var n=new Lo(t.player(),{event:e});t.addChild(n),n.update()}))}},{key:"addEvents",value:function(t){var e,n;(e=this.events_).push.apply(e,function(t){if(Array.isArray(t))return wo(t)}(n=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return wo(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wo(t,e):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 o.Z.dom.createEl("div",{className:"cv-progress-reporter-display"})}}])}(xo);function Io(t){return Io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Io(t)}function Do(t,e,n){return(e=No(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,No(r.key),r)}}function No(t){var e=function(t){if("object"!=Io(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Io(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Io(e)?e:e+""}function Mo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Mo=function(){return!!t})()}function Ao(t){return Ao=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ao(t)}function Fo(t,e){return Fo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fo(t,e)}var Zo=o.Z.getPlugin("plugin"),Vo="play",zo="playing",Uo="pause",Go="seekstart",qo="ended",Ho="pausedseek",Wo=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Ao(e),function(t,e){if(e&&("object"==Io(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Mo()?Reflect.construct(e,n||[],Ao(t).constructor):e.apply(t,n))}(this,e,[t,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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fo(t,e)}(e,t),n=e,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 t=this,e=Do(Do(Do(Do(Do(Do({},Vo,(function(){return t.onPlay()})),Uo,(function(){return t.onPause()})),"timeupdate",(function(){return t.onTimeUpdate()})),"seeking",(function(){return t.onSeeking()})),qo,(function(){return t.onEnded()})),zo,(function(){return t.onPlaying()})),n=Object.keys(e);n.forEach((function(n){return t.player.on(n,e[n])})),this.one("dispose",(function(){n.forEach((function(n){return t.player.off(n,e[n])}))}))}},{key:"startInterval",value:function(){var t=this,e=this.options.interval||5e3;this.interval=window.setInterval((function(){return t.flushBuffer()}),e),this.player.one("dispose",(function(){return window.clearInterval(t.interval)}))}},{key:"addEasterEgg",value:function(){var t,e,n=this,r="",o=function(e){"ArrowUpArrowUpArrowDownArrowDownArrowLeftArrowRightArrowLeftArrowRightba"===(r+=e.key)&&n.addDisplay(),window.clearTimeout(t),t=window.setTimeout((function(){r=""}),500)},i=!1,a=function(){i=!0,e=window.setTimeout((function(){i&&n.addDisplay()}),1e4)};function u(){i=!1,window.clearTimeout(e)}this.player.el().addEventListener("keyup",o);var c=this.player.getChild("Collapserator").getChild("PlayToggle");c.on("touchstart",a),c.on("touchend",u),this.player.one("dispose",(function(){var t,e;null===(e=null===(t=n.player)||void 0===t?void 0:t.el())||void 0===e||e.removeEventListener("keyup",o),c.off("touchstart",a),c.off("touchend",u)}))}},{key:"addDisplay",value:function(){var t=this;this.progressReporterDisplay||(this.progressReporterDisplay=new Ro(this.player),this.player.addChild(this.progressReporterDisplay),this.player.options_.inactivityTimeout=0,this.player.one("dispose",(function(){t.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(Vo)}},{key:"onPause",value:function(){var t=this;this.isSeeking||(this.pauseTimeout=window.setTimeout((function(){t.isPlaying=!1,t.logEvent(Uo),delete t.pauseTimeout}),50))}},{key:"onTimeUpdate",value:function(){this.shouldLogPlayOnTimeUpdate&&(this.shouldLogPlayOnTimeUpdate=!1,this.logEvent(Vo)),this.isPlaying&&!this.isSeeking&&this.logEvent(zo)}},{key:"onSeeking",value:function(){this.pauseTimeout&&(this.latestTime=this.previousLatestTime,window.clearTimeout(this.pauseTimeout),delete this.pauseTimeout),this.isPlaying||this.logEvent(Ho),!this.isSeeking&&this.isPlaying&&(this.isSeeking=!0,this.logEvent(Go))}},{key:"onEnded",value:function(){this.hasEnded=!0,this.logEvent(qo)}},{key:"onPlaying",value:function(){this.isSeeking=!1,this.isPlaying=!0}},{key:"logEvent",value:function(t){if(this.player){var e=this.player.currentTime();t===Go&&(e=this.latestTime),this.previousLatestTime=this.latestTime,this.latestTime=this.player.currentTime(),this.eventBuffer.push({time:e,type:t})}}},{key:"shouldUseCarriedOverTime",value:function(t){return this.lastPlayingTime&&(t===zo||t===Vo)}},{key:"shouldSaveCarriedOverTime",value:function(t){return t===zo||t===Uo}},{key:"shouldClearCarriedOverTime",value:function(t){return t===qo||t===Ho}},{key:"flushBuffer",value:function(){for(var t,e,n=[],r={};this.eventBuffer.length;){var o=this.eventBuffer.shift();this.shouldClearCarriedOverTime(o.type)?delete this.lastPlayingTime:r.start?o.type===zo&&this.eventBuffer.length>0||(this.shouldSaveCarriedOverTime(o.type)&&(this.lastPlayingTime=o.time),r.end=o,n.push(r),r={}):(this.shouldUseCarriedOverTime(o.type)&&(o.time=this.lastPlayingTime,delete this.lastPlayingTime),r.start=o)}this.eventBuffer=[],n.length&&this.validateEvents(n)&&(this.options.onFlush(n),null===(t=this.player)||void 0===t||t.trigger("progressflush"),null===(e=this.progressReporterDisplay)||void 0===e||e.addEvents(n))}},{key:"validateEvents",value:function(t){var e=0;t.forEach((function(t){e+=t.end.time-t.start.time}));var n=this.options.interval||5e3;return n/=1e3,n+=.5,n*=this.player.playbackRate(),e<n}}],r&&Bo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Zo);function Qo(t){return Qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qo(t)}function Yo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$o(r.key),r)}}function $o(t){var e=function(t){if("object"!=Qo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Qo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qo(e)?e:e+""}function Ko(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ko=function(){return!!t})()}function Xo(t){return Xo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xo(t)}function Jo(t,e){return Jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jo(t,e)}o.Z.registerPlugin("progressReporterPlugin",Wo);var ti=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Xo(e),function(t,e){if(e&&("object"==Qo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ko()?Reflect.construct(e,n||[],Xo(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jo(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){return o.Z.dom.createEl("span",{innerHTML:'<span class="vjs-icon-placeholder"></span>',className:"cv-drag-handle vjs-control vjs-button"},{})}}])&&Yo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component")),ei=["top","left","right","bottom"],ni={top:"Top",left:"Left",right:"Right",bottom:"Bottom"};function ri(t){return ri="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ri(t)}function oi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ii(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ui(r.key),r)}}function ai(t,e,n){return e&&ii(t.prototype,e),n&&ii(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ui(t){var e=function(t){if("object"!=ri(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ri(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ri(e)?e:e+""}function ci(t,e,n){return e=fi(e),function(t,e){if(e&&("object"==ri(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,li()?Reflect.construct(e,n||[],fi(t).constructor):e.apply(t,n))}function li(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(li=function(){return!!t})()}function si(){return si="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=fi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},si.apply(null,arguments)}function fi(t){return fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fi(t)}function pi(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yi(t,e)}function yi(t,e){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yi(t,e)}var hi=o.Z.getComponent("Component"),di=function(t){function e(t,n){var r;return oi(this,e),(r=ci(this,e,[t,n])).bindEventListeners(),r}return pi(e,t),ai(e,[{key:"createEl",value:function(){return(t=e,n=this,"function"==typeof(r=si(fi(1&3?t.prototype:t),"createEl",n))?function(t){return r.apply(n,t)}:r)(["div",{},{class:"cv-drop-target cv-drop-".concat(this.options_.side)}]);var t,n,r}},{key:"bindEventListeners",value:function(){var t=this,e=this.el(),n=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move",t.addClass("cv-drag-over")},r=function(e){e.preventDefault(),t.removeClass("cv-drag-over"),t.player_.whiteboardModePlugin().setWhiteboardMode(t.options_.side)},o=function(){t.removeClass("cv-drag-over")};e.addEventListener("dragover",n),e.addEventListener("drop",r),e.addEventListener("dragleave",o),this.on("dispose",(function(){e.removeEventListener("dragover",n),e.removeEventListener("drop",r),e.removeEventListener("dragleave",o)}))}}])}(hi),vi=function(t){function e(t,n){var r;return oi(this,e),(r=ci(this,e,[t,n])).addChildren(),r}return pi(e,t),ai(e,[{key:"addChildren",value:function(){var t=this;ei.forEach((function(e){t.addChild(new di(t.player_,{side:e}))}))}}])}(hi);function bi(t){return bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bi(t)}function mi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gi(r.key),r)}}function gi(t){var e=function(t){if("object"!=bi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bi(e)?e:e+""}function wi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wi=function(){return!!t})()}function Oi(t){return Oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Oi(t)}function Pi(t,e){return Pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pi(t,e)}var Si=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Oi(e),function(t,e){if(e&&("object"==bi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wi()?Reflect.construct(e,n||[],Oi(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pi(t,e)}(e,t),n=e,(r=[{key:"handleClick",value:function(){this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)}}])&&mi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function ji(t){return ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ji(t)}function ki(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_i(r.key),r)}}function _i(t){var e=function(t){if("object"!=ji(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ji(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ji(e)?e:e+""}function Ei(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ei=function(){return!!t})()}function Ci(){return Ci="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ti(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ci.apply(null,arguments)}function Ti(t){return Ti=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ti(t)}function xi(t,e){return xi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xi(t,e)}var Li=o.Z.getComponent("MenuButton"),Ri=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Ti(e),function(t,e){if(e&&("object"==ji(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ei()?Reflect.construct(e,n||[],Ti(t).constructor):e.apply(t,n))}(this,e,arguments)).alwaysCollapsed=!0,t.isCollapsed=!1,t.isCollabsible=!0,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xi(t,e)}(e,t),n=e,r=[{key:"createItems",value:function(){var t=this,e=this.player_.whiteboardModePlugin().side,n=[new _(this.player_,{label:"Video Controls"})];return ei.forEach((function(r){n.push(new Si(t.player_,{side:r,label:ni[r],selectable:!0,multiSelectable:!1,selected:r===e}))})),n}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat((t=e,n=this,"function"==typeof(r=Ci(Ti(1&3?t.prototype:t),"buildWrapperCSSClass",n))?function(t){return r.apply(n,t)}:r)([]));var t,n,r}},{key:"getCollabsibleName",value:function(){return"Video Controls"}},{key:"getCollabsibleValue",value:function(){var t=this.player_.whiteboardModePlugin().side;return ni[t]}},{key:"showInCollabsibleMenu",value:function(){return this.player_.isFullscreen()}},{key:"showCollapsibleMenu",value:function(){Li.prototype.handleClick.apply(this)}}],r&&ki(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Li);function Ii(t){return Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ii(t)}function Di(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bi(r.key),r)}}function Bi(t){var e=function(t){if("object"!=Ii(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ii(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ii(e)?e:e+""}function Ni(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ni=function(){return!!t})()}function Mi(t){return Mi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mi(t)}function Ai(t,e){return Ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ai(t,e)}var Fi="cv-whiteboard-side",Zi=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Mi(e),function(t,e){if(e&&("object"==Ii(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ni()?Reflect.construct(e,n||[],Mi(t).constructor):e.apply(t,n))}(this,e,[t])).side="bottom",n.player.ready((function(){n.initialize()})),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ai(t,e)}(e,t),n=e,r=[{key:"initialize",value:function(){if(!this.player.options_.mobile){if(Ze()){var t=Ve(Fi);t&&(this.side=t)}this.initCollapserator(),this.initDragTargets(),this.initFullscreenListener()}}},{key:"initCollapserator",value:function(){var t=this,e=this.player.getChild("collapserator"),n=new ti(this.player);this.button=new Ri(this.player),e.addChild(n),e.addChild(this.button),this.player.trigger("cv-updatecog");var r=function(){t.player.isFullscreen()&&e.el().setAttribute("draggable","true")},o=function(){t.player.isFullscreen()&&e.el().setAttribute("draggable","false")},i=function(e){t.player.isFullscreen()&&(t.player.addClass("cv-dragging"),e.dataTransfer.setData("text/plain","handle"))},a=function(){t.player.isFullscreen()&&(t.player.removeClass("cv-dragging"),e.el().setAttribute("draggable","false"))};n.el().addEventListener("mousedown",r),n.el().addEventListener("mouseup",o),e.el().addEventListener("dragstart",i),e.el().addEventListener("dragend",a),this.on("dispose",(function(){n.el().removeEventListener("mousedown",r),n.el().removeEventListener("mouseup",o),e.el().removeEventListener("dragstart",i),e.el().removeEventListener("dragend",a)}))}},{key:"initDragTargets",value:function(){this.player.addChild(new vi(this.player))}},{key:"initFullscreenListener",value:function(){var t=this;this.update=this.update.bind(this),this.player.on("fullscreenchange",this.update),this.one("dispose",(function(){t.player.off("fullscreenchange",t.update)}))}},{key:"setWhiteboardMode",value:function(t){this.side=t,this.button.update(),Ze()&&ze(Fi,t),this.player.trigger("cv-whiteboard-change"),this.update()}},{key:"update",value:function(){this.player.removeClass("cv-whiteboard-top"),this.player.removeClass("cv-whiteboard-left"),this.player.removeClass("cv-whiteboard-right"),o.Z.dom.removeClass(window.document.documentElement,"cv-whiteboard-html-font-size"),this.player.trigger("resizemenus"),this.player.trigger("cv-updatecog"),this.player.isFullscreen()&&"bottom"!==this.side&&(this.player.addClass("cv-whiteboard-".concat(this.side)),o.Z.dom.addClass(window.document.documentElement,"cv-whiteboard-html-font-size"))}}],r&&Di(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function Vi(t){return Vi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vi(t)}function zi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ui(r.key),r)}}function Ui(t){var e=function(t){if("object"!=Vi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vi(e)?e:e+""}function Gi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gi=function(){return!!t})()}function qi(t){return qi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qi(t)}function Hi(t,e){return Hi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Hi(t,e)}o.Z.registerPlugin("whiteboardModePlugin",Zi);var Wi=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=qi(e),function(t,e){if(e&&("object"==Vi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gi()?Reflect.construct(e,n||[],qi(t).constructor):e.apply(t,n))}(this,e,[t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Hi(t,e)}(e,t),n=e,(r=[{key:"deferMenu",value:function(){var t={subtitles:this.buildSubtitles(),qualities:this.buildQualities(),playbackSpeeds:this.buildPlaybackSpeeds()};this.player.trigger("cv-defer-menus",t)}},{key:"buildSubtitles",value:function(){for(var t=[],e=!1,n=this.player.textTracks(),r=0;r<n.length;r++){var o=n[r],i="showing"===o.mode;t.unshift({id:o.label,name:o.label,selected:i}),i&&(e=!0)}return t.push({id:null,name:"Off",selected:!e}),t}},{key:"buildQualities",value:function(){for(var t=[],e=this.player.qualityLevels(),n=0;n<e.length;n++){var r=e[n];t.push({id:r.id,name:r.id+"p",selected:r.enabled})}return t}},{key:"buildPlaybackSpeeds",value:function(){var t=this.player.playbackRate();return this.player.options_.playbackRates.map((function(e){return{id:e,name:e+"x"+(1===e?" (Normal)":""),selected:t===e}}))}}])&&zi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("deferMenusPlugin",Wi);var Qi="PreventScrubbingTooltip";function Yi(t){return Yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yi(t)}function $i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ki(r.key),r)}}function Ki(t){var e=function(t){if("object"!=Yi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Yi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yi(e)?e:e+""}function Xi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Xi=function(){return!!t})()}function Ji(t,e,n,r){var o=ta(ea(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function ta(){return ta="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ea(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},ta.apply(null,arguments)}function ea(t){return ea=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ea(t)}function na(t,e){return na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},na(t,e)}var ra=o.Z.getComponent("Component"),oa="cv-prevent-scrubbing-tooltip-show",ia="cv-prevent-scrubbing-tooltip-remove-transition",aa=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=ea(e),function(t,e){if(e&&("object"==Yi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Xi()?Reflect.construct(e,n||[],ea(t).constructor):e.apply(t,n))}(this,e,arguments)).isShowing=!1,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&na(t,e)}(e,t),n=e,r=[{key:"buildCSSClass",value:function(){return"cv-prevent-scrubbing-tooltip ".concat(Ji(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return Ji(e,"createEl",this,3)([t,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(oa),this.isShowing=!0)}},{key:"hide",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isShowing&&(e&&(this.addClass(ia),window.requestAnimationFrame((function(){t.removeClass(ia)}))),this.player_.userActive(!1),this.removeClass(oa),this.isShowing=!1)}}],r&&$i(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ra);function ua(t){return ua="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ua(t)}function ca(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,la(r.key),r)}}function la(t){var e=function(t){if("object"!=ua(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ua(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ua(e)?e:e+""}function sa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(sa=function(){return!!t})()}function fa(){return fa="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=pa(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},fa.apply(null,arguments)}function pa(t){return pa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pa(t)}function ya(t,e){return ya=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ya(t,e)}o.Z.registerComponent(Qi,aa);var ha=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=pa(e),function(t,e){if(e&&("object"==ua(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,sa()?Reflect.construct(e,n||[],pa(t).constructor):e.apply(t,n))}(this,e,[t])).isEnabled=!1,r.isPreviewing=!1;var o=null!=n?n:{},i=o.furthestVisitedTime,a=void 0===i?0:i,u=o.isEnabled,c=void 0!==u&&u;return r.playerCurrentTimeFn=r.player.currentTime.bind(t),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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ya(t,e)}(e,t),n=e,r=[{key:"dispose",value:function(){var t,n,r;this.player.currentTime=this.playerCurrentTimeFn,this.isEnabled&&(this.disable(),(t=e,n=this,"function"==typeof(r=fa(pa(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([]))}},{key:"togglePreview",value:function(t){if(t){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(Qi),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 t=this.playerCurrentTimeFn();t>this.furthestVisitedTime&&(this.furthestVisitedTime=t)}},{key:"currentTime",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];if("number"!=typeof t)return this.playerCurrentTimeFn.apply(this,[t].concat(r));if(this.isEnabled){var i=this.getPreventScrubbingTooltip(),a=null===(e=this.getSeekBar())||void 0===e?void 0:e.getChild("MouseTimeDisplay");if(t>this.furthestVisitedTime)return i.show(),Q(i.hide,1e3,!1,i)(),null==a||a.hide(),void this.playerCurrentTimeFn(this.furthestVisitedTime,r);null==a||a.show(),i.hide(!0),this.playerCurrentTimeFn(t,r)}else this.playerCurrentTimeFn.apply(this,[t].concat(r))}},{key:"getPreventScrubbingTooltip",value:function(){return this.getProgressControl().getChild(Qi)}},{key:"getSeekBar",value:function(){var t;return null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar")}}],r&&ca(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function da(t){return da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},da(t)}function va(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ba(r.key),r)}}function ba(t){var e=function(t){if("object"!=da(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=da(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==da(e)?e:e+""}function ma(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ma=function(){return!!t})()}function ga(t){return ga=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ga(t)}function wa(t,e){return wa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wa(t,e)}o.Z.registerPlugin("preventScrubbingPlugin",ha);var Oa=o.Z.getComponent("Button"),Pa="cv-muted",Sa=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=ga(e),function(t,e){if(e&&("object"==da(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ma()?Reflect.construct(e,n||[],ga(t).constructor):e.apply(t,n))}(this,e,[t])).update(),n.update=n.update.bind(n),t.on("volumechange",n.update),t.on("dispose",(function(){return t.off("volumechange",n.update)})),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wa(t,e)}(e,t),n=e,(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"}}])&&va(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Oa);function ja(t){return ja="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ja(t)}function ka(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_a(r.key),r)}}function _a(t){var e=function(t){if("object"!=ja(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ja(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ja(e)?e:e+""}function Ea(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ea=function(){return!!t})()}function Ca(){return Ca="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ta(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ca.apply(null,arguments)}function Ta(t){return Ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ta(t)}function xa(t,e){return xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xa(t,e)}o.Z.registerComponent("muteButton",Sa),Sa.prototype.controlText_="Mute";var La,Ra=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Ta(e),function(t,e){if(e&&("object"==ja(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ea()?Reflect.construct(e,n||[],Ta(t).constructor):e.apply(t,n))}(this,e,[t,n]))._onClickHandler=n.onClickHandler,r.bindEventListeners(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xa(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(){return o.Z.dom.createEl("div",{className:"cv-player-overlay"})}},{key:"handleClick",value:function(t){"function"==typeof this._onClickHandler&&(t.stopImmediatePropagation(),this._onClickHandler())}},{key:"dispose",value:function(){var t,n,r;this.off("click",this.handleClick),(t=e,n=this,"function"==typeof(r=Ca(Ta(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"bindEventListeners",value:function(){this.on("click",this.handleClick)}}],r&&ka(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Ia(t){return Ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ia(t)}function Da(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ba(r.key),r)}}function Ba(t){var e=function(t){if("object"!=Ia(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ia(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ia(e)?e:e+""}function Na(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Na=function(){return!!t})()}function Ma(t){return Ma=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ma(t)}function Aa(t,e){return Aa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Aa(t,e)}o.Z.registerComponent("playerOverlay",Ra),function(t){t.Default="play",t.Hover="hover"}(La||(La={}));var Fa=o.Z.getPlugin("plugin"),Za="cv-preview-mode",Va=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Ma(e),function(t,e){if(e&&("object"==Ia(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Na()?Reflect.construct(e,n||[],Ma(t).constructor):e.apply(t,n))}(this,e,[t])).buttonAdded=!1,n.mode=null,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Aa(t,e)}(e,t),n=e,(r=[{key:"getMode",value:function(){return this.mode}},{key:"setPlayerMode",value:function(t,e){var n=this.mode;if(this.mode=t,t===La.Hover)return this.buttonAdded||this.addButtons(e),this.player.addClass(Za),this.enableSubtites(),this.mute(),this.removeActivityTimeout(),void this.player.trigger("resize");n===La.Hover&&(this.player.removeClass(Za),this.disableSubtitles(),this.unmute(),this.restoreActivityTimeout(),this.player.trigger("resize"))}},{key:"addButtons",value:function(t){var e=new Sa(this.player),n=new Ra(this.player,{onClickHandler:t});this.player.addChild(e),this.player.addChild(n),this.buttonAdded=!0}},{key:"enableSubtites",value:function(){var t=this;this.player.dataLoaded((function(){return t.player.persistSubtitleSettingsPlugin().previewModeSubtitles()}))}},{key:"disableSubtitles",value:function(){var t=this;this.player.dataLoaded((function(){return t.player.persistSubtitleSettingsPlugin().applyUserPreferences()}))}},{key:"mute",value:function(){var t=this;this.player.ready((function(){t.player.persistVolumePlugin().disable(),t.player.muted(!0)}))}},{key:"unmute",value:function(){var t=this;this.player.ready((function(){t.player.persistVolumePlugin().applyUserPreferences(),t.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}(Fa);function za(t){return za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},za(t)}function Ua(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ga(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ha(r.key),r)}}function qa(t,e,n){return e&&Ga(t.prototype,e),n&&Ga(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ha(t){var e=function(t){if("object"!=za(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=za(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==za(e)?e:e+""}function Wa(t,e,n){return e=Ya(e),function(t,e){if(e&&("object"==za(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Qa()?Reflect.construct(e,n||[],Ya(t).constructor):e.apply(t,n))}function Qa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qa=function(){return!!t})()}function Ya(t){return Ya=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ya(t)}function $a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ka(t,e)}function Ka(t,e){return Ka=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ka(t,e)}o.Z.registerPlugin("playerModePlugin",Va);var Xa=o.Z.getComponent("Component"),Ja=o.Z.getComponent("ClickableComponent"),tu=function(t){function e(){return Ua(this,e),Wa(this,e,arguments)}return $a(e,t),qa(e,[{key:"createEl",value:function(){return Xa.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>")})}}])}(Xa),eu=function(t){function e(t,n){var r;return Ua(this,e),(r=Wa(this,e,[t,n])).isFavourited=n.isFavourited,r.renderIcon(),r.update(),r}return $a(e,t),qa(e,[{key:"renderIcon",value:function(){this.icon&&this.removeChild(this.icon),this.icon=new tu(this.player_),this.addChild(this.icon)}},{key:"update",value:function(){this.isFavourited?this.addClass("cv-favourited"):this.removeClass("cv-favourited")}},{key:"createEl",value:function(t,e,n){e=Object.assign({innerHTML:"",className:"cv-favourite-button"},e),n=Object.assign({type:"button"},n);var r=Xa.prototype.createEl.call(this,"button",e,n);return this.createControlTextEl(r),r}},{key:"handleClick",value:function(){this.isFavourited=!this.isFavourited,this.update(),this.options_.clickHandler&&this.options_.clickHandler(this.isFavourited)}}])}(Ja);function nu(t){return nu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nu(t)}function ru(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ou(r.key),r)}}function ou(t){var e=function(t){if("object"!=nu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=nu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==nu(e)?e:e+""}function iu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(iu=function(){return!!t})()}function au(t){return au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},au(t)}function uu(t,e){return uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},uu(t,e)}eu.prototype.controlText_="Favourite";var cu=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=au(e),function(t,e){if(e&&("object"==nu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,iu()?Reflect.construct(e,n||[],au(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&uu(t,e)}(e,t),n=e,(r=[{key:"setFavourite",value:function(t,e){if(!this.initialized){var n=new eu(this.player,{isFavourited:t,clickHandler:e});this.player.addChild(n),this.initialized=!0}}}])&&ru(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("favouritePlugin",cu);var lu=n(18204);function su(t){return su="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},su(t)}function fu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pu(r.key),r)}}function pu(t){var e=function(t){if("object"!=su(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=su(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==su(e)?e:e+""}function yu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yu=function(){return!!t})()}function hu(t,e,n,r){var o=du(vu(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function du(){return du="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=vu(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},du.apply(null,arguments)}function vu(t){return vu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vu(t)}function bu(t,e){return bu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bu(t,e)}var mu=o.Z.getComponent("Menu"),gu=mu.prototype,wu=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=vu(e),function(t,e){if(e&&("object"==su(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,yu()?Reflect.construct(e,n||[],vu(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bu(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){var t=hu(e,"createEl",this,3)([]);return this.simpleBar=new lu.Z(this.contentEl(),{autoHide:!1}),t}},{key:"contentEl",value:function(){return this.simpleBar?this.simpleBar.getContentElement():hu(e,"contentEl",this,3)([])}},{key:"dispose",value:function(){this.simpleBar&&(this.simpleBar.unMount(),delete this.simpleBar),hu(e,"dispose",this,3)([])}},{key:"addItem",value:function(t){hu(e,"addItem",this,3)([t]),this.simpleBar.recalculate()}},{key:"lockShowing",value:function(){hu(e,"lockShowing",this,3)([]),this.simpleBar.recalculate()}},{key:"recalculateScrollBar",value:function(){this.simpleBar.recalculate()}},{key:"handleBlur",value:function(t){var e=t.relatedTarget||document.activeElement;this.el().contains(e)||gu.handleBlur.call(this,t)}}])&&fu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(mu);function Ou(t){return Ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ou(t)}function Pu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Su(r.key),r)}}function Su(t){var e=function(t){if("object"!=Ou(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ou(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ou(e)?e:e+""}function ju(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ju=function(){return!!t})()}function ku(t){return ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ku(t)}function _u(t,e){return _u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_u(t,e)}wu.originalProto=gu,mu.prototype=wu.prototype,o.Z.registerComponent("Menu",wu);var Eu=o.Z.getComponent("Component"),Cu=o.Z.getComponent("MenuButton"),Tu=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=ku(e),function(t,e){if(e&&("object"==Ou(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ju()?Reflect.construct(e,n||[],ku(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_u(t,e)}(e,t),n=e,(r=[{key:"createMenu",value:function(){var t,e=new wu(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var n=o.Z.dom.createEl("li",{className:"vjs-menu-title",innerHTML:(t=this.options_.title,"string"!=typeof t?t:t.replace(/./,(function(t){return t.toUpperCase()}))),tabIndex:-1});this.hideThreshold_+=1;var r=new Eu(this.player_,{el:n});e.addItem(r)}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e}}])&&Pu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Cu),xu=Cu.prototype.pressButton;Cu.prototype.pressButton=function(){xu.call(this),this.inactivityTimeout=this.player_.cache_.inactivityTimeout,this.player_.cache_.inactivityTimeout=0,this.player_.options_.inactivityTimeout=0};var Lu=Cu.prototype.unpressButton;function Ru(t){return Ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(t)}function Iu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Du(r.key),r)}}function Du(t){var e=function(t){if("object"!=Ru(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ru(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ru(e)?e:e+""}function Bu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Bu=function(){return!!t})()}function Nu(t,e,n,r){var o=Mu(Au(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Mu(){return Mu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Au(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Mu.apply(null,arguments)}function Au(t){return Au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Au(t)}function Fu(t,e){return Fu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fu(t,e)}Cu.prototype.unpressButton=function(){Lu.call(this),this.player_.cache_.inactivityTimeout=this.inactivityTimeout,this.player_.options_.inactivityTimeout=this.inactivityTimeout,this.player_.reportUserActivity()},o.Z.registerComponent("MenuButton",Tu);var Zu=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Au(e),function(t,e){if(e&&("object"==Ru(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Bu()?Reflect.construct(e,n||[],Au(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fu(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-time-wrapper ".concat(Nu(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return Nu(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}}])&&Iu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Vu(t){return Vu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vu(t)}function zu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Uu(r.key),r)}}function Uu(t){var e=function(t){if("object"!=Vu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vu(e)?e:e+""}function Gu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gu=function(){return!!t})()}function qu(t){return qu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qu(t)}function Hu(t,e){return Hu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Hu(t,e)}Zu.prototype.options_={children:["currentTimeDisplay","remainingTimeDisplay"]},o.Z.registerComponent("TimeWrapper",Zu);var Wu=o.Z.getComponent("SeekBar"),Qu=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=qu(e),function(t,e){if(e&&("object"==Vu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gu()?Reflect.construct(e,n||[],qu(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Hu(t,e)}(e,t),n=e,(r=[{key:"handleMouseDown",value:function(t){var e=this.player_.preventScrubbingPlugin();e.isEnabled&&this.getMouseTime(t)>e.furthestVisitedTime||(Wu.prototype.handleMouseDown.call(this,t),this.player_.addClass("cv-disable-play-pause-feedback"))}},{key:"handleMouseMove",value:function(t){Wu.prototype.handleMouseMove.call(this,t),this.update()}},{key:"getPercent",value:function(){var t=this.player_.currentTime()/this.player_.duration();return t>=1?1:t}},{key:"handleMouseUp",value:function(t){var e=this;Wu.prototype.handleMouseUp.call(this,t),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){e.player_.removeClass("cv-disable-play-pause-feedback")}),500)}},{key:"clamp",value:function(t,e,n){return Math.min(Math.max(t,e),n)}},{key:"getMouseTime",value:function(t){return this.clamp(Wu.prototype.calculateDistance.call(this,t).x,0,1)*this.player_.duration()}}])&&zu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Wu);function Yu(t){return Yu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yu(t)}function $u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ku(r.key),r)}}function Ku(t){var e=function(t){if("object"!=Yu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Yu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yu(e)?e:e+""}function Xu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Xu=function(){return!!t})()}function Ju(t,e,n,r){var o=tc(ec(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function tc(){return tc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ec(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},tc.apply(null,arguments)}function ec(t){return ec=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ec(t)}function nc(t,e){return nc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nc(t,e)}o.Z.registerComponent("SeekBar",Qu);var rc=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=ec(e),function(t,e){if(e&&("object"==Yu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Xu()?Reflect.construct(e,n||[],ec(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nc(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-load-progress ".concat(Ju(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return Ju(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"update",value:function(t){this.el_.style.width=100*t+"%"}}])&&$u(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function oc(t){return oc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oc(t)}function ic(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ac(r.key),r)}}function ac(t){var e=function(t){if("object"!=oc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=oc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oc(e)?e:e+""}function uc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(uc=function(){return!!t})()}function cc(t,e,n,r){var o=lc(sc(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function lc(){return lc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=sc(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},lc.apply(null,arguments)}function sc(t){return sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sc(t)}function fc(t,e){return fc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fc(t,e)}var pc=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=sc(e),function(t,e){if(e&&("object"==oc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,uc()?Reflect.construct(e,n||[],sc(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fc(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-play-progress ".concat(cc(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return cc(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"update",value:function(t){t>0&&t<1?this.addClass("cv-current"):this.removeClass("cv-current"),this.el_.style.width=100*t+"%"}}])&&ic(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function yc(t){return yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(t)}function hc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,dc(r.key),r)}}function dc(t){var e=function(t){if("object"!=yc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=yc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yc(e)?e:e+""}function vc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(vc=function(){return!!t})()}function bc(t,e,n,r){var o=mc(gc(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function mc(){return mc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=gc(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},mc.apply(null,arguments)}function gc(t){return gc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gc(t)}function wc(t,e){return wc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wc(t,e)}var Oc=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=gc(e),function(t,e){if(e&&("object"==yc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,vc()?Reflect.construct(e,n||[],gc(t).constructor):e.apply(t,n))}(this,e,[t,n])).playProgress=new pc(r.player_),r.addChild(r.playProgress),r.loadProgress=new rc(r.player_),r.addChild(r.loadProgress),r.update(),r.updateBuffered(0),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wc(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-item ".concat(bc(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return bc(e,"createEl",this,3)([t,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 t=this.player_.duration()||3600,e=this.options_.endTime-this.options_.startTime;if(t!==this.duration_){var n=e/t;this.el_.style.width=100*n+"%";var r=this.options_.startTime/t;this.el_.style.left=100*r+"%",this.duration_=t}var o=this.getCurrentTime();o<this.options_.startTime?this.playProgress.update(0):o>this.options_.endTime?this.playProgress.update(1):this.playProgress.update((o-this.options_.startTime)/e)}},{key:"updateBuffered",value:function(t){var e=this.options_.endTime-this.options_.startTime;t<this.options_.startTime?this.loadProgress.update(0):t>this.options_.endTime?this.loadProgress.update(1):this.loadProgress.update((t-this.options_.startTime)/e)}}])&&hc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Pc(t){for(var e=t.buffered(),n=t.currentTime(),r=0,o=0;o<e.length;o++){var i=e.start(o),a=e.end(o);if(i<=n&&a>=n){r=a;break}}return r}function Sc(t){return Sc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sc(t)}function jc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,kc(r.key),r)}}function kc(t){var e=function(t){if("object"!=Sc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Sc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sc(e)?e:e+""}function _c(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_c=function(){return!!t})()}function Ec(t,e,n,r){var o=Cc(Tc(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Cc(){return Cc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Tc(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Cc.apply(null,arguments)}function Tc(t){return Tc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tc(t)}function xc(t,e){return xc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xc(t,e)}var Lc=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Tc(e),function(t,e){if(e&&("object"==Sc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,_c()?Reflect.construct(e,n||[],Tc(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xc(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-items ".concat(Ec(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return Ec(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"update",value:function(){this.children_.forEach((function(t){t.update()}))}},{key:"updateBuffered",value:function(){var t=this;this.children_.forEach((function(e){e.updateBuffered(Pc(t.player_))}))}}])&&jc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Rc(t){return Rc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rc(t)}function Ic(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Dc(r.key),r)}}function Dc(t){var e=function(t){if("object"!=Rc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rc(e)?e:e+""}function Bc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Bc=function(){return!!t})()}function Nc(t,e,n,r){var o=Mc(Ac(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Mc(){return Mc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ac(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Mc.apply(null,arguments)}function Ac(t){return Ac=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ac(t)}function Fc(t,e){return Fc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fc(t,e)}var Zc=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Ac(e),function(t,e){if(e&&("object"==Rc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Bc()?Reflect.construct(e,n||[],Ac(t).constructor):e.apply(t,n))}(this,e,[t,n])).onDurationChange=r.onDurationChange.bind(r),r.createChapterItems=r.createChapterItems.bind(r),r.updateBuffered=r.updateBuffered.bind(r),W.useTrack(r.player_,"chapters",null,r.createChapterItems),r.player_.on("durationchange",r.onDurationChange),r.player_.on("progress",r.updateBuffered),r.createChapterItems(),r.update(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fc(t,e)}(e,t),n=e,(r=[{key:"dispose",value:function(){this.player_.off("durationchange",this.onDurationChange),this.player_.off("progress",this.updateBuffered),Nc(e,"dispose",this,3)([])}},{key:"createEl",value:function(){return o.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 t=Nc(e,"update",this,3)([]);return this.chapterBarItems&&this.chapterBarItems.update(),t}},{key:"updateBuffered",value:function(){this.chapterBarItems.updateBuffered()}},{key:"bindUpdateListener",value:function(t){var e=this,n=function(){e.createChapterItems(),e.updateBuffered()};t.addEventListener("cv:cuechange",n),this.player_.one("dispose",(function(){return t.removeEventListener("cv:cuechange",n)}))}},{key:"createChapterItems",value:function(t){var e,n;t&&(this.track_||this.bindUpdateListener(t),this.track_=t);var r=new Lc(this.player_);if((null===(n=null===(e=this.track_)||void 0===e?void 0:e.cues)||void 0===n?void 0:n.length)&&!this.options_.ignoreChapters)for(var o=0;o<this.track_.cues.length;o++){var i=this.track_.cues[o],a=i.startTime,u=i.endTime,c=this.player_.duration();c&&(o===this.track_.cues.length-1&&i.endTime<this.player_.duration()&&(u=this.player_.duration()),u>c&&(u=c));var l=new Oc(this.player_,{startTime:a,endTime:u});if(r.addChild(l),c&&u===c)break}else r.addChild(new Oc(this.player_,{startTime:0,endTime:this.player_.duration()||3600}));this.chapterBarItems&&this.removeChild(this.chapterBarItems),this.chapterBarItems=r,this.addChild(this.chapterBarItems)}}])&&Ic(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("SeekBar"));function Vc(t){return Vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vc(t)}function zc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Uc(r.key),r)}}function Uc(t){var e=function(t){if("object"!=Vc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vc(e)?e:e+""}function Gc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gc=function(){return!!t})()}function qc(){return qc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Hc(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},qc.apply(null,arguments)}function Hc(t){return Hc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hc(t)}function Wc(t,e){return Wc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wc(t,e)}Zc.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"},o.Z.browser.IS_IOS||o.Z.browser.IS_ANDROID||Zc.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),o.Z.registerComponent("ChapterSeekBar",Zc);var Qc=o.Z.getComponent("ProgressControl"),Yc="seekBar",$c=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Hc(e),function(t,e){if(e&&("object"==Vc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gc()?Reflect.construct(e,n||[],Hc(t).constructor):e.apply(t,n))}(this,e,arguments)).seekBarName_=Yc,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wc(t,e)}(e,t),n=e,r=[{key:"setSeekBarName",value:function(t){this.seekBarName_=t}},{key:"getChild",value:function(t){return(null==t?void 0:t.toLowerCase())===Yc.toLowerCase()&&(t=this.seekBarName_),(n=e,r=this,"function"==typeof(o=qc(Hc(1&3?n.prototype:n),"getChild",r))?function(t){return o.apply(r,t)}:o)([t]);var n,r,o}}],r&&zc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Qc);function Kc(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;t=t<0?0:t;var n=Math.floor(t%60),r=Math.floor(t/60%60),o=Math.floor(t/3600),i=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(o=r=n="-"),(o=o>0||a>0?o+":":"")+(r=((o||i>=10)&&r<10?"0"+r:r)+":")+(n<10?"0"+n:n)}function Xc(t){return Xc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xc(t)}function Jc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tl(r.key),r)}}function tl(t){var e=function(t){if("object"!=Xc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Xc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xc(e)?e:e+""}function el(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(el=function(){return!!t})()}function nl(){return nl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=rl(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},nl.apply(null,arguments)}function rl(t){return rl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rl(t)}function ol(t,e){return ol=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ol(t,e)}$c.prototype.options_={children:[]},o.Z.registerComponent("ProgressControl",$c);var il=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=rl(e),function(t,e){if(e&&("object"==Xc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,el()?Reflect.construct(e,n||[],rl(t).constructor):e.apply(t,n))}(this,e,[t,n])).hasCustomChapterText=!1,W.useTrack(r.player_,"chapters",!1,(function(t){r.track_=t})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ol(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(){var t,n,r,i=(t=e,n=this,"function"==typeof(r=nl(rl(1&3?t.prototype:t),"createEl",n))?function(t){return r.apply(n,t)}:r)([]);return this.chapter_=o.Z.dom.createEl("div"),i.appendChild(this.chapter_),this.time_=o.Z.dom.createEl("div"),i.appendChild(this.time_),i}},{key:"updateTime",value:function(t){var e=this.player_.duration();if(o.Z.dom.textContent(this.time_,Kc(t,e)),this.track_&&!this.hasCustomChapterText){for(var n=0;n<this.track_.cues.length;n++){var r=this.track_.cues[n],i=r.endTime||e;if(r.startTime<=t&&i>=t)return void o.Z.dom.textContent(this.chapter_,r.text)}o.Z.dom.textContent(this.chapter_,"")}}},{key:"clearChapterContent",value:function(){o.Z.dom.textContent(this.chapter_,"")}},{key:"updateText",value:function(t){o.Z.dom.textContent(this.time_,t)}},{key:"setCustomChapterText",value:function(t){this.hasCustomChapterText=!!t,o.Z.dom.textContent(this.chapter_,null!=t?t:"")}}],r&&Jc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("TimeTooltip"));function al(t){return al="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},al(t)}function ul(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,cl(r.key),r)}}function cl(t){var e=function(t){if("object"!=al(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=al(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==al(e)?e:e+""}function ll(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ll=function(){return!!t})()}function sl(){return sl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=fl(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},sl.apply(null,arguments)}function fl(t){return fl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fl(t)}function pl(t,e){return pl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pl(t,e)}o.Z.registerComponent("TimeTooltip",il);var yl=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=fl(e),function(t,e){if(e&&("object"==al(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ll()?Reflect.construct(e,n||[],fl(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pl(t,e)}(e,t),n=e,r=[{key:"setTrack",value:function(t){this.track_=t}},{key:"createEl",value:function(){var t,n,r,i=(t=e,n=this,"function"==typeof(r=sl(fl(1&3?t.prototype:t),"createEl",n))?function(t){return r.apply(n,t)}:r)(["div",{className:"cv-thumbnail-display"}]);return this.img_=o.Z.dom.createEl("img"),i.appendChild(this.img_),i}},{key:"enable",value:function(){this.addClass("cv-thumbnail-display-enabled")}},{key:"disable",value:function(){this.removeClass("cv-thumbnail-display-enabled")}},{key:"parseImageLink",value:function(t){var e=t.indexOf("#");if(-1===e)return{src:t,w:0,h:0,x:0,y:0};var n=t.substr(0,e),r=t.substr(e+1);if("xywh="!==r.substr(0,5))return{src:t,w:0,h:0,x:0,y:0};var o=this.getScale(),i=r.substr(5).split(",");return{src:n,w:parseInt(i[2])*o,h:parseInt(i[3])*o,x:parseInt(i[0])*o,y:parseInt(i[1])*o}}},{key:"getScale",value:function(){var t=this.options_.scaleFactor,e=this.player_.whiteboardModePlugin().side;return this.player_.isFullscreen()&&"bottom"!==e&&(t*=2),t}},{key:"update",value:function(t){var e,n;if(null===(n=null===(e=this.track_)||void 0===e?void 0:e.cues)||void 0===n?void 0:n.length){for(var r,o=t,i=0;i<this.track_.cues.length;){var a=this.track_.cues[i];if(a.startTime<=o&&a.endTime>=o){r=this.parseImageLink(a.text);break}i++}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,y=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(y,")"),this.el_.style.width=l+"px",this.el_.style.height=s+"px"}else this.disable()}}}],r&&ul(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function hl(t){return hl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hl(t)}function dl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vl(r.key),r)}}function vl(t){var e=function(t){if("object"!=hl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=hl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hl(e)?e:e+""}function bl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(bl=function(){return!!t})()}function ml(t){return ml=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ml(t)}function gl(t,e){return gl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gl(t,e)}yl.prototype.options_={scaleFactor:1},o.Z.registerComponent("ThumbnailDisplay",yl);var wl=o.Z.getComponent("MouseTimeDisplay"),Ol="cv-mouse-time-display-force-show",Pl=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,n){return e=ml(e),function(t,e){if(e&&("object"==hl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,bl()?Reflect.construct(e,n||[],ml(t).constructor):e.apply(t,n))}(this,e,[t,n]),W.useTrack(r.player_,"metadata","thumbnails",(function(t){r.getChild("ThumbnailDisplay").setTrack(t)})),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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gl(t,e)}(e,t),n=e,(r=[{key:"update",value:function(t,e){var n=this;this.requestAnimationFrame((function(){var r=n.getChild("TimeTooltip"),o=n.getChild("ThumbnailDisplay"),i=e*n.player_.duration(),a=n.player_.preventScrubbingPlugin(),u=n.player_.controlBar.getChild("progressControl").getChild(Qi),c=!1;a.isEnabled&&(c=i>a.furthestVisitedTime),c?(n.hide(),u.show(),Q(u.hide,1e3,!1,u)()):(n.show(),u&&u.hide(!0),o.update(i),r.updateTime(i));var l=n.el_.getBoundingClientRect();n.el_.style.marginLeft=-l.width/2+"px";var s=t.width*e;s<l.width/2?n.el_.style.left=l.width/2+"px":s>t.width-l.width/2?n.el_.style.left=t.width-l.width/2+"px":n.el_.style.left=t.width*e+"px"}))}},{key:"forceShow",value:function(){this.addClass(Ol)}},{key:"removeForceShow",value:function(){this.removeClass(Ol)}}])&&dl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(wl);function Sl(t){return Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sl(t)}function jl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,kl(r.key),r)}}function kl(t){var e=function(t){if("object"!=Sl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Sl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sl(e)?e:e+""}function _l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_l=function(){return!!t})()}function El(){return El="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Cl(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},El.apply(null,arguments)}function Cl(t){return Cl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Cl(t)}function Tl(t,e){return Tl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tl(t,e)}Pl.prototype.options_={children:["ThumbnailDisplay","TimeTooltip"]},o.Z.registerComponent("MouseTimeDisplay",Pl);var xl=o.Z.getComponent("ChaptersTrackMenuItem"),Ll=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Cl(e),function(t,e){if(e&&("object"==Sl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,_l()?Reflect.construct(e,n||[],Cl(t).constructor):e.apply(t,n))}(this,e,[t,n])).nonIconControl=!1,r.thumbnailDisplay=new yl(r.player_,{scaleFactor:.5}),r.el().insertBefore(r.thumbnailDisplay.el(),r.el().firstChild),W.useTrack(r.player_,"metadata","thumbnails",(function(t){r.addClass("cv-has-thumbnails"),r.thumbnailDisplay.setTrack(t),r.thumbnailDisplay.update(r.options_.cue.startTime)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tl(t,e)}(e,t),n=e,r=[{key:"update",value:function(){this.player_&&xl.prototype.update.call(this)}},{key:"buildCSSClass",value:function(){return"vjs-menu-item cv-chapter-menu-item"}},{key:"createEl",value:function(t,n,r){return this.nonIconControl=!0,(o=e,i=this,"function"==typeof(a=El(Cl(1&3?o.prototype:o),"createEl",i))?function(t){return a.apply(i,t)}:a)(["li",Object.assign({className:this.buildCSSClass(),innerHTML:this.getInnerHTML(),tabIndex:-1},n),r]);var o,i,a}},{key:"getInnerHTML",value:function(){var t=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(Kc(this.options_.cue.startTime,t),")</p>")+"</span>"}}],r&&jl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(xl);function Rl(t){return Rl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rl(t)}function Il(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Dl(r.key),r)}}function Dl(t){var e=function(t){if("object"!=Rl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rl(e)?e:e+""}function Bl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Bl=function(){return!!t})()}function Nl(t,e,n,r){var o=Ml(Al(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Ml(){return Ml="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Al(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ml.apply(null,arguments)}function Al(t){return Al=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Al(t)}function Fl(t,e){return Fl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fl(t,e)}var Zl=function(t){function e(t,n,r){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=function(t,e,n){return e=Al(e),function(t,e){if(e&&("object"==Rl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Bl()?Reflect.construct(e,n||[],Al(t).constructor):e.apply(t,n))}(this,e,[t,n,r])).alwaysCollapsed=!1,o.isCollapsed=!1,o.isCollabsible=!0,o.update=o.update.bind(o),o.player_.on("cv-whiteboard-change",o.update),o.player_.on("fullscreenchange",o.update),o.player_.on("dispose",(function(){o.player_.off("cv-whiteboard-change",o.update),o.player_.off("fullscreenchange",o.update)})),o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fl(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-chapters-button ".concat(Nl(e,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-big ".concat(Nl(e,"buildWrapperCSSClass",this,3)([]))}},{key:"createItems",value:function(){var t=[];if(!this.track_)return t;var e=this.track_.cues;if(!e)return t;for(var n=0,r=e.length;n<r;n++){var o=e[n],i=new Ll(this.player_,{track:this.track_,cue:o});t.push(i)}return t}},{key:"setTrack",value:function(t){var n=this;if(Nl(e,"setTrack",this,3)([t]),this.track_&&"chapters"===this.track_.kind){t.one("loadeddata",this.update);var r=function(){n.update(),n.player_.trigger("resizemenus")};t.on("cv:cuechange",r),this.player_.one("dispose",(function(){return t.off("cv:cueupdate",r)}))}}},{key:"update",value:function(t){Nl(e,"update",this,3)([t])}},{key:"getCollabsibleName",value:function(){return"Chapters"}},{key:"getCollabsibleValue",value:function(){var t=this.track_.activeCues[0];return(null==t?void 0:t.text)||""}},{key:"showInCollabsibleMenu",value:function(){if(!this.track_)return!1;var t=this.track_.cues;return!(!t||!t.length)}},{key:"showCollapsibleMenu",value:function(){this.handleClick(null)}}])&&Il(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("ChaptersButton"));function Vl(t){return Vl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vl(t)}function zl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ul(r.key),r)}}function Ul(t){var e=function(t){if("object"!=Vl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vl(e)?e:e+""}function Gl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gl=function(){return!!t})()}function ql(){return ql="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Hl(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},ql.apply(null,arguments)}function Hl(t){return Hl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hl(t)}function Wl(t,e){return Wl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wl(t,e)}o.Z.registerComponent("ChaptersButton",Zl);var Ql=o.Z.getComponent("OffTextTrackMenuItem"),Yl=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Hl(e),function(t,e){if(e&&("object"==Vl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gl()?Reflect.construct(e,n||[],Hl(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wl(t,e)}(e,t),n=e,r=[{key:"handleClick",value:function(t){Ql.prototype.handleClick.call(this,t),this.player_.trigger("cv:languageselected")}},{key:"createEl",value:function(t,n,r){return(o=e,i=this,"function"==typeof(a=ql(Hl(1&3?o.prototype:o),"createEl",i))?function(t){return a.apply(i,t)}:a)(["li",Object.assign(Object.assign({className:"vjs-menu-item",tabIndex:-1},n),{innerHTML:'<span class="vjs-menu-item-text">Off</span>'}),r]);var o,i,a}}],r&&zl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ql);function $l(t){return $l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$l(t)}function Kl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xl(r.key),r)}}function Xl(t){var e=function(t){if("object"!=$l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$l(e)?e:e+""}function Jl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Jl=function(){return!!t})()}function ts(t){return ts=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ts(t)}function es(t,e){return es=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},es(t,e)}o.Z.registerComponent("OffTextTrackMenuItem",Yl);var ns=o.Z.getComponent("TextTrackButton"),rs=o.Z.getComponent("TextTrackMenuItem"),os=o.Z.getComponent("OffTextTrackMenuItem"),is=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=ts(e),function(t,e){if(e&&("object"==$l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Jl()?Reflect.construct(e,n||[],ts(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&es(t,e)}(e,t),n=e,r=[{key:"createItems",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rs;this.label_&&(t="".concat(this.label_," off")),e.push(new os(this.player_,{kinds:this.kinds_,kind:this.kind_,label:t})),this.hideThreshold_+=1;var r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var o=0;o<r.length;o++){var i=r[o];if(this.kinds_.indexOf(i.kind)>-1){var a=new n(this.player_,{track:i,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});a.addClass("vjs-".concat(i.kind,"-menu-item")),e.push(a)}}return e}}],r&&Kl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ns);function as(t){return as="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},as(t)}function us(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,cs(r.key),r)}}function cs(t){var e=function(t){if("object"!=as(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=as(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==as(e)?e:e+""}function ls(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ls=function(){return!!t})()}function ss(t){return ss=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ss(t)}function fs(t,e){return fs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fs(t,e)}o.Z.registerComponent("TextTrackButton",is);var ps=o.Z.getComponent("SubsCapsMenuItem"),ys=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=ss(e),function(t,e){if(e&&("object"==as(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ls()?Reflect.construct(e,n||[],ss(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fs(t,e)}(e,t),n=e,(r=[{key:"handleClick",value:function(t){ps.prototype.handleClick.call(this,t),this.player_.trigger("cv:languageselected")}}])&&us(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ps);function hs(t){return hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hs(t)}function ds(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vs(r.key),r)}}function vs(t){var e=function(t){if("object"!=hs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=hs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hs(e)?e:e+""}function bs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(bs=function(){return!!t})()}function ms(t){return ms=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ms(t)}function gs(t,e){return gs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gs(t,e)}var ws=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r={};r.track={player:t,kind:"subtitle",label:"Search Captions",selectable:!1,default:!1,mode:"disabled"},r.selectable=!1,r.name="SubtitleSearchMenuItem",(n=function(t,e,n){return e=ms(e),function(t,e){if(e&&("object"==hs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,bs()?Reflect.construct(e,n||[],ms(t).constructor):e.apply(t,n))}(this,e,[t,r])).addClass("vjs-texttrack-settings"),n.addClass("cv-subtitle-search-menu-item"),n.controlText(", opens subtitle search"),n.toggleEnabled=n.toggleEnabled.bind(n);var o=n.player_.textTracks();return o.addEventListener("selectedlanguagechange",n.toggleEnabled),n.player_.one("dispose",(function(){o.removeEventListener("selectedlanguagechange",n.toggleEnabled)})),n.toggleEnabled(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gs(t,e)}(e,t),n=e,(r=[{key:"toggleEnabled",value:function(){var t;if(this.player_){var e=W.getCurrentTextTrack(this.player_);e?(null===(t=e.cues)||void 0===t?void 0:t.length)?this.removeClass("vjs-disabled"):(this.bindTrackEvents(e),this.addClass("vjs-disabled")):this.addClass("vjs-disabled")}}},{key:"bindTrackEvents",value:function(t){var e=this;t.removeEventListener("loadeddata",this.toggleEnabled),t.addEventListener("loadeddata",this.toggleEnabled),this.player_.one("dispose",(function(){t.removeEventListener("loadeddata",e.toggleEnabled)}))}},{key:"handleClick",value:function(){var t,e=this,n=W.getCurrentTextTrack(this.player_);(null===(t=null==n?void 0:n.cues)||void 0===t?void 0:t.length)&&this.requestAnimationFrame((function(){e.player_.getChild("collapserator").getChild("subtitleSearchButton").showCollapsibleMenu()}))}}])&&ds(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("TextTrackMenuItem"));function Os(t){return Os="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Os(t)}function Ps(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ss(r.key),r)}}function Ss(t){var e=function(t){if("object"!=Os(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Os(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Os(e)?e:e+""}function js(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(js=function(){return!!t})()}function ks(t){return ks=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ks(t)}function _s(t,e){return _s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_s(t,e)}var Es=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r={};return r.track={player:t,kind:"subtitle",label:"Caption Text Size",selectable:!1,default:!1,mode:"disabled"},r.selectable=!1,r.name="SubtitleSizeMenuItem",(n=function(t,e,n){return e=ks(e),function(t,e){if(e&&("object"==Os(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,js()?Reflect.construct(e,n||[],ks(t).constructor):e.apply(t,n))}(this,e,[t,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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_s(t,e)}(e,t),n=e,(r=[{key:"handleClick",value:function(){var t=this;this.requestAnimationFrame((function(){t.player_.getChild("collapserator").getChild("subtitleSizeButton").showCollapsibleMenu()}))}}])&&Ps(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("TextTrackMenuItem"));function Cs(t){return Cs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cs(t)}function Ts(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xs(r.key),r)}}function xs(t){var e=function(t){if("object"!=Cs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Cs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cs(e)?e:e+""}function Ls(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ls=function(){return!!t})()}function Rs(){return Rs="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Is(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Rs.apply(null,arguments)}function Is(t){return Is=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Is(t)}function Ds(t,e){return Ds=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ds(t,e)}var Bs=o.Z.getComponent("TextTrackButton"),Ns=o.Z.getComponent("SubsCapsButton"),Ms=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Is(e),function(t,e){if(e&&("object"==Cs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ls()?Reflect.construct(e,n||[],Is(t).constructor):e.apply(t,n))}(this,e,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t.className="cv-subs-caps-menu-button",t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ds(t,e)}(e,t),n=e,r=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat((t=e,n=this,"function"==typeof(r=Rs(Is(1&3?t.prototype:t),"buildWrapperCSSClass",n))?function(t){return r.apply(n,t)}:r)([]));var t,n,r}},{key:"createItems",value:function(){var t=[];return this.player_.options_.mobile||(t.push(new ws(this.player_)),t.push(new Es(this.player_)),this.hideThreshold_=this.hideThreshold_+2),Bs.prototype.createItems.call(this,t,ys)}},{key:"getCollabsibleName",value:function(){return"Subtitles"}},{key:"getCollabsibleValue",value:function(){for(var t=this.player_.textTracks(),e=0;e<t.length;e++){var n=t[e];if(this.kinds_.indexOf(n.kind)>-1&&"showing"===n.mode)return n.label}return"Off"}},{key:"showInCollabsibleMenu",value:function(){for(var t=this.player_.textTracks(),e=0;e<t.length;e++){var n=t[e];if(this.kinds_.indexOf(n.kind)>-1)return!0}return!1}},{key:"showCollapsibleMenu",value:function(){Ns.prototype.handleClick.apply(this)}}],r&&Ts(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ns);function As(t){return As="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},As(t)}function Fs(){Fs=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==As(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(As(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Zs(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Vs(r.key),r)}}function Vs(t){var e=function(t){if("object"!=As(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=As(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==As(e)?e:e+""}function zs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(zs=function(){return!!t})()}function Us(t){return Us=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Us(t)}function Gs(t,e){return Gs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gs(t,e)}o.Z.registerComponent("SubsCapsButton",Ms);var qs="<span class='vjs-local-cache-indicator-icon' title='Streaming from ClickView Local Cache'>".concat(xr,"</span>"),Hs=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Us(e),function(t,e){if(e&&("object"==As(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zs()?Reflect.construct(e,n||[],Us(t).constructor):e.apply(t,n))}(this,e,[t,n])).qualityId=n.qualityId;var o=t.qualityLevels(),i=r.handleQualityChange.bind(r);return o.on("change",i),t.one("dispose",(function(){o.off("change",i)})),r.handleLocalCacheChange=r.handleLocalCacheChange.bind(r),r.player_.ready((function(){r.player_&&(r.player_.on("localcachechanged",r.handleLocalCacheChange),r.player_.one("dispose",(function(){var t;null===(t=r.player_)||void 0===t||t.off("localcachechanged",r.handleLocalCacheChange)})),r.handleLocalCacheChange())})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gs(t,e)}(e,t),n=e,(r=[{key:"handleLocalCacheChange",value:function(){return t=this,e=void 0,n=void 0,r=Fs().mark((function t(){var e,n;return Fs().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.player_.localCache(),t.next=3,e.getActiveLocalCache();case 3:if(null==(n=t.sent)?void 0:n.playbackProfile){t.next=9;break}return this.show(),this.enable(),this.setLabel(this.options_.label),t.abrupt("return");case 9:n.playbackProfile!==this.qualityId?this.disable():this.setLabel(this.options_.label+qs);case 10:case"end":return t.stop()}}),t,this)})),new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}},{key:"setLabel",value:function(t){var e=this.$(".vjs-menu-item-text");e&&(e.innerHTML=t)}},{key:"buildCSSClass",value:function(){return"vjs-menu-item cv-quality-menu-item"}},{key:"handleClick",value:function(){for(var t=this.player_.qualityLevels(),e=0;e<t.length;e++){var n=t[e];n.enabled=n.id===this.qualityId}}},{key:"handleQualityChange",value:function(){if(this.player_){var t=this.player_.qualityLevels(),e=t[t.selectedIndex],n=e&&e.id===this.qualityId;n!==this.isSelected_&&this.selected(n)}}}])&&Zs(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function Ws(t){return Ws="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ws(t)}function Qs(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ys(r.key),r)}}function Ys(t){var e=function(t){if("object"!=Ws(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ws(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ws(e)?e:e+""}function $s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return($s=function(){return!!t})()}function Ks(t,e,n,r){var o=Xs(Js(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Xs(){return Xs="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Js(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Xs.apply(null,arguments)}function Js(t){return Js=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Js(t)}function tf(t,e){return tf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tf(t,e)}var ef={144:"144p (Preview)",240:"240p",360:"360p",480:"480p",720:"720p",1080:"1080p"},nf=o.Z.getComponent("MenuButton"),rf=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Js(e),function(t,e){if(e&&("object"==Ws(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,$s()?Reflect.construct(e,n||[],Js(t).constructor):e.apply(t,n))}(this,e,[t,n])).alwaysCollapsed=!0,r.isCollapsed=!1,r.isCollabsible=!0,r.className="cv-quality-menu-button";var o=r.player_.qualityLevels(),i=r.update.bind(r);return o.on("addqualitylevel",i),o.on("removequalitylevel",i),t.one("dispose",(function(){o.removeEventListener("addqualitylevel",i),o.removeEventListener("removequalitylevel",i)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&tf(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-quality-button ".concat(Ks(e,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small vjs-quality-button cv-has-left-icons ".concat(Ks(e,"buildWrapperCSSClass",this,3)([]))}},{key:"createItems",value:function(){var t=[],e=this.player_.qualityLevels();t.push(new _(this.player_,{label:"Quality"}));for(var n=0;n<e.length;n++){var r=e[n];if(r){var o=ef[r.id];o&&t.push(new Hs(this.player_,{qualityId:r.id,label:o,selectable:!0,multiSelectable:!1}))}}return t}},{key:"getCollabsibleName",value:function(){return"Quality"}},{key:"getCollabsibleValue",value:function(){var t=this.player_.qualityLevels(),e=t[t.selectedIndex];return e?ef[e.id]:""}},{key:"showInCollabsibleMenu",value:function(){return!!this.player_.qualityLevels().length}},{key:"showCollapsibleMenu",value:function(){nf.prototype.handleClick.apply(this)}}])&&Qs(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(nf);function of(t){return of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},of(t)}function af(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,uf(r.key),r)}}function uf(t){var e=function(t){if("object"!=of(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=of(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==of(e)?e:e+""}function cf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(cf=function(){return!!t})()}function lf(){return lf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=sf(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},lf.apply(null,arguments)}function sf(t){return sf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sf(t)}function ff(t,e){return ff=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ff(t,e)}o.Z.registerComponent("QualityButton",rf);var pf=o.Z.getComponent("Menu"),yf=o.Z.getComponent("MenuButton"),hf=o.Z.getComponent("PlaybackRateMenuItem"),df=o.Z.getComponent("PlaybackRateMenuButton"),vf=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=sf(e),function(t,e){if(e&&("object"==of(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,cf()?Reflect.construct(e,n||[],sf(t).constructor):e.apply(t,n))}(this,e,arguments)).alwaysCollapsed=!0,t.isCollapsed=!1,t.isCollabsible=!0,t.className="cv-playback-rate-menu-button",t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ff(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=yf.prototype.createEl).apply.apply(t,[this].concat(n))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat((t=e,n=this,"function"==typeof(r=lf(sf(1&3?t.prototype:t),"buildWrapperCSSClass",n))?function(t){return r.apply(n,t)}:r)([]));var t,n,r}},{key:"createMenu",value:function(){var t=new pf(this.player(),{menuButton:this});t.addItem(new _(this.player_,{label:"Playback Speed"}));var e=this.playbackRates();if(e)for(var n=0;n<e.length;n++){var r=e[n]+"x";1===e[n]&&(r+=" (Normal)"),t.addItem(new hf(this.player(),{rate:r}))}return t}},{key:"handleClick",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=yf.prototype.handleClick).apply.apply(t,[this].concat(n))}},{key:"updateLabel",value:function(){var t;this.setupLabelEl();for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=df.prototype.updateLabel).apply.apply(t,[this].concat(n))}},{key:"setupLabelEl",value:function(){if(!this.labelEl_){var t=this.$("button");t&&(this.labelEl_=o.Z.dom.createEl("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.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&&af(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(df);function bf(t){return bf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bf(t)}function mf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gf(r.key),r)}}function gf(t){var e=function(t){if("object"!=bf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bf(e)?e:e+""}function wf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wf=function(){return!!t})()}function Of(t){return Of=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Of(t)}function Pf(t,e){return Pf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pf(t,e)}o.Z.registerComponent("PlaybackRateMenuButton",vf);var Sf=o.Z.getComponent("TextTrackSettings"),jf={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",edgeStyle:void 0,fontFamily:"proportionalSansSerif",fontPercent:1,textOpacity:"1",windowColor:"#000",windowOpacity:"0"},kf={small:jf,medium:Object.assign(Object.assign({},jf),{fontPercent:1.5}),large:Object.assign(Object.assign({},jf),{fontPercent:2})},_f=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Of(e),function(t,e){if(e&&("object"==bf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wf()?Reflect.construct(e,n||[],Of(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pf(t,e)}(e,t),n=e,(r=[{key:"setSizeSetting",value:function(t){var e=this;this.size_=t,this.player_.getChild("textTrackDisplay").updateDisplay();var n=this.player_.getChild("collapserator").getChild("subtitleSizeButton");this.player_.trigger("changesubtitlesize",this.size_),window.requestAnimationFrame((function(){n.update(),e.player_.trigger("resizemenus")}))}},{key:"getSizeSetting",value:function(){return this.size_||"small"}},{key:"getValues",value:function(){return kf[this.size_]?kf[this.size_]:jf}}])&&mf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sf);function Ef(t){return Ef="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ef(t)}function Cf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Tf(r.key),r)}}function Tf(t){var e=function(t){if("object"!=Ef(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ef(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ef(e)?e:e+""}function xf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(xf=function(){return!!t})()}function Lf(t,e,n,r){var o=Rf(If(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Rf(){return Rf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=If(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Rf.apply(null,arguments)}function If(t){return If=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},If(t)}function Df(t,e){return Df=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Df(t,e)}o.Z.registerComponent("TextTrackSettings",_f);var Bf=window.navigator&&window.navigator.userAgent||"",Nf=(/iPod/i.test(Bf),/Android/i.test(Bf),o.Z.getComponent("Player")),Mf=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=If(e),function(t,e){if(e&&("object"==Ef(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,xf()?Reflect.construct(e,n||[],If(t).constructor):e.apply(t,n))}(this,e,[t,n]))._dataLoaded=!1,n.mobile&&r.addClass("cv-mobile-player");var o=function(){return r._dataLoaded=!0};return r.on("cv-playback-data-loaded",o),r.on("dispose",(function(){return r.off("cv-playback-data-loaded",o)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Df(t,e)}(e,t),n=e,(r=[{key:"dataLoaded",value:function(t){var e=this;this._dataLoaded?t():(this.one("cv-playback-data-loaded",t),this.one("dispose",(function(){e.off("cv-playback-data-loaded",t)})))}},{key:"lock",value:function(t){this.callback_=t}},{key:"unlock",value:function(){delete this.callback_}},{key:"currentTime",value:function(t,n){var r=this;if("number"!=typeof t||!this.callback_||n)return Lf(e,"currentTime",this,3)([t]);this.callback_((function(){r.unlock(),r.currentTime(t)}))}},{key:"play",value:function(){var t=this;if(!this.callback_)return Lf(e,"play",this,3)([]);this.callback_((function(){t.unlock(),t.play()}))}},{key:"updateStyleEl_",value:function(){if(Nf.prototype.updateStyleEl_.call(this),this.options_.fluid){var t=this.el_.parentNode;if(t&&this.options_.setMaxHeight){var e=this.aspectRatio();if(void 0!==e&&"auto"!==e||(e=this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9"),this.player_.playerModePlugin().getMode()===La.Hover)return t.style.removeProperty("maxWidth"),void t.style.removeProperty("margin");var n=e.split(":"),r=+n[1]/+n[0];t.style.maxWidth=85/r+"vh",t.style.margin="0 auto"}}}},{key:"listenForUserActivity_",value:function(){var t=this;Nf.prototype.listenForUserActivity_.call(this);var e=this.getChild("collapserator");e.on("mouseenter",(function(){t.player().cache_.inactivityTimeout=t.player().options_.inactivityTimeout,t.player().options_.inactivityTimeout=0})),e.on("mouseleave",(function(){t.player().options_.inactivityTimeout=t.player().cache_.inactivityTimeout}))}}])&&Cf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Nf);function Af(t){return Af="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Af(t)}function Ff(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zf(r.key),r)}}function Zf(t){var e=function(t){if("object"!=Af(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Af(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Af(e)?e:e+""}function Vf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Vf=function(){return!!t})()}function zf(t){return zf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zf(t)}function Uf(t,e){return Uf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uf(t,e)}Mf.prototype.options_=Object.assign(Object.assign({},Nf.prototype.options_),{setMaxHeight:!0}),o.Z.registerComponent("player",Mf);var Gf=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=zf(e),function(t,e){if(e&&("object"==Af(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Vf()?Reflect.construct(e,n||[],zf(t).constructor):e.apply(t,n))}(this,e,[t,n])).player_.addClass("cv-disable-play-pause-feedback"),r.onFirstPlay=r.onFirstPlay.bind(r),r.player_.one("firstplay",r.onFirstPlay),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Uf(t,e)}(e,t),n=e,(r=[{key:"dispose",value:function(){this.player_.off("firstplay",this.onFirstPlay)}},{key:"onFirstPlay",value:function(){var t=this;window.setTimeout((function(){t.player_.isDisposed()||t.player_.removeClass("cv-disable-play-pause-feedback")}),500)}},{key:"createEl",value:function(){return o.Z.dom.createEl("div",{className:"cv-play-pause-feedback"})}}])&&Ff(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function qf(t){return qf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qf(t)}function Hf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Wf(r.key),r)}}function Wf(t){var e=function(t){if("object"!=qf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=qf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qf(e)?e:e+""}function Qf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qf=function(){return!!t})()}function Yf(t){return Yf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yf(t)}function $f(t,e){return $f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$f(t,e)}o.Z.registerComponent("PlayPauseFeedback",Gf);var Kf=o.Z.getComponent("PlayToggle"),Xf=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Yf(e),function(t,e){if(e&&("object"==qf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Qf()?Reflect.construct(e,n||[],Yf(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$f(t,e)}(e,t),n=e,(r=[{key:"handleClick",value:function(t){var e=this;Kf.prototype.handleClick.call(this,t),this.player_.addClass("cv-disable-play-pause-feedback"),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){e.player_.removeClass("cv-disable-play-pause-feedback")}),500)}}])&&Hf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Kf);function Jf(t){return Jf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jf(t)}function tp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ep(r.key),r)}}function ep(t){var e=function(t){if("object"!=Jf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Jf(e)?e:e+""}function np(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(np=function(){return!!t})()}function rp(t){return rp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rp(t)}function op(t,e){return op=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},op(t,e)}o.Z.registerComponent("PlayToggle",Xf);var ip=o.Z.getComponent("TextTrackDisplay"),ap=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=rp(e),function(t,e){if(e&&("object"==Jf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,np()?Reflect.construct(e,n||[],rp(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&op(t,e)}(e,t),n=e,(r=[{key:"updateDisplayState",value:function(t){ip.prototype.updateDisplayState.call(this,t);for(var e=this.player_.textTrackSettings.getValues(),n=t.activeCues,r=n.length;r--;){var o=n[r];if(o){var i=o.displayState;if(e.fontPercent&&1!==e.fontPercent){var a=.025*this.el().getBoundingClientRect().width*100/100;i.style.fontSize=a*e.fontPercent+"px"}}}}}])&&tp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ip);function up(t){return up="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},up(t)}function cp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,lp(r.key),r)}}function lp(t){var e=function(t){if("object"!=up(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=up(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==up(e)?e:e+""}function sp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(sp=function(){return!!t})()}function fp(t){return fp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fp(t)}function pp(t,e){return pp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pp(t,e)}o.Z.registerComponent("TextTrackDisplay",ap);var yp=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=fp(e),function(t,e){if(e&&("object"==up(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,sp()?Reflect.construct(e,n||[],fp(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pp(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){return o.Z.dom.createEl("div",{className:"cv-control-bar-gradient-container",innerHTML:'<div class="cv-control-bar-gradient"></div>'})}}])&&cp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function hp(t){return hp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hp(t)}function dp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vp(r.key),r)}}function vp(t){var e=function(t){if("object"!=hp(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=hp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hp(e)?e:e+""}function bp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(bp=function(){return!!t})()}function mp(t,e,n,r){var o=gp(wp(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function gp(){return gp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=wp(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},gp.apply(null,arguments)}function wp(t){return wp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wp(t)}function Op(t,e){return Op=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Op(t,e)}o.Z.registerComponent("ControlBarGradient",yp);var Pp=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=wp(e),function(t,e){if(e&&("object"==hp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,bp()?Reflect.construct(e,n||[],wp(t).constructor):e.apply(t,n))}(this,e,[t,n])).options_=n,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Op(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){var t=this.options_.title;if(!this.options_.seriesName)return mp(e,"createEl",this,3)(["h1",{innerHTML:t}]);var n=this.buildSeasonEpisodeString();return n?(t="<div class='cv-splash-series'>".concat(this.options_.seriesName.toUpperCase()," ").concat(n,"</div>")+t,mp(e,"createEl",this,3)(["h1",{innerHTML:t}])):(t="<div class='cv-splash-series'>".concat(this.options_.seriesName.toUpperCase(),"</div>")+t,mp(e,"createEl",this,3)(["h1",{innerHTML:t}]))}},{key:"buildSeasonEpisodeString",value:function(){if(!this.options_.seasonNumber||!this.options_.episodeNumber)return"";var t=this.padNumber(this.options_.seasonNumber,2),e=this.padNumber(this.options_.episodeNumber,2);return"S".concat(t," • E").concat(e)}},{key:"padNumber",value:function(t,e){var n=t.toString();if(n.length>=e)return n;for(e-=n.length;e>0;)n="0"+n,e--;return n}}])&&dp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Sp(t){return Sp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sp(t)}function jp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,kp(r.key),r)}}function kp(t){var e=function(t){if("object"!=Sp(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Sp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sp(e)?e:e+""}function _p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_p=function(){return!!t})()}function Ep(){return Ep="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Cp(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ep.apply(null,arguments)}function Cp(t){return Cp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Cp(t)}function Tp(t,e){return Tp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tp(t,e)}var xp=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Cp(e),function(t,e){if(e&&("object"==Sp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,_p()?Reflect.construct(e,n||[],Cp(t).constructor):e.apply(t,n))}(this,e,[t,n])).options_=n,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tp(t,e)}(e,t),n=e,r=[{key:"buildCSSClass",value:function(){return"cv-splash-rating ".concat((t=this.options_.ratingValue)?function(t){switch(!0){case t<32:return"cv-rating-purple";case t<48:return"cv-rating-green";case t<80:return"cv-rating-blue";case t<96:return"cv-rating-red";case t<128:return"cv-rating-pink";case t>=128:return"cv-rating-yellow";default:return""}}(t):"");var t}},{key:"createEl",value:function(t,n,r){return this.options_.ratingCode?(o=e,i=this,"function"==typeof(a=Ep(Cp(1&3?o.prototype:o),"createEl",i))?function(t){return a.apply(i,t)}:a)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass(),innerHTML:this.options_.ratingCode}),r]):null;var o,i,a}}],r&&jp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Lp(t){return Lp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lp(t)}function Rp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ip(r.key),r)}}function Ip(t){var e=function(t){if("object"!=Lp(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Lp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Lp(e)?e:e+""}function Dp(t,e){if(e&&("object"==Lp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Bp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Bp=function(){return!!t})()}function Np(t){return Np=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Np(t)}function Mp(t,e){return Mp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mp(t,e)}var Ap=function(t){function e(t,n){var r,o,i,a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o=this,a=[t,n],i=Np(i=e),r=Dp(o,Bp()?Reflect.construct(i,a||[],Np(o).constructor):i.apply(o,a)),n.embed?(r.addChild(new Pp(t,n)),r.addChild(new xp(t,n)),r):Dp(r,r)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mp(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){return o.Z.dom.createEl("div",{className:"cv-splash-metadata"})}}])&&Rp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Fp(t){return Fp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fp(t)}function Zp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Vp(r.key),r)}}function Vp(t){var e=function(t){if("object"!=Fp(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fp(e)?e:e+""}function zp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(zp=function(){return!!t})()}function Up(t){return Up=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Up(t)}function Gp(t,e){return Gp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gp(t,e)}var qp=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Up(e),function(t,e){if(e&&("object"==Fp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zp()?Reflect.construct(e,n||[],Up(t).constructor):e.apply(t,n))}(this,e,[t,n])).addChild(new Ap(t,n)),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gp(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){var t="<div class='cv-splash-mask'></div>";return this.options_.embed&&(t+="<div class='cv-splash-logo'>".concat(mn,"</div>")),o.Z.dom.createEl("div",{className:"vjs-poster cv-embed-splash cv-embed-splash-black",tabIndex:-1,innerHTML:t})}}])&&Zp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("posterImage"));function Hp(t){return Hp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hp(t)}function Wp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Qp(r.key),r)}}function Qp(t){var e=function(t){if("object"!=Hp(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Hp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hp(e)?e:e+""}function Yp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Yp=function(){return!!t})()}function $p(t){return $p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$p(t)}function Kp(t,e){return Kp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Kp(t,e)}o.Z.registerComponent("posterImage",qp);var Xp=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=$p(e),function(t,e){if(e&&("object"==Hp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Yp()?Reflect.construct(e,n||[],$p(t).constructor):e.apply(t,n))}(this,e,[t,n])).el().prepend(r.getErrorImage()),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kp(t,e)}(e,t),n=e,(r=[{key:"getErrorImage",value:function(){return o.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 '})}}])&&Wp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("ErrorDisplay"));o.Z.registerComponent("ErrorDisplay",Xp);var Jp=n(67453),ty=n(54610);function ey(t){return ey="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ey(t)}function ny(){ny=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==ey(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(ey(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function ry(t){return function(t){if(Array.isArray(t))return oy(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return oy(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oy(t,e):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.")}()}function oy(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function iy(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ay(r.key),r)}}function ay(t){var e=function(t){if("object"!=ey(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ey(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ey(e)?e:e+""}var uy,cy=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},ly=o.Z.getComponent("Player"),sy=function(){return t=function t(e,n){var r=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.streamLogged=!1,this.options=o.Z.mergeOptions({},t.options_,n),null===this.options.playerApi)throw new Error("PlayerApi required");this.initialize(),this.createEl(e),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(t){return r.handleFetchError(t)}))}))},(e=[{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(t){var e;null===(e=this.analyticsService)||void 0===e||e.logVideoProgress(t)}},{key:"buildVideoJs",value:function(){return this.player=(0,o.Z)(this.el,this.getPlayerOptions())}},{key:"getInactivityTimeout",value:function(){if("number"==typeof this.options.inactivityTimeout)return this.options.inactivityTimeout;var t=500;return(this.options.mobile||o.Z.browser.IS_IOS||o.Z.browser.IS_ANDROID)&&(t=3e3),t}},{key:"getPlayerOptions",value:function(){var t=this,e=ly.prototype.options_.children;return e=e.filter((function(t){return"bigPlayButton"!==t&&"posterImage"!==t})),{controls:this.options.controls,fluid:!this.options.embed&&!this.options.mobile,fill:this.options.embed||this.options.mobile,inactivityTimeout:this.getInactivityTimeout(),controlBar:{children:["timeWrapper","progressControl"]},children:[].concat(ry(e),[{name:"collapserator",children:Jt.filter((function(e){return!("fullscreenToggle"===e&&!t.options.allowFullscreen)}))},"playPauseFeedback","controlBarGradient"]),userActions:{hotkeys:function(e){return function(t,e,n){var r=Pe()(t);("f"!==r||n.allowFullscreen)&&Te[r]&&(["space"].includes(r)&&(t.preventDefault(),t.stopPropagation()),Te[r](e,t))}(e,t.player,t.options)}},playbackRates:this.options.playbackRates,techOrder:["html5"],html5:{nativeTextTracks:!1},playsinline:!0,aspectRatio:this.options.aspectRatio,mobile:this.options.mobile,deferMenus:this.options.deferMenus,muted:this.options.muted,devicesConfig:this.options.devicesConfig}}},{key:"getPlaybackObject",value:function(){return cy(this,void 0,void 0,ny().mark((function t(){var e,n,r=this;return ny().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.offlinePlaybackObject){t.next=2;break}return t.abrupt("return",this.options.offlinePlaybackObject);case 2:if(e=this.options.fetch,void 0===this.options.fetch&&(e=function(t){var e="".concat(r.options.playerApi.origin,"/api/playback?viewKey=").concat(t);return we.get(e)}),this.options.viewKey){t.next=6;break}throw new Error("Please specify a viewKey or a fetch function");case 6:return t.next=8,e(this.options.viewKey);case 8:if(n=t.sent){t.next=11;break}throw new Error("Error fetching playback object");case 11:return t.abrupt("return",n);case 12:case"end":return t.stop()}}),t,this)})))}},{key:"setChaptersInternal",value:function(t,e){var n=W.getTrack(this.player,"chapters",null);n||(n=this.player.addTextTrack("chapters")),ry(n.cues.cues_).forEach((function(t){return n.removeCue(t)})),t.forEach((function(t){n.addCue({startTime:t.timestamp,endTime:t.endTimestamp,text:t.name})})),e&&n.trigger({type:"cv:cuechange",target:n}),n.trigger({type:"loadeddata",target:n})}},{key:"setChapters",value:function(t){this.setChaptersInternal(t,!0)}},{key:"setPlayerMode",value:function(t,e){this.player.playerModePlugin().setPlayerMode(t,e)}},{key:"setFavourite",value:function(t,e){this.player.favouritePlugin().setFavourite(t,e)}},{key:"fetch",value:function(){var t,e,n,r,o;return cy(this,void 0,void 0,ny().mark((function i(){var a,u,c,l=this;return ny().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getPlaybackObject();case 2:if(a=i.sent,!this.isDisposed()){i.next=5;break}return i.abrupt("return");case 5:u="MasterClip"===a.mediaType,c=null===(t=a.additionalData)||void 0===t?void 0:t.clipData,(null===(n=null===(e=a.chapters)||void 0===e?void 0:e.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===(o=this.options.enableLocalCache)||void 0===o||o}),this.player.progressiveFiles({sources:a.files.progressive.map((function(t){return{id:t.profile,mimeType:t.mimeType,url:t.url}}))}),this.player.handleNetworkErrors({playerApi:this.options.playerApi,fileToken:a.files.fileToken}),a.subtitles.list.length>0&&a.subtitles.list.forEach((function(t){if("text/vtt"===t.mimeType){var e=l.player.addRemoteTextTrack({kind:"subtitles",src:t.url,language:t.language,label:t.label},!0);W.sanitizeTrack(e.track,l.player)}})),a.posterUrl&&this.player.poster(Jp.j.createUrl(a.posterUrl,{size:ty.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.ready((function(){l.player.currentTime(l.options.startTime)})),this.player.trigger("cv-playback-data-loaded",a);case 18:case"end":return i.stop()}}),i,this)})))}},{key:"handleFetchError",value:function(t){var e,n=t.message;t instanceof he&&(null===(e=t.response)||void 0===e?void 0:e.type)===Ce.PhysicallyChapteredVideo&&(n="Video cannot be played because it is either corrupt or damaged."),this.player.error(n),this.options.onError&&this.options.onError(t)}},{key:"fetchConfig",value:function(){return cy(this,void 0,void 0,ny().mark((function t(){var e;return ny().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(uy||this.options.fetch||this.options.offlinePlaybackObject)){t.next=2;break}return t.abrupt("return");case 2:return e="".concat(this.options.playerApi.origin,"/api/config"),t.next=5,we.get(e);case 5:if(uy=t.sent,!this.isDisposed()){t.next=8;break}return t.abrupt("return");case 8:this.trigger("config:loaded");case 9:case"end":return t.stop()}}),t,this)})))}},{key:"additionalSetup",value:function(t){var e,n=this;this.player.whiteboardModePlugin(),this.player.deferMenusPlugin();var r=this.options.enableLocalCache&&!!(null===(e=t.localCacheAddresses)||void 0===e?void 0:e.length);uy?this.setupAnalyticsService(t,r):this.one("config:loaded",(function(){return n.setupAnalyticsService(t,r)})),this.analyticsService||!this.isAnalyticsEnabled()?this.setupAnalyticsDependentPlugins(t):this.one("analytics:loaded",(function(){return n.setupAnalyticsDependentPlugins(t)}))}},{key:"setupAnalyticsService",value:function(t,e){this.options.eventLogging&&(this.analyticsService=new ce({collectionApiUrls:uy.collectionApi.urls,collectionApiClientId:uy.collectionApi.clientId,productVersion:"1.26.0",videoId:t.videoId,mediaId:t.mediaId,userId:t.viewerId,shareId:t.shareId,customerId:t.viewerCustomerId,mediaType:t.mediaType,playerType:this.getAnalyticsPlayerType(),isEmbedded:this.options.embed,isUsingLocalCache:e,additionalAnalyticsData:this.getAdditionalAnalyticsData(t),regionName:t.instanceRegion||this.options.sharerInstanceRegion||xe.M.CvApSoutheast1}),this.on("timeupdate",this.logStream),this.trigger("analytics:loaded"))}},{key:"setupAnalyticsDependentPlugins",value:function(t){var e,n,r,o;this.player.persistSubtitleSettingsPlugin({showSubtitles:null===(e=t.settings)||void 0===e?void 0:e.showSubtitles,subtitleSize:null===(n=t.settings)||void 0===n?void 0:n.playbackSubtitleSizeDefault,analyticsService:this.analyticsService}),this.player.persistQualitySettingsPlugin({playbackProfile:null===(r=t.settings)||void 0===r?void 0:r.playbackProfile,playbackProfileLocalCache:null===(o=t.settings)||void 0===o?void 0:o.playbackProfileLocalCache,analyticsService:this.analyticsService}),this.player.persistPlaybackRatePlugin({analyticsService:this.analyticsService})}},{key:"getAdditionalAnalyticsData",value:function(t){return{}}},{key:"isAnalyticsEnabled",value:function(){return!this.options.fetch&&!this.options.offlinePlaybackObject&&this.options.eventLogging}},{key:"handleAutoplay",value:function(t){var e=this;this.options.autoplay&&this.player.ready((function(){e.player.play().catch((function(){e.isDisposed()||e.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(t){var e;"string"==typeof t?(t=function(t){return 0===t.indexOf("#")?t.slice(1):t}(t),e=o.Z.dom.$("#"+t)):e=t;var n="video-js";return this.getPlayerClassName()&&(n+=" ".concat(this.getPlayerClassName())),this.el=o.Z.dom.createEl("video",{},{class:n}),e.appendChild(this.el),this.el}},{key:"getPlayerClassName",value:function(){return""}},{key:"on",value:function(t,e){this.player.on(t,e)}},{key:"one",value:function(t,e){this.player.one(t,e)}},{key:"off",value:function(t,e){this.player.off(t,e)}},{key:"trigger",value:function(t,e){return this.player.trigger(t,e)}},{key:"dispose",value:function(){this.player.dispose()}},{key:"ready",value:function(t){this.player.ready(t)}},{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(t){return this.player.currentTime(t)}},{key:"muted",value:function(t){return this.player.muted(t)}},{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(t){return this.player.playbackRate(t)}},{key:"quality",value:function(t){for(var e=this.player.qualityLevels(),n=0;n<e.length;n++){var r=e[n];if(t)r.enabled=r.id===t.toString();else if(r.enabled)return r.id}}},{key:"subtitles",value:function(t){for(var e=this.player.textTracks(),n=0;n<e.length;n++){var r=e[n];if(void 0===t){if("showing"===r.mode)return r.label}else r.label===t?r.mode="showing":r.mode="disabled"}}},{key:"bindEventListeners",value:function(){var t=this,e=function(t){return t.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",e),this.player.one("dispose",(function(){t.off("ended",t.showSplash),t.off("play",t.hideSplash),t.player.tech(!0).off("contextmenu",e)})),this.options.hotkeyElQuerySelector){var n=o.Z.dom.$(this.options.hotkeyElQuerySelector);n&&(this.player.on(n,"keydown",this.player.handleKeyDown),this.player.one("dispose",(function(){t.player.off(n,"keydown",t.player.handleKeyDown)})))}}},{key:"setupSeekBar",value:function(){var t=this.getSeekBarName(),e=this.player.controlBar.getChild("progressControl");e.addChild(t,this.getSeekBarOptions()),e.setSeekBarName(t)}},{key:"setupSplash",value:function(t){this._splashAdded||(this._splashAdded=!0,this.player.addChild("posterImage",Object.assign({embed:this.options.embed},t)),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"}}])&&iy(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function fy(t){return fy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fy(t)}function py(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yy(r.key),r)}}function yy(t){var e=function(t){if("object"!=fy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=fy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fy(e)?e:e+""}function hy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(hy=function(){return!!t})()}function dy(){return dy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=vy(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},dy.apply(null,arguments)}function vy(t){return vy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vy(t)}function by(t,e){return by=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},by(t,e)}sy.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 my=function(t){function e(t,n){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,n){return e=vy(e),function(t,e){if(e&&("object"==fy(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,hy()?Reflect.construct(e,n||[],vy(t).constructor):e.apply(t,n))}(this,e,[t]),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(t),r.playerDurationFn=r.player.duration.bind(t),r.playerCurrentTimeFn=r.player.currentTime.bind(t),r.playerbufferedFn=r.player.buffered.bind(t),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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&by(t,e)}(e,t),n=e,r=[{key:"clipStart",get:function(){var t=this.playerDurationFn();return this._clipStart>t?t:this._clipStart}},{key:"clipEnd",get:function(){var t=this.playerDurationFn();return t<=0?this._clipEnd:this._clipEnd>t?t:this._clipEnd}},{key:"dispose",value:function(){var t,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"),(t=e,n=this,"function"==typeof(r=dy(vy(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}: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 t=this.getCurrentTime(!1);t>this.clipEnd?this._isEnded||(this.player.pause(),this.player.trigger("ended"),this._isEnded=!0):(this._isEnded=!1,t<this.clipStart-10&&this.playerCurrentTimeFn(this.clipStart,!0))}},{key:"ended",value:function(){return this.getCurrentTime(!1)>this.clipEnd}},{key:"duration",value:function(t){return t&&t>0&&(this.playerDurationFn()?console.info("The duration of the player has already been set. This is a no-op."):this.playerDurationFn(t)),this.clipEnd-this.clipStart}},{key:"currentTime",value:function(t){if("number"!=typeof t)return this.getCurrentTime(!0);for(var e=t+this.clipStart,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.playerCurrentTimeFn(e,r)}},{key:"getCurrentTime",value:function(t){var e=this.playerCurrentTimeFn(),n=0;return e>=this.clipStart&&(n=e-this.clipStart),this.player.getCache().currentTime=n,t?n:e}},{key:"buffered",value:function(){for(var t=this.playerbufferedFn(),e=[],n=0;n<t.length;n++)e[n]=[Math.max(0,t.start(n)-this.clipStart),Math.min(Math.max(0,t.end(n)-this.clipStart),this.player.duration())];return o.Z.createTimeRanges(e)}}],r&&py(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function gy(t){return gy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gy(t)}function wy(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Oy(r.key),r)}}function Oy(t){var e=function(t){if("object"!=gy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=gy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gy(e)?e:e+""}function Py(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Py=function(){return!!t})()}function Sy(){return Sy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=jy(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Sy.apply(null,arguments)}function jy(t){return jy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jy(t)}function ky(t,e){return ky=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ky(t,e)}o.Z.registerPlugin("clipPlugin",my);var _y=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=jy(e),function(t,e){if(e&&("object"==gy(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Py()?Reflect.construct(e,n||[],jy(t).constructor):e.apply(t,n))}(this,e,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ky(t,e)}(e,t),n=e,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 t,n,r;(t=e,n=this,"function"==typeof(r=Sy(jy(1&3?t.prototype:t),"handleClick",n))?function(t){return r.apply(n,t)}:r)([null])}}],r&&wy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Button"));function Ey(t){return Ey="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ey(t)}function Cy(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ty(r.key),r)}}function Ty(t){var e=function(t){if("object"!=Ey(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ey(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ey(e)?e:e+""}function xy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(xy=function(){return!!t})()}function Ly(t){return Ly=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ly(t)}function Ry(t,e){return Ry=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ry(t,e)}_y.prototype.controlText_="Create Clip",o.Z.registerComponent("CreateClipButton",_y);var Iy=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Ly(e),function(t,e){if(e&&("object"==Ey(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,xy()?Reflect.construct(e,n||[],Ly(t).constructor):e.apply(t,n))}(this,e,[t,n])).options=n,t.ready((function(){return r.onReady()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ry(t,e)}(e,t),n=e,(r=[{key:"onReady",value:function(){var t,e=this.player.getChild("collapserator"),n=null===(t=null==e?void 0:e.children())||void 0===t?void 0:t.findIndex((function(t){return"CustomControlSpacer"===t.name()}));n&&-1!==n&&e.addChild("CreateClipButton",{clickHandler:this.options.onClick},n+1)}}])&&Cy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function Dy(t){return Dy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dy(t)}function By(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ny(r.key),r)}}function Ny(t){var e=function(t){if("object"!=Dy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Dy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Dy(e)?e:e+""}function My(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(My=function(){return!!t})()}function Ay(t){return Ay=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ay(t)}function Fy(t,e){return Fy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fy(t,e)}o.Z.registerPlugin("createClipButtonPlugin",Iy);var Zy=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Ay(e),function(t,e){if(e&&("object"==Dy(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,My()?Reflect.construct(e,n||[],Ay(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fy(t,e)}(e,t),n=e,(r=[{key:"handlePictureInPictureEnabledChange",value:function(){this.enable()}}])&&By(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("PictureInPictureToggle"));function Vy(t){return Vy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vy(t)}function zy(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Uy(r.key),r)}}function Uy(t){var e=function(t){if("object"!=Vy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vy(e)?e:e+""}function Gy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gy=function(){return!!t})()}function qy(){return qy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Hy(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},qy.apply(null,arguments)}function Hy(t){return Hy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hy(t)}function Wy(t,e){return Wy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wy(t,e)}o.Z.registerComponent("PictureInPictureToggle",Zy);var Qy=o.Z.getComponent("PlayToggle"),Yy=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Hy(e),function(t,e){if(e&&("object"==Vy(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gy()?Reflect.construct(e,n||[],Hy(t).constructor):e.apply(t,n))}(this,e,[t,n])).pictureInPictureEnabled=!1,r.options=n,r.bindFunctions(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wy(t,e)}(e,t),n=e,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:"enablePictureInPicture",value:function(){var t=this;if(this.player.options_.fluid&&!this.pictureInPictureEnabled){var e=this.getToggleParentComponent();if(e){this.pictureInPictureEnabled=!0;var n=e.children().findIndex((function(t){var e;return"fullscreentoggle"===(null===(e=t.name())||void 0===e?void 0:e.toLowerCase())}));-1===n&&(n=e.children().length-1),e.addChild("pictureInPictureToggle",{},n);var r=e.getChild("pictureInPictureToggle");null==r||r.enable(),this.player.on("playerresize",this.onPlayerResize),this.player.on("dispose",(function(){var e;null===(e=t.player)||void 0===e||e.off("playerresize",t.onPlayerResize)}))}}}},{key:"disablePictureInPicture",value:function(){if(this.pictureInPictureEnabled){this.pictureInPictureEnabled=!1;var t=this.getToggleParentComponent(),e=null==t?void 0:t.getChild("pictureInPictureToggle");e&&t.removeChild(e),this.player.off("playerresize",this.onPlayerResize)}}},{key:"togglePictureInPicture",value:function(t){if(t!==this.player.isInPictureInPicture()){var e=t?"enterpictureinpicture":"leavepictureinpicture";this.player.isInPictureInPicture(t),this.player.trigger(e),t?this.addPipStyles():this.removePipStyles()}}},{key:"onPlayerResize",value:function(){if(!this.player.isInPictureInPicture()){var t=this.player.el().getBoundingClientRect();0!==t.width&&(t.width<800?this.disablePictureInPicture():this.enablePictureInPicture())}}},{key:"addPipStyles",value:function(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new Qy(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 t;this.pictureInPictureEnabled&&(this.togglePictureInPicture(!0),"function"==typeof(null===(t=this.options)||void 0===t?void 0:t.onRequestPictureInPicture)&&this.options.onRequestPictureInPicture(!0))}},{key:"exitPictureInPicture",value:function(){this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles()}},{key:"getToggleParentComponent",value:function(){return this.player.getChild("collapserator")}},{key:"dispose",value:function(){var t,n,r;this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,(t=e,n=this,"function"==typeof(r=qy(Hy(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}}],r&&zy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function $y(t){return $y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$y(t)}function Ky(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xy(r.key),r)}}function Xy(t){var e=function(t){if("object"!=$y(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$y(e)?e:e+""}o.Z.registerPlugin("pictureInPicture",Yy);var Jy=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.listeners={}},e=[{key:"subscribe",value:function(t,e){this.registerListener(t,e)}},{key:"subscribeOnce",value:function(t,e){this.registerListener(t,e,1)}},{key:"unsubscribe",value:function(t,e){this.deregisterListener(t,e)}},{key:"trigger",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.triggerCallbacks(t,n)}},{key:"registerListener",value:function(t,e,n){var r;if("string"!=typeof t)throw new Error("Event name must be a string");if("function"!=typeof e)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[t]=null!==(r=this.listeners[t])&&void 0!==r?r:[],this.listeners[t].push({callback:e,executionLimit:n})}},{key:"deregisterListener",value:function(t,e){var n;if("string"!=typeof t)throw new Error("Event name must be a string");if(e&&"function"!=typeof e)throw new Error("Event callback must be a function");if(e){var r=null===(n=this.listeners[t])||void 0===n?void 0:n.findIndex((function(t){return t.callback===e}));"number"==typeof r&&-1!==r&&(this.listeners[t].splice(r,1),0===this.listeners[t].length&&delete this.listeners[t])}else this.listeners[t]=[]}},{key:"triggerCallbacks",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];if(this.listeners[t]){var i=[];this.listeners[t].forEach((function(t){var e,n;"number"==typeof t.executionLimit&&(t.executionCount=null!==(n=t.executionCount)&&void 0!==n?n:0,t.executionCount++,t.executionCount===t.executionLimit&&i.push(t.callback)),(e=t.callback).apply.apply(e,[null].concat(r))})),i.length&&i.forEach((function(n){return e.deregisterListener(t,n)}))}}}],e&&Ky(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}());function th(t){return th="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},th(t)}function eh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nh(r.key),r)}}function nh(t){var e=function(t){if("object"!=th(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=th(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==th(e)?e:e+""}function rh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(rh=function(){return!!t})()}function oh(t,e,n,r){var o=ih(ah(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function ih(){return ih="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ah(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},ih.apply(null,arguments)}function ah(t){return ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ah(t)}function uh(t,e){return uh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},uh(t,e)}var ch=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=ah(e),function(t,e){if(e&&("object"==th(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,rh()?Reflect.construct(e,n||[],ah(t).constructor):e.apply(t,n))}(this,e,[t,n])).hasBuffered=!1,r.hasPlayed=!1,r.eventsService=Jy,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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&uh(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){this.setPosition(),this.bindListeners()}},{key:"buildCSSClass",value:function(){return"cv-point-of-interest-indicator ".concat(oh(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return oh(e,"createEl",this,3)([t,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 t=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/t*100+"%"}},{key:"updateBuffered",value:function(t){var e=this.getPointOfInterestTime()<=t;if(e!==this.hasBuffered){this.hasBuffered=e;var n="cv-point-of-interest-indicator-buffered";this.hasBuffered?this.addClass(n):this.removeClass(n)}}},{key:"updatePlaybackProgress",value:function(t){var e=this.getPointOfInterestTime()<=t;if(e!==this.hasPlayed){this.hasPlayed=e;var n="cv-point-of-interest-indicator-played";e?this.addClass(n):this.removeClass(n)}}},{key:"toggleVisibility",value:function(t){var e="cv-point-of-interest-indicator-hidden";t?this.removeClass(e):this.addClass(e)}},{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(t){t.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 t;null===(t=this.getTimeTooltip())||void 0===t||t.setCustomChapterText(this.pointOfInterest.description)}},{key:"clearTimeTooltipText",value:function(){var t;null===(t=this.getTimeTooltip())||void 0===t||t.setCustomChapterText()}},{key:"setTimeTooltipTime",value:function(){var t=this.getTimeTooltip();null==t||t.updateTime(this.getPointOfInterestTime())}},{key:"positionMouseTimeDisplay",value:function(){var t,e,n=null===(t=this.getSeekBar())||void 0===t?void 0:t.el();if(n){var r=o.Z.dom.findPosition(n),i=this.getPointOfInterestTime()/this.player().duration();null===(e=this.getMouseTimeDisplay())||void 0===e||e.update(r,i)}}},{key:"showMouseTimeDisplay",value:function(){var t;null===(t=this.getMouseTimeDisplay())||void 0===t||t.forceShow()}},{key:"hideMouseTimeDisplay",value:function(){var t;null===(t=this.getMouseTimeDisplay())||void 0===t||t.removeForceShow()}},{key:"getSeekBar",value:function(){var t;return null===(t=this.player().controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar")}},{key:"getMouseTimeDisplay",value:function(){var t;return null===(t=this.getSeekBar())||void 0===t?void 0:t.getChild("MouseTimeDisplay")}},{key:"getTimeTooltip",value:function(){var t;return null===(t=this.getMouseTimeDisplay())||void 0===t?void 0:t.getChild("TimeTooltip")}}])&&eh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function lh(t){return lh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lh(t)}function sh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,fh(r.key),r)}}function fh(t){var e=function(t){if("object"!=lh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=lh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lh(e)?e:e+""}function ph(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ph=function(){return!!t})()}function yh(){return yh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=hh(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},yh.apply(null,arguments)}function hh(t){return hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hh(t)}function dh(t,e){return dh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dh(t,e)}var vh=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=hh(e),function(t,e){if(e&&("object"==lh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ph()?Reflect.construct(e,n||[],hh(t).constructor):e.apply(t,n))}(this,e,[t,n])).pointsOfInterestVisible=n.pointsOfInterestVisible,r.toggle(r.pointsOfInterestVisible),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dh(t,e)}(e,t),n=e,r=[{key:"handleToggle",value:function(){this.toggle(!this.pointsOfInterestVisible)}},{key:"toggle",value:function(t){t?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){o.Z.dom.addClass(this.toggleEl,"on"),o.Z.dom.setAttribute(this.toggleEl,"aria-checked","true"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"toggleOff",value:function(){o.Z.dom.removeClass(this.toggleEl,"on"),o.Z.dom.setAttribute(this.toggleEl,"aria-checked","false"),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"handleClick",value:function(t){t.stopImmediatePropagation()}},{key:"createEl",value:function(t,n,r){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=o.Z.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),o.Z.dom.setAttribute(this.toggleEl,"id","poi-toggle"),o.Z.dom.setAttribute(this.toggleEl,"role","switch"),this.toggleEl.addEventListener("click",this.handleToggle);var i,a,u,c=(i=e,a=this,"function"==typeof(u=yh(hh(1&3?i.prototype:i),"createEl",a))?function(t){return u.apply(a,t)}:u)([t,{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&&sh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function bh(t){return bh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bh(t)}function mh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gh(r.key),r)}}function gh(t){var e=function(t){if("object"!=bh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bh(e)?e:e+""}function wh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wh=function(){return!!t})()}function Oh(t){return Oh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Oh(t)}function Ph(t,e){return Ph=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ph(t,e)}o.Z.registerComponent("PointsOfInterestMenuItem",vh);var Sh,jh=o.Z.getPlugin("plugin"),kh="cvplayer-points-of-interest",_h=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Oh(e),function(t,e){if(e&&("object"==bh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wh()?Reflect.construct(e,n||[],Oh(t).constructor):e.apply(t,n))}(this,e,[t])).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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ph(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){this.pointsOfInterest&&(Ze()&&"false"===Ve(kh)&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}},{key:"bindListeners",value:function(){var t=this;this.player.on("progress",this.updateBuffered),this.player.on("timeupdate",this.updatePlaybackProgress),this.player.on("dispose",(function(){var e,n;null===(e=t.player)||void 0===e||e.off("progress",t.updateBuffered),null===(n=t.player)||void 0===n||n.off("timeupdate",t.updatePlaybackProgress)}))}},{key:"togglePointsOfInterest",value:function(t){ze(kh,t.toString()),this.pointOfInterestIndicators.forEach((function(e){return e.toggleVisibility(t)}))}},{key:"setupTrack",value:function(){var t=this.player.addTextTrack("metadata","pointsofinterest");this.pointsOfInterest.forEach((function(e){t.addCue({startTime:e.startTime,endTime:e.endTime,text:e.description})})),t.trigger({type:"loadeddata",target:t})}},{key:"createPointOfInterestIndicators",value:function(){var t,e=this,n=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar");this.pointsOfInterest.forEach((function(t){var r=new ch(e.player,{pointOfInterest:t});e.pointOfInterestIndicators.push(r),n.addChild(r)}))}},{key:"addMenuItem",value:function(){var t;(null===(t=this.player.getChild("collapserator"))||void 0===t?void 0:t.getChild("cogButton")).addItem({index:0,ctor:vh,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}},{key:"updateBuffered",value:function(){var t=this;this.pointOfInterestIndicators.forEach((function(e){return e.updateBuffered(Pc(t.player))}))}},{key:"updatePlaybackProgress",value:function(){var t=this;this.pointOfInterestIndicators.forEach((function(e){return e.updatePlaybackProgress(t.player.currentTime())}))}}])&&mh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(jh);function Eh(t){return Eh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eh(t)}function Ch(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Th(r.key),r)}}function Th(t){var e=function(t){if("object"!=Eh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Eh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Eh(e)?e:e+""}function xh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(xh=function(){return!!t})()}function Lh(t){return Lh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lh(t)}function Rh(t,e){return Rh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Rh(t,e)}o.Z.registerPlugin("pointsOfInterestPlugin",_h),function(t){t.None="None",t.Complete="Complete",t.Incomplete="Incomplete"}(Sh||(Sh={}));var Ih=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Lh(e),function(t,e){if(e&&("object"==Eh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,xh()?Reflect.construct(e,n||[],Lh(t).constructor):e.apply(t,n))}(this,e,[t,n])).update(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Rh(t,e)}(e,t),n=e,r=[{key:"update",value:function(){this.options_.activityStatus===Sh.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 t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.options_.clickHandler.call(this,e)}}},{key:"buildCSSClass",value:function(){return"cv-activity-status-button"}},{key:"getToggledActivityStatus",value:function(){return this.options_.activityStatus===Sh.None||this.options_.activityStatus===Sh.Incomplete?Sh.Complete:this.options_.activityStatus===Sh.Complete?Sh.Incomplete:void 0}}],r&&Ch(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Button"));function Dh(t){return Dh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dh(t)}function Bh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Nh(r.key),r)}}function Nh(t){var e=function(t){if("object"!=Dh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Dh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Dh(e)?e:e+""}function Mh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Mh=function(){return!!t})()}function Ah(t){return Ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ah(t)}function Fh(t,e){return Fh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fh(t,e)}Ih.prototype.controlText_="Complete";var Zh=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Ah(e),function(t,e){if(e&&("object"==Dh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Mh()?Reflect.construct(e,n||[],Ah(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fh(t,e)}(e,t),n=e,(r=[{key:"setActivityStatus",value:function(t,e){var n=this;t!==this.activityStatus&&(this.activityStatus=t,this.onToggleStatus=e,this.player.ready((function(){n.renderActivityStatusButton()})))}},{key:"renderActivityStatusButton",value:function(){this.button&&this.player.removeChild(this.button),this.button=new Ih(this.player,{activityStatus:this.activityStatus,clickHandler:this.onToggleStatus}),this.player.addChild(this.button)}}])&&Bh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function Vh(t){return Vh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vh(t)}function zh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Uh(r.key),r)}}function Uh(t){var e=function(t){if("object"!=Vh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vh(e)?e:e+""}function Gh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gh=function(){return!!t})()}function qh(t,e,n,r){var o=Hh(Wh(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Hh(){return Hh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Wh(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Hh.apply(null,arguments)}function Wh(t){return Wh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wh(t)}function Qh(t,e){return Qh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qh(t,e)}o.Z.registerPlugin("activityStatusPlugin",Zh);var Yh=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Wh(e),function(t,e){if(e&&("object"==Vh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gh()?Reflect.construct(e,n||[],Wh(t).constructor):e.apply(t,n))}(this,e,[t,n])).initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qh(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){this.setPosition()}},{key:"buildCSSClass",value:function(){return"cv-range-indicator ".concat(qh(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return qh(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"setPosition",value:function(){var t=this.player().duration();this.el_.style.left=this.options_.time/t*100+"%"}}])&&zh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function $h(t){return $h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$h(t)}function Kh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xh(r.key),r)}}function Xh(t){var e=function(t){if("object"!=$h(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$h(e)?e:e+""}function Jh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Jh=function(){return!!t})()}function td(t,e,n,r){var o=ed(nd(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function ed(){return ed="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=nd(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},ed.apply(null,arguments)}function nd(t){return nd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nd(t)}function rd(t,e){return rd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},rd(t,e)}var od=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=nd(e),function(t,e){if(e&&("object"==$h(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Jh()?Reflect.construct(e,n||[],nd(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rd(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-replay-view-button ".concat(td(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return td(e,"createEl",this,3)([t,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()}}])&&Kh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("ClickableComponent"));function id(t){return id="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},id(t)}function ad(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ud(r.key),r)}}function ud(t){var e=function(t){if("object"!=id(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=id(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==id(e)?e:e+""}function cd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(cd=function(){return!!t})()}function ld(t,e,n,r){var o=sd(fd(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function sd(){return sd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=fd(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},sd.apply(null,arguments)}function fd(t){return fd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fd(t)}function pd(t,e){return pd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pd(t,e)}var yd=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=fd(e),function(t,e){if(e&&("object"==id(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,cd()?Reflect.construct(e,n||[],fd(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pd(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-replay-view ".concat(ld(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){var i=ld(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r]),a=o.Z.dom.createEl("h5",{innerHTML:this.localize("This clip has finished"),className:"cv-replay-heading"}),u=o.Z.dom.createEl("div",{className:"cv-button-container"}),c=new od(this.player_,{label:this.localize("Replay clip"),iconClassName:"cv-replay-icon",onPress:this.options_.onReplayPress}),l=new od(this.player_,{label:this.localize("Continue watching"),iconClassName:"cv-continue-icon",onPress:this.options_.onContinuePress});return i.appendChild(a),i.appendChild(u),u.appendChild(c.el()),u.appendChild(l.el()),i}}])&&ad(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function hd(t){return hd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hd(t)}function dd(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vd(r.key),r)}}function vd(t){var e=function(t){if("object"!=hd(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=hd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hd(e)?e:e+""}function bd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(bd=function(){return!!t})()}function md(){return md="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=gd(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},md.apply(null,arguments)}function gd(t){return gd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gd(t)}function wd(t,e){return wd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wd(t,e)}var Od=function(t){function e(t,n){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=gd(e),function(t,e){if(e&&("object"==hd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,bd()?Reflect.construct(e,n||[],gd(t).constructor):e.apply(t,n))}(this,e,[t,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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wd(t,e)}(e,t),n=e,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 t=this;this.player.one("loadedmetadata",(function(){return t.player.ready(t.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 t=this.player.currentTime();if(!(t<this.startTime))return t>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 t,e=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar");this.startTimeIndicator||(this.startTimeIndicator=new Yh(this.player,{time:this.startTime}),null==e||e.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new Yh(this.player,{time:this.endTime}),null==e||e.addChild(this.endTimeIndicator))}},{key:"hideRangeIndicators",value:function(){var t,e;null===(t=this.startTimeIndicator)||void 0===t||t.hide(),null===(e=this.endTimeIndicator)||void 0===e||e.hide()}},{key:"addMaskToProgressBar",value:function(){var t,e=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar"),n=null==e?void 0:e.el().getElementsByClassName("cv-chapter-bar-items");if(n&&n.length){var r=n[0],o=this.player.duration(),i=this.startTime/o*100,a=100-this.endTime/o*100;r.style.clipPath="inset(".concat(-5,"em ").concat(a,"% ").concat(-5,"em ").concat(i,"%)")}}},{key:"removeMaskFromProgressBar",value:function(){var t,e=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar"),n=null==e?void 0:e.el().getElementsByClassName("cv-chapter-bar-items");n&&n.length&&(n[0].style.clipPath="")}},{key:"showReplayView",value:function(){this.replayView||(this.replayView=new yd(this.player,{onContinuePress:this.onContinuePress,onReplayPress:this.onReplayPress}),this.player.addChild(this.replayView)),this.replayView.show()}},{key:"hideReplayView",value:function(){var t;null===(t=this.replayView)||void 0===t||t.hide()}},{key:"getPlayToggle",value:function(){var t=this.player.getChild("collapserator");return null==t?void 0:t.getChild("PlayToggle")}},{key:"enablePlayToggle",value:function(){var t=this.getPlayToggle();t&&t.enable()}},{key:"disablePlayToggle",value:function(){var t=this.getPlayToggle();t&&t.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 t,n,r,o,i,a;this.removeCssClasses(),this.player.off("timeupdate",this.onTimeUpdateOrSeeked),this.player.off("seeked",this.onTimeUpdateOrSeeked),null===(t=this.startTimeIndicator)||void 0===t||t.dispose(),null===(n=this.endTimeIndicator)||void 0===n||n.dispose(),null===(r=this.replayView)||void 0===r||r.dispose(),(o=e,i=this,"function"==typeof(a=md(gd(1&3?o.prototype:o),"dispose",i))?function(t){return a.apply(i,t)}:a)([])}}],r&&dd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("rangeIndicatorPlugin",Od);var Pd=function(){var t,e,n;return null!==(n=null===(e=null===(t=window.crypto)||void 0===t?void 0:t.randomUUID)||void 0===e?void 0:e.call(t))&&void 0!==n?n:Math.random().toString()};function Sd(t){return Sd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sd(t)}function jd(){jd=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Sd(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Sd(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function kd(t){return function(t){if(Array.isArray(t))return _d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return _d(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_d(t,e):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.")}()}function _d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ed(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Cd(r.key),r)}}function Cd(t){var e=function(t){if("object"!=Sd(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Sd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sd(e)?e:e+""}function Td(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Td=function(){return!!t})()}function xd(t,e,n,r){var o=Ld(Rd(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Ld(){return Ld="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Rd(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ld.apply(null,arguments)}function Rd(t){return Rd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rd(t)}function Id(t,e){return Id=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Id(t,e)}var Dd,Bd,Nd=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Rd(e),function(t,e){if(e&&("object"==Sd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Td()?Reflect.construct(e,n||[],Rd(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Id(t,e)}(e,t),n=e,(r=[{key:"getPlayerOptions",value:function(){var t,n=xd(e,"getPlayerOptions",this,3)([]);return(null===(t=n.devicesConfig)||void 0===t?void 0:t.canUserCastToDevices)?Object.assign(Object.assign({},n),{techOrder:["devices"].concat(kd(n.techOrder)),devices:{instanceId:Pd()}}):n}},{key:"configurePlugins",value:function(){var t;try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),(null===(t=this.options.pointsOfInterest)||void 0===t?void 0:t.length)&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest})}catch(t){console.log("failed to register plugins",t)}}},{key:"setNextVideo",value:function(t,e,n){this.player.nextVideoPlugin&&this.player.nextVideoPlugin().setNextVideo(t,e,n)}},{key:"enablePictureInPicture",value:function(){var t=this.player.pictureInPicture();t&&t.enablePictureInPicture()}},{key:"disablePictureInPicture",value:function(){var t=this.player.pictureInPicture();t&&t.disablePictureInPicture()}},{key:"togglePictureInPicture",value:function(t){var e=this.player.pictureInPicture();e&&e.togglePictureInPicture(t)}},{key:"additionalSetup",value:function(t){var n,r,o,i,a,u=this,c=Object.create(null,{additionalSetup:{get:function(){return xd(e,"additionalSetup",u,1)}}});return r=this,o=void 0,i=void 0,a=jd().mark((function e(){var r;return jd().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c.additionalSetup.call(this,t),this.options.showResources&&t.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:t.resources.list,imageCdnUrl:this.options.imageCdnUrl}),"MasterClip"!==t.mediaType){e.next=7;break}if(null!==(r=t.additionalData)){e.next=6;break}throw Error("Invalid clip data");case 6:this.player.clipPlugin({startTime:r.startTime,endTime:r.endTime});case 7:if(!(null===(n=this.options.devicesConfig)||void 0===n?void 0:n.canUserCastToDevices)){e.next=11;break}if(this.player.devicesPlugin){e.next=10;break}return e.abrupt("return");case 10:this.player.devicesPlugin(Object.assign(Object.assign({},this.options.devicesConfig),{userId:parseInt(t.viewerId),title:t.title,analyticsService:this.analyticsService}));case 11:"MasterVideo"===t.mediaType&&this.options.startTime&&this.options.endTime&&this.player.rangeIndicatorPlugin({startTime:this.options.startTime,endTime:this.options.endTime});case 12:case"end":return e.stop()}}),e,this)})),new(i||(i=Promise))((function(t,e){function n(t){try{c(a.next(t))}catch(t){e(t)}}function u(t){try{c(a.throw(t))}catch(t){e(t)}}function c(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(n,u)}c((a=a.apply(r,o||[])).next())}))}},{key:"setActivityStatus",value:function(t,e){this.player.activityStatusPlugin().setActivityStatus(t,e)}}])&&Ed(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(sy),Md=n(33937);function Ad(t){return Ad="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ad(t)}function Fd(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zd(r.key),r)}}function Zd(t){var e=function(t){if("object"!=Ad(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ad(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ad(e)?e:e+""}!function(t){t.AppleTv="apple-tv",t.Vivi="vivi"}(Dd||(Dd={})),function(t){t.Available="available",t.Offline="offline",t.Busy="busy"}(Bd||(Bd={}));var Vd=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this[Symbol.toStringTag]=e[Symbol.toStringTag],this.innerPromise=e,this.onTimeout=n,this.bindFunctions()}return e=t,r=[{key:"reject",value:function(e){return new t(Promise.reject(e))}},{key:"fromPromise",value:function(e){return new t(e)}}],(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(t){var e=this;return new Promise((function(n,r){e.then(n).catch(r).finally((function(){return clearTimeout(o)}));var o=setTimeout((function(){var t;null===(t=e.onTimeout)||void 0===t||t.call(e),r(new Error("Promise timed out"))}),t)}))}},{key:"then",value:function(t,e){return this.innerPromise.then(t,e)}},{key:"catch",value:function(t){return this.innerPromise.catch(t)}},{key:"finally",value:function(t){return this.innerPromise.finally(t)}}])&&Fd(e.prototype,n),r&&Fd(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();function zd(t){return zd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zd(t)}function Ud(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gd(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hd(r.key),r)}}function qd(t,e,n){return e&&Gd(t.prototype,e),n&&Gd(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Hd(t){var e=function(t){if("object"!=zd(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zd(e)?e:e+""}Symbol.toStringTag;var Wd=function(){return qd((function t(){Ud(this,t),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(t){var e=this;this.callbacks.forEach((function(n,r){var o=e.predicates[r];o&&!o(t)||n(t)}))}},{key:"on",value:function(t){var e=this;this.isDisposed()&&console.warn("This EventChannel instance been disposed - this is a no-op");var n=this.callbacks.length;this.callbacks[n]=t,this.predicates[n]=function(){return!0};var r=function(){e.off(t)};return{off:r,filter:function(t){return e.predicates[n]=t,r}}}},{key:"one",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return this.isDisposed()?Vd.reject(new Error("This EventChannel instance has been disposed")):new Vd(new Promise((function(r,o){t=e.on((function(n){e.signal.removeEventListener("abort",i),t(),r(n)})).filter(n);var i=function(){t(),o(new Error("Aborted while waiting for message"))};e.signal.addEventListener("abort",i,{once:!0})})),(function(){t()}))}},{key:"off",value:function(t){var e=this.callbacks.indexOf(t);-1!==e&&(this.callbacks.splice(e,1),this.predicates.splice(e,1))}},{key:"dispose",value:function(){this.callbacks.length=0,this.predicates.length=0,this.controller.abort()}},{key:"isDisposed",value:function(){return this.signal.aborted}}])}(),Qd=function(){return qd((function t(){Ud(this,t),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(t,e){this.getChannel(t).trigger(e)}},{key:"on",value:function(t,e){return this.getChannel(t).on(e)}},{key:"one",value:function(t,e){return this.getChannel(t).one(e)}},{key:"off",value:function(t,e){this.getChannel(t).off(e)}},{key:"dispose",value:function(){this.trigger("dispose",Yd.void),Object.values(this.channels).forEach((function(t){return t.dispose()})),this.channels={}}},{key:"getChannel",value:function(t){return this.channels[t]||(this.channels[t]=new Wd),this.channels[t]}}])}(),Yd={void:void 0};function $d(t){return $d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$d(t)}function Kd(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xd(r.key),r)}}function Xd(t){var e=function(t){if("object"!=$d(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$d(e)?e:e+""}var Jd,tv,ev,nv=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bindFunctions()},(e=[{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(t){return this.task=t,this}},{key:"every",value:function(t){return this.intervalInMilliseconds=t,this}},{key:"trigger",value:function(){var t;return null===(t=this.task)||void 0===t||t.call(this,this),this}},{key:"start",value:function(){var t=this;return this.intervalId||(this.intervalId=setInterval((function(){return t.trigger()}),this.intervalInMilliseconds)),this}},{key:"stop",value:function(){return this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this}}])&&Kd(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),rv=function(t,e){return t._lastModified||(t._lastModified={}),new Proxy(t,{set:function(n,r,o,i){var a=t._lastModified[r.toString()];return!!(a&&Date.now()<a+e)||Reflect.set(n,r,o,i)}})},ov=function(t){return t._lastModified||(t._lastModified={}),new Proxy(t,{set:function(e,n,r,o){return t._lastModified[n.toString()]=Date.now(),Reflect.set(e,n,r,o)}})};function iv(t){return iv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iv(t)}function av(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,cv(r.key),r)}}function uv(t,e,n){return e&&av(t.prototype,e),n&&av(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function cv(t){var e=function(t){if("object"!=iv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=iv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==iv(e)?e:e+""}!function(t){t[t.Offline=0]="Offline",t[t.Online=1]="Online",t[t.Locked=2]="Locked",t[t.Suspended=3]="Suspended"}(Jd||(Jd={})),function(t){t[t.PlaybackStatusChange=0]="PlaybackStatusChange",t[t.PositionChange=1]="PositionChange"}(tv||(tv={})),function(t){t.Begin="BEGIN",t.Play="PLAY",t.Pause="PAUSE",t.Load="LOAD",t.Scan="SCAN",t.Stop="STOP"}(ev||(ev={}));var lv=uv((function t(e,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.title=e,this.device=n,this.locked=!1,this.position=0,this.playbackStatus=ev.Load,this.debounced=rv(this,2e3),ov(this)}));function sv(t){return sv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sv(t)}function fv(){fv=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==sv(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(sv(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function pv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yv(r.key),r)}}function yv(t){var e=function(t){if("object"!=sv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=sv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sv(e)?e:e+""}function hv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(hv=function(){return!!t})()}function dv(){return dv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=vv(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},dv.apply(null,arguments)}function vv(t){return vv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vv(t)}function bv(t,e){return bv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bv(t,e)}var mv=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=vv(e),function(t,e){if(e&&("object"==sv(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,hv()?Reflect.construct(e,n||[],vv(t).constructor):e.apply(t,n))}(this,e)).client=t,r.localState=new lv(n.title,n.device),r.bindFunctions(),r.initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bv(t,e)}(e,t),n=e,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 t,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(t){return console.error(t)})),(t=e,n=this,"function"==typeof(r=dv(vv(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}: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(t){if(t.deviceId===this.getDevice().id){var e=this.localState.debounced;switch(t.event){case tv.PlaybackStatusChange:this.handlePlaybackChange(e,t);break;case tv.PositionChange:this.handlePositionChange(e,t)}}}},{key:"handlePlaybackChange",value:function(t,e){t.playbackStatus!==e.params.playbackStatus&&(t.playbackStatus=e.params.playbackStatus,this.trigger("playingchange",Yd.void),t.playbackStatus===ev.Stop&&this.dispose())}},{key:"handlePositionChange",value:function(t,e){t.position!==e.params.position&&(t.position=e.params.position,this.trigger("positionchange",Yd.void))}},{key:"loadSource",value:function(){return t=this,e=void 0,n=void 0,r=fv().mark((function t(){return fv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!this.localState.locked){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,this.client.lock(this.getDevice().id);case 5:return this.localState.locked=!0,t.next=8,this.client.loadVideo(this.getDevice().id);case 8:this.trigger("sourceloaded",Yd.void),t.next=15;break;case 11:t.prev=11,t.t0=t.catch(0),console.error(t.t0),this.trigger("error",new Error("Could not load video on Apple TV device"));case 15:case"end":return t.stop()}}),t,this,[[0,11]])})),new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}},{key:"play",value:function(){this.localState.locked&&this.localState.playbackStatus!==ev.Play&&(this.localState.playbackStatus=ev.Play,this.client.play(this.getDevice().id),this.trigger("playingchange",Yd.void))}},{key:"pause",value:function(){this.localState.locked&&this.localState.playbackStatus!==ev.Pause&&(this.localState.playbackStatus=ev.Pause,this.client.pause(this.getDevice().id),this.trigger("playingchange",Yd.void))}},{key:"seek",value:function(t){this.localState.locked&&this.localState.position!==t&&(this.localState.position=t,this.client.seek(this.getDevice().id,t),this.trigger("positionchange",Yd.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===ev.Play||this.localState.playbackStatus===ev.Begin||this.localState.playbackStatus===ev.Load}},{key:"isPlaybackFinished",value:function(){return this.localState.playbackStatus===ev.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&&pv(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Qd);function gv(t){return gv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gv(t)}function wv(){wv=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==gv(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(gv(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Ov(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Pv(r.key),r)}}function Pv(t){var e=function(t){if("object"!=gv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=gv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gv(e)?e:e+""}function Sv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Sv=function(){return!!t})()}function jv(){return jv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=kv(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},jv.apply(null,arguments)}function kv(t){return kv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kv(t)}function _v(t,e){return _v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_v(t,e)}var Ev,Cv,Tv,xv=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))};!function(t){t.DeviceList="DeviceList",t.DeviceStateChange="DeviceStateChange",t.Paired="Paired",t.Unpaired="Unpaired",t.PlayStatusChange="PlayStatusChange",t.TimeSync="TimeSync"}(Ev||(Ev={})),function(t){t.Command="Command",t.Pair="Pair",t.Unpair="Unpair",t.RenameDevice="Renamedevice",t.Subscribe="Subscribe",t.Lock="Lock"}(Cv||(Cv={})),function(t){t[t.Connecting=0]="Connecting",t[t.Connected=1]="Connected",t[t.Reconnecting=2]="Reconnecting",t[t.Disconnected=4]="Disconnected"}(Tv||(Tv={}));var Lv=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=kv(e),function(t,e){if(e&&("object"==gv(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Sv()?Reflect.construct(e,n||[],kv(t).constructor):e.apply(t,n))}(this,e)).options=t,n.accessToken=void 0,n.devices=[],n.heartbeat=new nv,n.bindFunctions(),n.initialize(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_v(t,e)}(e,t),n=e,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 xv(this,void 0,void 0,wv().mark((function t(){return wv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.options.fetchAccessToken();case 3:return this.accessToken=t.sent,this.connection=(0,Md.OB)(this.accessToken.host,{logging:!1}),this.hubProxy=this.connection.createHubProxy("DeviceUserHub"),this.hubProxy.on(Ev.DeviceList,this.handleDeviceList),this.hubProxy.on(Ev.DeviceStateChange,this.handleDeviceStateChange),this.hubProxy.on(Ev.Paired,this.handleDevicePaired),this.hubProxy.on(Ev.Unpaired,this.handleDeviceUnpaired),this.hubProxy.on(Ev.PlayStatusChange,this.handlePlayStatusChange),this.hubProxy.on(Ev.TimeSync,this.handleTimeSync),t.next=14,this.connect();case 14:return t.next=16,this.subscribe(this.accessToken.token);case 16:this.heartbeat.schedule(this.tryFixConnection).every(5e3).start(),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(0),console.error(t.t0),this.trigger("error",new Error("Could not connect to Online API"));case 23:case"end":return t.stop()}}),t,this,[[0,19]])})))}},{key:"connect",value:function(){return xv(this,void 0,void 0,wv().mark((function t(){var e=this;return wv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,n){e.connection.start({jsonp:!1,withCredentials:!1}).done((function(){return t()})).fail((function(){return n(new Error("Could not connect to SignalR hub"))}))})));case 1:case"end":return t.stop()}}),t)})))}},{key:"subscribe",value:function(t){return xv(this,void 0,void 0,wv().mark((function e(){return wv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(Cv.Subscribe,t);case 2:if(e.sent){e.next=5;break}throw new Error("The subscription request was rejected by Online API");case 5:case"end":return e.stop()}}),e,this)})))}},{key:"tryFixConnection",value:function(){return xv(this,void 0,void 0,wv().mark((function t(){return wv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.connection.state===Tv.Disconnected){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,this.heartbeat.stop(),t.next=6,this.options.fetchAccessToken();case 6:return this.accessToken=t.sent,t.next=9,this.connect();case 9:return t.next=11,this.subscribe(this.accessToken.token);case 11:t.next=17;break;case 13:t.prev=13,t.t0=t.catch(2),console.warn(t.t0),console.warn("Could not reconnect to Online API");case 17:return t.prev=17,this.heartbeat.start(),t.finish(17);case 20:case"end":return t.stop()}}),t,this,[[2,13,17,20]])})))}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return xv(this,void 0,void 0,wv().mark((function e(){var r,o=this;return wv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new Promise((function(e,r){var i,a;(null===(a=o.hubProxy)||void 0===a?void 0:(i=a).invoke.apply(i,[t].concat(n))).done(e).fail(r)})),e.abrupt("return",Vd.fromPromise(r).timeout(2e4));case 2:case"end":return e.stop()}}),e)})))}},{key:"handleDeviceList",value:function(t){this.devices=t.filter((function(t){return"vivi"!==t.type})).map(e.convertToGenericDevice),this.trigger("deviceschange",Yd.void)}},{key:"handleDeviceStateChange",value:function(t){var n=this.devices.findIndex((function(e){return e.id===t.deviceId}));n>=0&&(this.devices[n]=e.convertToGenericDevice(t),this.trigger("deviceschange",Yd.void))}},{key:"handleDevicePaired",value:function(t){"vivi"!==t.type&&(this.devices.push(e.convertToGenericDevice(t)),this.trigger("deviceschange",Yd.void))}},{key:"handleDeviceUnpaired",value:function(t){this.devices=this.devices.filter((function(e){return e.id!==t})),this.trigger("deviceschange",Yd.void)}},{key:"handlePlayStatusChange",value:function(t,e){this.trigger("message",{event:tv.PlaybackStatusChange,deviceId:t,params:{playbackStatus:e.commandType}})}},{key:"handleTimeSync",value:function(t,e){this.trigger("message",{event:tv.PositionChange,deviceId:t,params:{position:e}})}},{key:"dispose",value:function(){var t,n,r;this.hubProxy.off(Ev.DeviceList,this.handleDeviceList),this.hubProxy.off(Ev.DeviceStateChange,this.handleDeviceStateChange),this.hubProxy.off(Ev.Paired,this.handleDevicePaired),this.hubProxy.off(Ev.Unpaired,this.handleDeviceUnpaired),this.hubProxy.off(Ev.PlayStatusChange,this.handlePlayStatusChange),this.hubProxy.off(Ev.TimeSync,this.handleTimeSync),this.hubProxy.connection.stop(!1,!0),this.heartbeat.stop(),(t=e,n=this,"function"==typeof(r=jv(kv(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"canCastToDevice",value:function(t){return t===Dd.AppleTv}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(t){return new mv(this,t)}},{key:"lock",value:function(t){var e;return xv(this,void 0,void 0,wv().mark((function n(){return wv().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.invoke(Cv.Lock,t,this.options.userId,null!==(e=this.options.username)&&void 0!==e?e:"");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(t){return xv(this,void 0,void 0,wv().mark((function e(){return wv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.options.trackingCode){e.next=2;break}throw new Error("Tracking code must be provided to cast videos");case 2:return e.next=4,this.invoke(Cv.Command,{DeviceId:t,CommandType:ev.Play,Data:this.options.trackingCode});case 4:case"end":return e.stop()}}),e,this)})))}},{key:"play",value:function(t){return xv(this,void 0,void 0,wv().mark((function e(){return wv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(Cv.Command,{DeviceId:t,CommandType:ev.Play});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(t){return xv(this,void 0,void 0,wv().mark((function e(){return wv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(Cv.Command,{DeviceId:t,CommandType:ev.Pause});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"seek",value:function(t,e){this.invokeDebounced(Cv.Command,{DeviceId:t,CommandType:ev.Play,Params:"1,".concat(Math.trunc(e))})}},{key:"stop",value:function(t){return xv(this,void 0,void 0,wv().mark((function e(){return wv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(Cv.Command,{DeviceId:t,CommandType:ev.Stop});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"pair",value:function(t){return xv(this,void 0,void 0,wv().mark((function e(){var n;return wv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(Cv.Pair,t);case 2:if(n=e.sent){e.next=5;break}throw new Error("Could not pair device");case 5:return e.abrupt("return",n);case 6:case"end":return e.stop()}}),e,this)})))}},{key:"unpair",value:function(t){return xv(this,void 0,void 0,wv().mark((function e(){return wv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(Cv.Unpair,t);case 2:case"end":return e.stop()}}),e,this)})))}},{key:"renameDevice",value:function(t){var e=t.deviceId,n=t.deviceName;return xv(this,void 0,void 0,wv().mark((function t(){return wv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.invoke(Cv.RenameDevice,e,n);case 2:if(t.sent){t.next=5;break}throw new Error("Could not rename device");case 5:case"end":return t.stop()}}),t,this)})))}}],o=[{key:"convertToGenericDeviceStatus",value:function(t){switch(t){case Jd.Online:return Bd.Available;case Jd.Locked:return Bd.Busy;case Jd.Suspended:case Jd.Offline:return Bd.Offline}}},{key:"convertToGenericDevice",value:function(t){return{id:t.deviceId,name:t.name,type:Dd.AppleTv,status:e.convertToGenericDeviceStatus(t.status)}}}],r&&Ov(n.prototype,r),o&&Ov(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Qd);function Rv(t){return Rv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rv(t)}function Iv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Dv(r.key),r)}}function Dv(t){var e=function(t){if("object"!=Rv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rv(e)?e:e+""}var Bv={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""},Nv=function(){return t=function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bv;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bindFunctions(),this.url=e,this.options=Object.assign(Object.assign({},Bv),r),this.webSocket=this.connect(),this.heartbeat=(new nv).schedule((function(){return n.send(n.options.heartbeatMessage)})).every(this.options.heartbeatIntervalInMillseconds)},(e=[{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(t){var e;null===(e=this.onOpen)||void 0===e||e.call(this,t),this.options.heartbeatEnabled&&this.heartbeat.start()}},{key:"handleMessage",value:function(t){var e;null===(e=this.onMessage)||void 0===e||e.call(this,t)}},{key:"handleClose",value:function(t){var e,n=this;null===(e=this.onClose)||void 0===e||e.call(this,t),this.cleanup(),setTimeout((function(){n.webSocket=n.connect()}),this.options.reconnectIntervalInMilliseconds)}},{key:"handleError",value:function(t){var e;null===(e=this.onError)||void 0===e||e.call(this,t),this.handleClose()}},{key:"connect",value:function(){var t=new WebSocket(this.url);return t.addEventListener("open",this.handleOpen),t.addEventListener("message",this.handleMessage),t.addEventListener("close",this.handleClose),t.addEventListener("error",this.handleError),t}},{key:"send",value:function(t){this.webSocket.send(t)}},{key:"dipose",value:function(){this.cleanup(),this.webSocket.close()}}])&&Iv(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Mv(t){return Mv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mv(t)}function Av(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fv(r.key),r)}}function Fv(t){var e=function(t){if("object"!=Mv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Mv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Mv(e)?e:e+""}var Zv,Vv=function(){return t=function t(e,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),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=e,this.device=n,this.ready=!1,this.playbackFinished=!1,this.debounced=rv(this,2e3),ov(this)},(e=[{key:"position",get:function(){return this._position+this.getTimerDurationInSeconds()},set:function(t){this._position=t,this.restartTimer()}},{key:"playing",get:function(){return this._playing},set:function(t){this._playing=t,t?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}}])&&Av(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function zv(t){return zv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zv(t)}function Uv(){Uv=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==zv(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(zv(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Gv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qv(r.key),r)}}function qv(t){var e=function(t){if("object"!=zv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zv(e)?e:e+""}function Hv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hv=function(){return!!t})()}function Wv(){return Wv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Qv(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Wv.apply(null,arguments)}function Qv(t){return Qv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qv(t)}function Yv(t,e){return Yv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yv(t,e)}!function(t){t.Update="update",t.Volume="volume",t.Playing="playing",t.Paused="paused",t.NewChapter="new_chapter",t.Stopped="stopped",t.Ready="ready",t.Mute="mute",t.Finished="finished",t.Subtitles="subtitles"}(Zv||(Zv={}));var $v=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},Kv=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Qv(e),function(t,e){if(e&&("object"==zv(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Hv()?Reflect.construct(e,n||[],Qv(t).constructor):e.apply(t,n))}(this,e)).client=t,r.localState=new Vv(n.title,n.device),r.bindFunctions(),r.initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Yv(t,e)}(e,t),n=e,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 t=this;this.client.on("dispose",this.dispose),this.client.on("connected",this.handleClientConnected),this.client.on("message",this.handleDisconnectMessage).filter((function(e){return e.source===t.getDevice().id&&"disconnect"===e.message.type})),this.client.on("message",this.handleAllVideoMessages).filter((function(e){return e.source===t.getDevice().id&&"video_event"===e.message.type}))}},{key:"dispose",value:function(){var t,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(t){return console.error(t)})),(t=e,n=this,"function"==typeof(r=Wv(Qv(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"handleClientConnected",value:function(){return $v(this,void 0,void 0,Uv().mark((function t(){return Uv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.joinRoom(this.getDevice().id);case 3:t.next=8;break;case 5:t.prev=5,t.t0=t.catch(0),this.trigger("error",t.t0);case 8:case"end":return t.stop()}}),t,this,[[0,5]])})))}},{key:"handleDisconnectMessage",value:function(){this.dispose()}},{key:"handleAllVideoMessages",value:function(t){var e=this.localState.debounced,n=t.message.payload.params||{};switch(t.message.payload.event){case Zv.Update:this.handleUpdateMessage(e,n);break;case Zv.NewChapter:this.handleNewChapterMessage(e,n);break;case Zv.Volume:this.handleVolumeMessage(e,n);break;case Zv.Playing:this.handlePlayingMessage(e);break;case Zv.Paused:this.handlePausedMessage(e);break;case Zv.Finished:this.handleFinishedMessage(e);break;case Zv.Stopped:this.handleStoppedMessage()}}},{key:"handleUpdateMessage",value:function(t,e){t.duration!==e.duration&&(t.duration=e.duration,this.trigger("durationchange",Yd.void)),t.position!==e.position&&(t.position=e.position,this.trigger("positionchange",Yd.void)),t.subtitles!==e.subtitles&&(t.subtitles=e.subtitles,this.trigger("subtitleschange",Yd.void))}},{key:"handleVolumeMessage",value:function(t,e){t.volume!==e.level&&(t.volume=e.level,t.mute=0===e.level,this.trigger("volumechange",Yd.void))}},{key:"handlePlayingMessage",value:function(t){!0!==t.playing&&(t.playing=!0,t.playbackFinished=!1,this.trigger("playingchange",Yd.void))}},{key:"handlePausedMessage",value:function(t){!1!==t.playing&&(t.playing=!1,this.trigger("playingchange",Yd.void))}},{key:"handleFinishedMessage",value:function(t){!0!==t.playbackFinished&&(t.playing=!1,t.playbackFinished=!0,this.trigger("playingchange",Yd.void))}},{key:"handleNewChapterMessage",value:function(t,e){var n,r=(null!==(n=e.queue)&&void 0!==n?n:[]).find((function(e){return e.url===t.videoSource}));if(!r)return console.info("The device is no longer playing the source we loaded - disposing the session"),void this.dispose();t.subtitleSource!==r.suburl&&(t.subtitleSource=r.suburl,this.trigger("subtitleschange",Yd.void))}},{key:"handleStoppedMessage",value:function(){this.dispose()}},{key:"loadSource",value:function(t,e){return $v(this,void 0,void 0,Uv().mark((function n(){var r,o;return Uv().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.localState.videoSource!==t||this.localState.subtitleSource!==e){n.next=2;break}return n.abrupt("return");case 2:return n.prev=2,r=this.getDevice().id,o=this.getPosition(),this.localState.videoSource=t,this.localState.subtitleSource=e,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:t,subtitleSource:e});case 12:this.localState.ready=!0,this.trigger("sourceloaded",Yd.void),o>0&&this.seek(o),e&&this.setSubtitles(e),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",Yd.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",Yd.void))}},{key:"seek",value:function(t){this.localState.ready&&this.localState.position!==t&&(this.localState.position=t,this.client.seek(this.getDevice().id,t),this.trigger("positionchange",Yd.void))}},{key:"setVolume",value:function(t){this.localState.ready&&this.localState.volume!==t&&(this.localState.volume=t,this.client.setVolume(this.getDevice().id,t),this.trigger("volumechange",Yd.void))}},{key:"setMuted",value:function(t){this.localState.ready&&this.localState.mute!==t&&(this.localState.mute=t,this.client.setMuted(this.getDevice().id,t),this.trigger("volumechange",Yd.void))}},{key:"setSubtitles",value:function(t){return $v(this,void 0,void 0,Uv().mark((function e(){var n;return Uv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.localState.ready){e.next=2;break}return e.abrupt("return");case 2:if(!t){e.next=5;break}return e.next=5,this.loadSource(this.localState.videoSource,t);case 5:n=!!t,this.localState.subtitles!==n&&(this.localState.subtitles=n,this.client.setSubtitles(this.getDevice().id,n),this.trigger("subtitleschange",Yd.void));case 7:case"end":return e.stop()}}),e,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&&Gv(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Qd);function Xv(t){return Xv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xv(t)}function Jv(){Jv=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Xv(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function E(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Xv(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("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 o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function tb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,eb(r.key),r)}}function eb(t){var e=function(t){if("object"!=Xv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Xv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xv(e)?e:e+""}function nb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(nb=function(){return!!t})()}function rb(){return rb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ob(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},rb.apply(null,arguments)}function ob(t){return ob=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ob(t)}function ib(t,e){return ib=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ib(t,e)}var ab=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},ub=1e4,cb=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=ob(e),function(t,e){if(e&&("object"==Xv(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,nb()?Reflect.construct(e,n||[],ob(t).constructor):e.apply(t,n))}(this,e)).options=t,n.accessToken="",n.devices=[],n.devicesFingerprint="",n.deviceDiscovery=new nv,n.bindFunctions(),n.initialize(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ib(t,e)}(e,t),n=e,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 t=this;this.webSocket=new Nv(this.options.url),this.webSocket.onMessage=function(e){return t.trigger("message",JSON.parse(e.data))},this.webSocket.onOpen=function(){return ab(t,void 0,void 0,Jv().mark((function t(){return Jv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.options.fetchAccessToken();case 3:return this.accessToken=t.sent,t.next=6,this.authenticateWithVivi();case 6:this.beginDeviceDiscovery(),this.trigger("connected",Yd.void),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),console.error(t.t0),this.trigger("error",new Error("Could not connect to Vivi"));case 14:case"end":return t.stop()}}),t,this,[[0,10]])})))}}},{key:"sendMessage",value:function(t){var e;null===(e=this.webSocket)||void 0===e||e.send(JSON.stringify(t))}},{key:"beginDeviceDiscovery",value:function(){var t=this;this.deviceDiscovery.every(1e4).schedule((function(){return ab(t,void 0,void 0,Jv().mark((function t(){var n,r,o,i;return Jv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.getRoomList();case 3:if(n=t.sent,(r=e.calculateFingerprint(n))!==this.devicesFingerprint){t.next=7;break}return t.abrupt("return");case 7:o=new Set(n.map((function(t){var e;return null!==(e=t.organisation)&&void 0!==e?e:""}))).size,i=new Set(n.map((function(t){var e;return null!==(e=t.location)&&void 0!==e?e:""}))).size,this.devices=n.map((function(t){return{id:t.id,name:t.name,schoolName:o>1?t.organisation:"",description:i>1?t.location:"",type:Dd.Vivi,status:Bd.Available}})),this.devicesFingerprint=r,this.trigger("deviceschange",Yd.void),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(0),console.warn(t.t0);case 17:case"end":return t.stop()}}),t,this,[[0,14]])})))})).trigger().start()}},{key:"dispose",value:function(){var t,n,r,o;this.deviceDiscovery.stop(),null===(t=this.webSocket)||void 0===t||t.dipose(),(n=e,r=this,"function"==typeof(o=rb(ob(1&3?n.prototype:n),"dispose",r))?function(t){return o.apply(r,t)}:o)([])}},{key:"canCastToDevice",value:function(t){return t===Dd.Vivi}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(t){return new Kv(this,t)}},{key:"authenticateWithVivi",value:function(){return ab(this,void 0,void 0,Jv().mark((function t(){return Jv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:"relay",message:{token:this.accessToken,type:"identify_video_api"}}),t.next=3,this.one("message",(function(t){return"video_api_identified"===t.message.type})).timeout(ub).catch((function(){throw new Error("Failed to authenticate with Vivi")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"getRoomList",value:function(){return ab(this,void 0,void 0,Jv().mark((function t(){var e;return Jv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:"relay",message:{type:"video_api_rooms"}}),t.next=3,this.one("message",(function(t){return"video_api_rooms"===t.message.type})).timeout(ub).catch((function(){throw new Error("Failed to fetch rooms")}));case 3:return e=t.sent,t.abrupt("return",e.message.rooms||[]);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"joinRoom",value:function(t){return ab(this,void 0,void 0,Jv().mark((function e(){return Jv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:"relay",message:{destination_type:"box",new_destination:t,token:this.accessToken,type:"connect"}}),e.next=3,this.one("message",(function(e){return e.source===t&&"connect"===e.message.type||"error"===e.message.type&&"already_connected"===e.message.error_type||void 0})).timeout(ub).catch((function(){throw new Error("Failed to join room")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"query",value:function(t){return ab(this,void 0,void 0,Jv().mark((function n(){var r;return Jv().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.createAckId(),this.sendMessage({destination:t,message:{type:"message_with_ack",ack_id:r,name:"query"}}),n.next=4,this.one("message",(function(t){return t.message.ack_id===r})).timeout(ub).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(t){var n=t.roomId,r=t.title,o=t.videoSource,i=t.subtitleSource;return ab(this,void 0,void 0,Jv().mark((function t(){return Jv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:n,message:{type:"message_with_ack",ack_id:e.createAckId(),name:"queue_load",payload:{urls:[{title:r,url:o,suburl:i}]}}}),t.next=3,this.one("message",(function(t){var e;return t.source===n&&"ready"===(null===(e=t.message.payload)||void 0===e?void 0:e.event)})).timeout(ub).catch((function(){throw new Error("Failed to load media")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"play",value:function(t){return ab(this,void 0,void 0,Jv().mark((function e(){return Jv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"video_play",payload:{}}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"playing"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(ub).catch((function(){throw new Error("Failed to play video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(t){return ab(this,void 0,void 0,Jv().mark((function e(){return Jv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"video_pause"}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"paused"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(ub).catch((function(){throw new Error("Failed to pause video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"stop",value:function(t){return ab(this,void 0,void 0,Jv().mark((function e(){return Jv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"video_stop"}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"stopped"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(ub).catch((function(){throw new Error("Failed to stop video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"seek",value:function(t,e){return ab(this,void 0,void 0,Jv().mark((function n(){return Jv().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.sendMessageDebounced({destination:t,message:{type:"message",name:"video_seek",payload:{position:e}}})){n.next=4;break}return n.next=4,this.one("message",(function(e){var n;return e.source===t&&"playing"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(ub).catch((function(){throw new Error("Failed to seek video")}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"setVolume",value:function(t,e){return ab(this,void 0,void 0,Jv().mark((function n(){return Jv().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.sendMessageDebounced({destination:t,message:{type:"message",name:"set_volume",payload:{volume:e}}})){n.next=4;break}return n.next=4,this.one("message",(function(e){var n;return e.source===t&&"volume"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(ub).catch((function(){throw new Error("Failed to set volume")}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"setMuted",value:function(t,e){return ab(this,void 0,void 0,Jv().mark((function n(){return Jv().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"set_mute",payload:{mute:e}}}),n.next=3,this.one("message",(function(e){var n;return e.source===t&&"mute"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(ub).catch((function(){throw new Error("Failed to set mute")}));case 3:case"end":return n.stop()}}),n,this)})))}},{key:"setSubtitles",value:function(t,n){return ab(this,void 0,void 0,Jv().mark((function r(){var o;return Jv().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o=e.createAckId(),this.sendMessage({destination:t,message:{type:"message_with_ack",ack_id:o,name:"set_subtitles",payload:{subtitles:n}}}),r.next=4,this.one("message",(function(e){var n;return e.source===t&&"subtitles"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(ub).catch((function(){throw new Error("Failed to set subtitles")}));case 4:case"end":return r.stop()}}),r,this)})))}}],o=[{key:"createAckId",value:function(){return Pd()}},{key:"calculateFingerprint",value:function(t){return t.map((function(t){return t.id})).sort().join(",")}}],r&&tb(n.prototype,r),o&&tb(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Qd);function lb(t){return lb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lb(t)}function sb(t){return function(t){if(Array.isArray(t))return fb(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return fb(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fb(t,e):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.")}()}function fb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function pb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yb(r.key),r)}}function yb(t){var e=function(t){if("object"!=lb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=lb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lb(e)?e:e+""}function hb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(hb=function(){return!!t})()}function db(){return db="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=vb(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},db.apply(null,arguments)}function vb(t){return vb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vb(t)}function bb(t,e){return bb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bb(t,e)}var mb=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=vb(e),function(t,e){if(e&&("object"==lb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,hb()?Reflect.construct(e,n||[],vb(t).constructor):e.apply(t,n))}(this,e)).instanceId=t,n.clients=[],n.bindFunctions(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bb(t,e)}(e,t),n=e,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(t){var e=this;t.on("deviceschange",this.gatherAndPublishDevices),t.on("error",(function(t){return e.trigger("error",t)})),this.clients.push(t)}},{key:"hasInstanceOfClient",value:function(t){return this.clients.some((function(e){return e instanceof t}))}},{key:"startCastSession",value:function(t){var e=this;if(this.castSession){if(this.castSession.getDevice().id===t.device.id)return void console.info("A session with device ".concat(t.device.id," already exists - this is a no-op"));this.castSession.dispose()}var n=this.clients.find((function(e){return e.canCastToDevice(t.device.type)}));n&&(this.castSession=n.startCastSession(t),this.castSession.on("error",(function(t){e.castSession.dispose(),e.trigger("error",t)})),this.castSession.on("dispose",(function(){e.castSession=void 0,e.trigger("castsessionchange",void 0)})),this.trigger("castsessionchange",this.castSession))}},{key:"getCastSession",value:function(){return this.castSession}},{key:"gatherAndPublishDevices",value:function(){var t=this.clients.map((function(t){return t.getDevices()})).reduce((function(t,e){return[].concat(sb(t),sb(e))}),[]);this.trigger("deviceschange",t)}},{key:"dispose",value:function(){var t,n,r,o;null===(t=this.castSession)||void 0===t||t.dispose(),this.clients.forEach((function(t){return t.dispose()})),this.castSession=void 0,this.clients=[],(n=e,r=this,"function"==typeof(o=db(vb(1&3?n.prototype:n),"dispose",r))?function(t){return o.apply(r,t)}:o)([])}}],o=[{key:"getOrCreateInstance",value:function(t){if(!t)throw new Error("instanceId is required");return this.instances[t]||(this.instances[t]=new e(t)),this.instances[t]}},{key:"disposeAndRemoveInstance",value:function(t){t.dispose(),delete this.instances[t.instanceId]}},{key:"isActive",value:function(){return Object.keys(this.instances).length>0}}],r&&pb(n.prototype,r),o&&pb(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Qd);function gb(t){return gb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gb(t)}function wb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ob(r.key),r)}}function Ob(t){var e=function(t){if("object"!=gb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=gb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gb(e)?e:e+""}function Pb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Pb=function(){return!!t})()}function Sb(t,e,n,r){var o=jb(kb(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function jb(){return jb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=kb(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},jb.apply(null,arguments)}function kb(t){return kb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kb(t)}function _b(t,e){return _b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_b(t,e)}mb.instances={};var Eb=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=kb(e),function(t,e){if(e&&("object"==gb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Pb()?Reflect.construct(e,n||[],kb(t).constructor):e.apply(t,n))}(this,e,[t,n])).isVisible=r.isVisible.bind(r),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_b(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){var t,n;return Sb(e,"createEl",this,3)(["li",{className:"vjs-menu-item cv-device-menu-item",innerHTML:'\n <div class="cv-device-menu-item-body">\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!==(t=this.options_.schoolName)&&void 0!==t?t:"",'</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 </div>\n ")}])}},{key:"handleClick",value:function(){this.options_.onClick()}},{key:"show",value:function(){Sb(e,"show",this,3)([])}},{key:"hide",value:function(){Sb(e,"hide",this,3)([])}},{key:"isVisible",value:function(){return!Sb(e,"hasClass",this,3)(["vjs-hidden"])}}])&&wb(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function Cb(t){return Cb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cb(t)}function Tb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xb(r.key),r)}}function xb(t){var e=function(t){if("object"!=Cb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Cb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cb(e)?e:e+""}function Lb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Lb=function(){return!!t})()}function Rb(t){return Rb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rb(t)}function Ib(t,e){return Ib=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ib(t,e)}var Db=o.Z.getComponent("Menu"),Bb=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Rb(e),function(t,e){if(e&&("object"==Cb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Lb()?Reflect.construct(e,n||[],Rb(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ib(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){var t=Db.originalProto.createEl.apply(this),e=this.contentEl_;return this.contentWrapper=o.Z.dom.createEl("div",{className:"vjs-menu-content"}),t.className="vjs-menu cv-devices-menu",e.className="cv-devices-menu-item-list",t.removeChild(e),t.appendChild(this.contentWrapper),this.contentWrapper.appendChild(e),this.simpleBar=new lu.Z(e,{autoHide:!1}),t}},{key:"addCta",value:function(t){this.ctaElement?console.warn("CTA has already been added to the menu - this is a no-op"):(this.ctaElement=t.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"))}}])&&Tb(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Db);o.Z.registerComponent("DevicesMenu",Bb);var Nb=n(44645);function Mb(t){return Mb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mb(t)}function Ab(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Vb(r.key),r)}}function Zb(t,e,n){return e&&Fb(t.prototype,e),n&&Fb(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Vb(t){var e=function(t){if("object"!=Mb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Mb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Mb(e)?e:e+""}function zb(t,e,n){return e=qb(e),function(t,e){if(e&&("object"==Mb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ub()?Reflect.construct(e,n||[],qb(t).constructor):e.apply(t,n))}function Ub(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ub=function(){return!!t})()}function Gb(){return Gb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=qb(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Gb.apply(null,arguments)}function qb(t){return qb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qb(t)}function Hb(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wb(t,e)}function Wb(t,e){return Wb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wb(t,e)}var Qb=function(t){function e(t,n){return Ab(this,e),zb(this,e,[t,n])}return Hb(e,t),Zb(e,[{key:"dispose",value:function(){var t,n,r,o=this;setImmediate((function(){var t;null===(t=o.root)||void 0===t||t.unmount()})),(t=e,n=this,"function"==typeof(r=Gb(qb(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}}])}(o.Z.getComponent("Component")),Yb={tagName:"div"};function $b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yb;if(!t)throw new Error("componentCtor is required");var n=function(n){function r(){return Ab(this,r),zb(this,r,arguments)}return Hb(r,n),Zb(r,[{key:"createEl",value:function(){var n=o.Z.dom.createEl(e.tagName,e.properties,e.attributes),r=(0,Nb.s)(n);return r.render(t(this.player_,this.options_)),this.root=r,n}}])}(Qb);return n}function Kb(t){var e=t.inactiveIntegrations,n=t.canUserManageIntegrations,o=t.player,i=t.onDismiss,a=t.onInstall,u=t.onLearnMore,c=t.onContactSupport;if(0===e.length)return r.createElement(r.Fragment,null);var l,s=function(t){return o.localize(t)},f=function(t){return-1!==e.indexOf(t)};return l=f(Dd.AppleTv)&&f(Dd.Vivi)?"vivi_and_apple_tv":f(Dd.Vivi)?"vivi":"apple_tv",r.createElement("div",{className:"cv-devices-cta",tabIndex:-1},r.createElement(Xb,{context:l,localize:s,onDismiss:function(){return i(l)}}),r.createElement(Jb,{context:l}),r.createElement(tm,{context:l,canUserManageIntegrations:n,localize:s,onContactSupport:function(){return c(l)},onInstall:function(){return a(l)},onLearnMore:function(){return u(l)}}))}function Xb(t){var e=t.context,n=t.localize,o=t.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"===e&&n("Cast to Vivi and Apple TV"),"vivi"===e&&n("Cast to Vivi"),"apple_tv"===e&&n("Cast to Apple TV")),r.createElement("span",{className:"cv-devices-close",onClick:o},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 Jb(t){var e=t.context,n="vivi_and_apple_tv"===e?"bg-vivi-and-apple":"vivi"===e?"bg-vivi":"bg-apple";return r.createElement("div",{className:"cv-devices-cta-body ".concat(n)},("vivi_and_apple_tv"===e||"apple_tv"===e)&&r.createElement("div",{className:"cv-devices-icon-container"},r.createElement("span",{className:"cv-devices-icon apple"})),("vivi_and_apple_tv"===e||"vivi"===e)&&r.createElement("div",{className:"cv-devices-icon-container"},r.createElement("span",{className:"cv-devices-icon vivi"})))}function tm(t){var e=t.context,n=t.canUserManageIntegrations,o=t.localize,i=t.onInstall,a=t.onLearnMore,u=t.onContactSupport;return n?r.createElement("div",{className:"cv-devices-cta-footer"},r.createElement("span",null,"vivi_and_apple_tv"===e&&o("Discover our new device integrations to make presenting in the classroom easy!"),"vivi"===e&&o("Discover our new Vivi integration."),"apple_tv"===e&&o("Discover our new Apple TV integration.")),r.createElement("br",null),r.createElement("span",{className:"cv-devices-link",onClick:i},o("Click here to install"))):r.createElement("div",{className:"cv-devices-cta-footer"},r.createElement("span",null,"vivi_and_apple_tv"===e&&o("Cast to Vivi and Apple TV is now available! Please contact "),"vivi"===e&&o("Cast to Vivi is now available! Please contact "),"apple_tv"===e&&o("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"===e&&o(" or your administrator to set up Apple TV and Vivi."),"vivi"===e&&o(" or your administrator to set up Vivi."),"apple_tv"===e&&o(" or your administrator to set up Apple TV.")),r.createElement("br",null),r.createElement("span",{className:"cv-devices-link",onClick:a},"Learn more"))}function em(t){return em="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},em(t)}function nm(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rm(r.key),r)}}function rm(t){var e=function(t){if("object"!=em(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=em(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==em(e)?e:e+""}function om(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(om=function(){return!!t})()}function im(t,e,n,r){var o=am(um(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function am(){return am="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=um(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},am.apply(null,arguments)}function um(t){return um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},um(t)}function cm(t,e){return cm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cm(t,e)}o.Z.registerComponent("DevicesCta",$b((function(t,e){return r.createElement(Kb,Object.assign({player:t},e))}),{properties:{className:"cv-devices-cta-wrapper"}}));var lm=o.Z.getComponent("DevicesCta"),sm=o.Z.getComponent("MenuButton"),fm=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=um(e),function(t,e){if(e&&("object"==em(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,om()?Reflect.construct(e,n||[],um(t).constructor):e.apply(t,n))}(this,e,[t,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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cm(t,e)}(e,t),n=e,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 t=this,e=this.$("button"),n=function(e){t.menu.handleBlur(e)};e.addEventListener("blur",n),this.one("dispose",(function(){var r;e.removeEventListener("blur",n),null===(r=t.cta)||void 0===r||r.dispose()}))}},{key:"createEl",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=sm.prototype.createEl).apply.apply(t,[this].concat(n))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-devices-button ".concat(im(e,"buildWrapperCSSClass",this,3)([]))}},{key:"createMenu",value:function(){var t=this,e=new Bb(this.player_,{menuButton:this});if(!this.options_.ctaOptions.hasBeenDismissed&&this.options_.ctaOptions.inactiveIntegrations.length>0){var n=this.options_.ctaOptions,r=n.onDismiss,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(n,["onDismiss"]);this.cta=new lm(this.player(),Object.assign(Object.assign({},o),{onDismiss:function(n){t.hideNotificationBadge(),e.removeCta(),r(n)}})),this.showNotificationBadge(),e.addCta(this.cta)}return this.createItems().forEach((function(t){return e.addItem(t)})),e}},{key:"createItems",value:function(){var t=this,e=[];return this.headingItem=new _(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new ct(this.player_,{menuButton:this,search:function(e){return t.setSearchText(e)},className:"cv-devices-search-input"}),this.emptyPlaceholder=new lt(this.player_,{label:"No devices found",selected:!1,selectable:!1,multiSelectable:!1}),this.headingItem.show(),this.searchInputItem.hide(),this.emptyPlaceholder.show(),e.push(this.headingItem,this.searchInputItem,this.emptyPlaceholder),e}},{key:"pressButton",value:function(){var t;im(e,"pressButton",this,3)([]),this.shouldShowSearchInput()&&(null===(t=this.searchInputItem)||void 0===t||t.focus())}},{key:"setDevices",value:function(t){this.devices=t,this.render()}},{key:"setCastSession",value:function(t){this.castSession=t,this.render()}},{key:"setSearchText",value:function(t){this.searchText=t,this.render()}},{key:"getDeviceMenuItems",value:function(){return this.menu.children_.filter((function(t){return t instanceof Eb}))}},{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(t){var e=this;t.forEach((function(t){e.menu.removeChild(t),t.dispose()}))}},{key:"addMenuItemsForDevices",value:function(t){var e=this;t.sort((function(t,e){var n,r,o,i,a="".concat(t.type).concat(null!==(n=t.schoolName)&&void 0!==n?n:"").concat(null!==(r=t.description)&&void 0!==r?r:"").concat(t.name),u="".concat(e.type).concat(null!==(o=e.schoolName)&&void 0!==o?o:"").concat(null!==(i=e.description)&&void 0!==i?i:"").concat(e.name);return a.localeCompare(u)})).forEach((function(t){var n=new Eb(e.player(),{id:t.id,label:t.name,schoolName:t.schoolName,description:t.description,selected:!1,multiSelectable:!1,selectable:!0,available:t.status===Bd.Available,type:t.type,onClick:function(){e.options_.onDeviceMenuItemClick(n,t)}});e.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 t=this,e=this.getDeviceMenuItems(),n=this.shouldShowSearchInput(),r=this.searchText.toLowerCase();e.forEach((function(e){var o,i,a,u=t.devices.find((function(t){return t.id===e.options_.id}));if(u){var c=u.status===Bd.Available,l=u.id===(null===(o=t.castSession)||void 0===o?void 0:o.getDevice().id),s=!n||-1!=="".concat(u.name," ").concat(null!==(i=u.schoolName)&&void 0!==i?i:""," ").concat(null!==(a=u.description)&&void 0!==a?a:"").trim().toLowerCase().indexOf(r);c?e.enable():e.disable(),s?e.show():e.hide(),l?e.selected(!0):e.selected(!1)}}))}},{key:"toggleEmptyStatePlaceholder",value:function(){var t=this.getDeviceMenuItems();t.filter((function(t){return t.isVisible()})).length?this.emptyPlaceholder.hide():this.emptyPlaceholder.show(),t.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 t,e;return null!==(e=null===(t=this.castSession)||void 0===t?void 0:t.getDevice().name)&&void 0!==e?e:" "}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){this.handleClick()}},{key:"handleClick",value:function(){im(e,"handleClick",this,3)([null]),this.options_.onClick()}}],r&&nm(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(sm);function pm(t){return pm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pm(t)}function ym(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,hm(r.key),r)}}function hm(t){var e=function(t){if("object"!=pm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pm(e)?e:e+""}function dm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(dm=function(){return!!t})()}function vm(){return vm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=bm(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},vm.apply(null,arguments)}function bm(t){return bm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bm(t)}function mm(t,e){return mm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mm(t,e)}fm.prototype.controlText_="Devices",o.Z.registerComponent("DevicesButton",fm);var gm=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=bm(e),function(t,e){if(e&&("object"==pm(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,dm()?Reflect.construct(e,n||[],bm(t).constructor):e.apply(t,n))}(this,e,[null,t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mm(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(){return(t=e,n=this,"function"==typeof(r=vm(bm(1&3?t.prototype:t),"createEl",n))?function(t){return r.apply(n,t)}:r)(["div",{className:"cv-devices-tech"}]);var t,n,r}},{key:"setPoster",value:function(t){this.poster=t,this.update()}},{key:"setDevice",value:function(t){this.device=t,this.update()}},{key:"update",value:function(){var t,e,n,r,o=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!==(e=null===(t=this.device)||void 0===t?void 0:t.type)&&void 0!==e?e:Dd.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 i=document.createElement("button"),a=function(t){t.stopPropagation(),o.options_.onStopCasting()};i.onclick=a,i.ontouchstart=a,i.className="stop-casting-button",i.innerHTML=this.localize("Stop casting"),this.el_.querySelector(".cv-devices-content").appendChild(i)}},{key:"play",value:function(){}}],r&&ym(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function wm(t){return wm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wm(t)}function Om(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Pm(r.key),r)}}function Pm(t){var e=function(t){if("object"!=wm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wm(e)?e:e+""}function Sm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Sm=function(){return!!t})()}function jm(t,e,n,r){var o=km(_m(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function km(){return km="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=_m(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},km.apply(null,arguments)}function _m(t){return _m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_m(t)}function Em(t,e){return Em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Em(t,e)}var Cm=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=_m(e),function(t,e){if(e&&("object"==wm(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Sm()?Reflect.construct(e,n||[],_m(t).constructor):e.apply(t,n))}(this,e,[t,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,o.Z)(r.options_.playerId),r.bindFunctions(),r.bindEventListeners(),r.ready((function(){r.setSource(r.options_.source)})),r.triggerReady(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Em(t,e)}(e,t),n=e,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 t=this,e=this.getCastSession();e&&(this.textTracks().on("change",this.onTextTrackChanged),this.videojsPlayer.one("ended",(function(){e.dispose()})),e.on("durationchange",(function(){t.trigger("durationchange")})),e.on("dispose",(function(){t.trigger("ended"),t.hideUI()})),e.on("playingchange",(function(){e.isPlaying()?(t.trigger("play"),t.trigger("playing")):t.trigger("pause")})),e.on("volumechange",(function(){t.trigger("volumechange")})),e.on("sourceloaded",(function(){t.trigger("loadeddata")})),e.on("subtitleschange",(function(){t.setSelectedTextTrack(e.getSubtitles())})))}},{key:"onTextTrackChanged",value:function(){var t,e=this.getSelectedTextTrack();null===(t=this.getCastSession())||void 0===t||t.setSubtitles(null==e?void 0:e.src)}},{key:"getSelectedTextTrack",value:function(){return W.findTrackByPredicate(this.videojsPlayer.player_,(function(t){return"showing"===t.mode&&!!t.src}))}},{key:"setSelectedTextTrack",value:function(t){W.forEachTrack(this.videojsPlayer.player_,(function(e){e.src===t?e.mode="showing":e.mode="hidden"}))}},{key:"showUI",value:function(t){this.ui&&(this.ui.setPoster(this.options_.poster),this.ui.setDevice(t),this.ui.show())}},{key:"hideUI",value:function(){var t;null===(t=this.ui)||void 0===t||t.hide()}},{key:"dispose",value:function(){this.textTracks().off("change",this.onTextTrackChanged);var t=this.getCastSession();t&&t.dispose(),jm(e,"cleanupAutoTextTracks",this,3)([]),jm(e,"dispose",this,3)([])}},{key:"createEl",value:function(){var t=this;return this.ui=this.ui||new gm({onStopCasting:function(){var e;null===(e=t.getCastSession())||void 0===e||e.dispose()}}),this.ui.el()}},{key:"setSource",value:function(t){var e=this.getCastSession();if(e){this.showUI(e.getDevice()),this.trigger("loadstart");var n=this.getSelectedTextTrack();e.loadSource(t.src,null==n?void 0:n.src)}}},{key:"addRemoteTextTrack",value:function(t){return jm(e,"addRemoteTextTrack",this,3)([t,!0])}},{key:"getCastSession",value:function(){var t;return mb.getOrCreateInstance(null!==(t=this.options_.instanceId)&&void 0!==t?t:"").getCastSession()}},{key:"play",value:function(){var t;null===(t=this.getCastSession())||void 0===t||t.play()}},{key:"pause",value:function(){var t;null===(t=this.getCastSession())||void 0===t||t.pause()}},{key:"paused",value:function(){var t;return!1===(null===(t=this.getCastSession())||void 0===t?void 0:t.isPlaying())}},{key:"ended",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.isPlaybackFinished())&&void 0!==e&&e}},{key:"setCurrentTime",value:function(t){var e;null===(e=this.getCastSession())||void 0===e||e.seek(null!=t?t:0)}},{key:"currentTime",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}},{key:"duration",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getDuration())&&void 0!==e?e:this.videojsPlayer.duration()}},{key:"volume",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getVolume())&&void 0!==e?e:1}},{key:"setVolume",value:function(t){var e;null===(e=this.getCastSession())||void 0===e||e.setVolume(t)}},{key:"muted",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getMuted())&&void 0!==e&&e}},{key:"setMuted",value:function(t){var e;null===(e=this.getCastSession())||void 0===e||e.setMuted(t)}},{key:"buffered",value:function(){}},{key:"seekable",value:function(){return o.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(){}}],i=[{key:"canPlayType",value:function(){return""}},{key:"canPlaySource",value:function(t,e){var n;return!!mb.getOrCreateInstance(null!==(n=null==e?void 0:e.instanceId)&&void 0!==n?n:"").getCastSession()}},{key:"isSupported",value:function(){return mb.isActive()}}],r&&Om(n.prototype,r),i&&Om(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(o.Z.getComponent("Tech"));function Tm(t){return Tm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tm(t)}function xm(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Lm(r.key),r)}}function Lm(t){var e=function(t){if("object"!=Tm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Tm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tm(e)?e:e+""}function Rm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Rm=function(){return!!t})()}function Im(){return Im="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Dm(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Im.apply(null,arguments)}function Dm(t){return Dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dm(t)}function Bm(t,e){return Bm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Bm(t,e)}o.Z.registerTech("devices",Cm);var Nm=function(t){function e(t,n){var r,o,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Dm(e),function(t,e){if(e&&("object"==Tm(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Rm()?Reflect.construct(e,n||[],Dm(t).constructor):e.apply(t,n))}(this,e,[t,n])).options=n,r.instanceId=null!==(i=null===(o=r.player.options_.devices)||void 0===o?void 0:o.instanceId)&&void 0!==i?i:"",r.bindFunctions(),r.initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bm(t,e)}(e,t),n=e,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 t=this,e=this.player.getChild("collapserator"),n=null==e?void 0:e.children().findIndex((function(t){return"CustomControlSpacer"===t.name()})),r=null==e?void 0:e.children().findIndex((function(t){return"OpenExternallyButton"===t.name()})),o=Math.max(n,r)+1,i=this.getSessionManager();if(e&&n&&-1!==n&&i){i.on("deviceschange",this.onDevicesChanged),i.on("castsessionchange",this.onCastSessionChanged),i.on("error",this.onDevicesError);var a=this.options.ctaOptions,u=this.options.vivi,c=[];this.options.appleTv.enabled||c.push(Dd.AppleTv),u.enabled&&u.accountConnected||c.push(Dd.Vivi);var l={onClick:function(){t.addViviClient(i),t.addAppleTvClient(i)},onDeviceMenuItemClick:function(e,n){var r;i.startCastSession({device:n,title:t.options.title}),null===(r=t.options.analyticsService)||void 0===r||r.logUserAction(n,{actionType:ne.Vw.Select,workflowPhase:ne.eu.Complete,descriptor:ne.UX.ChangeDevice,entity:ne.py.Device,eventVersion:ne.eq.V3})},ctaOptions:Object.assign(Object.assign({},a),{inactiveIntegrations:c})};this.devicesButton=e.addChild("DevicesButton",l,o)}}},{key:"onDevicesChanged",value:function(t){var e;null===(e=this.devicesButton)||void 0===e||e.setDevices(t)}},{key:"onCastSessionChanged",value:function(t){var e;null===(e=this.devicesButton)||void 0===e||e.setCastSession(t),this.reloadTech(),t?(this.player.addClass("cv-device-casting"),this.player.addClass("cv-device-".concat(t.getDevice().type)),this.player.isFullscreen()&&this.player.exitFullscreen()):(this.player.removeClass("cv-device-casting"),this.player.removeClass("cv-device-".concat(Dd.AppleTv)),this.player.removeClass("cv-device-".concat(Dd.Vivi)))}},{key:"onDevicesError",value:function(t){this.player.error(t.message),this.player.pause()}},{key:"addViviClient",value:function(t){if(this.options.vivi.enabled&&this.options.vivi.accountConnected&&this.options.vivi.apiUrl&&!t.hasInstanceOfClient(cb)){var e=new cb({url:this.options.vivi.apiUrl,fetchAccessToken:this.options.vivi.fetchAccessToken});t.addClient(e)}}},{key:"addAppleTvClient",value:function(t){if(this.options.appleTv.enabled&&this.options.trackingCode&&this.options.userId&&!t.hasInstanceOfClient(Lv)){var e=new Lv({fetchAccessToken:this.options.appleTv.fetchAccessToken,trackingCode:this.options.trackingCode,userId:this.options.userId});t.addClient(e)}}},{key:"reloadTech",value:function(){var t=this.player,e=t.currentSources(),n=t.volume(),r=t.muted(),o=t.currentTime(),i=t.paused();t.src(e),t.one("playing",(function(){t.volume(n),t.muted(r),t.currentTime(o),i?t.pause():t.play()}))}},{key:"getSessionManager",value:function(){if(this.instanceId)return mb.getOrCreateInstance(this.instanceId)}},{key:"dispose",value:function(){var t,n,r,o=this.getSessionManager();o&&(o.off("deviceschange",this.onDevicesChanged),o.off("castsessionchange",this.onCastSessionChanged),o.off("error",this.onDevicesError),mb.disposeAndRemoveInstance(o),(t=e,n=this,"function"==typeof(r=Im(Dm(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([]))}}],r&&xm(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function Mm(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Am(t){var e,n,o,i=r.useRef(t.player.duration()-t.player.currentTime()),a=(n=r.useState(i.current),o=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(n,o)||function(t,e){if(t){if("string"==typeof t)return Mm(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mm(t,e):void 0}}(n,o)||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 e=t.player.duration()-t.player.currentTime();c(e),e>i.current&&(i.current=e)}if(r.useEffect((function(){return t.player.on("timeupdate",l),function(){t.player.off("timeupdate",l)}}),[]),!t.nextVideo||!t.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:t.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:t.onPlayNext,style:{backgroundImage:"url(".concat(null===(e=t.nextVideo)||void 0===e?void 0:e.thumbnailUrl,")")}}),r.createElement("div",{className:"cv-up-next-title"},t.nextVideo.name)))}function Fm(t){return Fm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fm(t)}function Zm(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Vm(r.key),r)}}function Vm(t){var e=function(t){if("object"!=Fm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fm(e)?e:e+""}function zm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(zm=function(){return!!t})()}function Um(){return Um="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Gm(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Um.apply(null,arguments)}function Gm(t){return Gm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gm(t)}function qm(t,e){return qm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qm(t,e)}o.Z.registerPlugin("devicesPlugin",Nm),o.Z.registerComponent("UpNext",$b((function(t,e){return r.createElement(Am,Object.assign({player:t},e))})));var Hm=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Gm(e),function(t,e){if(e&&("object"==Fm(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zm()?Reflect.construct(e,n||[],Gm(t).constructor):e.apply(t,n))}(this,e,[t,n])).playNext=t.nextVideoPlugin().getShouldPlayNext(),r.toggle(r.playNext),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qm(t,e)}(e,t),n=e,r=[{key:"handleToggle",value:function(){this.toggle(!this.playNext)}},{key:"toggle",value:function(t){t?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){this.playNext=!0,o.Z.dom.addClass(this.toggleEl,"on"),this.player_.nextVideoPlugin().setShouldPlayNext(this.playNext,!0)}},{key:"toggleOff",value:function(){this.playNext=!1,o.Z.dom.removeClass(this.toggleEl,"on"),this.player_.nextVideoPlugin().setShouldPlayNext(this.playNext,!0)}},{key:"handleClick",value:function(t){t.stopImmediatePropagation()}},{key:"createEl",value:function(t,n,r){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=o.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 i,a,u,c=(i=e,a=this,"function"==typeof(u=Um(Gm(1&3?i.prototype:i),"createEl",a))?function(t){return u.apply(a,t)}:u)([t,{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&&Zm(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function Wm(t){return Wm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wm(t)}function Qm(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ym(r.key),r)}}function Ym(t){var e=function(t){if("object"!=Wm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Wm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wm(e)?e:e+""}function $m(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return($m=function(){return!!t})()}function Km(){return Km="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Xm(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Km.apply(null,arguments)}function Xm(t){return Xm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xm(t)}function Jm(t,e){return Jm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jm(t,e)}o.Z.registerComponent("NextVideoMenuItem",Hm);var tg="cv-persisttest",eg="cv-play-next-video",ng=o.Z.getPlugin("plugin"),rg=(o.Z.getComponent("MenuItem"),o.Z.getComponent("NextVideoMenuItem")),og=function(t){function e(t){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Xm(e),function(t,e){if(e&&("object"==Wm(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,$m()?Reflect.construct(e,n||[],Xm(t).constructor):e.apply(t,n))}(this,e,[t])).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(eg);n.shouldPlayNextVideo="true"===r}return t.ready((function(){n.initialize()})),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jm(t,e)}(e,t),n=e,r=[{key:"initialize",value:function(){this.player.isDisposed()||this.bindListeners()}},{key:"getChapterTrack",value:function(){return W.getTrack(this.player,"chapters",null)}},{key:"setNextVideo",value:function(t,e,n){var r;this.nextVideo=t,this.callback=n,e&&this.setShouldPlayNext(!0),(null===(r=this.player.getChild("collapserator"))||void 0===r?void 0:r.getChild("cogButton")).addItem({index:0,ctor:rg,name:"NextVideoMenuItem"})}},{key:"getShouldPlayNext",value:function(){return this.shouldPlayNextVideo}},{key:"setShouldPlayNext",value:function(t,e){this.shouldPlayNextVideo=t,this.hasLocalStorage&&e&&window.localStorage.setItem(eg,t.toString())}},{key:"bindListeners",value:function(){this.player.on("timeupdate",this.onTimeUpdate)}},{key:"dispose",value:function(){var t,n,r;this.player.off("timeupdate",this.onTimeUpdate),this.hideUpNext(),(t=e,n=this,"function"==typeof(r=Km(Xm(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"onTimeUpdate",value:function(){var t,e;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===(t=null==n?void 0:n.activeCues)||void 0===t?void 0:t.length)&&n.activeCues[0];"credits"===(null===(e=null==r?void 0:r.text)||void 0===e?void 0:e.toLowerCase())||this.player.currentTime()>=this.player.duration()-5?this.showUpNext():this.hideUpNext()}}else this.hideUpNext()}},{key:"showUpNext",value:function(){var t=this;this.upNextRendered||(this.upNextRendered=!0,this.upNextTimepoint=this.player.currentTime(),this.player.addChild("UpNext",{nextVideo:this.nextVideo,onPlayNext:this.callback,onCancel:function(){t.hideUpNext(),t.setShouldPlayNext(!1)}}))}},{key:"hideUpNext",value:function(){if(this.upNextRendered){this.upNextRendered=!1,this.upNextTimepoint=null;var t=this.player.getChild("UpNext");t&&(this.player.removeChild(t),t.dispose())}}},{key:"testHasLocalStorage",value:function(){try{return window.localStorage.setItem(tg,"persistPlayNext"),window.localStorage.removeItem(tg),!0}catch(t){return!1}}}],r&&Qm(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ng);o.Z.registerPlugin("nextVideoPlugin",og);var ig=n(39202),ag=n(49985),ug=n(57408),cg=n(11607),lg=n(86073),sg=n(1164),fg=n(45778),pg=n(85473);var yg={width:200,resizeType:ty.Nq.Cover};function hg(t){var e;return fg.G.isResource(t)?t.metadata.type===sg.L.Pdf||(null===(e=t.pdf)||void 0===e?void 0:e.url)?ty.__.Pdf:ty.__.Thumbnails:ty.__.Link}function dg(t){var e,n,o,i=null,a=0;fg.G.isResource(t.resource)&&(i=t.resource.metadata,a=null!==(o=null===(n=null===(e=t.resource.thumbnail)||void 0===e?void 0:e.metadata)||void 0===n?void 0:n.rotation)&&void 0!==o?o:0);var u=function(t,e){var n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yg,a=hg(e);if("thumbnail"in e&&(null===(n=e.thumbnail)||void 0===n?void 0:n.url))return Jp.j.createUrl(null===(r=e.thumbnail)||void 0===r?void 0:r.url,Object.assign({},i));var u=lg._.safeUrlConcat(t,"/v1/previews");return fg.G.isResource(e)?a===ty.__.Pdf?e.metadata.type===sg.L.Pdf?Jp.j.createResourceImage(u,e.url,Object.assign({},i)):Jp.j.createResourceImage(u,null===(o=e.pdf)||void 0===o?void 0:o.url,Object.assign({},i)):e.metadata.type!==sg.L.Zip?Jp.j.createUrl(e.url,{size:ty.h2.Medium,resizeType:ty.Nq.Cover}):"/images/zip-resource.png":Jp.j.createResourceImage(u,e.url,Object.assign({},i))}(t.imageCdnUrl,t.resource,t.dynamicRatioImageOptions);return r.createElement(pg.Z,{data:u,imageType:hg(t.resource),imageStyle:{transform:"rotate(".concat(a,"deg)")},alt:t.resource.name,errorFallbackImageSrc:t.imageErrorFallbackUrl,errorFallbackImageClassName:"Xy4zX",imageClassName:(null==i?void 0:i.type)===sg.L.Image?"".concat("z4O5p"," ").concat("FFgf3"):"",preload:t.preloadImage,preventLoad:!t.preloadImage})}var vg=n(83914),bg=n(97663),mg=n(76177),gg=n(1948),wg=n(71063),Og=n(4594),Pg=n(79967),Sg=n(35223);function jg(t){var e,n,o,i,a=null;"metadata"in t.data&&(a=t.data.metadata);var u=fg.G.isType(t.data,Og.E.Resource);return r.createElement(r.Fragment,null,r.createElement("div",{className:"OnJDH"},r.createElement("div",{className:"CIFy7"},r.createElement("div",{className:function(e){var n,r="\n d-flex flex-column align-items-center justify-content-end rounded-3 h-100\n position-relative ".concat(function(t){switch(t){case"atom-guide":return"X39wU";case"student-activity":return"X9pMl";case"teacher-pack":return"_tdVE";case"additional-materials":return"qRVUo";default:return"_18JaV"}}(e)," ").concat("oUZPD");return(null===(n=t.theme)||void 0===n?void 0:n.containerClass)?r+=" ".concat(t.theme.containerClass):r+=" pt-3 px-3",t.applyHoverState&&(r+=" ".concat("xRYhX")),r}(null==a?void 0:a.resourceType)},"above"===t.titlePosition&&r.createElement(mg.u,{title:t.data.name},r.createElement("h3",{className:"text-center text-break h5 mb-3 ".concat("g5NWS")},r.createElement("span",{className:"clamp-1"},t.data.name))),r.createElement("div",{className:"\n ".concat(null!==(n=null===(e=t.theme)||void 0===e?void 0:e.thumbnailContainerClass)&&void 0!==n?n:""," w-75 overflow-hidden \n ").concat("EDiGi"," ").concat("above"===t.titlePosition?"e9ejn":""," \n ").concat("I9E5O","\n ")},r.createElement(dg,{resource:t.data,imageCdnUrl:t.imageCdnUrl,imageErrorFallbackUrl:t.imageErrorFallbackUrl,preloadImage:t.preloadImage})),u&&t.onClickDownload&&"normal"===t.actionBehaviour&&r.createElement("div",{className:"jzGAm"},r.createElement(cg.L,{onClick:function(e){return t.onClickDownload(e,t.data)},className:"".concat("fbb_e"," d-flex align-items-center justify-content-center")},r.createElement(vg.x,{svgName:Sg.vn.Download}))),!t.hideTypeBadge&&u&&r.createElement(gg.y,{typeId:Og.E.Resource})))),"below"===t.titlePosition&&r.createElement("div",{className:"mt-1 ".concat("Cpjs3")},fg.G.isType(t.data,Og.E.Resource)&&!!(null===(i=null===(o=t.data)||void 0===o?void 0:o.metadata)||void 0===i?void 0:i.resourceType)&&r.createElement(bg.m,null,function(t){switch(t){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"}}(t.data.metadata.resourceType)),r.createElement("h3",{className:"h6 clamp-2"},t.data.name)))}function kg(t){return kg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kg(t)}function _g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Eg(r.key),r)}}function Eg(t){var e=function(t){if("object"!=kg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=kg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kg(e)?e:e+""}function Cg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Cg=function(){return!!t})()}function Tg(t){return Tg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tg(t)}function xg(t,e){return xg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xg(t,e)}function Lg(t){return r.createElement("div",{className:"cv-resource-item"},r.createElement(jg,{data:t.resource,imageCdnUrl:t.imageCdnUrl,titlePosition:"above",hideTypeBadge:!0}))}jg.defaultProps={preloadImage:!0,actionBehaviour:"normal"},r.memo((function(t){var e,n,o,i,a=(e=t.data,n=t.actionBehaviour,i=(0,Pg.k)(),"public"===n||!i.xs&&!i.sm&&"resource"===e.type&&"metadata"in e&&(e.metadata.type===sg.L.Image||(e.metadata.type===sg.L.Pdf?!!e.url:!!(null===(o=e.pdf)||void 0===o?void 0:o.url)))),u=Object.assign(Object.assign({},t.analyticsData),t.data),c=Object.assign(Object.assign({},t.analyticsOptions),{actionType:ne.Vw.Click,entity:t.data.typeId===Og.E.Resource?ne.py.Resource:ne.py.Link});function l(){ag.k.logUserAction(u,c)}var s,f=Object.assign(Object.assign({},t),{applyHoverState:a||!!t.data.url});return r.createElement("div",{className:"px-1 flex-shrink-0 ".concat("tqUFn"," ").concat("play-page"===t.location?"V2RwX":"o7j7p"," ").concat(wg.M.RESOURCE_ITEM_SELECTOR)},(s="d-block no-decoration","link"===t.data.type?r.createElement("a",{href:t.data.url,target:"_blank",className:s,onClick:l},r.createElement(jg,Object.assign({},f))):a?"public"===t.actionBehaviour?r.createElement("div",{className:"".concat(s," cursor-pointer d-inline"),onClick:function(){l(),ig.C$.trigger(t.getAppLink(t.data))}},r.createElement(jg,Object.assign({},f))):r.createElement(ug.F,{appLink:t.getAppLink(t.data),className:s,analyticsData:u,analyticsOptions:c},r.createElement(jg,Object.assign({},f))):t.data.url?r.createElement("a",{href:t.data.url,className:s,onClick:l},r.createElement(jg,Object.assign({},f))):r.createElement("div",{className:s},r.createElement(jg,Object.assign({},f)))))}));var Rg=$b((function(t,e){return r.createElement(Lg,Object.assign({},e))})),Ig=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,n){return e=Tg(e),function(t,e){if(e&&("object"==kg(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Cg()?Reflect.construct(e,n||[],Tg(t).constructor):e.apply(t,n))}(this,e,[t,n]);var o=new Rg(t,{resource:n.resource,imageCdnUrl:n.imageCdnUrl});return r.addChild(o),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xg(t,e)}(e,t),n=e,(r=[{key:"handleClick",value:function(t){t.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}}])&&_g(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function Dg(t){return Dg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dg(t)}function Bg(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ng(r.key),r)}}function Ng(t){var e=function(t){if("object"!=Dg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Dg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Dg(e)?e:e+""}function Mg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Mg=function(){return!!t})()}function Ag(t,e,n,r){var o=Fg(Zg(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Fg(){return Fg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Zg(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Fg.apply(null,arguments)}function Zg(t){return Zg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zg(t)}function Vg(t,e){return Vg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vg(t,e)}var zg=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Zg(e),function(t,e){if(e&&("object"==Dg(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Mg()?Reflect.construct(e,n||[],Zg(t).constructor):e.apply(t,n))}(this,e,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vg(t,e)}(e,t),n=e,(r=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-resources-button-wrapper ".concat(Ag(e,"buildWrapperCSSClass",this,3)([]))}},{key:"buildCSSClass",value:function(){return"cv-resources-button ".concat(Ag(e,"buildCSSClass",this,3)([]))}},{key:"update",value:function(){Ag(e,"update",this,3)([])}},{key:"createItems",value:function(){var t=this,e=[];return e.push(new _(this.player_,{label:"Resources"})),this.options_.resources.forEach((function(n){var r=new Ig(t.player(),{resource:n,imageCdnUrl:t.options_.imageCdnUrl,downloadResource:function(e){return t.downloadResource(e)},label:n.name});e.push(r)})),e}},{key:"downloadResource",value:function(t){"link"!==t.type?this.getDownloadIframe().src=t.url:ig.Ab.PageLoad(t.url,!0)}},{key:"getDownloadIframe",value:function(){return this.downloadIframe||(this.downloadIframe=o.Z.dom.createEl("iframe"),this.downloadIframe.style.display="none",o.Z.dom.appendContent(o.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(){Ag(e,"handleClick",this,3)([null])}}])&&Bg(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuButton"));function Ug(t){return Ug="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ug(t)}function Gg(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qg(r.key),r)}}function qg(t){var e=function(t){if("object"!=Ug(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ug(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ug(e)?e:e+""}function Hg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hg=function(){return!!t})()}function Wg(t){return Wg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wg(t)}function Qg(t,e){return Qg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qg(t,e)}zg.prototype.controlText_="Resources",o.Z.registerComponent("ResourcesButton",zg);var Yg=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Wg(e),function(t,e){if(e&&("object"==Ug(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Hg()?Reflect.construct(e,n||[],Wg(t).constructor):e.apply(t,n))}(this,e,[t,n])).options=n,t.ready((function(){return r.onReady()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qg(t,e)}(e,t),n=e,(r=[{key:"onReady",value:function(){if(this.options.resources.length){var t=this.player.getChild("collapserator");t.addChild("ResourcesButton",{resources:this.options.resources,imageCdnUrl:this.options.imageCdnUrl},t.children_.length-4)}}}])&&Gg(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("resourcesPlugin",Yg);var $g=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n};function Kg(t){var e=t.className,n=void 0===e?"":e,o=t.playerApi,i=t.onReady,a=t.onDispose,u=$g(t,["className","playerApi","onReady","onDispose"]),c=r.useRef();return r.useEffect((function(){if(c){var t=new Nd(c.current,Object.assign(Object.assign({},u),{playerApi:o}));return i&&t.ready((function(){i(function(t){return new Proxy(t,{get:function(t,e,n){if("off"===e||!t.isDisposed())return Reflect.get(t,e,n)}})}(t))})),a&&t.one("dispose",a),function(){null==t||t.dispose()}}}),[t.viewKey]),r.createElement("div",{ref:c,className:n})}},86319:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r={tagList:"Zw6d9",disabled:"jlL1c",partialTag:"too_N",badge:"OjtN8",close:"X9joI"}},58421:()=>{}}]);