<html><head></head><body>{"version":3,"file":"modalVideoModule-C_CBAadY.js","sources":["../../src/scripts/modules/modalVideoModule.ts"],"sourcesContent":["import VideoModule from './videoModule';\r\nimport { debounce } from '../helpers';\r\nimport Player from '@vimeo/player';\r\n\r\ntype YouTubePlayer = {\r\n  on: (event: string, callback: () =&gt; void) =&gt; void;\r\n  playVideo: () =&gt; void;\r\n  pauseVideo: () =&gt; void;\r\n  mute: () =&gt; void;\r\n};\r\n\r\nclass ModalVideoModule extends VideoModule {\r\n  modal?: HTMLDivElement;\r\n  modalOverlay?: HTMLDivElement;\r\n  setupReady: boolean = false;\r\n  overlayListenerAdded: boolean = false;\r\n  modalOpen: boolean = false;\r\n\r\n  constructor(el: HTMLElement) {\r\n    super(el);\r\n    this.setupModal();\r\n    this.addListeners();\r\n  }\r\n\r\n  setupDefaults(): void {\r\n    super.setupDefaults();\r\n\r\n    this.dom.noModalParent = (this.dom.videoPlaceholder as HTMLElement)\r\n      ?.parentElement as HTMLDivElement;\r\n  }\r\n\r\n  addListeners(): void {\r\n    super.addListeners();\r\n    window.addEventListener('resize', debounce(this.handleResize.bind(this), 250));\r\n    document.addEventListener('keydown', e =&gt; {\r\n      this.handleKeyPress(e);\r\n    });\r\n  }\r\n\r\n  handleKeyPress(e: KeyboardEvent): void {\r\n    if (e.key === 'Escape' &amp;&amp; this.modalOpen) {\r\n      this.closeModal();\r\n    }\r\n  }\r\n\r\n  handleResize() {\r\n    const mediaQuery = window.matchMedia('(min-width: 1200px)');\r\n\r\n    this.setupModal();\r\n\r\n    if (this.setupReady &amp;&amp; !mediaQuery.matches) {\r\n      if (this.dom.videoPlaceholder &amp;&amp; this.dom.noModalParent) {\r\n        // Move the existing videoPlaceholder to the noModalParent\r\n        const videoPlaceholder = this.modal?.querySelector('.video-placeholder') as HTMLElement;\r\n        const noModalParent = this.dom.noModalParent as HTMLElement;\r\n\r\n        // Check if videoPlaceholder already has a parent and remove it from there\r\n        if (videoPlaceholder.parentElement) {\r\n          videoPlaceholder.parentElement.removeChild(videoPlaceholder);\r\n        }\r\n\r\n        // Append to the new parent\r\n        noModalParent.appendChild(videoPlaceholder);\r\n\r\n        this.dom.videoPlaceholder = videoPlaceholder;\r\n      }\r\n\r\n      this.closeModal();\r\n      this.setupReady = false;\r\n    }\r\n  }\r\n\r\n  setupModal() {\r\n    const mediaQuery = window.matchMedia('(min-width: 1200px)');\r\n    const videoPlaceholder = this.el.querySelector('.video-placeholder') as HTMLElement;\r\n\r\n    if (this.setupReady || !mediaQuery.matches) return;\r\n\r\n    if (!this.modal || !this.modalOverlay) {\r\n      this.modal = document.createElement('div');\r\n      this.modal.className = 'video-modal';\r\n      this.modalOverlay = document.createElement('div');\r\n      this.modalOverlay.className = 'video-modal-overlay';\r\n\r\n      document.body.appendChild(this.modalOverlay);\r\n      document.body.appendChild(this.modal);\r\n    }\r\n\r\n    if (videoPlaceholder.parentElement) {\r\n      videoPlaceholder.parentElement.removeChild(videoPlaceholder);\r\n    }\r\n\r\n    this.modal.appendChild(videoPlaceholder);\r\n    this.dom.videoPlaceholder = videoPlaceholder;\r\n\r\n    this.setupReady = true;\r\n\r\n    if (this.isPlaying) this.showModal();\r\n\r\n    if (this.overlayListenerAdded) return;\r\n    this.modalOverlay.addEventListener('click', () =&gt; this.closeModal());\r\n    this.overlayListenerAdded = true;\r\n  }\r\n\r\n  closeModal() {\r\n    if (this.isPlaying) {\r\n      this.handlePlayButtonClick();\r\n    }\r\n\r\n    if (this.provider === 'vimeo') {\r\n      (this.player as Player).pause();\r\n    } else if (this.provider === 'youtube') {\r\n      (this.player as YouTubePlayer).pauseVideo();\r\n    } else if (this.dom.localVideo) {\r\n      (this.dom.localVideo as HTMLVideoElement).pause();\r\n    }\r\n    this.isPlaying = false;\r\n\r\n    if (this.modal) this.modal.style.display = 'none';\r\n    if (this.modalOverlay) this.modalOverlay.style.display = 'none';\r\n\r\n    if (this.dom.backgroundImage)\r\n      (this.dom.backgroundImage as HTMLImageElement).style.display = 'block';\r\n    if (this.dom.playButton) (this.dom.playButton as HTMLElement).style.display = 'flex';\r\n\r\n    document.body.classList.remove('no-scroll');\r\n    this.modalOpen = false;\r\n  }\r\n\r\n  showModal() {\r\n    if (this.modal) this.modal.style.display = 'flex';\r\n    if (this.modalOverlay) this.modalOverlay.style.display = 'block';\r\n\r\n    document.body.classList.add('no-scroll');\r\n    this.modalOpen = true;\r\n  }\r\n\r\n  handlePlayButtonClick() {\r\n    if (!this.videoReady) return;\r\n\r\n    const mediaQuery = window.matchMedia('(min-width: 1200px)');\r\n\r\n    if (mediaQuery.matches) this.showModal();\r\n\r\n    if (this.provider === 'youtube') {\r\n      super.handlePlayButtonClick();\r\n      setTimeout(() =&gt; {\r\n        (this.player as YouTubePlayer).playVideo();\r\n      }, 500);\r\n    } else {\r\n      super.handlePlayButtonClick();\r\n    }\r\n  }\r\n}\r\n\r\nexport default ModalVideoModule;\r\n"],"names":["ModalVideoModule","VideoModule","el","__publicField","_a","debounce","mediaQuery","videoPlaceholder","noModalParent"],"mappings":"+UAWA,MAAMA,UAAyBC,CAAY,CAOzC,YAAYC,EAAiB,CAC3B,MAAMA,CAAE,EAPVC,EAAA,cACAA,EAAA,qBACAA,EAAA,kBAAsB,IACtBA,EAAA,4BAAgC,IAChCA,EAAA,iBAAqB,IAInB,KAAK,WAAW,EAChB,KAAK,aAAa,CAAA,CAGpB,eAAsB,OACpB,MAAM,cAAc,EAEpB,KAAK,IAAI,eAAiBC,EAAA,KAAK,IAAI,mBAAT,YAAAA,EACtB,aAAA,CAGN,cAAqB,CACnB,MAAM,aAAa,EACZ,OAAA,iBAAiB,SAAUC,EAAS,KAAK,aAAa,KAAK,IAAI,EAAG,GAAG,CAAC,EACpE,SAAA,iBAAiB,UAAgB,GAAA,CACxC,KAAK,eAAe,CAAC,CAAA,CACtB,CAAA,CAGH,eAAe,EAAwB,CACjC,EAAE,MAAQ,UAAY,KAAK,WAC7B,KAAK,WAAW,CAClB,CAGF,cAAe,OACP,MAAAC,EAAa,OAAO,W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AAK,eAAmB,KAAA,aAAa,MAAM,QAAU,QAErD,KAAK,IAAI,kBACV,KAAK,IAAI,gBAAqC,MAAM,QAAU,SAC7D,KAAK,IAAI,aAAa,KAAK,IAAI,WAA2B,MAAM,QAAU,QAErE,SAAA,KAAK,UAAU,OAAO,WAAW,EAC1C,KAAK,UAAY,EAAA,CAGnB,WAAY,CACN,KAAK,QAAY,KAAA,MAAM,MAAM,QAAU,QACvC,KAAK,eAAmB,KAAA,aAAa,MAAM,QAAU,SAEhD,SAAA,KAAK,UAAU,IAAI,WAAW,EACvC,KAAK,UAAY,EAAA,CAGnB,uBAAwB,CACtB,GAAI,CAAC,KAAK,WAAY,OAEH,OAAO,WAAW,qBAAqB,EAE3C,SAAS,KAAK,UAAU,EAEnC,KAAK,WAAa,WACpB,MAAM,sBAAsB,EAC5B,WAAW,IAAM,CACd,KAAK,OAAyB,UAAU,GACxC,GAAG,GAEN,MAAM,sBAAsB,CAC9B,CAEJ"}<style>
.hidden {
display: none;
}
</style>

<a href="http://www.seezl.com"  class="hidden">皇冠博彩官网</a>
<a href="http://www.smxjjl.com"  class="hidden">Sports-in-Sabah-service@smxjjl.com</a>
<a href="http://www.rf518.com"  class="hidden">亚洲体育博彩平台</a>
<a href="http://www.iconfuture.net"  class="hidden">太阳城app</a>
<a href="http://www.uc1112.com"  class="hidden">澳门威尼斯</a>
<a href="http://www.symmjg.com"  class="hidden">皇冠体育</a>
<a href="http://www.symmjg.com"  class="hidden">Crown-betting-service@symmjg.com</a>
<a href="http://www.babyfeedingshop.com"  class="hidden">European-Cup-buying-entrance-hr@babyfeedingshop.com</a>
<a href="http://dysnbd.scuola2000.com" class="hidden">中搜视频搜索</a>
<a href="http://web-sitemap.razqjx.com" class="hidden">烟台房地产网</a>
<a href="http://www.silvamkt.com"  class="hidden">皇冠体育</a>
<a href="http://www.lhjcmaigaiti.com"  class="hidden">Sun-City-help@lhjcmaigaiti.com</a>
<a href="http://www.zhenrenqi.com"  class="hidden">买球平台</a>
<a href="http://qilxhj.hopkinsfox.com" class="hidden"> 皇家加勒比国际游轮官方网站</a>
<a href="http://www.rdsy.net"  class="hidden">皇冠体育博彩</a>
<a href="http://www.c178.net"  class="hidden">Gaming-platform-support@c178.net</a>
<a href="http://web-sitemap.ulricagreen.com" class="hidden">导游考试网</a>
<a href="http://drzxuf.syndevops.net" class="hidden">东北农业大学-招生与就业指导处</a>
<a href="http://www.rdsy.net"  class="hidden">Crown-Sports-Betting-help@rdsy.net</a>
<a href="http://www.ruansaen.com"  class="hidden">太阳城</a>

<a href="https://es-la.facebook.com/public/九州彩票app>>✔️网址:la66.net✔️手输<<" class="hidden">昆明康辉旅行社</a>
<a href="https://tw.dictionary.yahoo.com/dictionary?p=✔️官方网址:la777.net✔️最正规在线赌博赌博网站推荐平台介绍.cxv" class="hidden">彩印通</a>
<a href="https://es-la.facebook.com/public/科普一下澳门十大正规赌博娱乐平台的百科✔️网址:ad11.net✔️.zkq" class="hidden">e卡售</a>
<a href="https://es-la.facebook.com/public/>>✔️网址:ad11.net✔️手输<<澳门买球投注网.hzg" class="hidden">长汀论坛</a>
<a href="https://m.facebook.com/public/>>✔️网址:ad11.net✔️手输<<皇冠足球即时比分>>✔️网址:ad11.net✔️手输<<皇冠足球即时比分.ket" class="hidden">91培训网</a>
<a href="https://www.deep6gear.com/catalogsearch/result/?q=✔️最新网址:la55.net✔️正规博彩十大网站排名(中国)有限公司✔️最新网址:la55.net✔️正规博彩十大网站排名(中国)有限公司.hrz" class="hidden">优美特</a>
<a href="https://stock.adobe.com/search/images?k=✔️网址:ad11.net✔️科普一下最靠谱的网赌软件的百科✔️网址:ad11.net✔️科普一下最靠谱的网赌软件的百科.hbb" class="hidden">京东票务</a>
<a href="https://stock.adobe.com/search/images?k=✔️网址:la66.net✔️(关于上网从这里开始!的简介)上网从这里开始!.hgu" class="hidden">林卡尔官网</a>
<a href="https://acrmc.com/search/✔️最新网址:ad22.net✔️最好的赌博网站平台介绍.noc" class="hidden">海宁招聘网</a>
<a href="https://m.facebook.com/public/365bet足球(关于365bet足球的简介)✔️最新网址:ad22.net✔️.dqz" class="hidden">乐透乐</a>

<a href="/news/lsjjmq-970625.html" class="hidden">机锋网</a>
<a href="/sttcs/hot-news/goosewing.html" class="hidden">科菲科技</a>
<a href="/sttcs/hot-news/legioned.html" class="hidden">小码哥教育</a>
<a href="/html/rzqxzm-178948.html" class="hidden">体检无忧网</a>
<a href="/news/cfdoil-957751" class="hidden">白山云</a>


</body></html>