[
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Desktop (please complete the following information):**\n - OS: [e.g. iOS]\n - Browser [e.g. chrome, safari]\n - Version [e.g. 22]\n\n**Smartphone (please complete the following information):**\n - Device: [e.g. iPhone6]\n - OS: [e.g. iOS8.1]\n - Browser [e.g. stock browser, safari]\n - Version [e.g. 22]\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/question.md",
    "content": "---\nname: Question\nabout: Describe your question here.\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\nHow do I ...\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules/*\n"
  },
  {
    "path": "README.md",
    "content": "# Archived\n\nThis repository has been archived and is now part of https://github.com/fancyapps/ui\n\n# Fancybox\n\njQuery lightbox script for displaying images, videos and more.\nTouch enabled, responsive and fully customizable.\n\n## Quick start\n\n1\\. Add latest jQuery and Fancybox files\n\n```html\n<script src=\"https://code.jquery.com/jquery-3.3.1.min.js\"></script>\n\n<link href=\"/path/to/jquery.fancybox.min.css\" rel=\"stylesheet\" />\n<script src=\"/path/to/jquery.fancybox.min.js\"></script>\n```\n\n2\\. Create links\n\n```html\n<a data-fancybox=\"gallery\" href=\"big_1.jpg\">\n  <img src=\"small_1.jpg\" />\n</a>\n\n<a data-fancybox=\"gallery\" href=\"big_2.jpg\">\n  <img src=\"small_2.jpg\" />\n</a>\n```\n\n3\\. Enjoy!\n\n## License\n\nFancybox is licensed under the [GPLv3](http://choosealicense.com/licenses/gpl-3.0) license for all open source applications.\nA commercial license is required for all commercial applications (including sites, themes and apps you plan to sell).\n\n[Read more about Fancybox license](http://fancyapps.com/).\n"
  },
  {
    "path": "bower.json",
    "content": "{\n  \"name\": \"fancybox\",\n  \"description\": \"Touch enabled, responsive and fully customizable jQuery lightbox script\",\n  \"keywords\": [\n    \"touch\",\n    \"responsive\",\n    \"lightbox\",\n    \"fancybox\",\n    \"gallery\",\n    \"jQuery\",\n    \"plugin\"\n  ],\n  \"homepage\": \"http://fancyapps.com/fancybox/\",\n  \"license\": \"GPL-3.0\",\n  \"moduleType\": \"globals\",\n  \"main\": [\n    \"dist/jquery.fancybox.min.css\",\n    \"dist/jquery.fancybox.min.js\"\n  ],\n  \"dependencies\": {\n    \"jquery\": \">=1.9.0\"\n  }\n}\n"
  },
  {
    "path": "dist/jquery.fancybox.css",
    "content": "body.compensate-for-scrollbar {\n    overflow: hidden;\n}\n\n.fancybox-active {\n    height: auto;\n}\n\n.fancybox-is-hidden {\n    left: -9999px;\n    margin: 0;\n    position: absolute !important;\n    top: -9999px;\n    visibility: hidden;\n}\n\n.fancybox-container {\n    -webkit-backface-visibility: hidden;\n    height: 100%;\n    left: 0;\n    outline: none;\n    position: fixed;\n    -webkit-tap-highlight-color: transparent;\n    top: 0;\n    -ms-touch-action: manipulation;\n    touch-action: manipulation;\n    transform: translateZ(0);\n    width: 100%;\n    z-index: 99992;\n}\n\n.fancybox-container * {\n    box-sizing: border-box;\n}\n\n.fancybox-outer,\n.fancybox-inner,\n.fancybox-bg,\n.fancybox-stage {\n    bottom: 0;\n    left: 0;\n    position: absolute;\n    right: 0;\n    top: 0;\n}\n\n.fancybox-outer {\n    -webkit-overflow-scrolling: touch;\n    overflow-y: auto;\n}\n\n.fancybox-bg {\n    background: rgb(30, 30, 30);\n    opacity: 0;\n    transition-duration: inherit;\n    transition-property: opacity;\n    transition-timing-function: cubic-bezier(.47, 0, .74, .71);\n}\n\n.fancybox-is-open .fancybox-bg {\n    opacity: .9;\n    transition-timing-function: cubic-bezier(.22, .61, .36, 1);\n}\n\n.fancybox-infobar,\n.fancybox-toolbar,\n.fancybox-caption,\n.fancybox-navigation .fancybox-button {\n    direction: ltr;\n    opacity: 0;\n    position: absolute;\n    transition: opacity .25s ease, visibility 0s ease .25s;\n    visibility: hidden;\n    z-index: 99997;\n}\n\n.fancybox-show-infobar .fancybox-infobar,\n.fancybox-show-toolbar .fancybox-toolbar,\n.fancybox-show-caption .fancybox-caption,\n.fancybox-show-nav .fancybox-navigation .fancybox-button {\n    opacity: 1;\n    transition: opacity .25s ease 0s, visibility 0s ease 0s;\n    visibility: visible;\n}\n\n.fancybox-infobar {\n    color: #ccc;\n    font-size: 13px;\n    -webkit-font-smoothing: subpixel-antialiased;\n    height: 44px;\n    left: 0;\n    line-height: 44px;\n    min-width: 44px;\n    mix-blend-mode: difference;\n    padding: 0 10px;\n    pointer-events: none;\n    top: 0;\n    -webkit-touch-callout: none;\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n}\n\n.fancybox-toolbar {\n    right: 0;\n    top: 0;\n}\n\n.fancybox-stage {\n    direction: ltr;\n    overflow: visible;\n    transform: translateZ(0);\n    z-index: 99994;\n}\n\n.fancybox-is-open .fancybox-stage {\n    overflow: hidden;\n}\n\n.fancybox-slide {\n    -webkit-backface-visibility: hidden;\n    /* Using without prefix would break IE11 */\n    display: none;\n    height: 100%;\n    left: 0;\n    outline: none;\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding: 44px;\n    position: absolute;\n    text-align: center;\n    top: 0;\n    transition-property: transform, opacity;\n    white-space: normal;\n    width: 100%;\n    z-index: 99994;\n}\n\n.fancybox-slide::before {\n    content: '';\n    display: inline-block;\n    font-size: 0;\n    height: 100%;\n    vertical-align: middle;\n    width: 0;\n}\n\n.fancybox-is-sliding .fancybox-slide,\n.fancybox-slide--previous,\n.fancybox-slide--current,\n.fancybox-slide--next {\n    display: block;\n}\n\n.fancybox-slide--image {\n    overflow: hidden;\n    padding: 44px 0;\n}\n\n.fancybox-slide--image::before {\n    display: none;\n}\n\n.fancybox-slide--html {\n    padding: 6px;\n}\n\n.fancybox-content {\n    background: #fff;\n    display: inline-block;\n    margin: 0;\n    max-width: 100%;\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding: 44px;\n    position: relative;\n    text-align: left;\n    vertical-align: middle;\n}\n\n.fancybox-slide--image .fancybox-content {\n    animation-timing-function: cubic-bezier(.5, 0, .14, 1);\n    -webkit-backface-visibility: hidden;\n    background: transparent;\n    background-repeat: no-repeat;\n    background-size: 100% 100%;\n    left: 0;\n    max-width: none;\n    overflow: visible;\n    padding: 0;\n    position: absolute;\n    top: 0;\n    -ms-transform-origin: top left;\n    transform-origin: top left;\n    transition-property: transform, opacity;\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n    z-index: 99995;\n}\n\n.fancybox-can-zoomOut .fancybox-content {\n    cursor: zoom-out;\n}\n\n.fancybox-can-zoomIn .fancybox-content {\n    cursor: zoom-in;\n}\n\n.fancybox-can-swipe .fancybox-content,\n.fancybox-can-pan .fancybox-content {\n    cursor: -webkit-grab;\n    cursor: grab;\n}\n\n.fancybox-is-grabbing .fancybox-content {\n    cursor: -webkit-grabbing;\n    cursor: grabbing;\n}\n\n.fancybox-container [data-selectable='true'] {\n    cursor: text;\n}\n\n.fancybox-image,\n.fancybox-spaceball {\n    background: transparent;\n    border: 0;\n    height: 100%;\n    left: 0;\n    margin: 0;\n    max-height: none;\n    max-width: none;\n    padding: 0;\n    position: absolute;\n    top: 0;\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n    width: 100%;\n}\n\n.fancybox-spaceball {\n    z-index: 1;\n}\n\n.fancybox-slide--video .fancybox-content,\n.fancybox-slide--map .fancybox-content,\n.fancybox-slide--pdf .fancybox-content,\n.fancybox-slide--iframe .fancybox-content {\n    height: 100%;\n    overflow: visible;\n    padding: 0;\n    width: 100%;\n}\n\n.fancybox-slide--video .fancybox-content {\n    background: #000;\n}\n\n.fancybox-slide--map .fancybox-content {\n    background: #e5e3df;\n}\n\n.fancybox-slide--iframe .fancybox-content {\n    background: #fff;\n}\n\n.fancybox-video,\n.fancybox-iframe {\n    background: transparent;\n    border: 0;\n    display: block;\n    height: 100%;\n    margin: 0;\n    overflow: hidden;\n    padding: 0;\n    width: 100%;\n}\n\n/* Fix iOS */\n.fancybox-iframe {\n    left: 0;\n    position: absolute;\n    top: 0;\n}\n\n.fancybox-error {\n    background: #fff;\n    cursor: default;\n    max-width: 400px;\n    padding: 40px;\n    width: 100%;\n}\n\n.fancybox-error p {\n    color: #444;\n    font-size: 16px;\n    line-height: 20px;\n    margin: 0;\n    padding: 0;\n}\n\n/* Buttons */\n\n.fancybox-button {\n    background: rgba(30, 30, 30, .6);\n    border: 0;\n    border-radius: 0;\n    box-shadow: none;\n    cursor: pointer;\n    display: inline-block;\n    height: 44px;\n    margin: 0;\n    padding: 10px;\n    position: relative;\n    transition: color .2s;\n    vertical-align: top;\n    visibility: inherit;\n    width: 44px;\n}\n\n.fancybox-button,\n.fancybox-button:visited,\n.fancybox-button:link {\n    color: #ccc;\n}\n\n.fancybox-button:hover {\n    color: #fff;\n}\n\n.fancybox-button:focus {\n    outline: none;\n}\n\n.fancybox-button.fancybox-focus {\n    outline: 1px dotted;\n}\n\n.fancybox-button[disabled],\n.fancybox-button[disabled]:hover {\n    color: #888;\n    cursor: default;\n    outline: none;\n}\n\n/* Fix IE11 */\n.fancybox-button div {\n    height: 100%;\n}\n\n.fancybox-button svg {\n    display: block;\n    height: 100%;\n    overflow: visible;\n    position: relative;\n    width: 100%;\n}\n\n.fancybox-button svg path {\n    fill: currentColor;\n    stroke-width: 0;\n}\n\n.fancybox-button--play svg:nth-child(2),\n.fancybox-button--fsenter svg:nth-child(2) {\n    display: none;\n}\n\n.fancybox-button--pause svg:nth-child(1),\n.fancybox-button--fsexit svg:nth-child(1) {\n    display: none;\n}\n\n.fancybox-progress {\n    background: #ff5268;\n    height: 2px;\n    left: 0;\n    position: absolute;\n    right: 0;\n    top: 0;\n    -ms-transform: scaleX(0);\n    transform: scaleX(0);\n    -ms-transform-origin: 0;\n    transform-origin: 0;\n    transition-property: transform;\n    transition-timing-function: linear;\n    z-index: 99998;\n}\n\n/* Close button on the top right corner of html content */\n\n.fancybox-close-small {\n    background: transparent;\n    border: 0;\n    border-radius: 0;\n    color: #ccc;\n    cursor: pointer;\n    opacity: .8;\n    padding: 8px;\n    position: absolute;\n    right: -12px;\n    top: -44px;\n    z-index: 401;\n}\n\n.fancybox-close-small:hover {\n    color: #fff;\n    opacity: 1;\n}\n\n.fancybox-slide--html .fancybox-close-small {\n    color: currentColor;\n    padding: 10px;\n    right: 0;\n    top: 0;\n}\n\n.fancybox-slide--image.fancybox-is-scaling .fancybox-content {\n    overflow: hidden;\n}\n\n.fancybox-is-scaling .fancybox-close-small,\n.fancybox-is-zoomable.fancybox-can-pan .fancybox-close-small {\n    display: none;\n}\n\n/* Navigation arrows */\n\n.fancybox-navigation .fancybox-button {\n    background-clip: content-box;\n    height: 100px;\n    opacity: 0;\n    position: absolute;\n    top: calc(50% - 50px);\n    width: 70px;\n}\n\n.fancybox-navigation .fancybox-button div {\n    padding: 7px;\n}\n\n.fancybox-navigation .fancybox-button--arrow_left {\n    left: 0;\n    left: env(safe-area-inset-left);\n    padding: 31px 26px 31px 6px;\n}\n\n.fancybox-navigation .fancybox-button--arrow_right {\n    padding: 31px 6px 31px 26px;\n    right: 0;\n    right: env(safe-area-inset-right);\n}\n\n/* Caption */\n\n.fancybox-caption {\n    background: linear-gradient(to top,\n        rgba(0, 0, 0, .85) 0%,\n        rgba(0, 0, 0, .3) 50%,\n        rgba(0, 0, 0, .15) 65%,\n        rgba(0, 0, 0, .075) 75.5%,\n        rgba(0, 0, 0, .037) 82.85%,\n        rgba(0, 0, 0, .019) 88%,\n        rgba(0, 0, 0, 0) 100%);\n    bottom: 0;\n    color: #eee;\n    font-size: 14px;\n    font-weight: 400;\n    left: 0;\n    line-height: 1.5;\n    padding: 75px 44px 25px 44px;\n    pointer-events: none;\n    right: 0;\n    text-align: center;\n    z-index: 99996;\n}\n\n@supports (padding: max(0px)) {\n    .fancybox-caption {\n        padding: 75px max(44px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(44px, env(safe-area-inset-left));\n    }\n}\n\n.fancybox-caption--separate {\n    margin-top: -50px;\n}\n\n.fancybox-caption__body {\n    max-height: 50vh;\n    overflow: auto;\n    pointer-events: all;\n}\n\n.fancybox-caption a,\n.fancybox-caption a:link,\n.fancybox-caption a:visited {\n    color: #ccc;\n    text-decoration: none;\n}\n\n.fancybox-caption a:hover {\n    color: #fff;\n    text-decoration: underline;\n}\n\n/* Loading indicator */\n\n.fancybox-loading {\n    animation: fancybox-rotate 1s linear infinite;\n    background: transparent;\n    border: 4px solid #888;\n    border-bottom-color: #fff;\n    border-radius: 50%;\n    height: 50px;\n    left: 50%;\n    margin: -25px 0 0 -25px;\n    opacity: .7;\n    padding: 0;\n    position: absolute;\n    top: 50%;\n    width: 50px;\n    z-index: 99999;\n}\n\n@keyframes fancybox-rotate {\n    100% {\n        transform: rotate(360deg);\n    }\n}\n\n/* Transition effects */\n\n.fancybox-animated {\n    transition-timing-function: cubic-bezier(0, 0, .25, 1);\n}\n\n/* transitionEffect: slide */\n\n.fancybox-fx-slide.fancybox-slide--previous {\n    opacity: 0;\n    transform: translate3d(-100%, 0, 0);\n}\n\n.fancybox-fx-slide.fancybox-slide--next {\n    opacity: 0;\n    transform: translate3d(100%, 0, 0);\n}\n\n.fancybox-fx-slide.fancybox-slide--current {\n    opacity: 1;\n    transform: translate3d(0, 0, 0);\n}\n\n/* transitionEffect: fade */\n\n.fancybox-fx-fade.fancybox-slide--previous,\n.fancybox-fx-fade.fancybox-slide--next {\n    opacity: 0;\n    transition-timing-function: cubic-bezier(.19, 1, .22, 1);\n}\n\n.fancybox-fx-fade.fancybox-slide--current {\n    opacity: 1;\n}\n\n/* transitionEffect: zoom-in-out */\n\n.fancybox-fx-zoom-in-out.fancybox-slide--previous {\n    opacity: 0;\n    transform: scale3d(1.5, 1.5, 1.5);\n}\n\n.fancybox-fx-zoom-in-out.fancybox-slide--next {\n    opacity: 0;\n    transform: scale3d(.5, .5, .5);\n}\n\n.fancybox-fx-zoom-in-out.fancybox-slide--current {\n    opacity: 1;\n    transform: scale3d(1, 1, 1);\n}\n\n/* transitionEffect: rotate */\n\n.fancybox-fx-rotate.fancybox-slide--previous {\n    opacity: 0;\n    -ms-transform: rotate(-360deg);\n    transform: rotate(-360deg);\n}\n\n.fancybox-fx-rotate.fancybox-slide--next {\n    opacity: 0;\n    -ms-transform: rotate(360deg);\n    transform: rotate(360deg);\n}\n\n.fancybox-fx-rotate.fancybox-slide--current {\n    opacity: 1;\n    -ms-transform: rotate(0deg);\n    transform: rotate(0deg);\n}\n\n/* transitionEffect: circular */\n\n.fancybox-fx-circular.fancybox-slide--previous {\n    opacity: 0;\n    transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0);\n}\n\n.fancybox-fx-circular.fancybox-slide--next {\n    opacity: 0;\n    transform: scale3d(0, 0, 0) translate3d(100%, 0, 0);\n}\n\n.fancybox-fx-circular.fancybox-slide--current {\n    opacity: 1;\n    transform: scale3d(1, 1, 1) translate3d(0, 0, 0);\n}\n\n/* transitionEffect: tube */\n\n.fancybox-fx-tube.fancybox-slide--previous {\n    transform: translate3d(-100%, 0, 0) scale(.1) skew(-10deg);\n}\n\n.fancybox-fx-tube.fancybox-slide--next {\n    transform: translate3d(100%, 0, 0) scale(.1) skew(10deg);\n}\n\n.fancybox-fx-tube.fancybox-slide--current {\n    transform: translate3d(0, 0, 0) scale(1);\n}\n\n/* Styling for Small-Screen Devices */\n@media all and (max-height: 576px) {\n    .fancybox-slide {\n        padding-left: 6px;\n        padding-right: 6px;\n    }\n\n    .fancybox-slide--image {\n        padding: 6px 0;\n    }\n\n    .fancybox-close-small {\n        right: -6px;\n    }\n\n    .fancybox-slide--image .fancybox-close-small {\n        background: #4e4e4e;\n        color: #f2f4f6;\n        height: 36px;\n        opacity: 1;\n        padding: 6px;\n        right: 0;\n        top: 0;\n        width: 36px;\n    }\n\n    .fancybox-caption {\n        padding-left: 12px;\n        padding-right: 12px;\n    }\n\n    @supports (padding: max(0px)) {\n        .fancybox-caption {\n            padding-left: max(12px, env(safe-area-inset-left));\n            padding-right: max(12px, env(safe-area-inset-right));\n        }\n    }\n}\n/* Share */\n\n.fancybox-share {\n    background: #f4f4f4;\n    border-radius: 3px;\n    max-width: 90%;\n    padding: 30px;\n    text-align: center;\n}\n\n.fancybox-share h1 {\n    color: #222;\n    font-size: 35px;\n    font-weight: 700;\n    margin: 0 0 20px 0;\n}\n\n.fancybox-share p {\n    margin: 0;\n    padding: 0;\n}\n\n.fancybox-share__button {\n    border: 0;\n    border-radius: 3px;\n    display: inline-block;\n    font-size: 14px;\n    font-weight: 700;\n    line-height: 40px;\n    margin: 0 5px 10px 5px;\n    min-width: 130px;\n    padding: 0 15px;\n    text-decoration: none;\n    transition: all .2s;\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n    white-space: nowrap;\n}\n\n.fancybox-share__button:visited,\n.fancybox-share__button:link {\n    color: #fff;\n}\n\n.fancybox-share__button:hover {\n    text-decoration: none;\n}\n\n.fancybox-share__button--fb {\n    background: #3b5998;\n}\n\n.fancybox-share__button--fb:hover {\n    background: #344e86;\n}\n\n.fancybox-share__button--pt {\n    background: #bd081d;\n}\n\n.fancybox-share__button--pt:hover {\n    background: #aa0719;\n}\n\n.fancybox-share__button--tw {\n    background: #1da1f2;\n}\n\n.fancybox-share__button--tw:hover {\n    background: #0d95e8;\n}\n\n.fancybox-share__button svg {\n    height: 25px;\n    margin-right: 7px;\n    position: relative;\n    top: -1px;\n    vertical-align: middle;\n    width: 25px;\n}\n\n.fancybox-share__button svg path {\n    fill: #fff;\n}\n\n.fancybox-share__input {\n    background: transparent;\n    border: 0;\n    border-bottom: 1px solid #d7d7d7;\n    border-radius: 0;\n    color: #5d5b5b;\n    font-size: 14px;\n    margin: 10px 0 0 0;\n    outline: none;\n    padding: 10px 15px;\n    width: 100%;\n}\n/* Thumbs */\n\n.fancybox-thumbs {\n    background: #ddd;\n    bottom: 0;\n    display: none;\n    margin: 0;\n    -webkit-overflow-scrolling: touch;\n    -ms-overflow-style: -ms-autohiding-scrollbar;\n    padding: 2px 2px 4px 2px;\n    position: absolute;\n    right: 0;\n    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n    top: 0;\n    width: 212px;\n    z-index: 99995;\n}\n\n.fancybox-thumbs-x {\n    overflow-x: auto;\n    overflow-y: hidden;\n}\n\n.fancybox-show-thumbs .fancybox-thumbs {\n    display: block;\n}\n\n.fancybox-show-thumbs .fancybox-inner {\n    right: 212px;\n}\n\n.fancybox-thumbs__list {\n    font-size: 0;\n    height: 100%;\n    list-style: none;\n    margin: 0;\n    overflow-x: hidden;\n    overflow-y: auto;\n    padding: 0;\n    position: absolute;\n    position: relative;\n    white-space: nowrap;\n    width: 100%;\n}\n\n.fancybox-thumbs-x .fancybox-thumbs__list {\n    overflow: hidden;\n}\n\n.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar {\n    width: 7px;\n}\n\n.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-track {\n    background: #fff;\n    border-radius: 10px;\n    box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);\n}\n\n.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-thumb {\n    background: #2a2a2a;\n    border-radius: 10px;\n}\n\n.fancybox-thumbs__list a {\n    -webkit-backface-visibility: hidden;\n    backface-visibility: hidden;\n    background-color: rgba(0, 0, 0, .1);\n    background-position: center center;\n    background-repeat: no-repeat;\n    background-size: cover;\n    cursor: pointer;\n    float: left;\n    height: 75px;\n    margin: 2px;\n    max-height: calc(100% - 8px);\n    max-width: calc(50% - 4px);\n    outline: none;\n    overflow: hidden;\n    padding: 0;\n    position: relative;\n    -webkit-tap-highlight-color: transparent;\n    width: 100px;\n}\n\n.fancybox-thumbs__list a::before {\n    border: 6px solid #ff5268;\n    bottom: 0;\n    content: '';\n    left: 0;\n    opacity: 0;\n    position: absolute;\n    right: 0;\n    top: 0;\n    transition: all .2s cubic-bezier(.25, .46, .45, .94);\n    z-index: 99991;\n}\n\n.fancybox-thumbs__list a:focus::before {\n    opacity: .5;\n}\n\n.fancybox-thumbs__list a.fancybox-thumbs-active::before {\n    opacity: 1;\n}\n\n/* Styling for Small-Screen Devices */\n@media all and (max-width: 576px) {\n    .fancybox-thumbs {\n        width: 110px;\n    }\n\n    .fancybox-show-thumbs .fancybox-inner {\n        right: 110px;\n    }\n\n    .fancybox-thumbs__list a {\n        max-width: calc(100% - 10px);\n    }\n}"
  },
  {
    "path": "dist/jquery.fancybox.js",
    "content": "// ==================================================\n// fancyBox v3.5.7\n//\n// Licensed GPLv3 for open source use\n// or fancyBox Commercial License for commercial use\n//\n// http://fancyapps.com/fancybox/\n// Copyright 2019 fancyApps\n//\n// ==================================================\n(function (window, document, $, undefined) {\n  \"use strict\";\n\n  window.console = window.console || {\n    info: function (stuff) {}\n  };\n\n  // If there's no jQuery, fancyBox can't work\n  // =========================================\n\n  if (!$) {\n    return;\n  }\n\n  // Check if fancyBox is already initialized\n  // ========================================\n\n  if ($.fn.fancybox) {\n    console.info(\"fancyBox already initialized\");\n\n    return;\n  }\n\n  // Private default settings\n  // ========================\n\n  var defaults = {\n    // Close existing modals\n    // Set this to false if you do not need to stack multiple instances\n    closeExisting: false,\n\n    // Enable infinite gallery navigation\n    loop: false,\n\n    // Horizontal space between slides\n    gutter: 50,\n\n    // Enable keyboard navigation\n    keyboard: true,\n\n    // Should allow caption to overlap the content\n    preventCaptionOverlap: true,\n\n    // Should display navigation arrows at the screen edges\n    arrows: true,\n\n    // Should display counter at the top left corner\n    infobar: true,\n\n    // Should display close button (using `btnTpl.smallBtn` template) over the content\n    // Can be true, false, \"auto\"\n    // If \"auto\" - will be automatically enabled for \"html\", \"inline\" or \"ajax\" items\n    smallBtn: \"auto\",\n\n    // Should display toolbar (buttons at the top)\n    // Can be true, false, \"auto\"\n    // If \"auto\" - will be automatically hidden if \"smallBtn\" is enabled\n    toolbar: \"auto\",\n\n    // What buttons should appear in the top right corner.\n    // Buttons will be created using templates from `btnTpl` option\n    // and they will be placed into toolbar (class=\"fancybox-toolbar\"` element)\n    buttons: [\n      \"zoom\",\n      //\"share\",\n      \"slideShow\",\n      //\"fullScreen\",\n      //\"download\",\n      \"thumbs\",\n      \"close\"\n    ],\n\n    // Detect \"idle\" time in seconds\n    idleTime: 3,\n\n    // Disable right-click and use simple image protection for images\n    protect: false,\n\n    // Shortcut to make content \"modal\" - disable keyboard navigtion, hide buttons, etc\n    modal: false,\n\n    image: {\n      // Wait for images to load before displaying\n      //   true  - wait for image to load and then display;\n      //   false - display thumbnail and load the full-sized image over top,\n      //           requires predefined image dimensions (`data-width` and `data-height` attributes)\n      preload: false\n    },\n\n    ajax: {\n      // Object containing settings for ajax request\n      settings: {\n        // This helps to indicate that request comes from the modal\n        // Feel free to change naming\n        data: {\n          fancybox: true\n        }\n      }\n    },\n\n    iframe: {\n      // Iframe template\n      tpl: '<iframe id=\"fancybox-frame{rnd}\" name=\"fancybox-frame{rnd}\" class=\"fancybox-iframe\" allowfullscreen=\"allowfullscreen\" allow=\"autoplay; fullscreen\" src=\"\"></iframe>',\n\n      // Preload iframe before displaying it\n      // This allows to calculate iframe content width and height\n      // (note: Due to \"Same Origin Policy\", you can't get cross domain data).\n      preload: true,\n\n      // Custom CSS styling for iframe wrapping element\n      // You can use this to set custom iframe dimensions\n      css: {},\n\n      // Iframe tag attributes\n      attr: {\n        scrolling: \"auto\"\n      }\n    },\n\n    // For HTML5 video only\n    video: {\n      tpl: '<video class=\"fancybox-video\" controls controlsList=\"nodownload\" poster=\"{{poster}}\">' +\n        '<source src=\"{{src}}\" type=\"{{format}}\" />' +\n        'Sorry, your browser doesn\\'t support embedded videos, <a href=\"{{src}}\">download</a> and watch with your favorite video player!' +\n        \"</video>\",\n      format: \"\", // custom video format\n      autoStart: true\n    },\n\n    // Default content type if cannot be detected automatically\n    defaultType: \"image\",\n\n    // Open/close animation type\n    // Possible values:\n    //   false            - disable\n    //   \"zoom\"           - zoom images from/to thumbnail\n    //   \"fade\"\n    //   \"zoom-in-out\"\n    //\n    animationEffect: \"zoom\",\n\n    // Duration in ms for open/close animation\n    animationDuration: 366,\n\n    // Should image change opacity while zooming\n    // If opacity is \"auto\", then opacity will be changed if image and thumbnail have different aspect ratios\n    zoomOpacity: \"auto\",\n\n    // Transition effect between slides\n    //\n    // Possible values:\n    //   false            - disable\n    //   \"fade'\n    //   \"slide'\n    //   \"circular'\n    //   \"tube'\n    //   \"zoom-in-out'\n    //   \"rotate'\n    //\n    transitionEffect: \"fade\",\n\n    // Duration in ms for transition animation\n    transitionDuration: 366,\n\n    // Custom CSS class for slide element\n    slideClass: \"\",\n\n    // Custom CSS class for layout\n    baseClass: \"\",\n\n    // Base template for layout\n    baseTpl: '<div class=\"fancybox-container\" role=\"dialog\" tabindex=\"-1\">' +\n      '<div class=\"fancybox-bg\"></div>' +\n      '<div class=\"fancybox-inner\">' +\n      '<div class=\"fancybox-infobar\"><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div>' +\n      '<div class=\"fancybox-toolbar\">{{buttons}}</div>' +\n      '<div class=\"fancybox-navigation\">{{arrows}}</div>' +\n      '<div class=\"fancybox-stage\"></div>' +\n      '<div class=\"fancybox-caption\"><div class=\"fancybox-caption__body\"></div></div>' +\n      \"</div>\" +\n      \"</div>\",\n\n    // Loading indicator template\n    spinnerTpl: '<div class=\"fancybox-loading\"></div>',\n\n    // Error message template\n    errorTpl: '<div class=\"fancybox-error\"><p>{{ERROR}}</p></div>',\n\n    btnTpl: {\n      download: '<a download data-fancybox-download class=\"fancybox-button fancybox-button--download\" title=\"{{DOWNLOAD}}\" href=\"javascript:;\">' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z\"/></svg>' +\n        \"</a>\",\n\n      zoom: '<button data-fancybox-zoom class=\"fancybox-button fancybox-button--zoom\" title=\"{{ZOOM}}\">' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z\"/></svg>' +\n        \"</button>\",\n\n      close: '<button data-fancybox-close class=\"fancybox-button fancybox-button--close\" title=\"{{CLOSE}}\">' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z\"/></svg>' +\n        \"</button>\",\n\n      // Arrows\n      arrowLeft: '<button data-fancybox-prev class=\"fancybox-button fancybox-button--arrow_left\" title=\"{{PREV}}\">' +\n        '<div><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z\"/></svg></div>' +\n        \"</button>\",\n\n      arrowRight: '<button data-fancybox-next class=\"fancybox-button fancybox-button--arrow_right\" title=\"{{NEXT}}\">' +\n        '<div><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z\"/></svg></div>' +\n        \"</button>\",\n\n      // This small close button will be appended to your html/inline/ajax content by default,\n      // if \"smallBtn\" option is not set to false\n      smallBtn: '<button type=\"button\" data-fancybox-close class=\"fancybox-button fancybox-close-small\" title=\"{{CLOSE}}\">' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1\" viewBox=\"0 0 24 24\"><path d=\"M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z\"/></svg>' +\n        \"</button>\"\n    },\n\n    // Container is injected into this element\n    parentEl: \"body\",\n\n    // Hide browser vertical scrollbars; use at your own risk\n    hideScrollbar: true,\n\n    // Focus handling\n    // ==============\n\n    // Try to focus on the first focusable element after opening\n    autoFocus: true,\n\n    // Put focus back to active element after closing\n    backFocus: true,\n\n    // Do not let user to focus on element outside modal content\n    trapFocus: true,\n\n    // Module specific options\n    // =======================\n\n    fullScreen: {\n      autoStart: false\n    },\n\n    // Set `touch: false` to disable panning/swiping\n    touch: {\n      vertical: true, // Allow to drag content vertically\n      momentum: true // Continue movement after releasing mouse/touch when panning\n    },\n\n    // Hash value when initializing manually,\n    // set `false` to disable hash change\n    hash: null,\n\n    // Customize or add new media types\n    // Example:\n    /*\n      media : {\n        youtube : {\n          params : {\n            autoplay : 0\n          }\n        }\n      }\n    */\n    media: {},\n\n    slideShow: {\n      autoStart: false,\n      speed: 3000\n    },\n\n    thumbs: {\n      autoStart: false, // Display thumbnails on opening\n      hideOnClose: true, // Hide thumbnail grid when closing animation starts\n      parentEl: \".fancybox-container\", // Container is injected into this element\n      axis: \"y\" // Vertical (y) or horizontal (x) scrolling\n    },\n\n    // Use mousewheel to navigate gallery\n    // If 'auto' - enabled for images only\n    wheel: \"auto\",\n\n    // Callbacks\n    //==========\n\n    // See Documentation/API/Events for more information\n    // Example:\n    /*\n      afterShow: function( instance, current ) {\n        console.info( 'Clicked element:' );\n        console.info( current.opts.$orig );\n      }\n    */\n\n    onInit: $.noop, // When instance has been initialized\n\n    beforeLoad: $.noop, // Before the content of a slide is being loaded\n    afterLoad: $.noop, // When the content of a slide is done loading\n\n    beforeShow: $.noop, // Before open animation starts\n    afterShow: $.noop, // When content is done loading and animating\n\n    beforeClose: $.noop, // Before the instance attempts to close. Return false to cancel the close.\n    afterClose: $.noop, // After instance has been closed\n\n    onActivate: $.noop, // When instance is brought to front\n    onDeactivate: $.noop, // When other instance has been activated\n\n    // Interaction\n    // ===========\n\n    // Use options below to customize taken action when user clicks or double clicks on the fancyBox area,\n    // each option can be string or method that returns value.\n    //\n    // Possible values:\n    //   \"close\"           - close instance\n    //   \"next\"            - move to next gallery item\n    //   \"nextOrClose\"     - move to next gallery item or close if gallery has only one item\n    //   \"toggleControls\"  - show/hide controls\n    //   \"zoom\"            - zoom image (if loaded)\n    //   false             - do nothing\n\n    // Clicked on the content\n    clickContent: function (current, event) {\n      return current.type === \"image\" ? \"zoom\" : false;\n    },\n\n    // Clicked on the slide\n    clickSlide: \"close\",\n\n    // Clicked on the background (backdrop) element;\n    // if you have not changed the layout, then most likely you need to use `clickSlide` option\n    clickOutside: \"close\",\n\n    // Same as previous two, but for double click\n    dblclickContent: false,\n    dblclickSlide: false,\n    dblclickOutside: false,\n\n    // Custom options when mobile device is detected\n    // =============================================\n\n    mobile: {\n      preventCaptionOverlap: false,\n      idleTime: false,\n      clickContent: function (current, event) {\n        return current.type === \"image\" ? \"toggleControls\" : false;\n      },\n      clickSlide: function (current, event) {\n        return current.type === \"image\" ? \"toggleControls\" : \"close\";\n      },\n      dblclickContent: function (current, event) {\n        return current.type === \"image\" ? \"zoom\" : false;\n      },\n      dblclickSlide: function (current, event) {\n        return current.type === \"image\" ? \"zoom\" : false;\n      }\n    },\n\n    // Internationalization\n    // ====================\n\n    lang: \"en\",\n    i18n: {\n      en: {\n        CLOSE: \"Close\",\n        NEXT: \"Next\",\n        PREV: \"Previous\",\n        ERROR: \"The requested content cannot be loaded. <br/> Please try again later.\",\n        PLAY_START: \"Start slideshow\",\n        PLAY_STOP: \"Pause slideshow\",\n        FULL_SCREEN: \"Full screen\",\n        THUMBS: \"Thumbnails\",\n        DOWNLOAD: \"Download\",\n        SHARE: \"Share\",\n        ZOOM: \"Zoom\"\n      },\n      de: {\n        CLOSE: \"Schlie&szlig;en\",\n        NEXT: \"Weiter\",\n        PREV: \"Zur&uuml;ck\",\n        ERROR: \"Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es sp&auml;ter nochmal.\",\n        PLAY_START: \"Diaschau starten\",\n        PLAY_STOP: \"Diaschau beenden\",\n        FULL_SCREEN: \"Vollbild\",\n        THUMBS: \"Vorschaubilder\",\n        DOWNLOAD: \"Herunterladen\",\n        SHARE: \"Teilen\",\n        ZOOM: \"Vergr&ouml;&szlig;ern\"\n      }\n    }\n  };\n\n  // Few useful variables and methods\n  // ================================\n\n  var $W = $(window);\n  var $D = $(document);\n\n  var called = 0;\n\n  // Check if an object is a jQuery object and not a native JavaScript object\n  // ========================================================================\n  var isQuery = function (obj) {\n    return obj && obj.hasOwnProperty && obj instanceof $;\n  };\n\n  // Handle multiple browsers for \"requestAnimationFrame\" and \"cancelAnimationFrame\"\n  // ===============================================================================\n  var requestAFrame = (function () {\n    return (\n      window.requestAnimationFrame ||\n      window.webkitRequestAnimationFrame ||\n      window.mozRequestAnimationFrame ||\n      window.oRequestAnimationFrame ||\n      // if all else fails, use setTimeout\n      function (callback) {\n        return window.setTimeout(callback, 1000 / 60);\n      }\n    );\n  })();\n\n  var cancelAFrame = (function () {\n    return (\n      window.cancelAnimationFrame ||\n      window.webkitCancelAnimationFrame ||\n      window.mozCancelAnimationFrame ||\n      window.oCancelAnimationFrame ||\n      function (id) {\n        window.clearTimeout(id);\n      }\n    );\n  })();\n\n  // Detect the supported transition-end event property name\n  // =======================================================\n  var transitionEnd = (function () {\n    var el = document.createElement(\"fakeelement\"),\n      t;\n\n    var transitions = {\n      transition: \"transitionend\",\n      OTransition: \"oTransitionEnd\",\n      MozTransition: \"transitionend\",\n      WebkitTransition: \"webkitTransitionEnd\"\n    };\n\n    for (t in transitions) {\n      if (el.style[t] !== undefined) {\n        return transitions[t];\n      }\n    }\n\n    return \"transitionend\";\n  })();\n\n  // Force redraw on an element.\n  // This helps in cases where the browser doesn't redraw an updated element properly\n  // ================================================================================\n  var forceRedraw = function ($el) {\n    return $el && $el.length && $el[0].offsetHeight;\n  };\n\n  // Exclude array (`buttons`) options from deep merging\n  // ===================================================\n  var mergeOpts = function (opts1, opts2) {\n    var rez = $.extend(true, {}, opts1, opts2);\n\n    $.each(opts2, function (key, value) {\n      if ($.isArray(value)) {\n        rez[key] = value;\n      }\n    });\n\n    return rez;\n  };\n\n  // How much of an element is visible in viewport\n  // =============================================\n\n  var inViewport = function (elem) {\n    var elemCenter, rez;\n\n    if (!elem || elem.ownerDocument !== document) {\n      return false;\n    }\n\n    $(\".fancybox-container\").css(\"pointer-events\", \"none\");\n\n    elemCenter = {\n      x: elem.getBoundingClientRect().left + elem.offsetWidth / 2,\n      y: elem.getBoundingClientRect().top + elem.offsetHeight / 2\n    };\n\n    rez = document.elementFromPoint(elemCenter.x, elemCenter.y) === elem;\n\n    $(\".fancybox-container\").css(\"pointer-events\", \"\");\n\n    return rez;\n  };\n\n  // Class definition\n  // ================\n\n  var FancyBox = function (content, opts, index) {\n    var self = this;\n\n    self.opts = mergeOpts({\n      index: index\n    }, $.fancybox.defaults);\n\n    if ($.isPlainObject(opts)) {\n      self.opts = mergeOpts(self.opts, opts);\n    }\n\n    if ($.fancybox.isMobile) {\n      self.opts = mergeOpts(self.opts, self.opts.mobile);\n    }\n\n    self.id = self.opts.id || ++called;\n\n    self.currIndex = parseInt(self.opts.index, 10) || 0;\n    self.prevIndex = null;\n\n    self.prevPos = null;\n    self.currPos = 0;\n\n    self.firstRun = true;\n\n    // All group items\n    self.group = [];\n\n    // Existing slides (for current, next and previous gallery items)\n    self.slides = {};\n\n    // Create group elements\n    self.addContent(content);\n\n    if (!self.group.length) {\n      return;\n    }\n\n    self.init();\n  };\n\n  $.extend(FancyBox.prototype, {\n    // Create DOM structure\n    // ====================\n\n    init: function () {\n      var self = this,\n        firstItem = self.group[self.currIndex],\n        firstItemOpts = firstItem.opts,\n        $container,\n        buttonStr;\n\n      if (firstItemOpts.closeExisting) {\n        $.fancybox.close(true);\n      }\n\n      // Hide scrollbars\n      // ===============\n\n      $(\"body\").addClass(\"fancybox-active\");\n\n      if (\n        !$.fancybox.getInstance() &&\n        firstItemOpts.hideScrollbar !== false &&\n        !$.fancybox.isMobile &&\n        document.body.scrollHeight > window.innerHeight\n      ) {\n        $(\"head\").append(\n          '<style id=\"fancybox-style-noscroll\" type=\"text/css\">.compensate-for-scrollbar{margin-right:' +\n          (window.innerWidth - document.documentElement.clientWidth) +\n          \"px;}</style>\"\n        );\n\n        $(\"body\").addClass(\"compensate-for-scrollbar\");\n      }\n\n      // Build html markup and set references\n      // ====================================\n\n      // Build html code for buttons and insert into main template\n      buttonStr = \"\";\n\n      $.each(firstItemOpts.buttons, function (index, value) {\n        buttonStr += firstItemOpts.btnTpl[value] || \"\";\n      });\n\n      // Create markup from base template, it will be initially hidden to\n      // avoid unnecessary work like painting while initializing is not complete\n      $container = $(\n          self.translate(\n            self,\n            firstItemOpts.baseTpl\n            .replace(\"{{buttons}}\", buttonStr)\n            .replace(\"{{arrows}}\", firstItemOpts.btnTpl.arrowLeft + firstItemOpts.btnTpl.arrowRight)\n          )\n        )\n        .attr(\"id\", \"fancybox-container-\" + self.id)\n        .addClass(firstItemOpts.baseClass)\n        .data(\"FancyBox\", self)\n        .appendTo(firstItemOpts.parentEl);\n\n      // Create object holding references to jQuery wrapped nodes\n      self.$refs = {\n        container: $container\n      };\n\n      [\"bg\", \"inner\", \"infobar\", \"toolbar\", \"stage\", \"caption\", \"navigation\"].forEach(function (item) {\n        self.$refs[item] = $container.find(\".fancybox-\" + item);\n      });\n\n      self.trigger(\"onInit\");\n\n      // Enable events, deactive previous instances\n      self.activate();\n\n      // Build slides, load and reveal content\n      self.jumpTo(self.currIndex);\n    },\n\n    // Simple i18n support - replaces object keys found in template\n    // with corresponding values\n    // ============================================================\n\n    translate: function (obj, str) {\n      var arr = obj.opts.i18n[obj.opts.lang] || obj.opts.i18n.en;\n\n      return str.replace(/\\{\\{(\\w+)\\}\\}/g, function (match, n) {\n        return arr[n] === undefined ? match : arr[n];\n      });\n    },\n\n    // Populate current group with fresh content\n    // Check if each object has valid type and content\n    // ===============================================\n\n    addContent: function (content) {\n      var self = this,\n        items = $.makeArray(content),\n        thumbs;\n\n      $.each(items, function (i, item) {\n        var obj = {},\n          opts = {},\n          $item,\n          type,\n          found,\n          src,\n          srcParts;\n\n        // Step 1 - Make sure we have an object\n        // ====================================\n\n        if ($.isPlainObject(item)) {\n          // We probably have manual usage here, something like\n          // $.fancybox.open( [ { src : \"image.jpg\", type : \"image\" } ] )\n\n          obj = item;\n          opts = item.opts || item;\n        } else if ($.type(item) === \"object\" && $(item).length) {\n          // Here we probably have jQuery collection returned by some selector\n          $item = $(item);\n\n          // Support attributes like `data-options='{\"touch\" : false}'` and `data-touch='false'`\n          opts = $item.data() || {};\n          opts = $.extend(true, {}, opts, opts.options);\n\n          // Here we store clicked element\n          opts.$orig = $item;\n\n          obj.src = self.opts.src || opts.src || $item.attr(\"href\");\n\n          // Assume that simple syntax is used, for example:\n          //   `$.fancybox.open( $(\"#test\"), {} );`\n          if (!obj.type && !obj.src) {\n            obj.type = \"inline\";\n            obj.src = item;\n          }\n        } else {\n          // Assume we have a simple html code, for example:\n          //   $.fancybox.open( '<div><h1>Hi!</h1></div>' );\n          obj = {\n            type: \"html\",\n            src: item + \"\"\n          };\n        }\n\n        // Each gallery object has full collection of options\n        obj.opts = $.extend(true, {}, self.opts, opts);\n\n        // Do not merge buttons array\n        if ($.isArray(opts.buttons)) {\n          obj.opts.buttons = opts.buttons;\n        }\n\n        if ($.fancybox.isMobile && obj.opts.mobile) {\n          obj.opts = mergeOpts(obj.opts, obj.opts.mobile);\n        }\n\n        // Step 2 - Make sure we have content type, if not - try to guess\n        // ==============================================================\n\n        type = obj.type || obj.opts.type;\n        src = obj.src || \"\";\n\n        if (!type && src) {\n          if ((found = src.match(/\\.(mp4|mov|ogv|webm)((\\?|#).*)?$/i))) {\n            type = \"video\";\n\n            if (!obj.opts.video.format) {\n              obj.opts.video.format = \"video/\" + (found[1] === \"ogv\" ? \"ogg\" : found[1]);\n            }\n          } else if (src.match(/(^data:image\\/[a-z0-9+\\/=]*,)|(\\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\\?|#).*)?$)/i)) {\n            type = \"image\";\n          } else if (src.match(/\\.(pdf)((\\?|#).*)?$/i)) {\n            type = \"iframe\";\n            obj = $.extend(true, obj, {\n              contentType: \"pdf\",\n              opts: {\n                iframe: {\n                  preload: false\n                }\n              }\n            });\n          } else if (src.charAt(0) === \"#\") {\n            type = \"inline\";\n          }\n        }\n\n        if (type) {\n          obj.type = type;\n        } else {\n          self.trigger(\"objectNeedsType\", obj);\n        }\n\n        if (!obj.contentType) {\n          obj.contentType = $.inArray(obj.type, [\"html\", \"inline\", \"ajax\"]) > -1 ? \"html\" : obj.type;\n        }\n\n        // Step 3 - Some adjustments\n        // =========================\n\n        obj.index = self.group.length;\n\n        if (obj.opts.smallBtn == \"auto\") {\n          obj.opts.smallBtn = $.inArray(obj.type, [\"html\", \"inline\", \"ajax\"]) > -1;\n        }\n\n        if (obj.opts.toolbar === \"auto\") {\n          obj.opts.toolbar = !obj.opts.smallBtn;\n        }\n\n        // Find thumbnail image, check if exists and if is in the viewport\n        obj.$thumb = obj.opts.$thumb || null;\n\n        if (obj.opts.$trigger && obj.index === self.opts.index) {\n          obj.$thumb = obj.opts.$trigger.find(\"img:first\");\n\n          if (obj.$thumb.length) {\n            obj.opts.$orig = obj.opts.$trigger;\n          }\n        }\n\n        if (!(obj.$thumb && obj.$thumb.length) && obj.opts.$orig) {\n          obj.$thumb = obj.opts.$orig.find(\"img:first\");\n        }\n\n        if (obj.$thumb && !obj.$thumb.length) {\n          obj.$thumb = null;\n        }\n\n        obj.thumb = obj.opts.thumb || (obj.$thumb ? obj.$thumb[0].src : null);\n\n        // \"caption\" is a \"special\" option, it can be used to customize caption per gallery item\n        if ($.type(obj.opts.caption) === \"function\") {\n          obj.opts.caption = obj.opts.caption.apply(item, [self, obj]);\n        }\n\n        if ($.type(self.opts.caption) === \"function\") {\n          obj.opts.caption = self.opts.caption.apply(item, [self, obj]);\n        }\n\n        // Make sure we have caption as a string or jQuery object\n        if (!(obj.opts.caption instanceof $)) {\n          obj.opts.caption = obj.opts.caption === undefined ? \"\" : obj.opts.caption + \"\";\n        }\n\n        // Check if url contains \"filter\" used to filter the content\n        // Example: \"ajax.html #something\"\n        if (obj.type === \"ajax\") {\n          srcParts = src.split(/\\s+/, 2);\n\n          if (srcParts.length > 1) {\n            obj.src = srcParts.shift();\n\n            obj.opts.filter = srcParts.shift();\n          }\n        }\n\n        // Hide all buttons and disable interactivity for modal items\n        if (obj.opts.modal) {\n          obj.opts = $.extend(true, obj.opts, {\n            trapFocus: true,\n            // Remove buttons\n            infobar: 0,\n            toolbar: 0,\n\n            smallBtn: 0,\n\n            // Disable keyboard navigation\n            keyboard: 0,\n\n            // Disable some modules\n            slideShow: 0,\n            fullScreen: 0,\n            thumbs: 0,\n            touch: 0,\n\n            // Disable click event handlers\n            clickContent: false,\n            clickSlide: false,\n            clickOutside: false,\n            dblclickContent: false,\n            dblclickSlide: false,\n            dblclickOutside: false\n          });\n        }\n\n        // Step 4 - Add processed object to group\n        // ======================================\n\n        self.group.push(obj);\n      });\n\n      // Update controls if gallery is already opened\n      if (Object.keys(self.slides).length) {\n        self.updateControls();\n\n        // Update thumbnails, if needed\n        thumbs = self.Thumbs;\n\n        if (thumbs && thumbs.isActive) {\n          thumbs.create();\n\n          thumbs.focus();\n        }\n      }\n    },\n\n    // Attach an event handler functions for:\n    //   - navigation buttons\n    //   - browser scrolling, resizing;\n    //   - focusing\n    //   - keyboard\n    //   - detecting inactivity\n    // ======================================\n\n    addEvents: function () {\n      var self = this;\n\n      self.removeEvents();\n\n      // Make navigation elements clickable\n      // ==================================\n\n      self.$refs.container\n        .on(\"click.fb-close\", \"[data-fancybox-close]\", function (e) {\n          e.stopPropagation();\n          e.preventDefault();\n\n          self.close(e);\n        })\n        .on(\"touchstart.fb-prev click.fb-prev\", \"[data-fancybox-prev]\", function (e) {\n          e.stopPropagation();\n          e.preventDefault();\n\n          self.previous();\n        })\n        .on(\"touchstart.fb-next click.fb-next\", \"[data-fancybox-next]\", function (e) {\n          e.stopPropagation();\n          e.preventDefault();\n\n          self.next();\n        })\n        .on(\"click.fb\", \"[data-fancybox-zoom]\", function (e) {\n          // Click handler for zoom button\n          self[self.isScaledDown() ? \"scaleToActual\" : \"scaleToFit\"]();\n        });\n\n      // Handle page scrolling and browser resizing\n      // ==========================================\n\n      $W.on(\"orientationchange.fb resize.fb\", function (e) {\n        if (e && e.originalEvent && e.originalEvent.type === \"resize\") {\n          if (self.requestId) {\n            cancelAFrame(self.requestId);\n          }\n\n          self.requestId = requestAFrame(function () {\n            self.update(e);\n          });\n        } else {\n          if (self.current && self.current.type === \"iframe\") {\n            self.$refs.stage.hide();\n          }\n\n          setTimeout(\n            function () {\n              self.$refs.stage.show();\n\n              self.update(e);\n            },\n            $.fancybox.isMobile ? 600 : 250\n          );\n        }\n      });\n\n      $D.on(\"keydown.fb\", function (e) {\n        var instance = $.fancybox ? $.fancybox.getInstance() : null,\n          current = instance.current,\n          keycode = e.keyCode || e.which;\n\n        // Trap keyboard focus inside of the modal\n        // =======================================\n\n        if (keycode == 9) {\n          if (current.opts.trapFocus) {\n            self.focus(e);\n          }\n\n          return;\n        }\n\n        // Enable keyboard navigation\n        // ==========================\n\n        if (!current.opts.keyboard || e.ctrlKey || e.altKey || e.shiftKey || $(e.target).is(\"input,textarea,video,audio,select\")) {\n          return;\n        }\n\n        // Backspace and Esc keys\n        if (keycode === 8 || keycode === 27) {\n          e.preventDefault();\n\n          self.close(e);\n\n          return;\n        }\n\n        // Left arrow and Up arrow\n        if (keycode === 37 || keycode === 38) {\n          e.preventDefault();\n\n          self.previous();\n\n          return;\n        }\n\n        // Righ arrow and Down arrow\n        if (keycode === 39 || keycode === 40) {\n          e.preventDefault();\n\n          self.next();\n\n          return;\n        }\n\n        self.trigger(\"afterKeydown\", e, keycode);\n      });\n\n      // Hide controls after some inactivity period\n      if (self.group[self.currIndex].opts.idleTime) {\n        self.idleSecondsCounter = 0;\n\n        $D.on(\n          \"mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle\",\n          function (e) {\n            self.idleSecondsCounter = 0;\n\n            if (self.isIdle) {\n              self.showControls();\n            }\n\n            self.isIdle = false;\n          }\n        );\n\n        self.idleInterval = window.setInterval(function () {\n          self.idleSecondsCounter++;\n\n          if (self.idleSecondsCounter >= self.group[self.currIndex].opts.idleTime && !self.isDragging) {\n            self.isIdle = true;\n            self.idleSecondsCounter = 0;\n\n            self.hideControls();\n          }\n        }, 1000);\n      }\n    },\n\n    // Remove events added by the core\n    // ===============================\n\n    removeEvents: function () {\n      var self = this;\n\n      $W.off(\"orientationchange.fb resize.fb\");\n      $D.off(\"keydown.fb .fb-idle\");\n\n      this.$refs.container.off(\".fb-close .fb-prev .fb-next\");\n\n      if (self.idleInterval) {\n        window.clearInterval(self.idleInterval);\n\n        self.idleInterval = null;\n      }\n    },\n\n    // Change to previous gallery item\n    // ===============================\n\n    previous: function (duration) {\n      return this.jumpTo(this.currPos - 1, duration);\n    },\n\n    // Change to next gallery item\n    // ===========================\n\n    next: function (duration) {\n      return this.jumpTo(this.currPos + 1, duration);\n    },\n\n    // Switch to selected gallery item\n    // ===============================\n\n    jumpTo: function (pos, duration) {\n      var self = this,\n        groupLen = self.group.length,\n        firstRun,\n        isMoved,\n        loop,\n        current,\n        previous,\n        slidePos,\n        stagePos,\n        prop,\n        diff;\n\n      if (self.isDragging || self.isClosing || (self.isAnimating && self.firstRun)) {\n        return;\n      }\n\n      // Should loop?\n      pos = parseInt(pos, 10);\n      loop = self.current ? self.current.opts.loop : self.opts.loop;\n\n      if (!loop && (pos < 0 || pos >= groupLen)) {\n        return false;\n      }\n\n      // Check if opening for the first time; this helps to speed things up\n      firstRun = self.firstRun = !Object.keys(self.slides).length;\n\n      // Create slides\n      previous = self.current;\n\n      self.prevIndex = self.currIndex;\n      self.prevPos = self.currPos;\n\n      current = self.createSlide(pos);\n\n      if (groupLen > 1) {\n        if (loop || current.index < groupLen - 1) {\n          self.createSlide(pos + 1);\n        }\n\n        if (loop || current.index > 0) {\n          self.createSlide(pos - 1);\n        }\n      }\n\n      self.current = current;\n      self.currIndex = current.index;\n      self.currPos = current.pos;\n\n      self.trigger(\"beforeShow\", firstRun);\n\n      self.updateControls();\n\n      // Validate duration length\n      current.forcedDuration = undefined;\n\n      if ($.isNumeric(duration)) {\n        current.forcedDuration = duration;\n      } else {\n        duration = current.opts[firstRun ? \"animationDuration\" : \"transitionDuration\"];\n      }\n\n      duration = parseInt(duration, 10);\n\n      // Check if user has swiped the slides or if still animating\n      isMoved = self.isMoved(current);\n\n      // Make sure current slide is visible\n      current.$slide.addClass(\"fancybox-slide--current\");\n\n      // Fresh start - reveal container, current slide and start loading content\n      if (firstRun) {\n        if (current.opts.animationEffect && duration) {\n          self.$refs.container.css(\"transition-duration\", duration + \"ms\");\n        }\n\n        self.$refs.container.addClass(\"fancybox-is-open\").trigger(\"focus\");\n\n        // Attempt to load content into slide\n        // This will later call `afterLoad` -> `revealContent`\n        self.loadSlide(current);\n\n        self.preload(\"image\");\n\n        return;\n      }\n\n      // Get actual slide/stage positions (before cleaning up)\n      slidePos = $.fancybox.getTranslate(previous.$slide);\n      stagePos = $.fancybox.getTranslate(self.$refs.stage);\n\n      // Clean up all slides\n      $.each(self.slides, function (index, slide) {\n        $.fancybox.stop(slide.$slide, true);\n      });\n\n      if (previous.pos !== current.pos) {\n        previous.isComplete = false;\n      }\n\n      previous.$slide.removeClass(\"fancybox-slide--complete fancybox-slide--current\");\n\n      // If slides are out of place, then animate them to correct position\n      if (isMoved) {\n        // Calculate horizontal swipe distance\n        diff = slidePos.left - (previous.pos * slidePos.width + previous.pos * previous.opts.gutter);\n\n        $.each(self.slides, function (index, slide) {\n          slide.$slide.removeClass(\"fancybox-animated\").removeClass(function (index, className) {\n            return (className.match(/(^|\\s)fancybox-fx-\\S+/g) || []).join(\" \");\n          });\n\n          // Make sure that each slide is in equal distance\n          // This is mostly needed for freshly added slides, because they are not yet positioned\n          var leftPos = slide.pos * slidePos.width + slide.pos * slide.opts.gutter;\n\n          $.fancybox.setTranslate(slide.$slide, {\n            top: 0,\n            left: leftPos - stagePos.left + diff\n          });\n\n          if (slide.pos !== current.pos) {\n            slide.$slide.addClass(\"fancybox-slide--\" + (slide.pos > current.pos ? \"next\" : \"previous\"));\n          }\n\n          // Redraw to make sure that transition will start\n          forceRedraw(slide.$slide);\n\n          // Animate the slide\n          $.fancybox.animate(\n            slide.$slide, {\n              top: 0,\n              left: (slide.pos - current.pos) * slidePos.width + (slide.pos - current.pos) * slide.opts.gutter\n            },\n            duration,\n            function () {\n              slide.$slide\n                .css({\n                  transform: \"\",\n                  opacity: \"\"\n                })\n                .removeClass(\"fancybox-slide--next fancybox-slide--previous\");\n\n              if (slide.pos === self.currPos) {\n                self.complete();\n              }\n            }\n          );\n        });\n      } else if (duration && current.opts.transitionEffect) {\n        // Set transition effect for previously active slide\n        prop = \"fancybox-animated fancybox-fx-\" + current.opts.transitionEffect;\n\n        previous.$slide.addClass(\"fancybox-slide--\" + (previous.pos > current.pos ? \"next\" : \"previous\"));\n\n        $.fancybox.animate(\n          previous.$slide,\n          prop,\n          duration,\n          function () {\n            previous.$slide.removeClass(prop).removeClass(\"fancybox-slide--next fancybox-slide--previous\");\n          },\n          false\n        );\n      }\n\n      if (current.isLoaded) {\n        self.revealContent(current);\n      } else {\n        self.loadSlide(current);\n      }\n\n      self.preload(\"image\");\n    },\n\n    // Create new \"slide\" element\n    // These are gallery items  that are actually added to DOM\n    // =======================================================\n\n    createSlide: function (pos) {\n      var self = this,\n        $slide,\n        index;\n\n      index = pos % self.group.length;\n      index = index < 0 ? self.group.length + index : index;\n\n      if (!self.slides[pos] && self.group[index]) {\n        $slide = $('<div class=\"fancybox-slide\"></div>').appendTo(self.$refs.stage);\n\n        self.slides[pos] = $.extend(true, {}, self.group[index], {\n          pos: pos,\n          $slide: $slide,\n          isLoaded: false\n        });\n\n        self.updateSlide(self.slides[pos]);\n      }\n\n      return self.slides[pos];\n    },\n\n    // Scale image to the actual size of the image;\n    // x and y values should be relative to the slide\n    // ==============================================\n\n    scaleToActual: function (x, y, duration) {\n      var self = this,\n        current = self.current,\n        $content = current.$content,\n        canvasWidth = $.fancybox.getTranslate(current.$slide).width,\n        canvasHeight = $.fancybox.getTranslate(current.$slide).height,\n        newImgWidth = current.width,\n        newImgHeight = current.height,\n        imgPos,\n        posX,\n        posY,\n        scaleX,\n        scaleY;\n\n      if (self.isAnimating || self.isMoved() || !$content || !(current.type == \"image\" && current.isLoaded && !current.hasError)) {\n        return;\n      }\n\n      self.isAnimating = true;\n\n      $.fancybox.stop($content);\n\n      x = x === undefined ? canvasWidth * 0.5 : x;\n      y = y === undefined ? canvasHeight * 0.5 : y;\n\n      imgPos = $.fancybox.getTranslate($content);\n\n      imgPos.top -= $.fancybox.getTranslate(current.$slide).top;\n      imgPos.left -= $.fancybox.getTranslate(current.$slide).left;\n\n      scaleX = newImgWidth / imgPos.width;\n      scaleY = newImgHeight / imgPos.height;\n\n      // Get center position for original image\n      posX = canvasWidth * 0.5 - newImgWidth * 0.5;\n      posY = canvasHeight * 0.5 - newImgHeight * 0.5;\n\n      // Make sure image does not move away from edges\n      if (newImgWidth > canvasWidth) {\n        posX = imgPos.left * scaleX - (x * scaleX - x);\n\n        if (posX > 0) {\n          posX = 0;\n        }\n\n        if (posX < canvasWidth - newImgWidth) {\n          posX = canvasWidth - newImgWidth;\n        }\n      }\n\n      if (newImgHeight > canvasHeight) {\n        posY = imgPos.top * scaleY - (y * scaleY - y);\n\n        if (posY > 0) {\n          posY = 0;\n        }\n\n        if (posY < canvasHeight - newImgHeight) {\n          posY = canvasHeight - newImgHeight;\n        }\n      }\n\n      self.updateCursor(newImgWidth, newImgHeight);\n\n      $.fancybox.animate(\n        $content, {\n          top: posY,\n          left: posX,\n          scaleX: scaleX,\n          scaleY: scaleY\n        },\n        duration || 366,\n        function () {\n          self.isAnimating = false;\n        }\n      );\n\n      // Stop slideshow\n      if (self.SlideShow && self.SlideShow.isActive) {\n        self.SlideShow.stop();\n      }\n    },\n\n    // Scale image to fit inside parent element\n    // ========================================\n\n    scaleToFit: function (duration) {\n      var self = this,\n        current = self.current,\n        $content = current.$content,\n        end;\n\n      if (self.isAnimating || self.isMoved() || !$content || !(current.type == \"image\" && current.isLoaded && !current.hasError)) {\n        return;\n      }\n\n      self.isAnimating = true;\n\n      $.fancybox.stop($content);\n\n      end = self.getFitPos(current);\n\n      self.updateCursor(end.width, end.height);\n\n      $.fancybox.animate(\n        $content, {\n          top: end.top,\n          left: end.left,\n          scaleX: end.width / $content.width(),\n          scaleY: end.height / $content.height()\n        },\n        duration || 366,\n        function () {\n          self.isAnimating = false;\n        }\n      );\n    },\n\n    // Calculate image size to fit inside viewport\n    // ===========================================\n\n    getFitPos: function (slide) {\n      var self = this,\n        $content = slide.$content,\n        $slide = slide.$slide,\n        width = slide.width || slide.opts.width,\n        height = slide.height || slide.opts.height,\n        maxWidth,\n        maxHeight,\n        minRatio,\n        aspectRatio,\n        rez = {};\n\n      if (!slide.isLoaded || !$content || !$content.length) {\n        return false;\n      }\n\n      maxWidth = $.fancybox.getTranslate(self.$refs.stage).width;\n      maxHeight = $.fancybox.getTranslate(self.$refs.stage).height;\n\n      maxWidth -=\n        parseFloat($slide.css(\"paddingLeft\")) +\n        parseFloat($slide.css(\"paddingRight\")) +\n        parseFloat($content.css(\"marginLeft\")) +\n        parseFloat($content.css(\"marginRight\"));\n\n      maxHeight -=\n        parseFloat($slide.css(\"paddingTop\")) +\n        parseFloat($slide.css(\"paddingBottom\")) +\n        parseFloat($content.css(\"marginTop\")) +\n        parseFloat($content.css(\"marginBottom\"));\n\n      if (!width || !height) {\n        width = maxWidth;\n        height = maxHeight;\n      }\n\n      minRatio = Math.min(1, maxWidth / width, maxHeight / height);\n\n      width = minRatio * width;\n      height = minRatio * height;\n\n      // Adjust width/height to precisely fit into container\n      if (width > maxWidth - 0.5) {\n        width = maxWidth;\n      }\n\n      if (height > maxHeight - 0.5) {\n        height = maxHeight;\n      }\n\n      if (slide.type === \"image\") {\n        rez.top = Math.floor((maxHeight - height) * 0.5) + parseFloat($slide.css(\"paddingTop\"));\n        rez.left = Math.floor((maxWidth - width) * 0.5) + parseFloat($slide.css(\"paddingLeft\"));\n      } else if (slide.contentType === \"video\") {\n        // Force aspect ratio for the video\n        // \"I say the whole world must learn of our peaceful ways… by force!\"\n        aspectRatio = slide.opts.width && slide.opts.height ? width / height : slide.opts.ratio || 16 / 9;\n\n        if (height > width / aspectRatio) {\n          height = width / aspectRatio;\n        } else if (width > height * aspectRatio) {\n          width = height * aspectRatio;\n        }\n      }\n\n      rez.width = width;\n      rez.height = height;\n\n      return rez;\n    },\n\n    // Update content size and position for all slides\n    // ==============================================\n\n    update: function (e) {\n      var self = this;\n\n      $.each(self.slides, function (key, slide) {\n        self.updateSlide(slide, e);\n      });\n    },\n\n    // Update slide content position and size\n    // ======================================\n\n    updateSlide: function (slide, e) {\n      var self = this,\n        $content = slide && slide.$content,\n        width = slide.width || slide.opts.width,\n        height = slide.height || slide.opts.height,\n        $slide = slide.$slide;\n\n      // First, prevent caption overlap, if needed\n      self.adjustCaption(slide);\n\n      // Then resize content to fit inside the slide\n      if ($content && (width || height || slide.contentType === \"video\") && !slide.hasError) {\n        $.fancybox.stop($content);\n\n        $.fancybox.setTranslate($content, self.getFitPos(slide));\n\n        if (slide.pos === self.currPos) {\n          self.isAnimating = false;\n\n          self.updateCursor();\n        }\n      }\n\n      // Then some adjustments\n      self.adjustLayout(slide);\n\n      if ($slide.length) {\n        $slide.trigger(\"refresh\");\n\n        if (slide.pos === self.currPos) {\n          self.$refs.toolbar\n            .add(self.$refs.navigation.find(\".fancybox-button--arrow_right\"))\n            .toggleClass(\"compensate-for-scrollbar\", $slide.get(0).scrollHeight > $slide.get(0).clientHeight);\n        }\n      }\n\n      self.trigger(\"onUpdate\", slide, e);\n    },\n\n    // Horizontally center slide\n    // =========================\n\n    centerSlide: function (duration) {\n      var self = this,\n        current = self.current,\n        $slide = current.$slide;\n\n      if (self.isClosing || !current) {\n        return;\n      }\n\n      $slide.siblings().css({\n        transform: \"\",\n        opacity: \"\"\n      });\n\n      $slide\n        .parent()\n        .children()\n        .removeClass(\"fancybox-slide--previous fancybox-slide--next\");\n\n      $.fancybox.animate(\n        $slide, {\n          top: 0,\n          left: 0,\n          opacity: 1\n        },\n        duration === undefined ? 0 : duration,\n        function () {\n          // Clean up\n          $slide.css({\n            transform: \"\",\n            opacity: \"\"\n          });\n\n          if (!current.isComplete) {\n            self.complete();\n          }\n        },\n        false\n      );\n    },\n\n    // Check if current slide is moved (swiped)\n    // ========================================\n\n    isMoved: function (slide) {\n      var current = slide || this.current,\n        slidePos,\n        stagePos;\n\n      if (!current) {\n        return false;\n      }\n\n      stagePos = $.fancybox.getTranslate(this.$refs.stage);\n      slidePos = $.fancybox.getTranslate(current.$slide);\n\n      return (\n        !current.$slide.hasClass(\"fancybox-animated\") &&\n        (Math.abs(slidePos.top - stagePos.top) > 0.5 || Math.abs(slidePos.left - stagePos.left) > 0.5)\n      );\n    },\n\n    // Update cursor style depending if content can be zoomed\n    // ======================================================\n\n    updateCursor: function (nextWidth, nextHeight) {\n      var self = this,\n        current = self.current,\n        $container = self.$refs.container,\n        canPan,\n        isZoomable;\n\n      if (!current || self.isClosing || !self.Guestures) {\n        return;\n      }\n\n      $container.removeClass(\"fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan\");\n\n      canPan = self.canPan(nextWidth, nextHeight);\n\n      isZoomable = canPan ? true : self.isZoomable();\n\n      $container.toggleClass(\"fancybox-is-zoomable\", isZoomable);\n\n      $(\"[data-fancybox-zoom]\").prop(\"disabled\", !isZoomable);\n\n      if (canPan) {\n        $container.addClass(\"fancybox-can-pan\");\n      } else if (\n        isZoomable &&\n        (current.opts.clickContent === \"zoom\" || ($.isFunction(current.opts.clickContent) && current.opts.clickContent(current) == \"zoom\"))\n      ) {\n        $container.addClass(\"fancybox-can-zoomIn\");\n      } else if (current.opts.touch && (current.opts.touch.vertical || self.group.length > 1) && current.contentType !== \"video\") {\n        $container.addClass(\"fancybox-can-swipe\");\n      }\n    },\n\n    // Check if current slide is zoomable\n    // ==================================\n\n    isZoomable: function () {\n      var self = this,\n        current = self.current,\n        fitPos;\n\n      // Assume that slide is zoomable if:\n      //   - image is still loading\n      //   - actual size of the image is smaller than available area\n      if (current && !self.isClosing && current.type === \"image\" && !current.hasError) {\n        if (!current.isLoaded) {\n          return true;\n        }\n\n        fitPos = self.getFitPos(current);\n\n        if (fitPos && (current.width > fitPos.width || current.height > fitPos.height)) {\n          return true;\n        }\n      }\n\n      return false;\n    },\n\n    // Check if current image dimensions are smaller than actual\n    // =========================================================\n\n    isScaledDown: function (nextWidth, nextHeight) {\n      var self = this,\n        rez = false,\n        current = self.current,\n        $content = current.$content;\n\n      if (nextWidth !== undefined && nextHeight !== undefined) {\n        rez = nextWidth < current.width && nextHeight < current.height;\n      } else if ($content) {\n        rez = $.fancybox.getTranslate($content);\n        rez = rez.width < current.width && rez.height < current.height;\n      }\n\n      return rez;\n    },\n\n    // Check if image dimensions exceed parent element\n    // ===============================================\n\n    canPan: function (nextWidth, nextHeight) {\n      var self = this,\n        current = self.current,\n        pos = null,\n        rez = false;\n\n      if (current.type === \"image\" && (current.isComplete || (nextWidth && nextHeight)) && !current.hasError) {\n        rez = self.getFitPos(current);\n\n        if (nextWidth !== undefined && nextHeight !== undefined) {\n          pos = {\n            width: nextWidth,\n            height: nextHeight\n          };\n        } else if (current.isComplete) {\n          pos = $.fancybox.getTranslate(current.$content);\n        }\n\n        if (pos && rez) {\n          rez = Math.abs(pos.width - rez.width) > 1.5 || Math.abs(pos.height - rez.height) > 1.5;\n        }\n      }\n\n      return rez;\n    },\n\n    // Load content into the slide\n    // ===========================\n\n    loadSlide: function (slide) {\n      var self = this,\n        type,\n        $slide,\n        ajaxLoad;\n\n      if (slide.isLoading || slide.isLoaded) {\n        return;\n      }\n\n      slide.isLoading = true;\n\n      if (self.trigger(\"beforeLoad\", slide) === false) {\n        slide.isLoading = false;\n\n        return false;\n      }\n\n      type = slide.type;\n      $slide = slide.$slide;\n\n      $slide\n        .off(\"refresh\")\n        .trigger(\"onReset\")\n        .addClass(slide.opts.slideClass);\n\n      // Create content depending on the type\n      switch (type) {\n        case \"image\":\n          self.setImage(slide);\n\n          break;\n\n        case \"iframe\":\n          self.setIframe(slide);\n\n          break;\n\n        case \"html\":\n          self.setContent(slide, slide.src || slide.content);\n\n          break;\n\n        case \"video\":\n          self.setContent(\n            slide,\n            slide.opts.video.tpl\n            .replace(/\\{\\{src\\}\\}/gi, slide.src)\n            .replace(\"{{format}}\", slide.opts.videoFormat || slide.opts.video.format || \"\")\n            .replace(\"{{poster}}\", slide.thumb || \"\")\n          );\n\n          break;\n\n        case \"inline\":\n          if ($(slide.src).length) {\n            self.setContent(slide, $(slide.src));\n          } else {\n            self.setError(slide);\n          }\n\n          break;\n\n        case \"ajax\":\n          self.showLoading(slide);\n\n          ajaxLoad = $.ajax(\n            $.extend({}, slide.opts.ajax.settings, {\n              url: slide.src,\n              success: function (data, textStatus) {\n                if (textStatus === \"success\") {\n                  self.setContent(slide, data);\n                }\n              },\n              error: function (jqXHR, textStatus) {\n                if (jqXHR && textStatus !== \"abort\") {\n                  self.setError(slide);\n                }\n              }\n            })\n          );\n\n          $slide.one(\"onReset\", function () {\n            ajaxLoad.abort();\n          });\n\n          break;\n\n        default:\n          self.setError(slide);\n\n          break;\n      }\n\n      return true;\n    },\n\n    // Use thumbnail image, if possible\n    // ================================\n\n    setImage: function (slide) {\n      var self = this,\n        ghost;\n\n      // Check if need to show loading icon\n      setTimeout(function () {\n        var $img = slide.$image;\n\n        if (!self.isClosing && slide.isLoading && (!$img || !$img.length || !$img[0].complete) && !slide.hasError) {\n          self.showLoading(slide);\n        }\n      }, 50);\n\n      //Check if image has srcset\n      self.checkSrcset(slide);\n\n      // This will be wrapper containing both ghost and actual image\n      slide.$content = $('<div class=\"fancybox-content\"></div>')\n        .addClass(\"fancybox-is-hidden\")\n        .appendTo(slide.$slide.addClass(\"fancybox-slide--image\"));\n\n      // If we have a thumbnail, we can display it while actual image is loading\n      // Users will not stare at black screen and actual image will appear gradually\n      if (slide.opts.preload !== false && slide.opts.width && slide.opts.height && slide.thumb) {\n        slide.width = slide.opts.width;\n        slide.height = slide.opts.height;\n\n        ghost = document.createElement(\"img\");\n\n        ghost.onerror = function () {\n          $(this).remove();\n\n          slide.$ghost = null;\n        };\n\n        ghost.onload = function () {\n          self.afterLoad(slide);\n        };\n\n        slide.$ghost = $(ghost)\n          .addClass(\"fancybox-image\")\n          .appendTo(slide.$content)\n          .attr(\"src\", slide.thumb);\n      }\n\n      // Start loading actual image\n      self.setBigImage(slide);\n    },\n\n    // Check if image has srcset and get the source\n    // ============================================\n    checkSrcset: function (slide) {\n      var srcset = slide.opts.srcset || slide.opts.image.srcset,\n        found,\n        temp,\n        pxRatio,\n        windowWidth;\n\n      // If we have \"srcset\", then we need to find first matching \"src\" value.\n      // This is necessary, because when you set an src attribute, the browser will preload the image\n      // before any javascript or even CSS is applied.\n      if (srcset) {\n        pxRatio = window.devicePixelRatio || 1;\n        windowWidth = window.innerWidth * pxRatio;\n\n        temp = srcset.split(\",\").map(function (el) {\n          var ret = {};\n\n          el.trim()\n            .split(/\\s+/)\n            .forEach(function (el, i) {\n              var value = parseInt(el.substring(0, el.length - 1), 10);\n\n              if (i === 0) {\n                return (ret.url = el);\n              }\n\n              if (value) {\n                ret.value = value;\n                ret.postfix = el[el.length - 1];\n              }\n            });\n\n          return ret;\n        });\n\n        // Sort by value\n        temp.sort(function (a, b) {\n          return a.value - b.value;\n        });\n\n        // Ok, now we have an array of all srcset values\n        for (var j = 0; j < temp.length; j++) {\n          var el = temp[j];\n\n          if ((el.postfix === \"w\" && el.value >= windowWidth) || (el.postfix === \"x\" && el.value >= pxRatio)) {\n            found = el;\n            break;\n          }\n        }\n\n        // If not found, take the last one\n        if (!found && temp.length) {\n          found = temp[temp.length - 1];\n        }\n\n        if (found) {\n          slide.src = found.url;\n\n          // If we have default width/height values, we can calculate height for matching source\n          if (slide.width && slide.height && found.postfix == \"w\") {\n            slide.height = (slide.width / slide.height) * found.value;\n            slide.width = found.value;\n          }\n\n          slide.opts.srcset = srcset;\n        }\n      }\n    },\n\n    // Create full-size image\n    // ======================\n\n    setBigImage: function (slide) {\n      var self = this,\n        img = document.createElement(\"img\"),\n        $img = $(img);\n\n      slide.$image = $img\n        .one(\"error\", function () {\n          self.setError(slide);\n        })\n        .one(\"load\", function () {\n          var sizes;\n\n          if (!slide.$ghost) {\n            self.resolveImageSlideSize(slide, this.naturalWidth, this.naturalHeight);\n\n            self.afterLoad(slide);\n          }\n\n          if (self.isClosing) {\n            return;\n          }\n\n          if (slide.opts.srcset) {\n            sizes = slide.opts.sizes;\n\n            if (!sizes || sizes === \"auto\") {\n              sizes =\n                (slide.width / slide.height > 1 && $W.width() / $W.height() > 1 ? \"100\" : Math.round((slide.width / slide.height) * 100)) +\n                \"vw\";\n            }\n\n            $img.attr(\"sizes\", sizes).attr(\"srcset\", slide.opts.srcset);\n          }\n\n          // Hide temporary image after some delay\n          if (slide.$ghost) {\n            setTimeout(function () {\n              if (slide.$ghost && !self.isClosing) {\n                slide.$ghost.hide();\n              }\n            }, Math.min(300, Math.max(1000, slide.height / 1600)));\n          }\n\n          self.hideLoading(slide);\n        })\n        .addClass(\"fancybox-image\")\n        .attr(\"src\", slide.src)\n        .appendTo(slide.$content);\n\n      if ((img.complete || img.readyState == \"complete\") && $img.naturalWidth && $img.naturalHeight) {\n        $img.trigger(\"load\");\n      } else if (img.error) {\n        $img.trigger(\"error\");\n      }\n    },\n\n    // Computes the slide size from image size and maxWidth/maxHeight\n    // ==============================================================\n\n    resolveImageSlideSize: function (slide, imgWidth, imgHeight) {\n      var maxWidth = parseInt(slide.opts.width, 10),\n        maxHeight = parseInt(slide.opts.height, 10);\n\n      // Sets the default values from the image\n      slide.width = imgWidth;\n      slide.height = imgHeight;\n\n      if (maxWidth > 0) {\n        slide.width = maxWidth;\n        slide.height = Math.floor((maxWidth * imgHeight) / imgWidth);\n      }\n\n      if (maxHeight > 0) {\n        slide.width = Math.floor((maxHeight * imgWidth) / imgHeight);\n        slide.height = maxHeight;\n      }\n    },\n\n    // Create iframe wrapper, iframe and bindings\n    // ==========================================\n\n    setIframe: function (slide) {\n      var self = this,\n        opts = slide.opts.iframe,\n        $slide = slide.$slide,\n        $iframe;\n\n      slide.$content = $('<div class=\"fancybox-content' + (opts.preload ? \" fancybox-is-hidden\" : \"\") + '\"></div>')\n        .css(opts.css)\n        .appendTo($slide);\n\n      $slide.addClass(\"fancybox-slide--\" + slide.contentType);\n\n      slide.$iframe = $iframe = $(opts.tpl.replace(/\\{rnd\\}/g, new Date().getTime()))\n        .attr(opts.attr)\n        .appendTo(slide.$content);\n\n      if (opts.preload) {\n        self.showLoading(slide);\n\n        // Unfortunately, it is not always possible to determine if iframe is successfully loaded\n        // (due to browser security policy)\n\n        $iframe.on(\"load.fb error.fb\", function (e) {\n          this.isReady = 1;\n\n          slide.$slide.trigger(\"refresh\");\n\n          self.afterLoad(slide);\n        });\n\n        // Recalculate iframe content size\n        // ===============================\n\n        $slide.on(\"refresh.fb\", function () {\n          var $content = slide.$content,\n            frameWidth = opts.css.width,\n            frameHeight = opts.css.height,\n            $contents,\n            $body;\n\n          if ($iframe[0].isReady !== 1) {\n            return;\n          }\n\n          try {\n            $contents = $iframe.contents();\n            $body = $contents.find(\"body\");\n          } catch (ignore) {}\n\n          // Calculate content dimensions, if it is accessible\n          if ($body && $body.length && $body.children().length) {\n            // Avoid scrolling to top (if multiple instances)\n            $slide.css(\"overflow\", \"visible\");\n\n            $content.css({\n              width: \"100%\",\n              \"max-width\": \"100%\",\n              height: \"9999px\"\n            });\n\n            if (frameWidth === undefined) {\n              frameWidth = Math.ceil(Math.max($body[0].clientWidth, $body.outerWidth(true)));\n            }\n\n            $content.css(\"width\", frameWidth ? frameWidth : \"\").css(\"max-width\", \"\");\n\n            if (frameHeight === undefined) {\n              frameHeight = Math.ceil(Math.max($body[0].clientHeight, $body.outerHeight(true)));\n            }\n\n            $content.css(\"height\", frameHeight ? frameHeight : \"\");\n\n            $slide.css(\"overflow\", \"auto\");\n          }\n\n          $content.removeClass(\"fancybox-is-hidden\");\n        });\n      } else {\n        self.afterLoad(slide);\n      }\n\n      $iframe.attr(\"src\", slide.src);\n\n      // Remove iframe if closing or changing gallery item\n      $slide.one(\"onReset\", function () {\n        // This helps IE not to throw errors when closing\n        try {\n          $(this)\n            .find(\"iframe\")\n            .hide()\n            .unbind()\n            .attr(\"src\", \"//about:blank\");\n        } catch (ignore) {}\n\n        $(this)\n          .off(\"refresh.fb\")\n          .empty();\n\n        slide.isLoaded = false;\n        slide.isRevealed = false;\n      });\n    },\n\n    // Wrap and append content to the slide\n    // ======================================\n\n    setContent: function (slide, content) {\n      var self = this;\n\n      if (self.isClosing) {\n        return;\n      }\n\n      self.hideLoading(slide);\n\n      if (slide.$content) {\n        $.fancybox.stop(slide.$content);\n      }\n\n      slide.$slide.empty();\n\n      // If content is a jQuery object, then it will be moved to the slide.\n      // The placeholder is created so we will know where to put it back.\n      if (isQuery(content) && content.parent().length) {\n        // Make sure content is not already moved to fancyBox\n        if (content.hasClass(\"fancybox-content\") || content.parent().hasClass(\"fancybox-content\")) {\n          content.parents(\".fancybox-slide\").trigger(\"onReset\");\n        }\n\n        // Create temporary element marking original place of the content\n        slide.$placeholder = $(\"<div>\")\n          .hide()\n          .insertAfter(content);\n\n        // Make sure content is visible\n        content.css(\"display\", \"inline-block\");\n      } else if (!slide.hasError) {\n        // If content is just a plain text, try to convert it to html\n        if ($.type(content) === \"string\") {\n          content = $(\"<div>\")\n            .append($.trim(content))\n            .contents();\n        }\n\n        // If \"filter\" option is provided, then filter content\n        if (slide.opts.filter) {\n          content = $(\"<div>\")\n            .html(content)\n            .find(slide.opts.filter);\n        }\n      }\n\n      slide.$slide.one(\"onReset\", function () {\n        // Pause all html5 video/audio\n        $(this)\n          .find(\"video,audio\")\n          .trigger(\"pause\");\n\n        // Put content back\n        if (slide.$placeholder) {\n          slide.$placeholder.after(content.removeClass(\"fancybox-content\").hide()).remove();\n\n          slide.$placeholder = null;\n        }\n\n        // Remove custom close button\n        if (slide.$smallBtn) {\n          slide.$smallBtn.remove();\n\n          slide.$smallBtn = null;\n        }\n\n        // Remove content and mark slide as not loaded\n        if (!slide.hasError) {\n          $(this).empty();\n\n          slide.isLoaded = false;\n          slide.isRevealed = false;\n        }\n      });\n\n      $(content).appendTo(slide.$slide);\n\n      if ($(content).is(\"video,audio\")) {\n        $(content).addClass(\"fancybox-video\");\n\n        $(content).wrap(\"<div></div>\");\n\n        slide.contentType = \"video\";\n\n        slide.opts.width = slide.opts.width || $(content).attr(\"width\");\n        slide.opts.height = slide.opts.height || $(content).attr(\"height\");\n      }\n\n      slide.$content = slide.$slide\n        .children()\n        .filter(\"div,form,main,video,audio,article,.fancybox-content\")\n        .first();\n\n      slide.$content.siblings().hide();\n\n      // Re-check if there is a valid content\n      // (in some cases, ajax response can contain various elements or plain text)\n      if (!slide.$content.length) {\n        slide.$content = slide.$slide\n          .wrapInner(\"<div></div>\")\n          .children()\n          .first();\n      }\n\n      slide.$content.addClass(\"fancybox-content\");\n\n      slide.$slide.addClass(\"fancybox-slide--\" + slide.contentType);\n\n      self.afterLoad(slide);\n    },\n\n    // Display error message\n    // =====================\n\n    setError: function (slide) {\n      slide.hasError = true;\n\n      slide.$slide\n        .trigger(\"onReset\")\n        .removeClass(\"fancybox-slide--\" + slide.contentType)\n        .addClass(\"fancybox-slide--error\");\n\n      slide.contentType = \"html\";\n\n      this.setContent(slide, this.translate(slide, slide.opts.errorTpl));\n\n      if (slide.pos === this.currPos) {\n        this.isAnimating = false;\n      }\n    },\n\n    // Show loading icon inside the slide\n    // ==================================\n\n    showLoading: function (slide) {\n      var self = this;\n\n      slide = slide || self.current;\n\n      if (slide && !slide.$spinner) {\n        slide.$spinner = $(self.translate(self, self.opts.spinnerTpl))\n          .appendTo(slide.$slide)\n          .hide()\n          .fadeIn(\"fast\");\n      }\n    },\n\n    // Remove loading icon from the slide\n    // ==================================\n\n    hideLoading: function (slide) {\n      var self = this;\n\n      slide = slide || self.current;\n\n      if (slide && slide.$spinner) {\n        slide.$spinner.stop().remove();\n\n        delete slide.$spinner;\n      }\n    },\n\n    // Adjustments after slide content has been loaded\n    // ===============================================\n\n    afterLoad: function (slide) {\n      var self = this;\n\n      if (self.isClosing) {\n        return;\n      }\n\n      slide.isLoading = false;\n      slide.isLoaded = true;\n\n      self.trigger(\"afterLoad\", slide);\n\n      self.hideLoading(slide);\n\n      // Add small close button\n      if (slide.opts.smallBtn && (!slide.$smallBtn || !slide.$smallBtn.length)) {\n        slide.$smallBtn = $(self.translate(slide, slide.opts.btnTpl.smallBtn)).appendTo(slide.$content);\n      }\n\n      // Disable right click\n      if (slide.opts.protect && slide.$content && !slide.hasError) {\n        slide.$content.on(\"contextmenu.fb\", function (e) {\n          if (e.button == 2) {\n            e.preventDefault();\n          }\n\n          return true;\n        });\n\n        // Add fake element on top of the image\n        // This makes a bit harder for user to select image\n        if (slide.type === \"image\") {\n          $('<div class=\"fancybox-spaceball\"></div>').appendTo(slide.$content);\n        }\n      }\n\n      self.adjustCaption(slide);\n\n      self.adjustLayout(slide);\n\n      if (slide.pos === self.currPos) {\n        self.updateCursor();\n      }\n\n      self.revealContent(slide);\n    },\n\n    // Prevent caption overlap,\n    // fix css inconsistency across browsers\n    // =====================================\n\n    adjustCaption: function (slide) {\n      var self = this,\n        current = slide || self.current,\n        caption = current.opts.caption,\n        preventOverlap = current.opts.preventCaptionOverlap,\n        $caption = self.$refs.caption,\n        $clone,\n        captionH = false;\n\n      $caption.toggleClass(\"fancybox-caption--separate\", preventOverlap);\n\n      if (preventOverlap && caption && caption.length) {\n        if (current.pos !== self.currPos) {\n          $clone = $caption.clone().appendTo($caption.parent());\n\n          $clone\n            .children()\n            .eq(0)\n            .empty()\n            .html(caption);\n\n          captionH = $clone.outerHeight(true);\n\n          $clone.empty().remove();\n        } else if (self.$caption) {\n          captionH = self.$caption.outerHeight(true);\n        }\n\n        current.$slide.css(\"padding-bottom\", captionH || \"\");\n      }\n    },\n\n    // Simple hack to fix inconsistency across browsers, described here (affects Edge, too):\n    // https://bugzilla.mozilla.org/show_bug.cgi?id=748518\n    // ====================================================================================\n\n    adjustLayout: function (slide) {\n      var self = this,\n        current = slide || self.current,\n        scrollHeight,\n        marginBottom,\n        inlinePadding,\n        actualPadding;\n\n      if (current.isLoaded && current.opts.disableLayoutFix !== true) {\n        current.$content.css(\"margin-bottom\", \"\");\n\n        // If we would always set margin-bottom for the content,\n        // then it would potentially break vertical align\n        if (current.$content.outerHeight() > current.$slide.height() + 0.5) {\n          inlinePadding = current.$slide[0].style[\"padding-bottom\"];\n          actualPadding = current.$slide.css(\"padding-bottom\");\n\n          if (parseFloat(actualPadding) > 0) {\n            scrollHeight = current.$slide[0].scrollHeight;\n\n            current.$slide.css(\"padding-bottom\", 0);\n\n            if (Math.abs(scrollHeight - current.$slide[0].scrollHeight) < 1) {\n              marginBottom = actualPadding;\n            }\n\n            current.$slide.css(\"padding-bottom\", inlinePadding);\n          }\n        }\n\n        current.$content.css(\"margin-bottom\", marginBottom);\n      }\n    },\n\n    // Make content visible\n    // This method is called right after content has been loaded or\n    // user navigates gallery and transition should start\n    // ============================================================\n\n    revealContent: function (slide) {\n      var self = this,\n        $slide = slide.$slide,\n        end = false,\n        start = false,\n        isMoved = self.isMoved(slide),\n        isRevealed = slide.isRevealed,\n        effect,\n        effectClassName,\n        duration,\n        opacity;\n\n      slide.isRevealed = true;\n\n      effect = slide.opts[self.firstRun ? \"animationEffect\" : \"transitionEffect\"];\n      duration = slide.opts[self.firstRun ? \"animationDuration\" : \"transitionDuration\"];\n\n      duration = parseInt(slide.forcedDuration === undefined ? duration : slide.forcedDuration, 10);\n\n      if (isMoved || slide.pos !== self.currPos || !duration) {\n        effect = false;\n      }\n\n      // Check if can zoom\n      if (effect === \"zoom\") {\n        if (slide.pos === self.currPos && duration && slide.type === \"image\" && !slide.hasError && (start = self.getThumbPos(slide))) {\n          end = self.getFitPos(slide);\n        } else {\n          effect = \"fade\";\n        }\n      }\n\n      // Zoom animation\n      // ==============\n      if (effect === \"zoom\") {\n        self.isAnimating = true;\n\n        end.scaleX = end.width / start.width;\n        end.scaleY = end.height / start.height;\n\n        // Check if we need to animate opacity\n        opacity = slide.opts.zoomOpacity;\n\n        if (opacity == \"auto\") {\n          opacity = Math.abs(slide.width / slide.height - start.width / start.height) > 0.1;\n        }\n\n        if (opacity) {\n          start.opacity = 0.1;\n          end.opacity = 1;\n        }\n\n        // Draw image at start position\n        $.fancybox.setTranslate(slide.$content.removeClass(\"fancybox-is-hidden\"), start);\n\n        forceRedraw(slide.$content);\n\n        // Start animation\n        $.fancybox.animate(slide.$content, end, duration, function () {\n          self.isAnimating = false;\n\n          self.complete();\n        });\n\n        return;\n      }\n\n      self.updateSlide(slide);\n\n      // Simply show content if no effect\n      // ================================\n      if (!effect) {\n        slide.$content.removeClass(\"fancybox-is-hidden\");\n\n        if (!isRevealed && isMoved && slide.type === \"image\" && !slide.hasError) {\n          slide.$content.hide().fadeIn(\"fast\");\n        }\n\n        if (slide.pos === self.currPos) {\n          self.complete();\n        }\n\n        return;\n      }\n\n      // Prepare for CSS transiton\n      // =========================\n      $.fancybox.stop($slide);\n\n      //effectClassName = \"fancybox-animated fancybox-slide--\" + (slide.pos >= self.prevPos ? \"next\" : \"previous\") + \" fancybox-fx-\" + effect;\n      effectClassName = \"fancybox-slide--\" + (slide.pos >= self.prevPos ? \"next\" : \"previous\") + \" fancybox-animated fancybox-fx-\" + effect;\n\n      $slide.addClass(effectClassName).removeClass(\"fancybox-slide--current\"); //.addClass(effectClassName);\n\n      slide.$content.removeClass(\"fancybox-is-hidden\");\n\n      // Force reflow\n      forceRedraw($slide);\n\n      if (slide.type !== \"image\") {\n        slide.$content.hide().show(0);\n      }\n\n      $.fancybox.animate(\n        $slide,\n        \"fancybox-slide--current\",\n        duration,\n        function () {\n          $slide.removeClass(effectClassName).css({\n            transform: \"\",\n            opacity: \"\"\n          });\n\n          if (slide.pos === self.currPos) {\n            self.complete();\n          }\n        },\n        true\n      );\n    },\n\n    // Check if we can and have to zoom from thumbnail\n    //================================================\n\n    getThumbPos: function (slide) {\n      var rez = false,\n        $thumb = slide.$thumb,\n        thumbPos,\n        btw,\n        brw,\n        bbw,\n        blw;\n\n      if (!$thumb || !inViewport($thumb[0])) {\n        return false;\n      }\n\n      thumbPos = $.fancybox.getTranslate($thumb);\n\n      btw = parseFloat($thumb.css(\"border-top-width\") || 0);\n      brw = parseFloat($thumb.css(\"border-right-width\") || 0);\n      bbw = parseFloat($thumb.css(\"border-bottom-width\") || 0);\n      blw = parseFloat($thumb.css(\"border-left-width\") || 0);\n\n      rez = {\n        top: thumbPos.top + btw,\n        left: thumbPos.left + blw,\n        width: thumbPos.width - brw - blw,\n        height: thumbPos.height - btw - bbw,\n        scaleX: 1,\n        scaleY: 1\n      };\n\n      return thumbPos.width > 0 && thumbPos.height > 0 ? rez : false;\n    },\n\n    // Final adjustments after current gallery item is moved to position\n    // and it`s content is loaded\n    // ==================================================================\n\n    complete: function () {\n      var self = this,\n        current = self.current,\n        slides = {},\n        $el;\n\n      if (self.isMoved() || !current.isLoaded) {\n        return;\n      }\n\n      if (!current.isComplete) {\n        current.isComplete = true;\n\n        current.$slide.siblings().trigger(\"onReset\");\n\n        self.preload(\"inline\");\n\n        // Trigger any CSS transiton inside the slide\n        forceRedraw(current.$slide);\n\n        current.$slide.addClass(\"fancybox-slide--complete\");\n\n        // Remove unnecessary slides\n        $.each(self.slides, function (key, slide) {\n          if (slide.pos >= self.currPos - 1 && slide.pos <= self.currPos + 1) {\n            slides[slide.pos] = slide;\n          } else if (slide) {\n            $.fancybox.stop(slide.$slide);\n\n            slide.$slide.off().remove();\n          }\n        });\n\n        self.slides = slides;\n      }\n\n      self.isAnimating = false;\n\n      self.updateCursor();\n\n      self.trigger(\"afterShow\");\n\n      // Autoplay first html5 video/audio\n      if (!!current.opts.video.autoStart) {\n        current.$slide\n          .find(\"video,audio\")\n          .filter(\":visible:first\")\n          .trigger(\"play\")\n          .one(\"ended\", function () {\n            if (Document.exitFullscreen) {\n              Document.exitFullscreen();\n            } else if (this.webkitExitFullscreen) {\n              this.webkitExitFullscreen();\n            }\n\n            self.next();\n          });\n      }\n\n      // Try to focus on the first focusable element\n      if (current.opts.autoFocus && current.contentType === \"html\") {\n        // Look for the first input with autofocus attribute\n        $el = current.$content.find(\"input[autofocus]:enabled:visible:first\");\n\n        if ($el.length) {\n          $el.trigger(\"focus\");\n        } else {\n          self.focus(null, true);\n        }\n      }\n\n      // Avoid jumping\n      current.$slide.scrollTop(0).scrollLeft(0);\n    },\n\n    // Preload next and previous slides\n    // ================================\n\n    preload: function (type) {\n      var self = this,\n        prev,\n        next;\n\n      if (self.group.length < 2) {\n        return;\n      }\n\n      next = self.slides[self.currPos + 1];\n      prev = self.slides[self.currPos - 1];\n\n      if (prev && prev.type === type) {\n        self.loadSlide(prev);\n      }\n\n      if (next && next.type === type) {\n        self.loadSlide(next);\n      }\n    },\n\n    // Try to find and focus on the first focusable element\n    // ====================================================\n\n    focus: function (e, firstRun) {\n      var self = this,\n        focusableStr = [\n          \"a[href]\",\n          \"area[href]\",\n          'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])',\n          \"select:not([disabled]):not([aria-hidden])\",\n          \"textarea:not([disabled]):not([aria-hidden])\",\n          \"button:not([disabled]):not([aria-hidden])\",\n          \"iframe\",\n          \"object\",\n          \"embed\",\n          \"video\",\n          \"audio\",\n          \"[contenteditable]\",\n          '[tabindex]:not([tabindex^=\"-\"])'\n        ].join(\",\"),\n        focusableItems,\n        focusedItemIndex;\n\n      if (self.isClosing) {\n        return;\n      }\n\n      if (e || !self.current || !self.current.isComplete) {\n        // Focus on any element inside fancybox\n        focusableItems = self.$refs.container.find(\"*:visible\");\n      } else {\n        // Focus inside current slide\n        focusableItems = self.current.$slide.find(\"*:visible\" + (firstRun ? \":not(.fancybox-close-small)\" : \"\"));\n      }\n\n      focusableItems = focusableItems.filter(focusableStr).filter(function () {\n        return $(this).css(\"visibility\") !== \"hidden\" && !$(this).hasClass(\"disabled\");\n      });\n\n      if (focusableItems.length) {\n        focusedItemIndex = focusableItems.index(document.activeElement);\n\n        if (e && e.shiftKey) {\n          // Back tab\n          if (focusedItemIndex < 0 || focusedItemIndex == 0) {\n            e.preventDefault();\n\n            focusableItems.eq(focusableItems.length - 1).trigger(\"focus\");\n          }\n        } else {\n          // Outside or Forward tab\n          if (focusedItemIndex < 0 || focusedItemIndex == focusableItems.length - 1) {\n            if (e) {\n              e.preventDefault();\n            }\n\n            focusableItems.eq(0).trigger(\"focus\");\n          }\n        }\n      } else {\n        self.$refs.container.trigger(\"focus\");\n      }\n    },\n\n    // Activates current instance - brings container to the front and enables keyboard,\n    // notifies other instances about deactivating\n    // =================================================================================\n\n    activate: function () {\n      var self = this;\n\n      // Deactivate all instances\n      $(\".fancybox-container\").each(function () {\n        var instance = $(this).data(\"FancyBox\");\n\n        // Skip self and closing instances\n        if (instance && instance.id !== self.id && !instance.isClosing) {\n          instance.trigger(\"onDeactivate\");\n\n          instance.removeEvents();\n\n          instance.isVisible = false;\n        }\n      });\n\n      self.isVisible = true;\n\n      if (self.current || self.isIdle) {\n        self.update();\n\n        self.updateControls();\n      }\n\n      self.trigger(\"onActivate\");\n\n      self.addEvents();\n    },\n\n    // Start closing procedure\n    // This will start \"zoom-out\" animation if needed and clean everything up afterwards\n    // =================================================================================\n\n    close: function (e, d) {\n      var self = this,\n        current = self.current,\n        effect,\n        duration,\n        $content,\n        domRect,\n        opacity,\n        start,\n        end;\n\n      var done = function () {\n        self.cleanUp(e);\n      };\n\n      if (self.isClosing) {\n        return false;\n      }\n\n      self.isClosing = true;\n\n      // If beforeClose callback prevents closing, make sure content is centered\n      if (self.trigger(\"beforeClose\", e) === false) {\n        self.isClosing = false;\n\n        requestAFrame(function () {\n          self.update();\n        });\n\n        return false;\n      }\n\n      // Remove all events\n      // If there are multiple instances, they will be set again by \"activate\" method\n      self.removeEvents();\n\n      $content = current.$content;\n      effect = current.opts.animationEffect;\n      duration = $.isNumeric(d) ? d : effect ? current.opts.animationDuration : 0;\n\n      current.$slide.removeClass(\"fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated\");\n\n      if (e !== true) {\n        $.fancybox.stop(current.$slide);\n      } else {\n        effect = false;\n      }\n\n      // Remove other slides\n      current.$slide\n        .siblings()\n        .trigger(\"onReset\")\n        .remove();\n\n      // Trigger animations\n      if (duration) {\n        self.$refs.container\n          .removeClass(\"fancybox-is-open\")\n          .addClass(\"fancybox-is-closing\")\n          .css(\"transition-duration\", duration + \"ms\");\n      }\n\n      // Clean up\n      self.hideLoading(current);\n\n      self.hideControls(true);\n\n      self.updateCursor();\n\n      // Check if possible to zoom-out\n      if (\n        effect === \"zoom\" &&\n        !($content && duration && current.type === \"image\" && !self.isMoved() && !current.hasError && (end = self.getThumbPos(current)))\n      ) {\n        effect = \"fade\";\n      }\n\n      if (effect === \"zoom\") {\n        $.fancybox.stop($content);\n\n        domRect = $.fancybox.getTranslate($content);\n\n        start = {\n          top: domRect.top,\n          left: domRect.left,\n          scaleX: domRect.width / end.width,\n          scaleY: domRect.height / end.height,\n          width: end.width,\n          height: end.height\n        };\n\n        // Check if we need to animate opacity\n        opacity = current.opts.zoomOpacity;\n\n        if (opacity == \"auto\") {\n          opacity = Math.abs(current.width / current.height - end.width / end.height) > 0.1;\n        }\n\n        if (opacity) {\n          end.opacity = 0;\n        }\n\n        $.fancybox.setTranslate($content, start);\n\n        forceRedraw($content);\n\n        $.fancybox.animate($content, end, duration, done);\n\n        return true;\n      }\n\n      if (effect && duration) {\n        $.fancybox.animate(\n          current.$slide.addClass(\"fancybox-slide--previous\").removeClass(\"fancybox-slide--current\"),\n          \"fancybox-animated fancybox-fx-\" + effect,\n          duration,\n          done\n        );\n      } else {\n        // If skip animation\n        if (e === true) {\n          setTimeout(done, duration);\n        } else {\n          done();\n        }\n      }\n\n      return true;\n    },\n\n    // Final adjustments after removing the instance\n    // =============================================\n\n    cleanUp: function (e) {\n      var self = this,\n        instance,\n        $focus = self.current.opts.$orig,\n        x,\n        y;\n\n      self.current.$slide.trigger(\"onReset\");\n\n      self.$refs.container.empty().remove();\n\n      self.trigger(\"afterClose\", e);\n\n      // Place back focus\n      if (!!self.current.opts.backFocus) {\n        if (!$focus || !$focus.length || !$focus.is(\":visible\")) {\n          $focus = self.$trigger;\n        }\n\n        if ($focus && $focus.length) {\n          x = window.scrollX;\n          y = window.scrollY;\n\n          $focus.trigger(\"focus\");\n\n          $(\"html, body\")\n            .scrollTop(y)\n            .scrollLeft(x);\n        }\n      }\n\n      self.current = null;\n\n      // Check if there are other instances\n      instance = $.fancybox.getInstance();\n\n      if (instance) {\n        instance.activate();\n      } else {\n        $(\"body\").removeClass(\"fancybox-active compensate-for-scrollbar\");\n\n        $(\"#fancybox-style-noscroll\").remove();\n      }\n    },\n\n    // Call callback and trigger an event\n    // ==================================\n\n    trigger: function (name, slide) {\n      var args = Array.prototype.slice.call(arguments, 1),\n        self = this,\n        obj = slide && slide.opts ? slide : self.current,\n        rez;\n\n      if (obj) {\n        args.unshift(obj);\n      } else {\n        obj = self;\n      }\n\n      args.unshift(self);\n\n      if ($.isFunction(obj.opts[name])) {\n        rez = obj.opts[name].apply(obj, args);\n      }\n\n      if (rez === false) {\n        return rez;\n      }\n\n      if (name === \"afterClose\" || !self.$refs) {\n        $D.trigger(name + \".fb\", args);\n      } else {\n        self.$refs.container.trigger(name + \".fb\", args);\n      }\n    },\n\n    // Update infobar values, navigation button states and reveal caption\n    // ==================================================================\n\n    updateControls: function () {\n      var self = this,\n        current = self.current,\n        index = current.index,\n        $container = self.$refs.container,\n        $caption = self.$refs.caption,\n        caption = current.opts.caption;\n\n      // Recalculate content dimensions\n      current.$slide.trigger(\"refresh\");\n\n      // Set caption\n      if (caption && caption.length) {\n        self.$caption = $caption;\n\n        $caption\n          .children()\n          .eq(0)\n          .html(caption);\n      } else {\n        self.$caption = null;\n      }\n\n      if (!self.hasHiddenControls && !self.isIdle) {\n        self.showControls();\n      }\n\n      // Update info and navigation elements\n      $container.find(\"[data-fancybox-count]\").html(self.group.length);\n      $container.find(\"[data-fancybox-index]\").html(index + 1);\n\n      $container.find(\"[data-fancybox-prev]\").prop(\"disabled\", !current.opts.loop && index <= 0);\n      $container.find(\"[data-fancybox-next]\").prop(\"disabled\", !current.opts.loop && index >= self.group.length - 1);\n\n      if (current.type === \"image\") {\n        // Re-enable buttons; update download button source\n        $container\n          .find(\"[data-fancybox-zoom]\")\n          .show()\n          .end()\n          .find(\"[data-fancybox-download]\")\n          .attr(\"href\", current.opts.image.src || current.src)\n          .show();\n      } else if (current.opts.toolbar) {\n        $container.find(\"[data-fancybox-download],[data-fancybox-zoom]\").hide();\n      }\n\n      // Make sure focus is not on disabled button/element\n      if ($(document.activeElement).is(\":hidden,[disabled]\")) {\n        self.$refs.container.trigger(\"focus\");\n      }\n    },\n\n    // Hide toolbar and caption\n    // ========================\n\n    hideControls: function (andCaption) {\n      var self = this,\n        arr = [\"infobar\", \"toolbar\", \"nav\"];\n\n      if (andCaption || !self.current.opts.preventCaptionOverlap) {\n        arr.push(\"caption\");\n      }\n\n      this.$refs.container.removeClass(\n        arr\n        .map(function (i) {\n          return \"fancybox-show-\" + i;\n        })\n        .join(\" \")\n      );\n\n      this.hasHiddenControls = true;\n    },\n\n    showControls: function () {\n      var self = this,\n        opts = self.current ? self.current.opts : self.opts,\n        $container = self.$refs.container;\n\n      self.hasHiddenControls = false;\n      self.idleSecondsCounter = 0;\n\n      $container\n        .toggleClass(\"fancybox-show-toolbar\", !!(opts.toolbar && opts.buttons))\n        .toggleClass(\"fancybox-show-infobar\", !!(opts.infobar && self.group.length > 1))\n        .toggleClass(\"fancybox-show-caption\", !!self.$caption)\n        .toggleClass(\"fancybox-show-nav\", !!(opts.arrows && self.group.length > 1))\n        .toggleClass(\"fancybox-is-modal\", !!opts.modal);\n    },\n\n    // Toggle toolbar and caption\n    // ==========================\n\n    toggleControls: function () {\n      if (this.hasHiddenControls) {\n        this.showControls();\n      } else {\n        this.hideControls();\n      }\n    }\n  });\n\n  $.fancybox = {\n    version: \"3.5.7\",\n    defaults: defaults,\n\n    // Get current instance and execute a command.\n    //\n    // Examples of usage:\n    //\n    //   $instance = $.fancybox.getInstance();\n    //   $.fancybox.getInstance().jumpTo( 1 );\n    //   $.fancybox.getInstance( 'jumpTo', 1 );\n    //   $.fancybox.getInstance( function() {\n    //       console.info( this.currIndex );\n    //   });\n    // ======================================================\n\n    getInstance: function (command) {\n      var instance = $('.fancybox-container:not(\".fancybox-is-closing\"):last').data(\"FancyBox\"),\n        args = Array.prototype.slice.call(arguments, 1);\n\n      if (instance instanceof FancyBox) {\n        if ($.type(command) === \"string\") {\n          instance[command].apply(instance, args);\n        } else if ($.type(command) === \"function\") {\n          command.apply(instance, args);\n        }\n\n        return instance;\n      }\n\n      return false;\n    },\n\n    // Create new instance\n    // ===================\n\n    open: function (items, opts, index) {\n      return new FancyBox(items, opts, index);\n    },\n\n    // Close current or all instances\n    // ==============================\n\n    close: function (all) {\n      var instance = this.getInstance();\n\n      if (instance) {\n        instance.close();\n\n        // Try to find and close next instance\n        if (all === true) {\n          this.close(all);\n        }\n      }\n    },\n\n    // Close all instances and unbind all events\n    // =========================================\n\n    destroy: function () {\n      this.close(true);\n\n      $D.add(\"body\").off(\"click.fb-start\", \"**\");\n    },\n\n    // Try to detect mobile devices\n    // ============================\n\n    isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),\n\n    // Detect if 'translate3d' support is available\n    // ============================================\n\n    use3d: (function () {\n      var div = document.createElement(\"div\");\n\n      return (\n        window.getComputedStyle &&\n        window.getComputedStyle(div) &&\n        window.getComputedStyle(div).getPropertyValue(\"transform\") &&\n        !(document.documentMode && document.documentMode < 11)\n      );\n    })(),\n\n    // Helper function to get current visual state of an element\n    // returns array[ top, left, horizontal-scale, vertical-scale, opacity ]\n    // =====================================================================\n\n    getTranslate: function ($el) {\n      var domRect;\n\n      if (!$el || !$el.length) {\n        return false;\n      }\n\n      domRect = $el[0].getBoundingClientRect();\n\n      return {\n        top: domRect.top || 0,\n        left: domRect.left || 0,\n        width: domRect.width,\n        height: domRect.height,\n        opacity: parseFloat($el.css(\"opacity\"))\n      };\n    },\n\n    // Shortcut for setting \"translate3d\" properties for element\n    // Can set be used to set opacity, too\n    // ========================================================\n\n    setTranslate: function ($el, props) {\n      var str = \"\",\n        css = {};\n\n      if (!$el || !props) {\n        return;\n      }\n\n      if (props.left !== undefined || props.top !== undefined) {\n        str =\n          (props.left === undefined ? $el.position().left : props.left) +\n          \"px, \" +\n          (props.top === undefined ? $el.position().top : props.top) +\n          \"px\";\n\n        if (this.use3d) {\n          str = \"translate3d(\" + str + \", 0px)\";\n        } else {\n          str = \"translate(\" + str + \")\";\n        }\n      }\n\n      if (props.scaleX !== undefined && props.scaleY !== undefined) {\n        str += \" scale(\" + props.scaleX + \", \" + props.scaleY + \")\";\n      } else if (props.scaleX !== undefined) {\n        str += \" scaleX(\" + props.scaleX + \")\";\n      }\n\n      if (str.length) {\n        css.transform = str;\n      }\n\n      if (props.opacity !== undefined) {\n        css.opacity = props.opacity;\n      }\n\n      if (props.width !== undefined) {\n        css.width = props.width;\n      }\n\n      if (props.height !== undefined) {\n        css.height = props.height;\n      }\n\n      return $el.css(css);\n    },\n\n    // Simple CSS transition handler\n    // =============================\n\n    animate: function ($el, to, duration, callback, leaveAnimationName) {\n      var self = this,\n        from;\n\n      if ($.isFunction(duration)) {\n        callback = duration;\n        duration = null;\n      }\n\n      self.stop($el);\n\n      from = self.getTranslate($el);\n\n      $el.on(transitionEnd, function (e) {\n        // Skip events from child elements and z-index change\n        if (e && e.originalEvent && (!$el.is(e.originalEvent.target) || e.originalEvent.propertyName == \"z-index\")) {\n          return;\n        }\n\n        self.stop($el);\n\n        if ($.isNumeric(duration)) {\n          $el.css(\"transition-duration\", \"\");\n        }\n\n        if ($.isPlainObject(to)) {\n          if (to.scaleX !== undefined && to.scaleY !== undefined) {\n            self.setTranslate($el, {\n              top: to.top,\n              left: to.left,\n              width: from.width * to.scaleX,\n              height: from.height * to.scaleY,\n              scaleX: 1,\n              scaleY: 1\n            });\n          }\n        } else if (leaveAnimationName !== true) {\n          $el.removeClass(to);\n        }\n\n        if ($.isFunction(callback)) {\n          callback(e);\n        }\n      });\n\n      if ($.isNumeric(duration)) {\n        $el.css(\"transition-duration\", duration + \"ms\");\n      }\n\n      // Start animation by changing CSS properties or class name\n      if ($.isPlainObject(to)) {\n        if (to.scaleX !== undefined && to.scaleY !== undefined) {\n          delete to.width;\n          delete to.height;\n\n          if ($el.parent().hasClass(\"fancybox-slide--image\")) {\n            $el.parent().addClass(\"fancybox-is-scaling\");\n          }\n        }\n\n        $.fancybox.setTranslate($el, to);\n      } else {\n        $el.addClass(to);\n      }\n\n      // Make sure that `transitionend` callback gets fired\n      $el.data(\n        \"timer\",\n        setTimeout(function () {\n          $el.trigger(transitionEnd);\n        }, duration + 33)\n      );\n    },\n\n    stop: function ($el, callCallback) {\n      if ($el && $el.length) {\n        clearTimeout($el.data(\"timer\"));\n\n        if (callCallback) {\n          $el.trigger(transitionEnd);\n        }\n\n        $el.off(transitionEnd).css(\"transition-duration\", \"\");\n\n        $el.parent().removeClass(\"fancybox-is-scaling\");\n      }\n    }\n  };\n\n  // Default click handler for \"fancyboxed\" links\n  // ============================================\n\n  function _run(e, opts) {\n    var items = [],\n      index = 0,\n      $target,\n      value,\n      instance;\n\n    // Avoid opening multiple times\n    if (e && e.isDefaultPrevented()) {\n      return;\n    }\n\n    e.preventDefault();\n\n    opts = opts || {};\n\n    if (e && e.data) {\n      opts = mergeOpts(e.data.options, opts);\n    }\n\n    $target = opts.$target || $(e.currentTarget).trigger(\"blur\");\n    instance = $.fancybox.getInstance();\n\n    if (instance && instance.$trigger && instance.$trigger.is($target)) {\n      return;\n    }\n\n    if (opts.selector) {\n      items = $(opts.selector);\n    } else {\n      // Get all related items and find index for clicked one\n      value = $target.attr(\"data-fancybox\") || \"\";\n\n      if (value) {\n        items = e.data ? e.data.items : [];\n        items = items.length ? items.filter('[data-fancybox=\"' + value + '\"]') : $('[data-fancybox=\"' + value + '\"]');\n      } else {\n        items = [$target];\n      }\n    }\n\n    index = $(items).index($target);\n\n    // Sometimes current item can not be found\n    if (index < 0) {\n      index = 0;\n    }\n\n    instance = $.fancybox.open(items, opts, index);\n\n    // Save last active element\n    instance.$trigger = $target;\n  }\n\n  // Create a jQuery plugin\n  // ======================\n\n  $.fn.fancybox = function (options) {\n    var selector;\n\n    options = options || {};\n    selector = options.selector || false;\n\n    if (selector) {\n      // Use body element instead of document so it executes first\n      $(\"body\")\n        .off(\"click.fb-start\", selector)\n        .on(\"click.fb-start\", selector, {\n          options: options\n        }, _run);\n    } else {\n      this.off(\"click.fb-start\").on(\n        \"click.fb-start\", {\n          items: this,\n          options: options\n        },\n        _run\n      );\n    }\n\n    return this;\n  };\n\n  // Self initializing plugin for all elements having `data-fancybox` attribute\n  // ==========================================================================\n\n  $D.on(\"click.fb-start\", \"[data-fancybox]\", _run);\n\n  // Enable \"trigger elements\"\n  // =========================\n\n  $D.on(\"click.fb-start\", \"[data-fancybox-trigger]\", function (e) {\n    $('[data-fancybox=\"' + $(this).attr(\"data-fancybox-trigger\") + '\"]')\n      .eq($(this).attr(\"data-fancybox-index\") || 0)\n      .trigger(\"click.fb-start\", {\n        $trigger: $(this)\n      });\n  });\n\n  // Track focus event for better accessibility styling\n  // ==================================================\n  (function () {\n    var buttonStr = \".fancybox-button\",\n      focusStr = \"fancybox-focus\",\n      $pressed = null;\n\n    $D.on(\"mousedown mouseup focus blur\", buttonStr, function (e) {\n      switch (e.type) {\n        case \"mousedown\":\n          $pressed = $(this);\n          break;\n        case \"mouseup\":\n          $pressed = null;\n          break;\n        case \"focusin\":\n          $(buttonStr).removeClass(focusStr);\n\n          if (!$(this).is($pressed) && !$(this).is(\"[disabled]\")) {\n            $(this).addClass(focusStr);\n          }\n          break;\n        case \"focusout\":\n          $(buttonStr).removeClass(focusStr);\n          break;\n      }\n    });\n  })();\n})(window, document, jQuery);\n// ==========================================================================\n//\n// Media\n// Adds additional media type support\n//\n// ==========================================================================\n(function ($) {\n  \"use strict\";\n\n  // Object containing properties for each media type\n  var defaults = {\n    youtube: {\n      matcher: /(youtube\\.com|youtu\\.be|youtube\\-nocookie\\.com)\\/(watch\\?(.*&)?v=|v\\/|u\\/|embed\\/?)?(videoseries\\?list=(.*)|[\\w-]{11}|\\?listType=(.*)&list=(.*))(.*)/i,\n      params: {\n        autoplay: 1,\n        autohide: 1,\n        fs: 1,\n        rel: 0,\n        hd: 1,\n        wmode: \"transparent\",\n        enablejsapi: 1,\n        html5: 1\n      },\n      paramPlace: 8,\n      type: \"iframe\",\n      url: \"https://www.youtube-nocookie.com/embed/$4\",\n      thumb: \"https://img.youtube.com/vi/$4/hqdefault.jpg\"\n    },\n\n    vimeo: {\n      matcher: /^.+vimeo.com\\/(.*\\/)?([\\d]+)(.*)?/,\n      params: {\n        autoplay: 1,\n        hd: 1,\n        show_title: 1,\n        show_byline: 1,\n        show_portrait: 0,\n        fullscreen: 1\n      },\n      paramPlace: 3,\n      type: \"iframe\",\n      url: \"//player.vimeo.com/video/$2\"\n    },\n\n    instagram: {\n      matcher: /(instagr\\.am|instagram\\.com)\\/p\\/([a-zA-Z0-9_\\-]+)\\/?/i,\n      type: \"image\",\n      url: \"//$1/p/$2/media/?size=l\"\n    },\n\n    // Examples:\n    // http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16\n    // https://www.google.com/maps/@37.7852006,-122.4146355,14.65z\n    // https://www.google.com/maps/@52.2111123,2.9237542,6.61z?hl=en\n    // https://www.google.com/maps/place/Googleplex/@37.4220041,-122.0833494,17z/data=!4m5!3m4!1s0x0:0x6c296c66619367e0!8m2!3d37.4219998!4d-122.0840572\n    gmap_place: {\n      matcher: /(maps\\.)?google\\.([a-z]{2,3}(\\.[a-z]{2})?)\\/(((maps\\/(place\\/(.*)\\/)?\\@(.*),(\\d+.?\\d+?)z))|(\\?ll=))(.*)?/i,\n      type: \"iframe\",\n      url: function (rez) {\n        return (\n          \"//maps.google.\" +\n          rez[2] +\n          \"/?ll=\" +\n          (rez[9] ? rez[9] + \"&z=\" + Math.floor(rez[10]) + (rez[12] ? rez[12].replace(/^\\//, \"&\") : \"\") : rez[12] + \"\").replace(/\\?/, \"&\") +\n          \"&output=\" +\n          (rez[12] && rez[12].indexOf(\"layer=c\") > 0 ? \"svembed\" : \"embed\")\n        );\n      }\n    },\n\n    // Examples:\n    // https://www.google.com/maps/search/Empire+State+Building/\n    // https://www.google.com/maps/search/?api=1&query=centurylink+field\n    // https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393\n    gmap_search: {\n      matcher: /(maps\\.)?google\\.([a-z]{2,3}(\\.[a-z]{2})?)\\/(maps\\/search\\/)(.*)/i,\n      type: \"iframe\",\n      url: function (rez) {\n        return \"//maps.google.\" + rez[2] + \"/maps?q=\" + rez[5].replace(\"query=\", \"q=\").replace(\"api=1\", \"\") + \"&output=embed\";\n      }\n    }\n  };\n\n  // Formats matching url to final form\n  var format = function (url, rez, params) {\n    if (!url) {\n      return;\n    }\n\n    params = params || \"\";\n\n    if ($.type(params) === \"object\") {\n      params = $.param(params, true);\n    }\n\n    $.each(rez, function (key, value) {\n      url = url.replace(\"$\" + key, value || \"\");\n    });\n\n    if (params.length) {\n      url += (url.indexOf(\"?\") > 0 ? \"&\" : \"?\") + params;\n    }\n\n    return url;\n  };\n\n  $(document).on(\"objectNeedsType.fb\", function (e, instance, item) {\n    var url = item.src || \"\",\n      type = false,\n      media,\n      thumb,\n      rez,\n      params,\n      urlParams,\n      paramObj,\n      provider;\n\n    media = $.extend(true, {}, defaults, item.opts.media);\n\n    // Look for any matching media type\n    $.each(media, function (providerName, providerOpts) {\n      rez = url.match(providerOpts.matcher);\n\n      if (!rez) {\n        return;\n      }\n\n      type = providerOpts.type;\n      provider = providerName;\n      paramObj = {};\n\n      if (providerOpts.paramPlace && rez[providerOpts.paramPlace]) {\n        urlParams = rez[providerOpts.paramPlace];\n\n        if (urlParams[0] == \"?\") {\n          urlParams = urlParams.substring(1);\n        }\n\n        urlParams = urlParams.split(\"&\");\n\n        for (var m = 0; m < urlParams.length; ++m) {\n          var p = urlParams[m].split(\"=\", 2);\n\n          if (p.length == 2) {\n            paramObj[p[0]] = decodeURIComponent(p[1].replace(/\\+/g, \" \"));\n          }\n        }\n      }\n\n      params = $.extend(true, {}, providerOpts.params, item.opts[providerName], paramObj);\n\n      url =\n        $.type(providerOpts.url) === \"function\" ? providerOpts.url.call(this, rez, params, item) : format(providerOpts.url, rez, params);\n\n      thumb =\n        $.type(providerOpts.thumb) === \"function\" ? providerOpts.thumb.call(this, rez, params, item) : format(providerOpts.thumb, rez);\n\n      if (providerName === \"youtube\") {\n        url = url.replace(/&t=((\\d+)m)?(\\d+)s/, function (match, p1, m, s) {\n          return \"&start=\" + ((m ? parseInt(m, 10) * 60 : 0) + parseInt(s, 10));\n        });\n      } else if (providerName === \"vimeo\") {\n        url = url.replace(\"&%23\", \"#\");\n      }\n\n      return false;\n    });\n\n    // If it is found, then change content type and update the url\n\n    if (type) {\n      if (!item.opts.thumb && !(item.opts.$thumb && item.opts.$thumb.length)) {\n        item.opts.thumb = thumb;\n      }\n\n      if (type === \"iframe\") {\n        item.opts = $.extend(true, item.opts, {\n          iframe: {\n            preload: false,\n            attr: {\n              scrolling: \"no\"\n            }\n          }\n        });\n      }\n\n      $.extend(item, {\n        type: type,\n        src: url,\n        origSrc: item.src,\n        contentSource: provider,\n        contentType: type === \"image\" ? \"image\" : provider == \"gmap_place\" || provider == \"gmap_search\" ? \"map\" : \"video\"\n      });\n    } else if (url) {\n      item.type = item.opts.defaultType;\n    }\n  });\n\n  // Load YouTube/Video API on request to detect when video finished playing\n  var VideoAPILoader = {\n    youtube: {\n      src: \"https://www.youtube.com/iframe_api\",\n      class: \"YT\",\n      loading: false,\n      loaded: false\n    },\n\n    vimeo: {\n      src: \"https://player.vimeo.com/api/player.js\",\n      class: \"Vimeo\",\n      loading: false,\n      loaded: false\n    },\n\n    load: function (vendor) {\n      var _this = this,\n        script;\n\n      if (this[vendor].loaded) {\n        setTimeout(function () {\n          _this.done(vendor);\n        });\n        return;\n      }\n\n      if (this[vendor].loading) {\n        return;\n      }\n\n      this[vendor].loading = true;\n\n      script = document.createElement(\"script\");\n      script.type = \"text/javascript\";\n      script.src = this[vendor].src;\n\n      if (vendor === \"youtube\") {\n        window.onYouTubeIframeAPIReady = function () {\n          _this[vendor].loaded = true;\n          _this.done(vendor);\n        };\n      } else {\n        script.onload = function () {\n          _this[vendor].loaded = true;\n          _this.done(vendor);\n        };\n      }\n\n      document.body.appendChild(script);\n    },\n    done: function (vendor) {\n      var instance, $el, player;\n\n      if (vendor === \"youtube\") {\n        delete window.onYouTubeIframeAPIReady;\n      }\n\n      instance = $.fancybox.getInstance();\n\n      if (instance) {\n        $el = instance.current.$content.find(\"iframe\");\n\n        if (vendor === \"youtube\" && YT !== undefined && YT) {\n          player = new YT.Player($el.attr(\"id\"), {\n            events: {\n              onStateChange: function (e) {\n                if (e.data == 0) {\n                  instance.next();\n                }\n              }\n            }\n          });\n        } else if (vendor === \"vimeo\" && Vimeo !== undefined && Vimeo) {\n          player = new Vimeo.Player($el);\n\n          player.on(\"ended\", function () {\n            instance.next();\n          });\n        }\n      }\n    }\n  };\n\n  $(document).on({\n    \"afterShow.fb\": function (e, instance, current) {\n      if (instance.group.length > 1 && (current.contentSource === \"youtube\" || current.contentSource === \"vimeo\")) {\n        VideoAPILoader.load(current.contentSource);\n      }\n    }\n  });\n})(jQuery);\n// ==========================================================================\n//\n// Guestures\n// Adds touch guestures, handles click and tap events\n//\n// ==========================================================================\n(function (window, document, $) {\n  \"use strict\";\n\n  var requestAFrame = (function () {\n    return (\n      window.requestAnimationFrame ||\n      window.webkitRequestAnimationFrame ||\n      window.mozRequestAnimationFrame ||\n      window.oRequestAnimationFrame ||\n      // if all else fails, use setTimeout\n      function (callback) {\n        return window.setTimeout(callback, 1000 / 60);\n      }\n    );\n  })();\n\n  var cancelAFrame = (function () {\n    return (\n      window.cancelAnimationFrame ||\n      window.webkitCancelAnimationFrame ||\n      window.mozCancelAnimationFrame ||\n      window.oCancelAnimationFrame ||\n      function (id) {\n        window.clearTimeout(id);\n      }\n    );\n  })();\n\n  var getPointerXY = function (e) {\n    var result = [];\n\n    e = e.originalEvent || e || window.e;\n    e = e.touches && e.touches.length ? e.touches : e.changedTouches && e.changedTouches.length ? e.changedTouches : [e];\n\n    for (var key in e) {\n      if (e[key].pageX) {\n        result.push({\n          x: e[key].pageX,\n          y: e[key].pageY\n        });\n      } else if (e[key].clientX) {\n        result.push({\n          x: e[key].clientX,\n          y: e[key].clientY\n        });\n      }\n    }\n\n    return result;\n  };\n\n  var distance = function (point2, point1, what) {\n    if (!point1 || !point2) {\n      return 0;\n    }\n\n    if (what === \"x\") {\n      return point2.x - point1.x;\n    } else if (what === \"y\") {\n      return point2.y - point1.y;\n    }\n\n    return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2));\n  };\n\n  var isClickable = function ($el) {\n    if (\n      $el.is('a,area,button,[role=\"button\"],input,label,select,summary,textarea,video,audio,iframe') ||\n      $.isFunction($el.get(0).onclick) ||\n      $el.data(\"selectable\")\n    ) {\n      return true;\n    }\n\n    // Check for attributes like data-fancybox-next or data-fancybox-close\n    for (var i = 0, atts = $el[0].attributes, n = atts.length; i < n; i++) {\n      if (atts[i].nodeName.substr(0, 14) === \"data-fancybox-\") {\n        return true;\n      }\n    }\n\n    return false;\n  };\n\n  var hasScrollbars = function (el) {\n    var overflowY = window.getComputedStyle(el)[\"overflow-y\"],\n      overflowX = window.getComputedStyle(el)[\"overflow-x\"],\n      vertical = (overflowY === \"scroll\" || overflowY === \"auto\") && el.scrollHeight > el.clientHeight,\n      horizontal = (overflowX === \"scroll\" || overflowX === \"auto\") && el.scrollWidth > el.clientWidth;\n\n    return vertical || horizontal;\n  };\n\n  var isScrollable = function ($el) {\n    var rez = false;\n\n    while (true) {\n      rez = hasScrollbars($el.get(0));\n\n      if (rez) {\n        break;\n      }\n\n      $el = $el.parent();\n\n      if (!$el.length || $el.hasClass(\"fancybox-stage\") || $el.is(\"body\")) {\n        break;\n      }\n    }\n\n    return rez;\n  };\n\n  var Guestures = function (instance) {\n    var self = this;\n\n    self.instance = instance;\n\n    self.$bg = instance.$refs.bg;\n    self.$stage = instance.$refs.stage;\n    self.$container = instance.$refs.container;\n\n    self.destroy();\n\n    self.$container.on(\"touchstart.fb.touch mousedown.fb.touch\", $.proxy(self, \"ontouchstart\"));\n  };\n\n  Guestures.prototype.destroy = function () {\n    var self = this;\n\n    self.$container.off(\".fb.touch\");\n\n    $(document).off(\".fb.touch\");\n\n    if (self.requestId) {\n      cancelAFrame(self.requestId);\n      self.requestId = null;\n    }\n\n    if (self.tapped) {\n      clearTimeout(self.tapped);\n      self.tapped = null;\n    }\n  };\n\n  Guestures.prototype.ontouchstart = function (e) {\n    var self = this,\n      $target = $(e.target),\n      instance = self.instance,\n      current = instance.current,\n      $slide = current.$slide,\n      $content = current.$content,\n      isTouchDevice = e.type == \"touchstart\";\n\n    // Do not respond to both (touch and mouse) events\n    if (isTouchDevice) {\n      self.$container.off(\"mousedown.fb.touch\");\n    }\n\n    // Ignore right click\n    if (e.originalEvent && e.originalEvent.button == 2) {\n      return;\n    }\n\n    // Ignore taping on links, buttons, input elements\n    if (!$slide.length || !$target.length || isClickable($target) || isClickable($target.parent())) {\n      return;\n    }\n    // Ignore clicks on the scrollbar\n    if (!$target.is(\"img\") && e.originalEvent.clientX > $target[0].clientWidth + $target.offset().left) {\n      return;\n    }\n\n    // Ignore clicks while zooming or closing\n    if (!current || instance.isAnimating || current.$slide.hasClass(\"fancybox-animated\")) {\n      e.stopPropagation();\n      e.preventDefault();\n\n      return;\n    }\n\n    self.realPoints = self.startPoints = getPointerXY(e);\n\n    if (!self.startPoints.length) {\n      return;\n    }\n\n    // Allow other scripts to catch touch event if \"touch\" is set to false\n    if (current.touch) {\n      e.stopPropagation();\n    }\n\n    self.startEvent = e;\n\n    self.canTap = true;\n    self.$target = $target;\n    self.$content = $content;\n    self.opts = current.opts.touch;\n\n    self.isPanning = false;\n    self.isSwiping = false;\n    self.isZooming = false;\n    self.isScrolling = false;\n    self.canPan = instance.canPan();\n\n    self.startTime = new Date().getTime();\n    self.distanceX = self.distanceY = self.distance = 0;\n\n    self.canvasWidth = Math.round($slide[0].clientWidth);\n    self.canvasHeight = Math.round($slide[0].clientHeight);\n\n    self.contentLastPos = null;\n    self.contentStartPos = $.fancybox.getTranslate(self.$content) || {\n      top: 0,\n      left: 0\n    };\n    self.sliderStartPos = $.fancybox.getTranslate($slide);\n\n    // Since position will be absolute, but we need to make it relative to the stage\n    self.stagePos = $.fancybox.getTranslate(instance.$refs.stage);\n\n    self.sliderStartPos.top -= self.stagePos.top;\n    self.sliderStartPos.left -= self.stagePos.left;\n\n    self.contentStartPos.top -= self.stagePos.top;\n    self.contentStartPos.left -= self.stagePos.left;\n\n    $(document)\n      .off(\".fb.touch\")\n      .on(isTouchDevice ? \"touchend.fb.touch touchcancel.fb.touch\" : \"mouseup.fb.touch mouseleave.fb.touch\", $.proxy(self, \"ontouchend\"))\n      .on(isTouchDevice ? \"touchmove.fb.touch\" : \"mousemove.fb.touch\", $.proxy(self, \"ontouchmove\"));\n\n    if ($.fancybox.isMobile) {\n      document.addEventListener(\"scroll\", self.onscroll, true);\n    }\n\n    // Skip if clicked outside the sliding area\n    if (!(self.opts || self.canPan) || !($target.is(self.$stage) || self.$stage.find($target).length)) {\n      if ($target.is(\".fancybox-image\")) {\n        e.preventDefault();\n      }\n\n      if (!($.fancybox.isMobile && $target.parents(\".fancybox-caption\").length)) {\n        return;\n      }\n    }\n\n    self.isScrollable = isScrollable($target) || isScrollable($target.parent());\n\n    // Check if element is scrollable and try to prevent default behavior (scrolling)\n    if (!($.fancybox.isMobile && self.isScrollable)) {\n      e.preventDefault();\n    }\n\n    // One finger or mouse click - swipe or pan an image\n    if (self.startPoints.length === 1 || current.hasError) {\n      if (self.canPan) {\n        $.fancybox.stop(self.$content);\n\n        self.isPanning = true;\n      } else {\n        self.isSwiping = true;\n      }\n\n      self.$container.addClass(\"fancybox-is-grabbing\");\n    }\n\n    // Two fingers - zoom image\n    if (self.startPoints.length === 2 && current.type === \"image\" && (current.isLoaded || current.$ghost)) {\n      self.canTap = false;\n      self.isSwiping = false;\n      self.isPanning = false;\n\n      self.isZooming = true;\n\n      $.fancybox.stop(self.$content);\n\n      self.centerPointStartX = (self.startPoints[0].x + self.startPoints[1].x) * 0.5 - $(window).scrollLeft();\n      self.centerPointStartY = (self.startPoints[0].y + self.startPoints[1].y) * 0.5 - $(window).scrollTop();\n\n      self.percentageOfImageAtPinchPointX = (self.centerPointStartX - self.contentStartPos.left) / self.contentStartPos.width;\n      self.percentageOfImageAtPinchPointY = (self.centerPointStartY - self.contentStartPos.top) / self.contentStartPos.height;\n\n      self.startDistanceBetweenFingers = distance(self.startPoints[0], self.startPoints[1]);\n    }\n  };\n\n  Guestures.prototype.onscroll = function (e) {\n    var self = this;\n\n    self.isScrolling = true;\n\n    document.removeEventListener(\"scroll\", self.onscroll, true);\n  };\n\n  Guestures.prototype.ontouchmove = function (e) {\n    var self = this;\n\n    // Make sure user has not released over iframe or disabled element\n    if (e.originalEvent.buttons !== undefined && e.originalEvent.buttons === 0) {\n      self.ontouchend(e);\n      return;\n    }\n\n    if (self.isScrolling) {\n      self.canTap = false;\n      return;\n    }\n\n    self.newPoints = getPointerXY(e);\n\n    if (!(self.opts || self.canPan) || !self.newPoints.length || !self.newPoints.length) {\n      return;\n    }\n\n    if (!(self.isSwiping && self.isSwiping === true)) {\n      e.preventDefault();\n    }\n\n    self.distanceX = distance(self.newPoints[0], self.startPoints[0], \"x\");\n    self.distanceY = distance(self.newPoints[0], self.startPoints[0], \"y\");\n\n    self.distance = distance(self.newPoints[0], self.startPoints[0]);\n\n    // Skip false ontouchmove events (Chrome)\n    if (self.distance > 0) {\n      if (self.isSwiping) {\n        self.onSwipe(e);\n      } else if (self.isPanning) {\n        self.onPan();\n      } else if (self.isZooming) {\n        self.onZoom();\n      }\n    }\n  };\n\n  Guestures.prototype.onSwipe = function (e) {\n    var self = this,\n      instance = self.instance,\n      swiping = self.isSwiping,\n      left = self.sliderStartPos.left || 0,\n      angle;\n\n    // If direction is not yet determined\n    if (swiping === true) {\n      // We need at least 10px distance to correctly calculate an angle\n      if (Math.abs(self.distance) > 10) {\n        self.canTap = false;\n\n        if (instance.group.length < 2 && self.opts.vertical) {\n          self.isSwiping = \"y\";\n        } else if (instance.isDragging || self.opts.vertical === false || (self.opts.vertical === \"auto\" && $(window).width() > 800)) {\n          self.isSwiping = \"x\";\n        } else {\n          angle = Math.abs((Math.atan2(self.distanceY, self.distanceX) * 180) / Math.PI);\n\n          self.isSwiping = angle > 45 && angle < 135 ? \"y\" : \"x\";\n        }\n\n        if (self.isSwiping === \"y\" && $.fancybox.isMobile && self.isScrollable) {\n          self.isScrolling = true;\n\n          return;\n        }\n\n        instance.isDragging = self.isSwiping;\n\n        // Reset points to avoid jumping, because we dropped first swipes to calculate the angle\n        self.startPoints = self.newPoints;\n\n        $.each(instance.slides, function (index, slide) {\n          var slidePos, stagePos;\n\n          $.fancybox.stop(slide.$slide);\n\n          slidePos = $.fancybox.getTranslate(slide.$slide);\n          stagePos = $.fancybox.getTranslate(instance.$refs.stage);\n\n          slide.$slide\n            .css({\n              transform: \"\",\n              opacity: \"\",\n              \"transition-duration\": \"\"\n            })\n            .removeClass(\"fancybox-animated\")\n            .removeClass(function (index, className) {\n              return (className.match(/(^|\\s)fancybox-fx-\\S+/g) || []).join(\" \");\n            });\n\n          if (slide.pos === instance.current.pos) {\n            self.sliderStartPos.top = slidePos.top - stagePos.top;\n            self.sliderStartPos.left = slidePos.left - stagePos.left;\n          }\n\n          $.fancybox.setTranslate(slide.$slide, {\n            top: slidePos.top - stagePos.top,\n            left: slidePos.left - stagePos.left\n          });\n        });\n\n        // Stop slideshow\n        if (instance.SlideShow && instance.SlideShow.isActive) {\n          instance.SlideShow.stop();\n        }\n      }\n\n      return;\n    }\n\n    // Sticky edges\n    if (swiping == \"x\") {\n      if (\n        self.distanceX > 0 &&\n        (self.instance.group.length < 2 || (self.instance.current.index === 0 && !self.instance.current.opts.loop))\n      ) {\n        left = left + Math.pow(self.distanceX, 0.8);\n      } else if (\n        self.distanceX < 0 &&\n        (self.instance.group.length < 2 ||\n          (self.instance.current.index === self.instance.group.length - 1 && !self.instance.current.opts.loop))\n      ) {\n        left = left - Math.pow(-self.distanceX, 0.8);\n      } else {\n        left = left + self.distanceX;\n      }\n    }\n\n    self.sliderLastPos = {\n      top: swiping == \"x\" ? 0 : self.sliderStartPos.top + self.distanceY,\n      left: left\n    };\n\n    if (self.requestId) {\n      cancelAFrame(self.requestId);\n\n      self.requestId = null;\n    }\n\n    self.requestId = requestAFrame(function () {\n      if (self.sliderLastPos) {\n        $.each(self.instance.slides, function (index, slide) {\n          var pos = slide.pos - self.instance.currPos;\n\n          $.fancybox.setTranslate(slide.$slide, {\n            top: self.sliderLastPos.top,\n            left: self.sliderLastPos.left + pos * self.canvasWidth + pos * slide.opts.gutter\n          });\n        });\n\n        self.$container.addClass(\"fancybox-is-sliding\");\n      }\n    });\n  };\n\n  Guestures.prototype.onPan = function () {\n    var self = this;\n\n    // Prevent accidental movement (sometimes, when tapping casually, finger can move a bit)\n    if (distance(self.newPoints[0], self.realPoints[0]) < ($.fancybox.isMobile ? 10 : 5)) {\n      self.startPoints = self.newPoints;\n      return;\n    }\n\n    self.canTap = false;\n\n    self.contentLastPos = self.limitMovement();\n\n    if (self.requestId) {\n      cancelAFrame(self.requestId);\n    }\n\n    self.requestId = requestAFrame(function () {\n      $.fancybox.setTranslate(self.$content, self.contentLastPos);\n    });\n  };\n\n  // Make panning sticky to the edges\n  Guestures.prototype.limitMovement = function () {\n    var self = this;\n\n    var canvasWidth = self.canvasWidth;\n    var canvasHeight = self.canvasHeight;\n\n    var distanceX = self.distanceX;\n    var distanceY = self.distanceY;\n\n    var contentStartPos = self.contentStartPos;\n\n    var currentOffsetX = contentStartPos.left;\n    var currentOffsetY = contentStartPos.top;\n\n    var currentWidth = contentStartPos.width;\n    var currentHeight = contentStartPos.height;\n\n    var minTranslateX, minTranslateY, maxTranslateX, maxTranslateY, newOffsetX, newOffsetY;\n\n    if (currentWidth > canvasWidth) {\n      newOffsetX = currentOffsetX + distanceX;\n    } else {\n      newOffsetX = currentOffsetX;\n    }\n\n    newOffsetY = currentOffsetY + distanceY;\n\n    // Slow down proportionally to traveled distance\n    minTranslateX = Math.max(0, canvasWidth * 0.5 - currentWidth * 0.5);\n    minTranslateY = Math.max(0, canvasHeight * 0.5 - currentHeight * 0.5);\n\n    maxTranslateX = Math.min(canvasWidth - currentWidth, canvasWidth * 0.5 - currentWidth * 0.5);\n    maxTranslateY = Math.min(canvasHeight - currentHeight, canvasHeight * 0.5 - currentHeight * 0.5);\n\n    //   ->\n    if (distanceX > 0 && newOffsetX > minTranslateX) {\n      newOffsetX = minTranslateX - 1 + Math.pow(-minTranslateX + currentOffsetX + distanceX, 0.8) || 0;\n    }\n\n    //    <-\n    if (distanceX < 0 && newOffsetX < maxTranslateX) {\n      newOffsetX = maxTranslateX + 1 - Math.pow(maxTranslateX - currentOffsetX - distanceX, 0.8) || 0;\n    }\n\n    //   \\/\n    if (distanceY > 0 && newOffsetY > minTranslateY) {\n      newOffsetY = minTranslateY - 1 + Math.pow(-minTranslateY + currentOffsetY + distanceY, 0.8) || 0;\n    }\n\n    //   /\\\n    if (distanceY < 0 && newOffsetY < maxTranslateY) {\n      newOffsetY = maxTranslateY + 1 - Math.pow(maxTranslateY - currentOffsetY - distanceY, 0.8) || 0;\n    }\n\n    return {\n      top: newOffsetY,\n      left: newOffsetX\n    };\n  };\n\n  Guestures.prototype.limitPosition = function (newOffsetX, newOffsetY, newWidth, newHeight) {\n    var self = this;\n\n    var canvasWidth = self.canvasWidth;\n    var canvasHeight = self.canvasHeight;\n\n    if (newWidth > canvasWidth) {\n      newOffsetX = newOffsetX > 0 ? 0 : newOffsetX;\n      newOffsetX = newOffsetX < canvasWidth - newWidth ? canvasWidth - newWidth : newOffsetX;\n    } else {\n      // Center horizontally\n      newOffsetX = Math.max(0, canvasWidth / 2 - newWidth / 2);\n    }\n\n    if (newHeight > canvasHeight) {\n      newOffsetY = newOffsetY > 0 ? 0 : newOffsetY;\n      newOffsetY = newOffsetY < canvasHeight - newHeight ? canvasHeight - newHeight : newOffsetY;\n    } else {\n      // Center vertically\n      newOffsetY = Math.max(0, canvasHeight / 2 - newHeight / 2);\n    }\n\n    return {\n      top: newOffsetY,\n      left: newOffsetX\n    };\n  };\n\n  Guestures.prototype.onZoom = function () {\n    var self = this;\n\n    // Calculate current distance between points to get pinch ratio and new width and height\n    var contentStartPos = self.contentStartPos;\n\n    var currentWidth = contentStartPos.width;\n    var currentHeight = contentStartPos.height;\n\n    var currentOffsetX = contentStartPos.left;\n    var currentOffsetY = contentStartPos.top;\n\n    var endDistanceBetweenFingers = distance(self.newPoints[0], self.newPoints[1]);\n\n    var pinchRatio = endDistanceBetweenFingers / self.startDistanceBetweenFingers;\n\n    var newWidth = Math.floor(currentWidth * pinchRatio);\n    var newHeight = Math.floor(currentHeight * pinchRatio);\n\n    // This is the translation due to pinch-zooming\n    var translateFromZoomingX = (currentWidth - newWidth) * self.percentageOfImageAtPinchPointX;\n    var translateFromZoomingY = (currentHeight - newHeight) * self.percentageOfImageAtPinchPointY;\n\n    // Point between the two touches\n    var centerPointEndX = (self.newPoints[0].x + self.newPoints[1].x) / 2 - $(window).scrollLeft();\n    var centerPointEndY = (self.newPoints[0].y + self.newPoints[1].y) / 2 - $(window).scrollTop();\n\n    // And this is the translation due to translation of the centerpoint\n    // between the two fingers\n    var translateFromTranslatingX = centerPointEndX - self.centerPointStartX;\n    var translateFromTranslatingY = centerPointEndY - self.centerPointStartY;\n\n    // The new offset is the old/current one plus the total translation\n    var newOffsetX = currentOffsetX + (translateFromZoomingX + translateFromTranslatingX);\n    var newOffsetY = currentOffsetY + (translateFromZoomingY + translateFromTranslatingY);\n\n    var newPos = {\n      top: newOffsetY,\n      left: newOffsetX,\n      scaleX: pinchRatio,\n      scaleY: pinchRatio\n    };\n\n    self.canTap = false;\n\n    self.newWidth = newWidth;\n    self.newHeight = newHeight;\n\n    self.contentLastPos = newPos;\n\n    if (self.requestId) {\n      cancelAFrame(self.requestId);\n    }\n\n    self.requestId = requestAFrame(function () {\n      $.fancybox.setTranslate(self.$content, self.contentLastPos);\n    });\n  };\n\n  Guestures.prototype.ontouchend = function (e) {\n    var self = this;\n\n    var swiping = self.isSwiping;\n    var panning = self.isPanning;\n    var zooming = self.isZooming;\n    var scrolling = self.isScrolling;\n\n    self.endPoints = getPointerXY(e);\n    self.dMs = Math.max(new Date().getTime() - self.startTime, 1);\n\n    self.$container.removeClass(\"fancybox-is-grabbing\");\n\n    $(document).off(\".fb.touch\");\n\n    document.removeEventListener(\"scroll\", self.onscroll, true);\n\n    if (self.requestId) {\n      cancelAFrame(self.requestId);\n\n      self.requestId = null;\n    }\n\n    self.isSwiping = false;\n    self.isPanning = false;\n    self.isZooming = false;\n    self.isScrolling = false;\n\n    self.instance.isDragging = false;\n\n    if (self.canTap) {\n      return self.onTap(e);\n    }\n\n    self.speed = 100;\n\n    // Speed in px/ms\n    self.velocityX = (self.distanceX / self.dMs) * 0.5;\n    self.velocityY = (self.distanceY / self.dMs) * 0.5;\n\n    if (panning) {\n      self.endPanning();\n    } else if (zooming) {\n      self.endZooming();\n    } else {\n      self.endSwiping(swiping, scrolling);\n    }\n\n    return;\n  };\n\n  Guestures.prototype.endSwiping = function (swiping, scrolling) {\n    var self = this,\n      ret = false,\n      len = self.instance.group.length,\n      distanceX = Math.abs(self.distanceX),\n      canAdvance = swiping == \"x\" && len > 1 && ((self.dMs > 130 && distanceX > 10) || distanceX > 50),\n      speedX = 300;\n\n    self.sliderLastPos = null;\n\n    // Close if swiped vertically / navigate if horizontally\n    if (swiping == \"y\" && !scrolling && Math.abs(self.distanceY) > 50) {\n      // Continue vertical movement\n      $.fancybox.animate(\n        self.instance.current.$slide, {\n          top: self.sliderStartPos.top + self.distanceY + self.velocityY * 150,\n          opacity: 0\n        },\n        200\n      );\n      ret = self.instance.close(true, 250);\n    } else if (canAdvance && self.distanceX > 0) {\n      ret = self.instance.previous(speedX);\n    } else if (canAdvance && self.distanceX < 0) {\n      ret = self.instance.next(speedX);\n    }\n\n    if (ret === false && (swiping == \"x\" || swiping == \"y\")) {\n      self.instance.centerSlide(200);\n    }\n\n    self.$container.removeClass(\"fancybox-is-sliding\");\n  };\n\n  // Limit panning from edges\n  // ========================\n  Guestures.prototype.endPanning = function () {\n    var self = this,\n      newOffsetX,\n      newOffsetY,\n      newPos;\n\n    if (!self.contentLastPos) {\n      return;\n    }\n\n    if (self.opts.momentum === false || self.dMs > 350) {\n      newOffsetX = self.contentLastPos.left;\n      newOffsetY = self.contentLastPos.top;\n    } else {\n      // Continue movement\n      newOffsetX = self.contentLastPos.left + self.velocityX * 500;\n      newOffsetY = self.contentLastPos.top + self.velocityY * 500;\n    }\n\n    newPos = self.limitPosition(newOffsetX, newOffsetY, self.contentStartPos.width, self.contentStartPos.height);\n\n    newPos.width = self.contentStartPos.width;\n    newPos.height = self.contentStartPos.height;\n\n    $.fancybox.animate(self.$content, newPos, 366);\n  };\n\n  Guestures.prototype.endZooming = function () {\n    var self = this;\n\n    var current = self.instance.current;\n\n    var newOffsetX, newOffsetY, newPos, reset;\n\n    var newWidth = self.newWidth;\n    var newHeight = self.newHeight;\n\n    if (!self.contentLastPos) {\n      return;\n    }\n\n    newOffsetX = self.contentLastPos.left;\n    newOffsetY = self.contentLastPos.top;\n\n    reset = {\n      top: newOffsetY,\n      left: newOffsetX,\n      width: newWidth,\n      height: newHeight,\n      scaleX: 1,\n      scaleY: 1\n    };\n\n    // Reset scalex/scaleY values; this helps for perfomance and does not break animation\n    $.fancybox.setTranslate(self.$content, reset);\n\n    if (newWidth < self.canvasWidth && newHeight < self.canvasHeight) {\n      self.instance.scaleToFit(150);\n    } else if (newWidth > current.width || newHeight > current.height) {\n      self.instance.scaleToActual(self.centerPointStartX, self.centerPointStartY, 150);\n    } else {\n      newPos = self.limitPosition(newOffsetX, newOffsetY, newWidth, newHeight);\n\n      $.fancybox.animate(self.$content, newPos, 150);\n    }\n  };\n\n  Guestures.prototype.onTap = function (e) {\n    var self = this;\n    var $target = $(e.target);\n\n    var instance = self.instance;\n    var current = instance.current;\n\n    var endPoints = (e && getPointerXY(e)) || self.startPoints;\n\n    var tapX = endPoints[0] ? endPoints[0].x - $(window).scrollLeft() - self.stagePos.left : 0;\n    var tapY = endPoints[0] ? endPoints[0].y - $(window).scrollTop() - self.stagePos.top : 0;\n\n    var where;\n\n    var process = function (prefix) {\n      var action = current.opts[prefix];\n\n      if ($.isFunction(action)) {\n        action = action.apply(instance, [current, e]);\n      }\n\n      if (!action) {\n        return;\n      }\n\n      switch (action) {\n        case \"close\":\n          instance.close(self.startEvent);\n\n          break;\n\n        case \"toggleControls\":\n          instance.toggleControls();\n\n          break;\n\n        case \"next\":\n          instance.next();\n\n          break;\n\n        case \"nextOrClose\":\n          if (instance.group.length > 1) {\n            instance.next();\n          } else {\n            instance.close(self.startEvent);\n          }\n\n          break;\n\n        case \"zoom\":\n          if (current.type == \"image\" && (current.isLoaded || current.$ghost)) {\n            if (instance.canPan()) {\n              instance.scaleToFit();\n            } else if (instance.isScaledDown()) {\n              instance.scaleToActual(tapX, tapY);\n            } else if (instance.group.length < 2) {\n              instance.close(self.startEvent);\n            }\n          }\n\n          break;\n      }\n    };\n\n    // Ignore right click\n    if (e.originalEvent && e.originalEvent.button == 2) {\n      return;\n    }\n\n    // Skip if clicked on the scrollbar\n    if (!$target.is(\"img\") && tapX > $target[0].clientWidth + $target.offset().left) {\n      return;\n    }\n\n    // Check where is clicked\n    if ($target.is(\".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container\")) {\n      where = \"Outside\";\n    } else if ($target.is(\".fancybox-slide\")) {\n      where = \"Slide\";\n    } else if (\n      instance.current.$content &&\n      instance.current.$content\n      .find($target)\n      .addBack()\n      .filter($target).length\n    ) {\n      where = \"Content\";\n    } else {\n      return;\n    }\n\n    // Check if this is a double tap\n    if (self.tapped) {\n      // Stop previously created single tap\n      clearTimeout(self.tapped);\n      self.tapped = null;\n\n      // Skip if distance between taps is too big\n      if (Math.abs(tapX - self.tapX) > 50 || Math.abs(tapY - self.tapY) > 50) {\n        return this;\n      }\n\n      // OK, now we assume that this is a double-tap\n      process(\"dblclick\" + where);\n    } else {\n      // Single tap will be processed if user has not clicked second time within 300ms\n      // or there is no need to wait for double-tap\n      self.tapX = tapX;\n      self.tapY = tapY;\n\n      if (current.opts[\"dblclick\" + where] && current.opts[\"dblclick\" + where] !== current.opts[\"click\" + where]) {\n        self.tapped = setTimeout(function () {\n          self.tapped = null;\n\n          if (!instance.isAnimating) {\n            process(\"click\" + where);\n          }\n        }, 500);\n      } else {\n        process(\"click\" + where);\n      }\n    }\n\n    return this;\n  };\n\n  $(document)\n    .on(\"onActivate.fb\", function (e, instance) {\n      if (instance && !instance.Guestures) {\n        instance.Guestures = new Guestures(instance);\n      }\n    })\n    .on(\"beforeClose.fb\", function (e, instance) {\n      if (instance && instance.Guestures) {\n        instance.Guestures.destroy();\n      }\n    });\n})(window, document, jQuery);\n// ==========================================================================\n//\n// SlideShow\n// Enables slideshow functionality\n//\n// Example of usage:\n// $.fancybox.getInstance().SlideShow.start()\n//\n// ==========================================================================\n(function (document, $) {\n  \"use strict\";\n\n  $.extend(true, $.fancybox.defaults, {\n    btnTpl: {\n      slideShow: '<button data-fancybox-play class=\"fancybox-button fancybox-button--play\" title=\"{{PLAY_START}}\">' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M6.5 5.4v13.2l11-6.6z\"/></svg>' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z\"/></svg>' +\n        \"</button>\"\n    },\n    slideShow: {\n      autoStart: false,\n      speed: 3000,\n      progress: true\n    }\n  });\n\n  var SlideShow = function (instance) {\n    this.instance = instance;\n    this.init();\n  };\n\n  $.extend(SlideShow.prototype, {\n    timer: null,\n    isActive: false,\n    $button: null,\n\n    init: function () {\n      var self = this,\n        instance = self.instance,\n        opts = instance.group[instance.currIndex].opts.slideShow;\n\n      self.$button = instance.$refs.toolbar.find(\"[data-fancybox-play]\").on(\"click\", function () {\n        self.toggle();\n      });\n\n      if (instance.group.length < 2 || !opts) {\n        self.$button.hide();\n      } else if (opts.progress) {\n        self.$progress = $('<div class=\"fancybox-progress\"></div>').appendTo(instance.$refs.inner);\n      }\n    },\n\n    set: function (force) {\n      var self = this,\n        instance = self.instance,\n        current = instance.current;\n\n      // Check if reached last element\n      if (current && (force === true || current.opts.loop || instance.currIndex < instance.group.length - 1)) {\n        if (self.isActive && current.contentType !== \"video\") {\n          if (self.$progress) {\n            $.fancybox.animate(self.$progress.show(), {\n              scaleX: 1\n            }, current.opts.slideShow.speed);\n          }\n\n          self.timer = setTimeout(function () {\n            if (!instance.current.opts.loop && instance.current.index == instance.group.length - 1) {\n              instance.jumpTo(0);\n            } else {\n              instance.next();\n            }\n          }, current.opts.slideShow.speed);\n        }\n      } else {\n        self.stop();\n        instance.idleSecondsCounter = 0;\n        instance.showControls();\n      }\n    },\n\n    clear: function () {\n      var self = this;\n\n      clearTimeout(self.timer);\n\n      self.timer = null;\n\n      if (self.$progress) {\n        self.$progress.removeAttr(\"style\").hide();\n      }\n    },\n\n    start: function () {\n      var self = this,\n        current = self.instance.current;\n\n      if (current) {\n        self.$button\n          .attr(\"title\", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_STOP)\n          .removeClass(\"fancybox-button--play\")\n          .addClass(\"fancybox-button--pause\");\n\n        self.isActive = true;\n\n        if (current.isComplete) {\n          self.set(true);\n        }\n\n        self.instance.trigger(\"onSlideShowChange\", true);\n      }\n    },\n\n    stop: function () {\n      var self = this,\n        current = self.instance.current;\n\n      self.clear();\n\n      self.$button\n        .attr(\"title\", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_START)\n        .removeClass(\"fancybox-button--pause\")\n        .addClass(\"fancybox-button--play\");\n\n      self.isActive = false;\n\n      self.instance.trigger(\"onSlideShowChange\", false);\n\n      if (self.$progress) {\n        self.$progress.removeAttr(\"style\").hide();\n      }\n    },\n\n    toggle: function () {\n      var self = this;\n\n      if (self.isActive) {\n        self.stop();\n      } else {\n        self.start();\n      }\n    }\n  });\n\n  $(document).on({\n    \"onInit.fb\": function (e, instance) {\n      if (instance && !instance.SlideShow) {\n        instance.SlideShow = new SlideShow(instance);\n      }\n    },\n\n    \"beforeShow.fb\": function (e, instance, current, firstRun) {\n      var SlideShow = instance && instance.SlideShow;\n\n      if (firstRun) {\n        if (SlideShow && current.opts.slideShow.autoStart) {\n          SlideShow.start();\n        }\n      } else if (SlideShow && SlideShow.isActive) {\n        SlideShow.clear();\n      }\n    },\n\n    \"afterShow.fb\": function (e, instance, current) {\n      var SlideShow = instance && instance.SlideShow;\n\n      if (SlideShow && SlideShow.isActive) {\n        SlideShow.set();\n      }\n    },\n\n    \"afterKeydown.fb\": function (e, instance, current, keypress, keycode) {\n      var SlideShow = instance && instance.SlideShow;\n\n      // \"P\" or Spacebar\n      if (SlideShow && current.opts.slideShow && (keycode === 80 || keycode === 32) && !$(document.activeElement).is(\"button,a,input\")) {\n        keypress.preventDefault();\n\n        SlideShow.toggle();\n      }\n    },\n\n    \"beforeClose.fb onDeactivate.fb\": function (e, instance) {\n      var SlideShow = instance && instance.SlideShow;\n\n      if (SlideShow) {\n        SlideShow.stop();\n      }\n    }\n  });\n\n  // Page Visibility API to pause slideshow when window is not active\n  $(document).on(\"visibilitychange\", function () {\n    var instance = $.fancybox.getInstance(),\n      SlideShow = instance && instance.SlideShow;\n\n    if (SlideShow && SlideShow.isActive) {\n      if (document.hidden) {\n        SlideShow.clear();\n      } else {\n        SlideShow.set();\n      }\n    }\n  });\n})(document, jQuery);\n// ==========================================================================\n//\n// FullScreen\n// Adds fullscreen functionality\n//\n// ==========================================================================\n(function (document, $) {\n  \"use strict\";\n\n  // Collection of methods supported by user browser\n  var fn = (function () {\n    var fnMap = [\n      [\"requestFullscreen\", \"exitFullscreen\", \"fullscreenElement\", \"fullscreenEnabled\", \"fullscreenchange\", \"fullscreenerror\"],\n      // new WebKit\n      [\n        \"webkitRequestFullscreen\",\n        \"webkitExitFullscreen\",\n        \"webkitFullscreenElement\",\n        \"webkitFullscreenEnabled\",\n        \"webkitfullscreenchange\",\n        \"webkitfullscreenerror\"\n      ],\n      // old WebKit (Safari 5.1)\n      [\n        \"webkitRequestFullScreen\",\n        \"webkitCancelFullScreen\",\n        \"webkitCurrentFullScreenElement\",\n        \"webkitCancelFullScreen\",\n        \"webkitfullscreenchange\",\n        \"webkitfullscreenerror\"\n      ],\n      [\n        \"mozRequestFullScreen\",\n        \"mozCancelFullScreen\",\n        \"mozFullScreenElement\",\n        \"mozFullScreenEnabled\",\n        \"mozfullscreenchange\",\n        \"mozfullscreenerror\"\n      ],\n      [\"msRequestFullscreen\", \"msExitFullscreen\", \"msFullscreenElement\", \"msFullscreenEnabled\", \"MSFullscreenChange\", \"MSFullscreenError\"]\n    ];\n\n    var ret = {};\n\n    for (var i = 0; i < fnMap.length; i++) {\n      var val = fnMap[i];\n\n      if (val && val[1] in document) {\n        for (var j = 0; j < val.length; j++) {\n          ret[fnMap[0][j]] = val[j];\n        }\n\n        return ret;\n      }\n    }\n\n    return false;\n  })();\n\n  if (fn) {\n    var FullScreen = {\n      request: function (elem) {\n        elem = elem || document.documentElement;\n\n        elem[fn.requestFullscreen](elem.ALLOW_KEYBOARD_INPUT);\n      },\n      exit: function () {\n        document[fn.exitFullscreen]();\n      },\n      toggle: function (elem) {\n        elem = elem || document.documentElement;\n\n        if (this.isFullscreen()) {\n          this.exit();\n        } else {\n          this.request(elem);\n        }\n      },\n      isFullscreen: function () {\n        return Boolean(document[fn.fullscreenElement]);\n      },\n      enabled: function () {\n        return Boolean(document[fn.fullscreenEnabled]);\n      }\n    };\n\n    $.extend(true, $.fancybox.defaults, {\n      btnTpl: {\n        fullScreen: '<button data-fancybox-fullscreen class=\"fancybox-button fancybox-button--fsenter\" title=\"{{FULL_SCREEN}}\">' +\n          '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z\"/></svg>' +\n          '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z\"/></svg>' +\n          \"</button>\"\n      },\n      fullScreen: {\n        autoStart: false\n      }\n    });\n\n    $(document).on(fn.fullscreenchange, function () {\n      var isFullscreen = FullScreen.isFullscreen(),\n        instance = $.fancybox.getInstance();\n\n      if (instance) {\n        // If image is zooming, then force to stop and reposition properly\n        if (instance.current && instance.current.type === \"image\" && instance.isAnimating) {\n          instance.isAnimating = false;\n\n          instance.update(true, true, 0);\n\n          if (!instance.isComplete) {\n            instance.complete();\n          }\n        }\n\n        instance.trigger(\"onFullscreenChange\", isFullscreen);\n\n        instance.$refs.container.toggleClass(\"fancybox-is-fullscreen\", isFullscreen);\n\n        instance.$refs.toolbar\n          .find(\"[data-fancybox-fullscreen]\")\n          .toggleClass(\"fancybox-button--fsenter\", !isFullscreen)\n          .toggleClass(\"fancybox-button--fsexit\", isFullscreen);\n      }\n    });\n  }\n\n  $(document).on({\n    \"onInit.fb\": function (e, instance) {\n      var $container;\n\n      if (!fn) {\n        instance.$refs.toolbar.find(\"[data-fancybox-fullscreen]\").remove();\n\n        return;\n      }\n\n      if (instance && instance.group[instance.currIndex].opts.fullScreen) {\n        $container = instance.$refs.container;\n\n        $container.on(\"click.fb-fullscreen\", \"[data-fancybox-fullscreen]\", function (e) {\n          e.stopPropagation();\n          e.preventDefault();\n\n          FullScreen.toggle();\n        });\n\n        if (instance.opts.fullScreen && instance.opts.fullScreen.autoStart === true) {\n          FullScreen.request();\n        }\n\n        // Expose API\n        instance.FullScreen = FullScreen;\n      } else if (instance) {\n        instance.$refs.toolbar.find(\"[data-fancybox-fullscreen]\").hide();\n      }\n    },\n\n    \"afterKeydown.fb\": function (e, instance, current, keypress, keycode) {\n      // \"F\"\n      if (instance && instance.FullScreen && keycode === 70) {\n        keypress.preventDefault();\n\n        instance.FullScreen.toggle();\n      }\n    },\n\n    \"beforeClose.fb\": function (e, instance) {\n      if (instance && instance.FullScreen && instance.$refs.container.hasClass(\"fancybox-is-fullscreen\")) {\n        FullScreen.exit();\n      }\n    }\n  });\n})(document, jQuery);\n// ==========================================================================\n//\n// Thumbs\n// Displays thumbnails in a grid\n//\n// ==========================================================================\n(function (document, $) {\n  \"use strict\";\n\n  var CLASS = \"fancybox-thumbs\",\n    CLASS_ACTIVE = CLASS + \"-active\";\n\n  // Make sure there are default values\n  $.fancybox.defaults = $.extend(\n    true, {\n      btnTpl: {\n        thumbs: '<button data-fancybox-thumbs class=\"fancybox-button fancybox-button--thumbs\" title=\"{{THUMBS}}\">' +\n          '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z\"/></svg>' +\n          \"</button>\"\n      },\n      thumbs: {\n        autoStart: false, // Display thumbnails on opening\n        hideOnClose: true, // Hide thumbnail grid when closing animation starts\n        parentEl: \".fancybox-container\", // Container is injected into this element\n        axis: \"y\" // Vertical (y) or horizontal (x) scrolling\n      }\n    },\n    $.fancybox.defaults\n  );\n\n  var FancyThumbs = function (instance) {\n    this.init(instance);\n  };\n\n  $.extend(FancyThumbs.prototype, {\n    $button: null,\n    $grid: null,\n    $list: null,\n    isVisible: false,\n    isActive: false,\n\n    init: function (instance) {\n      var self = this,\n        group = instance.group,\n        enabled = 0;\n\n      self.instance = instance;\n      self.opts = group[instance.currIndex].opts.thumbs;\n\n      instance.Thumbs = self;\n\n      self.$button = instance.$refs.toolbar.find(\"[data-fancybox-thumbs]\");\n\n      // Enable thumbs if at least two group items have thumbnails\n      for (var i = 0, len = group.length; i < len; i++) {\n        if (group[i].thumb) {\n          enabled++;\n        }\n\n        if (enabled > 1) {\n          break;\n        }\n      }\n\n      if (enabled > 1 && !!self.opts) {\n        self.$button.removeAttr(\"style\").on(\"click\", function () {\n          self.toggle();\n        });\n\n        self.isActive = true;\n      } else {\n        self.$button.hide();\n      }\n    },\n\n    create: function () {\n      var self = this,\n        instance = self.instance,\n        parentEl = self.opts.parentEl,\n        list = [],\n        src;\n\n      if (!self.$grid) {\n        // Create main element\n        self.$grid = $('<div class=\"' + CLASS + \" \" + CLASS + \"-\" + self.opts.axis + '\"></div>').appendTo(\n          instance.$refs.container\n          .find(parentEl)\n          .addBack()\n          .filter(parentEl)\n        );\n\n        // Add \"click\" event that performs gallery navigation\n        self.$grid.on(\"click\", \"a\", function () {\n          instance.jumpTo($(this).attr(\"data-index\"));\n        });\n      }\n\n      // Build the list\n      if (!self.$list) {\n        self.$list = $('<div class=\"' + CLASS + '__list\">').appendTo(self.$grid);\n      }\n\n      $.each(instance.group, function (i, item) {\n        src = item.thumb;\n\n        if (!src && item.type === \"image\") {\n          src = item.src;\n        }\n\n        list.push(\n          '<a href=\"javascript:;\" tabindex=\"0\" data-index=\"' +\n          i +\n          '\"' +\n          (src && src.length ? ' style=\"background-image:url(' + src + ')\"' : 'class=\"fancybox-thumbs-missing\"') +\n          \"></a>\"\n        );\n      });\n\n      self.$list[0].innerHTML = list.join(\"\");\n\n      if (self.opts.axis === \"x\") {\n        // Set fixed width for list element to enable horizontal scrolling\n        self.$list.width(\n          parseInt(self.$grid.css(\"padding-right\"), 10) +\n          instance.group.length *\n          self.$list\n          .children()\n          .eq(0)\n          .outerWidth(true)\n        );\n      }\n    },\n\n    focus: function (duration) {\n      var self = this,\n        $list = self.$list,\n        $grid = self.$grid,\n        thumb,\n        thumbPos;\n\n      if (!self.instance.current) {\n        return;\n      }\n\n      thumb = $list\n        .children()\n        .removeClass(CLASS_ACTIVE)\n        .filter('[data-index=\"' + self.instance.current.index + '\"]')\n        .addClass(CLASS_ACTIVE);\n\n      thumbPos = thumb.position();\n\n      // Check if need to scroll to make current thumb visible\n      if (self.opts.axis === \"y\" && (thumbPos.top < 0 || thumbPos.top > $list.height() - thumb.outerHeight())) {\n        $list.stop().animate({\n            scrollTop: $list.scrollTop() + thumbPos.top\n          },\n          duration\n        );\n      } else if (\n        self.opts.axis === \"x\" &&\n        (thumbPos.left < $grid.scrollLeft() || thumbPos.left > $grid.scrollLeft() + ($grid.width() - thumb.outerWidth()))\n      ) {\n        $list\n          .parent()\n          .stop()\n          .animate({\n              scrollLeft: thumbPos.left\n            },\n            duration\n          );\n      }\n    },\n\n    update: function () {\n      var that = this;\n      that.instance.$refs.container.toggleClass(\"fancybox-show-thumbs\", this.isVisible);\n\n      if (that.isVisible) {\n        if (!that.$grid) {\n          that.create();\n        }\n\n        that.instance.trigger(\"onThumbsShow\");\n\n        that.focus(0);\n      } else if (that.$grid) {\n        that.instance.trigger(\"onThumbsHide\");\n      }\n\n      // Update content position\n      that.instance.update();\n    },\n\n    hide: function () {\n      this.isVisible = false;\n      this.update();\n    },\n\n    show: function () {\n      this.isVisible = true;\n      this.update();\n    },\n\n    toggle: function () {\n      this.isVisible = !this.isVisible;\n      this.update();\n    }\n  });\n\n  $(document).on({\n    \"onInit.fb\": function (e, instance) {\n      var Thumbs;\n\n      if (instance && !instance.Thumbs) {\n        Thumbs = new FancyThumbs(instance);\n\n        if (Thumbs.isActive && Thumbs.opts.autoStart === true) {\n          Thumbs.show();\n        }\n      }\n    },\n\n    \"beforeShow.fb\": function (e, instance, item, firstRun) {\n      var Thumbs = instance && instance.Thumbs;\n\n      if (Thumbs && Thumbs.isVisible) {\n        Thumbs.focus(firstRun ? 0 : 250);\n      }\n    },\n\n    \"afterKeydown.fb\": function (e, instance, current, keypress, keycode) {\n      var Thumbs = instance && instance.Thumbs;\n\n      // \"G\"\n      if (Thumbs && Thumbs.isActive && keycode === 71) {\n        keypress.preventDefault();\n\n        Thumbs.toggle();\n      }\n    },\n\n    \"beforeClose.fb\": function (e, instance) {\n      var Thumbs = instance && instance.Thumbs;\n\n      if (Thumbs && Thumbs.isVisible && Thumbs.opts.hideOnClose !== false) {\n        Thumbs.$grid.hide();\n      }\n    }\n  });\n})(document, jQuery);\n//// ==========================================================================\n//\n// Share\n// Displays simple form for sharing current url\n//\n// ==========================================================================\n(function (document, $) {\n  \"use strict\";\n\n  $.extend(true, $.fancybox.defaults, {\n    btnTpl: {\n      share: '<button data-fancybox-share class=\"fancybox-button fancybox-button--share\" title=\"{{SHARE}}\">' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z\"/></svg>' +\n        \"</button>\"\n    },\n    share: {\n      url: function (instance, item) {\n        return (\n          (!instance.currentHash && !(item.type === \"inline\" || item.type === \"html\") ? item.origSrc || item.src : false) || window.location\n        );\n      },\n      tpl: '<div class=\"fancybox-share\">' +\n        \"<h1>{{SHARE}}</h1>\" +\n        \"<p>\" +\n        '<a class=\"fancybox-share__button fancybox-share__button--fb\" href=\"https://www.facebook.com/sharer/sharer.php?u={{url}}\">' +\n        '<svg viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196\" /></svg>' +\n        \"<span>Facebook</span>\" +\n        \"</a>\" +\n        '<a class=\"fancybox-share__button fancybox-share__button--tw\" href=\"https://twitter.com/intent/tweet?url={{url}}&text={{descr}}\">' +\n        '<svg viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z\" /></svg>' +\n        \"<span>Twitter</span>\" +\n        \"</a>\" +\n        '<a class=\"fancybox-share__button fancybox-share__button--pt\" href=\"https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}\">' +\n        '<svg viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z\" fill=\"#fff\"/></svg>' +\n        \"<span>Pinterest</span>\" +\n        \"</a>\" +\n        \"</p>\" +\n        '<p><input class=\"fancybox-share__input\" type=\"text\" value=\"{{url_raw}}\" onclick=\"select()\" /></p>' +\n        \"</div>\"\n    }\n  });\n\n  function escapeHtml(string) {\n    var entityMap = {\n      \"&\": \"&amp;\",\n      \"<\": \"&lt;\",\n      \">\": \"&gt;\",\n      '\"': \"&quot;\",\n      \"'\": \"&#39;\",\n      \"/\": \"&#x2F;\",\n      \"`\": \"&#x60;\",\n      \"=\": \"&#x3D;\"\n    };\n\n    return String(string).replace(/[&<>\"'`=\\/]/g, function (s) {\n      return entityMap[s];\n    });\n  }\n\n  $(document).on(\"click\", \"[data-fancybox-share]\", function () {\n    var instance = $.fancybox.getInstance(),\n      current = instance.current || null,\n      url,\n      tpl;\n\n    if (!current) {\n      return;\n    }\n\n    if ($.type(current.opts.share.url) === \"function\") {\n      url = current.opts.share.url.apply(current, [instance, current]);\n    }\n\n    tpl = current.opts.share.tpl\n      .replace(/\\{\\{media\\}\\}/g, current.type === \"image\" ? encodeURIComponent(current.src) : \"\")\n      .replace(/\\{\\{url\\}\\}/g, encodeURIComponent(url))\n      .replace(/\\{\\{url_raw\\}\\}/g, escapeHtml(url))\n      .replace(/\\{\\{descr\\}\\}/g, instance.$caption ? encodeURIComponent(instance.$caption.text()) : \"\");\n\n    $.fancybox.open({\n      src: instance.translate(instance, tpl),\n      type: \"html\",\n      opts: {\n        touch: false,\n        animationEffect: false,\n        afterLoad: function (shareInstance, shareCurrent) {\n          // Close self if parent instance is closing\n          instance.$refs.container.one(\"beforeClose.fb\", function () {\n            shareInstance.close(null, 0);\n          });\n\n          // Opening links in a popup window\n          shareCurrent.$content.find(\".fancybox-share__button\").click(function () {\n            window.open(this.href, \"Share\", \"width=550, height=450\");\n            return false;\n          });\n        },\n        mobile: {\n          autoFocus: false\n        }\n      }\n    });\n  });\n})(document, jQuery);\n// ==========================================================================\n//\n// Hash\n// Enables linking to each modal\n//\n// ==========================================================================\n(function (window, document, $) {\n  \"use strict\";\n\n  // Simple $.escapeSelector polyfill (for jQuery prior v3)\n  if (!$.escapeSelector) {\n    $.escapeSelector = function (sel) {\n      var rcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\x80-\\uFFFF\\w-]/g;\n      var fcssescape = function (ch, asCodePoint) {\n        if (asCodePoint) {\n          // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n          if (ch === \"\\0\") {\n            return \"\\uFFFD\";\n          }\n\n          // Control characters and (dependent upon position) numbers get escaped as code points\n          return ch.slice(0, -1) + \"\\\\\" + ch.charCodeAt(ch.length - 1).toString(16) + \" \";\n        }\n\n        // Other potentially-special ASCII characters get backslash-escaped\n        return \"\\\\\" + ch;\n      };\n\n      return (sel + \"\").replace(rcssescape, fcssescape);\n    };\n  }\n\n  // Get info about gallery name and current index from url\n  function parseUrl() {\n    var hash = window.location.hash.substr(1),\n      rez = hash.split(\"-\"),\n      index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n      gallery = rez.join(\"-\");\n\n    return {\n      hash: hash,\n      /* Index is starting from 1 */\n      index: index < 1 ? 1 : index,\n      gallery: gallery\n    };\n  }\n\n  // Trigger click evnt on links to open new fancyBox instance\n  function triggerFromUrl(url) {\n    if (url.gallery !== \"\") {\n      // If we can find element matching 'data-fancybox' atribute,\n      // then triggering click event should start fancyBox\n      $(\"[data-fancybox='\" + $.escapeSelector(url.gallery) + \"']\")\n        .eq(url.index - 1)\n        .focus()\n        .trigger(\"click.fb-start\");\n    }\n  }\n\n  // Get gallery name from current instance\n  function getGalleryID(instance) {\n    var opts, ret;\n\n    if (!instance) {\n      return false;\n    }\n\n    opts = instance.current ? instance.current.opts : instance.opts;\n    ret = opts.hash || (opts.$orig ? opts.$orig.data(\"fancybox\") || opts.$orig.data(\"fancybox-trigger\") : \"\");\n\n    return ret === \"\" ? false : ret;\n  }\n\n  // Start when DOM becomes ready\n  $(function () {\n    // Check if user has disabled this module\n    if ($.fancybox.defaults.hash === false) {\n      return;\n    }\n\n    // Update hash when opening/closing fancyBox\n    $(document).on({\n      \"onInit.fb\": function (e, instance) {\n        var url, gallery;\n\n        if (instance.group[instance.currIndex].opts.hash === false) {\n          return;\n        }\n\n        url = parseUrl();\n        gallery = getGalleryID(instance);\n\n        // Make sure gallery start index matches index from hash\n        if (gallery && url.gallery && gallery == url.gallery) {\n          instance.currIndex = url.index - 1;\n        }\n      },\n\n      \"beforeShow.fb\": function (e, instance, current, firstRun) {\n        var gallery;\n\n        if (!current || current.opts.hash === false) {\n          return;\n        }\n\n        // Check if need to update window hash\n        gallery = getGalleryID(instance);\n\n        if (!gallery) {\n          return;\n        }\n\n        // Variable containing last hash value set by fancyBox\n        // It will be used to determine if fancyBox needs to close after hash change is detected\n        instance.currentHash = gallery + (instance.group.length > 1 ? \"-\" + (current.index + 1) : \"\");\n\n        // If current hash is the same (this instance most likely is opened by hashchange), then do nothing\n        if (window.location.hash === \"#\" + instance.currentHash) {\n          return;\n        }\n\n        if (firstRun && !instance.origHash) {\n          instance.origHash = window.location.hash;\n        }\n\n        if (instance.hashTimer) {\n          clearTimeout(instance.hashTimer);\n        }\n\n        // Update hash\n        instance.hashTimer = setTimeout(function () {\n          if (\"replaceState\" in window.history) {\n            window.history[firstRun ? \"pushState\" : \"replaceState\"]({},\n              document.title,\n              window.location.pathname + window.location.search + \"#\" + instance.currentHash\n            );\n\n            if (firstRun) {\n              instance.hasCreatedHistory = true;\n            }\n          } else {\n            window.location.hash = instance.currentHash;\n          }\n\n          instance.hashTimer = null;\n        }, 300);\n      },\n\n      \"beforeClose.fb\": function (e, instance, current) {\n        if (!current || current.opts.hash === false) {\n          return;\n        }\n\n        clearTimeout(instance.hashTimer);\n\n        // Goto previous history entry\n        if (instance.currentHash && instance.hasCreatedHistory) {\n          window.history.back();\n        } else if (instance.currentHash) {\n          if (\"replaceState\" in window.history) {\n            window.history.replaceState({}, document.title, window.location.pathname + window.location.search + (instance.origHash || \"\"));\n          } else {\n            window.location.hash = instance.origHash;\n          }\n        }\n\n        instance.currentHash = null;\n      }\n    });\n\n    // Check if need to start/close after url has changed\n    $(window).on(\"hashchange.fb\", function () {\n      var url = parseUrl(),\n        fb = null;\n\n      // Find last fancyBox instance that has \"hash\"\n      $.each(\n        $(\".fancybox-container\")\n        .get()\n        .reverse(),\n        function (index, value) {\n          var tmp = $(value).data(\"FancyBox\");\n\n          if (tmp && tmp.currentHash) {\n            fb = tmp;\n            return false;\n          }\n        }\n      );\n\n      if (fb) {\n        // Now, compare hash values\n        if (fb.currentHash !== url.gallery + \"-\" + url.index && !(url.index === 1 && fb.currentHash == url.gallery)) {\n          fb.currentHash = null;\n\n          fb.close();\n        }\n      } else if (url.gallery !== \"\") {\n        triggerFromUrl(url);\n      }\n    });\n\n    // Check current hash and trigger click event on matching element to start fancyBox, if needed\n    setTimeout(function () {\n      if (!$.fancybox.getInstance()) {\n        triggerFromUrl(parseUrl());\n      }\n    }, 50);\n  });\n})(window, document, jQuery);\n// ==========================================================================\n//\n// Wheel\n// Basic mouse weheel support for gallery navigation\n//\n// ==========================================================================\n(function (document, $) {\n  \"use strict\";\n\n  var prevTime = new Date().getTime();\n\n  $(document).on({\n    \"onInit.fb\": function (e, instance, current) {\n      instance.$refs.stage.on(\"mousewheel DOMMouseScroll wheel MozMousePixelScroll\", function (e) {\n        var current = instance.current,\n          currTime = new Date().getTime();\n\n        if (instance.group.length < 2 || current.opts.wheel === false || (current.opts.wheel === \"auto\" && current.type !== \"image\")) {\n          return;\n        }\n\n        e.preventDefault();\n        e.stopPropagation();\n\n        if (current.$slide.hasClass(\"fancybox-animated\")) {\n          return;\n        }\n\n        e = e.originalEvent || e;\n\n        if (currTime - prevTime < 250) {\n          return;\n        }\n\n        prevTime = currTime;\n\n        instance[(-e.deltaY || -e.deltaX || e.wheelDelta || -e.detail) < 0 ? \"next\" : \"previous\"]();\n      });\n    }\n  });\n})(document, jQuery);"
  },
  {
    "path": "docs/index.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n\n  <title>fancybox3 · Documentation</title>\n\n  <!-- jQuery -->\n  <script src=\"https://code.jquery.com/jquery-3.3.1.min.js\" integrity=\"sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=\"\n    crossorigin=\"anonymous\"></script>\n\n  <!-- Bootstrap  -->\n  <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css\" integrity=\"sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm\"\n    crossorigin=\"anonymous\">\n  <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js\" integrity=\"sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl\"\n    crossorigin=\"anonymous\"></script>\n\n  <style>\na,\na:hover {\n    color: #ff5268;\n}\n\nh2 {\n    border-bottom: 1px solid rgba(0, 0, 0, .1);\n    margin-bottom: 2rem;\n    padding-bottom: 1rem;\n    padding-top: 2rem;\n}\n\nh3 {\n    font-size: 1.5rem;\n    margin-bottom: 1rem;\n    padding-top: 1.5rem;\n}\n\nh2 + h3 {\n    margin-top: -2rem;\n}\n\nh3 a,\nh3 a:hover {\n    color: currentColor;\n}\n\ncode {\n    background: #f1ecec;\n    color: #555;\n    padding: 2px 5px;\n}\n\npre {\n    background: #f1ecec;\n    color: #555;\n    max-height: 70vh;\n    overflow: auto;\n    padding: 1rem 1.5rem;\n    -moz-tab-size: 4;\n         tab-size: 4;\n}\n\npre code {\n    padding: 0;\n}\n\nsection {\n    margin-bottom: 1rem;\n    margin-bottom: 5vh;\n}\n\n#introduction {\n    background: #fbf9f9;\n    margin-bottom: 2rem;\n    padding-bottom: 1rem;\n    padding-top: 1rem;\n}\n\n.navbar-brand {\n    color: #444;\n    font-size: 1.375rem;\n}\n\n.navbar-brand svg {\n    position: relative;\n    top: -1px;\n    vertical-align: middle;\n}\n\n.navbar-brand svg path {\n    fill: #fff;\n    stroke: #444;\n    stroke-width: 2.5;\n}\n\n.nav-link {\n    color: grey;\n    height: 2.5rem;\n}\n\n.navbar-brand:hover,\n.nav-link:hover {\n    color: #464646;\n}\n\n.nav-link.active {\n    background: #ff5268;\n    border-radius: .25rem;\n    color: #fff;\n}\n\n.sticky {\n    padding-top: 2rem;\n    top: 0;\n}\n\n.sticky ul {\n    line-height: 2;\n    list-style: none;\n}\n\n.sticky > ul {\n    padding-left: 1rem;\n}\n\n.sticky a {\n    color: grey;\n    text-decoration: none;\n}\n\n.sticky a:hover {\n    color: #464646;\n}\n\n.sticky a.active {\n    color: #ff5268;\n}\n\n.demo {\n    font-size: 90%;\n    margin-bottom: 2rem;\n    text-align: right;\n}\n\npre ~ .demo {\n    margin-top: -1rem;\n}\n\n.badge-warning {\n    font-weight: 600;\n}\n\n  </style>\n</head>\n\n<body>\n  <div id=\"introduction\">\n    <div class=\"container\">\n      <nav class=\"navbar navbar-expand\">\n        <a class=\"navbar-brand py-0 mr-auto\" href=\"https://fancyapps.com/fancybox/3/\">\n          fancybox\n        </a>\n\n        <ul class=\"navbar-nav ml-auto\">\n          <li class=\"nav-item px-2 d-none d-md-block\">\n            <a class=\"nav-link\" href=\"https://fancyapps.com/fancybox/3/\">Home</a>\n          </li>\n          <li class=\"nav-item px-2 d-none d-md-block\">\n            <a class=\"nav-link active\" href=\"https://fancyapps.com/fancybox/3/docs/\">Documentation</a>\n          </li>\n          <li class=\"nav-item px-2\">\n            <a class=\"nav-link\" href=\"https://fancyapps.com/store/\">Store</a>\n          </li>\n          <li class=\"nav-item\">\n            <a class=\"nav-link\" href=\"https://github.com/fancyapps/fancybox\" target=\"_blank\">\n              <svg width=\"24\" height=\"24\" xmlns=\"http://www.w3.org/2000/svg\" aria-label=\"Github\" role=\"img\" viewBox=\"0 0 512 512\">\n                <rect fill=\"#444\" width=\"512\" height=\"512\" rx=\"50%\"></rect>\n                <path fill=\"#fff\" d=\"M335 499c14 0 12 17 12 17H165s-2-17 12-17c13 0 16-6 16-12l-1-50c-71 16-86-28-86-28-12-30-28-37-28-37-24-16 1-16 1-16 26 2 40 26 40 26 22 39 59 28 74 22 2-17 9-28 16-35-57-6-116-28-116-126 0-28 10-51 26-69-3-6-11-32 3-67 0 0 21-7 70 26 42-12 86-12 128 0 49-33 70-26 70-26 14 35 6 61 3 67 16 18 26 41 26 69 0 98-60 120-117 126 10 8 18 24 18 48l-1 70c0 6 3 12 16 12z\"></path>\n              </svg>\n            </a>\n          </li>\n          <li class=\"nav-item\">\n            <a class=\"nav-link\" href=\"https://twitter.com/thefancyapps\" target=\"_blank\" title=\"Follow @thefancyapps\">\n              <svg width=\"24\" height=\"24\" xmlns=\"http://www.w3.org/2000/svg\" aria-label=\"Twitter\" role=\"img\" viewBox=\"0 0 512 512\">\n                <rect fill=\"#444\" width=\"512\" height=\"512\" rx=\"50%\"></rect>\n                <path fill=\"#fff\" d=\"M437 152a72 72 0 0 1-40 12 72 72 0 0 0 32-40 72 72 0 0 1-45 17 72 72 0 0 0-122 65 200 200 0 0 1-145-74 72 72 0 0 0 22 94 72 72 0 0 1-32-7 72 72 0 0 0 56 69 72 72 0 0 1-32 1 72 72 0 0 0 67 50 200 200 0 0 1-105 29 200 200 0 0 0 309-179 200 200 0 0 0 35-37\"></path>\n              </svg>\n            </a>\n          </li>\n        </ul>\n      </nav>\n    </div>\n  </div>\n\n  <div class=\"container\">\n    <div class=\"row\">\n      <div class=\"col-md-2\" id=\"leftCol\">\n        <div class=\"sticky\">\n          <ul>\n            <li>\n              <a href=\"#introduction\">Introduction</a>\n            </li>\n            <li>\n              <a href=\"#setup\">Setup</a>\n            </li>\n            <li>\n              <a href=\"#usage\">How to Use</a>\n            </li>\n            <li>\n              <a href=\"#media_types\">Media types</a>\n\n              <ul>\n                <li>\n                  <a href=\"#images\">Images</a>\n                </li>\n                <li>\n                  <a href=\"#video\">Video</a>\n                </li>\n                <li>\n                  <a href=\"#iframe\">Iframe</a>\n                </li>\n                <li>\n                  <a href=\"#inline\">Inline</a>\n                </li>\n                <li>\n                  <a href=\"#ajax\">Ajax</a>\n                </li>\n              </ul>\n            </li>\n            <li>\n              <a href=\"#options\">Options</a>\n            </li>\n            <li>\n              <a href=\"#api\">Api</a>\n            </li>\n            <li>\n              <a href=\"#modules\">Modules</a>\n            </li>\n            <li>\n              <a href=\"#faq\">FAQ</a>\n            </li>\n          </ul>\n        </div>\n      </div>\n\n      <div class=\"col-md-10 px-2 px-md-5\" id=\"mainCol\">\n\n        <section>\n          <h2>Introduction</h2>\n\n          <p>\n            Get started with fancybox, probably the world’s most popular lightbox script.\n          </p>\n        </section>\n        <section>\n\n          <h3>\n            Dependencies\n          </h3>\n\n          <p>\n            jQuery 3+ is preferred, but fancybox works with jQuery 1.9.1+ and jQuery 2+\n          </p>\n\n          <h3>Compatibility</h3>\n\n          <p>\n            fancybox includes support for touch gestures and even supports pinch gestures for zooming.\n            It is perfectly suited for both mobile and desktop browsers.\n          </p>\n\n          <p>\n            fancybox has been tested in following browsers/devices:\n          </p>\n\n          <ul>\n            <li>Chrome</li>\n            <li>Firefox</li>\n            <li>IE10/11</li>\n            <li>Edge</li>\n            <li>iOS Safari</li>\n            <li>Android 7.0 Tablet</li>\n          </ul>\n\n        </section>\n\n        <section id=\"setup\">\n\n          <h2>Setup</h2>\n\n          <p>\n            You can install fancybox by linking\n            <code>.css</code> and\n            <code>.js</code> files to your html file. Make sure you also load the jQuery library. Below is a basic HTML\n            template to use as an example:\n          </p>\n\n          <pre>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n\t&lt;meta charset=&quot;utf-8&quot;&gt;\n\t&lt;title&gt;My page&lt;/title&gt;\n\n\t&lt;!-- CSS --&gt;\n\t&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;jquery.fancybox.min.css&quot;&gt;\n&lt;/head&gt;\n&lt;body&gt;\n\n\t&lt;!-- Your HTML content goes here --&gt;\n\n\t&lt;!-- JS --&gt;\n\t&lt;script src=&quot;https://code.jquery.com/jquery-3.2.1.min.js&quot;&gt;&lt;/script&gt;\n\t&lt;script src=&quot;jquery.fancybox.min.js&quot;&gt;&lt;/script&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</pre>\n          <h3>Download fancybox</h3>\n\n          <p>\n            Download the latest version of fancybox on\n            <a href=\"https://github.com/fancyapps/fancybox\" target=\"_blank\">GitHub</a>.\n            <br /> Or just link directly to fancybox files on cdnjs -\n            <a href=\"https://cdnjs.com/libraries/fancybox\" target=\"_blank\">https://cdnjs.com/libraries/fancybox</a>.\n          </p>\n\n          <h3>Package Managers</h3>\n\n          <p>\n            fancybox is also available on npm and Bower.\n          </p>\n\n          <pre><code># NPM\nnpm install @fancyapps/fancybox --save\n\n# Bower\nbower install fancybox --save\n</code></pre>\n\n          <h4 class=\"mt-5\">\n            <span class=\"badge badge-warning\">Important</span>\n          </h4>\n\n          <ul>\n            <li>Make sure you add the jQuery library before the fancybox JS file</li>\n            <li>If you already have jQuery on your page, you shouldn't include it second time</li>\n            <li>Do not include both fancybox.js and fancybox.min.js files</li>\n            <li>\n              Some functionality (ajax, iframes, etc) will not work when you're opening local file directly on your\n              browser, the code must\n              be running on a web server\n            </li>\n          </ul>\n\n        </section>\n\n        <section id=\"usage\">\n          <h2>How to Use</h2>\n\n          <h3>Initialize with data attributes</h3>\n\n          <p>\n            The most basic way to use fancybox is by adding the\n            <code>data-fancybox</code> attribute to your element. This will automatically bind click event that will\n            start\n            fancybox. Use\n            <code>href</code> or\n            <code>data-src</code> attribute to specify source of your content. Example:\n          </p>\n\n          <pre>&lt;a href=\"image.jpg\" data-fancybox data-caption=\"Caption for single image\"&gt;\n\t&lt;img src=\"thumbnail.jpg\" alt=\"\" /&gt;\n&lt;/a&gt;</pre>\n\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/oPKVea?editors=1000\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            If you have a group of items, you can use the same attribute\n            <code>data-fancybox</code> value for each of them to create a gallery. Each group should have a unique\n            value.\n            Example:\n          </p>\n\n          <pre>&lt;a href=\"image_1.jpg\" data-fancybox=\"gallery\" data-caption=\"Caption #1\"&gt;\n\t&lt;img src=\"thumbnail_1.jpg\" alt=\"\" /&gt;\n&lt;/a&gt;\n\n&lt;a href=\"image_2.jpg\" data-fancybox=\"gallery\" data-caption=\"Caption #2\"&gt;\n\t&lt;img src=\"thumbnail_2.jpg\" alt=\"\" /&gt;\n&lt;/a&gt;\n</pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/wEVOPa?editors=1000\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            If you choose this method, default settings will be applied. See\n            <a href=\"#options\">options</a> section for examples how to customize\n            by changing defaults, using\n            <code>data-options</code> attribute or by <a href=\"#initialize-with-javascript\">initializing with\n              JavaScript</a>.\n          </p>\n\n          <p>\n            <span class=\"badge badge-info\">Info</span>\n            Sometimes you have multiple links pointing to the same source and that creates duplicates in the gallery.\n            To avoid that, simply use\n            <code>data-fancybox-trigger</code> attribute with the same value used for\n            <code>data-fancybox</code> attribute for your other links. Optionally, use\n            <code>data-fancybox-index</code> attribute to specify index of starting element:\n          </p>\n\n          <pre><code>&lt;a data-fancybox-trigger=&quot;gallery&quot; href=&quot;javascript:;&quot;&gt;\n    &lt;img src=\"thumbnail_1.jpg\" alt=\"\" /&gt;\n&lt;/a&gt;\n</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/VGoRqO?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <h3 id=\"initialize-with-javascript\">Initialize with JavaScript</h3>\n\n          <p>\n            Select your elements with a jQuery selector (you can use any valid selector) and call the\n            <code>fancybox</code> method:\n          </p>\n\n          <pre><code>$('[data-fancybox=\"gallery\"]').fancybox({\n\t// Options will go here\n});\n</code></pre>\n\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/vzoPMB?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            <span class=\"badge badge-info\">Info</span>\n            Sometimes you might need to bind fancybox to dynamically added elements. Use\n            <code>selector</code> option to attach click event listener for elements that exist now or in the future.\n            All selected items will be automatically grouped in the gallery. Example:\n          </p>\n\n          <pre><code>$().fancybox({\n    selector : '.imglist a:visible'\n});</code></pre>\n\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/NLQJQp?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <h3>Use with Javascript</h3>\n\n          <p>\n            You can also open and close fancybox programmatically. Here are a couple of examples, visit\n            <a href=\"#api\">API</a> section for more information and demos.\n          </p>\n          <p>\n            Display simple message:\n          </p>\n\n          <pre><code>$.fancybox.open('&lt;div class=&quot;message&quot;&gt;&lt;h2&gt;Hello!&lt;/h2&gt;&lt;p&gt;You are awesome!&lt;/p&gt;&lt;/div&gt;');</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/qMewWv?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            Display iframed page:\n          </p>\n\n          <pre><code>$.fancybox.open({\n\tsrc  : 'link-to-your-page.html',\n\ttype : 'iframe',\n\topts : {\n\t\tafterShow : function( instance, current ) {\n\t\t\tconsole.info( 'done!' );\n\t\t}\n\t}\n});</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/GXVLgo?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <h4 class=\"mt-4\">\n            <span class=\"badge badge-warning\">Important</span>\n          </h4>\n\n          <p>\n            fancybox attempts to automatically detect the type of content based on the given url. If it cannot be\n            detected, the type can also be set manually using\n            <code>data-type</code> attribute (or\n            <code>type</code> option). Example:\n          </p>\n\n          <pre>&lt;a href=\"images.php?id=123\" data-type=\"image\" data-caption=\"Caption\"&gt;\n\tShow image\n&lt;/a&gt;</pre>\n\n        </section>\n        <section id=\"media_types\">\n\n          <h2>Media types</h2>\n\n          <p>\n            fancybox is designed to display images, video, iframes and any HTML content. For your convenience, there is\n            a built in support for inline content and ajax.\n          </p>\n\n          <h3 id=\"images\">Images</h3>\n\n          <p>\n            The standard way of using fancybox is with a number of thumbnail images that link to larger images:\n          </p>\n\n          <pre><code>&lt;a href=\"image.jpg\" data-fancybox=\"images\" data-caption=\"My caption\"&gt;\n\t&lt;img src=\"thumbnail.jpg\" alt=\"\" /&gt;\n&lt;/a&gt;</code></pre>\n\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/EeqJPG?editors=1000\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            By default, fancybox fully preloads an image before displaying it. You can choose to display the image\n            right away. It will render and show the full size image while the data is being received. To do so, some\n            attributes are necessary:\n          </p>\n\n          <ul>\n            <li>\n              <code>data-width</code> &nbsp; - the real width of the image</li>\n            <li>\n              <code>data-height</code> - the real height of the image</li>\n          </ul>\n\n          <pre><code>&lt;a href=&quot;image.jpg&quot; data-fancybox=&quot;images&quot; data-width=&quot;2048&quot; data-height=&quot;1365&quot;&gt;\n    &lt;img src=&quot;thumbnail.jpg&quot; /&gt;\n&lt;/a&gt;</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/bxXJRr?editors=1000\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            You can also use these\n            <code>width</code> and\n            <code>height</code> properties to control size of the image. This can be used to make images look sharper\n            on retina displays. Example:\n          </p>\n\n          <pre><code>$('[data-fancybox=&quot;images&quot;]').fancybox({\n    afterLoad : function(instance, current) {\n        var pixelRatio = window.devicePixelRatio || 1;\n\n        if ( pixelRatio &gt; 1.5 ) {\n            current.width  = current.width  / pixelRatio;\n            current.height = current.height / pixelRatio;\n        }\n    }\n});</code></pre>\n\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/gdVyxg?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            fancybox supports \"srcset\" so it can display different images based on viewport width. You can use this to\n            improve download times for mobile users and over time save bandwidth. Example:\n          </p>\n\n          <pre><code>&lt;a href=&quot;medium.jpg&quot; data-fancybox=&quot;images&quot; data-srcset=&quot;large.jpg 1600w, medium.jpg 1200w, small.jpg 640w&quot;&gt;\n\t&lt;img src=&quot;thumbnail.jpg&quot; /&gt;\n&lt;/a&gt;</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/LJwvzY?editors=1000\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            It is also possible to protect images from downloading by right-click. While this does not protect from\n            truly determined users, it should discourage the vast majority from ripping off your files.\n            Optionally, put the watermark over image.\n          </p>\n\n          <pre><code>$('[data-fancybox]').fancybox({\n\tprotect: true\n});</code></pre>\n\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/QVePOQ\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <h3 id=\"video\">Video</h3>\n\n          <p>\n            YouTube and Vimeo videos can be used with fancybox by just providing the page URL. Link to MP4 video\n            directly or use trigger element to display hidden <code>&lt;video&gt;</code> element.\n          </p>\n\n          <p>\n            Use\n            <code>data-width</code> and\n            <code>data-height</code> attributes to customize video dimensions and\n            <code>data-ratio</code> for the aspect ratio.\n          </p>\n\n          <pre><code>&lt;a data-fancybox href=\"https://www.youtube.com/watch?v=_sI_Ps7JSEk\"&gt;\n    YouTube video\n&lt;/a&gt;\n\n&lt;a data-fancybox href=\"https://vimeo.com/191947042\"&gt;\n    Vimeo video\n&lt;/a&gt;\n\n&lt;a data-fancybox data-width=&quot;640&quot; data-height=&quot;360&quot; href=&quot;video.mp4&quot;&gt;\n    Direct link to MP4 video\n&lt;/a&gt;\n\n&lt;a data-fancybox href=&quot;#myVideo&quot;&gt;\n    HTML5 video element\n&lt;/a&gt;\n\n&lt;video width=&quot;640&quot; height=&quot;320&quot; controls id=&quot;myVideo&quot; style=&quot;display:none;&quot;&gt;\n    &lt;source src=&quot;https://www.html5rocks.com/en/tutorials/video/basics/Chrome_ImF.mp4&quot; type=&quot;video/mp4&quot;&gt;\n    &lt;source src=&quot;https://www.html5rocks.com/en/tutorials/video/basics/Chrome_ImF.webm&quot; type=&quot;video/webm&quot;&gt;\n    &lt;source src=&quot;https://www.html5rocks.com/en/tutorials/video/basics/Chrome_ImF.ogv&quot; type=&quot;video/ogg&quot;&gt;\n    Your browser doesn't support HTML5 video tag.\n&lt;/video&gt;</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/GXVLyr?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            Controlling YouTube &amp; Vimeo video via URL parameters:\n          </p>\n\n          <pre><code>&lt;a data-fancybox href=&quot;https://www.youtube.com/watch?v=_sI_Ps7JSEk&amp;amp;autoplay=1&amp;amp;rel=0&amp;amp;controls=0&amp;amp;showinfo=0&quot;&gt;\n    YouTube video - hide controls and info\n&lt;/a&gt;\n\n&lt;a data-fancybox href=&quot;https://vimeo.com/191947042?color=f00&quot;&gt;\n    Vimeo video - custom color\n&lt;/a&gt;</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/NLQmzy?editors=1000\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            Via JavaScript:\n          </p>\n\n          <pre><code>$('[data-fancybox]').fancybox({\n    youtube : {\n        controls : 0,\n        showinfo : 0\n    },\n    vimeo : {\n        color : 'f00'\n    }\n});</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/WgVWKz?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n\n\n          <h3 id=\"iframe\">Iframe</h3>\n\n          <p>\n            If you need to display content from another page, add <code>data-fancybox</code> and <code>data-type=\"iframe\"</code>\n            attributes to your link. This would create <code>&lt;iframe&gt;</iframe></code> element that allows to\n            embed an entire web document inside the modal.\n          </p>\n\n          <pre><code>&lt;a data-fancybox data-type=\"iframe\" data-src=&quot;http://codepen.io/fancyapps/full/jyEGGG/&quot; href=&quot;javascript:;&quot;&gt;\n\tWebpage\n&lt;/a&gt;\n\n&lt;a data-fancybox data-type=\"iframe\" data-src=&quot;https://mozilla.github.io/pdf.js/web/viewer.html&quot; href=&quot;javascript:;&quot;&gt;\n    Sample PDF file \n&lt;/a&gt;\n</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/RYXOeK?editors=1000\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            If you have not disabled iframe preloading (using\n            <code>preload</code> option), the script will atempt to calculate content dimensions and will adjust\n            width/height of <code>&lt;iframe&gt;</iframe></code> to fit with content in it. Keep in mind, that due to\n            <a href=\"https://en.wikipedia.org/wiki/Same-origin_policy\" target=\"_blank\">same origin policy</a>, there\n            are some limitations.\n          </p>\n\n          <p>\n            This example will disable iframe preloading and will display small close button next to iframe instead of\n            the toolbar:\n          </p>\n\n          <pre><code>$('[data-fancybox]').fancybox({\n\ttoolbar  : false,\n\tsmallBtn : true,\n\tiframe : {\n\t\tpreload : false\n\t}\n})\n</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/pOMBQx\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n\n          <p>\n            Iframe dimensions can be controlled by CSS:\n          </p>\n\n          <pre><code>.fancybox-slide--iframe .fancybox-content {\n    width  : 800px;\n    height : 600px;\n    max-width  : 80%;\n    max-height : 80%;\n    margin: 0;\n}</code></pre>\n\n          <p>\n            These CSS rules can be overridden by JS, if needed:\n          </p>\n\n          <pre><code>$(&quot;[data-fancybox]&quot;).fancybox({\n    iframe : {\n        css : {\n            width : '600px'\n        }\n    }\n});</code></pre>\n\n          <p>\n            How to access and control fancybox in parent window from inside an iframe:\n          </p>\n\n          <pre><code>// Close current fancybox instance\nparent.jQuery.fancybox.getInstance().close();\n\n// Adjust iframe height according to the contents\nparent.jQuery.fancybox.getInstance().update();\n</code></pre>\n\n          <h3 id=\"inline\">Inline</h3>\n\n          <p>\n            fancybox can be used to display any HTML element on the page.\n            First, create a hidden element with unique ID:\n          </p>\n\n          <pre><code>&lt;div style=&quot;display: none;&quot; id=&quot;hidden-content&quot;&gt;\n\t&lt;h2&gt;Hello&lt;/h2&gt;\n\t&lt;p&gt;You are awesome.&lt;/p&gt;\n&lt;/div&gt;</code></pre>\n\n          <p>\n            Then simply create a link having\n            <code>data-src</code> attribute that matches ID of the element you want to open (preceded by a hash mark\n            (#); in this example - <code>#hidden-content</code>):\n          </p>\n\n          <pre><code>&lt;a data-fancybox data-src=&quot;#hidden-content&quot; href=&quot;javascript:;&quot;&gt;\n\tTrigger the fancybox\n&lt;/a&gt;</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/zJgXyg?editors=1100\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            The script will append small close button (if you have not disabled by\n            <code>smallBtn:false</code>) and will not apply any styles except for centering. Therefore you can easily\n            set custom dimensions using CSS.\n          </p>\n\n          <p>\n            <span class=\"badge badge-info\">Info</span> If necessary, you can make your element (and similarly any other\n            html content) scrollable by adding additional wrapping element and some CSS -\n\n            <a href=\"https://codepen.io/fancyapps/pen/yxmrwG?editors=1100\" target=\"_blank\">view demo on CodePen</a>.\n          </p>\n\n\n          <h3 id=\"ajax\">Ajax</h3>\n\n          <p>\n            To load your content via AJAX, you need to add a\n            <code>data-type=\"ajax\"</code> attribute to your link:\n          </p>\n\n          <pre><code>&lt;a data-fancybox data-type=&quot;ajax&quot; data-src=&quot;my_page.com/path/to/ajax/&quot; href=&quot;javascript:;&quot;&gt;\n\tAJAX content\n&lt;/a&gt;</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/yxmrWZ?editors=1100\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            Additionally it is possible to define a selector with the\n            <code>data-filter</code> attribute to show only a part of the response. The selector can be any string,\n            that is a valid jQuery selector:\n          </p>\n\n          <pre><code>&lt;a data-fancybox data-type=&quot;ajax&quot; data-src=&quot;my_page.com/path/to/ajax/&quot; data-filter=&quot;#two&quot; href=&quot;javascript:;&quot;&gt;\n\tAJAX content\n&lt;/a&gt;\n</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/jvgRRe?editors=1100\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n        </section>\n\n\n        <section id=\"options\">\n          <h2>Options</h2>\n\n          <p>\n            Quick reference for all default options as defined in the source:\n          </p>\n\n          <pre>var defaults = {\n  // Close existing modals\n  // Set this to false if you do not need to stack multiple instances\n  closeExisting: false,\n\n  // Enable infinite gallery navigation\n  loop: false,\n\n  // Horizontal space between slides\n  gutter: 50,\n\n  // Enable keyboard navigation\n  keyboard: true,\n\n  // Should allow caption to overlap the content\n  preventCaptionOverlap: true,\n\n  // Should display navigation arrows at the screen edges\n  arrows: true,\n\n  // Should display counter at the top left corner\n  infobar: true,\n\n  // Should display close button (using `btnTpl.smallBtn` template) over the content\n  // Can be true, false, &quot;auto&quot;\n  // If &quot;auto&quot; - will be automatically enabled for &quot;html&quot;, &quot;inline&quot; or &quot;ajax&quot; items\n  smallBtn: &quot;auto&quot;,\n\n  // Should display toolbar (buttons at the top)\n  // Can be true, false, &quot;auto&quot;\n  // If &quot;auto&quot; - will be automatically hidden if &quot;smallBtn&quot; is enabled\n  toolbar: &quot;auto&quot;,\n\n  // What buttons should appear in the top right corner.\n  // Buttons will be created using templates from `btnTpl` option\n  // and they will be placed into toolbar (class=&quot;fancybox-toolbar&quot;` element)\n  buttons: [\n    &quot;zoom&quot;,\n    //&quot;share&quot;,\n    &quot;slideShow&quot;,\n    //&quot;fullScreen&quot;,\n    //&quot;download&quot;,\n    &quot;thumbs&quot;,\n    &quot;close&quot;\n  ],\n\n  // Detect &quot;idle&quot; time in seconds\n  idleTime: 3,\n\n  // Disable right-click and use simple image protection for images\n  protect: false,\n\n  // Shortcut to make content &quot;modal&quot; - disable keyboard navigtion, hide buttons, etc\n  modal: false,\n\n  image: {\n    // Wait for images to load before displaying\n    //   true  - wait for image to load and then display;\n    //   false - display thumbnail and load the full-sized image over top,\n    //           requires predefined image dimensions (`data-width` and `data-height` attributes)\n    preload: false\n  },\n\n  ajax: {\n    // Object containing settings for ajax request\n    settings: {\n      // This helps to indicate that request comes from the modal\n      // Feel free to change naming\n      data: {\n        fancybox: true\n      }\n    }\n  },\n\n  iframe: {\n    // Iframe template\n    tpl:\n      '&lt;iframe id=&quot;fancybox-frame{rnd}&quot; name=&quot;fancybox-frame{rnd}&quot; class=&quot;fancybox-iframe&quot; allowfullscreen allow=&quot;autoplay; fullscreen&quot; src=&quot;&quot;&gt;&lt;/iframe&gt;',\n\n    // Preload iframe before displaying it\n    // This allows to calculate iframe content width and height\n    // (note: Due to &quot;Same Origin Policy&quot;, you can't get cross domain data).\n    preload: true,\n\n    // Custom CSS styling for iframe wrapping element\n    // You can use this to set custom iframe dimensions\n    css: {},\n\n    // Iframe tag attributes\n    attr: {\n      scrolling: &quot;auto&quot;\n    }\n  },\n\n  // For HTML5 video only\n  video: {\n    tpl:\n      '&lt;video class=&quot;fancybox-video&quot; controls controlsList=&quot;nodownload&quot; poster=&quot;{{poster}}&quot;&gt;' +\n      '&lt;source src=&quot;{{src}}&quot; type=&quot;{{format}}&quot; /&gt;' +\n      'Sorry, your browser doesn\\'t support embedded videos, &lt;a href=&quot;{{src}}&quot;&gt;download&lt;/a&gt; and watch with your favorite video player!' +\n      &quot;&lt;/video&gt;&quot;,\n    format: &quot;&quot;, // custom video format\n    autoStart: true\n  },\n\n  // Default content type if cannot be detected automatically\n  defaultType: &quot;image&quot;,\n\n  // Open/close animation type\n  // Possible values:\n  //   false            - disable\n  //   &quot;zoom&quot;           - zoom images from/to thumbnail\n  //   &quot;fade&quot;\n  //   &quot;zoom-in-out&quot;\n  //\n  animationEffect: &quot;zoom&quot;,\n\n  // Duration in ms for open/close animation\n  animationDuration: 366,\n\n  // Should image change opacity while zooming\n  // If opacity is &quot;auto&quot;, then opacity will be changed if image and thumbnail have different aspect ratios\n  zoomOpacity: &quot;auto&quot;,\n\n  // Transition effect between slides\n  //\n  // Possible values:\n  //   false            - disable\n  //   &quot;fade'\n  //   &quot;slide'\n  //   &quot;circular'\n  //   &quot;tube'\n  //   &quot;zoom-in-out'\n  //   &quot;rotate'\n  //\n  transitionEffect: &quot;fade&quot;,\n\n  // Duration in ms for transition animation\n  transitionDuration: 366,\n\n  // Custom CSS class for slide element\n  slideClass: &quot;&quot;,\n\n  // Custom CSS class for layout\n  baseClass: &quot;&quot;,\n\n  // Base template for layout\n  baseTpl:\n    '&lt;div class=&quot;fancybox-container&quot; role=&quot;dialog&quot; tabindex=&quot;-1&quot;&gt;' +\n    '&lt;div class=&quot;fancybox-bg&quot;&gt;&lt;/div&gt;' +\n    '&lt;div class=&quot;fancybox-inner&quot;&gt;' +\n    '&lt;div class=&quot;fancybox-infobar&quot;&gt;&lt;span data-fancybox-index&gt;&lt;/span&gt;&amp;nbsp;/&amp;nbsp;&lt;span data-fancybox-count&gt;&lt;/span&gt;&lt;/div&gt;' +\n    '&lt;div class=&quot;fancybox-toolbar&quot;&gt;{{buttons}}&lt;/div&gt;' +\n    '&lt;div class=&quot;fancybox-navigation&quot;&gt;{{arrows}}&lt;/div&gt;' +\n    '&lt;div class=&quot;fancybox-stage&quot;&gt;&lt;/div&gt;' +\n    '&lt;div class=&quot;fancybox-caption&quot;&gt;&lt;div class=\"&quot;fancybox-caption__body&quot;&gt;&lt;/div&gt;&lt;/div&gt;' +\n    '&lt;/div&gt;' +\n    '&lt;/div&gt;',\n\n  // Loading indicator template\n  spinnerTpl: '&lt;div class=&quot;fancybox-loading&quot;&gt;&lt;/div&gt;',\n\n  // Error message template\n  errorTpl: '&lt;div class=&quot;fancybox-error&quot;&gt;&lt;p&gt;{{ERROR}}&lt;/p&gt;&lt;/div&gt;',\n\n  btnTpl: {\n    download:\n      '&lt;a download data-fancybox-download class=&quot;fancybox-button fancybox-button--download&quot; title=&quot;{{DOWNLOAD}}&quot; href=&quot;javascript:;&quot;&gt;' +\n      '&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z&quot;/&gt;&lt;/svg&gt;' +\n      &quot;&lt;/a&gt;&quot;,\n\n    zoom:\n      '&lt;button data-fancybox-zoom class=&quot;fancybox-button fancybox-button--zoom&quot; title=&quot;{{ZOOM}}&quot;&gt;' +\n      '&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z&quot;/&gt;&lt;/svg&gt;' +\n      &quot;&lt;/button&gt;&quot;,\n\n    close:\n      '&lt;button data-fancybox-close class=&quot;fancybox-button fancybox-button--close&quot; title=&quot;{{CLOSE}}&quot;&gt;' +\n      '&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z&quot;/&gt;&lt;/svg&gt;' +\n      &quot;&lt;/button&gt;&quot;,\n\n    // Arrows\n    arrowLeft:\n      '&lt;button data-fancybox-prev class=&quot;fancybox-button fancybox-button--arrow_left&quot; title=&quot;{{PREV}}&quot;&gt;' +\n      '&lt;div&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z&quot;/&gt;&lt;/svg&gt;&lt;/div&gt;' +\n      &quot;&lt;/button&gt;&quot;,\n\n    arrowRight:\n      '&lt;button data-fancybox-next class=&quot;fancybox-button fancybox-button--arrow_right&quot; title=&quot;{{NEXT}}&quot;&gt;' +\n      '&lt;div&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z&quot;/&gt;&lt;/svg&gt;&lt;/div&gt;' +\n      &quot;&lt;/button&gt;&quot;,\n\n    // This small close button will be appended to your html/inline/ajax content by default,\n    // if &quot;smallBtn&quot; option is not set to false\n    smallBtn:\n      '&lt;button type=&quot;button&quot; data-fancybox-close class=&quot;fancybox-button fancybox-close-small&quot; title=&quot;{{CLOSE}}&quot;&gt;' +\n      '&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1&quot; viewBox=&quot;0 0 24 24&quot;&gt;&lt;path d=&quot;M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z&quot;/&gt;&lt;/svg&gt;' +\n      &quot;&lt;/button&gt;&quot;\n  },\n\n  // Container is injected into this element\n  parentEl: &quot;body&quot;,\n\n  // Hide browser vertical scrollbars; use at your own risk\n  hideScrollbar: true,\n\n  // Focus handling\n  // ==============\n\n  // Try to focus on the first focusable element after opening\n  autoFocus: true,\n\n  // Put focus back to active element after closing\n  backFocus: true,\n\n  // Do not let user to focus on element outside modal content\n  trapFocus: true,\n\n  // Module specific options\n  // =======================\n\n  fullScreen: {\n    autoStart: false\n  },\n\n  // Set `touch: false` to disable panning/swiping\n  touch: {\n    vertical: true, // Allow to drag content vertically\n    momentum: true // Continue movement after releasing mouse/touch when panning\n  },\n\n  // Hash value when initializing manually,\n  // set `false` to disable hash change\n  hash: null,\n\n  // Customize or add new media types\n  // Example:\n  /*\n    media : {\n      youtube : {\n        params : {\n          autoplay : 0\n        }\n      }\n    }\n  */\n  media: {},\n\n  slideShow: {\n    autoStart: false,\n    speed: 3000\n  },\n\n  thumbs: {\n    autoStart: false, // Display thumbnails on opening\n    hideOnClose: true, // Hide thumbnail grid when closing animation starts\n    parentEl: &quot;.fancybox-container&quot;, // Container is injected into this element\n    axis: &quot;y&quot; // Vertical (y) or horizontal (x) scrolling\n  },\n\n  // Use mousewheel to navigate gallery\n  // If 'auto' - enabled for images only\n  wheel: &quot;auto&quot;,\n\n  // Callbacks\n  //==========\n\n  // See Documentation/API/Events for more information\n  // Example:\n  /*\n    afterShow: function( instance, current ) {\n      console.info( 'Clicked element:' );\n      console.info( current.opts.$orig );\n    }\n  */\n\n  onInit: $.noop, // When instance has been initialized\n\n  beforeLoad: $.noop, // Before the content of a slide is being loaded\n  afterLoad: $.noop, // When the content of a slide is done loading\n\n  beforeShow: $.noop, // Before open animation starts\n  afterShow: $.noop, // When content is done loading and animating\n\n  beforeClose: $.noop, // Before the instance attempts to close. Return false to cancel the close.\n  afterClose: $.noop, // After instance has been closed\n\n  onActivate: $.noop, // When instance is brought to front\n  onDeactivate: $.noop, // When other instance has been activated\n\n  // Interaction\n  // ===========\n\n  // Use options below to customize taken action when user clicks or double clicks on the fancyBox area,\n  // each option can be string or method that returns value.\n  //\n  // Possible values:\n  //   &quot;close&quot;           - close instance\n  //   &quot;next&quot;            - move to next gallery item\n  //   &quot;nextOrClose&quot;     - move to next gallery item or close if gallery has only one item\n  //   &quot;toggleControls&quot;  - show/hide controls\n  //   &quot;zoom&quot;            - zoom image (if loaded)\n  //   false             - do nothing\n\n  // Clicked on the content\n  clickContent: function(current, event) {\n    return current.type === &quot;image&quot; ? &quot;zoom&quot; : false;\n  },\n\n  // Clicked on the slide\n  clickSlide: &quot;close&quot;,\n\n  // Clicked on the background (backdrop) element;\n  // if you have not changed the layout, then most likely you need to use `clickSlide` option\n  clickOutside: &quot;close&quot;,\n\n  // Same as previous two, but for double click\n  dblclickContent: false,\n  dblclickSlide: false,\n  dblclickOutside: false,\n\n  // Custom options when mobile device is detected\n  // =============================================\n\n  mobile: {\n    preventCaptionOverlap: false,\n    idleTime: false,\n    clickContent: function(current, event) {\n      return current.type === &quot;image&quot; ? &quot;toggleControls&quot; : false;\n    },\n    clickSlide: function(current, event) {\n      return current.type === &quot;image&quot; ? &quot;toggleControls&quot; : &quot;close&quot;;\n    },\n    dblclickContent: function(current, event) {\n      return current.type === &quot;image&quot; ? &quot;zoom&quot; : false;\n    },\n    dblclickSlide: function(current, event) {\n      return current.type === &quot;image&quot; ? &quot;zoom&quot; : false;\n    }\n  },\n\n  // Internationalization\n  // ====================\n\n  lang: &quot;en&quot;,\n  i18n: {\n    en: {\n      CLOSE: &quot;Close&quot;,\n      NEXT: &quot;Next&quot;,\n      PREV: &quot;Previous&quot;,\n      ERROR: &quot;The requested content cannot be loaded. &lt;br/&gt; Please try again later.&quot;,\n      PLAY_START: &quot;Start slideshow&quot;,\n      PLAY_STOP: &quot;Pause slideshow&quot;,\n      FULL_SCREEN: &quot;Full screen&quot;,\n      THUMBS: &quot;Thumbnails&quot;,\n      DOWNLOAD: &quot;Download&quot;,\n      SHARE: &quot;Share&quot;,\n      ZOOM: &quot;Zoom&quot;\n    },\n    de: {\n      CLOSE: &quot;Schliessen&quot;,\n      NEXT: &quot;Weiter&quot;,\n      PREV: &quot;Zurück&quot;,\n      ERROR: &quot;Die angeforderten Daten konnten nicht geladen werden. &lt;br/&gt; Bitte versuchen Sie es später nochmal.&quot;,\n      PLAY_START: &quot;Diaschau starten&quot;,\n      PLAY_STOP: &quot;Diaschau beenden&quot;,\n      FULL_SCREEN: &quot;Vollbild&quot;,\n      THUMBS: &quot;Vorschaubilder&quot;,\n      DOWNLOAD: &quot;Herunterladen&quot;,\n      SHARE: &quot;Teilen&quot;,\n      ZOOM: &quot;Maßstab&quot;\n    }\n  }\n};\n</pre>\n\n\n          <p>\n            Set instance options by passing a valid object to <code>fancybox()</code> method:\n          </p>\n\n          <pre><code>$('[data-fancybox=\"gallery\"]').fancybox({\n\tthumbs : {\n\t\tautoStart : true\n\t}\n});</code></pre>\n\n\n          <p>\n            Plugin options / defaults are exposed in\n            <code>$.fancybox.defaults</code> namespace so you can easily adjust them globally:\n          </p>\n\n          <pre><code>$.fancybox.defaults.animationEffect = \"fade\";</code></pre>\n\n          <p>\n            Custom options for each element individually can be set by adding a\n            <code>data-options</code> attribute to the element.\n            This attribute should contain the properly formatted JSON object\n            (remember, strings should be wrapped in double quotes).\n          </p>\n          <p>\n            It is also possible to quickly set any option using\n            <em>parameterized</em> name of the selected option, for example,\n            <code>animationEffect</code> would be <code>data-animation-effect</code>:\n          </p>\n\n          <pre><code>&lt;a data-fancybox data-options='{&quot;caption&quot; : &quot;My caption&quot;, &quot;src&quot; : &quot;https://codepen.io/about/&quot;, &quot;type&quot; : &quot;iframe&quot;}' href=&quot;javascript:;&quot; class=&quot;btn btn-primary&quot;&gt;\n    Example #1\n&lt;/a&gt;\n\n&lt;a data-fancybox data-animation-effect=&quot;false&quot; href=&quot;https://source.unsplash.com/0JYgd2QuMfw/1500x1000&quot; class=&quot;btn btn-primary&quot;&gt;\n    Example #2\n&lt;/a&gt;\n</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/PdMgrO?editors=1000\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n        </section>\n        <section id=\"api\">\n\n          <h2>API</h2>\n\n          <p>\n            The fancybox API offers a couple of methods to control fancybox. This gives you the ability to extend the\n            plugin and to integrate it with other web application components.\n          </p>\n\n          <h3 id=\"core_methods\">Core methods</h3>\n\n          <p>\n            Core methods are methods which affect/handle instances:\n          </p>\n\n\n          <pre><code>// Start new fancybox instance\n$.fancybox.open( items, opts, index );\n\n// Get refrence to currently active fancybox instance\n$.fancybox.getInstance();\n\n// Close currently active fancybox instance (pass `true` to close all instances) \n$.fancybox.close();\n\n// Close all instances and unbind all events\n$.fancybox.destroy();\n</code></pre>\n\n\n          <h3 id=\"api_usage\">Starting fancybox</h3>\n\n          <p>\n            When creating group objects manually, each item should follow this pattern:\n          </p>\n\n          <pre><code>{\n\tsrc  : '' // Source of the content\n\ttype : '' // Content type: image|inline|ajax|iframe|html (optional)\n\topts : {} // Object containing item options (optional)\n}\n</code></pre>\n\n          <p>\n            Example of opening image gallery programmatically:\n          </p>\n\n          <pre><code>$.fancybox.open([\n\t{\n\t\tsrc  : '1_b.jpg',\n\t\topts : {\n\t\t\tcaption : 'First caption',\n\t\t\tthumb   : '1_s.jpg'\n\t\t}\n\t},\n\t{\n\t\tsrc  : '2_b.jpg',\n\t\topts : {\n\t\t\tcaption : 'Second caption',\n\t\t\tthumb   : '2_s.jpg'\n\t\t}\n\t}\n], {\n\tloop : false\n});</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/wEVbdY?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            It is also possible to pass only one object. Example of opening inline content:\n          </p>\n\n          <pre><code>$.fancybox.open({\n\tsrc  : '#hidden-content',\n\ttype : 'inline',\n\topts : {\n\t\tafterShow : function( instance, current ) {\n\t\t\tconsole.info( 'done!' );\n\t\t}\n\t}\n});\n</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/mGNYwX?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            If you wish to quickly display some html content (for example, a message), then you can use a simpler\n            syntax. Do not forget to use a wrapping element around your content.\n          </p>\n\n          <pre><code>$.fancybox.open('&lt;div class=&quot;message&quot;&gt;&lt;h2&gt;Hello!&lt;/h2&gt;&lt;p&gt;You are awesome!&lt;/p&gt;&lt;/div&gt;');</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/qMeGVr\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            Group items can be collection of jQuery objects, too.\n            This can be used, for example, to display group of inline elements:\n          </p>\n\n          <pre><code>$('#test').on('click', function() {\n  $.fancybox.open( $('.inline-gallery'), {\n    touch: false\n  });\n});</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/GXVayG?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n\n          <h3 id=\"instance_methods\">Instance methods</h3>\n\n          <p>\n            In order to use these methods, you need an instance of the plugin's object.\n            There are 3 common ways to get the reference.\n          </p>\n\n          <p>\n            1) Using API method to get currently active instance:\n          </p>\n\n          <pre><code>var instance = $.fancybox.getInstance();</code></pre>\n\n          <p>\n            2) While starting fancybox programmatically:\n          </p>\n          <pre><code>var instance = $.fancybox.open(\n\t// Your content and options\n);</code></pre>\n\n          <p>\n            3) From within the callback - first argument is always a reference to current instance:\n          </p>\n\n          <pre><code>$('[data-fancybox=\"gallery\"]').fancybox({\n\tafterShow : function( instance, current ) {\n\t\tconsole.info( instance );\n\t}\n});</code></pre>\n          <p>\n            Once you have a reference to fancybox instance the following methods are available:\n          </p>\n\n          <pre><code>// Go to next gallery item\ninstance.next( duration );\n\n// Go to previous gallery item\ninstance.previous( duration );\n\n// Switch to selected gallery item\ninstance.jumpTo( index, duration );\n\n// Check if current image dimensions are smaller than actual\ninstance.isScaledDown();\n\n// Scale image to the actual size of the image\ninstance.scaleToActual( x, y, duration );\n\n// Check if image dimensions exceed parent element\ninstance.canPan();\n\n// Scale image to fit inside parent element\ninstance.scaleToFit( duration );\n\n// Update position and content of all slides\ninstance.update();\n\n// Update slide position and scale content to fit\ninstance.updateSlide( slide );\n\n// Update infobar values, navigation button states and reveal caption\ninstance.updateControls( force );\n\n// Load custom content into the slide\ninstance.setContent( slide, content );\n\n// Show loading icon inside the slide\ninstance.showLoading( slide );\n\n// Remove loading icon from the slide\ninstance.hideLoading( slide );\n\n// Try to find and focus on the first focusable element\ninstance.focus();\n\n// Activates current instance, brings it to the front\ninstance.activate();\n\n// Close instance\ninstance.close();\n</code></pre>\n\n          <p>\n            You can also do something like this:\n          </p>\n\n          <pre><code>$.fancybox.getInstance().jumpTo(1);</code></pre>\n\n          <p>\n            or simply:\n          </p>\n\n          <pre><code>$.fancybox.getInstance('jumpTo', 1);</code></pre>\n\n          <h3 id=\"events\">Events</h3>\n\n          <p>\n            fancybox fires several events:\n          </p>\n\n          <pre><code>beforeLoad   : Before the content of a slide is being loaded\nafterLoad    : When the content of a slide is done loading\n\nbeforeShow   : Before open animation starts\nafterShow    : When content is done loading and animating\n\nbeforeClose  : Before the instance attempts to close. Return false to cancel the close.\nafterClose   : After instance has been closed\n\nonInit       : When instance has been initialized\nonActivate   : When instance is brought to front\nonDeactivate : When other instance has been activated</code></pre>\n\n          <p>\n            Event callbacks can be set as function properties of the options object passed to fancybox initialization\n            function:\n          </p>\n\n          <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;\n\t$(&quot;[data-fancybox]&quot;).fancybox({\n\t\tafterShow: function( instance, slide ) {\n\n\t\t\t// Tip: Each event passes useful information within the event object:\n\n\t\t\t// Object containing references to interface elements\n\t\t\t// (background, buttons, caption, etc)\n\t\t\t// console.info( instance.$refs );\n\n\t\t\t// Current slide options\n\t\t\t// console.info( slide.opts );\n\n\t\t\t// Clicked element\n\t\t\t// console.info( slide.opts.$orig );\n\n\t\t\t// Reference to DOM element of the slide\n\t\t\t// console.info( slide.$slide );\n\n\t\t}\n\t});\n&lt;/script&gt;</code></pre>\n\n          <p>\n            Each callback receives two parameters - current fancybox instance and current gallery object, if exists.\n          </p>\n\n          <p>\n            It is also possible to attach event handler for all instances. To prevent interfering with other scripts,\n            these events have been namespaced to <code>.fb</code>.\n            These handlers receive 3 parameters - event, current fancybox instance and current gallery object.\n          </p>\n          <p>\n            Here is an example of binding to the\n            <code>afterShow</code> event:\n          </p>\n\n          <pre><code>$(document).on('afterShow.fb', function( e, instance, slide ) {\n\t// Your code goes here\n});</code></pre>\n\n\n          <p>\n            If you wish to prevent closing of the modal (for example, after form submit), you can use\n            <code>beforeClose</code> callback. Simply return\n            <code>false</code>:\n          </p>\n\n          <pre><code>beforeClose : function( instance, current, e ) {\n\tif ( $('#my-field').val() == '' ) {\n\t\treturn false;\n\t}\n}\n</code></pre>\n\n        </section>\n        <section id=\"modules\">\n          <h2>Modules</h2>\n\n          <p>\n            fancybox code is split into several files (modules) that extend core functionality. You can build your own\n            fancybox version by excluding unnecessary modules, if needed.\n            Each one has their own <code>js</code> and/or <code>css</code> files.\n          </p>\n\n          <p>\n            Some modules can be customized and controlled programmatically. List of all possible options:\n          </p>\n\n          <pre><code>fullScreen: {\n  autoStart: false\n},\n\ntouch : {\n  vertical : true,  // Allow to drag content vertically\n  momentum : true   // Continuous movement when panning\n},\n\n// Hash value when initializing manually,\n// set `false` to disable hash change\nhash : null,\n\n// Customize or add new media types\n// Example:\n/*\nmedia : {\n  youtube : {\n    params : {\n      autoplay : 0\n    }\n  }\n}\n*/\nmedia : {},\n\nslideShow : {\n  autoStart : false,\n  speed     : 4000\n},\n\nthumbs : {\n  autoStart   : false,                  // Display thumbnails on opening\n  hideOnClose : true,                   // Hide thumbnail grid when closing animation starts\n  parentEl    : '.fancybox-container',  // Container is injected into this element\n  axis        : 'y'                     // Vertical (y) or horizontal (x) scrolling\n},\n\nshare: {\n  url: function(instance, item) {\n    return (\n      (!instance.currentHash &amp;&amp; !(item.type === \"inline\" || item.type === \"html\") ? item.origSrc || item.src : false) || window.location\n    );\n  },\n  tpl:\n    '&lt;div class=&quot;fancybox-share&quot;&gt;' +\n    &quot;&lt;h1&gt;{{SHARE}}&lt;/h1&gt;&quot; +\n    &quot;&lt;p&gt;&quot; +\n    '&lt;a class=&quot;fancybox-share__button fancybox-share__button--fb&quot; href=&quot;https://www.facebook.com/sharer/sharer.php?u={{url}}&quot;&gt;' +\n    '&lt;svg viewBox=&quot;0 0 512 512&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196&quot; /&gt;&lt;/svg&gt;' +\n    &quot;&lt;span&gt;Facebook&lt;/span&gt;&quot; +\n    &quot;&lt;/a&gt;&quot; +\n    '&lt;a class=&quot;fancybox-share__button fancybox-share__button--tw&quot; href=&quot;https://twitter.com/intent/tweet?url={{url}}&amp;text={{descr}}&quot;&gt;' +\n    '&lt;svg viewBox=&quot;0 0 512 512&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z&quot; /&gt;&lt;/svg&gt;' +\n    &quot;&lt;span&gt;Twitter&lt;/span&gt;&quot; +\n    &quot;&lt;/a&gt;&quot; +\n    '&lt;a class=&quot;fancybox-share__button fancybox-share__button--pt&quot; href=&quot;https://www.pinterest.com/pin/create/button/?url={{url}}&amp;description={{descr}}&amp;media={{media}}&quot;&gt;' +\n    '&lt;svg viewBox=&quot;0 0 512 512&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z&quot; fill=&quot;#fff&quot;/&gt;&lt;/svg&gt;' +\n    &quot;&lt;span&gt;Pinterest&lt;/span&gt;&quot; +\n    &quot;&lt;/a&gt;&quot; +\n    &quot;&lt;/p&gt;&quot; +\n    '&lt;p&gt;&lt;input class=&quot;fancybox-share__input&quot; type=&quot;text&quot; value=&quot;{{url_raw}}&quot; /&gt;&lt;/p&gt;' +\n    &quot;&lt;/div&gt;&quot;\n}\n\n</code></pre>\n\n          <h5 class=\"mt-5\">Couple of examples</h5>\n\n          <p>\n            Show thumbnails on start:\n          </p>\n\n          <pre><code>$('[data-fancybox=\"images\"]').fancybox({\n\tthumbs : {\n\t\tautoStart : true\n\t}\n});</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/xavNjq?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            Customize share url if displaying hidden video element:\n          </p>\n\n          <pre><code>$('[data-fancybox=&quot;test-share-url&quot;]').fancybox({\n    buttons : ['share', 'close'],\n    hash : false,\n    share : {\n        url : function( instance, item ) {\n            if (item.type === 'inline' &amp;&amp; item.contentType === 'video') {\n                return item.$content.find('source:first').attr('src');\n            }\n\n            return item.src;\n        }\n    }\n});</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/MqNdqw?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            If you would inspect fancybox instance object, you would find that same keys ar captialized - these are\n            references for each module object.\n            Also, you would notice that fancybox uses common naming convention to prefix jQuery objects with <code>$</code>.\n          </p>\n\n          <p>\n            This is how you, for example, can access thumbnail grid element:\n          </p>\n\n          <pre><code>$.fancybox.getInstance().Thumbs.$grid</code></pre>\n\n          <p>\n            This example shows how to call method that toggles thumbnails:\n          </p>\n\n          <pre><code>$.fancybox.getInstance().Thumbs.toggle();</code></pre>\n\n          <p>\n            List of available methods:\n          </p>\n\n          <pre><code>Thumbs.focus()\nThumbs.update();\nThumbs.hide();\nThumbs.show();\nThumbs.toggle();\n\nFullScreen.request( elem );\nFullScreen.exit();\nFullScreen.toggle( elem );\nFullScreen.isFullscreen();\nFullScreen.enabled();\n\nSlideShow.start();\nSlideShow.stop();\nSlideShow.toggle();\n</code></pre>\n\n          <p>\n            If you wish to disable hash module, use this snippet (after including JS file):\n          </p>\n\n          <pre><code>$.fancybox.defaults.hash = false;</code></pre>\n\n        </section>\n\n        <section id=\"faq\">\n\n          <h2>FAQ</h2>\n\n          <h3 id=\"faq-1\">\n            <a href=\"#faq-1\">#1</a> Opening/closing causes fixed element to jump</h3>\n\n          <p>\n            Simply add <code>compensate-for-scrollbar</code> CSS class to your fixed positioned elements.\n            Example of using Bootstrap navbar component:\n          </p>\n\n          <pre><code>&lt;nav class=&quot;navbar navbar-inverse navbar-fixed-top compensate-for-scrollbar&quot;&gt;\n\t&lt;div class=&quot;container&quot;&gt;\n\t\t..\n\t&lt;/div&gt;\n&lt;/nav&gt;</code></pre>\n\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/MqNdPa?editors=1000\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            The script measures width of the scrollbar and creates\n            <code>compensate-for-scrollbar</code> CSS class that uses this value for\n            <code>margin-right</code> property. Therefore, if your element has\n            <code>width:100%</code>, you should positon it using\n            <code>left</code> and\n            <code>right</code> properties instead. Example:\n          </p>\n\n          <pre><code>.navbar {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n}</code></pre>\n\n          <h3 id=\"faq-2\">\n            <a href=\"#faq-2\">#2</a> How to customize caption</h3>\n\n          <p>\n            You can use\n            <code>caption</code> option that accepts a function and is called for each group element.\n            Example of appending image download link:\n          </p>\n\n          <pre><code>$( '[data-fancybox=&quot;images&quot;]' ).fancybox({\n    caption : function( instance, item ) {\n        var caption = $(this).data('caption') || '';\n\n        if ( item.type === 'image' ) {\n            caption = (caption.length ? caption + '&lt;br /&gt;' : '') + '&lt;a href=&quot;' + item.src + '&quot;&gt;Download image&lt;/a&gt;' ;\n        }\n\n        return caption;\n    }\n});</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/OoKYrd?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            Add current image index and image count (the total number of images in the gallery) right in the caption:\n          </p>\n\n          <pre><code>$( '[data-fancybox=&quot;images&quot;]' ).fancybox({\n    infobar : false,\n    caption : function( instance, item ) {\n        var caption = $(this).data('caption') || '';\n\n        return ( caption.length ? caption + '&lt;br /&gt;' : '' ) + 'Image &lt;span data-fancybox-index&gt;&lt;/span&gt; of &lt;span data-fancybox-count&gt;&lt;/span&gt;';\n    }\n});</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/EeqzMW?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <p>\n            Inside\n            <code>caption</code> method,\n            <code>this</code> refers to the clicked element. Example of using different source for caption:\n          </p>\n\n          <pre><code>$( '[data-fancybox]' ).fancybox({\n\tcaption : function( instance, item ) {\n\t\treturn $(this).find('figcaption').html();\n\t}\n});</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/aaerxw\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <h3 id=\"faq-3\">\n            <a href=\"#faq-3\">#3</a> How to create custom button in the toolbar</h3>\n\n          <p>\n            Example of creating reusable button:\n          </p>\n\n          <pre><code>// Create template for the button\n$.fancybox.defaults.btnTpl.fb = '&lt;button data-fancybox-fb class=&quot;fancybox-button fancybox-button--fb&quot; title=&quot;Facebook&quot;&gt;' +\n    '&lt;svg viewBox=&quot;0 0 24 24&quot;&gt;' +\n        '&lt;path d=&quot;M22.676 0H1.324C.594 0 0 .593 0 1.324v21.352C0 23.408.593 24 1.324 24h11.494v-9.294h-3.13v-3.62h3.13V8.41c0-3.1 1.894-4.785 4.66-4.785 1.324 0 2.463.097 2.795.14v3.24h-1.92c-1.5 0-1.793.722-1.793 1.772v2.31h3.584l-.465 3.63h-3.12V24h6.115c.733 0 1.325-.592 1.325-1.324V1.324C24 .594 23.408 0 22.676 0&quot;/&gt;' +\n    '&lt;/svg&gt;' +\n'&lt;/button&gt;';\n\n// Make button clickable using event delegation\n$('body').on('click', '[data-fancybox-fb]', function() {\n    window.open(&quot;https://www.facebook.com/sharer/sharer.php?u=&quot;+encodeURIComponent(window.location.href)+&quot;&amp;t=&quot;+encodeURIComponent(document.title), '','left=0,top=0,width=600,height=300,menubar=no,toolbar=no,resizable=yes,scrollbars=yes');\n});\n\n// Customize buttons\n$( '[data-fancybox=&quot;images&quot;]' ).fancybox({\n    buttons : [\n        'fb',\n        'close'\n    ]\n});</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/NLQVZQ\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <h3 id=\"faq-4\">\n            <a href=\"#faq-4\">#4</a> How to reposition thumbnail grid\n          </h3>\n\n          <p>\n            There is currenty no JS option to change thumbnail grid position. But fancybox is designed so that you can\n            use CSS to change position or dimension for each block (e.g., content area, caption or thumbnail grid).\n            This gives you freedom to completely change the look and feel of the modal window, if needed.\n\n            <a href=\"https://codepen.io/fancyapps/pen/PdMvML\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <h3 id=\"faq-5\">\n            <a href=\"#faq-5\">#5</a> How to disable touch gestures/swiping\n          </h3>\n\n          <p>\n            When you want to make your content selectable or clickable, you have two options:\n          </p>\n\n          <ul>\n            <li>\n              disable touch gestures completely by setting\n              <code>touch:false</code>\n            </li>\n            <li>\n              add\n              <code>data-selectable=\"true\"</code> attribute to your html element\n            </li>\n          </ul>\n\n          <p>\n            <a href=\"https://codepen.io/fancyapps/pen/NLQZWK?editors=1000\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n          <h3 id=\"faq-6\">\n            <a href=\"#faq-6\">#6</a> Slider/carousel add's cloned duplicate items\n          </h3>\n\n          <p>\n            If you are combining fancybox with slider/carousel script and that script clones items to enable infinite\n            navigation, then duplicated items will appear in the gallery.\n            To avoid that -\n            1) initialise fancybox on all items except cloned;\n            2) add custom click event on cloned items and trigger click event on corresponding \"real\" item. Here is an\n            example using Slick slider:\n          </p>\n          <pre><code>// Init fancybox\n// =============\nvar selector = '.slick-slide:not(.slick-cloned)';\n\n// Skip cloned elements\n$().fancybox({\n  selector : selector,\n  backFocus : false\n});\n\n// Attach custom click event on cloned elements, \n// trigger click event on corresponding link\n$(document).on('click', '.slick-cloned', function(e) {\n  $(selector)\n    .eq( ( $(e.currentTarget).attr(\"data-slick-index\") || 0) % $(selector).length )\n    .trigger(\"click.fb-start\", {\n      $trigger: $(this)\n    });\n\n  return false;\n});\n\n// Init Slick\n// ==========\n$(\".main-slider\").slick({\n  slidesToShow   : 3,\n  infinite : true,\n  dots     : false,\n  arrows   : false\n});</code></pre>\n          <p class=\"demo\">\n            <a href=\"https://codepen.io/fancyapps/pen/NLQZBr?editors=1010\" target=\"_blank\">View demo on CodePen</a>\n          </p>\n\n\n        </section>\n\n        <section>\n          <p class=\"text-right mt-5\">\n            <a href=\"#introduction\">Back to Top</a>\n          </p>\n        </section>\n\n      </div>\n    </div>\n  </div>\n\n  <script>\n\n    $(document).ready(function () {\n\n      /* Sticky nvigation */\n\n      var sticky = {\n        $sticky: $('.sticky'),\n        offsets: [],\n        targets: [],\n        stickyTop: null,\n\n        set: function () {\n          var self = this;\n\n          var windowTop = Math.floor($(window).scrollTop());\n\n          self.offsets = [];\n          self.targets = [];\n\n          // Get current top position of sticky element\n          self.stickyTop = self.$sticky.css('position', 'relative').offset().top;\n\n          // Cache all targets and their top positions\n          self.$sticky.find('a').map(function () {\n            var $el = $(this),\n              href = $el.data('target') || $el.attr('href'),\n              $href = /^#./.test(href) && $(href);\n\n            return $href && $href.length && $href.is(':visible') ? [[$href[0].getBoundingClientRect().top + windowTop, href]] : null;\n          })\n            .sort(function (a, b) { return a[0] - b[0] })\n            .each(function () {\n              self.offsets.push(this[0]);\n              self.targets.push(this[1]);\n            });\n        },\n\n        update: function () {\n          var self = this;\n\n          var windowTop = Math.floor($(window).scrollTop());\n          var $stickyLinks = self.$sticky.find('a').removeClass('active');\n          var stickyPosition = 'fixed';\n          var currentIndex = 0;\n\n          // Toggle fixed position depending on visibility\n          if ($(window).width() < 800 || $(window).height() < 500 || self.stickyTop > windowTop) {\n            stickyPosition = 'relative';\n\n          } else {\n\n            for (var i = self.offsets.length; i--;) {\n              if (windowTop >= self.offsets[i] - 2 && (self.offsets[i + 1] === undefined || windowTop <= self.offsets[i + 1] + 2)) {\n                currentIndex = i;\n\n                break;\n              }\n            }\n\n          }\n\n          self.$sticky.css('position', stickyPosition).width($('#leftCol').width());\n\n          $stickyLinks.eq(currentIndex).addClass('active');\n        },\n\n        init: function () {\n          var self = this;\n\n          $(window).on('resize', function () {\n            self.set();\n\n            self.update();\n          });\n\n          $(window).on('scroll', function () {\n            self.update();\n          });\n\n          $(window).trigger('resize');\n        }\n      }\n\n      sticky.init();\n    });\n  </script>\n</body>\n\n</html>\n"
  },
  {
    "path": "gulpfile.js",
    "content": "var gulp = require(\"gulp\"),\n  concat = require(\"gulp-concat\"),\n  uglify = require(\"gulp-uglify\"),\n  rename = require(\"gulp-rename\"),\n  cssnano = require(\"gulp-cssnano\"),\n  autoprefixer = require(\"gulp-autoprefixer\"),\n  header = require(\"gulp-header\"),\n  replace = require(\"gulp-replace\");\n\nvar pkg = require(\"./package.json\");\nvar banner = [\n  \"// ==================================================\",\n  \"// fancyBox v${pkg.version}\",\n  \"//\",\n  \"// Licensed GPLv3 for open source use\",\n  \"// or fancyBox Commercial License for commercial use\",\n  \"//\",\n  \"// http://fancyapps.com/fancybox/\",\n  \"// Copyright ${new Date().getFullYear()} fancyApps\",\n  \"//\",\n  \"// ==================================================\",\n  \"\"\n].join(\"\\n\");\n\n// Concatenate & Minify JS\n\ngulp.task(\"scripts\", function() {\n  return gulp\n    .src([\n      \"src/js/core.js\",\n      \"src/js/media.js\",\n      \"src/js/guestures.js\",\n      \"src/js/slideshow.js\",\n      \"src/js/fullscreen.js\",\n      \"src/js/thumbs.js\",\n      \"src/js/hash.js\",\n      \"src/js/wheel.js\"\n    ])\n    .pipe(concat(\"jquery.fancybox.js\"))\n    .pipe(replace(/({fancybox-version})/g, pkg.version))\n    .pipe(header(banner, {pkg: pkg}))\n    .pipe(gulp.dest(\"dist\"))\n    .pipe(rename({suffix: \".min\"}))\n    .pipe(uglify())\n    .pipe(header(banner, {pkg: pkg}))\n    .pipe(gulp.dest(\"dist\"));\n});\n\n// Compile CSS\n\ngulp.task(\"css\", function() {\n  return gulp\n    .src(\"src/css/*.css\") // Gets all files src/css\n    .pipe(\n      autoprefixer({\n        browsers: [\"last 5 versions\"],\n        cascade: false\n      })\n    )\n    .pipe(concat(\"jquery.fancybox.css\"))\n    .pipe(gulp.dest(\"dist\"))\n    .pipe(rename({suffix: \".min\"}))\n    .pipe(cssnano({zindex: false}))\n    .pipe(gulp.dest(\"dist\"));\n});\n\n// Default Task\ngulp.task(\"default\", [\"scripts\", \"css\"]);\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"@fancyapps/fancybox\",\n  \"description\": \"Touch enabled, responsive and fully customizable jQuery lightbox script\",\n  \"version\": \"3.5.7\",\n  \"homepage\": \"https://fancyapps.com/fancybox/3/\",\n  \"main\": \"dist/jquery.fancybox.js\",\n  \"style\": \"dist/jquery.fancybox.css\",\n  \"author\": \"fancyApps\",\n  \"license\": \"GPL-3.0\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/fancyapps/fancybox.git\"\n  },\n  \"peerDependencies\": {\n    \"jquery\": \">=1.9.0\"\n  },\n  \"devDependencies\": {\n    \"del\": \"^2.2.2\",\n    \"gulp\": \"^3.9.1\",\n    \"gulp-autoprefixer\": \"^3.1.1\",\n    \"gulp-concat\": \"^2.6.1\",\n    \"gulp-cssnano\": \"^2.1.2\",\n    \"gulp-header\": \"^1.8.8\",\n    \"gulp-jshint\": \"^2.0.4\",\n    \"gulp-livereload\": \"^3.8.1\",\n    \"gulp-notify\": \"^2.2.0\",\n    \"gulp-rename\": \"^1.2.2\",\n    \"gulp-replace\": \"^0.5.4\",\n    \"gulp-uglify\": \"^2.0.0\",\n    \"gulp-util\": \"^3.0.8\",\n    \"jshint\": \"^2.9.4\"\n  },\n  \"keywords\": [\n    \"touch\",\n    \"responsive\",\n    \"lightbox\",\n    \"fancybox\",\n    \"gallery\",\n    \"jQuery\",\n    \"plugin\"\n  ],\n  \"bugs\": {\n    \"url\": \"https://github.com/fancyapps/fancybox/issues\"\n  },\n  \"directories\": {\n    \"doc\": \"docs\"\n  },\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  }\n}"
  },
  {
    "path": "src/css/core.css",
    "content": "body.compensate-for-scrollbar {\n    overflow: hidden;\n}\n\n.fancybox-active {\n    height: auto;\n}\n\n.fancybox-is-hidden {\n    left: -9999px;\n    margin: 0;\n    position: absolute !important;\n    top: -9999px;\n    visibility: hidden;\n}\n\n.fancybox-container {\n    -webkit-backface-visibility: hidden;\n    height: 100%;\n    left: 0;\n    outline: none;\n    position: fixed;\n    -webkit-tap-highlight-color: transparent;\n    top: 0;\n    touch-action: manipulation;\n    transform: translateZ(0);\n    width: 100%;\n    z-index: 99992;\n}\n\n.fancybox-container * {\n    box-sizing: border-box;\n}\n\n.fancybox-outer,\n.fancybox-inner,\n.fancybox-bg,\n.fancybox-stage {\n    bottom: 0;\n    left: 0;\n    position: absolute;\n    right: 0;\n    top: 0;\n}\n\n.fancybox-outer {\n    -webkit-overflow-scrolling: touch;\n    overflow-y: auto;\n}\n\n.fancybox-bg {\n    background: rgb(30, 30, 30);\n    opacity: 0;\n    transition-duration: inherit;\n    transition-property: opacity;\n    transition-timing-function: cubic-bezier(.47, 0, .74, .71);\n}\n\n.fancybox-is-open .fancybox-bg {\n    opacity: .9;\n    transition-timing-function: cubic-bezier(.22, .61, .36, 1);\n}\n\n.fancybox-infobar,\n.fancybox-toolbar,\n.fancybox-caption,\n.fancybox-navigation .fancybox-button {\n    direction: ltr;\n    opacity: 0;\n    position: absolute;\n    transition: opacity .25s ease, visibility 0s ease .25s;\n    visibility: hidden;\n    z-index: 99997;\n}\n\n.fancybox-show-infobar .fancybox-infobar,\n.fancybox-show-toolbar .fancybox-toolbar,\n.fancybox-show-caption .fancybox-caption,\n.fancybox-show-nav .fancybox-navigation .fancybox-button {\n    opacity: 1;\n    transition: opacity .25s ease 0s, visibility 0s ease 0s;\n    visibility: visible;\n}\n\n.fancybox-infobar {\n    color: #ccc;\n    font-size: 13px;\n    -webkit-font-smoothing: subpixel-antialiased;\n    height: 44px;\n    left: 0;\n    line-height: 44px;\n    min-width: 44px;\n    mix-blend-mode: difference;\n    padding: 0 10px;\n    pointer-events: none;\n    top: 0;\n    -webkit-touch-callout: none;\n    user-select: none;\n}\n\n.fancybox-toolbar {\n    right: 0;\n    top: 0;\n}\n\n.fancybox-stage {\n    direction: ltr;\n    overflow: visible;\n    transform: translateZ(0);\n    z-index: 99994;\n}\n\n.fancybox-is-open .fancybox-stage {\n    overflow: hidden;\n}\n\n.fancybox-slide {\n    -webkit-backface-visibility: hidden;\n    /* Using without prefix would break IE11 */\n    display: none;\n    height: 100%;\n    left: 0;\n    outline: none;\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding: 44px;\n    position: absolute;\n    text-align: center;\n    top: 0;\n    transition-property: transform, opacity;\n    white-space: normal;\n    width: 100%;\n    z-index: 99994;\n}\n\n.fancybox-slide::before {\n    content: '';\n    display: inline-block;\n    font-size: 0;\n    height: 100%;\n    vertical-align: middle;\n    width: 0;\n}\n\n.fancybox-is-sliding .fancybox-slide,\n.fancybox-slide--previous,\n.fancybox-slide--current,\n.fancybox-slide--next {\n    display: block;\n}\n\n.fancybox-slide--image {\n    overflow: hidden;\n    padding: 44px 0;\n}\n\n.fancybox-slide--image::before {\n    display: none;\n}\n\n.fancybox-slide--html {\n    padding: 6px;\n}\n\n.fancybox-content {\n    background: #fff;\n    display: inline-block;\n    margin: 0;\n    max-width: 100%;\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding: 44px;\n    position: relative;\n    text-align: left;\n    vertical-align: middle;\n}\n\n.fancybox-slide--image .fancybox-content {\n    animation-timing-function: cubic-bezier(.5, 0, .14, 1);\n    -webkit-backface-visibility: hidden;\n    background: transparent;\n    background-repeat: no-repeat;\n    background-size: 100% 100%;\n    left: 0;\n    max-width: none;\n    overflow: visible;\n    padding: 0;\n    position: absolute;\n    top: 0;\n    transform-origin: top left;\n    transition-property: transform, opacity;\n    user-select: none;\n    z-index: 99995;\n}\n\n.fancybox-can-zoomOut .fancybox-content {\n    cursor: zoom-out;\n}\n\n.fancybox-can-zoomIn .fancybox-content {\n    cursor: zoom-in;\n}\n\n.fancybox-can-swipe .fancybox-content,\n.fancybox-can-pan .fancybox-content {\n    cursor: grab;\n}\n\n.fancybox-is-grabbing .fancybox-content {\n    cursor: grabbing;\n}\n\n.fancybox-container [data-selectable='true'] {\n    cursor: text;\n}\n\n.fancybox-image,\n.fancybox-spaceball {\n    background: transparent;\n    border: 0;\n    height: 100%;\n    left: 0;\n    margin: 0;\n    max-height: none;\n    max-width: none;\n    padding: 0;\n    position: absolute;\n    top: 0;\n    user-select: none;\n    width: 100%;\n}\n\n.fancybox-spaceball {\n    z-index: 1;\n}\n\n.fancybox-slide--video .fancybox-content,\n.fancybox-slide--map .fancybox-content,\n.fancybox-slide--pdf .fancybox-content,\n.fancybox-slide--iframe .fancybox-content {\n    height: 100%;\n    overflow: visible;\n    padding: 0;\n    width: 100%;\n}\n\n.fancybox-slide--video .fancybox-content {\n    background: #000;\n}\n\n.fancybox-slide--map .fancybox-content {\n    background: #e5e3df;\n}\n\n.fancybox-slide--iframe .fancybox-content {\n    background: #fff;\n}\n\n.fancybox-video,\n.fancybox-iframe {\n    background: transparent;\n    border: 0;\n    display: block;\n    height: 100%;\n    margin: 0;\n    overflow: hidden;\n    padding: 0;\n    width: 100%;\n}\n\n/* Fix iOS */\n.fancybox-iframe {\n    left: 0;\n    position: absolute;\n    top: 0;\n}\n\n.fancybox-error {\n    background: #fff;\n    cursor: default;\n    max-width: 400px;\n    padding: 40px;\n    width: 100%;\n}\n\n.fancybox-error p {\n    color: #444;\n    font-size: 16px;\n    line-height: 20px;\n    margin: 0;\n    padding: 0;\n}\n\n/* Buttons */\n\n.fancybox-button {\n    background: rgba(30, 30, 30, .6);\n    border: 0;\n    border-radius: 0;\n    box-shadow: none;\n    cursor: pointer;\n    display: inline-block;\n    height: 44px;\n    margin: 0;\n    padding: 10px;\n    position: relative;\n    transition: color .2s;\n    vertical-align: top;\n    visibility: inherit;\n    width: 44px;\n}\n\n.fancybox-button,\n.fancybox-button:visited,\n.fancybox-button:link {\n    color: #ccc;\n}\n\n.fancybox-button:hover {\n    color: #fff;\n}\n\n.fancybox-button:focus {\n    outline: none;\n}\n\n.fancybox-button.fancybox-focus {\n    outline: 1px dotted;\n}\n\n.fancybox-button[disabled],\n.fancybox-button[disabled]:hover {\n    color: #888;\n    cursor: default;\n    outline: none;\n}\n\n/* Fix IE11 */\n.fancybox-button div {\n    height: 100%;\n}\n\n.fancybox-button svg {\n    display: block;\n    height: 100%;\n    overflow: visible;\n    position: relative;\n    width: 100%;\n}\n\n.fancybox-button svg path {\n    fill: currentColor;\n    stroke-width: 0;\n}\n\n.fancybox-button--play svg:nth-child(2),\n.fancybox-button--fsenter svg:nth-child(2) {\n    display: none;\n}\n\n.fancybox-button--pause svg:nth-child(1),\n.fancybox-button--fsexit svg:nth-child(1) {\n    display: none;\n}\n\n.fancybox-progress {\n    background: #ff5268;\n    height: 2px;\n    left: 0;\n    position: absolute;\n    right: 0;\n    top: 0;\n    transform: scaleX(0);\n    transform-origin: 0;\n    transition-property: transform;\n    transition-timing-function: linear;\n    z-index: 99998;\n}\n\n/* Close button on the top right corner of html content */\n\n.fancybox-close-small {\n    background: transparent;\n    border: 0;\n    border-radius: 0;\n    color: #ccc;\n    cursor: pointer;\n    opacity: .8;\n    padding: 8px;\n    position: absolute;\n    right: -12px;\n    top: -44px;\n    z-index: 401;\n}\n\n.fancybox-close-small:hover {\n    color: #fff;\n    opacity: 1;\n}\n\n.fancybox-slide--html .fancybox-close-small {\n    color: currentColor;\n    padding: 10px;\n    right: 0;\n    top: 0;\n}\n\n.fancybox-slide--image.fancybox-is-scaling .fancybox-content {\n    overflow: hidden;\n}\n\n.fancybox-is-scaling .fancybox-close-small,\n.fancybox-is-zoomable.fancybox-can-pan .fancybox-close-small {\n    display: none;\n}\n\n/* Navigation arrows */\n\n.fancybox-navigation .fancybox-button {\n    background-clip: content-box;\n    height: 100px;\n    opacity: 0;\n    position: absolute;\n    top: calc(50% - 50px);\n    width: 70px;\n}\n\n.fancybox-navigation .fancybox-button div {\n    padding: 7px;\n}\n\n.fancybox-navigation .fancybox-button--arrow_left {\n    left: 0;\n    left: env(safe-area-inset-left);\n    padding: 31px 26px 31px 6px;\n}\n\n.fancybox-navigation .fancybox-button--arrow_right {\n    padding: 31px 6px 31px 26px;\n    right: 0;\n    right: env(safe-area-inset-right);\n}\n\n/* Caption */\n\n.fancybox-caption {\n    background: linear-gradient(to top,\n        rgba(0, 0, 0, .85) 0%,\n        rgba(0, 0, 0, .3) 50%,\n        rgba(0, 0, 0, .15) 65%,\n        rgba(0, 0, 0, .075) 75.5%,\n        rgba(0, 0, 0, .037) 82.85%,\n        rgba(0, 0, 0, .019) 88%,\n        rgba(0, 0, 0, 0) 100%);\n    bottom: 0;\n    color: #eee;\n    font-size: 14px;\n    font-weight: 400;\n    left: 0;\n    line-height: 1.5;\n    padding: 75px 44px 25px 44px;\n    pointer-events: none;\n    right: 0;\n    text-align: center;\n    z-index: 99996;\n}\n\n@supports (padding: max(0px)) {\n    .fancybox-caption {\n        padding: 75px max(44px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(44px, env(safe-area-inset-left));\n    }\n}\n\n.fancybox-caption--separate {\n    margin-top: -50px;\n}\n\n.fancybox-caption__body {\n    max-height: 50vh;\n    overflow: auto;\n    pointer-events: all;\n}\n\n.fancybox-caption a,\n.fancybox-caption a:link,\n.fancybox-caption a:visited {\n    color: #ccc;\n    text-decoration: none;\n}\n\n.fancybox-caption a:hover {\n    color: #fff;\n    text-decoration: underline;\n}\n\n/* Loading indicator */\n\n.fancybox-loading {\n    animation: fancybox-rotate 1s linear infinite;\n    background: transparent;\n    border: 4px solid #888;\n    border-bottom-color: #fff;\n    border-radius: 50%;\n    height: 50px;\n    left: 50%;\n    margin: -25px 0 0 -25px;\n    opacity: .7;\n    padding: 0;\n    position: absolute;\n    top: 50%;\n    width: 50px;\n    z-index: 99999;\n}\n\n@keyframes fancybox-rotate {\n    100% {\n        transform: rotate(360deg);\n    }\n}\n\n/* Transition effects */\n\n.fancybox-animated {\n    transition-timing-function: cubic-bezier(0, 0, .25, 1);\n}\n\n/* transitionEffect: slide */\n\n.fancybox-fx-slide.fancybox-slide--previous {\n    opacity: 0;\n    transform: translate3d(-100%, 0, 0);\n}\n\n.fancybox-fx-slide.fancybox-slide--next {\n    opacity: 0;\n    transform: translate3d(100%, 0, 0);\n}\n\n.fancybox-fx-slide.fancybox-slide--current {\n    opacity: 1;\n    transform: translate3d(0, 0, 0);\n}\n\n/* transitionEffect: fade */\n\n.fancybox-fx-fade.fancybox-slide--previous,\n.fancybox-fx-fade.fancybox-slide--next {\n    opacity: 0;\n    transition-timing-function: cubic-bezier(.19, 1, .22, 1);\n}\n\n.fancybox-fx-fade.fancybox-slide--current {\n    opacity: 1;\n}\n\n/* transitionEffect: zoom-in-out */\n\n.fancybox-fx-zoom-in-out.fancybox-slide--previous {\n    opacity: 0;\n    transform: scale3d(1.5, 1.5, 1.5);\n}\n\n.fancybox-fx-zoom-in-out.fancybox-slide--next {\n    opacity: 0;\n    transform: scale3d(.5, .5, .5);\n}\n\n.fancybox-fx-zoom-in-out.fancybox-slide--current {\n    opacity: 1;\n    transform: scale3d(1, 1, 1);\n}\n\n/* transitionEffect: rotate */\n\n.fancybox-fx-rotate.fancybox-slide--previous {\n    opacity: 0;\n    transform: rotate(-360deg);\n}\n\n.fancybox-fx-rotate.fancybox-slide--next {\n    opacity: 0;\n    transform: rotate(360deg);\n}\n\n.fancybox-fx-rotate.fancybox-slide--current {\n    opacity: 1;\n    transform: rotate(0deg);\n}\n\n/* transitionEffect: circular */\n\n.fancybox-fx-circular.fancybox-slide--previous {\n    opacity: 0;\n    transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0);\n}\n\n.fancybox-fx-circular.fancybox-slide--next {\n    opacity: 0;\n    transform: scale3d(0, 0, 0) translate3d(100%, 0, 0);\n}\n\n.fancybox-fx-circular.fancybox-slide--current {\n    opacity: 1;\n    transform: scale3d(1, 1, 1) translate3d(0, 0, 0);\n}\n\n/* transitionEffect: tube */\n\n.fancybox-fx-tube.fancybox-slide--previous {\n    transform: translate3d(-100%, 0, 0) scale(.1) skew(-10deg);\n}\n\n.fancybox-fx-tube.fancybox-slide--next {\n    transform: translate3d(100%, 0, 0) scale(.1) skew(10deg);\n}\n\n.fancybox-fx-tube.fancybox-slide--current {\n    transform: translate3d(0, 0, 0) scale(1);\n}\n\n/* Styling for Small-Screen Devices */\n@media all and (max-height: 576px) {\n    .fancybox-slide {\n        padding-left: 6px;\n        padding-right: 6px;\n    }\n\n    .fancybox-slide--image {\n        padding: 6px 0;\n    }\n\n    .fancybox-close-small {\n        right: -6px;\n    }\n\n    .fancybox-slide--image .fancybox-close-small {\n        background: #4e4e4e;\n        color: #f2f4f6;\n        height: 36px;\n        opacity: 1;\n        padding: 6px;\n        right: 0;\n        top: 0;\n        width: 36px;\n    }\n\n    .fancybox-caption {\n        padding-left: 12px;\n        padding-right: 12px;\n    }\n\n    @supports (padding: max(0px)) {\n        .fancybox-caption {\n            padding-left: max(12px, env(safe-area-inset-left));\n            padding-right: max(12px, env(safe-area-inset-right));\n        }\n    }\n}"
  },
  {
    "path": "src/css/fullscreen.css",
    "content": "\n/* Fullscreen  */\n\n.fancybox-button--fullscreen::before {\n\twidth: 15px;\n\theight: 11px;\n\tleft: calc(50% - 7px);\n\ttop: calc(50% - 6px);\n\tborder: 2px solid;\n\tbackground: none;\n}\n"
  },
  {
    "path": "src/css/share.css",
    "content": "/* Share */\n\n.fancybox-share {\n    background: #f4f4f4;\n    border-radius: 3px;\n    max-width: 90%;\n    padding: 30px;\n    text-align: center;\n}\n\n.fancybox-share h1 {\n    color: #222;\n    font-size: 35px;\n    font-weight: 700;\n    margin: 0 0 20px 0;\n}\n\n.fancybox-share p {\n    margin: 0;\n    padding: 0;\n}\n\n.fancybox-share__button {\n    border: 0;\n    border-radius: 3px;\n    display: inline-block;\n    font-size: 14px;\n    font-weight: 700;\n    line-height: 40px;\n    margin: 0 5px 10px 5px;\n    min-width: 130px;\n    padding: 0 15px;\n    text-decoration: none;\n    transition: all .2s;\n    user-select: none;\n    white-space: nowrap;\n}\n\n.fancybox-share__button:visited,\n.fancybox-share__button:link {\n    color: #fff;\n}\n\n.fancybox-share__button:hover {\n    text-decoration: none;\n}\n\n.fancybox-share__button--fb {\n    background: #3b5998;\n}\n\n.fancybox-share__button--fb:hover {\n    background: #344e86;\n}\n\n.fancybox-share__button--pt {\n    background: #bd081d;\n}\n\n.fancybox-share__button--pt:hover {\n    background: #aa0719;\n}\n\n.fancybox-share__button--tw {\n    background: #1da1f2;\n}\n\n.fancybox-share__button--tw:hover {\n    background: #0d95e8;\n}\n\n.fancybox-share__button svg {\n    height: 25px;\n    margin-right: 7px;\n    position: relative;\n    top: -1px;\n    vertical-align: middle;\n    width: 25px;\n}\n\n.fancybox-share__button svg path {\n    fill: #fff;\n}\n\n.fancybox-share__input {\n    background: transparent;\n    border: 0;\n    border-bottom: 1px solid #d7d7d7;\n    border-radius: 0;\n    color: #5d5b5b;\n    font-size: 14px;\n    margin: 10px 0 0 0;\n    outline: none;\n    padding: 10px 15px;\n    width: 100%;\n}"
  },
  {
    "path": "src/css/slideshow.css",
    "content": "/* Slideshow button */\n\n.fancybox-button--play {}\n\n.fancybox-button--play::before,\n.fancybox-button--pause::before {\n\ttop: calc(50% - 6px);\n\tleft: calc(50% - 4px);\n\tbackground: transparent;\n}\n\n.fancybox-button--play::before {\n\twidth: 0;\n\theight: 0;\n\tborder-top: 6px inset transparent;\n\tborder-bottom: 6px inset transparent;\n\tborder-left: 10px solid;\n\tborder-radius: 1px;\n}\n\n.fancybox-button--pause::before {\n\twidth: 7px;\n\theight: 11px;\n\tborder-style: solid;\n\tborder-width: 0 2px 0 2px;\n}\n"
  },
  {
    "path": "src/css/thumbs.css",
    "content": "/* Thumbs */\n\n.fancybox-thumbs {\n    background: #ddd;\n    bottom: 0;\n    display: none;\n    margin: 0;\n    -webkit-overflow-scrolling: touch;\n    -ms-overflow-style: -ms-autohiding-scrollbar;\n    padding: 2px 2px 4px 2px;\n    position: absolute;\n    right: 0;\n    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n    top: 0;\n    width: 212px;\n    z-index: 99995;\n}\n\n.fancybox-thumbs-x {\n    overflow-x: auto;\n    overflow-y: hidden;\n}\n\n.fancybox-show-thumbs .fancybox-thumbs {\n    display: block;\n}\n\n.fancybox-show-thumbs .fancybox-inner {\n    right: 212px;\n}\n\n.fancybox-thumbs__list {\n    font-size: 0;\n    height: 100%;\n    list-style: none;\n    margin: 0;\n    overflow-x: hidden;\n    overflow-y: auto;\n    padding: 0;\n    position: absolute;\n    position: relative;\n    white-space: nowrap;\n    width: 100%;\n}\n\n.fancybox-thumbs-x .fancybox-thumbs__list {\n    overflow: hidden;\n}\n\n.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar {\n    width: 7px;\n}\n\n.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-track {\n    background: #fff;\n    border-radius: 10px;\n    box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);\n}\n\n.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-thumb {\n    background: #2a2a2a;\n    border-radius: 10px;\n}\n\n.fancybox-thumbs__list a {\n    backface-visibility: hidden;\n    background-color: rgba(0, 0, 0, .1);\n    background-position: center center;\n    background-repeat: no-repeat;\n    background-size: cover;\n    cursor: pointer;\n    float: left;\n    height: 75px;\n    margin: 2px;\n    max-height: calc(100% - 8px);\n    max-width: calc(50% - 4px);\n    outline: none;\n    overflow: hidden;\n    padding: 0;\n    position: relative;\n    -webkit-tap-highlight-color: transparent;\n    width: 100px;\n}\n\n.fancybox-thumbs__list a::before {\n    border: 6px solid #ff5268;\n    bottom: 0;\n    content: '';\n    left: 0;\n    opacity: 0;\n    position: absolute;\n    right: 0;\n    top: 0;\n    transition: all .2s cubic-bezier(.25, .46, .45, .94);\n    z-index: 99991;\n}\n\n.fancybox-thumbs__list a:focus::before {\n    opacity: .5;\n}\n\n.fancybox-thumbs__list a.fancybox-thumbs-active::before {\n    opacity: 1;\n}\n\n/* Styling for Small-Screen Devices */\n@media all and (max-width: 576px) {\n    .fancybox-thumbs {\n        width: 110px;\n    }\n\n    .fancybox-show-thumbs .fancybox-inner {\n        right: 110px;\n    }\n\n    .fancybox-thumbs__list a {\n        max-width: calc(100% - 10px);\n    }\n}"
  },
  {
    "path": "src/js/core.js",
    "content": "(function (window, document, $, undefined) {\n  \"use strict\";\n\n  window.console = window.console || {\n    info: function (stuff) {}\n  };\n\n  // If there's no jQuery, fancyBox can't work\n  // =========================================\n\n  if (!$) {\n    return;\n  }\n\n  // Check if fancyBox is already initialized\n  // ========================================\n\n  if ($.fn.fancybox) {\n    console.info(\"fancyBox already initialized\");\n\n    return;\n  }\n\n  // Private default settings\n  // ========================\n\n  var defaults = {\n    // Close existing modals\n    // Set this to false if you do not need to stack multiple instances\n    closeExisting: false,\n\n    // Enable infinite gallery navigation\n    loop: false,\n\n    // Horizontal space between slides\n    gutter: 50,\n\n    // Enable keyboard navigation\n    keyboard: true,\n\n    // Should allow caption to overlap the content\n    preventCaptionOverlap: true,\n\n    // Should display navigation arrows at the screen edges\n    arrows: true,\n\n    // Should display counter at the top left corner\n    infobar: true,\n\n    // Should display close button (using `btnTpl.smallBtn` template) over the content\n    // Can be true, false, \"auto\"\n    // If \"auto\" - will be automatically enabled for \"html\", \"inline\" or \"ajax\" items\n    smallBtn: \"auto\",\n\n    // Should display toolbar (buttons at the top)\n    // Can be true, false, \"auto\"\n    // If \"auto\" - will be automatically hidden if \"smallBtn\" is enabled\n    toolbar: \"auto\",\n\n    // What buttons should appear in the top right corner.\n    // Buttons will be created using templates from `btnTpl` option\n    // and they will be placed into toolbar (class=\"fancybox-toolbar\"` element)\n    buttons: [\n      \"zoom\",\n      //\"share\",\n      \"slideShow\",\n      //\"fullScreen\",\n      //\"download\",\n      \"thumbs\",\n      \"close\"\n    ],\n\n    // Detect \"idle\" time in seconds\n    idleTime: 3,\n\n    // Disable right-click and use simple image protection for images\n    protect: false,\n\n    // Shortcut to make content \"modal\" - disable keyboard navigtion, hide buttons, etc\n    modal: false,\n\n    image: {\n      // Wait for images to load before displaying\n      //   true  - wait for image to load and then display;\n      //   false - display thumbnail and load the full-sized image over top,\n      //           requires predefined image dimensions (`data-width` and `data-height` attributes)\n      preload: false\n    },\n\n    ajax: {\n      // Object containing settings for ajax request\n      settings: {\n        // This helps to indicate that request comes from the modal\n        // Feel free to change naming\n        data: {\n          fancybox: true\n        }\n      }\n    },\n\n    iframe: {\n      // Iframe template\n      tpl: '<iframe id=\"fancybox-frame{rnd}\" name=\"fancybox-frame{rnd}\" class=\"fancybox-iframe\" allowfullscreen=\"allowfullscreen\" allow=\"autoplay; fullscreen\" src=\"\"></iframe>',\n\n      // Preload iframe before displaying it\n      // This allows to calculate iframe content width and height\n      // (note: Due to \"Same Origin Policy\", you can't get cross domain data).\n      preload: true,\n\n      // Custom CSS styling for iframe wrapping element\n      // You can use this to set custom iframe dimensions\n      css: {},\n\n      // Iframe tag attributes\n      attr: {\n        scrolling: \"auto\"\n      }\n    },\n\n    // For HTML5 video only\n    video: {\n      tpl: '<video class=\"fancybox-video\" controls controlsList=\"nodownload\" poster=\"{{poster}}\">' +\n        '<source src=\"{{src}}\" type=\"{{format}}\" />' +\n        'Sorry, your browser doesn\\'t support embedded videos, <a href=\"{{src}}\">download</a> and watch with your favorite video player!' +\n        \"</video>\",\n      format: \"\", // custom video format\n      autoStart: true\n    },\n\n    // Default content type if cannot be detected automatically\n    defaultType: \"image\",\n\n    // Open/close animation type\n    // Possible values:\n    //   false            - disable\n    //   \"zoom\"           - zoom images from/to thumbnail\n    //   \"fade\"\n    //   \"zoom-in-out\"\n    //\n    animationEffect: \"zoom\",\n\n    // Duration in ms for open/close animation\n    animationDuration: 366,\n\n    // Should image change opacity while zooming\n    // If opacity is \"auto\", then opacity will be changed if image and thumbnail have different aspect ratios\n    zoomOpacity: \"auto\",\n\n    // Transition effect between slides\n    //\n    // Possible values:\n    //   false            - disable\n    //   \"fade'\n    //   \"slide'\n    //   \"circular'\n    //   \"tube'\n    //   \"zoom-in-out'\n    //   \"rotate'\n    //\n    transitionEffect: \"fade\",\n\n    // Duration in ms for transition animation\n    transitionDuration: 366,\n\n    // Custom CSS class for slide element\n    slideClass: \"\",\n\n    // Custom CSS class for layout\n    baseClass: \"\",\n\n    // Base template for layout\n    baseTpl: '<div class=\"fancybox-container\" role=\"dialog\" tabindex=\"-1\">' +\n      '<div class=\"fancybox-bg\"></div>' +\n      '<div class=\"fancybox-inner\">' +\n      '<div class=\"fancybox-infobar\"><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div>' +\n      '<div class=\"fancybox-toolbar\">{{buttons}}</div>' +\n      '<div class=\"fancybox-navigation\">{{arrows}}</div>' +\n      '<div class=\"fancybox-stage\"></div>' +\n      '<div class=\"fancybox-caption\"><div class=\"fancybox-caption__body\"></div></div>' +\n      \"</div>\" +\n      \"</div>\",\n\n    // Loading indicator template\n    spinnerTpl: '<div class=\"fancybox-loading\"></div>',\n\n    // Error message template\n    errorTpl: '<div class=\"fancybox-error\"><p>{{ERROR}}</p></div>',\n\n    btnTpl: {\n      download: '<a download data-fancybox-download class=\"fancybox-button fancybox-button--download\" title=\"{{DOWNLOAD}}\" href=\"javascript:;\">' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z\"/></svg>' +\n        \"</a>\",\n\n      zoom: '<button data-fancybox-zoom class=\"fancybox-button fancybox-button--zoom\" title=\"{{ZOOM}}\">' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z\"/></svg>' +\n        \"</button>\",\n\n      close: '<button data-fancybox-close class=\"fancybox-button fancybox-button--close\" title=\"{{CLOSE}}\">' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z\"/></svg>' +\n        \"</button>\",\n\n      // Arrows\n      arrowLeft: '<button data-fancybox-prev class=\"fancybox-button fancybox-button--arrow_left\" title=\"{{PREV}}\">' +\n        '<div><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z\"/></svg></div>' +\n        \"</button>\",\n\n      arrowRight: '<button data-fancybox-next class=\"fancybox-button fancybox-button--arrow_right\" title=\"{{NEXT}}\">' +\n        '<div><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z\"/></svg></div>' +\n        \"</button>\",\n\n      // This small close button will be appended to your html/inline/ajax content by default,\n      // if \"smallBtn\" option is not set to false\n      smallBtn: '<button type=\"button\" data-fancybox-close class=\"fancybox-button fancybox-close-small\" title=\"{{CLOSE}}\">' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1\" viewBox=\"0 0 24 24\"><path d=\"M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z\"/></svg>' +\n        \"</button>\"\n    },\n\n    // Container is injected into this element\n    parentEl: \"body\",\n\n    // Hide browser vertical scrollbars; use at your own risk\n    hideScrollbar: true,\n\n    // Focus handling\n    // ==============\n\n    // Try to focus on the first focusable element after opening\n    autoFocus: true,\n\n    // Put focus back to active element after closing\n    backFocus: true,\n\n    // Do not let user to focus on element outside modal content\n    trapFocus: true,\n\n    // Module specific options\n    // =======================\n\n    fullScreen: {\n      autoStart: false\n    },\n\n    // Set `touch: false` to disable panning/swiping\n    touch: {\n      vertical: true, // Allow to drag content vertically\n      momentum: true // Continue movement after releasing mouse/touch when panning\n    },\n\n    // Hash value when initializing manually,\n    // set `false` to disable hash change\n    hash: null,\n\n    // Customize or add new media types\n    // Example:\n    /*\n      media : {\n        youtube : {\n          params : {\n            autoplay : 0\n          }\n        }\n      }\n    */\n    media: {},\n\n    slideShow: {\n      autoStart: false,\n      speed: 3000\n    },\n\n    thumbs: {\n      autoStart: false, // Display thumbnails on opening\n      hideOnClose: true, // Hide thumbnail grid when closing animation starts\n      parentEl: \".fancybox-container\", // Container is injected into this element\n      axis: \"y\" // Vertical (y) or horizontal (x) scrolling\n    },\n\n    // Use mousewheel to navigate gallery\n    // If 'auto' - enabled for images only\n    wheel: \"auto\",\n\n    // Callbacks\n    //==========\n\n    // See Documentation/API/Events for more information\n    // Example:\n    /*\n      afterShow: function( instance, current ) {\n        console.info( 'Clicked element:' );\n        console.info( current.opts.$orig );\n      }\n    */\n\n    onInit: $.noop, // When instance has been initialized\n\n    beforeLoad: $.noop, // Before the content of a slide is being loaded\n    afterLoad: $.noop, // When the content of a slide is done loading\n\n    beforeShow: $.noop, // Before open animation starts\n    afterShow: $.noop, // When content is done loading and animating\n\n    beforeClose: $.noop, // Before the instance attempts to close. Return false to cancel the close.\n    afterClose: $.noop, // After instance has been closed\n\n    onActivate: $.noop, // When instance is brought to front\n    onDeactivate: $.noop, // When other instance has been activated\n\n    // Interaction\n    // ===========\n\n    // Use options below to customize taken action when user clicks or double clicks on the fancyBox area,\n    // each option can be string or method that returns value.\n    //\n    // Possible values:\n    //   \"close\"           - close instance\n    //   \"next\"            - move to next gallery item\n    //   \"nextOrClose\"     - move to next gallery item or close if gallery has only one item\n    //   \"toggleControls\"  - show/hide controls\n    //   \"zoom\"            - zoom image (if loaded)\n    //   false             - do nothing\n\n    // Clicked on the content\n    clickContent: function (current, event) {\n      return current.type === \"image\" ? \"zoom\" : false;\n    },\n\n    // Clicked on the slide\n    clickSlide: \"close\",\n\n    // Clicked on the background (backdrop) element;\n    // if you have not changed the layout, then most likely you need to use `clickSlide` option\n    clickOutside: \"close\",\n\n    // Same as previous two, but for double click\n    dblclickContent: false,\n    dblclickSlide: false,\n    dblclickOutside: false,\n\n    // Custom options when mobile device is detected\n    // =============================================\n\n    mobile: {\n      preventCaptionOverlap: false,\n      idleTime: false,\n      clickContent: function (current, event) {\n        return current.type === \"image\" ? \"toggleControls\" : false;\n      },\n      clickSlide: function (current, event) {\n        return current.type === \"image\" ? \"toggleControls\" : \"close\";\n      },\n      dblclickContent: function (current, event) {\n        return current.type === \"image\" ? \"zoom\" : false;\n      },\n      dblclickSlide: function (current, event) {\n        return current.type === \"image\" ? \"zoom\" : false;\n      }\n    },\n\n    // Internationalization\n    // ====================\n\n    lang: \"en\",\n    i18n: {\n      en: {\n        CLOSE: \"Close\",\n        NEXT: \"Next\",\n        PREV: \"Previous\",\n        ERROR: \"The requested content cannot be loaded. <br/> Please try again later.\",\n        PLAY_START: \"Start slideshow\",\n        PLAY_STOP: \"Pause slideshow\",\n        FULL_SCREEN: \"Full screen\",\n        THUMBS: \"Thumbnails\",\n        DOWNLOAD: \"Download\",\n        SHARE: \"Share\",\n        ZOOM: \"Zoom\"\n      },\n      de: {\n        CLOSE: \"Schlie&szlig;en\",\n        NEXT: \"Weiter\",\n        PREV: \"Zur&uuml;ck\",\n        ERROR: \"Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es sp&auml;ter nochmal.\",\n        PLAY_START: \"Diaschau starten\",\n        PLAY_STOP: \"Diaschau beenden\",\n        FULL_SCREEN: \"Vollbild\",\n        THUMBS: \"Vorschaubilder\",\n        DOWNLOAD: \"Herunterladen\",\n        SHARE: \"Teilen\",\n        ZOOM: \"Vergr&ouml;&szlig;ern\"\n      }\n    }\n  };\n\n  // Few useful variables and methods\n  // ================================\n\n  var $W = $(window);\n  var $D = $(document);\n\n  var called = 0;\n\n  // Check if an object is a jQuery object and not a native JavaScript object\n  // ========================================================================\n  var isQuery = function (obj) {\n    return obj && obj.hasOwnProperty && obj instanceof $;\n  };\n\n  // Handle multiple browsers for \"requestAnimationFrame\" and \"cancelAnimationFrame\"\n  // ===============================================================================\n  var requestAFrame = (function () {\n    return (\n      window.requestAnimationFrame ||\n      window.webkitRequestAnimationFrame ||\n      window.mozRequestAnimationFrame ||\n      window.oRequestAnimationFrame ||\n      // if all else fails, use setTimeout\n      function (callback) {\n        return window.setTimeout(callback, 1000 / 60);\n      }\n    );\n  })();\n\n  var cancelAFrame = (function () {\n    return (\n      window.cancelAnimationFrame ||\n      window.webkitCancelAnimationFrame ||\n      window.mozCancelAnimationFrame ||\n      window.oCancelAnimationFrame ||\n      function (id) {\n        window.clearTimeout(id);\n      }\n    );\n  })();\n\n  // Detect the supported transition-end event property name\n  // =======================================================\n  var transitionEnd = (function () {\n    var el = document.createElement(\"fakeelement\"),\n      t;\n\n    var transitions = {\n      transition: \"transitionend\",\n      OTransition: \"oTransitionEnd\",\n      MozTransition: \"transitionend\",\n      WebkitTransition: \"webkitTransitionEnd\"\n    };\n\n    for (t in transitions) {\n      if (el.style[t] !== undefined) {\n        return transitions[t];\n      }\n    }\n\n    return \"transitionend\";\n  })();\n\n  // Force redraw on an element.\n  // This helps in cases where the browser doesn't redraw an updated element properly\n  // ================================================================================\n  var forceRedraw = function ($el) {\n    return $el && $el.length && $el[0].offsetHeight;\n  };\n\n  // Exclude array (`buttons`) options from deep merging\n  // ===================================================\n  var mergeOpts = function (opts1, opts2) {\n    var rez = $.extend(true, {}, opts1, opts2);\n\n    $.each(opts2, function (key, value) {\n      if ($.isArray(value)) {\n        rez[key] = value;\n      }\n    });\n\n    return rez;\n  };\n\n  // How much of an element is visible in viewport\n  // =============================================\n\n  var inViewport = function (elem) {\n    var elemCenter, rez;\n\n    if (!elem || elem.ownerDocument !== document) {\n      return false;\n    }\n\n    $(\".fancybox-container\").css(\"pointer-events\", \"none\");\n\n    elemCenter = {\n      x: elem.getBoundingClientRect().left + elem.offsetWidth / 2,\n      y: elem.getBoundingClientRect().top + elem.offsetHeight / 2\n    };\n\n    rez = document.elementFromPoint(elemCenter.x, elemCenter.y) === elem;\n\n    $(\".fancybox-container\").css(\"pointer-events\", \"\");\n\n    return rez;\n  };\n\n  // Class definition\n  // ================\n\n  var FancyBox = function (content, opts, index) {\n    var self = this;\n\n    self.opts = mergeOpts({\n      index: index\n    }, $.fancybox.defaults);\n\n    if ($.isPlainObject(opts)) {\n      self.opts = mergeOpts(self.opts, opts);\n    }\n\n    if ($.fancybox.isMobile) {\n      self.opts = mergeOpts(self.opts, self.opts.mobile);\n    }\n\n    self.id = self.opts.id || ++called;\n\n    self.currIndex = parseInt(self.opts.index, 10) || 0;\n    self.prevIndex = null;\n\n    self.prevPos = null;\n    self.currPos = 0;\n\n    self.firstRun = true;\n\n    // All group items\n    self.group = [];\n\n    // Existing slides (for current, next and previous gallery items)\n    self.slides = {};\n\n    // Create group elements\n    self.addContent(content);\n\n    if (!self.group.length) {\n      return;\n    }\n\n    self.init();\n  };\n\n  $.extend(FancyBox.prototype, {\n    // Create DOM structure\n    // ====================\n\n    init: function () {\n      var self = this,\n        firstItem = self.group[self.currIndex],\n        firstItemOpts = firstItem.opts,\n        $container,\n        buttonStr;\n\n      if (firstItemOpts.closeExisting) {\n        $.fancybox.close(true);\n      }\n\n      // Hide scrollbars\n      // ===============\n\n      $(\"body\").addClass(\"fancybox-active\");\n\n      if (\n        !$.fancybox.getInstance() &&\n        firstItemOpts.hideScrollbar !== false &&\n        !$.fancybox.isMobile &&\n        document.body.scrollHeight > window.innerHeight\n      ) {\n        $(\"head\").append(\n          '<style id=\"fancybox-style-noscroll\" type=\"text/css\">.compensate-for-scrollbar{margin-right:' +\n          (window.innerWidth - document.documentElement.clientWidth) +\n          \"px;}</style>\"\n        );\n\n        $(\"body\").addClass(\"compensate-for-scrollbar\");\n      }\n\n      // Build html markup and set references\n      // ====================================\n\n      // Build html code for buttons and insert into main template\n      buttonStr = \"\";\n\n      $.each(firstItemOpts.buttons, function (index, value) {\n        buttonStr += firstItemOpts.btnTpl[value] || \"\";\n      });\n\n      // Create markup from base template, it will be initially hidden to\n      // avoid unnecessary work like painting while initializing is not complete\n      $container = $(\n          self.translate(\n            self,\n            firstItemOpts.baseTpl\n            .replace(\"{{buttons}}\", buttonStr)\n            .replace(\"{{arrows}}\", firstItemOpts.btnTpl.arrowLeft + firstItemOpts.btnTpl.arrowRight)\n          )\n        )\n        .attr(\"id\", \"fancybox-container-\" + self.id)\n        .addClass(firstItemOpts.baseClass)\n        .data(\"FancyBox\", self)\n        .appendTo(firstItemOpts.parentEl);\n\n      // Create object holding references to jQuery wrapped nodes\n      self.$refs = {\n        container: $container\n      };\n\n      [\"bg\", \"inner\", \"infobar\", \"toolbar\", \"stage\", \"caption\", \"navigation\"].forEach(function (item) {\n        self.$refs[item] = $container.find(\".fancybox-\" + item);\n      });\n\n      self.trigger(\"onInit\");\n\n      // Enable events, deactive previous instances\n      self.activate();\n\n      // Build slides, load and reveal content\n      self.jumpTo(self.currIndex);\n    },\n\n    // Simple i18n support - replaces object keys found in template\n    // with corresponding values\n    // ============================================================\n\n    translate: function (obj, str) {\n      var arr = obj.opts.i18n[obj.opts.lang] || obj.opts.i18n.en;\n\n      return str.replace(/\\{\\{(\\w+)\\}\\}/g, function (match, n) {\n        return arr[n] === undefined ? match : arr[n];\n      });\n    },\n\n    // Populate current group with fresh content\n    // Check if each object has valid type and content\n    // ===============================================\n\n    addContent: function (content) {\n      var self = this,\n        items = $.makeArray(content),\n        thumbs;\n\n      $.each(items, function (i, item) {\n        var obj = {},\n          opts = {},\n          $item,\n          type,\n          found,\n          src,\n          srcParts;\n\n        // Step 1 - Make sure we have an object\n        // ====================================\n\n        if ($.isPlainObject(item)) {\n          // We probably have manual usage here, something like\n          // $.fancybox.open( [ { src : \"image.jpg\", type : \"image\" } ] )\n\n          obj = item;\n          opts = item.opts || item;\n        } else if ($.type(item) === \"object\" && $(item).length) {\n          // Here we probably have jQuery collection returned by some selector\n          $item = $(item);\n\n          // Support attributes like `data-options='{\"touch\" : false}'` and `data-touch='false'`\n          opts = $item.data() || {};\n          opts = $.extend(true, {}, opts, opts.options);\n\n          // Here we store clicked element\n          opts.$orig = $item;\n\n          obj.src = self.opts.src || opts.src || $item.attr(\"href\");\n\n          // Assume that simple syntax is used, for example:\n          //   `$.fancybox.open( $(\"#test\"), {} );`\n          if (!obj.type && !obj.src) {\n            obj.type = \"inline\";\n            obj.src = item;\n          }\n        } else {\n          // Assume we have a simple html code, for example:\n          //   $.fancybox.open( '<div><h1>Hi!</h1></div>' );\n          obj = {\n            type: \"html\",\n            src: item + \"\"\n          };\n        }\n\n        // Each gallery object has full collection of options\n        obj.opts = $.extend(true, {}, self.opts, opts);\n\n        // Do not merge buttons array\n        if ($.isArray(opts.buttons)) {\n          obj.opts.buttons = opts.buttons;\n        }\n\n        if ($.fancybox.isMobile && obj.opts.mobile) {\n          obj.opts = mergeOpts(obj.opts, obj.opts.mobile);\n        }\n\n        // Step 2 - Make sure we have content type, if not - try to guess\n        // ==============================================================\n\n        type = obj.type || obj.opts.type;\n        src = obj.src || \"\";\n\n        if (!type && src) {\n          if ((found = src.match(/\\.(mp4|mov|ogv|webm)((\\?|#).*)?$/i))) {\n            type = \"video\";\n\n            if (!obj.opts.video.format) {\n              obj.opts.video.format = \"video/\" + (found[1] === \"ogv\" ? \"ogg\" : found[1]);\n            }\n          } else if (src.match(/(^data:image\\/[a-z0-9+\\/=]*,)|(\\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\\?|#).*)?$)/i)) {\n            type = \"image\";\n          } else if (src.match(/\\.(pdf)((\\?|#).*)?$/i)) {\n            type = \"iframe\";\n            obj = $.extend(true, obj, {\n              contentType: \"pdf\",\n              opts: {\n                iframe: {\n                  preload: false\n                }\n              }\n            });\n          } else if (src.charAt(0) === \"#\") {\n            type = \"inline\";\n          }\n        }\n\n        if (type) {\n          obj.type = type;\n        } else {\n          self.trigger(\"objectNeedsType\", obj);\n        }\n\n        if (!obj.contentType) {\n          obj.contentType = $.inArray(obj.type, [\"html\", \"inline\", \"ajax\"]) > -1 ? \"html\" : obj.type;\n        }\n\n        // Step 3 - Some adjustments\n        // =========================\n\n        obj.index = self.group.length;\n\n        if (obj.opts.smallBtn == \"auto\") {\n          obj.opts.smallBtn = $.inArray(obj.type, [\"html\", \"inline\", \"ajax\"]) > -1;\n        }\n\n        if (obj.opts.toolbar === \"auto\") {\n          obj.opts.toolbar = !obj.opts.smallBtn;\n        }\n\n        // Find thumbnail image, check if exists and if is in the viewport\n        obj.$thumb = obj.opts.$thumb || null;\n\n        if (obj.opts.$trigger && obj.index === self.opts.index) {\n          obj.$thumb = obj.opts.$trigger.find(\"img:first\");\n\n          if (obj.$thumb.length) {\n            obj.opts.$orig = obj.opts.$trigger;\n          }\n        }\n\n        if (!(obj.$thumb && obj.$thumb.length) && obj.opts.$orig) {\n          obj.$thumb = obj.opts.$orig.find(\"img:first\");\n        }\n\n        if (obj.$thumb && !obj.$thumb.length) {\n          obj.$thumb = null;\n        }\n\n        obj.thumb = obj.opts.thumb || (obj.$thumb ? obj.$thumb[0].src : null);\n\n        // \"caption\" is a \"special\" option, it can be used to customize caption per gallery item\n        if ($.type(obj.opts.caption) === \"function\") {\n          obj.opts.caption = obj.opts.caption.apply(item, [self, obj]);\n        }\n\n        if ($.type(self.opts.caption) === \"function\") {\n          obj.opts.caption = self.opts.caption.apply(item, [self, obj]);\n        }\n\n        // Make sure we have caption as a string or jQuery object\n        if (!(obj.opts.caption instanceof $)) {\n          obj.opts.caption = obj.opts.caption === undefined ? \"\" : obj.opts.caption + \"\";\n        }\n\n        // Check if url contains \"filter\" used to filter the content\n        // Example: \"ajax.html #something\"\n        if (obj.type === \"ajax\") {\n          srcParts = src.split(/\\s+/, 2);\n\n          if (srcParts.length > 1) {\n            obj.src = srcParts.shift();\n\n            obj.opts.filter = srcParts.shift();\n          }\n        }\n\n        // Hide all buttons and disable interactivity for modal items\n        if (obj.opts.modal) {\n          obj.opts = $.extend(true, obj.opts, {\n            trapFocus: true,\n            // Remove buttons\n            infobar: 0,\n            toolbar: 0,\n\n            smallBtn: 0,\n\n            // Disable keyboard navigation\n            keyboard: 0,\n\n            // Disable some modules\n            slideShow: 0,\n            fullScreen: 0,\n            thumbs: 0,\n            touch: 0,\n\n            // Disable click event handlers\n            clickContent: false,\n            clickSlide: false,\n            clickOutside: false,\n            dblclickContent: false,\n            dblclickSlide: false,\n            dblclickOutside: false\n          });\n        }\n\n        // Step 4 - Add processed object to group\n        // ======================================\n\n        self.group.push(obj);\n      });\n\n      // Update controls if gallery is already opened\n      if (Object.keys(self.slides).length) {\n        self.updateControls();\n\n        // Update thumbnails, if needed\n        thumbs = self.Thumbs;\n\n        if (thumbs && thumbs.isActive) {\n          thumbs.create();\n\n          thumbs.focus();\n        }\n      }\n    },\n\n    // Attach an event handler functions for:\n    //   - navigation buttons\n    //   - browser scrolling, resizing;\n    //   - focusing\n    //   - keyboard\n    //   - detecting inactivity\n    // ======================================\n\n    addEvents: function () {\n      var self = this;\n\n      self.removeEvents();\n\n      // Make navigation elements clickable\n      // ==================================\n\n      self.$refs.container\n        .on(\"click.fb-close\", \"[data-fancybox-close]\", function (e) {\n          e.stopPropagation();\n          e.preventDefault();\n\n          self.close(e);\n        })\n        .on(\"touchstart.fb-prev click.fb-prev\", \"[data-fancybox-prev]\", function (e) {\n          e.stopPropagation();\n          e.preventDefault();\n\n          self.previous();\n        })\n        .on(\"touchstart.fb-next click.fb-next\", \"[data-fancybox-next]\", function (e) {\n          e.stopPropagation();\n          e.preventDefault();\n\n          self.next();\n        })\n        .on(\"click.fb\", \"[data-fancybox-zoom]\", function (e) {\n          // Click handler for zoom button\n          self[self.isScaledDown() ? \"scaleToActual\" : \"scaleToFit\"]();\n        });\n\n      // Handle page scrolling and browser resizing\n      // ==========================================\n\n      $W.on(\"orientationchange.fb resize.fb\", function (e) {\n        if (e && e.originalEvent && e.originalEvent.type === \"resize\") {\n          if (self.requestId) {\n            cancelAFrame(self.requestId);\n          }\n\n          self.requestId = requestAFrame(function () {\n            self.update(e);\n          });\n        } else {\n          if (self.current && self.current.type === \"iframe\") {\n            self.$refs.stage.hide();\n          }\n\n          setTimeout(\n            function () {\n              self.$refs.stage.show();\n\n              self.update(e);\n            },\n            $.fancybox.isMobile ? 600 : 250\n          );\n        }\n      });\n\n      $D.on(\"keydown.fb\", function (e) {\n        var instance = $.fancybox ? $.fancybox.getInstance() : null,\n          current = instance.current,\n          keycode = e.keyCode || e.which;\n\n        // Trap keyboard focus inside of the modal\n        // =======================================\n\n        if (keycode == 9) {\n          if (current.opts.trapFocus) {\n            self.focus(e);\n          }\n\n          return;\n        }\n\n        // Enable keyboard navigation\n        // ==========================\n\n        if (!current.opts.keyboard || e.ctrlKey || e.altKey || e.shiftKey || $(e.target).is(\"input,textarea,video,audio,select\")) {\n          return;\n        }\n\n        // Backspace and Esc keys\n        if (keycode === 8 || keycode === 27) {\n          e.preventDefault();\n\n          self.close(e);\n\n          return;\n        }\n\n        // Left arrow and Up arrow\n        if (keycode === 37 || keycode === 38) {\n          e.preventDefault();\n\n          self.previous();\n\n          return;\n        }\n\n        // Righ arrow and Down arrow\n        if (keycode === 39 || keycode === 40) {\n          e.preventDefault();\n\n          self.next();\n\n          return;\n        }\n\n        self.trigger(\"afterKeydown\", e, keycode);\n      });\n\n      // Hide controls after some inactivity period\n      if (self.group[self.currIndex].opts.idleTime) {\n        self.idleSecondsCounter = 0;\n\n        $D.on(\n          \"mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle\",\n          function (e) {\n            self.idleSecondsCounter = 0;\n\n            if (self.isIdle) {\n              self.showControls();\n            }\n\n            self.isIdle = false;\n          }\n        );\n\n        self.idleInterval = window.setInterval(function () {\n          self.idleSecondsCounter++;\n\n          if (self.idleSecondsCounter >= self.group[self.currIndex].opts.idleTime && !self.isDragging) {\n            self.isIdle = true;\n            self.idleSecondsCounter = 0;\n\n            self.hideControls();\n          }\n        }, 1000);\n      }\n    },\n\n    // Remove events added by the core\n    // ===============================\n\n    removeEvents: function () {\n      var self = this;\n\n      $W.off(\"orientationchange.fb resize.fb\");\n      $D.off(\"keydown.fb .fb-idle\");\n\n      this.$refs.container.off(\".fb-close .fb-prev .fb-next\");\n\n      if (self.idleInterval) {\n        window.clearInterval(self.idleInterval);\n\n        self.idleInterval = null;\n      }\n    },\n\n    // Change to previous gallery item\n    // ===============================\n\n    previous: function (duration) {\n      return this.jumpTo(this.currPos - 1, duration);\n    },\n\n    // Change to next gallery item\n    // ===========================\n\n    next: function (duration) {\n      return this.jumpTo(this.currPos + 1, duration);\n    },\n\n    // Switch to selected gallery item\n    // ===============================\n\n    jumpTo: function (pos, duration) {\n      var self = this,\n        groupLen = self.group.length,\n        firstRun,\n        isMoved,\n        loop,\n        current,\n        previous,\n        slidePos,\n        stagePos,\n        prop,\n        diff;\n\n      if (self.isDragging || self.isClosing || (self.isAnimating && self.firstRun)) {\n        return;\n      }\n\n      // Should loop?\n      pos = parseInt(pos, 10);\n      loop = self.current ? self.current.opts.loop : self.opts.loop;\n\n      if (!loop && (pos < 0 || pos >= groupLen)) {\n        return false;\n      }\n\n      // Check if opening for the first time; this helps to speed things up\n      firstRun = self.firstRun = !Object.keys(self.slides).length;\n\n      // Create slides\n      previous = self.current;\n\n      self.prevIndex = self.currIndex;\n      self.prevPos = self.currPos;\n\n      current = self.createSlide(pos);\n\n      if (groupLen > 1) {\n        if (loop || current.index < groupLen - 1) {\n          self.createSlide(pos + 1);\n        }\n\n        if (loop || current.index > 0) {\n          self.createSlide(pos - 1);\n        }\n      }\n\n      self.current = current;\n      self.currIndex = current.index;\n      self.currPos = current.pos;\n\n      self.trigger(\"beforeShow\", firstRun);\n\n      self.updateControls();\n\n      // Validate duration length\n      current.forcedDuration = undefined;\n\n      if ($.isNumeric(duration)) {\n        current.forcedDuration = duration;\n      } else {\n        duration = current.opts[firstRun ? \"animationDuration\" : \"transitionDuration\"];\n      }\n\n      duration = parseInt(duration, 10);\n\n      // Check if user has swiped the slides or if still animating\n      isMoved = self.isMoved(current);\n\n      // Make sure current slide is visible\n      current.$slide.addClass(\"fancybox-slide--current\");\n\n      // Fresh start - reveal container, current slide and start loading content\n      if (firstRun) {\n        if (current.opts.animationEffect && duration) {\n          self.$refs.container.css(\"transition-duration\", duration + \"ms\");\n        }\n\n        self.$refs.container.addClass(\"fancybox-is-open\").trigger(\"focus\");\n\n        // Attempt to load content into slide\n        // This will later call `afterLoad` -> `revealContent`\n        self.loadSlide(current);\n\n        self.preload(\"image\");\n\n        return;\n      }\n\n      // Get actual slide/stage positions (before cleaning up)\n      slidePos = $.fancybox.getTranslate(previous.$slide);\n      stagePos = $.fancybox.getTranslate(self.$refs.stage);\n\n      // Clean up all slides\n      $.each(self.slides, function (index, slide) {\n        $.fancybox.stop(slide.$slide, true);\n      });\n\n      if (previous.pos !== current.pos) {\n        previous.isComplete = false;\n      }\n\n      previous.$slide.removeClass(\"fancybox-slide--complete fancybox-slide--current\");\n\n      // If slides are out of place, then animate them to correct position\n      if (isMoved) {\n        // Calculate horizontal swipe distance\n        diff = slidePos.left - (previous.pos * slidePos.width + previous.pos * previous.opts.gutter);\n\n        $.each(self.slides, function (index, slide) {\n          slide.$slide.removeClass(\"fancybox-animated\").removeClass(function (index, className) {\n            return (className.match(/(^|\\s)fancybox-fx-\\S+/g) || []).join(\" \");\n          });\n\n          // Make sure that each slide is in equal distance\n          // This is mostly needed for freshly added slides, because they are not yet positioned\n          var leftPos = slide.pos * slidePos.width + slide.pos * slide.opts.gutter;\n\n          $.fancybox.setTranslate(slide.$slide, {\n            top: 0,\n            left: leftPos - stagePos.left + diff\n          });\n\n          if (slide.pos !== current.pos) {\n            slide.$slide.addClass(\"fancybox-slide--\" + (slide.pos > current.pos ? \"next\" : \"previous\"));\n          }\n\n          // Redraw to make sure that transition will start\n          forceRedraw(slide.$slide);\n\n          // Animate the slide\n          $.fancybox.animate(\n            slide.$slide, {\n              top: 0,\n              left: (slide.pos - current.pos) * slidePos.width + (slide.pos - current.pos) * slide.opts.gutter\n            },\n            duration,\n            function () {\n              slide.$slide\n                .css({\n                  transform: \"\",\n                  opacity: \"\"\n                })\n                .removeClass(\"fancybox-slide--next fancybox-slide--previous\");\n\n              if (slide.pos === self.currPos) {\n                self.complete();\n              }\n            }\n          );\n        });\n      } else if (duration && current.opts.transitionEffect) {\n        // Set transition effect for previously active slide\n        prop = \"fancybox-animated fancybox-fx-\" + current.opts.transitionEffect;\n\n        previous.$slide.addClass(\"fancybox-slide--\" + (previous.pos > current.pos ? \"next\" : \"previous\"));\n\n        $.fancybox.animate(\n          previous.$slide,\n          prop,\n          duration,\n          function () {\n            previous.$slide.removeClass(prop).removeClass(\"fancybox-slide--next fancybox-slide--previous\");\n          },\n          false\n        );\n      }\n\n      if (current.isLoaded) {\n        self.revealContent(current);\n      } else {\n        self.loadSlide(current);\n      }\n\n      self.preload(\"image\");\n    },\n\n    // Create new \"slide\" element\n    // These are gallery items  that are actually added to DOM\n    // =======================================================\n\n    createSlide: function (pos) {\n      var self = this,\n        $slide,\n        index;\n\n      index = pos % self.group.length;\n      index = index < 0 ? self.group.length + index : index;\n\n      if (!self.slides[pos] && self.group[index]) {\n        $slide = $('<div class=\"fancybox-slide\"></div>').appendTo(self.$refs.stage);\n\n        self.slides[pos] = $.extend(true, {}, self.group[index], {\n          pos: pos,\n          $slide: $slide,\n          isLoaded: false\n        });\n\n        self.updateSlide(self.slides[pos]);\n      }\n\n      return self.slides[pos];\n    },\n\n    // Scale image to the actual size of the image;\n    // x and y values should be relative to the slide\n    // ==============================================\n\n    scaleToActual: function (x, y, duration) {\n      var self = this,\n        current = self.current,\n        $content = current.$content,\n        canvasWidth = $.fancybox.getTranslate(current.$slide).width,\n        canvasHeight = $.fancybox.getTranslate(current.$slide).height,\n        newImgWidth = current.width,\n        newImgHeight = current.height,\n        imgPos,\n        posX,\n        posY,\n        scaleX,\n        scaleY;\n\n      if (self.isAnimating || self.isMoved() || !$content || !(current.type == \"image\" && current.isLoaded && !current.hasError)) {\n        return;\n      }\n\n      self.isAnimating = true;\n\n      $.fancybox.stop($content);\n\n      x = x === undefined ? canvasWidth * 0.5 : x;\n      y = y === undefined ? canvasHeight * 0.5 : y;\n\n      imgPos = $.fancybox.getTranslate($content);\n\n      imgPos.top -= $.fancybox.getTranslate(current.$slide).top;\n      imgPos.left -= $.fancybox.getTranslate(current.$slide).left;\n\n      scaleX = newImgWidth / imgPos.width;\n      scaleY = newImgHeight / imgPos.height;\n\n      // Get center position for original image\n      posX = canvasWidth * 0.5 - newImgWidth * 0.5;\n      posY = canvasHeight * 0.5 - newImgHeight * 0.5;\n\n      // Make sure image does not move away from edges\n      if (newImgWidth > canvasWidth) {\n        posX = imgPos.left * scaleX - (x * scaleX - x);\n\n        if (posX > 0) {\n          posX = 0;\n        }\n\n        if (posX < canvasWidth - newImgWidth) {\n          posX = canvasWidth - newImgWidth;\n        }\n      }\n\n      if (newImgHeight > canvasHeight) {\n        posY = imgPos.top * scaleY - (y * scaleY - y);\n\n        if (posY > 0) {\n          posY = 0;\n        }\n\n        if (posY < canvasHeight - newImgHeight) {\n          posY = canvasHeight - newImgHeight;\n        }\n      }\n\n      self.updateCursor(newImgWidth, newImgHeight);\n\n      $.fancybox.animate(\n        $content, {\n          top: posY,\n          left: posX,\n          scaleX: scaleX,\n          scaleY: scaleY\n        },\n        duration || 366,\n        function () {\n          self.isAnimating = false;\n        }\n      );\n\n      // Stop slideshow\n      if (self.SlideShow && self.SlideShow.isActive) {\n        self.SlideShow.stop();\n      }\n    },\n\n    // Scale image to fit inside parent element\n    // ========================================\n\n    scaleToFit: function (duration) {\n      var self = this,\n        current = self.current,\n        $content = current.$content,\n        end;\n\n      if (self.isAnimating || self.isMoved() || !$content || !(current.type == \"image\" && current.isLoaded && !current.hasError)) {\n        return;\n      }\n\n      self.isAnimating = true;\n\n      $.fancybox.stop($content);\n\n      end = self.getFitPos(current);\n\n      self.updateCursor(end.width, end.height);\n\n      $.fancybox.animate(\n        $content, {\n          top: end.top,\n          left: end.left,\n          scaleX: end.width / $content.width(),\n          scaleY: end.height / $content.height()\n        },\n        duration || 366,\n        function () {\n          self.isAnimating = false;\n        }\n      );\n    },\n\n    // Calculate image size to fit inside viewport\n    // ===========================================\n\n    getFitPos: function (slide) {\n      var self = this,\n        $content = slide.$content,\n        $slide = slide.$slide,\n        width = slide.width || slide.opts.width,\n        height = slide.height || slide.opts.height,\n        maxWidth,\n        maxHeight,\n        minRatio,\n        aspectRatio,\n        rez = {};\n\n      if (!slide.isLoaded || !$content || !$content.length) {\n        return false;\n      }\n\n      maxWidth = $.fancybox.getTranslate(self.$refs.stage).width;\n      maxHeight = $.fancybox.getTranslate(self.$refs.stage).height;\n\n      maxWidth -=\n        parseFloat($slide.css(\"paddingLeft\")) +\n        parseFloat($slide.css(\"paddingRight\")) +\n        parseFloat($content.css(\"marginLeft\")) +\n        parseFloat($content.css(\"marginRight\"));\n\n      maxHeight -=\n        parseFloat($slide.css(\"paddingTop\")) +\n        parseFloat($slide.css(\"paddingBottom\")) +\n        parseFloat($content.css(\"marginTop\")) +\n        parseFloat($content.css(\"marginBottom\"));\n\n      if (!width || !height) {\n        width = maxWidth;\n        height = maxHeight;\n      }\n\n      minRatio = Math.min(1, maxWidth / width, maxHeight / height);\n\n      width = minRatio * width;\n      height = minRatio * height;\n\n      // Adjust width/height to precisely fit into container\n      if (width > maxWidth - 0.5) {\n        width = maxWidth;\n      }\n\n      if (height > maxHeight - 0.5) {\n        height = maxHeight;\n      }\n\n      if (slide.type === \"image\") {\n        rez.top = Math.floor((maxHeight - height) * 0.5) + parseFloat($slide.css(\"paddingTop\"));\n        rez.left = Math.floor((maxWidth - width) * 0.5) + parseFloat($slide.css(\"paddingLeft\"));\n      } else if (slide.contentType === \"video\") {\n        // Force aspect ratio for the video\n        // \"I say the whole world must learn of our peaceful ways… by force!\"\n        aspectRatio = slide.opts.width && slide.opts.height ? width / height : slide.opts.ratio || 16 / 9;\n\n        if (height > width / aspectRatio) {\n          height = width / aspectRatio;\n        } else if (width > height * aspectRatio) {\n          width = height * aspectRatio;\n        }\n      }\n\n      rez.width = width;\n      rez.height = height;\n\n      return rez;\n    },\n\n    // Update content size and position for all slides\n    // ==============================================\n\n    update: function (e) {\n      var self = this;\n\n      $.each(self.slides, function (key, slide) {\n        self.updateSlide(slide, e);\n      });\n    },\n\n    // Update slide content position and size\n    // ======================================\n\n    updateSlide: function (slide, e) {\n      var self = this,\n        $content = slide && slide.$content,\n        width = slide.width || slide.opts.width,\n        height = slide.height || slide.opts.height,\n        $slide = slide.$slide;\n\n      // First, prevent caption overlap, if needed\n      self.adjustCaption(slide);\n\n      // Then resize content to fit inside the slide\n      if ($content && (width || height || slide.contentType === \"video\") && !slide.hasError) {\n        $.fancybox.stop($content);\n\n        $.fancybox.setTranslate($content, self.getFitPos(slide));\n\n        if (slide.pos === self.currPos) {\n          self.isAnimating = false;\n\n          self.updateCursor();\n        }\n      }\n\n      // Then some adjustments\n      self.adjustLayout(slide);\n\n      if ($slide.length) {\n        $slide.trigger(\"refresh\");\n\n        if (slide.pos === self.currPos) {\n          self.$refs.toolbar\n            .add(self.$refs.navigation.find(\".fancybox-button--arrow_right\"))\n            .toggleClass(\"compensate-for-scrollbar\", $slide.get(0).scrollHeight > $slide.get(0).clientHeight);\n        }\n      }\n\n      self.trigger(\"onUpdate\", slide, e);\n    },\n\n    // Horizontally center slide\n    // =========================\n\n    centerSlide: function (duration) {\n      var self = this,\n        current = self.current,\n        $slide = current.$slide;\n\n      if (self.isClosing || !current) {\n        return;\n      }\n\n      $slide.siblings().css({\n        transform: \"\",\n        opacity: \"\"\n      });\n\n      $slide\n        .parent()\n        .children()\n        .removeClass(\"fancybox-slide--previous fancybox-slide--next\");\n\n      $.fancybox.animate(\n        $slide, {\n          top: 0,\n          left: 0,\n          opacity: 1\n        },\n        duration === undefined ? 0 : duration,\n        function () {\n          // Clean up\n          $slide.css({\n            transform: \"\",\n            opacity: \"\"\n          });\n\n          if (!current.isComplete) {\n            self.complete();\n          }\n        },\n        false\n      );\n    },\n\n    // Check if current slide is moved (swiped)\n    // ========================================\n\n    isMoved: function (slide) {\n      var current = slide || this.current,\n        slidePos,\n        stagePos;\n\n      if (!current) {\n        return false;\n      }\n\n      stagePos = $.fancybox.getTranslate(this.$refs.stage);\n      slidePos = $.fancybox.getTranslate(current.$slide);\n\n      return (\n        !current.$slide.hasClass(\"fancybox-animated\") &&\n        (Math.abs(slidePos.top - stagePos.top) > 0.5 || Math.abs(slidePos.left - stagePos.left) > 0.5)\n      );\n    },\n\n    // Update cursor style depending if content can be zoomed\n    // ======================================================\n\n    updateCursor: function (nextWidth, nextHeight) {\n      var self = this,\n        current = self.current,\n        $container = self.$refs.container,\n        canPan,\n        isZoomable;\n\n      if (!current || self.isClosing || !self.Guestures) {\n        return;\n      }\n\n      $container.removeClass(\"fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan\");\n\n      canPan = self.canPan(nextWidth, nextHeight);\n\n      isZoomable = canPan ? true : self.isZoomable();\n\n      $container.toggleClass(\"fancybox-is-zoomable\", isZoomable);\n\n      $(\"[data-fancybox-zoom]\").prop(\"disabled\", !isZoomable);\n\n      if (canPan) {\n        $container.addClass(\"fancybox-can-pan\");\n      } else if (\n        isZoomable &&\n        (current.opts.clickContent === \"zoom\" || ($.isFunction(current.opts.clickContent) && current.opts.clickContent(current) == \"zoom\"))\n      ) {\n        $container.addClass(\"fancybox-can-zoomIn\");\n      } else if (current.opts.touch && (current.opts.touch.vertical || self.group.length > 1) && current.contentType !== \"video\") {\n        $container.addClass(\"fancybox-can-swipe\");\n      }\n    },\n\n    // Check if current slide is zoomable\n    // ==================================\n\n    isZoomable: function () {\n      var self = this,\n        current = self.current,\n        fitPos;\n\n      // Assume that slide is zoomable if:\n      //   - image is still loading\n      //   - actual size of the image is smaller than available area\n      if (current && !self.isClosing && current.type === \"image\" && !current.hasError) {\n        if (!current.isLoaded) {\n          return true;\n        }\n\n        fitPos = self.getFitPos(current);\n\n        if (fitPos && (current.width > fitPos.width || current.height > fitPos.height)) {\n          return true;\n        }\n      }\n\n      return false;\n    },\n\n    // Check if current image dimensions are smaller than actual\n    // =========================================================\n\n    isScaledDown: function (nextWidth, nextHeight) {\n      var self = this,\n        rez = false,\n        current = self.current,\n        $content = current.$content;\n\n      if (nextWidth !== undefined && nextHeight !== undefined) {\n        rez = nextWidth < current.width && nextHeight < current.height;\n      } else if ($content) {\n        rez = $.fancybox.getTranslate($content);\n        rez = rez.width < current.width && rez.height < current.height;\n      }\n\n      return rez;\n    },\n\n    // Check if image dimensions exceed parent element\n    // ===============================================\n\n    canPan: function (nextWidth, nextHeight) {\n      var self = this,\n        current = self.current,\n        pos = null,\n        rez = false;\n\n      if (current.type === \"image\" && (current.isComplete || (nextWidth && nextHeight)) && !current.hasError) {\n        rez = self.getFitPos(current);\n\n        if (nextWidth !== undefined && nextHeight !== undefined) {\n          pos = {\n            width: nextWidth,\n            height: nextHeight\n          };\n        } else if (current.isComplete) {\n          pos = $.fancybox.getTranslate(current.$content);\n        }\n\n        if (pos && rez) {\n          rez = Math.abs(pos.width - rez.width) > 1.5 || Math.abs(pos.height - rez.height) > 1.5;\n        }\n      }\n\n      return rez;\n    },\n\n    // Load content into the slide\n    // ===========================\n\n    loadSlide: function (slide) {\n      var self = this,\n        type,\n        $slide,\n        ajaxLoad;\n\n      if (slide.isLoading || slide.isLoaded) {\n        return;\n      }\n\n      slide.isLoading = true;\n\n      if (self.trigger(\"beforeLoad\", slide) === false) {\n        slide.isLoading = false;\n\n        return false;\n      }\n\n      type = slide.type;\n      $slide = slide.$slide;\n\n      $slide\n        .off(\"refresh\")\n        .trigger(\"onReset\")\n        .addClass(slide.opts.slideClass);\n\n      // Create content depending on the type\n      switch (type) {\n        case \"image\":\n          self.setImage(slide);\n\n          break;\n\n        case \"iframe\":\n          self.setIframe(slide);\n\n          break;\n\n        case \"html\":\n          self.setContent(slide, slide.src || slide.content);\n\n          break;\n\n        case \"video\":\n          self.setContent(\n            slide,\n            slide.opts.video.tpl\n            .replace(/\\{\\{src\\}\\}/gi, slide.src)\n            .replace(\"{{format}}\", slide.opts.videoFormat || slide.opts.video.format || \"\")\n            .replace(\"{{poster}}\", slide.thumb || \"\")\n          );\n\n          break;\n\n        case \"inline\":\n          if ($(slide.src).length) {\n            self.setContent(slide, $(slide.src));\n          } else {\n            self.setError(slide);\n          }\n\n          break;\n\n        case \"ajax\":\n          self.showLoading(slide);\n\n          ajaxLoad = $.ajax(\n            $.extend({}, slide.opts.ajax.settings, {\n              url: slide.src,\n              success: function (data, textStatus) {\n                if (textStatus === \"success\") {\n                  self.setContent(slide, data);\n                }\n              },\n              error: function (jqXHR, textStatus) {\n                if (jqXHR && textStatus !== \"abort\") {\n                  self.setError(slide);\n                }\n              }\n            })\n          );\n\n          $slide.one(\"onReset\", function () {\n            ajaxLoad.abort();\n          });\n\n          break;\n\n        default:\n          self.setError(slide);\n\n          break;\n      }\n\n      return true;\n    },\n\n    // Use thumbnail image, if possible\n    // ================================\n\n    setImage: function (slide) {\n      var self = this,\n        ghost;\n\n      // Check if need to show loading icon\n      setTimeout(function () {\n        var $img = slide.$image;\n\n        if (!self.isClosing && slide.isLoading && (!$img || !$img.length || !$img[0].complete) && !slide.hasError) {\n          self.showLoading(slide);\n        }\n      }, 50);\n\n      //Check if image has srcset\n      self.checkSrcset(slide);\n\n      // This will be wrapper containing both ghost and actual image\n      slide.$content = $('<div class=\"fancybox-content\"></div>')\n        .addClass(\"fancybox-is-hidden\")\n        .appendTo(slide.$slide.addClass(\"fancybox-slide--image\"));\n\n      // If we have a thumbnail, we can display it while actual image is loading\n      // Users will not stare at black screen and actual image will appear gradually\n      if (slide.opts.preload !== false && slide.opts.width && slide.opts.height && slide.thumb) {\n        slide.width = slide.opts.width;\n        slide.height = slide.opts.height;\n\n        ghost = document.createElement(\"img\");\n\n        ghost.onerror = function () {\n          $(this).remove();\n\n          slide.$ghost = null;\n        };\n\n        ghost.onload = function () {\n          self.afterLoad(slide);\n        };\n\n        slide.$ghost = $(ghost)\n          .addClass(\"fancybox-image\")\n          .appendTo(slide.$content)\n          .attr(\"src\", slide.thumb);\n      }\n\n      // Start loading actual image\n      self.setBigImage(slide);\n    },\n\n    // Check if image has srcset and get the source\n    // ============================================\n    checkSrcset: function (slide) {\n      var srcset = slide.opts.srcset || slide.opts.image.srcset,\n        found,\n        temp,\n        pxRatio,\n        windowWidth;\n\n      // If we have \"srcset\", then we need to find first matching \"src\" value.\n      // This is necessary, because when you set an src attribute, the browser will preload the image\n      // before any javascript or even CSS is applied.\n      if (srcset) {\n        pxRatio = window.devicePixelRatio || 1;\n        windowWidth = window.innerWidth * pxRatio;\n\n        temp = srcset.split(\",\").map(function (el) {\n          var ret = {};\n\n          el.trim()\n            .split(/\\s+/)\n            .forEach(function (el, i) {\n              var value = parseInt(el.substring(0, el.length - 1), 10);\n\n              if (i === 0) {\n                return (ret.url = el);\n              }\n\n              if (value) {\n                ret.value = value;\n                ret.postfix = el[el.length - 1];\n              }\n            });\n\n          return ret;\n        });\n\n        // Sort by value\n        temp.sort(function (a, b) {\n          return a.value - b.value;\n        });\n\n        // Ok, now we have an array of all srcset values\n        for (var j = 0; j < temp.length; j++) {\n          var el = temp[j];\n\n          if ((el.postfix === \"w\" && el.value >= windowWidth) || (el.postfix === \"x\" && el.value >= pxRatio)) {\n            found = el;\n            break;\n          }\n        }\n\n        // If not found, take the last one\n        if (!found && temp.length) {\n          found = temp[temp.length - 1];\n        }\n\n        if (found) {\n          slide.src = found.url;\n\n          // If we have default width/height values, we can calculate height for matching source\n          if (slide.width && slide.height && found.postfix == \"w\") {\n            slide.height = (slide.width / slide.height) * found.value;\n            slide.width = found.value;\n          }\n\n          slide.opts.srcset = srcset;\n        }\n      }\n    },\n\n    // Create full-size image\n    // ======================\n\n    setBigImage: function (slide) {\n      var self = this,\n        img = document.createElement(\"img\"),\n        $img = $(img);\n\n      slide.$image = $img\n        .one(\"error\", function () {\n          self.setError(slide);\n        })\n        .one(\"load\", function () {\n          var sizes;\n\n          if (!slide.$ghost) {\n            self.resolveImageSlideSize(slide, this.naturalWidth, this.naturalHeight);\n\n            self.afterLoad(slide);\n          }\n\n          if (self.isClosing) {\n            return;\n          }\n\n          if (slide.opts.srcset) {\n            sizes = slide.opts.sizes;\n\n            if (!sizes || sizes === \"auto\") {\n              sizes =\n                (slide.width / slide.height > 1 && $W.width() / $W.height() > 1 ? \"100\" : Math.round((slide.width / slide.height) * 100)) +\n                \"vw\";\n            }\n\n            $img.attr(\"sizes\", sizes).attr(\"srcset\", slide.opts.srcset);\n          }\n\n          // Hide temporary image after some delay\n          if (slide.$ghost) {\n            setTimeout(function () {\n              if (slide.$ghost && !self.isClosing) {\n                slide.$ghost.hide();\n              }\n            }, Math.min(300, Math.max(1000, slide.height / 1600)));\n          }\n\n          self.hideLoading(slide);\n        })\n        .addClass(\"fancybox-image\")\n        .attr(\"src\", slide.src)\n        .appendTo(slide.$content);\n\n      if ((img.complete || img.readyState == \"complete\") && $img.naturalWidth && $img.naturalHeight) {\n        $img.trigger(\"load\");\n      } else if (img.error) {\n        $img.trigger(\"error\");\n      }\n    },\n\n    // Computes the slide size from image size and maxWidth/maxHeight\n    // ==============================================================\n\n    resolveImageSlideSize: function (slide, imgWidth, imgHeight) {\n      var maxWidth = parseInt(slide.opts.width, 10),\n        maxHeight = parseInt(slide.opts.height, 10);\n\n      // Sets the default values from the image\n      slide.width = imgWidth;\n      slide.height = imgHeight;\n\n      if (maxWidth > 0) {\n        slide.width = maxWidth;\n        slide.height = Math.floor((maxWidth * imgHeight) / imgWidth);\n      }\n\n      if (maxHeight > 0) {\n        slide.width = Math.floor((maxHeight * imgWidth) / imgHeight);\n        slide.height = maxHeight;\n      }\n    },\n\n    // Create iframe wrapper, iframe and bindings\n    // ==========================================\n\n    setIframe: function (slide) {\n      var self = this,\n        opts = slide.opts.iframe,\n        $slide = slide.$slide,\n        $iframe;\n\n      slide.$content = $('<div class=\"fancybox-content' + (opts.preload ? \" fancybox-is-hidden\" : \"\") + '\"></div>')\n        .css(opts.css)\n        .appendTo($slide);\n\n      $slide.addClass(\"fancybox-slide--\" + slide.contentType);\n\n      slide.$iframe = $iframe = $(opts.tpl.replace(/\\{rnd\\}/g, new Date().getTime()))\n        .attr(opts.attr)\n        .appendTo(slide.$content);\n\n      if (opts.preload) {\n        self.showLoading(slide);\n\n        // Unfortunately, it is not always possible to determine if iframe is successfully loaded\n        // (due to browser security policy)\n\n        $iframe.on(\"load.fb error.fb\", function (e) {\n          this.isReady = 1;\n\n          slide.$slide.trigger(\"refresh\");\n\n          self.afterLoad(slide);\n        });\n\n        // Recalculate iframe content size\n        // ===============================\n\n        $slide.on(\"refresh.fb\", function () {\n          var $content = slide.$content,\n            frameWidth = opts.css.width,\n            frameHeight = opts.css.height,\n            $contents,\n            $body;\n\n          if ($iframe[0].isReady !== 1) {\n            return;\n          }\n\n          try {\n            $contents = $iframe.contents();\n            $body = $contents.find(\"body\");\n          } catch (ignore) {}\n\n          // Calculate content dimensions, if it is accessible\n          if ($body && $body.length && $body.children().length) {\n            // Avoid scrolling to top (if multiple instances)\n            $slide.css(\"overflow\", \"visible\");\n\n            $content.css({\n              width: \"100%\",\n              \"max-width\": \"100%\",\n              height: \"9999px\"\n            });\n\n            if (frameWidth === undefined) {\n              frameWidth = Math.ceil(Math.max($body[0].clientWidth, $body.outerWidth(true)));\n            }\n\n            $content.css(\"width\", frameWidth ? frameWidth : \"\").css(\"max-width\", \"\");\n\n            if (frameHeight === undefined) {\n              frameHeight = Math.ceil(Math.max($body[0].clientHeight, $body.outerHeight(true)));\n            }\n\n            $content.css(\"height\", frameHeight ? frameHeight : \"\");\n\n            $slide.css(\"overflow\", \"auto\");\n          }\n\n          $content.removeClass(\"fancybox-is-hidden\");\n        });\n      } else {\n        self.afterLoad(slide);\n      }\n\n      $iframe.attr(\"src\", slide.src);\n\n      // Remove iframe if closing or changing gallery item\n      $slide.one(\"onReset\", function () {\n        // This helps IE not to throw errors when closing\n        try {\n          $(this)\n            .find(\"iframe\")\n            .hide()\n            .unbind()\n            .attr(\"src\", \"//about:blank\");\n        } catch (ignore) {}\n\n        $(this)\n          .off(\"refresh.fb\")\n          .empty();\n\n        slide.isLoaded = false;\n        slide.isRevealed = false;\n      });\n    },\n\n    // Wrap and append content to the slide\n    // ======================================\n\n    setContent: function (slide, content) {\n      var self = this;\n\n      if (self.isClosing) {\n        return;\n      }\n\n      self.hideLoading(slide);\n\n      if (slide.$content) {\n        $.fancybox.stop(slide.$content);\n      }\n\n      slide.$slide.empty();\n\n      // If content is a jQuery object, then it will be moved to the slide.\n      // The placeholder is created so we will know where to put it back.\n      if (isQuery(content) && content.parent().length) {\n        // Make sure content is not already moved to fancyBox\n        if (content.hasClass(\"fancybox-content\") || content.parent().hasClass(\"fancybox-content\")) {\n          content.parents(\".fancybox-slide\").trigger(\"onReset\");\n        }\n\n        // Create temporary element marking original place of the content\n        slide.$placeholder = $(\"<div>\")\n          .hide()\n          .insertAfter(content);\n\n        // Make sure content is visible\n        content.css(\"display\", \"inline-block\");\n      } else if (!slide.hasError) {\n        // If content is just a plain text, try to convert it to html\n        if ($.type(content) === \"string\") {\n          content = $(\"<div>\")\n            .append($.trim(content))\n            .contents();\n        }\n\n        // If \"filter\" option is provided, then filter content\n        if (slide.opts.filter) {\n          content = $(\"<div>\")\n            .html(content)\n            .find(slide.opts.filter);\n        }\n      }\n\n      slide.$slide.one(\"onReset\", function () {\n        // Pause all html5 video/audio\n        $(this)\n          .find(\"video,audio\")\n          .trigger(\"pause\");\n\n        // Put content back\n        if (slide.$placeholder) {\n          slide.$placeholder.after(content.removeClass(\"fancybox-content\").hide()).remove();\n\n          slide.$placeholder = null;\n        }\n\n        // Remove custom close button\n        if (slide.$smallBtn) {\n          slide.$smallBtn.remove();\n\n          slide.$smallBtn = null;\n        }\n\n        // Remove content and mark slide as not loaded\n        if (!slide.hasError) {\n          $(this).empty();\n\n          slide.isLoaded = false;\n          slide.isRevealed = false;\n        }\n      });\n\n      $(content).appendTo(slide.$slide);\n\n      if ($(content).is(\"video,audio\")) {\n        $(content).addClass(\"fancybox-video\");\n\n        $(content).wrap(\"<div></div>\");\n\n        slide.contentType = \"video\";\n\n        slide.opts.width = slide.opts.width || $(content).attr(\"width\");\n        slide.opts.height = slide.opts.height || $(content).attr(\"height\");\n      }\n\n      slide.$content = slide.$slide\n        .children()\n        .filter(\"div,form,main,video,audio,article,.fancybox-content\")\n        .first();\n\n      slide.$content.siblings().hide();\n\n      // Re-check if there is a valid content\n      // (in some cases, ajax response can contain various elements or plain text)\n      if (!slide.$content.length) {\n        slide.$content = slide.$slide\n          .wrapInner(\"<div></div>\")\n          .children()\n          .first();\n      }\n\n      slide.$content.addClass(\"fancybox-content\");\n\n      slide.$slide.addClass(\"fancybox-slide--\" + slide.contentType);\n\n      self.afterLoad(slide);\n    },\n\n    // Display error message\n    // =====================\n\n    setError: function (slide) {\n      slide.hasError = true;\n\n      slide.$slide\n        .trigger(\"onReset\")\n        .removeClass(\"fancybox-slide--\" + slide.contentType)\n        .addClass(\"fancybox-slide--error\");\n\n      slide.contentType = \"html\";\n\n      this.setContent(slide, this.translate(slide, slide.opts.errorTpl));\n\n      if (slide.pos === this.currPos) {\n        this.isAnimating = false;\n      }\n    },\n\n    // Show loading icon inside the slide\n    // ==================================\n\n    showLoading: function (slide) {\n      var self = this;\n\n      slide = slide || self.current;\n\n      if (slide && !slide.$spinner) {\n        slide.$spinner = $(self.translate(self, self.opts.spinnerTpl))\n          .appendTo(slide.$slide)\n          .hide()\n          .fadeIn(\"fast\");\n      }\n    },\n\n    // Remove loading icon from the slide\n    // ==================================\n\n    hideLoading: function (slide) {\n      var self = this;\n\n      slide = slide || self.current;\n\n      if (slide && slide.$spinner) {\n        slide.$spinner.stop().remove();\n\n        delete slide.$spinner;\n      }\n    },\n\n    // Adjustments after slide content has been loaded\n    // ===============================================\n\n    afterLoad: function (slide) {\n      var self = this;\n\n      if (self.isClosing) {\n        return;\n      }\n\n      slide.isLoading = false;\n      slide.isLoaded = true;\n\n      self.trigger(\"afterLoad\", slide);\n\n      self.hideLoading(slide);\n\n      // Add small close button\n      if (slide.opts.smallBtn && (!slide.$smallBtn || !slide.$smallBtn.length)) {\n        slide.$smallBtn = $(self.translate(slide, slide.opts.btnTpl.smallBtn)).appendTo(slide.$content);\n      }\n\n      // Disable right click\n      if (slide.opts.protect && slide.$content && !slide.hasError) {\n        slide.$content.on(\"contextmenu.fb\", function (e) {\n          if (e.button == 2) {\n            e.preventDefault();\n          }\n\n          return true;\n        });\n\n        // Add fake element on top of the image\n        // This makes a bit harder for user to select image\n        if (slide.type === \"image\") {\n          $('<div class=\"fancybox-spaceball\"></div>').appendTo(slide.$content);\n        }\n      }\n\n      self.adjustCaption(slide);\n\n      self.adjustLayout(slide);\n\n      if (slide.pos === self.currPos) {\n        self.updateCursor();\n      }\n\n      self.revealContent(slide);\n    },\n\n    // Prevent caption overlap,\n    // fix css inconsistency across browsers\n    // =====================================\n\n    adjustCaption: function (slide) {\n      var self = this,\n        current = slide || self.current,\n        caption = current.opts.caption,\n        preventOverlap = current.opts.preventCaptionOverlap,\n        $caption = self.$refs.caption,\n        $clone,\n        captionH = false;\n\n      $caption.toggleClass(\"fancybox-caption--separate\", preventOverlap);\n\n      if (preventOverlap && caption && caption.length) {\n        if (current.pos !== self.currPos) {\n          $clone = $caption.clone().appendTo($caption.parent());\n\n          $clone\n            .children()\n            .eq(0)\n            .empty()\n            .html(caption);\n\n          captionH = $clone.outerHeight(true);\n\n          $clone.empty().remove();\n        } else if (self.$caption) {\n          captionH = self.$caption.outerHeight(true);\n        }\n\n        current.$slide.css(\"padding-bottom\", captionH || \"\");\n      }\n    },\n\n    // Simple hack to fix inconsistency across browsers, described here (affects Edge, too):\n    // https://bugzilla.mozilla.org/show_bug.cgi?id=748518\n    // ====================================================================================\n\n    adjustLayout: function (slide) {\n      var self = this,\n        current = slide || self.current,\n        scrollHeight,\n        marginBottom,\n        inlinePadding,\n        actualPadding;\n\n      if (current.isLoaded && current.opts.disableLayoutFix !== true) {\n        current.$content.css(\"margin-bottom\", \"\");\n\n        // If we would always set margin-bottom for the content,\n        // then it would potentially break vertical align\n        if (current.$content.outerHeight() > current.$slide.height() + 0.5) {\n          inlinePadding = current.$slide[0].style[\"padding-bottom\"];\n          actualPadding = current.$slide.css(\"padding-bottom\");\n\n          if (parseFloat(actualPadding) > 0) {\n            scrollHeight = current.$slide[0].scrollHeight;\n\n            current.$slide.css(\"padding-bottom\", 0);\n\n            if (Math.abs(scrollHeight - current.$slide[0].scrollHeight) < 1) {\n              marginBottom = actualPadding;\n            }\n\n            current.$slide.css(\"padding-bottom\", inlinePadding);\n          }\n        }\n\n        current.$content.css(\"margin-bottom\", marginBottom);\n      }\n    },\n\n    // Make content visible\n    // This method is called right after content has been loaded or\n    // user navigates gallery and transition should start\n    // ============================================================\n\n    revealContent: function (slide) {\n      var self = this,\n        $slide = slide.$slide,\n        end = false,\n        start = false,\n        isMoved = self.isMoved(slide),\n        isRevealed = slide.isRevealed,\n        effect,\n        effectClassName,\n        duration,\n        opacity;\n\n      slide.isRevealed = true;\n\n      effect = slide.opts[self.firstRun ? \"animationEffect\" : \"transitionEffect\"];\n      duration = slide.opts[self.firstRun ? \"animationDuration\" : \"transitionDuration\"];\n\n      duration = parseInt(slide.forcedDuration === undefined ? duration : slide.forcedDuration, 10);\n\n      if (isMoved || slide.pos !== self.currPos || !duration) {\n        effect = false;\n      }\n\n      // Check if can zoom\n      if (effect === \"zoom\") {\n        if (slide.pos === self.currPos && duration && slide.type === \"image\" && !slide.hasError && (start = self.getThumbPos(slide))) {\n          end = self.getFitPos(slide);\n        } else {\n          effect = \"fade\";\n        }\n      }\n\n      // Zoom animation\n      // ==============\n      if (effect === \"zoom\") {\n        self.isAnimating = true;\n\n        end.scaleX = end.width / start.width;\n        end.scaleY = end.height / start.height;\n\n        // Check if we need to animate opacity\n        opacity = slide.opts.zoomOpacity;\n\n        if (opacity == \"auto\") {\n          opacity = Math.abs(slide.width / slide.height - start.width / start.height) > 0.1;\n        }\n\n        if (opacity) {\n          start.opacity = 0.1;\n          end.opacity = 1;\n        }\n\n        // Draw image at start position\n        $.fancybox.setTranslate(slide.$content.removeClass(\"fancybox-is-hidden\"), start);\n\n        forceRedraw(slide.$content);\n\n        // Start animation\n        $.fancybox.animate(slide.$content, end, duration, function () {\n          self.isAnimating = false;\n\n          self.complete();\n        });\n\n        return;\n      }\n\n      self.updateSlide(slide);\n\n      // Simply show content if no effect\n      // ================================\n      if (!effect) {\n        slide.$content.removeClass(\"fancybox-is-hidden\");\n\n        if (!isRevealed && isMoved && slide.type === \"image\" && !slide.hasError) {\n          slide.$content.hide().fadeIn(\"fast\");\n        }\n\n        if (slide.pos === self.currPos) {\n          self.complete();\n        }\n\n        return;\n      }\n\n      // Prepare for CSS transiton\n      // =========================\n      $.fancybox.stop($slide);\n\n      //effectClassName = \"fancybox-animated fancybox-slide--\" + (slide.pos >= self.prevPos ? \"next\" : \"previous\") + \" fancybox-fx-\" + effect;\n      effectClassName = \"fancybox-slide--\" + (slide.pos >= self.prevPos ? \"next\" : \"previous\") + \" fancybox-animated fancybox-fx-\" + effect;\n\n      $slide.addClass(effectClassName).removeClass(\"fancybox-slide--current\"); //.addClass(effectClassName);\n\n      slide.$content.removeClass(\"fancybox-is-hidden\");\n\n      // Force reflow\n      forceRedraw($slide);\n\n      if (slide.type !== \"image\") {\n        slide.$content.hide().show(0);\n      }\n\n      $.fancybox.animate(\n        $slide,\n        \"fancybox-slide--current\",\n        duration,\n        function () {\n          $slide.removeClass(effectClassName).css({\n            transform: \"\",\n            opacity: \"\"\n          });\n\n          if (slide.pos === self.currPos) {\n            self.complete();\n          }\n        },\n        true\n      );\n    },\n\n    // Check if we can and have to zoom from thumbnail\n    //================================================\n\n    getThumbPos: function (slide) {\n      var rez = false,\n        $thumb = slide.$thumb,\n        thumbPos,\n        btw,\n        brw,\n        bbw,\n        blw;\n\n      if (!$thumb || !inViewport($thumb[0])) {\n        return false;\n      }\n\n      thumbPos = $.fancybox.getTranslate($thumb);\n\n      btw = parseFloat($thumb.css(\"border-top-width\") || 0);\n      brw = parseFloat($thumb.css(\"border-right-width\") || 0);\n      bbw = parseFloat($thumb.css(\"border-bottom-width\") || 0);\n      blw = parseFloat($thumb.css(\"border-left-width\") || 0);\n\n      rez = {\n        top: thumbPos.top + btw,\n        left: thumbPos.left + blw,\n        width: thumbPos.width - brw - blw,\n        height: thumbPos.height - btw - bbw,\n        scaleX: 1,\n        scaleY: 1\n      };\n\n      return thumbPos.width > 0 && thumbPos.height > 0 ? rez : false;\n    },\n\n    // Final adjustments after current gallery item is moved to position\n    // and it`s content is loaded\n    // ==================================================================\n\n    complete: function () {\n      var self = this,\n        current = self.current,\n        slides = {},\n        $el;\n\n      if (self.isMoved() || !current.isLoaded) {\n        return;\n      }\n\n      if (!current.isComplete) {\n        current.isComplete = true;\n\n        current.$slide.siblings().trigger(\"onReset\");\n\n        self.preload(\"inline\");\n\n        // Trigger any CSS transiton inside the slide\n        forceRedraw(current.$slide);\n\n        current.$slide.addClass(\"fancybox-slide--complete\");\n\n        // Remove unnecessary slides\n        $.each(self.slides, function (key, slide) {\n          if (slide.pos >= self.currPos - 1 && slide.pos <= self.currPos + 1) {\n            slides[slide.pos] = slide;\n          } else if (slide) {\n            $.fancybox.stop(slide.$slide);\n\n            slide.$slide.off().remove();\n          }\n        });\n\n        self.slides = slides;\n      }\n\n      self.isAnimating = false;\n\n      self.updateCursor();\n\n      self.trigger(\"afterShow\");\n\n      // Autoplay first html5 video/audio\n      if (!!current.opts.video.autoStart) {\n        current.$slide\n          .find(\"video,audio\")\n          .filter(\":visible:first\")\n          .trigger(\"play\")\n          .one(\"ended\", function () {\n            if (Document.exitFullscreen) {\n              Document.exitFullscreen();\n            } else if (this.webkitExitFullscreen) {\n              this.webkitExitFullscreen();\n            }\n\n            self.next();\n          });\n      }\n\n      // Try to focus on the first focusable element\n      if (current.opts.autoFocus && current.contentType === \"html\") {\n        // Look for the first input with autofocus attribute\n        $el = current.$content.find(\"input[autofocus]:enabled:visible:first\");\n\n        if ($el.length) {\n          $el.trigger(\"focus\");\n        } else {\n          self.focus(null, true);\n        }\n      }\n\n      // Avoid jumping\n      current.$slide.scrollTop(0).scrollLeft(0);\n    },\n\n    // Preload next and previous slides\n    // ================================\n\n    preload: function (type) {\n      var self = this,\n        prev,\n        next;\n\n      if (self.group.length < 2) {\n        return;\n      }\n\n      next = self.slides[self.currPos + 1];\n      prev = self.slides[self.currPos - 1];\n\n      if (prev && prev.type === type) {\n        self.loadSlide(prev);\n      }\n\n      if (next && next.type === type) {\n        self.loadSlide(next);\n      }\n    },\n\n    // Try to find and focus on the first focusable element\n    // ====================================================\n\n    focus: function (e, firstRun) {\n      var self = this,\n        focusableStr = [\n          \"a[href]\",\n          \"area[href]\",\n          'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])',\n          \"select:not([disabled]):not([aria-hidden])\",\n          \"textarea:not([disabled]):not([aria-hidden])\",\n          \"button:not([disabled]):not([aria-hidden])\",\n          \"iframe\",\n          \"object\",\n          \"embed\",\n          \"video\",\n          \"audio\",\n          \"[contenteditable]\",\n          '[tabindex]:not([tabindex^=\"-\"])'\n        ].join(\",\"),\n        focusableItems,\n        focusedItemIndex;\n\n      if (self.isClosing) {\n        return;\n      }\n\n      if (e || !self.current || !self.current.isComplete) {\n        // Focus on any element inside fancybox\n        focusableItems = self.$refs.container.find(\"*:visible\");\n      } else {\n        // Focus inside current slide\n        focusableItems = self.current.$slide.find(\"*:visible\" + (firstRun ? \":not(.fancybox-close-small)\" : \"\"));\n      }\n\n      focusableItems = focusableItems.filter(focusableStr).filter(function () {\n        return $(this).css(\"visibility\") !== \"hidden\" && !$(this).hasClass(\"disabled\");\n      });\n\n      if (focusableItems.length) {\n        focusedItemIndex = focusableItems.index(document.activeElement);\n\n        if (e && e.shiftKey) {\n          // Back tab\n          if (focusedItemIndex < 0 || focusedItemIndex == 0) {\n            e.preventDefault();\n\n            focusableItems.eq(focusableItems.length - 1).trigger(\"focus\");\n          }\n        } else {\n          // Outside or Forward tab\n          if (focusedItemIndex < 0 || focusedItemIndex == focusableItems.length - 1) {\n            if (e) {\n              e.preventDefault();\n            }\n\n            focusableItems.eq(0).trigger(\"focus\");\n          }\n        }\n      } else {\n        self.$refs.container.trigger(\"focus\");\n      }\n    },\n\n    // Activates current instance - brings container to the front and enables keyboard,\n    // notifies other instances about deactivating\n    // =================================================================================\n\n    activate: function () {\n      var self = this;\n\n      // Deactivate all instances\n      $(\".fancybox-container\").each(function () {\n        var instance = $(this).data(\"FancyBox\");\n\n        // Skip self and closing instances\n        if (instance && instance.id !== self.id && !instance.isClosing) {\n          instance.trigger(\"onDeactivate\");\n\n          instance.removeEvents();\n\n          instance.isVisible = false;\n        }\n      });\n\n      self.isVisible = true;\n\n      if (self.current || self.isIdle) {\n        self.update();\n\n        self.updateControls();\n      }\n\n      self.trigger(\"onActivate\");\n\n      self.addEvents();\n    },\n\n    // Start closing procedure\n    // This will start \"zoom-out\" animation if needed and clean everything up afterwards\n    // =================================================================================\n\n    close: function (e, d) {\n      var self = this,\n        current = self.current,\n        effect,\n        duration,\n        $content,\n        domRect,\n        opacity,\n        start,\n        end;\n\n      var done = function () {\n        self.cleanUp(e);\n      };\n\n      if (self.isClosing) {\n        return false;\n      }\n\n      self.isClosing = true;\n\n      // If beforeClose callback prevents closing, make sure content is centered\n      if (self.trigger(\"beforeClose\", e) === false) {\n        self.isClosing = false;\n\n        requestAFrame(function () {\n          self.update();\n        });\n\n        return false;\n      }\n\n      // Remove all events\n      // If there are multiple instances, they will be set again by \"activate\" method\n      self.removeEvents();\n\n      $content = current.$content;\n      effect = current.opts.animationEffect;\n      duration = $.isNumeric(d) ? d : effect ? current.opts.animationDuration : 0;\n\n      current.$slide.removeClass(\"fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated\");\n\n      if (e !== true) {\n        $.fancybox.stop(current.$slide);\n      } else {\n        effect = false;\n      }\n\n      // Remove other slides\n      current.$slide\n        .siblings()\n        .trigger(\"onReset\")\n        .remove();\n\n      // Trigger animations\n      if (duration) {\n        self.$refs.container\n          .removeClass(\"fancybox-is-open\")\n          .addClass(\"fancybox-is-closing\")\n          .css(\"transition-duration\", duration + \"ms\");\n      }\n\n      // Clean up\n      self.hideLoading(current);\n\n      self.hideControls(true);\n\n      self.updateCursor();\n\n      // Check if possible to zoom-out\n      if (\n        effect === \"zoom\" &&\n        !($content && duration && current.type === \"image\" && !self.isMoved() && !current.hasError && (end = self.getThumbPos(current)))\n      ) {\n        effect = \"fade\";\n      }\n\n      if (effect === \"zoom\") {\n        $.fancybox.stop($content);\n\n        domRect = $.fancybox.getTranslate($content);\n\n        start = {\n          top: domRect.top,\n          left: domRect.left,\n          scaleX: domRect.width / end.width,\n          scaleY: domRect.height / end.height,\n          width: end.width,\n          height: end.height\n        };\n\n        // Check if we need to animate opacity\n        opacity = current.opts.zoomOpacity;\n\n        if (opacity == \"auto\") {\n          opacity = Math.abs(current.width / current.height - end.width / end.height) > 0.1;\n        }\n\n        if (opacity) {\n          end.opacity = 0;\n        }\n\n        $.fancybox.setTranslate($content, start);\n\n        forceRedraw($content);\n\n        $.fancybox.animate($content, end, duration, done);\n\n        return true;\n      }\n\n      if (effect && duration) {\n        $.fancybox.animate(\n          current.$slide.addClass(\"fancybox-slide--previous\").removeClass(\"fancybox-slide--current\"),\n          \"fancybox-animated fancybox-fx-\" + effect,\n          duration,\n          done\n        );\n      } else {\n        // If skip animation\n        if (e === true) {\n          setTimeout(done, duration);\n        } else {\n          done();\n        }\n      }\n\n      return true;\n    },\n\n    // Final adjustments after removing the instance\n    // =============================================\n\n    cleanUp: function (e) {\n      var self = this,\n        instance,\n        $focus = self.current.opts.$orig,\n        x,\n        y;\n\n      self.current.$slide.trigger(\"onReset\");\n\n      self.$refs.container.empty().remove();\n\n      self.trigger(\"afterClose\", e);\n\n      // Place back focus\n      if (!!self.current.opts.backFocus) {\n        if (!$focus || !$focus.length || !$focus.is(\":visible\")) {\n          $focus = self.$trigger;\n        }\n\n        if ($focus && $focus.length) {\n          x = window.scrollX;\n          y = window.scrollY;\n\n          $focus.trigger(\"focus\");\n\n          $(\"html, body\")\n            .scrollTop(y)\n            .scrollLeft(x);\n        }\n      }\n\n      self.current = null;\n\n      // Check if there are other instances\n      instance = $.fancybox.getInstance();\n\n      if (instance) {\n        instance.activate();\n      } else {\n        $(\"body\").removeClass(\"fancybox-active compensate-for-scrollbar\");\n\n        $(\"#fancybox-style-noscroll\").remove();\n      }\n    },\n\n    // Call callback and trigger an event\n    // ==================================\n\n    trigger: function (name, slide) {\n      var args = Array.prototype.slice.call(arguments, 1),\n        self = this,\n        obj = slide && slide.opts ? slide : self.current,\n        rez;\n\n      if (obj) {\n        args.unshift(obj);\n      } else {\n        obj = self;\n      }\n\n      args.unshift(self);\n\n      if ($.isFunction(obj.opts[name])) {\n        rez = obj.opts[name].apply(obj, args);\n      }\n\n      if (rez === false) {\n        return rez;\n      }\n\n      if (name === \"afterClose\" || !self.$refs) {\n        $D.trigger(name + \".fb\", args);\n      } else {\n        self.$refs.container.trigger(name + \".fb\", args);\n      }\n    },\n\n    // Update infobar values, navigation button states and reveal caption\n    // ==================================================================\n\n    updateControls: function () {\n      var self = this,\n        current = self.current,\n        index = current.index,\n        $container = self.$refs.container,\n        $caption = self.$refs.caption,\n        caption = current.opts.caption;\n\n      // Recalculate content dimensions\n      current.$slide.trigger(\"refresh\");\n\n      // Set caption\n      if (caption && caption.length) {\n        self.$caption = $caption;\n\n        $caption\n          .children()\n          .eq(0)\n          .html(caption);\n      } else {\n        self.$caption = null;\n      }\n\n      if (!self.hasHiddenControls && !self.isIdle) {\n        self.showControls();\n      }\n\n      // Update info and navigation elements\n      $container.find(\"[data-fancybox-count]\").html(self.group.length);\n      $container.find(\"[data-fancybox-index]\").html(index + 1);\n\n      $container.find(\"[data-fancybox-prev]\").prop(\"disabled\", !current.opts.loop && index <= 0);\n      $container.find(\"[data-fancybox-next]\").prop(\"disabled\", !current.opts.loop && index >= self.group.length - 1);\n\n      if (current.type === \"image\") {\n        // Re-enable buttons; update download button source\n        $container\n          .find(\"[data-fancybox-zoom]\")\n          .show()\n          .end()\n          .find(\"[data-fancybox-download]\")\n          .attr(\"href\", current.opts.image.src || current.src)\n          .show();\n      } else if (current.opts.toolbar) {\n        $container.find(\"[data-fancybox-download],[data-fancybox-zoom]\").hide();\n      }\n\n      // Make sure focus is not on disabled button/element\n      if ($(document.activeElement).is(\":hidden,[disabled]\")) {\n        self.$refs.container.trigger(\"focus\");\n      }\n    },\n\n    // Hide toolbar and caption\n    // ========================\n\n    hideControls: function (andCaption) {\n      var self = this,\n        arr = [\"infobar\", \"toolbar\", \"nav\"];\n\n      if (andCaption || !self.current.opts.preventCaptionOverlap) {\n        arr.push(\"caption\");\n      }\n\n      this.$refs.container.removeClass(\n        arr\n        .map(function (i) {\n          return \"fancybox-show-\" + i;\n        })\n        .join(\" \")\n      );\n\n      this.hasHiddenControls = true;\n    },\n\n    showControls: function () {\n      var self = this,\n        opts = self.current ? self.current.opts : self.opts,\n        $container = self.$refs.container;\n\n      self.hasHiddenControls = false;\n      self.idleSecondsCounter = 0;\n\n      $container\n        .toggleClass(\"fancybox-show-toolbar\", !!(opts.toolbar && opts.buttons))\n        .toggleClass(\"fancybox-show-infobar\", !!(opts.infobar && self.group.length > 1))\n        .toggleClass(\"fancybox-show-caption\", !!self.$caption)\n        .toggleClass(\"fancybox-show-nav\", !!(opts.arrows && self.group.length > 1))\n        .toggleClass(\"fancybox-is-modal\", !!opts.modal);\n    },\n\n    // Toggle toolbar and caption\n    // ==========================\n\n    toggleControls: function () {\n      if (this.hasHiddenControls) {\n        this.showControls();\n      } else {\n        this.hideControls();\n      }\n    }\n  });\n\n  $.fancybox = {\n    version: \"{fancybox-version}\",\n    defaults: defaults,\n\n    // Get current instance and execute a command.\n    //\n    // Examples of usage:\n    //\n    //   $instance = $.fancybox.getInstance();\n    //   $.fancybox.getInstance().jumpTo( 1 );\n    //   $.fancybox.getInstance( 'jumpTo', 1 );\n    //   $.fancybox.getInstance( function() {\n    //       console.info( this.currIndex );\n    //   });\n    // ======================================================\n\n    getInstance: function (command) {\n      var instance = $('.fancybox-container:not(\".fancybox-is-closing\"):last').data(\"FancyBox\"),\n        args = Array.prototype.slice.call(arguments, 1);\n\n      if (instance instanceof FancyBox) {\n        if ($.type(command) === \"string\") {\n          instance[command].apply(instance, args);\n        } else if ($.type(command) === \"function\") {\n          command.apply(instance, args);\n        }\n\n        return instance;\n      }\n\n      return false;\n    },\n\n    // Create new instance\n    // ===================\n\n    open: function (items, opts, index) {\n      return new FancyBox(items, opts, index);\n    },\n\n    // Close current or all instances\n    // ==============================\n\n    close: function (all) {\n      var instance = this.getInstance();\n\n      if (instance) {\n        instance.close();\n\n        // Try to find and close next instance\n        if (all === true) {\n          this.close(all);\n        }\n      }\n    },\n\n    // Close all instances and unbind all events\n    // =========================================\n\n    destroy: function () {\n      this.close(true);\n\n      $D.add(\"body\").off(\"click.fb-start\", \"**\");\n    },\n\n    // Try to detect mobile devices\n    // ============================\n\n    isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),\n\n    // Detect if 'translate3d' support is available\n    // ============================================\n\n    use3d: (function () {\n      var div = document.createElement(\"div\");\n\n      return (\n        window.getComputedStyle &&\n        window.getComputedStyle(div) &&\n        window.getComputedStyle(div).getPropertyValue(\"transform\") &&\n        !(document.documentMode && document.documentMode < 11)\n      );\n    })(),\n\n    // Helper function to get current visual state of an element\n    // returns array[ top, left, horizontal-scale, vertical-scale, opacity ]\n    // =====================================================================\n\n    getTranslate: function ($el) {\n      var domRect;\n\n      if (!$el || !$el.length) {\n        return false;\n      }\n\n      domRect = $el[0].getBoundingClientRect();\n\n      return {\n        top: domRect.top || 0,\n        left: domRect.left || 0,\n        width: domRect.width,\n        height: domRect.height,\n        opacity: parseFloat($el.css(\"opacity\"))\n      };\n    },\n\n    // Shortcut for setting \"translate3d\" properties for element\n    // Can set be used to set opacity, too\n    // ========================================================\n\n    setTranslate: function ($el, props) {\n      var str = \"\",\n        css = {};\n\n      if (!$el || !props) {\n        return;\n      }\n\n      if (props.left !== undefined || props.top !== undefined) {\n        str =\n          (props.left === undefined ? $el.position().left : props.left) +\n          \"px, \" +\n          (props.top === undefined ? $el.position().top : props.top) +\n          \"px\";\n\n        if (this.use3d) {\n          str = \"translate3d(\" + str + \", 0px)\";\n        } else {\n          str = \"translate(\" + str + \")\";\n        }\n      }\n\n      if (props.scaleX !== undefined && props.scaleY !== undefined) {\n        str += \" scale(\" + props.scaleX + \", \" + props.scaleY + \")\";\n      } else if (props.scaleX !== undefined) {\n        str += \" scaleX(\" + props.scaleX + \")\";\n      }\n\n      if (str.length) {\n        css.transform = str;\n      }\n\n      if (props.opacity !== undefined) {\n        css.opacity = props.opacity;\n      }\n\n      if (props.width !== undefined) {\n        css.width = props.width;\n      }\n\n      if (props.height !== undefined) {\n        css.height = props.height;\n      }\n\n      return $el.css(css);\n    },\n\n    // Simple CSS transition handler\n    // =============================\n\n    animate: function ($el, to, duration, callback, leaveAnimationName) {\n      var self = this,\n        from;\n\n      if ($.isFunction(duration)) {\n        callback = duration;\n        duration = null;\n      }\n\n      self.stop($el);\n\n      from = self.getTranslate($el);\n\n      $el.on(transitionEnd, function (e) {\n        // Skip events from child elements and z-index change\n        if (e && e.originalEvent && (!$el.is(e.originalEvent.target) || e.originalEvent.propertyName == \"z-index\")) {\n          return;\n        }\n\n        self.stop($el);\n\n        if ($.isNumeric(duration)) {\n          $el.css(\"transition-duration\", \"\");\n        }\n\n        if ($.isPlainObject(to)) {\n          if (to.scaleX !== undefined && to.scaleY !== undefined) {\n            self.setTranslate($el, {\n              top: to.top,\n              left: to.left,\n              width: from.width * to.scaleX,\n              height: from.height * to.scaleY,\n              scaleX: 1,\n              scaleY: 1\n            });\n          }\n        } else if (leaveAnimationName !== true) {\n          $el.removeClass(to);\n        }\n\n        if ($.isFunction(callback)) {\n          callback(e);\n        }\n      });\n\n      if ($.isNumeric(duration)) {\n        $el.css(\"transition-duration\", duration + \"ms\");\n      }\n\n      // Start animation by changing CSS properties or class name\n      if ($.isPlainObject(to)) {\n        if (to.scaleX !== undefined && to.scaleY !== undefined) {\n          delete to.width;\n          delete to.height;\n\n          if ($el.parent().hasClass(\"fancybox-slide--image\")) {\n            $el.parent().addClass(\"fancybox-is-scaling\");\n          }\n        }\n\n        $.fancybox.setTranslate($el, to);\n      } else {\n        $el.addClass(to);\n      }\n\n      // Make sure that `transitionend` callback gets fired\n      $el.data(\n        \"timer\",\n        setTimeout(function () {\n          $el.trigger(transitionEnd);\n        }, duration + 33)\n      );\n    },\n\n    stop: function ($el, callCallback) {\n      if ($el && $el.length) {\n        clearTimeout($el.data(\"timer\"));\n\n        if (callCallback) {\n          $el.trigger(transitionEnd);\n        }\n\n        $el.off(transitionEnd).css(\"transition-duration\", \"\");\n\n        $el.parent().removeClass(\"fancybox-is-scaling\");\n      }\n    }\n  };\n\n  // Default click handler for \"fancyboxed\" links\n  // ============================================\n\n  function _run(e, opts) {\n    var items = [],\n      index = 0,\n      $target,\n      value,\n      instance;\n\n    // Avoid opening multiple times\n    if (e && e.isDefaultPrevented()) {\n      return;\n    }\n\n    e.preventDefault();\n\n    opts = opts || {};\n\n    if (e && e.data) {\n      opts = mergeOpts(e.data.options, opts);\n    }\n\n    $target = opts.$target || $(e.currentTarget).trigger(\"blur\");\n    instance = $.fancybox.getInstance();\n\n    if (instance && instance.$trigger && instance.$trigger.is($target)) {\n      return;\n    }\n\n    if (opts.selector) {\n      items = $(opts.selector);\n    } else {\n      // Get all related items and find index for clicked one\n      value = $target.attr(\"data-fancybox\") || \"\";\n\n      if (value) {\n        items = e.data ? e.data.items : [];\n        items = items.length ? items.filter('[data-fancybox=\"' + value + '\"]') : $('[data-fancybox=\"' + value + '\"]');\n      } else {\n        items = [$target];\n      }\n    }\n\n    index = $(items).index($target);\n\n    // Sometimes current item can not be found\n    if (index < 0) {\n      index = 0;\n    }\n\n    instance = $.fancybox.open(items, opts, index);\n\n    // Save last active element\n    instance.$trigger = $target;\n  }\n\n  // Create a jQuery plugin\n  // ======================\n\n  $.fn.fancybox = function (options) {\n    var selector;\n\n    options = options || {};\n    selector = options.selector || false;\n\n    if (selector) {\n      // Use body element instead of document so it executes first\n      $(\"body\")\n        .off(\"click.fb-start\", selector)\n        .on(\"click.fb-start\", selector, {\n          options: options\n        }, _run);\n    } else {\n      this.off(\"click.fb-start\").on(\n        \"click.fb-start\", {\n          items: this,\n          options: options\n        },\n        _run\n      );\n    }\n\n    return this;\n  };\n\n  // Self initializing plugin for all elements having `data-fancybox` attribute\n  // ==========================================================================\n\n  $D.on(\"click.fb-start\", \"[data-fancybox]\", _run);\n\n  // Enable \"trigger elements\"\n  // =========================\n\n  $D.on(\"click.fb-start\", \"[data-fancybox-trigger]\", function (e) {\n    $('[data-fancybox=\"' + $(this).attr(\"data-fancybox-trigger\") + '\"]')\n      .eq($(this).attr(\"data-fancybox-index\") || 0)\n      .trigger(\"click.fb-start\", {\n        $trigger: $(this)\n      });\n  });\n\n  // Track focus event for better accessibility styling\n  // ==================================================\n  (function () {\n    var buttonStr = \".fancybox-button\",\n      focusStr = \"fancybox-focus\",\n      $pressed = null;\n\n    $D.on(\"mousedown mouseup focus blur\", buttonStr, function (e) {\n      switch (e.type) {\n        case \"mousedown\":\n          $pressed = $(this);\n          break;\n        case \"mouseup\":\n          $pressed = null;\n          break;\n        case \"focusin\":\n          $(buttonStr).removeClass(focusStr);\n\n          if (!$(this).is($pressed) && !$(this).is(\"[disabled]\")) {\n            $(this).addClass(focusStr);\n          }\n          break;\n        case \"focusout\":\n          $(buttonStr).removeClass(focusStr);\n          break;\n      }\n    });\n  })();\n})(window, document, jQuery);"
  },
  {
    "path": "src/js/fullscreen.js",
    "content": "// ==========================================================================\n//\n// FullScreen\n// Adds fullscreen functionality\n//\n// ==========================================================================\n(function (document, $) {\n  \"use strict\";\n\n  // Collection of methods supported by user browser\n  var fn = (function () {\n    var fnMap = [\n      [\"requestFullscreen\", \"exitFullscreen\", \"fullscreenElement\", \"fullscreenEnabled\", \"fullscreenchange\", \"fullscreenerror\"],\n      // new WebKit\n      [\n        \"webkitRequestFullscreen\",\n        \"webkitExitFullscreen\",\n        \"webkitFullscreenElement\",\n        \"webkitFullscreenEnabled\",\n        \"webkitfullscreenchange\",\n        \"webkitfullscreenerror\"\n      ],\n      // old WebKit (Safari 5.1)\n      [\n        \"webkitRequestFullScreen\",\n        \"webkitCancelFullScreen\",\n        \"webkitCurrentFullScreenElement\",\n        \"webkitCancelFullScreen\",\n        \"webkitfullscreenchange\",\n        \"webkitfullscreenerror\"\n      ],\n      [\n        \"mozRequestFullScreen\",\n        \"mozCancelFullScreen\",\n        \"mozFullScreenElement\",\n        \"mozFullScreenEnabled\",\n        \"mozfullscreenchange\",\n        \"mozfullscreenerror\"\n      ],\n      [\"msRequestFullscreen\", \"msExitFullscreen\", \"msFullscreenElement\", \"msFullscreenEnabled\", \"MSFullscreenChange\", \"MSFullscreenError\"]\n    ];\n\n    var ret = {};\n\n    for (var i = 0; i < fnMap.length; i++) {\n      var val = fnMap[i];\n\n      if (val && val[1] in document) {\n        for (var j = 0; j < val.length; j++) {\n          ret[fnMap[0][j]] = val[j];\n        }\n\n        return ret;\n      }\n    }\n\n    return false;\n  })();\n\n  if (fn) {\n    var FullScreen = {\n      request: function (elem) {\n        elem = elem || document.documentElement;\n\n        elem[fn.requestFullscreen](elem.ALLOW_KEYBOARD_INPUT);\n      },\n      exit: function () {\n        document[fn.exitFullscreen]();\n      },\n      toggle: function (elem) {\n        elem = elem || document.documentElement;\n\n        if (this.isFullscreen()) {\n          this.exit();\n        } else {\n          this.request(elem);\n        }\n      },\n      isFullscreen: function () {\n        return Boolean(document[fn.fullscreenElement]);\n      },\n      enabled: function () {\n        return Boolean(document[fn.fullscreenEnabled]);\n      }\n    };\n\n    $.extend(true, $.fancybox.defaults, {\n      btnTpl: {\n        fullScreen: '<button data-fancybox-fullscreen class=\"fancybox-button fancybox-button--fsenter\" title=\"{{FULL_SCREEN}}\">' +\n          '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z\"/></svg>' +\n          '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z\"/></svg>' +\n          \"</button>\"\n      },\n      fullScreen: {\n        autoStart: false\n      }\n    });\n\n    $(document).on(fn.fullscreenchange, function () {\n      var isFullscreen = FullScreen.isFullscreen(),\n        instance = $.fancybox.getInstance();\n\n      if (instance) {\n        // If image is zooming, then force to stop and reposition properly\n        if (instance.current && instance.current.type === \"image\" && instance.isAnimating) {\n          instance.isAnimating = false;\n\n          instance.update(true, true, 0);\n\n          if (!instance.isComplete) {\n            instance.complete();\n          }\n        }\n\n        instance.trigger(\"onFullscreenChange\", isFullscreen);\n\n        instance.$refs.container.toggleClass(\"fancybox-is-fullscreen\", isFullscreen);\n\n        instance.$refs.toolbar\n          .find(\"[data-fancybox-fullscreen]\")\n          .toggleClass(\"fancybox-button--fsenter\", !isFullscreen)\n          .toggleClass(\"fancybox-button--fsexit\", isFullscreen);\n      }\n    });\n  }\n\n  $(document).on({\n    \"onInit.fb\": function (e, instance) {\n      var $container;\n\n      if (!fn) {\n        instance.$refs.toolbar.find(\"[data-fancybox-fullscreen]\").remove();\n\n        return;\n      }\n\n      if (instance && instance.group[instance.currIndex].opts.fullScreen) {\n        $container = instance.$refs.container;\n\n        $container.on(\"click.fb-fullscreen\", \"[data-fancybox-fullscreen]\", function (e) {\n          e.stopPropagation();\n          e.preventDefault();\n\n          FullScreen.toggle();\n        });\n\n        if (instance.opts.fullScreen && instance.opts.fullScreen.autoStart === true) {\n          FullScreen.request();\n        }\n\n        // Expose API\n        instance.FullScreen = FullScreen;\n      } else if (instance) {\n        instance.$refs.toolbar.find(\"[data-fancybox-fullscreen]\").hide();\n      }\n    },\n\n    \"afterKeydown.fb\": function (e, instance, current, keypress, keycode) {\n      // \"F\"\n      if (instance && instance.FullScreen && keycode === 70) {\n        keypress.preventDefault();\n\n        instance.FullScreen.toggle();\n      }\n    },\n\n    \"beforeClose.fb\": function (e, instance) {\n      if (instance && instance.FullScreen && instance.$refs.container.hasClass(\"fancybox-is-fullscreen\")) {\n        FullScreen.exit();\n      }\n    }\n  });\n})(document, jQuery);"
  },
  {
    "path": "src/js/guestures.js",
    "content": "// ==========================================================================\n//\n// Guestures\n// Adds touch guestures, handles click and tap events\n//\n// ==========================================================================\n(function (window, document, $) {\n  \"use strict\";\n\n  var requestAFrame = (function () {\n    return (\n      window.requestAnimationFrame ||\n      window.webkitRequestAnimationFrame ||\n      window.mozRequestAnimationFrame ||\n      window.oRequestAnimationFrame ||\n      // if all else fails, use setTimeout\n      function (callback) {\n        return window.setTimeout(callback, 1000 / 60);\n      }\n    );\n  })();\n\n  var cancelAFrame = (function () {\n    return (\n      window.cancelAnimationFrame ||\n      window.webkitCancelAnimationFrame ||\n      window.mozCancelAnimationFrame ||\n      window.oCancelAnimationFrame ||\n      function (id) {\n        window.clearTimeout(id);\n      }\n    );\n  })();\n\n  var getPointerXY = function (e) {\n    var result = [];\n\n    e = e.originalEvent || e || window.e;\n    e = e.touches && e.touches.length ? e.touches : e.changedTouches && e.changedTouches.length ? e.changedTouches : [e];\n\n    for (var key in e) {\n      if (e[key].pageX) {\n        result.push({\n          x: e[key].pageX,\n          y: e[key].pageY\n        });\n      } else if (e[key].clientX) {\n        result.push({\n          x: e[key].clientX,\n          y: e[key].clientY\n        });\n      }\n    }\n\n    return result;\n  };\n\n  var distance = function (point2, point1, what) {\n    if (!point1 || !point2) {\n      return 0;\n    }\n\n    if (what === \"x\") {\n      return point2.x - point1.x;\n    } else if (what === \"y\") {\n      return point2.y - point1.y;\n    }\n\n    return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2));\n  };\n\n  var isClickable = function ($el) {\n    if (\n      $el.is('a,area,button,[role=\"button\"],input,label,select,summary,textarea,video,audio,iframe') ||\n      $.isFunction($el.get(0).onclick) ||\n      $el.data(\"selectable\")\n    ) {\n      return true;\n    }\n\n    // Check for attributes like data-fancybox-next or data-fancybox-close\n    for (var i = 0, atts = $el[0].attributes, n = atts.length; i < n; i++) {\n      if (atts[i].nodeName.substr(0, 14) === \"data-fancybox-\") {\n        return true;\n      }\n    }\n\n    return false;\n  };\n\n  var hasScrollbars = function (el) {\n    var overflowY = window.getComputedStyle(el)[\"overflow-y\"],\n      overflowX = window.getComputedStyle(el)[\"overflow-x\"],\n      vertical = (overflowY === \"scroll\" || overflowY === \"auto\") && el.scrollHeight > el.clientHeight,\n      horizontal = (overflowX === \"scroll\" || overflowX === \"auto\") && el.scrollWidth > el.clientWidth;\n\n    return vertical || horizontal;\n  };\n\n  var isScrollable = function ($el) {\n    var rez = false;\n\n    while (true) {\n      rez = hasScrollbars($el.get(0));\n\n      if (rez) {\n        break;\n      }\n\n      $el = $el.parent();\n\n      if (!$el.length || $el.hasClass(\"fancybox-stage\") || $el.is(\"body\")) {\n        break;\n      }\n    }\n\n    return rez;\n  };\n\n  var Guestures = function (instance) {\n    var self = this;\n\n    self.instance = instance;\n\n    self.$bg = instance.$refs.bg;\n    self.$stage = instance.$refs.stage;\n    self.$container = instance.$refs.container;\n\n    self.destroy();\n\n    self.$container.on(\"touchstart.fb.touch mousedown.fb.touch\", $.proxy(self, \"ontouchstart\"));\n  };\n\n  Guestures.prototype.destroy = function () {\n    var self = this;\n\n    self.$container.off(\".fb.touch\");\n\n    $(document).off(\".fb.touch\");\n\n    if (self.requestId) {\n      cancelAFrame(self.requestId);\n      self.requestId = null;\n    }\n\n    if (self.tapped) {\n      clearTimeout(self.tapped);\n      self.tapped = null;\n    }\n  };\n\n  Guestures.prototype.ontouchstart = function (e) {\n    var self = this,\n      $target = $(e.target),\n      instance = self.instance,\n      current = instance.current,\n      $slide = current.$slide,\n      $content = current.$content,\n      isTouchDevice = e.type == \"touchstart\";\n\n    // Do not respond to both (touch and mouse) events\n    if (isTouchDevice) {\n      self.$container.off(\"mousedown.fb.touch\");\n    }\n\n    // Ignore right click\n    if (e.originalEvent && e.originalEvent.button == 2) {\n      return;\n    }\n\n    // Ignore taping on links, buttons, input elements\n    if (!$slide.length || !$target.length || isClickable($target) || isClickable($target.parent())) {\n      return;\n    }\n    // Ignore clicks on the scrollbar\n    if (!$target.is(\"img\") && e.originalEvent.clientX > $target[0].clientWidth + $target.offset().left) {\n      return;\n    }\n\n    // Ignore clicks while zooming or closing\n    if (!current || instance.isAnimating || current.$slide.hasClass(\"fancybox-animated\")) {\n      e.stopPropagation();\n      e.preventDefault();\n\n      return;\n    }\n\n    self.realPoints = self.startPoints = getPointerXY(e);\n\n    if (!self.startPoints.length) {\n      return;\n    }\n\n    // Allow other scripts to catch touch event if \"touch\" is set to false\n    if (current.touch) {\n      e.stopPropagation();\n    }\n\n    self.startEvent = e;\n\n    self.canTap = true;\n    self.$target = $target;\n    self.$content = $content;\n    self.opts = current.opts.touch;\n\n    self.isPanning = false;\n    self.isSwiping = false;\n    self.isZooming = false;\n    self.isScrolling = false;\n    self.canPan = instance.canPan();\n\n    self.startTime = new Date().getTime();\n    self.distanceX = self.distanceY = self.distance = 0;\n\n    self.canvasWidth = Math.round($slide[0].clientWidth);\n    self.canvasHeight = Math.round($slide[0].clientHeight);\n\n    self.contentLastPos = null;\n    self.contentStartPos = $.fancybox.getTranslate(self.$content) || {\n      top: 0,\n      left: 0\n    };\n    self.sliderStartPos = $.fancybox.getTranslate($slide);\n\n    // Since position will be absolute, but we need to make it relative to the stage\n    self.stagePos = $.fancybox.getTranslate(instance.$refs.stage);\n\n    self.sliderStartPos.top -= self.stagePos.top;\n    self.sliderStartPos.left -= self.stagePos.left;\n\n    self.contentStartPos.top -= self.stagePos.top;\n    self.contentStartPos.left -= self.stagePos.left;\n\n    $(document)\n      .off(\".fb.touch\")\n      .on(isTouchDevice ? \"touchend.fb.touch touchcancel.fb.touch\" : \"mouseup.fb.touch mouseleave.fb.touch\", $.proxy(self, \"ontouchend\"))\n      .on(isTouchDevice ? \"touchmove.fb.touch\" : \"mousemove.fb.touch\", $.proxy(self, \"ontouchmove\"));\n\n    if ($.fancybox.isMobile) {\n      document.addEventListener(\"scroll\", self.onscroll, true);\n    }\n\n    // Skip if clicked outside the sliding area\n    if (!(self.opts || self.canPan) || !($target.is(self.$stage) || self.$stage.find($target).length)) {\n      if ($target.is(\".fancybox-image\")) {\n        e.preventDefault();\n      }\n\n      if (!($.fancybox.isMobile && $target.parents(\".fancybox-caption\").length)) {\n        return;\n      }\n    }\n\n    self.isScrollable = isScrollable($target) || isScrollable($target.parent());\n\n    // Check if element is scrollable and try to prevent default behavior (scrolling)\n    if (!($.fancybox.isMobile && self.isScrollable)) {\n      e.preventDefault();\n    }\n\n    // One finger or mouse click - swipe or pan an image\n    if (self.startPoints.length === 1 || current.hasError) {\n      if (self.canPan) {\n        $.fancybox.stop(self.$content);\n\n        self.isPanning = true;\n      } else {\n        self.isSwiping = true;\n      }\n\n      self.$container.addClass(\"fancybox-is-grabbing\");\n    }\n\n    // Two fingers - zoom image\n    if (self.startPoints.length === 2 && current.type === \"image\" && (current.isLoaded || current.$ghost)) {\n      self.canTap = false;\n      self.isSwiping = false;\n      self.isPanning = false;\n\n      self.isZooming = true;\n\n      $.fancybox.stop(self.$content);\n\n      self.centerPointStartX = (self.startPoints[0].x + self.startPoints[1].x) * 0.5 - $(window).scrollLeft();\n      self.centerPointStartY = (self.startPoints[0].y + self.startPoints[1].y) * 0.5 - $(window).scrollTop();\n\n      self.percentageOfImageAtPinchPointX = (self.centerPointStartX - self.contentStartPos.left) / self.contentStartPos.width;\n      self.percentageOfImageAtPinchPointY = (self.centerPointStartY - self.contentStartPos.top) / self.contentStartPos.height;\n\n      self.startDistanceBetweenFingers = distance(self.startPoints[0], self.startPoints[1]);\n    }\n  };\n\n  Guestures.prototype.onscroll = function (e) {\n    var self = this;\n\n    self.isScrolling = true;\n\n    document.removeEventListener(\"scroll\", self.onscroll, true);\n  };\n\n  Guestures.prototype.ontouchmove = function (e) {\n    var self = this;\n\n    // Make sure user has not released over iframe or disabled element\n    if (e.originalEvent.buttons !== undefined && e.originalEvent.buttons === 0) {\n      self.ontouchend(e);\n      return;\n    }\n\n    if (self.isScrolling) {\n      self.canTap = false;\n      return;\n    }\n\n    self.newPoints = getPointerXY(e);\n\n    if (!(self.opts || self.canPan) || !self.newPoints.length || !self.newPoints.length) {\n      return;\n    }\n\n    if (!(self.isSwiping && self.isSwiping === true)) {\n      e.preventDefault();\n    }\n\n    self.distanceX = distance(self.newPoints[0], self.startPoints[0], \"x\");\n    self.distanceY = distance(self.newPoints[0], self.startPoints[0], \"y\");\n\n    self.distance = distance(self.newPoints[0], self.startPoints[0]);\n\n    // Skip false ontouchmove events (Chrome)\n    if (self.distance > 0) {\n      if (self.isSwiping) {\n        self.onSwipe(e);\n      } else if (self.isPanning) {\n        self.onPan();\n      } else if (self.isZooming) {\n        self.onZoom();\n      }\n    }\n  };\n\n  Guestures.prototype.onSwipe = function (e) {\n    var self = this,\n      instance = self.instance,\n      swiping = self.isSwiping,\n      left = self.sliderStartPos.left || 0,\n      angle;\n\n    // If direction is not yet determined\n    if (swiping === true) {\n      // We need at least 10px distance to correctly calculate an angle\n      if (Math.abs(self.distance) > 10) {\n        self.canTap = false;\n\n        if (instance.group.length < 2 && self.opts.vertical) {\n          self.isSwiping = \"y\";\n        } else if (instance.isDragging || self.opts.vertical === false || (self.opts.vertical === \"auto\" && $(window).width() > 800)) {\n          self.isSwiping = \"x\";\n        } else {\n          angle = Math.abs((Math.atan2(self.distanceY, self.distanceX) * 180) / Math.PI);\n\n          self.isSwiping = angle > 45 && angle < 135 ? \"y\" : \"x\";\n        }\n\n        if (self.isSwiping === \"y\" && $.fancybox.isMobile && self.isScrollable) {\n          self.isScrolling = true;\n\n          return;\n        }\n\n        instance.isDragging = self.isSwiping;\n\n        // Reset points to avoid jumping, because we dropped first swipes to calculate the angle\n        self.startPoints = self.newPoints;\n\n        $.each(instance.slides, function (index, slide) {\n          var slidePos, stagePos;\n\n          $.fancybox.stop(slide.$slide);\n\n          slidePos = $.fancybox.getTranslate(slide.$slide);\n          stagePos = $.fancybox.getTranslate(instance.$refs.stage);\n\n          slide.$slide\n            .css({\n              transform: \"\",\n              opacity: \"\",\n              \"transition-duration\": \"\"\n            })\n            .removeClass(\"fancybox-animated\")\n            .removeClass(function (index, className) {\n              return (className.match(/(^|\\s)fancybox-fx-\\S+/g) || []).join(\" \");\n            });\n\n          if (slide.pos === instance.current.pos) {\n            self.sliderStartPos.top = slidePos.top - stagePos.top;\n            self.sliderStartPos.left = slidePos.left - stagePos.left;\n          }\n\n          $.fancybox.setTranslate(slide.$slide, {\n            top: slidePos.top - stagePos.top,\n            left: slidePos.left - stagePos.left\n          });\n        });\n\n        // Stop slideshow\n        if (instance.SlideShow && instance.SlideShow.isActive) {\n          instance.SlideShow.stop();\n        }\n      }\n\n      return;\n    }\n\n    // Sticky edges\n    if (swiping == \"x\") {\n      if (\n        self.distanceX > 0 &&\n        (self.instance.group.length < 2 || (self.instance.current.index === 0 && !self.instance.current.opts.loop))\n      ) {\n        left = left + Math.pow(self.distanceX, 0.8);\n      } else if (\n        self.distanceX < 0 &&\n        (self.instance.group.length < 2 ||\n          (self.instance.current.index === self.instance.group.length - 1 && !self.instance.current.opts.loop))\n      ) {\n        left = left - Math.pow(-self.distanceX, 0.8);\n      } else {\n        left = left + self.distanceX;\n      }\n    }\n\n    self.sliderLastPos = {\n      top: swiping == \"x\" ? 0 : self.sliderStartPos.top + self.distanceY,\n      left: left\n    };\n\n    if (self.requestId) {\n      cancelAFrame(self.requestId);\n\n      self.requestId = null;\n    }\n\n    self.requestId = requestAFrame(function () {\n      if (self.sliderLastPos) {\n        $.each(self.instance.slides, function (index, slide) {\n          var pos = slide.pos - self.instance.currPos;\n\n          $.fancybox.setTranslate(slide.$slide, {\n            top: self.sliderLastPos.top,\n            left: self.sliderLastPos.left + pos * self.canvasWidth + pos * slide.opts.gutter\n          });\n        });\n\n        self.$container.addClass(\"fancybox-is-sliding\");\n      }\n    });\n  };\n\n  Guestures.prototype.onPan = function () {\n    var self = this;\n\n    // Prevent accidental movement (sometimes, when tapping casually, finger can move a bit)\n    if (distance(self.newPoints[0], self.realPoints[0]) < ($.fancybox.isMobile ? 10 : 5)) {\n      self.startPoints = self.newPoints;\n      return;\n    }\n\n    self.canTap = false;\n\n    self.contentLastPos = self.limitMovement();\n\n    if (self.requestId) {\n      cancelAFrame(self.requestId);\n    }\n\n    self.requestId = requestAFrame(function () {\n      $.fancybox.setTranslate(self.$content, self.contentLastPos);\n    });\n  };\n\n  // Make panning sticky to the edges\n  Guestures.prototype.limitMovement = function () {\n    var self = this;\n\n    var canvasWidth = self.canvasWidth;\n    var canvasHeight = self.canvasHeight;\n\n    var distanceX = self.distanceX;\n    var distanceY = self.distanceY;\n\n    var contentStartPos = self.contentStartPos;\n\n    var currentOffsetX = contentStartPos.left;\n    var currentOffsetY = contentStartPos.top;\n\n    var currentWidth = contentStartPos.width;\n    var currentHeight = contentStartPos.height;\n\n    var minTranslateX, minTranslateY, maxTranslateX, maxTranslateY, newOffsetX, newOffsetY;\n\n    if (currentWidth > canvasWidth) {\n      newOffsetX = currentOffsetX + distanceX;\n    } else {\n      newOffsetX = currentOffsetX;\n    }\n\n    newOffsetY = currentOffsetY + distanceY;\n\n    // Slow down proportionally to traveled distance\n    minTranslateX = Math.max(0, canvasWidth * 0.5 - currentWidth * 0.5);\n    minTranslateY = Math.max(0, canvasHeight * 0.5 - currentHeight * 0.5);\n\n    maxTranslateX = Math.min(canvasWidth - currentWidth, canvasWidth * 0.5 - currentWidth * 0.5);\n    maxTranslateY = Math.min(canvasHeight - currentHeight, canvasHeight * 0.5 - currentHeight * 0.5);\n\n    //   ->\n    if (distanceX > 0 && newOffsetX > minTranslateX) {\n      newOffsetX = minTranslateX - 1 + Math.pow(-minTranslateX + currentOffsetX + distanceX, 0.8) || 0;\n    }\n\n    //    <-\n    if (distanceX < 0 && newOffsetX < maxTranslateX) {\n      newOffsetX = maxTranslateX + 1 - Math.pow(maxTranslateX - currentOffsetX - distanceX, 0.8) || 0;\n    }\n\n    //   \\/\n    if (distanceY > 0 && newOffsetY > minTranslateY) {\n      newOffsetY = minTranslateY - 1 + Math.pow(-minTranslateY + currentOffsetY + distanceY, 0.8) || 0;\n    }\n\n    //   /\\\n    if (distanceY < 0 && newOffsetY < maxTranslateY) {\n      newOffsetY = maxTranslateY + 1 - Math.pow(maxTranslateY - currentOffsetY - distanceY, 0.8) || 0;\n    }\n\n    return {\n      top: newOffsetY,\n      left: newOffsetX\n    };\n  };\n\n  Guestures.prototype.limitPosition = function (newOffsetX, newOffsetY, newWidth, newHeight) {\n    var self = this;\n\n    var canvasWidth = self.canvasWidth;\n    var canvasHeight = self.canvasHeight;\n\n    if (newWidth > canvasWidth) {\n      newOffsetX = newOffsetX > 0 ? 0 : newOffsetX;\n      newOffsetX = newOffsetX < canvasWidth - newWidth ? canvasWidth - newWidth : newOffsetX;\n    } else {\n      // Center horizontally\n      newOffsetX = Math.max(0, canvasWidth / 2 - newWidth / 2);\n    }\n\n    if (newHeight > canvasHeight) {\n      newOffsetY = newOffsetY > 0 ? 0 : newOffsetY;\n      newOffsetY = newOffsetY < canvasHeight - newHeight ? canvasHeight - newHeight : newOffsetY;\n    } else {\n      // Center vertically\n      newOffsetY = Math.max(0, canvasHeight / 2 - newHeight / 2);\n    }\n\n    return {\n      top: newOffsetY,\n      left: newOffsetX\n    };\n  };\n\n  Guestures.prototype.onZoom = function () {\n    var self = this;\n\n    // Calculate current distance between points to get pinch ratio and new width and height\n    var contentStartPos = self.contentStartPos;\n\n    var currentWidth = contentStartPos.width;\n    var currentHeight = contentStartPos.height;\n\n    var currentOffsetX = contentStartPos.left;\n    var currentOffsetY = contentStartPos.top;\n\n    var endDistanceBetweenFingers = distance(self.newPoints[0], self.newPoints[1]);\n\n    var pinchRatio = endDistanceBetweenFingers / self.startDistanceBetweenFingers;\n\n    var newWidth = Math.floor(currentWidth * pinchRatio);\n    var newHeight = Math.floor(currentHeight * pinchRatio);\n\n    // This is the translation due to pinch-zooming\n    var translateFromZoomingX = (currentWidth - newWidth) * self.percentageOfImageAtPinchPointX;\n    var translateFromZoomingY = (currentHeight - newHeight) * self.percentageOfImageAtPinchPointY;\n\n    // Point between the two touches\n    var centerPointEndX = (self.newPoints[0].x + self.newPoints[1].x) / 2 - $(window).scrollLeft();\n    var centerPointEndY = (self.newPoints[0].y + self.newPoints[1].y) / 2 - $(window).scrollTop();\n\n    // And this is the translation due to translation of the centerpoint\n    // between the two fingers\n    var translateFromTranslatingX = centerPointEndX - self.centerPointStartX;\n    var translateFromTranslatingY = centerPointEndY - self.centerPointStartY;\n\n    // The new offset is the old/current one plus the total translation\n    var newOffsetX = currentOffsetX + (translateFromZoomingX + translateFromTranslatingX);\n    var newOffsetY = currentOffsetY + (translateFromZoomingY + translateFromTranslatingY);\n\n    var newPos = {\n      top: newOffsetY,\n      left: newOffsetX,\n      scaleX: pinchRatio,\n      scaleY: pinchRatio\n    };\n\n    self.canTap = false;\n\n    self.newWidth = newWidth;\n    self.newHeight = newHeight;\n\n    self.contentLastPos = newPos;\n\n    if (self.requestId) {\n      cancelAFrame(self.requestId);\n    }\n\n    self.requestId = requestAFrame(function () {\n      $.fancybox.setTranslate(self.$content, self.contentLastPos);\n    });\n  };\n\n  Guestures.prototype.ontouchend = function (e) {\n    var self = this;\n\n    var swiping = self.isSwiping;\n    var panning = self.isPanning;\n    var zooming = self.isZooming;\n    var scrolling = self.isScrolling;\n\n    self.endPoints = getPointerXY(e);\n    self.dMs = Math.max(new Date().getTime() - self.startTime, 1);\n\n    self.$container.removeClass(\"fancybox-is-grabbing\");\n\n    $(document).off(\".fb.touch\");\n\n    document.removeEventListener(\"scroll\", self.onscroll, true);\n\n    if (self.requestId) {\n      cancelAFrame(self.requestId);\n\n      self.requestId = null;\n    }\n\n    self.isSwiping = false;\n    self.isPanning = false;\n    self.isZooming = false;\n    self.isScrolling = false;\n\n    self.instance.isDragging = false;\n\n    if (self.canTap) {\n      return self.onTap(e);\n    }\n\n    self.speed = 100;\n\n    // Speed in px/ms\n    self.velocityX = (self.distanceX / self.dMs) * 0.5;\n    self.velocityY = (self.distanceY / self.dMs) * 0.5;\n\n    if (panning) {\n      self.endPanning();\n    } else if (zooming) {\n      self.endZooming();\n    } else {\n      self.endSwiping(swiping, scrolling);\n    }\n\n    return;\n  };\n\n  Guestures.prototype.endSwiping = function (swiping, scrolling) {\n    var self = this,\n      ret = false,\n      len = self.instance.group.length,\n      distanceX = Math.abs(self.distanceX),\n      canAdvance = swiping == \"x\" && len > 1 && ((self.dMs > 130 && distanceX > 10) || distanceX > 50),\n      speedX = 300;\n\n    self.sliderLastPos = null;\n\n    // Close if swiped vertically / navigate if horizontally\n    if (swiping == \"y\" && !scrolling && Math.abs(self.distanceY) > 50) {\n      // Continue vertical movement\n      $.fancybox.animate(\n        self.instance.current.$slide, {\n          top: self.sliderStartPos.top + self.distanceY + self.velocityY * 150,\n          opacity: 0\n        },\n        200\n      );\n      ret = self.instance.close(true, 250);\n    } else if (canAdvance && self.distanceX > 0) {\n      ret = self.instance.previous(speedX);\n    } else if (canAdvance && self.distanceX < 0) {\n      ret = self.instance.next(speedX);\n    }\n\n    if (ret === false && (swiping == \"x\" || swiping == \"y\")) {\n      self.instance.centerSlide(200);\n    }\n\n    self.$container.removeClass(\"fancybox-is-sliding\");\n  };\n\n  // Limit panning from edges\n  // ========================\n  Guestures.prototype.endPanning = function () {\n    var self = this,\n      newOffsetX,\n      newOffsetY,\n      newPos;\n\n    if (!self.contentLastPos) {\n      return;\n    }\n\n    if (self.opts.momentum === false || self.dMs > 350) {\n      newOffsetX = self.contentLastPos.left;\n      newOffsetY = self.contentLastPos.top;\n    } else {\n      // Continue movement\n      newOffsetX = self.contentLastPos.left + self.velocityX * 500;\n      newOffsetY = self.contentLastPos.top + self.velocityY * 500;\n    }\n\n    newPos = self.limitPosition(newOffsetX, newOffsetY, self.contentStartPos.width, self.contentStartPos.height);\n\n    newPos.width = self.contentStartPos.width;\n    newPos.height = self.contentStartPos.height;\n\n    $.fancybox.animate(self.$content, newPos, 366);\n  };\n\n  Guestures.prototype.endZooming = function () {\n    var self = this;\n\n    var current = self.instance.current;\n\n    var newOffsetX, newOffsetY, newPos, reset;\n\n    var newWidth = self.newWidth;\n    var newHeight = self.newHeight;\n\n    if (!self.contentLastPos) {\n      return;\n    }\n\n    newOffsetX = self.contentLastPos.left;\n    newOffsetY = self.contentLastPos.top;\n\n    reset = {\n      top: newOffsetY,\n      left: newOffsetX,\n      width: newWidth,\n      height: newHeight,\n      scaleX: 1,\n      scaleY: 1\n    };\n\n    // Reset scalex/scaleY values; this helps for perfomance and does not break animation\n    $.fancybox.setTranslate(self.$content, reset);\n\n    if (newWidth < self.canvasWidth && newHeight < self.canvasHeight) {\n      self.instance.scaleToFit(150);\n    } else if (newWidth > current.width || newHeight > current.height) {\n      self.instance.scaleToActual(self.centerPointStartX, self.centerPointStartY, 150);\n    } else {\n      newPos = self.limitPosition(newOffsetX, newOffsetY, newWidth, newHeight);\n\n      $.fancybox.animate(self.$content, newPos, 150);\n    }\n  };\n\n  Guestures.prototype.onTap = function (e) {\n    var self = this;\n    var $target = $(e.target);\n\n    var instance = self.instance;\n    var current = instance.current;\n\n    var endPoints = (e && getPointerXY(e)) || self.startPoints;\n\n    var tapX = endPoints[0] ? endPoints[0].x - $(window).scrollLeft() - self.stagePos.left : 0;\n    var tapY = endPoints[0] ? endPoints[0].y - $(window).scrollTop() - self.stagePos.top : 0;\n\n    var where;\n\n    var process = function (prefix) {\n      var action = current.opts[prefix];\n\n      if ($.isFunction(action)) {\n        action = action.apply(instance, [current, e]);\n      }\n\n      if (!action) {\n        return;\n      }\n\n      switch (action) {\n        case \"close\":\n          instance.close(self.startEvent);\n\n          break;\n\n        case \"toggleControls\":\n          instance.toggleControls();\n\n          break;\n\n        case \"next\":\n          instance.next();\n\n          break;\n\n        case \"nextOrClose\":\n          if (instance.group.length > 1) {\n            instance.next();\n          } else {\n            instance.close(self.startEvent);\n          }\n\n          break;\n\n        case \"zoom\":\n          if (current.type == \"image\" && (current.isLoaded || current.$ghost)) {\n            if (instance.canPan()) {\n              instance.scaleToFit();\n            } else if (instance.isScaledDown()) {\n              instance.scaleToActual(tapX, tapY);\n            } else if (instance.group.length < 2) {\n              instance.close(self.startEvent);\n            }\n          }\n\n          break;\n      }\n    };\n\n    // Ignore right click\n    if (e.originalEvent && e.originalEvent.button == 2) {\n      return;\n    }\n\n    // Skip if clicked on the scrollbar\n    if (!$target.is(\"img\") && tapX > $target[0].clientWidth + $target.offset().left) {\n      return;\n    }\n\n    // Check where is clicked\n    if ($target.is(\".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container\")) {\n      where = \"Outside\";\n    } else if ($target.is(\".fancybox-slide\")) {\n      where = \"Slide\";\n    } else if (\n      instance.current.$content &&\n      instance.current.$content\n      .find($target)\n      .addBack()\n      .filter($target).length\n    ) {\n      where = \"Content\";\n    } else {\n      return;\n    }\n\n    // Check if this is a double tap\n    if (self.tapped) {\n      // Stop previously created single tap\n      clearTimeout(self.tapped);\n      self.tapped = null;\n\n      // Skip if distance between taps is too big\n      if (Math.abs(tapX - self.tapX) > 50 || Math.abs(tapY - self.tapY) > 50) {\n        return this;\n      }\n\n      // OK, now we assume that this is a double-tap\n      process(\"dblclick\" + where);\n    } else {\n      // Single tap will be processed if user has not clicked second time within 300ms\n      // or there is no need to wait for double-tap\n      self.tapX = tapX;\n      self.tapY = tapY;\n\n      if (current.opts[\"dblclick\" + where] && current.opts[\"dblclick\" + where] !== current.opts[\"click\" + where]) {\n        self.tapped = setTimeout(function () {\n          self.tapped = null;\n\n          if (!instance.isAnimating) {\n            process(\"click\" + where);\n          }\n        }, 500);\n      } else {\n        process(\"click\" + where);\n      }\n    }\n\n    return this;\n  };\n\n  $(document)\n    .on(\"onActivate.fb\", function (e, instance) {\n      if (instance && !instance.Guestures) {\n        instance.Guestures = new Guestures(instance);\n      }\n    })\n    .on(\"beforeClose.fb\", function (e, instance) {\n      if (instance && instance.Guestures) {\n        instance.Guestures.destroy();\n      }\n    });\n})(window, document, jQuery);"
  },
  {
    "path": "src/js/hash.js",
    "content": "// ==========================================================================\n//\n// Hash\n// Enables linking to each modal\n//\n// ==========================================================================\n(function (window, document, $) {\n  \"use strict\";\n\n  // Simple $.escapeSelector polyfill (for jQuery prior v3)\n  if (!$.escapeSelector) {\n    $.escapeSelector = function (sel) {\n      var rcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\x80-\\uFFFF\\w-]/g;\n      var fcssescape = function (ch, asCodePoint) {\n        if (asCodePoint) {\n          // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n          if (ch === \"\\0\") {\n            return \"\\uFFFD\";\n          }\n\n          // Control characters and (dependent upon position) numbers get escaped as code points\n          return ch.slice(0, -1) + \"\\\\\" + ch.charCodeAt(ch.length - 1).toString(16) + \" \";\n        }\n\n        // Other potentially-special ASCII characters get backslash-escaped\n        return \"\\\\\" + ch;\n      };\n\n      return (sel + \"\").replace(rcssescape, fcssescape);\n    };\n  }\n\n  // Get info about gallery name and current index from url\n  function parseUrl() {\n    var hash = window.location.hash.substr(1),\n      rez = hash.split(\"-\"),\n      index = rez.length > 1 && /^\\+?\\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,\n      gallery = rez.join(\"-\");\n\n    return {\n      hash: hash,\n      /* Index is starting from 1 */\n      index: index < 1 ? 1 : index,\n      gallery: gallery\n    };\n  }\n\n  // Trigger click evnt on links to open new fancyBox instance\n  function triggerFromUrl(url) {\n    if (url.gallery !== \"\") {\n      // If we can find element matching 'data-fancybox' atribute,\n      // then triggering click event should start fancyBox\n      $(\"[data-fancybox='\" + $.escapeSelector(url.gallery) + \"']\")\n        .eq(url.index - 1)\n        .focus()\n        .trigger(\"click.fb-start\");\n    }\n  }\n\n  // Get gallery name from current instance\n  function getGalleryID(instance) {\n    var opts, ret;\n\n    if (!instance) {\n      return false;\n    }\n\n    opts = instance.current ? instance.current.opts : instance.opts;\n    ret = opts.hash || (opts.$orig ? opts.$orig.data(\"fancybox\") || opts.$orig.data(\"fancybox-trigger\") : \"\");\n\n    return ret === \"\" ? false : ret;\n  }\n\n  // Start when DOM becomes ready\n  $(function () {\n    // Check if user has disabled this module\n    if ($.fancybox.defaults.hash === false) {\n      return;\n    }\n\n    // Update hash when opening/closing fancyBox\n    $(document).on({\n      \"onInit.fb\": function (e, instance) {\n        var url, gallery;\n\n        if (instance.group[instance.currIndex].opts.hash === false) {\n          return;\n        }\n\n        url = parseUrl();\n        gallery = getGalleryID(instance);\n\n        // Make sure gallery start index matches index from hash\n        if (gallery && url.gallery && gallery == url.gallery) {\n          instance.currIndex = url.index - 1;\n        }\n      },\n\n      \"beforeShow.fb\": function (e, instance, current, firstRun) {\n        var gallery;\n\n        if (!current || current.opts.hash === false) {\n          return;\n        }\n\n        // Check if need to update window hash\n        gallery = getGalleryID(instance);\n\n        if (!gallery) {\n          return;\n        }\n\n        // Variable containing last hash value set by fancyBox\n        // It will be used to determine if fancyBox needs to close after hash change is detected\n        instance.currentHash = gallery + (instance.group.length > 1 ? \"-\" + (current.index + 1) : \"\");\n\n        // If current hash is the same (this instance most likely is opened by hashchange), then do nothing\n        if (window.location.hash === \"#\" + instance.currentHash) {\n          return;\n        }\n\n        if (firstRun && !instance.origHash) {\n          instance.origHash = window.location.hash;\n        }\n\n        if (instance.hashTimer) {\n          clearTimeout(instance.hashTimer);\n        }\n\n        // Update hash\n        instance.hashTimer = setTimeout(function () {\n          if (\"replaceState\" in window.history) {\n            window.history[firstRun ? \"pushState\" : \"replaceState\"]({},\n              document.title,\n              window.location.pathname + window.location.search + \"#\" + instance.currentHash\n            );\n\n            if (firstRun) {\n              instance.hasCreatedHistory = true;\n            }\n          } else {\n            window.location.hash = instance.currentHash;\n          }\n\n          instance.hashTimer = null;\n        }, 300);\n      },\n\n      \"beforeClose.fb\": function (e, instance, current) {\n        if (!current || current.opts.hash === false) {\n          return;\n        }\n\n        clearTimeout(instance.hashTimer);\n\n        // Goto previous history entry\n        if (instance.currentHash && instance.hasCreatedHistory) {\n          window.history.back();\n        } else if (instance.currentHash) {\n          if (\"replaceState\" in window.history) {\n            window.history.replaceState({}, document.title, window.location.pathname + window.location.search + (instance.origHash || \"\"));\n          } else {\n            window.location.hash = instance.origHash;\n          }\n        }\n\n        instance.currentHash = null;\n      }\n    });\n\n    // Check if need to start/close after url has changed\n    $(window).on(\"hashchange.fb\", function () {\n      var url = parseUrl(),\n        fb = null;\n\n      // Find last fancyBox instance that has \"hash\"\n      $.each(\n        $(\".fancybox-container\")\n        .get()\n        .reverse(),\n        function (index, value) {\n          var tmp = $(value).data(\"FancyBox\");\n\n          if (tmp && tmp.currentHash) {\n            fb = tmp;\n            return false;\n          }\n        }\n      );\n\n      if (fb) {\n        // Now, compare hash values\n        if (fb.currentHash !== url.gallery + \"-\" + url.index && !(url.index === 1 && fb.currentHash == url.gallery)) {\n          fb.currentHash = null;\n\n          fb.close();\n        }\n      } else if (url.gallery !== \"\") {\n        triggerFromUrl(url);\n      }\n    });\n\n    // Check current hash and trigger click event on matching element to start fancyBox, if needed\n    setTimeout(function () {\n      if (!$.fancybox.getInstance()) {\n        triggerFromUrl(parseUrl());\n      }\n    }, 50);\n  });\n})(window, document, jQuery);"
  },
  {
    "path": "src/js/media.js",
    "content": "// ==========================================================================\n//\n// Media\n// Adds additional media type support\n//\n// ==========================================================================\n(function ($) {\n  \"use strict\";\n\n  // Object containing properties for each media type\n  var defaults = {\n    youtube: {\n      matcher: /(youtube\\.com|youtu\\.be|youtube\\-nocookie\\.com)\\/(watch\\?(.*&)?v=|v\\/|u\\/|embed\\/?)?(videoseries\\?list=(.*)|[\\w-]{11}|\\?listType=(.*)&list=(.*))(.*)/i,\n      params: {\n        autoplay: 1,\n        autohide: 1,\n        fs: 1,\n        rel: 0,\n        hd: 1,\n        wmode: \"transparent\",\n        enablejsapi: 1,\n        html5: 1\n      },\n      paramPlace: 8,\n      type: \"iframe\",\n      url: \"https://www.youtube-nocookie.com/embed/$4\",\n      thumb: \"https://img.youtube.com/vi/$4/hqdefault.jpg\"\n    },\n\n    vimeo: {\n      matcher: /^.+vimeo.com\\/(.*\\/)?([\\d]+)(.*)?/,\n      params: {\n        autoplay: 1,\n        hd: 1,\n        show_title: 1,\n        show_byline: 1,\n        show_portrait: 0,\n        fullscreen: 1\n      },\n      paramPlace: 3,\n      type: \"iframe\",\n      url: \"//player.vimeo.com/video/$2\"\n    },\n\n    instagram: {\n      matcher: /(instagr\\.am|instagram\\.com)\\/p\\/([a-zA-Z0-9_\\-]+)\\/?/i,\n      type: \"image\",\n      url: \"//$1/p/$2/media/?size=l\"\n    },\n\n    // Examples:\n    // http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16\n    // https://www.google.com/maps/@37.7852006,-122.4146355,14.65z\n    // https://www.google.com/maps/@52.2111123,2.9237542,6.61z?hl=en\n    // https://www.google.com/maps/place/Googleplex/@37.4220041,-122.0833494,17z/data=!4m5!3m4!1s0x0:0x6c296c66619367e0!8m2!3d37.4219998!4d-122.0840572\n    gmap_place: {\n      matcher: /(maps\\.)?google\\.([a-z]{2,3}(\\.[a-z]{2})?)\\/(((maps\\/(place\\/(.*)\\/)?\\@(.*),(\\d+.?\\d+?)z))|(\\?ll=))(.*)?/i,\n      type: \"iframe\",\n      url: function (rez) {\n        return (\n          \"//maps.google.\" +\n          rez[2] +\n          \"/?ll=\" +\n          (rez[9] ? rez[9] + \"&z=\" + Math.floor(rez[10]) + (rez[12] ? rez[12].replace(/^\\//, \"&\") : \"\") : rez[12] + \"\").replace(/\\?/, \"&\") +\n          \"&output=\" +\n          (rez[12] && rez[12].indexOf(\"layer=c\") > 0 ? \"svembed\" : \"embed\")\n        );\n      }\n    },\n\n    // Examples:\n    // https://www.google.com/maps/search/Empire+State+Building/\n    // https://www.google.com/maps/search/?api=1&query=centurylink+field\n    // https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393\n    gmap_search: {\n      matcher: /(maps\\.)?google\\.([a-z]{2,3}(\\.[a-z]{2})?)\\/(maps\\/search\\/)(.*)/i,\n      type: \"iframe\",\n      url: function (rez) {\n        return \"//maps.google.\" + rez[2] + \"/maps?q=\" + rez[5].replace(\"query=\", \"q=\").replace(\"api=1\", \"\") + \"&output=embed\";\n      }\n    }\n  };\n\n  // Formats matching url to final form\n  var format = function (url, rez, params) {\n    if (!url) {\n      return;\n    }\n\n    params = params || \"\";\n\n    if ($.type(params) === \"object\") {\n      params = $.param(params, true);\n    }\n\n    $.each(rez, function (key, value) {\n      url = url.replace(\"$\" + key, value || \"\");\n    });\n\n    if (params.length) {\n      url += (url.indexOf(\"?\") > 0 ? \"&\" : \"?\") + params;\n    }\n\n    return url;\n  };\n\n  $(document).on(\"objectNeedsType.fb\", function (e, instance, item) {\n    var url = item.src || \"\",\n      type = false,\n      media,\n      thumb,\n      rez,\n      params,\n      urlParams,\n      paramObj,\n      provider;\n\n    media = $.extend(true, {}, defaults, item.opts.media);\n\n    // Look for any matching media type\n    $.each(media, function (providerName, providerOpts) {\n      rez = url.match(providerOpts.matcher);\n\n      if (!rez) {\n        return;\n      }\n\n      type = providerOpts.type;\n      provider = providerName;\n      paramObj = {};\n\n      if (providerOpts.paramPlace && rez[providerOpts.paramPlace]) {\n        urlParams = rez[providerOpts.paramPlace];\n\n        if (urlParams[0] == \"?\") {\n          urlParams = urlParams.substring(1);\n        }\n\n        urlParams = urlParams.split(\"&\");\n\n        for (var m = 0; m < urlParams.length; ++m) {\n          var p = urlParams[m].split(\"=\", 2);\n\n          if (p.length == 2) {\n            paramObj[p[0]] = decodeURIComponent(p[1].replace(/\\+/g, \" \"));\n          }\n        }\n      }\n\n      params = $.extend(true, {}, providerOpts.params, item.opts[providerName], paramObj);\n\n      url =\n        $.type(providerOpts.url) === \"function\" ? providerOpts.url.call(this, rez, params, item) : format(providerOpts.url, rez, params);\n\n      thumb =\n        $.type(providerOpts.thumb) === \"function\" ? providerOpts.thumb.call(this, rez, params, item) : format(providerOpts.thumb, rez);\n\n      if (providerName === \"youtube\") {\n        url = url.replace(/&t=((\\d+)m)?(\\d+)s/, function (match, p1, m, s) {\n          return \"&start=\" + ((m ? parseInt(m, 10) * 60 : 0) + parseInt(s, 10));\n        });\n      } else if (providerName === \"vimeo\") {\n        url = url.replace(\"&%23\", \"#\");\n      }\n\n      return false;\n    });\n\n    // If it is found, then change content type and update the url\n\n    if (type) {\n      if (!item.opts.thumb && !(item.opts.$thumb && item.opts.$thumb.length)) {\n        item.opts.thumb = thumb;\n      }\n\n      if (type === \"iframe\") {\n        item.opts = $.extend(true, item.opts, {\n          iframe: {\n            preload: false,\n            attr: {\n              scrolling: \"no\"\n            }\n          }\n        });\n      }\n\n      $.extend(item, {\n        type: type,\n        src: url,\n        origSrc: item.src,\n        contentSource: provider,\n        contentType: type === \"image\" ? \"image\" : provider == \"gmap_place\" || provider == \"gmap_search\" ? \"map\" : \"video\"\n      });\n    } else if (url) {\n      item.type = item.opts.defaultType;\n    }\n  });\n\n  // Load YouTube/Video API on request to detect when video finished playing\n  var VideoAPILoader = {\n    youtube: {\n      src: \"https://www.youtube.com/iframe_api\",\n      class: \"YT\",\n      loading: false,\n      loaded: false\n    },\n\n    vimeo: {\n      src: \"https://player.vimeo.com/api/player.js\",\n      class: \"Vimeo\",\n      loading: false,\n      loaded: false\n    },\n\n    load: function (vendor) {\n      var _this = this,\n        script;\n\n      if (this[vendor].loaded) {\n        setTimeout(function () {\n          _this.done(vendor);\n        });\n        return;\n      }\n\n      if (this[vendor].loading) {\n        return;\n      }\n\n      this[vendor].loading = true;\n\n      script = document.createElement(\"script\");\n      script.type = \"text/javascript\";\n      script.src = this[vendor].src;\n\n      if (vendor === \"youtube\") {\n        window.onYouTubeIframeAPIReady = function () {\n          _this[vendor].loaded = true;\n          _this.done(vendor);\n        };\n      } else {\n        script.onload = function () {\n          _this[vendor].loaded = true;\n          _this.done(vendor);\n        };\n      }\n\n      document.body.appendChild(script);\n    },\n    done: function (vendor) {\n      var instance, $el, player;\n\n      if (vendor === \"youtube\") {\n        delete window.onYouTubeIframeAPIReady;\n      }\n\n      instance = $.fancybox.getInstance();\n\n      if (instance) {\n        $el = instance.current.$content.find(\"iframe\");\n\n        if (vendor === \"youtube\" && YT !== undefined && YT) {\n          player = new YT.Player($el.attr(\"id\"), {\n            events: {\n              onStateChange: function (e) {\n                if (e.data == 0) {\n                  instance.next();\n                }\n              }\n            }\n          });\n        } else if (vendor === \"vimeo\" && Vimeo !== undefined && Vimeo) {\n          player = new Vimeo.Player($el);\n\n          player.on(\"ended\", function () {\n            instance.next();\n          });\n        }\n      }\n    }\n  };\n\n  $(document).on({\n    \"afterShow.fb\": function (e, instance, current) {\n      if (instance.group.length > 1 && (current.contentSource === \"youtube\" || current.contentSource === \"vimeo\")) {\n        VideoAPILoader.load(current.contentSource);\n      }\n    }\n  });\n})(jQuery);"
  },
  {
    "path": "src/js/share.js",
    "content": "//// ==========================================================================\n//\n// Share\n// Displays simple form for sharing current url\n//\n// ==========================================================================\n(function (document, $) {\n  \"use strict\";\n\n  $.extend(true, $.fancybox.defaults, {\n    btnTpl: {\n      share: '<button data-fancybox-share class=\"fancybox-button fancybox-button--share\" title=\"{{SHARE}}\">' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z\"/></svg>' +\n        \"</button>\"\n    },\n    share: {\n      url: function (instance, item) {\n        return (\n          (!instance.currentHash && !(item.type === \"inline\" || item.type === \"html\") ? item.origSrc || item.src : false) || window.location\n        );\n      },\n      tpl: '<div class=\"fancybox-share\">' +\n        \"<h1>{{SHARE}}</h1>\" +\n        \"<p>\" +\n        '<a class=\"fancybox-share__button fancybox-share__button--fb\" href=\"https://www.facebook.com/sharer/sharer.php?u={{url}}\">' +\n        '<svg viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196\" /></svg>' +\n        \"<span>Facebook</span>\" +\n        \"</a>\" +\n        '<a class=\"fancybox-share__button fancybox-share__button--tw\" href=\"https://twitter.com/intent/tweet?url={{url}}&text={{descr}}\">' +\n        '<svg viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z\" /></svg>' +\n        \"<span>Twitter</span>\" +\n        \"</a>\" +\n        '<a class=\"fancybox-share__button fancybox-share__button--pt\" href=\"https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}\">' +\n        '<svg viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z\" fill=\"#fff\"/></svg>' +\n        \"<span>Pinterest</span>\" +\n        \"</a>\" +\n        \"</p>\" +\n        '<p><input class=\"fancybox-share__input\" type=\"text\" value=\"{{url_raw}}\" onclick=\"select()\" /></p>' +\n        \"</div>\"\n    }\n  });\n\n  function escapeHtml(string) {\n    var entityMap = {\n      \"&\": \"&amp;\",\n      \"<\": \"&lt;\",\n      \">\": \"&gt;\",\n      '\"': \"&quot;\",\n      \"'\": \"&#39;\",\n      \"/\": \"&#x2F;\",\n      \"`\": \"&#x60;\",\n      \"=\": \"&#x3D;\"\n    };\n\n    return String(string).replace(/[&<>\"'`=\\/]/g, function (s) {\n      return entityMap[s];\n    });\n  }\n\n  $(document).on(\"click\", \"[data-fancybox-share]\", function () {\n    var instance = $.fancybox.getInstance(),\n      current = instance.current || null,\n      url,\n      tpl;\n\n    if (!current) {\n      return;\n    }\n\n    if ($.type(current.opts.share.url) === \"function\") {\n      url = current.opts.share.url.apply(current, [instance, current]);\n    }\n\n    tpl = current.opts.share.tpl\n      .replace(/\\{\\{media\\}\\}/g, current.type === \"image\" ? encodeURIComponent(current.src) : \"\")\n      .replace(/\\{\\{url\\}\\}/g, encodeURIComponent(url))\n      .replace(/\\{\\{url_raw\\}\\}/g, escapeHtml(url))\n      .replace(/\\{\\{descr\\}\\}/g, instance.$caption ? encodeURIComponent(instance.$caption.text()) : \"\");\n\n    $.fancybox.open({\n      src: instance.translate(instance, tpl),\n      type: \"html\",\n      opts: {\n        touch: false,\n        animationEffect: false,\n        afterLoad: function (shareInstance, shareCurrent) {\n          // Close self if parent instance is closing\n          instance.$refs.container.one(\"beforeClose.fb\", function () {\n            shareInstance.close(null, 0);\n          });\n\n          // Opening links in a popup window\n          shareCurrent.$content.find(\".fancybox-share__button\").click(function () {\n            window.open(this.href, \"Share\", \"width=550, height=450\");\n            return false;\n          });\n        },\n        mobile: {\n          autoFocus: false\n        }\n      }\n    });\n  });\n})(document, jQuery);"
  },
  {
    "path": "src/js/slideshow.js",
    "content": "// ==========================================================================\n//\n// SlideShow\n// Enables slideshow functionality\n//\n// Example of usage:\n// $.fancybox.getInstance().SlideShow.start()\n//\n// ==========================================================================\n(function (document, $) {\n  \"use strict\";\n\n  $.extend(true, $.fancybox.defaults, {\n    btnTpl: {\n      slideShow: '<button data-fancybox-play class=\"fancybox-button fancybox-button--play\" title=\"{{PLAY_START}}\">' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M6.5 5.4v13.2l11-6.6z\"/></svg>' +\n        '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z\"/></svg>' +\n        \"</button>\"\n    },\n    slideShow: {\n      autoStart: false,\n      speed: 3000,\n      progress: true\n    }\n  });\n\n  var SlideShow = function (instance) {\n    this.instance = instance;\n    this.init();\n  };\n\n  $.extend(SlideShow.prototype, {\n    timer: null,\n    isActive: false,\n    $button: null,\n\n    init: function () {\n      var self = this,\n        instance = self.instance,\n        opts = instance.group[instance.currIndex].opts.slideShow;\n\n      self.$button = instance.$refs.toolbar.find(\"[data-fancybox-play]\").on(\"click\", function () {\n        self.toggle();\n      });\n\n      if (instance.group.length < 2 || !opts) {\n        self.$button.hide();\n      } else if (opts.progress) {\n        self.$progress = $('<div class=\"fancybox-progress\"></div>').appendTo(instance.$refs.inner);\n      }\n    },\n\n    set: function (force) {\n      var self = this,\n        instance = self.instance,\n        current = instance.current;\n\n      // Check if reached last element\n      if (current && (force === true || current.opts.loop || instance.currIndex < instance.group.length - 1)) {\n        if (self.isActive && current.contentType !== \"video\") {\n          if (self.$progress) {\n            $.fancybox.animate(self.$progress.show(), {\n              scaleX: 1\n            }, current.opts.slideShow.speed);\n          }\n\n          self.timer = setTimeout(function () {\n            if (!instance.current.opts.loop && instance.current.index == instance.group.length - 1) {\n              instance.jumpTo(0);\n            } else {\n              instance.next();\n            }\n          }, current.opts.slideShow.speed);\n        }\n      } else {\n        self.stop();\n        instance.idleSecondsCounter = 0;\n        instance.showControls();\n      }\n    },\n\n    clear: function () {\n      var self = this;\n\n      clearTimeout(self.timer);\n\n      self.timer = null;\n\n      if (self.$progress) {\n        self.$progress.removeAttr(\"style\").hide();\n      }\n    },\n\n    start: function () {\n      var self = this,\n        current = self.instance.current;\n\n      if (current) {\n        self.$button\n          .attr(\"title\", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_STOP)\n          .removeClass(\"fancybox-button--play\")\n          .addClass(\"fancybox-button--pause\");\n\n        self.isActive = true;\n\n        if (current.isComplete) {\n          self.set(true);\n        }\n\n        self.instance.trigger(\"onSlideShowChange\", true);\n      }\n    },\n\n    stop: function () {\n      var self = this,\n        current = self.instance.current;\n\n      self.clear();\n\n      self.$button\n        .attr(\"title\", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_START)\n        .removeClass(\"fancybox-button--pause\")\n        .addClass(\"fancybox-button--play\");\n\n      self.isActive = false;\n\n      self.instance.trigger(\"onSlideShowChange\", false);\n\n      if (self.$progress) {\n        self.$progress.removeAttr(\"style\").hide();\n      }\n    },\n\n    toggle: function () {\n      var self = this;\n\n      if (self.isActive) {\n        self.stop();\n      } else {\n        self.start();\n      }\n    }\n  });\n\n  $(document).on({\n    \"onInit.fb\": function (e, instance) {\n      if (instance && !instance.SlideShow) {\n        instance.SlideShow = new SlideShow(instance);\n      }\n    },\n\n    \"beforeShow.fb\": function (e, instance, current, firstRun) {\n      var SlideShow = instance && instance.SlideShow;\n\n      if (firstRun) {\n        if (SlideShow && current.opts.slideShow.autoStart) {\n          SlideShow.start();\n        }\n      } else if (SlideShow && SlideShow.isActive) {\n        SlideShow.clear();\n      }\n    },\n\n    \"afterShow.fb\": function (e, instance, current) {\n      var SlideShow = instance && instance.SlideShow;\n\n      if (SlideShow && SlideShow.isActive) {\n        SlideShow.set();\n      }\n    },\n\n    \"afterKeydown.fb\": function (e, instance, current, keypress, keycode) {\n      var SlideShow = instance && instance.SlideShow;\n\n      // \"P\" or Spacebar\n      if (SlideShow && current.opts.slideShow && (keycode === 80 || keycode === 32) && !$(document.activeElement).is(\"button,a,input\")) {\n        keypress.preventDefault();\n\n        SlideShow.toggle();\n      }\n    },\n\n    \"beforeClose.fb onDeactivate.fb\": function (e, instance) {\n      var SlideShow = instance && instance.SlideShow;\n\n      if (SlideShow) {\n        SlideShow.stop();\n      }\n    }\n  });\n\n  // Page Visibility API to pause slideshow when window is not active\n  $(document).on(\"visibilitychange\", function () {\n    var instance = $.fancybox.getInstance(),\n      SlideShow = instance && instance.SlideShow;\n\n    if (SlideShow && SlideShow.isActive) {\n      if (document.hidden) {\n        SlideShow.clear();\n      } else {\n        SlideShow.set();\n      }\n    }\n  });\n})(document, jQuery);"
  },
  {
    "path": "src/js/thumbs.js",
    "content": "// ==========================================================================\n//\n// Thumbs\n// Displays thumbnails in a grid\n//\n// ==========================================================================\n(function (document, $) {\n  \"use strict\";\n\n  var CLASS = \"fancybox-thumbs\",\n    CLASS_ACTIVE = CLASS + \"-active\";\n\n  // Make sure there are default values\n  $.fancybox.defaults = $.extend(\n    true, {\n      btnTpl: {\n        thumbs: '<button data-fancybox-thumbs class=\"fancybox-button fancybox-button--thumbs\" title=\"{{THUMBS}}\">' +\n          '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z\"/></svg>' +\n          \"</button>\"\n      },\n      thumbs: {\n        autoStart: false, // Display thumbnails on opening\n        hideOnClose: true, // Hide thumbnail grid when closing animation starts\n        parentEl: \".fancybox-container\", // Container is injected into this element\n        axis: \"y\" // Vertical (y) or horizontal (x) scrolling\n      }\n    },\n    $.fancybox.defaults\n  );\n\n  var FancyThumbs = function (instance) {\n    this.init(instance);\n  };\n\n  $.extend(FancyThumbs.prototype, {\n    $button: null,\n    $grid: null,\n    $list: null,\n    isVisible: false,\n    isActive: false,\n\n    init: function (instance) {\n      var self = this,\n        group = instance.group,\n        enabled = 0;\n\n      self.instance = instance;\n      self.opts = group[instance.currIndex].opts.thumbs;\n\n      instance.Thumbs = self;\n\n      self.$button = instance.$refs.toolbar.find(\"[data-fancybox-thumbs]\");\n\n      // Enable thumbs if at least two group items have thumbnails\n      for (var i = 0, len = group.length; i < len; i++) {\n        if (group[i].thumb) {\n          enabled++;\n        }\n\n        if (enabled > 1) {\n          break;\n        }\n      }\n\n      if (enabled > 1 && !!self.opts) {\n        self.$button.removeAttr(\"style\").on(\"click\", function () {\n          self.toggle();\n        });\n\n        self.isActive = true;\n      } else {\n        self.$button.hide();\n      }\n    },\n\n    create: function () {\n      var self = this,\n        instance = self.instance,\n        parentEl = self.opts.parentEl,\n        list = [],\n        src;\n\n      if (!self.$grid) {\n        // Create main element\n        self.$grid = $('<div class=\"' + CLASS + \" \" + CLASS + \"-\" + self.opts.axis + '\"></div>').appendTo(\n          instance.$refs.container\n          .find(parentEl)\n          .addBack()\n          .filter(parentEl)\n        );\n\n        // Add \"click\" event that performs gallery navigation\n        self.$grid.on(\"click\", \"a\", function () {\n          instance.jumpTo($(this).attr(\"data-index\"));\n        });\n      }\n\n      // Build the list\n      if (!self.$list) {\n        self.$list = $('<div class=\"' + CLASS + '__list\">').appendTo(self.$grid);\n      }\n\n      $.each(instance.group, function (i, item) {\n        src = item.thumb;\n\n        if (!src && item.type === \"image\") {\n          src = item.src;\n        }\n\n        list.push(\n          '<a href=\"javascript:;\" tabindex=\"0\" data-index=\"' +\n          i +\n          '\"' +\n          (src && src.length ? ' style=\"background-image:url(' + src + ')\"' : 'class=\"fancybox-thumbs-missing\"') +\n          \"></a>\"\n        );\n      });\n\n      self.$list[0].innerHTML = list.join(\"\");\n\n      if (self.opts.axis === \"x\") {\n        // Set fixed width for list element to enable horizontal scrolling\n        self.$list.width(\n          parseInt(self.$grid.css(\"padding-right\"), 10) +\n          instance.group.length *\n          self.$list\n          .children()\n          .eq(0)\n          .outerWidth(true)\n        );\n      }\n    },\n\n    focus: function (duration) {\n      var self = this,\n        $list = self.$list,\n        $grid = self.$grid,\n        thumb,\n        thumbPos;\n\n      if (!self.instance.current) {\n        return;\n      }\n\n      thumb = $list\n        .children()\n        .removeClass(CLASS_ACTIVE)\n        .filter('[data-index=\"' + self.instance.current.index + '\"]')\n        .addClass(CLASS_ACTIVE);\n\n      thumbPos = thumb.position();\n\n      // Check if need to scroll to make current thumb visible\n      if (self.opts.axis === \"y\" && (thumbPos.top < 0 || thumbPos.top > $list.height() - thumb.outerHeight())) {\n        $list.stop().animate({\n            scrollTop: $list.scrollTop() + thumbPos.top\n          },\n          duration\n        );\n      } else if (\n        self.opts.axis === \"x\" &&\n        (thumbPos.left < $grid.scrollLeft() || thumbPos.left > $grid.scrollLeft() + ($grid.width() - thumb.outerWidth()))\n      ) {\n        $list\n          .parent()\n          .stop()\n          .animate({\n              scrollLeft: thumbPos.left\n            },\n            duration\n          );\n      }\n    },\n\n    update: function () {\n      var that = this;\n      that.instance.$refs.container.toggleClass(\"fancybox-show-thumbs\", this.isVisible);\n\n      if (that.isVisible) {\n        if (!that.$grid) {\n          that.create();\n        }\n\n        that.instance.trigger(\"onThumbsShow\");\n\n        that.focus(0);\n      } else if (that.$grid) {\n        that.instance.trigger(\"onThumbsHide\");\n      }\n\n      // Update content position\n      that.instance.update();\n    },\n\n    hide: function () {\n      this.isVisible = false;\n      this.update();\n    },\n\n    show: function () {\n      this.isVisible = true;\n      this.update();\n    },\n\n    toggle: function () {\n      this.isVisible = !this.isVisible;\n      this.update();\n    }\n  });\n\n  $(document).on({\n    \"onInit.fb\": function (e, instance) {\n      var Thumbs;\n\n      if (instance && !instance.Thumbs) {\n        Thumbs = new FancyThumbs(instance);\n\n        if (Thumbs.isActive && Thumbs.opts.autoStart === true) {\n          Thumbs.show();\n        }\n      }\n    },\n\n    \"beforeShow.fb\": function (e, instance, item, firstRun) {\n      var Thumbs = instance && instance.Thumbs;\n\n      if (Thumbs && Thumbs.isVisible) {\n        Thumbs.focus(firstRun ? 0 : 250);\n      }\n    },\n\n    \"afterKeydown.fb\": function (e, instance, current, keypress, keycode) {\n      var Thumbs = instance && instance.Thumbs;\n\n      // \"G\"\n      if (Thumbs && Thumbs.isActive && keycode === 71) {\n        keypress.preventDefault();\n\n        Thumbs.toggle();\n      }\n    },\n\n    \"beforeClose.fb\": function (e, instance) {\n      var Thumbs = instance && instance.Thumbs;\n\n      if (Thumbs && Thumbs.isVisible && Thumbs.opts.hideOnClose !== false) {\n        Thumbs.$grid.hide();\n      }\n    }\n  });\n})(document, jQuery);"
  },
  {
    "path": "src/js/wheel.js",
    "content": "// ==========================================================================\n//\n// Wheel\n// Basic mouse weheel support for gallery navigation\n//\n// ==========================================================================\n(function (document, $) {\n  \"use strict\";\n\n  var prevTime = new Date().getTime();\n\n  $(document).on({\n    \"onInit.fb\": function (e, instance, current) {\n      instance.$refs.stage.on(\"mousewheel DOMMouseScroll wheel MozMousePixelScroll\", function (e) {\n        var current = instance.current,\n          currTime = new Date().getTime();\n\n        if (instance.group.length < 2 || current.opts.wheel === false || (current.opts.wheel === \"auto\" && current.type !== \"image\")) {\n          return;\n        }\n\n        e.preventDefault();\n        e.stopPropagation();\n\n        if (current.$slide.hasClass(\"fancybox-animated\")) {\n          return;\n        }\n\n        e = e.originalEvent || e;\n\n        if (currTime - prevTime < 250) {\n          return;\n        }\n\n        prevTime = currTime;\n\n        instance[(-e.deltaY || -e.deltaX || e.wheelDelta || -e.detail) < 0 ? \"next\" : \"previous\"]();\n      });\n    }\n  });\n})(document, jQuery);"
  }
]