{"version":3,"file":"PlayerPlayButton-CAElMmMV.mjs","names":[],"sources":["../src/components/composable/player/usePlayerDisplayTime.ts","../src/components/misc/player/elements/PlayerTitle.vue","../src/components/misc/player/elements/PlayerTitle.vue","../src/components/misc/player/chaptering/PlayerChaptering.vue","../src/components/misc/player/chaptering/PlayerChaptering.vue","../src/components/misc/player/elements/PlayerImage.vue","../src/components/misc/player/elements/PlayerImage.vue","../src/components/misc/player/elements/PlayerPlayButton.vue","../src/components/misc/player/elements/PlayerPlayButton.vue"],"sourcesContent":["import { computed } from \"vue\";\nimport { usePlayerStore } from \"../../../stores/PlayerStore\";\nimport { useVastStore } from \"../../../stores/VastStore\";\nimport DurationHelper from \"../../../helper/durationHelper\";\nexport const usePlayerDisplayTime = ()=>{\n\n  const playerStore = usePlayerStore();\n  const vastStore = useVastStore();\n\n  const displayPlayTime = computed(() => { \n    if(vastStore.isAdPlaying){\n      return DurationHelper.formatDuration(Math.round(vastStore.currentTimeAd));\n    }\n    return playerStore.playedTime;\n  });\n\n  const displayTotalTime = computed(() => { \n    if(vastStore.isAdPlaying){\n      return DurationHelper.formatDuration(Math.round(vastStore.currentDurationAd));\n    }\n    return playerStore.totalTime;\n  });\n\n  const transcriptText = computed(() => { \n    return playerStore.transcriptText;\n  });\n\n  return {\n    displayPlayTime,\n    displayTotalTime,\n    transcriptText,\n    radioUrl: playerStore.radioUrl,\n    isAdPlaying: vastStore.isAdPlaying,\n  }\n}\n","<template>\n  <div v-if=\"playerError\" class=\"text-warning mx-2\">\n    {{ t(\"Podcast play error\") + \" - \" }}\n  </div>\n  <component\n    :is=\"vastStore.linkAdvertising ? 'a' : 'div'\"\n    class=\"flex-grow-1 text-truncate\"\n    :class=\"titleClass\"\n    :href=\"vastStore.linkAdvertising\"\n    rel=\"noreferrer noopener\"\n    target=\"_blank\"\n    :title=\"t('New window', {text: podcastTitle})\"\n  >\n    {{ podcastTitle }}\n  </component>\n</template>\n<script setup lang=\"ts\">\nimport {useFetchRadio} from \"../../../composable/radio/usefetchRadioData\";\nimport { usePlayerStore } from \"../../../../stores/PlayerStore\";\nimport { useVastStore } from \"../../../../stores/VastStore\";\nimport { computed, onUnmounted, Ref, ref, watch } from \"vue\";\nimport { MediaRadio, NextAdvertising } from \"@/stores/class/general/player\";\nimport { Podcast } from \"@/stores/class/general/podcast\";\nimport { useI18n } from \"vue-i18n\";\n\n//Props \nconst props = defineProps({\n  playerError: { default: false, type: Boolean },\n  hlsReady: { default: false, type: Boolean },\n  titleClass: { default: \"\", type: String },\n})\n\n//Data \nconst radioInterval: Ref<ReturnType<typeof setTimeout> | undefined> = ref(undefined);\n\n//Composables\nconst { t } = useI18n();\nconst { fetchRadioMetadata, displayTitle } = useFetchRadio();\nconst playerStore = usePlayerStore();\nconst vastStore = useVastStore();\n\n\n//Computed\nconst podcastTitle = computed(() => {\n  if (vastStore.isAdPlaying) {\n    return t(\"Advertising\") + vastStore.titleAdvertising;\n  }\n  if (playerStore.playerRadio) {\n    if (playerStore.playerRadio.podcast) {\n      return playerStore.playerRadio.podcast.title;\n    }\n    return displayTitle(playerStore.playerRadio.metadata);\n  }\n  if (playerStore.playerPodcast) {\n    return playerStore.playerPodcast.title;\n  }\n  if (playerStore.playerMedia) {\n    return playerStore.playerMedia.title;\n  }\n  if (playerStore.playerLive) {\n    if (!props.hlsReady) {\n      return (\n        playerStore.playerLive.title + \" (\" + t(\"Start in a while\") + \")\"\n      );\n    }\n    return playerStore.playerLive.title;\n  }\n  return \"\";\n});\n\n//Watch\nwatch(()=>playerStore.playerRadio, (newValue, oldValue) => {\n  if (oldValue && newValue && newValue.canalId === oldValue.canalId) {\n    return;\n  }\n  clearInterval(radioInterval.value as unknown as number);\n  if (playerStore.playerRadio) {\n    fetchCurrentlyPlaying();\n    radioInterval.value = setInterval(() => {\n      fetchCurrentlyPlaying();\n    }, 10000);\n  }\n}, {deep: true,immediate: true});\n\nonUnmounted(()=>{\n  clearInterval(radioInterval.value as unknown as number);\n  radioInterval.value= undefined;\n})\n\n\n//Methods\nasync function fetchCurrentlyPlaying(): Promise<void> {\n  fetchRadioMetadata(\n    playerStore.playerRadio?.canalId ?? 0,\n    playerStore.playerRadio?.metadata?.title ?? \"\",\n    updateMetadata,\n    updateAdvertising,\n  );\n}\nfunction updateAdvertising(nextAdvertising: NextAdvertising): void {\n  playerStore.playerRadioUpdateNextAdvertising(nextAdvertising);\n}\nfunction updateMetadata(\n  metadata: MediaRadio|undefined,\n  podcast: Podcast | undefined,\n  history: Array<MediaRadio>,\n): void {\n  playerStore.playerMetadata(metadata, history); //TODO\n  playerStore.playerRadioPodcast(podcast);\n}\n</script>\n","<template>\n  <div v-if=\"playerError\" class=\"text-warning mx-2\">\n    {{ t(\"Podcast play error\") + \" - \" }}\n  </div>\n  <component\n    :is=\"vastStore.linkAdvertising ? 'a' : 'div'\"\n    class=\"flex-grow-1 text-truncate\"\n    :class=\"titleClass\"\n    :href=\"vastStore.linkAdvertising\"\n    rel=\"noreferrer noopener\"\n    target=\"_blank\"\n    :title=\"t('New window', {text: podcastTitle})\"\n  >\n    {{ podcastTitle }}\n  </component>\n</template>\n<script setup lang=\"ts\">\nimport {useFetchRadio} from \"../../../composable/radio/usefetchRadioData\";\nimport { usePlayerStore } from \"../../../../stores/PlayerStore\";\nimport { useVastStore } from \"../../../../stores/VastStore\";\nimport { computed, onUnmounted, Ref, ref, watch } from \"vue\";\nimport { MediaRadio, NextAdvertising } from \"@/stores/class/general/player\";\nimport { Podcast } from \"@/stores/class/general/podcast\";\nimport { useI18n } from \"vue-i18n\";\n\n//Props \nconst props = defineProps({\n  playerError: { default: false, type: Boolean },\n  hlsReady: { default: false, type: Boolean },\n  titleClass: { default: \"\", type: String },\n})\n\n//Data \nconst radioInterval: Ref<ReturnType<typeof setTimeout> | undefined> = ref(undefined);\n\n//Composables\nconst { t } = useI18n();\nconst { fetchRadioMetadata, displayTitle } = useFetchRadio();\nconst playerStore = usePlayerStore();\nconst vastStore = useVastStore();\n\n\n//Computed\nconst podcastTitle = computed(() => {\n  if (vastStore.isAdPlaying) {\n    return t(\"Advertising\") + vastStore.titleAdvertising;\n  }\n  if (playerStore.playerRadio) {\n    if (playerStore.playerRadio.podcast) {\n      return playerStore.playerRadio.podcast.title;\n    }\n    return displayTitle(playerStore.playerRadio.metadata);\n  }\n  if (playerStore.playerPodcast) {\n    return playerStore.playerPodcast.title;\n  }\n  if (playerStore.playerMedia) {\n    return playerStore.playerMedia.title;\n  }\n  if (playerStore.playerLive) {\n    if (!props.hlsReady) {\n      return (\n        playerStore.playerLive.title + \" (\" + t(\"Start in a while\") + \")\"\n      );\n    }\n    return playerStore.playerLive.title;\n  }\n  return \"\";\n});\n\n//Watch\nwatch(()=>playerStore.playerRadio, (newValue, oldValue) => {\n  if (oldValue && newValue && newValue.canalId === oldValue.canalId) {\n    return;\n  }\n  clearInterval(radioInterval.value as unknown as number);\n  if (playerStore.playerRadio) {\n    fetchCurrentlyPlaying();\n    radioInterval.value = setInterval(() => {\n      fetchCurrentlyPlaying();\n    }, 10000);\n  }\n}, {deep: true,immediate: true});\n\nonUnmounted(()=>{\n  clearInterval(radioInterval.value as unknown as number);\n  radioInterval.value= undefined;\n})\n\n\n//Methods\nasync function fetchCurrentlyPlaying(): Promise<void> {\n  fetchRadioMetadata(\n    playerStore.playerRadio?.canalId ?? 0,\n    playerStore.playerRadio?.metadata?.title ?? \"\",\n    updateMetadata,\n    updateAdvertising,\n  );\n}\nfunction updateAdvertising(nextAdvertising: NextAdvertising): void {\n  playerStore.playerRadioUpdateNextAdvertising(nextAdvertising);\n}\nfunction updateMetadata(\n  metadata: MediaRadio|undefined,\n  podcast: Podcast | undefined,\n  history: Array<MediaRadio>,\n): void {\n  playerStore.playerMetadata(metadata, history); //TODO\n  playerStore.playerRadioPodcast(podcast);\n}\n</script>\n","<template>\n  <div v-if=\"actualChapter\" class=\"d-flex mb-1\">\n    <button\n      class=\"btn-transparent d-flex align-items-center text-truncate medium-text text-light\"\n      @click=\"showChaptering = !showChaptering\"\n    >\n      <div class=\"text-truncate\">\n        {{ actualIndex + 1 + \" - \" + actualChapter.title }}\n      </div>\n      <ChevronRightIcon :size=\"16\" />\n    </button>\n    <ChapteringModal\n      v-if=\"showChaptering\"\n      :actual-chapter=\"actualIndex\"\n      @close=\"showChaptering = false\"\n    />\n  </div>\n  <div v-else-if=\"playerStore.playerChapteringPercent\" class=\"margin-chaptering\"></div>\n</template>\n<script setup lang=\"ts\">\nimport ChevronRightIcon from \"vue-material-design-icons/ChevronRight.vue\";\nimport { ChapterPercent } from \"@/stores/class/chaptering/chaptering\";\nimport { usePlayerStore } from \"../../../../stores/PlayerStore\";\nimport { defineAsyncComponent, Ref, ref, watch } from \"vue\";\nconst ChapteringModal = defineAsyncComponent(\n  () => import(\"./ChapteringModal.vue\"),\n);\n\n//Data \nconst actualChapter : Ref<ChapterPercent | undefined>= ref(undefined);\nconst actualIndex = ref(-1);\nconst showChaptering = ref(false);\n\n\n//Composables\nconst playerStore = usePlayerStore();\n\n//Watch\nwatch(()=>playerStore.playerElapsed, () => {\n  if (!playerStore.playerChapteringPercent) {\n    actualChapter.value = undefined;\n    return;\n  }\n  const progressPercent = (playerStore.playerElapsed ?? 0) * 100;\n  if (\n    actualChapter.value &&\n    isInChapter(progressPercent, actualChapter.value)\n  ) {\n    return;\n  }\n  for (\n    let i = 0, len = playerStore.playerChapteringPercent.length;\n    i < len;\n    i++\n  ) {\n    if (\n      isInChapter(progressPercent, playerStore.playerChapteringPercent[i])\n    ) {\n      actualChapter.value = playerStore.playerChapteringPercent[i];\n      actualIndex.value = i;\n      return;\n    }\n  }\n  actualChapter.value = undefined;\n  actualIndex.value = -1;\n}, {immediate: true});\n\n\n//Methods\nfunction isInChapter(val: number, chapter: ChapterPercent) {\n  return (\n    Math.floor(chapter.startPercent) <= val &&\n    val < Math.floor(chapter.endPercent)\n  );\n}\n</script>\n<style lang=\"scss\">\n.octopus-app .margin-chaptering {\n  height: 23px;\n}\n</style>\n","<template>\n  <div v-if=\"actualChapter\" class=\"d-flex mb-1\">\n    <button\n      class=\"btn-transparent d-flex align-items-center text-truncate medium-text text-light\"\n      @click=\"showChaptering = !showChaptering\"\n    >\n      <div class=\"text-truncate\">\n        {{ actualIndex + 1 + \" - \" + actualChapter.title }}\n      </div>\n      <ChevronRightIcon :size=\"16\" />\n    </button>\n    <ChapteringModal\n      v-if=\"showChaptering\"\n      :actual-chapter=\"actualIndex\"\n      @close=\"showChaptering = false\"\n    />\n  </div>\n  <div v-else-if=\"playerStore.playerChapteringPercent\" class=\"margin-chaptering\"></div>\n</template>\n<script setup lang=\"ts\">\nimport ChevronRightIcon from \"vue-material-design-icons/ChevronRight.vue\";\nimport { ChapterPercent } from \"@/stores/class/chaptering/chaptering\";\nimport { usePlayerStore } from \"../../../../stores/PlayerStore\";\nimport { defineAsyncComponent, Ref, ref, watch } from \"vue\";\nconst ChapteringModal = defineAsyncComponent(\n  () => import(\"./ChapteringModal.vue\"),\n);\n\n//Data \nconst actualChapter : Ref<ChapterPercent | undefined>= ref(undefined);\nconst actualIndex = ref(-1);\nconst showChaptering = ref(false);\n\n\n//Composables\nconst playerStore = usePlayerStore();\n\n//Watch\nwatch(()=>playerStore.playerElapsed, () => {\n  if (!playerStore.playerChapteringPercent) {\n    actualChapter.value = undefined;\n    return;\n  }\n  const progressPercent = (playerStore.playerElapsed ?? 0) * 100;\n  if (\n    actualChapter.value &&\n    isInChapter(progressPercent, actualChapter.value)\n  ) {\n    return;\n  }\n  for (\n    let i = 0, len = playerStore.playerChapteringPercent.length;\n    i < len;\n    i++\n  ) {\n    if (\n      isInChapter(progressPercent, playerStore.playerChapteringPercent[i])\n    ) {\n      actualChapter.value = playerStore.playerChapteringPercent[i];\n      actualIndex.value = i;\n      return;\n    }\n  }\n  actualChapter.value = undefined;\n  actualIndex.value = -1;\n}, {immediate: true});\n\n\n//Methods\nfunction isInChapter(val: number, chapter: ChapterPercent) {\n  return (\n    Math.floor(chapter.startPercent) <= val &&\n    val < Math.floor(chapter.endPercent)\n  );\n}\n</script>\n<style lang=\"scss\">\n.octopus-app .margin-chaptering {\n  height: 23px;\n}\n</style>\n","<template>\n  <div>\n    <a\n      v-if=\"vastStore.linkAdvertising\"\n      rel=\"noreferrer noopener\"\n      target=\"_blank\"\n      :href=\"vastStore.linkAdvertising\"\n      class=\"player-image link-image\"\n      :class=\"imageWidth > 50 ? 'big-player-image' : ''\"\n      :title=\"t('New window', {text: t('Advertising')})\"\n    >\n      <LinkVariantIcon />\n    </a>\n    <router-link\n      v-else-if=\"playerStore.podcastImage\"\n      :to=\"podcastShareUrl\"\n      :title=\"t('Episode name page', { name: podcastDisplay?.title })\"\n    >\n      <img\n        v-lazy=\"useProxyImageUrl(playerStore.podcastImage, imageWidth)\"\n        :width=\"imageWidth\"\n        :height=\"imageWidth\"\n        aria-hidden=\"true\"\n        alt=\"\"\n        :title=\"t('Episode name image', { name: podcastDisplay?.title })\"\n        class=\"player-image\"\n        :class=\"imageWidth > 50 ? 'big-player-image' : ''\"\n      />\n    </router-link>\n  </div>\n</template>\n<script setup lang=\"ts\">\nimport LinkVariantIcon from \"vue-material-design-icons/LinkVariant.vue\";\nimport {useImageProxy} from \"../../../composable/useImageProxy\";\nimport { computed } from \"vue\";\nimport { usePlayerStore } from \"../../../../stores/PlayerStore\";\nimport { useVastStore } from \"../../../../stores/VastStore\";\nimport { useI18n } from \"vue-i18n\";\n\n\n//Props \ndefineProps({\n  imageWidth: { default: 48, type: Number },\n})\n\n//Composables\nconst { t } = useI18n();\nconst { useProxyImageUrl } = useImageProxy();\nconst playerStore = usePlayerStore();\nconst vastStore = useVastStore();\n\n\n//Computed\nconst podcastDisplay = computed(() => {\n  if (playerStore.playerRadio?.podcast) {\n    return playerStore.playerRadio?.podcast;\n  }\n  if (playerStore.playerPodcast) {\n    return playerStore.playerPodcast;\n  }\n  return undefined;\n});\nconst podcastShareUrl = computed(() => {\n  if (playerStore.playerRadio?.podcast?.podcastId) {\n    return {\n      name: \"podcast\",\n      params: {\n        podcastId: playerStore.playerRadio?.podcast?.podcastId.toString(),\n      },\n    };\n  }\n  if (playerStore.playerPodcast) {\n    return {\n      name: \"podcast\",\n      params: { podcastId: playerStore.playerPodcast.podcastId.toString() },\n    };\n  }\n  return \"\";\n});\n\n</script>\n\n<style lang=\"scss\">\n\n.octopus-app .player-image {\n  border-radius: var(--octopus-border-radius);\n  height: 2.4rem;\n  width: 2.4rem;\n  margin-right: 0.5rem;\n  cursor: pointer;\n\n  /** PHONES */\n  @media (width <= 450px) {\n    height: 1.8rem;\n    width: 1.8rem;\n  }\n\n  &.big-player-image {\n    height: 200px;\n    width: 200px;\n  }\n\n  &.link-image {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    background: var(--octopus-secondary);\n    color: black;\n  }\n}\n</style>\n","<template>\n  <div>\n    <a\n      v-if=\"vastStore.linkAdvertising\"\n      rel=\"noreferrer noopener\"\n      target=\"_blank\"\n      :href=\"vastStore.linkAdvertising\"\n      class=\"player-image link-image\"\n      :class=\"imageWidth > 50 ? 'big-player-image' : ''\"\n      :title=\"t('New window', {text: t('Advertising')})\"\n    >\n      <LinkVariantIcon />\n    </a>\n    <router-link\n      v-else-if=\"playerStore.podcastImage\"\n      :to=\"podcastShareUrl\"\n      :title=\"t('Episode name page', { name: podcastDisplay?.title })\"\n    >\n      <img\n        v-lazy=\"useProxyImageUrl(playerStore.podcastImage, imageWidth)\"\n        :width=\"imageWidth\"\n        :height=\"imageWidth\"\n        aria-hidden=\"true\"\n        alt=\"\"\n        :title=\"t('Episode name image', { name: podcastDisplay?.title })\"\n        class=\"player-image\"\n        :class=\"imageWidth > 50 ? 'big-player-image' : ''\"\n      />\n    </router-link>\n  </div>\n</template>\n<script setup lang=\"ts\">\nimport LinkVariantIcon from \"vue-material-design-icons/LinkVariant.vue\";\nimport {useImageProxy} from \"../../../composable/useImageProxy\";\nimport { computed } from \"vue\";\nimport { usePlayerStore } from \"../../../../stores/PlayerStore\";\nimport { useVastStore } from \"../../../../stores/VastStore\";\nimport { useI18n } from \"vue-i18n\";\n\n\n//Props \ndefineProps({\n  imageWidth: { default: 48, type: Number },\n})\n\n//Composables\nconst { t } = useI18n();\nconst { useProxyImageUrl } = useImageProxy();\nconst playerStore = usePlayerStore();\nconst vastStore = useVastStore();\n\n\n//Computed\nconst podcastDisplay = computed(() => {\n  if (playerStore.playerRadio?.podcast) {\n    return playerStore.playerRadio?.podcast;\n  }\n  if (playerStore.playerPodcast) {\n    return playerStore.playerPodcast;\n  }\n  return undefined;\n});\nconst podcastShareUrl = computed(() => {\n  if (playerStore.playerRadio?.podcast?.podcastId) {\n    return {\n      name: \"podcast\",\n      params: {\n        podcastId: playerStore.playerRadio?.podcast?.podcastId.toString(),\n      },\n    };\n  }\n  if (playerStore.playerPodcast) {\n    return {\n      name: \"podcast\",\n      params: { podcastId: playerStore.playerPodcast.podcastId.toString() },\n    };\n  }\n  return \"\";\n});\n\n</script>\n\n<style lang=\"scss\">\n\n.octopus-app .player-image {\n  border-radius: var(--octopus-border-radius);\n  height: 2.4rem;\n  width: 2.4rem;\n  margin-right: 0.5rem;\n  cursor: pointer;\n\n  /** PHONES */\n  @media (width <= 450px) {\n    height: 1.8rem;\n    width: 1.8rem;\n  }\n\n  &.big-player-image {\n    height: 200px;\n    width: 200px;\n  }\n\n  &.link-image {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    background: var(--octopus-secondary);\n    color: black;\n  }\n}\n</style>\n","<template>\n  <button\n    v-if=\"!playerError\"\n    :title=\"t('Play')\"\n    :class=\"{\n      'p-0': !displayIsPaused && !displayIsPlaying,\n      'play-button-box': !isBigButton,\n      'play-big-button-box': isBigButton,\n    }\"\n    class=\"btn text-light\"\n    @click=\"switchPausePlay\"\n  >\n    <PlayIcon v-if=\"displayIsPaused\" :size=\"isBigButton ? 60 : 30\" />\n    <PauseIcon v-if=\"displayIsPlaying\" :size=\"isBigButton ? 60 : 30\" />\n    <ClassicSpinner\n      v-if=\"!displayIsPaused && !displayIsPlaying\"\n      :small=\"!isBigButton\"\n    />\n  </button>\n</template>\n<script setup lang=\"ts\">\nimport PlayIcon from \"vue-material-design-icons/Play.vue\";\nimport PauseIcon from \"vue-material-design-icons/Pause.vue\";\nimport ClassicSpinner from \"../../ClassicSpinner.vue\";\nimport { computed, onMounted, onUnmounted } from \"vue\";\nimport { usePlayerStore } from \"../../../../stores/PlayerStore\";\nimport { useVastStore } from \"../../../../stores/VastStore\";\nimport { useI18n } from \"vue-i18n\";\n\n//Props \ndefineProps({\n  playerError: { default: false, type: Boolean },\n  isBigButton: { default: false, type: Boolean },\n})\n\n//Composables\nconst { t } = useI18n();\nconst playerStore = usePlayerStore();\nconst vastStore = useVastStore();\n\n\n//Computed\nconst displayIsPlaying = computed(() => {\n  return (\n    (vastStore.isAdPlaying && !vastStore.isAdPaused) ||\n    (!vastStore.isAdPlaying && playerStore.isPlaying)\n  );\n});\nconst displayIsPaused = computed(() => {\n  return (\n    (vastStore.isAdPlaying && vastStore.isAdPaused) ||\n    (!vastStore.isAdPlaying && playerStore.isPaused)\n  );\n});\n\n\nonMounted(()=>window.addEventListener(\"keydown\", addKeyboardControl));\nonUnmounted(()=>window.removeEventListener(\"keydown\", addKeyboardControl))\n\n\n//Methods\nfunction addKeyboardControl(event: KeyboardEvent): void {\n  if (!event || null === event) {\n    return;\n  }\n  const element = event.target as HTMLElement;\n  if (\n    !element ||\n    \"INPUT\" == element.tagName.toUpperCase() ||\n    \"TEXTAREA\" == element.tagName.toUpperCase()\n  ) {\n    return;\n  }\n  if (\" \" === event.key || \"Spacebar\" === event.key) {\n    event.preventDefault();\n    switchPausePlay();\n    return;\n  }\n  if (vastStore.isAdPlaying) {\n    return;\n  }\n  if (\"ArrowRight\" === event.key && event.ctrlKey) {\n    changeCurrentTime(15);\n    return;\n  }\n  if (\"ArrowLeft\" === event.key && event.ctrlKey) {\n    changeCurrentTime(-15);\n  }\n}\nfunction changeCurrentTime(delay: number) {\n  const audioPlayer: HTMLAudioElement | null = document.querySelector(\"#audio-player\");\n  if (!audioPlayer) {\n    return;\n  }\n  audioPlayer.currentTime += delay;\n}\nfunction switchPausePlay(): void {\n  if (vastStore.isAdPlaying) {\n    vastStore.updateIsAdPaused(!vastStore.isAdPaused);\n    return;\n  }\n  const audioPlayer: HTMLAudioElement | null =document.querySelector(\"#audio-player\");\n  if (!audioPlayer) {\n    return;\n  }\n  playerStore.playerChangeStatus(!audioPlayer.paused);\n}\n</script>\n\n<style scoped lang=\"scss\">\n@use \"../../../../style/playButton\";\n\n.btn {\n  color: var(--octopus-player-btn-fg);\n  background-color: var(--octopus-player-btn-bg);\n}\n\n.play-button-box:not(.small-font) {\n  font-size: 1rem !important;\n}\n.play-big-button-box {\n  height: 5rem;\n  width: 5rem;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  margin: 0 0.5rem;\n  border-radius: 50% !important;\n  font-size: 2.5rem !important;\n  flex-shrink: 0;\n  cursor: pointer;\n}\n</style>\n","<template>\n  <button\n    v-if=\"!playerError\"\n    :title=\"t('Play')\"\n    :class=\"{\n      'p-0': !displayIsPaused && !displayIsPlaying,\n      'play-button-box': !isBigButton,\n      'play-big-button-box': isBigButton,\n    }\"\n    class=\"btn text-light\"\n    @click=\"switchPausePlay\"\n  >\n    <PlayIcon v-if=\"displayIsPaused\" :size=\"isBigButton ? 60 : 30\" />\n    <PauseIcon v-if=\"displayIsPlaying\" :size=\"isBigButton ? 60 : 30\" />\n    <ClassicSpinner\n      v-if=\"!displayIsPaused && !displayIsPlaying\"\n      :small=\"!isBigButton\"\n    />\n  </button>\n</template>\n<script setup lang=\"ts\">\nimport PlayIcon from \"vue-material-design-icons/Play.vue\";\nimport PauseIcon from \"vue-material-design-icons/Pause.vue\";\nimport ClassicSpinner from \"../../ClassicSpinner.vue\";\nimport { computed, onMounted, onUnmounted } from \"vue\";\nimport { usePlayerStore } from \"../../../../stores/PlayerStore\";\nimport { useVastStore } from \"../../../../stores/VastStore\";\nimport { useI18n } from \"vue-i18n\";\n\n//Props \ndefineProps({\n  playerError: { default: false, type: Boolean },\n  isBigButton: { default: false, type: Boolean },\n})\n\n//Composables\nconst { t } = useI18n();\nconst playerStore = usePlayerStore();\nconst vastStore = useVastStore();\n\n\n//Computed\nconst displayIsPlaying = computed(() => {\n  return (\n    (vastStore.isAdPlaying && !vastStore.isAdPaused) ||\n    (!vastStore.isAdPlaying && playerStore.isPlaying)\n  );\n});\nconst displayIsPaused = computed(() => {\n  return (\n    (vastStore.isAdPlaying && vastStore.isAdPaused) ||\n    (!vastStore.isAdPlaying && playerStore.isPaused)\n  );\n});\n\n\nonMounted(()=>window.addEventListener(\"keydown\", addKeyboardControl));\nonUnmounted(()=>window.removeEventListener(\"keydown\", addKeyboardControl))\n\n\n//Methods\nfunction addKeyboardControl(event: KeyboardEvent): void {\n  if (!event || null === event) {\n    return;\n  }\n  const element = event.target as HTMLElement;\n  if (\n    !element ||\n    \"INPUT\" == element.tagName.toUpperCase() ||\n    \"TEXTAREA\" == element.tagName.toUpperCase()\n  ) {\n    return;\n  }\n  if (\" \" === event.key || \"Spacebar\" === event.key) {\n    event.preventDefault();\n    switchPausePlay();\n    return;\n  }\n  if (vastStore.isAdPlaying) {\n    return;\n  }\n  if (\"ArrowRight\" === event.key && event.ctrlKey) {\n    changeCurrentTime(15);\n    return;\n  }\n  if (\"ArrowLeft\" === event.key && event.ctrlKey) {\n    changeCurrentTime(-15);\n  }\n}\nfunction changeCurrentTime(delay: number) {\n  const audioPlayer: HTMLAudioElement | null = document.querySelector(\"#audio-player\");\n  if (!audioPlayer) {\n    return;\n  }\n  audioPlayer.currentTime += delay;\n}\nfunction switchPausePlay(): void {\n  if (vastStore.isAdPlaying) {\n    vastStore.updateIsAdPaused(!vastStore.isAdPaused);\n    return;\n  }\n  const audioPlayer: HTMLAudioElement | null =document.querySelector(\"#audio-player\");\n  if (!audioPlayer) {\n    return;\n  }\n  playerStore.playerChangeStatus(!audioPlayer.paused);\n}\n</script>\n\n<style scoped lang=\"scss\">\n@use \"../../../../style/playButton\";\n\n.btn {\n  color: var(--octopus-player-btn-fg);\n  background-color: var(--octopus-player-btn-bg);\n}\n\n.play-button-box:not(.small-font) {\n  font-size: 1rem !important;\n}\n.play-big-button-box {\n  height: 5rem;\n  width: 5rem;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  margin: 0 0.5rem;\n  border-radius: 50% !important;\n  font-size: 2.5rem !important;\n  flex-shrink: 0;\n  cursor: pointer;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;AAIA,IAAa,6BAA2B;CAEtC,MAAM,cAAc,eAAe;CACnC,MAAM,YAAY,aAAa;CAoB/B,OAAO;EACL,iBAnBsB,eAAe;GACrC,IAAG,UAAU,aACX,OAAO,uBAAe,eAAe,KAAK,MAAM,UAAU,aAAa,CAAC;GAE1E,OAAO,YAAY;EACrB,CAcE;EACA,kBAbuB,eAAe;GACtC,IAAG,UAAU,aACX,OAAO,uBAAe,eAAe,KAAK,MAAM,UAAU,iBAAiB,CAAC;GAE9E,OAAO,YAAY;EACrB,CAQE;EACA,gBAPqB,eAAe;GACpC,OAAO,YAAY;EACrB,CAKE;EACA,UAAU,YAAY;EACtB,aAAa,UAAU;CACzB;AACF;;;;;;;;;;;;;;;;;;;;;ECRA,MAAM,QAAQ;EAOd,MAAM,gBAAgE,IAAI,KAAA,CAAS;EAGnF,MAAM,EAAE,MAAM,QAAQ;EACtB,MAAM,EAAE,oBAAoB,iBAAiB,cAAc;EAC3D,MAAM,cAAc,eAAe;EACnC,MAAM,YAAY,aAAa;EAI/B,MAAM,eAAe,eAAe;GAClC,IAAI,UAAU,aACZ,OAAO,EAAE,aAAa,IAAI,UAAU;GAEtC,IAAI,YAAY,aAAa;IAC3B,IAAI,YAAY,YAAY,SAC1B,OAAO,YAAY,YAAY,QAAQ;IAEzC,OAAO,aAAa,YAAY,YAAY,QAAQ;GACtD;GACA,IAAI,YAAY,eACd,OAAO,YAAY,cAAc;GAEnC,IAAI,YAAY,aACd,OAAO,YAAY,YAAY;GAEjC,IAAI,YAAY,YAAY;IAC1B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