Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
37 kB
2
Indexable
Never
window.popularMysteryObj = [
  {
    title: 'Shetland',
    link: '/us/show/Shetland_p05tb1sm',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=283110.jpg&imageType=tile",
    info: 'Show · 7 Seasons',
    description: 'Based on the best-selling books by award-winning writer Ann Cleeves, this fan-favorite crime drama follows Detective Jimmy Perez as he investigates crimes within the close-knit island community.',
  },
  {
    title: 'McDonald & Dodds',
    link: '/us/show/McDonald_and_Dodds_59989',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=285073.png&imageType=tile",
    info: 'Show · 2 Seasons',
    description: 'When two mismatched cops are partnered up, they instantly lock horns over their different approaches to policing – and to life.',
  },
  {
    title: 'Death in Paradise',
    link: '/us/show/Death_in_Paradise_b01pvmf6',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=211472.png&imageType=tile",
    info: 'Show · 12 Seasons',
    description: 'Welcome to the idyllic island of Saint Marie. With its beautiful tropical charm, you might mistake it for paradise...until you see its murder rate.',
  },
  {
    title: 'Silent Witness',
    link: '/us/show/Silent_Witness_b007y6k8',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=80&Width=405&Height=227&ImageUrl=230010.jpg&imageType=tile",
    info: 'Show · 25 Seasons',
    description: 'Every body tells a story. A crack team of forensic pathologists reveal the truth behind murders and accidental deaths.',
  },
  {
    title: 'Shakespeare & Hathaway - Private Investigators',
    link: '/us/show/Shakespeare_and_Hathaway_Private_Investigators_b09trrn9',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=213232.jpg&imageType=tile",
    info: 'Show · 4 Seasons',
    description:
      'The unlikely detective duo of Frank and Lu discover that not all is as peaceful as it seems in the picturesque Stratford-upon-Avon, where fact is stranger than fiction and low-life criminals get caught up in deliciously high drama.',
  },
  {
    title: 'Murder in Provence',
    link: '/us/show/Murder_in_Provence_73779',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=321588.jpg&imageType=tile",
    info: 'Show · 1 Season',
    description: 'Roger Allam and Nancy Carroll star in this delectable mystery. Antoine Verlaque and his spontaneous romantic partner Marine Bonnet solve crimes among the sun-drenched hills of southern France.',
  },
  {
    title: 'Father Brown',
    link: '/us/show/Father_Brown_b03pmw4m',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=284278.jpg&imageType=tile",
    info: 'Show · 9 Seasons',
    description: 'For this detective, the devil is in the details. Mark Williams stars as Father Brown, a clergyman with a particular talent for crime-solving.',
  },
  {
    title: 'The Bay',
    link: '/us/show/The_Bay_p07kgkwc',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=341426.jpg&imageType=tile",
    info: 'Show · 3 Seasons',
    description:
      'When Family Liaison Officer Lisa Armstrong is assigned to a missing persons investigations, it initially seems like any other - tragic, but all too familiar. This time, it is especially challenging for her not to get emotionally involved.',
  },
  {
    title: 'Vera',
    link: '/us/show/Vera_p053fylw',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=201950.jpg&imageType=tile",
    info: 'Show · 10 Seasons',
    description: 'Brenda Blethyn stars in this massive hit mystery based on the novels from award-winning author Ann Cleeves. Obsessed with her work, DCI Vera Stanhope deftly investigates murders only she can solve.',
  },
  {
    title: 'Sister Boniface Mysteries',
    link: '/us/show/Sister_Boniface_Mysteries_73774',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=319335.jpg&imageType=tile",
    info: 'Show · 1 Season',
    description: "First there was Father Brown. Now, say hello to Sister Boniface.  This clever, moped-riding nun is the police's secret weapon for solving murders in this divine Father Brown spin-off.",
  },
  {
    title: 'Traces',
    link: '/us/show/Traces_63419',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=302432.jpg&imageType=tile",
    info: 'Show · 2 Seasons',
    description: 'Breaking Bad’s Laura Fraser stars in this suspense-filled crime thriller driven by a personal tragedy and murder left unsolved - until now.',
  },
  {
    title: "Agatha Christie's Poirot",
    link: '/us/show/Agatha_Christies_Poirot_p04m8lr8',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=224684.jpg&imageType=tile",
    info: 'Show · 13 Seasons',
    description: "The complete collection. David Suchet stars as Agatha Christie's beloved detective Hercule Poirot, who pits his wits against crime and injustice in this collection of murder mysteries.",
  },
  {
    title: 'The Long Call',
    link: '/us/show/The_Long_Call_69699',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=309105.jpg&imageType=tile",
    info: 'Show · 1 Season',
    description: 'Based on Ann Cleeves’ bestselling novel, the intriguing and flawed DI Matthew Venn is led back into the community he left behind - and the deadly secrets that lurk there.',
  },
  {
    title: "Agatha Christie's Marple",
    link: '/us/show/Agatha_Christies_Marple_p04mbtzt',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=243469.jpg&imageType=tile",
    info: 'Show · 6 Seasons',
    description: 'With an unassuming demeanor that belies a razor sharp mind, Agatha Christie’s beloved amateur sleuth Miss Marple gets to the bottom of challenging cases that even confound the police.',
  },
  {
    title: 'New Tricks',
    link: '/us/show/New_Tricks_b006t0qx',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=255225.jpg&imageType=tile",
    info: 'Show · 12 Seasons',
    description: 'A crew of retired, old-school cops is recruited to re-investigate unsolved cases long gone cold.',
  },
  {
    title: 'The Tower',
    link: '/us/show/The_Tower_70088',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=312948.jpg&imageType=tile",
    info: 'Show · 1 Season',
    description: 'Gemma Whelan (Game of Thrones) and Jimmy Akingbola (Kate & Koji) star in this eye-opening crime thriller that explores the terrifying realities of life on duty.',
  },
];

window.newtoBritBox = [
  {
    title: 'Suspect',
    link: '/us/show/Suspect_89154',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=345160.jpg&imageType=tile",
    info: 'EPISODE 1· Season 1',
    description: 'James Nesbitt stars in this enthralling psychological drama, where detective Danny Frater sets out to uncover the cause of his daughter’s death.',
    newRibbon: 'New',
  },
  {
    title: 'The Thief, His Wife and the Canoe',
    link: '/us/show/The_Thief_His_Wife_and_the_Canoe_88330',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=80&Width=405&Height=227&ImageUrl=340530.jpg&imageType=tile",
    info: 'EPISODE 1· Season 1',
    description: '.',
    newRibbon: 'New',
  },
  {
    title: 'Murder in Suburbia',
    link: '/us/show/Murder_in_Suburbia_87807',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=80&Width=405&Height=227&ImageUrl=337408.jpg&imageType=tile",
    info: 'EPISODE 1· Season 1',
    description: 'Two quick-witted detectives solve brutal crimes in a sleepy suburban town.',
    newRibbon: 'New',
  },
  {
    title: 'Year of the Rabbit',
    link: '/us/show/Murder_in_Suburbia_87807',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=80&Width=405&Height=227&ImageUrl=336970.jpg&imageType=tile",
    info: 'EPISODE 1· Season 1',
    description: 'Matt Berry leads an all-star cast as Detective Inspector Rabbit, a hardened booze-hound who fights crime in Victorian London.',
    newRibbon: 'New',
  },
  {
    title: 'Redemption',
    link: '/us/show/Redemption_75460',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=80&Width=405&Height=227&ImageUrl=334219.jpg&imageType=tile",
    info: 'EPISODE 1· Season 1',
    description: 'From the producers of The Bay and Grace, this compelling new crime drama starring Ray Donovan’s Paula Malcomson is a powerful story about family and second chances.',
    newRibbon: 'New',
  },
  {
    title: "Why Didn't They Ask Evans?",
    link: '/us/show/Why_Didnt_They_Ask_Evans_68247#',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=80&Width=405&Height=227&ImageUrl=325069.jpg&imageType=tile",
    info: 'EPISODE 1· Season 1',
    description: "Agatha Christie's wittiest mystery ever. Lucy Boynton and Will Poulter star in Hugh Laurie’s new adaptation, where two amateur sleuths set out to find the meaning behind a dead man’s mysterious final words.",
    newRibbon: 'New',
  },
  {
    title: 'Murder in Provence',
    link: '/us/show/Murder_in_Provence_73779#',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=321588.jpg&imageType=tile",
    info: 'EPISODE 1· Season 1',
    description: 'Bienvenue en Provence! Among the sun-drenched hills of southern France, Antoine Verlaque and his spontaneous amoureuse, Marine Bonnet, solve crimes in the beautiful town of Aix.',
    newRibbon: 'New',
  },
  {
    title: 'Hope Street',
    link: '/us/show/Hope_Street_72532#',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=80&Width=405&Height=227&ImageUrl=330629.jpg&imageType=tile",
    info: 'EPISODE 1· Season 1',
    description: 'Amara Karan (Bancroft) stars in this uplifting original crime drama. A small town in Northern Ireland sees the mysterious arrival of English DC Leila Hussain, the first Muslim officer in the town’s history.',
    newRibbon: 'New',
  },
];

window.britboxOriginal = [
  {
    title: 'Murder in Provence',
    link: '/us/show/Murder_in_Provence_73779',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=321588.jpg&imageType=tile",
    info: 'Show · 1 Season ',
    description: 'Bienvenue en Provence! Among the sun-drenched hills of southern France, Antoine Verlaque and his spontaneous amoureuse, Marine Bonnet, solve crimes in the beautiful town of Aix.',
  },
  {
    title: 'The Bay',
    link: '/us/show/The_Bay_p07kgkwc',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=302259.jpg&imageType=tile",
    info: 'Show · 3 Seasons ',
    description:
      ' When Family Liaison Officer Lisa Armstrong is assigned to a missing persons investigations, it initially seems like any other - tragic, but all too familiar. This time, it is especially challenging for her not to get emotionally involved. ',
  },
  {
    title: 'Grace',
    link: '/us/show/Grace_65424',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=302291.jpg&imageType=tile",
    info: 'Show · 1 Season ',
    description: 'John Simm (Life on Mars) stars as tenacious yet troubled detective Roy Grace. As he walks a career tightrope, he is assigned to a missing person case. ',
  },
  {
    title: 'Sister Boniface Mysteries',
    link: '/us/show/Sister_Boniface_Mysteries_73774',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=319335.jpg&imageType=tile",
    info: 'Show · 1 Season ',
    description: "First there was Father Brown. Now, say hello to Sister Boniface. This clever, moped-riding nun is the police's secret weapon for solving murders in this divine Father Brown spin-off.",
  },
  {
    title: "Irvine Welsh's Crime",
    link: '/us/show/Irvine_Welshs_Crime_71638',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=312442.jpg&imageType=tile",
    info: 'Show · 1 Season ',
    description: ' From the creator of Trainspotting comes this highly anticipated detective drama. When a local girl goes missing, DI Ray Lennox investigates her disappearance while battling his own inner demons. ',
  },
  {
    title: 'The Long Call',
    link: '/us/show/The_Long_Call_69699',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=309105.jpg&imageType=tile",
    info: 'Show · 1 Season ',
    description: ' Based on Ann Cleeves’ bestselling novel, the intriguing and flawed DI Matthew Venn is led back into the community he left behind - and the deadly secrets that lurk there.',
  },
  {
    title: 'Reyka',
    link: '/us/show/Reyka_71591',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=311557.jpg&imageType=tile",
    info: 'Show · 1 Season ',
    description: 'Haunted by her past, flawed but brilliant criminal profiler Reyka Gama investigates brutal murders committed in the sugar cane fields of South Africa.',
  },
  {
    title: 'The Tower',
    link: '/us/show/The_Tower_70088',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=312948.jpg&imageType=tile",
    info: 'Show · 1 Season ',
    description: ' Gemma Whelan (Game of Thrones) and Jimmy Akingbola (Kate & Koji) star in this eye-opening crime thriller that explores the terrifying realities of life on duty. ',
  },
  {
    title: 'The Mallorca Files',
    link: '/us/show/The_Mallorca_Files_m000bqkm',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=80&Width=405&Height=227&ImageUrl=302709.jpg&imageType=tile",
    info: 'Show · 1 Season ',
    description: " From the award-winning writers of A Confession, Stephen Merchant portrays killer Stephen Port in this poignant true crime drama told from the perspective of the victims' families.",
  },
  {
    title: 'A Confession',
    link: '/us/show/A_Confession_p0891f13',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=308647.png&imageType=tile",
    info: 'Show · 1 Season ',
    description:
      'Martin Freeman stars in BAFTA-nominated true story of Detective Superintendent Stephen Fulcher, who heroically risks his good name to track down the culprit responsible for the disappearance of 22-year-old Sian O’Callaghan.',
  },
  {
    title: 'Wild Bill',
    link: '/us/show/Wild_Bill_59289',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=302524.jpg&imageType=tile",
    info: 'Show · 1 Season ',
    description: 'Six-time Golden Globe nominee Rob Lowe stars as once high-flying US police chief who relocates to East Lincolnshire, England to shake up the local police force, as well as his own life.',
  },
  {
    title: 'McDonald & Dodds',
    link: '/us/show/McDonald_and_Dodds_59989',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=285073.png&imageType=tile",
    info: 'Show · 1 Season ',
    description: ' When two mismatched cops are partnered up, they instantly lock horns over their different approaches to policing – and to life.',
  },
  {
    title: 'The Pembrokeshire Murders',
    link: '/us/show/The_Pembrokeshire_Murders_63921',
    img: "https://static.bbus-static.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=75&Width=391&Height=220&ImageUrl=302299.jpg&imageType=tile",
    info: 'Show · 1 Season ',
    description: 'The extraordinary true-to-life pursuit of the most notorious serial killer in Welsh history.',
  },
];

(function () {
  /* main variables */
  var debug = 0;
  var variation_name = '';
  /* all Pure helper functions */
  function waitForElement(selector, trigger, delayInterval, delayTimeout) {
    var interval = setInterval(function () {
      if (document && document.querySelector(selector) && document.querySelectorAll(selector).length > 0 && window.britboxOriginal && window.newtoBritBox && window.popularMysteryObj) {
        clearInterval(interval);
        trigger();
      }
    }, delayInterval);
    setTimeout(function () {
      clearInterval(interval);
    }, delayTimeout);
  }

  function getNewToBritboxHTML() {
    var html = '';
    for (var i = 0; i < window.newtoBritBox.length; i++) {
      html +=
        '' +
        '  <div class="swiper-slide">' +
        '      <div class="box">' +
        '          <div data-title="' +
        window.newtoBritBox[i].title +
        '" data-title-tracking="" data-colnumber="' +
        (i + 1) +
        '" class="card"><div class="ribbon Blue-normal">New</div>' +
        '              <a href="' +
        window.newtoBritBox[i].link +
        '">' +
        '                  <div class="image pulsate loaded">' +
        '                      <img src="' +
        window.newtoBritBox[i].img +
        '" class="b-lazy b-loaded" />' +
        '                  </div>' +
        '              </a>' +
        '              <div class="card-content">' +
        '                  <div class="card-content-inside">' +
        '                      <div class="description">' +
        '                          <div class="top-animation">' +
        '                              <a href="' +
        window.newtoBritBox[i].link +
        '">' +
        '                                  <div class="top">' +
        window.newtoBritBox[i].title +
        '</div>' +
        '                                  <div class="inner-content">' +
        '                                      <div class="season">' +
        '                                          <div class="description">' +
        window.newtoBritBox[i].description +
        '</div>' +
        '                                          <div class="more-info">' +
        window.newtoBritBox[i].info +
        '</div>' +
        '                                      </div>' +
        '                                  </div>' +
        '                              </a>' +
        '                          </div>' +
        '                          <div class="actions bottom">' +
        '                              <a href="' +
        window.newtoBritBox[i].link +
        '" class="play-now">' +
        '                                  <span class="play-animation">' +
        '                                      <img src="/content/img/action-svg/play_now.svg" /> ' +
        '                                      <img src="/content/img/action-svg/continue_watching.svg" style="display: none" /> ' +
        '                                      <img src="/content/img/action-svg/trailer.svg" style="display: none" />' +
        '                                  </span>' +
        '                                  <span>Play now </span></a>' +
        '                              <a href="' +
        window.newtoBritBox[i].link +
        '" class="discover"><i class="icon-discover-more"></i> <span>Discover more</span></a>' +
        '                          </div>' +
        '                      </div>' +
        '                  </div>' +
        '              </div>' +
        '          </div>' +
        '      </div>' +
        '  </div>';
    }
    return (
      '  <div data-name-component="ProgrammeCarousel" class="swiper episodes new-episodes new-to-britbox">' +
      '      <div class="row">' +
      '          <div class="columns">' +
      '              <div class="top-wrapper">' +
      '                  <h2 class="title">New to BritBox</h2>' +
      '                  <div class="swiper-pagination swiper-pagination-clickable swiper-pagination-bullets">' +
      '                      <span class="swiper-pagination-bullet swiper-pagination-bullet-active" tabindex="0" role="button" aria-label="Go to slide 1"></span' +
      '            ><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 2"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 3"></span' +
      '            ><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 4"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 5"></span>' +
      '                  </div>' +
      '              </div>' +
      '          </div>' +
      '      </div>' +
      '      <div class="row">' +
      '          <div class="columns">' +
      '              <div class="swiper-horizontal">' +
      '                  <div data-slides-per-view="4" data-slides-per-group="4" class="swiper-container swiper-container-initialized swiper-container-horizontal eg-my-swiper">' +
      '                      <div class="swiper-wrapper init-via-slick">' +
      html +
      '</div>' +
      '                      <div class="swiper-button-next" tabindex="0" role="button" aria-label="Next slide" aria-disabled="false"></div>' +
      '                      <div class="swiper-button-prev swiper-button-disabled" tabindex="0" role="button" aria-label="Previous slide" aria-disabled="true"></div>' +
      '                      <span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span> <span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span>' +
      '                  </div>' +
      '              </div>' +
      '          </div>' +
      '      </div>' +
      '  </div>'
    );
  }

  function getPopularMisteryHTML() {
    var html = '';
    for (var i = 0; i < window.popularMysteryObj.length; i++) {
      html +=
        '' +
        '  <div class="swiper-slide">' +
        '      <div class="box">' +
        '          <div data-title="' +
        window.popularMysteryObj[i].title +
        '" data-title-tracking="" data-colnumber="' +
        (i + 1) +
        '" class="card">' +
        '              <a href="' +
        window.popularMysteryObj[i].link +
        '">' +
        '                  <div class="image pulsate loaded">' +
        '                      <img src="' +
        window.popularMysteryObj[i].img +
        '" class="b-lazy b-loaded" />' +
        '                  </div>' +
        '              </a>' +
        '              <div class="card-content">' +
        '                  <div class="card-content-inside">' +
        '                      <div class="description">' +
        '                          <div class="top-animation">' +
        '                              <a href="' +
        window.popularMysteryObj[i].link +
        '">' +
        '                                  <div class="top">' +
        window.popularMysteryObj[i].title +
        '</div>' +
        '                                  <div class="inner-content">' +
        '                                      <div class="season">' +
        '                                          <div class="description">' +
        window.popularMysteryObj[i].description +
        '</div>' +
        '                                          <div class="more-info">' +
        window.popularMysteryObj[i].info +
        '</div>' +
        '                                      </div>' +
        '                                  </div>' +
        '                              </a>' +
        '                          </div>' +
        '                          <div class="actions bottom">' +
        '                              <a href="' +
        window.popularMysteryObj[i].link +
        '" class="play-now">' +
        '                                  <span class="play-animation">' +
        '                                      <img src="/content/img/action-svg/play_now.svg" /> ' +
        '                                      <img src="/content/img/action-svg/continue_watching.svg" style="display: none" /> ' +
        '                                      <img src="/content/img/action-svg/trailer.svg" style="display: none" />' +
        '                                  </span>' +
        '                                  <span>Play now </span></a>' +
        '                              <a href="' +
        window.popularMysteryObj[i].link +
        '" class="discover"><i class="icon-discover-more"></i> <span>Discover more</span></a>' +
        '                          </div>' +
        '                      </div>' +
        '                  </div>' +
        '              </div>' +
        '          </div>' +
        '      </div>' +
        '  </div>';
    }
    return (
      '  <div data-name-component="ProgrammeCarousel" class="swiper episodes new-episodes popular-mystery">' +
      '      <div class="row">' +
      '          <div class="columns">' +
      '              <div class="top-wrapper">' +
      '                  <h2 class="title">Popular Mystery</h2>' +
      '                  <div class="swiper-pagination swiper-pagination-clickable swiper-pagination-bullets">' +
      '                      <span class="swiper-pagination-bullet swiper-pagination-bullet-active" tabindex="0" role="button" aria-label="Go to slide 1"></span' +
      '            ><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 2"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 3"></span' +
      '            ><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 4"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 5"></span>' +
      '                  </div>' +
      '              </div>' +
      '          </div>' +
      '      </div>' +
      '      <div class="row">' +
      '          <div class="columns">' +
      '              <div class="swiper-horizontal">' +
      '                  <div data-slides-per-view="4" data-slides-per-group="4" class="swiper-container swiper-container-initialized swiper-container-horizontal eg-my-swiper">' +
      '                      <div class="swiper-wrapper init-via-slick">' +
      html +
      '</div>' +
      '                      <div class="swiper-button-next" tabindex="0" role="button" aria-label="Next slide" aria-disabled="false"></div>' +
      '                      <div class="swiper-button-prev swiper-button-disabled" tabindex="0" role="button" aria-label="Previous slide" aria-disabled="true"></div>' +
      '                      <span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span> <span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span>' +
      '                  </div>' +
      '              </div>' +
      '          </div>' +
      '      </div>' +
      '  </div>'
    );
  }

  function getBritboxOriginalHTML() {
    var html = '';
    for (var i = 0; i < window.britboxOriginal.length; i++) {
      html +=
        '' +
        '  <div class="swiper-slide">' +
        '      <div class="box">' +
        '          <div data-title="' +
        window.britboxOriginal[i].title +
        '" data-title-tracking="" data-colnumber="' +
        (i + 1) +
        '" class="card">' +
        '              <a href="' +
        window.britboxOriginal[i].link +
        '">' +
        '                  <div class="image pulsate loaded">' +
        '                      <img src="' +
        window.britboxOriginal[i].img +
        '" class="b-lazy b-loaded" />' +
        '                  </div>' +
        '              </a>' +
        '              <div class="card-content">' +
        '                  <div class="card-content-inside">' +
        '                      <div class="description">' +
        '                          <div class="top-animation">' +
        '                              <a href="' +
        window.britboxOriginal[i].link +
        '">' +
        '                                  <div class="top">' +
        window.britboxOriginal[i].title +
        '</div>' +
        '                                  <div class="inner-content">' +
        '                                      <div class="season">' +
        '                                          <div class="description">' +
        window.britboxOriginal[i].description +
        '</div>' +
        '                                          <div class="more-info">' +
        window.britboxOriginal[i].info +
        '</div>' +
        '                                      </div>' +
        '                                  </div>' +
        '                              </a>' +
        '                          </div>' +
        '                          <div class="actions bottom">' +
        '                              <a href="' +
        window.britboxOriginal[i].link +
        '" class="play-now">' +
        '                                  <span class="play-animation">' +
        '                                      <img src="/content/img/action-svg/play_now.svg" /> ' +
        '                                      <img src="/content/img/action-svg/continue_watching.svg" style="display: none" /> ' +
        '                                      <img src="/content/img/action-svg/trailer.svg" style="display: none" />' +
        '                                  </span>' +
        '                                  <span>Play now </span></a>' +
        '                              <a href="' +
        window.britboxOriginal[i].link +
        '" class="discover"><i class="icon-discover-more"></i> <span>Discover more</span></a>' +
        '                          </div>' +
        '                      </div>' +
        '                  </div>' +
        '              </div>' +
        '          </div>' +
        '      </div>' +
        '  </div>';
    }
    return (
      '  <div data-name-component="ProgrammeCarousel" class="swiper episodes new-episodes">' +
      '      <div class="row">' +
      '          <div class="columns">' +
      '              <div class="top-wrapper">' +
      '                  <h2 class="title">Britbox Original</h2>' +
      '                  <div class="swiper-pagination swiper-pagination-clickable swiper-pagination-bullets">' +
      '                      <span class="swiper-pagination-bullet swiper-pagination-bullet-active" tabindex="0" role="button" aria-label="Go to slide 1"></span' +
      '            ><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 2"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 3"></span' +
      '            ><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 4"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 5"></span>' +
      '                  </div>' +
      '              </div>' +
      '          </div>' +
      '      </div>' +
      '      <div class="row">' +
      '          <div class="columns">' +
      '              <div class="swiper-horizontal">' +
      '                  <div data-slides-per-view="4" data-slides-per-group="4" class="swiper-container swiper-container-initialized swiper-container-horizontal eg-my-swiper">' +
      '                      <div class="swiper-wrapper init-via-slick">' +
      html +
      '</div>' +
      '                      <div class="swiper-button-next" tabindex="0" role="button" aria-label="Next slide" aria-disabled="false"></div>' +
      '                      <div class="swiper-button-prev swiper-button-disabled" tabindex="0" role="button" aria-label="Previous slide" aria-disabled="true"></div>' +
      '                      <span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span> <span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span>' +
      '                  </div>' +
      '              </div>' +
      '          </div>' +
      '      </div>' +
      '  </div>'
    );
  }

  function init() {
    document.querySelector('.main-content > .episodes.new-episodes:nth-child(5)').insertAdjacentHTML('beforebegin', getNewToBritboxHTML());

    document.querySelector('.main-content > .episodes.new-episodes:nth-child(7)').insertAdjacentHTML('beforebegin', getBritboxOriginalHTML());

    document.querySelector('.main-content .new-to-britbox').insertAdjacentHTML('beforebegin', getPopularMisteryHTML());

    waitForElement(
      '[data-name-component="ProgrammeCarousel"] .swiper-container-initialized.swiper-container:not(.eg-my-swiper)',
      function () {
        document.querySelectorAll('[data-name-component="ProgrammeCarousel"] .swiper-container:not(.eg-my-swiper)').forEach(function (item) {
          let slider = item.swiper;
          slider.destroy();
        });

        waitForjQuery(function () {
          addScript();
          waitForSlick(function () {
            var $ = window.jQuery;
            $('[data-name-component="ProgrammeCarousel"] .swiper-container:not(.eg-my-swiper) .swiper-wrapper').slick({
              dots: false,
              infinite: true,
              speed: 300,
              slidesToShow: 4,
              slidesToScroll: 4,
              centerMode: false,
              responsive: [
                {
                  breakpoint: 767,
                  settings: {
                    slidesToShow: 1,
                    slidesToScroll: 1,
                    centerMode: true,
                  },
                },
              ],
            });
            $('[data-name-component="ProgrammeCarousel"] .swiper-container:not(.eg-my-swiper) .swiper-wrapper').on('beforeChange', function (event, slick, currentSlide, nextSlide) {
              setTimeout(function () {
                window.scroll(0, window.pageYOffset + 1);
              }, 200);
            });
          });
        });
      },
      50,
      10000
    );
  }

  function waitForSlick(trigger) {
    var interval = setInterval(function () {
      if (window.jQuery.fn.slick != undefined) {
        clearInterval(interval);
        trigger();
      }
    }, 50);
    setTimeout(function () {
      clearInterval(interval);
    }, 15000);
  }

  function waitForjQuery(trigger) {
    var interval = setInterval(function () {
      if (window.jQuery != undefined) {
        clearInterval(interval);
        trigger();
      }
    }, 50);
    setTimeout(function () {
      clearInterval(interval);
    }, 15000);
  }

  function addScript() {
    var cssScript = '' + "<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.css'/>";
    document.querySelector('head').insertAdjacentHTML('beforeend', cssScript);
    var swiperScript = document.createElement('script');
    swiperScript.src = 'https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js';
    document.getElementsByTagName('head')[0].appendChild(swiperScript);
  }

  waitForElement('.main-content [data-name-component="HeroCarousel"] .swiper-container', init, 50, 10000);
})();