function findFragmentByPDT(fragments, PDTValue, maxFragLookUpTolerance) {
  if (PDTValue === null || !Array.isArray(fragments) || !fragments.length || !Object(_home_runner_work_hls_js_hls_js_src_polyfills_number__WEBPACK_IMPORTED_MODULE_0__["isFiniteNumber"])(PDTValue)) {
    return null;
  } // if less than start


  var startPDT = fragments[0].programDateTime;

  if (PDTValue < (startPDT || 0)) {
    return null;
  }

  var endPDT = fragments[fragments.length - 1].endProgramDateTime;

  if (PDTValue >= (endPDT || 0)) {
    return null;
  }

  maxFragLookUpTolerance = maxFragLookUpTolerance || 0;

  for (var seg = 0; seg < fragments.length; ++seg) {
    var frag = fragments[seg];

    if (pdtWithinToleranceTest(PDTValue, maxFragLookUpTolerance, frag)) {
      return frag;
    }
  }

  return null;
}
Returns first fragment whose endPdt value exceeds the given PDT.
@param {Array<Fragment>} fragments - The array of candidate fragments
@param {number|null} [PDTValue = null] - The PDT value which must be exceeded
@param {number} [maxFragLookUpTolerance = 0] - The amount of time that a fragment's start/end can be within in order to be considered contiguous
@returns {*|null} fragment - The best matching fragment