{"version":3,"file":"movie.helper.cjs","names":["getColor","parseISO8601Duration","addProtocol","parseIdFromUrl","parseLastIdFromUrl","parseFilmType","parseDate"],"sources":["../../src/helpers/movie.helper.ts"],"sourcesContent":["import { HTMLElement } from 'node-html-parser';\nimport type { CSFDColorRating, CSFDFilmTypes } from '../dto/global';\nimport type {\n  CSFDBoxContent,\n  CSFDCreatorGroups,\n  CSFDCreatorGroupsEnglish,\n  CSFDCreatorGroupsSlovak,\n  CSFDCreators,\n  CSFDGenres,\n  CSFDMovieCreator,\n  CSFDMovieListItem,\n  CSFDParent,\n  CSFDPremiere,\n  CSFDSeriesChild,\n  CSFDTitlesOther,\n  CSFDVod,\n  CSFDVodService,\n  MovieJsonLd\n} from '../dto/movie';\nimport type { CSFDOptions } from '../types';\nimport {\n  addProtocol,\n  getColor,\n  parseDate,\n  parseFilmType,\n  parseISO8601Duration,\n  parseIdFromUrl,\n  parseLastIdFromUrl\n} from './global.helper';\n\n// Performance Optimization: Extract regex literal from loop map callbacks\n// This avoids redundant recompilation per iteration.\nconst CLEAN_TEXT_REGEX = /(\\r\\n|\\n|\\r|\\t)/gm;\n\nconst CREATOR_LABELS: Record<\n  string,\n  Record<string, CSFDCreatorGroups | CSFDCreatorGroupsEnglish | CSFDCreatorGroupsSlovak>\n> = {\n  en: {\n    directors: 'Directed by',\n    writers: 'Screenplay',\n    cinematography: 'Cinematography',\n    music: 'Composer',\n    actors: 'Cast',\n    basedOn: 'Based on',\n    producers: 'Produced by',\n    filmEditing: 'Editing',\n    costumeDesign: 'Costumes',\n    productionDesign: 'Production design',\n    casting: 'Casting',\n    sound: 'Sound',\n    makeup: 'Make-up'\n  },\n  cs: {\n    directors: 'Režie',\n    writers: 'Scénář',\n    cinematography: 'Kamera',\n    music: 'Hudba',\n    actors: 'Hrají',\n    basedOn: 'Předloha',\n    producers: 'Produkce',\n    filmEditing: 'Střih',\n    costumeDesign: 'Kostýmy',\n    productionDesign: 'Scénografie',\n    casting: 'Casting',\n    sound: 'Zvuk',\n    makeup: 'Masky'\n  },\n  sk: {\n    directors: 'Réžia',\n    writers: 'Scenár',\n    cinematography: 'Kamera',\n    music: 'Hudba',\n    actors: 'Hrajú',\n    basedOn: 'Predloha',\n    producers: 'Produkcia',\n    filmEditing: 'Strih',\n    costumeDesign: 'Kostýmy',\n    productionDesign: 'Scénografia',\n    casting: 'Casting',\n    sound: 'Zvuk',\n    makeup: 'Masky'\n  }\n};\n\n/**\n * Maps language-specific movie creator group labels.\n * @param language - The language code (e.g., 'en', 'cs')\n * @param key - The key of the creator group (e.g., 'directors', 'writers')\n * @returns The localized label for the creator group\n */\nconst CREATOR_KEYS = [\n  'directors',\n  'writers',\n  'cinematography',\n  'music',\n  'actors',\n  'basedOn',\n  'producers',\n  'filmEditing',\n  'costumeDesign',\n  'productionDesign',\n  'sound'\n] as const;\n\n// ⚡ Bolt Performance Optimization:\n// Precomputed reverse map for O(1) creator group lookups instead of dynamic mapping and O(N) string includes checking inside a loop.\nconst REVERSE_CREATOR_LABELS = (() => {\n  const map = new Map<string, (typeof CREATOR_KEYS)[number]>();\n  for (const lang of Object.values(CREATOR_LABELS)) {\n    for (const key of CREATOR_KEYS) {\n      if (lang[key]) {\n        map.set(lang[key] as string, key);\n      }\n    }\n  }\n  return map;\n})();\n\nexport const getLocalizedCreatorLabel = (\n  language: string | undefined,\n  key:\n    | 'directors'\n    | 'writers'\n    | 'cinematography'\n    | 'music'\n    | 'actors'\n    | 'basedOn'\n    | 'producers'\n    | 'filmEditing'\n    | 'costumeDesign'\n    | 'productionDesign'\n    | 'casting'\n    | 'sound'\n    | 'makeup'\n): CSFDCreatorGroups | CSFDCreatorGroupsEnglish | CSFDCreatorGroupsSlovak => {\n  const lang = language || 'cs'; // Default to Czech\n  return (CREATOR_LABELS[lang] || CREATOR_LABELS['cs'])[key];\n};\n\nexport const getMovieId = (el: HTMLElement): number => {\n  const url = el.querySelector('.tabs .tab-nav-list a').attributes.href;\n  return parseIdFromUrl(url);\n};\n\nexport const getSeriesAndSeasonTitle = (\n  el: HTMLElement\n): { seriesName: string | null; seasonName: string | null } => {\n  const titleElement = el.querySelector('h1');\n  if (!titleElement) {\n    return { seriesName: null, seasonName: null };\n  }\n\n  const fullText = titleElement.innerText.trim();\n\n  // Check if there's a series part indicated by ' - '\n  if (fullText.includes(' - ')) {\n    const [seriesName, seasonName] = fullText.split(' - ').map((part) => part.trim());\n    return { seriesName, seasonName };\n  }\n\n  // If no series part found, return just the name\n  return { seriesName: fullText, seasonName: null };\n};\n\nexport const getMovieTitle = (el: HTMLElement): string => {\n  return el.querySelector('h1').innerText.split(`(`)[0].trim();\n};\n\nexport const getMovieGenres = (el: HTMLElement): CSFDGenres[] => {\n  const genresNode = el.querySelector('.genres');\n  if (!genresNode) return [];\n  return genresNode.childNodes\n    .map((n) => n.textContent.trim())\n    .filter((x) => x.length > 0) as CSFDGenres[];\n};\n\nexport const getMovieOrigins = (el: HTMLElement): string[] => {\n  const originNode = el.querySelector('.origin');\n  if (!originNode) return [];\n  const text = originNode.childNodes[0]?.text || '';\n  return text\n    .split('/')\n    .map((x) => x.trim())\n    .filter((x) => x);\n};\n\nexport const getMovieColorRating = (bodyClasses: string[]): CSFDColorRating => {\n  return getColor(bodyClasses[1]);\n};\n\nexport const getMovieRating = (el: HTMLElement): number => {\n  const ratingRaw = el.querySelector('.film-rating-average')?.textContent;\n  const rating = ratingRaw?.replace(/%/g, '')?.trim();\n  const ratingInt = parseInt(rating);\n\n  if (Number.isInteger(ratingInt)) {\n    return ratingInt;\n  } else {\n    return null;\n  }\n};\n\nexport const getMovieRatingCount = (el: HTMLElement): number => {\n  const ratingCountRaw = el.querySelector('.ratings-list .counter')?.textContent;\n  if (!ratingCountRaw) return null;\n  const countString = ratingCountRaw.replace(/[^\\d]/g, '');\n  const ratingCount = parseInt(countString, 10);\n  if (Number.isInteger(ratingCount)) {\n    return ratingCount;\n  } else {\n    return null;\n  }\n};\n\nexport const getMovieYear = (jsonLd: MovieJsonLd | null): number => {\n  if (jsonLd && jsonLd.dateCreated) {\n    return +jsonLd.dateCreated;\n  }\n  return null;\n};\n\nexport const getMovieDuration = (jsonLd: MovieJsonLd | null, el: HTMLElement): number => {\n  if (jsonLd && jsonLd.duration) {\n    try {\n      return parseISO8601Duration(jsonLd.duration);\n    } catch (e) {\n      // ignore\n    }\n  }\n\n  try {\n    const originText = el.querySelector('.origin')?.textContent;\n    if (originText) {\n      const match = originText.match(/(?:(\\d+)\\s*h)?\\s*(\\d+)\\s*min/);\n      if (match) {\n        const hours = parseInt(match[1] || '0', 10);\n        const minutes = parseInt(match[2] || '0', 10);\n        return hours * 60 + minutes;\n      }\n    }\n  } catch (error) {\n    return null;\n  }\n  return null;\n};\n\nexport const getMovieTitlesOther = (el: HTMLElement): CSFDTitlesOther[] => {\n  const namesNode = el.querySelectorAll('.film-names li');\n\n  if (!namesNode.length) {\n    return [];\n  }\n\n  const titlesOther = namesNode.map((el) => {\n    const country = el.querySelector('img.flag').attributes.alt;\n    const title = el.textContent.trim().split('\\n')[0];\n\n    if (country && title) {\n      return {\n        country,\n        title\n      };\n    } else {\n      return null;\n    }\n  });\n\n  return titlesOther.filter((x) => x);\n};\n\nexport const getMoviePoster = (el: HTMLElement | null): string => {\n  const poster = el.querySelector('.film-posters img');\n  // Resolve empty image\n  if (poster) {\n    if (poster.classNames?.includes('empty-image')) {\n      return null;\n    } else {\n      // Full sized image (not thumb)\n      const imageThumb = poster.attributes.src.split('?')[0];\n      const image = imageThumb.replace(/\\/w140\\//, '/w1080/');\n      return addProtocol(image);\n    }\n  } else {\n    return null;\n  }\n};\n\nexport const getMovieRandomPhoto = (el: HTMLElement | null): string => {\n  const imageNode = el.querySelector('.gallery-item picture img');\n  const image = imageNode?.attributes?.src;\n  if (image) {\n    return image.replace(/\\/w663\\//, '/w1326/');\n  } else {\n    return null;\n  }\n};\n\nexport const getMovieTrivia = (el: HTMLElement | null): string[] => {\n  const triviaNodes = el.querySelectorAll('.article-trivia ul li');\n  if (triviaNodes?.length) {\n    return triviaNodes.map((node) => node.textContent.trim().replace(CLEAN_TEXT_REGEX, ''));\n  } else {\n    return null;\n  }\n};\n\nexport const getMovieDescriptions = (el: HTMLElement): string[] => {\n  return el\n    .querySelectorAll('.body--plots .plot-full p, .body--plots .plots .plots-item p')\n    .map((movie) => movie.textContent?.trim().replace(CLEAN_TEXT_REGEX, ''));\n};\n\nconst parseMoviePeople = (el: HTMLElement): CSFDMovieCreator[] => {\n  const people = el.querySelectorAll('a');\n  return (\n    people\n      // Filter out \"more\" links\n      .filter((x) => x.classNames.length === 0)\n      .map((person) => {\n        return {\n          id: parseIdFromUrl(person.attributes.href),\n          name: person.innerText.trim(),\n          url: `https://www.csfd.cz${person.attributes.href}`\n        };\n      })\n  );\n};\n\n// export const getMovieGroup = (el: HTMLElement, group: CSFDCreatorGroups | CSFDCreatorGroupsEnglish | CSFDCreatorGroupsSlovak): CSFDMovieCreator[] => {\n//   const creators = el.querySelectorAll('.creators h4');\n//   const element = creators.filter((elem) => elem.textContent.trim().includes(group))[0];\n//   if (element?.parentNode) {\n//     return parseMoviePeople(element.parentNode as HTMLElement);\n//   } else {\n//     return [];\n//   }\n// };\n\nexport const getMovieCreators = (el: HTMLElement, options?: CSFDOptions): CSFDCreators => {\n  const creators: CSFDCreators = {\n    directors: [],\n    writers: [],\n    cinematography: [],\n    music: [],\n    actors: [],\n    basedOn: [],\n    producers: [],\n    filmEditing: [],\n    costumeDesign: [],\n    productionDesign: [],\n    sound: []\n  };\n\n  const groups = el.querySelectorAll('.creators h4');\n\n  for (const group of groups) {\n    let text = group.textContent.trim();\n    if (text.endsWith(':')) {\n      text = text.slice(0, -1);\n    }\n    const key = REVERSE_CREATOR_LABELS.get(text);\n    if (key) {\n      if (group.parentNode) {\n        creators[key] = parseMoviePeople(group.parentNode as HTMLElement);\n      }\n    }\n  }\n\n  return creators;\n};\n\nexport const getSeasonsOrEpisodes = (el: HTMLElement): CSFDSeriesChild[] | null => {\n  const childrenList = el.querySelector('.film-episodes-list');\n  if (!childrenList) return null;\n\n  const childrenNodes = childrenList.querySelectorAll('.film-title-inline');\n  if (!childrenNodes?.length) return [];\n\n  return childrenNodes.map((season) => {\n    const nameContainer = season.querySelector('.film-title-name');\n    const infoContainer = season.querySelector('.info');\n\n    const href = nameContainer?.getAttribute('href');\n    const url = href ? (href.startsWith('/') ? `https://www.csfd.cz${href}` : href) : null;\n\n    return {\n      id: parseLastIdFromUrl(href || ''),\n      title: nameContainer?.textContent?.trim() || null,\n      url,\n      info: infoContainer?.textContent?.replace(/[{()}]/g, '').trim() || null\n    };\n  });\n};\n\nexport const getEpisodeCode = (el: HTMLElement): string | null => {\n  const filmHeaderName = el.querySelector('.film-header-name h1');\n  if (!filmHeaderName) return null;\n\n  const text = filmHeaderName.textContent?.trim() || '';\n  const match = text.match(/\\(([^)]+)\\)/);\n  const code = match ? match[1] : null;\n\n  return code;\n};\n\nexport const detectSeasonOrEpisodeListType = (el: HTMLElement) => {\n  const episodesList = el.querySelector('.film-episodes-list');\n  if (!episodesList) return null;\n\n  const section = episodesList.closest('.updated-box') || episodesList.closest('section') || el;\n  const headerText = section.querySelector('.updated-box-header h3')?.textContent?.trim() ?? '';\n\n  if (headerText.includes('Série')) return 'seasons';\n  if (headerText.includes('Epizody')) return 'episodes';\n  return null;\n};\n\nexport const getSeasonOrEpisodeParent = (el: HTMLElement): CSFDParent | null => {\n  let parents = el.querySelectorAll('.film-series-content h2 a');\n  if (parents.length === 0) parents = el.querySelectorAll('.film-header-name h1 a');\n  if (parents.length === 0) return null;\n\n  const [parentSeries, parentSeason] = parents;\n\n  const seriesId = parseIdFromUrl(parentSeries?.getAttribute('href'));\n  const seasonId = parseLastIdFromUrl(parentSeason?.getAttribute('href') || '');\n  const seriesTitle = parentSeries?.textContent?.trim() || null;\n  const seasonTitle = parentSeason?.textContent?.trim() || null;\n\n  const series = seriesId && seriesTitle ? { id: seriesId, title: seriesTitle } : null;\n  const season = seasonId && seasonTitle ? { id: seasonId, title: seasonTitle } : null;\n\n  if (!series && !season) return null;\n\n  return { series, season };\n};\n\nexport const getMovieGroup = (\n  el: HTMLElement,\n  group: CSFDCreatorGroups | CSFDCreatorGroupsEnglish | CSFDCreatorGroupsSlovak\n): CSFDMovieCreator[] => {\n  const creators = el.querySelectorAll('.creators h4');\n  const element = creators.find((elem) => elem.textContent.trim().includes(group as string));\n  if (element?.parentNode) {\n    return parseMoviePeople(element.parentNode as HTMLElement);\n  } else {\n    return [];\n  }\n};\n\nexport const getMovieType = (el: HTMLElement): CSFDFilmTypes => {\n  const type = el.querySelector('.film-header-name .type');\n  const text =\n    type?.innerText\n      ?.replace(/[{()}]/g, '')\n      .split('\\n')[0]\n      .trim() || 'film';\n  return parseFilmType(text);\n};\n\nexport const getMovieVods = (el: HTMLElement | null): CSFDVod[] => {\n  let vods: CSFDVod[] = [];\n  if (el) {\n    const buttonsVod = el.querySelectorAll('.box-film-vod .vod-badge-link');\n    vods = buttonsVod.map((btn) => {\n      return {\n        title: btn.textContent.trim() as CSFDVodService,\n        url: btn.attributes.href\n      };\n    });\n  }\n  return vods.length ? vods : [];\n};\n\n// Get box content\nconst getBoxContent = (el: HTMLElement, box: string): HTMLElement => {\n  const headers = el.querySelectorAll('section .updated-box-header');\n  return headers.find(\n    (header) =>\n      header.querySelector('h3')?.textContent.trim() === box ||\n      header.querySelector('h2')?.textContent.trim() === box\n  )?.parentNode;\n};\n\nexport const getMovieBoxMovies = (\n  el: HTMLElement,\n  boxName: CSFDBoxContent\n): CSFDMovieListItem[] => {\n  const movieListItem: CSFDMovieListItem[] = [];\n  const box = getBoxContent(el, boxName);\n  const movieTitleNodes = box?.querySelectorAll('.article-header .film-title-name');\n  if (movieTitleNodes?.length) {\n    for (const item of movieTitleNodes) {\n      movieListItem.push({\n        id: parseIdFromUrl(item.attributes.href),\n        title: item.textContent.trim(),\n        url: `https://www.csfd.cz${item.attributes.href}`\n      });\n    }\n  }\n  return movieListItem;\n};\n\nexport const getMoviePremieres = (el: HTMLElement): CSFDPremiere[] => {\n  const premiereNodes = el.querySelectorAll('.box-premieres li');\n  const premiere: CSFDPremiere[] = [];\n  for (const premiereNode of premiereNodes) {\n    const title = premiereNode.querySelector('p + span').attributes.title;\n\n    if (title) {\n      const [dateRaw, ...company] = title?.split(' ');\n      const date = parseDate(dateRaw);\n\n      if (date) {\n        premiere.push({\n          country: premiereNode.querySelector('.flag')?.attributes.title || null,\n          format: premiereNode.querySelector('p').textContent.trim()?.split(' od')[0],\n          date,\n          company: company.join(' ')\n        });\n      }\n    }\n  }\n  return premiere;\n};\n\nexport const getMovieTags = (el: HTMLElement): string[] => {\n  const tagsNodes = el.querySelectorAll('.updated-box-content-tags a');\n  return tagsNodes.map((tag) => tag.textContent.trim());\n};\n"],"mappings":";;AAgCA,MAAM,mBAAmB;AAEzB,MAAM,iBAGF;CACF,IAAI;EACF,WAAW;EACX,SAAS;EACT,gBAAgB;EAChB,OAAO;EACP,QAAQ;EACR,SAAS;EACT,WAAW;EACX,aAAa;EACb,eAAe;EACf,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;CACV;CACA,IAAI;EACF,WAAW;EACX,SAAS;EACT,gBAAgB;EAChB,OAAO;EACP,QAAQ;EACR,SAAS;EACT,WAAW;EACX,aAAa;EACb,eAAe;EACf,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;CACV;CACA,IAAI;EACF,WAAW;EACX,SAAS;EACT,gBAAgB;EAChB,OAAO;EACP,QAAQ;EACR,SAAS;EACT,WAAW;EACX,aAAa;EACb,eAAe;EACf,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;CACV;AACF;;;;;;;AAQA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAM,gCAAgC;CACpC,MAAM,sBAAM,IAAI,IAA2C;CAC3D,KAAK,MAAM,QAAQ,OAAO,OAAO,cAAc,GAC7C,KAAK,MAAM,OAAO,cAChB,IAAI,KAA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