@gumlet/insights-js-core 2.1.3 → 2.1.4
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/{Events-Ci0uH7jU.mjs → Events-D5KYZXXC.mjs} +1 -1
- package/dist/{GumletStateMachine-CegNbYMj.mjs → GumletStateMachine-BfcnvYyv.mjs} +2 -2
- package/dist/{HTML5Adapter-B8YEupKD.mjs → HTML5Adapter-Cr6SpCtZ.mjs} +2 -2
- package/dist/{HlsjsAdapter-D9eIzI9V.mjs → HlsjsAdapter-BV3nPAe2.mjs} +2 -2
- package/dist/{Logger-BRbHaEqa.mjs → Logger-CXYCiU0M.mjs} +1 -1
- package/dist/{Players-DZahhtZn.mjs → Players-C89XH3yK.mjs} +1 -1
- package/dist/{ShakaAdapter-s8Tcp-Tt.mjs → ShakaAdapter-Dx785TPx.mjs} +2 -2
- package/dist/main.iife.js +2 -2
- package/dist/main.mjs +2 -2
- package/package.json +1 -1
package/dist/main.iife.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
// This source code and its use and distribution, is subject to the terms
|
|
5
5
|
// and conditions of the applicable license agreement.
|
|
6
6
|
|
|
7
|
-
// @gumlet/insights-js-core version 2.1.
|
|
7
|
+
// @gumlet/insights-js-core version 2.1.4
|
|
8
8
|
|
|
9
|
-
var gminsights=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e));let f={CLOUDFLARE:`cloudflare`,AKAMAI:`akamai`,FASTLY:`fastly`,MAXCDN:`maxcdn`,CLOUDFRONT:`cloudfront`,CHINACACHE:`chinacache`,BITGRAVITY:`bitgravity`};var p,m=s((()=>{p={READY:`ready`,STARTUP:`startup`,SOURCE_LOADED:`sourceLoaded`,PLAY:`play`,PAUSE:`pause`,TIMECHANGED:`timechanged`,SEEK:`seek`,SEEKED:`seeked`,START_CAST:`startCasting`,END_CAST:`endCasting`,START_BUFFERING:`startBuffering`,END_BUFFERING:`endBuffering`,AUDIO_CHANGE:`audioChange`,VIDEO_CHANGE:`videoChange`,START_FULLSCREEN:`startFullscreen`,END_FULLSCREEN:`endFullscreen`,START_AD:`adStart`,END_AD:`adEnd`,MUTE:`mute`,UN_MUTE:`unMute`,ERROR:`playerError`,NON_FATAL_ERROR:`playerNonFatalError`,PLAYBACK_FINISHED:`end`,SCREEN_RESIZE:`resize`,UNLOAD:`unload`,END:`end`,METADATA_LOADED:`metadataLoaded`,SOURCE_UNLOADED:`sourceUnloaded`,PLAYBACK_PLAYING:`playback_playing`}})),h,ee=s((()=>{h={JW:`jw`,RADIANT:`radiant`,HLSJS:`hlsjs`,SHAKA:`shaka`,HTML:`html5`,REACTNATIVEVIDEO:`react-native-video`}}));m(),ee();let te={experimentName:`insights-test-experiment`,customData1:`custom_data_1:test-slot-1`,customData2:`custom_data_2:test-slot-2`,customData3:`custom_data_3:test-slot-3`,customData4:`custom_data_4:test-slot-4`,customData5:`custom_data_5:test-slot-5`,customData6:`custom_data_6:test-slot-6`,customData7:`custom_data_7:test-slot-7`,customData8:`custom_data_8:test-slot-8`,customData9:`custom_data_9:test-slot-9`,customData10:`custom_data_10:test-slot-10`,customPlayerIntegrationVersion:`custom_player_integration_version:1.2.3-test`,customPlayerName:`custom_player_name:TestPlayerShell`,customPageType:`custom_page_type:article`,userId:`custom_user_id:test-user-42`,userName:`custom_user_name:Ada Test`,userEMail:`custom_user_email:test@example.com`,userPhone:`custom_user_phone:+1-555-0100`,userProfileImage:`custom_user_profile_image:https://example.com/avatar.png`,userAddressLine1:`custom_user_address_line_1:1 Test Street`,userAddressLine2:`custom_user_address_line_2:Suite 100`,userCity:`custom_user_city:Testville`,userState:`custom_user_state:TS`,userCountry:`custom_user_country:Testland`,userZipcode:`custom_user_zipcode:99999`,customContentType:`custom_content_type:application/x-test-stream`,customVideoDurationMillis:`custom_video_duration_millis:12345678`,customEncodingVariant:`custom_encoding_variant:h264-720p-test`,customVideoLanguage:`custom_video_language:en-TEST`,customVideoId:`custom_video_id:vid-integration-001`,customVideoSeries:`custom_video_series:Series Test Pack`,customVideoProducer:`custom_video_producer:QA Producer`,customVideoTitle:`custom_video_title:Full metadata smoke test`,customVideoVariantName:`custom_video_variant_name:main-feed`,customVideoVariant:`custom_video_variant:abr-ladder-a`},ne=e=>e!==void 0&&typeof e==`string`,re=e=>e!==void 0&&typeof e==`boolean`,ie=e=>e!==void 0&&typeof e==`number`,ae=e=>e.replace(/\/$/g,``),oe=e=>(e*=1e3,Math.round(e)),se=e=>{let t=e.toString().length;return t===13?e:e*10**(13-t)},ce=()=>Date.now(),le=e=>ce()-e,ue=()=>{if(crypto&&crypto.randomUUID)return crypto.randomUUID();let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[...e].map(e=>e.toString(16).padStart(2,`0`));return t.slice(0,4).join(``)+`-`+t.slice(4,6).join(``)+`-`+t.slice(6,8).join(``)+`-`+t.slice(8,10).join(``)+`-`+t.slice(10,16).join(``)},de=e=>{let t=`${e}=`,n=[];try{n=document.cookie.split(`;`)}catch{return``}let r=null;for(let e=0;e<n.length;e++){let i=n[e];for(;i.charAt(0)===` `;)i=i.substring(1);i.indexOf(t)===0&&(r=i.substring(t.length,i.length))}if(!r){try{r=localStorage.getItem(e)}catch{return``}let t=null;if(r)try{t=JSON.parse(r)}catch{return``}else return``;let n=null;if(t.expires)n=new Date(t.expires);else return``;if(Object.prototype.toString.call(n)===`[object Date]`){if(!(n instanceof Date&&!isNaN(n.getTime())))return``}else return``;if(n.getTime()>new Date().getTime())r=t.value?t.value:``;else return``}return r},fe=(e,t=30,n=null)=>{let r=new Date;r.setTime(r.getTime()+t*60*1e3);let i=n||ue();try{document.cookie=`${e}=${i}; expires=${r.toUTCString()}; path=/`,localStorage.setItem(e,JSON.stringify({expires:r.getTime(),value:i}))}catch{}return i},pe=()=>{},me=(e,t)=>{let n=0,r;return()=>n>=t?r:(r=e.apply(null,arguments),n++,r)},he=e=>me(e,1),ge=()=>{let e=[`webkit`,`moz`,`ms`,`o`];if(`hidden`in document)return`hidden`;for(let t=0;t<e.length;t++)if(`${e[t]}Hidden`in document)return`${e[t]}Hidden`;return null},_e=e=>typeof e==`object`?JSON.stringify(e):typeof e==`function`?_e(e()):e===void 0||typeof e==`string`?e:String(e);var g={validString:ne,validBoolean:re,validNumber:ie,sanitizePath:ae,calculateTime:oe,getCurrentTimestamp:ce,getDurationFromTimestampToNow:le,uuidv4:ue,getCookie:de,setCookie:fe,noOp:pe,times:me,once:he,getHiddenProp:ge,getCustomDataString:_e,jsonToQueryString:e=>`?`+Object.keys(e).map(t=>encodeURIComponent(t)+`=`+encodeURIComponent(e[t])).join(`&`),currentDateTimeFormatString:()=>new Date().toISOString(),convertEpochTime:se};function ve(){return typeof performance<`u`&&typeof performance.timeOrigin==`number`&&!Number.isNaN(performance.timeOrigin)&&typeof performance.now==`function`?((performance.timeOrigin+performance.now())/1e3).toFixed(9):(Date.now()/1e3).toFixed(9)}function ye(e){e.z=ve();let t=[void 0,null,!1];Object.keys(e).forEach(n=>{t.indexOf(e[n])!==-1&&delete e[n]}),Object.keys(e).forEach(t=>{Number.isNaN(e[t])&&delete e[t]})}var be=class{get(e,t,n,r=!0){ye(t);let i=g.jsonToQueryString(t);e+=i,fetch(e,{method:`GET`,keepalive:r===!1}).then(e=>e.text()).then(e=>{e&&e.length>0&&n(e)}).catch(()=>{})}asyncGet(e,t){return new Promise((n,r)=>{ye(t);let i=g.jsonToQueryString(t);e+=i,fetch(e,{method:`GET`}).then(e=>e.ok?e.text():Promise.reject({status:e.status,statusText:e.statusText})).then(e=>n(e)).catch(e=>{e&&typeof e.status==`number`?r(e):r({status:0,statusText:``})})})}};let xe=!0;function Se(e){xe=e}function Ce(){return xe}var we,Te,Ee,De,_=s((()=>{we=`urn:x-cast:com.gumlet.ingest.cast`,Te=`https://ingest.gumlytics.com`,Ee=`https://ingest.gumlytics.com`.endsWith(`/`)?Te:`${Te}/`,De=new URL(`v2`,Ee).href.replace(/\/+$/,``)}));_();function Oe(){return{}}let ke=Oe;function Ae(e){ke=e}function je(e){if(!(e.meta_user_agent!=null&&e.meta_user_agent!==``))try{typeof navigator<`u`&&navigator.userAgent&&(e.meta_user_agent=navigator.userAgent)}catch{}}function Me(e){if(e.event_duration_millis!=null)return;let t=e.from,n=e.to;typeof t==`number`&&typeof n==`number`&&!Number.isNaN(t)&&!Number.isNaN(n)&&(e.event_duration_millis=n-t)}function Ne(e){let t=e.user_email;t!=null&&t!==``&&(e.custom_user_email==null||e.custom_user_email===``)&&(e.custom_user_email=t)}function Pe(e,t){let n={...e};for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}function Fe(e){let t=Pe(ke(),e);return t.bitrate_mbps==null&&t.bitrate!=null&&(t.bitrate_mbps=t.bitrate),t.player_software==null&&t.player_name!=null&&(t.player_software=t.player_name),je(t),Me(t),Ne(t),t}var Ie=class e extends be{constructor(...t){super(...t),this.sendRequest=function(t,n){t.event_family=`session_event`;let r=Ce()?Fe({...t}):null;this.get(e.analyticsServerUrl,t,n),r&&this.get(e.analyticsServerUrlV2,r,g.noOp)},this.sendRequestAsync=function(t){t.event_family=`session_event`;let n=Ce()?Fe({...t}):null,r=this.asyncGet(e.analyticsServerUrl,t);return n&&this.asyncGet(e.analyticsServerUrlV2,n).catch(()=>{}),r},this.sendRequestSynchronous=function(t,n){t.event_family=`session_event`;let r=Ce()?Fe({...t}):null;this.get(e.analyticsServerUrl,t,n,!1),r&&this.get(e.analyticsServerUrlV2,r,g.noOp,!1)},this.getAnalyticsServerUrl=()=>e.analyticsServerUrl}static{this.analyticsServerUrl=Te}static{this.analyticsServerUrlV2=De}},Le,v,Re=s((()=>{Le=class{constructor(e=!1){this.log=e=>{this.showLogs&&console.log(e)},this.error=e=>{this.showLogs&&console.error(e)},this.warning=e=>{this.showLogs&&console.warn(e)},this.showLogs=e}setLogging(e){this.showLogs=e}isLogging(){return this.showLogs}},v=new Le}));Re();function ze(e){return typeof window>`u`||!window.shaka?!1:typeof shaka.Player==`function`&&e?.constructor===shaka.Player}function Be(e){return typeof window>`u`||!window.Hls?!1:typeof Hls==`function`&&e?.constructor===Hls}let Ve={isShaka:ze,isHlsjs:Be};_();var He=class{setUp(){v.log(`setting up cast session`),this.castSession=cast.framework.CastContext.getInstance().getCurrentSession(),this.addMessageListener()}addMessageListener(){let e=this.castSession.getApplicationMetadata();if(!e||e.namespaces.indexOf(`urn:x-cast:com.gumlet.ingest.cast`)<0){v.log(`No analytics on chrome cast receiver enabled!`);return}v.log(`adding message listener`),this.castSession.addMessageListener(we,(e,t)=>{v.log(`Received: ${e} ${t}`);try{let e=JSON.parse(t);this.handleReceiverMessage(e)}catch{v.error(`Message parsing failed ${t}`)}})}handleReceiverMessage(e){v.log(e)}sendMessage(e){let t=this.castSession.getApplicationMetadata();if(!t||t.namespaces.indexOf(`urn:x-cast:com.gumlet.ingest.cast`)<0){v.log(`No analytics on chrome cast receiver enabled!`);return}v.log(`Sending message: ${JSON.stringify(e)}`),this.castSession.sendMessage(we,e)}};_(),Re();var Ue=class{setUp(){this.messageBus=cast.receiver.CastReceiverManager.getInstance().getCastMessageBus(we,cast.receiver.CastMessageBus.MessageType.JSON),v.log(this.messageBus),this.messageBus.onMessage=e=>{v.log(`Received message from cast client: ${JSON.stringify(e)}`);let t=e.data;this.handleClientMessage(t)}}setCallback(e){this.callback=e}handleClientMessage(e){this.callback(e)}sendMessage(e){this.messageBus.broadcast(e)}};let y={SETUP:`event_setup`,PLAYER_READY:`event_player_ready`,PLAYBACK_READY:`event_playback_ready`,PLAYBACK_STARTED:`event_playback_started`,PAUSE:`event_pause`,PLAY:`event_play`,PLAYING:`event_playing`,PLAYBACK_UPDATE:`event_playback_update`,END:`event_ended`,MUTE:`event_muted`,UNMUTE:`event_unmute`,SEEKED:`event_seeked`,START_REBUFFER:`event_rebuffer_start`,END_REBUFFER:`event_rebuffer_end`,ERROR:`event_error`,ERROR_RECOVERED:`event_error_recovered`};var We=`2.0.9`,Ge=500,Ke=`user-agent`,qe=``,Je=`?`,b={FUNCTION:`function`,OBJECT:`object`,STRING:`string`,UNDEFINED:`undefined`},x=`browser`,S=`cpu`,C=`device`,w=`engine`,T=`os`,Ye=`result`,E=`name`,D=`type`,O=`vendor`,k=`version`,A=`architecture`,Xe=`major`,j=`model`,Ze=`console`,M=`mobile`,N=`tablet`,P=`smarttv`,F=`wearable`,Qe=`xr`,$e=`embedded`,et=`fetcher`,I=`inapp`,tt=`brands`,L=`formFactors`,nt=`fullVersionList`,rt=`platform`,it=`platformVersion`,at=`bitness`,R=`sec-ch-ua`,ot=R+`-full-version-list`,st=R+`-arch`,ct=R+`-`+at,lt=R+`-form-factors`,ut=R+`-`+M,dt=R+`-`+j,ft=R+`-`+rt,pt=ft+`-version`,mt=[tt,nt,M,j,rt,it,A,L,at],ht=`Amazon`,gt=`Apple`,_t=`ASUS`,vt=`BlackBerry`,z=`Google`,yt=`Huawei`,bt=`Lenovo`,xt=`Honor`,St=`LG`,Ct=`Microsoft`,wt=`Motorola`,Tt=`Nvidia`,Et=`OnePlus`,Dt=`OPPO`,Ot=`Samsung`,kt=`Sharp`,At=`Sony`,jt=`Xiaomi`,Mt=`Zebra`,Nt=`Chrome`,Pt=`Chromium`,B=`Chromecast`,Ft=`Edge`,It=`Firefox`,V=`Opera`,Lt=`Facebook`,Rt=`Sogou`,H=`Mobile `,U=` Browser`,zt=`Windows`,W=typeof window!==b.UNDEFINED&&window.navigator?window.navigator:void 0,G=W&&W.userAgentData?W.userAgentData:void 0,Bt=function(e,t){var n={},r=t;if(!Ut(t))for(var i in r={},t)for(var a in t[i])r[a]=t[i][a].concat(r[a]?r[a]:[]);for(var o in e)n[o]=r[o]&&r[o].length%2==0?r[o].concat(e[o]):e[o];return n},Vt=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},Ht=function(e,t){if(typeof e===b.OBJECT&&e.length>0){for(var n in e)if(K(t)==K(e[n]))return!0;return!1}return Wt(e)?K(t)==K(e):!1},Ut=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?Ut(e[n]):!1)},Wt=function(e){return typeof e===b.STRING},Gt=function(e){if(e){for(var t=[],n=qt(/\\?\"/g,e).split(`,`),r=0;r<n.length;r++)if(n[r].indexOf(`;`)>-1){var i=Yt(n[r]).split(`;v=`);t[r]={brand:i[0],version:i[1]}}else t[r]=Yt(n[r]);return t}},K=function(e){return Wt(e)?e.toLowerCase():e},Kt=function(e){return Wt(e)?qt(/[^\d\.]/g,e).split(`.`)[0]:void 0},q=function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];typeof n==b.OBJECT&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},qt=function(e,t){return Wt(t)?t.replace(e,qe):t},Jt=function(e){return qt(/\\?\"/g,e)},Yt=function(e,t){return e=qt(/^\s\s*/,String(e)),typeof t===b.UNDEFINED?e:e.substring(0,t)},Xt=function(e,t){if(!(!e||!t))for(var n=0,r,i,a,o,s,c;n<t.length&&!s;){var l=t[n],u=t[n+1];for(r=i=0;r<l.length&&!s&&l[r];)if(s=l[r++].exec(e),s)for(a=0;a<u.length;a++)c=s[++i],o=u[a],typeof o===b.OBJECT&&o.length>0?o.length===2?typeof o[1]==b.FUNCTION?this[o[0]]=o[1].call(this,c):this[o[0]]=o[1]:o.length>=3&&(typeof o[1]===b.FUNCTION&&!(o[1].exec&&o[1].test)?o.length>3?this[o[0]]=c?o[1].apply(this,o.slice(2)):void 0:this[o[0]]=c?o[1].call(this,c,o[2]):void 0:o.length==3?this[o[0]]=c?c.replace(o[1],o[2]):void 0:o.length==4?this[o[0]]=c?o[3].call(this,c.replace(o[1],o[2])):void 0:o.length>4&&(this[o[0]]=c?o[3].apply(this,[c.replace(o[1],o[2])].concat(o.slice(4))):void 0)):this[o]=c||void 0;n+=2}},J=function(e,t){for(var n in t)if(typeof t[n]===b.OBJECT&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(Ht(t[n][r],e))return n===Je?void 0:n}else if(Ht(t[n],e))return n===Je?void 0:n;return t.hasOwnProperty(`*`)?t[`*`]:e},Zt={ME:`4.90`,"NT 3.51":`3.51`,"NT 4.0":`4.0`,2e3:[`5.0`,`5.01`],XP:[`5.1`,`5.2`],Vista:`6.0`,7:`6.1`,8:`6.2`,"8.1":`6.3`,10:[`6.4`,`10.0`],NT:``},Qt={embedded:`Automotive`,mobile:`Mobile`,tablet:[`Tablet`,`EInk`],smarttv:`TV`,wearable:`Watch`,xr:[`VR`,`XR`],"?":[`Desktop`,`Unknown`],"*":void 0},$t={Chrome:`Google Chrome`,Edge:`Microsoft Edge`,"Edge WebView2":`Microsoft Edge WebView2`,"Chrome WebView":`Android WebView`,"Chrome Headless":`HeadlessChrome`,"Huawei Browser":`HuaweiBrowser`,"MIUI Browser":`Miui Browser`,"Opera Mobi":`OperaMobile`,Yandex:`YaBrowser`},en={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[k,[E,H+`Chrome`]],[/webview.+edge\/([\w\.]+)/i],[k,[E,Ft+` WebView`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[k,[E,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[E,k],[/opios[\/ ]+([\w\.]+)/i],[k,[E,V+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[k,[E,V+` GX`]],[/\bopr\/([\w\.]+)/i],[k,[E,V]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[k,[E,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[k,[E,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:hi|lg |ovi|qute)browser|palemoon)\/v?([-\w\.]+)/i,/(brave)(?: chrome)?\/([\d\.]+)/i,/(aloha|heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[E,k],[/quark(?:pc)?\/([-\w\.]+)/i],[k,[E,`Quark`]],[/\bddg\/([\w\.]+)/i],[k,[E,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[k,[E,`UCBrowser`]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[k,[E,`WeChat`]],[/konqueror\/([\w\.]+)/i],[k,[E,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[k,[E,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[k,[E,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[k,[E,`Smart `+bt+U]],[/(av(?:ast|g|ira))\/([\w\.]+)/i],[[E,/(.+)/,`$1 Secure`+U],k],[/norton\/([\w\.]+)/i],[k,[E,`Norton Private`+U]],[/\bfocus\/([\w\.]+)/i],[k,[E,It+` Focus`]],[/ mms\/([\w\.]+)$/i],[k,[E,V+` Neon`]],[/ opt\/([\w\.]+)$/i],[k,[E,V+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[k,[E,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[k,[E,`Dolphin`]],[/coast\/([\w\.]+)/i],[k,[E,V+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[k,[E,`MIUI`+U]],[/fxios\/([\w\.-]+)/i],[k,[E,H+It]],[/\bqihoobrowser\/?([\w\.]*)/i],[k,[E,`360`]],[/\b(qq)\/([\w\.]+)/i],[[E,/(.+)/,`$1Browser`],k],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[E,/(.+)/,`$1`+U],k],[/samsungbrowser\/([\w\.]+)/i],[k,[E,Ot+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[k,[E,Rt+` Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[E,Rt+` Mobile`],k],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[E,k],[/(lbbrowser|luakit|rekonq|steam(?= (clie|tenf|gameo)))/i],[E],[/ome\/([\w\.]+).+(iron(?= saf)|360(?=[es]e$))/i],[k,E],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[E,Lt],k,[D,I]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[E,k,[D,I]],[/\bgsa\/([\w\.]+) .*safari\//i],[k,[E,`GSA`],[D,I]],[/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i],[k,[E,`TikTok`],[D,I]],[/\[(linkedin)app\]/i],[E,[D,I]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[E,/(.+)/,`Zalo`],k,[D,I]],[/(chromium)[\/ ]([-\w\.]+)/i],[E,k],[/ome-(lighthouse)$/i],[E,[D,et]],[/headlesschrome(?:\/([\w\.]+)| )/i],[k,[E,Nt+` Headless`]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[k,[E,Ft+` WebView2`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[E,Nt+` WebView`],k],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[k,[E,`Android`+U]],[/chrome\/([\w\.]+) mobile/i],[k,[E,H+`Chrome`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[E,k],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[k,[E,H+`Safari`]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[E,H+`Safari`]],[/version\/([\w\.\,]+) .*(safari)/i],[k,E],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[E,[k,`1`]],[/(webkit|khtml)\/([\w\.]+)/i],[E,k],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[E,H+It],k],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[E,`Netscape`],k],[/(wolvic|librewolf)\/([\w\.]+)/i],[E,k],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[k,[E,It+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[E,[k,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[E,[k,/[^\d\.]+./,qe]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[A,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[A,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[A,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[A,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[A,`arm`]],[/ sun4\w[;\)]/i],[[A,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[A,/ower/,qe,K]],[/mc680.0/i],[[A,`68k`]],[/winnt.+\[axp/i],[[A,`alpha`]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[j,[O,Ot],[D,N]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[j,[O,Ot],[D,M]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[j,[O,gt],[D,M]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[j,[O,gt],[D,N]],[/(macintosh);/i],[j,[O,gt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[j,[O,kt],[D,M]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[j,[O,xt],[D,N]],[/honor([-\w ]+)[;\)]/i],[j,[O,xt],[D,M]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[j,[O,yt],[D,N]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[j,[O,yt],[D,M]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[j,/_/g,` `],[O,jt],[D,N]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[j,/_/g,` `],[O,jt],[D,M]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-l]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[j,[O,Et],[D,M]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[j,[O,Dt],[D,M]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[j,[O,J,{OnePlus:[`203`,`304`,`403`,`404`,`413`,`415`],"*":Dt}],[D,N]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[j,[O,`BLU`],[D,M]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[j,[O,`Vivo`],[D,M]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[j,[O,`Realme`],[D,M]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[j,[O,bt],[D,N]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[j,[O,bt],[D,M]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[j,[O,wt],[D,M]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[j,[O,wt],[D,N]],[/\b(?:lg)?([vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[j,[O,St],[D,N]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[j,[O,St],[D,M]],[/(nokia) (t[12][01])/i],[O,j,[D,N]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[j,/_/g,` `],[D,M],[O,`Nokia`]],[/(pixel (c|tablet))\b/i],[j,[O,z],[D,N]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[j,[O,z],[D,M]],[/(google) (pixelbook( go)?)/i],[O,j],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[j,[O,At],[D,M]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[j,`Xperia Tablet`],[O,At],[D,N]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[j,[O,ht],[D,N]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[j,/(.+)/g,`Fire Phone $1`],[O,ht],[D,M]],[/(playbook);[-\w\),; ]+(rim)/i],[j,O,[D,N]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[j,[O,vt],[D,M]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[j,[O,_t],[D,N]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[j,[O,_t],[D,M]],[/(nexus 9)/i],[j,[O,`HTC`],[D,N]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[O,[j,/_/g,` `],[D,M]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[j,[O,`TCL`],[D,N]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[j,[O,`TCL`],[D,M]],[/(itel) ((\w+))/i],[[O,K],j,[D,J,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[j,[O,`Acer`],[D,N]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[j,[O,`Meizu`],[D,M]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[j,[O,`Ulefone`],[D,M]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[j,[O,`Energizer`],[D,M]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[j,[O,`Cat`],[D,M]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[j,[O,`Smartfren`],[D,M]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[j,[O,`Nothing`],[D,M]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[j,[O,`Archos`],[D,N]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[j,[O,`Archos`],[D,M]],[/; (n159v)/i],[j,[O,`HMD`],[D,M]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[O,j,[D,N]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[O,j,[D,M]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[O,j,[D,N]],[/(surface duo)/i],[j,[O,Ct],[D,N]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[j,[O,`Fairphone`],[D,M]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[j,[O,Tt],[D,N]],[/(sprint) (\w+)/i],[O,j,[D,M]],[/(kin\.[onetw]{3})/i],[[j,/\./g,` `],[O,Ct],[D,M]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[j,[O,Mt],[D,N]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[j,[O,Mt],[D,M]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[O,[D,P]],[/hbbtv.+maple;(\d+)/i],[[j,/^/,`SmartTV`],[O,Ot],[D,P]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[O,j,[D,P]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[O,St],[D,P]],[/(apple) ?tv/i],[O,[j,gt+` TV`],[D,P]],[/crkey.*devicetype\/chromecast/i],[[j,B+` Third Generation`],[O,z],[D,P]],[/crkey.*devicetype\/([^/]*)/i],[[j,/^/,`Chromecast `],[O,z],[D,P]],[/fuchsia.*crkey/i],[[j,B+` Nest Hub`],[O,z],[D,P]],[/crkey/i],[[j,B],[O,z],[D,P]],[/(portaltv)/i],[j,[O,Lt],[D,P]],[/droid.+aft(\w+)( bui|\))/i],[j,[O,ht],[D,P]],[/(shield \w+ tv)/i],[j,[O,Tt],[D,P]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[j,[O,kt],[D,P]],[/(bravia[\w ]+)( bui|\))/i],[j,[O,At],[D,P]],[/(mi(tv|box)-?\w+) bui/i],[j,[O,jt],[D,P]],[/Hbbtv.*(technisat) (.*);/i],[O,j,[D,P]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[O,/.+\/(\w+)/,`$1`,J,{LG:`lge`}],[j,Yt],[D,P]],[/(playstation \w+)/i],[j,[O,At],[D,Ze]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[j,[O,Ct],[D,Ze]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[O,J,{Nvidia:`Shield`,Anbernic:`RGCUBE`,Logitech:`GR0006`}],j,[D,Ze]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[j,[O,Ot],[D,F]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[O,j,[D,F]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[j,[O,Dt],[D,F]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[j,[O,gt],[D,F]],[/(opwwe\d{3})/i],[j,[O,Et],[D,F]],[/(moto 360)/i],[j,[O,wt],[D,F]],[/(smartwatch 3)/i],[j,[O,At],[D,F]],[/(g watch r)/i],[j,[O,St],[D,F]],[/droid.+; (wt63?0{2,3})\)/i],[j,[O,Mt],[D,F]],[/droid.+; (glass) \d/i],[j,[O,z],[D,Qe]],[/(pico) ([\w ]+) os\d/i],[O,j,[D,Qe]],[/(quest( \d| pro)?s?).+vr/i],[j,[O,Lt],[D,Qe]],[/mobile vr; rv.+firefox/i],[[D,Qe]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[O,[D,$e]],[/(aeobc)\b/i],[j,[O,ht],[D,$e]],[/(homepod).+mac os/i],[j,[O,gt],[D,$e]],[/windows iot/i],[[D,$e]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[j,[D,P]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[D,P]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[j,[D,J,{mobile:`Mobile`,xr:`VR`,"*":N}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[D,N]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[D,M]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[j,[O,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[k,[E,Ft+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[E,k],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[k,[E,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links|dillo)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[E,k],[/ladybird\//i],[[E,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[k,E]],os:[[/(windows nt) (6\.[23]); arm/i],[[E,/N/,`R`],[k,J,Zt]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[E,k],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[k,/(;|\))/g,``,J,Zt],[E,zt]],[/(windows ce)\/?([\d\.]*)/i],[E,k],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[k,/_/g,`.`],[E,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[E,`macOS`],[k,/_/g,`.`]],[/android ([\d\.]+).*crkey/i],[k,[E,B+` Android`]],[/fuchsia.*crkey\/([\d\.]+)/i],[k,[E,B+` Fuchsia`]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[k,[E,B+` SmartSpeaker`]],[/linux.*crkey\/([\d\.]+)/i],[k,[E,B+` Linux`]],[/crkey\/([\d\.]+)/i],[k,[E,B]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[k,E],[/(ubuntu) ([\w\.]+) like android/i],[[E,/(.+)/,`$1 Touch`],k],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[E,k],[/\(bb(10);/i],[k,[E,vt]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[k,[E,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i],[k,[E,It+` OS`]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[k,[E,`webOS`]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[k,J,{25:`120`,24:`108`,23:`94`,22:`87`,6:`79`,5:`68`,4:`53`,3:`38`,2:`538`,1:`537`,"*":`TV`}],[E,`webOS`]],[/watch(?: ?os[,\/ ]|\d,\d\/)([\d\.]+)/i],[k,[E,`watchOS`]],[/cros [\w]+(?:\)| ([\w\.]+)\b)/i],[k,[E,`Chrome OS`]],[/kepler ([\w\.]+); (aft|aeo)/i],[k,[E,`Vega OS`]],[/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[E,k],[/(sunos) ?([\d\.]*)/i],[[E,`Solaris`],k],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[E,k]]},tn=(function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return q.call(e.init,[[x,[E,k,Xe,D]],[S,[A]],[C,[D,j,O]],[w,[E,k]],[T,[E,k]]]),q.call(e.isIgnore,[[x,[k,Xe]],[w,[k]],[T,[k]]]),q.call(e.isIgnoreRgx,[[x,/ ?browser$/i],[T,/ ?os$/i]]),q.call(e.toString,[[x,[E,k]],[S,[A]],[C,[O,j]],[w,[E,k]],[T,[E,k]]]),e})(),nn=function(e,t){var n=tn.init[t],r=tn.isIgnore[t]||0,i=tn.isIgnoreRgx[t]||0,a=tn.toString[t]||0;function o(){q.call(this,n)}return o.prototype.getItem=function(){return e},o.prototype.withClientHints=function(){return G?G.getHighEntropyValues(mt).then(function(t){return e.setCH(new rn(t,!1)).parseCH().get()}):e.parseCH().get()},o.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=Ye&&(o.prototype.is=function(e){var t=!1;for(var n in this)if(this.hasOwnProperty(n)&&!Ht(r,n)&&K(i?qt(i,this[n]):this[n])==K(i?qt(i,e):e)){if(t=!0,e!=b.UNDEFINED)break}else if(e==b.UNDEFINED&&t){t=!t;break}return t},o.prototype.toString=function(){var e=qe;for(var t in a)typeof this[a[t]]!==b.UNDEFINED&&(e+=(e?` `:qe)+this[a[t]]);return e||b.UNDEFINED}),o.prototype.then=function(e){var t=this,n=function(){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e])};n.prototype={is:o.prototype.is,toString:o.prototype.toString,withClientHints:o.prototype.withClientHints,withFeatureCheck:o.prototype.withFeatureCheck};var r=new n;return e(r),r},new o};function rn(e,t){if(e||={},q.call(this,mt),t)q.call(this,[[tt,Gt(e[R])],[nt,Gt(e[ot])],[M,/\?1/.test(e[ut])],[j,Jt(e[dt])],[rt,Jt(e[ft])],[it,Jt(e[pt])],[A,Jt(e[st])],[L,Gt(e[lt])],[at,Jt(e[ct])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==b.UNDEFINED&&(this[n]=e[n])}function Y(e,t,n,r){return q.call(this,[[`itemType`,e],[`ua`,t],[`uaCH`,r],[`rgxMap`,n],[`data`,nn(this,e)]]),this}Y.prototype.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data},Y.prototype.set=function(e,t){return this.data[e]=t,this},Y.prototype.setCH=function(e){return this.uaCH=e,this},Y.prototype.detectFeature=function(){if(W&&W.userAgent==this.ua)switch(this.itemType){case x:W.brave&&typeof W.brave.isBrave==b.FUNCTION&&this.set(E,`Brave`);break;case C:!this.get(D)&&G&&G[M]&&this.set(D,M),this.get(j)==`Macintosh`&&W&&typeof W.standalone!==b.UNDEFINED&&W.maxTouchPoints&&W.maxTouchPoints>2&&this.set(j,`iPad`).set(D,N);break;case T:!this.get(E)&&G&&G[rt]&&this.set(E,G[rt]);break;case Ye:var e=this.data,t=function(t){return e[t].getItem().detectFeature().get()};this.set(x,t(x)).set(S,t(S)).set(C,t(C)).set(w,t(w)).set(T,t(T))}return this},Y.prototype.parseUA=function(){switch(this.itemType!=Ye&&Xt.call(this.data,this.ua,this.rgxMap),this.itemType){case x:this.set(Xe,Kt(this.get(k)));break;case T:if(this.get(E)==`iOS`&&this.get(k)==`18.6`){var e=/\) Version\/([\d\.]+)/.exec(this.ua);e&&parseInt(e[1].substring(0,2),10)>=26&&this.set(k,e[1])}break}return this},Y.prototype.parseCH=function(){var e=this.uaCH,t=this.rgxMap;switch(this.itemType){case x:case w:var n=e[nt]||e[tt],r;if(n)for(var i=0;i<n.length;i++){var a=n[i].brand||n[i],o=n[i].version;this.itemType==x&&!/not.a.brand/i.test(a)&&(!r||/Chrom/.test(r)&&a!=Pt||r==Ft&&/WebView2/.test(a))&&(a=J(a,$t),r=this.get(E),r&&!/Chrom/.test(r)&&/Chrom/.test(a)||this.set(E,a).set(k,o).set(Xe,Kt(o)),r=a),this.itemType==w&&a==Pt&&this.set(k,o)}break;case S:var s=e[A];s&&(s&&e[at]==`64`&&(s+=`64`),Xt.call(this.data,s+`;`,t));break;case C:if(e[M]&&this.set(D,M),e[j]&&(this.set(j,e[j]),!this.get(D)||!this.get(O))){var c={};Xt.call(c,`droid 9; `+e[j]+`)`,t),!this.get(D)&&c.type&&this.set(D,c.type),!this.get(O)&&c.vendor&&this.set(O,c.vendor)}if(e[L]){var l;if(typeof e[L]!=`string`)for(var u=0;!l&&u<e[L].length;)l=J(e[L][u++],Qt);else l=J(e[L],Qt);this.set(D,l)}break;case T:var d=e[rt];if(d){var f=e[it];d==zt&&(f=parseInt(Kt(f),10)>=13?`11`:`10`),this.set(E,d).set(k,f)}this.get(E)==zt&&e[j]==`Xbox`&&this.set(E,`Xbox`).set(k,void 0);break;case Ye:var p=this.data,m=function(t){return p[t].getItem().setCH(e).parseCH().get()};this.set(x,m(x)).set(S,m(S)).set(C,m(C)).set(w,m(w)).set(T,m(T))}return this};function X(e,t,n){if(typeof e===b.OBJECT?(Ut(e,!0)?(typeof t===b.OBJECT&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===b.STRING&&!Ut(t,!0)&&(n=t,t=void 0),n)if(typeof n.append===b.FUNCTION){var r={};n.forEach(function(e,t){r[String(t).toLowerCase()]=e}),n=r}else{var i={};for(var a in n)n.hasOwnProperty(a)&&(i[String(a).toLowerCase()]=n[a]);n=i}if(!(this instanceof X))return new X(e,t,n).getResult();var o=typeof e===b.STRING?e:n&&n[Ke]?n[Ke]:W&&W.userAgent?W.userAgent:qe,s=new rn(n,!0),c=t?Bt(en,t):en,l=function(e){return e==Ye?function(){return new Y(e,o,c,s).set(`ua`,o).set(x,this.getBrowser()).set(S,this.getCPU()).set(C,this.getDevice()).set(w,this.getEngine()).set(T,this.getOS()).get()}:function(){return new Y(e,o,c[e],s).parseUA().get()}};return q.call(this,[[`getBrowser`,l(x)],[`getCPU`,l(S)],[`getDevice`,l(C)],[`getEngine`,l(w)],[`getOS`,l(T)],[`getResult`,l(Ye)],[`getUA`,function(){return o}],[`setUA`,function(e){return Wt(e)&&(o=Yt(e,Ge)),this}]]).setUA(o),this}X.VERSION=We,X.BROWSER=Vt([E,k,Xe,D]),X.CPU=Vt([A]),X.DEVICE=Vt([j,O,D,Ze,M,P,N,F,$e]),X.ENGINE=X.OS=Vt([E,k]);let an=()=>{let e=window.navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(e)?`tablet`:/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(e)?`mobile`:`desktop`};_();var on=class e extends be{constructor(...t){super(...t),this.sendRequest=function(t,n){t.event_family=`player_init`,this.get(e.analyticsServerUrl,t,n)},this.sendRequestSynchronous=function(t,n){t.event_family=`player_init`,this.get(e.analyticsServerUrl,t,n,!1)},this.getAnalyticsServerUrl=()=>e.analyticsServerUrl}static{this.analyticsServerUrl=Te}};_();var sn=class e extends be{constructor(...t){super(...t),this.sendRequest=function(t,n){t.event_family=`session`;let r=Ce()?Fe({...t}):null;this.get(e.analyticsServerUrl,t,n),r&&this.get(e.analyticsServerUrlV2,r,g.noOp)},this.sendRequestSynchronous=function(t,n){t.event_family=`session`;let r=Ce()?Fe({...t}):null;this.get(e.analyticsServerUrl,t,n,!1),r&&this.get(e.analyticsServerUrlV2,r,g.noOp,!1)},this.getAnalyticsServerUrl=()=>e.analyticsServerUrl}static{this.analyticsServerUrl=Te}static{this.analyticsServerUrlV2=De}},cn=`2.1.3`;let Z=new X().getResult();var ln=class{constructor(e){this.SDKVersion=cn,this.config=e,this.sessionCreationCall=new sn,this.playerInitCall=new on,this.setConfigParameters()}setConfigParameters(e=this.config){this.customData1=g.getCustomDataString(e.customData1),this.customData2=g.getCustomDataString(e.customData2),this.customData3=g.getCustomDataString(e.customData3),this.customData4=g.getCustomDataString(e.customData4),this.customData5=g.getCustomDataString(e.customData5),this.customData6=g.getCustomDataString(e.customData6),this.customData7=g.getCustomDataString(e.customData7),this.customData8=g.getCustomDataString(e.customData8),this.customData9=g.getCustomDataString(e.customData9),this.customData10=g.getCustomDataString(e.customData10),this.customPlayerIntegrationVersion=g.getCustomDataString(e.customPlayerIntegrationVersion),this.customPlayerName=g.getCustomDataString(e.customPlayerName),this.customPlayerVersion=g.getCustomDataString(e.customPlayerVersion),this.customPageType=g.getCustomDataString(e.customPageType),this.customUserId=g.getCustomDataString(e.userId),this.userName=g.getCustomDataString(e.userName),this.userEMail=g.getCustomDataString(e.userEMail??e.userEmail),this.userPhone=g.getCustomDataString(e.userPhone),this.userProfileImage=g.getCustomDataString(e.userProfileImage),this.userAddressLine1=g.getCustomDataString(e.userAddressLine1),this.userAddressLine2=g.getCustomDataString(e.userAddressLine2),this.userCity=g.getCustomDataString(e.userCity),this.userState=g.getCustomDataString(e.userState),this.userCountry=g.getCustomDataString(e.userCountry),this.userZipcode=g.getCustomDataString(e.userZipcode),this.customContentType=g.getCustomDataString(e.customContentType),this.customVideoDurationMillis=g.getCustomDataString(e.customVideoDurationMillis),this.customEncodingVariant=g.getCustomDataString(e.customEncodingVariant),this.customVideoLanguage=g.getCustomDataString(e.customVideoLanguage),this.customVideoId=g.getCustomDataString(e.customVideoId),this.customWorkspaceId=g.getCustomDataString(e.customWorkspaceId),this.customVideoSeries=g.getCustomDataString(e.customVideoSeries),this.customVideoProducer=g.getCustomDataString(e.customVideoProducer),this.customVideoTitle=g.getCustomDataString(e.customVideoTitle),this.customVideoVariantName=g.getCustomDataString(e.customVideoVariantName),this.customVideoVariant=g.getCustomDataString(e.customVideoVariant),this.SDKVersion=cn,this.experimentName=e.experimentName}updateCustomData(e){this.customData1=g.getCustomDataString(e.customData1),this.customData2=g.getCustomDataString(e.customData2),this.customData3=g.getCustomDataString(e.customData3),this.customData4=g.getCustomDataString(e.customData4),this.customData5=g.getCustomDataString(e.customData5),this.customData6=g.getCustomDataString(e.customData6),this.customData7=g.getCustomDataString(e.customData7),this.customData8=g.getCustomDataString(e.customData8),this.customData9=g.getCustomDataString(e.customData9),this.customData10=g.getCustomDataString(e.customData10)}updateCustomUserData(e){this.customUserId=g.getCustomDataString(e.userId),this.userName=g.getCustomDataString(e.userName),this.userEMail=g.getCustomDataString(e.userEMail??e.userEmail),this.userPhone=g.getCustomDataString(e.userPhone),this.userProfileImage=g.getCustomDataString(e.userProfileImage),this.userAddressLine1=g.getCustomDataString(e.userAddressLine1),this.userAddressLine2=g.getCustomDataString(e.userAddressLine2),this.userCity=g.getCustomDataString(e.userCity),this.userState=g.getCustomDataString(e.userState),this.userCountry=g.getCustomDataString(e.userCountry),this.userZipcode=g.getCustomDataString(e.userZipcode)}updateCustomVideoData(e){this.customContentType=g.getCustomDataString(e.customContentType),this.customVideoDurationMillis=g.getCustomDataString(e.customVideoDurationMillis),this.customEncodingVariant=g.getCustomDataString(e.customEncodingVariant),this.customVideoLanguage=g.getCustomDataString(e.customVideoLanguage),this.customVideoId=g.getCustomDataString(e.customVideoId),this.customWorkspaceId=g.getCustomDataString(e.customWorkspaceId),this.customVideoSeries=g.getCustomDataString(e.customVideoSeries),this.customVideoProducer=g.getCustomDataString(e.customVideoProducer),this.customVideoTitle=g.getCustomDataString(e.customVideoTitle),this.customVideoVariantName=g.getCustomDataString(e.customVideoVariantName),this.customVideoVariant=g.getCustomDataString(e.customVideoVariant)}updateCustomPlayerData(e){this.customPlayerIntegrationVersion=g.getCustomDataString(e.customPlayerIntegrationVersion),this.customPlayerName=g.getCustomDataString(e.customPlayerName),this.customPlayerVersion=g.getCustomDataString(e.customPlayerVersion),this.customPageType=g.getCustomDataString(e.customPageType)}setUserId(e=!1,t=null){if(t){this.userId=t;return}if(e){this.userId=g.uuidv4();return}let n=g.getCookie(`gumlet_user_id`);!n||n===``?this.userId=g.setCookie(`gumlet_user_id`,720*60):this.userId=n}setSessionId(e=!1,t=null,n=!0){if(t){this.sessionId=t,this.setSessionData(),n&&this.sessionCreationCall.sendRequest(this.sessionData,g.noOp);return}if(e){this.sessionId=g.uuidv4();return}let r=g.getCookie(`gumlet_session_id`);!r||r===``?(this.sessionId=g.setCookie(`gumlet_session_id`,30),this.setSessionData(),this.sessionCreationCall.sendRequest(this.sessionData,g.noOp)):(this.sessionId=r,this.setSessionData())}setPlayerInstanceId(e){this.playerInstanceId=e?e():g.uuidv4(),this.setPlayerData()}setPlaybackId(e){this.playbackId=e?e():g.uuidv4()}resetSessionExpiry(){this.config.test||this.config.sessionID||(g.setCookie(`gumlet_session_id`,30,this.sessionId),g.setCookie(`gumlet_user_id`,720*60,this.userId))}setSessionData(){if(this.sessionData={session_id:this.sessionId,property_id:this.propertyId,user_id:this.userId,custom_user_id:this.customUserId,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,user_name:this.userName,user_email:this.userEMail,user_phone:this.userPhone,user_profile_image:this.userProfileImage,user_address_line1:this.userAddressLine1,user_address_line2:this.userAddressLine2,user_city:this.userCity,user_state:this.userState,user_country:this.userCountry,user_zipcode:this.userZipcode,viewer_client_version:this.SDKVersion,custom_user_email:this.userEMail,custom_content_type:this.customContentType,custom_video_duration_millis:this.customVideoDurationMillis,custom_encoding_variant:this.customEncodingVariant,custom_video_language:this.customVideoLanguage,custom_video_id:this.customVideoId,custom_workspace_id:this.customWorkspaceId,custom_video_series:this.customVideoSeries,custom_video_producer:this.customVideoProducer,custom_video_title:this.customVideoTitle,custom_video_variant_name:this.customVideoVariantName,custom_video_variant:this.customVideoVariant},this.config.deviceData){let e=this.config.deviceData;this.sessionData.meta_device_name=e.meta_device_name,this.sessionData.meta_device_manufacturer=e.meta_device_manufacturer,this.sessionData.meta_operating_system_version=e.meta_operating_system_version,this.sessionData.meta_operating_system=e.meta_operating_system,this.sessionData.meta_browser=e.meta_browser,this.sessionData.meta_device_display_dpr=e.meta_device_display_dpr,this.sessionData.meta_browser_version=e.meta_browser_version,this.sessionData.meta_device_category=e.meta_device_category,this.sessionData.meta_device_architecture=e.meta_device_architecture,this.sessionData.meta_device_display_width=e.meta_device_display_width,this.sessionData.meta_device_display_height=e.meta_device_display_height,this.sessionData.meta_device_is_touchscreen=e.meta_device_is_touchscreen,this.sessionData.meta_browser_language=e.meta_browser_language}else this.sessionData.meta_device_name=Z.device.model,this.sessionData.meta_device_manufacturer=Z.device.vendor,this.sessionData.meta_operating_system_version=Z.os.version,this.sessionData.meta_operating_system=Z.os.name,this.sessionData.meta_browser=Z.browser.name,this.sessionData.meta_browser_version=Z.browser.version,this.sessionData.meta_device_category=an(),this.sessionData.meta_device_architecture=Z.cpu.architecture,typeof window<`u`&&(this.sessionData.meta_device_display_dpr=parseInt(String(window.devicePixelRatio),10),this.sessionData.meta_device_display_width=window.screen.width,this.sessionData.meta_device_display_height=window.screen.height,this.sessionData.meta_browser_language=navigator?navigator.language||navigator.userLanguage:``,`ontouchstart`in document.documentElement&&(this.sessionData.meta_device_is_touchscreen=`true`))}setPlayerData(e){if(this.playerData={player_instance_id:this.playerInstanceId,property_id:this.propertyId,session_id:this.sessionId,user_id:this.userId,custom_user_id:this.customUserId,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,player_integration_version:this.customPlayerIntegrationVersion,meta_page_type:this.customPageType,meta_page_url:this.pageURL},this.config.deviceData){let e=this.config.playerData||{};this.playerData.player_preload=e.player_preload,this.playerData.player_autoplay=e.player_autoplay,this.playerData.player_software_version=e.player_software_version,this.playerData.player_integration_version=e.player_integration_version,this.playerData.player_name=e.player_name,this.playerData.player_language_code=e.player_language_code,this.playerData.player_software=e.player_software,this.playerData.meta_page_url=e.meta_page_url,this.playerData.meta_page_type=e.meta_page_type,this.playerData.player_height_pixels=e.player_height_pixels,this.playerData.player_width_pixels=e.player_width_pixels}e&&g.validNumber(e.videoWindowHeight)&&(this.playerData.player_height_pixels=e.videoWindowHeight),e&&g.validNumber(e.videoWindowWidth)&&(this.playerData.player_width_pixels=e.videoWindowWidth),e&&g.validBoolean(e.autoplay)&&(this.playerData.player_autoplay=e.autoplay),e&&g.validBoolean(e.preload)&&(this.playerData.player_preload=e.preload),e&&g.validString(e.version)&&(this.playerData.player_software_version=e.version),e&&g.validString(e.audioLanguage)&&(this.playerData.player_language_code=e.audioLanguage),e&&g.validString(e.playerSoftware)&&(this.playerData.player_software=e.playerSoftware),this.customPlayerName&&(this.playerData.player_software=this.customPlayerName),this.customPlayerVersion&&(this.playerData.player_software_version=this.customPlayerVersion)}},un=class{constructor(e,t){this.sample={},this.currentTime=0,this.isMuted=!1,this.orientation=`undetected`,this.playbackWatchTime=0,this.config=e,this.session=t;try{this.orientation=screen.orientation.type.match(/\w+/)[0],screen.orientation.addEventListener(`change`,()=>{this.orientation=screen.orientation.type.match(/\w+/)[0]})}catch{this.orientation=`undetected`}}setDuration(e){}setPlaybackWatchTime(e){this.playbackWatchTime=e}getPlaybackWatchTime(){return this.playbackWatchTime}setVideoData(e){e&&g.validNumber(e.duration)&&(this.videoDuration=g.calculateTime(e.duration)),e&&g.validString(e.streamType)&&(this.videoSourceType=e.streamType,e.streamType===`dash`&&g.validString(e.mpdUrl)?(this.videoSourceUrl=e.mpdUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e.streamType===`hls`&&g.validString(e.m3u8Url)?(this.videoSourceUrl=e.m3u8Url,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e.streamType===`hls`&&g.validString(e.streamUrl)?(this.videoSourceUrl=e.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e.streamType===`progressive`&&g.validString(e.progUrl)?(this.videoSourceUrl=e.progUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e?.streamUrl&&(this.videoSourceUrl=e.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname)),e?.streamUrl&&(this.videoSourceUrl=e.streamUrl),e?.sourceHostName&&(this.videoSourceHostname=e.sourceHostName),e?.muted&&(this.isMuted=e.muted),e?.currentVideoData?.height&&g.validNumber(e.currentVideoData.height)&&e.currentVideoData.height>0&&(this.videoHeightPixels=e.currentVideoData.height),e?.currentVideoData?.width&&g.validNumber(e.currentVideoData.width)&&e.currentVideoData.width>0&&(this.videoWidthPixels=e.currentVideoData.width),e?.currentVideoData?.bitrate&&g.validNumber(e.currentVideoData.bitrate)&&e.currentVideoData.bitrate>-1&&(this.videoBitrate=e.currentVideoData.bitrate/1e6),e?.currentVideoData?.audioCodec&&g.validString(e.currentVideoData.audioCodec)&&e.currentVideoData.audioCodec.length>0&&(this.audioCodec=e.currentVideoData.audioCodec),e?.currentVideoData&&g.validString(e.currentVideoData.videoCodec)&&e.currentVideoData.videoCodec.length>0&&(this.videoCodec=e.currentVideoData.videoCodec);let t=this.session,n=0;if(this.videoHeightPixels&&t.playerData?.player_height_pixels&&t.sessionData?.meta_device_display_dpr?n=t.playerData.player_height_pixels*t.sessionData.meta_device_display_dpr/this.videoHeightPixels-1:(this.upscalePercentage=void 0,this.downscalePercentage=void 0),this.videoHeightPixels&&t.playerData?.player_height_pixels&&t.sessionData?.meta_device_display_dpr&&(n>0?(this.upscalePercentage=n*100,this.downscalePercentage=0):n<0?(this.upscalePercentage=0,this.downscalePercentage=n*100*-1):(this.upscalePercentage=0,this.downscalePercentage=0)),this.videoSourceUrl)try{let e=new URL(this.videoSourceUrl);e.hostname===`video.gumlet.io`&&!t.customVideoId&&(t.customVideoId=e.pathname.split(`/`)[2])}catch{}}setPlaybackSettingsFromLoadedEvent(e){e&&g.validNumber(e.currentTime)&&(this.currentTime=g.calculateTime(e.currentTime)),e&&g.validBoolean(e.isFullScreen)&&(this.isFullScreen=e.isFullScreen),e&&g.validBoolean(e.isCasting)&&(this.isCasting=e.isCasting)}setupSample(){let e=this.session;this.sample={property_id:e.propertyId,session_id:e.sessionId,user_id:e.userId,player_instance_id:e.playerInstanceId,playback_id:e.playbackId,from:void 0,to:void 0,playback_time_instant_millis:void 0,bitrate_mbps:this.videoBitrate,error_code:void 0,error:void 0,error_text:void 0,video_cover:void 0,video_cover_reference:void 0,player_remote_played:void 0,video_total_duration_millis:this.videoDuration,video_width_pixels:void 0,video_height_pixels:void 0,video_source_url:void 0,video_source_hostname:void 0,video_source_type:void 0,custom_content_type:e.customContentType,custom_video_duration_millis:e.customVideoDurationMillis,custom_encoding_variant:e.customEncodingVariant,custom_video_language:e.customVideoLanguage,custom_video_id:e.customVideoId,custom_workspace_id:e.customWorkspaceId,custom_video_series:e.customVideoSeries,custom_video_producer:e.customVideoProducer,custom_video_title:e.customVideoTitle,custom_video_variant_name:e.customVideoVariantName,custom_video_variant:e.customVideoVariant,muted:this.isMuted,casting:void 0,fullscreen:this.isFullScreen,video_downscale_percentage:void 0,video_upscale_percentage:void 0,orientation:void 0,orientation_from:void 0,quality:void 0,quality_from:void 0,previous_event:void 0,millis_from_previous_event:void 0,video_codec:void 0,audio_codec:void 0,custom_data_1:e.customData1,custom_data_2:e.customData2,custom_data_3:e.customData3,custom_data_4:e.customData4,custom_data_5:e.customData5,custom_data_6:e.customData6,custom_data_7:e.customData7,custom_data_8:e.customData8,custom_data_9:e.customData9,custom_data_10:e.customData10,custom_event_data:void 0,playback_watch_time:void 0}}getSample(e=null,t={}){let n=this.session,r=this.sample;if(r.event=e,r.event_id=n.config?.getUUID?n.config.getUUID():g.uuidv4(),r.custom_data_1=n.customData1,r.custom_data_2=n.customData2,r.custom_data_3=n.customData3,r.custom_data_4=n.customData4,r.custom_data_5=n.customData5,r.custom_data_6=n.customData6,r.custom_data_7=n.customData7,r.custom_data_8=n.customData8,r.custom_data_9=n.customData9,r.custom_data_10=n.customData10,r.custom_content_type=n.customContentType,r.custom_video_duration_millis=n.customVideoDurationMillis,r.custom_encoding_variant=n.customEncodingVariant,r.custom_video_language=n.customVideoLanguage,r.custom_video_id=n.customVideoId,r.custom_workspace_id=n.customWorkspaceId,r.custom_video_series=n.customVideoSeries,r.custom_video_producer=n.customVideoProducer,r.custom_video_title=n.customVideoTitle,r.custom_video_variant_name=n.customVideoVariantName,r.custom_video_variant=n.customVideoVariant,r.fullscreen=this.isFullScreen,r.muted=this.isMuted,r.video_width_pixels=this.videoWidthPixels,r.video_height_pixels=this.videoHeightPixels,r.video_total_duration_millis=this.videoDuration,r.bitrate=this.videoBitrate,r.audio_codec=this.audioCodec,r.video_codec=this.videoCodec,r.orientation=this.orientation,r.playback_time_instant_millis=this.currentTime,r.video_source_type=this.videoSourceType,r.video_source_url=this.videoSourceUrl,r.video_upscale_percentage=this.upscalePercentage,r.video_downscale_percentage=this.downscalePercentage,r.video_source_hostname=this.videoSourceHostname,r.custom_event_data=void 0,r.playback_watch_time=this.playbackWatchTime,Object.keys(t).forEach(e=>{r[e]=t[e]}),typeof window<`u`&&window.parent!==void 0&&window.navigator)try{typeof window.navigator.getBattery==`function`&&window.navigator.getBattery().then(e=>{e&&(r.battery_level_percentage=e.level*100,r.battery_charging=e.charging)})}catch{}return r}};Re();var dn=class{constructor(e,t){this.licensing=`granted`,this.analyticsCall=e,this.sampleBuilder=t}sendRequest(e,t={}){let n=this.sampleBuilder.getSample(e,t);if(e!==y.END){if(n.playback_time_instant_millis&&n.video_total_duration_millis&&n.playback_time_instant_millis>n.video_total_duration_millis)return}else n.video_total_duration_millis&&(n.playback_time_instant_millis=Math.min(n.playback_time_instant_millis??0,n.video_total_duration_millis));this.analyticsCall.sendRequest(n,g.noOp)}sendRequestAsync(e,t={}){return new Promise((n,r)=>{let i=this.sampleBuilder.getSample(e,t);if(i.playback_time_instant_millis&&i.video_total_duration_millis&&i.playback_time_instant_millis>i.video_total_duration_millis){n(406);return}this.analyticsCall.sendRequestAsync(i).then(e=>n(e)).catch(e=>r(e))})}sendAndClear(e=null,t={}){if(!e){v.log(`event null passed not hitting the ingestion API`);return}this.sampleBuilder.videoDuration&&this.sampleBuilder.videoDuration>864e5||this.sendRequest(e,t)}sendAndClearAsync(e=null,t={}){return new Promise((n,r)=>{if(!e){v.log(`event null passed not hitting the ingestion API`),r(`event null passed not hitting the ingestion API`);return}this.sendRequestAsync(e,t).then(e=>n(e)).catch(e=>r(e))})}sendUnload(){if(this.licensing===`denied`)return;let e=this.sampleBuilder.sample;if(navigator.sendBeacon===void 0){this.sendSynchronous();return}fetch(this.analyticsCall.getAnalyticsServerUrl(),{method:`POST`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}}).then(e=>{e.ok||this.sendSynchronous()}).catch(()=>{this.sendSynchronous()})}sendSynchronous(){this.licensing!==`denied`&&this.analyticsCall.sendRequestSynchronous(this.sampleBuilder.sample,g.noOp)}},fn=c(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define(`StateMachine`,[],r):typeof e==`object`?e.StateMachine=r():n.StateMachine=r()})(e,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=5)})([(function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i;for(n=1;n<arguments.length;n++)for(i in r=arguments[n],r)r.hasOwnProperty(i)&&(e[i]=r[i]);return e}}),(function(e,t,n){"use strict";var r=n(0);e.exports={build:function(e,t){var n,i,a,o=t.plugins;for(n=0,i=o.length;n<i;n++)a=o[n],a.methods&&r(e,a.methods),a.properties&&Object.defineProperties(e,a.properties)},hook:function(e,t,n){var r,i,a,o,s=e.config.plugins,c=[e.context];for(n&&(c=c.concat(n)),r=0,i=s.length;r<i;r++)o=s[r],a=s[r][t],a&&a.apply(o,c)}}}),(function(e,t,n){"use strict";function r(e){if(e.length===0)return e;var t,n,r=e.split(/[_-]/);if(r.length===1&&r[0][0].toLowerCase()===r[0][0])return e;for(n=r[0].toLowerCase(),t=1;t<r.length;t++)n=n+r[t].charAt(0).toUpperCase()+r[t].substring(1).toLowerCase();return n}r.prepended=function(e,t){return t=r(t),e+t[0].toUpperCase()+t.substring(1)},e.exports=r}),(function(e,t,n){"use strict";var r=n(0),i=n(2);function a(e,t){e||={},this.options=e,this.defaults=t.defaults,this.states=[],this.transitions=[],this.map={},this.lifecycle=this.configureLifecycle(),this.init=this.configureInitTransition(e.init),this.data=this.configureData(e.data),this.methods=this.configureMethods(e.methods),this.map[this.defaults.wildcard]={},this.configureTransitions(e.transitions||[]),this.plugins=this.configurePlugins(e.plugins,t.plugin)}r(a.prototype,{addState:function(e){this.map[e]||(this.states.push(e),this.addStateLifecycleNames(e),this.map[e]={})},addStateLifecycleNames:function(e){this.lifecycle.onEnter[e]=i.prepended(`onEnter`,e),this.lifecycle.onLeave[e]=i.prepended(`onLeave`,e),this.lifecycle.on[e]=i.prepended(`on`,e)},addTransition:function(e){this.transitions.indexOf(e)<0&&(this.transitions.push(e),this.addTransitionLifecycleNames(e))},addTransitionLifecycleNames:function(e){this.lifecycle.onBefore[e]=i.prepended(`onBefore`,e),this.lifecycle.onAfter[e]=i.prepended(`onAfter`,e),this.lifecycle.on[e]=i.prepended(`on`,e)},mapTransition:function(e){var t=e.name,n=e.from,r=e.to;return this.addState(n),typeof r!=`function`&&this.addState(r),this.addTransition(t),this.map[n][t]=e,e},configureLifecycle:function(){return{onBefore:{transition:`onBeforeTransition`},onAfter:{transition:`onAfterTransition`},onEnter:{state:`onEnterState`},onLeave:{state:`onLeaveState`},on:{transition:`onTransition`}}},configureInitTransition:function(e){return typeof e==`string`?this.mapTransition(r({},this.defaults.init,{to:e,active:!0})):typeof e==`object`?this.mapTransition(r({},this.defaults.init,e,{active:!0})):(this.addState(this.defaults.init.from),this.defaults.init)},configureData:function(e){return typeof e==`function`?e:typeof e==`object`?function(){return e}:function(){return{}}},configureMethods:function(e){return e||{}},configurePlugins:function(e,t){e||=[];var n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],typeof i==`function`&&(e[n]=i=i()),i.configure&&i.configure(this);return e},configureTransitions:function(e){var t,n,r,i,a,o=this.defaults.wildcard;for(n=0;n<e.length;n++)for(r=e[n],i=Array.isArray(r.from)?r.from:[r.from||o],a=r.to||o,t=0;t<i.length;t++)this.mapTransition({name:r.name,from:i[t],to:a})},transitionFor:function(e,t){var n=this.defaults.wildcard;return this.map[e][t]||this.map[n][t]},transitionsFor:function(e){var t=this.defaults.wildcard;return Object.keys(this.map[e]).concat(Object.keys(this.map[t]))},allStates:function(){return this.states},allTransitions:function(){return this.transitions}}),e.exports=a}),(function(e,t,n){var r=n(0),i=n(6),a=n(1),o=[null,[]];function s(e,t){this.context=e,this.config=t,this.state=t.init.from,this.observers=[e]}r(s.prototype,{init:function(e){if(r(this.context,this.config.data.apply(this.context,e)),a.hook(this,`init`),this.config.init.active)return this.fire(this.config.init.name,[])},is:function(e){return Array.isArray(e)?e.indexOf(this.state)>=0:this.state===e},isPending:function(){return this.pending},can:function(e){return!this.isPending()&&!!this.seek(e)},cannot:function(e){return!this.can(e)},allStates:function(){return this.config.allStates()},allTransitions:function(){return this.config.allTransitions()},transitions:function(){return this.config.transitionsFor(this.state)},seek:function(e,t){var n=this.config.defaults.wildcard,r=this.config.transitionFor(this.state,e),i=r&&r.to;return typeof i==`function`?i.apply(this.context,t):i===n?this.state:i},fire:function(e,t){return this.transit(e,this.state,this.seek(e,t),t)},transit:function(e,t,n,r){var i=this.config.lifecycle,a=this.config.options.observeUnchangedState||t!==n;return n?this.isPending()?this.context.onPendingTransition(e,t,n):(this.config.addState(n),this.beginTransit(),r.unshift({transition:e,from:t,to:n,fsm:this.context}),this.observeEvents([this.observersForEvent(i.onBefore.transition),this.observersForEvent(i.onBefore[e]),a?this.observersForEvent(i.onLeave.state):o,a?this.observersForEvent(i.onLeave[t]):o,this.observersForEvent(i.on.transition),a?[`doTransit`,[this]]:o,a?this.observersForEvent(i.onEnter.state):o,a?this.observersForEvent(i.onEnter[n]):o,a?this.observersForEvent(i.on[n]):o,this.observersForEvent(i.onAfter.transition),this.observersForEvent(i.onAfter[e]),this.observersForEvent(i.on[e])],r)):this.context.onInvalidTransition(e,t,n)},beginTransit:function(){this.pending=!0},endTransit:function(e){return this.pending=!1,e},failTransit:function(e){throw this.pending=!1,e},doTransit:function(e){this.state=e.to},observe:function(e){if(e.length===2){var t={};t[e[0]]=e[1],this.observers.push(t)}else this.observers.push(e[0])},observersForEvent:function(e){for(var t=0,n=this.observers.length,r,i=[];t<n;t++)r=this.observers[t],r[e]&&i.push(r);return[e,i,!0]},observeEvents:function(e,t,n,r){if(e.length===0)return this.endTransit(r===void 0?!0:r);var i=e[0][0],o=e[0][1],s=e[0][2];if(t[0].event=i,i&&s&&i!==n&&a.hook(this,`lifecycle`,t),o.length===0)return e.shift(),this.observeEvents(e,t,i,r);var c=o.shift(),l=c[i].apply(c,t);return l&&typeof l.then==`function`?l.then(this.observeEvents.bind(this,e,t,i)).catch(this.failTransit.bind(this)):l===!1?this.endTransit(!1):this.observeEvents(e,t,i,l)},onInvalidTransition:function(e,t,n){throw new i(`transition is invalid in current state`,e,t,n,this.state)},onPendingTransition:function(e,t,n){throw new i(`transition is invalid while previous transition is still in progress`,e,t,n,this.state)}}),e.exports=s}),(function(e,t,n){"use strict";var r=n(0),i=n(2),a=n(1),o=n(3),s=n(4),c={is:function(e){return this._fsm.is(e)},can:function(e){return this._fsm.can(e)},cannot:function(e){return this._fsm.cannot(e)},observe:function(){return this._fsm.observe(arguments)},transitions:function(){return this._fsm.transitions()},allTransitions:function(){return this._fsm.allTransitions()},allStates:function(){return this._fsm.allStates()},onInvalidTransition:function(e,t,n){return this._fsm.onInvalidTransition(e,t,n)},onPendingTransition:function(e,t,n){return this._fsm.onPendingTransition(e,t,n)}},l={state:{configurable:!1,enumerable:!0,get:function(){return this._fsm.state},set:function(e){throw Error(`use transitions to change state`)}}};function u(e){return f(this||{},e)}function d(){var e,t;typeof arguments[0]==`function`?(e=arguments[0],t=arguments[1]||{}):(e=function(){this._fsm.apply(this,arguments)},t=arguments[0]||{});var n=new o(t,u);return p(e.prototype,n),e.prototype._fsm.config=n,e}function f(e,t){return p(e,new o(t,u)),e._fsm(),e}function p(e,t){if(typeof e!=`object`||Array.isArray(e))throw Error(`StateMachine can only be applied to objects`);a.build(e,t),Object.defineProperties(e,l),r(e,c),r(e,t.methods),t.allTransitions().forEach(function(t){e[i(t)]=function(){return this._fsm.fire(t,[].slice.call(arguments))}}),e._fsm=function(){this._fsm=new s(this,t),this._fsm.init(arguments)}}u.version=`3.0.1`,u.factory=d,u.apply=f,u.defaults={wildcard:`*`,init:{name:`init`,from:`none`}},e.exports=u}),(function(e,t,n){"use strict";e.exports=function(e,t,n,r,i){this.message=e,this.transition=t,this.from=n,this.to=r,this.current=i}})])})})),pn=l({GumletStateMachine:()=>hn}),mn,hn,gn=s((()=>{mn=d(fn(),1),Re(),_(),hn=class{constructor(e,t={}){this.previousRecordTime=0,this.playbackWatchTime=0,this.lastPlayHeadDuration=0,this.onEnterStateTimestamp=0,this.heartbeatTimestamp=0,this.seekStartedAt=null,this.seekedFrom=0,this.seekedTimestamp=0,this.pausedAtPlayheadMs=0,this.lastPreJumpPlayheadSec=null,this.playTimeStamp=null,this.startupBufferingPending=!1,this.pendingErrorRecovery_=!1,this.States={SETUP:`SETUP`,STARTUP:`STARTUP`,READY:`READY`,PLAYING:`PLAYING`,REBUFFERING:`REBUFFERING`,PAUSE:`PAUSE`,PAUSED_SEEKING:`PAUSED_SEEKING`,END:`END`,ERROR:`ERROR`,CASTING:`CASTING`},this.callbacks=e,this.opts=t,this.createStateMachine()}callEvent(e,t,n){this.fsm.can(e)?this.fsm[e](n,t):v.log(`Ignored Event: ${e}`)}updateMetadata(e){this.callbacks.updateSample(e)}allStates(){return Object.values(this.States)}createStateMachine(){let e=this,t=this.States,n=this.opts,r=[p.PLAY,p.PAUSE,p.SEEK,p.SEEKED,p.PLAYBACK_PLAYING,p.PLAYBACK_FINISHED,p.READY,p.SCREEN_RESIZE,p.END,p.ERROR,p.NON_FATAL_ERROR,p.UN_MUTE,p.MUTE];this.fsm=new mn.default({init:t.SETUP,transitions:[{name:p.TIMECHANGED,from:t.SETUP,to:t.SETUP},{name:p.READY,from:[t.SETUP,t.ERROR],to:t.READY},{name:p.SOURCE_LOADED,from:t.SETUP,to:t.SETUP},{name:p.PLAY,from:t.READY,to:t.STARTUP},{name:p.SOURCE_LOADED,from:t.READY,to:t.READY},{name:p.SEEK,from:t.READY,to:t.READY},{name:p.SEEKED,from:t.READY,to:t.READY},{name:p.MUTE,from:t.READY,to:t.READY},{name:p.UN_MUTE,from:t.READY,to:t.READY},{name:p.VIDEO_CHANGE,from:t.READY,to:t.READY},{name:p.AUDIO_CHANGE,from:t.READY,to:t.READY},{name:p.TIMECHANGED,from:t.STARTUP,to:t.PLAYING},{name:p.START_BUFFERING,from:t.STARTUP,to:t.STARTUP},{name:p.END_BUFFERING,from:t.STARTUP,to:t.STARTUP},{name:p.VIDEO_CHANGE,from:t.STARTUP,to:t.STARTUP},{name:p.AUDIO_CHANGE,from:t.STARTUP,to:t.STARTUP},{name:p.SEEK,from:t.STARTUP,to:t.STARTUP},{name:p.SEEKED,from:t.STARTUP,to:t.STARTUP},{name:p.SOURCE_LOADED,from:t.STARTUP,to:t.STARTUP},{name:p.END,from:t.STARTUP,to:t.END},{name:p.TIMECHANGED,from:t.PLAYING,to:t.PLAYING},{name:p.END_BUFFERING,from:t.PLAYING,to:t.PLAYING},{name:p.SEEK,from:t.PLAYING,to:t.PLAYING},{name:p.SEEKED,from:t.PLAYING,to:t.PLAYING},{name:p.SOURCE_LOADED,from:t.PLAYING,to:t.PLAYING},{name:p.VIDEO_CHANGE,from:t.PLAYING,to:t.PLAYING},{name:p.AUDIO_CHANGE,from:t.PLAYING,to:t.PLAYING},{name:p.MUTE,from:t.PLAYING,to:t.PLAYING},{name:p.UN_MUTE,from:t.PLAYING,to:t.PLAYING},{name:p.PAUSE,from:t.PLAYING,to:t.PAUSE},{name:p.START_BUFFERING,from:t.PLAYING,to:t.REBUFFERING},{name:p.END,from:t.PLAYING,to:t.END},{name:p.START_BUFFERING,from:t.REBUFFERING,to:t.REBUFFERING},{name:p.VIDEO_CHANGE,from:t.REBUFFERING,to:t.REBUFFERING},{name:p.AUDIO_CHANGE,from:t.REBUFFERING,to:t.REBUFFERING},{name:p.PLAY,from:t.REBUFFERING,to:t.PLAYING},{name:p.TIMECHANGED,from:t.REBUFFERING,to:t.PLAYING},{name:p.SEEKED,from:t.REBUFFERING,to:t.PLAYING},{name:p.PAUSE,from:t.REBUFFERING,to:t.PAUSE},{name:p.END,from:t.REBUFFERING,to:t.END},{name:p.TIMECHANGED,from:t.PAUSE,to:t.PAUSE},{name:p.SEEKED,from:t.PAUSE,to:t.PAUSE},{name:p.VIDEO_CHANGE,from:t.PAUSE,to:t.PAUSE},{name:p.AUDIO_CHANGE,from:t.PAUSE,to:t.PAUSE},{name:p.MUTE,from:t.PAUSE,to:t.PAUSE},{name:p.UN_MUTE,from:t.PAUSE,to:t.PAUSE},{name:p.PLAY,from:t.PAUSE,to:t.PLAYING},{name:p.SEEK,from:t.PAUSE,to:t.PAUSED_SEEKING},{name:p.END,from:t.PAUSE,to:t.END},{name:p.SEEK,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.AUDIO_CHANGE,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.VIDEO_CHANGE,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.START_BUFFERING,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.END_BUFFERING,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.PLAY,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.SEEKED,from:t.PAUSED_SEEKING,to:t.PAUSE},{name:p.TIMECHANGED,from:t.PAUSED_SEEKING,to:t.PLAYING},{name:p.PAUSE,from:t.PAUSED_SEEKING,to:t.PAUSE},{name:p.END,from:t.PAUSED_SEEKING,to:t.END},{name:p.SEEK,from:t.END,to:t.END},{name:p.SEEKED,from:t.END,to:t.END},{name:p.TIMECHANGED,from:t.END,to:t.END},{name:p.END_BUFFERING,from:t.END,to:t.END},{name:p.START_BUFFERING,from:t.END,to:t.END},{name:p.END,from:t.END,to:t.END},{name:p.PLAY,from:t.END,to:t.PLAYING},{name:p.ERROR,from:this.allStates(),to:t.ERROR},{name:p.PAUSE,from:t.ERROR,to:t.ERROR},{name:p.PLAY,from:t.ERROR,to:t.PLAYING},{name:p.TIMECHANGED,from:t.ERROR,to:t.PLAYING},{name:p.SOURCE_LOADED,from:t.ERROR,to:t.ERROR},{name:p.METADATA_LOADED,from:t.ERROR,to:t.ERROR},{name:p.START_BUFFERING,from:t.ERROR,to:t.REBUFFERING},{name:p.SEEK,from:t.ERROR,to:t.ERROR},{name:p.SEEKED,from:t.ERROR,to:t.ERROR},{name:p.MUTE,from:t.ERROR,to:t.ERROR},{name:p.UN_MUTE,from:t.ERROR,to:t.ERROR},{name:p.VIDEO_CHANGE,from:t.ERROR,to:t.ERROR},{name:p.AUDIO_CHANGE,from:t.ERROR,to:t.ERROR},{name:p.END_BUFFERING,from:t.ERROR,to:t.ERROR},{name:p.END,from:t.ERROR,to:t.END},...this.allStates().map(e=>({name:p.NON_FATAL_ERROR,from:e,to:e})),{name:p.UNLOAD,from:this.allStates(),to:t.END},{name:p.START_CAST,from:[t.READY,t.PAUSE],to:t.CASTING},{name:p.PAUSE,from:t.CASTING,to:t.CASTING},{name:p.PLAY,from:t.CASTING,to:t.CASTING},{name:p.TIMECHANGED,from:t.CASTING,to:t.CASTING},{name:p.MUTE,from:t.CASTING,to:t.CASTING},{name:p.SEEK,from:t.CASTING,to:t.CASTING},{name:p.SEEKED,from:t.CASTING,to:t.CASTING},{name:p.END_CAST,from:t.CASTING,to:t.READY}],methods:{onBeforeTransition(n,i,a){if(e.callbacks.playbackWatchTime(e.playbackWatchTime),n.transition===p.SEEK&&(n.from===t.PLAYING||n.from===t.CASTING)&&e.seekStartedAt===null&&(e.seekedFrom=Math.round(e.previousRecordTime*1e3)),n.transition===p.SEEK&&n.from===t.PAUSE&&(e.seekedFrom=e.pausedAtPlayheadMs),n.transition===p.PAUSE&&n.from!==t.PAUSED_SEEKING){let t=a?.currentTime;if(typeof t==`number`)if(e.lastPreJumpPlayheadSec!=null)e.pausedAtPlayheadMs=Math.round(e.lastPreJumpPlayheadSec*1e3),e.lastPreJumpPlayheadSec=null;else{let n=e.previousRecordTime;e.pausedAtPlayheadMs=Math.abs(t-n)>=5?Math.round(n*1e3):Math.round(t*1e3)}}r.includes(n.transition)&&(n.transition===p.PLAYBACK_FINISHED&&(e.previousRecordTime=0),a&&(e.previousRecordTime=a.currentTime)),a&&n.transition!==p.SOURCE_LOADED&&(e.lastPlayHeadDuration=a.currentTime*1e3)},onLeaveState(n,r,i){if(!r)return;let a=r-e.onEnterStateTimestamp;i&&n.to!==t.PAUSED_SEEKING&&(v.log(`Setting video time end to ${i.currentTime}, going to ${n.to}`),e.callbacks.setVideoTimeEndFromEvent(i));let o=n.from.toLowerCase();if(n.from===t.PAUSED_SEEKING){let a=r-(e.seekStartedAt??r);e.seekStartedAt=null,e.callbacks.playback_seeked(e.seekedFrom,i.currentTime*1e3,a,n.to),e.callbacks.heartbeat(r,t.PAUSE.toLowerCase(),i),v.log(`Seek was ${a}ms`)}else n.transition===p.UNLOAD&&n.from===t.PLAYING?e.callbacks.playingAndBye(a,o,i):n.from===t.PAUSE&&n.to!==t.PAUSED_SEEKING&&n.to!==t.PLAYING&&(e.callbacks.setVideoTimeStartFromEvent(n.transition),e.callbacks.pause(a,o,i),e.callbacks.heartbeat(r,o,i))},onAfterTransition(t,n,r){e.callbacks.resetSessionExpiry(),t.transition===p.VIDEO_CHANGE?e.callbacks.videoChange(r):t.transition===p.AUDIO_CHANGE?e.callbacks.audioChange(r):t.transition===p.MUTE?(v.log(`Setting sample to muted`),e.callbacks.mute(n,r)):t.transition===p.UN_MUTE&&(v.log(`Setting sample to unmuted`),e.callbacks.unMute(n,r))},onEnterState(i,a,o){i.to===t.ERROR&&(e.pendingErrorRecovery_=!1),e.callbacks.playbackWatchTime(e.playbackWatchTime),r.includes(i.transition)&&o&&(e.previousRecordTime=o.currentTime),i.transition!==p.NON_FATAL_ERROR&&(i.from===`none`&&n.starttime?e.onEnterStateTimestamp=n.starttime:e.onEnterStateTimestamp=a||Date.now()),(i.to===t.PLAYING&&(i.from===t.STARTUP||i.from===t.PAUSE||i.from===t.REBUFFERING||i.from===t.PAUSED_SEEKING||i.from===t.ERROR)||i.from===`none`&&i.to===t.SETUP)&&(e.heartbeatTimestamp=i.from===`none`&&n.starttime?n.starttime:a||Date.now()),o&&i.to!==t.PAUSED_SEEKING&&e.callbacks.setVideoTimeStartFromEvent(o)},onEnterSetup(r,i,a){r.from===`none`&&e.callbacks.setup(i,t.SETUP,a,n)},onEnterReady(n,r,i){n.from===t.SETUP&&e.callbacks.ready(r,t.READY,i)},onEnterStartup(n,r,i){n.transition===p.PLAY&&(e.playTimeStamp=new Date,e.callbacks.first_play(r,t.STARTUP,i))},onEnterPlaying(n,r,i){n.transition===p.PLAY&&n.from===t.PAUSE?(e.callbacks.play(r,t.PLAYING,i),e.callbacks.playing(r,t.PLAYING,i),e.callbacks.heartbeat(r,t.PLAYING,i)):n.from===t.STARTUP?(e.startupBufferingPending&&(e.startupBufferingPending=!1,e.callbacks.start_rebuffer(r,t.REBUFFERING,i),e.callbacks.end_rebuffer(r,t.REBUFFERING,i)),e.callbacks.playing(r,t.PLAYING,i),e.callbacks.playback_started(i)):n.from===t.REBUFFERING?(e.callbacks.end_rebuffer(r,t.REBUFFERING,i),e.pendingErrorRecovery_&&(e.pendingErrorRecovery_=!1,e.callbacks.error_recovered(r,t.ERROR,i))):n.from===t.ERROR&&e.callbacks.error_recovered(r,t.ERROR,i)},onEnterPause(n,r,i){n.from===t.PAUSED_SEEKING&&i&&typeof i.currentTime==`number`&&(e.pausedAtPlayheadMs=i.currentTime*1e3),n.from===t.PLAYING&&(e.callbacks.pause(r,t.PAUSE,i),e.callbacks.heartbeat(r,t.PAUSE,i))},onEnterRebuffering(n,r,i){n.transition===p.START_BUFFERING&&(e.callbacks.start_rebuffer(r,t.REBUFFERING,i),n.from===t.ERROR&&(e.pendingErrorRecovery_=!0))},onBeforeStartBuffering(n,r,i){n.from===t.STARTUP&&(e.startupBufferingPending=!0)},onEnterEnd(n,r,i){e.callbacks.end(r,t.END,i),e.callbacks.heartbeat(r,t.END,i)},onBeforeSourceLoaded(n,r,i){let a=n.from===t.PLAYING&&e.playTimeStamp?Date.now()-e.playTimeStamp.getTime():null;e.callbacks.loaded(r,t.READY,i,a)},onSeek(t,n,r){r&&(e.previousRecordTime=r.currentTime),e.callbacks.playbackWatchTime(e.playbackWatchTime),e.seekStartedAt=e.seekStartedAt??n},onSeeked(n,r,i){if(i&&(e.previousRecordTime=i.currentTime),e.callbacks.playbackWatchTime(e.playbackWatchTime),e.seekedTimestamp=r,i&&(n.from===t.PLAYING&&n.to===t.PLAYING||n.from===t.CASTING&&n.to===t.CASTING)){let t=e.seekStartedAt==null?0:r-e.seekStartedAt;e.callbacks.playback_seeked(e.seekedFrom,i.currentTime*1e3,t,null),v.log(`Seek was ${t}ms`)}e.seekStartedAt=null},onTimechanged(t,n,r){e.callbacks.playbackWatchTime(e.playbackWatchTime);let i=r.currentTime-e.previousRecordTime;i>0&&i<5?(e.playbackWatchTime+=Math.round(i*1e3),e.previousRecordTime=r.currentTime,e.lastPreJumpPlayheadSec=null):(e.lastPreJumpPlayheadSec=e.previousRecordTime,e.previousRecordTime=r.currentTime);let a=n-e.heartbeatTimestamp;a>1e4&&(e.callbacks.setVideoTimeEndFromEvent(r),v.log(`Sending heartbeat`),e.callbacks.heartbeat(a,t.from.toLowerCase(),r),e.heartbeatTimestamp=n,e.callbacks.setVideoTimeStartFromEvent(r),e.callbacks.resetSessionExpiry())},onPlayerError(t,n,r){e.callbacks.error(r)},onPlayerNonFatalError(t,n,r){e.callbacks.error(r)}}})}static pad(e,t){return(e+Array(t).join(` `)).slice(0,t)}}}));function _n(e){return e=e.toLowerCase(),e.endsWith(`.m3u8`)?bn:e.endsWith(`.mp4`)||e.endsWith(`.m4v`)||e.endsWith(`.m4a`)?vn:e.endsWith(`.webm`)?yn:e.endsWith(`.mpd`)?xn:null}var vn,yn,bn,xn,Sn,Cn=s((()=>{vn=`video/mp4`,yn=`video/webm`,bn=`application/x-mpegURL`,xn=`application/dash+xml`,Sn={MP4:vn,WEBM:yn,HLS:bn,DASH:xn}}));function wn(e){return kn[e]}var Tn,En,Dn,On,kn,An=s((()=>{Cn(),{MP4:Tn,WEBM:En,HLS:Dn,DASH:On}=Sn,kn={[Tn]:`mp4`,[En]:`webm`,[Dn]:`hls`,[On]:`dash`}})),jn=l({HTML5Adapter:()=>Nn}),Mn,Nn,Pn=s((()=>{m(),Cn(),An(),Mn=1e3,Nn=class{constructor(e,t,n,r=null){this.lastKnownCurrentTime_=0,this.sourceSwitching_=!1,this.eventCallback=t,this.playerSoftwareName=r??h.HTML,this.stateMachine=n,this.mediaEl=e,this.mediaElEventHandlers=[],this.analyticsBitrate_=-1,this.audioCodec_=``,this.videoCodec_=``,this.bufferingTimeout_=null,this.isBuffering_=!1,this.isLive_=!1,this.isPaused_=!1,this.previousMediaTime_=null,this.needsReadyEvent_=!0,this.needsFirstPlayIntent_=!0,this.mediaElementSet_=!1,this.playbackReadySet_=!1,e&&this.setMediaElement()}getCurrentQualityLevelInfo(){return null}isLive(){return!1}getMIMEType(){let e=this.mediaEl;if(!e)return null;let t=e.src||e.querySelector(`source`)?.src||null;return t?_n(t):null}getStreamType(){return wn(this.getMIMEType()??``)}getPlayerVersion(){return null}getStreamURL(){let e=this.mediaEl;return e&&(e.src||e.querySelector(`source`)?.src)||null}destroy(){this.mediaEl&&this.unregisterMediaElement()}setMediaElement(e=null){if(e&&this.mediaEl&&(this.unregisterMediaElement(),this.mediaElementSet_=!1),e&&(this.mediaEl=e),!this.mediaEl)throw Error(`No media element owned`);if(this.mediaElementSet_)throw Error(`Media element already set (only call this once)`);this.mediaElementSet_=!0,this.registerMediaElement(),this.onMaybeReady()}resetMedia(){this.mediaEl=null,this.mediaElEventHandlers=[]}registerMediaElement(){let e=this.mediaEl;e&&(this.listenToMediaElementEvent(`loadedmetadata`,()=>{if(e.readyState!==1)return;this.checkQualityLevelAttributes(!0);let{duration:t,autoplay:n,videoWidth:r,videoHeight:i,muted:a}=e,o={type:`html5`,isLive:this.isLive(),version:this.getPlayerVersion()??`html5`,streamType:this.getStreamType(),streamUrl:this.getStreamURL(),duration:t,autoplay:n,currentVideoData:{height:i,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},videoWindowWidth:e.clientWidth,videoWindowHeight:e.clientHeight,muted:a};this.needsFirstPlayIntent_||this.eventCallback(p.METADATA_LOADED,o)}),this.listenToMediaElementEvent(`canplay`,()=>{if(this.playbackReadySet_)return;this.playbackReadySet_=!0;let{duration:t,autoplay:n,videoWidth:r,videoHeight:i,muted:a}=e,o={type:`html5`,isLive:this.isLive(),version:this.getPlayerVersion()??`html5`,streamType:this.getStreamType(),streamUrl:this.getStreamURL(),duration:t,autoplay:n,playerSoftware:this.playerSoftwareName,videoWindowWidth:e.clientWidth,videoWindowHeight:e.clientHeight,currentVideoData:{height:i,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},muted:a};this.eventCallback(p.SOURCE_LOADED,o)}),this.listenToMediaElementEvent(`emptied`,()=>{this.sourceSwitching_=!0}),this.listenToMediaElementEvent(`play`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.needsFirstPlayIntent_=!1,this.eventCallback(p.PLAY,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t})}),this.listenToMediaElementEvent(`pause`,()=>{this.onPaused()}),this.listenToMediaElementEvent(`playing`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.isPaused_=!1,!this.needsFirstPlayIntent_&&(this.sourceSwitching_||this.eventCallback(p.TIMECHANGED,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t}))}),this.listenToMediaElementEvent(`error`,()=>{let{error:t}=e;this.eventCallback(p.ERROR,{currentTime:this.lastKnownCurrentTime_,code:t?.code,message:t?.message})}),this.listenToMediaElementEvent(`volumechange`,()=>{let{muted:t,currentTime:n}=e;t?this.eventCallback(p.MUTE,{currentTime:n}):this.eventCallback(p.UN_MUTE,{currentTime:n})}),this.listenToMediaElementEvent(`seeking`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.eventCallback(p.SEEK,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t,droppedFrames:0})}),this.listenToMediaElementEvent(`seeked`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.bufferingTimeout_&&clearTimeout(this.bufferingTimeout_),this.eventCallback(p.SEEKED,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t,droppedFrames:0})}),this.listenToMediaElementEvent(`ended`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.eventCallback(p.END,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t})}),this.listenToMediaElementEvent(`timeupdate`,()=>{let{currentTime:t,videoHeight:n,videoWidth:r}=e;this.isBuffering_=!1,t>0&&(this.lastKnownCurrentTime_=t,this.sourceSwitching_=!1),!this.needsFirstPlayIntent_&&(!this.isPaused_&&!this.sourceSwitching_&&this.eventCallback(p.TIMECHANGED,{currentVideoData:{height:n,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t}),this.checkQualityLevelAttributes(),this.checkPlayheadProgress(),this.previousMediaTime_=t)}),this.listenToMediaElementEvent(`stalled`,()=>{}),this.listenToMediaElementEvent(`waiting`,()=>{this.onBuffering()}))}listenToMediaElementEvent(e,t){if(!this.mediaEl)throw Error(`No media attached`);let n=t.bind(this);this.mediaElEventHandlers.push({event:e,handler:n}),this.mediaEl.addEventListener(e,n,!1)}unregisterMediaElement(){if(!this.mediaEl)throw Error(`No media attached`);for(let{event:e,handler:t}of this.mediaElEventHandlers)this.mediaEl.removeEventListener(e,t,!1);this.resetMedia()}onMaybeReady(){if(!this.needsReadyEvent_||!this.mediaEl)return;this.needsReadyEvent_=!1;let{duration:e,autoplay:t,videoWidth:n,videoHeight:r,muted:i,preload:a}=this.mediaEl,o=this.getStreamURL(),s=a!==`none`,c={type:`html5`,isLive:this.isLive(),version:this.getPlayerVersion()??`html5`,streamType:this.getStreamType(),streamUrl:o,duration:e,autoplay:t,preload:s,playerSoftware:this.playerSoftwareName,currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},videoWindowWidth:this.mediaEl.clientWidth,videoWindowHeight:this.mediaEl.clientHeight,muted:i};this.stateMachine.updateMetadata(c),this.eventCallback(p.READY,c)}onBuffering(){let{currentTime:e}=this.mediaEl;this.isBuffering_||this.isPaused_||(this.eventCallback(p.START_BUFFERING,{currentTime:e}),this.isBuffering_=!0)}onPaused(){if(this.isPaused_)return;if(this.sourceSwitching_){this.isPaused_=!0;return}let{videoHeight:e,videoWidth:t}=this.mediaEl,n=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:this.mediaEl.currentTime??0;this.eventCallback(p.PAUSE,{currentVideoData:{height:e,width:t,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:n}),this.isPaused_=!0}checkPlayheadProgress(){let e=this.mediaEl;e.paused&&this.onPaused(),this.bufferingTimeout_&&clearTimeout(this.bufferingTimeout_),this.bufferingTimeout_=setTimeout(()=>{(e.paused||e.ended)&&!this.isBuffering_||e.currentTime-(this.previousMediaTime_??e.currentTime)<Mn&&this.onBuffering()},Mn)}checkQualityLevelAttributes(e=!1){let t=this.mediaEl,n=this.getCurrentQualityLevelInfo();if(!n)return;let{bitrate:r,width:i,height:a,videoCodec:o,audioCodec:s}=n,c=this.isLive();if(c!==this.isLive_&&(this.isLive_=c,e||this.stateMachine.updateMetadata({isLive:c})),this.audioCodec_=s??``,this.videoCodec_=o??``,this.analyticsBitrate_!==r){let n={width:i,height:a,bitrate:r,videoCodec:o,audioCodec:s,currentTime:t.currentTime};e||this.eventCallback(p.VIDEO_CHANGE,n),this.analyticsBitrate_=r??-1}}}})),Fn=l({HlsjsAdapter:()=>In}),In,Ln=s((()=>{m(),Pn(),Cn(),ee(),In=class extends Nn{constructor(e,t,n){super(null,t,n,h.HLSJS),this.hls=e,this.playerSoftwareName=h.HLSJS,this.boundOnMediaAttaching=this.onMediaAttaching.bind(this),this.boundOnMediaDetaching=this.onMediaDetaching.bind(this),this.boundOnManifestLoading=this.onManifestLoading.bind(this),this.hlsErrorHandler=(e,t)=>this.onError(t),this.resetMedia(),this.registerHlsEvents()}getCurrentQualityLevelInfo(){let e=this.hls,t=e.levels?.[e.currentLevel];if(!t)return null;let n=t.attrs,r=n.BANDWIDTH?parseInt(n.BANDWIDTH,10):0,i=n.RESOLUTION?.width?parseInt(n.RESOLUTION.width,10):0,a=n.RESOLUTION?.height?parseInt(n.RESOLUTION.height,10):0,o=null,s=null;if(n.CODECS){let e=n.CODECS.split(`,`);s=e[0]??null,o=e.length>1?e[1]:null}return{bitrate:r,width:i,height:a,audioCodec:o,videoCodec:s}}isLive(){let e=this.hls;return e.currentLevel<0?!1:!!(e.levels?.[e.currentLevel])?.details?.live}getPlayerVersion(){return Hls.version}getMIMEType(){return Sn.HLS}getStreamURL(){return this.hls.url??null}destroy(){let e=this.hls;e.off(Hls.Events.MEDIA_ATTACHING,this.boundOnMediaAttaching),e.off(Hls.Events.MEDIA_DETACHING,this.boundOnMediaDetaching),e.off(Hls.Events.MANIFEST_LOADING,this.boundOnManifestLoading),e.off(Hls.Events.ERROR,this.hlsErrorHandler),super.destroy()}registerHlsEvents(){let e=this.hls;if(!Hls)throw Error(`Hls.js is not installed (must be loaded before analytics module)`);e.on(Hls.Events.MEDIA_ATTACHING,this.boundOnMediaAttaching),e.on(Hls.Events.MEDIA_DETACHING,this.boundOnMediaDetaching),e.on(Hls.Events.MANIFEST_LOADING,this.boundOnManifestLoading),e.on(Hls.Events.ERROR,this.hlsErrorHandler),e.media&&this.onMediaAttaching(),e.url&&this.onManifestLoading()}onMediaAttaching(){this.mediaEl||(this.mediaEl=this.hls.media,this.registerMediaElement(),this.onMaybeReady())}onMediaDetaching(){this.unregisterMediaElement()}onManifestLoading(){this.onMaybeReady()}onError(e){let t=e,n=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:this.mediaEl?.currentTime??0;t?.fatal===!0&&t?.details===`internalException`&&console.error(e),this.eventCallback(p.ERROR,{currentTime:n,code:t?.type,message:JSON.stringify({details:t?.details,fatal:t?.fatal,type:t?.type,fragment_url:t?.url,error:{message:t?.error?.message,stack:t?.error?.stack},extra:{networkDetails:{status:t?.networkDetails?.status,statusText:t?.networkDetails?.statusText,url:t?.networkDetails?.url,responseHeaders:t?.networkDetails?.responseHeaders,responseText:t?.networkDetails?.responseText,responseURL:t?.networkDetails?.responseURL,data:t?.networkDetails?.data}}})})}}})),Rn=l({ShakaAdapter:()=>zn}),zn,Bn=s((()=>{Pn(),Cn(),ee(),m(),zn=class extends Nn{constructor(e,t,n,r){if(super(r,t,n,h.SHAKA),typeof shaka>`u`)throw Error("`shaka` lib is not installed (must be loaded before analytics module)");this.shakaPlayer=e,this.playerSoftwareName=h.SHAKA,this.shakaErrorHandler=e=>{this.onGumletShakaError(e,this.eventCallback,this.mediaEl).catch(()=>{let e=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:this.mediaEl?.currentTime??0;this.eventCallback(p.ERROR,{currentTime:e,code:`error_handler_exception`,message:`Shaka error handler threw before firing callback`})})},this.registerShakaEvents()}getPlayerVersion(){return shaka.Player.version}isLive(){return this.shakaPlayer?.isLive()??!1}getMIMEType(){return this.shakaPlayer?.getManifestType?.()===`HLS`?Sn.HLS:Sn.DASH}getStreamURL(){return this.shakaPlayer?.getAssetUri()??null}getCurrentQualityLevelInfo(){let e=this.shakaPlayer.getVariantTracks().filter(e=>e.active).find(e=>e.videoCodec!==null||e.videoId!==null);return e?{bitrate:e.videoBandwidth??e.bandwidth??null,width:e.width??null,height:e.height??null,videoCodec:e.videoCodec??null,audioCodec:e.audioCodec??null}:null}destroy(){this.shakaPlayer.removeEventListener(`error`,this.shakaErrorHandler),super.destroy()}registerShakaEvents(){if(!this.shakaPlayer)throw Error(`Shaka player object is not defined`);this.shakaPlayer.addEventListener(`error`,this.shakaErrorHandler)}getEnumNameFromValue(e,t){if(!e||t==null)return null;for(let[n,r]of Object.entries(e))if(r===t)return n;return null}getShakaErrorCodeName(e){let t=globalThis.shaka?.util?.Error?.Code;return this.getEnumNameFromValue(t,e)}getShakaErrorCategoryName(e){let t=globalThis.shaka?.util?.Error?.Category;return this.getEnumNameFromValue(t,e)}getBufferedRanges(e){if(!e?.buffered)return[];let t=[];for(let n=0;n<e.buffered.length;n+=1)t.push({start:e.buffered.start(n),end:e.buffered.end(n)});return t}getPlaybackQuality(e){if(!e?.getVideoPlaybackQuality)return null;let t=e.getVideoPlaybackQuality();return{droppedVideoFrames:t.droppedVideoFrames,totalVideoFrames:t.totalVideoFrames,corruptedVideoFrames:t.corruptedVideoFrames}}getMediaElementState(e,t){return{readyState:e?.readyState??null,networkState:e?.networkState??null,currentSrc:e?.currentSrc??null,currentTime:e?.currentTime??t??null,paused:e?.paused??null,ended:e?.ended??null,seeking:e?.seeking??null,playbackRate:e?.playbackRate??null,muted:e?.muted??null,videoWidth:e?.videoWidth??null,videoHeight:e?.videoHeight??null}}getHtml5MediaError(e){let t=e?.error;return t?{code:t.code??null,message:t?.message??null}:null}getQualityLevelInfoFallback(){let e=this.shakaPlayer.getVariantTracks().find(e=>e.videoCodec!==null||e.videoId!==null);return e?{bitrate:e.videoBandwidth??e.bandwidth??null,width:e.width??null,height:e.height??null,videoCodec:e.videoCodec??null,audioCodec:e.audioCodec??null}:null}getExtraDataHint(e,t){if(!Array.isArray(e))return null;let n={item_count:e.length,item_types:e.map(e=>e===null?`null`:Array.isArray(e)?`array`:typeof e)};return t?.includes(`DECODE`)&&(n.decode_context={first:e[0]??null,second:e[1]??null}),n}async onGumletShakaError(e,t,n){let r=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:n?.currentTime??0,i=e;if(!i.detail){t(p.ERROR,{currentTime:r,code:`not_set_by_shaka`,message:`{}`});return}let a=i.detail,o=[];if(a.data)for(let e of a.data)o.push(e);let s=[],c=null,l=null,u=null;try{let e=[],t=this.shakaPlayer.getVariantTracks();if(t.forEach(t=>{e.push({width:t.width,height:t.height,bitrate:t.videoBandwidth??t.bandwidth,framerate:t.frameRate,contentType:`${t.mimeType}; codecs="${t.videoCodec}"`})}),navigator?.mediaCapabilities?.decodingInfo)for(let t of e)try{let e={type:`media-source`,video:{contentType:t.contentType,width:t.width??0,height:t.height??0,bitrate:t.bitrate??0,framerate:t.framerate??0},keySystemConfiguration:{keySystem:`com.widevine.alpha`,video:{contentType:t.contentType}}},n=await navigator.mediaCapabilities.decodingInfo(e);s.push({...n,keySystemAccess:n.keySystemAccess?.getConfiguration()})}catch{}c=this.getCurrentQualityLevelInfo(),c||(l=this.getQualityLevelInfoFallback()),u={manifest_type:this.shakaPlayer.getManifestType?.()??null,asset_uri:this.shakaPlayer.getAssetUri?.()??null,is_live:this.shakaPlayer.isLive?.()??null,player_version:this.getPlayerVersion(),variant_track_count:t.length}}catch{}let d=!a.severity||a.severity===2?p.ERROR:p.NON_FATAL_ERROR,f=a.category??a.v??null,m=this.getShakaErrorCodeName(a.code),h=this.getShakaErrorCategoryName(f);t(d,{currentTime:r,code:a.code,message:JSON.stringify({category:f,category_name:h,code:a.code,code_name:m,severity:a.severity,handled:a.handled,timestamp:i.timestamp,extra_data:o,extra_data_hint:this.getExtraDataHint(o,m),media_capabilities:s,selected_quality_info:c,selected_quality_info_fallback:l,html5_media_error:this.getHtml5MediaError(n),media_element_state:this.getMediaElementState(n,r),buffered_ranges:this.getBufferedRanges(n),playback_quality:this.getPlaybackQuality(n),shaka_runtime_context:u})})}}}));Re();var Vn=class e{static{this.PAGE_LOAD_TYPE={FOREGROUND:1,BACKGROUND:2}}static{this.LICENSE_CALL_PENDING_TIMEOUT=200}static{this.PAGE_LOAD_TYPE_TIMEOUT=200}static{this.CAST_RECEIVER_CONFIG_MESSAGE=`CAST_RECEIVER_CONFIG_MESSAGE`}constructor(t){this.previousState=void 0,this.previousStateTimeStamp=new Date,this.previousStateMono=0,this.firstPlayTimestamp=0,this.startupTime=0,this.pageLoadType=e.PAGE_LOAD_TYPE.FOREGROUND,this.droppedSampleFrames=0,this.autoplay=void 0,this.isCastClient=!1,this.isCastReceiver=!1,this.isAllowedToSendSamples=!1,this.samplesQueue=[],this.customEventHandler=(e,t)=>{this.sampleBuilder.sample.custom_event_data=JSON.stringify(t),this.sendAnalyticsRequestAndClearValues(e,{custom_event_data:JSON.stringify(t)})},this.customEventHandlerAsync=(e,t)=>new Promise((n,r)=>{let i=JSON.stringify(t);this.sendAnalyticsRequestAndClearValuesAsync(e,{custom_event_data:i}).then(e=>n(e)).catch(e=>r(e))}),this.getCurrentImpressionId=()=>this.sample.impressionId,this.setDroppedFrames=e=>{},this.register=async(e,t={})=>{t.starttime?t.starttime=g.convertEpochTime(t.starttime):t.starttime=g.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(gn(),pn));if(this.analyticsStateMachine=new n(this.stateMachineCallbacks,t),!e){let{HTML5Adapter:e}=await Promise.resolve().then(()=>(Pn(),jn));return this.adapter=new e(this.mediaElement,this.record,this.analyticsStateMachine),this.analyticsStateMachine}if(Ve.isHlsjs(e)){let{HlsjsAdapter:t}=await Promise.resolve().then(()=>(Ln(),Fn));this.adapter=new t(e,this.record,this.analyticsStateMachine)}else if(Ve.isShaka(e)){let{ShakaAdapter:n}=await Promise.resolve().then(()=>(Bn(),Rn));this.adapter=new n(e,this.record,this.analyticsStateMachine,t.mediaElement??null)}else{let{HTML5Adapter:t}=await Promise.resolve().then(()=>(Pn(),jn));this.adapter=new t(e,this.record,this.analyticsStateMachine)}this.adapter||v.error(`Could not detect player.`)},this.registerHLSJSPlayer=async(e,t={})=>{t.starttime?t.starttime=g.convertEpochTime(t.starttime):t.starttime=g.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(gn(),pn));this.analyticsStateMachine=new n(this.stateMachineCallbacks,t);let{HlsjsAdapter:r}=await Promise.resolve().then(()=>(Ln(),Fn));this.adapter=new r(e,this.record,this.analyticsStateMachine)},this.registerShakaPlayer=async(e,t={})=>{t.starttime?t.starttime=g.convertEpochTime(t.starttime):t.starttime=g.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(gn(),pn));this.analyticsStateMachine=new n(this.stateMachineCallbacks,t);let{ShakaAdapter:r}=await Promise.resolve().then(()=>(Bn(),Rn));this.adapter=new r(e,this.record,this.analyticsStateMachine,t.mediaElement)},this.registerHTML5Player=async(e,t={})=>{t.starttime?t.starttime=g.convertEpochTime(t.starttime):t.starttime=g.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(gn(),pn));this.analyticsStateMachine=new n(this.stateMachineCallbacks,t);let{HTML5Adapter:r}=await Promise.resolve().then(()=>(Pn(),jn));this.adapter=new r(e,this.record,this.analyticsStateMachine)},this.registerReactNativeVideoPlayer=async e=>{e.starttime?e.starttime=g.convertEpochTime(e.starttime):e.starttime=g.getCurrentTimestamp();let{GumletStateMachine:t}=await Promise.resolve().then(()=>(gn(),pn));return this.analyticsStateMachine=new t(this.stateMachineCallbacks,e),this.analyticsStateMachine},this.record=(e,t)=>{t||={},this.analyticsStateMachine.callEvent(e,t,g.getCurrentTimestamp())},this.config=t,Se(t.disable_analytics_v2!==!0),this.analyticsCall=new Ie,this.castClient=new He,this.castReceiver=new Ue,this.session=new ln(t),Ae(()=>{let e=this.session.sessionData,t=this.session.playerData;return{...e&&typeof e==`object`?e:{},...t&&typeof t==`object`?t:{}}}),this.sampleBuilder=new un(t,this.session),this.publisher=new dn(this.analyticsCall,this.sampleBuilder),this.init(),this.setupSample(),this.setupStateMachineCallbacks(),typeof performance<`u`&&typeof performance.now==`function`?this.previousStateMono=performance.now():this.previousStateMono=this.previousStateTimeStamp.getTime()}init(){if(!this.isCastReceiver&&(this.config.property_id===``||!g.validString(this.config.property_id))){console.error(`Invalid analytics property_id provided`);return}v.setLogging(this.config.debug||!1),this.session.propertyId=this.config.property_id,typeof window<`u`&&window.parent!==void 0?this.session.pageURL=window.location===window.parent.location?document.location.href:document.referrer:this.config.page_url?this.session.pageURL=this.config.page_url:this.session.pageURL=null;let e=!!this.config.test,t=this.config.sessionID||null,n=this.config.userID||null,r=Object.hasOwn(this.config,`sendSessionRequest`)?this.config.sendSessionRequest:!0;this.session.setUserId(e,n),this.session.setSessionId(e,t,r),this.session.setPlayerInstanceId(this.config.getUUID),this.session.setPlaybackId(this.config.getUUID)}setConfigParameters(e=this.config){this.session.setConfigParameters(e)}updateCustomData(e){this.session.updateCustomData(e)}updateCustomUserData(e){this.session.updateCustomUserData(e)}updateCustomVideoData(e){this.session.updateCustomVideoData(e)}updateCustomPlayerData(e){this.session.updateCustomPlayerData(e)}get userId(){return this.session.userId}get sessionId(){return this.session.sessionId}get propertyId(){return this.session.propertyId}get playerData(){return this.session.playerData}get sessionData(){return this.session.sessionData}get playerInitCall(){return this.session.playerInitCall}get isMuted(){return this.sampleBuilder.isMuted}set isMuted(e){this.sampleBuilder.isMuted=e}get sample(){return this.sampleBuilder.sample}setupSample(){this.sampleBuilder.setupSample()}setDuration(e){this.sampleBuilder.setDuration(e)}setVideoData(e){this.sampleBuilder.setVideoData(e)}setPlaybackSettingsFromLoadedEvent(e){this.sampleBuilder.setPlaybackSettingsFromLoadedEvent(e)}setPlaybackWatchTime(e){this.sampleBuilder.setPlaybackWatchTime(e)}getPlaybackWatchTime(){return this.sampleBuilder.getPlaybackWatchTime()}getSample(e=null,t={}){let n=this.sampleBuilder.getSample(e,t);return n.millis_from_previous_event=this.getMillisFromPreviousState(),n.previous_event=this.previousState,n}setPlayerData(e){this.session.setPlayerData(e)}setSessionData(){this.session.setSessionData()}setPlaybackId(){this.session.setPlaybackId(this.config.getUUID)}setUserId(e=!1,t=null){this.session.setUserId(e,t)}setSessionId(e=!1,t=null,n=!0){this.session.setSessionId(e,t,n)}setPlayerInstanceId(){this.session.setPlayerInstanceId(this.config.getUUID)}sendAnalyticsRequest(e,t){this.publisher.sendRequest(e,t)}sendAnalyticsRequestAsync(e,t){return this.publisher.sendRequestAsync(e,t)}sendAnalyticsRequestAndClearValues(e=null,t={}){let n={millis_from_previous_event:this.getMillisFromPreviousState(),previous_event:this.previousState,...t};this.publisher.sendAndClear(e,n)}sendAnalyticsRequestAndClearValuesAsync(e=null,t={}){return this.publisher.sendAndClearAsync(e,t)}sendUnloadRequest(){this.publisher.sendUnload()}sendAnalyticsRequestSynchronous(){this.publisher.sendSynchronous()}getMillisFromPreviousState(){let e;e=typeof performance<`u`&&typeof performance.now==`function`?performance.now()-this.previousStateMono:new Date().getTime()-this.previousStateTimeStamp.getTime();let t=Math.round(e);return t<=0&&this.previousState!==void 0?1:Math.max(0,t)}setState(e=void 0){e&&(this.previousState=e,this.previousStateTimeStamp=new Date,typeof performance<`u`&&typeof performance.now==`function`?this.previousStateMono=performance.now():this.previousStateMono=this.previousStateTimeStamp.getTime())}getDroppedFrames(e){if(e!==void 0&&e!==0){let t=e-this.droppedSampleFrames;return this.droppedSampleFrames=e,t}return 0}setupStateMachineCallbacks(){this.stateMachineCallbacks={setup:(e,t,n,r)=>{v.log(`Setup Gumlet analytics `+this.analyticsVersion),this.setDuration(e),this.setVideoData(n);let i=0;r?.starttime&&(i=new Date().getTime()-r.starttime),this.sendAnalyticsRequestAndClearValues(y.SETUP,{millis_from_previous_event:i}),this.setState(y.SETUP)},ready:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(y.PLAYER_READY),this.setState(y.PLAYER_READY),this.setPlayerData(n),this.playerInitCall.sendRequest(this.playerData,g.noOp)},loaded:(e,t,n,r=null)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n);let i={};r!==null&&(i={millis_from_previous_event:r,previous_event:y.PLAYER_READY}),this.sendAnalyticsRequestAndClearValues(y.PLAYBACK_READY,i),r===null&&this.setState(y.PLAYBACK_READY)},startup:(e,t)=>{this.setDuration(e)},first_play:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(y.PLAY),this.setState(y.PLAY),this.firstPlayTimestamp=new Date},play:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(y.PLAY),this.setState(y.PLAY)},updateSample:e=>{this.setPlaybackSettingsFromLoadedEvent(e)},playing:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(y.PLAYING),this.setState(y.PLAYING)},playback_started:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n);let r=new Date().getTime()-this.firstPlayTimestamp.getTime();this.sendAnalyticsRequestAndClearValues(y.PLAYBACK_STARTED,{millis_from_previous_event:r}),this.setState(y.PLAYBACK_STARTED)},playingAndBye:(e,t,n)=>{this.setDuration(e),this.setDroppedFrames(n),this.sendUnloadRequest()},heartbeat:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(y.PLAYBACK_UPDATE),this.setState(y.PLAYBACK_UPDATE)},playbackWatchTime:e=>{this.setPlaybackWatchTime(e)},qualitychange:(e,t)=>{this.setDuration(e)},qualitychange_pause:(e,t)=>{this.setDuration(e)},qualitychange_rebuffering:(e,t)=>{this.setDuration(e)},videoChange:e=>{this.stateMachineCallbacks.setVideoTimeEndFromEvent(e),this.stateMachineCallbacks.setVideoTimeStartFromEvent(e),this.setPlaybackSettingsFromLoadedEvent(e)},audioChange:e=>{this.stateMachineCallbacks.setVideoTimeEndFromEvent(e),this.stateMachineCallbacks.setVideoTimeStartFromEvent(e)},pause:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(y.PAUSE),this.setState(y.PAUSE)},start_rebuffer:(e,t,n,r=!1)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),r||this.sendAnalyticsRequestAndClearValues(y.START_REBUFFER),this.setState(y.START_REBUFFER)},end_rebuffer:(e,t,n,r=!1)=>{if(this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),!r)this.sendAnalyticsRequestAndClearValues(y.END_REBUFFER);else return this.getSample(y.END_REBUFFER);this.setState(y.END_REBUFFER)},playback_seeked:(e,t,n,r)=>{this.sendAnalyticsRequestAndClearValues(y.SEEKED,{from:e,to:t}),this.setState(y.SEEKED),this.setupSample(),r===`PAUSE`?(this.sendAnalyticsRequestAndClearValues(y.PAUSE,{millis_from_previous_event:n}),this.setState(y.PAUSE)):r===`PLAYING`&&(this.sendAnalyticsRequestAndClearValues(y.PLAYING,{millis_from_previous_event:n}),this.setState(y.PLAYING))},paused_seeking:(e,t,n)=>{this.setDuration(e)},play_seeking:g.noOp,end_play_seeking:(e,t,n)=>{this.setDuration(e)},rebuffering:(e,t,n)=>{this.setDuration(e)},error:e=>{this.setPlaybackSettingsFromLoadedEvent(e),this.stateMachineCallbacks.setVideoTimeEndFromEvent(e),this.stateMachineCallbacks.setVideoTimeStartFromEvent(e),this.sendAnalyticsRequestAndClearValues(y.ERROR,{error_code:e&&e.code,error:e&&e.message}),this.setState(y.ERROR),this.setupSample()},error_recovered:(e,t,n)=>{this.setPlaybackSettingsFromLoadedEvent(n),this.stateMachineCallbacks.setVideoTimeEndFromEvent(n),this.stateMachineCallbacks.setVideoTimeStartFromEvent(n),this.sendAnalyticsRequestAndClearValues(y.ERROR_RECOVERED,{})},end:(e,t,n)=>{this.setPlaybackId(),this.setDuration(e),this.sendAnalyticsRequestAndClearValues(y.END),this.setState(y.END)},ad:(e,t,n)=>{this.setDuration(e),this.setDroppedFrames(n)},mute:(e,t)=>{this.isMuted=!0,this.setPlaybackSettingsFromLoadedEvent(t),this.sendAnalyticsRequestAndClearValues(y.MUTE)},unMute:(e,t)=>{this.isMuted=!1,this.setPlaybackSettingsFromLoadedEvent(t),this.sendAnalyticsRequestAndClearValues(y.UNMUTE)},muting_ready:g.noOp,muting_play:g.noOp,muting_pause:g.noOp,setVideoTimeEndFromEvent:e=>{},setVideoTimeStartFromEvent:e=>{},startCasting:(t,n)=>{if(n&&n.resuming){this.isAllowedToSendSamples=!1,v.warning(`Player started casting but a session is already casting!`);return}this.isCastClient=!0,this.isAllowedToSendSamples=!1;let{domain:r,path:i,language:a,userAgent:o,userId:s,impressionId:c}=this.sample,l={type:e.CAST_RECEIVER_CONFIG_MESSAGE,data:{config:this.config,userId:s,domain:r,path:i,language:a,userAgent:o,impressionId:c}};this.castClient.setUp(),this.castClient.sendMessage(l)},casting:()=>{this.isCastClient=!1,this.samplesQueue=[],this.isAllowedToSendSamples=!0},source_changing:()=>{},resetSessionExpiry:()=>{this.session.resetSessionExpiry()}}}};let Q=`[GumletInsights]`;var Hn=class{constructor(e){if(this.analytics_=null,this.ready_=!1,this.attached_=!1,!e||!g.validString(e.property_id)||e.property_id===``){console.error(`${Q} A valid property_id is required. No analytics events will be sent until the SDK is re-constructed with a valid config.`);return}this.analytics_=new Vn(e),this.ready_=!0}async attach(e,t={}){if(!this.ready_||!this.analytics_){console.error(`${Q} attach() called but the SDK is not initialized. Check that you passed a valid property_id to the constructor.`);return}this.attached_&&(console.warn(`${Q} attach() called while a player is already attached. Detaching the previous player first.`),this.detach());let n=t.mediaElement??null;if(n!==null&&!this.isHTMLVideoElement_(n)){console.error(`${Q} opts.mediaElement must be an HTMLVideoElement, got: ${Object.prototype.toString.call(n)}`);return}if(e==null){if(!n){console.error(`${Q} HTML5 mode requires opts.mediaElement (an HTMLVideoElement). Pass the <video> element as opts.mediaElement, or pass it directly as the player argument.`);return}}else if(Be(e)){if(!this.isValidHlsPlayer_(e)){console.error(`${Q} HLS.js player is not in a valid state. The player may have been destroyed. Create a new Hls() instance before attaching.`);return}}else if(ze(e)){let t=typeof e.getMediaElement==`function`?e.getMediaElement():null;if(!n&&!t){console.error(`${Q} Shaka Player requires opts.mediaElement — pass the HTMLVideoElement that Shaka is rendering into.`);return}if(!this.isValidShakaPlayer_(e)){console.error(`${Q} Shaka Player is not in a valid state. The player may have been destroyed. Create a new shaka.Player() before attaching.`);return}}else if(!this.isHTMLVideoElement_(e)){console.error(`${Q} Unrecognized player type (${Object.prototype.toString.call(e)}). Supported players: HLS.js (Hls instance), Shaka Player (shaka.Player instance), HTMLVideoElement, or null/undefined (HTML5 mode with opts.mediaElement).`);return}await this.analytics_.register(e,{...t,mediaElement:n}),this.attached_=!0}detach(){this.attached_&&=(this.analytics_?.adapter?.destroy?.(),!1)}get isAttached(){return this.attached_}getImpressionId(){return this.analytics_?.getCurrentImpressionId()??void 0}updateConfig(e){!this.ready_||!this.analytics_||(this.analytics_.updateCustomData(e),this.analytics_.updateCustomVideoData(e),this.analytics_.updateCustomUserData(e),this.analytics_.updateCustomPlayerData(e))}updateCustomData(e){this.analytics_?.updateCustomData(e)}updateCustomVideoData(e){this.analytics_?.updateCustomVideoData(e)}updateCustomUserData(e){this.analytics_?.updateCustomUserData(e)}updateCustomPlayerData(e){this.analytics_?.updateCustomPlayerData(e)}customEventHandler(e,t){if(!this.ready_||!this.analytics_){console.warn(`${Q} customEventHandler ignored — SDK not initialized (check property_id).`);return}this.analytics_.customEventHandler(e,t)}customEventHandlerAsync(e,t){return!this.ready_||!this.analytics_?Promise.reject(Error(`${Q} customEventHandlerAsync — SDK not initialized (check property_id).`)):this.analytics_.customEventHandlerAsync(e,t)}isHTMLVideoElement_(e){return typeof HTMLVideoElement<`u`?e instanceof HTMLVideoElement:typeof e==`object`&&!!e&&typeof e.play==`function`&&typeof e.pause==`function`&&typeof e.addEventListener==`function`}isValidHlsPlayer_(e){return typeof e==`object`&&!!e&&typeof e.loadSource==`function`&&typeof e.attachMedia==`function`&&typeof e.destroy==`function`}isValidShakaPlayer_(e){return typeof e!=`object`||!e?!1:typeof e.isDestroyed==`function`?!e.isDestroyed():typeof e.load==`function`&&typeof e.unload==`function`&&typeof e.addEventListener==`function`}};m(),ee();let $,Un=(e,t={})=>$.register(e,t),Wn=(e,t={})=>$.registerHLSJSPlayer(e,t),Gn=(e,t={})=>$.registerShakaPlayer(e,t),Kn=(e,t={})=>$.registerHTML5Player(e,t),qn=(e,t={})=>$.registerReactNativeVideoPlayer(e,t),Jn=()=>$.getCurrentImpressionId(),Yn=()=>$.analyticsStateMachine,Xn=e=>$.updateCustomData(e),Zn=e=>$.updateCustomVideoData(e),Qn=e=>$.updateCustomUserData(e),$n=e=>$.updateCustomPlayerData(e),er=(e,t)=>$.customEventHandler(e,t),tr=(e,t)=>new Promise((n,r)=>{$.customEventHandlerAsync(e,t).then(e=>{n(e)}).catch(e=>{r(e)})}),nr=e=>($=new Vn(e),{register:Un,registerHLSJSPlayer:Wn,registerShakaPlayer:Gn,registerHTML5Player:Kn,registerReactNativeVideoPlayer:qn,getCurrentImpressionId:Jn,stateMachine:Yn,updateCustomData:Xn,updateCustomVideoData:Zn,updateCustomUserData:Qn,updateCustomPlayerData:$n,setCustomData:$.setCustomData,setCustomDataOnce:$.setCustomDataOnce,customEventHandler:er,customEventHandlerAsync:tr});nr.Players=h,nr.CdnProviders=f,nr.gumletInsightsEvents=p,nr.gumletSupportedPlayers=h,typeof window<`u`&&(window.gumlet=window.gumlet||{},window.gumlet.insights=nr,window.gumlet.GumletInsights=Hn,window.gumletInsightsEvents=p,window.gumletSupportedPlayers=h,window.gumlet.insightsFullCustomTestConfig=te);var rr={insights:nr,gumletInsightsEvents:p,gumletSupportedPlayers:h,fullCustomAnalyticsConfig:te};return e.GumletInsights=Hn,e.default=rr,e.fullCustomAnalyticsConfig=te,e})({});
|
|
9
|
+
var gminsights=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e));let f={CLOUDFLARE:`cloudflare`,AKAMAI:`akamai`,FASTLY:`fastly`,MAXCDN:`maxcdn`,CLOUDFRONT:`cloudfront`,CHINACACHE:`chinacache`,BITGRAVITY:`bitgravity`};var p,m=s((()=>{p={READY:`ready`,STARTUP:`startup`,SOURCE_LOADED:`sourceLoaded`,PLAY:`play`,PAUSE:`pause`,TIMECHANGED:`timechanged`,SEEK:`seek`,SEEKED:`seeked`,START_CAST:`startCasting`,END_CAST:`endCasting`,START_BUFFERING:`startBuffering`,END_BUFFERING:`endBuffering`,AUDIO_CHANGE:`audioChange`,VIDEO_CHANGE:`videoChange`,START_FULLSCREEN:`startFullscreen`,END_FULLSCREEN:`endFullscreen`,START_AD:`adStart`,END_AD:`adEnd`,MUTE:`mute`,UN_MUTE:`unMute`,ERROR:`playerError`,NON_FATAL_ERROR:`playerNonFatalError`,PLAYBACK_FINISHED:`end`,SCREEN_RESIZE:`resize`,UNLOAD:`unload`,END:`end`,METADATA_LOADED:`metadataLoaded`,SOURCE_UNLOADED:`sourceUnloaded`,PLAYBACK_PLAYING:`playback_playing`}})),h,ee=s((()=>{h={JW:`jw`,RADIANT:`radiant`,HLSJS:`hlsjs`,SHAKA:`shaka`,HTML:`html5`,REACTNATIVEVIDEO:`react-native-video`}}));m(),ee();let te={experimentName:`insights-test-experiment`,customData1:`custom_data_1:test-slot-1`,customData2:`custom_data_2:test-slot-2`,customData3:`custom_data_3:test-slot-3`,customData4:`custom_data_4:test-slot-4`,customData5:`custom_data_5:test-slot-5`,customData6:`custom_data_6:test-slot-6`,customData7:`custom_data_7:test-slot-7`,customData8:`custom_data_8:test-slot-8`,customData9:`custom_data_9:test-slot-9`,customData10:`custom_data_10:test-slot-10`,customPlayerIntegrationVersion:`custom_player_integration_version:1.2.3-test`,customPlayerName:`custom_player_name:TestPlayerShell`,customPageType:`custom_page_type:article`,userId:`custom_user_id:test-user-42`,userName:`custom_user_name:Ada Test`,userEMail:`custom_user_email:test@example.com`,userPhone:`custom_user_phone:+1-555-0100`,userProfileImage:`custom_user_profile_image:https://example.com/avatar.png`,userAddressLine1:`custom_user_address_line_1:1 Test Street`,userAddressLine2:`custom_user_address_line_2:Suite 100`,userCity:`custom_user_city:Testville`,userState:`custom_user_state:TS`,userCountry:`custom_user_country:Testland`,userZipcode:`custom_user_zipcode:99999`,customContentType:`custom_content_type:application/x-test-stream`,customVideoDurationMillis:`custom_video_duration_millis:12345678`,customEncodingVariant:`custom_encoding_variant:h264-720p-test`,customVideoLanguage:`custom_video_language:en-TEST`,customVideoId:`custom_video_id:vid-integration-001`,customVideoSeries:`custom_video_series:Series Test Pack`,customVideoProducer:`custom_video_producer:QA Producer`,customVideoTitle:`custom_video_title:Full metadata smoke test`,customVideoVariantName:`custom_video_variant_name:main-feed`,customVideoVariant:`custom_video_variant:abr-ladder-a`},ne=e=>e!==void 0&&typeof e==`string`,re=e=>e!==void 0&&typeof e==`boolean`,ie=e=>e!==void 0&&typeof e==`number`,ae=e=>e.replace(/\/$/g,``),oe=e=>(e*=1e3,Math.round(e)),se=e=>{let t=e.toString().length;return t===13?e:e*10**(13-t)},ce=()=>Date.now(),le=e=>ce()-e,ue=()=>{if(crypto&&crypto.randomUUID)return crypto.randomUUID();let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[...e].map(e=>e.toString(16).padStart(2,`0`));return t.slice(0,4).join(``)+`-`+t.slice(4,6).join(``)+`-`+t.slice(6,8).join(``)+`-`+t.slice(8,10).join(``)+`-`+t.slice(10,16).join(``)},de=e=>{let t=`${e}=`,n=[];try{n=document.cookie.split(`;`)}catch{return``}let r=null;for(let e=0;e<n.length;e++){let i=n[e];for(;i.charAt(0)===` `;)i=i.substring(1);i.indexOf(t)===0&&(r=i.substring(t.length,i.length))}if(!r){try{r=localStorage.getItem(e)}catch{return``}let t=null;if(r)try{t=JSON.parse(r)}catch{return``}else return``;let n=null;if(t.expires)n=new Date(t.expires);else return``;if(Object.prototype.toString.call(n)===`[object Date]`){if(!(n instanceof Date&&!isNaN(n.getTime())))return``}else return``;if(n.getTime()>new Date().getTime())r=t.value?t.value:``;else return``}return r},fe=(e,t=30,n=null)=>{let r=new Date;r.setTime(r.getTime()+t*60*1e3);let i=n||ue();try{document.cookie=`${e}=${i}; expires=${r.toUTCString()}; path=/`,localStorage.setItem(e,JSON.stringify({expires:r.getTime(),value:i}))}catch{}return i},pe=()=>{},me=(e,t)=>{let n=0,r;return()=>n>=t?r:(r=e.apply(null,arguments),n++,r)},he=e=>me(e,1),ge=()=>{let e=[`webkit`,`moz`,`ms`,`o`];if(`hidden`in document)return`hidden`;for(let t=0;t<e.length;t++)if(`${e[t]}Hidden`in document)return`${e[t]}Hidden`;return null},_e=e=>typeof e==`object`?JSON.stringify(e):typeof e==`function`?_e(e()):e===void 0||typeof e==`string`?e:String(e);var g={validString:ne,validBoolean:re,validNumber:ie,sanitizePath:ae,calculateTime:oe,getCurrentTimestamp:ce,getDurationFromTimestampToNow:le,uuidv4:ue,getCookie:de,setCookie:fe,noOp:pe,times:me,once:he,getHiddenProp:ge,getCustomDataString:_e,jsonToQueryString:e=>`?`+Object.keys(e).map(t=>encodeURIComponent(t)+`=`+encodeURIComponent(e[t])).join(`&`),currentDateTimeFormatString:()=>new Date().toISOString(),convertEpochTime:se};function ve(){return typeof performance<`u`&&typeof performance.timeOrigin==`number`&&!Number.isNaN(performance.timeOrigin)&&typeof performance.now==`function`?((performance.timeOrigin+performance.now())/1e3).toFixed(9):(Date.now()/1e3).toFixed(9)}function ye(e){e.z=ve();let t=[void 0,null,!1];Object.keys(e).forEach(n=>{t.indexOf(e[n])!==-1&&delete e[n]}),Object.keys(e).forEach(t=>{Number.isNaN(e[t])&&delete e[t]})}var be=class{get(e,t,n,r=!0){ye(t);let i=g.jsonToQueryString(t);e+=i,fetch(e,{method:`GET`,keepalive:r===!1}).then(e=>e.text()).then(e=>{e&&e.length>0&&n(e)}).catch(()=>{})}asyncGet(e,t){return new Promise((n,r)=>{ye(t);let i=g.jsonToQueryString(t);e+=i,fetch(e,{method:`GET`}).then(e=>e.ok?e.text():Promise.reject({status:e.status,statusText:e.statusText})).then(e=>n(e)).catch(e=>{e&&typeof e.status==`number`?r(e):r({status:0,statusText:``})})})}};let xe=!0;function Se(e){xe=e}function Ce(){return xe}var we,Te,Ee,De,_=s((()=>{we=`urn:x-cast:com.gumlet.ingest.cast`,Te=`https://ingest.gumlytics.com`,Ee=`https://ingest.gumlytics.com`.endsWith(`/`)?Te:`${Te}/`,De=new URL(`v2`,Ee).href.replace(/\/+$/,``)}));_();function Oe(){return{}}let ke=Oe;function Ae(e){ke=e}function je(e){if(!(e.meta_user_agent!=null&&e.meta_user_agent!==``))try{typeof navigator<`u`&&navigator.userAgent&&(e.meta_user_agent=navigator.userAgent)}catch{}}function Me(e){if(e.event_duration_millis!=null)return;let t=e.from,n=e.to;typeof t==`number`&&typeof n==`number`&&!Number.isNaN(t)&&!Number.isNaN(n)&&(e.event_duration_millis=n-t)}function Ne(e){let t=e.user_email;t!=null&&t!==``&&(e.custom_user_email==null||e.custom_user_email===``)&&(e.custom_user_email=t)}function Pe(e,t){let n={...e};for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}function Fe(e){let t=Pe(ke(),e);return t.bitrate_mbps==null&&t.bitrate!=null&&(t.bitrate_mbps=t.bitrate),t.player_software==null&&t.player_name!=null&&(t.player_software=t.player_name),je(t),Me(t),Ne(t),t}var Ie=class e extends be{constructor(...t){super(...t),this.sendRequest=function(t,n){t.event_family=`session_event`;let r=Ce()?Fe({...t}):null;this.get(e.analyticsServerUrl,t,n),r&&this.get(e.analyticsServerUrlV2,r,g.noOp)},this.sendRequestAsync=function(t){t.event_family=`session_event`;let n=Ce()?Fe({...t}):null,r=this.asyncGet(e.analyticsServerUrl,t);return n&&this.asyncGet(e.analyticsServerUrlV2,n).catch(()=>{}),r},this.sendRequestSynchronous=function(t,n){t.event_family=`session_event`;let r=Ce()?Fe({...t}):null;this.get(e.analyticsServerUrl,t,n,!1),r&&this.get(e.analyticsServerUrlV2,r,g.noOp,!1)},this.getAnalyticsServerUrl=()=>e.analyticsServerUrl}static{this.analyticsServerUrl=Te}static{this.analyticsServerUrlV2=De}},Le,v,Re=s((()=>{Le=class{constructor(e=!1){this.log=e=>{this.showLogs&&console.log(e)},this.error=e=>{this.showLogs&&console.error(e)},this.warning=e=>{this.showLogs&&console.warn(e)},this.showLogs=e}setLogging(e){this.showLogs=e}isLogging(){return this.showLogs}},v=new Le}));Re();function ze(e){return typeof window>`u`||!window.shaka?!1:typeof shaka.Player==`function`&&e?.constructor===shaka.Player}function Be(e){return typeof window>`u`||!window.Hls?!1:typeof Hls==`function`&&e?.constructor===Hls}let Ve={isShaka:ze,isHlsjs:Be};_();var He=class{setUp(){v.log(`setting up cast session`),this.castSession=cast.framework.CastContext.getInstance().getCurrentSession(),this.addMessageListener()}addMessageListener(){let e=this.castSession.getApplicationMetadata();if(!e||e.namespaces.indexOf(`urn:x-cast:com.gumlet.ingest.cast`)<0){v.log(`No analytics on chrome cast receiver enabled!`);return}v.log(`adding message listener`),this.castSession.addMessageListener(we,(e,t)=>{v.log(`Received: ${e} ${t}`);try{let e=JSON.parse(t);this.handleReceiverMessage(e)}catch{v.error(`Message parsing failed ${t}`)}})}handleReceiverMessage(e){v.log(e)}sendMessage(e){let t=this.castSession.getApplicationMetadata();if(!t||t.namespaces.indexOf(`urn:x-cast:com.gumlet.ingest.cast`)<0){v.log(`No analytics on chrome cast receiver enabled!`);return}v.log(`Sending message: ${JSON.stringify(e)}`),this.castSession.sendMessage(we,e)}};_(),Re();var Ue=class{setUp(){this.messageBus=cast.receiver.CastReceiverManager.getInstance().getCastMessageBus(we,cast.receiver.CastMessageBus.MessageType.JSON),v.log(this.messageBus),this.messageBus.onMessage=e=>{v.log(`Received message from cast client: ${JSON.stringify(e)}`);let t=e.data;this.handleClientMessage(t)}}setCallback(e){this.callback=e}handleClientMessage(e){this.callback(e)}sendMessage(e){this.messageBus.broadcast(e)}};let y={SETUP:`event_setup`,PLAYER_READY:`event_player_ready`,PLAYBACK_READY:`event_playback_ready`,PLAYBACK_STARTED:`event_playback_started`,PAUSE:`event_pause`,PLAY:`event_play`,PLAYING:`event_playing`,PLAYBACK_UPDATE:`event_playback_update`,END:`event_ended`,MUTE:`event_muted`,UNMUTE:`event_unmute`,SEEKED:`event_seeked`,START_REBUFFER:`event_rebuffer_start`,END_REBUFFER:`event_rebuffer_end`,ERROR:`event_error`,ERROR_RECOVERED:`event_error_recovered`};var We=`2.0.9`,Ge=500,Ke=`user-agent`,qe=``,Je=`?`,b={FUNCTION:`function`,OBJECT:`object`,STRING:`string`,UNDEFINED:`undefined`},x=`browser`,S=`cpu`,C=`device`,w=`engine`,T=`os`,Ye=`result`,E=`name`,D=`type`,O=`vendor`,k=`version`,A=`architecture`,Xe=`major`,j=`model`,Ze=`console`,M=`mobile`,N=`tablet`,P=`smarttv`,F=`wearable`,Qe=`xr`,$e=`embedded`,et=`fetcher`,I=`inapp`,tt=`brands`,L=`formFactors`,nt=`fullVersionList`,rt=`platform`,it=`platformVersion`,at=`bitness`,R=`sec-ch-ua`,ot=R+`-full-version-list`,st=R+`-arch`,ct=R+`-`+at,lt=R+`-form-factors`,ut=R+`-`+M,dt=R+`-`+j,ft=R+`-`+rt,pt=ft+`-version`,mt=[tt,nt,M,j,rt,it,A,L,at],ht=`Amazon`,gt=`Apple`,_t=`ASUS`,vt=`BlackBerry`,z=`Google`,yt=`Huawei`,bt=`Lenovo`,xt=`Honor`,St=`LG`,Ct=`Microsoft`,wt=`Motorola`,Tt=`Nvidia`,Et=`OnePlus`,Dt=`OPPO`,Ot=`Samsung`,kt=`Sharp`,At=`Sony`,jt=`Xiaomi`,Mt=`Zebra`,Nt=`Chrome`,Pt=`Chromium`,B=`Chromecast`,Ft=`Edge`,It=`Firefox`,V=`Opera`,Lt=`Facebook`,Rt=`Sogou`,H=`Mobile `,U=` Browser`,zt=`Windows`,W=typeof window!==b.UNDEFINED&&window.navigator?window.navigator:void 0,G=W&&W.userAgentData?W.userAgentData:void 0,Bt=function(e,t){var n={},r=t;if(!Ut(t))for(var i in r={},t)for(var a in t[i])r[a]=t[i][a].concat(r[a]?r[a]:[]);for(var o in e)n[o]=r[o]&&r[o].length%2==0?r[o].concat(e[o]):e[o];return n},Vt=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},Ht=function(e,t){if(typeof e===b.OBJECT&&e.length>0){for(var n in e)if(K(t)==K(e[n]))return!0;return!1}return Wt(e)?K(t)==K(e):!1},Ut=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?Ut(e[n]):!1)},Wt=function(e){return typeof e===b.STRING},Gt=function(e){if(e){for(var t=[],n=qt(/\\?\"/g,e).split(`,`),r=0;r<n.length;r++)if(n[r].indexOf(`;`)>-1){var i=Yt(n[r]).split(`;v=`);t[r]={brand:i[0],version:i[1]}}else t[r]=Yt(n[r]);return t}},K=function(e){return Wt(e)?e.toLowerCase():e},Kt=function(e){return Wt(e)?qt(/[^\d\.]/g,e).split(`.`)[0]:void 0},q=function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];typeof n==b.OBJECT&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},qt=function(e,t){return Wt(t)?t.replace(e,qe):t},Jt=function(e){return qt(/\\?\"/g,e)},Yt=function(e,t){return e=qt(/^\s\s*/,String(e)),typeof t===b.UNDEFINED?e:e.substring(0,t)},Xt=function(e,t){if(!(!e||!t))for(var n=0,r,i,a,o,s,c;n<t.length&&!s;){var l=t[n],u=t[n+1];for(r=i=0;r<l.length&&!s&&l[r];)if(s=l[r++].exec(e),s)for(a=0;a<u.length;a++)c=s[++i],o=u[a],typeof o===b.OBJECT&&o.length>0?o.length===2?typeof o[1]==b.FUNCTION?this[o[0]]=o[1].call(this,c):this[o[0]]=o[1]:o.length>=3&&(typeof o[1]===b.FUNCTION&&!(o[1].exec&&o[1].test)?o.length>3?this[o[0]]=c?o[1].apply(this,o.slice(2)):void 0:this[o[0]]=c?o[1].call(this,c,o[2]):void 0:o.length==3?this[o[0]]=c?c.replace(o[1],o[2]):void 0:o.length==4?this[o[0]]=c?o[3].call(this,c.replace(o[1],o[2])):void 0:o.length>4&&(this[o[0]]=c?o[3].apply(this,[c.replace(o[1],o[2])].concat(o.slice(4))):void 0)):this[o]=c||void 0;n+=2}},J=function(e,t){for(var n in t)if(typeof t[n]===b.OBJECT&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(Ht(t[n][r],e))return n===Je?void 0:n}else if(Ht(t[n],e))return n===Je?void 0:n;return t.hasOwnProperty(`*`)?t[`*`]:e},Zt={ME:`4.90`,"NT 3.51":`3.51`,"NT 4.0":`4.0`,2e3:[`5.0`,`5.01`],XP:[`5.1`,`5.2`],Vista:`6.0`,7:`6.1`,8:`6.2`,"8.1":`6.3`,10:[`6.4`,`10.0`],NT:``},Qt={embedded:`Automotive`,mobile:`Mobile`,tablet:[`Tablet`,`EInk`],smarttv:`TV`,wearable:`Watch`,xr:[`VR`,`XR`],"?":[`Desktop`,`Unknown`],"*":void 0},$t={Chrome:`Google Chrome`,Edge:`Microsoft Edge`,"Edge WebView2":`Microsoft Edge WebView2`,"Chrome WebView":`Android WebView`,"Chrome Headless":`HeadlessChrome`,"Huawei Browser":`HuaweiBrowser`,"MIUI Browser":`Miui Browser`,"Opera Mobi":`OperaMobile`,Yandex:`YaBrowser`},en={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[k,[E,H+`Chrome`]],[/webview.+edge\/([\w\.]+)/i],[k,[E,Ft+` WebView`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[k,[E,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[E,k],[/opios[\/ ]+([\w\.]+)/i],[k,[E,V+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[k,[E,V+` GX`]],[/\bopr\/([\w\.]+)/i],[k,[E,V]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[k,[E,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[k,[E,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:hi|lg |ovi|qute)browser|palemoon)\/v?([-\w\.]+)/i,/(brave)(?: chrome)?\/([\d\.]+)/i,/(aloha|heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[E,k],[/quark(?:pc)?\/([-\w\.]+)/i],[k,[E,`Quark`]],[/\bddg\/([\w\.]+)/i],[k,[E,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[k,[E,`UCBrowser`]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[k,[E,`WeChat`]],[/konqueror\/([\w\.]+)/i],[k,[E,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[k,[E,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[k,[E,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[k,[E,`Smart `+bt+U]],[/(av(?:ast|g|ira))\/([\w\.]+)/i],[[E,/(.+)/,`$1 Secure`+U],k],[/norton\/([\w\.]+)/i],[k,[E,`Norton Private`+U]],[/\bfocus\/([\w\.]+)/i],[k,[E,It+` Focus`]],[/ mms\/([\w\.]+)$/i],[k,[E,V+` Neon`]],[/ opt\/([\w\.]+)$/i],[k,[E,V+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[k,[E,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[k,[E,`Dolphin`]],[/coast\/([\w\.]+)/i],[k,[E,V+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[k,[E,`MIUI`+U]],[/fxios\/([\w\.-]+)/i],[k,[E,H+It]],[/\bqihoobrowser\/?([\w\.]*)/i],[k,[E,`360`]],[/\b(qq)\/([\w\.]+)/i],[[E,/(.+)/,`$1Browser`],k],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[E,/(.+)/,`$1`+U],k],[/samsungbrowser\/([\w\.]+)/i],[k,[E,Ot+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[k,[E,Rt+` Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[E,Rt+` Mobile`],k],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[E,k],[/(lbbrowser|luakit|rekonq|steam(?= (clie|tenf|gameo)))/i],[E],[/ome\/([\w\.]+).+(iron(?= saf)|360(?=[es]e$))/i],[k,E],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[E,Lt],k,[D,I]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[E,k,[D,I]],[/\bgsa\/([\w\.]+) .*safari\//i],[k,[E,`GSA`],[D,I]],[/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i],[k,[E,`TikTok`],[D,I]],[/\[(linkedin)app\]/i],[E,[D,I]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[E,/(.+)/,`Zalo`],k,[D,I]],[/(chromium)[\/ ]([-\w\.]+)/i],[E,k],[/ome-(lighthouse)$/i],[E,[D,et]],[/headlesschrome(?:\/([\w\.]+)| )/i],[k,[E,Nt+` Headless`]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[k,[E,Ft+` WebView2`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[E,Nt+` WebView`],k],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[k,[E,`Android`+U]],[/chrome\/([\w\.]+) mobile/i],[k,[E,H+`Chrome`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[E,k],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[k,[E,H+`Safari`]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[E,H+`Safari`]],[/version\/([\w\.\,]+) .*(safari)/i],[k,E],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[E,[k,`1`]],[/(webkit|khtml)\/([\w\.]+)/i],[E,k],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[E,H+It],k],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[E,`Netscape`],k],[/(wolvic|librewolf)\/([\w\.]+)/i],[E,k],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[k,[E,It+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[E,[k,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[E,[k,/[^\d\.]+./,qe]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[A,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[A,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[A,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[A,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[A,`arm`]],[/ sun4\w[;\)]/i],[[A,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[A,/ower/,qe,K]],[/mc680.0/i],[[A,`68k`]],[/winnt.+\[axp/i],[[A,`alpha`]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[j,[O,Ot],[D,N]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[j,[O,Ot],[D,M]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[j,[O,gt],[D,M]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[j,[O,gt],[D,N]],[/(macintosh);/i],[j,[O,gt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[j,[O,kt],[D,M]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[j,[O,xt],[D,N]],[/honor([-\w ]+)[;\)]/i],[j,[O,xt],[D,M]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[j,[O,yt],[D,N]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[j,[O,yt],[D,M]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[j,/_/g,` `],[O,jt],[D,N]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[j,/_/g,` `],[O,jt],[D,M]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-l]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[j,[O,Et],[D,M]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[j,[O,Dt],[D,M]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[j,[O,J,{OnePlus:[`203`,`304`,`403`,`404`,`413`,`415`],"*":Dt}],[D,N]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[j,[O,`BLU`],[D,M]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[j,[O,`Vivo`],[D,M]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[j,[O,`Realme`],[D,M]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[j,[O,bt],[D,N]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[j,[O,bt],[D,M]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[j,[O,wt],[D,M]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[j,[O,wt],[D,N]],[/\b(?:lg)?([vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[j,[O,St],[D,N]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[j,[O,St],[D,M]],[/(nokia) (t[12][01])/i],[O,j,[D,N]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[j,/_/g,` `],[D,M],[O,`Nokia`]],[/(pixel (c|tablet))\b/i],[j,[O,z],[D,N]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[j,[O,z],[D,M]],[/(google) (pixelbook( go)?)/i],[O,j],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[j,[O,At],[D,M]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[j,`Xperia Tablet`],[O,At],[D,N]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[j,[O,ht],[D,N]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[j,/(.+)/g,`Fire Phone $1`],[O,ht],[D,M]],[/(playbook);[-\w\),; ]+(rim)/i],[j,O,[D,N]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[j,[O,vt],[D,M]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[j,[O,_t],[D,N]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[j,[O,_t],[D,M]],[/(nexus 9)/i],[j,[O,`HTC`],[D,N]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[O,[j,/_/g,` `],[D,M]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[j,[O,`TCL`],[D,N]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[j,[O,`TCL`],[D,M]],[/(itel) ((\w+))/i],[[O,K],j,[D,J,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[j,[O,`Acer`],[D,N]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[j,[O,`Meizu`],[D,M]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[j,[O,`Ulefone`],[D,M]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[j,[O,`Energizer`],[D,M]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[j,[O,`Cat`],[D,M]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[j,[O,`Smartfren`],[D,M]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[j,[O,`Nothing`],[D,M]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[j,[O,`Archos`],[D,N]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[j,[O,`Archos`],[D,M]],[/; (n159v)/i],[j,[O,`HMD`],[D,M]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[O,j,[D,N]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[O,j,[D,M]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[O,j,[D,N]],[/(surface duo)/i],[j,[O,Ct],[D,N]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[j,[O,`Fairphone`],[D,M]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[j,[O,Tt],[D,N]],[/(sprint) (\w+)/i],[O,j,[D,M]],[/(kin\.[onetw]{3})/i],[[j,/\./g,` `],[O,Ct],[D,M]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[j,[O,Mt],[D,N]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[j,[O,Mt],[D,M]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[O,[D,P]],[/hbbtv.+maple;(\d+)/i],[[j,/^/,`SmartTV`],[O,Ot],[D,P]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[O,j,[D,P]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[O,St],[D,P]],[/(apple) ?tv/i],[O,[j,gt+` TV`],[D,P]],[/crkey.*devicetype\/chromecast/i],[[j,B+` Third Generation`],[O,z],[D,P]],[/crkey.*devicetype\/([^/]*)/i],[[j,/^/,`Chromecast `],[O,z],[D,P]],[/fuchsia.*crkey/i],[[j,B+` Nest Hub`],[O,z],[D,P]],[/crkey/i],[[j,B],[O,z],[D,P]],[/(portaltv)/i],[j,[O,Lt],[D,P]],[/droid.+aft(\w+)( bui|\))/i],[j,[O,ht],[D,P]],[/(shield \w+ tv)/i],[j,[O,Tt],[D,P]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[j,[O,kt],[D,P]],[/(bravia[\w ]+)( bui|\))/i],[j,[O,At],[D,P]],[/(mi(tv|box)-?\w+) bui/i],[j,[O,jt],[D,P]],[/Hbbtv.*(technisat) (.*);/i],[O,j,[D,P]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[O,/.+\/(\w+)/,`$1`,J,{LG:`lge`}],[j,Yt],[D,P]],[/(playstation \w+)/i],[j,[O,At],[D,Ze]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[j,[O,Ct],[D,Ze]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[O,J,{Nvidia:`Shield`,Anbernic:`RGCUBE`,Logitech:`GR0006`}],j,[D,Ze]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[j,[O,Ot],[D,F]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[O,j,[D,F]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[j,[O,Dt],[D,F]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[j,[O,gt],[D,F]],[/(opwwe\d{3})/i],[j,[O,Et],[D,F]],[/(moto 360)/i],[j,[O,wt],[D,F]],[/(smartwatch 3)/i],[j,[O,At],[D,F]],[/(g watch r)/i],[j,[O,St],[D,F]],[/droid.+; (wt63?0{2,3})\)/i],[j,[O,Mt],[D,F]],[/droid.+; (glass) \d/i],[j,[O,z],[D,Qe]],[/(pico) ([\w ]+) os\d/i],[O,j,[D,Qe]],[/(quest( \d| pro)?s?).+vr/i],[j,[O,Lt],[D,Qe]],[/mobile vr; rv.+firefox/i],[[D,Qe]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[O,[D,$e]],[/(aeobc)\b/i],[j,[O,ht],[D,$e]],[/(homepod).+mac os/i],[j,[O,gt],[D,$e]],[/windows iot/i],[[D,$e]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[j,[D,P]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[D,P]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[j,[D,J,{mobile:`Mobile`,xr:`VR`,"*":N}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[D,N]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[D,M]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[j,[O,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[k,[E,Ft+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[E,k],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[k,[E,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links|dillo)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[E,k],[/ladybird\//i],[[E,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[k,E]],os:[[/(windows nt) (6\.[23]); arm/i],[[E,/N/,`R`],[k,J,Zt]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[E,k],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[k,/(;|\))/g,``,J,Zt],[E,zt]],[/(windows ce)\/?([\d\.]*)/i],[E,k],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[k,/_/g,`.`],[E,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[E,`macOS`],[k,/_/g,`.`]],[/android ([\d\.]+).*crkey/i],[k,[E,B+` Android`]],[/fuchsia.*crkey\/([\d\.]+)/i],[k,[E,B+` Fuchsia`]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[k,[E,B+` SmartSpeaker`]],[/linux.*crkey\/([\d\.]+)/i],[k,[E,B+` Linux`]],[/crkey\/([\d\.]+)/i],[k,[E,B]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[k,E],[/(ubuntu) ([\w\.]+) like android/i],[[E,/(.+)/,`$1 Touch`],k],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[E,k],[/\(bb(10);/i],[k,[E,vt]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[k,[E,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i],[k,[E,It+` OS`]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[k,[E,`webOS`]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[k,J,{25:`120`,24:`108`,23:`94`,22:`87`,6:`79`,5:`68`,4:`53`,3:`38`,2:`538`,1:`537`,"*":`TV`}],[E,`webOS`]],[/watch(?: ?os[,\/ ]|\d,\d\/)([\d\.]+)/i],[k,[E,`watchOS`]],[/cros [\w]+(?:\)| ([\w\.]+)\b)/i],[k,[E,`Chrome OS`]],[/kepler ([\w\.]+); (aft|aeo)/i],[k,[E,`Vega OS`]],[/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[E,k],[/(sunos) ?([\d\.]*)/i],[[E,`Solaris`],k],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[E,k]]},tn=(function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return q.call(e.init,[[x,[E,k,Xe,D]],[S,[A]],[C,[D,j,O]],[w,[E,k]],[T,[E,k]]]),q.call(e.isIgnore,[[x,[k,Xe]],[w,[k]],[T,[k]]]),q.call(e.isIgnoreRgx,[[x,/ ?browser$/i],[T,/ ?os$/i]]),q.call(e.toString,[[x,[E,k]],[S,[A]],[C,[O,j]],[w,[E,k]],[T,[E,k]]]),e})(),nn=function(e,t){var n=tn.init[t],r=tn.isIgnore[t]||0,i=tn.isIgnoreRgx[t]||0,a=tn.toString[t]||0;function o(){q.call(this,n)}return o.prototype.getItem=function(){return e},o.prototype.withClientHints=function(){return G?G.getHighEntropyValues(mt).then(function(t){return e.setCH(new rn(t,!1)).parseCH().get()}):e.parseCH().get()},o.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=Ye&&(o.prototype.is=function(e){var t=!1;for(var n in this)if(this.hasOwnProperty(n)&&!Ht(r,n)&&K(i?qt(i,this[n]):this[n])==K(i?qt(i,e):e)){if(t=!0,e!=b.UNDEFINED)break}else if(e==b.UNDEFINED&&t){t=!t;break}return t},o.prototype.toString=function(){var e=qe;for(var t in a)typeof this[a[t]]!==b.UNDEFINED&&(e+=(e?` `:qe)+this[a[t]]);return e||b.UNDEFINED}),o.prototype.then=function(e){var t=this,n=function(){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e])};n.prototype={is:o.prototype.is,toString:o.prototype.toString,withClientHints:o.prototype.withClientHints,withFeatureCheck:o.prototype.withFeatureCheck};var r=new n;return e(r),r},new o};function rn(e,t){if(e||={},q.call(this,mt),t)q.call(this,[[tt,Gt(e[R])],[nt,Gt(e[ot])],[M,/\?1/.test(e[ut])],[j,Jt(e[dt])],[rt,Jt(e[ft])],[it,Jt(e[pt])],[A,Jt(e[st])],[L,Gt(e[lt])],[at,Jt(e[ct])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==b.UNDEFINED&&(this[n]=e[n])}function Y(e,t,n,r){return q.call(this,[[`itemType`,e],[`ua`,t],[`uaCH`,r],[`rgxMap`,n],[`data`,nn(this,e)]]),this}Y.prototype.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data},Y.prototype.set=function(e,t){return this.data[e]=t,this},Y.prototype.setCH=function(e){return this.uaCH=e,this},Y.prototype.detectFeature=function(){if(W&&W.userAgent==this.ua)switch(this.itemType){case x:W.brave&&typeof W.brave.isBrave==b.FUNCTION&&this.set(E,`Brave`);break;case C:!this.get(D)&&G&&G[M]&&this.set(D,M),this.get(j)==`Macintosh`&&W&&typeof W.standalone!==b.UNDEFINED&&W.maxTouchPoints&&W.maxTouchPoints>2&&this.set(j,`iPad`).set(D,N);break;case T:!this.get(E)&&G&&G[rt]&&this.set(E,G[rt]);break;case Ye:var e=this.data,t=function(t){return e[t].getItem().detectFeature().get()};this.set(x,t(x)).set(S,t(S)).set(C,t(C)).set(w,t(w)).set(T,t(T))}return this},Y.prototype.parseUA=function(){switch(this.itemType!=Ye&&Xt.call(this.data,this.ua,this.rgxMap),this.itemType){case x:this.set(Xe,Kt(this.get(k)));break;case T:if(this.get(E)==`iOS`&&this.get(k)==`18.6`){var e=/\) Version\/([\d\.]+)/.exec(this.ua);e&&parseInt(e[1].substring(0,2),10)>=26&&this.set(k,e[1])}break}return this},Y.prototype.parseCH=function(){var e=this.uaCH,t=this.rgxMap;switch(this.itemType){case x:case w:var n=e[nt]||e[tt],r;if(n)for(var i=0;i<n.length;i++){var a=n[i].brand||n[i],o=n[i].version;this.itemType==x&&!/not.a.brand/i.test(a)&&(!r||/Chrom/.test(r)&&a!=Pt||r==Ft&&/WebView2/.test(a))&&(a=J(a,$t),r=this.get(E),r&&!/Chrom/.test(r)&&/Chrom/.test(a)||this.set(E,a).set(k,o).set(Xe,Kt(o)),r=a),this.itemType==w&&a==Pt&&this.set(k,o)}break;case S:var s=e[A];s&&(s&&e[at]==`64`&&(s+=`64`),Xt.call(this.data,s+`;`,t));break;case C:if(e[M]&&this.set(D,M),e[j]&&(this.set(j,e[j]),!this.get(D)||!this.get(O))){var c={};Xt.call(c,`droid 9; `+e[j]+`)`,t),!this.get(D)&&c.type&&this.set(D,c.type),!this.get(O)&&c.vendor&&this.set(O,c.vendor)}if(e[L]){var l;if(typeof e[L]!=`string`)for(var u=0;!l&&u<e[L].length;)l=J(e[L][u++],Qt);else l=J(e[L],Qt);this.set(D,l)}break;case T:var d=e[rt];if(d){var f=e[it];d==zt&&(f=parseInt(Kt(f),10)>=13?`11`:`10`),this.set(E,d).set(k,f)}this.get(E)==zt&&e[j]==`Xbox`&&this.set(E,`Xbox`).set(k,void 0);break;case Ye:var p=this.data,m=function(t){return p[t].getItem().setCH(e).parseCH().get()};this.set(x,m(x)).set(S,m(S)).set(C,m(C)).set(w,m(w)).set(T,m(T))}return this};function X(e,t,n){if(typeof e===b.OBJECT?(Ut(e,!0)?(typeof t===b.OBJECT&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===b.STRING&&!Ut(t,!0)&&(n=t,t=void 0),n)if(typeof n.append===b.FUNCTION){var r={};n.forEach(function(e,t){r[String(t).toLowerCase()]=e}),n=r}else{var i={};for(var a in n)n.hasOwnProperty(a)&&(i[String(a).toLowerCase()]=n[a]);n=i}if(!(this instanceof X))return new X(e,t,n).getResult();var o=typeof e===b.STRING?e:n&&n[Ke]?n[Ke]:W&&W.userAgent?W.userAgent:qe,s=new rn(n,!0),c=t?Bt(en,t):en,l=function(e){return e==Ye?function(){return new Y(e,o,c,s).set(`ua`,o).set(x,this.getBrowser()).set(S,this.getCPU()).set(C,this.getDevice()).set(w,this.getEngine()).set(T,this.getOS()).get()}:function(){return new Y(e,o,c[e],s).parseUA().get()}};return q.call(this,[[`getBrowser`,l(x)],[`getCPU`,l(S)],[`getDevice`,l(C)],[`getEngine`,l(w)],[`getOS`,l(T)],[`getResult`,l(Ye)],[`getUA`,function(){return o}],[`setUA`,function(e){return Wt(e)&&(o=Yt(e,Ge)),this}]]).setUA(o),this}X.VERSION=We,X.BROWSER=Vt([E,k,Xe,D]),X.CPU=Vt([A]),X.DEVICE=Vt([j,O,D,Ze,M,P,N,F,$e]),X.ENGINE=X.OS=Vt([E,k]);let an=()=>{let e=window.navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(e)?`tablet`:/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(e)?`mobile`:`desktop`};_();var on=class e extends be{constructor(...t){super(...t),this.sendRequest=function(t,n){t.event_family=`player_init`,this.get(e.analyticsServerUrl,t,n)},this.sendRequestSynchronous=function(t,n){t.event_family=`player_init`,this.get(e.analyticsServerUrl,t,n,!1)},this.getAnalyticsServerUrl=()=>e.analyticsServerUrl}static{this.analyticsServerUrl=Te}};_();var sn=class e extends be{constructor(...t){super(...t),this.sendRequest=function(t,n){t.event_family=`session`;let r=Ce()?Fe({...t}):null;this.get(e.analyticsServerUrl,t,n),r&&this.get(e.analyticsServerUrlV2,r,g.noOp)},this.sendRequestSynchronous=function(t,n){t.event_family=`session`;let r=Ce()?Fe({...t}):null;this.get(e.analyticsServerUrl,t,n,!1),r&&this.get(e.analyticsServerUrlV2,r,g.noOp,!1)},this.getAnalyticsServerUrl=()=>e.analyticsServerUrl}static{this.analyticsServerUrl=Te}static{this.analyticsServerUrlV2=De}},cn=`2.1.4`;let Z=new X().getResult();var ln=class{constructor(e){this.SDKVersion=cn,this.config=e,this.sessionCreationCall=new sn,this.playerInitCall=new on,this.setConfigParameters()}setConfigParameters(e=this.config){this.customData1=g.getCustomDataString(e.customData1),this.customData2=g.getCustomDataString(e.customData2),this.customData3=g.getCustomDataString(e.customData3),this.customData4=g.getCustomDataString(e.customData4),this.customData5=g.getCustomDataString(e.customData5),this.customData6=g.getCustomDataString(e.customData6),this.customData7=g.getCustomDataString(e.customData7),this.customData8=g.getCustomDataString(e.customData8),this.customData9=g.getCustomDataString(e.customData9),this.customData10=g.getCustomDataString(e.customData10),this.customPlayerIntegrationVersion=g.getCustomDataString(e.customPlayerIntegrationVersion),this.customPlayerName=g.getCustomDataString(e.customPlayerName),this.customPlayerVersion=g.getCustomDataString(e.customPlayerVersion),this.customPageType=g.getCustomDataString(e.customPageType),this.customUserId=g.getCustomDataString(e.userId),this.userName=g.getCustomDataString(e.userName),this.userEMail=g.getCustomDataString(e.userEMail??e.userEmail),this.userPhone=g.getCustomDataString(e.userPhone),this.userProfileImage=g.getCustomDataString(e.userProfileImage),this.userAddressLine1=g.getCustomDataString(e.userAddressLine1),this.userAddressLine2=g.getCustomDataString(e.userAddressLine2),this.userCity=g.getCustomDataString(e.userCity),this.userState=g.getCustomDataString(e.userState),this.userCountry=g.getCustomDataString(e.userCountry),this.userZipcode=g.getCustomDataString(e.userZipcode),this.customContentType=g.getCustomDataString(e.customContentType),this.customVideoDurationMillis=g.getCustomDataString(e.customVideoDurationMillis),this.customEncodingVariant=g.getCustomDataString(e.customEncodingVariant),this.customVideoLanguage=g.getCustomDataString(e.customVideoLanguage),this.customVideoId=g.getCustomDataString(e.customVideoId),this.customWorkspaceId=g.getCustomDataString(e.customWorkspaceId),this.customVideoSeries=g.getCustomDataString(e.customVideoSeries),this.customVideoProducer=g.getCustomDataString(e.customVideoProducer),this.customVideoTitle=g.getCustomDataString(e.customVideoTitle),this.customVideoVariantName=g.getCustomDataString(e.customVideoVariantName),this.customVideoVariant=g.getCustomDataString(e.customVideoVariant),this.SDKVersion=cn,this.experimentName=e.experimentName}updateCustomData(e){this.customData1=g.getCustomDataString(e.customData1),this.customData2=g.getCustomDataString(e.customData2),this.customData3=g.getCustomDataString(e.customData3),this.customData4=g.getCustomDataString(e.customData4),this.customData5=g.getCustomDataString(e.customData5),this.customData6=g.getCustomDataString(e.customData6),this.customData7=g.getCustomDataString(e.customData7),this.customData8=g.getCustomDataString(e.customData8),this.customData9=g.getCustomDataString(e.customData9),this.customData10=g.getCustomDataString(e.customData10)}updateCustomUserData(e){this.customUserId=g.getCustomDataString(e.userId),this.userName=g.getCustomDataString(e.userName),this.userEMail=g.getCustomDataString(e.userEMail??e.userEmail),this.userPhone=g.getCustomDataString(e.userPhone),this.userProfileImage=g.getCustomDataString(e.userProfileImage),this.userAddressLine1=g.getCustomDataString(e.userAddressLine1),this.userAddressLine2=g.getCustomDataString(e.userAddressLine2),this.userCity=g.getCustomDataString(e.userCity),this.userState=g.getCustomDataString(e.userState),this.userCountry=g.getCustomDataString(e.userCountry),this.userZipcode=g.getCustomDataString(e.userZipcode)}updateCustomVideoData(e){this.customContentType=g.getCustomDataString(e.customContentType),this.customVideoDurationMillis=g.getCustomDataString(e.customVideoDurationMillis),this.customEncodingVariant=g.getCustomDataString(e.customEncodingVariant),this.customVideoLanguage=g.getCustomDataString(e.customVideoLanguage),this.customVideoId=g.getCustomDataString(e.customVideoId),this.customWorkspaceId=g.getCustomDataString(e.customWorkspaceId),this.customVideoSeries=g.getCustomDataString(e.customVideoSeries),this.customVideoProducer=g.getCustomDataString(e.customVideoProducer),this.customVideoTitle=g.getCustomDataString(e.customVideoTitle),this.customVideoVariantName=g.getCustomDataString(e.customVideoVariantName),this.customVideoVariant=g.getCustomDataString(e.customVideoVariant)}updateCustomPlayerData(e){this.customPlayerIntegrationVersion=g.getCustomDataString(e.customPlayerIntegrationVersion),this.customPlayerName=g.getCustomDataString(e.customPlayerName),this.customPlayerVersion=g.getCustomDataString(e.customPlayerVersion),this.customPageType=g.getCustomDataString(e.customPageType)}setUserId(e=!1,t=null){if(t){this.userId=t;return}if(e){this.userId=g.uuidv4();return}let n=g.getCookie(`gumlet_user_id`);!n||n===``?this.userId=g.setCookie(`gumlet_user_id`,720*60):this.userId=n}setSessionId(e=!1,t=null,n=!0){if(t){this.sessionId=t,this.setSessionData(),n&&this.sessionCreationCall.sendRequest(this.sessionData,g.noOp);return}if(e){this.sessionId=g.uuidv4();return}let r=g.getCookie(`gumlet_session_id`);!r||r===``?(this.sessionId=g.setCookie(`gumlet_session_id`,30),this.setSessionData(),this.sessionCreationCall.sendRequest(this.sessionData,g.noOp)):(this.sessionId=r,this.setSessionData())}setPlayerInstanceId(e){this.playerInstanceId=e?e():g.uuidv4(),this.setPlayerData()}setPlaybackId(e){this.playbackId=e?e():g.uuidv4()}resetSessionExpiry(){this.config.test||this.config.sessionID||(g.setCookie(`gumlet_session_id`,30,this.sessionId),g.setCookie(`gumlet_user_id`,720*60,this.userId))}setSessionData(){if(this.sessionData={session_id:this.sessionId,property_id:this.propertyId,user_id:this.userId,custom_user_id:this.customUserId,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,user_name:this.userName,user_email:this.userEMail,user_phone:this.userPhone,user_profile_image:this.userProfileImage,user_address_line1:this.userAddressLine1,user_address_line2:this.userAddressLine2,user_city:this.userCity,user_state:this.userState,user_country:this.userCountry,user_zipcode:this.userZipcode,viewer_client_version:this.SDKVersion,custom_user_email:this.userEMail,custom_content_type:this.customContentType,custom_video_duration_millis:this.customVideoDurationMillis,custom_encoding_variant:this.customEncodingVariant,custom_video_language:this.customVideoLanguage,custom_video_id:this.customVideoId,custom_workspace_id:this.customWorkspaceId,custom_video_series:this.customVideoSeries,custom_video_producer:this.customVideoProducer,custom_video_title:this.customVideoTitle,custom_video_variant_name:this.customVideoVariantName,custom_video_variant:this.customVideoVariant},this.config.deviceData){let e=this.config.deviceData;this.sessionData.meta_device_name=e.meta_device_name,this.sessionData.meta_device_manufacturer=e.meta_device_manufacturer,this.sessionData.meta_operating_system_version=e.meta_operating_system_version,this.sessionData.meta_operating_system=e.meta_operating_system,this.sessionData.meta_browser=e.meta_browser,this.sessionData.meta_device_display_dpr=e.meta_device_display_dpr,this.sessionData.meta_browser_version=e.meta_browser_version,this.sessionData.meta_device_category=e.meta_device_category,this.sessionData.meta_device_architecture=e.meta_device_architecture,this.sessionData.meta_device_display_width=e.meta_device_display_width,this.sessionData.meta_device_display_height=e.meta_device_display_height,this.sessionData.meta_device_is_touchscreen=e.meta_device_is_touchscreen,this.sessionData.meta_browser_language=e.meta_browser_language}else this.sessionData.meta_device_name=Z.device.model,this.sessionData.meta_device_manufacturer=Z.device.vendor,this.sessionData.meta_operating_system_version=Z.os.version,this.sessionData.meta_operating_system=Z.os.name,this.sessionData.meta_browser=Z.browser.name,this.sessionData.meta_browser_version=Z.browser.version,this.sessionData.meta_device_category=an(),this.sessionData.meta_device_architecture=Z.cpu.architecture,typeof window<`u`&&(this.sessionData.meta_device_display_dpr=parseInt(String(window.devicePixelRatio),10),this.sessionData.meta_device_display_width=window.screen.width,this.sessionData.meta_device_display_height=window.screen.height,this.sessionData.meta_browser_language=navigator?navigator.language||navigator.userLanguage:``,`ontouchstart`in document.documentElement&&(this.sessionData.meta_device_is_touchscreen=`true`))}setPlayerData(e){if(this.playerData={player_instance_id:this.playerInstanceId,property_id:this.propertyId,session_id:this.sessionId,user_id:this.userId,custom_user_id:this.customUserId,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,player_integration_version:this.customPlayerIntegrationVersion,meta_page_type:this.customPageType,meta_page_url:this.pageURL},this.config.deviceData){let e=this.config.playerData||{};this.playerData.player_preload=e.player_preload,this.playerData.player_autoplay=e.player_autoplay,this.playerData.player_software_version=e.player_software_version,this.playerData.player_integration_version=e.player_integration_version,this.playerData.player_name=e.player_name,this.playerData.player_language_code=e.player_language_code,this.playerData.player_software=e.player_software,this.playerData.meta_page_url=e.meta_page_url,this.playerData.meta_page_type=e.meta_page_type,this.playerData.player_height_pixels=e.player_height_pixels,this.playerData.player_width_pixels=e.player_width_pixels}e&&g.validNumber(e.videoWindowHeight)&&(this.playerData.player_height_pixels=e.videoWindowHeight),e&&g.validNumber(e.videoWindowWidth)&&(this.playerData.player_width_pixels=e.videoWindowWidth),e&&g.validBoolean(e.autoplay)&&(this.playerData.player_autoplay=e.autoplay),e&&g.validBoolean(e.preload)&&(this.playerData.player_preload=e.preload),e&&g.validString(e.version)&&(this.playerData.player_software_version=e.version),e&&g.validString(e.audioLanguage)&&(this.playerData.player_language_code=e.audioLanguage),e&&g.validString(e.playerSoftware)&&(this.playerData.player_software=e.playerSoftware),this.customPlayerName&&(this.playerData.player_software=this.customPlayerName),this.customPlayerVersion&&(this.playerData.player_software_version=this.customPlayerVersion)}},un=class{constructor(e,t){this.sample={},this.currentTime=0,this.isMuted=!1,this.orientation=`undetected`,this.playbackWatchTime=0,this.config=e,this.session=t;try{this.orientation=screen.orientation.type.match(/\w+/)[0],screen.orientation.addEventListener(`change`,()=>{this.orientation=screen.orientation.type.match(/\w+/)[0]})}catch{this.orientation=`undetected`}}setDuration(e){}setPlaybackWatchTime(e){this.playbackWatchTime=e}getPlaybackWatchTime(){return this.playbackWatchTime}setVideoData(e){e&&g.validNumber(e.duration)&&(this.videoDuration=g.calculateTime(e.duration)),e&&g.validString(e.streamType)&&(this.videoSourceType=e.streamType,e.streamType===`dash`&&g.validString(e.mpdUrl)?(this.videoSourceUrl=e.mpdUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e.streamType===`hls`&&g.validString(e.m3u8Url)?(this.videoSourceUrl=e.m3u8Url,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e.streamType===`hls`&&g.validString(e.streamUrl)?(this.videoSourceUrl=e.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e.streamType===`progressive`&&g.validString(e.progUrl)?(this.videoSourceUrl=e.progUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):e?.streamUrl&&(this.videoSourceUrl=e.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname)),e?.streamUrl&&(this.videoSourceUrl=e.streamUrl),e?.sourceHostName&&(this.videoSourceHostname=e.sourceHostName),e?.muted&&(this.isMuted=e.muted),e?.currentVideoData?.height&&g.validNumber(e.currentVideoData.height)&&e.currentVideoData.height>0&&(this.videoHeightPixels=e.currentVideoData.height),e?.currentVideoData?.width&&g.validNumber(e.currentVideoData.width)&&e.currentVideoData.width>0&&(this.videoWidthPixels=e.currentVideoData.width),e?.currentVideoData?.bitrate&&g.validNumber(e.currentVideoData.bitrate)&&e.currentVideoData.bitrate>-1&&(this.videoBitrate=e.currentVideoData.bitrate/1e6),e?.currentVideoData?.audioCodec&&g.validString(e.currentVideoData.audioCodec)&&e.currentVideoData.audioCodec.length>0&&(this.audioCodec=e.currentVideoData.audioCodec),e?.currentVideoData&&g.validString(e.currentVideoData.videoCodec)&&e.currentVideoData.videoCodec.length>0&&(this.videoCodec=e.currentVideoData.videoCodec);let t=this.session,n=0;if(this.videoHeightPixels&&t.playerData?.player_height_pixels&&t.sessionData?.meta_device_display_dpr?n=t.playerData.player_height_pixels*t.sessionData.meta_device_display_dpr/this.videoHeightPixels-1:(this.upscalePercentage=void 0,this.downscalePercentage=void 0),this.videoHeightPixels&&t.playerData?.player_height_pixels&&t.sessionData?.meta_device_display_dpr&&(n>0?(this.upscalePercentage=n*100,this.downscalePercentage=0):n<0?(this.upscalePercentage=0,this.downscalePercentage=n*100*-1):(this.upscalePercentage=0,this.downscalePercentage=0)),this.videoSourceUrl)try{let e=new URL(this.videoSourceUrl);e.hostname===`video.gumlet.io`&&!t.customVideoId&&(t.customVideoId=e.pathname.split(`/`)[2])}catch{}}setPlaybackSettingsFromLoadedEvent(e){e&&g.validNumber(e.currentTime)&&(this.currentTime=g.calculateTime(e.currentTime)),e&&g.validBoolean(e.isFullScreen)&&(this.isFullScreen=e.isFullScreen),e&&g.validBoolean(e.isCasting)&&(this.isCasting=e.isCasting)}setupSample(){let e=this.session;this.sample={property_id:e.propertyId,session_id:e.sessionId,user_id:e.userId,player_instance_id:e.playerInstanceId,playback_id:e.playbackId,from:void 0,to:void 0,playback_time_instant_millis:void 0,bitrate_mbps:this.videoBitrate,error_code:void 0,error:void 0,error_text:void 0,video_cover:void 0,video_cover_reference:void 0,player_remote_played:void 0,video_total_duration_millis:this.videoDuration,video_width_pixels:void 0,video_height_pixels:void 0,video_source_url:void 0,video_source_hostname:void 0,video_source_type:void 0,custom_content_type:e.customContentType,custom_video_duration_millis:e.customVideoDurationMillis,custom_encoding_variant:e.customEncodingVariant,custom_video_language:e.customVideoLanguage,custom_video_id:e.customVideoId,custom_workspace_id:e.customWorkspaceId,custom_video_series:e.customVideoSeries,custom_video_producer:e.customVideoProducer,custom_video_title:e.customVideoTitle,custom_video_variant_name:e.customVideoVariantName,custom_video_variant:e.customVideoVariant,muted:this.isMuted,casting:void 0,fullscreen:this.isFullScreen,video_downscale_percentage:void 0,video_upscale_percentage:void 0,orientation:void 0,orientation_from:void 0,quality:void 0,quality_from:void 0,previous_event:void 0,millis_from_previous_event:void 0,video_codec:void 0,audio_codec:void 0,custom_data_1:e.customData1,custom_data_2:e.customData2,custom_data_3:e.customData3,custom_data_4:e.customData4,custom_data_5:e.customData5,custom_data_6:e.customData6,custom_data_7:e.customData7,custom_data_8:e.customData8,custom_data_9:e.customData9,custom_data_10:e.customData10,custom_event_data:void 0,playback_watch_time:void 0}}getSample(e=null,t={}){let n=this.session,r=this.sample;if(r.event=e,r.event_id=n.config?.getUUID?n.config.getUUID():g.uuidv4(),r.custom_data_1=n.customData1,r.custom_data_2=n.customData2,r.custom_data_3=n.customData3,r.custom_data_4=n.customData4,r.custom_data_5=n.customData5,r.custom_data_6=n.customData6,r.custom_data_7=n.customData7,r.custom_data_8=n.customData8,r.custom_data_9=n.customData9,r.custom_data_10=n.customData10,r.custom_content_type=n.customContentType,r.custom_video_duration_millis=n.customVideoDurationMillis,r.custom_encoding_variant=n.customEncodingVariant,r.custom_video_language=n.customVideoLanguage,r.custom_video_id=n.customVideoId,r.custom_workspace_id=n.customWorkspaceId,r.custom_video_series=n.customVideoSeries,r.custom_video_producer=n.customVideoProducer,r.custom_video_title=n.customVideoTitle,r.custom_video_variant_name=n.customVideoVariantName,r.custom_video_variant=n.customVideoVariant,r.fullscreen=this.isFullScreen,r.muted=this.isMuted,r.video_width_pixels=this.videoWidthPixels,r.video_height_pixels=this.videoHeightPixels,r.video_total_duration_millis=this.videoDuration,r.bitrate=this.videoBitrate,r.audio_codec=this.audioCodec,r.video_codec=this.videoCodec,r.orientation=this.orientation,r.playback_time_instant_millis=this.currentTime,r.video_source_type=this.videoSourceType,r.video_source_url=this.videoSourceUrl,r.video_upscale_percentage=this.upscalePercentage,r.video_downscale_percentage=this.downscalePercentage,r.video_source_hostname=this.videoSourceHostname,r.custom_event_data=void 0,r.playback_watch_time=this.playbackWatchTime,Object.keys(t).forEach(e=>{r[e]=t[e]}),typeof window<`u`&&window.parent!==void 0&&window.navigator)try{typeof window.navigator.getBattery==`function`&&window.navigator.getBattery().then(e=>{e&&(r.battery_level_percentage=e.level*100,r.battery_charging=e.charging)})}catch{}return r}};Re();var dn=class{constructor(e,t){this.licensing=`granted`,this.analyticsCall=e,this.sampleBuilder=t}sendRequest(e,t={}){let n=this.sampleBuilder.getSample(e,t);if(e!==y.END){if(n.playback_time_instant_millis&&n.video_total_duration_millis&&n.playback_time_instant_millis>n.video_total_duration_millis)return}else n.video_total_duration_millis&&(n.playback_time_instant_millis=Math.min(n.playback_time_instant_millis??0,n.video_total_duration_millis));this.analyticsCall.sendRequest(n,g.noOp)}sendRequestAsync(e,t={}){return new Promise((n,r)=>{let i=this.sampleBuilder.getSample(e,t);if(i.playback_time_instant_millis&&i.video_total_duration_millis&&i.playback_time_instant_millis>i.video_total_duration_millis){n(406);return}this.analyticsCall.sendRequestAsync(i).then(e=>n(e)).catch(e=>r(e))})}sendAndClear(e=null,t={}){if(!e){v.log(`event null passed not hitting the ingestion API`);return}this.sampleBuilder.videoDuration&&this.sampleBuilder.videoDuration>864e5||this.sendRequest(e,t)}sendAndClearAsync(e=null,t={}){return new Promise((n,r)=>{if(!e){v.log(`event null passed not hitting the ingestion API`),r(`event null passed not hitting the ingestion API`);return}this.sendRequestAsync(e,t).then(e=>n(e)).catch(e=>r(e))})}sendUnload(){if(this.licensing===`denied`)return;let e=this.sampleBuilder.sample;if(navigator.sendBeacon===void 0){this.sendSynchronous();return}fetch(this.analyticsCall.getAnalyticsServerUrl(),{method:`POST`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}}).then(e=>{e.ok||this.sendSynchronous()}).catch(()=>{this.sendSynchronous()})}sendSynchronous(){this.licensing!==`denied`&&this.analyticsCall.sendRequestSynchronous(this.sampleBuilder.sample,g.noOp)}},fn=c(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define(`StateMachine`,[],r):typeof e==`object`?e.StateMachine=r():n.StateMachine=r()})(e,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=5)})([(function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i;for(n=1;n<arguments.length;n++)for(i in r=arguments[n],r)r.hasOwnProperty(i)&&(e[i]=r[i]);return e}}),(function(e,t,n){"use strict";var r=n(0);e.exports={build:function(e,t){var n,i,a,o=t.plugins;for(n=0,i=o.length;n<i;n++)a=o[n],a.methods&&r(e,a.methods),a.properties&&Object.defineProperties(e,a.properties)},hook:function(e,t,n){var r,i,a,o,s=e.config.plugins,c=[e.context];for(n&&(c=c.concat(n)),r=0,i=s.length;r<i;r++)o=s[r],a=s[r][t],a&&a.apply(o,c)}}}),(function(e,t,n){"use strict";function r(e){if(e.length===0)return e;var t,n,r=e.split(/[_-]/);if(r.length===1&&r[0][0].toLowerCase()===r[0][0])return e;for(n=r[0].toLowerCase(),t=1;t<r.length;t++)n=n+r[t].charAt(0).toUpperCase()+r[t].substring(1).toLowerCase();return n}r.prepended=function(e,t){return t=r(t),e+t[0].toUpperCase()+t.substring(1)},e.exports=r}),(function(e,t,n){"use strict";var r=n(0),i=n(2);function a(e,t){e||={},this.options=e,this.defaults=t.defaults,this.states=[],this.transitions=[],this.map={},this.lifecycle=this.configureLifecycle(),this.init=this.configureInitTransition(e.init),this.data=this.configureData(e.data),this.methods=this.configureMethods(e.methods),this.map[this.defaults.wildcard]={},this.configureTransitions(e.transitions||[]),this.plugins=this.configurePlugins(e.plugins,t.plugin)}r(a.prototype,{addState:function(e){this.map[e]||(this.states.push(e),this.addStateLifecycleNames(e),this.map[e]={})},addStateLifecycleNames:function(e){this.lifecycle.onEnter[e]=i.prepended(`onEnter`,e),this.lifecycle.onLeave[e]=i.prepended(`onLeave`,e),this.lifecycle.on[e]=i.prepended(`on`,e)},addTransition:function(e){this.transitions.indexOf(e)<0&&(this.transitions.push(e),this.addTransitionLifecycleNames(e))},addTransitionLifecycleNames:function(e){this.lifecycle.onBefore[e]=i.prepended(`onBefore`,e),this.lifecycle.onAfter[e]=i.prepended(`onAfter`,e),this.lifecycle.on[e]=i.prepended(`on`,e)},mapTransition:function(e){var t=e.name,n=e.from,r=e.to;return this.addState(n),typeof r!=`function`&&this.addState(r),this.addTransition(t),this.map[n][t]=e,e},configureLifecycle:function(){return{onBefore:{transition:`onBeforeTransition`},onAfter:{transition:`onAfterTransition`},onEnter:{state:`onEnterState`},onLeave:{state:`onLeaveState`},on:{transition:`onTransition`}}},configureInitTransition:function(e){return typeof e==`string`?this.mapTransition(r({},this.defaults.init,{to:e,active:!0})):typeof e==`object`?this.mapTransition(r({},this.defaults.init,e,{active:!0})):(this.addState(this.defaults.init.from),this.defaults.init)},configureData:function(e){return typeof e==`function`?e:typeof e==`object`?function(){return e}:function(){return{}}},configureMethods:function(e){return e||{}},configurePlugins:function(e,t){e||=[];var n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],typeof i==`function`&&(e[n]=i=i()),i.configure&&i.configure(this);return e},configureTransitions:function(e){var t,n,r,i,a,o=this.defaults.wildcard;for(n=0;n<e.length;n++)for(r=e[n],i=Array.isArray(r.from)?r.from:[r.from||o],a=r.to||o,t=0;t<i.length;t++)this.mapTransition({name:r.name,from:i[t],to:a})},transitionFor:function(e,t){var n=this.defaults.wildcard;return this.map[e][t]||this.map[n][t]},transitionsFor:function(e){var t=this.defaults.wildcard;return Object.keys(this.map[e]).concat(Object.keys(this.map[t]))},allStates:function(){return this.states},allTransitions:function(){return this.transitions}}),e.exports=a}),(function(e,t,n){var r=n(0),i=n(6),a=n(1),o=[null,[]];function s(e,t){this.context=e,this.config=t,this.state=t.init.from,this.observers=[e]}r(s.prototype,{init:function(e){if(r(this.context,this.config.data.apply(this.context,e)),a.hook(this,`init`),this.config.init.active)return this.fire(this.config.init.name,[])},is:function(e){return Array.isArray(e)?e.indexOf(this.state)>=0:this.state===e},isPending:function(){return this.pending},can:function(e){return!this.isPending()&&!!this.seek(e)},cannot:function(e){return!this.can(e)},allStates:function(){return this.config.allStates()},allTransitions:function(){return this.config.allTransitions()},transitions:function(){return this.config.transitionsFor(this.state)},seek:function(e,t){var n=this.config.defaults.wildcard,r=this.config.transitionFor(this.state,e),i=r&&r.to;return typeof i==`function`?i.apply(this.context,t):i===n?this.state:i},fire:function(e,t){return this.transit(e,this.state,this.seek(e,t),t)},transit:function(e,t,n,r){var i=this.config.lifecycle,a=this.config.options.observeUnchangedState||t!==n;return n?this.isPending()?this.context.onPendingTransition(e,t,n):(this.config.addState(n),this.beginTransit(),r.unshift({transition:e,from:t,to:n,fsm:this.context}),this.observeEvents([this.observersForEvent(i.onBefore.transition),this.observersForEvent(i.onBefore[e]),a?this.observersForEvent(i.onLeave.state):o,a?this.observersForEvent(i.onLeave[t]):o,this.observersForEvent(i.on.transition),a?[`doTransit`,[this]]:o,a?this.observersForEvent(i.onEnter.state):o,a?this.observersForEvent(i.onEnter[n]):o,a?this.observersForEvent(i.on[n]):o,this.observersForEvent(i.onAfter.transition),this.observersForEvent(i.onAfter[e]),this.observersForEvent(i.on[e])],r)):this.context.onInvalidTransition(e,t,n)},beginTransit:function(){this.pending=!0},endTransit:function(e){return this.pending=!1,e},failTransit:function(e){throw this.pending=!1,e},doTransit:function(e){this.state=e.to},observe:function(e){if(e.length===2){var t={};t[e[0]]=e[1],this.observers.push(t)}else this.observers.push(e[0])},observersForEvent:function(e){for(var t=0,n=this.observers.length,r,i=[];t<n;t++)r=this.observers[t],r[e]&&i.push(r);return[e,i,!0]},observeEvents:function(e,t,n,r){if(e.length===0)return this.endTransit(r===void 0?!0:r);var i=e[0][0],o=e[0][1],s=e[0][2];if(t[0].event=i,i&&s&&i!==n&&a.hook(this,`lifecycle`,t),o.length===0)return e.shift(),this.observeEvents(e,t,i,r);var c=o.shift(),l=c[i].apply(c,t);return l&&typeof l.then==`function`?l.then(this.observeEvents.bind(this,e,t,i)).catch(this.failTransit.bind(this)):l===!1?this.endTransit(!1):this.observeEvents(e,t,i,l)},onInvalidTransition:function(e,t,n){throw new i(`transition is invalid in current state`,e,t,n,this.state)},onPendingTransition:function(e,t,n){throw new i(`transition is invalid while previous transition is still in progress`,e,t,n,this.state)}}),e.exports=s}),(function(e,t,n){"use strict";var r=n(0),i=n(2),a=n(1),o=n(3),s=n(4),c={is:function(e){return this._fsm.is(e)},can:function(e){return this._fsm.can(e)},cannot:function(e){return this._fsm.cannot(e)},observe:function(){return this._fsm.observe(arguments)},transitions:function(){return this._fsm.transitions()},allTransitions:function(){return this._fsm.allTransitions()},allStates:function(){return this._fsm.allStates()},onInvalidTransition:function(e,t,n){return this._fsm.onInvalidTransition(e,t,n)},onPendingTransition:function(e,t,n){return this._fsm.onPendingTransition(e,t,n)}},l={state:{configurable:!1,enumerable:!0,get:function(){return this._fsm.state},set:function(e){throw Error(`use transitions to change state`)}}};function u(e){return f(this||{},e)}function d(){var e,t;typeof arguments[0]==`function`?(e=arguments[0],t=arguments[1]||{}):(e=function(){this._fsm.apply(this,arguments)},t=arguments[0]||{});var n=new o(t,u);return p(e.prototype,n),e.prototype._fsm.config=n,e}function f(e,t){return p(e,new o(t,u)),e._fsm(),e}function p(e,t){if(typeof e!=`object`||Array.isArray(e))throw Error(`StateMachine can only be applied to objects`);a.build(e,t),Object.defineProperties(e,l),r(e,c),r(e,t.methods),t.allTransitions().forEach(function(t){e[i(t)]=function(){return this._fsm.fire(t,[].slice.call(arguments))}}),e._fsm=function(){this._fsm=new s(this,t),this._fsm.init(arguments)}}u.version=`3.0.1`,u.factory=d,u.apply=f,u.defaults={wildcard:`*`,init:{name:`init`,from:`none`}},e.exports=u}),(function(e,t,n){"use strict";e.exports=function(e,t,n,r,i){this.message=e,this.transition=t,this.from=n,this.to=r,this.current=i}})])})})),pn=l({GumletStateMachine:()=>hn}),mn,hn,gn=s((()=>{mn=d(fn(),1),Re(),_(),hn=class{constructor(e,t={}){this.previousRecordTime=0,this.playbackWatchTime=0,this.lastPlayHeadDuration=0,this.onEnterStateTimestamp=0,this.heartbeatTimestamp=0,this.seekStartedAt=null,this.seekedFrom=0,this.seekedTimestamp=0,this.pausedAtPlayheadMs=0,this.lastPreJumpPlayheadSec=null,this.playTimeStamp=null,this.startupBufferingPending=!1,this.pendingErrorRecovery_=!1,this.States={SETUP:`SETUP`,STARTUP:`STARTUP`,READY:`READY`,PLAYING:`PLAYING`,REBUFFERING:`REBUFFERING`,PAUSE:`PAUSE`,PAUSED_SEEKING:`PAUSED_SEEKING`,END:`END`,ERROR:`ERROR`,CASTING:`CASTING`},this.callbacks=e,this.opts=t,this.createStateMachine()}callEvent(e,t,n){this.fsm.can(e)?this.fsm[e](n,t):v.log(`Ignored Event: ${e}`)}updateMetadata(e){this.callbacks.updateSample(e)}allStates(){return Object.values(this.States)}createStateMachine(){let e=this,t=this.States,n=this.opts,r=[p.PLAY,p.PAUSE,p.SEEK,p.SEEKED,p.PLAYBACK_PLAYING,p.PLAYBACK_FINISHED,p.READY,p.SCREEN_RESIZE,p.END,p.ERROR,p.NON_FATAL_ERROR,p.UN_MUTE,p.MUTE];this.fsm=new mn.default({init:t.SETUP,transitions:[{name:p.TIMECHANGED,from:t.SETUP,to:t.SETUP},{name:p.READY,from:[t.SETUP,t.ERROR],to:t.READY},{name:p.SOURCE_LOADED,from:t.SETUP,to:t.SETUP},{name:p.PLAY,from:t.READY,to:t.STARTUP},{name:p.SOURCE_LOADED,from:t.READY,to:t.READY},{name:p.SEEK,from:t.READY,to:t.READY},{name:p.SEEKED,from:t.READY,to:t.READY},{name:p.MUTE,from:t.READY,to:t.READY},{name:p.UN_MUTE,from:t.READY,to:t.READY},{name:p.VIDEO_CHANGE,from:t.READY,to:t.READY},{name:p.AUDIO_CHANGE,from:t.READY,to:t.READY},{name:p.TIMECHANGED,from:t.STARTUP,to:t.PLAYING},{name:p.START_BUFFERING,from:t.STARTUP,to:t.STARTUP},{name:p.END_BUFFERING,from:t.STARTUP,to:t.STARTUP},{name:p.VIDEO_CHANGE,from:t.STARTUP,to:t.STARTUP},{name:p.AUDIO_CHANGE,from:t.STARTUP,to:t.STARTUP},{name:p.SEEK,from:t.STARTUP,to:t.STARTUP},{name:p.SEEKED,from:t.STARTUP,to:t.STARTUP},{name:p.SOURCE_LOADED,from:t.STARTUP,to:t.STARTUP},{name:p.END,from:t.STARTUP,to:t.END},{name:p.TIMECHANGED,from:t.PLAYING,to:t.PLAYING},{name:p.END_BUFFERING,from:t.PLAYING,to:t.PLAYING},{name:p.SEEK,from:t.PLAYING,to:t.PLAYING},{name:p.SEEKED,from:t.PLAYING,to:t.PLAYING},{name:p.SOURCE_LOADED,from:t.PLAYING,to:t.PLAYING},{name:p.VIDEO_CHANGE,from:t.PLAYING,to:t.PLAYING},{name:p.AUDIO_CHANGE,from:t.PLAYING,to:t.PLAYING},{name:p.MUTE,from:t.PLAYING,to:t.PLAYING},{name:p.UN_MUTE,from:t.PLAYING,to:t.PLAYING},{name:p.PAUSE,from:t.PLAYING,to:t.PAUSE},{name:p.START_BUFFERING,from:t.PLAYING,to:t.REBUFFERING},{name:p.END,from:t.PLAYING,to:t.END},{name:p.START_BUFFERING,from:t.REBUFFERING,to:t.REBUFFERING},{name:p.VIDEO_CHANGE,from:t.REBUFFERING,to:t.REBUFFERING},{name:p.AUDIO_CHANGE,from:t.REBUFFERING,to:t.REBUFFERING},{name:p.PLAY,from:t.REBUFFERING,to:t.PLAYING},{name:p.TIMECHANGED,from:t.REBUFFERING,to:t.PLAYING},{name:p.SEEKED,from:t.REBUFFERING,to:t.PLAYING},{name:p.PAUSE,from:t.REBUFFERING,to:t.PAUSE},{name:p.END,from:t.REBUFFERING,to:t.END},{name:p.TIMECHANGED,from:t.PAUSE,to:t.PAUSE},{name:p.SEEKED,from:t.PAUSE,to:t.PAUSE},{name:p.VIDEO_CHANGE,from:t.PAUSE,to:t.PAUSE},{name:p.AUDIO_CHANGE,from:t.PAUSE,to:t.PAUSE},{name:p.MUTE,from:t.PAUSE,to:t.PAUSE},{name:p.UN_MUTE,from:t.PAUSE,to:t.PAUSE},{name:p.PLAY,from:t.PAUSE,to:t.PLAYING},{name:p.SEEK,from:t.PAUSE,to:t.PAUSED_SEEKING},{name:p.END,from:t.PAUSE,to:t.END},{name:p.SEEK,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.AUDIO_CHANGE,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.VIDEO_CHANGE,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.START_BUFFERING,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.END_BUFFERING,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.PLAY,from:t.PAUSED_SEEKING,to:t.PAUSED_SEEKING},{name:p.SEEKED,from:t.PAUSED_SEEKING,to:t.PAUSE},{name:p.TIMECHANGED,from:t.PAUSED_SEEKING,to:t.PLAYING},{name:p.PAUSE,from:t.PAUSED_SEEKING,to:t.PAUSE},{name:p.END,from:t.PAUSED_SEEKING,to:t.END},{name:p.SEEK,from:t.END,to:t.END},{name:p.SEEKED,from:t.END,to:t.END},{name:p.TIMECHANGED,from:t.END,to:t.END},{name:p.END_BUFFERING,from:t.END,to:t.END},{name:p.START_BUFFERING,from:t.END,to:t.END},{name:p.END,from:t.END,to:t.END},{name:p.PLAY,from:t.END,to:t.PLAYING},{name:p.ERROR,from:this.allStates(),to:t.ERROR},{name:p.PAUSE,from:t.ERROR,to:t.ERROR},{name:p.PLAY,from:t.ERROR,to:t.PLAYING},{name:p.TIMECHANGED,from:t.ERROR,to:t.PLAYING},{name:p.SOURCE_LOADED,from:t.ERROR,to:t.ERROR},{name:p.METADATA_LOADED,from:t.ERROR,to:t.ERROR},{name:p.START_BUFFERING,from:t.ERROR,to:t.REBUFFERING},{name:p.SEEK,from:t.ERROR,to:t.ERROR},{name:p.SEEKED,from:t.ERROR,to:t.ERROR},{name:p.MUTE,from:t.ERROR,to:t.ERROR},{name:p.UN_MUTE,from:t.ERROR,to:t.ERROR},{name:p.VIDEO_CHANGE,from:t.ERROR,to:t.ERROR},{name:p.AUDIO_CHANGE,from:t.ERROR,to:t.ERROR},{name:p.END_BUFFERING,from:t.ERROR,to:t.ERROR},{name:p.END,from:t.ERROR,to:t.END},...this.allStates().map(e=>({name:p.NON_FATAL_ERROR,from:e,to:e})),{name:p.UNLOAD,from:this.allStates(),to:t.END},{name:p.START_CAST,from:[t.READY,t.PAUSE],to:t.CASTING},{name:p.PAUSE,from:t.CASTING,to:t.CASTING},{name:p.PLAY,from:t.CASTING,to:t.CASTING},{name:p.TIMECHANGED,from:t.CASTING,to:t.CASTING},{name:p.MUTE,from:t.CASTING,to:t.CASTING},{name:p.SEEK,from:t.CASTING,to:t.CASTING},{name:p.SEEKED,from:t.CASTING,to:t.CASTING},{name:p.END_CAST,from:t.CASTING,to:t.READY}],methods:{onBeforeTransition(n,i,a){if(e.callbacks.playbackWatchTime(e.playbackWatchTime),n.transition===p.SEEK&&(n.from===t.PLAYING||n.from===t.CASTING)&&e.seekStartedAt===null&&(e.seekedFrom=Math.round(e.previousRecordTime*1e3)),n.transition===p.SEEK&&n.from===t.PAUSE&&(e.seekedFrom=e.pausedAtPlayheadMs),n.transition===p.PAUSE&&n.from!==t.PAUSED_SEEKING){let t=a?.currentTime;if(typeof t==`number`)if(e.lastPreJumpPlayheadSec!=null)e.pausedAtPlayheadMs=Math.round(e.lastPreJumpPlayheadSec*1e3),e.lastPreJumpPlayheadSec=null;else{let n=e.previousRecordTime;e.pausedAtPlayheadMs=Math.abs(t-n)>=5?Math.round(n*1e3):Math.round(t*1e3)}}r.includes(n.transition)&&(n.transition===p.PLAYBACK_FINISHED&&(e.previousRecordTime=0),a&&(e.previousRecordTime=a.currentTime)),a&&n.transition!==p.SOURCE_LOADED&&(e.lastPlayHeadDuration=a.currentTime*1e3)},onLeaveState(n,r,i){if(!r)return;let a=r-e.onEnterStateTimestamp;i&&n.to!==t.PAUSED_SEEKING&&(v.log(`Setting video time end to ${i.currentTime}, going to ${n.to}`),e.callbacks.setVideoTimeEndFromEvent(i));let o=n.from.toLowerCase();if(n.from===t.PAUSED_SEEKING){let a=r-(e.seekStartedAt??r);e.seekStartedAt=null,e.callbacks.playback_seeked(e.seekedFrom,i.currentTime*1e3,a,n.to),e.callbacks.heartbeat(r,t.PAUSE.toLowerCase(),i),v.log(`Seek was ${a}ms`)}else n.transition===p.UNLOAD&&n.from===t.PLAYING?e.callbacks.playingAndBye(a,o,i):n.from===t.PAUSE&&n.to!==t.PAUSED_SEEKING&&n.to!==t.PLAYING&&(e.callbacks.setVideoTimeStartFromEvent(n.transition),e.callbacks.pause(a,o,i),e.callbacks.heartbeat(r,o,i))},onAfterTransition(t,n,r){e.callbacks.resetSessionExpiry(),t.transition===p.VIDEO_CHANGE?e.callbacks.videoChange(r):t.transition===p.AUDIO_CHANGE?e.callbacks.audioChange(r):t.transition===p.MUTE?(v.log(`Setting sample to muted`),e.callbacks.mute(n,r)):t.transition===p.UN_MUTE&&(v.log(`Setting sample to unmuted`),e.callbacks.unMute(n,r))},onEnterState(i,a,o){i.to===t.ERROR&&(e.pendingErrorRecovery_=!1),e.callbacks.playbackWatchTime(e.playbackWatchTime),r.includes(i.transition)&&o&&(e.previousRecordTime=o.currentTime),i.transition!==p.NON_FATAL_ERROR&&(i.from===`none`&&n.starttime?e.onEnterStateTimestamp=n.starttime:e.onEnterStateTimestamp=a||Date.now()),(i.to===t.PLAYING&&(i.from===t.STARTUP||i.from===t.PAUSE||i.from===t.REBUFFERING||i.from===t.PAUSED_SEEKING||i.from===t.ERROR)||i.from===`none`&&i.to===t.SETUP)&&(e.heartbeatTimestamp=i.from===`none`&&n.starttime?n.starttime:a||Date.now()),o&&i.to!==t.PAUSED_SEEKING&&e.callbacks.setVideoTimeStartFromEvent(o)},onEnterSetup(r,i,a){r.from===`none`&&e.callbacks.setup(i,t.SETUP,a,n)},onEnterReady(n,r,i){n.from===t.SETUP&&e.callbacks.ready(r,t.READY,i)},onEnterStartup(n,r,i){n.transition===p.PLAY&&(e.playTimeStamp=new Date,e.callbacks.first_play(r,t.STARTUP,i))},onEnterPlaying(n,r,i){n.transition===p.PLAY&&n.from===t.PAUSE?(e.callbacks.play(r,t.PLAYING,i),e.callbacks.playing(r,t.PLAYING,i),e.callbacks.heartbeat(r,t.PLAYING,i)):n.from===t.STARTUP?(e.startupBufferingPending&&(e.startupBufferingPending=!1,e.callbacks.start_rebuffer(r,t.REBUFFERING,i),e.callbacks.end_rebuffer(r,t.REBUFFERING,i)),e.callbacks.playing(r,t.PLAYING,i),e.callbacks.playback_started(i)):n.from===t.REBUFFERING?(e.callbacks.end_rebuffer(r,t.REBUFFERING,i),e.pendingErrorRecovery_&&(e.pendingErrorRecovery_=!1,e.callbacks.error_recovered(r,t.ERROR,i))):n.from===t.ERROR&&e.callbacks.error_recovered(r,t.ERROR,i)},onEnterPause(n,r,i){n.from===t.PAUSED_SEEKING&&i&&typeof i.currentTime==`number`&&(e.pausedAtPlayheadMs=i.currentTime*1e3),n.from===t.PLAYING&&(e.callbacks.pause(r,t.PAUSE,i),e.callbacks.heartbeat(r,t.PAUSE,i))},onEnterRebuffering(n,r,i){n.transition===p.START_BUFFERING&&(e.callbacks.start_rebuffer(r,t.REBUFFERING,i),n.from===t.ERROR&&(e.pendingErrorRecovery_=!0))},onBeforeStartBuffering(n,r,i){n.from===t.STARTUP&&(e.startupBufferingPending=!0)},onEnterEnd(n,r,i){e.callbacks.end(r,t.END,i),e.callbacks.heartbeat(r,t.END,i)},onBeforeSourceLoaded(n,r,i){let a=n.from===t.PLAYING&&e.playTimeStamp?Date.now()-e.playTimeStamp.getTime():null;e.callbacks.loaded(r,t.READY,i,a)},onSeek(t,n,r){r&&(e.previousRecordTime=r.currentTime),e.callbacks.playbackWatchTime(e.playbackWatchTime),e.seekStartedAt=e.seekStartedAt??n},onSeeked(n,r,i){if(i&&(e.previousRecordTime=i.currentTime),e.callbacks.playbackWatchTime(e.playbackWatchTime),e.seekedTimestamp=r,i&&(n.from===t.PLAYING&&n.to===t.PLAYING||n.from===t.CASTING&&n.to===t.CASTING)){let t=e.seekStartedAt==null?0:r-e.seekStartedAt;e.callbacks.playback_seeked(e.seekedFrom,i.currentTime*1e3,t,null),v.log(`Seek was ${t}ms`)}e.seekStartedAt=null},onTimechanged(t,n,r){e.callbacks.playbackWatchTime(e.playbackWatchTime);let i=r.currentTime-e.previousRecordTime;i>0&&i<5?(e.playbackWatchTime+=Math.round(i*1e3),e.previousRecordTime=r.currentTime,e.lastPreJumpPlayheadSec=null):(e.lastPreJumpPlayheadSec=e.previousRecordTime,e.previousRecordTime=r.currentTime);let a=n-e.heartbeatTimestamp;a>1e4&&(e.callbacks.setVideoTimeEndFromEvent(r),v.log(`Sending heartbeat`),e.callbacks.heartbeat(a,t.from.toLowerCase(),r),e.heartbeatTimestamp=n,e.callbacks.setVideoTimeStartFromEvent(r),e.callbacks.resetSessionExpiry())},onPlayerError(t,n,r){e.callbacks.error(r)},onPlayerNonFatalError(t,n,r){e.callbacks.error(r)}}})}static pad(e,t){return(e+Array(t).join(` `)).slice(0,t)}}}));function _n(e){return e=e.toLowerCase(),e.endsWith(`.m3u8`)?bn:e.endsWith(`.mp4`)||e.endsWith(`.m4v`)||e.endsWith(`.m4a`)?vn:e.endsWith(`.webm`)?yn:e.endsWith(`.mpd`)?xn:null}var vn,yn,bn,xn,Sn,Cn=s((()=>{vn=`video/mp4`,yn=`video/webm`,bn=`application/x-mpegURL`,xn=`application/dash+xml`,Sn={MP4:vn,WEBM:yn,HLS:bn,DASH:xn}}));function wn(e){return kn[e]}var Tn,En,Dn,On,kn,An=s((()=>{Cn(),{MP4:Tn,WEBM:En,HLS:Dn,DASH:On}=Sn,kn={[Tn]:`mp4`,[En]:`webm`,[Dn]:`hls`,[On]:`dash`}})),jn=l({HTML5Adapter:()=>Nn}),Mn,Nn,Pn=s((()=>{m(),Cn(),An(),Mn=1e3,Nn=class{constructor(e,t,n,r=null){this.lastKnownCurrentTime_=0,this.sourceSwitching_=!1,this.eventCallback=t,this.playerSoftwareName=r??h.HTML,this.stateMachine=n,this.mediaEl=e,this.mediaElEventHandlers=[],this.analyticsBitrate_=-1,this.audioCodec_=``,this.videoCodec_=``,this.bufferingTimeout_=null,this.isBuffering_=!1,this.isLive_=!1,this.isPaused_=!1,this.previousMediaTime_=null,this.needsReadyEvent_=!0,this.needsFirstPlayIntent_=!0,this.mediaElementSet_=!1,this.playbackReadySet_=!1,e&&this.setMediaElement()}getCurrentQualityLevelInfo(){return null}isLive(){return!1}getMIMEType(){let e=this.mediaEl;if(!e)return null;let t=e.src||e.querySelector(`source`)?.src||null;return t?_n(t):null}getStreamType(){return wn(this.getMIMEType()??``)}getPlayerVersion(){return null}getStreamURL(){let e=this.mediaEl;return e&&(e.src||e.querySelector(`source`)?.src)||null}destroy(){this.mediaEl&&this.unregisterMediaElement()}setMediaElement(e=null){if(e&&this.mediaEl&&(this.unregisterMediaElement(),this.mediaElementSet_=!1),e&&(this.mediaEl=e),!this.mediaEl)throw Error(`No media element owned`);if(this.mediaElementSet_)throw Error(`Media element already set (only call this once)`);this.mediaElementSet_=!0,this.registerMediaElement(),this.onMaybeReady()}resetMedia(){this.mediaEl=null,this.mediaElEventHandlers=[]}registerMediaElement(){let e=this.mediaEl;e&&(this.listenToMediaElementEvent(`loadedmetadata`,()=>{if(e.readyState!==1)return;this.checkQualityLevelAttributes(!0);let{duration:t,autoplay:n,videoWidth:r,videoHeight:i,muted:a}=e,o={type:`html5`,isLive:this.isLive(),version:this.getPlayerVersion()??`html5`,streamType:this.getStreamType(),streamUrl:this.getStreamURL(),duration:t,autoplay:n,currentVideoData:{height:i,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},videoWindowWidth:e.clientWidth,videoWindowHeight:e.clientHeight,muted:a};this.needsFirstPlayIntent_||this.eventCallback(p.METADATA_LOADED,o)}),this.listenToMediaElementEvent(`canplay`,()=>{if(this.playbackReadySet_)return;this.playbackReadySet_=!0;let{duration:t,autoplay:n,videoWidth:r,videoHeight:i,muted:a}=e,o={type:`html5`,isLive:this.isLive(),version:this.getPlayerVersion()??`html5`,streamType:this.getStreamType(),streamUrl:this.getStreamURL(),duration:t,autoplay:n,playerSoftware:this.playerSoftwareName,videoWindowWidth:e.clientWidth,videoWindowHeight:e.clientHeight,currentVideoData:{height:i,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},muted:a};this.eventCallback(p.SOURCE_LOADED,o)}),this.listenToMediaElementEvent(`emptied`,()=>{this.sourceSwitching_=!0}),this.listenToMediaElementEvent(`play`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.needsFirstPlayIntent_=!1,this.eventCallback(p.PLAY,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t})}),this.listenToMediaElementEvent(`pause`,()=>{this.onPaused()}),this.listenToMediaElementEvent(`playing`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.isPaused_=!1,!this.needsFirstPlayIntent_&&(this.sourceSwitching_||this.eventCallback(p.TIMECHANGED,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t}))}),this.listenToMediaElementEvent(`error`,()=>{let{error:t}=e;this.eventCallback(p.ERROR,{currentTime:this.lastKnownCurrentTime_,code:t?.code,message:t?.message})}),this.listenToMediaElementEvent(`volumechange`,()=>{let{muted:t,currentTime:n}=e;t?this.eventCallback(p.MUTE,{currentTime:n}):this.eventCallback(p.UN_MUTE,{currentTime:n})}),this.listenToMediaElementEvent(`seeking`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.eventCallback(p.SEEK,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t,droppedFrames:0})}),this.listenToMediaElementEvent(`seeked`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.bufferingTimeout_&&clearTimeout(this.bufferingTimeout_),this.eventCallback(p.SEEKED,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t,droppedFrames:0})}),this.listenToMediaElementEvent(`ended`,()=>{let{currentTime:t,videoWidth:n,videoHeight:r}=e;this.eventCallback(p.END,{currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t})}),this.listenToMediaElementEvent(`timeupdate`,()=>{let{currentTime:t,videoHeight:n,videoWidth:r}=e;this.isBuffering_=!1,t>0&&(this.lastKnownCurrentTime_=t,this.sourceSwitching_=!1),!this.needsFirstPlayIntent_&&(!this.isPaused_&&!this.sourceSwitching_&&this.eventCallback(p.TIMECHANGED,{currentVideoData:{height:n,width:r,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:t}),this.checkQualityLevelAttributes(),this.checkPlayheadProgress(),this.previousMediaTime_=t)}),this.listenToMediaElementEvent(`stalled`,()=>{}),this.listenToMediaElementEvent(`waiting`,()=>{this.onBuffering()}))}listenToMediaElementEvent(e,t){if(!this.mediaEl)throw Error(`No media attached`);let n=t.bind(this);this.mediaElEventHandlers.push({event:e,handler:n}),this.mediaEl.addEventListener(e,n,!1)}unregisterMediaElement(){if(!this.mediaEl)throw Error(`No media attached`);for(let{event:e,handler:t}of this.mediaElEventHandlers)this.mediaEl.removeEventListener(e,t,!1);this.resetMedia()}onMaybeReady(){if(!this.needsReadyEvent_||!this.mediaEl)return;this.needsReadyEvent_=!1;let{duration:e,autoplay:t,videoWidth:n,videoHeight:r,muted:i,preload:a}=this.mediaEl,o=this.getStreamURL(),s=a!==`none`,c={type:`html5`,isLive:this.isLive(),version:this.getPlayerVersion()??`html5`,streamType:this.getStreamType(),streamUrl:o,duration:e,autoplay:t,preload:s,playerSoftware:this.playerSoftwareName,currentVideoData:{height:r,width:n,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},videoWindowWidth:this.mediaEl.clientWidth,videoWindowHeight:this.mediaEl.clientHeight,muted:i};this.stateMachine.updateMetadata(c),this.eventCallback(p.READY,c)}onBuffering(){let{currentTime:e}=this.mediaEl;this.isBuffering_||this.isPaused_||(this.eventCallback(p.START_BUFFERING,{currentTime:e}),this.isBuffering_=!0)}onPaused(){if(this.isPaused_)return;if(this.sourceSwitching_){this.isPaused_=!0;return}let{videoHeight:e,videoWidth:t}=this.mediaEl,n=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:this.mediaEl.currentTime??0;this.eventCallback(p.PAUSE,{currentVideoData:{height:e,width:t,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:n}),this.isPaused_=!0}checkPlayheadProgress(){let e=this.mediaEl;e.paused&&this.onPaused(),this.bufferingTimeout_&&clearTimeout(this.bufferingTimeout_),this.bufferingTimeout_=setTimeout(()=>{(e.paused||e.ended)&&!this.isBuffering_||e.currentTime-(this.previousMediaTime_??e.currentTime)<Mn&&this.onBuffering()},Mn)}checkQualityLevelAttributes(e=!1){let t=this.mediaEl,n=this.getCurrentQualityLevelInfo();if(!n)return;let{bitrate:r,width:i,height:a,videoCodec:o,audioCodec:s}=n,c=this.isLive();if(c!==this.isLive_&&(this.isLive_=c,e||this.stateMachine.updateMetadata({isLive:c})),this.audioCodec_=s??``,this.videoCodec_=o??``,this.analyticsBitrate_!==r){let n={width:i,height:a,bitrate:r,videoCodec:o,audioCodec:s,currentTime:t.currentTime};e||this.eventCallback(p.VIDEO_CHANGE,n),this.analyticsBitrate_=r??-1}}}})),Fn=l({HlsjsAdapter:()=>In}),In,Ln=s((()=>{m(),Pn(),Cn(),ee(),In=class extends Nn{constructor(e,t,n){super(null,t,n,h.HLSJS),this.hls=e,this.playerSoftwareName=h.HLSJS,this.boundOnMediaAttaching=this.onMediaAttaching.bind(this),this.boundOnMediaDetaching=this.onMediaDetaching.bind(this),this.boundOnManifestLoading=this.onManifestLoading.bind(this),this.hlsErrorHandler=(e,t)=>this.onError(t),this.resetMedia(),this.registerHlsEvents()}getCurrentQualityLevelInfo(){let e=this.hls,t=e.levels?.[e.currentLevel];if(!t)return null;let n=t.attrs,r=n.BANDWIDTH?parseInt(n.BANDWIDTH,10):0,i=n.RESOLUTION?.width?parseInt(n.RESOLUTION.width,10):0,a=n.RESOLUTION?.height?parseInt(n.RESOLUTION.height,10):0,o=null,s=null;if(n.CODECS){let e=n.CODECS.split(`,`);s=e[0]??null,o=e.length>1?e[1]:null}return{bitrate:r,width:i,height:a,audioCodec:o,videoCodec:s}}isLive(){let e=this.hls;return e.currentLevel<0?!1:!!(e.levels?.[e.currentLevel])?.details?.live}getPlayerVersion(){return Hls.version}getMIMEType(){return Sn.HLS}getStreamURL(){return this.hls.url??null}destroy(){let e=this.hls;e.off(Hls.Events.MEDIA_ATTACHING,this.boundOnMediaAttaching),e.off(Hls.Events.MEDIA_DETACHING,this.boundOnMediaDetaching),e.off(Hls.Events.MANIFEST_LOADING,this.boundOnManifestLoading),e.off(Hls.Events.ERROR,this.hlsErrorHandler),super.destroy()}registerHlsEvents(){let e=this.hls;if(!Hls)throw Error(`Hls.js is not installed (must be loaded before analytics module)`);e.on(Hls.Events.MEDIA_ATTACHING,this.boundOnMediaAttaching),e.on(Hls.Events.MEDIA_DETACHING,this.boundOnMediaDetaching),e.on(Hls.Events.MANIFEST_LOADING,this.boundOnManifestLoading),e.on(Hls.Events.ERROR,this.hlsErrorHandler),e.media&&this.onMediaAttaching(),e.url&&this.onManifestLoading()}onMediaAttaching(){this.mediaEl||(this.mediaEl=this.hls.media,this.registerMediaElement(),this.onMaybeReady())}onMediaDetaching(){this.unregisterMediaElement()}onManifestLoading(){this.onMaybeReady()}onError(e){let t=e,n=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:this.mediaEl?.currentTime??0;t?.fatal===!0&&t?.details===`internalException`&&console.error(e),this.eventCallback(p.ERROR,{currentTime:n,code:t?.type,message:JSON.stringify({details:t?.details,fatal:t?.fatal,type:t?.type,fragment_url:t?.url,error:{message:t?.error?.message,stack:t?.error?.stack},extra:{networkDetails:{status:t?.networkDetails?.status,statusText:t?.networkDetails?.statusText,url:t?.networkDetails?.url,responseHeaders:t?.networkDetails?.responseHeaders,responseText:t?.networkDetails?.responseText,responseURL:t?.networkDetails?.responseURL,data:t?.networkDetails?.data}}})})}}})),Rn=l({ShakaAdapter:()=>zn}),zn,Bn=s((()=>{Pn(),Cn(),ee(),m(),zn=class extends Nn{constructor(e,t,n,r){if(super(r,t,n,h.SHAKA),typeof shaka>`u`)throw Error("`shaka` lib is not installed (must be loaded before analytics module)");this.shakaPlayer=e,this.playerSoftwareName=h.SHAKA,this.shakaErrorHandler=e=>{this.onGumletShakaError(e,this.eventCallback,this.mediaEl).catch(()=>{let e=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:this.mediaEl?.currentTime??0;this.eventCallback(p.ERROR,{currentTime:e,code:`error_handler_exception`,message:`Shaka error handler threw before firing callback`})})},this.registerShakaEvents()}getPlayerVersion(){return shaka.Player.version}isLive(){return this.shakaPlayer?.isLive()??!1}getMIMEType(){return this.shakaPlayer?.getManifestType?.()===`HLS`?Sn.HLS:Sn.DASH}getStreamURL(){return this.shakaPlayer?.getAssetUri()??null}getCurrentQualityLevelInfo(){let e=this.shakaPlayer.getVariantTracks().filter(e=>e.active).find(e=>e.videoCodec!==null||e.videoId!==null);return e?{bitrate:e.videoBandwidth??e.bandwidth??null,width:e.width??null,height:e.height??null,videoCodec:e.videoCodec??null,audioCodec:e.audioCodec??null}:null}destroy(){this.shakaPlayer.removeEventListener(`error`,this.shakaErrorHandler),super.destroy()}registerShakaEvents(){if(!this.shakaPlayer)throw Error(`Shaka player object is not defined`);this.shakaPlayer.addEventListener(`error`,this.shakaErrorHandler)}getEnumNameFromValue(e,t){if(!e||t==null)return null;for(let[n,r]of Object.entries(e))if(r===t)return n;return null}getShakaErrorCodeName(e){let t=globalThis.shaka?.util?.Error?.Code;return this.getEnumNameFromValue(t,e)}getShakaErrorCategoryName(e){let t=globalThis.shaka?.util?.Error?.Category;return this.getEnumNameFromValue(t,e)}getBufferedRanges(e){if(!e?.buffered)return[];let t=[];for(let n=0;n<e.buffered.length;n+=1)t.push({start:e.buffered.start(n),end:e.buffered.end(n)});return t}getPlaybackQuality(e){if(!e?.getVideoPlaybackQuality)return null;let t=e.getVideoPlaybackQuality();return{droppedVideoFrames:t.droppedVideoFrames,totalVideoFrames:t.totalVideoFrames,corruptedVideoFrames:t.corruptedVideoFrames}}getMediaElementState(e,t){return{readyState:e?.readyState??null,networkState:e?.networkState??null,currentSrc:e?.currentSrc??null,currentTime:e?.currentTime??t??null,paused:e?.paused??null,ended:e?.ended??null,seeking:e?.seeking??null,playbackRate:e?.playbackRate??null,muted:e?.muted??null,videoWidth:e?.videoWidth??null,videoHeight:e?.videoHeight??null}}getHtml5MediaError(e){let t=e?.error;return t?{code:t.code??null,message:t?.message??null}:null}getQualityLevelInfoFallback(){let e=this.shakaPlayer.getVariantTracks().find(e=>e.videoCodec!==null||e.videoId!==null);return e?{bitrate:e.videoBandwidth??e.bandwidth??null,width:e.width??null,height:e.height??null,videoCodec:e.videoCodec??null,audioCodec:e.audioCodec??null}:null}getExtraDataHint(e,t){if(!Array.isArray(e))return null;let n={item_count:e.length,item_types:e.map(e=>e===null?`null`:Array.isArray(e)?`array`:typeof e)};return t?.includes(`DECODE`)&&(n.decode_context={first:e[0]??null,second:e[1]??null}),n}async onGumletShakaError(e,t,n){let r=this.lastKnownCurrentTime_>0?this.lastKnownCurrentTime_:n?.currentTime??0,i=e;if(!i.detail){t(p.ERROR,{currentTime:r,code:`not_set_by_shaka`,message:`{}`});return}let a=i.detail,o=[];if(a.data)for(let e of a.data)o.push(e);let s=[],c=null,l=null,u=null;try{let e=[],t=this.shakaPlayer.getVariantTracks();if(t.forEach(t=>{e.push({width:t.width,height:t.height,bitrate:t.videoBandwidth??t.bandwidth,framerate:t.frameRate,contentType:`${t.mimeType}; codecs="${t.videoCodec}"`})}),navigator?.mediaCapabilities?.decodingInfo)for(let t of e)try{let e={type:`media-source`,video:{contentType:t.contentType,width:t.width??0,height:t.height??0,bitrate:t.bitrate??0,framerate:t.framerate??0},keySystemConfiguration:{keySystem:`com.widevine.alpha`,video:{contentType:t.contentType}}},n=await navigator.mediaCapabilities.decodingInfo(e);s.push({...n,keySystemAccess:n.keySystemAccess?.getConfiguration()})}catch{}c=this.getCurrentQualityLevelInfo(),c||(l=this.getQualityLevelInfoFallback()),u={manifest_type:this.shakaPlayer.getManifestType?.()??null,asset_uri:this.shakaPlayer.getAssetUri?.()??null,is_live:this.shakaPlayer.isLive?.()??null,player_version:this.getPlayerVersion(),variant_track_count:t.length}}catch{}let d=!a.severity||a.severity===2?p.ERROR:p.NON_FATAL_ERROR,f=a.category??a.v??null,m=this.getShakaErrorCodeName(a.code),h=this.getShakaErrorCategoryName(f);t(d,{currentTime:r,code:a.code,message:JSON.stringify({category:f,category_name:h,code:a.code,code_name:m,severity:a.severity,handled:a.handled,timestamp:i.timestamp,extra_data:o,extra_data_hint:this.getExtraDataHint(o,m),media_capabilities:s,selected_quality_info:c,selected_quality_info_fallback:l,html5_media_error:this.getHtml5MediaError(n),media_element_state:this.getMediaElementState(n,r),buffered_ranges:this.getBufferedRanges(n),playback_quality:this.getPlaybackQuality(n),shaka_runtime_context:u})})}}}));Re();var Vn=class e{static{this.PAGE_LOAD_TYPE={FOREGROUND:1,BACKGROUND:2}}static{this.LICENSE_CALL_PENDING_TIMEOUT=200}static{this.PAGE_LOAD_TYPE_TIMEOUT=200}static{this.CAST_RECEIVER_CONFIG_MESSAGE=`CAST_RECEIVER_CONFIG_MESSAGE`}constructor(t){this.previousState=void 0,this.previousStateTimeStamp=new Date,this.previousStateMono=0,this.firstPlayTimestamp=0,this.startupTime=0,this.pageLoadType=e.PAGE_LOAD_TYPE.FOREGROUND,this.droppedSampleFrames=0,this.autoplay=void 0,this.isCastClient=!1,this.isCastReceiver=!1,this.isAllowedToSendSamples=!1,this.samplesQueue=[],this.customEventHandler=(e,t)=>{this.sampleBuilder.sample.custom_event_data=JSON.stringify(t),this.sendAnalyticsRequestAndClearValues(e,{custom_event_data:JSON.stringify(t)})},this.customEventHandlerAsync=(e,t)=>new Promise((n,r)=>{let i=JSON.stringify(t);this.sendAnalyticsRequestAndClearValuesAsync(e,{custom_event_data:i}).then(e=>n(e)).catch(e=>r(e))}),this.getCurrentImpressionId=()=>this.sample.impressionId,this.setDroppedFrames=e=>{},this.register=async(e,t={})=>{t.starttime?t.starttime=g.convertEpochTime(t.starttime):t.starttime=g.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(gn(),pn));if(this.analyticsStateMachine=new n(this.stateMachineCallbacks,t),!e){let{HTML5Adapter:e}=await Promise.resolve().then(()=>(Pn(),jn));return this.adapter=new e(this.mediaElement,this.record,this.analyticsStateMachine),this.analyticsStateMachine}if(Ve.isHlsjs(e)){let{HlsjsAdapter:t}=await Promise.resolve().then(()=>(Ln(),Fn));this.adapter=new t(e,this.record,this.analyticsStateMachine)}else if(Ve.isShaka(e)){let{ShakaAdapter:n}=await Promise.resolve().then(()=>(Bn(),Rn));this.adapter=new n(e,this.record,this.analyticsStateMachine,t.mediaElement??null)}else{let{HTML5Adapter:t}=await Promise.resolve().then(()=>(Pn(),jn));this.adapter=new t(e,this.record,this.analyticsStateMachine)}this.adapter||v.error(`Could not detect player.`)},this.registerHLSJSPlayer=async(e,t={})=>{t.starttime?t.starttime=g.convertEpochTime(t.starttime):t.starttime=g.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(gn(),pn));this.analyticsStateMachine=new n(this.stateMachineCallbacks,t);let{HlsjsAdapter:r}=await Promise.resolve().then(()=>(Ln(),Fn));this.adapter=new r(e,this.record,this.analyticsStateMachine)},this.registerShakaPlayer=async(e,t={})=>{t.starttime?t.starttime=g.convertEpochTime(t.starttime):t.starttime=g.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(gn(),pn));this.analyticsStateMachine=new n(this.stateMachineCallbacks,t);let{ShakaAdapter:r}=await Promise.resolve().then(()=>(Bn(),Rn));this.adapter=new r(e,this.record,this.analyticsStateMachine,t.mediaElement)},this.registerHTML5Player=async(e,t={})=>{t.starttime?t.starttime=g.convertEpochTime(t.starttime):t.starttime=g.getCurrentTimestamp();let{GumletStateMachine:n}=await Promise.resolve().then(()=>(gn(),pn));this.analyticsStateMachine=new n(this.stateMachineCallbacks,t);let{HTML5Adapter:r}=await Promise.resolve().then(()=>(Pn(),jn));this.adapter=new r(e,this.record,this.analyticsStateMachine)},this.registerReactNativeVideoPlayer=async e=>{e.starttime?e.starttime=g.convertEpochTime(e.starttime):e.starttime=g.getCurrentTimestamp();let{GumletStateMachine:t}=await Promise.resolve().then(()=>(gn(),pn));return this.analyticsStateMachine=new t(this.stateMachineCallbacks,e),this.analyticsStateMachine},this.record=(e,t)=>{t||={},this.analyticsStateMachine.callEvent(e,t,g.getCurrentTimestamp())},this.config=t,Se(t.disable_analytics_v2!==!0),this.analyticsCall=new Ie,this.castClient=new He,this.castReceiver=new Ue,this.session=new ln(t),Ae(()=>{let e=this.session.sessionData,t=this.session.playerData;return{...e&&typeof e==`object`?e:{},...t&&typeof t==`object`?t:{}}}),this.sampleBuilder=new un(t,this.session),this.publisher=new dn(this.analyticsCall,this.sampleBuilder),this.init(),this.setupSample(),this.setupStateMachineCallbacks(),typeof performance<`u`&&typeof performance.now==`function`?this.previousStateMono=performance.now():this.previousStateMono=this.previousStateTimeStamp.getTime()}init(){if(!this.isCastReceiver&&(this.config.property_id===``||!g.validString(this.config.property_id))){console.error(`Invalid analytics property_id provided`);return}v.setLogging(this.config.debug||!1),this.session.propertyId=this.config.property_id,typeof window<`u`&&window.parent!==void 0?this.session.pageURL=window.location===window.parent.location?document.location.href:document.referrer:this.config.page_url?this.session.pageURL=this.config.page_url:this.session.pageURL=null;let e=!!this.config.test,t=this.config.sessionID||null,n=this.config.userID||null,r=Object.hasOwn(this.config,`sendSessionRequest`)?this.config.sendSessionRequest:!0;this.session.setUserId(e,n),this.session.setSessionId(e,t,r),this.session.setPlayerInstanceId(this.config.getUUID),this.session.setPlaybackId(this.config.getUUID)}setConfigParameters(e=this.config){this.session.setConfigParameters(e)}updateCustomData(e){this.session.updateCustomData(e)}updateCustomUserData(e){this.session.updateCustomUserData(e)}updateCustomVideoData(e){this.session.updateCustomVideoData(e)}updateCustomPlayerData(e){this.session.updateCustomPlayerData(e)}get userId(){return this.session.userId}get sessionId(){return this.session.sessionId}get propertyId(){return this.session.propertyId}get playerData(){return this.session.playerData}get sessionData(){return this.session.sessionData}get playerInitCall(){return this.session.playerInitCall}get isMuted(){return this.sampleBuilder.isMuted}set isMuted(e){this.sampleBuilder.isMuted=e}get sample(){return this.sampleBuilder.sample}setupSample(){this.sampleBuilder.setupSample()}setDuration(e){this.sampleBuilder.setDuration(e)}setVideoData(e){this.sampleBuilder.setVideoData(e)}setPlaybackSettingsFromLoadedEvent(e){this.sampleBuilder.setPlaybackSettingsFromLoadedEvent(e)}setPlaybackWatchTime(e){this.sampleBuilder.setPlaybackWatchTime(e)}getPlaybackWatchTime(){return this.sampleBuilder.getPlaybackWatchTime()}getSample(e=null,t={}){let n=this.sampleBuilder.getSample(e,t);return n.millis_from_previous_event=this.getMillisFromPreviousState(),n.previous_event=this.previousState,n}setPlayerData(e){this.session.setPlayerData(e)}setSessionData(){this.session.setSessionData()}setPlaybackId(){this.session.setPlaybackId(this.config.getUUID)}setUserId(e=!1,t=null){this.session.setUserId(e,t)}setSessionId(e=!1,t=null,n=!0){this.session.setSessionId(e,t,n)}setPlayerInstanceId(){this.session.setPlayerInstanceId(this.config.getUUID)}sendAnalyticsRequest(e,t){this.publisher.sendRequest(e,t)}sendAnalyticsRequestAsync(e,t){return this.publisher.sendRequestAsync(e,t)}sendAnalyticsRequestAndClearValues(e=null,t={}){let n={millis_from_previous_event:this.getMillisFromPreviousState(),previous_event:this.previousState,...t};this.publisher.sendAndClear(e,n)}sendAnalyticsRequestAndClearValuesAsync(e=null,t={}){return this.publisher.sendAndClearAsync(e,t)}sendUnloadRequest(){this.publisher.sendUnload()}sendAnalyticsRequestSynchronous(){this.publisher.sendSynchronous()}getMillisFromPreviousState(){let e;e=typeof performance<`u`&&typeof performance.now==`function`?performance.now()-this.previousStateMono:new Date().getTime()-this.previousStateTimeStamp.getTime();let t=Math.round(e);return t<=0&&this.previousState!==void 0?1:Math.max(0,t)}setState(e=void 0){e&&(this.previousState=e,this.previousStateTimeStamp=new Date,typeof performance<`u`&&typeof performance.now==`function`?this.previousStateMono=performance.now():this.previousStateMono=this.previousStateTimeStamp.getTime())}getDroppedFrames(e){if(e!==void 0&&e!==0){let t=e-this.droppedSampleFrames;return this.droppedSampleFrames=e,t}return 0}setupStateMachineCallbacks(){this.stateMachineCallbacks={setup:(e,t,n,r)=>{v.log(`Setup Gumlet analytics `+this.analyticsVersion),this.setDuration(e),this.setVideoData(n);let i=0;r?.starttime&&(i=new Date().getTime()-r.starttime),this.sendAnalyticsRequestAndClearValues(y.SETUP,{millis_from_previous_event:i}),this.setState(y.SETUP)},ready:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(y.PLAYER_READY),this.setState(y.PLAYER_READY),this.setPlayerData(n),this.playerInitCall.sendRequest(this.playerData,g.noOp)},loaded:(e,t,n,r=null)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n);let i={};r!==null&&(i={millis_from_previous_event:r,previous_event:y.PLAYER_READY}),this.sendAnalyticsRequestAndClearValues(y.PLAYBACK_READY,i),r===null&&this.setState(y.PLAYBACK_READY)},startup:(e,t)=>{this.setDuration(e)},first_play:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(y.PLAY),this.setState(y.PLAY),this.firstPlayTimestamp=new Date},play:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(y.PLAY),this.setState(y.PLAY)},updateSample:e=>{this.setPlaybackSettingsFromLoadedEvent(e)},playing:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(y.PLAYING),this.setState(y.PLAYING)},playback_started:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n);let r=new Date().getTime()-this.firstPlayTimestamp.getTime();this.sendAnalyticsRequestAndClearValues(y.PLAYBACK_STARTED,{millis_from_previous_event:r}),this.setState(y.PLAYBACK_STARTED)},playingAndBye:(e,t,n)=>{this.setDuration(e),this.setDroppedFrames(n),this.sendUnloadRequest()},heartbeat:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(y.PLAYBACK_UPDATE),this.setState(y.PLAYBACK_UPDATE)},playbackWatchTime:e=>{this.setPlaybackWatchTime(e)},qualitychange:(e,t)=>{this.setDuration(e)},qualitychange_pause:(e,t)=>{this.setDuration(e)},qualitychange_rebuffering:(e,t)=>{this.setDuration(e)},videoChange:e=>{this.stateMachineCallbacks.setVideoTimeEndFromEvent(e),this.stateMachineCallbacks.setVideoTimeStartFromEvent(e),this.setPlaybackSettingsFromLoadedEvent(e)},audioChange:e=>{this.stateMachineCallbacks.setVideoTimeEndFromEvent(e),this.stateMachineCallbacks.setVideoTimeStartFromEvent(e)},pause:(e,t,n)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),this.sendAnalyticsRequestAndClearValues(y.PAUSE),this.setState(y.PAUSE)},start_rebuffer:(e,t,n,r=!1)=>{this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),r||this.sendAnalyticsRequestAndClearValues(y.START_REBUFFER),this.setState(y.START_REBUFFER)},end_rebuffer:(e,t,n,r=!1)=>{if(this.setDuration(e),this.setVideoData(n),this.setPlaybackSettingsFromLoadedEvent(n),!r)this.sendAnalyticsRequestAndClearValues(y.END_REBUFFER);else return this.getSample(y.END_REBUFFER);this.setState(y.END_REBUFFER)},playback_seeked:(e,t,n,r)=>{this.sendAnalyticsRequestAndClearValues(y.SEEKED,{from:e,to:t}),this.setState(y.SEEKED),this.setupSample(),r===`PAUSE`?(this.sendAnalyticsRequestAndClearValues(y.PAUSE,{millis_from_previous_event:n}),this.setState(y.PAUSE)):r===`PLAYING`&&(this.sendAnalyticsRequestAndClearValues(y.PLAYING,{millis_from_previous_event:n}),this.setState(y.PLAYING))},paused_seeking:(e,t,n)=>{this.setDuration(e)},play_seeking:g.noOp,end_play_seeking:(e,t,n)=>{this.setDuration(e)},rebuffering:(e,t,n)=>{this.setDuration(e)},error:e=>{this.setPlaybackSettingsFromLoadedEvent(e),this.stateMachineCallbacks.setVideoTimeEndFromEvent(e),this.stateMachineCallbacks.setVideoTimeStartFromEvent(e),this.sendAnalyticsRequestAndClearValues(y.ERROR,{error_code:e&&e.code,error:e&&e.message}),this.setState(y.ERROR),this.setupSample()},error_recovered:(e,t,n)=>{this.setPlaybackSettingsFromLoadedEvent(n),this.stateMachineCallbacks.setVideoTimeEndFromEvent(n),this.stateMachineCallbacks.setVideoTimeStartFromEvent(n),this.sendAnalyticsRequestAndClearValues(y.ERROR_RECOVERED,{})},end:(e,t,n)=>{this.setPlaybackId(),this.setDuration(e),this.sendAnalyticsRequestAndClearValues(y.END),this.setState(y.END)},ad:(e,t,n)=>{this.setDuration(e),this.setDroppedFrames(n)},mute:(e,t)=>{this.isMuted=!0,this.setPlaybackSettingsFromLoadedEvent(t),this.sendAnalyticsRequestAndClearValues(y.MUTE)},unMute:(e,t)=>{this.isMuted=!1,this.setPlaybackSettingsFromLoadedEvent(t),this.sendAnalyticsRequestAndClearValues(y.UNMUTE)},muting_ready:g.noOp,muting_play:g.noOp,muting_pause:g.noOp,setVideoTimeEndFromEvent:e=>{},setVideoTimeStartFromEvent:e=>{},startCasting:(t,n)=>{if(n&&n.resuming){this.isAllowedToSendSamples=!1,v.warning(`Player started casting but a session is already casting!`);return}this.isCastClient=!0,this.isAllowedToSendSamples=!1;let{domain:r,path:i,language:a,userAgent:o,userId:s,impressionId:c}=this.sample,l={type:e.CAST_RECEIVER_CONFIG_MESSAGE,data:{config:this.config,userId:s,domain:r,path:i,language:a,userAgent:o,impressionId:c}};this.castClient.setUp(),this.castClient.sendMessage(l)},casting:()=>{this.isCastClient=!1,this.samplesQueue=[],this.isAllowedToSendSamples=!0},source_changing:()=>{},resetSessionExpiry:()=>{this.session.resetSessionExpiry()}}}};let Q=`[GumletInsights]`;var Hn=class{constructor(e){if(this.analytics_=null,this.ready_=!1,this.attached_=!1,!e||!g.validString(e.property_id)||e.property_id===``){console.error(`${Q} A valid property_id is required. No analytics events will be sent until the SDK is re-constructed with a valid config.`);return}this.analytics_=new Vn(e),this.ready_=!0}async attach(e,t={}){if(!this.ready_||!this.analytics_){console.error(`${Q} attach() called but the SDK is not initialized. Check that you passed a valid property_id to the constructor.`);return}this.attached_&&(console.warn(`${Q} attach() called while a player is already attached. Detaching the previous player first.`),this.detach());let n=t.mediaElement??null;if(n!==null&&!this.isHTMLVideoElement_(n)){console.error(`${Q} opts.mediaElement must be an HTMLVideoElement, got: ${Object.prototype.toString.call(n)}`);return}if(e==null){if(!n){console.error(`${Q} HTML5 mode requires opts.mediaElement (an HTMLVideoElement). Pass the <video> element as opts.mediaElement, or pass it directly as the player argument.`);return}}else if(Be(e)){if(!this.isValidHlsPlayer_(e)){console.error(`${Q} HLS.js player is not in a valid state. The player may have been destroyed. Create a new Hls() instance before attaching.`);return}}else if(ze(e)){let t=typeof e.getMediaElement==`function`?e.getMediaElement():null;if(!n&&!t){console.error(`${Q} Shaka Player requires opts.mediaElement — pass the HTMLVideoElement that Shaka is rendering into.`);return}if(!this.isValidShakaPlayer_(e)){console.error(`${Q} Shaka Player is not in a valid state. The player may have been destroyed. Create a new shaka.Player() before attaching.`);return}}else if(!this.isHTMLVideoElement_(e)){console.error(`${Q} Unrecognized player type (${Object.prototype.toString.call(e)}). Supported players: HLS.js (Hls instance), Shaka Player (shaka.Player instance), HTMLVideoElement, or null/undefined (HTML5 mode with opts.mediaElement).`);return}await this.analytics_.register(e,{...t,mediaElement:n}),this.attached_=!0}detach(){this.attached_&&=(this.analytics_?.adapter?.destroy?.(),!1)}get isAttached(){return this.attached_}getImpressionId(){return this.analytics_?.getCurrentImpressionId()??void 0}updateConfig(e){!this.ready_||!this.analytics_||(this.analytics_.updateCustomData(e),this.analytics_.updateCustomVideoData(e),this.analytics_.updateCustomUserData(e),this.analytics_.updateCustomPlayerData(e))}updateCustomData(e){this.analytics_?.updateCustomData(e)}updateCustomVideoData(e){this.analytics_?.updateCustomVideoData(e)}updateCustomUserData(e){this.analytics_?.updateCustomUserData(e)}updateCustomPlayerData(e){this.analytics_?.updateCustomPlayerData(e)}customEventHandler(e,t){if(!this.ready_||!this.analytics_){console.warn(`${Q} customEventHandler ignored — SDK not initialized (check property_id).`);return}this.analytics_.customEventHandler(e,t)}customEventHandlerAsync(e,t){return!this.ready_||!this.analytics_?Promise.reject(Error(`${Q} customEventHandlerAsync — SDK not initialized (check property_id).`)):this.analytics_.customEventHandlerAsync(e,t)}isHTMLVideoElement_(e){return typeof HTMLVideoElement<`u`?e instanceof HTMLVideoElement:typeof e==`object`&&!!e&&typeof e.play==`function`&&typeof e.pause==`function`&&typeof e.addEventListener==`function`}isValidHlsPlayer_(e){return typeof e==`object`&&!!e&&typeof e.loadSource==`function`&&typeof e.attachMedia==`function`&&typeof e.destroy==`function`}isValidShakaPlayer_(e){return typeof e!=`object`||!e?!1:typeof e.isDestroyed==`function`?!e.isDestroyed():typeof e.load==`function`&&typeof e.unload==`function`&&typeof e.addEventListener==`function`}};m(),ee();let $,Un=(e,t={})=>$.register(e,t),Wn=(e,t={})=>$.registerHLSJSPlayer(e,t),Gn=(e,t={})=>$.registerShakaPlayer(e,t),Kn=(e,t={})=>$.registerHTML5Player(e,t),qn=(e,t={})=>$.registerReactNativeVideoPlayer(e,t),Jn=()=>$.getCurrentImpressionId(),Yn=()=>$.analyticsStateMachine,Xn=e=>$.updateCustomData(e),Zn=e=>$.updateCustomVideoData(e),Qn=e=>$.updateCustomUserData(e),$n=e=>$.updateCustomPlayerData(e),er=(e,t)=>$.customEventHandler(e,t),tr=(e,t)=>new Promise((n,r)=>{$.customEventHandlerAsync(e,t).then(e=>{n(e)}).catch(e=>{r(e)})}),nr=e=>($=new Vn(e),{register:Un,registerHLSJSPlayer:Wn,registerShakaPlayer:Gn,registerHTML5Player:Kn,registerReactNativeVideoPlayer:qn,getCurrentImpressionId:Jn,stateMachine:Yn,updateCustomData:Xn,updateCustomVideoData:Zn,updateCustomUserData:Qn,updateCustomPlayerData:$n,setCustomData:$.setCustomData,setCustomDataOnce:$.setCustomDataOnce,customEventHandler:er,customEventHandlerAsync:tr});nr.Players=h,nr.CdnProviders=f,nr.gumletInsightsEvents=p,nr.gumletSupportedPlayers=h,typeof window<`u`&&(window.gumlet=window.gumlet||{},window.gumlet.insights=nr,window.gumlet.GumletInsights=Hn,window.gumletInsightsEvents=p,window.gumletSupportedPlayers=h,window.gumlet.insightsFullCustomTestConfig=te);var rr={insights:nr,gumletInsightsEvents:p,gumletSupportedPlayers:h,fullCustomAnalyticsConfig:te};return e.GumletInsights=Hn,e.default=rr,e.fullCustomAnalyticsConfig=te,e})({});
|