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AAa,cAAeqR,EAAa7sB,EAAUC,EACrE,CA+lFWwoB,CAAevqB,KAAK4E,UAAW5E,KAAKkJ,UAAYlJ,KAAKkJ,UAAUhG,KAAOlD,KAAK2sB,iBAAkB3sB,KACtG,CAOA,OAAA2V,GACE,OAAO3V,KAAKqB,QAAQoc,MAAQzd,KAAKqV,cAAgB,CACnD,CAQA,eAAAkX,CAAgBlrB,GAQd,OAPI7B,OAAO4uB,WAAW,4CAA4CC,UAChEhtB,EAAQ+oB,sBAAwB,OAChC/oB,EAAQoH,sBAAwB,GAK3B,IAAKyjB,MACP7qB,EAEP","sources":["webpack://camp/./node_modules/photoswipe/dist/photoswipe.esm.js"],"sourcesContent":["/*!\n * PhotoSwipe 5.4.0 - https://photoswipe.com\n * (c) 2023 Dmytro Semenov\n */\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/**\r\n * @template {keyof HTMLElementTagNameMap} T\r\n * @param {string} className\r\n * @param {T} tagName\r\n * @param {Node} [appendToEl]\r\n * @returns {HTMLElementTagNameMap[T]}\r\n */\nfunction createElement(className, tagName, appendToEl) {\n const el = document.createElement(tagName);\n\n if (className) {\n el.className = className;\n }\n\n if (appendToEl) {\n appendToEl.appendChild(el);\n }\n\n return el;\n}\n/**\r\n * @param {Point} p1\r\n * @param {Point} p2\r\n * @returns {Point}\r\n */\n\nfunction equalizePoints(p1, p2) {\n p1.x = p2.x;\n p1.y = p2.y;\n\n if (p2.id !== undefined) {\n p1.id = p2.id;\n }\n\n return p1;\n}\n/**\r\n * @param {Point} p\r\n */\n\nfunction roundPoint(p) {\n p.x = Math.round(p.x);\n p.y = Math.round(p.y);\n}\n/**\r\n * Returns distance between two points.\r\n *\r\n * @param {Point} p1\r\n * @param {Point} p2\r\n * @returns {number}\r\n */\n\nfunction getDistanceBetween(p1, p2) {\n const x = Math.abs(p1.x - p2.x);\n const y = Math.abs(p1.y - p2.y);\n return Math.sqrt(x * x + y * y);\n}\n/**\r\n * Whether X and Y positions of points are equal\r\n *\r\n * @param {Point} p1\r\n * @param {Point} p2\r\n * @returns {boolean}\r\n */\n\nfunction pointsEqual(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n/**\r\n * The float result between the min and max values.\r\n *\r\n * @param {number} val\r\n * @param {number} min\r\n * @param {number} max\r\n * @returns {number}\r\n */\n\nfunction clamp(val, min, max) {\n return Math.min(Math.max(val, min), max);\n}\n/**\r\n * Get transform string\r\n *\r\n * @param {number} x\r\n * @param {number} [y]\r\n * @param {number} [scale]\r\n * @returns {string}\r\n */\n\nfunction toTransformString(x, y, scale) {\n let propValue = `translate3d(${x}px,${y || 0}px,0)`;\n\n if (scale !== undefined) {\n propValue += ` scale3d(${scale},${scale},1)`;\n }\n\n return propValue;\n}\n/**\r\n * Apply transform:translate(x, y) scale(scale) to element\r\n *\r\n * @param {HTMLElement} el\r\n * @param {number} x\r\n * @param {number} [y]\r\n * @param {number} [scale]\r\n */\n\nfunction setTransform(el, x, y, scale) {\n el.style.transform = toTransformString(x, y, scale);\n}\nconst defaultCSSEasing = 'cubic-bezier(.4,0,.22,1)';\n/**\r\n * Apply CSS transition to element\r\n *\r\n * @param {HTMLElement} el\r\n * @param {string} [prop] CSS property to animate\r\n * @param {number} [duration] in ms\r\n * @param {string} [ease] CSS easing function\r\n */\n\nfunction setTransitionStyle(el, prop, duration, ease) {\n // inOut: 'cubic-bezier(.4, 0, .22, 1)', // for \"toggle state\" transitions\n // out: 'cubic-bezier(0, 0, .22, 1)', // for \"show\" transitions\n // in: 'cubic-bezier(.4, 0, 1, 1)'// for \"hide\" transitions\n el.style.transition = prop ? `${prop} ${duration}ms ${ease || defaultCSSEasing}` : 'none';\n}\n/**\r\n * Apply width and height CSS properties to element\r\n *\r\n * @param {HTMLElement} el\r\n * @param {string | number} w\r\n * @param {string | number} h\r\n */\n\nfunction setWidthHeight(el, w, h) {\n el.style.width = typeof w === 'number' ? `${w}px` : w;\n el.style.height = typeof h === 'number' ? `${h}px` : h;\n}\n/**\r\n * @param {HTMLElement} el\r\n */\n\nfunction removeTransitionStyle(el) {\n setTransitionStyle(el);\n}\n/**\r\n * @param {HTMLImageElement} img\r\n * @returns {Promise}\r\n */\n\nfunction decodeImage(img) {\n if ('decode' in img) {\n return img.decode().catch(() => {});\n }\n\n if (img.complete) {\n return Promise.resolve(img);\n }\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img);\n\n img.onerror = reject;\n });\n}\n/** @typedef {LOAD_STATE[keyof LOAD_STATE]} LoadState */\n\n/** @type {{ IDLE: 'idle'; LOADING: 'loading'; LOADED: 'loaded'; ERROR: 'error' }} */\n\nconst LOAD_STATE = {\n IDLE: 'idle',\n LOADING: 'loading',\n LOADED: 'loaded',\n ERROR: 'error'\n};\n/**\r\n * Check if click or keydown event was dispatched\r\n * with a special key or via mouse wheel.\r\n *\r\n * @param {MouseEvent | KeyboardEvent} e\r\n * @returns {boolean}\r\n */\n\nfunction specialKeyUsed(e) {\n return 'button' in e && e.button === 1 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey;\n}\n/**\r\n * Parse `gallery` or `children` options.\r\n *\r\n * @param {import('../photoswipe.js').ElementProvider} [option]\r\n * @param {string} [legacySelector]\r\n * @param {HTMLElement | Document} [parent]\r\n * @returns HTMLElement[]\r\n */\n\nfunction getElementsFromOption(option, legacySelector, parent = document) {\n /** @type {HTMLElement[]} */\n let elements = [];\n\n if (option instanceof Element) {\n elements = [option];\n } else if (option instanceof NodeList || Array.isArray(option)) {\n elements = Array.from(option);\n } else {\n const selector = typeof option === 'string' ? option : legacySelector;\n\n if (selector) {\n elements = Array.from(parent.querySelectorAll(selector));\n }\n }\n\n return elements;\n}\n/**\r\n * Check if browser is Safari\r\n *\r\n * @returns {boolean}\r\n */\n\nfunction isSafari() {\n return !!(navigator.vendor && navigator.vendor.match(/apple/i));\n}\n\n// Detect passive event listener support\nlet supportsPassive = false;\n/* eslint-disable */\n\ntry {\n /* @ts-ignore */\n window.addEventListener('test', null, Object.defineProperty({}, 'passive', {\n get: () => {\n supportsPassive = true;\n }\n }));\n} catch (e) {}\n/* eslint-enable */\n\n/**\r\n * @typedef {Object} PoolItem\r\n * @prop {HTMLElement | Window | Document | undefined | null} target\r\n * @prop {string} type\r\n * @prop {EventListenerOrEventListenerObject} listener\r\n * @prop {boolean} [passive]\r\n */\n\n\nclass DOMEvents {\n constructor() {\n /**\r\n * @type {PoolItem[]}\r\n * @private\r\n */\n this._pool = [];\n }\n /**\r\n * Adds event listeners\r\n *\r\n * @param {PoolItem['target']} target\r\n * @param {PoolItem['type']} type Can be multiple, separated by space.\r\n * @param {PoolItem['listener']} listener\r\n * @param {PoolItem['passive']} [passive]\r\n */\n\n\n add(target, type, listener, passive) {\n this._toggleListener(target, type, listener, passive);\n }\n /**\r\n * Removes event listeners\r\n *\r\n * @param {PoolItem['target']} target\r\n * @param {PoolItem['type']} type\r\n * @param {PoolItem['listener']} listener\r\n * @param {PoolItem['passive']} [passive]\r\n */\n\n\n remove(target, type, listener, passive) {\n this._toggleListener(target, type, listener, passive, true);\n }\n /**\r\n * Removes all bound events\r\n */\n\n\n removeAll() {\n this._pool.forEach(poolItem => {\n this._toggleListener(poolItem.target, poolItem.type, poolItem.listener, poolItem.passive, true, true);\n });\n\n this._pool = [];\n }\n /**\r\n * Adds or removes event\r\n *\r\n * @private\r\n * @param {PoolItem['target']} target\r\n * @param {PoolItem['type']} type\r\n * @param {PoolItem['listener']} listener\r\n * @param {PoolItem['passive']} [passive]\r\n * @param {boolean} [unbind] Whether the event should be added or removed\r\n * @param {boolean} [skipPool] Whether events pool should be skipped\r\n */\n\n\n _toggleListener(target, type, listener, passive, unbind, skipPool) {\n if (!target) {\n return;\n }\n\n const methodName = unbind ? 'removeEventListener' : 'addEventListener';\n const types = type.split(' ');\n types.forEach(eType => {\n if (eType) {\n // Events pool is used to easily unbind all events when PhotoSwipe is closed,\n // so developer doesn't need to do this manually\n if (!skipPool) {\n if (unbind) {\n // Remove from the events pool\n this._pool = this._pool.filter(poolItem => {\n return poolItem.type !== eType || poolItem.listener !== listener || poolItem.target !== target;\n });\n } else {\n // Add to the events pool\n this._pool.push({\n target,\n type: eType,\n listener,\n passive\n });\n }\n } // most PhotoSwipe events call preventDefault,\n // and we do not need browser to scroll the page\n\n\n const eventOptions = supportsPassive ? {\n passive: passive || false\n } : false;\n target[methodName](eType, listener, eventOptions);\n }\n });\n }\n\n}\n\n/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */\n\n/** @typedef {import('../core/base.js').default} PhotoSwipeBase */\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {import('../slide/slide.js').SlideData} SlideData */\n\n/**\r\n * @param {PhotoSwipeOptions} options\r\n * @param {PhotoSwipeBase} pswp\r\n * @returns {Point}\r\n */\nfunction getViewportSize(options, pswp) {\n if (options.getViewportSizeFn) {\n const newViewportSize = options.getViewportSizeFn(options, pswp);\n\n if (newViewportSize) {\n return newViewportSize;\n }\n }\n\n return {\n x: document.documentElement.clientWidth,\n // TODO: height on mobile is very incosistent due to toolbar\n // find a way to improve this\n //\n // document.documentElement.clientHeight - doesn't seem to work well\n y: window.innerHeight\n };\n}\n/**\r\n * Parses padding option.\r\n * Supported formats:\r\n *\r\n * // Object\r\n * padding: {\r\n * top: 0,\r\n * bottom: 0,\r\n * left: 0,\r\n * right: 0\r\n * }\r\n *\r\n * // A function that returns the object\r\n * paddingFn: (viewportSize, itemData, index) => {\r\n * return {\r\n * top: 0,\r\n * bottom: 0,\r\n * left: 0,\r\n * right: 0\r\n * };\r\n * }\r\n *\r\n * // Legacy variant\r\n * paddingLeft: 0,\r\n * paddingRight: 0,\r\n * paddingTop: 0,\r\n * paddingBottom: 0,\r\n *\r\n * @param {'left' | 'top' | 'bottom' | 'right'} prop\r\n * @param {PhotoSwipeOptions} options PhotoSwipe options\r\n * @param {Point} viewportSize PhotoSwipe viewport size, for example: { x:800, y:600 }\r\n * @param {SlideData} itemData Data about the slide\r\n * @param {number} index Slide index\r\n * @returns {number}\r\n */\n\nfunction parsePaddingOption(prop, options, viewportSize, itemData, index) {\n let paddingValue = 0;\n\n if (options.paddingFn) {\n paddingValue = options.paddingFn(viewportSize, itemData, index)[prop];\n } else if (options.padding) {\n paddingValue = options.padding[prop];\n } else {\n const legacyPropName = 'padding' + prop[0].toUpperCase() + prop.slice(1); // @ts-expect-error\n\n if (options[legacyPropName]) {\n // @ts-expect-error\n paddingValue = options[legacyPropName];\n }\n }\n\n return Number(paddingValue) || 0;\n}\n/**\r\n * @param {PhotoSwipeOptions} options\r\n * @param {Point} viewportSize\r\n * @param {SlideData} itemData\r\n * @param {number} index\r\n * @returns {Point}\r\n */\n\nfunction getPanAreaSize(options, viewportSize, itemData, index) {\n return {\n x: viewportSize.x - parsePaddingOption('left', options, viewportSize, itemData, index) - parsePaddingOption('right', options, viewportSize, itemData, index),\n y: viewportSize.y - parsePaddingOption('top', options, viewportSize, itemData, index) - parsePaddingOption('bottom', options, viewportSize, itemData, index)\n };\n}\n\n/** @typedef {import('./slide.js').default} Slide */\n\n/** @typedef {Record} Point */\n\n/** @typedef {'x' | 'y'} Axis */\n\n/**\r\n * Calculates minimum, maximum and initial (center) bounds of a slide\r\n */\n\nclass PanBounds {\n /**\r\n * @param {Slide} slide\r\n */\n constructor(slide) {\n this.slide = slide;\n this.currZoomLevel = 1;\n this.center =\n /** @type {Point} */\n {\n x: 0,\n y: 0\n };\n this.max =\n /** @type {Point} */\n {\n x: 0,\n y: 0\n };\n this.min =\n /** @type {Point} */\n {\n x: 0,\n y: 0\n };\n }\n /**\r\n * _getItemBounds\r\n *\r\n * @param {number} currZoomLevel\r\n */\n\n\n update(currZoomLevel) {\n this.currZoomLevel = currZoomLevel;\n\n if (!this.slide.width) {\n this.reset();\n } else {\n this._updateAxis('x');\n\n this._updateAxis('y');\n\n this.slide.pswp.dispatch('calcBounds', {\n slide: this.slide\n });\n }\n }\n /**\r\n * _calculateItemBoundsForAxis\r\n *\r\n * @param {Axis} axis\r\n */\n\n\n _updateAxis(axis) {\n const {\n pswp\n } = this.slide;\n const elSize = this.slide[axis === 'x' ? 'width' : 'height'] * this.currZoomLevel;\n const paddingProp = axis === 'x' ? 'left' : 'top';\n const padding = parsePaddingOption(paddingProp, pswp.options, pswp.viewportSize, this.slide.data, this.slide.index);\n const panAreaSize = this.slide.panAreaSize[axis]; // Default position of element.\n // By default, it is center of viewport:\n\n this.center[axis] = Math.round((panAreaSize - elSize) / 2) + padding; // maximum pan position\n\n this.max[axis] = elSize > panAreaSize ? Math.round(panAreaSize - elSize) + padding : this.center[axis]; // minimum pan position\n\n this.min[axis] = elSize > panAreaSize ? padding : this.center[axis];\n } // _getZeroBounds\n\n\n reset() {\n this.center.x = 0;\n this.center.y = 0;\n this.max.x = 0;\n this.max.y = 0;\n this.min.x = 0;\n this.min.y = 0;\n }\n /**\r\n * Correct pan position if it's beyond the bounds\r\n *\r\n * @param {Axis} axis x or y\r\n * @param {number} panOffset\r\n * @returns {number}\r\n */\n\n\n correctPan(axis, panOffset) {\n // checkPanBounds\n return clamp(panOffset, this.max[axis], this.min[axis]);\n }\n\n}\n\nconst MAX_IMAGE_WIDTH = 4000;\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {import('../slide/slide.js').SlideData} SlideData */\n\n/** @typedef {'fit' | 'fill' | number | ((zoomLevelObject: ZoomLevel) => number)} ZoomLevelOption */\n\n/**\r\n * Calculates zoom levels for specific slide.\r\n * Depends on viewport size and image size.\r\n */\n\nclass ZoomLevel {\n /**\r\n * @param {PhotoSwipeOptions} options PhotoSwipe options\r\n * @param {SlideData} itemData Slide data\r\n * @param {number} index Slide index\r\n * @param {PhotoSwipe} [pswp] PhotoSwipe instance, can be undefined if not initialized yet\r\n */\n constructor(options, itemData, index, pswp) {\n this.pswp = pswp;\n this.options = options;\n this.itemData = itemData;\n this.index = index;\n /** @type { Point | null } */\n\n this.panAreaSize = null;\n /** @type { Point | null } */\n\n this.elementSize = null;\n this.fit = 1;\n this.fill = 1;\n this.vFill = 1;\n this.initial = 1;\n this.secondary = 1;\n this.max = 1;\n this.min = 1;\n }\n /**\r\n * Calculate initial, secondary and maximum zoom level for the specified slide.\r\n *\r\n * It should be called when either image or viewport size changes.\r\n *\r\n * @param {number} maxWidth\r\n * @param {number} maxHeight\r\n * @param {Point} panAreaSize\r\n */\n\n\n update(maxWidth, maxHeight, panAreaSize) {\n /** @type {Point} */\n const elementSize = {\n x: maxWidth,\n y: maxHeight\n };\n this.elementSize = elementSize;\n this.panAreaSize = panAreaSize;\n const hRatio = panAreaSize.x / elementSize.x;\n const vRatio = panAreaSize.y / elementSize.y;\n this.fit = Math.min(1, hRatio < vRatio ? hRatio : vRatio);\n this.fill = Math.min(1, hRatio > vRatio ? hRatio : vRatio); // zoom.vFill defines zoom level of the image\n // when it has 100% of viewport vertical space (height)\n\n this.vFill = Math.min(1, vRatio);\n this.initial = this._getInitial();\n this.secondary = this._getSecondary();\n this.max = Math.max(this.initial, this.secondary, this._getMax());\n this.min = Math.min(this.fit, this.initial, this.secondary);\n\n if (this.pswp) {\n this.pswp.dispatch('zoomLevelsUpdate', {\n zoomLevels: this,\n slideData: this.itemData\n });\n }\n }\n /**\r\n * Parses user-defined zoom option.\r\n *\r\n * @private\r\n * @param {'initial' | 'secondary' | 'max'} optionPrefix Zoom level option prefix (initial, secondary, max)\r\n * @returns { number | undefined }\r\n */\n\n\n _parseZoomLevelOption(optionPrefix) {\n const optionName =\n /** @type {'initialZoomLevel' | 'secondaryZoomLevel' | 'maxZoomLevel'} */\n optionPrefix + 'ZoomLevel';\n const optionValue = this.options[optionName];\n\n if (!optionValue) {\n return;\n }\n\n if (typeof optionValue === 'function') {\n return optionValue(this);\n }\n\n if (optionValue === 'fill') {\n return this.fill;\n }\n\n if (optionValue === 'fit') {\n return this.fit;\n }\n\n return Number(optionValue);\n }\n /**\r\n * Get zoom level to which image will be zoomed after double-tap gesture,\r\n * or when user clicks on zoom icon,\r\n * or mouse-click on image itself.\r\n * If you return 1 image will be zoomed to its original size.\r\n *\r\n * @private\r\n * @return {number}\r\n */\n\n\n _getSecondary() {\n let currZoomLevel = this._parseZoomLevelOption('secondary');\n\n if (currZoomLevel) {\n return currZoomLevel;\n } // 3x of \"fit\" state, but not larger than original\n\n\n currZoomLevel = Math.min(1, this.fit * 3);\n\n if (this.elementSize && currZoomLevel * this.elementSize.x > MAX_IMAGE_WIDTH) {\n currZoomLevel = MAX_IMAGE_WIDTH / this.elementSize.x;\n }\n\n return currZoomLevel;\n }\n /**\r\n * Get initial image zoom level.\r\n *\r\n * @private\r\n * @return {number}\r\n */\n\n\n _getInitial() {\n return this._parseZoomLevelOption('initial') || this.fit;\n }\n /**\r\n * Maximum zoom level when user zooms\r\n * via zoom/pinch gesture,\r\n * via cmd/ctrl-wheel or via trackpad.\r\n *\r\n * @private\r\n * @return {number}\r\n */\n\n\n _getMax() {\n // max zoom level is x4 from \"fit state\",\n // used for zoom gesture and ctrl/trackpad zoom\n return this._parseZoomLevelOption('max') || Math.max(1, this.fit * 4);\n }\n\n}\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n/**\r\n * Renders and allows to control a single slide\r\n */\n\nclass Slide {\n /**\r\n * @param {SlideData} data\r\n * @param {number} index\r\n * @param {PhotoSwipe} pswp\r\n */\n constructor(data, index, pswp) {\n this.data = data;\n this.index = index;\n this.pswp = pswp;\n this.isActive = index === pswp.currIndex;\n this.currentResolution = 0;\n /** @type {Point} */\n\n this.panAreaSize = {\n x: 0,\n y: 0\n };\n /** @type {Point} */\n\n this.pan = {\n x: 0,\n y: 0\n };\n this.isFirstSlide = this.isActive && !pswp.opener.isOpen;\n this.zoomLevels = new ZoomLevel(pswp.options, data, index, pswp);\n this.pswp.dispatch('gettingData', {\n slide: this,\n data: this.data,\n index\n });\n this.content = this.pswp.contentLoader.getContentBySlide(this);\n this.container = createElement('pswp__zoom-wrap', 'div');\n /** @type {HTMLElement | null} */\n\n this.holderElement = null;\n this.currZoomLevel = 1;\n /** @type {number} */\n\n this.width = this.content.width;\n /** @type {number} */\n\n this.height = this.content.height;\n this.heavyAppended = false;\n this.bounds = new PanBounds(this);\n this.prevDisplayedWidth = -1;\n this.prevDisplayedHeight = -1;\n this.pswp.dispatch('slideInit', {\n slide: this\n });\n }\n /**\r\n * If this slide is active/current/visible\r\n *\r\n * @param {boolean} isActive\r\n */\n\n\n setIsActive(isActive) {\n if (isActive && !this.isActive) {\n // slide just became active\n this.activate();\n } else if (!isActive && this.isActive) {\n // slide just became non-active\n this.deactivate();\n }\n }\n /**\r\n * Appends slide content to DOM\r\n *\r\n * @param {HTMLElement} holderElement\r\n */\n\n\n append(holderElement) {\n this.holderElement = holderElement;\n this.container.style.transformOrigin = '0 0'; // Slide appended to DOM\n\n if (!this.data) {\n return;\n }\n\n this.calculateSize();\n this.load();\n this.updateContentSize();\n this.appendHeavy();\n this.holderElement.appendChild(this.container);\n this.zoomAndPanToInitial();\n this.pswp.dispatch('firstZoomPan', {\n slide: this\n });\n this.applyCurrentZoomPan();\n this.pswp.dispatch('afterSetContent', {\n slide: this\n });\n\n if (this.isActive) {\n this.activate();\n }\n }\n\n load() {\n this.content.load(false);\n this.pswp.dispatch('slideLoad', {\n slide: this\n });\n }\n /**\r\n * Append \"heavy\" DOM elements\r\n *\r\n * This may depend on a type of slide,\r\n * but generally these are large images.\r\n */\n\n\n appendHeavy() {\n const {\n pswp\n } = this;\n const appendHeavyNearby = true; // todo\n // Avoid appending heavy elements during animations\n\n if (this.heavyAppended || !pswp.opener.isOpen || pswp.mainScroll.isShifted() || !this.isActive && !appendHeavyNearby) {\n return;\n }\n\n if (this.pswp.dispatch('appendHeavy', {\n slide: this\n }).defaultPrevented) {\n return;\n }\n\n this.heavyAppended = true;\n this.content.append();\n this.pswp.dispatch('appendHeavyContent', {\n slide: this\n });\n }\n /**\r\n * Triggered when this slide is active (selected).\r\n *\r\n * If it's part of opening/closing transition -\r\n * activate() will trigger after the transition is ended.\r\n */\n\n\n activate() {\n this.isActive = true;\n this.appendHeavy();\n this.content.activate();\n this.pswp.dispatch('slideActivate', {\n slide: this\n });\n }\n /**\r\n * Triggered when this slide becomes inactive.\r\n *\r\n * Slide can become inactive only after it was active.\r\n */\n\n\n deactivate() {\n this.isActive = false;\n this.content.deactivate();\n\n if (this.currZoomLevel !== this.zoomLevels.initial) {\n // allow filtering\n this.calculateSize();\n } // reset zoom level\n\n\n this.currentResolution = 0;\n this.zoomAndPanToInitial();\n this.applyCurrentZoomPan();\n this.updateContentSize();\n this.pswp.dispatch('slideDeactivate', {\n slide: this\n });\n }\n /**\r\n * The slide should destroy itself, it will never be used again.\r\n * (unbind all events and destroy internal components)\r\n */\n\n\n destroy() {\n this.content.hasSlide = false;\n this.content.remove();\n this.container.remove();\n this.pswp.dispatch('slideDestroy', {\n slide: this\n });\n }\n\n resize() {\n if (this.currZoomLevel === this.zoomLevels.initial || !this.isActive) {\n // Keep initial zoom level if it was before the resize,\n // as well as when this slide is not active\n // Reset position and scale to original state\n this.calculateSize();\n this.currentResolution = 0;\n this.zoomAndPanToInitial();\n this.applyCurrentZoomPan();\n this.updateContentSize();\n } else {\n // readjust pan position if it's beyond the bounds\n this.calculateSize();\n this.bounds.update(this.currZoomLevel);\n this.panTo(this.pan.x, this.pan.y);\n }\n }\n /**\r\n * Apply size to current slide content,\r\n * based on the current resolution and scale.\r\n *\r\n * @param {boolean} [force] if size should be updated even if dimensions weren't changed\r\n */\n\n\n updateContentSize(force) {\n // Use initial zoom level\n // if resolution is not defined (user didn't zoom yet)\n const scaleMultiplier = this.currentResolution || this.zoomLevels.initial;\n\n if (!scaleMultiplier) {\n return;\n }\n\n const width = Math.round(this.width * scaleMultiplier) || this.pswp.viewportSize.x;\n const height = Math.round(this.height * scaleMultiplier) || this.pswp.viewportSize.y;\n\n if (!this.sizeChanged(width, height) && !force) {\n return;\n }\n\n this.content.setDisplayedSize(width, height);\n }\n /**\r\n * @param {number} width\r\n * @param {number} height\r\n */\n\n\n sizeChanged(width, height) {\n if (width !== this.prevDisplayedWidth || height !== this.prevDisplayedHeight) {\n this.prevDisplayedWidth = width;\n this.prevDisplayedHeight = height;\n return true;\n }\n\n return false;\n }\n /** @returns {HTMLImageElement | HTMLDivElement | null | undefined} */\n\n\n getPlaceholderElement() {\n var _this$content$placeho;\n\n return (_this$content$placeho = this.content.placeholder) === null || _this$content$placeho === void 0 ? void 0 : _this$content$placeho.element;\n }\n /**\r\n * Zoom current slide image to...\r\n *\r\n * @param {number} destZoomLevel Destination zoom level.\r\n * @param {Point} [centerPoint]\r\n * Transform origin center point, or false if viewport center should be used.\r\n * @param {number | false} [transitionDuration] Transition duration, may be set to 0.\r\n * @param {boolean} [ignoreBounds] Minimum and maximum zoom levels will be ignored.\r\n */\n\n\n zoomTo(destZoomLevel, centerPoint, transitionDuration, ignoreBounds) {\n const {\n pswp\n } = this;\n\n if (!this.isZoomable() || pswp.mainScroll.isShifted()) {\n return;\n }\n\n pswp.dispatch('beforeZoomTo', {\n destZoomLevel,\n centerPoint,\n transitionDuration\n }); // stop all pan and zoom transitions\n\n pswp.animations.stopAllPan(); // if (!centerPoint) {\n // centerPoint = pswp.getViewportCenterPoint();\n // }\n\n const prevZoomLevel = this.currZoomLevel;\n\n if (!ignoreBounds) {\n destZoomLevel = clamp(destZoomLevel, this.zoomLevels.min, this.zoomLevels.max);\n } // if (transitionDuration === undefined) {\n // transitionDuration = this.pswp.options.zoomAnimationDuration;\n // }\n\n\n this.setZoomLevel(destZoomLevel);\n this.pan.x = this.calculateZoomToPanOffset('x', centerPoint, prevZoomLevel);\n this.pan.y = this.calculateZoomToPanOffset('y', centerPoint, prevZoomLevel);\n roundPoint(this.pan);\n\n const finishTransition = () => {\n this._setResolution(destZoomLevel);\n\n this.applyCurrentZoomPan();\n };\n\n if (!transitionDuration) {\n finishTransition();\n } else {\n pswp.animations.startTransition({\n isPan: true,\n name: 'zoomTo',\n target: this.container,\n transform: this.getCurrentTransform(),\n onComplete: finishTransition,\n duration: transitionDuration,\n easing: pswp.options.easing\n });\n }\n }\n /**\r\n * @param {Point} [centerPoint]\r\n */\n\n\n toggleZoom(centerPoint) {\n this.zoomTo(this.currZoomLevel === this.zoomLevels.initial ? this.zoomLevels.secondary : this.zoomLevels.initial, centerPoint, this.pswp.options.zoomAnimationDuration);\n }\n /**\r\n * Updates zoom level property and recalculates new pan bounds,\r\n * unlike zoomTo it does not apply transform (use applyCurrentZoomPan)\r\n *\r\n * @param {number} currZoomLevel\r\n */\n\n\n setZoomLevel(currZoomLevel) {\n this.currZoomLevel = currZoomLevel;\n this.bounds.update(this.currZoomLevel);\n }\n /**\r\n * Get pan position after zoom at a given `point`.\r\n *\r\n * Always call setZoomLevel(newZoomLevel) beforehand to recalculate\r\n * pan bounds according to the new zoom level.\r\n *\r\n * @param {'x' | 'y'} axis\r\n * @param {Point} [point]\r\n * point based on which zoom is performed, usually refers to the current mouse position,\r\n * if false - viewport center will be used.\r\n * @param {number} [prevZoomLevel] Zoom level before new zoom was applied.\r\n * @returns {number}\r\n */\n\n\n calculateZoomToPanOffset(axis, point, prevZoomLevel) {\n const totalPanDistance = this.bounds.max[axis] - this.bounds.min[axis];\n\n if (totalPanDistance === 0) {\n return this.bounds.center[axis];\n }\n\n if (!point) {\n point = this.pswp.getViewportCenterPoint();\n }\n\n if (!prevZoomLevel) {\n prevZoomLevel = this.zoomLevels.initial;\n }\n\n const zoomFactor = this.currZoomLevel / prevZoomLevel;\n return this.bounds.correctPan(axis, (this.pan[axis] - point[axis]) * zoomFactor + point[axis]);\n }\n /**\r\n * Apply pan and keep it within bounds.\r\n *\r\n * @param {number} panX\r\n * @param {number} panY\r\n */\n\n\n panTo(panX, panY) {\n this.pan.x = this.bounds.correctPan('x', panX);\n this.pan.y = this.bounds.correctPan('y', panY);\n this.applyCurrentZoomPan();\n }\n /**\r\n * If the slide in the current state can be panned by the user\r\n * @returns {boolean}\r\n */\n\n\n isPannable() {\n return Boolean(this.width) && this.currZoomLevel > this.zoomLevels.fit;\n }\n /**\r\n * If the slide can be zoomed\r\n * @returns {boolean}\r\n */\n\n\n isZoomable() {\n return Boolean(this.width) && this.content.isZoomable();\n }\n /**\r\n * Apply transform and scale based on\r\n * the current pan position (this.pan) and zoom level (this.currZoomLevel)\r\n */\n\n\n applyCurrentZoomPan() {\n this._applyZoomTransform(this.pan.x, this.pan.y, this.currZoomLevel);\n\n if (this === this.pswp.currSlide) {\n this.pswp.dispatch('zoomPanUpdate', {\n slide: this\n });\n }\n }\n\n zoomAndPanToInitial() {\n this.currZoomLevel = this.zoomLevels.initial; // pan according to the zoom level\n\n this.bounds.update(this.currZoomLevel);\n equalizePoints(this.pan, this.bounds.center);\n this.pswp.dispatch('initialZoomPan', {\n slide: this\n });\n }\n /**\r\n * Set translate and scale based on current resolution\r\n *\r\n * @param {number} x\r\n * @param {number} y\r\n * @param {number} zoom\r\n * @private\r\n */\n\n\n _applyZoomTransform(x, y, zoom) {\n zoom /= this.currentResolution || this.zoomLevels.initial;\n setTransform(this.container, x, y, zoom);\n }\n\n calculateSize() {\n const {\n pswp\n } = this;\n equalizePoints(this.panAreaSize, getPanAreaSize(pswp.options, pswp.viewportSize, this.data, this.index));\n this.zoomLevels.update(this.width, this.height, this.panAreaSize);\n pswp.dispatch('calcSlideSize', {\n slide: this\n });\n }\n /** @returns {string} */\n\n\n getCurrentTransform() {\n const scale = this.currZoomLevel / (this.currentResolution || this.zoomLevels.initial);\n return toTransformString(this.pan.x, this.pan.y, scale);\n }\n /**\r\n * Set resolution and re-render the image.\r\n *\r\n * For example, if the real image size is 2000x1500,\r\n * and resolution is 0.5 - it will be rendered as 1000x750.\r\n *\r\n * Image with zoom level 2 and resolution 0.5 is\r\n * the same as image with zoom level 1 and resolution 1.\r\n *\r\n * Used to optimize animations and make\r\n * sure that browser renders image in the highest quality.\r\n * Also used by responsive images to load the correct one.\r\n *\r\n * @param {number} newResolution\r\n */\n\n\n _setResolution(newResolution) {\n if (newResolution === this.currentResolution) {\n return;\n }\n\n this.currentResolution = newResolution;\n this.updateContentSize();\n this.pswp.dispatch('resolutionChanged');\n }\n\n}\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {import('./gestures.js').default} Gestures */\n\nconst PAN_END_FRICTION = 0.35;\nconst VERTICAL_DRAG_FRICTION = 0.6; // 1 corresponds to the third of viewport height\n\nconst MIN_RATIO_TO_CLOSE = 0.4; // Minimum speed required to navigate\n// to next or previous slide\n\nconst MIN_NEXT_SLIDE_SPEED = 0.5;\n/**\r\n * @param {number} initialVelocity\r\n * @param {number} decelerationRate\r\n * @returns {number}\r\n */\n\nfunction project(initialVelocity, decelerationRate) {\n return initialVelocity * decelerationRate / (1 - decelerationRate);\n}\n/**\r\n * Handles single pointer dragging\r\n */\n\n\nclass DragHandler {\n /**\r\n * @param {Gestures} gestures\r\n */\n constructor(gestures) {\n this.gestures = gestures;\n this.pswp = gestures.pswp;\n /** @type {Point} */\n\n this.startPan = {\n x: 0,\n y: 0\n };\n }\n\n start() {\n if (this.pswp.currSlide) {\n equalizePoints(this.startPan, this.pswp.currSlide.pan);\n }\n\n this.pswp.animations.stopAll();\n }\n\n change() {\n const {\n p1,\n prevP1,\n dragAxis\n } = this.gestures;\n const {\n currSlide\n } = this.pswp;\n\n if (dragAxis === 'y' && this.pswp.options.closeOnVerticalDrag && currSlide && currSlide.currZoomLevel <= currSlide.zoomLevels.fit && !this.gestures.isMultitouch) {\n // Handle vertical drag to close\n const panY = currSlide.pan.y + (p1.y - prevP1.y);\n\n if (!this.pswp.dispatch('verticalDrag', {\n panY\n }).defaultPrevented) {\n this._setPanWithFriction('y', panY, VERTICAL_DRAG_FRICTION);\n\n const bgOpacity = 1 - Math.abs(this._getVerticalDragRatio(currSlide.pan.y));\n this.pswp.applyBgOpacity(bgOpacity);\n currSlide.applyCurrentZoomPan();\n }\n } else {\n const mainScrollChanged = this._panOrMoveMainScroll('x');\n\n if (!mainScrollChanged) {\n this._panOrMoveMainScroll('y');\n\n if (currSlide) {\n roundPoint(currSlide.pan);\n currSlide.applyCurrentZoomPan();\n }\n }\n }\n }\n\n end() {\n const {\n velocity\n } = this.gestures;\n const {\n mainScroll,\n currSlide\n } = this.pswp;\n let indexDiff = 0;\n this.pswp.animations.stopAll(); // Handle main scroll if it's shifted\n\n if (mainScroll.isShifted()) {\n // Position of the main scroll relative to the viewport\n const mainScrollShiftDiff = mainScroll.x - mainScroll.getCurrSlideX(); // Ratio between 0 and 1:\n // 0 - slide is not visible at all,\n // 0.5 - half of the slide is visible\n // 1 - slide is fully visible\n\n const currentSlideVisibilityRatio = mainScrollShiftDiff / this.pswp.viewportSize.x; // Go next slide.\n //\n // - if velocity and its direction is matched,\n // and we see at least tiny part of the next slide\n //\n // - or if we see less than 50% of the current slide\n // and velocity is close to 0\n //\n\n if (velocity.x < -MIN_NEXT_SLIDE_SPEED && currentSlideVisibilityRatio < 0 || velocity.x < 0.1 && currentSlideVisibilityRatio < -0.5) {\n // Go to next slide\n indexDiff = 1;\n velocity.x = Math.min(velocity.x, 0);\n } else if (velocity.x > MIN_NEXT_SLIDE_SPEED && currentSlideVisibilityRatio > 0 || velocity.x > -0.1 && currentSlideVisibilityRatio > 0.5) {\n // Go to prev slide\n indexDiff = -1;\n velocity.x = Math.max(velocity.x, 0);\n }\n\n mainScroll.moveIndexBy(indexDiff, true, velocity.x);\n } // Restore zoom level\n\n\n if (currSlide && currSlide.currZoomLevel > currSlide.zoomLevels.max || this.gestures.isMultitouch) {\n this.gestures.zoomLevels.correctZoomPan(true);\n } else {\n // we run two animations instead of one,\n // as each axis has own pan boundaries and thus different spring function\n // (correctZoomPan does not have this functionality,\n // it animates all properties with single timing function)\n this._finishPanGestureForAxis('x');\n\n this._finishPanGestureForAxis('y');\n }\n }\n /**\r\n * @private\r\n * @param {'x' | 'y'} axis\r\n */\n\n\n _finishPanGestureForAxis(axis) {\n const {\n velocity\n } = this.gestures;\n const {\n currSlide\n } = this.pswp;\n\n if (!currSlide) {\n return;\n }\n\n const {\n pan,\n bounds\n } = currSlide;\n const panPos = pan[axis];\n const restoreBgOpacity = this.pswp.bgOpacity < 1 && axis === 'y'; // 0.995 means - scroll view loses 0.5% of its velocity per millisecond\n // Increasing this number will reduce travel distance\n\n const decelerationRate = 0.995; // 0.99\n // Pan position if there is no bounds\n\n const projectedPosition = panPos + project(velocity[axis], decelerationRate);\n\n if (restoreBgOpacity) {\n const vDragRatio = this._getVerticalDragRatio(panPos);\n\n const projectedVDragRatio = this._getVerticalDragRatio(projectedPosition); // If we are above and moving upwards,\n // or if we are below and moving downwards\n\n\n if (vDragRatio < 0 && projectedVDragRatio < -MIN_RATIO_TO_CLOSE || vDragRatio > 0 && projectedVDragRatio > MIN_RATIO_TO_CLOSE) {\n this.pswp.close();\n return;\n }\n } // Pan position with corrected bounds\n\n\n const correctedPanPosition = bounds.correctPan(axis, projectedPosition); // Exit if pan position should not be changed\n // or if speed it too low\n\n if (panPos === correctedPanPosition) {\n return;\n } // Overshoot if the final position is out of pan bounds\n\n\n const dampingRatio = correctedPanPosition === projectedPosition ? 1 : 0.82;\n const initialBgOpacity = this.pswp.bgOpacity;\n const totalPanDist = correctedPanPosition - panPos;\n this.pswp.animations.startSpring({\n name: 'panGesture' + axis,\n isPan: true,\n start: panPos,\n end: correctedPanPosition,\n velocity: velocity[axis],\n dampingRatio,\n onUpdate: pos => {\n // Animate opacity of background relative to Y pan position of an image\n if (restoreBgOpacity && this.pswp.bgOpacity < 1) {\n // 0 - start of animation, 1 - end of animation\n const animationProgressRatio = 1 - (correctedPanPosition - pos) / totalPanDist; // We clamp opacity to keep it between 0 and 1.\n // As progress ratio can be larger than 1 due to overshoot,\n // and we do not want to bounce opacity.\n\n this.pswp.applyBgOpacity(clamp(initialBgOpacity + (1 - initialBgOpacity) * animationProgressRatio, 0, 1));\n }\n\n pan[axis] = Math.floor(pos);\n currSlide.applyCurrentZoomPan();\n }\n });\n }\n /**\r\n * Update position of the main scroll,\r\n * or/and update pan position of the current slide.\r\n *\r\n * Should return true if it changes (or can change) main scroll.\r\n *\r\n * @private\r\n * @param {'x' | 'y'} axis\r\n * @returns {boolean}\r\n */\n\n\n _panOrMoveMainScroll(axis) {\n const {\n p1,\n dragAxis,\n prevP1,\n isMultitouch\n } = this.gestures;\n const {\n currSlide,\n mainScroll\n } = this.pswp;\n const delta = p1[axis] - prevP1[axis];\n const newMainScrollX = mainScroll.x + delta;\n\n if (!delta || !currSlide) {\n return false;\n } // Always move main scroll if image can not be panned\n\n\n if (axis === 'x' && !currSlide.isPannable() && !isMultitouch) {\n mainScroll.moveTo(newMainScrollX, true);\n return true; // changed main scroll\n }\n\n const {\n bounds\n } = currSlide;\n const newPan = currSlide.pan[axis] + delta;\n\n if (this.pswp.options.allowPanToNext && dragAxis === 'x' && axis === 'x' && !isMultitouch) {\n const currSlideMainScrollX = mainScroll.getCurrSlideX(); // Position of the main scroll relative to the viewport\n\n const mainScrollShiftDiff = mainScroll.x - currSlideMainScrollX;\n const isLeftToRight = delta > 0;\n const isRightToLeft = !isLeftToRight;\n\n if (newPan > bounds.min[axis] && isLeftToRight) {\n // Panning from left to right, beyond the left edge\n // Wether the image was at minimum pan position (or less)\n // when this drag gesture started.\n // Minimum pan position refers to the left edge of the image.\n const wasAtMinPanPosition = bounds.min[axis] <= this.startPan[axis];\n\n if (wasAtMinPanPosition) {\n mainScroll.moveTo(newMainScrollX, true);\n return true;\n } else {\n this._setPanWithFriction(axis, newPan); //currSlide.pan[axis] = newPan;\n\n }\n } else if (newPan < bounds.max[axis] && isRightToLeft) {\n // Paning from right to left, beyond the right edge\n // Maximum pan position refers to the right edge of the image.\n const wasAtMaxPanPosition = this.startPan[axis] <= bounds.max[axis];\n\n if (wasAtMaxPanPosition) {\n mainScroll.moveTo(newMainScrollX, true);\n return true;\n } else {\n this._setPanWithFriction(axis, newPan); //currSlide.pan[axis] = newPan;\n\n }\n } else {\n // If main scroll is shifted\n if (mainScrollShiftDiff !== 0) {\n // If main scroll is shifted right\n if (mainScrollShiftDiff > 0\n /*&& isRightToLeft*/\n ) {\n mainScroll.moveTo(Math.max(newMainScrollX, currSlideMainScrollX), true);\n return true;\n } else if (mainScrollShiftDiff < 0\n /*&& isLeftToRight*/\n ) {\n // Main scroll is shifted left (Position is less than 0 comparing to the viewport 0)\n mainScroll.moveTo(Math.min(newMainScrollX, currSlideMainScrollX), true);\n return true;\n }\n } else {\n // We are within pan bounds, so just pan\n this._setPanWithFriction(axis, newPan);\n }\n }\n } else {\n if (axis === 'y') {\n // Do not pan vertically if main scroll is shifted o\n if (!mainScroll.isShifted() && bounds.min.y !== bounds.max.y) {\n this._setPanWithFriction(axis, newPan);\n }\n } else {\n this._setPanWithFriction(axis, newPan);\n }\n }\n\n return false;\n } // If we move above - the ratio is negative\n // If we move below the ratio is positive\n\n /**\r\n * Relation between pan Y position and third of viewport height.\r\n *\r\n * When we are at initial position (center bounds) - the ratio is 0,\r\n * if position is shifted upwards - the ratio is negative,\r\n * if position is shifted downwards - the ratio is positive.\r\n *\r\n * @private\r\n * @param {number} panY The current pan Y position.\r\n * @returns {number}\r\n */\n\n\n _getVerticalDragRatio(panY) {\n var _this$pswp$currSlide$, _this$pswp$currSlide;\n\n return (panY - ((_this$pswp$currSlide$ = (_this$pswp$currSlide = this.pswp.currSlide) === null || _this$pswp$currSlide === void 0 ? void 0 : _this$pswp$currSlide.bounds.center.y) !== null && _this$pswp$currSlide$ !== void 0 ? _this$pswp$currSlide$ : 0)) / (this.pswp.viewportSize.y / 3);\n }\n /**\r\n * Set pan position of the current slide.\r\n * Apply friction if the position is beyond the pan bounds,\r\n * or if custom friction is defined.\r\n *\r\n * @private\r\n * @param {'x' | 'y'} axis\r\n * @param {number} potentialPan\r\n * @param {number} [customFriction] (0.1 - 1)\r\n */\n\n\n _setPanWithFriction(axis, potentialPan, customFriction) {\n const {\n currSlide\n } = this.pswp;\n\n if (!currSlide) {\n return;\n }\n\n const {\n pan,\n bounds\n } = currSlide;\n const correctedPan = bounds.correctPan(axis, potentialPan); // If we are out of pan bounds\n\n if (correctedPan !== potentialPan || customFriction) {\n const delta = Math.round(potentialPan - pan[axis]);\n pan[axis] += delta * (customFriction || PAN_END_FRICTION);\n } else {\n pan[axis] = potentialPan;\n }\n }\n\n}\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {import('./gestures.js').default} Gestures */\n\nconst UPPER_ZOOM_FRICTION = 0.05;\nconst LOWER_ZOOM_FRICTION = 0.15;\n/**\r\n * Get center point between two points\r\n *\r\n * @param {Point} p\r\n * @param {Point} p1\r\n * @param {Point} p2\r\n * @returns {Point}\r\n */\n\nfunction getZoomPointsCenter(p, p1, p2) {\n p.x = (p1.x + p2.x) / 2;\n p.y = (p1.y + p2.y) / 2;\n return p;\n}\n\nclass ZoomHandler {\n /**\r\n * @param {Gestures} gestures\r\n */\n constructor(gestures) {\n this.gestures = gestures;\n /**\r\n * @private\r\n * @type {Point}\r\n */\n\n this._startPan = {\n x: 0,\n y: 0\n };\n /**\r\n * @private\r\n * @type {Point}\r\n */\n\n this._startZoomPoint = {\n x: 0,\n y: 0\n };\n /**\r\n * @private\r\n * @type {Point}\r\n */\n\n this._zoomPoint = {\n x: 0,\n y: 0\n };\n /** @private */\n\n this._wasOverFitZoomLevel = false;\n /** @private */\n\n this._startZoomLevel = 1;\n }\n\n start() {\n const {\n currSlide\n } = this.gestures.pswp;\n\n if (currSlide) {\n this._startZoomLevel = currSlide.currZoomLevel;\n equalizePoints(this._startPan, currSlide.pan);\n }\n\n this.gestures.pswp.animations.stopAllPan();\n this._wasOverFitZoomLevel = false;\n }\n\n change() {\n const {\n p1,\n startP1,\n p2,\n startP2,\n pswp\n } = this.gestures;\n const {\n currSlide\n } = pswp;\n\n if (!currSlide) {\n return;\n }\n\n const minZoomLevel = currSlide.zoomLevels.min;\n const maxZoomLevel = currSlide.zoomLevels.max;\n\n if (!currSlide.isZoomable() || pswp.mainScroll.isShifted()) {\n return;\n }\n\n getZoomPointsCenter(this._startZoomPoint, startP1, startP2);\n getZoomPointsCenter(this._zoomPoint, p1, p2);\n\n let currZoomLevel = 1 / getDistanceBetween(startP1, startP2) * getDistanceBetween(p1, p2) * this._startZoomLevel; // slightly over the zoom.fit\n\n\n if (currZoomLevel > currSlide.zoomLevels.initial + currSlide.zoomLevels.initial / 15) {\n this._wasOverFitZoomLevel = true;\n }\n\n if (currZoomLevel < minZoomLevel) {\n if (pswp.options.pinchToClose && !this._wasOverFitZoomLevel && this._startZoomLevel <= currSlide.zoomLevels.initial) {\n // fade out background if zooming out\n const bgOpacity = 1 - (minZoomLevel - currZoomLevel) / (minZoomLevel / 1.2);\n\n if (!pswp.dispatch('pinchClose', {\n bgOpacity\n }).defaultPrevented) {\n pswp.applyBgOpacity(bgOpacity);\n }\n } else {\n // Apply the friction if zoom level is below the min\n currZoomLevel = minZoomLevel - (minZoomLevel - currZoomLevel) * LOWER_ZOOM_FRICTION;\n }\n } else if (currZoomLevel > maxZoomLevel) {\n // Apply the friction if zoom level is above the max\n currZoomLevel = maxZoomLevel + (currZoomLevel - maxZoomLevel) * UPPER_ZOOM_FRICTION;\n }\n\n currSlide.pan.x = this._calculatePanForZoomLevel('x', currZoomLevel);\n currSlide.pan.y = this._calculatePanForZoomLevel('y', currZoomLevel);\n currSlide.setZoomLevel(currZoomLevel);\n currSlide.applyCurrentZoomPan();\n }\n\n end() {\n const {\n pswp\n } = this.gestures;\n const {\n currSlide\n } = pswp;\n\n if ((!currSlide || currSlide.currZoomLevel < currSlide.zoomLevels.initial) && !this._wasOverFitZoomLevel && pswp.options.pinchToClose) {\n pswp.close();\n } else {\n this.correctZoomPan();\n }\n }\n /**\r\n * @private\r\n * @param {'x' | 'y'} axis\r\n * @param {number} currZoomLevel\r\n * @returns {number}\r\n */\n\n\n _calculatePanForZoomLevel(axis, currZoomLevel) {\n const zoomFactor = currZoomLevel / this._startZoomLevel;\n return this._zoomPoint[axis] - (this._startZoomPoint[axis] - this._startPan[axis]) * zoomFactor;\n }\n /**\r\n * Correct currZoomLevel and pan if they are\r\n * beyond minimum or maximum values.\r\n * With animation.\r\n *\r\n * @param {boolean} [ignoreGesture]\r\n * Wether gesture coordinates should be ignored when calculating destination pan position.\r\n */\n\n\n correctZoomPan(ignoreGesture) {\n const {\n pswp\n } = this.gestures;\n const {\n currSlide\n } = pswp;\n\n if (!(currSlide !== null && currSlide !== void 0 && currSlide.isZoomable())) {\n return;\n }\n\n if (this._zoomPoint.x === 0) {\n ignoreGesture = true;\n }\n\n const prevZoomLevel = currSlide.currZoomLevel;\n /** @type {number} */\n\n let destinationZoomLevel;\n let currZoomLevelNeedsChange = true;\n\n if (prevZoomLevel < currSlide.zoomLevels.initial) {\n destinationZoomLevel = currSlide.zoomLevels.initial; // zoom to min\n } else if (prevZoomLevel > currSlide.zoomLevels.max) {\n destinationZoomLevel = currSlide.zoomLevels.max; // zoom to max\n } else {\n currZoomLevelNeedsChange = false;\n destinationZoomLevel = prevZoomLevel;\n }\n\n const initialBgOpacity = pswp.bgOpacity;\n const restoreBgOpacity = pswp.bgOpacity < 1;\n const initialPan = equalizePoints({\n x: 0,\n y: 0\n }, currSlide.pan);\n let destinationPan = equalizePoints({\n x: 0,\n y: 0\n }, initialPan);\n\n if (ignoreGesture) {\n this._zoomPoint.x = 0;\n this._zoomPoint.y = 0;\n this._startZoomPoint.x = 0;\n this._startZoomPoint.y = 0;\n this._startZoomLevel = prevZoomLevel;\n equalizePoints(this._startPan, initialPan);\n }\n\n if (currZoomLevelNeedsChange) {\n destinationPan = {\n x: this._calculatePanForZoomLevel('x', destinationZoomLevel),\n y: this._calculatePanForZoomLevel('y', destinationZoomLevel)\n };\n } // set zoom level, so pan bounds are updated according to it\n\n\n currSlide.setZoomLevel(destinationZoomLevel);\n destinationPan = {\n x: currSlide.bounds.correctPan('x', destinationPan.x),\n y: currSlide.bounds.correctPan('y', destinationPan.y)\n }; // return zoom level and its bounds to initial\n\n currSlide.setZoomLevel(prevZoomLevel);\n const panNeedsChange = !pointsEqual(destinationPan, initialPan);\n\n if (!panNeedsChange && !currZoomLevelNeedsChange && !restoreBgOpacity) {\n // update resolution after gesture\n currSlide._setResolution(destinationZoomLevel);\n\n currSlide.applyCurrentZoomPan(); // nothing to animate\n\n return;\n }\n\n pswp.animations.stopAllPan();\n pswp.animations.startSpring({\n isPan: true,\n start: 0,\n end: 1000,\n velocity: 0,\n dampingRatio: 1,\n naturalFrequency: 40,\n onUpdate: now => {\n now /= 1000; // 0 - start, 1 - end\n\n if (panNeedsChange || currZoomLevelNeedsChange) {\n if (panNeedsChange) {\n currSlide.pan.x = initialPan.x + (destinationPan.x - initialPan.x) * now;\n currSlide.pan.y = initialPan.y + (destinationPan.y - initialPan.y) * now;\n }\n\n if (currZoomLevelNeedsChange) {\n const newZoomLevel = prevZoomLevel + (destinationZoomLevel - prevZoomLevel) * now;\n currSlide.setZoomLevel(newZoomLevel);\n }\n\n currSlide.applyCurrentZoomPan();\n } // Restore background opacity\n\n\n if (restoreBgOpacity && pswp.bgOpacity < 1) {\n // We clamp opacity to keep it between 0 and 1.\n // As progress ratio can be larger than 1 due to overshoot,\n // and we do not want to bounce opacity.\n pswp.applyBgOpacity(clamp(initialBgOpacity + (1 - initialBgOpacity) * now, 0, 1));\n }\n },\n onComplete: () => {\n // update resolution after transition ends\n currSlide._setResolution(destinationZoomLevel);\n\n currSlide.applyCurrentZoomPan();\n }\n });\n }\n\n}\n\n/**\r\n * @template {string} T\r\n * @template {string} P\r\n * @typedef {import('../types.js').AddPostfix} AddPostfix\r\n */\n\n/** @typedef {import('./gestures.js').default} Gestures */\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {'imageClick' | 'bgClick' | 'tap' | 'doubleTap'} Actions */\n\n/**\r\n * Whether the tap was performed on the main slide\r\n * (rather than controls or caption).\r\n *\r\n * @param {PointerEvent} event\r\n * @returns {boolean}\r\n */\nfunction didTapOnMainContent(event) {\n return !!\n /** @type {HTMLElement} */\n event.target.closest('.pswp__container');\n}\n/**\r\n * Tap, double-tap handler.\r\n */\n\n\nclass TapHandler {\n /**\r\n * @param {Gestures} gestures\r\n */\n constructor(gestures) {\n this.gestures = gestures;\n }\n /**\r\n * @param {Point} point\r\n * @param {PointerEvent} originalEvent\r\n */\n\n\n click(point, originalEvent) {\n const targetClassList =\n /** @type {HTMLElement} */\n originalEvent.target.classList;\n const isImageClick = targetClassList.contains('pswp__img');\n const isBackgroundClick = targetClassList.contains('pswp__item') || targetClassList.contains('pswp__zoom-wrap');\n\n if (isImageClick) {\n this._doClickOrTapAction('imageClick', point, originalEvent);\n } else if (isBackgroundClick) {\n this._doClickOrTapAction('bgClick', point, originalEvent);\n }\n }\n /**\r\n * @param {Point} point\r\n * @param {PointerEvent} originalEvent\r\n */\n\n\n tap(point, originalEvent) {\n if (didTapOnMainContent(originalEvent)) {\n this._doClickOrTapAction('tap', point, originalEvent);\n }\n }\n /**\r\n * @param {Point} point\r\n * @param {PointerEvent} originalEvent\r\n */\n\n\n doubleTap(point, originalEvent) {\n if (didTapOnMainContent(originalEvent)) {\n this._doClickOrTapAction('doubleTap', point, originalEvent);\n }\n }\n /**\r\n * @private\r\n * @param {Actions} actionName\r\n * @param {Point} point\r\n * @param {PointerEvent} originalEvent\r\n */\n\n\n _doClickOrTapAction(actionName, point, originalEvent) {\n var _this$gestures$pswp$e;\n\n const {\n pswp\n } = this.gestures;\n const {\n currSlide\n } = pswp;\n const actionFullName =\n /** @type {AddPostfix} */\n actionName + 'Action';\n const optionValue = pswp.options[actionFullName];\n\n if (pswp.dispatch(actionFullName, {\n point,\n originalEvent\n }).defaultPrevented) {\n return;\n }\n\n if (typeof optionValue === 'function') {\n optionValue.call(pswp, point, originalEvent);\n return;\n }\n\n switch (optionValue) {\n case 'close':\n case 'next':\n pswp[optionValue]();\n break;\n\n case 'zoom':\n currSlide === null || currSlide === void 0 || currSlide.toggleZoom(point);\n break;\n\n case 'zoom-or-close':\n // by default click zooms current image,\n // if it can not be zoomed - gallery will be closed\n if (currSlide !== null && currSlide !== void 0 && currSlide.isZoomable() && currSlide.zoomLevels.secondary !== currSlide.zoomLevels.initial) {\n currSlide.toggleZoom(point);\n } else if (pswp.options.clickToCloseNonZoomable) {\n pswp.close();\n }\n\n break;\n\n case 'toggle-controls':\n (_this$gestures$pswp$e = this.gestures.pswp.element) === null || _this$gestures$pswp$e === void 0 || _this$gestures$pswp$e.classList.toggle('pswp--ui-visible'); // if (_controlsVisible) {\n // _ui.hideControls();\n // } else {\n // _ui.showControls();\n // }\n\n break;\n }\n }\n\n}\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n// How far should user should drag\n// until we can determine that the gesture is swipe and its direction\n\nconst AXIS_SWIPE_HYSTERISIS = 10; //const PAN_END_FRICTION = 0.35;\n\nconst DOUBLE_TAP_DELAY = 300; // ms\n\nconst MIN_TAP_DISTANCE = 25; // px\n\n/**\r\n * Gestures class bind touch, pointer or mouse events\r\n * and emits drag to drag-handler and zoom events zoom-handler.\r\n *\r\n * Drag and zoom events are emited in requestAnimationFrame,\r\n * and only when one of pointers was actually changed.\r\n */\n\nclass Gestures {\n /**\r\n * @param {PhotoSwipe} pswp\r\n */\n constructor(pswp) {\n this.pswp = pswp;\n /** @type {'x' | 'y' | null} */\n\n this.dragAxis = null; // point objects are defined once and reused\n // PhotoSwipe keeps track only of two pointers, others are ignored\n\n /** @type {Point} */\n\n this.p1 = {\n x: 0,\n y: 0\n }; // the first pressed pointer\n\n /** @type {Point} */\n\n this.p2 = {\n x: 0,\n y: 0\n }; // the second pressed pointer\n\n /** @type {Point} */\n\n this.prevP1 = {\n x: 0,\n y: 0\n };\n /** @type {Point} */\n\n this.prevP2 = {\n x: 0,\n y: 0\n };\n /** @type {Point} */\n\n this.startP1 = {\n x: 0,\n y: 0\n };\n /** @type {Point} */\n\n this.startP2 = {\n x: 0,\n y: 0\n };\n /** @type {Point} */\n\n this.velocity = {\n x: 0,\n y: 0\n };\n /** @type {Point}\r\n * @private\r\n */\n\n this._lastStartP1 = {\n x: 0,\n y: 0\n };\n /** @type {Point}\r\n * @private\r\n */\n\n this._intervalP1 = {\n x: 0,\n y: 0\n };\n /** @private */\n\n this._numActivePoints = 0;\n /** @type {Point[]}\r\n * @private\r\n */\n\n this._ongoingPointers = [];\n /** @private */\n\n this._touchEventEnabled = 'ontouchstart' in window;\n /** @private */\n\n this._pointerEventEnabled = !!window.PointerEvent;\n this.supportsTouch = this._touchEventEnabled || this._pointerEventEnabled && navigator.maxTouchPoints > 1;\n /** @private */\n\n this._numActivePoints = 0;\n /** @private */\n\n this._intervalTime = 0;\n /** @private */\n\n this._velocityCalculated = false;\n this.isMultitouch = false;\n this.isDragging = false;\n this.isZooming = false;\n /** @type {number | null} */\n\n this.raf = null;\n /** @type {NodeJS.Timeout | null}\r\n * @private\r\n */\n\n this._tapTimer = null;\n\n if (!this.supportsTouch) {\n // disable pan to next slide for non-touch devices\n pswp.options.allowPanToNext = false;\n }\n\n this.drag = new DragHandler(this);\n this.zoomLevels = new ZoomHandler(this);\n this.tapHandler = new TapHandler(this);\n pswp.on('bindEvents', () => {\n pswp.events.add(pswp.scrollWrap, 'click',\n /** @type EventListener */\n this._onClick.bind(this));\n\n if (this._pointerEventEnabled) {\n this._bindEvents('pointer', 'down', 'up', 'cancel');\n } else if (this._touchEventEnabled) {\n this._bindEvents('touch', 'start', 'end', 'cancel'); // In previous versions we also bound mouse event here,\n // in case device supports both touch and mouse events,\n // but newer versions of browsers now support PointerEvent.\n // on iOS10 if you bind touchmove/end after touchstart,\n // and you don't preventDefault touchstart (which PhotoSwipe does),\n // preventDefault will have no effect on touchmove and touchend.\n // Unless you bind it previously.\n\n\n if (pswp.scrollWrap) {\n pswp.scrollWrap.ontouchmove = () => {};\n\n pswp.scrollWrap.ontouchend = () => {};\n }\n } else {\n this._bindEvents('mouse', 'down', 'up');\n }\n });\n }\n /**\r\n * @private\r\n * @param {'mouse' | 'touch' | 'pointer'} pref\r\n * @param {'down' | 'start'} down\r\n * @param {'up' | 'end'} up\r\n * @param {'cancel'} [cancel]\r\n */\n\n\n _bindEvents(pref, down, up, cancel) {\n const {\n pswp\n } = this;\n const {\n events\n } = pswp;\n const cancelEvent = cancel ? pref + cancel : '';\n events.add(pswp.scrollWrap, pref + down,\n /** @type EventListener */\n this.onPointerDown.bind(this));\n events.add(window, pref + 'move',\n /** @type EventListener */\n this.onPointerMove.bind(this));\n events.add(window, pref + up,\n /** @type EventListener */\n this.onPointerUp.bind(this));\n\n if (cancelEvent) {\n events.add(pswp.scrollWrap, cancelEvent,\n /** @type EventListener */\n this.onPointerUp.bind(this));\n }\n }\n /**\r\n * @param {PointerEvent} e\r\n */\n\n\n onPointerDown(e) {\n // We do not call preventDefault for touch events\n // to allow browser to show native dialog on longpress\n // (the one that allows to save image or open it in new tab).\n //\n // Desktop Safari allows to drag images when preventDefault isn't called on mousedown,\n // even though preventDefault IS called on mousemove. That's why we preventDefault mousedown.\n const isMousePointer = e.type === 'mousedown' || e.pointerType === 'mouse'; // Allow dragging only via left mouse button.\n // http://www.quirksmode.org/js/events_properties.html\n // https://developer.mozilla.org/en-US/docs/Web/API/event.button\n\n if (isMousePointer && e.button > 0) {\n return;\n }\n\n const {\n pswp\n } = this; // if PhotoSwipe is opening or closing\n\n if (!pswp.opener.isOpen) {\n e.preventDefault();\n return;\n }\n\n if (pswp.dispatch('pointerDown', {\n originalEvent: e\n }).defaultPrevented) {\n return;\n }\n\n if (isMousePointer) {\n pswp.mouseDetected(); // preventDefault mouse event to prevent\n // browser image drag feature\n\n this._preventPointerEventBehaviour(e);\n }\n\n pswp.animations.stopAll();\n\n this._updatePoints(e, 'down');\n\n if (this._numActivePoints === 1) {\n this.dragAxis = null; // we need to store initial point to determine the main axis,\n // drag is activated only after the axis is determined\n\n equalizePoints(this.startP1, this.p1);\n }\n\n if (this._numActivePoints > 1) {\n // Tap or double tap should not trigger if more than one pointer\n this._clearTapTimer();\n\n this.isMultitouch = true;\n } else {\n this.isMultitouch = false;\n }\n }\n /**\r\n * @param {PointerEvent} e\r\n */\n\n\n onPointerMove(e) {\n e.preventDefault(); // always preventDefault move event\n\n if (!this._numActivePoints) {\n return;\n }\n\n this._updatePoints(e, 'move');\n\n if (this.pswp.dispatch('pointerMove', {\n originalEvent: e\n }).defaultPrevented) {\n return;\n }\n\n if (this._numActivePoints === 1 && !this.isDragging) {\n if (!this.dragAxis) {\n this._calculateDragDirection();\n } // Drag axis was detected, emit drag.start\n\n\n if (this.dragAxis && !this.isDragging) {\n if (this.isZooming) {\n this.isZooming = false;\n this.zoomLevels.end();\n }\n\n this.isDragging = true;\n\n this._clearTapTimer(); // Tap can not trigger after drag\n // Adjust starting point\n\n\n this._updateStartPoints();\n\n this._intervalTime = Date.now(); //this._startTime = this._intervalTime;\n\n this._velocityCalculated = false;\n equalizePoints(this._intervalP1, this.p1);\n this.velocity.x = 0;\n this.velocity.y = 0;\n this.drag.start();\n\n this._rafStopLoop();\n\n this._rafRenderLoop();\n }\n } else if (this._numActivePoints > 1 && !this.isZooming) {\n this._finishDrag();\n\n this.isZooming = true; // Adjust starting points\n\n this._updateStartPoints();\n\n this.zoomLevels.start();\n\n this._rafStopLoop();\n\n this._rafRenderLoop();\n }\n }\n /**\r\n * @private\r\n */\n\n\n _finishDrag() {\n if (this.isDragging) {\n this.isDragging = false; // Try to calculate velocity,\n // if it wasn't calculated yet in drag.change\n\n if (!this._velocityCalculated) {\n this._updateVelocity(true);\n }\n\n this.drag.end();\n this.dragAxis = null;\n }\n }\n /**\r\n * @param {PointerEvent} e\r\n */\n\n\n onPointerUp(e) {\n if (!this._numActivePoints) {\n return;\n }\n\n this._updatePoints(e, 'up');\n\n if (this.pswp.dispatch('pointerUp', {\n originalEvent: e\n }).defaultPrevented) {\n return;\n }\n\n if (this._numActivePoints === 0) {\n this._rafStopLoop();\n\n if (this.isDragging) {\n this._finishDrag();\n } else if (!this.isZooming && !this.isMultitouch) {\n //this.zoomLevels.correctZoomPan();\n this._finishTap(e);\n }\n }\n\n if (this._numActivePoints < 2 && this.isZooming) {\n this.isZooming = false;\n this.zoomLevels.end();\n\n if (this._numActivePoints === 1) {\n // Since we have 1 point left, we need to reinitiate drag\n this.dragAxis = null;\n\n this._updateStartPoints();\n }\n }\n }\n /**\r\n * @private\r\n */\n\n\n _rafRenderLoop() {\n if (this.isDragging || this.isZooming) {\n this._updateVelocity();\n\n if (this.isDragging) {\n // make sure that pointer moved since the last update\n if (!pointsEqual(this.p1, this.prevP1)) {\n this.drag.change();\n }\n } else\n /* if (this.isZooming) */\n {\n if (!pointsEqual(this.p1, this.prevP1) || !pointsEqual(this.p2, this.prevP2)) {\n this.zoomLevels.change();\n }\n }\n\n this._updatePrevPoints();\n\n this.raf = requestAnimationFrame(this._rafRenderLoop.bind(this));\n }\n }\n /**\r\n * Update velocity at 50ms interval\r\n *\r\n * @private\r\n * @param {boolean} [force]\r\n */\n\n\n _updateVelocity(force) {\n const time = Date.now();\n const duration = time - this._intervalTime;\n\n if (duration < 50 && !force) {\n return;\n }\n\n this.velocity.x = this._getVelocity('x', duration);\n this.velocity.y = this._getVelocity('y', duration);\n this._intervalTime = time;\n equalizePoints(this._intervalP1, this.p1);\n this._velocityCalculated = true;\n }\n /**\r\n * @private\r\n * @param {PointerEvent} e\r\n */\n\n\n _finishTap(e) {\n const {\n mainScroll\n } = this.pswp; // Do not trigger tap events if main scroll is shifted\n\n if (mainScroll.isShifted()) {\n // restore main scroll position\n // (usually happens if stopped in the middle of animation)\n mainScroll.moveIndexBy(0, true);\n return;\n } // Do not trigger tap for touchcancel or pointercancel\n\n\n if (e.type.indexOf('cancel') > 0) {\n return;\n } // Trigger click instead of tap for mouse events\n\n\n if (e.type === 'mouseup' || e.pointerType === 'mouse') {\n this.tapHandler.click(this.startP1, e);\n return;\n } // Disable delay if there is no doubleTapAction\n\n\n const tapDelay = this.pswp.options.doubleTapAction ? DOUBLE_TAP_DELAY : 0; // If tapTimer is defined - we tapped recently,\n // check if the current tap is close to the previous one,\n // if yes - trigger double tap\n\n if (this._tapTimer) {\n this._clearTapTimer(); // Check if two taps were more or less on the same place\n\n\n if (getDistanceBetween(this._lastStartP1, this.startP1) < MIN_TAP_DISTANCE) {\n this.tapHandler.doubleTap(this.startP1, e);\n }\n } else {\n equalizePoints(this._lastStartP1, this.startP1);\n this._tapTimer = setTimeout(() => {\n this.tapHandler.tap(this.startP1, e);\n\n this._clearTapTimer();\n }, tapDelay);\n }\n }\n /**\r\n * @private\r\n */\n\n\n _clearTapTimer() {\n if (this._tapTimer) {\n clearTimeout(this._tapTimer);\n this._tapTimer = null;\n }\n }\n /**\r\n * Get velocity for axis\r\n *\r\n * @private\r\n * @param {'x' | 'y'} axis\r\n * @param {number} duration\r\n * @returns {number}\r\n */\n\n\n _getVelocity(axis, duration) {\n // displacement is like distance, but can be negative.\n const displacement = this.p1[axis] - this._intervalP1[axis];\n\n if (Math.abs(displacement) > 1 && duration > 5) {\n return displacement / duration;\n }\n\n return 0;\n }\n /**\r\n * @private\r\n */\n\n\n _rafStopLoop() {\n if (this.raf) {\n cancelAnimationFrame(this.raf);\n this.raf = null;\n }\n }\n /**\r\n * @private\r\n * @param {PointerEvent} e\r\n */\n\n\n _preventPointerEventBehaviour(e) {\n // TODO find a way to disable e.preventDefault on some elements\n // via event or some class or something\n e.preventDefault();\n }\n /**\r\n * Parses and normalizes points from the touch, mouse or pointer event.\r\n * Updates p1 and p2.\r\n *\r\n * @private\r\n * @param {PointerEvent | TouchEvent} e\r\n * @param {'up' | 'down' | 'move'} pointerType Normalized pointer type\r\n */\n\n\n _updatePoints(e, pointerType) {\n if (this._pointerEventEnabled) {\n const pointerEvent =\n /** @type {PointerEvent} */\n e; // Try to find the current pointer in ongoing pointers by its ID\n\n const pointerIndex = this._ongoingPointers.findIndex(ongoingPointer => {\n return ongoingPointer.id === pointerEvent.pointerId;\n });\n\n if (pointerType === 'up' && pointerIndex > -1) {\n // release the pointer - remove it from ongoing\n this._ongoingPointers.splice(pointerIndex, 1);\n } else if (pointerType === 'down' && pointerIndex === -1) {\n // add new pointer\n this._ongoingPointers.push(this._convertEventPosToPoint(pointerEvent, {\n x: 0,\n y: 0\n }));\n } else if (pointerIndex > -1) {\n // update existing pointer\n this._convertEventPosToPoint(pointerEvent, this._ongoingPointers[pointerIndex]);\n }\n\n this._numActivePoints = this._ongoingPointers.length; // update points that PhotoSwipe uses\n // to calculate position and scale\n\n if (this._numActivePoints > 0) {\n equalizePoints(this.p1, this._ongoingPointers[0]);\n }\n\n if (this._numActivePoints > 1) {\n equalizePoints(this.p2, this._ongoingPointers[1]);\n }\n } else {\n const touchEvent =\n /** @type {TouchEvent} */\n e;\n this._numActivePoints = 0;\n\n if (touchEvent.type.indexOf('touch') > -1) {\n // Touch Event\n // https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent\n if (touchEvent.touches && touchEvent.touches.length > 0) {\n this._convertEventPosToPoint(touchEvent.touches[0], this.p1);\n\n this._numActivePoints++;\n\n if (touchEvent.touches.length > 1) {\n this._convertEventPosToPoint(touchEvent.touches[1], this.p2);\n\n this._numActivePoints++;\n }\n }\n } else {\n // Mouse Event\n this._convertEventPosToPoint(\n /** @type {PointerEvent} */\n e, this.p1);\n\n if (pointerType === 'up') {\n // clear all points on mouseup\n this._numActivePoints = 0;\n } else {\n this._numActivePoints++;\n }\n }\n }\n }\n /** update points that were used during previous rAF tick\r\n * @private\r\n */\n\n\n _updatePrevPoints() {\n equalizePoints(this.prevP1, this.p1);\n equalizePoints(this.prevP2, this.p2);\n }\n /** update points at the start of gesture\r\n * @private\r\n */\n\n\n _updateStartPoints() {\n equalizePoints(this.startP1, this.p1);\n equalizePoints(this.startP2, this.p2);\n\n this._updatePrevPoints();\n }\n /** @private */\n\n\n _calculateDragDirection() {\n if (this.pswp.mainScroll.isShifted()) {\n // if main scroll position is shifted – direction is always horizontal\n this.dragAxis = 'x';\n } else {\n // calculate delta of the last touchmove tick\n const diff = Math.abs(this.p1.x - this.startP1.x) - Math.abs(this.p1.y - this.startP1.y);\n\n if (diff !== 0) {\n // check if pointer was shifted horizontally or vertically\n const axisToCheck = diff > 0 ? 'x' : 'y';\n\n if (Math.abs(this.p1[axisToCheck] - this.startP1[axisToCheck]) >= AXIS_SWIPE_HYSTERISIS) {\n this.dragAxis = axisToCheck;\n }\n }\n }\n }\n /**\r\n * Converts touch, pointer or mouse event\r\n * to PhotoSwipe point.\r\n *\r\n * @private\r\n * @param {Touch | PointerEvent} e\r\n * @param {Point} p\r\n * @returns {Point}\r\n */\n\n\n _convertEventPosToPoint(e, p) {\n p.x = e.pageX - this.pswp.offset.x;\n p.y = e.pageY - this.pswp.offset.y;\n\n if ('pointerId' in e) {\n p.id = e.pointerId;\n } else if (e.identifier !== undefined) {\n p.id = e.identifier;\n }\n\n return p;\n }\n /**\r\n * @private\r\n * @param {PointerEvent} e\r\n */\n\n\n _onClick(e) {\n // Do not allow click event to pass through after drag\n if (this.pswp.mainScroll.isShifted()) {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n\n}\n\n/** @typedef {import('./photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('./slide/slide.js').default} Slide */\n\n/** @typedef {{ el: HTMLDivElement; slide?: Slide }} ItemHolder */\n\nconst MAIN_SCROLL_END_FRICTION = 0.35; // const MIN_SWIPE_TRANSITION_DURATION = 250;\n// const MAX_SWIPE_TRABSITION_DURATION = 500;\n// const DEFAULT_SWIPE_TRANSITION_DURATION = 333;\n\n/**\r\n * Handles movement of the main scrolling container\r\n * (for example, it repositions when user swipes left or right).\r\n *\r\n * Also stores its state.\r\n */\n\nclass MainScroll {\n /**\r\n * @param {PhotoSwipe} pswp\r\n */\n constructor(pswp) {\n this.pswp = pswp;\n this.x = 0;\n this.slideWidth = 0;\n /** @private */\n\n this._currPositionIndex = 0;\n /** @private */\n\n this._prevPositionIndex = 0;\n /** @private */\n\n this._containerShiftIndex = -1;\n /** @type {ItemHolder[]} */\n\n this.itemHolders = [];\n }\n /**\r\n * Position the scroller and slide containers\r\n * according to viewport size.\r\n *\r\n * @param {boolean} [resizeSlides] Whether slides content should resized\r\n */\n\n\n resize(resizeSlides) {\n const {\n pswp\n } = this;\n const newSlideWidth = Math.round(pswp.viewportSize.x + pswp.viewportSize.x * pswp.options.spacing); // Mobile browsers might trigger a resize event during a gesture.\n // (due to toolbar appearing or hiding).\n // Avoid re-adjusting main scroll position if width wasn't changed\n\n const slideWidthChanged = newSlideWidth !== this.slideWidth;\n\n if (slideWidthChanged) {\n this.slideWidth = newSlideWidth;\n this.moveTo(this.getCurrSlideX());\n }\n\n this.itemHolders.forEach((itemHolder, index) => {\n if (slideWidthChanged) {\n setTransform(itemHolder.el, (index + this._containerShiftIndex) * this.slideWidth);\n }\n\n if (resizeSlides && itemHolder.slide) {\n itemHolder.slide.resize();\n }\n });\n }\n /**\r\n * Reset X position of the main scroller to zero\r\n */\n\n\n resetPosition() {\n // Position on the main scroller (offset)\n // it is independent from slide index\n this._currPositionIndex = 0;\n this._prevPositionIndex = 0; // This will force recalculation of size on next resize()\n\n this.slideWidth = 0; // _containerShiftIndex*viewportSize will give you amount of transform of the current slide\n\n this._containerShiftIndex = -1;\n }\n /**\r\n * Create and append array of three items\r\n * that hold data about slides in DOM\r\n */\n\n\n appendHolders() {\n this.itemHolders = []; // append our three slide holders -\n // previous, current, and next\n\n for (let i = 0; i < 3; i++) {\n const el = createElement('pswp__item', 'div', this.pswp.container);\n el.setAttribute('role', 'group');\n el.setAttribute('aria-roledescription', 'slide');\n el.setAttribute('aria-hidden', 'true'); // hide nearby item holders until initial zoom animation finishes (to avoid extra Paints)\n\n el.style.display = i === 1 ? 'block' : 'none';\n this.itemHolders.push({\n el //index: -1\n\n });\n }\n }\n /**\r\n * Whether the main scroll can be horizontally swiped to the next or previous slide.\r\n * @returns {boolean}\r\n */\n\n\n canBeSwiped() {\n return this.pswp.getNumItems() > 1;\n }\n /**\r\n * Move main scroll by X amount of slides.\r\n * For example:\r\n * `-1` will move to the previous slide,\r\n * `0` will reset the scroll position of the current slide,\r\n * `3` will move three slides forward\r\n *\r\n * If loop option is enabled - index will be automatically looped too,\r\n * (for example `-1` will move to the last slide of the gallery).\r\n *\r\n * @param {number} diff\r\n * @param {boolean} [animate]\r\n * @param {number} [velocityX]\r\n * @returns {boolean} whether index was changed or not\r\n */\n\n\n moveIndexBy(diff, animate, velocityX) {\n const {\n pswp\n } = this;\n let newIndex = pswp.potentialIndex + diff;\n const numSlides = pswp.getNumItems();\n\n if (pswp.canLoop()) {\n newIndex = pswp.getLoopedIndex(newIndex);\n const distance = (diff + numSlides) % numSlides;\n\n if (distance <= numSlides / 2) {\n // go forward\n diff = distance;\n } else {\n // go backwards\n diff = distance - numSlides;\n }\n } else {\n if (newIndex < 0) {\n newIndex = 0;\n } else if (newIndex >= numSlides) {\n newIndex = numSlides - 1;\n }\n\n diff = newIndex - pswp.potentialIndex;\n }\n\n pswp.potentialIndex = newIndex;\n this._currPositionIndex -= diff;\n pswp.animations.stopMainScroll();\n const destinationX = this.getCurrSlideX();\n\n if (!animate) {\n this.moveTo(destinationX);\n this.updateCurrItem();\n } else {\n pswp.animations.startSpring({\n isMainScroll: true,\n start: this.x,\n end: destinationX,\n velocity: velocityX || 0,\n naturalFrequency: 30,\n dampingRatio: 1,\n //0.7,\n onUpdate: x => {\n this.moveTo(x);\n },\n onComplete: () => {\n this.updateCurrItem();\n pswp.appendHeavy();\n }\n });\n let currDiff = pswp.potentialIndex - pswp.currIndex;\n\n if (pswp.canLoop()) {\n const currDistance = (currDiff + numSlides) % numSlides;\n\n if (currDistance <= numSlides / 2) {\n // go forward\n currDiff = currDistance;\n } else {\n // go backwards\n currDiff = currDistance - numSlides;\n }\n } // Force-append new slides during transition\n // if difference between slides is more than 1\n\n\n if (Math.abs(currDiff) > 1) {\n this.updateCurrItem();\n }\n }\n\n return Boolean(diff);\n }\n /**\r\n * X position of the main scroll for the current slide\r\n * (ignores position during dragging)\r\n * @returns {number}\r\n */\n\n\n getCurrSlideX() {\n return this.slideWidth * this._currPositionIndex;\n }\n /**\r\n * Whether scroll position is shifted.\r\n * For example, it will return true if the scroll is being dragged or animated.\r\n * @returns {boolean}\r\n */\n\n\n isShifted() {\n return this.x !== this.getCurrSlideX();\n }\n /**\r\n * Update slides X positions and set their content\r\n */\n\n\n updateCurrItem() {\n var _this$itemHolders$;\n\n const {\n pswp\n } = this;\n const positionDifference = this._prevPositionIndex - this._currPositionIndex;\n\n if (!positionDifference) {\n return;\n }\n\n this._prevPositionIndex = this._currPositionIndex;\n pswp.currIndex = pswp.potentialIndex;\n let diffAbs = Math.abs(positionDifference);\n /** @type {ItemHolder | undefined} */\n\n let tempHolder;\n\n if (diffAbs >= 3) {\n this._containerShiftIndex += positionDifference + (positionDifference > 0 ? -3 : 3);\n diffAbs = 3;\n }\n\n for (let i = 0; i < diffAbs; i++) {\n if (positionDifference > 0) {\n tempHolder = this.itemHolders.shift();\n\n if (tempHolder) {\n this.itemHolders[2] = tempHolder; // move first to last\n\n this._containerShiftIndex++;\n setTransform(tempHolder.el, (this._containerShiftIndex + 2) * this.slideWidth);\n pswp.setContent(tempHolder, pswp.currIndex - diffAbs + i + 2);\n }\n } else {\n tempHolder = this.itemHolders.pop();\n\n if (tempHolder) {\n this.itemHolders.unshift(tempHolder); // move last to first\n\n this._containerShiftIndex--;\n setTransform(tempHolder.el, this._containerShiftIndex * this.slideWidth);\n pswp.setContent(tempHolder, pswp.currIndex + diffAbs - i - 2);\n }\n }\n } // Reset transfrom every 50ish navigations in one direction.\n //\n // Otherwise transform will keep growing indefinitely,\n // which might cause issues as browsers have a maximum transform limit.\n // I wasn't able to reach it, but just to be safe.\n // This should not cause noticable lag.\n\n\n if (Math.abs(this._containerShiftIndex) > 50 && !this.isShifted()) {\n this.resetPosition();\n this.resize();\n } // Pan transition might be running (and consntantly updating pan position)\n\n\n pswp.animations.stopAllPan();\n this.itemHolders.forEach((itemHolder, i) => {\n if (itemHolder.slide) {\n // Slide in the 2nd holder is always active\n itemHolder.slide.setIsActive(i === 1);\n }\n });\n pswp.currSlide = (_this$itemHolders$ = this.itemHolders[1]) === null || _this$itemHolders$ === void 0 ? void 0 : _this$itemHolders$.slide;\n pswp.contentLoader.updateLazy(positionDifference);\n\n if (pswp.currSlide) {\n pswp.currSlide.applyCurrentZoomPan();\n }\n\n pswp.dispatch('change');\n }\n /**\r\n * Move the X position of the main scroll container\r\n *\r\n * @param {number} x\r\n * @param {boolean} [dragging]\r\n */\n\n\n moveTo(x, dragging) {\n if (!this.pswp.canLoop() && dragging) {\n // Apply friction\n let newSlideIndexOffset = (this.slideWidth * this._currPositionIndex - x) / this.slideWidth;\n newSlideIndexOffset += this.pswp.currIndex;\n const delta = Math.round(x - this.x);\n\n if (newSlideIndexOffset < 0 && delta > 0 || newSlideIndexOffset >= this.pswp.getNumItems() - 1 && delta < 0) {\n x = this.x + delta * MAIN_SCROLL_END_FRICTION;\n }\n }\n\n this.x = x;\n\n if (this.pswp.container) {\n setTransform(this.pswp.container, x);\n }\n\n this.pswp.dispatch('moveMainScroll', {\n x,\n dragging: dragging !== null && dragging !== void 0 ? dragging : false\n });\n }\n\n}\n\n/** @typedef {import('./photoswipe.js').default} PhotoSwipe */\n\n/**\r\n * @template T\r\n * @typedef {import('./types.js').Methods} Methods\r\n */\n\nconst KeyboardKeyCodesMap = {\n Escape: 27,\n z: 90,\n ArrowLeft: 37,\n ArrowUp: 38,\n ArrowRight: 39,\n ArrowDown: 40,\n Tab: 9\n};\n/**\r\n * @template {keyof KeyboardKeyCodesMap} T\r\n * @param {T} key\r\n * @param {boolean} isKeySupported\r\n * @returns {T | number | undefined}\r\n */\n\nconst getKeyboardEventKey = (key, isKeySupported) => {\n return isKeySupported ? key : KeyboardKeyCodesMap[key];\n};\n/**\r\n * - Manages keyboard shortcuts.\r\n * - Helps trap focus within photoswipe.\r\n */\n\n\nclass Keyboard {\n /**\r\n * @param {PhotoSwipe} pswp\r\n */\n constructor(pswp) {\n this.pswp = pswp;\n /** @private */\n\n this._wasFocused = false;\n pswp.on('bindEvents', () => {\n // Dialog was likely opened by keyboard if initial point is not defined\n if (!pswp.options.initialPointerPos) {\n // focus causes layout,\n // which causes lag during the animation,\n // that's why we delay it until the opener transition ends\n this._focusRoot();\n }\n\n pswp.events.add(document, 'focusin',\n /** @type EventListener */\n this._onFocusIn.bind(this));\n pswp.events.add(document, 'keydown',\n /** @type EventListener */\n this._onKeyDown.bind(this));\n });\n const lastActiveElement =\n /** @type {HTMLElement} */\n document.activeElement;\n pswp.on('destroy', () => {\n if (pswp.options.returnFocus && lastActiveElement && this._wasFocused) {\n lastActiveElement.focus();\n }\n });\n }\n /** @private */\n\n\n _focusRoot() {\n if (!this._wasFocused && this.pswp.element) {\n this.pswp.element.focus();\n this._wasFocused = true;\n }\n }\n /**\r\n * @private\r\n * @param {KeyboardEvent} e\r\n */\n\n\n _onKeyDown(e) {\n const {\n pswp\n } = this;\n\n if (pswp.dispatch('keydown', {\n originalEvent: e\n }).defaultPrevented) {\n return;\n }\n\n if (specialKeyUsed(e)) {\n // don't do anything if special key pressed\n // to prevent from overriding default browser actions\n // for example, in Chrome on Mac cmd+arrow-left returns to previous page\n return;\n }\n /** @type {Methods | undefined} */\n\n\n let keydownAction;\n /** @type {'x' | 'y' | undefined} */\n\n let axis;\n let isForward = false;\n const isKeySupported = ('key' in e);\n\n switch (isKeySupported ? e.key : e.keyCode) {\n case getKeyboardEventKey('Escape', isKeySupported):\n if (pswp.options.escKey) {\n keydownAction = 'close';\n }\n\n break;\n\n case getKeyboardEventKey('z', isKeySupported):\n keydownAction = 'toggleZoom';\n break;\n\n case getKeyboardEventKey('ArrowLeft', isKeySupported):\n axis = 'x';\n break;\n\n case getKeyboardEventKey('ArrowUp', isKeySupported):\n axis = 'y';\n break;\n\n case getKeyboardEventKey('ArrowRight', isKeySupported):\n axis = 'x';\n isForward = true;\n break;\n\n case getKeyboardEventKey('ArrowDown', isKeySupported):\n isForward = true;\n axis = 'y';\n break;\n\n case getKeyboardEventKey('Tab', isKeySupported):\n this._focusRoot();\n\n break;\n } // if left/right/top/bottom key\n\n\n if (axis) {\n // prevent page scroll\n e.preventDefault();\n const {\n currSlide\n } = pswp;\n\n if (pswp.options.arrowKeys && axis === 'x' && pswp.getNumItems() > 1) {\n keydownAction = isForward ? 'next' : 'prev';\n } else if (currSlide && currSlide.currZoomLevel > currSlide.zoomLevels.fit) {\n // up/down arrow keys pan the image vertically\n // left/right arrow keys pan horizontally.\n // Unless there is only one image,\n // or arrowKeys option is disabled\n currSlide.pan[axis] += isForward ? -80 : 80;\n currSlide.panTo(currSlide.pan.x, currSlide.pan.y);\n }\n }\n\n if (keydownAction) {\n e.preventDefault(); // @ts-ignore\n\n pswp[keydownAction]();\n }\n }\n /**\r\n * Trap focus inside photoswipe\r\n *\r\n * @private\r\n * @param {FocusEvent} e\r\n */\n\n\n _onFocusIn(e) {\n const {\n template\n } = this.pswp;\n\n if (template && document !== e.target && template !== e.target && !template.contains(\n /** @type {Node} */\n e.target)) {\n // focus root element\n template.focus();\n }\n }\n\n}\n\nconst DEFAULT_EASING = 'cubic-bezier(.4,0,.22,1)';\n/** @typedef {import('./animations.js').SharedAnimationProps} SharedAnimationProps */\n\n/** @typedef {Object} DefaultCssAnimationProps\r\n *\r\n * @prop {HTMLElement} target\r\n * @prop {number} [duration]\r\n * @prop {string} [easing]\r\n * @prop {string} [transform]\r\n * @prop {string} [opacity]\r\n * */\n\n/** @typedef {SharedAnimationProps & DefaultCssAnimationProps} CssAnimationProps */\n\n/**\r\n * Runs CSS transition.\r\n */\n\nclass CSSAnimation {\n /**\r\n * onComplete can be unpredictable, be careful about current state\r\n *\r\n * @param {CssAnimationProps} props\r\n */\n constructor(props) {\n var _props$prop;\n\n this.props = props;\n const {\n target,\n onComplete,\n transform,\n onFinish = () => {},\n duration = 333,\n easing = DEFAULT_EASING\n } = props;\n this.onFinish = onFinish; // support only transform and opacity\n\n const prop = transform ? 'transform' : 'opacity';\n const propValue = (_props$prop = props[prop]) !== null && _props$prop !== void 0 ? _props$prop : '';\n /** @private */\n\n this._target = target;\n /** @private */\n\n this._onComplete = onComplete;\n /** @private */\n\n this._finished = false;\n /** @private */\n\n this._onTransitionEnd = this._onTransitionEnd.bind(this); // Using timeout hack to make sure that animation\n // starts even if the animated property was changed recently,\n // otherwise transitionend might not fire or transition won't start.\n // https://drafts.csswg.org/css-transitions/#starting\n //\n // ¯\\_(ツ)_/¯\n\n /** @private */\n\n this._helperTimeout = setTimeout(() => {\n setTransitionStyle(target, prop, duration, easing);\n this._helperTimeout = setTimeout(() => {\n target.addEventListener('transitionend', this._onTransitionEnd, false);\n target.addEventListener('transitioncancel', this._onTransitionEnd, false); // Safari occasionally does not emit transitionend event\n // if element property was modified during the transition,\n // which may be caused by resize or third party component,\n // using timeout as a safety fallback\n\n this._helperTimeout = setTimeout(() => {\n this._finalizeAnimation();\n }, duration + 500);\n target.style[prop] = propValue;\n }, 30); // Do not reduce this number\n }, 0);\n }\n /**\r\n * @private\r\n * @param {TransitionEvent} e\r\n */\n\n\n _onTransitionEnd(e) {\n if (e.target === this._target) {\n this._finalizeAnimation();\n }\n }\n /**\r\n * @private\r\n */\n\n\n _finalizeAnimation() {\n if (!this._finished) {\n this._finished = true;\n this.onFinish();\n\n if (this._onComplete) {\n this._onComplete();\n }\n }\n } // Destroy is called automatically onFinish\n\n\n destroy() {\n if (this._helperTimeout) {\n clearTimeout(this._helperTimeout);\n }\n\n removeTransitionStyle(this._target);\n\n this._target.removeEventListener('transitionend', this._onTransitionEnd, false);\n\n this._target.removeEventListener('transitioncancel', this._onTransitionEnd, false);\n\n if (!this._finished) {\n this._finalizeAnimation();\n }\n }\n\n}\n\nconst DEFAULT_NATURAL_FREQUENCY = 12;\nconst DEFAULT_DAMPING_RATIO = 0.75;\n/**\r\n * Spring easing helper\r\n */\n\nclass SpringEaser {\n /**\r\n * @param {number} initialVelocity Initial velocity, px per ms.\r\n *\r\n * @param {number} [dampingRatio]\r\n * Determines how bouncy animation will be.\r\n * From 0 to 1, 0 - always overshoot, 1 - do not overshoot.\r\n * \"overshoot\" refers to part of animation that\r\n * goes beyond the final value.\r\n *\r\n * @param {number} [naturalFrequency]\r\n * Determines how fast animation will slow down.\r\n * The higher value - the stiffer the transition will be,\r\n * and the faster it will slow down.\r\n * Recommended value from 10 to 50\r\n */\n constructor(initialVelocity, dampingRatio, naturalFrequency) {\n this.velocity = initialVelocity * 1000; // convert to \"pixels per second\"\n // https://en.wikipedia.org/wiki/Damping_ratio\n\n this._dampingRatio = dampingRatio || DEFAULT_DAMPING_RATIO; // https://en.wikipedia.org/wiki/Natural_frequency\n\n this._naturalFrequency = naturalFrequency || DEFAULT_NATURAL_FREQUENCY;\n this._dampedFrequency = this._naturalFrequency;\n\n if (this._dampingRatio < 1) {\n this._dampedFrequency *= Math.sqrt(1 - this._dampingRatio * this._dampingRatio);\n }\n }\n /**\r\n * @param {number} deltaPosition Difference between current and end position of the animation\r\n * @param {number} deltaTime Frame duration in milliseconds\r\n *\r\n * @returns {number} Displacement, relative to the end position.\r\n */\n\n\n easeFrame(deltaPosition, deltaTime) {\n // Inspired by Apple Webkit and Android spring function implementation\n // https://en.wikipedia.org/wiki/Oscillation\n // https://en.wikipedia.org/wiki/Damping_ratio\n // we ignore mass (assume that it's 1kg)\n let displacement = 0;\n let coeff;\n deltaTime /= 1000;\n const naturalDumpingPow = Math.E ** (-this._dampingRatio * this._naturalFrequency * deltaTime);\n\n if (this._dampingRatio === 1) {\n coeff = this.velocity + this._naturalFrequency * deltaPosition;\n displacement = (deltaPosition + coeff * deltaTime) * naturalDumpingPow;\n this.velocity = displacement * -this._naturalFrequency + coeff * naturalDumpingPow;\n } else if (this._dampingRatio < 1) {\n coeff = 1 / this._dampedFrequency * (this._dampingRatio * this._naturalFrequency * deltaPosition + this.velocity);\n const dumpedFCos = Math.cos(this._dampedFrequency * deltaTime);\n const dumpedFSin = Math.sin(this._dampedFrequency * deltaTime);\n displacement = naturalDumpingPow * (deltaPosition * dumpedFCos + coeff * dumpedFSin);\n this.velocity = displacement * -this._naturalFrequency * this._dampingRatio + naturalDumpingPow * (-this._dampedFrequency * deltaPosition * dumpedFSin + this._dampedFrequency * coeff * dumpedFCos);\n } // Overdamped (>1) damping ratio is not supported\n\n\n return displacement;\n }\n\n}\n\n/** @typedef {import('./animations.js').SharedAnimationProps} SharedAnimationProps */\n\n/**\r\n * @typedef {Object} DefaultSpringAnimationProps\r\n *\r\n * @prop {number} start\r\n * @prop {number} end\r\n * @prop {number} velocity\r\n * @prop {number} [dampingRatio]\r\n * @prop {number} [naturalFrequency]\r\n * @prop {(end: number) => void} onUpdate\r\n */\n\n/** @typedef {SharedAnimationProps & DefaultSpringAnimationProps} SpringAnimationProps */\n\nclass SpringAnimation {\n /**\r\n * @param {SpringAnimationProps} props\r\n */\n constructor(props) {\n this.props = props;\n this._raf = 0;\n const {\n start,\n end,\n velocity,\n onUpdate,\n onComplete,\n onFinish = () => {},\n dampingRatio,\n naturalFrequency\n } = props;\n this.onFinish = onFinish;\n const easer = new SpringEaser(velocity, dampingRatio, naturalFrequency);\n let prevTime = Date.now();\n let deltaPosition = start - end;\n\n const animationLoop = () => {\n if (this._raf) {\n deltaPosition = easer.easeFrame(deltaPosition, Date.now() - prevTime); // Stop the animation if velocity is low and position is close to end\n\n if (Math.abs(deltaPosition) < 1 && Math.abs(easer.velocity) < 50) {\n // Finalize the animation\n onUpdate(end);\n\n if (onComplete) {\n onComplete();\n }\n\n this.onFinish();\n } else {\n prevTime = Date.now();\n onUpdate(deltaPosition + end);\n this._raf = requestAnimationFrame(animationLoop);\n }\n }\n };\n\n this._raf = requestAnimationFrame(animationLoop);\n } // Destroy is called automatically onFinish\n\n\n destroy() {\n if (this._raf >= 0) {\n cancelAnimationFrame(this._raf);\n }\n\n this._raf = 0;\n }\n\n}\n\n/** @typedef {import('./css-animation.js').CssAnimationProps} CssAnimationProps */\n\n/** @typedef {import('./spring-animation.js').SpringAnimationProps} SpringAnimationProps */\n\n/** @typedef {Object} SharedAnimationProps\r\n * @prop {string} [name]\r\n * @prop {boolean} [isPan]\r\n * @prop {boolean} [isMainScroll]\r\n * @prop {VoidFunction} [onComplete]\r\n * @prop {VoidFunction} [onFinish]\r\n */\n\n/** @typedef {SpringAnimation | CSSAnimation} Animation */\n\n/** @typedef {SpringAnimationProps | CssAnimationProps} AnimationProps */\n\n/**\r\n * Manages animations\r\n */\n\nclass Animations {\n constructor() {\n /** @type {Animation[]} */\n this.activeAnimations = [];\n }\n /**\r\n * @param {SpringAnimationProps} props\r\n */\n\n\n startSpring(props) {\n this._start(props, true);\n }\n /**\r\n * @param {CssAnimationProps} props\r\n */\n\n\n startTransition(props) {\n this._start(props);\n }\n /**\r\n * @private\r\n * @param {AnimationProps} props\r\n * @param {boolean} [isSpring]\r\n * @returns {Animation}\r\n */\n\n\n _start(props, isSpring) {\n const animation = isSpring ? new SpringAnimation(\n /** @type SpringAnimationProps */\n props) : new CSSAnimation(\n /** @type CssAnimationProps */\n props);\n this.activeAnimations.push(animation);\n\n animation.onFinish = () => this.stop(animation);\n\n return animation;\n }\n /**\r\n * @param {Animation} animation\r\n */\n\n\n stop(animation) {\n animation.destroy();\n const index = this.activeAnimations.indexOf(animation);\n\n if (index > -1) {\n this.activeAnimations.splice(index, 1);\n }\n }\n\n stopAll() {\n // _stopAllAnimations\n this.activeAnimations.forEach(animation => {\n animation.destroy();\n });\n this.activeAnimations = [];\n }\n /**\r\n * Stop all pan or zoom transitions\r\n */\n\n\n stopAllPan() {\n this.activeAnimations = this.activeAnimations.filter(animation => {\n if (animation.props.isPan) {\n animation.destroy();\n return false;\n }\n\n return true;\n });\n }\n\n stopMainScroll() {\n this.activeAnimations = this.activeAnimations.filter(animation => {\n if (animation.props.isMainScroll) {\n animation.destroy();\n return false;\n }\n\n return true;\n });\n }\n /**\r\n * Returns true if main scroll transition is running\r\n */\n // isMainScrollRunning() {\n // return this.activeAnimations.some((animation) => {\n // return animation.props.isMainScroll;\n // });\n // }\n\n /**\r\n * Returns true if any pan or zoom transition is running\r\n */\n\n\n isPanRunning() {\n return this.activeAnimations.some(animation => {\n return animation.props.isPan;\n });\n }\n\n}\n\n/** @typedef {import('./photoswipe.js').default} PhotoSwipe */\n\n/**\r\n * Handles scroll wheel.\r\n * Can pan and zoom current slide image.\r\n */\nclass ScrollWheel {\n /**\r\n * @param {PhotoSwipe} pswp\r\n */\n constructor(pswp) {\n this.pswp = pswp;\n pswp.events.add(pswp.element, 'wheel',\n /** @type EventListener */\n this._onWheel.bind(this));\n }\n /**\r\n * @private\r\n * @param {WheelEvent} e\r\n */\n\n\n _onWheel(e) {\n e.preventDefault();\n const {\n currSlide\n } = this.pswp;\n let {\n deltaX,\n deltaY\n } = e;\n\n if (!currSlide) {\n return;\n }\n\n if (this.pswp.dispatch('wheel', {\n originalEvent: e\n }).defaultPrevented) {\n return;\n }\n\n if (e.ctrlKey || this.pswp.options.wheelToZoom) {\n // zoom\n if (currSlide.isZoomable()) {\n let zoomFactor = -deltaY;\n\n if (e.deltaMode === 1\n /* DOM_DELTA_LINE */\n ) {\n zoomFactor *= 0.05;\n } else {\n zoomFactor *= e.deltaMode ? 1 : 0.002;\n }\n\n zoomFactor = 2 ** zoomFactor;\n const destZoomLevel = currSlide.currZoomLevel * zoomFactor;\n currSlide.zoomTo(destZoomLevel, {\n x: e.clientX,\n y: e.clientY\n });\n }\n } else {\n // pan\n if (currSlide.isPannable()) {\n if (e.deltaMode === 1\n /* DOM_DELTA_LINE */\n ) {\n // 18 - average line height\n deltaX *= 18;\n deltaY *= 18;\n }\n\n currSlide.panTo(currSlide.pan.x - deltaX, currSlide.pan.y - deltaY);\n }\n }\n }\n\n}\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/**\r\n * @template T\r\n * @typedef {import('../types.js').Methods} Methods\r\n */\n\n/**\r\n * @typedef {Object} UIElementMarkupProps\r\n * @prop {boolean} [isCustomSVG]\r\n * @prop {string} inner\r\n * @prop {string} [outlineID]\r\n * @prop {number | string} [size]\r\n */\n\n/**\r\n * @typedef {Object} UIElementData\r\n * @prop {DefaultUIElements | string} [name]\r\n * @prop {string} [className]\r\n * @prop {UIElementMarkup} [html]\r\n * @prop {boolean} [isButton]\r\n * @prop {keyof HTMLElementTagNameMap} [tagName]\r\n * @prop {string} [title]\r\n * @prop {string} [ariaLabel]\r\n * @prop {(element: HTMLElement, pswp: PhotoSwipe) => void} [onInit]\r\n * @prop {Methods | ((e: MouseEvent, element: HTMLElement, pswp: PhotoSwipe) => void)} [onClick]\r\n * @prop {'bar' | 'wrapper' | 'root'} [appendTo]\r\n * @prop {number} [order]\r\n */\n\n/** @typedef {'arrowPrev' | 'arrowNext' | 'close' | 'zoom' | 'counter'} DefaultUIElements */\n\n/** @typedef {string | UIElementMarkupProps} UIElementMarkup */\n\n/**\r\n * @param {UIElementMarkup} [htmlData]\r\n * @returns {string}\r\n */\n\nfunction addElementHTML(htmlData) {\n if (typeof htmlData === 'string') {\n // Allow developers to provide full svg,\n // For example:\n // \n // \n // \n // \n // Can also be any HTML string.\n return htmlData;\n }\n\n if (!htmlData || !htmlData.isCustomSVG) {\n return '';\n }\n\n const svgData = htmlData;\n let out = ''; // replace all %d with size\n\n out = out.split('%d').join(\n /** @type {string} */\n svgData.size || 32); // Icons may contain outline/shadow,\n // to make it we \"clone\" base icon shape and add border to it.\n // Icon itself and border are styled via CSS.\n //\n // Property shadowID defines ID of element that should be cloned.\n\n if (svgData.outlineID) {\n out += '';\n }\n\n out += svgData.inner;\n out += '';\n return out;\n}\n\nclass UIElement {\n /**\r\n * @param {PhotoSwipe} pswp\r\n * @param {UIElementData} data\r\n */\n constructor(pswp, data) {\n var _container;\n\n const name = data.name || data.className;\n let elementHTML = data.html; // @ts-expect-error lookup only by `data.name` maybe?\n\n if (pswp.options[name] === false) {\n // exit if element is disabled from options\n return;\n } // Allow to override SVG icons from options\n // @ts-expect-error lookup only by `data.name` maybe?\n\n\n if (typeof pswp.options[name + 'SVG'] === 'string') {\n // arrowPrevSVG\n // arrowNextSVG\n // closeSVG\n // zoomSVG\n // @ts-expect-error lookup only by `data.name` maybe?\n elementHTML = pswp.options[name + 'SVG'];\n }\n\n pswp.dispatch('uiElementCreate', {\n data\n });\n let className = '';\n\n if (data.isButton) {\n className += 'pswp__button ';\n className += data.className || `pswp__button--${data.name}`;\n } else {\n className += data.className || `pswp__${data.name}`;\n }\n\n let tagName = data.isButton ? data.tagName || 'button' : data.tagName || 'div';\n tagName =\n /** @type {keyof HTMLElementTagNameMap} */\n tagName.toLowerCase();\n /** @type {HTMLElement} */\n\n const element = createElement(className, tagName);\n\n if (data.isButton) {\n if (tagName === 'button') {\n /** @type {HTMLButtonElement} */\n element.type = 'button';\n }\n\n let {\n title\n } = data;\n const {\n ariaLabel\n } = data; // @ts-expect-error lookup only by `data.name` maybe?\n\n if (typeof pswp.options[name + 'Title'] === 'string') {\n // @ts-expect-error lookup only by `data.name` maybe?\n title = pswp.options[name + 'Title'];\n }\n\n if (title) {\n element.title = title;\n }\n\n const ariaText = ariaLabel || title;\n\n if (ariaText) {\n element.setAttribute('aria-label', ariaText);\n }\n }\n\n element.innerHTML = addElementHTML(elementHTML);\n\n if (data.onInit) {\n data.onInit(element, pswp);\n }\n\n if (data.onClick) {\n element.onclick = e => {\n if (typeof data.onClick === 'string') {\n // @ts-ignore\n pswp[data.onClick]();\n } else if (typeof data.onClick === 'function') {\n data.onClick(e, element, pswp);\n }\n };\n } // Top bar is default position\n\n\n const appendTo = data.appendTo || 'bar';\n /** @type {HTMLElement | undefined} root element by default */\n\n let container = pswp.element;\n\n if (appendTo === 'bar') {\n if (!pswp.topBar) {\n pswp.topBar = createElement('pswp__top-bar pswp__hide-on-close', 'div', pswp.scrollWrap);\n }\n\n container = pswp.topBar;\n } else {\n // element outside of top bar gets a secondary class\n // that makes element fade out on close\n element.classList.add('pswp__hide-on-close');\n\n if (appendTo === 'wrapper') {\n container = pswp.scrollWrap;\n }\n }\n\n (_container = container) === null || _container === void 0 || _container.appendChild(pswp.applyFilters('uiElement', element, data));\n }\n\n}\n\n/*\r\n Backward and forward arrow buttons\r\n */\n\n/** @typedef {import('./ui-element.js').UIElementData} UIElementData */\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/**\r\n *\r\n * @param {HTMLElement} element\r\n * @param {PhotoSwipe} pswp\r\n * @param {boolean} [isNextButton]\r\n */\nfunction initArrowButton(element, pswp, isNextButton) {\n element.classList.add('pswp__button--arrow'); // TODO: this should point to a unique id for this instance\n\n element.setAttribute('aria-controls', 'pswp__items');\n pswp.on('change', () => {\n if (!pswp.options.loop) {\n if (isNextButton) {\n /** @type {HTMLButtonElement} */\n element.disabled = !(pswp.currIndex < pswp.getNumItems() - 1);\n } else {\n /** @type {HTMLButtonElement} */\n element.disabled = !(pswp.currIndex > 0);\n }\n }\n });\n}\n/** @type {UIElementData} */\n\n\nconst arrowPrev = {\n name: 'arrowPrev',\n className: 'pswp__button--arrow--prev',\n title: 'Previous',\n order: 10,\n isButton: true,\n appendTo: 'wrapper',\n html: {\n isCustomSVG: true,\n size: 60,\n inner: '',\n outlineID: 'pswp__icn-arrow'\n },\n onClick: 'prev',\n onInit: initArrowButton\n};\n/** @type {UIElementData} */\n\nconst arrowNext = {\n name: 'arrowNext',\n className: 'pswp__button--arrow--next',\n title: 'Next',\n order: 11,\n isButton: true,\n appendTo: 'wrapper',\n html: {\n isCustomSVG: true,\n size: 60,\n inner: '',\n outlineID: 'pswp__icn-arrow'\n },\n onClick: 'next',\n onInit: (el, pswp) => {\n initArrowButton(el, pswp, true);\n }\n};\n\n/** @type {import('./ui-element.js').UIElementData} UIElementData */\nconst closeButton = {\n name: 'close',\n title: 'Close',\n order: 20,\n isButton: true,\n html: {\n isCustomSVG: true,\n inner: '',\n outlineID: 'pswp__icn-close'\n },\n onClick: 'close'\n};\n\n/** @type {import('./ui-element.js').UIElementData} UIElementData */\nconst zoomButton = {\n name: 'zoom',\n title: 'Zoom',\n order: 10,\n isButton: true,\n html: {\n isCustomSVG: true,\n // eslint-disable-next-line max-len\n inner: '' + '' + '',\n outlineID: 'pswp__icn-zoom'\n },\n onClick: 'toggleZoom'\n};\n\n/** @type {import('./ui-element.js').UIElementData} UIElementData */\nconst loadingIndicator = {\n name: 'preloader',\n appendTo: 'bar',\n order: 7,\n html: {\n isCustomSVG: true,\n // eslint-disable-next-line max-len\n inner: '',\n outlineID: 'pswp__icn-loading'\n },\n onInit: (indicatorElement, pswp) => {\n /** @type {boolean | undefined} */\n let isVisible;\n /** @type {NodeJS.Timeout | null} */\n\n let delayTimeout = null;\n /**\r\n * @param {string} className\r\n * @param {boolean} add\r\n */\n\n const toggleIndicatorClass = (className, add) => {\n indicatorElement.classList.toggle('pswp__preloader--' + className, add);\n };\n /**\r\n * @param {boolean} visible\r\n */\n\n\n const setIndicatorVisibility = visible => {\n if (isVisible !== visible) {\n isVisible = visible;\n toggleIndicatorClass('active', visible);\n }\n };\n\n const updatePreloaderVisibility = () => {\n var _pswp$currSlide;\n\n if (!((_pswp$currSlide = pswp.currSlide) !== null && _pswp$currSlide !== void 0 && _pswp$currSlide.content.isLoading())) {\n setIndicatorVisibility(false);\n\n if (delayTimeout) {\n clearTimeout(delayTimeout);\n delayTimeout = null;\n }\n\n return;\n }\n\n if (!delayTimeout) {\n // display loading indicator with delay\n delayTimeout = setTimeout(() => {\n var _pswp$currSlide2;\n\n setIndicatorVisibility(Boolean((_pswp$currSlide2 = pswp.currSlide) === null || _pswp$currSlide2 === void 0 ? void 0 : _pswp$currSlide2.content.isLoading()));\n delayTimeout = null;\n }, pswp.options.preloaderDelay);\n }\n };\n\n pswp.on('change', updatePreloaderVisibility);\n pswp.on('loadComplete', e => {\n if (pswp.currSlide === e.slide) {\n updatePreloaderVisibility();\n }\n }); // expose the method\n\n if (pswp.ui) {\n pswp.ui.updatePreloaderVisibility = updatePreloaderVisibility;\n }\n }\n};\n\n/** @type {import('./ui-element.js').UIElementData} UIElementData */\nconst counterIndicator = {\n name: 'counter',\n order: 5,\n onInit: (counterElement, pswp) => {\n pswp.on('change', () => {\n counterElement.innerText = pswp.currIndex + 1 + pswp.options.indexIndicatorSep + pswp.getNumItems();\n });\n }\n};\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('./ui-element.js').UIElementData} UIElementData */\n\n/**\r\n * Set special class on element when image is zoomed.\r\n *\r\n * By default, it is used to adjust\r\n * zoom icon and zoom cursor via CSS.\r\n *\r\n * @param {HTMLElement} el\r\n * @param {boolean} isZoomedIn\r\n */\n\nfunction setZoomedIn(el, isZoomedIn) {\n el.classList.toggle('pswp--zoomed-in', isZoomedIn);\n}\n\nclass UI {\n /**\r\n * @param {PhotoSwipe} pswp\r\n */\n constructor(pswp) {\n this.pswp = pswp;\n this.isRegistered = false;\n /** @type {UIElementData[]} */\n\n this.uiElementsData = [];\n /** @type {(UIElement | UIElementData)[]} */\n\n this.items = [];\n /** @type {() => void} */\n\n this.updatePreloaderVisibility = () => {};\n /**\r\n * @private\r\n * @type {number | undefined}\r\n */\n\n\n this._lastUpdatedZoomLevel = undefined;\n }\n\n init() {\n const {\n pswp\n } = this;\n this.isRegistered = false;\n this.uiElementsData = [closeButton, arrowPrev, arrowNext, zoomButton, loadingIndicator, counterIndicator];\n pswp.dispatch('uiRegister'); // sort by order\n\n this.uiElementsData.sort((a, b) => {\n // default order is 0\n return (a.order || 0) - (b.order || 0);\n });\n this.items = [];\n this.isRegistered = true;\n this.uiElementsData.forEach(uiElementData => {\n this.registerElement(uiElementData);\n });\n pswp.on('change', () => {\n var _pswp$element;\n\n (_pswp$element = pswp.element) === null || _pswp$element === void 0 || _pswp$element.classList.toggle('pswp--one-slide', pswp.getNumItems() === 1);\n });\n pswp.on('zoomPanUpdate', () => this._onZoomPanUpdate());\n }\n /**\r\n * @param {UIElementData} elementData\r\n */\n\n\n registerElement(elementData) {\n if (this.isRegistered) {\n this.items.push(new UIElement(this.pswp, elementData));\n } else {\n this.uiElementsData.push(elementData);\n }\n }\n /**\r\n * Fired each time zoom or pan position is changed.\r\n * Update classes that control visibility of zoom button and cursor icon.\r\n *\r\n * @private\r\n */\n\n\n _onZoomPanUpdate() {\n const {\n template,\n currSlide,\n options\n } = this.pswp;\n\n if (this.pswp.opener.isClosing || !template || !currSlide) {\n return;\n }\n\n let {\n currZoomLevel\n } = currSlide; // if not open yet - check against initial zoom level\n\n if (!this.pswp.opener.isOpen) {\n currZoomLevel = currSlide.zoomLevels.initial;\n }\n\n if (currZoomLevel === this._lastUpdatedZoomLevel) {\n return;\n }\n\n this._lastUpdatedZoomLevel = currZoomLevel;\n const currZoomLevelDiff = currSlide.zoomLevels.initial - currSlide.zoomLevels.secondary; // Initial and secondary zoom levels are almost equal\n\n if (Math.abs(currZoomLevelDiff) < 0.01 || !currSlide.isZoomable()) {\n // disable zoom\n setZoomedIn(template, false);\n template.classList.remove('pswp--zoom-allowed');\n return;\n }\n\n template.classList.add('pswp--zoom-allowed');\n const potentialZoomLevel = currZoomLevel === currSlide.zoomLevels.initial ? currSlide.zoomLevels.secondary : currSlide.zoomLevels.initial;\n setZoomedIn(template, potentialZoomLevel <= currZoomLevel);\n\n if (options.imageClickAction === 'zoom' || options.imageClickAction === 'zoom-or-close') {\n template.classList.add('pswp--click-to-zoom');\n }\n }\n\n}\n\n/** @typedef {import('./slide.js').SlideData} SlideData */\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {{ x: number; y: number; w: number; innerRect?: { w: number; h: number; x: number; y: number } }} Bounds */\n\n/**\r\n * @param {HTMLElement} el\r\n * @returns Bounds\r\n */\nfunction getBoundsByElement(el) {\n const thumbAreaRect = el.getBoundingClientRect();\n return {\n x: thumbAreaRect.left,\n y: thumbAreaRect.top,\n w: thumbAreaRect.width\n };\n}\n/**\r\n * @param {HTMLElement} el\r\n * @param {number} imageWidth\r\n * @param {number} imageHeight\r\n * @returns Bounds\r\n */\n\n\nfunction getCroppedBoundsByElement(el, imageWidth, imageHeight) {\n const thumbAreaRect = el.getBoundingClientRect(); // fill image into the area\n // (do they same as object-fit:cover does to retrieve coordinates)\n\n const hRatio = thumbAreaRect.width / imageWidth;\n const vRatio = thumbAreaRect.height / imageHeight;\n const fillZoomLevel = hRatio > vRatio ? hRatio : vRatio;\n const offsetX = (thumbAreaRect.width - imageWidth * fillZoomLevel) / 2;\n const offsetY = (thumbAreaRect.height - imageHeight * fillZoomLevel) / 2;\n /**\r\n * Coordinates of the image,\r\n * as if it was not cropped,\r\n * height is calculated automatically\r\n *\r\n * @type {Bounds}\r\n */\n\n const bounds = {\n x: thumbAreaRect.left + offsetX,\n y: thumbAreaRect.top + offsetY,\n w: imageWidth * fillZoomLevel\n }; // Coordinates of inner crop area\n // relative to the image\n\n bounds.innerRect = {\n w: thumbAreaRect.width,\n h: thumbAreaRect.height,\n x: offsetX,\n y: offsetY\n };\n return bounds;\n}\n/**\r\n * Get dimensions of thumbnail image\r\n * (click on which opens photoswipe or closes photoswipe to)\r\n *\r\n * @param {number} index\r\n * @param {SlideData} itemData\r\n * @param {PhotoSwipe} instance PhotoSwipe instance\r\n * @returns {Bounds | undefined}\r\n */\n\n\nfunction getThumbBounds(index, itemData, instance) {\n // legacy event, before filters were introduced\n const event = instance.dispatch('thumbBounds', {\n index,\n itemData,\n instance\n }); // @ts-expect-error\n\n if (event.thumbBounds) {\n // @ts-expect-error\n return event.thumbBounds;\n }\n\n const {\n element\n } = itemData;\n /** @type {Bounds | undefined} */\n\n let thumbBounds;\n /** @type {HTMLElement | null | undefined} */\n\n let thumbnail;\n\n if (element && instance.options.thumbSelector !== false) {\n const thumbSelector = instance.options.thumbSelector || 'img';\n thumbnail = element.matches(thumbSelector) ? element :\n /** @type {HTMLElement | null} */\n element.querySelector(thumbSelector);\n }\n\n thumbnail = instance.applyFilters('thumbEl', thumbnail, itemData, index);\n\n if (thumbnail) {\n if (!itemData.thumbCropped) {\n thumbBounds = getBoundsByElement(thumbnail);\n } else {\n thumbBounds = getCroppedBoundsByElement(thumbnail, itemData.width || itemData.w || 0, itemData.height || itemData.h || 0);\n }\n }\n\n return instance.applyFilters('thumbBounds', thumbBounds, itemData, index);\n}\n\n/** @typedef {import('../lightbox/lightbox.js').default} PhotoSwipeLightbox */\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */\n\n/** @typedef {import('../photoswipe.js').DataSource} DataSource */\n\n/** @typedef {import('../ui/ui-element.js').UIElementData} UIElementData */\n\n/** @typedef {import('../slide/content.js').default} ContentDefault */\n\n/** @typedef {import('../slide/slide.js').default} Slide */\n\n/** @typedef {import('../slide/slide.js').SlideData} SlideData */\n\n/** @typedef {import('../slide/zoom-level.js').default} ZoomLevel */\n\n/** @typedef {import('../slide/get-thumb-bounds.js').Bounds} Bounds */\n\n/**\r\n * Allow adding an arbitrary props to the Content\r\n * https://photoswipe.com/custom-content/#using-webp-image-format\r\n * @typedef {ContentDefault & Record} Content\r\n */\n\n/** @typedef {{ x?: number; y?: number }} Point */\n\n/**\r\n * @typedef {Object} PhotoSwipeEventsMap https://photoswipe.com/events/\r\n *\r\n *\r\n * https://photoswipe.com/adding-ui-elements/\r\n *\r\n * @prop {undefined} uiRegister\r\n * @prop {{ data: UIElementData }} uiElementCreate\r\n *\r\n *\r\n * https://photoswipe.com/events/#initialization-events\r\n *\r\n * @prop {undefined} beforeOpen\r\n * @prop {undefined} firstUpdate\r\n * @prop {undefined} initialLayout\r\n * @prop {undefined} change\r\n * @prop {undefined} afterInit\r\n * @prop {undefined} bindEvents\r\n *\r\n *\r\n * https://photoswipe.com/events/#opening-or-closing-transition-events\r\n *\r\n * @prop {undefined} openingAnimationStart\r\n * @prop {undefined} openingAnimationEnd\r\n * @prop {undefined} closingAnimationStart\r\n * @prop {undefined} closingAnimationEnd\r\n *\r\n *\r\n * https://photoswipe.com/events/#closing-events\r\n *\r\n * @prop {undefined} close\r\n * @prop {undefined} destroy\r\n *\r\n *\r\n * https://photoswipe.com/events/#pointer-and-gesture-events\r\n *\r\n * @prop {{ originalEvent: PointerEvent }} pointerDown\r\n * @prop {{ originalEvent: PointerEvent }} pointerMove\r\n * @prop {{ originalEvent: PointerEvent }} pointerUp\r\n * @prop {{ bgOpacity: number }} pinchClose can be default prevented\r\n * @prop {{ panY: number }} verticalDrag can be default prevented\r\n *\r\n *\r\n * https://photoswipe.com/events/#slide-content-events\r\n *\r\n * @prop {{ content: Content }} contentInit\r\n * @prop {{ content: Content; isLazy: boolean }} contentLoad can be default prevented\r\n * @prop {{ content: Content; isLazy: boolean }} contentLoadImage can be default prevented\r\n * @prop {{ content: Content; slide: Slide; isError?: boolean }} loadComplete\r\n * @prop {{ content: Content; slide: Slide }} loadError\r\n * @prop {{ content: Content; width: number; height: number }} contentResize can be default prevented\r\n * @prop {{ content: Content; width: number; height: number; slide: Slide }} imageSizeChange\r\n * @prop {{ content: Content }} contentLazyLoad can be default prevented\r\n * @prop {{ content: Content }} contentAppend can be default prevented\r\n * @prop {{ content: Content }} contentActivate can be default prevented\r\n * @prop {{ content: Content }} contentDeactivate can be default prevented\r\n * @prop {{ content: Content }} contentRemove can be default prevented\r\n * @prop {{ content: Content }} contentDestroy can be default prevented\r\n *\r\n *\r\n * undocumented\r\n *\r\n * @prop {{ point: Point; originalEvent: PointerEvent }} imageClickAction can be default prevented\r\n * @prop {{ point: Point; originalEvent: PointerEvent }} bgClickAction can be default prevented\r\n * @prop {{ point: Point; originalEvent: PointerEvent }} tapAction can be default prevented\r\n * @prop {{ point: Point; originalEvent: PointerEvent }} doubleTapAction can be default prevented\r\n *\r\n * @prop {{ originalEvent: KeyboardEvent }} keydown can be default prevented\r\n * @prop {{ x: number; dragging: boolean }} moveMainScroll\r\n * @prop {{ slide: Slide }} firstZoomPan\r\n * @prop {{ slide: Slide | undefined, data: SlideData, index: number }} gettingData\r\n * @prop {undefined} beforeResize\r\n * @prop {undefined} resize\r\n * @prop {undefined} viewportSize\r\n * @prop {undefined} updateScrollOffset\r\n * @prop {{ slide: Slide }} slideInit\r\n * @prop {{ slide: Slide }} afterSetContent\r\n * @prop {{ slide: Slide }} slideLoad\r\n * @prop {{ slide: Slide }} appendHeavy can be default prevented\r\n * @prop {{ slide: Slide }} appendHeavyContent\r\n * @prop {{ slide: Slide }} slideActivate\r\n * @prop {{ slide: Slide }} slideDeactivate\r\n * @prop {{ slide: Slide }} slideDestroy\r\n * @prop {{ destZoomLevel: number, centerPoint: Point | undefined, transitionDuration: number | false | undefined }} beforeZoomTo\r\n * @prop {{ slide: Slide }} zoomPanUpdate\r\n * @prop {{ slide: Slide }} initialZoomPan\r\n * @prop {{ slide: Slide }} calcSlideSize\r\n * @prop {undefined} resolutionChanged\r\n * @prop {{ originalEvent: WheelEvent }} wheel can be default prevented\r\n * @prop {{ content: Content }} contentAppendImage can be default prevented\r\n * @prop {{ index: number; itemData: SlideData }} lazyLoadSlide can be default prevented\r\n * @prop {undefined} lazyLoad\r\n * @prop {{ slide: Slide }} calcBounds\r\n * @prop {{ zoomLevels: ZoomLevel, slideData: SlideData }} zoomLevelsUpdate\r\n *\r\n *\r\n * legacy\r\n *\r\n * @prop {undefined} init\r\n * @prop {undefined} initialZoomIn\r\n * @prop {undefined} initialZoomOut\r\n * @prop {undefined} initialZoomInEnd\r\n * @prop {undefined} initialZoomOutEnd\r\n * @prop {{ dataSource: DataSource | undefined, numItems: number }} numItems\r\n * @prop {{ itemData: SlideData; index: number }} itemData\r\n * @prop {{ index: number, itemData: SlideData, instance: PhotoSwipe }} thumbBounds\r\n */\n\n/**\r\n * @typedef {Object} PhotoSwipeFiltersMap https://photoswipe.com/filters/\r\n *\r\n * @prop {(numItems: number, dataSource: DataSource | undefined) => number} numItems\r\n * Modify the total amount of slides. Example on Data sources page.\r\n * https://photoswipe.com/filters/#numitems\r\n *\r\n * @prop {(itemData: SlideData, index: number) => SlideData} itemData\r\n * Modify slide item data. Example on Data sources page.\r\n * https://photoswipe.com/filters/#itemdata\r\n *\r\n * @prop {(itemData: SlideData, element: HTMLElement, linkEl: HTMLAnchorElement) => SlideData} domItemData\r\n * Modify item data when it's parsed from DOM element. Example on Data sources page.\r\n * https://photoswipe.com/filters/#domitemdata\r\n *\r\n * @prop {(clickedIndex: number, e: MouseEvent, instance: PhotoSwipeLightbox) => number} clickedIndex\r\n * Modify clicked gallery item index.\r\n * https://photoswipe.com/filters/#clickedindex\r\n *\r\n * @prop {(placeholderSrc: string | false, content: Content) => string | false} placeholderSrc\r\n * Modify placeholder image source.\r\n * https://photoswipe.com/filters/#placeholdersrc\r\n *\r\n * @prop {(isContentLoading: boolean, content: Content) => boolean} isContentLoading\r\n * Modify if the content is currently loading.\r\n * https://photoswipe.com/filters/#iscontentloading\r\n *\r\n * @prop {(isContentZoomable: boolean, content: Content) => boolean} isContentZoomable\r\n * Modify if the content can be zoomed.\r\n * https://photoswipe.com/filters/#iscontentzoomable\r\n *\r\n * @prop {(useContentPlaceholder: boolean, content: Content) => boolean} useContentPlaceholder\r\n * Modify if the placeholder should be used for the content.\r\n * https://photoswipe.com/filters/#usecontentplaceholder\r\n *\r\n * @prop {(isKeepingPlaceholder: boolean, content: Content) => boolean} isKeepingPlaceholder\r\n * Modify if the placeholder should be kept after the content is loaded.\r\n * https://photoswipe.com/filters/#iskeepingplaceholder\r\n *\r\n *\r\n * @prop {(contentErrorElement: HTMLElement, content: Content) => HTMLElement} contentErrorElement\r\n * Modify an element when the content has error state (for example, if image cannot be loaded).\r\n * https://photoswipe.com/filters/#contenterrorelement\r\n *\r\n * @prop {(element: HTMLElement, data: UIElementData) => HTMLElement} uiElement\r\n * Modify a UI element that's being created.\r\n * https://photoswipe.com/filters/#uielement\r\n *\r\n * @prop {(thumbnail: HTMLElement | null | undefined, itemData: SlideData, index: number) => HTMLElement} thumbEl\r\n * Modify the thubmnail element from which opening zoom animation starts or ends.\r\n * https://photoswipe.com/filters/#thumbel\r\n *\r\n * @prop {(thumbBounds: Bounds | undefined, itemData: SlideData, index: number) => Bounds} thumbBounds\r\n * Modify the thubmnail bounds from which opening zoom animation starts or ends.\r\n * https://photoswipe.com/filters/#thumbbounds\r\n *\r\n * @prop {(srcsetSizesWidth: number, content: Content) => number} srcsetSizesWidth\r\n *\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeFiltersMap} T\r\n * @typedef {{ fn: PhotoSwipeFiltersMap[T], priority: number }} Filter\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {PhotoSwipeEventsMap[T] extends undefined ? PhotoSwipeEvent : PhotoSwipeEvent & PhotoSwipeEventsMap[T]} AugmentedEvent\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {(event: AugmentedEvent) => void} EventCallback\r\n */\n\n/**\r\n * Base PhotoSwipe event object\r\n *\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n */\nclass PhotoSwipeEvent {\n /**\r\n * @param {T} type\r\n * @param {PhotoSwipeEventsMap[T]} [details]\r\n */\n constructor(type, details) {\n this.type = type;\n this.defaultPrevented = false;\n\n if (details) {\n Object.assign(this, details);\n }\n }\n\n preventDefault() {\n this.defaultPrevented = true;\n }\n\n}\n/**\r\n * PhotoSwipe base class that can listen and dispatch for events.\r\n * Shared by PhotoSwipe Core and PhotoSwipe Lightbox, extended by base.js\r\n */\n\n\nclass Eventable {\n constructor() {\n /**\r\n * @type {{ [T in keyof PhotoSwipeEventsMap]?: ((event: AugmentedEvent) => void)[] }}\r\n */\n this._listeners = {};\n /**\r\n * @type {{ [T in keyof PhotoSwipeFiltersMap]?: Filter[] }}\r\n */\n\n this._filters = {};\n /** @type {PhotoSwipe | undefined} */\n\n this.pswp = undefined;\n /** @type {PhotoSwipeOptions | undefined} */\n\n this.options = undefined;\n }\n /**\r\n * @template {keyof PhotoSwipeFiltersMap} T\r\n * @param {T} name\r\n * @param {PhotoSwipeFiltersMap[T]} fn\r\n * @param {number} priority\r\n */\n\n\n addFilter(name, fn, priority = 100) {\n var _this$_filters$name, _this$_filters$name2, _this$pswp;\n\n if (!this._filters[name]) {\n this._filters[name] = [];\n }\n\n (_this$_filters$name = this._filters[name]) === null || _this$_filters$name === void 0 || _this$_filters$name.push({\n fn,\n priority\n });\n (_this$_filters$name2 = this._filters[name]) === null || _this$_filters$name2 === void 0 || _this$_filters$name2.sort((f1, f2) => f1.priority - f2.priority);\n (_this$pswp = this.pswp) === null || _this$pswp === void 0 || _this$pswp.addFilter(name, fn, priority);\n }\n /**\r\n * @template {keyof PhotoSwipeFiltersMap} T\r\n * @param {T} name\r\n * @param {PhotoSwipeFiltersMap[T]} fn\r\n */\n\n\n removeFilter(name, fn) {\n if (this._filters[name]) {\n // @ts-expect-error\n this._filters[name] = this._filters[name].filter(filter => filter.fn !== fn);\n }\n\n if (this.pswp) {\n this.pswp.removeFilter(name, fn);\n }\n }\n /**\r\n * @template {keyof PhotoSwipeFiltersMap} T\r\n * @param {T} name\r\n * @param {Parameters} args\r\n * @returns {Parameters[0]}\r\n */\n\n\n applyFilters(name, ...args) {\n var _this$_filters$name3;\n\n (_this$_filters$name3 = this._filters[name]) === null || _this$_filters$name3 === void 0 || _this$_filters$name3.forEach(filter => {\n // @ts-expect-error\n args[0] = filter.fn.apply(this, args);\n });\n return args[0];\n }\n /**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @param {T} name\r\n * @param {EventCallback} fn\r\n */\n\n\n on(name, fn) {\n var _this$_listeners$name, _this$pswp2;\n\n if (!this._listeners[name]) {\n this._listeners[name] = [];\n }\n\n (_this$_listeners$name = this._listeners[name]) === null || _this$_listeners$name === void 0 || _this$_listeners$name.push(fn); // When binding events to lightbox,\n // also bind events to PhotoSwipe Core,\n // if it's open.\n\n (_this$pswp2 = this.pswp) === null || _this$pswp2 === void 0 || _this$pswp2.on(name, fn);\n }\n /**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @param {T} name\r\n * @param {EventCallback} fn\r\n */\n\n\n off(name, fn) {\n var _this$pswp3;\n\n if (this._listeners[name]) {\n // @ts-expect-error\n this._listeners[name] = this._listeners[name].filter(listener => fn !== listener);\n }\n\n (_this$pswp3 = this.pswp) === null || _this$pswp3 === void 0 || _this$pswp3.off(name, fn);\n }\n /**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @param {T} name\r\n * @param {PhotoSwipeEventsMap[T]} [details]\r\n * @returns {AugmentedEvent}\r\n */\n\n\n dispatch(name, details) {\n var _this$_listeners$name2;\n\n if (this.pswp) {\n return this.pswp.dispatch(name, details);\n }\n\n const event =\n /** @type {AugmentedEvent} */\n new PhotoSwipeEvent(name, details);\n (_this$_listeners$name2 = this._listeners[name]) === null || _this$_listeners$name2 === void 0 || _this$_listeners$name2.forEach(listener => {\n listener.call(this, event);\n });\n return event;\n }\n\n}\n\nclass Placeholder {\n /**\r\n * @param {string | false} imageSrc\r\n * @param {HTMLElement} container\r\n */\n constructor(imageSrc, container) {\n // Create placeholder\n // (stretched thumbnail or simple div behind the main image)\n\n /** @type {HTMLImageElement | HTMLDivElement | null} */\n this.element = createElement('pswp__img pswp__img--placeholder', imageSrc ? 'img' : 'div', container);\n\n if (imageSrc) {\n const imgEl =\n /** @type {HTMLImageElement} */\n this.element;\n imgEl.decoding = 'async';\n imgEl.alt = '';\n imgEl.src = imageSrc;\n imgEl.setAttribute('role', 'presentation');\n }\n\n this.element.setAttribute('aria-hidden', 'true');\n }\n /**\r\n * @param {number} width\r\n * @param {number} height\r\n */\n\n\n setDisplayedSize(width, height) {\n if (!this.element) {\n return;\n }\n\n if (this.element.tagName === 'IMG') {\n // Use transform scale() to modify img placeholder size\n // (instead of changing width/height directly).\n // This helps with performance, specifically in iOS15 Safari.\n setWidthHeight(this.element, 250, 'auto');\n this.element.style.transformOrigin = '0 0';\n this.element.style.transform = toTransformString(0, 0, width / 250);\n } else {\n setWidthHeight(this.element, width, height);\n }\n }\n\n destroy() {\n var _this$element;\n\n if ((_this$element = this.element) !== null && _this$element !== void 0 && _this$element.parentNode) {\n this.element.remove();\n }\n\n this.element = null;\n }\n\n}\n\n/** @typedef {import('./slide.js').default} Slide */\n\n/** @typedef {import('./slide.js').SlideData} SlideData */\n\n/** @typedef {import('../core/base.js').default} PhotoSwipeBase */\n\n/** @typedef {import('../util/util.js').LoadState} LoadState */\n\nclass Content {\n /**\r\n * @param {SlideData} itemData Slide data\r\n * @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance\r\n * @param {number} index\r\n */\n constructor(itemData, instance, index) {\n this.instance = instance;\n this.data = itemData;\n this.index = index;\n /** @type {HTMLImageElement | HTMLDivElement | undefined} */\n\n this.element = undefined;\n /** @type {Placeholder | undefined} */\n\n this.placeholder = undefined;\n /** @type {Slide | undefined} */\n\n this.slide = undefined;\n this.displayedImageWidth = 0;\n this.displayedImageHeight = 0;\n this.width = Number(this.data.w) || Number(this.data.width) || 0;\n this.height = Number(this.data.h) || Number(this.data.height) || 0;\n this.isAttached = false;\n this.hasSlide = false;\n this.isDecoding = false;\n /** @type {LoadState} */\n\n this.state = LOAD_STATE.IDLE;\n\n if (this.data.type) {\n this.type = this.data.type;\n } else if (this.data.src) {\n this.type = 'image';\n } else {\n this.type = 'html';\n }\n\n this.instance.dispatch('contentInit', {\n content: this\n });\n }\n\n removePlaceholder() {\n if (this.placeholder && !this.keepPlaceholder()) {\n // With delay, as image might be loaded, but not rendered\n setTimeout(() => {\n if (this.placeholder) {\n this.placeholder.destroy();\n this.placeholder = undefined;\n }\n }, 1000);\n }\n }\n /**\r\n * Preload content\r\n *\r\n * @param {boolean} isLazy\r\n * @param {boolean} [reload]\r\n */\n\n\n load(isLazy, reload) {\n if (this.slide && this.usePlaceholder()) {\n if (!this.placeholder) {\n const placeholderSrc = this.instance.applyFilters('placeholderSrc', // use image-based placeholder only for the first slide,\n // as rendering (even small stretched thumbnail) is an expensive operation\n this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : false, this);\n this.placeholder = new Placeholder(placeholderSrc, this.slide.container);\n } else {\n const placeholderEl = this.placeholder.element; // Add placeholder to DOM if it was already created\n\n if (placeholderEl && !placeholderEl.parentElement) {\n this.slide.container.prepend(placeholderEl);\n }\n }\n }\n\n if (this.element && !reload) {\n return;\n }\n\n if (this.instance.dispatch('contentLoad', {\n content: this,\n isLazy\n }).defaultPrevented) {\n return;\n }\n\n if (this.isImageContent()) {\n this.element = createElement('pswp__img', 'img'); // Start loading only after width is defined, as sizes might depend on it.\n // Due to Safari feature, we must define sizes before srcset.\n\n if (this.displayedImageWidth) {\n this.loadImage(isLazy);\n }\n } else {\n this.element = createElement('pswp__content', 'div');\n this.element.innerHTML = this.data.html || '';\n }\n\n if (reload && this.slide) {\n this.slide.updateContentSize(true);\n }\n }\n /**\r\n * Preload image\r\n *\r\n * @param {boolean} isLazy\r\n */\n\n\n loadImage(isLazy) {\n var _this$data$src, _this$data$alt;\n\n if (!this.isImageContent() || !this.element || this.instance.dispatch('contentLoadImage', {\n content: this,\n isLazy\n }).defaultPrevented) {\n return;\n }\n\n const imageElement =\n /** @type HTMLImageElement */\n this.element;\n this.updateSrcsetSizes();\n\n if (this.data.srcset) {\n imageElement.srcset = this.data.srcset;\n }\n\n imageElement.src = (_this$data$src = this.data.src) !== null && _this$data$src !== void 0 ? _this$data$src : '';\n imageElement.alt = (_this$data$alt = this.data.alt) !== null && _this$data$alt !== void 0 ? _this$data$alt : '';\n this.state = LOAD_STATE.LOADING;\n\n if (imageElement.complete) {\n this.onLoaded();\n } else {\n imageElement.onload = () => {\n this.onLoaded();\n };\n\n imageElement.onerror = () => {\n this.onError();\n };\n }\n }\n /**\r\n * Assign slide to content\r\n *\r\n * @param {Slide} slide\r\n */\n\n\n setSlide(slide) {\n this.slide = slide;\n this.hasSlide = true;\n this.instance = slide.pswp; // todo: do we need to unset slide?\n }\n /**\r\n * Content load success handler\r\n */\n\n\n onLoaded() {\n this.state = LOAD_STATE.LOADED;\n\n if (this.slide && this.element) {\n this.instance.dispatch('loadComplete', {\n slide: this.slide,\n content: this\n }); // if content is reloaded\n\n if (this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode) {\n this.append();\n this.slide.updateContentSize(true);\n }\n\n if (this.state === LOAD_STATE.LOADED || this.state === LOAD_STATE.ERROR) {\n this.removePlaceholder();\n }\n }\n }\n /**\r\n * Content load error handler\r\n */\n\n\n onError() {\n this.state = LOAD_STATE.ERROR;\n\n if (this.slide) {\n this.displayError();\n this.instance.dispatch('loadComplete', {\n slide: this.slide,\n isError: true,\n content: this\n });\n this.instance.dispatch('loadError', {\n slide: this.slide,\n content: this\n });\n }\n }\n /**\r\n * @returns {Boolean} If the content is currently loading\r\n */\n\n\n isLoading() {\n return this.instance.applyFilters('isContentLoading', this.state === LOAD_STATE.LOADING, this);\n }\n /**\r\n * @returns {Boolean} If the content is in error state\r\n */\n\n\n isError() {\n return this.state === LOAD_STATE.ERROR;\n }\n /**\r\n * @returns {boolean} If the content is image\r\n */\n\n\n isImageContent() {\n return this.type === 'image';\n }\n /**\r\n * Update content size\r\n *\r\n * @param {Number} width\r\n * @param {Number} height\r\n */\n\n\n setDisplayedSize(width, height) {\n if (!this.element) {\n return;\n }\n\n if (this.placeholder) {\n this.placeholder.setDisplayedSize(width, height);\n }\n\n if (this.instance.dispatch('contentResize', {\n content: this,\n width,\n height\n }).defaultPrevented) {\n return;\n }\n\n setWidthHeight(this.element, width, height);\n\n if (this.isImageContent() && !this.isError()) {\n const isInitialSizeUpdate = !this.displayedImageWidth && width;\n this.displayedImageWidth = width;\n this.displayedImageHeight = height;\n\n if (isInitialSizeUpdate) {\n this.loadImage(false);\n } else {\n this.updateSrcsetSizes();\n }\n\n if (this.slide) {\n this.instance.dispatch('imageSizeChange', {\n slide: this.slide,\n width,\n height,\n content: this\n });\n }\n }\n }\n /**\r\n * @returns {boolean} If the content can be zoomed\r\n */\n\n\n isZoomable() {\n return this.instance.applyFilters('isContentZoomable', this.isImageContent() && this.state !== LOAD_STATE.ERROR, this);\n }\n /**\r\n * Update image srcset sizes attribute based on width and height\r\n */\n\n\n updateSrcsetSizes() {\n // Handle srcset sizes attribute.\n //\n // Never lower quality, if it was increased previously.\n // Chrome does this automatically, Firefox and Safari do not,\n // so we store largest used size in dataset.\n if (!this.isImageContent() || !this.element || !this.data.srcset) {\n return;\n }\n\n const image =\n /** @type HTMLImageElement */\n this.element;\n const sizesWidth = this.instance.applyFilters('srcsetSizesWidth', this.displayedImageWidth, this);\n\n if (!image.dataset.largestUsedSize || sizesWidth > parseInt(image.dataset.largestUsedSize, 10)) {\n image.sizes = sizesWidth + 'px';\n image.dataset.largestUsedSize = String(sizesWidth);\n }\n }\n /**\r\n * @returns {boolean} If content should use a placeholder (from msrc by default)\r\n */\n\n\n usePlaceholder() {\n return this.instance.applyFilters('useContentPlaceholder', this.isImageContent(), this);\n }\n /**\r\n * Preload content with lazy-loading param\r\n */\n\n\n lazyLoad() {\n if (this.instance.dispatch('contentLazyLoad', {\n content: this\n }).defaultPrevented) {\n return;\n }\n\n this.load(true);\n }\n /**\r\n * @returns {boolean} If placeholder should be kept after content is loaded\r\n */\n\n\n keepPlaceholder() {\n return this.instance.applyFilters('isKeepingPlaceholder', this.isLoading(), this);\n }\n /**\r\n * Destroy the content\r\n */\n\n\n destroy() {\n this.hasSlide = false;\n this.slide = undefined;\n\n if (this.instance.dispatch('contentDestroy', {\n content: this\n }).defaultPrevented) {\n return;\n }\n\n this.remove();\n\n if (this.placeholder) {\n this.placeholder.destroy();\n this.placeholder = undefined;\n }\n\n if (this.isImageContent() && this.element) {\n this.element.onload = null;\n this.element.onerror = null;\n this.element = undefined;\n }\n }\n /**\r\n * Display error message\r\n */\n\n\n displayError() {\n if (this.slide) {\n var _this$instance$option, _this$instance$option2;\n\n let errorMsgEl = createElement('pswp__error-msg', 'div');\n errorMsgEl.innerText = (_this$instance$option = (_this$instance$option2 = this.instance.options) === null || _this$instance$option2 === void 0 ? void 0 : _this$instance$option2.errorMsg) !== null && _this$instance$option !== void 0 ? _this$instance$option : '';\n errorMsgEl =\n /** @type {HTMLDivElement} */\n this.instance.applyFilters('contentErrorElement', errorMsgEl, this);\n this.element = createElement('pswp__content pswp__error-msg-container', 'div');\n this.element.appendChild(errorMsgEl);\n this.slide.container.innerText = '';\n this.slide.container.appendChild(this.element);\n this.slide.updateContentSize(true);\n this.removePlaceholder();\n }\n }\n /**\r\n * Append the content\r\n */\n\n\n append() {\n if (this.isAttached || !this.element) {\n return;\n }\n\n this.isAttached = true;\n\n if (this.state === LOAD_STATE.ERROR) {\n this.displayError();\n return;\n }\n\n if (this.instance.dispatch('contentAppend', {\n content: this\n }).defaultPrevented) {\n return;\n }\n\n const supportsDecode = ('decode' in this.element);\n\n if (this.isImageContent()) {\n // Use decode() on nearby slides\n //\n // Nearby slide images are in DOM and not hidden via display:none.\n // However, they are placed offscreen (to the left and right side).\n //\n // Some browsers do not composite the image until it's actually visible,\n // using decode() helps.\n //\n // You might ask \"why dont you just decode() and then append all images\",\n // that's because I want to show image before it's fully loaded,\n // as browser can render parts of image while it is loading.\n // We do not do this in Safari due to partial loading bug.\n if (supportsDecode && this.slide && (!this.slide.isActive || isSafari())) {\n this.isDecoding = true; // purposefully using finally instead of then,\n // as if srcset sizes changes dynamically - it may cause decode error\n\n /** @type {HTMLImageElement} */\n\n this.element.decode().catch(() => {}).finally(() => {\n this.isDecoding = false;\n this.appendImage();\n });\n } else {\n this.appendImage();\n }\n } else if (this.slide && !this.element.parentNode) {\n this.slide.container.appendChild(this.element);\n }\n }\n /**\r\n * Activate the slide,\r\n * active slide is generally the current one,\r\n * meaning the user can see it.\r\n */\n\n\n activate() {\n if (this.instance.dispatch('contentActivate', {\n content: this\n }).defaultPrevented || !this.slide) {\n return;\n }\n\n if (this.isImageContent() && this.isDecoding && !isSafari()) {\n // add image to slide when it becomes active,\n // even if it's not finished decoding\n this.appendImage();\n } else if (this.isError()) {\n this.load(false, true); // try to reload\n }\n\n if (this.slide.holderElement) {\n this.slide.holderElement.setAttribute('aria-hidden', 'false');\n }\n }\n /**\r\n * Deactivate the content\r\n */\n\n\n deactivate() {\n this.instance.dispatch('contentDeactivate', {\n content: this\n });\n\n if (this.slide && this.slide.holderElement) {\n this.slide.holderElement.setAttribute('aria-hidden', 'true');\n }\n }\n /**\r\n * Remove the content from DOM\r\n */\n\n\n remove() {\n this.isAttached = false;\n\n if (this.instance.dispatch('contentRemove', {\n content: this\n }).defaultPrevented) {\n return;\n }\n\n if (this.element && this.element.parentNode) {\n this.element.remove();\n }\n\n if (this.placeholder && this.placeholder.element) {\n this.placeholder.element.remove();\n }\n }\n /**\r\n * Append the image content to slide container\r\n */\n\n\n appendImage() {\n if (!this.isAttached) {\n return;\n }\n\n if (this.instance.dispatch('contentAppendImage', {\n content: this\n }).defaultPrevented) {\n return;\n } // ensure that element exists and is not already appended\n\n\n if (this.slide && this.element && !this.element.parentNode) {\n this.slide.container.appendChild(this.element);\n }\n\n if (this.state === LOAD_STATE.LOADED || this.state === LOAD_STATE.ERROR) {\n this.removePlaceholder();\n }\n }\n\n}\n\n/** @typedef {import('./content.js').default} Content */\n\n/** @typedef {import('./slide.js').default} Slide */\n\n/** @typedef {import('./slide.js').SlideData} SlideData */\n\n/** @typedef {import('../core/base.js').default} PhotoSwipeBase */\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\nconst MIN_SLIDES_TO_CACHE = 5;\n/**\r\n * Lazy-load an image\r\n * This function is used both by Lightbox and PhotoSwipe core,\r\n * thus it can be called before dialog is opened.\r\n *\r\n * @param {SlideData} itemData Data about the slide\r\n * @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance\r\n * @param {number} index\r\n * @returns {Content} Image that is being decoded or false.\r\n */\n\nfunction lazyLoadData(itemData, instance, index) {\n const content = instance.createContentFromData(itemData, index);\n /** @type {ZoomLevel | undefined} */\n\n let zoomLevel;\n const {\n options\n } = instance; // We need to know dimensions of the image to preload it,\n // as it might use srcset, and we need to define sizes\n\n if (options) {\n zoomLevel = new ZoomLevel(options, itemData, -1);\n let viewportSize;\n\n if (instance.pswp) {\n viewportSize = instance.pswp.viewportSize;\n } else {\n viewportSize = getViewportSize(options, instance);\n }\n\n const panAreaSize = getPanAreaSize(options, viewportSize, itemData, index);\n zoomLevel.update(content.width, content.height, panAreaSize);\n }\n\n content.lazyLoad();\n\n if (zoomLevel) {\n content.setDisplayedSize(Math.ceil(content.width * zoomLevel.initial), Math.ceil(content.height * zoomLevel.initial));\n }\n\n return content;\n}\n/**\r\n * Lazy-loads specific slide.\r\n * This function is used both by Lightbox and PhotoSwipe core,\r\n * thus it can be called before dialog is opened.\r\n *\r\n * By default, it loads image based on viewport size and initial zoom level.\r\n *\r\n * @param {number} index Slide index\r\n * @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox eventable instance\r\n * @returns {Content | undefined}\r\n */\n\nfunction lazyLoadSlide(index, instance) {\n const itemData = instance.getItemData(index);\n\n if (instance.dispatch('lazyLoadSlide', {\n index,\n itemData\n }).defaultPrevented) {\n return;\n }\n\n return lazyLoadData(itemData, instance, index);\n}\n\nclass ContentLoader {\n /**\r\n * @param {PhotoSwipe} pswp\r\n */\n constructor(pswp) {\n this.pswp = pswp; // Total amount of cached images\n\n this.limit = Math.max(pswp.options.preload[0] + pswp.options.preload[1] + 1, MIN_SLIDES_TO_CACHE);\n /** @type {Content[]} */\n\n this._cachedItems = [];\n }\n /**\r\n * Lazy load nearby slides based on `preload` option.\r\n *\r\n * @param {number} [diff] Difference between slide indexes that was changed recently, or 0.\r\n */\n\n\n updateLazy(diff) {\n const {\n pswp\n } = this;\n\n if (pswp.dispatch('lazyLoad').defaultPrevented) {\n return;\n }\n\n const {\n preload\n } = pswp.options;\n const isForward = diff === undefined ? true : diff >= 0;\n let i; // preload[1] - num items to preload in forward direction\n\n for (i = 0; i <= preload[1]; i++) {\n this.loadSlideByIndex(pswp.currIndex + (isForward ? i : -i));\n } // preload[0] - num items to preload in backward direction\n\n\n for (i = 1; i <= preload[0]; i++) {\n this.loadSlideByIndex(pswp.currIndex + (isForward ? -i : i));\n }\n }\n /**\r\n * @param {number} initialIndex\r\n */\n\n\n loadSlideByIndex(initialIndex) {\n const index = this.pswp.getLoopedIndex(initialIndex); // try to get cached content\n\n let content = this.getContentByIndex(index);\n\n if (!content) {\n // no cached content, so try to load from scratch:\n content = lazyLoadSlide(index, this.pswp); // if content can be loaded, add it to cache:\n\n if (content) {\n this.addToCache(content);\n }\n }\n }\n /**\r\n * @param {Slide} slide\r\n * @returns {Content}\r\n */\n\n\n getContentBySlide(slide) {\n let content = this.getContentByIndex(slide.index);\n\n if (!content) {\n // create content if not found in cache\n content = this.pswp.createContentFromData(slide.data, slide.index);\n this.addToCache(content);\n } // assign slide to content\n\n\n content.setSlide(slide);\n return content;\n }\n /**\r\n * @param {Content} content\r\n */\n\n\n addToCache(content) {\n // move to the end of array\n this.removeByIndex(content.index);\n\n this._cachedItems.push(content);\n\n if (this._cachedItems.length > this.limit) {\n // Destroy the first content that's not attached\n const indexToRemove = this._cachedItems.findIndex(item => {\n return !item.isAttached && !item.hasSlide;\n });\n\n if (indexToRemove !== -1) {\n const removedItem = this._cachedItems.splice(indexToRemove, 1)[0];\n\n removedItem.destroy();\n }\n }\n }\n /**\r\n * Removes an image from cache, does not destroy() it, just removes.\r\n *\r\n * @param {number} index\r\n */\n\n\n removeByIndex(index) {\n const indexToRemove = this._cachedItems.findIndex(item => item.index === index);\n\n if (indexToRemove !== -1) {\n this._cachedItems.splice(indexToRemove, 1);\n }\n }\n /**\r\n * @param {number} index\r\n * @returns {Content | undefined}\r\n */\n\n\n getContentByIndex(index) {\n return this._cachedItems.find(content => content.index === index);\n }\n\n destroy() {\n this._cachedItems.forEach(content => content.destroy());\n\n this._cachedItems = [];\n }\n\n}\n\n/** @typedef {import(\"../photoswipe.js\").default} PhotoSwipe */\n\n/** @typedef {import(\"../slide/slide.js\").SlideData} SlideData */\n\n/**\r\n * PhotoSwipe base class that can retrieve data about every slide.\r\n * Shared by PhotoSwipe Core and PhotoSwipe Lightbox\r\n */\n\nclass PhotoSwipeBase extends Eventable {\n /**\r\n * Get total number of slides\r\n *\r\n * @returns {number}\r\n */\n getNumItems() {\n var _this$options;\n\n let numItems = 0;\n const dataSource = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.dataSource;\n\n if (dataSource && 'length' in dataSource) {\n // may be an array or just object with length property\n numItems = dataSource.length;\n } else if (dataSource && 'gallery' in dataSource) {\n // query DOM elements\n if (!dataSource.items) {\n dataSource.items = this._getGalleryDOMElements(dataSource.gallery);\n }\n\n if (dataSource.items) {\n numItems = dataSource.items.length;\n }\n } // legacy event, before filters were introduced\n\n\n const event = this.dispatch('numItems', {\n dataSource,\n numItems\n });\n return this.applyFilters('numItems', event.numItems, dataSource);\n }\n /**\r\n * @param {SlideData} slideData\r\n * @param {number} index\r\n * @returns {Content}\r\n */\n\n\n createContentFromData(slideData, index) {\n return new Content(slideData, this, index);\n }\n /**\r\n * Get item data by index.\r\n *\r\n * \"item data\" should contain normalized information that PhotoSwipe needs to generate a slide.\r\n * For example, it may contain properties like\r\n * `src`, `srcset`, `w`, `h`, which will be used to generate a slide with image.\r\n *\r\n * @param {number} index\r\n * @returns {SlideData}\r\n */\n\n\n getItemData(index) {\n var _this$options2;\n\n const dataSource = (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.dataSource;\n /** @type {SlideData | HTMLElement} */\n\n let dataSourceItem = {};\n\n if (Array.isArray(dataSource)) {\n // Datasource is an array of elements\n dataSourceItem = dataSource[index];\n } else if (dataSource && 'gallery' in dataSource) {\n // dataSource has gallery property,\n // thus it was created by Lightbox, based on\n // gallery and children options\n // query DOM elements\n if (!dataSource.items) {\n dataSource.items = this._getGalleryDOMElements(dataSource.gallery);\n }\n\n dataSourceItem = dataSource.items[index];\n }\n\n let itemData = dataSourceItem;\n\n if (itemData instanceof Element) {\n itemData = this._domElementToItemData(itemData);\n } // Dispatching the itemData event,\n // it's a legacy verion before filters were introduced\n\n\n const event = this.dispatch('itemData', {\n itemData: itemData || {},\n index\n });\n return this.applyFilters('itemData', event.itemData, index);\n }\n /**\r\n * Get array of gallery DOM elements,\r\n * based on childSelector and gallery element.\r\n *\r\n * @param {HTMLElement} galleryElement\r\n * @returns {HTMLElement[]}\r\n */\n\n\n _getGalleryDOMElements(galleryElement) {\n var _this$options3, _this$options4;\n\n if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.children || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.childSelector) {\n return getElementsFromOption(this.options.children, this.options.childSelector, galleryElement) || [];\n }\n\n return [galleryElement];\n }\n /**\r\n * Converts DOM element to item data object.\r\n *\r\n * @param {HTMLElement} element DOM element\r\n * @returns {SlideData}\r\n */\n\n\n _domElementToItemData(element) {\n /** @type {SlideData} */\n const itemData = {\n element\n };\n const linkEl =\n /** @type {HTMLAnchorElement} */\n element.tagName === 'A' ? element : element.querySelector('a');\n\n if (linkEl) {\n // src comes from data-pswp-src attribute,\n // if it's empty link href is used\n itemData.src = linkEl.dataset.pswpSrc || linkEl.href;\n\n if (linkEl.dataset.pswpSrcset) {\n itemData.srcset = linkEl.dataset.pswpSrcset;\n }\n\n itemData.width = linkEl.dataset.pswpWidth ? parseInt(linkEl.dataset.pswpWidth, 10) : 0;\n itemData.height = linkEl.dataset.pswpHeight ? parseInt(linkEl.dataset.pswpHeight, 10) : 0; // support legacy w & h properties\n\n itemData.w = itemData.width;\n itemData.h = itemData.height;\n\n if (linkEl.dataset.pswpType) {\n itemData.type = linkEl.dataset.pswpType;\n }\n\n const thumbnailEl = element.querySelector('img');\n\n if (thumbnailEl) {\n var _thumbnailEl$getAttri;\n\n // msrc is URL to placeholder image that's displayed before large image is loaded\n // by default it's displayed only for the first slide\n itemData.msrc = thumbnailEl.currentSrc || thumbnailEl.src;\n itemData.alt = (_thumbnailEl$getAttri = thumbnailEl.getAttribute('alt')) !== null && _thumbnailEl$getAttri !== void 0 ? _thumbnailEl$getAttri : '';\n }\n\n if (linkEl.dataset.pswpCropped || linkEl.dataset.cropped) {\n itemData.thumbCropped = true;\n }\n }\n\n return this.applyFilters('domItemData', itemData, element, linkEl);\n }\n /**\r\n * Lazy-load by slide data\r\n *\r\n * @param {SlideData} itemData Data about the slide\r\n * @param {number} index\r\n * @returns {Content} Image that is being decoded or false.\r\n */\n\n\n lazyLoadData(itemData, index) {\n return lazyLoadData(itemData, this, index);\n }\n\n}\n\n/** @typedef {import('./photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('./slide/get-thumb-bounds.js').Bounds} Bounds */\n\n/** @typedef {import('./util/animations.js').AnimationProps} AnimationProps */\n// some browsers do not paint\n// elements which opacity is set to 0,\n// since we need to pre-render elements for the animation -\n// we set it to the minimum amount\n\nconst MIN_OPACITY = 0.003;\n/**\r\n * Manages opening and closing transitions of the PhotoSwipe.\r\n *\r\n * It can perform zoom, fade or no transition.\r\n */\n\nclass Opener {\n /**\r\n * @param {PhotoSwipe} pswp\r\n */\n constructor(pswp) {\n this.pswp = pswp;\n this.isClosed = true;\n this.isOpen = false;\n this.isClosing = false;\n this.isOpening = false;\n /**\r\n * @private\r\n * @type {number | false | undefined}\r\n */\n\n this._duration = undefined;\n /** @private */\n\n this._useAnimation = false;\n /** @private */\n\n this._croppedZoom = false;\n /** @private */\n\n this._animateRootOpacity = false;\n /** @private */\n\n this._animateBgOpacity = false;\n /**\r\n * @private\r\n * @type { HTMLDivElement | HTMLImageElement | null | undefined }\r\n */\n\n this._placeholder = undefined;\n /**\r\n * @private\r\n * @type { HTMLDivElement | undefined }\r\n */\n\n this._opacityElement = undefined;\n /**\r\n * @private\r\n * @type { HTMLDivElement | undefined }\r\n */\n\n this._cropContainer1 = undefined;\n /**\r\n * @private\r\n * @type { HTMLElement | null | undefined }\r\n */\n\n this._cropContainer2 = undefined;\n /**\r\n * @private\r\n * @type {Bounds | undefined}\r\n */\n\n this._thumbBounds = undefined;\n this._prepareOpen = this._prepareOpen.bind(this); // Override initial zoom and pan position\n\n pswp.on('firstZoomPan', this._prepareOpen);\n }\n\n open() {\n this._prepareOpen();\n\n this._start();\n }\n\n close() {\n if (this.isClosed || this.isClosing || this.isOpening) {\n // if we close during opening animation\n // for now do nothing,\n // browsers aren't good at changing the direction of the CSS transition\n return;\n }\n\n const slide = this.pswp.currSlide;\n this.isOpen = false;\n this.isOpening = false;\n this.isClosing = true;\n this._duration = this.pswp.options.hideAnimationDuration;\n\n if (slide && slide.currZoomLevel * slide.width >= this.pswp.options.maxWidthToAnimate) {\n this._duration = 0;\n }\n\n this._applyStartProps();\n\n setTimeout(() => {\n this._start();\n }, this._croppedZoom ? 30 : 0);\n }\n /** @private */\n\n\n _prepareOpen() {\n this.pswp.off('firstZoomPan', this._prepareOpen);\n\n if (!this.isOpening) {\n const slide = this.pswp.currSlide;\n this.isOpening = true;\n this.isClosing = false;\n this._duration = this.pswp.options.showAnimationDuration;\n\n if (slide && slide.zoomLevels.initial * slide.width >= this.pswp.options.maxWidthToAnimate) {\n this._duration = 0;\n }\n\n this._applyStartProps();\n }\n }\n /** @private */\n\n\n _applyStartProps() {\n const {\n pswp\n } = this;\n const slide = this.pswp.currSlide;\n const {\n options\n } = pswp;\n\n if (options.showHideAnimationType === 'fade') {\n options.showHideOpacity = true;\n this._thumbBounds = undefined;\n } else if (options.showHideAnimationType === 'none') {\n options.showHideOpacity = false;\n this._duration = 0;\n this._thumbBounds = undefined;\n } else if (this.isOpening && pswp._initialThumbBounds) {\n // Use initial bounds if defined\n this._thumbBounds = pswp._initialThumbBounds;\n } else {\n this._thumbBounds = this.pswp.getThumbBounds();\n }\n\n this._placeholder = slide === null || slide === void 0 ? void 0 : slide.getPlaceholderElement();\n pswp.animations.stopAll(); // Discard animations when duration is less than 50ms\n\n this._useAnimation = Boolean(this._duration && this._duration > 50);\n this._animateZoom = Boolean(this._thumbBounds) && (slide === null || slide === void 0 ? void 0 : slide.content.usePlaceholder()) && (!this.isClosing || !pswp.mainScroll.isShifted());\n\n if (!this._animateZoom) {\n this._animateRootOpacity = true;\n\n if (this.isOpening && slide) {\n slide.zoomAndPanToInitial();\n slide.applyCurrentZoomPan();\n }\n } else {\n var _options$showHideOpac;\n\n this._animateRootOpacity = (_options$showHideOpac = options.showHideOpacity) !== null && _options$showHideOpac !== void 0 ? _options$showHideOpac : false;\n }\n\n this._animateBgOpacity = !this._animateRootOpacity && this.pswp.options.bgOpacity > MIN_OPACITY;\n this._opacityElement = this._animateRootOpacity ? pswp.element : pswp.bg;\n\n if (!this._useAnimation) {\n this._duration = 0;\n this._animateZoom = false;\n this._animateBgOpacity = false;\n this._animateRootOpacity = true;\n\n if (this.isOpening) {\n if (pswp.element) {\n pswp.element.style.opacity = String(MIN_OPACITY);\n }\n\n pswp.applyBgOpacity(1);\n }\n\n return;\n }\n\n if (this._animateZoom && this._thumbBounds && this._thumbBounds.innerRect) {\n var _this$pswp$currSlide;\n\n // Properties are used when animation from cropped thumbnail\n this._croppedZoom = true;\n this._cropContainer1 = this.pswp.container;\n this._cropContainer2 = (_this$pswp$currSlide = this.pswp.currSlide) === null || _this$pswp$currSlide === void 0 ? void 0 : _this$pswp$currSlide.holderElement;\n\n if (pswp.container) {\n pswp.container.style.overflow = 'hidden';\n pswp.container.style.width = pswp.viewportSize.x + 'px';\n }\n } else {\n this._croppedZoom = false;\n }\n\n if (this.isOpening) {\n // Apply styles before opening transition\n if (this._animateRootOpacity) {\n if (pswp.element) {\n pswp.element.style.opacity = String(MIN_OPACITY);\n }\n\n pswp.applyBgOpacity(1);\n } else {\n if (this._animateBgOpacity && pswp.bg) {\n pswp.bg.style.opacity = String(MIN_OPACITY);\n }\n\n if (pswp.element) {\n pswp.element.style.opacity = '1';\n }\n }\n\n if (this._animateZoom) {\n this._setClosedStateZoomPan();\n\n if (this._placeholder) {\n // tell browser that we plan to animate the placeholder\n this._placeholder.style.willChange = 'transform'; // hide placeholder to allow hiding of\n // elements that overlap it (such as icons over the thumbnail)\n\n this._placeholder.style.opacity = String(MIN_OPACITY);\n }\n }\n } else if (this.isClosing) {\n // hide nearby slides to make sure that\n // they are not painted during the transition\n if (pswp.mainScroll.itemHolders[0]) {\n pswp.mainScroll.itemHolders[0].el.style.display = 'none';\n }\n\n if (pswp.mainScroll.itemHolders[2]) {\n pswp.mainScroll.itemHolders[2].el.style.display = 'none';\n }\n\n if (this._croppedZoom) {\n if (pswp.mainScroll.x !== 0) {\n // shift the main scroller to zero position\n pswp.mainScroll.resetPosition();\n pswp.mainScroll.resize();\n }\n }\n }\n }\n /** @private */\n\n\n _start() {\n if (this.isOpening && this._useAnimation && this._placeholder && this._placeholder.tagName === 'IMG') {\n // To ensure smooth animation\n // we wait till the current slide image placeholder is decoded,\n // but no longer than 250ms,\n // and no shorter than 50ms\n // (just using requestanimationframe is not enough in Firefox,\n // for some reason)\n new Promise(resolve => {\n let decoded = false;\n let isDelaying = true;\n decodeImage(\n /** @type {HTMLImageElement} */\n this._placeholder).finally(() => {\n decoded = true;\n\n if (!isDelaying) {\n resolve(true);\n }\n });\n setTimeout(() => {\n isDelaying = false;\n\n if (decoded) {\n resolve(true);\n }\n }, 50);\n setTimeout(resolve, 250);\n }).finally(() => this._initiate());\n } else {\n this._initiate();\n }\n }\n /** @private */\n\n\n _initiate() {\n var _this$pswp$element, _this$pswp$element2;\n\n (_this$pswp$element = this.pswp.element) === null || _this$pswp$element === void 0 || _this$pswp$element.style.setProperty('--pswp-transition-duration', this._duration + 'ms');\n this.pswp.dispatch(this.isOpening ? 'openingAnimationStart' : 'closingAnimationStart'); // legacy event\n\n this.pswp.dispatch(\n /** @type {'initialZoomIn' | 'initialZoomOut'} */\n 'initialZoom' + (this.isOpening ? 'In' : 'Out'));\n (_this$pswp$element2 = this.pswp.element) === null || _this$pswp$element2 === void 0 || _this$pswp$element2.classList.toggle('pswp--ui-visible', this.isOpening);\n\n if (this.isOpening) {\n if (this._placeholder) {\n // unhide the placeholder\n this._placeholder.style.opacity = '1';\n }\n\n this._animateToOpenState();\n } else if (this.isClosing) {\n this._animateToClosedState();\n }\n\n if (!this._useAnimation) {\n this._onAnimationComplete();\n }\n }\n /** @private */\n\n\n _onAnimationComplete() {\n const {\n pswp\n } = this;\n this.isOpen = this.isOpening;\n this.isClosed = this.isClosing;\n this.isOpening = false;\n this.isClosing = false;\n pswp.dispatch(this.isOpen ? 'openingAnimationEnd' : 'closingAnimationEnd'); // legacy event\n\n pswp.dispatch(\n /** @type {'initialZoomInEnd' | 'initialZoomOutEnd'} */\n 'initialZoom' + (this.isOpen ? 'InEnd' : 'OutEnd'));\n\n if (this.isClosed) {\n pswp.destroy();\n } else if (this.isOpen) {\n var _pswp$currSlide;\n\n if (this._animateZoom && pswp.container) {\n pswp.container.style.overflow = 'visible';\n pswp.container.style.width = '100%';\n }\n\n (_pswp$currSlide = pswp.currSlide) === null || _pswp$currSlide === void 0 || _pswp$currSlide.applyCurrentZoomPan();\n }\n }\n /** @private */\n\n\n _animateToOpenState() {\n const {\n pswp\n } = this;\n\n if (this._animateZoom) {\n if (this._croppedZoom && this._cropContainer1 && this._cropContainer2) {\n this._animateTo(this._cropContainer1, 'transform', 'translate3d(0,0,0)');\n\n this._animateTo(this._cropContainer2, 'transform', 'none');\n }\n\n if (pswp.currSlide) {\n pswp.currSlide.zoomAndPanToInitial();\n\n this._animateTo(pswp.currSlide.container, 'transform', pswp.currSlide.getCurrentTransform());\n }\n }\n\n if (this._animateBgOpacity && pswp.bg) {\n this._animateTo(pswp.bg, 'opacity', String(pswp.options.bgOpacity));\n }\n\n if (this._animateRootOpacity && pswp.element) {\n this._animateTo(pswp.element, 'opacity', '1');\n }\n }\n /** @private */\n\n\n _animateToClosedState() {\n const {\n pswp\n } = this;\n\n if (this._animateZoom) {\n this._setClosedStateZoomPan(true);\n } // do not animate opacity if it's already at 0\n\n\n if (this._animateBgOpacity && pswp.bgOpacity > 0.01 && pswp.bg) {\n this._animateTo(pswp.bg, 'opacity', '0');\n }\n\n if (this._animateRootOpacity && pswp.element) {\n this._animateTo(pswp.element, 'opacity', '0');\n }\n }\n /**\r\n * @private\r\n * @param {boolean} [animate]\r\n */\n\n\n _setClosedStateZoomPan(animate) {\n if (!this._thumbBounds) return;\n const {\n pswp\n } = this;\n const {\n innerRect\n } = this._thumbBounds;\n const {\n currSlide,\n viewportSize\n } = pswp;\n\n if (this._croppedZoom && innerRect && this._cropContainer1 && this._cropContainer2) {\n const containerOnePanX = -viewportSize.x + (this._thumbBounds.x - innerRect.x) + innerRect.w;\n const containerOnePanY = -viewportSize.y + (this._thumbBounds.y - innerRect.y) + innerRect.h;\n const containerTwoPanX = viewportSize.x - innerRect.w;\n const containerTwoPanY = viewportSize.y - innerRect.h;\n\n if (animate) {\n this._animateTo(this._cropContainer1, 'transform', toTransformString(containerOnePanX, containerOnePanY));\n\n this._animateTo(this._cropContainer2, 'transform', toTransformString(containerTwoPanX, containerTwoPanY));\n } else {\n setTransform(this._cropContainer1, containerOnePanX, containerOnePanY);\n setTransform(this._cropContainer2, containerTwoPanX, containerTwoPanY);\n }\n }\n\n if (currSlide) {\n equalizePoints(currSlide.pan, innerRect || this._thumbBounds);\n currSlide.currZoomLevel = this._thumbBounds.w / currSlide.width;\n\n if (animate) {\n this._animateTo(currSlide.container, 'transform', currSlide.getCurrentTransform());\n } else {\n currSlide.applyCurrentZoomPan();\n }\n }\n }\n /**\r\n * @private\r\n * @param {HTMLElement} target\r\n * @param {'transform' | 'opacity'} prop\r\n * @param {string} propValue\r\n */\n\n\n _animateTo(target, prop, propValue) {\n if (!this._duration) {\n target.style[prop] = propValue;\n return;\n }\n\n const {\n animations\n } = this.pswp;\n /** @type {AnimationProps} */\n\n const animProps = {\n duration: this._duration,\n easing: this.pswp.options.easing,\n onComplete: () => {\n if (!animations.activeAnimations.length) {\n this._onAnimationComplete();\n }\n },\n target\n };\n animProps[prop] = propValue;\n animations.startTransition(animProps);\n }\n\n}\n\n/**\r\n * @template T\r\n * @typedef {import('./types.js').Type} Type\r\n */\n\n/** @typedef {import('./slide/slide.js').SlideData} SlideData */\n\n/** @typedef {import('./slide/zoom-level.js').ZoomLevelOption} ZoomLevelOption */\n\n/** @typedef {import('./ui/ui-element.js').UIElementData} UIElementData */\n\n/** @typedef {import('./main-scroll.js').ItemHolder} ItemHolder */\n\n/** @typedef {import('./core/eventable.js').PhotoSwipeEventsMap} PhotoSwipeEventsMap */\n\n/** @typedef {import('./core/eventable.js').PhotoSwipeFiltersMap} PhotoSwipeFiltersMap */\n\n/** @typedef {import('./slide/get-thumb-bounds').Bounds} Bounds */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {import('./core/eventable.js').EventCallback} EventCallback\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {import('./core/eventable.js').AugmentedEvent} AugmentedEvent\r\n */\n\n/** @typedef {{ x: number; y: number; id?: string | number }} Point */\n\n/** @typedef {{ top: number; bottom: number; left: number; right: number }} Padding */\n\n/** @typedef {SlideData[]} DataSourceArray */\n\n/** @typedef {{ gallery: HTMLElement; items?: HTMLElement[] }} DataSourceObject */\n\n/** @typedef {DataSourceArray | DataSourceObject} DataSource */\n\n/** @typedef {(point: Point, originalEvent: PointerEvent) => void} ActionFn */\n\n/** @typedef {'close' | 'next' | 'zoom' | 'zoom-or-close' | 'toggle-controls'} ActionType */\n\n/** @typedef {Type | { default: Type }} PhotoSwipeModule */\n\n/** @typedef {PhotoSwipeModule | Promise | (() => Promise)} PhotoSwipeModuleOption */\n\n/**\r\n * @typedef {string | NodeListOf | HTMLElement[] | HTMLElement} ElementProvider\r\n */\n\n/** @typedef {Partial} PhotoSwipeOptions https://photoswipe.com/options/ */\n\n/**\r\n * @typedef {Object} PreparedPhotoSwipeOptions\r\n *\r\n * @prop {DataSource} [dataSource]\r\n * Pass an array of any items via dataSource option. Its length will determine amount of slides\r\n * (which may be modified further from numItems event).\r\n *\r\n * Each item should contain data that you need to generate slide\r\n * (for image slide it would be src (image URL), width (image width), height, srcset, alt).\r\n *\r\n * If these properties are not present in your initial array, you may \"pre-parse\" each item from itemData filter.\r\n *\r\n * @prop {number} bgOpacity\r\n * Background backdrop opacity, always define it via this option and not via CSS rgba color.\r\n *\r\n * @prop {number} spacing\r\n * Spacing between slides. Defined as ratio relative to the viewport width (0.1 = 10% of viewport).\r\n *\r\n * @prop {boolean} allowPanToNext\r\n * Allow swipe navigation to the next slide when the current slide is zoomed. Does not apply to mouse events.\r\n *\r\n * @prop {boolean} loop\r\n * If set to true you'll be able to swipe from the last to the first image.\r\n * Option is always false when there are less than 3 slides.\r\n *\r\n * @prop {boolean} [wheelToZoom]\r\n * By default PhotoSwipe zooms image with ctrl-wheel, if you enable this option - image will zoom just via wheel.\r\n *\r\n * @prop {boolean} pinchToClose\r\n * Pinch touch gesture to close the gallery.\r\n *\r\n * @prop {boolean} closeOnVerticalDrag\r\n * Vertical drag gesture to close the PhotoSwipe.\r\n *\r\n * @prop {Padding} [padding]\r\n * Slide area padding (in pixels).\r\n *\r\n * @prop {(viewportSize: Point, itemData: SlideData, index: number) => Padding} [paddingFn]\r\n * The option is checked frequently, so make sure it's performant. Overrides padding option if defined. For example:\r\n *\r\n * @prop {number | false} hideAnimationDuration\r\n * Transition duration in milliseconds, can be 0.\r\n *\r\n * @prop {number | false} showAnimationDuration\r\n * Transition duration in milliseconds, can be 0.\r\n *\r\n * @prop {number | false} zoomAnimationDuration\r\n * Transition duration in milliseconds, can be 0.\r\n *\r\n * @prop {string} easing\r\n * String, 'cubic-bezier(.4,0,.22,1)'. CSS easing function for open/close/zoom transitions.\r\n *\r\n * @prop {boolean} escKey\r\n * Esc key to close.\r\n *\r\n * @prop {boolean} arrowKeys\r\n * Left/right arrow keys for navigation.\r\n *\r\n * @prop {boolean} returnFocus\r\n * Restore focus the last active element after PhotoSwipe is closed.\r\n *\r\n * @prop {boolean} clickToCloseNonZoomable\r\n * If image is not zoomable (for example, smaller than viewport) it can be closed by clicking on it.\r\n *\r\n * @prop {ActionType | ActionFn | false} imageClickAction\r\n * Refer to click and tap actions page.\r\n *\r\n * @prop {ActionType | ActionFn | false} bgClickAction\r\n * Refer to click and tap actions page.\r\n *\r\n * @prop {ActionType | ActionFn | false} tapAction\r\n * Refer to click and tap actions page.\r\n *\r\n * @prop {ActionType | ActionFn | false} doubleTapAction\r\n * Refer to click and tap actions page.\r\n *\r\n * @prop {number} preloaderDelay\r\n * Delay before the loading indicator will be displayed,\r\n * if image is loaded during it - the indicator will not be displayed at all. Can be zero.\r\n *\r\n * @prop {string} indexIndicatorSep\r\n * Used for slide count indicator (\"1 of 10 \").\r\n *\r\n * @prop {(options: PhotoSwipeOptions, pswp: PhotoSwipeBase) => Point} [getViewportSizeFn]\r\n * A function that should return slide viewport width and height, in format {x: 100, y: 100}.\r\n *\r\n * @prop {string} errorMsg\r\n * Message to display when the image wasn't able to load. If you need to display HTML - use contentErrorElement filter.\r\n *\r\n * @prop {[number, number]} preload\r\n * Lazy loading of nearby slides based on direction of movement. Should be an array with two integers,\r\n * first one - number of items to preload before the current image, second one - after the current image.\r\n * Two nearby images are always loaded.\r\n *\r\n * @prop {string} [mainClass]\r\n * Class that will be added to the root element of PhotoSwipe, may contain multiple separated by space.\r\n * Example on Styling page.\r\n *\r\n * @prop {HTMLElement} [appendToEl]\r\n * Element to which PhotoSwipe dialog will be appended when it opens.\r\n *\r\n * @prop {number} maxWidthToAnimate\r\n * Maximum width of image to animate, if initial rendered image width\r\n * is larger than this value - the opening/closing transition will be automatically disabled.\r\n *\r\n * @prop {string} [closeTitle]\r\n * Translating\r\n *\r\n * @prop {string} [zoomTitle]\r\n * Translating\r\n *\r\n * @prop {string} [arrowPrevTitle]\r\n * Translating\r\n *\r\n * @prop {string} [arrowNextTitle]\r\n * Translating\r\n *\r\n * @prop {'zoom' | 'fade' | 'none'} [showHideAnimationType]\r\n * To adjust opening or closing transition type use lightbox option `showHideAnimationType` (`String`).\r\n * It supports three values - `zoom` (default), `fade` (default if there is no thumbnail) and `none`.\r\n *\r\n * Animations are automatically disabled if user `(prefers-reduced-motion: reduce)`.\r\n *\r\n * @prop {number} index\r\n * Defines start slide index.\r\n *\r\n * @prop {(e: MouseEvent) => number} [getClickedIndexFn]\r\n *\r\n * @prop {boolean} [arrowPrev]\r\n * @prop {boolean} [arrowNext]\r\n * @prop {boolean} [zoom]\r\n * @prop {boolean} [close]\r\n * @prop {boolean} [counter]\r\n *\r\n * @prop {string} [arrowPrevSVG]\r\n * @prop {string} [arrowNextSVG]\r\n * @prop {string} [zoomSVG]\r\n * @prop {string} [closeSVG]\r\n * @prop {string} [counterSVG]\r\n *\r\n * @prop {string} [arrowPrevTitle]\r\n * @prop {string} [arrowNextTitle]\r\n * @prop {string} [zoomTitle]\r\n * @prop {string} [closeTitle]\r\n * @prop {string} [counterTitle]\r\n *\r\n * @prop {ZoomLevelOption} [initialZoomLevel]\r\n * @prop {ZoomLevelOption} [secondaryZoomLevel]\r\n * @prop {ZoomLevelOption} [maxZoomLevel]\r\n *\r\n * @prop {boolean} [mouseMovePan]\r\n * @prop {Point | null} [initialPointerPos]\r\n * @prop {boolean} [showHideOpacity]\r\n *\r\n * @prop {PhotoSwipeModuleOption} [pswpModule]\r\n * @prop {() => Promise} [openPromise]\r\n * @prop {boolean} [preloadFirstSlide]\r\n * @prop {ElementProvider} [gallery]\r\n * @prop {string} [gallerySelector]\r\n * @prop {ElementProvider} [children]\r\n * @prop {string} [childSelector]\r\n * @prop {string | false} [thumbSelector]\r\n */\n\n/** @type {PreparedPhotoSwipeOptions} */\n\nconst defaultOptions = {\n allowPanToNext: true,\n spacing: 0.1,\n loop: true,\n pinchToClose: true,\n closeOnVerticalDrag: true,\n hideAnimationDuration: 333,\n showAnimationDuration: 333,\n zoomAnimationDuration: 333,\n escKey: true,\n arrowKeys: true,\n returnFocus: true,\n maxWidthToAnimate: 4000,\n clickToCloseNonZoomable: true,\n imageClickAction: 'zoom-or-close',\n bgClickAction: 'close',\n tapAction: 'toggle-controls',\n doubleTapAction: 'zoom',\n indexIndicatorSep: ' / ',\n preloaderDelay: 2000,\n bgOpacity: 0.8,\n index: 0,\n errorMsg: 'The image cannot be loaded',\n preload: [1, 2],\n easing: 'cubic-bezier(.4,0,.22,1)'\n};\n/**\r\n * PhotoSwipe Core\r\n */\n\nclass PhotoSwipe extends PhotoSwipeBase {\n /**\r\n * @param {PhotoSwipeOptions} [options]\r\n */\n constructor(options) {\n super();\n this.options = this._prepareOptions(options || {});\n /**\r\n * offset of viewport relative to document\r\n *\r\n * @type {Point}\r\n */\n\n this.offset = {\n x: 0,\n y: 0\n };\n /**\r\n * @type {Point}\r\n * @private\r\n */\n\n this._prevViewportSize = {\n x: 0,\n y: 0\n };\n /**\r\n * Size of scrollable PhotoSwipe viewport\r\n *\r\n * @type {Point}\r\n */\n\n this.viewportSize = {\n x: 0,\n y: 0\n };\n /**\r\n * background (backdrop) opacity\r\n */\n\n this.bgOpacity = 1;\n this.currIndex = 0;\n this.potentialIndex = 0;\n this.isOpen = false;\n this.isDestroying = false;\n this.hasMouse = false;\n /**\r\n * @private\r\n * @type {SlideData}\r\n */\n\n this._initialItemData = {};\n /** @type {Bounds | undefined} */\n\n this._initialThumbBounds = undefined;\n /** @type {HTMLDivElement | undefined} */\n\n this.topBar = undefined;\n /** @type {HTMLDivElement | undefined} */\n\n this.element = undefined;\n /** @type {HTMLDivElement | undefined} */\n\n this.template = undefined;\n /** @type {HTMLDivElement | undefined} */\n\n this.container = undefined;\n /** @type {HTMLElement | undefined} */\n\n this.scrollWrap = undefined;\n /** @type {Slide | undefined} */\n\n this.currSlide = undefined;\n this.events = new DOMEvents();\n this.animations = new Animations();\n this.mainScroll = new MainScroll(this);\n this.gestures = new Gestures(this);\n this.opener = new Opener(this);\n this.keyboard = new Keyboard(this);\n this.contentLoader = new ContentLoader(this);\n }\n /** @returns {boolean} */\n\n\n init() {\n if (this.isOpen || this.isDestroying) {\n return false;\n }\n\n this.isOpen = true;\n this.dispatch('init'); // legacy\n\n this.dispatch('beforeOpen');\n\n this._createMainStructure(); // add classes to the root element of PhotoSwipe\n\n\n let rootClasses = 'pswp--open';\n\n if (this.gestures.supportsTouch) {\n rootClasses += ' pswp--touch';\n }\n\n if (this.options.mainClass) {\n rootClasses += ' ' + this.options.mainClass;\n }\n\n if (this.element) {\n this.element.className += ' ' + rootClasses;\n }\n\n this.currIndex = this.options.index || 0;\n this.potentialIndex = this.currIndex;\n this.dispatch('firstUpdate'); // starting index can be modified here\n // initialize scroll wheel handler to block the scroll\n\n this.scrollWheel = new ScrollWheel(this); // sanitize index\n\n if (Number.isNaN(this.currIndex) || this.currIndex < 0 || this.currIndex >= this.getNumItems()) {\n this.currIndex = 0;\n }\n\n if (!this.gestures.supportsTouch) {\n // enable mouse features if no touch support detected\n this.mouseDetected();\n } // causes forced synchronous layout\n\n\n this.updateSize();\n this.offset.y = window.pageYOffset;\n this._initialItemData = this.getItemData(this.currIndex);\n this.dispatch('gettingData', {\n index: this.currIndex,\n data: this._initialItemData,\n slide: undefined\n }); // *Layout* - calculate size and position of elements here\n\n this._initialThumbBounds = this.getThumbBounds();\n this.dispatch('initialLayout');\n this.on('openingAnimationEnd', () => {\n const {\n itemHolders\n } = this.mainScroll; // Add content to the previous and next slide\n\n if (itemHolders[0]) {\n itemHolders[0].el.style.display = 'block';\n this.setContent(itemHolders[0], this.currIndex - 1);\n }\n\n if (itemHolders[2]) {\n itemHolders[2].el.style.display = 'block';\n this.setContent(itemHolders[2], this.currIndex + 1);\n }\n\n this.appendHeavy();\n this.contentLoader.updateLazy();\n this.events.add(window, 'resize', this._handlePageResize.bind(this));\n this.events.add(window, 'scroll', this._updatePageScrollOffset.bind(this));\n this.dispatch('bindEvents');\n }); // set content for center slide (first time)\n\n if (this.mainScroll.itemHolders[1]) {\n this.setContent(this.mainScroll.itemHolders[1], this.currIndex);\n }\n\n this.dispatch('change');\n this.opener.open();\n this.dispatch('afterInit');\n return true;\n }\n /**\r\n * Get looped slide index\r\n * (for example, -1 will return the last slide)\r\n *\r\n * @param {number} index\r\n * @returns {number}\r\n */\n\n\n getLoopedIndex(index) {\n const numSlides = this.getNumItems();\n\n if (this.options.loop) {\n if (index > numSlides - 1) {\n index -= numSlides;\n }\n\n if (index < 0) {\n index += numSlides;\n }\n }\n\n return clamp(index, 0, numSlides - 1);\n }\n\n appendHeavy() {\n this.mainScroll.itemHolders.forEach(itemHolder => {\n var _itemHolder$slide;\n\n (_itemHolder$slide = itemHolder.slide) === null || _itemHolder$slide === void 0 || _itemHolder$slide.appendHeavy();\n });\n }\n /**\r\n * Change the slide\r\n * @param {number} index New index\r\n */\n\n\n goTo(index) {\n this.mainScroll.moveIndexBy(this.getLoopedIndex(index) - this.potentialIndex);\n }\n /**\r\n * Go to the next slide.\r\n */\n\n\n next() {\n this.goTo(this.potentialIndex + 1);\n }\n /**\r\n * Go to the previous slide.\r\n */\n\n\n prev() {\n this.goTo(this.potentialIndex - 1);\n }\n /**\r\n * @see slide/slide.js zoomTo\r\n *\r\n * @param {Parameters} args\r\n */\n\n\n zoomTo(...args) {\n var _this$currSlide;\n\n (_this$currSlide = this.currSlide) === null || _this$currSlide === void 0 || _this$currSlide.zoomTo(...args);\n }\n /**\r\n * @see slide/slide.js toggleZoom\r\n */\n\n\n toggleZoom() {\n var _this$currSlide2;\n\n (_this$currSlide2 = this.currSlide) === null || _this$currSlide2 === void 0 || _this$currSlide2.toggleZoom();\n }\n /**\r\n * Close the gallery.\r\n * After closing transition ends - destroy it\r\n */\n\n\n close() {\n if (!this.opener.isOpen || this.isDestroying) {\n return;\n }\n\n this.isDestroying = true;\n this.dispatch('close');\n this.events.removeAll();\n this.opener.close();\n }\n /**\r\n * Destroys the gallery:\r\n * - instantly closes the gallery\r\n * - unbinds events,\r\n * - cleans intervals and timeouts\r\n * - removes elements from DOM\r\n */\n\n\n destroy() {\n var _this$element;\n\n if (!this.isDestroying) {\n this.options.showHideAnimationType = 'none';\n this.close();\n return;\n }\n\n this.dispatch('destroy');\n this._listeners = {};\n\n if (this.scrollWrap) {\n this.scrollWrap.ontouchmove = null;\n this.scrollWrap.ontouchend = null;\n }\n\n (_this$element = this.element) === null || _this$element === void 0 || _this$element.remove();\n this.mainScroll.itemHolders.forEach(itemHolder => {\n var _itemHolder$slide2;\n\n (_itemHolder$slide2 = itemHolder.slide) === null || _itemHolder$slide2 === void 0 || _itemHolder$slide2.destroy();\n });\n this.contentLoader.destroy();\n this.events.removeAll();\n }\n /**\r\n * Refresh/reload content of a slide by its index\r\n *\r\n * @param {number} slideIndex\r\n */\n\n\n refreshSlideContent(slideIndex) {\n this.contentLoader.removeByIndex(slideIndex);\n this.mainScroll.itemHolders.forEach((itemHolder, i) => {\n var _this$currSlide$index, _this$currSlide3;\n\n let potentialHolderIndex = ((_this$currSlide$index = (_this$currSlide3 = this.currSlide) === null || _this$currSlide3 === void 0 ? void 0 : _this$currSlide3.index) !== null && _this$currSlide$index !== void 0 ? _this$currSlide$index : 0) - 1 + i;\n\n if (this.canLoop()) {\n potentialHolderIndex = this.getLoopedIndex(potentialHolderIndex);\n }\n\n if (potentialHolderIndex === slideIndex) {\n // set the new slide content\n this.setContent(itemHolder, slideIndex, true); // activate the new slide if it's current\n\n if (i === 1) {\n var _itemHolder$slide3;\n\n this.currSlide = itemHolder.slide;\n (_itemHolder$slide3 = itemHolder.slide) === null || _itemHolder$slide3 === void 0 || _itemHolder$slide3.setIsActive(true);\n }\n }\n });\n this.dispatch('change');\n }\n /**\r\n * Set slide content\r\n *\r\n * @param {ItemHolder} holder mainScroll.itemHolders array item\r\n * @param {number} index Slide index\r\n * @param {boolean} [force] If content should be set even if index wasn't changed\r\n */\n\n\n setContent(holder, index, force) {\n if (this.canLoop()) {\n index = this.getLoopedIndex(index);\n }\n\n if (holder.slide) {\n if (holder.slide.index === index && !force) {\n // exit if holder already contains this slide\n // this could be common when just three slides are used\n return;\n } // destroy previous slide\n\n\n holder.slide.destroy();\n holder.slide = undefined;\n } // exit if no loop and index is out of bounds\n\n\n if (!this.canLoop() && (index < 0 || index >= this.getNumItems())) {\n return;\n }\n\n const itemData = this.getItemData(index);\n holder.slide = new Slide(itemData, index, this); // set current slide\n\n if (index === this.currIndex) {\n this.currSlide = holder.slide;\n }\n\n holder.slide.append(holder.el);\n }\n /** @returns {Point} */\n\n\n getViewportCenterPoint() {\n return {\n x: this.viewportSize.x / 2,\n y: this.viewportSize.y / 2\n };\n }\n /**\r\n * Update size of all elements.\r\n * Executed on init and on page resize.\r\n *\r\n * @param {boolean} [force] Update size even if size of viewport was not changed.\r\n */\n\n\n updateSize(force) {\n // let item;\n // let itemIndex;\n if (this.isDestroying) {\n // exit if PhotoSwipe is closed or closing\n // (to avoid errors, as resize event might be delayed)\n return;\n } //const newWidth = this.scrollWrap.clientWidth;\n //const newHeight = this.scrollWrap.clientHeight;\n\n\n const newViewportSize = getViewportSize(this.options, this);\n\n if (!force && pointsEqual(newViewportSize, this._prevViewportSize)) {\n // Exit if dimensions were not changed\n return;\n } //this._prevViewportSize.x = newWidth;\n //this._prevViewportSize.y = newHeight;\n\n\n equalizePoints(this._prevViewportSize, newViewportSize);\n this.dispatch('beforeResize');\n equalizePoints(this.viewportSize, this._prevViewportSize);\n\n this._updatePageScrollOffset();\n\n this.dispatch('viewportSize'); // Resize slides only after opener animation is finished\n // and don't re-calculate size on inital size update\n\n this.mainScroll.resize(this.opener.isOpen);\n\n if (!this.hasMouse && window.matchMedia('(any-hover: hover)').matches) {\n this.mouseDetected();\n }\n\n this.dispatch('resize');\n }\n /**\r\n * @param {number} opacity\r\n */\n\n\n applyBgOpacity(opacity) {\n this.bgOpacity = Math.max(opacity, 0);\n\n if (this.bg) {\n this.bg.style.opacity = String(this.bgOpacity * this.options.bgOpacity);\n }\n }\n /**\r\n * Whether mouse is detected\r\n */\n\n\n mouseDetected() {\n if (!this.hasMouse) {\n var _this$element2;\n\n this.hasMouse = true;\n (_this$element2 = this.element) === null || _this$element2 === void 0 || _this$element2.classList.add('pswp--has_mouse');\n }\n }\n /**\r\n * Page resize event handler\r\n *\r\n * @private\r\n */\n\n\n _handlePageResize() {\n this.updateSize(); // In iOS webview, if element size depends on document size,\n // it'll be measured incorrectly in resize event\n //\n // https://bugs.webkit.org/show_bug.cgi?id=170595\n // https://hackernoon.com/onresize-event-broken-in-mobile-safari-d8469027bf4d\n\n if (/iPhone|iPad|iPod/i.test(window.navigator.userAgent)) {\n setTimeout(() => {\n this.updateSize();\n }, 500);\n }\n }\n /**\r\n * Page scroll offset is used\r\n * to get correct coordinates\r\n * relative to PhotoSwipe viewport.\r\n *\r\n * @private\r\n */\n\n\n _updatePageScrollOffset() {\n this.setScrollOffset(0, window.pageYOffset);\n }\n /**\r\n * @param {number} x\r\n * @param {number} y\r\n */\n\n\n setScrollOffset(x, y) {\n this.offset.x = x;\n this.offset.y = y;\n this.dispatch('updateScrollOffset');\n }\n /**\r\n * Create main HTML structure of PhotoSwipe,\r\n * and add it to DOM\r\n *\r\n * @private\r\n */\n\n\n _createMainStructure() {\n // root DOM element of PhotoSwipe (.pswp)\n this.element = createElement('pswp', 'div');\n this.element.setAttribute('tabindex', '-1');\n this.element.setAttribute('role', 'dialog'); // template is legacy prop\n\n this.template = this.element; // Background is added as a separate element,\n // as animating opacity is faster than animating rgba()\n\n this.bg = createElement('pswp__bg', 'div', this.element);\n this.scrollWrap = createElement('pswp__scroll-wrap', 'section', this.element);\n this.container = createElement('pswp__container', 'div', this.scrollWrap); // aria pattern: carousel\n\n this.scrollWrap.setAttribute('aria-roledescription', 'carousel');\n this.container.setAttribute('aria-live', 'off');\n this.container.setAttribute('id', 'pswp__items');\n this.mainScroll.appendHolders();\n this.ui = new UI(this);\n this.ui.init(); // append to DOM\n\n (this.options.appendToEl || document.body).appendChild(this.element);\n }\n /**\r\n * Get position and dimensions of small thumbnail\r\n * {x:,y:,w:}\r\n *\r\n * Height is optional (calculated based on the large image)\r\n *\r\n * @returns {Bounds | undefined}\r\n */\n\n\n getThumbBounds() {\n return getThumbBounds(this.currIndex, this.currSlide ? this.currSlide.data : this._initialItemData, this);\n }\n /**\r\n * If the PhotoSwipe can have continuous loop\r\n * @returns Boolean\r\n */\n\n\n canLoop() {\n return this.options.loop && this.getNumItems() > 2;\n }\n /**\r\n * @private\r\n * @param {PhotoSwipeOptions} options\r\n * @returns {PreparedPhotoSwipeOptions}\r\n */\n\n\n _prepareOptions(options) {\n if (window.matchMedia('(prefers-reduced-motion), (update: slow)').matches) {\n options.showHideAnimationType = 'none';\n options.zoomAnimationDuration = 0;\n }\n /** @type {PreparedPhotoSwipeOptions} */\n\n\n return { ...defaultOptions,\n ...options\n };\n }\n\n}\n\nexport { PhotoSwipe as default };\n//# sourceMappingURL=photoswipe.esm.js.map\n"],"names":["createElement","className","tagName","appendToEl","el","document","appendChild","equalizePoints","p1","p2","x","y","undefined","id","roundPoint","p","Math","round","getDistanceBetween","abs","sqrt","pointsEqual","clamp","val","min","max","toTransformString","scale","propValue","setTransform","style","transform","defaultCSSEasing","setTransitionStyle","prop","duration","ease","transition","setWidthHeight","w","h","width","height","LOAD_STATE","isSafari","navigator","vendor","match","supportsPassive","window","addEventListener","Object","defineProperty","get","e","DOMEvents","constructor","this","_pool","add","target","type","listener","passive","_toggleListener","remove","removeAll","forEach","poolItem","unbind","skipPool","methodName","split","eType","filter","push","eventOptions","getViewportSize","options","pswp","getViewportSizeFn","newViewportSize","documentElement","clientWidth","innerHeight","parsePaddingOption","viewportSize","itemData","index","paddingValue","paddingFn","padding","legacyPropName","toUpperCase","slice","Number","getPanAreaSize","PanBounds","slide","currZoomLevel","center","update","_updateAxis","dispatch","reset","axis","elSize","data","panAreaSize","correctPan","panOffset","ZoomLevel","elementSize","fit","fill","vFill","initial","secondary","maxWidth","maxHeight","hRatio","vRatio","_getInitial","_getSecondary","_getMax","zoomLevels","slideData","_parseZoomLevelOption","optionPrefix","optionName","optionValue","Slide","isActive","currIndex","currentResolution","pan","isFirstSlide","opener","isOpen","content","contentLoader","getContentBySlide","container","holderElement","heavyAppended","bounds","prevDisplayedWidth","prevDisplayedHeight","setIsActive","activate","deactivate","append","transformOrigin","calculateSize","load","updateContentSize","appendHeavy","zoomAndPanToInitial","applyCurrentZoomPan","mainScroll","isShifted","defaultPrevented","destroy","hasSlide","resize","panTo","force","scaleMultiplier","sizeChanged","setDisplayedSize","getPlaceholderElement","_this$content$placeho","placeholder","element","zoomTo","destZoomLevel","centerPoint","transitionDuration","ignoreBounds","isZoomable","animations","stopAllPan","prevZoomLevel","setZoomLevel","calculateZoomToPanOffset","finishTransition","_setResolution","startTransition","isPan","name","getCurrentTransform","onComplete","easing","toggleZoom","zoomAnimationDuration","point","getViewportCenterPoint","zoomFactor","panX","panY","isPannable","Boolean","_applyZoomTransform","currSlide","zoom","newResolution","DragHandler","gestures","startPan","start","stopAll","change","prevP1","dragAxis","closeOnVerticalDrag","isMultitouch","_setPanWithFriction","bgOpacity","_getVerticalDragRatio","applyBgOpacity","_panOrMoveMainScroll","end","velocity","indexDiff","currentSlideVisibilityRatio","getCurrSlideX","moveIndexBy","correctZoomPan","_finishPanGestureForAxis","panPos","restoreBgOpacity","projectedPosition","initialVelocity","decelerationRate","project","vDragRatio","projectedVDragRatio","close","correctedPanPosition","dampingRatio","initialBgOpacity","totalPanDist","startSpring","onUpdate","pos","animationProgressRatio","floor","delta","newMainScrollX","moveTo","newPan","allowPanToNext","currSlideMainScrollX","mainScrollShiftDiff","isLeftToRight","isRightToLeft","_this$pswp$currSlide$","_this$pswp$currSlide","potentialPan","customFriction","getZoomPointsCenter","ZoomHandler","_startPan","_startZoomPoint","_zoomPoint","_wasOverFitZoomLevel","_startZoomLevel","startP1","startP2","minZoomLevel","maxZoomLevel","pinchToClose","_calculatePanForZoomLevel","ignoreGesture","destinationZoomLevel","currZoomLevelNeedsChange","initialPan","destinationPan","panNeedsChange","naturalFrequency","now","newZoomLevel","didTapOnMainContent","event","closest","TapHandler","click","originalEvent","targetClassList","classList","isImageClick","contains","isBackgroundClick","_doClickOrTapAction","tap","doubleTap","actionName","_this$gestures$pswp$e","actionFullName","clickToCloseNonZoomable","toggle","call","Gestures","prevP2","_lastStartP1","_intervalP1","_numActivePoints","_ongoingPointers","_touchEventEnabled","_pointerEventEnabled","PointerEvent","supportsTouch","maxTouchPoints","_intervalTime","_velocityCalculated","isDragging","isZooming","raf","_tapTimer","drag","tapHandler","on","events","scrollWrap","_onClick","bind","_bindEvents","ontouchmove","ontouchend","pref","down","up","cancel","cancelEvent","onPointerDown","onPointerMove","onPointerUp","isMousePointer","pointerType","button","mouseDetected","_preventPointerEventBehaviour","_updatePoints","_clearTapTimer","preventDefault","_finishDrag","_updateStartPoints","_rafStopLoop","_rafRenderLoop","_calculateDragDirection","Date","_updateVelocity","_finishTap","_updatePrevPoints","requestAnimationFrame","time","_getVelocity","indexOf","tapDelay","doubleTapAction","setTimeout","clearTimeout","displacement","cancelAnimationFrame","pointerEvent","pointerIndex","findIndex","ongoingPointer","pointerId","splice","_convertEventPosToPoint","length","touchEvent","touches","diff","axisToCheck","pageX","offset","pageY","identifier","stopPropagation","MainScroll","slideWidth","_currPositionIndex","_prevPositionIndex","_containerShiftIndex","itemHolders","resizeSlides","newSlideWidth","spacing","slideWidthChanged","itemHolder","resetPosition","appendHolders","i","setAttribute","display","canBeSwiped","getNumItems","animate","velocityX","newIndex","potentialIndex","numSlides","canLoop","getLoopedIndex","distance","stopMainScroll","destinationX","isMainScroll","updateCurrItem","currDiff","currDistance","_this$itemHolders$","positionDifference","tempHolder","diffAbs","shift","setContent","pop","unshift","updateLazy","dragging","newSlideIndexOffset","KeyboardKeyCodesMap","Escape","z","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Tab","getKeyboardEventKey","key","isKeySupported","Keyboard","_wasFocused","initialPointerPos","_focusRoot","_onFocusIn","_onKeyDown","lastActiveElement","activeElement","returnFocus","focus","ctrlKey","metaKey","altKey","shiftKey","specialKeyUsed","keydownAction","isForward","keyCode","escKey","arrowKeys","template","DEFAULT_EASING","CSSAnimation","props","_props$prop","onFinish","_target","_onComplete","_finished","_onTransitionEnd","_helperTimeout","_finalizeAnimation","removeEventListener","SpringEaser","_dampingRatio","_naturalFrequency","_dampedFrequency","easeFrame","deltaPosition","deltaTime","coeff","naturalDumpingPow","E","dumpedFCos","cos","dumpedFSin","sin","SpringAnimation","_raf","easer","prevTime","animationLoop","Animations","activeAnimations","_start","isSpring","animation","stop","isPanRunning","some","ScrollWheel","_onWheel","deltaX","deltaY","wheelToZoom","deltaMode","clientX","clientY","UIElement","_container","elementHTML","html","isButton","toLowerCase","title","ariaLabel","ariaText","innerHTML","htmlData","isCustomSVG","svgData","out","join","size","outlineID","inner","addElementHTML","onInit","onClick","onclick","appendTo","topBar","applyFilters","initArrowButton","isNextButton","loop","disabled","arrowPrev","order","arrowNext","closeButton","zoomButton","loadingIndicator","indicatorElement","isVisible","delayTimeout","setIndicatorVisibility","visible","updatePreloaderVisibility","_pswp$currSlide","isLoading","_pswp$currSlide2","preloaderDelay","ui","counterIndicator","counterElement","innerText","indexIndicatorSep","setZoomedIn","isZoomedIn","UI","isRegistered","uiElementsData","items","_lastUpdatedZoomLevel","init","sort","a","b","uiElementData","registerElement","_pswp$element","_onZoomPanUpdate","elementData","isClosing","currZoomLevelDiff","imageClickAction","PhotoSwipeEvent","details","assign","Eventable","_listeners","_filters","addFilter","fn","priority","_this$_filters$name","_this$_filters$name2","_this$pswp","f1","f2","removeFilter","args","_this$_filters$name3","apply","_this$_listeners$name","_this$pswp2","off","_this$pswp3","_this$_listeners$name2","Placeholder","imageSrc","imgEl","decoding","alt","src","_this$element","parentNode","Content","instance","displayedImageWidth","displayedImageHeight","isAttached","isDecoding","state","removePlaceholder","keepPlaceholder","isLazy","reload","usePlaceholder","placeholderEl","parentElement","prepend","placeholderSrc","msrc","isImageContent","loadImage","_this$data$src","_this$data$alt","imageElement","updateSrcsetSizes","srcset","complete","onLoaded","onload","onerror","onError","setSlide","displayError","isError","isInitialSizeUpdate","image","sizesWidth","dataset","largestUsedSize","parseInt","sizes","String","lazyLoad","_this$instance$option","_this$instance$option2","errorMsgEl","errorMsg","supportsDecode","decode","catch","finally","appendImage","lazyLoadData","createContentFromData","zoomLevel","ceil","ContentLoader","limit","preload","_cachedItems","loadSlideByIndex","initialIndex","getContentByIndex","getItemData","lazyLoadSlide","addToCache","removeByIndex","indexToRemove","item","find","PhotoSwipeBase","_this$options","numItems","dataSource","_getGalleryDOMElements","gallery","_this$options2","dataSourceItem","Array","isArray","Element","_domElementToItemData","galleryElement","_this$options3","_this$options4","children","childSelector","option","legacySelector","parent","elements","NodeList","from","selector","querySelectorAll","getElementsFromOption","linkEl","querySelector","pswpSrc","href","pswpSrcset","pswpWidth","pswpHeight","pswpType","thumbnailEl","_thumbnailEl$getAttri","currentSrc","getAttribute","pswpCropped","cropped","thumbCropped","MIN_OPACITY","Opener","isClosed","isOpening","_duration","_useAnimation","_croppedZoom","_animateRootOpacity","_animateBgOpacity","_placeholder","_opacityElement","_cropContainer1","_cropContainer2","_thumbBounds","_prepareOpen","open","hideAnimationDuration","maxWidthToAnimate","_applyStartProps","showAnimationDuration","_options$showHideOpac","showHideAnimationType","showHideOpacity","_initialThumbBounds","getThumbBounds","_animateZoom","bg","opacity","innerRect","overflow","_setClosedStateZoomPan","willChange","Promise","resolve","decoded","isDelaying","img","reject","_initiate","_this$pswp$element","_this$pswp$element2","setProperty","_animateToOpenState","_animateToClosedState","_onAnimationComplete","_animateTo","containerOnePanX","containerOnePanY","containerTwoPanX","containerTwoPanY","animProps","defaultOptions","bgClickAction","tapAction","PhotoSwipe","super","_prepareOptions","_prevViewportSize","isDestroying","hasMouse","_initialItemData","keyboard","_createMainStructure","rootClasses","mainClass","scrollWheel","isNaN","updateSize","pageYOffset","_handlePageResize","_updatePageScrollOffset","_itemHolder$slide","goTo","next","prev","_this$currSlide","_this$currSlide2","_itemHolder$slide2","refreshSlideContent","slideIndex","_this$currSlide$index","_this$currSlide3","potentialHolderIndex","_itemHolder$slide3","holder","matchMedia","matches","_this$element2","test","userAgent","setScrollOffset","body","thumbBounds","thumbnail","thumbSelector","imageWidth","imageHeight","thumbAreaRect","getBoundingClientRect","fillZoomLevel","offsetX","offsetY","left","top","getCroppedBoundsByElement","getBoundsByElement"],"sourceRoot":""}