cloudinary-video-player 3.6.3-edge.1 → 3.6.4-edge.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.
- package/dist/adaptive-streaming.js +2 -2
- package/dist/adaptive-streaming.min.js +2 -2
- package/dist/chapters.js +2 -2
- package/dist/chapters.min.js +2 -2
- package/dist/cld-video-player.css +2 -2
- package/dist/cld-video-player.js +7 -7
- package/dist/cld-video-player.light.js +7 -7
- package/dist/cld-video-player.light.min.js +4 -4
- package/dist/cld-video-player.min.css +2 -2
- package/dist/cld-video-player.min.js +4 -4
- package/dist/colors.js +2 -2
- package/dist/colors.min.js +2 -2
- package/dist/dash.js +2 -2
- package/dist/dash.min.js +2 -2
- package/dist/debug.js +2 -2
- package/dist/debug.min.js +2 -2
- package/dist/ima.js +2 -2
- package/dist/ima.min.js +2 -2
- package/dist/interaction-areas.js +2 -2
- package/dist/interaction-areas.min.js +2 -2
- package/dist/node_modules_lodash_throttle_js.js +2 -2
- package/dist/playlist.js +2 -2
- package/dist/playlist.min.js +2 -2
- package/dist/recommendations-overlay.js +2 -2
- package/dist/recommendations-overlay.min.js +2 -2
- package/dist/share.js +2 -2
- package/dist/share.min.js +2 -2
- package/dist/shoppable.js +2 -2
- package/dist/shoppable.min.js +2 -2
- package/dist/visual-search.js +2 -2
- package/dist/visual-search.min.js +2 -2
- package/lib/all.js +1 -1
- package/lib/cld-video-player.js +1 -1
- package/lib/player.js +1 -1
- package/lib/videoPlayer.js +1 -1
- package/package.json +1 -1
package/dist/colors.js
CHANGED
package/dist/colors.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cloudinary Video Player v3.6.
|
|
3
|
-
* Built on 2025-12-
|
|
2
|
+
* Cloudinary Video Player v3.6.4-edge.0
|
|
3
|
+
* Built on 2025-12-15T17:25:36.409Z
|
|
4
4
|
* https://github.com/cloudinary/cloudinary-video-player
|
|
5
5
|
*/
|
|
6
6
|
"use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[691],{9454:(o,t,e)=>{e.d(t,{default:()=>l,w:()=>r});var s=e(7764);const c={colorsDark:{base:"#000000",accent:"#0D9AFF",text:"#FFFFFF"},colorsLight:{base:"#FFFFFF",accent:"#0D9AFF",text:"#000000"}},r=o=>(0,s.T4)(o)?c.colorsLight:c.colorsDark,l=function(o){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const e=r(o.options_);t.colors=Object.assign({},e,t.colors);const s=o.el();return t.colors.base&&s.style.setProperty("--color-base",t.colors.base),t.colors.accent&&s.style.setProperty("--color-accent",t.colors.accent),t.colors.text&&s.style.setProperty("--color-text",t.colors.text),{updateColors:o=>{const e=Object.assign({},t.colors,o);e.base&&s.style.setProperty("--color-base",e.base),e.accent&&s.style.setProperty("--color-accent",e.accent),e.text&&s.style.setProperty("--color-text",e.text),t.colors=e},getColors:()=>t.colors}}}}]);
|
package/dist/dash.js
CHANGED
package/dist/dash.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cloudinary Video Player v3.6.
|
|
3
|
-
* Built on 2025-12-
|
|
2
|
+
* Cloudinary Video Player v3.6.4-edge.0
|
|
3
|
+
* Built on 2025-12-15T17:25:36.409Z
|
|
4
4
|
* https://github.com/cloudinary/cloudinary-video-player
|
|
5
5
|
*/
|
|
6
6
|
(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[367],{7509:(e,t,r)=>{var n,a=void 0!==r.g?r.g:"undefined"!=typeof window?window:{},i=r(4626);"undefined"!=typeof document?n=document:(n=a["__GLOBAL_DOCUMENT_CACHE@4"])||(n=a["__GLOBAL_DOCUMENT_CACHE@4"]=i),e.exports=n},5204:(e,t,r)=>{var n;n="undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},e.exports=n},6604:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>N});var n=r(6673),i=r.n(n),o=r(5204),u=r.n(o),l=r(7509),c=r.n(l);var f,d,h,g=(f=function(e,t){var r;window,r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s="./index.js")}({"./externals/base64.js":
|
package/dist/debug.js
CHANGED
package/dist/debug.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cloudinary Video Player v3.6.
|
|
3
|
-
* Built on 2025-12-
|
|
2
|
+
* Cloudinary Video Player v3.6.4-edge.0
|
|
3
|
+
* Built on 2025-12-15T17:25:36.409Z
|
|
4
4
|
* https://github.com/cloudinary/cloudinary-video-player
|
|
5
5
|
*/
|
|
6
6
|
(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[40],{8592:(e,a,i)=>{"use strict";i.d(a,{$n:()=>t,Lp:()=>s,mM:()=>o});const t={fastStart:{capLevelToPlayerSize:!0,ignoreDevicePixelRatio:!0,maxDevicePixelRatio:2,abrEwmaDefaultEstimate:4194304,abrEwmaDefaultEstimateMax:4194304,enableWorker:!1,startLevel:0},balanced:{capLevelToPlayerSize:!0,ignoreDevicePixelRatio:!0,maxDevicePixelRatio:2,abrEwmaDefaultEstimate:4194304,abrEwmaDefaultEstimateMax:4194304,enableWorker:!1},highQuality:{capLevelToPlayerSize:!0,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:2,abrEwmaDefaultEstimate:4194304,abrEwmaDefaultEstimateMax:4194304,enableWorker:!1}},o=Object.keys(t),s=window.matchMedia&&window.matchMedia("(dynamic-range: high)").matches},9017:(e,a,i)=>{"use strict";i.d(a,{F0:()=>r,Fg:()=>s,IT:()=>n,T$:()=>c,Vv:()=>u,Yx:()=>l,be:()=>o,q3:()=>g,sb:()=>t});const t="cld-ia-layout-state",o="vp-ia",s="interaction-areas-container",r={PORTRAIT:"portrait",LANDSCAPE:"landscape",All:"all",CENTER:"center"},n={PULSING:"pulsing",SHADOWED:"shadowed"},l={[r.PORTRAIT]:"https://res.cloudinary.com/prod/raw/upload/v1623772481/video-player/vtts/portrait.vtt",[r.LANDSCAPE]:"https://res.cloudinary.com/prod/raw/upload/v1623772303/video-player/vtts/landscape.vtt",[r.All]:"https://res.cloudinary.com/prod/raw/upload/v1623250266/video-player/vtts/all.vtt",[r.CENTER]:"https://res.cloudinary.com/prod/raw/upload/v1623250265/video-player/vtts/center.vtt"},c="https://res.cloudinary.com/prod/image/upload/v1626764643/video-player/interaction-area-hand.svg",u=4500,g=250},9754:(e,a,i)=>{"use strict";i.r(a),i.d(a,{playerValidators:()=>h,sourceValidators:()=>f});var t=i(608),o=i(9017),s=i(8592),r=i(8552),n=i.n(r),l=i(8446),c=i.n(l),u=i(7531),g=i.n(u),d=i(8953),m=i.n(d),b=i(7571),p=i.n(b),y=i(5779);const v=e=>m()(e)?":(".concat(Object.values(e).join("/"),")"):"",S={isString:e=>({value:p(),message:a=>"'".concat(a,"' should be a string").concat(v(e))}),isNumber:e=>({value:g(),message:a=>"'".concat(a,"' should be a number").concat(v(e))}),isBoolean:()=>({value:n(),message:e=>"'".concat(e,"' should be a boolean")}),isFunction:()=>({value:c(),message:e=>"'".concat(e,"' should be a function")}),isPlainObject:()=>({value:m(),message:e=>"'".concat(e,"' should be an object")}),isObject:()=>({value:e=>e&&"object"==typeof e,message:e=>"'".concat(e,"' should be an object")}),isArray:()=>({value:Array.isArray,message:e=>"'".concat(e,"' should be an array")}),isArrayOfNumbers:()=>({value:e=>Array.isArray(e)&&e.every(g()),message:e=>"'".concat(e,"' should be an array of numbers")}),isArrayOfStrings:()=>({value:e=>Array.isArray(e)&&e.every(p()),message:e=>"'".concat(e,"' should be an array of strings")}),isArrayOfObjects:e=>({value:a=>a.every(a=>{for(let i in a)if(Object.prototype.hasOwnProperty.call(a,i)){const t=a[i],o=e[i];if(!(o&&(0,y.QF)(o(t),t,i)))return!1}return!0}),message:()=>"invalid array"}),or:function(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];return()=>({value:e=>a.some(a=>(0,y.O6)(a).value(e)),message:e=>a.map(a=>(0,y.O6)(a).message(e)).join(" or ")})}},h={videojsOptions:{loop:S.isBoolean,controls:S.isBoolean,autoplay:S.isBoolean,autoplayMode:S.isString(t.HJ),bigPlayButton:S.isBoolean,playbackRates:S.isArray,showLogo:S.isBoolean,logoImageUrl:S.isString,logoOnclickUrl:S.isString,videoJS:S.isPlainObject,maxTries:S.isNumber,muted:S.isBoolean,playsinline:S.isBoolean,videoTimeout:S.isNumber,preload:S.isString,sourceTransformation:S.isPlainObject,allowUsageReport:S.isBoolean,interactionAreas:{theme:{template:S.isString(o.IT)},layout:{enable:S.isBoolean,showAgain:S.isBoolean}}},playerOptions:{debug:S.isBoolean,queryParams:S.isPlainObject,publicId:S.isString,fluid:S.isBoolean,withCredentials:S.isBoolean,analytics:S.isBoolean,cloudinaryAnalytics:S.or(S.isBoolean,S.isPlainObject),hideContextMenu:S.isBoolean,playedEventPercents:S.isArrayOfNumbers,showJumpControls:S.isBoolean,chaptersButton:S.isBoolean,pictureInPictureToggle:S.isBoolean,seekThumbnails:S.isBoolean,aiHighlightsGraph:S.isBoolean,floatingWhenNotVisible:S.isString(t.rT),playedEventTimes:S.isArray,playlistWidget:{direction:S.isString,total:S.isNumber},colors:{base:S.isString,accent:S.isString,text:S.isString},ads:{adTagUrl:S.isString,showCountdown:S.isBoolean,adLabel:S.isString,locale:S.isString,prerollTimeout:S.isNumber,postrollTimeout:S.isNumber,adsInPlaylist:S.isString(t.KE)},cloudinary:{autoShowRecommendations:S.isBoolean,sourceTypes:S.isArrayOfStrings,transformation:S.isObject,fontFace:S.isString,posterOptions:{publicId:S.isString,transformation:S.isObject}}}},f={raw_transformation:S.isString,resourceType:S.isString,shoppable:S.isPlainObject,chapters:S.or(S.isBoolean,S.isPlainObject),visualSearch:S.or(S.isBoolean),download:S.isBoolean,title:S.or(S.isString,S.isBoolean),description:S.or(S.isString,S.isBoolean),interactionAreas:{enable:S.isBoolean,template:S.or(S.isString(o.F0),S.isArray),vttUrl:S.isString,onClick:S.isFunction},textTracks:{options:{theme:S.isString,fontFace:S.isString,fontSize:S.isString,gravity:S.isString,box:S.isPlainObject,style:S.isPlainObject,wordHighlightStyle:S.isPlainObject},captions:{label:S.isString,language:S.isString,default:S.isBoolean,url:S.isString,maxWords:S.isNumber,wordHighlight:S.isBoolean,timeOffset:S.isNumber},subtitles:S.isArrayOfObjects({label:S.isString,language:S.isString,default:S.isBoolean,url:S.isString,maxWords:S.isNumber,wordHighlight:S.isBoolean,timeOffset:S.isNumber})},info:{title:S.isString,subtitle:S.isString,description:S.isString},cloudinary:{sourceTypes:S.isArrayOfStrings,transformation:S.isObject},adaptiveStreaming:{strategy:S.isString(s.mM)},videoSources:S.isArray}},8552:(e,a,i)=>{var t=i(7148),o=i(2934);e.exports=function(e){return!0===e||!1===e||o(e)&&"[object Boolean]"==t(e)}},7531:(e,a,i)=>{var t=i(7148),o=i(2934);e.exports=function(e){return"number"==typeof e||o(e)&&"[object Number]"==t(e)}}}]);
|
package/dist/ima.js
CHANGED
package/dist/ima.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cloudinary Video Player v3.6.
|
|
3
|
-
* Built on 2025-12-
|
|
2
|
+
* Cloudinary Video Player v3.6.4-edge.0
|
|
3
|
+
* Built on 2025-12-15T17:25:36.409Z
|
|
4
4
|
* https://github.com/cloudinary/cloudinary-video-player
|
|
5
5
|
*/
|
|
6
6
|
(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[330],{2650:(t,e,n)=>{"use strict";var i=n(6673),r=n.n(i),o=n(5204),s=n.n(o),a=n(7509),d=n.n(a),l="7.5.2";var A=function(t,e){e.isImmediatePropagationStopped=function(){return!0},e.cancelBubble=!0,e.isPropagationStopped=function(){return!0}},h=function(t,e,n){A(0,n),t.trigger({type:e+n.type,originalEvent:n})};function u(t){"playing"===t.type?function(t,e){t.ads.isInAdMode()&&(t.ads.isContentResuming()?t.ads._contentEnding&&h(t,"content",e):h(t,"ad",e))}(this,t):"ended"===t.type?function(t,e){t.ads.isInAdMode()?t.ads.isContentResuming()?(A(0,e),t.trigger("resumeended")):h(t,"ad",e):t.ads._contentHasEnded||t.ads.stitchedAds()||(h(t,"content",e),t.trigger("readyforpostroll"))}(this,t):"loadstart"===t.type||"loadeddata"===t.type||"loadedmetadata"===t.type?function(t,e){if(!("loadstart"===e.type&&!t.ads._hasThereBeenALoadStartDuringPlayerLife||"loadeddata"===e.type&&!t.ads._hasThereBeenALoadedData||"loadedmetadata"===e.type&&!t.ads._hasThereBeenALoadedMetaData))if(t.ads.inAdBreak())h(t,"ad",e);else{if(t.currentSrc()!==t.ads.contentSrc)return;h(t,"content",e)}}(this,t):"play"===t.type?function(t,e){t.ads.inAdBreak()?h(t,"ad",e):t.ads.isContentResuming()&&h(t,"content",e)}(this,t):this.ads.isInAdMode()&&(this.ads.isContentResuming()?h(this,"content",t):h(this,"ad",t))}function c(){return c=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},c.apply(this,arguments)}function p(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,g(t,e)}function g(t,e){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},g(t,e)}var y={},m=function(){!function(){if(r().dom.isInFrame()&&"function"!=typeof s().__tcfapi){for(var t,e=s(),n={};e;){try{if(e.frames.__tcfapiLocator){t=e;break}}catch(t){}if(e===s().top)break;e=e.parent}if(!t)return;s().__tcfapi=function(e,i,r,o){var s=Math.random()+"",a={__tcfapiCall:{command:e,parameter:o,version:i,callId:s}};n[s]=r,t.postMessage(a,"*")},s().addEventListener("message",function(t){var e={};try{e="string"==typeof t.data?JSON.parse(t.data):t.data}catch(t){}var i=e.__tcfapiReturn;i&&"function"==typeof n[i.callId]&&(n[i.callId](i.returnValue,i.success),n[i.callId]=null)},!1)}}(),"function"==typeof s().__tcfapi&&s().__tcfapi("addEventListener",2,function(t,e){e&&(y=t)})},f="",v=function(t,e){if(void 0===e&&(e=s()),e.__uspapi)e.__uspapi("getUSPData",1,function(e,n){var i=n?e.uspString:null;f=i,t(i)});else{var n=function(t){for(var e=t.parent;e!==t.top;){try{if(e.frames&&e.frames.__uspapiLocator)return e}catch(t){}e=e.parent}try{if(t.top.frames&&t.top.frames.__uspapiLocator)return t.top}catch(t){}return null}(e);if(!n)return void t(null);var i=Math.random().toString(36).substring(2),r={__uspapiCall:{command:"getUSPData",version:1,callId:i}};e.addEventListener("message",function n(r){if(r&&r.data&&r.data.__uspapiReturn&&r.data.__uspapiReturn.callId===i){e.removeEventListener("message",n,!1);var o=r.data.__uspapiReturn,s=o.returnValue,a=o.success?s.uspString:null;f=a,t(a)}},!1),n.postMessage(r,"*")}},P={AdsBeforePrerollError:"ads-before-preroll-error",AdsPrerollError:"ads-preroll-error",AdsMidrollError:"ads-midroll-error",AdsPostrollError:"ads-postroll-error",AdsMacroReplacementFailed:"ads-macro-replacement-failed",AdsResumeContentFailed:"ads-resume-content-failed"},C=function(t,e){return e?encodeURIComponent(t):t},S=function(t,e){var n={};return["description","tags","reference_id","ad_keys"].forEach(function(i){t&&t[i]?n["{mediainfo."+i+"}"]=t[i]:e["{mediainfo."+i+"}"]?n["{mediainfo."+i+"}"]=e["{mediainfo."+i+"}"]:n["{mediainfo."+i+"}"]=""}),["custom_fields","customFields"].forEach(function(e){!function(t,e,n){if(t&&t[n])for(var i=t[n],r=Object.keys(i),o=0;o<r.length;o++)e["{mediainfo."+n+"."+r[o]+"}"]=i[r[o]]}(t,n,e)}),n},b=function(t,e,n,i,o){for(var s in void 0===i&&(i={}),e){var a=i.hasOwnProperty(s)?i[s]:s;if(a.startsWith("r:"))try{var d=new RegExp(a.slice(2),"g");t=t.replace(d,C(e[s],n))}catch(t){o.ads.error({errorType:P.AdsMacroReplacementFailed,macro:s,error:t}),r().log.warn('Unable to replace macro with regex "'+a+'". The provided regex may be invalid.')}else t=t.split(a).join(C(e[s],n))}return t};function k(t,e,n){void 0===e&&(e=!1),void 0===n&&(n={});var i=n.disableDefaultMacros||!1,o=n.macroNameOverrides||{};delete n.disableDefaultMacros,delete n.macroNameOverrides;var a=n;if(i)return b(t,a,e,o);var l,A,h,u=function(t){var e={},n=t.replace(/{([^}=]+)=([^}]*)}/g,function(t,n,i){return e["{"+n+"}"]=i,"{"+n+"}"});return{defaults:e,modifiedString:n}}(t),p=u.defaults,g=u.modifiedString;for(var m in t=g,c(a,{"{player.id}":(h=this).options_["data-player"]||h.id_,"{player.height}":h.currentHeight(),"{player.width}":h.currentWidth(),"{player.heightInt}":Math.round(h.currentHeight()),"{player.widthInt}":Math.round(h.currentWidth()),"{player.autoplay}":h.autoplay()?1:0,"{player.muted}":h.muted()?1:0,"{player.language}":h.language()||"","{mediainfo.id}":h.mediainfo?h.mediainfo.id:"","{mediainfo.name}":h.mediainfo?h.mediainfo.name:"","{mediainfo.duration}":h.mediainfo?h.mediainfo.duration:"","{player.duration}":h.duration(),"{player.durationInt}":Math.round(h.duration()),"{player.live}":h.duration()===1/0?1:0,"{player.pageUrl}":r().dom.isInFrame()?d().referrer:s().location.href,"{playlistinfo.id}":h.playlistinfo?h.playlistinfo.id:"","{playlistinfo.name}":h.playlistinfo?h.playlistinfo.name:"","{timestamp}":(new Date).getTime(),"{document.referrer}":d().referrer,"{window.location.href}":s().location.href,"{random}":Math.floor(1e12*Math.random())},S(this.mediainfo,p),(l=y,A={},Object.keys(l).forEach(function(t){A["{tcf."+t+"}"]=l[t]}),A["{tcf.gdprAppliesInt}"]=l.gdprApplies?1:0,A),{"{usp.uspString}":f},function(t,e,n){var i=new RegExp("{pageVariable\\.([^}]+)}","g"),o={},a=(t.match(i)||[]).concat(Object.keys(n).filter(function(e){return i.test(e)&&t.includes(n[e])}));if(a)return a.forEach(function(t){for(var n,i=t,a=t.slice(14,-1),d=a.split("."),l=s(),A=0;A<d.length;A++)if(A===d.length-1)n=l[d[A]];else if(void 0===(l=l[d[A]]))break;var h=typeof n;null===n?o[i]="null":void 0===n?e[i]?o[i]=e[i]:(r().log.warn('Page variable "'+a+'" not found'),o[i]=""):"string"!==h&&"number"!==h&&"boolean"!==h?(r().log.warn('Page variable "'+a+'" is not a supported type'),o[i]=""):o[i]=n}),o}(t,p,o)),t=b(t,a,e,o,this),p)t=t.replace(m,p[m]);return t}var E={processMetadataTracks:function(t,e){for(var n=t.textTracks(),i=function(n){"metadata"===n.kind&&(t.ads.cueTextTracks.setMetadataTrackMode(n),e(t,n))},r=0;r<n.length;r++)i(n[r]);n.addEventListener("addtrack",function(t){i(t.track)})},setMetadataTrackMode:function(t){},getSupportedAdCue:function(t,e){return e},isSupportedAdCue:function(t,e){return!0},getCueId:function(t,e){return e.id}},M=function(t,e){return void 0!==e&&t.ads.includedCues[e]},L=function(t,e){void 0!==e&&""!==e&&(t.ads.includedCues[e]=!0)};function T(){!1!==this.ads._shouldBlockPlay&&(this.paused()||(this.ads.debug("Playback was canceled by cancelContentPlay"),this.pause()),this.ads._cancelledPlay=!0)}E.processAdTrack=function(t,e,n,i){t.ads.includedCues={};for(var o=0;o<e.length;o++){var s=e[o],a=this.getSupportedAdCue(t,s);if(!this.isSupportedAdCue(t,s))return void r().log.warn("Skipping as this is not a supported ad cue.",s);var d=this.getCueId(t,s),l=s.startTime;if(M(t,d))return void r().log("Skipping ad already seen with ID "+d);i&&i(t,a,d,l),n(t,a,d,l),L(t,d)}};var w={},R=r();w.isMiddlewareMediatorSupported=function(){return!R.browser.IS_IOS&&!R.browser.IS_ANDROID&&!!(R.use&&R.middleware&&R.middleware.TERMINATOR)},w.playMiddleware=function(t){return{setSource:function(t,e){e(null,t)},callPlay:function(){if(t.ads&&!0===t.ads._shouldBlockPlay)return t.ads.debug("Using playMiddleware to block content playback"),t.ads._playBlocked=!0,R.middleware.TERMINATOR},play:function(e,n){t.ads&&t.ads._playBlocked&&e?(t.ads.debug("Play call to Tech was terminated."),t.trigger("play"),t.addClass("vjs-has-started"),t.ads._playBlocked=!1):n&&n.catch&&n.catch(function(e){"NotAllowedError"!==e.name||r().browser.IS_SAFARI||t.trigger("pause")})}}},w.testHook=function(t){R=t};var D=w.playMiddleware,B=w.isMiddlewareMediatorSupported;var I={src:"data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAAxJtZGF03ABMYXZjNjEuMy4xMDAAQiAIwRg4AAACrgYF//+q3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE2NCByMzEwOCAzMWUxOWY5IC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAyMyAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MzoweDExMyBtZT1oZXggc3VibWU9NyBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0xIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MSA4eDhkY3Q9MSBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0tMiB0aHJlYWRzPTcgbG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0zIGJfcHlyYW1pZD0yIGJfYWRhcHQ9MSBiX2JpYXM9MCBkaXJlY3Q9MSB3ZWlnaHRiPTEgb3Blbl9nb3A9MCB3ZWlnaHRwPTIga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAAn//71sXwKaunqigzoMi7hlyTJrrYi4m0AwABFxzcqWKGahTaoBcQAAMWK4AlcFlIICBeldSEQBGCMHAAABVNtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAAIgABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAACQXRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAIgAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAABQAAAAPAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAACIAAAAAAAEAAAAAAbltZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAADwAAAACAFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAFkbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABJHN0YmwAAADAc3RzZAAAAAAAAAABAAAAsGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAABQADwAEgAAABIAAAAAAAAAAEUTGF2YzYxLjMuMTAwIGxpYngyNjQAAAAAAAAAAAAAAAAY//8AAAA2YXZjQwFkAA3/4QAZZ2QADazZQUH7ARAAAAMAEAAAAwPA8UKZYAEABmjr48siwP34+AAAAAAQcGFzcAAAAAEAAAABAAAAFGJ0cnQAAAAAAALAEAACwBAAAAAYc3R0cwAAAAAAAAABAAAAAQAAAgAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAC7wAAAAEAAAAUc3RjbwAAAAAAAAABAAAARQAAAj10cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAAABgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAAXAAAEAAABAAAAAAG1bWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAACsRAAACABVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABYG1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABJHN0YmwAAAB+c3RzZAAAAAAAAAABAAAAbm1wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAACsRAAAAAAANmVzZHMAAAAAA4CAgCUAAgAEgICAF0AVAAAAAAH0AAAAEisFgICABRIQVuUABoCAgAECAAAAFGJ0cnQAAAAAAAH0AAAAEisAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAAVAAAABgAAABhzdGNvAAAAAAAAAAIAAAAwAAADNAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAACAAAAAQAAAGF1ZHRhAAAAWW1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALGlsc3QAAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjEuMS4xMDA=",type:"video/mp4"},j=function(){function t(){}return t.getState=function(e){if(e)return t.states_&&t.states_[e]?t.states_[e]:void 0},t.registerState=function(e,n){if("string"!=typeof e||!e)throw new Error('Illegal state name, "'+e+'"; must be a non-empty string.');return t.states_||(t.states_={}),t.states_[e]=n,n},t}(),_=function(){function t(t){this.player=t}t._getName=function(){return"Anonymous State"};var e=t.prototype;return e.transitionTo=function(t){var e=this.player;this.cleanup(e);var n=new t(e);e.ads._state=n,e.ads.debug(this.constructor._getName()+" -> "+n.constructor._getName());for(var i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];n.init.apply(n,[e].concat(r))},e.init=function(){},e.cleanup=function(){},e.onPlay=function(){},e.onPlaying=function(){},e.onEnded=function(){},e.onAdEnded=function(){},e.onAdsReady=function(){r().log.warn("Unexpected adsready event")},e.onAdsError=function(){},e.onAdsCanceled=function(){},e.onAdTimeout=function(){},e.onAdStarted=function(){},e.onAdSkipped=function(){},e.onContentChanged=function(){},e.onContentResumed=function(){},e.onReadyForPostroll=function(){r().log.warn("Unexpected readyforpostroll event")},e.onNoPreroll=function(){},e.onNoPostroll=function(){},e.startLinearAdMode=function(){r().log.warn("Unexpected startLinearAdMode invocation (State via "+this.constructor._getName()+")")},e.endLinearAdMode=function(){r().log.warn("Unexpected endLinearAdMode invocation (State via "+this.constructor._getName()+")")},e.skipLinearAdMode=function(){r().log.warn("Unexpected skipLinearAdMode invocation (State via "+this.constructor._getName()+")")},e.isAdState=function(){throw new Error("isAdState unimplemented for "+this.constructor._getName())},e.isWaitingForAdBreak=function(){return!1},e.isContentResuming=function(){return!1},e.inAdBreak=function(){return!1},e.handleEvent=function(t){var e=this.player;"play"===t?this.onPlay(e):"adsready"===t?this.onAdsReady(e):"adserror"===t?this.onAdsError(e):"adscanceled"===t?this.onAdsCanceled(e):"adtimeout"===t?this.onAdTimeout(e):"ads-ad-started"===t?this.onAdStarted(e):"ads-ad-skipped"===t?this.onAdSkipped(e):"contentchanged"===t?this.onContentChanged(e):"contentresumed"===t?this.onContentResumed(e):"readyforpostroll"===t?this.onReadyForPostroll(e):"playing"===t?this.onPlaying(e):"ended"===t?this.onEnded(e):"nopreroll"===t?this.onNoPreroll(e):"nopostroll"===t?this.onNoPostroll(e):"adended"===t&&this.onAdEnded(e)},t}();j.registerState("State",_);var W=function(t){function e(e){var n;return(n=t.call(this,e)||this).contentResuming=!1,n.waitingForAdBreak=!1,n}p(e,t);var n=e.prototype;return n.isAdState=function(){return!0},n.onPlaying=function(){var t=j.getState("ContentPlayback");this.contentResuming&&this.transitionTo(t)},n.onContentResumed=function(){var t=j.getState("ContentPlayback");this.contentResuming&&this.transitionTo(t)},n.isWaitingForAdBreak=function(){return this.waitingForAdBreak},n.isContentResuming=function(){return this.contentResuming},n.inAdBreak=function(){return!0===this.player.ads._inLinearAdMode},e}(_);j.registerState("AdState",W);var N=function(t){function e(){return t.apply(this,arguments)||this}p(e,t);var n=e.prototype;return n.isAdState=function(){return!1},n.onContentChanged=function(t){var e=j.getState("BeforePreroll"),n=j.getState("Preroll");t.ads.debug("Received contentchanged event (ContentState)"),t.paused()?this.transitionTo(e):(this.transitionTo(n,!1),t.pause(),t.ads._pausedOnContentupdate=!0)},e}(_);j.registerState("ContentState",N);var F,O=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"AdsDone"};var n=e.prototype;return n.init=function(t){t.ads._contentHasEnded=!0,t.trigger("ended")},n.startLinearAdMode=function(){r().log.warn("Unexpected startLinearAdMode invocation (AdsDone)")},e}(j.getState("ContentState"));j.registerState("AdsDone",O);var U={start:function(t){t.ads.debug("Starting ad break"),t.ads._inLinearAdMode=!0,t.trigger("adstart"),t.ads.shouldTakeSnapshots()&&(t.ads.snapshot=function(t){var e;e=r().browser.IS_IOS&&t.ads.isLive(t)&&t.seekable().length>0?t.currentTime()-t.seekable().end(0):t.currentTime();var n=t.$(".vjs-tech"),i=t.textTracks?t.textTracks():[],o=[],s={ended:t.ended(),currentSrc:t.currentSrc(),sources:t.currentSources(),src:t.tech_.src(),currentTime:e,type:t.currentType()};n&&(s.style=n.getAttribute("style"));for(var a=0;a<i.length;a++){var d=i[a];o.push({track:d,mode:d.mode}),d.mode="disabled"}return s.suppressedTracks=o,s}(t)),t.ads.shouldPlayContentBehindAd(t)&&!t.ads.settings.stitchedAds&&(t.ads.preAdVolume_=t.volume(),t.volume(0)),t.addClass("vjs-ad-playing"),t.hasClass("vjs-live")&&t.removeClass("vjs-live"),t.ads.removeNativePoster(),t.ads.preAdPlaybackRate_=t.playbackRate(),t.playbackRate(1),t.controlBar&&t.controlBar.playbackRateMenuButton&&t.controlBar.playbackRateMenuButton.playbackRateSupported&&!t.controlBar.playbackRateMenuButton.hasClass("vjs-hidden")?(t.controlBar.playbackRateMenuButton.hide(),t.ads.showPlaybackMenuOnAdEnd_=!0):t.ads.showPlaybackMenuOnAdEnd_=!1},end:function(t,e){t.ads.debug("Ending ad break"),void 0===e&&(e=function(){}),t.ads.adType=null,t.ads._inLinearAdMode=!1,t.trigger("adend"),t.removeClass("vjs-ad-playing"),t.ads.isLive(t)&&t.addClass("vjs-live"),t.ads.shouldTakeSnapshots()?function(t,e){var n=t.ads.snapshot;if(void 0===e&&(e=function(){}),!0===t.ads.disableNextSnapshotRestore)return t.ads.disableNextSnapshotRestore=!1,delete t.ads.snapshot,void e();var i,o=t.$(".vjs-tech"),s=20,a=n.suppressedTracks,d=function(){for(var t=0;t<a.length;t++)(i=a[t]).track.mode=i.mode},l=function(){var e;if(r().browser.IS_IOS&&t.ads.isLive(t)){if(n.currentTime<0&&(e=t.seekable().length>0?t.seekable().end(0)+n.currentTime:t.currentTime(),t.currentTime(e)),t.paused()){var i=t.play();i&&i.catch&&i.catch(function(t){r().log.warn("Play promise rejected in IOS snapshot resume",t)})}}else if(n.ended)t.currentTime(t.duration());else{t.currentTime(n.currentTime);var o=t.play();o&&o.catch&&o.catch(function(t){r().log.warn("Play promise rejected in snapshot resume",t)})}t.ads.shouldRemoveAutoplay_&&(t.autoplay(!1),t.ads.shouldRemoveAutoplay_=!1)},A=function e(){if(t.off("contentcanplay",e),F&&t.clearTimeout(F),(o=t.el().querySelector(".vjs-tech")).readyState>1)return l();if(void 0===o.seekable)return l();if(o.seekable.length>0)return l();if(s--)t.setTimeout(e,50);else try{l()}catch(e){t.ads.error({errorType:P.AdsResumeContentFailed,error:e}),r().log.warn("Failed to resume the content after an advertisement",e)}};if("style"in n&&o.setAttribute("style",n.style||""),t.ads.videoElementRecycled())t.one("resumeended",function(){delete t.ads.snapshot,e()}),t.one("contentloadedmetadata",d),r().browser.IS_IOS&&!t.autoplay()&&"function"==typeof t.techCall_&&(t.techCall_("setAutoplay",!0),t.ads.shouldRemoveAutoplay_=!0),t.src(n.sources),t.one("contentcanplay",A),F=t.setTimeout(A,2e3);else{if(d(),!t.ended()){var h=t.play();h&&h.catch&&h.catch(function(t){r().log.warn("Play promise rejected in snapshot restore",t)})}delete t.ads.snapshot,e()}}(t,e):(t.ads.preAdVolume_&&t.volume(t.ads.preAdVolume_),e()),t.playbackRate(t.ads.preAdPlaybackRate_),t.ads.showPlaybackMenuOnAdEnd_&&t.controlBar.playbackRateMenuButton.show()}},V=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"Preroll"};var n=e.prototype;return n.init=function(t,e,n){if(this.waitingForAdBreak=!0,t.addClass("vjs-ad-loading"),n||t.ads.nopreroll_)return this.resumeAfterNoPreroll(t);var i=t.ads.settings.timeout;"number"==typeof t.ads.settings.prerollTimeout&&(i=t.ads.settings.prerollTimeout),this._timeout=t.setTimeout(function(){t.trigger("adtimeout")},i),e?this.handleAdsReady():this.adsReady=!1},n.onAdsReady=function(t){t.ads.inAdBreak()?r().log.warn("Unexpected adsready event (Preroll)"):(t.ads.debug("Received adsready event (Preroll)"),this.handleAdsReady())},n.handleAdsReady=function(){this.adsReady=!0,this.readyForPreroll()},n.afterLoadStart=function(t){var e=this.player;e.ads._hasThereBeenALoadStartDuringPlayerLife?t():(e.ads.debug("Waiting for loadstart..."),e.one("loadstart",function(){e.ads.debug("Received loadstart event"),t()}))},n.noPreroll=function(){var t=this;this.afterLoadStart(function(){t.player.ads.debug("Skipping prerolls due to nopreroll event (Preroll)"),t.resumeAfterNoPreroll(t.player)})},n.readyForPreroll=function(){var t=this.player;this.afterLoadStart(function(){t.ads.debug("Triggered readyforpreroll event (Preroll)"),t.trigger("readyforpreroll")})},n.onAdsCanceled=function(t){var e=this;t.ads.debug("adscanceled (Preroll)"),this.afterLoadStart(function(){e.resumeAfterNoPreroll(t)})},n.onAdsError=function(t){var e=this;r().log("adserror (Preroll)"),t.ads.error({errorType:P.AdsPrerollError}),this.inAdBreak()?t.ads.endLinearAdMode():this.afterLoadStart(function(){e.resumeAfterNoPreroll(t)})},n.startLinearAdMode=function(){var t=this.player;!this.adsReady||t.ads.inAdBreak()||this.isContentResuming()?r().log.warn("Unexpected startLinearAdMode invocation (Preroll)"):(this.clearTimeout(t),t.ads.adType="preroll",this.waitingForAdBreak=!1,U.start(t),t.ads._shouldBlockPlay=!1)},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var t=this.player;this.inAdBreak()&&(t.removeClass("vjs-ad-loading"),t.addClass("vjs-ad-content-resuming"),this.contentResuming=!0,U.end(t))},n.skipLinearAdMode=function(){var t=this,e=this.player;e.ads.inAdBreak()||this.isContentResuming()?r().log.warn("Unexpected skipLinearAdMode invocation"):this.afterLoadStart(function(){e.trigger("adskip"),e.ads.debug("skipLinearAdMode (Preroll)"),t.resumeAfterNoPreroll(e)})},n.onAdTimeout=function(t){var e=this;this.afterLoadStart(function(){t.ads.debug("adtimeout (Preroll)"),e.resumeAfterNoPreroll(t)})},n.onNoPreroll=function(t){t.ads.inAdBreak()||this.isContentResuming()?r().log.warn("Unexpected nopreroll event (Preroll)"):this.noPreroll()},n.resumeAfterNoPreroll=function(t){if(this.contentResuming=!0,t.ads._shouldBlockPlay=!1,this.cleanupPartial(t),t.ads._playRequested||t.ads._pausedOnContentupdate)if(t.paused()){t.ads.debug("resumeAfterNoPreroll: attempting to resume playback (Preroll)");var e=t.play();e&&e.then&&e.then(null,function(t){})}else t.ads.debug("resumeAfterNoPreroll: already playing (Preroll)"),t.trigger("play"),t.trigger("playing")},n.cleanup=function(t){t.ads._hasThereBeenALoadStartDuringPlayerLife||r().log.warn("Leaving Preroll state before loadstart event can cause issues."),this.cleanupPartial(t)},n.cleanupPartial=function(t){t.removeClass("vjs-ad-loading"),t.removeClass("vjs-ad-content-resuming"),this.clearTimeout(t)},n.clearTimeout=function(t){t.clearTimeout(this._timeout),this._timeout=null},e}(j.getState("AdState"));j.registerState("Preroll",V);var H=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"BeforePreroll"};var n=e.prototype;return n.init=function(t){this.adsReady=!1,this.shouldResumeToContent=!1,t.ads._shouldBlockPlay=!t.ads.settings.allowVjsAutoplay||!t.autoplay()},n.onAdsReady=function(t){t.ads.debug("Received adsready event (BeforePreroll)"),this.adsReady=!0},n.onPlay=function(t){var e=j.getState("Preroll");t.ads.debug("Received play event (BeforePreroll)"),this.transitionTo(e,this.adsReady,this.shouldResumeToContent)},n.onAdsCanceled=function(t){t.ads.debug("adscanceled (BeforePreroll)"),this.shouldResumeToContent=!0},n.onAdsError=function(){this.player.ads.debug("adserror (BeforePreroll)"),this.player.ads.error({errorType:P.AdsBeforePrerollError}),this.shouldResumeToContent=!0},n.onNoPreroll=function(){this.player.ads.debug("Skipping prerolls due to nopreroll event (BeforePreroll)"),this.shouldResumeToContent=!0},n.skipLinearAdMode=function(){var t=this.player;t.trigger("adskip"),t.ads.debug("skipLinearAdMode (BeforePreroll)"),this.shouldResumeToContent=!0},n.onContentChanged=function(){this.init(this.player)},e}(j.getState("ContentState"));j.registerState("BeforePreroll",H);var x=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"Midroll"};var n=e.prototype;return n.init=function(t){t.ads.adType="midroll",U.start(t),t.addClass("vjs-ad-loading")},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var t=this.player;this.inAdBreak()&&(this.contentResuming=!0,t.addClass("vjs-ad-content-resuming"),t.removeClass("vjs-ad-loading"),U.end(t))},n.onAdsError=function(t){t.ads.error({errorType:P.AdsMidrollError}),this.inAdBreak()&&t.ads.endLinearAdMode()},n.cleanup=function(t){t.removeClass("vjs-ad-loading"),t.removeClass("vjs-ad-content-resuming")},e}(j.getState("AdState"));j.registerState("Midroll",x);var Z=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"Postroll"};var n=e.prototype;return n.init=function(t){if(this.waitingForAdBreak=!0,t.ads._contentEnding=!0,t.ads.nopostroll_){this.resumeContent(t);var e=j.getState("AdsDone");this.transitionTo(e)}else{t.addClass("vjs-ad-loading");var n=t.ads.settings.timeout;"number"==typeof t.ads.settings.postrollTimeout&&(n=t.ads.settings.postrollTimeout),this._postrollTimeout=t.setTimeout(function(){t.trigger("adtimeout")},n)}},n.startLinearAdMode=function(){var t=this.player;t.ads.inAdBreak()||this.isContentResuming()?r().log.warn("Unexpected startLinearAdMode invocation (Postroll)"):(t.ads.adType="postroll",t.clearTimeout(this._postrollTimeout),this.waitingForAdBreak=!1,U.start(t))},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.endLinearAdMode=function(){var t=this,e=this.player,n=j.getState("AdsDone");this.inAdBreak()&&(e.removeClass("vjs-ad-loading"),this.resumeContent(e),U.end(e,function(){t.transitionTo(n)}))},n.skipLinearAdMode=function(){var t=this.player;t.ads.inAdBreak()||this.isContentResuming()?r().log.warn("Unexpected skipLinearAdMode invocation"):(t.ads.debug("Postroll abort (skipLinearAdMode)"),t.trigger("adskip"),this.abort(t))},n.onAdTimeout=function(t){t.ads.debug("Postroll abort (adtimeout)"),this.abort(t)},n.onAdsError=function(t){t.ads.debug("Postroll abort (adserror)"),t.ads.error({errorType:P.AdsPostrollError}),t.ads.inAdBreak()?t.ads.endLinearAdMode():this.abort(t)},n.onContentChanged=function(t){if(this.isContentResuming()){var e=j.getState("BeforePreroll");this.transitionTo(e)}else if(!this.inAdBreak()){var n=j.getState("Preroll");this.transitionTo(n)}},n.onNoPostroll=function(t){this.isContentResuming()||this.inAdBreak()?r().log.warn("Unexpected nopostroll event (Postroll)"):this.abort(t)},n.resumeContent=function(t){this.contentResuming=!0,t.addClass("vjs-ad-content-resuming")},n.abort=function(t){var e=j.getState("AdsDone");this.resumeContent(t),t.removeClass("vjs-ad-loading"),this.transitionTo(e)},n.cleanup=function(t){t.removeClass("vjs-ad-content-resuming"),t.clearTimeout(this._postrollTimeout),t.ads._contentEnding=!1},e}(j.getState("AdState"));j.registerState("Postroll",Z);var G=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"ContentPlayback"};var n=e.prototype;return n.init=function(t){t.ads._shouldBlockPlay=!1},n.onAdsReady=function(t){t.ads.debug("Received adsready event (ContentPlayback)"),t.ads.nopreroll_||(t.ads.debug("Triggered readyforpreroll event (ContentPlayback)"),t.trigger("readyforpreroll"))},n.onReadyForPostroll=function(t){var e=j.getState("Postroll");t.ads.debug("Received readyforpostroll event"),this.transitionTo(e)},n.startLinearAdMode=function(){var t=j.getState("Midroll");this.transitionTo(t)},e}(j.getState("ContentState"));j.registerState("ContentPlayback",G);var z=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"StitchedContentPlayback"};var n=e.prototype;return n.init=function(){this.player.ads._shouldBlockPlay=!1},n.onContentChanged=function(){this.player.ads.debug("Received contentchanged event ("+this.constructor._getName()+")")},n.startLinearAdMode=function(){var t=j.getState("StitchedAdRoll");this.transitionTo(t)},e}(j.getState("ContentState"));j.registerState("StitchedContentPlayback",z);var Y=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"StitchedAdRoll"};var n=e.prototype;return n.init=function(){this.waitingForAdBreak=!1,this.contentResuming=!1,this.player.ads.adType="stitched",U.start(this.player)},n.onPlaying=function(){},n.onContentResumed=function(){},n.onAdEnded=function(){this.endLinearAdMode(),this.player.trigger("ended")},n.endLinearAdMode=function(){var t=j.getState("StitchedContentPlayback");U.end(this.player),this.transitionTo(t)},e}(j.getState("AdState"));j.registerState("StitchedAdRoll",Y);var Q=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"OutstreamPending"};var n=e.prototype;return n.init=function(t){this.adsReady=!1},n.onPlay=function(t){var e=j.getState("OutstreamPlayback");t.ads.debug("Received play event (OutstreamPending)"),this.transitionTo(e,this.adsReady)},n.onAdsReady=function(t){t.ads.debug("Received adsready event (OutstreamPending)"),this.adsReady=!0},n.onAdsError=function(){this.player.ads.debug("adserror (OutstreamPending)"),this.adsReady=!1},e}(j.getState("AdState"));j.registerState("OutstreamPending",Q);var q=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"OutstreamPlayback"};var n=e.prototype;return n.init=function(t,e){t.addClass("vjs-ad-loading"),e?this.handleAdsReady():this.abort(t)},n.onAdsReady=function(t){t.ads.inAdBreak()?r().log.warn("Unexpected adsready event (Preroll)"):(t.ads.debug("Received adsready event (Preroll)"),this.handleAdsReady())},n.abort=function(t){var e=j.getState("OutstreamDone");t.removeClass("vjs-ad-loading"),this.transitionTo(e)},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.handleAdsReady=function(){this.adsReady=!0,this.readyForOutstreamPlayback()},n.readyForOutstreamPlayback=function(){var t=this.player;this.afterLoadStart(function(){t.trigger("readyforoutstream")})},n.startLinearAdMode=function(){var t=this.player;this.adsReady&&!t.ads.inAdBreak()&&U.start(t)},n.cleanup=function(t){t.ads._hasThereBeenALoadStartDuringPlayerLife||r().log.warn("Leaving OutstreamPlayback state before loadstart event can cause issues."),this.cleanupPartial(t)},n.cleanupPartial=function(t){t.removeClass("vjs-ad-loading"),t.removeClass("vjs-ad-content-resuming"),this.clearTimeout(t)},n.clearTimeout=function(t){t.clearTimeout(this._timeout),this._timeout=null},n.onAdStarted=function(t){t.removeClass("vjs-ad-loading")},n.onAdsError=function(t){var e=this;r().log("adserror (OutstreamPlayback)"),this.inAdBreak()?t.ads.endLinearAdMode():this.afterLoadStart(function(){e.abort(t)})},n.onAdTimeout=function(t){var e=this;this.afterLoadStart(function(){t.ads.debug("adtimeout (OutstreamPlayback)"),e.abort(t)})},n.onAdsCanceled=function(t){var e=this;t.ads.debug("adscanceled (OutstreamPlaybac)"),this.afterLoadStart(function(){e.abort(t)})},n.endLinearAdMode=function(){var t=this;if(this.inAdBreak()){this.player.removeClass("vjs-ad-loading");var e=j.getState("OutstreamDone");U.end(this.player,function(){t.transitionTo(e)})}},n.afterLoadStart=function(t){var e=this.player;e.ads._hasThereBeenALoadStartDuringPlayerLife?t():(e.ads.debug("Waiting for loadstart..."),e.one("loadstart",function(){e.ads.debug("Received loadstart event"),t()}))},n.skipLinearAdMode=function(){var t=this,e=this.player,n=j.getState("OutstreamDone");this.inAdBreak()?r().log.warn("Unexpected skipLinearAdMode invocation"):this.afterLoadStart(function(){e.trigger("adskip"),e.ads.debug("skipLinearAdMode (OutstreamPlayback)"),t.transitionTo(n)})},e}(j.getState("AdState"));j.registerState("OutstreamPlayback",q);var X=function(t){function e(){return t.apply(this,arguments)||this}p(e,t),e._getName=function(){return"OutstreamDone"};var n=e.prototype;return n.init=function(t){t.trigger("ended")},n.startLinearAdMode=function(){r().log.warn("Unexpected startLinearAdMode invocation (OutstreamDone)")},e}(j.getState("AdState"));j.registerState("OutstreamDone",X);var J=w.isMiddlewareMediatorSupported,K=r().getTech("Html5").Events,$={timeout:5e3,prerollTimeout:void 0,postrollTimeout:void 0,debug:!1,stitchedAds:!1,contentIsLive:void 0,liveCuePoints:!0,allowVjsAutoplay:r().options.normalizeAutoplay||!1},tt=function(t){var e=this,n=r().obj.merge($,t),i=[];K.concat(["firstplay","loadedalldata"]).forEach(function(t){-1===i.indexOf(t)&&i.push(t)}),e.on(i,u),J()||function(t,e){e&&r().log("Using cancelContentPlay to block content playback"),t.on("play",T)}(e,n.debug),e.setTimeout(function(){e.ads._hasThereBeenALoadStartDuringPlayerLife||""===e.src()||r().log.error("videojs-contrib-ads has not seen a loadstart event 5 seconds after being initialized, but a source is present. This indicates that videojs-contrib-ads was initialized too late. It must be initialized immediately after video.js in the same tick. As a result, some ads will not play and some media events will be incorrect. For more information, see http://videojs.github.io/videojs-contrib-ads/integrator/getting-started.html")},5e3),e.on("ended",function(){e.hasClass("vjs-has-started")||e.addClass("vjs-has-started")}),e.on("contenttimeupdate",function(){e.removeClass("vjs-waiting")}),e.on(["addurationchange","adcanplay"],function(){if(!e.ads.settings.stitchedAds&&!e.hasStarted()&&(!e.ads.snapshot||e.currentSrc()!==e.ads.snapshot.currentSrc)&&e.ads.inAdBreak()){var t=e.play();t&&t.catch&&t.catch(function(t){r().log.warn("Play promise rejected when playing ad",t)})}}),e.on("nopreroll",function(){e.ads.debug("Received nopreroll event"),e.ads.nopreroll_=!0}),e.on("nopostroll",function(){e.ads.debug("Received nopostroll event"),e.ads.nopostroll_=!0}),e.on("playing",function(){e.ads._cancelledPlay=!1,e.ads._pausedOnContentupdate=!1}),e.on("play",function(){e.ads._playRequested=!0}),e.one("loadstart",function(){e.ads._hasThereBeenALoadStartDuringPlayerLife=!0}),e.on("loadeddata",function(){e.ads._hasThereBeenALoadedData=!0}),e.on("loadedmetadata",function(){e.ads._hasThereBeenALoadedMetaData=!0}),e.ads=function(t){return{disableNextSnapshotRestore:!1,_contentEnding:!1,_contentHasEnded:!1,_hasThereBeenALoadStartDuringPlayerLife:!1,_hasThereBeenALoadedData:!1,_hasThereBeenALoadedMetaData:!1,_inLinearAdMode:!1,_shouldBlockPlay:!1,_playBlocked:!1,_playRequested:!1,_error:null,adType:null,VERSION:l,reset:function(){t.ads.disableNextSnapshotRestore=!1,t.ads._contentEnding=!1,t.ads._contentHasEnded=!1,t.ads.snapshot=null,t.ads.adType=null,t.ads._hasThereBeenALoadedData=!1,t.ads._hasThereBeenALoadedMetaData=!1,t.ads._cancelledPlay=!1,t.ads._shouldBlockPlay=!1,t.ads._playBlocked=!1,t.ads.nopreroll_=!1,t.ads.nopostroll_=!1,t.ads._playRequested=!1,t.ads._error=null},startLinearAdMode:function(){t.ads._state.startLinearAdMode()},endLinearAdMode:function(){t.ads._state.endLinearAdMode()},skipLinearAdMode:function(){t.ads._state.skipLinearAdMode()},stitchedAds:function(t){return void 0!==t&&(r().log.warn("Using player.ads.stitchedAds() as a setter is deprecated, it should be set as an option upon initialization of contrib-ads."),this.settings.stitchedAds=!!t),this.settings.stitchedAds},videoElementRecycled:function(){if(t.ads.shouldPlayContentBehindAd(t))return!1;if(!this.snapshot)throw new Error("You cannot use videoElementRecycled while there is no snapshot.");var e=t.tech_.src()!==this.snapshot.src,n=t.currentSrc()!==this.snapshot.currentSrc;return e||n},isLive:function(e){return void 0===e&&(e=t),"boolean"==typeof e.ads.settings.contentIsLive?e.ads.settings.contentIsLive:e.duration()===1/0||"8"===r().browser.IOS_VERSION&&0===e.duration()},shouldPlayContentBehindAd:function(e){if(void 0===e&&(e=t),e)return!!e.ads.settings.liveCuePoints&&!r().browser.IS_IOS&&!r().browser.IS_ANDROID&&e.duration()===1/0;throw new Error("shouldPlayContentBehindAd requires a player as a param")},shouldTakeSnapshots:function(e){return void 0===e&&(e=t),!this.shouldPlayContentBehindAd(e)&&!this.stitchedAds()},isInAdMode:function(){return this._state.isAdState()},isWaitingForAdBreak:function(){return this._state.isWaitingForAdBreak()},isContentResuming:function(){return this._state.isContentResuming()},isAdPlaying:function(){return this._state.inAdBreak()},inAdBreak:function(){return this._state.inAdBreak()},removeNativePoster:function(){var e=t.$(".vjs-tech");e&&e.removeAttribute("poster")},debug:function(){if(this.settings.debug){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];1===e.length&&"string"==typeof e[0]?r().log("ADS: "+e[0]):r().log.apply(r(),["ADS:"].concat(e))}},error:function(e){if(void 0===e)return this._error||null;null!==e&&e.errorType?(this._error=e,r().log.error("An error with Ads occured. Type: "+e.errorType+"."),t.trigger({type:"vjsadserror",error:this._error})):this._error=null}}}(e),e.ads.settings=n,n.stitchedAds=!!n.stitchedAds,"outstream"===n.playerMode?(e.src(I),e.ads._state=new(j.getState("OutstreamPending"))(e)):n.stitchedAds?e.ads._state=new(j.getState("StitchedContentPlayback"))(e):e.ads._state=new(j.getState("BeforePreroll"))(e),e.ads._state.init(e),e.ads.cueTextTracks=E,e.ads.adMacroReplacement=k.bind(e),function(t){t.ads.contentSrc=t.currentSrc(),t.ads._seenInitialLoadstart=!1,t.on("loadstart",function(){if(!t.ads.inAdBreak()){var e=t.currentSrc();e!==t.ads.contentSrc&&(t.ads._seenInitialLoadstart&&t.trigger({type:"contentchanged"}),t.trigger({type:"contentupdate",oldValue:t.ads.contentSrc,newValue:e}),t.ads.contentSrc=e),t.ads._seenInitialLoadstart=!0}})}(e),e.on("contentchanged",e.ads.reset);var o=function(){var t=e.textTracks();if(!e.ads.shouldPlayContentBehindAd(e)&&e.ads.inAdBreak()&&e.tech_.featuresNativeTextTracks&&r().browser.IS_IOS&&!Array.isArray(e.textTracks()))for(var n=0;n<t.length;n++){var i=t[n];"showing"===i.mode&&(i.mode="disabled")}};e.ready(function(){e.textTracks().addEventListener("change",o)}),e.on(["play","playing","ended","adsready","adscanceled","adskip","adserror","adtimeout","adended","ads-ad-started","ads-ad-skipped","contentchanged","dispose","contentresumed","readyforpostroll","nopreroll","nopostroll"],function(t){e.ads._state.handleEvent(t.type)}),e.on("dispose",function(){e.ads.reset(),e.textTracks().removeEventListener("change",o)}),m(),v(function(){}),e.ads.listenToTcf=m,e.ads.updateUsPrivacyString=function(t){return v(t)}};tt.Error=P,tt.VERSION=l,function(t){!function(){if(r().getPlugin)return Boolean(r().getPlugin("ads"));var t=r().getComponent("Player");return Boolean(t&&t.prototype.ads)}(r())&&((r().registerPlugin||r().plugin)("ads",t),B()&&!r().usingContribAdsMiddleware_&&(r().use("*",D),r().usingContribAdsMiddleware_=!0,r().log.debug("Play middleware has been registered with videojs")))}(tt);function et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function nt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}function rt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return et(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)?et(t,e):void 0}}(t))||e){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function ot(t){return ot="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},ot(t)}var st=function(t,e,n){this.vjsPlayer=t,this.controller=n,this.contentTrackingTimer=null,this.contentComplete=!1,this.updateTimeIntervalHandle=null,this.updateTimeInterval=1e3,this.seekCheckIntervalHandle=null,this.seekCheckInterval=1e3,this.resizeCheckIntervalHandle=null,this.resizeCheckInterval=250,this.seekThreshold=100,this.contentEndedListeners=[],this.contentSource="",this.contentSourceType="",this.contentPlayheadTracker={currentTime:0,previousTime:0,seeking:!1,duration:0},this.vjsPlayerDimensions={width:this.getPlayerWidth(),height:this.getPlayerHeight()},this.vjsControls=this.vjsPlayer.getChild("controlBar"),this.h5Player=null,this.vjsPlayer.one("play",this.setUpPlayerIntervals.bind(this)),this.boundContentEndedListener=this.localContentEndedListener.bind(this),this.vjsPlayer.on("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.on("dispose",this.playerDisposedListener.bind(this)),this.vjsPlayer.on("readyforpreroll",this.onReadyForPreroll.bind(this)),this.vjsPlayer.on("adtimeout",this.onAdTimeout.bind(this)),this.vjsPlayer.ready(this.onPlayerReady.bind(this)),"onPlay"===this.controller.getSettings().requestMode&&this.vjsPlayer.one("play",this.controller.requestAds.bind(this.controller)),this.vjsPlayer.ads||window.console.warn("You may be using a version of videojs-contrib-ads that is not compatible with your version of video.js."),this.vjsPlayer.ads(e)};st.prototype.setUpPlayerIntervals=function(){this.updateTimeIntervalHandle&&clearInterval(this.updateTimeIntervalHandle),this.seekCheckIntervalHandle&&clearInterval(this.seekCheckIntervalHandle),this.resizeCheckIntervalHandle&&clearInterval(this.resizeCheckIntervalHandle),this.updateTimeIntervalHandle=setInterval(this.updateCurrentTime.bind(this),this.updateTimeInterval),this.seekCheckIntervalHandle=setInterval(this.checkForSeeking.bind(this),this.seekCheckInterval),this.resizeCheckIntervalHandle=setInterval(this.checkForResize.bind(this),this.resizeCheckInterval)},st.prototype.updateCurrentTime=function(){this.contentPlayheadTracker.seeking||(this.contentPlayheadTracker.currentTime=this.vjsPlayer.currentTime())},st.prototype.checkForSeeking=function(){var t=1e3*(this.vjsPlayer.currentTime()-this.contentPlayheadTracker.previousTime);Math.abs(t)>this.seekCheckInterval+this.seekThreshold?this.contentPlayheadTracker.seeking=!0:this.contentPlayheadTracker.seeking=!1,this.contentPlayheadTracker.previousTime=this.vjsPlayer.currentTime()},st.prototype.checkForResize=function(){var t=this.getPlayerWidth(),e=this.getPlayerHeight();t==this.vjsPlayerDimensions.width&&e==this.vjsPlayerDimensions.height||(this.vjsPlayerDimensions.width=t,this.vjsPlayerDimensions.height=e,this.controller.onPlayerResize(t,e))},st.prototype.localContentEndedListener=function(){for(var t in this.contentComplete||(this.contentComplete=!0,this.controller.onContentComplete()),this.contentEndedListeners)"function"==typeof this.contentEndedListeners[t]&&this.contentEndedListeners[t]();this.vjsPlayer.el()&&this.vjsPlayer.one("play",this.setUpPlayerIntervals.bind(this))},st.prototype.onNoPostroll=function(){this.vjsPlayer.trigger("nopostroll")},st.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.controller.onPlayerDisposed(),this.contentComplete=!0,this.vjsPlayer.off("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.ads.adTimeoutTimeout&&clearTimeout(this.vjsPlayer.ads.adTimeoutTimeout);var t=[this.updateTimeIntervalHandle,this.seekCheckIntervalHandle,this.resizeCheckIntervalHandle];for(var e in t)t[e]&&clearInterval(t[e])},st.prototype.onReadyForPreroll=function(){this.controller.onPlayerReadyForPreroll()},st.prototype.onAdTimeout=function(){this.controller.onAdTimeout()},st.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName("vjs-tech")[0],this.h5Player.hasAttribute("autoplay")&&this.controller.setSetting("adWillAutoPlay",!0),this.onVolumeChange(),this.vjsPlayer.on("fullscreenchange",this.onFullscreenChange.bind(this)),this.vjsPlayer.on("volumechange",this.onVolumeChange.bind(this)),this.controller.onPlayerReady()},st.prototype.onFullscreenChange=function(){this.vjsPlayer.isFullscreen()?this.controller.onPlayerEnterFullscreen():this.controller.onPlayerExitFullscreen()},st.prototype.onVolumeChange=function(){var t=this.vjsPlayer.muted()?0:this.vjsPlayer.volume();this.controller.onPlayerVolumeChanged(t)},st.prototype.injectAdContainerDiv=function(t){this.vjsControls.el().parentNode.appendChild(t)},st.prototype.getContentPlayer=function(){return this.h5Player},st.prototype.getVolume=function(){return this.vjsPlayer.muted()?0:this.vjsPlayer.volume()},st.prototype.setVolume=function(t){this.vjsPlayer.volume(t),0==t?this.vjsPlayer.muted(!0):this.vjsPlayer.muted(!1)},st.prototype.unmute=function(){this.vjsPlayer.muted(!1)},st.prototype.mute=function(){this.vjsPlayer.muted(!0)},st.prototype.play=function(){this.vjsPlayer.play()},st.prototype.togglePlayback=function(){this.vjsPlayer.paused()?this.vjsPlayer.play():this.vjsPlayer.pause()},st.prototype.getPlayerWidth=function(){var t=(getComputedStyle(this.vjsPlayer.el())||{}).width;return t&&0!==parseFloat(t)||(t=(this.vjsPlayer.el().getBoundingClientRect()||{}).width),parseFloat(t)||this.vjsPlayer.width()},st.prototype.getPlayerHeight=function(){var t=(getComputedStyle(this.vjsPlayer.el())||{}).height;return t&&0!==parseFloat(t)||(t=(this.vjsPlayer.el().getBoundingClientRect()||{}).height),parseFloat(t)||this.vjsPlayer.height()},st.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_},st.prototype.getPlayerId=function(){return this.vjsPlayer.id()},st.prototype.toggleFullscreen=function(){this.vjsPlayer.isFullscreen()?this.vjsPlayer.exitFullscreen():this.vjsPlayer.requestFullscreen()},st.prototype.getContentPlayheadTracker=function(){return this.contentPlayheadTracker},st.prototype.onAdError=function(t){this.vjsControls.show();var e=void 0!==t.getError?t.getError():t.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:e,AdErrorEvent:t}})},st.prototype.onAdLog=function(t){var e=t.getAdData(),n=void 0!==e.adError?e.adError.getMessage():void 0;this.vjsPlayer.trigger({type:"adslog",data:{AdError:n,AdEvent:t}})},st.prototype.onAdBreakStart=function(){this.contentSource=this.vjsPlayer.currentSrc(),this.contentSourceType=this.vjsPlayer.currentType(),this.vjsPlayer.off("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.ads.startLinearAdMode(),this.vjsControls.hide(),this.vjsPlayer.pause()},st.prototype.onAdBreakEnd=function(){this.vjsPlayer.on("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.vjsControls.show()},st.prototype.onAdStart=function(){this.vjsPlayer.trigger("ads-ad-started")},st.prototype.onAllAdsCompleted=function(){1==this.contentComplete&&(this.contentSource&&this.vjsPlayer.currentSrc()!=this.contentSource&&this.vjsPlayer.src({src:this.contentSource,type:this.contentSourceType}),this.controller.onContentAndAdsCompleted())},st.prototype.onAdsReady=function(){this.vjsPlayer.trigger("adsready")},st.prototype.changeSource=function(t){this.vjsPlayer.currentSrc()&&(this.vjsPlayer.currentTime(0),this.vjsPlayer.pause()),t&&this.vjsPlayer.src(t),this.vjsPlayer.one("loadedmetadata",this.seekContentToZero.bind(this))},st.prototype.seekContentToZero=function(){this.vjsPlayer.currentTime(0)},st.prototype.triggerPlayerEvent=function(t,e){this.vjsPlayer.trigger(t,e)},st.prototype.addContentEndedListener=function(t){this.contentEndedListeners.push(t)},st.prototype.reset=function(){this.vjsPlayer.off("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.on("readyforpostroll",this.boundContentEndedListener),this.vjsControls.show(),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.contentPlayheadTracker.currentTime=0,this.contentComplete=!1};var at=function(t){this.controller=t,this.adContainerDiv=document.createElement("div"),this.controlsDiv=document.createElement("div"),this.countdownDiv=document.createElement("div"),this.seekBarDiv=document.createElement("div"),this.progressDiv=document.createElement("div"),this.playPauseDiv=document.createElement("div"),this.muteDiv=document.createElement("div"),this.sliderDiv=document.createElement("div"),this.sliderLevelDiv=document.createElement("div"),this.fullscreenDiv=document.createElement("div"),this.boundOnMouseUp=this.onMouseUp.bind(this),this.boundOnMouseMove=this.onMouseMove.bind(this),this.adPlayheadTracker={currentTime:0,duration:0,isPod:!1,adPosition:0,totalAds:0},this.controlPrefix=this.controller.getPlayerId()+"_",this.showCountdown=!0,!1===this.controller.getSettings().showCountdown&&(this.showCountdown=!1),this.isAdNonlinear=!1,this.createAdContainer()};at.prototype.createAdContainer=function(){this.assignControlAttributes(this.adContainerDiv,"ima-ad-container"),this.adContainerDiv.classList.add("hide-ad-container"),this.adContainerDiv.addEventListener("mouseenter",this.showAdControls.bind(this),!1),this.adContainerDiv.addEventListener("mouseleave",this.hideAdControls.bind(this),!1),this.adContainerDiv.addEventListener("click",this.onAdContainerClick.bind(this),!1),this.createControls(),this.controller.injectAdContainerDiv(this.adContainerDiv)},at.prototype.createControls=function(){this.assignControlAttributes(this.controlsDiv,"ima-controls-div"),this.controlsDiv.style.width="100%",this.controller.getIsMobile()?this.countdownDiv.style.display="none":(this.assignControlAttributes(this.countdownDiv,"ima-countdown-div"),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel,this.countdownDiv.style.display=this.showCountdown?"block":"none"),this.assignControlAttributes(this.seekBarDiv,"ima-seek-bar-div"),this.seekBarDiv.style.width="100%",this.assignControlAttributes(this.progressDiv,"ima-progress-div"),this.assignControlAttributes(this.playPauseDiv,"ima-play-pause-div"),this.addClass(this.playPauseDiv,"ima-playing"),this.playPauseDiv.addEventListener("click",this.onAdPlayPauseClick.bind(this),!1),this.assignControlAttributes(this.muteDiv,"ima-mute-div"),this.addClass(this.muteDiv,"ima-non-muted"),this.muteDiv.addEventListener("click",this.onAdMuteClick.bind(this),!1),this.assignControlAttributes(this.sliderDiv,"ima-slider-div"),this.sliderDiv.addEventListener("mousedown",this.onAdVolumeSliderMouseDown.bind(this),!1),this.controller.getIsIos()&&(this.sliderDiv.style.display="none"),this.assignControlAttributes(this.sliderLevelDiv,"ima-slider-level-div"),this.assignControlAttributes(this.fullscreenDiv,"ima-fullscreen-div"),this.addClass(this.fullscreenDiv,"ima-non-fullscreen"),this.fullscreenDiv.addEventListener("click",this.onAdFullscreenClick.bind(this),!1),this.adContainerDiv.appendChild(this.controlsDiv),this.controlsDiv.appendChild(this.countdownDiv),this.controlsDiv.appendChild(this.seekBarDiv),this.controlsDiv.appendChild(this.playPauseDiv),this.controlsDiv.appendChild(this.muteDiv),this.controlsDiv.appendChild(this.sliderDiv),this.controlsDiv.appendChild(this.fullscreenDiv),this.seekBarDiv.appendChild(this.progressDiv),this.sliderDiv.appendChild(this.sliderLevelDiv)},at.prototype.onAdPlayPauseClick=function(){this.controller.onAdPlayPauseClick()},at.prototype.onAdMuteClick=function(){this.controller.onAdMuteClick()},at.prototype.onAdFullscreenClick=function(){this.controller.toggleFullscreen()},at.prototype.onAdsPaused=function(){this.controller.sdkImpl.adPlaying=!1,this.addClass(this.playPauseDiv,"ima-paused"),this.removeClass(this.playPauseDiv,"ima-playing"),this.showAdControls()},at.prototype.onAdsResumed=function(){this.onAdsPlaying(),this.showAdControls()},at.prototype.onAdsPlaying=function(){this.controller.sdkImpl.adPlaying=!0,this.addClass(this.playPauseDiv,"ima-playing"),this.removeClass(this.playPauseDiv,"ima-paused")},at.prototype.updateAdUi=function(t,e,n,i,r){var o=Math.floor(e/60),s=Math.floor(e%60);s.toString().length<2&&(s="0"+s);var a=": ";r>1&&(a=" ("+i+" "+this.controller.getSettings().adLabelNofN+" "+r+"): "),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel+a+o+":"+s;var d=100*(t/n);this.progressDiv.style.width=d+"%"},at.prototype.unmute=function(){this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted"),this.sliderLevelDiv.style.width=100*this.controller.getPlayerVolume()+"%"},at.prototype.mute=function(){this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted"),this.sliderLevelDiv.style.width="0%"},at.prototype.onAdVolumeSliderMouseDown=function(){document.addEventListener("mouseup",this.boundOnMouseUp,!1),document.addEventListener("mousemove",this.boundOnMouseMove,!1)},at.prototype.onMouseMove=function(t){this.changeVolume(t)},at.prototype.onMouseUp=function(t){this.changeVolume(t),document.removeEventListener("mouseup",this.boundOnMouseUp),document.removeEventListener("mousemove",this.boundOnMouseMove)},at.prototype.changeVolume=function(t){var e=(t.clientX-this.sliderDiv.getBoundingClientRect().left)/this.sliderDiv.offsetWidth;e*=100,e=Math.min(Math.max(e,0),100),this.sliderLevelDiv.style.width=e+"%",0==this.percent?(this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted")):(this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted")),this.controller.setVolume(e/100)},at.prototype.showAdContainer=function(){this.adContainerDiv.classList.remove("hide-ad-container")},at.prototype.hideAdContainer=function(){this.adContainerDiv.classList.add("hide-ad-container")},at.prototype.onAdContainerClick=function(){this.isAdNonlinear&&this.controller.togglePlayback()},at.prototype.reset=function(){this.hideAdContainer()},at.prototype.onAdError=function(){this.hideAdContainer()},at.prototype.onAdBreakStart=function(t){this.showAdContainer(),"application/javascript"!==t.getAd().getContentType()||this.controller.getSettings().showControlsForJSAds?this.controlsDiv.style.display="block":this.controlsDiv.style.display="none",this.onAdsPlaying(),this.hideAdControls()},at.prototype.onAdBreakEnd=function(){var t=this.controller.getCurrentAd();(null==t||t.isLinear())&&this.hideAdContainer(),this.controlsDiv.style.display="none",this.countdownDiv.innerHTML=""},at.prototype.onAllAdsCompleted=function(){this.hideAdContainer()},at.prototype.onLinearAdStart=function(){this.removeClass(this.adContainerDiv,"bumpable-ima-ad-container"),this.isAdNonlinear=!1},at.prototype.onNonLinearAdLoad=function(){this.addClass(this.adContainerDiv,"bumpable-ima-ad-container"),this.isAdNonlinear=!0},at.prototype.onPlayerEnterFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-non-fullscreen")},at.prototype.onPlayerExitFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-non-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-fullscreen")},at.prototype.onPlayerVolumeChanged=function(t){0==t?(this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted"),this.sliderLevelDiv.style.width="0%"):(this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted"),this.sliderLevelDiv.style.width=100*t+"%")},at.prototype.showAdControls=function(){this.controller.getSettings().disableAdControls||this.addClass(this.controlsDiv,"ima-controls-div-showing")},at.prototype.hideAdControls=function(){this.removeClass(this.controlsDiv,"ima-controls-div-showing")},at.prototype.assignControlAttributes=function(t,e){t.id=this.controlPrefix+e,t.className=this.controlPrefix+e+" "+e},at.prototype.getClassRegexp=function(t){return new RegExp("(^|[^A-Za-z-])"+t+"((?![A-Za-z-])|$)","gi")},at.prototype.elementHasClass=function(t,e){return this.getClassRegexp(e).test(t.className)},at.prototype.addClass=function(t,e){t.className=t.className.trim()+" "+e},at.prototype.removeClass=function(t,e){var n=this.getClassRegexp(e);t.className=t.className.trim().replace(n,"")},at.prototype.getAdContainerDiv=function(){return this.adContainerDiv},at.prototype.setShowCountdown=function(t){this.showCountdown=t,this.countdownDiv.style.display=this.showCountdown?"block":"none"};var dt="2.5.0",lt=function(t){this.controller=t,this.adDisplayContainer=null,this.adDisplayContainerInitialized=!1,this.adsLoader=null,this.adsManager=null,this.adsRenderingSettings=null,this.adsResponse=null,this.currentAd=null,this.adTrackingTimer=null,this.allAdsCompleted=!1,this.adsActive=!1,this.adPlaying=!1,this.adMuted=!1,this.adBreakReadyListener=void 0,this.contentCompleteCalled=!1,this.isAdTimedOut=!1,this.adsManagerDimensions={width:0,height:0},this.autoPlayAdBreaks=!0,!1===this.controller.getSettings().autoPlayAdBreaks&&(this.autoPlayAdBreaks=!1),this.controller.getSettings().locale&&google.ima.settings.setLocale(this.controller.getSettings().locale),this.controller.getSettings().disableFlashAds&&google.ima.settings.setDisableFlashAds(this.controller.getSettings().disableFlashAds),this.controller.getSettings().disableCustomPlaybackForIOS10Plus&&google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.controller.getSettings().disableCustomPlaybackForIOS10Plus),this.controller.getSettings().ppid&&google.ima.settings.setPpid(this.controller.getSettings().ppid),this.controller.getSettings().featureFlags&&google.ima.settings.setFeatureFlags(this.controller.getSettings().featureFlags)};lt.prototype.initAdObjects=function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.controller.getAdContainerDiv(),this.controller.getContentPlayer()),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),0==this.controller.getSettings().vpaidAllowed&&this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.DISABLED),void 0!==this.controller.getSettings().vpaidMode&&this.adsLoader.getSettings().setVpaidMode(this.controller.getSettings().vpaidMode),this.controller.getSettings().locale&&this.adsLoader.getSettings().setLocale(this.controller.getSettings().locale),this.controller.getSettings().numRedirects&&this.adsLoader.getSettings().setNumRedirects(this.controller.getSettings().numRedirects),this.controller.getSettings().sessionId&&this.adsLoader.getSettings().setSessionId(this.controller.getSettings().sessionId),this.adsLoader.getSettings().setPlayerType("videojs-ima"),this.adsLoader.getSettings().setPlayerVersion(dt),this.adsLoader.getSettings().setAutoPlayAdBreaks(this.autoPlayAdBreaks),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoaded.bind(this),!1),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdsLoaderError.bind(this),!1),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-loader",adsLoader:this.adsLoader})},lt.prototype.requestAds=function(){var t=new google.ima.AdsRequest;if(this.controller.getSettings().adTagUrl?t.adTagUrl=this.controller.getSettings().adTagUrl:t.adsResponse=this.controller.getSettings().adsResponse,this.controller.getSettings().forceNonLinearFullSlot&&(t.forceNonLinearFullSlot=!0),this.controller.getSettings().vastLoadTimeout&&(t.vastLoadTimeout=this.controller.getSettings().vastLoadTimeout),this.controller.getSettings().omidMode&&window.console.warn("The additional setting `omidMode` has been removed. Use `omidVendorAccess` instead."),this.controller.getSettings().omidVendorAccess){t.omidAccessModeRules={};var e=this.controller.getSettings().omidVendorAccess;Object.keys(e).forEach(function(n){t.omidAccessModeRules[n]=e[n]})}t.linearAdSlotWidth=this.controller.getPlayerWidth(),t.linearAdSlotHeight=this.controller.getPlayerHeight(),t.nonLinearAdSlotWidth=this.controller.getSettings().nonLinearWidth||this.controller.getPlayerWidth(),t.nonLinearAdSlotHeight=this.controller.getSettings().nonLinearHeight||this.controller.getPlayerHeight(),t.setAdWillAutoPlay(this.controller.adsWillAutoplay()),t.setAdWillPlayMuted(this.controller.adsWillPlayMuted());var n=this.controller.getSettings().adsRequest;n&&"object"===ot(n)&&Object.keys(n).forEach(function(e){t[e]=n[e]}),this.adsLoader.requestAds(t),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-request",AdsRequest:t})},lt.prototype.onAdsManagerLoaded=function(t){this.createAdsRenderingSettings(),this.adsManager=t.getAdsManager(this.controller.getContentPlayheadTracker(),this.adsRenderingSettings),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdError.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this.onAdBreakReady.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this.onContentPauseRequested.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this.onContentResumeRequested.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this.onAllAdsCompleted.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this.onAdLoaded.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this.onAdStarted.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this.onAdComplete.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this.onAdComplete.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this.onAdLog.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this.onAdPaused.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this.onAdResumed.bind(this)),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-manager",adsManager:this.adsManager}),this.autoPlayAdBreaks||this.initAdsManager();var e=this.controller.getSettings().preventLateAdStart;e?e&&!this.isAdTimedOut&&this.controller.onAdsReady():this.controller.onAdsReady(),this.controller.getSettings().adsManagerLoadedCallback&&this.controller.getSettings().adsManagerLoadedCallback()},lt.prototype.onAdsLoaderError=function(t){window.console.warn("AdsLoader error: "+t.getError()),this.controller.onErrorLoadingAds(t),this.adsManager&&this.adsManager.destroy()},lt.prototype.initAdsManager=function(){try{var t=this.controller.getPlayerWidth(),e=this.controller.getPlayerHeight();this.adsManagerDimensions.width=t,this.adsManagerDimensions.height=e,this.adsManager.init(t,e),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.initializeAdDisplayContainer()}catch(t){this.onAdError(t)}},lt.prototype.createAdsRenderingSettings=function(){if(this.adsRenderingSettings=new google.ima.AdsRenderingSettings,this.adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete=!0,this.controller.getSettings().adsRenderingSettings)for(var t in this.controller.getSettings().adsRenderingSettings)""!==t&&(this.adsRenderingSettings[t]=this.controller.getSettings().adsRenderingSettings[t])},lt.prototype.onAdError=function(t){var e=void 0!==t.getError?t.getError():t.stack;window.console.warn("Ad error: "+e),this.adsManager.destroy(),this.controller.onAdError(t),this.adsActive=!1,this.adPlaying=!1},lt.prototype.onAdBreakReady=function(t){this.adBreakReadyListener(t)},lt.prototype.onContentPauseRequested=function(t){this.adsActive=!0,this.adPlaying=!0,this.controller.onAdBreakStart(t)},lt.prototype.onContentResumeRequested=function(t){this.adsActive=!1,this.adPlaying=!1,this.controller.onAdBreakEnd()},lt.prototype.onAllAdsCompleted=function(t){this.allAdsCompleted=!0,this.controller.onAllAdsCompleted()},lt.prototype.onAdLoaded=function(t){t.getAd().isLinear()||(this.controller.onNonLinearAdLoad(),this.controller.playContent())},lt.prototype.onAdStarted=function(t){this.currentAd=t.getAd(),this.currentAd.isLinear()?(this.adTrackingTimer=setInterval(this.onAdPlayheadTrackerInterval.bind(this),250),this.controller.onLinearAdStart()):this.controller.onNonLinearAdStart()},lt.prototype.onAdPaused=function(){this.controller.onAdsPaused()},lt.prototype.onAdResumed=function(t){this.controller.onAdsResumed()},lt.prototype.onAdComplete=function(){this.currentAd.isLinear()&&clearInterval(this.adTrackingTimer)},lt.prototype.onAdLog=function(t){this.controller.onAdLog(t)},lt.prototype.onAdPlayheadTrackerInterval=function(){if(null!==this.adsManager){var t=this.adsManager.getRemainingTime(),e=this.currentAd.getDuration(),n=e-t;n=n>0?n:0;var i,r=0;this.currentAd.getAdPodInfo()&&(i=this.currentAd.getAdPodInfo().getAdPosition(),r=this.currentAd.getAdPodInfo().getTotalAds()),this.controller.onAdPlayheadUpdated(n,t,e,i,r)}},lt.prototype.onContentComplete=function(){this.adsLoader&&(this.adsLoader.contentComplete(),this.contentCompleteCalled=!0),(this.adsManager&&this.adsManager.getCuePoints()&&!this.adsManager.getCuePoints().includes(-1)||!this.adsManager)&&this.controller.onNoPostroll(),this.allAdsCompleted&&this.controller.onContentAndAdsCompleted()},lt.prototype.onPlayerDisposed=function(){this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null)},lt.prototype.onPlayerReadyForPreroll=function(){if(this.autoPlayAdBreaks){this.initAdsManager();try{this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start()}catch(t){this.onAdError(t)}}},lt.prototype.onAdTimeout=function(){this.isAdTimedOut=!0},lt.prototype.onPlayerReady=function(){this.initAdObjects(),(this.controller.getSettings().adTagUrl||this.controller.getSettings().adsResponse)&&"onLoad"===this.controller.getSettings().requestMode&&this.requestAds()},lt.prototype.onPlayerEnterFullscreen=function(){this.adsManager&&this.adsManager.resize(window.screen.width,window.screen.height)},lt.prototype.onPlayerExitFullscreen=function(){this.adsManager&&this.adsManager.resize(this.controller.getPlayerWidth(),this.controller.getPlayerHeight())},lt.prototype.onPlayerVolumeChanged=function(t){this.adsManager&&this.adsManager.setVolume(t),this.adMuted=0==t},lt.prototype.onPlayerResize=function(t,e){this.adsManager&&(this.adsManagerDimensions.width=t,this.adsManagerDimensions.height=e,this.adsManager.resize(t,e))},lt.prototype.getCurrentAd=function(){return this.currentAd},lt.prototype.setAdBreakReadyListener=function(t){this.adBreakReadyListener=t},lt.prototype.isAdPlaying=function(){return this.adPlaying},lt.prototype.isAdMuted=function(){return this.adMuted},lt.prototype.pauseAds=function(){this.adsManager.pause(),this.adPlaying=!1},lt.prototype.resumeAds=function(){this.adsManager.resume(),this.adPlaying=!0},lt.prototype.unmute=function(){this.adsManager.setVolume(1),this.adMuted=!1},lt.prototype.mute=function(){this.adsManager.setVolume(0),this.adMuted=!0},lt.prototype.setVolume=function(t){this.adsManager.setVolume(t),this.adMuted=0==t},lt.prototype.initializeAdDisplayContainer=function(){this.adDisplayContainer&&(this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0))},lt.prototype.playAdBreak=function(){this.autoPlayAdBreaks||(this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start())},lt.prototype.addEventListener=function(t,e){this.adsManager&&this.adsManager.addEventListener(t,e)},lt.prototype.getAdsManager=function(){return this.adsManager},lt.prototype.reset=function(){this.adsActive=!1,this.adPlaying=!1,this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null),this.adsLoader&&!this.contentCompleteCalled&&this.adsLoader.contentComplete(),this.contentCompleteCalled=!1,this.allAdsCompleted=!1};var At=function(t,e){this.settings={},this.contentAndAdsEndedListeners=[],this.isMobile=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i),this.isIos=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i),this.initWithSettings(e);var n={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},i=Object.assign({},n,e.contribAdsSettings||{});this.playerWrapper=new st(t,i,this),this.adUi=new at(this),this.sdkImpl=new lt(this)};At.IMA_DEFAULTS={adLabel:"Advertisement",adLabelNofN:"of",debug:!1,disableAdControls:!1,prerollTimeout:1e3,preventLateAdStart:!1,requestMode:"onLoad",showControlsForJSAds:!0,timeout:5e3},At.prototype.initWithSettings=function(t){this.settings=Object.assign({},At.IMA_DEFAULTS,t||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,!1===this.settings.showCountdown&&(this.showCountdown=!1)},At.prototype.warnAboutDeprecatedSettings=function(){var t=this;["adWillAutoplay","adsWillAutoplay","adWillPlayMuted","adsWillPlayMuted"].forEach(function(e){void 0!==t.settings[e]&&console.warn("WARNING: videojs.ima setting "+e+" is deprecated")})},At.prototype.getSettings=function(){return this.settings},At.prototype.getIsMobile=function(){return this.isMobile},At.prototype.getIsIos=function(){return this.isIos},At.prototype.injectAdContainerDiv=function(t){this.playerWrapper.injectAdContainerDiv(t)},At.prototype.getAdContainerDiv=function(){return this.adUi.getAdContainerDiv()},At.prototype.getContentPlayer=function(){return this.playerWrapper.getContentPlayer()},At.prototype.getContentPlayheadTracker=function(){return this.playerWrapper.getContentPlayheadTracker()},At.prototype.requestAds=function(){this.sdkImpl.requestAds()},At.prototype.setSetting=function(t,e){this.settings[t]=e},At.prototype.onErrorLoadingAds=function(t){this.adUi.onAdError(),this.playerWrapper.onAdError(t)},At.prototype.onAdPlayPauseClick=function(){this.sdkImpl.isAdPlaying()?(this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()):(this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds())},At.prototype.onAdMuteClick=function(){this.sdkImpl.isAdMuted()?(this.playerWrapper.unmute(),this.adUi.unmute(),this.sdkImpl.unmute()):(this.playerWrapper.mute(),this.adUi.mute(),this.sdkImpl.mute())},At.prototype.setVolume=function(t){this.playerWrapper.setVolume(t),this.sdkImpl.setVolume(t)},At.prototype.getPlayerVolume=function(){return this.playerWrapper.getVolume()},At.prototype.toggleFullscreen=function(){this.playerWrapper.toggleFullscreen()},At.prototype.onAdError=function(t){this.adUi.onAdError(),this.playerWrapper.onAdError(t)},At.prototype.onAdBreakStart=function(t){this.playerWrapper.onAdBreakStart(),this.adUi.onAdBreakStart(t)},At.prototype.showAdContainer=function(){this.adUi.showAdContainer()},At.prototype.onAdBreakEnd=function(){this.playerWrapper.onAdBreakEnd(),this.adUi.onAdBreakEnd()},At.prototype.onAllAdsCompleted=function(){this.adUi.onAllAdsCompleted(),this.playerWrapper.onAllAdsCompleted()},At.prototype.onAdsPaused=function(){this.adUi.onAdsPaused()},At.prototype.onAdsResumed=function(){this.adUi.onAdsResumed()},At.prototype.onAdPlayheadUpdated=function(t,e,n,i,r){this.adUi.updateAdUi(t,e,n,i,r)},At.prototype.onAdLog=function(t){this.playerWrapper.onAdLog(t)},At.prototype.getCurrentAd=function(){return this.sdkImpl.getCurrentAd()},At.prototype.playContent=function(){this.playerWrapper.play()},At.prototype.onLinearAdStart=function(){this.adUi.onLinearAdStart(),this.playerWrapper.onAdStart()},At.prototype.onNonLinearAdLoad=function(){this.adUi.onNonLinearAdLoad()},At.prototype.onNonLinearAdStart=function(){this.adUi.onNonLinearAdLoad(),this.playerWrapper.onAdStart()},At.prototype.getPlayerWidth=function(){return this.playerWrapper.getPlayerWidth()},At.prototype.getPlayerHeight=function(){return this.playerWrapper.getPlayerHeight()},At.prototype.onAdsReady=function(){this.playerWrapper.onAdsReady()},At.prototype.onPlayerResize=function(t,e){this.sdkImpl.onPlayerResize(t,e)},At.prototype.onContentComplete=function(){this.sdkImpl.onContentComplete()},At.prototype.onNoPostroll=function(){this.playerWrapper.onNoPostroll()},At.prototype.onContentAndAdsCompleted=function(){for(var t in this.contentAndAdsEndedListeners)"function"==typeof this.contentAndAdsEndedListeners[t]&&this.contentAndAdsEndedListeners[t]()},At.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()},At.prototype.onPlayerReadyForPreroll=function(){this.sdkImpl.onPlayerReadyForPreroll()},At.prototype.onAdTimeout=function(){this.sdkImpl.onAdTimeout()},At.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()},At.prototype.onPlayerEnterFullscreen=function(){this.adUi.onPlayerEnterFullscreen(),this.sdkImpl.onPlayerEnterFullscreen()},At.prototype.onPlayerExitFullscreen=function(){this.adUi.onPlayerExitFullscreen(),this.sdkImpl.onPlayerExitFullscreen()},At.prototype.onPlayerVolumeChanged=function(t){this.adUi.onPlayerVolumeChanged(t),this.sdkImpl.onPlayerVolumeChanged(t)},At.prototype.setContentWithAdTag=function(t,e){this.reset(),this.settings.adTagUrl=e||this.settings.adTagUrl,this.playerWrapper.changeSource(t)},At.prototype.setContentWithAdsResponse=function(t,e){this.reset(),this.settings.adsResponse=e||this.settings.adsResponse,this.playerWrapper.changeSource(t)},At.prototype.setContentWithAdsRequest=function(t,e){this.reset(),this.settings.adsRequest=e||this.settings.adsRequest,this.playerWrapper.changeSource(t)},At.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset(),this.adUi.reset()},At.prototype.addContentEndedListener=function(t){this.playerWrapper.addContentEndedListener(t)},At.prototype.addContentAndAdsEndedListener=function(t){this.contentAndAdsEndedListeners.push(t)},At.prototype.setAdBreakReadyListener=function(t){this.sdkImpl.setAdBreakReadyListener(t)},At.prototype.setShowCountdown=function(t){this.adUi.setShowCountdown(t),this.showCountdown=t,this.adUi.countdownDiv.style.display=this.showCountdown?"block":"none"},At.prototype.initializeAdDisplayContainer=function(){this.sdkImpl.initializeAdDisplayContainer()},At.prototype.playAdBreak=function(){this.sdkImpl.playAdBreak()},At.prototype.addEventListener=function(t,e){this.sdkImpl.addEventListener(t,e)},At.prototype.getAdsManager=function(){return this.sdkImpl.getAdsManager()},At.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()},At.prototype.changeAdTag=function(t){this.reset(),this.settings.adTagUrl=t},At.prototype.pauseAd=function(){this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()},At.prototype.resumeAd=function(){this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds()},At.prototype.togglePlayback=function(){this.playerWrapper.togglePlayback()},At.prototype.adsWillAutoplay=function(){return void 0!==this.settings.adsWillAutoplay?this.settings.adsWillAutoplay:void 0!==this.settings.adWillAutoplay?this.settings.adWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay},At.prototype.adsWillPlayMuted=function(){return void 0!==this.settings.adsWillPlayMuted?this.settings.adsWillPlayMuted:void 0!==this.settings.adWillPlayMuted?this.settings.adWillPlayMuted:void 0!==this.playerWrapper.getPlayerOptions().muted?this.playerWrapper.getPlayerOptions().muted:0==this.playerWrapper.getVolume()},At.prototype.triggerPlayerEvent=function(t,e){this.playerWrapper.triggerPlayerEvent(t,e)};var ht=function(t,e,n){this.vjsPlayer=t,this.daiController=n,this.vjsControls=this.vjsPlayer.getChild("controlBar"),this.h5Player=null,this.vjsPlayer.on("dispose",this.playerDisposedListener.bind(this)),this.vjsPlayer.on("pause",this.onPause.bind(this)),this.vjsPlayer.on("play",this.onPlay.bind(this)),this.vjsPlayer.on("seeked",this.onSeekEnd.bind(this)),this.vjsPlayer.ready(this.onPlayerReady.bind(this)),this.vjsPlayer.ads||window.console.warn("You may be using a version of videojs-contrib-ads that is not compatible with your version of video.js."),this.vjsPlayer.ads(e)};ht.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.daiController.onPlayerDisposed()},ht.prototype.onPause=function(){this.daiController.isInAdBreak()&&this.vjsControls.show()},ht.prototype.onPlay=function(){this.daiController.isInAdBreak()&&this.vjsControls.hide()},ht.prototype.onSeekEnd=function(){this.daiController.onSeekEnd(this.vjsPlayer.currentTime())},ht.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName("vjs-tech")[0],this.daiController.onPlayerReady()},ht.prototype.getStreamPlayer=function(){return this.h5Player},ht.prototype.getVjsPlayer=function(){return this.vjsPlayer},ht.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_},ht.prototype.getPlayerId=function(){return this.vjsPlayer.id()},ht.prototype.onAdError=function(t){this.vjsControls.show();var e=void 0!==t.getError?t.getError():t.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:e,AdErrorEvent:t}})},ht.prototype.onAdBreakStart=function(){this.vjsControls.hide()},ht.prototype.onAdBreakEnd=function(){this.vjsControls.show()},ht.prototype.reset=function(){this.vjsControls.show()};var ut=function(t){this.daiController=t,this.streamPlayer=null,this.vjsPlayer=null,this.streamManager=null,this.uiSettings=new google.ima.dai.api.UiSettings,this.isAdBreak=!1,this.isSnapback=!1,this.snapForwardTime=0,this.timedMetadata,this.metadataLoaded={},this.SOURCE_TYPES={hls:"application/x-mpegURL",dash:"application/dash+xml"}};ut.prototype.initImaDai=function(){var t=this;this.streamPlayer=this.daiController.getStreamPlayer(),this.vjsPlayer=this.daiController.getVjsPlayer(),this.createAdUiDiv(),this.daiController.getSettings().locale&&this.uiSettings.setLocale(this.daiController.getSettings().locale),this.streamManager=new google.ima.dai.api.StreamManager(this.streamPlayer,this.adUiDiv,this.uiSettings),this.streamPlayer.addEventListener("pause",this.onStreamPause),this.streamPlayer.addEventListener("play",this.onStreamPlay),[google.ima.dai.api.StreamEvent.Type.LOADED,google.ima.dai.api.StreamEvent.Type.ERROR,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED].forEach(function(e){t.streamManager.addEventListener(e,t.onStreamEvent.bind(t))}),this.vjsPlayer.textTracks().onaddtrack=this.onAddTrack.bind(this),this.vjsPlayer.trigger({type:"stream-manager",StreamManager:this.streamManager}),this.requestStream()},ut.prototype.onAddTrack=function(t){var e=this,n=t.track;"metadata"===n.kind&&(n.mode="hidden",n.addEventListener("cuechange",function(t){var i,r=rt(n.activeCues);try{for(r.s();!(i=r.n()).done;){var o=i.value,s={};s[o.value.key]=o.value.data,e.streamManager.onTimedMetadata(s)}}catch(t){r.e(t)}finally{r.f()}}))},ut.prototype.createAdUiDiv=function(){var t=document.createElement("div");t.id="ad-ui",t.style.height="calc(100% - 3em)",this.streamPlayer.parentNode.appendChild(t),this.adUiDiv=t},ut.prototype.onStreamPause=function(){this.isAdBreak&&(this.adUiDiv.style.display="none")},ut.prototype.onStreamPlay=function(){this.isAdBreak&&(this.adUiDiv.style.display="block")},ut.prototype.onSeekEnd=function(t){if("live"!==this.daiController.getSettings().streamType)if(this.isSnapback)this.isSnapback=!1;else{var e=this.streamManager.previousCuePointForStreamTime(t);e&&!e.played&&(this.isSnapback=!0,this.snapForwardTime=t,this.vjsPlayer.currentTime(e.start))}},ut.prototype.onStreamEvent=function(t){switch(t.type){case google.ima.dai.api.StreamEvent.Type.LOADED:this.loadUrl(t.getStreamData().url);break;case google.ima.dai.api.StreamEvent.Type.ERROR:window.console.warn("Error loading stream, attempting to play backup stream. "+t.getStreamData().errorMessage),this.daiController.onErrorLoadingAds(t),this.daiController.getSettings().fallbackStreamUrl&&this.loadUrl(this.daiController.getSettings().fallbackStreamUrl);break;case google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED:this.isAdBreak=!0,this.adUiDiv.style.display="block",this.daiController.onAdBreakStart();break;case google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED:this.isAdBreak=!1,this.adUiDiv.style.display="none",this.daiController.onAdBreakEnd(),this.snapForwardTime&&this.snapForwardTime>this.vjsPlayer.currentTime()&&(this.vjsPlayer.currentTime(this.snapForwardTime),this.snapForwardTime=0)}},ut.prototype.loadUrl=function(t){this.vjsPlayer.ready(function(){var e=this.daiController.getSettings().streamFormat;this.vjsPlayer.src({src:t,type:this.SOURCE_TYPES[e]});var n=this.daiController.getSettings().bookmarkTime;if(n){var i=this.streamManager.streamTimeForContentTime(n);this.isSnapback=!0,this.vjsPlayer.currentTime(i)}}.bind(this))},ut.prototype.requestStream=function(){var t,e=this.daiController.getSettings().streamType;if("vod"===e?((t=new google.ima.dai.api.VODStreamRequest).contentSourceId=this.daiController.getSettings().cmsId,t.videoId=this.daiController.getSettings().videoId):"live"===e?(t=new google.ima.dai.api.LiveStreamRequest).assetKey=this.daiController.getSettings().assetKey:window.console.warn("No valid stream type selected"),t.format=this.daiController.getSettings().streamFormat,this.daiController.getSettings().apiKey&&(t.apiKey=this.daiController.getSettings().apiKey),this.daiController.getSettings().authToken&&(t.authToken=this.daiController.getSettings().authToken),this.daiController.getSettings().adTagParameters&&(t.adTagParameters=this.daiController.getSettings().adTagParameters),this.daiController.getSettings().streamActivityMonitorId&&(t.streamActivityMonitorId=this.daiController.getSettings().streamActivityMonitorId),this.daiController.getSettings().omidMode){t.omidAccessModeRules={};var n=this.daiController.getSettings().omidMode;n.FULL&&(t.omidAccessModeRules[google.ima.OmidAccessMode.FULL]=n.FULL),n.DOMAIN&&(t.omidAccessModeRules[google.ima.OmidAccessMode.DOMAIN]=n.DOMAIN),n.LIMITED&&(t.omidAccessModeRules[google.ima.OmidAccessMode.LIMITED]=n.LIMITED)}this.streamManager.requestStream(t),this.vjsPlayer.trigger({type:"stream-request",StreamRequest:t})},ut.prototype.onPlayerReady=function(){this.initImaDai()},ut.prototype.onPlayerDisposed=function(){this.streamManager&&this.streamManager.reset()},ut.prototype.addEventListener=function(t,e){this.streamManager&&this.streamManager.addEventListener(t,e)},ut.prototype.getStreamManager=function(){return this.streamManager},ut.prototype.reset=function(){this.streamManager&&this.streamManager.reset()};var ct=function(t,e){this.inAdBreak=!1,this.settings={},this.isMobile=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i),this.isIos=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i),this.initWithSettings(e);var n={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},i=Object.assign({},n,e.contribAdsSettings||{});this.playerWrapper=new ht(t,i,this),this.sdkImpl=new ut(this)};ct.IMA_DEFAULTS={adLabel:"Advertisement",adLabelNofN:"of",debug:!1,disableAdControls:!1,showControlsForJSAds:!0},ct.prototype.initWithSettings=function(t){this.settings=Object.assign({},ct.IMA_DEFAULTS,t||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,!1===this.settings.showCountdown&&(this.showCountdown=!1)},ct.prototype.warnAboutDeprecatedSettings=function(){var t=this;[].forEach(function(e){void 0!==t.settings[e]&&console.warn("WARNING: videojs.imaDai setting "+e+" is deprecated")})},ct.prototype.getSettings=function(){return this.settings},ct.prototype.getIsMobile=function(){return this.isMobile},ct.prototype.getIsIos=function(){return this.isIos},ct.prototype.getStreamPlayer=function(){return this.playerWrapper.getStreamPlayer()},ct.prototype.getVjsPlayer=function(){return this.playerWrapper.getVjsPlayer()},ct.prototype.requestStream=function(){this.sdkImpl.requestStream()},ct.prototype.setSetting=function(t,e){this.settings[t]=e},ct.prototype.onErrorLoadingAds=function(t){this.playerWrapper.onAdError(t)},ct.prototype.onAdError=function(t){this.playerWrapper.onAdError(t)},ct.prototype.onAdBreakStart=function(){this.inAdBreak=!0,this.playerWrapper.onAdBreakStart()},ct.prototype.onAdBreakEnd=function(){this.inAdBreak=!1,this.playerWrapper.onAdBreakEnd()},ct.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()},ct.prototype.isInAdBreak=function(){return this.inAdBreak},ct.prototype.onSeekEnd=function(t){this.sdkImpl.onSeekEnd(t)},ct.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()},ct.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset()},ct.prototype.addEventListener=function(t,e){this.sdkImpl.addEventListener(t,e)},ct.prototype.getStreamManager=function(){return this.sdkImpl.getStreamManager()},ct.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()},ct.prototype.streamWillAutoplay=function(){return void 0!==this.settings.streamWillAutoplay?this.settings.streamWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay},ct.prototype.triggerPlayerEvent=function(t,e){this.playerWrapper.triggerPlayerEvent(t,e)};var pt=function(t,e){this.controller=new At(t,e),this.addContentAndAdsEndedListener=function(t){this.controller.addContentAndAdsEndedListener(t)}.bind(this),this.addContentEndedListener=function(t){this.controller.addContentEndedListener(t)}.bind(this),this.addEventListener=function(t,e){this.controller.addEventListener(t,e)}.bind(this),this.changeAdTag=function(t){this.controller.changeAdTag(t)}.bind(this),this.getAdsManager=function(){return this.controller.getAdsManager()}.bind(this),this.initializeAdDisplayContainer=function(){this.controller.initializeAdDisplayContainer()}.bind(this),this.pauseAd=function(){this.controller.pauseAd()}.bind(this),this.playAdBreak=function(){this.controller.playAdBreak()}.bind(this),this.requestAds=function(){this.controller.requestAds()}.bind(this),this.resumeAd=function(){this.controller.resumeAd()}.bind(this),this.setAdBreakReadyListener=function(t){this.controller.setAdBreakReadyListener(t)}.bind(this),this.setContentWithAdTag=function(t,e){this.controller.setContentWithAdTag(t,e)}.bind(this),this.setContentWithAdsResponse=function(t,e){this.controller.setContentWithAdsResponse(t,e)}.bind(this),this.setContentWithAdsRequest=function(t,e){this.controller.setContentWithAdsRequest(t,e)}.bind(this),this.setShowCountdown=function(t){this.controller.setShowCountdown(t)}.bind(this)},gt=function(t,e){this.controller=new ct(t,e),this.streamEndedListener=function(t){this.controller.addStreamEndedListener(t)}.bind(this),this.addEventListener=function(t,e){this.controller.addEventListener(t,e)}.bind(this),this.getStreamManager=function(){return this.controller.getStreamManager()}.bind(this)},yt=it(function t(e,n){nt(this,t),"hls"===(e=e.toLowerCase())||"dash"===e?"dash"!==e?"string"==typeof n?(this.streamFormat=e,this.assetKey=n):window.console.error("assetKey error: value must be string."):window.console.error("streamFormat error: DASH streams are notcurrently supported by this plugin."):window.console.error("VodStream error: incorrect streamFormat.")}),mt=it(function t(e,n,i){nt(this,t),"hls"===(e=e.toLowerCase())||"dash"===e?"dash"!==e?"string"==typeof n?"string"==typeof i?(this.streamFormat=e,this.cmsId=n,this.videoId=i):window.console.error("videoId error: value must be string."):window.console.error("cmsId error: value must be string."):window.console.error("streamFormat error: DASH streams are notcurrently supported by this plugin."):window.console.error("VodStream error: incorrect streamFormat.")}),ft=r().registerPlugin||r().plugin;ft("ima",function(t){this.ima=new pt(this,t)}),ft("imaDai",function(t,e){if(t instanceof yt)e.streamType="live",e.assetKey=t.assetKey;else{if(!(t instanceof mt))return void window.console.error("initDai() first parameter must be an instance of LiveStream or VodStream.");e.streamType="vod",e.cmsId=t.cmsId,e.videoId=t.videoId}e.streamFormat=t.streamFormat,this.imaDai=new gt(this,e)})},7509:(t,e,n)=>{var i,r=void 0!==n.g?n.g:"undefined"!=typeof window?window:{},o=n(4626);"undefined"!=typeof document?i=document:(i=r["__GLOBAL_DOCUMENT_CACHE@4"])||(i=r["__GLOBAL_DOCUMENT_CACHE@4"]=o),t.exports=i},5204:(t,e,n)=>{var i;i="undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},t.exports=i},4626:()=>{}}]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cloudinary Video Player v3.6.
|
|
3
|
-
* Built on 2025-12-
|
|
2
|
+
* Cloudinary Video Player v3.6.4-edge.0
|
|
3
|
+
* Built on 2025-12-15T17:25:36.409Z
|
|
4
4
|
* https://github.com/cloudinary/cloudinary-video-player
|
|
5
5
|
*/
|
|
6
6
|
(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[404,691],{9454:(t,e,o)=>{"use strict";o.d(e,{default:()=>c,w:()=>i});var n=o(7764);const a={colorsDark:{base:"#000000",accent:"#0D9AFF",text:"#FFFFFF"},colorsLight:{base:"#FFFFFF",accent:"#0D9AFF",text:"#000000"}},i=t=>(0,n.T4)(t)?a.colorsLight:a.colorsDark,c=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=i(t.options_);e.colors=Object.assign({},o,e.colors);const n=t.el();return e.colors.base&&n.style.setProperty("--color-base",e.colors.base),e.colors.accent&&n.style.setProperty("--color-accent",e.colors.accent),e.colors.text&&n.style.setProperty("--color-text",e.colors.text),{updateColors:t=>{const o=Object.assign({},e.colors,t);o.base&&n.style.setProperty("--color-base",o.base),o.accent&&n.style.setProperty("--color-accent",o.accent),o.text&&n.style.setProperty("--color-text",o.text),e.colors=o},getColors:()=>e.colors}}},9017:(t,e,o)=>{"use strict";o.d(e,{F0:()=>c,Fg:()=>i,IT:()=>r,T$:()=>l,Vv:()=>d,Yx:()=>s,be:()=>a,q3:()=>u,sb:()=>n});const n="cld-ia-layout-state",a="vp-ia",i="interaction-areas-container",c={PORTRAIT:"portrait",LANDSCAPE:"landscape",All:"all",CENTER:"center"},r={PULSING:"pulsing",SHADOWED:"shadowed"},s={[c.PORTRAIT]:"https://res.cloudinary.com/prod/raw/upload/v1623772481/video-player/vtts/portrait.vtt",[c.LANDSCAPE]:"https://res.cloudinary.com/prod/raw/upload/v1623772303/video-player/vtts/landscape.vtt",[c.All]:"https://res.cloudinary.com/prod/raw/upload/v1623250266/video-player/vtts/all.vtt",[c.CENTER]:"https://res.cloudinary.com/prod/raw/upload/v1623250265/video-player/vtts/center.vtt"},l="https://res.cloudinary.com/prod/image/upload/v1626764643/video-player/interaction-area-hand.svg",d=4500,u=250},1066:(t,e,o)=>{"use strict";o.d(e,{interactionAreasService:()=>j});var n=o(6673),a=o.n(n),i=o(2832),c=o.n(i),r=o(2858),s=o.n(r),l=o(5114),d=o.n(l),u=o(9017),v=o(7134),p=o(9454);const h=t=>{let{text:e,onClick:o,theme:n="",loadingDelay:a=0}=t;return(0,v.It)({tag:"button",attr:{class:"vp-theme-button theme-".concat(n)},onClick:o,children:[{tag:"div",attr:{class:"vp-loading-bar"},style:{"animation-duration":"".concat(a,"ms")}},{tag:"div",attr:{class:"content"},children:e}]})},f="transparent-white",m=(t,e)=>t.id||t.type||"id_".concat(e),g=(t,e,o,n,a)=>{let{playerOptions:i,videojsOptions:r}=t;const s=(0,p.w)(r),l=i&&i.colors?i.colors.accent:s.accent,d=c()(r,"interactionDisplay.theme.template",u.IT.PULSING);return(0,v.It)({tag:"div",attr:{class:"".concat(u.be,"-item theme-").concat(d),"data-id":m(e,o)},style:{left:"".concat(e.left,"%"),top:"".concat(e.top,"%"),width:"".concat(e.width,"%"),height:"".concat(e.height,"%"),transitionDuration:"".concat(n,"ms")},event:{name:"click",callback:a},children:[{tag:"div",attr:{class:"".concat(u.be,"-area-marker")},children:[{tag:"div",attr:{class:"".concat(u.be,"-marker-shadow")},style:{[d===u.IT.SHADOWED?"backgroundColor":"borderColor"]:l}},{tag:"div",attr:{class:"".concat(u.be,"-marker-main")},style:{borderColor:l}}]}]})},y=(t,e)=>t/(100/+e),b=(t,e)=>{const o=w(t);o?o.replaceWith(e):t.el().appendChild(e)},x=(t,e,o)=>t.querySelector("[data-id=".concat(m(e,o),"]")),T=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d();localStorage.setItem(u.sb,JSON.parse(t)),e()},w=t=>t.el().querySelector(".".concat(u.Fg)),E=t=>{const e=w(t);e&&e.parentNode.removeChild(e)};var k=o(7764),C=o(1104);const j=(t,e,o)=>{let n=!1,i=null,r=null,l=d();const p=()=>{return t=o.interactionDisplay,c()(t,"layout.enable",!0)&&"true"!==localStorage.getItem(u.sb);var t};function j(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=A();return t||e&&e.enable}function D(){r&&t.videojs.removeRemoteTextTrack(r);const e=j(),o=A();if(!e||n)return null;if(Array.isArray(o.template))L(o.template),N();else{const e=o.vttUrl||u.Yx[o.template];e&&(r=(0,k.eo)(t.videojs,e),function(e){if(!e)return;let o=null;e.addEventListener("cuechange",()=>{const n=e.activeCues&&e.activeCues[0];if(n){const t=Math.max(Math.floor(1e3*(n.endTime-n.startTime)),u.q3),e=JSON.parse(n.text);L(e,o,t),!o&&N(),o=e}else E(t.videojs),o=null})}(r))}}function A(){const{cldSrc:t}=i;return t&&t.interactionAreas()}function F(){E(t.videojs),D(),t.play()}function O(){if(j())if(p()){let e=null;const n=c()(o,"interactionDisplay.layout.showAgain",!1);t.pause(),function(t,e){let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!1;const a="checkbox_".concat(Math.round(1e4*Math.random())),i=(0,v.It)({tag:"div",attr:{class:"".concat(u.Fg," ").concat(u.be,"-layout-message ").concat(o?"":"clickable")},onClick:o?null:()=>T(n,e),children:[{tag:"img",attr:{class:"".concat(u.be,"-layout-icon"),src:u.T$}},{tag:"h3",attr:{class:"".concat(u.be,"-layout-message-title")},children:"Tap on dots to zoom for a product."},h({text:"Got it",theme:f,loadingDelay:o?0:u.Vv,onClick:o?()=>T(n,e):null}),o&&{tag:"div",attr:{class:"".concat(u.be,"-layout-message-do-not-show")},children:[{tag:"input",attr:{type:"checkbox",class:"".concat(u.be,"-layout-message-checkbox"),id:a},event:{name:"input",callback:t=>{n=t.target.checked}}},{tag:"label",attr:{class:"".concat(u.be,"-layout-message-checkbox-title"),for:a},children:"Don׳t show it again"}]}].filter(t=>t)});b(t,i)}(t.videojs,()=>{clearTimeout(e),F()},n),n||(e=setTimeout(F,u.Vv))}else F()}function S(e,o,c){const r=t.currentTime(),s=(()=>{const t=A();return!(!t||void 0===t.syncOffsetTime)&&t.syncOffsetTime})(),{cldSrc:d}=i,p=d.getInitOptions(),h=o||{transformation:p.transformation},f=!e&&((t,e)=>{const{videoHeight:o,videoWidth:n}=t,a=y(n,e.left),i=y(o,e.top),c=y(n,e.width),r=y(o,e.height),s=n/o,l=c/r,d=Math.round(l>1||s>1?r*l:c),u=Math.round(d/s),v=Math.round(a-(d-c)/2),p=Math.round(i-(u-r)/2);return{width:d,height:u,x:Math.min(Math.max(v,0),n-d),y:Math.min(Math.max(p,0),o-u),crop:"crop"}})(t.videoElement,c),m=f?a().obj.merge({transformation:f},h):h,g=d.isRawUrl?i.src:{publicId:d.publicId()};t.source(f?{publicId:d.publicId()}:e,m).play(),s&&t.currentTime(r),n=!0,function(){const e=(0,v.n)("div",{class:"go-back-button"});e.addEventListener("click",()=>{l()},!1);const o=(0,v.n)("div",{class:u.Fg},e);b(t.videojs,o)}(),l=()=>{if(n){n=!1;const e=t.currentTime(),o=t.duration();t.source(g,p).play(),s&&e<o&&t.currentTime(e),D()}}}function I(t){let{event:e,item:o,index:n}=t;const a=A();a.onClick&&a.onClick({item:o,index:n,event:e,zoom:(t,e)=>{S(t,e,o)}})}function L(n,a){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const c={playerOptions:e,videojsOptions:o};if(a)((t,e,o,n,a,i)=>{const c=w(t);o.forEach((t,o)=>{const r=x(c,t,o),s=m(t),l=n.some(t=>m(t)===s);l&&r?(0,v.cu)(r,{left:"".concat(t.left,"%"),top:"".concat(t.top,"%"),width:"".concat(t.width,"%"),height:"".concat(t.height,"%"),transitionDuration:"".concat(a,"ms")}):l||r||c.appendChild(g(e,t,o,a,e=>{i({event:e,item:t,index:o})}))}),n.forEach((t,e)=>{const n=x(c,t,e),a=m(t),i=!o.some(t=>m(t)===a);n&&i&&n.parentNode.removeChild(n)})})(t.videojs,c,n,a,i,I);else{const e=n.map((t,e)=>g(c,t,e,i,o=>{I({event:o,item:t,index:e})}));b(t.videojs,(0,v.n)("div",{class:u.Fg},e))}}function N(){j()&&((t,e)=>{const o=w(t);if(!o)return;const{videoHeight:n,videoWidth:a}=e,i=a/n,c=i*e.clientHeight;o.style.width="".concat(e.clientWidth<c?"100%":c,"px"),o.style.height=e.clientWidth<c?"".concat(e.clientWidth/i,"px"):"100%"})(t.videojs,t.videoElement)}!function(){if(i=i||t.videojs.currentSource(),j()){t.videojs.el().classList.add("interaction-areas"),t.videojs.one(C.f.PLAY,()=>{"object"==typeof t.videojs.ima?t.on("adsready",()=>{t.videojs.ima.addEventListener(window.google.ima.AdEvent.Type.ALL_ADS_COMPLETED,O)}):O()});const e=s()(N,100);t.videojs.on(C.f.FULL_SCREEN_CHANGE,()=>{setTimeout(e,100)});const o=(0,v.q2)(window,"resize",N,!1);t.videojs.on(C.f.DISPOSE,o)}t.videojs.on(C.f.ENDED,()=>{l()}),t.videojs.on(C.f.ERROR,()=>{t.pause()})}()}},8812:(t,e,o)=>{var n=o(2140),a=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(a,""):t}},2140:t=>{var e=/\s/;t.exports=function(t){for(var o=t.length;o--&&e.test(t.charAt(o)););return o}},6177:(t,e,o)=>{var n=o(8953),a=o(3664),i=o(5378),c=Math.max,r=Math.min;t.exports=function(t,e,o){var s,l,d,u,v,p,h=0,f=!1,m=!1,g=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var o=s,n=l;return s=l=void 0,h=e,u=t.apply(n,o)}function b(t){var o=t-p;return void 0===p||o>=e||o<0||m&&t-h>=d}function x(){var t=a();if(b(t))return T(t);v=setTimeout(x,function(t){var o=e-(t-p);return m?r(o,d-(t-h)):o}(t))}function T(t){return v=void 0,g&&s?y(t):(s=l=void 0,u)}function w(){var t=a(),o=b(t);if(s=arguments,l=this,p=t,o){if(void 0===v)return function(t){return h=t,v=setTimeout(x,e),f?y(t):u}(p);if(m)return clearTimeout(v),v=setTimeout(x,e),y(p)}return void 0===v&&(v=setTimeout(x,e)),u}return e=i(e)||0,n(o)&&(f=!!o.leading,d=(m="maxWait"in o)?c(i(o.maxWait)||0,e):d,g="trailing"in o?!!o.trailing:g),w.cancel=function(){void 0!==v&&clearTimeout(v),h=0,s=p=l=v=void 0},w.flush=function(){return void 0===v?u:T(a())},w}},5114:t=>{t.exports=function(){}},3664:(t,e,o)=>{var n=o(1433);t.exports=function(){return n.Date.now()}},2858:(t,e,o)=>{var n=o(6177),a=o(8953);t.exports=function(t,e,o){var i=!0,c=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return a(o)&&(i="leading"in o?!!o.leading:i,c="trailing"in o?!!o.trailing:c),n(t,e,{leading:i,maxWait:e,trailing:c})}},5378:(t,e,o)=>{var n=o(8812),a=o(8953),i=o(5414),c=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(a(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=a(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var o=r.test(t);return o||s.test(t)?l(t.slice(2),o?2:8):c.test(t)?NaN:+t}}}]);
|
package/dist/playlist.js
CHANGED
package/dist/playlist.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cloudinary Video Player v3.6.
|
|
3
|
-
* Built on 2025-12-
|
|
2
|
+
* Cloudinary Video Player v3.6.4-edge.0
|
|
3
|
+
* Built on 2025-12-15T17:25:36.409Z
|
|
4
4
|
* https://github.com/cloudinary/cloudinary-video-player
|
|
5
5
|
*/
|
|
6
6
|
(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[33],{5826:(t,e,r)=>{"use strict";r.d(e,{default:()=>lt});var i=r(5871),n=r(1104),s=r(1865),o=r(3686),l=r.n(o),a=r(4679),c=r.n(a);const u=[1,4,5,6,7,10,11],p=["created_at","updated_at"],d=t=>{const e={};return c()(t)?(Object.keys(t).reduce((e,r)=>{const i=l()(r);return-1!==p.indexOf(r)?e[i]=new Date(function(t){let e=0,r=0,i=0;if(r=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec(t)){for(let t,e=0;t=u[e];++e)r[t]=+r[t]||0;r[2]=(+r[2]||1)-1,r[3]=+r[3]||1,"Z"!==r[8]&&void 0!==r[9]&&(i=60*r[10]+r[11],"+"===r[9]&&(i=0-i)),e=Date.UTC(r[1],r[2],r[3],r[4],r[5]+i,r[6],r[7])}else e=NaN;return e}(t[r])):e[i]=d(t[r]),e},e),e):Array.isArray(t)?t.map(t=>d(t)):t};var h=r(5381),m=r(4466),g=r.n(m),y=r(6673),f=r.n(y);function v(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const _=f().dom||f(),b=f().getComponent("Component"),C=f().getComponent("ClickableComponent");class x extends C{constructor(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];super(t,...r),v(this,"_hide",()=>{this.removeClass(x.VJS_UPCOMING_VIDEO_SHOW)}),v(this,"_onPlaylistItemChange",(t,e)=>{this._hide(),this._disableTransition(()=>{e.next&&this.setItem(e.next)})}),v(this,"_show",()=>{const t=this.player().ima,e="object"===t&&t.getAdsManager();e&&e.getCurrentAd()&&!e.getCurrentAd().isLinear()||this.addClass(x.VJS_UPCOMING_VIDEO_SHOW)}),this._setEvents(t)}_setEvents(t){t.on(n.f.UP_COMING_VIDEO_SHOW,this._show),t.on(n.f.UP_COMING_VIDEO_HIDE,this._hide),t.on(n.f.PLAYLIST_ITEM_CHANGED,this._onPlaylistItemChange)}_disableTransition(t){this.addClass(x.DISABLE_TRANSITION_CLASS),t(),this.removeClass(x.DISABLE_TRANSITION_CLASS)}setTitle(t){this.getChild("upcomingVideoOverlayContent").getChild("upcomingVideoOverlayBar").getChild("upcomingVideoOverlayTitle").setContent(t.info().title||t.publicId())}setItem(t){this._source=t;const e=parseInt(window.getComputedStyle(this.el(),null).getPropertyValue("max-width"),10),r={crop:"pad",background:"auto:predominant",width:e,height:Math.round(e*(9/16))},i=this.getChild("upcomingVideoOverlayContent");this.setTitle(t),i.el().style.backgroundImage='url("'.concat(this._source.poster().url({transformation:r}),'")')}handleClick(){super.handleClick(event),this.player().cloudinary.playlist().playNext()}createEl(){return super.createEl("div",{className:"vjs-upcoming-video"})}}v(x,"DISABLE_TRANSITION_CLASS","disable-transition"),v(x,"VJS_UPCOMING_VIDEO_SHOW","vjs-upcoming-video-show");class w extends b{createEl(){return super.createEl("div",{className:"upcoming-video-overlay aspect-ratio-content"})}}class I extends b{createEl(){return super.createEl("div",{className:"vjs-upcoming-video-bar"})}}x.prototype.options_={children:["upcomingVideoOverlayContent"]},f().registerComponent("upcomingVideoOverlay",x),w.prototype.options_={children:["upcomingVideoOverlayBar"]},f().registerComponent("upcomingVideoOverlayContent",w),I.prototype.options_={children:["upcomingVideoOverlayTitle","playlistNextButton"]},f().registerComponent("upcomingVideoOverlayBar",I),f().registerComponent("upcomingVideoOverlayTitle",class extends b{setContent(t){this._contentSpan.innerText=t}createEl(){const t=super.createEl("div",{className:"vjs-control vjs-upcoming-video-title"}),e=_.createEl("div",{className:"vjs-upcoming-video-title-display",innerHTML:'<span class="vjs-control-text">Next up</span>Next up: '});return this._contentSpan=_.createEl("span",{className:"vjs-upcoming-video-title-display-label"}),e.appendChild(this._contentSpan),t.appendChild(e),t}});const O=f().getComponent("ClickableComponent");const P=class extends O{constructor(t,e){super(t,e);const r=e.type;if(!r&&"previous"!==r&&"next"!==r)throw new Error("Type must be either 'previous' or 'next'")}createEl(){const t=this.options_.type,e="vjs-icon-".concat(t,"-item");return f().dom.createEl("button",{className:"vjs-control vjs-playlist-button vjs-button ".concat(e),ariaLabel:"Playlist ".concat(t," item")})}};class E extends P{constructor(t){super(t,{type:"next"})}handleClick(t){t.stopPropagation(),super.handleClick(t),this.player().cloudinary.playlist().playNext()}}f().registerComponent("PlaylistNextButton",E);class A extends P{constructor(t){super(t,{type:"previous"})}handleClick(t){super.handleClick(t),this.player().cloudinary.playlist().playPrevious()}}f().registerComponent("PlaylistPreviousButton",A);const j={fluid:!1,show:!0,direction:"vertical",total:4,selector:!1,renderTo:[]};function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?T(Object(r),!0).forEach(function(e){N(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function N(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const U=class{constructor(t){var e=this;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],{repeat:i=!1,autoAdvance:n=!1,presentUpcoming:s=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};N(this,"playlistByTag",function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.player().sourcesByTag(t,r).then(t=>e.player().playlist(t,r))}),this._context=t,this._sources=[],this._defaultRecResolverCache={},this._currentIndex=null,this._recommendationsHandler=null,this._autoAdvance=null,this._presentUpcoming=null,this.addUiComponents(),this.resetState=()=>{this.repeat(i),this.autoAdvance(n),this.presentUpcoming(s)},r.forEach(t=>this.enqueue(t)),this.resetState()}list(){return this._sources}player(){return this._context.player}addUiComponents(){const t=this.player().getChild("ControlBar"),e=t.children();t.addChild("playlistPreviousButton",{},e.findIndex(t=>"PlayToggle"===t.name_)),t.addChild("playlistNextButton",{},e.findIndex(t=>"PlayToggle"===t.name_)+1),this.player().addChild("upcomingVideoOverlay")}presentUpcoming(t){if(this._presentUpcoming=this._presentUpcoming||{},void 0===t)return this._presentUpcoming.delay;if(!0===t)t=10;else if(!1===t)t=!1;else if(!g()(t)||t<0)throw new Error("presentUpcoming 'delay' must be either a boolean or a positive integer.");return this._presentUpcoming.delay=t,this._setupPresentUpcoming(),this._presentUpcoming.delay}autoAdvance(t){if(this._autoAdvance=this._autoAdvance||{},void 0===t)return this._autoAdvance.delay;if(!0===t)t=0;else if(!1===t)t=!1;else if(!g()(t)||t<0)throw new Error("Auto advance 'delay' must be either a boolean or a positive integer.");return this._autoAdvance.delay=t,this._setupAutoAdvance(),this._autoAdvance.delay}_setupAutoAdvance(){this._resetAutoAdvance();const t=this._autoAdvance.delay;if(!1===t)return;this._autoAdvance={delay:t,trigger:()=>{this.player().ended()&&(this._autoAdvance.timeout=setTimeout(()=>{this.playNext()},1e3*t))}},this._context.on("ended",this._autoAdvance.trigger)}dispose(){this._resetAutoAdvance(),this._resetPresentUpcoming(),this._resetRecommendations()}_resetPresentUpcoming(){this.player().trigger("upcomingvideohide"),this._presentUpcoming||(this._presentUpcoming={}),this._presentUpcoming.trigger&&this._context.off("timeupdate",this._presentUpcoming.trigger),this._presentUpcoming.trigger=null,this._presentUpcoming.showTriggered=!1}_setupPresentUpcoming(){this._resetPresentUpcoming();!1!==this._presentUpcoming.delay&&(this._presentUpcoming.trigger=()=>{const t=this.player().currentTime(),e=this.player().duration()-t;e<1.5?this._presentUpcoming.showTriggered&&(this.player().trigger("upcomingvideohide"),this._presentUpcoming.showTriggered=!1):e<=this._presentUpcoming.delay&&!this._presentUpcoming.showTriggered&&!this.player().loop()?(this.player().trigger("upcomingvideoshow"),this._presentUpcoming.showTriggered=!0):this._presentUpcoming.showTriggered&&(e>this._presentUpcoming.delay||this.player().loop())&&(this.player().trigger("upcomingvideohide"),this._presentUpcoming.showTriggered=!1)},this._context.on("timeupdate",this._presentUpcoming.trigger))}_resetAutoAdvance(){this._autoAdvance||(this._autoAdvance={}),this._autoAdvance.timeout&&clearTimeout(this._autoAdvance.timeout),this._autoAdvance.trigger&&this._context.off("ended",this._autoAdvance.trigger),this._autoAdvance.timeout=null,this._autoAdvance.trigger=null}_resetRecommendations(){this._recommendationsHandler&&this._context.off("ended",this._recommendationsHandler)}_refreshRecommendations(){this._resetRecommendations(),this._recommendationsHandler=()=>{!1===this.autoAdvance()&&this._context.autoShowRecommendations()&&this.player().trigger("recommendationsshow")},this._context.on("ended",this._recommendationsHandler)}_refreshTextTracks(){this.player().trigger("refreshTextTracks",this.currentSource().textTracks())}_recommendationItemBuilder(t){const e=this._defaultRecResolverCache[t.objectId];if(!t.recommendations()||e&&t.recommendations()===e)return t=>({source:t,action:()=>this.playItem(t)})}currentIndex(t){if(void 0===t)return this._currentIndex;if(t>=this.length()||t<0)throw new Error("Invalid playlist index.");this._currentIndex=t;const e=this.currentSource(),r=this._recommendationItemBuilder(e);e.recommendations()||e.recommendations(this._defaultRecommendationsResolver(e));const i=e.getInitOptions?e.getInitOptions():{};this._context.source(e,S(S({},i),{},{recommendationOptions:{disableAutoShow:!0,itemBuilder:r}}));const n={playlist:this,current:e,next:this.next()};return this.player().trigger("playlistitemchanged",n),this._refreshRecommendations(),this._refreshTextTracks(),e}_defaultRecommendationsResolver(t){const e=this._defaultRecResolverCache[t.objectId];return e||(this._defaultRecResolverCache[t.objectId]=()=>{let e=this.list().indexOf(t);const r=[],i=Math.min(4,this.length()-1);for(;r.length<i&&(e=this.nextIndex(e),-1!==e);){const t=this.list()[e];r.push(t)}return r},this._defaultRecResolverCache[t.objectId])}buildSource(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._context.buildSource(t,e)}enqueue(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=t instanceof h.A?t:this.buildSource(t,e);return this._sources.push(r),r}playItem(t){let e=this.list().indexOf(t);if(-1===e)throw new Error("Invalid playlist item.");this.playAtIndex(e)}playAtIndex(t){return this.currentIndex(t),this.player().play(),this.currentSource()}currentSource(){return this.list()[this.currentIndex()]}removeAt(t){if(t>=this.length()||t<0)throw new Error("Invalid playlist index.");return this._sources.splice(t,1),this}repeat(t){return void 0===t||(this._repeat=!!t),this._repeat}first(){return this.list()[0]}last(){return this.list()[this.length()-1]}next(){const t=this.nextIndex();return-1===t?null:this.list()[t]}nextIndex(t){if((t=void 0!==t?t:this.currentIndex())>=this.length()||t<0)throw new Error("Invalid playlist index.");let e=t+1;if(t===this.length()-1){if(!this.repeat())return-1;e=0}return e}previousIndex(){return this.isFirst()?-1:this.currentIndex()-1}playFirst(){return this.playAtIndex(0)}playLast(){const t=this.list().length-1;return this.playAtIndex(t)}isLast(){return this.currentIndex()>=this.length()-1}isFirst(){return 0===this.currentIndex()}length(){return this.list().length}playNext(){let t=this.nextIndex();return-1===t?null:this.playAtIndex(t)}playPrevious(){let t=this.previousIndex();return-1===t?null:this.playAtIndex(t)}},L=(t,e)=>(t.parentNode.insertBefore(e,t),e.appendChild(t),e);var D=r(3066);function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach(function(e){V(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function V(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const B=f().dom||f(),H=f().getComponent("Component"),F={wrap:!1};class M extends H{constructor(t,e){const r=R(R({},F),e);super(t,r),this.player_=t;const i=(t,e)=>{this.options_.fluid=e,this.removeCls(),this.setCls()},s=()=>{const t=this.el();this.videoWrap_=B.createEl("div",{className:"cld-plw-col-player"}),this.contentEl_=this.contentEl_=B.createEl("div",{className:"cld-plw-col-list"}),L(this.player().el(),t),t.appendChild(this.videoWrap_),t.appendChild(this.contentEl_),L(this.player().el(),this.videoWrap_)};r.wrap&&s(),t.on(n.f.FLUID,i),this.addChild(n.f.PLAYLIST_PANEL,this.options_),this.setCls(),this.dispose=()=>{this.removeLayout(),super.dispose(),t.off(n.f.FLUID,i)}}getCls(){let t=["cld-video-player","cld-plw-layout"];return t.push((0,D.skinClassPrefix)(this.player())),t.push((0,D.playerClassPrefix)(this.player())),this.options_.fluid&&t.push("cld-plw-layout-fluid"),t}setCls(){this.removeClass((0,D.skinClassPrefix)(this.player())),this.getCls().forEach(t=>{this.addClass(t)})}removeCls(){this.getCls().forEach(t=>{this.removeClass(t)})}update(t,e){this.options(e),this.removeChild("PlaylistPanel"),this.addChild("PlaylistPanel",this.options_),this.trigger("playlistlayoutupdate")}removeLayout(){const t=this.el().parentElement;t&&t.appendChild(this.player().el())}createEl(){const t=super.createEl("div");return t.style.fontFamily=this.player().el().style.fontFamily,t}}f().registerComponent("playlistLayout",M);const W=M;const G=class extends W{constructor(t,e){e.wrap=!0,super(t,e)}getCls(){const t=super.getCls();return t.push("cld-plw-horizontal"),t}};const z=class extends W{constructor(t,e){e.wrap=!0,super(t,e)}getCls(){const t=super.getCls();return t.push("cld-plw-vertical"),t}};const Y=class extends W{getCls(){let t=super.getCls();return t.push("cld-plw-custom"),t}createEl(){const t=super.createEl();return this.options_.renderTo.appendChild(t),t}};function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function q(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach(function(e){J(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function J(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const Z=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=((t,e)=>{const r=q(q({},j),e);if(r.show&&"string"==typeof r.selector&&(r.useDefaultLayout=!1,r.useCustomLayout=!0,r.renderTo=document.querySelector(r.selector),r.showAll=!0,0===!r.renderTo.length))throw new Error("Couldn't find element(s) by selector '".concat(r.selector,"' for playlist"));return r.show&&!r.selector&&(r.useDefaultLayout=!0,r.useCustomLayout=!1),r.direction="horizontal"===r.direction.toLowerCase()?"horizontal":"vertical",r.skin=t.options_.skin,r})(t,e),this.options_=e,this.player_=t,this.render();const r=(t,e)=>{this.options_.fluid=e};t.on(n.f.FLUID,r),this.options=e=>e?(this.options_=f().obj.merge(this.options_,e),t.trigger("playlistwidgetoption",this.options_.playlistWidget),this.options_):this.options_,this.dispose=()=>{this.layout_.dispose(),t.off(n.f.FLUID,r)}}render(){this.options_.useDefaultLayout&&("horizontal"===this.options_.direction?this.layout_=new G(this.player_,this.options_):this.layout_=new z(this.player_,this.options_)),this.options_.useCustomLayout&&(this.layout_=new Y(this.player_,this.options_))}getLayout(){return this.layout_}update(t,e){this.options(e),"direction"===t?(this.layout_.removeLayout(),this.layout_.dispose(),this.render()):this.layout_.update(t,this.options_)}setSkin(){this.layout_.setCls()}total(){const t=parseInt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:j.total,10);return t!==this.options_.total&&"number"==typeof t&&t>0&&this.update("total",{total:t}),this}direction(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j.direction;return"horizontal"!==t&&"vertical"!==t||this.update("direction",{direction:t}),this}},K=f().getComponent("ClickableComponent"),Q={item:null,transformation:{width:300,aspect_ratio:"16:9",crop:"pad",background:"black"}};const X=class extends K{constructor(t,e){super(t,f().obj.merge(Q,e))}getItem(){return this.options_.item}getTitle(){return this.getItem().info().title}getDuration(){return" "}getThumbnail(){return this.getItem().poster().url({transformation:this.options_.transformation})}handleClick(t){t.preventDefault()}createControlTextEl(){}createEl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"a";const e=super.createEl(t,{className:"cld-thumbnail",href:"#"}),r=super.createEl("img",{className:"cld-thumbnail-img",src:this.getThumbnail()});return e.appendChild(r),e.style.backgroundImage="url('".concat(this.getThumbnail(),"')"),e}},tt=f().dom||f(),et={source:null,next:!1};class rt extends X{constructor(t,e){super(t,f().obj.merge(et,e))}handleClick(t){super.handleClick(t),this.play()}play(){const t=this.getItem(),e=this.player().cloudinary.playlist().list().indexOf(t);if(-1===e)throw new Error("Invalid playlist item...");this.player().cloudinary.playlist().playAtIndex(e)}isCurrent(){return this.options_.current}getTitle(){return super.getTitle()}getDuration(){return super.getDuration()}createEl(){const t=super.createEl();t.classList.add("cld-plw-panel-item");const e=tt.createEl("div",{className:"cld-plw-item-info-wrap"}),r=tt.createEl("div",{className:"cld-plw-item-title"});if(this.isCurrent()){t.classList.add("cld-plw-panel-item-active");const e=tt.createEl("span",{className:"cld-plw-item-title-curr"},{},"Now Playing: ");r.appendChild(e)}const i=tt.createEl("span",{className:"cld-plw-item-title"},{},this.getTitle());r.appendChild(i);const n=tt.createEl("div",{className:"cld-plw-item-duration"},{},this.getDuration());return e.appendChild(r),e.appendChild(n),t&&t.appendChild(e),t.appendChild(e),t}}f().registerComponent("playlistPanelItem",rt);const it=rt,nt=f().getComponent("Component");class st extends nt{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});const e=()=>{this.render()};t.on(n.f.PLAYLIST_ITEM_CHANGED,e),this.render(),this.dispose=()=>{super.dispose(),t.off(n.f.PLAYLIST_ITEM_CHANGED,e)}}createEl(){const t=super.createEl();return t.classList.add("cld-plw-panel"),t}removeAll(){const t=this.children();for(let e=t.length-1;e>=0;--e)this.removeChild(t[e])}getItems(){const t=this.player().cloudinary.playlist(),e=t._repeat;if(this.options_.showAll)return t.list();const r=[],i=this.options_.total;let n=t.currentIndex(),s=t.list()[n];for(r.push(s);r.length<i;){if(n=t.nextIndex(n),-1===n){if(!e&&r.length>0)break;n=0}s=t.list()[n],r.push(s)}return r}render(){const t=this.getItems();this.removeAll(),t.forEach((t,e)=>{const r=new it(this.player(),f().obj.merge(this.options_,{item:t,next:1===e,current:0===e}));this.addChild(r)})}}f().registerComponent("playlistPanel",st);const ot={format:"json",resource_type:"video",type:"list"},lt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(0,i.sliceProperties)(e,"chainTarget").chainTarget;let o=null,l=null,a=null;const c=()=>{t.on(n.f.PLAYLIST_CREATED,()=>{var r;a&&a.dispose(),0!=(null===(r=e.playlistWidget)||void 0===r?void 0:r.show)&&(t.fluid_&&(e.playlistWidget.fluid=!0),t.cloudinary.fontFace&&(e.playlistWidget.fontFace=t.cloudinary.fontFace),a=new Z(t,e.playlistWidget))})},u=(e,r)=>{e instanceof U?(o=e,o.resetState(),o.currentIndex(o.currentIndex())):(o=new U(t.cloudinary,e,r),o.currentIndex(0)),c(),l=(()=>{const e=()=>{o&&!o.currentSource().contains(t.currentSource())&&t.disposePlaylist()};return t.on("cldsourcechanged",e),e})(),t.addClass("vjs-playlist")};return t.cloudinary.sourcesByTag=async function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=(0,s.KA)(e,Object.assign({},t.cloudinary.cloudinaryConfig(),ot)),n=await fetch(i),o=await n.json(),l=d(o.resources);r.sorter&&l.sort(r.sorter);return l.map(e=>{let i=r.sourceParams||{};"function"==typeof i&&(i=i(e));const n=e.context&&e.context.custom||{},s=Object.assign({info:n},i,{publicId:e.publicId});return t.cloudinary.buildSource(s)})},function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return void 0===e?o:(o&&(t.removeClass("vjs-playlist"),o=void 0,t.playlist().dispose(),t.off("cldsourcechanged",l)),u(e,i),t.trigger("playlistcreated"),r)}}},8812:(t,e,r)=>{var i=r(2140),n=/^\s+/;t.exports=function(t){return t?t.slice(0,i(t)+1).replace(n,""):t}},2140:t=>{var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},4466:(t,e,r)=>{var i=r(1826);t.exports=function(t){return"number"==typeof t&&t==i(t)}},4764:(t,e,r)=>{var i=r(5378),n=1/0;t.exports=function(t){return t?(t=i(t))===n||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},1826:(t,e,r)=>{var i=r(4764);t.exports=function(t){var e=i(t),r=e%1;return e==e?r?e-r:e:0}},5378:(t,e,r)=>{var i=r(8812),n=r(8953),s=r(5414),o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,a=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(s(t))return NaN;if(n(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=n(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=i(t);var r=l.test(t);return r||a.test(t)?c(t.slice(2),r?2:8):o.test(t)?NaN:+t}}}]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cloudinary Video Player v3.6.
|
|
3
|
-
* Built on 2025-12-
|
|
2
|
+
* Cloudinary Video Player v3.6.4-edge.0
|
|
3
|
+
* Built on 2025-12-15T17:25:36.409Z
|
|
4
4
|
* https://github.com/cloudinary/cloudinary-video-player
|
|
5
5
|
*/
|
|
6
6
|
"use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[410],{7604:(t,e,s)=>{s.r(e),s.d(e,{default:()=>k});var i=s(6673),n=s.n(i);const o=n().getComponent("ClickableComponent");const r=class extends o{setItem(t){const{action:e,source:s}=t;this.source=s;const i=s.info();this.setTitle(i.title||s.publicId()),this.setPoster(this.source.poster().url({transformation:{aspect_ratio:"16:9",crop:"pad",background:"black"}})),this.setAction(e)}setTitle(t){this.title.innerText=t}setAction(t){this.action=t}handleClick(){super.handleClick(),this.player().trigger("recommendationshide"),this.action()}};var a=s(7878),c=s.n(a);const l=n().dom||n();const h=class extends r{setItem(t){super.setItem(t);const e=this.source.info();if(this.setTitle(e.title),this.setSubtitle(e.subtitle),e.description){const t=300,s=e.description.length>t?e.description.substring(0,t)+"...":e.description;this.setDescription(s)}}setPoster(t){this.poster.style.backgroundImage="url('".concat(t,"')")}setTitle(t){c().setText(this.title,t),this.setAriaCheck(this.title,!!t)}setSubtitle(t){c().setText(this.subtitle,t),this.setAriaCheck(this.subtitle,!!t)}setDescription(t){c().setText(this.description,t),this.setAriaCheck(this.description,!!t)}setAriaCheck(t){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden","true")}clearItem(){this.setTitle(""),this.setSubtitle(""),this.setDescription(""),this.poster.style.backgroundImage=null}createEl(){const t=super.createEl("div",{className:"vjs-recommendations-overlay-item vjs-recommendations-overlay-item-primary"});return this.poster=l.createEl("div",{className:"vjs-recommendations-overlay-item-primary-image"}),this.title=l.createEl("h2",{ariaLabel:"Recmmendation Title"}),this.setAriaCheck(this.title,!1),this.title.innerHTML="",this.subtitle=l.createEl("h3",{ariaLabel:"Recmmendation Subtitle"}),this.setAriaCheck(this.subtitle,!1),this.subtitle.innerHTML="",this.description=l.createEl("p"),this.setAriaCheck(this.description,!1),this.description.innerHTML="",this.content=l.createEl("div",{className:"vjs-recommendations-overlay-item-info vjs-recommendations-overlay-item-primary-content"}),this.content.appendChild(this.title),this.content.appendChild(this.subtitle),this.content.appendChild(this.description),t.appendChild(this.poster),t.appendChild(this.content),t}},d=n().dom||n();const m=class extends r{setItem(t){super.setItem(t),this.setDuration("")}setPoster(t){this.el().style.backgroundImage="url('".concat(t,"')")}setDuration(t){this.duration.innerText=t}createEl(){const t=super.createEl("div",{className:"vjs-recommendations-overlay-item vjs-recommendations-overlay-item-secondary"});this.title=d.createEl("span",{className:"vjs-recommendations-overlay-item-secondary-title"}),this.title.innerHTML="",this.duration=d.createEl("span",{className:"vjs-recommendations-overlay-item-secondary-duration"}),this.duration.innerHTML="";const e=d.createEl("div",{className:"vjs-recommendations-overlay-item-info"});return e.appendChild(this.title),e.appendChild(this.duration),t.appendChild(e),t}handleClick(){super.handleClick(),this.action()}},p=n().getComponent("Component");const u=class extends p{setItems(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];this.clearItems(),e&&e.forEach(t=>{const e=new m(this.player());e.setItem(t),this.addChild(e)})}clearItems(){this.children().forEach(()=>{this.removeChild(this.children()[0])})}createEl(){return super.createEl("div",{className:"vjs-recommendations-overlay-item-secondary-container"})}},v=n().getComponent("Component");class y extends v{constructor(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),i=1;i<e;i++)s[i-1]=arguments[i];super(t,...s),this._primary=new h(t),this._secondaryContainer=new u(t),this.addChild(this._primary),this.addChild(this._secondaryContainer)}setItems(t){this._primary.setItem(t);for(var e=arguments.length,s=new Array(e>1?e-1:0),i=1;i<e;i++)s[i-1]=arguments[i];this._secondaryContainer.setItems(...s)}createEl(){return super.createEl("div",{className:"aspect-ratio-content"})}}const C=class extends v{constructor(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),i=1;i<e;i++)s[i-1]=arguments[i];super(t,...s),this._content=new y(t),this.addChild(this._content)}setItems(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),i=1;i<e;i++)s[i-1]=arguments[i];this._content.setItems(t,...s)}clearItems(){this._content._primary.clearItem(),this._content._secondaryContainer.clearItems()}createEl(){return super.createEl("div",{className:"vjs-recommendations-overlay-content"})}},g=n().getComponent("ClickableComponent");const I=class extends g{createEl(){return super.createEl("span",{className:"vjs-recommendations-overlay-hide vjs-icon-close"})}handleClick(){this.options_.clickHandler()}},b=n().getComponent("Component");class E extends b{constructor(t,e){for(var s=arguments.length,i=new Array(s>2?s-2:0),n=2;n<s;n++)i[n-2]=arguments[n];super(t,...i),this._content=new C(t),this.addChild(this._content),this.addChild(new I(t,{clickHandler:()=>{this.close()}},...i)),this.setEvents(t),this.doNotOpen=!1}setEvents(t){this.on(t,"recommendationschanged",(t,e)=>{this.setItems(...e.items)}),this.on(t,"recommendationsnoshow",this.setDoNotOpen),this.on(t,"recommendationsshow",this.open),this.on(t,"recommendationshide",this.close),this.on(t,"cldsourcechanged",()=>{this.clearItems(),this.close()})}setDoNotOpen(){this.doNotOpen=!0}open(){this.doNotOpen||(this._showControlsOnClose=this.player().controls(),this.player().controls(!1),this.el().style.visibility="visible")}clearItems(){this._content.clearItems()}close(){this.el().style.visibility="hidden",this._showControlsOnClose&&this.player().controls(!0)}createEl(){const t="vjs-recommendations-overlay",e=super.createEl("div",{className:t});return n().dom.addClass(e,t),e}setItems(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),i=1;i<e;i++)s[i-1]=arguments[i];this.doNotOpen=!1,s=s.slice(0,3),this._content.setItems(t,...s)}handleClick(){this.stopPropagation()}dispose(){super.dispose()}}n().registerComponent("recommendationsOverlay",E);const k=E}}]);
|
package/dist/share.js
CHANGED
package/dist/share.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cloudinary Video Player v3.6.
|
|
3
|
-
* Built on 2025-12-
|
|
2
|
+
* Cloudinary Video Player v3.6.4-edge.0
|
|
3
|
+
* Built on 2025-12-15T17:25:36.409Z
|
|
4
4
|
* https://github.com/cloudinary/cloudinary-video-player
|
|
5
5
|
*/
|
|
6
6
|
"use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[976],{2130:(e,t,o)=>{o.d(t,{default:()=>v});var n=o(6673),r=o.n(n);const i=r().getComponent("ClickableComponent");class a extends i{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}handleClick(e){super.handleClick(e),this.player().share&&"function"==typeof this.player().share.download&&this.player().share.download()}createEl(){const e=r().dom.createEl("button",{className:"vjs-control vjs-share-download-button vjs-button",ariaLabel:"Download video",title:"Download video"}),t=r().dom.createEl("span",{className:"vjs-icon-file-download vjs-icon-placeholder"});e.appendChild(t);const o=r().dom.createEl("span",{className:"vjs-loading-spinner"});return e.appendChild(o),e}setPreparing(e){const t=this.el();e?(t.classList.add("vjs-waiting"),t.setAttribute("title","Download is being prepared")):(t.classList.remove("vjs-waiting"),t.setAttribute("title","Download video"))}}r().registerComponent("ShareDownloadButton",a);var l=o(1865),c=o(4319),d=o.n(c);function s(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function u(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach(function(t){p(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function p(e,t,o){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(arguments.length>1?arguments[1]:void 0)||this;t.addClass("vjs-share");const o=()=>{const e=t.getChild("ControlBar");if(!e||e.getChild("ShareDownloadButton"))return;const o=e.children().findIndex(e=>"FullscreenToggle"===e.name_);e.addChild("ShareDownloadButton",{},-1!==o?o:void 0)};e.download&&o(),t.share={download:()=>{var e;const o=(()=>{var e,o,n;const r=null===(e=t.currentSource)||void 0===e?void 0:e.call(t);if(!r)return null;const i=["format","video_codec","streaming_profile"],a=e=>{if(Array.isArray(e))return e.map(a);if(e&&"object"==typeof e){const t=d()(e,i);return Object.keys(t).forEach(e=>{t[e]=a(t[e])}),t}return e},c=a(t.cloudinary.transformation()||{}),s=null===(o=t.cloudinary.currentPublicId())||void 0===o||null===(o=o.split("/"))||void 0===o?void 0:o.pop(),p=u(u(u({},t.cloudinary.cloudinaryConfig()),c),{},{resource_type:"video",format:"mp4",video_codec:"h264",flags:"streaming_attachment:".concat(s)});return r.isAdaptive&&Object.assign(p,{crop:"limit",width:1920,height:1920}),"AudioSource"===(null===(n=t.cloudinary.source())||void 0===n?void 0:n.getType())&&Object.assign(p,{format:"mp3",video_codec:void 0}),(0,l.KA)(t.cloudinary.currentPublicId(),p)})();if(!o)return void console.warn("Share plugin: Unable to resolve download URL.");const n=[423],r=null===(e=t.controlBar)||void 0===e?void 0:e.getChild("ShareDownloadButton"),i=e=>{var t;null==r||null===(t=r.setPreparing)||void 0===t||t.call(r,e)},a=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const t=await fetch(o,{method:"HEAD"});if(n.includes(t.status)&&e<60)return await(r=1e4,new Promise(e=>setTimeout(e,r))),a(e+1);var r;i(!1),(()=>{const e=document.createElement("a");e.href=o,e.download="",document.body.appendChild(e),e.click(),document.body.removeChild(e)})()};i(!0),a()},addDownloadButton:o,removeDownloadButton:()=>{if(!t.controlBar)return;const e=t.controlBar.getChild("ShareDownloadButton");e&&t.controlBar.removeChild(e)}}}}}]);
|
package/dist/shoppable.js
CHANGED
package/dist/shoppable.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cloudinary Video Player v3.6.
|
|
3
|
-
* Built on 2025-12-
|
|
2
|
+
* Cloudinary Video Player v3.6.4-edge.0
|
|
3
|
+
* Built on 2025-12-15T17:25:36.409Z
|
|
4
4
|
* https://github.com/cloudinary/cloudinary-video-player
|
|
5
5
|
*/
|
|
6
6
|
(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[525],{9987:(t,e,o)=>{"use strict";o.d(e,{default:()=>Q});var s=o(6673),r=o.n(s);const a=function(t){const[e,o,s]=t.split(":").reverse();let r=null;return isNaN(e)||(r=60*(+s||0)*60+60*(+o||0)+ +e),r};var n=o(9339);const i={location:"right",toggleIcon:"",width:"20%",startState:"openOnPlay",autoClose:2,transformation:{quality:"auto",width:"auto",fetch_format:"auto",crop:"scale"},products:[],showPostPlayOverlay:!1},l="goto",c="seek",p="overlay",d="shoppable-panel-visible",h="shoppable-panel-hidden",u="shoppable-products-overlay",m="cld-spbl-panel",f="cld-spbl-toggle",g="cld-spbl-toggle-icon",y="cld-spbl-bar-inner",_="animate",v="cld-spbl-item",b="cld-spbl-img";var C=o(1104);function E(t,e,o){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var s=o.call(t,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}const P=r().dom||r(),T=r().getComponent("Component");class w extends T{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),E(this,"renderProducts",()=>{this.player_.removeClass(d),this.player_.addClass(h),this.player_.addClass(u),this.layout_.innerHTML="";const t=this.player_.currentTime();this.options_.products.filter(e=>e.hotspots&&e.hotspots.some(e=>a(e.time)===t)).forEach(e=>{const o=(0,n.I)(e.hotspots,e=>a(e.time)===t),s=P.createEl("div",{className:"cld-spbl-product-hotspot-name"},{},e.productName),r=P.createEl("div",{className:"cld-spbl-product-tooltip cld-spbl-product-tooltip-"+o.tooltipPosition},{},s),i=P.createEl("a",{className:"cld-spbl-product-hotspot accent-color-text",href:o.clickUrl,target:"_blank"},{style:"left:"+o.x+"; top:"+o.y+";"},r);this.layout_.appendChild(i)}),this.player_.one(C.f.SEEKING,this.clearLayout),this.player_.one(C.f.PLAY,this.clearLayout)}),E(this,"clearLayout",()=>{this.layout_.innerHTML="",this.player_.removeClass(u)}),this.options_=e,this.player_=t,this.player_.on(C.f.SHOW_PRODUCTS_OVERLAY,this.renderProducts),this.dispose=()=>{this.layout_.dispose()}}createEl(){const t=this.player_.currentDimensions();return this.layout_=P.createEl("div",{className:"cld-spbl-products-overlay",style:"padding-top: ".concat(t.height/t.width*100,"%;")}),this.layout_}}r().registerComponent("ShoppableProductsOverlay",w);const N=w,O=r().dom||r(),L=r().getComponent("ClickableComponent");class x extends L{constructor(t,e){super(t,e),this.options_=e}handleClick(t){t.preventDefault(),t.stopPropagation(),this.options_.clickHandler()}createEl(){let t={},e={};this.options_.toggleIcon?(t={className:"".concat(g," ").concat("cld-spbl-toggle-custom-icon"," ").concat("vjs-icon-close")},e={style:"background-image: url(".concat(this.options_.toggleIcon,")")}):t={className:"".concat(g," ").concat("vjs-icon-cart")};const o=O.createEl("span",t,e),s=super.createEl("a",{className:"".concat(f," base-color-bg")});return s.appendChild(o),this.player_.on(C.f.PRODUCT_BAR_MIN,()=>{setTimeout(()=>{o.classList.add(_),setTimeout(()=>{o.classList.remove(_)},1e3)},500)}),s}}r().registerComponent("shoppablePanelToggle",x);const k=x,S=r().dom||r(),j=r().getComponent("Component");class I extends j{constructor(t,e){super(t,e),this.player_=t,this.player().addClass("cld-shoppable-panel"),this.player().addClass(h),this.contentWrpEl_=S.createEl("div",{className:"cld-spbl-bar"}),this.contentBannerEl_=S.createEl("div",{className:"cld-spbl-banner-msg base-color-text"},{},this.options_.bannerMsg||"Shop the Video"),this.contentWrpEl_.appendChild(this.contentBannerEl_);const o=new N(this.player_,this.options_);this.contentWrpEl_.appendChild(o.el_),this.contentEl_=S.createEl("div",{className:y}),this.contentWrpEl_.appendChild(this.contentEl_),this.player().el().appendChild(this.contentWrpEl_),this.addChild(new k(this.player_,{toggleIcon:this.options_.toggleIcon,clickHandler:()=>{this.togglePanel()}})),this.addChild("ShoppablePanel",this.options_),this.dispose=()=>{this.removeLayout(),super.dispose()},this.togglePanel=t=>{!0===t?(this.player().removeClass(h),this.player().addClass(d)):!1===t?(this.player().removeClass(d),this.player().addClass(h)):(this.player().toggleClass(h),this.player().toggleClass(d));let e=this.player().hasClass(d)?"productBarMax":"productBarMin";this.player().trigger(e)},"open"===this.options_.startState&&this.togglePanel(!0),this.player_.on(C.f.PLAY,()=>{this.player_.currentTime()<.01&&("openOnPlay"===this.options_.startState&&this.togglePanel(!0,this.options_.autoClose),this.options_.autoClose&&-1!==this.options_.startState.indexOf("open")&&setTimeout(()=>{this.contentEl_.matches(":hover")?this.contentEl_.addEventListener("mouseleave",()=>{this.togglePanel(!1)},{once:!0}):this.togglePanel(!1)},1e3*this.options_.autoClose))})}createEl(){return super.createEl("div")}}r().registerComponent("shoppableBarLayout",I);const A=I;var H=o(2858),M=o.n(H),D=o(4650);const W=r().getComponent("ClickableComponent"),B=r().dom||r(),R={width:132};class z extends W{constructor(t,e){super(t,e),this.options_=e,this.isDragged=!1}handleClick(t){t.preventDefault(),t.stopPropagation(),this.el_.matches(".dragged .".concat(v))||this.options_.clickHandler(t),this.isDragged=!1}getTitle(){return this.options_.conf.title}createEl(){const t=super.createEl("a",{className:"".concat(v," base-color-bg accent-color-text"),href:"#"});t.setAttribute("data-product-id",this.options_.conf.productId||""),t.setAttribute("data-product-name",this.options_.conf.productName||""),this.options_.conf.onHover&&U(t,this.options_.conf.onHover,this.options_.item.cloudinaryConfig()),this.options_.conf.onClick&&V(t,this.options_.conf.onClick);const e=super.createEl("img",{className:b},{src:this.options_.item.url(R)});if(t.appendChild(e),this.getTitle()){const e=B.createEl("div",{className:"cld-spbl-item-info base-color-semi-bg text-color-text"}),o=B.createEl("span",{className:"cld-spbl-item-title"},{},this.getTitle());e.appendChild(o),t.appendChild(e)}return t}}const U=(t,e,o)=>{if(t.setAttribute("data-hover-action",e.action),e.action===p){const o=B.createEl("span",{className:"cld-spbl-overlay-text base-color-text"},{},e.args),s=B.createEl("span",{className:"cld-spbl-overlay text-color-semi-bg base-color-text"},{title:e.args},o);t.appendChild(s)}else{const s=new D.A(e.args.publicId,{cloudinaryConfig:o,transformation:e.args.transformation}),r=B.createEl("img",{className:"".concat(b," cld-spbl-hover-img")},{src:s.url(R)});t.appendChild(r)}},V=(t,e)=>{t.setAttribute("data-click-action",e.action),t.setAttribute("data-pause",e.pause),e.action===c?t.setAttribute("data-seek",e.args.time):e.action===l&&t.setAttribute("data-goto-url",e.args.url)};r().registerComponent("shoppablePanelItem",z);const X=z,G=r().getComponent("Component");class Y extends G{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.options=e;const o=()=>{this.render()};t.on(C.f.SHOPPABLE_ITEM_CHANGED,o),this.render(),this.dispose=()=>{super.dispose(),t.off(C.f.SHOPPABLE_ITEM_CHANGED,o)}}createEl(){const t=super.createEl();return[m,"base-color-bg"].map(e=>t.classList.add(e)),t}removeAll(){const t=this.children();for(let e=t.length-1;e>=0;--e)this.removeChild(t[e])}getItems(){const t=this.player_.cloudinary.cloudinaryConfig();return this.options.products.map(e=>{e.onHover&&"object"==typeof e.onHover.args&&(e.onHover.args.transformation=Object.assign({},this.options.transformation,e.onHover.args.transformation));const o={productId:e.productId,productName:e.productName,title:e.title,onHover:e.onHover,onClick:e.onClick,startTime:e.startTime,endTime:e.endTime};return{imageSrc:new D.A(e.publicId,{cloudinaryConfig:t,transformation:Object.assign({},this.options.transformation,e.transformation)}),conf:o}})}scrollToActiveItem(){const t=this.el_.getElementsByClassName("active");if(t.length>0){const e=t[0].offsetTop-12;"scrollBehavior"in document.documentElement.style?this.el_.scrollTo({top:e,behavior:"smooth"}):this.el_.scrollTop=e}}render(){this.removeAll();const t=this.getItems(),e=M()(()=>this.scrollToActiveItem(),1e3);t.forEach((t,o)=>{const s=new X(this.player(),{item:t.imageSrc,conf:t.conf,next:1===o,current:0===o,clickHandler:t=>{let e=t.currentTarget||t.target,o=this.player_.ended()?"productClickPost":"productClick";if(this.player_.trigger(o,{productId:e.dataset.productId,productName:e.dataset.productName}),e.dataset.clickAction===l)window.open(e.dataset.gotoUrl,"_blank");else if(e.dataset.clickAction===c){const t=a(e.dataset.seek);null!==t&&(this.player_.addClass("vjs-has-started"),this.player_.postModal&&this.player_.postModal.close(),this.player_.currentTime(t),this.player_.removeClass(d),this.player_.addClass(h),this.player_.addClass(u),this.player_.one("seeked",()=>this.player_.trigger("showProductsOverlay")))}"false"!==e.dataset.pause&&(this.player_.pause(),a(e.dataset.pause)&&setTimeout(()=>{this.player_.play()},1e3*a(e.dataset.pause)))}});s.on("mouseover",t=>{let e=t.currentTarget||t.target,o=this.player_.ended()?"productHoverPost":"productHover";this.player_.trigger(o,{productId:e.dataset.productId,productName:e.dataset.productName})}),void 0!==t.conf.startTime&&void 0!==t.conf.endTime&&this.player_.on(C.f.TIME_UPDATE,()=>{const o=this.player_.currentTime();o>=t.conf.startTime&&o<t.conf.endTime?(s.el_.classList.add("active"),e()):s.el_.classList.contains("active")&&s.el_.classList.remove("active")}),this.addChild(s)})}}r().registerComponent("shoppablePanel",Y);const $=Y;function q(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,s)}return o}function Z(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?q(Object(o),!0).forEach(function(e){F(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):q(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function F(t,e,o){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var s=o.call(t,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}const K=r().dom||r();const J=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.options_=Z(Z({},e),{},{postPlay:!0}),this.player_=t,this.render(),this.handleDragToScroll(),this.dispose=()=>{this.layout_.dispose()}}handleDragToScroll(){const t=this.player_.postModal.el_.querySelector(".".concat(m));let e=!1,o=0,s=0;t.addEventListener("mousedown",r=>{e=!0,o=r.pageX-t.offsetLeft,s=t.scrollLeft}),document.addEventListener("mouseup",s=>{e=!1,setTimeout(()=>{t.classList.remove("dragged")},300);const r=s.pageX-t.offsetLeft-o;Math.abs(r)>5&&s.preventDefault()}),document.addEventListener("mousemove",r=>{if(!e)return;r.preventDefault();const a=r.pageX-t.offsetLeft-o;t.scrollLeft=s-a,Math.abs(a)>5&&!t.classList.contains("dragged")&&t.classList.add("dragged")})}render(){this.player_.postModal=null;const t=K.createEl("div",{className:"cld-spbl-post-play"}),e=new $(this.player_,this.options_),o=K.createEl("div",{className:"cld-spbl-post-title base-color-text"},{},this.options_.bannerMsg||"Shop the Video"),s=this.player_.cloudinary.currentPoster();s.transformation([s.transformation().toOptions?s.transformation().toOptions():{},{effect:"blur:3000"}]);const r=K.createEl("div",{className:"cld-spbl-post-play-bg",style:'background-image: url("'.concat(s.url(),'")')}),a=K.createEl("button",{className:"cld-spbl-replay-btn base-color-bg vjs-icon-replay",onclick:()=>{this.player_.trigger("replay"),this.player_.postModal.close(),this.player_.play()}},{},"Replay");t.appendChild(r),t.appendChild(o),t.appendChild(e.el()),t.appendChild(a),this.player_.postModal=this.player_.createModal(t,{name:"postModal",uncloseable:!0}),this.player_.addClass("cld-spbl-post-modal"),this.player_.postModal.on("beforemodalclose",()=>{this.player_.removeClass("cld-spbl-post-modal")})}};const Q=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.options_=r().obj.merge(i,e),this.player_=t,this.options_.showPostPlayOverlay&&this.player_.on(C.f.ENDED,()=>{this.player_.addChild(new J(this.player_,this.options_))});const o=this.options_.width;this._injectCSS("\n .".concat(y," {\n transform: translateX(").concat(o,");\n }\n .").concat(d," .vjs-control-bar {\n width: calc(100% - ").concat(o,");\n }\n .").concat(f," {\n right: ").concat(o,";\n }\n .").concat(m,"{\n width: ").concat(o,";\n }\n ")),this._setListeners()}_setListeners(){const t=this._resizeHandler.bind(this);this.player_.on(C.f.RESIZE,t),window.addEventListener("resize",t),this.dispose=()=>{this.player_.off(C.f.RESIZE,t),window.removeEventListener("resize",t),this.layout_.dispose()}}_injectCSS(t){const e=document.createElement("style");e.innerHTML=t,this.player_.el_.appendChild(e)}_resizeHandler(){const t=[["sm",0,80],["md",81,110],["lg",111,170]],e=parseFloat(this.options_.width)/100*this.player_.el_.clientWidth;let o=!1;if(e){for(const[s,r,a]of t)e>r&&e<=a&&(this.layout_.contentWrpEl_.setAttribute("size",s),o=s);o||this.layout_.contentWrpEl_.removeAttribute("size")}}init(){this.render()}render(){this.layout_=new A(this.player_,this.options_)}}},8812:(t,e,o)=>{var s=o(2140),r=/^\s+/;t.exports=function(t){return t?t.slice(0,s(t)+1).replace(r,""):t}},2140:t=>{var e=/\s/;t.exports=function(t){for(var o=t.length;o--&&e.test(t.charAt(o)););return o}},6177:(t,e,o)=>{var s=o(8953),r=o(3664),a=o(5378),n=Math.max,i=Math.min;t.exports=function(t,e,o){var l,c,p,d,h,u,m=0,f=!1,g=!1,y=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function _(e){var o=l,s=c;return l=c=void 0,m=e,d=t.apply(s,o)}function v(t){var o=t-u;return void 0===u||o>=e||o<0||g&&t-m>=p}function b(){var t=r();if(v(t))return C(t);h=setTimeout(b,function(t){var o=e-(t-u);return g?i(o,p-(t-m)):o}(t))}function C(t){return h=void 0,y&&l?_(t):(l=c=void 0,d)}function E(){var t=r(),o=v(t);if(l=arguments,c=this,u=t,o){if(void 0===h)return function(t){return m=t,h=setTimeout(b,e),f?_(t):d}(u);if(g)return clearTimeout(h),h=setTimeout(b,e),_(u)}return void 0===h&&(h=setTimeout(b,e)),d}return e=a(e)||0,s(o)&&(f=!!o.leading,p=(g="maxWait"in o)?n(a(o.maxWait)||0,e):p,y="trailing"in o?!!o.trailing:y),E.cancel=function(){void 0!==h&&clearTimeout(h),m=0,l=u=c=h=void 0},E.flush=function(){return void 0===h?d:C(r())},E}},3664:(t,e,o)=>{var s=o(1433);t.exports=function(){return s.Date.now()}},2858:(t,e,o)=>{var s=o(6177),r=o(8953);t.exports=function(t,e,o){var a=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return r(o)&&(a="leading"in o?!!o.leading:a,n="trailing"in o?!!o.trailing:n),s(t,e,{leading:a,maxWait:e,trailing:n})}},5378:(t,e,o)=>{var s=o(8812),r=o(8953),a=o(5414),n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(a(t))return NaN;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=s(t);var o=i.test(t);return o||l.test(t)?c(t.slice(2),o?2:8):n.test(t)?NaN:+t}}}]);
|
package/dist/visual-search.js
CHANGED