function parsePaddingOption(prop, options, viewportSize, itemData, index) {
  let paddingValue = 0;

  if (options.paddingFn) {
    paddingValue = options.paddingFn(viewportSize, itemData, index)[prop];
  } else if (options.padding) {
    paddingValue = options.padding[prop];
  } else {
    const legacyPropName = 'padding' + prop[0].toUpperCase() + prop.slice(1); // @ts-expect-error

    if (options[legacyPropName]) {
      // @ts-expect-error
      paddingValue = options[legacyPropName];
    }
  }

  return Number(paddingValue) || 0;
}
Parses padding option.
Supported formats:

// Object
padding: {
 top: 0,
 bottom: 0,
 left: 0,
 right: 0
}

// A function that returns the object
paddingFn: (viewportSize, itemData, index) => {
 return {
   top: 0,
   bottom: 0,
   left: 0,
   right: 0
 };
}

// Legacy variant
paddingLeft: 0,
paddingRight: 0,
paddingTop: 0,
paddingBottom: 0,

@param {'left' | 'top' | 'bottom' | 'right'} prop
@param {PhotoSwipeOptions} options PhotoSwipe options
@param {Point} viewportSize PhotoSwipe viewport size, for example: { x:800, y:600 }
@param {SlideData} itemData Data about the slide
@param {number} index Slide index
@returns {number}