import { UniversalMediaType as u } from "./accelbyte-widgets149.mjs";
class o {
  static getYoutubeScreenshot(t) {
    const e = o.extractYoutubeId(t);
    return e && o.getYoutubeScreenshotLinkFromVideoId(e) || null;
  }
  static getMediaScreenshot(t) {
    return t.type === u.YOUTUBE_VIDEO ? o.getYoutubeScreenshot(t.content) : t.content;
  }
  static extractYoutubeId(t) {
    const e = t.match(
      /(?:youtube(?:-nocookie)?\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/
    );
    return e && e[1] || null;
  }
  static getYoutubeScreenshotLinkFromVideoId(t) {
    return `https://img.youtube.com/vi/${t}/maxresdefault.jpg`;
  }
}
export {
  o as UniversalMediaHelper
};
