/* Minification failed. Returning unminified contents.
(35495,29-39): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: namesCount
 */
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
'use strict';

var _lazyload = require('../../foundation/scripts/vendor/lazyload8');

var _lazyload2 = _interopRequireDefault(_lazyload);

var _matchHeight = require('../../foundation/scripts/match-height');

var _matchHeight2 = _interopRequireDefault(_matchHeight);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

+function ($) {
    'use strict';

    $(document).ready(function () {

        // This basically rewrites most of the markup of the page, because I didn't check a wireframe properly.
        var $filters = $('[data-js="agritech-filter"]');

        // Do we have AgriTech tags on this page?
        if ($filters.length) {
            var ctaColumn, agriBlogRow, tabsMarkup, filtersMarkup, twitterMarkup;

            // The containing column for the news call-to-actions
            ctaColumn = $('[data-js="agritech-cta"]')[0].closest('[class*="col-"]');
            // The row which I hope holds most of the content of the page
            agriBlogRow = ctaColumn.closest('[class*="row"]');

            // The markup for the mobile version of the filter
            // Hard-coded SVG alert
            filtersMarkup = '<div class="u-bg-primary u-fireplace-padd-sm u-v-gutter-bottom"> <p class="u-v-gutter-bottom-sm"> <a href="#article-filters" class="u-media u-text-dec-0" data-js="toggle" data-spin="45"> <span class="u-bd u-text-center metapro-bold u-caps">Filter Articles</span> <span class="u-img-r"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="icon ic-web" width="20" height="20"> <path class="ic-img" d="M3.62 45.37h92.73v11.12H3.62z"/><path class="ic-img" d="M55.55 4.56v92.73H44.43V4.56z"/></svg></span></a></p> <p id="article-filters" class="js-hide u-flush">' + $filters.find('p').html() + '</p></div>';

            // Everything which Twitter adds to the page, I guess
            // Has Twitter done its dirty business yet? (not sure this ever happens)
            if ($('#twitter-widget-0').length) {
                twitterMarkup = $('#twitter-widget-0')[0].outerHTML;
            }
            // Take the Twitter link into the tabs
            else if ($('.twitter-timeline')) {
                    twitterMarkup = $('.twitter-timeline')[0].outerHTML;
                }

            // Create new tabs markup
            tabsMarkup = '<section class="visible-xs" data-js="mobile"><h2 id="tab-legend" class="u-sr-only">News feed or Twitter</h2> <input type="radio" name="tabs" id="tab1" class="u-sr-only" aria-controls="pane1" checked> <input type="radio" name="tabs" id="tab2" class="u-sr-only" aria-controls="pane2"> <p aria-labelledby="tab-legend" class="tabs-group"> <label for="tab1" id="click-tab1" class="btn btn-secondary">News feed</label> <label for="tab2" id="click-tab2" class="btn btn-secondary">Twitter</label> </p> <section role="tabpanel" aria-labelledby="click-tab1" id="pane1" tabindex="0" class="u-all-padd u-brd-grey"> <h3 class="u-sr-only">News feed</h3>' + filtersMarkup + '<div data-js="more-articles-mobile">' + $(ctaColumn).html() + '</div></section> <section role="tabpanel" aria-labelledby="click-tab2" id="pane2" tabindex="0" class="u-all-padd u-brd-grey"> <h3 class="u-sr-only">Twitter</h3><div id="twitter-mobile-list"></div></section></section>';

            // Dump the new markup after the last row (and hide it from mobile)
            $(agriBlogRow).addClass('hidden-xs').attr('data-js', 'desktop').after(tabsMarkup);

            // We need the Twitter embed to be brought to life, when the user clicks on the Twitter tab
            $(document).on('click', '#click-tab2', function () {
                var $desktopTwit = $('#twitter-widget-0');

                // Does the desktop iframe already exist?
                // Does the mobile iframe *not* currently exist?
                if ($desktopTwit.length && !$('#twitter-mobile-list *').length) {
                    // The data-widget-id attribute contains all of the data we need to initialise the Twitter widget.
                    var widgetID = $desktopTwit.attr('data-widget-id').split(':');
                    twttr.widgets.createTimeline({
                        sourceType: widgetID[0],
                        ownerScreenName: widgetID[1],
                        slug: widgetID[2]
                    }, document.getElementById('twitter-mobile-list')
                    // NR-285: Twitter iframes have a strange property where they are wider than they need to be, in some browsers.
                    // Everything here runs after the timeline has been created.
                    ).then(function () {
                        growthSpurt('#twitter-mobile-list');
                    });
                } // end if
            });

            // Kick off lazy loading a second time.
            // Perhaps this is required because the mobile adds new elements to the DOM?
            // https://www.andreaverlicchi.eu/lazyload/
            var myLazyLoad = new _lazyload2.default({
                elements_selector: ".lazy"
            });
            myLazyLoad.update();
        } // end if
    });

    $(window).resize(function () {
        growthSpurt('#twitter-mobile-list');
    });

    // NR-285: This function ensures that the Twitter iframe is correctly sized.
    // Named because the child has outgrown the parent.
    function growthSpurt(parent) {
        var $container = $(parent),
            $iframe = $container.find('iframe');
        // Do both these elements exist, and has the child outgrown the parent?
        // I use !==, rather than > because the page might resize up (for example,
        // the orientation of the mobile device might flip) and the child needs to
        // increase in size.
        if ($container.length && $iframe.length && $iframe.width() !== $container.width()) {
            $iframe.css('width', $container.width());
        }
    }
}(jQuery);

},{"../../foundation/scripts/match-height":42,"../../foundation/scripts/vendor/lazyload8":56}],2:[function(require,module,exports){
'use strict';

var _branchTeam = require('./branch-team');

var _branchTeam2 = _interopRequireDefault(_branchTeam);

var _saveBranchBtn = require('./save-branch-btn');

var _saveBranchBtn2 = _interopRequireDefault(_saveBranchBtn);

var _branchPage = require('./branch-page');

var _branchPage2 = _interopRequireDefault(_branchPage);

var _branchMap = require('./branch-map');

var _branchMap2 = _interopRequireDefault(_branchMap);

var _branchFind = require('./branch-find');

var _branchFind2 = _interopRequireDefault(_branchFind);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var isMobile = false; //initiate as false
// device detection
if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0, 4))) isMobile = true;

// Logic
$(document).ready(function () {

    // GENERIC
    if (typeof episerverForms === 'function') {
        episerverForms();
    }
    (0, _saveBranchBtn2.default)();

    if ($('.product-raq').length) {
        productPage();
    }

    // FIND BRANCH PAGE
    var branchFindMap = $('#branch-find-map');
    if (branchFindMap.length) {
        (0, _branchFind2.default)(branchFindMap);
    }

    // BRANCH PAGE
    if ($('#branch-masthead-map').length) {
        (0, _branchMap2.default)();
    }
    (0, _branchTeam2.default)();
    (0, _branchPage2.default)();

    // SEARCH BRANCH
    // This doesn't seem to be used - branchSearch() isn't in scope, at this point.
    if ($('[data-js="branch-search"]').length) {
        branchSearch();
    }

    // PROFILES
    // Probably not called any more. That class has gone.
    if ($('.main').find('.profile').length) {
        truncateProfileDesc('.profile');
    }
});

// VIEWPORT BREAKPOINS
// This doesn't seem to be used within this file.
var breakpoints = { xs: 425, sm: 767, md: 992, lg: 1200

    // CURENT VIEWPORT WIDTH
};var currentViewport = $(window).width();
$(window).resize(function () {
    currentViewport = $(window).width();
});

// Random functions which are used here and elsewhere
// (I didn't architect this)

// DETECT TOUCH
function detectTouch() {
    function is_touch_device() {
        return 'ontouchstart' in window || navigator.maxTouchPoints;
    };
    if (is_touch_device()) {
        $('.content').addClass('touch');
    } else {
        $('.content').addClass('no-touch');
    }
}

},{"./branch-find":4,"./branch-map":5,"./branch-page":6,"./branch-team":7,"./save-branch-btn":8}],3:[function(require,module,exports){
"use strict";

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = debounce;
function debounce(func, wait, immediate) {
    var timeout;
    return function () {
        var context = this,
            args = arguments;
        var later = function later() {
            timeout = null;
            if (!immediate) func.apply(context, args);
        };
        var callNow = immediate && !timeout;
        clearTimeout(timeout);
        timeout = setTimeout(later, wait);
        if (callNow) func.apply(context, args);
    };
};

},{}],4:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = branchFind;

var _branchDebounce = require('./branch-debounce');

var _branchDebounce2 = _interopRequireDefault(_branchDebounce);

var _getParameter = require('../url-parameters/get-parameter');

var _getParameter2 = _interopRequireDefault(_getParameter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function branchFind($branchFindMap) {

    //CHECK FOR ADDRESS IN URL
    var address = (0, _getParameter2.default)('address');
    if (address) {
        $('#branch-address').val(address);
        getLocations('/Postcode/RadiusFind');
    }

    var map,
        markers = [],
        infos = [],
        mapPinPath = '/Static/images/map-pins/',
        mapFirstPosition = { lat: 55.0942198, lng: -4.4267206 },
        bounds = new google.maps.LatLngBounds(),
        zoomRange = 7,
        // The range at which "Search area in map >" becomes a viable option for the user
    mapOptions = {
        center: mapFirstPosition,
        disableDefaultUI: true,
        //gestureHandling: 'greedy', // NR-213
        maxZoom: 18,
        minZoom: 5,
        scrollwheel: false,
        styles: [{
            featureType: 'landscape.man_made',
            stylers: [{ visibility: 'off' }]
        }, {
            featureType: 'poi',
            stylers: [{ visibility: 'off' }]
        }, {
            featureType: 'road.highway',
            elementType: 'geometry.fill',
            stylers: [{ hue: '#74A1B3' }, { saturation: -100 }, { lightness: 20 }]
        }, {
            featureType: 'road.highway',
            elementType: 'geometry.stroke',
            stylers: [{ hue: '#74A1B3' }, { saturation: -100 }, { lightness: 100 }, { gamma: 1 }]
        }, {
            featureType: 'road.highway',
            elementType: 'labels.text',
            stylers: [{ hue: '#74A1B3' }, { saturation: -100 }, { lightness: 20 }, { gamma: 1 }]
        }, {
            featureType: 'transit',
            stylers: [{ visibility: 'off' }]
        }, {
            featureType: 'water',
            elementType: 'geometry.fill',
            stylers: [{ hue: '#74A1B3' }, { gamma: 0.4 }, { saturation: -70 }]
        }, {
            featureType: 'water',
            elementType: 'labels',
            stylers: [{ visibility: 'off' }]
        }],
        zoom: 6,
        zoomControl: true,
        zoomControlOptions: {
            position: google.maps.ControlPosition.RIGHT_BOTTOM
        }
    }; // End map options

    // INIT FIRST MAP
    map = new google.maps.Map($branchFindMap[0], mapOptions);
    google.maps.event.addListener(map, 'tilesloaded', function () {
        if ($('.infomsg').length) {
            $('.infomsg').parent().css({ 'z-index': '0' });
        }
        // Get ye behind me, Satan!
        // So both the "idle" and the "tileloaded" events in Google Maps reliably occur
        // *before* the zoom controls exist on the page. This horrible hack is my
        // "solution", with apologies to those on slow network connections.
        setTimeout(positionZoom, 1000);
    });

    // Changes the appearance of the "search area in map >" link
    map.addListener('zoom_changed', function () {
        var $searchAreaBtns = $('[data-js="search-area"]');
        if (map.zoom > zoomRange) {
            $searchAreaBtns.each(function () {
                $(this).removeClass('btn-disabled');
            });
        } else {
            $searchAreaBtns.each(function () {
                $(this).addClass('btn-disabled');
            });
        }
    });

    var mapTabs = document.querySelectorAll('[name="tabs"]'),
        $mapContainer = $('[id~="branch-search-map-container"]');

    for (var i = 0; i < mapTabs.length; i++) {
        // When the user switches to the map tab after a search, resize the map to fit it inside the viewport.
        mapTabs[i].addEventListener('input', function () {
            // Do we have results? Is the map showing yet?
            if (markers.length > 0 && $mapContainer.is(':visible')) {
                var bounds = new google.maps.LatLngBounds();
                for (var i = 0; i < markers.length; i++) {
                    bounds.extend(markers[i].position);
                }
                map.fitBounds(bounds);
            }
        });
    }

    // RESIZE
    var setFirstMap = (0, _branchDebounce2.default)(function () {
        //map.setCenter(mapFirstPosition); 
        map.panTo(mapFirstPosition);
    }, 200);
    $(window).resize(setFirstMap);

    // Big yellow [SEARCH] button
    $('[data-js="location-submit"]').click(function (e) {
        e.preventDefault();
        getLocations('/Postcode/RadiusFind', '');
    });
    // Same, but if the user hits enter.
    $('#branch-find-form').submit(function (e) {
        e.preventDefault();
        getLocations('/Postcode/RadiusFind', '');
    });

    // GET LOCATIONS
    function getLocations(targetURL) {
        var data = {
            productTag: "All Products",
            address: $('#branch-address').val()
        };

        // uncomment the regex lines if you want to switch back to only allowing postcodes
        //var reg =
        //    new RegExp("^(([gG][iI][rR] {0,}0[aA]{2})|((([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y]?[0-9][0-9]?)|(([a-pr-uwyzA-PR-UWYZ][0-9][a-hjkstuwA-HJKSTUW])|([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y][0-9][abehmnprv-yABEHMNPRV-Y])))( {0,}[0-9][abd-hjlnp-uw-zABD-HJLNP-UW-Z]{2})?))$");
        ////if (data.address.length < 2 || !reg.test(data.address)) {
        //    setSearchFeedback('<span>To look for a specific agency by name, please use the main site search.</span>');
        //}


        // Probably need some logic in here, along the lines of "if the user hits 'search area in map >' or submit (same thing?), and the search field is empty, then search on the current location, as long as the zoom level is greater then 9, or whatever it's suppose to be.

        if (data.address.length < 2) {
            setSearchFeedback('Please enter your postcode, branch name or address.');
        } else {
            $.ajax({
                url: targetURL,
                method: "POST",
                async: true,
                data: data,
                success: function success(data) {
                    setSearchFeedback('');
                    setMapMarkers(data);
                    resultsInit(data);
                    callOptimize();
                    rTapNotifyDOMChange(document.body); //nr-251 update responsetap after ajax call
                },
                error: function error(jqXHR, textStatus, errorThrown) {
                    setSearchFeedback('Service currently unavailable. Please try again later.');
                    gtmPush(false);
                }
            });
        }
    }

    // Converts latitude and longditude into postcodes
    function reverseLookup(targetURL, lng, lat) {
        var data = {
            productTag: "All Products",
            lng: lng,
            lat: lat
        };

        $.ajax({
            url: targetURL,
            method: "POST",
            async: true,
            data: data,
            success: function success(data) {
                setSearchFeedback('');
                setMapMarkers(data);
                resultsInit(data);
            },
            error: function error(jqXHR, textStatus, errorThrown) {
                setSearchFeedback('Service currently unavailable. Please try again later.');
                gtmPush(false);
            }
        });
    }

    // GOOGLE MAP INIT
    function setMapMarkers(data) {
        clearMapMarkers();
        if (data.branches.length === 0) {
            data.currentLocation = mapFirstPosition;

            setSearchFeedback('No results were found.');
            gtmPush(false);
            map.panTo(mapFirstPosition);
            map.setZoom(7);

            return;
        }

        var currentLocation = new google.maps.LatLng(data.currentLocation.lat, data.currentLocation.lng);
        var bounds = new google.maps.LatLngBounds();
        google.maps.event.clearListeners('#branch-search-map', 'resize');

        for (var i = 0; i < data.branches.length; i++) {
            var icon = mapPinPath + (i + 1) + '.png';
            if (i === 0) {
                icon = mapPinPath + (i + 1) + '-hover.png';
            }
            var marker = new google.maps.Marker({
                position: new google.maps.LatLng(data.branches[i].lat, data.branches[i].lng),
                map: map,
                icon: icon,
                branchId: data.branches[i].id,
                pinNo: i + 1
            });
            markers.push(marker);

            // User clicks on one of the custom pins.
            google.maps.event.addDomListener(marker, 'click', function (e) {
                var number = $(this)[0].pinNo;
                highlightMapPin(number);
                highlightResult(number);
                scrollToResult(number);
            });

            bounds.extend(marker.position);

            // Marker pop-up content
            var contentString = '<div class="branch-marker-popup"><h2 class="h3">' + (i + 1) + '. ' + data.branches[i].name + '</h2> <p class="archer-book-ss">' + data.branches[i].openinghours + '</p><hr class="u-v-gutter-half">' + '<p class="archer-book-ss"><span class="rTapNumber' + data.branches[i].ResponseTapCode + '">' + data.branches[i].telephone + ' </span><span class="icon-tel"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="icon ic-web" width="20" height="20"><path d="M67.964 1.069C69.677.996 71.342.972 73.08.972a30.808 30.808 0 0 1 10.568 3.185c4.415 2.92 8.058 6.9 10.664 11.58 1.616 3.016 1.954 6.49.917 9.7-10.278 32.667-35.78 58.266-68.375 68.76-3.716 1.159-7.818.773-11.171-1.182-2.485-1.471-4.825-3.088-6.828-4.994C4.198 83.51 1.206 77.72.048 71.446c-.17-.748.12-1.616.7-2.195.289-.29.747-.507 1.158-.58l24.73-6.2c1.254-.338 2.581.41 2.943 1.689l2.244 7.696c.12.459.362.797.651 1.086.99.99 2.533.941 3.523-.048L73.079 35.81c.99-.99 1.038-2.533.049-3.522-.338-.338-.797-.555-1.255-.676l-4.705-.893c-1.206-.29-2.002-1.327-2.002-2.485l.506-24.73c.049-.627.29-1.206.748-1.664.41-.41.99-.652 1.544-.772z" class="ic-img"/></svg></span></p>' + ' <p class="u-hidden" data-optimizeSE="true"><a href="/contact-us/general-enquiry/local-office-enquiry/?postcode=' + data.branches[i].postcode + '" class="btn btn-txt btn-ic-right"><span class="txt">Send enquiry</span> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25.959 25.959" class="icon ic-web" width="20" height="20"><path d="M5.69 23.936l10.78-10.779L5.381 2.1 7.512 0l13.065 13.064L7.744 25.96z" class="ic-img"/></svg></a></p>' + ' <p><a href="https://www.google.com/maps/dir/?api=1&amp;destination=' + data.branches[i].lat + ',' + data.branches[i].lng + '" class="btn btn-txt btn-ic-right" target="_blank"><span class="txt">Get directions</span> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="icon ic-web" width="20" height="20"><path d="M36.085 12.004V-.024H0V96.32h96.344V60.117H84.316v24.175H12.028V12.004z" class="ic-img"/><path d="M50.59-.024v12.028h21.58l-29.953 30.66 11.32 11.439 30.779-32.547v23.939h12.028V-.025z" class="ic-img"/></svg></a></p>' + ' <p><a href="' + data.branches[i].url + '" data-branchId="' + data.branches[i].id + '" class="btn btn-txt btn-ic-right"><span class="txt">Visit Agency Page</span> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25.959 25.959" class="icon ic-web" width="20" height="20"><path d="M5.69 23.936l10.78-10.779L5.381 2.1 7.512 0l13.065 13.064L7.744 25.96z" class="ic-img"/></svg></a></p></div>';

            //create info window
            var infowindow = new google.maps.InfoWindow();

            // MARKER CLICK
            google.maps.event.addListener(marker, 'click', function (marker, contentString, infowindow) {
                return function () {
                    /* close the previous info-window */
                    closeInfos();
                    infowindow.setContent(contentString);
                    infowindow.open(map, marker);
                    /* keep the handle, in order to close it on next click event */
                    infos[0] = infowindow;
                    //set classes on list
                    $('#branch-find-results').find('ul li a').removeClass('active');
                    $('#branch-find-results').find('ul li a[data-branchId="' + this.branchId + '"]').addClass('active');
                };
            }(marker, contentString, infowindow));
            if (i === 0) {
                google.maps.event.trigger(marker, 'click');
            }

            google.maps.event.addListener(infowindow, 'domready', function () {
                rTapNotifyDOMChange(document.body);
            });
        }

        // Stops the pins being positioned under the search results
        // 326 is half the maximum width of the map pin bubbles. I'd like to get this progromatically, but at this point, no info windows are shown.
        map.fitBounds(bounds, { left: $('.agency-locations').outerWidth(), right: 0, top: 0, bottom: 0 });

        google.maps.event.addListenerOnce(map, 'bounds_changed', function (event) {

            this.setCenter(bounds.getCenter());
            this.setZoom(map.getZoom() - 1);
        });

        gtmPush(true);

        // REINIT MAP ON RESIZE
        var setMap = (0, _branchDebounce2.default)(function () {
            map.fitBounds(bounds);
        }, 200);
        $(window).resize(setMap);
    }

    function closeInfos() {

        if (infos.length > 0) {

            /* detach the info-window from the marker ... undocumented in the API docs */
            infos[0].set("marker", null);

            /* and close it */
            infos[0].close();

            /* blank the array */
            infos.length = 0;
        }
    }

    function formatAddress(address) {
        var formattedAddress = '';
        var array = address.trim().split(/\s*,\s*/);
        for (var i = 0; i < array.length; i++) {
            formattedAddress = formattedAddress + '<p>' + array[i] + '</p>';
        }
        return formattedAddress;
    }

    function clearMapMarkers() {
        for (var i = 0; i < markers.length; i++) {
            markers[i].setMap(null);
            // Need to remove the click event at this point
        }
        markers = [];
    }

    // This markup needs to appear in two different places, for desktop and mobile.
    function setSearchFeedback(html) {
        $('[data-js="branch-find-feedback"]').each(function (index) {
            $(this).html(html);
        });
    }

    //GTM Push
    function gtmPush(success) {
        var postcode = document.getElementById('branch-address').value.trim();
        postcode = postcode.replace(/(\S*)\s*(\d)/, "$1 $2");
        postcode = postcode.split(' ')[0];

        if (postcode.includes('@')) {
            postcode = "Invalid Entry";
        }

        window.dataLayer.push({
            "event": "branchFinderPostcodeSearch",
            "postalSector": postcode,
            "branchFinderSuccess": success
        });
    }

    // RESULTS INIT
    function resultsInit(data) {
        var mapResults = $('#branch-find-results');
        mapResults.css('display', 'block').delay(500).slideDown('fast');
        var resultList = mapResults.find('ul');
        if (resultList.find('li').length > 0) {
            resultList.find('li').remove();
        }

        for (var i = 0; i < data.branches.length; i++) {
            // Distance: data.branches[i].radius
            // Hard-coded SVG alert
            // The branch search results, left.
            var listItem = '';

            if (i === 0) {
                listItem = '<li tabindex="-1" role="button" class="u-all-padd agency-result current" data-count="' + (i + 1) + '"><strong>Your nearest agency is:</strong><h3>' + (i + 1) + '. ' + data.branches[i].name + ' (' + data.branches[i].radius + ' miles)</h3><p class="u-v-gutter-bottom-sm">' + data.branches[i].address + '</p><p class="u-v-gutter-bottom-sm">' + data.branches[i].openinghours + '</p><p class="u-v-gutter-bottom-sm"><span class="rTapNumber' + data.branches[i].ResponseTapCode + '">' + data.branches[i].telephone + '</span> <span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="icon ic-web" width="20" height="20"><path d="M67.964 1.069C69.677.996 71.342.972 73.08.972a30.808 30.808 0 0 1 10.568 3.185c4.415 2.92 8.058 6.9 10.664 11.58 1.616 3.016 1.954 6.49.917 9.7-10.278 32.667-35.78 58.266-68.375 68.76-3.716 1.159-7.818.773-11.171-1.182-2.485-1.471-4.825-3.088-6.828-4.994C4.198 83.51 1.206 77.72.048 71.446c-.17-.748.12-1.616.7-2.195.289-.29.747-.507 1.158-.58l24.73-6.2c1.254-.338 2.581.41 2.943 1.689l2.244 7.696c.12.459.362.797.651 1.086.99.99 2.533.941 3.523-.048L73.079 35.81c.99-.99 1.038-2.533.049-3.522-.338-.338-.797-.555-1.255-.676l-4.705-.893c-1.206-.29-2.002-1.327-2.002-2.485l.506-24.73c.049-.627.29-1.206.748-1.664.41-.41.99-.652 1.544-.772z" class="ic-img"/></svg></span></p>' +
                //New Send Enquiry link added for Optimize testing
                '<p class="u-v-gutter-bottom-sm u-hidden" data-optimizeSE="true" ><a href="/contact-us/general-enquiry/local-office-enquiry/?postcode=' + data.branches[i].postcode + '" class="btn btn-txt btn-ic-right"><span class="txt">Send enquiry</span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25.959 25.959" class="icon ic-web" width="20" height="20"><path d= "M5.69 23.936l10.78-10.779L5.381 2.1 7.512 0l13.065 13.064L7.744 25.96z" class="ic-img"/></svg></a></p>' + '<p class="u-v-gutter-bottom-sm"><a href="https://www.google.com/maps/dir/?api=1&amp;destination=' + data.branches[i].lat + ',' + data.branches[i].lng + '" class="btn btn-txt btn-ic-right" target="_blank"><span class="txt">Get directions</span> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="icon ic-web" width="20" height="20"><path d="M36.085 12.004V-.024H0V96.32h96.344V60.117H84.316v24.175H12.028V12.004z" class="ic-img"/><path d="M50.59-.024v12.028h21.58l-29.953 30.66 11.32 11.439 30.779-32.547v23.939h12.028V-.025z" class="ic-img"/></svg></a></p>' + '<p class="u-v-gutter-bottom-sm"><a href="' + data.branches[i].url + '" data-branchId="' + data.branches[i].id + '" class="btn btn-txt btn-ic-right"><span class="txt">Visit Agency Page</span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25.959 25.959" class="icon ic-web" width="20" height="20"><path d= "M5.69 23.936l10.78-10.779L5.381 2.1 7.512 0l13.065 13.064L7.744 25.96z" class="ic-img"/></svg></a></p>';
            } else {
                listItem = '<li tabindex="-1" role="button" class="u-all-padd agency-result" data-count="' + (i + 1) + '"><h3>' + (i + 1) + '. ' + data.branches[i].name + ' (' + data.branches[i].radius + ' miles)</h3><p class="u-v-gutter-bottom-sm">' + data.branches[i].address + '</p><p class="u-v-gutter-bottom-sm">' + data.branches[i].openinghours + '</p><p class="u-v-gutter-bottom-sm"><span class="rTapNumber' + data.branches[i].ResponseTapCode + '">' + data.branches[i].telephone + '</span> <span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="icon ic-web" width="20" height="20"><path d="M67.964 1.069C69.677.996 71.342.972 73.08.972a30.808 30.808 0 0 1 10.568 3.185c4.415 2.92 8.058 6.9 10.664 11.58 1.616 3.016 1.954 6.49.917 9.7-10.278 32.667-35.78 58.266-68.375 68.76-3.716 1.159-7.818.773-11.171-1.182-2.485-1.471-4.825-3.088-6.828-4.994C4.198 83.51 1.206 77.72.048 71.446c-.17-.748.12-1.616.7-2.195.289-.29.747-.507 1.158-.58l24.73-6.2c1.254-.338 2.581.41 2.943 1.689l2.244 7.696c.12.459.362.797.651 1.086.99.99 2.533.941 3.523-.048L73.079 35.81c.99-.99 1.038-2.533.049-3.522-.338-.338-.797-.555-1.255-.676l-4.705-.893c-1.206-.29-2.002-1.327-2.002-2.485l.506-24.73c.049-.627.29-1.206.748-1.664.41-.41.99-.652 1.544-.772z" class="ic-img"/></svg></span></p>' + '<p class="u-v-gutter-bottom-sm u-hidden" data-optimizeSE="true" ><a href="/contact-us/general-enquiry/local-office-enquiry/?postcode=' + data.branches[i].postcode + '" class="btn btn-txt btn-ic-right"><span class="txt">Send enquiry</span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25.959 25.959" class="icon ic-web" width="20" height="20"><path d= "M5.69 23.936l10.78-10.779L5.381 2.1 7.512 0l13.065 13.064L7.744 25.96z" class="ic-img"/></svg></a></p>' + '<p class="u-v-gutter-bottom-sm"><a href="https://www.google.com/maps/dir/?api=1&amp;destination=' + data.branches[i].lat + ',' + data.branches[i].lng + '" class="btn btn-txt btn-ic-right" target="_blank"><span class="txt">Get directions</span> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="icon ic-web" width="20" height="20"><path d="M36.085 12.004V-.024H0V96.32h96.344V60.117H84.316v24.175H12.028V12.004z" class="ic-img"/><path d="M50.59-.024v12.028h21.58l-29.953 30.66 11.32 11.439 30.779-32.547v23.939h12.028V-.025z" class="ic-img"/></svg></a></p>' + '<p class="u-v-gutter-bottom-sm"><a href="' + data.branches[i].url + '" data-branchId="' + data.branches[i].id + '" class="btn btn-txt btn-ic-right"><span class="txt">Visit Agency Page</span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25.959 25.959" class="icon ic-web" width="20" height="20"><path d= "M5.69 23.936l10.78-10.779L5.381 2.1 7.512 0l13.065 13.064L7.744 25.96z" class="ic-img"/></svg></a></p>';
            }
            listItem += '</li>';
            resultList.append(listItem);

            // Hide the placeholder text
            $('[data-js="results-holding-text"]').hide();
        }
        sizeResults();

        // Now that the results have been added to the DOM, let's listen for any sly clicks, yeah?
        $('[id="branch-find-results"] li').click(function (e) {
            var number = $(this).attr('data-count');
            highlightResult(number);
            highlightMapPin(number);
            //google.maps.event.trigger(markers[number-1], 'click');
        });
    }

    //Tell Optimize content is ready to be used
    function callOptimize() {
        if (window.dataLayer) {
            dataLayer.push({ 'event': 'optimize.activate' });
        }
    }

    // The results list needs to be no taller than the map. If it is, then it needs a wee scroll bar.
    function sizeResults() {
        var mapResults = $('#branch-find-results'),
            gMap = $('[id~="branch-search-map-container"]'),
            spaceAboveResults = Math.round(mapResults.offset().top - gMap.offset().top),
            gutterValue = 30,
            resultsContentHeight = 0;

        // We need to measure the height of the contents of the search results, rather than the height
        // of the search results themselves, so that when this function is run for a second time,
        // the fixed height of the container won't cause a false positive and allow the else condition
        // to be chosen.
        mapResults.find('> *').each(function () {
            resultsContentHeight += $(this).outerHeight();
        });

        if (spaceAboveResults + resultsContentHeight + gutterValue > gMap.height()) {
            // The height of the results should be the height of the map,
            // minus the distance between the top of the results and the top of the map
            // (this is calculated using the result offset top, minus the map offset top)
            // minus the standard site gutter
            var resultHeight = gMap.height() - spaceAboveResults - gutterValue;
            mapResults.outerHeight(resultHeight + 'px');
        } else {
            // No need to stretch the white box
            mapResults.css('height', 'auto');
        }
    }

    $(window).resize(function () {
        // Are the results showing?
        if ($('#branch-find-results').is(':visible')) {
            sizeResults();
        }
    });

    // "search area in map >" link
    $('[data-js="search-area"]').click(function () {
        // The user only gets to use this functionality if they've zoomed in a wee bit.
        if (map.zoom > zoomRange) {
            var centre = map.getCenter();
            // Do the thing
            reverseLookup('/postcode/ReverseGeoCodeLookup', centre.lng(), centre.lat());
            setSearchFeedback('');
        } else {
            setSearchFeedback('Please zoom in a little more, before searching in this area.');
        }
        return false;
    });

    // This only gets called once the results are in the DOM. It highlights a single result on the left-hand side of the page, with a light yellow background.
    function highlightResult(number) {
        $('[id="branch-find-results"] li').each(function (index) {
            // Is this the current result?
            if (index === number - 1) {
                $('[id="branch-find-results"]').find('li').eq(index).addClass('current');
            } else {
                // Unselect all of the other results
                $('[id="branch-find-results"]').find('li').eq(index).removeClass('current');
            }
        });
        closeInfos();
    }

    // Highlights one particular map pin, and deselects all other map pins. Assumes that number is 1 based counting, not zero based.
    function highlightMapPin(number) {
        // Each pin appears in the map twice. No idea why. I assume it's a Google thing.
        var $mapPins = $('#branch-find-map img[src^="/Static/images/map-pins/"]');
        $mapPins.each(function (index) {
            if (index === number - 1) {
                $('[id="branch-find-map"]').find('[src="/Static/images/map-pins/' + (index + 1) + '.png"]').attr('src', mapPinPath + (index + 1) + '-hover.png');
            } else {
                $('[id="branch-find-map"]').find('[src="/Static/images/map-pins/' + (index + 1) + '-hover.png"]').attr('src', mapPinPath + (index + 1) + '.png');
            }
        });
    }

    // When the user clicks on a map pin and a result on the left is highlighted, it would be polite to scroll it into view.
    function scrollToResult(number) {
        // So apparently I can't trust jQuery's .position().top to return an accurate figure of how far the top of
        // one result is from the top of the container. So I need to do it manually.
        var resultHeights = [];
        $('[id="branch-find-results"] li').each(function () {
            resultHeights.push($(this).outerHeight());
        });

        // The current question is this far, from the top of the scrolling div:
        // The offset of the unordered list plus
        // the height of every question *before* the current question
        var scrollDistance = 0;
        for (var i = 0; i < number - 1; i++) {
            scrollDistance += resultHeights[i];
        }
        $('#branch-find-results').animate({
            scrollTop: scrollDistance
        }, 1000);
    }

    // Allows the values from the two search fields to be mirrored in real time
    // (one for desktop, the other for mobile)
    $('[data-js="mirror"]').on('keyup', function () {
        $('.' + $(this).attr('class')).val($(this).val());
    });

    // The zoom ([+],[-]) buttons on the map need to be visible for the whole time the map is on screen.
    // When the bottom of the map passes the bottom of the viewport, they need to snap to it, quicksmart.
    // For some reason, when the page loads, the zoom controls are position: fixed. positionZoom() only
    // seems to run after the page has scrolled.
    $(window).on('resize scroll', function (e) {
        positionZoom();
    });

    // Making sure the [+] and [-] buttons are up in the user's grill at all times
    function positionZoom() {
        var $map = $('[id~="branch-search-map-container"]'),
            mapHeight = parseInt($map[0].getBoundingClientRect().height),

        // The distance between the top of the document and the top of the map
        mapOverhead = getOffsetTop(document.querySelector('#branch-find')),

        // The height of the viewport
        viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0),
            zoomControls = $('.gm-bundled-control-on-bottom'),
            zoomHeight,

        // The distance the user has scrolled
        scrollyTop = window.pageYOffset;

        // The first time positionZoom() runs, the Google Maps zoom controls haven't been added to the page yet.
        if (zoomControls.length) {
            zoomHeight = zoomControls.find('.gmnoprint').outerHeight();
        } else {
            // Looks like Google Maps has triggered a "tilesloaded" event before it's ready again...
            zoomHeight = 81;
        }

        // If the top of the map is below the fold or just a *bit* above it
        // The 38 pixels is a bit of a "magic number" comprising of the top
        // value of the zoom controls, plus a lot of fudge.
        if (mapOverhead + zoomHeight + 38 > scrollyTop + viewHeight) {
            zoomControls.addClass('map-top').removeClass('map-snap');
        }
        // If the bottom of the map crosses the bottom of the viewport
        else if (scrollyTop + viewHeight > mapOverhead + mapHeight) {
                zoomControls.addClass('map-snap').removeClass('map-top');
            } else {
                // Map is in the middle of the viewport
                zoomControls.removeClass('map-snap map-top');
            }
    }

    // Pinched from https://gomakethings.com/how-to-get-an-elements-distance-from-the-top-of-the-page-with-vanilla-javascript/
    // Measures the *true* distance between the height of an element and the top of the page.
    function getOffsetTop(elem) {

        // Set our distance placeholder
        var distance = 0;

        // Loop up the DOM
        if (elem.offsetParent) {
            do {
                distance += elem.offsetTop;
                elem = elem.offsetParent;
            } while (elem);
        }

        // Return our distance
        return distance < 0 ? 0 : distance;
    }
}

// Big yellow [SEARCH] button desktop
$('[data-js="location-redirect"]').click(function (e) {
    e.preventDefault();
    var address = $('[data-js="redirect-branch-address"]').val();
    var url = $('[data-js="redirect-url"]').val();
    if (address.length < 2) {
        $('[data-js="branch-redirect-feedback"]').html('<span>Please enter your postcode, branch name or address</span>');
    } else {
        window.location = url + '?address=' + address;
    }
});
// Same, but if the user hits enter desktop.
$('[data-js="redirect-branch-form"]').submit(function (e) {
    e.preventDefault();
    var address = $('[data-js="redirect-branch-address"]').val();
    var url = $('[data-js="redirect-url"]').val();
    if (address.length < 2) {
        $('[data-js="branch-redirect-feedback"]').html('<span>Please enter your postcode, branch name or address</span>');
    } else {
        window.location = url + '?address=' + address;
    }
});

},{"../url-parameters/get-parameter":30,"./branch-debounce":3}],5:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = branchMap;
function branchMap() {

    function TxtOverlay(pos, txt, cls, map) {
        this.pos = pos;
        this.txt_ = txt;
        this.cls_ = cls;
        this.map_ = map;
        this.div_ = null;
        this.setMap(map);
    }

    TxtOverlay.prototype = new google.maps.OverlayView();

    TxtOverlay.prototype.onAdd = function () {
        var div = document.createElement('DIV');
        div.className = this.cls_;
        div.innerHTML = this.txt_;
        this.div_ = div;
        var overlayProjection = this.getProjection();
        var position = overlayProjection.fromLatLngToDivPixel(this.pos);
        div.style.left = position.x + 'px';
        div.style.top = position.y + 'px';
        var panes = this.getPanes();
        panes.floatPane.appendChild(div);
    };

    TxtOverlay.prototype.draw = function () {
        var overlayProjection = this.getProjection();
        var position = overlayProjection.fromLatLngToDivPixel(this.pos);
        var div = this.div_;
        div.style.left = position.x + 'px';
        div.style.top = position.y + 'px';
    };

    var map;
    var branchMapName = $('#branch-masthead-map').attr('data-branchname');
    var mapPin = 'data:image/png;base64, ' + $('#branch-masthead-map').attr('data-map-marker');
    var branchMapPosition = new google.maps.LatLng(Number($('#branch-masthead-map').attr('data-latitude').replace(',', '.')), Number($('#branch-masthead-map').attr('data-longitude').replace(',', '.')));
    var branchMapOptions = {
        zoom: 16,
        center: branchMapPosition,
        disableDefaultUI: true,
        minZoom: 5,
        scrollwheel: false,
        styles: [{
            featureType: 'landscape.man_made',
            stylers: [{ visibility: 'off' }]
        }, {
            featureType: 'poi',
            stylers: [{ visibility: 'off' }]
        }, {
            featureType: 'road.highway',
            elementType: 'geometry.fill',
            stylers: [{ hue: '#74A1B3' }, { saturation: -100 }, { lightness: 20 }]
        }, {
            featureType: 'road.highway',
            elementType: 'geometry.stroke',
            stylers: [{ hue: '#74A1B3' }, { saturation: -100 }, { lightness: 100 }, { gamma: 1 }]
        }, {
            featureType: 'road.highway',
            elementType: 'labels.text',
            stylers: [{ hue: '#74A1B3' }, { saturation: -100 }, { lightness: 20 }, { gamma: 1 }]
        }, {
            featureType: 'transit',
            stylers: [{ visibility: 'off' }]
        }, {
            featureType: 'water',
            elementType: 'geometry.fill',
            stylers: [{ hue: '#74A1B3' }, { gamma: 0.4 }, { saturation: -70 }]
        }, {
            featureType: 'water',
            elementType: 'labels',
            stylers: [{ visibility: 'off' }]
        }],
        zoomControl: true,
        zoomControlOptions: {
            position: google.maps.ControlPosition.TOP_RIGHT
        }
    };

    function initMap() {

        map = new google.maps.Map(document.getElementById("branch-masthead-map"), branchMapOptions);

        // SET MARKER
        var marker = new google.maps.Marker({
            position: branchMapPosition,
            map: map,
            icon: mapPin
        });

        // SET MARKER TEXT
        // This might be a mistake - I added a "var" here, to fix a console error.
        // It seems to have worked, though.
        var txt = new TxtOverlay(branchMapPosition, branchMapName, "branch-map-name", map);

        // SET MARKER LINK

        var mapLink = 'http://maps.google.com/maps?q=loc:' + branchMapPosition.lat() + ',' + branchMapPosition.lng();

        google.maps.event.addListener(marker, 'click', function () {
            window.open(mapLink, '_blank');
        });

        google.maps.event.addListener(map, 'tilesloaded', function () {
            if ($('.infomsg').length) {
                $('.infomsg').parent().css({ 'z-index': '0' });
            }
        });
    }

    google.maps.event.addDomListener(window, 'load', initMap);

    //added delay for firefox lag issue
    function resetMap() {
        setTimeout(function () {
            google.maps.event.trigger(map, 'resize');
        }, 50);
        if (map) {
            setTimeout(function () {
                map.setCenter(branchMapPosition);
            }, 100);
        }
    }

    // CENTERING ON RESIZE
    var reset;

    google.maps.event.addDomListener(window, "resize", function () {
        clearTimeout(reset);
        reset = setTimeout(resetMap, 100);
    });
}

},{}],6:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
	value: true
});
exports.default = branchPage;

var _branchDebounce = require('./branch-debounce');

var _branchDebounce2 = _interopRequireDefault(_branchDebounce);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function branchPage() {

	// This is the "normal" call-to-action, the position of which in the page defines if the sticky call-to-action appears.
	var raqBlock = $('[data-js="child"]');

	if (raqBlock.length > 0) {

		// TRIGGER CTA MESSAGE
		var raqBlockHeight = raqBlock.outerHeight();
		var raqBlockTop;
		var ctaMessage = $('[data-js="sticky"]'); // Here's yer man who fades in at the top and stops people from reading the content.
		var triggerCtaMessage = (0, _branchDebounce2.default)(function () {
			raqBlockTop = raqBlock.offset().top - $(window).scrollTop() + raqBlockHeight;
			if (raqBlockTop < 0) {
				ctaMessage.fadeIn(300);
			} else {
				ctaMessage.fadeOut(300);
			}
		}, 200);
		$(window).scroll(function () {
			triggerCtaMessage();
		});
	}
}

},{"./branch-debounce":3}],7:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = branchTeam;
function branchTeam() {

    // VIEWPORT BREAKPOINS
    var breakpoints = { xs: 425, sm: 767, md: 992, lg: 1200 };

    $('[aria-labelledby="org-name"]').each(function () {

        var teamList = $(this);
        var profiles = $(this).find('[itemprop="Person"]');
        var windowWidth = $(window).width();

        // LAUNCH ON START

        collapseList(profiles, windowWidth);

        if (windowWidth > breakpoints.sm) {
            if (profiles.length > 3) {
                appendListNav(teamList);
                initButton(teamList, profiles, windowWidth);
            }
        } else {
            if (profiles.length > 2) {
                appendListNav(teamList);
                initButton(teamList, profiles, windowWidth);
            }
        }

        // LAUNCH ON RESIZE
        $(window).resize(function () {
            // Hey, it's the view more button!
            $(teamList).find('[data-js="view-more"]').remove();
            profiles.show();
            windowWidth = $(window).width();
            collapseList(profiles, windowWidth);
            if (windowWidth > breakpoints.sm) {
                if (profiles.length > 3) {
                    appendListNav(teamList);
                    initButton(teamList, profiles, windowWidth);
                }
            } else {
                if (profiles.length > 2) {
                    appendListNav(teamList);
                    initButton(teamList, profiles, windowWidth);
                }
            }
        });
    });

    // FUNCTIONS:
    // 1. EXPAND LIST FUNCTION
    function expandList(item) {
        $(item).show();
    }

    // 2. COLLAPSE LIST FUNCTION
    function collapseList(item, width) {
        if (width > breakpoints.sm) {
            $(item).slice(3).hide();
        } else {
            $(item).slice(2).hide();
        }
    }

    // 3. APPEND BUTTON
    function appendListNav(item) {
        var listNav = '<p class="u-text-center u-hidden-print" data-js="view-more"><button class="btn btn-secondary">View more</button></p>';
        if ($('[data-js="view-more"]').length == 0) {
            $(item).append(listNav);
        }
    }

    // 4. CTA BUTTON

    function initButton(item, itemsToShow, width) {
        var cta = $(item).find('[data-js="view-more"]');
        cta.click(function () {
            if ($(item).hasClass('active')) {
                collapseList(itemsToShow, width);
                $(item).removeClass('active');
                cta.find('button').text('View more');
            } else {
                expandList(itemsToShow);
                $(item).addClass('active');
                cta.find('button').text('View less');
            }
        });
    }
}

},{}],8:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = saveBranchBtn;

var _prefferedBranchCookie = require('../../foundation/scripts/preffered-branch-cookie');

var _prefferedBranchCookie2 = _interopRequireDefault(_prefferedBranchCookie);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// This is a copy of the original JS, which is / was in \Resources\uid\js\save-branch-btn.js
function saveBranchBtn() {
    var saveBranchDiv = $('[data-branch-id]');
    var saveBranchDivExists = saveBranchDiv.length > 0;
    var saveBranchTextContainer = saveBranchDiv.find(".txt");
    var saveBranchTextContainerExists = saveBranchTextContainer.length > 0;
    var isCurrentBranchSelected = false;
    var pbCookieHandler = (0, _prefferedBranchCookie2.default)();

    function getCurrentBranch() {
        if (saveBranchDivExists) {
            var currentBranchId = saveBranchDiv.attr("data-branch-id");
            if (typeof currentBranchId !== "undefined") {
                var bId = parseInt(currentBranchId);
                if (!isNaN(bId)) {
                    return bId;
                }
            }
        }
        return 0;
    }

    function markAsMyBranch(isMyBranch) {
        if (saveBranchDivExists && saveBranchTextContainerExists) {
            if (isMyBranch) {
                saveBranchDiv.addClass("active");
                saveBranchTextContainer.text("Saved as my local office");
            } else {
                saveBranchDiv.removeClass("active");
                saveBranchTextContainer.text("Save as my local office");
            }
        }
    }

    function loadInitialState() {
        var currentBranchId = getCurrentBranch();
        if (currentBranchId > 0) {
            // Oh, hello.
            var sessionBranchId = pbCookieHandler.getPrefferedBranchId();
            isCurrentBranchSelected = sessionBranchId === currentBranchId;
            markAsMyBranch(isCurrentBranchSelected);
        }
    }

    saveBranchDiv.click(function (e) {
        e.preventDefault();
        var sessionBranchId = pbCookieHandler.getPrefferedBranchId();
        var currentBranchId = getCurrentBranch();
        if (currentBranchId > 0) {
            sessionBranchId === currentBranchId ? pbCookieHandler.setPrefferedBranchId(0) : pbCookieHandler.setPrefferedBranchId(currentBranchId);
        }

        setTimeout(loadInitialState, 200);
    });

    loadInitialState();
}

},{"../../foundation/scripts/preffered-branch-cookie":45}],9:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = agencySearch;

var _branchDebounce = require('../branch-map/branch-debounce');

var _branchDebounce2 = _interopRequireDefault(_branchDebounce);

var _prefferedBranchCookie = require('../../foundation/scripts/preffered-branch-cookie');

var _prefferedBranchCookie2 = _interopRequireDefault(_prefferedBranchCookie);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function agencySearch(type) {
    var map,
        infos = [],
        markers = [],
        mapPinPath = '/Static/images/map-pins/',

    //mapPin = 'data:image/png;base64, ' + $('#branch-search-map').attr('data-map-marker'),
    mapFirstPosition = { lat: 55.0942198, lng: -4.4267206 },

    //bounds = new google.maps.LatLngBounds(),
    zoomRange = 7,
        // The range at which "Search area in map >" becomes a viable option for the user
    mapOptions = {
        center: mapFirstPosition,
        zoom: 7,
        minZoom: 5,
        maxZoom: 18,
        disableDefaultUI: true,
        scrollwheel: false,
        styles: [{
            featureType: 'landscape.man_made',
            stylers: [{ visibility: 'off' }]
        }, {
            featureType: 'poi',
            stylers: [{ visibility: 'off' }]
        }, {
            featureType: 'road.highway',
            elementType: 'geometry.fill',
            stylers: [{ hue: '#74A1B3' }, { saturation: -100 }, { lightness: 20 }]
        }, {
            featureType: 'road.highway',
            elementType: 'geometry.stroke',
            stylers: [{ hue: '#74A1B3' }, { saturation: -100 }, { lightness: 100 }, { gamma: 1 }]
        }, {
            featureType: 'road.highway',
            elementType: 'labels.text',
            stylers: [{ hue: '#74A1B3' }, { saturation: -100 }, { lightness: 20 }, { gamma: 1 }]
        }, {
            featureType: 'transit',
            stylers: [{ visibility: 'off' }]
        }, {
            featureType: 'water',
            elementType: 'geometry.fill',
            stylers: [{ hue: '#74A1B3' }, { gamma: 0.4 }, { saturation: -70 }]
        }, {
            featureType: 'water',
            elementType: 'labels',
            stylers: [{ visibility: 'off' }]
        }],
        zoomControl: true,
        zoomControlOptions: {
            position: google.maps.ControlPosition.RIGHT_BOTTOM
        }
    },
        $branchSearchResults = $('#branch-search-results'),
        $branchMap = $('#branch-search-map'),
        firstGo = true;

    // INIT FIRST MAP
    map = new google.maps.Map(document.getElementById("branch-search-map"), mapOptions);

    // "Search area in map >" link
    $('[data-js="search-area"]').click(function () {
        if (map.zoom > zoomRange) {
            var centre = map.getCenter();
            reverseLookup('/postcode/ReverseGeoCodeLookup', centre.lng(), centre.lat());
            setSearchFeedback('');
        } else {
            setSearchFeedback('Please zoom in a little more, before searching in this area.');
        }
        return false;
    });

    google.maps.event.addListener(map, 'tilesloaded', function () {
        if ($('.infomsg').length) {
            $('.infomsg').parent().css({ 'z-index': '0' });
        }
    });

    // Changes the appearance of the "Search area in map >" link
    map.addListener('zoom_changed', function () {
        var $searchAreaBtn = $('[data-js="search-area"]');
        if (map.zoom > zoomRange) {
            $searchAreaBtn.removeClass('btn-disabled');
        } else {
            $searchAreaBtn.addClass('btn-disabled');
        }
    });

    var mapTabs = document.querySelectorAll('[name="tabs"]'),
        $mapContainer = $('[id~="branch-search-map-container"]');

    // This is the "Edit >" or "Hide >" buttons, in the yellow panel. Because of the way the map is hidden,
    // we need to manage the bounds of the map, once it's shown for the first time.
    $('[data-click="crashZoom"]').click(function () {
        // Unfortunately, because the toggle link uses slideDown, crashZoom() returns
        // false, unless we delay it (I'm not going to extend toggle link across the
        // site just for this one page)
        setTimeout(crashZoom, 500);
        // Make sure the results list is scrolled to the top
        scrollToResult(0);
    });

    // Because the "submit" button is type="button", for some reason.
    $('#branch-address').keypress(function (e) {
        var key = event.key || event.keyCode;
        if (key === 'Enter' || key === 13) {
            $('.branch-search-form-submit').trigger('click');
            event.preventDefault();
        }
    });

    // RESIZE
    var setFirstMap = (0, _branchDebounce2.default)(function () {
        map.panTo(mapFirstPosition);
    }, 200);
    $(window).resize(setFirstMap);

    // This is created in order to pass a parameter to a click event.
    // It gets called in the search button click, below.
    function searchClick(fakeClick) {
        getLocations('/Postcode/RadiusSearch', fakeClick);
        $('body').find('.ui-dialog').animate({
            top: "50"
        }, 300);
    }

    // Adding the function above to the window, because scope is confusing and frightening
    window.searchClick = searchClick;

    // User searches for a new postcode, using a search box on or around a Google map
    $('.branch-search-form-submit').off('click').on('click', function (e) {
        e.preventDefault();
        searchClick();
    });

    // Same, but if the user hits enter.
    $(document).keypress(function (e) {
        if ($("#branch-search").hasClass('branch-popup') && (e.keycode === 13 || e.which === 13)) {
            e.preventDefault();
            searchClick();
        }
    });

    // This returns a bunch of agencies and adds them to the Google map
    function getLocations(targetURL, prepopulate) {
        var feedbackText = $('[data-js="cms-feedback-text"]').val();
        var data = {
            productTag: "All Products",
            address: $('.branch-search-form-keyword').val()
        };

        //We want to make sure that the agency selector brings back 5 instead of the existing method that is just 3
        if (type === 'agency-finder') {
            data.fiveResults = true;
        }

        if (data.address.length < 2) {
            setSearchFeedback(feedbackText);
        } else {
            $.ajax({
                url: targetURL,
                method: "POST",
                async: true,
                data: data,
                success: function success(data) {
                    setSearchFeedback('');
                    setMapMarkers(data);
                    resultsInit(data);
                    // For the postcode-agency-finder, we need to steal the top result,
                    // then display it in the postit note above the map.
                    if (prepopulate && data.branches[0]) {
                        var result = data.branches[0];
                        var $result = $($branchSearchResults.find('li').get(0));
                        agentSelect($("#branch-search-results li:first button")[0], data, $result);
                        // Write the cookie - Commenting this out as part of NFUM-1781
                        //prefferedBranchCookie().setPrefferedBranchId(data.branches[0].id);
                    }
                },
                error: function error(jqXHR, textStatus, errorThrown) {
                    setSearchFeedback('Service currently unavailable. Please try again later.');
                    gtmPush(false);
                }
            });
        }
    }

    // GOOGLE MAP INIT
    function setMapMarkers(data) {
        clearMapMarkers();
        if (data.branches.length === 0) {
            data.currentLocation = mapFirstPosition;

            setSearchFeedback('Sorry, no results were found.');
            gtmPush(false);
            map.panTo(mapFirstPosition);
            map.setZoom(7);
            return;
        }

        var currentLocation = new google.maps.LatLng(data.currentLocation.lat, data.currentLocation.lng);
        var bounds = new google.maps.LatLngBounds();
        google.maps.event.clearListeners('#branch-search-map', 'resize');

        for (var i = 0; i < data.branches.length; i++) {
            var iconType = i == 0 ? '-hover' : '';
            var marker = new google.maps.Marker({
                position: new google.maps.LatLng(data.branches[i].lat, data.branches[i].lng),
                map: map,
                icon: mapPinPath + (i + 1) + iconType + '.png',
                branchId: data.branches[i].id,
                pinNo: i + 1
            });
            markers.push(marker);
            bounds.extend(marker.position);

            // Marker pop-up content
            var contentString = '<div class="branch-marker-popup"><h2 class="h3">' + (i + 1) + '. ' + data.branches[i].name + '</h2> <p class="archer-book-ss">' + data.branches[i].openinghours + '</p><hr class="hr-sm"><p data-js="unselected"><a href="#" data-select-agency="' + i + '" data-branchid="' + data.branches[i].id + '" class="btn btn-txt btn-ic-right"><span class="txt">Select agency</span> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25.959 25.959" class="icon ic-web" width="20" height="20"><path d="M5.69 23.936l10.78-10.779L5.381 2.1 7.512 0l13.065 13.064L7.744 25.96z" class="ic-img"></path></svg></a></p><p class="ic-small u-flush" data-js="selected"><span class="btn btn-txt btn-ic-right"><span class="txt">Sending form to ' + data.branches[i].name + '</span> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="icon ic-secondary" width="40" height="40"><path class="ic-circle" fill="#ffcb05" d="M99.28 50.06A49.28 49.28 0 1 1 50 .77a49.29 49.29 0 0 1 49.28 49.29"></path><path class="ic-img" fill="#000" d="M43.24 67.26l-3 3-17.89-17.88 3-3zm-3-3l3 3 34.41-34.41-3-3z"></path></svg></span></p></div>';

            //create info window
            var infowindow = new google.maps.InfoWindow();

            // Info window is finished loading
            google.maps.event.addListener(infowindow, 'domready', function () {
                // User clicks on the [Select agency >] call-to-action
                // This appears both inside the map info windows and in the results list
                $('[data-select-agency]').click(function (e) {
                    var $that = $(this),
                        index = $that.attr('data-select-agency'),
                        branchID = $that.attr('data-branchid'),
                        $result = $($branchSearchResults.find('li').get(index));
                    agentSelect(e.currentTarget, data, $result);
                    highlightMapPin(parseInt(index, 10) + 1);
                    e.stopPropagation();
                    e.preventDefault();
                });
            });

            // User clicks on a map pin
            google.maps.event.addListener(marker, 'click', function (marker, contentString, infowindow) {
                return function () {
                    var number = $(this)[0].pinNo;
                    closeInfos();
                    // Populates that wee popup with information
                    infowindow.setContent(contentString);
                    infowindow.open(map, marker);
                    // An attempt to get infowindows to stop hiding behind the search bar.
                    map.fitBounds(bounds, { top: 380, right: 380 });
                    highlightMapPin(number);
                    scrollToResult(number);
                    resultSelect(number - 1);
                    /* keep the handle, in order to close it on next click event */
                    infos[0] = infowindow;
                };
            }(marker, contentString, infowindow));
        }
        map.fitBounds(bounds);
        google.maps.event.addListenerOnce(map, 'bounds_changed', function (event) {
            this.setCenter(bounds.getCenter());
            this.setZoom(map.getZoom() - 1);
        });
        gtmPush(true);
        // REINIT MAP ON RESIZE
        var setMap = (0, _branchDebounce2.default)(function () {
            map.fitBounds(bounds);
        }, 200);
        $(window).resize(setMap);
    }

    function clearMapMarkers() {
        for (var i = 0; i < markers.length; i++) {
            markers[i].setMap(null);
        }
        markers = [];
    }

    function closeInfos() {
        if (infos.length > 0) {
            /* detach the info-window from the marker ... undocumented in the API docs */
            infos[0].set("marker", null);
            /* and close it */
            infos[0].close();
            /* blank the array */
            infos.length = 0;
        }
    }

    function setSearchFeedback(html) {
        $('#branch-search-feedback').html(html);
    }

    //GTM Push
    function gtmPush(success) {
        var postcode = document.getElementById('branch-address').value.trim();
        postcode = postcode.replace(/(\S*)\s*(\d)/, "$1 $2");
        postcode = postcode.split(' ')[0];

        if (postcode.includes('@')) {
            postcode = "Invalid Entry";
        }

        window.dataLayer.push({
            "event": "branchFinderPostcodeSearch",
            "postalSector": postcode,
            "branchFinderSuccess": success
        });
    }

    // RESULTS INIT
    function resultsInit(data) {
        $branchSearchResults.delay(500).slideDown('fast');
        var $resultList = $branchSearchResults.find('ul');
        if ($resultList.find('li').length > 0) {
            $resultList.find('li').remove();
        }
        for (var i = 0; i < data.branches.length; i++) {
            var listItem;
            // For the postcode agency finder, we need slightly different markup.
            if (type === 'agency-finder') {
                listItem = '<li><a href="#"" class="link-container"><h3>' + (i + 1) + '. ' + data.branches[i].name + ' <br class="visible-xs"><span class="h4 u-txt-black metapro-bold">(' + data.branches[i].radius + ' miles)</span></h3><p>' + data.branches[i].address + '</p><p class="u-flush" data-js="unselected"><button type="button" class="btn btn-txt btn-ic-right" data-select-agency="' + i + '" data-branchid="' + data.branches[i].id + '"><span class="txt">Select agency</span> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25.959 25.959" class="icon ic-web" width="20" height="20"><path d="M5.69 23.936l10.78-10.779L5.381 2.1 7.512 0l13.065 13.064L7.744 25.96z" class="ic-img"></path></svg></button></p><p class="ic-med u-flush" data-js="selected"><span class="btn btn-txt btn-ic-right"><span class="txt">Sending form to ' + data.branches[i].name + '</span> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="icon ic-secondary" width="40" height="40"><path class="ic-circle" fill="#ffcb05" d="M99.28 50.06A49.28 49.28 0 1 1 50 .77a49.29 49.29 0 0 1 49.28 49.29"></path><path class="ic-img" fill="#000" d="M43.24 67.26l-3 3-17.89-17.88 3-3zm-3-3l3 3 34.41-34.41-3-3z"></path></svg></span></p></a>';
                if (i !== data.branches.length - 1) {
                    listItem += '<hr class="hr-sm">';
                }
                listItem += '</li>';
            }
            // For the branch finder
            else {
                    listItem = '<li><a href="#" data-branchId="' + data.branches[i].id + '" class="link-container"><h3>' + data.branches[i].name + ' <br class="visible-xs"><span class="h4 u-txt-black metapro-bold">(' + data.branches[i].radius + ' miles)</span></h3><p>' + data.branches[i].address + '</p></a><hr></li>';
                }
            $resultList.append(listItem);
        }

        // User selects a branch from the results list on the map
        $resultList.find('li a').click(function (e) {
            e.preventDefault();
            var index = $branchSearchResults.find('li').index($(this).parent());
            // resultSelect insists on the node in the form of an index.
            resultSelect(index);
            //agentSwitch(e, data, $that);
            highlightMapPin(index + 1);
            scrollToResult(index);
        });

        // User clicks on the [Select agency >] call-to-action
        // This appears both inside the map info windows and in the results list
        $('[data-select-agency]').click(function (e) {
            var index = $(this).attr('data-select-agency'),
                $result = $($branchSearchResults.find('li').get(index));
            agentSelect(e.currentTarget, data, $result);
            highlightMapPin(parseInt(index, 10) + 1);
            e.stopPropagation();
            e.preventDefault();
        });
    }

    // This selects a particular result, but doesn't change the cookie
    function resultSelect(index) {
        // Remove all the old highlight classes
        $branchSearchResults.find('.u-bg-grey-20').removeClass('u-bg-grey-20');
        // Add the highlight class
        $branchSearchResults.find('li').eq(index).addClass('u-bg-grey-20');
    }

    // This updated the page state after the user has selected a new agent.
    // It updates the sort of yellow post-it note with new information.
    // e: event
    // data: not quite sure. I think it's passed about from further up
    // $agentResult: a jQuery object which represents the <li/> in the
    //               results list, which represents this particular agency
    function agentSelect(e, data, $agentResult) {
        var submitType = $('#SubmitType').val(),
            selectedBranchId = $(e).data("branchid") + '_' + submitType,
            index = $(e).attr('data-select-agency'),
            branchData = data.branches[index];

        //selectBranchId will be constructed differently
        if (typeof window.AgencySelector !== "undefined" && typeof window.AgencySelector.items !== "undefined") {
            selectedBranchId = $(e).data("branchid") + '_' + window.AgencySelector.items[0].submitType;
        }

        $branchSearchResults.find('li').each(function () {
            $(this).removeClass('u-bg-grey-20 active');
        });
        $agentResult.addClass('active');
        // Update the yellow panel with what the user has chosen
        if (typeof branchData !== 'undefined') {
            updatePostit(branchData.name, branchData.radius, commaBreak(branchData.address), formatTelephone(branchData));
        }

        //We have a new event for the new Agency Selector.
        $(document).trigger("branchSearch.agencySelected", [selectedBranchId, firstGo]);
        //Mark that we have already triggered this before
        if (firstGo) {

            firstGo = false;
        }
    }

    // This formats a string so that after each comma, there's a <br/> tag.
    function commaBreak(string) {
        // This is a regular expression, which represents ",".
        // Apparently, this is the only way to get replace() to work more than once.
        var regComma = /,/gi;
        return string.replace(regComma, ',<br>');
    }

    // This formats a telephone number.
    function formatTelephone(branchData) {
        return '<span class="rTapNumber' + branchData.ResponseTapCode + '">' + branchData.telephone + '</span> <span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="icon ic-web" width="20" height="20"><path d="M67.964 1.069C69.677.996 71.342.972 73.08.972a30.808 30.808 0 0 1 10.568 3.185c4.415 2.92 8.058 6.9 10.664 11.58 1.616 3.016 1.954 6.49.917 9.7-10.278 32.667-35.78 58.266-68.375 68.76-3.716 1.159-7.818.773-11.171-1.182-2.485-1.471-4.825-3.088-6.828-4.994C4.198 83.51 1.206 77.72.048 71.446c-.17-.748.12-1.616.7-2.195.289-.29.747-.507 1.158-.58l24.73-6.2c1.254-.338 2.581.41 2.943 1.689l2.244 7.696c.12.459.362.797.651 1.086.99.99 2.533.941 3.523-.048L73.079 35.81c.99-.99 1.038-2.533.049-3.522-.338-.338-.797-.555-1.255-.676l-4.705-.893c-1.206-.29-2.002-1.327-2.002-2.485l.506-24.73c.049-.627.29-1.206.748-1.664.41-.41.99-.652 1.544-.772z" class="ic-img" /></svg></span>';
    }

    // This pushes content into the yellow panel above the map panel
    // It expects the parameters to be text or HTML and for the address
    // to have <br> tags after each comma.
    function updatePostit(name, radius, address, telephone) {
        $('[data-js="selected-agency-name"]').html(name);
        $('[data-js="selected-agency-distance"]').html('(' + radius + ' miles)');
        $('[data-js="selected-agency-address"]').html(address);
        $('[data-js="selected-agency-telephone"]').html(telephone);
    }

    // Highlights one particular map pin and deselects all other map pins. Assumes that number is 1 based counting, not zero based.
    function highlightMapPin(number) {
        closeInfos();
        // Each pin appears in the map twice. No idea why. I assume it's a Google thing.
        var $mapPins = $branchMap.find('img[src^="' + mapPinPath + '"]');
        $mapPins.each(function (index) {
            if (index === number - 1) {
                $branchMap.find('[src="' + mapPinPath + (index + 1) + '.png"]').attr('src', mapPinPath + (index + 1) + '-hover.png');
            } else {
                $branchMap.find('[src="' + mapPinPath + (index + 1) + '-hover.png"]').attr('src', mapPinPath + (index + 1) + '.png');
            }
        });
    }

    // When the user clicks on a map pin and a result on the left is highlighted, it would be polite to scroll it into view.
    function scrollToResult(number) {
        // So apparently I can't trust jQuery's .position().top to return an accurate figure of how far the top of
        // one result is from the top of the container. So I need to do it manually.
        var resultHeights = [];
        $('[id="branch-search-results"] li').each(function () {
            resultHeights.push($(this).outerHeight());
        });

        // The current question is this far, from the top of the scrolling div:
        // The offset of the unordered list plus
        // the height of every question *before* the current question
        var scrollDistance = 0;
        for (var i = 0; i < number - 1; i++) {
            scrollDistance += resultHeights[i];
        }
        $branchSearchResults.animate({
            scrollTop: scrollDistance
        }, 1000);
    }

    // Used in the above event listeners, to nudge the map to fit the frame nicely.
    function crashZoom() {
        // Do we have results? Is the map showing yet?
        if (markers.length > 0 && $mapContainer.is(':visible')) {
            var bounds = new google.maps.LatLngBounds();
            for (var i = 0; i < markers.length; i++) {
                bounds.extend(markers[i].position);
            }
            // Mobile
            if ($('.tabs-group').is(':visible')) {
                map.fitBounds(bounds);
            }
            // Leaving an arbitrary amount of space at the top of the map, for the controls.
            else {
                    map.fitBounds(bounds, { top: 210 });
                }
        }
    }
    // Converts latitude and longditude into postcodes
    function reverseLookup(targetURL, lng, lat) {
        var data = {
            productTag: "All Products",
            lng: lng,
            lat: lat
        };

        $.ajax({
            url: targetURL,
            method: "POST",
            async: true,
            data: data,
            success: function success(data) {
                setSearchFeedback('');
                setMapMarkers(data);
                resultsInit(data);
            },
            error: function error(jqXHR, textStatus, errorThrown) {
                setSearchFeedback('Service currently unavailable. Please try again later.');
                gtmPush(false);
            }
        });
    }
}

},{"../../foundation/scripts/preffered-branch-cookie":45,"../branch-map/branch-debounce":3}],10:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = branchSearch;

var _branchDebounce = require('../branch-map/branch-debounce');

var _branchDebounce2 = _interopRequireDefault(_branchDebounce);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function branchSearch() {
  var map;
  var markers = [];
  var mapPin = 'data:image/png;base64, ' + $('#branch-search-map').attr('data-map-marker');
  var mapFirstPosition = { lat: 55.0942198, lng: -4.4267206 };
  var bounds = new google.maps.LatLngBounds();
  var mapOptions = {
    center: mapFirstPosition,
    zoom: 7,
    minZoom: 5,
    maxZoom: 18,
    disableDefaultUI: true,
    scrollwheel: false,
    styles: [{
      featureType: 'landscape.man_made',
      stylers: [{ visibility: 'off' }]
    }, {
      featureType: 'poi',
      stylers: [{ visibility: 'off' }]
    }, {
      featureType: 'road.highway',
      elementType: 'geometry.fill',
      stylers: [{ hue: '#74A1B3' }, { saturation: -100 }, { lightness: 20 }]
    }, {
      featureType: 'road.highway',
      elementType: 'geometry.stroke',
      stylers: [{ hue: '#74A1B3' }, { saturation: -100 }, { lightness: 100 }, { gamma: 1 }]
    }, {
      featureType: 'road.highway',
      elementType: 'labels.text',
      stylers: [{ hue: '#74A1B3' }, { saturation: -100 }, { lightness: 20 }, { gamma: 1 }]
    }, {
      featureType: 'transit',
      stylers: [{ visibility: 'off' }]
    }, {
      featureType: 'water',
      elementType: 'geometry.fill',
      stylers: [{ hue: '#74A1B3' }, { gamma: 0.4 }, { saturation: -70 }]
    }, {
      featureType: 'water',
      elementType: 'labels',
      stylers: [{ visibility: 'off' }]
    }],
    zoomControl: true,
    zoomControlOptions: {
      position: google.maps.ControlPosition.RIGHT_BOTTOM
    }
  };

  // INIT FIRST MAP
  map = new google.maps.Map(document.getElementById("branch-search-map"), mapOptions);

  google.maps.event.addListener(map, 'tilesloaded', function () {
    if ($('.infomsg').length) {
      $('.infomsg').parent().css({ 'z-index': '0' });
    }
  });

  // RESIZE
  var setFirstMap = (0, _branchDebounce2.default)(function () {
    //map.setCenter(mapFirstPosition); 
    map.panTo(mapFirstPosition);
  }, 200);
  $(window).resize(setFirstMap);

  // SEARCH button
  $('.branch-search-form-submit').off('click').on('click', function (e) {
    e.preventDefault();

    getLocations('/Postcode/RadiusSearch');
    $('body').find('.ui-dialog').animate({
      top: "50"
    }, 300);
  });

  // Same, but if the user hits enter.
  $(document).keypress(function (e) {
    if ($("#branch-search").hasClass('branch-popup') && (e.keycode === 13 || e.which === 13)) {
      e.preventDefault();
      getLocations('/Postcode/RadiusSearch');
      $('body').find('.ui-dialog').animate({
        top: "50"
      }, 300);
    }
  });

  // GET LOCATIONS
  function getLocations(targetURL) {
    var data = {
      productTag: "All Products",
      address: $('.branch-search-form-keyword').val()
    };

    if (data.address.length < 2) {
      setSearchFeedback('Please enter your postcode, branch name or address');
    } else {
      $.ajax({
        url: targetURL,
        method: "POST",
        async: true,
        data: data,
        success: function success(data) {
          setSearchFeedback('');
          setMapMarkers(data);
          resultsInit(data);
        },
        error: function error(jqXHR, textStatus, errorThrown) {
          setSearchFeedback('Service currently unavailable. Please try again later.');
          gtmPush(false);
        }
      });
    }
  }

  // GOOGLE MAP INIT
  function setMapMarkers(data) {
    clearMapMarkers();
    if (data.branches.length === 0) {
      data.currentLocation = mapFirstPosition;

      setSearchFeedback('<span>No results were found.</span>');
      gtmPush(false);
      map.panTo(mapFirstPosition);
      map.setZoom(7);

      return;
    }

    var currentLocation = new google.maps.LatLng(data.currentLocation.lat, data.currentLocation.lng);
    var bounds = new google.maps.LatLngBounds();
    google.maps.event.clearListeners('#branch-search-map', 'resize');

    for (var i = 0; i < data.branches.length; i++) {
      var marker = new google.maps.Marker({
        position: new google.maps.LatLng(data.branches[i].lat, data.branches[i].lng),
        map: map,
        icon: mapPin,
        branchId: data.branches[i].id
      });
      markers.push(marker);
      bounds.extend(marker.position);
      // MARKER CLICK
      google.maps.event.addListener(marker, 'click', function () {
        $('#branch-search-results').find('ul li a').removeClass('active');
        $('#branch-search-results').find('ul li a[data-branchId="' + this.branchId + '"]').addClass('active');
      });
    }
    map.fitBounds(bounds);

    google.maps.event.addListenerOnce(map, 'bounds_changed', function (event) {

      this.setCenter(bounds.getCenter());
      this.setZoom(map.getZoom() - 1);
    });
    gtmPush(true);
    // REINIT MAP ON RESIZE
    var setMap = (0, _branchDebounce2.default)(function () {
      map.fitBounds(bounds);
    }, 200);
    $(window).resize(setMap);
  }

  function clearMapMarkers() {
    for (var i = 0; i < markers.length; i++) {
      markers[i].setMap(null);
    }
    markers = [];
  }

  function setSearchFeedback(html) {
    $('#branch-search-feedback').html(html);
  }
  //GTM Push
  function gtmPush(success) {
    var postcode = document.getElementById('branch-address').value.trim();
    postcode = postcode.replace(/(\S*)\s*(\d)/, "$1 $2");
    postcode = postcode.split(' ')[0];

    if (postcode.includes('@')) {
      postcode = "Invalid Entry";
    }

    window.dataLayer.push({
      "event": "branchFinderPostcodeSearch",
      "postalSector": postcode,
      "branchFinderSuccess": success
    });
  }

  // RESULTS INIT
  function resultsInit(data) {
    $('#branch-search-results').delay(500).slideDown('fast');
    var resultList = $('#branch-search-results').find('ul');
    if (resultList.find('li').length > 0) {
      resultList.find('li').remove();
    }
    for (var i = 0; i < data.branches.length; i++) {
      var listItem = '<li><a href="#" data-branchId="' + data.branches[i].id + '" class="link-container"><h3>' + data.branches[i].name + ' <br class="visible-xs"><span class="h4 u-txt-black metapro-bold">(' + data.branches[i].radius + ' miles)</span></h3><p>' + data.branches[i].address + '</p></a><hr></li>';
      resultList.append(listItem);
    }
    resultList.find('li a').click(function (e) {
      e.preventDefault();
      var submitType = $('#SubmitType').val();
      var selectedBranchId = $(e.currentTarget).data("branchid") + '_' + submitType;
      $(document).trigger("branchSearch.branchSelected", selectedBranchId);
    });
  }
}

},{"../branch-map/branch-debounce":3}],11:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = enquirersSubmit;

var _branchSearch = require('./branch-search');

var _branchSearch2 = _interopRequireDefault(_branchSearch);

var _prefferedBranchCookie = require('../../foundation/scripts/preffered-branch-cookie');

var _prefferedBranchCookie2 = _interopRequireDefault(_prefferedBranchCookie);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// This just hands the submission of this form:
// /contact-us/general/local-office-enquiry/
// ... which has much in common with the branch finder.
function enquirersSubmit(data) {
    var formContainer = $(data.formId),
        formButton = $(data.buttonId),
        hiddenSubmit = $(data.hiddenSubmitId),
        formHiddenInput = $(data.hiddenInputId),
        internalBranchId = $(data.internalBranchId),
        selectedBranchId,
        enqModal,
        // Probably not used any more
    windowWidth = $(window).width(),
        $modalDiv = $('[data-js="modal"]');

    // Ensure the modal markup is in the root of the document, then do some setup.
    $('.site-footer').after($modalDiv);
    $modalDiv.append('<div class="modal-overlay"/><div tabindex="0"/><div class="modal-panel u-bg-white u-all-padd"/><div tabindex="0"/>');

    var $modalContent = $modalDiv.find('.modal-panel');

    function submitForm() {
        // [NFU-695] To enable episerver builtin client-side validation, form is submitted by programmatically click hidden submit button.
        hiddenSubmit.click();
    }

    $('[data-js="close"]').click(function () {
        closeDialog();
    });

    // Shows the modal popup, which allows users to select a branch
    function showDialog(html) {
        $modalContent.html(html);
        $modalDiv.removeClass('u-hidden').attr('aria-hidden', 'false');
        $('html,body').scrollTop(0);
        $modalContent.find('input').focus(); // This is a bit markup-specific, for my liking.
        // Listen out for the escape key
        $('body').on('keyup.close', function (e) {
            if (e.keyCode === 27) {
                closeDialog();
            }
        });
        // Builds an array of all elements within the modal which can receive focus
        var $focus = $('.modal').find('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');

        // Traps the cursor inside the modal.
        // Hit the first dummy focus element - sends the focus to the end of the modal
        $focus.first().focus(function () {
            $focus.get($focus.length - 1).focus();
        });
        // Hit the last dummy focus element - sends the focus to the start of the modal
        $focus.last().focus(function () {
            $focus.get(1).focus();
        });
        (0, _branchSearch2.default)();
    }

    // I guess closes the modal popup
    function closeDialog() {
        $modalDiv.addClass('u-hidden').attr('aria-hidden', 'true');
        // Removes the listener for the escape key
        $('body').off('.close');
    }

    // AJAX fails, inform user?
    function showErrorDialog() {
        $modalContent.html('<p>Service currently unavailable. Please try again later.</p>');
    };

    // Submit hit
    formButton.click(function (e) {
        if (data.isPcaOn && data.submitType !== '' && typeof selectedBranchId === "undefined") {
            $.ajax({
                url: '/Forms/LocalBranch',
                method: "POST",
                data: {
                    routeToLocalBranch: data.isPcaOn,
                    submitType: data.submitType
                },
                async: true,
                success: function success(data) {
                    // The user has not chosen a favourite branch
                    if (data !== undefined && data.branchId === undefined) {
                        showDialog(data);
                    } else {
                        var value = 'branchId_' + data.branchId + '_' + data.submitType;
                        formHiddenInput.val(value);
                        submitForm();
                    }
                },
                fail: function fail(jqXHR, textStatus, errorThrown) {
                    showErrorDialog();
                }
            });
        } else {
            submitForm();
        }
    });

    // User selects a branch from the modal
    $(document).on("branchSearch.branchSelected", function (event, selectedBranchVal) {
        closeDialog();
        selectedBranchId = selectedBranchVal;
        var value = 'branchId_' + selectedBranchVal;
        formHiddenInput.val(value);
        (0, _prefferedBranchCookie2.default)().setPrefferedBranchId(parseInt(selectedBranchVal));
        submitForm();
    });
}

},{"../../foundation/scripts/preffered-branch-cookie":45,"./branch-search":10}],12:[function(require,module,exports){
'use strict';

+function ($) {
    'use strict';

    $(document).ready(function () {
        // This adjusts the top margin of the yellow call-to-action panel, so that half of it is hanging over the hero panel
        var $parent = $('[data-js="parent"]'),
            $child = $parent.find('[data-js="child"]'),
            nudge;

        if ($parent.length && $child.length) {
            nudge = 30 + $child.outerHeight() / 2;
            $child.css({
                'margin-top': '-' + nudge + 'px', // The 30 is the gutter on the previous element
                'position': 'relative',
                'z-index': 1
            });
        }
    });
}(jQuery);

},{}],13:[function(require,module,exports){
'use strict';

+function ($) {
    'use strict';

    $(document).ready(function () {
        // I appreciate the location of this file is a little bonkers (the JavaScript files
        // in the root of forms are not currently used) but Omar suggested it, and it made
        // sense at the time.
        // This controls the complicated relationship between two select boxes, a number
        // input field and their secret, hidden input field which actually gets sumbmitted
        // to the server. Think of it as a sexy French film from the 1980s.

        // The (simplified) markup structure looks like this:
        // <div data-js="date-picker-parent">
        //   <p><select/></p>
        //   <p><select/></p>
        //   <p><input/></p>
        //   <input type="hidden"/> <- Secret hidden field
        // </div>
        // This looks for the user having any interaction with any of the three elements
        // used to select a date - changing or tabbing through
        $('[data-js="date-picker-parent"] select, [data-js="date-picker-parent"] input[type="number"]').on("change blur", function (e) {
            var guid = $(this).attr('data-guid'),
                pickedDay = $('#day-' + guid).val(),
                pickedMonth = $('#month-' + guid).val(),
                pickedYear = $('#year-' + guid).val();
            // Populate the hidden input field with the values from the form fields, padded to appropriate values
            //Trigger a change after the value as updated as a hidden input will not fire an event
            $('#date-' + guid).val(pad(pickedDay, 10) + '/' + pad(pickedMonth, 10) + '/' + pad(pickedYear, 1000)).trigger("change");
            console.log("The current value of the hidden form field with a GUID of " + guid + " is " + $('#date-' + guid).val());
        });

        // Takes two numbers, an input and a example number of digits
        // 1 and 10 returns 01
        // 1 and 100 returns 001
        // 100 and 1 returns 100 (this is not a feature of this function)
        function pad(input, example) {
            input = Math.abs(input); // Bit of insurance
            var missingDigits,
                inputLength = input.toString().length,
                exampleLength = example.toString().length;
            // Hang on - that number's too short. Let's put some platform heels on it.
            if (inputLength < exampleLength) {
                missingDigits = exampleLength - inputLength;
                // Keep stacking those heels, until the number reaches the mark.
                for (var step = 0; step < missingDigits; step++) {
                    input = '0' + input;
                }
            }
            return input;
        }

        //Add a change event to the hidden input which holds the actual date to validate
        $(".FormAdvancedDateTime .ValidationRequired").on("change", function () {
            var $el = $(this);
            //if the validation fails/succeeds we need to add/remove the failed classes
            //Defense check as validate is activate/deactivated through the CMS
            if (typeof window.validate === 'function') {
                if (window.validate($el)) {
                    $el.closest(".FormAdvancedDateTime").removeClass("ValidationFail");
                } else {
                    $el.closest(".FormAdvancedDateTime").addClass("ValidationFail");
                }
            }
        });
    });
}(jQuery);

},{}],14:[function(require,module,exports){
'use strict';

+function ($) {
    'use strict';

    $(document).ready(function () {
        var maxDate = '+' + $('#max-date').val();
        $('[data-js="pickadate-picker"]').pickadate({
            // An integer (positive/negative) sets it relative to today.
            min: true,
            // `true` sets it to today. `false` removes any limits.
            max: +30,
            today: 'Select today'
        });
    });
}(jQuery);

},{}],15:[function(require,module,exports){
'use strict';

require('../../../foundation/scripts/vendor/jquery-ui-autocomplete.min');

+function ($) {
    'use strict';

    $(document).ready(function () {

        //Finds all search spreadsheet fields in the form, as the user can add in as many as they want
        var $searchField = $('[id*="data-input"]');

        // If a user selects an answer, then refreshes the page, that answer will still be in the search field,
        // due to the persistent nature of form fields. This will trigger autocomplete again, as soon as the
        // field receives focus.
        $searchField.focus(function () {
            //Once we know which form field the user is interacting with we can grab the id and populate the variables
            var $el = $(this);
            var id = $el.attr("name").replace("dummy", ""),
                $userFeedback = $('[data-js="user-feedback' + id + '"]'),
                $occId = $("#output-lookup" + id),
                $reset = $('[data-js="reset' + id + '"]'),
                $resultsList = $('.search-spreadsheet-element [data-js="autocomplete-results' + id + '"]'),
                $harlosh = $("#harlosh" + id);
            $el.autocomplete({

                // Adds NFUM classes to the jQuery UI elements
                classes: {
                    "ui-menu-item-wrapper": "btn btn-autocomplete"
                },
                appendTo: '[data-js="autocomplete-results' + id + '"]',
                source: function source(request, response) {
                    $.ajax({
                        url: "/searchspreadsheet/lookup",
                        dataType: "json",
                        data: {
                            search: request.term,
                            id: $occId.val()
                        },
                        success: function success(data) {
                            try {
                                var output = JSON.parse(data);
                                response($.map(output.Items, function (item) {
                                    return {
                                        value: item.Description,
                                        id: item.Code
                                    };
                                }));
                            } catch (e) {
                                //console.log("Catch error: " + e);
                            }
                            $reset.removeClass('u-hidden');
                            // No results
                            if (!JSON.parse(data).Items) {
                                $userFeedback.html('<p>No matches found. Please try a different job title.</p>');
                            } else {
                                // Results!
                                $userFeedback.html('');
                                // UI makes it the width of the page, for some reason. This makes it the width of the search field.
                                $('.ui-autocomplete').css('width', $searchField.outerWidth() + 'px');

                                //NR-318 add back in UI-styling on autocomplete results
                                $resultsList.find('li').each(function () {
                                    var initialContent = $(this).html();
                                    $(this).html('<div tabindex="-1" class="ui-menu-item-wrapper">' + initialContent + '</div>');
                                });
                            }
                        },
                        error: function error(XMLHttpRequest, textStatus, errorThrown) {
                            //console.log("Error function");
                        }
                    });
                },
                open: function open(event, ui) {
                    // NR-221
                    if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
                        $('.ui-autocomplete').off('menufocus hover mouseover mouseenter');
                    }
                },
                close: function close() {},
                focus: function focus(event, ui) {},
                minLength: 2,
                select: function select(event, ui) {
                    $harlosh.val(ui.item.value + "-" + ui.item.id);
                }
            });
            $el.removeClass('u-bg-search');
            $reset.removeClass('u-hidden');
            var searchString = this.value;
            if (searchString !== '') {
                $el.autocomplete('search', searchString);
            } else {
                $userFeedback.html('');
            }
        }).focusout(function () {
            //Once we know which form field the user is interacting with we can grab the id and populate the variables
            var $el = $(this);
            var id = $el.attr("name").replace("dummy", ""),
                $userFeedback = $('[data-js="user-feedback' + id + '"]'),
                $harlosh = $("#harlosh" + id),
                $reset = $('[data-js="reset' + id + '"]');
            var searchString = this.value;
            if (searchString === '') {
                $el.addClass('u-bg-search');
                $userFeedback.html('');
                // Hide the button type reset
                $reset.addClass('u-hidden');
            }
            if ($el.val() === '') {
                $harlosh.val('');
            }
        });
    }); // Ready
}(jQuery);

},{"../../../foundation/scripts/vendor/jquery-ui-autocomplete.min":51}],16:[function(require,module,exports){
'use strict';

var _lazyload = require('../../foundation/scripts/vendor/lazyload8');

var _lazyload2 = _interopRequireDefault(_lazyload);

var _matchHeight = require('../../foundation/scripts/match-height');

var _matchHeight2 = _interopRequireDefault(_matchHeight);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

+function ($) {
    'use strict';

    $(document).ready(function () {

        // This finds a candidate image then chooses the best possible alternate image to fit the current
        // container size. These alternate images are stored in a data-set attribute.
        // (the lazy loading plugin makes the assumption that you'd only want to swap one low-resolution
        // image for one high-resolution image, rather than choosing a best-fit image)
        function chooseBestImage() {
            $('img[data-set]').each(function () {
                // The width of the container of the current image
                var $that = $(this),
                    targetWidth = Math.round($that.parent().width()),
                    currentWidth = $that[0].naturalWidth,

                // For debug purposes
                data = {
                    "alt": $that.attr('alt'),
                    "targetWidth": targetWidth,
                    "currentWidth": currentWidth
                };
                //console.table(data);

                // Is the current image too small? Note that if the user already has a large image loaded
                // and resizes the browser down, they will hold onto the large image, saving a further
                // download.
                if (currentWidth < targetWidth) {
                    // The data-img attribute stores a series of sizes and paths of alternative images
                    var tempArray = $that.attr('data-set').split('|');

                    // Let's split this string into an object, so we can pull out the best fit image
                    // URL, once we know what the minimum size is we need.
                    // Although most browsers seem to arange objects automatically by size, this
                    // behaviour cannot be guarenteed.
                    var objImg = {};
                    tempArray.forEach(function (property) {
                        var imagePair = property.split(';');
                        objImg[imagePair[0]] = imagePair[1];
                    });
                    // This is just an Array of the image sizes. Although it seems mental to convert
                    // a string into an Array, then an object, then back into an Array again, the object
                    // will give us the URL of the new image, while this particular Array will give us
                    // the image sizes in an order which we can control.
                    var ArraySizes = [];
                    jQuery.each(objImg, function (i) {
                        ArraySizes.push(i);
                    });
                    // Sorts the Array into numeric order.
                    ArraySizes = ArraySizes.sort(function (a, b) {
                        return a - b;
                    });
                    var candidateSize = 0;

                    // This iterates through the Array of candidate sizes, from small to large, until it
                    // finds one which is larger than the targetWidth, then breaks out and stops.
                    ArraySizes.some(function (size) {
                        candidateSize = size;
                        return targetWidth <= size;
                    });
                    var newPath = objImg[candidateSize],
                        imgClass = $that.attr('class');
                    // Has lazyLoading already happened to this particular image?
                    if (imgClass.indexOf('lazy') > -1 && imgClass.indexOf('loaded') === -1) {
                        // Get the image ready for the plugin
                        $that.attr('data-src', newPath);
                    } else {
                        // Replace the image manually
                        $that.attr('src', newPath);
                    }
                    $.fn.matchHeight._update();
                }
            });
        }

        chooseBestImage();
        $(window).resize(function () {
            chooseBestImage();
            myLazyLoad.update();
            // This isn't working yet
            $.fn.matchHeight._update();
        });

        // Kick off lazy loading
        // https://www.andreaverlicchi.eu/lazyload/
        var myLazyLoad = new _lazyload2.default({
            elements_selector: ".lazy"
        });
    });
}(jQuery);

},{"../../foundation/scripts/match-height":42,"../../foundation/scripts/vendor/lazyload8":56}],17:[function(require,module,exports){
'use strict';

+function ($) {
    'use strict';

    $(document).ready(function () {

        // setTimeout pollyfill for IE9, because IE9 don't believe in no parameters.
        if (document.all && !window.setTimeout.isPolyfill) {
            var __nativeST__ = window.setTimeout;
            window.setTimeout = function (vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */) {
                var aArgs = Array.prototype.slice.call(arguments, 2);
                return __nativeST__(vCallback instanceof Function ? function () {
                    vCallback.apply(null, aArgs);
                } : vCallback, nDelay);
            };
            window.setTimeout.isPolyfill = true;
        }

        // Adds a class to the parent <li/>, if sub-navigation links which are usually hidden come into focus.
        $('.parent-content a').focus(function () {
            $(this).attr('aria-expanded', 'true').closest('.parent').addClass('show-child');
        }).blur(function () {
            $(this).attr('aria-expanded', 'false').closest('.parent').removeClass('show-child');
        });

        // A class of "done" *roughly* corresponds with the menu animation completing.
        function navHover($that) {
            $that.addClass('done');
        }

        var startMenu;
        // Adds / removes the class of "done", for use elsewhere.
        $('.parent-trigger').on('mouseover', function () {
            var $that = $(this);
            startMenu = setTimeout(navHover, 200, $that);
            $that.focus().attr('aria-expanded', 'true');
        }).on('mouseout', function () {
            clearTimeout(startMenu);
            $(this).removeClass('done').attr('aria-expanded', 'false');
        });

        // Some links from the Supplementary navigation need to move inside the main navigation, so they appear
        // there when our SmartPhone brothers and sisters poke at the hamburger menu with their sausage fingers.
        // I'm flip-reversing the results so when they end up in the <ul/>, they're the right way round. Blame prepend().
        $($('.supplementary-nav [data-js="sup-pre"]').get().reverse()).each(function () {
            var $that = $(this),
                oldClass = $that.attr('class');
            if (typeof oldClass === "undefined") {
                oldClass = '';
            }
            var newLink = '<li class="hidden-lg ' + oldClass + '">' + $that.html() + '</li>';
            $('.main-nav-ul').prepend(newLink);
        });

        // Some links have a sort of golden ticket, which means they get to jump to the front of the queue
        // I'M LOOKING AT YOU, FIND YOUR LOCAL AGENT.
        $($('.supplementary-nav [data-js="wonka"]').get()).each(function () {
            var $that = $(this),
                oldClass = $that.attr('class');
            if (typeof oldClass === "undefined") {
                oldClass = '';
            }
            var newLink = '<li class="hidden-lg ' + oldClass + '">' + $that.html() + '</li>';
            $('.main-nav-ul').prepend(newLink);
        });

        // These links appear after the natural main navigation links.
        $($('.supplementary-nav [data-js="sup-post"]').get()).each(function () {
            $('.main-nav .container').append('<p class="hidden-lg">' + $(this).html() + '</p>');
        });

        // OK, this is nasty. SiteImprove spots that the same link appears in the supplementary navigation and the
        // main navigation, so lists the link text as duplicate. This inserts a full-stop (which causes speech readers
        // to very briefly pause), to trick it into passing.
        $('.main-nav-ul .hidden-lg [itemprop="name"]').each(function () {
            $(this).append('<span class="u-sr-only">.</span>');
        });

        // The user clicks on a top-level navigation link, which has childen.
        $('.parent-trigger').on('click', function (e) {
            var $this = $(this),
                $target = $this.next();

            // Is the navigation in small screen mode? (rather than tying this code explicitly to breakpoints, look for the hamburger)
            if ($('.mobile-nav-trigger').is(':visible')) {
                if ($target.is(':visible')) {
                    // Hide menu
                    $target.slideUp();
                    $this.removeClass('open').attr('aria-expanded', 'false');
                    $($this.children('.u-sr-only')).text(' collapsed'); // extra information on navigation status for screen readers
                } else {
                    // Show menu
                    $target.slideDown();
                    $this.addClass('open').attr('aria-expanded', 'true');
                    $($this.children('.u-sr-only')).text(' open'); // extra information on navigation status for screen readers
                }
                return false;
            }
            // Some touch enabled devices fire a hover event just before the click event. This shows the sub-menu to the user, but doesn't
            // give them enough time to interact with it, as the browser starts to navigate to the next page automatically. The class of
            // 'done' is added after 0.2 seconds, which hopefully is enough time for the below to fire for touch devices.
            if (!$this.hasClass('done')) {
                // Putting the current link in focus should automatically show the menu
                $this.focus();
                return false;
            }
        });

        $('.primary-nav').on('click', function (e) {
            //The way the navigation is handled on mobile, we have to not fire on a primary-nav click when the mobile nav is visible.
            if ($('.mobile-nav-trigger').is(':hidden')) {
                window.dataLayer.push({
                    "event": "navigationInteractions",
                    "eventCategory": "Navigation Interactions",
                    "eventAction": "Primary Nav click",
                    "eventLabel": removeFullStop($(this).find('[itemprop="name"]').text())
                });
            }
        });

        //The way the navigation is handled on mobile, this is the equivalent of a primary-nav click
        $('.trigger-landing').on('click', function (e) {
            window.dataLayer.push({
                "event": "navigationInteractions",
                "eventCategory": "Navigation Interactions",
                "eventAction": "Primary Nav click",
                "eventLabel": removeFullStop($(this).find('[itemprop="name"]').text())
            });
        });

        $('.secondary-nav').on('click', function (e) {
            window.dataLayer.push({
                "event": "navigationInteractions",
                "eventCategory": "Navigation Interactions",
                "eventAction": "Secondary Nav click",
                "eventLabel": removeFullStop($(this).find('[itemprop="name"]').text())
            });
        });

        $('.mega-nav').on('click', function (e) {
            window.dataLayer.push({
                "event": "navigationInteractions",
                "eventCategory": "Navigation Interactions",
                "eventAction": "Mega Nav click",
                "eventLabel": removeFullStop($(this).find('[itemprop="name"]').text())
            });
        });

        //Including the Find your local office link as a Mega Nav Link
        $('.your-local-branch-trigger').on('click', function (e) {
            window.dataLayer.push({
                "event": "navigationInteractions",
                "eventCategory": "Navigation Interactions",
                "eventAction": "Mega Nav click",
                "eventLabel": removeFullStop($(this).find('[itemprop="name"]').text())
            });
        });

        // Removes the full-stop that was added as part of the nasty SiteImporve fix.
        function removeFullStop(text) {
            if (text[text.length - 1] === '.') {
                text = text.slice(0, -1);
            }
            return text;
        }
    });
}(jQuery);

},{}],18:[function(require,module,exports){
'use strict';

require('../../foundation/scripts/vendor/jquery-ui-autocomplete.min');

+function ($) {
    'use strict';

    $(document).ready(function () {

        var $userFeedback = $('[data-js="user-feedback"]'),
            $searchField = $("#occupations"),
            $occId = $("#outputLookup"),
            $reset = $('[data-js="reset"]'),
            $resultsList = $('.occupation-search-block [data-js="autocomplete-results"]');

        $searchField.autocomplete({
            // Adds NFUM classes to the jQuery UI elements
            classes: {
                "ui-menu-item-wrapper": "btn btn-autocomplete"
            },
            appendTo: '[data-js="autocomplete-results"]',
            source: function source(request, response) {
                $.ajax({
                    url: "/occupationautocomplete/lookup",
                    dataType: "json",
                    data: {
                        search: request.term
                    },
                    success: function success(data) {
                        try {
                            var output = JSON.parse(data);
                            response($.map(output.Items, function (item) {
                                return {
                                    value: item.Desc,
                                    id: item.Code
                                };
                            }));
                        } catch (e) {
                            //console.log("Catch error: " + e);
                        }
                        $reset.removeClass('u-hidden');
                        // No results
                        if (!JSON.parse(data).Items) {
                            $userFeedback.html('<p>No matches found. Please try a different job title.</p>');
                        } else {
                            // Results!
                            $userFeedback.html('');
                            // UI makes it the width of the page, for some reason. This makes it the width of the search field.
                            $('.ui-autocomplete').css('width', $searchField.outerWidth() + 'px');

                            //NR-318 add back in UI-styling on autocomplete results
                            $resultsList.find('li').each(function () {
                                var initialContent = $(this).html();
                                $(this).html('<div tabindex="-1" class="ui-menu-item-wrapper">' + initialContent + '</div>');
                            });
                        }
                    },
                    error: function error(XMLHttpRequest, textStatus, errorThrown) {
                        //console.log("Error function");
                    }
                });
            },
            //position: { my: "left top", at: "left bottom" },
            //collision: 'none', // Trying to get position() to behave
            open: function open(event, ui) {
                // NR-221
                if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
                    $('.ui-autocomplete').off('menufocus hover mouseover mouseenter');
                }
            },
            close: function close() {},
            focus: function focus(event, ui) {},
            minLength: 2,
            select: function select(event, ui) {
                // This fires when the user selects an option from the auto-complete.
                $.ajax({
                    url: "/occupationautocomplete/display",
                    dataType: "html",
                    data: {
                        code: ui.item.id,
                        id: $occId.val()
                    },
                    success: function success(data) {
                        try {
                            $userFeedback.html("<p class='u-flush'><br>Showing results for '" + $searchField.val() + "'</p>");
                            $('[data-js="result"]').html(data);
                        } catch (e) {
                            //console.log("Catch error 3: " + e);
                        }
                    },
                    error: function error(XMLHttpRequest, textStatus, errorThrown) {
                        //console.log(textStatus);
                    }
                });
            }
        });

        // If a user selects an answer, then refreshes the page, that answer will still be in the search field,
        // due to the persistent nature of form fields. This will trigger autocomplete again, as soon as the
        // field receives focus.
        $searchField.focus(function () {
            $searchField.removeClass('u-bg-search');
            $reset.removeClass('u-hidden');
            var searchString = this.value;
            if (searchString !== '') {
                $searchField.autocomplete('search', searchString);
            } else {
                $userFeedback.html('');
            }
        }).focusout(function () {
            var searchString = this.value;
            if (searchString === '') {
                $searchField.addClass('u-bg-search');
                $userFeedback.html('');
                // Hide the button type reset
                $reset.addClass('u-hidden');
            }
        });
    }); // Ready

    // This needs to happen after the positioning of the yellow call-to-action block
    // JavaScript in cta-block.js.
    $(window).bind("load", function () {
        // The template which this component sits within (ProductPage) is used elsewhere.
        // This ensures that the Occupation Search sits snugly against the hero panel,
        // even though the CSS is bristling with margins, in order to specifically
        // prevent this from happening.
        var hero = document.querySelector('.hero'),
            occupationSearch = document.querySelector('.occupation-search-block');

        function suckUpToHero() {
            if (typeof hero !== 'undefined' && hero !== null && typeof occupationSearch !== 'undefined' && occupationSearch !== null) {
                // If you don't reset the margin top before you measure the OffsetTop, any errors will be replicated.
                occupationSearch.style.marginTop = '0';
                var margin = getOffsetTop(occupationSearch) - getOffsetTop(hero) - hero.offsetHeight;
                occupationSearch.style.marginTop = '-' + margin + 'px';
            }
        }
        suckUpToHero();

        $(window).resize(function () {
            var resizeId;
            // To stop suckUpToHero() getting spammed endlessly.
            clearTimeout(resizeId);
            resizeId = setTimeout(suckUpToHero, 500);
        });

        // Pinched from https://gomakethings.com/how-to-get-an-elements-distance-from-the-top-of-the-page-with-vanilla-javascript/
        // Measures the *true* distance between the height of an element and the top of the page.
        function getOffsetTop(elem) {

            // Set our distance placeholder
            var distance = 0;

            // Loop up the DOM
            if (elem.offsetParent) {
                do {
                    distance += elem.offsetTop;
                    elem = elem.offsetParent;
                } while (elem);
            }

            // Return our distance
            return distance < 0 ? 0 : distance;
        }
    });
}(jQuery);

},{"../../foundation/scripts/vendor/jquery-ui-autocomplete.min":51}],19:[function(require,module,exports){
'use strict';

var _agencySearch = require('../contact-branch/agency-search');

var _agencySearch2 = _interopRequireDefault(_agencySearch);

var _prefferedBranchCookie = require('../../foundation/scripts/preffered-branch-cookie');

var _prefferedBranchCookie2 = _interopRequireDefault(_prefferedBranchCookie);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// Kicks off the Google map
+function ($, window) {
    'use strict';

    $(document).ready(function () {

        //If we don't have an Agency Selector then don't go any further 
        if ($(".AgencySelector").length === 0) {
            return;
        }

        var $postCodeField = $('#Postcode'),
            cookieBranchId = getCookie('pbId'),
            noBranch = true;

        //Hold Agency Selector Info
        var guid = "",
            submitType = "",
            introText = "",
            chooseText = "",
            feedbackText = "",
            queryPostcode = getUrlParameter('postcode');

        if (typeof window.AgencySelector !== "undefined" && typeof window.AgencySelector.items !== "undefined") {
            guid = window.AgencySelector.items[0].guid;
            submitType = window.AgencySelector.items[0].submitType;
            introText = window.AgencySelector.items[0].introText;
            chooseText = window.AgencySelector.items[0].chooseText;
            feedbackText = window.AgencySelector.items[0].feedbackText;
        }

        // Shows the yellow panel, which allows users to select a branch then
        // tried to prepopulate it with an accurate agency.
        function showAgencyChooser(html, postcode) {
            $('[data-js="postcode-agency-finder"]').html(html);
            (0, _agencySearch2.default)('agency-finder');
            // Steal what passes for a postcode, then submit the map search

            if (postcode !== undefined) {
                $('#branch-address').val(postcode);
            } else {
                $('#branch-address').val($postCodeField.val());
            }

            // Fake a search on the map postcode search
            window.searchClick(true);
            noBranch = false;
        }

        // AJAX fails, inform user?
        function showErrorDialog() {
            alert("ISSUE");
        }

        // This is for desktop users, who are perhaps more likely to use the tab key
        $postCodeField.on('blur', function () {
            // Has the user arrived on this page without a querystring?
            // (if a querystring is used, it can only be overridden by
            // manually chosing a new agency)
            if (!getCookie('pbId') && queryPostcode === '' && noBranch) {
                $(document).trigger("branchSearch.postcodeSearch");
            }
        });

        // NS-671 This is for mobile users, who aren't allowed keyboards.
        $postCodeField.on('keyup', function () {
            if ($postCodeField.val().length > 3 && !getCookie('pbId') && queryPostcode === '' && noBranch) {
                $(document).trigger("branchSearch.postcodeSearch");
            }
        });

        // This is a custom event, which is triggered in a number of different places
        // It takes the postcode field and uses it to generate the results markup.
        $(document).on('branchSearch.postcodeSearch', function (e, postcode) {
            if ($postCodeField.val() !== '' || postcode !== undefined) {
                $.ajax({
                    url: '/Forms/LocalAgency',
                    method: "POST",
                    data: {
                        routeToLocalBranch: true,
                        submitType: submitType,
                        introText: introText,
                        chooseText: chooseText,
                        feedbackText: feedbackText
                    },
                    postcode: postcode,
                    async: true,
                    success: function success(data) {
                        // MFW I have data, but no branch ID
                        if (data !== undefined && data.branchId === undefined) {
                            showAgencyChooser(data, this.postcode);
                        } else {
                            // Put together the branch id for the hidden input
                            var value = 'branchId_' + data.branchId + '_' + data.submitType;
                            // This variable isn't instigated properly - we need the GUID passed through
                            //$formHiddenInput.val(value);
                            submitForm();
                        }
                    },
                    fail: function fail(jqXHR, textStatus, errorThrown) {
                        showErrorDialog();
                    }
                });
            }
        });

        // When the page and map first loads, check if a valid postcode has been passed, via the querystring.
        if (queryPostcode !== '') {
            $(document).trigger("branchSearch.postcodeSearch", queryPostcode);
        } // User has a saved branch
        else if (cookieBranchId) {
                $.ajax({
                    url: '/forms/GetLocalBranchFromCookie',
                    method: "POST",
                    data: {
                        pbId: cookieBranchId
                    },
                    async: true,
                    success: function success(data) {

                        $(document).trigger("branchSearch.postcodeSearch", data.postcode);
                    },
                    fail: function fail(jqXHR, textStatus, errorThrown) {
                        showErrorDialog();
                    }
                });
            }

        // User selects a branch from the Agency Selector - Event fired from Branch Search
        $(document).on("branchSearch.agencySelected", function (event, selectedBranchVal, firstGo) {
            var value = 'branchId_' + selectedBranchVal;
            //Make sure we have an agency selector
            if (typeof window.AgencySelector !== "undefined" && typeof window.AgencySelector.items !== "undefined") {
                //Set the hidden value to the branch id
                $("#" + window.AgencySelector.items[0].guid).val(value);
            }

            // Set the branch id in a cookie
            // Don't set if:
            // It's the first run and we have a postcode in the url as we don't want to auto set the favourite on load 
            if (!firstGo && queryPostcode.length === 0) {
                (0, _prefferedBranchCookie2.default)().setPrefferedBranchId(parseInt(selectedBranchVal));
            }
        });

        // Pull specific parameters from the querystring, by asking for them by name.
        // Stolen from aframe.io
        function getUrlParameter(name) {
            name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
            var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
            var results = regex.exec(location.search);
            return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
        }

        // Used to check if the user already has a favourite branch set
        function getCookie(name) {
            var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
            return v ? v[2] : null;
        }
    });
}(jQuery, window);

},{"../../foundation/scripts/preffered-branch-cookie":45,"../contact-branch/agency-search":9}],20:[function(require,module,exports){
'use strict';

require('../../foundation/scripts/vendor/jquery-ui-autocomplete.min');

+function ($) {
    'use strict';

    $(document).ready(function () {
        // SEARCHBAR ELEMENTS
        var searchBar = $("#desktop-search");
        var searchBarInput = $('#search-form-input');
        var searchBarResults = searchBar.find('[data-js="results"]');
        var searchBarAutocompleteResults = searchBarResults.find('#autocomplete-results');
        var searchBarAutocompleteNoResults = searchBarResults.find('#autocomplete-no-results');
        var viewAllResult = searchBarResults.find('[data-js="all-search-results"]');
        searchBarInput.focus(searchAutocomplete);

        function updateViewAllResultLink(value) {
            value = encodeURIComponent(value);
            var url = viewAllResult.attr('data-searcher') + '?q=' + value;
            viewAllResult.attr('href', url);
        }

        // If the user clicks anywhere outside of the search bar or the autocomplete results, close the search.
        $(document).click(function (event) {
            if (!$(event.target).closest('[data-js="search"]').length) {
                if ($('[data-js="search"]').is(":visible")) {
                    $('[href="#desktop-search"]').click();
                }
            }
        });

        function searchAutocomplete() {

            // The user is typing! Panic!
            searchBarInput.keyup(function () {
                if (searchBarInput.val().length === 0) {
                    searchBarResults.slideUp('fast');
                }
                updateViewAllResultLink($(this).val());
            });

            $.widget("custom.catcomplete", $.ui.autocomplete, {
                _create: function _create(event, ui) {
                    this._super();
                    // Not sure what this is.
                    this.widget().menu("option", "items", "> :not(.ui-autocomplete-category)");
                },
                _renderItem: function _renderItem(ul, item) {
                    return $("<li>").data("item.autocomplete", item)
                    // These links get added inside list items.
                    .append('<a href="' + item.link + '" class="btn btn-autocomplete">' + item.title + '</a>').appendTo(ul);
                },
                _renderMenu: function _renderMenu(ul, items) {
                    var that = this,
                        currentGroup = "";
                    $.each(items, function (index, item) {
                        var li;
                        // This is the sort of heading for each group of links, for example "Products".
                        if (item.group != currentGroup) {
                            ul.append('<li class="h4">' + item.group + '</li>');
                            currentGroup = item.group;
                        }
                        li = that._renderItemData(ul, item);
                        if (item.group && item.name) {
                            li.attr("aria-label", item.group + " : " + item.name);
                        }
                    });
                }
            });

            searchBarInput.catcomplete({
                appendTo: searchBarAutocompleteResults,
                delay: 0,
                messages: {
                    noResults: function noResults() {
                        searchBarResults.slideDown('fast');
                        searchBarAutocompleteResults.hide();
                        searchBarAutocompleteNoResults.show();
                        viewAllResult.parents('.all-search-results').hide();
                    },
                    results: function results() {
                        searchBarAutocompleteResults.show();
                        searchBarAutocompleteNoResults.hide();
                        viewAllResult.parents('.all-search-results').show();
                    }
                },
                minLength: 3,
                open: function open() {
                    $("#autocomplete-results > ul").addClass('active').removeAttr('tabindex');
                    searchBarResults.slideDown('fast');
                    // searchBarAutocompleteResults
                    searchBarAutocompleteResults.show();
                },
                source: function source(request, response) {
                    $.ajax({
                        url: "/FindBase/All",
                        method: "POST",
                        data: JSON.stringify({
                            pageSize: 5,
                            startPage: 0,
                            queryString: searchBarInput.val()
                        }),
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function success(data) {
                            response(data.length === 1 && data[0].length === 0 ? [] : data);
                        },
                        fail: function fail(data, errorThrown) {
                            alert('request failed');
                        }
                    });
                }
            });
        }

        updateViewAllResultLink("");
    });
}(jQuery);

},{"../../foundation/scripts/vendor/jquery-ui-autocomplete.min":51}],21:[function(require,module,exports){
'use strict';

var _searchBar = require('./search-bar');

var _searchBar2 = _interopRequireDefault(_searchBar);

var _searchResults = require('./search-results');

var _searchResults2 = _interopRequireDefault(_searchResults);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

},{"./search-bar":20,"./search-results":22}],22:[function(require,module,exports){
'use strict';

var _getParameter = require('../url-parameters/get-parameter');

var _getParameter2 = _interopRequireDefault(_getParameter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

//CHECK FOR ADDRESS IN URL
var query = (0, _getParameter2.default)('q');
if (query) {
    $('#search-term').val(query);
}

$('.search-find-form-submit').click(function (e) {
    e.preventDefault();
    window.location.href = '/Search/?q=' + $('#search-term').val() + '&p=1';
});

},{"../url-parameters/get-parameter":30}],23:[function(require,module,exports){
'use strict';

+function ($) {
    'use strict';

    $(document).ready(function (e) {
        // This is the social sharing widget. It's found on article pages.
        $('[data-js="social-share"] a').click(function () {
            // Everything before the querystring is stored in the href.
            var platform = $(this).attr('href'),
                pageTitle = encodeURIComponent(document.title),
                currentURL = encodeURIComponent(location),
                destination,
                id = $(this).attr('id');

            // This builds the final URL which we want to punt the user off to.
            switch (platform) {
                case 'https://www.facebook.com/sharer/sharer.php':
                    destination = platform + '?u=' + currentURL;
                    break;
                case 'https://twitter.com/share':
                    destination = platform + '?url=' + currentURL + '&amp;text=' + pageTitle;
                    break;
                case 'https://www.linkedin.com/sharing/share-offsite':
                    destination = platform + '?url=' + currentURL + '&amp;title=' + pageTitle;
                    break;
                case 'mailto:':
                    destination = platform + '?&amp;subject=' + pageTitle + '&amp;body=' + currentURL;
                    break;
            }

            // If it's a proper URL, open in a new window
            if (destination.lastIndexOf('http', 0) !== -1) {
                window.open(destination, '_blank');
            } else {
                // If it's an email, don't open a pointless new tab.
                window.location.href = destination;
            }

            // This script might be called in an environment where Google Tag Manager isn't running.
            if (typeof dataLayer !== "undefined") {
                dataLayer.push({
                    "event": "socialShare",
                    "socialNetwork": id
                });
            }

            return false;
        });
    });
}(jQuery);

},{}],24:[function(require,module,exports){
'use strict';

+function ($) {
    'use strict';

    $(document).ready(function () {
        // The search bar needs to appear at the bottom of the navigation bar. This is a simple task for
        // css, using position: relative, but it also needs one of those tinted backgrounds which covers
        // the whole page, apart from the header. The bottom of the header is not a fixed height from
        // the top of the page, unfortunately: it changes depending upon if there is a warning message
        // or not.
        $('[href="#desktop-search"]').click(function () {
            var $mainNav = $('.main-nav'),
                $search = $('#desktop-search');
            if ($search.length && $mainNav.length) {
                var coords = $mainNav.offset().top + $mainNav.outerHeight(true);
                $search.css('top', Math.round(coords));
            }
        });

        // The mobile navigation uses a checkbox to show and hide the whole navigation panel. Unfortunately,
        // because it's hiding the panel by sliding it out of the viewport, speech browsers can still see it
        // and users can still navigate through it via the keyboard. This calls for JAVASCRIPT!

        var $navToggleLabel = $('[for="mobile-nav-toggle"]'),
            $navToggleCheck = $('#mobile-nav-toggle'),
            $mainNav = $('.main-nav');

        // The burger menu is inside a label tag.
        $navToggleLabel.click(function () {
            var $that = $(this);

            // Do we need to close the nav?
            if ($that.hasClass('open')) {
                $that.removeClass('open');
                $mainNav.animate({
                    'opacity': .99,
                    'left': '-100%'
                }, 500, function () {
                    navClosed();
                });
                // Open the nav
            } else {
                $that.addClass('open');
                $mainNav.css('display', 'block').animate({
                    'opacity': 1,
                    'left': '0%'
                }, 500, function () {
                    navOpen();
                });
            }
            return false;
        });

        // We also want all of the above to happen when the label is in focus and the user hits space or enter.
        $('body').keyup(function (e) {
            var elID = document.activeElement.getAttribute('id');
            // Is the nav checkbox in focus (this shouldn't be possible!) and has the user hit either space or enter?
            if (elID === 'mobile-nav-toggle' && (e.keyCode === 32 || e.keyCode === 13)) {
                $('[for="' + elID + '"]').click();
            }
        });

        // If the user tabs out of the main navigation, it needs to close.
        $('.main-nav').focusout(function (e) {
            if (e.target.className.indexOf('mobile-nav-trigger') > -1) {
                $('[for="mobile-nav-toggle"]').click();
            }
        });

        // NR-138 - Trigger the mobile nav 

        // Check to see if the mobile navigation is active
        function navActive() {
            if ($('.active').length > 0) {
                $('.main-nav').attr('aria-hidden', 'false');
                $('.mobile-nav-name').html('Hide navigation');
            } else {
                $('.main-nav').attr('aria-hidden', 'true');
                $('.mobile-nav-name').html('Show navigation');
            }
        }

        // [data-js="close"]

        // Toggle active state of navigation on click
        $('[data-js="mobile-nav-trigger"]').on('click', function () {
            var $that = $(this),
                $srText = $that.find('.u-sr-only');
            $('.main-nav').toggleClass('active');
            // NR-195
            if ($that.hasClass('open')) {
                $srText.html('Show navigation');
            } else {
                $srText.html('Hide navigation');
            }
            $that.toggleClass('open');
            navActive();
        });

        // There's a bunch of stuff which needs to happen, to make the slidy mobile navigation accessible.
        // helpfully, I've encapsulated it all in this function.
        function navClosed() {
            // Are we in mobile view? Should the nav be showing?
            if ($navToggleLabel.is(':visible') && !$navToggleLabel.hasClass('open')) {

                $navToggleLabel.attr({
                    'taborder': '0',
                    'tabindex': '1',
                    'title': 'Show main navigation',
                    'aria-label': 'Show main navigation',
                    'role': 'button',
                    'aria-pressed': false
                });
                $navToggleCheck.attr({
                    'taborder': '-1',
                    'aria-hidden': true
                });
                $mainNav.attr({
                    'aria-hidden': true
                }).css({
                    'left': '-100%',
                    'opacity': .99,
                    'transform': 'translateX(0)',
                    '-webkit-transform': 'translateX(0)'
                });
                $('#mobile-nav-toggle').prop('checked', false);
            } else {
                navOpen();
            }
        }
        navClosed();
        $(window).resize(function () {
            navClosed();
        });

        function navOpen() {
            $navToggleLabel.attr({
                'title': 'Hide main navigation',
                'aria-label': 'Hide main navigation',
                'aria-pressed': true
            });
            $mainNav.attr('aria-hidden', 'false');
        }
    });
}(jQuery);

},{}],25:[function(require,module,exports){
'use strict';

// NR-195: Belt and braces, mate. Belt and braces.
// Sorry - just to explain, this ensures that the focus moves to the #main element
// even though it's got a tabindex of -1.
//NR-321 adding the tabindex -1
$('[data-js="skip"]').click(function () {
    var $target = $($(this).attr('href'));
    if ($target.length) {
        $target.attr('tabindex', '-1').focus();
    }
});

},{}],26:[function(require,module,exports){
'use strict';

+function ($) {
    'use strict';

    // All the secret, hidden radio buttons which control the tab set

    var tabRadios = document.querySelectorAll('[name="tabs"]'),
        tabPanels = document.querySelectorAll('[role="tabpanel"]');

    // Are there even tabs on this page?
    if (tabRadios.length && tabPanels.length) {

        // The page tabs are a set of labels which extend to the full available width. But UX don't want them wrapping under any circumstances.
        // This function detects when this happens and swops the tabs for a select box, quicksmart.
        var tabReplace = function tabReplace() {
            var $tabGroup = $('.tabs-group'),
                $tabSelect = $('[data-js="tab-compact"]'),
                groupOffset = $tabGroup.offset().top,
                // The distance between the set of tabs and the top of the page.
            tabWrap = false;

            $tabGroup.find('.btn').each(function () {
                // Is this button the same distance from the top of the page as the tab set itself?
                if ($(this).offset().top > groupOffset) {
                    tabWrap = true;
                }
            });
            // I make two assumptions here:
            // 1) The website reading order is left-to-right
            // 2) The markup is ordered such that the last tabs will also appear last in the markup.
            if (tabWrap) {
                $tabSelect.removeClass('u-background').removeAttr('tabindex');
                $tabGroup.addClass('u-background').attr('tabindex', '-1');
            } else {
                $tabSelect.addClass('u-background').attr('tabindex', '-1');
                $tabGroup.removeClass('u-background').removeAttr('tabindex');
            }
        };

        $(document).ready(function () {

            // Used to build the tabs fallback, should the user suffer the indignity of wrapping tabs.
            var selectHTML = '<select name="select-' + tabRadios[0].name + '" id="select-' + tabRadios[0].name + '" data-js="tab-compact" class="u-background">';

            for (var i = 0; i < tabRadios.length; i++) {

                // We need to fiddle about with the markup, when the radio buttons change.
                tabRadios[i].oninput = function () {
                    for (var j = 0; j < tabRadios.length; j++) {
                        // Set aria-selected on all radio buttons to false
                        tabRadios[j].setAttribute('aria-selected', false);
                        // Set the "hidden" attribute of all the tab panels
                        tabPanels[j].setAttribute('hidden', 'hidden');
                    }
                    // Set aria-selected on *this* radio button to true
                    this.setAttribute('aria-selected', true);
                    // Removes the "hidden" attribute on the currently selected tab pane
                    // (it needs a looser selector, due to multiple ID attribute values on the same element on the branches page)
                    document.querySelector('[id~="' + this.getAttribute('aria-controls') + '"]').removeAttribute('hidden');
                };

                // Keyboard navigation in the tab set.
                tabRadios[i].addEventListener('keydown', function (e) {
                    var oldKey = e.keyCode,
                        newKey = e.key;
                    // User hits home to move to the first tab
                    if (newKey === 'Home' || oldKey === 36) {
                        e.preventDefault();
                        var radio1 = tabRadios.item(0);
                        radio1.focus();
                        radio1.click();
                    }
                    // User hits the end key, to move to the last tab
                    else if (newKey === 'End' || oldKey === 35) {
                            e.preventDefault();
                            var radioLast = tabRadios.item(tabRadios.length - 1);
                            radioLast.focus();
                            radioLast.click();
                        }
                });

                // This builds a select box, which replaces the tab set if the unimaginable happens: the tabs start to wrap.
                selectHTML += '<option value="' + tabRadios[i].id + '">' + document.querySelector('[for="' + tabRadios[i].id + '"]').textContent + '</option>';
            }
            selectHTML += '</select>';
            $('.tabs-group').before(selectHTML);
            // This ensures that any change to the select box is reflected in the radio buttons,
            // avoiding the need to rewrite the show / hide guff above.
            $('[data-js="tab-compact"]').change(function (e) {
                $('#' + e.currentTarget.value).trigger('click');
            });
            // OK, so Design don't like the look of tabs wrapping, so they want to replace them with a select box.
            // The only way to detect when tabs wrap is JavaScript, so here we are.
            tabReplace();
        }); // ready

        $(window).resize(function () {
            tabReplace();
        });
    } // if
}(jQuery);

},{}],27:[function(require,module,exports){
'use strict';

+function ($) {
    'use strict';

    $(document).ready(function () {

        // This is used to truncate descriptions on the team member pages, if
        // they get too waffly.
        function truncateProfileDesc(items) {

            $(items).each(function () {

                var text = $(this).find('[data-js="description"]');
                var triggerParent = $(this).find('[data-js="toggle-description"]');
                var trigger = triggerParent.find('a');
                var textLimit = 250;

                if (text.text().length > textLimit) {
                    triggerParent.show();
                    var longDesc = text.html();
                    var textLimit = longDesc.slice(0, textLimit).lastIndexOf(' ');
                    var shortDesc = longDesc.slice(0, textLimit) + '...';
                    text.html(shortDesc);
                    trigger.click(function () {
                        if (trigger.hasClass('u-svg-spin')) {
                            text.html(shortDesc);
                            trigger.removeClass('u-svg-spin').find(".txt").text('Expand text');
                        } else {
                            text.html(longDesc);
                            trigger.addClass('u-svg-spin').find(".txt").text('Collapse text');
                        }
                        return false;
                    });
                }
            });
        }
        truncateProfileDesc('[data-js="team-member"]');
    });
}(jQuery);

},{}],28:[function(require,module,exports){
'use strict';

+function ($) {
    'use strict';

    $(document).ready(function () {

        /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
        | Toggle any hashlink with a class of toggle-link. Assumes that there's a jump link             |
        | relationship between link and target. Markup structure and nesting is not important.          |
        |                                                                                               |
        | Example markup:                                                                               |
        | <p><a href="#my-target" data-open="Open" data-close="Close" data-js="toggle">Open</a></p>     |
        | <p id="my-target" class="js-hide">More information here</p>                                   |
        \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
        $(document).on('click', '[data-js="toggle"]', function (e) {
            var togLink = $(this);
            // Has the rel been used correctly?
            if (togLink.attr('href').indexOf('#') != -1) {
                var target = $(togLink.attr('href').substring(togLink.attr('href').indexOf("#"))),
                    openTxt = togLink.attr('data-open'),
                    closeTxt = togLink.attr('data-close'),
                    txtString = togLink.attr('data-string');
                // Does the target exist, and is it currently hidden?
                if (target.length && target.is(':hidden')) {
                    target.slideDown('400', function () {
                        if ($.fn.matchHeight) {
                            $.fn.matchHeight._update();
                        }
                        target.addClass('open');
                    });
                    if (txtString !== '' && closeTxt !== '') togLink.find(txtString).html(closeTxt);else if (closeTxt !== '') togLink.html(closeTxt);
                    togLink.addClass('open');
                } else if (target.length) {
                    target.removeClass('open');
                    target.slideUp('400', function () {
                        if ($.fn.matchHeight) {
                            $.fn.matchHeight._update();
                        }
                    });
                    if (txtString !== '' && openTxt !== '') togLink.find(txtString).html(openTxt);else if (openTxt !== '') togLink.html(openTxt);
                    togLink.removeClass('open');
                }
                return false;
            }
        });
    });
}(jQuery);

},{}],29:[function(require,module,exports){
'use strict';

// Used in forms
+function ($) {
    'use strict';

    // arTips is an array of all valid tooltip IDs on the page.

    var arTips = [],
        $tipTriggers = $('[data-js="tooltip-trigger"]');

    $tipTriggers.each(function () {
        var $that = $(this),
            targetID = $that.attr('aria-describedby'),
            valid = false,
            $target = $('#' + targetID);
        // Does this trigger have a valid target?
        // Has it been added to the page twice ?
        if ($target.length && inArray(targetID, arTips)) {
            // Both tip and target are valid
            arTips.push(targetID);
            valid = true;
        }
        // Should any of them be displayed by default?
        if (valid && $target.attr('aria-hidden')) {
            $target.attr('hidden', 'hidden');
        }
    });

    // User clicks on (i)
    $('[data-js="tooltip-trigger"]').click(function () {
        var $that = $(this),
            targetID = $that.attr('aria-describedby'),
            $target = $('#' + targetID);
        // Does this click make sense?
        if ($target.length) {
            // Is the tool tip in question hidden?
            if ($target.attr('aria-hidden') === 'true') {
                hideToolTips(targetID);
                // Show the tool tip
                $target.attr('aria-hidden', 'false').removeAttr('hidden');
                $that.addClass('active');
            } else {
                hideToolTips();
            }
        }
    });

    // User clicks on ×
    $('[data-js="tooltip-close"]').click(function () {
        hideToolTips();
    });

    // User panics, because the tooltip is frightening
    document.onkeydown = function (evt) {
        evt = evt || window.event;
        var isEscape = false;
        if ("key" in evt) {
            isEscape = evt.key === "Escape" || evt.key === "Esc";
        } else {
            isEscape = evt.keyCode === 27;
        }
        if (isEscape) {
            hideToolTips();
        }
    };

    // This hides all tooltips *except* the one with the matching ID passed as a parameter.
    function hideToolTips(exception) {
        for (var i = 0; i < arTips.length; i++) {
            if (arTips[i] !== exception) {
                $('#' + arTips[i]).attr({
                    'hidden': 'hidden',
                    'aria-hidden': 'true'
                });
                // Tidy up the (i)
                $('[aria-describedby="' + arTips[i] + '"]').removeClass('active');
            }
        }
    }

    // Check if string is present in Array
    function inArray(string, array) {
        for (var i = 0; i < array.length; i++) {
            if (array[i] === string) {
                return i;
            }
        }
        return -1;
    }
}(jQuery);

},{}],30:[function(require,module,exports){
"use strict";

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = getParameterByName;
// GET URL PARAMETERS
function getParameterByName(name, url) {
    if (!url) url = window.location.href;
    name = name.replace(/[\[\]]/g, "\\$&");
    var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
        results = regex.exec(url);
    if (!results) return null;
    if (!results[2]) return '';
    return decodeURIComponent(results[2].replace(/\+/g, " "));
}

},{}],31:[function(require,module,exports){
"use strict";

var _cookieUtils = require("../../foundation/scripts/cookie-utils");

var _cookieUtils2 = _interopRequireDefault(_cookieUtils);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var cookieExpiration = new Date(new Date().getTime() + 180 * 24 * 60 * 60 * 1000);
var upVote = function upVote(data, success) {
    return apiCall("/faqfeedback/up/", "POST", data, success);
};
var downVote = function downVote(data, success) {
    return apiCall("/faqfeedback/down/", "POST", data, success);
};
var loadVotes = function loadVotes(data, success) {
    return apiCall("/faqfeedback/data/", "POST", data, success);
};
var token = $('input[name="__RequestVerificationToken"]').val();

var apiCall = function apiCall(url, type, data, _success) {
    data['__RequestVerificationToken'] = token;
    $.ajax({
        type: type,
        data: data,
        url: url,
        success: function success(result) {
            if (result) _success(result);
        }
    });
};
var disableButtons = function disableButtons(upBtn, downBtn) {
    upBtn.attr('disabled', 'disabled');
    downBtn.attr('disabled', 'disabled');
};

var buttonClicked = function buttonClicked(upBtn, downBtn) {
    if (upBtn) {
        upBtn.addClass('clicked');
    } else {
        downBtn.addClass('clicked');
    }
};

+function ($) {
    'use strict';

    $(document).ready(function () {
        var $accordion = $('.accordion'),
            $items = $accordion.find('[data-accordion-feedback]'),
            idList = { values: $.map($items, function (i) {
                return $(i).data('accordion-feedback');
            }) };

        var cookieName = 'accordion-feedback';
        var cookieCategory = _cookieUtils2.default.categories.functional;
        var cookiesAllowed = _cookieUtils2.default.checkCategoryAllowed(cookieCategory);

        if (!$items.length || !cookiesAllowed) {
            $items.hide();
            return;
        }

        var accordionVotingCookie = _cookieUtils2.default.getCookie(cookieName, cookieCategory);
        var votedItems = JSON.parse(accordionVotingCookie || '[]');

        loadVotes(idList, function (data) {
            $.map($items, function (item) {
                var $item = $(item),
                    itemId = $item.data('accordion-feedback'),
                    result = $.grep(data, function (o) {
                    return o.Id === itemId;
                })[0] || {};

                var itemResult = {
                    id: itemId,
                    up: result.UpVotes || 0,
                    down: result.DownVotes || 0
                };

                var buttons = $item.find('button'),
                    $upBtn = $(buttons[0]),
                    $downBtn = $(buttons[1]),
                    $upVotes = $item.find('[data-voting-yes]'),
                    $downVotes = $item.find('[data-voting-no]');

                $upVotes.text(itemResult.up);
                $downVotes.text(itemResult.down);

                if (votedItems.indexOf(itemId) !== -1) {
                    disableButtons($upBtn, $downBtn);
                } else {
                    $upBtn.click(function () {
                        upVote({ id: itemId }, function (result) {
                            itemResult.up++;
                            $upVotes.text(itemResult.up);

                            votedItems.push(itemId);
                            _cookieUtils2.default.setCookie(cookieCategory, cookieName, JSON.stringify(votedItems), cookieExpiration.toUTCString());

                            disableButtons($upBtn, $downBtn);
                            buttonClicked($upBtn);
                            window.dataLayer.push({
                                "event": "faqFeedback",
                                "eventCategory": "FAQ feedback",
                                "eventAction": "Positive",
                                "eventLabel": $upVotes.parents('.AccordionItem__accordionContent').siblings('.AccordionItem__accordionTrigger').text()
                            });
                        });
                    });
                    $downBtn.click(function () {
                        downVote({ id: itemId }, function (result) {
                            itemResult.down++;
                            $downVotes.text(itemResult.down);

                            votedItems.push(itemId);
                            _cookieUtils2.default.setCookie(cookieCategory, cookieName, JSON.stringify(votedItems), cookieExpiration.toUTCString());

                            disableButtons($upBtn, $downBtn);
                            buttonClicked($downBtn);
                            window.dataLayer.push({
                                "event": "faqFeedback",
                                "eventCategory": "FAQ feedback",
                                "eventAction": "Negative",
                                "eventLabel": $downVotes.parents('.AccordionItem__accordionContent').siblings('.AccordionItem__accordionTrigger').text()
                            });
                        });
                    });
                }
            });
        });
    });
}(jQuery);

},{"../../foundation/scripts/cookie-utils":39}],32:[function(require,module,exports){
'use strict';

var _cookieUtils = require('../../foundation/scripts/cookie-utils');

var _cookieUtils2 = _interopRequireDefault(_cookieUtils);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

+function ($) {
    'use strict';

    //warning wrapper

    var message = $('[data-js="warning-message"]'),
        search = $('.desktop-search');

    var category = _cookieUtils2.default.categories.functional;

    if (document.cookie.indexOf("warningBannerDismiss=") < 1) {
        message.css("display", "block");

        //fix search box postion bug when banner is on
        if (message.length > 0) {
            search.addClass('warning-repos');
        }
        //warning banner close button function
        message.on('click', '[data-js="close"]', function () {

            //set cookie for whole domain so banner doesnt re-show for 24h irrespective of page
            var expiry = new Date();
            expiry.setTime(expiry.getTime() + 24 * 60 * 60 * 1000);
            _cookieUtils2.default.setCookie(category, "warningBannerDismiss", "yes", expiry.toGMTString(), "/");

            //reposition search box when warning dismissed
            search.removeClass('warning-repos');

            //remove warning
            $(this).closest(message).remove();
        });
    } else {
        //if cookie exists trash warning element
        message.remove();
    }

    function fixLint() {
        var lintFix = handleLintIssue();
    }
}(jQuery);

},{"../../foundation/scripts/cookie-utils":39}],33:[function(require,module,exports){
'use strict';

var _utilities = require('./utilities.js');

var util = _interopRequireWildcard(_utilities);

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

+function () {
    'use strict';

    var settings = {
        accordionGroup: '[data-accordion-group="true"]',
        accordionItem: '[data-accordion-item]',
        accordionContent: '[data-accordion-content]',
        accordionTrigger: '[data-accordion-trigger]',
        openClass: 'js-open',
        closeClass: 'js-close'
    };

    //do we have accordion groups?
    var accordionGroups = document.querySelectorAll(settings.accordionGroup);

    if (accordionGroups.length > 0) {
        Array.prototype.forEach.call(accordionGroups, function (el, i) {

            var group = el,
                accordionItems = group.querySelectorAll(settings.accordionItem),
                expandedItems = group.querySelectorAll('.' + settings.openClass);

            //if windowHash in link open and scroll to that item
            if (window.location.hash !== "") {

                var matchString = window.location.hash.replace('#', ''),
                    trigger = group.querySelector('[data-deep-link="' + matchString + '"]');

                if (trigger !== null) {
                    var block = trigger.parentNode.querySelector(settings.accordionContent);
                    openAccordion(block, trigger, accordionItems);
                    trigger.scrollIntoView();
                }
            }
            //if no items set to open open the first item
            else if (expandedItems.length === 0) {
                    Array.prototype.forEach.call(accordionItems, function (el, i) {
                        var item = el,
                            block = el.querySelectorAll(settings.accordionContent)[0],
                            trigger = el.querySelectorAll(settings.accordionTrigger)[0];

                        if (i === 0) {
                            openAccordion(block, trigger);
                        } else {

                            closeAccordion(block, trigger);
                        }
                    });
                }

            //open and close functionality for trigger
            Array.prototype.forEach.call(accordionItems, function (el, i) {
                var item = el,
                    block = el.querySelectorAll(settings.accordionContent)[0],
                    trigger = el.querySelectorAll(settings.accordionTrigger)[0];

                trigger.addEventListener('click', changeAccordionState);
                trigger.addEventListener('keypress', changeAccordionState);

                function changeAccordionState(e) {
                    e.preventDefault();
                    //respond to enter
                    if (e.type === "keypress") {
                        //if not enter key press break out
                        if (e.which !== 13) {
                            return;
                        }
                    }

                    if (block.classList.contains(settings.openClass)) {
                        closeAccordion(block, trigger);
                        util.removeHash();
                    } else {
                        openAccordion(block, trigger, accordionItems);
                        window.location.hash = trigger.getAttribute('data-deep-link');
                    }
                }
            });
        });
    }

    function openAccordion(block, trigger, accordionItems) {
        //on opening an accordion if the group is also passed in close these items. 
        if (accordionItems !== undefined) {
            if (accordionItems.length > 1) {
                Array.prototype.forEach.call(accordionItems, function (el, i) {
                    var block = el.querySelectorAll(settings.accordionContent)[0],
                        trigger = el.querySelectorAll(settings.accordionTrigger)[0];

                    closeAccordion(block, trigger);
                });
            }
        }
        //do all the classes and aria/sr stuff to open accordion 
        $("#" + block.id).slideDown();
        var objele = "a[href = '#" + block.id + "']";
        var tele = document.querySelector(objele);
        if (!isInViewport(tele)) {
            //console.log('not in Viewport');
            tele.scrollIntoView({
                behavior: 'smooth'
            });
        } else {
            //console.log('in Viewport');
        }

        block.classList.add(settings.openClass);
        block.classList.remove(settings.closeClass);
        block.setAttribute('aria-hidden', 'false');
        trigger.setAttribute('aria-expanded', 'true');
        util.removeAttributes(block.querySelectorAll('a'), 'tabindex');
    }
    function isInViewport(el) {
        var rect = el.getBoundingClientRect();
        return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
    }

    function closeAccordion(block, trigger) {

        //do all the classes and aria/sr stuff to close accordion
        $("#" + block.id).slideUp();
        block.classList.remove(settings.openClass);
        block.classList.add(settings.closeClass);
        block.setAttribute('aria-hidden', 'true');
        trigger.setAttribute('aria-expanded', 'false');
        trigger.setAttribute('role', 'button');
    }
}();

},{"./utilities.js":47}],34:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = addressLookup;
function addressLookup(addressSearchId) {

    var $addressInput = $(addressSearchId),
        addressInputResults = '<p class="addressInputResults"><select class="addressInputDropdown"></select></p>';

    setupProgressiveListeners();

    // Open up the manual address input when the form is submitted so the user can see any validation messages
    $addressInput.closest('form').find('button[type="submit"]').on('click', function () {
        if ($addressInput.is(':visible')) {
            manualAddress('show');
            // Gets rid of "Or enter your address manually"
            $('[data-js="show-address"]').parent().remove();
        }
    });
    // STYLING ADDRESS LOOKUP
    stylingAddressLookup($('[data-is-lookup="True"]'));

    if ($('#AddressSearch').length > 0) {
        addressSearchExtras();
    }

    // User is typing in the postcode search box - NFUM-1781 diabling this as it is confusing for the end user
    $addressInput.keyup(function (e) {
        // Is the search string long enough?
        //getAddress('/Postcode/AddressLookup', {
        //    text: $addressInput.val(),
        //    container: ''
        //}, true);
        //if (e.which === 13 && $addressInput.val().length > 3) {
        //    getAddress('/Postcode/AddressLookup', {
        //        text: $addressInput.val(),
        //        container: ''
        //    }, true);
        //}
        //return e.which !== 13;
    });

    // USED FUNCTIONS:

    // targetURL  - the API URL
    // targetData - an object, containing the ID for the agency
    // dropdown   - boolean. Used to distingush between the first
    //              search (AddressLookup) and the second
    //              (AddressRetrieve)
    function getAddress(targetURL, targetData, dropdown) {
        $.ajax({
            url: targetURL,
            method: "POST",
            data: targetData,
            async: true
        }).done(function (data) {
            var jsonResults = JSON.parse(data);

            //Check if we have results to use
            if (jsonResults.length === 0) {
                $('.addressInputResults').remove();
                return;
            }

            $('.addressInputResults').remove();
            // The address results need to sit outside the media object layout
            $addressInput.closest('.u-media').after(addressInputResults);
            // If there's only one option in the dropdown, and it represents an address,
            // select it and populate the fields.
            if (dropdown && jsonResults.length === 1 && jsonResults[0].Type === "Address") {
                $('.addressInputResults').remove();
                getAddress('/Postcode/AddressRetrieve', {
                    id: jsonResults[0].Id
                }, false);
                $("#AddressSearchBtn").html("Change address");
            }
            // If there's only one option in the dropdown, but it represents multiple addresses
            else if (dropdown && jsonResults.length === 1) {
                    $('.addressInputResults').remove();
                    getAddress('/Postcode/AddressLookup', {
                        text: '',
                        container: jsonResults[0].Id
                    }, true);
                }
                // If there's multiple possible answers
                else if (dropdown) {
                        showResults(jsonResults);
                    } else {
                        //Only when its a retreive and not a search should we move to populate the results
                        if (this.url == '/Postcode/AddressRetrieve') {
                            manualAddress('show');
                            formFill(jsonResults);
                            $('.addressInputResults').hide();
                            // Gets rid of "Or enter your address manually"
                            $('[data-js="show-address"]').parent().remove();
                            $("#AddressSearchBtn").html("Change address");
                        }
                    }
        }).error(function (jqXHR, exception) {
            var msg = '';
            if (jqXHR.status === 0) {
                msg = 'Not connect.\n Verify Network.';
            } else if (jqXHR.status === 404) {
                msg = 'Requested page not found. [404]';
            } else if (jqXHR.status === 500) {
                msg = 'Internal Server Error [500].';
            } else if (exception === 'parsererror') {
                msg = 'Requested JSON parse failed.';
            } else if (exception === 'timeout') {
                msg = 'Time out error.';
            } else if (exception === 'abort') {
                msg = 'Ajax request aborted.';
            } else {
                msg = 'Uncaught Error.\n' + jqXHR.responseText;
            }
            console.log(msg);
        });
    }

    /*  function getAddress(targetURL, targetData, dropdown) {
            $.ajax({
                url: targetURL,
                method: "POST",
                data: targetData,
                async: true
            }).done(function (data) {
                addressInput.after(addressInputResults);
                if (dropdown) {
                    showResults(JSON.parse(data));
                } else {
                    formFill(JSON.parse(data));
                }
            });
        } */

    // This is triggered when the ajax request for addresses comes back from the server.
    function showResults(resultsData) {
        var $select = $('.addressInputDropdown');

        //Set the size of the select box to the results and overflow to auto
        //max of 10
        var size = resultsData.length > 10 ? 10 : resultsData.length;
        // $select.attr("size", size);
        // $select.attr("style", "overflow: auto; background-image: none;");

        clearResults();

        var defaultItem = '<option disabled="disabled" selected="selected" value="">-- Select address --</option>';
        $(defaultItem).appendTo($select);

        $(resultsData).each(function () {
            var currentId = this.Id,
                currentText = this.Text,
                currentType = this.Type,
                currentDesc = this.Description,
                currentItem = '<option data-id="' + currentId + '" data-type="' + currentType + '">' + currentText + ' ' + currentDesc + '</option>';

            $(currentItem).appendTo($select);
        });

        // User selects an address
        $('.addressInputDropdown').change(function () {
            var $that = $(this),
                triggerId = $that.find('option:selected').attr('data-id'),
                triggerType = $that.find('option:selected').attr('data-type');
            $('.addressInputResults').remove();

            // This process runs twice. The first time, it shows one or more fuzzy matches for the
            // search string. The second time, the user can select one or more addresses which
            // share the same postcode.
            if (triggerType === 'Address') {
                // These addresses have the same postcode
                getAddress('/Postcode/AddressRetrieve', {
                    id: triggerId
                });
            } else {
                // These addresses match the fuzzy search
                getAddress('/Postcode/AddressLookup', {
                    text: '',
                    container: triggerId
                }, true);
            }
        });
    }

    // CLEAR RESULTS FUNCTION
    function clearResults() {
        $('.addressInputDropdown').find('option').remove();
    }

    // Populates all the different address fields with the data we've got back from the Ajax request.
    function formFill(resultsData) {
        var currentAddress = resultsData[0],
            currentForm = $('#AddressSearch').parents('form');
        if (currentForm) {
            currentForm.find('input#Company').val(currentAddress.Company);
            currentForm.find('input#Town').val(currentAddress.City);
            currentForm.find('input#AddressLine1').val(currentAddress.Line1);
            currentForm.find('input#AddressLine2').val(currentAddress.Line2);
            currentForm.find('input#Postcode').val(currentAddress.PostalCode);
            currentForm.find('input#Country').val(currentAddress.CountryName);

            //Need to run validation 
            //if the validation succeeds we need to remove the failed classes
            //Defense check as validate is activate/deactivated through the CMS
            if (typeof window.validate === 'function') {
                if (currentForm.find('input#Company').length > 0 && window.validate(currentForm.find('input#Company').closest(".Form__Element"))) {
                    currentForm.find('input#Company').closest(".Form__Element").removeClass("ValidationFail");
                }

                if (currentForm.find('input#Town').length > 0 && window.validate(currentForm.find('input#Town').closest(".Form__Element"))) {
                    currentForm.find('input#Town').closest(".Form__Element").removeClass("ValidationFail");
                }

                if (currentForm.find('input#AddressLine1').length > 0 && window.validate(currentForm.find('input#AddressLine1').closest(".Form__Element"))) {
                    currentForm.find('input#AddressLine1').closest(".Form__Element").removeClass("ValidationFail");
                }

                if (currentForm.find('input#AddressLine2').length > 0 && window.validate(currentForm.find('input#AddressLine2').closest(".Form__Element"))) {
                    currentForm.find('input#AddressLine2').closest(".Form__Element").removeClass("ValidationFail");
                }

                if (currentForm.find('input#Postcode').length > 0 && window.validate(currentForm.find('input#Postcode').closest(".Form__Element"))) {
                    currentForm.find('input#Postcode').closest(".Form__Element").removeClass("ValidationFail");
                }

                if (currentForm.find('input#Country').length > 0 && window.validate(currentForm.find('input#Country').closest(".Form__Element"))) {
                    currentForm.find('input#Country').closest(".Form__Element").removeClass("ValidationFail");
                }
            }

            // If the user has no favourite branch and has not come into this
            // page via a querystring, then use their postcode to do a search.
            if (getUrlParameter('postcode') === '') {
                $(document).trigger("branchSearch.postcodeSearch");
            }
            $('html, body').stop().animate({ scrollTop: $('#AddressSearch').offset().top }, 500);
        }
    }

    // STYLING ADDRESS LOOKUP
    function stylingAddressLookup(element) {
        element.addClass('addressLookUp');
    }

    // Basically an init function
    function addressSearchExtras() {
        var $inputDad = $addressInput.parent();
        $inputDad.after('<p class="u-img-r"><button type="button" id="AddressSearchBtn" class="btn btn-primary u-nowrap">Find address</button></p>');
        $addressInput.parents('.FormTextbox').addClass('AddressSearchContainer');
        // This button triggers the show / hide on the additional address fields
        $inputDad.parent().after('<p>Or <a href="#" data-js="show-address">enter your address manually</a>.</p>');
        // Users need to explicitly ask to see the address form elements
        manualAddress('hide');

        $('#AddressSearchBtn').click(function (e) {
            e.preventDefault();
            // Bit of clean up, yeah?
            clearResults();
            manualAddress('hide');
            $('.addressInputResults').remove();
            getAddress('/Postcode/AddressLookup', {
                text: $addressInput.val(),
                container: ''
            }, true);
        });
    }

    // If the user wants to bypass the postcode lookup, the
    // "enter your address manually"
    // link allows them to do so.
    $('[data-js="show-address"]').click(function () {
        manualAddress('show');
        // You ain't seen me, right?
        $(this).parent().remove();
        $('html, body').stop().animate({ scrollTop: $('#AddressSearch').offset().top }, 500);
        return false;
    });

    // There's a series of address input which need to be either hidden or shown.
    // To keep things DRY, I'm hiding the references to them in this function.
    // It expects either "show" or "hide" as a parameter.
    function manualAddress(toggle) {
        var $address1Dad = $('#AddressLine1').closest('.Form__Element'),
            $address2Dad = $('#AddressLine2').closest('.Form__Element'),
            $townDad = $('#Town').closest('.Form__Element'),
            $postcodeDad = $('#Postcode').closest('.Form__Element');

        if (toggle === 'show') {
            $address1Dad.slideDown();
            $address2Dad.slideDown();
            $townDad.slideDown();
            $postcodeDad.slideDown();
        } else if (toggle === 'hide') {
            $address1Dad.hide();
            $address2Dad.hide();
            $townDad.hide();
            $postcodeDad.hide();
        }
    }

    // Pull specific parameters from the querystring, by asking for them by name.
    // Stolen from aframe.io
    function getUrlParameter(name) {
        name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
        var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
        var results = regex.exec(location.search);
        return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
    }

    // Used to check if the user already has a favourite branch set
    function getCookie(name) {
        var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
        return v ? v[2] : null;
    }

    // Listens for progressive validation events in order to show fields
    function setupProgressiveListeners() {
        var $address1Dad = $('#AddressLine1').closest('.Form__Element'),
            $address2Dad = $('#AddressLine2').closest('.Form__Element'),
            $townDad = $('#Town').closest('.Form__Element'),
            $postcodeDad = $('#Postcode').closest('.Form__Element');

        function progressivePrevListener(e) {
            manualAddress('show');
            // Gets rid of "Or enter your address manually"
            $('[data-js="show-address"]').parent().remove();
        }

        $address1Dad.on('progressive-validation:previous', progressivePrevListener);
        $address2Dad.on('progressive-validation:previous', progressivePrevListener);
        $townDad.on('progressive-validation:previous', progressivePrevListener);
        $postcodeDad.on('progressive-validation:previous', progressivePrevListener);
    }
}

},{}],35:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
// I've no idea if this file is being imported sucessfully into content-hub.js or not - intersect() is called
// in that file, but the code is uncommented and I have no idea under what conditions that line might be parsed.

// Does not seem to be used
Array.isNonEmptyArray = function (array) {
    return typeof array !== 'undefined' && array != null && $.isArray(array) && array.length > 0;
};

// Used in content-hub.js
Array.intersect = function (array1, array2, elementIsInArrayFunction) {
    if (typeof elementIsInArrayFunction === 'undefined' || !$.isFunction(elementIsInArrayFunction)) {
        elementIsInArrayFunction = function elementIsInArrayFunction(element, array) {
            return $.inArray(element, array) >= 0;
        };
    }

    if (Array.isNonEmptyArray(array1) && Array.isNonEmptyArray(array2)) {
        var commonArray = $.grep(array1, function (e) {
            return elementIsInArrayFunction(e, array2);
        });
        return commonArray;
    } else {
        return [];
    }
};

exports.default = Array;

},{}],36:[function(require,module,exports){
'use strict';

+function ($) {
    'use strict';

    // Visited links can also be replicated with a CSS class.
    // In order to demonstate all of the anchor states, the example
    // anchors have to not appear in the browser history. This adds
    // dummy query strings, to make this possible.

    $('[data-js="no-history"]').each(function () {
        var currentHREF = $(this).attr('href');
        if (currentHREF != '' || typeof currentHREF != 'undefined') {
            $(this).attr('href', currentHREF + '?r=' + Math.random());
        }
    });

    // I want to hide the ugly blocks of code behind twiddly links, you know,
    // to save the sensitive eyes of clients from the everyday horror of the
    // coal face of web dev. Let them eat their peeled grapes in peace.
    $('pre').each(function (i) {
        var $that = $(this);
        // Is this a proper code block, or just some random tag burped out by the WYSIWTF
        if ($that.find('code').length !== 0) {
            $that.attr('id', 'code' + i).addClass('js-hide').before('<p><a href="#code' + i + '" class="btn btn-secondary u-flush" data-open="Show code" data-close="Hide code" data-js="toggle">Show code</a></p>');
        }
    });

    // Filched from https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f
    var copyToClipboard = function copyToClipboard(str) {
        var el = document.createElement('textarea'); // Create a <textarea> element
        el.value = str; // Set its value to the string that you want copied
        el.setAttribute('readonly', ''); // Make it readonly to be tamper-proof
        el.style.position = 'absolute';
        el.style.left = '-9999px'; // Move outside the screen to make it invisible
        document.body.appendChild(el); // Append the <textarea> element to the HTML document
        var selected = document.getSelection().rangeCount > 0 // Check if there is any content selected previously
        ? document.getSelection().getRangeAt(0) // Store selection if found
        : false; // Mark as false to know no selection existed before
        el.select(); // Select the <textarea> content
        document.execCommand('copy'); // Copy - only works as a result of a user action (e.g. click events)
        document.body.removeChild(el); // Remove the <textarea> element
        if (selected) {
            // If a selection existed before copying
            document.getSelection().removeAllRanges(); // Unselect everything on the HTML document
            document.getSelection().addRange(selected); // Restore the original selection
        }
    };

    // Clicking on certain icons in the brand guidelines copies the filename of the icon to the clipboard.
    $('[data-js="icon-click"]').click(function () {
        var fileName = $(this).find('[data-js="copy"]');
        // If we have a string to copy
        if (fileName.length > 0) {
            copyToClipboard(fileName.html());
        }
    });
}(jQuery);

},{}],37:[function(require,module,exports){
'use strict';

var _jqueryMatchheight = require('./vendor/jquery-matchheight');

var _jqueryMatchheight2 = _interopRequireDefault(_jqueryMatchheight);

var _arrayHelpers = require('./array-helpers');

var _arrayHelpers2 = _interopRequireDefault(_arrayHelpers);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

$.fn.matchHeight = _jqueryMatchheight2.default;
//import UrlParametersHelper from './url-parameters-helpers';


function contentHub(data) {

    var categoryTypes = data.categoryTypes || [];
    var categories = data.categories || [];
    var allArticlesCount = data.allArticlesCount || 0;
    var loadedArticlesCount = data.loadedArticlesCount || 0;
    var nonFeaturedElementsNextToEachOther = data.nonFeaturedElementsNextToEachOther || 0;
    var newsPageId = data.newsPage || 0;

    var UrlParametersHelper = function UrlParametersHelper() {};

    UrlParametersHelper.getParameterValueByName = function (name, url) {
        if (!url) {
            url = window.location.href;
        }
        name = name.replace(/[\[\]]/g, "\\$&");
        var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
            results = regex.exec(url);
        if (!results) return null;
        if (!results[2]) return '';
        return decodeURIComponent(results[2].replace(/\+/g, " "));
    };

    var ContentHubArticleLoader = function () {
        var _contentHubTotalHitsHeaderKey = "ContentHub-TotalHits";
        var _contentHubLoadedElements = "ContentHub-LoadedElements";
        var _nonFeaturedElementsNextToEachOtherKey = "ContentHub-NonFeaturedElementsNextToEachOther";
        var _articleCountInOneLoadGrid = 9;
        //var _articleContainer = $('#articles-grid');
        var _articleContainer = $('[data-js="more-articles"]');
        var _selectedArticles = [];
        var _loadedArticlesCount = 0;
        var _allArticlesCount;
        var _nonFeaturedElementsNextToEachOther;

        function ContentHubArticleLoader(allArticlesCount, nonFeaturedElementsNextToEachOther) {
            _allArticlesCount = allArticlesCount;
            _nonFeaturedElementsNextToEachOther = nonFeaturedElementsNextToEachOther;
        }

        ContentHubArticleLoader.prototype.constructor = ContentHubArticleLoader;

        ContentHubArticleLoader.prototype.getAllArticlesCount = function () {
            return _allArticlesCount;
        };

        ContentHubArticleLoader.prototype.getConstArticlesCountInOneLoadGrid = function () {
            return _articleCountInOneLoadGrid;
        };

        ContentHubArticleLoader.prototype.getLoadedArticlesCount = function () {
            return _loadedArticlesCount;
        };

        ContentHubArticleLoader.prototype.getSelectedArticles = function () {
            return _selectedArticles;
        };

        ContentHubArticleLoader.prototype.setSelectedArticles = function (value) {
            _selectedArticles = value;
            _allArticlesCount = typeof _selectedArticles !== 'undefined' && $.isArray(_selectedArticles) ? _selectedArticles.length : 0;
        };

        ContentHubArticleLoader.prototype.registerNewElementsAdded = function (elementsCount) {
            _loadedArticlesCount += elementsCount;
        };

        ContentHubArticleLoader.prototype.clearArticles = function () {
            _articleContainer.html('');
            _loadedArticlesCount = 0;
            _selectedArticles = [];
            _nonFeaturedElementsNextToEachOther = 0;
        };

        ContentHubArticleLoader.prototype.loadArticles = function (articleLoadedCallback) {
            var self = this;

            $.ajax({
                url: '/ContentHubPage/LoadArticles',
                method: "POST",
                contentType: "application/json",
                data: JSON.stringify({
                    articleIds: _selectedArticles,
                    start: _loadedArticlesCount,
                    nonFeaturedNextToEachOther: _nonFeaturedElementsNextToEachOther,
                    newsPage: newsPageId
                }),
                async: true,
                success: function success(data, textStatus, jqXHR) {
                    _allArticlesCount = parseFloat(jqXHR.getResponseHeader(_contentHubTotalHitsHeaderKey));
                    _nonFeaturedElementsNextToEachOther = parseFloat(jqXHR.getResponseHeader(_nonFeaturedElementsNextToEachOtherKey));
                    var loadedElementsCount = parseFloat(jqXHR.getResponseHeader(_contentHubLoadedElements));
                    self.registerNewElementsAdded(loadedElementsCount);
                    _articleContainer.append(data);
                    if ($.isFunction(articleLoadedCallback)) {
                        articleLoadedCallback();
                        // NR-119: This allows the lazyLoad to trigger for the new batch of articles which load in.
                        // Note that this is *not* the ideal way to do this, but the proper way involves Event Dispatcher
                        // and quite a lot of re-engineering of the site.
                        $(window).trigger('resize');
                    }
                    // Right, this is utter shambles, but it mostly works. I need to trigger matchHeight()
                    // but only after the new images have loaded in. Note that it will trigger for all
                    // the new articles, so if the user clicks the "more" button several times, it'll resize
                    // markup further up the page too.
                    var loaded = 0,
                        $newImages = _articleContainer.find('img');
                    $newImages.on('load', function () {
                        loaded++;
                        if (loaded === _articleCountInOneLoadGrid) {
                            $('.match-height').matchHeight();
                        }
                    });
                }
            });
        };

        return ContentHubArticleLoader;
    }();

    var ContentHubLoadMoreButton = function () {
        var _btnLoadMore = $('[data-js="load-more"]');
        var _articleLoaderHandler;
        var _self;

        function ContentHubLoadMoreButton(articleLoaderHandler) {
            _self = this;
            _articleLoaderHandler = articleLoaderHandler;
            _btnLoadMore.click(this.btnClicked);

            // On init we have 9 elements in grid
            this.disableIfNeeded(_articleLoaderHandler.getAllArticlesCount(), _articleLoaderHandler.getConstArticlesCountInOneLoadGrid());
            _articleLoaderHandler.registerNewElementsAdded(loadedArticlesCount);
        }

        ContentHubLoadMoreButton.prototype.constructor = ContentHubLoadMoreButton;

        ContentHubLoadMoreButton.prototype.disableIfNeeded = function (allAvailableItemsCount, loadedItemsCount) {
            if (typeof allAvailableItemsCount !== 'undefined' && !isNaN(allAvailableItemsCount)) {
                if (allAvailableItemsCount <= loadedItemsCount) {
                    _btnLoadMore.hide();
                } else {
                    _btnLoadMore.show();
                }
            }
        };

        ContentHubLoadMoreButton.prototype.btnClicked = function () {
            _articleLoaderHandler.loadArticles(function () {
                _self.disableIfNeeded(_articleLoaderHandler.getAllArticlesCount(), _articleLoaderHandler.getLoadedArticlesCount());
            });
        };

        return ContentHubLoadMoreButton;
    }();

    var ContentHubFilters = function () {
        var _self;
        var _categoryTypesSelect = $('.articles-filter-type');
        var _categoriesSelect = $('.articles-filter-category');
        var _categoryTypes;
        var _categories;
        var _articleLoaderHandler;
        var _loadMoreButtonHandler;

        function ContentHubFilters(categoryTypes, categories, articleLoaderHandler, loadMoreButtonHandler) {
            _self = this;
            _categoryTypes = categoryTypes;
            _categories = categories;
            _articleLoaderHandler = articleLoaderHandler;
            _loadMoreButtonHandler = loadMoreButtonHandler;

            this.loadDefaultValuesToDropdowns();
            this.dropdownLoad(_categoryTypesSelect, _categoryTypes);
            this.dropdownLoad(_categoriesSelect, _categories);

            _categoryTypesSelect.change(function (e) {
                _self.selectedDropdownValueChanged(_categoryTypesSelect, _categoryTypes, _categoriesSelect, _categories);
            });
            _categoriesSelect.change(function (e) {
                _self.selectedDropdownValueChanged(_categoriesSelect, _categories, _categoryTypesSelect, _categoryTypes);
            });
        }

        ContentHubFilters.prototype.constructor = ContentHubFilters;

        ContentHubFilters.prototype.loadDefaultValuesToDropdowns = function () {
            _categoryTypesSelect.append($('<option>', {
                value: "",
                text: "Select type"
            }));

            _categoriesSelect.append($('<option>', {
                value: "",
                text: "Select category"
            }));
        };

        ContentHubFilters.prototype.dropdownLoad = function (currentDropdown, data) {
            if (typeof data !== 'undefined' && $.isArray(data)) {
                for (var i = 0; i < data.length; i++) {
                    currentDropdown.append($('<option>', {
                        value: data[i].Id,
                        text: data[i].Name
                    }));
                }
            }
        };

        ContentHubFilters.prototype.clearDropdown = function (dropdown) {
            dropdown.find('option:gt(0)').remove();
        };

        ContentHubFilters.prototype.getDataElementById = function (id, data) {
            return $.grep(data, function (e) {
                return e.Id == id;
            })[0];
        };

        ContentHubFilters.prototype.findElementsWithCommonArticles = function (data, selectedElement) {
            if (typeof selectedElement === 'undefined' || selectedElement == null || !$.isArray(selectedElement.Articles) || selectedElement.Articles.length === 0) {
                return data;
            } else {
                var filteredElements = [];
                var selectedElementArticlesIds = _self.getArticleIds(selectedElement.Articles);
                for (var i = 0; i < data.length; i++) {
                    var dataElement = data[i];
                    for (var j = 0; j < dataElement.Articles.length; j++) {
                        var articleId = dataElement.Articles[j].Id;

                        if ($.inArray(articleId, selectedElementArticlesIds) >= 0) {
                            filteredElements.push(dataElement);
                            break;
                        }
                    }
                }
                return filteredElements;
            }
        };

        ContentHubFilters.prototype.getArticleIds = function (articles) {
            return $.map(articles, function (val, i) {
                return val.Id;
            });
        };

        ContentHubFilters.prototype.dropdownNarrowBySecondDropdownSelectedValue2 = function (currentDropdown, currentDropdownData, secondDropdown, secondDropdownData) {
            var currentDropdownSelectedObject = _self.getDataElementById(currentDropdown.val(), currentDropdownData);
            var secondDropdownSelectedObject = _self.getDataElementById(secondDropdown.val(), secondDropdownData);

            var newSecondDropdownData = typeof currentDropdownSelectedObject === 'undefined' ? secondDropdownData : _self.findElementsWithCommonArticles(secondDropdownData, currentDropdownSelectedObject);
            var secondDropdownSelectedValue = secondDropdown.val();

            _self.clearDropdown(secondDropdown);
            _self.dropdownLoad(secondDropdown, newSecondDropdownData);
            secondDropdown.val(secondDropdownSelectedValue);
        };

        ContentHubFilters.prototype.dropdownNarrowBySecondDropdownSelectedValue = function (currentDropdow, currentData, articlesInSelectedValueInAnotherDropdow) {
            _self.clearDropdown(currentDropdow);
            if (typeof currentData !== 'undefined' && $.isArray(currentData)) {
                if (articlesInSelectedValueInAnotherDropdow == null || $.isArray(articlesInSelectedValueInAnotherDropdow) && articlesInSelectedValueInAnotherDropdow.length === 0) {
                    _self.dropdownLoad(currentDropdow, data);
                } else {
                    for (var i = 0; i < currentData.length; i++) {
                        var articlesInType = currentData[i].Articles;
                        if (this.arraysIntersect(articlesInSelectedValueInAnotherDropdow, articlesInType).length > 0) {
                            var type = currentData[i];
                            currentDropdow.append($('<option>', {
                                value: type.Id,
                                text: type.Name
                            }));
                        }
                    }
                }
            }
        };

        ContentHubFilters.prototype.setQueryString = function (type, category) {
            var newUrl = window.location.pathname;
            if (newUrl.indexOf('/', newUrl.length - 1) === -1) {
                newUrl = newUrl + '/';
            }
            var typeHasValue = type != null && type !== "";
            var categoryHasValue = category != null && category !== "";

            if (typeHasValue || categoryHasValue) newUrl += '?';

            if (typeHasValue) {
                newUrl += 't=' + type;
            }
            if (categoryHasValue) {
                if (typeHasValue) newUrl += '&';
                newUrl += 'c=' + category;
            }

            if (!$('html').hasClass('IE9')) {
                window.history.replaceState("content-hub", "Content Hub", newUrl);
            }
        };

        ContentHubFilters.prototype.sortArticles = function (articles) {
            return articles.sort(function (first, second) {
                var publishedDateFirst = new Date(first.PublishedTime);
                var publishedDateSecond = new Date(second.PublishedTime);
                if (publishedDateFirst == publishedDateSecond) {
                    return 0;
                }
                if (publishedDateFirst < publishedDateSecond) {
                    return 1;
                } else {
                    return -1;
                }
            });
        };

        ContentHubFilters.prototype.loadArticlesBasedOnDropdowns = function (callback) {
            var selectedType = _self.getDataElementById(_categoryTypesSelect.val(), _categoryTypes);
            var selectedCategory = _self.getDataElementById(_categoriesSelect.val(), _categories);

            var selectedArticleIds;
            var articlesCount = 0;

            if (typeof selectedType !== 'undefined' && typeof selectedCategory !== 'undefined') {
                var articles = _arrayHelpers2.default.intersect(selectedType.Articles, _self.getArticleIds(selectedCategory.Articles), function (element, articleIdsArray) {
                    return $.inArray(element.Id, articleIdsArray) >= 0;
                });
                var sortedByDate = _self.sortArticles(articles);
                selectedArticleIds = _self.getArticleIds(sortedByDate);
                articlesCount = selectedArticleIds.length;
            } else if (typeof selectedType !== 'undefined') {
                selectedArticleIds = _self.getArticleIds(selectedType.Articles);
                articlesCount = selectedArticleIds.length;
            } else if (typeof selectedCategory !== 'undefined') {
                selectedArticleIds = _self.getArticleIds(selectedCategory.Articles);
                articlesCount = selectedArticleIds.length;
            } else {
                selectedArticleIds = [];
            }

            _articleLoaderHandler.setSelectedArticles(selectedArticleIds);

            _articleLoaderHandler.loadArticles(function () {
                _loadMoreButtonHandler.disableIfNeeded(_articleLoaderHandler.getAllArticlesCount(), _articleLoaderHandler.getLoadedArticlesCount());
                if (typeof callback !== 'undefined' && $.isFunction(callback)) {
                    callback();
                }
            });
        };

        ContentHubFilters.prototype.getDataUrlNameById = function (id, data) {
            var first = $.grep(data, function (e) {
                return e.Id == id;
            })[0];
            if (first != null) return first.Name.trim().toLowerCase().replace(/[^a-zA-Z0-9_-]/g, '_');
            return first;
        };

        ContentHubFilters.prototype.getDataUrlIdByName = function (name, data) {
            var first = $.grep(data, function (e) {
                return e.Name.trim().toLowerCase().replace(/[^a-zA-Z0-9_-]/g, '_') == name;
            })[0];
            if (first != null) return first.Id;
            return first;
        };
        ContentHubFilters.prototype.selectedDropdownValueChanged = function (currentDropdown, currentData, secondDropdown, secondDropdownData, callback) {
            if (currentDropdown.val() == null) {
                currentDropdown.val("");
            }

            _articleLoaderHandler.clearArticles();

            _self.dropdownNarrowBySecondDropdownSelectedValue2(currentDropdown, currentData, secondDropdown, secondDropdownData);

            _self.setQueryString(_self.getDataUrlNameById(_categoryTypesSelect.val(), _categoryTypes), _self.getDataUrlNameById(_categoriesSelect.val(), _categories));
            _self.loadArticlesBasedOnDropdowns(callback);
        };

        ContentHubFilters.prototype.firstLoad = function () {
            var type = UrlParametersHelper.getParameterValueByName('t');
            var category = UrlParametersHelper.getParameterValueByName('c');
            if (type != null) {

                if (isNaN(type)) {
                    _categoryTypesSelect.val(_self.getDataUrlIdByName(type, _categoryTypes));
                } else {
                    _categoryTypesSelect.val(type);
                }

                _self.selectedDropdownValueChanged(_categoryTypesSelect, _categoryTypes, _categoriesSelect, _categories, function () {
                    if (category != null) {

                        if (isNaN(category)) {
                            _categoriesSelect.val(_self.getDataUrlIdByName(category, _categories));
                        } else {
                            _categoriesSelect.val(category);
                        }

                        _self.selectedDropdownValueChanged(_categoriesSelect, _categories, _categoryTypesSelect, _categoryTypes);
                    }
                });
            } else if (category != null) {
                if (isNaN(category)) {
                    _categoriesSelect.val(_self.getDataUrlIdByName(category, _categories));
                } else {
                    _categoriesSelect.val(category);
                }
                _self.selectedDropdownValueChanged(_categoriesSelect, _categories, _categoryTypesSelect, _categoryTypes);
            }
        };

        return ContentHubFilters;
    }();

    var ArticleLoader = new ContentHubArticleLoader(allArticlesCount, nonFeaturedElementsNextToEachOther);
    var LoadMoreButton = new ContentHubLoadMoreButton(ArticleLoader);
    var Filters = new ContentHubFilters(categoryTypes, categories, ArticleLoader, LoadMoreButton);
    Filters.firstLoad();
}

// \views\pages\contenthubpage.cshtml populates window.newsFeed
$(document).ready(function () {
    if (typeof window.newsFeed !== 'undefined') {
        contentHub(window.newsFeed);
    }
});

},{"./array-helpers":35,"./vendor/jquery-matchheight":50}],38:[function(require,module,exports){
'use strict';

+function ($) {
    'use strict';

    function cookiePolicy() {

        var policyContainer = $('body').find('[data-js="cookie-policy"]');
        var policyContainerClose = policyContainer.find('[data-js="close"]');

        var cookieExDays = 180;
        var currentDate = new Date();
        var cookieName = 'isCookiePolicyAccepted';

        // CHECKING COOKIE AND SHOWING COOKIE CONTAINER
        if (!checkCookie()) {
            policyContainer.delay(700).slideDown('fast');
        }

        // CLOSING COOKIE CONTAINER
        policyContainerClose.click(function () {
            closeContainer();
            setCookie();
            return false;
        });

        function closeContainer() {
            policyContainer.slideUp('fast', function () {
                $(this).attr('aria-hidden', 'true');
            });
        }

        function setCookie() {
            currentDate.setTime(currentDate.getTime() + cookieExDays * 24 * 60 * 60 * 1000);
            var cookieValue = true;
            var cookieExpires = "expires=" + currentDate.toUTCString();
            document.cookie = cookieName + "=" + cookieValue + ";" + cookieExpires + ";" + "path=/";
        }

        function getCookie(cname) {
            var name = cname + "=";
            var ca = document.cookie.split(';');
            for (var i = 0; i < ca.length; i++) {
                var c = ca[i];
                while (c.charAt(0) == ' ') {
                    c = c.substring(1);
                }
                if (c.indexOf(name) == 0) {
                    return c.substring(name.length, c.length);
                }
            }
        }

        function checkCookie() {
            var currentCookie = getCookie(cookieName);

            if (currentCookie) {
                return true;
            }
        }
    }
    cookiePolicy();
}(jQuery);

},{}],39:[function(require,module,exports){
"use strict";

Object.defineProperty(exports, "__esModule", {
   value: true
});
var categories = {
   strictlyNecessary: "C0001",
   performance: "C0002",
   functional: "C0003",
   marketing: "C0004",
   socialMedia: "C0005"
};

function checkCategoryAllowed(category) {
   var cookie = getCookie("OptanonConsent");
   var reg = new RegExp(/(C000[0-5]):1/g);

   var match = reg.exec(cookie);
   while (match) {
      if (match[1] === category) {
         return true;
      }
      match = reg.exec(cookie);
   }
   return false;
}

function getCookie(cname, category) {
   if (category && !checkCategoryAllowed(category)) {
      removeCookie(cname);
      return "";
   }

   var name = cname + "=";
   var decodedCookie = decodeURIComponent(document.cookie);
   var ca = decodedCookie.split(";");
   for (var i = 0; i < ca.length; i++) {
      var c = ca[i];
      while (c.charAt(0) === " ") {
         c = c.substring(1);
      }
      if (c.indexOf(name) === 0) {
         return c.substring(name.length, c.length);
      }
   }
   return "";
}

function setCookie(category, name, value, expiry, path) {
   if (!checkCategoryAllowed(category)) {
      removeCookie(name);
      return;
   }

   var cookie = name + "=" + encodeURIComponent(value);

   if (path) {
      cookie = cookie + "; path=" + path;
   }

   if (expiry) {
      cookie = cookie + "; expires=" + expiry;
   }

   document.cookie = cookie;
}

function removeCookie(name) {
   document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT";
}

exports.default = {
   categories: categories,
   checkCategoryAllowed: checkCategoryAllowed,
   getCookie: getCookie,
   setCookie: setCookie,
   removeCookie: removeCookie
};

},{}],40:[function(require,module,exports){
'use strict';

var _getParameter = require('../../components/url-parameters/get-parameter');

var _getParameter2 = _interopRequireDefault(_getParameter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// Logic
$(document).ready(function () {

  // Form
  if ($('.EPiServerForms').length > 0) {
    episerverForms();
  }
});

function episerverForms() {

  //Change the title tag on the form steps.
  if (formItemExist('.FormStep__Title')) {
    formStepsTitle();
  }

  if (formItemExist('input[type="radio"]')) {
    activeRadio();
  }

  if (formItemExist('input[type="checkbox"]')) {
    activeCheckbox();
  }

  if (formItemExist('input[type="file"]')) {
    fileInput();
  }

  if (formItemExist('select')) {
    //customSelect();
  }

  if (formItemExist('.FormSelection_multiple')) {
    multiSelect();
  }

  if (formItemExist('.FormDateTime__Input')) {
    datePicker();
  }

  if (formItemExist('.FormCaptcha')) {
    epiCaptcha();
  }

  // USED FUNCTIONS:

  // CHECK IF FORM ITEM EXIST
  function formItemExist(item) {
    if ($('.EPiServerForms').find(item).length > 0) {
      return true;
    }
  }

  // ACTIVE RADIOS
  function activeRadio() {
    $('.EPiServerForms').find('.FormChoice').find('input[type="radio"]').on('change', function () {
      var currentInput = $(this);
      var currentInputDesc = currentInput.siblings('span');
      var currentInputContainer = currentInput.parents('.FormChoice');
      currentInputContainer.find('input + span').removeClass('active');
      currentInputDesc.addClass('active');
    });

    $(window).on('load', function () {
      //Get product name from URL
      var product = (0, _getParameter2.default)('product');
      if (product) {
        //If we have a product, loop through the radio buttons to find the product and select it 
        $("input[type=radio]").each(function (index) {
          if ($(this).val().toLowerCase() === product) {
            $(this).prop('checked', true);
            $('.EPiServerForms').find('.FormChoice_Container').hide();
          }
        });
      }
    });
  }

  // ACTIVE CHECKBOXES
  function activeCheckbox() {
    $('.EPiServerForms').find('.FormChoice').find('input[type="checkbox"]').change(function () {
      var currentInput = $(this);
      var currentInputDesc = currentInput.siblings('span');
      if (currentInputDesc.hasClass('active')) {
        currentInputDesc.removeClass('active');
      } else {
        currentInputDesc.addClass('active');
      }
    });

    $(document).ready(function () {
      var checkedInputs = $('.Form__Element.FormChoice').find('input:checked');
      checkedInputs.each(function () {
        $(this).siblings('span').addClass('active');
      });
    });
  }

  // FILE UPLOAD
  function fileInput() {

    $('.customFileInput').click(function (e) {
      //e.preventDefault();
      $(this).siblings('.FormFileUpload__Input').click();
      return false;
    });

    $('.EPiServerForms').find('.FormFileUpload').find('input[type="file"]').change(function () {
      var currentFile = $(this).val().split('\\');
      $(this).siblings('.customFileInput').text(currentFile[currentFile.length - 1]);
    });
  }

  // EPI CAPTCHA  
  function epiCaptcha() {
    $('.FormRecaptcha').each(function () {
      var errorMsg = $(this).find('.Form__Element__ValidationError').css('display');
      if (errorMsg === 'block') {
        $(this).addClass('ValidationFail');
      }
    });
  }

  function handleInputMobile(dateInputUnder, dateInput, format) {
    dateInput.val(moment().format(format));
    dateInputUnder.on("change", function () {
      var currentValue = moment(this.value);
      dateInput.val(currentValue.format(format));
    });
  }

  // DATE PICKER  
  function datePicker() {
    window.mobileAndTabletcheck = window.mobileAndTabletcheck || function () {
      return false;
    };

    $('.Form__CustomInput.FormDateTime__Input').each(function () {
      var dateInput = $(this);
      // The form has a date and time picker
      if (dateInput.hasClass('type-datetimepicker') || dateInput.hasClass('type-timepicker')) {
        if (dateInput.hasClass('type-datetimepicker')) {
          if (window.mobileAndTabletcheck()) {
            // Creates a duplicate input field - not sure why
            var dateInputUnder = $('<input type="datetime-local" class="date-overlay" />');
            dateInput.before(dateInputUnder);
            handleInputMobile(dateInputUnder, dateInput, "DD/MM/YYYY HH:mm");
            return;
          }
          dateInput.datetimepicker({
            format: 'd/m/Y H:i',
            step: 30
          });
        } else if (dateInput.hasClass('type-timepicker')) {
          if (window.mobileAndTabletcheck()) {
            dateInputUnder = $('<input type="time" class="date-overlay" />');
            dateInput.before(dateInputUnder);
            handleInputMobile(dateInputUnder, dateInput, "HH:mm");
            return;
          }
          dateInput.datetimepicker({
            datepicker: false,
            todayButton: false,
            format: 'H:i',
            step: 30
          });
        }
        $(window).on('resize', function () {
          dateInput.datetimepicker('hide');
        });
      } else {
        if (window.mobileAndTabletcheck()) {
          dateInputUnder = $('<input type="date" class="date-overlay" />');
          dateInput.before(dateInputUnder);
          handleInputMobile(dateInputUnder, dateInput, "hh:mm");
          return;
        }
        var datePicker = $(this).siblings('.datepicker');

        // SHOW DATE PICKER
        dateInput.click(function () {
          dateInput.addClass('active');
          $(datePicker).datepicker({
            dateFormat: 'dd/mm/yyyy',
            showButtonPanel: true,
            onSelect: function onSelect(dateText, inst) {
              var dateAsString = dateText;
              var dateAsObject = $(this).datepicker('getDate');
              $(this).siblings(dateInput).val(dateAsString);
              destroyDatePicker($(this));
            }
          });
          $(datePicker).find('.ui-datepicker-inline').focus();
        });

        // TODAY BUTTON SETTING CURRENT DATE VALUE
        $.datepicker._gotoToday = function (id) {
          var target = $(id);
          var inst = this._getInst(target[0]);
          dateInput.val(inst.currentMonth + 1 + '/' + inst.currentDay + '/' + inst.currentYear);
          destroyDatePicker(datePicker);
        };

        // DESTROY DATEPICKER ON RESIZE
        $(window).resize(function () {
          destroyDatePicker(datePicker);
        });

        // HIDE DROPDOWN ON CLICK OUTSIDE
        $(document).mouseup(function (e) {
          if (!$(datePicker).is(e.target) && $(datePicker).has(e.target).length === 0) {
            destroyDatePicker(datePicker);
          }
        });

        dateInput.focus(function () {
          dateInput.addClass('active');
          $(datePicker).datepicker({
            dateFormat: 'dd/mm/yyyy',
            showButtonPanel: true,
            onSelect: function onSelect(dateText, inst) {
              var dateAsString = dateText;
              var dateAsObject = $(this).datepicker('getDate');
              $(this).siblings(dateInput).val(dateAsString);
              destroyDatePicker(this);
            }
          });
          $(datePicker).find('.ui-datepicker-inline').focus();
        });
      }

      // SWITCHING MONTHS VIA KEYBOARD ARROWS
      $(document).on('keydown', function (e) {
        if ($('.datepicker').hasClass('hasDatepicker')) {
          var currentDatePicker = $('.datepicker.hasDatepicker');
          if (e.which === 39) {
            currentDatePicker.find('.ui-datepicker-next').click();
          }
          if (e.which === 37) {
            currentDatePicker.find('.ui-datepicker-prev').click();
          }
          if (e.which === 27) {
            destroyDatePicker(currentDatePicker);
          }
        }
      });
    });
  }

  // DESTROY DATE PICKER
  function destroyDatePicker(item) {
    $(item).datepicker('destroy');
    $(item).removeClass("hasDatepicker").removeAttr('id');
  }

  // Hide the main title and description on the form steps.
  function formStepsTitle() {
    //Get the hidden form field.
    var targetNode = document.getElementsByName('__FormCurrentStepIndex')[0];

    //Add an observer to monitor changes in the hidden form field.
    // Options for the observer (which mutations to observe)
    var config = { attributes: true, childList: true, subtree: true };

    // Callback function to execute when mutations are observed
    var callback = function callback(mutationsList, observer) {
      var _iteratorNormalCompletion = true;
      var _didIteratorError = false;
      var _iteratorError = undefined;

      try {
        for (var _iterator = mutationsList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
          var mutation = _step.value;

          if (mutation.type === 'attributes') {

            //When on step one display the title and description.
            if (targetNode.value == "0") {
              $('.Form__Title').show();
              $('.Form__Description').show();
            } else {
              //Hide the title and description on all form steps.
              $('.Form__Title').hide();
              $('.Form__Description').hide();
            }
          }
        }
      } catch (err) {
        _didIteratorError = true;
        _iteratorError = err;
      } finally {
        try {
          if (!_iteratorNormalCompletion && _iterator.return) {
            _iterator.return();
          }
        } finally {
          if (_didIteratorError) {
            throw _iteratorError;
          }
        }
      }
    };

    // Create an observer instance linked to the callback function
    var observer = new MutationObserver(callback);

    // Start observing the target node for configured mutations
    observer.observe(targetNode, config);

    //Get a list of all the form steps tags.
    var formStepsTitles = $('.FormStep__Title');

    //Change the tag of the form step title.
    formStepsTitles.each(function (index) {
      //don't update the first step as this appears on the same page as main title.
      if (index > 0) {
        $(this).replaceWith($('<h2 class="FormStep__Title">' + this.innerHTML + '</h2>'));
      }
    });
  }

  // Allow you to select multiple options without using ctrl
  function multiSelect() {
    $('.FormSelection_multiple').mousedown(function (e) {
      e.preventDefault();

      var select = this;
      var scroll = select.scrollTop;
      e.target.selected = !e.target.selected;
      setTimeout(function () {
        select.scrollTop = scroll;
      }, 0);
      $(select).focus();
    });
    $('.FormSelection_multiple').mousemove(function (e) {
      e.preventDefault();
    });
  }
}

},{"../../components/url-parameters/get-parameter":30}],41:[function(require,module,exports){
'use strict';

var _highlightPack = require('./vendor/highlight-pack.js');

var _highlightPack2 = _interopRequireDefault(_highlightPack);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

_highlightPack2.default.initHighlightingOnLoad();

// ************************
var cssFun = function cssFun(hljs) {
    var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';
    var RULE = {
        begin: /[A-Z\_\.\-]+\s*:/, returnBegin: true, end: ';', endsWithParent: true,
        contains: [{
            className: 'attribute',
            begin: /\S/, end: ':', excludeEnd: true,
            starts: {
                endsWithParent: true, excludeEnd: true,
                contains: [{
                    begin: /[\w-]+\(/, returnBegin: true,
                    contains: [{
                        className: 'built_in',
                        begin: /[\w-]+/
                    }, {
                        begin: /\(/, end: /\)/,
                        contains: [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE]
                    }]
                }, hljs.CSS_NUMBER_MODE, hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE, hljs.C_BLOCK_COMMENT_MODE, {
                    className: 'number', begin: '#[0-9A-Fa-f]+'
                }, {
                    className: 'meta', begin: '!important'
                }]
            }
        }]
    };

    return {
        case_insensitive: true,
        illegal: /[=\/|'\$]/,
        contains: [hljs.C_BLOCK_COMMENT_MODE, {
            className: 'selector-id', begin: /#[A-Za-z0-9_-]+/
        }, {
            className: 'selector-class', begin: /\.[A-Za-z0-9_-]+/
        }, {
            className: 'selector-attr',
            begin: /\[/, end: /\]/,
            illegal: '$'
        }, {
            className: 'selector-pseudo',
            begin: /:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/
        }, {
            begin: '@(font-face|page)',
            lexemes: '[a-z-]+',
            keywords: 'font-face page'
        }, {
            begin: '@', end: '[{;]', // at_rule eating first "{" is a good thing
            // because it doesn’t let it to be parsed as
            // a rule set but instead drops parser into
            // the default mode which is how it should be.
            illegal: /:/, // break on Less variables @var: ...
            contains: [{
                className: 'keyword',
                begin: /\w+/
            }, {
                begin: /\s/, endsWithParent: true, excludeEnd: true,
                relevance: 0,
                contains: [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, hljs.CSS_NUMBER_MODE]
            }]
        }, {
            className: 'selector-tag', begin: IDENT_RE,
            relevance: 0
        }, {
            begin: '{', end: '}',
            illegal: /\S/,
            contains: [hljs.C_BLOCK_COMMENT_MODE, RULE]
        }]
    };
};

// ************************
var xmlFun = function xmlFun(hljs) {
    var XML_IDENT_RE = '[A-Za-z0-9\\._:-]+';
    var TAG_INTERNALS = {
        endsWithParent: true,
        illegal: /</,
        relevance: 0,
        contains: [{
            className: 'attr',
            begin: XML_IDENT_RE,
            relevance: 0
        }, {
            begin: /=\s*/,
            relevance: 0,
            contains: [{
                className: 'string',
                endsParent: true,
                variants: [{ begin: /"/, end: /"/ }, { begin: /'/, end: /'/ }, { begin: /[^\s"'=<>`]+/ }]
            }]
        }]
    };
    return {
        aliases: ['html', 'xhtml', 'rss', 'atom', 'xjb', 'xsd', 'xsl', 'plist'],
        case_insensitive: true,
        contains: [{
            className: 'meta',
            begin: '<!DOCTYPE', end: '>',
            relevance: 10,
            contains: [{ begin: '\\[', end: '\\]' }]
        }, hljs.COMMENT('<!--', '-->', {
            relevance: 10
        }), {
            begin: '<\\!\\[CDATA\\[', end: '\\]\\]>',
            relevance: 10
        }, {
            className: 'meta',
            begin: /<\?xml/, end: /\?>/, relevance: 10
        }, {
            begin: /<\?(php)?/, end: /\?>/,
            subLanguage: 'php',
            contains: [{ begin: '/\\*', end: '\\*/', skip: true }]
        }, {
            className: 'tag',
            /*
            The lookahead pattern (?=...) ensures that 'begin' only matches
            '<style' as a single word, followed by a whitespace or an
            ending braket. The '$' is needed for the lexeme to be recognized
            by hljs.subMode() that tests lexemes outside the stream.
            */
            begin: '<style(?=\\s|>|$)', end: '>',
            keywords: { name: 'style' },
            contains: [TAG_INTERNALS],
            starts: {
                end: '</style>', returnEnd: true,
                subLanguage: ['css', 'xml']
            }
        }, {
            className: 'tag',
            // See the comment in the <style tag about the lookahead pattern
            begin: '<script(?=\\s|>|$)', end: '>',
            keywords: { name: 'script' },
            contains: [TAG_INTERNALS],
            starts: {
                end: '\<\/script\>', returnEnd: true,
                subLanguage: ['actionscript', 'javascript', 'handlebars', 'xml']
            }
        }, {
            className: 'tag',
            begin: '</?', end: '/?>',
            contains: [{
                className: 'name', begin: /[^\/><\s]+/, relevance: 0
            }, TAG_INTERNALS]
        }]
    };
};

// ************************
var jsonFun = function jsonFun(hljs) {
    var LITERALS = { literal: 'true false null' };
    var TYPES = [hljs.QUOTE_STRING_MODE, hljs.C_NUMBER_MODE];
    var VALUE_CONTAINER = {
        end: ',', endsWithParent: true, excludeEnd: true,
        contains: TYPES,
        keywords: LITERALS
    };
    var OBJECT = {
        begin: '{', end: '}',
        contains: [{
            className: 'attr',
            begin: /"/, end: /"/,
            contains: [hljs.BACKSLASH_ESCAPE],
            illegal: '\\n'
        }, hljs.inherit(VALUE_CONTAINER, { begin: /:/ })],
        illegal: '\\S'
    };
    var ARRAY = {
        begin: '\\[', end: '\\]',
        contains: [hljs.inherit(VALUE_CONTAINER)], // inherit is a workaround for a bug that makes shared modes with endsWithParent compile only the ending of one of the parents
        illegal: '\\S'
    };
    TYPES.splice(TYPES.length, 0, OBJECT, ARRAY);
    return {
        contains: TYPES,
        keywords: LITERALS,
        illegal: '\\S'
    };
};

// ************************
var jsFun = function jsFun(hljs) {
    var IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
    var KEYWORDS = {
        keyword: 'in of if for while finally var new function do return void else break catch ' + 'instanceof with throw case default try this switch continue typeof delete ' + 'let yield const export super debugger as async await static ' +
        // ECMAScript 6 modules import
        'import from as',

        literal: 'true false null undefined NaN Infinity',
        built_in: 'eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent ' + 'encodeURI encodeURIComponent escape unescape Object Function Boolean Error ' + 'EvalError InternalError RangeError ReferenceError StopIteration SyntaxError ' + 'TypeError URIError Number Math Date String RegExp Array Float32Array ' + 'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' + 'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' + 'module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect ' + 'Promise'
    };
    var EXPRESSIONS;
    var NUMBER = {
        className: 'number',
        variants: [{ begin: '\\b(0[bB][01]+)' }, { begin: '\\b(0[oO][0-7]+)' }, { begin: hljs.C_NUMBER_RE }],
        relevance: 0
    };
    var SUBST = {
        className: 'subst',
        begin: '\\$\\{', end: '\\}',
        keywords: KEYWORDS,
        contains: [] // defined later
    };
    var TEMPLATE_STRING = {
        className: 'string',
        begin: '`', end: '`',
        contains: [hljs.BACKSLASH_ESCAPE, SUBST]
    };
    SUBST.contains = [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, TEMPLATE_STRING, NUMBER, hljs.REGEXP_MODE];
    var PARAMS_CONTAINS = SUBST.contains.concat([hljs.C_BLOCK_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE]);

    return {
        aliases: ['js', 'jsx'],
        keywords: KEYWORDS,
        contains: [{
            className: 'meta',
            relevance: 10,
            begin: /^\s*['"]use (strict|asm)['"]/
        }, {
            className: 'meta',
            begin: /^#!/, end: /$/
        }, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, TEMPLATE_STRING, hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, NUMBER, { // object attr container
            begin: /[{,]\s*/, relevance: 0,
            contains: [{
                begin: IDENT_RE + '\\s*:', returnBegin: true,
                relevance: 0,
                contains: [{ className: 'attr', begin: IDENT_RE, relevance: 0 }]
            }]
        }, { // "value" container
            begin: '(' + hljs.RE_STARTERS_RE + '|\\b(case|return|throw)\\b)\\s*',
            keywords: 'return throw case',
            contains: [hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, hljs.REGEXP_MODE, {
                className: 'function',
                begin: '(\\(.*?\\)|' + IDENT_RE + ')\\s*=>', returnBegin: true,
                end: '\\s*=>',
                contains: [{
                    className: 'params',
                    variants: [{
                        begin: IDENT_RE
                    }, {
                        begin: /\(\s*\)/
                    }, {
                        begin: /\(/, end: /\)/,
                        excludeBegin: true, excludeEnd: true,
                        keywords: KEYWORDS,
                        contains: PARAMS_CONTAINS
                    }]
                }]
            }, { // E4X / JSX
                begin: /</, end: /(\/\w+|\w+\/)>/,
                subLanguage: 'xml',
                contains: [{ begin: /<\w+\s*\/>/, skip: true }, {
                    begin: /<\w+/, end: /(\/\w+|\w+\/)>/, skip: true,
                    contains: [{ begin: /<\w+\s*\/>/, skip: true }, 'self']
                }]
            }],
            relevance: 0
        }, {
            className: 'function',
            beginKeywords: 'function', end: /\{/, excludeEnd: true,
            contains: [hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE }), {
                className: 'params',
                begin: /\(/, end: /\)/,
                excludeBegin: true,
                excludeEnd: true,
                contains: PARAMS_CONTAINS
            }],
            illegal: /\[|%/
        }, {
            begin: /\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
        }, hljs.METHOD_GUARD, { // ES6 class
            className: 'class',
            beginKeywords: 'class', end: /[{;=]/, excludeEnd: true,
            illegal: /[:"\[\]]/,
            contains: [{ beginKeywords: 'extends' }, hljs.UNDERSCORE_TITLE_MODE]
        }, {
            beginKeywords: 'constructor', end: /\{/, excludeEnd: true
        }],
        illegal: /#(?!!)/
    };
};

_highlightPack2.default.registerLanguage('css', cssFun);
_highlightPack2.default.registerLanguage('json', jsonFun);
_highlightPack2.default.registerLanguage('xml', xmlFun);
_highlightPack2.default.registerLanguage('js', jsFun);

},{"./vendor/highlight-pack.js":49}],42:[function(require,module,exports){
'use strict';

var _jqueryMatchheight = require('./vendor/jquery-matchheight');

var _jqueryMatchheight2 = _interopRequireDefault(_jqueryMatchheight);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

$.fn.matchHeight = _jqueryMatchheight2.default;

+function ($) {
    'use strict';

    $(document).ready(function () {
        matchHeights();

        $(window).on('match-heights', matchHeights);

        function matchHeights() {
            var $heights = $('.match-height');

            if ($heights.length > 0) {
                $heights.matchHeight();
            }
        }
    });

    // https://github.com/liabru/jquery-match-height#manually-trigger-an-update
    window.addEventListener("orientationchange", function () {
        $.fn.matchHeight._update();
    }, false);
}(jQuery);

},{"./vendor/jquery-matchheight":50}],43:[function(require,module,exports){
'use strict';

var _jqueryMatchheight = require('./vendor/jquery-matchheight');

var _jqueryMatchheight2 = _interopRequireDefault(_jqueryMatchheight);

var _arrayHelpers = require('./array-helpers');

var _arrayHelpers2 = _interopRequireDefault(_arrayHelpers);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

$.fn.matchHeight = _jqueryMatchheight2.default;
//import UrlParametersHelper from './url-parameters-helpers';


function newsArchiveBlock(data) {

    var categoryTypes = data.categoryTypes || [];
    var categories = data.categories || [];
    var allArticlesCount = data.allArticlesCount || 0;
    var loadedArticlesCount = data.loadedArticlesCount || 0;
    var nonFeaturedElementsNextToEachOther = data.nonFeaturedElementsNextToEachOther || 0;
    var contentId = data.contentId;
    var itemsPerPage = data.itemsPerPage;
    var currentPage = data.currentPage;

    var UrlParametersHelper = function UrlParametersHelper() {};

    UrlParametersHelper.getParameterValueByName = function (name, url) {
        if (!url) {
            url = window.location.href;
        }
        name = name.replace(/[\[\]]/g, "\\$&");
        var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
            results = regex.exec(url);
        if (!results) return null;
        if (!results[2]) return '';
        return decodeURIComponent(results[2].replace(/\+/g, " "));
    };

    var NewsArchiveBlockArticleLoader = function () {

        var _newsArchiveBlockTotalHitsHeaderKey = "NewsArchiveBlock-TotalHits",
            _newsArchiveBlockLoadedElements = "NewsArchiveBlock-LoadedElements",
            _nonFeaturedElementsNextToEachOtherKey = "NewsArchiveBlock-NonFeaturedElementsNextToEachOther",
            _newsArchiveBlockCurrentPageKey = "NewsArchiveBlock-CurrentPage",
            _hasMore = "NewsArchiveBlock-HasMore",
            _articleCountInOneLoadGrid = itemsPerPage,
            _articleContainer = $('[data-js="more-articles-newsarchive"]'),
            // Article container
        _selectedArticles = [],
            _loadedArticlesCount = 0,
            _allArticlesCount,
            _nonFeaturedElementsNextToEachOther;

        function NewsArchiveBlockArticleLoader(allArticlesCount, nonFeaturedElementsNextToEachOther) {
            _allArticlesCount = allArticlesCount;
            _nonFeaturedElementsNextToEachOther = nonFeaturedElementsNextToEachOther;
        }

        NewsArchiveBlockArticleLoader.prototype.constructor = NewsArchiveBlockArticleLoader;

        NewsArchiveBlockArticleLoader.prototype.getAllArticlesCount = function () {
            return _allArticlesCount;
        };

        NewsArchiveBlockArticleLoader.prototype.getConstArticlesCountInOneLoadGrid = function () {
            return _articleCountInOneLoadGrid;
        };

        NewsArchiveBlockArticleLoader.prototype.getLoadedArticlesCount = function () {
            return _loadedArticlesCount;
        };

        NewsArchiveBlockArticleLoader.prototype.getSelectedArticles = function () {
            return _selectedArticles;
        };

        NewsArchiveBlockArticleLoader.prototype.setSelectedArticles = function (value) {
            _selectedArticles = value;
            _allArticlesCount = typeof _selectedArticles !== 'undefined' && $.isArray(_selectedArticles) ? _selectedArticles.length : 0;
        };

        NewsArchiveBlockArticleLoader.prototype.registerNewElementsAdded = function (elementsCount) {
            _loadedArticlesCount += elementsCount;
        };

        NewsArchiveBlockArticleLoader.prototype.registerCurrentPage = function (page) {
            currentPage = page;
        };

        NewsArchiveBlockArticleLoader.prototype.clearArticles = function () {
            _articleContainer.html('');
            _loadedArticlesCount = 0;
            _selectedArticles = [];
            _nonFeaturedElementsNextToEachOther = 0;
        };

        NewsArchiveBlockArticleLoader.prototype.loadArticles = function (articleLoadedCallback) {
            var nextPage = parseInt(currentPage) + 1;

            var self = this;
            $.ajax({
                url: '/api/getarticles/',
                method: "POST",
                contentType: "application/json",
                data: JSON.stringify({
                    categories: categories,
                    start: _loadedArticlesCount,
                    currentPage: nextPage,
                    Id: contentId,
                    nonFeaturedNextToEachOther: _nonFeaturedElementsNextToEachOther
                }),
                async: true,
                success: function success(data, textStatus, jqXHR) {

                    _allArticlesCount = parseFloat(jqXHR.getResponseHeader(_newsArchiveBlockTotalHitsHeaderKey));

                    //hide the loadmore button if there are no more pages of results.
                    var hasMore = jqXHR.getResponseHeader(_hasMore);
                    if (hasMore === "false") {
                        $(".loadmorewrapper").hide();
                    }

                    _nonFeaturedElementsNextToEachOther = parseFloat(jqXHR.getResponseHeader(_nonFeaturedElementsNextToEachOtherKey));

                    var loadedElementsCount = parseFloat(jqXHR.getResponseHeader(_newsArchiveBlockLoadedElements));
                    self.registerNewElementsAdded(loadedElementsCount);

                    //What is the current page.
                    //var page = nextPage;// jqXHR.getResponseHeader(_newsArchiveBlockCurrentPageKey);

                    //console.log(nextPage);

                    // var xxx = jqXHR.getResponseHeader(_newsArchiveBlockCurrentPageKey);

                    // console.log("x:" + xxx);                   

                    self.registerCurrentPage(nextPage);

                    // Add the new articles
                    _articleContainer.append(data);

                    if ($.isFunction(articleLoadedCallback)) {
                        articleLoadedCallback();
                        // NR-119: This allows the lazyLoad to trigger for the new batch of articles which load in.
                        // Note that this is *not* the ideal way to do this, but the proper way involves Event Dispatcher
                        // and quite a lot of re-engineering of the site.
                        $(window).trigger('resize');
                    }
                    // Right, this is utter shambles, but it mostly works. I need to trigger matchHeight()
                    // but only after the new images have loaded in. Note that it will trigger for all
                    // the new articles, so if the user clicks the "more" button several times, it'll resize
                    // markup further up the page too.
                    var loaded = 0,
                        $newImages = _articleContainer.find('img');

                    $newImages.on('load', function () {
                        loaded++;
                        if (loaded === _articleCountInOneLoadGrid) {
                            $('.match-height').matchHeight();
                        }
                    });
                }
            });
        };

        return NewsArchiveBlockArticleLoader;
    }();

    var NewsArchiveBlockLoadMoreButton = function () {
        var _btnLoadMore = $('[data-js="load-more-newsarchive"]');
        var _articleLoaderHandler;
        var _self;

        function NewsArchiveBlockLoadMoreButton(articleLoaderHandler) {
            _self = this;
            _articleLoaderHandler = articleLoaderHandler;
            _btnLoadMore.click(this.btnClicked);

            // On init we have 9 elements in grid
            this.disableIfNeeded(_articleLoaderHandler.getAllArticlesCount(), _articleLoaderHandler.getConstArticlesCountInOneLoadGrid());
            _articleLoaderHandler.registerNewElementsAdded(loadedArticlesCount);
        }

        NewsArchiveBlockLoadMoreButton.prototype.constructor = NewsArchiveBlockLoadMoreButton;

        NewsArchiveBlockLoadMoreButton.prototype.disableIfNeeded = function (allAvailableItemsCount, loadedItemsCount) {
            if (typeof allAvailableItemsCount !== 'undefined' && !isNaN(allAvailableItemsCount)) {
                if (allAvailableItemsCount <= loadedItemsCount) {
                    _btnLoadMore.hide();
                } else {
                    _btnLoadMore.show();
                }
            }
        };

        NewsArchiveBlockLoadMoreButton.prototype.btnClicked = function () {
            _articleLoaderHandler.loadArticles(function () {
                _self.disableIfNeeded(_articleLoaderHandler.getAllArticlesCount(), _articleLoaderHandler.getLoadedArticlesCount());
            });
        };

        return NewsArchiveBlockLoadMoreButton;
    }();

    var NewsArchiveBlockFilters = function () {
        var _self;
        var _categoryTypesSelect = $('.articles-filter-type-newsarchiveblock');
        var _categoriesSelect = $('.articles-filter-category-newsarchiveblock');
        var _categoryTypes;
        var _categories;
        var _articleLoaderHandler;
        var _loadMoreButtonHandler;

        function NewsArchiveBlockFilters(categoryTypes, categories, articleLoaderHandler, loadMoreButtonHandler) {
            _self = this;
            _categoryTypes = categoryTypes;
            _categories = categories;
            _articleLoaderHandler = articleLoaderHandler;
            _loadMoreButtonHandler = loadMoreButtonHandler;

            this.loadDefaultValuesToDropdowns();
            this.dropdownLoad(_categoryTypesSelect, _categoryTypes);
            this.dropdownLoad(_categoriesSelect, _categories);

            _categoryTypesSelect.change(function (e) {
                _self.selectedDropdownValueChanged(_categoryTypesSelect, _categoryTypes, _categoriesSelect, _categories);
            });
            _categoriesSelect.change(function (e) {
                _self.selectedDropdownValueChanged(_categoriesSelect, _categories, _categoryTypesSelect, _categoryTypes);
            });
        }

        NewsArchiveBlockFilters.prototype.constructor = NewsArchiveBlockFilters;

        NewsArchiveBlockFilters.prototype.loadDefaultValuesToDropdowns = function () {
            _categoryTypesSelect.append($('<option>', {
                value: "",
                text: "Select type"
            }));

            _categoriesSelect.append($('<option>', {
                value: "",
                text: "Select category"
            }));
        };

        NewsArchiveBlockFilters.prototype.dropdownLoad = function (currentDropdown, data) {
            if (typeof data !== 'undefined' && $.isArray(data)) {
                for (var i = 0; i < data.length; i++) {
                    currentDropdown.append($('<option>', {
                        value: data[i].Id,
                        text: data[i].Name
                    }));
                }
            }
        };

        NewsArchiveBlockFilters.prototype.clearDropdown = function (dropdown) {
            dropdown.find('option:gt(0)').remove();
        };

        NewsArchiveBlockFilters.prototype.getDataElementById = function (id, data) {
            return $.grep(data, function (e) {
                return e.Id == id;
            })[0];
        };

        NewsArchiveBlockFilters.prototype.findElementsWithCommonArticles = function (data, selectedElement) {
            if (typeof selectedElement === 'undefined' || selectedElement == null || !$.isArray(selectedElement.Articles) || selectedElement.Articles.length === 0) {
                return data;
            } else {
                var filteredElements = [];
                var selectedElementArticlesIds = _self.getArticleIds(selectedElement.Articles);
                for (var i = 0; i < data.length; i++) {
                    var dataElement = data[i];
                    for (var j = 0; j < dataElement.Articles.length; j++) {
                        var articleId = dataElement.Articles[j].Id;

                        if ($.inArray(articleId, selectedElementArticlesIds) >= 0) {
                            filteredElements.push(dataElement);
                            break;
                        }
                    }
                }
                return filteredElements;
            }
        };

        NewsArchiveBlockFilters.prototype.getArticleIds = function (articles) {
            return $.map(articles, function (val, i) {
                return val.Id;
            });
        };

        NewsArchiveBlockFilters.prototype.dropdownNarrowBySecondDropdownSelectedValue2 = function (currentDropdown, currentDropdownData, secondDropdown, secondDropdownData) {
            var currentDropdownSelectedObject = _self.getDataElementById(currentDropdown.val(), currentDropdownData);
            var secondDropdownSelectedObject = _self.getDataElementById(secondDropdown.val(), secondDropdownData);

            var newSecondDropdownData = typeof currentDropdownSelectedObject === 'undefined' ? secondDropdownData : _self.findElementsWithCommonArticles(secondDropdownData, currentDropdownSelectedObject);
            var secondDropdownSelectedValue = secondDropdown.val();

            _self.clearDropdown(secondDropdown);
            _self.dropdownLoad(secondDropdown, newSecondDropdownData);
            secondDropdown.val(secondDropdownSelectedValue);
        };

        NewsArchiveBlockFilters.prototype.dropdownNarrowBySecondDropdownSelectedValue = function (currentDropdow, currentData, articlesInSelectedValueInAnotherDropdow) {
            _self.clearDropdown(currentDropdow);
            if (typeof currentData !== 'undefined' && $.isArray(currentData)) {
                if (articlesInSelectedValueInAnotherDropdow == null || $.isArray(articlesInSelectedValueInAnotherDropdow) && articlesInSelectedValueInAnotherDropdow.length === 0) {
                    _self.dropdownLoad(currentDropdow, data);
                } else {
                    for (var i = 0; i < currentData.length; i++) {
                        var articlesInType = currentData[i].Articles;
                        if (this.arraysIntersect(articlesInSelectedValueInAnotherDropdow, articlesInType).length > 0) {
                            var type = currentData[i];
                            currentDropdow.append($('<option>', {
                                value: type.Id,
                                text: type.Name
                            }));
                        }
                    }
                }
            }
        };

        NewsArchiveBlockFilters.prototype.setQueryString = function (type, category) {
            var newUrl = window.location.pathname;
            if (newUrl.indexOf('/', newUrl.length - 1) === -1) {
                newUrl = newUrl + '/';
            }
            var typeHasValue = type != null && type !== "";
            var categoryHasValue = category != null && category !== "";

            if (typeHasValue || categoryHasValue) newUrl += '?';

            if (typeHasValue) {
                newUrl += 't=' + type;
            }
            if (categoryHasValue) {
                if (typeHasValue) newUrl += '&';
                newUrl += 'c=' + category;
            }

            if (!$('html').hasClass('IE9')) {
                window.history.replaceState("news-archive-block", "Content Hub", newUrl);
            }
        };

        NewsArchiveBlockFilters.prototype.sortArticles = function (articles) {
            return articles.sort(function (first, second) {
                var publishedDateFirst = new Date(first.PublishedTime);
                var publishedDateSecond = new Date(second.PublishedTime);
                if (publishedDateFirst == publishedDateSecond) {
                    return 0;
                }
                if (publishedDateFirst < publishedDateSecond) {
                    return 1;
                } else {
                    return -1;
                }
            });
        };

        NewsArchiveBlockFilters.prototype.loadArticlesBasedOnDropdowns = function (callback) {
            var selectedType = _self.getDataElementById(_categoryTypesSelect.val(), _categoryTypes);
            var selectedCategory = _self.getDataElementById(_categoriesSelect.val(), _categories);

            var articlesCount = 0;

            if (typeof selectedType !== 'undefined' && typeof selectedCategory !== 'undefined') {
                var articles = _arrayHelpers2.default.intersect(selectedType.Articles, _self.getArticleIds(selectedCategory.Articles), function (element, articleIdsArray) {
                    return $.inArray(element.Id, articleIdsArray) >= 0;
                });
                var sortedByDate = _self.sortArticles(articles);
            }

            _articleLoaderHandler.loadArticles(function () {
                _loadMoreButtonHandler.disableIfNeeded(_articleLoaderHandler.getAllArticlesCount(), _articleLoaderHandler.getLoadedArticlesCount());
                if (typeof callback !== 'undefined' && $.isFunction(callback)) {
                    callback();
                }
            });
        };

        NewsArchiveBlockFilters.prototype.getDataUrlNameById = function (id, data) {
            var first = $.grep(data, function (e) {
                return e.Id == id;
            })[0];
            if (first != null) return first.Name.trim().toLowerCase().replace(/[^a-zA-Z0-9_-]/g, '_');
            return first;
        };

        NewsArchiveBlockFilters.prototype.getDataUrlIdByName = function (name, data) {
            var first = $.grep(data, function (e) {
                return e.Name.trim().toLowerCase().replace(/[^a-zA-Z0-9_-]/g, '_') == name;
            })[0];
            if (first != null) return first.Id;
            return first;
        };

        NewsArchiveBlockFilters.prototype.selectedDropdownValueChanged = function (currentDropdown, currentData, secondDropdown, secondDropdownData, callback) {
            if (currentDropdown.val() == null) {
                currentDropdown.val("");
            }

            //Set the categories to the value of the selected in the category dropdown.
            categories = _categoriesSelect.val();

            _articleLoaderHandler.clearArticles();

            _self.dropdownNarrowBySecondDropdownSelectedValue2(currentDropdown, currentData, secondDropdown, secondDropdownData);

            _self.setQueryString(_self.getDataUrlNameById(_categoryTypesSelect.val(), _categoryTypes), _self.getDataUrlNameById(_categoriesSelect.val(), _categories));
            _self.loadArticlesBasedOnDropdowns(callback);
        };

        NewsArchiveBlockFilters.prototype.firstLoad = function () {
            var type = UrlParametersHelper.getParameterValueByName('t');
            var category = UrlParametersHelper.getParameterValueByName('c');
            if (type != null) {

                if (isNaN(type)) {
                    _categoryTypesSelect.val(_self.getDataUrlIdByName(type, _categoryTypes));
                } else {
                    _categoryTypesSelect.val(type);
                }

                _self.selectedDropdownValueChanged(_categoryTypesSelect, _categoryTypes, _categoriesSelect, _categories, function () {
                    if (category != null) {

                        if (isNaN(category)) {
                            _categoriesSelect.val(_self.getDataUrlIdByName(category, _categories));
                        } else {
                            _categoriesSelect.val(category);
                        }

                        _self.selectedDropdownValueChanged(_categoriesSelect, _categories, _categoryTypesSelect, _categoryTypes);
                    }
                });
            } else if (category != null) {
                if (isNaN(category)) {
                    _categoriesSelect.val(_self.getDataUrlIdByName(category, _categories));
                } else {
                    _categoriesSelect.val(category);
                }
                _self.selectedDropdownValueChanged(_categoriesSelect, _categories, _categoryTypesSelect, _categoryTypes);
            }
        };

        return NewsArchiveBlockFilters;
    }();

    var ArticleLoader = new NewsArchiveBlockArticleLoader(allArticlesCount, nonFeaturedElementsNextToEachOther);
    var LoadMoreButton = new NewsArchiveBlockLoadMoreButton(ArticleLoader);
    var Filters = new NewsArchiveBlockFilters(categoryTypes, categories, ArticleLoader, LoadMoreButton);
    Filters.firstLoad();
}

$(document).ready(function () {
    if (typeof window.newsFeed !== 'undefined') {
        newsArchiveBlock(window.newsFeed);
    }
});

},{"./array-helpers":35,"./vendor/jquery-matchheight":50}],44:[function(require,module,exports){
"use strict";

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = postCodeLookup;
function postCodeLookup(addressSearchId, failRedirectUrl, passRedirectUrl, id, postcodeCheckBlock) {
    // console.log(id);
    var addressInput = $(addressSearchId);
    var addressSearchIdName = "";
    if (addressSearchId && addressSearchId.length > 0) {
        addressSearchIdName = addressSearchId.slice(1, addressSearchId.length);
    }

    if ($('#AddressSearch_Postcode').length > 0 && !postcodeCheckBlock) {
        addressSearchExtrasPostcode();
    }

    //When this is being run via the Postcode Check Block we do things a little different. Should be refactored at a later date.
    if (postcodeCheckBlock) {
        postcodeCheckInit();
    }

    // USED FUNCTIONS:
    // CHECK POSTCODE FUNCTION
    function checkPostCodeIsValid(targetURL, targetData) {
        $.ajax({
            url: targetURL,
            method: "GET",
            data: targetData,
            async: true
        }).done(function (data) {

            //console.log(data);

            $('#postcode_fail').hide();
            $('#postcode_pass').hide();
            $('#postcode_invalid').hide();

            var element = document.getElementById($('input[data-lookupid]').attr("id"));
            var event = new Event('change');

            if (data === "not a valid postcode") {
                $('#postcode_invalid').show();
                $('input[data-lookupid]').val("fail");
                if (element) {
                    element.dispatchEvent(event);
                }

                $('.btnNext').hide();
            } else if (data === "false") {
                if (failRedirectUrl !== "") {
                    window.location.href = failRedirectUrl;
                } else {
                    $('#postcode_fail').show();
                    $('input[data-lookupid]').val("fail");
                    if (element) {
                        element.dispatchEvent(event);
                    }
                    $('.btnNext').hide();
                }
            } else {

                if (passRedirectUrl !== "") {
                    window.location.href = passRedirectUrl;
                } else {
                    $('#postcode_pass').show();
                    $('input[data-lookupid]').val("pass");
                    if (element) {
                        element.dispatchEvent(event);
                    }
                    $('.btnNext').show();
                }
            }
        });
    }

    function checkPostCodeIsValidV2(targetURL, targetData) {

        $.ajax({
            url: targetURL,
            method: "GET",
            data: targetData,
            async: true
        }).done(function (data) {

            //console.log(data);

            $('span[data-postcodefail=' + addressSearchIdName + ']').hide();
            $('span[data-postcodepass=' + addressSearchIdName + ']').hide();
            $('span[data-postcodeinvalid=' + addressSearchIdName + ']').hide();

            var element = $('input[data-lookupidpccb=' + addressSearchIdName + ']')[0];
            var event = new Event('change');

            if (data === "not a valid postcode") {
                $('span[data-postcodeinvalid=' + addressSearchIdName + ']').show();
                $('input[data-lookupidpccb=' + addressSearchIdName + ']').val("fail");
                if (element) {
                    element.dispatchEvent(event);
                }

                //$('.btnNext').hide();
            } else if (data === "false") {
                if (failRedirectUrl !== "") {
                    window.location.href = failRedirectUrl;
                } else {
                    $('span[data-postcodefail=' + addressSearchIdName + ']').show();
                    $('input[data-lookupidpccb=' + addressSearchIdName + ']').val("fail");
                    if (element) {
                        element.dispatchEvent(event);
                    }
                    //$('.btnNext').hide();
                }
            } else {

                if (passRedirectUrl !== "") {
                    window.location.href = passRedirectUrl;
                } else {
                    $('span[data-postcodepass=' + addressSearchIdName + ']').show();
                    $('input[data-lookupidpccb=' + addressSearchIdName + ']').val("pass");
                    if (element) {
                        element.dispatchEvent(event);
                    }
                    //$('.btnNext').show();
                }
            }
        });
    }

    function addressSearchExtrasPostcode() {
        //When the postcode check is on a page we need to hide the next button until the postcode check is valid.
        $('.btnNext').hide();

        //preventing enter in the field submitting the form, as this does not do the postcode check
        $('.no-enter-submit').keydown(function (e) {
            if (e.keyCode === 13) {
                e.preventDefault();
                return false;
            }
        });

        $('#postcode_invalid').after('<br><button type="button" id="AddressSearchPostcodeBtn" class="btn btn-primary">Check Postcode</button>');

        $('#AddressSearch_Postcode').parents('.FormTextbox').addClass('AddressSearchContainer');

        $('#AddressSearchPostcodeBtn').click(function (e) {
            e.preventDefault();
            e.stopImmediatePropagation();

            checkPostCodeIsValid('/Postcode/ValidCheck/' + id + '/' + addressInput.val() + '/', {}, true);
        });
    }

    function postcodeCheckInit() {
        //When the postcode check is on a page we need to hide the next button until the postcode check is valid.
        //Is this needed?
        //$('.btnNext').hide();

        //preventing enter in the field submitting the form, as this does not do the postcode check
        $('.no-enter-submit').keydown(function (e) {
            if (e.keyCode === 13) {
                e.preventDefault();
                return false;
            }
        });

        addressInput.parents('.FormTextbox').addClass('AddressSearchContainer');

        //Find the Check Postcode button related to this instance
        $('button[data-postcodebtn=' + addressSearchId.slice(1, addressSearchId.length) + ']').click(function (e) {
            e.preventDefault();
            e.stopImmediatePropagation();

            checkPostCodeIsValidV2('/Postcode/ValidCheck/' + id + '/' + addressInput.val() + '/', {});
        });
    }
}

},{}],45:[function(require,module,exports){
"use strict";

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = prefferedBranchCookie;

var _cookieUtils = require("./cookie-utils");

var _cookieUtils2 = _interopRequireDefault(_cookieUtils);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function prefferedBranchCookie() {
    var _cookieNamePrefferedBranchId = "pbId";
    var category = _cookieUtils2.default.categories.functional;

    function isCorrectUnsignedNumber(number) {
        return (/^[\d]+$/.test(number)
        );
    }

    function setPrefferedBranchId(prefferedBranchId) {
        if (isCorrectUnsignedNumber(prefferedBranchId)) {
            var date = new Date();
            date.setMonth(date.getMonth() + 3);
            _cookieUtils2.default.setCookie(category, _cookieNamePrefferedBranchId, prefferedBranchId, date.toString(), "/");
        }
    }

    function getPrefferedBranchId() {
        var cookie = _cookieUtils2.default.getCookie(_cookieNamePrefferedBranchId, category);
        if (typeof cookie !== "undefined") {
            var branchId = parseInt(cookie);
            if (typeof branchId !== "undefined" && !isNaN(branchId)) {
                return branchId;
            }
        }
        return 0;
    }

    function removePrefferedBranchId() {
        _cookieUtils2.default.removeCookie(_cookieNamePrefferedBranchId);
    }

    return {
        setPrefferedBranchId: setPrefferedBranchId,
        getPrefferedBranchId: getPrefferedBranchId,
        removePrefferedBranchId: removePrefferedBranchId
    };
}

},{"./cookie-utils":39}],46:[function(require,module,exports){
'use strict';

+function ($) {
    'use strict';

    $(document).ready(function () {
        // That old target="_blank" security fix
        // dev.to/ben/the-targetblank-vulnerability-by-example
        $('[target="_blank"]').each(function () {
            var rel = $(this).attr('rel');
            if (!rel) {
                $(this).attr('rel', 'noopener noreferrer');
            } else {
                if (rel.indexOf('noopener') === -1) {
                    this.rel += ' noopener';
                }
                if (rel.indexOf('noreferrer') === -1) {
                    this.rel += ' noreferrer';
                }
            }
        });
    });
}(jQuery);

},{}],47:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
// So Joe says this is OK, as long as the JavaScript doesn't get too complex.
+function ($) {
    'use strict';

    $(document).ready(function () {

        $('body').addClass('js').removeClass('no-js');

        // Polyfill for IE. Poor IE.
        if (typeof Object.assign != 'function') {
            Object.assign = function (target) {
                'use strict';

                if (target == null) {
                    throw new TypeError('Cannot convert undefined or null to object');
                }

                target = Object(target);
                for (var index = 1; index < arguments.length; index++) {
                    var source = arguments[index];
                    if (source != null) {
                        for (var key in source) {
                            if (Object.prototype.hasOwnProperty.call(source, key)) {
                                target[key] = source[key];
                            }
                        }
                    }
                }
                return target;
            };
        }

        // Tries to force PDFs to open in a new window
        $('a[href*=".pdf"]').click(function () {
            var $that = $(this);
            if (!$that.is('[target]')) {
                window.open($that.attr('href'), '_blank');
                return false;
            }
        });

        // Sometimes, hidden check-boxes are used to toggle things on and off.
        // When these checkboxes fall into focus, this isn't reflected in their associated
        // (and visible) label tags.
        $('input.u-sr-only').focus(function () {
            $('[for="' + $(this).attr('id') + '"').addClass('u-focus');
        }).blur(function () {
            $('[for="' + $(this).attr('id') + '"').removeClass('u-focus');
        });

        // Gives any iframes which creepy third-party services vomit onto the page a title attribute,
        // to satisfy SiteImprove. Basically, I make computers happy for a living.
        $('iframe').each(function () {
            var $that = $(this),
                iframeSRC = $that.attr('data-src'),
                iframeTitle = $that.attr('title'),
                hostname;

            if (iframeSRC === undefined) {
                iframeSRC = $that.attr('src');
            }

            // Finds the hostname from the iframe src
            console.log(iframeSRC);
            if (iframeSRC !== 'undefined' || new URL(iframeSRC)) {
                hostname = new URL(iframeSRC).hostname;
            } else {
                hostname = 'Mysterious iframe. Please ignore.';
            }
            // Google Maps likes to add a hidden iframe on the page, for funsies.
            // Unfortunately, this code runs before Google adds the iframe to the page, and $(document).load is throwing an error.
            if (iframeSRC === 'about:blank') {
                $that.attr('title', 'Google maps');
            }
            // The current iframe doesn't have a title, but does have a src attribute
            else if (!iframeTitle && hostname !== '') {
                    $that.attr('title', hostname);
                    // For some reason, someone's added an iframe which points nowhere
                } else if (!iframeTitle) {
                    $that.attr('title', 'Mysterious iframe. Please ignore.');
                }
        });

        // Google Recaptcha burps an iframe into the page, but it's not very punctual. This tries to add a title attribute to it,
        // using the tried-and-tested technique of BRUTE FORCE. Yes, this is crude. Thanks for noticing.
        var chaChaCha = $('.FormRecaptcha');

        // Is there a Recaptcha on this page?
        if (chaChaCha.length) {
            var iframeCheck = function iframeCheck() {
                if (typeof chaChaCha.find('iframe').attr('title') !== 'undefined') {
                    clearInterval(timerId);
                } else {
                    chaChaCha.find('iframe').attr('title', 'Google Recaptcha');
                }
            };

            var current = 0,
                max = 2000;
            var timerId = setInterval(function () {
                iframeCheck();
                if (current == max) {
                    clearInterval(timerId);
                }
                current = current + 200;
            }, 500);
        }

        // Sometime, you need a fake form which doesn't submit
        $('[data-js="fake-form"]').submit(function (event) {
            event.preventDefault();
        });
    });
}(jQuery);

/*
 * Replacement functions for common jQuery uses that are not as tidy in ES6
*/

//Add or remove classes to a set of elements
function addClass(elements, className) {
    Array.prototype.forEach.call(elements, function (el, i) {
        el.classList.add(className);
    });
}

function removeClass(elements, className) {
    Array.prototype.forEach.call(elements, function (el, i) {
        el.classList.remove(className);
    });
}

//Add or remove attributes from a set of elements 
function setAttributes(elements, attribute, value) {
    Array.prototype.forEach.call(elements, function (el, i) {
        el.setAttribute(attribute, value);
    });
}

function removeAttributes(elements, attribute) {
    Array.prototype.forEach.call(elements, function (el, i) {
        el.removeAttribute(attribute);
    });
}

function removeHash() {
    var scrollV,
        scrollH,
        loc = window.location;
    if ("pushState" in history) history.pushState("", document.title, loc.pathname + loc.search);else {
        // Prevent scrolling by storing the page's current scroll offset
        scrollV = document.body.scrollTop;
        scrollH = document.body.scrollLeft;

        loc.hash = "";

        // Restore the scroll offset, should be flicker free
        document.body.scrollTop = scrollV;
        document.body.scrollLeft = scrollH;
    }
}

function addHash(hash) {
    var scrollV,
        scrollH,
        loc = window.location;
    if ("pushState" in history) history.pushState(null, null, hash);else {
        // Prevent scrolling by storing the page's current scroll offset
        scrollV = document.body.scrollTop;
        scrollH = document.body.scrollLeft;

        loc.hash = hash;

        // Restore the scroll offset, should be flicker free
        document.body.scrollTop = scrollV;
        document.body.scrollLeft = scrollH;
    }
}

function triggerClick(element) {
    if (element.onclick) {
        element.onclick();
    } else if (element.click) {
        element.click();
    }
}

var getParents = function getParents(elem, selector) {

    // Element.matches() polyfill
    if (!Element.prototype.matches) {
        Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function (s) {
            var matches = (this.document || this.ownerDocument).querySelectorAll(s),
                i = matches.length;
            while (--i >= 0 && matches.item(i) !== this) {}
            return i > -1;
        };
    }

    // Set up a parent array
    var parents = [];

    // Push each parent element to the array
    for (; elem && elem !== document; elem = elem.parentNode) {
        if (selector) {
            if (elem.matches(selector)) {
                parents.push(elem);
            }
            continue;
        }
        parents.push(elem);
    }

    // Return our parent array
    return parents;
};

exports.addClass = addClass;
exports.removeClass = removeClass;
exports.setAttributes = setAttributes;
exports.removeAttributes = removeAttributes;
exports.removeHash = removeHash;
exports.addHash = addHash;
exports.triggerClick = triggerClick;
exports.getParents = getParents;

},{}],48:[function(require,module,exports){
"use strict";

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

!function (t, e) {
  "object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : t.dayjs = e();
}(undefined, function () {
  "use strict";
  var t = "millisecond",
      e = "second",
      n = "minute",
      r = "hour",
      i = "day",
      s = "week",
      u = "month",
      a = "quarter",
      o = "year",
      f = "date",
      h = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,
      c = /\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,
      d = function d(t, e, n) {
    var r = String(t);return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
  },
      $ = { s: d, z: function z(t) {
      var e = -t.utcOffset(),
          n = Math.abs(e),
          r = Math.floor(n / 60),
          i = n % 60;return (e <= 0 ? "+" : "-") + d(r, 2, "0") + ":" + d(i, 2, "0");
    }, m: function t(e, n) {
      if (e.date() < n.date()) return -t(n, e);var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
          i = e.add(r, u),
          s = n - i < 0,
          a = e.add(r + (s ? -1 : 1), u);return +(-(r + (n - i) / (s ? i - a : a - i)) || 0);
    }, a: function a(t) {
      return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
    }, p: function p(h) {
      return { M: u, y: o, w: s, d: i, D: f, h: r, m: n, s: e, ms: t, Q: a }[h] || String(h || "").toLowerCase().replace(/s$/, "");
    }, u: function u(t) {
      return void 0 === t;
    } },
      l = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_") },
      y = "en",
      M = {};M[y] = l;var m = function m(t) {
    return t instanceof S;
  },
      D = function D(t, e, n) {
    var r;if (!t) return y;if ("string" == typeof t) M[t] && (r = t), e && (M[t] = e, r = t);else {
      var i = t.name;M[i] = t, r = i;
    }return !n && r && (y = r), r || !n && y;
  },
      v = function v(t, e) {
    if (m(t)) return t.clone();var n = "object" == (typeof e === "undefined" ? "undefined" : _typeof(e)) ? e : {};return n.date = t, n.args = arguments, new S(n);
  },
      g = $;g.l = D, g.i = m, g.w = function (t, e) {
    return v(t, { locale: e.$L, utc: e.$u, $offset: e.$offset });
  };var S = function () {
    function d(t) {
      this.$L = this.$L || D(t.locale, null, !0), this.parse(t);
    }var $ = d.prototype;return $.parse = function (t) {
      this.$d = function (t) {
        var e = t.date,
            n = t.utc;if (null === e) return new Date(NaN);if (g.u(e)) return new Date();if (e instanceof Date) return new Date(e);if ("string" == typeof e && !/Z$/i.test(e)) {
          var r = e.match(h);if (r) {
            var i = r[2] - 1 || 0;return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, r[7] || 0)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, r[7] || 0);
          }
        }return new Date(e);
      }(t), this.init();
    }, $.init = function () {
      var t = this.$d;this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
    }, $.$utils = function () {
      return g;
    }, $.isValid = function () {
      return !("Invalid Date" === this.$d.toString());
    }, $.isSame = function (t, e) {
      var n = v(t);return this.startOf(e) <= n && n <= this.endOf(e);
    }, $.isAfter = function (t, e) {
      return v(t) < this.startOf(e);
    }, $.isBefore = function (t, e) {
      return this.endOf(e) < v(t);
    }, $.$g = function (t, e, n) {
      return g.u(t) ? this[e] : this.set(n, t);
    }, $.unix = function () {
      return Math.floor(this.valueOf() / 1e3);
    }, $.valueOf = function () {
      return this.$d.getTime();
    }, $.startOf = function (t, a) {
      var h = this,
          c = !!g.u(a) || a,
          d = g.p(t),
          $ = function $(t, e) {
        var n = g.w(h.$u ? Date.UTC(h.$y, e, t) : new Date(h.$y, e, t), h);return c ? n : n.endOf(i);
      },
          l = function l(t, e) {
        return g.w(h.toDate()[t].apply(h.toDate("s"), (c ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), h);
      },
          y = this.$W,
          M = this.$M,
          m = this.$D,
          D = "set" + (this.$u ? "UTC" : "");switch (d) {case o:
          return c ? $(1, 0) : $(31, 11);case u:
          return c ? $(1, M) : $(0, M + 1);case s:
          var v = this.$locale().weekStart || 0,
              S = (y < v ? y + 7 : y) - v;return $(c ? m - S : m + (6 - S), M);case i:case f:
          return l(D + "Hours", 0);case r:
          return l(D + "Minutes", 1);case n:
          return l(D + "Seconds", 2);case e:
          return l(D + "Milliseconds", 3);default:
          return this.clone();}
    }, $.endOf = function (t) {
      return this.startOf(t, !1);
    }, $.$set = function (s, a) {
      var h,
          c = g.p(s),
          d = "set" + (this.$u ? "UTC" : ""),
          $ = (h = {}, h[i] = d + "Date", h[f] = d + "Date", h[u] = d + "Month", h[o] = d + "FullYear", h[r] = d + "Hours", h[n] = d + "Minutes", h[e] = d + "Seconds", h[t] = d + "Milliseconds", h)[c],
          l = c === i ? this.$D + (a - this.$W) : a;if (c === u || c === o) {
        var y = this.clone().set(f, 1);y.$d[$](l), y.init(), this.$d = y.set(f, Math.min(this.$D, y.daysInMonth())).$d;
      } else $ && this.$d[$](l);return this.init(), this;
    }, $.set = function (t, e) {
      return this.clone().$set(t, e);
    }, $.get = function (t) {
      return this[g.p(t)]();
    }, $.add = function (t, a) {
      var f,
          h = this;t = Number(t);var c = g.p(a),
          d = function d(e) {
        var n = v(h);return g.w(n.date(n.date() + Math.round(e * t)), h);
      };if (c === u) return this.set(u, this.$M + t);if (c === o) return this.set(o, this.$y + t);if (c === i) return d(1);if (c === s) return d(7);var $ = (f = {}, f[n] = 6e4, f[r] = 36e5, f[e] = 1e3, f)[c] || 1,
          l = this.$d.getTime() + t * $;return g.w(l, this);
    }, $.subtract = function (t, e) {
      return this.add(-1 * t, e);
    }, $.format = function (t) {
      var e = this;if (!this.isValid()) return "Invalid Date";var n = t || "YYYY-MM-DDTHH:mm:ssZ",
          r = g.z(this),
          i = this.$locale(),
          s = this.$H,
          u = this.$m,
          a = this.$M,
          o = i.weekdays,
          f = i.months,
          h = function h(t, r, i, s) {
        return t && (t[r] || t(e, n)) || i[r].substr(0, s);
      },
          d = function d(t) {
        return g.s(s % 12 || 12, t, "0");
      },
          $ = i.meridiem || function (t, e, n) {
        var r = t < 12 ? "AM" : "PM";return n ? r.toLowerCase() : r;
      },
          l = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a + 1, MM: g.s(a + 1, 2, "0"), MMM: h(i.monthsShort, a, f, 3), MMMM: h(f, a), D: this.$D, DD: g.s(this.$D, 2, "0"), d: String(this.$W), dd: h(i.weekdaysMin, this.$W, o, 2), ddd: h(i.weekdaysShort, this.$W, o, 3), dddd: o[this.$W], H: String(s), HH: g.s(s, 2, "0"), h: d(1), hh: d(2), a: $(s, u, !0), A: $(s, u, !1), m: String(u), mm: g.s(u, 2, "0"), s: String(this.$s), ss: g.s(this.$s, 2, "0"), SSS: g.s(this.$ms, 3, "0"), Z: r };return n.replace(c, function (t, e) {
        return e || l[t] || r.replace(":", "");
      });
    }, $.utcOffset = function () {
      return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
    }, $.diff = function (t, f, h) {
      var c,
          d = g.p(f),
          $ = v(t),
          l = 6e4 * ($.utcOffset() - this.utcOffset()),
          y = this - $,
          M = g.m(this, $);return M = (c = {}, c[o] = M / 12, c[u] = M, c[a] = M / 3, c[s] = (y - l) / 6048e5, c[i] = (y - l) / 864e5, c[r] = y / 36e5, c[n] = y / 6e4, c[e] = y / 1e3, c)[d] || y, h ? M : g.a(M);
    }, $.daysInMonth = function () {
      return this.endOf(u).$D;
    }, $.$locale = function () {
      return M[this.$L];
    }, $.locale = function (t, e) {
      if (!t) return this.$L;var n = this.clone(),
          r = D(t, e, !0);return r && (n.$L = r), n;
    }, $.clone = function () {
      return g.w(this.$d, this);
    }, $.toDate = function () {
      return new Date(this.valueOf());
    }, $.toJSON = function () {
      return this.isValid() ? this.toISOString() : null;
    }, $.toISOString = function () {
      return this.$d.toISOString();
    }, $.toString = function () {
      return this.$d.toUTCString();
    }, d;
  }(),
      p = S.prototype;return v.prototype = p, [["$ms", t], ["$s", e], ["$m", n], ["$H", r], ["$W", i], ["$M", u], ["$y", o], ["$D", f]].forEach(function (t) {
    p[t[1]] = function (e) {
      return this.$g(e, t[0], t[1]);
    };
  }), v.extend = function (t, e) {
    return t(e, S, v), v;
  }, v.locale = D, v.isDayjs = m, v.unix = function (t) {
    return v(1e3 * t);
  }, v.en = M[y], v.Ls = M, v;
});

},{}],49:[function(require,module,exports){
'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

/*
Syntax highlighting with language autodetection.
https://highlightjs.org/
*/

(function (factory) {

    // Find the global object for export to both the browser and web workers.
    var globalObject = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window || (typeof self === 'undefined' ? 'undefined' : _typeof(self)) === 'object' && self;

    // Setup highlight.js for different environments. First is Node.js or
    // CommonJS.
    if (typeof exports !== 'undefined') {
        factory(exports);
    } else if (globalObject) {
        // Export hljs globally even when using AMD for cases when this script
        // is loaded with others that may still expect a global hljs.
        globalObject.hljs = factory({});

        // Finally register the global hljs with AMD.
        if (typeof define === 'function' && define.amd) {
            define([], function () {
                return globalObject.hljs;
            });
        }
    }
})(function (hljs) {
    // Convenience variables for build-in objects
    var ArrayProto = [],
        objectKeys = Object.keys;

    // Global internal variables used within the highlight.js library.
    var languages = {},
        aliases = {};

    // Regular expressions used throughout the highlight.js library.
    var noHighlightRe = /^(no-?highlight|plain|text)$/i,
        languagePrefixRe = /\blang(?:uage)?-([\w-]+)\b/i,
        fixMarkupRe = /((^(<[^>]+>|\t|)+|(?:\n)))/gm;

    var spanEndTag = '</span>';

    // Global options used when within external APIs. This is modified when
    // calling the `hljs.configure` function.
    var options = {
        classPrefix: 'hljs-',
        tabReplace: null,
        useBR: false,
        languages: undefined
    };

    /* Utility functions */

    function escape(value) {
        return value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
    }

    function tag(node) {
        return node.nodeName.toLowerCase();
    }

    function testRe(re, lexeme) {
        var match = re && re.exec(lexeme);
        return match && match.index === 0;
    }

    function isNotHighlighted(language) {
        return noHighlightRe.test(language);
    }

    function blockLanguage(block) {
        var i, match, length, _class;
        var classes = block.className + ' ';

        classes += block.parentNode ? block.parentNode.className : '';

        // language-* takes precedence over non-prefixed class names.
        match = languagePrefixRe.exec(classes);
        if (match) {
            return getLanguage(match[1]) ? match[1] : 'no-highlight';
        }

        classes = classes.split(/\s+/);

        for (i = 0, length = classes.length; i < length; i++) {
            _class = classes[i];

            if (isNotHighlighted(_class) || getLanguage(_class)) {
                return _class;
            }
        }
    }

    function inherit(parent) {
        // inherit(parent, override_obj, override_obj, ...)
        var key;
        var result = {};
        var objects = Array.prototype.slice.call(arguments, 1);

        for (key in parent) {
            result[key] = parent[key];
        }objects.forEach(function (obj) {
            for (key in obj) {
                result[key] = obj[key];
            }
        });
        return result;
    }

    /* Stream merging */

    function nodeStream(node) {
        var result = [];
        (function _nodeStream(node, offset) {
            for (var child = node.firstChild; child; child = child.nextSibling) {
                if (child.nodeType === 3) offset += child.nodeValue.length;else if (child.nodeType === 1) {
                    result.push({
                        event: 'start',
                        offset: offset,
                        node: child
                    });
                    offset = _nodeStream(child, offset);
                    // Prevent void elements from having an end tag that would actually
                    // double them in the output. There are more void elements in HTML
                    // but we list only those realistically expected in code display.
                    if (!tag(child).match(/br|hr|img|input/)) {
                        result.push({
                            event: 'stop',
                            offset: offset,
                            node: child
                        });
                    }
                }
            }
            return offset;
        })(node, 0);
        return result;
    }

    function mergeStreams(original, highlighted, value) {
        var processed = 0;
        var result = '';
        var nodeStack = [];

        function selectStream() {
            if (!original.length || !highlighted.length) {
                return original.length ? original : highlighted;
            }
            if (original[0].offset !== highlighted[0].offset) {
                return original[0].offset < highlighted[0].offset ? original : highlighted;
            }

            /*
            To avoid starting the stream just before it should stop the order is
            ensured that original always starts first and closes last:
                    if (event1 == 'start' && event2 == 'start')
              return original;
            if (event1 == 'start' && event2 == 'stop')
              return highlighted;
            if (event1 == 'stop' && event2 == 'start')
              return original;
            if (event1 == 'stop' && event2 == 'stop')
              return highlighted;
                    ... which is collapsed to:
            */
            return highlighted[0].event === 'start' ? original : highlighted;
        }

        function open(node) {
            function attr_str(a) {
                return ' ' + a.nodeName + '="' + escape(a.value).replace('"', '&quot;') + '"';
            }
            result += '<' + tag(node) + ArrayProto.map.call(node.attributes, attr_str).join('') + '>';
        }

        function close(node) {
            result += '</' + tag(node) + '>';
        }

        function render(event) {
            (event.event === 'start' ? open : close)(event.node);
        }

        while (original.length || highlighted.length) {
            var stream = selectStream();
            result += escape(value.substring(processed, stream[0].offset));
            processed = stream[0].offset;
            if (stream === original) {
                /*
                On any opening or closing tag of the original markup we first close
                the entire highlighted node stack, then render the original tag along
                with all the following original tags at the same offset and then
                reopen all the tags on the highlighted stack.
                */
                nodeStack.reverse().forEach(close);
                do {
                    render(stream.splice(0, 1)[0]);
                    stream = selectStream();
                } while (stream === original && stream.length && stream[0].offset === processed);
                nodeStack.reverse().forEach(open);
            } else {
                if (stream[0].event === 'start') {
                    nodeStack.push(stream[0].node);
                } else {
                    nodeStack.pop();
                }
                render(stream.splice(0, 1)[0]);
            }
        }
        return result + escape(value.substr(processed));
    }

    /* Initialization */

    function expand_mode(mode) {
        if (mode.variants && !mode.cached_variants) {
            mode.cached_variants = mode.variants.map(function (variant) {
                return inherit(mode, { variants: null }, variant);
            });
        }
        return mode.cached_variants || mode.endsWithParent && [inherit(mode)] || [mode];
    }

    function compileLanguage(language) {

        function reStr(re) {
            return re && re.source || re;
        }

        function langRe(value, global) {
            return new RegExp(reStr(value), 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : ''));
        }

        function compileMode(mode, parent) {
            if (mode.compiled) return;
            mode.compiled = true;

            mode.keywords = mode.keywords || mode.beginKeywords;
            if (mode.keywords) {
                var compiled_keywords = {};

                var flatten = function flatten(className, str) {
                    if (language.case_insensitive) {
                        str = str.toLowerCase();
                    }
                    str.split(' ').forEach(function (kw) {
                        var pair = kw.split('|');
                        compiled_keywords[pair[0]] = [className, pair[1] ? Number(pair[1]) : 1];
                    });
                };

                if (typeof mode.keywords === 'string') {
                    // string
                    flatten('keyword', mode.keywords);
                } else {
                    objectKeys(mode.keywords).forEach(function (className) {
                        flatten(className, mode.keywords[className]);
                    });
                }
                mode.keywords = compiled_keywords;
            }
            mode.lexemesRe = langRe(mode.lexemes || /\w+/, true);

            if (parent) {
                if (mode.beginKeywords) {
                    mode.begin = '\\b(' + mode.beginKeywords.split(' ').join('|') + ')\\b';
                }
                if (!mode.begin) mode.begin = /\B|\b/;
                mode.beginRe = langRe(mode.begin);
                if (!mode.end && !mode.endsWithParent) mode.end = /\B|\b/;
                if (mode.end) mode.endRe = langRe(mode.end);
                mode.terminator_end = reStr(mode.end) || '';
                if (mode.endsWithParent && parent.terminator_end) mode.terminator_end += (mode.end ? '|' : '') + parent.terminator_end;
            }
            if (mode.illegal) mode.illegalRe = langRe(mode.illegal);
            if (mode.relevance == null) mode.relevance = 1;
            if (!mode.contains) {
                mode.contains = [];
            }
            mode.contains = Array.prototype.concat.apply([], mode.contains.map(function (c) {
                return expand_mode(c === 'self' ? mode : c);
            }));
            mode.contains.forEach(function (c) {
                compileMode(c, mode);
            });

            if (mode.starts) {
                compileMode(mode.starts, parent);
            }

            var terminators = mode.contains.map(function (c) {
                return c.beginKeywords ? '\\.?(' + c.begin + ')\\.?' : c.begin;
            }).concat([mode.terminator_end, mode.illegal]).map(reStr).filter(Boolean);
            mode.terminators = terminators.length ? langRe(terminators.join('|'), true) : { exec: function exec() /*s*/{
                    return null;
                } };
        }

        compileMode(language);
    }

    /*
    Core highlighting function. Accepts a language name, or an alias, and a
    string with the code to highlight. Returns an object with the following
    properties:
        - relevance (int)
    - value (an HTML string with highlighting markup)
        */
    function highlight(name, value, ignore_illegals, continuation) {

        function subMode(lexeme, mode) {
            var i, length;

            for (i = 0, length = mode.contains.length; i < length; i++) {
                if (testRe(mode.contains[i].beginRe, lexeme)) {
                    return mode.contains[i];
                }
            }
        }

        function endOfMode(mode, lexeme) {
            if (testRe(mode.endRe, lexeme)) {
                while (mode.endsParent && mode.parent) {
                    mode = mode.parent;
                }
                return mode;
            }
            if (mode.endsWithParent) {
                return endOfMode(mode.parent, lexeme);
            }
        }

        function isIllegal(lexeme, mode) {
            return !ignore_illegals && testRe(mode.illegalRe, lexeme);
        }

        function keywordMatch(mode, match) {
            var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];
            return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];
        }

        function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {
            var classPrefix = noPrefix ? '' : options.classPrefix,
                openSpan = '<span class="' + classPrefix,
                closeSpan = leaveOpen ? '' : spanEndTag;

            openSpan += classname + '">';

            return openSpan + insideSpan + closeSpan;
        }

        function processKeywords() {
            var keyword_match, last_index, match, result;

            if (!top.keywords) return escape(mode_buffer);

            result = '';
            last_index = 0;
            top.lexemesRe.lastIndex = 0;
            match = top.lexemesRe.exec(mode_buffer);

            while (match) {
                result += escape(mode_buffer.substring(last_index, match.index));
                keyword_match = keywordMatch(top, match);
                if (keyword_match) {
                    relevance += keyword_match[1];
                    result += buildSpan(keyword_match[0], escape(match[0]));
                } else {
                    result += escape(match[0]);
                }
                last_index = top.lexemesRe.lastIndex;
                match = top.lexemesRe.exec(mode_buffer);
            }
            return result + escape(mode_buffer.substr(last_index));
        }

        function processSubLanguage() {
            var explicit = typeof top.subLanguage === 'string';
            if (explicit && !languages[top.subLanguage]) {
                return escape(mode_buffer);
            }

            var result = explicit ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);

            // Counting embedded language score towards the host language may be disabled
            // with zeroing the containing mode relevance. Usecase in point is Markdown that
            // allows XML everywhere and makes every XML snippet to have a much larger Markdown
            // score.
            if (top.relevance > 0) {
                relevance += result.relevance;
            }
            if (explicit) {
                continuations[top.subLanguage] = result.top;
            }
            return buildSpan(result.language, result.value, false, true);
        }

        function processBuffer() {
            result += top.subLanguage != null ? processSubLanguage() : processKeywords();
            mode_buffer = '';
        }

        function startNewMode(mode) {
            result += mode.className ? buildSpan(mode.className, '', true) : '';
            top = Object.create(mode, { parent: { value: top } });
        }

        function processLexeme(buffer, lexeme) {

            mode_buffer += buffer;

            if (lexeme == null) {
                processBuffer();
                return 0;
            }

            var new_mode = subMode(lexeme, top);
            if (new_mode) {
                if (new_mode.skip) {
                    mode_buffer += lexeme;
                } else {
                    if (new_mode.excludeBegin) {
                        mode_buffer += lexeme;
                    }
                    processBuffer();
                    if (!new_mode.returnBegin && !new_mode.excludeBegin) {
                        mode_buffer = lexeme;
                    }
                }
                startNewMode(new_mode, lexeme);
                return new_mode.returnBegin ? 0 : lexeme.length;
            }

            var end_mode = endOfMode(top, lexeme);
            if (end_mode) {
                var origin = top;
                if (origin.skip) {
                    mode_buffer += lexeme;
                } else {
                    if (!(origin.returnEnd || origin.excludeEnd)) {
                        mode_buffer += lexeme;
                    }
                    processBuffer();
                    if (origin.excludeEnd) {
                        mode_buffer = lexeme;
                    }
                }
                do {
                    if (top.className) {
                        result += spanEndTag;
                    }
                    if (!top.skip && !top.subLanguage) {
                        relevance += top.relevance;
                    }
                    top = top.parent;
                } while (top !== end_mode.parent);
                if (end_mode.starts) {
                    startNewMode(end_mode.starts, '');
                }
                return origin.returnEnd ? 0 : lexeme.length;
            }

            if (isIllegal(lexeme, top)) throw new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '<unnamed>') + '"');

            /*
            Parser should not reach this point as all types of lexemes should be caught
            earlier, but if it does due to some bug make sure it advances at least one
            character forward to prevent infinite looping.
            */
            mode_buffer += lexeme;
            return lexeme.length || 1;
        }

        var language = getLanguage(name);
        if (!language) {
            throw new Error('Unknown language: "' + name + '"');
        }

        compileLanguage(language);
        var top = continuation || language;
        var continuations = {}; // keep continuations for sub-languages
        var result = '',
            current;
        for (current = top; current !== language; current = current.parent) {
            if (current.className) {
                result = buildSpan(current.className, '', true) + result;
            }
        }
        var mode_buffer = '';
        var relevance = 0;
        try {
            var match,
                count,
                index = 0;
            while (true) {
                top.terminators.lastIndex = index;
                match = top.terminators.exec(value);
                if (!match) break;
                count = processLexeme(value.substring(index, match.index), match[0]);
                index = match.index + count;
            }
            processLexeme(value.substr(index));
            for (current = top; current.parent; current = current.parent) {
                // close dangling modes
                if (current.className) {
                    result += spanEndTag;
                }
            }
            return {
                relevance: relevance,
                value: result,
                language: name,
                top: top
            };
        } catch (e) {
            if (e.message && e.message.indexOf('Illegal') !== -1) {
                return {
                    relevance: 0,
                    value: escape(value)
                };
            } else {
                throw e;
            }
        }
    }

    /*
    Highlighting with language detection. Accepts a string with the code to
    highlight. Returns an object with the following properties:
        - language (detected language)
    - relevance (int)
    - value (an HTML string with highlighting markup)
    - second_best (object with the same structure for second-best heuristically
      detected language, may be absent)
        */
    function highlightAuto(text, languageSubset) {
        languageSubset = languageSubset || options.languages || objectKeys(languages);
        var result = {
            relevance: 0,
            value: escape(text)
        };
        var second_best = result;
        languageSubset.filter(getLanguage).forEach(function (name) {
            var current = highlight(name, text, false);
            current.language = name;
            if (current.relevance > second_best.relevance) {
                second_best = current;
            }
            if (current.relevance > result.relevance) {
                second_best = result;
                result = current;
            }
        });
        if (second_best.language) {
            result.second_best = second_best;
        }
        return result;
    }

    /*
    Post-processing of the highlighted markup:
        - replace TABs with something more useful
    - replace real line-breaks with '<br>' for non-pre containers
        */
    function fixMarkup(value) {
        return !(options.tabReplace || options.useBR) ? value : value.replace(fixMarkupRe, function (match, p1) {
            if (options.useBR && match === '\n') {
                return '<br>';
            } else if (options.tabReplace) {
                return p1.replace(/\t/g, options.tabReplace);
            }
            return '';
        });
    }

    function buildClassName(prevClassName, currentLang, resultLang) {
        var language = currentLang ? aliases[currentLang] : resultLang,
            result = [prevClassName.trim()];

        if (!prevClassName.match(/\bhljs\b/)) {
            result.push('hljs');
        }

        if (prevClassName.indexOf(language) === -1) {
            result.push(language);
        }

        return result.join(' ').trim();
    }

    /*
    Applies highlighting to a DOM node containing code. Accepts a DOM node and
    two optional parameters for fixMarkup.
    */
    function highlightBlock(block) {
        var node, originalStream, result, resultNode, text;
        var language = blockLanguage(block);

        if (isNotHighlighted(language)) return;

        if (options.useBR) {
            node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');
            node.innerHTML = block.innerHTML.replace(/\n/g, '').replace(/<br[ \/]*>/g, '\n');
        } else {
            node = block;
        }
        text = node.textContent;
        result = language ? highlight(language, text, true) : highlightAuto(text);

        originalStream = nodeStream(node);
        if (originalStream.length) {
            resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');
            resultNode.innerHTML = result.value;
            result.value = mergeStreams(originalStream, nodeStream(resultNode), text);
        }
        result.value = fixMarkup(result.value);

        block.innerHTML = result.value;
        block.className = buildClassName(block.className, language, result.language);
        block.result = {
            language: result.language,
            re: result.relevance
        };
        if (result.second_best) {
            block.second_best = {
                language: result.second_best.language,
                re: result.second_best.relevance
            };
        }
    }

    /*
    Updates highlight.js global options with values passed in the form of an object.
    */
    function configure(user_options) {
        options = inherit(options, user_options);
    }

    /*
    Applies highlighting to all <pre><code>..</code></pre> blocks on a page.
    */
    function initHighlighting() {
        if (initHighlighting.called) return;
        initHighlighting.called = true;

        var blocks = document.querySelectorAll('pre code');
        ArrayProto.forEach.call(blocks, highlightBlock);
    }

    /*
    Attaches highlighting to the page load event.
    */
    function initHighlightingOnLoad() {
        addEventListener('DOMContentLoaded', initHighlighting, false);
        addEventListener('load', initHighlighting, false);
    }

    function registerLanguage(name, language) {
        var lang = languages[name] = language(hljs);
        if (lang.aliases) {
            lang.aliases.forEach(function (alias) {
                aliases[alias] = name;
            });
        }
    }

    function listLanguages() {
        return objectKeys(languages);
    }

    function getLanguage(name) {
        name = (name || '').toLowerCase();
        return languages[name] || languages[aliases[name]];
    }

    /* Interface definition */

    hljs.highlight = highlight;
    hljs.highlightAuto = highlightAuto;
    hljs.fixMarkup = fixMarkup;
    hljs.highlightBlock = highlightBlock;
    hljs.configure = configure;
    hljs.initHighlighting = initHighlighting;
    hljs.initHighlightingOnLoad = initHighlightingOnLoad;
    hljs.registerLanguage = registerLanguage;
    hljs.listLanguages = listLanguages;
    hljs.getLanguage = getLanguage;
    hljs.inherit = inherit;

    // Common regexps
    hljs.IDENT_RE = '[a-zA-Z]\\w*';
    hljs.UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\w*';
    hljs.NUMBER_RE = '\\b\\d+(\\.\\d+)?';
    hljs.C_NUMBER_RE = '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)'; // 0x..., 0..., decimal, float
    hljs.BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b...
    hljs.RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~';

    // Common modes
    hljs.BACKSLASH_ESCAPE = {
        begin: '\\\\[\\s\\S]', relevance: 0
    };
    hljs.APOS_STRING_MODE = {
        className: 'string',
        begin: '\'', end: '\'',
        illegal: '\\n',
        contains: [hljs.BACKSLASH_ESCAPE]
    };
    hljs.QUOTE_STRING_MODE = {
        className: 'string',
        begin: '"', end: '"',
        illegal: '\\n',
        contains: [hljs.BACKSLASH_ESCAPE]
    };
    hljs.PHRASAL_WORDS_MODE = {
        begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
    };
    hljs.COMMENT = function (begin, end, inherits) {
        var mode = hljs.inherit({
            className: 'comment',
            begin: begin, end: end,
            contains: []
        }, inherits || {});
        mode.contains.push(hljs.PHRASAL_WORDS_MODE);
        mode.contains.push({
            className: 'doctag',
            begin: '(?:TODO|FIXME|NOTE|BUG|XXX):',
            relevance: 0
        });
        return mode;
    };
    hljs.C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$');
    hljs.C_BLOCK_COMMENT_MODE = hljs.COMMENT('/\\*', '\\*/');
    hljs.HASH_COMMENT_MODE = hljs.COMMENT('#', '$');
    hljs.NUMBER_MODE = {
        className: 'number',
        begin: hljs.NUMBER_RE,
        relevance: 0
    };
    hljs.C_NUMBER_MODE = {
        className: 'number',
        begin: hljs.C_NUMBER_RE,
        relevance: 0
    };
    hljs.BINARY_NUMBER_MODE = {
        className: 'number',
        begin: hljs.BINARY_NUMBER_RE,
        relevance: 0
    };
    hljs.CSS_NUMBER_MODE = {
        className: 'number',
        begin: hljs.NUMBER_RE + '(' + '%|em|ex|ch|rem' + '|vw|vh|vmin|vmax' + '|cm|mm|in|pt|pc|px' + '|deg|grad|rad|turn' + '|s|ms' + '|Hz|kHz' + '|dpi|dpcm|dppx' + ')?',
        relevance: 0
    };
    hljs.REGEXP_MODE = {
        className: 'regexp',
        begin: /\//, end: /\/[gimuy]*/,
        illegal: /\n/,
        contains: [hljs.BACKSLASH_ESCAPE, {
            begin: /\[/, end: /\]/,
            relevance: 0,
            contains: [hljs.BACKSLASH_ESCAPE]
        }]
    };
    hljs.TITLE_MODE = {
        className: 'title',
        begin: hljs.IDENT_RE,
        relevance: 0
    };
    hljs.UNDERSCORE_TITLE_MODE = {
        className: 'title',
        begin: hljs.UNDERSCORE_IDENT_RE,
        relevance: 0
    };
    hljs.METHOD_GUARD = {
        // excludes method names from keyword processing
        begin: '\\.\\s*' + hljs.UNDERSCORE_IDENT_RE,
        relevance: 0
    };

    return hljs;
});

},{}],50:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; // Import jQuery using ES6
// Export result as an ES6 module
// David Storey, Realise

var _jquery = require('./jquery');

var _jquery2 = _interopRequireDefault(_jquery);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var jQuery = _jquery2.default;

/**
* jquery-match-height 0.7.2 by @liabru
* http://brm.io/jquery-match-height/
* License: MIT
*/

(function ($) {
    /*
    *  internal
    */

    var _previousResizeWidth = -1,
        _updateTimeout = -1;

    /*
    *  _parse
    *  value parse utility function
    */

    var _parse = function _parse(value) {
        // parse value and convert NaN to 0
        return parseFloat(value) || 0;
    };

    /*
    *  _rows
    *  utility function returns array of jQuery selections representing each row
    *  (as displayed after float wrapping applied by browser)
    */

    var _rows = function _rows(elements) {
        var tolerance = 1,
            $elements = $(elements),
            lastTop = null,
            rows = [];

        // group elements by their top position
        $elements.each(function () {
            var $that = $(this),
                top = $that.offset().top - _parse($that.css('margin-top')),
                lastRow = rows.length > 0 ? rows[rows.length - 1] : null;

            if (lastRow === null) {
                // first item on the row, so just push it
                rows.push($that);
            } else {
                // if the row top is the same, add to the row group
                if (Math.floor(Math.abs(lastTop - top)) <= tolerance) {
                    rows[rows.length - 1] = lastRow.add($that);
                } else {
                    // otherwise start a new row group
                    rows.push($that);
                }
            }

            // keep track of the last row top
            lastTop = top;
        });

        return rows;
    };

    /*
    *  _parseOptions
    *  handle plugin options
    */

    var _parseOptions = function _parseOptions(options) {
        var opts = {
            byRow: true,
            property: 'height',
            target: null,
            remove: false
        };

        if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {
            return $.extend(opts, options);
        }

        if (typeof options === 'boolean') {
            opts.byRow = options;
        } else if (options === 'remove') {
            opts.remove = true;
        }

        return opts;
    };

    /*
    *  matchHeight
    *  plugin definition
    */

    var matchHeight = $.fn.matchHeight = function (options) {
        var opts = _parseOptions(options);

        // handle remove
        if (opts.remove) {
            var that = this;

            // remove fixed height from all selected elements
            this.css(opts.property, '');

            // remove selected elements from all groups
            $.each(matchHeight._groups, function (key, group) {
                group.elements = group.elements.not(that);
            });

            // TODO: cleanup empty groups

            return this;
        }

        if (this.length <= 1 && !opts.target) {
            return this;
        }

        // keep track of this group so we can re-apply later on load and resize events
        matchHeight._groups.push({
            elements: this,
            options: opts
        });

        // match each element's height to the tallest element in the selection
        matchHeight._apply(this, opts);

        return this;
    };

    /*
    *  plugin global options
    */

    matchHeight.version = '0.7.2';
    matchHeight._groups = [];
    matchHeight._throttle = 80;
    matchHeight._maintainScroll = false;
    matchHeight._beforeUpdate = null;
    matchHeight._afterUpdate = null;
    matchHeight._rows = _rows;
    matchHeight._parse = _parse;
    matchHeight._parseOptions = _parseOptions;

    /*
    *  matchHeight._apply
    *  apply matchHeight to given elements
    */

    matchHeight._apply = function (elements, options) {
        var opts = _parseOptions(options),
            $elements = $(elements),
            rows = [$elements];

        // take note of scroll position
        var scrollTop = $(window).scrollTop(),
            htmlHeight = $('html').outerHeight(true);

        // get hidden parents
        var $hiddenParents = $elements.parents().filter(':hidden');

        // cache the original inline style
        $hiddenParents.each(function () {
            var $that = $(this);
            $that.data('style-cache', $that.attr('style'));
        });

        // temporarily must force hidden parents visible
        $hiddenParents.css('display', 'block');

        // get rows if using byRow, otherwise assume one row
        if (opts.byRow && !opts.target) {

            // must first force an arbitrary equal height so floating elements break evenly
            $elements.each(function () {
                var $that = $(this),
                    display = $that.css('display');

                // temporarily force a usable display value
                if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {
                    display = 'block';
                }

                // cache the original inline style
                $that.data('style-cache', $that.attr('style'));

                $that.css({
                    'display': display,
                    'padding-top': '0',
                    'padding-bottom': '0',
                    'margin-top': '0',
                    'margin-bottom': '0',
                    'border-top-width': '0',
                    'border-bottom-width': '0',
                    'height': '100px',
                    'overflow': 'hidden'
                });
            });

            // get the array of rows (based on element top position)
            rows = _rows($elements);

            // revert original inline styles
            $elements.each(function () {
                var $that = $(this);
                $that.attr('style', $that.data('style-cache') || '');
            });
        }

        $.each(rows, function (key, row) {
            var $row = $(row),
                targetHeight = 0;

            if (!opts.target) {
                // skip apply to rows with only one item
                if (opts.byRow && $row.length <= 1) {
                    $row.css(opts.property, '');
                    return;
                }

                // iterate the row and find the max height
                $row.each(function () {
                    var $that = $(this),
                        style = $that.attr('style'),
                        display = $that.css('display');

                    // temporarily force a usable display value
                    if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {
                        display = 'block';
                    }

                    // ensure we get the correct actual height (and not a previously set height value)
                    var css = { 'display': display };
                    css[opts.property] = '';
                    $that.css(css);

                    // find the max height (including padding, but not margin)
                    if ($that.outerHeight(false) > targetHeight) {
                        targetHeight = $that.outerHeight(false);
                    }

                    // revert styles
                    if (style) {
                        $that.attr('style', style);
                    } else {
                        $that.css('display', '');
                    }
                });
            } else {
                // if target set, use the height of the target element
                targetHeight = opts.target.outerHeight(false);
            }

            // iterate the row and apply the height to all elements
            $row.each(function () {
                var $that = $(this),
                    verticalPadding = 0;

                // don't apply to a target
                if (opts.target && $that.is(opts.target)) {
                    return;
                }

                // handle padding and border correctly (required when not using border-box)
                if ($that.css('box-sizing') !== 'border-box') {
                    verticalPadding += _parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width'));
                    verticalPadding += _parse($that.css('padding-top')) + _parse($that.css('padding-bottom'));
                }

                // set the height (accounting for padding and border)
                $that.css(opts.property, targetHeight - verticalPadding + 'px');
            });
        });

        // revert hidden parents
        $hiddenParents.each(function () {
            var $that = $(this);
            $that.attr('style', $that.data('style-cache') || null);
        });

        // restore scroll position if enabled
        if (matchHeight._maintainScroll) {
            $(window).scrollTop(scrollTop / htmlHeight * $('html').outerHeight(true));
        }

        return this;
    };

    /*
    *  matchHeight._applyDataApi
    *  applies matchHeight to all elements with a data-match-height attribute
    */

    matchHeight._applyDataApi = function () {
        var groups = {};

        // generate groups by their groupId set by elements using data-match-height
        $('[data-match-height], [data-mh]').each(function () {
            var $this = $(this),
                groupId = $this.attr('data-mh') || $this.attr('data-match-height');

            if (groupId in groups) {
                groups[groupId] = groups[groupId].add($this);
            } else {
                groups[groupId] = $this;
            }
        });

        // apply matchHeight to each group
        $.each(groups, function () {
            this.matchHeight(true);
        });
    };

    /*
    *  matchHeight._update
    *  updates matchHeight on all current groups with their correct options
    */

    var _update = function _update(event) {
        if (matchHeight._beforeUpdate) {
            matchHeight._beforeUpdate(event, matchHeight._groups);
        }

        $.each(matchHeight._groups, function () {
            matchHeight._apply(this.elements, this.options);
        });

        if (matchHeight._afterUpdate) {
            matchHeight._afterUpdate(event, matchHeight._groups);
        }
    };

    matchHeight._update = function (throttle, event) {
        // prevent update if fired from a resize event
        // where the viewport width hasn't actually changed
        // fixes an event looping bug in IE8
        if (event && event.type === 'resize') {
            var windowWidth = $(window).width();
            if (windowWidth === _previousResizeWidth) {
                return;
            }
            _previousResizeWidth = windowWidth;
        }

        // throttle updates
        if (!throttle) {
            _update(event);
        } else if (_updateTimeout === -1) {
            _updateTimeout = setTimeout(function () {
                _update(event);
                _updateTimeout = -1;
            }, matchHeight._throttle);
        }
    };

    /*
    *  bind events
    */

    // apply on DOM ready event
    $(matchHeight._applyDataApi);

    // use on or bind where supported
    var on = $.fn.on ? 'on' : 'bind';

    // update heights on load and resize events
    $(window)[on]('load', function (event) {
        matchHeight._update(false, event);
    });

    // throttled update heights on resize events
    $(window)[on]('resize orientationchange', function (event) {
        matchHeight._update(true, event);
    });
})(jQuery);

exports.default = jQuery.fn.matchHeight;

},{"./jquery":55}],51:[function(require,module,exports){
"use strict";

/*! jQuery UI - v1.12.1 - 2019-05-09
* http://jqueryui.com
* Includes: widget.js, position.js, jquery-1-7.js, keycode.js, unique-id.js, widgets/autocomplete.js, widgets/menu.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

(function (t) {
  "function" == typeof define && define.amd ? define(["jquery"], t) : t(jQuery);
})(function (t) {
  t.ui = t.ui || {}, t.ui.version = "1.12.1";var e = 0,
      i = Array.prototype.slice;t.cleanData = function (e) {
    return function (i) {
      var s, n, o;for (o = 0; null != (n = i[o]); o++) {
        try {
          s = t._data(n, "events"), s && s.remove && t(n).triggerHandler("remove");
        } catch (a) {}
      }e(i);
    };
  }(t.cleanData), t.widget = function (e, i, s) {
    var n,
        o,
        a,
        r = {},
        l = e.split(".")[0];e = e.split(".")[1];var h = l + "-" + e;return s || (s = i, i = t.Widget), t.isArray(s) && (s = t.extend.apply(null, [{}].concat(s))), t.expr[":"][h.toLowerCase()] = function (e) {
      return !!t.data(e, h);
    }, t[l] = t[l] || {}, n = t[l][e], o = t[l][e] = function (t, e) {
      return this._createWidget ? (arguments.length && this._createWidget(t, e), void 0) : new o(t, e);
    }, t.extend(o, n, { version: s.version, _proto: t.extend({}, s), _childConstructors: [] }), a = new i(), a.options = t.widget.extend({}, a.options), t.each(s, function (e, s) {
      return t.isFunction(s) ? (r[e] = function () {
        function t() {
          return i.prototype[e].apply(this, arguments);
        }function n(t) {
          return i.prototype[e].apply(this, t);
        }return function () {
          var e,
              i = this._super,
              o = this._superApply;return this._super = t, this._superApply = n, e = s.apply(this, arguments), this._super = i, this._superApply = o, e;
        };
      }(), void 0) : (r[e] = s, void 0);
    }), o.prototype = t.widget.extend(a, { widgetEventPrefix: n ? a.widgetEventPrefix || e : e }, r, { constructor: o, namespace: l, widgetName: e, widgetFullName: h }), n ? (t.each(n._childConstructors, function (e, i) {
      var s = i.prototype;t.widget(s.namespace + "." + s.widgetName, o, i._proto);
    }), delete n._childConstructors) : i._childConstructors.push(o), t.widget.bridge(e, o), o;
  }, t.widget.extend = function (e) {
    for (var s, n, o = i.call(arguments, 1), a = 0, r = o.length; r > a; a++) {
      for (s in o[a]) {
        n = o[a][s], o[a].hasOwnProperty(s) && void 0 !== n && (e[s] = t.isPlainObject(n) ? t.isPlainObject(e[s]) ? t.widget.extend({}, e[s], n) : t.widget.extend({}, n) : n);
      }
    }return e;
  }, t.widget.bridge = function (e, s) {
    var n = s.prototype.widgetFullName || e;t.fn[e] = function (o) {
      var a = "string" == typeof o,
          r = i.call(arguments, 1),
          l = this;return a ? this.length || "instance" !== o ? this.each(function () {
        var i,
            s = t.data(this, n);return "instance" === o ? (l = s, !1) : s ? t.isFunction(s[o]) && "_" !== o.charAt(0) ? (i = s[o].apply(s, r), i !== s && void 0 !== i ? (l = i && i.jquery ? l.pushStack(i.get()) : i, !1) : void 0) : t.error("no such method '" + o + "' for " + e + " widget instance") : t.error("cannot call methods on " + e + " prior to initialization; " + "attempted to call method '" + o + "'");
      }) : l = void 0 : (r.length && (o = t.widget.extend.apply(null, [o].concat(r))), this.each(function () {
        var e = t.data(this, n);e ? (e.option(o || {}), e._init && e._init()) : t.data(this, n, new s(o, this));
      })), l;
    };
  }, t.Widget = function () {}, t.Widget._childConstructors = [], t.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "<div>", options: { classes: {}, disabled: !1, create: null }, _createWidget: function _createWidget(i, s) {
      s = t(s || this.defaultElement || this)[0], this.element = t(s), this.uuid = e++, this.eventNamespace = "." + this.widgetName + this.uuid, this.bindings = t(), this.hoverable = t(), this.focusable = t(), this.classesElementLookup = {}, s !== this && (t.data(s, this.widgetFullName, this), this._on(!0, this.element, { remove: function remove(t) {
          t.target === s && this.destroy();
        } }), this.document = t(s.style ? s.ownerDocument : s.document || s), this.window = t(this.document[0].defaultView || this.document[0].parentWindow)), this.options = t.widget.extend({}, this.options, this._getCreateOptions(), i), this._create(), this.options.disabled && this._setOptionDisabled(this.options.disabled), this._trigger("create", null, this._getCreateEventData()), this._init();
    }, _getCreateOptions: function _getCreateOptions() {
      return {};
    }, _getCreateEventData: t.noop, _create: t.noop, _init: t.noop, destroy: function destroy() {
      var e = this;this._destroy(), t.each(this.classesElementLookup, function (t, i) {
        e._removeClass(i, t);
      }), this.element.off(this.eventNamespace).removeData(this.widgetFullName), this.widget().off(this.eventNamespace).removeAttr("aria-disabled"), this.bindings.off(this.eventNamespace);
    }, _destroy: t.noop, widget: function widget() {
      return this.element;
    }, option: function option(e, i) {
      var s,
          n,
          o,
          a = e;if (0 === arguments.length) return t.widget.extend({}, this.options);if ("string" == typeof e) if (a = {}, s = e.split("."), e = s.shift(), s.length) {
        for (n = a[e] = t.widget.extend({}, this.options[e]), o = 0; s.length - 1 > o; o++) {
          n[s[o]] = n[s[o]] || {}, n = n[s[o]];
        }if (e = s.pop(), 1 === arguments.length) return void 0 === n[e] ? null : n[e];n[e] = i;
      } else {
        if (1 === arguments.length) return void 0 === this.options[e] ? null : this.options[e];a[e] = i;
      }return this._setOptions(a), this;
    }, _setOptions: function _setOptions(t) {
      var e;for (e in t) {
        this._setOption(e, t[e]);
      }return this;
    }, _setOption: function _setOption(t, e) {
      return "classes" === t && this._setOptionClasses(e), this.options[t] = e, "disabled" === t && this._setOptionDisabled(e), this;
    }, _setOptionClasses: function _setOptionClasses(e) {
      var i, s, n;for (i in e) {
        n = this.classesElementLookup[i], e[i] !== this.options.classes[i] && n && n.length && (s = t(n.get()), this._removeClass(n, i), s.addClass(this._classes({ element: s, keys: i, classes: e, add: !0 })));
      }
    }, _setOptionDisabled: function _setOptionDisabled(t) {
      this._toggleClass(this.widget(), this.widgetFullName + "-disabled", null, !!t), t && (this._removeClass(this.hoverable, null, "ui-state-hover"), this._removeClass(this.focusable, null, "ui-state-focus"));
    }, enable: function enable() {
      return this._setOptions({ disabled: !1 });
    }, disable: function disable() {
      return this._setOptions({ disabled: !0 });
    }, _classes: function _classes(e) {
      function i(i, o) {
        var a, r;for (r = 0; i.length > r; r++) {
          a = n.classesElementLookup[i[r]] || t(), a = e.add ? t(t.unique(a.get().concat(e.element.get()))) : t(a.not(e.element).get()), n.classesElementLookup[i[r]] = a, s.push(i[r]), o && e.classes[i[r]] && s.push(e.classes[i[r]]);
        }
      }var s = [],
          n = this;return e = t.extend({ element: this.element, classes: this.options.classes || {} }, e), this._on(e.element, { remove: "_untrackClassesElement" }), e.keys && i(e.keys.match(/\S+/g) || [], !0), e.extra && i(e.extra.match(/\S+/g) || []), s.join(" ");
    }, _untrackClassesElement: function _untrackClassesElement(e) {
      var i = this;t.each(i.classesElementLookup, function (s, n) {
        -1 !== t.inArray(e.target, n) && (i.classesElementLookup[s] = t(n.not(e.target).get()));
      });
    }, _removeClass: function _removeClass(t, e, i) {
      return this._toggleClass(t, e, i, !1);
    }, _addClass: function _addClass(t, e, i) {
      return this._toggleClass(t, e, i, !0);
    }, _toggleClass: function _toggleClass(t, e, i, s) {
      s = "boolean" == typeof s ? s : i;var n = "string" == typeof t || null === t,
          o = { extra: n ? e : i, keys: n ? t : e, element: n ? this.element : t, add: s };return o.element.toggleClass(this._classes(o), s), this;
    }, _on: function _on(e, i, s) {
      var n,
          o = this;"boolean" != typeof e && (s = i, i = e, e = !1), s ? (i = n = t(i), this.bindings = this.bindings.add(i)) : (s = i, i = this.element, n = this.widget()), t.each(s, function (s, a) {
        function r() {
          return e || o.options.disabled !== !0 && !t(this).hasClass("ui-state-disabled") ? ("string" == typeof a ? o[a] : a).apply(o, arguments) : void 0;
        }"string" != typeof a && (r.guid = a.guid = a.guid || r.guid || t.guid++);var l = s.match(/^([\w:-]*)\s*(.*)$/),
            h = l[1] + o.eventNamespace,
            c = l[2];c ? n.on(h, c, r) : i.on(h, r);
      });
    }, _off: function _off(e, i) {
      i = (i || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace, e.off(i).off(i), this.bindings = t(this.bindings.not(e).get()), this.focusable = t(this.focusable.not(e).get()), this.hoverable = t(this.hoverable.not(e).get());
    }, _delay: function _delay(t, e) {
      function i() {
        return ("string" == typeof t ? s[t] : t).apply(s, arguments);
      }var s = this;return setTimeout(i, e || 0);
    }, _hoverable: function _hoverable(e) {
      this.hoverable = this.hoverable.add(e), this._on(e, { mouseenter: function mouseenter(e) {
          this._addClass(t(e.currentTarget), null, "ui-state-hover");
        }, mouseleave: function mouseleave(e) {
          this._removeClass(t(e.currentTarget), null, "ui-state-hover");
        } });
    }, _focusable: function _focusable(e) {
      this.focusable = this.focusable.add(e), this._on(e, { focusin: function focusin(e) {
          this._addClass(t(e.currentTarget), null, "ui-state-focus");
        }, focusout: function focusout(e) {
          this._removeClass(t(e.currentTarget), null, "ui-state-focus");
        } });
    }, _trigger: function _trigger(e, i, s) {
      var n,
          o,
          a = this.options[e];if (s = s || {}, i = t.Event(i), i.type = (e === this.widgetEventPrefix ? e : this.widgetEventPrefix + e).toLowerCase(), i.target = this.element[0], o = i.originalEvent) for (n in o) {
        n in i || (i[n] = o[n]);
      }return this.element.trigger(i, s), !(t.isFunction(a) && a.apply(this.element[0], [i].concat(s)) === !1 || i.isDefaultPrevented());
    } }, t.each({ show: "fadeIn", hide: "fadeOut" }, function (e, i) {
    t.Widget.prototype["_" + e] = function (s, n, o) {
      "string" == typeof n && (n = { effect: n });var a,
          r = n ? n === !0 || "number" == typeof n ? i : n.effect || i : e;n = n || {}, "number" == typeof n && (n = { duration: n }), a = !t.isEmptyObject(n), n.complete = o, n.delay && s.delay(n.delay), a && t.effects && t.effects.effect[r] ? s[e](n) : r !== e && s[r] ? s[r](n.duration, n.easing, o) : s.queue(function (i) {
        t(this)[e](), o && o.call(s[0]), i();
      });
    };
  }), t.widget, function () {
    function e(t, e, i) {
      return [parseFloat(t[0]) * (u.test(t[0]) ? e / 100 : 1), parseFloat(t[1]) * (u.test(t[1]) ? i / 100 : 1)];
    }function i(e, i) {
      return parseInt(t.css(e, i), 10) || 0;
    }function s(e) {
      var i = e[0];return 9 === i.nodeType ? { width: e.width(), height: e.height(), offset: { top: 0, left: 0 } } : t.isWindow(i) ? { width: e.width(), height: e.height(), offset: { top: e.scrollTop(), left: e.scrollLeft() } } : i.preventDefault ? { width: 0, height: 0, offset: { top: i.pageY, left: i.pageX } } : { width: e.outerWidth(), height: e.outerHeight(), offset: e.offset() };
    }var n,
        o = Math.max,
        a = Math.abs,
        r = /left|center|right/,
        l = /top|center|bottom/,
        h = /[\+\-]\d+(\.[\d]+)?%?/,
        c = /^\w+/,
        u = /%$/,
        d = t.fn.position;t.position = { scrollbarWidth: function scrollbarWidth() {
        if (void 0 !== n) return n;var e,
            i,
            s = t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),
            o = s.children()[0];return t("body").append(s), e = o.offsetWidth, s.css("overflow", "scroll"), i = o.offsetWidth, e === i && (i = s[0].clientWidth), s.remove(), n = e - i;
      }, getScrollInfo: function getScrollInfo(e) {
        var i = e.isWindow || e.isDocument ? "" : e.element.css("overflow-x"),
            s = e.isWindow || e.isDocument ? "" : e.element.css("overflow-y"),
            n = "scroll" === i || "auto" === i && e.width < e.element[0].scrollWidth,
            o = "scroll" === s || "auto" === s && e.height < e.element[0].scrollHeight;return { width: o ? t.position.scrollbarWidth() : 0, height: n ? t.position.scrollbarWidth() : 0 };
      }, getWithinInfo: function getWithinInfo(e) {
        var i = t(e || window),
            s = t.isWindow(i[0]),
            n = !!i[0] && 9 === i[0].nodeType,
            o = !s && !n;return { element: i, isWindow: s, isDocument: n, offset: o ? t(e).offset() : { left: 0, top: 0 }, scrollLeft: i.scrollLeft(), scrollTop: i.scrollTop(), width: i.outerWidth(), height: i.outerHeight() };
      } }, t.fn.position = function (n) {
      if (!n || !n.of) return d.apply(this, arguments);n = t.extend({}, n);var u,
          p,
          f,
          g,
          m,
          _,
          v = t(n.of),
          b = t.position.getWithinInfo(n.within),
          y = t.position.getScrollInfo(b),
          w = (n.collision || "flip").split(" "),
          k = {};return _ = s(v), v[0].preventDefault && (n.at = "left top"), p = _.width, f = _.height, g = _.offset, m = t.extend({}, g), t.each(["my", "at"], function () {
        var t,
            e,
            i = (n[this] || "").split(" ");1 === i.length && (i = r.test(i[0]) ? i.concat(["center"]) : l.test(i[0]) ? ["center"].concat(i) : ["center", "center"]), i[0] = r.test(i[0]) ? i[0] : "center", i[1] = l.test(i[1]) ? i[1] : "center", t = h.exec(i[0]), e = h.exec(i[1]), k[this] = [t ? t[0] : 0, e ? e[0] : 0], n[this] = [c.exec(i[0])[0], c.exec(i[1])[0]];
      }), 1 === w.length && (w[1] = w[0]), "right" === n.at[0] ? m.left += p : "center" === n.at[0] && (m.left += p / 2), "bottom" === n.at[1] ? m.top += f : "center" === n.at[1] && (m.top += f / 2), u = e(k.at, p, f), m.left += u[0], m.top += u[1], this.each(function () {
        var s,
            r,
            l = t(this),
            h = l.outerWidth(),
            c = l.outerHeight(),
            d = i(this, "marginLeft"),
            _ = i(this, "marginTop"),
            x = h + d + i(this, "marginRight") + y.width,
            C = c + _ + i(this, "marginBottom") + y.height,
            D = t.extend({}, m),
            T = e(k.my, l.outerWidth(), l.outerHeight());"right" === n.my[0] ? D.left -= h : "center" === n.my[0] && (D.left -= h / 2), "bottom" === n.my[1] ? D.top -= c : "center" === n.my[1] && (D.top -= c / 2), D.left += T[0], D.top += T[1], s = { marginLeft: d, marginTop: _ }, t.each(["left", "top"], function (e, i) {
          t.ui.position[w[e]] && t.ui.position[w[e]][i](D, { targetWidth: p, targetHeight: f, elemWidth: h, elemHeight: c, collisionPosition: s, collisionWidth: x, collisionHeight: C, offset: [u[0] + T[0], u[1] + T[1]], my: n.my, at: n.at, within: b, elem: l });
        }), n.using && (r = function r(t) {
          var e = g.left - D.left,
              i = e + p - h,
              s = g.top - D.top,
              r = s + f - c,
              u = { target: { element: v, left: g.left, top: g.top, width: p, height: f }, element: { element: l, left: D.left, top: D.top, width: h, height: c }, horizontal: 0 > i ? "left" : e > 0 ? "right" : "center", vertical: 0 > r ? "top" : s > 0 ? "bottom" : "middle" };h > p && p > a(e + i) && (u.horizontal = "center"), c > f && f > a(s + r) && (u.vertical = "middle"), u.important = o(a(e), a(i)) > o(a(s), a(r)) ? "horizontal" : "vertical", n.using.call(this, t, u);
        }), l.offset(t.extend(D, { using: r }));
      });
    }, t.ui.position = { fit: { left: function left(t, e) {
          var i,
              s = e.within,
              n = s.isWindow ? s.scrollLeft : s.offset.left,
              a = s.width,
              r = t.left - e.collisionPosition.marginLeft,
              l = n - r,
              h = r + e.collisionWidth - a - n;e.collisionWidth > a ? l > 0 && 0 >= h ? (i = t.left + l + e.collisionWidth - a - n, t.left += l - i) : t.left = h > 0 && 0 >= l ? n : l > h ? n + a - e.collisionWidth : n : l > 0 ? t.left += l : h > 0 ? t.left -= h : t.left = o(t.left - r, t.left);
        }, top: function top(t, e) {
          var i,
              s = e.within,
              n = s.isWindow ? s.scrollTop : s.offset.top,
              a = e.within.height,
              r = t.top - e.collisionPosition.marginTop,
              l = n - r,
              h = r + e.collisionHeight - a - n;e.collisionHeight > a ? l > 0 && 0 >= h ? (i = t.top + l + e.collisionHeight - a - n, t.top += l - i) : t.top = h > 0 && 0 >= l ? n : l > h ? n + a - e.collisionHeight : n : l > 0 ? t.top += l : h > 0 ? t.top -= h : t.top = o(t.top - r, t.top);
        } }, flip: { left: function left(t, e) {
          var i,
              s,
              n = e.within,
              o = n.offset.left + n.scrollLeft,
              r = n.width,
              l = n.isWindow ? n.scrollLeft : n.offset.left,
              h = t.left - e.collisionPosition.marginLeft,
              c = h - l,
              u = h + e.collisionWidth - r - l,
              d = "left" === e.my[0] ? -e.elemWidth : "right" === e.my[0] ? e.elemWidth : 0,
              p = "left" === e.at[0] ? e.targetWidth : "right" === e.at[0] ? -e.targetWidth : 0,
              f = -2 * e.offset[0];0 > c ? (i = t.left + d + p + f + e.collisionWidth - r - o, (0 > i || a(c) > i) && (t.left += d + p + f)) : u > 0 && (s = t.left - e.collisionPosition.marginLeft + d + p + f - l, (s > 0 || u > a(s)) && (t.left += d + p + f));
        }, top: function top(t, e) {
          var i,
              s,
              n = e.within,
              o = n.offset.top + n.scrollTop,
              r = n.height,
              l = n.isWindow ? n.scrollTop : n.offset.top,
              h = t.top - e.collisionPosition.marginTop,
              c = h - l,
              u = h + e.collisionHeight - r - l,
              d = "top" === e.my[1],
              p = d ? -e.elemHeight : "bottom" === e.my[1] ? e.elemHeight : 0,
              f = "top" === e.at[1] ? e.targetHeight : "bottom" === e.at[1] ? -e.targetHeight : 0,
              g = -2 * e.offset[1];0 > c ? (s = t.top + p + f + g + e.collisionHeight - r - o, (0 > s || a(c) > s) && (t.top += p + f + g)) : u > 0 && (i = t.top - e.collisionPosition.marginTop + p + f + g - l, (i > 0 || u > a(i)) && (t.top += p + f + g));
        } }, flipfit: { left: function left() {
          t.ui.position.flip.left.apply(this, arguments), t.ui.position.fit.left.apply(this, arguments);
        }, top: function top() {
          t.ui.position.flip.top.apply(this, arguments), t.ui.position.fit.top.apply(this, arguments);
        } } };
  }(), t.ui.position, "1.7" === t.fn.jquery.substring(0, 3) && (t.each(["Width", "Height"], function (e, i) {
    function s(e, i, s, o) {
      return t.each(n, function () {
        i -= parseFloat(t.css(e, "padding" + this)) || 0, s && (i -= parseFloat(t.css(e, "border" + this + "Width")) || 0), o && (i -= parseFloat(t.css(e, "margin" + this)) || 0);
      }), i;
    }var n = "Width" === i ? ["Left", "Right"] : ["Top", "Bottom"],
        o = i.toLowerCase(),
        a = { innerWidth: t.fn.innerWidth, innerHeight: t.fn.innerHeight, outerWidth: t.fn.outerWidth, outerHeight: t.fn.outerHeight };t.fn["inner" + i] = function (e) {
      return void 0 === e ? a["inner" + i].call(this) : this.each(function () {
        t(this).css(o, s(this, e) + "px");
      });
    }, t.fn["outer" + i] = function (e, n) {
      return "number" != typeof e ? a["outer" + i].call(this, e) : this.each(function () {
        t(this).css(o, s(this, e, !0, n) + "px");
      });
    };
  }), t.fn.addBack = function (t) {
    return this.add(null == t ? this.prevObject : this.prevObject.filter(t));
  }), t.ui.keyCode = { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38 }, t.fn.extend({ uniqueId: function () {
      var t = 0;return function () {
        return this.each(function () {
          this.id || (this.id = "ui-id-" + ++t);
        });
      };
    }(), removeUniqueId: function removeUniqueId() {
      return this.each(function () {
        /^ui-id-\d+$/.test(this.id) && t(this).removeAttr("id");
      });
    } }), t.ui.safeActiveElement = function (t) {
    var e;try {
      e = t.activeElement;
    } catch (i) {
      e = t.body;
    }return e || (e = t.body), e.nodeName || (e = t.body), e;
  }, t.widget("ui.menu", { version: "1.12.1", defaultElement: "<ul>", delay: 300, options: { icons: { submenu: "ui-icon-caret-1-e" }, items: "> *", menus: "ul", position: { my: "left top", at: "right top" }, role: "menu", blur: null, focus: null, select: null }, _create: function _create() {
      this.activeMenu = this.element, this.mouseHandled = !1, this.element.uniqueId().attr({ role: this.options.role, tabIndex: 0 }), this._addClass("ui-menu", "ui-widget ui-widget-content"), this._on({ "mousedown .ui-menu-item": function mousedownUiMenuItem(t) {
          t.preventDefault();
        }, "click .ui-menu-item": function clickUiMenuItem(e) {
          var i = t(e.target),
              s = t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled && i.not(".ui-state-disabled").length && (this.select(e), e.isPropagationStopped() || (this.mouseHandled = !0), i.has(".ui-menu").length ? this.expand(e) : !this.element.is(":focus") && s.closest(".ui-menu").length && (this.element.trigger("focus", [!0]), this.active && 1 === this.active.parents(".ui-menu").length && clearTimeout(this.timer)));
        }, "mouseenter .ui-menu-item": function mouseenterUiMenuItem(e) {
          if (!this.previousFilter) {
            var i = t(e.target).closest(".ui-menu-item"),
                s = t(e.currentTarget);i[0] === s[0] && (this._removeClass(s.siblings().children(".ui-state-active"), null, "ui-state-active"), this.focus(e, s));
          }
        }, mouseleave: "collapseAll", "mouseleave .ui-menu": "collapseAll", focus: function focus(t, e) {
          var i = this.active || this.element.find(this.options.items).eq(0);e || this.focus(t, i);
        }, blur: function blur(e) {
          this._delay(function () {
            var i = !t.contains(this.element[0], t.ui.safeActiveElement(this.document[0]));i && this.collapseAll(e);
          });
        }, keydown: "_keydown" }), this.refresh(), this._on(this.document, { click: function click(t) {
          this._closeOnDocumentClick(t) && this.collapseAll(t), this.mouseHandled = !1;
        } });
    }, _destroy: function _destroy() {
      var e = this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),
          i = e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(), i.children().each(function () {
        var e = t(this);e.data("ui-menu-submenu-caret") && e.remove();
      });
    }, _keydown: function _keydown(e) {
      var i,
          s,
          n,
          o,
          a = !0;switch (e.keyCode) {case t.ui.keyCode.PAGE_UP:
          this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:
          this.nextPage(e);break;case t.ui.keyCode.HOME:
          this._move("first", "first", e);break;case t.ui.keyCode.END:
          this._move("last", "last", e);break;case t.ui.keyCode.UP:
          this.previous(e);break;case t.ui.keyCode.DOWN:
          this.next(e);break;case t.ui.keyCode.LEFT:
          this.collapse(e);break;case t.ui.keyCode.RIGHT:
          this.active && !this.active.is(".ui-state-disabled") && this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:
          this._activate(e);break;case t.ui.keyCode.ESCAPE:
          this.collapse(e);break;default:
          a = !1, s = this.previousFilter || "", o = !1, n = e.keyCode >= 96 && 105 >= e.keyCode ? "" + (e.keyCode - 96) : String.fromCharCode(e.keyCode), clearTimeout(this.filterTimer), n === s ? o = !0 : n = s + n, i = this._filterMenuItems(n), i = o && -1 !== i.index(this.active.next()) ? this.active.nextAll(".ui-menu-item") : i, i.length || (n = String.fromCharCode(e.keyCode), i = this._filterMenuItems(n)), i.length ? (this.focus(e, i), this.previousFilter = n, this.filterTimer = this._delay(function () {
            delete this.previousFilter;
          }, 1e3)) : delete this.previousFilter;}a && e.preventDefault();
    }, _activate: function _activate(t) {
      this.active && !this.active.is(".ui-state-disabled") && (this.active.children("[aria-haspopup='true']").length ? this.expand(t) : this.select(t));
    }, refresh: function refresh() {
      var e,
          i,
          s,
          n,
          o,
          a = this,
          r = this.options.icons.submenu,
          l = this.element.find(this.options.menus);this._toggleClass("ui-menu-icons", null, !!this.element.find(".ui-icon").length), s = l.filter(":not(.ui-menu)").hide().attr({ role: this.options.role, "aria-hidden": "true", "aria-expanded": "false" }).each(function () {
        var e = t(this),
            i = e.prev(),
            s = t("<span>").data("ui-menu-submenu-caret", !0);a._addClass(s, "ui-menu-icon", "ui-icon " + r), i.attr("aria-haspopup", "true").prepend(s), e.attr("aria-labelledby", i.attr("id"));
      }), this._addClass(s, "ui-menu", "ui-widget ui-widget-content ui-front"), e = l.add(this.element), i = e.find(this.options.items), i.not(".ui-menu-item").each(function () {
        var e = t(this);a._isDivider(e) && a._addClass(e, "ui-menu-divider", "ui-widget-content");
      }), n = i.not(".ui-menu-item, .ui-menu-divider"), o = n.children().not(".ui-menu").uniqueId().attr({ tabIndex: -1, role: this._itemRole() }), this._addClass(n, "ui-menu-item")._addClass(o, "ui-menu-item-wrapper"), i.filter(".ui-state-disabled").attr("aria-disabled", "true"), this.active && !t.contains(this.element[0], this.active[0]) && this.blur();
    }, _itemRole: function _itemRole() {
      return { menu: "menuitem", listbox: "option" }[this.options.role];
    }, _setOption: function _setOption(t, e) {
      if ("icons" === t) {
        var i = this.element.find(".ui-menu-icon");this._removeClass(i, null, this.options.icons.submenu)._addClass(i, null, e.submenu);
      }this._super(t, e);
    }, _setOptionDisabled: function _setOptionDisabled(t) {
      this._super(t), this.element.attr("aria-disabled", t + ""), this._toggleClass(null, "ui-state-disabled", !!t);
    }, focus: function focus(t, e) {
      var i, s, n;this.blur(t, t && "focus" === t.type), this._scrollIntoView(e), this.active = e.first(), s = this.active.children(".ui-menu-item-wrapper"), this._addClass(s, null, "ui-state-active"), this.options.role && this.element.attr("aria-activedescendant", s.attr("id")), n = this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"), this._addClass(n, null, "ui-state-active"), t && "keydown" === t.type ? this._close() : this.timer = this._delay(function () {
        this._close();
      }, this.delay), i = e.children(".ui-menu"), i.length && t && /^mouse/.test(t.type) && this._startOpening(i), this.activeMenu = e.parent(), this._trigger("focus", t, { item: e });
    }, _scrollIntoView: function _scrollIntoView(e) {
      var i, s, n, o, a, r;this._hasScroll() && (i = parseFloat(t.css(this.activeMenu[0], "borderTopWidth")) || 0, s = parseFloat(t.css(this.activeMenu[0], "paddingTop")) || 0, n = e.offset().top - this.activeMenu.offset().top - i - s, o = this.activeMenu.scrollTop(), a = this.activeMenu.height(), r = e.outerHeight(), 0 > n ? this.activeMenu.scrollTop(o + n) : n + r > a && this.activeMenu.scrollTop(o + n - a + r));
    }, blur: function blur(t, e) {
      e || clearTimeout(this.timer), this.active && (this._removeClass(this.active.children(".ui-menu-item-wrapper"), null, "ui-state-active"), this._trigger("blur", t, { item: this.active }), this.active = null);
    }, _startOpening: function _startOpening(t) {
      clearTimeout(this.timer), "true" === t.attr("aria-hidden") && (this.timer = this._delay(function () {
        this._close(), this._open(t);
      }, this.delay));
    }, _open: function _open(e) {
      var i = t.extend({ of: this.active }, this.options.position);clearTimeout(this.timer), this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden", "true"), e.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(i);
    }, collapseAll: function collapseAll(e, i) {
      clearTimeout(this.timer), this.timer = this._delay(function () {
        var s = i ? this.element : t(e && e.target).closest(this.element.find(".ui-menu"));s.length || (s = this.element), this._close(s), this.blur(e), this._removeClass(s.find(".ui-state-active"), null, "ui-state-active"), this.activeMenu = s;
      }, this.delay);
    }, _close: function _close(t) {
      t || (t = this.active ? this.active.parent() : this.element), t.find(".ui-menu").hide().attr("aria-hidden", "true").attr("aria-expanded", "false");
    }, _closeOnDocumentClick: function _closeOnDocumentClick(e) {
      return !t(e.target).closest(".ui-menu").length;
    }, _isDivider: function _isDivider(t) {
      return !/[^\-\u2014\u2013\s]/.test(t.text());
    }, collapse: function collapse(t) {
      var e = this.active && this.active.parent().closest(".ui-menu-item", this.element);e && e.length && (this._close(), this.focus(t, e));
    }, expand: function expand(t) {
      var e = this.active && this.active.children(".ui-menu ").find(this.options.items).first();e && e.length && (this._open(e.parent()), this._delay(function () {
        this.focus(t, e);
      }));
    }, next: function next(t) {
      this._move("next", "first", t);
    }, previous: function previous(t) {
      this._move("prev", "last", t);
    }, isFirstItem: function isFirstItem() {
      return this.active && !this.active.prevAll(".ui-menu-item").length;
    }, isLastItem: function isLastItem() {
      return this.active && !this.active.nextAll(".ui-menu-item").length;
    }, _move: function _move(t, e, i) {
      var s;this.active && (s = "first" === t || "last" === t ? this.active["first" === t ? "prevAll" : "nextAll"](".ui-menu-item").eq(-1) : this.active[t + "All"](".ui-menu-item").eq(0)), s && s.length && this.active || (s = this.activeMenu.find(this.options.items)[e]()), this.focus(i, s);
    }, nextPage: function nextPage(e) {
      var i, s, n;return this.active ? (this.isLastItem() || (this._hasScroll() ? (s = this.active.offset().top, n = this.element.height(), this.active.nextAll(".ui-menu-item").each(function () {
        return i = t(this), 0 > i.offset().top - s - n;
      }), this.focus(e, i)) : this.focus(e, this.activeMenu.find(this.options.items)[this.active ? "last" : "first"]())), void 0) : (this.next(e), void 0);
    }, previousPage: function previousPage(e) {
      var i, s, n;return this.active ? (this.isFirstItem() || (this._hasScroll() ? (s = this.active.offset().top, n = this.element.height(), this.active.prevAll(".ui-menu-item").each(function () {
        return i = t(this), i.offset().top - s + n > 0;
      }), this.focus(e, i)) : this.focus(e, this.activeMenu.find(this.options.items).first())), void 0) : (this.next(e), void 0);
    }, _hasScroll: function _hasScroll() {
      return this.element.outerHeight() < this.element.prop("scrollHeight");
    }, select: function select(e) {
      this.active = this.active || t(e.target).closest(".ui-menu-item");var i = { item: this.active };this.active.has(".ui-menu").length || this.collapseAll(e, !0), this._trigger("select", e, i);
    }, _filterMenuItems: function _filterMenuItems(e) {
      var i = e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"),
          s = RegExp("^" + i, "i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function () {
        return s.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()));
      });
    } }), t.widget("ui.autocomplete", { version: "1.12.1", defaultElement: "<input>", options: { appendTo: null, autoFocus: !1, delay: 300, minLength: 1, position: { my: "left top", at: "left bottom", collision: "none" }, source: null, change: null, close: null, focus: null, open: null, response: null, search: null, select: null }, requestIndex: 0, pending: 0, _create: function _create() {
      var e,
          i,
          s,
          n = this.element[0].nodeName.toLowerCase(),
          o = "textarea" === n,
          a = "input" === n;this.isMultiLine = o || !a && this._isContentEditable(this.element), this.valueMethod = this.element[o || a ? "val" : "text"], this.isNewMenu = !0, this._addClass("ui-autocomplete-input"), this.element.attr("autocomplete", "off"), this._on(this.element, { keydown: function keydown(n) {
          if (this.element.prop("readOnly")) return e = !0, s = !0, i = !0, void 0;e = !1, s = !1, i = !1;var o = t.ui.keyCode;switch (n.keyCode) {case o.PAGE_UP:
              e = !0, this._move("previousPage", n);break;case o.PAGE_DOWN:
              e = !0, this._move("nextPage", n);break;case o.UP:
              e = !0, this._keyEvent("previous", n);break;case o.DOWN:
              e = !0, this._keyEvent("next", n);break;case o.ENTER:
              this.menu.active && (e = !0, n.preventDefault(), this.menu.select(n));break;case o.TAB:
              this.menu.active && this.menu.select(n);break;case o.ESCAPE:
              this.menu.element.is(":visible") && (this.isMultiLine || this._value(this.term), this.close(n), n.preventDefault());break;default:
              i = !0, this._searchTimeout(n);}
        }, keypress: function keypress(s) {
          if (e) return e = !1, (!this.isMultiLine || this.menu.element.is(":visible")) && s.preventDefault(), void 0;if (!i) {
            var n = t.ui.keyCode;switch (s.keyCode) {case n.PAGE_UP:
                this._move("previousPage", s);break;case n.PAGE_DOWN:
                this._move("nextPage", s);break;case n.UP:
                this._keyEvent("previous", s);break;case n.DOWN:
                this._keyEvent("next", s);}
          }
        }, input: function input(t) {
          return s ? (s = !1, t.preventDefault(), void 0) : (this._searchTimeout(t), void 0);
        }, focus: function focus() {
          this.selectedItem = null, this.previous = this._value();
        }, blur: function blur(t) {
          return this.cancelBlur ? (delete this.cancelBlur, void 0) : (clearTimeout(this.searching), this.close(t), this._change(t), void 0);
        } }), this._initSource(), this.menu = t("<ul>").appendTo(this._appendTo()).menu({ role: null }).hide().menu("instance"), this._addClass(this.menu.element, "ui-autocomplete", "ui-front"), this._on(this.menu.element, { mousedown: function mousedown(e) {
          e.preventDefault(), this.cancelBlur = !0, this._delay(function () {
            delete this.cancelBlur, this.element[0] !== t.ui.safeActiveElement(this.document[0]) && this.element.trigger("focus");
          });
        }, menufocus: function menufocus(e, i) {
          var s, n;return this.isNewMenu && (this.isNewMenu = !1, e.originalEvent && /^mouse/.test(e.originalEvent.type)) ? (this.menu.blur(), this.document.one("mousemove", function () {
            t(e.target).trigger(e.originalEvent);
          }), void 0) : (n = i.item.data("ui-autocomplete-item"), !1 !== this._trigger("focus", e, { item: n }) && e.originalEvent && /^key/.test(e.originalEvent.type) && this._value(n.value), s = i.item.attr("aria-label") || n.value, s && t.trim(s).length && (this.liveRegion.children().hide(), t("<div>").text(s).appendTo(this.liveRegion)), void 0);
        }, menuselect: function menuselect(e, i) {
          var s = i.item.data("ui-autocomplete-item"),
              n = this.previous;this.element[0] !== t.ui.safeActiveElement(this.document[0]) && (this.element.trigger("focus"), this.previous = n, this._delay(function () {
            this.previous = n, this.selectedItem = s;
          })), !1 !== this._trigger("select", e, { item: s }) && this._value(s.value), this.term = this._value(), this.close(e), this.selectedItem = s;
        } }), this.liveRegion = t("<div>", { role: "status", "aria-live": "assertive", "aria-relevant": "additions" }).appendTo(this.document[0].body), this._addClass(this.liveRegion, null, "ui-helper-hidden-accessible"), this._on(this.window, { beforeunload: function beforeunload() {
          this.element.removeAttr("autocomplete");
        } });
    }, _destroy: function _destroy() {
      clearTimeout(this.searching), this.element.removeAttr("autocomplete"), this.menu.element.remove(), this.liveRegion.remove();
    }, _setOption: function _setOption(t, e) {
      this._super(t, e), "source" === t && this._initSource(), "appendTo" === t && this.menu.element.appendTo(this._appendTo()), "disabled" === t && e && this.xhr && this.xhr.abort();
    }, _isEventTargetInWidget: function _isEventTargetInWidget(e) {
      var i = this.menu.element[0];return e.target === this.element[0] || e.target === i || t.contains(i, e.target);
    }, _closeOnClickOutside: function _closeOnClickOutside(t) {
      this._isEventTargetInWidget(t) || this.close();
    }, _appendTo: function _appendTo() {
      var e = this.options.appendTo;return e && (e = e.jquery || e.nodeType ? t(e) : this.document.find(e).eq(0)), e && e[0] || (e = this.element.closest(".ui-front, dialog")), e.length || (e = this.document[0].body), e;
    }, _initSource: function _initSource() {
      var e,
          i,
          s = this;t.isArray(this.options.source) ? (e = this.options.source, this.source = function (i, s) {
        s(t.ui.autocomplete.filter(e, i.term));
      }) : "string" == typeof this.options.source ? (i = this.options.source, this.source = function (e, n) {
        s.xhr && s.xhr.abort(), s.xhr = t.ajax({ url: i, data: e, dataType: "json", success: function success(t) {
            n(t);
          }, error: function error() {
            n([]);
          } });
      }) : this.source = this.options.source;
    }, _searchTimeout: function _searchTimeout(t) {
      clearTimeout(this.searching), this.searching = this._delay(function () {
        var e = this.term === this._value(),
            i = this.menu.element.is(":visible"),
            s = t.altKey || t.ctrlKey || t.metaKey || t.shiftKey;(!e || e && !i && !s) && (this.selectedItem = null, this.search(null, t));
      }, this.options.delay);
    }, search: function search(t, e) {
      return t = null != t ? t : this._value(), this.term = this._value(), t.length < this.options.minLength ? this.close(e) : this._trigger("search", e) !== !1 ? this._search(t) : void 0;
    }, _search: function _search(t) {
      this.pending++, this._addClass("ui-autocomplete-loading"), this.cancelSearch = !1, this.source({ term: t }, this._response());
    }, _response: function _response() {
      var e = ++this.requestIndex;return t.proxy(function (t) {
        e === this.requestIndex && this.__response(t), this.pending--, this.pending || this._removeClass("ui-autocomplete-loading");
      }, this);
    }, __response: function __response(t) {
      t && (t = this._normalize(t)), this._trigger("response", null, { content: t }), !this.options.disabled && t && t.length && !this.cancelSearch ? (this._suggest(t), this._trigger("open")) : this._close();
    }, close: function close(t) {
      this.cancelSearch = !0, this._close(t);
    }, _close: function _close(t) {
      this._off(this.document, "mousedown"), this.menu.element.is(":visible") && (this.menu.element.hide(), this.menu.blur(), this.isNewMenu = !0, this._trigger("close", t));
    }, _change: function _change(t) {
      this.previous !== this._value() && this._trigger("change", t, { item: this.selectedItem });
    }, _normalize: function _normalize(e) {
      return e.length && e[0].label && e[0].value ? e : t.map(e, function (e) {
        return "string" == typeof e ? { label: e, value: e } : t.extend({}, e, { label: e.label || e.value, value: e.value || e.label });
      });
    }, _suggest: function _suggest(e) {
      var i = this.menu.element.empty();this._renderMenu(i, e), this.isNewMenu = !0, this.menu.refresh(), i.show(), this._resizeMenu(), i.position(t.extend({ of: this.element }, this.options.position)), this.options.autoFocus && this.menu.next(), this._on(this.document, { mousedown: "_closeOnClickOutside" });
    }, _resizeMenu: function _resizeMenu() {
      var t = this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth() + 1, this.element.outerWidth()));
    }, _renderMenu: function _renderMenu(e, i) {
      var s = this;t.each(i, function (t, i) {
        s._renderItemData(e, i);
      });
    }, _renderItemData: function _renderItemData(t, e) {
      return this._renderItem(t, e).data("ui-autocomplete-item", e);
    }, _renderItem: function _renderItem(e, i) {
      return t("<li>").append(t("<div>").text(i.label)).appendTo(e);
    }, _move: function _move(t, e) {
      return this.menu.element.is(":visible") ? this.menu.isFirstItem() && /^previous/.test(t) || this.menu.isLastItem() && /^next/.test(t) ? (this.isMultiLine || this._value(this.term), this.menu.blur(), void 0) : (this.menu[t](e), void 0) : (this.search(null, e), void 0);
    }, widget: function widget() {
      return this.menu.element;
    }, _value: function _value() {
      return this.valueMethod.apply(this.element, arguments);
    }, _keyEvent: function _keyEvent(t, e) {
      (!this.isMultiLine || this.menu.element.is(":visible")) && (this._move(t, e), e.preventDefault());
    }, _isContentEditable: function _isContentEditable(t) {
      if (!t.length) return !1;var e = t.prop("contentEditable");return "inherit" === e ? this._isContentEditable(t.parent()) : "true" === e;
    } }), t.extend(t.ui.autocomplete, { escapeRegex: function escapeRegex(t) {
      return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
    }, filter: function filter(e, i) {
      var s = RegExp(t.ui.autocomplete.escapeRegex(i), "i");return t.grep(e, function (t) {
        return s.test(t.label || t.value || t);
      });
    } }), t.widget("ui.autocomplete", t.ui.autocomplete, { options: { messages: { noResults: "No search results.", results: function results(t) {
          return t + (t > 1 ? " results are" : " result is") + " available, use up and down arrow keys to navigate.";
        } } }, __response: function __response(e) {
      var i;this._superApply(arguments), this.options.disabled || this.cancelSearch || (i = e && e.length ? this.options.messages.results(e.length) : this.options.messages.noResults, this.liveRegion.children().hide(), t("<div>").text(i).appendTo(this.liveRegion));
    } }), t.ui.autocomplete;
});

},{}],52:[function(require,module,exports){
"use strict";

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

/*! jQuery UI - v1.12.1 - 2016-09-14
* http://jqueryui.com
* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

(function (factory) {
	if (typeof define === "function" && define.amd) {

		// AMD. Register as an anonymous module.
		define(["jquery"], factory);
	} else {

		// Browser globals
		factory(jQuery);
	}
})(function ($) {

	$.ui = $.ui || {};

	var version = $.ui.version = "1.12.1";

	/*!
  * jQuery UI Widget 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Widget
	//>>group: Core
	//>>description: Provides a factory for creating stateful widgets with a common API.
	//>>docs: http://api.jqueryui.com/jQuery.widget/
	//>>demos: http://jqueryui.com/widget/


	var widgetUuid = 0;
	var widgetSlice = Array.prototype.slice;

	$.cleanData = function (orig) {
		return function (elems) {
			var events, elem, i;
			for (i = 0; (elem = elems[i]) != null; i++) {
				try {

					// Only trigger remove when necessary to save time
					events = $._data(elem, "events");
					if (events && events.remove) {
						$(elem).triggerHandler("remove");
					}

					// Http://bugs.jquery.com/ticket/8235
				} catch (e) {}
			}
			orig(elems);
		};
	}($.cleanData);

	$.widget = function (name, base, prototype) {
		var existingConstructor, constructor, basePrototype;

		// ProxiedPrototype allows the provided prototype to remain unmodified
		// so that it can be used as a mixin for multiple widgets (#8876)
		var proxiedPrototype = {};

		var namespace = name.split(".")[0];
		name = name.split(".")[1];
		var fullName = namespace + "-" + name;

		if (!prototype) {
			prototype = base;
			base = $.Widget;
		}

		if ($.isArray(prototype)) {
			prototype = $.extend.apply(null, [{}].concat(prototype));
		}

		// Create selector for plugin
		$.expr[":"][fullName.toLowerCase()] = function (elem) {
			return !!$.data(elem, fullName);
		};

		$[namespace] = $[namespace] || {};
		existingConstructor = $[namespace][name];
		constructor = $[namespace][name] = function (options, element) {

			// Allow instantiation without "new" keyword
			if (!this._createWidget) {
				return new constructor(options, element);
			}

			// Allow instantiation without initializing for simple inheritance
			// must use "new" keyword (the code above always passes args)
			if (arguments.length) {
				this._createWidget(options, element);
			}
		};

		// Extend with the existing constructor to carry over any static properties
		$.extend(constructor, existingConstructor, {
			version: prototype.version,

			// Copy the object used to create the prototype in case we need to
			// redefine the widget later
			_proto: $.extend({}, prototype),

			// Track widgets that inherit from this widget in case this widget is
			// redefined after a widget inherits from it
			_childConstructors: []
		});

		basePrototype = new base();

		// We need to make the options hash a property directly on the new instance
		// otherwise we'll modify the options hash on the prototype that we're
		// inheriting from
		basePrototype.options = $.widget.extend({}, basePrototype.options);
		$.each(prototype, function (prop, value) {
			if (!$.isFunction(value)) {
				proxiedPrototype[prop] = value;
				return;
			}
			proxiedPrototype[prop] = function () {
				function _super() {
					return base.prototype[prop].apply(this, arguments);
				}

				function _superApply(args) {
					return base.prototype[prop].apply(this, args);
				}

				return function () {
					var __super = this._super;
					var __superApply = this._superApply;
					var returnValue;

					this._super = _super;
					this._superApply = _superApply;

					returnValue = value.apply(this, arguments);

					this._super = __super;
					this._superApply = __superApply;

					return returnValue;
				};
			}();
		});
		constructor.prototype = $.widget.extend(basePrototype, {

			// TODO: remove support for widgetEventPrefix
			// always use the name + a colon as the prefix, e.g., draggable:start
			// don't prefix for widgets that aren't DOM-based
			widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix || name : name
		}, proxiedPrototype, {
			constructor: constructor,
			namespace: namespace,
			widgetName: name,
			widgetFullName: fullName
		});

		// If this widget is being redefined then we need to find all widgets that
		// are inheriting from it and redefine all of them so that they inherit from
		// the new version of this widget. We're essentially trying to replace one
		// level in the prototype chain.
		if (existingConstructor) {
			$.each(existingConstructor._childConstructors, function (i, child) {
				var childPrototype = child.prototype;

				// Redefine the child widget using the same prototype that was
				// originally used, but inherit from the new version of the base
				$.widget(childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto);
			});

			// Remove the list of existing child constructors from the old constructor
			// so the old child constructors can be garbage collected
			delete existingConstructor._childConstructors;
		} else {
			base._childConstructors.push(constructor);
		}

		$.widget.bridge(name, constructor);

		return constructor;
	};

	$.widget.extend = function (target) {
		var input = widgetSlice.call(arguments, 1);
		var inputIndex = 0;
		var inputLength = input.length;
		var key;
		var value;

		for (; inputIndex < inputLength; inputIndex++) {
			for (key in input[inputIndex]) {
				value = input[inputIndex][key];
				if (input[inputIndex].hasOwnProperty(key) && value !== undefined) {

					// Clone objects
					if ($.isPlainObject(value)) {
						target[key] = $.isPlainObject(target[key]) ? $.widget.extend({}, target[key], value) :

						// Don't extend strings, arrays, etc. with objects
						$.widget.extend({}, value);

						// Copy everything else by reference
					} else {
						target[key] = value;
					}
				}
			}
		}
		return target;
	};

	$.widget.bridge = function (name, object) {
		var fullName = object.prototype.widgetFullName || name;
		$.fn[name] = function (options) {
			var isMethodCall = typeof options === "string";
			var args = widgetSlice.call(arguments, 1);
			var returnValue = this;

			if (isMethodCall) {

				// If this is an empty collection, we need to have the instance method
				// return undefined instead of the jQuery instance
				if (!this.length && options === "instance") {
					returnValue = undefined;
				} else {
					this.each(function () {
						var methodValue;
						var instance = $.data(this, fullName);

						if (options === "instance") {
							returnValue = instance;
							return false;
						}

						if (!instance) {
							return $.error("cannot call methods on " + name + " prior to initialization; " + "attempted to call method '" + options + "'");
						}

						if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
							return $.error("no such method '" + options + "' for " + name + " widget instance");
						}

						methodValue = instance[options].apply(instance, args);

						if (methodValue !== instance && methodValue !== undefined) {
							returnValue = methodValue && methodValue.jquery ? returnValue.pushStack(methodValue.get()) : methodValue;
							return false;
						}
					});
				}
			} else {

				// Allow multiple hashes to be passed on init
				if (args.length) {
					options = $.widget.extend.apply(null, [options].concat(args));
				}

				this.each(function () {
					var instance = $.data(this, fullName);
					if (instance) {
						instance.option(options || {});
						if (instance._init) {
							instance._init();
						}
					} else {
						$.data(this, fullName, new object(options, this));
					}
				});
			}

			return returnValue;
		};
	};

	$.Widget = function () /* options, element */{};
	$.Widget._childConstructors = [];

	$.Widget.prototype = {
		widgetName: "widget",
		widgetEventPrefix: "",
		defaultElement: "<div>",

		options: {
			classes: {},
			disabled: false,

			// Callbacks
			create: null
		},

		_createWidget: function _createWidget(options, element) {
			element = $(element || this.defaultElement || this)[0];
			this.element = $(element);
			this.uuid = widgetUuid++;
			this.eventNamespace = "." + this.widgetName + this.uuid;

			this.bindings = $();
			this.hoverable = $();
			this.focusable = $();
			this.classesElementLookup = {};

			if (element !== this) {
				$.data(element, this.widgetFullName, this);
				this._on(true, this.element, {
					remove: function remove(event) {
						if (event.target === element) {
							this.destroy();
						}
					}
				});
				this.document = $(element.style ?

				// Element within the document
				element.ownerDocument :

				// Element is window or document
				element.document || element);
				this.window = $(this.document[0].defaultView || this.document[0].parentWindow);
			}

			this.options = $.widget.extend({}, this.options, this._getCreateOptions(), options);

			this._create();

			if (this.options.disabled) {
				this._setOptionDisabled(this.options.disabled);
			}

			this._trigger("create", null, this._getCreateEventData());
			this._init();
		},

		_getCreateOptions: function _getCreateOptions() {
			return {};
		},

		_getCreateEventData: $.noop,

		_create: $.noop,

		_init: $.noop,

		destroy: function destroy() {
			var that = this;

			this._destroy();
			$.each(this.classesElementLookup, function (key, value) {
				that._removeClass(value, key);
			});

			// We can probably remove the unbind calls in 2.0
			// all event bindings should go through this._on()
			this.element.off(this.eventNamespace).removeData(this.widgetFullName);
			this.widget().off(this.eventNamespace).removeAttr("aria-disabled");

			// Clean up events and states
			this.bindings.off(this.eventNamespace);
		},

		_destroy: $.noop,

		widget: function widget() {
			return this.element;
		},

		option: function option(key, value) {
			var options = key;
			var parts;
			var curOption;
			var i;

			if (arguments.length === 0) {

				// Don't return a reference to the internal hash
				return $.widget.extend({}, this.options);
			}

			if (typeof key === "string") {

				// Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
				options = {};
				parts = key.split(".");
				key = parts.shift();
				if (parts.length) {
					curOption = options[key] = $.widget.extend({}, this.options[key]);
					for (i = 0; i < parts.length - 1; i++) {
						curOption[parts[i]] = curOption[parts[i]] || {};
						curOption = curOption[parts[i]];
					}
					key = parts.pop();
					if (arguments.length === 1) {
						return curOption[key] === undefined ? null : curOption[key];
					}
					curOption[key] = value;
				} else {
					if (arguments.length === 1) {
						return this.options[key] === undefined ? null : this.options[key];
					}
					options[key] = value;
				}
			}

			this._setOptions(options);

			return this;
		},

		_setOptions: function _setOptions(options) {
			var key;

			for (key in options) {
				this._setOption(key, options[key]);
			}

			return this;
		},

		_setOption: function _setOption(key, value) {
			if (key === "classes") {
				this._setOptionClasses(value);
			}

			this.options[key] = value;

			if (key === "disabled") {
				this._setOptionDisabled(value);
			}

			return this;
		},

		_setOptionClasses: function _setOptionClasses(value) {
			var classKey, elements, currentElements;

			for (classKey in value) {
				currentElements = this.classesElementLookup[classKey];
				if (value[classKey] === this.options.classes[classKey] || !currentElements || !currentElements.length) {
					continue;
				}

				// We are doing this to create a new jQuery object because the _removeClass() call
				// on the next line is going to destroy the reference to the current elements being
				// tracked. We need to save a copy of this collection so that we can add the new classes
				// below.
				elements = $(currentElements.get());
				this._removeClass(currentElements, classKey);

				// We don't use _addClass() here, because that uses this.options.classes
				// for generating the string of classes. We want to use the value passed in from
				// _setOption(), this is the new value of the classes option which was passed to
				// _setOption(). We pass this value directly to _classes().
				elements.addClass(this._classes({
					element: elements,
					keys: classKey,
					classes: value,
					add: true
				}));
			}
		},

		_setOptionDisabled: function _setOptionDisabled(value) {
			this._toggleClass(this.widget(), this.widgetFullName + "-disabled", null, !!value);

			// If the widget is becoming disabled, then nothing is interactive
			if (value) {
				this._removeClass(this.hoverable, null, "ui-state-hover");
				this._removeClass(this.focusable, null, "ui-state-focus");
			}
		},

		enable: function enable() {
			return this._setOptions({ disabled: false });
		},

		disable: function disable() {
			return this._setOptions({ disabled: true });
		},

		_classes: function _classes(options) {
			var full = [];
			var that = this;

			options = $.extend({
				element: this.element,
				classes: this.options.classes || {}
			}, options);

			function processClassString(classes, checkOption) {
				var current, i;
				for (i = 0; i < classes.length; i++) {
					current = that.classesElementLookup[classes[i]] || $();
					if (options.add) {
						current = $($.unique(current.get().concat(options.element.get())));
					} else {
						current = $(current.not(options.element).get());
					}
					that.classesElementLookup[classes[i]] = current;
					full.push(classes[i]);
					if (checkOption && options.classes[classes[i]]) {
						full.push(options.classes[classes[i]]);
					}
				}
			}

			this._on(options.element, {
				"remove": "_untrackClassesElement"
			});

			if (options.keys) {
				processClassString(options.keys.match(/\S+/g) || [], true);
			}
			if (options.extra) {
				processClassString(options.extra.match(/\S+/g) || []);
			}

			return full.join(" ");
		},

		_untrackClassesElement: function _untrackClassesElement(event) {
			var that = this;
			$.each(that.classesElementLookup, function (key, value) {
				if ($.inArray(event.target, value) !== -1) {
					that.classesElementLookup[key] = $(value.not(event.target).get());
				}
			});
		},

		_removeClass: function _removeClass(element, keys, extra) {
			return this._toggleClass(element, keys, extra, false);
		},

		_addClass: function _addClass(element, keys, extra) {
			return this._toggleClass(element, keys, extra, true);
		},

		_toggleClass: function _toggleClass(element, keys, extra, add) {
			add = typeof add === "boolean" ? add : extra;
			var shift = typeof element === "string" || element === null,
			    options = {
				extra: shift ? keys : extra,
				keys: shift ? element : keys,
				element: shift ? this.element : element,
				add: add
			};
			options.element.toggleClass(this._classes(options), add);
			return this;
		},

		_on: function _on(suppressDisabledCheck, element, handlers) {
			var delegateElement;
			var instance = this;

			// No suppressDisabledCheck flag, shuffle arguments
			if (typeof suppressDisabledCheck !== "boolean") {
				handlers = element;
				element = suppressDisabledCheck;
				suppressDisabledCheck = false;
			}

			// No element argument, shuffle and use this.element
			if (!handlers) {
				handlers = element;
				element = this.element;
				delegateElement = this.widget();
			} else {
				element = delegateElement = $(element);
				this.bindings = this.bindings.add(element);
			}

			$.each(handlers, function (event, handler) {
				function handlerProxy() {

					// Allow widgets to customize the disabled handling
					// - disabled as an array instead of boolean
					// - disabled class as method for disabling individual parts
					if (!suppressDisabledCheck && (instance.options.disabled === true || $(this).hasClass("ui-state-disabled"))) {
						return;
					}
					return (typeof handler === "string" ? instance[handler] : handler).apply(instance, arguments);
				}

				// Copy the guid so direct unbinding works
				if (typeof handler !== "string") {
					handlerProxy.guid = handler.guid = handler.guid || handlerProxy.guid || $.guid++;
				}

				var match = event.match(/^([\w:-]*)\s*(.*)$/);
				var eventName = match[1] + instance.eventNamespace;
				var selector = match[2];

				if (selector) {
					delegateElement.on(eventName, selector, handlerProxy);
				} else {
					element.on(eventName, handlerProxy);
				}
			});
		},

		_off: function _off(element, eventName) {
			eventName = (eventName || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace;
			element.off(eventName).off(eventName);

			// Clear the stack to avoid memory leaks (#10056)
			this.bindings = $(this.bindings.not(element).get());
			this.focusable = $(this.focusable.not(element).get());
			this.hoverable = $(this.hoverable.not(element).get());
		},

		_delay: function _delay(handler, delay) {
			function handlerProxy() {
				return (typeof handler === "string" ? instance[handler] : handler).apply(instance, arguments);
			}
			var instance = this;
			return setTimeout(handlerProxy, delay || 0);
		},

		_hoverable: function _hoverable(element) {
			this.hoverable = this.hoverable.add(element);
			this._on(element, {
				mouseenter: function mouseenter(event) {
					this._addClass($(event.currentTarget), null, "ui-state-hover");
				},
				mouseleave: function mouseleave(event) {
					this._removeClass($(event.currentTarget), null, "ui-state-hover");
				}
			});
		},

		_focusable: function _focusable(element) {
			this.focusable = this.focusable.add(element);
			this._on(element, {
				focusin: function focusin(event) {
					this._addClass($(event.currentTarget), null, "ui-state-focus");
				},
				focusout: function focusout(event) {
					this._removeClass($(event.currentTarget), null, "ui-state-focus");
				}
			});
		},

		_trigger: function _trigger(type, event, data) {
			var prop, orig;
			var callback = this.options[type];

			data = data || {};
			event = $.Event(event);
			event.type = (type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type).toLowerCase();

			// The original event may come from any element
			// so we need to reset the target on the new event
			event.target = this.element[0];

			// Copy original event properties over to the new event
			orig = event.originalEvent;
			if (orig) {
				for (prop in orig) {
					if (!(prop in event)) {
						event[prop] = orig[prop];
					}
				}
			}

			this.element.trigger(event, data);
			return !($.isFunction(callback) && callback.apply(this.element[0], [event].concat(data)) === false || event.isDefaultPrevented());
		}
	};

	$.each({ show: "fadeIn", hide: "fadeOut" }, function (method, defaultEffect) {
		$.Widget.prototype["_" + method] = function (element, options, callback) {
			if (typeof options === "string") {
				options = { effect: options };
			}

			var hasOptions;
			var effectName = !options ? method : options === true || typeof options === "number" ? defaultEffect : options.effect || defaultEffect;

			options = options || {};
			if (typeof options === "number") {
				options = { duration: options };
			}

			hasOptions = !$.isEmptyObject(options);
			options.complete = callback;

			if (options.delay) {
				element.delay(options.delay);
			}

			if (hasOptions && $.effects && $.effects.effect[effectName]) {
				element[method](options);
			} else if (effectName !== method && element[effectName]) {
				element[effectName](options.duration, options.easing, callback);
			} else {
				element.queue(function (next) {
					$(this)[method]();
					if (callback) {
						callback.call(element[0]);
					}
					next();
				});
			}
		};
	});

	var widget = $.widget;

	/*!
  * jQuery UI Position 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
  * http://api.jqueryui.com/position/
  */

	//>>label: Position
	//>>group: Core
	//>>description: Positions elements relative to other elements.
	//>>docs: http://api.jqueryui.com/position/
	//>>demos: http://jqueryui.com/position/


	(function () {
		var cachedScrollbarWidth,
		    max = Math.max,
		    abs = Math.abs,
		    rhorizontal = /left|center|right/,
		    rvertical = /top|center|bottom/,
		    roffset = /[\+\-]\d+(\.[\d]+)?%?/,
		    rposition = /^\w+/,
		    rpercent = /%$/,
		    _position = $.fn.position;

		function getOffsets(offsets, width, height) {
			return [parseFloat(offsets[0]) * (rpercent.test(offsets[0]) ? width / 100 : 1), parseFloat(offsets[1]) * (rpercent.test(offsets[1]) ? height / 100 : 1)];
		}

		function parseCss(element, property) {
			return parseInt($.css(element, property), 10) || 0;
		}

		function getDimensions(elem) {
			var raw = elem[0];
			if (raw.nodeType === 9) {
				return {
					width: elem.width(),
					height: elem.height(),
					offset: { top: 0, left: 0 }
				};
			}
			if ($.isWindow(raw)) {
				return {
					width: elem.width(),
					height: elem.height(),
					offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
				};
			}
			if (raw.preventDefault) {
				return {
					width: 0,
					height: 0,
					offset: { top: raw.pageY, left: raw.pageX }
				};
			}
			return {
				width: elem.outerWidth(),
				height: elem.outerHeight(),
				offset: elem.offset()
			};
		}

		$.position = {
			scrollbarWidth: function scrollbarWidth() {
				if (cachedScrollbarWidth !== undefined) {
					return cachedScrollbarWidth;
				}
				var w1,
				    w2,
				    div = $("<div " + "style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" + "<div style='height:100px;width:auto;'></div></div>"),
				    innerDiv = div.children()[0];

				$("body").append(div);
				w1 = innerDiv.offsetWidth;
				div.css("overflow", "scroll");

				w2 = innerDiv.offsetWidth;

				if (w1 === w2) {
					w2 = div[0].clientWidth;
				}

				div.remove();

				return cachedScrollbarWidth = w1 - w2;
			},
			getScrollInfo: function getScrollInfo(within) {
				var overflowX = within.isWindow || within.isDocument ? "" : within.element.css("overflow-x"),
				    overflowY = within.isWindow || within.isDocument ? "" : within.element.css("overflow-y"),
				    hasOverflowX = overflowX === "scroll" || overflowX === "auto" && within.width < within.element[0].scrollWidth,
				    hasOverflowY = overflowY === "scroll" || overflowY === "auto" && within.height < within.element[0].scrollHeight;
				return {
					width: hasOverflowY ? $.position.scrollbarWidth() : 0,
					height: hasOverflowX ? $.position.scrollbarWidth() : 0
				};
			},
			getWithinInfo: function getWithinInfo(element) {
				var withinElement = $(element || window),
				    isWindow = $.isWindow(withinElement[0]),
				    isDocument = !!withinElement[0] && withinElement[0].nodeType === 9,
				    hasOffset = !isWindow && !isDocument;
				return {
					element: withinElement,
					isWindow: isWindow,
					isDocument: isDocument,
					offset: hasOffset ? $(element).offset() : { left: 0, top: 0 },
					scrollLeft: withinElement.scrollLeft(),
					scrollTop: withinElement.scrollTop(),
					width: withinElement.outerWidth(),
					height: withinElement.outerHeight()
				};
			}
		};

		$.fn.position = function (options) {
			if (!options || !options.of) {
				return _position.apply(this, arguments);
			}

			// Make a copy, we don't want to modify arguments
			options = $.extend({}, options);

			var atOffset,
			    targetWidth,
			    targetHeight,
			    targetOffset,
			    basePosition,
			    dimensions,
			    target = $(options.of),
			    within = $.position.getWithinInfo(options.within),
			    scrollInfo = $.position.getScrollInfo(within),
			    collision = (options.collision || "flip").split(" "),
			    offsets = {};

			dimensions = getDimensions(target);
			if (target[0].preventDefault) {

				// Force left top to allow flipping
				options.at = "left top";
			}
			targetWidth = dimensions.width;
			targetHeight = dimensions.height;
			targetOffset = dimensions.offset;

			// Clone to reuse original targetOffset later
			basePosition = $.extend({}, targetOffset);

			// Force my and at to have valid horizontal and vertical positions
			// if a value is missing or invalid, it will be converted to center
			$.each(["my", "at"], function () {
				var pos = (options[this] || "").split(" "),
				    horizontalOffset,
				    verticalOffset;

				if (pos.length === 1) {
					pos = rhorizontal.test(pos[0]) ? pos.concat(["center"]) : rvertical.test(pos[0]) ? ["center"].concat(pos) : ["center", "center"];
				}
				pos[0] = rhorizontal.test(pos[0]) ? pos[0] : "center";
				pos[1] = rvertical.test(pos[1]) ? pos[1] : "center";

				// Calculate offsets
				horizontalOffset = roffset.exec(pos[0]);
				verticalOffset = roffset.exec(pos[1]);
				offsets[this] = [horizontalOffset ? horizontalOffset[0] : 0, verticalOffset ? verticalOffset[0] : 0];

				// Reduce to just the positions without the offsets
				options[this] = [rposition.exec(pos[0])[0], rposition.exec(pos[1])[0]];
			});

			// Normalize collision option
			if (collision.length === 1) {
				collision[1] = collision[0];
			}

			if (options.at[0] === "right") {
				basePosition.left += targetWidth;
			} else if (options.at[0] === "center") {
				basePosition.left += targetWidth / 2;
			}

			if (options.at[1] === "bottom") {
				basePosition.top += targetHeight;
			} else if (options.at[1] === "center") {
				basePosition.top += targetHeight / 2;
			}

			atOffset = getOffsets(offsets.at, targetWidth, targetHeight);
			basePosition.left += atOffset[0];
			basePosition.top += atOffset[1];

			return this.each(function () {
				var collisionPosition,
				    using,
				    elem = $(this),
				    elemWidth = elem.outerWidth(),
				    elemHeight = elem.outerHeight(),
				    marginLeft = parseCss(this, "marginLeft"),
				    marginTop = parseCss(this, "marginTop"),
				    collisionWidth = elemWidth + marginLeft + parseCss(this, "marginRight") + scrollInfo.width,
				    collisionHeight = elemHeight + marginTop + parseCss(this, "marginBottom") + scrollInfo.height,
				    position = $.extend({}, basePosition),
				    myOffset = getOffsets(offsets.my, elem.outerWidth(), elem.outerHeight());

				if (options.my[0] === "right") {
					position.left -= elemWidth;
				} else if (options.my[0] === "center") {
					position.left -= elemWidth / 2;
				}

				if (options.my[1] === "bottom") {
					position.top -= elemHeight;
				} else if (options.my[1] === "center") {
					position.top -= elemHeight / 2;
				}

				position.left += myOffset[0];
				position.top += myOffset[1];

				collisionPosition = {
					marginLeft: marginLeft,
					marginTop: marginTop
				};

				$.each(["left", "top"], function (i, dir) {
					if ($.ui.position[collision[i]]) {
						$.ui.position[collision[i]][dir](position, {
							targetWidth: targetWidth,
							targetHeight: targetHeight,
							elemWidth: elemWidth,
							elemHeight: elemHeight,
							collisionPosition: collisionPosition,
							collisionWidth: collisionWidth,
							collisionHeight: collisionHeight,
							offset: [atOffset[0] + myOffset[0], atOffset[1] + myOffset[1]],
							my: options.my,
							at: options.at,
							within: within,
							elem: elem
						});
					}
				});

				if (options.using) {

					// Adds feedback as second argument to using callback, if present
					using = function using(props) {
						var left = targetOffset.left - position.left,
						    right = left + targetWidth - elemWidth,
						    top = targetOffset.top - position.top,
						    bottom = top + targetHeight - elemHeight,
						    feedback = {
							target: {
								element: target,
								left: targetOffset.left,
								top: targetOffset.top,
								width: targetWidth,
								height: targetHeight
							},
							element: {
								element: elem,
								left: position.left,
								top: position.top,
								width: elemWidth,
								height: elemHeight
							},
							horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
							vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
						};
						if (targetWidth < elemWidth && abs(left + right) < targetWidth) {
							feedback.horizontal = "center";
						}
						if (targetHeight < elemHeight && abs(top + bottom) < targetHeight) {
							feedback.vertical = "middle";
						}
						if (max(abs(left), abs(right)) > max(abs(top), abs(bottom))) {
							feedback.important = "horizontal";
						} else {
							feedback.important = "vertical";
						}
						options.using.call(this, props, feedback);
					};
				}

				elem.offset($.extend(position, { using: using }));
			});
		};

		$.ui.position = {
			fit: {
				left: function left(position, data) {
					var within = data.within,
					    withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
					    outerWidth = within.width,
					    collisionPosLeft = position.left - data.collisionPosition.marginLeft,
					    overLeft = withinOffset - collisionPosLeft,
					    overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
					    newOverRight;

					// Element is wider than within
					if (data.collisionWidth > outerWidth) {

						// Element is initially over the left side of within
						if (overLeft > 0 && overRight <= 0) {
							newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
							position.left += overLeft - newOverRight;

							// Element is initially over right side of within
						} else if (overRight > 0 && overLeft <= 0) {
							position.left = withinOffset;

							// Element is initially over both left and right sides of within
						} else {
							if (overLeft > overRight) {
								position.left = withinOffset + outerWidth - data.collisionWidth;
							} else {
								position.left = withinOffset;
							}
						}

						// Too far left -> align with left edge
					} else if (overLeft > 0) {
						position.left += overLeft;

						// Too far right -> align with right edge
					} else if (overRight > 0) {
						position.left -= overRight;

						// Adjust based on position and margin
					} else {
						position.left = max(position.left - collisionPosLeft, position.left);
					}
				},
				top: function top(position, data) {
					var within = data.within,
					    withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
					    outerHeight = data.within.height,
					    collisionPosTop = position.top - data.collisionPosition.marginTop,
					    overTop = withinOffset - collisionPosTop,
					    overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
					    newOverBottom;

					// Element is taller than within
					if (data.collisionHeight > outerHeight) {

						// Element is initially over the top of within
						if (overTop > 0 && overBottom <= 0) {
							newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
							position.top += overTop - newOverBottom;

							// Element is initially over bottom of within
						} else if (overBottom > 0 && overTop <= 0) {
							position.top = withinOffset;

							// Element is initially over both top and bottom of within
						} else {
							if (overTop > overBottom) {
								position.top = withinOffset + outerHeight - data.collisionHeight;
							} else {
								position.top = withinOffset;
							}
						}

						// Too far up -> align with top
					} else if (overTop > 0) {
						position.top += overTop;

						// Too far down -> align with bottom edge
					} else if (overBottom > 0) {
						position.top -= overBottom;

						// Adjust based on position and margin
					} else {
						position.top = max(position.top - collisionPosTop, position.top);
					}
				}
			},
			flip: {
				left: function left(position, data) {
					var within = data.within,
					    withinOffset = within.offset.left + within.scrollLeft,
					    outerWidth = within.width,
					    offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
					    collisionPosLeft = position.left - data.collisionPosition.marginLeft,
					    overLeft = collisionPosLeft - offsetLeft,
					    overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
					    myOffset = data.my[0] === "left" ? -data.elemWidth : data.my[0] === "right" ? data.elemWidth : 0,
					    atOffset = data.at[0] === "left" ? data.targetWidth : data.at[0] === "right" ? -data.targetWidth : 0,
					    offset = -2 * data.offset[0],
					    newOverRight,
					    newOverLeft;

					if (overLeft < 0) {
						newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
						if (newOverRight < 0 || newOverRight < abs(overLeft)) {
							position.left += myOffset + atOffset + offset;
						}
					} else if (overRight > 0) {
						newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
						if (newOverLeft > 0 || abs(newOverLeft) < overRight) {
							position.left += myOffset + atOffset + offset;
						}
					}
				},
				top: function top(position, data) {
					var within = data.within,
					    withinOffset = within.offset.top + within.scrollTop,
					    outerHeight = within.height,
					    offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
					    collisionPosTop = position.top - data.collisionPosition.marginTop,
					    overTop = collisionPosTop - offsetTop,
					    overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
					    top = data.my[1] === "top",
					    myOffset = top ? -data.elemHeight : data.my[1] === "bottom" ? data.elemHeight : 0,
					    atOffset = data.at[1] === "top" ? data.targetHeight : data.at[1] === "bottom" ? -data.targetHeight : 0,
					    offset = -2 * data.offset[1],
					    newOverTop,
					    newOverBottom;
					if (overTop < 0) {
						newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
						if (newOverBottom < 0 || newOverBottom < abs(overTop)) {
							position.top += myOffset + atOffset + offset;
						}
					} else if (overBottom > 0) {
						newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
						if (newOverTop > 0 || abs(newOverTop) < overBottom) {
							position.top += myOffset + atOffset + offset;
						}
					}
				}
			},
			flipfit: {
				left: function left() {
					$.ui.position.flip.left.apply(this, arguments);
					$.ui.position.fit.left.apply(this, arguments);
				},
				top: function top() {
					$.ui.position.flip.top.apply(this, arguments);
					$.ui.position.fit.top.apply(this, arguments);
				}
			}
		};
	})();

	var position = $.ui.position;

	/*!
  * jQuery UI :data 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: :data Selector
	//>>group: Core
	//>>description: Selects elements which have data stored under the specified key.
	//>>docs: http://api.jqueryui.com/data-selector/


	var data = $.extend($.expr[":"], {
		data: $.expr.createPseudo ? $.expr.createPseudo(function (dataName) {
			return function (elem) {
				return !!$.data(elem, dataName);
			};
		}) :

		// Support: jQuery <1.8
		function (elem, i, match) {
			return !!$.data(elem, match[3]);
		}
	});

	/*!
  * jQuery UI Disable Selection 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: disableSelection
	//>>group: Core
	//>>description: Disable selection of text content within the set of matched elements.
	//>>docs: http://api.jqueryui.com/disableSelection/

	// This file is deprecated


	var disableSelection = $.fn.extend({
		disableSelection: function () {
			var eventType = "onselectstart" in document.createElement("div") ? "selectstart" : "mousedown";

			return function () {
				return this.on(eventType + ".ui-disableSelection", function (event) {
					event.preventDefault();
				});
			};
		}(),

		enableSelection: function enableSelection() {
			return this.off(".ui-disableSelection");
		}
	});

	/*!
  * jQuery UI Effects 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Effects Core
	//>>group: Effects
	// jscs:disable maximumLineLength
	//>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.
	// jscs:enable maximumLineLength
	//>>docs: http://api.jqueryui.com/category/effects-core/
	//>>demos: http://jqueryui.com/effect/


	var dataSpace = "ui-effects-",
	    dataSpaceStyle = "ui-effects-style",
	    dataSpaceAnimated = "ui-effects-animated",


	// Create a local jQuery because jQuery Color relies on it and the
	// global may not exist with AMD and a custom build (#10199)
	jQuery = $;

	$.effects = {
		effect: {}
	};

	/*!
  * jQuery Color Animations v2.1.2
  * https://github.com/jquery/jquery-color
  *
  * Copyright 2014 jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
  * Date: Wed Jan 16 08:47:09 2013 -0600
  */
	(function (jQuery, undefined) {

		var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor " + "borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",


		// Plusequals test for += 100 -= 100
		rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,


		// A set of RE's that can match strings and generate color tuples.
		stringParsers = [{
			re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
			parse: function parse(execResult) {
				return [execResult[1], execResult[2], execResult[3], execResult[4]];
			}
		}, {
			re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
			parse: function parse(execResult) {
				return [execResult[1] * 2.55, execResult[2] * 2.55, execResult[3] * 2.55, execResult[4]];
			}
		}, {

			// This regex ignores A-F because it's compared against an already lowercased string
			re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
			parse: function parse(execResult) {
				return [parseInt(execResult[1], 16), parseInt(execResult[2], 16), parseInt(execResult[3], 16)];
			}
		}, {

			// This regex ignores A-F because it's compared against an already lowercased string
			re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
			parse: function parse(execResult) {
				return [parseInt(execResult[1] + execResult[1], 16), parseInt(execResult[2] + execResult[2], 16), parseInt(execResult[3] + execResult[3], 16)];
			}
		}, {
			re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
			space: "hsla",
			parse: function parse(execResult) {
				return [execResult[1], execResult[2] / 100, execResult[3] / 100, execResult[4]];
			}
		}],


		// JQuery.Color( )
		color = jQuery.Color = function (color, green, blue, alpha) {
			return new jQuery.Color.fn.parse(color, green, blue, alpha);
		},
		    spaces = {
			rgba: {
				props: {
					red: {
						idx: 0,
						type: "byte"
					},
					green: {
						idx: 1,
						type: "byte"
					},
					blue: {
						idx: 2,
						type: "byte"
					}
				}
			},

			hsla: {
				props: {
					hue: {
						idx: 0,
						type: "degrees"
					},
					saturation: {
						idx: 1,
						type: "percent"
					},
					lightness: {
						idx: 2,
						type: "percent"
					}
				}
			}
		},
		    propTypes = {
			"byte": {
				floor: true,
				max: 255
			},
			"percent": {
				max: 1
			},
			"degrees": {
				mod: 360,
				floor: true
			}
		},
		    support = color.support = {},


		// Element for support tests
		supportElem = jQuery("<p>")[0],


		// Colors = jQuery.Color.names
		colors,


		// Local aliases of functions called often
		each = jQuery.each;

		// Determine rgba support immediately
		supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
		support.rgba = supportElem.style.backgroundColor.indexOf("rgba") > -1;

		// Define cache name and alpha properties
		// for rgba and hsla spaces
		each(spaces, function (spaceName, space) {
			space.cache = "_" + spaceName;
			space.props.alpha = {
				idx: 3,
				type: "percent",
				def: 1
			};
		});

		function clamp(value, prop, allowEmpty) {
			var type = propTypes[prop.type] || {};

			if (value == null) {
				return allowEmpty || !prop.def ? null : prop.def;
			}

			// ~~ is an short way of doing floor for positive numbers
			value = type.floor ? ~~value : parseFloat(value);

			// IE will pass in empty strings as value for alpha,
			// which will hit this case
			if (isNaN(value)) {
				return prop.def;
			}

			if (type.mod) {

				// We add mod before modding to make sure that negatives values
				// get converted properly: -10 -> 350
				return (value + type.mod) % type.mod;
			}

			// For now all property types without mod have min and max
			return 0 > value ? 0 : type.max < value ? type.max : value;
		}

		function stringParse(string) {
			var inst = color(),
			    rgba = inst._rgba = [];

			string = string.toLowerCase();

			each(stringParsers, function (i, parser) {
				var parsed,
				    match = parser.re.exec(string),
				    values = match && parser.parse(match),
				    spaceName = parser.space || "rgba";

				if (values) {
					parsed = inst[spaceName](values);

					// If this was an rgba parse the assignment might happen twice
					// oh well....
					inst[spaces[spaceName].cache] = parsed[spaces[spaceName].cache];
					rgba = inst._rgba = parsed._rgba;

					// Exit each( stringParsers ) here because we matched
					return false;
				}
			});

			// Found a stringParser that handled it
			if (rgba.length) {

				// If this came from a parsed string, force "transparent" when alpha is 0
				// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
				if (rgba.join() === "0,0,0,0") {
					jQuery.extend(rgba, colors.transparent);
				}
				return inst;
			}

			// Named colors
			return colors[string];
		}

		color.fn = jQuery.extend(color.prototype, {
			parse: function parse(red, green, blue, alpha) {
				if (red === undefined) {
					this._rgba = [null, null, null, null];
					return this;
				}
				if (red.jquery || red.nodeType) {
					red = jQuery(red).css(green);
					green = undefined;
				}

				var inst = this,
				    type = jQuery.type(red),
				    rgba = this._rgba = [];

				// More than 1 argument specified - assume ( red, green, blue, alpha )
				if (green !== undefined) {
					red = [red, green, blue, alpha];
					type = "array";
				}

				if (type === "string") {
					return this.parse(stringParse(red) || colors._default);
				}

				if (type === "array") {
					each(spaces.rgba.props, function (key, prop) {
						rgba[prop.idx] = clamp(red[prop.idx], prop);
					});
					return this;
				}

				if (type === "object") {
					if (red instanceof color) {
						each(spaces, function (spaceName, space) {
							if (red[space.cache]) {
								inst[space.cache] = red[space.cache].slice();
							}
						});
					} else {
						each(spaces, function (spaceName, space) {
							var cache = space.cache;
							each(space.props, function (key, prop) {

								// If the cache doesn't exist, and we know how to convert
								if (!inst[cache] && space.to) {

									// If the value was null, we don't need to copy it
									// if the key was alpha, we don't need to copy it either
									if (key === "alpha" || red[key] == null) {
										return;
									}
									inst[cache] = space.to(inst._rgba);
								}

								// This is the only case where we allow nulls for ALL properties.
								// call clamp with alwaysAllowEmpty
								inst[cache][prop.idx] = clamp(red[key], prop, true);
							});

							// Everything defined but alpha?
							if (inst[cache] && jQuery.inArray(null, inst[cache].slice(0, 3)) < 0) {

								// Use the default of 1
								inst[cache][3] = 1;
								if (space.from) {
									inst._rgba = space.from(inst[cache]);
								}
							}
						});
					}
					return this;
				}
			},
			is: function is(compare) {
				var is = color(compare),
				    same = true,
				    inst = this;

				each(spaces, function (_, space) {
					var localCache,
					    isCache = is[space.cache];
					if (isCache) {
						localCache = inst[space.cache] || space.to && space.to(inst._rgba) || [];
						each(space.props, function (_, prop) {
							if (isCache[prop.idx] != null) {
								same = isCache[prop.idx] === localCache[prop.idx];
								return same;
							}
						});
					}
					return same;
				});
				return same;
			},
			_space: function _space() {
				var used = [],
				    inst = this;
				each(spaces, function (spaceName, space) {
					if (inst[space.cache]) {
						used.push(spaceName);
					}
				});
				return used.pop();
			},
			transition: function transition(other, distance) {
				var end = color(other),
				    spaceName = end._space(),
				    space = spaces[spaceName],
				    startColor = this.alpha() === 0 ? color("transparent") : this,
				    start = startColor[space.cache] || space.to(startColor._rgba),
				    result = start.slice();

				end = end[space.cache];
				each(space.props, function (key, prop) {
					var index = prop.idx,
					    startValue = start[index],
					    endValue = end[index],
					    type = propTypes[prop.type] || {};

					// If null, don't override start value
					if (endValue === null) {
						return;
					}

					// If null - use end
					if (startValue === null) {
						result[index] = endValue;
					} else {
						if (type.mod) {
							if (endValue - startValue > type.mod / 2) {
								startValue += type.mod;
							} else if (startValue - endValue > type.mod / 2) {
								startValue -= type.mod;
							}
						}
						result[index] = clamp((endValue - startValue) * distance + startValue, prop);
					}
				});
				return this[spaceName](result);
			},
			blend: function blend(opaque) {

				// If we are already opaque - return ourself
				if (this._rgba[3] === 1) {
					return this;
				}

				var rgb = this._rgba.slice(),
				    a = rgb.pop(),
				    blend = color(opaque)._rgba;

				return color(jQuery.map(rgb, function (v, i) {
					return (1 - a) * blend[i] + a * v;
				}));
			},
			toRgbaString: function toRgbaString() {
				var prefix = "rgba(",
				    rgba = jQuery.map(this._rgba, function (v, i) {
					return v == null ? i > 2 ? 1 : 0 : v;
				});

				if (rgba[3] === 1) {
					rgba.pop();
					prefix = "rgb(";
				}

				return prefix + rgba.join() + ")";
			},
			toHslaString: function toHslaString() {
				var prefix = "hsla(",
				    hsla = jQuery.map(this.hsla(), function (v, i) {
					if (v == null) {
						v = i > 2 ? 1 : 0;
					}

					// Catch 1 and 2
					if (i && i < 3) {
						v = Math.round(v * 100) + "%";
					}
					return v;
				});

				if (hsla[3] === 1) {
					hsla.pop();
					prefix = "hsl(";
				}
				return prefix + hsla.join() + ")";
			},
			toHexString: function toHexString(includeAlpha) {
				var rgba = this._rgba.slice(),
				    alpha = rgba.pop();

				if (includeAlpha) {
					rgba.push(~~(alpha * 255));
				}

				return "#" + jQuery.map(rgba, function (v) {

					// Default to 0 when nulls exist
					v = (v || 0).toString(16);
					return v.length === 1 ? "0" + v : v;
				}).join("");
			},
			toString: function toString() {
				return this._rgba[3] === 0 ? "transparent" : this.toRgbaString();
			}
		});
		color.fn.parse.prototype = color.fn;

		// Hsla conversions adapted from:
		// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021

		function hue2rgb(p, q, h) {
			h = (h + 1) % 1;
			if (h * 6 < 1) {
				return p + (q - p) * h * 6;
			}
			if (h * 2 < 1) {
				return q;
			}
			if (h * 3 < 2) {
				return p + (q - p) * (2 / 3 - h) * 6;
			}
			return p;
		}

		spaces.hsla.to = function (rgba) {
			if (rgba[0] == null || rgba[1] == null || rgba[2] == null) {
				return [null, null, null, rgba[3]];
			}
			var r = rgba[0] / 255,
			    g = rgba[1] / 255,
			    b = rgba[2] / 255,
			    a = rgba[3],
			    max = Math.max(r, g, b),
			    min = Math.min(r, g, b),
			    diff = max - min,
			    add = max + min,
			    l = add * 0.5,
			    h,
			    s;

			if (min === max) {
				h = 0;
			} else if (r === max) {
				h = 60 * (g - b) / diff + 360;
			} else if (g === max) {
				h = 60 * (b - r) / diff + 120;
			} else {
				h = 60 * (r - g) / diff + 240;
			}

			// Chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
			// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
			if (diff === 0) {
				s = 0;
			} else if (l <= 0.5) {
				s = diff / add;
			} else {
				s = diff / (2 - add);
			}
			return [Math.round(h) % 360, s, l, a == null ? 1 : a];
		};

		spaces.hsla.from = function (hsla) {
			if (hsla[0] == null || hsla[1] == null || hsla[2] == null) {
				return [null, null, null, hsla[3]];
			}
			var h = hsla[0] / 360,
			    s = hsla[1],
			    l = hsla[2],
			    a = hsla[3],
			    q = l <= 0.5 ? l * (1 + s) : l + s - l * s,
			    p = 2 * l - q;

			return [Math.round(hue2rgb(p, q, h + 1 / 3) * 255), Math.round(hue2rgb(p, q, h) * 255), Math.round(hue2rgb(p, q, h - 1 / 3) * 255), a];
		};

		each(spaces, function (spaceName, space) {
			var props = space.props,
			    cache = space.cache,
			    to = space.to,
			    from = space.from;

			// Makes rgba() and hsla()
			color.fn[spaceName] = function (value) {

				// Generate a cache for this space if it doesn't exist
				if (to && !this[cache]) {
					this[cache] = to(this._rgba);
				}
				if (value === undefined) {
					return this[cache].slice();
				}

				var ret,
				    type = jQuery.type(value),
				    arr = type === "array" || type === "object" ? value : arguments,
				    local = this[cache].slice();

				each(props, function (key, prop) {
					var val = arr[type === "object" ? key : prop.idx];
					if (val == null) {
						val = local[prop.idx];
					}
					local[prop.idx] = clamp(val, prop);
				});

				if (from) {
					ret = color(from(local));
					ret[cache] = local;
					return ret;
				} else {
					return color(local);
				}
			};

			// Makes red() green() blue() alpha() hue() saturation() lightness()
			each(props, function (key, prop) {

				// Alpha is included in more than one space
				if (color.fn[key]) {
					return;
				}
				color.fn[key] = function (value) {
					var vtype = jQuery.type(value),
					    fn = key === "alpha" ? this._hsla ? "hsla" : "rgba" : spaceName,
					    local = this[fn](),
					    cur = local[prop.idx],
					    match;

					if (vtype === "undefined") {
						return cur;
					}

					if (vtype === "function") {
						value = value.call(this, cur);
						vtype = jQuery.type(value);
					}
					if (value == null && prop.empty) {
						return this;
					}
					if (vtype === "string") {
						match = rplusequals.exec(value);
						if (match) {
							value = cur + parseFloat(match[2]) * (match[1] === "+" ? 1 : -1);
						}
					}
					local[prop.idx] = value;
					return this[fn](local);
				};
			});
		});

		// Add cssHook and .fx.step function for each named hook.
		// accept a space separated string of properties
		color.hook = function (hook) {
			var hooks = hook.split(" ");
			each(hooks, function (i, hook) {
				jQuery.cssHooks[hook] = {
					set: function set(elem, value) {
						var parsed,
						    curElem,
						    backgroundColor = "";

						if (value !== "transparent" && (jQuery.type(value) !== "string" || (parsed = stringParse(value)))) {
							value = color(parsed || value);
							if (!support.rgba && value._rgba[3] !== 1) {
								curElem = hook === "backgroundColor" ? elem.parentNode : elem;
								while ((backgroundColor === "" || backgroundColor === "transparent") && curElem && curElem.style) {
									try {
										backgroundColor = jQuery.css(curElem, "backgroundColor");
										curElem = curElem.parentNode;
									} catch (e) {}
								}

								value = value.blend(backgroundColor && backgroundColor !== "transparent" ? backgroundColor : "_default");
							}

							value = value.toRgbaString();
						}
						try {
							elem.style[hook] = value;
						} catch (e) {

							// Wrapped to prevent IE from throwing errors on "invalid" values like
							// 'auto' or 'inherit'
						}
					}
				};
				jQuery.fx.step[hook] = function (fx) {
					if (!fx.colorInit) {
						fx.start = color(fx.elem, hook);
						fx.end = color(fx.end);
						fx.colorInit = true;
					}
					jQuery.cssHooks[hook].set(fx.elem, fx.start.transition(fx.end, fx.pos));
				};
			});
		};

		color.hook(stepHooks);

		jQuery.cssHooks.borderColor = {
			expand: function expand(value) {
				var expanded = {};

				each(["Top", "Right", "Bottom", "Left"], function (i, part) {
					expanded["border" + part + "Color"] = value;
				});
				return expanded;
			}
		};

		// Basic color names only.
		// Usage of any of the other color names requires adding yourself or including
		// jquery.color.svg-names.js.
		colors = jQuery.Color.names = {

			// 4.1. Basic color keywords
			aqua: "#00ffff",
			black: "#000000",
			blue: "#0000ff",
			fuchsia: "#ff00ff",
			gray: "#808080",
			green: "#008000",
			lime: "#00ff00",
			maroon: "#800000",
			navy: "#000080",
			olive: "#808000",
			purple: "#800080",
			red: "#ff0000",
			silver: "#c0c0c0",
			teal: "#008080",
			white: "#ffffff",
			yellow: "#ffff00",

			// 4.2.3. "transparent" color keyword
			transparent: [null, null, null, 0],

			_default: "#ffffff"
		};
	})(jQuery);

	/******************************************************************************/
	/****************************** CLASS ANIMATIONS ******************************/
	/******************************************************************************/
	(function () {

		var classAnimationActions = ["add", "remove", "toggle"],
		    shorthandStyles = {
			border: 1,
			borderBottom: 1,
			borderColor: 1,
			borderLeft: 1,
			borderRight: 1,
			borderTop: 1,
			borderWidth: 1,
			margin: 1,
			padding: 1
		};

		$.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function (_, prop) {
			$.fx.step[prop] = function (fx) {
				if (fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr) {
					jQuery.style(fx.elem, prop, fx.end);
					fx.setAttr = true;
				}
			};
		});

		function getElementStyles(elem) {
			var key,
			    len,
			    style = elem.ownerDocument.defaultView ? elem.ownerDocument.defaultView.getComputedStyle(elem, null) : elem.currentStyle,
			    styles = {};

			if (style && style.length && style[0] && style[style[0]]) {
				len = style.length;
				while (len--) {
					key = style[len];
					if (typeof style[key] === "string") {
						styles[$.camelCase(key)] = style[key];
					}
				}

				// Support: Opera, IE <9
			} else {
				for (key in style) {
					if (typeof style[key] === "string") {
						styles[key] = style[key];
					}
				}
			}

			return styles;
		}

		function styleDifference(oldStyle, newStyle) {
			var diff = {},
			    name,
			    value;

			for (name in newStyle) {
				value = newStyle[name];
				if (oldStyle[name] !== value) {
					if (!shorthandStyles[name]) {
						if ($.fx.step[name] || !isNaN(parseFloat(value))) {
							diff[name] = value;
						}
					}
				}
			}

			return diff;
		}

		// Support: jQuery <1.8
		if (!$.fn.addBack) {
			$.fn.addBack = function (selector) {
				return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));
			};
		}

		$.effects.animateClass = function (value, duration, easing, callback) {
			var o = $.speed(duration, easing, callback);

			return this.queue(function () {
				var animated = $(this),
				    baseClass = animated.attr("class") || "",
				    applyClassChange,
				    allAnimations = o.children ? animated.find("*").addBack() : animated;

				// Map the animated objects to store the original styles.
				allAnimations = allAnimations.map(function () {
					var el = $(this);
					return {
						el: el,
						start: getElementStyles(this)
					};
				});

				// Apply class change
				applyClassChange = function applyClassChange() {
					$.each(classAnimationActions, function (i, action) {
						if (value[action]) {
							animated[action + "Class"](value[action]);
						}
					});
				};
				applyClassChange();

				// Map all animated objects again - calculate new styles and diff
				allAnimations = allAnimations.map(function () {
					this.end = getElementStyles(this.el[0]);
					this.diff = styleDifference(this.start, this.end);
					return this;
				});

				// Apply original class
				animated.attr("class", baseClass);

				// Map all animated objects again - this time collecting a promise
				allAnimations = allAnimations.map(function () {
					var styleInfo = this,
					    dfd = $.Deferred(),
					    opts = $.extend({}, o, {
						queue: false,
						complete: function complete() {
							dfd.resolve(styleInfo);
						}
					});

					this.el.animate(this.diff, opts);
					return dfd.promise();
				});

				// Once all animations have completed:
				$.when.apply($, allAnimations.get()).done(function () {

					// Set the final class
					applyClassChange();

					// For each animated element,
					// clear all css properties that were animated
					$.each(arguments, function () {
						var el = this.el;
						$.each(this.diff, function (key) {
							el.css(key, "");
						});
					});

					// This is guarnteed to be there if you use jQuery.speed()
					// it also handles dequeuing the next anim...
					o.complete.call(animated[0]);
				});
			});
		};

		$.fn.extend({
			addClass: function (orig) {
				return function (classNames, speed, easing, callback) {
					return speed ? $.effects.animateClass.call(this, { add: classNames }, speed, easing, callback) : orig.apply(this, arguments);
				};
			}($.fn.addClass),

			removeClass: function (orig) {
				return function (classNames, speed, easing, callback) {
					return arguments.length > 1 ? $.effects.animateClass.call(this, { remove: classNames }, speed, easing, callback) : orig.apply(this, arguments);
				};
			}($.fn.removeClass),

			toggleClass: function (orig) {
				return function (classNames, force, speed, easing, callback) {
					if (typeof force === "boolean" || force === undefined) {
						if (!speed) {

							// Without speed parameter
							return orig.apply(this, arguments);
						} else {
							return $.effects.animateClass.call(this, force ? { add: classNames } : { remove: classNames }, speed, easing, callback);
						}
					} else {

						// Without force parameter
						return $.effects.animateClass.call(this, { toggle: classNames }, force, speed, easing);
					}
				};
			}($.fn.toggleClass),

			switchClass: function switchClass(remove, add, speed, easing, callback) {
				return $.effects.animateClass.call(this, {
					add: add,
					remove: remove
				}, speed, easing, callback);
			}
		});
	})();

	/******************************************************************************/
	/*********************************** EFFECTS **********************************/
	/******************************************************************************/

	(function () {

		if ($.expr && $.expr.filters && $.expr.filters.animated) {
			$.expr.filters.animated = function (orig) {
				return function (elem) {
					return !!$(elem).data(dataSpaceAnimated) || orig(elem);
				};
			}($.expr.filters.animated);
		}

		if ($.uiBackCompat !== false) {
			$.extend($.effects, {

				// Saves a set of properties in a data storage
				save: function save(element, set) {
					var i = 0,
					    length = set.length;
					for (; i < length; i++) {
						if (set[i] !== null) {
							element.data(dataSpace + set[i], element[0].style[set[i]]);
						}
					}
				},

				// Restores a set of previously saved properties from a data storage
				restore: function restore(element, set) {
					var val,
					    i = 0,
					    length = set.length;
					for (; i < length; i++) {
						if (set[i] !== null) {
							val = element.data(dataSpace + set[i]);
							element.css(set[i], val);
						}
					}
				},

				setMode: function setMode(el, mode) {
					if (mode === "toggle") {
						mode = el.is(":hidden") ? "show" : "hide";
					}
					return mode;
				},

				// Wraps the element around a wrapper that copies position properties
				createWrapper: function createWrapper(element) {

					// If the element is already wrapped, return it
					if (element.parent().is(".ui-effects-wrapper")) {
						return element.parent();
					}

					// Wrap the element
					var props = {
						width: element.outerWidth(true),
						height: element.outerHeight(true),
						"float": element.css("float")
					},
					    wrapper = $("<div></div>").addClass("ui-effects-wrapper").css({
						fontSize: "100%",
						background: "transparent",
						border: "none",
						margin: 0,
						padding: 0
					}),


					// Store the size in case width/height are defined in % - Fixes #5245
					size = {
						width: element.width(),
						height: element.height()
					},
					    active = document.activeElement;

					// Support: Firefox
					// Firefox incorrectly exposes anonymous content
					// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
					try {
						active.id;
					} catch (e) {
						active = document.body;
					}

					element.wrap(wrapper);

					// Fixes #7595 - Elements lose focus when wrapped.
					if (element[0] === active || $.contains(element[0], active)) {
						$(active).trigger("focus");
					}

					// Hotfix for jQuery 1.4 since some change in wrap() seems to actually
					// lose the reference to the wrapped element
					wrapper = element.parent();

					// Transfer positioning properties to the wrapper
					if (element.css("position") === "static") {
						wrapper.css({ position: "relative" });
						element.css({ position: "relative" });
					} else {
						$.extend(props, {
							position: element.css("position"),
							zIndex: element.css("z-index")
						});
						$.each(["top", "left", "bottom", "right"], function (i, pos) {
							props[pos] = element.css(pos);
							if (isNaN(parseInt(props[pos], 10))) {
								props[pos] = "auto";
							}
						});
						element.css({
							position: "relative",
							top: 0,
							left: 0,
							right: "auto",
							bottom: "auto"
						});
					}
					element.css(size);

					return wrapper.css(props).show();
				},

				removeWrapper: function removeWrapper(element) {
					var active = document.activeElement;

					if (element.parent().is(".ui-effects-wrapper")) {
						element.parent().replaceWith(element);

						// Fixes #7595 - Elements lose focus when wrapped.
						if (element[0] === active || $.contains(element[0], active)) {
							$(active).trigger("focus");
						}
					}

					return element;
				}
			});
		}

		$.extend($.effects, {
			version: "1.12.1",

			define: function define(name, mode, effect) {
				if (!effect) {
					effect = mode;
					mode = "effect";
				}

				$.effects.effect[name] = effect;
				$.effects.effect[name].mode = mode;

				return effect;
			},

			scaledDimensions: function scaledDimensions(element, percent, direction) {
				if (percent === 0) {
					return {
						height: 0,
						width: 0,
						outerHeight: 0,
						outerWidth: 0
					};
				}

				var x = direction !== "horizontal" ? (percent || 100) / 100 : 1,
				    y = direction !== "vertical" ? (percent || 100) / 100 : 1;

				return {
					height: element.height() * y,
					width: element.width() * x,
					outerHeight: element.outerHeight() * y,
					outerWidth: element.outerWidth() * x
				};
			},

			clipToBox: function clipToBox(animation) {
				return {
					width: animation.clip.right - animation.clip.left,
					height: animation.clip.bottom - animation.clip.top,
					left: animation.clip.left,
					top: animation.clip.top
				};
			},

			// Injects recently queued functions to be first in line (after "inprogress")
			unshift: function unshift(element, queueLength, count) {
				var queue = element.queue();

				if (queueLength > 1) {
					queue.splice.apply(queue, [1, 0].concat(queue.splice(queueLength, count)));
				}
				element.dequeue();
			},

			saveStyle: function saveStyle(element) {
				element.data(dataSpaceStyle, element[0].style.cssText);
			},

			restoreStyle: function restoreStyle(element) {
				element[0].style.cssText = element.data(dataSpaceStyle) || "";
				element.removeData(dataSpaceStyle);
			},

			mode: function mode(element, _mode) {
				var hidden = element.is(":hidden");

				if (_mode === "toggle") {
					_mode = hidden ? "show" : "hide";
				}
				if (hidden ? _mode === "hide" : _mode === "show") {
					_mode = "none";
				}
				return _mode;
			},

			// Translates a [top,left] array into a baseline value
			getBaseline: function getBaseline(origin, original) {
				var y, x;

				switch (origin[0]) {
					case "top":
						y = 0;
						break;
					case "middle":
						y = 0.5;
						break;
					case "bottom":
						y = 1;
						break;
					default:
						y = origin[0] / original.height;
				}

				switch (origin[1]) {
					case "left":
						x = 0;
						break;
					case "center":
						x = 0.5;
						break;
					case "right":
						x = 1;
						break;
					default:
						x = origin[1] / original.width;
				}

				return {
					x: x,
					y: y
				};
			},

			// Creates a placeholder element so that the original element can be made absolute
			createPlaceholder: function createPlaceholder(element) {
				var placeholder,
				    cssPosition = element.css("position"),
				    position = element.position();

				// Lock in margins first to account for form elements, which
				// will change margin if you explicitly set height
				// see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380
				// Support: Safari
				element.css({
					marginTop: element.css("marginTop"),
					marginBottom: element.css("marginBottom"),
					marginLeft: element.css("marginLeft"),
					marginRight: element.css("marginRight")
				}).outerWidth(element.outerWidth()).outerHeight(element.outerHeight());

				if (/^(static|relative)/.test(cssPosition)) {
					cssPosition = "absolute";

					placeholder = $("<" + element[0].nodeName + ">").insertAfter(element).css({

						// Convert inline to inline block to account for inline elements
						// that turn to inline block based on content (like img)
						display: /^(inline|ruby)/.test(element.css("display")) ? "inline-block" : "block",
						visibility: "hidden",

						// Margins need to be set to account for margin collapse
						marginTop: element.css("marginTop"),
						marginBottom: element.css("marginBottom"),
						marginLeft: element.css("marginLeft"),
						marginRight: element.css("marginRight"),
						"float": element.css("float")
					}).outerWidth(element.outerWidth()).outerHeight(element.outerHeight()).addClass("ui-effects-placeholder");

					element.data(dataSpace + "placeholder", placeholder);
				}

				element.css({
					position: cssPosition,
					left: position.left,
					top: position.top
				});

				return placeholder;
			},

			removePlaceholder: function removePlaceholder(element) {
				var dataKey = dataSpace + "placeholder",
				    placeholder = element.data(dataKey);

				if (placeholder) {
					placeholder.remove();
					element.removeData(dataKey);
				}
			},

			// Removes a placeholder if it exists and restores
			// properties that were modified during placeholder creation
			cleanUp: function cleanUp(element) {
				$.effects.restoreStyle(element);
				$.effects.removePlaceholder(element);
			},

			setTransition: function setTransition(element, list, factor, value) {
				value = value || {};
				$.each(list, function (i, x) {
					var unit = element.cssUnit(x);
					if (unit[0] > 0) {
						value[x] = unit[0] * factor + unit[1];
					}
				});
				return value;
			}
		});

		// Return an effect options object for the given parameters:
		function _normalizeArguments(effect, options, speed, callback) {

			// Allow passing all options as the first parameter
			if ($.isPlainObject(effect)) {
				options = effect;
				effect = effect.effect;
			}

			// Convert to an object
			effect = { effect: effect };

			// Catch (effect, null, ...)
			if (options == null) {
				options = {};
			}

			// Catch (effect, callback)
			if ($.isFunction(options)) {
				callback = options;
				speed = null;
				options = {};
			}

			// Catch (effect, speed, ?)
			if (typeof options === "number" || $.fx.speeds[options]) {
				callback = speed;
				speed = options;
				options = {};
			}

			// Catch (effect, options, callback)
			if ($.isFunction(speed)) {
				callback = speed;
				speed = null;
			}

			// Add options to effect
			if (options) {
				$.extend(effect, options);
			}

			speed = speed || options.duration;
			effect.duration = $.fx.off ? 0 : typeof speed === "number" ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default;

			effect.complete = callback || options.complete;

			return effect;
		}

		function standardAnimationOption(option) {

			// Valid standard speeds (nothing, number, named speed)
			if (!option || typeof option === "number" || $.fx.speeds[option]) {
				return true;
			}

			// Invalid strings - treat as "normal" speed
			if (typeof option === "string" && !$.effects.effect[option]) {
				return true;
			}

			// Complete callback
			if ($.isFunction(option)) {
				return true;
			}

			// Options hash (but not naming an effect)
			if ((typeof option === "undefined" ? "undefined" : _typeof(option)) === "object" && !option.effect) {
				return true;
			}

			// Didn't match any standard API
			return false;
		}

		$.fn.extend({
			effect: function effect() /* effect, options, speed, callback */{
				var args = _normalizeArguments.apply(this, arguments),
				    effectMethod = $.effects.effect[args.effect],
				    defaultMode = effectMethod.mode,
				    queue = args.queue,
				    queueName = queue || "fx",
				    complete = args.complete,
				    mode = args.mode,
				    modes = [],
				    prefilter = function prefilter(next) {
					var el = $(this),
					    normalizedMode = $.effects.mode(el, mode) || defaultMode;

					// Sentinel for duck-punching the :animated psuedo-selector
					el.data(dataSpaceAnimated, true);

					// Save effect mode for later use,
					// we can't just call $.effects.mode again later,
					// as the .show() below destroys the initial state
					modes.push(normalizedMode);

					// See $.uiBackCompat inside of run() for removal of defaultMode in 1.13
					if (defaultMode && (normalizedMode === "show" || normalizedMode === defaultMode && normalizedMode === "hide")) {
						el.show();
					}

					if (!defaultMode || normalizedMode !== "none") {
						$.effects.saveStyle(el);
					}

					if ($.isFunction(next)) {
						next();
					}
				};

				if ($.fx.off || !effectMethod) {

					// Delegate to the original method (e.g., .show()) if possible
					if (mode) {
						return this[mode](args.duration, complete);
					} else {
						return this.each(function () {
							if (complete) {
								complete.call(this);
							}
						});
					}
				}

				function run(next) {
					var elem = $(this);

					function cleanup() {
						elem.removeData(dataSpaceAnimated);

						$.effects.cleanUp(elem);

						if (args.mode === "hide") {
							elem.hide();
						}

						done();
					}

					function done() {
						if ($.isFunction(complete)) {
							complete.call(elem[0]);
						}

						if ($.isFunction(next)) {
							next();
						}
					}

					// Override mode option on a per element basis,
					// as toggle can be either show or hide depending on element state
					args.mode = modes.shift();

					if ($.uiBackCompat !== false && !defaultMode) {
						if (elem.is(":hidden") ? mode === "hide" : mode === "show") {

							// Call the core method to track "olddisplay" properly
							elem[mode]();
							done();
						} else {
							effectMethod.call(elem[0], args, done);
						}
					} else {
						if (args.mode === "none") {

							// Call the core method to track "olddisplay" properly
							elem[mode]();
							done();
						} else {
							effectMethod.call(elem[0], args, cleanup);
						}
					}
				}

				// Run prefilter on all elements first to ensure that
				// any showing or hiding happens before placeholder creation,
				// which ensures that any layout changes are correctly captured.
				return queue === false ? this.each(prefilter).each(run) : this.queue(queueName, prefilter).queue(queueName, run);
			},

			show: function (orig) {
				return function (option) {
					if (standardAnimationOption(option)) {
						return orig.apply(this, arguments);
					} else {
						var args = _normalizeArguments.apply(this, arguments);
						args.mode = "show";
						return this.effect.call(this, args);
					}
				};
			}($.fn.show),

			hide: function (orig) {
				return function (option) {
					if (standardAnimationOption(option)) {
						return orig.apply(this, arguments);
					} else {
						var args = _normalizeArguments.apply(this, arguments);
						args.mode = "hide";
						return this.effect.call(this, args);
					}
				};
			}($.fn.hide),

			toggle: function (orig) {
				return function (option) {
					if (standardAnimationOption(option) || typeof option === "boolean") {
						return orig.apply(this, arguments);
					} else {
						var args = _normalizeArguments.apply(this, arguments);
						args.mode = "toggle";
						return this.effect.call(this, args);
					}
				};
			}($.fn.toggle),

			cssUnit: function cssUnit(key) {
				var style = this.css(key),
				    val = [];

				$.each(["em", "px", "%", "pt"], function (i, unit) {
					if (style.indexOf(unit) > 0) {
						val = [parseFloat(style), unit];
					}
				});
				return val;
			},

			cssClip: function cssClip(clipObj) {
				if (clipObj) {
					return this.css("clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " + clipObj.bottom + "px " + clipObj.left + "px)");
				}
				return parseClip(this.css("clip"), this);
			},

			transfer: function transfer(options, done) {
				var element = $(this),
				    target = $(options.to),
				    targetFixed = target.css("position") === "fixed",
				    body = $("body"),
				    fixTop = targetFixed ? body.scrollTop() : 0,
				    fixLeft = targetFixed ? body.scrollLeft() : 0,
				    endPosition = target.offset(),
				    animation = {
					top: endPosition.top - fixTop,
					left: endPosition.left - fixLeft,
					height: target.innerHeight(),
					width: target.innerWidth()
				},
				    startPosition = element.offset(),
				    transfer = $("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(options.className).css({
					top: startPosition.top - fixTop,
					left: startPosition.left - fixLeft,
					height: element.innerHeight(),
					width: element.innerWidth(),
					position: targetFixed ? "fixed" : "absolute"
				}).animate(animation, options.duration, options.easing, function () {
					transfer.remove();
					if ($.isFunction(done)) {
						done();
					}
				});
			}
		});

		function parseClip(str, element) {
			var outerWidth = element.outerWidth(),
			    outerHeight = element.outerHeight(),
			    clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,
			    values = clipRegex.exec(str) || ["", 0, outerWidth, outerHeight, 0];

			return {
				top: parseFloat(values[1]) || 0,
				right: values[2] === "auto" ? outerWidth : parseFloat(values[2]),
				bottom: values[3] === "auto" ? outerHeight : parseFloat(values[3]),
				left: parseFloat(values[4]) || 0
			};
		}

		$.fx.step.clip = function (fx) {
			if (!fx.clipInit) {
				fx.start = $(fx.elem).cssClip();
				if (typeof fx.end === "string") {
					fx.end = parseClip(fx.end, fx.elem);
				}
				fx.clipInit = true;
			}

			$(fx.elem).cssClip({
				top: fx.pos * (fx.end.top - fx.start.top) + fx.start.top,
				right: fx.pos * (fx.end.right - fx.start.right) + fx.start.right,
				bottom: fx.pos * (fx.end.bottom - fx.start.bottom) + fx.start.bottom,
				left: fx.pos * (fx.end.left - fx.start.left) + fx.start.left
			});
		};
	})();

	/******************************************************************************/
	/*********************************** EASING ***********************************/
	/******************************************************************************/

	(function () {

		// Based on easing equations from Robert Penner (http://www.robertpenner.com/easing)

		var baseEasings = {};

		$.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function (i, name) {
			baseEasings[name] = function (p) {
				return Math.pow(p, i + 2);
			};
		});

		$.extend(baseEasings, {
			Sine: function Sine(p) {
				return 1 - Math.cos(p * Math.PI / 2);
			},
			Circ: function Circ(p) {
				return 1 - Math.sqrt(1 - p * p);
			},
			Elastic: function Elastic(p) {
				return p === 0 || p === 1 ? p : -Math.pow(2, 8 * (p - 1)) * Math.sin(((p - 1) * 80 - 7.5) * Math.PI / 15);
			},
			Back: function Back(p) {
				return p * p * (3 * p - 2);
			},
			Bounce: function Bounce(p) {
				var pow2,
				    bounce = 4;

				while (p < ((pow2 = Math.pow(2, --bounce)) - 1) / 11) {}
				return 1 / Math.pow(4, 3 - bounce) - 7.5625 * Math.pow((pow2 * 3 - 2) / 22 - p, 2);
			}
		});

		$.each(baseEasings, function (name, easeIn) {
			$.easing["easeIn" + name] = easeIn;
			$.easing["easeOut" + name] = function (p) {
				return 1 - easeIn(1 - p);
			};
			$.easing["easeInOut" + name] = function (p) {
				return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn(p * -2 + 2) / 2;
			};
		});
	})();

	var effect = $.effects;

	/*!
  * jQuery UI Effects Blind 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Blind Effect
	//>>group: Effects
	//>>description: Blinds the element.
	//>>docs: http://api.jqueryui.com/blind-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectBlind = $.effects.define("blind", "hide", function (options, done) {
		var map = {
			up: ["bottom", "top"],
			vertical: ["bottom", "top"],
			down: ["top", "bottom"],
			left: ["right", "left"],
			horizontal: ["right", "left"],
			right: ["left", "right"]
		},
		    element = $(this),
		    direction = options.direction || "up",
		    start = element.cssClip(),
		    animate = { clip: $.extend({}, start) },
		    placeholder = $.effects.createPlaceholder(element);

		animate.clip[map[direction][0]] = animate.clip[map[direction][1]];

		if (options.mode === "show") {
			element.cssClip(animate.clip);
			if (placeholder) {
				placeholder.css($.effects.clipToBox(animate));
			}

			animate.clip = start;
		}

		if (placeholder) {
			placeholder.animate($.effects.clipToBox(animate), options.duration, options.easing);
		}

		element.animate(animate, {
			queue: false,
			duration: options.duration,
			easing: options.easing,
			complete: done
		});
	});

	/*!
  * jQuery UI Effects Bounce 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Bounce Effect
	//>>group: Effects
	//>>description: Bounces an element horizontally or vertically n times.
	//>>docs: http://api.jqueryui.com/bounce-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectBounce = $.effects.define("bounce", function (options, done) {
		var upAnim,
		    downAnim,
		    refValue,
		    element = $(this),


		// Defaults:
		mode = options.mode,
		    hide = mode === "hide",
		    show = mode === "show",
		    direction = options.direction || "up",
		    distance = options.distance,
		    times = options.times || 5,


		// Number of internal animations
		anims = times * 2 + (show || hide ? 1 : 0),
		    speed = options.duration / anims,
		    easing = options.easing,


		// Utility:
		ref = direction === "up" || direction === "down" ? "top" : "left",
		    motion = direction === "up" || direction === "left",
		    i = 0,
		    queuelen = element.queue().length;

		$.effects.createPlaceholder(element);

		refValue = element.css(ref);

		// Default distance for the BIGGEST bounce is the outer Distance / 3
		if (!distance) {
			distance = element[ref === "top" ? "outerHeight" : "outerWidth"]() / 3;
		}

		if (show) {
			downAnim = { opacity: 1 };
			downAnim[ref] = refValue;

			// If we are showing, force opacity 0 and set the initial position
			// then do the "first" animation
			element.css("opacity", 0).css(ref, motion ? -distance * 2 : distance * 2).animate(downAnim, speed, easing);
		}

		// Start at the smallest distance if we are hiding
		if (hide) {
			distance = distance / Math.pow(2, times - 1);
		}

		downAnim = {};
		downAnim[ref] = refValue;

		// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
		for (; i < times; i++) {
			upAnim = {};
			upAnim[ref] = (motion ? "-=" : "+=") + distance;

			element.animate(upAnim, speed, easing).animate(downAnim, speed, easing);

			distance = hide ? distance * 2 : distance / 2;
		}

		// Last Bounce when Hiding
		if (hide) {
			upAnim = { opacity: 0 };
			upAnim[ref] = (motion ? "-=" : "+=") + distance;

			element.animate(upAnim, speed, easing);
		}

		element.queue(done);

		$.effects.unshift(element, queuelen, anims + 1);
	});

	/*!
  * jQuery UI Effects Clip 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Clip Effect
	//>>group: Effects
	//>>description: Clips the element on and off like an old TV.
	//>>docs: http://api.jqueryui.com/clip-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectClip = $.effects.define("clip", "hide", function (options, done) {
		var start,
		    animate = {},
		    element = $(this),
		    direction = options.direction || "vertical",
		    both = direction === "both",
		    horizontal = both || direction === "horizontal",
		    vertical = both || direction === "vertical";

		start = element.cssClip();
		animate.clip = {
			top: vertical ? (start.bottom - start.top) / 2 : start.top,
			right: horizontal ? (start.right - start.left) / 2 : start.right,
			bottom: vertical ? (start.bottom - start.top) / 2 : start.bottom,
			left: horizontal ? (start.right - start.left) / 2 : start.left
		};

		$.effects.createPlaceholder(element);

		if (options.mode === "show") {
			element.cssClip(animate.clip);
			animate.clip = start;
		}

		element.animate(animate, {
			queue: false,
			duration: options.duration,
			easing: options.easing,
			complete: done
		});
	});

	/*!
  * jQuery UI Effects Drop 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Drop Effect
	//>>group: Effects
	//>>description: Moves an element in one direction and hides it at the same time.
	//>>docs: http://api.jqueryui.com/drop-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectDrop = $.effects.define("drop", "hide", function (options, done) {

		var distance,
		    element = $(this),
		    mode = options.mode,
		    show = mode === "show",
		    direction = options.direction || "left",
		    ref = direction === "up" || direction === "down" ? "top" : "left",
		    motion = direction === "up" || direction === "left" ? "-=" : "+=",
		    oppositeMotion = motion === "+=" ? "-=" : "+=",
		    animation = {
			opacity: 0
		};

		$.effects.createPlaceholder(element);

		distance = options.distance || element[ref === "top" ? "outerHeight" : "outerWidth"](true) / 2;

		animation[ref] = motion + distance;

		if (show) {
			element.css(animation);

			animation[ref] = oppositeMotion + distance;
			animation.opacity = 1;
		}

		// Animate
		element.animate(animation, {
			queue: false,
			duration: options.duration,
			easing: options.easing,
			complete: done
		});
	});

	/*!
  * jQuery UI Effects Explode 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Explode Effect
	//>>group: Effects
	// jscs:disable maximumLineLength
	//>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.
	// jscs:enable maximumLineLength
	//>>docs: http://api.jqueryui.com/explode-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectExplode = $.effects.define("explode", "hide", function (options, done) {

		var i,
		    j,
		    left,
		    top,
		    mx,
		    my,
		    rows = options.pieces ? Math.round(Math.sqrt(options.pieces)) : 3,
		    cells = rows,
		    element = $(this),
		    mode = options.mode,
		    show = mode === "show",


		// Show and then visibility:hidden the element before calculating offset
		offset = element.show().css("visibility", "hidden").offset(),


		// Width and height of a piece
		width = Math.ceil(element.outerWidth() / cells),
		    height = Math.ceil(element.outerHeight() / rows),
		    pieces = [];

		// Children animate complete:
		function childComplete() {
			pieces.push(this);
			if (pieces.length === rows * cells) {
				animComplete();
			}
		}

		// Clone the element for each row and cell.
		for (i = 0; i < rows; i++) {
			// ===>
			top = offset.top + i * height;
			my = i - (rows - 1) / 2;

			for (j = 0; j < cells; j++) {
				// |||
				left = offset.left + j * width;
				mx = j - (cells - 1) / 2;

				// Create a clone of the now hidden main element that will be absolute positioned
				// within a wrapper div off the -left and -top equal to size of our pieces
				element.clone().appendTo("body").wrap("<div></div>").css({
					position: "absolute",
					visibility: "visible",
					left: -j * width,
					top: -i * height
				})

				// Select the wrapper - make it overflow: hidden and absolute positioned based on
				// where the original was located +left and +top equal to the size of pieces
				.parent().addClass("ui-effects-explode").css({
					position: "absolute",
					overflow: "hidden",
					width: width,
					height: height,
					left: left + (show ? mx * width : 0),
					top: top + (show ? my * height : 0),
					opacity: show ? 0 : 1
				}).animate({
					left: left + (show ? 0 : mx * width),
					top: top + (show ? 0 : my * height),
					opacity: show ? 1 : 0
				}, options.duration || 500, options.easing, childComplete);
			}
		}

		function animComplete() {
			element.css({
				visibility: "visible"
			});
			$(pieces).remove();
			done();
		}
	});

	/*!
  * jQuery UI Effects Fade 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Fade Effect
	//>>group: Effects
	//>>description: Fades the element.
	//>>docs: http://api.jqueryui.com/fade-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectFade = $.effects.define("fade", "toggle", function (options, done) {
		var show = options.mode === "show";

		$(this).css("opacity", show ? 0 : 1).animate({
			opacity: show ? 1 : 0
		}, {
			queue: false,
			duration: options.duration,
			easing: options.easing,
			complete: done
		});
	});

	/*!
  * jQuery UI Effects Fold 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Fold Effect
	//>>group: Effects
	//>>description: Folds an element first horizontally and then vertically.
	//>>docs: http://api.jqueryui.com/fold-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectFold = $.effects.define("fold", "hide", function (options, done) {

		// Create element
		var element = $(this),
		    mode = options.mode,
		    show = mode === "show",
		    hide = mode === "hide",
		    size = options.size || 15,
		    percent = /([0-9]+)%/.exec(size),
		    horizFirst = !!options.horizFirst,
		    ref = horizFirst ? ["right", "bottom"] : ["bottom", "right"],
		    duration = options.duration / 2,
		    placeholder = $.effects.createPlaceholder(element),
		    start = element.cssClip(),
		    animation1 = { clip: $.extend({}, start) },
		    animation2 = { clip: $.extend({}, start) },
		    distance = [start[ref[0]], start[ref[1]]],
		    queuelen = element.queue().length;

		if (percent) {
			size = parseInt(percent[1], 10) / 100 * distance[hide ? 0 : 1];
		}
		animation1.clip[ref[0]] = size;
		animation2.clip[ref[0]] = size;
		animation2.clip[ref[1]] = 0;

		if (show) {
			element.cssClip(animation2.clip);
			if (placeholder) {
				placeholder.css($.effects.clipToBox(animation2));
			}

			animation2.clip = start;
		}

		// Animate
		element.queue(function (next) {
			if (placeholder) {
				placeholder.animate($.effects.clipToBox(animation1), duration, options.easing).animate($.effects.clipToBox(animation2), duration, options.easing);
			}

			next();
		}).animate(animation1, duration, options.easing).animate(animation2, duration, options.easing).queue(done);

		$.effects.unshift(element, queuelen, 4);
	});

	/*!
  * jQuery UI Effects Highlight 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Highlight Effect
	//>>group: Effects
	//>>description: Highlights the background of an element in a defined color for a custom duration.
	//>>docs: http://api.jqueryui.com/highlight-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectHighlight = $.effects.define("highlight", "show", function (options, done) {
		var element = $(this),
		    animation = {
			backgroundColor: element.css("backgroundColor")
		};

		if (options.mode === "hide") {
			animation.opacity = 0;
		}

		$.effects.saveStyle(element);

		element.css({
			backgroundImage: "none",
			backgroundColor: options.color || "#ffff99"
		}).animate(animation, {
			queue: false,
			duration: options.duration,
			easing: options.easing,
			complete: done
		});
	});

	/*!
  * jQuery UI Effects Size 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Size Effect
	//>>group: Effects
	//>>description: Resize an element to a specified width and height.
	//>>docs: http://api.jqueryui.com/size-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectSize = $.effects.define("size", function (options, done) {

		// Create element
		var baseline,
		    factor,
		    temp,
		    element = $(this),


		// Copy for children
		cProps = ["fontSize"],
		    vProps = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"],
		    hProps = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"],


		// Set options
		mode = options.mode,
		    restore = mode !== "effect",
		    scale = options.scale || "both",
		    origin = options.origin || ["middle", "center"],
		    position = element.css("position"),
		    pos = element.position(),
		    original = $.effects.scaledDimensions(element),
		    from = options.from || original,
		    to = options.to || $.effects.scaledDimensions(element, 0);

		$.effects.createPlaceholder(element);

		if (mode === "show") {
			temp = from;
			from = to;
			to = temp;
		}

		// Set scaling factor
		factor = {
			from: {
				y: from.height / original.height,
				x: from.width / original.width
			},
			to: {
				y: to.height / original.height,
				x: to.width / original.width
			}
		};

		// Scale the css box
		if (scale === "box" || scale === "both") {

			// Vertical props scaling
			if (factor.from.y !== factor.to.y) {
				from = $.effects.setTransition(element, vProps, factor.from.y, from);
				to = $.effects.setTransition(element, vProps, factor.to.y, to);
			}

			// Horizontal props scaling
			if (factor.from.x !== factor.to.x) {
				from = $.effects.setTransition(element, hProps, factor.from.x, from);
				to = $.effects.setTransition(element, hProps, factor.to.x, to);
			}
		}

		// Scale the content
		if (scale === "content" || scale === "both") {

			// Vertical props scaling
			if (factor.from.y !== factor.to.y) {
				from = $.effects.setTransition(element, cProps, factor.from.y, from);
				to = $.effects.setTransition(element, cProps, factor.to.y, to);
			}
		}

		// Adjust the position properties based on the provided origin points
		if (origin) {
			baseline = $.effects.getBaseline(origin, original);
			from.top = (original.outerHeight - from.outerHeight) * baseline.y + pos.top;
			from.left = (original.outerWidth - from.outerWidth) * baseline.x + pos.left;
			to.top = (original.outerHeight - to.outerHeight) * baseline.y + pos.top;
			to.left = (original.outerWidth - to.outerWidth) * baseline.x + pos.left;
		}
		element.css(from);

		// Animate the children if desired
		if (scale === "content" || scale === "both") {

			vProps = vProps.concat(["marginTop", "marginBottom"]).concat(cProps);
			hProps = hProps.concat(["marginLeft", "marginRight"]);

			// Only animate children with width attributes specified
			// TODO: is this right? should we include anything with css width specified as well
			element.find("*[width]").each(function () {
				var child = $(this),
				    childOriginal = $.effects.scaledDimensions(child),
				    childFrom = {
					height: childOriginal.height * factor.from.y,
					width: childOriginal.width * factor.from.x,
					outerHeight: childOriginal.outerHeight * factor.from.y,
					outerWidth: childOriginal.outerWidth * factor.from.x
				},
				    childTo = {
					height: childOriginal.height * factor.to.y,
					width: childOriginal.width * factor.to.x,
					outerHeight: childOriginal.height * factor.to.y,
					outerWidth: childOriginal.width * factor.to.x
				};

				// Vertical props scaling
				if (factor.from.y !== factor.to.y) {
					childFrom = $.effects.setTransition(child, vProps, factor.from.y, childFrom);
					childTo = $.effects.setTransition(child, vProps, factor.to.y, childTo);
				}

				// Horizontal props scaling
				if (factor.from.x !== factor.to.x) {
					childFrom = $.effects.setTransition(child, hProps, factor.from.x, childFrom);
					childTo = $.effects.setTransition(child, hProps, factor.to.x, childTo);
				}

				if (restore) {
					$.effects.saveStyle(child);
				}

				// Animate children
				child.css(childFrom);
				child.animate(childTo, options.duration, options.easing, function () {

					// Restore children
					if (restore) {
						$.effects.restoreStyle(child);
					}
				});
			});
		}

		// Animate
		element.animate(to, {
			queue: false,
			duration: options.duration,
			easing: options.easing,
			complete: function complete() {

				var offset = element.offset();

				if (to.opacity === 0) {
					element.css("opacity", from.opacity);
				}

				if (!restore) {
					element.css("position", position === "static" ? "relative" : position).offset(offset);

					// Need to save style here so that automatic style restoration
					// doesn't restore to the original styles from before the animation.
					$.effects.saveStyle(element);
				}

				done();
			}
		});
	});

	/*!
  * jQuery UI Effects Scale 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Scale Effect
	//>>group: Effects
	//>>description: Grows or shrinks an element and its content.
	//>>docs: http://api.jqueryui.com/scale-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectScale = $.effects.define("scale", function (options, done) {

		// Create element
		var el = $(this),
		    mode = options.mode,
		    percent = parseInt(options.percent, 10) || (parseInt(options.percent, 10) === 0 ? 0 : mode !== "effect" ? 0 : 100),
		    newOptions = $.extend(true, {
			from: $.effects.scaledDimensions(el),
			to: $.effects.scaledDimensions(el, percent, options.direction || "both"),
			origin: options.origin || ["middle", "center"]
		}, options);

		// Fade option to support puff
		if (options.fade) {
			newOptions.from.opacity = 1;
			newOptions.to.opacity = 0;
		}

		$.effects.effect.size.call(this, newOptions, done);
	});

	/*!
  * jQuery UI Effects Puff 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Puff Effect
	//>>group: Effects
	//>>description: Creates a puff effect by scaling the element up and hiding it at the same time.
	//>>docs: http://api.jqueryui.com/puff-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectPuff = $.effects.define("puff", "hide", function (options, done) {
		var newOptions = $.extend(true, {}, options, {
			fade: true,
			percent: parseInt(options.percent, 10) || 150
		});

		$.effects.effect.scale.call(this, newOptions, done);
	});

	/*!
  * jQuery UI Effects Pulsate 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Pulsate Effect
	//>>group: Effects
	//>>description: Pulsates an element n times by changing the opacity to zero and back.
	//>>docs: http://api.jqueryui.com/pulsate-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectPulsate = $.effects.define("pulsate", "show", function (options, done) {
		var element = $(this),
		    mode = options.mode,
		    show = mode === "show",
		    hide = mode === "hide",
		    showhide = show || hide,


		// Showing or hiding leaves off the "last" animation
		anims = (options.times || 5) * 2 + (showhide ? 1 : 0),
		    duration = options.duration / anims,
		    animateTo = 0,
		    i = 1,
		    queuelen = element.queue().length;

		if (show || !element.is(":visible")) {
			element.css("opacity", 0).show();
			animateTo = 1;
		}

		// Anims - 1 opacity "toggles"
		for (; i < anims; i++) {
			element.animate({ opacity: animateTo }, duration, options.easing);
			animateTo = 1 - animateTo;
		}

		element.animate({ opacity: animateTo }, duration, options.easing);

		element.queue(done);

		$.effects.unshift(element, queuelen, anims + 1);
	});

	/*!
  * jQuery UI Effects Shake 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Shake Effect
	//>>group: Effects
	//>>description: Shakes an element horizontally or vertically n times.
	//>>docs: http://api.jqueryui.com/shake-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectShake = $.effects.define("shake", function (options, done) {

		var i = 1,
		    element = $(this),
		    direction = options.direction || "left",
		    distance = options.distance || 20,
		    times = options.times || 3,
		    anims = times * 2 + 1,
		    speed = Math.round(options.duration / anims),
		    ref = direction === "up" || direction === "down" ? "top" : "left",
		    positiveMotion = direction === "up" || direction === "left",
		    animation = {},
		    animation1 = {},
		    animation2 = {},
		    queuelen = element.queue().length;

		$.effects.createPlaceholder(element);

		// Animation
		animation[ref] = (positiveMotion ? "-=" : "+=") + distance;
		animation1[ref] = (positiveMotion ? "+=" : "-=") + distance * 2;
		animation2[ref] = (positiveMotion ? "-=" : "+=") + distance * 2;

		// Animate
		element.animate(animation, speed, options.easing);

		// Shakes
		for (; i < times; i++) {
			element.animate(animation1, speed, options.easing).animate(animation2, speed, options.easing);
		}

		element.animate(animation1, speed, options.easing).animate(animation, speed / 2, options.easing).queue(done);

		$.effects.unshift(element, queuelen, anims + 1);
	});

	/*!
  * jQuery UI Effects Slide 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Slide Effect
	//>>group: Effects
	//>>description: Slides an element in and out of the viewport.
	//>>docs: http://api.jqueryui.com/slide-effect/
	//>>demos: http://jqueryui.com/effect/


	var effectsEffectSlide = $.effects.define("slide", "show", function (options, done) {
		var startClip,
		    startRef,
		    element = $(this),
		    map = {
			up: ["bottom", "top"],
			down: ["top", "bottom"],
			left: ["right", "left"],
			right: ["left", "right"]
		},
		    mode = options.mode,
		    direction = options.direction || "left",
		    ref = direction === "up" || direction === "down" ? "top" : "left",
		    positiveMotion = direction === "up" || direction === "left",
		    distance = options.distance || element[ref === "top" ? "outerHeight" : "outerWidth"](true),
		    animation = {};

		$.effects.createPlaceholder(element);

		startClip = element.cssClip();
		startRef = element.position()[ref];

		// Define hide animation
		animation[ref] = (positiveMotion ? -1 : 1) * distance + startRef;
		animation.clip = element.cssClip();
		animation.clip[map[direction][1]] = animation.clip[map[direction][0]];

		// Reverse the animation if we're showing
		if (mode === "show") {
			element.cssClip(animation.clip);
			element.css(ref, animation[ref]);
			animation.clip = startClip;
			animation[ref] = startRef;
		}

		// Actually animate
		element.animate(animation, {
			queue: false,
			duration: options.duration,
			easing: options.easing,
			complete: done
		});
	});

	/*!
  * jQuery UI Effects Transfer 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Transfer Effect
	//>>group: Effects
	//>>description: Displays a transfer effect from one element to another.
	//>>docs: http://api.jqueryui.com/transfer-effect/
	//>>demos: http://jqueryui.com/effect/


	var effect;
	if ($.uiBackCompat !== false) {
		effect = $.effects.define("transfer", function (options, done) {
			$(this).transfer(options, done);
		});
	}
	var effectsEffectTransfer = effect;

	/*!
  * jQuery UI Focusable 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: :focusable Selector
	//>>group: Core
	//>>description: Selects elements which can be focused.
	//>>docs: http://api.jqueryui.com/focusable-selector/


	// Selectors
	$.ui.focusable = function (element, hasTabindex) {
		var map,
		    mapName,
		    img,
		    focusableIfVisible,
		    fieldset,
		    nodeName = element.nodeName.toLowerCase();

		if ("area" === nodeName) {
			map = element.parentNode;
			mapName = map.name;
			if (!element.href || !mapName || map.nodeName.toLowerCase() !== "map") {
				return false;
			}
			img = $("img[usemap='#" + mapName + "']");
			return img.length > 0 && img.is(":visible");
		}

		if (/^(input|select|textarea|button|object)$/.test(nodeName)) {
			focusableIfVisible = !element.disabled;

			if (focusableIfVisible) {

				// Form controls within a disabled fieldset are disabled.
				// However, controls within the fieldset's legend do not get disabled.
				// Since controls generally aren't placed inside legends, we skip
				// this portion of the check.
				fieldset = $(element).closest("fieldset")[0];
				if (fieldset) {
					focusableIfVisible = !fieldset.disabled;
				}
			}
		} else if ("a" === nodeName) {
			focusableIfVisible = element.href || hasTabindex;
		} else {
			focusableIfVisible = hasTabindex;
		}

		return focusableIfVisible && $(element).is(":visible") && visible($(element));
	};

	// Support: IE 8 only
	// IE 8 doesn't resolve inherit to visible/hidden for computed values
	function visible(element) {
		var visibility = element.css("visibility");
		while (visibility === "inherit") {
			element = element.parent();
			visibility = element.css("visibility");
		}
		return visibility !== "hidden";
	}

	$.extend($.expr[":"], {
		focusable: function focusable(element) {
			return $.ui.focusable(element, $.attr(element, "tabindex") != null);
		}
	});

	var focusable = $.ui.focusable;

	// Support: IE8 Only
	// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
	// with a string, so we need to find the proper form.
	var form = $.fn.form = function () {
		return typeof this[0].form === "string" ? this.closest("form") : $(this[0].form);
	};

	/*!
  * jQuery UI Form Reset Mixin 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Form Reset Mixin
	//>>group: Core
	//>>description: Refresh input widgets when their form is reset
	//>>docs: http://api.jqueryui.com/form-reset-mixin/


	var formResetMixin = $.ui.formResetMixin = {
		_formResetHandler: function _formResetHandler() {
			var form = $(this);

			// Wait for the form reset to actually happen before refreshing
			setTimeout(function () {
				var instances = form.data("ui-form-reset-instances");
				$.each(instances, function () {
					this.refresh();
				});
			});
		},

		_bindFormResetHandler: function _bindFormResetHandler() {
			this.form = this.element.form();
			if (!this.form.length) {
				return;
			}

			var instances = this.form.data("ui-form-reset-instances") || [];
			if (!instances.length) {

				// We don't use _on() here because we use a single event handler per form
				this.form.on("reset.ui-form-reset", this._formResetHandler);
			}
			instances.push(this);
			this.form.data("ui-form-reset-instances", instances);
		},

		_unbindFormResetHandler: function _unbindFormResetHandler() {
			if (!this.form.length) {
				return;
			}

			var instances = this.form.data("ui-form-reset-instances");
			instances.splice($.inArray(this, instances), 1);
			if (instances.length) {
				this.form.data("ui-form-reset-instances", instances);
			} else {
				this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset");
			}
		}
	};

	/*!
  * jQuery UI Support for jQuery core 1.7.x 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
  */

	//>>label: jQuery 1.7 Support
	//>>group: Core
	//>>description: Support version 1.7.x of jQuery core


	// Support: jQuery 1.7 only
	// Not a great way to check versions, but since we only support 1.7+ and only
	// need to detect <1.8, this is a simple check that should suffice. Checking
	// for "1.7." would be a bit safer, but the version string is 1.7, not 1.7.0
	// and we'll never reach 1.70.0 (if we do, we certainly won't be supporting
	// 1.7 anymore). See #11197 for why we're not using feature detection.
	if ($.fn.jquery.substring(0, 3) === "1.7") {

		// Setters for .innerWidth(), .innerHeight(), .outerWidth(), .outerHeight()
		// Unlike jQuery Core 1.8+, these only support numeric values to set the
		// dimensions in pixels
		$.each(["Width", "Height"], function (i, name) {
			var side = name === "Width" ? ["Left", "Right"] : ["Top", "Bottom"],
			    type = name.toLowerCase(),
			    orig = {
				innerWidth: $.fn.innerWidth,
				innerHeight: $.fn.innerHeight,
				outerWidth: $.fn.outerWidth,
				outerHeight: $.fn.outerHeight
			};

			function reduce(elem, size, border, margin) {
				$.each(side, function () {
					size -= parseFloat($.css(elem, "padding" + this)) || 0;
					if (border) {
						size -= parseFloat($.css(elem, "border" + this + "Width")) || 0;
					}
					if (margin) {
						size -= parseFloat($.css(elem, "margin" + this)) || 0;
					}
				});
				return size;
			}

			$.fn["inner" + name] = function (size) {
				if (size === undefined) {
					return orig["inner" + name].call(this);
				}

				return this.each(function () {
					$(this).css(type, reduce(this, size) + "px");
				});
			};

			$.fn["outer" + name] = function (size, margin) {
				if (typeof size !== "number") {
					return orig["outer" + name].call(this, size);
				}

				return this.each(function () {
					$(this).css(type, reduce(this, size, true, margin) + "px");
				});
			};
		});

		$.fn.addBack = function (selector) {
			return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));
		};
	}

	;
	/*!
  * jQuery UI Keycode 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Keycode
	//>>group: Core
	//>>description: Provide keycodes as keynames
	//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/


	var keycode = $.ui.keyCode = {
		BACKSPACE: 8,
		COMMA: 188,
		DELETE: 46,
		DOWN: 40,
		END: 35,
		ENTER: 13,
		ESCAPE: 27,
		HOME: 36,
		LEFT: 37,
		PAGE_DOWN: 34,
		PAGE_UP: 33,
		PERIOD: 190,
		RIGHT: 39,
		SPACE: 32,
		TAB: 9,
		UP: 38
	};

	// Internal use only
	var escapeSelector = $.ui.escapeSelector = function () {
		var selectorEscape = /([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;
		return function (selector) {
			return selector.replace(selectorEscape, "\\$1");
		};
	}();

	/*!
  * jQuery UI Labels 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: labels
	//>>group: Core
	//>>description: Find all the labels associated with a given input
	//>>docs: http://api.jqueryui.com/labels/


	var labels = $.fn.labels = function () {
		var ancestor, selector, id, labels, ancestors;

		// Check control.labels first
		if (this[0].labels && this[0].labels.length) {
			return this.pushStack(this[0].labels);
		}

		// Support: IE <= 11, FF <= 37, Android <= 2.3 only
		// Above browsers do not support control.labels. Everything below is to support them
		// as well as document fragments. control.labels does not work on document fragments
		labels = this.eq(0).parents("label");

		// Look for the label based on the id
		id = this.attr("id");
		if (id) {

			// We don't search against the document in case the element
			// is disconnected from the DOM
			ancestor = this.eq(0).parents().last();

			// Get a full set of top level ancestors
			ancestors = ancestor.add(ancestor.length ? ancestor.siblings() : this.siblings());

			// Create a selector for the label based on the id
			selector = "label[for='" + $.ui.escapeSelector(id) + "']";

			labels = labels.add(ancestors.find(selector).addBack(selector));
		}

		// Return whatever we have found for labels
		return this.pushStack(labels);
	};

	/*!
  * jQuery UI Scroll Parent 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: scrollParent
	//>>group: Core
	//>>description: Get the closest ancestor element that is scrollable.
	//>>docs: http://api.jqueryui.com/scrollParent/


	var scrollParent = $.fn.scrollParent = function (includeHidden) {
		var position = this.css("position"),
		    excludeStaticParent = position === "absolute",
		    overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
		    scrollParent = this.parents().filter(function () {
			var parent = $(this);
			if (excludeStaticParent && parent.css("position") === "static") {
				return false;
			}
			return overflowRegex.test(parent.css("overflow") + parent.css("overflow-y") + parent.css("overflow-x"));
		}).eq(0);

		return position === "fixed" || !scrollParent.length ? $(this[0].ownerDocument || document) : scrollParent;
	};

	/*!
  * jQuery UI Tabbable 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: :tabbable Selector
	//>>group: Core
	//>>description: Selects elements which can be tabbed to.
	//>>docs: http://api.jqueryui.com/tabbable-selector/


	var tabbable = $.extend($.expr[":"], {
		tabbable: function tabbable(element) {
			var tabIndex = $.attr(element, "tabindex"),
			    hasTabindex = tabIndex != null;
			return (!hasTabindex || tabIndex >= 0) && $.ui.focusable(element, hasTabindex);
		}
	});

	/*!
  * jQuery UI Unique ID 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: uniqueId
	//>>group: Core
	//>>description: Functions to generate and remove uniqueId's
	//>>docs: http://api.jqueryui.com/uniqueId/


	var uniqueId = $.fn.extend({
		uniqueId: function () {
			var uuid = 0;

			return function () {
				return this.each(function () {
					if (!this.id) {
						this.id = "ui-id-" + ++uuid;
					}
				});
			};
		}(),

		removeUniqueId: function removeUniqueId() {
			return this.each(function () {
				if (/^ui-id-\d+$/.test(this.id)) {
					$(this).removeAttr("id");
				}
			});
		}
	});

	/*!
  * jQuery UI Accordion 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Accordion
	//>>group: Widgets
	// jscs:disable maximumLineLength
	//>>description: Displays collapsible content panels for presenting information in a limited amount of space.
	// jscs:enable maximumLineLength
	//>>docs: http://api.jqueryui.com/accordion/
	//>>demos: http://jqueryui.com/accordion/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/accordion.css
	//>>css.theme: ../../themes/base/theme.css


	var widgetsAccordion = $.widget("ui.accordion", {
		version: "1.12.1",
		options: {
			active: 0,
			animate: {},
			classes: {
				"ui-accordion-header": "ui-corner-top",
				"ui-accordion-header-collapsed": "ui-corner-all",
				"ui-accordion-content": "ui-corner-bottom"
			},
			collapsible: false,
			event: "click",
			header: "> li > :first-child, > :not(li):even",
			heightStyle: "auto",
			icons: {
				activeHeader: "ui-icon-triangle-1-s",
				header: "ui-icon-triangle-1-e"
			},

			// Callbacks
			activate: null,
			beforeActivate: null
		},

		hideProps: {
			borderTopWidth: "hide",
			borderBottomWidth: "hide",
			paddingTop: "hide",
			paddingBottom: "hide",
			height: "hide"
		},

		showProps: {
			borderTopWidth: "show",
			borderBottomWidth: "show",
			paddingTop: "show",
			paddingBottom: "show",
			height: "show"
		},

		_create: function _create() {
			var options = this.options;

			this.prevShow = this.prevHide = $();
			this._addClass("ui-accordion", "ui-widget ui-helper-reset");
			this.element.attr("role", "tablist");

			// Don't allow collapsible: false and active: false / null
			if (!options.collapsible && (options.active === false || options.active == null)) {
				options.active = 0;
			}

			this._processPanels();

			// handle negative values
			if (options.active < 0) {
				options.active += this.headers.length;
			}
			this._refresh();
		},

		_getCreateEventData: function _getCreateEventData() {
			return {
				header: this.active,
				panel: !this.active.length ? $() : this.active.next()
			};
		},

		_createIcons: function _createIcons() {
			var icon,
			    children,
			    icons = this.options.icons;

			if (icons) {
				icon = $("<span>");
				this._addClass(icon, "ui-accordion-header-icon", "ui-icon " + icons.header);
				icon.prependTo(this.headers);
				children = this.active.children(".ui-accordion-header-icon");
				this._removeClass(children, icons.header)._addClass(children, null, icons.activeHeader)._addClass(this.headers, "ui-accordion-icons");
			}
		},

		_destroyIcons: function _destroyIcons() {
			this._removeClass(this.headers, "ui-accordion-icons");
			this.headers.children(".ui-accordion-header-icon").remove();
		},

		_destroy: function _destroy() {
			var contents;

			// Clean up main element
			this.element.removeAttr("role");

			// Clean up headers
			this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId();

			this._destroyIcons();

			// Clean up content panels
			contents = this.headers.next().css("display", "").removeAttr("role aria-hidden aria-labelledby").removeUniqueId();

			if (this.options.heightStyle !== "content") {
				contents.css("height", "");
			}
		},

		_setOption: function _setOption(key, value) {
			if (key === "active") {

				// _activate() will handle invalid values and update this.options
				this._activate(value);
				return;
			}

			if (key === "event") {
				if (this.options.event) {
					this._off(this.headers, this.options.event);
				}
				this._setupEvents(value);
			}

			this._super(key, value);

			// Setting collapsible: false while collapsed; open first panel
			if (key === "collapsible" && !value && this.options.active === false) {
				this._activate(0);
			}

			if (key === "icons") {
				this._destroyIcons();
				if (value) {
					this._createIcons();
				}
			}
		},

		_setOptionDisabled: function _setOptionDisabled(value) {
			this._super(value);

			this.element.attr("aria-disabled", value);

			// Support: IE8 Only
			// #5332 / #6059 - opacity doesn't cascade to positioned elements in IE
			// so we need to add the disabled class to the headers and panels
			this._toggleClass(null, "ui-state-disabled", !!value);
			this._toggleClass(this.headers.add(this.headers.next()), null, "ui-state-disabled", !!value);
		},

		_keydown: function _keydown(event) {
			if (event.altKey || event.ctrlKey) {
				return;
			}

			var keyCode = $.ui.keyCode,
			    length = this.headers.length,
			    currentIndex = this.headers.index(event.target),
			    toFocus = false;

			switch (event.keyCode) {
				case keyCode.RIGHT:
				case keyCode.DOWN:
					toFocus = this.headers[(currentIndex + 1) % length];
					break;
				case keyCode.LEFT:
				case keyCode.UP:
					toFocus = this.headers[(currentIndex - 1 + length) % length];
					break;
				case keyCode.SPACE:
				case keyCode.ENTER:
					this._eventHandler(event);
					break;
				case keyCode.HOME:
					toFocus = this.headers[0];
					break;
				case keyCode.END:
					toFocus = this.headers[length - 1];
					break;
			}

			if (toFocus) {
				$(event.target).attr("tabIndex", -1);
				$(toFocus).attr("tabIndex", 0);
				$(toFocus).trigger("focus");
				event.preventDefault();
			}
		},

		_panelKeyDown: function _panelKeyDown(event) {
			if (event.keyCode === $.ui.keyCode.UP && event.ctrlKey) {
				$(event.currentTarget).prev().trigger("focus");
			}
		},

		refresh: function refresh() {
			var options = this.options;
			this._processPanels();

			// Was collapsed or no panel
			if (options.active === false && options.collapsible === true || !this.headers.length) {
				options.active = false;
				this.active = $();

				// active false only when collapsible is true
			} else if (options.active === false) {
				this._activate(0);

				// was active, but active panel is gone
			} else if (this.active.length && !$.contains(this.element[0], this.active[0])) {

				// all remaining panel are disabled
				if (this.headers.length === this.headers.find(".ui-state-disabled").length) {
					options.active = false;
					this.active = $();

					// activate previous panel
				} else {
					this._activate(Math.max(0, options.active - 1));
				}

				// was active, active panel still exists
			} else {

				// make sure active index is correct
				options.active = this.headers.index(this.active);
			}

			this._destroyIcons();

			this._refresh();
		},

		_processPanels: function _processPanels() {
			var prevHeaders = this.headers,
			    prevPanels = this.panels;

			this.headers = this.element.find(this.options.header);
			this._addClass(this.headers, "ui-accordion-header ui-accordion-header-collapsed", "ui-state-default");

			this.panels = this.headers.next().filter(":not(.ui-accordion-content-active)").hide();
			this._addClass(this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content");

			// Avoid memory leaks (#10056)
			if (prevPanels) {
				this._off(prevHeaders.not(this.headers));
				this._off(prevPanels.not(this.panels));
			}
		},

		_refresh: function _refresh() {
			var maxHeight,
			    options = this.options,
			    heightStyle = options.heightStyle,
			    parent = this.element.parent();

			this.active = this._findActive(options.active);
			this._addClass(this.active, "ui-accordion-header-active", "ui-state-active")._removeClass(this.active, "ui-accordion-header-collapsed");
			this._addClass(this.active.next(), "ui-accordion-content-active");
			this.active.next().show();

			this.headers.attr("role", "tab").each(function () {
				var header = $(this),
				    headerId = header.uniqueId().attr("id"),
				    panel = header.next(),
				    panelId = panel.uniqueId().attr("id");
				header.attr("aria-controls", panelId);
				panel.attr("aria-labelledby", headerId);
			}).next().attr("role", "tabpanel");

			this.headers.not(this.active).attr({
				"aria-selected": "false",
				"aria-expanded": "false",
				tabIndex: -1
			}).next().attr({
				"aria-hidden": "true"
			}).hide();

			// Make sure at least one header is in the tab order
			if (!this.active.length) {
				this.headers.eq(0).attr("tabIndex", 0);
			} else {
				this.active.attr({
					"aria-selected": "true",
					"aria-expanded": "true",
					tabIndex: 0
				}).next().attr({
					"aria-hidden": "false"
				});
			}

			this._createIcons();

			this._setupEvents(options.event);

			if (heightStyle === "fill") {
				maxHeight = parent.height();
				this.element.siblings(":visible").each(function () {
					var elem = $(this),
					    position = elem.css("position");

					if (position === "absolute" || position === "fixed") {
						return;
					}
					maxHeight -= elem.outerHeight(true);
				});

				this.headers.each(function () {
					maxHeight -= $(this).outerHeight(true);
				});

				this.headers.next().each(function () {
					$(this).height(Math.max(0, maxHeight - $(this).innerHeight() + $(this).height()));
				}).css("overflow", "auto");
			} else if (heightStyle === "auto") {
				maxHeight = 0;
				this.headers.next().each(function () {
					var isVisible = $(this).is(":visible");
					if (!isVisible) {
						$(this).show();
					}
					maxHeight = Math.max(maxHeight, $(this).css("height", "").height());
					if (!isVisible) {
						$(this).hide();
					}
				}).height(maxHeight);
			}
		},

		_activate: function _activate(index) {
			var active = this._findActive(index)[0];

			// Trying to activate the already active panel
			if (active === this.active[0]) {
				return;
			}

			// Trying to collapse, simulate a click on the currently active header
			active = active || this.active[0];

			this._eventHandler({
				target: active,
				currentTarget: active,
				preventDefault: $.noop
			});
		},

		_findActive: function _findActive(selector) {
			return typeof selector === "number" ? this.headers.eq(selector) : $();
		},

		_setupEvents: function _setupEvents(event) {
			var events = {
				keydown: "_keydown"
			};
			if (event) {
				$.each(event.split(" "), function (index, eventName) {
					events[eventName] = "_eventHandler";
				});
			}

			this._off(this.headers.add(this.headers.next()));
			this._on(this.headers, events);
			this._on(this.headers.next(), { keydown: "_panelKeyDown" });
			this._hoverable(this.headers);
			this._focusable(this.headers);
		},

		_eventHandler: function _eventHandler(event) {
			var activeChildren,
			    clickedChildren,
			    options = this.options,
			    active = this.active,
			    clicked = $(event.currentTarget),
			    clickedIsActive = clicked[0] === active[0],
			    collapsing = clickedIsActive && options.collapsible,
			    toShow = collapsing ? $() : clicked.next(),
			    toHide = active.next(),
			    eventData = {
				oldHeader: active,
				oldPanel: toHide,
				newHeader: collapsing ? $() : clicked,
				newPanel: toShow
			};

			event.preventDefault();

			if (

			// click on active header, but not collapsible
			clickedIsActive && !options.collapsible ||

			// allow canceling activation
			this._trigger("beforeActivate", event, eventData) === false) {
				return;
			}

			options.active = collapsing ? false : this.headers.index(clicked);

			// When the call to ._toggle() comes after the class changes
			// it causes a very odd bug in IE 8 (see #6720)
			this.active = clickedIsActive ? $() : clicked;
			this._toggle(eventData);

			// Switch classes
			// corner classes on the previously active header stay after the animation
			this._removeClass(active, "ui-accordion-header-active", "ui-state-active");
			if (options.icons) {
				activeChildren = active.children(".ui-accordion-header-icon");
				this._removeClass(activeChildren, null, options.icons.activeHeader)._addClass(activeChildren, null, options.icons.header);
			}

			if (!clickedIsActive) {
				this._removeClass(clicked, "ui-accordion-header-collapsed")._addClass(clicked, "ui-accordion-header-active", "ui-state-active");
				if (options.icons) {
					clickedChildren = clicked.children(".ui-accordion-header-icon");
					this._removeClass(clickedChildren, null, options.icons.header)._addClass(clickedChildren, null, options.icons.activeHeader);
				}

				this._addClass(clicked.next(), "ui-accordion-content-active");
			}
		},

		_toggle: function _toggle(data) {
			var toShow = data.newPanel,
			    toHide = this.prevShow.length ? this.prevShow : data.oldPanel;

			// Handle activating a panel during the animation for another activation
			this.prevShow.add(this.prevHide).stop(true, true);
			this.prevShow = toShow;
			this.prevHide = toHide;

			if (this.options.animate) {
				this._animate(toShow, toHide, data);
			} else {
				toHide.hide();
				toShow.show();
				this._toggleComplete(data);
			}

			toHide.attr({
				"aria-hidden": "true"
			});
			toHide.prev().attr({
				"aria-selected": "false",
				"aria-expanded": "false"
			});

			// if we're switching panels, remove the old header from the tab order
			// if we're opening from collapsed state, remove the previous header from the tab order
			// if we're collapsing, then keep the collapsing header in the tab order
			if (toShow.length && toHide.length) {
				toHide.prev().attr({
					"tabIndex": -1,
					"aria-expanded": "false"
				});
			} else if (toShow.length) {
				this.headers.filter(function () {
					return parseInt($(this).attr("tabIndex"), 10) === 0;
				}).attr("tabIndex", -1);
			}

			toShow.attr("aria-hidden", "false").prev().attr({
				"aria-selected": "true",
				"aria-expanded": "true",
				tabIndex: 0
			});
		},

		_animate: function _animate(toShow, toHide, data) {
			var total,
			    easing,
			    duration,
			    that = this,
			    adjust = 0,
			    boxSizing = toShow.css("box-sizing"),
			    down = toShow.length && (!toHide.length || toShow.index() < toHide.index()),
			    animate = this.options.animate || {},
			    options = down && animate.down || animate,
			    complete = function complete() {
				that._toggleComplete(data);
			};

			if (typeof options === "number") {
				duration = options;
			}
			if (typeof options === "string") {
				easing = options;
			}

			// fall back from options to animation in case of partial down settings
			easing = easing || options.easing || animate.easing;
			duration = duration || options.duration || animate.duration;

			if (!toHide.length) {
				return toShow.animate(this.showProps, duration, easing, complete);
			}
			if (!toShow.length) {
				return toHide.animate(this.hideProps, duration, easing, complete);
			}

			total = toShow.show().outerHeight();
			toHide.animate(this.hideProps, {
				duration: duration,
				easing: easing,
				step: function step(now, fx) {
					fx.now = Math.round(now);
				}
			});
			toShow.hide().animate(this.showProps, {
				duration: duration,
				easing: easing,
				complete: complete,
				step: function step(now, fx) {
					fx.now = Math.round(now);
					if (fx.prop !== "height") {
						if (boxSizing === "content-box") {
							adjust += fx.now;
						}
					} else if (that.options.heightStyle !== "content") {
						fx.now = Math.round(total - toHide.outerHeight() - adjust);
						adjust = 0;
					}
				}
			});
		},

		_toggleComplete: function _toggleComplete(data) {
			var toHide = data.oldPanel,
			    prev = toHide.prev();

			this._removeClass(toHide, "ui-accordion-content-active");
			this._removeClass(prev, "ui-accordion-header-active")._addClass(prev, "ui-accordion-header-collapsed");

			// Work around for rendering bug in IE (#5421)
			if (toHide.length) {
				toHide.parent()[0].className = toHide.parent()[0].className;
			}
			this._trigger("activate", null, data);
		}
	});

	var safeActiveElement = $.ui.safeActiveElement = function (document) {
		var activeElement;

		// Support: IE 9 only
		// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
		try {
			activeElement = document.activeElement;
		} catch (error) {
			activeElement = document.body;
		}

		// Support: IE 9 - 11 only
		// IE may return null instead of an element
		// Interestingly, this only seems to occur when NOT in an iframe
		if (!activeElement) {
			activeElement = document.body;
		}

		// Support: IE 11 only
		// IE11 returns a seemingly empty object in some cases when accessing
		// document.activeElement from an <iframe>
		if (!activeElement.nodeName) {
			activeElement = document.body;
		}

		return activeElement;
	};

	/*!
  * jQuery UI Menu 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Menu
	//>>group: Widgets
	//>>description: Creates nestable menus.
	//>>docs: http://api.jqueryui.com/menu/
	//>>demos: http://jqueryui.com/menu/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/menu.css
	//>>css.theme: ../../themes/base/theme.css


	var widgetsMenu = $.widget("ui.menu", {
		version: "1.12.1",
		defaultElement: "<ul>",
		delay: 300,
		options: {
			icons: {
				submenu: "ui-icon-caret-1-e"
			},
			items: "> *",
			menus: "ul",
			position: {
				my: "left top",
				at: "right top"
			},
			role: "menu",

			// Callbacks
			blur: null,
			focus: null,
			select: null
		},

		_create: function _create() {
			this.activeMenu = this.element;

			// Flag used to prevent firing of the click handler
			// as the event bubbles up through nested menus
			this.mouseHandled = false;
			this.element.uniqueId().attr({
				role: this.options.role,
				tabIndex: 0
			});

			this._addClass("ui-menu", "ui-widget ui-widget-content");
			this._on({

				// Prevent focus from sticking to links inside menu after clicking
				// them (focus should always stay on UL during navigation).
				"mousedown .ui-menu-item": function mousedownUiMenuItem(event) {
					event.preventDefault();
				},
				"click .ui-menu-item": function clickUiMenuItem(event) {
					var target = $(event.target);
					var active = $($.ui.safeActiveElement(this.document[0]));
					if (!this.mouseHandled && target.not(".ui-state-disabled").length) {
						this.select(event);

						// Only set the mouseHandled flag if the event will bubble, see #9469.
						if (!event.isPropagationStopped()) {
							this.mouseHandled = true;
						}

						// Open submenu on click
						if (target.has(".ui-menu").length) {
							this.expand(event);
						} else if (!this.element.is(":focus") && active.closest(".ui-menu").length) {

							// Redirect focus to the menu
							this.element.trigger("focus", [true]);

							// If the active item is on the top level, let it stay active.
							// Otherwise, blur the active item since it is no longer visible.
							if (this.active && this.active.parents(".ui-menu").length === 1) {
								clearTimeout(this.timer);
							}
						}
					}
				},
				"mouseenter .ui-menu-item": function mouseenterUiMenuItem(event) {

					// Ignore mouse events while typeahead is active, see #10458.
					// Prevents focusing the wrong item when typeahead causes a scroll while the mouse
					// is over an item in the menu
					if (this.previousFilter) {
						return;
					}

					var actualTarget = $(event.target).closest(".ui-menu-item"),
					    target = $(event.currentTarget);

					// Ignore bubbled events on parent items, see #11641
					if (actualTarget[0] !== target[0]) {
						return;
					}

					// Remove ui-state-active class from siblings of the newly focused menu item
					// to avoid a jump caused by adjacent elements both having a class with a border
					this._removeClass(target.siblings().children(".ui-state-active"), null, "ui-state-active");
					this.focus(event, target);
				},
				mouseleave: "collapseAll",
				"mouseleave .ui-menu": "collapseAll",
				focus: function focus(event, keepActiveItem) {

					// If there's already an active item, keep it active
					// If not, activate the first item
					var item = this.active || this.element.find(this.options.items).eq(0);

					if (!keepActiveItem) {
						this.focus(event, item);
					}
				},
				blur: function blur(event) {
					this._delay(function () {
						var notContained = !$.contains(this.element[0], $.ui.safeActiveElement(this.document[0]));
						if (notContained) {
							this.collapseAll(event);
						}
					});
				},
				keydown: "_keydown"
			});

			this.refresh();

			// Clicks outside of a menu collapse any open menus
			this._on(this.document, {
				click: function click(event) {
					if (this._closeOnDocumentClick(event)) {
						this.collapseAll(event);
					}

					// Reset the mouseHandled flag
					this.mouseHandled = false;
				}
			});
		},

		_destroy: function _destroy() {
			var items = this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),
			    submenus = items.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");

			// Destroy (sub)menus
			this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled " + "tabIndex").removeUniqueId().show();

			submenus.children().each(function () {
				var elem = $(this);
				if (elem.data("ui-menu-submenu-caret")) {
					elem.remove();
				}
			});
		},

		_keydown: function _keydown(event) {
			var match,
			    prev,
			    character,
			    skip,
			    preventDefault = true;

			switch (event.keyCode) {
				case $.ui.keyCode.PAGE_UP:
					this.previousPage(event);
					break;
				case $.ui.keyCode.PAGE_DOWN:
					this.nextPage(event);
					break;
				case $.ui.keyCode.HOME:
					this._move("first", "first", event);
					break;
				case $.ui.keyCode.END:
					this._move("last", "last", event);
					break;
				case $.ui.keyCode.UP:
					this.previous(event);
					break;
				case $.ui.keyCode.DOWN:
					this.next(event);
					break;
				case $.ui.keyCode.LEFT:
					this.collapse(event);
					break;
				case $.ui.keyCode.RIGHT:
					if (this.active && !this.active.is(".ui-state-disabled")) {
						this.expand(event);
					}
					break;
				case $.ui.keyCode.ENTER:
				case $.ui.keyCode.SPACE:
					this._activate(event);
					break;
				case $.ui.keyCode.ESCAPE:
					this.collapse(event);
					break;
				default:
					preventDefault = false;
					prev = this.previousFilter || "";
					skip = false;

					// Support number pad values
					character = event.keyCode >= 96 && event.keyCode <= 105 ? (event.keyCode - 96).toString() : String.fromCharCode(event.keyCode);

					clearTimeout(this.filterTimer);

					if (character === prev) {
						skip = true;
					} else {
						character = prev + character;
					}

					match = this._filterMenuItems(character);
					match = skip && match.index(this.active.next()) !== -1 ? this.active.nextAll(".ui-menu-item") : match;

					// If no matches on the current filter, reset to the last character pressed
					// to move down the menu to the first item that starts with that character
					if (!match.length) {
						character = String.fromCharCode(event.keyCode);
						match = this._filterMenuItems(character);
					}

					if (match.length) {
						this.focus(event, match);
						this.previousFilter = character;
						this.filterTimer = this._delay(function () {
							delete this.previousFilter;
						}, 1000);
					} else {
						delete this.previousFilter;
					}
			}

			if (preventDefault) {
				event.preventDefault();
			}
		},

		_activate: function _activate(event) {
			if (this.active && !this.active.is(".ui-state-disabled")) {
				if (this.active.children("[aria-haspopup='true']").length) {
					this.expand(event);
				} else {
					this.select(event);
				}
			}
		},

		refresh: function refresh() {
			var menus,
			    items,
			    newSubmenus,
			    newItems,
			    newWrappers,
			    that = this,
			    icon = this.options.icons.submenu,
			    submenus = this.element.find(this.options.menus);

			this._toggleClass("ui-menu-icons", null, !!this.element.find(".ui-icon").length);

			// Initialize nested menus
			newSubmenus = submenus.filter(":not(.ui-menu)").hide().attr({
				role: this.options.role,
				"aria-hidden": "true",
				"aria-expanded": "false"
			}).each(function () {
				var menu = $(this),
				    item = menu.prev(),
				    submenuCaret = $("<span>").data("ui-menu-submenu-caret", true);

				that._addClass(submenuCaret, "ui-menu-icon", "ui-icon " + icon);
				item.attr("aria-haspopup", "true").prepend(submenuCaret);
				menu.attr("aria-labelledby", item.attr("id"));
			});

			this._addClass(newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front");

			menus = submenus.add(this.element);
			items = menus.find(this.options.items);

			// Initialize menu-items containing spaces and/or dashes only as dividers
			items.not(".ui-menu-item").each(function () {
				var item = $(this);
				if (that._isDivider(item)) {
					that._addClass(item, "ui-menu-divider", "ui-widget-content");
				}
			});

			// Don't refresh list items that are already adapted
			newItems = items.not(".ui-menu-item, .ui-menu-divider");
			newWrappers = newItems.children().not(".ui-menu").uniqueId().attr({
				tabIndex: -1,
				role: this._itemRole()
			});
			this._addClass(newItems, "ui-menu-item")._addClass(newWrappers, "ui-menu-item-wrapper");

			// Add aria-disabled attribute to any disabled menu item
			items.filter(".ui-state-disabled").attr("aria-disabled", "true");

			// If the active item has been removed, blur the menu
			if (this.active && !$.contains(this.element[0], this.active[0])) {
				this.blur();
			}
		},

		_itemRole: function _itemRole() {
			return {
				menu: "menuitem",
				listbox: "option"
			}[this.options.role];
		},

		_setOption: function _setOption(key, value) {
			if (key === "icons") {
				var icons = this.element.find(".ui-menu-icon");
				this._removeClass(icons, null, this.options.icons.submenu)._addClass(icons, null, value.submenu);
			}
			this._super(key, value);
		},

		_setOptionDisabled: function _setOptionDisabled(value) {
			this._super(value);

			this.element.attr("aria-disabled", String(value));
			this._toggleClass(null, "ui-state-disabled", !!value);
		},

		focus: function focus(event, item) {
			var nested, focused, activeParent;
			this.blur(event, event && event.type === "focus");

			this._scrollIntoView(item);

			this.active = item.first();

			focused = this.active.children(".ui-menu-item-wrapper");
			this._addClass(focused, null, "ui-state-active");

			// Only update aria-activedescendant if there's a role
			// otherwise we assume focus is managed elsewhere
			if (this.options.role) {
				this.element.attr("aria-activedescendant", focused.attr("id"));
			}

			// Highlight active parent menu item, if any
			activeParent = this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper");
			this._addClass(activeParent, null, "ui-state-active");

			if (event && event.type === "keydown") {
				this._close();
			} else {
				this.timer = this._delay(function () {
					this._close();
				}, this.delay);
			}

			nested = item.children(".ui-menu");
			if (nested.length && event && /^mouse/.test(event.type)) {
				this._startOpening(nested);
			}
			this.activeMenu = item.parent();

			this._trigger("focus", event, { item: item });
		},

		_scrollIntoView: function _scrollIntoView(item) {
			var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
			if (this._hasScroll()) {
				borderTop = parseFloat($.css(this.activeMenu[0], "borderTopWidth")) || 0;
				paddingTop = parseFloat($.css(this.activeMenu[0], "paddingTop")) || 0;
				offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
				scroll = this.activeMenu.scrollTop();
				elementHeight = this.activeMenu.height();
				itemHeight = item.outerHeight();

				if (offset < 0) {
					this.activeMenu.scrollTop(scroll + offset);
				} else if (offset + itemHeight > elementHeight) {
					this.activeMenu.scrollTop(scroll + offset - elementHeight + itemHeight);
				}
			}
		},

		blur: function blur(event, fromFocus) {
			if (!fromFocus) {
				clearTimeout(this.timer);
			}

			if (!this.active) {
				return;
			}

			this._removeClass(this.active.children(".ui-menu-item-wrapper"), null, "ui-state-active");

			this._trigger("blur", event, { item: this.active });
			this.active = null;
		},

		_startOpening: function _startOpening(submenu) {
			clearTimeout(this.timer);

			// Don't open if already open fixes a Firefox bug that caused a .5 pixel
			// shift in the submenu position when mousing over the caret icon
			if (submenu.attr("aria-hidden") !== "true") {
				return;
			}

			this.timer = this._delay(function () {
				this._close();
				this._open(submenu);
			}, this.delay);
		},

		_open: function _open(submenu) {
			var position = $.extend({
				of: this.active
			}, this.options.position);

			clearTimeout(this.timer);
			this.element.find(".ui-menu").not(submenu.parents(".ui-menu")).hide().attr("aria-hidden", "true");

			submenu.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(position);
		},

		collapseAll: function collapseAll(event, all) {
			clearTimeout(this.timer);
			this.timer = this._delay(function () {

				// If we were passed an event, look for the submenu that contains the event
				var currentMenu = all ? this.element : $(event && event.target).closest(this.element.find(".ui-menu"));

				// If we found no valid submenu ancestor, use the main menu to close all
				// sub menus anyway
				if (!currentMenu.length) {
					currentMenu = this.element;
				}

				this._close(currentMenu);

				this.blur(event);

				// Work around active item staying active after menu is blurred
				this._removeClass(currentMenu.find(".ui-state-active"), null, "ui-state-active");

				this.activeMenu = currentMenu;
			}, this.delay);
		},

		// With no arguments, closes the currently active menu - if nothing is active
		// it closes all menus.  If passed an argument, it will search for menus BELOW
		_close: function _close(startMenu) {
			if (!startMenu) {
				startMenu = this.active ? this.active.parent() : this.element;
			}

			startMenu.find(".ui-menu").hide().attr("aria-hidden", "true").attr("aria-expanded", "false");
		},

		_closeOnDocumentClick: function _closeOnDocumentClick(event) {
			return !$(event.target).closest(".ui-menu").length;
		},

		_isDivider: function _isDivider(item) {

			// Match hyphen, em dash, en dash
			return !/[^\-\u2014\u2013\s]/.test(item.text());
		},

		collapse: function collapse(event) {
			var newItem = this.active && this.active.parent().closest(".ui-menu-item", this.element);
			if (newItem && newItem.length) {
				this._close();
				this.focus(event, newItem);
			}
		},

		expand: function expand(event) {
			var newItem = this.active && this.active.children(".ui-menu ").find(this.options.items).first();

			if (newItem && newItem.length) {
				this._open(newItem.parent());

				// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
				this._delay(function () {
					this.focus(event, newItem);
				});
			}
		},

		next: function next(event) {
			this._move("next", "first", event);
		},

		previous: function previous(event) {
			this._move("prev", "last", event);
		},

		isFirstItem: function isFirstItem() {
			return this.active && !this.active.prevAll(".ui-menu-item").length;
		},

		isLastItem: function isLastItem() {
			return this.active && !this.active.nextAll(".ui-menu-item").length;
		},

		_move: function _move(direction, filter, event) {
			var next;
			if (this.active) {
				if (direction === "first" || direction === "last") {
					next = this.active[direction === "first" ? "prevAll" : "nextAll"](".ui-menu-item").eq(-1);
				} else {
					next = this.active[direction + "All"](".ui-menu-item").eq(0);
				}
			}
			if (!next || !next.length || !this.active) {
				next = this.activeMenu.find(this.options.items)[filter]();
			}

			this.focus(event, next);
		},

		nextPage: function nextPage(event) {
			var item, base, height;

			if (!this.active) {
				this.next(event);
				return;
			}
			if (this.isLastItem()) {
				return;
			}
			if (this._hasScroll()) {
				base = this.active.offset().top;
				height = this.element.height();
				this.active.nextAll(".ui-menu-item").each(function () {
					item = $(this);
					return item.offset().top - base - height < 0;
				});

				this.focus(event, item);
			} else {
				this.focus(event, this.activeMenu.find(this.options.items)[!this.active ? "first" : "last"]());
			}
		},

		previousPage: function previousPage(event) {
			var item, base, height;
			if (!this.active) {
				this.next(event);
				return;
			}
			if (this.isFirstItem()) {
				return;
			}
			if (this._hasScroll()) {
				base = this.active.offset().top;
				height = this.element.height();
				this.active.prevAll(".ui-menu-item").each(function () {
					item = $(this);
					return item.offset().top - base + height > 0;
				});

				this.focus(event, item);
			} else {
				this.focus(event, this.activeMenu.find(this.options.items).first());
			}
		},

		_hasScroll: function _hasScroll() {
			return this.element.outerHeight() < this.element.prop("scrollHeight");
		},

		select: function select(event) {

			// TODO: It should never be possible to not have an active item at this
			// point, but the tests don't trigger mouseenter before click.
			this.active = this.active || $(event.target).closest(".ui-menu-item");
			var ui = { item: this.active };
			if (!this.active.has(".ui-menu").length) {
				this.collapseAll(event, true);
			}
			this._trigger("select", event, ui);
		},

		_filterMenuItems: function _filterMenuItems(character) {
			var escapedCharacter = character.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"),
			    regex = new RegExp("^" + escapedCharacter, "i");

			return this.activeMenu.find(this.options.items)

			// Only match on items, not dividers or other content (#10571)
			.filter(".ui-menu-item").filter(function () {
				return regex.test($.trim($(this).children(".ui-menu-item-wrapper").text()));
			});
		}
	});

	/*!
  * jQuery UI Autocomplete 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Autocomplete
	//>>group: Widgets
	//>>description: Lists suggested words as the user is typing.
	//>>docs: http://api.jqueryui.com/autocomplete/
	//>>demos: http://jqueryui.com/autocomplete/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/autocomplete.css
	//>>css.theme: ../../themes/base/theme.css


	$.widget("ui.autocomplete", {
		version: "1.12.1",
		defaultElement: "<input>",
		options: {
			appendTo: null,
			autoFocus: false,
			delay: 300,
			minLength: 1,
			position: {
				my: "left top",
				at: "left bottom",
				collision: "none"
			},
			source: null,

			// Callbacks
			change: null,
			close: null,
			focus: null,
			open: null,
			response: null,
			search: null,
			select: null
		},

		requestIndex: 0,
		pending: 0,

		_create: function _create() {

			// Some browsers only repeat keydown events, not keypress events,
			// so we use the suppressKeyPress flag to determine if we've already
			// handled the keydown event. #7269
			// Unfortunately the code for & in keypress is the same as the up arrow,
			// so we use the suppressKeyPressRepeat flag to avoid handling keypress
			// events when we know the keydown event was used to modify the
			// search term. #7799
			var suppressKeyPress,
			    suppressKeyPressRepeat,
			    suppressInput,
			    nodeName = this.element[0].nodeName.toLowerCase(),
			    isTextarea = nodeName === "textarea",
			    isInput = nodeName === "input";

			// Textareas are always multi-line
			// Inputs are always single-line, even if inside a contentEditable element
			// IE also treats inputs as contentEditable
			// All other element types are determined by whether or not they're contentEditable
			this.isMultiLine = isTextarea || !isInput && this._isContentEditable(this.element);

			this.valueMethod = this.element[isTextarea || isInput ? "val" : "text"];
			this.isNewMenu = true;

			this._addClass("ui-autocomplete-input");
			this.element.attr("autocomplete", "off");

			this._on(this.element, {
				keydown: function keydown(event) {
					if (this.element.prop("readOnly")) {
						suppressKeyPress = true;
						suppressInput = true;
						suppressKeyPressRepeat = true;
						return;
					}

					suppressKeyPress = false;
					suppressInput = false;
					suppressKeyPressRepeat = false;
					var keyCode = $.ui.keyCode;
					switch (event.keyCode) {
						case keyCode.PAGE_UP:
							suppressKeyPress = true;
							this._move("previousPage", event);
							break;
						case keyCode.PAGE_DOWN:
							suppressKeyPress = true;
							this._move("nextPage", event);
							break;
						case keyCode.UP:
							suppressKeyPress = true;
							this._keyEvent("previous", event);
							break;
						case keyCode.DOWN:
							suppressKeyPress = true;
							this._keyEvent("next", event);
							break;
						case keyCode.ENTER:

							// when menu is open and has focus
							if (this.menu.active) {

								// #6055 - Opera still allows the keypress to occur
								// which causes forms to submit
								suppressKeyPress = true;
								event.preventDefault();
								this.menu.select(event);
							}
							break;
						case keyCode.TAB:
							if (this.menu.active) {
								this.menu.select(event);
							}
							break;
						case keyCode.ESCAPE:
							if (this.menu.element.is(":visible")) {
								if (!this.isMultiLine) {
									this._value(this.term);
								}
								this.close(event);

								// Different browsers have different default behavior for escape
								// Single press can mean undo or clear
								// Double press in IE means clear the whole form
								event.preventDefault();
							}
							break;
						default:
							suppressKeyPressRepeat = true;

							// search timeout should be triggered before the input value is changed
							this._searchTimeout(event);
							break;
					}
				},
				keypress: function keypress(event) {
					if (suppressKeyPress) {
						suppressKeyPress = false;
						if (!this.isMultiLine || this.menu.element.is(":visible")) {
							event.preventDefault();
						}
						return;
					}
					if (suppressKeyPressRepeat) {
						return;
					}

					// Replicate some key handlers to allow them to repeat in Firefox and Opera
					var keyCode = $.ui.keyCode;
					switch (event.keyCode) {
						case keyCode.PAGE_UP:
							this._move("previousPage", event);
							break;
						case keyCode.PAGE_DOWN:
							this._move("nextPage", event);
							break;
						case keyCode.UP:
							this._keyEvent("previous", event);
							break;
						case keyCode.DOWN:
							this._keyEvent("next", event);
							break;
					}
				},
				input: function input(event) {
					if (suppressInput) {
						suppressInput = false;
						event.preventDefault();
						return;
					}
					this._searchTimeout(event);
				},
				focus: function focus() {
					this.selectedItem = null;
					this.previous = this._value();
				},
				blur: function blur(event) {
					if (this.cancelBlur) {
						delete this.cancelBlur;
						return;
					}

					clearTimeout(this.searching);
					this.close(event);
					this._change(event);
				}
			});

			this._initSource();
			this.menu = $("<ul>").appendTo(this._appendTo()).menu({

				// disable ARIA support, the live region takes care of that
				role: null
			}).hide().menu("instance");

			this._addClass(this.menu.element, "ui-autocomplete", "ui-front");
			this._on(this.menu.element, {
				mousedown: function mousedown(event) {

					// prevent moving focus out of the text field
					event.preventDefault();

					// IE doesn't prevent moving focus even with event.preventDefault()
					// so we set a flag to know when we should ignore the blur event
					this.cancelBlur = true;
					this._delay(function () {
						delete this.cancelBlur;

						// Support: IE 8 only
						// Right clicking a menu item or selecting text from the menu items will
						// result in focus moving out of the input. However, we've already received
						// and ignored the blur event because of the cancelBlur flag set above. So
						// we restore focus to ensure that the menu closes properly based on the user's
						// next actions.
						if (this.element[0] !== $.ui.safeActiveElement(this.document[0])) {
							this.element.trigger("focus");
						}
					});
				},
				menufocus: function menufocus(event, ui) {
					var label, item;

					// support: Firefox
					// Prevent accidental activation of menu items in Firefox (#7024 #9118)
					if (this.isNewMenu) {
						this.isNewMenu = false;
						if (event.originalEvent && /^mouse/.test(event.originalEvent.type)) {
							this.menu.blur();

							this.document.one("mousemove", function () {
								$(event.target).trigger(event.originalEvent);
							});

							return;
						}
					}

					item = ui.item.data("ui-autocomplete-item");
					if (false !== this._trigger("focus", event, { item: item })) {

						// use value to match what will end up in the input, if it was a key event
						if (event.originalEvent && /^key/.test(event.originalEvent.type)) {
							this._value(item.value);
						}
					}

					// Announce the value in the liveRegion
					label = ui.item.attr("aria-label") || item.value;
					if (label && $.trim(label).length) {
						this.liveRegion.children().hide();
						$("<div>").text(label).appendTo(this.liveRegion);
					}
				},
				menuselect: function menuselect(event, ui) {
					var item = ui.item.data("ui-autocomplete-item"),
					    previous = this.previous;

					// Only trigger when focus was lost (click on menu)
					if (this.element[0] !== $.ui.safeActiveElement(this.document[0])) {
						this.element.trigger("focus");
						this.previous = previous;

						// #6109 - IE triggers two focus events and the second
						// is asynchronous, so we need to reset the previous
						// term synchronously and asynchronously :-(
						this._delay(function () {
							this.previous = previous;
							this.selectedItem = item;
						});
					}

					if (false !== this._trigger("select", event, { item: item })) {
						this._value(item.value);
					}

					// reset the term after the select event
					// this allows custom select handling to work properly
					this.term = this._value();

					this.close(event);
					this.selectedItem = item;
				}
			});

			this.liveRegion = $("<div>", {
				role: "status",
				"aria-live": "assertive",
				"aria-relevant": "additions"
			}).appendTo(this.document[0].body);

			this._addClass(this.liveRegion, null, "ui-helper-hidden-accessible");

			// Turning off autocomplete prevents the browser from remembering the
			// value when navigating through history, so we re-enable autocomplete
			// if the page is unloaded before the widget is destroyed. #7790
			this._on(this.window, {
				beforeunload: function beforeunload() {
					this.element.removeAttr("autocomplete");
				}
			});
		},

		_destroy: function _destroy() {
			clearTimeout(this.searching);
			this.element.removeAttr("autocomplete");
			this.menu.element.remove();
			this.liveRegion.remove();
		},

		_setOption: function _setOption(key, value) {
			this._super(key, value);
			if (key === "source") {
				this._initSource();
			}
			if (key === "appendTo") {
				this.menu.element.appendTo(this._appendTo());
			}
			if (key === "disabled" && value && this.xhr) {
				this.xhr.abort();
			}
		},

		_isEventTargetInWidget: function _isEventTargetInWidget(event) {
			var menuElement = this.menu.element[0];

			return event.target === this.element[0] || event.target === menuElement || $.contains(menuElement, event.target);
		},

		_closeOnClickOutside: function _closeOnClickOutside(event) {
			if (!this._isEventTargetInWidget(event)) {
				this.close();
			}
		},

		_appendTo: function _appendTo() {
			var element = this.options.appendTo;

			if (element) {
				element = element.jquery || element.nodeType ? $(element) : this.document.find(element).eq(0);
			}

			if (!element || !element[0]) {
				element = this.element.closest(".ui-front, dialog");
			}

			if (!element.length) {
				element = this.document[0].body;
			}

			return element;
		},

		_initSource: function _initSource() {
			var array,
			    url,
			    that = this;
			if ($.isArray(this.options.source)) {
				array = this.options.source;
				this.source = function (request, response) {
					response($.ui.autocomplete.filter(array, request.term));
				};
			} else if (typeof this.options.source === "string") {
				url = this.options.source;
				this.source = function (request, response) {
					if (that.xhr) {
						that.xhr.abort();
					}
					that.xhr = $.ajax({
						url: url,
						data: request,
						dataType: "json",
						success: function success(data) {
							response(data);
						},
						error: function error() {
							response([]);
						}
					});
				};
			} else {
				this.source = this.options.source;
			}
		},

		_searchTimeout: function _searchTimeout(event) {
			clearTimeout(this.searching);
			this.searching = this._delay(function () {

				// Search if the value has changed, or if the user retypes the same value (see #7434)
				var equalValues = this.term === this._value(),
				    menuVisible = this.menu.element.is(":visible"),
				    modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;

				if (!equalValues || equalValues && !menuVisible && !modifierKey) {
					this.selectedItem = null;
					this.search(null, event);
				}
			}, this.options.delay);
		},

		search: function search(value, event) {
			value = value != null ? value : this._value();

			// Always save the actual value, not the one passed as an argument
			this.term = this._value();

			if (value.length < this.options.minLength) {
				return this.close(event);
			}

			if (this._trigger("search", event) === false) {
				return;
			}

			return this._search(value);
		},

		_search: function _search(value) {
			this.pending++;
			this._addClass("ui-autocomplete-loading");
			this.cancelSearch = false;

			this.source({ term: value }, this._response());
		},

		_response: function _response() {
			var index = ++this.requestIndex;

			return $.proxy(function (content) {
				if (index === this.requestIndex) {
					this.__response(content);
				}

				this.pending--;
				if (!this.pending) {
					this._removeClass("ui-autocomplete-loading");
				}
			}, this);
		},

		__response: function __response(content) {
			if (content) {
				content = this._normalize(content);
			}
			this._trigger("response", null, { content: content });
			if (!this.options.disabled && content && content.length && !this.cancelSearch) {
				this._suggest(content);
				this._trigger("open");
			} else {

				// use ._close() instead of .close() so we don't cancel future searches
				this._close();
			}
		},

		close: function close(event) {
			this.cancelSearch = true;
			this._close(event);
		},

		_close: function _close(event) {

			// Remove the handler that closes the menu on outside clicks
			this._off(this.document, "mousedown");

			if (this.menu.element.is(":visible")) {
				this.menu.element.hide();
				this.menu.blur();
				this.isNewMenu = true;
				this._trigger("close", event);
			}
		},

		_change: function _change(event) {
			if (this.previous !== this._value()) {
				this._trigger("change", event, { item: this.selectedItem });
			}
		},

		_normalize: function _normalize(items) {

			// assume all items have the right format when the first item is complete
			if (items.length && items[0].label && items[0].value) {
				return items;
			}
			return $.map(items, function (item) {
				if (typeof item === "string") {
					return {
						label: item,
						value: item
					};
				}
				return $.extend({}, item, {
					label: item.label || item.value,
					value: item.value || item.label
				});
			});
		},

		_suggest: function _suggest(items) {
			var ul = this.menu.element.empty();
			this._renderMenu(ul, items);
			this.isNewMenu = true;
			this.menu.refresh();

			// Size and position menu
			ul.show();
			this._resizeMenu();
			ul.position($.extend({
				of: this.element
			}, this.options.position));

			if (this.options.autoFocus) {
				this.menu.next();
			}

			// Listen for interactions outside of the widget (#6642)
			this._on(this.document, {
				mousedown: "_closeOnClickOutside"
			});
		},

		_resizeMenu: function _resizeMenu() {
			var ul = this.menu.element;
			ul.outerWidth(Math.max(

			// Firefox wraps long text (possibly a rounding bug)
			// so we add 1px to avoid the wrapping (#7513)
			ul.width("").outerWidth() + 1, this.element.outerWidth()));
		},

		_renderMenu: function _renderMenu(ul, items) {
			var that = this;
			$.each(items, function (index, item) {
				that._renderItemData(ul, item);
			});
		},

		_renderItemData: function _renderItemData(ul, item) {
			return this._renderItem(ul, item).data("ui-autocomplete-item", item);
		},

		_renderItem: function _renderItem(ul, item) {
			return $("<li>").append($("<div>").text(item.label)).appendTo(ul);
		},

		_move: function _move(direction, event) {
			if (!this.menu.element.is(":visible")) {
				this.search(null, event);
				return;
			}
			if (this.menu.isFirstItem() && /^previous/.test(direction) || this.menu.isLastItem() && /^next/.test(direction)) {

				if (!this.isMultiLine) {
					this._value(this.term);
				}

				this.menu.blur();
				return;
			}
			this.menu[direction](event);
		},

		widget: function widget() {
			return this.menu.element;
		},

		_value: function _value() {
			return this.valueMethod.apply(this.element, arguments);
		},

		_keyEvent: function _keyEvent(keyEvent, event) {
			if (!this.isMultiLine || this.menu.element.is(":visible")) {
				this._move(keyEvent, event);

				// Prevents moving cursor to beginning/end of the text field in some browsers
				event.preventDefault();
			}
		},

		// Support: Chrome <=50
		// We should be able to just use this.element.prop( "isContentEditable" )
		// but hidden elements always report false in Chrome.
		// https://code.google.com/p/chromium/issues/detail?id=313082
		_isContentEditable: function _isContentEditable(element) {
			if (!element.length) {
				return false;
			}

			var editable = element.prop("contentEditable");

			if (editable === "inherit") {
				return this._isContentEditable(element.parent());
			}

			return editable === "true";
		}
	});

	$.extend($.ui.autocomplete, {
		escapeRegex: function escapeRegex(value) {
			return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
		},
		filter: function filter(array, term) {
			var matcher = new RegExp($.ui.autocomplete.escapeRegex(term), "i");
			return $.grep(array, function (value) {
				return matcher.test(value.label || value.value || value);
			});
		}
	});

	// Live region extension, adding a `messages` option
	// NOTE: This is an experimental API. We are still investigating
	// a full solution for string manipulation and internationalization.
	$.widget("ui.autocomplete", $.ui.autocomplete, {
		options: {
			messages: {
				noResults: "No search results.",
				results: function results(amount) {
					return amount + (amount > 1 ? " results are" : " result is") + " available, use up and down arrow keys to navigate.";
				}
			}
		},

		__response: function __response(content) {
			var message;
			this._superApply(arguments);
			if (this.options.disabled || this.cancelSearch) {
				return;
			}
			if (content && content.length) {
				message = this.options.messages.results(content.length);
			} else {
				message = this.options.messages.noResults;
			}
			this.liveRegion.children().hide();
			$("<div>").text(message).appendTo(this.liveRegion);
		}
	});

	var widgetsAutocomplete = $.ui.autocomplete;

	/*!
  * jQuery UI Controlgroup 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Controlgroup
	//>>group: Widgets
	//>>description: Visually groups form control widgets
	//>>docs: http://api.jqueryui.com/controlgroup/
	//>>demos: http://jqueryui.com/controlgroup/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/controlgroup.css
	//>>css.theme: ../../themes/base/theme.css


	var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;

	var widgetsControlgroup = $.widget("ui.controlgroup", {
		version: "1.12.1",
		defaultElement: "<div>",
		options: {
			direction: "horizontal",
			disabled: null,
			onlyVisible: true,
			items: {
				"button": "input[type=button], input[type=submit], input[type=reset], button, a",
				"controlgroupLabel": ".ui-controlgroup-label",
				"checkboxradio": "input[type='checkbox'], input[type='radio']",
				"selectmenu": "select",
				"spinner": ".ui-spinner-input"
			}
		},

		_create: function _create() {
			this._enhance();
		},

		// To support the enhanced option in jQuery Mobile, we isolate DOM manipulation
		_enhance: function _enhance() {
			this.element.attr("role", "toolbar");
			this.refresh();
		},

		_destroy: function _destroy() {
			this._callChildMethod("destroy");
			this.childWidgets.removeData("ui-controlgroup-data");
			this.element.removeAttr("role");
			if (this.options.items.controlgroupLabel) {
				this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap();
			}
		},

		_initWidgets: function _initWidgets() {
			var that = this,
			    childWidgets = [];

			// First we iterate over each of the items options
			$.each(this.options.items, function (widget, selector) {
				var labels;
				var options = {};

				// Make sure the widget has a selector set
				if (!selector) {
					return;
				}

				if (widget === "controlgroupLabel") {
					labels = that.element.find(selector);
					labels.each(function () {
						var element = $(this);

						if (element.children(".ui-controlgroup-label-contents").length) {
							return;
						}
						element.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>");
					});
					that._addClass(labels, null, "ui-widget ui-widget-content ui-state-default");
					childWidgets = childWidgets.concat(labels.get());
					return;
				}

				// Make sure the widget actually exists
				if (!$.fn[widget]) {
					return;
				}

				// We assume everything is in the middle to start because we can't determine
				// first / last elements until all enhancments are done.
				if (that["_" + widget + "Options"]) {
					options = that["_" + widget + "Options"]("middle");
				} else {
					options = { classes: {} };
				}

				// Find instances of this widget inside controlgroup and init them
				that.element.find(selector).each(function () {
					var element = $(this);
					var instance = element[widget]("instance");

					// We need to clone the default options for this type of widget to avoid
					// polluting the variable options which has a wider scope than a single widget.
					var instanceOptions = $.widget.extend({}, options);

					// If the button is the child of a spinner ignore it
					// TODO: Find a more generic solution
					if (widget === "button" && element.parent(".ui-spinner").length) {
						return;
					}

					// Create the widget if it doesn't exist
					if (!instance) {
						instance = element[widget]()[widget]("instance");
					}
					if (instance) {
						instanceOptions.classes = that._resolveClassesValues(instanceOptions.classes, instance);
					}
					element[widget](instanceOptions);

					// Store an instance of the controlgroup to be able to reference
					// from the outermost element for changing options and refresh
					var widgetElement = element[widget]("widget");
					$.data(widgetElement[0], "ui-controlgroup-data", instance ? instance : element[widget]("instance"));

					childWidgets.push(widgetElement[0]);
				});
			});

			this.childWidgets = $($.unique(childWidgets));
			this._addClass(this.childWidgets, "ui-controlgroup-item");
		},

		_callChildMethod: function _callChildMethod(method) {
			this.childWidgets.each(function () {
				var element = $(this),
				    data = element.data("ui-controlgroup-data");
				if (data && data[method]) {
					data[method]();
				}
			});
		},

		_updateCornerClass: function _updateCornerClass(element, position) {
			var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";
			var add = this._buildSimpleOptions(position, "label").classes.label;

			this._removeClass(element, null, remove);
			this._addClass(element, null, add);
		},

		_buildSimpleOptions: function _buildSimpleOptions(position, key) {
			var direction = this.options.direction === "vertical";
			var result = {
				classes: {}
			};
			result.classes[key] = {
				"middle": "",
				"first": "ui-corner-" + (direction ? "top" : "left"),
				"last": "ui-corner-" + (direction ? "bottom" : "right"),
				"only": "ui-corner-all"
			}[position];

			return result;
		},

		_spinnerOptions: function _spinnerOptions(position) {
			var options = this._buildSimpleOptions(position, "ui-spinner");

			options.classes["ui-spinner-up"] = "";
			options.classes["ui-spinner-down"] = "";

			return options;
		},

		_buttonOptions: function _buttonOptions(position) {
			return this._buildSimpleOptions(position, "ui-button");
		},

		_checkboxradioOptions: function _checkboxradioOptions(position) {
			return this._buildSimpleOptions(position, "ui-checkboxradio-label");
		},

		_selectmenuOptions: function _selectmenuOptions(position) {
			var direction = this.options.direction === "vertical";
			return {
				width: direction ? "auto" : false,
				classes: {
					middle: {
						"ui-selectmenu-button-open": "",
						"ui-selectmenu-button-closed": ""
					},
					first: {
						"ui-selectmenu-button-open": "ui-corner-" + (direction ? "top" : "tl"),
						"ui-selectmenu-button-closed": "ui-corner-" + (direction ? "top" : "left")
					},
					last: {
						"ui-selectmenu-button-open": direction ? "" : "ui-corner-tr",
						"ui-selectmenu-button-closed": "ui-corner-" + (direction ? "bottom" : "right")
					},
					only: {
						"ui-selectmenu-button-open": "ui-corner-top",
						"ui-selectmenu-button-closed": "ui-corner-all"
					}

				}[position]
			};
		},

		_resolveClassesValues: function _resolveClassesValues(classes, instance) {
			var result = {};
			$.each(classes, function (key) {
				var current = instance.options.classes[key] || "";
				current = $.trim(current.replace(controlgroupCornerRegex, ""));
				result[key] = (current + " " + classes[key]).replace(/\s+/g, " ");
			});
			return result;
		},

		_setOption: function _setOption(key, value) {
			if (key === "direction") {
				this._removeClass("ui-controlgroup-" + this.options.direction);
			}

			this._super(key, value);
			if (key === "disabled") {
				this._callChildMethod(value ? "disable" : "enable");
				return;
			}

			this.refresh();
		},

		refresh: function refresh() {
			var children,
			    that = this;

			this._addClass("ui-controlgroup ui-controlgroup-" + this.options.direction);

			if (this.options.direction === "horizontal") {
				this._addClass(null, "ui-helper-clearfix");
			}
			this._initWidgets();

			children = this.childWidgets;

			// We filter here because we need to track all childWidgets not just the visible ones
			if (this.options.onlyVisible) {
				children = children.filter(":visible");
			}

			if (children.length) {

				// We do this last because we need to make sure all enhancment is done
				// before determining first and last
				$.each(["first", "last"], function (index, value) {
					var instance = children[value]().data("ui-controlgroup-data");

					if (instance && that["_" + instance.widgetName + "Options"]) {
						var options = that["_" + instance.widgetName + "Options"](children.length === 1 ? "only" : value);
						options.classes = that._resolveClassesValues(options.classes, instance);
						instance.element[instance.widgetName](options);
					} else {
						that._updateCornerClass(children[value](), value);
					}
				});

				// Finally call the refresh method on each of the child widgets.
				this._callChildMethod("refresh");
			}
		}
	});

	/*!
  * jQuery UI Checkboxradio 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Checkboxradio
	//>>group: Widgets
	//>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
	//>>docs: http://api.jqueryui.com/checkboxradio/
	//>>demos: http://jqueryui.com/checkboxradio/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/button.css
	//>>css.structure: ../../themes/base/checkboxradio.css
	//>>css.theme: ../../themes/base/theme.css


	$.widget("ui.checkboxradio", [$.ui.formResetMixin, {
		version: "1.12.1",
		options: {
			disabled: null,
			label: null,
			icon: true,
			classes: {
				"ui-checkboxradio-label": "ui-corner-all",
				"ui-checkboxradio-icon": "ui-corner-all"
			}
		},

		_getCreateOptions: function _getCreateOptions() {
			var disabled, labels;
			var that = this;
			var options = this._super() || {};

			// We read the type here, because it makes more sense to throw a element type error first,
			// rather then the error for lack of a label. Often if its the wrong type, it
			// won't have a label (e.g. calling on a div, btn, etc)
			this._readType();

			labels = this.element.labels();

			// If there are multiple labels, use the last one
			this.label = $(labels[labels.length - 1]);
			if (!this.label.length) {
				$.error("No label found for checkboxradio widget");
			}

			this.originalLabel = "";

			// We need to get the label text but this may also need to make sure it does not contain the
			// input itself.
			this.label.contents().not(this.element[0]).each(function () {

				// The label contents could be text, html, or a mix. We concat each element to get a
				// string representation of the label, without the input as part of it.
				that.originalLabel += this.nodeType === 3 ? $(this).text() : this.outerHTML;
			});

			// Set the label option if we found label text
			if (this.originalLabel) {
				options.label = this.originalLabel;
			}

			disabled = this.element[0].disabled;
			if (disabled != null) {
				options.disabled = disabled;
			}
			return options;
		},

		_create: function _create() {
			var checked = this.element[0].checked;

			this._bindFormResetHandler();

			if (this.options.disabled == null) {
				this.options.disabled = this.element[0].disabled;
			}

			this._setOption("disabled", this.options.disabled);
			this._addClass("ui-checkboxradio", "ui-helper-hidden-accessible");
			this._addClass(this.label, "ui-checkboxradio-label", "ui-button ui-widget");

			if (this.type === "radio") {
				this._addClass(this.label, "ui-checkboxradio-radio-label");
			}

			if (this.options.label && this.options.label !== this.originalLabel) {
				this._updateLabel();
			} else if (this.originalLabel) {
				this.options.label = this.originalLabel;
			}

			this._enhance();

			if (checked) {
				this._addClass(this.label, "ui-checkboxradio-checked", "ui-state-active");
				if (this.icon) {
					this._addClass(this.icon, null, "ui-state-hover");
				}
			}

			this._on({
				change: "_toggleClasses",
				focus: function focus() {
					this._addClass(this.label, null, "ui-state-focus ui-visual-focus");
				},
				blur: function blur() {
					this._removeClass(this.label, null, "ui-state-focus ui-visual-focus");
				}
			});
		},

		_readType: function _readType() {
			var nodeName = this.element[0].nodeName.toLowerCase();
			this.type = this.element[0].type;
			if (nodeName !== "input" || !/radio|checkbox/.test(this.type)) {
				$.error("Can't create checkboxradio on element.nodeName=" + nodeName + " and element.type=" + this.type);
			}
		},

		// Support jQuery Mobile enhanced option
		_enhance: function _enhance() {
			this._updateIcon(this.element[0].checked);
		},

		widget: function widget() {
			return this.label;
		},

		_getRadioGroup: function _getRadioGroup() {
			var group;
			var name = this.element[0].name;
			var nameSelector = "input[name='" + $.ui.escapeSelector(name) + "']";

			if (!name) {
				return $([]);
			}

			if (this.form.length) {
				group = $(this.form[0].elements).filter(nameSelector);
			} else {

				// Not inside a form, check all inputs that also are not inside a form
				group = $(nameSelector).filter(function () {
					return $(this).form().length === 0;
				});
			}

			return group.not(this.element);
		},

		_toggleClasses: function _toggleClasses() {
			var checked = this.element[0].checked;
			this._toggleClass(this.label, "ui-checkboxradio-checked", "ui-state-active", checked);

			if (this.options.icon && this.type === "checkbox") {
				this._toggleClass(this.icon, null, "ui-icon-check ui-state-checked", checked)._toggleClass(this.icon, null, "ui-icon-blank", !checked);
			}

			if (this.type === "radio") {
				this._getRadioGroup().each(function () {
					var instance = $(this).checkboxradio("instance");

					if (instance) {
						instance._removeClass(instance.label, "ui-checkboxradio-checked", "ui-state-active");
					}
				});
			}
		},

		_destroy: function _destroy() {
			this._unbindFormResetHandler();

			if (this.icon) {
				this.icon.remove();
				this.iconSpace.remove();
			}
		},

		_setOption: function _setOption(key, value) {

			// We don't allow the value to be set to nothing
			if (key === "label" && !value) {
				return;
			}

			this._super(key, value);

			if (key === "disabled") {
				this._toggleClass(this.label, null, "ui-state-disabled", value);
				this.element[0].disabled = value;

				// Don't refresh when setting disabled
				return;
			}
			this.refresh();
		},

		_updateIcon: function _updateIcon(checked) {
			var toAdd = "ui-icon ui-icon-background ";

			if (this.options.icon) {
				if (!this.icon) {
					this.icon = $("<span>");
					this.iconSpace = $("<span> </span>");
					this._addClass(this.iconSpace, "ui-checkboxradio-icon-space");
				}

				if (this.type === "checkbox") {
					toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank";
					this._removeClass(this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check");
				} else {
					toAdd += "ui-icon-blank";
				}
				this._addClass(this.icon, "ui-checkboxradio-icon", toAdd);
				if (!checked) {
					this._removeClass(this.icon, null, "ui-icon-check ui-state-checked");
				}
				this.icon.prependTo(this.label).after(this.iconSpace);
			} else if (this.icon !== undefined) {
				this.icon.remove();
				this.iconSpace.remove();
				delete this.icon;
			}
		},

		_updateLabel: function _updateLabel() {

			// Remove the contents of the label ( minus the icon, icon space, and input )
			var contents = this.label.contents().not(this.element[0]);
			if (this.icon) {
				contents = contents.not(this.icon[0]);
			}
			if (this.iconSpace) {
				contents = contents.not(this.iconSpace[0]);
			}
			contents.remove();

			this.label.append(this.options.label);
		},

		refresh: function refresh() {
			var checked = this.element[0].checked,
			    isDisabled = this.element[0].disabled;

			this._updateIcon(checked);
			this._toggleClass(this.label, "ui-checkboxradio-checked", "ui-state-active", checked);
			if (this.options.label !== null) {
				this._updateLabel();
			}

			if (isDisabled !== this.options.disabled) {
				this._setOptions({ "disabled": isDisabled });
			}
		}

	}]);

	var widgetsCheckboxradio = $.ui.checkboxradio;

	/*!
  * jQuery UI Button 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Button
	//>>group: Widgets
	//>>description: Enhances a form with themeable buttons.
	//>>docs: http://api.jqueryui.com/button/
	//>>demos: http://jqueryui.com/button/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/button.css
	//>>css.theme: ../../themes/base/theme.css


	$.widget("ui.button", {
		version: "1.12.1",
		defaultElement: "<button>",
		options: {
			classes: {
				"ui-button": "ui-corner-all"
			},
			disabled: null,
			icon: null,
			iconPosition: "beginning",
			label: null,
			showLabel: true
		},

		_getCreateOptions: function _getCreateOptions() {
			var disabled,


			// This is to support cases like in jQuery Mobile where the base widget does have
			// an implementation of _getCreateOptions
			options = this._super() || {};

			this.isInput = this.element.is("input");

			disabled = this.element[0].disabled;
			if (disabled != null) {
				options.disabled = disabled;
			}

			this.originalLabel = this.isInput ? this.element.val() : this.element.html();
			if (this.originalLabel) {
				options.label = this.originalLabel;
			}

			return options;
		},

		_create: function _create() {
			if (!this.option.showLabel & !this.options.icon) {
				this.options.showLabel = true;
			}

			// We have to check the option again here even though we did in _getCreateOptions,
			// because null may have been passed on init which would override what was set in
			// _getCreateOptions
			if (this.options.disabled == null) {
				this.options.disabled = this.element[0].disabled || false;
			}

			this.hasTitle = !!this.element.attr("title");

			// Check to see if the label needs to be set or if its already correct
			if (this.options.label && this.options.label !== this.originalLabel) {
				if (this.isInput) {
					this.element.val(this.options.label);
				} else {
					this.element.html(this.options.label);
				}
			}
			this._addClass("ui-button", "ui-widget");
			this._setOption("disabled", this.options.disabled);
			this._enhance();

			if (this.element.is("a")) {
				this._on({
					"keyup": function keyup(event) {
						if (event.keyCode === $.ui.keyCode.SPACE) {
							event.preventDefault();

							// Support: PhantomJS <= 1.9, IE 8 Only
							// If a native click is available use it so we actually cause navigation
							// otherwise just trigger a click event
							if (this.element[0].click) {
								this.element[0].click();
							} else {
								this.element.trigger("click");
							}
						}
					}
				});
			}
		},

		_enhance: function _enhance() {
			if (!this.element.is("button")) {
				this.element.attr("role", "button");
			}

			if (this.options.icon) {
				this._updateIcon("icon", this.options.icon);
				this._updateTooltip();
			}
		},

		_updateTooltip: function _updateTooltip() {
			this.title = this.element.attr("title");

			if (!this.options.showLabel && !this.title) {
				this.element.attr("title", this.options.label);
			}
		},

		_updateIcon: function _updateIcon(option, value) {
			var icon = option !== "iconPosition",
			    position = icon ? this.options.iconPosition : value,
			    displayBlock = position === "top" || position === "bottom";

			// Create icon
			if (!this.icon) {
				this.icon = $("<span>");

				this._addClass(this.icon, "ui-button-icon", "ui-icon");

				if (!this.options.showLabel) {
					this._addClass("ui-button-icon-only");
				}
			} else if (icon) {

				// If we are updating the icon remove the old icon class
				this._removeClass(this.icon, null, this.options.icon);
			}

			// If we are updating the icon add the new icon class
			if (icon) {
				this._addClass(this.icon, null, value);
			}

			this._attachIcon(position);

			// If the icon is on top or bottom we need to add the ui-widget-icon-block class and remove
			// the iconSpace if there is one.
			if (displayBlock) {
				this._addClass(this.icon, null, "ui-widget-icon-block");
				if (this.iconSpace) {
					this.iconSpace.remove();
				}
			} else {

				// Position is beginning or end so remove the ui-widget-icon-block class and add the
				// space if it does not exist
				if (!this.iconSpace) {
					this.iconSpace = $("<span> </span>");
					this._addClass(this.iconSpace, "ui-button-icon-space");
				}
				this._removeClass(this.icon, null, "ui-wiget-icon-block");
				this._attachIconSpace(position);
			}
		},

		_destroy: function _destroy() {
			this.element.removeAttr("role");

			if (this.icon) {
				this.icon.remove();
			}
			if (this.iconSpace) {
				this.iconSpace.remove();
			}
			if (!this.hasTitle) {
				this.element.removeAttr("title");
			}
		},

		_attachIconSpace: function _attachIconSpace(iconPosition) {
			this.icon[/^(?:end|bottom)/.test(iconPosition) ? "before" : "after"](this.iconSpace);
		},

		_attachIcon: function _attachIcon(iconPosition) {
			this.element[/^(?:end|bottom)/.test(iconPosition) ? "append" : "prepend"](this.icon);
		},

		_setOptions: function _setOptions(options) {
			var newShowLabel = options.showLabel === undefined ? this.options.showLabel : options.showLabel,
			    newIcon = options.icon === undefined ? this.options.icon : options.icon;

			if (!newShowLabel && !newIcon) {
				options.showLabel = true;
			}
			this._super(options);
		},

		_setOption: function _setOption(key, value) {
			if (key === "icon") {
				if (value) {
					this._updateIcon(key, value);
				} else if (this.icon) {
					this.icon.remove();
					if (this.iconSpace) {
						this.iconSpace.remove();
					}
				}
			}

			if (key === "iconPosition") {
				this._updateIcon(key, value);
			}

			// Make sure we can't end up with a button that has neither text nor icon
			if (key === "showLabel") {
				this._toggleClass("ui-button-icon-only", null, !value);
				this._updateTooltip();
			}

			if (key === "label") {
				if (this.isInput) {
					this.element.val(value);
				} else {

					// If there is an icon, append it, else nothing then append the value
					// this avoids removal of the icon when setting label text
					this.element.html(value);
					if (this.icon) {
						this._attachIcon(this.options.iconPosition);
						this._attachIconSpace(this.options.iconPosition);
					}
				}
			}

			this._super(key, value);

			if (key === "disabled") {
				this._toggleClass(null, "ui-state-disabled", value);
				this.element[0].disabled = value;
				if (value) {
					this.element.blur();
				}
			}
		},

		refresh: function refresh() {

			// Make sure to only check disabled if its an element that supports this otherwise
			// check for the disabled class to determine state
			var isDisabled = this.element.is("input, button") ? this.element[0].disabled : this.element.hasClass("ui-button-disabled");

			if (isDisabled !== this.options.disabled) {
				this._setOptions({ disabled: isDisabled });
			}

			this._updateTooltip();
		}
	});

	// DEPRECATED
	if ($.uiBackCompat !== false) {

		// Text and Icons options
		$.widget("ui.button", $.ui.button, {
			options: {
				text: true,
				icons: {
					primary: null,
					secondary: null
				}
			},

			_create: function _create() {
				if (this.options.showLabel && !this.options.text) {
					this.options.showLabel = this.options.text;
				}
				if (!this.options.showLabel && this.options.text) {
					this.options.text = this.options.showLabel;
				}
				if (!this.options.icon && (this.options.icons.primary || this.options.icons.secondary)) {
					if (this.options.icons.primary) {
						this.options.icon = this.options.icons.primary;
					} else {
						this.options.icon = this.options.icons.secondary;
						this.options.iconPosition = "end";
					}
				} else if (this.options.icon) {
					this.options.icons.primary = this.options.icon;
				}
				this._super();
			},

			_setOption: function _setOption(key, value) {
				if (key === "text") {
					this._super("showLabel", value);
					return;
				}
				if (key === "showLabel") {
					this.options.text = value;
				}
				if (key === "icon") {
					this.options.icons.primary = value;
				}
				if (key === "icons") {
					if (value.primary) {
						this._super("icon", value.primary);
						this._super("iconPosition", "beginning");
					} else if (value.secondary) {
						this._super("icon", value.secondary);
						this._super("iconPosition", "end");
					}
				}
				this._superApply(arguments);
			}
		});

		$.fn.button = function (orig) {
			return function () {
				if (!this.length || this.length && this[0].tagName !== "INPUT" || this.length && this[0].tagName === "INPUT" && this.attr("type") !== "checkbox" && this.attr("type") !== "radio") {
					return orig.apply(this, arguments);
				}
				if (!$.ui.checkboxradio) {
					$.error("Checkboxradio widget missing");
				}
				if (arguments.length === 0) {
					return this.checkboxradio({
						"icon": false
					});
				}
				return this.checkboxradio.apply(this, arguments);
			};
		}($.fn.button);

		$.fn.buttonset = function () {
			if (!$.ui.controlgroup) {
				$.error("Controlgroup widget missing");
			}
			if (arguments[0] === "option" && arguments[1] === "items" && arguments[2]) {
				return this.controlgroup.apply(this, [arguments[0], "items.button", arguments[2]]);
			}
			if (arguments[0] === "option" && arguments[1] === "items") {
				return this.controlgroup.apply(this, [arguments[0], "items.button"]);
			}
			if (_typeof(arguments[0]) === "object" && arguments[0].items) {
				arguments[0].items = {
					button: arguments[0].items
				};
			}
			return this.controlgroup.apply(this, arguments);
		};
	}

	var widgetsButton = $.ui.button;

	// jscs:disable maximumLineLength
	/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
	/*!
  * jQuery UI Datepicker 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Datepicker
	//>>group: Widgets
	//>>description: Displays a calendar from an input or inline for selecting dates.
	//>>docs: http://api.jqueryui.com/datepicker/
	//>>demos: http://jqueryui.com/datepicker/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/datepicker.css
	//>>css.theme: ../../themes/base/theme.css


	$.extend($.ui, { datepicker: { version: "1.12.1" } });

	var datepicker_instActive;

	function datepicker_getZindex(elem) {
		var position, value;
		while (elem.length && elem[0] !== document) {

			// Ignore z-index if position is set to a value where z-index is ignored by the browser
			// This makes behavior of this function consistent across browsers
			// WebKit always returns auto if the element is positioned
			position = elem.css("position");
			if (position === "absolute" || position === "relative" || position === "fixed") {

				// IE returns 0 when zIndex is not specified
				// other browsers return a string
				// we ignore the case of nested elements with an explicit value of 0
				// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
				value = parseInt(elem.css("zIndex"), 10);
				if (!isNaN(value) && value !== 0) {
					return value;
				}
			}
			elem = elem.parent();
		}

		return 0;
	}
	/* Date picker manager.
    Use the singleton instance of this class, $.datepicker, to interact with the date picker.
    Settings for (groups of) date pickers are maintained in an instance object,
    allowing multiple different settings on the same page. */

	function Datepicker() {
		this._curInst = null; // The current instance in use
		this._keyEvent = false; // If the last event was a key event
		this._disabledInputs = []; // List of date picker inputs that have been disabled
		this._datepickerShowing = false; // True if the popup picker is showing , false if not
		this._inDialog = false; // True if showing within a "dialog", false if not
		this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
		this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
		this._appendClass = "ui-datepicker-append"; // The name of the append marker class
		this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
		this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
		this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
		this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
		this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
		this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
		this.regional = []; // Available regional settings, indexed by language code
		this.regional[""] = { // Default regional settings
			closeText: "Done", // Display text for close link
			prevText: "Prev", // Display text for previous month link
			nextText: "Next", // Display text for next month link
			currentText: "Today", // Display text for current month link
			monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], // Names of months for drop-down and formatting
			monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
			dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
			dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
			dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], // Column headings for days starting at Sunday
			weekHeader: "Wk", // Column header for week of the year
			dateFormat: "mm/dd/yy", // See format options on parseDate
			firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
			isRTL: false, // True if right-to-left language, false if left-to-right
			showMonthAfterYear: false, // True if the year select precedes month, false for month then year
			yearSuffix: "" // Additional text to append to the year in the month headers
		};
		this._defaults = { // Global defaults for all the date picker instances
			showOn: "focus", // "focus" for popup on focus,
			// "button" for trigger button, or "both" for either
			showAnim: "fadeIn", // Name of jQuery animation for popup
			showOptions: {}, // Options for enhanced animations
			defaultDate: null, // Used when field is blank: actual date,
			// +/-number for offset from today, null for today
			appendText: "", // Display text following the input box, e.g. showing the format
			buttonText: "...", // Text for trigger button
			buttonImage: "", // URL for trigger button image
			buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
			hideIfNoPrevNext: false, // True to hide next/previous month links
			// if not applicable, false to just disable them
			navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
			gotoCurrent: false, // True if today link goes back to current selection instead
			changeMonth: false, // True if month can be selected directly, false if only prev/next
			changeYear: false, // True if year can be selected directly, false if only prev/next
			yearRange: "c-10:c+10", // Range of years to display in drop-down,
			// either relative to today's year (-nn:+nn), relative to currently displayed year
			// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
			showOtherMonths: false, // True to show dates in other months, false to leave blank
			selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
			showWeek: false, // True to show week of the year, false to not show it
			calculateWeek: this.iso8601Week, // How to calculate the week of the year,
			// takes a Date and returns the number of the week for it
			shortYearCutoff: "+10", // Short year values < this are in the current century,
			// > this are in the previous century,
			// string value starting with "+" for current year + value
			minDate: null, // The earliest selectable date, or null for no limit
			maxDate: null, // The latest selectable date, or null for no limit
			duration: "fast", // Duration of display/closure
			beforeShowDay: null, // Function that takes a date and returns an array with
			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
			beforeShow: null, // Function that takes an input field and
			// returns a set of custom settings for the date picker
			onSelect: null, // Define a callback function when a date is selected
			onChangeMonthYear: null, // Define a callback function when the month or year is changed
			onClose: null, // Define a callback function when the datepicker is closed
			numberOfMonths: 1, // Number of months to show at a time
			showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
			stepMonths: 1, // Number of months to step back/forward
			stepBigMonths: 12, // Number of months to step back/forward for the big links
			altField: "", // Selector for an alternate field to store selected dates into
			altFormat: "", // The date format to use for the alternate field
			constrainInput: true, // The input is constrained by the current date format
			showButtonPanel: false, // True to show button panel, false to not show it
			autoSize: false, // True to size the input for the date format, false to leave as is
			disabled: false // The initial disabled state
		};
		$.extend(this._defaults, this.regional[""]);
		this.regional.en = $.extend(true, {}, this.regional[""]);
		this.regional["en-US"] = $.extend(true, {}, this.regional.en);
		this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
	}

	$.extend(Datepicker.prototype, {
		/* Class name added to elements to indicate already configured with a date picker. */
		markerClassName: "hasDatepicker",

		//Keep track of the maximum number of rows displayed (see #7043)
		maxRows: 4,

		// TODO rename to "widget" when switching to widget factory
		_widgetDatepicker: function _widgetDatepicker() {
			return this.dpDiv;
		},

		/* Override the default settings for all instances of the date picker.
   * @param  settings  object - the new settings to use as defaults (anonymous object)
   * @return the manager object
   */
		setDefaults: function setDefaults(settings) {
			datepicker_extendRemove(this._defaults, settings || {});
			return this;
		},

		/* Attach the date picker to a jQuery selection.
   * @param  target	element - the target input field or division or span
   * @param  settings  object - the new settings to use for this date picker instance (anonymous)
   */
		_attachDatepicker: function _attachDatepicker(target, settings) {
			var nodeName, inline, inst;
			nodeName = target.nodeName.toLowerCase();
			inline = nodeName === "div" || nodeName === "span";
			if (!target.id) {
				this.uuid += 1;
				target.id = "dp" + this.uuid;
			}
			inst = this._newInst($(target), inline);
			inst.settings = $.extend({}, settings || {});
			if (nodeName === "input") {
				this._connectDatepicker(target, inst);
			} else if (inline) {
				this._inlineDatepicker(target, inst);
			}
		},

		/* Create a new instance object. */
		_newInst: function _newInst(target, inline) {
			var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
			return { id: id, input: target, // associated target
				selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
				drawMonth: 0, drawYear: 0, // month being drawn
				inline: inline, // is datepicker inline or not
				dpDiv: !inline ? this.dpDiv : // presentation div
				datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")) };
		},

		/* Attach the date picker to an input field. */
		_connectDatepicker: function _connectDatepicker(target, inst) {
			var input = $(target);
			inst.append = $([]);
			inst.trigger = $([]);
			if (input.hasClass(this.markerClassName)) {
				return;
			}
			this._attachments(input, inst);
			input.addClass(this.markerClassName).on("keydown", this._doKeyDown).on("keypress", this._doKeyPress).on("keyup", this._doKeyUp);
			this._autoSize(inst);
			$.data(target, "datepicker", inst);

			//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
			if (inst.settings.disabled) {
				this._disableDatepicker(target);
			}
		},

		/* Make attachments based on settings. */
		_attachments: function _attachments(input, inst) {
			var showOn,
			    buttonText,
			    buttonImage,
			    appendText = this._get(inst, "appendText"),
			    isRTL = this._get(inst, "isRTL");

			if (inst.append) {
				inst.append.remove();
			}
			if (appendText) {
				inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
				input[isRTL ? "before" : "after"](inst.append);
			}

			input.off("focus", this._showDatepicker);

			if (inst.trigger) {
				inst.trigger.remove();
			}

			showOn = this._get(inst, "showOn");
			if (showOn === "focus" || showOn === "both") {
				// pop-up date picker when in the marked field
				input.on("focus", this._showDatepicker);
			}
			if (showOn === "button" || showOn === "both") {
				// pop-up date picker when button clicked
				buttonText = this._get(inst, "buttonText");
				buttonImage = this._get(inst, "buttonImage");
				inst.trigger = $(this._get(inst, "buttonImageOnly") ? $("<img/>").addClass(this._triggerClass).attr({ src: buttonImage, alt: buttonText, title: buttonText }) : $("<button type='button'></button>").addClass(this._triggerClass).html(!buttonImage ? buttonText : $("<img/>").attr({ src: buttonImage, alt: buttonText, title: buttonText })));
				input[isRTL ? "before" : "after"](inst.trigger);
				inst.trigger.on("click", function () {
					if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
						$.datepicker._hideDatepicker();
					} else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
						$.datepicker._hideDatepicker();
						$.datepicker._showDatepicker(input[0]);
					} else {
						$.datepicker._showDatepicker(input[0]);
					}
					return false;
				});
			}
		},

		/* Apply the maximum length for the date format. */
		_autoSize: function _autoSize(inst) {
			if (this._get(inst, "autoSize") && !inst.inline) {
				var findMax,
				    max,
				    maxI,
				    i,
				    date = new Date(2009, 12 - 1, 20),
				    // Ensure double digits
				dateFormat = this._get(inst, "dateFormat");

				if (dateFormat.match(/[DM]/)) {
					findMax = function findMax(names) {
						max = 0;
						maxI = 0;
						for (i = 0; i < names.length; i++) {
							if (names[i].length > max) {
								max = names[i].length;
								maxI = i;
							}
						}
						return maxI;
					};
					date.setMonth(findMax(this._get(inst, dateFormat.match(/MM/) ? "monthNames" : "monthNamesShort")));
					date.setDate(findMax(this._get(inst, dateFormat.match(/DD/) ? "dayNames" : "dayNamesShort")) + 20 - date.getDay());
				}
				inst.input.attr("size", this._formatDate(inst, date).length);
			}
		},

		/* Attach an inline date picker to a div. */
		_inlineDatepicker: function _inlineDatepicker(target, inst) {
			var divSpan = $(target);
			if (divSpan.hasClass(this.markerClassName)) {
				return;
			}
			divSpan.addClass(this.markerClassName).append(inst.dpDiv);
			$.data(target, "datepicker", inst);
			this._setDate(inst, this._getDefaultDate(inst), true);
			this._updateDatepicker(inst);
			this._updateAlternate(inst);

			//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
			if (inst.settings.disabled) {
				this._disableDatepicker(target);
			}

			// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
			// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
			inst.dpDiv.css("display", "block");
		},

		/* Pop-up the date picker in a "dialog" box.
   * @param  input element - ignored
   * @param  date	string or Date - the initial date to display
   * @param  onSelect  function - the function to call when a date is selected
   * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
   * @param  pos int[2] - coordinates for the dialog's position within the screen or
   *					event - with x/y coordinates or
   *					leave empty for default (screen centre)
   * @return the manager object
   */
		_dialogDatepicker: function _dialogDatepicker(input, date, onSelect, settings, pos) {
			var id,
			    browserWidth,
			    browserHeight,
			    scrollX,
			    scrollY,
			    inst = this._dialogInst; // internal instance

			if (!inst) {
				this.uuid += 1;
				id = "dp" + this.uuid;
				this._dialogInput = $("<input type='text' id='" + id + "' style='position: absolute; top: -100px; width: 0px;'/>");
				this._dialogInput.on("keydown", this._doKeyDown);
				$("body").append(this._dialogInput);
				inst = this._dialogInst = this._newInst(this._dialogInput, false);
				inst.settings = {};
				$.data(this._dialogInput[0], "datepicker", inst);
			}
			datepicker_extendRemove(inst.settings, settings || {});
			date = date && date.constructor === Date ? this._formatDate(inst, date) : date;
			this._dialogInput.val(date);

			this._pos = pos ? pos.length ? pos : [pos.pageX, pos.pageY] : null;
			if (!this._pos) {
				browserWidth = document.documentElement.clientWidth;
				browserHeight = document.documentElement.clientHeight;
				scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
				scrollY = document.documentElement.scrollTop || document.body.scrollTop;
				this._pos = // should use actual width/height below
				[browserWidth / 2 - 100 + scrollX, browserHeight / 2 - 150 + scrollY];
			}

			// Move input on screen for focus, but hidden behind dialog
			this._dialogInput.css("left", this._pos[0] + 20 + "px").css("top", this._pos[1] + "px");
			inst.settings.onSelect = onSelect;
			this._inDialog = true;
			this.dpDiv.addClass(this._dialogClass);
			this._showDatepicker(this._dialogInput[0]);
			if ($.blockUI) {
				$.blockUI(this.dpDiv);
			}
			$.data(this._dialogInput[0], "datepicker", inst);
			return this;
		},

		/* Detach a datepicker from its control.
   * @param  target	element - the target input field or division or span
   */
		_destroyDatepicker: function _destroyDatepicker(target) {
			var nodeName,
			    $target = $(target),
			    inst = $.data(target, "datepicker");

			if (!$target.hasClass(this.markerClassName)) {
				return;
			}

			nodeName = target.nodeName.toLowerCase();
			$.removeData(target, "datepicker");
			if (nodeName === "input") {
				inst.append.remove();
				inst.trigger.remove();
				$target.removeClass(this.markerClassName).off("focus", this._showDatepicker).off("keydown", this._doKeyDown).off("keypress", this._doKeyPress).off("keyup", this._doKeyUp);
			} else if (nodeName === "div" || nodeName === "span") {
				$target.removeClass(this.markerClassName).empty();
			}

			if (datepicker_instActive === inst) {
				datepicker_instActive = null;
			}
		},

		/* Enable the date picker to a jQuery selection.
   * @param  target	element - the target input field or division or span
   */
		_enableDatepicker: function _enableDatepicker(target) {
			var nodeName,
			    inline,
			    $target = $(target),
			    inst = $.data(target, "datepicker");

			if (!$target.hasClass(this.markerClassName)) {
				return;
			}

			nodeName = target.nodeName.toLowerCase();
			if (nodeName === "input") {
				target.disabled = false;
				inst.trigger.filter("button").each(function () {
					this.disabled = false;
				}).end().filter("img").css({ opacity: "1.0", cursor: "" });
			} else if (nodeName === "div" || nodeName === "span") {
				inline = $target.children("." + this._inlineClass);
				inline.children().removeClass("ui-state-disabled");
				inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", false);
			}
			this._disabledInputs = $.map(this._disabledInputs, function (value) {
				return value === target ? null : value;
			}); // delete entry
		},

		/* Disable the date picker to a jQuery selection.
   * @param  target	element - the target input field or division or span
   */
		_disableDatepicker: function _disableDatepicker(target) {
			var nodeName,
			    inline,
			    $target = $(target),
			    inst = $.data(target, "datepicker");

			if (!$target.hasClass(this.markerClassName)) {
				return;
			}

			nodeName = target.nodeName.toLowerCase();
			if (nodeName === "input") {
				target.disabled = true;
				inst.trigger.filter("button").each(function () {
					this.disabled = true;
				}).end().filter("img").css({ opacity: "0.5", cursor: "default" });
			} else if (nodeName === "div" || nodeName === "span") {
				inline = $target.children("." + this._inlineClass);
				inline.children().addClass("ui-state-disabled");
				inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", true);
			}
			this._disabledInputs = $.map(this._disabledInputs, function (value) {
				return value === target ? null : value;
			}); // delete entry
			this._disabledInputs[this._disabledInputs.length] = target;
		},

		/* Is the first field in a jQuery collection disabled as a datepicker?
   * @param  target	element - the target input field or division or span
   * @return boolean - true if disabled, false if enabled
   */
		_isDisabledDatepicker: function _isDisabledDatepicker(target) {
			if (!target) {
				return false;
			}
			for (var i = 0; i < this._disabledInputs.length; i++) {
				if (this._disabledInputs[i] === target) {
					return true;
				}
			}
			return false;
		},

		/* Retrieve the instance data for the target control.
   * @param  target  element - the target input field or division or span
   * @return  object - the associated instance data
   * @throws  error if a jQuery problem getting data
   */
		_getInst: function _getInst(target) {
			try {
				return $.data(target, "datepicker");
			} catch (err) {
				throw "Missing instance data for this datepicker";
			}
		},

		/* Update or retrieve the settings for a date picker attached to an input field or division.
   * @param  target  element - the target input field or division or span
   * @param  name	object - the new settings to update or
   *				string - the name of the setting to change or retrieve,
   *				when retrieving also "all" for all instance settings or
   *				"defaults" for all global defaults
   * @param  value   any - the new value for the setting
   *				(omit if above is an object or to retrieve a value)
   */
		_optionDatepicker: function _optionDatepicker(target, name, value) {
			var settings,
			    date,
			    minDate,
			    maxDate,
			    inst = this._getInst(target);

			if (arguments.length === 2 && typeof name === "string") {
				return name === "defaults" ? $.extend({}, $.datepicker._defaults) : inst ? name === "all" ? $.extend({}, inst.settings) : this._get(inst, name) : null;
			}

			settings = name || {};
			if (typeof name === "string") {
				settings = {};
				settings[name] = value;
			}

			if (inst) {
				if (this._curInst === inst) {
					this._hideDatepicker();
				}

				date = this._getDateDatepicker(target, true);
				minDate = this._getMinMaxDate(inst, "min");
				maxDate = this._getMinMaxDate(inst, "max");
				datepicker_extendRemove(inst.settings, settings);

				// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
				if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
					inst.settings.minDate = this._formatDate(inst, minDate);
				}
				if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
					inst.settings.maxDate = this._formatDate(inst, maxDate);
				}
				if ("disabled" in settings) {
					if (settings.disabled) {
						this._disableDatepicker(target);
					} else {
						this._enableDatepicker(target);
					}
				}
				this._attachments($(target), inst);
				this._autoSize(inst);
				this._setDate(inst, date);
				this._updateAlternate(inst);
				this._updateDatepicker(inst);
			}
		},

		// Change method deprecated
		_changeDatepicker: function _changeDatepicker(target, name, value) {
			this._optionDatepicker(target, name, value);
		},

		/* Redraw the date picker attached to an input field or division.
   * @param  target  element - the target input field or division or span
   */
		_refreshDatepicker: function _refreshDatepicker(target) {
			var inst = this._getInst(target);
			if (inst) {
				this._updateDatepicker(inst);
			}
		},

		/* Set the dates for a jQuery selection.
   * @param  target element - the target input field or division or span
   * @param  date	Date - the new date
   */
		_setDateDatepicker: function _setDateDatepicker(target, date) {
			var inst = this._getInst(target);
			if (inst) {
				this._setDate(inst, date);
				this._updateDatepicker(inst);
				this._updateAlternate(inst);
			}
		},

		/* Get the date(s) for the first entry in a jQuery selection.
   * @param  target element - the target input field or division or span
   * @param  noDefault boolean - true if no default date is to be used
   * @return Date - the current date
   */
		_getDateDatepicker: function _getDateDatepicker(target, noDefault) {
			var inst = this._getInst(target);
			if (inst && !inst.inline) {
				this._setDateFromField(inst, noDefault);
			}
			return inst ? this._getDate(inst) : null;
		},

		/* Handle keystrokes. */
		_doKeyDown: function _doKeyDown(event) {
			var onSelect,
			    dateStr,
			    sel,
			    inst = $.datepicker._getInst(event.target),
			    handled = true,
			    isRTL = inst.dpDiv.is(".ui-datepicker-rtl");

			inst._keyEvent = true;
			if ($.datepicker._datepickerShowing) {
				switch (event.keyCode) {
					case 9:
						$.datepicker._hideDatepicker();
						handled = false;
						break; // hide on tab out
					case 13:
						sel = $("td." + $.datepicker._dayOverClass + ":not(." + $.datepicker._currentClass + ")", inst.dpDiv);
						if (sel[0]) {
							$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
						}

						onSelect = $.datepicker._get(inst, "onSelect");
						if (onSelect) {
							dateStr = $.datepicker._formatDate(inst);

							// Trigger custom callback
							onSelect.apply(inst.input ? inst.input[0] : null, [dateStr, inst]);
						} else {
							$.datepicker._hideDatepicker();
						}

						return false; // don't submit the form
					case 27:
						$.datepicker._hideDatepicker();
						break; // hide on escape
					case 33:
						$.datepicker._adjustDate(event.target, event.ctrlKey ? -$.datepicker._get(inst, "stepBigMonths") : -$.datepicker._get(inst, "stepMonths"), "M");
						break; // previous month/year on page up/+ ctrl
					case 34:
						$.datepicker._adjustDate(event.target, event.ctrlKey ? +$.datepicker._get(inst, "stepBigMonths") : +$.datepicker._get(inst, "stepMonths"), "M");
						break; // next month/year on page down/+ ctrl
					case 35:
						if (event.ctrlKey || event.metaKey) {
							$.datepicker._clearDate(event.target);
						}
						handled = event.ctrlKey || event.metaKey;
						break; // clear on ctrl or command +end
					case 36:
						if (event.ctrlKey || event.metaKey) {
							$.datepicker._gotoToday(event.target);
						}
						handled = event.ctrlKey || event.metaKey;
						break; // current on ctrl or command +home
					case 37:
						if (event.ctrlKey || event.metaKey) {
							$.datepicker._adjustDate(event.target, isRTL ? +1 : -1, "D");
						}
						handled = event.ctrlKey || event.metaKey;

						// -1 day on ctrl or command +left
						if (event.originalEvent.altKey) {
							$.datepicker._adjustDate(event.target, event.ctrlKey ? -$.datepicker._get(inst, "stepBigMonths") : -$.datepicker._get(inst, "stepMonths"), "M");
						}

						// next month/year on alt +left on Mac
						break;
					case 38:
						if (event.ctrlKey || event.metaKey) {
							$.datepicker._adjustDate(event.target, -7, "D");
						}
						handled = event.ctrlKey || event.metaKey;
						break; // -1 week on ctrl or command +up
					case 39:
						if (event.ctrlKey || event.metaKey) {
							$.datepicker._adjustDate(event.target, isRTL ? -1 : +1, "D");
						}
						handled = event.ctrlKey || event.metaKey;

						// +1 day on ctrl or command +right
						if (event.originalEvent.altKey) {
							$.datepicker._adjustDate(event.target, event.ctrlKey ? +$.datepicker._get(inst, "stepBigMonths") : +$.datepicker._get(inst, "stepMonths"), "M");
						}

						// next month/year on alt +right
						break;
					case 40:
						if (event.ctrlKey || event.metaKey) {
							$.datepicker._adjustDate(event.target, +7, "D");
						}
						handled = event.ctrlKey || event.metaKey;
						break; // +1 week on ctrl or command +down
					default:
						handled = false;
				}
			} else if (event.keyCode === 36 && event.ctrlKey) {
				// display the date picker on ctrl+home
				$.datepicker._showDatepicker(this);
			} else {
				handled = false;
			}

			if (handled) {
				event.preventDefault();
				event.stopPropagation();
			}
		},

		/* Filter entered characters - based on date format. */
		_doKeyPress: function _doKeyPress(event) {
			var chars,
			    chr,
			    inst = $.datepicker._getInst(event.target);

			if ($.datepicker._get(inst, "constrainInput")) {
				chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
				chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
				return event.ctrlKey || event.metaKey || chr < " " || !chars || chars.indexOf(chr) > -1;
			}
		},

		/* Synchronise manual entry and field/alternate field. */
		_doKeyUp: function _doKeyUp(event) {
			var date,
			    inst = $.datepicker._getInst(event.target);

			if (inst.input.val() !== inst.lastVal) {
				try {
					date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), inst.input ? inst.input.val() : null, $.datepicker._getFormatConfig(inst));

					if (date) {
						// only if valid
						$.datepicker._setDateFromField(inst);
						$.datepicker._updateAlternate(inst);
						$.datepicker._updateDatepicker(inst);
					}
				} catch (err) {}
			}
			return true;
		},

		/* Pop-up the date picker for a given input field.
   * If false returned from beforeShow event handler do not show.
   * @param  input  element - the input field attached to the date picker or
   *					event - if triggered by focus
   */
		_showDatepicker: function _showDatepicker(input) {
			input = input.target || input;
			if (input.nodeName.toLowerCase() !== "input") {
				// find from button/image trigger
				input = $("input", input.parentNode)[0];
			}

			if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) {
				// already here
				return;
			}

			var inst, beforeShow, beforeShowSettings, isFixed, offset, showAnim, duration;

			inst = $.datepicker._getInst(input);
			if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
				$.datepicker._curInst.dpDiv.stop(true, true);
				if (inst && $.datepicker._datepickerShowing) {
					$.datepicker._hideDatepicker($.datepicker._curInst.input[0]);
				}
			}

			beforeShow = $.datepicker._get(inst, "beforeShow");
			beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
			if (beforeShowSettings === false) {
				return;
			}
			datepicker_extendRemove(inst.settings, beforeShowSettings);

			inst.lastVal = null;
			$.datepicker._lastInput = input;
			$.datepicker._setDateFromField(inst);

			if ($.datepicker._inDialog) {
				// hide cursor
				input.value = "";
			}
			if (!$.datepicker._pos) {
				// position below input
				$.datepicker._pos = $.datepicker._findPos(input);
				$.datepicker._pos[1] += input.offsetHeight; // add the height
			}

			isFixed = false;
			$(input).parents().each(function () {
				isFixed |= $(this).css("position") === "fixed";
				return !isFixed;
			});

			offset = { left: $.datepicker._pos[0], top: $.datepicker._pos[1] };
			$.datepicker._pos = null;

			//to avoid flashes on Firefox
			inst.dpDiv.empty();

			// determine sizing offscreen
			inst.dpDiv.css({ position: "absolute", display: "block", top: "-1000px" });
			$.datepicker._updateDatepicker(inst);

			// fix width for dynamic number of date pickers
			// and adjust position before showing
			offset = $.datepicker._checkOffset(inst, offset, isFixed);
			inst.dpDiv.css({ position: $.datepicker._inDialog && $.blockUI ? "static" : isFixed ? "fixed" : "absolute", display: "none",
				left: offset.left + "px", top: offset.top + "px" });

			if (!inst.inline) {
				showAnim = $.datepicker._get(inst, "showAnim");
				duration = $.datepicker._get(inst, "duration");
				inst.dpDiv.css("z-index", datepicker_getZindex($(input)) + 1);
				$.datepicker._datepickerShowing = true;

				if ($.effects && $.effects.effect[showAnim]) {
					inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
				} else {
					inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
				}

				if ($.datepicker._shouldFocusInput(inst)) {
					inst.input.trigger("focus");
				}

				$.datepicker._curInst = inst;
			}
		},

		/* Generate the date picker content. */
		_updateDatepicker: function _updateDatepicker(inst) {
			this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
			datepicker_instActive = inst; // for delegate hover events
			inst.dpDiv.empty().append(this._generateHTML(inst));
			this._attachHandlers(inst);

			var origyearshtml,
			    numMonths = this._getNumberOfMonths(inst),
			    cols = numMonths[1],
			    width = 17,
			    activeCell = inst.dpDiv.find("." + this._dayOverClass + " a");

			if (activeCell.length > 0) {
				datepicker_handleMouseover.apply(activeCell.get(0));
			}

			inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
			if (cols > 1) {
				inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", width * cols + "em");
			}
			inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") + "Class"]("ui-datepicker-multi");
			inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl");

			if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput(inst)) {
				inst.input.trigger("focus");
			}

			// Deffered render of the years select (to avoid flashes on Firefox)
			if (inst.yearshtml) {
				origyearshtml = inst.yearshtml;
				setTimeout(function () {

					//assure that inst.yearshtml didn't change.
					if (origyearshtml === inst.yearshtml && inst.yearshtml) {
						inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
					}
					origyearshtml = inst.yearshtml = null;
				}, 0);
			}
		},

		// #6694 - don't focus the input if it's already focused
		// this breaks the change event in IE
		// Support: IE and jQuery <1.9
		_shouldFocusInput: function _shouldFocusInput(inst) {
			return inst.input && inst.input.is(":visible") && !inst.input.is(":disabled") && !inst.input.is(":focus");
		},

		/* Check positioning to remain on screen. */
		_checkOffset: function _checkOffset(inst, offset, isFixed) {
			var dpWidth = inst.dpDiv.outerWidth(),
			    dpHeight = inst.dpDiv.outerHeight(),
			    inputWidth = inst.input ? inst.input.outerWidth() : 0,
			    inputHeight = inst.input ? inst.input.outerHeight() : 0,
			    viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
			    viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());

			offset.left -= this._get(inst, "isRTL") ? dpWidth - inputWidth : 0;
			offset.left -= isFixed && offset.left === inst.input.offset().left ? $(document).scrollLeft() : 0;
			offset.top -= isFixed && offset.top === inst.input.offset().top + inputHeight ? $(document).scrollTop() : 0;

			// Now check if datepicker is showing outside window viewport - move to a better place if so.
			offset.left -= Math.min(offset.left, offset.left + dpWidth > viewWidth && viewWidth > dpWidth ? Math.abs(offset.left + dpWidth - viewWidth) : 0);
			offset.top -= Math.min(offset.top, offset.top + dpHeight > viewHeight && viewHeight > dpHeight ? Math.abs(dpHeight + inputHeight) : 0);

			return offset;
		},

		/* Find an object's position on the screen. */
		_findPos: function _findPos(obj) {
			var position,
			    inst = this._getInst(obj),
			    isRTL = this._get(inst, "isRTL");

			while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
				obj = obj[isRTL ? "previousSibling" : "nextSibling"];
			}

			position = $(obj).offset();
			return [position.left, position.top];
		},

		/* Hide the date picker from view.
   * @param  input  element - the input field attached to the date picker
   */
		_hideDatepicker: function _hideDatepicker(input) {
			var showAnim,
			    duration,
			    postProcess,
			    onClose,
			    inst = this._curInst;

			if (!inst || input && inst !== $.data(input, "datepicker")) {
				return;
			}

			if (this._datepickerShowing) {
				showAnim = this._get(inst, "showAnim");
				duration = this._get(inst, "duration");
				postProcess = function postProcess() {
					$.datepicker._tidyDialog(inst);
				};

				// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
				if ($.effects && ($.effects.effect[showAnim] || $.effects[showAnim])) {
					inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
				} else {
					inst.dpDiv[showAnim === "slideDown" ? "slideUp" : showAnim === "fadeIn" ? "fadeOut" : "hide"](showAnim ? duration : null, postProcess);
				}

				if (!showAnim) {
					postProcess();
				}
				this._datepickerShowing = false;

				onClose = this._get(inst, "onClose");
				if (onClose) {
					onClose.apply(inst.input ? inst.input[0] : null, [inst.input ? inst.input.val() : "", inst]);
				}

				this._lastInput = null;
				if (this._inDialog) {
					this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
					if ($.blockUI) {
						$.unblockUI();
						$("body").append(this.dpDiv);
					}
				}
				this._inDialog = false;
			}
		},

		/* Tidy up after a dialog display. */
		_tidyDialog: function _tidyDialog(inst) {
			inst.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar");
		},

		/* Close date picker if clicked elsewhere. */
		_checkExternalClick: function _checkExternalClick(event) {
			if (!$.datepicker._curInst) {
				return;
			}

			var $target = $(event.target),
			    inst = $.datepicker._getInst($target[0]);

			if ($target[0].id !== $.datepicker._mainDivId && $target.parents("#" + $.datepicker._mainDivId).length === 0 && !$target.hasClass($.datepicker.markerClassName) && !$target.closest("." + $.datepicker._triggerClass).length && $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) || $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst) {
				$.datepicker._hideDatepicker();
			}
		},

		/* Adjust one of the date sub-fields. */
		_adjustDate: function _adjustDate(id, offset, period) {
			var target = $(id),
			    inst = this._getInst(target[0]);

			if (this._isDisabledDatepicker(target[0])) {
				return;
			}
			this._adjustInstDate(inst, offset + (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
			period);
			this._updateDatepicker(inst);
		},

		/* Action for current link. */
		_gotoToday: function _gotoToday(id) {
			var date,
			    target = $(id),
			    inst = this._getInst(target[0]);

			if (this._get(inst, "gotoCurrent") && inst.currentDay) {
				inst.selectedDay = inst.currentDay;
				inst.drawMonth = inst.selectedMonth = inst.currentMonth;
				inst.drawYear = inst.selectedYear = inst.currentYear;
			} else {
				date = new Date();
				inst.selectedDay = date.getDate();
				inst.drawMonth = inst.selectedMonth = date.getMonth();
				inst.drawYear = inst.selectedYear = date.getFullYear();
			}
			this._notifyChange(inst);
			this._adjustDate(target);
		},

		/* Action for selecting a new month/year. */
		_selectMonthYear: function _selectMonthYear(id, select, period) {
			var target = $(id),
			    inst = this._getInst(target[0]);

			inst["selected" + (period === "M" ? "Month" : "Year")] = inst["draw" + (period === "M" ? "Month" : "Year")] = parseInt(select.options[select.selectedIndex].value, 10);

			this._notifyChange(inst);
			this._adjustDate(target);
		},

		/* Action for selecting a day. */
		_selectDay: function _selectDay(id, month, year, td) {
			var inst,
			    target = $(id);

			if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
				return;
			}

			inst = this._getInst(target[0]);
			inst.selectedDay = inst.currentDay = $("a", td).html();
			inst.selectedMonth = inst.currentMonth = month;
			inst.selectedYear = inst.currentYear = year;
			this._selectDate(id, this._formatDate(inst, inst.currentDay, inst.currentMonth, inst.currentYear));
		},

		/* Erase the input field and hide the date picker. */
		_clearDate: function _clearDate(id) {
			var target = $(id);
			this._selectDate(target, "");
		},

		/* Update the input field with the selected date. */
		_selectDate: function _selectDate(id, dateStr) {
			var onSelect,
			    target = $(id),
			    inst = this._getInst(target[0]);

			dateStr = dateStr != null ? dateStr : this._formatDate(inst);
			if (inst.input) {
				inst.input.val(dateStr);
			}
			this._updateAlternate(inst);

			onSelect = this._get(inst, "onSelect");
			if (onSelect) {
				onSelect.apply(inst.input ? inst.input[0] : null, [dateStr, inst]); // trigger custom callback
			} else if (inst.input) {
				inst.input.trigger("change"); // fire the change event
			}

			if (inst.inline) {
				this._updateDatepicker(inst);
			} else {
				this._hideDatepicker();
				this._lastInput = inst.input[0];
				if (_typeof(inst.input[0]) !== "object") {
					inst.input.trigger("focus"); // restore focus
				}
				this._lastInput = null;
			}
		},

		/* Update any alternate field to synchronise with the main field. */
		_updateAlternate: function _updateAlternate(inst) {
			var altFormat,
			    date,
			    dateStr,
			    altField = this._get(inst, "altField");

			if (altField) {
				// update alternate field too
				altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
				date = this._getDate(inst);
				dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
				$(altField).val(dateStr);
			}
		},

		/* Set as beforeShowDay function to prevent selection of weekends.
   * @param  date  Date - the date to customise
   * @return [boolean, string] - is this date selectable?, what is its CSS class?
   */
		noWeekends: function noWeekends(date) {
			var day = date.getDay();
			return [day > 0 && day < 6, ""];
		},

		/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
   * @param  date  Date - the date to get the week for
   * @return  number - the number of the week within the year that contains this date
   */
		iso8601Week: function iso8601Week(date) {
			var time,
			    checkDate = new Date(date.getTime());

			// Find Thursday of this week starting on Monday
			checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));

			time = checkDate.getTime();
			checkDate.setMonth(0); // Compare with Jan 1
			checkDate.setDate(1);
			return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
		},

		/* Parse a string value into a date object.
   * See formatDate below for the possible formats.
   *
   * @param  format string - the expected format of the date
   * @param  value string - the date in the above format
   * @param  settings Object - attributes include:
   *					shortYearCutoff  number - the cutoff year for determining the century (optional)
   *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
   *					dayNames		string[7] - names of the days from Sunday (optional)
   *					monthNamesShort string[12] - abbreviated names of the months (optional)
   *					monthNames		string[12] - names of the months (optional)
   * @return  Date - the extracted date value or null if value is blank
   */
		parseDate: function parseDate(format, value, settings) {
			if (format == null || value == null) {
				throw "Invalid arguments";
			}

			value = (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object" ? value.toString() : value + "";
			if (value === "") {
				return null;
			}

			var iFormat,
			    dim,
			    extra,
			    iValue = 0,
			    shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
			    shortYearCutoff = typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp : new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10),
			    dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
			    dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
			    monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
			    monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
			    year = -1,
			    month = -1,
			    day = -1,
			    doy = -1,
			    literal = false,
			    date,


			// Check whether a format character is doubled
			lookAhead = function lookAhead(match) {
				var matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
				if (matches) {
					iFormat++;
				}
				return matches;
			},


			// Extract a number from the string value
			getNumber = function getNumber(match) {
				var isDoubled = lookAhead(match),
				    size = match === "@" ? 14 : match === "!" ? 20 : match === "y" && isDoubled ? 4 : match === "o" ? 3 : 2,
				    minSize = match === "y" ? size : 1,
				    digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
				    num = value.substring(iValue).match(digits);
				if (!num) {
					throw "Missing number at position " + iValue;
				}
				iValue += num[0].length;
				return parseInt(num[0], 10);
			},


			// Extract a name from the string value and convert to an index
			getName = function getName(match, shortNames, longNames) {
				var index = -1,
				    names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
					return [[k, v]];
				}).sort(function (a, b) {
					return -(a[1].length - b[1].length);
				});

				$.each(names, function (i, pair) {
					var name = pair[1];
					if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
						index = pair[0];
						iValue += name.length;
						return false;
					}
				});
				if (index !== -1) {
					return index + 1;
				} else {
					throw "Unknown name at position " + iValue;
				}
			},


			// Confirm that a literal character matches the string value
			checkLiteral = function checkLiteral() {
				if (value.charAt(iValue) !== format.charAt(iFormat)) {
					throw "Unexpected literal at position " + iValue;
				}
				iValue++;
			};

			for (iFormat = 0; iFormat < format.length; iFormat++) {
				if (literal) {
					if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
						literal = false;
					} else {
						checkLiteral();
					}
				} else {
					switch (format.charAt(iFormat)) {
						case "d":
							day = getNumber("d");
							break;
						case "D":
							getName("D", dayNamesShort, dayNames);
							break;
						case "o":
							doy = getNumber("o");
							break;
						case "m":
							month = getNumber("m");
							break;
						case "M":
							month = getName("M", monthNamesShort, monthNames);
							break;
						case "y":
							year = getNumber("y");
							break;
						case "@":
							date = new Date(getNumber("@"));
							year = date.getFullYear();
							month = date.getMonth() + 1;
							day = date.getDate();
							break;
						case "!":
							date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
							year = date.getFullYear();
							month = date.getMonth() + 1;
							day = date.getDate();
							break;
						case "'":
							if (lookAhead("'")) {
								checkLiteral();
							} else {
								literal = true;
							}
							break;
						default:
							checkLiteral();
					}
				}
			}

			if (iValue < value.length) {
				extra = value.substr(iValue);
				if (!/^\s+/.test(extra)) {
					throw "Extra/unparsed characters found in date: " + extra;
				}
			}

			if (year === -1) {
				year = new Date().getFullYear();
			} else if (year < 100) {
				year += new Date().getFullYear() - new Date().getFullYear() % 100 + (year <= shortYearCutoff ? 0 : -100);
			}

			if (doy > -1) {
				month = 1;
				day = doy;
				do {
					dim = this._getDaysInMonth(year, month - 1);
					if (day <= dim) {
						break;
					}
					month++;
					day -= dim;
				} while (true);
			}

			date = this._daylightSavingAdjust(new Date(year, month - 1, day));
			if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
				throw "Invalid date"; // E.g. 31/02/00
			}
			return date;
		},

		/* Standard date formats. */
		ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
		COOKIE: "D, dd M yy",
		ISO_8601: "yy-mm-dd",
		RFC_822: "D, d M y",
		RFC_850: "DD, dd-M-y",
		RFC_1036: "D, d M y",
		RFC_1123: "D, d M yy",
		RFC_2822: "D, d M yy",
		RSS: "D, d M y", // RFC 822
		TICKS: "!",
		TIMESTAMP: "@",
		W3C: "yy-mm-dd", // ISO 8601

		_ticksTo1970: ((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000,

		/* Format a date object into a string value.
   * The format can be combinations of the following:
   * d  - day of month (no leading zero)
   * dd - day of month (two digit)
   * o  - day of year (no leading zeros)
   * oo - day of year (three digit)
   * D  - day name short
   * DD - day name long
   * m  - month of year (no leading zero)
   * mm - month of year (two digit)
   * M  - month name short
   * MM - month name long
   * y  - year (two digit)
   * yy - year (four digit)
   * @ - Unix timestamp (ms since 01/01/1970)
   * ! - Windows ticks (100ns since 01/01/0001)
   * "..." - literal text
   * '' - single quote
   *
   * @param  format string - the desired format of the date
   * @param  date Date - the date value to format
   * @param  settings Object - attributes include:
   *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
   *					dayNames		string[7] - names of the days from Sunday (optional)
   *					monthNamesShort string[12] - abbreviated names of the months (optional)
   *					monthNames		string[12] - names of the months (optional)
   * @return  string - the date in the above format
   */
		formatDate: function formatDate(format, date, settings) {
			if (!date) {
				return "";
			}

			var iFormat,
			    dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
			    dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
			    monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
			    monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,


			// Check whether a format character is doubled
			lookAhead = function lookAhead(match) {
				var matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
				if (matches) {
					iFormat++;
				}
				return matches;
			},


			// Format a number, with leading zero if necessary
			formatNumber = function formatNumber(match, value, len) {
				var num = "" + value;
				if (lookAhead(match)) {
					while (num.length < len) {
						num = "0" + num;
					}
				}
				return num;
			},


			// Format a name, short or long as requested
			formatName = function formatName(match, value, shortNames, longNames) {
				return lookAhead(match) ? longNames[value] : shortNames[value];
			},
			    output = "",
			    literal = false;

			if (date) {
				for (iFormat = 0; iFormat < format.length; iFormat++) {
					if (literal) {
						if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
							literal = false;
						} else {
							output += format.charAt(iFormat);
						}
					} else {
						switch (format.charAt(iFormat)) {
							case "d":
								output += formatNumber("d", date.getDate(), 2);
								break;
							case "D":
								output += formatName("D", date.getDay(), dayNamesShort, dayNames);
								break;
							case "o":
								output += formatNumber("o", Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
								break;
							case "m":
								output += formatNumber("m", date.getMonth() + 1, 2);
								break;
							case "M":
								output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
								break;
							case "y":
								output += lookAhead("y") ? date.getFullYear() : (date.getFullYear() % 100 < 10 ? "0" : "") + date.getFullYear() % 100;
								break;
							case "@":
								output += date.getTime();
								break;
							case "!":
								output += date.getTime() * 10000 + this._ticksTo1970;
								break;
							case "'":
								if (lookAhead("'")) {
									output += "'";
								} else {
									literal = true;
								}
								break;
							default:
								output += format.charAt(iFormat);
						}
					}
				}
			}
			return output;
		},

		/* Extract all possible characters from the date format. */
		_possibleChars: function _possibleChars(format) {
			var iFormat,
			    chars = "",
			    literal = false,


			// Check whether a format character is doubled
			lookAhead = function lookAhead(match) {
				var matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
				if (matches) {
					iFormat++;
				}
				return matches;
			};

			for (iFormat = 0; iFormat < format.length; iFormat++) {
				if (literal) {
					if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
						literal = false;
					} else {
						chars += format.charAt(iFormat);
					}
				} else {
					switch (format.charAt(iFormat)) {
						case "d":case "m":case "y":case "@":
							chars += "0123456789";
							break;
						case "D":case "M":
							return null; // Accept anything
						case "'":
							if (lookAhead("'")) {
								chars += "'";
							} else {
								literal = true;
							}
							break;
						default:
							chars += format.charAt(iFormat);
					}
				}
			}
			return chars;
		},

		/* Get a setting value, defaulting if necessary. */
		_get: function _get(inst, name) {
			return inst.settings[name] !== undefined ? inst.settings[name] : this._defaults[name];
		},

		/* Parse existing date and initialise date picker. */
		_setDateFromField: function _setDateFromField(inst, noDefault) {
			if (inst.input.val() === inst.lastVal) {
				return;
			}

			var dateFormat = this._get(inst, "dateFormat"),
			    dates = inst.lastVal = inst.input ? inst.input.val() : null,
			    defaultDate = this._getDefaultDate(inst),
			    date = defaultDate,
			    settings = this._getFormatConfig(inst);

			try {
				date = this.parseDate(dateFormat, dates, settings) || defaultDate;
			} catch (event) {
				dates = noDefault ? "" : dates;
			}
			inst.selectedDay = date.getDate();
			inst.drawMonth = inst.selectedMonth = date.getMonth();
			inst.drawYear = inst.selectedYear = date.getFullYear();
			inst.currentDay = dates ? date.getDate() : 0;
			inst.currentMonth = dates ? date.getMonth() : 0;
			inst.currentYear = dates ? date.getFullYear() : 0;
			this._adjustInstDate(inst);
		},

		/* Retrieve the default date shown on opening. */
		_getDefaultDate: function _getDefaultDate(inst) {
			return this._restrictMinMax(inst, this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
		},

		/* A date may be specified as an exact value or a relative one. */
		_determineDate: function _determineDate(inst, date, defaultDate) {
			var offsetNumeric = function offsetNumeric(offset) {
				var date = new Date();
				date.setDate(date.getDate() + offset);
				return date;
			},
			    offsetString = function offsetString(offset) {
				try {
					return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), offset, $.datepicker._getFormatConfig(inst));
				} catch (e) {

					// Ignore
				}

				var date = (offset.toLowerCase().match(/^c/) ? $.datepicker._getDate(inst) : null) || new Date(),
				    year = date.getFullYear(),
				    month = date.getMonth(),
				    day = date.getDate(),
				    pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
				    matches = pattern.exec(offset);

				while (matches) {
					switch (matches[2] || "d") {
						case "d":case "D":
							day += parseInt(matches[1], 10);break;
						case "w":case "W":
							day += parseInt(matches[1], 10) * 7;break;
						case "m":case "M":
							month += parseInt(matches[1], 10);
							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
							break;
						case "y":case "Y":
							year += parseInt(matches[1], 10);
							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
							break;
					}
					matches = pattern.exec(offset);
				}
				return new Date(year, month, day);
			},
			    newDate = date == null || date === "" ? defaultDate : typeof date === "string" ? offsetString(date) : typeof date === "number" ? isNaN(date) ? defaultDate : offsetNumeric(date) : new Date(date.getTime());

			newDate = newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate;
			if (newDate) {
				newDate.setHours(0);
				newDate.setMinutes(0);
				newDate.setSeconds(0);
				newDate.setMilliseconds(0);
			}
			return this._daylightSavingAdjust(newDate);
		},

		/* Handle switch to/from daylight saving.
   * Hours may be non-zero on daylight saving cut-over:
   * > 12 when midnight changeover, but then cannot generate
   * midnight datetime, so jump to 1AM, otherwise reset.
   * @param  date  (Date) the date to check
   * @return  (Date) the corrected date
   */
		_daylightSavingAdjust: function _daylightSavingAdjust(date) {
			if (!date) {
				return null;
			}
			date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
			return date;
		},

		/* Set the date(s) directly. */
		_setDate: function _setDate(inst, date, noChange) {
			var clear = !date,
			    origMonth = inst.selectedMonth,
			    origYear = inst.selectedYear,
			    newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));

			inst.selectedDay = inst.currentDay = newDate.getDate();
			inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
			inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
			if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
				this._notifyChange(inst);
			}
			this._adjustInstDate(inst);
			if (inst.input) {
				inst.input.val(clear ? "" : this._formatDate(inst));
			}
		},

		/* Retrieve the date(s) directly. */
		_getDate: function _getDate(inst) {
			var startDate = !inst.currentYear || inst.input && inst.input.val() === "" ? null : this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay));
			return startDate;
		},

		/* Attach the onxxx handlers.  These are declared statically so
   * they work with static code transformers like Caja.
   */
		_attachHandlers: function _attachHandlers(inst) {
			var stepMonths = this._get(inst, "stepMonths"),
			    id = "#" + inst.id.replace(/\\\\/g, "\\");
			inst.dpDiv.find("[data-handler]").map(function () {
				var handler = {
					prev: function prev() {
						$.datepicker._adjustDate(id, -stepMonths, "M");
					},
					next: function next() {
						$.datepicker._adjustDate(id, +stepMonths, "M");
					},
					hide: function hide() {
						$.datepicker._hideDatepicker();
					},
					today: function today() {
						$.datepicker._gotoToday(id);
					},
					selectDay: function selectDay() {
						$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
						return false;
					},
					selectMonth: function selectMonth() {
						$.datepicker._selectMonthYear(id, this, "M");
						return false;
					},
					selectYear: function selectYear() {
						$.datepicker._selectMonthYear(id, this, "Y");
						return false;
					}
				};
				$(this).on(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
			});
		},

		/* Generate the HTML for the current state of the date picker. */
		_generateHTML: function _generateHTML(inst) {
			var maxDraw,
			    prevText,
			    prev,
			    nextText,
			    next,
			    currentText,
			    gotoDate,
			    controls,
			    buttonPanel,
			    firstDay,
			    showWeek,
			    dayNames,
			    dayNamesMin,
			    monthNames,
			    monthNamesShort,
			    beforeShowDay,
			    showOtherMonths,
			    selectOtherMonths,
			    defaultDate,
			    html,
			    dow,
			    row,
			    group,
			    col,
			    selectedDate,
			    cornerClass,
			    calender,
			    thead,
			    day,
			    daysInMonth,
			    leadDays,
			    curRows,
			    numRows,
			    printDate,
			    dRow,
			    tbody,
			    daySettings,
			    otherMonth,
			    unselectable,
			    tempDate = new Date(),
			    today = this._daylightSavingAdjust(new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())),
			    // clear time
			isRTL = this._get(inst, "isRTL"),
			    showButtonPanel = this._get(inst, "showButtonPanel"),
			    hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
			    navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
			    numMonths = this._getNumberOfMonths(inst),
			    showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
			    stepMonths = this._get(inst, "stepMonths"),
			    isMultiMonth = numMonths[0] !== 1 || numMonths[1] !== 1,
			    currentDate = this._daylightSavingAdjust(!inst.currentDay ? new Date(9999, 9, 9) : new Date(inst.currentYear, inst.currentMonth, inst.currentDay)),
			    minDate = this._getMinMaxDate(inst, "min"),
			    maxDate = this._getMinMaxDate(inst, "max"),
			    drawMonth = inst.drawMonth - showCurrentAtPos,
			    drawYear = inst.drawYear;

			if (drawMonth < 0) {
				drawMonth += 12;
				drawYear--;
			}
			if (maxDate) {
				maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), maxDate.getMonth() - numMonths[0] * numMonths[1] + 1, maxDate.getDate()));
				maxDraw = minDate && maxDraw < minDate ? minDate : maxDraw;
				while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
					drawMonth--;
					if (drawMonth < 0) {
						drawMonth = 11;
						drawYear--;
					}
				}
			}
			inst.drawMonth = drawMonth;
			inst.drawYear = drawYear;

			prevText = this._get(inst, "prevText");
			prevText = !navigationAsDateFormat ? prevText : this.formatDate(prevText, this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), this._getFormatConfig(inst));

			prev = this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" + " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" : hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "e" : "w") + "'>" + prevText + "</span></a>";

			nextText = this._get(inst, "nextText");
			nextText = !navigationAsDateFormat ? nextText : this.formatDate(nextText, this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), this._getFormatConfig(inst));

			next = this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" + " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" : hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "w" : "e") + "'>" + nextText + "</span></a>";

			currentText = this._get(inst, "currentText");
			gotoDate = this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today;
			currentText = !navigationAsDateFormat ? currentText : this.formatDate(currentText, gotoDate, this._getFormatConfig(inst));

			controls = !inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + this._get(inst, "closeText") + "</button>" : "";

			buttonPanel = showButtonPanel ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") + (this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" + ">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";

			firstDay = parseInt(this._get(inst, "firstDay"), 10);
			firstDay = isNaN(firstDay) ? 0 : firstDay;

			showWeek = this._get(inst, "showWeek");
			dayNames = this._get(inst, "dayNames");
			dayNamesMin = this._get(inst, "dayNamesMin");
			monthNames = this._get(inst, "monthNames");
			monthNamesShort = this._get(inst, "monthNamesShort");
			beforeShowDay = this._get(inst, "beforeShowDay");
			showOtherMonths = this._get(inst, "showOtherMonths");
			selectOtherMonths = this._get(inst, "selectOtherMonths");
			defaultDate = this._getDefaultDate(inst);
			html = "";

			for (row = 0; row < numMonths[0]; row++) {
				group = "";
				this.maxRows = 4;
				for (col = 0; col < numMonths[1]; col++) {
					selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
					cornerClass = " ui-corner-all";
					calender = "";
					if (isMultiMonth) {
						calender += "<div class='ui-datepicker-group";
						if (numMonths[1] > 1) {
							switch (col) {
								case 0:
									calender += " ui-datepicker-group-first";
									cornerClass = " ui-corner-" + (isRTL ? "right" : "left");break;
								case numMonths[1] - 1:
									calender += " ui-datepicker-group-last";
									cornerClass = " ui-corner-" + (isRTL ? "left" : "right");break;
								default:
									calender += " ui-datepicker-group-middle";cornerClass = "";break;
							}
						}
						calender += "'>";
					}
					calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" + (/all|left/.test(cornerClass) && row === 0 ? isRTL ? next : prev : "") + (/all|right/.test(cornerClass) && row === 0 ? isRTL ? prev : next : "") + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
					"</div><table class='ui-datepicker-calendar'><thead>" + "<tr>";
					thead = showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "";
					for (dow = 0; dow < 7; dow++) {
						// days of the week
						day = (dow + firstDay) % 7;
						thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" + "<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
					}
					calender += thead + "</tr></thead><tbody>";
					daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
					if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
						inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
					}
					leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
					curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
					numRows = isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows; //If multiple months, use the higher number of rows (see #7043)
					this.maxRows = numRows;
					printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
					for (dRow = 0; dRow < numRows; dRow++) {
						// create date picker rows
						calender += "<tr>";
						tbody = !showWeek ? "" : "<td class='ui-datepicker-week-col'>" + this._get(inst, "calculateWeek")(printDate) + "</td>";
						for (dow = 0; dow < 7; dow++) {
							// create date picker days
							daySettings = beforeShowDay ? beforeShowDay.apply(inst.input ? inst.input[0] : null, [printDate]) : [true, ""];
							otherMonth = printDate.getMonth() !== drawMonth;
							unselectable = otherMonth && !selectOtherMonths || !daySettings[0] || minDate && printDate < minDate || maxDate && printDate > maxDate;
							tbody += "<td class='" + ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + ( // highlight weekends
							otherMonth ? " ui-datepicker-other-month" : "") + ( // highlight days from other months
							printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent || // user pressed key
							defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime() ?

							// or defaultDate is current printedDate and defaultDate is selectedDate
							" " + this._dayOverClass : "") + ( // highlight selected day
							unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "") + ( // highlight unselectable days
							otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + ( // highlight custom dates
							printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + ( // highlight selected day
							printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + ( // highlight today (if different)
							(!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + ( // cell title
							unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + ( // actions
							otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
							unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" + (printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") + (printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + ( // highlight selected day
							otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
							"' href='#'>" + printDate.getDate() + "</a>") + "</td>"; // display selectable date
							printDate.setDate(printDate.getDate() + 1);
							printDate = this._daylightSavingAdjust(printDate);
						}
						calender += tbody + "</tr>";
					}
					drawMonth++;
					if (drawMonth > 11) {
						drawMonth = 0;
						drawYear++;
					}
					calender += "</tbody></table>" + (isMultiMonth ? "</div>" + (numMonths[0] > 0 && col === numMonths[1] - 1 ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
					group += calender;
				}
				html += group;
			}
			html += buttonPanel;
			inst._keyEvent = false;
			return html;
		},

		/* Generate the month and year header. */
		_generateMonthYearHeader: function _generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, secondary, monthNames, monthNamesShort) {

			var inMinYear,
			    inMaxYear,
			    month,
			    years,
			    thisYear,
			    determineYear,
			    year,
			    endYear,
			    changeMonth = this._get(inst, "changeMonth"),
			    changeYear = this._get(inst, "changeYear"),
			    showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
			    html = "<div class='ui-datepicker-title'>",
			    monthHtml = "";

			// Month selection
			if (secondary || !changeMonth) {
				monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
			} else {
				inMinYear = minDate && minDate.getFullYear() === drawYear;
				inMaxYear = maxDate && maxDate.getFullYear() === drawYear;
				monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
				for (month = 0; month < 12; month++) {
					if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
						monthHtml += "<option value='" + month + "'" + (month === drawMonth ? " selected='selected'" : "") + ">" + monthNamesShort[month] + "</option>";
					}
				}
				monthHtml += "</select>";
			}

			if (!showMonthAfterYear) {
				html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
			}

			// Year selection
			if (!inst.yearshtml) {
				inst.yearshtml = "";
				if (secondary || !changeYear) {
					html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
				} else {

					// determine range of years to display
					years = this._get(inst, "yearRange").split(":");
					thisYear = new Date().getFullYear();
					determineYear = function determineYear(value) {
						var year = value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) : value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) : parseInt(value, 10);
						return isNaN(year) ? thisYear : year;
					};
					year = determineYear(years[0]);
					endYear = Math.max(year, determineYear(years[1] || ""));
					year = minDate ? Math.max(year, minDate.getFullYear()) : year;
					endYear = maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear;
					inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
					for (; year <= endYear; year++) {
						inst.yearshtml += "<option value='" + year + "'" + (year === drawYear ? " selected='selected'" : "") + ">" + year + "</option>";
					}
					inst.yearshtml += "</select>";

					html += inst.yearshtml;
					inst.yearshtml = null;
				}
			}

			html += this._get(inst, "yearSuffix");
			if (showMonthAfterYear) {
				html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
			}
			html += "</div>"; // Close datepicker_header
			return html;
		},

		/* Adjust one of the date sub-fields. */
		_adjustInstDate: function _adjustInstDate(inst, offset, period) {
			var year = inst.selectedYear + (period === "Y" ? offset : 0),
			    month = inst.selectedMonth + (period === "M" ? offset : 0),
			    day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
			    date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));

			inst.selectedDay = date.getDate();
			inst.drawMonth = inst.selectedMonth = date.getMonth();
			inst.drawYear = inst.selectedYear = date.getFullYear();
			if (period === "M" || period === "Y") {
				this._notifyChange(inst);
			}
		},

		/* Ensure a date is within any min/max bounds. */
		_restrictMinMax: function _restrictMinMax(inst, date) {
			var minDate = this._getMinMaxDate(inst, "min"),
			    maxDate = this._getMinMaxDate(inst, "max"),
			    newDate = minDate && date < minDate ? minDate : date;
			return maxDate && newDate > maxDate ? maxDate : newDate;
		},

		/* Notify change of month/year. */
		_notifyChange: function _notifyChange(inst) {
			var onChange = this._get(inst, "onChangeMonthYear");
			if (onChange) {
				onChange.apply(inst.input ? inst.input[0] : null, [inst.selectedYear, inst.selectedMonth + 1, inst]);
			}
		},

		/* Determine the number of months to show. */
		_getNumberOfMonths: function _getNumberOfMonths(inst) {
			var numMonths = this._get(inst, "numberOfMonths");
			return numMonths == null ? [1, 1] : typeof numMonths === "number" ? [1, numMonths] : numMonths;
		},

		/* Determine the current maximum date - ensure no time components are set. */
		_getMinMaxDate: function _getMinMaxDate(inst, minMax) {
			return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
		},

		/* Find the number of days in a given month. */
		_getDaysInMonth: function _getDaysInMonth(year, month) {
			return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
		},

		/* Find the day of the week of the first of a month. */
		_getFirstDayOfMonth: function _getFirstDayOfMonth(year, month) {
			return new Date(year, month, 1).getDay();
		},

		/* Determines if we should allow a "next/prev" month display change. */
		_canAdjustMonth: function _canAdjustMonth(inst, offset, curYear, curMonth) {
			var numMonths = this._getNumberOfMonths(inst),
			    date = this._daylightSavingAdjust(new Date(curYear, curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));

			if (offset < 0) {
				date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
			}
			return this._isInRange(inst, date);
		},

		/* Is the given date in the accepted range? */
		_isInRange: function _isInRange(inst, date) {
			var yearSplit,
			    currentYear,
			    minDate = this._getMinMaxDate(inst, "min"),
			    maxDate = this._getMinMaxDate(inst, "max"),
			    minYear = null,
			    maxYear = null,
			    years = this._get(inst, "yearRange");
			if (years) {
				yearSplit = years.split(":");
				currentYear = new Date().getFullYear();
				minYear = parseInt(yearSplit[0], 10);
				maxYear = parseInt(yearSplit[1], 10);
				if (yearSplit[0].match(/[+\-].*/)) {
					minYear += currentYear;
				}
				if (yearSplit[1].match(/[+\-].*/)) {
					maxYear += currentYear;
				}
			}

			return (!minDate || date.getTime() >= minDate.getTime()) && (!maxDate || date.getTime() <= maxDate.getTime()) && (!minYear || date.getFullYear() >= minYear) && (!maxYear || date.getFullYear() <= maxYear);
		},

		/* Provide the configuration settings for formatting/parsing. */
		_getFormatConfig: function _getFormatConfig(inst) {
			var shortYearCutoff = this._get(inst, "shortYearCutoff");
			shortYearCutoff = typeof shortYearCutoff !== "string" ? shortYearCutoff : new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10);
			return { shortYearCutoff: shortYearCutoff,
				dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
				monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames") };
		},

		/* Format the given date for display. */
		_formatDate: function _formatDate(inst, day, month, year) {
			if (!day) {
				inst.currentDay = inst.selectedDay;
				inst.currentMonth = inst.selectedMonth;
				inst.currentYear = inst.selectedYear;
			}
			var date = day ? (typeof day === "undefined" ? "undefined" : _typeof(day)) === "object" ? day : this._daylightSavingAdjust(new Date(year, month, day)) : this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay));
			return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
		}
	});

	/*
  * Bind hover events for datepicker elements.
  * Done via delegate so the binding only occurs once in the lifetime of the parent div.
  * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
  */
	function datepicker_bindHover(dpDiv) {
		var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
		return dpDiv.on("mouseout", selector, function () {
			$(this).removeClass("ui-state-hover");
			if (this.className.indexOf("ui-datepicker-prev") !== -1) {
				$(this).removeClass("ui-datepicker-prev-hover");
			}
			if (this.className.indexOf("ui-datepicker-next") !== -1) {
				$(this).removeClass("ui-datepicker-next-hover");
			}
		}).on("mouseover", selector, datepicker_handleMouseover);
	}

	function datepicker_handleMouseover() {
		if (!$.datepicker._isDisabledDatepicker(datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
			$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
			$(this).addClass("ui-state-hover");
			if (this.className.indexOf("ui-datepicker-prev") !== -1) {
				$(this).addClass("ui-datepicker-prev-hover");
			}
			if (this.className.indexOf("ui-datepicker-next") !== -1) {
				$(this).addClass("ui-datepicker-next-hover");
			}
		}
	}

	/* jQuery extend now ignores nulls! */
	function datepicker_extendRemove(target, props) {
		$.extend(target, props);
		for (var name in props) {
			if (props[name] == null) {
				target[name] = props[name];
			}
		}
		return target;
	}

	/* Invoke the datepicker functionality.
    @param  options  string - a command, optionally followed by additional parameters or
 					Object - settings for attaching new datepicker functionality
    @return  jQuery object */
	$.fn.datepicker = function (options) {

		/* Verify an empty collection wasn't passed - Fixes #6976 */
		if (!this.length) {
			return this;
		}

		/* Initialise the date picker. */
		if (!$.datepicker.initialized) {
			$(document).on("mousedown", $.datepicker._checkExternalClick);
			$.datepicker.initialized = true;
		}

		/* Append datepicker main container to body if not exist. */
		if ($("#" + $.datepicker._mainDivId).length === 0) {
			$("body").append($.datepicker.dpDiv);
		}

		var otherArgs = Array.prototype.slice.call(arguments, 1);
		if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
			return $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this[0]].concat(otherArgs));
		}
		if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
			return $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this[0]].concat(otherArgs));
		}
		return this.each(function () {
			typeof options === "string" ? $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this].concat(otherArgs)) : $.datepicker._attachDatepicker(this, options);
		});
	};

	$.datepicker = new Datepicker(); // singleton instance
	$.datepicker.initialized = false;
	$.datepicker.uuid = new Date().getTime();
	$.datepicker.version = "1.12.1";

	var widgetsDatepicker = $.datepicker;

	// This file is deprecated
	var ie = $.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());

	/*!
  * jQuery UI Mouse 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Mouse
	//>>group: Widgets
	//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
	//>>docs: http://api.jqueryui.com/mouse/


	var mouseHandled = false;
	$(document).on("mouseup", function () {
		mouseHandled = false;
	});

	var widgetsMouse = $.widget("ui.mouse", {
		version: "1.12.1",
		options: {
			cancel: "input, textarea, button, select, option",
			distance: 1,
			delay: 0
		},
		_mouseInit: function _mouseInit() {
			var that = this;

			this.element.on("mousedown." + this.widgetName, function (event) {
				return that._mouseDown(event);
			}).on("click." + this.widgetName, function (event) {
				if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
					$.removeData(event.target, that.widgetName + ".preventClickEvent");
					event.stopImmediatePropagation();
					return false;
				}
			});

			this.started = false;
		},

		// TODO: make sure destroying one instance of mouse doesn't mess with
		// other instances of mouse
		_mouseDestroy: function _mouseDestroy() {
			this.element.off("." + this.widgetName);
			if (this._mouseMoveDelegate) {
				this.document.off("mousemove." + this.widgetName, this._mouseMoveDelegate).off("mouseup." + this.widgetName, this._mouseUpDelegate);
			}
		},

		_mouseDown: function _mouseDown(event) {

			// don't let more than one widget handle mouseStart
			if (mouseHandled) {
				return;
			}

			this._mouseMoved = false;

			// We may have missed mouseup (out of window)
			this._mouseStarted && this._mouseUp(event);

			this._mouseDownEvent = event;

			var that = this,
			    btnIsLeft = event.which === 1,


			// event.target.nodeName works around a bug in IE 8 with
			// disabled inputs (#7620)
			elIsCancel = typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false;
			if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
				return true;
			}

			this.mouseDelayMet = !this.options.delay;
			if (!this.mouseDelayMet) {
				this._mouseDelayTimer = setTimeout(function () {
					that.mouseDelayMet = true;
				}, this.options.delay);
			}

			if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
				this._mouseStarted = this._mouseStart(event) !== false;
				if (!this._mouseStarted) {
					event.preventDefault();
					return true;
				}
			}

			// Click event may never have fired (Gecko & Opera)
			if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
				$.removeData(event.target, this.widgetName + ".preventClickEvent");
			}

			// These delegates are required to keep context
			this._mouseMoveDelegate = function (event) {
				return that._mouseMove(event);
			};
			this._mouseUpDelegate = function (event) {
				return that._mouseUp(event);
			};

			this.document.on("mousemove." + this.widgetName, this._mouseMoveDelegate).on("mouseup." + this.widgetName, this._mouseUpDelegate);

			event.preventDefault();

			mouseHandled = true;
			return true;
		},

		_mouseMove: function _mouseMove(event) {

			// Only check for mouseups outside the document if you've moved inside the document
			// at least once. This prevents the firing of mouseup in the case of IE<9, which will
			// fire a mousemove event if content is placed under the cursor. See #7778
			// Support: IE <9
			if (this._mouseMoved) {

				// IE mouseup check - mouseup happened when mouse was out of window
				if ($.ui.ie && (!document.documentMode || document.documentMode < 9) && !event.button) {
					return this._mouseUp(event);

					// Iframe mouseup check - mouseup occurred in another document
				} else if (!event.which) {

					// Support: Safari <=8 - 9
					// Safari sets which to 0 if you press any of the following keys
					// during a drag (#14461)
					if (event.originalEvent.altKey || event.originalEvent.ctrlKey || event.originalEvent.metaKey || event.originalEvent.shiftKey) {
						this.ignoreMissingWhich = true;
					} else if (!this.ignoreMissingWhich) {
						return this._mouseUp(event);
					}
				}
			}

			if (event.which || event.button) {
				this._mouseMoved = true;
			}

			if (this._mouseStarted) {
				this._mouseDrag(event);
				return event.preventDefault();
			}

			if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
				this._mouseStarted = this._mouseStart(this._mouseDownEvent, event) !== false;
				this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event);
			}

			return !this._mouseStarted;
		},

		_mouseUp: function _mouseUp(event) {
			this.document.off("mousemove." + this.widgetName, this._mouseMoveDelegate).off("mouseup." + this.widgetName, this._mouseUpDelegate);

			if (this._mouseStarted) {
				this._mouseStarted = false;

				if (event.target === this._mouseDownEvent.target) {
					$.data(event.target, this.widgetName + ".preventClickEvent", true);
				}

				this._mouseStop(event);
			}

			if (this._mouseDelayTimer) {
				clearTimeout(this._mouseDelayTimer);
				delete this._mouseDelayTimer;
			}

			this.ignoreMissingWhich = false;
			mouseHandled = false;
			event.preventDefault();
		},

		_mouseDistanceMet: function _mouseDistanceMet(event) {
			return Math.max(Math.abs(this._mouseDownEvent.pageX - event.pageX), Math.abs(this._mouseDownEvent.pageY - event.pageY)) >= this.options.distance;
		},

		_mouseDelayMet: function _mouseDelayMet() /* event */{
			return this.mouseDelayMet;
		},

		// These are placeholder methods, to be overriden by extending plugin
		_mouseStart: function _mouseStart() /* event */{},
		_mouseDrag: function _mouseDrag() /* event */{},
		_mouseStop: function _mouseStop() /* event */{},
		_mouseCapture: function _mouseCapture() /* event */{
			return true;
		}
	});

	// $.ui.plugin is deprecated. Use $.widget() extensions instead.
	var plugin = $.ui.plugin = {
		add: function add(module, option, set) {
			var i,
			    proto = $.ui[module].prototype;
			for (i in set) {
				proto.plugins[i] = proto.plugins[i] || [];
				proto.plugins[i].push([option, set[i]]);
			}
		},
		call: function call(instance, name, args, allowDisconnected) {
			var i,
			    set = instance.plugins[name];

			if (!set) {
				return;
			}

			if (!allowDisconnected && (!instance.element[0].parentNode || instance.element[0].parentNode.nodeType === 11)) {
				return;
			}

			for (i = 0; i < set.length; i++) {
				if (instance.options[set[i][0]]) {
					set[i][1].apply(instance.element, args);
				}
			}
		}
	};

	var safeBlur = $.ui.safeBlur = function (element) {

		// Support: IE9 - 10 only
		// If the <body> is blurred, IE will switch windows, see #9420
		if (element && element.nodeName.toLowerCase() !== "body") {
			$(element).trigger("blur");
		}
	};

	/*!
  * jQuery UI Draggable 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Draggable
	//>>group: Interactions
	//>>description: Enables dragging functionality for any element.
	//>>docs: http://api.jqueryui.com/draggable/
	//>>demos: http://jqueryui.com/draggable/
	//>>css.structure: ../../themes/base/draggable.css


	$.widget("ui.draggable", $.ui.mouse, {
		version: "1.12.1",
		widgetEventPrefix: "drag",
		options: {
			addClasses: true,
			appendTo: "parent",
			axis: false,
			connectToSortable: false,
			containment: false,
			cursor: "auto",
			cursorAt: false,
			grid: false,
			handle: false,
			helper: "original",
			iframeFix: false,
			opacity: false,
			refreshPositions: false,
			revert: false,
			revertDuration: 500,
			scope: "default",
			scroll: true,
			scrollSensitivity: 20,
			scrollSpeed: 20,
			snap: false,
			snapMode: "both",
			snapTolerance: 20,
			stack: false,
			zIndex: false,

			// Callbacks
			drag: null,
			start: null,
			stop: null
		},
		_create: function _create() {

			if (this.options.helper === "original") {
				this._setPositionRelative();
			}
			if (this.options.addClasses) {
				this._addClass("ui-draggable");
			}
			this._setHandleClassName();

			this._mouseInit();
		},

		_setOption: function _setOption(key, value) {
			this._super(key, value);
			if (key === "handle") {
				this._removeHandleClassName();
				this._setHandleClassName();
			}
		},

		_destroy: function _destroy() {
			if ((this.helper || this.element).is(".ui-draggable-dragging")) {
				this.destroyOnClear = true;
				return;
			}
			this._removeHandleClassName();
			this._mouseDestroy();
		},

		_mouseCapture: function _mouseCapture(event) {
			var o = this.options;

			// Among others, prevent a drag on a resizable-handle
			if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
				return false;
			}

			//Quit if we're not on a valid handle
			this.handle = this._getHandle(event);
			if (!this.handle) {
				return false;
			}

			this._blurActiveElement(event);

			this._blockFrames(o.iframeFix === true ? "iframe" : o.iframeFix);

			return true;
		},

		_blockFrames: function _blockFrames(selector) {
			this.iframeBlocks = this.document.find(selector).map(function () {
				var iframe = $(this);

				return $("<div>").css("position", "absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0];
			});
		},

		_unblockFrames: function _unblockFrames() {
			if (this.iframeBlocks) {
				this.iframeBlocks.remove();
				delete this.iframeBlocks;
			}
		},

		_blurActiveElement: function _blurActiveElement(event) {
			var activeElement = $.ui.safeActiveElement(this.document[0]),
			    target = $(event.target);

			// Don't blur if the event occurred on an element that is within
			// the currently focused element
			// See #10527, #12472
			if (target.closest(activeElement).length) {
				return;
			}

			// Blur any element that currently has focus, see #4261
			$.ui.safeBlur(activeElement);
		},

		_mouseStart: function _mouseStart(event) {

			var o = this.options;

			//Create and append the visible helper
			this.helper = this._createHelper(event);

			this._addClass(this.helper, "ui-draggable-dragging");

			//Cache the helper size
			this._cacheHelperProportions();

			//If ddmanager is used for droppables, set the global draggable
			if ($.ui.ddmanager) {
				$.ui.ddmanager.current = this;
			}

			/*
    * - Position generation -
    * This block generates everything position related - it's the core of draggables.
    */

			//Cache the margins of the original element
			this._cacheMargins();

			//Store the helper's css position
			this.cssPosition = this.helper.css("position");
			this.scrollParent = this.helper.scrollParent(true);
			this.offsetParent = this.helper.offsetParent();
			this.hasFixedAncestor = this.helper.parents().filter(function () {
				return $(this).css("position") === "fixed";
			}).length > 0;

			//The element's absolute position on the page minus margins
			this.positionAbs = this.element.offset();
			this._refreshOffsets(event);

			//Generate the original position
			this.originalPosition = this.position = this._generatePosition(event, false);
			this.originalPageX = event.pageX;
			this.originalPageY = event.pageY;

			//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
			o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt);

			//Set a containment if given in the options
			this._setContainment();

			//Trigger event + callbacks
			if (this._trigger("start", event) === false) {
				this._clear();
				return false;
			}

			//Recache the helper size
			this._cacheHelperProportions();

			//Prepare the droppable offsets
			if ($.ui.ddmanager && !o.dropBehaviour) {
				$.ui.ddmanager.prepareOffsets(this, event);
			}

			// Execute the drag once - this causes the helper not to be visible before getting its
			// correct position
			this._mouseDrag(event, true);

			// If the ddmanager is used for droppables, inform the manager that dragging has started
			// (see #5003)
			if ($.ui.ddmanager) {
				$.ui.ddmanager.dragStart(this, event);
			}

			return true;
		},

		_refreshOffsets: function _refreshOffsets(event) {
			this.offset = {
				top: this.positionAbs.top - this.margins.top,
				left: this.positionAbs.left - this.margins.left,
				scroll: false,
				parent: this._getParentOffset(),
				relative: this._getRelativeOffset()
			};

			this.offset.click = {
				left: event.pageX - this.offset.left,
				top: event.pageY - this.offset.top
			};
		},

		_mouseDrag: function _mouseDrag(event, noPropagation) {

			// reset any necessary cached properties (see #5009)
			if (this.hasFixedAncestor) {
				this.offset.parent = this._getParentOffset();
			}

			//Compute the helpers position
			this.position = this._generatePosition(event, true);
			this.positionAbs = this._convertPositionTo("absolute");

			//Call plugins and callbacks and use the resulting position if something is returned
			if (!noPropagation) {
				var ui = this._uiHash();
				if (this._trigger("drag", event, ui) === false) {
					this._mouseUp(new $.Event("mouseup", event));
					return false;
				}
				this.position = ui.position;
			}

			this.helper[0].style.left = this.position.left + "px";
			this.helper[0].style.top = this.position.top + "px";

			if ($.ui.ddmanager) {
				$.ui.ddmanager.drag(this, event);
			}

			return false;
		},

		_mouseStop: function _mouseStop(event) {

			//If we are using droppables, inform the manager about the drop
			var that = this,
			    dropped = false;
			if ($.ui.ddmanager && !this.options.dropBehaviour) {
				dropped = $.ui.ddmanager.drop(this, event);
			}

			//if a drop comes from outside (a sortable)
			if (this.dropped) {
				dropped = this.dropped;
				this.dropped = false;
			}

			if (this.options.revert === "invalid" && !dropped || this.options.revert === "valid" && dropped || this.options.revert === true || $.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped)) {
				$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () {
					if (that._trigger("stop", event) !== false) {
						that._clear();
					}
				});
			} else {
				if (this._trigger("stop", event) !== false) {
					this._clear();
				}
			}

			return false;
		},

		_mouseUp: function _mouseUp(event) {
			this._unblockFrames();

			// If the ddmanager is used for droppables, inform the manager that dragging has stopped
			// (see #5003)
			if ($.ui.ddmanager) {
				$.ui.ddmanager.dragStop(this, event);
			}

			// Only need to focus if the event occurred on the draggable itself, see #10527
			if (this.handleElement.is(event.target)) {

				// The interaction is over; whether or not the click resulted in a drag,
				// focus the element
				this.element.trigger("focus");
			}

			return $.ui.mouse.prototype._mouseUp.call(this, event);
		},

		cancel: function cancel() {

			if (this.helper.is(".ui-draggable-dragging")) {
				this._mouseUp(new $.Event("mouseup", { target: this.element[0] }));
			} else {
				this._clear();
			}

			return this;
		},

		_getHandle: function _getHandle(event) {
			return this.options.handle ? !!$(event.target).closest(this.element.find(this.options.handle)).length : true;
		},

		_setHandleClassName: function _setHandleClassName() {
			this.handleElement = this.options.handle ? this.element.find(this.options.handle) : this.element;
			this._addClass(this.handleElement, "ui-draggable-handle");
		},

		_removeHandleClassName: function _removeHandleClassName() {
			this._removeClass(this.handleElement, "ui-draggable-handle");
		},

		_createHelper: function _createHelper(event) {

			var o = this.options,
			    helperIsFunction = $.isFunction(o.helper),
			    helper = helperIsFunction ? $(o.helper.apply(this.element[0], [event])) : o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element;

			if (!helper.parents("body").length) {
				helper.appendTo(o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo);
			}

			// Http://bugs.jqueryui.com/ticket/9446
			// a helper function can return the original element
			// which wouldn't have been set to relative in _create
			if (helperIsFunction && helper[0] === this.element[0]) {
				this._setPositionRelative();
			}

			if (helper[0] !== this.element[0] && !/(fixed|absolute)/.test(helper.css("position"))) {
				helper.css("position", "absolute");
			}

			return helper;
		},

		_setPositionRelative: function _setPositionRelative() {
			if (!/^(?:r|a|f)/.test(this.element.css("position"))) {
				this.element[0].style.position = "relative";
			}
		},

		_adjustOffsetFromHelper: function _adjustOffsetFromHelper(obj) {
			if (typeof obj === "string") {
				obj = obj.split(" ");
			}
			if ($.isArray(obj)) {
				obj = { left: +obj[0], top: +obj[1] || 0 };
			}
			if ("left" in obj) {
				this.offset.click.left = obj.left + this.margins.left;
			}
			if ("right" in obj) {
				this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
			}
			if ("top" in obj) {
				this.offset.click.top = obj.top + this.margins.top;
			}
			if ("bottom" in obj) {
				this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
			}
		},

		_isRootNode: function _isRootNode(element) {
			return (/(html|body)/i.test(element.tagName) || element === this.document[0]
			);
		},

		_getParentOffset: function _getParentOffset() {

			//Get the offsetParent and cache its position
			var po = this.offsetParent.offset(),
			    document = this.document[0];

			// This is a special case where we need to modify a offset calculated on start, since the
			// following happened:
			// 1. The position of the helper is absolute, so it's position is calculated based on the
			// next positioned parent
			// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
			// the document, which means that the scroll is included in the initial calculation of the
			// offset of the parent, and never recalculated upon drag
			if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
				po.left += this.scrollParent.scrollLeft();
				po.top += this.scrollParent.scrollTop();
			}

			if (this._isRootNode(this.offsetParent[0])) {
				po = { top: 0, left: 0 };
			}

			return {
				top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
				left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
			};
		},

		_getRelativeOffset: function _getRelativeOffset() {
			if (this.cssPosition !== "relative") {
				return { top: 0, left: 0 };
			}

			var p = this.element.position(),
			    scrollIsRootNode = this._isRootNode(this.scrollParent[0]);

			return {
				top: p.top - (parseInt(this.helper.css("top"), 10) || 0) + (!scrollIsRootNode ? this.scrollParent.scrollTop() : 0),
				left: p.left - (parseInt(this.helper.css("left"), 10) || 0) + (!scrollIsRootNode ? this.scrollParent.scrollLeft() : 0)
			};
		},

		_cacheMargins: function _cacheMargins() {
			this.margins = {
				left: parseInt(this.element.css("marginLeft"), 10) || 0,
				top: parseInt(this.element.css("marginTop"), 10) || 0,
				right: parseInt(this.element.css("marginRight"), 10) || 0,
				bottom: parseInt(this.element.css("marginBottom"), 10) || 0
			};
		},

		_cacheHelperProportions: function _cacheHelperProportions() {
			this.helperProportions = {
				width: this.helper.outerWidth(),
				height: this.helper.outerHeight()
			};
		},

		_setContainment: function _setContainment() {

			var isUserScrollable,
			    c,
			    ce,
			    o = this.options,
			    document = this.document[0];

			this.relativeContainer = null;

			if (!o.containment) {
				this.containment = null;
				return;
			}

			if (o.containment === "window") {
				this.containment = [$(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, $(window).scrollLeft() + $(window).width() - this.helperProportions.width - this.margins.left, $(window).scrollTop() + ($(window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
				return;
			}

			if (o.containment === "document") {
				this.containment = [0, 0, $(document).width() - this.helperProportions.width - this.margins.left, ($(document).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
				return;
			}

			if (o.containment.constructor === Array) {
				this.containment = o.containment;
				return;
			}

			if (o.containment === "parent") {
				o.containment = this.helper[0].parentNode;
			}

			c = $(o.containment);
			ce = c[0];

			if (!ce) {
				return;
			}

			isUserScrollable = /(scroll|auto)/.test(c.css("overflow"));

			this.containment = [(parseInt(c.css("borderLeftWidth"), 10) || 0) + (parseInt(c.css("paddingLeft"), 10) || 0), (parseInt(c.css("borderTopWidth"), 10) || 0) + (parseInt(c.css("paddingTop"), 10) || 0), (isUserScrollable ? Math.max(ce.scrollWidth, ce.offsetWidth) : ce.offsetWidth) - (parseInt(c.css("borderRightWidth"), 10) || 0) - (parseInt(c.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (isUserScrollable ? Math.max(ce.scrollHeight, ce.offsetHeight) : ce.offsetHeight) - (parseInt(c.css("borderBottomWidth"), 10) || 0) - (parseInt(c.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom];
			this.relativeContainer = c;
		},

		_convertPositionTo: function _convertPositionTo(d, pos) {

			if (!pos) {
				pos = this.position;
			}

			var mod = d === "absolute" ? 1 : -1,
			    scrollIsRootNode = this._isRootNode(this.scrollParent[0]);

			return {
				top:

				// The absolute mouse position
				pos.top +

				// Only for relative positioned nodes: Relative offset from element to offset parent
				this.offset.relative.top * mod +

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.top * mod - (this.cssPosition === "fixed" ? -this.offset.scroll.top : scrollIsRootNode ? 0 : this.offset.scroll.top) * mod,
				left:

				// The absolute mouse position
				pos.left +

				// Only for relative positioned nodes: Relative offset from element to offset parent
				this.offset.relative.left * mod +

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.left * mod - (this.cssPosition === "fixed" ? -this.offset.scroll.left : scrollIsRootNode ? 0 : this.offset.scroll.left) * mod
			};
		},

		_generatePosition: function _generatePosition(event, constrainPosition) {

			var containment,
			    co,
			    top,
			    left,
			    o = this.options,
			    scrollIsRootNode = this._isRootNode(this.scrollParent[0]),
			    pageX = event.pageX,
			    pageY = event.pageY;

			// Cache the scroll
			if (!scrollIsRootNode || !this.offset.scroll) {
				this.offset.scroll = {
					top: this.scrollParent.scrollTop(),
					left: this.scrollParent.scrollLeft()
				};
			}

			/*
    * - Position constraining -
    * Constrain the position to a mix of grid, containment.
    */

			// If we are not dragging yet, we won't check for options
			if (constrainPosition) {
				if (this.containment) {
					if (this.relativeContainer) {
						co = this.relativeContainer.offset();
						containment = [this.containment[0] + co.left, this.containment[1] + co.top, this.containment[2] + co.left, this.containment[3] + co.top];
					} else {
						containment = this.containment;
					}

					if (event.pageX - this.offset.click.left < containment[0]) {
						pageX = containment[0] + this.offset.click.left;
					}
					if (event.pageY - this.offset.click.top < containment[1]) {
						pageY = containment[1] + this.offset.click.top;
					}
					if (event.pageX - this.offset.click.left > containment[2]) {
						pageX = containment[2] + this.offset.click.left;
					}
					if (event.pageY - this.offset.click.top > containment[3]) {
						pageY = containment[3] + this.offset.click.top;
					}
				}

				if (o.grid) {

					//Check for grid elements set to 0 to prevent divide by 0 error causing invalid
					// argument errors in IE (see ticket #6950)
					top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
					pageY = containment ? top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3] ? top : top - this.offset.click.top >= containment[1] ? top - o.grid[1] : top + o.grid[1] : top;

					left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
					pageX = containment ? left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2] ? left : left - this.offset.click.left >= containment[0] ? left - o.grid[0] : left + o.grid[0] : left;
				}

				if (o.axis === "y") {
					pageX = this.originalPageX;
				}

				if (o.axis === "x") {
					pageY = this.originalPageY;
				}
			}

			return {
				top:

				// The absolute mouse position
				pageY -

				// Click offset (relative to the element)
				this.offset.click.top -

				// Only for relative positioned nodes: Relative offset from element to offset parent
				this.offset.relative.top -

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.top + (this.cssPosition === "fixed" ? -this.offset.scroll.top : scrollIsRootNode ? 0 : this.offset.scroll.top),
				left:

				// The absolute mouse position
				pageX -

				// Click offset (relative to the element)
				this.offset.click.left -

				// Only for relative positioned nodes: Relative offset from element to offset parent
				this.offset.relative.left -

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.left + (this.cssPosition === "fixed" ? -this.offset.scroll.left : scrollIsRootNode ? 0 : this.offset.scroll.left)
			};
		},

		_clear: function _clear() {
			this._removeClass(this.helper, "ui-draggable-dragging");
			if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
				this.helper.remove();
			}
			this.helper = null;
			this.cancelHelperRemoval = false;
			if (this.destroyOnClear) {
				this.destroy();
			}
		},

		// From now on bulk stuff - mainly helpers

		_trigger: function _trigger(type, event, ui) {
			ui = ui || this._uiHash();
			$.ui.plugin.call(this, type, [event, ui, this], true);

			// Absolute position and offset (see #6884 ) have to be recalculated after plugins
			if (/^(drag|start|stop)/.test(type)) {
				this.positionAbs = this._convertPositionTo("absolute");
				ui.offset = this.positionAbs;
			}
			return $.Widget.prototype._trigger.call(this, type, event, ui);
		},

		plugins: {},

		_uiHash: function _uiHash() {
			return {
				helper: this.helper,
				position: this.position,
				originalPosition: this.originalPosition,
				offset: this.positionAbs
			};
		}

	});

	$.ui.plugin.add("draggable", "connectToSortable", {
		start: function start(event, ui, draggable) {
			var uiSortable = $.extend({}, ui, {
				item: draggable.element
			});

			draggable.sortables = [];
			$(draggable.options.connectToSortable).each(function () {
				var sortable = $(this).sortable("instance");

				if (sortable && !sortable.options.disabled) {
					draggable.sortables.push(sortable);

					// RefreshPositions is called at drag start to refresh the containerCache
					// which is used in drag. This ensures it's initialized and synchronized
					// with any changes that might have happened on the page since initialization.
					sortable.refreshPositions();
					sortable._trigger("activate", event, uiSortable);
				}
			});
		},
		stop: function stop(event, ui, draggable) {
			var uiSortable = $.extend({}, ui, {
				item: draggable.element
			});

			draggable.cancelHelperRemoval = false;

			$.each(draggable.sortables, function () {
				var sortable = this;

				if (sortable.isOver) {
					sortable.isOver = 0;

					// Allow this sortable to handle removing the helper
					draggable.cancelHelperRemoval = true;
					sortable.cancelHelperRemoval = false;

					// Use _storedCSS To restore properties in the sortable,
					// as this also handles revert (#9675) since the draggable
					// may have modified them in unexpected ways (#8809)
					sortable._storedCSS = {
						position: sortable.placeholder.css("position"),
						top: sortable.placeholder.css("top"),
						left: sortable.placeholder.css("left")
					};

					sortable._mouseStop(event);

					// Once drag has ended, the sortable should return to using
					// its original helper, not the shared helper from draggable
					sortable.options.helper = sortable.options._helper;
				} else {

					// Prevent this Sortable from removing the helper.
					// However, don't set the draggable to remove the helper
					// either as another connected Sortable may yet handle the removal.
					sortable.cancelHelperRemoval = true;

					sortable._trigger("deactivate", event, uiSortable);
				}
			});
		},
		drag: function drag(event, ui, draggable) {
			$.each(draggable.sortables, function () {
				var innermostIntersecting = false,
				    sortable = this;

				// Copy over variables that sortable's _intersectsWith uses
				sortable.positionAbs = draggable.positionAbs;
				sortable.helperProportions = draggable.helperProportions;
				sortable.offset.click = draggable.offset.click;

				if (sortable._intersectsWith(sortable.containerCache)) {
					innermostIntersecting = true;

					$.each(draggable.sortables, function () {

						// Copy over variables that sortable's _intersectsWith uses
						this.positionAbs = draggable.positionAbs;
						this.helperProportions = draggable.helperProportions;
						this.offset.click = draggable.offset.click;

						if (this !== sortable && this._intersectsWith(this.containerCache) && $.contains(sortable.element[0], this.element[0])) {
							innermostIntersecting = false;
						}

						return innermostIntersecting;
					});
				}

				if (innermostIntersecting) {

					// If it intersects, we use a little isOver variable and set it once,
					// so that the move-in stuff gets fired only once.
					if (!sortable.isOver) {
						sortable.isOver = 1;

						// Store draggable's parent in case we need to reappend to it later.
						draggable._parent = ui.helper.parent();

						sortable.currentItem = ui.helper.appendTo(sortable.element).data("ui-sortable-item", true);

						// Store helper option to later restore it
						sortable.options._helper = sortable.options.helper;

						sortable.options.helper = function () {
							return ui.helper[0];
						};

						// Fire the start events of the sortable with our passed browser event,
						// and our own helper (so it doesn't create a new one)
						event.target = sortable.currentItem[0];
						sortable._mouseCapture(event, true);
						sortable._mouseStart(event, true, true);

						// Because the browser event is way off the new appended portlet,
						// modify necessary variables to reflect the changes
						sortable.offset.click.top = draggable.offset.click.top;
						sortable.offset.click.left = draggable.offset.click.left;
						sortable.offset.parent.left -= draggable.offset.parent.left - sortable.offset.parent.left;
						sortable.offset.parent.top -= draggable.offset.parent.top - sortable.offset.parent.top;

						draggable._trigger("toSortable", event);

						// Inform draggable that the helper is in a valid drop zone,
						// used solely in the revert option to handle "valid/invalid".
						draggable.dropped = sortable.element;

						// Need to refreshPositions of all sortables in the case that
						// adding to one sortable changes the location of the other sortables (#9675)
						$.each(draggable.sortables, function () {
							this.refreshPositions();
						});

						// Hack so receive/update callbacks work (mostly)
						draggable.currentItem = draggable.element;
						sortable.fromOutside = draggable;
					}

					if (sortable.currentItem) {
						sortable._mouseDrag(event);

						// Copy the sortable's position because the draggable's can potentially reflect
						// a relative position, while sortable is always absolute, which the dragged
						// element has now become. (#8809)
						ui.position = sortable.position;
					}
				} else {

					// If it doesn't intersect with the sortable, and it intersected before,
					// we fake the drag stop of the sortable, but make sure it doesn't remove
					// the helper by using cancelHelperRemoval.
					if (sortable.isOver) {

						sortable.isOver = 0;
						sortable.cancelHelperRemoval = true;

						// Calling sortable's mouseStop would trigger a revert,
						// so revert must be temporarily false until after mouseStop is called.
						sortable.options._revert = sortable.options.revert;
						sortable.options.revert = false;

						sortable._trigger("out", event, sortable._uiHash(sortable));
						sortable._mouseStop(event, true);

						// Restore sortable behaviors that were modfied
						// when the draggable entered the sortable area (#9481)
						sortable.options.revert = sortable.options._revert;
						sortable.options.helper = sortable.options._helper;

						if (sortable.placeholder) {
							sortable.placeholder.remove();
						}

						// Restore and recalculate the draggable's offset considering the sortable
						// may have modified them in unexpected ways. (#8809, #10669)
						ui.helper.appendTo(draggable._parent);
						draggable._refreshOffsets(event);
						ui.position = draggable._generatePosition(event, true);

						draggable._trigger("fromSortable", event);

						// Inform draggable that the helper is no longer in a valid drop zone
						draggable.dropped = false;

						// Need to refreshPositions of all sortables just in case removing
						// from one sortable changes the location of other sortables (#9675)
						$.each(draggable.sortables, function () {
							this.refreshPositions();
						});
					}
				}
			});
		}
	});

	$.ui.plugin.add("draggable", "cursor", {
		start: function start(event, ui, instance) {
			var t = $("body"),
			    o = instance.options;

			if (t.css("cursor")) {
				o._cursor = t.css("cursor");
			}
			t.css("cursor", o.cursor);
		},
		stop: function stop(event, ui, instance) {
			var o = instance.options;
			if (o._cursor) {
				$("body").css("cursor", o._cursor);
			}
		}
	});

	$.ui.plugin.add("draggable", "opacity", {
		start: function start(event, ui, instance) {
			var t = $(ui.helper),
			    o = instance.options;
			if (t.css("opacity")) {
				o._opacity = t.css("opacity");
			}
			t.css("opacity", o.opacity);
		},
		stop: function stop(event, ui, instance) {
			var o = instance.options;
			if (o._opacity) {
				$(ui.helper).css("opacity", o._opacity);
			}
		}
	});

	$.ui.plugin.add("draggable", "scroll", {
		start: function start(event, ui, i) {
			if (!i.scrollParentNotHidden) {
				i.scrollParentNotHidden = i.helper.scrollParent(false);
			}

			if (i.scrollParentNotHidden[0] !== i.document[0] && i.scrollParentNotHidden[0].tagName !== "HTML") {
				i.overflowOffset = i.scrollParentNotHidden.offset();
			}
		},
		drag: function drag(event, ui, i) {

			var o = i.options,
			    scrolled = false,
			    scrollParent = i.scrollParentNotHidden[0],
			    document = i.document[0];

			if (scrollParent !== document && scrollParent.tagName !== "HTML") {
				if (!o.axis || o.axis !== "x") {
					if (i.overflowOffset.top + scrollParent.offsetHeight - event.pageY < o.scrollSensitivity) {
						scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
					} else if (event.pageY - i.overflowOffset.top < o.scrollSensitivity) {
						scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
					}
				}

				if (!o.axis || o.axis !== "y") {
					if (i.overflowOffset.left + scrollParent.offsetWidth - event.pageX < o.scrollSensitivity) {
						scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
					} else if (event.pageX - i.overflowOffset.left < o.scrollSensitivity) {
						scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
					}
				}
			} else {

				if (!o.axis || o.axis !== "x") {
					if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
						scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
					} else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
						scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
					}
				}

				if (!o.axis || o.axis !== "y") {
					if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
						scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
					} else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
						scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
					}
				}
			}

			if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
				$.ui.ddmanager.prepareOffsets(i, event);
			}
		}
	});

	$.ui.plugin.add("draggable", "snap", {
		start: function start(event, ui, i) {

			var o = i.options;

			i.snapElements = [];

			$(o.snap.constructor !== String ? o.snap.items || ":data(ui-draggable)" : o.snap).each(function () {
				var $t = $(this),
				    $o = $t.offset();
				if (this !== i.element[0]) {
					i.snapElements.push({
						item: this,
						width: $t.outerWidth(), height: $t.outerHeight(),
						top: $o.top, left: $o.left
					});
				}
			});
		},
		drag: function drag(event, ui, inst) {

			var ts,
			    bs,
			    ls,
			    rs,
			    l,
			    r,
			    t,
			    b,
			    i,
			    first,
			    o = inst.options,
			    d = o.snapTolerance,
			    x1 = ui.offset.left,
			    x2 = x1 + inst.helperProportions.width,
			    y1 = ui.offset.top,
			    y2 = y1 + inst.helperProportions.height;

			for (i = inst.snapElements.length - 1; i >= 0; i--) {

				l = inst.snapElements[i].left - inst.margins.left;
				r = l + inst.snapElements[i].width;
				t = inst.snapElements[i].top - inst.margins.top;
				b = t + inst.snapElements[i].height;

				if (x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains(inst.snapElements[i].item.ownerDocument, inst.snapElements[i].item)) {
					if (inst.snapElements[i].snapping) {
						inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }));
					}
					inst.snapElements[i].snapping = false;
					continue;
				}

				if (o.snapMode !== "inner") {
					ts = Math.abs(t - y2) <= d;
					bs = Math.abs(b - y1) <= d;
					ls = Math.abs(l - x2) <= d;
					rs = Math.abs(r - x1) <= d;
					if (ts) {
						ui.position.top = inst._convertPositionTo("relative", {
							top: t - inst.helperProportions.height,
							left: 0
						}).top;
					}
					if (bs) {
						ui.position.top = inst._convertPositionTo("relative", {
							top: b,
							left: 0
						}).top;
					}
					if (ls) {
						ui.position.left = inst._convertPositionTo("relative", {
							top: 0,
							left: l - inst.helperProportions.width
						}).left;
					}
					if (rs) {
						ui.position.left = inst._convertPositionTo("relative", {
							top: 0,
							left: r
						}).left;
					}
				}

				first = ts || bs || ls || rs;

				if (o.snapMode !== "outer") {
					ts = Math.abs(t - y1) <= d;
					bs = Math.abs(b - y2) <= d;
					ls = Math.abs(l - x1) <= d;
					rs = Math.abs(r - x2) <= d;
					if (ts) {
						ui.position.top = inst._convertPositionTo("relative", {
							top: t,
							left: 0
						}).top;
					}
					if (bs) {
						ui.position.top = inst._convertPositionTo("relative", {
							top: b - inst.helperProportions.height,
							left: 0
						}).top;
					}
					if (ls) {
						ui.position.left = inst._convertPositionTo("relative", {
							top: 0,
							left: l
						}).left;
					}
					if (rs) {
						ui.position.left = inst._convertPositionTo("relative", {
							top: 0,
							left: r - inst.helperProportions.width
						}).left;
					}
				}

				if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
					inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), {
						snapItem: inst.snapElements[i].item
					}));
				}
				inst.snapElements[i].snapping = ts || bs || ls || rs || first;
			}
		}
	});

	$.ui.plugin.add("draggable", "stack", {
		start: function start(event, ui, instance) {
			var min,
			    o = instance.options,
			    group = $.makeArray($(o.stack)).sort(function (a, b) {
				return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
			});

			if (!group.length) {
				return;
			}

			min = parseInt($(group[0]).css("zIndex"), 10) || 0;
			$(group).each(function (i) {
				$(this).css("zIndex", min + i);
			});
			this.css("zIndex", min + group.length);
		}
	});

	$.ui.plugin.add("draggable", "zIndex", {
		start: function start(event, ui, instance) {
			var t = $(ui.helper),
			    o = instance.options;

			if (t.css("zIndex")) {
				o._zIndex = t.css("zIndex");
			}
			t.css("zIndex", o.zIndex);
		},
		stop: function stop(event, ui, instance) {
			var o = instance.options;

			if (o._zIndex) {
				$(ui.helper).css("zIndex", o._zIndex);
			}
		}
	});

	var widgetsDraggable = $.ui.draggable;

	/*!
  * jQuery UI Resizable 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Resizable
	//>>group: Interactions
	//>>description: Enables resize functionality for any element.
	//>>docs: http://api.jqueryui.com/resizable/
	//>>demos: http://jqueryui.com/resizable/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/resizable.css
	//>>css.theme: ../../themes/base/theme.css


	$.widget("ui.resizable", $.ui.mouse, {
		version: "1.12.1",
		widgetEventPrefix: "resize",
		options: {
			alsoResize: false,
			animate: false,
			animateDuration: "slow",
			animateEasing: "swing",
			aspectRatio: false,
			autoHide: false,
			classes: {
				"ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
			},
			containment: false,
			ghost: false,
			grid: false,
			handles: "e,s,se",
			helper: false,
			maxHeight: null,
			maxWidth: null,
			minHeight: 10,
			minWidth: 10,

			// See #7960
			zIndex: 90,

			// Callbacks
			resize: null,
			start: null,
			stop: null
		},

		_num: function _num(value) {
			return parseFloat(value) || 0;
		},

		_isNumber: function _isNumber(value) {
			return !isNaN(parseFloat(value));
		},

		_hasScroll: function _hasScroll(el, a) {

			if ($(el).css("overflow") === "hidden") {
				return false;
			}

			var scroll = a && a === "left" ? "scrollLeft" : "scrollTop",
			    has = false;

			if (el[scroll] > 0) {
				return true;
			}

			// TODO: determine which cases actually cause this to happen
			// if the element doesn't have the scroll set, see if it's possible to
			// set the scroll
			el[scroll] = 1;
			has = el[scroll] > 0;
			el[scroll] = 0;
			return has;
		},

		_create: function _create() {

			var margins,
			    o = this.options,
			    that = this;
			this._addClass("ui-resizable");

			$.extend(this, {
				_aspectRatio: !!o.aspectRatio,
				aspectRatio: o.aspectRatio,
				originalElement: this.element,
				_proportionallyResizeElements: [],
				_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
			});

			// Wrap the element if it cannot hold child nodes
			if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {

				this.element.wrap($("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
					position: this.element.css("position"),
					width: this.element.outerWidth(),
					height: this.element.outerHeight(),
					top: this.element.css("top"),
					left: this.element.css("left")
				}));

				this.element = this.element.parent().data("ui-resizable", this.element.resizable("instance"));

				this.elementIsWrapper = true;

				margins = {
					marginTop: this.originalElement.css("marginTop"),
					marginRight: this.originalElement.css("marginRight"),
					marginBottom: this.originalElement.css("marginBottom"),
					marginLeft: this.originalElement.css("marginLeft")
				};

				this.element.css(margins);
				this.originalElement.css("margin", 0);

				// support: Safari
				// Prevent Safari textarea resize
				this.originalResizeStyle = this.originalElement.css("resize");
				this.originalElement.css("resize", "none");

				this._proportionallyResizeElements.push(this.originalElement.css({
					position: "static",
					zoom: 1,
					display: "block"
				}));

				// Support: IE9
				// avoid IE jump (hard set the margin)
				this.originalElement.css(margins);

				this._proportionallyResize();
			}

			this._setupHandles();

			if (o.autoHide) {
				$(this.element).on("mouseenter", function () {
					if (o.disabled) {
						return;
					}
					that._removeClass("ui-resizable-autohide");
					that._handles.show();
				}).on("mouseleave", function () {
					if (o.disabled) {
						return;
					}
					if (!that.resizing) {
						that._addClass("ui-resizable-autohide");
						that._handles.hide();
					}
				});
			}

			this._mouseInit();
		},

		_destroy: function _destroy() {

			this._mouseDestroy();

			var wrapper,
			    _destroy = function _destroy(exp) {
				$(exp).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove();
			};

			// TODO: Unwrap at same DOM position
			if (this.elementIsWrapper) {
				_destroy(this.element);
				wrapper = this.element;
				this.originalElement.css({
					position: wrapper.css("position"),
					width: wrapper.outerWidth(),
					height: wrapper.outerHeight(),
					top: wrapper.css("top"),
					left: wrapper.css("left")
				}).insertAfter(wrapper);
				wrapper.remove();
			}

			this.originalElement.css("resize", this.originalResizeStyle);
			_destroy(this.originalElement);

			return this;
		},

		_setOption: function _setOption(key, value) {
			this._super(key, value);

			switch (key) {
				case "handles":
					this._removeHandles();
					this._setupHandles();
					break;
				default:
					break;
			}
		},

		_setupHandles: function _setupHandles() {
			var o = this.options,
			    handle,
			    i,
			    n,
			    hname,
			    axis,
			    that = this;
			this.handles = o.handles || (!$(".ui-resizable-handle", this.element).length ? "e,s,se" : {
				n: ".ui-resizable-n",
				e: ".ui-resizable-e",
				s: ".ui-resizable-s",
				w: ".ui-resizable-w",
				se: ".ui-resizable-se",
				sw: ".ui-resizable-sw",
				ne: ".ui-resizable-ne",
				nw: ".ui-resizable-nw"
			});

			this._handles = $();
			if (this.handles.constructor === String) {

				if (this.handles === "all") {
					this.handles = "n,e,s,w,se,sw,ne,nw";
				}

				n = this.handles.split(",");
				this.handles = {};

				for (i = 0; i < n.length; i++) {

					handle = $.trim(n[i]);
					hname = "ui-resizable-" + handle;
					axis = $("<div>");
					this._addClass(axis, "ui-resizable-handle " + hname);

					axis.css({ zIndex: o.zIndex });

					this.handles[handle] = ".ui-resizable-" + handle;
					this.element.append(axis);
				}
			}

			this._renderAxis = function (target) {

				var i, axis, padPos, padWrapper;

				target = target || this.element;

				for (i in this.handles) {

					if (this.handles[i].constructor === String) {
						this.handles[i] = this.element.children(this.handles[i]).first().show();
					} else if (this.handles[i].jquery || this.handles[i].nodeType) {
						this.handles[i] = $(this.handles[i]);
						this._on(this.handles[i], { "mousedown": that._mouseDown });
					}

					if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
						axis = $(this.handles[i], this.element);

						padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();

						padPos = ["padding", /ne|nw|n/.test(i) ? "Top" : /se|sw|s/.test(i) ? "Bottom" : /^e$/.test(i) ? "Right" : "Left"].join("");

						target.css(padPos, padWrapper);

						this._proportionallyResize();
					}

					this._handles = this._handles.add(this.handles[i]);
				}
			};

			// TODO: make renderAxis a prototype function
			this._renderAxis(this.element);

			this._handles = this._handles.add(this.element.find(".ui-resizable-handle"));
			this._handles.disableSelection();

			this._handles.on("mouseover", function () {
				if (!that.resizing) {
					if (this.className) {
						axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
					}
					that.axis = axis && axis[1] ? axis[1] : "se";
				}
			});

			if (o.autoHide) {
				this._handles.hide();
				this._addClass("ui-resizable-autohide");
			}
		},

		_removeHandles: function _removeHandles() {
			this._handles.remove();
		},

		_mouseCapture: function _mouseCapture(event) {
			var i,
			    handle,
			    capture = false;

			for (i in this.handles) {
				handle = $(this.handles[i])[0];
				if (handle === event.target || $.contains(handle, event.target)) {
					capture = true;
				}
			}

			return !this.options.disabled && capture;
		},

		_mouseStart: function _mouseStart(event) {

			var curleft,
			    curtop,
			    cursor,
			    o = this.options,
			    el = this.element;

			this.resizing = true;

			this._renderProxy();

			curleft = this._num(this.helper.css("left"));
			curtop = this._num(this.helper.css("top"));

			if (o.containment) {
				curleft += $(o.containment).scrollLeft() || 0;
				curtop += $(o.containment).scrollTop() || 0;
			}

			this.offset = this.helper.offset();
			this.position = { left: curleft, top: curtop };

			this.size = this._helper ? {
				width: this.helper.width(),
				height: this.helper.height()
			} : {
				width: el.width(),
				height: el.height()
			};

			this.originalSize = this._helper ? {
				width: el.outerWidth(),
				height: el.outerHeight()
			} : {
				width: el.width(),
				height: el.height()
			};

			this.sizeDiff = {
				width: el.outerWidth() - el.width(),
				height: el.outerHeight() - el.height()
			};

			this.originalPosition = { left: curleft, top: curtop };
			this.originalMousePosition = { left: event.pageX, top: event.pageY };

			this.aspectRatio = typeof o.aspectRatio === "number" ? o.aspectRatio : this.originalSize.width / this.originalSize.height || 1;

			cursor = $(".ui-resizable-" + this.axis).css("cursor");
			$("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);

			this._addClass("ui-resizable-resizing");
			this._propagate("start", event);
			return true;
		},

		_mouseDrag: function _mouseDrag(event) {

			var data,
			    props,
			    smp = this.originalMousePosition,
			    a = this.axis,
			    dx = event.pageX - smp.left || 0,
			    dy = event.pageY - smp.top || 0,
			    trigger = this._change[a];

			this._updatePrevProperties();

			if (!trigger) {
				return false;
			}

			data = trigger.apply(this, [event, dx, dy]);

			this._updateVirtualBoundaries(event.shiftKey);
			if (this._aspectRatio || event.shiftKey) {
				data = this._updateRatio(data, event);
			}

			data = this._respectSize(data, event);

			this._updateCache(data);

			this._propagate("resize", event);

			props = this._applyChanges();

			if (!this._helper && this._proportionallyResizeElements.length) {
				this._proportionallyResize();
			}

			if (!$.isEmptyObject(props)) {
				this._updatePrevProperties();
				this._trigger("resize", event, this.ui());
				this._applyChanges();
			}

			return false;
		},

		_mouseStop: function _mouseStop(event) {

			this.resizing = false;
			var pr,
			    ista,
			    soffseth,
			    soffsetw,
			    s,
			    left,
			    top,
			    o = this.options,
			    that = this;

			if (this._helper) {

				pr = this._proportionallyResizeElements;
				ista = pr.length && /textarea/i.test(pr[0].nodeName);
				soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
				soffsetw = ista ? 0 : that.sizeDiff.width;

				s = {
					width: that.helper.width() - soffsetw,
					height: that.helper.height() - soffseth
				};
				left = parseFloat(that.element.css("left")) + (that.position.left - that.originalPosition.left) || null;
				top = parseFloat(that.element.css("top")) + (that.position.top - that.originalPosition.top) || null;

				if (!o.animate) {
					this.element.css($.extend(s, { top: top, left: left }));
				}

				that.helper.height(that.size.height);
				that.helper.width(that.size.width);

				if (this._helper && !o.animate) {
					this._proportionallyResize();
				}
			}

			$("body").css("cursor", "auto");

			this._removeClass("ui-resizable-resizing");

			this._propagate("stop", event);

			if (this._helper) {
				this.helper.remove();
			}

			return false;
		},

		_updatePrevProperties: function _updatePrevProperties() {
			this.prevPosition = {
				top: this.position.top,
				left: this.position.left
			};
			this.prevSize = {
				width: this.size.width,
				height: this.size.height
			};
		},

		_applyChanges: function _applyChanges() {
			var props = {};

			if (this.position.top !== this.prevPosition.top) {
				props.top = this.position.top + "px";
			}
			if (this.position.left !== this.prevPosition.left) {
				props.left = this.position.left + "px";
			}
			if (this.size.width !== this.prevSize.width) {
				props.width = this.size.width + "px";
			}
			if (this.size.height !== this.prevSize.height) {
				props.height = this.size.height + "px";
			}

			this.helper.css(props);

			return props;
		},

		_updateVirtualBoundaries: function _updateVirtualBoundaries(forceAspectRatio) {
			var pMinWidth,
			    pMaxWidth,
			    pMinHeight,
			    pMaxHeight,
			    b,
			    o = this.options;

			b = {
				minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
				maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
				minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
				maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
			};

			if (this._aspectRatio || forceAspectRatio) {
				pMinWidth = b.minHeight * this.aspectRatio;
				pMinHeight = b.minWidth / this.aspectRatio;
				pMaxWidth = b.maxHeight * this.aspectRatio;
				pMaxHeight = b.maxWidth / this.aspectRatio;

				if (pMinWidth > b.minWidth) {
					b.minWidth = pMinWidth;
				}
				if (pMinHeight > b.minHeight) {
					b.minHeight = pMinHeight;
				}
				if (pMaxWidth < b.maxWidth) {
					b.maxWidth = pMaxWidth;
				}
				if (pMaxHeight < b.maxHeight) {
					b.maxHeight = pMaxHeight;
				}
			}
			this._vBoundaries = b;
		},

		_updateCache: function _updateCache(data) {
			this.offset = this.helper.offset();
			if (this._isNumber(data.left)) {
				this.position.left = data.left;
			}
			if (this._isNumber(data.top)) {
				this.position.top = data.top;
			}
			if (this._isNumber(data.height)) {
				this.size.height = data.height;
			}
			if (this._isNumber(data.width)) {
				this.size.width = data.width;
			}
		},

		_updateRatio: function _updateRatio(data) {

			var cpos = this.position,
			    csize = this.size,
			    a = this.axis;

			if (this._isNumber(data.height)) {
				data.width = data.height * this.aspectRatio;
			} else if (this._isNumber(data.width)) {
				data.height = data.width / this.aspectRatio;
			}

			if (a === "sw") {
				data.left = cpos.left + (csize.width - data.width);
				data.top = null;
			}
			if (a === "nw") {
				data.top = cpos.top + (csize.height - data.height);
				data.left = cpos.left + (csize.width - data.width);
			}

			return data;
		},

		_respectSize: function _respectSize(data) {

			var o = this._vBoundaries,
			    a = this.axis,
			    ismaxw = this._isNumber(data.width) && o.maxWidth && o.maxWidth < data.width,
			    ismaxh = this._isNumber(data.height) && o.maxHeight && o.maxHeight < data.height,
			    isminw = this._isNumber(data.width) && o.minWidth && o.minWidth > data.width,
			    isminh = this._isNumber(data.height) && o.minHeight && o.minHeight > data.height,
			    dw = this.originalPosition.left + this.originalSize.width,
			    dh = this.originalPosition.top + this.originalSize.height,
			    cw = /sw|nw|w/.test(a),
			    ch = /nw|ne|n/.test(a);
			if (isminw) {
				data.width = o.minWidth;
			}
			if (isminh) {
				data.height = o.minHeight;
			}
			if (ismaxw) {
				data.width = o.maxWidth;
			}
			if (ismaxh) {
				data.height = o.maxHeight;
			}

			if (isminw && cw) {
				data.left = dw - o.minWidth;
			}
			if (ismaxw && cw) {
				data.left = dw - o.maxWidth;
			}
			if (isminh && ch) {
				data.top = dh - o.minHeight;
			}
			if (ismaxh && ch) {
				data.top = dh - o.maxHeight;
			}

			// Fixing jump error on top/left - bug #2330
			if (!data.width && !data.height && !data.left && data.top) {
				data.top = null;
			} else if (!data.width && !data.height && !data.top && data.left) {
				data.left = null;
			}

			return data;
		},

		_getPaddingPlusBorderDimensions: function _getPaddingPlusBorderDimensions(element) {
			var i = 0,
			    widths = [],
			    borders = [element.css("borderTopWidth"), element.css("borderRightWidth"), element.css("borderBottomWidth"), element.css("borderLeftWidth")],
			    paddings = [element.css("paddingTop"), element.css("paddingRight"), element.css("paddingBottom"), element.css("paddingLeft")];

			for (; i < 4; i++) {
				widths[i] = parseFloat(borders[i]) || 0;
				widths[i] += parseFloat(paddings[i]) || 0;
			}

			return {
				height: widths[0] + widths[2],
				width: widths[1] + widths[3]
			};
		},

		_proportionallyResize: function _proportionallyResize() {

			if (!this._proportionallyResizeElements.length) {
				return;
			}

			var prel,
			    i = 0,
			    element = this.helper || this.element;

			for (; i < this._proportionallyResizeElements.length; i++) {

				prel = this._proportionallyResizeElements[i];

				// TODO: Seems like a bug to cache this.outerDimensions
				// considering that we are in a loop.
				if (!this.outerDimensions) {
					this.outerDimensions = this._getPaddingPlusBorderDimensions(prel);
				}

				prel.css({
					height: element.height() - this.outerDimensions.height || 0,
					width: element.width() - this.outerDimensions.width || 0
				});
			}
		},

		_renderProxy: function _renderProxy() {

			var el = this.element,
			    o = this.options;
			this.elementOffset = el.offset();

			if (this._helper) {

				this.helper = this.helper || $("<div style='overflow:hidden;'></div>");

				this._addClass(this.helper, this._helper);
				this.helper.css({
					width: this.element.outerWidth(),
					height: this.element.outerHeight(),
					position: "absolute",
					left: this.elementOffset.left + "px",
					top: this.elementOffset.top + "px",
					zIndex: ++o.zIndex //TODO: Don't modify option
				});

				this.helper.appendTo("body").disableSelection();
			} else {
				this.helper = this.element;
			}
		},

		_change: {
			e: function e(event, dx) {
				return { width: this.originalSize.width + dx };
			},
			w: function w(event, dx) {
				var cs = this.originalSize,
				    sp = this.originalPosition;
				return { left: sp.left + dx, width: cs.width - dx };
			},
			n: function n(event, dx, dy) {
				var cs = this.originalSize,
				    sp = this.originalPosition;
				return { top: sp.top + dy, height: cs.height - dy };
			},
			s: function s(event, dx, dy) {
				return { height: this.originalSize.height + dy };
			},
			se: function se(event, dx, dy) {
				return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
			},
			sw: function sw(event, dx, dy) {
				return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
			},
			ne: function ne(event, dx, dy) {
				return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
			},
			nw: function nw(event, dx, dy) {
				return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
			}
		},

		_propagate: function _propagate(n, event) {
			$.ui.plugin.call(this, n, [event, this.ui()]);
			n !== "resize" && this._trigger(n, event, this.ui());
		},

		plugins: {},

		ui: function ui() {
			return {
				originalElement: this.originalElement,
				element: this.element,
				helper: this.helper,
				position: this.position,
				size: this.size,
				originalSize: this.originalSize,
				originalPosition: this.originalPosition
			};
		}

	});

	/*
  * Resizable Extensions
  */

	$.ui.plugin.add("resizable", "animate", {

		stop: function stop(event) {
			var that = $(this).resizable("instance"),
			    o = that.options,
			    pr = that._proportionallyResizeElements,
			    ista = pr.length && /textarea/i.test(pr[0].nodeName),
			    soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
			    soffsetw = ista ? 0 : that.sizeDiff.width,
			    style = {
				width: that.size.width - soffsetw,
				height: that.size.height - soffseth
			},
			    left = parseFloat(that.element.css("left")) + (that.position.left - that.originalPosition.left) || null,
			    top = parseFloat(that.element.css("top")) + (that.position.top - that.originalPosition.top) || null;

			that.element.animate($.extend(style, top && left ? { top: top, left: left } : {}), {
				duration: o.animateDuration,
				easing: o.animateEasing,
				step: function step() {

					var data = {
						width: parseFloat(that.element.css("width")),
						height: parseFloat(that.element.css("height")),
						top: parseFloat(that.element.css("top")),
						left: parseFloat(that.element.css("left"))
					};

					if (pr && pr.length) {
						$(pr[0]).css({ width: data.width, height: data.height });
					}

					// Propagating resize, and updating values for each animation step
					that._updateCache(data);
					that._propagate("resize", event);
				}
			});
		}

	});

	$.ui.plugin.add("resizable", "containment", {

		start: function start() {
			var element,
			    p,
			    co,
			    ch,
			    cw,
			    width,
			    height,
			    that = $(this).resizable("instance"),
			    o = that.options,
			    el = that.element,
			    oc = o.containment,
			    ce = oc instanceof $ ? oc.get(0) : /parent/.test(oc) ? el.parent().get(0) : oc;

			if (!ce) {
				return;
			}

			that.containerElement = $(ce);

			if (/document/.test(oc) || oc === document) {
				that.containerOffset = {
					left: 0,
					top: 0
				};
				that.containerPosition = {
					left: 0,
					top: 0
				};

				that.parentData = {
					element: $(document),
					left: 0,
					top: 0,
					width: $(document).width(),
					height: $(document).height() || document.body.parentNode.scrollHeight
				};
			} else {
				element = $(ce);
				p = [];
				$(["Top", "Right", "Left", "Bottom"]).each(function (i, name) {
					p[i] = that._num(element.css("padding" + name));
				});

				that.containerOffset = element.offset();
				that.containerPosition = element.position();
				that.containerSize = {
					height: element.innerHeight() - p[3],
					width: element.innerWidth() - p[1]
				};

				co = that.containerOffset;
				ch = that.containerSize.height;
				cw = that.containerSize.width;
				width = that._hasScroll(ce, "left") ? ce.scrollWidth : cw;
				height = that._hasScroll(ce) ? ce.scrollHeight : ch;

				that.parentData = {
					element: ce,
					left: co.left,
					top: co.top,
					width: width,
					height: height
				};
			}
		},

		resize: function resize(event) {
			var woset,
			    hoset,
			    isParent,
			    isOffsetRelative,
			    that = $(this).resizable("instance"),
			    o = that.options,
			    co = that.containerOffset,
			    cp = that.position,
			    pRatio = that._aspectRatio || event.shiftKey,
			    cop = {
				top: 0,
				left: 0
			},
			    ce = that.containerElement,
			    continueResize = true;

			if (ce[0] !== document && /static/.test(ce.css("position"))) {
				cop = co;
			}

			if (cp.left < (that._helper ? co.left : 0)) {
				that.size.width = that.size.width + (that._helper ? that.position.left - co.left : that.position.left - cop.left);

				if (pRatio) {
					that.size.height = that.size.width / that.aspectRatio;
					continueResize = false;
				}
				that.position.left = o.helper ? co.left : 0;
			}

			if (cp.top < (that._helper ? co.top : 0)) {
				that.size.height = that.size.height + (that._helper ? that.position.top - co.top : that.position.top);

				if (pRatio) {
					that.size.width = that.size.height * that.aspectRatio;
					continueResize = false;
				}
				that.position.top = that._helper ? co.top : 0;
			}

			isParent = that.containerElement.get(0) === that.element.parent().get(0);
			isOffsetRelative = /relative|absolute/.test(that.containerElement.css("position"));

			if (isParent && isOffsetRelative) {
				that.offset.left = that.parentData.left + that.position.left;
				that.offset.top = that.parentData.top + that.position.top;
			} else {
				that.offset.left = that.element.offset().left;
				that.offset.top = that.element.offset().top;
			}

			woset = Math.abs(that.sizeDiff.width + (that._helper ? that.offset.left - cop.left : that.offset.left - co.left));

			hoset = Math.abs(that.sizeDiff.height + (that._helper ? that.offset.top - cop.top : that.offset.top - co.top));

			if (woset + that.size.width >= that.parentData.width) {
				that.size.width = that.parentData.width - woset;
				if (pRatio) {
					that.size.height = that.size.width / that.aspectRatio;
					continueResize = false;
				}
			}

			if (hoset + that.size.height >= that.parentData.height) {
				that.size.height = that.parentData.height - hoset;
				if (pRatio) {
					that.size.width = that.size.height * that.aspectRatio;
					continueResize = false;
				}
			}

			if (!continueResize) {
				that.position.left = that.prevPosition.left;
				that.position.top = that.prevPosition.top;
				that.size.width = that.prevSize.width;
				that.size.height = that.prevSize.height;
			}
		},

		stop: function stop() {
			var that = $(this).resizable("instance"),
			    o = that.options,
			    co = that.containerOffset,
			    cop = that.containerPosition,
			    ce = that.containerElement,
			    helper = $(that.helper),
			    ho = helper.offset(),
			    w = helper.outerWidth() - that.sizeDiff.width,
			    h = helper.outerHeight() - that.sizeDiff.height;

			if (that._helper && !o.animate && /relative/.test(ce.css("position"))) {
				$(this).css({
					left: ho.left - cop.left - co.left,
					width: w,
					height: h
				});
			}

			if (that._helper && !o.animate && /static/.test(ce.css("position"))) {
				$(this).css({
					left: ho.left - cop.left - co.left,
					width: w,
					height: h
				});
			}
		}
	});

	$.ui.plugin.add("resizable", "alsoResize", {

		start: function start() {
			var that = $(this).resizable("instance"),
			    o = that.options;

			$(o.alsoResize).each(function () {
				var el = $(this);
				el.data("ui-resizable-alsoresize", {
					width: parseFloat(el.width()), height: parseFloat(el.height()),
					left: parseFloat(el.css("left")), top: parseFloat(el.css("top"))
				});
			});
		},

		resize: function resize(event, ui) {
			var that = $(this).resizable("instance"),
			    o = that.options,
			    os = that.originalSize,
			    op = that.originalPosition,
			    delta = {
				height: that.size.height - os.height || 0,
				width: that.size.width - os.width || 0,
				top: that.position.top - op.top || 0,
				left: that.position.left - op.left || 0
			};

			$(o.alsoResize).each(function () {
				var el = $(this),
				    start = $(this).data("ui-resizable-alsoresize"),
				    style = {},
				    css = el.parents(ui.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];

				$.each(css, function (i, prop) {
					var sum = (start[prop] || 0) + (delta[prop] || 0);
					if (sum && sum >= 0) {
						style[prop] = sum || null;
					}
				});

				el.css(style);
			});
		},

		stop: function stop() {
			$(this).removeData("ui-resizable-alsoresize");
		}
	});

	$.ui.plugin.add("resizable", "ghost", {

		start: function start() {

			var that = $(this).resizable("instance"),
			    cs = that.size;

			that.ghost = that.originalElement.clone();
			that.ghost.css({
				opacity: 0.25,
				display: "block",
				position: "relative",
				height: cs.height,
				width: cs.width,
				margin: 0,
				left: 0,
				top: 0
			});

			that._addClass(that.ghost, "ui-resizable-ghost");

			// DEPRECATED
			// TODO: remove after 1.12
			if ($.uiBackCompat !== false && typeof that.options.ghost === "string") {

				// Ghost option
				that.ghost.addClass(this.options.ghost);
			}

			that.ghost.appendTo(that.helper);
		},

		resize: function resize() {
			var that = $(this).resizable("instance");
			if (that.ghost) {
				that.ghost.css({
					position: "relative",
					height: that.size.height,
					width: that.size.width
				});
			}
		},

		stop: function stop() {
			var that = $(this).resizable("instance");
			if (that.ghost && that.helper) {
				that.helper.get(0).removeChild(that.ghost.get(0));
			}
		}

	});

	$.ui.plugin.add("resizable", "grid", {

		resize: function resize() {
			var outerDimensions,
			    that = $(this).resizable("instance"),
			    o = that.options,
			    cs = that.size,
			    os = that.originalSize,
			    op = that.originalPosition,
			    a = that.axis,
			    grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid,
			    gridX = grid[0] || 1,
			    gridY = grid[1] || 1,
			    ox = Math.round((cs.width - os.width) / gridX) * gridX,
			    oy = Math.round((cs.height - os.height) / gridY) * gridY,
			    newWidth = os.width + ox,
			    newHeight = os.height + oy,
			    isMaxWidth = o.maxWidth && o.maxWidth < newWidth,
			    isMaxHeight = o.maxHeight && o.maxHeight < newHeight,
			    isMinWidth = o.minWidth && o.minWidth > newWidth,
			    isMinHeight = o.minHeight && o.minHeight > newHeight;

			o.grid = grid;

			if (isMinWidth) {
				newWidth += gridX;
			}
			if (isMinHeight) {
				newHeight += gridY;
			}
			if (isMaxWidth) {
				newWidth -= gridX;
			}
			if (isMaxHeight) {
				newHeight -= gridY;
			}

			if (/^(se|s|e)$/.test(a)) {
				that.size.width = newWidth;
				that.size.height = newHeight;
			} else if (/^(ne)$/.test(a)) {
				that.size.width = newWidth;
				that.size.height = newHeight;
				that.position.top = op.top - oy;
			} else if (/^(sw)$/.test(a)) {
				that.size.width = newWidth;
				that.size.height = newHeight;
				that.position.left = op.left - ox;
			} else {
				if (newHeight - gridY <= 0 || newWidth - gridX <= 0) {
					outerDimensions = that._getPaddingPlusBorderDimensions(this);
				}

				if (newHeight - gridY > 0) {
					that.size.height = newHeight;
					that.position.top = op.top - oy;
				} else {
					newHeight = gridY - outerDimensions.height;
					that.size.height = newHeight;
					that.position.top = op.top + os.height - newHeight;
				}
				if (newWidth - gridX > 0) {
					that.size.width = newWidth;
					that.position.left = op.left - ox;
				} else {
					newWidth = gridX - outerDimensions.width;
					that.size.width = newWidth;
					that.position.left = op.left + os.width - newWidth;
				}
			}
		}

	});

	var widgetsResizable = $.ui.resizable;

	/*!
  * jQuery UI Dialog 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Dialog
	//>>group: Widgets
	//>>description: Displays customizable dialog windows.
	//>>docs: http://api.jqueryui.com/dialog/
	//>>demos: http://jqueryui.com/dialog/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/dialog.css
	//>>css.theme: ../../themes/base/theme.css


	$.widget("ui.dialog", {
		version: "1.12.1",
		options: {
			appendTo: "body",
			autoOpen: true,
			buttons: [],
			classes: {
				"ui-dialog": "ui-corner-all",
				"ui-dialog-titlebar": "ui-corner-all"
			},
			closeOnEscape: true,
			closeText: "Close",
			draggable: true,
			hide: null,
			height: "auto",
			maxHeight: null,
			maxWidth: null,
			minHeight: 150,
			minWidth: 150,
			modal: false,
			position: {
				my: "center",
				at: "center",
				of: window,
				collision: "fit",

				// Ensure the titlebar is always visible
				using: function using(pos) {
					var topOffset = $(this).css(pos).offset().top;
					if (topOffset < 0) {
						$(this).css("top", pos.top - topOffset);
					}
				}
			},
			resizable: true,
			show: null,
			title: null,
			width: 300,

			// Callbacks
			beforeClose: null,
			close: null,
			drag: null,
			dragStart: null,
			dragStop: null,
			focus: null,
			open: null,
			resize: null,
			resizeStart: null,
			resizeStop: null
		},

		sizeRelatedOptions: {
			buttons: true,
			height: true,
			maxHeight: true,
			maxWidth: true,
			minHeight: true,
			minWidth: true,
			width: true
		},

		resizableRelatedOptions: {
			maxHeight: true,
			maxWidth: true,
			minHeight: true,
			minWidth: true
		},

		_create: function _create() {
			this.originalCss = {
				display: this.element[0].style.display,
				width: this.element[0].style.width,
				minHeight: this.element[0].style.minHeight,
				maxHeight: this.element[0].style.maxHeight,
				height: this.element[0].style.height
			};
			this.originalPosition = {
				parent: this.element.parent(),
				index: this.element.parent().children().index(this.element)
			};
			this.originalTitle = this.element.attr("title");
			if (this.options.title == null && this.originalTitle != null) {
				this.options.title = this.originalTitle;
			}

			// Dialogs can't be disabled
			if (this.options.disabled) {
				this.options.disabled = false;
			}

			this._createWrapper();

			this.element.show().removeAttr("title").appendTo(this.uiDialog);

			this._addClass("ui-dialog-content", "ui-widget-content");

			this._createTitlebar();
			this._createButtonPane();

			if (this.options.draggable && $.fn.draggable) {
				this._makeDraggable();
			}
			if (this.options.resizable && $.fn.resizable) {
				this._makeResizable();
			}

			this._isOpen = false;

			this._trackFocus();
		},

		_init: function _init() {
			if (this.options.autoOpen) {
				this.open();
			}
		},

		_appendTo: function _appendTo() {
			var element = this.options.appendTo;
			if (element && (element.jquery || element.nodeType)) {
				return $(element);
			}
			return this.document.find(element || "body").eq(0);
		},

		_destroy: function _destroy() {
			var next,
			    originalPosition = this.originalPosition;

			this._untrackInstance();
			this._destroyOverlay();

			this.element.removeUniqueId().css(this.originalCss)

			// Without detaching first, the following becomes really slow
			.detach();

			this.uiDialog.remove();

			if (this.originalTitle) {
				this.element.attr("title", this.originalTitle);
			}

			next = originalPosition.parent.children().eq(originalPosition.index);

			// Don't try to place the dialog next to itself (#8613)
			if (next.length && next[0] !== this.element[0]) {
				next.before(this.element);
			} else {
				originalPosition.parent.append(this.element);
			}
		},

		widget: function widget() {
			return this.uiDialog;
		},

		disable: $.noop,
		enable: $.noop,

		close: function close(event) {
			var that = this;

			if (!this._isOpen || this._trigger("beforeClose", event) === false) {
				return;
			}

			this._isOpen = false;
			this._focusedElement = null;
			this._destroyOverlay();
			this._untrackInstance();

			if (!this.opener.filter(":focusable").trigger("focus").length) {

				// Hiding a focused element doesn't trigger blur in WebKit
				// so in case we have nothing to focus on, explicitly blur the active element
				// https://bugs.webkit.org/show_bug.cgi?id=47182
				$.ui.safeBlur($.ui.safeActiveElement(this.document[0]));
			}

			this._hide(this.uiDialog, this.options.hide, function () {
				that._trigger("close", event);
			});
		},

		isOpen: function isOpen() {
			return this._isOpen;
		},

		moveToTop: function moveToTop() {
			this._moveToTop();
		},

		_moveToTop: function _moveToTop(event, silent) {
			var moved = false,
			    zIndices = this.uiDialog.siblings(".ui-front:visible").map(function () {
				return +$(this).css("z-index");
			}).get(),
			    zIndexMax = Math.max.apply(null, zIndices);

			if (zIndexMax >= +this.uiDialog.css("z-index")) {
				this.uiDialog.css("z-index", zIndexMax + 1);
				moved = true;
			}

			if (moved && !silent) {
				this._trigger("focus", event);
			}
			return moved;
		},

		open: function open() {
			var that = this;
			if (this._isOpen) {
				if (this._moveToTop()) {
					this._focusTabbable();
				}
				return;
			}

			this._isOpen = true;
			this.opener = $($.ui.safeActiveElement(this.document[0]));

			this._size();
			this._position();
			this._createOverlay();
			this._moveToTop(null, true);

			// Ensure the overlay is moved to the top with the dialog, but only when
			// opening. The overlay shouldn't move after the dialog is open so that
			// modeless dialogs opened after the modal dialog stack properly.
			if (this.overlay) {
				this.overlay.css("z-index", this.uiDialog.css("z-index") - 1);
			}

			this._show(this.uiDialog, this.options.show, function () {
				that._focusTabbable();
				that._trigger("focus");
			});

			// Track the dialog immediately upon openening in case a focus event
			// somehow occurs outside of the dialog before an element inside the
			// dialog is focused (#10152)
			this._makeFocusTarget();

			this._trigger("open");
		},

		_focusTabbable: function _focusTabbable() {

			// Set focus to the first match:
			// 1. An element that was focused previously
			// 2. First element inside the dialog matching [autofocus]
			// 3. Tabbable element inside the content element
			// 4. Tabbable element inside the buttonpane
			// 5. The close button
			// 6. The dialog itself
			var hasFocus = this._focusedElement;
			if (!hasFocus) {
				hasFocus = this.element.find("[autofocus]");
			}
			if (!hasFocus.length) {
				hasFocus = this.element.find(":tabbable");
			}
			if (!hasFocus.length) {
				hasFocus = this.uiDialogButtonPane.find(":tabbable");
			}
			if (!hasFocus.length) {
				hasFocus = this.uiDialogTitlebarClose.filter(":tabbable");
			}
			if (!hasFocus.length) {
				hasFocus = this.uiDialog;
			}
			hasFocus.eq(0).trigger("focus");
		},

		_keepFocus: function _keepFocus(event) {
			function checkFocus() {
				var activeElement = $.ui.safeActiveElement(this.document[0]),
				    isActive = this.uiDialog[0] === activeElement || $.contains(this.uiDialog[0], activeElement);
				if (!isActive) {
					this._focusTabbable();
				}
			}
			event.preventDefault();
			checkFocus.call(this);

			// support: IE
			// IE <= 8 doesn't prevent moving focus even with event.preventDefault()
			// so we check again later
			this._delay(checkFocus);
		},

		_createWrapper: function _createWrapper() {
			this.uiDialog = $("<div>").hide().attr({

				// Setting tabIndex makes the div focusable
				tabIndex: -1,
				role: "dialog"
			}).appendTo(this._appendTo());

			this._addClass(this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front");
			this._on(this.uiDialog, {
				keydown: function keydown(event) {
					if (this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && event.keyCode === $.ui.keyCode.ESCAPE) {
						event.preventDefault();
						this.close(event);
						return;
					}

					// Prevent tabbing out of dialogs
					if (event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented()) {
						return;
					}
					var tabbables = this.uiDialog.find(":tabbable"),
					    first = tabbables.filter(":first"),
					    last = tabbables.filter(":last");

					if ((event.target === last[0] || event.target === this.uiDialog[0]) && !event.shiftKey) {
						this._delay(function () {
							first.trigger("focus");
						});
						event.preventDefault();
					} else if ((event.target === first[0] || event.target === this.uiDialog[0]) && event.shiftKey) {
						this._delay(function () {
							last.trigger("focus");
						});
						event.preventDefault();
					}
				},
				mousedown: function mousedown(event) {
					if (this._moveToTop(event)) {
						this._focusTabbable();
					}
				}
			});

			// We assume that any existing aria-describedby attribute means
			// that the dialog content is marked up properly
			// otherwise we brute force the content as the description
			if (!this.element.find("[aria-describedby]").length) {
				this.uiDialog.attr({
					"aria-describedby": this.element.uniqueId().attr("id")
				});
			}
		},

		_createTitlebar: function _createTitlebar() {
			var uiDialogTitle;

			this.uiDialogTitlebar = $("<div>");
			this._addClass(this.uiDialogTitlebar, "ui-dialog-titlebar", "ui-widget-header ui-helper-clearfix");
			this._on(this.uiDialogTitlebar, {
				mousedown: function mousedown(event) {

					// Don't prevent click on close button (#8838)
					// Focusing a dialog that is partially scrolled out of view
					// causes the browser to scroll it into view, preventing the click event
					if (!$(event.target).closest(".ui-dialog-titlebar-close")) {

						// Dialog isn't getting focus when dragging (#8063)
						this.uiDialog.trigger("focus");
					}
				}
			});

			// Support: IE
			// Use type="button" to prevent enter keypresses in textboxes from closing the
			// dialog in IE (#9312)
			this.uiDialogTitlebarClose = $("<button type='button'></button>").button({
				label: $("<a>").text(this.options.closeText).html(),
				icon: "ui-icon-closethick",
				showLabel: false
			}).appendTo(this.uiDialogTitlebar);

			this._addClass(this.uiDialogTitlebarClose, "ui-dialog-titlebar-close");
			this._on(this.uiDialogTitlebarClose, {
				click: function click(event) {
					event.preventDefault();
					this.close(event);
				}
			});

			uiDialogTitle = $("<span>").uniqueId().prependTo(this.uiDialogTitlebar);
			this._addClass(uiDialogTitle, "ui-dialog-title");
			this._title(uiDialogTitle);

			this.uiDialogTitlebar.prependTo(this.uiDialog);

			this.uiDialog.attr({
				"aria-labelledby": uiDialogTitle.attr("id")
			});
		},

		_title: function _title(title) {
			if (this.options.title) {
				title.text(this.options.title);
			} else {
				title.html("&#160;");
			}
		},

		_createButtonPane: function _createButtonPane() {
			this.uiDialogButtonPane = $("<div>");
			this._addClass(this.uiDialogButtonPane, "ui-dialog-buttonpane", "ui-widget-content ui-helper-clearfix");

			this.uiButtonSet = $("<div>").appendTo(this.uiDialogButtonPane);
			this._addClass(this.uiButtonSet, "ui-dialog-buttonset");

			this._createButtons();
		},

		_createButtons: function _createButtons() {
			var that = this,
			    buttons = this.options.buttons;

			// If we already have a button pane, remove it
			this.uiDialogButtonPane.remove();
			this.uiButtonSet.empty();

			if ($.isEmptyObject(buttons) || $.isArray(buttons) && !buttons.length) {
				this._removeClass(this.uiDialog, "ui-dialog-buttons");
				return;
			}

			$.each(buttons, function (name, props) {
				var click, buttonOptions;
				props = $.isFunction(props) ? { click: props, text: name } : props;

				// Default to a non-submitting button
				props = $.extend({ type: "button" }, props);

				// Change the context for the click callback to be the main element
				click = props.click;
				buttonOptions = {
					icon: props.icon,
					iconPosition: props.iconPosition,
					showLabel: props.showLabel,

					// Deprecated options
					icons: props.icons,
					text: props.text
				};

				delete props.click;
				delete props.icon;
				delete props.iconPosition;
				delete props.showLabel;

				// Deprecated options
				delete props.icons;
				if (typeof props.text === "boolean") {
					delete props.text;
				}

				$("<button></button>", props).button(buttonOptions).appendTo(that.uiButtonSet).on("click", function () {
					click.apply(that.element[0], arguments);
				});
			});
			this._addClass(this.uiDialog, "ui-dialog-buttons");
			this.uiDialogButtonPane.appendTo(this.uiDialog);
		},

		_makeDraggable: function _makeDraggable() {
			var that = this,
			    options = this.options;

			function filteredUi(ui) {
				return {
					position: ui.position,
					offset: ui.offset
				};
			}

			this.uiDialog.draggable({
				cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
				handle: ".ui-dialog-titlebar",
				containment: "document",
				start: function start(event, ui) {
					that._addClass($(this), "ui-dialog-dragging");
					that._blockFrames();
					that._trigger("dragStart", event, filteredUi(ui));
				},
				drag: function drag(event, ui) {
					that._trigger("drag", event, filteredUi(ui));
				},
				stop: function stop(event, ui) {
					var left = ui.offset.left - that.document.scrollLeft(),
					    top = ui.offset.top - that.document.scrollTop();

					options.position = {
						my: "left top",
						at: "left" + (left >= 0 ? "+" : "") + left + " " + "top" + (top >= 0 ? "+" : "") + top,
						of: that.window
					};
					that._removeClass($(this), "ui-dialog-dragging");
					that._unblockFrames();
					that._trigger("dragStop", event, filteredUi(ui));
				}
			});
		},

		_makeResizable: function _makeResizable() {
			var that = this,
			    options = this.options,
			    handles = options.resizable,


			// .ui-resizable has position: relative defined in the stylesheet
			// but dialogs have to use absolute or fixed positioning
			position = this.uiDialog.css("position"),
			    resizeHandles = typeof handles === "string" ? handles : "n,e,s,w,se,sw,ne,nw";

			function filteredUi(ui) {
				return {
					originalPosition: ui.originalPosition,
					originalSize: ui.originalSize,
					position: ui.position,
					size: ui.size
				};
			}

			this.uiDialog.resizable({
				cancel: ".ui-dialog-content",
				containment: "document",
				alsoResize: this.element,
				maxWidth: options.maxWidth,
				maxHeight: options.maxHeight,
				minWidth: options.minWidth,
				minHeight: this._minHeight(),
				handles: resizeHandles,
				start: function start(event, ui) {
					that._addClass($(this), "ui-dialog-resizing");
					that._blockFrames();
					that._trigger("resizeStart", event, filteredUi(ui));
				},
				resize: function resize(event, ui) {
					that._trigger("resize", event, filteredUi(ui));
				},
				stop: function stop(event, ui) {
					var offset = that.uiDialog.offset(),
					    left = offset.left - that.document.scrollLeft(),
					    top = offset.top - that.document.scrollTop();

					options.height = that.uiDialog.height();
					options.width = that.uiDialog.width();
					options.position = {
						my: "left top",
						at: "left" + (left >= 0 ? "+" : "") + left + " " + "top" + (top >= 0 ? "+" : "") + top,
						of: that.window
					};
					that._removeClass($(this), "ui-dialog-resizing");
					that._unblockFrames();
					that._trigger("resizeStop", event, filteredUi(ui));
				}
			}).css("position", position);
		},

		_trackFocus: function _trackFocus() {
			this._on(this.widget(), {
				focusin: function focusin(event) {
					this._makeFocusTarget();
					this._focusedElement = $(event.target);
				}
			});
		},

		_makeFocusTarget: function _makeFocusTarget() {
			this._untrackInstance();
			this._trackingInstances().unshift(this);
		},

		_untrackInstance: function _untrackInstance() {
			var instances = this._trackingInstances(),
			    exists = $.inArray(this, instances);
			if (exists !== -1) {
				instances.splice(exists, 1);
			}
		},

		_trackingInstances: function _trackingInstances() {
			var instances = this.document.data("ui-dialog-instances");
			if (!instances) {
				instances = [];
				this.document.data("ui-dialog-instances", instances);
			}
			return instances;
		},

		_minHeight: function _minHeight() {
			var options = this.options;

			return options.height === "auto" ? options.minHeight : Math.min(options.minHeight, options.height);
		},

		_position: function _position() {

			// Need to show the dialog to get the actual offset in the position plugin
			var isVisible = this.uiDialog.is(":visible");
			if (!isVisible) {
				this.uiDialog.show();
			}
			this.uiDialog.position(this.options.position);
			if (!isVisible) {
				this.uiDialog.hide();
			}
		},

		_setOptions: function _setOptions(options) {
			var that = this,
			    resize = false,
			    resizableOptions = {};

			$.each(options, function (key, value) {
				that._setOption(key, value);

				if (key in that.sizeRelatedOptions) {
					resize = true;
				}
				if (key in that.resizableRelatedOptions) {
					resizableOptions[key] = value;
				}
			});

			if (resize) {
				this._size();
				this._position();
			}
			if (this.uiDialog.is(":data(ui-resizable)")) {
				this.uiDialog.resizable("option", resizableOptions);
			}
		},

		_setOption: function _setOption(key, value) {
			var isDraggable,
			    isResizable,
			    uiDialog = this.uiDialog;

			if (key === "disabled") {
				return;
			}

			this._super(key, value);

			if (key === "appendTo") {
				this.uiDialog.appendTo(this._appendTo());
			}

			if (key === "buttons") {
				this._createButtons();
			}

			if (key === "closeText") {
				this.uiDialogTitlebarClose.button({

					// Ensure that we always pass a string
					label: $("<a>").text("" + this.options.closeText).html()
				});
			}

			if (key === "draggable") {
				isDraggable = uiDialog.is(":data(ui-draggable)");
				if (isDraggable && !value) {
					uiDialog.draggable("destroy");
				}

				if (!isDraggable && value) {
					this._makeDraggable();
				}
			}

			if (key === "position") {
				this._position();
			}

			if (key === "resizable") {

				// currently resizable, becoming non-resizable
				isResizable = uiDialog.is(":data(ui-resizable)");
				if (isResizable && !value) {
					uiDialog.resizable("destroy");
				}

				// Currently resizable, changing handles
				if (isResizable && typeof value === "string") {
					uiDialog.resizable("option", "handles", value);
				}

				// Currently non-resizable, becoming resizable
				if (!isResizable && value !== false) {
					this._makeResizable();
				}
			}

			if (key === "title") {
				this._title(this.uiDialogTitlebar.find(".ui-dialog-title"));
			}
		},

		_size: function _size() {

			// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
			// divs will both have width and height set, so we need to reset them
			var nonContentHeight,
			    minContentHeight,
			    maxContentHeight,
			    options = this.options;

			// Reset content sizing
			this.element.show().css({
				width: "auto",
				minHeight: 0,
				maxHeight: "none",
				height: 0
			});

			if (options.minWidth > options.width) {
				options.width = options.minWidth;
			}

			// Reset wrapper sizing
			// determine the height of all the non-content elements
			nonContentHeight = this.uiDialog.css({
				height: "auto",
				width: options.width
			}).outerHeight();
			minContentHeight = Math.max(0, options.minHeight - nonContentHeight);
			maxContentHeight = typeof options.maxHeight === "number" ? Math.max(0, options.maxHeight - nonContentHeight) : "none";

			if (options.height === "auto") {
				this.element.css({
					minHeight: minContentHeight,
					maxHeight: maxContentHeight,
					height: "auto"
				});
			} else {
				this.element.height(Math.max(0, options.height - nonContentHeight));
			}

			if (this.uiDialog.is(":data(ui-resizable)")) {
				this.uiDialog.resizable("option", "minHeight", this._minHeight());
			}
		},

		_blockFrames: function _blockFrames() {
			this.iframeBlocks = this.document.find("iframe").map(function () {
				var iframe = $(this);

				return $("<div>").css({
					position: "absolute",
					width: iframe.outerWidth(),
					height: iframe.outerHeight()
				}).appendTo(iframe.parent()).offset(iframe.offset())[0];
			});
		},

		_unblockFrames: function _unblockFrames() {
			if (this.iframeBlocks) {
				this.iframeBlocks.remove();
				delete this.iframeBlocks;
			}
		},

		_allowInteraction: function _allowInteraction(event) {
			if ($(event.target).closest(".ui-dialog").length) {
				return true;
			}

			// TODO: Remove hack when datepicker implements
			// the .ui-front logic (#8989)
			return !!$(event.target).closest(".ui-datepicker").length;
		},

		_createOverlay: function _createOverlay() {
			if (!this.options.modal) {
				return;
			}

			// We use a delay in case the overlay is created from an
			// event that we're going to be cancelling (#2804)
			var isOpening = true;
			this._delay(function () {
				isOpening = false;
			});

			if (!this.document.data("ui-dialog-overlays")) {

				// Prevent use of anchors and inputs
				// Using _on() for an event handler shared across many instances is
				// safe because the dialogs stack and must be closed in reverse order
				this._on(this.document, {
					focusin: function focusin(event) {
						if (isOpening) {
							return;
						}

						if (!this._allowInteraction(event)) {
							event.preventDefault();
							this._trackingInstances()[0]._focusTabbable();
						}
					}
				});
			}

			this.overlay = $("<div>").appendTo(this._appendTo());

			this._addClass(this.overlay, null, "ui-widget-overlay ui-front");
			this._on(this.overlay, {
				mousedown: "_keepFocus"
			});
			this.document.data("ui-dialog-overlays", (this.document.data("ui-dialog-overlays") || 0) + 1);
		},

		_destroyOverlay: function _destroyOverlay() {
			if (!this.options.modal) {
				return;
			}

			if (this.overlay) {
				var overlays = this.document.data("ui-dialog-overlays") - 1;

				if (!overlays) {
					this._off(this.document, "focusin");
					this.document.removeData("ui-dialog-overlays");
				} else {
					this.document.data("ui-dialog-overlays", overlays);
				}

				this.overlay.remove();
				this.overlay = null;
			}
		}
	});

	// DEPRECATED
	// TODO: switch return back to widget declaration at top of file when this is removed
	if ($.uiBackCompat !== false) {

		// Backcompat for dialogClass option
		$.widget("ui.dialog", $.ui.dialog, {
			options: {
				dialogClass: ""
			},
			_createWrapper: function _createWrapper() {
				this._super();
				this.uiDialog.addClass(this.options.dialogClass);
			},
			_setOption: function _setOption(key, value) {
				if (key === "dialogClass") {
					this.uiDialog.removeClass(this.options.dialogClass).addClass(value);
				}
				this._superApply(arguments);
			}
		});
	}

	var widgetsDialog = $.ui.dialog;

	/*!
  * jQuery UI Droppable 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Droppable
	//>>group: Interactions
	//>>description: Enables drop targets for draggable elements.
	//>>docs: http://api.jqueryui.com/droppable/
	//>>demos: http://jqueryui.com/droppable/


	$.widget("ui.droppable", {
		version: "1.12.1",
		widgetEventPrefix: "drop",
		options: {
			accept: "*",
			addClasses: true,
			greedy: false,
			scope: "default",
			tolerance: "intersect",

			// Callbacks
			activate: null,
			deactivate: null,
			drop: null,
			out: null,
			over: null
		},
		_create: function _create() {

			var proportions,
			    o = this.options,
			    accept = o.accept;

			this.isover = false;
			this.isout = true;

			this.accept = $.isFunction(accept) ? accept : function (d) {
				return d.is(accept);
			};

			this.proportions = function () /* valueToWrite */{
				if (arguments.length) {

					// Store the droppable's proportions
					proportions = arguments[0];
				} else {

					// Retrieve or derive the droppable's proportions
					return proportions ? proportions : proportions = {
						width: this.element[0].offsetWidth,
						height: this.element[0].offsetHeight
					};
				}
			};

			this._addToManager(o.scope);

			o.addClasses && this._addClass("ui-droppable");
		},

		_addToManager: function _addToManager(scope) {

			// Add the reference and positions to the manager
			$.ui.ddmanager.droppables[scope] = $.ui.ddmanager.droppables[scope] || [];
			$.ui.ddmanager.droppables[scope].push(this);
		},

		_splice: function _splice(drop) {
			var i = 0;
			for (; i < drop.length; i++) {
				if (drop[i] === this) {
					drop.splice(i, 1);
				}
			}
		},

		_destroy: function _destroy() {
			var drop = $.ui.ddmanager.droppables[this.options.scope];

			this._splice(drop);
		},

		_setOption: function _setOption(key, value) {

			if (key === "accept") {
				this.accept = $.isFunction(value) ? value : function (d) {
					return d.is(value);
				};
			} else if (key === "scope") {
				var drop = $.ui.ddmanager.droppables[this.options.scope];

				this._splice(drop);
				this._addToManager(value);
			}

			this._super(key, value);
		},

		_activate: function _activate(event) {
			var draggable = $.ui.ddmanager.current;

			this._addActiveClass();
			if (draggable) {
				this._trigger("activate", event, this.ui(draggable));
			}
		},

		_deactivate: function _deactivate(event) {
			var draggable = $.ui.ddmanager.current;

			this._removeActiveClass();
			if (draggable) {
				this._trigger("deactivate", event, this.ui(draggable));
			}
		},

		_over: function _over(event) {

			var draggable = $.ui.ddmanager.current;

			// Bail if draggable and droppable are same element
			if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
				return;
			}

			if (this.accept.call(this.element[0], draggable.currentItem || draggable.element)) {
				this._addHoverClass();
				this._trigger("over", event, this.ui(draggable));
			}
		},

		_out: function _out(event) {

			var draggable = $.ui.ddmanager.current;

			// Bail if draggable and droppable are same element
			if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
				return;
			}

			if (this.accept.call(this.element[0], draggable.currentItem || draggable.element)) {
				this._removeHoverClass();
				this._trigger("out", event, this.ui(draggable));
			}
		},

		_drop: function _drop(event, custom) {

			var draggable = custom || $.ui.ddmanager.current,
			    childrenIntersection = false;

			// Bail if draggable and droppable are same element
			if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
				return false;
			}

			this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function () {
				var inst = $(this).droppable("instance");
				if (inst.options.greedy && !inst.options.disabled && inst.options.scope === draggable.options.scope && inst.accept.call(inst.element[0], draggable.currentItem || draggable.element) && intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance, event)) {
					childrenIntersection = true;
					return false;
				}
			});
			if (childrenIntersection) {
				return false;
			}

			if (this.accept.call(this.element[0], draggable.currentItem || draggable.element)) {
				this._removeActiveClass();
				this._removeHoverClass();

				this._trigger("drop", event, this.ui(draggable));
				return this.element;
			}

			return false;
		},

		ui: function ui(c) {
			return {
				draggable: c.currentItem || c.element,
				helper: c.helper,
				position: c.position,
				offset: c.positionAbs
			};
		},

		// Extension points just to make backcompat sane and avoid duplicating logic
		// TODO: Remove in 1.13 along with call to it below
		_addHoverClass: function _addHoverClass() {
			this._addClass("ui-droppable-hover");
		},

		_removeHoverClass: function _removeHoverClass() {
			this._removeClass("ui-droppable-hover");
		},

		_addActiveClass: function _addActiveClass() {
			this._addClass("ui-droppable-active");
		},

		_removeActiveClass: function _removeActiveClass() {
			this._removeClass("ui-droppable-active");
		}
	});

	var intersect = $.ui.intersect = function () {
		function isOverAxis(x, reference, size) {
			return x >= reference && x < reference + size;
		}

		return function (draggable, droppable, toleranceMode, event) {

			if (!droppable.offset) {
				return false;
			}

			var x1 = (draggable.positionAbs || draggable.position.absolute).left + draggable.margins.left,
			    y1 = (draggable.positionAbs || draggable.position.absolute).top + draggable.margins.top,
			    x2 = x1 + draggable.helperProportions.width,
			    y2 = y1 + draggable.helperProportions.height,
			    l = droppable.offset.left,
			    t = droppable.offset.top,
			    r = l + droppable.proportions().width,
			    b = t + droppable.proportions().height;

			switch (toleranceMode) {
				case "fit":
					return l <= x1 && x2 <= r && t <= y1 && y2 <= b;
				case "intersect":
					return l < x1 + draggable.helperProportions.width / 2 && // Right Half
					x2 - draggable.helperProportions.width / 2 < r && // Left Half
					t < y1 + draggable.helperProportions.height / 2 && // Bottom Half
					y2 - draggable.helperProportions.height / 2 < b; // Top Half
				case "pointer":
					return isOverAxis(event.pageY, t, droppable.proportions().height) && isOverAxis(event.pageX, l, droppable.proportions().width);
				case "touch":
					return (y1 >= t && y1 <= b || // Top edge touching
					y2 >= t && y2 <= b || // Bottom edge touching
					y1 < t && y2 > b // Surrounded vertically
					) && (x1 >= l && x1 <= r || // Left edge touching
					x2 >= l && x2 <= r || // Right edge touching
					x1 < l && x2 > r // Surrounded horizontally
					);
				default:
					return false;
			}
		};
	}();

	/*
 	This manager tracks offsets of draggables and droppables
 */
	$.ui.ddmanager = {
		current: null,
		droppables: { "default": [] },
		prepareOffsets: function prepareOffsets(t, event) {

			var i,
			    j,
			    m = $.ui.ddmanager.droppables[t.options.scope] || [],
			    type = event ? event.type : null,
			    // workaround for #2317
			list = (t.currentItem || t.element).find(":data(ui-droppable)").addBack();

			droppablesLoop: for (i = 0; i < m.length; i++) {

				// No disabled and non-accepted
				if (m[i].options.disabled || t && !m[i].accept.call(m[i].element[0], t.currentItem || t.element)) {
					continue;
				}

				// Filter out elements in the current dragged item
				for (j = 0; j < list.length; j++) {
					if (list[j] === m[i].element[0]) {
						m[i].proportions().height = 0;
						continue droppablesLoop;
					}
				}

				m[i].visible = m[i].element.css("display") !== "none";
				if (!m[i].visible) {
					continue;
				}

				// Activate the droppable if used directly from draggables
				if (type === "mousedown") {
					m[i]._activate.call(m[i], event);
				}

				m[i].offset = m[i].element.offset();
				m[i].proportions({
					width: m[i].element[0].offsetWidth,
					height: m[i].element[0].offsetHeight
				});
			}
		},
		drop: function drop(draggable, event) {

			var dropped = false;

			// Create a copy of the droppables in case the list changes during the drop (#9116)
			$.each(($.ui.ddmanager.droppables[draggable.options.scope] || []).slice(), function () {

				if (!this.options) {
					return;
				}
				if (!this.options.disabled && this.visible && intersect(draggable, this, this.options.tolerance, event)) {
					dropped = this._drop.call(this, event) || dropped;
				}

				if (!this.options.disabled && this.visible && this.accept.call(this.element[0], draggable.currentItem || draggable.element)) {
					this.isout = true;
					this.isover = false;
					this._deactivate.call(this, event);
				}
			});
			return dropped;
		},
		dragStart: function dragStart(draggable, event) {

			// Listen for scrolling so that if the dragging causes scrolling the position of the
			// droppables can be recalculated (see #5003)
			draggable.element.parentsUntil("body").on("scroll.droppable", function () {
				if (!draggable.options.refreshPositions) {
					$.ui.ddmanager.prepareOffsets(draggable, event);
				}
			});
		},
		drag: function drag(draggable, event) {

			// If you have a highly dynamic page, you might try this option. It renders positions
			// every time you move the mouse.
			if (draggable.options.refreshPositions) {
				$.ui.ddmanager.prepareOffsets(draggable, event);
			}

			// Run through all droppables and check their positions based on specific tolerance options
			$.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function () {

				if (this.options.disabled || this.greedyChild || !this.visible) {
					return;
				}

				var parentInstance,
				    scope,
				    parent,
				    intersects = intersect(draggable, this, this.options.tolerance, event),
				    c = !intersects && this.isover ? "isout" : intersects && !this.isover ? "isover" : null;
				if (!c) {
					return;
				}

				if (this.options.greedy) {

					// find droppable parents with same scope
					scope = this.options.scope;
					parent = this.element.parents(":data(ui-droppable)").filter(function () {
						return $(this).droppable("instance").options.scope === scope;
					});

					if (parent.length) {
						parentInstance = $(parent[0]).droppable("instance");
						parentInstance.greedyChild = c === "isover";
					}
				}

				// We just moved into a greedy child
				if (parentInstance && c === "isover") {
					parentInstance.isover = false;
					parentInstance.isout = true;
					parentInstance._out.call(parentInstance, event);
				}

				this[c] = true;
				this[c === "isout" ? "isover" : "isout"] = false;
				this[c === "isover" ? "_over" : "_out"].call(this, event);

				// We just moved out of a greedy child
				if (parentInstance && c === "isout") {
					parentInstance.isout = false;
					parentInstance.isover = true;
					parentInstance._over.call(parentInstance, event);
				}
			});
		},
		dragStop: function dragStop(draggable, event) {
			draggable.element.parentsUntil("body").off("scroll.droppable");

			// Call prepareOffsets one final time since IE does not fire return scroll events when
			// overflow was caused by drag (see #5003)
			if (!draggable.options.refreshPositions) {
				$.ui.ddmanager.prepareOffsets(draggable, event);
			}
		}
	};

	// DEPRECATED
	// TODO: switch return back to widget declaration at top of file when this is removed
	if ($.uiBackCompat !== false) {

		// Backcompat for activeClass and hoverClass options
		$.widget("ui.droppable", $.ui.droppable, {
			options: {
				hoverClass: false,
				activeClass: false
			},
			_addActiveClass: function _addActiveClass() {
				this._super();
				if (this.options.activeClass) {
					this.element.addClass(this.options.activeClass);
				}
			},
			_removeActiveClass: function _removeActiveClass() {
				this._super();
				if (this.options.activeClass) {
					this.element.removeClass(this.options.activeClass);
				}
			},
			_addHoverClass: function _addHoverClass() {
				this._super();
				if (this.options.hoverClass) {
					this.element.addClass(this.options.hoverClass);
				}
			},
			_removeHoverClass: function _removeHoverClass() {
				this._super();
				if (this.options.hoverClass) {
					this.element.removeClass(this.options.hoverClass);
				}
			}
		});
	}

	var widgetsDroppable = $.ui.droppable;

	/*!
  * jQuery UI Progressbar 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Progressbar
	//>>group: Widgets
	// jscs:disable maximumLineLength
	//>>description: Displays a status indicator for loading state, standard percentage, and other progress indicators.
	// jscs:enable maximumLineLength
	//>>docs: http://api.jqueryui.com/progressbar/
	//>>demos: http://jqueryui.com/progressbar/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/progressbar.css
	//>>css.theme: ../../themes/base/theme.css


	var widgetsProgressbar = $.widget("ui.progressbar", {
		version: "1.12.1",
		options: {
			classes: {
				"ui-progressbar": "ui-corner-all",
				"ui-progressbar-value": "ui-corner-left",
				"ui-progressbar-complete": "ui-corner-right"
			},
			max: 100,
			value: 0,

			change: null,
			complete: null
		},

		min: 0,

		_create: function _create() {

			// Constrain initial value
			this.oldValue = this.options.value = this._constrainedValue();

			this.element.attr({

				// Only set static values; aria-valuenow and aria-valuemax are
				// set inside _refreshValue()
				role: "progressbar",
				"aria-valuemin": this.min
			});
			this._addClass("ui-progressbar", "ui-widget ui-widget-content");

			this.valueDiv = $("<div>").appendTo(this.element);
			this._addClass(this.valueDiv, "ui-progressbar-value", "ui-widget-header");
			this._refreshValue();
		},

		_destroy: function _destroy() {
			this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow");

			this.valueDiv.remove();
		},

		value: function value(newValue) {
			if (newValue === undefined) {
				return this.options.value;
			}

			this.options.value = this._constrainedValue(newValue);
			this._refreshValue();
		},

		_constrainedValue: function _constrainedValue(newValue) {
			if (newValue === undefined) {
				newValue = this.options.value;
			}

			this.indeterminate = newValue === false;

			// Sanitize value
			if (typeof newValue !== "number") {
				newValue = 0;
			}

			return this.indeterminate ? false : Math.min(this.options.max, Math.max(this.min, newValue));
		},

		_setOptions: function _setOptions(options) {

			// Ensure "value" option is set after other values (like max)
			var value = options.value;
			delete options.value;

			this._super(options);

			this.options.value = this._constrainedValue(value);
			this._refreshValue();
		},

		_setOption: function _setOption(key, value) {
			if (key === "max") {

				// Don't allow a max less than min
				value = Math.max(this.min, value);
			}
			this._super(key, value);
		},

		_setOptionDisabled: function _setOptionDisabled(value) {
			this._super(value);

			this.element.attr("aria-disabled", value);
			this._toggleClass(null, "ui-state-disabled", !!value);
		},

		_percentage: function _percentage() {
			return this.indeterminate ? 100 : 100 * (this.options.value - this.min) / (this.options.max - this.min);
		},

		_refreshValue: function _refreshValue() {
			var value = this.options.value,
			    percentage = this._percentage();

			this.valueDiv.toggle(this.indeterminate || value > this.min).width(percentage.toFixed(0) + "%");

			this._toggleClass(this.valueDiv, "ui-progressbar-complete", null, value === this.options.max)._toggleClass("ui-progressbar-indeterminate", null, this.indeterminate);

			if (this.indeterminate) {
				this.element.removeAttr("aria-valuenow");
				if (!this.overlayDiv) {
					this.overlayDiv = $("<div>").appendTo(this.valueDiv);
					this._addClass(this.overlayDiv, "ui-progressbar-overlay");
				}
			} else {
				this.element.attr({
					"aria-valuemax": this.options.max,
					"aria-valuenow": value
				});
				if (this.overlayDiv) {
					this.overlayDiv.remove();
					this.overlayDiv = null;
				}
			}

			if (this.oldValue !== value) {
				this.oldValue = value;
				this._trigger("change");
			}
			if (value === this.options.max) {
				this._trigger("complete");
			}
		}
	});

	/*!
  * jQuery UI Selectable 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Selectable
	//>>group: Interactions
	//>>description: Allows groups of elements to be selected with the mouse.
	//>>docs: http://api.jqueryui.com/selectable/
	//>>demos: http://jqueryui.com/selectable/
	//>>css.structure: ../../themes/base/selectable.css


	var widgetsSelectable = $.widget("ui.selectable", $.ui.mouse, {
		version: "1.12.1",
		options: {
			appendTo: "body",
			autoRefresh: true,
			distance: 0,
			filter: "*",
			tolerance: "touch",

			// Callbacks
			selected: null,
			selecting: null,
			start: null,
			stop: null,
			unselected: null,
			unselecting: null
		},
		_create: function _create() {
			var that = this;

			this._addClass("ui-selectable");

			this.dragged = false;

			// Cache selectee children based on filter
			this.refresh = function () {
				that.elementPos = $(that.element[0]).offset();
				that.selectees = $(that.options.filter, that.element[0]);
				that._addClass(that.selectees, "ui-selectee");
				that.selectees.each(function () {
					var $this = $(this),
					    selecteeOffset = $this.offset(),
					    pos = {
						left: selecteeOffset.left - that.elementPos.left,
						top: selecteeOffset.top - that.elementPos.top
					};
					$.data(this, "selectable-item", {
						element: this,
						$element: $this,
						left: pos.left,
						top: pos.top,
						right: pos.left + $this.outerWidth(),
						bottom: pos.top + $this.outerHeight(),
						startselected: false,
						selected: $this.hasClass("ui-selected"),
						selecting: $this.hasClass("ui-selecting"),
						unselecting: $this.hasClass("ui-unselecting")
					});
				});
			};
			this.refresh();

			this._mouseInit();

			this.helper = $("<div>");
			this._addClass(this.helper, "ui-selectable-helper");
		},

		_destroy: function _destroy() {
			this.selectees.removeData("selectable-item");
			this._mouseDestroy();
		},

		_mouseStart: function _mouseStart(event) {
			var that = this,
			    options = this.options;

			this.opos = [event.pageX, event.pageY];
			this.elementPos = $(this.element[0]).offset();

			if (this.options.disabled) {
				return;
			}

			this.selectees = $(options.filter, this.element[0]);

			this._trigger("start", event);

			$(options.appendTo).append(this.helper);

			// position helper (lasso)
			this.helper.css({
				"left": event.pageX,
				"top": event.pageY,
				"width": 0,
				"height": 0
			});

			if (options.autoRefresh) {
				this.refresh();
			}

			this.selectees.filter(".ui-selected").each(function () {
				var selectee = $.data(this, "selectable-item");
				selectee.startselected = true;
				if (!event.metaKey && !event.ctrlKey) {
					that._removeClass(selectee.$element, "ui-selected");
					selectee.selected = false;
					that._addClass(selectee.$element, "ui-unselecting");
					selectee.unselecting = true;

					// selectable UNSELECTING callback
					that._trigger("unselecting", event, {
						unselecting: selectee.element
					});
				}
			});

			$(event.target).parents().addBack().each(function () {
				var doSelect,
				    selectee = $.data(this, "selectable-item");
				if (selectee) {
					doSelect = !event.metaKey && !event.ctrlKey || !selectee.$element.hasClass("ui-selected");
					that._removeClass(selectee.$element, doSelect ? "ui-unselecting" : "ui-selected")._addClass(selectee.$element, doSelect ? "ui-selecting" : "ui-unselecting");
					selectee.unselecting = !doSelect;
					selectee.selecting = doSelect;
					selectee.selected = doSelect;

					// selectable (UN)SELECTING callback
					if (doSelect) {
						that._trigger("selecting", event, {
							selecting: selectee.element
						});
					} else {
						that._trigger("unselecting", event, {
							unselecting: selectee.element
						});
					}
					return false;
				}
			});
		},

		_mouseDrag: function _mouseDrag(event) {

			this.dragged = true;

			if (this.options.disabled) {
				return;
			}

			var tmp,
			    that = this,
			    options = this.options,
			    x1 = this.opos[0],
			    y1 = this.opos[1],
			    x2 = event.pageX,
			    y2 = event.pageY;

			if (x1 > x2) {
				tmp = x2;x2 = x1;x1 = tmp;
			}
			if (y1 > y2) {
				tmp = y2;y2 = y1;y1 = tmp;
			}
			this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 });

			this.selectees.each(function () {
				var selectee = $.data(this, "selectable-item"),
				    hit = false,
				    offset = {};

				//prevent helper from being selected if appendTo: selectable
				if (!selectee || selectee.element === that.element[0]) {
					return;
				}

				offset.left = selectee.left + that.elementPos.left;
				offset.right = selectee.right + that.elementPos.left;
				offset.top = selectee.top + that.elementPos.top;
				offset.bottom = selectee.bottom + that.elementPos.top;

				if (options.tolerance === "touch") {
					hit = !(offset.left > x2 || offset.right < x1 || offset.top > y2 || offset.bottom < y1);
				} else if (options.tolerance === "fit") {
					hit = offset.left > x1 && offset.right < x2 && offset.top > y1 && offset.bottom < y2;
				}

				if (hit) {

					// SELECT
					if (selectee.selected) {
						that._removeClass(selectee.$element, "ui-selected");
						selectee.selected = false;
					}
					if (selectee.unselecting) {
						that._removeClass(selectee.$element, "ui-unselecting");
						selectee.unselecting = false;
					}
					if (!selectee.selecting) {
						that._addClass(selectee.$element, "ui-selecting");
						selectee.selecting = true;

						// selectable SELECTING callback
						that._trigger("selecting", event, {
							selecting: selectee.element
						});
					}
				} else {

					// UNSELECT
					if (selectee.selecting) {
						if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
							that._removeClass(selectee.$element, "ui-selecting");
							selectee.selecting = false;
							that._addClass(selectee.$element, "ui-selected");
							selectee.selected = true;
						} else {
							that._removeClass(selectee.$element, "ui-selecting");
							selectee.selecting = false;
							if (selectee.startselected) {
								that._addClass(selectee.$element, "ui-unselecting");
								selectee.unselecting = true;
							}

							// selectable UNSELECTING callback
							that._trigger("unselecting", event, {
								unselecting: selectee.element
							});
						}
					}
					if (selectee.selected) {
						if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
							that._removeClass(selectee.$element, "ui-selected");
							selectee.selected = false;

							that._addClass(selectee.$element, "ui-unselecting");
							selectee.unselecting = true;

							// selectable UNSELECTING callback
							that._trigger("unselecting", event, {
								unselecting: selectee.element
							});
						}
					}
				}
			});

			return false;
		},

		_mouseStop: function _mouseStop(event) {
			var that = this;

			this.dragged = false;

			$(".ui-unselecting", this.element[0]).each(function () {
				var selectee = $.data(this, "selectable-item");
				that._removeClass(selectee.$element, "ui-unselecting");
				selectee.unselecting = false;
				selectee.startselected = false;
				that._trigger("unselected", event, {
					unselected: selectee.element
				});
			});
			$(".ui-selecting", this.element[0]).each(function () {
				var selectee = $.data(this, "selectable-item");
				that._removeClass(selectee.$element, "ui-selecting")._addClass(selectee.$element, "ui-selected");
				selectee.selecting = false;
				selectee.selected = true;
				selectee.startselected = true;
				that._trigger("selected", event, {
					selected: selectee.element
				});
			});
			this._trigger("stop", event);

			this.helper.remove();

			return false;
		}

	});

	/*!
  * jQuery UI Selectmenu 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Selectmenu
	//>>group: Widgets
	// jscs:disable maximumLineLength
	//>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select.
	// jscs:enable maximumLineLength
	//>>docs: http://api.jqueryui.com/selectmenu/
	//>>demos: http://jqueryui.com/selectmenu/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css
	//>>css.theme: ../../themes/base/theme.css


	var widgetsSelectmenu = $.widget("ui.selectmenu", [$.ui.formResetMixin, {
		version: "1.12.1",
		defaultElement: "<select>",
		options: {
			appendTo: null,
			classes: {
				"ui-selectmenu-button-open": "ui-corner-top",
				"ui-selectmenu-button-closed": "ui-corner-all"
			},
			disabled: null,
			icons: {
				button: "ui-icon-triangle-1-s"
			},
			position: {
				my: "left top",
				at: "left bottom",
				collision: "none"
			},
			width: false,

			// Callbacks
			change: null,
			close: null,
			focus: null,
			open: null,
			select: null
		},

		_create: function _create() {
			var selectmenuId = this.element.uniqueId().attr("id");
			this.ids = {
				element: selectmenuId,
				button: selectmenuId + "-button",
				menu: selectmenuId + "-menu"
			};

			this._drawButton();
			this._drawMenu();
			this._bindFormResetHandler();

			this._rendered = false;
			this.menuItems = $();
		},

		_drawButton: function _drawButton() {
			var icon,
			    that = this,
			    item = this._parseOption(this.element.find("option:selected"), this.element[0].selectedIndex);

			// Associate existing label with the new button
			this.labels = this.element.labels().attr("for", this.ids.button);
			this._on(this.labels, {
				click: function click(event) {
					this.button.focus();
					event.preventDefault();
				}
			});

			// Hide original select element
			this.element.hide();

			// Create button
			this.button = $("<span>", {
				tabindex: this.options.disabled ? -1 : 0,
				id: this.ids.button,
				role: "combobox",
				"aria-expanded": "false",
				"aria-autocomplete": "list",
				"aria-owns": this.ids.menu,
				"aria-haspopup": "true",
				title: this.element.attr("title")
			}).insertAfter(this.element);

			this._addClass(this.button, "ui-selectmenu-button ui-selectmenu-button-closed", "ui-button ui-widget");

			icon = $("<span>").appendTo(this.button);
			this._addClass(icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button);
			this.buttonItem = this._renderButtonItem(item).appendTo(this.button);

			if (this.options.width !== false) {
				this._resizeButton();
			}

			this._on(this.button, this._buttonEvents);
			this.button.one("focusin", function () {

				// Delay rendering the menu items until the button receives focus.
				// The menu may have already been rendered via a programmatic open.
				if (!that._rendered) {
					that._refreshMenu();
				}
			});
		},

		_drawMenu: function _drawMenu() {
			var that = this;

			// Create menu
			this.menu = $("<ul>", {
				"aria-hidden": "true",
				"aria-labelledby": this.ids.button,
				id: this.ids.menu
			});

			// Wrap menu
			this.menuWrap = $("<div>").append(this.menu);
			this._addClass(this.menuWrap, "ui-selectmenu-menu", "ui-front");
			this.menuWrap.appendTo(this._appendTo());

			// Initialize menu widget
			this.menuInstance = this.menu.menu({
				classes: {
					"ui-menu": "ui-corner-bottom"
				},
				role: "listbox",
				select: function select(event, ui) {
					event.preventDefault();

					// Support: IE8
					// If the item was selected via a click, the text selection
					// will be destroyed in IE
					that._setSelection();

					that._select(ui.item.data("ui-selectmenu-item"), event);
				},
				focus: function focus(event, ui) {
					var item = ui.item.data("ui-selectmenu-item");

					// Prevent inital focus from firing and check if its a newly focused item
					if (that.focusIndex != null && item.index !== that.focusIndex) {
						that._trigger("focus", event, { item: item });
						if (!that.isOpen) {
							that._select(item, event);
						}
					}
					that.focusIndex = item.index;

					that.button.attr("aria-activedescendant", that.menuItems.eq(item.index).attr("id"));
				}
			}).menu("instance");

			// Don't close the menu on mouseleave
			this.menuInstance._off(this.menu, "mouseleave");

			// Cancel the menu's collapseAll on document click
			this.menuInstance._closeOnDocumentClick = function () {
				return false;
			};

			// Selects often contain empty items, but never contain dividers
			this.menuInstance._isDivider = function () {
				return false;
			};
		},

		refresh: function refresh() {
			this._refreshMenu();
			this.buttonItem.replaceWith(this.buttonItem = this._renderButtonItem(

			// Fall back to an empty object in case there are no options
			this._getSelectedItem().data("ui-selectmenu-item") || {}));
			if (this.options.width === null) {
				this._resizeButton();
			}
		},

		_refreshMenu: function _refreshMenu() {
			var item,
			    options = this.element.find("option");

			this.menu.empty();

			this._parseOptions(options);
			this._renderMenu(this.menu, this.items);

			this.menuInstance.refresh();
			this.menuItems = this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper");

			this._rendered = true;

			if (!options.length) {
				return;
			}

			item = this._getSelectedItem();

			// Update the menu to have the correct item focused
			this.menuInstance.focus(null, item);
			this._setAria(item.data("ui-selectmenu-item"));

			// Set disabled state
			this._setOption("disabled", this.element.prop("disabled"));
		},

		open: function open(event) {
			if (this.options.disabled) {
				return;
			}

			// If this is the first time the menu is being opened, render the items
			if (!this._rendered) {
				this._refreshMenu();
			} else {

				// Menu clears focus on close, reset focus to selected item
				this._removeClass(this.menu.find(".ui-state-active"), null, "ui-state-active");
				this.menuInstance.focus(null, this._getSelectedItem());
			}

			// If there are no options, don't open the menu
			if (!this.menuItems.length) {
				return;
			}

			this.isOpen = true;
			this._toggleAttr();
			this._resizeMenu();
			this._position();

			this._on(this.document, this._documentClick);

			this._trigger("open", event);
		},

		_position: function _position() {
			this.menuWrap.position($.extend({ of: this.button }, this.options.position));
		},

		close: function close(event) {
			if (!this.isOpen) {
				return;
			}

			this.isOpen = false;
			this._toggleAttr();

			this.range = null;
			this._off(this.document);

			this._trigger("close", event);
		},

		widget: function widget() {
			return this.button;
		},

		menuWidget: function menuWidget() {
			return this.menu;
		},

		_renderButtonItem: function _renderButtonItem(item) {
			var buttonItem = $("<span>");

			this._setText(buttonItem, item.label);
			this._addClass(buttonItem, "ui-selectmenu-text");

			return buttonItem;
		},

		_renderMenu: function _renderMenu(ul, items) {
			var that = this,
			    currentOptgroup = "";

			$.each(items, function (index, item) {
				var li;

				if (item.optgroup !== currentOptgroup) {
					li = $("<li>", {
						text: item.optgroup
					});
					that._addClass(li, "ui-selectmenu-optgroup", "ui-menu-divider" + (item.element.parent("optgroup").prop("disabled") ? " ui-state-disabled" : ""));

					li.appendTo(ul);

					currentOptgroup = item.optgroup;
				}

				that._renderItemData(ul, item);
			});
		},

		_renderItemData: function _renderItemData(ul, item) {
			return this._renderItem(ul, item).data("ui-selectmenu-item", item);
		},

		_renderItem: function _renderItem(ul, item) {
			var li = $("<li>"),
			    wrapper = $("<div>", {
				title: item.element.attr("title")
			});

			if (item.disabled) {
				this._addClass(li, null, "ui-state-disabled");
			}
			this._setText(wrapper, item.label);

			return li.append(wrapper).appendTo(ul);
		},

		_setText: function _setText(element, value) {
			if (value) {
				element.text(value);
			} else {
				element.html("&#160;");
			}
		},

		_move: function _move(direction, event) {
			var item,
			    next,
			    filter = ".ui-menu-item";

			if (this.isOpen) {
				item = this.menuItems.eq(this.focusIndex).parent("li");
			} else {
				item = this.menuItems.eq(this.element[0].selectedIndex).parent("li");
				filter += ":not(.ui-state-disabled)";
			}

			if (direction === "first" || direction === "last") {
				next = item[direction === "first" ? "prevAll" : "nextAll"](filter).eq(-1);
			} else {
				next = item[direction + "All"](filter).eq(0);
			}

			if (next.length) {
				this.menuInstance.focus(event, next);
			}
		},

		_getSelectedItem: function _getSelectedItem() {
			return this.menuItems.eq(this.element[0].selectedIndex).parent("li");
		},

		_toggle: function _toggle(event) {
			this[this.isOpen ? "close" : "open"](event);
		},

		_setSelection: function _setSelection() {
			var selection;

			if (!this.range) {
				return;
			}

			if (window.getSelection) {
				selection = window.getSelection();
				selection.removeAllRanges();
				selection.addRange(this.range);

				// Support: IE8
			} else {
				this.range.select();
			}

			// Support: IE
			// Setting the text selection kills the button focus in IE, but
			// restoring the focus doesn't kill the selection.
			this.button.focus();
		},

		_documentClick: {
			mousedown: function mousedown(event) {
				if (!this.isOpen) {
					return;
				}

				if (!$(event.target).closest(".ui-selectmenu-menu, #" + $.ui.escapeSelector(this.ids.button)).length) {
					this.close(event);
				}
			}
		},

		_buttonEvents: {

			// Prevent text selection from being reset when interacting with the selectmenu (#10144)
			mousedown: function mousedown() {
				var selection;

				if (window.getSelection) {
					selection = window.getSelection();
					if (selection.rangeCount) {
						this.range = selection.getRangeAt(0);
					}

					// Support: IE8
				} else {
					this.range = document.selection.createRange();
				}
			},

			click: function click(event) {
				this._setSelection();
				this._toggle(event);
			},

			keydown: function keydown(event) {
				var preventDefault = true;
				switch (event.keyCode) {
					case $.ui.keyCode.TAB:
					case $.ui.keyCode.ESCAPE:
						this.close(event);
						preventDefault = false;
						break;
					case $.ui.keyCode.ENTER:
						if (this.isOpen) {
							this._selectFocusedItem(event);
						}
						break;
					case $.ui.keyCode.UP:
						if (event.altKey) {
							this._toggle(event);
						} else {
							this._move("prev", event);
						}
						break;
					case $.ui.keyCode.DOWN:
						if (event.altKey) {
							this._toggle(event);
						} else {
							this._move("next", event);
						}
						break;
					case $.ui.keyCode.SPACE:
						if (this.isOpen) {
							this._selectFocusedItem(event);
						} else {
							this._toggle(event);
						}
						break;
					case $.ui.keyCode.LEFT:
						this._move("prev", event);
						break;
					case $.ui.keyCode.RIGHT:
						this._move("next", event);
						break;
					case $.ui.keyCode.HOME:
					case $.ui.keyCode.PAGE_UP:
						this._move("first", event);
						break;
					case $.ui.keyCode.END:
					case $.ui.keyCode.PAGE_DOWN:
						this._move("last", event);
						break;
					default:
						this.menu.trigger(event);
						preventDefault = false;
				}

				if (preventDefault) {
					event.preventDefault();
				}
			}
		},

		_selectFocusedItem: function _selectFocusedItem(event) {
			var item = this.menuItems.eq(this.focusIndex).parent("li");
			if (!item.hasClass("ui-state-disabled")) {
				this._select(item.data("ui-selectmenu-item"), event);
			}
		},

		_select: function _select(item, event) {
			var oldIndex = this.element[0].selectedIndex;

			// Change native select element
			this.element[0].selectedIndex = item.index;
			this.buttonItem.replaceWith(this.buttonItem = this._renderButtonItem(item));
			this._setAria(item);
			this._trigger("select", event, { item: item });

			if (item.index !== oldIndex) {
				this._trigger("change", event, { item: item });
			}

			this.close(event);
		},

		_setAria: function _setAria(item) {
			var id = this.menuItems.eq(item.index).attr("id");

			this.button.attr({
				"aria-labelledby": id,
				"aria-activedescendant": id
			});
			this.menu.attr("aria-activedescendant", id);
		},

		_setOption: function _setOption(key, value) {
			if (key === "icons") {
				var icon = this.button.find("span.ui-icon");
				this._removeClass(icon, null, this.options.icons.button)._addClass(icon, null, value.button);
			}

			this._super(key, value);

			if (key === "appendTo") {
				this.menuWrap.appendTo(this._appendTo());
			}

			if (key === "width") {
				this._resizeButton();
			}
		},

		_setOptionDisabled: function _setOptionDisabled(value) {
			this._super(value);

			this.menuInstance.option("disabled", value);
			this.button.attr("aria-disabled", value);
			this._toggleClass(this.button, null, "ui-state-disabled", value);

			this.element.prop("disabled", value);
			if (value) {
				this.button.attr("tabindex", -1);
				this.close();
			} else {
				this.button.attr("tabindex", 0);
			}
		},

		_appendTo: function _appendTo() {
			var element = this.options.appendTo;

			if (element) {
				element = element.jquery || element.nodeType ? $(element) : this.document.find(element).eq(0);
			}

			if (!element || !element[0]) {
				element = this.element.closest(".ui-front, dialog");
			}

			if (!element.length) {
				element = this.document[0].body;
			}

			return element;
		},

		_toggleAttr: function _toggleAttr() {
			this.button.attr("aria-expanded", this.isOpen);

			// We can't use two _toggleClass() calls here, because we need to make sure
			// we always remove classes first and add them second, otherwise if both classes have the
			// same theme class, it will be removed after we add it.
			this._removeClass(this.button, "ui-selectmenu-button-" + (this.isOpen ? "closed" : "open"))._addClass(this.button, "ui-selectmenu-button-" + (this.isOpen ? "open" : "closed"))._toggleClass(this.menuWrap, "ui-selectmenu-open", null, this.isOpen);

			this.menu.attr("aria-hidden", !this.isOpen);
		},

		_resizeButton: function _resizeButton() {
			var width = this.options.width;

			// For `width: false`, just remove inline style and stop
			if (width === false) {
				this.button.css("width", "");
				return;
			}

			// For `width: null`, match the width of the original element
			if (width === null) {
				width = this.element.show().outerWidth();
				this.element.hide();
			}

			this.button.outerWidth(width);
		},

		_resizeMenu: function _resizeMenu() {
			this.menu.outerWidth(Math.max(this.button.outerWidth(),

			// Support: IE10
			// IE10 wraps long text (possibly a rounding bug)
			// so we add 1px to avoid the wrapping
			this.menu.width("").outerWidth() + 1));
		},

		_getCreateOptions: function _getCreateOptions() {
			var options = this._super();

			options.disabled = this.element.prop("disabled");

			return options;
		},

		_parseOptions: function _parseOptions(options) {
			var that = this,
			    data = [];
			options.each(function (index, item) {
				data.push(that._parseOption($(item), index));
			});
			this.items = data;
		},

		_parseOption: function _parseOption(option, index) {
			var optgroup = option.parent("optgroup");

			return {
				element: option,
				index: index,
				value: option.val(),
				label: option.text(),
				optgroup: optgroup.attr("label") || "",
				disabled: optgroup.prop("disabled") || option.prop("disabled")
			};
		},

		_destroy: function _destroy() {
			this._unbindFormResetHandler();
			this.menuWrap.remove();
			this.button.remove();
			this.element.show();
			this.element.removeUniqueId();
			this.labels.attr("for", this.ids.element);
		}
	}]);

	/*!
  * jQuery UI Slider 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Slider
	//>>group: Widgets
	//>>description: Displays a flexible slider with ranges and accessibility via keyboard.
	//>>docs: http://api.jqueryui.com/slider/
	//>>demos: http://jqueryui.com/slider/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/slider.css
	//>>css.theme: ../../themes/base/theme.css


	var widgetsSlider = $.widget("ui.slider", $.ui.mouse, {
		version: "1.12.1",
		widgetEventPrefix: "slide",

		options: {
			animate: false,
			classes: {
				"ui-slider": "ui-corner-all",
				"ui-slider-handle": "ui-corner-all",

				// Note: ui-widget-header isn't the most fittingly semantic framework class for this
				// element, but worked best visually with a variety of themes
				"ui-slider-range": "ui-corner-all ui-widget-header"
			},
			distance: 0,
			max: 100,
			min: 0,
			orientation: "horizontal",
			range: false,
			step: 1,
			value: 0,
			values: null,

			// Callbacks
			change: null,
			slide: null,
			start: null,
			stop: null
		},

		// Number of pages in a slider
		// (how many times can you page up/down to go through the whole range)
		numPages: 5,

		_create: function _create() {
			this._keySliding = false;
			this._mouseSliding = false;
			this._animateOff = true;
			this._handleIndex = null;
			this._detectOrientation();
			this._mouseInit();
			this._calculateNewMax();

			this._addClass("ui-slider ui-slider-" + this.orientation, "ui-widget ui-widget-content");

			this._refresh();

			this._animateOff = false;
		},

		_refresh: function _refresh() {
			this._createRange();
			this._createHandles();
			this._setupEvents();
			this._refreshValue();
		},

		_createHandles: function _createHandles() {
			var i,
			    handleCount,
			    options = this.options,
			    existingHandles = this.element.find(".ui-slider-handle"),
			    handle = "<span tabindex='0'></span>",
			    handles = [];

			handleCount = options.values && options.values.length || 1;

			if (existingHandles.length > handleCount) {
				existingHandles.slice(handleCount).remove();
				existingHandles = existingHandles.slice(0, handleCount);
			}

			for (i = existingHandles.length; i < handleCount; i++) {
				handles.push(handle);
			}

			this.handles = existingHandles.add($(handles.join("")).appendTo(this.element));

			this._addClass(this.handles, "ui-slider-handle", "ui-state-default");

			this.handle = this.handles.eq(0);

			this.handles.each(function (i) {
				$(this).data("ui-slider-handle-index", i).attr("tabIndex", 0);
			});
		},

		_createRange: function _createRange() {
			var options = this.options;

			if (options.range) {
				if (options.range === true) {
					if (!options.values) {
						options.values = [this._valueMin(), this._valueMin()];
					} else if (options.values.length && options.values.length !== 2) {
						options.values = [options.values[0], options.values[0]];
					} else if ($.isArray(options.values)) {
						options.values = options.values.slice(0);
					}
				}

				if (!this.range || !this.range.length) {
					this.range = $("<div>").appendTo(this.element);

					this._addClass(this.range, "ui-slider-range");
				} else {
					this._removeClass(this.range, "ui-slider-range-min ui-slider-range-max");

					// Handle range switching from true to min/max
					this.range.css({
						"left": "",
						"bottom": ""
					});
				}
				if (options.range === "min" || options.range === "max") {
					this._addClass(this.range, "ui-slider-range-" + options.range);
				}
			} else {
				if (this.range) {
					this.range.remove();
				}
				this.range = null;
			}
		},

		_setupEvents: function _setupEvents() {
			this._off(this.handles);
			this._on(this.handles, this._handleEvents);
			this._hoverable(this.handles);
			this._focusable(this.handles);
		},

		_destroy: function _destroy() {
			this.handles.remove();
			if (this.range) {
				this.range.remove();
			}

			this._mouseDestroy();
		},

		_mouseCapture: function _mouseCapture(event) {
			var position,
			    normValue,
			    distance,
			    closestHandle,
			    index,
			    allowed,
			    offset,
			    mouseOverHandle,
			    that = this,
			    o = this.options;

			if (o.disabled) {
				return false;
			}

			this.elementSize = {
				width: this.element.outerWidth(),
				height: this.element.outerHeight()
			};
			this.elementOffset = this.element.offset();

			position = { x: event.pageX, y: event.pageY };
			normValue = this._normValueFromMouse(position);
			distance = this._valueMax() - this._valueMin() + 1;
			this.handles.each(function (i) {
				var thisDistance = Math.abs(normValue - that.values(i));
				if (distance > thisDistance || distance === thisDistance && (i === that._lastChangedValue || that.values(i) === o.min)) {
					distance = thisDistance;
					closestHandle = $(this);
					index = i;
				}
			});

			allowed = this._start(event, index);
			if (allowed === false) {
				return false;
			}
			this._mouseSliding = true;

			this._handleIndex = index;

			this._addClass(closestHandle, null, "ui-state-active");
			closestHandle.trigger("focus");

			offset = closestHandle.offset();
			mouseOverHandle = !$(event.target).parents().addBack().is(".ui-slider-handle");
			this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
				left: event.pageX - offset.left - closestHandle.width() / 2,
				top: event.pageY - offset.top - closestHandle.height() / 2 - (parseInt(closestHandle.css("borderTopWidth"), 10) || 0) - (parseInt(closestHandle.css("borderBottomWidth"), 10) || 0) + (parseInt(closestHandle.css("marginTop"), 10) || 0)
			};

			if (!this.handles.hasClass("ui-state-hover")) {
				this._slide(event, index, normValue);
			}
			this._animateOff = true;
			return true;
		},

		_mouseStart: function _mouseStart() {
			return true;
		},

		_mouseDrag: function _mouseDrag(event) {
			var position = { x: event.pageX, y: event.pageY },
			    normValue = this._normValueFromMouse(position);

			this._slide(event, this._handleIndex, normValue);

			return false;
		},

		_mouseStop: function _mouseStop(event) {
			this._removeClass(this.handles, null, "ui-state-active");
			this._mouseSliding = false;

			this._stop(event, this._handleIndex);
			this._change(event, this._handleIndex);

			this._handleIndex = null;
			this._clickOffset = null;
			this._animateOff = false;

			return false;
		},

		_detectOrientation: function _detectOrientation() {
			this.orientation = this.options.orientation === "vertical" ? "vertical" : "horizontal";
		},

		_normValueFromMouse: function _normValueFromMouse(position) {
			var pixelTotal, pixelMouse, percentMouse, valueTotal, valueMouse;

			if (this.orientation === "horizontal") {
				pixelTotal = this.elementSize.width;
				pixelMouse = position.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0);
			} else {
				pixelTotal = this.elementSize.height;
				pixelMouse = position.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0);
			}

			percentMouse = pixelMouse / pixelTotal;
			if (percentMouse > 1) {
				percentMouse = 1;
			}
			if (percentMouse < 0) {
				percentMouse = 0;
			}
			if (this.orientation === "vertical") {
				percentMouse = 1 - percentMouse;
			}

			valueTotal = this._valueMax() - this._valueMin();
			valueMouse = this._valueMin() + percentMouse * valueTotal;

			return this._trimAlignValue(valueMouse);
		},

		_uiHash: function _uiHash(index, value, values) {
			var uiHash = {
				handle: this.handles[index],
				handleIndex: index,
				value: value !== undefined ? value : this.value()
			};

			if (this._hasMultipleValues()) {
				uiHash.value = value !== undefined ? value : this.values(index);
				uiHash.values = values || this.values();
			}

			return uiHash;
		},

		_hasMultipleValues: function _hasMultipleValues() {
			return this.options.values && this.options.values.length;
		},

		_start: function _start(event, index) {
			return this._trigger("start", event, this._uiHash(index));
		},

		_slide: function _slide(event, index, newVal) {
			var allowed,
			    otherVal,
			    currentValue = this.value(),
			    newValues = this.values();

			if (this._hasMultipleValues()) {
				otherVal = this.values(index ? 0 : 1);
				currentValue = this.values(index);

				if (this.options.values.length === 2 && this.options.range === true) {
					newVal = index === 0 ? Math.min(otherVal, newVal) : Math.max(otherVal, newVal);
				}

				newValues[index] = newVal;
			}

			if (newVal === currentValue) {
				return;
			}

			allowed = this._trigger("slide", event, this._uiHash(index, newVal, newValues));

			// A slide can be canceled by returning false from the slide callback
			if (allowed === false) {
				return;
			}

			if (this._hasMultipleValues()) {
				this.values(index, newVal);
			} else {
				this.value(newVal);
			}
		},

		_stop: function _stop(event, index) {
			this._trigger("stop", event, this._uiHash(index));
		},

		_change: function _change(event, index) {
			if (!this._keySliding && !this._mouseSliding) {

				//store the last changed value index for reference when handles overlap
				this._lastChangedValue = index;
				this._trigger("change", event, this._uiHash(index));
			}
		},

		value: function value(newValue) {
			if (arguments.length) {
				this.options.value = this._trimAlignValue(newValue);
				this._refreshValue();
				this._change(null, 0);
				return;
			}

			return this._value();
		},

		values: function values(index, newValue) {
			var vals, newValues, i;

			if (arguments.length > 1) {
				this.options.values[index] = this._trimAlignValue(newValue);
				this._refreshValue();
				this._change(null, index);
				return;
			}

			if (arguments.length) {
				if ($.isArray(arguments[0])) {
					vals = this.options.values;
					newValues = arguments[0];
					for (i = 0; i < vals.length; i += 1) {
						vals[i] = this._trimAlignValue(newValues[i]);
						this._change(null, i);
					}
					this._refreshValue();
				} else {
					if (this._hasMultipleValues()) {
						return this._values(index);
					} else {
						return this.value();
					}
				}
			} else {
				return this._values();
			}
		},

		_setOption: function _setOption(key, value) {
			var i,
			    valsLength = 0;

			if (key === "range" && this.options.range === true) {
				if (value === "min") {
					this.options.value = this._values(0);
					this.options.values = null;
				} else if (value === "max") {
					this.options.value = this._values(this.options.values.length - 1);
					this.options.values = null;
				}
			}

			if ($.isArray(this.options.values)) {
				valsLength = this.options.values.length;
			}

			this._super(key, value);

			switch (key) {
				case "orientation":
					this._detectOrientation();
					this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-" + this.orientation);
					this._refreshValue();
					if (this.options.range) {
						this._refreshRange(value);
					}

					// Reset positioning from previous orientation
					this.handles.css(value === "horizontal" ? "bottom" : "left", "");
					break;
				case "value":
					this._animateOff = true;
					this._refreshValue();
					this._change(null, 0);
					this._animateOff = false;
					break;
				case "values":
					this._animateOff = true;
					this._refreshValue();

					// Start from the last handle to prevent unreachable handles (#9046)
					for (i = valsLength - 1; i >= 0; i--) {
						this._change(null, i);
					}
					this._animateOff = false;
					break;
				case "step":
				case "min":
				case "max":
					this._animateOff = true;
					this._calculateNewMax();
					this._refreshValue();
					this._animateOff = false;
					break;
				case "range":
					this._animateOff = true;
					this._refresh();
					this._animateOff = false;
					break;
			}
		},

		_setOptionDisabled: function _setOptionDisabled(value) {
			this._super(value);

			this._toggleClass(null, "ui-state-disabled", !!value);
		},

		//internal value getter
		// _value() returns value trimmed by min and max, aligned by step
		_value: function _value() {
			var val = this.options.value;
			val = this._trimAlignValue(val);

			return val;
		},

		//internal values getter
		// _values() returns array of values trimmed by min and max, aligned by step
		// _values( index ) returns single value trimmed by min and max, aligned by step
		_values: function _values(index) {
			var val, vals, i;

			if (arguments.length) {
				val = this.options.values[index];
				val = this._trimAlignValue(val);

				return val;
			} else if (this._hasMultipleValues()) {

				// .slice() creates a copy of the array
				// this copy gets trimmed by min and max and then returned
				vals = this.options.values.slice();
				for (i = 0; i < vals.length; i += 1) {
					vals[i] = this._trimAlignValue(vals[i]);
				}

				return vals;
			} else {
				return [];
			}
		},

		// Returns the step-aligned value that val is closest to, between (inclusive) min and max
		_trimAlignValue: function _trimAlignValue(val) {
			if (val <= this._valueMin()) {
				return this._valueMin();
			}
			if (val >= this._valueMax()) {
				return this._valueMax();
			}
			var step = this.options.step > 0 ? this.options.step : 1,
			    valModStep = (val - this._valueMin()) % step,
			    alignValue = val - valModStep;

			if (Math.abs(valModStep) * 2 >= step) {
				alignValue += valModStep > 0 ? step : -step;
			}

			// Since JavaScript has problems with large floats, round
			// the final value to 5 digits after the decimal point (see #4124)
			return parseFloat(alignValue.toFixed(5));
		},

		_calculateNewMax: function _calculateNewMax() {
			var max = this.options.max,
			    min = this._valueMin(),
			    step = this.options.step,
			    aboveMin = Math.round((max - min) / step) * step;
			max = aboveMin + min;
			if (max > this.options.max) {

				//If max is not divisible by step, rounding off may increase its value
				max -= step;
			}
			this.max = parseFloat(max.toFixed(this._precision()));
		},

		_precision: function _precision() {
			var precision = this._precisionOf(this.options.step);
			if (this.options.min !== null) {
				precision = Math.max(precision, this._precisionOf(this.options.min));
			}
			return precision;
		},

		_precisionOf: function _precisionOf(num) {
			var str = num.toString(),
			    decimal = str.indexOf(".");
			return decimal === -1 ? 0 : str.length - decimal - 1;
		},

		_valueMin: function _valueMin() {
			return this.options.min;
		},

		_valueMax: function _valueMax() {
			return this.max;
		},

		_refreshRange: function _refreshRange(orientation) {
			if (orientation === "vertical") {
				this.range.css({ "width": "", "left": "" });
			}
			if (orientation === "horizontal") {
				this.range.css({ "height": "", "bottom": "" });
			}
		},

		_refreshValue: function _refreshValue() {
			var lastValPercent,
			    valPercent,
			    value,
			    valueMin,
			    valueMax,
			    oRange = this.options.range,
			    o = this.options,
			    that = this,
			    animate = !this._animateOff ? o.animate : false,
			    _set = {};

			if (this._hasMultipleValues()) {
				this.handles.each(function (i) {
					valPercent = (that.values(i) - that._valueMin()) / (that._valueMax() - that._valueMin()) * 100;
					_set[that.orientation === "horizontal" ? "left" : "bottom"] = valPercent + "%";
					$(this).stop(1, 1)[animate ? "animate" : "css"](_set, o.animate);
					if (that.options.range === true) {
						if (that.orientation === "horizontal") {
							if (i === 0) {
								that.range.stop(1, 1)[animate ? "animate" : "css"]({
									left: valPercent + "%"
								}, o.animate);
							}
							if (i === 1) {
								that.range[animate ? "animate" : "css"]({
									width: valPercent - lastValPercent + "%"
								}, {
									queue: false,
									duration: o.animate
								});
							}
						} else {
							if (i === 0) {
								that.range.stop(1, 1)[animate ? "animate" : "css"]({
									bottom: valPercent + "%"
								}, o.animate);
							}
							if (i === 1) {
								that.range[animate ? "animate" : "css"]({
									height: valPercent - lastValPercent + "%"
								}, {
									queue: false,
									duration: o.animate
								});
							}
						}
					}
					lastValPercent = valPercent;
				});
			} else {
				value = this.value();
				valueMin = this._valueMin();
				valueMax = this._valueMax();
				valPercent = valueMax !== valueMin ? (value - valueMin) / (valueMax - valueMin) * 100 : 0;
				_set[this.orientation === "horizontal" ? "left" : "bottom"] = valPercent + "%";
				this.handle.stop(1, 1)[animate ? "animate" : "css"](_set, o.animate);

				if (oRange === "min" && this.orientation === "horizontal") {
					this.range.stop(1, 1)[animate ? "animate" : "css"]({
						width: valPercent + "%"
					}, o.animate);
				}
				if (oRange === "max" && this.orientation === "horizontal") {
					this.range.stop(1, 1)[animate ? "animate" : "css"]({
						width: 100 - valPercent + "%"
					}, o.animate);
				}
				if (oRange === "min" && this.orientation === "vertical") {
					this.range.stop(1, 1)[animate ? "animate" : "css"]({
						height: valPercent + "%"
					}, o.animate);
				}
				if (oRange === "max" && this.orientation === "vertical") {
					this.range.stop(1, 1)[animate ? "animate" : "css"]({
						height: 100 - valPercent + "%"
					}, o.animate);
				}
			}
		},

		_handleEvents: {
			keydown: function keydown(event) {
				var allowed,
				    curVal,
				    newVal,
				    step,
				    index = $(event.target).data("ui-slider-handle-index");

				switch (event.keyCode) {
					case $.ui.keyCode.HOME:
					case $.ui.keyCode.END:
					case $.ui.keyCode.PAGE_UP:
					case $.ui.keyCode.PAGE_DOWN:
					case $.ui.keyCode.UP:
					case $.ui.keyCode.RIGHT:
					case $.ui.keyCode.DOWN:
					case $.ui.keyCode.LEFT:
						event.preventDefault();
						if (!this._keySliding) {
							this._keySliding = true;
							this._addClass($(event.target), null, "ui-state-active");
							allowed = this._start(event, index);
							if (allowed === false) {
								return;
							}
						}
						break;
				}

				step = this.options.step;
				if (this._hasMultipleValues()) {
					curVal = newVal = this.values(index);
				} else {
					curVal = newVal = this.value();
				}

				switch (event.keyCode) {
					case $.ui.keyCode.HOME:
						newVal = this._valueMin();
						break;
					case $.ui.keyCode.END:
						newVal = this._valueMax();
						break;
					case $.ui.keyCode.PAGE_UP:
						newVal = this._trimAlignValue(curVal + (this._valueMax() - this._valueMin()) / this.numPages);
						break;
					case $.ui.keyCode.PAGE_DOWN:
						newVal = this._trimAlignValue(curVal - (this._valueMax() - this._valueMin()) / this.numPages);
						break;
					case $.ui.keyCode.UP:
					case $.ui.keyCode.RIGHT:
						if (curVal === this._valueMax()) {
							return;
						}
						newVal = this._trimAlignValue(curVal + step);
						break;
					case $.ui.keyCode.DOWN:
					case $.ui.keyCode.LEFT:
						if (curVal === this._valueMin()) {
							return;
						}
						newVal = this._trimAlignValue(curVal - step);
						break;
				}

				this._slide(event, index, newVal);
			},
			keyup: function keyup(event) {
				var index = $(event.target).data("ui-slider-handle-index");

				if (this._keySliding) {
					this._keySliding = false;
					this._stop(event, index);
					this._change(event, index);
					this._removeClass($(event.target), null, "ui-state-active");
				}
			}
		}
	});

	/*!
  * jQuery UI Sortable 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Sortable
	//>>group: Interactions
	//>>description: Enables items in a list to be sorted using the mouse.
	//>>docs: http://api.jqueryui.com/sortable/
	//>>demos: http://jqueryui.com/sortable/
	//>>css.structure: ../../themes/base/sortable.css


	var widgetsSortable = $.widget("ui.sortable", $.ui.mouse, {
		version: "1.12.1",
		widgetEventPrefix: "sort",
		ready: false,
		options: {
			appendTo: "parent",
			axis: false,
			connectWith: false,
			containment: false,
			cursor: "auto",
			cursorAt: false,
			dropOnEmpty: true,
			forcePlaceholderSize: false,
			forceHelperSize: false,
			grid: false,
			handle: false,
			helper: "original",
			items: "> *",
			opacity: false,
			placeholder: false,
			revert: false,
			scroll: true,
			scrollSensitivity: 20,
			scrollSpeed: 20,
			scope: "default",
			tolerance: "intersect",
			zIndex: 1000,

			// Callbacks
			activate: null,
			beforeStop: null,
			change: null,
			deactivate: null,
			out: null,
			over: null,
			receive: null,
			remove: null,
			sort: null,
			start: null,
			stop: null,
			update: null
		},

		_isOverAxis: function _isOverAxis(x, reference, size) {
			return x >= reference && x < reference + size;
		},

		_isFloating: function _isFloating(item) {
			return (/left|right/.test(item.css("float")) || /inline|table-cell/.test(item.css("display"))
			);
		},

		_create: function _create() {
			this.containerCache = {};
			this._addClass("ui-sortable");

			//Get the items
			this.refresh();

			//Let's determine the parent's offset
			this.offset = this.element.offset();

			//Initialize mouse events for interaction
			this._mouseInit();

			this._setHandleClassName();

			//We're ready to go
			this.ready = true;
		},

		_setOption: function _setOption(key, value) {
			this._super(key, value);

			if (key === "handle") {
				this._setHandleClassName();
			}
		},

		_setHandleClassName: function _setHandleClassName() {
			var that = this;
			this._removeClass(this.element.find(".ui-sortable-handle"), "ui-sortable-handle");
			$.each(this.items, function () {
				that._addClass(this.instance.options.handle ? this.item.find(this.instance.options.handle) : this.item, "ui-sortable-handle");
			});
		},

		_destroy: function _destroy() {
			this._mouseDestroy();

			for (var i = this.items.length - 1; i >= 0; i--) {
				this.items[i].item.removeData(this.widgetName + "-item");
			}

			return this;
		},

		_mouseCapture: function _mouseCapture(event, overrideHandle) {
			var currentItem = null,
			    validHandle = false,
			    that = this;

			if (this.reverting) {
				return false;
			}

			if (this.options.disabled || this.options.type === "static") {
				return false;
			}

			//We have to refresh the items data once first
			this._refreshItems(event);

			//Find out if the clicked node (or one of its parents) is a actual item in this.items
			$(event.target).parents().each(function () {
				if ($.data(this, that.widgetName + "-item") === that) {
					currentItem = $(this);
					return false;
				}
			});
			if ($.data(event.target, that.widgetName + "-item") === that) {
				currentItem = $(event.target);
			}

			if (!currentItem) {
				return false;
			}
			if (this.options.handle && !overrideHandle) {
				$(this.options.handle, currentItem).find("*").addBack().each(function () {
					if (this === event.target) {
						validHandle = true;
					}
				});
				if (!validHandle) {
					return false;
				}
			}

			this.currentItem = currentItem;
			this._removeCurrentsFromItems();
			return true;
		},

		_mouseStart: function _mouseStart(event, overrideHandle, noActivation) {

			var i,
			    body,
			    o = this.options;

			this.currentContainer = this;

			//We only need to call refreshPositions, because the refreshItems call has been moved to
			// mouseCapture
			this.refreshPositions();

			//Create and append the visible helper
			this.helper = this._createHelper(event);

			//Cache the helper size
			this._cacheHelperProportions();

			/*
    * - Position generation -
    * This block generates everything position related - it's the core of draggables.
    */

			//Cache the margins of the original element
			this._cacheMargins();

			//Get the next scrolling parent
			this.scrollParent = this.helper.scrollParent();

			//The element's absolute position on the page minus margins
			this.offset = this.currentItem.offset();
			this.offset = {
				top: this.offset.top - this.margins.top,
				left: this.offset.left - this.margins.left
			};

			$.extend(this.offset, {
				click: { //Where the click happened, relative to the element
					left: event.pageX - this.offset.left,
					top: event.pageY - this.offset.top
				},
				parent: this._getParentOffset(),

				// This is a relative to absolute position minus the actual position calculation -
				// only used for relative positioned helper
				relative: this._getRelativeOffset()
			});

			// Only after we got the offset, we can change the helper's position to absolute
			// TODO: Still need to figure out a way to make relative sorting possible
			this.helper.css("position", "absolute");
			this.cssPosition = this.helper.css("position");

			//Generate the original position
			this.originalPosition = this._generatePosition(event);
			this.originalPageX = event.pageX;
			this.originalPageY = event.pageY;

			//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
			o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt);

			//Cache the former DOM position
			this.domPosition = {
				prev: this.currentItem.prev()[0],
				parent: this.currentItem.parent()[0]
			};

			// If the helper is not the original, hide the original so it's not playing any role during
			// the drag, won't cause anything bad this way
			if (this.helper[0] !== this.currentItem[0]) {
				this.currentItem.hide();
			}

			//Create the placeholder
			this._createPlaceholder();

			//Set a containment if given in the options
			if (o.containment) {
				this._setContainment();
			}

			if (o.cursor && o.cursor !== "auto") {
				// cursor option
				body = this.document.find("body");

				// Support: IE
				this.storedCursor = body.css("cursor");
				body.css("cursor", o.cursor);

				this.storedStylesheet = $("<style>*{ cursor: " + o.cursor + " !important; }</style>").appendTo(body);
			}

			if (o.opacity) {
				// opacity option
				if (this.helper.css("opacity")) {
					this._storedOpacity = this.helper.css("opacity");
				}
				this.helper.css("opacity", o.opacity);
			}

			if (o.zIndex) {
				// zIndex option
				if (this.helper.css("zIndex")) {
					this._storedZIndex = this.helper.css("zIndex");
				}
				this.helper.css("zIndex", o.zIndex);
			}

			//Prepare scrolling
			if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
				this.overflowOffset = this.scrollParent.offset();
			}

			//Call callbacks
			this._trigger("start", event, this._uiHash());

			//Recache the helper size
			if (!this._preserveHelperProportions) {
				this._cacheHelperProportions();
			}

			//Post "activate" events to possible containers
			if (!noActivation) {
				for (i = this.containers.length - 1; i >= 0; i--) {
					this.containers[i]._trigger("activate", event, this._uiHash(this));
				}
			}

			//Prepare possible droppables
			if ($.ui.ddmanager) {
				$.ui.ddmanager.current = this;
			}

			if ($.ui.ddmanager && !o.dropBehaviour) {
				$.ui.ddmanager.prepareOffsets(this, event);
			}

			this.dragging = true;

			this._addClass(this.helper, "ui-sortable-helper");

			// Execute the drag once - this causes the helper not to be visiblebefore getting its
			// correct position
			this._mouseDrag(event);
			return true;
		},

		_mouseDrag: function _mouseDrag(event) {
			var i,
			    item,
			    itemElement,
			    intersection,
			    o = this.options,
			    scrolled = false;

			//Compute the helpers position
			this.position = this._generatePosition(event);
			this.positionAbs = this._convertPositionTo("absolute");

			if (!this.lastPositionAbs) {
				this.lastPositionAbs = this.positionAbs;
			}

			//Do scrolling
			if (this.options.scroll) {
				if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {

					if (this.overflowOffset.top + this.scrollParent[0].offsetHeight - event.pageY < o.scrollSensitivity) {
						this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
					} else if (event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
						this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
					}

					if (this.overflowOffset.left + this.scrollParent[0].offsetWidth - event.pageX < o.scrollSensitivity) {
						this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
					} else if (event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
						this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
					}
				} else {

					if (event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
						scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
					} else if (this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
						scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
					}

					if (event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
						scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
					} else if (this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
						scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
					}
				}

				if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
					$.ui.ddmanager.prepareOffsets(this, event);
				}
			}

			//Regenerate the absolute position used for position checks
			this.positionAbs = this._convertPositionTo("absolute");

			//Set the helper position
			if (!this.options.axis || this.options.axis !== "y") {
				this.helper[0].style.left = this.position.left + "px";
			}
			if (!this.options.axis || this.options.axis !== "x") {
				this.helper[0].style.top = this.position.top + "px";
			}

			//Rearrange
			for (i = this.items.length - 1; i >= 0; i--) {

				//Cache variables and intersection, continue if no intersection
				item = this.items[i];
				itemElement = item.item[0];
				intersection = this._intersectsWithPointer(item);
				if (!intersection) {
					continue;
				}

				// Only put the placeholder inside the current Container, skip all
				// items from other containers. This works because when moving
				// an item from one container to another the
				// currentContainer is switched before the placeholder is moved.
				//
				// Without this, moving items in "sub-sortables" can cause
				// the placeholder to jitter between the outer and inner container.
				if (item.instance !== this.currentContainer) {
					continue;
				}

				// Cannot intersect with itself
				// no useless actions that have been done before
				// no action if the item moved is the parent of the item checked
				if (itemElement !== this.currentItem[0] && this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement && !$.contains(this.placeholder[0], itemElement) && (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)) {

					this.direction = intersection === 1 ? "down" : "up";

					if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
						this._rearrange(event, item);
					} else {
						break;
					}

					this._trigger("change", event, this._uiHash());
					break;
				}
			}

			//Post events to containers
			this._contactContainers(event);

			//Interconnect with droppables
			if ($.ui.ddmanager) {
				$.ui.ddmanager.drag(this, event);
			}

			//Call callbacks
			this._trigger("sort", event, this._uiHash());

			this.lastPositionAbs = this.positionAbs;
			return false;
		},

		_mouseStop: function _mouseStop(event, noPropagation) {

			if (!event) {
				return;
			}

			//If we are using droppables, inform the manager about the drop
			if ($.ui.ddmanager && !this.options.dropBehaviour) {
				$.ui.ddmanager.drop(this, event);
			}

			if (this.options.revert) {
				var that = this,
				    cur = this.placeholder.offset(),
				    axis = this.options.axis,
				    animation = {};

				if (!axis || axis === "x") {
					animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
				}
				if (!axis || axis === "y") {
					animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
				}
				this.reverting = true;
				$(this.helper).animate(animation, parseInt(this.options.revert, 10) || 500, function () {
					that._clear(event);
				});
			} else {
				this._clear(event, noPropagation);
			}

			return false;
		},

		cancel: function cancel() {

			if (this.dragging) {

				this._mouseUp(new $.Event("mouseup", { target: null }));

				if (this.options.helper === "original") {
					this.currentItem.css(this._storedCSS);
					this._removeClass(this.currentItem, "ui-sortable-helper");
				} else {
					this.currentItem.show();
				}

				//Post deactivating events to containers
				for (var i = this.containers.length - 1; i >= 0; i--) {
					this.containers[i]._trigger("deactivate", null, this._uiHash(this));
					if (this.containers[i].containerCache.over) {
						this.containers[i]._trigger("out", null, this._uiHash(this));
						this.containers[i].containerCache.over = 0;
					}
				}
			}

			if (this.placeholder) {

				//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
				// it unbinds ALL events from the original node!
				if (this.placeholder[0].parentNode) {
					this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
				}
				if (this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
					this.helper.remove();
				}

				$.extend(this, {
					helper: null,
					dragging: false,
					reverting: false,
					_noFinalSort: null
				});

				if (this.domPosition.prev) {
					$(this.domPosition.prev).after(this.currentItem);
				} else {
					$(this.domPosition.parent).prepend(this.currentItem);
				}
			}

			return this;
		},

		serialize: function serialize(o) {

			var items = this._getItemsAsjQuery(o && o.connected),
			    str = [];
			o = o || {};

			$(items).each(function () {
				var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || /(.+)[\-=_](.+)/);
				if (res) {
					str.push((o.key || res[1] + "[]") + "=" + (o.key && o.expression ? res[1] : res[2]));
				}
			});

			if (!str.length && o.key) {
				str.push(o.key + "=");
			}

			return str.join("&");
		},

		toArray: function toArray(o) {

			var items = this._getItemsAsjQuery(o && o.connected),
			    ret = [];

			o = o || {};

			items.each(function () {
				ret.push($(o.item || this).attr(o.attribute || "id") || "");
			});
			return ret;
		},

		/* Be careful with the following core functions */
		_intersectsWith: function _intersectsWith(item) {

			var x1 = this.positionAbs.left,
			    x2 = x1 + this.helperProportions.width,
			    y1 = this.positionAbs.top,
			    y2 = y1 + this.helperProportions.height,
			    l = item.left,
			    r = l + item.width,
			    t = item.top,
			    b = t + item.height,
			    dyClick = this.offset.click.top,
			    dxClick = this.offset.click.left,
			    isOverElementHeight = this.options.axis === "x" || y1 + dyClick > t && y1 + dyClick < b,
			    isOverElementWidth = this.options.axis === "y" || x1 + dxClick > l && x1 + dxClick < r,
			    isOverElement = isOverElementHeight && isOverElementWidth;

			if (this.options.tolerance === "pointer" || this.options.forcePointerForContainers || this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"]) {
				return isOverElement;
			} else {

				return l < x1 + this.helperProportions.width / 2 && // Right Half
				x2 - this.helperProportions.width / 2 < r && // Left Half
				t < y1 + this.helperProportions.height / 2 && // Bottom Half
				y2 - this.helperProportions.height / 2 < b; // Top Half
			}
		},

		_intersectsWithPointer: function _intersectsWithPointer(item) {
			var verticalDirection,
			    horizontalDirection,
			    isOverElementHeight = this.options.axis === "x" || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
			    isOverElementWidth = this.options.axis === "y" || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
			    isOverElement = isOverElementHeight && isOverElementWidth;

			if (!isOverElement) {
				return false;
			}

			verticalDirection = this._getDragVerticalDirection();
			horizontalDirection = this._getDragHorizontalDirection();

			return this.floating ? horizontalDirection === "right" || verticalDirection === "down" ? 2 : 1 : verticalDirection && (verticalDirection === "down" ? 2 : 1);
		},

		_intersectsWithSides: function _intersectsWithSides(item) {

			var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + item.height / 2, item.height),
			    isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + item.width / 2, item.width),
			    verticalDirection = this._getDragVerticalDirection(),
			    horizontalDirection = this._getDragHorizontalDirection();

			if (this.floating && horizontalDirection) {
				return horizontalDirection === "right" && isOverRightHalf || horizontalDirection === "left" && !isOverRightHalf;
			} else {
				return verticalDirection && (verticalDirection === "down" && isOverBottomHalf || verticalDirection === "up" && !isOverBottomHalf);
			}
		},

		_getDragVerticalDirection: function _getDragVerticalDirection() {
			var delta = this.positionAbs.top - this.lastPositionAbs.top;
			return delta !== 0 && (delta > 0 ? "down" : "up");
		},

		_getDragHorizontalDirection: function _getDragHorizontalDirection() {
			var delta = this.positionAbs.left - this.lastPositionAbs.left;
			return delta !== 0 && (delta > 0 ? "right" : "left");
		},

		refresh: function refresh(event) {
			this._refreshItems(event);
			this._setHandleClassName();
			this.refreshPositions();
			return this;
		},

		_connectWith: function _connectWith() {
			var options = this.options;
			return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
		},

		_getItemsAsjQuery: function _getItemsAsjQuery(connected) {

			var i,
			    j,
			    cur,
			    inst,
			    items = [],
			    queries = [],
			    connectWith = this._connectWith();

			if (connectWith && connected) {
				for (i = connectWith.length - 1; i >= 0; i--) {
					cur = $(connectWith[i], this.document[0]);
					for (j = cur.length - 1; j >= 0; j--) {
						inst = $.data(cur[j], this.widgetFullName);
						if (inst && inst !== this && !inst.options.disabled) {
							queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
						}
					}
				}
			}

			queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);

			function addItems() {
				items.push(this);
			}
			for (i = queries.length - 1; i >= 0; i--) {
				queries[i][0].each(addItems);
			}

			return $(items);
		},

		_removeCurrentsFromItems: function _removeCurrentsFromItems() {

			var list = this.currentItem.find(":data(" + this.widgetName + "-item)");

			this.items = $.grep(this.items, function (item) {
				for (var j = 0; j < list.length; j++) {
					if (list[j] === item.item[0]) {
						return false;
					}
				}
				return true;
			});
		},

		_refreshItems: function _refreshItems(event) {

			this.items = [];
			this.containers = [this];

			var i,
			    j,
			    cur,
			    inst,
			    targetData,
			    _queries,
			    item,
			    queriesLength,
			    items = this.items,
			    queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
			    connectWith = this._connectWith();

			//Shouldn't be run the first time through due to massive slow-down
			if (connectWith && this.ready) {
				for (i = connectWith.length - 1; i >= 0; i--) {
					cur = $(connectWith[i], this.document[0]);
					for (j = cur.length - 1; j >= 0; j--) {
						inst = $.data(cur[j], this.widgetFullName);
						if (inst && inst !== this && !inst.options.disabled) {
							queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
							this.containers.push(inst);
						}
					}
				}
			}

			for (i = queries.length - 1; i >= 0; i--) {
				targetData = queries[i][1];
				_queries = queries[i][0];

				for (j = 0, queriesLength = _queries.length; j < queriesLength; j++) {
					item = $(_queries[j]);

					// Data for target checking (mouse manager)
					item.data(this.widgetName + "-item", targetData);

					items.push({
						item: item,
						instance: targetData,
						width: 0, height: 0,
						left: 0, top: 0
					});
				}
			}
		},

		refreshPositions: function refreshPositions(fast) {

			// Determine whether items are being displayed horizontally
			this.floating = this.items.length ? this.options.axis === "x" || this._isFloating(this.items[0].item) : false;

			//This has to be redone because due to the item being moved out/into the offsetParent,
			// the offsetParent's position will change
			if (this.offsetParent && this.helper) {
				this.offset.parent = this._getParentOffset();
			}

			var i, item, t, p;

			for (i = this.items.length - 1; i >= 0; i--) {
				item = this.items[i];

				//We ignore calculating positions of all connected containers when we're not over them
				if (item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
					continue;
				}

				t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;

				if (!fast) {
					item.width = t.outerWidth();
					item.height = t.outerHeight();
				}

				p = t.offset();
				item.left = p.left;
				item.top = p.top;
			}

			if (this.options.custom && this.options.custom.refreshContainers) {
				this.options.custom.refreshContainers.call(this);
			} else {
				for (i = this.containers.length - 1; i >= 0; i--) {
					p = this.containers[i].element.offset();
					this.containers[i].containerCache.left = p.left;
					this.containers[i].containerCache.top = p.top;
					this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
					this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
				}
			}

			return this;
		},

		_createPlaceholder: function _createPlaceholder(that) {
			that = that || this;
			var className,
			    o = that.options;

			if (!o.placeholder || o.placeholder.constructor === String) {
				className = o.placeholder;
				o.placeholder = {
					element: function element() {

						var nodeName = that.currentItem[0].nodeName.toLowerCase(),
						    element = $("<" + nodeName + ">", that.document[0]);

						that._addClass(element, "ui-sortable-placeholder", className || that.currentItem[0].className)._removeClass(element, "ui-sortable-helper");

						if (nodeName === "tbody") {
							that._createTrPlaceholder(that.currentItem.find("tr").eq(0), $("<tr>", that.document[0]).appendTo(element));
						} else if (nodeName === "tr") {
							that._createTrPlaceholder(that.currentItem, element);
						} else if (nodeName === "img") {
							element.attr("src", that.currentItem.attr("src"));
						}

						if (!className) {
							element.css("visibility", "hidden");
						}

						return element;
					},
					update: function update(container, p) {

						// 1. If a className is set as 'placeholder option, we don't force sizes -
						// the class is responsible for that
						// 2. The option 'forcePlaceholderSize can be enabled to force it even if a
						// class name is specified
						if (className && !o.forcePlaceholderSize) {
							return;
						}

						//If the element doesn't have a actual height by itself (without styles coming
						// from a stylesheet), it receives the inline height from the dragged item
						if (!p.height()) {
							p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop") || 0, 10) - parseInt(that.currentItem.css("paddingBottom") || 0, 10));
						}
						if (!p.width()) {
							p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft") || 0, 10) - parseInt(that.currentItem.css("paddingRight") || 0, 10));
						}
					}
				};
			}

			//Create the placeholder
			that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));

			//Append it after the actual current item
			that.currentItem.after(that.placeholder);

			//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
			o.placeholder.update(that, that.placeholder);
		},

		_createTrPlaceholder: function _createTrPlaceholder(sourceTr, targetTr) {
			var that = this;

			sourceTr.children().each(function () {
				$("<td>&#160;</td>", that.document[0]).attr("colspan", $(this).attr("colspan") || 1).appendTo(targetTr);
			});
		},

		_contactContainers: function _contactContainers(event) {
			var i,
			    j,
			    dist,
			    itemWithLeastDistance,
			    posProperty,
			    sizeProperty,
			    cur,
			    nearBottom,
			    floating,
			    axis,
			    innermostContainer = null,
			    innermostIndex = null;

			// Get innermost container that intersects with item
			for (i = this.containers.length - 1; i >= 0; i--) {

				// Never consider a container that's located within the item itself
				if ($.contains(this.currentItem[0], this.containers[i].element[0])) {
					continue;
				}

				if (this._intersectsWith(this.containers[i].containerCache)) {

					// If we've already found a container and it's more "inner" than this, then continue
					if (innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
						continue;
					}

					innermostContainer = this.containers[i];
					innermostIndex = i;
				} else {

					// container doesn't intersect. trigger "out" event if necessary
					if (this.containers[i].containerCache.over) {
						this.containers[i]._trigger("out", event, this._uiHash(this));
						this.containers[i].containerCache.over = 0;
					}
				}
			}

			// If no intersecting containers found, return
			if (!innermostContainer) {
				return;
			}

			// Move the item into the container if it's not there already
			if (this.containers.length === 1) {
				if (!this.containers[innermostIndex].containerCache.over) {
					this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
					this.containers[innermostIndex].containerCache.over = 1;
				}
			} else {

				// When entering a new container, we will find the item with the least distance and
				// append our item near it
				dist = 10000;
				itemWithLeastDistance = null;
				floating = innermostContainer.floating || this._isFloating(this.currentItem);
				posProperty = floating ? "left" : "top";
				sizeProperty = floating ? "width" : "height";
				axis = floating ? "pageX" : "pageY";

				for (j = this.items.length - 1; j >= 0; j--) {
					if (!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
						continue;
					}
					if (this.items[j].item[0] === this.currentItem[0]) {
						continue;
					}

					cur = this.items[j].item.offset()[posProperty];
					nearBottom = false;
					if (event[axis] - cur > this.items[j][sizeProperty] / 2) {
						nearBottom = true;
					}

					if (Math.abs(event[axis] - cur) < dist) {
						dist = Math.abs(event[axis] - cur);
						itemWithLeastDistance = this.items[j];
						this.direction = nearBottom ? "up" : "down";
					}
				}

				//Check if dropOnEmpty is enabled
				if (!itemWithLeastDistance && !this.options.dropOnEmpty) {
					return;
				}

				if (this.currentContainer === this.containers[innermostIndex]) {
					if (!this.currentContainer.containerCache.over) {
						this.containers[innermostIndex]._trigger("over", event, this._uiHash());
						this.currentContainer.containerCache.over = 1;
					}
					return;
				}

				itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
				this._trigger("change", event, this._uiHash());
				this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
				this.currentContainer = this.containers[innermostIndex];

				//Update the placeholder
				this.options.placeholder.update(this.currentContainer, this.placeholder);

				this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
				this.containers[innermostIndex].containerCache.over = 1;
			}
		},

		_createHelper: function _createHelper(event) {

			var o = this.options,
			    helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : o.helper === "clone" ? this.currentItem.clone() : this.currentItem;

			//Add the helper to the DOM if that didn't happen already
			if (!helper.parents("body").length) {
				$(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
			}

			if (helper[0] === this.currentItem[0]) {
				this._storedCSS = {
					width: this.currentItem[0].style.width,
					height: this.currentItem[0].style.height,
					position: this.currentItem.css("position"),
					top: this.currentItem.css("top"),
					left: this.currentItem.css("left")
				};
			}

			if (!helper[0].style.width || o.forceHelperSize) {
				helper.width(this.currentItem.width());
			}
			if (!helper[0].style.height || o.forceHelperSize) {
				helper.height(this.currentItem.height());
			}

			return helper;
		},

		_adjustOffsetFromHelper: function _adjustOffsetFromHelper(obj) {
			if (typeof obj === "string") {
				obj = obj.split(" ");
			}
			if ($.isArray(obj)) {
				obj = { left: +obj[0], top: +obj[1] || 0 };
			}
			if ("left" in obj) {
				this.offset.click.left = obj.left + this.margins.left;
			}
			if ("right" in obj) {
				this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
			}
			if ("top" in obj) {
				this.offset.click.top = obj.top + this.margins.top;
			}
			if ("bottom" in obj) {
				this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
			}
		},

		_getParentOffset: function _getParentOffset() {

			//Get the offsetParent and cache its position
			this.offsetParent = this.helper.offsetParent();
			var po = this.offsetParent.offset();

			// This is a special case where we need to modify a offset calculated on start, since the
			// following happened:
			// 1. The position of the helper is absolute, so it's position is calculated based on the
			// next positioned parent
			// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
			// the document, which means that the scroll is included in the initial calculation of the
			// offset of the parent, and never recalculated upon drag
			if (this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
				po.left += this.scrollParent.scrollLeft();
				po.top += this.scrollParent.scrollTop();
			}

			// This needs to be actually done for all browsers, since pageX/pageY includes this
			// information with an ugly IE fix
			if (this.offsetParent[0] === this.document[0].body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie) {
				po = { top: 0, left: 0 };
			}

			return {
				top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
				left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
			};
		},

		_getRelativeOffset: function _getRelativeOffset() {

			if (this.cssPosition === "relative") {
				var p = this.currentItem.position();
				return {
					top: p.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(),
					left: p.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()
				};
			} else {
				return { top: 0, left: 0 };
			}
		},

		_cacheMargins: function _cacheMargins() {
			this.margins = {
				left: parseInt(this.currentItem.css("marginLeft"), 10) || 0,
				top: parseInt(this.currentItem.css("marginTop"), 10) || 0
			};
		},

		_cacheHelperProportions: function _cacheHelperProportions() {
			this.helperProportions = {
				width: this.helper.outerWidth(),
				height: this.helper.outerHeight()
			};
		},

		_setContainment: function _setContainment() {

			var ce,
			    co,
			    over,
			    o = this.options;
			if (o.containment === "parent") {
				o.containment = this.helper[0].parentNode;
			}
			if (o.containment === "document" || o.containment === "window") {
				this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left, (o.containment === "document" ? this.document.height() || document.body.parentNode.scrollHeight : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
			}

			if (!/^(document|window|parent)$/.test(o.containment)) {
				ce = $(o.containment)[0];
				co = $(o.containment).offset();
				over = $(ce).css("overflow") !== "hidden";

				this.containment = [co.left + (parseInt($(ce).css("borderLeftWidth"), 10) || 0) + (parseInt($(ce).css("paddingLeft"), 10) || 0) - this.margins.left, co.top + (parseInt($(ce).css("borderTopWidth"), 10) || 0) + (parseInt($(ce).css("paddingTop"), 10) || 0) - this.margins.top, co.left + (over ? Math.max(ce.scrollWidth, ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"), 10) || 0) - (parseInt($(ce).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, co.top + (over ? Math.max(ce.scrollHeight, ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"), 10) || 0) - (parseInt($(ce).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top];
			}
		},

		_convertPositionTo: function _convertPositionTo(d, pos) {

			if (!pos) {
				pos = this.position;
			}
			var mod = d === "absolute" ? 1 : -1,
			    scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
			    scrollIsRootNode = /(html|body)/i.test(scroll[0].tagName);

			return {
				top:

				// The absolute mouse position
				pos.top +

				// Only for relative positioned nodes: Relative offset from element to offset parent
				this.offset.relative.top * mod +

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.top * mod - (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : scrollIsRootNode ? 0 : scroll.scrollTop()) * mod,
				left:

				// The absolute mouse position
				pos.left +

				// Only for relative positioned nodes: Relative offset from element to offset parent
				this.offset.relative.left * mod +

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.left * mod - (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft()) * mod
			};
		},

		_generatePosition: function _generatePosition(event) {

			var top,
			    left,
			    o = this.options,
			    pageX = event.pageX,
			    pageY = event.pageY,
			    scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
			    scrollIsRootNode = /(html|body)/i.test(scroll[0].tagName);

			// This is another very weird special case that only happens for relative elements:
			// 1. If the css position is relative
			// 2. and the scroll parent is the document or similar to the offset parent
			// we have to refresh the relative offset during the scroll so there are no jumps
			if (this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
				this.offset.relative = this._getRelativeOffset();
			}

			/*
    * - Position constraining -
    * Constrain the position to a mix of grid, containment.
    */

			if (this.originalPosition) {
				//If we are not dragging yet, we won't check for options

				if (this.containment) {
					if (event.pageX - this.offset.click.left < this.containment[0]) {
						pageX = this.containment[0] + this.offset.click.left;
					}
					if (event.pageY - this.offset.click.top < this.containment[1]) {
						pageY = this.containment[1] + this.offset.click.top;
					}
					if (event.pageX - this.offset.click.left > this.containment[2]) {
						pageX = this.containment[2] + this.offset.click.left;
					}
					if (event.pageY - this.offset.click.top > this.containment[3]) {
						pageY = this.containment[3] + this.offset.click.top;
					}
				}

				if (o.grid) {
					top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
					pageY = this.containment ? top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3] ? top : top - this.offset.click.top >= this.containment[1] ? top - o.grid[1] : top + o.grid[1] : top;

					left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
					pageX = this.containment ? left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2] ? left : left - this.offset.click.left >= this.containment[0] ? left - o.grid[0] : left + o.grid[0] : left;
				}
			}

			return {
				top:

				// The absolute mouse position
				pageY -

				// Click offset (relative to the element)
				this.offset.click.top -

				// Only for relative positioned nodes: Relative offset from element to offset parent
				this.offset.relative.top -

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.top + (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : scrollIsRootNode ? 0 : scroll.scrollTop()),
				left:

				// The absolute mouse position
				pageX -

				// Click offset (relative to the element)
				this.offset.click.left -

				// Only for relative positioned nodes: Relative offset from element to offset parent
				this.offset.relative.left -

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.left + (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft())
			};
		},

		_rearrange: function _rearrange(event, i, a, hardRefresh) {

			a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], this.direction === "down" ? i.item[0] : i.item[0].nextSibling);

			//Various things done here to improve the performance:
			// 1. we create a setTimeout, that calls refreshPositions
			// 2. on the instance, we have a counter variable, that get's higher after every append
			// 3. on the local scope, we copy the counter variable, and check in the timeout,
			// if it's still the same
			// 4. this lets only the last addition to the timeout stack through
			this.counter = this.counter ? ++this.counter : 1;
			var counter = this.counter;

			this._delay(function () {
				if (counter === this.counter) {

					//Precompute after each DOM insertion, NOT on mousemove
					this.refreshPositions(!hardRefresh);
				}
			});
		},

		_clear: function _clear(event, noPropagation) {

			this.reverting = false;

			// We delay all events that have to be triggered to after the point where the placeholder
			// has been removed and everything else normalized again
			var i,
			    delayedTriggers = [];

			// We first have to update the dom position of the actual currentItem
			// Note: don't do it if the current item is already removed (by a user), or it gets
			// reappended (see #4088)
			if (!this._noFinalSort && this.currentItem.parent().length) {
				this.placeholder.before(this.currentItem);
			}
			this._noFinalSort = null;

			if (this.helper[0] === this.currentItem[0]) {
				for (i in this._storedCSS) {
					if (this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
						this._storedCSS[i] = "";
					}
				}
				this.currentItem.css(this._storedCSS);
				this._removeClass(this.currentItem, "ui-sortable-helper");
			} else {
				this.currentItem.show();
			}

			if (this.fromOutside && !noPropagation) {
				delayedTriggers.push(function (event) {
					this._trigger("receive", event, this._uiHash(this.fromOutside));
				});
			}
			if ((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {

				// Trigger update callback if the DOM position has changed
				delayedTriggers.push(function (event) {
					this._trigger("update", event, this._uiHash());
				});
			}

			// Check if the items Container has Changed and trigger appropriate
			// events.
			if (this !== this.currentContainer) {
				if (!noPropagation) {
					delayedTriggers.push(function (event) {
						this._trigger("remove", event, this._uiHash());
					});
					delayedTriggers.push(function (c) {
						return function (event) {
							c._trigger("receive", event, this._uiHash(this));
						};
					}.call(this, this.currentContainer));
					delayedTriggers.push(function (c) {
						return function (event) {
							c._trigger("update", event, this._uiHash(this));
						};
					}.call(this, this.currentContainer));
				}
			}

			//Post events to containers
			function delayEvent(type, instance, container) {
				return function (event) {
					container._trigger(type, event, instance._uiHash(instance));
				};
			}
			for (i = this.containers.length - 1; i >= 0; i--) {
				if (!noPropagation) {
					delayedTriggers.push(delayEvent("deactivate", this, this.containers[i]));
				}
				if (this.containers[i].containerCache.over) {
					delayedTriggers.push(delayEvent("out", this, this.containers[i]));
					this.containers[i].containerCache.over = 0;
				}
			}

			//Do what was originally in plugins
			if (this.storedCursor) {
				this.document.find("body").css("cursor", this.storedCursor);
				this.storedStylesheet.remove();
			}
			if (this._storedOpacity) {
				this.helper.css("opacity", this._storedOpacity);
			}
			if (this._storedZIndex) {
				this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
			}

			this.dragging = false;

			if (!noPropagation) {
				this._trigger("beforeStop", event, this._uiHash());
			}

			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
			// it unbinds ALL events from the original node!
			this.placeholder[0].parentNode.removeChild(this.placeholder[0]);

			if (!this.cancelHelperRemoval) {
				if (this.helper[0] !== this.currentItem[0]) {
					this.helper.remove();
				}
				this.helper = null;
			}

			if (!noPropagation) {
				for (i = 0; i < delayedTriggers.length; i++) {

					// Trigger all delayed events
					delayedTriggers[i].call(this, event);
				}
				this._trigger("stop", event, this._uiHash());
			}

			this.fromOutside = false;
			return !this.cancelHelperRemoval;
		},

		_trigger: function _trigger() {
			if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
				this.cancel();
			}
		},

		_uiHash: function _uiHash(_inst) {
			var inst = _inst || this;
			return {
				helper: inst.helper,
				placeholder: inst.placeholder || $([]),
				position: inst.position,
				originalPosition: inst.originalPosition,
				offset: inst.positionAbs,
				item: inst.currentItem,
				sender: _inst ? _inst.element : null
			};
		}

	});

	/*!
  * jQuery UI Spinner 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Spinner
	//>>group: Widgets
	//>>description: Displays buttons to easily input numbers via the keyboard or mouse.
	//>>docs: http://api.jqueryui.com/spinner/
	//>>demos: http://jqueryui.com/spinner/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/spinner.css
	//>>css.theme: ../../themes/base/theme.css


	function spinnerModifer(fn) {
		return function () {
			var previous = this.element.val();
			fn.apply(this, arguments);
			this._refresh();
			if (previous !== this.element.val()) {
				this._trigger("change");
			}
		};
	}

	$.widget("ui.spinner", {
		version: "1.12.1",
		defaultElement: "<input>",
		widgetEventPrefix: "spin",
		options: {
			classes: {
				"ui-spinner": "ui-corner-all",
				"ui-spinner-down": "ui-corner-br",
				"ui-spinner-up": "ui-corner-tr"
			},
			culture: null,
			icons: {
				down: "ui-icon-triangle-1-s",
				up: "ui-icon-triangle-1-n"
			},
			incremental: true,
			max: null,
			min: null,
			numberFormat: null,
			page: 10,
			step: 1,

			change: null,
			spin: null,
			start: null,
			stop: null
		},

		_create: function _create() {

			// handle string values that need to be parsed
			this._setOption("max", this.options.max);
			this._setOption("min", this.options.min);
			this._setOption("step", this.options.step);

			// Only format if there is a value, prevents the field from being marked
			// as invalid in Firefox, see #9573.
			if (this.value() !== "") {

				// Format the value, but don't constrain.
				this._value(this.element.val(), true);
			}

			this._draw();
			this._on(this._events);
			this._refresh();

			// Turning off autocomplete prevents the browser from remembering the
			// value when navigating through history, so we re-enable autocomplete
			// if the page is unloaded before the widget is destroyed. #7790
			this._on(this.window, {
				beforeunload: function beforeunload() {
					this.element.removeAttr("autocomplete");
				}
			});
		},

		_getCreateOptions: function _getCreateOptions() {
			var options = this._super();
			var element = this.element;

			$.each(["min", "max", "step"], function (i, option) {
				var value = element.attr(option);
				if (value != null && value.length) {
					options[option] = value;
				}
			});

			return options;
		},

		_events: {
			keydown: function keydown(event) {
				if (this._start(event) && this._keydown(event)) {
					event.preventDefault();
				}
			},
			keyup: "_stop",
			focus: function focus() {
				this.previous = this.element.val();
			},
			blur: function blur(event) {
				if (this.cancelBlur) {
					delete this.cancelBlur;
					return;
				}

				this._stop();
				this._refresh();
				if (this.previous !== this.element.val()) {
					this._trigger("change", event);
				}
			},
			mousewheel: function mousewheel(event, delta) {
				if (!delta) {
					return;
				}
				if (!this.spinning && !this._start(event)) {
					return false;
				}

				this._spin((delta > 0 ? 1 : -1) * this.options.step, event);
				clearTimeout(this.mousewheelTimer);
				this.mousewheelTimer = this._delay(function () {
					if (this.spinning) {
						this._stop(event);
					}
				}, 100);
				event.preventDefault();
			},
			"mousedown .ui-spinner-button": function mousedownUiSpinnerButton(event) {
				var previous;

				// We never want the buttons to have focus; whenever the user is
				// interacting with the spinner, the focus should be on the input.
				// If the input is focused then this.previous is properly set from
				// when the input first received focus. If the input is not focused
				// then we need to set this.previous based on the value before spinning.
				previous = this.element[0] === $.ui.safeActiveElement(this.document[0]) ? this.previous : this.element.val();
				function checkFocus() {
					var isActive = this.element[0] === $.ui.safeActiveElement(this.document[0]);
					if (!isActive) {
						this.element.trigger("focus");
						this.previous = previous;

						// support: IE
						// IE sets focus asynchronously, so we need to check if focus
						// moved off of the input because the user clicked on the button.
						this._delay(function () {
							this.previous = previous;
						});
					}
				}

				// Ensure focus is on (or stays on) the text field
				event.preventDefault();
				checkFocus.call(this);

				// Support: IE
				// IE doesn't prevent moving focus even with event.preventDefault()
				// so we set a flag to know when we should ignore the blur event
				// and check (again) if focus moved off of the input.
				this.cancelBlur = true;
				this._delay(function () {
					delete this.cancelBlur;
					checkFocus.call(this);
				});

				if (this._start(event) === false) {
					return;
				}

				this._repeat(null, $(event.currentTarget).hasClass("ui-spinner-up") ? 1 : -1, event);
			},
			"mouseup .ui-spinner-button": "_stop",
			"mouseenter .ui-spinner-button": function mouseenterUiSpinnerButton(event) {

				// button will add ui-state-active if mouse was down while mouseleave and kept down
				if (!$(event.currentTarget).hasClass("ui-state-active")) {
					return;
				}

				if (this._start(event) === false) {
					return false;
				}
				this._repeat(null, $(event.currentTarget).hasClass("ui-spinner-up") ? 1 : -1, event);
			},

			// TODO: do we really want to consider this a stop?
			// shouldn't we just stop the repeater and wait until mouseup before
			// we trigger the stop event?
			"mouseleave .ui-spinner-button": "_stop"
		},

		// Support mobile enhanced option and make backcompat more sane
		_enhance: function _enhance() {
			this.uiSpinner = this.element.attr("autocomplete", "off").wrap("<span>").parent()

			// Add buttons
			.append("<a></a><a></a>");
		},

		_draw: function _draw() {
			this._enhance();

			this._addClass(this.uiSpinner, "ui-spinner", "ui-widget ui-widget-content");
			this._addClass("ui-spinner-input");

			this.element.attr("role", "spinbutton");

			// Button bindings
			this.buttons = this.uiSpinner.children("a").attr("tabIndex", -1).attr("aria-hidden", true).button({
				classes: {
					"ui-button": ""
				}
			});

			// TODO: Right now button does not support classes this is already updated in button PR
			this._removeClass(this.buttons, "ui-corner-all");

			this._addClass(this.buttons.first(), "ui-spinner-button ui-spinner-up");
			this._addClass(this.buttons.last(), "ui-spinner-button ui-spinner-down");
			this.buttons.first().button({
				"icon": this.options.icons.up,
				"showLabel": false
			});
			this.buttons.last().button({
				"icon": this.options.icons.down,
				"showLabel": false
			});

			// IE 6 doesn't understand height: 50% for the buttons
			// unless the wrapper has an explicit height
			if (this.buttons.height() > Math.ceil(this.uiSpinner.height() * 0.5) && this.uiSpinner.height() > 0) {
				this.uiSpinner.height(this.uiSpinner.height());
			}
		},

		_keydown: function _keydown(event) {
			var options = this.options,
			    keyCode = $.ui.keyCode;

			switch (event.keyCode) {
				case keyCode.UP:
					this._repeat(null, 1, event);
					return true;
				case keyCode.DOWN:
					this._repeat(null, -1, event);
					return true;
				case keyCode.PAGE_UP:
					this._repeat(null, options.page, event);
					return true;
				case keyCode.PAGE_DOWN:
					this._repeat(null, -options.page, event);
					return true;
			}

			return false;
		},

		_start: function _start(event) {
			if (!this.spinning && this._trigger("start", event) === false) {
				return false;
			}

			if (!this.counter) {
				this.counter = 1;
			}
			this.spinning = true;
			return true;
		},

		_repeat: function _repeat(i, steps, event) {
			i = i || 500;

			clearTimeout(this.timer);
			this.timer = this._delay(function () {
				this._repeat(40, steps, event);
			}, i);

			this._spin(steps * this.options.step, event);
		},

		_spin: function _spin(step, event) {
			var value = this.value() || 0;

			if (!this.counter) {
				this.counter = 1;
			}

			value = this._adjustValue(value + step * this._increment(this.counter));

			if (!this.spinning || this._trigger("spin", event, { value: value }) !== false) {
				this._value(value);
				this.counter++;
			}
		},

		_increment: function _increment(i) {
			var incremental = this.options.incremental;

			if (incremental) {
				return $.isFunction(incremental) ? incremental(i) : Math.floor(i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1);
			}

			return 1;
		},

		_precision: function _precision() {
			var precision = this._precisionOf(this.options.step);
			if (this.options.min !== null) {
				precision = Math.max(precision, this._precisionOf(this.options.min));
			}
			return precision;
		},

		_precisionOf: function _precisionOf(num) {
			var str = num.toString(),
			    decimal = str.indexOf(".");
			return decimal === -1 ? 0 : str.length - decimal - 1;
		},

		_adjustValue: function _adjustValue(value) {
			var base,
			    aboveMin,
			    options = this.options;

			// Make sure we're at a valid step
			// - find out where we are relative to the base (min or 0)
			base = options.min !== null ? options.min : 0;
			aboveMin = value - base;

			// - round to the nearest step
			aboveMin = Math.round(aboveMin / options.step) * options.step;

			// - rounding is based on 0, so adjust back to our base
			value = base + aboveMin;

			// Fix precision from bad JS floating point math
			value = parseFloat(value.toFixed(this._precision()));

			// Clamp the value
			if (options.max !== null && value > options.max) {
				return options.max;
			}
			if (options.min !== null && value < options.min) {
				return options.min;
			}

			return value;
		},

		_stop: function _stop(event) {
			if (!this.spinning) {
				return;
			}

			clearTimeout(this.timer);
			clearTimeout(this.mousewheelTimer);
			this.counter = 0;
			this.spinning = false;
			this._trigger("stop", event);
		},

		_setOption: function _setOption(key, value) {
			var prevValue, first, last;

			if (key === "culture" || key === "numberFormat") {
				prevValue = this._parse(this.element.val());
				this.options[key] = value;
				this.element.val(this._format(prevValue));
				return;
			}

			if (key === "max" || key === "min" || key === "step") {
				if (typeof value === "string") {
					value = this._parse(value);
				}
			}
			if (key === "icons") {
				first = this.buttons.first().find(".ui-icon");
				this._removeClass(first, null, this.options.icons.up);
				this._addClass(first, null, value.up);
				last = this.buttons.last().find(".ui-icon");
				this._removeClass(last, null, this.options.icons.down);
				this._addClass(last, null, value.down);
			}

			this._super(key, value);
		},

		_setOptionDisabled: function _setOptionDisabled(value) {
			this._super(value);

			this._toggleClass(this.uiSpinner, null, "ui-state-disabled", !!value);
			this.element.prop("disabled", !!value);
			this.buttons.button(value ? "disable" : "enable");
		},

		_setOptions: spinnerModifer(function (options) {
			this._super(options);
		}),

		_parse: function _parse(val) {
			if (typeof val === "string" && val !== "") {
				val = window.Globalize && this.options.numberFormat ? Globalize.parseFloat(val, 10, this.options.culture) : +val;
			}
			return val === "" || isNaN(val) ? null : val;
		},

		_format: function _format(value) {
			if (value === "") {
				return "";
			}
			return window.Globalize && this.options.numberFormat ? Globalize.format(value, this.options.numberFormat, this.options.culture) : value;
		},

		_refresh: function _refresh() {
			this.element.attr({
				"aria-valuemin": this.options.min,
				"aria-valuemax": this.options.max,

				// TODO: what should we do with values that can't be parsed?
				"aria-valuenow": this._parse(this.element.val())
			});
		},

		isValid: function isValid() {
			var value = this.value();

			// Null is invalid
			if (value === null) {
				return false;
			}

			// If value gets adjusted, it's invalid
			return value === this._adjustValue(value);
		},

		// Update the value without triggering change
		_value: function _value(value, allowAny) {
			var parsed;
			if (value !== "") {
				parsed = this._parse(value);
				if (parsed !== null) {
					if (!allowAny) {
						parsed = this._adjustValue(parsed);
					}
					value = this._format(parsed);
				}
			}
			this.element.val(value);
			this._refresh();
		},

		_destroy: function _destroy() {
			this.element.prop("disabled", false).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow");

			this.uiSpinner.replaceWith(this.element);
		},

		stepUp: spinnerModifer(function (steps) {
			this._stepUp(steps);
		}),
		_stepUp: function _stepUp(steps) {
			if (this._start()) {
				this._spin((steps || 1) * this.options.step);
				this._stop();
			}
		},

		stepDown: spinnerModifer(function (steps) {
			this._stepDown(steps);
		}),
		_stepDown: function _stepDown(steps) {
			if (this._start()) {
				this._spin((steps || 1) * -this.options.step);
				this._stop();
			}
		},

		pageUp: spinnerModifer(function (pages) {
			this._stepUp((pages || 1) * this.options.page);
		}),

		pageDown: spinnerModifer(function (pages) {
			this._stepDown((pages || 1) * this.options.page);
		}),

		value: function value(newVal) {
			if (!arguments.length) {
				return this._parse(this.element.val());
			}
			spinnerModifer(this._value).call(this, newVal);
		},

		widget: function widget() {
			return this.uiSpinner;
		}
	});

	// DEPRECATED
	// TODO: switch return back to widget declaration at top of file when this is removed
	if ($.uiBackCompat !== false) {

		// Backcompat for spinner html extension points
		$.widget("ui.spinner", $.ui.spinner, {
			_enhance: function _enhance() {
				this.uiSpinner = this.element.attr("autocomplete", "off").wrap(this._uiSpinnerHtml()).parent()

				// Add buttons
				.append(this._buttonHtml());
			},
			_uiSpinnerHtml: function _uiSpinnerHtml() {
				return "<span>";
			},

			_buttonHtml: function _buttonHtml() {
				return "<a></a><a></a>";
			}
		});
	}

	var widgetsSpinner = $.ui.spinner;

	/*!
  * jQuery UI Tabs 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Tabs
	//>>group: Widgets
	//>>description: Transforms a set of container elements into a tab structure.
	//>>docs: http://api.jqueryui.com/tabs/
	//>>demos: http://jqueryui.com/tabs/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/tabs.css
	//>>css.theme: ../../themes/base/theme.css


	$.widget("ui.tabs", {
		version: "1.12.1",
		delay: 300,
		options: {
			active: null,
			classes: {
				"ui-tabs": "ui-corner-all",
				"ui-tabs-nav": "ui-corner-all",
				"ui-tabs-panel": "ui-corner-bottom",
				"ui-tabs-tab": "ui-corner-top"
			},
			collapsible: false,
			event: "click",
			heightStyle: "content",
			hide: null,
			show: null,

			// Callbacks
			activate: null,
			beforeActivate: null,
			beforeLoad: null,
			load: null
		},

		_isLocal: function () {
			var rhash = /#.*$/;

			return function (anchor) {
				var anchorUrl, locationUrl;

				anchorUrl = anchor.href.replace(rhash, "");
				locationUrl = location.href.replace(rhash, "");

				// Decoding may throw an error if the URL isn't UTF-8 (#9518)
				try {
					anchorUrl = decodeURIComponent(anchorUrl);
				} catch (error) {}
				try {
					locationUrl = decodeURIComponent(locationUrl);
				} catch (error) {}

				return anchor.hash.length > 1 && anchorUrl === locationUrl;
			};
		}(),

		_create: function _create() {
			var that = this,
			    options = this.options;

			this.running = false;

			this._addClass("ui-tabs", "ui-widget ui-widget-content");
			this._toggleClass("ui-tabs-collapsible", null, options.collapsible);

			this._processTabs();
			options.active = this._initialActive();

			// Take disabling tabs via class attribute from HTML
			// into account and update option properly.
			if ($.isArray(options.disabled)) {
				options.disabled = $.unique(options.disabled.concat($.map(this.tabs.filter(".ui-state-disabled"), function (li) {
					return that.tabs.index(li);
				}))).sort();
			}

			// Check for length avoids error when initializing empty list
			if (this.options.active !== false && this.anchors.length) {
				this.active = this._findActive(options.active);
			} else {
				this.active = $();
			}

			this._refresh();

			if (this.active.length) {
				this.load(options.active);
			}
		},

		_initialActive: function _initialActive() {
			var active = this.options.active,
			    collapsible = this.options.collapsible,
			    locationHash = location.hash.substring(1);

			if (active === null) {

				// check the fragment identifier in the URL
				if (locationHash) {
					this.tabs.each(function (i, tab) {
						if ($(tab).attr("aria-controls") === locationHash) {
							active = i;
							return false;
						}
					});
				}

				// Check for a tab marked active via a class
				if (active === null) {
					active = this.tabs.index(this.tabs.filter(".ui-tabs-active"));
				}

				// No active tab, set to false
				if (active === null || active === -1) {
					active = this.tabs.length ? 0 : false;
				}
			}

			// Handle numbers: negative, out of range
			if (active !== false) {
				active = this.tabs.index(this.tabs.eq(active));
				if (active === -1) {
					active = collapsible ? false : 0;
				}
			}

			// Don't allow collapsible: false and active: false
			if (!collapsible && active === false && this.anchors.length) {
				active = 0;
			}

			return active;
		},

		_getCreateEventData: function _getCreateEventData() {
			return {
				tab: this.active,
				panel: !this.active.length ? $() : this._getPanelForTab(this.active)
			};
		},

		_tabKeydown: function _tabKeydown(event) {
			var focusedTab = $($.ui.safeActiveElement(this.document[0])).closest("li"),
			    selectedIndex = this.tabs.index(focusedTab),
			    goingForward = true;

			if (this._handlePageNav(event)) {
				return;
			}

			switch (event.keyCode) {
				case $.ui.keyCode.RIGHT:
				case $.ui.keyCode.DOWN:
					selectedIndex++;
					break;
				case $.ui.keyCode.UP:
				case $.ui.keyCode.LEFT:
					goingForward = false;
					selectedIndex--;
					break;
				case $.ui.keyCode.END:
					selectedIndex = this.anchors.length - 1;
					break;
				case $.ui.keyCode.HOME:
					selectedIndex = 0;
					break;
				case $.ui.keyCode.SPACE:

					// Activate only, no collapsing
					event.preventDefault();
					clearTimeout(this.activating);
					this._activate(selectedIndex);
					return;
				case $.ui.keyCode.ENTER:

					// Toggle (cancel delayed activation, allow collapsing)
					event.preventDefault();
					clearTimeout(this.activating);

					// Determine if we should collapse or activate
					this._activate(selectedIndex === this.options.active ? false : selectedIndex);
					return;
				default:
					return;
			}

			// Focus the appropriate tab, based on which key was pressed
			event.preventDefault();
			clearTimeout(this.activating);
			selectedIndex = this._focusNextTab(selectedIndex, goingForward);

			// Navigating with control/command key will prevent automatic activation
			if (!event.ctrlKey && !event.metaKey) {

				// Update aria-selected immediately so that AT think the tab is already selected.
				// Otherwise AT may confuse the user by stating that they need to activate the tab,
				// but the tab will already be activated by the time the announcement finishes.
				focusedTab.attr("aria-selected", "false");
				this.tabs.eq(selectedIndex).attr("aria-selected", "true");

				this.activating = this._delay(function () {
					this.option("active", selectedIndex);
				}, this.delay);
			}
		},

		_panelKeydown: function _panelKeydown(event) {
			if (this._handlePageNav(event)) {
				return;
			}

			// Ctrl+up moves focus to the current tab
			if (event.ctrlKey && event.keyCode === $.ui.keyCode.UP) {
				event.preventDefault();
				this.active.trigger("focus");
			}
		},

		// Alt+page up/down moves focus to the previous/next tab (and activates)
		_handlePageNav: function _handlePageNav(event) {
			if (event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP) {
				this._activate(this._focusNextTab(this.options.active - 1, false));
				return true;
			}
			if (event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN) {
				this._activate(this._focusNextTab(this.options.active + 1, true));
				return true;
			}
		},

		_findNextTab: function _findNextTab(index, goingForward) {
			var lastTabIndex = this.tabs.length - 1;

			function constrain() {
				if (index > lastTabIndex) {
					index = 0;
				}
				if (index < 0) {
					index = lastTabIndex;
				}
				return index;
			}

			while ($.inArray(constrain(), this.options.disabled) !== -1) {
				index = goingForward ? index + 1 : index - 1;
			}

			return index;
		},

		_focusNextTab: function _focusNextTab(index, goingForward) {
			index = this._findNextTab(index, goingForward);
			this.tabs.eq(index).trigger("focus");
			return index;
		},

		_setOption: function _setOption(key, value) {
			if (key === "active") {

				// _activate() will handle invalid values and update this.options
				this._activate(value);
				return;
			}

			this._super(key, value);

			if (key === "collapsible") {
				this._toggleClass("ui-tabs-collapsible", null, value);

				// Setting collapsible: false while collapsed; open first panel
				if (!value && this.options.active === false) {
					this._activate(0);
				}
			}

			if (key === "event") {
				this._setupEvents(value);
			}

			if (key === "heightStyle") {
				this._setupHeightStyle(value);
			}
		},

		_sanitizeSelector: function _sanitizeSelector(hash) {
			return hash ? hash.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&") : "";
		},

		refresh: function refresh() {
			var options = this.options,
			    lis = this.tablist.children(":has(a[href])");

			// Get disabled tabs from class attribute from HTML
			// this will get converted to a boolean if needed in _refresh()
			options.disabled = $.map(lis.filter(".ui-state-disabled"), function (tab) {
				return lis.index(tab);
			});

			this._processTabs();

			// Was collapsed or no tabs
			if (options.active === false || !this.anchors.length) {
				options.active = false;
				this.active = $();

				// was active, but active tab is gone
			} else if (this.active.length && !$.contains(this.tablist[0], this.active[0])) {

				// all remaining tabs are disabled
				if (this.tabs.length === options.disabled.length) {
					options.active = false;
					this.active = $();

					// activate previous tab
				} else {
					this._activate(this._findNextTab(Math.max(0, options.active - 1), false));
				}

				// was active, active tab still exists
			} else {

				// make sure active index is correct
				options.active = this.tabs.index(this.active);
			}

			this._refresh();
		},

		_refresh: function _refresh() {
			this._setOptionDisabled(this.options.disabled);
			this._setupEvents(this.options.event);
			this._setupHeightStyle(this.options.heightStyle);

			this.tabs.not(this.active).attr({
				"aria-selected": "false",
				"aria-expanded": "false",
				tabIndex: -1
			});
			this.panels.not(this._getPanelForTab(this.active)).hide().attr({
				"aria-hidden": "true"
			});

			// Make sure one tab is in the tab order
			if (!this.active.length) {
				this.tabs.eq(0).attr("tabIndex", 0);
			} else {
				this.active.attr({
					"aria-selected": "true",
					"aria-expanded": "true",
					tabIndex: 0
				});
				this._addClass(this.active, "ui-tabs-active", "ui-state-active");
				this._getPanelForTab(this.active).show().attr({
					"aria-hidden": "false"
				});
			}
		},

		_processTabs: function _processTabs() {
			var that = this,
			    prevTabs = this.tabs,
			    prevAnchors = this.anchors,
			    prevPanels = this.panels;

			this.tablist = this._getList().attr("role", "tablist");
			this._addClass(this.tablist, "ui-tabs-nav", "ui-helper-reset ui-helper-clearfix ui-widget-header");

			// Prevent users from focusing disabled tabs via click
			this.tablist.on("mousedown" + this.eventNamespace, "> li", function (event) {
				if ($(this).is(".ui-state-disabled")) {
					event.preventDefault();
				}
			})

			// Support: IE <9
			// Preventing the default action in mousedown doesn't prevent IE
			// from focusing the element, so if the anchor gets focused, blur.
			// We don't have to worry about focusing the previously focused
			// element since clicking on a non-focusable element should focus
			// the body anyway.
			.on("focus" + this.eventNamespace, ".ui-tabs-anchor", function () {
				if ($(this).closest("li").is(".ui-state-disabled")) {
					this.blur();
				}
			});

			this.tabs = this.tablist.find("> li:has(a[href])").attr({
				role: "tab",
				tabIndex: -1
			});
			this._addClass(this.tabs, "ui-tabs-tab", "ui-state-default");

			this.anchors = this.tabs.map(function () {
				return $("a", this)[0];
			}).attr({
				role: "presentation",
				tabIndex: -1
			});
			this._addClass(this.anchors, "ui-tabs-anchor");

			this.panels = $();

			this.anchors.each(function (i, anchor) {
				var selector,
				    panel,
				    panelId,
				    anchorId = $(anchor).uniqueId().attr("id"),
				    tab = $(anchor).closest("li"),
				    originalAriaControls = tab.attr("aria-controls");

				// Inline tab
				if (that._isLocal(anchor)) {
					selector = anchor.hash;
					panelId = selector.substring(1);
					panel = that.element.find(that._sanitizeSelector(selector));

					// remote tab
				} else {

					// If the tab doesn't already have aria-controls,
					// generate an id by using a throw-away element
					panelId = tab.attr("aria-controls") || $({}).uniqueId()[0].id;
					selector = "#" + panelId;
					panel = that.element.find(selector);
					if (!panel.length) {
						panel = that._createPanel(panelId);
						panel.insertAfter(that.panels[i - 1] || that.tablist);
					}
					panel.attr("aria-live", "polite");
				}

				if (panel.length) {
					that.panels = that.panels.add(panel);
				}
				if (originalAriaControls) {
					tab.data("ui-tabs-aria-controls", originalAriaControls);
				}
				tab.attr({
					"aria-controls": panelId,
					"aria-labelledby": anchorId
				});
				panel.attr("aria-labelledby", anchorId);
			});

			this.panels.attr("role", "tabpanel");
			this._addClass(this.panels, "ui-tabs-panel", "ui-widget-content");

			// Avoid memory leaks (#10056)
			if (prevTabs) {
				this._off(prevTabs.not(this.tabs));
				this._off(prevAnchors.not(this.anchors));
				this._off(prevPanels.not(this.panels));
			}
		},

		// Allow overriding how to find the list for rare usage scenarios (#7715)
		_getList: function _getList() {
			return this.tablist || this.element.find("ol, ul").eq(0);
		},

		_createPanel: function _createPanel(id) {
			return $("<div>").attr("id", id).data("ui-tabs-destroy", true);
		},

		_setOptionDisabled: function _setOptionDisabled(disabled) {
			var currentItem, li, i;

			if ($.isArray(disabled)) {
				if (!disabled.length) {
					disabled = false;
				} else if (disabled.length === this.anchors.length) {
					disabled = true;
				}
			}

			// Disable tabs
			for (i = 0; li = this.tabs[i]; i++) {
				currentItem = $(li);
				if (disabled === true || $.inArray(i, disabled) !== -1) {
					currentItem.attr("aria-disabled", "true");
					this._addClass(currentItem, null, "ui-state-disabled");
				} else {
					currentItem.removeAttr("aria-disabled");
					this._removeClass(currentItem, null, "ui-state-disabled");
				}
			}

			this.options.disabled = disabled;

			this._toggleClass(this.widget(), this.widgetFullName + "-disabled", null, disabled === true);
		},

		_setupEvents: function _setupEvents(event) {
			var events = {};
			if (event) {
				$.each(event.split(" "), function (index, eventName) {
					events[eventName] = "_eventHandler";
				});
			}

			this._off(this.anchors.add(this.tabs).add(this.panels));

			// Always prevent the default action, even when disabled
			this._on(true, this.anchors, {
				click: function click(event) {
					event.preventDefault();
				}
			});
			this._on(this.anchors, events);
			this._on(this.tabs, { keydown: "_tabKeydown" });
			this._on(this.panels, { keydown: "_panelKeydown" });

			this._focusable(this.tabs);
			this._hoverable(this.tabs);
		},

		_setupHeightStyle: function _setupHeightStyle(heightStyle) {
			var maxHeight,
			    parent = this.element.parent();

			if (heightStyle === "fill") {
				maxHeight = parent.height();
				maxHeight -= this.element.outerHeight() - this.element.height();

				this.element.siblings(":visible").each(function () {
					var elem = $(this),
					    position = elem.css("position");

					if (position === "absolute" || position === "fixed") {
						return;
					}
					maxHeight -= elem.outerHeight(true);
				});

				this.element.children().not(this.panels).each(function () {
					maxHeight -= $(this).outerHeight(true);
				});

				this.panels.each(function () {
					$(this).height(Math.max(0, maxHeight - $(this).innerHeight() + $(this).height()));
				}).css("overflow", "auto");
			} else if (heightStyle === "auto") {
				maxHeight = 0;
				this.panels.each(function () {
					maxHeight = Math.max(maxHeight, $(this).height("").height());
				}).height(maxHeight);
			}
		},

		_eventHandler: function _eventHandler(event) {
			var options = this.options,
			    active = this.active,
			    anchor = $(event.currentTarget),
			    tab = anchor.closest("li"),
			    clickedIsActive = tab[0] === active[0],
			    collapsing = clickedIsActive && options.collapsible,
			    toShow = collapsing ? $() : this._getPanelForTab(tab),
			    toHide = !active.length ? $() : this._getPanelForTab(active),
			    eventData = {
				oldTab: active,
				oldPanel: toHide,
				newTab: collapsing ? $() : tab,
				newPanel: toShow
			};

			event.preventDefault();

			if (tab.hasClass("ui-state-disabled") ||

			// tab is already loading
			tab.hasClass("ui-tabs-loading") ||

			// can't switch durning an animation
			this.running ||

			// click on active header, but not collapsible
			clickedIsActive && !options.collapsible ||

			// allow canceling activation
			this._trigger("beforeActivate", event, eventData) === false) {
				return;
			}

			options.active = collapsing ? false : this.tabs.index(tab);

			this.active = clickedIsActive ? $() : tab;
			if (this.xhr) {
				this.xhr.abort();
			}

			if (!toHide.length && !toShow.length) {
				$.error("jQuery UI Tabs: Mismatching fragment identifier.");
			}

			if (toShow.length) {
				this.load(this.tabs.index(tab), event);
			}
			this._toggle(event, eventData);
		},

		// Handles show/hide for selecting tabs
		_toggle: function _toggle(event, eventData) {
			var that = this,
			    toShow = eventData.newPanel,
			    toHide = eventData.oldPanel;

			this.running = true;

			function complete() {
				that.running = false;
				that._trigger("activate", event, eventData);
			}

			function show() {
				that._addClass(eventData.newTab.closest("li"), "ui-tabs-active", "ui-state-active");

				if (toShow.length && that.options.show) {
					that._show(toShow, that.options.show, complete);
				} else {
					toShow.show();
					complete();
				}
			}

			// Start out by hiding, then showing, then completing
			if (toHide.length && this.options.hide) {
				this._hide(toHide, this.options.hide, function () {
					that._removeClass(eventData.oldTab.closest("li"), "ui-tabs-active", "ui-state-active");
					show();
				});
			} else {
				this._removeClass(eventData.oldTab.closest("li"), "ui-tabs-active", "ui-state-active");
				toHide.hide();
				show();
			}

			toHide.attr("aria-hidden", "true");
			eventData.oldTab.attr({
				"aria-selected": "false",
				"aria-expanded": "false"
			});

			// If we're switching tabs, remove the old tab from the tab order.
			// If we're opening from collapsed state, remove the previous tab from the tab order.
			// If we're collapsing, then keep the collapsing tab in the tab order.
			if (toShow.length && toHide.length) {
				eventData.oldTab.attr("tabIndex", -1);
			} else if (toShow.length) {
				this.tabs.filter(function () {
					return $(this).attr("tabIndex") === 0;
				}).attr("tabIndex", -1);
			}

			toShow.attr("aria-hidden", "false");
			eventData.newTab.attr({
				"aria-selected": "true",
				"aria-expanded": "true",
				tabIndex: 0
			});
		},

		_activate: function _activate(index) {
			var anchor,
			    active = this._findActive(index);

			// Trying to activate the already active panel
			if (active[0] === this.active[0]) {
				return;
			}

			// Trying to collapse, simulate a click on the current active header
			if (!active.length) {
				active = this.active;
			}

			anchor = active.find(".ui-tabs-anchor")[0];
			this._eventHandler({
				target: anchor,
				currentTarget: anchor,
				preventDefault: $.noop
			});
		},

		_findActive: function _findActive(index) {
			return index === false ? $() : this.tabs.eq(index);
		},

		_getIndex: function _getIndex(index) {

			// meta-function to give users option to provide a href string instead of a numerical index.
			if (typeof index === "string") {
				index = this.anchors.index(this.anchors.filter("[href$='" + $.ui.escapeSelector(index) + "']"));
			}

			return index;
		},

		_destroy: function _destroy() {
			if (this.xhr) {
				this.xhr.abort();
			}

			this.tablist.removeAttr("role").off(this.eventNamespace);

			this.anchors.removeAttr("role tabIndex").removeUniqueId();

			this.tabs.add(this.panels).each(function () {
				if ($.data(this, "ui-tabs-destroy")) {
					$(this).remove();
				} else {
					$(this).removeAttr("role tabIndex " + "aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded");
				}
			});

			this.tabs.each(function () {
				var li = $(this),
				    prev = li.data("ui-tabs-aria-controls");
				if (prev) {
					li.attr("aria-controls", prev).removeData("ui-tabs-aria-controls");
				} else {
					li.removeAttr("aria-controls");
				}
			});

			this.panels.show();

			if (this.options.heightStyle !== "content") {
				this.panels.css("height", "");
			}
		},

		enable: function enable(index) {
			var disabled = this.options.disabled;
			if (disabled === false) {
				return;
			}

			if (index === undefined) {
				disabled = false;
			} else {
				index = this._getIndex(index);
				if ($.isArray(disabled)) {
					disabled = $.map(disabled, function (num) {
						return num !== index ? num : null;
					});
				} else {
					disabled = $.map(this.tabs, function (li, num) {
						return num !== index ? num : null;
					});
				}
			}
			this._setOptionDisabled(disabled);
		},

		disable: function disable(index) {
			var disabled = this.options.disabled;
			if (disabled === true) {
				return;
			}

			if (index === undefined) {
				disabled = true;
			} else {
				index = this._getIndex(index);
				if ($.inArray(index, disabled) !== -1) {
					return;
				}
				if ($.isArray(disabled)) {
					disabled = $.merge([index], disabled).sort();
				} else {
					disabled = [index];
				}
			}
			this._setOptionDisabled(disabled);
		},

		load: function load(index, event) {
			index = this._getIndex(index);
			var that = this,
			    tab = this.tabs.eq(index),
			    anchor = tab.find(".ui-tabs-anchor"),
			    panel = this._getPanelForTab(tab),
			    eventData = {
				tab: tab,
				panel: panel
			},
			    complete = function complete(jqXHR, status) {
				if (status === "abort") {
					that.panels.stop(false, true);
				}

				that._removeClass(tab, "ui-tabs-loading");
				panel.removeAttr("aria-busy");

				if (jqXHR === that.xhr) {
					delete that.xhr;
				}
			};

			// Not remote
			if (this._isLocal(anchor[0])) {
				return;
			}

			this.xhr = $.ajax(this._ajaxSettings(anchor, event, eventData));

			// Support: jQuery <1.8
			// jQuery <1.8 returns false if the request is canceled in beforeSend,
			// but as of 1.8, $.ajax() always returns a jqXHR object.
			if (this.xhr && this.xhr.statusText !== "canceled") {
				this._addClass(tab, "ui-tabs-loading");
				panel.attr("aria-busy", "true");

				this.xhr.done(function (response, status, jqXHR) {

					// support: jQuery <1.8
					// http://bugs.jquery.com/ticket/11778
					setTimeout(function () {
						panel.html(response);
						that._trigger("load", event, eventData);

						complete(jqXHR, status);
					}, 1);
				}).fail(function (jqXHR, status) {

					// support: jQuery <1.8
					// http://bugs.jquery.com/ticket/11778
					setTimeout(function () {
						complete(jqXHR, status);
					}, 1);
				});
			}
		},

		_ajaxSettings: function _ajaxSettings(anchor, event, eventData) {
			var that = this;
			return {

				// Support: IE <11 only
				// Strip any hash that exists to prevent errors with the Ajax request
				url: anchor.attr("href").replace(/#.*$/, ""),
				beforeSend: function beforeSend(jqXHR, settings) {
					return that._trigger("beforeLoad", event, $.extend({ jqXHR: jqXHR, ajaxSettings: settings }, eventData));
				}
			};
		},

		_getPanelForTab: function _getPanelForTab(tab) {
			var id = $(tab).attr("aria-controls");
			return this.element.find(this._sanitizeSelector("#" + id));
		}
	});

	// DEPRECATED
	// TODO: Switch return back to widget declaration at top of file when this is removed
	if ($.uiBackCompat !== false) {

		// Backcompat for ui-tab class (now ui-tabs-tab)
		$.widget("ui.tabs", $.ui.tabs, {
			_processTabs: function _processTabs() {
				this._superApply(arguments);
				this._addClass(this.tabs, "ui-tab");
			}
		});
	}

	var widgetsTabs = $.ui.tabs;

	/*!
  * jQuery UI Tooltip 1.12.1
  * http://jqueryui.com
  *
  * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  */

	//>>label: Tooltip
	//>>group: Widgets
	//>>description: Shows additional information for any element on hover or focus.
	//>>docs: http://api.jqueryui.com/tooltip/
	//>>demos: http://jqueryui.com/tooltip/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/tooltip.css
	//>>css.theme: ../../themes/base/theme.css


	$.widget("ui.tooltip", {
		version: "1.12.1",
		options: {
			classes: {
				"ui-tooltip": "ui-corner-all ui-widget-shadow"
			},
			content: function content() {

				// support: IE<9, Opera in jQuery <1.7
				// .text() can't accept undefined, so coerce to a string
				var title = $(this).attr("title") || "";

				// Escape title, since we're going from an attribute to raw HTML
				return $("<a>").text(title).html();
			},
			hide: true,

			// Disabled elements have inconsistent behavior across browsers (#8661)
			items: "[title]:not([disabled])",
			position: {
				my: "left top+15",
				at: "left bottom",
				collision: "flipfit flip"
			},
			show: true,
			track: false,

			// Callbacks
			close: null,
			open: null
		},

		_addDescribedBy: function _addDescribedBy(elem, id) {
			var describedby = (elem.attr("aria-describedby") || "").split(/\s+/);
			describedby.push(id);
			elem.data("ui-tooltip-id", id).attr("aria-describedby", $.trim(describedby.join(" ")));
		},

		_removeDescribedBy: function _removeDescribedBy(elem) {
			var id = elem.data("ui-tooltip-id"),
			    describedby = (elem.attr("aria-describedby") || "").split(/\s+/),
			    index = $.inArray(id, describedby);

			if (index !== -1) {
				describedby.splice(index, 1);
			}

			elem.removeData("ui-tooltip-id");
			describedby = $.trim(describedby.join(" "));
			if (describedby) {
				elem.attr("aria-describedby", describedby);
			} else {
				elem.removeAttr("aria-describedby");
			}
		},

		_create: function _create() {
			this._on({
				mouseover: "open",
				focusin: "open"
			});

			// IDs of generated tooltips, needed for destroy
			this.tooltips = {};

			// IDs of parent tooltips where we removed the title attribute
			this.parents = {};

			// Append the aria-live region so tooltips announce correctly
			this.liveRegion = $("<div>").attr({
				role: "log",
				"aria-live": "assertive",
				"aria-relevant": "additions"
			}).appendTo(this.document[0].body);
			this._addClass(this.liveRegion, null, "ui-helper-hidden-accessible");

			this.disabledTitles = $([]);
		},

		_setOption: function _setOption(key, value) {
			var that = this;

			this._super(key, value);

			if (key === "content") {
				$.each(this.tooltips, function (id, tooltipData) {
					that._updateContent(tooltipData.element);
				});
			}
		},

		_setOptionDisabled: function _setOptionDisabled(value) {
			this[value ? "_disable" : "_enable"]();
		},

		_disable: function _disable() {
			var that = this;

			// Close open tooltips
			$.each(this.tooltips, function (id, tooltipData) {
				var event = $.Event("blur");
				event.target = event.currentTarget = tooltipData.element[0];
				that.close(event, true);
			});

			// Remove title attributes to prevent native tooltips
			this.disabledTitles = this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function () {
				var element = $(this);
				if (element.is("[title]")) {
					return element.data("ui-tooltip-title", element.attr("title")).removeAttr("title");
				}
			}));
		},

		_enable: function _enable() {

			// restore title attributes
			this.disabledTitles.each(function () {
				var element = $(this);
				if (element.data("ui-tooltip-title")) {
					element.attr("title", element.data("ui-tooltip-title"));
				}
			});
			this.disabledTitles = $([]);
		},

		open: function open(event) {
			var that = this,
			    target = $(event ? event.target : this.element)

			// we need closest here due to mouseover bubbling,
			// but always pointing at the same event target
			.closest(this.options.items);

			// No element to show a tooltip for or the tooltip is already open
			if (!target.length || target.data("ui-tooltip-id")) {
				return;
			}

			if (target.attr("title")) {
				target.data("ui-tooltip-title", target.attr("title"));
			}

			target.data("ui-tooltip-open", true);

			// Kill parent tooltips, custom or native, for hover
			if (event && event.type === "mouseover") {
				target.parents().each(function () {
					var parent = $(this),
					    blurEvent;
					if (parent.data("ui-tooltip-open")) {
						blurEvent = $.Event("blur");
						blurEvent.target = blurEvent.currentTarget = this;
						that.close(blurEvent, true);
					}
					if (parent.attr("title")) {
						parent.uniqueId();
						that.parents[this.id] = {
							element: this,
							title: parent.attr("title")
						};
						parent.attr("title", "");
					}
				});
			}

			this._registerCloseHandlers(event, target);
			this._updateContent(target, event);
		},

		_updateContent: function _updateContent(target, event) {
			var content,
			    contentOption = this.options.content,
			    that = this,
			    eventType = event ? event.type : null;

			if (typeof contentOption === "string" || contentOption.nodeType || contentOption.jquery) {
				return this._open(event, target, contentOption);
			}

			content = contentOption.call(target[0], function (response) {

				// IE may instantly serve a cached response for ajax requests
				// delay this call to _open so the other call to _open runs first
				that._delay(function () {

					// Ignore async response if tooltip was closed already
					if (!target.data("ui-tooltip-open")) {
						return;
					}

					// JQuery creates a special event for focusin when it doesn't
					// exist natively. To improve performance, the native event
					// object is reused and the type is changed. Therefore, we can't
					// rely on the type being correct after the event finished
					// bubbling, so we set it back to the previous value. (#8740)
					if (event) {
						event.type = eventType;
					}
					this._open(event, target, response);
				});
			});
			if (content) {
				this._open(event, target, content);
			}
		},

		_open: function _open(event, target, content) {
			var tooltipData,
			    tooltip,
			    delayedShow,
			    a11yContent,
			    positionOption = $.extend({}, this.options.position);

			if (!content) {
				return;
			}

			// Content can be updated multiple times. If the tooltip already
			// exists, then just update the content and bail.
			tooltipData = this._find(target);
			if (tooltipData) {
				tooltipData.tooltip.find(".ui-tooltip-content").html(content);
				return;
			}

			// If we have a title, clear it to prevent the native tooltip
			// we have to check first to avoid defining a title if none exists
			// (we don't want to cause an element to start matching [title])
			//
			// We use removeAttr only for key events, to allow IE to export the correct
			// accessible attributes. For mouse events, set to empty string to avoid
			// native tooltip showing up (happens only when removing inside mouseover).
			if (target.is("[title]")) {
				if (event && event.type === "mouseover") {
					target.attr("title", "");
				} else {
					target.removeAttr("title");
				}
			}

			tooltipData = this._tooltip(target);
			tooltip = tooltipData.tooltip;
			this._addDescribedBy(target, tooltip.attr("id"));
			tooltip.find(".ui-tooltip-content").html(content);

			// Support: Voiceover on OS X, JAWS on IE <= 9
			// JAWS announces deletions even when aria-relevant="additions"
			// Voiceover will sometimes re-read the entire log region's contents from the beginning
			this.liveRegion.children().hide();
			a11yContent = $("<div>").html(tooltip.find(".ui-tooltip-content").html());
			a11yContent.removeAttr("name").find("[name]").removeAttr("name");
			a11yContent.removeAttr("id").find("[id]").removeAttr("id");
			a11yContent.appendTo(this.liveRegion);

			function position(event) {
				positionOption.of = event;
				if (tooltip.is(":hidden")) {
					return;
				}
				tooltip.position(positionOption);
			}
			if (this.options.track && event && /^mouse/.test(event.type)) {
				this._on(this.document, {
					mousemove: position
				});

				// trigger once to override element-relative positioning
				position(event);
			} else {
				tooltip.position($.extend({
					of: target
				}, this.options.position));
			}

			tooltip.hide();

			this._show(tooltip, this.options.show);

			// Handle tracking tooltips that are shown with a delay (#8644). As soon
			// as the tooltip is visible, position the tooltip using the most recent
			// event.
			// Adds the check to add the timers only when both delay and track options are set (#14682)
			if (this.options.track && this.options.show && this.options.show.delay) {
				delayedShow = this.delayedShow = setInterval(function () {
					if (tooltip.is(":visible")) {
						position(positionOption.of);
						clearInterval(delayedShow);
					}
				}, $.fx.interval);
			}

			this._trigger("open", event, { tooltip: tooltip });
		},

		_registerCloseHandlers: function _registerCloseHandlers(event, target) {
			var events = {
				keyup: function keyup(event) {
					if (event.keyCode === $.ui.keyCode.ESCAPE) {
						var fakeEvent = $.Event(event);
						fakeEvent.currentTarget = target[0];
						this.close(fakeEvent, true);
					}
				}
			};

			// Only bind remove handler for delegated targets. Non-delegated
			// tooltips will handle this in destroy.
			if (target[0] !== this.element[0]) {
				events.remove = function () {
					this._removeTooltip(this._find(target).tooltip);
				};
			}

			if (!event || event.type === "mouseover") {
				events.mouseleave = "close";
			}
			if (!event || event.type === "focusin") {
				events.focusout = "close";
			}
			this._on(true, target, events);
		},

		close: function close(event) {
			var tooltip,
			    that = this,
			    target = $(event ? event.currentTarget : this.element),
			    tooltipData = this._find(target);

			// The tooltip may already be closed
			if (!tooltipData) {

				// We set ui-tooltip-open immediately upon open (in open()), but only set the
				// additional data once there's actually content to show (in _open()). So even if the
				// tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in
				// the period between open() and _open().
				target.removeData("ui-tooltip-open");
				return;
			}

			tooltip = tooltipData.tooltip;

			// Disabling closes the tooltip, so we need to track when we're closing
			// to avoid an infinite loop in case the tooltip becomes disabled on close
			if (tooltipData.closing) {
				return;
			}

			// Clear the interval for delayed tracking tooltips
			clearInterval(this.delayedShow);

			// Only set title if we had one before (see comment in _open())
			// If the title attribute has changed since open(), don't restore
			if (target.data("ui-tooltip-title") && !target.attr("title")) {
				target.attr("title", target.data("ui-tooltip-title"));
			}

			this._removeDescribedBy(target);

			tooltipData.hiding = true;
			tooltip.stop(true);
			this._hide(tooltip, this.options.hide, function () {
				that._removeTooltip($(this));
			});

			target.removeData("ui-tooltip-open");
			this._off(target, "mouseleave focusout keyup");

			// Remove 'remove' binding only on delegated targets
			if (target[0] !== this.element[0]) {
				this._off(target, "remove");
			}
			this._off(this.document, "mousemove");

			if (event && event.type === "mouseleave") {
				$.each(this.parents, function (id, parent) {
					$(parent.element).attr("title", parent.title);
					delete that.parents[id];
				});
			}

			tooltipData.closing = true;
			this._trigger("close", event, { tooltip: tooltip });
			if (!tooltipData.hiding) {
				tooltipData.closing = false;
			}
		},

		_tooltip: function _tooltip(element) {
			var tooltip = $("<div>").attr("role", "tooltip"),
			    content = $("<div>").appendTo(tooltip),
			    id = tooltip.uniqueId().attr("id");

			this._addClass(content, "ui-tooltip-content");
			this._addClass(tooltip, "ui-tooltip", "ui-widget ui-widget-content");

			tooltip.appendTo(this._appendTo(element));

			return this.tooltips[id] = {
				element: element,
				tooltip: tooltip
			};
		},

		_find: function _find(target) {
			var id = target.data("ui-tooltip-id");
			return id ? this.tooltips[id] : null;
		},

		_removeTooltip: function _removeTooltip(tooltip) {
			tooltip.remove();
			delete this.tooltips[tooltip.attr("id")];
		},

		_appendTo: function _appendTo(target) {
			var element = target.closest(".ui-front, dialog");

			if (!element.length) {
				element = this.document[0].body;
			}

			return element;
		},

		_destroy: function _destroy() {
			var that = this;

			// Close open tooltips
			$.each(this.tooltips, function (id, tooltipData) {

				// Delegate to close method to handle common cleanup
				var event = $.Event("blur"),
				    element = tooltipData.element;
				event.target = event.currentTarget = element[0];
				that.close(event, true);

				// Remove immediately; destroying an open tooltip doesn't use the
				// hide animation
				$("#" + id).remove();

				// Restore the title
				if (element.data("ui-tooltip-title")) {

					// If the title attribute has changed since open(), don't restore
					if (!element.attr("title")) {
						element.attr("title", element.data("ui-tooltip-title"));
					}
					element.removeData("ui-tooltip-title");
				}
			});
			this.liveRegion.remove();
		}
	});

	// DEPRECATED
	// TODO: Switch return back to widget declaration at top of file when this is removed
	if ($.uiBackCompat !== false) {

		// Backcompat for tooltipClass option
		$.widget("ui.tooltip", $.ui.tooltip, {
			options: {
				tooltipClass: null
			},
			_tooltip: function _tooltip() {
				var tooltipData = this._superApply(arguments);
				if (this.options.tooltipClass) {
					tooltipData.tooltip.addClass(this.options.tooltipClass);
				}
				return tooltipData;
			}
		});
	}

	var widgetsTooltip = $.ui.tooltip;
});

},{}],53:[function(require,module,exports){
'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var _jquery = require('./jquery');

var _jquery2 = _interopRequireDefault(_jquery);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var jQuery = _jquery2.default;

+function ($) {
    'use strict';
    /*!
    * jQuery Validation Plugin v1.15.0
    *
    * http://jqueryvalidation.org/
    *
    * Copyright (c) 2016 Jörn Zaefferer
    * Released under the MIT license
    */

    (function (factory) {
        /* if (typeof define === "function" && define.amd) {
             define(["jquery"], factory);
         } else if (typeof module === "object" && module.exports) {
             module.exports = factory(require("jquery"));
         } else {
             factory(jQuery);
         }*/
    })(function ($) {

        $.extend($.fn, {

            // http://jqueryvalidation.org/validate/
            validate: function validate(options) {

                // If nothing is selected, return nothing; can't chain anyway
                if (!this.length) {
                    if (options && options.debug && window.console) {
                        console.warn("Nothing selected, can't validate, returning nothing.");
                    }
                    return;
                }

                // Check if a validator for this form was already created
                var validator = $.data(this[0], "validator");
                if (validator) {
                    return validator;
                }

                // Add novalidate tag if HTML5.
                this.attr("novalidate", "novalidate");

                validator = new $.validator(options, this[0]);
                $.data(this[0], "validator", validator);

                if (validator.settings.onsubmit) {

                    this.on("click.validate", ":submit", function (event) {
                        if (validator.settings.submitHandler) {
                            validator.submitButton = event.target;
                        }

                        // Allow suppressing validation by adding a cancel class to the submit button
                        if ($(this).hasClass("cancel")) {
                            validator.cancelSubmit = true;
                        }

                        // Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button
                        if ($(this).attr("formnovalidate") !== undefined) {
                            validator.cancelSubmit = true;
                        }
                    });

                    // Validate the form on submit
                    this.on("submit.validate", function (event) {
                        if (validator.settings.debug) {

                            // Prevent form submit to be able to see console output
                            event.preventDefault();
                        }
                        function handle() {
                            var hidden, result;
                            if (validator.settings.submitHandler) {
                                if (validator.submitButton) {

                                    // Insert a hidden input as a replacement for the missing submit button
                                    hidden = $("<input type='hidden'/>").attr("name", validator.submitButton.name).val($(validator.submitButton).val()).appendTo(validator.currentForm);
                                }
                                result = validator.settings.submitHandler.call(validator, validator.currentForm, event);
                                if (validator.submitButton) {

                                    // And clean up afterwards; thanks to no-block-scope, hidden can be referenced
                                    hidden.remove();
                                }
                                if (result !== undefined) {
                                    return result;
                                }
                                return false;
                            }
                            return true;
                        }

                        // Prevent submit for invalid forms or custom submit handlers
                        if (validator.cancelSubmit) {
                            validator.cancelSubmit = false;
                            return handle();
                        }
                        if (validator.form()) {
                            if (validator.pendingRequest) {
                                validator.formSubmitted = true;
                                return false;
                            }
                            return handle();
                        } else {
                            validator.focusInvalid();
                            return false;
                        }
                    });
                }

                return validator;
            },

            // http://jqueryvalidation.org/valid/
            valid: function valid() {
                var valid, validator, errorList;

                if ($(this[0]).is("form")) {
                    valid = this.validate().form();
                } else {
                    errorList = [];
                    valid = true;
                    validator = $(this[0].form).validate();
                    this.each(function () {
                        valid = validator.element(this) && valid;
                        if (!valid) {
                            errorList = errorList.concat(validator.errorList);
                        }
                    });
                    validator.errorList = errorList;
                }
                return valid;
            },

            // http://jqueryvalidation.org/rules/
            rules: function rules(command, argument) {

                // If nothing is selected, return nothing; can't chain anyway
                if (!this.length) {
                    return;
                }

                var element = this[0],
                    settings,
                    staticRules,
                    existingRules,
                    data,
                    param,
                    filtered;

                if (command) {
                    settings = $.data(element.form, "validator").settings;
                    staticRules = settings.rules;
                    existingRules = $.validator.staticRules(element);
                    switch (command) {
                        case "add":
                            $.extend(existingRules, $.validator.normalizeRule(argument));

                            // Remove messages from rules, but allow them to be set separately
                            delete existingRules.messages;
                            staticRules[element.name] = existingRules;
                            if (argument.messages) {
                                settings.messages[element.name] = $.extend(settings.messages[element.name], argument.messages);
                            }
                            break;
                        case "remove":
                            if (!argument) {
                                delete staticRules[element.name];
                                return existingRules;
                            }
                            filtered = {};
                            $.each(argument.split(/\s/), function (index, method) {
                                filtered[method] = existingRules[method];
                                delete existingRules[method];
                                if (method === "required") {
                                    $(element).removeAttr("aria-required");
                                }
                            });
                            return filtered;
                    }
                }

                data = $.validator.normalizeRules($.extend({}, $.validator.classRules(element), $.validator.attributeRules(element), $.validator.dataRules(element), $.validator.staticRules(element)), element);

                // Make sure required is at front
                if (data.required) {
                    param = data.required;
                    delete data.required;
                    data = $.extend({ required: param }, data);
                    $(element).attr("aria-required", "true");
                }

                // Make sure remote is at back
                if (data.remote) {
                    param = data.remote;
                    delete data.remote;
                    data = $.extend(data, { remote: param });
                }

                return data;
            }
        });

        // Custom selectors
        $.extend($.expr[":"], {

            // http://jqueryvalidation.org/blank-selector/
            blank: function blank(a) {
                return !$.trim("" + $(a).val());
            },

            // http://jqueryvalidation.org/filled-selector/
            filled: function filled(a) {
                var val = $(a).val();
                return val !== null && !!$.trim("" + val);
            },

            // http://jqueryvalidation.org/unchecked-selector/
            unchecked: function unchecked(a) {
                return !$(a).prop("checked");
            }
        });

        // Constructor for validator
        $.validator = function (options, form) {
            this.settings = $.extend(true, {}, $.validator.defaults, options);
            this.currentForm = form;
            this.init();
        };

        // http://jqueryvalidation.org/jQuery.validator.format/
        $.validator.format = function (source, params) {
            if (arguments.length === 1) {
                return function () {
                    var args = $.makeArray(arguments);
                    args.unshift(source);
                    return $.validator.format.apply(this, args);
                };
            }
            if (params === undefined) {
                return source;
            }
            if (arguments.length > 2 && params.constructor !== Array) {
                params = $.makeArray(arguments).slice(1);
            }
            if (params.constructor !== Array) {
                params = [params];
            }
            $.each(params, function (i, n) {
                source = source.replace(new RegExp("\\{" + i + "\\}", "g"), function () {
                    return n;
                });
            });
            return source;
        };

        $.extend($.validator, {

            defaults: {
                messages: {},
                groups: {},
                rules: {},
                errorClass: "error",
                pendingClass: "pending",
                validClass: "valid",
                errorElement: "label",
                focusCleanup: false,
                focusInvalid: true,
                errorContainer: $([]),
                errorLabelContainer: $([]),
                onsubmit: true,
                ignore: ":hidden",
                ignoreTitle: false,
                onfocusin: function onfocusin(element) {
                    this.lastActive = element;

                    // Hide error label and remove error class on focus if enabled
                    if (this.settings.focusCleanup) {
                        if (this.settings.unhighlight) {
                            this.settings.unhighlight.call(this, element, this.settings.errorClass, this.settings.validClass);
                        }
                        this.hideThese(this.errorsFor(element));
                    }
                },
                onfocusout: function onfocusout(element) {
                    if (!this.checkable(element) && (element.name in this.submitted || !this.optional(element))) {
                        this.element(element);
                    }
                },
                onkeyup: function onkeyup(element, event) {

                    // Avoid revalidate the field when pressing one of the following keys
                    // Shift       => 16
                    // Ctrl        => 17
                    // Alt         => 18
                    // Caps lock   => 20
                    // End         => 35
                    // Home        => 36
                    // Left arrow  => 37
                    // Up arrow    => 38
                    // Right arrow => 39
                    // Down arrow  => 40
                    // Insert      => 45
                    // Num lock    => 144
                    // AltGr key   => 225
                    var excludedKeys = [16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225];

                    if (event.which === 9 && this.elementValue(element) === "" || $.inArray(event.keyCode, excludedKeys) !== -1) {
                        return;
                    } else if (element.name in this.submitted || element.name in this.invalid) {
                        this.element(element);
                    }
                },
                onclick: function onclick(element) {

                    // Click on selects, radiobuttons and checkboxes
                    if (element.name in this.submitted) {
                        this.element(element);

                        // Or option elements, check parent select in that case
                    } else if (element.parentNode.name in this.submitted) {
                        this.element(element.parentNode);
                    }
                },
                highlight: function highlight(element, errorClass, validClass) {
                    if (element.type === "radio") {
                        this.findByName(element.name).addClass(errorClass).removeClass(validClass);
                    } else {
                        $(element).addClass(errorClass).removeClass(validClass);
                    }
                },
                unhighlight: function unhighlight(element, errorClass, validClass) {
                    if (element.type === "radio") {
                        this.findByName(element.name).removeClass(errorClass).addClass(validClass);
                    } else {
                        $(element).removeClass(errorClass).addClass(validClass);
                    }
                }
            },

            // http://jqueryvalidation.org/jQuery.validator.setDefaults/
            setDefaults: function setDefaults(settings) {
                $.extend($.validator.defaults, settings);
            },

            messages: {
                required: "This field is required.",
                remote: "Please fix this field.",
                email: "Please enter a valid email address.",
                url: "Please enter a valid URL.",
                date: "Please enter a valid date.",
                dateISO: "Please enter a valid date ( ISO ).",
                number: "Please enter a valid number.",
                digits: "Please enter only digits.",
                equalTo: "Please enter the same value again.",
                maxlength: $.validator.format("Please enter no more than {0} characters."),
                minlength: $.validator.format("Please enter at least {0} characters."),
                rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."),
                range: $.validator.format("Please enter a value between {0} and {1}."),
                max: $.validator.format("Please enter a value less than or equal to {0}."),
                min: $.validator.format("Please enter a value greater than or equal to {0}."),
                step: $.validator.format("Please enter a multiple of {0}.")
            },

            autoCreateRanges: false,

            prototype: {

                init: function init() {
                    this.labelContainer = $(this.settings.errorLabelContainer);
                    this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm);
                    this.containers = $(this.settings.errorContainer).add(this.settings.errorLabelContainer);
                    this.submitted = {};
                    this.valueCache = {};
                    this.pendingRequest = 0;
                    this.pending = {};
                    this.invalid = {};
                    this.reset();

                    var groups = this.groups = {},
                        rules;
                    $.each(this.settings.groups, function (key, value) {
                        if (typeof value === "string") {
                            value = value.split(/\s/);
                        }
                        $.each(value, function (index, name) {
                            groups[name] = key;
                        });
                    });
                    rules = this.settings.rules;
                    $.each(rules, function (key, value) {
                        rules[key] = $.validator.normalizeRule(value);
                    });

                    function delegate(event) {
                        var validator = $.data(this.form, "validator"),
                            eventType = "on" + event.type.replace(/^validate/, ""),
                            settings = validator.settings;
                        if (settings[eventType] && !$(this).is(settings.ignore)) {
                            settings[eventType].call(validator, this, event);
                        }
                    }

                    $(this.currentForm).on("focusin.validate focusout.validate keyup.validate", ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " + "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " + "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " + "[type='radio'], [type='checkbox'], [contenteditable]", delegate)

                    // Support: Chrome, oldIE
                    // "select" is provided as event.target when clicking a option
                    .on("click.validate", "select, option, [type='radio'], [type='checkbox']", delegate);

                    if (this.settings.invalidHandler) {
                        $(this.currentForm).on("invalid-form.validate", this.settings.invalidHandler);
                    }

                    // Add aria-required to any Static/Data/Class required fields before first validation
                    // Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html
                    $(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required", "true");
                },

                // http://jqueryvalidation.org/Validator.form/
                form: function form() {
                    this.checkForm();
                    $.extend(this.submitted, this.errorMap);
                    this.invalid = $.extend({}, this.errorMap);
                    if (!this.valid()) {
                        $(this.currentForm).triggerHandler("invalid-form", [this]);
                    }
                    this.showErrors();
                    return this.valid();
                },

                checkForm: function checkForm() {
                    this.prepareForm();
                    for (var i = 0, elements = this.currentElements = this.elements(); elements[i]; i++) {
                        this.check(elements[i]);
                    }
                    return this.valid();
                },

                // http://jqueryvalidation.org/Validator.element/
                element: function element(_element) {
                    var cleanElement = this.clean(_element),
                        checkElement = this.validationTargetFor(cleanElement),
                        v = this,
                        result = true,
                        rs,
                        group;

                    if (checkElement === undefined) {
                        delete this.invalid[cleanElement.name];
                    } else {
                        this.prepareElement(checkElement);
                        this.currentElements = $(checkElement);

                        // If this element is grouped, then validate all group elements already
                        // containing a value
                        group = this.groups[checkElement.name];
                        if (group) {
                            $.each(this.groups, function (name, testgroup) {
                                if (testgroup === group && name !== checkElement.name) {
                                    cleanElement = v.validationTargetFor(v.clean(v.findByName(name)));
                                    if (cleanElement && cleanElement.name in v.invalid) {
                                        v.currentElements.push(cleanElement);
                                        result = result && v.check(cleanElement);
                                    }
                                }
                            });
                        }

                        rs = this.check(checkElement) !== false;
                        result = result && rs;
                        if (rs) {
                            this.invalid[checkElement.name] = false;
                        } else {
                            this.invalid[checkElement.name] = true;
                        }

                        if (!this.numberOfInvalids()) {

                            // Hide error containers on last error
                            this.toHide = this.toHide.add(this.containers);
                        }
                        this.showErrors();

                        // Add aria-invalid status for screen readers
                        $(_element).attr("aria-invalid", !rs);
                    }

                    return result;
                },

                // http://jqueryvalidation.org/Validator.showErrors/
                showErrors: function showErrors(errors) {
                    if (errors) {
                        var validator = this;

                        // Add items to error list and map
                        $.extend(this.errorMap, errors);
                        this.errorList = $.map(this.errorMap, function (message, name) {
                            return {
                                message: message,
                                element: validator.findByName(name)[0]
                            };
                        });

                        // Remove items from success list
                        this.successList = $.grep(this.successList, function (element) {
                            return !(element.name in errors);
                        });
                    }
                    if (this.settings.showErrors) {
                        this.settings.showErrors.call(this, this.errorMap, this.errorList);
                    } else {
                        this.defaultShowErrors();
                    }
                },

                // http://jqueryvalidation.org/Validator.resetForm/
                resetForm: function resetForm() {
                    if ($.fn.resetForm) {
                        $(this.currentForm).resetForm();
                    }
                    this.invalid = {};
                    this.submitted = {};
                    this.prepareForm();
                    this.hideErrors();
                    var elements = this.elements().removeData("previousValue").removeAttr("aria-invalid");

                    this.resetElements(elements);
                },

                resetElements: function resetElements(elements) {
                    var i;

                    if (this.settings.unhighlight) {
                        for (i = 0; elements[i]; i++) {
                            this.settings.unhighlight.call(this, elements[i], this.settings.errorClass, "");
                            this.findByName(elements[i].name).removeClass(this.settings.validClass);
                        }
                    } else {
                        elements.removeClass(this.settings.errorClass).removeClass(this.settings.validClass);
                    }
                },

                numberOfInvalids: function numberOfInvalids() {
                    return this.objectLength(this.invalid);
                },

                objectLength: function objectLength(obj) {
                    /* jshint unused: false */
                    var count = 0,
                        i;
                    for (i in obj) {
                        if (obj[i]) {
                            count++;
                        }
                    }
                    return count;
                },

                hideErrors: function hideErrors() {
                    this.hideThese(this.toHide);
                },

                hideThese: function hideThese(errors) {
                    errors.not(this.containers).text("");
                    this.addWrapper(errors).hide();
                },

                valid: function valid() {
                    return this.size() === 0;
                },

                size: function size() {
                    return this.errorList.length;
                },

                focusInvalid: function focusInvalid() {
                    if (this.settings.focusInvalid) {
                        try {
                            $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus()

                            // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find
                            .trigger("focusin");
                        } catch (e) {

                            // Ignore IE throwing errors when focusing hidden elements
                        }
                    }
                },

                findLastActive: function findLastActive() {
                    var lastActive = this.lastActive;
                    return lastActive && $.grep(this.errorList, function (n) {
                        return n.element.name === lastActive.name;
                    }).length === 1 && lastActive;
                },

                elements: function elements() {
                    var validator = this,
                        rulesCache = {};

                    // Select all valid inputs inside the form (no submit or reset buttons)
                    return $(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function () {
                        var name = this.name || $(this).attr("name"); // For contenteditable
                        if (!name && validator.settings.debug && window.console) {
                            console.error("%o has no name assigned", this);
                        }

                        // Set form expando on contenteditable
                        if (this.hasAttribute("contenteditable")) {
                            this.form = $(this).closest("form")[0];
                        }

                        // Select only the first element for each name, and only those with rules specified
                        if (name in rulesCache || !validator.objectLength($(this).rules())) {
                            return false;
                        }

                        rulesCache[name] = true;
                        return true;
                    });
                },

                clean: function clean(selector) {
                    return $(selector)[0];
                },

                errors: function errors() {
                    var errorClass = this.settings.errorClass.split(" ").join(".");
                    return $(this.settings.errorElement + "." + errorClass, this.errorContext);
                },

                resetInternals: function resetInternals() {
                    this.successList = [];
                    this.errorList = [];
                    this.errorMap = {};
                    this.toShow = $([]);
                    this.toHide = $([]);
                },

                reset: function reset() {
                    this.resetInternals();
                    this.currentElements = $([]);
                },

                prepareForm: function prepareForm() {
                    this.reset();
                    this.toHide = this.errors().add(this.containers);
                },

                prepareElement: function prepareElement(element) {
                    this.reset();
                    this.toHide = this.errorsFor(element);
                },

                elementValue: function elementValue(element) {
                    var $element = $(element),
                        type = element.type,
                        val,
                        idx;

                    if (type === "radio" || type === "checkbox") {
                        return this.findByName(element.name).filter(":checked").val();
                    } else if (type === "number" && typeof element.validity !== "undefined") {
                        return element.validity.badInput ? "NaN" : $element.val();
                    }

                    if (element.hasAttribute("contenteditable")) {
                        val = $element.text();
                    } else {
                        val = $element.val();
                    }

                    if (type === "file") {

                        // Modern browser (chrome & safari)
                        if (val.substr(0, 12) === "C:\\fakepath\\") {
                            return val.substr(12);
                        }

                        // Legacy browsers
                        // Unix-based path
                        idx = val.lastIndexOf("/");
                        if (idx >= 0) {
                            return val.substr(idx + 1);
                        }

                        // Windows-based path
                        idx = val.lastIndexOf("\\");
                        if (idx >= 0) {
                            return val.substr(idx + 1);
                        }

                        // Just the file name
                        return val;
                    }

                    if (typeof val === "string") {
                        return val.replace(/\r/g, "");
                    }
                    return val;
                },

                check: function check(element) {
                    element = this.validationTargetFor(this.clean(element));

                    var rules = $(element).rules(),
                        rulesCount = $.map(rules, function (n, i) {
                        return i;
                    }).length,
                        dependencyMismatch = false,
                        val = this.elementValue(element),
                        result,
                        method,
                        rule;

                    // If a normalizer is defined for this element, then
                    // call it to retreive the changed value instead
                    // of using the real one.
                    // Note that `this` in the normalizer is `element`.
                    if (typeof rules.normalizer === "function") {
                        val = rules.normalizer.call(element, val);

                        if (typeof val !== "string") {
                            throw new TypeError("The normalizer should return a string value.");
                        }

                        // Delete the normalizer from rules to avoid treating
                        // it as a pre-defined method.
                        delete rules.normalizer;
                    }

                    for (method in rules) {
                        rule = { method: method, parameters: rules[method] };
                        try {
                            result = $.validator.methods[method].call(this, val, element, rule.parameters);

                            // If a method indicates that the field is optional and therefore valid,
                            // don't mark it as valid when there are no other rules
                            if (result === "dependency-mismatch" && rulesCount === 1) {
                                dependencyMismatch = true;
                                continue;
                            }
                            dependencyMismatch = false;

                            if (result === "pending") {
                                this.toHide = this.toHide.not(this.errorsFor(element));
                                return;
                            }

                            if (!result) {
                                this.formatAndAdd(element, rule);
                                return false;
                            }
                        } catch (e) {
                            if (this.settings.debug && window.console) {
                                console.log("Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e);
                            }
                            if (e instanceof TypeError) {
                                e.message += ".  Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.";
                            }

                            throw e;
                        }
                    }
                    if (dependencyMismatch) {
                        return;
                    }
                    if (this.objectLength(rules)) {
                        this.successList.push(element);
                    }
                    return true;
                },

                // Return the custom message for the given element and validation method
                // specified in the element's HTML5 data attribute
                // return the generic message if present and no method specific message is present
                customDataMessage: function customDataMessage(element, method) {
                    return $(element).data("msg" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase()) || $(element).data("msg");
                },

                // Return the custom message for the given element name and validation method
                customMessage: function customMessage(name, method) {
                    var m = this.settings.messages[name];
                    return m && (m.constructor === String ? m : m[method]);
                },

                // Return the first defined argument, allowing empty strings
                findDefined: function findDefined() {
                    for (var i = 0; i < arguments.length; i++) {
                        if (arguments[i] !== undefined) {
                            return arguments[i];
                        }
                    }
                    return undefined;
                },

                defaultMessage: function defaultMessage(element, rule) {
                    var message = this.findDefined(this.customMessage(element.name, rule.method), this.customDataMessage(element, rule.method),

                    // 'title' is never undefined, so handle empty string as undefined
                    !this.settings.ignoreTitle && element.title || undefined, $.validator.messages[rule.method], "<strong>Warning: No message defined for " + element.name + "</strong>"),
                        theregex = /\$?\{(\d+)\}/g;
                    if (typeof message === "function") {
                        message = message.call(this, rule.parameters, element);
                    } else if (theregex.test(message)) {
                        message = $.validator.format(message.replace(theregex, "{$1}"), rule.parameters);
                    }

                    return message;
                },

                formatAndAdd: function formatAndAdd(element, rule) {
                    var message = this.defaultMessage(element, rule);

                    this.errorList.push({
                        message: message,
                        element: element,
                        method: rule.method
                    });

                    this.errorMap[element.name] = message;
                    this.submitted[element.name] = message;
                },

                addWrapper: function addWrapper(toToggle) {
                    if (this.settings.wrapper) {
                        toToggle = toToggle.add(toToggle.parent(this.settings.wrapper));
                    }
                    return toToggle;
                },

                defaultShowErrors: function defaultShowErrors() {
                    var i, elements, error;
                    for (i = 0; this.errorList[i]; i++) {
                        error = this.errorList[i];
                        if (this.settings.highlight) {
                            this.settings.highlight.call(this, error.element, this.settings.errorClass, this.settings.validClass);
                        }
                        this.showLabel(error.element, error.message);
                    }
                    if (this.errorList.length) {
                        this.toShow = this.toShow.add(this.containers);
                    }
                    if (this.settings.success) {
                        for (i = 0; this.successList[i]; i++) {
                            this.showLabel(this.successList[i]);
                        }
                    }
                    if (this.settings.unhighlight) {
                        for (i = 0, elements = this.validElements(); elements[i]; i++) {
                            this.settings.unhighlight.call(this, elements[i], this.settings.errorClass, this.settings.validClass);
                        }
                    }
                    this.toHide = this.toHide.not(this.toShow);
                    this.hideErrors();
                    this.addWrapper(this.toShow).show();
                },

                validElements: function validElements() {
                    return this.currentElements.not(this.invalidElements());
                },

                invalidElements: function invalidElements() {
                    return $(this.errorList).map(function () {
                        return this.element;
                    });
                },

                showLabel: function showLabel(element, message) {
                    var place,
                        group,
                        errorID,
                        v,
                        error = this.errorsFor(element),
                        elementID = this.idOrName(element),
                        describedBy = $(element).attr("aria-describedby");

                    if (error.length) {

                        // Refresh error/success class
                        error.removeClass(this.settings.validClass).addClass(this.settings.errorClass);

                        // Replace message on existing label
                        error.html(message);
                    } else {

                        // Create error element
                        error = $("<" + this.settings.errorElement + ">").attr("id", elementID + "-error").addClass(this.settings.errorClass).html(message || "");

                        // Maintain reference to the element to be placed into the DOM
                        place = error;
                        if (this.settings.wrapper) {

                            // Make sure the element is visible, even in IE
                            // actually showing the wrapped element is handled elsewhere
                            place = error.hide().show().wrap("<" + this.settings.wrapper + "/>").parent();
                        }
                        if (this.labelContainer.length) {
                            this.labelContainer.append(place);
                        } else if (this.settings.errorPlacement) {
                            this.settings.errorPlacement(place, $(element));
                        } else {
                            place.insertAfter(element);
                        }

                        // Link error back to the element
                        if (error.is("label")) {

                            // If the error is a label, then associate using 'for'
                            error.attr("for", elementID);

                            // If the element is not a child of an associated label, then it's necessary
                            // to explicitly apply aria-describedby
                        } else if (error.parents("label[for='" + this.escapeCssMeta(elementID) + "']").length === 0) {
                            errorID = error.attr("id");

                            // Respect existing non-error aria-describedby
                            if (!describedBy) {
                                describedBy = errorID;
                            } else if (!describedBy.match(new RegExp("\\b" + this.escapeCssMeta(errorID) + "\\b"))) {

                                // Add to end of list if not already present
                                describedBy += " " + errorID;
                            }
                            $(element).attr("aria-describedby", describedBy);

                            // If this element is grouped, then assign to all elements in the same group
                            group = this.groups[element.name];
                            if (group) {
                                v = this;
                                $.each(v.groups, function (name, testgroup) {
                                    if (testgroup === group) {
                                        $("[name='" + v.escapeCssMeta(name) + "']", v.currentForm).attr("aria-describedby", error.attr("id"));
                                    }
                                });
                            }
                        }
                    }
                    if (!message && this.settings.success) {
                        error.text("");
                        if (typeof this.settings.success === "string") {
                            error.addClass(this.settings.success);
                        } else {
                            this.settings.success(error, element);
                        }
                    }
                    this.toShow = this.toShow.add(error);
                },

                errorsFor: function errorsFor(element) {
                    var name = this.escapeCssMeta(this.idOrName(element)),
                        describer = $(element).attr("aria-describedby"),
                        selector = "label[for='" + name + "'], label[for='" + name + "'] *";

                    // 'aria-describedby' should directly reference the error element
                    if (describer) {
                        selector = selector + ", #" + this.escapeCssMeta(describer).replace(/\s+/g, ", #");
                    }

                    return this.errors().filter(selector);
                },

                // See https://api.jquery.com/category/selectors/, for CSS
                // meta-characters that should be escaped in order to be used with JQuery
                // as a literal part of a name/id or any selector.
                escapeCssMeta: function escapeCssMeta(string) {
                    return string.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1");
                },

                idOrName: function idOrName(element) {
                    return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name);
                },

                validationTargetFor: function validationTargetFor(element) {

                    // If radio/checkbox, validate first element in group instead
                    if (this.checkable(element)) {
                        element = this.findByName(element.name);
                    }

                    // Always apply ignore filter
                    return $(element).not(this.settings.ignore)[0];
                },

                checkable: function checkable(element) {
                    return (/radio|checkbox/i.test(element.type)
                    );
                },

                findByName: function findByName(name) {
                    return $(this.currentForm).find("[name='" + this.escapeCssMeta(name) + "']");
                },

                getLength: function getLength(value, element) {
                    switch (element.nodeName.toLowerCase()) {
                        case "select":
                            return $("option:selected", element).length;
                        case "input":
                            if (this.checkable(element)) {
                                return this.findByName(element.name).filter(":checked").length;
                            }
                    }
                    return value.length;
                },

                depend: function depend(param, element) {
                    return this.dependTypes[typeof param === 'undefined' ? 'undefined' : _typeof(param)] ? this.dependTypes[typeof param === 'undefined' ? 'undefined' : _typeof(param)](param, element) : true;
                },

                dependTypes: {
                    "boolean": function boolean(param) {
                        return param;
                    },
                    "string": function string(param, element) {
                        return !!$(param, element.form).length;
                    },
                    "function": function _function(param, element) {
                        return param(element);
                    }
                },

                optional: function optional(element) {
                    var val = this.elementValue(element);
                    return !$.validator.methods.required.call(this, val, element) && "dependency-mismatch";
                },

                startRequest: function startRequest(element) {
                    if (!this.pending[element.name]) {
                        this.pendingRequest++;
                        $(element).addClass(this.settings.pendingClass);
                        this.pending[element.name] = true;
                    }
                },

                stopRequest: function stopRequest(element, valid) {
                    this.pendingRequest--;

                    // Sometimes synchronization fails, make sure pendingRequest is never < 0
                    if (this.pendingRequest < 0) {
                        this.pendingRequest = 0;
                    }
                    delete this.pending[element.name];
                    $(element).removeClass(this.settings.pendingClass);
                    if (valid && this.pendingRequest === 0 && this.formSubmitted && this.form()) {
                        $(this.currentForm).submit();
                        this.formSubmitted = false;
                    } else if (!valid && this.pendingRequest === 0 && this.formSubmitted) {
                        $(this.currentForm).triggerHandler("invalid-form", [this]);
                        this.formSubmitted = false;
                    }
                },

                previousValue: function previousValue(element, method) {
                    return $.data(element, "previousValue") || $.data(element, "previousValue", {
                        old: null,
                        valid: true,
                        message: this.defaultMessage(element, { method: method })
                    });
                },

                // Cleans up all forms and elements, removes validator-specific events
                destroy: function destroy() {
                    this.resetForm();

                    $(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur");
                }

            },

            classRuleSettings: {
                required: { required: true },
                email: { email: true },
                url: { url: true },
                date: { date: true },
                dateISO: { dateISO: true },
                number: { number: true },
                digits: { digits: true },
                creditcard: { creditcard: true }
            },

            addClassRules: function addClassRules(className, rules) {
                if (className.constructor === String) {
                    this.classRuleSettings[className] = rules;
                } else {
                    $.extend(this.classRuleSettings, className);
                }
            },

            classRules: function classRules(element) {
                var rules = {},
                    classes = $(element).attr("class");

                if (classes) {
                    $.each(classes.split(" "), function () {
                        if (this in $.validator.classRuleSettings) {
                            $.extend(rules, $.validator.classRuleSettings[this]);
                        }
                    });
                }
                return rules;
            },

            normalizeAttributeRule: function normalizeAttributeRule(rules, type, method, value) {

                // Convert the value to a number for number inputs, and for text for backwards compability
                // allows type="date" and others to be compared as strings
                if (/min|max|step/.test(method) && (type === null || /number|range|text/.test(type))) {
                    value = Number(value);

                    // Support Opera Mini, which returns NaN for undefined minlength
                    if (isNaN(value)) {
                        value = undefined;
                    }
                }

                if (value || value === 0) {
                    rules[method] = value;
                } else if (type === method && type !== "range") {

                    // Exception: the jquery validate 'range' method
                    // does not test for the html5 'range' type
                    rules[method] = true;
                }
            },

            attributeRules: function attributeRules(element) {
                var rules = {},
                    $element = $(element),
                    type = element.getAttribute("type"),
                    method,
                    value;

                for (method in $.validator.methods) {

                    // Support for <input required> in both html5 and older browsers
                    if (method === "required") {
                        value = element.getAttribute(method);

                        // Some browsers return an empty string for the required attribute
                        // and non-HTML5 browsers might have required="" markup
                        if (value === "") {
                            value = true;
                        }

                        // Force non-HTML5 browsers to return bool
                        value = !!value;
                    } else {
                        value = $element.attr(method);
                    }

                    this.normalizeAttributeRule(rules, type, method, value);
                }

                // 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs
                if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) {
                    delete rules.maxlength;
                }

                return rules;
            },

            dataRules: function dataRules(element) {
                var rules = {},
                    $element = $(element),
                    type = element.getAttribute("type"),
                    method,
                    value;

                for (method in $.validator.methods) {
                    value = $element.data("rule" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase());
                    this.normalizeAttributeRule(rules, type, method, value);
                }
                return rules;
            },

            staticRules: function staticRules(element) {
                var rules = {},
                    validator = $.data(element.form, "validator");

                if (validator.settings.rules) {
                    rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {};
                }
                return rules;
            },

            normalizeRules: function normalizeRules(rules, element) {

                // Handle dependency check
                $.each(rules, function (prop, val) {

                    // Ignore rule when param is explicitly false, eg. required:false
                    if (val === false) {
                        delete rules[prop];
                        return;
                    }
                    if (val.param || val.depends) {
                        var keepRule = true;
                        switch (_typeof(val.depends)) {
                            case "string":
                                keepRule = !!$(val.depends, element.form).length;
                                break;
                            case "function":
                                keepRule = val.depends.call(element, element);
                                break;
                        }
                        if (keepRule) {
                            rules[prop] = val.param !== undefined ? val.param : true;
                        } else {
                            $.data(element.form, "validator").resetElements($(element));
                            delete rules[prop];
                        }
                    }
                });

                // Evaluate parameters
                $.each(rules, function (rule, parameter) {
                    rules[rule] = $.isFunction(parameter) && rule !== "normalizer" ? parameter(element) : parameter;
                });

                // Clean number parameters
                $.each(["minlength", "maxlength"], function () {
                    if (rules[this]) {
                        rules[this] = Number(rules[this]);
                    }
                });
                $.each(["rangelength", "range"], function () {
                    var parts;
                    if (rules[this]) {
                        if ($.isArray(rules[this])) {
                            rules[this] = [Number(rules[this][0]), Number(rules[this][1])];
                        } else if (typeof rules[this] === "string") {
                            parts = rules[this].replace(/[\[\]]/g, "").split(/[\s,]+/);
                            rules[this] = [Number(parts[0]), Number(parts[1])];
                        }
                    }
                });

                if ($.validator.autoCreateRanges) {

                    // Auto-create ranges
                    if (rules.min != null && rules.max != null) {
                        rules.range = [rules.min, rules.max];
                        delete rules.min;
                        delete rules.max;
                    }
                    if (rules.minlength != null && rules.maxlength != null) {
                        rules.rangelength = [rules.minlength, rules.maxlength];
                        delete rules.minlength;
                        delete rules.maxlength;
                    }
                }

                return rules;
            },

            // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true}
            normalizeRule: function normalizeRule(data) {
                if (typeof data === "string") {
                    var transformed = {};
                    $.each(data.split(/\s/), function () {
                        transformed[this] = true;
                    });
                    data = transformed;
                }
                return data;
            },

            // http://jqueryvalidation.org/jQuery.validator.addMethod/
            addMethod: function addMethod(name, method, message) {
                $.validator.methods[name] = method;
                $.validator.messages[name] = message !== undefined ? message : $.validator.messages[name];
                if (method.length < 3) {
                    $.validator.addClassRules(name, $.validator.normalizeRule(name));
                }
            },

            // http://jqueryvalidation.org/jQuery.validator.methods/
            methods: {

                // http://jqueryvalidation.org/required-method/
                required: function required(value, element, param) {

                    // Check if dependency is met
                    if (!this.depend(param, element)) {
                        return "dependency-mismatch";
                    }
                    if (element.nodeName.toLowerCase() === "select") {

                        // Could be an array for select-multiple or a string, both are fine this way
                        var val = $(element).val();
                        return val && val.length > 0;
                    }
                    if (this.checkable(element)) {
                        return this.getLength(value, element) > 0;
                    }
                    return value.length > 0;
                },

                // http://jqueryvalidation.org/email-method/
                email: function email(value, element) {

                    // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address
                    // Retrieved 2014-01-14
                    // If you have a problem with this implementation, report a bug against the above spec
                    // Or use custom methods to implement your own email validation
                    return this.optional(element) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);
                },

                // http://jqueryvalidation.org/url-method/
                url: function url(value, element) {

                    // Copyright (c) 2010-2013 Diego Perini, MIT licensed
                    // https://gist.github.com/dperini/729294
                    // see also https://mathiasbynens.be/demo/url-regex
                    // modified to allow protocol-relative URLs
                    return this.optional(element) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value);
                },

                // http://jqueryvalidation.org/date-method/
                date: function date(value, element) {
                    return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString());
                },

                // http://jqueryvalidation.org/dateISO-method/
                dateISO: function dateISO(value, element) {
                    return this.optional(element) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
                },

                // http://jqueryvalidation.org/number-method/
                number: function number(value, element) {
                    return this.optional(element) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
                },

                // http://jqueryvalidation.org/digits-method/
                digits: function digits(value, element) {
                    return this.optional(element) || /^\d+$/.test(value);
                },

                // http://jqueryvalidation.org/minlength-method/
                minlength: function minlength(value, element, param) {
                    var length = $.isArray(value) ? value.length : this.getLength(value, element);
                    return this.optional(element) || length >= param;
                },

                // http://jqueryvalidation.org/maxlength-method/
                maxlength: function maxlength(value, element, param) {
                    var length = $.isArray(value) ? value.length : this.getLength(value, element);
                    return this.optional(element) || length <= param;
                },

                // http://jqueryvalidation.org/rangelength-method/
                rangelength: function rangelength(value, element, param) {
                    var length = $.isArray(value) ? value.length : this.getLength(value, element);
                    return this.optional(element) || length >= param[0] && length <= param[1];
                },

                // http://jqueryvalidation.org/min-method/
                min: function min(value, element, param) {
                    return this.optional(element) || value >= param;
                },

                // http://jqueryvalidation.org/max-method/
                max: function max(value, element, param) {
                    return this.optional(element) || value <= param;
                },

                // http://jqueryvalidation.org/range-method/
                range: function range(value, element, param) {
                    return this.optional(element) || value >= param[0] && value <= param[1];
                },

                // http://jqueryvalidation.org/step-method/
                step: function step(value, element, param) {
                    var type = $(element).attr("type"),
                        errorMessage = "Step attribute on input type " + type + " is not supported.",
                        supportedTypes = ["text", "number", "range"],
                        re = new RegExp("\\b" + type + "\\b"),
                        notSupported = type && !re.test(supportedTypes.join());

                    // Works only for text, number and range input types
                    // TODO find a way to support input types date, datetime, datetime-local, month, time and week
                    if (notSupported) {
                        throw new Error(errorMessage);
                    }
                    return this.optional(element) || value % param === 0;
                },

                // http://jqueryvalidation.org/equalTo-method/
                equalTo: function equalTo(value, element, param) {

                    // Bind to the blur event of the target in order to revalidate whenever the target field is updated
                    var target = $(param);
                    if (this.settings.onfocusout && target.not(".validate-equalTo-blur").length) {
                        target.addClass("validate-equalTo-blur").on("blur.validate-equalTo", function () {
                            $(element).valid();
                        });
                    }
                    return value === target.val();
                },

                // http://jqueryvalidation.org/remote-method/
                remote: function remote(value, element, param, method) {
                    if (this.optional(element)) {
                        return "dependency-mismatch";
                    }

                    method = typeof method === "string" && method || "remote";

                    var previous = this.previousValue(element, method),
                        validator,
                        data,
                        optionDataString;

                    if (!this.settings.messages[element.name]) {
                        this.settings.messages[element.name] = {};
                    }
                    previous.originalMessage = previous.originalMessage || this.settings.messages[element.name][method];
                    this.settings.messages[element.name][method] = previous.message;

                    param = typeof param === "string" && { url: param } || param;
                    optionDataString = $.param($.extend({ data: value }, param.data));
                    if (previous.old === optionDataString) {
                        return previous.valid;
                    }

                    previous.old = optionDataString;
                    validator = this;
                    this.startRequest(element);
                    data = {};
                    data[element.name] = value;
                    $.ajax($.extend(true, {
                        mode: "abort",
                        port: "validate" + element.name,
                        dataType: "json",
                        data: data,
                        context: validator.currentForm,
                        success: function success(response) {
                            var valid = response === true || response === "true",
                                errors,
                                message,
                                submitted;

                            validator.settings.messages[element.name][method] = previous.originalMessage;
                            if (valid) {
                                submitted = validator.formSubmitted;
                                validator.resetInternals();
                                validator.toHide = validator.errorsFor(element);
                                validator.formSubmitted = submitted;
                                validator.successList.push(element);
                                validator.invalid[element.name] = false;
                                validator.showErrors();
                            } else {
                                errors = {};
                                message = response || validator.defaultMessage(element, { method: method, parameters: value });
                                errors[element.name] = previous.message = message;
                                validator.invalid[element.name] = true;
                                validator.showErrors(errors);
                            }
                            previous.valid = valid;
                            validator.stopRequest(element, valid);
                        }
                    }, param));
                    return "pending";
                }
            }

        });

        // Ajax mode: abort
        // usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
        // if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()

        var pendingRequests = {},
            ajax;

        // Use a prefilter if available (1.5+)
        if ($.ajaxPrefilter) {
            $.ajaxPrefilter(function (settings, _, xhr) {
                var port = settings.port;
                if (settings.mode === "abort") {
                    if (pendingRequests[port]) {
                        pendingRequests[port].abort();
                    }
                    pendingRequests[port] = xhr;
                }
            });
        } else {

            // Proxy ajax
            ajax = $.ajax;
            $.ajax = function (settings) {
                var mode = ("mode" in settings ? settings : $.ajaxSettings).mode,
                    port = ("port" in settings ? settings : $.ajaxSettings).port;
                if (mode === "abort") {
                    if (pendingRequests[port]) {
                        pendingRequests[port].abort();
                    }
                    pendingRequests[port] = ajax.apply(this, arguments);
                    return pendingRequests[port];
                }
                return ajax.apply(this, arguments);
            };
        }
    });
}(jQuery);

},{"./jquery":55}],54:[function(require,module,exports){
'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

/*!
 * @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
 * @version 1.3.4
 *
 * Date formatter utility library that allows formatting date/time variables or Date objects using PHP DateTime format.
 * This library is a standalone javascript library and does not depend on other libraries or plugins like jQuery.
 * 
 * @see http://php.net/manual/en/function.date.php
 *
 * For more JQuery plugins visit http://plugins.krajee.com
 * For more Yii related demos visit http://demos.krajee.com
 */
window.mobileAndTabletcheck = function () {
	var check = false;
	(function (a) {
		if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true;
	})(navigator.userAgent || navigator.vendor || window.opera);
	return check;
};
var DateFormatter;
(function () {
	"use strict";

	var _compare, _lpad2, _extend2, _indexOf, defaultSettings, DAY, HOUR;
	DAY = 1000 * 60 * 60 * 24;
	HOUR = 3600;

	_compare = function _compare(str1, str2) {
		return typeof str1 === 'string' && typeof str2 === 'string' && str1.toLowerCase() === str2.toLowerCase();
	};
	_lpad2 = function _lpad(value, length, chr) {
		var val = value.toString();
		chr = chr || '0';
		return val.length < length ? _lpad2(chr + val, length) : val;
	};
	_extend2 = function _extend(out) {
		var i, obj;
		out = out || {};
		for (i = 1; i < arguments.length; i++) {
			obj = arguments[i];
			if (!obj) {
				continue;
			}
			for (var key in obj) {
				if (obj.hasOwnProperty(key)) {
					if (_typeof(obj[key]) === 'object') {
						_extend2(out[key], obj[key]);
					} else {
						out[key] = obj[key];
					}
				}
			}
		}
		return out;
	};
	_indexOf = function _indexOf(val, arr) {
		for (var i = 0; i < arr.length; i++) {
			if (arr[i].toLowerCase() === val.toLowerCase()) {
				return i;
			}
		}
		return -1;
	};
	defaultSettings = {
		dateSettings: {
			days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
			daysShort: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
			months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
			monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
			meridiem: ['AM', 'PM'],
			ordinal: function ordinal(number) {
				var n = number % 10,
				    suffixes = { 1: 'st', 2: 'nd', 3: 'rd' };
				return Math.floor(number % 100 / 10) === 1 || !suffixes[n] ? 'th' : suffixes[n];
			}
		},
		separators: /[ \-+\/\.T:@]/g,
		validParts: /[dDjlNSwzWFmMntLoYyaABgGhHisueTIOPZcrU]/g,
		intParts: /[djwNzmnyYhHgGis]/g,
		tzParts: /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
		tzClip: /[^-+\dA-Z]/g
	};

	DateFormatter = function DateFormatter(options) {
		var self = this,
		    config = _extend2(defaultSettings, options);
		self.dateSettings = config.dateSettings;
		self.separators = config.separators;
		self.validParts = config.validParts;
		self.intParts = config.intParts;
		self.tzParts = config.tzParts;
		self.tzClip = config.tzClip;
	};

	DateFormatter.prototype = {
		constructor: DateFormatter,
		getMonth: function getMonth(val) {
			var self = this,
			    i;
			i = _indexOf(val, self.dateSettings.monthsShort) + 1;
			if (i === 0) {
				i = _indexOf(val, self.dateSettings.months) + 1;
			}
			return i;
		},
		parseDate: function parseDate(vDate, vFormat) {
			var self = this,
			    vFormatParts,
			    vDateParts,
			    i,
			    vDateFlag = false,
			    vTimeFlag = false,
			    vDatePart,
			    iDatePart,
			    vSettings = self.dateSettings,
			    vMonth,
			    vMeriIndex,
			    vMeriOffset,
			    len,
			    mer,
			    out = { date: null, year: null, month: null, day: null, hour: 0, min: 0, sec: 0 };
			if (!vDate) {
				return null;
			}
			if (vDate instanceof Date) {
				return vDate;
			}
			if (vFormat === 'U') {
				i = parseInt(vDate);
				return i ? new Date(i * 1000) : vDate;
			}
			switch (typeof vDate === 'undefined' ? 'undefined' : _typeof(vDate)) {
				case 'number':
					return new Date(vDate);
				case 'string':
					break;
				default:
					return null;
			}
			vFormatParts = vFormat.match(self.validParts);
			if (!vFormatParts || vFormatParts.length === 0) {
				throw new Error("Invalid date format definition.");
			}
			vDateParts = vDate.replace(self.separators, '\0').split('\0');
			for (i = 0; i < vDateParts.length; i++) {
				vDatePart = vDateParts[i];
				iDatePart = parseInt(vDatePart);
				switch (vFormatParts[i]) {
					case 'y':
					case 'Y':
						if (iDatePart) {
							len = vDatePart.length;
							out.year = len === 2 ? parseInt((iDatePart < 70 ? '20' : '19') + vDatePart) : iDatePart;
						} else {
							return null;
						}
						vDateFlag = true;
						break;
					case 'm':
					case 'n':
					case 'M':
					case 'F':
						if (isNaN(iDatePart)) {
							vMonth = self.getMonth(vDatePart);
							if (vMonth > 0) {
								out.month = vMonth;
							} else {
								return null;
							}
						} else {
							if (iDatePart >= 1 && iDatePart <= 12) {
								out.month = iDatePart;
							} else {
								return null;
							}
						}
						vDateFlag = true;
						break;
					case 'd':
					case 'j':
						if (iDatePart >= 1 && iDatePart <= 31) {
							out.day = iDatePart;
						} else {
							return null;
						}
						vDateFlag = true;
						break;
					case 'g':
					case 'h':
						vMeriIndex = vFormatParts.indexOf('a') > -1 ? vFormatParts.indexOf('a') : vFormatParts.indexOf('A') > -1 ? vFormatParts.indexOf('A') : -1;
						mer = vDateParts[vMeriIndex];
						if (vMeriIndex !== -1) {
							vMeriOffset = _compare(mer, vSettings.meridiem[0]) ? 0 : _compare(mer, vSettings.meridiem[1]) ? 12 : -1;
							if (iDatePart >= 1 && iDatePart <= 12 && vMeriOffset !== -1) {
								out.hour = iDatePart % 12 === 0 ? vMeriOffset : iDatePart + vMeriOffset;
							} else {
								if (iDatePart >= 0 && iDatePart <= 23) {
									out.hour = iDatePart;
								}
							}
						} else {
							if (iDatePart >= 0 && iDatePart <= 23) {
								out.hour = iDatePart;
							} else {
								return null;
							}
						}
						vTimeFlag = true;
						break;
					case 'G':
					case 'H':
						if (iDatePart >= 0 && iDatePart <= 23) {
							out.hour = iDatePart;
						} else {
							return null;
						}
						vTimeFlag = true;
						break;
					case 'i':
						if (iDatePart >= 0 && iDatePart <= 59) {
							out.min = iDatePart;
						} else {
							return null;
						}
						vTimeFlag = true;
						break;
					case 's':
						if (iDatePart >= 0 && iDatePart <= 59) {
							out.sec = iDatePart;
						} else {
							return null;
						}
						vTimeFlag = true;
						break;
				}
			}
			if (vDateFlag === true && out.year && out.month && out.day) {
				out.date = new Date(out.year, out.month - 1, out.day, out.hour, out.min, out.sec, 0);
			} else {
				if (vTimeFlag !== true) {
					return null;
				}
				out.date = new Date(0, 0, 0, out.hour, out.min, out.sec, 0);
			}
			return out.date;
		},
		guessDate: function guessDate(vDateStr, vFormat) {
			if (typeof vDateStr !== 'string') {
				return vDateStr;
			}
			var self = this,
			    vParts = vDateStr.replace(self.separators, '\0').split('\0'),
			    vPattern = /^[djmn]/g,
			    len,
			    vFormatParts = vFormat.match(self.validParts),
			    vDate = new Date(),
			    vDigit = 0,
			    vYear,
			    i,
			    n,
			    iPart,
			    iSec;

			if (!vPattern.test(vFormatParts[0])) {
				return vDateStr;
			}

			for (i = 0; i < vParts.length; i++) {
				vDigit = 2;
				iPart = vParts[i];
				iSec = parseInt(iPart.substr(0, 2));
				if (isNaN(iSec)) {
					return null;
				}
				switch (i) {
					case 0:
						if (vFormatParts[0] === 'm' || vFormatParts[0] === 'n') {
							vDate.setMonth(iSec - 1);
						} else {
							vDate.setDate(iSec);
						}
						break;
					case 1:
						if (vFormatParts[0] === 'm' || vFormatParts[0] === 'n') {
							vDate.setDate(iSec);
						} else {
							vDate.setMonth(iSec - 1);
						}
						break;
					case 2:
						vYear = vDate.getFullYear();
						len = iPart.length;
						vDigit = len < 4 ? len : 4;
						vYear = parseInt(len < 4 ? vYear.toString().substr(0, 4 - len) + iPart : iPart.substr(0, 4));
						if (!vYear) {
							return null;
						}
						vDate.setFullYear(vYear);
						break;
					case 3:
						vDate.setHours(iSec);
						break;
					case 4:
						vDate.setMinutes(iSec);
						break;
					case 5:
						vDate.setSeconds(iSec);
						break;
				}
				n = iPart.substr(vDigit);
				if (n.length > 0) {
					vParts.splice(i + 1, 0, n);
				}
			}
			return vDate;
		},
		parseFormat: function parseFormat(vChar, vDate) {
			var self = this,
			    vSettings = self.dateSettings,
			    fmt,
			    backslash = /\\?(.?)/gi,
			    doFormat = function doFormat(t, s) {
				return fmt[t] ? fmt[t]() : s;
			};
			fmt = {
				/////////
				// DAY //
				/////////
				/**
     * Day of month with leading 0: `01..31`
     * @return {string}
     */
				d: function d() {
					return _lpad2(fmt.j(), 2);
				},
				/**
     * Shorthand day name: `Mon...Sun`
     * @return {string}
     */
				D: function D() {
					return vSettings.daysShort[fmt.w()];
				},
				/**
     * Day of month: `1..31`
     * @return {number}
     */
				j: function j() {
					return vDate.getDate();
				},
				/**
     * Full day name: `Monday...Sunday`
     * @return {number}
     */
				l: function l() {
					return vSettings.days[fmt.w()];
				},
				/**
     * ISO-8601 day of week: `1[Mon]..7[Sun]`
     * @return {number}
     */
				N: function N() {
					return fmt.w() || 7;
				},
				/**
     * Day of week: `0[Sun]..6[Sat]`
     * @return {number}
     */
				w: function w() {
					return vDate.getDay();
				},
				/**
     * Day of year: `0..365`
     * @return {number}
     */
				z: function z() {
					var a = new Date(fmt.Y(), fmt.n() - 1, fmt.j()),
					    b = new Date(fmt.Y(), 0, 1);
					return Math.round((a - b) / DAY);
				},

				//////////
				// WEEK //
				//////////
				/**
     * ISO-8601 week number
     * @return {number}
     */
				W: function W() {
					var a = new Date(fmt.Y(), fmt.n() - 1, fmt.j() - fmt.N() + 3),
					    b = new Date(a.getFullYear(), 0, 4);
					return _lpad2(1 + Math.round((a - b) / DAY / 7), 2);
				},

				///////////
				// MONTH //
				///////////
				/**
     * Full month name: `January...December`
     * @return {string}
     */
				F: function F() {
					return vSettings.months[vDate.getMonth()];
				},
				/**
     * Month w/leading 0: `01..12`
     * @return {string}
     */
				m: function m() {
					return _lpad2(fmt.n(), 2);
				},
				/**
     * Shorthand month name; `Jan...Dec`
     * @return {string}
     */
				M: function M() {
					return vSettings.monthsShort[vDate.getMonth()];
				},
				/**
     * Month: `1...12`
     * @return {number}
     */
				n: function n() {
					return vDate.getMonth() + 1;
				},
				/**
     * Days in month: `28...31`
     * @return {number}
     */
				t: function t() {
					return new Date(fmt.Y(), fmt.n(), 0).getDate();
				},

				//////////
				// YEAR //
				//////////
				/**
     * Is leap year? `0 or 1`
     * @return {number}
     */
				L: function L() {
					var Y = fmt.Y();
					return Y % 4 === 0 && Y % 100 !== 0 || Y % 400 === 0 ? 1 : 0;
				},
				/**
     * ISO-8601 year
     * @return {number}
     */
				o: function o() {
					var n = fmt.n(),
					    W = fmt.W(),
					    Y = fmt.Y();
					return Y + (n === 12 && W < 9 ? 1 : n === 1 && W > 9 ? -1 : 0);
				},
				/**
     * Full year: `e.g. 1980...2010`
     * @return {number}
     */
				Y: function Y() {
					return vDate.getFullYear();
				},
				/**
     * Last two digits of year: `00...99`
     * @return {string}
     */
				y: function y() {
					return fmt.Y().toString().slice(-2);
				},

				//////////
				// TIME //
				//////////
				/**
     * Meridian lower: `am or pm`
     * @return {string}
     */
				a: function a() {
					return fmt.A().toLowerCase();
				},
				/**
     * Meridian upper: `AM or PM`
     * @return {string}
     */
				A: function A() {
					var n = fmt.G() < 12 ? 0 : 1;
					return vSettings.meridiem[n];
				},
				/**
     * Swatch Internet time: `000..999`
     * @return {string}
     */
				B: function B() {
					var H = vDate.getUTCHours() * HOUR,
					    i = vDate.getUTCMinutes() * 60,
					    s = vDate.getUTCSeconds();
					return _lpad2(Math.floor((H + i + s + HOUR) / 86.4) % 1000, 3);
				},
				/**
     * 12-Hours: `1..12`
     * @return {number}
     */
				g: function g() {
					return fmt.G() % 12 || 12;
				},
				/**
     * 24-Hours: `0..23`
     * @return {number}
     */
				G: function G() {
					return vDate.getHours();
				},
				/**
     * 12-Hours with leading 0: `01..12`
     * @return {string}
     */
				h: function h() {
					return _lpad2(fmt.g(), 2);
				},
				/**
     * 24-Hours w/leading 0: `00..23`
     * @return {string}
     */
				H: function H() {
					return _lpad2(fmt.G(), 2);
				},
				/**
     * Minutes w/leading 0: `00..59`
     * @return {string}
     */
				i: function i() {
					return _lpad2(vDate.getMinutes(), 2);
				},
				/**
     * Seconds w/leading 0: `00..59`
     * @return {string}
     */
				s: function s() {
					return _lpad2(vDate.getSeconds(), 2);
				},
				/**
     * Microseconds: `000000-999000`
     * @return {string}
     */
				u: function u() {
					return _lpad2(vDate.getMilliseconds() * 1000, 6);
				},

				//////////////
				// TIMEZONE //
				//////////////
				/**
     * Timezone identifier: `e.g. Atlantic/Azores, ...`
     * @return {string}
     */
				e: function e() {
					var str = /\((.*)\)/.exec(String(vDate))[1];
					return str || 'Coordinated Universal Time';
				},
				/**
     * DST observed? `0 or 1`
     * @return {number}
     */
				I: function I() {
					var a = new Date(fmt.Y(), 0),
					    c = Date.UTC(fmt.Y(), 0),
					    b = new Date(fmt.Y(), 6),
					    d = Date.UTC(fmt.Y(), 6);
					return a - c !== b - d ? 1 : 0;
				},
				/**
     * Difference to GMT in hour format: `e.g. +0200`
     * @return {string}
     */
				O: function O() {
					var tzo = vDate.getTimezoneOffset(),
					    a = Math.abs(tzo);
					return (tzo > 0 ? '-' : '+') + _lpad2(Math.floor(a / 60) * 100 + a % 60, 4);
				},
				/**
     * Difference to GMT with colon: `e.g. +02:00`
     * @return {string}
     */
				P: function P() {
					var O = fmt.O();
					return O.substr(0, 3) + ':' + O.substr(3, 2);
				},
				/**
     * Timezone abbreviation: `e.g. EST, MDT, ...`
     * @return {string}
     */
				T: function T() {
					var str = (String(vDate).match(self.tzParts) || [""]).pop().replace(self.tzClip, "");
					return str || 'UTC';
				},
				/**
     * Timezone offset in seconds: `-43200...50400`
     * @return {number}
     */
				Z: function Z() {
					return -vDate.getTimezoneOffset() * 60;
				},

				////////////////////
				// FULL DATE TIME //
				////////////////////
				/**
     * ISO-8601 date
     * @return {string}
     */
				c: function c() {
					return 'Y-m-d\\TH:i:sP'.replace(backslash, doFormat);
				},
				/**
     * RFC 2822 date
     * @return {string}
     */
				r: function r() {
					return 'D, d M Y H:i:s O'.replace(backslash, doFormat);
				},
				/**
     * Seconds since UNIX epoch
     * @return {number}
     */
				U: function U() {
					return vDate.getTime() / 1000 || 0;
				}
			};
			return doFormat(vChar, vChar);
		},
		formatDate: function formatDate(vDate, vFormat) {
			var self = this,
			    i,
			    n,
			    len,
			    str,
			    vChar,
			    vDateStr = '',
			    BACKSLASH = '\\';
			if (typeof vDate === 'string') {
				vDate = self.parseDate(vDate, vFormat);
				if (!vDate) {
					return null;
				}
			}
			if (vDate instanceof Date) {
				len = vFormat.length;
				for (i = 0; i < len; i++) {
					vChar = vFormat.charAt(i);
					if (vChar === 'S' || vChar === BACKSLASH) {
						continue;
					}
					if (i > 0 && vFormat.charAt(i - 1) === BACKSLASH) {
						vDateStr += vChar;
						continue;
					}
					str = self.parseFormat(vChar, vDate);
					if (i !== len - 1 && self.intParts.test(vChar) && vFormat.charAt(i + 1) === 'S') {
						n = parseInt(str) || 0;
						str += self.dateSettings.ordinal(n);
					}
					vDateStr += str;
				}
				return vDateStr;
			}
			return '';
		}
	};
})();
/**
 * @preserve jQuery DateTimePicker plugin v2.5.4
 * @homepage http://xdsoft.net/jqplugins/datetimepicker/
 * @author Chupurnov Valeriy (<chupurnov@gmail.com>)
 */
/*global DateFormatter, document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/
;(function (factory) {
	factory(jQuery);
})(function ($) {
	'use strict';

	var default_options = {
		i18n: {
			ar: { // Arabic
				months: ["كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"],
				dayOfWeekShort: ["ن", "ث", "ع", "خ", "ج", "س", "ح"],
				dayOfWeek: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت", "الأحد"]
			},
			ro: { // Romanian
				months: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"],
				dayOfWeekShort: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ"],
				dayOfWeek: ["Duminică", "Luni", "Marţi", "Miercuri", "Joi", "Vineri", "Sâmbătă"]
			},
			id: { // Indonesian
				months: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"],
				dayOfWeekShort: ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"],
				dayOfWeek: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"]
			},
			is: { // Icelandic
				months: ["Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember"],
				dayOfWeekShort: ["Sun", "Mán", "Þrið", "Mið", "Fim", "Fös", "Lau"],
				dayOfWeek: ["Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur"]
			},
			bg: { // Bulgarian
				months: ["Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"],
				dayOfWeekShort: ["Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"],
				dayOfWeek: ["Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота"]
			},
			fa: { // Persian/Farsi
				months: ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'],
				dayOfWeekShort: ['یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'],
				dayOfWeek: ["یک‌شنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", "پنج‌شنبه", "جمعه", "شنبه", "یک‌شنبه"]
			},
			ru: { // Russian
				months: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
				dayOfWeekShort: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"],
				dayOfWeek: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"]
			},
			uk: { // Ukrainian
				months: ['Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'],
				dayOfWeekShort: ["Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт"],
				dayOfWeek: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"]
			},
			en: { // English
				months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
				dayOfWeekShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
				dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
			},
			el: { // Ελληνικά
				months: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"],
				dayOfWeekShort: ["Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ"],
				dayOfWeek: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"]
			},
			de: { // German
				months: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
				dayOfWeekShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
				dayOfWeek: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"]
			},
			nl: { // Dutch
				months: ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"],
				dayOfWeekShort: ["zo", "ma", "di", "wo", "do", "vr", "za"],
				dayOfWeek: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"]
			},
			tr: { // Turkish
				months: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"],
				dayOfWeekShort: ["Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"],
				dayOfWeek: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"]
			},
			fr: { //French
				months: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"],
				dayOfWeekShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"],
				dayOfWeek: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"]
			},
			es: { // Spanish
				months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
				dayOfWeekShort: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"],
				dayOfWeek: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"]
			},
			th: { // Thai
				months: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'],
				dayOfWeekShort: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'],
				dayOfWeek: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุกร์", "เสาร์", "อาทิตย์"]
			},
			pl: { // Polish
				months: ["styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień"],
				dayOfWeekShort: ["nd", "pn", "wt", "śr", "cz", "pt", "sb"],
				dayOfWeek: ["niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"]
			},
			pt: { // Portuguese
				months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
				dayOfWeekShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"],
				dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"]
			},
			ch: { // Simplified Chinese
				months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
				dayOfWeekShort: ["日", "一", "二", "三", "四", "五", "六"]
			},
			se: { // Swedish
				months: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"],
				dayOfWeekShort: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"]
			},
			km: { // Khmer
				months: ["មករា​", "កុម្ភៈ", "មិនា​", "មេសា​", "ឧសភា​", "មិថុនា​", "កក្កដា​", "សីហា​", "កញ្ញា​", "តុលា​", "វិច្ឋិកា​", "ធ្នូ​"],
				dayOfWeekShort: ["អាទិ​", "ចន្ទ​", "អង្គារ​", "ពុធ​", "ព្រហ​​", "សុក្រ​", "សៅរ៍"],
				dayOfWeek: ["អាទិត្យ​", "ចន្ទ​", "អង្គារ​", "ពុធ​", "ព្រហស្បតិ៍​", "សុក្រ​", "សៅរ៍"]
			},
			kr: { // Korean
				months: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"],
				dayOfWeekShort: ["일", "월", "화", "수", "목", "금", "토"],
				dayOfWeek: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"]
			},
			it: { // Italian
				months: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"],
				dayOfWeekShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"],
				dayOfWeek: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"]
			},
			da: { // Dansk
				months: ["January", "Februar", "Marts", "April", "Maj", "Juni", "July", "August", "September", "Oktober", "November", "December"],
				dayOfWeekShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"],
				dayOfWeek: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"]
			},
			no: { // Norwegian
				months: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"],
				dayOfWeekShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"],
				dayOfWeek: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag']
			},
			ja: { // Japanese
				months: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
				dayOfWeekShort: ["日", "月", "火", "水", "木", "金", "土"],
				dayOfWeek: ["日曜", "月曜", "火曜", "水曜", "木曜", "金曜", "土曜"]
			},
			vi: { // Vietnamese
				months: ["Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12"],
				dayOfWeekShort: ["CN", "T2", "T3", "T4", "T5", "T6", "T7"],
				dayOfWeek: ["Chủ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy"]
			},
			sl: { // Slovenščina
				months: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"],
				dayOfWeekShort: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"],
				dayOfWeek: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"]
			},
			cs: { // Čeština
				months: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"],
				dayOfWeekShort: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So"]
			},
			hu: { // Hungarian
				months: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"],
				dayOfWeekShort: ["Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo"],
				dayOfWeek: ["vasárnap", "hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat"]
			},
			az: { //Azerbaijanian (Azeri)
				months: ["Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr"],
				dayOfWeekShort: ["B", "Be", "Ça", "Ç", "Ca", "C", "Ş"],
				dayOfWeek: ["Bazar", "Bazar ertəsi", "Çərşənbə axşamı", "Çərşənbə", "Cümə axşamı", "Cümə", "Şənbə"]
			},
			bs: { //Bosanski
				months: ["Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"],
				dayOfWeekShort: ["Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"],
				dayOfWeek: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"]
			},
			ca: { //Català
				months: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"],
				dayOfWeekShort: ["Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds"],
				dayOfWeek: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"]
			},
			'en-GB': { //English (British)
				months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
				dayOfWeekShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
				dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
			},
			et: { //"Eesti"
				months: ["Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"],
				dayOfWeekShort: ["P", "E", "T", "K", "N", "R", "L"],
				dayOfWeek: ["Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev"]
			},
			eu: { //Euskara
				months: ["Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua"],
				dayOfWeekShort: ["Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La."],
				dayOfWeek: ['Igandea', 'Astelehena', 'Asteartea', 'Asteazkena', 'Osteguna', 'Ostirala', 'Larunbata']
			},
			fi: { //Finnish (Suomi)
				months: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"],
				dayOfWeekShort: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"],
				dayOfWeek: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"]
			},
			gl: { //Galego
				months: ["Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec"],
				dayOfWeekShort: ["Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab"],
				dayOfWeek: ["Domingo", "Luns", "Martes", "Mércores", "Xoves", "Venres", "Sábado"]
			},
			hr: { //Hrvatski
				months: ["Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"],
				dayOfWeekShort: ["Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"],
				dayOfWeek: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"]
			},
			ko: { //Korean (한국어)
				months: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"],
				dayOfWeekShort: ["일", "월", "화", "수", "목", "금", "토"],
				dayOfWeek: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"]
			},
			lt: { //Lithuanian (lietuvių)
				months: ["Sausio", "Vasario", "Kovo", "Balandžio", "Gegužės", "Birželio", "Liepos", "Rugpjūčio", "Rugsėjo", "Spalio", "Lapkričio", "Gruodžio"],
				dayOfWeekShort: ["Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš"],
				dayOfWeek: ["Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis"]
			},
			lv: { //Latvian (Latviešu)
				months: ["Janvāris", "Februāris", "Marts", "Aprīlis ", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"],
				dayOfWeekShort: ["Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St"],
				dayOfWeek: ["Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena"]
			},
			mk: { //Macedonian (Македонски)
				months: ["јануари", "февруари", "март", "април", "мај", "јуни", "јули", "август", "септември", "октомври", "ноември", "декември"],
				dayOfWeekShort: ["нед", "пон", "вто", "сре", "чет", "пет", "саб"],
				dayOfWeek: ["Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота"]
			},
			mn: { //Mongolian (Монгол)
				months: ["1-р сар", "2-р сар", "3-р сар", "4-р сар", "5-р сар", "6-р сар", "7-р сар", "8-р сар", "9-р сар", "10-р сар", "11-р сар", "12-р сар"],
				dayOfWeekShort: ["Дав", "Мяг", "Лха", "Пүр", "Бсн", "Бям", "Ням"],
				dayOfWeek: ["Даваа", "Мягмар", "Лхагва", "Пүрэв", "Баасан", "Бямба", "Ням"]
			},
			'pt-BR': { //Português(Brasil)
				months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
				dayOfWeekShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"],
				dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"]
			},
			sk: { //Slovenčina
				months: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"],
				dayOfWeekShort: ["Ne", "Po", "Ut", "St", "Št", "Pi", "So"],
				dayOfWeek: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"]
			},
			sq: { //Albanian (Shqip)
				months: ["Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor"],
				dayOfWeekShort: ["Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Shtu"],
				dayOfWeek: ["E Diel", "E Hënë", "E Martē", "E Mërkurë", "E Enjte", "E Premte", "E Shtunë"]
			},
			'sr-YU': { //Serbian (Srpski)
				months: ["Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"],
				dayOfWeekShort: ["Ned", "Pon", "Uto", "Sre", "čet", "Pet", "Sub"],
				dayOfWeek: ["Nedelja", "Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota"]
			},
			sr: { //Serbian Cyrillic (Српски)
				months: ["јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар"],
				dayOfWeekShort: ["нед", "пон", "уто", "сре", "чет", "пет", "суб"],
				dayOfWeek: ["Недеља", "Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота"]
			},
			sv: { //Svenska
				months: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"],
				dayOfWeekShort: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"],
				dayOfWeek: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"]
			},
			'zh-TW': { //Traditional Chinese (繁體中文)
				months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
				dayOfWeekShort: ["日", "一", "二", "三", "四", "五", "六"],
				dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
			},
			zh: { //Simplified Chinese (简体中文)
				months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
				dayOfWeekShort: ["日", "一", "二", "三", "四", "五", "六"],
				dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
			},
			he: { //Hebrew (עברית)
				months: ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'],
				dayOfWeekShort: ['א\'', 'ב\'', 'ג\'', 'ד\'', 'ה\'', 'ו\'', 'שבת'],
				dayOfWeek: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת", "ראשון"]
			},
			hy: { // Armenian
				months: ["Հունվար", "Փետրվար", "Մարտ", "Ապրիլ", "Մայիս", "Հունիս", "Հուլիս", "Օգոստոս", "Սեպտեմբեր", "Հոկտեմբեր", "Նոյեմբեր", "Դեկտեմբեր"],
				dayOfWeekShort: ["Կի", "Երկ", "Երք", "Չոր", "Հնգ", "Ուրբ", "Շբթ"],
				dayOfWeek: ["Կիրակի", "Երկուշաբթի", "Երեքշաբթի", "Չորեքշաբթի", "Հինգշաբթի", "Ուրբաթ", "Շաբաթ"]
			},
			kg: { // Kyrgyz
				months: ['Үчтүн айы', 'Бирдин айы', 'Жалган Куран', 'Чын Куран', 'Бугу', 'Кулжа', 'Теке', 'Баш Оона', 'Аяк Оона', 'Тогуздун айы', 'Жетинин айы', 'Бештин айы'],
				dayOfWeekShort: ["Жек", "Дүй", "Шей", "Шар", "Бей", "Жум", "Ише"],
				dayOfWeek: ["Жекшемб", "Дүйшөмб", "Шейшемб", "Шаршемб", "Бейшемби", "Жума", "Ишенб"]
			},
			rm: { // Romansh
				months: ["Schaner", "Favrer", "Mars", "Avrigl", "Matg", "Zercladur", "Fanadur", "Avust", "Settember", "October", "November", "December"],
				dayOfWeekShort: ["Du", "Gli", "Ma", "Me", "Gie", "Ve", "So"],
				dayOfWeek: ["Dumengia", "Glindesdi", "Mardi", "Mesemna", "Gievgia", "Venderdi", "Sonda"]
			},
			ka: { // Georgian
				months: ['იანვარი', 'თებერვალი', 'მარტი', 'აპრილი', 'მაისი', 'ივნისი', 'ივლისი', 'აგვისტო', 'სექტემბერი', 'ოქტომბერი', 'ნოემბერი', 'დეკემბერი'],
				dayOfWeekShort: ["კვ", "ორშ", "სამშ", "ოთხ", "ხუთ", "პარ", "შაბ"],
				dayOfWeek: ["კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი"]
			}
		},

		ownerDocument: document,
		contentWindow: window,

		value: '',
		rtl: false,

		format: 'Y/m/d H:i',
		formatTime: 'H:i',
		formatDate: 'Y/m/d',

		startDate: false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05',
		step: 60,
		monthChangeSpinner: true,

		closeOnDateSelect: false,
		closeOnTimeSelect: true,
		closeOnWithoutClick: true,
		closeOnInputClick: true,

		timepicker: true,
		datepicker: true,
		weeks: false,

		defaultTime: false, // use formatTime format (ex. '10:00' for formatTime:	'H:i')
		defaultDate: false, // use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05')

		minDate: false,
		maxDate: false,
		minTime: false,
		maxTime: false,
		disabledMinTime: false,
		disabledMaxTime: false,

		allowTimes: [],
		opened: false,
		initTime: true,
		inline: false,
		theme: '',

		onSelectDate: function onSelectDate() {},
		onSelectTime: function onSelectTime() {},
		onChangeMonth: function onChangeMonth() {},
		onGetWeekOfYear: function onGetWeekOfYear() {},
		onChangeYear: function onChangeYear() {},
		onChangeDateTime: function onChangeDateTime() {},
		onShow: function onShow() {},
		onClose: function onClose() {},
		onGenerate: function onGenerate() {},

		withoutCopyright: true,
		inverseButton: false,
		hours12: false,
		next: 'xdsoft_next',
		prev: 'xdsoft_prev',
		dayOfWeekStart: 0,
		parentID: 'body',
		timeHeightInTimePicker: 25,
		timepickerScrollbar: true,
		todayButton: true,
		prevButton: true,
		nextButton: true,
		defaultSelect: true,

		scrollMonth: true,
		scrollTime: true,
		scrollInput: true,

		lazyInit: false,
		mask: false,
		validateOnBlur: true,
		allowBlank: true,
		yearStart: 1950,
		yearEnd: 2050,
		monthStart: 0,
		monthEnd: 11,
		style: '',
		id: '',
		fixed: false,
		roundTime: 'round', // ceil, floor
		className: '',
		weekends: [],
		highlightedDates: [],
		highlightedPeriods: [],
		allowDates: [],
		allowDateRe: null,
		disabledDates: [],
		disabledWeekDays: [],
		yearOffset: 0,
		beforeShowDay: null,

		enterLikeTab: true,
		showApplyButton: false
	};

	var dateHelper = null,
	    globalLocaleDefault = 'en',
	    globalLocale = 'en';

	var dateFormatterOptionsDefault = {
		meridiem: ['AM', 'PM']
	};

	// This seems to be the main function - it might be formatting the date, but it's also doing a lot of other stuff, such
	// as kicking off the jQuery UI calendar plugin, somehow.
	var initDateFormatter = function initDateFormatter() {
		var locale = default_options.i18n[globalLocale],
		    opts = {
			days: locale.dayOfWeek,
			daysShort: locale.dayOfWeekShort,
			months: locale.months,
			monthsShort: $.map(locale.months, function (n) {
				return n.substring(0, 3);
			})
		};

		if (typeof DateFormatter === 'function') {
			dateHelper = new DateFormatter({
				dateSettings: $.extend({}, dateFormatterOptionsDefault, opts)
			});
		}
	};

	// for locale settings
	$.datetimepicker = {
		setLocale: function setLocale(locale) {
			var newLocale = default_options.i18n[locale] ? locale : globalLocaleDefault;
			if (globalLocale !== newLocale) {
				globalLocale = newLocale;
				// reinit date formatter
				initDateFormatter();
			}
		},
		setDateFormatter: function setDateFormatter(dateFormatter) {
			dateHelper = dateFormatter;
		},
		RFC_2822: 'D, d M Y H:i:s O',
		ATOM: 'Y-m-d\TH:i:sP',
		ISO_8601: 'Y-m-d\TH:i:sO',
		RFC_822: 'D, d M y H:i:s O',
		RFC_850: 'l, d-M-y H:i:s T',
		RFC_1036: 'D, d M y H:i:s O',
		RFC_1123: 'D, d M Y H:i:s O',
		RSS: 'D, d M Y H:i:s O',
		W3C: 'Y-m-d\TH:i:sP'
	};

	// Only do this, if native support doesn't exist
	if (!Modernizr.inputtypes["datetime-local"]) {
		// first init date formatter
		initDateFormatter();
	}

	// fix for ie8
	if (!window.getComputedStyle) {
		window.getComputedStyle = function (el, pseudo) {
			this.el = el;
			this.getPropertyValue = function (prop) {
				var re = /(\-([a-z]){1})/g;
				if (prop === 'float') {
					prop = 'styleFloat';
				}
				if (re.test(prop)) {
					prop = prop.replace(re, function (a, b, c) {
						return c.toUpperCase();
					});
				}
				return el.currentStyle[prop] || null;
			};
			return this;
		};
	}
	if (!Array.prototype.indexOf) {
		Array.prototype.indexOf = function (obj, start) {
			var i, j;
			for (i = start || 0, j = this.length; i < j; i += 1) {
				if (this[i] === obj) {
					return i;
				}
			}
			return -1;
		};
	}
	Date.prototype.countDaysInMonth = function () {
		return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate();
	};
	$.fn.xdsoftScroller = function (options, percent) {
		return this.each(function () {
			var timeboxparent = $(this),
			    pointerEventToXY = function pointerEventToXY(e) {
				var out = { x: 0, y: 0 },
				    touch;
				if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') {
					touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
					out.x = touch.clientX;
					out.y = touch.clientY;
				} else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') {
					out.x = e.clientX;
					out.y = e.clientY;
				}
				return out;
			},
			    timebox,
			    parentHeight,
			    height,
			    scrollbar,
			    scroller,
			    maximumOffset = 100,
			    start = false,
			    startY = 0,
			    startTop = 0,
			    h1 = 0,
			    touchStart = false,
			    startTopScroll = 0,
			    calcOffset = function calcOffset() {};
			if (percent === 'hide') {
				timeboxparent.find('.xdsoft_scrollbar').hide();
				return;
			}
			if (!$(this).hasClass('xdsoft_scroller_box')) {
				timebox = timeboxparent.children().eq(0);
				parentHeight = timeboxparent[0].clientHeight;
				height = timebox[0].offsetHeight;
				scrollbar = $('<div class="xdsoft_scrollbar"></div>');
				scroller = $('<div class="xdsoft_scroller"></div>');
				scrollbar.append(scroller);

				timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar);
				calcOffset = function calcOffset(event) {
					var offset = pointerEventToXY(event).y - startY + startTopScroll;
					if (offset < 0) {
						offset = 0;
					}
					if (offset + scroller[0].offsetHeight > h1) {
						offset = h1 - scroller[0].offsetHeight;
					}
					timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]);
				};

				scroller.on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) {
					if (!parentHeight) {
						timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
					}

					startY = pointerEventToXY(event).y;
					startTopScroll = parseInt(scroller.css('margin-top'), 10);
					h1 = scrollbar[0].offsetHeight;

					if (event.type === 'mousedown' || event.type === 'touchstart') {
						if (options.ownerDocument) {
							$(options.ownerDocument.body).addClass('xdsoft_noselect');
						}
						$([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft_scroller', function arguments_callee() {
							$([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft_scroller', arguments_callee).off('mousemove.xdsoft_scroller', calcOffset).removeClass('xdsoft_noselect');
						});
						$(options.ownerDocument.body).on('mousemove.xdsoft_scroller', calcOffset);
					} else {
						touchStart = true;
						event.stopPropagation();
						event.preventDefault();
					}
				}).on('touchmove', function (event) {
					if (touchStart) {
						event.preventDefault();
						calcOffset(event);
					}
				}).on('touchend touchcancel', function () {
					touchStart = false;
					startTopScroll = 0;
				});

				timeboxparent.on('scroll_element.xdsoft_scroller', function (event, percentage) {
					if (!parentHeight) {
						timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]);
					}
					percentage = percentage > 1 ? 1 : percentage < 0 || isNaN(percentage) ? 0 : percentage;

					scroller.css('margin-top', maximumOffset * percentage);

					setTimeout(function () {
						timebox.css('marginTop', -parseInt((timebox[0].offsetHeight - parentHeight) * percentage, 10));
					}, 10);
				}).on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) {
					var percent, sh;
					parentHeight = timeboxparent[0].clientHeight;
					height = timebox[0].offsetHeight;
					percent = parentHeight / height;
					sh = percent * scrollbar[0].offsetHeight;
					if (percent > 1) {
						scroller.hide();
					} else {
						scroller.show();
						scroller.css('height', parseInt(sh > 10 ? sh : 10, 10));
						maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight;
						if (noTriggerScroll !== true) {
							timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || Math.abs(parseInt(timebox.css('marginTop'), 10)) / (height - parentHeight)]);
						}
					}
				});

				timeboxparent.on('mousewheel', function (event) {
					var top = Math.abs(parseInt(timebox.css('marginTop'), 10));

					top = top - event.deltaY * 20;
					if (top < 0) {
						top = 0;
					}

					timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]);
					event.stopPropagation();
					return false;
				});

				timeboxparent.on('touchstart', function (event) {
					start = pointerEventToXY(event);
					startTop = Math.abs(parseInt(timebox.css('marginTop'), 10));
				});

				timeboxparent.on('touchmove', function (event) {
					if (start) {
						event.preventDefault();
						var coord = pointerEventToXY(event);
						timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]);
					}
				});

				timeboxparent.on('touchend touchcancel', function () {
					start = false;
					startTop = 0;
				});
			}
			timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
		});
	};

	$.fn.datetimepicker = function (opt, opt2) {

		var result = this,
		    KEY0 = 48,
		    KEY9 = 57,
		    _KEY0 = 96,
		    _KEY9 = 105,
		    CTRLKEY = 17,
		    DEL = 46,
		    ENTER = 13,
		    ESC = 27,
		    BACKSPACE = 8,
		    ARROWLEFT = 37,
		    ARROWUP = 38,
		    ARROWRIGHT = 39,
		    ARROWDOWN = 40,
		    TAB = 9,
		    F5 = 116,
		    AKEY = 65,
		    CKEY = 67,
		    VKEY = 86,
		    ZKEY = 90,
		    YKEY = 89,
		    ctrlDown = false,
		    options = $.isPlainObject(opt) || !opt ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options),
		    lazyInitTimer = 0,
		    createDateTimePicker,
		    destroyDateTimePicker,
		    lazyInit = function lazyInit(input) {
			input.on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function initOnActionCallback() {
				if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) {
					return;
				}
				clearTimeout(lazyInitTimer);
				lazyInitTimer = setTimeout(function () {

					if (!input.data('xdsoft_datetimepicker')) {
						createDateTimePicker(input);
					}
					input.off('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', initOnActionCallback).trigger('open.xdsoft');
				}, 100);
			});
		};
		if (window.mobileAndTabletcheck()) {
			if (options.datepicker) {
				if (options.timepicker) {
					$(this).attr('type', 'datetime-local');
				} else {
					$(this).attr('type', 'date');
				}
			} else {
				$(this).attr('type', 'time');
			}

			return result;
		}
		createDateTimePicker = function createDateTimePicker(input) {
			var datetimepicker = $('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'),
			    xdsoft_copyright = $('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),
			    datepicker = $('<div class="xdsoft_datepicker active"></div>'),
			    month_picker = $('<div class="xdsoft_monthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button>' + '<div class="xdsoft_label xdsoft_month"><span></span><i></i></div>' + '<div class="xdsoft_label xdsoft_year"><span></span><i></i></div>' + '<button type="button" class="xdsoft_next"></button></div>'),
			    calendar = $('<div class="xdsoft_calendar"></div>'),
			    timepicker = $('<div class="xdsoft_timepicker active"><button type="button" class="xdsoft_prev"></button><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div>'),
			    timeboxparent = timepicker.find('.xdsoft_time_box').eq(0),
			    timebox = $('<div class="xdsoft_time_variant"></div>'),
			    applyButton = $('<button type="button" class="xdsoft_save_selected blue-gradient-button">Save Selected</button>'),
			    monthselect = $('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),
			    yearselect = $('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),
			    triggerAfterOpen = false,
			    XDSoft_datetime,
			    xchangeTimer,
			    timerclick,
			    current_time_index,
			    setPos,
			    timer = 0,
			    _xdsoft_datetime,
			    forEachAncestorOf,
			    throttle;

			if (options.id) {
				datetimepicker.attr('id', options.id);
			}
			if (options.style) {
				datetimepicker.attr('style', options.style);
			}
			if (options.weeks) {
				datetimepicker.addClass('xdsoft_showweeks');
			}
			if (options.rtl) {
				datetimepicker.addClass('xdsoft_rtl');
			}

			datetimepicker.addClass('xdsoft_' + options.theme);
			datetimepicker.addClass(options.className);

			month_picker.find('.xdsoft_month span').after(monthselect);
			month_picker.find('.xdsoft_year span').after(yearselect);

			month_picker.find('.xdsoft_month,.xdsoft_year').on('touchstart mousedown.xdsoft', function (event) {
				var select = $(this).find('.xdsoft_select').eq(0),
				    val = 0,
				    top = 0,
				    visible = select.is(':visible'),
				    items,
				    i;

				month_picker.find('.xdsoft_select').hide();
				if (_xdsoft_datetime.currentTime) {
					val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear']();
				}

				select[visible ? 'hide' : 'show']();
				for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) {
					if (items.eq(i).data('value') === val) {
						break;
					} else {
						top += items[0].offsetHeight;
					}
				}

				select.xdsoftScroller(options, top / (select.children()[0].offsetHeight - select[0].clientHeight));
				event.stopPropagation();
				return false;
			});

			month_picker.find('.xdsoft_select').xdsoftScroller(options).on('touchstart mousedown.xdsoft', function (event) {
				event.stopPropagation();
				event.preventDefault();
			}).on('touchstart mousedown.xdsoft', '.xdsoft_option', function () {
				if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
					_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
				}

				var year = _xdsoft_datetime.currentTime.getFullYear();
				if (_xdsoft_datetime && _xdsoft_datetime.currentTime) {
					_xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value'));
				}

				$(this).parent().parent().hide();

				datetimepicker.trigger('xchange.xdsoft');
				if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
					options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
				}

				if (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
					options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
				}
			});

			datetimepicker.getValue = function () {
				return _xdsoft_datetime.getCurrentTime();
			};

			datetimepicker.setOptions = function (_options) {
				var highlightedDates = {};

				options = $.extend(true, {}, options, _options);

				if (_options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length) {
					options.allowTimes = $.extend(true, [], _options.allowTimes);
				}

				if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) {
					options.weekends = $.extend(true, [], _options.weekends);
				}

				if (_options.allowDates && $.isArray(_options.allowDates) && _options.allowDates.length) {
					options.allowDates = $.extend(true, [], _options.allowDates);
				}

				if (_options.allowDateRe && Object.prototype.toString.call(_options.allowDateRe) === "[object String]") {
					options.allowDateRe = new RegExp(_options.allowDateRe);
				}

				if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) {
					$.each(_options.highlightedDates, function (index, value) {
						var splitData = $.map(value.split(','), $.trim),
						    exDesc,
						    hDate = new HighlightedDate(dateHelper.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]),
						    // date, desc, style
						keyDate = dateHelper.formatDate(hDate.date, options.formatDate);
						if (highlightedDates[keyDate] !== undefined) {
							exDesc = highlightedDates[keyDate].desc;
							if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
								highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
							}
						} else {
							highlightedDates[keyDate] = hDate;
						}
					});

					options.highlightedDates = $.extend(true, [], highlightedDates);
				}

				if (_options.highlightedPeriods && $.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) {
					highlightedDates = $.extend(true, [], options.highlightedDates);
					$.each(_options.highlightedPeriods, function (index, value) {
						var dateTest, // start date
						dateEnd, desc, hDate, keyDate, exDesc, style;
						if ($.isArray(value)) {
							dateTest = value[0];
							dateEnd = value[1];
							desc = value[2];
							style = value[3];
						} else {
							var splitData = $.map(value.split(','), $.trim);
							dateTest = dateHelper.parseDate(splitData[0], options.formatDate);
							dateEnd = dateHelper.parseDate(splitData[1], options.formatDate);
							desc = splitData[2];
							style = splitData[3];
						}

						while (dateTest <= dateEnd) {
							hDate = new HighlightedDate(dateTest, desc, style);
							keyDate = dateHelper.formatDate(dateTest, options.formatDate);
							dateTest.setDate(dateTest.getDate() + 1);
							if (highlightedDates[keyDate] !== undefined) {
								exDesc = highlightedDates[keyDate].desc;
								if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
									highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
								}
							} else {
								highlightedDates[keyDate] = hDate;
							}
						}
					});

					options.highlightedDates = $.extend(true, [], highlightedDates);
				}

				if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) {
					options.disabledDates = $.extend(true, [], _options.disabledDates);
				}

				if (_options.disabledWeekDays && $.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) {
					options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays);
				}

				if ((options.open || options.opened) && !options.inline) {
					input.trigger('open.xdsoft');
				}

				if (options.inline) {
					triggerAfterOpen = true;
					datetimepicker.addClass('xdsoft_inline');
					input.after(datetimepicker).hide();
				}

				if (options.inverseButton) {
					options.next = 'xdsoft_prev';
					options.prev = 'xdsoft_next';
				}

				if (options.datepicker) {
					datepicker.addClass('active');
				} else {
					datepicker.removeClass('active');
				}

				if (options.timepicker) {
					timepicker.addClass('active');
				} else {
					timepicker.removeClass('active');
				}

				if (options.value) {
					_xdsoft_datetime.setCurrentTime(options.value);
					if (input && input.val) {
						input.val(_xdsoft_datetime.str);
					}
				}

				if (isNaN(options.dayOfWeekStart)) {
					options.dayOfWeekStart = 0;
				} else {
					options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7;
				}

				if (!options.timepickerScrollbar) {
					timeboxparent.xdsoftScroller(options, 'hide');
				}

				if (options.minDate && /^[\+\-](.*)$/.test(options.minDate)) {
					options.minDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.minDate), options.formatDate);
				}

				if (options.maxDate && /^[\+\-](.*)$/.test(options.maxDate)) {
					options.maxDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate), options.formatDate);
				}

				applyButton.toggle(options.showApplyButton);

				month_picker.find('.xdsoft_today_button').css('visibility', !options.todayButton ? 'hidden' : 'visible');

				month_picker.find('.' + options.prev).css('visibility', !options.prevButton ? 'hidden' : 'visible');

				month_picker.find('.' + options.next).css('visibility', !options.nextButton ? 'hidden' : 'visible');

				setMask(options);

				if (options.validateOnBlur) {
					input.off('blur.xdsoft').on('blur.xdsoft', function () {
						if (options.allowBlank && (!$.trim($(this).val()).length || typeof options.mask == "string" && $.trim($(this).val()) === options.mask.replace(/[0-9]/g, '_'))) {
							$(this).val(null);
							datetimepicker.data('xdsoft_datetime').empty();
						} else {
							var d = dateHelper.parseDate($(this).val(), options.format);
							if (d) {
								// parseDate() may skip some invalid parts like date or time, so make it clear for user: show parsed date/time
								$(this).val(dateHelper.formatDate(d, options.format));
							} else {
								var splittedHours = +[$(this).val()[0], $(this).val()[1]].join(''),
								    splittedMinutes = +[$(this).val()[2], $(this).val()[3]].join('');

								// parse the numbers as 0312 => 03:12
								if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) {
									$(this).val([splittedHours, splittedMinutes].map(function (item) {
										return item > 9 ? item : '0' + item;
									}).join(':'));
								} else {
									$(this).val(dateHelper.formatDate(_xdsoft_datetime.now(), options.format));
								}
							}
							datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
						}

						datetimepicker.trigger('changedatetime.xdsoft');
						datetimepicker.trigger('close.xdsoft');
					});
				}
				options.dayOfWeekStartPrev = options.dayOfWeekStart === 0 ? 6 : options.dayOfWeekStart - 1;

				datetimepicker.trigger('xchange.xdsoft').trigger('afterOpen.xdsoft');
			};

			datetimepicker.data('options', options).on('touchstart mousedown.xdsoft', function (event) {
				event.stopPropagation();
				event.preventDefault();
				yearselect.hide();
				monthselect.hide();
				return false;
			});

			//scroll_element = timepicker.find('.xdsoft_time_box');
			timeboxparent.append(timebox);
			timeboxparent.xdsoftScroller(options);

			datetimepicker.on('afterOpen.xdsoft', function () {
				timeboxparent.xdsoftScroller(options);
			});

			datetimepicker.append(datepicker).append(timepicker);

			if (options.withoutCopyright !== true) {
				datetimepicker.append(xdsoft_copyright);
			}

			datepicker.append(month_picker).append(calendar).append(applyButton);

			$(options.parentID).append(datetimepicker);

			XDSoft_datetime = function XDSoft_datetime() {
				var _this = this;
				_this.now = function (norecursion) {
					var d = new Date(),
					    date,
					    time;

					if (!norecursion && options.defaultDate) {
						date = _this.strToDateTime(options.defaultDate);
						d.setDate(1);
						d.setFullYear(date.getFullYear());
						d.setMonth(date.getMonth());
						d.setDate(date.getDate());
					}

					if (options.yearOffset) {
						d.setFullYear(d.getFullYear() + options.yearOffset);
					}

					if (!norecursion && options.defaultTime) {
						time = _this.strtotime(options.defaultTime);
						d.setHours(time.getHours());
						d.setMinutes(time.getMinutes());
					}
					return d;
				};

				_this.isValidDate = function (d) {
					if (Object.prototype.toString.call(d) !== "[object Date]") {
						return false;
					}
					return !isNaN(d.getTime());
				};

				_this.setCurrentTime = function (dTime, requireValidDate) {
					if (typeof dTime === 'string') {
						_this.currentTime = _this.strToDateTime(dTime);
					} else if (_this.isValidDate(dTime)) {
						_this.currentTime = dTime;
					} else if (!dTime && !requireValidDate && options.allowBlank) {
						_this.currentTime = null;
					} else {
						_this.currentTime = _this.now();
					}

					datetimepicker.trigger('xchange.xdsoft');
				};

				_this.empty = function () {
					_this.currentTime = null;
				};

				_this.getCurrentTime = function (dTime) {
					return _this.currentTime;
				};

				_this.nextMonth = function () {

					if (_this.currentTime === undefined || _this.currentTime === null) {
						_this.currentTime = _this.now();
					}

					var month = _this.currentTime.getMonth() + 1,
					    year;
					if (month === 12) {
						_this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1);
						month = 0;
					}

					year = _this.currentTime.getFullYear();

					_this.currentTime.setDate(Math.min(new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), _this.currentTime.getDate()));
					_this.currentTime.setMonth(month);

					if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
						options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
					}

					if (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
						options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
					}

					datetimepicker.trigger('xchange.xdsoft');
					return month;
				};

				_this.prevMonth = function () {

					if (_this.currentTime === undefined || _this.currentTime === null) {
						_this.currentTime = _this.now();
					}

					var month = _this.currentTime.getMonth() - 1;
					if (month === -1) {
						_this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1);
						month = 11;
					}
					_this.currentTime.setDate(Math.min(new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), _this.currentTime.getDate()));
					_this.currentTime.setMonth(month);
					if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
						options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
					}
					datetimepicker.trigger('xchange.xdsoft');
					return month;
				};

				_this.getWeekOfYear = function (datetime) {
					if (options.onGetWeekOfYear && $.isFunction(options.onGetWeekOfYear)) {
						var week = options.onGetWeekOfYear.call(datetimepicker, datetime);
						if (typeof week !== 'undefined') {
							return week;
						}
					}
					var onejan = new Date(datetime.getFullYear(), 0, 1);
					//First week of the year is th one with the first Thursday according to ISO8601
					if (onejan.getDay() != 4) onejan.setMonth(0, 1 + (4 - onejan.getDay() + 7) % 7);
					return Math.ceil(((datetime - onejan) / 86400000 + onejan.getDay() + 1) / 7);
				};

				_this.strToDateTime = function (sDateTime) {
					var tmpDate = [],
					    timeOffset,
					    currentTime;

					if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) {
						return sDateTime;
					}

					tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime);
					if (tmpDate) {
						tmpDate[2] = dateHelper.parseDate(tmpDate[2], options.formatDate);
					}
					if (tmpDate && tmpDate[2]) {
						timeOffset = tmpDate[2].getTime() - tmpDate[2].getTimezoneOffset() * 60000;
						currentTime = new Date(_this.now(true).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset);
					} else {
						currentTime = sDateTime ? dateHelper.parseDate(sDateTime, options.format) : _this.now();
					}

					if (!_this.isValidDate(currentTime)) {
						currentTime = _this.now();
					}

					return currentTime;
				};

				_this.strToDate = function (sDate) {
					if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) {
						return sDate;
					}

					var currentTime = sDate ? dateHelper.parseDate(sDate, options.formatDate) : _this.now(true);
					if (!_this.isValidDate(currentTime)) {
						currentTime = _this.now(true);
					}
					return currentTime;
				};

				_this.strtotime = function (sTime) {
					if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) {
						return sTime;
					}
					var currentTime = sTime ? dateHelper.parseDate(sTime, options.formatTime) : _this.now(true);
					if (!_this.isValidDate(currentTime)) {
						currentTime = _this.now(true);
					}
					return currentTime;
				};

				_this.str = function () {
					return dateHelper.formatDate(_this.currentTime, options.format);
				};
				_this.currentTime = this.now();
			};

			_xdsoft_datetime = new XDSoft_datetime();

			applyButton.on('touchend click', function (e) {
				//pathbrite
				e.preventDefault();
				datetimepicker.data('changed', true);
				_xdsoft_datetime.setCurrentTime(getCurrentValue());
				input.val(_xdsoft_datetime.str());
				datetimepicker.trigger('close.xdsoft');
			});
			month_picker.find('.xdsoft_today_button').on('touchend mousedown.xdsoft', function () {
				datetimepicker.data('changed', true);
				_xdsoft_datetime.setCurrentTime(0, true);
				datetimepicker.trigger('afterOpen.xdsoft');
			}).on('dblclick.xdsoft', function () {
				var currentDate = _xdsoft_datetime.getCurrentTime(),
				    minDate,
				    maxDate;
				currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate());
				minDate = _xdsoft_datetime.strToDate(options.minDate);
				minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
				if (currentDate < minDate) {
					return;
				}
				maxDate = _xdsoft_datetime.strToDate(options.maxDate);
				maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate());
				if (currentDate > maxDate) {
					return;
				}
				input.val(_xdsoft_datetime.str());
				input.trigger('change');
				datetimepicker.trigger('close.xdsoft');
			});
			month_picker.find('.xdsoft_prev,.xdsoft_next').on('touchend mousedown.xdsoft', function () {
				var $this = $(this),
				    timer = 0,
				    stop = false;

				(function arguments_callee1(v) {
					if ($this.hasClass(options.next)) {
						_xdsoft_datetime.nextMonth();
					} else if ($this.hasClass(options.prev)) {
						_xdsoft_datetime.prevMonth();
					}
					if (options.monthChangeSpinner) {
						if (!stop) {
							timer = setTimeout(arguments_callee1, v || 100);
						}
					}
				})(500);

				$([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft', function arguments_callee2() {
					clearTimeout(timer);
					stop = true;
					$([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft', arguments_callee2);
				});
			});

			timepicker.find('.xdsoft_prev,.xdsoft_next').on('touchend mousedown.xdsoft', function () {
				var $this = $(this),
				    timer = 0,
				    stop = false,
				    period = 110;
				(function arguments_callee4(v) {
					var pheight = timeboxparent[0].clientHeight,
					    height = timebox[0].offsetHeight,
					    top = Math.abs(parseInt(timebox.css('marginTop'), 10));
					if ($this.hasClass(options.next) && height - pheight - options.timeHeightInTimePicker >= top) {
						timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px');
					} else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) {
						timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px');
					}
					/**
      * Fixed bug:
      * When using css3 transition, it will cause a bug that you cannot scroll the timepicker list.
      * The reason is that the transition-duration time, if you set it to 0, all things fine, otherwise, this
      * would cause a bug when you use jquery.css method.
      * Let's say: * { transition: all .5s ease; }
      * jquery timebox.css('marginTop') will return the original value which is before you clicking the next/prev button,
      * meanwhile the timebox[0].style.marginTop will return the right value which is after you clicking the
      * next/prev button.
      *
      * What we should do:
      * Replace timebox.css('marginTop') with timebox[0].style.marginTop.
      */
					timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox[0].style.marginTop, 10) / (height - pheight))]);
					period = period > 10 ? 10 : period - 10;
					if (!stop) {
						timer = setTimeout(arguments_callee4, v || period);
					}
				})(500);
				$([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft', function arguments_callee5() {
					clearTimeout(timer);
					stop = true;
					$([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft', arguments_callee5);
				});
			});

			xchangeTimer = 0;
			// base handler - generating a calendar and timepicker
			datetimepicker.on('xchange.xdsoft', function (event) {
				clearTimeout(xchangeTimer);
				xchangeTimer = setTimeout(function () {

					if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
						//In case blanks are allowed, delay construction until we have a valid date
						if (options.allowBlank) return;

						_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
					}

					var table = '',
					    start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0),
					    i = 0,
					    j,
					    today = _xdsoft_datetime.now(),
					    maxDate = false,
					    minDate = false,
					    hDate,
					    day,
					    d,
					    y,
					    m,
					    w,
					    classes = [],
					    customDateSettings,
					    newRow = true,
					    time = '',
					    h = '',
					    line_time,
					    description;

					while (start.getDay() !== options.dayOfWeekStart) {
						start.setDate(start.getDate() - 1);
					}

					table += '<table><thead><tr>';

					if (options.weeks) {
						table += '<th></th>';
					}

					for (j = 0; j < 7; j += 1) {
						table += '<th>' + options.i18n[globalLocale].dayOfWeekShort[(j + options.dayOfWeekStart) % 7] + '</th>';
					}

					table += '</tr></thead>';
					table += '<tbody>';

					if (options.maxDate !== false) {
						maxDate = _xdsoft_datetime.strToDate(options.maxDate);
						maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999);
					}

					if (options.minDate !== false) {
						minDate = _xdsoft_datetime.strToDate(options.minDate);
						minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
					}

					while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) {
						classes = [];
						i += 1;

						day = start.getDay();
						d = start.getDate();
						y = start.getFullYear();
						m = start.getMonth();
						w = _xdsoft_datetime.getWeekOfYear(start);
						description = '';

						classes.push('xdsoft_date');

						if (options.beforeShowDay && $.isFunction(options.beforeShowDay.call)) {
							customDateSettings = options.beforeShowDay.call(datetimepicker, start);
						} else {
							customDateSettings = null;
						}

						if (options.allowDateRe && Object.prototype.toString.call(options.allowDateRe) === "[object RegExp]") {
							if (!options.allowDateRe.test(dateHelper.formatDate(start, options.formatDate))) {
								classes.push('xdsoft_disabled');
							}
						} else if (options.allowDates && options.allowDates.length > 0) {
							if (options.allowDates.indexOf(dateHelper.formatDate(start, options.formatDate)) === -1) {
								classes.push('xdsoft_disabled');
							}
						} else if (maxDate !== false && start > maxDate || minDate !== false && start < minDate || customDateSettings && customDateSettings[0] === false) {
							classes.push('xdsoft_disabled');
						} else if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
							classes.push('xdsoft_disabled');
						} else if (options.disabledWeekDays.indexOf(day) !== -1) {
							classes.push('xdsoft_disabled');
						} else if (input.is('[readonly]')) {
							classes.push('xdsoft_disabled');
						}

						if (customDateSettings && customDateSettings[1] !== "") {
							classes.push(customDateSettings[1]);
						}

						if (_xdsoft_datetime.currentTime.getMonth() !== m) {
							classes.push('xdsoft_other_month');
						}

						if ((options.defaultSelect || datetimepicker.data('changed')) && dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) {
							classes.push('xdsoft_current');
						}

						if (dateHelper.formatDate(today, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) {
							classes.push('xdsoft_today');
						}

						if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
							classes.push('xdsoft_weekend');
						}

						if (options.highlightedDates[dateHelper.formatDate(start, options.formatDate)] !== undefined) {
							hDate = options.highlightedDates[dateHelper.formatDate(start, options.formatDate)];
							classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style);
							description = hDate.desc === undefined ? '' : hDate.desc;
						}

						if (options.beforeShowDay && $.isFunction(options.beforeShowDay)) {
							classes.push(options.beforeShowDay(start));
						}

						if (newRow) {
							table += '<tr>';
							newRow = false;
							if (options.weeks) {
								table += '<th>' + w + '</th>';
							}
						}

						table += '<td data-date="' + d + '" data-month="' + m + '" data-year="' + y + '"' + ' class="xdsoft_date xdsoft_day_of_week' + start.getDay() + ' ' + classes.join(' ') + '" title="' + description + '">' + '<div>' + d + '</div>' + '</td>';

						if (start.getDay() === options.dayOfWeekStartPrev) {
							table += '</tr>';
							newRow = true;
						}

						start.setDate(d + 1);
					}
					table += '</tbody></table>';

					calendar.html(table);

					month_picker.find('.xdsoft_label span').eq(0).text(options.i18n[globalLocale].months[_xdsoft_datetime.currentTime.getMonth()]);
					month_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear());

					// generate timebox
					time = '';
					h = '';
					m = '';

					line_time = function line_time(h, m) {
						var now = _xdsoft_datetime.now(),
						    optionDateTime,
						    current_time,
						    isALlowTimesInit = options.allowTimes && $.isArray(options.allowTimes) && options.allowTimes.length;
						now.setHours(h);
						h = parseInt(now.getHours(), 10);
						now.setMinutes(m);
						m = parseInt(now.getMinutes(), 10);
						optionDateTime = new Date(_xdsoft_datetime.currentTime);
						optionDateTime.setHours(h);
						optionDateTime.setMinutes(m);
						classes = [];
						if (options.minDateTime !== false && options.minDateTime > optionDateTime || options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime() || options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime()) {
							classes.push('xdsoft_disabled');
						} else if (options.minDateTime !== false && options.minDateTime > optionDateTime || options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime() && options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()) {
							classes.push('xdsoft_disabled');
						} else if (input.is('[readonly]')) {
							classes.push('xdsoft_disabled');
						}

						current_time = new Date(_xdsoft_datetime.currentTime);
						current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10));

						if (!isALlowTimesInit) {
							current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step);
						}

						if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && (!isALlowTimesInit && options.step > 59 || current_time.getMinutes() === parseInt(m, 10))) {
							if (options.defaultSelect || datetimepicker.data('changed')) {
								classes.push('xdsoft_current');
							} else if (options.initTime) {
								classes.push('xdsoft_init_time');
							}
						}
						if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) {
							classes.push('xdsoft_today');
						}
						time += '<div class="xdsoft_time ' + classes.join(' ') + '" data-hour="' + h + '" data-minute="' + m + '">' + dateHelper.formatDate(now, options.formatTime) + '</div>';
					};

					if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) {
						for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) {
							for (j = 0; j < 60; j += options.step) {
								h = (i < 10 ? '0' : '') + i;
								m = (j < 10 ? '0' : '') + j;
								line_time(h, m);
							}
						}
					} else {
						for (i = 0; i < options.allowTimes.length; i += 1) {
							h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours();
							m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes();
							line_time(h, m);
						}
					}

					timebox.html(time);

					opt = '';
					i = 0;

					for (i = parseInt(options.yearStart, 10) + options.yearOffset; i <= parseInt(options.yearEnd, 10) + options.yearOffset; i += 1) {
						opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getFullYear() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + i + '</div>';
					}
					yearselect.children().eq(0).html(opt);

					for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10); i += 1) {
						opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getMonth() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + options.i18n[globalLocale].months[i] + '</div>';
					}
					monthselect.children().eq(0).html(opt);
					$(datetimepicker).trigger('generate.xdsoft');
				}, 10);
				event.stopPropagation();
			}).on('afterOpen.xdsoft', function () {
				if (options.timepicker) {
					var classType, pheight, height, top;
					if (timebox.find('.xdsoft_current').length) {
						classType = '.xdsoft_current';
					} else if (timebox.find('.xdsoft_init_time').length) {
						classType = '.xdsoft_init_time';
					}
					if (classType) {
						pheight = timeboxparent[0].clientHeight;
						height = timebox[0].offsetHeight;
						top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1;
						if (height - pheight < top) {
							top = height - pheight;
						}
						timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]);
					} else {
						timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]);
					}
				}
			});

			timerclick = 0;
			calendar.on('touchend click.xdsoft', 'td', function (xdevent) {
				xdevent.stopPropagation(); // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap
				timerclick += 1;
				var $this = $(this),
				    currentTime = _xdsoft_datetime.currentTime;

				if (currentTime === undefined || currentTime === null) {
					_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
					currentTime = _xdsoft_datetime.currentTime;
				}

				if ($this.hasClass('xdsoft_disabled')) {
					return false;
				}

				currentTime.setDate(1);
				currentTime.setFullYear($this.data('year'));
				currentTime.setMonth($this.data('month'));
				currentTime.setDate($this.data('date'));

				datetimepicker.trigger('select.xdsoft', [currentTime]);

				input.val(_xdsoft_datetime.str());

				if (options.onSelectDate && $.isFunction(options.onSelectDate)) {
					options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
				}

				datetimepicker.data('changed', true);
				datetimepicker.trigger('xchange.xdsoft');
				datetimepicker.trigger('changedatetime.xdsoft');
				if ((timerclick > 1 || options.closeOnDateSelect === true || options.closeOnDateSelect === false && !options.timepicker) && !options.inline) {
					datetimepicker.trigger('close.xdsoft');
				}
				setTimeout(function () {
					timerclick = 0;
				}, 200);
			});

			timebox.on('touchend click.xdsoft', 'div', function (xdevent) {
				xdevent.stopPropagation();
				var $this = $(this),
				    currentTime = _xdsoft_datetime.currentTime;

				if (currentTime === undefined || currentTime === null) {
					_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
					currentTime = _xdsoft_datetime.currentTime;
				}

				if ($this.hasClass('xdsoft_disabled')) {
					return false;
				}
				currentTime.setHours($this.data('hour'));
				currentTime.setMinutes($this.data('minute'));
				datetimepicker.trigger('select.xdsoft', [currentTime]);

				datetimepicker.data('input').val(_xdsoft_datetime.str());

				if (options.onSelectTime && $.isFunction(options.onSelectTime)) {
					options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
				}
				datetimepicker.data('changed', true);
				datetimepicker.trigger('xchange.xdsoft');
				datetimepicker.trigger('changedatetime.xdsoft');
				if (options.inline !== true && options.closeOnTimeSelect === true) {
					datetimepicker.trigger('close.xdsoft');
				}
			});

			datepicker.on('mousewheel.xdsoft', function (event) {
				if (!options.scrollMonth) {
					return true;
				}
				if (event.deltaY < 0) {
					_xdsoft_datetime.nextMonth();
				} else {
					_xdsoft_datetime.prevMonth();
				}
				return false;
			});

			input.on('mousewheel.xdsoft', function (event) {
				if (!options.scrollInput) {
					return true;
				}
				if (!options.datepicker && options.timepicker) {
					current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0;
					if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) {
						current_time_index += event.deltaY;
					}
					if (timebox.children().eq(current_time_index).length) {
						timebox.children().eq(current_time_index).trigger('mousedown');
					}
					return false;
				}
				if (options.datepicker && !options.timepicker) {
					datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]);
					if (input.val) {
						input.val(_xdsoft_datetime.str());
					}
					datetimepicker.trigger('changedatetime.xdsoft');
					return false;
				}
			});

			datetimepicker.on('changedatetime.xdsoft', function (event) {
				if (options.onChangeDateTime && $.isFunction(options.onChangeDateTime)) {
					var $input = datetimepicker.data('input');
					options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event);
					delete options.value;
					$input.trigger('change');
				}
			}).on('generate.xdsoft', function () {
				if (options.onGenerate && $.isFunction(options.onGenerate)) {
					options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
				}
				if (triggerAfterOpen) {
					datetimepicker.trigger('afterOpen.xdsoft');
					triggerAfterOpen = false;
				}
			}).on('click.xdsoft', function (xdevent) {
				xdevent.stopPropagation();
			});

			current_time_index = 0;

			/**
    * Runs the callback for each of the specified node's ancestors.
    *
    * Return FALSE from the callback to stop ascending.
    *
    * @param {DOMNode} node
    * @param {Function} callback
    * @returns {undefined}
    */
			forEachAncestorOf = function forEachAncestorOf(node, callback) {
				do {
					node = node.parentNode;

					if (callback(node) === false) {
						break;
					}
				} while (node.nodeName !== 'HTML');
			};

			/**
    * Sets the position of the picker.
    *
    * @returns {undefined}
    */
			setPos = function setPos() {
				var dateInputOffset, dateInputElem, verticalPosition, left, position, datetimepickerElem, dateInputHasFixedAncestor, $dateInput, windowWidth, verticalAnchorEdge, datetimepickerCss, windowHeight, windowScrollTop;

				$dateInput = datetimepicker.data('input');
				dateInputOffset = $dateInput.offset();
				dateInputElem = $dateInput[0];

				verticalAnchorEdge = 'top';
				verticalPosition = dateInputOffset.top + dateInputElem.offsetHeight - 1;
				left = dateInputOffset.left;
				position = "absolute";

				windowWidth = $(options.contentWindow).width();
				windowHeight = $(options.contentWindow).height();
				windowScrollTop = $(options.contentWindow).scrollTop();

				if (options.ownerDocument.documentElement.clientWidth - dateInputOffset.left < datepicker.parent().outerWidth(true)) {
					var diff = datepicker.parent().outerWidth(true) - dateInputElem.offsetWidth;
					left = left - diff;
				}

				if ($dateInput.parent().css('direction') === 'rtl') {
					left -= datetimepicker.outerWidth() - $dateInput.outerWidth();
				}

				if (options.fixed) {
					verticalPosition -= windowScrollTop;
					left -= $(options.contentWindow).scrollLeft();
					position = "fixed";
				} else {
					dateInputHasFixedAncestor = false;

					forEachAncestorOf(dateInputElem, function (ancestorNode) {
						if (options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position') === 'fixed') {
							dateInputHasFixedAncestor = true;
							return false;
						}
					});

					if (dateInputHasFixedAncestor) {
						position = 'fixed';

						//If the picker won't fit entirely within the viewport then display it above the date input.
						if (verticalPosition + datetimepicker.outerHeight() > windowHeight + windowScrollTop) {
							verticalAnchorEdge = 'bottom';
							verticalPosition = windowHeight + windowScrollTop - dateInputOffset.top;
						} else {
							verticalPosition -= windowScrollTop;
						}
					} else {
						if (verticalPosition + dateInputElem.offsetHeight > windowHeight + windowScrollTop) {
							verticalPosition = dateInputOffset.top - dateInputElem.offsetHeight + 1;
						}
					}

					if (verticalPosition < 0) {
						verticalPosition = 0;
					}

					if (left + dateInputElem.offsetWidth > windowWidth) {
						left = windowWidth - dateInputElem.offsetWidth;
					}
				}

				datetimepickerElem = datetimepicker[0];

				forEachAncestorOf(datetimepickerElem, function (ancestorNode) {
					var ancestorNodePosition;

					ancestorNodePosition = options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position');

					if (ancestorNodePosition === 'relative' && windowWidth >= ancestorNode.offsetWidth) {
						left = left - (windowWidth - ancestorNode.offsetWidth) / 2;
						return false;
					}
				});

				datetimepickerCss = {
					position: position,
					left: left,
					top: '', //Initialize to prevent previous values interfering with new ones.
					bottom: '' //Initialize to prevent previous values interfering with new ones.
				};

				datetimepickerCss[verticalAnchorEdge] = verticalPosition;

				datetimepicker.css(datetimepickerCss);
			};

			datetimepicker.on('open.xdsoft', function (event) {
				var onShow = true;
				if (options.onShow && $.isFunction(options.onShow)) {
					onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
				}
				if (onShow !== false) {
					datetimepicker.show();
					setPos();
					$(options.contentWindow).off('resize.xdsoft', setPos).on('resize.xdsoft', setPos);

					if (options.closeOnWithoutClick) {
						$([options.ownerDocument.body, options.contentWindow]).on('touchstart mousedown.xdsoft', function arguments_callee6() {
							datetimepicker.trigger('close.xdsoft');
							$([options.ownerDocument.body, options.contentWindow]).off('touchstart mousedown.xdsoft', arguments_callee6);
						});
					}
				}
			}).on('close.xdsoft', function (event) {
				var onClose = true;
				month_picker.find('.xdsoft_month,.xdsoft_year').find('.xdsoft_select').hide();
				if (options.onClose && $.isFunction(options.onClose)) {
					onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
				}
				if (onClose !== false && !options.opened && !options.inline) {
					datetimepicker.hide();
				}
				event.stopPropagation();
			}).on('toggle.xdsoft', function () {
				if (datetimepicker.is(':visible')) {
					datetimepicker.trigger('close.xdsoft');
				} else {
					datetimepicker.trigger('open.xdsoft');
				}
			}).data('input', input);

			timer = 0;

			datetimepicker.data('xdsoft_datetime', _xdsoft_datetime);
			datetimepicker.setOptions(options);

			function getCurrentValue() {
				var ct = false,
				    time;

				if (options.startDate) {
					ct = _xdsoft_datetime.strToDate(options.startDate);
				} else {
					ct = options.value || (input && input.val && input.val() ? input.val() : '');
					if (ct) {
						ct = _xdsoft_datetime.strToDateTime(ct);
					} else if (options.defaultDate) {
						ct = _xdsoft_datetime.strToDateTime(options.defaultDate);
						if (options.defaultTime) {
							time = _xdsoft_datetime.strtotime(options.defaultTime);
							ct.setHours(time.getHours());
							ct.setMinutes(time.getMinutes());
						}
					}
				}

				if (ct && _xdsoft_datetime.isValidDate(ct)) {
					datetimepicker.data('changed', true);
				} else {
					ct = '';
				}

				return ct || 0;
			}

			function setMask(options) {

				var isValidValue = function isValidValue(mask, value) {
					var reg = mask.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1').replace(/_/g, '{digit+}').replace(/([0-9]{1})/g, '{digit$1}').replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}').replace(/\{digit[\+]\}/g, '[0-9_]{1}');
					return new RegExp(reg).test(value);
				},
				    getCaretPos = function getCaretPos(input) {
					try {
						if (options.ownerDocument.selection && options.ownerDocument.selection.createRange) {
							var range = options.ownerDocument.selection.createRange();
							return range.getBookmark().charCodeAt(2) - 2;
						}
						if (input.setSelectionRange) {
							return input.selectionStart;
						}
					} catch (e) {
						return 0;
					}
				},
				    setCaretPos = function setCaretPos(node, pos) {
					node = typeof node === "string" || node instanceof String ? options.ownerDocument.getElementById(node) : node;
					if (!node) {
						return false;
					}
					if (node.createTextRange) {
						var textRange = node.createTextRange();
						textRange.collapse(true);
						textRange.moveEnd('character', pos);
						textRange.moveStart('character', pos);
						textRange.select();
						return true;
					}
					if (node.setSelectionRange) {
						node.setSelectionRange(pos, pos);
						return true;
					}
					return false;
				};
				if (options.mask) {
					input.off('keydown.xdsoft');
				}
				if (options.mask === true) {
					if (typeof moment != 'undefined') {
						options.mask = options.format.replace(/Y{4}/g, '9999').replace(/Y{2}/g, '99').replace(/M{2}/g, '19').replace(/D{2}/g, '39').replace(/H{2}/g, '29').replace(/m{2}/g, '59').replace(/s{2}/g, '59');
					} else {
						options.mask = options.format.replace(/Y/g, '9999').replace(/F/g, '9999').replace(/m/g, '19').replace(/d/g, '39').replace(/H/g, '29').replace(/i/g, '59').replace(/s/g, '59');
					}
				}

				if ($.type(options.mask) === 'string') {
					if (!isValidValue(options.mask, input.val())) {
						input.val(options.mask.replace(/[0-9]/g, '_'));
						setCaretPos(input[0], 0);
					}

					input.on('keydown.xdsoft', function (event) {
						var val = this.value,
						    key = event.which,
						    pos,
						    digit;

						if (key >= KEY0 && key <= KEY9 || key >= _KEY0 && key <= _KEY9 || key === BACKSPACE || key === DEL) {
							pos = getCaretPos(this);
							digit = key !== BACKSPACE && key !== DEL ? String.fromCharCode(_KEY0 <= key && key <= _KEY9 ? key - KEY0 : key) : '_';

							if ((key === BACKSPACE || key === DEL) && pos) {
								pos -= 1;
								digit = '_';
							}

							while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
								pos += key === BACKSPACE || key === DEL ? -1 : 1;
							}

							val = val.substr(0, pos) + digit + val.substr(pos + 1);
							if ($.trim(val) === '') {
								val = options.mask.replace(/[0-9]/g, '_');
							} else {
								if (pos === options.mask.length) {
									event.preventDefault();
									return false;
								}
							}

							pos += key === BACKSPACE || key === DEL ? 0 : 1;
							while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
								pos += key === BACKSPACE || key === DEL ? -1 : 1;
							}

							if (isValidValue(options.mask, val)) {
								this.value = val;
								setCaretPos(this, pos);
							} else if ($.trim(val) === '') {
								this.value = options.mask.replace(/[0-9]/g, '_');
							} else {
								input.trigger('error_input.xdsoft');
							}
						} else {
							if ([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) {
								return true;
							}
						}

						event.preventDefault();
						return false;
					});
				}
			}

			_xdsoft_datetime.setCurrentTime(getCurrentValue());

			input.data('xdsoft_datetimepicker', datetimepicker).on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function () {
				if (input.is(':disabled') || input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick) {
					return;
				}
				clearTimeout(timer);
				timer = setTimeout(function () {
					if (input.is(':disabled')) {
						return;
					}

					triggerAfterOpen = true;
					_xdsoft_datetime.setCurrentTime(getCurrentValue(), true);
					if (options.mask) {
						setMask(options);
					}
					datetimepicker.trigger('open.xdsoft');
				}, 100);
			}).on('keydown.xdsoft', function (event) {
				var elementSelector,
				    key = event.which;
				if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) {
					elementSelector = $("input:visible,textarea:visible,button:visible,a:visible");
					datetimepicker.trigger('close.xdsoft');
					elementSelector.eq(elementSelector.index(this) + 1).focus();
					return false;
				}
				if ([TAB].indexOf(key) !== -1) {
					datetimepicker.trigger('close.xdsoft');
					return true;
				}
			}).on('blur.xdsoft', function () {
				datetimepicker.trigger('close.xdsoft');
			});
		};
		destroyDateTimePicker = function destroyDateTimePicker(input) {
			var datetimepicker = input.data('xdsoft_datetimepicker');
			if (datetimepicker) {
				datetimepicker.data('xdsoft_datetime', null);
				datetimepicker.remove();
				input.data('xdsoft_datetimepicker', null).off('.xdsoft');
				$(options.contentWindow).off('resize.xdsoft');
				$([options.contentWindow, options.ownerDocument.body]).off('mousedown.xdsoft touchstart');
				if (input.unmousewheel) {
					input.unmousewheel();
				}
			}
		};
		$(options.ownerDocument).off('keydown.xdsoftctrl keyup.xdsoftctrl').on('keydown.xdsoftctrl', function (e) {
			if (e.keyCode === CTRLKEY) {
				ctrlDown = true;
			}
		}).on('keyup.xdsoftctrl', function (e) {
			if (e.keyCode === CTRLKEY) {
				ctrlDown = false;
			}
		});

		this.each(function () {
			var datetimepicker = $(this).data('xdsoft_datetimepicker'),
			    $input;
			if (datetimepicker) {
				if ($.type(opt) === 'string') {
					switch (opt) {
						case 'show':
							$(this).select().focus();
							datetimepicker.trigger('open.xdsoft');
							break;
						case 'hide':
							datetimepicker.trigger('close.xdsoft');
							break;
						case 'toggle':
							datetimepicker.trigger('toggle.xdsoft');
							break;
						case 'destroy':
							destroyDateTimePicker($(this));
							break;
						case 'reset':
							this.value = this.defaultValue;
							if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(dateHelper.parseDate(this.value, options.format))) {
								datetimepicker.data('changed', false);
							}
							datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value);
							break;
						case 'validate':
							$input = datetimepicker.data('input');
							$input.trigger('blur.xdsoft');
							break;
						default:
							if (datetimepicker[opt] && $.isFunction(datetimepicker[opt])) {
								result = datetimepicker[opt](opt2);
							}
					}
				} else {
					datetimepicker.setOptions(opt);
				}
				return 0;
			}
			if ($.type(opt) !== 'string') {
				if (!options.lazyInit || options.open || options.inline) {
					createDateTimePicker($(this));
				} else {
					lazyInit($(this));
				}
			}
		});

		return result;
	};

	$.fn.datetimepicker.defaults = default_options;

	function HighlightedDate(date, desc, style) {
		"use strict";

		this.date = date;
		this.desc = desc;
		this.style = style;
	}
});

/*!
 * jQuery Mousewheel 3.1.13
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 */

(function (factory) {
	factory(jQuery);
})(function ($) {

	var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
	    toBind = 'onwheel' in document || document.documentMode >= 9 ? ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
	    slice = Array.prototype.slice,
	    nullLowestDeltaTimeout,
	    lowestDelta;

	if ($.event.fixHooks) {
		for (var i = toFix.length; i;) {
			$.event.fixHooks[toFix[--i]] = $.event.mouseHooks;
		}
	}

	var special = $.event.special.mousewheel = {
		version: '3.1.12',

		setup: function setup() {
			if (this.addEventListener) {
				for (var i = toBind.length; i;) {
					this.addEventListener(toBind[--i], handler, false);
				}
			} else {
				this.onmousewheel = handler;
			}
			// Store the line height and page height for this particular element
			$.data(this, 'mousewheel-line-height', special.getLineHeight(this));
			$.data(this, 'mousewheel-page-height', special.getPageHeight(this));
		},

		teardown: function teardown() {
			if (this.removeEventListener) {
				for (var i = toBind.length; i;) {
					this.removeEventListener(toBind[--i], handler, false);
				}
			} else {
				this.onmousewheel = null;
			}
			// Clean up the data we added to the element
			$.removeData(this, 'mousewheel-line-height');
			$.removeData(this, 'mousewheel-page-height');
		},

		getLineHeight: function getLineHeight(elem) {
			var $elem = $(elem),
			    $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
			if (!$parent.length) {
				$parent = $('body');
			}
			return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
		},

		getPageHeight: function getPageHeight(elem) {
			return $(elem).height();
		},

		settings: {
			adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
			normalizeOffset: true // calls getBoundingClientRect for each event
		}
	};

	$.fn.extend({
		mousewheel: function mousewheel(fn) {
			return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
		},

		unmousewheel: function unmousewheel(fn) {
			return this.unbind('mousewheel', fn);
		}
	});

	function handler(event) {
		var orgEvent = event || window.event,
		    args = slice.call(arguments, 1),
		    delta = 0,
		    deltaX = 0,
		    deltaY = 0,
		    absDelta = 0,
		    offsetX = 0,
		    offsetY = 0;
		event = $.event.fix(orgEvent);
		event.type = 'mousewheel';

		// Old school scrollwheel delta
		if ('detail' in orgEvent) {
			deltaY = orgEvent.detail * -1;
		}
		if ('wheelDelta' in orgEvent) {
			deltaY = orgEvent.wheelDelta;
		}
		if ('wheelDeltaY' in orgEvent) {
			deltaY = orgEvent.wheelDeltaY;
		}
		if ('wheelDeltaX' in orgEvent) {
			deltaX = orgEvent.wheelDeltaX * -1;
		}

		// Firefox < 17 horizontal scrolling related to DOMMouseScroll event
		if ('axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) {
			deltaX = deltaY * -1;
			deltaY = 0;
		}

		// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
		delta = deltaY === 0 ? deltaX : deltaY;

		// New school wheel delta (wheel event)
		if ('deltaY' in orgEvent) {
			deltaY = orgEvent.deltaY * -1;
			delta = deltaY;
		}
		if ('deltaX' in orgEvent) {
			deltaX = orgEvent.deltaX;
			if (deltaY === 0) {
				delta = deltaX * -1;
			}
		}

		// No change actually happened, no reason to go any further
		if (deltaY === 0 && deltaX === 0) {
			return;
		}

		// Need to convert lines and pages to pixels if we aren't already in pixels
		// There are three delta modes:
		//   * deltaMode 0 is by pixels, nothing to do
		//   * deltaMode 1 is by lines
		//   * deltaMode 2 is by pages
		if (orgEvent.deltaMode === 1) {
			var lineHeight = $.data(this, 'mousewheel-line-height');
			delta *= lineHeight;
			deltaY *= lineHeight;
			deltaX *= lineHeight;
		} else if (orgEvent.deltaMode === 2) {
			var pageHeight = $.data(this, 'mousewheel-page-height');
			delta *= pageHeight;
			deltaY *= pageHeight;
			deltaX *= pageHeight;
		}

		// Store lowest absolute delta to normalize the delta values
		absDelta = Math.max(Math.abs(deltaY), Math.abs(deltaX));

		if (!lowestDelta || absDelta < lowestDelta) {
			lowestDelta = absDelta;

			// Adjust older deltas if necessary
			if (shouldAdjustOldDeltas(orgEvent, absDelta)) {
				lowestDelta /= 40;
			}
		}

		// Adjust older deltas if necessary
		if (shouldAdjustOldDeltas(orgEvent, absDelta)) {
			// Divide all the things by 40!
			delta /= 40;
			deltaX /= 40;
			deltaY /= 40;
		}

		// Get a whole, normalized value for the deltas
		delta = Math[delta >= 1 ? 'floor' : 'ceil'](delta / lowestDelta);
		deltaX = Math[deltaX >= 1 ? 'floor' : 'ceil'](deltaX / lowestDelta);
		deltaY = Math[deltaY >= 1 ? 'floor' : 'ceil'](deltaY / lowestDelta);

		// Normalise offsetX and offsetY properties
		if (special.settings.normalizeOffset && this.getBoundingClientRect) {
			var boundingRect = this.getBoundingClientRect();
			offsetX = event.clientX - boundingRect.left;
			offsetY = event.clientY - boundingRect.top;
		}

		// Add information to the event object
		event.deltaX = deltaX;
		event.deltaY = deltaY;
		event.deltaFactor = lowestDelta;
		event.offsetX = offsetX;
		event.offsetY = offsetY;
		// Go ahead and set deltaMode to 0 since we converted to pixels
		// Although this is a little odd since we overwrite the deltaX/Y
		// properties with normalized deltas.
		event.deltaMode = 0;

		// Add event and delta to the front of the arguments
		args.unshift(event, delta, deltaX, deltaY);

		// Clearout lowestDelta after sometime to better
		// handle multiple device types that give different
		// a different lowestDelta
		// Ex: trackpad = 3 and mouse wheel = 120
		if (nullLowestDeltaTimeout) {
			clearTimeout(nullLowestDeltaTimeout);
		}
		nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);

		return ($.event.dispatch || $.event.handle).apply(this, args);
	}

	function nullLowestDelta() {
		lowestDelta = null;
	}

	function shouldAdjustOldDeltas(orgEvent, absDelta) {
		// If this is an older event and the delta is divisable by 120,
		// then we are assuming that the browser is treating this as an
		// older mouse wheel event and that we should divide the deltas
		// by 40 to try and get a more usable deltaFactor.
		// Side note, this actually impacts the reported scroll distance
		// in older browsers and can cause scrolling to be slower than native.
		// Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
		return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
	}
});

},{}],55:[function(require,module,exports){
"use strict";

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */
!function (a, b) {
  "use strict";
  "object" == (typeof module === "undefined" ? "undefined" : _typeof(module)) && "object" == _typeof(module.exports) ? module.exports = a.document ? b(a, !0) : function (a) {
    if (!a.document) throw new Error("jQuery requires a window with a document");return b(a);
  } : b(a);
}("undefined" != typeof window ? window : undefined, function (a, b) {
  "use strict";
  var c = [],
      d = a.document,
      e = Object.getPrototypeOf,
      f = c.slice,
      g = c.concat,
      h = c.push,
      i = c.indexOf,
      j = {},
      k = j.toString,
      l = j.hasOwnProperty,
      m = l.toString,
      n = m.call(Object),
      o = {};function p(a, b) {
    b = b || d;var c = b.createElement("script");c.text = a, b.head.appendChild(c).parentNode.removeChild(c);
  }var q = "3.1.1",
      r = function r(a, b) {
    return new r.fn.init(a, b);
  },
      s = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
      t = /^-ms-/,
      u = /-([a-z])/g,
      v = function v(a, b) {
    return b.toUpperCase();
  };r.fn = r.prototype = { jquery: q, constructor: r, length: 0, toArray: function toArray() {
      return f.call(this);
    }, get: function get(a) {
      return null == a ? f.call(this) : a < 0 ? this[a + this.length] : this[a];
    }, pushStack: function pushStack(a) {
      var b = r.merge(this.constructor(), a);return b.prevObject = this, b;
    }, each: function each(a) {
      return r.each(this, a);
    }, map: function map(a) {
      return this.pushStack(r.map(this, function (b, c) {
        return a.call(b, c, b);
      }));
    }, slice: function slice() {
      return this.pushStack(f.apply(this, arguments));
    }, first: function first() {
      return this.eq(0);
    }, last: function last() {
      return this.eq(-1);
    }, eq: function eq(a) {
      var b = this.length,
          c = +a + (a < 0 ? b : 0);return this.pushStack(c >= 0 && c < b ? [this[c]] : []);
    }, end: function end() {
      return this.prevObject || this.constructor();
    }, push: h, sort: c.sort, splice: c.splice }, r.extend = r.fn.extend = function () {
    var a,
        b,
        c,
        d,
        e,
        f,
        g = arguments[0] || {},
        h = 1,
        i = arguments.length,
        j = !1;for ("boolean" == typeof g && (j = g, g = arguments[h] || {}, h++), "object" == (typeof g === "undefined" ? "undefined" : _typeof(g)) || r.isFunction(g) || (g = {}), h === i && (g = this, h--); h < i; h++) {
      if (null != (a = arguments[h])) for (b in a) {
        c = g[b], d = a[b], g !== d && (j && d && (r.isPlainObject(d) || (e = r.isArray(d))) ? (e ? (e = !1, f = c && r.isArray(c) ? c : []) : f = c && r.isPlainObject(c) ? c : {}, g[b] = r.extend(j, f, d)) : void 0 !== d && (g[b] = d));
      }
    }return g;
  }, r.extend({ expando: "jQuery" + (q + Math.random()).replace(/\D/g, ""), isReady: !0, error: function error(a) {
      throw new Error(a);
    }, noop: function noop() {}, isFunction: function isFunction(a) {
      return "function" === r.type(a);
    }, isArray: Array.isArray, isWindow: function isWindow(a) {
      return null != a && a === a.window;
    }, isNumeric: function isNumeric(a) {
      var b = r.type(a);return ("number" === b || "string" === b) && !isNaN(a - parseFloat(a));
    }, isPlainObject: function isPlainObject(a) {
      var b, c;return !(!a || "[object Object]" !== k.call(a)) && (!(b = e(a)) || (c = l.call(b, "constructor") && b.constructor, "function" == typeof c && m.call(c) === n));
    }, isEmptyObject: function isEmptyObject(a) {
      var b;for (b in a) {
        return !1;
      }return !0;
    }, type: function type(a) {
      return null == a ? a + "" : "object" == (typeof a === "undefined" ? "undefined" : _typeof(a)) || "function" == typeof a ? j[k.call(a)] || "object" : typeof a === "undefined" ? "undefined" : _typeof(a);
    }, globalEval: function globalEval(a) {
      p(a);
    }, camelCase: function camelCase(a) {
      return a.replace(t, "ms-").replace(u, v);
    }, nodeName: function nodeName(a, b) {
      return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase();
    }, each: function each(a, b) {
      var c,
          d = 0;if (w(a)) {
        for (c = a.length; d < c; d++) {
          if (b.call(a[d], d, a[d]) === !1) break;
        }
      } else for (d in a) {
        if (b.call(a[d], d, a[d]) === !1) break;
      }return a;
    }, trim: function trim(a) {
      return null == a ? "" : (a + "").replace(s, "");
    }, makeArray: function makeArray(a, b) {
      var c = b || [];return null != a && (w(Object(a)) ? r.merge(c, "string" == typeof a ? [a] : a) : h.call(c, a)), c;
    }, inArray: function inArray(a, b, c) {
      return null == b ? -1 : i.call(b, a, c);
    }, merge: function merge(a, b) {
      for (var c = +b.length, d = 0, e = a.length; d < c; d++) {
        a[e++] = b[d];
      }return a.length = e, a;
    }, grep: function grep(a, b, c) {
      for (var d, e = [], f = 0, g = a.length, h = !c; f < g; f++) {
        d = !b(a[f], f), d !== h && e.push(a[f]);
      }return e;
    }, map: function map(a, b, c) {
      var d,
          e,
          f = 0,
          h = [];if (w(a)) for (d = a.length; f < d; f++) {
        e = b(a[f], f, c), null != e && h.push(e);
      } else for (f in a) {
        e = b(a[f], f, c), null != e && h.push(e);
      }return g.apply([], h);
    }, guid: 1, proxy: function proxy(a, b) {
      var c, d, e;if ("string" == typeof b && (c = a[b], b = a, a = c), r.isFunction(a)) return d = f.call(arguments, 2), e = function e() {
        return a.apply(b || this, d.concat(f.call(arguments)));
      }, e.guid = a.guid = a.guid || r.guid++, e;
    }, now: Date.now, support: o }), "function" == typeof Symbol && (r.fn[Symbol.iterator] = c[Symbol.iterator]), r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function (a, b) {
    j["[object " + b + "]"] = b.toLowerCase();
  });function w(a) {
    var b = !!a && "length" in a && a.length,
        c = r.type(a);return "function" !== c && !r.isWindow(a) && ("array" === c || 0 === b || "number" == typeof b && b > 0 && b - 1 in a);
  }var x = function (a) {
    var b,
        c,
        d,
        e,
        f,
        g,
        h,
        i,
        j,
        k,
        l,
        m,
        n,
        o,
        p,
        q,
        r,
        s,
        t,
        u = "sizzle" + 1 * new Date(),
        v = a.document,
        w = 0,
        x = 0,
        y = ha(),
        z = ha(),
        A = ha(),
        B = function B(a, b) {
      return a === b && (l = !0), 0;
    },
        C = {}.hasOwnProperty,
        D = [],
        E = D.pop,
        F = D.push,
        G = D.push,
        H = D.slice,
        I = function I(a, b) {
      for (var c = 0, d = a.length; c < d; c++) {
        if (a[c] === b) return c;
      }return -1;
    },
        J = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
        K = "[\\x20\\t\\r\\n\\f]",
        L = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
        M = "\\[" + K + "*(" + L + ")(?:" + K + "*([*^$|!~]?=)" + K + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + L + "))|)" + K + "*\\]",
        N = ":(" + L + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + M + ")*)|.*)\\)|)",
        O = new RegExp(K + "+", "g"),
        P = new RegExp("^" + K + "+|((?:^|[^\\\\])(?:\\\\.)*)" + K + "+$", "g"),
        Q = new RegExp("^" + K + "*," + K + "*"),
        R = new RegExp("^" + K + "*([>+~]|" + K + ")" + K + "*"),
        S = new RegExp("=" + K + "*([^\\]'\"]*?)" + K + "*\\]", "g"),
        T = new RegExp(N),
        U = new RegExp("^" + L + "$"),
        V = { ID: new RegExp("^#(" + L + ")"), CLASS: new RegExp("^\\.(" + L + ")"), TAG: new RegExp("^(" + L + "|[*])"), ATTR: new RegExp("^" + M), PSEUDO: new RegExp("^" + N), CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + K + "*(even|odd|(([+-]|)(\\d*)n|)" + K + "*(?:([+-]|)" + K + "*(\\d+)|))" + K + "*\\)|)", "i"), bool: new RegExp("^(?:" + J + ")$", "i"), needsContext: new RegExp("^" + K + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + K + "*((?:-\\d)?\\d*)" + K + "*\\)|)(?=[^-]|$)", "i") },
        W = /^(?:input|select|textarea|button)$/i,
        X = /^h\d$/i,
        Y = /^[^{]+\{\s*\[native \w/,
        Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
        $ = /[+~]/,
        _ = new RegExp("\\\\([\\da-f]{1,6}" + K + "?|(" + K + ")|.)", "ig"),
        aa = function aa(a, b, c) {
      var d = "0x" + b - 65536;return d !== d || c ? b : d < 0 ? String.fromCharCode(d + 65536) : String.fromCharCode(d >> 10 | 55296, 1023 & d | 56320);
    },
        ba = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
        ca = function ca(a, b) {
      return b ? "\0" === a ? "\uFFFD" : a.slice(0, -1) + "\\" + a.charCodeAt(a.length - 1).toString(16) + " " : "\\" + a;
    },
        da = function da() {
      m();
    },
        ea = ta(function (a) {
      return a.disabled === !0 && ("form" in a || "label" in a);
    }, { dir: "parentNode", next: "legend" });try {
      G.apply(D = H.call(v.childNodes), v.childNodes), D[v.childNodes.length].nodeType;
    } catch (fa) {
      G = { apply: D.length ? function (a, b) {
          F.apply(a, H.call(b));
        } : function (a, b) {
          var c = a.length,
              d = 0;while (a[c++] = b[d++]) {}a.length = c - 1;
        } };
    }function ga(a, b, d, e) {
      var f,
          h,
          j,
          k,
          l,
          o,
          r,
          s = b && b.ownerDocument,
          w = b ? b.nodeType : 9;if (d = d || [], "string" != typeof a || !a || 1 !== w && 9 !== w && 11 !== w) return d;if (!e && ((b ? b.ownerDocument || b : v) !== n && m(b), b = b || n, p)) {
        if (11 !== w && (l = Z.exec(a))) if (f = l[1]) {
          if (9 === w) {
            if (!(j = b.getElementById(f))) return d;if (j.id === f) return d.push(j), d;
          } else if (s && (j = s.getElementById(f)) && t(b, j) && j.id === f) return d.push(j), d;
        } else {
          if (l[2]) return G.apply(d, b.getElementsByTagName(a)), d;if ((f = l[3]) && c.getElementsByClassName && b.getElementsByClassName) return G.apply(d, b.getElementsByClassName(f)), d;
        }if (c.qsa && !A[a + " "] && (!q || !q.test(a))) {
          if (1 !== w) s = b, r = a;else if ("object" !== b.nodeName.toLowerCase()) {
            (k = b.getAttribute("id")) ? k = k.replace(ba, ca) : b.setAttribute("id", k = u), o = g(a), h = o.length;while (h--) {
              o[h] = "#" + k + " " + sa(o[h]);
            }r = o.join(","), s = $.test(a) && qa(b.parentNode) || b;
          }if (r) try {
            return G.apply(d, s.querySelectorAll(r)), d;
          } catch (x) {} finally {
            k === u && b.removeAttribute("id");
          }
        }
      }return i(a.replace(P, "$1"), b, d, e);
    }function ha() {
      var a = [];function b(c, e) {
        return a.push(c + " ") > d.cacheLength && delete b[a.shift()], b[c + " "] = e;
      }return b;
    }function ia(a) {
      return a[u] = !0, a;
    }function ja(a) {
      var b = n.createElement("fieldset");try {
        return !!a(b);
      } catch (c) {
        return !1;
      } finally {
        b.parentNode && b.parentNode.removeChild(b), b = null;
      }
    }function ka(a, b) {
      var c = a.split("|"),
          e = c.length;while (e--) {
        d.attrHandle[c[e]] = b;
      }
    }function la(a, b) {
      var c = b && a,
          d = c && 1 === a.nodeType && 1 === b.nodeType && a.sourceIndex - b.sourceIndex;if (d) return d;if (c) while (c = c.nextSibling) {
        if (c === b) return -1;
      }return a ? 1 : -1;
    }function ma(a) {
      return function (b) {
        var c = b.nodeName.toLowerCase();return "input" === c && b.type === a;
      };
    }function na(a) {
      return function (b) {
        var c = b.nodeName.toLowerCase();return ("input" === c || "button" === c) && b.type === a;
      };
    }function oa(a) {
      return function (b) {
        return "form" in b ? b.parentNode && b.disabled === !1 ? "label" in b ? "label" in b.parentNode ? b.parentNode.disabled === a : b.disabled === a : b.isDisabled === a || b.isDisabled !== !a && ea(b) === a : b.disabled === a : "label" in b && b.disabled === a;
      };
    }function pa(a) {
      return ia(function (b) {
        return b = +b, ia(function (c, d) {
          var e,
              f = a([], c.length, b),
              g = f.length;while (g--) {
            c[e = f[g]] && (c[e] = !(d[e] = c[e]));
          }
        });
      });
    }function qa(a) {
      return a && "undefined" != typeof a.getElementsByTagName && a;
    }c = ga.support = {}, f = ga.isXML = function (a) {
      var b = a && (a.ownerDocument || a).documentElement;return !!b && "HTML" !== b.nodeName;
    }, m = ga.setDocument = function (a) {
      var b,
          e,
          g = a ? a.ownerDocument || a : v;return g !== n && 9 === g.nodeType && g.documentElement ? (n = g, o = n.documentElement, p = !f(n), v !== n && (e = n.defaultView) && e.top !== e && (e.addEventListener ? e.addEventListener("unload", da, !1) : e.attachEvent && e.attachEvent("onunload", da)), c.attributes = ja(function (a) {
        return a.className = "i", !a.getAttribute("className");
      }), c.getElementsByTagName = ja(function (a) {
        return a.appendChild(n.createComment("")), !a.getElementsByTagName("*").length;
      }), c.getElementsByClassName = Y.test(n.getElementsByClassName), c.getById = ja(function (a) {
        return o.appendChild(a).id = u, !n.getElementsByName || !n.getElementsByName(u).length;
      }), c.getById ? (d.filter.ID = function (a) {
        var b = a.replace(_, aa);return function (a) {
          return a.getAttribute("id") === b;
        };
      }, d.find.ID = function (a, b) {
        if ("undefined" != typeof b.getElementById && p) {
          var c = b.getElementById(a);return c ? [c] : [];
        }
      }) : (d.filter.ID = function (a) {
        var b = a.replace(_, aa);return function (a) {
          var c = "undefined" != typeof a.getAttributeNode && a.getAttributeNode("id");return c && c.value === b;
        };
      }, d.find.ID = function (a, b) {
        if ("undefined" != typeof b.getElementById && p) {
          var c,
              d,
              e,
              f = b.getElementById(a);if (f) {
            if (c = f.getAttributeNode("id"), c && c.value === a) return [f];e = b.getElementsByName(a), d = 0;while (f = e[d++]) {
              if (c = f.getAttributeNode("id"), c && c.value === a) return [f];
            }
          }return [];
        }
      }), d.find.TAG = c.getElementsByTagName ? function (a, b) {
        return "undefined" != typeof b.getElementsByTagName ? b.getElementsByTagName(a) : c.qsa ? b.querySelectorAll(a) : void 0;
      } : function (a, b) {
        var c,
            d = [],
            e = 0,
            f = b.getElementsByTagName(a);if ("*" === a) {
          while (c = f[e++]) {
            1 === c.nodeType && d.push(c);
          }return d;
        }return f;
      }, d.find.CLASS = c.getElementsByClassName && function (a, b) {
        if ("undefined" != typeof b.getElementsByClassName && p) return b.getElementsByClassName(a);
      }, r = [], q = [], (c.qsa = Y.test(n.querySelectorAll)) && (ja(function (a) {
        o.appendChild(a).innerHTML = "<a id='" + u + "'></a><select id='" + u + "-\r\\' msallowcapture=''><option selected=''></option></select>", a.querySelectorAll("[msallowcapture^='']").length && q.push("[*^$]=" + K + "*(?:''|\"\")"), a.querySelectorAll("[selected]").length || q.push("\\[" + K + "*(?:value|" + J + ")"), a.querySelectorAll("[id~=" + u + "-]").length || q.push("~="), a.querySelectorAll(":checked").length || q.push(":checked"), a.querySelectorAll("a#" + u + "+*").length || q.push(".#.+[+~]");
      }), ja(function (a) {
        a.innerHTML = "<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b = n.createElement("input");b.setAttribute("type", "hidden"), a.appendChild(b).setAttribute("name", "D"), a.querySelectorAll("[name=d]").length && q.push("name" + K + "*[*^$|!~]?="), 2 !== a.querySelectorAll(":enabled").length && q.push(":enabled", ":disabled"), o.appendChild(a).disabled = !0, 2 !== a.querySelectorAll(":disabled").length && q.push(":enabled", ":disabled"), a.querySelectorAll("*,:x"), q.push(",.*:");
      })), (c.matchesSelector = Y.test(s = o.matches || o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || o.msMatchesSelector)) && ja(function (a) {
        c.disconnectedMatch = s.call(a, "*"), s.call(a, "[s!='']:x"), r.push("!=", N);
      }), q = q.length && new RegExp(q.join("|")), r = r.length && new RegExp(r.join("|")), b = Y.test(o.compareDocumentPosition), t = b || Y.test(o.contains) ? function (a, b) {
        var c = 9 === a.nodeType ? a.documentElement : a,
            d = b && b.parentNode;return a === d || !(!d || 1 !== d.nodeType || !(c.contains ? c.contains(d) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(d)));
      } : function (a, b) {
        if (b) while (b = b.parentNode) {
          if (b === a) return !0;
        }return !1;
      }, B = b ? function (a, b) {
        if (a === b) return l = !0, 0;var d = !a.compareDocumentPosition - !b.compareDocumentPosition;return d ? d : (d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & d || !c.sortDetached && b.compareDocumentPosition(a) === d ? a === n || a.ownerDocument === v && t(v, a) ? -1 : b === n || b.ownerDocument === v && t(v, b) ? 1 : k ? I(k, a) - I(k, b) : 0 : 4 & d ? -1 : 1);
      } : function (a, b) {
        if (a === b) return l = !0, 0;var c,
            d = 0,
            e = a.parentNode,
            f = b.parentNode,
            g = [a],
            h = [b];if (!e || !f) return a === n ? -1 : b === n ? 1 : e ? -1 : f ? 1 : k ? I(k, a) - I(k, b) : 0;if (e === f) return la(a, b);c = a;while (c = c.parentNode) {
          g.unshift(c);
        }c = b;while (c = c.parentNode) {
          h.unshift(c);
        }while (g[d] === h[d]) {
          d++;
        }return d ? la(g[d], h[d]) : g[d] === v ? -1 : h[d] === v ? 1 : 0;
      }, n) : n;
    }, ga.matches = function (a, b) {
      return ga(a, null, null, b);
    }, ga.matchesSelector = function (a, b) {
      if ((a.ownerDocument || a) !== n && m(a), b = b.replace(S, "='$1']"), c.matchesSelector && p && !A[b + " "] && (!r || !r.test(b)) && (!q || !q.test(b))) try {
        var d = s.call(a, b);if (d || c.disconnectedMatch || a.document && 11 !== a.document.nodeType) return d;
      } catch (e) {}return ga(b, n, null, [a]).length > 0;
    }, ga.contains = function (a, b) {
      return (a.ownerDocument || a) !== n && m(a), t(a, b);
    }, ga.attr = function (a, b) {
      (a.ownerDocument || a) !== n && m(a);var e = d.attrHandle[b.toLowerCase()],
          f = e && C.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !p) : void 0;return void 0 !== f ? f : c.attributes || !p ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null;
    }, ga.escape = function (a) {
      return (a + "").replace(ba, ca);
    }, ga.error = function (a) {
      throw new Error("Syntax error, unrecognized expression: " + a);
    }, ga.uniqueSort = function (a) {
      var b,
          d = [],
          e = 0,
          f = 0;if (l = !c.detectDuplicates, k = !c.sortStable && a.slice(0), a.sort(B), l) {
        while (b = a[f++]) {
          b === a[f] && (e = d.push(f));
        }while (e--) {
          a.splice(d[e], 1);
        }
      }return k = null, a;
    }, e = ga.getText = function (a) {
      var b,
          c = "",
          d = 0,
          f = a.nodeType;if (f) {
        if (1 === f || 9 === f || 11 === f) {
          if ("string" == typeof a.textContent) return a.textContent;for (a = a.firstChild; a; a = a.nextSibling) {
            c += e(a);
          }
        } else if (3 === f || 4 === f) return a.nodeValue;
      } else while (b = a[d++]) {
        c += e(b);
      }return c;
    }, d = ga.selectors = { cacheLength: 50, createPseudo: ia, match: V, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function ATTR(a) {
          return a[1] = a[1].replace(_, aa), a[3] = (a[3] || a[4] || a[5] || "").replace(_, aa), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4);
        }, CHILD: function CHILD(a) {
          return a[1] = a[1].toLowerCase(), "nth" === a[1].slice(0, 3) ? (a[3] || ga.error(a[0]), a[4] = +(a[4] ? a[5] + (a[6] || 1) : 2 * ("even" === a[3] || "odd" === a[3])), a[5] = +(a[7] + a[8] || "odd" === a[3])) : a[3] && ga.error(a[0]), a;
        }, PSEUDO: function PSEUDO(a) {
          var b,
              c = !a[6] && a[2];return V.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[4] || a[5] || "" : c && T.test(c) && (b = g(c, !0)) && (b = c.indexOf(")", c.length - b) - c.length) && (a[0] = a[0].slice(0, b), a[2] = c.slice(0, b)), a.slice(0, 3));
        } }, filter: { TAG: function TAG(a) {
          var b = a.replace(_, aa).toLowerCase();return "*" === a ? function () {
            return !0;
          } : function (a) {
            return a.nodeName && a.nodeName.toLowerCase() === b;
          };
        }, CLASS: function CLASS(a) {
          var b = y[a + " "];return b || (b = new RegExp("(^|" + K + ")" + a + "(" + K + "|$)")) && y(a, function (a) {
            return b.test("string" == typeof a.className && a.className || "undefined" != typeof a.getAttribute && a.getAttribute("class") || "");
          });
        }, ATTR: function ATTR(a, b, c) {
          return function (d) {
            var e = ga.attr(d, a);return null == e ? "!=" === b : !b || (e += "", "=" === b ? e === c : "!=" === b ? e !== c : "^=" === b ? c && 0 === e.indexOf(c) : "*=" === b ? c && e.indexOf(c) > -1 : "$=" === b ? c && e.slice(-c.length) === c : "~=" === b ? (" " + e.replace(O, " ") + " ").indexOf(c) > -1 : "|=" === b && (e === c || e.slice(0, c.length + 1) === c + "-"));
          };
        }, CHILD: function CHILD(a, b, c, d, e) {
          var f = "nth" !== a.slice(0, 3),
              g = "last" !== a.slice(-4),
              h = "of-type" === b;return 1 === d && 0 === e ? function (a) {
            return !!a.parentNode;
          } : function (b, c, i) {
            var j,
                k,
                l,
                m,
                n,
                o,
                p = f !== g ? "nextSibling" : "previousSibling",
                q = b.parentNode,
                r = h && b.nodeName.toLowerCase(),
                s = !i && !h,
                t = !1;if (q) {
              if (f) {
                while (p) {
                  m = b;while (m = m[p]) {
                    if (h ? m.nodeName.toLowerCase() === r : 1 === m.nodeType) return !1;
                  }o = p = "only" === a && !o && "nextSibling";
                }return !0;
              }if (o = [g ? q.firstChild : q.lastChild], g && s) {
                m = q, l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), j = k[a] || [], n = j[0] === w && j[1], t = n && j[2], m = n && q.childNodes[n];while (m = ++n && m && m[p] || (t = n = 0) || o.pop()) {
                  if (1 === m.nodeType && ++t && m === b) {
                    k[a] = [w, n, t];break;
                  }
                }
              } else if (s && (m = b, l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), j = k[a] || [], n = j[0] === w && j[1], t = n), t === !1) while (m = ++n && m && m[p] || (t = n = 0) || o.pop()) {
                if ((h ? m.nodeName.toLowerCase() === r : 1 === m.nodeType) && ++t && (s && (l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), k[a] = [w, t]), m === b)) break;
              }return t -= e, t === d || t % d === 0 && t / d >= 0;
            }
          };
        }, PSEUDO: function PSEUDO(a, b) {
          var c,
              e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || ga.error("unsupported pseudo: " + a);return e[u] ? e(b) : e.length > 1 ? (c = [a, a, "", b], d.setFilters.hasOwnProperty(a.toLowerCase()) ? ia(function (a, c) {
            var d,
                f = e(a, b),
                g = f.length;while (g--) {
              d = I(a, f[g]), a[d] = !(c[d] = f[g]);
            }
          }) : function (a) {
            return e(a, 0, c);
          }) : e;
        } }, pseudos: { not: ia(function (a) {
          var b = [],
              c = [],
              d = h(a.replace(P, "$1"));return d[u] ? ia(function (a, b, c, e) {
            var f,
                g = d(a, null, e, []),
                h = a.length;while (h--) {
              (f = g[h]) && (a[h] = !(b[h] = f));
            }
          }) : function (a, e, f) {
            return b[0] = a, d(b, null, f, c), b[0] = null, !c.pop();
          };
        }), has: ia(function (a) {
          return function (b) {
            return ga(a, b).length > 0;
          };
        }), contains: ia(function (a) {
          return a = a.replace(_, aa), function (b) {
            return (b.textContent || b.innerText || e(b)).indexOf(a) > -1;
          };
        }), lang: ia(function (a) {
          return U.test(a || "") || ga.error("unsupported lang: " + a), a = a.replace(_, aa).toLowerCase(), function (b) {
            var c;do {
              if (c = p ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang")) return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + "-");
            } while ((b = b.parentNode) && 1 === b.nodeType);return !1;
          };
        }), target: function target(b) {
          var c = a.location && a.location.hash;return c && c.slice(1) === b.id;
        }, root: function root(a) {
          return a === o;
        }, focus: function focus(a) {
          return a === n.activeElement && (!n.hasFocus || n.hasFocus()) && !!(a.type || a.href || ~a.tabIndex);
        }, enabled: oa(!1), disabled: oa(!0), checked: function checked(a) {
          var b = a.nodeName.toLowerCase();return "input" === b && !!a.checked || "option" === b && !!a.selected;
        }, selected: function selected(a) {
          return a.parentNode && a.parentNode.selectedIndex, a.selected === !0;
        }, empty: function empty(a) {
          for (a = a.firstChild; a; a = a.nextSibling) {
            if (a.nodeType < 6) return !1;
          }return !0;
        }, parent: function parent(a) {
          return !d.pseudos.empty(a);
        }, header: function header(a) {
          return X.test(a.nodeName);
        }, input: function input(a) {
          return W.test(a.nodeName);
        }, button: function button(a) {
          var b = a.nodeName.toLowerCase();return "input" === b && "button" === a.type || "button" === b;
        }, text: function text(a) {
          var b;return "input" === a.nodeName.toLowerCase() && "text" === a.type && (null == (b = a.getAttribute("type")) || "text" === b.toLowerCase());
        }, first: pa(function () {
          return [0];
        }), last: pa(function (a, b) {
          return [b - 1];
        }), eq: pa(function (a, b, c) {
          return [c < 0 ? c + b : c];
        }), even: pa(function (a, b) {
          for (var c = 0; c < b; c += 2) {
            a.push(c);
          }return a;
        }), odd: pa(function (a, b) {
          for (var c = 1; c < b; c += 2) {
            a.push(c);
          }return a;
        }), lt: pa(function (a, b, c) {
          for (var d = c < 0 ? c + b : c; --d >= 0;) {
            a.push(d);
          }return a;
        }), gt: pa(function (a, b, c) {
          for (var d = c < 0 ? c + b : c; ++d < b;) {
            a.push(d);
          }return a;
        }) } }, d.pseudos.nth = d.pseudos.eq;for (b in { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) {
      d.pseudos[b] = ma(b);
    }for (b in { submit: !0, reset: !0 }) {
      d.pseudos[b] = na(b);
    }function ra() {}ra.prototype = d.filters = d.pseudos, d.setFilters = new ra(), g = ga.tokenize = function (a, b) {
      var c,
          e,
          f,
          g,
          h,
          i,
          j,
          k = z[a + " "];if (k) return b ? 0 : k.slice(0);h = a, i = [], j = d.preFilter;while (h) {
        c && !(e = Q.exec(h)) || (e && (h = h.slice(e[0].length) || h), i.push(f = [])), c = !1, (e = R.exec(h)) && (c = e.shift(), f.push({ value: c, type: e[0].replace(P, " ") }), h = h.slice(c.length));for (g in d.filter) {
          !(e = V[g].exec(h)) || j[g] && !(e = j[g](e)) || (c = e.shift(), f.push({ value: c, type: g, matches: e }), h = h.slice(c.length));
        }if (!c) break;
      }return b ? h.length : h ? ga.error(a) : z(a, i).slice(0);
    };function sa(a) {
      for (var b = 0, c = a.length, d = ""; b < c; b++) {
        d += a[b].value;
      }return d;
    }function ta(a, b, c) {
      var d = b.dir,
          e = b.next,
          f = e || d,
          g = c && "parentNode" === f,
          h = x++;return b.first ? function (b, c, e) {
        while (b = b[d]) {
          if (1 === b.nodeType || g) return a(b, c, e);
        }return !1;
      } : function (b, c, i) {
        var j,
            k,
            l,
            m = [w, h];if (i) {
          while (b = b[d]) {
            if ((1 === b.nodeType || g) && a(b, c, i)) return !0;
          }
        } else while (b = b[d]) {
          if (1 === b.nodeType || g) if (l = b[u] || (b[u] = {}), k = l[b.uniqueID] || (l[b.uniqueID] = {}), e && e === b.nodeName.toLowerCase()) b = b[d] || b;else {
            if ((j = k[f]) && j[0] === w && j[1] === h) return m[2] = j[2];if (k[f] = m, m[2] = a(b, c, i)) return !0;
          }
        }return !1;
      };
    }function ua(a) {
      return a.length > 1 ? function (b, c, d) {
        var e = a.length;while (e--) {
          if (!a[e](b, c, d)) return !1;
        }return !0;
      } : a[0];
    }function va(a, b, c) {
      for (var d = 0, e = b.length; d < e; d++) {
        ga(a, b[d], c);
      }return c;
    }function wa(a, b, c, d, e) {
      for (var f, g = [], h = 0, i = a.length, j = null != b; h < i; h++) {
        (f = a[h]) && (c && !c(f, d, e) || (g.push(f), j && b.push(h)));
      }return g;
    }function xa(a, b, c, d, e, f) {
      return d && !d[u] && (d = xa(d)), e && !e[u] && (e = xa(e, f)), ia(function (f, g, h, i) {
        var j,
            k,
            l,
            m = [],
            n = [],
            o = g.length,
            p = f || va(b || "*", h.nodeType ? [h] : h, []),
            q = !a || !f && b ? p : wa(p, m, a, h, i),
            r = c ? e || (f ? a : o || d) ? [] : g : q;if (c && c(q, r, h, i), d) {
          j = wa(r, n), d(j, [], h, i), k = j.length;while (k--) {
            (l = j[k]) && (r[n[k]] = !(q[n[k]] = l));
          }
        }if (f) {
          if (e || a) {
            if (e) {
              j = [], k = r.length;while (k--) {
                (l = r[k]) && j.push(q[k] = l);
              }e(null, r = [], j, i);
            }k = r.length;while (k--) {
              (l = r[k]) && (j = e ? I(f, l) : m[k]) > -1 && (f[j] = !(g[j] = l));
            }
          }
        } else r = wa(r === g ? r.splice(o, r.length) : r), e ? e(null, g, r, i) : G.apply(g, r);
      });
    }function ya(a) {
      for (var b, c, e, f = a.length, g = d.relative[a[0].type], h = g || d.relative[" "], i = g ? 1 : 0, k = ta(function (a) {
        return a === b;
      }, h, !0), l = ta(function (a) {
        return I(b, a) > -1;
      }, h, !0), m = [function (a, c, d) {
        var e = !g && (d || c !== j) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d));return b = null, e;
      }]; i < f; i++) {
        if (c = d.relative[a[i].type]) m = [ta(ua(m), c)];else {
          if (c = d.filter[a[i].type].apply(null, a[i].matches), c[u]) {
            for (e = ++i; e < f; e++) {
              if (d.relative[a[e].type]) break;
            }return xa(i > 1 && ua(m), i > 1 && sa(a.slice(0, i - 1).concat({ value: " " === a[i - 2].type ? "*" : "" })).replace(P, "$1"), c, i < e && ya(a.slice(i, e)), e < f && ya(a = a.slice(e)), e < f && sa(a));
          }m.push(c);
        }
      }return ua(m);
    }function za(a, b) {
      var c = b.length > 0,
          e = a.length > 0,
          f = function f(_f, g, h, i, k) {
        var l,
            o,
            q,
            r = 0,
            s = "0",
            t = _f && [],
            u = [],
            v = j,
            x = _f || e && d.find.TAG("*", k),
            y = w += null == v ? 1 : Math.random() || .1,
            z = x.length;for (k && (j = g === n || g || k); s !== z && null != (l = x[s]); s++) {
          if (e && l) {
            o = 0, g || l.ownerDocument === n || (m(l), h = !p);while (q = a[o++]) {
              if (q(l, g || n, h)) {
                i.push(l);break;
              }
            }k && (w = y);
          }c && ((l = !q && l) && r--, _f && t.push(l));
        }if (r += s, c && s !== r) {
          o = 0;while (q = b[o++]) {
            q(t, u, g, h);
          }if (_f) {
            if (r > 0) while (s--) {
              t[s] || u[s] || (u[s] = E.call(i));
            }u = wa(u);
          }G.apply(i, u), k && !_f && u.length > 0 && r + b.length > 1 && ga.uniqueSort(i);
        }return k && (w = y, j = v), t;
      };return c ? ia(f) : f;
    }return h = ga.compile = function (a, b) {
      var c,
          d = [],
          e = [],
          f = A[a + " "];if (!f) {
        b || (b = g(a)), c = b.length;while (c--) {
          f = ya(b[c]), f[u] ? d.push(f) : e.push(f);
        }f = A(a, za(e, d)), f.selector = a;
      }return f;
    }, i = ga.select = function (a, b, c, e) {
      var f,
          i,
          j,
          k,
          l,
          m = "function" == typeof a && a,
          n = !e && g(a = m.selector || a);if (c = c || [], 1 === n.length) {
        if (i = n[0] = n[0].slice(0), i.length > 2 && "ID" === (j = i[0]).type && 9 === b.nodeType && p && d.relative[i[1].type]) {
          if (b = (d.find.ID(j.matches[0].replace(_, aa), b) || [])[0], !b) return c;m && (b = b.parentNode), a = a.slice(i.shift().value.length);
        }f = V.needsContext.test(a) ? 0 : i.length;while (f--) {
          if (j = i[f], d.relative[k = j.type]) break;if ((l = d.find[k]) && (e = l(j.matches[0].replace(_, aa), $.test(i[0].type) && qa(b.parentNode) || b))) {
            if (i.splice(f, 1), a = e.length && sa(i), !a) return G.apply(c, e), c;break;
          }
        }
      }return (m || h(a, n))(e, b, !p, c, !b || $.test(a) && qa(b.parentNode) || b), c;
    }, c.sortStable = u.split("").sort(B).join("") === u, c.detectDuplicates = !!l, m(), c.sortDetached = ja(function (a) {
      return 1 & a.compareDocumentPosition(n.createElement("fieldset"));
    }), ja(function (a) {
      return a.innerHTML = "<a href='#'></a>", "#" === a.firstChild.getAttribute("href");
    }) || ka("type|href|height|width", function (a, b, c) {
      if (!c) return a.getAttribute(b, "type" === b.toLowerCase() ? 1 : 2);
    }), c.attributes && ja(function (a) {
      return a.innerHTML = "<input/>", a.firstChild.setAttribute("value", ""), "" === a.firstChild.getAttribute("value");
    }) || ka("value", function (a, b, c) {
      if (!c && "input" === a.nodeName.toLowerCase()) return a.defaultValue;
    }), ja(function (a) {
      return null == a.getAttribute("disabled");
    }) || ka(J, function (a, b, c) {
      var d;if (!c) return a[b] === !0 ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null;
    }), ga;
  }(a);r.find = x, r.expr = x.selectors, r.expr[":"] = r.expr.pseudos, r.uniqueSort = r.unique = x.uniqueSort, r.text = x.getText, r.isXMLDoc = x.isXML, r.contains = x.contains, r.escapeSelector = x.escape;var y = function y(a, b, c) {
    var d = [],
        e = void 0 !== c;while ((a = a[b]) && 9 !== a.nodeType) {
      if (1 === a.nodeType) {
        if (e && r(a).is(c)) break;d.push(a);
      }
    }return d;
  },
      z = function z(a, b) {
    for (var c = []; a; a = a.nextSibling) {
      1 === a.nodeType && a !== b && c.push(a);
    }return c;
  },
      A = r.expr.match.needsContext,
      B = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,
      C = /^.[^:#\[\.,]*$/;function D(a, b, c) {
    return r.isFunction(b) ? r.grep(a, function (a, d) {
      return !!b.call(a, d, a) !== c;
    }) : b.nodeType ? r.grep(a, function (a) {
      return a === b !== c;
    }) : "string" != typeof b ? r.grep(a, function (a) {
      return i.call(b, a) > -1 !== c;
    }) : C.test(b) ? r.filter(b, a, c) : (b = r.filter(b, a), r.grep(a, function (a) {
      return i.call(b, a) > -1 !== c && 1 === a.nodeType;
    }));
  }r.filter = function (a, b, c) {
    var d = b[0];return c && (a = ":not(" + a + ")"), 1 === b.length && 1 === d.nodeType ? r.find.matchesSelector(d, a) ? [d] : [] : r.find.matches(a, r.grep(b, function (a) {
      return 1 === a.nodeType;
    }));
  }, r.fn.extend({ find: function find(a) {
      var b,
          c,
          d = this.length,
          e = this;if ("string" != typeof a) return this.pushStack(r(a).filter(function () {
        for (b = 0; b < d; b++) {
          if (r.contains(e[b], this)) return !0;
        }
      }));for (c = this.pushStack([]), b = 0; b < d; b++) {
        r.find(a, e[b], c);
      }return d > 1 ? r.uniqueSort(c) : c;
    }, filter: function filter(a) {
      return this.pushStack(D(this, a || [], !1));
    }, not: function not(a) {
      return this.pushStack(D(this, a || [], !0));
    }, is: function is(a) {
      return !!D(this, "string" == typeof a && A.test(a) ? r(a) : a || [], !1).length;
    } });var E,
      F = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
      G = r.fn.init = function (a, b, c) {
    var e, f;if (!a) return this;if (c = c || E, "string" == typeof a) {
      if (e = "<" === a[0] && ">" === a[a.length - 1] && a.length >= 3 ? [null, a, null] : F.exec(a), !e || !e[1] && b) return !b || b.jquery ? (b || c).find(a) : this.constructor(b).find(a);if (e[1]) {
        if (b = b instanceof r ? b[0] : b, r.merge(this, r.parseHTML(e[1], b && b.nodeType ? b.ownerDocument || b : d, !0)), B.test(e[1]) && r.isPlainObject(b)) for (e in b) {
          r.isFunction(this[e]) ? this[e](b[e]) : this.attr(e, b[e]);
        }return this;
      }return f = d.getElementById(e[2]), f && (this[0] = f, this.length = 1), this;
    }return a.nodeType ? (this[0] = a, this.length = 1, this) : r.isFunction(a) ? void 0 !== c.ready ? c.ready(a) : a(r) : r.makeArray(a, this);
  };G.prototype = r.fn, E = r(d);var H = /^(?:parents|prev(?:Until|All))/,
      I = { children: !0, contents: !0, next: !0, prev: !0 };r.fn.extend({ has: function has(a) {
      var b = r(a, this),
          c = b.length;return this.filter(function () {
        for (var a = 0; a < c; a++) {
          if (r.contains(this, b[a])) return !0;
        }
      });
    }, closest: function closest(a, b) {
      var c,
          d = 0,
          e = this.length,
          f = [],
          g = "string" != typeof a && r(a);if (!A.test(a)) for (; d < e; d++) {
        for (c = this[d]; c && c !== b; c = c.parentNode) {
          if (c.nodeType < 11 && (g ? g.index(c) > -1 : 1 === c.nodeType && r.find.matchesSelector(c, a))) {
            f.push(c);break;
          }
        }
      }return this.pushStack(f.length > 1 ? r.uniqueSort(f) : f);
    }, index: function index(a) {
      return a ? "string" == typeof a ? i.call(r(a), this[0]) : i.call(this, a.jquery ? a[0] : a) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
    }, add: function add(a, b) {
      return this.pushStack(r.uniqueSort(r.merge(this.get(), r(a, b))));
    }, addBack: function addBack(a) {
      return this.add(null == a ? this.prevObject : this.prevObject.filter(a));
    } });function J(a, b) {
    while ((a = a[b]) && 1 !== a.nodeType) {}return a;
  }r.each({ parent: function parent(a) {
      var b = a.parentNode;return b && 11 !== b.nodeType ? b : null;
    }, parents: function parents(a) {
      return y(a, "parentNode");
    }, parentsUntil: function parentsUntil(a, b, c) {
      return y(a, "parentNode", c);
    }, next: function next(a) {
      return J(a, "nextSibling");
    }, prev: function prev(a) {
      return J(a, "previousSibling");
    }, nextAll: function nextAll(a) {
      return y(a, "nextSibling");
    }, prevAll: function prevAll(a) {
      return y(a, "previousSibling");
    }, nextUntil: function nextUntil(a, b, c) {
      return y(a, "nextSibling", c);
    }, prevUntil: function prevUntil(a, b, c) {
      return y(a, "previousSibling", c);
    }, siblings: function siblings(a) {
      return z((a.parentNode || {}).firstChild, a);
    }, children: function children(a) {
      return z(a.firstChild);
    }, contents: function contents(a) {
      return a.contentDocument || r.merge([], a.childNodes);
    } }, function (a, b) {
    r.fn[a] = function (c, d) {
      var e = r.map(this, b, c);return "Until" !== a.slice(-5) && (d = c), d && "string" == typeof d && (e = r.filter(d, e)), this.length > 1 && (I[a] || r.uniqueSort(e), H.test(a) && e.reverse()), this.pushStack(e);
    };
  });var K = /[^\x20\t\r\n\f]+/g;function L(a) {
    var b = {};return r.each(a.match(K) || [], function (a, c) {
      b[c] = !0;
    }), b;
  }r.Callbacks = function (a) {
    a = "string" == typeof a ? L(a) : r.extend({}, a);var b,
        c,
        d,
        e,
        f = [],
        g = [],
        h = -1,
        i = function i() {
      for (e = a.once, d = b = !0; g.length; h = -1) {
        c = g.shift();while (++h < f.length) {
          f[h].apply(c[0], c[1]) === !1 && a.stopOnFalse && (h = f.length, c = !1);
        }
      }a.memory || (c = !1), b = !1, e && (f = c ? [] : "");
    },
        j = { add: function add() {
        return f && (c && !b && (h = f.length - 1, g.push(c)), function d(b) {
          r.each(b, function (b, c) {
            r.isFunction(c) ? a.unique && j.has(c) || f.push(c) : c && c.length && "string" !== r.type(c) && d(c);
          });
        }(arguments), c && !b && i()), this;
      }, remove: function remove() {
        return r.each(arguments, function (a, b) {
          var c;while ((c = r.inArray(b, f, c)) > -1) {
            f.splice(c, 1), c <= h && h--;
          }
        }), this;
      }, has: function has(a) {
        return a ? r.inArray(a, f) > -1 : f.length > 0;
      }, empty: function empty() {
        return f && (f = []), this;
      }, disable: function disable() {
        return e = g = [], f = c = "", this;
      }, disabled: function disabled() {
        return !f;
      }, lock: function lock() {
        return e = g = [], c || b || (f = c = ""), this;
      }, locked: function locked() {
        return !!e;
      }, fireWith: function fireWith(a, c) {
        return e || (c = c || [], c = [a, c.slice ? c.slice() : c], g.push(c), b || i()), this;
      }, fire: function fire() {
        return j.fireWith(this, arguments), this;
      }, fired: function fired() {
        return !!d;
      } };return j;
  };function M(a) {
    return a;
  }function N(a) {
    throw a;
  }function O(a, b, c) {
    var d;try {
      a && r.isFunction(d = a.promise) ? d.call(a).done(b).fail(c) : a && r.isFunction(d = a.then) ? d.call(a, b, c) : b.call(void 0, a);
    } catch (a) {
      c.call(void 0, a);
    }
  }r.extend({ Deferred: function Deferred(b) {
      var c = [["notify", "progress", r.Callbacks("memory"), r.Callbacks("memory"), 2], ["resolve", "done", r.Callbacks("once memory"), r.Callbacks("once memory"), 0, "resolved"], ["reject", "fail", r.Callbacks("once memory"), r.Callbacks("once memory"), 1, "rejected"]],
          d = "pending",
          e = { state: function state() {
          return d;
        }, always: function always() {
          return f.done(arguments).fail(arguments), this;
        }, "catch": function _catch(a) {
          return e.then(null, a);
        }, pipe: function pipe() {
          var a = arguments;return r.Deferred(function (b) {
            r.each(c, function (c, d) {
              var e = r.isFunction(a[d[4]]) && a[d[4]];f[d[1]](function () {
                var a = e && e.apply(this, arguments);a && r.isFunction(a.promise) ? a.promise().progress(b.notify).done(b.resolve).fail(b.reject) : b[d[0] + "With"](this, e ? [a] : arguments);
              });
            }), a = null;
          }).promise();
        }, then: function then(b, d, e) {
          var f = 0;function g(b, c, d, e) {
            return function () {
              var h = this,
                  i = arguments,
                  j = function j() {
                var a, j;if (!(b < f)) {
                  if (a = d.apply(h, i), a === c.promise()) throw new TypeError("Thenable self-resolution");j = a && ("object" == (typeof a === "undefined" ? "undefined" : _typeof(a)) || "function" == typeof a) && a.then, r.isFunction(j) ? e ? j.call(a, g(f, c, M, e), g(f, c, N, e)) : (f++, j.call(a, g(f, c, M, e), g(f, c, N, e), g(f, c, M, c.notifyWith))) : (d !== M && (h = void 0, i = [a]), (e || c.resolveWith)(h, i));
                }
              },
                  k = e ? j : function () {
                try {
                  j();
                } catch (a) {
                  r.Deferred.exceptionHook && r.Deferred.exceptionHook(a, k.stackTrace), b + 1 >= f && (d !== N && (h = void 0, i = [a]), c.rejectWith(h, i));
                }
              };b ? k() : (r.Deferred.getStackHook && (k.stackTrace = r.Deferred.getStackHook()), a.setTimeout(k));
            };
          }return r.Deferred(function (a) {
            c[0][3].add(g(0, a, r.isFunction(e) ? e : M, a.notifyWith)), c[1][3].add(g(0, a, r.isFunction(b) ? b : M)), c[2][3].add(g(0, a, r.isFunction(d) ? d : N));
          }).promise();
        }, promise: function promise(a) {
          return null != a ? r.extend(a, e) : e;
        } },
          f = {};return r.each(c, function (a, b) {
        var g = b[2],
            h = b[5];e[b[1]] = g.add, h && g.add(function () {
          d = h;
        }, c[3 - a][2].disable, c[0][2].lock), g.add(b[3].fire), f[b[0]] = function () {
          return f[b[0] + "With"](this === f ? void 0 : this, arguments), this;
        }, f[b[0] + "With"] = g.fireWith;
      }), e.promise(f), b && b.call(f, f), f;
    }, when: function when(a) {
      var b = arguments.length,
          c = b,
          d = Array(c),
          e = f.call(arguments),
          g = r.Deferred(),
          h = function h(a) {
        return function (c) {
          d[a] = this, e[a] = arguments.length > 1 ? f.call(arguments) : c, --b || g.resolveWith(d, e);
        };
      };if (b <= 1 && (O(a, g.done(h(c)).resolve, g.reject), "pending" === g.state() || r.isFunction(e[c] && e[c].then))) return g.then();while (c--) {
        O(e[c], h(c), g.reject);
      }return g.promise();
    } });var P = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook = function (b, c) {
    a.console && a.console.warn && b && P.test(b.name) && a.console.warn("jQuery.Deferred exception: " + b.message, b.stack, c);
  }, r.readyException = function (b) {
    a.setTimeout(function () {
      throw b;
    });
  };var Q = r.Deferred();r.fn.ready = function (a) {
    return Q.then(a)["catch"](function (a) {
      r.readyException(a);
    }), this;
  }, r.extend({ isReady: !1, readyWait: 1, holdReady: function holdReady(a) {
      a ? r.readyWait++ : r.ready(!0);
    }, ready: function ready(a) {
      (a === !0 ? --r.readyWait : r.isReady) || (r.isReady = !0, a !== !0 && --r.readyWait > 0 || Q.resolveWith(d, [r]));
    } }), r.ready.then = Q.then;function R() {
    d.removeEventListener("DOMContentLoaded", R), a.removeEventListener("load", R), r.ready();
  }"complete" === d.readyState || "loading" !== d.readyState && !d.documentElement.doScroll ? a.setTimeout(r.ready) : (d.addEventListener("DOMContentLoaded", R), a.addEventListener("load", R));var S = function S(a, b, c, d, e, f, g) {
    var h = 0,
        i = a.length,
        j = null == c;if ("object" === r.type(c)) {
      e = !0;for (h in c) {
        S(a, b, h, c[h], !0, f, g);
      }
    } else if (void 0 !== d && (e = !0, r.isFunction(d) || (g = !0), j && (g ? (b.call(a, d), b = null) : (j = b, b = function b(a, _b, c) {
      return j.call(r(a), c);
    })), b)) for (; h < i; h++) {
      b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c)));
    }return e ? a : j ? b.call(a) : i ? b(a[0], c) : f;
  },
      T = function T(a) {
    return 1 === a.nodeType || 9 === a.nodeType || !+a.nodeType;
  };function U() {
    this.expando = r.expando + U.uid++;
  }U.uid = 1, U.prototype = { cache: function cache(a) {
      var b = a[this.expando];return b || (b = {}, T(a) && (a.nodeType ? a[this.expando] = b : Object.defineProperty(a, this.expando, { value: b, configurable: !0 }))), b;
    }, set: function set(a, b, c) {
      var d,
          e = this.cache(a);if ("string" == typeof b) e[r.camelCase(b)] = c;else for (d in b) {
        e[r.camelCase(d)] = b[d];
      }return e;
    }, get: function get(a, b) {
      return void 0 === b ? this.cache(a) : a[this.expando] && a[this.expando][r.camelCase(b)];
    }, access: function access(a, b, c) {
      return void 0 === b || b && "string" == typeof b && void 0 === c ? this.get(a, b) : (this.set(a, b, c), void 0 !== c ? c : b);
    }, remove: function remove(a, b) {
      var c,
          d = a[this.expando];if (void 0 !== d) {
        if (void 0 !== b) {
          r.isArray(b) ? b = b.map(r.camelCase) : (b = r.camelCase(b), b = b in d ? [b] : b.match(K) || []), c = b.length;while (c--) {
            delete d[b[c]];
          }
        }(void 0 === b || r.isEmptyObject(d)) && (a.nodeType ? a[this.expando] = void 0 : delete a[this.expando]);
      }
    }, hasData: function hasData(a) {
      var b = a[this.expando];return void 0 !== b && !r.isEmptyObject(b);
    } };var V = new U(),
      W = new U(),
      X = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
      Y = /[A-Z]/g;function Z(a) {
    return "true" === a || "false" !== a && ("null" === a ? null : a === +a + "" ? +a : X.test(a) ? JSON.parse(a) : a);
  }function $(a, b, c) {
    var d;if (void 0 === c && 1 === a.nodeType) if (d = "data-" + b.replace(Y, "-$&").toLowerCase(), c = a.getAttribute(d), "string" == typeof c) {
      try {
        c = Z(c);
      } catch (e) {}W.set(a, b, c);
    } else c = void 0;return c;
  }r.extend({ hasData: function hasData(a) {
      return W.hasData(a) || V.hasData(a);
    }, data: function data(a, b, c) {
      return W.access(a, b, c);
    }, removeData: function removeData(a, b) {
      W.remove(a, b);
    }, _data: function _data(a, b, c) {
      return V.access(a, b, c);
    }, _removeData: function _removeData(a, b) {
      V.remove(a, b);
    } }), r.fn.extend({ data: function data(a, b) {
      var c,
          d,
          e,
          f = this[0],
          g = f && f.attributes;if (void 0 === a) {
        if (this.length && (e = W.get(f), 1 === f.nodeType && !V.get(f, "hasDataAttrs"))) {
          c = g.length;while (c--) {
            g[c] && (d = g[c].name, 0 === d.indexOf("data-") && (d = r.camelCase(d.slice(5)), $(f, d, e[d])));
          }V.set(f, "hasDataAttrs", !0);
        }return e;
      }return "object" == (typeof a === "undefined" ? "undefined" : _typeof(a)) ? this.each(function () {
        W.set(this, a);
      }) : S(this, function (b) {
        var c;if (f && void 0 === b) {
          if (c = W.get(f, a), void 0 !== c) return c;if (c = $(f, a), void 0 !== c) return c;
        } else this.each(function () {
          W.set(this, a, b);
        });
      }, null, b, arguments.length > 1, null, !0);
    }, removeData: function removeData(a) {
      return this.each(function () {
        W.remove(this, a);
      });
    } }), r.extend({ queue: function queue(a, b, c) {
      var d;if (a) return b = (b || "fx") + "queue", d = V.get(a, b), c && (!d || r.isArray(c) ? d = V.access(a, b, r.makeArray(c)) : d.push(c)), d || [];
    }, dequeue: function dequeue(a, b) {
      b = b || "fx";var c = r.queue(a, b),
          d = c.length,
          e = c.shift(),
          f = r._queueHooks(a, b),
          g = function g() {
        r.dequeue(a, b);
      };"inprogress" === e && (e = c.shift(), d--), e && ("fx" === b && c.unshift("inprogress"), delete f.stop, e.call(a, g, f)), !d && f && f.empty.fire();
    }, _queueHooks: function _queueHooks(a, b) {
      var c = b + "queueHooks";return V.get(a, c) || V.access(a, c, { empty: r.Callbacks("once memory").add(function () {
          V.remove(a, [b + "queue", c]);
        }) });
    } }), r.fn.extend({ queue: function queue(a, b) {
      var c = 2;return "string" != typeof a && (b = a, a = "fx", c--), arguments.length < c ? r.queue(this[0], a) : void 0 === b ? this : this.each(function () {
        var c = r.queue(this, a, b);r._queueHooks(this, a), "fx" === a && "inprogress" !== c[0] && r.dequeue(this, a);
      });
    }, dequeue: function dequeue(a) {
      return this.each(function () {
        r.dequeue(this, a);
      });
    }, clearQueue: function clearQueue(a) {
      return this.queue(a || "fx", []);
    }, promise: function promise(a, b) {
      var c,
          d = 1,
          e = r.Deferred(),
          f = this,
          g = this.length,
          h = function h() {
        --d || e.resolveWith(f, [f]);
      };"string" != typeof a && (b = a, a = void 0), a = a || "fx";while (g--) {
        c = V.get(f[g], a + "queueHooks"), c && c.empty && (d++, c.empty.add(h));
      }return h(), e.promise(b);
    } });var _ = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
      aa = new RegExp("^(?:([+-])=|)(" + _ + ")([a-z%]*)$", "i"),
      ba = ["Top", "Right", "Bottom", "Left"],
      ca = function ca(a, b) {
    return a = b || a, "none" === a.style.display || "" === a.style.display && r.contains(a.ownerDocument, a) && "none" === r.css(a, "display");
  },
      da = function da(a, b, c, d) {
    var e,
        f,
        g = {};for (f in b) {
      g[f] = a.style[f], a.style[f] = b[f];
    }e = c.apply(a, d || []);for (f in b) {
      a.style[f] = g[f];
    }return e;
  };function ea(a, b, c, d) {
    var e,
        f = 1,
        g = 20,
        h = d ? function () {
      return d.cur();
    } : function () {
      return r.css(a, b, "");
    },
        i = h(),
        j = c && c[3] || (r.cssNumber[b] ? "" : "px"),
        k = (r.cssNumber[b] || "px" !== j && +i) && aa.exec(r.css(a, b));if (k && k[3] !== j) {
      j = j || k[3], c = c || [], k = +i || 1;do {
        f = f || ".5", k /= f, r.style(a, b, k + j);
      } while (f !== (f = h() / i) && 1 !== f && --g);
    }return c && (k = +k || +i || 0, e = c[1] ? k + (c[1] + 1) * c[2] : +c[2], d && (d.unit = j, d.start = k, d.end = e)), e;
  }var fa = {};function ga(a) {
    var b,
        c = a.ownerDocument,
        d = a.nodeName,
        e = fa[d];return e ? e : (b = c.body.appendChild(c.createElement(d)), e = r.css(b, "display"), b.parentNode.removeChild(b), "none" === e && (e = "block"), fa[d] = e, e);
  }function ha(a, b) {
    for (var c, d, e = [], f = 0, g = a.length; f < g; f++) {
      d = a[f], d.style && (c = d.style.display, b ? ("none" === c && (e[f] = V.get(d, "display") || null, e[f] || (d.style.display = "")), "" === d.style.display && ca(d) && (e[f] = ga(d))) : "none" !== c && (e[f] = "none", V.set(d, "display", c)));
    }for (f = 0; f < g; f++) {
      null != e[f] && (a[f].style.display = e[f]);
    }return a;
  }r.fn.extend({ show: function show() {
      return ha(this, !0);
    }, hide: function hide() {
      return ha(this);
    }, toggle: function toggle(a) {
      return "boolean" == typeof a ? a ? this.show() : this.hide() : this.each(function () {
        ca(this) ? r(this).show() : r(this).hide();
      });
    } });var ia = /^(?:checkbox|radio)$/i,
      ja = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i,
      ka = /^$|\/(?:java|ecma)script/i,
      la = { option: [1, "<select multiple='multiple'>", "</select>"], thead: [1, "<table>", "</table>"], col: [2, "<table><colgroup>", "</colgroup></table>"], tr: [2, "<table><tbody>", "</tbody></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], _default: [0, "", ""] };la.optgroup = la.option, la.tbody = la.tfoot = la.colgroup = la.caption = la.thead, la.th = la.td;function ma(a, b) {
    var c;return c = "undefined" != typeof a.getElementsByTagName ? a.getElementsByTagName(b || "*") : "undefined" != typeof a.querySelectorAll ? a.querySelectorAll(b || "*") : [], void 0 === b || b && r.nodeName(a, b) ? r.merge([a], c) : c;
  }function na(a, b) {
    for (var c = 0, d = a.length; c < d; c++) {
      V.set(a[c], "globalEval", !b || V.get(b[c], "globalEval"));
    }
  }var oa = /<|&#?\w+;/;function pa(a, b, c, d, e) {
    for (var f, g, h, i, j, k, l = b.createDocumentFragment(), m = [], n = 0, o = a.length; n < o; n++) {
      if (f = a[n], f || 0 === f) if ("object" === r.type(f)) r.merge(m, f.nodeType ? [f] : f);else if (oa.test(f)) {
        g = g || l.appendChild(b.createElement("div")), h = (ja.exec(f) || ["", ""])[1].toLowerCase(), i = la[h] || la._default, g.innerHTML = i[1] + r.htmlPrefilter(f) + i[2], k = i[0];while (k--) {
          g = g.lastChild;
        }r.merge(m, g.childNodes), g = l.firstChild, g.textContent = "";
      } else m.push(b.createTextNode(f));
    }l.textContent = "", n = 0;while (f = m[n++]) {
      if (d && r.inArray(f, d) > -1) e && e.push(f);else if (j = r.contains(f.ownerDocument, f), g = ma(l.appendChild(f), "script"), j && na(g), c) {
        k = 0;while (f = g[k++]) {
          ka.test(f.type || "") && c.push(f);
        }
      }
    }return l;
  }!function () {
    var a = d.createDocumentFragment(),
        b = a.appendChild(d.createElement("div")),
        c = d.createElement("input");c.setAttribute("type", "radio"), c.setAttribute("checked", "checked"), c.setAttribute("name", "t"), b.appendChild(c), o.checkClone = b.cloneNode(!0).cloneNode(!0).lastChild.checked, b.innerHTML = "<textarea>x</textarea>", o.noCloneChecked = !!b.cloneNode(!0).lastChild.defaultValue;
  }();var qa = d.documentElement,
      ra = /^key/,
      sa = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
      ta = /^([^.]*)(?:\.(.+)|)/;function ua() {
    return !0;
  }function va() {
    return !1;
  }function wa() {
    try {
      return d.activeElement;
    } catch (a) {}
  }function xa(a, b, c, d, e, f) {
    var g, h;if ("object" == (typeof b === "undefined" ? "undefined" : _typeof(b))) {
      "string" != typeof c && (d = d || c, c = void 0);for (h in b) {
        xa(a, h, c, d, b[h], f);
      }return a;
    }if (null == d && null == e ? (e = c, d = c = void 0) : null == e && ("string" == typeof c ? (e = d, d = void 0) : (e = d, d = c, c = void 0)), e === !1) e = va;else if (!e) return a;return 1 === f && (g = e, e = function e(a) {
      return r().off(a), g.apply(this, arguments);
    }, e.guid = g.guid || (g.guid = r.guid++)), a.each(function () {
      r.event.add(this, b, e, d, c);
    });
  }r.event = { global: {}, add: function add(a, b, c, d, e) {
      var f,
          g,
          h,
          i,
          j,
          k,
          l,
          m,
          n,
          o,
          p,
          q = V.get(a);if (q) {
        c.handler && (f = c, c = f.handler, e = f.selector), e && r.find.matchesSelector(qa, e), c.guid || (c.guid = r.guid++), (i = q.events) || (i = q.events = {}), (g = q.handle) || (g = q.handle = function (b) {
          return "undefined" != typeof r && r.event.triggered !== b.type ? r.event.dispatch.apply(a, arguments) : void 0;
        }), b = (b || "").match(K) || [""], j = b.length;while (j--) {
          h = ta.exec(b[j]) || [], n = p = h[1], o = (h[2] || "").split(".").sort(), n && (l = r.event.special[n] || {}, n = (e ? l.delegateType : l.bindType) || n, l = r.event.special[n] || {}, k = r.extend({ type: n, origType: p, data: d, handler: c, guid: c.guid, selector: e, needsContext: e && r.expr.match.needsContext.test(e), namespace: o.join(".") }, f), (m = i[n]) || (m = i[n] = [], m.delegateCount = 0, l.setup && l.setup.call(a, d, o, g) !== !1 || a.addEventListener && a.addEventListener(n, g)), l.add && (l.add.call(a, k), k.handler.guid || (k.handler.guid = c.guid)), e ? m.splice(m.delegateCount++, 0, k) : m.push(k), r.event.global[n] = !0);
        }
      }
    }, remove: function remove(a, b, c, d, e) {
      var f,
          g,
          h,
          i,
          j,
          k,
          l,
          m,
          n,
          o,
          p,
          q = V.hasData(a) && V.get(a);if (q && (i = q.events)) {
        b = (b || "").match(K) || [""], j = b.length;while (j--) {
          if (h = ta.exec(b[j]) || [], n = p = h[1], o = (h[2] || "").split(".").sort(), n) {
            l = r.event.special[n] || {}, n = (d ? l.delegateType : l.bindType) || n, m = i[n] || [], h = h[2] && new RegExp("(^|\\.)" + o.join("\\.(?:.*\\.|)") + "(\\.|$)"), g = f = m.length;while (f--) {
              k = m[f], !e && p !== k.origType || c && c.guid !== k.guid || h && !h.test(k.namespace) || d && d !== k.selector && ("**" !== d || !k.selector) || (m.splice(f, 1), k.selector && m.delegateCount--, l.remove && l.remove.call(a, k));
            }g && !m.length && (l.teardown && l.teardown.call(a, o, q.handle) !== !1 || r.removeEvent(a, n, q.handle), delete i[n]);
          } else for (n in i) {
            r.event.remove(a, n + b[j], c, d, !0);
          }
        }r.isEmptyObject(i) && V.remove(a, "handle events");
      }
    }, dispatch: function dispatch(a) {
      var b = r.event.fix(a),
          c,
          d,
          e,
          f,
          g,
          h,
          i = new Array(arguments.length),
          j = (V.get(this, "events") || {})[b.type] || [],
          k = r.event.special[b.type] || {};for (i[0] = b, c = 1; c < arguments.length; c++) {
        i[c] = arguments[c];
      }if (b.delegateTarget = this, !k.preDispatch || k.preDispatch.call(this, b) !== !1) {
        h = r.event.handlers.call(this, b, j), c = 0;while ((f = h[c++]) && !b.isPropagationStopped()) {
          b.currentTarget = f.elem, d = 0;while ((g = f.handlers[d++]) && !b.isImmediatePropagationStopped()) {
            b.rnamespace && !b.rnamespace.test(g.namespace) || (b.handleObj = g, b.data = g.data, e = ((r.event.special[g.origType] || {}).handle || g.handler).apply(f.elem, i), void 0 !== e && (b.result = e) === !1 && (b.preventDefault(), b.stopPropagation()));
          }
        }return k.postDispatch && k.postDispatch.call(this, b), b.result;
      }
    }, handlers: function handlers(a, b) {
      var c,
          d,
          e,
          f,
          g,
          h = [],
          i = b.delegateCount,
          j = a.target;if (i && j.nodeType && !("click" === a.type && a.button >= 1)) for (; j !== this; j = j.parentNode || this) {
        if (1 === j.nodeType && ("click" !== a.type || j.disabled !== !0)) {
          for (f = [], g = {}, c = 0; c < i; c++) {
            d = b[c], e = d.selector + " ", void 0 === g[e] && (g[e] = d.needsContext ? r(e, this).index(j) > -1 : r.find(e, this, null, [j]).length), g[e] && f.push(d);
          }f.length && h.push({ elem: j, handlers: f });
        }
      }return j = this, i < b.length && h.push({ elem: j, handlers: b.slice(i) }), h;
    }, addProp: function addProp(a, b) {
      Object.defineProperty(r.Event.prototype, a, { enumerable: !0, configurable: !0, get: r.isFunction(b) ? function () {
          if (this.originalEvent) return b(this.originalEvent);
        } : function () {
          if (this.originalEvent) return this.originalEvent[a];
        }, set: function set(b) {
          Object.defineProperty(this, a, { enumerable: !0, configurable: !0, writable: !0, value: b });
        } });
    }, fix: function fix(a) {
      return a[r.expando] ? a : new r.Event(a);
    }, special: { load: { noBubble: !0 }, focus: { trigger: function trigger() {
          if (this !== wa() && this.focus) return this.focus(), !1;
        }, delegateType: "focusin" }, blur: { trigger: function trigger() {
          if (this === wa() && this.blur) return this.blur(), !1;
        }, delegateType: "focusout" }, click: { trigger: function trigger() {
          if ("checkbox" === this.type && this.click && r.nodeName(this, "input")) return this.click(), !1;
        }, _default: function _default(a) {
          return r.nodeName(a.target, "a");
        } }, beforeunload: { postDispatch: function postDispatch(a) {
          void 0 !== a.result && a.originalEvent && (a.originalEvent.returnValue = a.result);
        } } } }, r.removeEvent = function (a, b, c) {
    a.removeEventListener && a.removeEventListener(b, c);
  }, r.Event = function (a, b) {
    return this instanceof r.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || void 0 === a.defaultPrevented && a.returnValue === !1 ? ua : va, this.target = a.target && 3 === a.target.nodeType ? a.target.parentNode : a.target, this.currentTarget = a.currentTarget, this.relatedTarget = a.relatedTarget) : this.type = a, b && r.extend(this, b), this.timeStamp = a && a.timeStamp || r.now(), void (this[r.expando] = !0)) : new r.Event(a, b);
  }, r.Event.prototype = { constructor: r.Event, isDefaultPrevented: va, isPropagationStopped: va, isImmediatePropagationStopped: va, isSimulated: !1, preventDefault: function preventDefault() {
      var a = this.originalEvent;this.isDefaultPrevented = ua, a && !this.isSimulated && a.preventDefault();
    }, stopPropagation: function stopPropagation() {
      var a = this.originalEvent;this.isPropagationStopped = ua, a && !this.isSimulated && a.stopPropagation();
    }, stopImmediatePropagation: function stopImmediatePropagation() {
      var a = this.originalEvent;this.isImmediatePropagationStopped = ua, a && !this.isSimulated && a.stopImmediatePropagation(), this.stopPropagation();
    } }, r.each({ altKey: !0, bubbles: !0, cancelable: !0, changedTouches: !0, ctrlKey: !0, detail: !0, eventPhase: !0, metaKey: !0, pageX: !0, pageY: !0, shiftKey: !0, view: !0, "char": !0, charCode: !0, key: !0, keyCode: !0, button: !0, buttons: !0, clientX: !0, clientY: !0, offsetX: !0, offsetY: !0, pointerId: !0, pointerType: !0, screenX: !0, screenY: !0, targetTouches: !0, toElement: !0, touches: !0, which: function which(a) {
      var b = a.button;return null == a.which && ra.test(a.type) ? null != a.charCode ? a.charCode : a.keyCode : !a.which && void 0 !== b && sa.test(a.type) ? 1 & b ? 1 : 2 & b ? 3 : 4 & b ? 2 : 0 : a.which;
    } }, r.event.addProp), r.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function (a, b) {
    r.event.special[a] = { delegateType: b, bindType: b, handle: function handle(a) {
        var c,
            d = this,
            e = a.relatedTarget,
            f = a.handleObj;return e && (e === d || r.contains(d, e)) || (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c;
      } };
  }), r.fn.extend({ on: function on(a, b, c, d) {
      return xa(this, a, b, c, d);
    }, one: function one(a, b, c, d) {
      return xa(this, a, b, c, d, 1);
    }, off: function off(a, b, c) {
      var d, e;if (a && a.preventDefault && a.handleObj) return d = a.handleObj, r(a.delegateTarget).off(d.namespace ? d.origType + "." + d.namespace : d.origType, d.selector, d.handler), this;if ("object" == (typeof a === "undefined" ? "undefined" : _typeof(a))) {
        for (e in a) {
          this.off(e, b, a[e]);
        }return this;
      }return b !== !1 && "function" != typeof b || (c = b, b = void 0), c === !1 && (c = va), this.each(function () {
        r.event.remove(this, a, c, b);
      });
    } });var ya = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
      za = /<script|<style|<link/i,
      Aa = /checked\s*(?:[^=]|=\s*.checked.)/i,
      Ba = /^true\/(.*)/,
      Ca = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Da(a, b) {
    return r.nodeName(a, "table") && r.nodeName(11 !== b.nodeType ? b : b.firstChild, "tr") ? a.getElementsByTagName("tbody")[0] || a : a;
  }function Ea(a) {
    return a.type = (null !== a.getAttribute("type")) + "/" + a.type, a;
  }function Fa(a) {
    var b = Ba.exec(a.type);return b ? a.type = b[1] : a.removeAttribute("type"), a;
  }function Ga(a, b) {
    var c, d, e, f, g, h, i, j;if (1 === b.nodeType) {
      if (V.hasData(a) && (f = V.access(a), g = V.set(b, f), j = f.events)) {
        delete g.handle, g.events = {};for (e in j) {
          for (c = 0, d = j[e].length; c < d; c++) {
            r.event.add(b, e, j[e][c]);
          }
        }
      }W.hasData(a) && (h = W.access(a), i = r.extend({}, h), W.set(b, i));
    }
  }function Ha(a, b) {
    var c = b.nodeName.toLowerCase();"input" === c && ia.test(a.type) ? b.checked = a.checked : "input" !== c && "textarea" !== c || (b.defaultValue = a.defaultValue);
  }function Ia(a, b, c, d) {
    b = g.apply([], b);var e,
        f,
        h,
        i,
        j,
        k,
        l = 0,
        m = a.length,
        n = m - 1,
        q = b[0],
        s = r.isFunction(q);if (s || m > 1 && "string" == typeof q && !o.checkClone && Aa.test(q)) return a.each(function (e) {
      var f = a.eq(e);s && (b[0] = q.call(this, e, f.html())), Ia(f, b, c, d);
    });if (m && (e = pa(b, a[0].ownerDocument, !1, a, d), f = e.firstChild, 1 === e.childNodes.length && (e = f), f || d)) {
      for (h = r.map(ma(e, "script"), Ea), i = h.length; l < m; l++) {
        j = e, l !== n && (j = r.clone(j, !0, !0), i && r.merge(h, ma(j, "script"))), c.call(a[l], j, l);
      }if (i) for (k = h[h.length - 1].ownerDocument, r.map(h, Fa), l = 0; l < i; l++) {
        j = h[l], ka.test(j.type || "") && !V.access(j, "globalEval") && r.contains(k, j) && (j.src ? r._evalUrl && r._evalUrl(j.src) : p(j.textContent.replace(Ca, ""), k));
      }
    }return a;
  }function Ja(a, b, c) {
    for (var d, e = b ? r.filter(b, a) : a, f = 0; null != (d = e[f]); f++) {
      c || 1 !== d.nodeType || r.cleanData(ma(d)), d.parentNode && (c && r.contains(d.ownerDocument, d) && na(ma(d, "script")), d.parentNode.removeChild(d));
    }return a;
  }r.extend({ htmlPrefilter: function htmlPrefilter(a) {
      return a.replace(ya, "<$1></$2>");
    }, clone: function clone(a, b, c) {
      var d,
          e,
          f,
          g,
          h = a.cloneNode(!0),
          i = r.contains(a.ownerDocument, a);if (!(o.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || r.isXMLDoc(a))) for (g = ma(h), f = ma(a), d = 0, e = f.length; d < e; d++) {
        Ha(f[d], g[d]);
      }if (b) if (c) for (f = f || ma(a), g = g || ma(h), d = 0, e = f.length; d < e; d++) {
        Ga(f[d], g[d]);
      } else Ga(a, h);return g = ma(h, "script"), g.length > 0 && na(g, !i && ma(a, "script")), h;
    }, cleanData: function cleanData(a) {
      for (var b, c, d, e = r.event.special, f = 0; void 0 !== (c = a[f]); f++) {
        if (T(c)) {
          if (b = c[V.expando]) {
            if (b.events) for (d in b.events) {
              e[d] ? r.event.remove(c, d) : r.removeEvent(c, d, b.handle);
            }c[V.expando] = void 0;
          }c[W.expando] && (c[W.expando] = void 0);
        }
      }
    } }), r.fn.extend({ detach: function detach(a) {
      return Ja(this, a, !0);
    }, remove: function remove(a) {
      return Ja(this, a);
    }, text: function text(a) {
      return S(this, function (a) {
        return void 0 === a ? r.text(this) : this.empty().each(function () {
          1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || (this.textContent = a);
        });
      }, null, a, arguments.length);
    }, append: function append() {
      return Ia(this, arguments, function (a) {
        if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
          var b = Da(this, a);b.appendChild(a);
        }
      });
    }, prepend: function prepend() {
      return Ia(this, arguments, function (a) {
        if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
          var b = Da(this, a);b.insertBefore(a, b.firstChild);
        }
      });
    }, before: function before() {
      return Ia(this, arguments, function (a) {
        this.parentNode && this.parentNode.insertBefore(a, this);
      });
    }, after: function after() {
      return Ia(this, arguments, function (a) {
        this.parentNode && this.parentNode.insertBefore(a, this.nextSibling);
      });
    }, empty: function empty() {
      for (var a, b = 0; null != (a = this[b]); b++) {
        1 === a.nodeType && (r.cleanData(ma(a, !1)), a.textContent = "");
      }return this;
    }, clone: function clone(a, b) {
      return a = null != a && a, b = null == b ? a : b, this.map(function () {
        return r.clone(this, a, b);
      });
    }, html: function html(a) {
      return S(this, function (a) {
        var b = this[0] || {},
            c = 0,
            d = this.length;if (void 0 === a && 1 === b.nodeType) return b.innerHTML;if ("string" == typeof a && !za.test(a) && !la[(ja.exec(a) || ["", ""])[1].toLowerCase()]) {
          a = r.htmlPrefilter(a);try {
            for (; c < d; c++) {
              b = this[c] || {}, 1 === b.nodeType && (r.cleanData(ma(b, !1)), b.innerHTML = a);
            }b = 0;
          } catch (e) {}
        }b && this.empty().append(a);
      }, null, a, arguments.length);
    }, replaceWith: function replaceWith() {
      var a = [];return Ia(this, arguments, function (b) {
        var c = this.parentNode;r.inArray(this, a) < 0 && (r.cleanData(ma(this)), c && c.replaceChild(b, this));
      }, a);
    } }), r.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (a, b) {
    r.fn[a] = function (a) {
      for (var c, d = [], e = r(a), f = e.length - 1, g = 0; g <= f; g++) {
        c = g === f ? this : this.clone(!0), r(e[g])[b](c), h.apply(d, c.get());
      }return this.pushStack(d);
    };
  });var Ka = /^margin/,
      La = new RegExp("^(" + _ + ")(?!px)[a-z%]+$", "i"),
      Ma = function Ma(b) {
    var c = b.ownerDocument.defaultView;return c && c.opener || (c = a), c.getComputedStyle(b);
  };!function () {
    function b() {
      if (i) {
        i.style.cssText = "box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%", i.innerHTML = "", qa.appendChild(h);var b = a.getComputedStyle(i);c = "1%" !== b.top, g = "2px" === b.marginLeft, e = "4px" === b.width, i.style.marginRight = "50%", f = "4px" === b.marginRight, qa.removeChild(h), i = null;
      }
    }var c,
        e,
        f,
        g,
        h = d.createElement("div"),
        i = d.createElement("div");i.style && (i.style.backgroundClip = "content-box", i.cloneNode(!0).style.backgroundClip = "", o.clearCloneStyle = "content-box" === i.style.backgroundClip, h.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute", h.appendChild(i), r.extend(o, { pixelPosition: function pixelPosition() {
        return b(), c;
      }, boxSizingReliable: function boxSizingReliable() {
        return b(), e;
      }, pixelMarginRight: function pixelMarginRight() {
        return b(), f;
      }, reliableMarginLeft: function reliableMarginLeft() {
        return b(), g;
      } }));
  }();function Na(a, b, c) {
    var d,
        e,
        f,
        g,
        h = a.style;return c = c || Ma(a), c && (g = c.getPropertyValue(b) || c[b], "" !== g || r.contains(a.ownerDocument, a) || (g = r.style(a, b)), !o.pixelMarginRight() && La.test(g) && Ka.test(b) && (d = h.width, e = h.minWidth, f = h.maxWidth, h.minWidth = h.maxWidth = h.width = g, g = c.width, h.width = d, h.minWidth = e, h.maxWidth = f)), void 0 !== g ? g + "" : g;
  }function Oa(a, b) {
    return { get: function get() {
        return a() ? void delete this.get : (this.get = b).apply(this, arguments);
      } };
  }var Pa = /^(none|table(?!-c[ea]).+)/,
      Qa = { position: "absolute", visibility: "hidden", display: "block" },
      Ra = { letterSpacing: "0", fontWeight: "400" },
      Sa = ["Webkit", "Moz", "ms"],
      Ta = d.createElement("div").style;function Ua(a) {
    if (a in Ta) return a;var b = a[0].toUpperCase() + a.slice(1),
        c = Sa.length;while (c--) {
      if (a = Sa[c] + b, a in Ta) return a;
    }
  }function Va(a, b, c) {
    var d = aa.exec(b);return d ? Math.max(0, d[2] - (c || 0)) + (d[3] || "px") : b;
  }function Wa(a, b, c, d, e) {
    var f,
        g = 0;for (f = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0; f < 4; f += 2) {
      "margin" === c && (g += r.css(a, c + ba[f], !0, e)), d ? ("content" === c && (g -= r.css(a, "padding" + ba[f], !0, e)), "margin" !== c && (g -= r.css(a, "border" + ba[f] + "Width", !0, e))) : (g += r.css(a, "padding" + ba[f], !0, e), "padding" !== c && (g += r.css(a, "border" + ba[f] + "Width", !0, e)));
    }return g;
  }function Xa(a, b, c) {
    var d,
        e = !0,
        f = Ma(a),
        g = "border-box" === r.css(a, "boxSizing", !1, f);if (a.getClientRects().length && (d = a.getBoundingClientRect()[b]), d <= 0 || null == d) {
      if (d = Na(a, b, f), (d < 0 || null == d) && (d = a.style[b]), La.test(d)) return d;e = g && (o.boxSizingReliable() || d === a.style[b]), d = parseFloat(d) || 0;
    }return d + Wa(a, b, c || (g ? "border" : "content"), e, f) + "px";
  }r.extend({ cssHooks: { opacity: { get: function get(a, b) {
          if (b) {
            var c = Na(a, "opacity");return "" === c ? "1" : c;
          }
        } } }, cssNumber: { animationIterationCount: !0, columnCount: !0, fillOpacity: !0, flexGrow: !0, flexShrink: !0, fontWeight: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": "cssFloat" }, style: function style(a, b, c, d) {
      if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) {
        var e,
            f,
            g,
            h = r.camelCase(b),
            i = a.style;return b = r.cssProps[h] || (r.cssProps[h] = Ua(h) || h), g = r.cssHooks[b] || r.cssHooks[h], void 0 === c ? g && "get" in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b] : (f = typeof c === "undefined" ? "undefined" : _typeof(c), "string" === f && (e = aa.exec(c)) && e[1] && (c = ea(a, b, e), f = "number"), null != c && c === c && ("number" === f && (c += e && e[3] || (r.cssNumber[h] ? "" : "px")), o.clearCloneStyle || "" !== c || 0 !== b.indexOf("background") || (i[b] = "inherit"), g && "set" in g && void 0 === (c = g.set(a, c, d)) || (i[b] = c)), void 0);
      }
    }, css: function css(a, b, c, d) {
      var e,
          f,
          g,
          h = r.camelCase(b);return b = r.cssProps[h] || (r.cssProps[h] = Ua(h) || h), g = r.cssHooks[b] || r.cssHooks[h], g && "get" in g && (e = g.get(a, !0, c)), void 0 === e && (e = Na(a, b, d)), "normal" === e && b in Ra && (e = Ra[b]), "" === c || c ? (f = parseFloat(e), c === !0 || isFinite(f) ? f || 0 : e) : e;
    } }), r.each(["height", "width"], function (a, b) {
    r.cssHooks[b] = { get: function get(a, c, d) {
        if (c) return !Pa.test(r.css(a, "display")) || a.getClientRects().length && a.getBoundingClientRect().width ? Xa(a, b, d) : da(a, Qa, function () {
          return Xa(a, b, d);
        });
      }, set: function set(a, c, d) {
        var e,
            f = d && Ma(a),
            g = d && Wa(a, b, d, "border-box" === r.css(a, "boxSizing", !1, f), f);return g && (e = aa.exec(c)) && "px" !== (e[3] || "px") && (a.style[b] = c, c = r.css(a, b)), Va(a, c, g);
      } };
  }), r.cssHooks.marginLeft = Oa(o.reliableMarginLeft, function (a, b) {
    if (b) return (parseFloat(Na(a, "marginLeft")) || a.getBoundingClientRect().left - da(a, { marginLeft: 0 }, function () {
      return a.getBoundingClientRect().left;
    })) + "px";
  }), r.each({ margin: "", padding: "", border: "Width" }, function (a, b) {
    r.cssHooks[a + b] = { expand: function expand(c) {
        for (var d = 0, e = {}, f = "string" == typeof c ? c.split(" ") : [c]; d < 4; d++) {
          e[a + ba[d] + b] = f[d] || f[d - 2] || f[0];
        }return e;
      } }, Ka.test(a) || (r.cssHooks[a + b].set = Va);
  }), r.fn.extend({ css: function css(a, b) {
      return S(this, function (a, b, c) {
        var d,
            e,
            f = {},
            g = 0;if (r.isArray(b)) {
          for (d = Ma(a), e = b.length; g < e; g++) {
            f[b[g]] = r.css(a, b[g], !1, d);
          }return f;
        }return void 0 !== c ? r.style(a, b, c) : r.css(a, b);
      }, a, b, arguments.length > 1);
    } });function Ya(a, b, c, d, e) {
    return new Ya.prototype.init(a, b, c, d, e);
  }r.Tween = Ya, Ya.prototype = { constructor: Ya, init: function init(a, b, c, d, e, f) {
      this.elem = a, this.prop = c, this.easing = e || r.easing._default, this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || (r.cssNumber[c] ? "" : "px");
    }, cur: function cur() {
      var a = Ya.propHooks[this.prop];return a && a.get ? a.get(this) : Ya.propHooks._default.get(this);
    }, run: function run(a) {
      var b,
          c = Ya.propHooks[this.prop];return this.options.duration ? this.pos = b = r.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : this.pos = b = a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : Ya.propHooks._default.set(this), this;
    } }, Ya.prototype.init.prototype = Ya.prototype, Ya.propHooks = { _default: { get: function get(a) {
        var b;return 1 !== a.elem.nodeType || null != a.elem[a.prop] && null == a.elem.style[a.prop] ? a.elem[a.prop] : (b = r.css(a.elem, a.prop, ""), b && "auto" !== b ? b : 0);
      }, set: function set(a) {
        r.fx.step[a.prop] ? r.fx.step[a.prop](a) : 1 !== a.elem.nodeType || null == a.elem.style[r.cssProps[a.prop]] && !r.cssHooks[a.prop] ? a.elem[a.prop] = a.now : r.style(a.elem, a.prop, a.now + a.unit);
      } } }, Ya.propHooks.scrollTop = Ya.propHooks.scrollLeft = { set: function set(a) {
      a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now);
    } }, r.easing = { linear: function linear(a) {
      return a;
    }, swing: function swing(a) {
      return .5 - Math.cos(a * Math.PI) / 2;
    }, _default: "swing" }, r.fx = Ya.prototype.init, r.fx.step = {};var Za,
      $a,
      _a = /^(?:toggle|show|hide)$/,
      ab = /queueHooks$/;function bb() {
    $a && (a.requestAnimationFrame(bb), r.fx.tick());
  }function cb() {
    return a.setTimeout(function () {
      Za = void 0;
    }), Za = r.now();
  }function db(a, b) {
    var c,
        d = 0,
        e = { height: a };for (b = b ? 1 : 0; d < 4; d += 2 - b) {
      c = ba[d], e["margin" + c] = e["padding" + c] = a;
    }return b && (e.opacity = e.width = a), e;
  }function eb(a, b, c) {
    for (var d, e = (hb.tweeners[b] || []).concat(hb.tweeners["*"]), f = 0, g = e.length; f < g; f++) {
      if (d = e[f].call(c, b, a)) return d;
    }
  }function fb(a, b, c) {
    var d,
        e,
        f,
        g,
        h,
        i,
        j,
        k,
        l = "width" in b || "height" in b,
        m = this,
        n = {},
        o = a.style,
        p = a.nodeType && ca(a),
        q = V.get(a, "fxshow");c.queue || (g = r._queueHooks(a, "fx"), null == g.unqueued && (g.unqueued = 0, h = g.empty.fire, g.empty.fire = function () {
      g.unqueued || h();
    }), g.unqueued++, m.always(function () {
      m.always(function () {
        g.unqueued--, r.queue(a, "fx").length || g.empty.fire();
      });
    }));for (d in b) {
      if (e = b[d], _a.test(e)) {
        if (delete b[d], f = f || "toggle" === e, e === (p ? "hide" : "show")) {
          if ("show" !== e || !q || void 0 === q[d]) continue;p = !0;
        }n[d] = q && q[d] || r.style(a, d);
      }
    }if (i = !r.isEmptyObject(b), i || !r.isEmptyObject(n)) {
      l && 1 === a.nodeType && (c.overflow = [o.overflow, o.overflowX, o.overflowY], j = q && q.display, null == j && (j = V.get(a, "display")), k = r.css(a, "display"), "none" === k && (j ? k = j : (ha([a], !0), j = a.style.display || j, k = r.css(a, "display"), ha([a]))), ("inline" === k || "inline-block" === k && null != j) && "none" === r.css(a, "float") && (i || (m.done(function () {
        o.display = j;
      }), null == j && (k = o.display, j = "none" === k ? "" : k)), o.display = "inline-block")), c.overflow && (o.overflow = "hidden", m.always(function () {
        o.overflow = c.overflow[0], o.overflowX = c.overflow[1], o.overflowY = c.overflow[2];
      })), i = !1;for (d in n) {
        i || (q ? "hidden" in q && (p = q.hidden) : q = V.access(a, "fxshow", { display: j }), f && (q.hidden = !p), p && ha([a], !0), m.done(function () {
          p || ha([a]), V.remove(a, "fxshow");for (d in n) {
            r.style(a, d, n[d]);
          }
        })), i = eb(p ? q[d] : 0, d, m), d in q || (q[d] = i.start, p && (i.end = i.start, i.start = 0));
      }
    }
  }function gb(a, b) {
    var c, d, e, f, g;for (c in a) {
      if (d = r.camelCase(c), e = b[d], f = a[c], r.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = r.cssHooks[d], g && "expand" in g) {
        f = g.expand(f), delete a[d];for (c in f) {
          c in a || (a[c] = f[c], b[c] = e);
        }
      } else b[d] = e;
    }
  }function hb(a, b, c) {
    var d,
        e,
        f = 0,
        g = hb.prefilters.length,
        h = r.Deferred().always(function () {
      delete i.elem;
    }),
        i = function i() {
      if (e) return !1;for (var b = Za || cb(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; g < i; g++) {
        j.tweens[g].run(f);
      }return h.notifyWith(a, [j, f, c]), f < 1 && i ? c : (h.resolveWith(a, [j]), !1);
    },
        j = h.promise({ elem: a, props: r.extend({}, b), opts: r.extend(!0, { specialEasing: {}, easing: r.easing._default }, c), originalProperties: b, originalOptions: c, startTime: Za || cb(), duration: c.duration, tweens: [], createTween: function createTween(b, c) {
        var d = r.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing);return j.tweens.push(d), d;
      }, stop: function stop(b) {
        var c = 0,
            d = b ? j.tweens.length : 0;if (e) return this;for (e = !0; c < d; c++) {
          j.tweens[c].run(1);
        }return b ? (h.notifyWith(a, [j, 1, 0]), h.resolveWith(a, [j, b])) : h.rejectWith(a, [j, b]), this;
      } }),
        k = j.props;for (gb(k, j.opts.specialEasing); f < g; f++) {
      if (d = hb.prefilters[f].call(j, a, k, j.opts)) return r.isFunction(d.stop) && (r._queueHooks(j.elem, j.opts.queue).stop = r.proxy(d.stop, d)), d;
    }return r.map(k, eb, j), r.isFunction(j.opts.start) && j.opts.start.call(a, j), r.fx.timer(r.extend(i, { elem: a, anim: j, queue: j.opts.queue })), j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always);
  }r.Animation = r.extend(hb, { tweeners: { "*": [function (a, b) {
        var c = this.createTween(a, b);return ea(c.elem, a, aa.exec(b), c), c;
      }] }, tweener: function tweener(a, b) {
      r.isFunction(a) ? (b = a, a = ["*"]) : a = a.match(K);for (var c, d = 0, e = a.length; d < e; d++) {
        c = a[d], hb.tweeners[c] = hb.tweeners[c] || [], hb.tweeners[c].unshift(b);
      }
    }, prefilters: [fb], prefilter: function prefilter(a, b) {
      b ? hb.prefilters.unshift(a) : hb.prefilters.push(a);
    } }), r.speed = function (a, b, c) {
    var e = a && "object" == (typeof a === "undefined" ? "undefined" : _typeof(a)) ? r.extend({}, a) : { complete: c || !c && b || r.isFunction(a) && a, duration: a, easing: c && b || b && !r.isFunction(b) && b };return r.fx.off || d.hidden ? e.duration = 0 : "number" != typeof e.duration && (e.duration in r.fx.speeds ? e.duration = r.fx.speeds[e.duration] : e.duration = r.fx.speeds._default), null != e.queue && e.queue !== !0 || (e.queue = "fx"), e.old = e.complete, e.complete = function () {
      r.isFunction(e.old) && e.old.call(this), e.queue && r.dequeue(this, e.queue);
    }, e;
  }, r.fn.extend({ fadeTo: function fadeTo(a, b, c, d) {
      return this.filter(ca).css("opacity", 0).show().end().animate({ opacity: b }, a, c, d);
    }, animate: function animate(a, b, c, d) {
      var e = r.isEmptyObject(a),
          f = r.speed(b, c, d),
          g = function g() {
        var b = hb(this, r.extend({}, a), f);(e || V.get(this, "finish")) && b.stop(!0);
      };return g.finish = g, e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g);
    }, stop: function stop(a, b, c) {
      var d = function d(a) {
        var b = a.stop;delete a.stop, b(c);
      };return "string" != typeof a && (c = b, b = a, a = void 0), b && a !== !1 && this.queue(a || "fx", []), this.each(function () {
        var b = !0,
            e = null != a && a + "queueHooks",
            f = r.timers,
            g = V.get(this);if (e) g[e] && g[e].stop && d(g[e]);else for (e in g) {
          g[e] && g[e].stop && ab.test(e) && d(g[e]);
        }for (e = f.length; e--;) {
          f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b = !1, f.splice(e, 1));
        }!b && c || r.dequeue(this, a);
      });
    }, finish: function finish(a) {
      return a !== !1 && (a = a || "fx"), this.each(function () {
        var b,
            c = V.get(this),
            d = c[a + "queue"],
            e = c[a + "queueHooks"],
            f = r.timers,
            g = d ? d.length : 0;for (c.finish = !0, r.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--;) {
          f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0), f.splice(b, 1));
        }for (b = 0; b < g; b++) {
          d[b] && d[b].finish && d[b].finish.call(this);
        }delete c.finish;
      });
    } }), r.each(["toggle", "show", "hide"], function (a, b) {
    var c = r.fn[b];r.fn[b] = function (a, d, e) {
      return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(db(b, !0), a, d, e);
    };
  }), r.each({ slideDown: db("show"), slideUp: db("hide"), slideToggle: db("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (a, b) {
    r.fn[a] = function (a, c, d) {
      return this.animate(b, a, c, d);
    };
  }), r.timers = [], r.fx.tick = function () {
    var a,
        b = 0,
        c = r.timers;for (Za = r.now(); b < c.length; b++) {
      a = c[b], a() || c[b] !== a || c.splice(b--, 1);
    }c.length || r.fx.stop(), Za = void 0;
  }, r.fx.timer = function (a) {
    r.timers.push(a), a() ? r.fx.start() : r.timers.pop();
  }, r.fx.interval = 13, r.fx.start = function () {
    $a || ($a = a.requestAnimationFrame ? a.requestAnimationFrame(bb) : a.setInterval(r.fx.tick, r.fx.interval));
  }, r.fx.stop = function () {
    a.cancelAnimationFrame ? a.cancelAnimationFrame($a) : a.clearInterval($a), $a = null;
  }, r.fx.speeds = { slow: 600, fast: 200, _default: 400 }, r.fn.delay = function (b, c) {
    return b = r.fx ? r.fx.speeds[b] || b : b, c = c || "fx", this.queue(c, function (c, d) {
      var e = a.setTimeout(c, b);d.stop = function () {
        a.clearTimeout(e);
      };
    });
  }, function () {
    var a = d.createElement("input"),
        b = d.createElement("select"),
        c = b.appendChild(d.createElement("option"));a.type = "checkbox", o.checkOn = "" !== a.value, o.optSelected = c.selected, a = d.createElement("input"), a.value = "t", a.type = "radio", o.radioValue = "t" === a.value;
  }();var ib,
      jb = r.expr.attrHandle;r.fn.extend({ attr: function attr(a, b) {
      return S(this, r.attr, a, b, arguments.length > 1);
    }, removeAttr: function removeAttr(a) {
      return this.each(function () {
        r.removeAttr(this, a);
      });
    } }), r.extend({ attr: function attr(a, b, c) {
      var d,
          e,
          f = a.nodeType;if (3 !== f && 8 !== f && 2 !== f) return "undefined" == typeof a.getAttribute ? r.prop(a, b, c) : (1 === f && r.isXMLDoc(a) || (e = r.attrHooks[b.toLowerCase()] || (r.expr.match.bool.test(b) ? ib : void 0)), void 0 !== c ? null === c ? void r.removeAttr(a, b) : e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : (a.setAttribute(b, c + ""), c) : e && "get" in e && null !== (d = e.get(a, b)) ? d : (d = r.find.attr(a, b), null == d ? void 0 : d));
    }, attrHooks: { type: { set: function set(a, b) {
          if (!o.radioValue && "radio" === b && r.nodeName(a, "input")) {
            var c = a.value;return a.setAttribute("type", b), c && (a.value = c), b;
          }
        } } }, removeAttr: function removeAttr(a, b) {
      var c,
          d = 0,
          e = b && b.match(K);if (e && 1 === a.nodeType) while (c = e[d++]) {
        a.removeAttribute(c);
      }
    } }), ib = { set: function set(a, b, c) {
      return b === !1 ? r.removeAttr(a, c) : a.setAttribute(c, c), c;
    } }, r.each(r.expr.match.bool.source.match(/\w+/g), function (a, b) {
    var c = jb[b] || r.find.attr;jb[b] = function (a, b, d) {
      var e,
          f,
          g = b.toLowerCase();return d || (f = jb[g], jb[g] = e, e = null != c(a, b, d) ? g : null, jb[g] = f), e;
    };
  });var kb = /^(?:input|select|textarea|button)$/i,
      lb = /^(?:a|area)$/i;r.fn.extend({ prop: function prop(a, b) {
      return S(this, r.prop, a, b, arguments.length > 1);
    }, removeProp: function removeProp(a) {
      return this.each(function () {
        delete this[r.propFix[a] || a];
      });
    } }), r.extend({ prop: function prop(a, b, c) {
      var d,
          e,
          f = a.nodeType;if (3 !== f && 8 !== f && 2 !== f) return 1 === f && r.isXMLDoc(a) || (b = r.propFix[b] || b, e = r.propHooks[b]), void 0 !== c ? e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : a[b] = c : e && "get" in e && null !== (d = e.get(a, b)) ? d : a[b];
    }, propHooks: { tabIndex: { get: function get(a) {
          var b = r.find.attr(a, "tabindex");return b ? parseInt(b, 10) : kb.test(a.nodeName) || lb.test(a.nodeName) && a.href ? 0 : -1;
        } } }, propFix: { "for": "htmlFor", "class": "className" } }), o.optSelected || (r.propHooks.selected = { get: function get(a) {
      var b = a.parentNode;return b && b.parentNode && b.parentNode.selectedIndex, null;
    }, set: function set(a) {
      var b = a.parentNode;b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex);
    } }), r.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () {
    r.propFix[this.toLowerCase()] = this;
  });function mb(a) {
    var b = a.match(K) || [];return b.join(" ");
  }function nb(a) {
    return a.getAttribute && a.getAttribute("class") || "";
  }r.fn.extend({ addClass: function addClass(a) {
      var b,
          c,
          d,
          e,
          f,
          g,
          h,
          i = 0;if (r.isFunction(a)) return this.each(function (b) {
        r(this).addClass(a.call(this, b, nb(this)));
      });if ("string" == typeof a && a) {
        b = a.match(K) || [];while (c = this[i++]) {
          if (e = nb(c), d = 1 === c.nodeType && " " + mb(e) + " ") {
            g = 0;while (f = b[g++]) {
              d.indexOf(" " + f + " ") < 0 && (d += f + " ");
            }h = mb(d), e !== h && c.setAttribute("class", h);
          }
        }
      }return this;
    }, removeClass: function removeClass(a) {
      var b,
          c,
          d,
          e,
          f,
          g,
          h,
          i = 0;if (r.isFunction(a)) return this.each(function (b) {
        r(this).removeClass(a.call(this, b, nb(this)));
      });if (!arguments.length) return this.attr("class", "");if ("string" == typeof a && a) {
        b = a.match(K) || [];while (c = this[i++]) {
          if (e = nb(c), d = 1 === c.nodeType && " " + mb(e) + " ") {
            g = 0;while (f = b[g++]) {
              while (d.indexOf(" " + f + " ") > -1) {
                d = d.replace(" " + f + " ", " ");
              }
            }h = mb(d), e !== h && c.setAttribute("class", h);
          }
        }
      }return this;
    }, toggleClass: function toggleClass(a, b) {
      var c = typeof a === "undefined" ? "undefined" : _typeof(a);return "boolean" == typeof b && "string" === c ? b ? this.addClass(a) : this.removeClass(a) : r.isFunction(a) ? this.each(function (c) {
        r(this).toggleClass(a.call(this, c, nb(this), b), b);
      }) : this.each(function () {
        var b, d, e, f;if ("string" === c) {
          d = 0, e = r(this), f = a.match(K) || [];while (b = f[d++]) {
            e.hasClass(b) ? e.removeClass(b) : e.addClass(b);
          }
        } else void 0 !== a && "boolean" !== c || (b = nb(this), b && V.set(this, "__className__", b), this.setAttribute && this.setAttribute("class", b || a === !1 ? "" : V.get(this, "__className__") || ""));
      });
    }, hasClass: function hasClass(a) {
      var b,
          c,
          d = 0;b = " " + a + " ";while (c = this[d++]) {
        if (1 === c.nodeType && (" " + mb(nb(c)) + " ").indexOf(b) > -1) return !0;
      }return !1;
    } });var ob = /\r/g;r.fn.extend({ val: function val(a) {
      var b,
          c,
          d,
          e = this[0];{
        if (arguments.length) return d = r.isFunction(a), this.each(function (c) {
          var e;1 === this.nodeType && (e = d ? a.call(this, c, r(this).val()) : a, null == e ? e = "" : "number" == typeof e ? e += "" : r.isArray(e) && (e = r.map(e, function (a) {
            return null == a ? "" : a + "";
          })), b = r.valHooks[this.type] || r.valHooks[this.nodeName.toLowerCase()], b && "set" in b && void 0 !== b.set(this, e, "value") || (this.value = e));
        });if (e) return b = r.valHooks[e.type] || r.valHooks[e.nodeName.toLowerCase()], b && "get" in b && void 0 !== (c = b.get(e, "value")) ? c : (c = e.value, "string" == typeof c ? c.replace(ob, "") : null == c ? "" : c);
      }
    } }), r.extend({ valHooks: { option: { get: function get(a) {
          var b = r.find.attr(a, "value");return null != b ? b : mb(r.text(a));
        } }, select: { get: function get(a) {
          var b,
              c,
              d,
              e = a.options,
              f = a.selectedIndex,
              g = "select-one" === a.type,
              h = g ? null : [],
              i = g ? f + 1 : e.length;for (d = f < 0 ? i : g ? f : 0; d < i; d++) {
            if (c = e[d], (c.selected || d === f) && !c.disabled && (!c.parentNode.disabled || !r.nodeName(c.parentNode, "optgroup"))) {
              if (b = r(c).val(), g) return b;h.push(b);
            }
          }return h;
        }, set: function set(a, b) {
          var c,
              d,
              e = a.options,
              f = r.makeArray(b),
              g = e.length;while (g--) {
            d = e[g], (d.selected = r.inArray(r.valHooks.option.get(d), f) > -1) && (c = !0);
          }return c || (a.selectedIndex = -1), f;
        } } } }), r.each(["radio", "checkbox"], function () {
    r.valHooks[this] = { set: function set(a, b) {
        if (r.isArray(b)) return a.checked = r.inArray(r(a).val(), b) > -1;
      } }, o.checkOn || (r.valHooks[this].get = function (a) {
      return null === a.getAttribute("value") ? "on" : a.value;
    });
  });var pb = /^(?:focusinfocus|focusoutblur)$/;r.extend(r.event, { trigger: function trigger(b, c, e, f) {
      var g,
          h,
          i,
          j,
          k,
          m,
          n,
          o = [e || d],
          p = l.call(b, "type") ? b.type : b,
          q = l.call(b, "namespace") ? b.namespace.split(".") : [];if (h = i = e = e || d, 3 !== e.nodeType && 8 !== e.nodeType && !pb.test(p + r.event.triggered) && (p.indexOf(".") > -1 && (q = p.split("."), p = q.shift(), q.sort()), k = p.indexOf(":") < 0 && "on" + p, b = b[r.expando] ? b : new r.Event(p, "object" == (typeof b === "undefined" ? "undefined" : _typeof(b)) && b), b.isTrigger = f ? 2 : 3, b.namespace = q.join("."), b.rnamespace = b.namespace ? new RegExp("(^|\\.)" + q.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, b.result = void 0, b.target || (b.target = e), c = null == c ? [b] : r.makeArray(c, [b]), n = r.event.special[p] || {}, f || !n.trigger || n.trigger.apply(e, c) !== !1)) {
        if (!f && !n.noBubble && !r.isWindow(e)) {
          for (j = n.delegateType || p, pb.test(j + p) || (h = h.parentNode); h; h = h.parentNode) {
            o.push(h), i = h;
          }i === (e.ownerDocument || d) && o.push(i.defaultView || i.parentWindow || a);
        }g = 0;while ((h = o[g++]) && !b.isPropagationStopped()) {
          b.type = g > 1 ? j : n.bindType || p, m = (V.get(h, "events") || {})[b.type] && V.get(h, "handle"), m && m.apply(h, c), m = k && h[k], m && m.apply && T(h) && (b.result = m.apply(h, c), b.result === !1 && b.preventDefault());
        }return b.type = p, f || b.isDefaultPrevented() || n._default && n._default.apply(o.pop(), c) !== !1 || !T(e) || k && r.isFunction(e[p]) && !r.isWindow(e) && (i = e[k], i && (e[k] = null), r.event.triggered = p, e[p](), r.event.triggered = void 0, i && (e[k] = i)), b.result;
      }
    }, simulate: function simulate(a, b, c) {
      var d = r.extend(new r.Event(), c, { type: a, isSimulated: !0 });r.event.trigger(d, null, b);
    } }), r.fn.extend({ trigger: function trigger(a, b) {
      return this.each(function () {
        r.event.trigger(a, b, this);
      });
    }, triggerHandler: function triggerHandler(a, b) {
      var c = this[0];if (c) return r.event.trigger(a, b, c, !0);
    } }), r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "), function (a, b) {
    r.fn[b] = function (a, c) {
      return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b);
    };
  }), r.fn.extend({ hover: function hover(a, b) {
      return this.mouseenter(a).mouseleave(b || a);
    } }), o.focusin = "onfocusin" in a, o.focusin || r.each({ focus: "focusin", blur: "focusout" }, function (a, b) {
    var c = function c(a) {
      r.event.simulate(b, a.target, r.event.fix(a));
    };r.event.special[b] = { setup: function setup() {
        var d = this.ownerDocument || this,
            e = V.access(d, b);e || d.addEventListener(a, c, !0), V.access(d, b, (e || 0) + 1);
      }, teardown: function teardown() {
        var d = this.ownerDocument || this,
            e = V.access(d, b) - 1;e ? V.access(d, b, e) : (d.removeEventListener(a, c, !0), V.remove(d, b));
      } };
  });var qb = a.location,
      rb = r.now(),
      sb = /\?/;r.parseXML = function (b) {
    var c;if (!b || "string" != typeof b) return null;try {
      c = new a.DOMParser().parseFromString(b, "text/xml");
    } catch (d) {
      c = void 0;
    }return c && !c.getElementsByTagName("parsererror").length || r.error("Invalid XML: " + b), c;
  };var tb = /\[\]$/,
      ub = /\r?\n/g,
      vb = /^(?:submit|button|image|reset|file)$/i,
      wb = /^(?:input|select|textarea|keygen)/i;function xb(a, b, c, d) {
    var e;if (r.isArray(b)) r.each(b, function (b, e) {
      c || tb.test(a) ? d(a, e) : xb(a + "[" + ("object" == (typeof e === "undefined" ? "undefined" : _typeof(e)) && null != e ? b : "") + "]", e, c, d);
    });else if (c || "object" !== r.type(b)) d(a, b);else for (e in b) {
      xb(a + "[" + e + "]", b[e], c, d);
    }
  }r.param = function (a, b) {
    var c,
        d = [],
        e = function e(a, b) {
      var c = r.isFunction(b) ? b() : b;d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(null == c ? "" : c);
    };if (r.isArray(a) || a.jquery && !r.isPlainObject(a)) r.each(a, function () {
      e(this.name, this.value);
    });else for (c in a) {
      xb(c, a[c], b, e);
    }return d.join("&");
  }, r.fn.extend({ serialize: function serialize() {
      return r.param(this.serializeArray());
    }, serializeArray: function serializeArray() {
      return this.map(function () {
        var a = r.prop(this, "elements");return a ? r.makeArray(a) : this;
      }).filter(function () {
        var a = this.type;return this.name && !r(this).is(":disabled") && wb.test(this.nodeName) && !vb.test(a) && (this.checked || !ia.test(a));
      }).map(function (a, b) {
        var c = r(this).val();return null == c ? null : r.isArray(c) ? r.map(c, function (a) {
          return { name: b.name, value: a.replace(ub, "\r\n") };
        }) : { name: b.name, value: c.replace(ub, "\r\n") };
      }).get();
    } });var yb = /%20/g,
      zb = /#.*$/,
      Ab = /([?&])_=[^&]*/,
      Bb = /^(.*?):[ \t]*([^\r\n]*)$/gm,
      Cb = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
      Db = /^(?:GET|HEAD)$/,
      Eb = /^\/\//,
      Fb = {},
      Gb = {},
      Hb = "*/".concat("*"),
      Ib = d.createElement("a");Ib.href = qb.href;function Jb(a) {
    return function (b, c) {
      "string" != typeof b && (c = b, b = "*");var d,
          e = 0,
          f = b.toLowerCase().match(K) || [];if (r.isFunction(c)) while (d = f[e++]) {
        "+" === d[0] ? (d = d.slice(1) || "*", (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c);
      }
    };
  }function Kb(a, b, c, d) {
    var e = {},
        f = a === Gb;function g(h) {
      var i;return e[h] = !0, r.each(a[h] || [], function (a, h) {
        var j = h(b, c, d);return "string" != typeof j || f || e[j] ? f ? !(i = j) : void 0 : (b.dataTypes.unshift(j), g(j), !1);
      }), i;
    }return g(b.dataTypes[0]) || !e["*"] && g("*");
  }function Lb(a, b) {
    var c,
        d,
        e = r.ajaxSettings.flatOptions || {};for (c in b) {
      void 0 !== b[c] && ((e[c] ? a : d || (d = {}))[c] = b[c]);
    }return d && r.extend(!0, a, d), a;
  }function Mb(a, b, c) {
    var d,
        e,
        f,
        g,
        h = a.contents,
        i = a.dataTypes;while ("*" === i[0]) {
      i.shift(), void 0 === d && (d = a.mimeType || b.getResponseHeader("Content-Type"));
    }if (d) for (e in h) {
      if (h[e] && h[e].test(d)) {
        i.unshift(e);break;
      }
    }if (i[0] in c) f = i[0];else {
      for (e in c) {
        if (!i[0] || a.converters[e + " " + i[0]]) {
          f = e;break;
        }g || (g = e);
      }f = f || g;
    }if (f) return f !== i[0] && i.unshift(f), c[f];
  }function Nb(a, b, c, d) {
    var e,
        f,
        g,
        h,
        i,
        j = {},
        k = a.dataTypes.slice();if (k[1]) for (g in a.converters) {
      j[g.toLowerCase()] = a.converters[g];
    }f = k.shift();while (f) {
      if (a.responseFields[f] && (c[a.responseFields[f]] = b), !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)), i = f, f = k.shift()) if ("*" === f) f = i;else if ("*" !== i && i !== f) {
        if (g = j[i + " " + f] || j["* " + f], !g) for (e in j) {
          if (h = e.split(" "), h[1] === f && (g = j[i + " " + h[0]] || j["* " + h[0]])) {
            g === !0 ? g = j[e] : j[e] !== !0 && (f = h[0], k.unshift(h[1]));break;
          }
        }if (g !== !0) if (g && a["throws"]) b = g(b);else try {
          b = g(b);
        } catch (l) {
          return { state: "parsererror", error: g ? l : "No conversion from " + i + " to " + f };
        }
      }
    }return { state: "success", data: b };
  }r.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { url: qb.href, type: "GET", isLocal: Cb.test(qb.protocol), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: { "*": Hb, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, converters: { "* text": String, "text html": !0, "text json": JSON.parse, "text xml": r.parseXML }, flatOptions: { url: !0, context: !0 } }, ajaxSetup: function ajaxSetup(a, b) {
      return b ? Lb(Lb(a, r.ajaxSettings), b) : Lb(r.ajaxSettings, a);
    }, ajaxPrefilter: Jb(Fb), ajaxTransport: Jb(Gb), ajax: function ajax(b, c) {
      "object" == (typeof b === "undefined" ? "undefined" : _typeof(b)) && (c = b, b = void 0), c = c || {};var e,
          f,
          g,
          h,
          i,
          j,
          k,
          l,
          m,
          n,
          o = r.ajaxSetup({}, c),
          p = o.context || o,
          q = o.context && (p.nodeType || p.jquery) ? r(p) : r.event,
          s = r.Deferred(),
          t = r.Callbacks("once memory"),
          u = o.statusCode || {},
          v = {},
          w = {},
          x = "canceled",
          y = { readyState: 0, getResponseHeader: function getResponseHeader(a) {
          var b;if (k) {
            if (!h) {
              h = {};while (b = Bb.exec(g)) {
                h[b[1].toLowerCase()] = b[2];
              }
            }b = h[a.toLowerCase()];
          }return null == b ? null : b;
        }, getAllResponseHeaders: function getAllResponseHeaders() {
          return k ? g : null;
        }, setRequestHeader: function setRequestHeader(a, b) {
          return null == k && (a = w[a.toLowerCase()] = w[a.toLowerCase()] || a, v[a] = b), this;
        }, overrideMimeType: function overrideMimeType(a) {
          return null == k && (o.mimeType = a), this;
        }, statusCode: function statusCode(a) {
          var b;if (a) if (k) y.always(a[y.status]);else for (b in a) {
            u[b] = [u[b], a[b]];
          }return this;
        }, abort: function abort(a) {
          var b = a || x;return e && e.abort(b), A(0, b), this;
        } };if (s.promise(y), o.url = ((b || o.url || qb.href) + "").replace(Eb, qb.protocol + "//"), o.type = c.method || c.type || o.method || o.type, o.dataTypes = (o.dataType || "*").toLowerCase().match(K) || [""], null == o.crossDomain) {
        j = d.createElement("a");try {
          j.href = o.url, j.href = j.href, o.crossDomain = Ib.protocol + "//" + Ib.host != j.protocol + "//" + j.host;
        } catch (z) {
          o.crossDomain = !0;
        }
      }if (o.data && o.processData && "string" != typeof o.data && (o.data = r.param(o.data, o.traditional)), Kb(Fb, o, c, y), k) return y;l = r.event && o.global, l && 0 === r.active++ && r.event.trigger("ajaxStart"), o.type = o.type.toUpperCase(), o.hasContent = !Db.test(o.type), f = o.url.replace(zb, ""), o.hasContent ? o.data && o.processData && 0 === (o.contentType || "").indexOf("application/x-www-form-urlencoded") && (o.data = o.data.replace(yb, "+")) : (n = o.url.slice(f.length), o.data && (f += (sb.test(f) ? "&" : "?") + o.data, delete o.data), o.cache === !1 && (f = f.replace(Ab, "$1"), n = (sb.test(f) ? "&" : "?") + "_=" + rb++ + n), o.url = f + n), o.ifModified && (r.lastModified[f] && y.setRequestHeader("If-Modified-Since", r.lastModified[f]), r.etag[f] && y.setRequestHeader("If-None-Match", r.etag[f])), (o.data && o.hasContent && o.contentType !== !1 || c.contentType) && y.setRequestHeader("Content-Type", o.contentType), y.setRequestHeader("Accept", o.dataTypes[0] && o.accepts[o.dataTypes[0]] ? o.accepts[o.dataTypes[0]] + ("*" !== o.dataTypes[0] ? ", " + Hb + "; q=0.01" : "") : o.accepts["*"]);for (m in o.headers) {
        y.setRequestHeader(m, o.headers[m]);
      }if (o.beforeSend && (o.beforeSend.call(p, y, o) === !1 || k)) return y.abort();if (x = "abort", t.add(o.complete), y.done(o.success), y.fail(o.error), e = Kb(Gb, o, c, y)) {
        if (y.readyState = 1, l && q.trigger("ajaxSend", [y, o]), k) return y;o.async && o.timeout > 0 && (i = a.setTimeout(function () {
          y.abort("timeout");
        }, o.timeout));try {
          k = !1, e.send(v, A);
        } catch (z) {
          if (k) throw z;A(-1, z);
        }
      } else A(-1, "No Transport");function A(b, c, d, h) {
        var j,
            m,
            n,
            v,
            w,
            x = c;k || (k = !0, i && a.clearTimeout(i), e = void 0, g = h || "", y.readyState = b > 0 ? 4 : 0, j = b >= 200 && b < 300 || 304 === b, d && (v = Mb(o, y, d)), v = Nb(o, v, y, j), j ? (o.ifModified && (w = y.getResponseHeader("Last-Modified"), w && (r.lastModified[f] = w), w = y.getResponseHeader("etag"), w && (r.etag[f] = w)), 204 === b || "HEAD" === o.type ? x = "nocontent" : 304 === b ? x = "notmodified" : (x = v.state, m = v.data, n = v.error, j = !n)) : (n = x, !b && x || (x = "error", b < 0 && (b = 0))), y.status = b, y.statusText = (c || x) + "", j ? s.resolveWith(p, [m, x, y]) : s.rejectWith(p, [y, x, n]), y.statusCode(u), u = void 0, l && q.trigger(j ? "ajaxSuccess" : "ajaxError", [y, o, j ? m : n]), t.fireWith(p, [y, x]), l && (q.trigger("ajaxComplete", [y, o]), --r.active || r.event.trigger("ajaxStop")));
      }return y;
    }, getJSON: function getJSON(a, b, c) {
      return r.get(a, b, c, "json");
    }, getScript: function getScript(a, b) {
      return r.get(a, void 0, b, "script");
    } }), r.each(["get", "post"], function (a, b) {
    r[b] = function (a, c, d, e) {
      return r.isFunction(c) && (e = e || d, d = c, c = void 0), r.ajax(r.extend({ url: a, type: b, dataType: e, data: c, success: d }, r.isPlainObject(a) && a));
    };
  }), r._evalUrl = function (a) {
    return r.ajax({ url: a, type: "GET", dataType: "script", cache: !0, async: !1, global: !1, "throws": !0 });
  }, r.fn.extend({ wrapAll: function wrapAll(a) {
      var b;return this[0] && (r.isFunction(a) && (a = a.call(this[0])), b = r(a, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && b.insertBefore(this[0]), b.map(function () {
        var a = this;while (a.firstElementChild) {
          a = a.firstElementChild;
        }return a;
      }).append(this)), this;
    }, wrapInner: function wrapInner(a) {
      return r.isFunction(a) ? this.each(function (b) {
        r(this).wrapInner(a.call(this, b));
      }) : this.each(function () {
        var b = r(this),
            c = b.contents();c.length ? c.wrapAll(a) : b.append(a);
      });
    }, wrap: function wrap(a) {
      var b = r.isFunction(a);return this.each(function (c) {
        r(this).wrapAll(b ? a.call(this, c) : a);
      });
    }, unwrap: function unwrap(a) {
      return this.parent(a).not("body").each(function () {
        r(this).replaceWith(this.childNodes);
      }), this;
    } }), r.expr.pseudos.hidden = function (a) {
    return !r.expr.pseudos.visible(a);
  }, r.expr.pseudos.visible = function (a) {
    return !!(a.offsetWidth || a.offsetHeight || a.getClientRects().length);
  }, r.ajaxSettings.xhr = function () {
    try {
      return new a.XMLHttpRequest();
    } catch (b) {}
  };var Ob = { 0: 200, 1223: 204 },
      Pb = r.ajaxSettings.xhr();o.cors = !!Pb && "withCredentials" in Pb, o.ajax = Pb = !!Pb, r.ajaxTransport(function (b) {
    var _c, d;if (o.cors || Pb && !b.crossDomain) return { send: function send(e, f) {
        var g,
            h = b.xhr();if (h.open(b.type, b.url, b.async, b.username, b.password), b.xhrFields) for (g in b.xhrFields) {
          h[g] = b.xhrFields[g];
        }b.mimeType && h.overrideMimeType && h.overrideMimeType(b.mimeType), b.crossDomain || e["X-Requested-With"] || (e["X-Requested-With"] = "XMLHttpRequest");for (g in e) {
          h.setRequestHeader(g, e[g]);
        }_c = function c(a) {
          return function () {
            _c && (_c = d = h.onload = h.onerror = h.onabort = h.onreadystatechange = null, "abort" === a ? h.abort() : "error" === a ? "number" != typeof h.status ? f(0, "error") : f(h.status, h.statusText) : f(Ob[h.status] || h.status, h.statusText, "text" !== (h.responseType || "text") || "string" != typeof h.responseText ? { binary: h.response } : { text: h.responseText }, h.getAllResponseHeaders()));
          };
        }, h.onload = _c(), d = h.onerror = _c("error"), void 0 !== h.onabort ? h.onabort = d : h.onreadystatechange = function () {
          4 === h.readyState && a.setTimeout(function () {
            _c && d();
          });
        }, _c = _c("abort");try {
          h.send(b.hasContent && b.data || null);
        } catch (i) {
          if (_c) throw i;
        }
      }, abort: function abort() {
        _c && _c();
      } };
  }), r.ajaxPrefilter(function (a) {
    a.crossDomain && (a.contents.script = !1);
  }), r.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /\b(?:java|ecma)script\b/ }, converters: { "text script": function textScript(a) {
        return r.globalEval(a), a;
      } } }), r.ajaxPrefilter("script", function (a) {
    void 0 === a.cache && (a.cache = !1), a.crossDomain && (a.type = "GET");
  }), r.ajaxTransport("script", function (a) {
    if (a.crossDomain) {
      var b, _c2;return { send: function send(e, f) {
          b = r("<script>").prop({ charset: a.scriptCharset, src: a.url }).on("load error", _c2 = function c(a) {
            b.remove(), _c2 = null, a && f("error" === a.type ? 404 : 200, a.type);
          }), d.head.appendChild(b[0]);
        }, abort: function abort() {
          _c2 && _c2();
        } };
    }
  });var Qb = [],
      Rb = /(=)\?(?=&|$)|\?\?/;r.ajaxSetup({ jsonp: "callback", jsonpCallback: function jsonpCallback() {
      var a = Qb.pop() || r.expando + "_" + rb++;return this[a] = !0, a;
    } }), r.ajaxPrefilter("json jsonp", function (b, c, d) {
    var e,
        f,
        g,
        h = b.jsonp !== !1 && (Rb.test(b.url) ? "url" : "string" == typeof b.data && 0 === (b.contentType || "").indexOf("application/x-www-form-urlencoded") && Rb.test(b.data) && "data");if (h || "jsonp" === b.dataTypes[0]) return e = b.jsonpCallback = r.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, h ? b[h] = b[h].replace(Rb, "$1" + e) : b.jsonp !== !1 && (b.url += (sb.test(b.url) ? "&" : "?") + b.jsonp + "=" + e), b.converters["script json"] = function () {
      return g || r.error(e + " was not called"), g[0];
    }, b.dataTypes[0] = "json", f = a[e], a[e] = function () {
      g = arguments;
    }, d.always(function () {
      void 0 === f ? r(a).removeProp(e) : a[e] = f, b[e] && (b.jsonpCallback = c.jsonpCallback, Qb.push(e)), g && r.isFunction(f) && f(g[0]), g = f = void 0;
    }), "script";
  }), o.createHTMLDocument = function () {
    var a = d.implementation.createHTMLDocument("").body;return a.innerHTML = "<form></form><form></form>", 2 === a.childNodes.length;
  }(), r.parseHTML = function (a, b, c) {
    if ("string" != typeof a) return [];"boolean" == typeof b && (c = b, b = !1);var e, f, g;return b || (o.createHTMLDocument ? (b = d.implementation.createHTMLDocument(""), e = b.createElement("base"), e.href = d.location.href, b.head.appendChild(e)) : b = d), f = B.exec(a), g = !c && [], f ? [b.createElement(f[1])] : (f = pa([a], b, g), g && g.length && r(g).remove(), r.merge([], f.childNodes));
  }, r.fn.load = function (a, b, c) {
    var d,
        e,
        f,
        g = this,
        h = a.indexOf(" ");return h > -1 && (d = mb(a.slice(h)), a = a.slice(0, h)), r.isFunction(b) ? (c = b, b = void 0) : b && "object" == (typeof b === "undefined" ? "undefined" : _typeof(b)) && (e = "POST"), g.length > 0 && r.ajax({ url: a, type: e || "GET", dataType: "html", data: b }).done(function (a) {
      f = arguments, g.html(d ? r("<div>").append(r.parseHTML(a)).find(d) : a);
    }).always(c && function (a, b) {
      g.each(function () {
        c.apply(this, f || [a.responseText, b, a]);
      });
    }), this;
  }, r.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (a, b) {
    r.fn[b] = function (a) {
      return this.on(b, a);
    };
  }), r.expr.pseudos.animated = function (a) {
    return r.grep(r.timers, function (b) {
      return a === b.elem;
    }).length;
  };function Sb(a) {
    return r.isWindow(a) ? a : 9 === a.nodeType && a.defaultView;
  }r.offset = { setOffset: function setOffset(a, b, c) {
      var d,
          e,
          f,
          g,
          h,
          i,
          j,
          k = r.css(a, "position"),
          l = r(a),
          m = {};"static" === k && (a.style.position = "relative"), h = l.offset(), f = r.css(a, "top"), i = r.css(a, "left"), j = ("absolute" === k || "fixed" === k) && (f + i).indexOf("auto") > -1, j ? (d = l.position(), g = d.top, e = d.left) : (g = parseFloat(f) || 0, e = parseFloat(i) || 0), r.isFunction(b) && (b = b.call(a, c, r.extend({}, h))), null != b.top && (m.top = b.top - h.top + g), null != b.left && (m.left = b.left - h.left + e), "using" in b ? b.using.call(a, m) : l.css(m);
    } }, r.fn.extend({ offset: function offset(a) {
      if (arguments.length) return void 0 === a ? this : this.each(function (b) {
        r.offset.setOffset(this, a, b);
      });var b,
          c,
          d,
          e,
          f = this[0];if (f) return f.getClientRects().length ? (d = f.getBoundingClientRect(), d.width || d.height ? (e = f.ownerDocument, c = Sb(e), b = e.documentElement, { top: d.top + c.pageYOffset - b.clientTop, left: d.left + c.pageXOffset - b.clientLeft }) : d) : { top: 0, left: 0 };
    }, position: function position() {
      if (this[0]) {
        var a,
            b,
            c = this[0],
            d = { top: 0, left: 0 };return "fixed" === r.css(c, "position") ? b = c.getBoundingClientRect() : (a = this.offsetParent(), b = this.offset(), r.nodeName(a[0], "html") || (d = a.offset()), d = { top: d.top + r.css(a[0], "borderTopWidth", !0), left: d.left + r.css(a[0], "borderLeftWidth", !0) }), { top: b.top - d.top - r.css(c, "marginTop", !0), left: b.left - d.left - r.css(c, "marginLeft", !0) };
      }
    }, offsetParent: function offsetParent() {
      return this.map(function () {
        var a = this.offsetParent;while (a && "static" === r.css(a, "position")) {
          a = a.offsetParent;
        }return a || qa;
      });
    } }), r.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (a, b) {
    var c = "pageYOffset" === b;r.fn[a] = function (d) {
      return S(this, function (a, d, e) {
        var f = Sb(a);return void 0 === e ? f ? f[b] : a[d] : void (f ? f.scrollTo(c ? f.pageXOffset : e, c ? e : f.pageYOffset) : a[d] = e);
      }, a, d, arguments.length);
    };
  }), r.each(["top", "left"], function (a, b) {
    r.cssHooks[b] = Oa(o.pixelPosition, function (a, c) {
      if (c) return c = Na(a, b), La.test(c) ? r(a).position()[b] + "px" : c;
    });
  }), r.each({ Height: "height", Width: "width" }, function (a, b) {
    r.each({ padding: "inner" + a, content: b, "": "outer" + a }, function (c, d) {
      r.fn[d] = function (e, f) {
        var g = arguments.length && (c || "boolean" != typeof e),
            h = c || (e === !0 || f === !0 ? "margin" : "border");return S(this, function (b, c, e) {
          var f;return r.isWindow(b) ? 0 === d.indexOf("outer") ? b["inner" + a] : b.document.documentElement["client" + a] : 9 === b.nodeType ? (f = b.documentElement, Math.max(b.body["scroll" + a], f["scroll" + a], b.body["offset" + a], f["offset" + a], f["client" + a])) : void 0 === e ? r.css(b, c, h) : r.style(b, c, e, h);
        }, b, g ? e : void 0, g);
      };
    });
  }), r.fn.extend({ bind: function bind(a, b, c) {
      return this.on(a, null, b, c);
    }, unbind: function unbind(a, b) {
      return this.off(a, null, b);
    }, delegate: function delegate(a, b, c, d) {
      return this.on(b, a, c, d);
    }, undelegate: function undelegate(a, b, c) {
      return 1 === arguments.length ? this.off(a, "**") : this.off(b, a || "**", c);
    } }), r.parseJSON = JSON.parse, "function" == typeof define && define.amd && define("jquery", [], function () {
    return r;
  });var Tb = a.jQuery,
      Ub = a.$;return r.noConflict = function (b) {
    return a.$ === r && (a.$ = Ub), b && a.jQuery === r && (a.jQuery = Tb), r;
  }, b || (a.jQuery = a.$ = r), r;
});

},{}],56:[function(require,module,exports){
"use strict";

Object.defineProperty(exports, "__esModule", {
	value: true
});
var getDefaultSettings = function getDefaultSettings() {
	return {
		elements_selector: "img",
		container: window,
		threshold: 300,
		throttle: 150,
		data_src: "src",
		data_srcset: "srcset",
		data_sizes: "sizes",
		data_bg: "bg",
		class_loading: "loading",
		class_loaded: "loaded",
		class_error: "error",
		class_initial: "initial",
		skip_invisible: true,
		callback_load: null,
		callback_error: null,
		callback_set: null,
		callback_enter: null,
		callback_finish: null,
		to_webp: false
	};
};

var dataPrefix = "data-";
var processedDataName = "was-processed";
var processedDataValue = "true";

var getData = function getData(element, attribute) {
	return element.getAttribute(dataPrefix + attribute);
};

var setData = function setData(element, attribute, value) {
	var attrName = dataPrefix + attribute;
	if (value === null) {
		element.removeAttribute(attrName);
		return;
	}
	element.setAttribute(attrName, value);
};

var setWasProcessedData = function setWasProcessedData(element) {
	return setData(element, processedDataName, processedDataValue);
};

var getWasProcessedData = function getWasProcessedData(element) {
	return getData(element, processedDataName) === processedDataValue;
};

var purgeProcessedElements = function purgeProcessedElements(elements) {
	return elements.filter(function (element) {
		return !getWasProcessedData(element);
	});
};

var purgeOneElement = function purgeOneElement(elements, elementToPurge) {
	return elements.filter(function (element) {
		return element !== elementToPurge;
	});
};

var getTopOffset = function getTopOffset(element) {
	return element.getBoundingClientRect().top + window.pageYOffset - element.ownerDocument.documentElement.clientTop;
};

var isBelowViewport = function isBelowViewport(element, container, threshold) {
	var fold = container === window ? window.innerHeight + window.pageYOffset : getTopOffset(container) + container.offsetHeight;
	return fold <= getTopOffset(element) - threshold;
};

var getLeftOffset = function getLeftOffset(element) {
	return element.getBoundingClientRect().left + window.pageXOffset - element.ownerDocument.documentElement.clientLeft;
};

var isAtRightOfViewport = function isAtRightOfViewport(element, container, threshold) {
	var documentWidth = window.innerWidth;
	var fold = container === window ? documentWidth + window.pageXOffset : getLeftOffset(container) + documentWidth;
	return fold <= getLeftOffset(element) - threshold;
};

var isAboveViewport = function isAboveViewport(element, container, threshold) {
	var fold = container === window ? window.pageYOffset : getTopOffset(container);
	return fold >= getTopOffset(element) + threshold + element.offsetHeight;
};

var isAtLeftOfViewport = function isAtLeftOfViewport(element, container, threshold) {
	var fold = container === window ? window.pageXOffset : getLeftOffset(container);
	return fold >= getLeftOffset(element) + threshold + element.offsetWidth;
};

function isInsideViewport(element, container, threshold) {
	return !isBelowViewport(element, container, threshold) && !isAboveViewport(element, container, threshold) && !isAtRightOfViewport(element, container, threshold) && !isAtLeftOfViewport(element, container, threshold);
}

/* Creates instance and notifies it through the window element */
var createInstance = function createInstance(classObj, options) {
	var event;
	var eventString = "LazyLoad::Initialized";
	var instance = new classObj(options);
	try {
		// Works in modern browsers
		event = new CustomEvent(eventString, { detail: { instance: instance } });
	} catch (err) {
		// Works in Internet Explorer (all versions)
		event = document.createEvent("CustomEvent");
		event.initCustomEvent(eventString, false, false, { instance: instance });
	}
	window.dispatchEvent(event);
};

/* Auto initialization of one or more instances of lazyload, depending on the 
    options passed in (plain object or an array) */
function autoInitialize(classObj, options) {
	if (!options) {
		return;
	}
	if (!options.length) {
		// Plain object
		createInstance(classObj, options);
	} else {
		// Array of objects
		for (var i = 0, optionsItem; optionsItem = options[i]; i += 1) {
			createInstance(classObj, optionsItem);
		}
	}
}

var replaceExtToWebp = function replaceExtToWebp(value, condition) {
	return condition ? value.replace(/\.(jpe?g|png)/gi, ".webp") : value;
};

var detectWebp = function detectWebp() {
	var webpString = "image/webp";
	var canvas = document.createElement("canvas");

	if (canvas.getContext && canvas.getContext("2d")) {
		return canvas.toDataURL(webpString).indexOf("data:" + webpString) === 0;
	}

	return false;
};

var runningOnBrowser = typeof window !== "undefined";

var isBot = runningOnBrowser && !("onscroll" in window) || /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent);
var supportsClassList = runningOnBrowser && "classList" in document.createElement("p");

var supportsWebp = runningOnBrowser && detectWebp();

var addClass = function addClass(element, className) {
	if (supportsClassList) {
		element.classList.add(className);
		return;
	}
	element.className += (element.className ? " " : "") + className;
};

var removeClass = function removeClass(element, className) {
	if (supportsClassList) {
		element.classList.remove(className);
		return;
	}
	element.className = element.className.replace(new RegExp("(^|\\s+)" + className + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
};

var setSourcesInChildren = function setSourcesInChildren(parentTag, attrName, dataAttrName, toWebpFlag) {
	for (var i = 0, childTag; childTag = parentTag.children[i]; i += 1) {
		if (childTag.tagName === "SOURCE") {
			var attrValue = getData(childTag, dataAttrName);
			setAttributeIfValue(childTag, attrName, attrValue, toWebpFlag);
		}
	}
};

var setAttributeIfValue = function setAttributeIfValue(element, attrName, value, toWebpFlag) {
	if (!value) {
		return;
	}
	element.setAttribute(attrName, replaceExtToWebp(value, toWebpFlag));
};

var setSourcesImg = function setSourcesImg(element, settings) {
	var toWebpFlag = supportsWebp && settings.to_webp;
	var srcsetDataName = settings.data_srcset;
	var parent = element.parentNode;

	if (parent && parent.tagName === "PICTURE") {
		setSourcesInChildren(parent, "srcset", srcsetDataName, toWebpFlag);
	}
	var sizesDataValue = getData(element, settings.data_sizes);
	setAttributeIfValue(element, "sizes", sizesDataValue);
	var srcsetDataValue = getData(element, srcsetDataName);
	setAttributeIfValue(element, "srcset", srcsetDataValue, toWebpFlag);
	var srcDataValue = getData(element, settings.data_src);
	setAttributeIfValue(element, "src", srcDataValue, toWebpFlag);
};

var setSourcesIframe = function setSourcesIframe(element, settings) {
	var srcDataValue = getData(element, settings.data_src);

	setAttributeIfValue(element, "src", srcDataValue);
};

var setSourcesVideo = function setSourcesVideo(element, settings) {
	var srcDataName = settings.data_src;
	var srcDataValue = getData(element, srcDataName);

	setSourcesInChildren(element, "src", srcDataName);
	setAttributeIfValue(element, "src", srcDataValue);
	element.load();
};

var setSourcesBgImage = function setSourcesBgImage(element, settings) {
	var toWebpFlag = supportsWebp && settings.to_webp;
	var srcDataValue = getData(element, settings.data_src);
	var bgDataValue = getData(element, settings.data_bg);

	if (srcDataValue) {
		var setValue = replaceExtToWebp(srcDataValue, toWebpFlag);
		element.style.backgroundImage = "url(\"" + setValue + "\")";
	}

	if (bgDataValue) {
		var _setValue = replaceExtToWebp(bgDataValue, toWebpFlag);
		element.style.backgroundImage = _setValue;
	}
};

var setSourcesFunctions = {
	IMG: setSourcesImg,
	IFRAME: setSourcesIframe,
	VIDEO: setSourcesVideo
};

var setSources = function setSources(element, instance) {
	var settings = instance._settings;
	var tagName = element.tagName;
	var setSourcesFunction = setSourcesFunctions[tagName];
	if (setSourcesFunction) {
		setSourcesFunction(element, settings);
		instance._updateLoadingCount(1);
		instance._elements = purgeOneElement(instance._elements, element);
		return;
	}
	setSourcesBgImage(element, settings);
};

var callbackIfSet = function callbackIfSet(callback, argument) {
	if (callback) {
		callback(argument);
	}
};

var genericLoadEventName = "load";
var mediaLoadEventName = "loadeddata";
var errorEventName = "error";

var addEventListener = function addEventListener(element, eventName, handler) {
	element.addEventListener(eventName, handler);
};

var removeEventListener = function removeEventListener(element, eventName, handler) {
	element.removeEventListener(eventName, handler);
};

var addAllEventListeners = function addAllEventListeners(element, loadHandler, errorHandler) {
	addEventListener(element, genericLoadEventName, loadHandler);
	addEventListener(element, mediaLoadEventName, loadHandler);
	addEventListener(element, errorEventName, errorHandler);
};

var removeAllEventListeners = function removeAllEventListeners(element, loadHandler, errorHandler) {
	removeEventListener(element, genericLoadEventName, loadHandler);
	removeEventListener(element, mediaLoadEventName, loadHandler);
	removeEventListener(element, errorEventName, errorHandler);
};

var eventHandler = function eventHandler(event, success, instance) {
	var settings = instance._settings;
	var className = success ? settings.class_loaded : settings.class_error;
	var callback = success ? settings.callback_load : settings.callback_error;
	var element = event.target;

	removeClass(element, settings.class_loading);
	addClass(element, className);
	callbackIfSet(callback, element);

	instance._updateLoadingCount(-1);
};

var addOneShotEventListeners = function addOneShotEventListeners(element, instance) {
	var loadHandler = function loadHandler(event) {
		eventHandler(event, true, instance);
		removeAllEventListeners(element, loadHandler, errorHandler);
	};
	var errorHandler = function errorHandler(event) {
		eventHandler(event, false, instance);
		removeAllEventListeners(element, loadHandler, errorHandler);
	};
	addAllEventListeners(element, loadHandler, errorHandler);
};

var managedTags = ["IMG", "IFRAME", "VIDEO"];

function revealElement(element, instance, force) {
	var settings = instance._settings;
	if (!force && getWasProcessedData(element)) {
		return; // element has already been processed and force wasn't true
	}
	callbackIfSet(settings.callback_enter, element);
	if (managedTags.indexOf(element.tagName) > -1) {
		addOneShotEventListeners(element, instance);
		addClass(element, settings.class_loading);
	}
	setSources(element, instance);
	setWasProcessedData(element);
	callbackIfSet(settings.callback_set, element);
}

var removeFromArray = function removeFromArray(elements, indexes) {
	while (indexes.length) {
		elements.splice(indexes.pop(), 1);
	}
};

/*
 * Constructor
 */

var LazyLoad = function LazyLoad(instanceSettings) {
	this._settings = Object.assign({}, getDefaultSettings(), instanceSettings);
	this._loadingCount = 0;
	this._queryOriginNode = this._settings.container === window ? document : this._settings.container;

	this._previousLoopTime = 0;
	this._loopTimeout = null;
	this._boundHandleScroll = this.handleScroll.bind(this);

	this._isFirstLoop = true;
	window.addEventListener("resize", this._boundHandleScroll);
	this.update();
};

LazyLoad.prototype = {
	_loopThroughElements: function _loopThroughElements(forceDownload) {
		var settings = this._settings,
		    elements = this._elements,
		    elementsLength = !elements ? 0 : elements.length;
		var i = void 0,
		    processedIndexes = [],
		    isFirstLoop = this._isFirstLoop;

		if (isFirstLoop) {
			this._isFirstLoop = false;
		}

		if (elementsLength === 0) {
			this._stopScrollHandler();
			return;
		}

		for (i = 0; i < elementsLength; i++) {
			var element = elements[i];
			/* If must skip_invisible and element is invisible, skip it */
			if (settings.skip_invisible && element.offsetParent === null) {
				continue;
			}

			if (forceDownload || isInsideViewport(element, settings.container, settings.threshold)) {
				if (isFirstLoop) {
					addClass(element, settings.class_initial);
				}
				this.load(element);
				processedIndexes.push(i);
			}
		}

		// Removing processed elements from this._elements.
		removeFromArray(elements, processedIndexes);
	},

	_startScrollHandler: function _startScrollHandler() {
		if (!this._isHandlingScroll) {
			this._isHandlingScroll = true;
			this._settings.container.addEventListener("scroll", this._boundHandleScroll);
		}
	},

	_stopScrollHandler: function _stopScrollHandler() {
		if (this._isHandlingScroll) {
			this._isHandlingScroll = false;
			this._settings.container.removeEventListener("scroll", this._boundHandleScroll);
		}
	},

	_updateLoadingCount: function _updateLoadingCount(plusMinus) {
		this._loadingCount += plusMinus;
		if (this._elements.length === 0 && this._loadingCount === 0) {
			callbackIfSet(this._settings.callback_finish);
		}
	},

	handleScroll: function handleScroll() {
		var throttle = this._settings.throttle;

		if (throttle !== 0) {
			var now = Date.now();
			var remainingTime = throttle - (now - this._previousLoopTime);
			if (remainingTime <= 0 || remainingTime > throttle) {
				if (this._loopTimeout) {
					clearTimeout(this._loopTimeout);
					this._loopTimeout = null;
				}
				this._previousLoopTime = now;
				this._loopThroughElements();
			} else if (!this._loopTimeout) {
				this._loopTimeout = setTimeout(function () {
					this._previousLoopTime = Date.now();
					this._loopTimeout = null;
					this._loopThroughElements();
				}.bind(this), remainingTime);
			}
		} else {
			this._loopThroughElements();
		}
	},

	loadAll: function loadAll() {
		this._loopThroughElements(true);
	},

	update: function update(elements) {
		var settings = this._settings;
		var nodeSet = elements || this._queryOriginNode.querySelectorAll(settings.elements_selector);

		this._elements = purgeProcessedElements(Array.prototype.slice.call(nodeSet) // NOTE: nodeset to array for IE compatibility
		);

		if (isBot) {
			this.loadAll();
			return;
		}

		this._loopThroughElements();
		this._startScrollHandler();
	},

	destroy: function destroy() {
		window.removeEventListener("resize", this._boundHandleScroll);
		if (this._loopTimeout) {
			clearTimeout(this._loopTimeout);
			this._loopTimeout = null;
		}
		this._stopScrollHandler();
		this._elements = null;
		this._queryOriginNode = null;
		this._settings = null;
	},

	load: function load(element, force) {
		revealElement(element, this, force);
	}
};

/* Automatic instances creation if required (useful for async script loading) */
if (runningOnBrowser) {
	autoInitialize(LazyLoad, window.lazyLoadOptions);
}

exports.default = LazyLoad;

},{}],57:[function(require,module,exports){
"use strict";

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

/*! modernizr 3.6.0 (Custom Build) | MIT *
 * https://modernizr.com/download/?-inputtypes-setclasses !*/
!function (e, t, n) {
  function a(e) {
    var t = r.className,
        n = Modernizr._config.classPrefix || "";if (c && (t = t.baseVal), Modernizr._config.enableJSClass) {
      var a = new RegExp("(^|\\s)" + n + "no-js(\\s|$)");t = t.replace(a, "$1" + n + "js$2");
    }Modernizr._config.enableClasses && (t += " " + n + e.join(" " + n), c ? r.className.baseVal = t : r.className = t);
  }function s(e, t) {
    return (typeof e === "undefined" ? "undefined" : _typeof(e)) === t;
  }function i() {
    var e, t, n, a, i, o, r;for (var c in u) {
      if (u.hasOwnProperty(c)) {
        if (e = [], t = u[c], t.name && (e.push(t.name.toLowerCase()), t.options && t.options.aliases && t.options.aliases.length)) for (n = 0; n < t.options.aliases.length; n++) {
          e.push(t.options.aliases[n].toLowerCase());
        }for (a = s(t.fn, "function") ? t.fn() : t.fn, i = 0; i < e.length; i++) {
          o = e[i], r = o.split("."), 1 === r.length ? Modernizr[r[0]] = a : (!Modernizr[r[0]] || Modernizr[r[0]] instanceof Boolean || (Modernizr[r[0]] = new Boolean(Modernizr[r[0]])), Modernizr[r[0]][r[1]] = a), l.push((a ? "" : "no-") + r.join("-"));
        }
      }
    }
  }function o() {
    return "function" != typeof t.createElement ? t.createElement(arguments[0]) : c ? t.createElementNS.call(t, "http://www.w3.org/2000/svg", arguments[0]) : t.createElement.apply(t, arguments);
  }var l = [],
      r = t.documentElement,
      c = "svg" === r.nodeName.toLowerCase(),
      u = [],
      f = { _version: "3.6.0", _config: { classPrefix: "", enableClasses: !0, enableJSClass: !0, usePrefixes: !0 }, _q: [], on: function on(e, t) {
      var n = this;setTimeout(function () {
        t(n[e]);
      }, 0);
    }, addTest: function addTest(e, t, n) {
      u.push({ name: e, fn: t, options: n });
    }, addAsyncTest: function addAsyncTest(e) {
      u.push({ name: null, fn: e });
    } },
      Modernizr = function Modernizr() {};Modernizr.prototype = f, Modernizr = new Modernizr();var p = o("input"),
      d = "search tel url email datetime date month week time datetime-local number range color".split(" "),
      m = {};Modernizr.inputtypes = function (e) {
    for (var a, s, i, o = e.length, l = "1)", c = 0; o > c; c++) {
      p.setAttribute("type", a = e[c]), i = "text" !== p.type && "style" in p, i && (p.value = l, p.style.cssText = "position:absolute;visibility:hidden;", /^range$/.test(a) && p.style.WebkitAppearance !== n ? (r.appendChild(p), s = t.defaultView, i = s.getComputedStyle && "textfield" !== s.getComputedStyle(p, null).WebkitAppearance && 0 !== p.offsetHeight, r.removeChild(p)) : /^(search|tel)$/.test(a) || (i = /^(url|email)$/.test(a) ? p.checkValidity && p.checkValidity() === !1 : p.value != l)), m[e[c]] = !!i;
    }return m;
  }(d), i(), a(l), delete f.addTest, delete f.addAsyncTest;for (var h = 0; h < Modernizr._q.length; h++) {
    Modernizr._q[h]();
  }e.Modernizr = Modernizr;
}(window, document);

},{}],58:[function(require,module,exports){
'use strict';

var _jquery = require('./jquery');

var _jquery2 = _interopRequireDefault(_jquery);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var jQuery = _jquery2.default;

+function ($) {
    'use strict';
    /*! npm.im/object-fit-images 3.2.3 */

    var objectFitImages = function () {
        "use strict";
        function t(t, e) {
            return "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='" + t + "' height='" + e + "'%3E%3C/svg%3E";
        }function e(t) {
            if (t.srcset && !m && window.picturefill) {
                var e = window.picturefill._;t[e.ns] && t[e.ns].evaled || e.fillImg(t, { reselect: !0 }), t[e.ns].curSrc || (t[e.ns].supported = !1, e.fillImg(t, { reselect: !0 })), t.currentSrc = t[e.ns].curSrc || t.src;
            }
        }function i(t) {
            for (var e, i = getComputedStyle(t).fontFamily, r = {}; null !== (e = l.exec(i));) {
                r[e[1]] = e[2];
            }return r;
        }function r(e, i, r) {
            var n = t(i || 1, r || 0);p.call(e, "src") !== n && b.call(e, "src", n);
        }function n(t, e) {
            t.naturalWidth ? e(t) : setTimeout(n, 100, t, e);
        }function c(t) {
            var c = i(t),
                o = t[a];if (c["object-fit"] = c["object-fit"] || "fill", !o.img) {
                if ("fill" === c["object-fit"]) return;if (!o.skipTest && g && !c["object-position"]) return;
            }if (!o.img) {
                o.img = new Image(t.width, t.height), o.img.srcset = p.call(t, "data-ofi-srcset") || t.srcset, o.img.src = p.call(t, "data-ofi-src") || t.src, b.call(t, "data-ofi-src", t.src), t.srcset && b.call(t, "data-ofi-srcset", t.srcset), r(t, t.naturalWidth || t.width, t.naturalHeight || t.height), t.srcset && (t.srcset = "");try {
                    s(t);
                } catch (t) {
                    window.console && console.warn("https://bit.ly/ofi-old-browser");
                }
            }e(o.img), t.style.backgroundImage = 'url("' + (o.img.currentSrc || o.img.src).replace(/"/g, '\\"') + '")', t.style.backgroundPosition = c["object-position"] || "center", t.style.backgroundRepeat = "no-repeat", t.style.backgroundOrigin = "content-box", /scale-down/.test(c["object-fit"]) ? n(o.img, function () {
                o.img.naturalWidth > t.width || o.img.naturalHeight > t.height ? t.style.backgroundSize = "contain" : t.style.backgroundSize = "auto";
            }) : t.style.backgroundSize = c["object-fit"].replace("none", "auto").replace("fill", "100% 100%"), n(o.img, function (e) {
                r(t, e.naturalWidth, e.naturalHeight);
            });
        }function s(t) {
            var e = { get: function get(e) {
                    return t[a].img[e || "src"];
                }, set: function set(e, i) {
                    return t[a].img[i || "src"] = e, b.call(t, "data-ofi-" + i, e), c(t), e;
                } };Object.defineProperty(t, "src", e), Object.defineProperty(t, "currentSrc", { get: function get() {
                    return e.get("currentSrc");
                } }), Object.defineProperty(t, "srcset", { get: function get() {
                    return e.get("srcset");
                }, set: function set(t) {
                    return e.set(t, "srcset");
                } });
        }function o(t, e) {
            var i = !h && !t;if (e = e || {}, t = t || "img", f && !e.skipTest || !d) return !1;"img" === t ? t = document.getElementsByTagName("img") : "string" == typeof t ? t = document.querySelectorAll(t) : "length" in t || (t = [t]);for (var r = 0; r < t.length; r++) {
                t[r][a] = t[r][a] || { skipTest: e.skipTest }, c(t[r]);
            }i && (document.body.addEventListener("load", function (t) {
                "IMG" === t.target.tagName && o(t.target, { skipTest: e.skipTest });
            }, !0), h = !0, t = "img"), e.watchMQ && window.addEventListener("resize", o.bind(null, t, { skipTest: e.skipTest }));
        }var a = "bfred-it:object-fit-images",
            l = /(object-fit|object-position)\s*:\s*([-\w\s%]+)/g,
            u = "undefined" == typeof Image ? { style: { "object-position": 1 } } : new Image(),
            g = "object-fit" in u.style,
            f = "object-position" in u.style,
            d = "background-size" in u.style,
            m = "string" == typeof u.currentSrc,
            p = u.getAttribute,
            b = u.setAttribute,
            h = !1;return o.supportsObjectFit = g, o.supportsObjectPosition = f, function () {
            function t(t, e) {
                return t[a] && t[a].img && ("src" === e || "srcset" === e) ? t[a].img : t;
            }f || (HTMLImageElement.prototype.getAttribute = function (e) {
                return p.call(t(this, e), e);
            }, HTMLImageElement.prototype.setAttribute = function (e, i) {
                return b.call(t(this, e), e, String(i));
            });
        }(), o;
    }();

    $(function () {
        objectFitImages();
    });
}(jQuery);

},{"./jquery":55}],59:[function(require,module,exports){
'use strict';

/*jshint
   asi: true,
   unused: true,
   boss: true,
   loopfunc: true,
   eqnull: true
 */

/*!
 * Legacy browser support
 */

// Map array support
if (![].map) {
    Array.prototype.map = function (callback, self) {
        var array = this,
            len = array.length,
            newArray = new Array(len);
        for (var i = 0; i < len; i++) {
            if (i in array) {
                newArray[i] = callback.call(self, array[i], i, array);
            }
        }
        return newArray;
    };
}

// Filter array support
if (![].filter) {
    Array.prototype.filter = function (callback) {
        if (this == null) throw new TypeError();
        var t = Object(this),
            len = t.length >>> 0;
        if (typeof callback != 'function') throw new TypeError();
        var newArray = [],
            thisp = arguments[1];
        for (var i = 0; i < len; i++) {
            if (i in t) {
                var val = t[i];
                if (callback.call(thisp, val, i, t)) newArray.push(val);
            }
        }
        return newArray;
    };
}

// Index of array support
if (![].indexOf) {
    Array.prototype.indexOf = function (searchElement) {
        if (this == null) throw new TypeError();
        var t = Object(this),
            len = t.length >>> 0;
        if (len === 0) return -1;
        var n = 0;
        if (arguments.length > 1) {
            n = Number(arguments[1]);
            if (n != n) {
                n = 0;
            } else if (n !== 0 && n != Infinity && n != -Infinity) {
                n = (n > 0 || -1) * Math.floor(Math.abs(n));
            }
        }
        if (n >= len) return -1;
        var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
        for (; k < len; k++) {
            if (k in t && t[k] === searchElement) return k;
        }
        return -1;
    };
}

/*!
 * Cross-Browser Split 1.1.1
 * Copyright 2007-2012 Steven Levithan <stevenlevithan.com>
 * Available under the MIT License
 * http://blog.stevenlevithan.com/archives/cross-browser-split
 */
var nativeSplit = String.prototype.split,
    compliantExecNpcg = /()??/.exec('')[1] === undefined;
String.prototype.split = function (separator, limit) {
    var str = this;
    if (Object.prototype.toString.call(separator) !== '[object RegExp]') {
        return nativeSplit.call(str, separator, limit);
    }
    var output = [],
        flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.extended ? 'x' : '') + (separator.sticky ? 'y' : ''),
        lastLastIndex = 0,
        separator2,
        match,
        lastIndex,
        lastLength;
    separator = new RegExp(separator.source, flags + 'g');
    str += '';
    if (!compliantExecNpcg) {
        separator2 = new RegExp('^' + separator.source + '$(?!\\s)', flags);
    }
    limit = limit === undefined ? -1 >>> 0 : limit >>> 0;
    while (match = separator.exec(str)) {
        lastIndex = match.index + match[0].length;
        if (lastIndex > lastLastIndex) {
            output.push(str.slice(lastLastIndex, match.index));
            if (!compliantExecNpcg && match.length > 1) {
                match[0].replace(separator2, function () {
                    for (var i = 1; i < arguments.length - 2; i++) {
                        if (arguments[i] === undefined) {
                            match[i] = undefined;
                        }
                    }
                });
            }
            if (match.length > 1 && match.index < str.length) {
                Array.prototype.push.apply(output, match.slice(1));
            }
            lastLength = match[0].length;
            lastLastIndex = lastIndex;
            if (output.length >= limit) {
                break;
            }
        }
        if (separator.lastIndex === match.index) {
            separator.lastIndex++;
        }
    }
    if (lastLastIndex === str.length) {
        if (lastLength || !separator.test('')) {
            output.push('');
        }
    } else {
        output.push(str.slice(lastLastIndex));
    }
    return output.length > limit ? output.slice(0, limit) : output;
};

},{}],60:[function(require,module,exports){
'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

/*!
 * Date picker for pickadate.js v3.6.2
 * http://amsul.github.io/pickadate.js/date.htm
 */

(function (factory) {

    // AMD.
    if (typeof define == 'function' && define.amd) define(['./picker', 'jquery'], factory);

    // Node.js/browserify.
    else if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) == 'object') module.exports = factory(require('./picker.js'), jQuery);
        // module.exports = factory( require('./picker.js'), require('jquery') )

        // Browser globals.
        else factory(Picker, jQuery);
})(function (Picker, $) {

    /**
     * Globals and constants
     */
    var DAYS_IN_WEEK = 7,
        WEEKS_IN_CALENDAR = 6,
        _ = Picker._;

    /**
     * The date picker constructor
     */
    function DatePicker(picker, settings) {

        var calendar = this,
            element = picker.$node[0],
            elementValue = element.value,
            elementDataValue = picker.$node.data('value'),
            valueString = elementDataValue || elementValue,
            formatString = elementDataValue ? settings.formatSubmit : settings.format,
            isRTL = function isRTL() {

            return element.currentStyle ?

            // For IE.
            element.currentStyle.direction == 'rtl' :

            // For normal browsers.
            getComputedStyle(picker.$root[0]).direction == 'rtl';
        };

        calendar.settings = settings;
        calendar.$node = picker.$node;

        // The queue of methods that will be used to build item objects.
        calendar.queue = {
            min: 'measure create',
            max: 'measure create',
            now: 'now create',
            select: 'parse create validate',
            highlight: 'parse navigate create validate',
            view: 'parse create validate viewset',
            disable: 'deactivate',
            enable: 'activate'

            // The component's item object.
        };calendar.item = {};

        calendar.item.clear = null;
        calendar.item.disable = (settings.disable || []).slice(0);
        calendar.item.enable = -function (collectionDisabled) {
            return collectionDisabled[0] === true ? collectionDisabled.shift() : -1;
        }(calendar.item.disable);

        calendar.set('min', settings.min).set('max', settings.max).set('now');

        // When there’s a value, set the `select`, which in turn
        // also sets the `highlight` and `view`.
        if (valueString) {
            calendar.set('select', valueString, {
                format: formatString,
                defaultValue: true
            });
        }

        // If there’s no value, default to highlighting “today”.
        else {
                calendar.set('select', null).set('highlight', calendar.item.now);
            }

        // The keycode to movement mapping.
        calendar.key = {
            40: 7, // Down
            38: -7, // Up
            39: function _() {
                return isRTL() ? -1 : 1;
            }, // Right
            37: function _() {
                return isRTL() ? 1 : -1;
            }, // Left
            go: function go(timeChange) {
                var highlightedObject = calendar.item.highlight,
                    targetDate = new Date(highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange);
                calendar.set('highlight', targetDate, { interval: timeChange });
                this.render();
            }

            // Bind some picker events.
        };picker.on('render', function () {
            picker.$root.find('.' + settings.klass.selectMonth).on('change', function () {
                var value = this.value;
                if (value) {
                    picker.set('highlight', [picker.get('view').year, value, picker.get('highlight').date]);
                    picker.$root.find('.' + settings.klass.selectMonth).trigger('focus');
                }
            });
            picker.$root.find('.' + settings.klass.selectYear).on('change', function () {
                var value = this.value;
                if (value) {
                    picker.set('highlight', [value, picker.get('view').month, picker.get('highlight').date]);
                    picker.$root.find('.' + settings.klass.selectYear).trigger('focus');
                }
            });
        }, 1).on('open', function () {
            var includeToday = '';
            if (calendar.disabled(calendar.get('now'))) {
                includeToday = ':not(.' + settings.klass.buttonToday + ')';
            }
            picker.$root.find('button' + includeToday + ', select').attr('disabled', false);
        }, 1).on('close', function () {
            picker.$root.find('button, select').attr('disabled', true);
        }, 1);
    } //DatePicker


    /**
     * Set a datepicker item object.
     */
    DatePicker.prototype.set = function (type, value, options) {

        var calendar = this,
            calendarItem = calendar.item;

        // If the value is `null` just set it immediately.
        if (value === null) {
            if (type == 'clear') type = 'select';
            calendarItem[type] = value;
            return calendar;
        }

        // Otherwise go through the queue of methods, and invoke the functions.
        // Update this as the time unit, and set the final value as this item.
        // * In the case of `enable`, keep the queue but set `disable` instead.
        //   And in the case of `flip`, keep the queue but set `enable` instead.
        calendarItem[type == 'enable' ? 'disable' : type == 'flip' ? 'enable' : type] = calendar.queue[type].split(' ').map(function (method) {
            value = calendar[method](type, value, options);
            return value;
        }).pop();

        // Check if we need to cascade through more updates.
        if (type == 'select') {
            calendar.set('highlight', calendarItem.select, options);
        } else if (type == 'highlight') {
            calendar.set('view', calendarItem.highlight, options);
        } else if (type.match(/^(flip|min|max|disable|enable)$/)) {
            if (calendarItem.select && calendar.disabled(calendarItem.select)) {
                calendar.set('select', calendarItem.select, options);
            }
            if (calendarItem.highlight && calendar.disabled(calendarItem.highlight)) {
                calendar.set('highlight', calendarItem.highlight, options);
            }
        }

        return calendar;
    }; //DatePicker.prototype.set


    /**
     * Get a datepicker item object.
     */
    DatePicker.prototype.get = function (type) {
        return this.item[type];
    }; //DatePicker.prototype.get


    /**
     * Create a picker date object.
     */
    DatePicker.prototype.create = function (type, value, options) {

        var isInfiniteValue,
            calendar = this;

        // If there’s no value, use the type as the value.
        value = value === undefined ? type : value;

        // If it’s infinity, update the value.
        if (value == -Infinity || value == Infinity) {
            isInfiniteValue = value;
        }

        // If it’s an object, use the native date object.
        else if ($.isPlainObject(value) && _.isInteger(value.pick)) {
                value = value.obj;
            }

            // If it’s an array, convert it into a date and make sure
            // that it’s a valid date – otherwise default to today.
            else if ($.isArray(value)) {
                    value = new Date(value[0], value[1], value[2]);
                    value = _.isDate(value) ? value : calendar.create().obj;
                }

                // If it’s a number or date object, make a normalized date.
                else if (_.isInteger(value) || _.isDate(value)) {
                        value = calendar.normalize(new Date(value), options);
                    }

                    // If it’s a literal true or any other case, set it to now.
                    else /*if ( value === true )*/{
                            value = calendar.now(type, value, options);
                        }

        // Return the compiled object.
        return {
            year: isInfiniteValue || value.getFullYear(),
            month: isInfiniteValue || value.getMonth(),
            date: isInfiniteValue || value.getDate(),
            day: isInfiniteValue || value.getDay(),
            obj: isInfiniteValue || value,
            pick: isInfiniteValue || value.getTime()
        };
    }; //DatePicker.prototype.create


    /**
     * Create a range limit object using an array, date object,
     * literal “true”, or integer relative to another time.
     */
    DatePicker.prototype.createRange = function (from, to) {

        var calendar = this,
            createDate = function createDate(date) {
            if (date === true || $.isArray(date) || _.isDate(date)) {
                return calendar.create(date);
            }
            return date;
        };

        // Create objects if possible.
        if (!_.isInteger(from)) {
            from = createDate(from);
        }
        if (!_.isInteger(to)) {
            to = createDate(to);
        }

        // Create relative dates.
        if (_.isInteger(from) && $.isPlainObject(to)) {
            from = [to.year, to.month, to.date + from];
        } else if (_.isInteger(to) && $.isPlainObject(from)) {
            to = [from.year, from.month, from.date + to];
        }

        return {
            from: createDate(from),
            to: createDate(to)
        };
    }; //DatePicker.prototype.createRange


    /**
     * Check if a date unit falls within a date range object.
     */
    DatePicker.prototype.withinRange = function (range, dateUnit) {
        range = this.createRange(range.from, range.to);
        return dateUnit.pick >= range.from.pick && dateUnit.pick <= range.to.pick;
    };

    /**
     * Check if two date range objects overlap.
     */
    DatePicker.prototype.overlapRanges = function (one, two) {

        var calendar = this;

        // Convert the ranges into comparable dates.
        one = calendar.createRange(one.from, one.to);
        two = calendar.createRange(two.from, two.to);

        return calendar.withinRange(one, two.from) || calendar.withinRange(one, two.to) || calendar.withinRange(two, one.from) || calendar.withinRange(two, one.to);
    };

    /**
     * Get the date today.
     */
    DatePicker.prototype.now = function (type, value, options) {
        value = new Date();
        if (options && options.rel) {
            value.setDate(value.getDate() + options.rel);
        }
        return this.normalize(value, options);
    };

    /**
     * Navigate to next/prev month.
     */
    DatePicker.prototype.navigate = function (type, value, options) {

        var targetDateObject,
            targetYear,
            targetMonth,
            targetDate,
            isTargetArray = $.isArray(value),
            isTargetObject = $.isPlainObject(value),
            viewsetObject = this.item.view; /*,
                                            safety = 100*/

        if (isTargetArray || isTargetObject) {

            if (isTargetObject) {
                targetYear = value.year;
                targetMonth = value.month;
                targetDate = value.date;
            } else {
                targetYear = +value[0];
                targetMonth = +value[1];
                targetDate = +value[2];
            }

            // If we’re navigating months but the view is in a different
            // month, navigate to the view’s year and month.
            if (options && options.nav && viewsetObject && viewsetObject.month !== targetMonth) {
                targetYear = viewsetObject.year;
                targetMonth = viewsetObject.month;
            }

            // Figure out the expected target year and month.
            targetDateObject = new Date(targetYear, targetMonth + (options && options.nav ? options.nav : 0), 1);
            targetYear = targetDateObject.getFullYear();
            targetMonth = targetDateObject.getMonth();

            // If the month we’re going to doesn’t have enough days,
            // keep decreasing the date until we reach the month’s last date.
            while ( /*safety &&*/new Date(targetYear, targetMonth, targetDate).getMonth() !== targetMonth) {
                targetDate -= 1;
                /*safety -= 1
                if ( !safety ) {
                    throw 'Fell into an infinite loop while navigating to ' + new Date( targetYear, targetMonth, targetDate ) + '.'
                }*/
            }

            value = [targetYear, targetMonth, targetDate];
        }

        return value;
    }; //DatePicker.prototype.navigate


    /**
     * Normalize a date by setting the hours to midnight.
     */
    DatePicker.prototype.normalize = function (value /*, options*/) {
        value.setHours(0, 0, 0, 0);
        return value;
    };

    /**
     * Measure the range of dates.
     */
    DatePicker.prototype.measure = function (type, value /*, options*/) {

        var calendar = this;

        // If it's an integer, get a date relative to today.
        if (_.isInteger(value)) {
            value = calendar.now(type, value, { rel: value });
        }

        // If it’s anything false-y, remove the limits.
        else if (!value) {
                value = type == 'min' ? -Infinity : Infinity;
            }

            // If it’s a string, parse it.
            else if (typeof value == 'string') {
                    value = calendar.parse(type, value);
                }

        return value;
    }; ///DatePicker.prototype.measure


    /**
     * Create a viewset object based on navigation.
     */
    DatePicker.prototype.viewset = function (type, dateObject /*, options*/) {
        return this.create([dateObject.year, dateObject.month, 1]);
    };

    /**
     * Validate a date as enabled and shift if needed.
     */
    DatePicker.prototype.validate = function (type, dateObject, options) {

        var calendar = this,


        // Keep a reference to the original date.
        originalDateObject = dateObject,


        // Make sure we have an interval.
        interval = options && options.interval ? options.interval : 1,


        // Check if the calendar enabled dates are inverted.
        isFlippedBase = calendar.item.enable === -1,


        // Check if we have any enabled dates after/before now.
        hasEnabledBeforeTarget,
            hasEnabledAfterTarget,


        // The min & max limits.
        minLimitObject = calendar.item.min,
            maxLimitObject = calendar.item.max,


        // Check if we’ve reached the limit during shifting.
        reachedMin,
            reachedMax,


        // Check if the calendar is inverted and at least one weekday is enabled.
        hasEnabledWeekdays = isFlippedBase && calendar.item.disable.filter(function (value) {

            // If there’s a date, check where it is relative to the target.
            if ($.isArray(value)) {
                var dateTime = calendar.create(value).pick;
                if (dateTime < dateObject.pick) hasEnabledBeforeTarget = true;else if (dateTime > dateObject.pick) hasEnabledAfterTarget = true;
            }

            // Return only integers for enabled weekdays.
            return _.isInteger(value);
        }).length; /*,
                   safety = 100*/

        // Cases to validate for:
        // [1] Not inverted and date disabled.
        // [2] Inverted and some dates enabled.
        // [3] Not inverted and out of range.
        //
        // Cases to **not** validate for:
        // • Navigating months.
        // • Not inverted and date enabled.
        // • Inverted and all dates disabled.
        // • ..and anything else.
        if (!options || !options.nav && !options.defaultValue) if (
        /* 1 */!isFlippedBase && calendar.disabled(dateObject) ||
        /* 2 */isFlippedBase && calendar.disabled(dateObject) && (hasEnabledWeekdays || hasEnabledBeforeTarget || hasEnabledAfterTarget) ||
        /* 3 */!isFlippedBase && (dateObject.pick <= minLimitObject.pick || dateObject.pick >= maxLimitObject.pick)) {

            // When inverted, flip the direction if there aren’t any enabled weekdays
            // and there are no enabled dates in the direction of the interval.
            if (isFlippedBase && !hasEnabledWeekdays && (!hasEnabledAfterTarget && interval > 0 || !hasEnabledBeforeTarget && interval < 0)) {
                interval *= -1;
            }

            // Keep looping until we reach an enabled date.
            while ( /*safety &&*/calendar.disabled(dateObject)) {

                /*safety -= 1
                if ( !safety ) {
                    throw 'Fell into an infinite loop while validating ' + dateObject.obj + '.'
                }*/

                // If we’ve looped into the next/prev month with a large interval, return to the original date and flatten the interval.
                if (Math.abs(interval) > 1 && (dateObject.month < originalDateObject.month || dateObject.month > originalDateObject.month)) {
                    dateObject = originalDateObject;
                    interval = interval > 0 ? 1 : -1;
                }

                // If we’ve reached the min/max limit, reverse the direction, flatten the interval and set it to the limit.
                if (dateObject.pick <= minLimitObject.pick) {
                    reachedMin = true;
                    interval = 1;
                    dateObject = calendar.create([minLimitObject.year, minLimitObject.month, minLimitObject.date + (dateObject.pick === minLimitObject.pick ? 0 : -1)]);
                } else if (dateObject.pick >= maxLimitObject.pick) {
                    reachedMax = true;
                    interval = -1;
                    dateObject = calendar.create([maxLimitObject.year, maxLimitObject.month, maxLimitObject.date + (dateObject.pick === maxLimitObject.pick ? 0 : 1)]);
                }

                // If we’ve reached both limits, just break out of the loop.
                if (reachedMin && reachedMax) {
                    break;
                }

                // Finally, create the shifted date using the interval and keep looping.
                dateObject = calendar.create([dateObject.year, dateObject.month, dateObject.date + interval]);
            }
        } //endif


        // Return the date object settled on.
        return dateObject;
    }; //DatePicker.prototype.validate


    /**
     * Check if a date is disabled.
     */
    DatePicker.prototype.disabled = function (dateToVerify) {

        var calendar = this,


        // Filter through the disabled dates to check if this is one.
        isDisabledMatch = calendar.item.disable.filter(function (dateToDisable) {

            // If the date is a number, match the weekday with 0index and `firstDay` check.
            if (_.isInteger(dateToDisable)) {
                return dateToVerify.day === (calendar.settings.firstDay ? dateToDisable : dateToDisable - 1) % 7;
            }

            // If it’s an array or a native JS date, create and match the exact date.
            if ($.isArray(dateToDisable) || _.isDate(dateToDisable)) {
                return dateToVerify.pick === calendar.create(dateToDisable).pick;
            }

            // If it’s an object, match a date within the “from” and “to” range.
            if ($.isPlainObject(dateToDisable)) {
                return calendar.withinRange(dateToDisable, dateToVerify);
            }
        });

        // If this date matches a disabled date, confirm it’s not inverted.
        isDisabledMatch = isDisabledMatch.length && !isDisabledMatch.filter(function (dateToDisable) {
            return $.isArray(dateToDisable) && dateToDisable[3] == 'inverted' || $.isPlainObject(dateToDisable) && dateToDisable.inverted;
        }).length;

        // Check the calendar “enabled” flag and respectively flip the
        // disabled state. Then also check if it’s beyond the min/max limits.
        return calendar.item.enable === -1 ? !isDisabledMatch : isDisabledMatch || dateToVerify.pick < calendar.item.min.pick || dateToVerify.pick > calendar.item.max.pick;
    }; //DatePicker.prototype.disabled


    /**
     * Parse a string into a usable type.
     */
    DatePicker.prototype.parse = function (type, value, options) {

        var calendar = this,
            parsingObject = {};

        // If it’s already parsed, we’re good.
        if (!value || typeof value != 'string') {
            return value;
        }

        // We need a `.format` to parse the value with.
        if (!(options && options.format)) {
            options = options || {};
            options.format = calendar.settings.format;
        }

        // Convert the format into an array and then map through it.
        calendar.formats.toArray(options.format).map(function (label) {

            var
            // Grab the formatting label.
            formattingLabel = calendar.formats[label],


            // The format length is from the formatting label function or the
            // label length without the escaping exclamation (!) mark.
            formatLength = formattingLabel ? _.trigger(formattingLabel, calendar, [value, parsingObject]) : label.replace(/^!/, '').length;

            // If there's a format label, split the value up to the format length.
            // Then add it to the parsing object with appropriate label.
            if (formattingLabel) {
                parsingObject[label] = value.substr(0, formatLength);
            }

            // Update the value as the substring from format length to end.
            value = value.substr(formatLength);
        });

        // Compensate for month 0index.
        return [parsingObject.yyyy || parsingObject.yy, +(parsingObject.mm || parsingObject.m) - 1, parsingObject.dd || parsingObject.d];
    }; //DatePicker.prototype.parse


    /**
     * Various formats to display the object in.
     */
    DatePicker.prototype.formats = function () {

        // Return the length of the first word in a collection.
        function getWordLengthFromCollection(string, collection, dateObject) {

            // Grab the first word from the string.
            // Regex pattern from http://stackoverflow.com/q/150033
            var word = string.match(/[^\x00-\x7F]+|\w+/)[0];

            // If there's no month index, add it to the date object
            if (!dateObject.mm && !dateObject.m) {
                dateObject.m = collection.indexOf(word) + 1;
            }

            // Return the length of the word.
            return word.length;
        }

        // Get the length of the first word in a string.
        function getFirstWordLength(string) {
            return string.match(/\w+/)[0].length;
        }

        return {

            d: function d(string, dateObject) {

                // If there's string, then get the digits length.
                // Otherwise return the selected date.
                return string ? _.digits(string) : dateObject.date;
            },
            dd: function dd(string, dateObject) {

                // If there's a string, then the length is always 2.
                // Otherwise return the selected date with a leading zero.
                return string ? 2 : _.lead(dateObject.date);
            },
            ddd: function ddd(string, dateObject) {

                // If there's a string, then get the length of the first word.
                // Otherwise return the short selected weekday.
                return string ? getFirstWordLength(string) : this.settings.weekdaysShort[dateObject.day];
            },
            dddd: function dddd(string, dateObject) {

                // If there's a string, then get the length of the first word.
                // Otherwise return the full selected weekday.
                return string ? getFirstWordLength(string) : this.settings.weekdaysFull[dateObject.day];
            },
            m: function m(string, dateObject) {

                // If there's a string, then get the length of the digits
                // Otherwise return the selected month with 0index compensation.
                return string ? _.digits(string) : dateObject.month + 1;
            },
            mm: function mm(string, dateObject) {

                // If there's a string, then the length is always 2.
                // Otherwise return the selected month with 0index and leading zero.
                return string ? 2 : _.lead(dateObject.month + 1);
            },
            mmm: function mmm(string, dateObject) {

                var collection = this.settings.monthsShort;

                // If there's a string, get length of the relevant month from the short
                // months collection. Otherwise return the selected month from that collection.
                return string ? getWordLengthFromCollection(string, collection, dateObject) : collection[dateObject.month];
            },
            mmmm: function mmmm(string, dateObject) {

                var collection = this.settings.monthsFull;

                // If there's a string, get length of the relevant month from the full
                // months collection. Otherwise return the selected month from that collection.
                return string ? getWordLengthFromCollection(string, collection, dateObject) : collection[dateObject.month];
            },
            yy: function yy(string, dateObject) {

                // If there's a string, then the length is always 2.
                // Otherwise return the selected year by slicing out the first 2 digits.
                return string ? 2 : ('' + dateObject.year).slice(2);
            },
            yyyy: function yyyy(string, dateObject) {

                // If there's a string, then the length is always 4.
                // Otherwise return the selected year.
                return string ? 4 : dateObject.year;
            },

            // Create an array by splitting the formatting string passed.
            toArray: function toArray(formatString) {
                return formatString.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);
            },

            // Format an object into a string using the formatting options.
            toString: function toString(formatString, itemObject) {
                var calendar = this;
                return calendar.formats.toArray(formatString).map(function (label) {
                    return _.trigger(calendar.formats[label], calendar, [0, itemObject]) || label.replace(/^!/, '');
                }).join('');
            }
        };
    }(); //DatePicker.prototype.formats


    /**
     * Check if two date units are the exact.
     */
    DatePicker.prototype.isDateExact = function (one, two) {

        var calendar = this;

        // When we’re working with weekdays, do a direct comparison.
        if (_.isInteger(one) && _.isInteger(two) || typeof one == 'boolean' && typeof two == 'boolean') {
            return one === two;
        }

        // When we’re working with date representations, compare the “pick” value.
        if ((_.isDate(one) || $.isArray(one)) && (_.isDate(two) || $.isArray(two))) {
            return calendar.create(one).pick === calendar.create(two).pick;
        }

        // When we’re working with range objects, compare the “from” and “to”.
        if ($.isPlainObject(one) && $.isPlainObject(two)) {
            return calendar.isDateExact(one.from, two.from) && calendar.isDateExact(one.to, two.to);
        }

        return false;
    };

    /**
     * Check if two date units overlap.
     */
    DatePicker.prototype.isDateOverlap = function (one, two) {

        var calendar = this,
            firstDay = calendar.settings.firstDay ? 1 : 0;

        // When we’re working with a weekday index, compare the days.
        if (_.isInteger(one) && (_.isDate(two) || $.isArray(two))) {
            one = one % 7 + firstDay;
            return one === calendar.create(two).day + 1;
        }
        if (_.isInteger(two) && (_.isDate(one) || $.isArray(one))) {
            two = two % 7 + firstDay;
            return two === calendar.create(one).day + 1;
        }

        // When we’re working with range objects, check if the ranges overlap.
        if ($.isPlainObject(one) && $.isPlainObject(two)) {
            return calendar.overlapRanges(one, two);
        }

        return false;
    };

    /**
     * Flip the “enabled” state.
     */
    DatePicker.prototype.flipEnable = function (val) {
        var itemObject = this.item;
        itemObject.enable = val || (itemObject.enable == -1 ? 1 : -1);
    };

    /**
     * Mark a collection of dates as “disabled”.
     */
    DatePicker.prototype.deactivate = function (type, datesToDisable) {

        var calendar = this,
            disabledItems = calendar.item.disable.slice(0);

        // If we’re flipping, that’s all we need to do.
        if (datesToDisable == 'flip') {
            calendar.flipEnable();
        } else if (datesToDisable === false) {
            calendar.flipEnable(1);
            disabledItems = [];
        } else if (datesToDisable === true) {
            calendar.flipEnable(-1);
            disabledItems = [];
        }

        // Otherwise go through the dates to disable.
        else {

                datesToDisable.map(function (unitToDisable) {

                    var matchFound;

                    // When we have disabled items, check for matches.
                    // If something is matched, immediately break out.
                    for (var index = 0; index < disabledItems.length; index += 1) {
                        if (calendar.isDateExact(unitToDisable, disabledItems[index])) {
                            matchFound = true;
                            break;
                        }
                    }

                    // If nothing was found, add the validated unit to the collection.
                    if (!matchFound) {
                        if (_.isInteger(unitToDisable) || _.isDate(unitToDisable) || $.isArray(unitToDisable) || $.isPlainObject(unitToDisable) && unitToDisable.from && unitToDisable.to) {
                            disabledItems.push(unitToDisable);
                        }
                    }
                });
            }

        // Return the updated collection.
        return disabledItems;
    }; //DatePicker.prototype.deactivate


    /**
     * Mark a collection of dates as “enabled”.
     */
    DatePicker.prototype.activate = function (type, datesToEnable) {

        var calendar = this,
            disabledItems = calendar.item.disable,
            disabledItemsCount = disabledItems.length;

        // If we’re flipping, that’s all we need to do.
        if (datesToEnable == 'flip') {
            calendar.flipEnable();
        } else if (datesToEnable === true) {
            calendar.flipEnable(1);
            disabledItems = [];
        } else if (datesToEnable === false) {
            calendar.flipEnable(-1);
            disabledItems = [];
        }

        // Otherwise go through the disabled dates.
        else {

                datesToEnable.map(function (unitToEnable) {

                    var matchFound, disabledUnit, index, isExactRange;

                    // Go through the disabled items and try to find a match.
                    for (index = 0; index < disabledItemsCount; index += 1) {

                        disabledUnit = disabledItems[index];

                        // When an exact match is found, remove it from the collection.
                        if (calendar.isDateExact(disabledUnit, unitToEnable)) {
                            matchFound = disabledItems[index] = null;
                            isExactRange = true;
                            break;
                        }

                        // When an overlapped match is found, add the “inverted” state to it.
                        else if (calendar.isDateOverlap(disabledUnit, unitToEnable)) {
                                if ($.isPlainObject(unitToEnable)) {
                                    unitToEnable.inverted = true;
                                    matchFound = unitToEnable;
                                } else if ($.isArray(unitToEnable)) {
                                    matchFound = unitToEnable;
                                    if (!matchFound[3]) matchFound.push('inverted');
                                } else if (_.isDate(unitToEnable)) {
                                    matchFound = [unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted'];
                                }
                                break;
                            }
                    }

                    // If a match was found, remove a previous duplicate entry.
                    if (matchFound) for (index = 0; index < disabledItemsCount; index += 1) {
                        if (calendar.isDateExact(disabledItems[index], unitToEnable)) {
                            disabledItems[index] = null;
                            break;
                        }
                    }

                    // In the event that we’re dealing with an exact range of dates,
                    // make sure there are no “inverted” dates because of it.
                    if (isExactRange) for (index = 0; index < disabledItemsCount; index += 1) {
                        if (calendar.isDateOverlap(disabledItems[index], unitToEnable)) {
                            disabledItems[index] = null;
                            break;
                        }
                    }

                    // If something is still matched, add it into the collection.
                    if (matchFound) {
                        disabledItems.push(matchFound);
                    }
                });
            }

        // Return the updated collection.
        return disabledItems.filter(function (val) {
            return val != null;
        });
    }; //DatePicker.prototype.activate


    /**
     * Create a string for the nodes in the picker.
     */
    DatePicker.prototype.nodes = function (isOpen) {

        var calendar = this,
            settings = calendar.settings,
            calendarItem = calendar.item,
            nowObject = calendarItem.now,
            selectedObject = calendarItem.select,
            highlightedObject = calendarItem.highlight,
            viewsetObject = calendarItem.view,
            disabledCollection = calendarItem.disable,
            minLimitObject = calendarItem.min,
            maxLimitObject = calendarItem.max,


        // Create the calendar table head using a copy of weekday labels collection.
        // * We do a copy so we don't mutate the original array.
        tableHead = function (collection, fullCollection) {

            // If the first day should be Monday, move Sunday to the end.
            if (settings.firstDay) {
                collection.push(collection.shift());
                fullCollection.push(fullCollection.shift());
            }

            // Create and return the table head group.
            return _.node('thead', _.node('tr', _.group({
                min: 0,
                max: DAYS_IN_WEEK - 1,
                i: 1,
                node: 'th',
                item: function item(counter) {
                    return [collection[counter], settings.klass.weekdays, 'scope=col title="' + fullCollection[counter] + '"'];
                }
            }))); //endreturn
        }((settings.showWeekdaysFull ? settings.weekdaysFull : settings.weekdaysShort).slice(0), settings.weekdaysFull.slice(0)),
            //tableHead


        // Create the nav for next/prev month.
        createMonthNav = function createMonthNav(next) {

            // Otherwise, return the created month tag.
            return _.node('div', ' ', settings.klass['nav' + (next ? 'Next' : 'Prev')] + (

            // If the focused month is outside the range, disabled the button.
            next && viewsetObject.year >= maxLimitObject.year && viewsetObject.month >= maxLimitObject.month || !next && viewsetObject.year <= minLimitObject.year && viewsetObject.month <= minLimitObject.month ? ' ' + settings.klass.navDisabled : ''), 'data-nav=' + (next || -1) + ' ' + _.ariaAttr({
                role: 'button',
                controls: calendar.$node[0].id + '_table'
            }) + ' ' + 'title="' + (next ? settings.labelMonthNext : settings.labelMonthPrev) + '"'); //endreturn
        },
            //createMonthNav


        // Create the month label.
        createMonthLabel = function createMonthLabel() {

            var monthsCollection = settings.showMonthsShort ? settings.monthsShort : settings.monthsFull;

            // If there are months to select, add a dropdown menu.
            if (settings.selectMonths) {

                return _.node('select', _.group({
                    min: 0,
                    max: 11,
                    i: 1,
                    node: 'option',
                    item: function item(loopedMonth) {

                        return [

                        // The looped month and no classes.
                        monthsCollection[loopedMonth], 0,

                        // Set the value and selected index.
                        'value=' + loopedMonth + (viewsetObject.month == loopedMonth ? ' selected' : '') + (viewsetObject.year == minLimitObject.year && loopedMonth < minLimitObject.month || viewsetObject.year == maxLimitObject.year && loopedMonth > maxLimitObject.month ? ' disabled' : '')];
                    }
                }), settings.klass.selectMonth, (isOpen ? '' : 'disabled') + ' ' + _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' + 'title="' + settings.labelMonthSelect + '"');
            }

            // If there's a need for a month selector
            return _.node('div', monthsCollection[viewsetObject.month], settings.klass.month);
        },
            //createMonthLabel


        // Create the year label.
        createYearLabel = function createYearLabel() {

            var focusedYear = viewsetObject.year,


            // If years selector is set to a literal "true", set it to 5. Otherwise
            // divide in half to get half before and half after focused year.
            numberYears = settings.selectYears === true ? 5 : ~~(settings.selectYears / 2);

            // If there are years to select, add a dropdown menu.
            if (numberYears) {

                var minYear = minLimitObject.year,
                    maxYear = maxLimitObject.year,
                    lowestYear = focusedYear - numberYears,
                    highestYear = focusedYear + numberYears;

                // If the min year is greater than the lowest year, increase the highest year
                // by the difference and set the lowest year to the min year.
                if (minYear > lowestYear) {
                    highestYear += minYear - lowestYear;
                    lowestYear = minYear;
                }

                // If the max year is less than the highest year, decrease the lowest year
                // by the lower of the two: available and needed years. Then set the
                // highest year to the max year.
                if (maxYear < highestYear) {

                    var availableYears = lowestYear - minYear,
                        neededYears = highestYear - maxYear;

                    lowestYear -= availableYears > neededYears ? neededYears : availableYears;
                    highestYear = maxYear;
                }

                return _.node('select', _.group({
                    min: lowestYear,
                    max: highestYear,
                    i: 1,
                    node: 'option',
                    item: function item(loopedYear) {
                        return [

                        // The looped year and no classes.
                        loopedYear, 0,

                        // Set the value and selected index.
                        'value=' + loopedYear + (focusedYear == loopedYear ? ' selected' : '')];
                    }
                }), settings.klass.selectYear, (isOpen ? '' : 'disabled') + ' ' + _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' + 'title="' + settings.labelYearSelect + '"');
            }

            // Otherwise just return the year focused
            return _.node('div', focusedYear, settings.klass.year);
        }; //createYearLabel


        // Create and return the entire calendar.
        return _.node('div', (settings.selectYears ? createYearLabel() + createMonthLabel() : createMonthLabel() + createYearLabel()) + createMonthNav() + createMonthNav(1), settings.klass.header) + _.node('table', tableHead + _.node('tbody', _.group({
            min: 0,
            max: WEEKS_IN_CALENDAR - 1,
            i: 1,
            node: 'tr',
            item: function item(rowCounter) {

                // If Monday is the first day and the month starts on Sunday, shift the date back a week.
                var shiftDateBy = settings.firstDay && calendar.create([viewsetObject.year, viewsetObject.month, 1]).day === 0 ? -7 : 0;

                return [_.group({
                    min: DAYS_IN_WEEK * rowCounter - viewsetObject.day + shiftDateBy + 1, // Add 1 for weekday 0index
                    max: function max() {
                        return this.min + DAYS_IN_WEEK - 1;
                    },
                    i: 1,
                    node: 'td',
                    item: function item(targetDate) {

                        // Convert the time date from a relative date to a target date.
                        targetDate = calendar.create([viewsetObject.year, viewsetObject.month, targetDate + (settings.firstDay ? 1 : 0)]);

                        var isSelected = selectedObject && selectedObject.pick == targetDate.pick,
                            isHighlighted = highlightedObject && highlightedObject.pick == targetDate.pick,
                            isDisabled = disabledCollection && calendar.disabled(targetDate) || targetDate.pick < minLimitObject.pick || targetDate.pick > maxLimitObject.pick,
                            formattedDate = _.trigger(calendar.formats.toString, calendar, [settings.format, targetDate]);

                        return [_.node('div', targetDate.date, function (klasses) {

                            // Add the `infocus` or `outfocus` classes based on month in view.
                            klasses.push(viewsetObject.month == targetDate.month ? settings.klass.infocus : settings.klass.outfocus);

                            // Add the `today` class if needed.
                            if (nowObject.pick == targetDate.pick) {
                                klasses.push(settings.klass.now);
                            }

                            // Add the `selected` class if something's selected and the time matches.
                            if (isSelected) {
                                klasses.push(settings.klass.selected);
                            }

                            // Add the `highlighted` class if something's highlighted and the time matches.
                            if (isHighlighted) {
                                klasses.push(settings.klass.highlighted);
                            }

                            // Add the `disabled` class if something's disabled and the object matches.
                            if (isDisabled) {
                                klasses.push(settings.klass.disabled);
                            }

                            return klasses.join(' ');
                        }([settings.klass.day]), 'data-pick=' + targetDate.pick + ' ' + _.ariaAttr({
                            role: 'gridcell',
                            label: formattedDate,
                            selected: isSelected && calendar.$node.val() === formattedDate ? true : null,
                            activedescendant: isHighlighted ? true : null,
                            disabled: isDisabled ? true : null
                        })), '', _.ariaAttr({ role: 'presentation' })]; //endreturn
                    }
                })]; //endreturn
            }
        })), settings.klass.table, 'id="' + calendar.$node[0].id + '_table' + '" ' + _.ariaAttr({
            role: 'grid',
            controls: calendar.$node[0].id,
            readonly: true
        })) +

        // * For Firefox forms to submit, make sure to set the buttons’ `type` attributes as “button”.
        _.node('div', _.node('button', settings.today, settings.klass.buttonToday, 'type=button data-pick=' + nowObject.pick + (isOpen && !calendar.disabled(nowObject) ? '' : ' disabled') + ' ' + _.ariaAttr({ controls: calendar.$node[0].id })) + _.node('button', settings.clear, settings.klass.buttonClear, 'type=button data-clear=1' + (isOpen ? '' : ' disabled') + ' ' + _.ariaAttr({ controls: calendar.$node[0].id })) + _.node('button', settings.close, settings.klass.buttonClose, 'type=button data-close=true ' + (isOpen ? '' : ' disabled') + ' ' + _.ariaAttr({ controls: calendar.$node[0].id })), settings.klass.footer); //endreturn
    }; //DatePicker.prototype.nodes


    /**
     * The date picker defaults.
     */
    DatePicker.defaults = function (prefix) {

        return {

            // The title label to use for the month nav buttons
            labelMonthNext: 'Next month',
            labelMonthPrev: 'Previous month',

            // The title label to use for the dropdown selectors
            labelMonthSelect: 'Select a month',
            labelYearSelect: 'Select a year',

            // Months and weekdays
            monthsFull: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
            monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
            weekdaysFull: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
            weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],

            // Today and clear
            today: 'Today',
            clear: 'Clear',
            close: 'Close',

            // Picker close behavior
            closeOnSelect: true,
            closeOnClear: true,

            // Update input value on select/clear
            updateInput: true,

            // The format to show on the `input` element
            format: 'd mmmm, yyyy',

            // Classes
            klass: {

                table: prefix + 'table',

                header: prefix + 'header',

                navPrev: prefix + 'nav--prev',
                navNext: prefix + 'nav--next',
                navDisabled: prefix + 'nav--disabled',

                month: prefix + 'month',
                year: prefix + 'year',

                selectMonth: prefix + 'select--month',
                selectYear: prefix + 'select--year',

                weekdays: prefix + 'weekday',

                day: prefix + 'day',
                disabled: prefix + 'day--disabled',
                selected: prefix + 'day--selected',
                highlighted: prefix + 'day--highlighted',
                now: prefix + 'day--today',
                infocus: prefix + 'day--infocus',
                outfocus: prefix + 'day--outfocus',

                footer: prefix + 'footer',

                buttonClear: prefix + 'button--clear',
                buttonToday: prefix + 'button--today',
                buttonClose: prefix + 'button--close'
            }
        };
    }(Picker.klasses().picker + '__');

    /**
     * Extend the picker to add the date picker.
     */
    Picker.extend('pickadate', DatePicker);
});

},{"./picker.js":61}],61:[function(require,module,exports){
'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

/*!
 * pickadate.js v3.6.2, 2019/03/19
 * By Amsul, http://amsul.ca
 * Hosted on http://amsul.github.io/pickadate.js
 * Licensed under MIT
 */

(function (factory) {

    // AMD.
    if (typeof define == 'function' && define.amd) define('picker', ['jquery'], factory);

    // Node.js/browserify.
    else if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) == 'object') module.exports = factory(jQuery);
        // module.exports = factory( require('jquery') )

        // Browser globals.
        else this.Picker = factory(jQuery);
})(function ($) {

    var $window = $(window);
    var $document = $(document);
    var $html = $(document.documentElement);
    var supportsTransitions = document.documentElement.style.transition != null;

    /**
     * The picker constructor that creates a blank picker.
     */
    function PickerConstructor(ELEMENT, NAME, COMPONENT, OPTIONS) {

        // If there’s no element, return the picker constructor.
        if (!ELEMENT) return PickerConstructor;

        var IS_DEFAULT_THEME = false,


        // The state of the picker.
        STATE = {
            id: ELEMENT.id || 'P' + Math.abs(~~(Math.random() * new Date()))
        },


        // Merge the defaults and options passed.
        SETTINGS = COMPONENT ? $.extend(true, {}, COMPONENT.defaults, OPTIONS) : OPTIONS || {},


        // Merge the default classes with the settings classes.
        CLASSES = $.extend({}, PickerConstructor.klasses(), SETTINGS.klass),


        // The element node wrapper into a jQuery object.
        $ELEMENT = $(ELEMENT),


        // Pseudo picker constructor.
        PickerInstance = function PickerInstance() {
            return this.start();
        },


        // The picker prototype.
        P = PickerInstance.prototype = {

            constructor: PickerInstance,

            $node: $ELEMENT,

            /**
             * Initialize everything
             */
            start: function start() {

                // If it’s already started, do nothing.
                if (STATE && STATE.start) return P;

                // Update the picker states.
                STATE.methods = {};
                STATE.start = true;
                STATE.open = false;
                STATE.type = ELEMENT.type;

                // Confirm focus state, convert into text input to remove UA stylings,
                // and set as readonly to prevent keyboard popup.
                ELEMENT.autofocus = ELEMENT == getActiveElement();
                ELEMENT.readOnly = !SETTINGS.editable;
                ELEMENT.id = ELEMENT.id || STATE.id;
                if (ELEMENT.type != 'text') {
                    ELEMENT.type = 'text';
                }

                // Create a new picker component with the settings.
                P.component = new COMPONENT(P, SETTINGS);

                // Create the picker root and then prepare it.
                P.$root = $('<div class="' + CLASSES.picker + '" id="' + ELEMENT.id + '_root" />');
                prepareElementRoot();

                // Create the picker holder and then prepare it.
                P.$holder = $(createWrappedComponent()).appendTo(P.$root);
                prepareElementHolder();

                // If there’s a format for the hidden input element, create the element.
                if (SETTINGS.formatSubmit) {
                    prepareElementHidden();
                }

                // Prepare the input element.
                prepareElement();

                // Insert the hidden input as specified in the settings.
                if (SETTINGS.containerHidden) $(SETTINGS.containerHidden).append(P._hidden);else $ELEMENT.after(P._hidden);

                // Insert the root as specified in the settings.
                if (SETTINGS.container) $(SETTINGS.container).append(P.$root);else $ELEMENT.after(P.$root);

                // Bind the default component and settings events.
                P.on({
                    start: P.component.onStart,
                    render: P.component.onRender,
                    stop: P.component.onStop,
                    open: P.component.onOpen,
                    close: P.component.onClose,
                    set: P.component.onSet
                }).on({
                    start: SETTINGS.onStart,
                    render: SETTINGS.onRender,
                    stop: SETTINGS.onStop,
                    open: SETTINGS.onOpen,
                    close: SETTINGS.onClose,
                    set: SETTINGS.onSet
                });

                // Once we’re all set, check the theme in use.
                IS_DEFAULT_THEME = isUsingDefaultTheme(P.$holder[0]);

                // If the element has autofocus, open the picker.
                if (ELEMENT.autofocus) {
                    P.open();
                }

                // Trigger queued the “start” and “render” events.
                return P.trigger('start').trigger('render');
            }, //start


            /**
             * Render a new picker
             */
            render: function render(entireComponent) {

                // Insert a new component holder in the root or box.
                if (entireComponent) {
                    P.$holder = $(createWrappedComponent());
                    prepareElementHolder();
                    P.$root.html(P.$holder);
                } else P.$root.find('.' + CLASSES.box).html(P.component.nodes(STATE.open));

                // Trigger the queued “render” events.
                return P.trigger('render');
            }, //render


            /**
             * Destroy everything
             */
            stop: function stop() {

                // If it’s already stopped, do nothing.
                if (!STATE.start) return P;

                // Then close the picker.
                P.close();

                // Remove the hidden field.
                if (P._hidden) {
                    P._hidden.parentNode.removeChild(P._hidden);
                }

                // Remove the root.
                P.$root.remove();

                // Remove the input class, remove the stored data, and unbind
                // the events (after a tick for IE - see `P.close`).
                $ELEMENT.removeClass(CLASSES.input).removeData(NAME);
                setTimeout(function () {
                    $ELEMENT.off('.' + STATE.id);
                }, 0);

                // Restore the element state
                ELEMENT.type = STATE.type;
                ELEMENT.readOnly = false;

                // Trigger the queued “stop” events.
                P.trigger('stop');

                // Reset the picker states.
                STATE.methods = {};
                STATE.start = false;

                return P;
            }, //stop


            /**
             * Open up the picker
             */
            open: function open(dontGiveFocus) {

                // If it’s already open, do nothing.
                if (STATE.open) return P;

                // Add the “active” class.
                $ELEMENT.addClass(CLASSES.active);
                aria(ELEMENT, 'expanded', true);

                // * A Firefox bug, when `html` has `overflow:hidden`, results in
                //   killing transitions :(. So add the “opened” state on the next tick.
                //   Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289
                setTimeout(function () {

                    // Add the “opened” class to the picker root.
                    P.$root.addClass(CLASSES.opened);
                    aria(P.$root[0], 'hidden', false);
                }, 0);

                // If we have to give focus, bind the element and doc events.
                if (dontGiveFocus !== false) {

                    // Set it as open.
                    STATE.open = true;

                    // Prevent the page from scrolling.
                    if (IS_DEFAULT_THEME) {
                        $('body').css('overflow', 'hidden').css('padding-right', '+=' + getScrollbarWidth());
                    }

                    // Pass focus to the root element’s jQuery object.
                    focusPickerOnceOpened();

                    // Bind the document events.
                    $document.on('click.' + STATE.id + ' focusin.' + STATE.id, function (event) {

                        var target = getRealEventTarget(event, ELEMENT);

                        // If the target of the event is not the element, close the picker picker.
                        // * Don’t worry about clicks or focusins on the root because those don’t bubble up.
                        //   Also, for Firefox, a click on an `option` element bubbles up directly
                        //   to the doc. So make sure the target wasn't the doc.
                        // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,
                        //   which causes the picker to unexpectedly close when right-clicking it. So make
                        //   sure the event wasn’t a right-click.
                        // * In Chrome 62 and up, password autofill causes a simulated focusin event which
                        //   closes the picker.
                        if (!event.isSimulated && target != ELEMENT && target != document && event.which != 3) {

                            // If the target was the holder that covers the screen,
                            // keep the element focused to maintain tabindex.
                            P.close(target === P.$holder[0]);
                        }
                    }).on('keydown.' + STATE.id, function (event) {

                        var
                        // Get the keycode.
                        keycode = event.keyCode,


                        // Translate that to a selection change.
                        keycodeToMove = P.component.key[keycode],


                        // Grab the target.
                        target = getRealEventTarget(event, ELEMENT);

                        // On escape, close the picker and give focus.
                        if (keycode == 27) {
                            P.close(true);
                        }

                        // Check if there is a key movement or “enter” keypress on the element.
                        else if (target == P.$holder[0] && (keycodeToMove || keycode == 13)) {

                                // Prevent the default action to stop page movement.
                                event.preventDefault();

                                // Trigger the key movement action.
                                if (keycodeToMove) {
                                    PickerConstructor._.trigger(P.component.key.go, P, [PickerConstructor._.trigger(keycodeToMove)]);
                                }

                                // On “enter”, if the highlighted item isn’t disabled, set the value and close.
                                else if (!P.$root.find('.' + CLASSES.highlighted).hasClass(CLASSES.disabled)) {
                                        P.set('select', P.component.item.highlight);
                                        if (SETTINGS.closeOnSelect) {
                                            P.close(true);
                                        }
                                    }
                            }

                            // If the target is within the root and “enter” is pressed,
                            // prevent the default action and trigger a click on the target instead.
                            else if ($.contains(P.$root[0], target) && keycode == 13) {
                                    event.preventDefault();
                                    target.click();
                                }
                    });
                }

                // Trigger the queued “open” events.
                return P.trigger('open');
            }, //open


            /**
             * Close the picker
             */
            close: function close(giveFocus) {

                // If we need to give focus, do it before changing states.
                if (giveFocus) {
                    if (SETTINGS.editable) {
                        ELEMENT.focus();
                    } else {
                        // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|
                        // The focus is triggered *after* the close has completed - causing it
                        // to open again. So unbind and rebind the event at the next tick.
                        P.$holder.off('focus.toOpen').focus();
                        setTimeout(function () {
                            P.$holder.on('focus.toOpen', handleFocusToOpenEvent);
                        }, 0);
                    }
                }

                // Remove the “active” class.
                $ELEMENT.removeClass(CLASSES.active);
                aria(ELEMENT, 'expanded', false);

                // * A Firefox bug, when `html` has `overflow:hidden`, results in
                //   killing transitions :(. So remove the “opened” state on the next tick.
                //   Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289
                setTimeout(function () {

                    // Remove the “opened” and “focused” class from the picker root.
                    P.$root.removeClass(CLASSES.opened + ' ' + CLASSES.focused);
                    aria(P.$root[0], 'hidden', true);
                }, 0);

                // If it’s already closed, do nothing more.
                if (!STATE.open) return P;

                // Set it as closed.
                STATE.open = false;

                // Allow the page to scroll.
                if (IS_DEFAULT_THEME) {
                    $('body').css('overflow', '').css('padding-right', '-=' + getScrollbarWidth());
                }

                // Unbind the document events.
                $document.off('.' + STATE.id);

                // Trigger the queued “close” events.
                return P.trigger('close');
            }, //close


            /**
             * Clear the values
             */
            clear: function clear(options) {
                return P.set('clear', null, options);
            }, //clear


            /**
             * Set something
             */
            set: function set(thing, value, options) {

                var thingItem,
                    thingValue,
                    thingIsObject = $.isPlainObject(thing),
                    thingObject = thingIsObject ? thing : {};

                // Make sure we have usable options.
                options = thingIsObject && $.isPlainObject(value) ? value : options || {};

                if (thing) {

                    // If the thing isn’t an object, make it one.
                    if (!thingIsObject) {
                        thingObject[thing] = value;
                    }

                    // Go through the things of items to set.
                    for (thingItem in thingObject) {

                        // Grab the value of the thing.
                        thingValue = thingObject[thingItem];

                        // First, if the item exists and there’s a value, set it.
                        if (thingItem in P.component.item) {
                            if (thingValue === undefined) thingValue = null;
                            P.component.set(thingItem, thingValue, options);
                        }

                        // Then, check to update the element value and broadcast a change.
                        if ((thingItem == 'select' || thingItem == 'clear') && SETTINGS.updateInput) {
                            $ELEMENT.val(thingItem == 'clear' ? '' : P.get(thingItem, SETTINGS.format)).trigger('change');
                        }
                    }

                    // Render a new picker.
                    P.render();
                }

                // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.
                return options.muted ? P : P.trigger('set', thingObject);
            }, //set


            /**
             * Get something
             */
            get: function get(thing, format) {

                // Make sure there’s something to get.
                thing = thing || 'value';

                // If a picker state exists, return that.
                if (STATE[thing] != null) {
                    return STATE[thing];
                }

                // Return the submission value, if that.
                if (thing == 'valueSubmit') {
                    if (P._hidden) {
                        return P._hidden.value;
                    }
                    thing = 'value';
                }

                // Return the value, if that.
                if (thing == 'value') {
                    return ELEMENT.value;
                }

                // Check if a component item exists, return that.
                if (thing in P.component.item) {
                    if (typeof format == 'string') {
                        var thingValue = P.component.get(thing);
                        return thingValue ? PickerConstructor._.trigger(P.component.formats.toString, P.component, [format, thingValue]) : '';
                    }
                    return P.component.get(thing);
                }
            }, //get


            /**
             * Bind events on the things.
             */
            on: function on(thing, method, internal) {

                var thingName,
                    thingMethod,
                    thingIsObject = $.isPlainObject(thing),
                    thingObject = thingIsObject ? thing : {};

                if (thing) {

                    // If the thing isn’t an object, make it one.
                    if (!thingIsObject) {
                        thingObject[thing] = method;
                    }

                    // Go through the things to bind to.
                    for (thingName in thingObject) {

                        // Grab the method of the thing.
                        thingMethod = thingObject[thingName];

                        // If it was an internal binding, prefix it.
                        if (internal) {
                            thingName = '_' + thingName;
                        }

                        // Make sure the thing methods collection exists.
                        STATE.methods[thingName] = STATE.methods[thingName] || [];

                        // Add the method to the relative method collection.
                        STATE.methods[thingName].push(thingMethod);
                    }
                }

                return P;
            }, //on


            /**
             * Unbind events on the things.
             */
            off: function off() {
                var i,
                    thingName,
                    names = arguments;
                for (i = 0, namesCount = names.length; i < namesCount; i += 1) {
                    thingName = names[i];
                    if (thingName in STATE.methods) {
                        delete STATE.methods[thingName];
                    }
                }
                return P;
            },

            /**
             * Fire off method events.
             */
            trigger: function trigger(name, data) {
                var _trigger = function _trigger(name) {
                    var methodList = STATE.methods[name];
                    if (methodList) {
                        methodList.map(function (method) {
                            PickerConstructor._.trigger(method, P, [data]);
                        });
                    }
                };
                _trigger('_' + name);
                _trigger(name);
                return P;
            } //trigger
            //PickerInstance.prototype


            /**
             * Wrap the picker holder components together.
             */
        };function createWrappedComponent() {

            // Create a picker wrapper holder
            return PickerConstructor._.node('div',

            // Create a picker wrapper node
            PickerConstructor._.node('div',

            // Create a picker frame
            PickerConstructor._.node('div',

            // Create a picker box node
            PickerConstructor._.node('div',

            // Create the components nodes.
            P.component.nodes(STATE.open),

            // The picker box class
            CLASSES.box),

            // Picker wrap class
            CLASSES.wrap),

            // Picker frame class
            CLASSES.frame),

            // Picker holder class
            CLASSES.holder, 'tabindex="-1"'); //endreturn
        } //createWrappedComponent

        /**
         * Prepare the input element with all bindings.
         */
        function prepareElement() {

            $ELEMENT.

            // Store the picker data by component name.
            data(NAME, P).

            // Add the “input” class name.
            addClass(CLASSES.input).

            // If there’s a `data-value`, update the value of the element.
            val($ELEMENT.data('value') ? P.get('select', SETTINGS.format) : ELEMENT.value).

            // On focus/click, open the picker.
            on('focus.' + STATE.id + ' click.' + STATE.id, debounce(function (event) {
                event.preventDefault();
                P.open();
            }, 100));

            // Only bind keydown events if the element isn’t editable.
            if (!SETTINGS.editable) {

                $ELEMENT.

                // Handle keyboard event based on the picker being opened or not.
                on('keydown.' + STATE.id, handleKeydownEvent);
            }

            // Update the aria attributes.
            aria(ELEMENT, {
                haspopup: true,
                expanded: false,
                readonly: false,
                owns: ELEMENT.id + '_root'
            });
        }

        /**
         * Prepare the root picker element with all bindings.
         */
        function prepareElementRoot() {
            aria(P.$root[0], 'hidden', true);
        }

        /**
         * Prepare the holder picker element with all bindings.
         */
        function prepareElementHolder() {

            P.$holder.on({

                // For iOS8.
                keydown: handleKeydownEvent,

                'focus.toOpen': handleFocusToOpenEvent,

                blur: function blur() {
                    // Remove the “target” class.
                    $ELEMENT.removeClass(CLASSES.target);
                },

                // When something within the holder is focused, stop from bubbling
                // to the doc and remove the “focused” state from the root.
                focusin: function focusin(event) {
                    P.$root.removeClass(CLASSES.focused);
                    event.stopPropagation();
                },

                // When something within the holder is clicked, stop it
                // from bubbling to the doc.
                'mousedown click': function mousedownClick(event) {

                    var target = getRealEventTarget(event, ELEMENT);

                    // Make sure the target isn’t the root holder so it can bubble up.
                    if (target != P.$holder[0]) {

                        event.stopPropagation();

                        // * For mousedown events, cancel the default action in order to
                        //   prevent cases where focus is shifted onto external elements
                        //   when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).
                        //   Also, for Firefox, don’t prevent action on the `option` element.
                        if (event.type == 'mousedown' && !$(target).is('input, select, textarea, button, option')) {

                            event.preventDefault();

                            // Re-focus onto the holder so that users can click away
                            // from elements focused within the picker.
                            P.$holder.eq(0).focus();
                        }
                    }
                }

            }).

            // If there’s a click on an actionable element, carry out the actions.
            on('click', '[data-pick], [data-nav], [data-clear], [data-close]', function () {

                var $target = $(this),
                    targetData = $target.data(),
                    targetDisabled = $target.hasClass(CLASSES.navDisabled) || $target.hasClass(CLASSES.disabled),


                // * For IE, non-focusable elements can be active elements as well
                //   (http://stackoverflow.com/a/2684561).
                activeElement = getActiveElement();
                activeElement = activeElement && (activeElement.type || activeElement.href ? activeElement : null);

                // If it’s disabled or nothing inside is actively focused, re-focus the element.
                if (targetDisabled || activeElement && !$.contains(P.$root[0], activeElement)) {
                    P.$holder.eq(0).focus();
                }

                // If something is superficially changed, update the `highlight` based on the `nav`.
                if (!targetDisabled && targetData.nav) {
                    P.set('highlight', P.component.item.highlight, { nav: targetData.nav });
                }

                // If something is picked, set `select` then close with focus.
                else if (!targetDisabled && 'pick' in targetData) {
                        P.set('select', targetData.pick);
                        if (SETTINGS.closeOnSelect) {
                            P.close(true);
                        }
                    }

                    // If a “clear” button is pressed, empty the values and close with focus.
                    else if (targetData.clear) {
                            P.clear();
                            if (SETTINGS.closeOnClear) {
                                P.close(true);
                            }
                        } else if (targetData.close) {
                            P.close(true);
                        }
            }); //P.$holder
        }

        /**
         * Prepare the hidden input element along with all bindings.
         */
        function prepareElementHidden() {

            var name;

            if (SETTINGS.hiddenName === true) {
                name = ELEMENT.name;
                ELEMENT.name = '';
            } else {
                name = [typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '', typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'];
                name = name[0] + ELEMENT.name + name[1];
            }

            P._hidden = $('<input ' + 'type=hidden ' +

            // Create the name using the original input’s with a prefix and suffix.
            'name="' + name + '"' + (

            // If the element has a value, set the hidden value as well.
            $ELEMENT.data('value') || ELEMENT.value ? ' value="' + P.get('select', SETTINGS.formatSubmit) + '"' : '') + '>')[0];

            $ELEMENT.

            // If the value changes, update the hidden input with the correct format.
            on('change.' + STATE.id, function () {
                P._hidden.value = ELEMENT.value ? P.get('select', SETTINGS.formatSubmit) : '';
            });
        }

        // Wait for transitions to end before focusing the holder. Otherwise, while
        // using the `container` option, the view jumps to the container.
        function focusPickerOnceOpened() {

            if (IS_DEFAULT_THEME && supportsTransitions) {
                P.$holder.find('.' + CLASSES.frame).one('transitionend', function () {
                    P.$holder.eq(0).focus();
                });
            } else {
                setTimeout(function () {
                    P.$holder.eq(0).focus();
                }, 0);
            }
        }

        function handleFocusToOpenEvent(event) {

            // Stop the event from propagating to the doc.
            event.stopPropagation();

            // Add the “target” class.
            $ELEMENT.addClass(CLASSES.target);

            // Add the “focused” class to the root.
            P.$root.addClass(CLASSES.focused);

            // And then finally open the picker.
            P.open();
        }

        // For iOS8.
        function handleKeydownEvent(event) {

            var keycode = event.keyCode,


            // Check if one of the delete keys was pressed.
            isKeycodeDelete = /^(8|46)$/.test(keycode);

            // For some reason IE clears the input value on “escape”.
            if (keycode == 27) {
                P.close(true);
                return false;
            }

            // Check if `space` or `delete` was pressed or the picker is closed with a key movement.
            if (keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode]) {

                // Prevent it from moving the page and bubbling to doc.
                event.preventDefault();
                event.stopPropagation();

                // If `delete` was pressed, clear the values and close the picker.
                // Otherwise open the picker.
                if (isKeycodeDelete) {
                    P.clear().close();
                } else {
                    P.open();
                }
            }
        }

        // Return a new picker instance.
        return new PickerInstance();
    } //PickerConstructor


    /**
     * The default classes and prefix to use for the HTML classes.
     */
    PickerConstructor.klasses = function (prefix) {
        prefix = prefix || 'picker';
        return {

            picker: prefix,
            opened: prefix + '--opened',
            focused: prefix + '--focused',

            input: prefix + '__input',
            active: prefix + '__input--active',
            target: prefix + '__input--target',

            holder: prefix + '__holder',

            frame: prefix + '__frame',
            wrap: prefix + '__wrap',

            box: prefix + '__box'
        };
    }; //PickerConstructor.klasses


    /**
     * Check if the default theme is being used.
     */
    function isUsingDefaultTheme(element) {

        var theme,
            prop = 'position';

        // For IE.
        if (element.currentStyle) {
            theme = element.currentStyle[prop];
        }

        // For normal browsers.
        else if (window.getComputedStyle) {
                theme = getComputedStyle(element)[prop];
            }

        return theme == 'fixed';
    }

    /**
     * Get the width of the browser’s scrollbar.
     * Taken from: https://github.com/VodkaBears/Remodal/blob/master/src/jquery.remodal.js
     */
    function getScrollbarWidth() {

        if ($html.height() <= $window.height()) {
            return 0;
        }

        var $outer = $('<div style="visibility:hidden;width:100px" />').appendTo('body');

        // Get the width without scrollbars.
        var widthWithoutScroll = $outer[0].offsetWidth;

        // Force adding scrollbars.
        $outer.css('overflow', 'scroll');

        // Add the inner div.
        var $inner = $('<div style="width:100%" />').appendTo($outer);

        // Get the width with scrollbars.
        var widthWithScroll = $inner[0].offsetWidth;

        // Remove the divs.
        $outer.remove();

        // Return the difference between the widths.
        return widthWithoutScroll - widthWithScroll;
    }

    /**
     * Get the target element from the event.
     * If ELEMENT is supplied and present in the event path (ELEMENT is ancestor of the target),
     * returns ELEMENT instead
     */
    function getRealEventTarget(event, ELEMENT) {

        var path = [];

        if (event.path) {
            path = event.path;
        }

        if (event.originalEvent && event.originalEvent.path) {
            path = event.originalEvent.path;
        }

        if (path && path.length > 0) {
            if (ELEMENT && path.indexOf(ELEMENT) >= 0) {
                return ELEMENT;
            } else {
                return path[0];
            }
        }

        return event.target;
    }

    // taken from https://davidwalsh.name/javascript-debounce-function
    function debounce(func, wait, immediate) {
        var timeout;
        return function () {
            var context = this,
                args = arguments;
            var later = function later() {
                timeout = null;
                if (!immediate) func.apply(context, args);
            };
            var callNow = immediate && !timeout;
            clearTimeout(timeout);
            timeout = setTimeout(later, wait);
            if (callNow) func.apply(context, args);
        };
    }

    /**
     * PickerConstructor helper methods.
     */
    PickerConstructor._ = {

        /**
         * Create a group of nodes. Expects:
         * `
            {
                min:    {Integer},
                max:    {Integer},
                i:      {Integer},
                node:   {String},
                item:   {Function}
            }
         * `
         */
        group: function group(groupObject) {

            var
            // Scope for the looped object
            loopObjectScope,


            // Create the nodes list
            nodesList = '',


            // The counter starts from the `min`
            counter = PickerConstructor._.trigger(groupObject.min, groupObject);

            // Loop from the `min` to `max`, incrementing by `i`
            for (; counter <= PickerConstructor._.trigger(groupObject.max, groupObject, [counter]); counter += groupObject.i) {

                // Trigger the `item` function within scope of the object
                loopObjectScope = PickerConstructor._.trigger(groupObject.item, groupObject, [counter]);

                // Splice the subgroup and create nodes out of the sub nodes
                nodesList += PickerConstructor._.node(groupObject.node, loopObjectScope[0], // the node
                loopObjectScope[1], // the classes
                loopObjectScope[2] // the attributes
                );
            }

            // Return the list of nodes
            return nodesList;
        }, //group


        /**
         * Create a dom node string
         */
        node: function node(wrapper, item, klass, attribute) {

            // If the item is false-y, just return an empty string
            if (!item) return '';

            // If the item is an array, do a join
            item = $.isArray(item) ? item.join('') : item;

            // Check for the class
            klass = klass ? ' class="' + klass + '"' : '';

            // Check for any attributes
            attribute = attribute ? ' ' + attribute : '';

            // Return the wrapped item
            return '<' + wrapper + klass + attribute + '>' + item + '</' + wrapper + '>';
        }, //node


        /**
         * Lead numbers below 10 with a zero.
         */
        lead: function lead(number) {
            return (number < 10 ? '0' : '') + number;
        },

        /**
         * Trigger a function otherwise return the value.
         */
        trigger: function trigger(callback, scope, args) {
            return typeof callback == 'function' ? callback.apply(scope, args || []) : callback;
        },

        /**
         * If the second character is a digit, length is 2 otherwise 1.
         */
        digits: function digits(string) {
            return (/\d/.test(string[1]) ? 2 : 1
            );
        },

        /**
         * Tell if something is a date object.
         */
        isDate: function isDate(value) {
            return {}.toString.call(value).indexOf('Date') > -1 && this.isInteger(value.getDate());
        },

        /**
         * Tell if something is an integer.
         */
        isInteger: function isInteger(value) {
            return {}.toString.call(value).indexOf('Number') > -1 && value % 1 === 0;
        },

        /**
         * Create ARIA attribute strings.
         */
        ariaAttr: ariaAttr //PickerConstructor._


        /**
         * Extend the picker with a component and defaults.
         */
    };PickerConstructor.extend = function (name, Component) {

        // Extend jQuery.
        $.fn[name] = function (options, action) {

            // Grab the component data.
            var componentData = this.data(name);

            // If the picker is requested, return the data object.
            if (options == 'picker') {
                return componentData;
            }

            // If the component data exists and `options` is a string, carry out the action.
            if (componentData && typeof options == 'string') {
                return PickerConstructor._.trigger(componentData[options], componentData, [action]);
            }

            // Otherwise go through each matched element and if the component
            // doesn’t exist, create a new picker using `this` element
            // and merging the defaults and options with a deep copy.
            return this.each(function () {
                var $this = $(this);
                if (!$this.data(name)) {
                    new PickerConstructor(this, name, Component, options);
                }
            });
        };

        // Set the defaults.
        $.fn[name].defaults = Component.defaults;
    }; //PickerConstructor.extend


    function aria(element, attribute, value) {
        if ($.isPlainObject(attribute)) {
            for (var key in attribute) {
                ariaSet(element, key, attribute[key]);
            }
        } else {
            ariaSet(element, attribute, value);
        }
    }
    function ariaSet(element, attribute, value) {
        element.setAttribute((attribute == 'role' ? '' : 'aria-') + attribute, value);
    }
    function ariaAttr(attribute, data) {
        if (!$.isPlainObject(attribute)) {
            attribute = { attribute: data };
        }
        data = '';
        for (var key in attribute) {
            var attr = (key == 'role' ? '' : 'aria-') + key,
                attrVal = attribute[key];
            data += attrVal == null ? '' : attr + '="' + attribute[key] + '"';
        }
        return data;
    }

    // IE8 bug throws an error for activeElements within iframes.
    function getActiveElement() {
        try {
            return document.activeElement;
        } catch (err) {}
    }

    // Expose the picker constructor.
    return PickerConstructor;
});

},{}],62:[function(require,module,exports){
"use strict";

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

/*! picturefill - v3.0.2 - 2016-02-12
 * https://scottjehl.github.io/picturefill/
 * Copyright (c) 2016 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT
 */
!function (a) {
  var b = navigator.userAgent;a.HTMLPictureElement && /ecko/.test(b) && b.match(/rv\:(\d+)/) && RegExp.$1 < 45 && addEventListener("resize", function () {
    var b,
        c = document.createElement("source"),
        d = function d(a) {
      var b,
          d,
          e = a.parentNode;"PICTURE" === e.nodeName.toUpperCase() ? (b = c.cloneNode(), e.insertBefore(b, e.firstElementChild), setTimeout(function () {
        e.removeChild(b);
      })) : (!a._pfLastSize || a.offsetWidth > a._pfLastSize) && (a._pfLastSize = a.offsetWidth, d = a.sizes, a.sizes += ",100vw", setTimeout(function () {
        a.sizes = d;
      }));
    },
        e = function e() {
      var a,
          b = document.querySelectorAll("picture > img, img[srcset][sizes]");for (a = 0; a < b.length; a++) {
        d(b[a]);
      }
    },
        f = function f() {
      clearTimeout(b), b = setTimeout(e, 99);
    },
        g = a.matchMedia && matchMedia("(orientation: landscape)"),
        h = function h() {
      f(), g && g.addListener && g.addListener(f);
    };return c.srcset = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", /^[c|i]|d$/.test(document.readyState || "") ? h() : document.addEventListener("DOMContentLoaded", h), f;
  }());
}(window), function (a, b, c) {
  "use strict";
  function d(a) {
    return " " === a || "	" === a || "\n" === a || "\f" === a || "\r" === a;
  }function e(b, c) {
    var d = new a.Image();return d.onerror = function () {
      A[b] = !1, ba();
    }, d.onload = function () {
      A[b] = 1 === d.width, ba();
    }, d.src = c, "pending";
  }function f() {
    M = !1, P = a.devicePixelRatio, N = {}, O = {}, s.DPR = P || 1, Q.width = Math.max(a.innerWidth || 0, z.clientWidth), Q.height = Math.max(a.innerHeight || 0, z.clientHeight), Q.vw = Q.width / 100, Q.vh = Q.height / 100, r = [Q.height, Q.width, P].join("-"), Q.em = s.getEmValue(), Q.rem = Q.em;
  }function g(a, b, c, d) {
    var e, f, g, h;return "saveData" === B.algorithm ? a > 2.7 ? h = c + 1 : (f = b - c, e = Math.pow(a - .6, 1.5), g = f * e, d && (g += .1 * e), h = a + g) : h = c > 1 ? Math.sqrt(a * b) : a, h > c;
  }function h(a) {
    var b,
        c = s.getSet(a),
        d = !1;"pending" !== c && (d = r, c && (b = s.setRes(c), s.applySetCandidate(b, a))), a[s.ns].evaled = d;
  }function i(a, b) {
    return a.res - b.res;
  }function j(a, b, c) {
    var d;return !c && b && (c = a[s.ns].sets, c = c && c[c.length - 1]), d = k(b, c), d && (b = s.makeUrl(b), a[s.ns].curSrc = b, a[s.ns].curCan = d, d.res || aa(d, d.set.sizes)), d;
  }function k(a, b) {
    var c, d, e;if (a && b) for (e = s.parseSet(b), a = s.makeUrl(a), c = 0; c < e.length; c++) {
      if (a === s.makeUrl(e[c].url)) {
        d = e[c];break;
      }
    }return d;
  }function l(a, b) {
    var c,
        d,
        e,
        f,
        g = a.getElementsByTagName("source");for (c = 0, d = g.length; d > c; c++) {
      e = g[c], e[s.ns] = !0, f = e.getAttribute("srcset"), f && b.push({ srcset: f, media: e.getAttribute("media"), type: e.getAttribute("type"), sizes: e.getAttribute("sizes") });
    }
  }function m(a, b) {
    function c(b) {
      var c,
          d = b.exec(a.substring(m));return d ? (c = d[0], m += c.length, c) : void 0;
    }function e() {
      var a,
          c,
          d,
          e,
          f,
          i,
          j,
          k,
          l,
          m = !1,
          o = {};for (e = 0; e < h.length; e++) {
        f = h[e], i = f[f.length - 1], j = f.substring(0, f.length - 1), k = parseInt(j, 10), l = parseFloat(j), X.test(j) && "w" === i ? ((a || c) && (m = !0), 0 === k ? m = !0 : a = k) : Y.test(j) && "x" === i ? ((a || c || d) && (m = !0), 0 > l ? m = !0 : c = l) : X.test(j) && "h" === i ? ((d || c) && (m = !0), 0 === k ? m = !0 : d = k) : m = !0;
      }m || (o.url = g, a && (o.w = a), c && (o.d = c), d && (o.h = d), d || c || a || (o.d = 1), 1 === o.d && (b.has1x = !0), o.set = b, n.push(o));
    }function f() {
      for (c(T), i = "", j = "in descriptor";;) {
        if (k = a.charAt(m), "in descriptor" === j) {
          if (d(k)) i && (h.push(i), i = "", j = "after descriptor");else {
            if ("," === k) return m += 1, i && h.push(i), void e();if ("(" === k) i += k, j = "in parens";else {
              if ("" === k) return i && h.push(i), void e();i += k;
            }
          }
        } else if ("in parens" === j) {
          if (")" === k) i += k, j = "in descriptor";else {
            if ("" === k) return h.push(i), void e();i += k;
          }
        } else if ("after descriptor" === j) if (d(k)) ;else {
          if ("" === k) return void e();j = "in descriptor", m -= 1;
        }m += 1;
      }
    }for (var g, h, i, j, k, l = a.length, m = 0, n = [];;) {
      if (c(U), m >= l) return n;g = c(V), h = [], "," === g.slice(-1) ? (g = g.replace(W, ""), e()) : f();
    }
  }function n(a) {
    function b(a) {
      function b() {
        f && (g.push(f), f = "");
      }function c() {
        g[0] && (h.push(g), g = []);
      }for (var e, f = "", g = [], h = [], i = 0, j = 0, k = !1;;) {
        if (e = a.charAt(j), "" === e) return b(), c(), h;if (k) {
          if ("*" === e && "/" === a[j + 1]) {
            k = !1, j += 2, b();continue;
          }j += 1;
        } else {
          if (d(e)) {
            if (a.charAt(j - 1) && d(a.charAt(j - 1)) || !f) {
              j += 1;continue;
            }if (0 === i) {
              b(), j += 1;continue;
            }e = " ";
          } else if ("(" === e) i += 1;else if (")" === e) i -= 1;else {
            if ("," === e) {
              b(), c(), j += 1;continue;
            }if ("/" === e && "*" === a.charAt(j + 1)) {
              k = !0, j += 2;continue;
            }
          }f += e, j += 1;
        }
      }
    }function c(a) {
      return k.test(a) && parseFloat(a) >= 0 ? !0 : l.test(a) ? !0 : "0" === a || "-0" === a || "+0" === a ? !0 : !1;
    }var e,
        f,
        g,
        h,
        i,
        j,
        k = /^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i,
        l = /^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i;for (f = b(a), g = f.length, e = 0; g > e; e++) {
      if (h = f[e], i = h[h.length - 1], c(i)) {
        if (j = i, h.pop(), 0 === h.length) return j;if (h = h.join(" "), s.matchesMedia(h)) return j;
      }
    }return "100vw";
  }b.createElement("picture");var o,
      p,
      q,
      r,
      s = {},
      t = !1,
      u = function u() {},
      v = b.createElement("img"),
      w = v.getAttribute,
      x = v.setAttribute,
      y = v.removeAttribute,
      z = b.documentElement,
      A = {},
      B = { algorithm: "" },
      C = "data-pfsrc",
      D = C + "set",
      E = navigator.userAgent,
      F = /rident/.test(E) || /ecko/.test(E) && E.match(/rv\:(\d+)/) && RegExp.$1 > 35,
      G = "currentSrc",
      H = /\s+\+?\d+(e\d+)?w/,
      I = /(\([^)]+\))?\s*(.+)/,
      J = a.picturefillCFG,
      K = "position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)",
      L = "font-size:100%!important;",
      M = !0,
      N = {},
      O = {},
      P = a.devicePixelRatio,
      Q = { px: 1, "in": 96 },
      R = b.createElement("a"),
      S = !1,
      T = /^[ \t\n\r\u000c]+/,
      U = /^[, \t\n\r\u000c]+/,
      V = /^[^ \t\n\r\u000c]+/,
      W = /[,]+$/,
      X = /^\d+$/,
      Y = /^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,
      Z = function Z(a, b, c, d) {
    a.addEventListener ? a.addEventListener(b, c, d || !1) : a.attachEvent && a.attachEvent("on" + b, c);
  },
      $ = function $(a) {
    var b = {};return function (c) {
      return c in b || (b[c] = a(c)), b[c];
    };
  },
      _ = function () {
    var a = /^([\d\.]+)(em|vw|px)$/,
        b = function b() {
      for (var a = arguments, b = 0, c = a[0]; ++b in a;) {
        c = c.replace(a[b], a[++b]);
      }return c;
    },
        c = $(function (a) {
      return "return " + b((a || "").toLowerCase(), /\band\b/g, "&&", /,/g, "||", /min-([a-z-\s]+):/g, "e.$1>=", /max-([a-z-\s]+):/g, "e.$1<=", /calc([^)]+)/g, "($1)", /(\d+[\.]*[\d]*)([a-z]+)/g, "($1 * e.$2)", /^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi, "") + ";";
    });return function (b, d) {
      var e;if (!(b in N)) if (N[b] = !1, d && (e = b.match(a))) N[b] = e[1] * Q[e[2]];else try {
        N[b] = new Function("e", c(b))(Q);
      } catch (f) {}return N[b];
    };
  }(),
      aa = function aa(a, b) {
    return a.w ? (a.cWidth = s.calcListLength(b || "100vw"), a.res = a.w / a.cWidth) : a.res = a.d, a;
  },
      ba = function ba(a) {
    if (t) {
      var c,
          d,
          e,
          f = a || {};if (f.elements && 1 === f.elements.nodeType && ("IMG" === f.elements.nodeName.toUpperCase() ? f.elements = [f.elements] : (f.context = f.elements, f.elements = null)), c = f.elements || s.qsa(f.context || b, f.reevaluate || f.reselect ? s.sel : s.selShort), e = c.length) {
        for (s.setupRun(f), S = !0, d = 0; e > d; d++) {
          s.fillImg(c[d], f);
        }s.teardownRun(f);
      }
    }
  };o = a.console && console.warn ? function (a) {
    console.warn(a);
  } : u, G in v || (G = "src"), A["image/jpeg"] = !0, A["image/gif"] = !0, A["image/png"] = !0, A["image/svg+xml"] = b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1"), s.ns = ("pf" + new Date().getTime()).substr(0, 9), s.supSrcset = "srcset" in v, s.supSizes = "sizes" in v, s.supPicture = !!a.HTMLPictureElement, s.supSrcset && s.supPicture && !s.supSizes && !function (a) {
    v.srcset = "data:,a", a.src = "data:,a", s.supSrcset = v.complete === a.complete, s.supPicture = s.supSrcset && s.supPicture;
  }(b.createElement("img")), s.supSrcset && !s.supSizes ? !function () {
    var a = "data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw==",
        c = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",
        d = b.createElement("img"),
        e = function e() {
      var a = d.width;2 === a && (s.supSizes = !0), q = s.supSrcset && !s.supSizes, t = !0, setTimeout(ba);
    };d.onload = e, d.onerror = e, d.setAttribute("sizes", "9px"), d.srcset = c + " 1w," + a + " 9w", d.src = c;
  }() : t = !0, s.selShort = "picture>img,img[srcset]", s.sel = s.selShort, s.cfg = B, s.DPR = P || 1, s.u = Q, s.types = A, s.setSize = u, s.makeUrl = $(function (a) {
    return R.href = a, R.href;
  }), s.qsa = function (a, b) {
    return "querySelector" in a ? a.querySelectorAll(b) : [];
  }, s.matchesMedia = function () {
    return a.matchMedia && (matchMedia("(min-width: 0.1em)") || {}).matches ? s.matchesMedia = function (a) {
      return !a || matchMedia(a).matches;
    } : s.matchesMedia = s.mMQ, s.matchesMedia.apply(this, arguments);
  }, s.mMQ = function (a) {
    return a ? _(a) : !0;
  }, s.calcLength = function (a) {
    var b = _(a, !0) || !1;return 0 > b && (b = !1), b;
  }, s.supportsType = function (a) {
    return a ? A[a] : !0;
  }, s.parseSize = $(function (a) {
    var b = (a || "").match(I);return { media: b && b[1], length: b && b[2] };
  }), s.parseSet = function (a) {
    return a.cands || (a.cands = m(a.srcset, a)), a.cands;
  }, s.getEmValue = function () {
    var a;if (!p && (a = b.body)) {
      var c = b.createElement("div"),
          d = z.style.cssText,
          e = a.style.cssText;c.style.cssText = K, z.style.cssText = L, a.style.cssText = L, a.appendChild(c), p = c.offsetWidth, a.removeChild(c), p = parseFloat(p, 10), z.style.cssText = d, a.style.cssText = e;
    }return p || 16;
  }, s.calcListLength = function (a) {
    if (!(a in O) || B.uT) {
      var b = s.calcLength(n(a));O[a] = b ? b : Q.width;
    }return O[a];
  }, s.setRes = function (a) {
    var b;if (a) {
      b = s.parseSet(a);for (var c = 0, d = b.length; d > c; c++) {
        aa(b[c], a.sizes);
      }
    }return b;
  }, s.setRes.res = aa, s.applySetCandidate = function (a, b) {
    if (a.length) {
      var c,
          d,
          e,
          f,
          h,
          k,
          l,
          m,
          n,
          o = b[s.ns],
          p = s.DPR;if (k = o.curSrc || b[G], l = o.curCan || j(b, k, a[0].set), l && l.set === a[0].set && (n = F && !b.complete && l.res - .1 > p, n || (l.cached = !0, l.res >= p && (h = l))), !h) for (a.sort(i), f = a.length, h = a[f - 1], d = 0; f > d; d++) {
        if (c = a[d], c.res >= p) {
          e = d - 1, h = a[e] && (n || k !== s.makeUrl(c.url)) && g(a[e].res, c.res, p, a[e].cached) ? a[e] : c;break;
        }
      }h && (m = s.makeUrl(h.url), o.curSrc = m, o.curCan = h, m !== k && s.setSrc(b, h), s.setSize(b));
    }
  }, s.setSrc = function (a, b) {
    var c;a.src = b.url, "image/svg+xml" === b.set.type && (c = a.style.width, a.style.width = a.offsetWidth + 1 + "px", a.offsetWidth + 1 && (a.style.width = c));
  }, s.getSet = function (a) {
    var b,
        c,
        d,
        e = !1,
        f = a[s.ns].sets;for (b = 0; b < f.length && !e; b++) {
      if (c = f[b], c.srcset && s.matchesMedia(c.media) && (d = s.supportsType(c.type))) {
        "pending" === d && (c = d), e = c;break;
      }
    }return e;
  }, s.parseSets = function (a, b, d) {
    var e,
        f,
        g,
        h,
        i = b && "PICTURE" === b.nodeName.toUpperCase(),
        j = a[s.ns];(j.src === c || d.src) && (j.src = w.call(a, "src"), j.src ? x.call(a, C, j.src) : y.call(a, C)), (j.srcset === c || d.srcset || !s.supSrcset || a.srcset) && (e = w.call(a, "srcset"), j.srcset = e, h = !0), j.sets = [], i && (j.pic = !0, l(b, j.sets)), j.srcset ? (f = { srcset: j.srcset, sizes: w.call(a, "sizes") }, j.sets.push(f), g = (q || j.src) && H.test(j.srcset || ""), g || !j.src || k(j.src, f) || f.has1x || (f.srcset += ", " + j.src, f.cands.push({ url: j.src, d: 1, set: f }))) : j.src && j.sets.push({ srcset: j.src, sizes: null }), j.curCan = null, j.curSrc = c, j.supported = !(i || f && !s.supSrcset || g && !s.supSizes), h && s.supSrcset && !j.supported && (e ? (x.call(a, D, e), a.srcset = "") : y.call(a, D)), j.supported && !j.srcset && (!j.src && a.src || a.src !== s.makeUrl(j.src)) && (null === j.src ? a.removeAttribute("src") : a.src = j.src), j.parsed = !0;
  }, s.fillImg = function (a, b) {
    var c,
        d = b.reselect || b.reevaluate;a[s.ns] || (a[s.ns] = {}), c = a[s.ns], (d || c.evaled !== r) && ((!c.parsed || b.reevaluate) && s.parseSets(a, a.parentNode, b), c.supported ? c.evaled = r : h(a));
  }, s.setupRun = function () {
    (!S || M || P !== a.devicePixelRatio) && f();
  }, s.supPicture ? (ba = u, s.fillImg = u) : !function () {
    var c,
        d = a.attachEvent ? /d$|^c/ : /d$|^c|^i/,
        e = function e() {
      var a = b.readyState || "";f = setTimeout(e, "loading" === a ? 200 : 999), b.body && (s.fillImgs(), c = c || d.test(a), c && clearTimeout(f));
    },
        f = setTimeout(e, b.body ? 9 : 99),
        g = function g(a, b) {
      var c,
          d,
          e = function e() {
        var f = new Date() - d;b > f ? c = setTimeout(e, b - f) : (c = null, a());
      };return function () {
        d = new Date(), c || (c = setTimeout(e, b));
      };
    },
        h = z.clientHeight,
        i = function i() {
      M = Math.max(a.innerWidth || 0, z.clientWidth) !== Q.width || z.clientHeight !== h, h = z.clientHeight, M && s.fillImgs();
    };Z(a, "resize", g(i, 99)), Z(b, "readystatechange", e);
  }(), s.picturefill = ba, s.fillImgs = ba, s.teardownRun = u, ba._ = s, a.picturefillCFG = { pf: s, push: function push(a) {
      var b = a.shift();"function" == typeof s[b] ? s[b].apply(s, a) : (B[b] = a[0], S && s.fillImgs({ reselect: !0 }));
    } };for (; J && J.length;) {
    a.picturefillCFG.push(J.shift());
  }a.picturefill = ba, "object" == (typeof module === "undefined" ? "undefined" : _typeof(module)) && "object" == _typeof(module.exports) ? module.exports = ba : "function" == typeof define && define.amd && define("picturefill", function () {
    return ba;
  }), s.supPicture || (A["image/webp"] = e("image/webp", "data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA=="));
}(window, document);

},{}],63:[function(require,module,exports){
/* This is the starting point of the code, everything gets kicked off here
main.js
├── components - All page elements which have a SCSS and JavaScript file and are essentially self-contained
├── foundation
│   ├── scripts - AmazeRealise scrips
│   │   ├── vendor - third-party scripts
*/
'use strict';

require('./foundation/scripts/utilities');

require('./foundation/scripts/cookie-utils');

require('./foundation/scripts/vendor/modernizr-custom');

require('./foundation/scripts/vendor/jquery-ui');

require('./foundation/scripts/vendor/jquery.datetime');

var _dayjs = require('./foundation/scripts/vendor/dayjs');

var _dayjs2 = _interopRequireDefault(_dayjs);

var _accordion = require('./foundation/scripts/accordion');

var _accordion2 = _interopRequireDefault(_accordion);

var _matchHeight = require('./foundation/scripts/match-height');

var _matchHeight2 = _interopRequireDefault(_matchHeight);

var _contentHub = require('./foundation/scripts/content-hub');

var _contentHub2 = _interopRequireDefault(_contentHub);

var _brandGuidelines = require('./foundation/scripts/brand-guidelines');

var _brandGuidelines2 = _interopRequireDefault(_brandGuidelines);

var _mainNavigation = require('./components/main-navigation/main-navigation');

var _mainNavigation2 = _interopRequireDefault(_mainNavigation);

var _toggleLink = require('./components/toggle-link/toggle-link');

var _toggleLink2 = _interopRequireDefault(_toggleLink);

var _sharedWidget = require('./components/shared-widget/shared-widget');

var _sharedWidget2 = _interopRequireDefault(_sharedWidget);

var _teamMember = require('./components/team-member/team-member');

var _teamMember2 = _interopRequireDefault(_teamMember);

var _picturefill = require('./foundation/scripts/vendor/picturefill.min');

var _picturefill2 = _interopRequireDefault(_picturefill);

var _targetBlankFix = require('./foundation/scripts/target-blank-fix');

var _targetBlankFix2 = _interopRequireDefault(_targetBlankFix);

var _branchBase = require('./components/branch-map/branch-base');

var _branchBase2 = _interopRequireDefault(_branchBase);

var _searchBase = require('./components/search-bar/search-base');

var _searchBase2 = _interopRequireDefault(_searchBase);

var _ofiMin = require('./foundation/scripts/vendor/ofi-min');

var _ofiMin2 = _interopRequireDefault(_ofiMin);

var _jqueryValidate = require('./foundation/scripts/vendor/jquery-validate');

var _jqueryValidate2 = _interopRequireDefault(_jqueryValidate);

var _prefferedBranchCookie = require('./foundation/scripts/preffered-branch-cookie');

var _prefferedBranchCookie2 = _interopRequireDefault(_prefferedBranchCookie);

var _skipLink = require('./components/skip-link/skip-link');

var _skipLink2 = _interopRequireDefault(_skipLink);

var _addressLookup = require('./foundation/scripts/address-lookup');

var _addressLookup2 = _interopRequireDefault(_addressLookup);

var _postcodeLookup = require('./foundation/scripts/postcode-lookup');

var _postcodeLookup2 = _interopRequireDefault(_postcodeLookup);

var _epiForms = require('./foundation/scripts/epi-forms');

var _epiForms2 = _interopRequireDefault(_epiForms);

var _datePicker = require('./components/forms/date-picker/date-picker');

var _datePicker2 = _interopRequireDefault(_datePicker);

var _picker = require('./foundation/scripts/vendor/pickadate/picker');

var _picker2 = _interopRequireDefault(_picker);

var _picker3 = require('./foundation/scripts/vendor/pickadate/picker.date');

var _picker4 = _interopRequireDefault(_picker3);

var _legacy = require('./foundation/scripts/vendor/pickadate/legacy');

var _legacy2 = _interopRequireDefault(_legacy);

var _pickadate = require('./components/forms/pickadate/pickadate');

var _pickadate2 = _interopRequireDefault(_pickadate);

var _enquirersSubmit = require('./components/contact-branch/enquirers-submit');

var _enquirersSubmit2 = _interopRequireDefault(_enquirersSubmit);

var _postcodeAgencyFinder = require('./components/postcode-agency-finder/postcode-agency-finder');

var _postcodeAgencyFinder2 = _interopRequireDefault(_postcodeAgencyFinder);

var _arrayHelpers = require('./foundation/scripts/array-helpers');

var _arrayHelpers2 = _interopRequireDefault(_arrayHelpers);

var _ctaBlock = require('./components/cta-block/cta-block');

var _ctaBlock2 = _interopRequireDefault(_ctaBlock);

var _cookiePolicy = require('./foundation/scripts/cookie-policy');

var _cookiePolicy2 = _interopRequireDefault(_cookiePolicy);

var _warningMessage = require('./components/warning-message/warning-message');

var _warningMessage2 = _interopRequireDefault(_warningMessage);

var _siteHeader = require('./components/site-header/site-header');

var _siteHeader2 = _interopRequireDefault(_siteHeader);

var _lazyLoading = require('./components/lazy-loading/lazy-loading');

var _lazyLoading2 = _interopRequireDefault(_lazyLoading);

var _tabs = require('./components/tabs/tabs');

var _tabs2 = _interopRequireDefault(_tabs);

var _occupationSearch = require('./components/occupation-search/occupation-search');

var _occupationSearch2 = _interopRequireDefault(_occupationSearch);

var _searchSpreadsheet = require('./components/forms/search-spreadsheet/search-spreadsheet');

var _searchSpreadsheet2 = _interopRequireDefault(_searchSpreadsheet);

var _agritechBlog = require('./components/agritech-blog/agritech-blog');

var _agritechBlog2 = _interopRequireDefault(_agritechBlog);

var _newsarchiveblockFilter = require('./foundation/scripts/newsarchiveblock-filter');

var _newsarchiveblockFilter2 = _interopRequireDefault(_newsarchiveblockFilter);

var _tooltips = require('./components/tooltips/tooltips');

var _tooltips2 = _interopRequireDefault(_tooltips);

var _accordion3 = require('./components/voting/accordion');

var _accordion4 = _interopRequireDefault(_accordion3);

require('./foundation/scripts/highlight');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// Exposing addressLookup() to global scope, because it's used in-page.
// (this is less than ideal, but the better alternative is creating APIs)

// import dateTimeLocalPoly   from './foundation/scripts/vendor/datetime-local-polyfill';
// Note this is the *full* version of jQuery UI. No idea if it is required or not.
window.addressLookup = _addressLookup2.default;
//import brokenImages      from './foundation/scripts/broken-images';

// import pageHero         from './components/page-hero/hero';

window.postCodeLookup = _postcodeLookup2.default;
window.enquirersSubmit = _enquirersSubmit2.default;
window.dayjs = _dayjs2.default;

},{"./components/agritech-blog/agritech-blog":1,"./components/branch-map/branch-base":2,"./components/contact-branch/enquirers-submit":11,"./components/cta-block/cta-block":12,"./components/forms/date-picker/date-picker":13,"./components/forms/pickadate/pickadate":14,"./components/forms/search-spreadsheet/search-spreadsheet":15,"./components/lazy-loading/lazy-loading":16,"./components/main-navigation/main-navigation":17,"./components/occupation-search/occupation-search":18,"./components/postcode-agency-finder/postcode-agency-finder":19,"./components/search-bar/search-base":21,"./components/shared-widget/shared-widget":23,"./components/site-header/site-header":24,"./components/skip-link/skip-link":25,"./components/tabs/tabs":26,"./components/team-member/team-member":27,"./components/toggle-link/toggle-link":28,"./components/tooltips/tooltips":29,"./components/voting/accordion":31,"./components/warning-message/warning-message":32,"./foundation/scripts/accordion":33,"./foundation/scripts/address-lookup":34,"./foundation/scripts/array-helpers":35,"./foundation/scripts/brand-guidelines":36,"./foundation/scripts/content-hub":37,"./foundation/scripts/cookie-policy":38,"./foundation/scripts/cookie-utils":39,"./foundation/scripts/epi-forms":40,"./foundation/scripts/highlight":41,"./foundation/scripts/match-height":42,"./foundation/scripts/newsarchiveblock-filter":43,"./foundation/scripts/postcode-lookup":44,"./foundation/scripts/preffered-branch-cookie":45,"./foundation/scripts/target-blank-fix":46,"./foundation/scripts/utilities":47,"./foundation/scripts/vendor/dayjs":48,"./foundation/scripts/vendor/jquery-ui":52,"./foundation/scripts/vendor/jquery-validate":53,"./foundation/scripts/vendor/jquery.datetime":54,"./foundation/scripts/vendor/modernizr-custom":57,"./foundation/scripts/vendor/ofi-min":58,"./foundation/scripts/vendor/pickadate/legacy":59,"./foundation/scripts/vendor/pickadate/picker":61,"./foundation/scripts/vendor/pickadate/picker.date":60,"./foundation/scripts/vendor/picturefill.min":62}]},{},[63]);
;
