/*!
 * jQuery JavaScript Library v1.10.2
 * http://jquery.com/
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2013-07-03T13:48Z
 */

/*!
 * Sizzle CSS Selector Engine v1.10.2
 * http://sizzlejs.com/
 *
 * Copyright 2013 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2013-07-03
 */

//     Underscore.js 1.5.2
//     http://underscorejs.org
//     (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
//     Underscore may be freely distributed under the MIT license.

//     (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc.
//     Backbone may be freely distributed under the MIT license.
//     For all details and documentation:
//     http://backbonejs.org

/**
 * @license RequireJS i18n 2.0.4 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/i18n for details
 */

/*
 * Copyright 2015 Ubiquiti Networks, Inc. All rights reserved.
 */

/*!
 * XRegExp v2.0.0
 * (c) 2007-2012 Steven Levithan <http://xregexp.com/>
 * MIT License
 */

/*!
 * XRegExp Unicode Base v1.0.0
 * (c) 2008-2012 Steven Levithan <http://xregexp.com/>
 * MIT License
 * Uses Unicode 6.1 <http://unicode.org/>
 */

/*!
 * XRegExp Unicode Categories v1.2.0
 * (c) 2010-2012 Steven Levithan <http://xregexp.com/>
 * MIT License
 * Uses Unicode 6.1 <http://unicode.org/>
 */

/*!
 * XRegExp Unicode Scripts v1.2.0
 * (c) 2010-2012 Steven Levithan <http://xregexp.com/>
 * MIT License
 * Uses Unicode 6.1 <http://unicode.org/>
 */

/*!
 * XRegExp Unicode Blocks v1.2.0
 * (c) 2010-2012 Steven Levithan <http://xregexp.com/>
 * MIT License
 * Uses Unicode 6.1 <http://unicode.org/>
 */

/*!
 * XRegExp Unicode Properties v1.0.0
 * (c) 2012 Steven Levithan <http://xregexp.com/>
 * MIT License
 * Uses Unicode 6.1 <http://unicode.org/>
 */

/*!
 * XRegExp.matchRecursive v0.2.0
 * (c) 2009-2012 Steven Levithan <http://xregexp.com/>
 * MIT License
 */

/*!
 * XRegExp.build v0.1.0
 * (c) 2012 Steven Levithan <http://xregexp.com/>
 * MIT License
 * Inspired by RegExp.create by Lea Verou <http://lea.verou.me/>
 */

/*!
 * XRegExp Prototype Methods v1.0.0
 * (c) 2012 Steven Levithan <http://xregexp.com/>
 * MIT License
 */

/*!
 * string_score.js: String Scoring Algorithm 0.1.20 
 *
 * http://joshaven.com/string_score
 * https://github.com/joshaven/string_score
 *
 * Copyright (C) 2009-2011 Joshaven Potter <yourtech@gmail.com>
 * Special thanks to all of the contributors listed here https://github.com/joshaven/string_score
 * MIT license: http://www.opensource.org/licenses/mit-license.php
 *
 * Date: Tue Mar 1 2011
 * Updated: Tue Jun 11 2013
*/

/**
 * @license RequireJS text 2.0.10 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/text for details
 */

/*!
 * jQuery Cookie Plugin v1.3.1
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2013 Klaus Hartl
 * Released under the MIT license
 */

/*
  app.js
  Copyright 2015 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
 * Foundation Responsive Library
 * http://foundation.zurb.com
 * Copyright 2013, ZURB
 * Free to use under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
*/

/*
  unifi.js
  Copyright 2015 Ubiquiti Networks, Inc. All rights reserved.
 
  Usage:
    //set up a new dashboard router that must have a _fullyQualifiedName and an index route named Dashboard
    UNIFI.Routers.Dashboard = UNIFI.Router.extend({
      _fullyQualifiedName: 'UNIFI.Routers.Dashboard',
 
      routes: {
        'Dashboard': 'index'
      }
    });
 
    //set up a view which must be named with the router name and ucfirst(route)
    UNIFI.Views.Dashboard.Index = Backbone.View.extend({ ... });
 */

/*
  backgrid
  http://github.com/wyuenho/backgrid

  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
  Licensed under the MIT @license.
*/

// Copyright 2009, 2010 Kristopher Michael Kowal
// https://github.com/kriskowal/es5-shim
// ES5 15.5.4.20
// http://es5.github.com/#x15.5.4.20

//! moment.js
//! version : 2.6.0
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com

/*
  Copyright 2015 Ubiquiti Networks, Inc. All rights reserved.
 */

/*! jQuery UI - v1.10.3 - 2013-05-03
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effect.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */

/*!
 * jQuery Color Animations v2.1.2
 * https://github.com/jquery/jquery-color
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * Date: Wed Jan 16 08:47:09 2013 -0600
 */

/*
  ubnt.password.js
  Copyright 2015 Ubiquiti Networks, Inc. All rights reserved.
 
  Usage:
    <fieldset>
      <label for="password">Password</label>
      <input type="password" id="password" name="Password" />
    </fieldset>
  
    //initialize the password box so on focus it becomes a textbox
    $('input[name=password]').password();
 */

/*
  ubnt.submit.js
  Copyright 2015 Ubiquiti Networks, Inc. All rights reserved.
 
  Usage:
    <button type="submit" class="button tall auto green save"><span class="ui-button-icon ubnt-icon-check"></span>Apply</button>
    $('button').buttonalert({
        delay: 2000,
        states: {
            saving: '<span class="ui-button-icon ubnt-icon-refresh"></span>Saving',
            unsaved: '<span class="ui-button-icon ubnt-icon-warning"></span>Unsaved',
            success: '<span class="ui-button-icon ubnt-icon-check"></span>Saved',
            error: '<span class="ui-button-icon ubnt-icon-warning"></span>Error!'
        }
    });
    $('button').trigger('saving');
    $('button').trigger('unsaved');
    $('button').trigger('success');
    $('button').trigger('error');
    $('button').trigger('reset');
 */

/*
  ubnt.radiotoggle.js
  Copyright 2015 Ubiquiti Networks, Inc. All rights reserved.
 
  Usage:
    <fieldset>
      <div>
        <label>Foobar</label>
        <div class="buttonset">
          <input type="radio" id="countryUsa" name="country" value="usa" checked="checked" /><label for="countryUsa">USA</label>
          <input type="radio" id="countryCanada" name="country" value="canada" /><label for="countryCanada">Canada</label>
        </div>
      </div>
      <div class="country-toggled country-usa">
        <label for="state">State</label>
        <select id="state" name="state">
          <option value="CA">California</option>
          <option value="IL">Illinois</option>
          <option value="NY">New York</option>
        </select>
      </div>
      <div class="country-toggled country-canada">
        <label for="province">Province</label>
        <select id="province" name="province">
          <option value="AB">Alberta</option>
          <option value="BC">British Columbia</option>
        </select>
      </div>
    </fieldset>
  
    //initialize the radio buttons that do the toggling
    $('input[name=country]').radiotoggle({
      container: $('fieldset')
    });
 */

/*
  ubnt.addable.js
  Copyright 2015 Ubiquiti Networks, Inc. All rights reserved.
 
  Usage:
    <fieldset>
      <label for="foobar">Foobar</label>
      <div class="addable">
        <div>
          <input type="text" name="foobar" value="" />
          <button class="button icon-only"><span class="ubnt-icon-remove ui-button-icon button-remove-icon"></span></button>
        </div>
      </div>
    </fieldset>
 
    //initialize the addable, set up the constraints, and on add set up the remove button
    var $container = $('div.addable');
    $container.addable({
      min: 1,
      max: 5,
      template: $container.find('> div').clone(),
      add: $('<button class="button addable">Add New</button>'),
      added: function($inserted) {
        if (!this.options.min || this.count() > this.options.min) {
          $inserted.find('button').on('click', function(e) {
            e.preventDefault();
            $container.addable('remove', $(this));
          });
        } else {
          $inserted.find('button').remove();
        }
      }
    });
 
    //remove the elements that were used for the template
    $container.children(':not(button.addable)').remove();
    $container.addable('reset');
 */

/*
  Copyright 2014 Ubiquiti Extensions, Inc. All rights reserved.
 */

/*
  AddSiteView.js
  Copyright 2015 Ubiquiti Networks, Inc. All rights reserved.
 */

/*!
 * jQuery UI Selectmenu @VERSION
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/selectmenu
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.position.js
 *	jquery.ui.menu.js
 */

/*
  ubnt.selectmenu.js
  Copyright 2015 Ubiquiti Networks, Inc. All rights reserved.
 
  Allows for a parent element in addition to the button element
  and accounts for the original click triggering the menu and
  not just a focus event.
 */

/*  RETINISE.JS --------------------------------------------------*

  Author:         Simon Sturgess
                  @dahliacreative
                  simon@dahliacreative.com
                  http://www.dahliacreative.com
          
  Thanks to:      Pedro Piedade
                  @iampedropiedade
                  http://pedropiedade.com/
          
  Documentation:  http://www.dahliacreative.com/retinisejs
  
  Release date:   27/09/2012
  Version:        v.1.0
  Licensing:      © Copyright 2012 DahliaCreative.
                  Free to use under the GPLv2 license.
                  http://www.gnu.org/licenses/gpl-2.0.html
                  
*--------------------------------------------------------------------*/

require.config({waitSeconds:10,baseUrl:"/lib/4.7.6/js/",paths:{includes:"../../includes",jquery:"libs/bower-components/jquery/jquery","jquery-ui":"libs/bower-components/jquery-ui/ui/jquery-ui",backbone:"libs/bower-components/backbone/backbone",underscore:"libs/bower-components/underscore/underscore","ubnt/backgrid":"ubnt/ubnt.backgrid",text:"libs/bower-components/text/text",async:"libs/requirejs-async","libs/d3":"libs/bower-components/d3/d3","libs/backgrid":"libs/bower-components/backgrid/lib/4.7.6/backgrid","libs/moment":"libs/bower-components/momentjs/moment",i18n:"libs/bower-components/requirejs-i18n/i18n","libs/backbone-pageable":"libs/bower-components/backbone-pageable/lib/4.7.6/backbone-pageable","libs/string_score":"libs/bower-components/string_score/string_score","libs/jquery.cookie":"libs/bower-components/jquery.cookie/jquery.cookie","libs/jquery.mousewheel":"libs/bower-components/jquery-mousewheel/jquery.mousewheel","libs/jquery.ui.touch-punch":"libs/bower-components/jquery-ui-touch-punch/jquery.ui.touch-punch","libs/jquery.validate":"libs/bower-components/jquery-validation/jquery.validate","libs/jquery.fileupload":"libs/bower-components/jquery-file-upload/js/jquery.fileupload","libs/jquery.iframetransport":"libs/bower-components/jquery-file-upload/js/jquery.iframe-transport","libs/backgrid-select-all":"libs/bower-components/backgrid-select-all/backgrid-select-all",retina:"libs/jquery.retinise","foundation.alerts":"libs/foundation/foundation.alerts","foundation.clearing":"libs/foundation/foundation.clearing","foundation.cookie":"libs/foundation/foundation.cookie","foundation.dropdown":"libs/foundation/foundation.dropdown","foundation.forms":"libs/foundation/foundation.forms","foundation.joyride":"libs/foundation/foundation.joyride",foundation:"libs/foundation/foundation","foundation.magellen":"libs/foundation/foundation.magellen","foundation.orbit":"libs/foundation/foundation.orbit","foundation.placeholder":"libs/foundation/foundation.placeholder","foundation.reveal":"libs/foundation/foundation.reveal","foundation.section":"libs/foundation/foundation.section","foundation.tooltips":"libs/foundation/foundation.tooltips","foundation.topbar":"libs/foundation/foundation.topbar",stickit:"libs/bower-components/backbone.stickit/backbone.stickit",gmaps:"libs/google/maps",heatmap:"libs/heatmap","heatmap-gmaps":"libs/heatmap-gmaps",xregexp:"libs/xregexp-all"},shim:{underscore:{exports:"_"},backbone:{deps:["underscore","jquery","ubnt/ubnt.utils"],exports:"Backbone"},"libs/backgrid":{deps:["backbone","underscore","jquery"],exports:"Backgrid"},"libs/backgrid-select-all":["libs/backgrid"],"libs/moment":{exports:"moment"},"libs/jquery.mousewheel":["jquery"],"libs/jquery-ui":["jquery"],"libs/jquery.cookie":["jquery"],"libs/jquery.ui.selectmenu":["jquery-ui"],"libs/jquery.ui.touch-punch":["jquery-ui"],"libs/jquery.validate":["jquery-ui"],"libs/jquery.fileupload":["jquery-ui"],"libs/vt100":{exports:"VT100"},"libs/d3":{exports:"d3"},retina:{deps:["jquery"]},stickit:["backbone"],foundation:["jquery"],"foundation.alerts":["foundation"],"foundation.clearing":["foundation"],"foundation.cookie":["foundation"],"foundation.dropdown":["foundation"],"foundation.forms":["foundation"],"foundation.joyride":["foundation"],"foundation.magellen":["foundation"],"foundation.orbit":["foundation"],"foundation.placeholder":["foundation"],"foundation.reveal":["foundation"],"foundation.section":["foundation"],"foundation.tooltips":["foundation"],"foundation.topbar":["foundation"],gmaps:{wrapShim:!0,deps:["async"],exports:"google"},heatmap:{exports:"h337"},"heatmap-gmaps":{wrapShim:!0,deps:["jquery","heatmap","gmaps"],exports:"HeatmapOverlay"},xregexp:{exports:"XRegExp"}}}),define("common",function(){}),function(e,t){function i(e){var t=e.length,i=ct.type(e);return ct.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===i||"function"!==i&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function n(e){var t=Et[e]={};return ct.each(e.match(ht)||[],function(e,i){t[i]=!0}),t}function s(e,i,n,s){if(ct.acceptData(e)){var o,a,r=ct.expando,l=e.nodeType,u=l?ct.cache:e,c=l?e[r]:e[r]&&r;if(c&&u[c]&&(s||u[c].data)||n!==t||"string"!=typeof i)return c||(c=l?e[r]=tt.pop()||ct.guid++:r),u[c]||(u[c]=l?{}:{toJSON:ct.noop}),("object"==typeof i||"function"==typeof i)&&(s?u[c]=ct.extend(u[c],i):u[c].data=ct.extend(u[c].data,i)),a=u[c],s||(a.data||(a.data={}),a=a.data),n!==t&&(a[ct.camelCase(i)]=n),"string"==typeof i?(o=a[i],null==o&&(o=a[ct.camelCase(i)])):o=a,o}}function o(e,t,i){if(ct.acceptData(e)){var n,s,o=e.nodeType,a=o?ct.cache:e,l=o?e[ct.expando]:ct.expando;if(a[l]){if(t&&(n=i?a[l]:a[l].data)){ct.isArray(t)?t=t.concat(ct.map(t,ct.camelCase)):t in n?t=[t]:(t=ct.camelCase(t),t=t in n?[t]:t.split(" ")),s=t.length;for(;s--;)delete n[t[s]];if(i?!r(n):!ct.isEmptyObject(n))return}(i||(delete a[l].data,r(a[l])))&&(o?ct.cleanData([e],!0):ct.support.deleteExpando||a!=a.window?delete a[l]:a[l]=null)}}}function a(e,i,n){if(n===t&&1===e.nodeType){var s="data-"+i.replace(St,"-$1").toLowerCase();if(n=e.getAttribute(s),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Dt.test(n)?ct.parseJSON(n):n}catch(o){}ct.data(e,i,n)}else n=t}return n}function r(e){var t;for(t in e)if(("data"!==t||!ct.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function l(){return!0}function u(){return!1}function c(){try{return X.activeElement}catch(e){}}function d(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function h(e,t,i){if(ct.isFunction(t))return ct.grep(e,function(e,n){return!!t.call(e,n,e)!==i});if(t.nodeType)return ct.grep(e,function(e){return e===t!==i});if("string"==typeof t){if(Ht.test(t))return ct.filter(t,e,i);t=ct.filter(t,e)}return ct.grep(e,function(e){return ct.inArray(e,t)>=0!==i})}function p(e){var t=Vt.split("|"),i=e.createDocumentFragment();if(i.createElement)for(;t.length;)i.createElement(t.pop());return i}function f(e,t){return ct.nodeName(e,"table")&&ct.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function m(e){return e.type=(null!==ct.find.attr(e,"type"))+"/"+e.type,e}function g(e){var t=si.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _(e,t){for(var i,n=0;null!=(i=e[n]);n++)ct._data(i,"globalEval",!t||ct._data(t[n],"globalEval"))}function v(e,t){if(1===t.nodeType&&ct.hasData(e)){var i,n,s,o=ct._data(e),a=ct._data(t,o),r=o.events;if(r){delete a.handle,a.events={};for(i in r)for(n=0,s=r[i].length;s>n;n++)ct.event.add(t,i,r[i][n])}a.data&&(a.data=ct.extend({},a.data))}}function b(e,t){var i,n,s;if(1===t.nodeType){if(i=t.nodeName.toLowerCase(),!ct.support.noCloneEvent&&t[ct.expando]){s=ct._data(t);for(n in s.events)ct.removeEvent(t,n,s.handle);t.removeAttribute(ct.expando)}"script"===i&&t.text!==e.text?(m(t).text=e.text,g(t)):"object"===i?(t.parentNode&&(t.outerHTML=e.outerHTML),ct.support.html5Clone&&e.innerHTML&&!ct.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===i&&ti.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===i?t.defaultSelected=t.selected=e.defaultSelected:("input"===i||"textarea"===i)&&(t.defaultValue=e.defaultValue)}}function A(e,i){var n,s,o=0,a=typeof e.getElementsByTagName!==Y?e.getElementsByTagName(i||"*"):typeof e.querySelectorAll!==Y?e.querySelectorAll(i||"*"):t;if(!a)for(a=[],n=e.childNodes||e;null!=(s=n[o]);o++)!i||ct.nodeName(s,i)?a.push(s):ct.merge(a,A(s,i));return i===t||i&&ct.nodeName(e,i)?ct.merge([e],a):a}function y(e){ti.test(e.type)&&(e.defaultChecked=e.checked)}function C(e,t){if(t in e)return t;for(var i=t.charAt(0).toUpperCase()+t.slice(1),n=t,s=wi.length;s--;)if(t=wi[s]+i,t in e)return t;return n}function F(e,t){return e=t||e,"none"===ct.css(e,"display")||!ct.contains(e.ownerDocument,e)}function w(e,t){for(var i,n,s,o=[],a=0,r=e.length;r>a;a++)n=e[a],n.style&&(o[a]=ct._data(n,"olddisplay"),i=n.style.display,t?(o[a]||"none"!==i||(n.style.display=""),""===n.style.display&&F(n)&&(o[a]=ct._data(n,"olddisplay",x(n.nodeName)))):o[a]||(s=F(n),(i&&"none"!==i||!s)&&ct._data(n,"olddisplay",s?i:ct.css(n,"display"))));for(a=0;r>a;a++)n=e[a],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?o[a]||"":"none"));return e}function E(e,t,i){var n=_i.exec(t);return n?Math.max(0,n[1]-(i||0))+(n[2]||"px"):t}function D(e,t,i,n,s){for(var o=i===(n?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===i&&(a+=ct.css(e,i+Fi[o],!0,s)),n?("content"===i&&(a-=ct.css(e,"padding"+Fi[o],!0,s)),"margin"!==i&&(a-=ct.css(e,"border"+Fi[o]+"Width",!0,s))):(a+=ct.css(e,"padding"+Fi[o],!0,s),"padding"!==i&&(a+=ct.css(e,"border"+Fi[o]+"Width",!0,s)));return a}function S(e,t,i){var n=!0,s="width"===t?e.offsetWidth:e.offsetHeight,o=ci(e),a=ct.support.boxSizing&&"border-box"===ct.css(e,"boxSizing",!1,o);if(0>=s||null==s){if(s=di(e,t,o),(0>s||null==s)&&(s=e.style[t]),vi.test(s))return s;n=a&&(ct.support.boxSizingReliable||s===e.style[t]),s=parseFloat(s)||0}return s+D(e,t,i||(a?"border":"content"),n,o)+"px"}function x(e){var t=X,i=Ai[e];return i||(i=G(e,t),"none"!==i&&i||(ui=(ui||ct("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(ui[0].contentWindow||ui[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),i=G(e,t),ui.detach()),Ai[e]=i),i}function G(e,t){var i=ct(t.createElement(e)).appendTo(t.body),n=ct.css(i[0],"display");return i.remove(),n}function k(e,t,i,n){var s;if(ct.isArray(t))ct.each(t,function(t,s){i||Di.test(e)?n(e,s):k(e+"["+("object"==typeof s?t:"")+"]",s,i,n)});else if(i||"object"!==ct.type(t))n(e,t);else for(s in t)k(e+"["+s+"]",t[s],i,n)}function B(e){return function(t,i){"string"!=typeof t&&(i=t,t="*");var n,s=0,o=t.toLowerCase().match(ht)||[];if(ct.isFunction(i))for(;n=o[s++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(i)):(e[n]=e[n]||[]).push(i)}}function P(e,t,i,n){function s(r){var l;return o[r]=!0,ct.each(e[r]||[],function(e,r){var u=r(t,i,n);return"string"!=typeof u||a||o[u]?a?!(l=u):void 0:(t.dataTypes.unshift(u),s(u),!1)}),l}var o={},a=e===zi;return s(t.dataTypes[0])||!o["*"]&&s("*")}function T(e,i){var n,s,o=ct.ajaxSettings.flatOptions||{};for(s in i)i[s]!==t&&((o[s]?e:n||(n={}))[s]=i[s]);return n&&ct.extend(!0,e,n),e}function I(e,i,n){for(var s,o,a,r,l=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),o===t&&(o=e.mimeType||i.getResponseHeader("Content-Type"));if(o)for(r in l)if(l[r]&&l[r].test(o)){u.unshift(r);break}if(u[0]in n)a=u[0];else{for(r in n){if(!u[0]||e.converters[r+" "+u[0]]){a=r;break}s||(s=r)}a=a||s}return a?(a!==u[0]&&u.unshift(a),n[a]):void 0}function N(e,t,i,n){var s,o,a,r,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(i[e.responseFields[o]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(s in u)if(r=s.split(" "),r[1]===o&&(a=u[l+" "+r[0]]||u["* "+r[0]])){a===!0?a=u[s]:u[s]!==!0&&(o=r[0],c.unshift(r[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(d){return{state:"parsererror",error:a?d:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}function M(){try{return new e.XMLHttpRequest}catch(t){}}function $(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function R(){return setTimeout(function(){Qi=t}),Qi=ct.now()}function U(e,t,i){for(var n,s=(on[t]||[]).concat(on["*"]),o=0,a=s.length;a>o;o++)if(n=s[o].call(i,t,e))return n}function L(e,t,i){var n,s,o=0,a=sn.length,r=ct.Deferred().always(function(){delete l.elem}),l=function(){if(s)return!1;for(var t=Qi||R(),i=Math.max(0,u.startTime+u.duration-t),n=i/u.duration||0,o=1-n,a=0,l=u.tweens.length;l>a;a++)u.tweens[a].run(o);return r.notifyWith(e,[u,o,i]),1>o&&l?i:(r.resolveWith(e,[u]),!1)},u=r.promise({elem:e,props:ct.extend({},t),opts:ct.extend(!0,{specialEasing:{}},i),originalProperties:t,originalOptions:i,startTime:Qi||R(),duration:i.duration,tweens:[],createTween:function(t,i){var n=ct.Tween(e,u.opts,t,i,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(n),n},stop:function(t){var i=0,n=t?u.tweens.length:0;if(s)return this;for(s=!0;n>i;i++)u.tweens[i].run(1);return t?r.resolveWith(e,[u,t]):r.rejectWith(e,[u,t]),this}}),c=u.props;for(O(c,u.opts.specialEasing);a>o;o++)if(n=sn[o].call(u,e,c,u.opts))return n;return ct.map(c,U,u),ct.isFunction(u.opts.start)&&u.opts.start.call(e,u),ct.fx.timer(ct.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function O(e,t){var i,n,s,o,a;for(i in e)if(n=ct.camelCase(i),s=t[n],o=e[i],ct.isArray(o)&&(s=o[1],o=e[i]=o[0]),i!==n&&(e[n]=o,delete e[i]),a=ct.cssHooks[n],a&&"expand"in a){o=a.expand(o),delete e[n];for(i in o)i in e||(e[i]=o[i],t[i]=s)}else t[n]=s}function H(e,t,i){var n,s,o,a,r,l,u=this,c={},d=e.style,h=e.nodeType&&F(e),p=ct._data(e,"fxshow");i.queue||(r=ct._queueHooks(e,"fx"),null==r.unqueued&&(r.unqueued=0,l=r.empty.fire,r.empty.fire=function(){r.unqueued||l()}),r.unqueued++,u.always(function(){u.always(function(){r.unqueued--,ct.queue(e,"fx").length||r.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(i.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===ct.css(e,"display")&&"none"===ct.css(e,"float")&&(ct.support.inlineBlockNeedsLayout&&"inline"!==x(e.nodeName)?d.zoom=1:d.display="inline-block")),i.overflow&&(d.overflow="hidden",ct.support.shrinkWrapBlocks||u.always(function(){d.overflow=i.overflow[0],d.overflowX=i.overflow[1],d.overflowY=i.overflow[2]}));for(n in t)if(s=t[n],en.exec(s)){if(delete t[n],o=o||"toggle"===s,s===(h?"hide":"show"))continue;c[n]=p&&p[n]||ct.style(e,n)}if(!ct.isEmptyObject(c)){p?"hidden"in p&&(h=p.hidden):p=ct._data(e,"fxshow",{}),o&&(p.hidden=!h),h?ct(e).show():u.done(function(){ct(e).hide()}),u.done(function(){var t;ct._removeData(e,"fxshow");for(t in c)ct.style(e,t,c[t])});for(n in c)a=U(h?p[n]:0,n,u),n in p||(p[n]=a.start,h&&(a.end=a.start,a.start="width"===n||"height"===n?1:0))}}function z(e,t,i,n,s){return new z.prototype.init(e,t,i,n,s)}function W(e,t){var i,n={height:e},s=0;for(t=t?1:0;4>s;s+=2-t)i=Fi[s],n["margin"+i]=n["padding"+i]=e;return t&&(n.opacity=n.width=e),n}function j(e){return ct.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var V,q,Y=typeof t,K=e.location,X=e.document,J=X.documentElement,Q=e.jQuery,Z=e.$,et={},tt=[],it="1.10.2",nt=tt.concat,st=tt.push,ot=tt.slice,at=tt.indexOf,rt=et.toString,lt=et.hasOwnProperty,ut=it.trim,ct=function(e,t){return new ct.fn.init(e,t,q)},dt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ht=/\S+/g,pt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ft=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,mt=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,gt=/^[\],:{}\s]*$/,_t=/(?:^|:|,)(?:\s*\[)+/g,vt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,bt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,At=/^-ms-/,yt=/-([\da-z])/gi,Ct=function(e,t){return t.toUpperCase()},Ft=function(e){(X.addEventListener||"load"===e.type||"complete"===X.readyState)&&(wt(),ct.ready())},wt=function(){X.addEventListener?(X.removeEventListener("DOMContentLoaded",Ft,!1),e.removeEventListener("load",Ft,!1)):(X.detachEvent("onreadystatechange",Ft),e.detachEvent("onload",Ft))};ct.fn=ct.prototype={jquery:it,constructor:ct,init:function(e,i,n){var s,o;if(!e)return this;if("string"==typeof e){if(s="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:ft.exec(e),!s||!s[1]&&i)return!i||i.jquery?(i||n).find(e):this.constructor(i).find(e);if(s[1]){if(i=i instanceof ct?i[0]:i,ct.merge(this,ct.parseHTML(s[1],i&&i.nodeType?i.ownerDocument||i:X,!0)),mt.test(s[1])&&ct.isPlainObject(i))for(s in i)ct.isFunction(this[s])?this[s](i[s]):this.attr(s,i[s]);return this}if(o=X.getElementById(s[2]),o&&o.parentNode){if(o.id!==s[2])return n.find(e);this.length=1,this[0]=o}return this.context=X,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):ct.isFunction(e)?n.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),ct.makeArray(e,this))},selector:"",length:0,toArray:function(){return ot.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=ct.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return ct.each(this,e,t)},ready:function(e){return ct.ready.promise().done(e),this},slice:function(){return this.pushStack(ot.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,i=+e+(0>e?t:0);return this.pushStack(i>=0&&t>i?[this[i]]:[])},map:function(e){return this.pushStack(ct.map(this,function(t,i){return e.call(t,i,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:st,sort:[].sort,splice:[].splice},ct.fn.init.prototype=ct.fn,ct.extend=ct.fn.extend=function(){var e,i,n,s,o,a,r=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof r&&(c=r,r=arguments[1]||{},l=2),"object"==typeof r||ct.isFunction(r)||(r={}),u===l&&(r=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(s in o)e=r[s],n=o[s],r!==n&&(c&&n&&(ct.isPlainObject(n)||(i=ct.isArray(n)))?(i?(i=!1,a=e&&ct.isArray(e)?e:[]):a=e&&ct.isPlainObject(e)?e:{},r[s]=ct.extend(c,a,n)):n!==t&&(r[s]=n));return r},ct.extend({expando:"jQuery"+(it+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===ct&&(e.$=Z),t&&e.jQuery===ct&&(e.jQuery=Q),ct},isReady:!1,readyWait:1,holdReady:function(e){e?ct.readyWait++:ct.ready(!0)},ready:function(e){if(e===!0?!--ct.readyWait:!ct.isReady){if(!X.body)return setTimeout(ct.ready);ct.isReady=!0,e!==!0&&--ct.readyWait>0||(V.resolveWith(X,[ct]),ct.fn.trigger&&ct(X).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===ct.type(e)},isArray:Array.isArray||function(e){return"array"===ct.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?et[rt.call(e)]||"object":typeof e},isPlainObject:function(e){var i;if(!e||"object"!==ct.type(e)||e.nodeType||ct.isWindow(e))return!1;try{if(e.constructor&&!lt.call(e,"constructor")&&!lt.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(ct.support.ownLast)for(i in e)return lt.call(e,i);for(i in e);return i===t||lt.call(e,i)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,i){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(i=t,t=!1),t=t||X;var n=mt.exec(e),s=!i&&[];return n?[t.createElement(n[1])]:(n=ct.buildFragment([e],t,s),s&&ct(s).remove(),ct.merge([],n.childNodes))},parseJSON:function(t){return e.JSON&&e.JSON.parse?e.JSON.parse(t):null===t?t:"string"==typeof t&&(t=ct.trim(t),t&&gt.test(t.replace(vt,"@").replace(bt,"]").replace(_t,"")))?new Function("return "+t)():void ct.error("Invalid JSON: "+t)},parseXML:function(i){var n,s;if(!i||"string"!=typeof i)return null;try{e.DOMParser?(s=new DOMParser,n=s.parseFromString(i,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(i))}catch(o){n=t}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||ct.error("Invalid XML: "+i),n},noop:function(){},globalEval:function(t){t&&ct.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(At,"ms-").replace(yt,Ct)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var s,o=0,a=e.length,r=i(e);if(n){if(r)for(;a>o&&(s=t.apply(e[o],n),s!==!1);o++);else for(o in e)if(s=t.apply(e[o],n),s===!1)break}else if(r)for(;a>o&&(s=t.call(e[o],o,e[o]),s!==!1);o++);else for(o in e)if(s=t.call(e[o],o,e[o]),s===!1)break;return e},trim:ut&&!ut.call("﻿ ")?function(e){return null==e?"":ut.call(e)}:function(e){return null==e?"":(e+"").replace(pt,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(i(Object(e))?ct.merge(n,"string"==typeof e?[e]:e):st.call(n,e)),n},inArray:function(e,t,i){var n;if(t){if(at)return at.call(t,e,i);for(n=t.length,i=i?0>i?Math.max(0,n+i):i:0;n>i;i++)if(i in t&&t[i]===e)return i}return-1},merge:function(e,i){var n=i.length,s=e.length,o=0;if("number"==typeof n)for(;n>o;o++)e[s++]=i[o];else for(;i[o]!==t;)e[s++]=i[o++];return e.length=s,e},grep:function(e,t,i){var n,s=[],o=0,a=e.length;for(i=!!i;a>o;o++)n=!!t(e[o],o),i!==n&&s.push(e[o]);return s},map:function(e,t,n){var s,o=0,a=e.length,r=i(e),l=[];if(r)for(;a>o;o++)s=t(e[o],o,n),null!=s&&(l[l.length]=s);else for(o in e)s=t(e[o],o,n),null!=s&&(l[l.length]=s);return nt.apply([],l)},guid:1,proxy:function(e,i){var n,s,o;return"string"==typeof i&&(o=e[i],i=e,e=o),ct.isFunction(e)?(n=ot.call(arguments,2),s=function(){return e.apply(i||this,n.concat(ot.call(arguments)))},s.guid=e.guid=e.guid||ct.guid++,s):t},access:function(e,i,n,s,o,a,r){var l=0,u=e.length,c=null==n;if("object"===ct.type(n)){o=!0;for(l in n)ct.access(e,i,l,n[l],!0,a,r)}else if(s!==t&&(o=!0,ct.isFunction(s)||(r=!0),c&&(r?(i.call(e,s),i=null):(c=i,i=function(e,t,i){return c.call(ct(e),i)})),i))for(;u>l;l++)i(e[l],n,r?s:s.call(e[l],l,i(e[l],n)));return o?e:c?i.call(e):u?i(e[0],n):a},now:function(){return(new Date).getTime()},swap:function(e,t,i,n){var s,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];s=i.apply(e,n||[]);for(o in t)e.style[o]=a[o];return s}}),ct.ready.promise=function(t){if(!V)if(V=ct.Deferred(),"complete"===X.readyState)setTimeout(ct.ready);else if(X.addEventListener)X.addEventListener("DOMContentLoaded",Ft,!1),e.addEventListener("load",Ft,!1);else{X.attachEvent("onreadystatechange",Ft),e.attachEvent("onload",Ft);var i=!1;try{i=null==e.frameElement&&X.documentElement}catch(n){}i&&i.doScroll&&!function s(){if(!ct.isReady){try{i.doScroll("left")}catch(e){return setTimeout(s,50)}wt(),ct.ready()}}()}return V.promise(t)},ct.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){et["[object "+t+"]"]=t.toLowerCase()}),q=ct(X),function(e,t){function i(e,t,i,n){var s,o,a,r,l,u,c,d,f,m;if((t?t.ownerDocument||t:L)!==P&&B(t),t=t||P,i=i||[],!e||"string"!=typeof e)return i;if(1!==(r=t.nodeType)&&9!==r)return[];if(I&&!n){if(s=bt.exec(e))if(a=s[1]){if(9===r){if(o=t.getElementById(a),!o||!o.parentNode)return i;if(o.id===a)return i.push(o),i}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&R(t,o)&&o.id===a)return i.push(o),i}else{if(s[2])return et.apply(i,t.getElementsByTagName(e)),i;if((a=s[3])&&F.getElementsByClassName&&t.getElementsByClassName)return et.apply(i,t.getElementsByClassName(a)),i}if(F.qsa&&(!N||!N.test(e))){if(d=c=U,f=t,m=9===r&&e,1===r&&"object"!==t.nodeName.toLowerCase()){for(u=h(e),(c=t.getAttribute("id"))?d=c.replace(Ct,"\\$&"):t.setAttribute("id",d),d="[id='"+d+"'] ",l=u.length;l--;)u[l]=d+p(u[l]);f=pt.test(e)&&t.parentNode||t,m=u.join(",")}if(m)try{return et.apply(i,f.querySelectorAll(m)),i}catch(g){}finally{c||t.removeAttribute("id")}}}return y(e.replace(ut,"$1"),t,i,n)}function n(){function e(i,n){return t.push(i+=" ")>E.cacheLength&&delete e[t.shift()],e[i]=n}var t=[];return e}function s(e){return e[U]=!0,e}function o(e){var t=P.createElement("div");try{return!!e(t)}catch(i){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function a(e,t){for(var i=e.split("|"),n=e.length;n--;)E.attrHandle[i[n]]=t}function r(e,t){var i=t&&e,n=i&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||K)-(~e.sourceIndex||K);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===t)return-1;return e?1:-1}function l(e){return function(t){var i=t.nodeName.toLowerCase();return"input"===i&&t.type===e}}function u(e){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===e}}function c(e){return s(function(t){return t=+t,s(function(i,n){for(var s,o=e([],i.length,t),a=o.length;a--;)i[s=o[a]]&&(i[s]=!(n[s]=i[s]))})})}function d(){}function h(e,t){var n,s,o,a,r,l,u,c=W[e+" "];if(c)return t?0:c.slice(0);for(r=e,l=[],u=E.preFilter;r;){(!n||(s=dt.exec(r)))&&(s&&(r=r.slice(s[0].length)||r),l.push(o=[])),n=!1,(s=ht.exec(r))&&(n=s.shift(),o.push({value:n,type:s[0].replace(ut," ")}),r=r.slice(n.length));for(a in E.filter)!(s=_t[a].exec(r))||u[a]&&!(s=u[a](s))||(n=s.shift(),o.push({value:n,type:a,matches:s}),r=r.slice(n.length));if(!n)break}return t?r.length:r?i.error(e):W(e,l).slice(0)}function p(e){for(var t=0,i=e.length,n="";i>t;t++)n+=e[t].value;return n}function f(e,t,i){var n=t.dir,s=i&&"parentNode"===n,o=H++;return t.first?function(t,i,o){for(;t=t[n];)if(1===t.nodeType||s)return e(t,i,o)}:function(t,i,a){var r,l,u,c=O+" "+o;if(a){for(;t=t[n];)if((1===t.nodeType||s)&&e(t,i,a))return!0}else for(;t=t[n];)if(1===t.nodeType||s)if(u=t[U]||(t[U]={}),(l=u[n])&&l[0]===c){if((r=l[1])===!0||r===w)return r===!0}else if(l=u[n]=[c],l[1]=e(t,i,a)||w,l[1]===!0)return!0}}function m(e){return e.length>1?function(t,i,n){for(var s=e.length;s--;)if(!e[s](t,i,n))return!1;return!0}:e[0]}function g(e,t,i,n,s){for(var o,a=[],r=0,l=e.length,u=null!=t;l>r;r++)(o=e[r])&&(!i||i(o,n,s))&&(a.push(o),u&&t.push(r));return a}function _(e,t,i,n,o,a){return n&&!n[U]&&(n=_(n)),o&&!o[U]&&(o=_(o,a)),s(function(s,a,r,l){var u,c,d,h=[],p=[],f=a.length,m=s||A(t||"*",r.nodeType?[r]:r,[]),_=!e||!s&&t?m:g(m,h,e,r,l),v=i?o||(s?e:f||n)?[]:a:_;if(i&&i(_,v,r,l),n)for(u=g(v,p),n(u,[],r,l),c=u.length;c--;)(d=u[c])&&(v[p[c]]=!(_[p[c]]=d));if(s){if(o||e){if(o){for(u=[],c=v.length;c--;)(d=v[c])&&u.push(_[c]=d);o(null,v=[],u,l)}for(c=v.length;c--;)(d=v[c])&&(u=o?it.call(s,d):h[c])>-1&&(s[u]=!(a[u]=d))}}else v=g(v===a?v.splice(f,v.length):v),o?o(null,a,v,l):et.apply(a,v)})}function v(e){for(var t,i,n,s=e.length,o=E.relative[e[0].type],a=o||E.relative[" "],r=o?1:0,l=f(function(e){return e===t},a,!0),u=f(function(e){return it.call(t,e)>-1},a,!0),c=[function(e,i,n){return!o&&(n||i!==G)||((t=i).nodeType?l(e,i,n):u(e,i,n))}];s>r;r++)if(i=E.relative[e[r].type])c=[f(m(c),i)];else{if(i=E.filter[e[r].type].apply(null,e[r].matches),i[U]){for(n=++r;s>n&&!E.relative[e[n].type];n++);return _(r>1&&m(c),r>1&&p(e.slice(0,r-1).concat({value:" "===e[r-2].type?"*":""})).replace(ut,"$1"),i,n>r&&v(e.slice(r,n)),s>n&&v(e=e.slice(n)),s>n&&p(e))}c.push(i)}return m(c)}function b(e,t){var n=0,o=t.length>0,a=e.length>0,r=function(s,r,l,u,c){var d,h,p,f=[],m=0,_="0",v=s&&[],b=null!=c,A=G,y=s||a&&E.find.TAG("*",c&&r.parentNode||r),C=O+=null==A?1:Math.random()||.1;for(b&&(G=r!==P&&r,w=n);null!=(d=y[_]);_++){if(a&&d){for(h=0;p=e[h++];)if(p(d,r,l)){u.push(d);break}b&&(O=C,w=++n)}o&&((d=!p&&d)&&m--,s&&v.push(d))}if(m+=_,o&&_!==m){for(h=0;p=t[h++];)p(v,f,r,l);if(s){if(m>0)for(;_--;)v[_]||f[_]||(f[_]=Q.call(u));f=g(f)}et.apply(u,f),b&&!s&&f.length>0&&m+t.length>1&&i.uniqueSort(u)}return b&&(O=C,G=A),v};return o?s(r):r}function A(e,t,n){for(var s=0,o=t.length;o>s;s++)i(e,t[s],n);return n}function y(e,t,i,n){var s,o,a,r,l,u=h(e);if(!n&&1===u.length){if(o=u[0]=u[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&F.getById&&9===t.nodeType&&I&&E.relative[o[1].type]){if(t=(E.find.ID(a.matches[0].replace(Ft,wt),t)||[])[0],!t)return i;e=e.slice(o.shift().value.length)}for(s=_t.needsContext.test(e)?0:o.length;s--&&(a=o[s],!E.relative[r=a.type]);)if((l=E.find[r])&&(n=l(a.matches[0].replace(Ft,wt),pt.test(o[0].type)&&t.parentNode||t))){if(o.splice(s,1),e=n.length&&p(o),!e)return et.apply(i,n),i;break}}return x(e,u)(n,t,!I,i,pt.test(e)),i}var C,F,w,E,D,S,x,G,k,B,P,T,I,N,M,$,R,U="sizzle"+-new Date,L=e.document,O=0,H=0,z=n(),W=n(),j=n(),V=!1,q=function(e,t){return e===t?(V=!0,0):0},Y=typeof t,K=1<<31,X={}.hasOwnProperty,J=[],Q=J.pop,Z=J.push,et=J.push,tt=J.slice,it=J.indexOf||function(e){for(var t=0,i=this.length;i>t;t++)if(this[t]===e)return t;return-1},nt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",st="[\\x20\\t\\r\\n\\f]",ot="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",at=ot.replace("w","w#"),rt="\\["+st+"*("+ot+")"+st+"*(?:([*^$|!~]?=)"+st+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+at+")|)|)"+st+"*\\]",lt=":("+ot+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+rt.replace(3,8)+")*)|.*)\\)|)",ut=new RegExp("^"+st+"+|((?:^|[^\\\\])(?:\\\\.)*)"+st+"+$","g"),dt=new RegExp("^"+st+"*,"+st+"*"),ht=new RegExp("^"+st+"*([>+~]|"+st+")"+st+"*"),pt=new RegExp(st+"*[+~]"),ft=new RegExp("="+st+"*([^\\]'\"]*)"+st+"*\\]","g"),mt=new RegExp(lt),gt=new RegExp("^"+at+"$"),_t={ID:new RegExp("^#("+ot+")"),CLASS:new RegExp("^\\.("+ot+")"),TAG:new RegExp("^("+ot.replace("w","w*")+")"),ATTR:new RegExp("^"+rt),PSEUDO:new RegExp("^"+lt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+st+"*(even|odd|(([+-]|)(\\d*)n|)"+st+"*(?:([+-]|)"+st+"*(\\d+)|))"+st+"*\\)|)","i"),bool:new RegExp("^(?:"+nt+")$","i"),needsContext:new RegExp("^"+st+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+st+"*((?:-\\d)?\\d*)"+st+"*\\)|)(?=[^-]|$)","i")},vt=/^[^{]+\{\s*\[native \w/,bt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,At=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,Ct=/'|\\/g,Ft=new RegExp("\\\\([\\da-f]{1,6}"+st+"?|("+st+")|.)","ig"),wt=function(e,t,i){var n="0x"+t-65536;return n!==n||i?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)};try{et.apply(J=tt.call(L.childNodes),L.childNodes),J[L.childNodes.length].nodeType}catch(Et){et={apply:J.length?function(e,t){Z.apply(e,tt.call(t))}:function(e,t){for(var i=e.length,n=0;e[i++]=t[n++];);e.length=i-1}}}S=i.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},F=i.support={},B=i.setDocument=function(e){var t=e?e.ownerDocument||e:L,i=t.defaultView;return t!==P&&9===t.nodeType&&t.documentElement?(P=t,T=t.documentElement,I=!S(t),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){B()}),F.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),F.getElementsByTagName=o(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),F.getElementsByClassName=o(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),F.getById=o(function(e){return T.appendChild(e).id=U,!t.getElementsByName||!t.getElementsByName(U).length}),F.getById?(E.find.ID=function(e,t){if(typeof t.getElementById!==Y&&I){var i=t.getElementById(e);return i&&i.parentNode?[i]:[]}},E.filter.ID=function(e){var t=e.replace(Ft,wt);return function(e){return e.getAttribute("id")===t}}):(delete E.find.ID,E.filter.ID=function(e){var t=e.replace(Ft,wt);return function(e){var i=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return i&&i.value===t}}),E.find.TAG=F.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var i,n=[],s=0,o=t.getElementsByTagName(e);if("*"===e){for(;i=o[s++];)1===i.nodeType&&n.push(i);return n}return o},E.find.CLASS=F.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==Y&&I?t.getElementsByClassName(e):void 0},M=[],N=[],(F.qsa=vt.test(t.querySelectorAll))&&(o(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||N.push("\\["+st+"*(?:value|"+nt+")"),e.querySelectorAll(":checked").length||N.push(":checked")}),o(function(e){var i=t.createElement("input");i.setAttribute("type","hidden"),e.appendChild(i).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&N.push("[*^$]="+st+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||N.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),N.push(",.*:")})),(F.matchesSelector=vt.test($=T.webkitMatchesSelector||T.mozMatchesSelector||T.oMatchesSelector||T.msMatchesSelector))&&o(function(e){F.disconnectedMatch=$.call(e,"div"),$.call(e,"[s!='']:x"),M.push("!=",lt)}),N=N.length&&new RegExp(N.join("|")),M=M.length&&new RegExp(M.join("|")),R=vt.test(T.contains)||T.compareDocumentPosition?function(e,t){var i=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;
return e===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},q=T.compareDocumentPosition?function(e,i){if(e===i)return V=!0,0;var n=i.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(i);return n?1&n||!F.sortDetached&&i.compareDocumentPosition(e)===n?e===t||R(L,e)?-1:i===t||R(L,i)?1:k?it.call(k,e)-it.call(k,i):0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,i){var n,s=0,o=e.parentNode,a=i.parentNode,l=[e],u=[i];if(e===i)return V=!0,0;if(!o||!a)return e===t?-1:i===t?1:o?-1:a?1:k?it.call(k,e)-it.call(k,i):0;if(o===a)return r(e,i);for(n=e;n=n.parentNode;)l.unshift(n);for(n=i;n=n.parentNode;)u.unshift(n);for(;l[s]===u[s];)s++;return s?r(l[s],u[s]):l[s]===L?-1:u[s]===L?1:0},t):P},i.matches=function(e,t){return i(e,null,null,t)},i.matchesSelector=function(e,t){if((e.ownerDocument||e)!==P&&B(e),t=t.replace(ft,"='$1']"),!(!F.matchesSelector||!I||M&&M.test(t)||N&&N.test(t)))try{var n=$.call(e,t);if(n||F.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(s){}return i(t,P,null,[e]).length>0},i.contains=function(e,t){return(e.ownerDocument||e)!==P&&B(e),R(e,t)},i.attr=function(e,i){(e.ownerDocument||e)!==P&&B(e);var n=E.attrHandle[i.toLowerCase()],s=n&&X.call(E.attrHandle,i.toLowerCase())?n(e,i,!I):t;return s===t?F.attributes||!I?e.getAttribute(i):(s=e.getAttributeNode(i))&&s.specified?s.value:null:s},i.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},i.uniqueSort=function(e){var t,i=[],n=0,s=0;if(V=!F.detectDuplicates,k=!F.sortStable&&e.slice(0),e.sort(q),V){for(;t=e[s++];)t===e[s]&&(n=i.push(s));for(;n--;)e.splice(i[n],1)}return e},D=i.getText=function(e){var t,i="",n=0,s=e.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)i+=D(e)}else if(3===s||4===s)return e.nodeValue}else for(;t=e[n];n++)i+=D(t);return i},E=i.selectors={cacheLength:50,createPseudo:s,match:_t,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ft,wt),e[3]=(e[4]||e[5]||"").replace(Ft,wt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||i.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&i.error(e[0]),e},PSEUDO:function(e){var i,n=!e[5]&&e[2];return _t.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:n&&mt.test(n)&&(i=h(n,!0))&&(i=n.indexOf(")",n.length-i)-n.length)&&(e[0]=e[0].slice(0,i),e[2]=n.slice(0,i)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ft,wt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=z[e+" "];return t||(t=new RegExp("(^|"+st+")"+e+"("+st+"|$)"))&&z(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(s){var o=i.attr(s,e);return null==o?"!="===t:t?(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o+" ").indexOf(n)>-1:"|="===t?o===n||o.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,i,n,s){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),r="of-type"===t;return 1===n&&0===s?function(e){return!!e.parentNode}:function(t,i,l){var u,c,d,h,p,f,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,_=r&&t.nodeName.toLowerCase(),v=!l&&!r;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(r?d.nodeName.toLowerCase()===_:1===d.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[a?g.firstChild:g.lastChild],a&&v){for(c=g[U]||(g[U]={}),u=c[e]||[],p=u[0]===O&&u[1],h=u[0]===O&&u[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(h=p=0)||f.pop();)if(1===d.nodeType&&++h&&d===t){c[e]=[O,p,h];break}}else if(v&&(u=(t[U]||(t[U]={}))[e])&&u[0]===O)h=u[1];else for(;(d=++p&&d&&d[m]||(h=p=0)||f.pop())&&((r?d.nodeName.toLowerCase()!==_:1!==d.nodeType)||!++h||(v&&((d[U]||(d[U]={}))[e]=[O,h]),d!==t)););return h-=s,h===n||h%n===0&&h/n>=0}}},PSEUDO:function(e,t){var n,o=E.pseudos[e]||E.setFilters[e.toLowerCase()]||i.error("unsupported pseudo: "+e);return o[U]?o(t):o.length>1?(n=[e,e,"",t],E.setFilters.hasOwnProperty(e.toLowerCase())?s(function(e,i){for(var n,s=o(e,t),a=s.length;a--;)n=it.call(e,s[a]),e[n]=!(i[n]=s[a])}):function(e){return o(e,0,n)}):o}},pseudos:{not:s(function(e){var t=[],i=[],n=x(e.replace(ut,"$1"));return n[U]?s(function(e,t,i,s){for(var o,a=n(e,null,s,[]),r=e.length;r--;)(o=a[r])&&(e[r]=!(t[r]=o))}):function(e,s,o){return t[0]=e,n(t,null,o,i),!i.pop()}}),has:s(function(e){return function(t){return i(e,t).length>0}}),contains:s(function(e){return function(t){return(t.textContent||t.innerText||D(t)).indexOf(e)>-1}}),lang:s(function(e){return gt.test(e||"")||i.error("unsupported lang: "+e),e=e.replace(Ft,wt).toLowerCase(),function(t){var i;do if(i=I?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return i=i.toLowerCase(),i===e||0===i.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var i=e.location&&e.location.hash;return i&&i.slice(1)===t.id},root:function(e){return e===T},focus:function(e){return e===P.activeElement&&(!P.hasFocus||P.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!E.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return At.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,i){return[0>i?i+t:i]}),even:c(function(e,t){for(var i=0;t>i;i+=2)e.push(i);return e}),odd:c(function(e,t){for(var i=1;t>i;i+=2)e.push(i);return e}),lt:c(function(e,t,i){for(var n=0>i?i+t:i;--n>=0;)e.push(n);return e}),gt:c(function(e,t,i){for(var n=0>i?i+t:i;++n<t;)e.push(n);return e})}},E.pseudos.nth=E.pseudos.eq;for(C in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})E.pseudos[C]=l(C);for(C in{submit:!0,reset:!0})E.pseudos[C]=u(C);d.prototype=E.filters=E.pseudos,E.setFilters=new d,x=i.compile=function(e,t){var i,n=[],s=[],o=j[e+" "];if(!o){for(t||(t=h(e)),i=t.length;i--;)o=v(t[i]),o[U]?n.push(o):s.push(o);o=j(e,b(s,n))}return o},F.sortStable=U.split("").sort(q).join("")===U,F.detectDuplicates=V,B(),F.sortDetached=o(function(e){return 1&e.compareDocumentPosition(P.createElement("div"))}),o(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||a("type|href|height|width",function(e,t,i){return i?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),F.attributes&&o(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||a("value",function(e,t,i){return i||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),o(function(e){return null==e.getAttribute("disabled")})||a(nt,function(e,t,i){var n;return i?void 0:(n=e.getAttributeNode(t))&&n.specified?n.value:e[t]===!0?t.toLowerCase():null}),ct.find=i,ct.expr=i.selectors,ct.expr[":"]=ct.expr.pseudos,ct.unique=i.uniqueSort,ct.text=i.getText,ct.isXMLDoc=i.isXML,ct.contains=i.contains}(e);var Et={};ct.Callbacks=function(e){e="string"==typeof e?Et[e]||n(e):ct.extend({},e);var i,s,o,a,r,l,u=[],c=!e.once&&[],d=function(t){for(s=e.memory&&t,o=!0,r=l||0,l=0,a=u.length,i=!0;u&&a>r;r++)if(u[r].apply(t[0],t[1])===!1&&e.stopOnFalse){s=!1;break}i=!1,u&&(c?c.length&&d(c.shift()):s?u=[]:h.disable())},h={add:function(){if(u){var t=u.length;!function n(t){ct.each(t,function(t,i){var s=ct.type(i);"function"===s?e.unique&&h.has(i)||u.push(i):i&&i.length&&"string"!==s&&n(i)})}(arguments),i?a=u.length:s&&(l=t,d(s))}return this},remove:function(){return u&&ct.each(arguments,function(e,t){for(var n;(n=ct.inArray(t,u,n))>-1;)u.splice(n,1),i&&(a>=n&&a--,r>=n&&r--)}),this},has:function(e){return e?ct.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],a=0,this},disable:function(){return u=c=s=t,this},disabled:function(){return!u},lock:function(){return c=t,s||h.disable(),this},locked:function(){return!c},fireWith:function(e,t){return!u||o&&!c||(t=t||[],t=[e,t.slice?t.slice():t],i?c.push(t):d(t)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!o}};return h},ct.extend({Deferred:function(e){var t=[["resolve","done",ct.Callbacks("once memory"),"resolved"],["reject","fail",ct.Callbacks("once memory"),"rejected"],["notify","progress",ct.Callbacks("memory")]],i="pending",n={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var e=arguments;return ct.Deferred(function(i){ct.each(t,function(t,o){var a=o[0],r=ct.isFunction(e[t])&&e[t];s[o[1]](function(){var e=r&&r.apply(this,arguments);e&&ct.isFunction(e.promise)?e.promise().done(i.resolve).fail(i.reject).progress(i.notify):i[a+"With"](this===n?i.promise():this,r?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?ct.extend(e,n):n}},s={};return n.pipe=n.then,ct.each(t,function(e,o){var a=o[2],r=o[3];n[o[1]]=a.add,r&&a.add(function(){i=r},t[1^e][2].disable,t[2][2].lock),s[o[0]]=function(){return s[o[0]+"With"](this===s?n:this,arguments),this},s[o[0]+"With"]=a.fireWith}),n.promise(s),e&&e.call(s,s),s},when:function(e){var t,i,n,s=0,o=ot.call(arguments),a=o.length,r=1!==a||e&&ct.isFunction(e.promise)?a:0,l=1===r?e:ct.Deferred(),u=function(e,i,n){return function(s){i[e]=this,n[e]=arguments.length>1?ot.call(arguments):s,n===t?l.notifyWith(i,n):--r||l.resolveWith(i,n)}};if(a>1)for(t=new Array(a),i=new Array(a),n=new Array(a);a>s;s++)o[s]&&ct.isFunction(o[s].promise)?o[s].promise().done(u(s,n,o)).fail(l.reject).progress(u(s,i,t)):--r;return r||l.resolveWith(n,o),l.promise()}}),ct.support=function(t){var i,n,s,o,a,r,l,u,c,d=X.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",i=d.getElementsByTagName("*")||[],n=d.getElementsByTagName("a")[0],!n||!n.style||!i.length)return t;o=X.createElement("select"),r=o.appendChild(X.createElement("option")),s=d.getElementsByTagName("input")[0],n.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(n.getAttribute("style")),t.hrefNormalized="/a"===n.getAttribute("href"),t.opacity=/^0.5/.test(n.style.opacity),t.cssFloat=!!n.style.cssFloat,t.checkOn=!!s.value,t.optSelected=r.selected,t.enctype=!!X.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==X.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,s.checked=!0,t.noCloneChecked=s.cloneNode(!0).checked,o.disabled=!0,t.optDisabled=!r.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}s=X.createElement("input"),s.setAttribute("value",""),t.input=""===s.getAttribute("value"),s.value="t",s.setAttribute("type","radio"),t.radioValue="t"===s.value,s.setAttribute("checked","t"),s.setAttribute("name","t"),a=X.createDocumentFragment(),a.appendChild(s),t.appendChecked=s.checked,t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(c in{submit:!0,change:!0,focusin:!0})d.setAttribute(l="on"+c,"t"),t[c+"Bubbles"]=l in e||d.attributes[l].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(c in ct(t))break;return t.ownLast="0"!==c,ct(function(){var i,n,s,o="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",a=X.getElementsByTagName("body")[0];a&&(i=X.createElement("div"),i.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(i).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=d.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",u=0===s[0].offsetHeight,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=u&&0===s[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",ct.swap(a,null!=a.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,n=d.appendChild(X.createElement("div")),n.style.cssText=d.style.cssText=o,n.style.marginRight=n.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(n,null)||{}).marginRight)),typeof d.style.zoom!==Y&&(d.innerHTML="",d.style.cssText=o+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(a.style.zoom=1)),a.removeChild(i),i=d=s=n=null)}),i=o=a=r=n=s=null,t}({});var Dt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,St=/([A-Z])/g;ct.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?ct.cache[e[ct.expando]]:e[ct.expando],!!e&&!r(e)},data:function(e,t,i){return s(e,t,i)},removeData:function(e,t){return o(e,t)},_data:function(e,t,i){return s(e,t,i,!0)},_removeData:function(e,t){return o(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&ct.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),ct.fn.extend({data:function(e,i){var n,s,o=null,r=0,l=this[0];if(e===t){if(this.length&&(o=ct.data(l),1===l.nodeType&&!ct._data(l,"parsedAttrs"))){for(n=l.attributes;r<n.length;r++)s=n[r].name,0===s.indexOf("data-")&&(s=ct.camelCase(s.slice(5)),a(l,s,o[s]));ct._data(l,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){ct.data(this,e)}):arguments.length>1?this.each(function(){ct.data(this,e,i)}):l?a(l,e,ct.data(l,e)):null},removeData:function(e){return this.each(function(){ct.removeData(this,e)})}}),ct.extend({queue:function(e,t,i){var n;return e?(t=(t||"fx")+"queue",n=ct._data(e,t),i&&(!n||ct.isArray(i)?n=ct._data(e,t,ct.makeArray(i)):n.push(i)),n||[]):void 0},dequeue:function(e,t){t=t||"fx";var i=ct.queue(e,t),n=i.length,s=i.shift(),o=ct._queueHooks(e,t),a=function(){ct.dequeue(e,t)};"inprogress"===s&&(s=i.shift(),n--),s&&("fx"===t&&i.unshift("inprogress"),delete o.stop,s.call(e,a,o)),!n&&o&&o.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return ct._data(e,i)||ct._data(e,i,{empty:ct.Callbacks("once memory").add(function(){ct._removeData(e,t+"queue"),ct._removeData(e,i)})})}}),ct.fn.extend({queue:function(e,i){var n=2;return"string"!=typeof e&&(i=e,e="fx",n--),arguments.length<n?ct.queue(this[0],e):i===t?this:this.each(function(){var t=ct.queue(this,e,i);ct._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&ct.dequeue(this,e)})},dequeue:function(e){return this.each(function(){ct.dequeue(this,e)})},delay:function(e,t){return e=ct.fx?ct.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,i){var n=setTimeout(t,e);i.stop=function(){clearTimeout(n)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,i){var n,s=1,o=ct.Deferred(),a=this,r=this.length,l=function(){--s||o.resolveWith(a,[a])};for("string"!=typeof e&&(i=e,e=t),e=e||"fx";r--;)n=ct._data(a[r],e+"queueHooks"),n&&n.empty&&(s++,n.empty.add(l));return l(),o.promise(i)}});var xt,Gt,kt=/[\t\r\n\f]/g,Bt=/\r/g,Pt=/^(?:input|select|textarea|button|object)$/i,Tt=/^(?:a|area)$/i,It=/^(?:checked|selected)$/i,Nt=ct.support.getSetAttribute,Mt=ct.support.input;ct.fn.extend({attr:function(e,t){return ct.access(this,ct.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){ct.removeAttr(this,e)})},prop:function(e,t){return ct.access(this,ct.prop,e,t,arguments.length>1)},removeProp:function(e){return e=ct.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(i){}})},addClass:function(e){var t,i,n,s,o,a=0,r=this.length,l="string"==typeof e&&e;if(ct.isFunction(e))return this.each(function(t){ct(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(ht)||[];r>a;a++)if(i=this[a],n=1===i.nodeType&&(i.className?(" "+i.className+" ").replace(kt," "):" ")){for(o=0;s=t[o++];)n.indexOf(" "+s+" ")<0&&(n+=s+" ");i.className=ct.trim(n)}return this},removeClass:function(e){var t,i,n,s,o,a=0,r=this.length,l=0===arguments.length||"string"==typeof e&&e;if(ct.isFunction(e))return this.each(function(t){ct(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(ht)||[];r>a;a++)if(i=this[a],n=1===i.nodeType&&(i.className?(" "+i.className+" ").replace(kt," "):"")){for(o=0;s=t[o++];)for(;n.indexOf(" "+s+" ")>=0;)n=n.replace(" "+s+" "," ");i.className=e?ct.trim(n):""}return this},toggleClass:function(e,t){var i=typeof e;return"boolean"==typeof t&&"string"===i?t?this.addClass(e):this.removeClass(e):this.each(ct.isFunction(e)?function(i){ct(this).toggleClass(e.call(this,i,this.className,t),t)}:function(){if("string"===i)for(var t,n=0,s=ct(this),o=e.match(ht)||[];t=o[n++];)s.hasClass(t)?s.removeClass(t):s.addClass(t);else(i===Y||"boolean"===i)&&(this.className&&ct._data(this,"__className__",this.className),this.className=this.className||e===!1?"":ct._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",i=0,n=this.length;n>i;i++)if(1===this[i].nodeType&&(" "+this[i].className+" ").replace(kt," ").indexOf(t)>=0)return!0;return!1},val:function(e){var i,n,s,o=this[0];{if(arguments.length)return s=ct.isFunction(e),this.each(function(i){var o;1===this.nodeType&&(o=s?e.call(this,i,ct(this).val()):e,null==o?o="":"number"==typeof o?o+="":ct.isArray(o)&&(o=ct.map(o,function(e){return null==e?"":e+""})),n=ct.valHooks[this.type]||ct.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))});if(o)return n=ct.valHooks[o.type]||ct.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(i=n.get(o,"value"))!==t?i:(i=o.value,"string"==typeof i?i.replace(Bt,""):null==i?"":i)}}}),ct.extend({valHooks:{option:{get:function(e){var t=ct.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){for(var t,i,n=e.options,s=e.selectedIndex,o="select-one"===e.type||0>s,a=o?null:[],r=o?s+1:n.length,l=0>s?r:o?s:0;r>l;l++)if(i=n[l],!(!i.selected&&l!==s||(ct.support.optDisabled?i.disabled:null!==i.getAttribute("disabled"))||i.parentNode.disabled&&ct.nodeName(i.parentNode,"optgroup"))){if(t=ct(i).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var i,n,s=e.options,o=ct.makeArray(t),a=s.length;a--;)n=s[a],(n.selected=ct.inArray(ct(n).val(),o)>=0)&&(i=!0);return i||(e.selectedIndex=-1),o}}},attr:function(e,i,n){var s,o,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return typeof e.getAttribute===Y?ct.prop(e,i,n):(1===a&&ct.isXMLDoc(e)||(i=i.toLowerCase(),s=ct.attrHooks[i]||(ct.expr.match.bool.test(i)?Gt:xt)),n===t?s&&"get"in s&&null!==(o=s.get(e,i))?o:(o=ct.find.attr(e,i),null==o?t:o):null!==n?s&&"set"in s&&(o=s.set(e,n,i))!==t?o:(e.setAttribute(i,n+""),n):void ct.removeAttr(e,i))},removeAttr:function(e,t){var i,n,s=0,o=t&&t.match(ht);if(o&&1===e.nodeType)for(;i=o[s++];)n=ct.propFix[i]||i,ct.expr.match.bool.test(i)?Mt&&Nt||!It.test(i)?e[n]=!1:e[ct.camelCase("default-"+i)]=e[n]=!1:ct.attr(e,i,""),e.removeAttribute(Nt?i:n)},attrHooks:{type:{set:function(e,t){if(!ct.support.radioValue&&"radio"===t&&ct.nodeName(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,i,n){var s,o,a,r=e.nodeType;if(e&&3!==r&&8!==r&&2!==r)return a=1!==r||!ct.isXMLDoc(e),a&&(i=ct.propFix[i]||i,o=ct.propHooks[i]),n!==t?o&&"set"in o&&(s=o.set(e,n,i))!==t?s:e[i]=n:o&&"get"in o&&null!==(s=o.get(e,i))?s:e[i]},propHooks:{tabIndex:{get:function(e){var t=ct.find.attr(e,"tabindex");return t?parseInt(t,10):Pt.test(e.nodeName)||Tt.test(e.nodeName)&&e.href?0:-1}}}}),Gt={set:function(e,t,i){return t===!1?ct.removeAttr(e,i):Mt&&Nt||!It.test(i)?e.setAttribute(!Nt&&ct.propFix[i]||i,i):e[ct.camelCase("default-"+i)]=e[i]=!0,i}},ct.each(ct.expr.match.bool.source.match(/\w+/g),function(e,i){var n=ct.expr.attrHandle[i]||ct.find.attr;ct.expr.attrHandle[i]=Mt&&Nt||!It.test(i)?function(e,i,s){var o=ct.expr.attrHandle[i],a=s?t:(ct.expr.attrHandle[i]=t)!=n(e,i,s)?i.toLowerCase():null;return ct.expr.attrHandle[i]=o,a}:function(e,i,n){return n?t:e[ct.camelCase("default-"+i)]?i.toLowerCase():null}}),Mt&&Nt||(ct.attrHooks.value={set:function(e,t,i){return ct.nodeName(e,"input")?void(e.defaultValue=t):xt&&xt.set(e,t,i)}}),Nt||(xt={set:function(e,i,n){var s=e.getAttributeNode(n);return s||e.setAttributeNode(s=e.ownerDocument.createAttribute(n)),s.value=i+="","value"===n||i===e.getAttribute(n)?i:t}},ct.expr.attrHandle.id=ct.expr.attrHandle.name=ct.expr.attrHandle.coords=function(e,i,n){var s;return n?t:(s=e.getAttributeNode(i))&&""!==s.value?s.value:null},ct.valHooks.button={get:function(e,i){var n=e.getAttributeNode(i);return n&&n.specified?n.value:t},set:xt.set},ct.attrHooks.contenteditable={set:function(e,t,i){xt.set(e,""===t?!1:t,i)}},ct.each(["width","height"],function(e,t){ct.attrHooks[t]={set:function(e,i){return""===i?(e.setAttribute(t,"auto"),i):void 0}}})),ct.support.hrefNormalized||ct.each(["href","src"],function(e,t){ct.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),ct.support.style||(ct.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),ct.support.optSelected||(ct.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),ct.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ct.propFix[this.toLowerCase()]=this}),ct.support.enctype||(ct.propFix.enctype="encoding"),ct.each(["radio","checkbox"],function(){ct.valHooks[this]={set:function(e,t){return ct.isArray(t)?e.checked=ct.inArray(ct(e).val(),t)>=0:void 0}},ct.support.checkOn||(ct.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var $t=/^(?:input|select|textarea)$/i,Rt=/^key/,Ut=/^(?:mouse|contextmenu)|click/,Lt=/^(?:focusinfocus|focusoutblur)$/,Ot=/^([^.]*)(?:\.(.+)|)$/;ct.event={global:{},add:function(e,i,n,s,o){var a,r,l,u,c,d,h,p,f,m,g,_=ct._data(e);if(_){for(n.handler&&(u=n,n=u.handler,o=u.selector),n.guid||(n.guid=ct.guid++),(r=_.events)||(r=_.events={}),(d=_.handle)||(d=_.handle=function(e){return typeof ct===Y||e&&ct.event.triggered===e.type?t:ct.event.dispatch.apply(d.elem,arguments)},d.elem=e),i=(i||"").match(ht)||[""],l=i.length;l--;)a=Ot.exec(i[l])||[],f=g=a[1],m=(a[2]||"").split(".").sort(),f&&(c=ct.event.special[f]||{},f=(o?c.delegateType:c.bindType)||f,c=ct.event.special[f]||{},h=ct.extend({type:f,origType:g,data:s,handler:n,guid:n.guid,selector:o,needsContext:o&&ct.expr.match.needsContext.test(o),namespace:m.join(".")},u),(p=r[f])||(p=r[f]=[],p.delegateCount=0,c.setup&&c.setup.call(e,s,m,d)!==!1||(e.addEventListener?e.addEventListener(f,d,!1):e.attachEvent&&e.attachEvent("on"+f,d))),c.add&&(c.add.call(e,h),h.handler.guid||(h.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,h):p.push(h),ct.event.global[f]=!0);e=null}},remove:function(e,t,i,n,s){var o,a,r,l,u,c,d,h,p,f,m,g=ct.hasData(e)&&ct._data(e);if(g&&(c=g.events)){for(t=(t||"").match(ht)||[""],u=t.length;u--;)if(r=Ot.exec(t[u])||[],p=m=r[1],f=(r[2]||"").split(".").sort(),p){for(d=ct.event.special[p]||{},p=(n?d.delegateType:d.bindType)||p,h=c[p]||[],r=r[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=h.length;o--;)a=h[o],!s&&m!==a.origType||i&&i.guid!==a.guid||r&&!r.test(a.namespace)||n&&n!==a.selector&&("**"!==n||!a.selector)||(h.splice(o,1),a.selector&&h.delegateCount--,d.remove&&d.remove.call(e,a));l&&!h.length&&(d.teardown&&d.teardown.call(e,f,g.handle)!==!1||ct.removeEvent(e,p,g.handle),delete c[p])}else for(p in c)ct.event.remove(e,p+t[u],i,n,!0);ct.isEmptyObject(c)&&(delete g.handle,ct._removeData(e,"events"))}},trigger:function(i,n,s,o){var a,r,l,u,c,d,h,p=[s||X],f=lt.call(i,"type")?i.type:i,m=lt.call(i,"namespace")?i.namespace.split("."):[];if(l=d=s=s||X,3!==s.nodeType&&8!==s.nodeType&&!Lt.test(f+ct.event.triggered)&&(f.indexOf(".")>=0&&(m=f.split("."),f=m.shift(),m.sort()),r=f.indexOf(":")<0&&"on"+f,i=i[ct.expando]?i:new ct.Event(f,"object"==typeof i&&i),i.isTrigger=o?2:3,i.namespace=m.join("."),i.namespace_re=i.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,i.result=t,i.target||(i.target=s),n=null==n?[i]:ct.makeArray(n,[i]),c=ct.event.special[f]||{},o||!c.trigger||c.trigger.apply(s,n)!==!1)){if(!o&&!c.noBubble&&!ct.isWindow(s)){for(u=c.delegateType||f,Lt.test(u+f)||(l=l.parentNode);l;l=l.parentNode)p.push(l),d=l;d===(s.ownerDocument||X)&&p.push(d.defaultView||d.parentWindow||e)}for(h=0;(l=p[h++])&&!i.isPropagationStopped();)i.type=h>1?u:c.bindType||f,a=(ct._data(l,"events")||{})[i.type]&&ct._data(l,"handle"),a&&a.apply(l,n),a=r&&l[r],a&&ct.acceptData(l)&&a.apply&&a.apply(l,n)===!1&&i.preventDefault();if(i.type=f,!o&&!i.isDefaultPrevented()&&(!c._default||c._default.apply(p.pop(),n)===!1)&&ct.acceptData(s)&&r&&s[f]&&!ct.isWindow(s)){d=s[r],d&&(s[r]=null),ct.event.triggered=f;try{s[f]()}catch(g){}ct.event.triggered=t,d&&(s[r]=d)}return i.result}},dispatch:function(e){e=ct.event.fix(e);var i,n,s,o,a,r=[],l=ot.call(arguments),u=(ct._data(this,"events")||{})[e.type]||[],c=ct.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(r=ct.event.handlers.call(this,e,u),i=0;(o=r[i++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,a=0;(s=o.handlers[a++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(s.namespace))&&(e.handleObj=s,e.data=s.data,n=((ct.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,l),n!==t&&(e.result=n)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,i){var n,s,o,a,r=[],l=i.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)s=i[a],n=s.selector+" ",o[n]===t&&(o[n]=s.needsContext?ct(n,this).index(u)>=0:ct.find(n,this,null,[u]).length),o[n]&&o.push(s);o.length&&r.push({elem:u,handlers:o})}return l<i.length&&r.push({elem:this,handlers:i.slice(l)}),r},fix:function(e){if(e[ct.expando])return e;var t,i,n,s=e.type,o=e,a=this.fixHooks[s];for(a||(this.fixHooks[s]=a=Ut.test(s)?this.mouseHooks:Rt.test(s)?this.keyHooks:{}),n=a.props?this.props.concat(a.props):this.props,e=new ct.Event(o),t=n.length;t--;)i=n[t],e[i]=o[i];return e.target||(e.target=o.srcElement||X),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,a.filter?a.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,i){var n,s,o,a=i.button,r=i.fromElement;return null==e.pageX&&null!=i.clientX&&(s=e.target.ownerDocument||X,o=s.documentElement,n=s.body,e.pageX=i.clientX+(o&&o.scrollLeft||n&&n.scrollLeft||0)-(o&&o.clientLeft||n&&n.clientLeft||0),e.pageY=i.clientY+(o&&o.scrollTop||n&&n.scrollTop||0)-(o&&o.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&r&&(e.relatedTarget=r===e.target?i.toElement:r),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==c()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===c()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return ct.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(e){return ct.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,i,n){var s=ct.extend(new ct.Event,i,{type:e,isSimulated:!0,originalEvent:{}});n?ct.event.trigger(s,null,t):ct.event.dispatch.call(t,s),s.isDefaultPrevented()&&i.preventDefault()}},ct.removeEvent=X.removeEventListener?function(e,t,i){e.removeEventListener&&e.removeEventListener(t,i,!1)}:function(e,t,i){var n="on"+t;e.detachEvent&&(typeof e[n]===Y&&(e[n]=null),e.detachEvent(n,i))},ct.Event=function(e,t){return this instanceof ct.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?l:u):this.type=e,t&&ct.extend(this,t),this.timeStamp=e&&e.timeStamp||ct.now(),void(this[ct.expando]=!0)):new ct.Event(e,t)},ct.Event.prototype={isDefaultPrevented:u,isPropagationStopped:u,isImmediatePropagationStopped:u,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=l,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=l,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=l,this.stopPropagation()}},ct.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){ct.event.special[e]={delegateType:t,bindType:t,handle:function(e){var i,n=this,s=e.relatedTarget,o=e.handleObj;return(!s||s!==n&&!ct.contains(n,s))&&(e.type=o.origType,i=o.handler.apply(this,arguments),e.type=t),i}}}),ct.support.submitBubbles||(ct.event.special.submit={setup:function(){return ct.nodeName(this,"form")?!1:void ct.event.add(this,"click._submit keypress._submit",function(e){var i=e.target,n=ct.nodeName(i,"input")||ct.nodeName(i,"button")?i.form:t;n&&!ct._data(n,"submitBubbles")&&(ct.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),ct._data(n,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&ct.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return ct.nodeName(this,"form")?!1:void ct.event.remove(this,"._submit")}}),ct.support.changeBubbles||(ct.event.special.change={setup:function(){return $t.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(ct.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)
}),ct.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),ct.event.simulate("change",this,e,!0)})),!1):void ct.event.add(this,"beforeactivate._change",function(e){var t=e.target;$t.test(t.nodeName)&&!ct._data(t,"changeBubbles")&&(ct.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||ct.event.simulate("change",this.parentNode,e,!0)}),ct._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;return this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type?e.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return ct.event.remove(this,"._change"),!$t.test(this.nodeName)}}),ct.support.focusinBubbles||ct.each({focus:"focusin",blur:"focusout"},function(e,t){var i=0,n=function(e){ct.event.simulate(t,e.target,ct.event.fix(e),!0)};ct.event.special[t]={setup:function(){0===i++&&X.addEventListener(e,n,!0)},teardown:function(){0===--i&&X.removeEventListener(e,n,!0)}}}),ct.fn.extend({on:function(e,i,n,s,o){var a,r;if("object"==typeof e){"string"!=typeof i&&(n=n||i,i=t);for(a in e)this.on(a,i,n,e[a],o);return this}if(null==n&&null==s?(s=i,n=i=t):null==s&&("string"==typeof i?(s=n,n=t):(s=n,n=i,i=t)),s===!1)s=u;else if(!s)return this;return 1===o&&(r=s,s=function(e){return ct().off(e),r.apply(this,arguments)},s.guid=r.guid||(r.guid=ct.guid++)),this.each(function(){ct.event.add(this,e,s,n,i)})},one:function(e,t,i,n){return this.on(e,t,i,n,1)},off:function(e,i,n){var s,o;if(e&&e.preventDefault&&e.handleObj)return s=e.handleObj,ct(e.delegateTarget).off(s.namespace?s.origType+"."+s.namespace:s.origType,s.selector,s.handler),this;if("object"==typeof e){for(o in e)this.off(o,i,e[o]);return this}return(i===!1||"function"==typeof i)&&(n=i,i=t),n===!1&&(n=u),this.each(function(){ct.event.remove(this,e,n,i)})},trigger:function(e,t){return this.each(function(){ct.event.trigger(e,t,this)})},triggerHandler:function(e,t){var i=this[0];return i?ct.event.trigger(e,t,i,!0):void 0}});var Ht=/^.[^:#\[\.,]*$/,zt=/^(?:parents|prev(?:Until|All))/,Wt=ct.expr.match.needsContext,jt={children:!0,contents:!0,next:!0,prev:!0};ct.fn.extend({find:function(e){var t,i=[],n=this,s=n.length;if("string"!=typeof e)return this.pushStack(ct(e).filter(function(){for(t=0;s>t;t++)if(ct.contains(n[t],this))return!0}));for(t=0;s>t;t++)ct.find(e,n[t],i);return i=this.pushStack(s>1?ct.unique(i):i),i.selector=this.selector?this.selector+" "+e:e,i},has:function(e){var t,i=ct(e,this),n=i.length;return this.filter(function(){for(t=0;n>t;t++)if(ct.contains(this,i[t]))return!0})},not:function(e){return this.pushStack(h(this,e||[],!0))},filter:function(e){return this.pushStack(h(this,e||[],!1))},is:function(e){return!!h(this,"string"==typeof e&&Wt.test(e)?ct(e):e||[],!1).length},closest:function(e,t){for(var i,n=0,s=this.length,o=[],a=Wt.test(e)||"string"!=typeof e?ct(e,t||this.context):0;s>n;n++)for(i=this[n];i&&i!==t;i=i.parentNode)if(i.nodeType<11&&(a?a.index(i)>-1:1===i.nodeType&&ct.find.matchesSelector(i,e))){i=o.push(i);break}return this.pushStack(o.length>1?ct.unique(o):o)},index:function(e){return e?"string"==typeof e?ct.inArray(this[0],ct(e)):ct.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var i="string"==typeof e?ct(e,t):ct.makeArray(e&&e.nodeType?[e]:e),n=ct.merge(this.get(),i);return this.pushStack(ct.unique(n))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ct.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ct.dir(e,"parentNode")},parentsUntil:function(e,t,i){return ct.dir(e,"parentNode",i)},next:function(e){return d(e,"nextSibling")},prev:function(e){return d(e,"previousSibling")},nextAll:function(e){return ct.dir(e,"nextSibling")},prevAll:function(e){return ct.dir(e,"previousSibling")},nextUntil:function(e,t,i){return ct.dir(e,"nextSibling",i)},prevUntil:function(e,t,i){return ct.dir(e,"previousSibling",i)},siblings:function(e){return ct.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return ct.sibling(e.firstChild)},contents:function(e){return ct.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:ct.merge([],e.childNodes)}},function(e,t){ct.fn[e]=function(i,n){var s=ct.map(this,t,i);return"Until"!==e.slice(-5)&&(n=i),n&&"string"==typeof n&&(s=ct.filter(n,s)),this.length>1&&(jt[e]||(s=ct.unique(s)),zt.test(e)&&(s=s.reverse())),this.pushStack(s)}}),ct.extend({filter:function(e,t,i){var n=t[0];return i&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?ct.find.matchesSelector(n,e)?[n]:[]:ct.find.matches(e,ct.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,i,n){for(var s=[],o=e[i];o&&9!==o.nodeType&&(n===t||1!==o.nodeType||!ct(o).is(n));)1===o.nodeType&&s.push(o),o=o[i];return s},sibling:function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i}});var Vt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",qt=/ jQuery\d+="(?:null|\d+)"/g,Yt=new RegExp("<(?:"+Vt+")[\\s/>]","i"),Kt=/^\s+/,Xt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Jt=/<([\w:]+)/,Qt=/<tbody/i,Zt=/<|&#?\w+;/,ei=/<(?:script|style|link)/i,ti=/^(?:checkbox|radio)$/i,ii=/checked\s*(?:[^=]|=\s*.checked.)/i,ni=/^$|\/(?:java|ecma)script/i,si=/^true\/(.*)/,oi=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ai={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:ct.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},ri=p(X),li=ri.appendChild(X.createElement("div"));ai.optgroup=ai.option,ai.tbody=ai.tfoot=ai.colgroup=ai.caption=ai.thead,ai.th=ai.td,ct.fn.extend({text:function(e){return ct.access(this,function(e){return e===t?ct.text(this):this.empty().append((this[0]&&this[0].ownerDocument||X).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=f(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=f(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var i,n=e?ct.filter(e,this):this,s=0;null!=(i=n[s]);s++)t||1!==i.nodeType||ct.cleanData(A(i)),i.parentNode&&(t&&ct.contains(i.ownerDocument,i)&&_(A(i,"script")),i.parentNode.removeChild(i));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&ct.cleanData(A(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&ct.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return ct.clone(this,e,t)})},html:function(e){return ct.access(this,function(e){var i=this[0]||{},n=0,s=this.length;if(e===t)return 1===i.nodeType?i.innerHTML.replace(qt,""):t;if(!("string"!=typeof e||ei.test(e)||!ct.support.htmlSerialize&&Yt.test(e)||!ct.support.leadingWhitespace&&Kt.test(e)||ai[(Jt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Xt,"<$1></$2>");try{for(;s>n;n++)i=this[n]||{},1===i.nodeType&&(ct.cleanData(A(i,!1)),i.innerHTML=e);i=0}catch(o){}}i&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=ct.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(i){var n=e[t++],s=e[t++];s&&(n&&n.parentNode!==s&&(n=this.nextSibling),ct(this).remove(),s.insertBefore(i,n))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,i){e=nt.apply([],e);var n,s,o,a,r,l,u=0,c=this.length,d=this,h=c-1,p=e[0],f=ct.isFunction(p);if(f||!(1>=c||"string"!=typeof p||ct.support.checkClone)&&ii.test(p))return this.each(function(n){var s=d.eq(n);f&&(e[0]=p.call(this,n,s.html())),s.domManip(e,t,i)});if(c&&(l=ct.buildFragment(e,this[0].ownerDocument,!1,!i&&this),n=l.firstChild,1===l.childNodes.length&&(l=n),n)){for(a=ct.map(A(l,"script"),m),o=a.length;c>u;u++)s=l,u!==h&&(s=ct.clone(s,!0,!0),o&&ct.merge(a,A(s,"script"))),t.call(this[u],s,u);if(o)for(r=a[a.length-1].ownerDocument,ct.map(a,g),u=0;o>u;u++)s=a[u],ni.test(s.type||"")&&!ct._data(s,"globalEval")&&ct.contains(r,s)&&(s.src?ct._evalUrl(s.src):ct.globalEval((s.text||s.textContent||s.innerHTML||"").replace(oi,"")));l=n=null}return this}}),ct.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){ct.fn[e]=function(e){for(var i,n=0,s=[],o=ct(e),a=o.length-1;a>=n;n++)i=n===a?this:this.clone(!0),ct(o[n])[t](i),st.apply(s,i.get());return this.pushStack(s)}}),ct.extend({clone:function(e,t,i){var n,s,o,a,r,l=ct.contains(e.ownerDocument,e);if(ct.support.html5Clone||ct.isXMLDoc(e)||!Yt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(li.innerHTML=e.outerHTML,li.removeChild(o=li.firstChild)),!(ct.support.noCloneEvent&&ct.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ct.isXMLDoc(e)))for(n=A(o),r=A(e),a=0;null!=(s=r[a]);++a)n[a]&&b(s,n[a]);if(t)if(i)for(r=r||A(e),n=n||A(o),a=0;null!=(s=r[a]);a++)v(s,n[a]);else v(e,o);return n=A(o,"script"),n.length>0&&_(n,!l&&A(e,"script")),n=r=s=null,o},buildFragment:function(e,t,i,n){for(var s,o,a,r,l,u,c,d=e.length,h=p(t),f=[],m=0;d>m;m++)if(o=e[m],o||0===o)if("object"===ct.type(o))ct.merge(f,o.nodeType?[o]:o);else if(Zt.test(o)){for(r=r||h.appendChild(t.createElement("div")),l=(Jt.exec(o)||["",""])[1].toLowerCase(),c=ai[l]||ai._default,r.innerHTML=c[1]+o.replace(Xt,"<$1></$2>")+c[2],s=c[0];s--;)r=r.lastChild;if(!ct.support.leadingWhitespace&&Kt.test(o)&&f.push(t.createTextNode(Kt.exec(o)[0])),!ct.support.tbody)for(o="table"!==l||Qt.test(o)?"<table>"!==c[1]||Qt.test(o)?0:r:r.firstChild,s=o&&o.childNodes.length;s--;)ct.nodeName(u=o.childNodes[s],"tbody")&&!u.childNodes.length&&o.removeChild(u);for(ct.merge(f,r.childNodes),r.textContent="";r.firstChild;)r.removeChild(r.firstChild);r=h.lastChild}else f.push(t.createTextNode(o));for(r&&h.removeChild(r),ct.support.appendChecked||ct.grep(A(f,"input"),y),m=0;o=f[m++];)if((!n||-1===ct.inArray(o,n))&&(a=ct.contains(o.ownerDocument,o),r=A(h.appendChild(o),"script"),a&&_(r),i))for(s=0;o=r[s++];)ni.test(o.type||"")&&i.push(o);return r=null,h},cleanData:function(e,t){for(var i,n,s,o,a=0,r=ct.expando,l=ct.cache,u=ct.support.deleteExpando,c=ct.event.special;null!=(i=e[a]);a++)if((t||ct.acceptData(i))&&(s=i[r],o=s&&l[s])){if(o.events)for(n in o.events)c[n]?ct.event.remove(i,n):ct.removeEvent(i,n,o.handle);l[s]&&(delete l[s],u?delete i[r]:typeof i.removeAttribute!==Y?i.removeAttribute(r):i[r]=null,tt.push(s))}},_evalUrl:function(e){return ct.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),ct.fn.extend({wrapAll:function(e){if(ct.isFunction(e))return this.each(function(t){ct(this).wrapAll(e.call(this,t))});if(this[0]){var t=ct(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return this.each(ct.isFunction(e)?function(t){ct(this).wrapInner(e.call(this,t))}:function(){var t=ct(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)})},wrap:function(e){var t=ct.isFunction(e);return this.each(function(i){ct(this).wrapAll(t?e.call(this,i):e)})},unwrap:function(){return this.parent().each(function(){ct.nodeName(this,"body")||ct(this).replaceWith(this.childNodes)}).end()}});var ui,ci,di,hi=/alpha\([^)]*\)/i,pi=/opacity\s*=\s*([^)]*)/,fi=/^(top|right|bottom|left)$/,mi=/^(none|table(?!-c[ea]).+)/,gi=/^margin/,_i=new RegExp("^("+dt+")(.*)$","i"),vi=new RegExp("^("+dt+")(?!px)[a-z%]+$","i"),bi=new RegExp("^([+-])=("+dt+")","i"),Ai={BODY:"block"},yi={position:"absolute",visibility:"hidden",display:"block"},Ci={letterSpacing:0,fontWeight:400},Fi=["Top","Right","Bottom","Left"],wi=["Webkit","O","Moz","ms"];ct.fn.extend({css:function(e,i){return ct.access(this,function(e,i,n){var s,o,a={},r=0;if(ct.isArray(i)){for(o=ci(e),s=i.length;s>r;r++)a[i[r]]=ct.css(e,i[r],!1,o);return a}return n!==t?ct.style(e,i,n):ct.css(e,i)},e,i,arguments.length>1)},show:function(){return w(this,!0)},hide:function(){return w(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){F(this)?ct(this).show():ct(this).hide()})}}),ct.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=di(e,"opacity");return""===i?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":ct.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,i,n,s){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,r,l=ct.camelCase(i),u=e.style;if(i=ct.cssProps[l]||(ct.cssProps[l]=C(u,l)),r=ct.cssHooks[i]||ct.cssHooks[l],n===t)return r&&"get"in r&&(o=r.get(e,!1,s))!==t?o:u[i];if(a=typeof n,"string"===a&&(o=bi.exec(n))&&(n=(o[1]+1)*o[2]+parseFloat(ct.css(e,i)),a="number"),!(null==n||"number"===a&&isNaN(n)||("number"!==a||ct.cssNumber[l]||(n+="px"),ct.support.clearCloneStyle||""!==n||0!==i.indexOf("background")||(u[i]="inherit"),r&&"set"in r&&(n=r.set(e,n,s))===t)))try{u[i]=n}catch(c){}}},css:function(e,i,n,s){var o,a,r,l=ct.camelCase(i);return i=ct.cssProps[l]||(ct.cssProps[l]=C(e.style,l)),r=ct.cssHooks[i]||ct.cssHooks[l],r&&"get"in r&&(a=r.get(e,!0,n)),a===t&&(a=di(e,i,s)),"normal"===a&&i in Ci&&(a=Ci[i]),""===n||n?(o=parseFloat(a),n===!0||ct.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(ci=function(t){return e.getComputedStyle(t,null)},di=function(e,i,n){var s,o,a,r=n||ci(e),l=r?r.getPropertyValue(i)||r[i]:t,u=e.style;return r&&(""!==l||ct.contains(e.ownerDocument,e)||(l=ct.style(e,i)),vi.test(l)&&gi.test(i)&&(s=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=r.width,u.width=s,u.minWidth=o,u.maxWidth=a)),l}):X.documentElement.currentStyle&&(ci=function(e){return e.currentStyle},di=function(e,i,n){var s,o,a,r=n||ci(e),l=r?r[i]:t,u=e.style;return null==l&&u&&u[i]&&(l=u[i]),vi.test(l)&&!fi.test(i)&&(s=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===i?"1em":l,l=u.pixelLeft+"px",u.left=s,a&&(o.left=a)),""===l?"auto":l}),ct.each(["height","width"],function(e,t){ct.cssHooks[t]={get:function(e,i,n){return i?0===e.offsetWidth&&mi.test(ct.css(e,"display"))?ct.swap(e,yi,function(){return S(e,t,n)}):S(e,t,n):void 0},set:function(e,i,n){var s=n&&ci(e);return E(e,i,n?D(e,t,n,ct.support.boxSizing&&"border-box"===ct.css(e,"boxSizing",!1,s),s):0)}}}),ct.support.opacity||(ct.cssHooks.opacity={get:function(e,t){return pi.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var i=e.style,n=e.currentStyle,s=ct.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=n&&n.filter||i.filter||"";i.zoom=1,(t>=1||""===t)&&""===ct.trim(o.replace(hi,""))&&i.removeAttribute&&(i.removeAttribute("filter"),""===t||n&&!n.filter)||(i.filter=hi.test(o)?o.replace(hi,s):o+" "+s)}}),ct(function(){ct.support.reliableMarginRight||(ct.cssHooks.marginRight={get:function(e,t){return t?ct.swap(e,{display:"inline-block"},di,[e,"marginRight"]):void 0}}),!ct.support.pixelPosition&&ct.fn.position&&ct.each(["top","left"],function(e,t){ct.cssHooks[t]={get:function(e,i){return i?(i=di(e,t),vi.test(i)?ct(e).position()[t]+"px":i):void 0}}})}),ct.expr&&ct.expr.filters&&(ct.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!ct.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||ct.css(e,"display"))},ct.expr.filters.visible=function(e){return!ct.expr.filters.hidden(e)}),ct.each({margin:"",padding:"",border:"Width"},function(e,t){ct.cssHooks[e+t]={expand:function(i){for(var n=0,s={},o="string"==typeof i?i.split(" "):[i];4>n;n++)s[e+Fi[n]+t]=o[n]||o[n-2]||o[0];return s}},gi.test(e)||(ct.cssHooks[e+t].set=E)});var Ei=/%20/g,Di=/\[\]$/,Si=/\r?\n/g,xi=/^(?:submit|button|image|reset|file)$/i,Gi=/^(?:input|select|textarea|keygen)/i;ct.fn.extend({serialize:function(){return ct.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ct.prop(this,"elements");return e?ct.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ct(this).is(":disabled")&&Gi.test(this.nodeName)&&!xi.test(e)&&(this.checked||!ti.test(e))}).map(function(e,t){var i=ct(this).val();return null==i?null:ct.isArray(i)?ct.map(i,function(e){return{name:t.name,value:e.replace(Si,"\r\n")}}):{name:t.name,value:i.replace(Si,"\r\n")}}).get()}}),ct.param=function(e,i){var n,s=[],o=function(e,t){t=ct.isFunction(t)?t():null==t?"":t,s[s.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(i===t&&(i=ct.ajaxSettings&&ct.ajaxSettings.traditional),ct.isArray(e)||e.jquery&&!ct.isPlainObject(e))ct.each(e,function(){o(this.name,this.value)});else for(n in e)k(n,e[n],i,o);return s.join("&").replace(Ei,"+")},ct.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){ct.fn[t]=function(e,i){return arguments.length>0?this.on(t,null,e,i):this.trigger(t)}}),ct.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,i){return this.on(e,null,t,i)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,i,n){return this.on(t,e,i,n)},undelegate:function(e,t,i){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",i)}});var ki,Bi,Pi=ct.now(),Ti=/\?/,Ii=/#.*$/,Ni=/([?&])_=[^&]*/,Mi=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,$i=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ri=/^(?:GET|HEAD)$/,Ui=/^\/\//,Li=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Oi=ct.fn.load,Hi={},zi={},Wi="*/".concat("*");try{Bi=K.href}catch(ji){Bi=X.createElement("a"),Bi.href="",Bi=Bi.href}ki=Li.exec(Bi.toLowerCase())||[],ct.fn.load=function(e,i,n){if("string"!=typeof e&&Oi)return Oi.apply(this,arguments);var s,o,a,r=this,l=e.indexOf(" ");return l>=0&&(s=e.slice(l,e.length),e=e.slice(0,l)),ct.isFunction(i)?(n=i,i=t):i&&"object"==typeof i&&(a="POST"),r.length>0&&ct.ajax({url:e,type:a,dataType:"html",data:i}).done(function(e){o=arguments,r.html(s?ct("<div>").append(ct.parseHTML(e)).find(s):e)}).complete(n&&function(e,t){r.each(n,o||[e.responseText,t,e])}),this},ct.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ct.fn[t]=function(e){return this.on(t,e)}}),ct.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Bi,type:"GET",isLocal:$i.test(ki[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Wi,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ct.parseJSON,"text xml":ct.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?T(T(e,ct.ajaxSettings),t):T(ct.ajaxSettings,e)},ajaxPrefilter:B(Hi),ajaxTransport:B(zi),ajax:function(e,i){function n(e,i,n,s){var o,d,v,b,y,F=i;2!==A&&(A=2,l&&clearTimeout(l),c=t,r=s||"",C.readyState=e>0?4:0,o=e>=200&&300>e||304===e,n&&(b=I(h,C,n)),b=N(h,b,C,o),o?(h.ifModified&&(y=C.getResponseHeader("Last-Modified"),y&&(ct.lastModified[a]=y),y=C.getResponseHeader("etag"),y&&(ct.etag[a]=y)),204===e||"HEAD"===h.type?F="nocontent":304===e?F="notmodified":(F=b.state,d=b.data,v=b.error,o=!v)):(v=F,(e||!F)&&(F="error",0>e&&(e=0))),C.status=e,C.statusText=(i||F)+"",o?m.resolveWith(p,[d,F,C]):m.rejectWith(p,[C,F,v]),C.statusCode(_),_=t,u&&f.trigger(o?"ajaxSuccess":"ajaxError",[C,h,o?d:v]),g.fireWith(p,[C,F]),u&&(f.trigger("ajaxComplete",[C,h]),--ct.active||ct.event.trigger("ajaxStop")))}"object"==typeof e&&(i=e,e=t),i=i||{};var s,o,a,r,l,u,c,d,h=ct.ajaxSetup({},i),p=h.context||h,f=h.context&&(p.nodeType||p.jquery)?ct(p):ct.event,m=ct.Deferred(),g=ct.Callbacks("once memory"),_=h.statusCode||{},v={},b={},A=0,y="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===A){if(!d)for(d={};t=Mi.exec(r);)d[t[1].toLowerCase()]=t[2];t=d[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===A?r:null},setRequestHeader:function(e,t){var i=e.toLowerCase();return A||(e=b[i]=b[i]||e,v[e]=t),this},overrideMimeType:function(e){return A||(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>A)for(t in e)_[t]=[_[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||y;return c&&c.abort(t),n(0,t),this}};if(m.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,h.url=((e||h.url||Bi)+"").replace(Ii,"").replace(Ui,ki[1]+"//"),h.type=i.method||i.type||h.method||h.type,h.dataTypes=ct.trim(h.dataType||"*").toLowerCase().match(ht)||[""],null==h.crossDomain&&(s=Li.exec(h.url.toLowerCase()),h.crossDomain=!(!s||s[1]===ki[1]&&s[2]===ki[2]&&(s[3]||("http:"===s[1]?"80":"443"))===(ki[3]||("http:"===ki[1]?"80":"443")))),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=ct.param(h.data,h.traditional)),P(Hi,h,i,C),2===A)return C;u=h.global,u&&0===ct.active++&&ct.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Ri.test(h.type),a=h.url,h.hasContent||(h.data&&(a=h.url+=(Ti.test(a)?"&":"?")+h.data,delete h.data),h.cache===!1&&(h.url=Ni.test(a)?a.replace(Ni,"$1_="+Pi++):a+(Ti.test(a)?"&":"?")+"_="+Pi++)),h.ifModified&&(ct.lastModified[a]&&C.setRequestHeader("If-Modified-Since",ct.lastModified[a]),ct.etag[a]&&C.setRequestHeader("If-None-Match",ct.etag[a])),(h.data&&h.hasContent&&h.contentType!==!1||i.contentType)&&C.setRequestHeader("Content-Type",h.contentType),C.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Wi+"; q=0.01":""):h.accepts["*"]);for(o in h.headers)C.setRequestHeader(o,h.headers[o]);if(h.beforeSend&&(h.beforeSend.call(p,C,h)===!1||2===A))return C.abort();y="abort";for(o in{success:1,error:1,complete:1})C[o](h[o]);if(c=P(zi,h,i,C)){C.readyState=1,u&&f.trigger("ajaxSend",[C,h]),h.async&&h.timeout>0&&(l=setTimeout(function(){C.abort("timeout")},h.timeout));try{A=1,c.send(v,n)}catch(F){if(!(2>A))throw F;n(-1,F)}}else n(-1,"No Transport");return C},getJSON:function(e,t,i){return ct.get(e,t,i,"json")},getScript:function(e,i){return ct.get(e,t,i,"script")}}),ct.each(["get","post"],function(e,i){ct[i]=function(e,n,s,o){return ct.isFunction(n)&&(o=o||s,s=n,n=t),ct.ajax({url:e,type:i,dataType:o,data:n,success:s})}}),ct.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return ct.globalEval(e),e}}}),ct.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),ct.ajaxTransport("script",function(e){if(e.crossDomain){var i,n=X.head||ct("head")[0]||X.documentElement;return{send:function(t,s){i=X.createElement("script"),i.async=!0,e.scriptCharset&&(i.charset=e.scriptCharset),i.src=e.url,i.onload=i.onreadystatechange=function(e,t){(t||!i.readyState||/loaded|complete/.test(i.readyState))&&(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),i=null,t||s(200,"success"))},n.insertBefore(i,n.firstChild)},abort:function(){i&&i.onload(t,!0)}}}});var Vi=[],qi=/(=)\?(?=&|$)|\?\?/;ct.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Vi.pop()||ct.expando+"_"+Pi++;return this[e]=!0,e}}),ct.ajaxPrefilter("json jsonp",function(i,n,s){var o,a,r,l=i.jsonp!==!1&&(qi.test(i.url)?"url":"string"==typeof i.data&&!(i.contentType||"").indexOf("application/x-www-form-urlencoded")&&qi.test(i.data)&&"data");return l||"jsonp"===i.dataTypes[0]?(o=i.jsonpCallback=ct.isFunction(i.jsonpCallback)?i.jsonpCallback():i.jsonpCallback,l?i[l]=i[l].replace(qi,"$1"+o):i.jsonp!==!1&&(i.url+=(Ti.test(i.url)?"&":"?")+i.jsonp+"="+o),i.converters["script json"]=function(){return r||ct.error(o+" was not called"),r[0]},i.dataTypes[0]="json",a=e[o],e[o]=function(){r=arguments},s.always(function(){e[o]=a,i[o]&&(i.jsonpCallback=n.jsonpCallback,Vi.push(o)),r&&ct.isFunction(a)&&a(r[0]),r=a=t}),"script"):void 0});var Yi,Ki,Xi=0,Ji=e.ActiveXObject&&function(){var e;for(e in Yi)Yi[e](t,!0)};ct.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&M()||$()}:M,Ki=ct.ajaxSettings.xhr(),ct.support.cors=!!Ki&&"withCredentials"in Ki,Ki=ct.support.ajax=!!Ki,Ki&&ct.ajaxTransport(function(i){if(!i.crossDomain||ct.support.cors){var n;return{send:function(s,o){var a,r,l=i.xhr();if(i.username?l.open(i.type,i.url,i.async,i.username,i.password):l.open(i.type,i.url,i.async),i.xhrFields)for(r in i.xhrFields)l[r]=i.xhrFields[r];i.mimeType&&l.overrideMimeType&&l.overrideMimeType(i.mimeType),i.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest");try{for(r in s)l.setRequestHeader(r,s[r])}catch(u){}l.send(i.hasContent&&i.data||null),n=function(e,s){var r,u,c,d;try{if(n&&(s||4===l.readyState))if(n=t,a&&(l.onreadystatechange=ct.noop,Ji&&delete Yi[a]),s)4!==l.readyState&&l.abort();else{d={},r=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(d.text=l.responseText);try{c=l.statusText}catch(h){c=""}r||!i.isLocal||i.crossDomain?1223===r&&(r=204):r=d.text?200:404}}catch(p){s||o(-1,p)}d&&o(r,c,d,u)},i.async?4===l.readyState?setTimeout(n):(a=++Xi,Ji&&(Yi||(Yi={},ct(e).unload(Ji)),Yi[a]=n),l.onreadystatechange=n):n()},abort:function(){n&&n(t,!0)}}}});var Qi,Zi,en=/^(?:toggle|show|hide)$/,tn=new RegExp("^(?:([+-])=|)("+dt+")([a-z%]*)$","i"),nn=/queueHooks$/,sn=[H],on={"*":[function(e,t){var i=this.createTween(e,t),n=i.cur(),s=tn.exec(t),o=s&&s[3]||(ct.cssNumber[e]?"":"px"),a=(ct.cssNumber[e]||"px"!==o&&+n)&&tn.exec(ct.css(i.elem,e)),r=1,l=20;if(a&&a[3]!==o){o=o||a[3],s=s||[],a=+n||1;do r=r||".5",a/=r,ct.style(i.elem,e,a+o);while(r!==(r=i.cur()/n)&&1!==r&&--l)}return s&&(a=i.start=+a||+n||0,i.unit=o,i.end=s[1]?a+(s[1]+1)*s[2]:+s[2]),i}]};ct.Animation=ct.extend(L,{tweener:function(e,t){ct.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var i,n=0,s=e.length;s>n;n++)i=e[n],on[i]=on[i]||[],on[i].unshift(t)},prefilter:function(e,t){t?sn.unshift(e):sn.push(e)}}),ct.Tween=z,z.prototype={constructor:z,init:function(e,t,i,n,s,o){this.elem=e,this.prop=i,this.easing=s||"swing",this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=o||(ct.cssNumber[i]?"":"px")},cur:function(){var e=z.propHooks[this.prop];return e&&e.get?e.get(this):z.propHooks._default.get(this)},run:function(e){var t,i=z.propHooks[this.prop];return this.pos=t=this.options.duration?ct.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):z.propHooks._default.set(this),this}},z.prototype.init.prototype=z.prototype,z.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=ct.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){ct.fx.step[e.prop]?ct.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[ct.cssProps[e.prop]]||ct.cssHooks[e.prop])?ct.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},z.propHooks.scrollTop=z.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ct.each(["toggle","show","hide"],function(e,t){var i=ct.fn[t];ct.fn[t]=function(e,n,s){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(W(t,!0),e,n,s)}}),ct.fn.extend({fadeTo:function(e,t,i,n){return this.filter(F).css("opacity",0).show().end().animate({opacity:t},e,i,n)},animate:function(e,t,i,n){var s=ct.isEmptyObject(e),o=ct.speed(t,i,n),a=function(){var t=L(this,ct.extend({},e),o);(s||ct._data(this,"finish"))&&t.stop(!0)};return a.finish=a,s||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,i,n){var s=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=i,i=e,e=t),i&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=ct.timers,a=ct._data(this);if(i)a[i]&&a[i].stop&&s(a[i]);else for(i in a)a[i]&&a[i].stop&&nn.test(i)&&s(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&ct.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,i=ct._data(this),n=i[e+"queue"],s=i[e+"queueHooks"],o=ct.timers,a=n?n.length:0;for(i.finish=!0,ct.queue(this,e,[]),s&&s.stop&&s.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete i.finish})}}),ct.each({slideDown:W("show"),slideUp:W("hide"),slideToggle:W("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){ct.fn[e]=function(e,i,n){return this.animate(t,e,i,n)}}),ct.speed=function(e,t,i){var n=e&&"object"==typeof e?ct.extend({},e):{complete:i||!i&&t||ct.isFunction(e)&&e,duration:e,easing:i&&t||t&&!ct.isFunction(t)&&t};return n.duration=ct.fx.off?0:"number"==typeof n.duration?n.duration:n.duration in ct.fx.speeds?ct.fx.speeds[n.duration]:ct.fx.speeds._default,(null==n.queue||n.queue===!0)&&(n.queue="fx"),n.old=n.complete,n.complete=function(){ct.isFunction(n.old)&&n.old.call(this),n.queue&&ct.dequeue(this,n.queue)},n},ct.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},ct.timers=[],ct.fx=z.prototype.init,ct.fx.tick=function(){var e,i=ct.timers,n=0;for(Qi=ct.now();n<i.length;n++)e=i[n],e()||i[n]!==e||i.splice(n--,1);i.length||ct.fx.stop(),Qi=t},ct.fx.timer=function(e){e()&&ct.timers.push(e)&&ct.fx.start()},ct.fx.interval=13,ct.fx.start=function(){Zi||(Zi=setInterval(ct.fx.tick,ct.fx.interval))},ct.fx.stop=function(){clearInterval(Zi),Zi=null},ct.fx.speeds={slow:600,fast:200,_default:400},ct.fx.step={},ct.expr&&ct.expr.filters&&(ct.expr.filters.animated=function(e){return ct.grep(ct.timers,function(t){return e===t.elem}).length}),ct.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){ct.offset.setOffset(this,e,t)});var i,n,s={top:0,left:0},o=this[0],a=o&&o.ownerDocument;if(a)return i=a.documentElement,ct.contains(i,o)?(typeof o.getBoundingClientRect!==Y&&(s=o.getBoundingClientRect()),n=j(a),{top:s.top+(n.pageYOffset||i.scrollTop)-(i.clientTop||0),left:s.left+(n.pageXOffset||i.scrollLeft)-(i.clientLeft||0)}):s},ct.offset={setOffset:function(e,t,i){var n=ct.css(e,"position");"static"===n&&(e.style.position="relative");var s,o,a=ct(e),r=a.offset(),l=ct.css(e,"top"),u=ct.css(e,"left"),c=("absolute"===n||"fixed"===n)&&ct.inArray("auto",[l,u])>-1,d={},h={};c?(h=a.position(),s=h.top,o=h.left):(s=parseFloat(l)||0,o=parseFloat(u)||0),ct.isFunction(t)&&(t=t.call(e,i,r)),null!=t.top&&(d.top=t.top-r.top+s),null!=t.left&&(d.left=t.left-r.left+o),"using"in t?t.using.call(e,d):a.css(d)}},ct.fn.extend({position:function(){if(this[0]){var e,t,i={top:0,left:0},n=this[0];return"fixed"===ct.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),ct.nodeName(e[0],"html")||(i=e.offset()),i.top+=ct.css(e[0],"borderTopWidth",!0),i.left+=ct.css(e[0],"borderLeftWidth",!0)),{top:t.top-i.top-ct.css(n,"marginTop",!0),left:t.left-i.left-ct.css(n,"marginLeft",!0)}
}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||J;e&&!ct.nodeName(e,"html")&&"static"===ct.css(e,"position");)e=e.offsetParent;return e||J})}}),ct.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,i){var n=/Y/.test(i);ct.fn[e]=function(s){return ct.access(this,function(e,s,o){var a=j(e);return o===t?a?i in a?a[i]:a.document.documentElement[s]:e[s]:void(a?a.scrollTo(n?ct(a).scrollLeft():o,n?o:ct(a).scrollTop()):e[s]=o)},e,s,arguments.length,null)}}),ct.each({Height:"height",Width:"width"},function(e,i){ct.each({padding:"inner"+e,content:i,"":"outer"+e},function(n,s){ct.fn[s]=function(s,o){var a=arguments.length&&(n||"boolean"!=typeof s),r=n||(s===!0||o===!0?"margin":"border");return ct.access(this,function(i,n,s){var o;return ct.isWindow(i)?i.document.documentElement["client"+e]:9===i.nodeType?(o=i.documentElement,Math.max(i.body["scroll"+e],o["scroll"+e],i.body["offset"+e],o["offset"+e],o["client"+e])):s===t?ct.css(i,n,r):ct.style(i,n,s,r)},i,a?s:t,a,null)}})}),ct.fn.size=function(){return this.length},ct.fn.andSelf=ct.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=ct:(e.jQuery=e.$=ct,"function"==typeof define&&define.amd&&define("jquery",[],function(){return ct}))}(window),function(){var e=this,t=e._,i={},n=Array.prototype,s=Object.prototype,o=Function.prototype,a=n.push,r=n.slice,l=n.concat,u=s.toString,c=s.hasOwnProperty,d=n.forEach,h=n.map,p=n.reduce,f=n.reduceRight,m=n.filter,g=n.every,_=n.some,v=n.indexOf,b=n.lastIndexOf,A=Array.isArray,y=Object.keys,C=o.bind,F=function(e){return e instanceof F?e:this instanceof F?void(this._wrapped=e):new F(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=F),exports._=F):e._=F,F.VERSION="1.5.2";var w=F.each=F.forEach=function(e,t,n){if(null!=e)if(d&&e.forEach===d)e.forEach(t,n);else if(e.length===+e.length){for(var s=0,o=e.length;o>s;s++)if(t.call(n,e[s],s,e)===i)return}else for(var a=F.keys(e),s=0,o=a.length;o>s;s++)if(t.call(n,e[a[s]],a[s],e)===i)return};F.map=F.collect=function(e,t,i){var n=[];return null==e?n:h&&e.map===h?e.map(t,i):(w(e,function(e,s,o){n.push(t.call(i,e,s,o))}),n)};var E="Reduce of empty array with no initial value";F.reduce=F.foldl=F.inject=function(e,t,i,n){var s=arguments.length>2;if(null==e&&(e=[]),p&&e.reduce===p)return n&&(t=F.bind(t,n)),s?e.reduce(t,i):e.reduce(t);if(w(e,function(e,o,a){s?i=t.call(n,i,e,o,a):(i=e,s=!0)}),!s)throw new TypeError(E);return i},F.reduceRight=F.foldr=function(e,t,i,n){var s=arguments.length>2;if(null==e&&(e=[]),f&&e.reduceRight===f)return n&&(t=F.bind(t,n)),s?e.reduceRight(t,i):e.reduceRight(t);var o=e.length;if(o!==+o){var a=F.keys(e);o=a.length}if(w(e,function(r,l,u){l=a?a[--o]:--o,s?i=t.call(n,i,e[l],l,u):(i=e[l],s=!0)}),!s)throw new TypeError(E);return i},F.find=F.detect=function(e,t,i){var n;return D(e,function(e,s,o){return t.call(i,e,s,o)?(n=e,!0):void 0}),n},F.filter=F.select=function(e,t,i){var n=[];return null==e?n:m&&e.filter===m?e.filter(t,i):(w(e,function(e,s,o){t.call(i,e,s,o)&&n.push(e)}),n)},F.reject=function(e,t,i){return F.filter(e,function(e,n,s){return!t.call(i,e,n,s)},i)},F.every=F.all=function(e,t,n){t||(t=F.identity);var s=!0;return null==e?s:g&&e.every===g?e.every(t,n):(w(e,function(e,o,a){return(s=s&&t.call(n,e,o,a))?void 0:i}),!!s)};var D=F.some=F.any=function(e,t,n){t||(t=F.identity);var s=!1;return null==e?s:_&&e.some===_?e.some(t,n):(w(e,function(e,o,a){return s||(s=t.call(n,e,o,a))?i:void 0}),!!s)};F.contains=F.include=function(e,t){return null==e?!1:v&&e.indexOf===v?-1!=e.indexOf(t):D(e,function(e){return e===t})},F.invoke=function(e,t){var i=r.call(arguments,2),n=F.isFunction(t);return F.map(e,function(e){return(n?t:e[t]).apply(e,i)})},F.pluck=function(e,t){return F.map(e,function(e){return e[t]})},F.where=function(e,t,i){return F.isEmpty(t)?i?void 0:[]:F[i?"find":"filter"](e,function(e){for(var i in t)if(t[i]!==e[i])return!1;return!0})},F.findWhere=function(e,t){return F.where(e,t,!0)},F.max=function(e,t,i){if(!t&&F.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&F.isEmpty(e))return-1/0;var n={computed:-1/0,value:-1/0};return w(e,function(e,s,o){var a=t?t.call(i,e,s,o):e;a>n.computed&&(n={value:e,computed:a})}),n.value},F.min=function(e,t,i){if(!t&&F.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&F.isEmpty(e))return 1/0;var n={computed:1/0,value:1/0};return w(e,function(e,s,o){var a=t?t.call(i,e,s,o):e;a<n.computed&&(n={value:e,computed:a})}),n.value},F.shuffle=function(e){var t,i=0,n=[];return w(e,function(e){t=F.random(i++),n[i-1]=n[t],n[t]=e}),n},F.sample=function(e,t,i){return arguments.length<2||i?e[F.random(e.length-1)]:F.shuffle(e).slice(0,Math.max(0,t))};var S=function(e){return F.isFunction(e)?e:function(t){return t[e]}};F.sortBy=function(e,t,i){var n=S(t);return F.pluck(F.map(e,function(e,t,s){return{value:e,index:t,criteria:n.call(i,e,t,s)}}).sort(function(e,t){var i=e.criteria,n=t.criteria;if(i!==n){if(i>n||void 0===i)return 1;if(n>i||void 0===n)return-1}return e.index-t.index}),"value")};var x=function(e){return function(t,i,n){var s={},o=null==i?F.identity:S(i);return w(t,function(i,a){var r=o.call(n,i,a,t);e(s,r,i)}),s}};F.groupBy=x(function(e,t,i){(F.has(e,t)?e[t]:e[t]=[]).push(i)}),F.indexBy=x(function(e,t,i){e[t]=i}),F.countBy=x(function(e,t){F.has(e,t)?e[t]++:e[t]=1}),F.sortedIndex=function(e,t,i,n){i=null==i?F.identity:S(i);for(var s=i.call(n,t),o=0,a=e.length;a>o;){var r=o+a>>>1;i.call(n,e[r])<s?o=r+1:a=r}return o},F.toArray=function(e){return e?F.isArray(e)?r.call(e):e.length===+e.length?F.map(e,F.identity):F.values(e):[]},F.size=function(e){return null==e?0:e.length===+e.length?e.length:F.keys(e).length},F.first=F.head=F.take=function(e,t,i){return null==e?void 0:null==t||i?e[0]:r.call(e,0,t)},F.initial=function(e,t,i){return r.call(e,0,e.length-(null==t||i?1:t))},F.last=function(e,t,i){return null==e?void 0:null==t||i?e[e.length-1]:r.call(e,Math.max(e.length-t,0))},F.rest=F.tail=F.drop=function(e,t,i){return r.call(e,null==t||i?1:t)},F.compact=function(e){return F.filter(e,F.identity)};var G=function(e,t,i){return t&&F.every(e,F.isArray)?l.apply(i,e):(w(e,function(e){F.isArray(e)||F.isArguments(e)?t?a.apply(i,e):G(e,t,i):i.push(e)}),i)};F.flatten=function(e,t){return G(e,t,[])},F.without=function(e){return F.difference(e,r.call(arguments,1))},F.uniq=F.unique=function(e,t,i,n){F.isFunction(t)&&(n=i,i=t,t=!1);var s=i?F.map(e,i,n):e,o=[],a=[];return w(s,function(i,n){(t?n&&a[a.length-1]===i:F.contains(a,i))||(a.push(i),o.push(e[n]))}),o},F.union=function(){return F.uniq(F.flatten(arguments,!0))},F.intersection=function(e){var t=r.call(arguments,1);return F.filter(F.uniq(e),function(e){return F.every(t,function(t){return F.indexOf(t,e)>=0})})},F.difference=function(e){var t=l.apply(n,r.call(arguments,1));return F.filter(e,function(e){return!F.contains(t,e)})},F.zip=function(){for(var e=F.max(F.pluck(arguments,"length").concat(0)),t=new Array(e),i=0;e>i;i++)t[i]=F.pluck(arguments,""+i);return t},F.object=function(e,t){if(null==e)return{};for(var i={},n=0,s=e.length;s>n;n++)t?i[e[n]]=t[n]:i[e[n][0]]=e[n][1];return i},F.indexOf=function(e,t,i){if(null==e)return-1;var n=0,s=e.length;if(i){if("number"!=typeof i)return n=F.sortedIndex(e,t),e[n]===t?n:-1;n=0>i?Math.max(0,s+i):i}if(v&&e.indexOf===v)return e.indexOf(t,i);for(;s>n;n++)if(e[n]===t)return n;return-1},F.lastIndexOf=function(e,t,i){if(null==e)return-1;var n=null!=i;if(b&&e.lastIndexOf===b)return n?e.lastIndexOf(t,i):e.lastIndexOf(t);for(var s=n?i:e.length;s--;)if(e[s]===t)return s;return-1},F.range=function(e,t,i){arguments.length<=1&&(t=e||0,e=0),i=arguments[2]||1;for(var n=Math.max(Math.ceil((t-e)/i),0),s=0,o=new Array(n);n>s;)o[s++]=e,e+=i;return o};var k=function(){};F.bind=function(e,t){var i,n;if(C&&e.bind===C)return C.apply(e,r.call(arguments,1));if(!F.isFunction(e))throw new TypeError;return i=r.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,i.concat(r.call(arguments)));k.prototype=e.prototype;var s=new k;k.prototype=null;var o=e.apply(s,i.concat(r.call(arguments)));return Object(o)===o?o:s}},F.partial=function(e){var t=r.call(arguments,1);return function(){return e.apply(this,t.concat(r.call(arguments)))}},F.bindAll=function(e){var t=r.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return w(t,function(t){e[t]=F.bind(e[t],e)}),e},F.memoize=function(e,t){var i={};return t||(t=F.identity),function(){var n=t.apply(this,arguments);return F.has(i,n)?i[n]:i[n]=e.apply(this,arguments)}},F.delay=function(e,t){var i=r.call(arguments,2);return setTimeout(function(){return e.apply(null,i)},t)},F.defer=function(e){return F.delay.apply(F,[e,1].concat(r.call(arguments,1)))},F.throttle=function(e,t,i){var n,s,o,a=null,r=0;i||(i={});var l=function(){r=i.leading===!1?0:new Date,a=null,o=e.apply(n,s)};return function(){var u=new Date;r||i.leading!==!1||(r=u);var c=t-(u-r);return n=this,s=arguments,0>=c?(clearTimeout(a),a=null,r=u,o=e.apply(n,s)):a||i.trailing===!1||(a=setTimeout(l,c)),o}},F.debounce=function(e,t,i){var n,s,o,a,r;return function(){o=this,s=arguments,a=new Date;var l=function(){var u=new Date-a;t>u?n=setTimeout(l,t-u):(n=null,i||(r=e.apply(o,s)))},u=i&&!n;return n||(n=setTimeout(l,t)),u&&(r=e.apply(o,s)),r}},F.once=function(e){var t,i=!1;return function(){return i?t:(i=!0,t=e.apply(this,arguments),e=null,t)}},F.wrap=function(e,t){return function(){var i=[e];return a.apply(i,arguments),t.apply(this,i)}},F.compose=function(){var e=arguments;return function(){for(var t=arguments,i=e.length-1;i>=0;i--)t=[e[i].apply(this,t)];return t[0]}},F.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},F.keys=y||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var i in e)F.has(e,i)&&t.push(i);return t},F.values=function(e){for(var t=F.keys(e),i=t.length,n=new Array(i),s=0;i>s;s++)n[s]=e[t[s]];return n},F.pairs=function(e){for(var t=F.keys(e),i=t.length,n=new Array(i),s=0;i>s;s++)n[s]=[t[s],e[t[s]]];return n},F.invert=function(e){for(var t={},i=F.keys(e),n=0,s=i.length;s>n;n++)t[e[i[n]]]=i[n];return t},F.functions=F.methods=function(e){var t=[];for(var i in e)F.isFunction(e[i])&&t.push(i);return t.sort()},F.extend=function(e){return w(r.call(arguments,1),function(t){if(t)for(var i in t)e[i]=t[i]}),e},F.pick=function(e){var t={},i=l.apply(n,r.call(arguments,1));return w(i,function(i){i in e&&(t[i]=e[i])}),t},F.omit=function(e){var t={},i=l.apply(n,r.call(arguments,1));for(var s in e)F.contains(i,s)||(t[s]=e[s]);return t},F.defaults=function(e){return w(r.call(arguments,1),function(t){if(t)for(var i in t)void 0===e[i]&&(e[i]=t[i])}),e},F.clone=function(e){return F.isObject(e)?F.isArray(e)?e.slice():F.extend({},e):e},F.tap=function(e,t){return t(e),e};var B=function(e,t,i,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof F&&(e=e._wrapped),t instanceof F&&(t=t._wrapped);var s=u.call(e);if(s!=u.call(t))return!1;switch(s){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return!1;for(var o=i.length;o--;)if(i[o]==e)return n[o]==t;var a=e.constructor,r=t.constructor;if(a!==r&&!(F.isFunction(a)&&a instanceof a&&F.isFunction(r)&&r instanceof r))return!1;i.push(e),n.push(t);var l=0,c=!0;if("[object Array]"==s){if(l=e.length,c=l==t.length)for(;l--&&(c=B(e[l],t[l],i,n)););}else{for(var d in e)if(F.has(e,d)&&(l++,!(c=F.has(t,d)&&B(e[d],t[d],i,n))))break;if(c){for(d in t)if(F.has(t,d)&&!l--)break;c=!l}}return i.pop(),n.pop(),c};F.isEqual=function(e,t){return B(e,t,[],[])},F.isEmpty=function(e){if(null==e)return!0;if(F.isArray(e)||F.isString(e))return 0===e.length;for(var t in e)if(F.has(e,t))return!1;return!0},F.isElement=function(e){return!(!e||1!==e.nodeType)},F.isArray=A||function(e){return"[object Array]"==u.call(e)},F.isObject=function(e){return e===Object(e)},w(["Arguments","Function","String","Number","Date","RegExp"],function(e){F["is"+e]=function(t){return u.call(t)=="[object "+e+"]"}}),F.isArguments(arguments)||(F.isArguments=function(e){return!(!e||!F.has(e,"callee"))}),"function"!=typeof/./&&(F.isFunction=function(e){return"function"==typeof e}),F.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},F.isNaN=function(e){return F.isNumber(e)&&e!=+e},F.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"==u.call(e)},F.isNull=function(e){return null===e},F.isUndefined=function(e){return void 0===e},F.has=function(e,t){return c.call(e,t)},F.noConflict=function(){return e._=t,this},F.identity=function(e){return e},F.times=function(e,t,i){for(var n=Array(Math.max(0,e)),s=0;e>s;s++)n[s]=t.call(i,s);return n},F.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var P={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};P.unescape=F.invert(P.escape);var T={escape:new RegExp("["+F.keys(P.escape).join("")+"]","g"),unescape:new RegExp("("+F.keys(P.unescape).join("|")+")","g")};F.each(["escape","unescape"],function(e){F[e]=function(t){return null==t?"":(""+t).replace(T[e],function(t){return P[e][t]})}}),F.result=function(e,t){if(null==e)return void 0;var i=e[t];return F.isFunction(i)?i.call(e):i},F.mixin=function(e){w(F.functions(e),function(t){var i=F[t]=e[t];F.prototype[t]=function(){var e=[this._wrapped];return a.apply(e,arguments),R.call(this,i.apply(F,e))}})};var I=0;F.uniqueId=function(e){var t=++I+"";return e?e+t:t},F.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,M={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},$=/\\|'|\r|\n|\t|\u2028|\u2029/g;F.template=function(e,t,i){var n;i=F.defaults({},i,F.templateSettings);var s=new RegExp([(i.escape||N).source,(i.interpolate||N).source,(i.evaluate||N).source].join("|")+"|$","g"),o=0,a="__p+='";e.replace(s,function(t,i,n,s,r){return a+=e.slice(o,r).replace($,function(e){return"\\"+M[e]}),i&&(a+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'"),n&&(a+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),s&&(a+="';\n"+s+"\n__p+='"),o=r+t.length,t}),a+="';\n",i.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{n=new Function(i.variable||"obj","_",a)}catch(r){throw r.source=a,r}if(t)return n(t,F);var l=function(e){return n.call(this,e,F)};return l.source="function("+(i.variable||"obj")+"){\n"+a+"}",l},F.chain=function(e){return F(e).chain()};var R=function(e){return this._chain?F(e).chain():e};F.mixin(F),w(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=n[e];F.prototype[e]=function(){var i=this._wrapped;return t.apply(i,arguments),"shift"!=e&&"splice"!=e||0!==i.length||delete i[0],R.call(this,i)}}),w(["concat","join","slice"],function(e){var t=n[e];F.prototype[e]=function(){return R.call(this,t.apply(this._wrapped,arguments))}}),F.extend(F.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("underscore",function(e){return function(){var t;return t||e._}}(this)),define("ubnt/ubnt.utils",["underscore","jquery"],function(e,t){"use strict";t(function(){t.Window=t(window),t.Body=t("body"),t.Document=t(document),t.Html=t("html");var e="chrome";"undefined"!=typeof InstallTrigger?e="firefox":Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0?e="safari":(window.opera||navigator.userAgent.indexOf("Opera")>=0)&&(e="opera"),t.Body.addClass(e)}),t.fn.outerHTML=function(e){return e?this.before(e).remove():t("<div>").append(this.eq(0).clone()).html()},t.fn.serializeObject=function(){var e={},i=this.serializeArray();return t.each(i,function(){e[this.name]?(e[this.name].push||(e[this.name]=[e[this.name]]),e[this.name].push(this.value||"")):e[this.name]=this.value||""}),e},t.fn.disable=function(){this.attr("disabled","disabled").addClass("disabled")},t.fn.enable=function(){this.removeAttr("disabled").removeClass("disabled")},t.fn.setCaret=function(e){var t=this[0];if(t.setSelectionRange)t.focus(),t.setSelectionRange(e,e);else if(t.createTextRange){var i=t.createTextRange();i.collapse(!0),i.moveEnd("character",e),i.moveStart("character",e),i.select()}},t.parse_qs=function(e){for(var t,i=e||window.location,n={},s=/\+/g,o=/([^&=]+)=?([^&]*)/g,a=function(e){return decodeURIComponent(e.replace(s," "))},r=i.search.substring(1);t=o.exec(r);)n[a(t[1])]=a(t[2]);return n},t.get_site_name=function(){for(var e=window.location.pathname.split("/"),t=0;t<e.length;t++)if("s"==e[t]&&e.length>t+1)return e[t+1];return""},e.mixin({bindAll:function(t){var i=Array.prototype.slice.call(arguments,1);return 0===i.length&&(i=e.functions(t)),e.each(i,function(i){t[i]=e.bind(t[i],t)}),t}})}),function(){var e,t=this,i=t.Backbone,n=[],s=n.push,o=n.slice,a=n.splice;e="undefined"!=typeof exports?exports:t.Backbone={},e.VERSION="1.0.0";var r=t._;r||"undefined"==typeof require||(r=require("underscore")),e.$=t.jQuery||t.Zepto||t.ender||t.$,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var l=e.Events={on:function(e,t,i){if(!c(this,"on",e,[t,i])||!t)return this;this._events||(this._events={});var n=this._events[e]||(this._events[e]=[]);return n.push({callback:t,context:i,ctx:i||this}),this},once:function(e,t,i){if(!c(this,"once",e,[t,i])||!t)return this;var n=this,s=r.once(function(){n.off(e,s),t.apply(this,arguments)});return s._callback=t,this.on(e,s,i)},off:function(e,t,i){var n,s,o,a,l,u,d,h;if(!this._events||!c(this,"off",e,[t,i]))return this;if(!e&&!t&&!i)return this._events={},this;for(a=e?[e]:r.keys(this._events),l=0,u=a.length;u>l;l++)if(e=a[l],o=this._events[e]){if(this._events[e]=n=[],t||i)for(d=0,h=o.length;h>d;d++)s=o[d],(t&&t!==s.callback&&t!==s.callback._callback||i&&i!==s.context)&&n.push(s);n.length||delete this._events[e]}return this},trigger:function(e){if(!this._events)return this;var t=o.call(arguments,1);if(!c(this,"trigger",e,t))return this;var i=this._events[e],n=this._events.all;return i&&d(i,t),n&&d(n,arguments),this},stopListening:function(e,t,i){var n=this._listeners;if(!n)return this;var s=!t&&!i;"object"==typeof t&&(i=this),e&&((n={})[e._listenerId]=e);for(var o in n)n[o].off(t,i,this),s&&delete this._listeners[o];return this}},u=/\s+/,c=function(e,t,i,n){if(!i)return!0;if("object"==typeof i){for(var s in i)e[t].apply(e,[s,i[s]].concat(n));return!1}if(u.test(i)){for(var o=i.split(u),a=0,r=o.length;r>a;a++)e[t].apply(e,[o[a]].concat(n));return!1}return!0},d=function(e,t){var i,n=-1,s=e.length,o=t[0],a=t[1],r=t[2];switch(t.length){case 0:for(;++n<s;)(i=e[n]).callback.call(i.ctx);return;case 1:for(;++n<s;)(i=e[n]).callback.call(i.ctx,o);return;case 2:for(;++n<s;)(i=e[n]).callback.call(i.ctx,o,a);return;case 3:for(;++n<s;)(i=e[n]).callback.call(i.ctx,o,a,r);return;default:for(;++n<s;)(i=e[n]).callback.apply(i.ctx,t)}},h={listenTo:"on",listenToOnce:"once"};r.each(h,function(e,t){l[t]=function(t,i,n){var s=this._listeners||(this._listeners={}),o=t._listenerId||(t._listenerId=r.uniqueId("l"));return s[o]=t,"object"==typeof i&&(n=this),t[e](i,n,this),this}}),l.bind=l.on,l.unbind=l.off,r.extend(e,l);var p=e.Model=function(e,t){var i,n=e||{};t||(t={}),this.cid=r.uniqueId("c"),this.attributes={},r.extend(this,r.pick(t,f)),t.parse&&(n=this.parse(n,t)||{}),(i=r.result(this,"defaults"))&&(n=r.defaults({},n,i)),this.set(n,t),this.changed={},this.initialize.apply(this,arguments)},f=["url","urlRoot","collection"];r.extend(p.prototype,l,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(){return r.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return r.escape(this.get(e))},has:function(e){return null!=this.get(e)},set:function(e,t,i){var n,s,o,a,l,u,c,d;if(null==e)return this;if("object"==typeof e?(s=e,i=t):(s={})[e]=t,i||(i={}),!this._validate(s,i))return!1;o=i.unset,l=i.silent,a=[],u=this._changing,this._changing=!0,u||(this._previousAttributes=r.clone(this.attributes),this.changed={}),d=this.attributes,c=this._previousAttributes,this.idAttribute in s&&(this.id=s[this.idAttribute]);for(n in s)t=s[n],r.isEqual(d[n],t)||a.push(n),r.isEqual(c[n],t)?delete this.changed[n]:this.changed[n]=t,o?delete d[n]:d[n]=t;if(!l){a.length&&(this._pending=!0);for(var h=0,p=a.length;p>h;h++)this.trigger("change:"+a[h],this,d[a[h]],i)}if(u)return this;if(!l)for(;this._pending;)this._pending=!1,this.trigger("change",this,i);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,r.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var i in this.attributes)t[i]=void 0;return this.set(t,r.extend({},e,{unset:!0}))},hasChanged:function(e){return null==e?!r.isEmpty(this.changed):r.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?r.clone(this.changed):!1;var t,i=!1,n=this._changing?this._previousAttributes:this.attributes;for(var s in e)r.isEqual(n[s],t=e[s])||((i||(i={}))[s]=t);return i},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return r.clone(this._previousAttributes)},fetch:function(e){e=e?r.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=this,i=e.success;return e.success=function(n){return t.set(t.parse(n,e),e)?(i&&i(t,n,e),void t.trigger("sync",t,n,e)):!1},$(this,e),this.sync("read",this,e)},save:function(e,t,i){var n,s,o,a=this.attributes;if(null==e||"object"==typeof e?(n=e,i=t):(n={})[e]=t,!(!n||i&&i.wait||this.set(n,i)))return!1;if(i=r.extend({validate:!0},i),!this._validate(n,i))return!1;n&&i.wait&&(this.attributes=r.extend({},a,n)),void 0===i.parse&&(i.parse=!0);var l=this,u=i.success;return i.success=function(e){l.attributes=a;var t=l.parse(e,i);return i.wait&&(t=r.extend(n||{},t)),r.isObject(t)&&!l.set(t,i)?!1:(u&&u(l,e,i),void l.trigger("sync",l,e,i))},$(this,i),s=this.isNew()?"create":i.patch?"patch":"update","patch"===s&&(i.attrs=n),o=this.sync(s,this,i),n&&i.wait&&(this.attributes=a),o},destroy:function(e){e=e?r.clone(e):{};var t=this,i=e.success,n=function(){t.trigger("destroy",t,t.collection,e)};if(e.success=function(s){(e.wait||t.isNew())&&n(),i&&i(t,s,e),t.isNew()||t.trigger("sync",t,s,e)},this.isNew())return e.success(),!1;$(this,e);var s=this.sync("delete",this,e);return e.wait||n(),s},url:function(){var e=r.result(this,"urlRoot")||r.result(this.collection,"url")||M();return this.isNew()?e:e+("/"===e.charAt(e.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(e){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},isValid:function(e){return this._validate({},r.extend(e||{},{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=r.extend({},this.attributes,e);var i=this.validationError=this.validate(e,t)||null;return i?(this.trigger("invalid",this,i,r.extend(t||{},{validationError:i})),!1):!0}});var m=["keys","values","pairs","invert","pick","omit"];r.each(m,function(e){p.prototype[e]=function(){var t=o.call(arguments);return t.unshift(this.attributes),r[e].apply(r,t)}});var g=e.Collection=function(e,t){t||(t={}),t.url&&(this.url=t.url),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,r.extend({silent:!0},t))},_={add:!0,remove:!0,merge:!0},v={add:!0,merge:!1,remove:!1};r.extend(g.prototype,l,{model:p,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return e.sync.apply(this,arguments)},add:function(e,t){return this.set(e,r.defaults(t||{},v))},remove:function(e,t){e=r.isArray(e)?e.slice():[e],t||(t={});var i,n,s,o;for(i=0,n=e.length;n>i;i++)o=this.get(e[i]),o&&(delete this._byId[o.id],delete this._byId[o.cid],s=this.indexOf(o),this.models.splice(s,1),this.length--,t.silent||(t.index=s,o.trigger("remove",o,this,t)),this._removeReference(o));return this},set:function(e,t){t=r.defaults(t||{},_),t.parse&&(e=this.parse(e,t)),r.isArray(e)||(e=e?[e]:[]);var i,n,o,l,u,c=t.at,d=this.comparator&&null==c&&t.sort!==!1,h=r.isString(this.comparator)?this.comparator:null,p=[],f=[],m={};for(i=0,n=e.length;n>i;i++)(o=this._prepareModel(e[i],t))&&((l=this.get(o))?(t.remove&&(m[l.cid]=!0),t.merge&&(l.set(o.attributes,t),d&&!u&&l.hasChanged(h)&&(u=!0))):t.add&&(p.push(o),o.on("all",this._onModelEvent,this),this._byId[o.cid]=o,null!=o.id&&(this._byId[o.id]=o)));if(t.remove){for(i=0,n=this.length;n>i;++i)m[(o=this.models[i]).cid]||f.push(o);f.length&&this.remove(f,t)}if(p.length&&(d&&(u=!0),this.length+=p.length,null!=c?a.apply(this.models,[c,0].concat(p)):s.apply(this.models,p)),u&&this.sort({silent:!0}),t.silent)return this;for(i=0,n=p.length;n>i;i++)(o=p[i]).trigger("add",o,this,t);return u&&this.trigger("sort",this,t),this},reset:function(e,t){t||(t={});for(var i=0,n=this.models.length;n>i;i++)this._removeReference(this.models[i]);return t.previousModels=this.models,this._reset(),this.add(e,r.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),this},push:function(e,t){return e=this._prepareModel(e,t),this.add(e,r.extend({at:this.length},t)),e},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e),t},unshift:function(e,t){return e=this._prepareModel(e,t),this.add(e,r.extend({at:0},t)),e},shift:function(e){var t=this.at(0);return this.remove(t,e),t},slice:function(e,t){return this.models.slice(e,t)},get:function(e){return null==e?void 0:this._byId[null!=e.id?e.id:e.cid||e]},at:function(e){return this.models[e]},where:function(e,t){return r.isEmpty(e)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var i in e)if(e[i]!==t.get(i))return!1;return!0})},findWhere:function(e){return this.where(e,!0)},sort:function(e){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return e||(e={}),r.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(r.bind(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},sortedIndex:function(e,t,i){t||(t=this.comparator);var n=r.isFunction(t)?t:function(e){return e.get(t)};return r.sortedIndex(this.models,e,n,i)},pluck:function(e){return r.invoke(this.models,"get",e)},fetch:function(e){e=e?r.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=e.success,i=this;return e.success=function(n){var s=e.reset?"reset":"set";i[s](n,e),t&&t(i,n,e),i.trigger("sync",i,n,e)},$(this,e),this.sync("read",this,e)},create:function(e,t){if(t=t?r.clone(t):{},!(e=this._prepareModel(e,t)))return!1;t.wait||this.add(e,t);var i=this,n=t.success;return t.success=function(s){t.wait&&i.add(e,t),n&&n(e,s,t)},e.save(null,t),e},parse:function(e){return e},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(e instanceof p)return e.collection||(e.collection=this),e;t||(t={}),t.collection=this;var i=new this.model(e,t);return i._validate(e,t)?i:(this.trigger("invalid",this,e,t),!1)},_removeReference:function(e){this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,i,n){("add"!==e&&"remove"!==e||i===this)&&("destroy"===e&&this.remove(t,n),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],null!=t.id&&(this._byId[t.id]=t)),this.trigger.apply(this,arguments))}});var b=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","indexOf","shuffle","lastIndexOf","isEmpty","chain"];r.each(b,function(e){g.prototype[e]=function(){var t=o.call(arguments);return t.unshift(this.models),r[e].apply(r,t)}});var A=["groupBy","countBy","sortBy"];r.each(A,function(e){g.prototype[e]=function(t,i){var n=r.isFunction(t)?t:function(e){return e.get(t)};return r[e](this.models,n,i)}});var y=e.View=function(e){this.cid=r.uniqueId("view"),this._configure(e||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},C=/^(\S+)\s*(.*)$/,F=["model","collection","el","id","attributes","className","tagName","events"];r.extend(y.prototype,l,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(t,i){return this.$el&&this.undelegateEvents(),this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0],i!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=r.result(this,"events")))return this;this.undelegateEvents();for(var t in e){var i=e[t];if(r.isFunction(i)||(i=this[e[t]]),i){var n=t.match(C),s=n[1],o=n[2];i=r.bind(i,this),s+=".delegateEvents"+this.cid,""===o?this.$el.on(s,i):this.$el.on(s,o,i)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_configure:function(e){this.options&&(e=r.extend({},r.result(this,"options"),e)),r.extend(this,r.pick(e,F)),this.options=e},_ensureElement:function(){if(this.el)this.setElement(r.result(this,"el"),!1);else{var t=r.extend({},r.result(this,"attributes"));this.id&&(t.id=r.result(this,"id")),this.className&&(t["class"]=r.result(this,"className"));var i=e.$("<"+r.result(this,"tagName")+">").attr(t);this.setElement(i,!1)}}}),e.sync=function(t,i,n){var s=w[t];r.defaults(n||(n={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var o={type:s,dataType:"json"};if(n.url||(o.url=r.result(i,"url")||M()),null!=n.data||!i||"create"!==t&&"update"!==t&&"patch"!==t||(o.contentType="application/json",o.data=JSON.stringify(n.attrs||i.toJSON(n))),n.emulateJSON&&(o.contentType="application/x-www-form-urlencoded",o.data=o.data?{model:o.data}:{}),n.emulateHTTP&&("PUT"===s||"DELETE"===s||"PATCH"===s)){o.type="POST",n.emulateJSON&&(o.data._method=s);var a=n.beforeSend;n.beforeSend=function(e){return e.setRequestHeader("X-HTTP-Method-Override",s),a?a.apply(this,arguments):void 0}}"GET"===o.type||n.emulateJSON||(o.processData=!1),"PATCH"!==o.type||!window.ActiveXObject||window.external&&window.external.msActiveXFilteringEnabled||(o.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var l=n.xhr=e.ajax(r.extend(o,n));return i.trigger("request",i,l,n),l};var w={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var E=e.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},D=/\((.*?)\)/g,S=/(\(\?)?:\w+/g,x=/\*\w+/g,G=/[\-{}\[\]+?.,\\\^$|#\s]/g;r.extend(E.prototype,l,{initialize:function(){},route:function(t,i,n){r.isRegExp(t)||(t=this._routeToRegExp(t)),r.isFunction(i)&&(n=i,i=""),n||(n=this[i]);var s=this;return e.history.route(t,function(o){var a=s._extractParameters(t,o);n&&n.apply(s,a),s.trigger.apply(s,["route:"+i].concat(a)),s.trigger("route",i,a),e.history.trigger("route",s,i,a)}),this},navigate:function(t,i){return e.history.navigate(t,i),this},_bindRoutes:function(){if(this.routes){this.routes=r.result(this,"routes");for(var e,t=r.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e])}},_routeToRegExp:function(e){return e=e.replace(G,"\\$&").replace(D,"(?:$1)?").replace(S,function(e,t){return t?e:"([^/]+)"}).replace(x,"(.*?)"),new RegExp("^"+e+"$")},_extractParameters:function(e,t){var i=e.exec(t).slice(1);return r.map(i,function(e){return e?decodeURIComponent(e):null
})}});var k=e.History=function(){this.handlers=[],r.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},B=/^[#\/]|\s+$/g,P=/^\/+|\/+$/g,T=/msie [\w.]+/,I=/\/$/;k.started=!1,r.extend(k.prototype,l,{interval:50,getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(e,t){if(null==e)if(this._hasPushState||!this._wantsHashChange||t){e=this.location.pathname;var i=this.root.replace(I,"");e.indexOf(i)||(e=e.substr(i.length))}else e=this.getHash();return e.replace(B,"")},start:function(t){if(k.started)throw new Error("Backbone.history has already been started");k.started=!0,this.options=r.extend({},{root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var i=this.getFragment(),n=document.documentMode,s=T.exec(navigator.userAgent.toLowerCase())&&(!n||7>=n);this.root=("/"+this.root+"/").replace(P,"/"),s&&this._wantsHashChange&&(this.iframe=e.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(i)),this._hasPushState?e.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!s?e.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=i;var o=this.location,a=o.pathname.replace(/[^\/]$/,"$&/")===this.root;return this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!a?(this.fragment=this.getFragment(null,!0),this.location.replace(this.root+this.location.search+"#"+this.fragment),!0):(this._wantsPushState&&this._hasPushState&&a&&o.hash&&(this.fragment=this.getHash().replace(B,""),this.history.replaceState({},document.title,this.root+this.fragment+o.search)),this.options.silent?void 0:this.loadUrl())},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),k.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(){var e=this.getFragment();return e===this.fragment&&this.iframe&&(e=this.getFragment(this.getHash(this.iframe))),e===this.fragment?!1:(this.iframe&&this.navigate(e),void(this.loadUrl()||this.loadUrl(this.getHash())))},loadUrl:function(e){var t=this.fragment=this.getFragment(e),i=r.any(this.handlers,function(e){return e.route.test(t)?(e.callback(t),!0):void 0});return i},navigate:function(e,t){if(!k.started)return!1;if(t&&t!==!0||(t={trigger:t}),e=this.getFragment(e||""),this.fragment!==e){this.fragment=e;var i=this.root+e;if(this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,e,t.replace))}t.trigger&&this.loadUrl(e)}},_updateHash:function(e,t,i){if(i){var n=e.href.replace(/(javascript:|#).*$/,"");e.replace(n+"#"+t)}else e.hash="#"+t}}),e.history=new k;var N=function(e,t){var i,n=this;i=e&&r.has(e,"constructor")?e.constructor:function(){return n.apply(this,arguments)},r.extend(i,n,t);var s=function(){this.constructor=i};return s.prototype=n.prototype,i.prototype=new s,e&&r.extend(i.prototype,e),i.__super__=n.prototype,i};p.extend=g.extend=E.extend=y.extend=k.extend=N;var M=function(){throw new Error('A "url" property or function must be specified')},$=function(e,t){var i=t.error;t.error=function(n){i&&i(e,n,t),e.trigger("error",e,n,t)}}}.call(this),define("backbone",["underscore","jquery","ubnt/ubnt.utils"],function(e){return function(){var t;return t||e.Backbone}}(this)),function(){"use strict";function e(e,t,i,n,s,o){t[e]&&(i.push(e),(t[e]===!0||1===t[e])&&n.push(s+e+"/"+o))}function t(e,t,i,n,s){var o=n+t+"/"+s;require._fileExists(e.toUrl(o+".js"))&&i.push(o)}function i(e,t,n){var s;for(s in t)!t.hasOwnProperty(s)||e.hasOwnProperty(s)&&!n?"object"==typeof t[s]&&(!e[s]&&t[s]&&(e[s]={}),i(e[s],t[s],n)):e[s]=t[s]}var n=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(s){var o=s.config?s.config():{};return{version:"2.0.4",load:function(s,a,r,l){l=l||{},l.locale&&(o.locale=l.locale);var u,c,d,h=n.exec(s),p=h[1],f=h[4],m=h[5],g=f.split("-"),_=[],v={},b="";if(h[5]?(p=h[1],u=p+m):(u=s,m=h[4],f=o.locale,f||(f=o.locale="undefined"==typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),g=f.split("-")),l.isBuild){for(_.push(u),t(a,"root",_,p,m),c=0;c<g.length;c++)d=g[c],b+=(b?"-":"")+d,t(a,b,_,p,m);a(_,function(){r()})}else a([u],function(t){var n,s=[];for(e("root",t,s,_,p,m),c=0;c<g.length;c++)n=g[c],b+=(b?"-":"")+n,e(b,t,s,_,p,m);a(_,function(){var e,n,o;for(e=s.length-1;e>-1&&s[e];e--)o=s[e],n=t[o],(n===!0||1===n)&&(n=a(p+o+"/"+m)),i(v,n);r(v)})})}}})}(),define("msg/nls/Api",{root:!0,"zh-cn":!0,"zh-tw":!1}),define("msg/nls/root/Api",{E_Fatal:"There was a fatal error",E_UnspecifiedError:"There was an error",E_DataLoad:"There was an error loading the data",E_DataSave:"There was an error saving the data",E_InvalidResponse:"Invalid response",E_SessionExpired:"The management session has expired. Please login again.",N_NoRows:"There are no records to display",N_Loading:"Loading",G_APRestarting:"Restarting",G_APDisconnected:"Disconnected",G_APConnected:"Connected",G_APUpgrading:"Upgrading",G_APPending:"Pending Approval",G_APProvisioning:"Provisioning",G_APAdopting:"Adopting",G_APHeartbeatMissed:"Heartbeat Missed",G_APInformError:"Unmanageable",G_APManagedByOthers:"Managed by Other",G_APAdoptFailed:"Adoption Failed",G_APDeleting:"Deleting",G_APIsolated:"Isolated",G_APIsolatedPending:"Pending Approval (wireless)",G_APFirmwareMismatch:"Pending Upgrade",G_APRollingUpgrade:"Rolling upgrade scheduled.",I_ConfirmRestore:'"{1}" was created at {2}, click "Confirm" to proceed.',I_ConfirmUpgrade:"You will have to login again. Do you want to upgrade now?",I_AlertRestore:"The system is being restored.",I_ServerRestarting:"The server is restarting.",I_ServerDownloading:"The server is preparing backup settings.",I_ServerDownloadingSupport:"The server is preparing support info.",N_ConfirmRestartDevice:"Are you sure you want to restart this device?",N_ConfirmUpgradeDevice:"Are you sure you want to upgrade this device?",G_ToggleAlerts:"toggle alerts",G_ToggleSidebar:"toggle sidebar",G_ToggleEvents:"toggle events",G_ToggleHelp:"toggle help",G_Refresh:"refresh",G_ShowSidebar:"show sidebar",E_ChangeSite:"Unable to change the site",E_NotPlacedOnMap:"is not placed on a map.",E_GoogleNotFound:"Google could not find that location. Please try another search.",E_NoImageSpecified:"No image specified",G_RemoveMap:"Are you sure you want to remove this map?",E_GoogleMapsNotLoaded:"Unable to load Google Maps. Please connect to the internet and reload the page.",E_Alert:"Alert",E_Error:"Error",E_Error2:"Error!",G_WorkingPleaseWait:"Working... Please wait.",G_PleaseConfirm:"Please Confirm",G_SavingPleaseWait:"Saving... Please wait.",G_Saving:"Saving",G_Saved:"Saved",G_Invalid:"Invalid",E_ConnectionDropped:"Connection Dropped",E_UnableToConnect:"Unable to connect to UniFi Controller. Please check your network connection.",E_Retest:"Error - Try Re-test",G_MapAddMapHeader:"Add Map",G_MapEditMapHeader:"Edit Map",G_ConfigureMaps:"Configure Maps",E_MissingModel:"Unable to create a model to save",G_AccountReinvited:"An invitation was resent to {1}",G_AddNewRadius:"Add Auth Server",G_AddNewRadiusAccounting:"Add Acct Server",G_AddNew:"Add New",N_SmtpEmailSent:'An alert mail was sent to "{1}".',N_ConfirmSiteDelete:"Are you sure you want to delete this site?",E_NoAgentsAvailable:"No agents available at this time.",G_AgentsAvailable:"Agent Available",E_BackupFailed:"Backup Failed",E_DownlinksNotUpgraded:"Please upgrade all the downlink APs first.",E_DuplicateAdminName:"Duplicate admin name",E_DuplicateSiteName:"Duplicate site name",E_IdInvalid:"Invalid ID",E_IdRequired:"ID Required",E_InvalidApiKey:"Invalid API key",E_InvalidArgs:"Invalid arguments",E_InvalidBackup:"{1} is not a valid backup.",E_InvalidBackupVersion:"{1} cannot be restored (version={2}).",E_InvalidEmail:"Invalid email",E_InvalidFixedIP:"Invalid fixed IP {fixed_ip} for {user} in IP/Subnet {ip_subnet}",E_InvalidObject:"Invalid object",E_InvalidSiteName:"Invalid site name",E_InvalidTarget:"Invalid target",E_InvalidDevice:"Invalid Device",E_SpectrumScanInProgress:"Scan In Progress",E_InvalidOperatorName:"Invalid Operator Name",E_InvalidOperatorPassword:"Invalid Operator Password",E_InvalidPayload:"Invalid Payload",E_LoginRequired:"Please log in first",E_NoPermission:"Permission denied",E_NoSuchCommand:"No such command",E_NoUplinkAvailable:"No uplink available",E_NotImplemented:"Not implemented",E_NoSecondRemoveUserVPN:"Only one remote user vpn can be created in a site",E_ObjectExisted:"An object with the same name already exists",E_ObjectReferredBy:'Object is referenced by {type}, "{name}", and cannot be deleted',E_ServerBusy:"The server is busy",E_SmtpAuthFailed:"SMTP authorization failed",E_SmtpNoSuchRcpt:"No such recipient",E_SmtpNotEnabled:"SMTP is not enabled",E_SmtpSendFailed:"SMTP send failed",E_SmtpUnknownFailed:"Failed to send email for unknown reason",E_UnknownDevice:"Unknown device",E_UnknownGuest:"Unknown guest",E_UnknownMap:"Unknown map",E_UnknownPayment:"Unknown payment",E_UnknownPaymentGateway:"Unknown payment gateway",E_UnknownStation:"Unknown station",E_UnknownUser:"Unknown user",E_WirelessUplinkDisabled:"Uplink Connectivity Monitor is required for Wireless Uplink",E_NoSiteContext:"No site context",E_NoDelete:"Cannot delete object",E_NoEdit:"Cannot modify object",E_DeviceBusy:"Device is busy",E_UplinkDeviceBusy:"Uplink device is busy",E_InvalidVerification:"Invalid Verification",E_CannotRevokeSelf:"You cannot revoke your own access",E_EmailExisted:"That email already exists",E_NameExisted:"That admin name already exists",E_ExtensionExists:"That extension already exists.",E_NoSecondGateway:"Only one gateway can be adopted by a site.",E_RemoteUserVpnRangeExceeded:'Remote User VPN IP/Subnet "{ip_subnet}" is not within /{max_size}',E_SubnetOverlapped:'IP/Subnet overlaps with "{ip_subnet}" defined in "{name}"',E_RemoteSubnetOverlapped:'IP/Subnet overlaps with remote "{remote_subnet}" defined in site-vpn "{name}"',E_SiteVpnSubnetOverlapped:"local site subnet {local_subnet} overlaps with remote site subnet {remote_subnet}",E_VlanUsed:'VLAN {vlan} has been assigned to network "{name}"',E_InvalidAggregateRange:"Invalid aggregate range",E_TooManyAggregate:"Only {max_aggregate} link aggregate(s) can be created on this model",E_TooManyMirror:"Only {max_mirror} mirroring session(s) can be created on this model",E_TooManyNetwork:"A maximum of {max_network} networks are allowed per site",E_TooManyVlanNetwork:"A maximum of {max_network} VLAN only networks are allowed per site",E_TooManyFixedIpUser:"A maximum of {max_fixed_ip_user} fixed IP users are allowed per site",E_TooManyBlockedUser:"A maximum of {max_blocked_user} blocked users are allowed per site",E_TooManyMultiportPorts:"A maximum of {max_multiport_ports} ports are allowed per multiport forwarding",E_DynamicDNSServiceExisted:"Dynamic DNS service {ddns_service} already exists",E_InvalidSSID:'"{1}" can only be in the length of 1-32',E_InvalidPassphrase:'"{1}" can only be space or printable ASCII characters in the length of 8-63',E_InvalidAlphanumeric:'"{1}" can only be A-Z, a-z, or 0-9',E_InvalidAlphanumDash:'"{1}" can only be A-Z, a-z, 0-9 or "-"',E_InvalidAdminName:'"{1}" can only be A-Z, a-z, 0-9 or _.- but not start with .-',E_InvalidDeviceAdminName:'"{1}" can only be A-Z, a-z, 0-9 or _@.- but not start with .@-',E_InvalidHostname:'"{1}" is not a valid hostname',E_InvalidMirroringPort:"Port {1} is not a valid mirroring port",E_CannotBeEmpty:'"{1}" cannot be empty',E_InvalidAdminPassword:'"{1}" has to start with A-Z, a-z, or 0-9 and the others can only be printable ASCII characters with length of 2-63',E_DifferentPass:'"{1}" and "{2}" is different. Please try again',E_IncorrectLength:'"{1}" has to be in the length of {2}-{3}',E_IncorrectNumberRange:'"{1}" has to be a number between {2} to {3}',E_IncorrectNumberGreaterThanZero:'"{1}" has to be a number greater than zero',E_IncorrectNumberRangeList:'"{1}" has to have up to {2} numbers between {3} to {4} separated by commas (,) or dashes (-) for ranges, and no spaces.',E_IncorrectMultiportFwdPort:"Forward ports {fwd_port} needs to be the same for multiport forwarding",E_IncorrectIPAddress:'"{1}" is not a valid IP address',E_IncorrectIPRange:'"{1}" is not a valid IP range',E_IncorrectIPRangeSubnet:'"{1}" is not a valid IP, IP range or subnet',E_IncorrectNetmask:'"{1}" is not a valid netmask',E_IncorrectIPMaskCombination:"The combination of IP address and subnet mask is invalid.",E_IncorrectIPSubnetSpec:'"{1}" is not a valid IP/subnet (e.g. 192.168.1.1/16)',E_IncorrectIPSubnet:"{1} is not in the allowed subnet of {2}",E_IncorrectEmailAddress:'"{1}" is not a valid email format',E_IncorrectIntegerType:'"{1}" can only be integer number',E_IncorrectDigits:'"{1}" can only contain digits',E_TooManyDigits:'"{1}" exceeds max {2} digits',E_InvalidWEP:'"{1}" can only be hex value with 0-9, A-F in the length of 10 or 26, or printable ASCII characters in the length of 5 or 13',E_GuestNoHotspotPaymentSelected:'Please select at least one of "Voucher" or "Payment" for hotspot authorization',E_InvalidSubnetList:"The following subnets (e.g. 192.168.0.0/16) are invalid: {1}",E_InvalidName:'"{1}" can only be A-Z, a-z, À-ÿ, or 0-9',E_InvalidDHCPRange:"DHCP range needs to be within IP/Subnet",E_MustBeUnique:"{1} must be unique",E_AliasName:"Alias cannot be longer than 128 characters",G_NavDashboard:"Dashboard",G_NavMap:"Map",G_NavDevices:"Devices",G_NavClients:"Clients",G_NavStatistics:"Statistics",G_NavInsights:"Insights",G_NavSupport:"Support",G_NavSettings:"Settings",G_Unifi:"UniFi",G_Administrator:"Administrator",G_AddDevice:"Add Device",G_DeviceCode:"Device Code",G_UpgradeAll:"Upgrade All",G_Actions:"Actions",G_Status:"Status",G_Restart:"Restart",G_Adopt:"Adopt",G_EditSelected:"Edit Selected",G_Name:"Name",G_IPAddress:"IP Address",G_Version:"Version",G_Page:"Page",G_All:"All",G_2G:"2G",G_5G:"5G",G_StaticIP:"Static IP",G_User:"User",G_Users:"Users",G_Noted:"Noted",G_Guest:"Guest",G_OfflineOnly:"Offline Only",G_Download:"Download",G_Guests:"Guests",G_Down:"Down",G_Up:"Up",G_Activity:"Activity",G_Filter:"Filter",G_FilterShow:"Show: ",G_FilterItemsPerPage:"Items per page: ",G_Normal:"Normal",G_Apply:"Apply",G_PostedBy:"Posted by",G_Search:"Search",G_Default:"Default",G_Network:"Network",G_NativeNetwork:"Native Network",G_OtherNetworks:"Other Networks",G_Port:"Port",G_Ports:"Ports",G_UN:"Username",G_PW:"Password",G_ConfirmPW:"Confirm Password",G_Wireless:"Wireless",G_Wired:"Wired",G_Wire:"Wire",G_Send:"Send",G_Cancel:"Cancel",G_Confirm:"Confirm",G_Revoke:"Revoke",G_ReInvite:"Re-Invite",G_Invite:"Invite",G_Unverified:"Unverified",G_Role:"Role",G_Email:"Email",G_Admin:"Admin",G_ReadOnly:"Read Only",G_Unlimited:"Unlimited",G_Unconfigured:"Unconfigured",G_Wlan:"Wlan",G_Security:"Security",G_GuestNet:"Guest Network",G_Delete:"Delete",G_DB:"dB",G_AP:"AP",G_Both:"Both",G_QuestionMark:"?",G_Upload:"Upload",G_Open:"Open",G_Setup:"Setup",G_Check:"Check",G_CheckTitle:"Check for latest phone images",G_Edit:"Edit",G_Auth:"Authentication",G_AddSite:"Add Site",G_AddNewSite:"Add a New Site",G_SiteID:"Site ID",G_SiteName:"Site name",G_CurrentSite:"Current Site",G_RefreshRate:"Refresh Rate",G_Never:"Never",G_Updates:"Updates",G_SeeAll:"See All",G_Done:"Done",G_MyAccount:"My Account",G_SignOut:"Sign Out",G_Last:"Last",G_LastSeen:"Last Seen",G_LastUplink:"Last Uplink",G_Config:"Config",G_Remove:"Remove",G_Submit:"Submit",G_Channel:"Channel",G_ChannelAbbrev:"Chan.",G_Type:"Type",G_Package:"Package",G_Amount:"Amount",G_Start:"Start",G_Duration:"Duration",G_DateTime:"Date/Time",G_IP:"IP",G_UserGuest:"User/Guest",G_Overrides:"Overrides",G_Override:"Override",G_Options:"Options",G_Save:"Save",G_Encryption:"Encryption",G_Auto:"Auto",G_Hour:"hour",G_Hours:"hours",G_Expiration:"Expiration",G_Day:"day",G_Days:"days",G_Minute:"minute",G_Minutes:"minutes",G_Seconds:"seconds",G_Hostname:"Hostname",G_UrlPlaceholder:"http://",G_Signature:"Signature",G_More:"More",G_Week:"week",G_Weeks:"weeks",G_Month:"month",G_ChangePassword:"Change Password",G_ChangeMyPassword:"Change My Password",G_English:"English",G_Speed:"Speed",G_High:"High",G_Low:"Low",G_Medium:"Medium",G_Custom:"Custom",G_Enabled:"Enabled",G_Disabled:"Disabled",G_Locate:"Locate",G_Update:"Update",G_Upgrade:"Upgrade",G_Configuration:"Configuration",G_Note:"Note",G_Block:"Block",G_Unblock:"Unblock",G_Time:"Time",G_Login:"Login",G_Uptime:"Uptime",G_Create:"Create",G_Services:"Services",G_SelectOne:"Select one",G_None:"(none)",G_To:"to",G_Netmask:"Netmask",G_Incoming:"Incoming",G_Outgoing:"Outgoing",G_Internal:"Internal",G_Unknown:"Unknown",G_SettingsOn:"On",G_SettingsOff:"Off",G_Speedtest:"Speed Test",G_StartNow:"Start Now",G_Ping:"Ping",G_TestingPing:"Testing Ping",G_InProgress:"In Progress",G_Retest:"Re-test",G_LastTest:"Last Test",G_Signal:"Signal",G_Watt:"W",G_PowerConsumption:"Power Consumption",G_Temperature:"Temperature",G_DegreeCelsius:"℃",G_FanLevel:"Fan Level",G_Attach:"Attach",G_Detach:"Detach",N_IE8IsntGoingWork:"This isn't going to work.",N_IE8NonCompatible:"Internet Explorer 8 and earlier are not currently compatible with Ubiquiti Accounts. Future support is planned. Until then, please try a different web browser.",N_ConfirmDeleteSetting:"Are you sure you want to delete this setting?",N_ConfirmDeleteWlanGroup:"Are you sure you want to delete this WLAN group?",N_ConfirmBlockController:"{1} might be the UniFi Controller.  Are you sure you want to block it?",N_ConfirmPortConfigApply:"Port {1} might be connected to the UniFi Controller {2}.  Are you sure you want to apply changes?",N_ConfirmTerminateRemoteUserVPNConnection:"Are you sure you want to terminate this remote user VPN connection?",G_roadblockEdge:"Edge Router",G_roadBlockMillPerSec:"The world's first million-package-per-second router priced under $100",G_roadBlockCopy:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vulputate elit porta elit placerat, et consectetur sem rhoncus",G_roadBlockMoreDetails:"More Details",G_roadBlockDontShow:"Don't show me this window again.",G_roadBlockSkipPromo:"Skip this promotion",G_DashboardDiagramWWW:"www",G_DashboardDiagramWAN:"wan",G_DashboardDiagramLAN:"lan",G_DashboardDiagramWLAN:"wlan",G_DashboardDiagramVOIP:"voip",G_DashboardNetworkHealth:"Network Health",G_DashboardConnectedStable:"Connected and Stable",G_DashboardUnreachable:"Unreachable",G_DashboardNoDeviceInstalled:"No Device Installed",G_DashboardNoDataAvailable:"No Data Available",G_DashboardMostDevicesDown:"Devices Down",G_DashboardSomeDevicesDown:"Devices Down",G_DashboardDevicesPending:"Devices Pending",G_DashboardSomeSwitchDown:"Switch Down",G_DashboardGatewayDown:"Gateway Down",G_DashboardGatewayUpgrading:"Upgrading",G_MapLabels:"Labels",G_MapDetails:"Details",G_MapCoverage:"Coverage",G_MapTopology:"Topology",G_MapUnplacedDevices:"Unplaced Devices",G_MapAddMap:"Add a map",G_MapEditMap:"Edit Map",G_MapUploadImage:"Upload Image",G_MapGoogleMaps:"Google Maps",G_MapSetMapScale:"Set Map Scale",G_MapNoMaps:"No Maps",G_MapSetScale:"Set Scale",G_MapDrawLine:"Draw a line by clicking and dragging. Then define the distance of the line below.",G_MapMeters:"Meters",G_MapFeet:"Feet",G_MapNotWhatYouLookingFor:"Not what you were looking for?",G_MapSelectDiffMap:"Select a different map.",G_MapDeviceButton:"Device Button",G_MapTitle:"Device Name",G_MapMAC:"Mac:",G_MapChannel:"Channel:",G_MapUsers:"Users:",G_MapGuests:"Guests:",G_Devices:"Devices",G_DevicesGatewaySwitches:"Gateway/Switches",G_DevicesAPs:"APs",G_DevicesPhones:"Phones",G_DevicesNameMACAddress:"Name/MAC Address",G_DevicesClients:"Clients",G_DevicesSignal:"Signal",G_DevicesDown:"Down",G_DevicesUp:"Up",G_DevicesChannel:"Channel",G_DevicesModel:"Model",G_Devices2GClients:"2G Clients",G_Devices5GClients:"5G Clients",G_DevicesWLAN2G:"WLAN2G",G_DevicesWLAN5G:"WLAN5G",G_DevicesRadio2G:"Radio2G",G_DevicesRadio5G:"Radio5G",G_DevicesTX:"TX",G_DevicesRX:"RX",G_DevicesTX2G:"TX 2G",G_DevicesTX5G:"TX 5G",G_DevicesExtension:"Extension",G_DevicesMinutes:"Minutes",G_DevicesOverview:"Overview",G_DevicesPerformance:"Performance",G_DevicesAddSuccess:"Device Added Succuessfully",G_DevicesChangePassword:"Change Password",G_DevicesAddNewDevice:"Add a New Device",G_DevicesUpdateAll:"Update All",G_DevicesStartRollingUpgrade:"Start Rolling Upgrade",G_DevicesRollingUpgradeInProgress:"Rolling Upgrade in Progress",G_DevicesRollingUpgradeCancelled:"Rolling Upgrade cancelled",G_DevicesTopologyChanged:"Topology changed. Please wait a while for the new settings to propagate",G_MoveTo:"Move to ...",G_CopyFrom:"Copy from ...",N_ConfirmPowerCyclePort:"Are you sure you want to turn off power on Port {1} for 5 seconds?",G_DevicesConsole:"Console",G_DevicesWan:"WAN",G_DevicesLan:"LAN",G_DevicesVoip:"VOIP",G_PortForwardSource:"From",G_PortForwardDestinationPort:"Port",G_PortForwardDestIp:"Forward IP",G_PortForwardDestPort:"Forward Port",G_PortForwardDest:"Dest IP/Port",G_PortForwardName:"Name",G_PortForwardProtocol:"Protocol",G_PortForwardUpPkts:"Packets",G_PortForwardUpBytes:"Bytes",G_PortForwardLeaseDuration:"Lease Duration",G_PortForwardAll:"All",G_PortForwardUserDefined:"User-defined",G_PortForwardUpnp:"Upnp",G_RemoteUserVPNInterface:"Interface",G_RemoteUserVPNRemoteIP:"Remote IP",G_RemoteUserVPNUser:"User",G_RemoteUserVPNRxPackets:"Down Pkts",G_RemoteUserVPNRxBytes:"Down Bytes",G_RemoteUserVPNTxPackets:"Up Pkts",G_RemoteUserVPNTxBytes:"Up Bytes",G_Clients:"Clients",G_ClientsConnection:"Connection",G_ClientsWLAN:"WLAN",G_ClientsAP:"Access Point",G_ClientsAPPort:"AP/Port",G_ClientsSignal:"Signal",G_ClientsNameMACAddress:"Name/MAC Address",G_ClientsAuthorized:"Authorized",G_ClientsPending:"Pending",G_ClientsIPConfig:"IP Config",G_ClientsFixedIP:"Fixed IP",G_ClientsUseFixedIP:"Use Fixed IP address",G_Stats:"Statistics",G_StatsClientsTitle:"Clients (Total)",G_StatsCurrentUsageTopAPS:"Current Usage - Top Access Points",G_StatsQuickLook:"Quick Look",G_StatsNumOfClients:"# of Clients",G_StatsMostActiveAP:"Most Active AP",G_StatsMostActiveClient:"Most Active Client",G_StatsAllTimeTopClient:"All-time Top Client",G_StatsRecentActivities:"Recent Activities",G_StatsTrafficTitle:"Traffic",G_StatsClientsLabel:"Total Clients",G_StatsTrafficLabel:"of Traffic",G_StatsApplications:"Applications",G_StatsDisplayRange:"Display Range:",G_Stats24Hour:"24 Hour",G_Stats1Hour:"1 Hour",G_StatsMoreDataPoints:"More data points needed",G_StatsClearCurrentStats:"Clear Current Stats",G_Insights:"Insights",G_InsightsBlocked:"Blocked",G_InsightsUserGuest:"User/Guest",G_InsightsNoRecDisplay:"There are no records to display",G_InsightsKnownClients:"Known Clients",G_InsightsRogueAccessPoints:"Rogue Access Points",G_InsightsPastConnections:"Past Connections",G_InsightsPastGuestAuthorizations:"Past Guest Authorizations",G_InsightsSwitchStats:"Switch Stats",G_InsightsRemoteUserVPNStats:"Remote User VPN",G_InsightsDynamicDNS:"Dynamic DNS",G_InsightsPortForwardStats:"Port Forward Stats",G_InsightsRogueType:"Security",G_Insights1Day:"1 Day",G_Insights3Days:"3 Days",G_Insights7Days:"7 Days",G_Insights2Weeks:"2 Weeks",G_Insights1Month:"1 Month",G_Insights2Months:"2 Months",G_InsightsAll:"All",G_InsightsNameSSI:"Name/SSID",G_InsightsBSSID:"BSSID",G_InsightsManufacturer:"Manufacturer",G_InsightsLocation:"Location",G_InsightsLastSeen:"Last Seen",G_InsightsNameMACAddress:"Name/MAC Address",G_InsightsAuthorizedBy:"Authorized By",G_InsightsLastAP:"Last AP",G_InsightsLastAPPort:"Last AP/Port",G_InsightsAssociated:"Associated",G_InsightsNetworkVLAN:"Network/VLAN",G_InsightsPoeEnabled:"Enabled",G_InsightsPoePowerOn:"Power On",G_InsightsPoeDisabled:"Disabled",G_InsightsNetworkLinkStatus:"Link Status",G_InsightsSwitch:"Switch",G_InsightsMode:"Mode",G_InsightsSTP:"STP",G_InsightsSTPDisabled:"Disabled",G_InsightsSTPDiscarding:"Discarding",G_InsightsSTPForwarding:"Forwarding",G_InsightsCounters:"Counters",G_InsightsClearCounters:"Clear counters",G_ConfirmClearAllCounters:"Are you sure you want to clear counters for all Switch devices ?",G_ConfirmClearSwitchCounters:"Are you sure you want to clear counters on Switch {1} ?",G_ConfirmClearPortCounters:"Are you sure you want to clear counters on Switch {1}, Port {2} ?",G_InsightsClear:"Clear",G_InsightsPowerCycle:"Power Cycle",G_InsightsPoeMode:"POE Mode",G_InsightsPoeDetection:"POE Detection",G_InsightsPoeClass:"PD Class",G_InsightsPoePower:"Power",G_InsightsPoeVoltage:"Voltage",G_InsightsPoeCurrent:"Current",G_InsightsPoeGood:"Good",G_InsightsPoeCpdHigh:"CPD too High",G_InsightsPoePassive:"Passive",G_InsightsPoeNotDetected:"Not detected",G_InsightsCountersTxBytes:"TX Bytes",G_InsightsCountersTxFrames:"TX Frames",G_InsightsCountersTxMulticast:"TX Multicast",G_InsightsCountersTxBroadcast:"TX Broadcast",G_InsightsCountersTxErrors:"TX Errors",G_InsightsCountersRxBytes:"RX Bytes",G_InsightsCountersRxFrames:"RX Frames",G_InsightsCountersRxMulticast:"RX Multicast",G_InsightsCountersRxBroadcast:"RX Broadcast",G_InsightsCountersRxErrors:"RX Errors",G_SettingsMaintenance:"Maintenance",G_AdminServerInformation:"Server Information",G_AdminServices:"Services",G_AdminRestore:"Restore",G_AdminSupportInfo:"Support Info",G_AdminDownloadSupportInfo:"Download Support Info",G_AdminBrowse:"Browse",G_AdminDownloadBackupSettings:"Download Backup Settings",G_AdminChooseFile:"Choose File",G_AdminNoFileChosen:"No file Chosen",G_AdminDebugLog:"Debug Log",G_AdminMGMT:"mgmt",G_AdminDevice:"device",G_AdminSystem:"system",G_AdminUpgrade:"Upgrade",G_AdminDebug:"Debug",G_AdminDownloadTimeframe:"Historical Data Retention",G_AdminDownloadTimeframeUpTo:"Up to",G_AdminDownloadTimeframeAllTime:"All time",G_Support:"Support",G_SupportPopularTopics:"Popular Topics",G_SupportFreqAskQues:"Frequently Asked Questions",G_SupportCommAnsw:"Community Answers",G_SupportSeeAllFAQ:"See All FAQ",G_SupportSeeAllAnswers:"See All Answers",G_SupportForums:"Forums",G_SupportUserActivity:"User activity",G_SupportGoToForums:"Go to forums",G_SupportMoreSupportOpts:"More Support Options",G_SupportSbmtSupportReq:"Submit a Support Request",G_SupportQuestion:"Question",G_SupportDetails:"Details",G_SupportReqSubmitted:"Request submitted. Thank you.",G_SupportChatSupportAgt:"Chat With a Support Agent",G_SupportAskComm:"Ask the Community",G_SupportNoAgents:"No agents available at this time",G_SupportRecentTopics:"Recent Topics",G_SupportBriefDescribeQuestion:"Briefly describe your question",G_SupportFillDetails:"Fill in the details here. Please try to be as specific as possible.",G_Settings:"Settings",G_SettingsKey:"Key",G_SettingsSiteConfig:"Site Configuration",G_SettingsSite:"Site",G_SettingsServices:"Services",G_SettingsController:"Controller",G_SettingsControllerSettings:"Controller Settings",G_SettingsMailServer:"Mail Server",G_SettingsSiteName:"Site Name",G_SettingsCountry:"Country",G_SettingsTimezone:"Timezone",G_SettingsAutoUpgrade:"Automatic Upgrade",G_SettingsAutoUpgradeFirm:"Automatic upgrade firmware",G_SettingsAutoUpgradeAPFirm:"Automatically upgrade AP firmware",G_SettingsAutoUpgradePhoneFirm:"Automatically upgrade phone firmware",G_SettingsLED:"LED",G_SettingsEnblStatusLED:"Enable status LED",G_SettingsAlert:"Alert",G_SettingsEnblAlertEmails:"Enable alert emails",G_SettingsUplnkConnMonitor:"Uplink Connectivity Monitor",G_SettingsEnableConnMonWireUplnk:"Enable connectivity monitor and wireless uplink",G_SettingsDefaultGateway:"Default Gateway",G_SettingsCustomIP:"Custom IP",G_UplinkIPAddress:"Uplink IP Address",G_SettingsSNMP:"SNMP",G_SettingsEnblSNMP:"Enable SNMPv1",G_SettingsSNMPCommunity:"Community String",G_SettingsRemoteLogging:"Remote Logging",G_SettingsEnblRemoteSysServ:"Enable remote syslog server",G_SettingsLoggingDebug:"Enable debug level syslog",G_SettingsRemoteIPAddress:"Remote IP Address",G_SettingsDeviceAuth:"Device Authentication",G_SettingsCntrlHostnameIP:"Controller Hostname/IP",G_SettingsNetDiscovery:"Network Discovery",G_SettingsMakeCntrlDiscvL2Net:"Make controller discoverable on L2 Network",G_SettingsSMTPServ:"SMTP Server",G_SettingsSMTPHost:"SMTP Host",G_SettingsEnblMailServ:"Enable mail server",G_SettingsEnblAuth:"Enable authentication",G_SettingsSpecifySendAdd:"Specify sender address",G_SettingsTestSMTPServ:"Test SMTP Server",G_SettingsSendTestEmail:"Send test email to",G_SettingsEnblSSL:"Enable SSL",G_SettingsDeleteSite:"Delete Site",G_SettingsWPA1Only:"WPA1 Only",G_SettingsWPA2Only:"WPA2 Only",G_SettingsTKIPOnly:"TKIP Only",G_SettingsAESCCMPOnly:"AES/CCMP Only",G_SettingsAdmins:"Admins",G_SettingsCreateNewAdmin:"Create New Admin",G_SettingsAdminName:"Admin Name",G_SettingsAdminEmail:"Admin Email",G_SettingsEditAdmin:"Edit Admin",G_SettingsUserGroup:"User Group",G_SettingsUserGroups:"User Groups",G_SettingsCreateNewUserGroup:"Create New User Group",G_SettingsEditUserGroup:"Edit User Group",G_SettingsBandwidthLimit:"Bandwidth Limit",G_SettingsBandwidthLimitDL:"Bandwidth Limit (Download)",G_SettingsBandwidthLimitUL:"Bandwidth Limit (Upload)",G_SettingsLimitedTo:"limited to",G_SettingsKbps:"Kbps",G_SettingsMegaBytes:"MBytes",G_SettingsCreateNewWirelssGroup:"Create New Wireless Group",G_SettingsCreateNewWirelessNetwork:"Create New Wireless Network",G_SettingsCreateNewWirelessNetworkNote:"A maximum of 4 wireless networks are allowed per WLAN group",G_SettingsEditWirelessNetwork:"Edit Wireless Network",G_SettingsMobility:"Mobility",G_SettingsEnblSmlssRoaming:"Enable seamless roaming (Zero-Handoff)",G_SettingsMinRSSI:"Minimum RSSI",G_SettingsRecntClntsRSSI:"Reconnect clients with RSSI lower than",G_SettingsLoadBalancing:"Load Balancing",G_SettingsNumClients:"Number of clients",G_SettingsBalanceNumbrClnts:"Balance number of clients per radio",G_MaximumNumberClnts:"Number of clients per radio must be between {1} and {2}",G_SettingsLegacySupport:"Legacy Support",G_SettingsEnblLegacyDevice:"Enable legacy device support (i.e. 11b)",G_SettingsAdvancedOpts:"Advanced Options",G_SettingsNameSSID:"Name/SSID",G_SettingsWEP:"WEP",G_SettingsWPAPersonal:"WPA-Personal",G_SettingsWPAEnterprise:"WPA-Enterprise",G_SettingsGuestPolicy:"Guest Policy",G_SettingsApplyGuestPolicies:"Apply guest policies (captive portal, guest authentication, access)",G_SettingsWirelessNetworks:"Wireless Networks",G_SettingsWLANGroup:"WLAN Group",G_SettingsAddWLANGroup:"Add WLAN Group",G_SettingsEditWLANGroup:"Edit WLAN Group",G_SettingsRadio:"Radio",G_Settings2G802:"2G (802.11n/g)",G_Settings5G802:"5G (802.11n/a)",G_SettingsDFS:"(dfs)",G_SettingsWEPKey:"WEP Key",G_SettingsKeyIndex:"Key Index",G_SettingsSecurityKey:"Security Key",G_SettingsRadiusServer:"RADIUS Auth Server",G_SettingsRadiusAccountingServer:"RADIUS Accounting Server",G_SettingsVLAN:"VLAN",G_SettingsUseVLANId:"use VLAN ID",G_SettingsVLANId:"VLAN ID",G_SettingsHideSSID:"Hide SSID",G_SettingsWPAMode:"WPA Mode",G_SettingsEnableWLANSchedule:"Enable WLAN Schedule",G_SettingsScheduled:"Scheduled",G_SettingsWLANSchedule:"WLAN Schedule",G_SettingsScheduleHours:"Hours",G_SettingsEnableUAPSD:"Enable Unscheduled Automatic Power Save Delivery",G_SettingsUAPSD:"UAPSD",G_SettingsNetworks:"Networks",G_SettingsCreateNewNetwork:"Create New Network",G_SettingsEditNetwork:"Edit Network",G_SettingsPurpose:"Purpose",G_SettingsPurposeCorporate:"Corporate",G_SettingsPurposeGuest:"Guest",G_SettingsPurposeRemoteUserVPN:"Remote User VPN",G_SettingsPurposeSiteToSiteVPN:"Site-to-Site VPN",G_SettingsPurposeVoip:"Voice",G_SettingsPurposeVlanOnly:"VLAN Only",G_SettingsIPSubnet:"IP/Subnet",G_SettingsSubnet:"Subnet",G_SettingsDHCPServer:"DHCP Server",G_SettingsEnableDHCPServer:"Enable DHCP Server",G_SettingsDHCPNameServer:"DHCP Name Server",G_SettingsNameServer:"Name Server",G_SettingsNameServer1:"Name Server 1",G_SettingsNameServer2:"Name Server 2",G_SettingsNameServerAuto:"Auto",G_SettingsNameServerManual:"Manual",G_SettingsDHCPWinsServer:"DHCP WINS Server",G_SettingsWinsServer:"WINS Server",G_SettingsWinsServer1:"WINS Server 1",G_SettingsWinsServer2:"WINS Server 2",G_SettingsEnableDHCPWinsServer:"Enable DHCP WINS Server",G_SettingsEnableWinsServer:"Enable WINS Server",G_SettingsDHCPLeaseTime:"DHCP Lease Time",G_SettingsDHCPRange:"DHCP Range",G_SettingsDHCPRangeStart:"DHCP Range (start)",G_SettingsDHCPRangeEnd:"DHCP Range (end)",G_SettingsDHCPDHCPGuarding:"DHCP Guarding",G_SettingsEnableDHCPGuarding:"Enable DHCP Guarding",G_SettingsDHCPTrustedServerIp:"Trusted DHCP Server IP",G_SettingsIPPool:"IP Pool",G_SettingsIPStart:"IP Range (start)",G_SettingsIPEnd:"IP Range (end)",G_SettingsRemoteSite:"Remote Site",G_SettingsNetworkEnabled:"{1} was enabled",G_SettingsNetworkDisabled:"{1} was disabled",G_SettingNetworksUpdateDHCPRange:"update DHCP range",G_SettingsRadiusIP:"RADIUS IP",G_SettingsRadiusPassword:"RADIUS Password",G_SettingsExposedToVPN:"Site-to-Site VPN",G_SettingsExposedToSiteToSiteVPN:"Exposed to Site-to-Site VPN",G_SettingsLeaseTimeSeconds:"Seconds",G_SettingsGuestPW:"Guest Password",G_SettingsGuestCtrl:"Guest Control",G_SettingsGuestPolicies:"Guest Policies",G_SettingsEnblGuestPortal:"Enable Guest Portal",G_SettingsNoAuth:"No Authentication",G_SettingsSimplePW:"Simple Password",G_SettingsHotspot:"Hotspot",G_SettingsExtPortalServer:"External Portal Server",G_SettingsLandingPage:"Landing Page",G_SettingsRedirectOriginalURL:"Redirect to the Original URL",G_SettingsPromoURL:"Promotional URL",G_SettingsPortalCustomization:"Portal Customization",G_SettingsEnblPortalCustomization:"Enable portal customization",G_SettingsPortalURLHostname:"Portal URL Hostname",G_SettingsRediectHostname:"Redirect using hostname",G_SettingsVoucher:"Voucher",G_SettingsEnblVoucherAuth:"Enable voucher-based authorization",G_SettingsPayment:"Payment",G_SettingsEnblPaymentAuth:"Enable payment-based authorization",G_SettingsGateway:"Gateway",G_SettingsStripe:"Stripe (US, Canada)",G_SettingsPayPal:"PayPal",G_SettingsPaypalWebPaymentPro:"PayPal Website Payment Pro (US, Canada, UK)",G_SettingsQuickPay:"Quickpay (Europe)",G_SettingsAuthorizenet:"Authorize.Net (US, Canada)",G_SettingsMerchantWarrior:"Merchant Warrior (Australia, New Zealand)",G_SettingsIPpay:"IPpay (US, Canada)",G_SettingsAPIKey:"API Key",G_SettingsHopspotOp:"Hotspot Operator",G_SettingsGoToHotpotMgr:"Go to Hotspot Manager",G_SettingsAccessCntrl:"Access Control",G_SettingsRestrictedSubnets:"Restricted Subnets",G_SettingsAllowedSubnets:"Allowed Subnets",G_SettingsUserDefined:"User-defined",G_SettingsCustomPortal:"Custom Portal",G_SettingsUsePayPalSandbox:"Use PayPal Sandbox",G_SettingsApplySandboxAccount:"Apply Sandbox Account",G_SettingsMerchantId:"Merchant ID",G_SettingsMerchantUuid:"Merchant UUID",G_SetttingsMD5Secret:"MD5 Secret",G_SettingsAPILoginId:"API Login ID",G_SettingsAPIPassphrase:"API Passphrase",G_SettingsTransactionKey:"Transaction Key",G_SettingsTerminalId:"Terminal ID",G_SettingsUseTestAccount:"Use Test Account",G_SettingsApplyTestAccount:"Apply Test Account",G_SettingsVoip:"VOIP",G_SettingsVoipIsEnabled:"VOIP",G_SettingsVoipEnable:"Enable VOIP feature",G_SettingsVoipUpdateCache:"Update Image Cache",G_SettingsVoipUpdateCacheEnable:"Enable VOIP Phone Update Image Cache",G_SettingsPhoneAdopt:"Phone Adoption",G_SettingsPhoneAutoAdopt:"Automatically adopt discovered phones",G_SettingsProvider:"VOIP Provider",G_SettingsSipServer:"SIP Server",G_SettingsSipAuth:"SIP Authentication Method",G_SettingsSipAuthName:"Authorization ID",G_SettingsSipProxy:"Outbound Proxy",G_SettingsSipVoicemailURL:"SIP Voicemail",G_SettingsSipVoicemailURLTitle:"Voicemail URL or number from SIP provider",G_SettingsSipUsername:"SIP Username",G_SettingsSipPassword:"SIP Password",G_SettingsProviderSetup:"Provider Setup",G_SettingsProviderExternal:"External",G_SettingsProviderExternalNote:"Provide your own PBX. Use UniFi to mass-provision phones",G_SettingsProviderAuthUser:"User-based (most common)",G_SettingsProviderAuthIP:"IP-based",G_SettingsCreateNewNumber:"Create New Number",G_SettingsEditNumber:"Edit Number",G_SettingsVoipGlobal:"Global",G_SettingsVoipNumber:"Number",G_SettingsVoipExtension:"Extension",G_SettingsVoipType:"Type",G_SettingsVoipExtPhone:"Phone",G_SettingsVoipExtPhoneUnassigned:"unassigned",G_SettingsNumberManage:"Manage",G_SettingsNumberRefresh:"Refresh",G_SettingsNumberAdd:"Add",G_SettingsExtensions:"Extensions",G_SettingsExtensionImport:"Import",G_SettingsCreateNewExtension:"Create New Extension",G_SettingsEditExtension:"Edit Extension",G_SettingsExtPhone:"Phone",G_SettingsExtMembers:"Members",G_SettingsExtMembersPlaceholder:"Enter Name or Email Address",G_Properties:"Properties",G_PropertiesOverview:"Overview",G_PropertiesDetails:"Details",G_PropertiesConfiguration:"Configuration",G_PropertiesMACAddress:"MAC Address",G_PropertiesAlias:"Alias",G_PropertiesRadios:"Radios",G_PropertiesWLANS:"Wlans",G_PropertiesPotentialUplinks:"Potential Uplinks",G_PropertiesWirelessUplinks:"Wireless Uplinks",G_PropertiesForgetAP:"Forget this AP",G_PropertiesConfigIP:"Configure IP",G_PropertiesUsingDHCP:"Using DHCP",G_PropertiesStaticIP:"Static IP",G_PropertiesNoWirelssUplnks:"No wireless uplinks available",G_PropertiesForgetDeviceConfirmTitle:"Confirm Forget Device",G_PropertiesForgetDeviceConfirmTxt:"Are you sure you want to remove the device from the system? UniFi will no longer be managing this device and the device will be restored to factory default.",G_PropertiesMoveDeviceConfirmTitle:"Confirm Move Device",G_PropertiesMoveDeviceConfirmTxt:"Are you sure you want to move this device to site {1}? The device configurations and history respective to this site will be wiped out, and the device will reprovision with configurations in site {2}.",G_PropertiesCopyDeviceConfigConfirmTitle:"Confirm Copy Config",G_PropertiesCopyDeviceConfigConfirmTxt:"Are you sure you want to overwrite this device's configuration with the one from {1}?",G_PropertiesForget:"Forget",G_PropertiesForgetAPTxt:" If you no longer wish to manage this AP, you may remove it. Note that all configurations and history with respect to this access point will be wiped out.",G_PropertiesUplink:"Uplink",G_PropertiesBlocked:"Blocked",G_PropertiesUplinkAP:"Uplink AP",G_PropertiesSignal:"Signal",G_PropertiesTXRate:"TX Rate",G_PropertiesRXRate:"RX Rate",G_PropertiesDuplex:"Duplex",G_PropertiesFullDuplexAbbrv:"FDX",G_PropertiesHalfDuplexAbbrv:"HDX",G_PropertiesDownPktsBytes:"Down Pkts/Bytes",G_PropertiesUpPktsBytes:"Up Pkts/Bytes",G_PropertiesAdvancedOpts:"Advanced Options",G_PropertiesInformURL:"Inform URL",G_PropertiesUplinks:"Uplinks",G_PropertiesDownlinks:"Downlinks",G_PropertiesRadio11NBG:"RADIO (11N/B/G)",G_PropertiesTransmitPower:"Transmit Power",G_PropertiesTXPktsBytes:"TX Pkts/Bytes",G_PropertiesRXPktsBytes:"RX Pkts/Bytes",G_PropertiesTXRetryDropped:"TX Retry/Dropped",G_PropertiesRXRetryDropped:"RX Retry/Dropped",G_PropertiesRadio11NA:"RADIO (11N/A)",G_PropertiesRadio11AC:"RADIO (11N/A/AC)",G_PropertiesNoUsersConnected:"There are no users connected to this device.",G_PropertiesNoGuestsConnected:"There are no guests connected to this device.",G_PropertiesNoHistory:"There is no history related to this client.",G_PropertiesRadio2G11NBG:"Radio 2G (11n/b/g)",G_PropertiesHT20:"HT20",G_PropertiesHT40:"HT40",G_PropertiesHT80:"HT80",G_PropertiesTXPower:"Tx Power",G_PropertiesDBM:"dBm",G_PropertiesDBI:"dBi",G_PropertiesEIRP:"EIRP",G_PropertiesAntennaGain:"Antenna Gain",G_PropertiesRadio5G11NA:"Radio 5G (11n/a)",G_PropertiesRadio5G11AC:"Radio 5G (11n/a/ac)",G_PropertiesRFEnvironment:"RF Environment",G_PropertiesRFLastUpdated:"Scanned: {1}",G_PropertiesRFScan:"RF Scan",G_PropertiesRFScanScanning:"Scanning...",G_PropertiesRFScanConfirmTitle:"Confirm RF Scan",G_PropertiesRFScanConfirmTxt:"Are you sure you want to trigger an RF Scan? A scan may take more than 5 minutes. All clients using this AP will be disconnected and the AP will be offline for the duration of the scan.",G_PropertiesRFUtilization:"Utilization",G_PropertiesRFInterference:"Interference",G_PropertiesRFInterferenceTypes:"Interference types",G_PropertiesWLANS2G11NBG:"WLANs 2G (11n/b/g)",G_PropertiesWLANGroup:"WLAN Group",G_PropertiesWLANS5G11NA:"WLANs 5G (11n/a)",G_PropertiesWLANS5G11AC:"WLANs 5G (11n/a/ac)",G_2GWLANSDisabled:"* One or more 2G WLANs are disabled globally.",G_5GWLANSDisabled:"* One or more 5G WLANs are disabled globally.",G_PropertiesEnblOnAP:"Enabled on this AP",G_PropertiesVLAN:"VLAN",G_PropertiesUseVLANId:"Use VLAN ID",G_PropertiesSSID:"SSID",G_PropertiesPSK:"PSK",G_PropertiesRestore:"Restore",G_PropertiesSubnetMask:"Subnet Mask",G_PropertiesGateway:"Gateway",G_PropertiesPreferredDNS:"Preferred DNS",G_PropertiesAlternateDNS:"Alternate DNS",G_PropertiesDNSSuffix:"DNS suffix",G_PropertiesHistory:"History",G_PropertiesConnectedAP:"Connected AP",G_PropertiesESSID:"ESSID",G_PropertiesPowerSave:"Power Save",G_PropertiesUsergroups:"User Group",G_PropertiesAutomatic:"Automatic",G_PropertiesDebug:"Debug",G_PropertiesDeviceType:"Device Type",G_PropertiesReconnect:"Reconnect",G_PropertiesUnauthorize:"Unauthorize",G_PropertiesAuthorize:"Authorize",G_PropertiesAggregationFragmentation:"Aggregation / Fragmentation",G_PropertiesBandSteering:"Band Steering",G_PropertiesAirtimeFairness:"Airtime Fairness",G_PropertiesBalanced:"Balanced",G_PropertiesPrefer5G:"Steer to 5G",G_Ago:"ago",G_PropertiesNetworks:"Networks",G_PropertiesLANIPAddress:"LAN IP Address",G_PropertiesDownActivity:"Down Activity",G_PropertiesUpActivity:"Up Activity",G_PropertiesNumPhones:"Num Phones",G_PropertiesNoNetworksConfigured:"No networks configured",G_PropertiesNumHosts:"Num Hosts",G_PropertiesForgetGateway:"Forget this gateway",G_PropertiesForgetGatewayTxt:"If you no longer wish to manage this gateway, you may remove it. Note that all configurations and history with respect to this gateway will be wiped out.",G_PropertiesPortForward:"Port Forward",G_PropertiesConnectionType:"Connection Type",G_PropertiesRouter:"Router",G_PropertiesPPPoE:"PPPoE",G_PropertiesNoPortForwardingConfigured:"No port forwarding configured",G_PropertiesPortFwdSrcAnywhere:"Anywhere",G_PropertiesPortFwdSrcLimited:"Limited",G_PropertiesProtocol:"Protocol",G_PropertiesTcp:"TCP",G_PropertiesUdp:"UDP",G_PropertiesPortForwardDeleteConfirm:"Are you sure you want to remove this port forwarding rule?",G_PropertiesDynamicDNS:"Dynamic DNS",G_PropertiesNoDynamicDNSConfigured:"No Dynamic DNS configured",G_PropertiesDDNSService:"Service",G_PropertiesDDNSServiceAfraid:"afraid",G_PropertiesDDNSServiceDnspark:"dnspark",G_PropertiesDDNSServiceDslreports:"dslreports",G_PropertiesDDNSServiceDyndns:"dyndns",G_PropertiesDDNSServiceEasydns:"easydns",G_PropertiesDDNSServiceNamecheap:"namecheap",G_PropertiesDDNSServiceSitelutions:"sitelutions",G_PropertiesDDNSServiceZoneedit:"zoneedit",G_PropertiesDDNSHostname:"Hostname",G_PropertiesDDNSUsername:"Username",G_PropertiesDDNSPassword:"Password",G_PropertiesDDNSServer:"Server",G_PropertiesDDNSDynamicDNSDeleteConfirm:"Are you sure you want to remove this Dynamic DNS service?",G_PropertiesDDNSLastUpdated:"Last Updated",G_PropertiesDDNSIp:"IP",G_PropertiesDDNSStatus:"Status",G_PropertiesDDNSStatusGood:"Good",G_PropertiesDDNSStatusUpdating:"Updating",G_PropertiesDDNSStatusFailed:"Failed",G_PropertiesNetworksVLANs:"Networks/VLANs",G_PropertiesForgetSwitch:"Forget this switch",G_PropertiesForgetSwitchTxt:"If you no longer wish to manage this switch, you may remove it. Note that all configurations and history with respect to this switch will be wiped out.",G_PropertiesCopySwitchConfig:"Copy config",G_PropertiesCopySwitchConfigTxt:"You may copy a similar switch's configuration onto this switch.",G_PropertiesNoDownlinksConnected:"There are no downlinks connected to the switch",G_PropertiesNoPorts:"There are no ports",G_PropertiesDevice:"Device",G_PropertiesPoE:"PoE",G_PropertiesEnableJumboFrame:"Enable Jumbo Frame",G_PropertiesEnableFlowControl:"Enable Flow Control",G_PropertiesNetworkGroup:"Network Group",G_PropertiesManagementVLAN:"MGMT VLAN",G_PropertiesEnableSFlow:"Enable sFlow",G_PropertiesServerIp:"Server IP",G_PropertiesNoNetworksVLANsConfigured:"No networks or VLANs have been configured",G_PropertiesNetworkDeleteConfirm:"Are you sure you want to delete this network?",G_PropertiesNative:"Native",G_PropertiesCustomized:"Customized",G_PropertiesTaggedNetworks:"Tagged Networks",G_PropertiesOperation:"Operation",G_PropertiesSwitching:"Switching",G_PropertiesMirroring:"Mirroring",G_PropertiesMirroringPort:"Mirroring Port",G_PropertiesAggregatedByPort:"Aggregating Port",G_PropertiesAggregate:"Aggregate",G_PropertiesAggregatePorts:"Aggregate Ports",G_PropertiesPoEModePassive:"24V Passive",G_PropertiesPoEModePoEPlus:"PoE+",G_PropertiesAutoneg:"Link Negotiation",G_PropertiesAuto:"Auto",G_PropertiesManual:"Manual",G_PropertiesFullDuplex:"Full Duplex",G_PropertiesSpeed:"Link Speed",G_Properties10Mbps:"10 Mbps",G_Properties100Mbps:"100 Mbps",G_Properties1000Mbps:"1000 Mbps",G_Properties10Gbps:"10 Gbps",G_PropertiesEnable:"Enable",G_PropertiesSFPVendor:"Vendor",G_PropertiesSFPSerial:"Serial",G_PropertiesSFPPartNum:"Part Number",G_PropertiesSFPRev:"Rev",G_PropertiesSFPCompliance:"Compliance",G_PropertiesSFPVoltage:"Voltage",G_PropertiesSFPCurrent:"Current",G_PropertiesSFPOutputPower:"Output Power",G_PropertiesSFPInputPower:"Input Power",G_PropertiesSFPTXError:"TX Fault",G_PropertiesSFPRXError:"RX Fault",G_BetweenXandY:"between {1} and {2}",G_PropertiesForgetPhone:"Forget this phone",G_PropertiesForgetPhoneTxt:" If you no longer wish to manage this phone, you may remove it. Note that all configurations and history with respect to this phone will be wiped out.",G_HotspotNameMACAddress:"Name [MAC Address]",G_HotspotAuthorizedBy:"Authorized By",G_HotspotGuests:"Guests",G_HotspotPaymentsTransactions:"Payments and Transactions",G_HotspotLastName:"Last Name",G_HotspotFirstName:"First Name",G_HotspotExtraInfo:"Extra Info",G_HotspotVouchers:"Vouchers",G_HotspotCode:"Code",G_HotspotCreateTime:"Create Time",G_HotspotNotes:"Notes",G_HotspotPrintAllUnusedVouchers:"Print All Unused Vouchers",G_HotspotCreateVouchers:"Create Vouchers",G_HotspotPrintBatch:"Print batch",G_HotspotCreate:"Create",G_HotspotCount:"Count",G_HotspotDownloadLimit:"Download Limit",G_HotspotUploadLimit:"Upload Limit",G_HotspotByteQuota:"Byte Quota",G_HotspotExpireValue:"Expiration Value",G_HotspotOnetime:"One time",G_HotspotMultiuse:"Multi use",G_HotspotVouchersFor:"vouchers for",G_HotspotVouchersQuota:"Byte Quota",G_HotspotUserDefined:"User-defined",G_HotspotOperatorAccounts:"Operator Accounts",G_HotspotCreateOperator:"Create Operator",G_HotspotCreateNewOperator:"Create New Operator",G_HotspotOpenOperatorLogin:"Open Operator Login",G_HotspotAccountName:"Account Name",G_HotspotManagerLogin:"Hotspot Manager Log in",G_HotspotLogin:"Log In",G_HotspotChrome:"Chrome",G_HotspotFirefox:"Firefox",G_HotspotExpired:"Expired",G_HotspotValidUntil:"Valid until",E_InvalidUNPW:"Invalid username and password",E_InvalidSite:"No site is specified in login url, please correct the url and try again",G_HotspotNavGuests:"Guests",G_HotspotNavPayments:"Payments",G_HotspotNavVouchers:"Vouchers",G_HotspotNavOperators:"Operators",G_Alerts:"Alerts",G_AlertsShowArchivedAlerts:"Show archived alerts",G_AlertsArchiveAll:"Archive All",G_AlertsArchive:"Archive",G_AlertsSystem:"System",G_AlertsDevice:"Device",G_EventLan:"LAN",G_EventWlan:"WLAN",G_EventWan:"WAN",G_EventVoip:"VOIP",G_Events:"Events",G_EventsAll:"All",G_EventsAdmin:"Admin",G_EventsWithin:"within",G_CalendarMonday:"Monday",G_CalendarTuesday:"Tuesday",G_CalendarWednesday:"Wednesday",G_CalendarThursday:"Thursday",G_CalendarFriday:"Friday",G_CalendarSaturday:"Saturday",G_CalendarSunday:"Sunday",Wizard:{G_UniFiSetupWizardTitle:"UniFi Setup Wizard",G_WelcomeMessage:"Thank you for purchasing Ubiquiti Enterprise Solution. You will be able to setup your controller in a few minutes.",G_Back:"Back",G_Skip:"Skip",G_Next:"Next",G_Welcome:"Welcome",G_Discover:"Discover",G_Wireless:"Wireless",G_Password:"Password",G_Finish:"Finish",G_WelcomeSelectLanguage:"Select your preferred language",G_WelcomeSelectCountry:"Select your country",G_WelcomeSelectTimezone:"Select your timezone",G_WelcomeRestoreLinkPrefix:"Alternatively you can",G_WelcomeRestoreLinkText:"restore from a previous backup",G_Refresh:"Refresh",G_DiscoverMessage:"Please select the devices you would like to configure.",G_WirelessMessage:"For Wireless Networks, the installation wizard can create a secure primary wireless network for you. Enter the wireless settings that you would like to use below:",G_WirelessMessageSkip:"You may skip this step if you are not setting up any UniFi access points.",G_WirelessSecureSsid:"Secure SSID",G_WirelessSecureSsidTitle:"SSID can only be printable ASCII",G_WirelessSecurityKey:"Security Key",G_WirelessSecurityKeyTitle:"Security Key needs to be at least 8 characters long",G_WirelessOptionMessage:"Optionally, you may create an open wireless network for your guests",G_WirelessEnableGuestAccess:"Enable Guest Access",G_WirelessGuestSsid:"Guest SSID",G_PasswordMessage:"Please provide an administrator name and password for UniFi Controller access.",G_PasswordAdminName:"Admin Name",G_PasswordAdminNameTitle:"pattern can only be A-Z, a-z, 0-9 or _.- but cannot start with .-",G_ConfirmPassword:"Confirm Password",G_FinishMessage:'Please review the settings below. Click "Back" to make any changes or "Finish" to activate the settings. Once finished you will be redirected to the management interface.',E_PasswordRequired:"password required",E_PasswordsDontMatch:"passwords do not match",E_SsidAlphanumeric:"ssid needs to be printable alphanumeric",E_SsidPasswordLength:"passphrase must be between 8 and 63 characters",E_AdminNameAlphanumeric:"admin name must be alphanumeric",E_NoDevicesMsg:"No Devices have been discovered.",E_NoDevicesInstructions:"Make sure the devices are on the same L2/switch network and try again.",N_Restoring:"The backup is being loaded and controller restarted. Please wait.",N_NoSSID:"No SSID has been set"},E_BetaQuotaReached:"UniFi Cloud is in private beta and is invitation-only. Please stay tuned.",G_Back:"Back",G_PleaseLogin:"Please Login",E_InvalidLogin:"Invalid username and password",G_RecoverMessage:"Email sent to recover password",G_ForgotPassword:"Forget Your Password?",G_EnterEmailAddress:"Please enter your email address to reset your password.",G_ResetPassword:"Reset Password",E_WontWork:"This isn’t going to work.",E_WontWorkDetail:"Internet Explorer 8 and earlier are not currently compatible with our UI<br/>Future support is planned. Until then, please try a different web browser."}),define("msg/nls/zh-cn/Api",{E_Fatal:"发生了一个严重错误",E_UnspecifiedError:"出错了",E_DataLoad:"加载数据出错",E_DataSave:"保存数据出错",E_InvalidResponse:"无效的应答",E_SessionExpired:"会话超时, 请重新登录.",N_NoRows:"当前没有记录可以显示",N_Loading:"加载中",G_APRestarting:"正在重新启动",G_APDisconnected:"已断开",G_APConnected:"已连接",G_APUpgrading:"正在升级(请勿断电)",G_APPending:"等待批准",G_APProvisioning:"配置中",G_APAdopting:"正在采用",G_APHeartbeatMissed:"心跳丢失",G_APInformError:"无法管理",G_APManagedByOthers:"设备已被其他控制器管理",G_APAdoptFailed:"采用失败",G_APDeleting:"正在删除",G_APIsolated:"已隔离",G_APIsolatedPending:"等待批准(无线)",G_APFirmwareMismatch:"等待升级",G_APRollingUpgrade:"已加入滚动升级计划.",I_ConfirmRestore:'"{1}" 已在{2}生成, 点击 "确认"继续.',I_ConfirmUpgrade:"您必须重新登录,现在就升级吗?",I_AlertRestore:"系统已修复.",I_ServerRestarting:"服务器已重启.",I_ServerDownloading:"服务器正在准备备份设定.",I_ServerDownloadingSupport:"服务器正在准备支持信息.",N_ConfirmRestartDevice:"确定要重新启动该设备?",N_ConfirmUpgradeDevice:"确定要升级该设备?（注：升级期间不得断电）",G_ToggleAlerts:"打开警示",G_ToggleSidebar:"打开侧边栏",G_ToggleEvents:"打开事件",G_ToggleHelp:"打开帮助",G_Refresh:"刷新",G_ShowSidebar:"显示侧边栏",E_ChangeSite:"无法修改站点",E_NotPlacedOnMap:"未放到地图上.",E_GoogleNotFound:"Google 无法找到该位置,请重新搜索.",E_NoImageSpecified:"未指定图像",G_RemoveMap:"您确定要移除该地图?",E_GoogleMapsNotLoaded:"无法加载谷歌地图,请连接互联网并重新加载页面.",E_Alert:"警示",E_Error:"错误",E_Error2:"错误!",G_WorkingPleaseWait:"工作中…请稍候",G_PleaseConfirm:"请确认",G_SavingPleaseWait:"保存中…请稍候.",G_Saving:"保存中",G_Saved:"已保存",G_Invalid:"无效的",E_ConnectionDropped:"连线已中断",E_UnableToConnect:"无法连接到 UniFi 控制器,请确认您的网络连接.",E_Retest:"错误 - 尝试重新测试",G_MapAddMapHeader:"增加地图",G_MapEditMapHeader:"编辑地图",G_ConfigureMaps:"配置地图",E_MissingModel:"无法创建一个模型并保存",G_AccountReinvited:"邀请已重新发送到{1}",G_AddNewRadius:"添加验证服务器",G_AddNewRadiusAccounting:"添加计费服务器",G_AddNew:"新增",N_SmtpEmailSent:'一封警示邮件已发送到 "{1}".',N_ConfirmSiteDelete:"确定要删除该站点?",E_NoAgentsAvailable:"此次无可用的代理.",G_AgentsAvailable:"代理可用",E_BackupFailed:"备份失败",E_DownlinksNotUpgraded:"下行链接未升级",E_DuplicateAdminName:"复制管理员名称",E_DuplicateSiteName:"复制站点名称",E_IdInvalid:"无效的 ID",E_IdRequired:"需要 ID",E_InvalidApiKey:"无效的 API 密钥",E_InvalidArgs:"无效参数",E_InvalidBackup:"{1}是一个无效的备份.",E_InvalidBackupVersion:"{1} 无法修复(版本={2}).",E_InvalidEmail:"无效的邮件",E_InvalidFixedIP:"子网 {ip_subnet} 内用户 {user} 设有无效的固定 IP {fixed_ip}",E_InvalidObject:"无效的对象",E_InvalidSiteName:"无效的站点名称",E_InvalidTarget:"无效的目标",E_InvalidDevice:"无效的设备",E_InvalidOperatorName:"无效的操作员名称",E_InvalidOperatorPassword:"无效的操作员密码",E_InvalidPayload:"无效的 Payload",E_LoginRequired:"请先登录",E_NoPermission:"无此命令",E_NoSuchCommand:"无此命令",E_NoUplinkAvailable:"无可用的上行链接",E_NotImplemented:"未执行",E_NoSecondRemoveUserVPN:"单个站点下仅允许一个远程用户 VPN.",E_ObjectExisted:"已存在相同名字的对象",E_ObjectReferredBy:'对象已被{type}占用, "{name}", 无法删除',E_ServerBusy:"服务器正忙",E_SmtpAuthFailed:"SMTP 认证失败",E_SmtpNoSuchRcpt:"无此接收端",E_SmtpNotEnabled:"SMTP 未启用",E_SmtpSendFailed:"SMTP 发送失败",E_SmtpUnknownFailed:"发送邮件失败,原因不明",E_UnknownDevice:"未知的设备",E_UnknownGuest:"未知的来宾",E_UnknownMap:"未知的地图",E_UnknownPayment:"未知的付款方式",E_UnknownPaymentGateway:"未知的付款网关",E_UnknownStation:"未知的接收站",E_UnknownUser:"未知的用户",E_WirelessUplinkDisabled:"需要上行链路连接性监视器进行无线上行链接",E_NoSiteContext:"无站点环境",E_NoDelete:"无法删除对象",E_NoEdit:"无法修改对象",E_DeviceBusy:"设备忙碌中",E_UplinkDeviceBusy:"上行链接设备正忙",E_InvalidVerification:"无效的验证",E_CannotRevokeSelf:"您无法撤销自己的使用权",E_EmailExisted:"该 email 已经存在",E_NameExisted:"该管理员名称已经存在",E_ExtensionExists:"该分机已经存在.",E_NoSecondGateway:"单个站点下仅允许管理一个网关.",E_RemoteUserVpnRangeExceeded:'远程用户 VPN IP/子网 "{ip_subnet}" 未在 /{max_size} 范围内',E_SubnetOverlapped:'与"{name}"下的 IP/子网 "{ip_subnet}"有重叠',E_RemoteSubnetOverlapped:'IP/子网与定义为"{name}"的 site-vpn 下的远程"{remote_subnet}"重叠',E_SiteVpnSubnetOverlapped:"本地子网 {local_subnet} 与远程子网{remote_subnet}重叠",E_VlanUsed:'VLAN {vlan} 已指定给网络 "{name}"',E_InvalidAggregateRange:"无效的聚合范围",E_TooManyAggregate:"在当前模式下只能生成 {max_aggregate} 个链路聚合",E_TooManyMirror:"在当前模式下只能生成 {max_mirror} 个镜像会话",E_TooManyNetwork:"每个站点下仅允许最多 {max_network} 个网络",E_TooManyVlanNetwork:"每个站点下仅允许最多 {max_network} 个 VLAN only 网络",E_TooManyFixedIpUser:"每个站点下仅允许最多 {max_fixed_ip_user} 个固定 IP 的用户",E_TooManyBlockedUser:"每个站下仅允许最多 {max_blocked_user} 个封锁用户",E_TooManyMultiportPorts:"每个多端口转发 (multiport forwarding) 最多只允许 {max_multiport_ports} 个端口",E_DynamicDNSServiceExisted:"动态 DNS 服务器 {ddns_service} 已经存在",E_InvalidSSID:'"{1}" 的长度必须为1-32',E_InvalidPassphrase:'"{1}" 只能是空格或 8-63 位可打印的 ASCII 字符',E_InvalidAlphanumeric:'"{1}" 只能是 A-Z, a-z, 或者 0-9',E_InvalidAlphanumDash:'"{1}" 只能是 A-Z, a-z, 0-9 或者 "-"',E_InvalidAdminName:'"{1}" 只能是 A-Z, a-z, 0-9 或者 _.- 但是不能以 .- 开头',E_InvalidDeviceAdminName:'"{1}" 只能是 A-Z, a-z, 0-9 或者 _@.- 但是不能以 .@- 开头',E_InvalidHostname:'"{1}" 不是一个合法的主机名',E_InvalidMirroringPort:"端口 {1} 不是一个有效的监控端口",E_CannotBeEmpty:'"{1}" 不能为空',E_InvalidAdminPassword:'"{1}" 必需以 A-Z, a-z, 或者 0-9 开头, 并且只能是可打印的 ASCII 字符',E_DifferentPass:'"{1}" 和 "{2}" 不一致. 请重试',E_IncorrectLength:'"{1}" 的长度必需为 {2}-{3}',E_IncorrectNumberRange:'"{1}" 必需是 {2} 到 {3}之间的数字',E_IncorrectNumberGreaterThanZero:'"{1}" 必需是大于 0 的数字',E_IncorrectNumberRangeList:'"{1}" 必需是最大为 {2} 的数字，在{3} 到 {4} 之间用逗号(,) 或者短横线(-) 分开, 不能有空隔.',E_IncorrectMultiportFwdPort:"多端口转发（multiport forwarding）的转发端口 {fwd_port} 必需要相同",E_IncorrectIPAddress:'"{1}" 不是一个有效的 IP 地址',E_IncorrectIPRange:'"{1}" 不是一个有效的 IP 范围',E_IncorrectIPRangeSubnet:'"{1}" 不是一个有效的 IP , IP 范围或子网',E_IncorrectNetmask:'"{1}" 不是一个有效的网络掩码',E_IncorrectIPMaskCombination:"无效的 IP 地址和子网掩码组合.",E_IncorrectIPSubnetSpec:'"{1}"不是一个有效的 IP/子网 (例如:192.168.1.1/16)',E_IncorrectIPSubnet:"{1} 不在 {2}的被允许子网内",E_IncorrectEmailAddress:'"{1}" 不是一个有效的邮件格式',E_IncorrectIntegerType:'"{1}" 仅允许整数',E_IncorrectDigits:'"{1}" 只能是数字',E_TooManyDigits:'"{1}" 超过限额{2}位数',E_InvalidWEP:'"{1}"只能是 0-9, A-F 中的字符且长度为 10 或 26. 5 或 13 位可打印的 ASCII 字符.',E_GuestNoHotspotPaymentSelected:'请至少选择一个"凭证" 或 "付款方式" 用于热点认证',E_InvalidSubnetList:"以下子网 (如:192.168.0.0/16)是无效的: {1}",E_InvalidName:'"{1}" 只能是 A-Z, a-z, À-ÿ, 或者 0-9',E_InvalidDHCPRange:"DHCP 范围必须在 IP/子网内",E_MustBeUnique:"{1} 必须是唯一的",E_AliasName:"Alias cannot be longer than 128 characters",G_NavDashboard:"操作面板",G_NavMap:"地图",G_NavDevices:"设备",G_NavClients:"客户端",G_NavStatistics:"统计数据",G_NavInsights:"察看",G_NavSupport:"支持",G_NavSettings:"设置",G_Unifi:"UniFi",G_Administrator:"管理员",G_AddDevice:"添加设备",G_DeviceCode:"设备编码",G_UpgradeAll:"全部更新",G_Actions:"操作",G_Status:"状态",G_Restart:"重新启动",G_Adopt:"采用",G_EditSelected:"编辑选择",G_Name:"名称",G_IPAddress:"IP 地址",G_Version:"版本",G_Page:"页",G_All:"全部",G_2G:"2G",G_5G:"5G",G_StaticIP:"静态 IP",G_User:"用户",G_Users:"用户",G_Noted:"已标注的",G_Guest:"来宾",G_OfflineOnly:"只显示离线",G_Download:"下载",G_Guests:"来宾",G_Down:"下行",G_Up:"上行",G_Activity:"活跃度",G_Filter:"筛选器",G_FilterShow:"显示: ",G_FilterItemsPerPage:"每页显示条目: ",G_Normal:"普通",G_Apply:"应用",G_PostedBy:"发布者",G_Search:"搜索",G_Default:"默认",G_Network:"网络",G_NativeNetwork:"本地网路",G_OtherNetworks:"其他网路",G_Port:"端口",G_Ports:"端口",G_UN:"用户名",G_PW:"密码",G_ConfirmPW:"确认密码",G_Wireless:"无线",G_Wired:"有线",G_Wire:"有线",G_Send:"发送",G_Cancel:"取消",G_Confirm:"确认",G_Revoke:"撤销",G_ReInvite:"重新邀请",G_Invite:"邀请",G_Unverified:"尚未验证",G_Role:"角色",G_Email:"邮件",G_Admin:"管理员",G_ReadOnly:"只读",G_Unlimited:"未限速",G_Unconfigured:"未配置",G_Wlan:"Wlan",G_Security:"加密方式",G_GuestNet:"来宾网络",G_Delete:"删除",G_DB:"dB",G_AP:"AP",G_Both:"全部",G_QuestionMark:"?",G_Upload:"上传",G_Open:"不加密",G_Setup:"设置",G_Check:"检查更新",G_CheckTitle:"检查网络电话是否有固件更新",G_Edit:"编辑",G_Auth:"认证方式",G_AddSite:"增加站点",G_AddNewSite:"新增站点",G_SiteID:"站点 ID",G_SiteName:"站点名称",G_CurrentSite:"当前站点",G_RefreshRate:"页面刷新",G_Never:"从不",G_Updates:"更新",G_SeeAll:"查看全部",G_Done:"完成",G_MyAccount:"我的帐户",G_SignOut:"登出",G_Last:"最近",G_LastSeen:"最近出现时间",G_LastUplink:"上一个无线上连",G_Config:"配置",G_Remove:"移除",G_Submit:"提交",G_Channel:"信道",G_ChannelAbbrev:"信道.",G_Type:"类型",G_Package:"封包",G_Amount:"合计",G_Start:"开始时间",G_Duration:"持续时长",G_DateTime:"日期/时间",G_IP:"IP",G_UserGuest:"用户/来宾",G_Overrides:"修改",G_Override:"修改",G_Options:"选项",G_Save:"保存",G_Encryption:"加密方式",G_Auto:"自动",G_Hour:"小时",G_Hours:"小时",G_Expiration:"有效时长",G_Day:"天",G_Days:"天",G_Minute:"分钟",G_Minutes:"分钟",G_Seconds:"秒",G_Hostname:"主机名称",G_UrlPlaceholder:"http://",G_Signature:"签名",G_More:"更多",G_Week:"周",G_Weeks:"周",G_Month:"月",G_ChangePassword:"变更密码",G_ChangeMyPassword:"变更我的密码",G_English:"英语",G_Speed:"速率",G_High:"高",G_Low:"低",G_Medium:"中",G_Custom:"自定义",G_Enabled:"已启用",G_Disabled:"已禁用",G_Locate:"定位",G_Update:"更新",G_Upgrade:"升级",G_Configuration:"配置",G_Note:"备注",G_Block:"封锁",G_Unblock:"解除封锁",G_Time:"时间",G_Login:"登录",G_Uptime:"运行时间",G_Create:"创建",G_Services:"服务",G_SelectOne:"选择一个",G_None:"(无)",G_To:"到",G_Netmask:"网络掩码",G_Incoming:"来电",G_Outgoing:"呼出",G_Internal:"内线",G_Unknown:"未知",G_SettingsOn:"开",G_SettingsOff:"关",G_Speedtest:"速率测试",G_StartNow:"现在开始",G_Ping:"Ping",G_TestingPing:"Ping 测试",G_InProgress:"进行中",G_Retest:"重新测试",G_LastTest:"上次测试",G_Signal:"信号",G_Watt:"瓦",G_PowerConsumption:"电量消耗",G_Attach:"锁定到侧边栏",G_Detach:"从侧边栏分离",N_IE8IsntGoingWork:"这将无法工作.",N_IE8NonCompatible:"IE8 及更早版本与 Ubiquiti 帐户暂不兼容,我们正在规划后续对这些版本的支持.目前还请尝试其他网页浏览器.",N_ConfirmDeleteSetting:"您确定要删除该设置?",N_ConfirmDeleteWlanGroup:"您确定要删除该 WLAN 群组?",N_ConfirmBlockController:"{1} 有可能是 UniFi 控制器. 您确定要封锁它?",N_ConfirmPortConfigApply:"端口 {1} 有可能连接到 UniFi 控制器 {2}. 您确定要应用变更?",N_ConfirmTerminateRemoteUserVPNConnection:"确定是否要终止该远程用户的 VPN 连接?",G_roadblockEdge:"Edge Router",G_roadBlockMillPerSec:"这是世界上首款售价低于 $100 的每秒百万封包的高性能路由器",G_roadBlockCopy:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vulputate elit porta elit placerat, et consectetur sem rhoncus",G_roadBlockMoreDetails:"更多详情",G_roadBlockDontShow:"不再显示该窗口.",G_roadBlockSkipPromo:"跳过该广告",G_DashboardDiagramWWW:"www",G_DashboardDiagramWAN:"wan",G_DashboardDiagramLAN:"lan",G_DashboardDiagramWLAN:"wlan",G_DashboardDiagramVOIP:"voip",G_DashboardNetworkHealth:"网络健康",G_DashboardConnectedStable:"链接稳定",G_DashboardUnreachable:"无法到达",G_DashboardNoDeviceInstalled:"未安装设备",G_DashboardNoDataAvailable:"无数据",G_DashboardMostDevicesDown:"设备已离线",G_DashboardSomeDevicesDown:"设备已离线",G_DashboardDevicesPending:"设备等待采用",G_DashboardSomeSwitchDown:"交换机已离线",G_DashboardGatewayDown:"网关已离线",G_DashboardGatewayUpgrading:"升级中",G_MapLabels:"标签",G_MapDetails:"显示详情",G_MapCoverage:"覆盖范围",G_MapTopology:"拓扑结构",G_MapUnplacedDevices:"未放置的设备",G_MapAddMap:"增加地图",G_MapEditMap:"编辑地图",G_MapUploadImage:"更新图像",G_MapGoogleMaps:"谷歌地图",G_MapSetMapScale:"设置地图比例尺",G_MapNoMaps:"没有地图",G_MapSetScale:"设置比例尺",G_MapDrawLine:"通过拖放来画一条线,然后在下面定义这条线的长度",G_MapMeters:"米",G_MapFeet:"英尺",G_MapNotWhatYouLookingFor:"没找到您要找的?",G_MapSelectDiffMap:"设置另外一个地图.",G_MapDeviceButton:"设备按钮",G_MapTitle:"设备名称",G_MapMAC:"Mac:",G_MapChannel:"信道:",G_MapUsers:"用户:",G_MapGuests:"来宾:",G_Devices:"设备",G_DevicesGatewaySwitches:"网关/交换机",G_DevicesAPs:"接入点",G_DevicesPhones:"电话",G_DevicesNameMACAddress:"名称/MAC 地址",G_DevicesClients:"客户端",G_DevicesSignal:"信号",G_DevicesDown:"下行",G_DevicesUp:"上行",G_DevicesChannel:"信道",G_DevicesModel:"型号",G_Devices2GClients:"2G 客户端",G_Devices5GClients:"5G 客户端",G_DevicesWLAN2G:"WLAN2G",G_DevicesWLAN5G:"WLAN5G",G_DevicesRadio2G:"无线 2G",G_DevicesRadio5G:"无线 5G",G_DevicesTX:"TX",G_DevicesRX:"RX",G_DevicesTX2G:"TX 2G",G_DevicesTX5G:"TX 5G",G_DevicesExtension:"分机",G_DevicesMinutes:"分钟",G_DevicesOverview:"概览",G_DevicesPerformance:"性能",G_DevicesAddSuccess:"添加设备成功",G_DevicesChangePassword:"修改密码",G_DevicesAddNewDevice:"新增一个设备",G_DevicesUpdateAll:"全部更新",G_DevicesStartRollingUpgrade:"开始滚动升级",G_DevicesRollingUpgradeInProgress:"滚动升级正在进行中(请勿断开设备电源)",G_DevicesRollingUpgradeCancelled:"滚动升级已取消",G_DevicesTopologyChanged:"拓扑结构已变更,新的设定正在传送中,请稍等",G_MoveTo:"移动到…",G_CopyFrom:"复制 ...",N_ConfirmPowerCyclePort:'您确定要将交换器端口 "{1}" 的供电关闭五秒钟?',G_DevicesConsole:"控制台",G_DevicesWan:"WAN",G_DevicesLan:"LAN",G_DevicesVoip:"VOIP",G_PortForwardSource:"来自",G_PortForwardDestinationPort:"端口",G_PortForwardDestIp:"转发 IP",G_PortForwardDestPort:"转发端口",G_PortForwardDest:"目标 IP/端口",G_PortForwardName:"名称",G_PortForwardProtocol:"协议",G_PortForwardUpPkts:"封包",G_PortForwardUpBytes:"字节数",G_PortForwardLeaseDuration:"租期",G_PortForwardAll:"全部",G_PortForwardUserDefined:"用户自定义",G_PortForwardUpnp:"Upnp",G_RemoteUserVPNInterface:"接口",G_RemoteUserVPNRemoteIP:"远程 IP",G_RemoteUserVPNUser:"使用者",G_RemoteUserVPNRxPackets:"下行封包数",G_RemoteUserVPNRxBytes:"下行字节数",G_RemoteUserVPNTxPackets:"上行封包数",G_RemoteUserVPNTxBytes:"上行字节数",G_Clients:"客户端",G_ClientsConnection:"连接到",G_ClientsWLAN:"WLAN",G_ClientsAP:"接入点",G_ClientsAPPort:"接入点/端口",G_ClientsSignal:"信号",G_ClientsNameMACAddress:"名称/MAC 地址",G_ClientsAuthorized:"已授权",G_ClientsPending:"等待中",G_ClientsIPConfig:"IP 配置",G_ClientsFixedIP:"固定 IP",G_ClientsUseFixedIP:"使用固定 IP 地址",G_Stats:"统计资料",G_StatsClientsTitle:"客户端(全部)",G_StatsCurrentUsageTopAPS:"当前用量 -  AP 排行榜",G_StatsQuickLook:"快速查看",G_StatsNumOfClients:"客户端数量",G_StatsMostActiveAP:"最活跃的 AP",G_StatsMostActiveClient:"最活跃的客户端",G_StatsAllTimeTopClient:"全部时间客户端排行榜",G_StatsRecentActivities:"最近活动",G_StatsTrafficTitle:"流量",G_StatsClientsLabel:"全部客户端",G_StatsTrafficLabel:"的流量",G_StatsApplications:"应用",G_StatsDisplayRange:"显示范围:",G_Stats24Hour:"24 小时",G_Stats1Hour:"1 小时",G_StatsMoreDataPoints:"需要更多数据",G_StatsClearCurrentStats:"清除当前统计数据",G_Insights:"察看",G_InsightsBlocked:"被封锁的",G_InsightsUserGuest:"用户/来宾",G_InsightsNoRecDisplay:"当前没有记录",G_InsightsKnownClients:"客户端列表",G_InsightsRogueAccessPoints:"非法接入点",G_InsightsPastConnections:"连接记录",G_InsightsPastGuestAuthorizations:"来宾认证记录",G_InsightsSwitchStats:"交换机状态",G_InsightsRemoteUserVPNStats:"远程用户 VPN",G_InsightsDynamicDNS:"动态 DNS",G_InsightsPortForwardStats:"端口转发统计",G_InsightsRogueType:"加密方式",G_Insights1Day:"1 天",G_Insights3Days:"3 天",G_Insights7Days:"7 天",G_Insights2Weeks:"2 周",G_Insights1Month:"1 个月",G_Insights2Months:"2 个月",G_InsightsAll:"永久",G_InsightsNameSSI:"名称/SSID",G_InsightsBSSID:"BSSID",G_InsightsManufacturer:"制造商",G_InsightsLocation:"位置",G_InsightsLastSeen:"最后出现时间",G_InsightsNameMACAddress:"名称/MAC 地址",G_InsightsAuthorizedBy:"授权者",G_InsightsLastAP:"最近连接的 接入点",G_InsightsLastAPPort:"最近连接的 AP/端口",G_InsightsAssociated:"关联时间",G_InsightsNetworkVLAN:"网络/VLAN",G_InsightsPoeEnabled:"已启用",G_InsightsPoePowerOn:"电源开",G_InsightsPoeDisabled:"已禁用",G_InsightsNetworkLinkStatus:"链路状态",G_InsightsSwitch:"交换机",G_InsightsMode:"模式",G_InsightsSTP:"STP",G_InsightsSTPDisabled:"已禁用",G_InsightsSTPDiscarding:"丢弃",G_InsightsSTPForwarding:"转发",G_InsightsCounters:"计数",G_InsightsClearCounters:"清除计数",G_ConfirmClearAllCounters:"确定要清除全部交换机的计数?",G_ConfirmClearSwitchCounters:"确定要清除交换机 {1} 上的计数 ?",G_ConfirmClearPortCounters:"确定要清除交换机 {1} 端口 {2} 上的计数 ?",G_InsightsClear:"清除",G_InsightsPowerCycle:"重启",G_InsightsPoeMode:"POE 模式",G_InsightsPoeDetection:"POE 侦测",G_InsightsPoeClass:"PD 类型",G_InsightsPoePower:"电源",G_InsightsPoeVoltage:"电压",G_InsightsPoeCurrent:"电流",G_InsightsPoeGood:"良好",G_InsightsPoeCpdHigh:"CPD 过高",G_InsightsPoePassive:"被动式",G_InsightsPoeNotDetected:"未检测到",G_InsightsCountersTxBytes:"TX 字节数",G_InsightsCountersTxFrames:"TX 帧",G_InsightsCountersTxMulticast:"TX 组播",G_InsightsCountersTxBroadcast:"TX 广播",G_InsightsCountersTxErrors:"TX 错误",G_InsightsCountersRxBytes:"RX 字节数",G_InsightsCountersRxFrames:"RX 帧",G_InsightsCountersRxMulticast:"RX 组播",G_InsightsCountersRxBroadcast:"RX 广播",G_InsightsCountersRxErrors:"RX 错误",G_SettingsMaintenance:"维护",G_AdminServerInformation:"服务器信息",G_AdminServices:"服务",G_AdminRestore:"恢复",G_AdminSupportInfo:"支持信息",G_AdminDownloadSupportInfo:"下载支持信息",G_AdminBrowse:"浏览",G_AdminDownloadBackupSettings:"下载备份设置",G_AdminChooseFile:"选择文件",G_AdminNoFileChosen:"未选择文件",G_AdminDebugLog:"调试日志",G_AdminMGMT:"mgmt",G_AdminDevice:"设备",G_AdminSystem:"系统",G_AdminUpgrade:"升级",G_AdminDebug:"调试",G_AdminDownloadTimeframe:"历史数据保存",G_AdminDownloadTimeframeUpTo:"时长为",G_AdminDownloadTimeframeAllTime:"永久",G_Support:"支持",G_SupportPopularTopics:"热门话题",G_SupportFreqAskQues:"常见问题",G_SupportCommAnsw:"社区答案",G_SupportSeeAllFAQ:"查看全部常见问题",G_SupportSeeAllAnswers:"查看全部答案",G_SupportForums:"论坛",G_SupportUserActivity:"用户活动",G_SupportGoToForums:"跳转到论坛",G_SupportMoreSupportOpts:"更多支持选项",G_SupportSbmtSupportReq:"提交技术支持申请",G_SupportQuestion:"问题",G_SupportDetails:"详情",G_SupportReqSubmitted:"谢谢, 您的申请已提交.",G_SupportChatSupportAgt:"咨询在线客服",G_SupportAskComm:"社区提问",G_SupportNoAgents:"客服暂忙",G_SupportRecentTopics:"最近话题",G_SupportBriefDescribeQuestion:"请简洁地描述您的问题",G_SupportFillDetails:"请在此处尽量填写详情.",G_Settings:"设置",G_SettingsKey:"Key",G_SettingsSiteConfig:"站点配置",G_SettingsSite:"站点",G_SettingsServices:"服务",G_SettingsController:"控制器",G_SettingsControllerSettings:"控制器设置",G_SettingsMailServer:"邮件服务器",G_SettingsSiteName:"站点名称",G_SettingsCountry:"国家",G_SettingsTimezone:"时区",G_SettingsAutoUpgrade:"自动升级",G_SettingsAutoUpgradeFirm:"自动升级固件",G_SettingsAutoUpgradeAPFirm:"自动升级 AP 固件",G_SettingsAutoUpgradePhoneFirm:"自动升级 VoIP 话机固件",G_SettingsLED:"LED 指示灯",G_SettingsEnblStatusLED:"启用 LED 状态指示灯",G_SettingsAlert:"警示",G_SettingsEnblAlertEmails:"启用邮件提醒",G_SettingsUplnkConnMonitor:"上行连接性监视",G_SettingsEnableConnMonWireUplnk:"启用连接性监视和无线上行",G_SettingsDefaultGateway:"默认网关",G_SettingsCustomIP:"自定义 IP",G_UplinkIPAddress:"上行 IP 地址",G_SettingsSNMP:"SNMP",G_SettingsEnblSNMP:"启用 SNMPv1",G_SettingsSNMPCommunity:"社区字符串",G_SettingsRemoteLogging:"远程日志",G_SettingsEnblRemoteSysServ:"启用远程系统日志服务器",G_SettingsLoggingDebug:"启用调试级别系统日志",G_SettingsRemoteIPAddress:"远程 IP 地址",G_SettingsDeviceAuth:"设备身份验证",G_SettingsCntrlHostnameIP:"控制器主机名/IP",G_SettingsNetDiscovery:"网络发现",G_SettingsMakeCntrlDiscvL2Net:"使控制器在二层网络中可被其他设备发现",G_SettingsSMTPServ:"SMTP 服务器",G_SettingsSMTPHost:"SMTP 主机",G_SettingsEnblMailServ:"启用邮件服务器",G_SettingsEnblAuth:"启用身份验证",G_SettingsSpecifySendAdd:"指定发件人地址",G_SettingsTestSMTPServ:"测试 SMTP 服务器",G_SettingsSendTestEmail:"发送测试邮件到",G_SettingsEnblSSL:"启用 SSL",G_SettingsDeleteSite:"删除站点",G_SettingsWPA1Only:"仅 WPA1",G_SettingsWPA2Only:"仅 WPA2",G_SettingsTKIPOnly:"仅 TKIP",G_SettingsAESCCMPOnly:"仅 AES/CCMP",G_SettingsAdmins:"管理员",G_SettingsCreateNewAdmin:"创建新管理员",G_SettingsAdminName:"管理员名称",G_SettingsAdminEmail:"管理员邮箱",G_SettingsEditAdmin:"编辑管理员",G_SettingsUserGroup:"用户限速群组",G_SettingsUserGroups:"用户限速群组",G_SettingsCreateNewUserGroup:"创建一个新用户限速群组",G_SettingsEditUserGroup:"编辑用户限速群组",G_SettingsBandwidthLimit:"带宽限制",G_SettingsBandwidthLimitDL:"带宽限制 (下载)",G_SettingsBandwidthLimitUL:"带宽限制 (上传)",G_SettingsLimitedTo:"不超过",G_SettingsKbps:"Kbps",G_SettingsMegaBytes:"MBytes",G_SettingsCreateNewWirelssGroup:"创建新无线群组",G_SettingsCreateNewWirelessNetwork:"创建新无线网络",G_SettingsCreateNewWirelessNetworkNote:"每个 WLAN 群组最多允许 4 个无线网络",G_SettingsEditWirelessNetwork:"编辑无线网络",G_SettingsMobility:"移动性",G_SettingsEnblSmlssRoaming:"启用零切换无缝漫游(Zero-Handoff)",G_SettingsMinRSSI:"最小 RSSI 值",G_SettingsRecntClntsRSSI:"当 RSSI 值低于该值时重新连接客户端",G_SettingsLoadBalancing:"负载均衡",G_SettingsNumClients:"客户端数量",G_SettingsBalanceNumbrClnts:"平衡每个频段上的接入客户端数量",G_MaximumNumberClnts:"每个频段上允许接入的客户端数必须为 {1} 到 {2} ",G_SettingsLegacySupport:"传统设备支持",G_SettingsEnblLegacyDevice:"启用传统设备支持(例如:11b)",G_SettingsAdvancedOpts:"高级选项",G_SettingsNameSSID:"名称/SSID",G_SettingsWEP:"WEP",G_SettingsWPAPersonal:"WPA-个人",G_SettingsWPAEnterprise:"WPA-企业",G_SettingsGuestPolicy:"来宾策略",G_SettingsApplyGuestPolicies:"套用来宾策略 (网页认证, 来宾身份验证, 接入)",G_SettingsWirelessNetworks:"无线网络",G_SettingsWLANGroup:"WLAN 群组",G_SettingsAddWLANGroup:"新增 WLAN 群组",G_SettingsEditWLANGroup:"编辑 WLAN 群组",G_SettingsRadio:"无线广播",G_Settings2G802:"2G (802.11n/g)",G_Settings5G802:"5G (802.11n/a)",G_SettingsDFS:"(dfs)",G_SettingsWEPKey:"WEP 密钥",G_SettingsKeyIndex:"密钥索引",G_SettingsSecurityKey:"安全密钥",G_SettingsRadiusServer:"RADIUS 验证服务器",G_SettingsRadiusAccountingServer:"RADIUS 计费服务器",G_SettingsVLAN:"VLAN",G_SettingsUseVLANId:"使用 VLAN ID",G_SettingsVLANId:"VLAN ID",G_SettingsHideSSID:"隐藏 SSID",G_SettingsWPAMode:"WPA 模式",G_SettingsEnableWLANSchedule:"启用 WLAN 日程表",G_SettingsScheduled:"日程表",G_SettingsWLANSchedule:"WLAN 日程表",G_SettingsScheduleHours:"时间",G_SettingsEnableUAPSD:"启用非排程自动省电模式（UAPSD）",G_SettingsUAPSD:"UAPSD",G_SettingsNetworks:"网络",G_SettingsCreateNewNetwork:"创建新网络",G_SettingsEditNetwork:"编辑网络",G_SettingsPurpose:"用途",G_SettingsPurposeCorporate:"企业",G_SettingsPurposeGuest:"来宾",G_SettingsPurposeRemoteUserVPN:"远程用户 VPN",G_SettingsPurposeSiteToSiteVPN:"站点到站点 VPN",G_SettingsPurposeVoip:"VoIP语音",G_SettingsPurposeVlanOnly:"纯 VLAN ",G_SettingsIPSubnet:"IP/子网",G_SettingsSubnet:"子网",G_SettingsDHCPServer:"DHCP 服务器",G_SettingsEnableDHCPServer:"启用 DHCP 服务器",G_SettingsDHCPRange:"DHCP 范围",G_SettingsDHCPRangeStart:"DHCP 范围 (开始)",G_SettingsDHCPRangeEnd:"DHCP 范围 (结束)",G_SettingsDHCPDHCPGuarding:"DHCP 防护",G_SettingsEnableDHCPGuarding:"启用 DHCP 防护",G_SettingsDHCPTrustedServerIp:"信任的 DHCP 服务器 IP",G_SettingsIPPool:"IP 地址池",G_SettingsIPStart:"IP 范围 (开始)",G_SettingsIPEnd:"IP 范围 (开始)",G_SettingsRemoteSite:"远程站点",G_SettingsNetworkEnabled:"{1} 已启用",G_SettingsNetworkDisabled:"{1} 已禁用",G_SettingNetworksUpdateDHCPRange:"更新 DHCP 范围",G_SettingsRadiusIP:"RADIUS IP",G_SettingsRadiusPassword:"RADIUS 密码",G_SettingsExposedToVPN:"站点到站点 VPN",G_SettingsExposedToSiteToSiteVPN:"Exposed to Site-to-Site VPN",G_SettingsGuestPW:"来宾密码",G_SettingsGuestCtrl:"来宾控制",G_SettingsGuestPolicies:"来宾策略",G_SettingsEnblGuestPortal:"启用来宾 Portal",G_SettingsNoAuth:"无需验证",G_SettingsSimplePW:"简单密码",G_SettingsHotspot:"热点",G_SettingsExtPortalServer:"外部 Portal 服务器",G_SettingsLandingPage:"页面登录后",G_SettingsRedirectOriginalURL:"跳转到原始 URL",G_SettingsPromoURL:"广告 URL",G_SettingsPortalCustomization:"自定义 Portal ",G_SettingsEnblPortalCustomization:"启用自定义 Portal",G_SettingsPortalURLHostname:"Portal URL 主机名称",G_SettingsRediectHostname:"跳转使用主机名称",G_SettingsVoucher:"凭证",G_SettingsEnblVoucherAuth:"启用基于凭证的身份验证",G_SettingsPayment:"在线支付",G_SettingsEnblPaymentAuth:"启用基于在线支付的身份验证",G_SettingsGateway:"网关",G_SettingsStripe:"Stripe (US, Canada)",G_SettingsPayPal:"PayPal",G_SettingsPaypalWebPaymentPro:"PayPal Website Payment Pro (US, Canada, UK)",G_SettingsQuickPay:"Quickpay (Europe)",G_SettingsAuthorizenet:"Authorize.Net (US, Canada)",G_SettingsMerchantWarrior:"Merchant Warrior (Australia, New Zealand)",G_SettingsIPpay:"IPpay (US, Canada)",G_SettingsAPIKey:"API 密钥",G_SettingsHopspotOp:"热点操作员",G_SettingsGoToHotpotMgr:"跳转到热点管理页面",G_SettingsAccessCntrl:"接入控制",G_SettingsRestrictedSubnets:"限制子网",G_SettingsAllowedSubnets:"开放子网",G_SettingsUserDefined:"用户自定义",G_SettingsCustomPortal:"自定义 Portal",G_SettingsUsePayPalSandbox:"使用 PayPal Sandbox",G_SettingsApplySandboxAccount:"应用 Sandbox 帐户",G_SettingsMerchantId:"Merchant ID",G_SettingsMerchantUuid:"Merchant UUID",G_SetttingsMD5Secret:"MD5 加密",G_SettingsAPILoginId:"API 登录 ID",G_SettingsAPIPassphrase:"API 口令",G_SettingsTransactionKey:"交易密钥",G_SettingsTerminalId:"终端 ID",G_SettingsUseTestAccount:"使用测试帐户",G_SettingsApplyTestAccount:"应用测试帐户",G_SettingsVoip:"VoIP",G_SettingsVoipIsEnabled:"VoIP",G_SettingsVoipEnable:"启用 VoIP 功能",G_SettingsVoipUpdateCache:"升级映像档高速缓存",G_SettingsVoipUpdateCacheEnable:"启用网络电话升级映像档高速缓存",G_SettingsPhoneAdopt:"采用电话",G_SettingsPhoneAutoAdopt:"自动采用搜索到的电话",G_SettingsProvider:"VOIP 提供商",G_SettingsSipServer:"SIP 服务器",G_SettingsSipAuth:"SIP 验证方式",G_SettingsSipAuthName:"验证 ID",G_SettingsSipProxy:"外发代理",G_SettingsSipVoicemailURL:"SIP 语音信箱",G_SettingsSipVoicemailURLTitle:"来自 SIP 提供商的语音信箱 URL 或号码",G_SettingsSipUsername:"SIP 用户名",G_SettingsSipPassword:"SIP 密码",G_SettingsProviderSetup:"提供商设置",G_SettingsProviderExternal:"外部",G_SettingsProviderExternalNote:"提供您自己的 PBX. 利用 UniFi 来批量管理电话",G_SettingsProviderAuthUser:"基于使用者 (较常见)",G_SettingsProviderAuthIP:"基于 IP",G_SettingsCreateNewNumber:"创建一个新号码",G_SettingsEditNumber:"编辑号码",G_SettingsVoipGlobal:"全球",G_SettingsVoipNumber:"号码",G_SettingsVoipExtension:"分机",G_SettingsVoipType:"类型",G_SettingsVoipExtPhone:"电话",G_SettingsVoipExtPhoneUnassigned:"未指定",G_SettingsNumberManage:"管理",G_SettingsNumberRefresh:"刷新",G_SettingsNumberAdd:"添加",G_SettingsExtensions:"分机",G_SettingsExtensionImport:"导入",G_SettingsCreateNewExtension:"创建新分机",G_SettingsEditExtension:"编辑分机",G_SettingsExtPhone:"电话",G_SettingsExtMembers:"号码",G_SettingsExtMembersPlaceholder:"输入名称或邮箱地址",G_Properties:"属性",G_PropertiesOverview:"概述",G_PropertiesDetails:"详情",G_PropertiesConfiguration:"配置",G_PropertiesMACAddress:"MAC 地址",G_PropertiesAlias:"别名",G_PropertiesRadios:"无线广播",G_PropertiesWLANS:"Wlans",G_PropertiesPotentialUplinks:"可用上行链接",G_PropertiesWirelessUplinks:"无线上行链接",G_PropertiesForgetAP:"移除该 AP",G_PropertiesConfigIP:"配置 IP",G_PropertiesUsingDHCP:"使用 DHCP",G_PropertiesStaticIP:"静态 IP",G_PropertiesNoWirelssUplnks:"没有可用的无线上行链接",G_PropertiesForgetDeviceConfirmTitle:"请确认移除设备",G_PropertiesForgetDeviceConfirmTxt:"您确定要从系统中移除该设备? UniFi 将不能再管理该设备并且该设备会因此恢复到出厂状态.",G_PropertiesMoveDeviceConfirmTitle:"请确认移动设备",G_PropertiesMoveDeviceConfirmTxt:"您确定要将该设备移动到站点 {1} 中? 注意所有关于此设备的配置及历史记录也都将会清除.",G_PropertiesCopyDeviceConfigConfirmTitle:"确认复制配置",G_PropertiesCopyDeviceConfigConfirmTxt:"您确定要将 {1} 的配置覆写到这台设备上吗?",G_PropertiesForget:"移除",G_PropertiesForgetAPTxt:" 如果您不希望再管理此 AP, 您可以点击移除, 注意所有关于此 AP 的配置及历史记录也都将会清除.",G_PropertiesUplink:"上行链接",G_PropertiesBlocked:"被封锁的",G_PropertiesUplinkAP:"上行链接 AP",G_PropertiesSignal:"信号",G_PropertiesTXRate:"发送速率",G_PropertiesRXRate:"接收速率",G_PropertiesDuplex:"双工",G_PropertiesFullDuplexAbbrv:"FDX",G_PropertiesHalfDuplexAbbrv:"HDX",G_PropertiesDownPktsBytes:"下行封包数/字节数",G_PropertiesUpPktsBytes:"上行封包数/字节数",G_PropertiesAdvancedOpts:"高级选项",G_PropertiesInformURL:"通知 URL",G_PropertiesUplinks:"上行链接",G_PropertiesDownlinks:"下行链接",G_PropertiesRadio11NBG:"无线广播 (11N/B/G)",G_PropertiesTransmitPower:"发射功率",G_PropertiesTXPktsBytes:"发送封包数/字节数",G_PropertiesRXPktsBytes:"接收封包数/字节数",G_PropertiesTXRetryDropped:"发送重试/丢包",G_PropertiesRXRetryDropped:"接收重试/丢包",G_PropertiesRadio11NA:"无线广播 (11N/A)",G_PropertiesRadio11AC:"无线广播 (11N/A/AC)",G_PropertiesNoUsersConnected:"当前没有用户连接到该设备.",G_PropertiesNoGuestsConnected:"当前没有来宾连接到该设备.",G_PropertiesNoHistory:"该客户端当前没有相关的历史记录.",G_PropertiesRadio2G11NBG:"无线广播 2G (11n/b/g)",G_PropertiesHT20:"HT20",G_PropertiesHT40:"HT40",G_PropertiesHT80:"HT80",G_PropertiesTXPower:"发射功率",G_PropertiesDBM:"dBm",G_PropertiesDBI:"dBi",G_PropertiesEIRP:"EIRP",G_PropertiesAntennaGain:"天线增益",G_PropertiesRadio5G11NA:"无线广播 5G (11n/a)",G_PropertiesRadio5G11AC:"无线广播 5G (11n/a/ac)",G_PropertiesWLANS2G11NBG:"WLANs 2G (11n/b/g)",G_PropertiesWLANGroup:"WLAN 群组",G_PropertiesWLANS5G11NA:"WLANs 5G (11n/a)",G_PropertiesWLANS5G11AC:"WLANs 5G (11n/a/ac)",G_2GWLANSDisabled:"* 一个或多个2G WLAN 已全部禁用.",G_5GWLANSDisabled:"* 一个或多个5G WLAN 已全部禁用.",G_PropertiesEnblOnAP:"在该 AP 上启用",G_PropertiesVLAN:"VLAN",G_PropertiesUseVLANId:"使用 VLAN ID",G_PropertiesSSID:"SSID",G_PropertiesPSK:"PSK",G_PropertiesRestore:"恢复",G_PropertiesSubnetMask:"子网掩码",G_PropertiesGateway:"网关",G_PropertiesPreferredDNS:"首选 DNS",G_PropertiesAlternateDNS:"备用 DNS",G_PropertiesDNSSuffix:"DNS 后缀",G_PropertiesHistory:"历史记录",G_PropertiesConnectedAP:"已连接 AP",G_PropertiesESSID:"ESSID",G_PropertiesPowerSave:"省电模式",G_PropertiesUsergroups:"用户限速群组",G_PropertiesAutomatic:"自动",G_PropertiesDebug:"调试",G_PropertiesDeviceType:"设备类型",G_PropertiesReconnect:"重新连接",G_PropertiesUnauthorize:"取消授权",G_PropertiesAuthorize:"授权",G_PropertiesBandSteering:"频段引导",G_PropertiesAirtimeFairness:"占用时长公平性",G_PropertiesEnabledEqual:"已启用(均衡)",G_PropertiesEnabledPrefer5G:"已启用(5G优先)",G_PropertiesNetworks:"网络",G_PropertiesLANIPAddress:"LAN IP 地址",G_PropertiesDownActivity:"下行活跃度",G_PropertiesUpActivity:"上行活跃度",G_PropertiesNumPhones:"电话数量",G_PropertiesNoNetworksConfigured:"无网络配置",G_PropertiesNumHosts:"主机数",G_PropertiesForgetGateway:"移除该网关",G_PropertiesForgetGatewayTxt:"如果您不希望再管理此网关, 可以将其移除, 注意所有关于此网关的配置及历史记录也都将会清除.",G_PropertiesPortForward:"端口转发",G_PropertiesConnectionType:"连接类型",G_PropertiesRouter:"路由器",G_PropertiesPPPoE:"PPPoE",G_PropertiesNoPortForwardingConfigured:"未配置端口转发",G_PropertiesPortFwdSrcAnywhere:"任何地方",G_PropertiesPortFwdSrcLimited:"受限的",G_PropertiesProtocol:"协议",G_PropertiesTcp:"TCP",G_PropertiesUdp:"UDP",G_PropertiesPortForwardDeleteConfirm:"您确定要移除该端口转发规则?",G_PropertiesDynamicDNS:"动态 DNS",G_PropertiesNoDynamicDNSConfigured:"未配置动态DNS",G_PropertiesDDNSService:"服务",G_PropertiesDDNSServiceAfraid:"afraid",G_PropertiesDDNSServiceDnspark:"dnspark",G_PropertiesDDNSServiceDslreports:"dslreports",G_PropertiesDDNSServiceDyndns:"dyndns",G_PropertiesDDNSServiceEasydns:"easydns",G_PropertiesDDNSServiceNamecheap:"namecheap",G_PropertiesDDNSServiceSitelutions:"sitelutions",G_PropertiesDDNSServiceZoneedit:"zoneedit",G_PropertiesDDNSHostname:"主机名",G_PropertiesDDNSUsername:"用户名",G_PropertiesDDNSPassword:"密码",G_PropertiesDDNSServer:"服务器",G_PropertiesDDNSDynamicDNSDeleteConfirm:"您确定要移除该动态 DNS 服务器吗?",G_PropertiesDDNSLastUpdated:"最近更新",G_PropertiesDDNSIp:"IP",G_PropertiesDDNSStatus:"状态",G_PropertiesDDNSStatusGood:"良好",G_PropertiesDDNSStatusUpdating:"更新中",G_PropertiesDDNSStatusFailed:"失败",G_PropertiesNetworksVLANs:"网络/VLAN",G_PropertiesForgetSwitch:"移除该交换机",G_PropertiesForgetSwitchTxt:"如果您不希望再管理此交换机, 可以将其移除, 注意所有关于此交换机的配置及历史记录也都将会清除.",G_PropertiesCopySwitchConfig:"复制配置",G_PropertiesCopySwitchConfigTxt:"您可以将相同交换机的配置复制到这台交换机上.",G_PropertiesNoDownlinksConnected:"当前无下行链接连接到此交换机",G_PropertiesNoPorts:"当前无端口",G_PropertiesDevice:"设备",G_PropertiesPoE:"PoE",G_PropertiesEnableJumboFrame:"启用巨型帧",G_PropertiesEnableFlowControl:"启用流控制",G_PropertiesNetworkGroup:"网络群组",G_PropertiesManagementVLAN:"MGMT VLAN",G_PropertiesEnableSFlow:"启用 sFlow",G_PropertiesServerIp:"服务器 IP",G_PropertiesNoNetworksVLANsConfigured:"没有配置网络或者 VLAN ",G_PropertiesNetworkDeleteConfirm:"您确保要删除该网络?",G_PropertiesNative:"本地",G_PropertiesCustomized:"自定义",G_PropertiesTaggedNetworks:"标签网络",G_PropertiesOperation:"操作",G_PropertiesSwitching:"交换",G_PropertiesMirroring:"监控",G_PropertiesMirroringPort:"监控端口",G_PropertiesAggregatedByPort:"聚合端口",G_PropertiesAggregate:"聚合",G_PropertiesAggregatePorts:"聚合端口",G_PropertiesPoEModePassive:"24V (被动)",G_PropertiesPoEModePoEPlus:"PoE+ (自动)",G_PropertiesAutoneg:"链路协商",G_PropertiesAuto:"自动",G_PropertiesManual:"手动",G_PropertiesFullDuplex:"全双工",G_PropertiesSpeed:"链接速率",G_Properties10Mbps:"10 Mbps",G_Properties100Mbps:"100 Mbps",G_Properties1000Mbps:"1000 Mbps",G_PropertiesEnable:"启用",G_BetweenXandY:"在 {1} 和 {2} 之间",G_PropertiesForgetPhone:"移除该电话",G_PropertiesForgetPhoneTxt:"如果您不再希望管理该电话,您可以移除它.注意所有与该电话相关的配置及历史记录也将会被清除掉.",G_HotspotNameMACAddress:"名称 [MAC 地址]",G_HotspotAuthorizedBy:"授权者",G_HotspotGuests:"来宾",G_HotspotPaymentsTransactions:"支付与交易",G_HotspotLastName:"姓",G_HotspotFirstName:"名",G_HotspotExtraInfo:"附加信息",G_HotspotVouchers:"凭证",G_HotspotCode:"凭证代码",G_HotspotCreateTime:"生成时间",G_HotspotNotes:"备注",G_HotspotPrintAllUnusedVouchers:"打印全部未使用的凭证",G_HotspotCreateVouchers:"创建凭证",G_HotspotPrintBatch:"批量打印",G_HotspotCreate:"创建",G_HotspotCount:"Count",G_HotspotDownloadLimit:"下载限制",G_HotspotUploadLimit:"上传限制",G_HotspotByteQuota:"流量限额",G_HotspotExpireValue:"过期值",G_HotspotOnetime:"单次有效",G_HotspotMultiuse:"多次有效",G_HotspotVouchersFor:"凭证有效期",G_HotspotVouchersQuota:"流量限额",G_HotspotUserDefined:"自定义",G_HotspotOperatorAccounts:"操作员帐户",G_HotspotCreateOperator:"创建操作员",G_HotspotCreateNewOperator:"创建新的操作员",G_HotspotOpenOperatorLogin:"打开操作员登录页面",G_HotspotAccountName:"帐户名称",G_HotspotManagerLogin:"热点管理员登录",G_HotspotLogin:"登录",G_HotspotChrome:"Chrome",G_HotspotFirefox:"Firefox",G_HotspotExpired:"过期",G_HotspotValidUntil:"有效期至",E_InvalidUNPW:"用户名或密码不正确",E_InvalidSite:"在登录 url 中未定义站点名称，请修改 url 后再试一次",G_HotspotNavGuests:"来宾",G_HotspotNavPayments:"支付",G_HotspotNavVouchers:"凭证",G_HotspotNavOperators:"操作员",G_Alerts:"警示",G_AlertsShowArchivedAlerts:"显示已归档的警示",G_AlertsArchiveAll:"全部归档",G_AlertsArchive:"归档",G_AlertsSystem:"系统",G_AlertsDevice:"设备",G_EventLan:"LAN",G_EventWlan:"WLAN",G_EventWan:"WAN",G_EventVoip:"VOIP",G_Events:"事件",G_EventsAll:"全部",G_EventsAdmin:"管理员",G_EventsWithin:"时间范围",G_CalendarMonday:"星期一",G_CalendarTuesday:"星期二",G_CalendarWednesday:"星期三",G_CalendarThursday:"星期四",G_CalendarFriday:"星期五",G_CalendarSaturday:"星期六",G_CalendarSunday:"星期日",Wizard:{G_UniFiSetupWizardTitle:"UniFi 设置向导",G_WelcomeMessage:"非常感谢您购买 Ubiquiti 企业级产品. 您将在几分钟内完成控制器的设置.",G_Back:"返回",G_Skip:"跳过",G_Next:"下一步",G_Welcome:"欢迎",G_Discover:"发现",G_Wireless:"无线",G_Password:"密码",G_Finish:"完成",G_WelcomeSelectLanguage:"请选择您的首选语言",G_WelcomeSelectCountry:"选择您的国家",G_WelcomeSelectTimezone:"选择您的时区",G_WelcomeRestoreLinkPrefix:"您还可以",G_WelcomeRestoreLinkText:"从之前的备份中恢复",G_Refresh:"刷新",G_DiscoverMessage:"请选择您要配置的设备.",G_WirelessMessage:"关于无线网络, 本安装向导可为您创建一个安全的简单无线网络. 在下面输入您想要使用的无线设置:",G_WirelessMessageSkip:"如果还没有安装 UniFi AP 的话, 您可以先跳过该步骤.",G_WirelessSecureSsid:"安全 SSID",G_WirelessSecureSsidTitle:"SSID 只能是可打印的 ASCII 字符",G_WirelessSecurityKey:"安全密钥",G_WirelessSecurityKeyTitle:"安全密钥至少要有 8 个字符",G_WirelessOptionMessage:"如果有需要，还可以为您的来宾创建一个不加密的无线网络",G_WirelessEnableGuestAccess:"启用来宾接入",G_WirelessGuestSsid:"来宾 SSID",G_PasswordMessage:"请提供一个管理员名称和密码来登录 UniFi 控制器.",G_PasswordAdminName:"管理员名称",G_PasswordAdminNameTitle:"模板只能是 A-Z, a-z, 0-9 或 _.- 但是不能以 .- 开头",G_ConfirmPassword:"确认密码",G_FinishMessage:'请再确认以下设置, 点击"退回"来修改设置或点击"完成"来激活设置. 完成后您将会被跳转到管理界面.',E_PasswordRequired:"必须填入密码",E_PasswordsDontMatch:"密码不匹配",E_SsidAlphanumeric:"ssid 必须为可打印的字母或数字",E_SsidPasswordLength:"密码长度必须为 8 到 63 位的字符",E_AdminNameAlphanumeric:"管理员名称必须是字母或数字",E_NoDevicesMsg:"未发现任何设备.",E_NoDevicesInstructions:"请先确保所有设备在同一个二层/交换网络中后再试一次.",N_Restoring:"备份文件已加载, 控制器正在重新启动, 请稍候.",N_NoSSID:"未设置 SSID "},E_BetaQuotaReached:"UniFi 云还在内测期间目前仅限于受邀请用户, 敬请持续关注.",G_Back:"退回",G_PleaseLogin:"请登录",E_InvalidLogin:"无效的用户名和密码",G_RecoverMessage:"密码重置邮件已发送",G_ForgotPassword:"忘了密码?",G_EnterEmailAddress:"请输入您的用户名来重置您的密码",G_ResetPassword:"重置密码",E_WontWork:"这将无法正常工作.",E_WontWorkDetail:"Internet Explorer 8 以及更早版本当前无法兼容我们的部分 UI<br/>功能. 请先用其他网页浏览器再试一次."}),define("msg/Msg",["i18n!msg/nls/Api","jquery"],function(e,t){"use strict";
var i=e;return i.apiError=function(t,i){var n;if(t.responseText)try{var s=JSON.parse(t.responseText).meta;if(n=e[s.msg.replace("api.err.","E_")],n&&i===!0){for(var o,a=/{(\w+)}/g,r=n;o=a.exec(n);)s[o[1]]&&(r=r.replace(o[0],s[o[1]]));n=r}}catch(l){n=e.E_InvalidResponse}else n=t.statusText;return n||e.E_UnspecifiedError},i.localize=function(e){var t=[].slice.call(arguments,1),i=t.length;if(i)for(var n=0;i>n;n++)e=e.replace(/{[0-9]+}/,this.sanitize(t[n]));return e},i.sanitize=function(e){return t("<div />").text(e).html()},i});var XRegExp;XRegExp=XRegExp||function(e){"use strict";function t(e,t,i){var n;for(n in c.prototype)c.prototype.hasOwnProperty(n)&&(e[n]=c.prototype[n]);return e.xregexp={captureNames:t,isNative:!!i},e}function i(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function n(e,n,s){if(!c.isRegExp(e))throw new TypeError("type RegExp expected");var o=f.replace.call(i(e)+(n||""),C,"");return s&&(o=f.replace.call(o,new RegExp("["+s+"]+","g"),"")),e=e.xregexp&&!e.xregexp.isNative?t(c(e.source,o),e.xregexp.captureNames?e.xregexp.captureNames.slice(0):null):t(new RegExp(e.source,o),null,!0)}function s(e,t){var i=e.length;if(Array.prototype.lastIndexOf)return e.lastIndexOf(t);for(;i--;)if(e[i]===t)return i;return-1}function o(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object "+t+"]"}function a(e){return e=e||{},"all"===e||e.all?e={natives:!0,extensibility:!0}:o(e,"string")&&(e=c.forEach(e,/[^\s,]+/,function(e){this[e]=!0},{})),e}function r(e,t,i,n){var s,o,a=_.length,r=null;D=!0;try{for(;a--;)if(o=_[a],!("all"!==o.scope&&o.scope!==i||o.trigger&&!o.trigger.call(n))&&(o.pattern.lastIndex=t,s=m.exec.call(o.pattern,e),s&&s.index===t)){r={output:o.handler.call(n,s,i),match:s};break}}catch(l){throw l}finally{D=!1}return r}function l(e){c.addToken=d[e?"on":"off"],p.extensibility=e}function u(e){RegExp.prototype.exec=(e?m:f).exec,RegExp.prototype.test=(e?m:f).test,String.prototype.match=(e?m:f).match,String.prototype.replace=(e?m:f).replace,String.prototype.split=(e?m:f).split,p.natives=e}var c,d,h,p={natives:!1,extensibility:!1},f={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},m={},g={},_=[],v="default",b="class",A={"default":/^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/,"class":/^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/},y=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,C=/([\s\S])(?=[\s\S]*\1)/g,F=/^(?:[?*+]|{\d+(?:,\d*)?})\??/,w=f.exec.call(/()??/,"")[1]===e,E=RegExp.prototype.sticky!==e,D=!1,S="gim"+(E?"y":"");return c=function(i,s){if(c.isRegExp(i)){if(s!==e)throw new TypeError("can't supply flags when constructing one RegExp from another");return n(i)}if(D)throw new Error("can't call the XRegExp constructor within token definition functions");var o,a,l,u=[],d=v,h={hasNamedCapture:!1,captureNames:[],hasFlag:function(e){return s.indexOf(e)>-1}},p=0;if(i=i===e?"":String(i),s=s===e?"":String(s),f.match.call(s,C))throw new SyntaxError("invalid duplicate regular expression flag");for(i=f.replace.call(i,/^\(\?([\w$]+)\)/,function(e,t){if(f.test.call(/[gy]/,t))throw new SyntaxError("can't use flag g or y in mode modifier");return s=f.replace.call(s+t,C,""),""}),c.forEach(s,/[\s\S]/,function(e){if(S.indexOf(e[0])<0)throw new SyntaxError("invalid regular expression flag "+e[0])});p<i.length;)o=r(i,p,d,h),o?(u.push(o.output),p+=o.match[0].length||1):(a=f.exec.call(A[d],i.slice(p)),a?(u.push(a[0]),p+=a[0].length):(l=i.charAt(p),"["===l?d=b:"]"===l&&(d=v),u.push(l),++p));return t(new RegExp(u.join(""),f.replace.call(s,/[^gimy]+/g,"")),h.hasNamedCapture?h.captureNames:null)},d={on:function(e,t,i){i=i||{},e&&_.push({pattern:n(e,"g"+(E?"y":"")),handler:t,scope:i.scope||v,trigger:i.trigger||null}),i.customFlags&&(S=f.replace.call(S+i.customFlags,C,""))},off:function(){throw new Error("extensibility must be installed before using addToken")}},c.addToken=d.off,c.cache=function(e,t){var i=e+"/"+(t||"");return g[i]||(g[i]=c(e,t))},c.escape=function(e){return f.replace.call(e,/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},c.exec=function(e,t,i,s){var o,a=n(t,"g"+(s&&E?"y":""),s===!1?"y":"");return a.lastIndex=i=i||0,o=m.exec.call(a,e),s&&o&&o.index!==i&&(o=null),t.global&&(t.lastIndex=o?a.lastIndex:0),o},c.forEach=function(e,t,i,n){for(var s,o=0,a=-1;s=c.exec(e,t,o);)i.call(n,s,++a,e,t),o=s.index+(s[0].length||1);return n},c.globalize=function(e){return n(e,"g")},c.install=function(e){e=a(e),!p.natives&&e.natives&&u(!0),!p.extensibility&&e.extensibility&&l(!0)},c.isInstalled=function(e){return!!p[e]},c.isRegExp=function(e){return o(e,"regexp")},c.matchChain=function(e,t){return function i(e,n){var s,o=t[n].regex?t[n]:{regex:t[n]},a=[],r=function(e){a.push(o.backref?e[o.backref]||"":e[0])};for(s=0;s<e.length;++s)c.forEach(e[s],o.regex,r);return n!==t.length-1&&a.length?i(a,n+1):a}([e],0)},c.replace=function(t,i,s,o){var a,r=c.isRegExp(i),l=i;return r?(o===e&&i.global&&(o="all"),l=n(i,"all"===o?"g":"","all"===o?"":"g")):"all"===o&&(l=new RegExp(c.escape(String(i)),"g")),a=m.replace.call(String(t),l,s),r&&i.global&&(i.lastIndex=0),a},c.split=function(e,t,i){return m.split.call(e,t,i)},c.test=function(e,t,i,n){return!!c.exec(e,t,i,n)},c.uninstall=function(e){e=a(e),p.natives&&e.natives&&u(!1),p.extensibility&&e.extensibility&&l(!1)},c.union=function(e,t){var i,n,s,a,r=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,l=0,u=function(e,t,s){var o=n[l-i];if(t){if(++l,o)return"(?<"+o+">"}else if(s)return"\\"+(+s+i);return e},d=[];if(!o(e,"array")||!e.length)throw new TypeError("patterns must be a nonempty array");for(a=0;a<e.length;++a)s=e[a],c.isRegExp(s)?(i=l,n=s.xregexp&&s.xregexp.captureNames||[],d.push(c(s.source).source.replace(r,u))):d.push(c.escape(s));return c(d.join("|"),t)},c.version="2.0.0",m.exec=function(t){var n,o,a,r,l;if(this.global||(r=this.lastIndex),n=f.exec.apply(this,arguments)){if(!w&&n.length>1&&s(n,"")>-1&&(a=new RegExp(this.source,f.replace.call(i(this),"g","")),f.replace.call(String(t).slice(n.index),a,function(){var t;for(t=1;t<arguments.length-2;++t)arguments[t]===e&&(n[t]=e)})),this.xregexp&&this.xregexp.captureNames)for(l=1;l<n.length;++l)o=this.xregexp.captureNames[l-1],o&&(n[o]=n[l]);this.global&&!n[0].length&&this.lastIndex>n.index&&(this.lastIndex=n.index)}return this.global||(this.lastIndex=r),n},m.test=function(e){return!!m.exec.call(this,e)},m.match=function(e){if(c.isRegExp(e)){if(e.global){var t=f.match.apply(this,arguments);return e.lastIndex=0,t}}else e=new RegExp(e);return m.exec.call(e,this)},m.replace=function(e,t){var i,n,a,r,l=c.isRegExp(e);return l?(e.xregexp&&(i=e.xregexp.captureNames),e.global||(r=e.lastIndex)):e+="",o(t,"function")?n=f.replace.call(String(this),e,function(){var n,s=arguments;if(i)for(s[0]=new String(s[0]),n=0;n<i.length;++n)i[n]&&(s[0][i[n]]=s[n+1]);return l&&e.global&&(e.lastIndex=s[s.length-2]+s[0].length),t.apply(null,s)}):(a=String(this),n=f.replace.call(a,e,function(){var e=arguments;return f.replace.call(String(t),y,function(t,n,o){var a;if(n){if(a=+n,a<=e.length-3)return e[a]||"";if(a=i?s(i,n):-1,0>a)throw new SyntaxError("backreference to undefined group "+t);return e[a+1]||""}if("$"===o)return"$";if("&"===o||0===+o)return e[0];if("`"===o)return e[e.length-1].slice(0,e[e.length-2]);if("'"===o)return e[e.length-1].slice(e[e.length-2]+e[0].length);if(o=+o,!isNaN(o)){if(o>e.length-3)throw new SyntaxError("backreference to undefined group "+t);return e[o]||""}throw new SyntaxError("invalid token "+t)})})),l&&(e.lastIndex=e.global?0:r),n},m.split=function(t,i){if(!c.isRegExp(t))return f.split.apply(this,arguments);var n,s=String(this),o=t.lastIndex,a=[],r=0;return i=(i===e?-1:i)>>>0,c.forEach(s,t,function(e){e.index+e[0].length>r&&(a.push(s.slice(r,e.index)),e.length>1&&e.index<s.length&&Array.prototype.push.apply(a,e.slice(1)),n=e[0].length,r=e.index+n)}),r===s.length?(!f.test.call(t,"")||n)&&a.push(""):a.push(s.slice(r)),t.lastIndex=o,a.length>i?a.slice(0,i):a},h=d.on,h(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,function(e,t){if("B"===e[1]&&t===v)return e[0];throw new SyntaxError("invalid escape "+e[0])},{scope:"all"}),h(/\[(\^?)]/,function(e){return e[1]?"[\\s\\S]":"\\b\\B"}),h(/(?:\(\?#[^)]*\))+/,function(e){return f.test.call(F,e.input.slice(e.index+e[0].length))?"":"(?:)"}),h(/\\k<([\w$]+)>/,function(e){var t=isNaN(e[1])?s(this.captureNames,e[1])+1:+e[1],i=e.index+e[0].length;if(!t||t>this.captureNames.length)throw new SyntaxError("backreference to undefined group "+e[0]);return"\\"+t+(i===e.input.length||isNaN(e.input.charAt(i))?"":"(?:)")}),h(/(?:\s+|#.*)+/,function(e){return f.test.call(F,e.input.slice(e.index+e[0].length))?"":"(?:)"},{trigger:function(){return this.hasFlag("x")},customFlags:"x"}),h(/\./,function(){return"[\\s\\S]"},{trigger:function(){return this.hasFlag("s")},customFlags:"s"}),h(/\(\?P?<([\w$]+)>/,function(e){if(!isNaN(e[1]))throw new SyntaxError("can't use integer as capture name "+e[0]);return this.captureNames.push(e[1]),this.hasNamedCapture=!0,"("}),h(/\\(\d+)/,function(e,t){if(!(t===v&&/^[1-9]/.test(e[1])&&+e[1]<=this.captureNames.length)&&"0"!==e[1])throw new SyntaxError("can't use octal escape or backreference to undefined group "+e[0]);return e[0]},{scope:"all"}),h(/\((?!\?)/,function(){return this.hasFlag("n")?"(?:":(this.captureNames.push(null),"(")},{customFlags:"n"}),"undefined"!=typeof exports&&(exports.XRegExp=c),c}(),function(e){"use strict";function t(e){return e.replace(/[- _]+/g,"").toLowerCase()}function i(e){return e.replace(/\w{4}/g,"\\u$&")}function n(e){for(;e.length<4;)e="0"+e;return e}function s(e){return parseInt(e,16)}function o(e){return parseInt(e,10).toString(16)}function a(t){var i,a=[],r=-1;return e.forEach(t,/\\u(\w{4})(?:-\\u(\w{4}))?/,function(e){i=s(e[1]),i>r+1&&(a.push("\\u"+n(o(r+1))),i>r+2&&a.push("-\\u"+n(o(i-1)))),r=s(e[2]||e[1])}),65535>r&&(a.push("\\u"+n(o(r+1))),65534>r&&a.push("-\\uFFFF")),a.join("")}function r(e){return l["^"+e]||(l["^"+e]=a(l[e]))}var l={};e.install("extensibility"),e.addUnicodePackage=function(n,s){var o;if(!e.isInstalled("extensibility"))throw new Error("extensibility must be installed before adding Unicode packages");if(n)for(o in n)n.hasOwnProperty(o)&&(l[t(o)]=i(n[o]));if(s)for(o in s)s.hasOwnProperty(o)&&(l[t(s[o])]=l[t(o)])},e.addUnicodePackage({L:"0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05270531-055605590561-058705D0-05EA05F0-05F20620-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280840-085808A008A2-08AC0904-0939093D09500958-09610971-09770979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10CF10CF20D05-0D0C0D0E-0D100D12-0D3A0D3D0D4E0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC-0EDF0F000F40-0F470F49-0F6C0F88-0F8C1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510C710CD10D0-10FA10FC-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1BBA-1BE51C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11CF51CF61D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209C21022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2CF22CF32D00-2D252D272D2D2D30-2D672D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31BA31F0-31FF3400-4DB54E00-9FCCA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78B-A78EA790-A793A7A0-A7AAA7F8-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDAAE0-AAEAAAF2-AAF4AB01-AB06AB09-AB0EAB11-AB16AB20-AB26AB28-AB2EABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC"},{L:"Letter"}),e.addToken(/\\([pP]){(\^?)([^}]*)}/,function(e,i){var n="P"===e[1]||e[2]?"^":"",s=t(e[3]);if("P"===e[1]&&e[2])throw new SyntaxError("invalid double negation \\P{^");if(!l.hasOwnProperty(s))throw new SyntaxError("invalid or unknown Unicode property "+e[0]);return"class"===i?n?r(s):l[s]:"["+n+l[s]+"]"},{scope:"all"})}(XRegExp),function(e){"use strict";if(!e.addUnicodePackage)throw new ReferenceError("Unicode Base must be loaded before Unicode Categories");e.install("extensibility"),e.addUnicodePackage({Ll:"0061-007A00B500DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F05210523052505270561-05871D00-1D2B1D6B-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7B2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2CF32D00-2D252D272D2DA641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA661A663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CA78EA791A793A7A1A7A3A7A5A7A7A7A9A7FAFB00-FB06FB13-FB17FF41-FF5A",Lu:"0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E05200522052405260531-055610A0-10C510C710CD1E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CED2CF2A640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA660A662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BA78DA790A792A7A0A7A2A7A4A7A6A7A8A7AAFF21-FF3A",Lt:"01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",Lm:"02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D6A1D781D9B-1DBF2071207F2090-209C2C7C2C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A7F8A7F9A9CFAA70AADDAAF3AAF4FF70FF9EFF9F",Lo:"00AA00BA01BB01C0-01C3029405D0-05EA05F0-05F20620-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150840-085808A008A2-08AC0904-0939093D09500958-09610972-09770979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10CF10CF20D05-0D0C0D0E-0D100D12-0D3A0D3D0D4E0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC-0EDF0F000F40-0F470F49-0F6C0F88-0F8C1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA10FD-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1BBA-1BE51C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF11CF51CF62135-21382D30-2D672D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31BA31F0-31FF3400-4DB54E00-9FCCA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCAAE0-AAEAAAF2AB01-AB06AB09-AB0EAB11-AB16AB20-AB26AB28-AB2EABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",M:"0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065F067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0859-085B08E4-08FE0900-0903093A-093C093E-094F0951-0957096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F8D-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135D-135F1712-17141732-1734175217531772177317B4-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAD1BE6-1BF31C24-1C371CD0-1CD21CD4-1CE81CED1CF2-1CF41DC0-1DE61DFC-1DFF20D0-20F02CEF-2CF12D7F2DE0-2DFF302A-302F3099309AA66F-A672A674-A67DA69FA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1AAEB-AAEFAAF5AAF6ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26",Mn:"0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065F067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0859-085B08E4-08FE0900-0902093A093C0941-0948094D0951-095709620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F8D-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135D-135F1712-17141732-1734175217531772177317B417B517B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91BAB1BE61BE81BE91BED1BEF-1BF11C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1CF41DC0-1DE61DFC-1DFF20D0-20DC20E120E5-20F02CEF-2CF12D7F2DE0-2DFF302A-302D3099309AA66FA674-A67DA69FA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1AAECAAEDAAF6ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26",Mc:"0903093B093E-09400949-094C094E094F0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1BAC1BAD1BE71BEA-1BEC1BEE1BF21BF31C24-1C2B1C341C351CE11CF21CF3302E302FA823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BAAEBAAEEAAEFAAF5ABE3ABE4ABE6ABE7ABE9ABEAABEC",Me:"0488048920DD-20E020E2-20E4A670-A672",N:"0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0B72-0B770BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293248-324F3251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",Nd:"0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19D91A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",Nl:"16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",No:"00B200B300B900BC-00BE09F4-09F90B72-0B770BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F919DA20702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293248-324F3251-325F3280-328932B1-32BFA830-A835",P:"0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100A700AB00B600B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E085E0964096509700AF00DF40E4F0E5A0E5B0F04-0F120F140F3A-0F3D0F850FD0-0FD40FD90FDA104A-104F10FB1360-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A194419451A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601BFC-1BFF1C3B-1C3F1C7E1C7F1CC0-1CC71CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2D702E00-2E2E2E30-2E3B3001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFAAF0AAF1ABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65",Pd:"002D058A05BE140018062010-20152E172E1A2E3A2E3B301C303030A0FE31FE32FE58FE63FF0D",Ps:"0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",Pe:"0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",Pi:"00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",Pf:"00BB2019201D203A2E032E052E0A2E0D2E1D2E21",Pc:"005F203F20402054FE33FE34FE4D-FE4FFF3F",Po:"0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100A700B600B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E085E0964096509700AF00DF40E4F0E5A0E5B0F04-0F120F140F850FD0-0FD40FD90FDA104A-104F10FB1360-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A194419451A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601BFC-1BFF1C3B-1C3F1C7E1C7F1CC0-1CC71CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2D702E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E30-2E393001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFAAF0AAF1ABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65",S:"0024002B003C-003E005E0060007C007E00A2-00A600A800A900AC00AE-00B100B400B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F60482058F0606-0608060B060E060F06DE06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0D790E3F0F01-0F030F130F15-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F1390-139917DB194019DE-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B9210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23F32400-24262440-244A249C-24E92500-26FF2701-27672794-27C427C7-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-324732503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FBB2-FBC1FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD",Sm:"002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C21182140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC",Sc:"002400A2-00A5058F060B09F209F309FB0AF10BF90E3F17DB20A0-20B9A838FDFCFE69FF04FFE0FFE1FFE5FFE6",Sk:"005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFBB2-FBC1FF3EFF40FFE3",So:"00A600A900AE00B00482060E060F06DE06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0D790F01-0F030F130F15-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F1390-1399194019DE-19FF1B61-1B6A1B74-1B7C210021012103-210621082109211421162117211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23F32400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26FF2701-27672794-27BF2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-324732503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD",Z:"002000A01680180E2000-200A20282029202F205F3000",Zs:"002000A01680180E2000-200A202F205F3000",Zl:"2028",Zp:"2029",C:"0000-001F007F-009F00AD03780379037F-0383038B038D03A20528-05300557055805600588058B-058E059005C8-05CF05EB-05EF05F5-0605061C061D06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F085C085D085F-089F08A108AD-08E308FF097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B78-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D3B0D3C0D450D490D4F-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EE0-0EFF0F480F6D-0F700F980FBD0FCD0FDB-0FFF10C610C8-10CC10CE10CF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B135C137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BF4-1BFB1C38-1C3A1C4A-1C4C1C80-1CBF1CC8-1CCF1CF7-1CFF1DE7-1DFB1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F209D-209F20BA-20CF20F1-20FF218A-218F23F4-23FF2427-243F244B-245F27002B4D-2B4F2B5A-2BFF2C2F2C5F2CF4-2CF82D262D28-2D2C2D2E2D2F2D68-2D6E2D71-2D7E2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E3C-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31BB-31BF31E4-31EF321F32FF4DB6-4DBF9FCD-9FFFA48D-A48FA4C7-A4CFA62C-A63FA698-A69EA6F8-A6FFA78FA794-A79FA7AB-A7F7A82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAF7-AB00AB07AB08AB0FAB10AB17-AB1FAB27AB2F-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBC2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF",Cc:"0000-001F007F-009F",Cf:"00AD0600-060406DD070F200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",Co:"E000-F8FF",Cs:"D800-DFFF",Cn:"03780379037F-0383038B038D03A20528-05300557055805600588058B-058E059005C8-05CF05EB-05EF05F5-05FF0605061C061D070E074B074C07B2-07BF07FB-07FF082E082F083F085C085D085F-089F08A108AD-08E308FF097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B78-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D3B0D3C0D450D490D4F-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EE0-0EFF0F480F6D-0F700F980FBD0FCD0FDB-0FFF10C610C8-10CC10CE10CF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B135C137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BF4-1BFB1C38-1C3A1C4A-1C4C1C80-1CBF1CC8-1CCF1CF7-1CFF1DE7-1DFB1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F209D-209F20BA-20CF20F1-20FF218A-218F23F4-23FF2427-243F244B-245F27002B4D-2B4F2B5A-2BFF2C2F2C5F2CF4-2CF82D262D28-2D2C2D2E2D2F2D68-2D6E2D71-2D7E2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E3C-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31BB-31BF31E4-31EF321F32FF4DB6-4DBF9FCD-9FFFA48D-A48FA4C7-A4CFA62C-A63FA698-A69EA6F8-A6FFA78FA794-A79FA7AB-A7F7A82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAF7-AB00AB07AB08AB0FAB10AB17-AB1FAB27AB2F-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBC2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF"},{Ll:"Lowercase_Letter",Lu:"Uppercase_Letter",Lt:"Titlecase_Letter",Lm:"Modifier_Letter",Lo:"Other_Letter",M:"Mark",Mn:"Nonspacing_Mark",Mc:"Spacing_Mark",Me:"Enclosing_Mark",N:"Number",Nd:"Decimal_Number",Nl:"Letter_Number",No:"Other_Number",P:"Punctuation",Pd:"Dash_Punctuation",Ps:"Open_Punctuation",Pe:"Close_Punctuation",Pi:"Initial_Punctuation",Pf:"Final_Punctuation",Pc:"Connector_Punctuation",Po:"Other_Punctuation",S:"Symbol",Sm:"Math_Symbol",Sc:"Currency_Symbol",Sk:"Modifier_Symbol",So:"Other_Symbol",Z:"Separator",Zs:"Space_Separator",Zl:"Line_Separator",Zp:"Paragraph_Separator",C:"Other",Cc:"Control",Cf:"Format",Co:"Private_Use",Cs:"Surrogate",Cn:"Unassigned"})
}(XRegExp),function(e){"use strict";if(!e.addUnicodePackage)throw new ReferenceError("Unicode Base must be loaded before Unicode Scripts");e.install("extensibility"),e.addUnicodePackage({Arabic:"0600-06040606-060B060D-061A061E0620-063F0641-064A0656-065E066A-066F0671-06DC06DE-06FF0750-077F08A008A2-08AC08E4-08FEFB50-FBC1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFCFE70-FE74FE76-FEFC",Armenian:"0531-05560559-055F0561-0587058A058FFB13-FB17",Balinese:"1B00-1B4B1B50-1B7C",Bamum:"A6A0-A6F7",Batak:"1BC0-1BF31BFC-1BFF",Bengali:"0981-09830985-098C098F09900993-09A809AA-09B009B209B6-09B909BC-09C409C709C809CB-09CE09D709DC09DD09DF-09E309E6-09FB",Bopomofo:"02EA02EB3105-312D31A0-31BA",Braille:"2800-28FF",Buginese:"1A00-1A1B1A1E1A1F",Buhid:"1740-1753",Canadian_Aboriginal:"1400-167F18B0-18F5",Cham:"AA00-AA36AA40-AA4DAA50-AA59AA5C-AA5F",Cherokee:"13A0-13F4",Common:"0000-0040005B-0060007B-00A900AB-00B900BB-00BF00D700F702B9-02DF02E5-02E902EC-02FF0374037E038503870589060C061B061F06400660-066906DD096409650E3F0FD5-0FD810FB16EB-16ED173517361802180318051CD31CE11CE9-1CEC1CEE-1CF31CF51CF62000-200B200E-2064206A-20702074-207E2080-208E20A0-20B92100-21252127-2129212C-21312133-214D214F-215F21892190-23F32400-24262440-244A2460-26FF2701-27FF2900-2B4C2B50-2B592E00-2E3B2FF0-2FFB3000-300430063008-30203030-3037303C-303F309B309C30A030FB30FC3190-319F31C0-31E33220-325F327F-32CF3358-33FF4DC0-4DFFA700-A721A788-A78AA830-A839FD3EFD3FFDFDFE10-FE19FE30-FE52FE54-FE66FE68-FE6BFEFFFF01-FF20FF3B-FF40FF5B-FF65FF70FF9EFF9FFFE0-FFE6FFE8-FFEEFFF9-FFFD",Coptic:"03E2-03EF2C80-2CF32CF9-2CFF",Cyrillic:"0400-04840487-05271D2B1D782DE0-2DFFA640-A697A69F",Devanagari:"0900-09500953-09630966-09770979-097FA8E0-A8FB",Ethiopic:"1200-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A135D-137C1380-13992D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDEAB01-AB06AB09-AB0EAB11-AB16AB20-AB26AB28-AB2E",Georgian:"10A0-10C510C710CD10D0-10FA10FC-10FF2D00-2D252D272D2D",Glagolitic:"2C00-2C2E2C30-2C5E",Greek:"0370-03730375-0377037A-037D038403860388-038A038C038E-03A103A3-03E103F0-03FF1D26-1D2A1D5D-1D611D66-1D6A1DBF1F00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FC41FC6-1FD31FD6-1FDB1FDD-1FEF1FF2-1FF41FF6-1FFE2126",Gujarati:"0A81-0A830A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABC-0AC50AC7-0AC90ACB-0ACD0AD00AE0-0AE30AE6-0AF1",Gurmukhi:"0A01-0A030A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A3C0A3E-0A420A470A480A4B-0A4D0A510A59-0A5C0A5E0A66-0A75",Han:"2E80-2E992E9B-2EF32F00-2FD5300530073021-30293038-303B3400-4DB54E00-9FCCF900-FA6DFA70-FAD9",Hangul:"1100-11FF302E302F3131-318E3200-321E3260-327EA960-A97CAC00-D7A3D7B0-D7C6D7CB-D7FBFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",Hanunoo:"1720-1734",Hebrew:"0591-05C705D0-05EA05F0-05F4FB1D-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FB4F",Hiragana:"3041-3096309D-309F",Inherited:"0300-036F04850486064B-0655065F0670095109521CD0-1CD21CD4-1CE01CE2-1CE81CED1CF41DC0-1DE61DFC-1DFF200C200D20D0-20F0302A-302D3099309AFE00-FE0FFE20-FE26",Javanese:"A980-A9CDA9CF-A9D9A9DEA9DF",Kannada:"0C820C830C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBC-0CC40CC6-0CC80CCA-0CCD0CD50CD60CDE0CE0-0CE30CE6-0CEF0CF10CF2",Katakana:"30A1-30FA30FD-30FF31F0-31FF32D0-32FE3300-3357FF66-FF6FFF71-FF9D",Kayah_Li:"A900-A92F",Khmer:"1780-17DD17E0-17E917F0-17F919E0-19FF",Lao:"0E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB90EBB-0EBD0EC0-0EC40EC60EC8-0ECD0ED0-0ED90EDC-0EDF",Latin:"0041-005A0061-007A00AA00BA00C0-00D600D8-00F600F8-02B802E0-02E41D00-1D251D2C-1D5C1D62-1D651D6B-1D771D79-1DBE1E00-1EFF2071207F2090-209C212A212B2132214E2160-21882C60-2C7FA722-A787A78B-A78EA790-A793A7A0-A7AAA7F8-A7FFFB00-FB06FF21-FF3AFF41-FF5A",Lepcha:"1C00-1C371C3B-1C491C4D-1C4F",Limbu:"1900-191C1920-192B1930-193B19401944-194F",Lisu:"A4D0-A4FF",Malayalam:"0D020D030D05-0D0C0D0E-0D100D12-0D3A0D3D-0D440D46-0D480D4A-0D4E0D570D60-0D630D66-0D750D79-0D7F",Mandaic:"0840-085B085E",Meetei_Mayek:"AAE0-AAF6ABC0-ABEDABF0-ABF9",Mongolian:"1800180118041806-180E1810-18191820-18771880-18AA",Myanmar:"1000-109FAA60-AA7B",New_Tai_Lue:"1980-19AB19B0-19C919D0-19DA19DE19DF",Nko:"07C0-07FA",Ogham:"1680-169C",Ol_Chiki:"1C50-1C7F",Oriya:"0B01-0B030B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3C-0B440B470B480B4B-0B4D0B560B570B5C0B5D0B5F-0B630B66-0B77",Phags_Pa:"A840-A877",Rejang:"A930-A953A95F",Runic:"16A0-16EA16EE-16F0",Samaritan:"0800-082D0830-083E",Saurashtra:"A880-A8C4A8CE-A8D9",Sinhala:"0D820D830D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60DCA0DCF-0DD40DD60DD8-0DDF0DF2-0DF4",Sundanese:"1B80-1BBF1CC0-1CC7",Syloti_Nagri:"A800-A82B",Syriac:"0700-070D070F-074A074D-074F",Tagalog:"1700-170C170E-1714",Tagbanwa:"1760-176C176E-177017721773",Tai_Le:"1950-196D1970-1974",Tai_Tham:"1A20-1A5E1A60-1A7C1A7F-1A891A90-1A991AA0-1AAD",Tai_Viet:"AA80-AAC2AADB-AADF",Tamil:"0B820B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BBE-0BC20BC6-0BC80BCA-0BCD0BD00BD70BE6-0BFA",Telugu:"0C01-0C030C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D-0C440C46-0C480C4A-0C4D0C550C560C580C590C60-0C630C66-0C6F0C78-0C7F",Thaana:"0780-07B1",Thai:"0E01-0E3A0E40-0E5B",Tibetan:"0F00-0F470F49-0F6C0F71-0F970F99-0FBC0FBE-0FCC0FCE-0FD40FD90FDA",Tifinagh:"2D30-2D672D6F2D702D7F",Vai:"A500-A62B",Yi:"A000-A48CA490-A4C6"})}(XRegExp),function(e){"use strict";if(!e.addUnicodePackage)throw new ReferenceError("Unicode Base must be loaded before Unicode Blocks");e.install("extensibility"),e.addUnicodePackage({InBasic_Latin:"0000-007F",InLatin_1_Supplement:"0080-00FF",InLatin_Extended_A:"0100-017F",InLatin_Extended_B:"0180-024F",InIPA_Extensions:"0250-02AF",InSpacing_Modifier_Letters:"02B0-02FF",InCombining_Diacritical_Marks:"0300-036F",InGreek_and_Coptic:"0370-03FF",InCyrillic:"0400-04FF",InCyrillic_Supplement:"0500-052F",InArmenian:"0530-058F",InHebrew:"0590-05FF",InArabic:"0600-06FF",InSyriac:"0700-074F",InArabic_Supplement:"0750-077F",InThaana:"0780-07BF",InNKo:"07C0-07FF",InSamaritan:"0800-083F",InMandaic:"0840-085F",InArabic_Extended_A:"08A0-08FF",InDevanagari:"0900-097F",InBengali:"0980-09FF",InGurmukhi:"0A00-0A7F",InGujarati:"0A80-0AFF",InOriya:"0B00-0B7F",InTamil:"0B80-0BFF",InTelugu:"0C00-0C7F",InKannada:"0C80-0CFF",InMalayalam:"0D00-0D7F",InSinhala:"0D80-0DFF",InThai:"0E00-0E7F",InLao:"0E80-0EFF",InTibetan:"0F00-0FFF",InMyanmar:"1000-109F",InGeorgian:"10A0-10FF",InHangul_Jamo:"1100-11FF",InEthiopic:"1200-137F",InEthiopic_Supplement:"1380-139F",InCherokee:"13A0-13FF",InUnified_Canadian_Aboriginal_Syllabics:"1400-167F",InOgham:"1680-169F",InRunic:"16A0-16FF",InTagalog:"1700-171F",InHanunoo:"1720-173F",InBuhid:"1740-175F",InTagbanwa:"1760-177F",InKhmer:"1780-17FF",InMongolian:"1800-18AF",InUnified_Canadian_Aboriginal_Syllabics_Extended:"18B0-18FF",InLimbu:"1900-194F",InTai_Le:"1950-197F",InNew_Tai_Lue:"1980-19DF",InKhmer_Symbols:"19E0-19FF",InBuginese:"1A00-1A1F",InTai_Tham:"1A20-1AAF",InBalinese:"1B00-1B7F",InSundanese:"1B80-1BBF",InBatak:"1BC0-1BFF",InLepcha:"1C00-1C4F",InOl_Chiki:"1C50-1C7F",InSundanese_Supplement:"1CC0-1CCF",InVedic_Extensions:"1CD0-1CFF",InPhonetic_Extensions:"1D00-1D7F",InPhonetic_Extensions_Supplement:"1D80-1DBF",InCombining_Diacritical_Marks_Supplement:"1DC0-1DFF",InLatin_Extended_Additional:"1E00-1EFF",InGreek_Extended:"1F00-1FFF",InGeneral_Punctuation:"2000-206F",InSuperscripts_and_Subscripts:"2070-209F",InCurrency_Symbols:"20A0-20CF",InCombining_Diacritical_Marks_for_Symbols:"20D0-20FF",InLetterlike_Symbols:"2100-214F",InNumber_Forms:"2150-218F",InArrows:"2190-21FF",InMathematical_Operators:"2200-22FF",InMiscellaneous_Technical:"2300-23FF",InControl_Pictures:"2400-243F",InOptical_Character_Recognition:"2440-245F",InEnclosed_Alphanumerics:"2460-24FF",InBox_Drawing:"2500-257F",InBlock_Elements:"2580-259F",InGeometric_Shapes:"25A0-25FF",InMiscellaneous_Symbols:"2600-26FF",InDingbats:"2700-27BF",InMiscellaneous_Mathematical_Symbols_A:"27C0-27EF",InSupplemental_Arrows_A:"27F0-27FF",InBraille_Patterns:"2800-28FF",InSupplemental_Arrows_B:"2900-297F",InMiscellaneous_Mathematical_Symbols_B:"2980-29FF",InSupplemental_Mathematical_Operators:"2A00-2AFF",InMiscellaneous_Symbols_and_Arrows:"2B00-2BFF",InGlagolitic:"2C00-2C5F",InLatin_Extended_C:"2C60-2C7F",InCoptic:"2C80-2CFF",InGeorgian_Supplement:"2D00-2D2F",InTifinagh:"2D30-2D7F",InEthiopic_Extended:"2D80-2DDF",InCyrillic_Extended_A:"2DE0-2DFF",InSupplemental_Punctuation:"2E00-2E7F",InCJK_Radicals_Supplement:"2E80-2EFF",InKangxi_Radicals:"2F00-2FDF",InIdeographic_Description_Characters:"2FF0-2FFF",InCJK_Symbols_and_Punctuation:"3000-303F",InHiragana:"3040-309F",InKatakana:"30A0-30FF",InBopomofo:"3100-312F",InHangul_Compatibility_Jamo:"3130-318F",InKanbun:"3190-319F",InBopomofo_Extended:"31A0-31BF",InCJK_Strokes:"31C0-31EF",InKatakana_Phonetic_Extensions:"31F0-31FF",InEnclosed_CJK_Letters_and_Months:"3200-32FF",InCJK_Compatibility:"3300-33FF",InCJK_Unified_Ideographs_Extension_A:"3400-4DBF",InYijing_Hexagram_Symbols:"4DC0-4DFF",InCJK_Unified_Ideographs:"4E00-9FFF",InYi_Syllables:"A000-A48F",InYi_Radicals:"A490-A4CF",InLisu:"A4D0-A4FF",InVai:"A500-A63F",InCyrillic_Extended_B:"A640-A69F",InBamum:"A6A0-A6FF",InModifier_Tone_Letters:"A700-A71F",InLatin_Extended_D:"A720-A7FF",InSyloti_Nagri:"A800-A82F",InCommon_Indic_Number_Forms:"A830-A83F",InPhags_pa:"A840-A87F",InSaurashtra:"A880-A8DF",InDevanagari_Extended:"A8E0-A8FF",InKayah_Li:"A900-A92F",InRejang:"A930-A95F",InHangul_Jamo_Extended_A:"A960-A97F",InJavanese:"A980-A9DF",InCham:"AA00-AA5F",InMyanmar_Extended_A:"AA60-AA7F",InTai_Viet:"AA80-AADF",InMeetei_Mayek_Extensions:"AAE0-AAFF",InEthiopic_Extended_A:"AB00-AB2F",InMeetei_Mayek:"ABC0-ABFF",InHangul_Syllables:"AC00-D7AF",InHangul_Jamo_Extended_B:"D7B0-D7FF",InHigh_Surrogates:"D800-DB7F",InHigh_Private_Use_Surrogates:"DB80-DBFF",InLow_Surrogates:"DC00-DFFF",InPrivate_Use_Area:"E000-F8FF",InCJK_Compatibility_Ideographs:"F900-FAFF",InAlphabetic_Presentation_Forms:"FB00-FB4F",InArabic_Presentation_Forms_A:"FB50-FDFF",InVariation_Selectors:"FE00-FE0F",InVertical_Forms:"FE10-FE1F",InCombining_Half_Marks:"FE20-FE2F",InCJK_Compatibility_Forms:"FE30-FE4F",InSmall_Form_Variants:"FE50-FE6F",InArabic_Presentation_Forms_B:"FE70-FEFF",InHalfwidth_and_Fullwidth_Forms:"FF00-FFEF",InSpecials:"FFF0-FFFF"})}(XRegExp),function(e){"use strict";if(!e.addUnicodePackage)throw new ReferenceError("Unicode Base must be loaded before Unicode Properties");e.install("extensibility"),e.addUnicodePackage({Alphabetic:"0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE03450370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05270531-055605590561-058705B0-05BD05BF05C105C205C405C505C705D0-05EA05F0-05F20610-061A0620-06570659-065F066E-06D306D5-06DC06E1-06E806ED-06EF06FA-06FC06FF0710-073F074D-07B107CA-07EA07F407F507FA0800-0817081A-082C0840-085808A008A2-08AC08E4-08E908F0-08FE0900-093B093D-094C094E-09500955-09630971-09770979-097F0981-09830985-098C098F09900993-09A809AA-09B009B209B6-09B909BD-09C409C709C809CB09CC09CE09D709DC09DD09DF-09E309F009F10A01-0A030A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A3E-0A420A470A480A4B0A4C0A510A59-0A5C0A5E0A70-0A750A81-0A830A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD-0AC50AC7-0AC90ACB0ACC0AD00AE0-0AE30B01-0B030B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D-0B440B470B480B4B0B4C0B560B570B5C0B5D0B5F-0B630B710B820B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BBE-0BC20BC6-0BC80BCA-0BCC0BD00BD70C01-0C030C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D-0C440C46-0C480C4A-0C4C0C550C560C580C590C60-0C630C820C830C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD-0CC40CC6-0CC80CCA-0CCC0CD50CD60CDE0CE0-0CE30CF10CF20D020D030D05-0D0C0D0E-0D100D12-0D3A0D3D-0D440D46-0D480D4A-0D4C0D4E0D570D60-0D630D7A-0D7F0D820D830D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60DCF-0DD40DD60DD8-0DDF0DF20DF30E01-0E3A0E40-0E460E4D0E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB90EBB-0EBD0EC0-0EC40EC60ECD0EDC-0EDF0F000F40-0F470F49-0F6C0F71-0F810F88-0F970F99-0FBC1000-10361038103B-103F1050-10621065-1068106E-1086108E109C109D10A0-10C510C710CD10D0-10FA10FC-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A135F1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA16EE-16F01700-170C170E-17131720-17331740-17531760-176C176E-1770177217731780-17B317B6-17C817D717DC1820-18771880-18AA18B0-18F51900-191C1920-192B1930-19381950-196D1970-19741980-19AB19B0-19C91A00-1A1B1A20-1A5E1A61-1A741AA71B00-1B331B35-1B431B45-1B4B1B80-1BA91BAC-1BAF1BBA-1BE51BE7-1BF11C00-1C351C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF31CF51CF61D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209C21022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E2160-218824B6-24E92C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2CF22CF32D00-2D252D272D2D2D30-2D672D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2DE0-2DFF2E2F3005-30073021-30293031-30353038-303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31BA31F0-31FF3400-4DB54E00-9FCCA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A66EA674-A67BA67F-A697A69F-A6EFA717-A71FA722-A788A78B-A78EA790-A793A7A0-A7AAA7F8-A801A803-A805A807-A80AA80C-A827A840-A873A880-A8C3A8F2-A8F7A8FBA90A-A92AA930-A952A960-A97CA980-A9B2A9B4-A9BFA9CFAA00-AA36AA40-AA4DAA60-AA76AA7AAA80-AABEAAC0AAC2AADB-AADDAAE0-AAEFAAF2-AAF5AB01-AB06AB09-AB0EAB11-AB16AB20-AB26AB28-AB2EABC0-ABEAAC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1D-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",Uppercase:"0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E05200522052405260531-055610A0-10C510C710CD1E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F21452160-216F218324B6-24CF2C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CED2CF2A640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA660A662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BA78DA790A792A7A0A7A2A7A4A7A6A7A8A7AAFF21-FF3A",Lowercase:"0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02B802C002C102E0-02E40345037103730377037A-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F05210523052505270561-05871D00-1DBF1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF72071207F2090-209C210A210E210F2113212F21342139213C213D2146-2149214E2170-217F218424D0-24E92C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7D2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2CF32D00-2D252D272D2DA641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA661A663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76F-A778A77AA77CA77FA781A783A785A787A78CA78EA791A793A7A1A7A3A7A5A7A7A7A9A7F8-A7FAFB00-FB06FB13-FB17FF41-FF5A",White_Space:"0009-000D0020008500A01680180E2000-200A20282029202F205F3000",Noncharacter_Code_Point:"FDD0-FDEFFFFEFFFF",Default_Ignorable_Code_Point:"00AD034F115F116017B417B5180B-180D200B-200F202A-202E2060-206F3164FE00-FE0FFEFFFFA0FFF0-FFF8",Any:"0000-FFFF",Ascii:"0000-007F",Assigned:"0000-0377037A-037E0384-038A038C038E-03A103A3-05270531-05560559-055F0561-05870589058A058F0591-05C705D0-05EA05F0-05F40600-06040606-061B061E-070D070F-074A074D-07B107C0-07FA0800-082D0830-083E0840-085B085E08A008A2-08AC08E4-08FE0900-09770979-097F0981-09830985-098C098F09900993-09A809AA-09B009B209B6-09B909BC-09C409C709C809CB-09CE09D709DC09DD09DF-09E309E6-09FB0A01-0A030A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A3C0A3E-0A420A470A480A4B-0A4D0A510A59-0A5C0A5E0A66-0A750A81-0A830A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABC-0AC50AC7-0AC90ACB-0ACD0AD00AE0-0AE30AE6-0AF10B01-0B030B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3C-0B440B470B480B4B-0B4D0B560B570B5C0B5D0B5F-0B630B66-0B770B820B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BBE-0BC20BC6-0BC80BCA-0BCD0BD00BD70BE6-0BFA0C01-0C030C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D-0C440C46-0C480C4A-0C4D0C550C560C580C590C60-0C630C66-0C6F0C78-0C7F0C820C830C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBC-0CC40CC6-0CC80CCA-0CCD0CD50CD60CDE0CE0-0CE30CE6-0CEF0CF10CF20D020D030D05-0D0C0D0E-0D100D12-0D3A0D3D-0D440D46-0D480D4A-0D4E0D570D60-0D630D66-0D750D79-0D7F0D820D830D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60DCA0DCF-0DD40DD60DD8-0DDF0DF2-0DF40E01-0E3A0E3F-0E5B0E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB90EBB-0EBD0EC0-0EC40EC60EC8-0ECD0ED0-0ED90EDC-0EDF0F00-0F470F49-0F6C0F71-0F970F99-0FBC0FBE-0FCC0FCE-0FDA1000-10C510C710CD10D0-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A135D-137C1380-139913A0-13F41400-169C16A0-16F01700-170C170E-17141720-17361740-17531760-176C176E-1770177217731780-17DD17E0-17E917F0-17F91800-180E1810-18191820-18771880-18AA18B0-18F51900-191C1920-192B1930-193B19401944-196D1970-19741980-19AB19B0-19C919D0-19DA19DE-1A1B1A1E-1A5E1A60-1A7C1A7F-1A891A90-1A991AA0-1AAD1B00-1B4B1B50-1B7C1B80-1BF31BFC-1C371C3B-1C491C4D-1C7F1CC0-1CC71CD0-1CF61D00-1DE61DFC-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FC41FC6-1FD31FD6-1FDB1FDD-1FEF1FF2-1FF41FF6-1FFE2000-2064206A-20712074-208E2090-209C20A0-20B920D0-20F02100-21892190-23F32400-24262440-244A2460-26FF2701-2B4C2B50-2B592C00-2C2E2C30-2C5E2C60-2CF32CF9-2D252D272D2D2D30-2D672D6F2D702D7F-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2DE0-2E3B2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB3000-303F3041-30963099-30FF3105-312D3131-318E3190-31BA31C0-31E331F0-321E3220-32FE3300-4DB54DC0-9FCCA000-A48CA490-A4C6A4D0-A62BA640-A697A69F-A6F7A700-A78EA790-A793A7A0-A7AAA7F8-A82BA830-A839A840-A877A880-A8C4A8CE-A8D9A8E0-A8FBA900-A953A95F-A97CA980-A9CDA9CF-A9D9A9DEA9DFAA00-AA36AA40-AA4DAA50-AA59AA5C-AA7BAA80-AAC2AADB-AAF6AB01-AB06AB09-AB0EAB11-AB16AB20-AB26AB28-AB2EABC0-ABEDABF0-ABF9AC00-D7A3D7B0-D7C6D7CB-D7FBD800-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1D-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBC1FBD3-FD3FFD50-FD8FFD92-FDC7FDF0-FDFDFE00-FE19FE20-FE26FE30-FE52FE54-FE66FE68-FE6BFE70-FE74FE76-FEFCFEFFFF01-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDCFFE0-FFE6FFE8-FFEEFFF9-FFFD"})}(XRegExp),function(e){"use strict";function t(e,t,i,n){return{value:e,name:t,start:i,end:n}}e.matchRecursive=function(i,n,s,o,a){o=o||"",a=a||{};var r,l,u,c,d,h=o.indexOf("g")>-1,p=o.indexOf("y")>-1,f=o.replace(/y/g,""),m=a.escapeChar,g=a.valueNames,_=[],v=0,b=0,A=0,y=0;if(n=e(n,f),s=e(s,f),m){if(m.length>1)throw new SyntaxError("can't use more than one escape character");m=e.escape(m),d=new RegExp("(?:"+m+"[\\S\\s]|(?:(?!"+e.union([n,s]).source+")[^"+m+"])+)+",o.replace(/[^im]+/g,""))}for(;;){if(m&&(A+=(e.exec(i,d,A,"sticky")||[""])[0].length),u=e.exec(i,n,A),c=e.exec(i,s,A),u&&c&&(u.index<=c.index?c=null:u=null),u||c)b=(u||c).index,A=b+(u||c)[0].length;else if(!v)break;if(p&&!v&&b>y)break;if(u)v||(r=b,l=A),++v;else{if(!c||!v)throw new Error("string contains unbalanced delimiters");if(!--v&&(g?(g[0]&&r>y&&_.push(t(g[0],i.slice(y,r),y,r)),g[1]&&_.push(t(g[1],i.slice(r,l),r,l)),g[2]&&_.push(t(g[2],i.slice(l,b),l,b)),g[3]&&_.push(t(g[3],i.slice(b,A),b,A))):_.push(i.slice(l,b)),y=A,!h))break}b===A&&++A}return h&&!p&&g&&g[0]&&i.length>y&&_.push(t(g[0],i.slice(y),y,i.length)),_}}(XRegExp),function(e){"use strict";function t(e){var t=/^(?:\(\?:\))?\^/,i=/\$(?:\(\?:\))?$/;return i.test(e.replace(/\\[\s\S]/g,""))?e.replace(t,"").replace(i,""):e}function i(t){return e.isRegExp(t)?t.xregexp&&!t.xregexp.isNative?t:e(t.source):e(t)}var n=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,s=e.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/,n],"g");e.build=function(o,a,r){var l,u,c,d,h=/^\(\?([\w$]+)\)/.exec(o),p={},f=0,m=0,g=[0];h&&(r=r||"",h[1].replace(/./g,function(e){r+=r.indexOf(e)>-1?"":e}));for(d in a)a.hasOwnProperty(d)&&(c=i(a[d]),p[d]={pattern:t(c.source),names:c.xregexp.captureNames||[]});return o=i(o),u=o.xregexp.captureNames||[],o=o.source.replace(s,function(e,t,i,s,o){var a,r,c=t||i;if(c){if(!p.hasOwnProperty(c))throw new ReferenceError("undefined property "+e);return t?(a=u[m],g[++m]=++f,r="(?<"+(a||c)+">"):r="(?:",l=f,r+p[c].pattern.replace(n,function(e,t,i){if(t){if(a=p[c].names[f-l],++f,a)return"(?<"+a+">"}else if(i)return"\\"+(+i+l);return e})+")"}if(s){if(a=u[m],g[++m]=++f,a)return"(?<"+a+">"}else if(o)return"\\"+g[+o];return e}),e(o,r)}}(XRegExp),function(e){"use strict";function t(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}t(e.prototype,{apply:function(e,t){return this.test(t[0])},call:function(e,t){return this.test(t)},forEach:function(t,i,n){return e.forEach(t,this,i,n)},globalize:function(){return e.globalize(this)},xexec:function(t,i,n){return e.exec(t,this,i,n)},xtest:function(t,i,n){return e.test(t,this,i,n)}})}(XRegExp),define("xregexp",function(e){return function(){var t;return t||e.XRegExp}}(this)),String.prototype.score=function(e,t){if(this==e)return 1;if(""==e)return 0;var i,n,s,o,a=0,r=this,l=r.toLowerCase(),u=r.length,c=e.toLowerCase(),d=e.length,h=0,p=1;if(t&&(o=1-t),t)for(var f=0;d>f;++f)s=l.indexOf(c[f],h),-1!==s?(h===s?i=.7:(i=.1," "===r[s-1]&&(i+=.8)),r[s]===e[f]&&(i+=.1),a+=i,h=s+1):p+=o;else for(var f=0;d>f;++f){if(s=l.indexOf(c[f],h),-1===s)return 0;h===s?i=.7:(i=.1," "===r[s-1]&&(i+=.8)),r[s]===e[f]&&(i+=.1),a+=i,h=s+1}return n=.5*(a/u+a/d)/p,c[0]===l[0]&&.85>n&&(n+=.15),n},define("libs/string_score",function(){}),define("unifi/model/Model",["underscore","backbone","jquery","xregexp","libs/string_score"],function(e,t,i,n){"use strict";return t.Model.prototype.search=function(t,n,s){var o=this.toSearch?this.toSearch():this.toJSON(),a=0,r=!1,l=this.getSearchStrings();l&&(o=e.extend(o,l));var u=o[n]||this.get(n);if(u||"function"!=typeof this[n]||(u=this[n]()),n&&(o={x:u}),e.size(o)>0){var c=e.map(e.isArray(t)?t:[t],function(e){return i.trim(e)});e.each(o,function(t){if((e.isArray(t)||e.isObject(t))&&(t=JSON.stringify(t)),(e.isNumber(t)||e.isBoolean(t))&&(t=t.toString()),e.isString(t)){if(r&&!String.prototype.score)throw"Missing String.prototype.score";e.each(c,function(e){s?a+=r?t.score(e):t.search(new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"i"))>=0?1:0:a=r?Math.max(a,t.score(e)):Math.max(a,t.search(new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"i"))>=0?1:0)})}},this)}return a},t.Model.prototype.addSearchString=function(e,t){this._searchStrings=this._searchStrings||{},this._searchStrings[e]=t},t.Model.prototype.clearSearchStrings=function(){delete this._searchStrings},t.Model.prototype.getSearchStrings=function(){return this._searchStrings||{}},t.Model.prototype.validator={_regex:{alphanumeric:/^[a-zA-Z0-9]+$/,digits:/^\d+$/,number:/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/,email:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i,ip:/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/,netmask:/^((128|192|224|240|248|252|254)\.0\.0\.0)|(255\.(((0|128|192|224|240|248|252|254)\.0\.0)|(255\.(((0|128|192|224|240|248|252|254)\.0)|255\.(0|128|192|224|240|248|252|254)))))$/,hostname:/^[a-zA-Z0-9.-]+$/,subnet:/^\d+.\d+.\d+.\d+\/\d+$/,ssid:/^.{1,32}$/,password:/(^([\x20-\x7E]){8,63}$)/,wep:/^([0-9a-fA-F]){10}$|^([0-9a-fA-F]){26}$|^([\x20-\xFF]){5}$|^([\x20-\xFF]){13}$/,wep64:/^([0-9a-fA-F]){10}$/,wep128:/^([0-9a-fA-F]){26}$/,accountName:/^[_A-Za-z0-9][-_.A-Za-z0-9]*$/,deviceAccountName:/^[_A-Za-z0-9][-\@_.A-Za-z0-9]*$/},_ip2long:function(e){if(this.ip(e)){var t=e.split(".");return 16777216*t[0]+65536*t[1]+256*t[2]+1*t[3]}},match:function(e,t){return e&&e.match(t)},alphanumeric:function(e){return e&&e.match(this._regex.alphanumeric)},digits:function(e){return e&&(""+e).match(this._regex.digits)},number:function(e){return e&&e.match(this._regex.number)},email:function(e){return e&&e.match(this._regex.email)},ip:function(e){return e&&e.match(this._regex.ip)},iprange:function(e){var t=e.split("-");return t&&2==t.length&&this.ip(t[0])&&this.ip(t[1])},hostname:function(e){return e&&e.match(this._regex.hostname)},subnet:function(e){if(e&&e.match(this._regex.subnet)){var t=e.indexOf("/"),i=e.substring(0,t),n=parseInt(e.substring(t+1),10);return this.ip(i)&&32>=n}},ssid:function(e){return e&&e.match(this._regex.ssid)},password:function(e){return e&&e.match(this._regex.password)},wep:function(e,t){return e&&e.match(this._regex["wep"+(t?t:"")])},range:function(e,t,i){return this.digits(e)&&i>=e&&e>=t},rangeList:function(t,i,n,s,o){var a=!0,r=new RegExp("["+i+"]+","g"),l=t.replace(/[,]+/g,",").split(r),u=t.match(/\d*-\d*/g);return l.length>n&&(a=!1),e.each(l,function(e){this.range(e,s,o)||(a=!1)},this),e.each(u,function(e){var t=e.split("-");1*t[0]>=1*t[1]&&(a=!1)},this),a},length_limit:function(e,t){return void 0===e.length||e.length<=t},netmask:function(e,t){return e&&e.match(this._regex.netmask)&&(e=this._ip2long(e),t=this._ip2long(t),t^t&e)?!0:void 0},name:function(e){var t=new n("^[\\p{L}\\p{Z}\\p{P}\\p{S}\\p{N}]{0,}$");return e&&t.test(e)},accountName:function(e){return e&&e.match(this._regex.accountName)},deviceAccountName:function(e){return e&&e.match(this._regex.deviceAccountName)},nameStartWithLetter:function(e){var t=new n("^\\p{L}+[\\p{L}\\p{Z}\\p{P}\\p{N}]{0,}$");return e&&t.test(e)}},t.Model.extend({idAttribute:"_id",fetchWithUnset:!0,ignoreUnset:[],parse:function(e){return e&&e.data&&e.meta?e.data[0]:e},toJSON:function(t){var i=e.clone(this.attributes);return t&&t.exclude&&e.each(t.exclude,function(e){delete i[e]}),i},set:function(n,s,o){return"object"==typeof n&&(o=s),e.isObject(o)&&o.fetched&&this.fetchWithUnset&&e.each(e.keys(this.attributes),i.proxy(function(t){e.isUndefined(n[t])&&-1===e.indexOf(this.ignoreUnset,t)&&this.unset(t)},this)),t.Model.prototype.set.apply(this,arguments)}})}),define("unifi/model/CloudUser",["unifi/model/Model","jquery"],function(e,t){"use strict";return e.extend({url:"/api/s/"+t.get_site_name()+"/self",initialize:function(){this.communityURL="https://community.ubnt.com",this.apiToken="",this.set("avatar_sm_url","/lib/4.7.6/images/default-message-avatar.jpg"),this.set("avatar_url","/lib/4.7.6/images/default-profile-avatar.jpg"),this.set("linked",!1)},getName:function(){return this.get("first_name")||this.get("last_name")?(this.get("first_name")||"")+" "+(this.get("last_name")||""):this.get("community_id")?this.get("community_id")||"":""},parse:function(e,t){return t&&t.xhr&&200!==t.xhr.status?void 0:(this.set("linked",!0),e.data[0])}})}),define("unifi/model/AdminPref",["backbone","underscore"],function(e){"use strict";return e.Model.extend({sync:function(t,i,n){switch(n=n||{},t){case"update":n.url="/api/self",n.type="PUT",n.data=JSON.stringify({last_site_name:n.last_site_name})}return e.sync.call(this,t,i,n)}})}),define("ubnt/GoogleAnalytics",[],function(){"use strict";return{account:null,enabled:!1,logging:!1,init:function(e){!window.hasOwnProperty("ga")&&this.account&&this.enabled&&(!function(e,t,i,n,s){e.GoogleAnalyticsObject=i,e[i]||(e[i]=function(){(e[i].q=e[i].q||[]).push(arguments)}),e[i].l=+new Date,n=t.createElement("script"),s=t.scripts[0],n.src="//www.google-analytics.com/analytics.js",s.parentNode.insertBefore(n,s)}(window,document,"ga"),window.ga("create",e),this.account=e)},trackEvent:function(e,t,i){this.enabled&&(window.ga("send","event",e,t,i),this.log({category:"event",action:e,label:t,value:i}))
},trackPage:function(e,t){this.enabled&&(e=e||window.location.pathname+window.location.hash,t=t||document.title,window.ga("send","pageview",{page:e,title:t}),this.log({category:"pageview",page:e,title:t}))},enable:function(){window["ga-disable-"+this.account]=!1,this.enabled=!0,this.log("tracking enabled")},disable:function(){window["ga-disable-"+this.account]=!0,this.enabled=!1,this.log("tracking disabled")},log:function(e){this.logging&&console.log("%c Google Analytics ","background: #4d90fe; color: #fff",e)}}}),define("text",["module"],function(e){"use strict";var t,i,n,s,o,a=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],r=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,l=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,u="undefined"!=typeof location&&location.href,c=u&&location.protocol&&location.protocol.replace(/\:/,""),d=u&&location.hostname,h=u&&(location.port||void 0),p={},f=e.config&&e.config()||{};return t={version:"2.0.10",strip:function(e){if(e){e=e.replace(r,"");var t=e.match(l);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:f.createXhr||function(){var e,t,i;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(t=0;3>t;t+=1){i=a[t];try{e=new ActiveXObject(i)}catch(n){}if(e){a=[i];break}}return e},parseName:function(e){var t,i,n,s=!1,o=e.indexOf("."),a=0===e.indexOf("./")||0===e.indexOf("../");return-1!==o&&(!a||o>1)?(t=e.substring(0,o),i=e.substring(o+1,e.length)):t=e,n=i||t,o=n.indexOf("!"),-1!==o&&(s="strip"===n.substring(o+1),n=n.substring(0,o),i?i=n:t=n),{moduleName:t,ext:i,strip:s}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,i,n,s){var o,a,r,l=t.xdRegExp.exec(e);return l?(o=l[2],a=l[3],a=a.split(":"),r=a[1],a=a[0],!(o&&o!==i||a&&a.toLowerCase()!==n.toLowerCase()||(r||a)&&r!==s)):!0},finishLoad:function(e,i,n,s){n=i?t.strip(n):n,f.isBuild&&(p[e]=n),s(n)},load:function(e,i,n,s){if(s.isBuild&&!s.inlineText)return void n();f.isBuild=s.isBuild;var o=t.parseName(e),a=o.moduleName+(o.ext?"."+o.ext:""),r=i.toUrl(a),l=f.useXhr||t.useXhr;return 0===r.indexOf("empty:")?void n():void(!u||l(r,c,d,h)?t.get(r,function(i){t.finishLoad(e,o.strip,i,n)},function(e){n.error&&n.error(e)}):i([a],function(e){t.finishLoad(o.moduleName+"."+o.ext,o.strip,e,n)}))},write:function(e,i,n){if(p.hasOwnProperty(i)){var s=t.jsEscape(p[i]);n.asModule(e+"!"+i,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,i,n,s,o){var a=t.parseName(i),r=a.ext?"."+a.ext:"",l=a.moduleName+r,u=n.toUrl(a.moduleName+r)+".js";t.load(l,n,function(){var i=function(e){return s(u,e)};i.asModule=function(e,t){return s.asModule(e,u,t)},t.write(e,l,i,o)},o)}},"node"===f.env||!f.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(i=require.nodeRequire("fs"),t.get=function(e,t,n){try{var s=i.readFileSync(e,"utf8");0===s.indexOf("﻿")&&(s=s.substring(1)),t(s)}catch(o){n(o)}}):"xhr"===f.env||!f.env&&t.createXhr()?t.get=function(e,i,n,s){var o,a=t.createXhr();if(a.open("GET",e,!0),s)for(o in s)s.hasOwnProperty(o)&&a.setRequestHeader(o.toLowerCase(),s[o]);f.onXhr&&f.onXhr(a,e),a.onreadystatechange=function(){var t,s;4===a.readyState&&(t=a.status,t>399&&600>t?(s=new Error(e+" HTTP status: "+t),s.xhr=a,n(s)):i(a.responseText),f.onXhrComplete&&f.onXhrComplete(a,e))},a.send(null)}:"rhino"===f.env||!f.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?t.get=function(e,t){var i,n,s="utf-8",o=new java.io.File(e),a=java.lang.System.getProperty("line.separator"),r=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(o),s)),l="";try{for(i=new java.lang.StringBuffer,n=r.readLine(),n&&n.length()&&65279===n.charAt(0)&&(n=n.substring(1)),null!==n&&i.append(n);null!==(n=r.readLine());)i.append(a),i.append(n);l=String(i.toString())}finally{r.close()}t(l)}:("xpconnect"===f.env||!f.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(n=Components.classes,s=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),o="@mozilla.org/windows-registry-key;1"in n,t.get=function(e,t){var i,a,r,l={};o&&(e=e.replace(/\//g,"\\")),r=new FileUtils.File(e);try{i=n["@mozilla.org/network/file-input-stream;1"].createInstance(s.nsIFileInputStream),i.init(r,1,0,!1),a=n["@mozilla.org/intl/converter-input-stream;1"].createInstance(s.nsIConverterInputStream),a.init(i,"utf-8",i.available(),s.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),a.readString(i.available(),l),a.close(),i.close(),t(l.value)}catch(u){throw new Error((r&&r.path||"")+": "+u)}}),t}),define("text!includes/global/headerTemplate.html",[],function(){return'<div id="headerLogo">\n    <div class="header-logo sprite-logo ir"><span><%- msg.G_Unifi %></span></div>\n</div>\n<form class="hidden">\n    <fieldset class="left">\n        <div class="select location-select">\n            <label for="location"><%- msg.G_CurrentSite %></label>\n            <select id="location"></select>\n        </div>\n    </fieldset>\n\n    <fieldset class="right">\n        <div class="select">\n            <label for="refresh"><%- msg.G_RefreshRate %></label>\n            <select id="refresh">\n                <option value="15">15 <%- msg.G_Seconds %></option>\n                <option value="60">1 <%- msg.G_Minute %></option>\n                <option value="120" selected="selected">2 <%- msg.G_Minutes %></option>\n                <option value="300">5 <%- msg.G_Minutes %></option>\n                <option value="0"><%- msg.G_Never %></option>\n            </select>\n        </div>\n    </fieldset>\n</form>\n<div id="headerAvatar">\n    <!--\n    <div id="Notifications" class="left">\n        <a href="#">\n            <span class="ubnt-icon-download"></span>\n        </a>\n        <div id="NotificationsMenu">\n            <div class="point"></div>\n            <header>\n                <h2 class="left"><%- msg.G_Updates %></h2>\n                <a class="right" href="#"><%- msg.G_SeeAll %></a>\n            </header>\n            <div class="content">\n                <ul id="NotificationItems"></ul>\n            </div>\n        </div>\n    </div>\n    -->\n    <div class="user left">\n        <button class="blank-button small-avatar user-button">\n            <img src="" data-src="/lib/4.7.6/images/default-message-avatar.jpg" data-ret="/lib/4.7.6/images/default-message-avatar@2x.jpg" class="retina" />\n            <!-- not sure if we even need this, but the plugin has this in its markup example-->\n            <noscript>\n                <img src="/lib/4.7.6/images/default-message-avatar.jpg" />\n            </noscript>\n            <span class="arrow ubnt-icon-arrow-down"></span>\n        </button>\n    </div>\n\n    <div id="UserPopOver" class="user-popover visuallyhidden">\n        <div class="user-information">\n            <img src="" data-src="/lib/4.7.6/images/default-profile-avatar.jpg" data-ret="/lib/4.7.6/images/default-profile-avatar@2x.jpg" class="retina" />\n            <noscript>\n                <img src="/lib/4.7.6/images/default-profile-avatar.jpg" />\n            </noscript>\n            <div class="user-details">\n                <div class="user-name"></div>\n                <div class="user-email"></div>\n            </div>\n        </div>\n        <div class="user-controls">\n            <a id="UbiquitiAccountButton" class="left" href="http://account.ubnt.com/manage">\n                <span class="big-icon ubnt-icon-id"></span>\n                <%- msg.G_MyAccount %>\n            </a>\n            <a id="ChangePassword" class="left" href="http://account.ubnt.com/manage">\n                <span class="big-icon ubnt-icon-key"></span>\n                <%- msg.G_ChangePassword %>\n            </a>\n            <a id="SignOutButton" class="right" href="/logout">\n                <span class="big-icon ubnt-icon-enter"></span>\n                <%- msg.G_SignOut %> \n            </a>\n        </div>\n    </div>\n</div>\n'}),define("text!includes/map/messageDialogTemplate.html",[],function(){return'<div>\n    <div class="content-area">\n        <span class="message"></span>\n    </div>\n</div>'}),define("ubnt/view/dialogs/ErrorDialogView",["backbone","underscore","msg/Msg","jquery","text!includes/map/messageDialogTemplate.html"],function(e,t,i,n,s){"use strict";return e.View.extend({initialize:function(){var e=this;t.bindAll(e),e.isRendered=!1,e.template=t.template(s)},render:function(){var e=this;e.isRendered||(e.isRendered=!0,e.el=e.template({}),e.$el=n(e.el).dialog({title:i.E_Error,autoOpen:!0,width:300,buttons:{Close:function(){e.$el.dialog("close")}},resizable:!1,modal:!0}),e.$message=e.$el.find(".message"))},open:function(e){var t=this;switch(t.isRendered||t.render(),typeof e){case"string":t.$message.text(e);break;case"object":e.msg?t.$message.text(i.ErrorRenderer[e.msg]?i.ErrorRenderer[e.msg](e):e.msg):t.$message.html(e);break;default:t.$message.text(e)}t.$el.dialog("open")},close:function(){this.$el.dialog("close")}})}),define("ubnt/view/dialogs/AlertDialogView",["backbone","underscore","msg/Msg","jquery","text!includes/map/messageDialogTemplate.html"],function(e,t,i,n,s){"use strict";return e.View.extend({initialize:function(){t.bindAll(this),this.isRendered=!1,this.template=t.template(s)},buttons:function(){return{Close:n.proxy(function(){this.$el.dialog("close")},this)}},render:function(){!this.rendered&&(this.rendered=!0)&&(this.el=this.template(),this.$el=n(this.el).dialog(t.extend({title:i.E_Alert,autoOpen:!0,width:300,buttons:this.buttons(),resizable:!1,modal:!0},this.options)),this.$message=this.$el.find(".message"))},open:function(e){switch(this.rendered||this.render(),typeof e){case"string":this.$message.text(e);break;case"object":e.msg?this.$message.text(i.ErrorRenderer[e.msg]?i.ErrorRenderer[e.msg](e):e.msg):this.$message.html(e);break;default:this.$message.text(e)}this.$el.dialog("open")},close:function(){this.$el.dialog("close")},remove:function(){this.rendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("text!includes/global/lostConnectionTemplate.html",[],function(){return'<div>\n    <div class="content-area">\n        <span class="message"></span>\n    </div>\n</div>'}),define("ubnt/view/dialogs/LostConnectionDialogView",["backbone","underscore","msg/Msg","jquery","text!includes/global/lostConnectionTemplate.html"],function(e,t,i,n,s){"use strict";return e.View.extend({initialize:function(e){var i=this;t.bindAll(i),i.isRendered=!1,i.buttons=e.buttons,i.template=t.template(s)},render:function(){var e=this;e.isRendered||(e.isRendered=!0,e.el=e.template({}),e.$el=n(e.el).dialog({title:i.E_ConnectionDropped,autoOpen:!0,width:300,resizable:!1,draggable:!1,modal:!0,dialogClass:"lost-connection-dialog",buttons:this.buttons}),e.$message=e.$el.find(".message").html(i.E_UnableToConnect))},show:function(){var e=this;e.isRendered||e.render(),e.$el.dialog("open")},hide:function(){var e=this;e.isRendered&&e.$el.dialog("close")}})}),function(e,t,i){function n(e){return e}function s(e){return o(decodeURIComponent(e.replace(r," ")))}function o(e){return 0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")),e}function a(e){return l.json?JSON.parse(e):e}var r=/\+/g,l=e.cookie=function(o,r,u){if(r!==i){if(u=e.extend({},l.defaults,u),null===r&&(u.expires=-1),"number"==typeof u.expires){var c=u.expires,d=u.expires=new Date;d.setDate(d.getDate()+c)}return r=l.json?JSON.stringify(r):String(r),t.cookie=[encodeURIComponent(o),"=",l.raw?r:encodeURIComponent(r),u.expires?"; expires="+u.expires.toUTCString():"",u.path?"; path="+u.path:"",u.domain?"; domain="+u.domain:"",u.secure?"; secure":""].join("")}for(var h=l.raw?n:s,p=t.cookie.split("; "),f=o?null:{},m=0,g=p.length;g>m;m++){var _=p[m].split("="),v=h(_.shift()),b=h(_.join("="));if(o&&o===v){f=a(b);break}o||(f[v]=a(b))}return f};l.defaults={},e.removeCookie=function(t,i){return null!==e.cookie(t)?(e.cookie(t,null,i),!0):!1}}(jQuery,document),define("libs/jquery.cookie",function(){}),define("app",["jquery","backbone","underscore","msg/Msg","unifi/model/CloudUser","unifi/model/AdminPref","ubnt/GoogleAnalytics","text!includes/global/headerTemplate.html","ubnt/view/dialogs/ErrorDialogView","ubnt/view/dialogs/AlertDialogView","ubnt/view/dialogs/LostConnectionDialogView","libs/jquery.cookie"],function(e,t,i,n,s,o,a,r,l,u,c){"use strict";function d(){return"/"+("Admin"===CONFIG.site?"manage":"hotspot")+"/s/"+SITE.name+"/"}function h(){i.delay(function(){e("#ChangePassword").click()},1e3)}var p={};return p.initialize=function(t,a,l){var u=this;this.routers={},this.views={},this.data={},this.adminPref=new o,this.collections=a,e.cookie.defaults.path="/",e(document).ajaxSend(function(t,i,n){"POST"==n.type&&i.setRequestHeader("X-Csrf-Token",e.cookie("csrf_token"))}),this.cloudUser=new s,this.cloudUser.fetch().done(function(){u.cloudUserCallback(),u.views.app=new l({config:CONFIG,app:u,cloudUser:u.cloudUser}),e("#header").html(i.template(r,{msg:n})),"Operator"===CONFIG.site&&(e("#header").find("fieldset.left").remove(),e("body").addClass("isHotspot")),i.each(t,function(e,t){var i=t[0].toLowerCase()+t.substr(1);u.routers[i]=new e({app:u}),u.routers[i].on("route",function(){u.views.app.navigate(i)})},u),e(document).ajaxError(u.ajaxError),u.suppressAjaxErrors=0,e(document).tooltip({show:!1,hide:!1,track:!0}),u.preload(u.collections)}).error(function(){window.location.href=("Admin"===CONFIG.site?"":"/hotspot")+"/logout"})},p.cloudUserCallback=function(){var t=this,i=this.cloudUser;window.SITE={id:i.get("site_id"),name:i.get("site_name")},window.USER={id:i.get("admin_id"),role:i.get("site_role"),"super":i.get("is_super"),is_local:i.get("is_local")},"admin"===i.get("site_role")&&i.get("is_super")===!0?(e.Body.addClass("isSuper"),t.isSuper=!0):(e.Body.removeClass("isSuper"),t.isSuper=!1),"readonly"===i.get("site_role")?(e.Body.addClass("isReadOnly"),t.isReadOnly=!0,e(document).off("keyup keypress",'form input[type="checkbox"],form input[type="text"]',t.ignore_enter_keypress).on("keyup keypress",'form input[type="checkbox"],form input[type="text"]',t.ignore_enter_keypress)):(e.Body.removeClass("isReadOnly"),t.isReadOnly=!1,e(document).off("keyup keypress",'form input[type="checkbox"],form input[type="text"]',t.ignore_enter_keypress)),i.get("is_local")?(e.Body.addClass("isLocalUser"),t.isLocalUser=!0):(e.Body.removeClass("isLocalUser"),t.isLocalUser=!1),i.get("requires_new_password")?(e.Body.addClass("passwordChangeRequired"),h()):e.Body.removeClass("passwordChangeRequired")},p.ignore_enter_keypress=function(e){return 13==e.keyCode?(e.preventDefault(),!1):void 0},p.preload=function(t){var n=[],s={};i.each(t,function(t,i){n.push(s[i]=e.Deferred())},this),e.when.apply(e,n).then(function(){p.render()},function(){p.fatal()}),i.each(t,function(e,t){this.collection(t,{fetch:{reload:!1,deferred:s[t]}},e)},this)},p.render=function(){this.views.app.render(),this.routers.devices&&this.routers.devices.index(),this.routers.clients&&this.routers.clients.index();try{this.routers[CONFIG.start].route("","forward"),t.history.start({pushState:!0,root:d()})}catch(i){t.history.root=d();var n=e("#navigation");p.updatePushStateUrls(n.find("a").not("a[data-page=settings]"))}var s=t.history.fragment||CONFIG.start;t.history.loadUrl(""),this.routers[s.split("/")[0]].navigate(s,{replace:!1,trigger:!0})},p.refresh=function(){if(p.lostConnectionDialog&&p.lostConnectionDialog.$el.is(":visible")&&p.lostConnectionDialog.hide(),!this._refreshing&&(this._refreshing=!0)){var t=[],n={},s=this,o=this.views.app;o.refreshing(),i.each(this.data,function(i,s){t.push(n[s]=e.Deferred())}),e.when.apply(e,t).then(function(){s._refreshing=!1,o.refreshing(!0)},function(){s._refreshing=!1,o.refreshing(!1)}),i.each(this.data,function(e,t){s.collection(t,{fetch:{reload:!0,method:"reload",deferred:n[t]}})},this)}},p.changeSite=function(e,s){try{var o=e?this.collection("Sites").get(e):this.collection("Sites").first();if(!o||!o.id)throw n.E_ChangeSite;SITE={id:o.id,name:o.get("name"),route:s||t.history.fragment},this.adminPref.sync("update",this.adminPref,{last_site_name:SITE.name});var a=this.routers.clients.views.index.properties;i.each(a,function(e){e.remove()}),this.views.app.reset(),i.each(this.routers,function(e){e.reset&&e.reset()},this),i.each(this.data,function(e,t){var i=e.collection;i.bySite&&(i.reset(),delete this.data[t])},this);var r=this;this.cloudUser.url="/api/s/"+o.get("name")+"/self",this.cloudUser.fetch().done(function(){r.cloudUserCallback(),r.preload(r.collections),r.views.app.cloudUser=r.cloudUser})}catch(l){return void this.views.app.flash("error","Error",l)}},p.collection=function(e,t,n){if(t=t||{},t.init=t.init||{},t.fetch=t.fetch||{},i.isUndefined(this.data[e]))try{i.isObject(n)||(n=require("unifi/collection/"+e)),this.data[e]={collection:new n(t.init.models,t.init.options),state:null,deferred:[]}}catch(s){throw t.fetch&&t.fetch.deferred&&t.fetch.deferred.reject(),"Invalid collection: "+e}var o=this.data[e];return i.size(t.fetch)&&(t.fetch.deferred&&o.deferred.push(t.fetch.deferred),"fetching"!=o.state&&(!o.state||t.fetch.reload?(o.state="fetching",o.collection[t.fetch.method||"fetch"](i.extend(t.fetch.options||{},{success:function(){o.state="fetched",o.deferred&&i.each(o.deferred,function(e,t){"pending"==e.state()&&(e.resolve(arguments),delete o.deferred[t])})},error:function(){o.state="fetched",o.deferred&&i.each(o.deferred,function(e,t){"pending"==e.state()&&(e.reject(arguments),delete o.deferred[t])})}}))):o.deferred&&i.each(o.deferred,function(e,t){"pending"==e.state()&&(e.resolve(),delete o.deferred[t])}))),o.collection},p.fatal=function(){this.views.app?this.views.app.flash("error","Fatal Error",n.E_Fatal,!0):(new l).open(n.E_Fatal)},p.ajaxError=function(e,t){p.suppressAjaxErrors||(401===t.status||403===t.status?(p.lostConnectionDialog&&p.lostConnectionDialog.$el.is(":visible")&&p.lostConnectionDialog.hide(),p.alertDialog||(p.alertDialog=new u),p.alertDialog.$el.is(":visible")||(p.alertDialog.open(n.E_SessionExpired),i.delay(function(){document.location="/"},2e3))):0===t.readyState&&0===t.status&&"error"===t.statusText&&(p.lostConnectionDialog||(p.lostConnectionDialog=new c({buttons:{"Try Again":function(){p.refresh(!0)}}})),p.lostConnectionDialog.$el.is(":visible")||p.lostConnectionDialog.show()))},p.ajaxErrorOff=function(){p.suppressAjaxErrors++},p.ajaxErrorOn=function(){p.suppressAjaxErrors>0&&p.suppressAjaxErrors--},p.updatePushStateUrls=function(i){i.each(function(){var i=e(this),n=i.data("page"),s=(t.history.root||d())+n.toLowerCase();i.attr("href",s)})},window.googleMapsNotLoaded=function(){e(".google-map-container").html('<div class="googleMapsError">'+n.E_GoogleMapsNotLoaded+"</div>")},p});var libFuncName=null;if("undefined"==typeof jQuery&&"undefined"==typeof Zepto&&"function"==typeof $)libFuncName=$;else if("function"==typeof jQuery)libFuncName=jQuery;else{if("function"!=typeof Zepto)throw new TypeError;libFuncName=Zepto}!function(e){!function(){Array.prototype.filter||(Array.prototype.filter=function(e){"use strict";if(null==this)throw new TypeError;var t=Object(this),i=t.length>>>0;if("function"!=typeof e)try{throw new TypeError}catch(n){return}for(var s=[],o=arguments[1],a=0;i>a;a++)if(a in t){var r=t[a];e&&e.call(o,r,a,t)&&s.push(r)}return s},Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),i=this,n=function(){},s=function(){return i.apply(this instanceof n&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,s.prototype=new n,s})),e.fn.stop=e.fn.stop||function(){return this}}(),function(t){"use strict";t.Foundation={name:"Foundation",version:"4.0.8",cache:{},init:function(e,t,i,n,s,o){var a,r=[e,i,n,s],l=[],o=o||!1;if(o&&(this.nc=o),this.scope=e||this.scope,t&&"string"==typeof t){if(/off/i.test(t))return this.off();if(a=t.split(" "),a.length>0)for(var u=a.length-1;u>=0;u--)l.push(this.init_lib(a[u],r))}else for(var c in this.libs)l.push(this.init_lib(c,r));return"function"==typeof t&&r.unshift(t),this.response_obj(l,r)},response_obj:function(e,t){for(var i in t)if("function"==typeof t[i])return t[i]({errors:e.filter(function(e){return"string"==typeof e?e:void 0})});return e},init_lib:function(e,t){return this.trap(function(){return this.libs.hasOwnProperty(e)?(this.patch(this.libs[e]),this.libs[e].init.apply(this.libs[e],t)):void 0}.bind(this),e)},trap:function(e,t){if(!this.nc)try{return e()}catch(i){return this.error({name:t,message:"could not be initialized",more:i.name+" "+i.message})}return e()},patch:function(e){this.fix_outer(e)},inherit:function(e,t){for(var i=t.split(" "),n=i.length-1;n>=0;n--)this.lib_methods.hasOwnProperty(i[n])&&(this.libs[e.name][i[n]]=this.lib_methods[i[n]])},random_str:function(e){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split("");e||(e=Math.floor(Math.random()*t.length));for(var i="",n=0;e>n;n++)i+=t[Math.floor(Math.random()*t.length)];return i},libs:{},lib_methods:{set_data:function(e,t){var i=[this.name,+new Date,Foundation.random_str(5)].join("-");return Foundation.cache[i]=t,e.attr("data-"+this.name+"-id",i),t},get_data:function(e){return Foundation.cache[e.attr("data-"+this.name+"-id")]},remove_data:function(t){t?(delete Foundation.cache[t.attr("data-"+this.name+"-id")],t.attr("data-"+this.name+"-id","")):e("[data-"+this.name+"-id]").each(function(){delete Foundation.cache[e(this).attr("data-"+this.name+"-id")],e(this).attr("data-"+this.name+"-id","")})},throttle:function(e,t){var i=null;return function(){var n=this,s=arguments;clearTimeout(i),i=setTimeout(function(){e.apply(n,s)},t)}},data_options:function(t){function i(e){return!isNaN(e-0)&&null!==e&&""!==e&&e!==!1&&e!==!0}function n(t){return"string"==typeof t?e.trim(t):t}var s,o,a={},r=(t.attr("data-options")||":").split(";"),l=r.length;for(s=l-1;s>=0;s--)o=r[s].split(":"),/true/i.test(o[1])&&(o[1]=!0),/false/i.test(o[1])&&(o[1]=!1),i(o[1])&&(o[1]=parseInt(o[1],10)),2===o.length&&o[0].length>0&&(a[n(o[0])]=n(o[1]));return a},delay:function(e,t){return setTimeout(e,t)},scrollTo:function(i,n,s){if(!(0>s)){var o=n-e(t).scrollTop(),a=o/s*10;this.scrollToTimerCache=setTimeout(function(){isNaN(parseInt(a,10))||(t.scrollTo(0,e(t).scrollTop()+a),this.scrollTo(i,n,s-10))}.bind(this),10)}},scrollLeft:function(e){return e.length?"scrollLeft"in e[0]?e[0].scrollLeft:e[0].pageXOffset:void 0},empty:function(e){if(e.length&&e.length>0)return!1;if(e.length&&0===e.length)return!0;for(var t in e)if(hasOwnProperty.call(e,t))return!1;return!0}},fix_outer:function(e){e.outerHeight=function(e,t){return"function"==typeof Zepto?e.height():"undefined"!=typeof t?e.outerHeight(t):e.outerHeight()},e.outerWidth=function(e){return"function"==typeof Zepto?e.width():"undefined"!=typeof bool?e.outerWidth(bool):e.outerWidth()}},error:function(e){return e.name+" "+e.message+"; "+e.more},off:function(){return e(this.scope).off(".fndtn"),e(t).off(".fndtn"),!0},zj:function(){try{return Zepto}catch(e){return jQuery}}()},e.fn.foundation=function(){var e=Array.prototype.slice.call(arguments,0);return this.each(function(){return Foundation.init.apply(Foundation,[this].concat(e)),this})}}(this,this.document)}(libFuncName),define("foundation",function(){}),define("unifi/router/Router",["backbone","underscore"],function(e,t){"use strict";return e.Router.extend({_fullyQualifiedName:null,_sectionName:null,_associatedViews:null,initialize:function(e){if(!this._fullyQualifiedName)throw"Missing _fullyQualifiedName";if(!t.isObject(this._associatedViews))throw"Missing _associatedViews";this._sectionName=this._fullyQualifiedName.replace(/\w*\.Routers\./,"").toLowerCase(),this.app=e.app,this.views={}},index:function(){this._render("index")},forward:function(){this.navigate(this._sectionName,{trigger:!0,replace:!1})},reset:function(){t.each(this.views,function(e){e.reset&&e.reset()}),this.views={}},_render:function(e,t){this.views[e]?this.views[e].render():this.views[e]=new(this._associatedViews[e[0].toUpperCase()+e.substr(1)])({container:t||this.app.views.app.$el,app:this.app})}})}),define("unifi/collection/Collection",["jquery","underscore","backbone","unifi/model/Model"],function(e,t,i,n){"use strict";return i.Collection.prototype.searchModel=function(e,i){var n=!1;return e._searchScore=0,t.each(i,function(t){var i=e.search(t.term,t.property);t.negate===!0&&(i=0===i?1:0),i>=(t.minimum||0)?e._searchScore+=i:t.required&&(n=!0)}),e._searchScore&&!n},i.Collection.prototype.search=function(e){var t=new this.constructor,i=[];return t.comparator=function(e){return-1*e._searchScore},this.each(function(t){this.searchModel(t,e)&&i.push(t)},this),t.add(i),t},i.Collection.prototype.deferredSearch=function(i){var n=new this.constructor,s=[],o=e.Deferred(),a=this.searchModel;n.comparator=function(e){return-1*e._searchScore};var r=function(e,l,u){for(var c=u*l,d=Math.min(c+l,e.length);d>c;c++)a(e[c],i)&&s.push(e[c]);c<e.length?t.defer(r,e,l,++u):(n.add(s),o.resolve(n))};return r(this.models,500,0),o.promise()},i.Collection.extend({model:n,bySite:!1,triggerReset:!0,lastFetch:{},initialize:function(){this.triggerReset&&this.on("reset",function(e,i){t.each(i.previousModels,function(e){e.trigger("remove")})})},fetch:function(e){return this.lastFetch=t.omit(e,["success","error","complete"]),i.Collection.prototype.fetch.call(this,t.extend(e||{},{fetched:!0}))},reload:function(e){return this.fetch(t.extend(this.lastFetch,e||{}))},parse:function(e){return e.data}})}),define("unifi/view/app/ContentView",["backbone","underscore","jquery","msg/Msg"],function(e,t,i){"use strict";return e.View.extend({initialize:function(e){t.bindAll(this),this.rendered=!1,this.$container=e.container,this.app=e.app,this.$el=i("<"+this.tagName+' id="'+this.id+'" class="content'+(this.className?" "+this.className:"")+'"></'+this.tagName+">"),this.$container.append(this.$el)},render:function(){this.$container.find("> .content:not(#"+this.id+")").hide({easing:null,duration:0,complete:function(){i(this).trigger("content:hide")}}),this.$el.show({easing:null,duration:0,complete:function(){i(this).trigger("content:show")}})},reset:function(){this.rendered=!1,this.$el.empty()},remove:function(){this.rendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),function(e,t,i,n){"use strict";function s(e){return String.fromCharCode(e.charCodeAt(0)-32)+e.slice(1)}function o(e,t,i){var n=t-(e+"").length;n=0>n?0:n;for(var s="",o=0;n>o;o++)s+=i;return s+e}var a="	\n\f\r   ᠎             　\u2028\u2029﻿";if(!String.prototype.trim||a.trim()){a="["+a+"]";var r=new RegExp("^"+a+a+"*"),l=new RegExp(a+a+"*$");String.prototype.trim=function(){if(void 0===this||null===this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(r,"").replace(l,"")}}var u=e.Backgrid={VERSION:"0.2.6",Extension:{},requireOptions:function(e,t){for(var n=0;n<t.length;n++){var s=t[n];if(i.isUndefined(e[s]))throw new TypeError("'"+s+"' is required")}},resolveNameToClass:function(e,t){if(i.isString(e)){var n=i.map(e.split("-"),function(e){return s(e)}).join("")+t,o=u[n]||u.Extension[n];if(i.isUndefined(o))throw new ReferenceError("Class '"+n+"' not found");return o}return e}};i.extend(u,n.Events);var c=u.Command=function(e){i.extend(this,{altKey:!!e.altKey,"char":e["char"],charCode:e.charCode,ctrlKey:!!e.ctrlKey,key:e.key,keyCode:e.keyCode,locale:e.locale,location:e.location,metaKey:!!e.metaKey,repeat:!!e.repeat,shiftKey:!!e.shiftKey,which:e.which})};i.extend(c.prototype,{moveUp:function(){return 38==this.keyCode},moveDown:function(){return 40===this.keyCode},moveLeft:function(){return this.shiftKey&&9===this.keyCode},moveRight:function(){return!this.shiftKey&&9===this.keyCode},save:function(){return 13===this.keyCode},cancel:function(){return 27===this.keyCode},passThru:function(){return!(this.moveUp()||this.moveDown()||this.moveLeft()||this.moveRight()||this.save()||this.cancel())}});var d=u.CellFormatter=function(){};i.extend(d.prototype,{fromRaw:function(e){return e},toRaw:function(e){return e}});var h=u.NumberFormatter=function(e){if(e=e?i.clone(e):{},i.extend(this,this.defaults,e),this.decimals<0||this.decimals>20)throw new RangeError("decimals must be between 0 and 20")};h.prototype=new d,i.extend(h.prototype,{defaults:{decimals:2,decimalSeparator:".",orderSeparator:","},HUMANIZED_NUM_RE:/(\d)(?=(?:\d{3})+$)/g,fromRaw:function(e){if(i.isNull(e)||i.isUndefined(e))return"";e=e.toFixed(~~this.decimals);var t=e.split("."),n=t[0],s=t[1]?(this.decimalSeparator||".")+t[1]:"";return n.replace(this.HUMANIZED_NUM_RE,"$1"+this.orderSeparator)+s},toRaw:function(e){for(var t="",n=e.trim().split(this.orderSeparator),s=0;s<n.length;s++)t+=n[s];var o=t.split(this.decimalSeparator);t="";for(var s=0;s<o.length;s++)t=t+o[s]+".";"."===t[t.length-1]&&(t=t.slice(0,t.length-1));var a=1*(1*t).toFixed(~~this.decimals);return i.isNumber(a)&&!i.isNaN(a)?a:void 0}});var p=u.DatetimeFormatter=function(e){if(e=e?i.clone(e):{},i.extend(this,this.defaults,e),!this.includeDate&&!this.includeTime)throw new Error("Either includeDate or includeTime must be true")};p.prototype=new d,i.extend(p.prototype,{defaults:{includeDate:!0,includeTime:!0,includeMilli:!1},DATE_RE:/^([+\-]?\d{4})-(\d{2})-(\d{2})$/,TIME_RE:/^(\d{2}):(\d{2}):(\d{2})(\.(\d{3}))?$/,ISO_SPLITTER_RE:/T|Z| +/,_convert:function(e,t){var n,s=null;if(i.isNumber(e)){var a=new Date(e);n=o(a.getUTCFullYear(),4,0)+"-"+o(a.getUTCMonth()+1,2,0)+"-"+o(a.getUTCDate(),2,0),s=o(a.getUTCHours(),2,0)+":"+o(a.getUTCMinutes(),2,0)+":"+o(a.getUTCSeconds(),2,0)}else{e=e.trim();var r=e.split(this.ISO_SPLITTER_RE)||[];n=this.DATE_RE.test(r[0])?r[0]:"",s=n&&r[1]?r[1]:this.TIME_RE.test(r[0])?r[0]:""}var l=this.DATE_RE.exec(n)||[],u=this.TIME_RE.exec(s)||[];if(t){if(this.includeDate&&i.isUndefined(l[0]))return;if(this.includeTime&&i.isUndefined(u[0]))return;if(!this.includeDate&&n)return;if(!this.includeTime&&s)return}var a=new Date(Date.UTC(1*l[1]||0,1*l[2]-1||0,1*l[3]||0,1*u[1]||null,1*u[2]||null,1*u[3]||null,1*u[5]||null)),c="";return this.includeDate&&(c=o(a.getUTCFullYear(),4,0)+"-"+o(a.getUTCMonth()+1,2,0)+"-"+o(a.getUTCDate(),2,0)),this.includeTime&&(c=c+(this.includeDate?"T":"")+o(a.getUTCHours(),2,0)+":"+o(a.getUTCMinutes(),2,0)+":"+o(a.getUTCSeconds(),2,0),this.includeMilli&&(c=c+"."+o(a.getUTCMilliseconds(),3,0))),this.includeDate&&this.includeTime&&(c+="Z"),c},fromRaw:function(e){return i.isNull(e)||i.isUndefined(e)?"":this._convert(e)},toRaw:function(e){return this._convert(e,!0)}});var f=u.StringFormatter=function(){};f.prototype=new d,i.extend(f.prototype,{fromRaw:function(e){return i.isUndefined(e)||i.isNull(e)?"":e+""}});var m=u.EmailFormatter=function(){};m.prototype=new d,i.extend(m.prototype,{toRaw:function(e){var t=e.trim().split("@");return 2===t.length&&i.all(t)?e:void 0}});var g=u.SelectFormatter=function(){};g.prototype=new d,i.extend(g.prototype,{fromRaw:function(e){return i.isArray(e)?e:null!=e?[e]:[]}});{var _=u.CellEditor=n.View.extend({initialize:function(e){u.requireOptions(e,["formatter","column","model"]),this.formatter=e.formatter,this.column=e.column,this.column instanceof E||(this.column=new E(this.column)),this.listenTo(this.model,"backgrid:editing",this.postRender)},postRender:function(e,t){return(null==t||t.get("name")==this.column.get("name"))&&this.$el.focus(),this}}),v=u.InputCellEditor=_.extend({tagName:"input",attributes:{type:"text"},events:{blur:"saveOrCancel",keydown:"saveOrCancel"},initialize:function(e){_.prototype.initialize.apply(this,arguments),e.placeholder&&this.$el.attr("placeholder",e.placeholder)},render:function(){return this.$el.val(this.formatter.fromRaw(this.model.get(this.column.get("name")))),this},saveOrCancel:function(e){var t=this.formatter,n=this.model,s=this.column,o=new c(e),a="blur"===e.type;
if(o.moveUp()||o.moveDown()||o.moveLeft()||o.moveRight()||o.save()||a){e.preventDefault(),e.stopPropagation();var r=this.$el.val(),l=t.toRaw(r);i.isUndefined(l)?n.trigger("backgrid:error",n,s,r):(n.set(s.get("name"),l),n.trigger("backgrid:edited",n,s,o))}else o.cancel()&&(e.stopPropagation(),n.trigger("backgrid:edited",n,s,o))},postRender:function(e,t){if(null==t||t.get("name")==this.column.get("name"))if("right"===this.$el.css("text-align")){var i=this.$el.val();this.$el.focus().val(null).val(i)}else this.$el.focus();return this}}),b=u.Cell=n.View.extend({tagName:"td",formatter:new d,editor:v,events:{click:"enterEditMode"},initialize:function(e){u.requireOptions(e,["model","column"]),this.column=e.column,this.column instanceof E||(this.column=new E(this.column)),this.formatter=u.resolveNameToClass(this.column.get("formatter")||this.formatter,"Formatter"),this.editor=u.resolveNameToClass(this.editor,"CellEditor"),this.listenTo(this.model,"change:"+this.column.get("name"),function(){this.$el.hasClass("editor")||this.render()}),this.listenTo(this.model,"backgrid:error",this.renderError)},render:function(){return this.$el.empty(),this.$el.text(this.formatter.fromRaw(this.model.get(this.column.get("name")))),this.delegateEvents(),this},enterEditMode:function(){var e=this.model,t=this.column;t.get("editable")&&(this.currentEditor=new this.editor({column:this.column,model:this.model,formatter:this.formatter}),e.trigger("backgrid:edit",e,t,this,this.currentEditor),this.undelegateEvents(),this.$el.empty(),this.$el.append(this.currentEditor.$el),this.currentEditor.render(),this.$el.addClass("editor"),e.trigger("backgrid:editing",e,t,this,this.currentEditor))},renderError:function(e,t){(null==t||t.get("name")==this.column.get("name"))&&this.$el.addClass("error")},exitEditMode:function(){this.$el.removeClass("error"),this.currentEditor.remove(),this.stopListening(this.currentEditor),delete this.currentEditor,this.$el.removeClass("editor"),this.render()},remove:function(){return this.currentEditor&&(this.currentEditor.remove.apply(this,arguments),delete this.currentEditor),n.View.prototype.remove.apply(this,arguments)}}),A=u.StringCell=b.extend({className:"string-cell",formatter:new f}),y=(u.UriCell=b.extend({className:"uri-cell",render:function(){this.$el.empty();var e=this.formatter.fromRaw(this.model.get(this.column.get("name")));return this.$el.append(t("<a>",{tabIndex:-1,href:e,title:e,target:"_blank"}).text(e)),this.delegateEvents(),this}}),u.EmailCell=A.extend({className:"email-cell",formatter:new m,render:function(){this.$el.empty();var e=this.formatter.fromRaw(this.model.get(this.column.get("name")));return this.$el.append(t("<a>",{tabIndex:-1,href:"mailto:"+e,title:e}).text(e)),this.delegateEvents(),this}}),u.NumberCell=b.extend({className:"number-cell",decimals:h.prototype.defaults.decimals,decimalSeparator:h.prototype.defaults.decimalSeparator,orderSeparator:h.prototype.defaults.orderSeparator,formatter:h,initialize:function(){b.prototype.initialize.apply(this,arguments),this.formatter=new this.formatter({decimals:this.decimals,decimalSeparator:this.decimalSeparator,orderSeparator:this.orderSeparator})}})),C=(u.IntegerCell=y.extend({className:"integer-cell",decimals:0}),u.DatetimeCell=b.extend({className:"datetime-cell",includeDate:p.prototype.defaults.includeDate,includeTime:p.prototype.defaults.includeTime,includeMilli:p.prototype.defaults.includeMilli,formatter:p,initialize:function(){b.prototype.initialize.apply(this,arguments),this.formatter=new this.formatter({includeDate:this.includeDate,includeTime:this.includeTime,includeMilli:this.includeMilli});var e=this.includeDate?"YYYY-MM-DD":"";e+=this.includeDate&&this.includeTime?"T":"",e+=this.includeTime?"HH:mm:ss":"",e+=this.includeTime&&this.includeMilli?".SSS":"",this.editor=this.editor.extend({attributes:i.extend({},this.editor.prototype.attributes,this.editor.attributes,{placeholder:e})})}})),F=(u.DateCell=C.extend({className:"date-cell",includeTime:!1}),u.TimeCell=C.extend({className:"time-cell",includeDate:!1}),u.BooleanCellEditor=_.extend({tagName:"input",attributes:{tabIndex:-1,type:"checkbox"},events:{mousedown:function(){this.mouseDown=!0},blur:"enterOrExitEditMode",mouseup:function(){this.mouseDown=!1},change:"saveOrCancel",keydown:"saveOrCancel"},render:function(){var e=this.formatter.fromRaw(this.model.get(this.column.get("name")));return this.$el.prop("checked",e),this},enterOrExitEditMode:function(e){if(!this.mouseDown){var t=this.model;t.trigger("backgrid:edited",t,this.column,new c(e))}},saveOrCancel:function(e){var t=this.model,i=this.column,n=this.formatter,s=new c(e);if(s.passThru()&&"change"!=e.type)return!0;s.cancel()&&(e.stopPropagation(),t.trigger("backgrid:edited",t,i,s));var o=this.$el;if(s.save()||s.moveLeft()||s.moveRight()||s.moveUp()||s.moveDown()){e.preventDefault(),e.stopPropagation();var a=n.toRaw(o.prop("checked"));t.set(i.get("name"),a),t.trigger("backgrid:edited",t,i,s)}else if("change"==e.type){var a=n.toRaw(o.prop("checked"));t.set(i.get("name"),a),o.focus()}}})),w=(u.BooleanCell=b.extend({className:"boolean-cell",editor:F,events:{click:"enterEditMode"},render:function(){return this.$el.empty(),this.$el.append(t("<input>",{tabIndex:-1,type:"checkbox",checked:this.formatter.fromRaw(this.model.get(this.column.get("name")))})),this.delegateEvents(),this}}),u.SelectCellEditor=_.extend({tagName:"select",events:{change:"save",blur:"close",keydown:"close"},template:i.template('<option value="<%- value %>" <%= selected ? \'selected="selected"\' : "" %>><%- text %></option>'),setOptionValues:function(e){this.optionValues=e},setMultiple:function(e){this.multiple=e,this.$el.prop("multiple",e)},_renderOptions:function(e,t){for(var i="",n=0;n<e.length;n++)i+=this.template({text:e[n][0],value:e[n][1],selected:t.indexOf(e[n][1])>-1});return i},render:function(){this.$el.empty();var e=i.result(this,"optionValues"),n=this.formatter.fromRaw(this.model.get(this.column.get("name")));if(!i.isArray(e))throw TypeError("optionValues must be an array");for(var s=null,o=null,s=null,a=null,r=null,l=0;l<e.length;l++){var s=e[l];if(i.isArray(s))o=s[0],s=s[1],this.$el.append(this.template({text:o,value:s,selected:n.indexOf(s)>-1}));else{if(!i.isObject(s))throw TypeError("optionValues elements must be a name-value pair or an object hash of { name: 'optgroup label', value: [option name-value pairs] }");a=s.name,r=t("<optgroup></optgroup>",{label:a}),r.append(this._renderOptions(s.values,n)),this.$el.append(r)}}return this.delegateEvents(),this},save:function(e){var t=this.model,i=this.column;t.set(i.get("name"),this.formatter.toRaw(this.$el.val())),t.trigger("backgrid:edited",t,i,new c(e))},close:function(e){var t=this.model,i=this.column,n=new c(e);n.cancel()?(e.stopPropagation(),t.trigger("backgrid:edited",t,i,new c(e))):(n.save()||n.moveLeft()||n.moveRight()||n.moveUp()||n.moveDown()||"blur"==e.type)&&(e.preventDefault(),e.stopPropagation(),"blur"==e.type&&1===this.$el.find("option").length&&t.set(i.get("name"),this.formatter.toRaw(this.$el.val())),t.trigger("backgrid:edited",t,i,new c(e)))}})),E=(u.SelectCell=b.extend({className:"select-cell",editor:w,multiple:!1,formatter:new g,optionValues:void 0,delimiter:", ",initialize:function(){b.prototype.initialize.apply(this,arguments),u.requireOptions(this,["optionValues"]),this.listenTo(this.model,"backgrid:edit",function(e,t,i,n){t.get("name")==this.column.get("name")&&(n.setOptionValues(this.optionValues),n.setMultiple(this.multiple))})},render:function(){this.$el.empty();var e=this.optionValues,t=this.formatter.fromRaw(this.model.get(this.column.get("name"))),n=[];try{if(!i.isArray(e)||i.isEmpty(e))throw new TypeError;for(var s=0;s<t.length;s++)for(var o=t[s],a=0;a<e.length;a++){var r=e[a];if(i.isArray(r)){var l=r[0],r=r[1];r==o&&n.push(l)}else{if(!i.isObject(r))throw new TypeError;for(var u=r.values,c=0;c<u.length;c++){var d=u[c];d[1]==o&&n.push(d[0])}}}this.$el.append(n.join(this.delimiter))}catch(h){if(h instanceof TypeError)throw TypeError("'optionValues' must be of type {Array.<Array>|Array.<{name: string, values: Array.<Array>}>}");throw h}return this.delegateEvents(),this}}),u.Column=n.Model.extend({defaults:{name:void 0,label:void 0,sortable:!0,editable:!0,renderable:!0,formatter:void 0,cell:void 0,headerCell:void 0},initialize:function(e){u.requireOptions(e,["cell","name"]),this.has("label")||this.set({label:this.get("name")},{silent:!0});var t=u.resolveNameToClass(this.get("headerCell"),"HeaderCell"),i=u.resolveNameToClass(this.get("cell"),"Cell");this.set({cell:i,headerCell:t},{silent:!0})}})),D=u.Columns=n.Collection.extend({model:E}),S=u.Row=n.View.extend({tagName:"tr",requiredOptions:["columns","model"],initialize:function(e){u.requireOptions(e,this.requiredOptions);var t=this.columns=e.columns;t instanceof n.Collection||(t=this.columns=new D(t));for(var i=this.cells=[],s=0;s<t.length;s++)i.push(this.makeCell(t.at(s),e));this.listenTo(t,"change:renderable",function(e,t){for(var n=0;n<i.length;n++){var s=i[n];s.column.get("name")==e.get("name")&&(t?s.$el.show():s.$el.hide())}}),this.listenTo(t,"add",function(t,n){var s=n.indexOf(t),o=this.makeCell(t,e);i.splice(s,0,o),o.column.get("renderable")||o.$el.hide();var a=this.$el;0===s?a.prepend(o.render().$el):s===n.length-1?a.append(o.render().$el):a.children().eq(s).before(o.render().$el)}),this.listenTo(t,"remove",function(e,t,n){i[n.index].remove(),i.splice(n.index,1)})},makeCell:function(e){return new(e.get("cell"))({column:e,model:this.model})},render:function(){this.$el.empty();for(var e=document.createDocumentFragment(),t=0;t<this.cells.length;t++){var i=this.cells[t];e.appendChild(i.render().el),i.column.get("renderable")||i.$el.hide()}return this.el.appendChild(e),this.delegateEvents(),this},remove:function(){for(var e=0;e<this.cells.length;e++){var t=this.cells[e];t.remove.apply(t,arguments)}return n.View.prototype.remove.apply(this,arguments)}}),x=u.EmptyRow=n.View.extend({tagName:"tr",emptyText:null,initialize:function(e){u.requireOptions(e,["emptyText","columns"]),this.emptyText=e.emptyText,this.columns=e.columns},render:function(){this.$el.empty();var e=document.createElement("td");return e.setAttribute("colspan",this.columns.length),e.textContent=this.emptyText,this.el.setAttribute("class","empty"),this.el.appendChild(e),this}}),G=u.HeaderCell=n.View.extend({tagName:"th",events:{"click a":"onClick"},_direction:null,initialize:function(e){u.requireOptions(e,["column","collection"]),this.column=e.column,this.column instanceof E||(this.column=new E(this.column)),this.listenTo(this.collection,"backgrid:sort",this._resetCellDirection)},direction:function(e){return arguments.length&&(this._direction&&this.$el.removeClass(this._direction),e&&this.$el.addClass(e),this._direction=e),this._direction},_resetCellDirection:function(e,t,i,n){n==this.collection&&this.direction(e!==this.column.get("name")?null:t)},onClick:function(e){e.preventDefault();var t=this.column.get("name");this.column.get("sortable")&&("ascending"===this.direction()?this.sort(t,"descending",function(e,i){var n=e.get(t),s=i.get(t);return n===s?0:n>s?-1:1}):"descending"===this.direction()?this.sort(t,null):this.sort(t,"ascending",function(e,i){var n=e.get(t),s=i.get(t);return n===s?0:s>n?-1:1}))},sort:function(e,t,i){i=i||this._cidComparator;var s=this.collection;if(n.PageableCollection&&s instanceof n.PageableCollection){var o;o="ascending"===t?-1:"descending"===t?1:null,s.setSorting(o?e:null,o),"client"==s.mode?(s.fullCollection.comparator||(s.fullCollection.comparator=i),s.fullCollection.sort()):s.fetch({reset:!0})}else s.comparator=i,s.sort();this.collection.trigger("backgrid:sort",e,t,i,this.collection)},_cidComparator:function(e,t){var n=e.cid,s=t.cid;if(!i.isUndefined(n)&&!i.isUndefined(s)){if(n=1*n.slice(1),s=1*s.slice(1),s>n)return-1;if(n>s)return 1}return 0},render:function(){this.$el.empty();var e=t("<a>").text(this.column.get("label")).append("<b class='sort-caret'></b>");return this.$el.append(e),this.delegateEvents(),this}}),k=(u.HeaderRow=u.Row.extend({requiredOptions:["columns","collection"],initialize:function(){u.Row.prototype.initialize.apply(this,arguments)},makeCell:function(e,t){var i=e.get("headerCell")||t.headerCell||G;return i=new i({column:e,collection:this.collection})}}),u.Header=n.View.extend({tagName:"thead",initialize:function(e){u.requireOptions(e,["columns","collection"]),this.columns=e.columns,this.columns instanceof n.Collection||(this.columns=new D(this.columns)),this.row=new u.HeaderRow({columns:this.columns,collection:this.collection})},render:function(){return this.$el.append(this.row.render().$el),this.delegateEvents(),this},remove:function(){return this.row.remove.apply(this.row,arguments),n.View.prototype.remove.apply(this,arguments)}})),B=u.Body=n.View.extend({tagName:"tbody",initialize:function(e){u.requireOptions(e,["columns","collection"]),this.columns=e.columns,this.columns instanceof n.Collection||(this.columns=new D(this.columns)),this.row=e.row||S,this.rows=this.collection.map(function(e){var t=new this.row({columns:this.columns,model:e});return t},this),this.emptyText=e.emptyText,this._unshiftEmptyRowMayBe();var t=this.collection;this.listenTo(t,"add",this.insertRow),this.listenTo(t,"remove",this.removeRow),this.listenTo(t,"sort",this.refresh),this.listenTo(t,"reset",this.refresh),this.listenTo(t,"backgrid:edited",this.moveToNextCell)},_unshiftEmptyRowMayBe:function(){0===this.rows.length&&null!=this.emptyText&&this.rows.unshift(new x({emptyText:this.emptyText,columns:this.columns}))},insertRow:function(e,t,s){if(this.rows[0]instanceof x&&this.rows.pop().remove(),!(t instanceof n.Collection||s))return void this.collection.add(e,s=t);s=i.extend({render:!0},s||{});var o=new this.row({columns:this.columns,model:e}),a=t.indexOf(e);this.rows.splice(a,0,o);var r=this.$el,l=r.children(),u=o.render().$el;s.render&&(a>=l.length?r.append(u):l.eq(a).before(u))},removeRow:function(e,t,n){return n?((i.isUndefined(n.render)||n.render)&&this.rows[n.index].remove(),this.rows.splice(n.index,1),void this._unshiftEmptyRowMayBe()):(this.collection.remove(e,n=t),void this._unshiftEmptyRowMayBe())},refresh:function(){for(var e=0;e<this.rows.length;e++)this.rows[e].remove();return this.rows=this.collection.map(function(e){var t=new this.row({columns:this.columns,model:e});return t},this),this._unshiftEmptyRowMayBe(),this.render(),this.collection.trigger("backgrid:refresh",this),this},render:function(){this.$el.empty();for(var e=document.createDocumentFragment(),t=0;t<this.rows.length;t++){var i=this.rows[t];e.appendChild(i.render().el)}return this.el.appendChild(e),this.delegateEvents(),this},remove:function(){for(var e=0;e<this.rows.length;e++){var t=this.rows[e];t.remove.apply(t,arguments)}return n.View.prototype.remove.apply(this,arguments)},moveToNextCell:function(e,t,i){var n=this.collection.indexOf(e),s=this.columns.indexOf(t);if(i.moveUp()||i.moveDown()||i.moveLeft()||i.moveRight()||i.save()){var o=this.columns.length,a=o*this.collection.length;if(i.moveUp()||i.moveDown()){var r=this.rows[n+(i.moveUp()?-1:1)];r&&r.cells[s].enterEditMode()}else if(i.moveLeft()||i.moveRight())for(var l=i.moveRight(),u=n*o+s+(l?1:-1);u>=0&&a>u;l?u++:u--){var c=~~(u/o),d=u-c*o,h=this.rows[c].cells[d];if(h.column.get("renderable")&&h.column.get("editable")){h.enterEditMode();break}}}this.rows[n].cells[s].exitEditMode()}});u.Footer=n.View.extend({tagName:"tfoot",initialize:function(e){u.requireOptions(e,["columns","collection"]),this.columns=e.columns,this.columns instanceof n.Collection||(this.columns=new u.Columns(this.columns))}}),u.Grid=n.View.extend({tagName:"table",className:"backgrid",header:k,body:B,footer:null,initialize:function(e){u.requireOptions(e,["columns","collection"]),e.columns instanceof n.Collection||(e.columns=new D(e.columns)),this.columns=e.columns;var t=i.omit(e,["el","id","attributes","className","tagName","events"]);this.header=e.header||this.header,this.header=new this.header(t),this.body=e.body||this.body,this.body=new this.body(t),this.footer=e.footer||this.footer,this.footer&&(this.footer=new this.footer(t)),this.listenTo(this.columns,"reset",function(){this.header=new(this.header.remove().constructor)(t),this.body=new(this.body.remove().constructor)(t),this.footer&&(this.footer=new(this.footer.remove().constructor)(t)),this.render()})},insertRow:function(e,t,i){return this.body.insertRow(e,t,i)},removeRow:function(e,t,i){return this.body.removeRow(e,t,i)},insertColumn:function(e,t){return t=t||{render:!0},this.columns.add(e,t),this},removeColumn:function(e,t){return this.columns.remove(e,t),this},render:function(){return this.$el.empty(),this.$el.append(this.header.render().$el),this.footer&&this.$el.append(this.footer.render().$el),this.$el.append(this.body.render().$el),this.delegateEvents(),this.trigger("backgrid:rendered",this),this},remove:function(){return this.header.remove.apply(this.header,arguments),this.body.remove.apply(this.body,arguments),this.footer&&this.footer.remove.apply(this.footer,arguments),n.View.prototype.remove.apply(this,arguments)}})}}(this,jQuery,_,Backbone),define("libs/backgrid",["backbone","underscore","jquery"],function(e){return function(){var t;return t||e.Backgrid}}(this)),function(e){function t(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function i(e,t){function i(){lt.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}var n=!0;return l(function(){return n&&(i(),n=!1),t.apply(this,arguments)},t)}function n(e,t){return function(i){return d(e.call(this,i),t)}}function s(e,t){return function(i){return this.lang().ordinal(e.call(this,i),t)}}function o(){}function a(e){w(e),l(this,e)}function r(e){var t=_(e),i=t.year||0,n=t.quarter||0,s=t.month||0,o=t.week||0,a=t.day||0,r=t.hour||0,l=t.minute||0,u=t.second||0,c=t.millisecond||0;this._milliseconds=+c+1e3*u+6e4*l+36e5*r,this._days=+a+7*o,this._months=+s+3*n+12*i,this._data={},this._bubble()}function l(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return t.hasOwnProperty("toString")&&(e.toString=t.toString),t.hasOwnProperty("valueOf")&&(e.valueOf=t.valueOf),e}function u(e){var t,i={};for(t in e)e.hasOwnProperty(t)&&Ct.hasOwnProperty(t)&&(i[t]=e[t]);return i}function c(e){return 0>e?Math.ceil(e):Math.floor(e)}function d(e,t,i){for(var n=""+Math.abs(e),s=e>=0;n.length<t;)n="0"+n;return(s?i?"+":"":"-")+n}function h(e,t,i,n){var s=t._milliseconds,o=t._days,a=t._months;n=null==n?!0:n,s&&e._d.setTime(+e._d+s*i),o&&nt(e,"Date",it(e,"Date")+o*i),a&&tt(e,it(e,"Month")+a*i),n&&lt.updateOffset(e,o||a)}function p(e){return"[object Array]"===Object.prototype.toString.call(e)}function f(e){return"[object Date]"===Object.prototype.toString.call(e)||e instanceof Date}function m(e,t,i){var n,s=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),a=0;for(n=0;s>n;n++)(i&&e[n]!==t[n]||!i&&b(e[n])!==b(t[n]))&&a++;return a+o}function g(e){if(e){var t=e.toLowerCase().replace(/(.)s$/,"$1");e=Jt[e]||Qt[t]||t}return e}function _(e){var t,i,n={};for(i in e)e.hasOwnProperty(i)&&(t=g(i),t&&(n[t]=e[i]));return n}function v(t){var i,n;if(0===t.indexOf("week"))i=7,n="day";else{if(0!==t.indexOf("month"))return;i=12,n="month"}lt[t]=function(s,o){var a,r,l=lt.fn._lang[t],u=[];if("number"==typeof s&&(o=s,s=e),r=function(e){var t=lt().utc().set(n,e);return l.call(lt.fn._lang,t,s||"")},null!=o)return r(o);for(a=0;i>a;a++)u.push(r(a));return u}}function b(e){var t=+e,i=0;return 0!==t&&isFinite(t)&&(i=t>=0?Math.floor(t):Math.ceil(t)),i}function A(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function y(e,t,i){return Q(lt([e,11,31+t-i]),t,i).week}function C(e){return F(e)?366:365}function F(e){return e%4===0&&e%100!==0||e%400===0}function w(e){var t;e._a&&-2===e._pf.overflow&&(t=e._a[mt]<0||e._a[mt]>11?mt:e._a[gt]<1||e._a[gt]>A(e._a[ft],e._a[mt])?gt:e._a[_t]<0||e._a[_t]>23?_t:e._a[vt]<0||e._a[vt]>59?vt:e._a[bt]<0||e._a[bt]>59?bt:e._a[At]<0||e._a[At]>999?At:-1,e._pf._overflowDayOfYear&&(ft>t||t>gt)&&(t=gt),e._pf.overflow=t)}function E(e){return null==e._isValid&&(e._isValid=!isNaN(e._d.getTime())&&e._pf.overflow<0&&!e._pf.empty&&!e._pf.invalidMonth&&!e._pf.nullInput&&!e._pf.invalidFormat&&!e._pf.userInvalidated,e._strict&&(e._isValid=e._isValid&&0===e._pf.charsLeftOver&&0===e._pf.unusedTokens.length)),e._isValid}function D(e){return e?e.toLowerCase().replace("_","-"):e}function S(e,t){return t._isUTC?lt(e).zone(t._offset||0):lt(e).local()}function x(e,t){return t.abbr=e,yt[e]||(yt[e]=new o),yt[e].set(t),yt[e]}function G(e){delete yt[e]}function k(e){var t,i,n,s,o=0,a=function(e){if(!yt[e]&&Ft)try{require("./lang/"+e)}catch(t){}return yt[e]};if(!e)return lt.fn._lang;if(!p(e)){if(i=a(e))return i;e=[e]}for(;o<e.length;){for(s=D(e[o]).split("-"),t=s.length,n=D(e[o+1]),n=n?n.split("-"):null;t>0;){if(i=a(s.slice(0,t).join("-")))return i;if(n&&n.length>=t&&m(s,n,!0)>=t-1)break;t--}o++}return lt.fn._lang}function B(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function P(e){var t,i,n=e.match(St);for(t=0,i=n.length;i>t;t++)n[t]=ii[n[t]]?ii[n[t]]:B(n[t]);return function(s){var o="";for(t=0;i>t;t++)o+=n[t]instanceof Function?n[t].call(s,e):n[t];return o}}function T(e,t){return e.isValid()?(t=I(t,e.lang()),Zt[t]||(Zt[t]=P(t)),Zt[t](e)):e.lang().invalidDate()}function I(e,t){function i(e){return t.longDateFormat(e)||e}var n=5;for(xt.lastIndex=0;n>=0&&xt.test(e);)e=e.replace(xt,i),xt.lastIndex=0,n-=1;return e}function N(e,t){var i,n=t._strict;switch(e){case"Q":return Ut;case"DDDD":return Ot;case"YYYY":case"GGGG":case"gggg":return n?Ht:Bt;case"Y":case"G":case"g":return Wt;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return n?zt:Pt;case"S":if(n)return Ut;case"SS":if(n)return Lt;case"SSS":if(n)return Ot;case"DDD":return kt;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return It;case"a":case"A":return k(t._l)._meridiemParse;case"X":return $t;case"Z":case"ZZ":return Nt;case"T":return Mt;case"SSSS":return Tt;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return n?Lt:Gt;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Gt;case"Do":return Rt;default:return i=new RegExp(z(H(e.replace("\\","")),"i"))}}function M(e){e=e||"";var t=e.match(Nt)||[],i=t[t.length-1]||[],n=(i+"").match(Kt)||["-",0,0],s=+(60*n[1])+b(n[2]);return"+"===n[0]?-s:s}function $(e,t,i){var n,s=i._a;switch(e){case"Q":null!=t&&(s[mt]=3*(b(t)-1));break;case"M":case"MM":null!=t&&(s[mt]=b(t)-1);break;case"MMM":case"MMMM":n=k(i._l).monthsParse(t),null!=n?s[mt]=n:i._pf.invalidMonth=t;break;case"D":case"DD":null!=t&&(s[gt]=b(t));break;case"Do":null!=t&&(s[gt]=b(parseInt(t,10)));break;case"DDD":case"DDDD":null!=t&&(i._dayOfYear=b(t));break;case"YY":s[ft]=lt.parseTwoDigitYear(t);break;case"YYYY":case"YYYYY":case"YYYYYY":s[ft]=b(t);break;case"a":case"A":i._isPm=k(i._l).isPM(t);break;case"H":case"HH":case"h":case"hh":s[_t]=b(t);break;case"m":case"mm":s[vt]=b(t);break;case"s":case"ss":s[bt]=b(t);break;case"S":case"SS":case"SSS":case"SSSS":s[At]=b(1e3*("0."+t));break;case"X":i._d=new Date(1e3*parseFloat(t));break;case"Z":case"ZZ":i._useUTC=!0,i._tzm=M(t);break;case"w":case"ww":case"W":case"WW":case"d":case"dd":case"ddd":case"dddd":case"e":case"E":e=e.substr(0,1);case"gg":case"gggg":case"GG":case"GGGG":case"GGGGG":e=e.substr(0,2),t&&(i._w=i._w||{},i._w[e]=t)}}function R(e){var t,i,n,s,o,a,r,l,u,c,d=[];if(!e._d){for(n=L(e),e._w&&null==e._a[gt]&&null==e._a[mt]&&(o=function(t){var i=parseInt(t,10);return t?t.length<3?i>68?1900+i:2e3+i:i:null==e._a[ft]?lt().weekYear():e._a[ft]},a=e._w,null!=a.GG||null!=a.W||null!=a.E?r=Z(o(a.GG),a.W||1,a.E,4,1):(l=k(e._l),u=null!=a.d?K(a.d,l):null!=a.e?parseInt(a.e,10)+l._week.dow:0,c=parseInt(a.w,10)||1,null!=a.d&&u<l._week.dow&&c++,r=Z(o(a.gg),c,u,l._week.doy,l._week.dow)),e._a[ft]=r.year,e._dayOfYear=r.dayOfYear),e._dayOfYear&&(s=null==e._a[ft]?n[ft]:e._a[ft],e._dayOfYear>C(s)&&(e._pf._overflowDayOfYear=!0),i=Y(s,0,e._dayOfYear),e._a[mt]=i.getUTCMonth(),e._a[gt]=i.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=d[t]=n[t];for(;7>t;t++)e._a[t]=d[t]=null==e._a[t]?2===t?1:0:e._a[t];d[_t]+=b((e._tzm||0)/60),d[vt]+=b((e._tzm||0)%60),e._d=(e._useUTC?Y:q).apply(null,d)}}function U(e){var t;e._d||(t=_(e._i),e._a=[t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond],R(e))}function L(e){var t=new Date;return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function O(e){e._a=[],e._pf.empty=!0;var t,i,n,s,o,a=k(e._l),r=""+e._i,l=r.length,u=0;for(n=I(e._f,a).match(St)||[],t=0;t<n.length;t++)s=n[t],i=(r.match(N(s,e))||[])[0],i&&(o=r.substr(0,r.indexOf(i)),o.length>0&&e._pf.unusedInput.push(o),r=r.slice(r.indexOf(i)+i.length),u+=i.length),ii[s]?(i?e._pf.empty=!1:e._pf.unusedTokens.push(s),$(s,i,e)):e._strict&&!i&&e._pf.unusedTokens.push(s);e._pf.charsLeftOver=l-u,r.length>0&&e._pf.unusedInput.push(r),e._isPm&&e._a[_t]<12&&(e._a[_t]+=12),e._isPm===!1&&12===e._a[_t]&&(e._a[_t]=0),R(e),w(e)}function H(e){return e.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,n,s){return t||i||n||s})}function z(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function W(e){var i,n,s,o,a;if(0===e._f.length)return e._pf.invalidFormat=!0,void(e._d=new Date(0/0));for(o=0;o<e._f.length;o++)a=0,i=l({},e),i._pf=t(),i._f=e._f[o],O(i),E(i)&&(a+=i._pf.charsLeftOver,a+=10*i._pf.unusedTokens.length,i._pf.score=a,(null==s||s>a)&&(s=a,n=i));l(e,n||i)}function j(e){var t,i,n=e._i,s=jt.exec(n);if(s){for(e._pf.iso=!0,t=0,i=qt.length;i>t;t++)if(qt[t][1].exec(n)){e._f=qt[t][0]+(s[6]||" ");break}for(t=0,i=Yt.length;i>t;t++)if(Yt[t][1].exec(n)){e._f+=Yt[t][0];break}n.match(Nt)&&(e._f+="Z"),O(e)}else lt.createFromInputFallback(e)}function V(t){var i=t._i,n=wt.exec(i);i===e?t._d=new Date:n?t._d=new Date(+n[1]):"string"==typeof i?j(t):p(i)?(t._a=i.slice(0),R(t)):f(i)?t._d=new Date(+i):"object"==typeof i?U(t):"number"==typeof i?t._d=new Date(i):lt.createFromInputFallback(t)}function q(e,t,i,n,s,o,a){var r=new Date(e,t,i,n,s,o,a);return 1970>e&&r.setFullYear(e),r}function Y(e){var t=new Date(Date.UTC.apply(null,arguments));return 1970>e&&t.setUTCFullYear(e),t}function K(e,t){if("string"==typeof e)if(isNaN(e)){if(e=t.weekdaysParse(e),"number"!=typeof e)return null}else e=parseInt(e,10);return e}function X(e,t,i,n,s){return s.relativeTime(t||1,!!i,e,n)}function J(e,t,i){var n=pt(Math.abs(e)/1e3),s=pt(n/60),o=pt(s/60),a=pt(o/24),r=pt(a/365),l=45>n&&["s",n]||1===s&&["m"]||45>s&&["mm",s]||1===o&&["h"]||22>o&&["hh",o]||1===a&&["d"]||25>=a&&["dd",a]||45>=a&&["M"]||345>a&&["MM",pt(a/30)]||1===r&&["y"]||["yy",r];return l[2]=t,l[3]=e>0,l[4]=i,X.apply({},l)}function Q(e,t,i){var n,s=i-t,o=i-e.day();return o>s&&(o-=7),s-7>o&&(o+=7),n=lt(e).add("d",o),{week:Math.ceil(n.dayOfYear()/7),year:n.year()}}function Z(e,t,i,n,s){var o,a,r=Y(e,0,1).getUTCDay();return i=null!=i?i:s,o=s-r+(r>n?7:0)-(s>r?7:0),a=7*(t-1)+(i-s)+o+1,{year:a>0?e:e-1,dayOfYear:a>0?a:C(e-1)+a}}function et(t){var i=t._i,n=t._f;return null===i||n===e&&""===i?lt.invalid({nullInput:!0}):("string"==typeof i&&(t._i=i=k().preparse(i)),lt.isMoment(i)?(t=u(i),t._d=new Date(+i._d)):n?p(n)?W(t):O(t):V(t),new a(t))}function tt(e,t){var i;return"string"==typeof t&&(t=e.lang().monthsParse(t),"number"!=typeof t)?e:(i=Math.min(e.date(),A(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i),e)}function it(e,t){return e._d["get"+(e._isUTC?"UTC":"")+t]()}function nt(e,t,i){return"Month"===t?tt(e,i):e._d["set"+(e._isUTC?"UTC":"")+t](i)}function st(e,t){return function(i){return null!=i?(nt(this,e,i),lt.updateOffset(this,t),this):it(this,e)}}function ot(e){lt.duration.fn[e]=function(){return this._data[e]}}function at(e,t){lt.duration.fn["as"+e]=function(){return+this/t}}function rt(e){"undefined"==typeof ender&&(ut=ht.moment,ht.moment=e?i("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",lt):lt)}for(var lt,ut,ct,dt="2.6.0",ht="undefined"!=typeof global?global:this,pt=Math.round,ft=0,mt=1,gt=2,_t=3,vt=4,bt=5,At=6,yt={},Ct={_isAMomentObject:null,_i:null,_f:null,_l:null,_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},Ft="undefined"!=typeof module&&module.exports,wt=/^\/?Date\((\-?\d+)/i,Et=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Dt=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,St=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,xt=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,Gt=/\d\d?/,kt=/\d{1,3}/,Bt=/\d{1,4}/,Pt=/[+\-]?\d{1,6}/,Tt=/\d+/,It=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Nt=/Z|[\+\-]\d\d:?\d\d/gi,Mt=/T/i,$t=/[\+\-]?\d+(\.\d{1,3})?/,Rt=/\d{1,2}/,Ut=/\d/,Lt=/\d\d/,Ot=/\d{3}/,Ht=/\d{4}/,zt=/[+-]?\d{6}/,Wt=/[+-]?\d+/,jt=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Vt="YYYY-MM-DDTHH:mm:ssZ",qt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Yt=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Kt=/([\+\-]|\d\d)/gi,Xt=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),Jt={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},Qt={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},Zt={},ei="DDD w W M D d".split(" "),ti="M D H h m s w W".split(" "),ii={M:function(){return this.month()+1},MMM:function(e){return this.lang().monthsShort(this,e)},MMMM:function(e){return this.lang().months(this,e)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(e){return this.lang().weekdaysMin(this,e)},ddd:function(e){return this.lang().weekdaysShort(this,e)},dddd:function(e){return this.lang().weekdays(this,e)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return d(this.year()%100,2)},YYYY:function(){return d(this.year(),4)},YYYYY:function(){return d(this.year(),5)},YYYYYY:function(){var e=this.year(),t=e>=0?"+":"-";return t+d(Math.abs(e),6)},gg:function(){return d(this.weekYear()%100,2)},gggg:function(){return d(this.weekYear(),4)},ggggg:function(){return d(this.weekYear(),5)},GG:function(){return d(this.isoWeekYear()%100,2)},GGGG:function(){return d(this.isoWeekYear(),4)},GGGGG:function(){return d(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return b(this.milliseconds()/100)},SS:function(){return d(b(this.milliseconds()/10),2)},SSS:function(){return d(this.milliseconds(),3)},SSSS:function(){return d(this.milliseconds(),3)},Z:function(){var e=-this.zone(),t="+";return 0>e&&(e=-e,t="-"),t+d(b(e/60),2)+":"+d(b(e)%60,2)},ZZ:function(){var e=-this.zone(),t="+";return 0>e&&(e=-e,t="-"),t+d(b(e/60),2)+d(b(e)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},ni=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];ei.length;)ct=ei.pop(),ii[ct+"o"]=s(ii[ct],ct);
for(;ti.length;)ct=ti.pop(),ii[ct+ct]=n(ii[ct],2);for(ii.DDDD=n(ii.DDD,3),l(o.prototype,{set:function(e){var t,i;for(i in e)t=e[i],"function"==typeof t?this[i]=t:this["_"+i]=t},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(e){return this._months[e.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(e){return this._monthsShort[e.month()]},monthsParse:function(e){var t,i,n;for(this._monthsParse||(this._monthsParse=[]),t=0;12>t;t++)if(this._monthsParse[t]||(i=lt.utc([2e3,t]),n="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[t]=new RegExp(n.replace(".",""),"i")),this._monthsParse[t].test(e))return t},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(e){return this._weekdays[e.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(e){return this._weekdaysShort[e.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(e){return this._weekdaysMin[e.day()]},weekdaysParse:function(e){var t,i,n;for(this._weekdaysParse||(this._weekdaysParse=[]),t=0;7>t;t++)if(this._weekdaysParse[t]||(i=lt([2e3,1]).day(t),n="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[t]=new RegExp(n.replace(".",""),"i")),this._weekdaysParse[t].test(e))return t},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(e){var t=this._longDateFormat[e];return!t&&this._longDateFormat[e.toUpperCase()]&&(t=this._longDateFormat[e.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e]=t),t},isPM:function(e){return"p"===(e+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(e,t,i){return e>11?i?"pm":"PM":i?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(e,t){var i=this._calendar[e];return"function"==typeof i?i.apply(t):i},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(e,t,i,n){var s=this._relativeTime[i];return"function"==typeof s?s(e,t,i,n):s.replace(/%d/i,e)},pastFuture:function(e,t){var i=this._relativeTime[e>0?"future":"past"];return"function"==typeof i?i(t):i.replace(/%s/i,t)},ordinal:function(e){return this._ordinal.replace("%d",e)},_ordinal:"%d",preparse:function(e){return e},postformat:function(e){return e},week:function(e){return Q(e,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),lt=function(i,n,s,o){var a;return"boolean"==typeof s&&(o=s,s=e),a={},a._isAMomentObject=!0,a._i=i,a._f=n,a._l=s,a._strict=o,a._isUTC=!1,a._pf=t(),et(a)},lt.suppressDeprecationWarnings=!1,lt.createFromInputFallback=i("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i)}),lt.utc=function(i,n,s,o){var a;return"boolean"==typeof s&&(o=s,s=e),a={},a._isAMomentObject=!0,a._useUTC=!0,a._isUTC=!0,a._l=s,a._i=i,a._f=n,a._strict=o,a._pf=t(),et(a).utc()},lt.unix=function(e){return lt(1e3*e)},lt.duration=function(e,t){var i,n,s,o=e,a=null;return lt.isDuration(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(o={},t?o[t]=e:o.milliseconds=e):(a=Et.exec(e))?(i="-"===a[1]?-1:1,o={y:0,d:b(a[gt])*i,h:b(a[_t])*i,m:b(a[vt])*i,s:b(a[bt])*i,ms:b(a[At])*i}):(a=Dt.exec(e))&&(i="-"===a[1]?-1:1,s=function(e){var t=e&&parseFloat(e.replace(",","."));return(isNaN(t)?0:t)*i},o={y:s(a[2]),M:s(a[3]),d:s(a[4]),h:s(a[5]),m:s(a[6]),s:s(a[7]),w:s(a[8])}),n=new r(o),lt.isDuration(e)&&e.hasOwnProperty("_lang")&&(n._lang=e._lang),n},lt.version=dt,lt.defaultFormat=Vt,lt.momentProperties=Ct,lt.updateOffset=function(){},lt.lang=function(e,t){var i;return e?(t?x(D(e),t):null===t?(G(e),e="en"):yt[e]||k(e),i=lt.duration.fn._lang=lt.fn._lang=k(e),i._abbr):lt.fn._lang._abbr},lt.langData=function(e){return e&&e._lang&&e._lang._abbr&&(e=e._lang._abbr),k(e)},lt.isMoment=function(e){return e instanceof a||null!=e&&e.hasOwnProperty("_isAMomentObject")},lt.isDuration=function(e){return e instanceof r},ct=ni.length-1;ct>=0;--ct)v(ni[ct]);lt.normalizeUnits=function(e){return g(e)},lt.invalid=function(e){var t=lt.utc(0/0);return null!=e?l(t._pf,e):t._pf.userInvalidated=!0,t},lt.parseZone=function(){return lt.apply(null,arguments).parseZone()},lt.parseTwoDigitYear=function(e){return b(e)+(b(e)>68?1900:2e3)},l(lt.fn=a.prototype,{clone:function(){return lt(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var e=lt(this).utc();return 0<e.year()&&e.year()<=9999?T(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):T(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var e=this;return[e.year(),e.month(),e.date(),e.hours(),e.minutes(),e.seconds(),e.milliseconds()]},isValid:function(){return E(this)},isDSTShifted:function(){return this._a?this.isValid()&&m(this._a,(this._isUTC?lt.utc(this._a):lt(this._a)).toArray())>0:!1},parsingFlags:function(){return l({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(e){var t=T(this,e||lt.defaultFormat);return this.lang().postformat(t)},add:function(e,t){var i;return i="string"==typeof e?lt.duration(+t,e):lt.duration(e,t),h(this,i,1),this},subtract:function(e,t){var i;return i="string"==typeof e?lt.duration(+t,e):lt.duration(e,t),h(this,i,-1),this},diff:function(e,t,i){var n,s,o=S(e,this),a=6e4*(this.zone()-o.zone());return t=g(t),"year"===t||"month"===t?(n=432e5*(this.daysInMonth()+o.daysInMonth()),s=12*(this.year()-o.year())+(this.month()-o.month()),s+=(this-lt(this).startOf("month")-(o-lt(o).startOf("month")))/n,s-=6e4*(this.zone()-lt(this).startOf("month").zone()-(o.zone()-lt(o).startOf("month").zone()))/n,"year"===t&&(s/=12)):(n=this-o,s="second"===t?n/1e3:"minute"===t?n/6e4:"hour"===t?n/36e5:"day"===t?(n-a)/864e5:"week"===t?(n-a)/6048e5:n),i?s:c(s)},from:function(e,t){return lt.duration(this.diff(e)).lang(this.lang()._abbr).humanize(!t)},fromNow:function(e){return this.from(lt(),e)},calendar:function(){var e=S(lt(),this).startOf("day"),t=this.diff(e,"days",!0),i=-6>t?"sameElse":-1>t?"lastWeek":0>t?"lastDay":1>t?"sameDay":2>t?"nextDay":7>t?"nextWeek":"sameElse";return this.format(this.lang().calendar(i,this))},isLeapYear:function(){return F(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=K(e,this.lang()),this.add({d:e-t})):t},month:st("Month",!0),startOf:function(e){switch(e=g(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e?this.weekday(0):"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(e){return e=g(e),this.startOf(e).add("isoWeek"===e?"week":e,1).subtract("ms",1)},isAfter:function(e,t){return t="undefined"!=typeof t?t:"millisecond",+this.clone().startOf(t)>+lt(e).startOf(t)},isBefore:function(e,t){return t="undefined"!=typeof t?t:"millisecond",+this.clone().startOf(t)<+lt(e).startOf(t)},isSame:function(e,t){return t=t||"ms",+this.clone().startOf(t)===+S(e,this).startOf(t)},min:function(e){return e=lt.apply(null,arguments),this>e?this:e},max:function(e){return e=lt.apply(null,arguments),e>this?this:e},zone:function(e,t){var i=this._offset||0;return null==e?this._isUTC?i:this._d.getTimezoneOffset():("string"==typeof e&&(e=M(e)),Math.abs(e)<16&&(e=60*e),this._offset=e,this._isUTC=!0,i!==e&&(!t||this._changeInProgress?h(this,lt.duration(i-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,lt.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(e){return e=e?lt(e).zone():0,(this.zone()-e)%60===0},daysInMonth:function(){return A(this.year(),this.month())},dayOfYear:function(e){var t=pt((lt(this).startOf("day")-lt(this).startOf("year"))/864e5)+1;return null==e?t:this.add("d",e-t)},quarter:function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},weekYear:function(e){var t=Q(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==e?t:this.add("y",e-t)},isoWeekYear:function(e){var t=Q(this,1,4).year;return null==e?t:this.add("y",e-t)},week:function(e){var t=this.lang().week(this);return null==e?t:this.add("d",7*(e-t))},isoWeek:function(e){var t=Q(this,1,4).week;return null==e?t:this.add("d",7*(e-t))},weekday:function(e){var t=(this.day()+7-this.lang()._week.dow)%7;return null==e?t:this.add("d",e-t)},isoWeekday:function(e){return null==e?this.day()||7:this.day(this.day()%7?e:e-7)},isoWeeksInYear:function(){return y(this.year(),1,4)},weeksInYear:function(){var e=this._lang._week;return y(this.year(),e.dow,e.doy)},get:function(e){return e=g(e),this[e]()},set:function(e,t){return e=g(e),"function"==typeof this[e]&&this[e](t),this},lang:function(t){return t===e?this._lang:(this._lang=k(t),this)}}),lt.fn.millisecond=lt.fn.milliseconds=st("Milliseconds",!1),lt.fn.second=lt.fn.seconds=st("Seconds",!1),lt.fn.minute=lt.fn.minutes=st("Minutes",!1),lt.fn.hour=lt.fn.hours=st("Hours",!0),lt.fn.date=st("Date",!0),lt.fn.dates=i("dates accessor is deprecated. Use date instead.",st("Date",!0)),lt.fn.year=st("FullYear",!0),lt.fn.years=i("years accessor is deprecated. Use year instead.",st("FullYear",!0)),lt.fn.days=lt.fn.day,lt.fn.months=lt.fn.month,lt.fn.weeks=lt.fn.week,lt.fn.isoWeeks=lt.fn.isoWeek,lt.fn.quarters=lt.fn.quarter,lt.fn.toJSON=lt.fn.toISOString,l(lt.duration.fn=r.prototype,{_bubble:function(){var e,t,i,n,s=this._milliseconds,o=this._days,a=this._months,r=this._data;r.milliseconds=s%1e3,e=c(s/1e3),r.seconds=e%60,t=c(e/60),r.minutes=t%60,i=c(t/60),r.hours=i%24,o+=c(i/24),r.days=o%30,a+=c(o/30),r.months=a%12,n=c(a/12),r.years=n},weeks:function(){return c(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*b(this._months/12)},humanize:function(e){var t=+this,i=J(t,!e,this.lang());return e&&(i=this.lang().pastFuture(t,i)),this.lang().postformat(i)},add:function(e,t){var i=lt.duration(e,t);return this._milliseconds+=i._milliseconds,this._days+=i._days,this._months+=i._months,this._bubble(),this},subtract:function(e,t){var i=lt.duration(e,t);return this._milliseconds-=i._milliseconds,this._days-=i._days,this._months-=i._months,this._bubble(),this},get:function(e){return e=g(e),this[e.toLowerCase()+"s"]()},as:function(e){return e=g(e),this["as"+e.charAt(0).toUpperCase()+e.slice(1)+"s"]()},lang:lt.fn.lang,toIsoString:function(){var e=Math.abs(this.years()),t=Math.abs(this.months()),i=Math.abs(this.days()),n=Math.abs(this.hours()),s=Math.abs(this.minutes()),o=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(e?e+"Y":"")+(t?t+"M":"")+(i?i+"D":"")+(n||s||o?"T":"")+(n?n+"H":"")+(s?s+"M":"")+(o?o+"S":""):"P0D"}});for(ct in Xt)Xt.hasOwnProperty(ct)&&(at(ct,Xt[ct]),ot(ct.toLowerCase()));at("Weeks",6048e5),lt.duration.fn.asMonths=function(){return(+this-31536e6*this.years())/2592e6+12*this.years()},lt.lang("en",{ordinal:function(e){var t=e%10,i=1===b(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+i}}),Ft?module.exports=lt:"function"==typeof define&&define.amd?(define("moment",["require","exports","module"],function(e,t,i){return i.config&&i.config()&&i.config().noGlobal===!0&&(ht.moment=ut),lt}),rt(!0)):rt()}.call(this),define("libs/moment",function(e){return function(){var t;return t||e.moment}}(this)),define("text!includes/global/backgridPaginatorDefault.html",[],function(){return'<tr class="default">\n    <td colspan="<%- colspan %>">\n        <div class="left pages">Page <%- currentPage %> of <%- totalPages %></div>\n        <ul class="right links">\n            <% _.each(handles, function (handle) { %>\n                <li<% if (handle.className) { %> class="<%- handle.className %>"<% } %>><a href="#"<% if(handle.icon) { %> class="<%- handle.icon %>"<% } %> data-page="<%- handle.page %>"<% if (handle.title) {%> title="<%- handle.title %>"<% } %>><span><%- handle.label %></span></a></li>\n            <% }); %>\n        </ul>\n    </td>\n</tr>'}),define("text!includes/global/backgridPaginatorMini.html",[],function(){return'<tr class="default">\n    <td colspan="<%- colspan %>">\n        <ul class="right">\n            <li<% if (handles.prev.className) { %> class="<%- handles.prev.className %>"<% } %>><a href="#"<% if(handles.prev.icon) { %> class="<%- handles.prev.icon %>"<% } %> data-page="<%- handles.prev.page %>"<% if (handles.prev.title) {%> title="<%- handles.prev.title %>"<% } %>><span><%- handles.prev.label %></span></a></li>\n            <li><%- currentPage %> of <%- totalPages %></li>\n            <li<% if (handles.next.className) { %> class="<%- handles.next.className %>"<% } %>><a href="#"<% if(handles.next.icon) { %> class="<%- handles.next.icon %>"<% } %> data-page="<%- handles.next.page %>"<% if (handles.next.title) {%> title="<%- handles.next.title %>"<% } %>><span><%- handles.next.label %></span></a></li>\n        </ul>\n    </td>\n</tr>'}),define("ubnt/backgrid",["backbone","underscore","libs/backgrid","jquery","libs/moment","msg/Msg","text!includes/global/backgridPaginatorDefault.html","text!includes/global/backgridPaginatorMini.html"],function(e,t,i,n,s,o,a,r){"use strict";var l={Backgrid:{}};return l.Backgrid.Row=i.Row.extend({render:function(){i.Row.prototype.render.call(this);var e=this.$el.find("td"),s=this;if(t.each(this.cells,function(i,o){var a=i.options.column,r=a.get("callback"),l=a.get("customClass"),u=a.get("title"),c=n(e[o]);r&&t.isFunction(r)&&!c.is(":empty")&&c.addClass("callback-trigger").on("click",function(e){e.stopPropagation(),r(s.model)}),l&&c.addClass(l),u&&c.attr("title",t.isFunction(u)?u(s.model):s.model.get(u))},this),this.$el.on("disable",function(){n(this).addClass("disabled").find("button").attr("disabled","disabled")}).on("enable",function(){n(this).removeClass("disabled").find("button").removeAttr("disabled")}),this.rowClassName){var o=t.isFunction(this.rowClassName)?this.rowClassName(this.model):this.model.get(this.rowClassName);o&&this.$el.addClass(o)}return this},refresh:function(){for(var e=0;e<this.cells.length;e++)this.cells[e].render()},remove:function(){var e=this;this.$el.find("td").off("click"),this.$el.off(),this.$el.fadeOut(200,function(){i.Row.prototype.remove.apply(e,arguments)})}}),l.Backgrid.HeaderCell=i.HeaderCell.extend({onClick:function(e){e.preventDefault(),this.column.get("sortable")&&"descending"===this.direction()&&this.direction(null),i.HeaderCell.prototype.onClick.call(this,e)}}),l.Backgrid.Header=i.Header.extend({initialize:function(t){i.requireOptions(t,["columns","collection"]),this.columns=t.columns,this.columns instanceof e.Collection||(this.columns=new i.Columns(this.columns)),this.row=new i.HeaderRow({columns:this.columns,collection:this.collection,headerCell:l.Backgrid.HeaderCell})},reset:function(e){return this.collection=e,this.row.collection=e,this.refresh&&this.refresh(),this},render:function(){return i.Header.prototype.render.call(this),this.$el.find(".sort-caret").addClass("ubnt-icon-arrows-sort"),this}}),l.Backgrid.Body=i.Body.extend({initialize:function(e){e.row=l.Backgrid.Row,e.rowClassName&&(e.row=e.row.extend({rowClassName:e.rowClassName})),this.throttled={alert:t.throttle(n.proxy(this.alert,this),200),title:t.throttle(n.proxy(this.title,this),200)},i.Body.prototype.initialize.call(this,e),this.noRows=e.noRows||o.N_NoRows,this.titles=e.titles?new e.titles({el:this.$el,collection:this.collection,columns:this.columns}):null},insertRow:function(e,t,n){i.Body.prototype.insertRow.call(this,e,t,n),this.throttled.alert(),this.throttled.title()},removeRow:function(e,t,n){i.Body.prototype.removeRow.call(this,e,t,n),this.throttled.alert(),this.throttled.title()},render:function(){return i.Body.prototype.render.call(this),this.alert(),this.title(),this},loading:function(e){this._isLoading=e,this.alert()},alert:function(){if(this.$el.find("tr.alert").remove(),!this._isLoading&&!t.size(this.rows)){var e=t.reduce(this.columns.pluck("renderable"),function(e,t){return t?e+1:e},0);this.$el.append(n('<tr class="alert"><td colspan="'+e+'">'+this.noRows+"</td></tr>"))}},title:function(){this.titles&&this.titles.render(t.size(this.rows)>0)},refresh:function(e){if(!e)return i.Body.prototype.refresh.call(this);for(var t=0;t<this.rows.length;t++)this.rows[t].refresh()},reset:function(e){return this.stopListening(this.collection),this.listenTo(e,"add",this.insertRow),this.listenTo(e,"remove",this.removeRow),this.listenTo(e,"reset",this.refresh),this.listenTo(e,"sort",this.refresh),this.collection=e,this.refresh&&this.refresh(),this},remove:function(){this.stopListening(this.collection),i.Body.prototype.remove.apply(this,arguments)}}),l.Backgrid.Footer=i.Footer.extend({reset:function(e){return this.collection=e,this.refresh&&this.refresh(),this}}),l.Backgrid.Grid=i.Grid.extend({header:l.Backgrid.Header,body:l.Backgrid.Body,footer:l.Backgrid.Footer,initialize:function(e){this.state={filters:{},pageSize:null,currentPage:null,sort:this.collection.comparator,syncing:!1,paginateToAddedModel:e.paginateToAddedModel||!1},this.collections={filtered:null,paginated:null};this.collection=e.collection;e.collection=this._collection(0),e.grid=this,this.listenTo(e.collection,"sort",this._syncSort),i.Grid.prototype.initialize.call(this,e),this.stopListening(this.columns,"reset"),this.listenTo(this.columns,"reset",function(){this._reset(!0)}),this.reset=t.debounce(this._reset,200),t.bindAll(this,"_syncState","_syncSort","_reset"),this.listenTo(this.collection,"add",t.debounce(this.handleAdd,200)),this.listenTo(this.collection,"remove",t.debounce(this.handleRemove,200)),this.listenTo(this.collection,"reset",this._syncState)},render:function(){return!this.rendered&&(this.rendered=!0)&&(i.Grid.prototype.render.call(this),this._reset()),this},refresh:function(){this.rendered&&this.body.refresh(!0)},loading:function(e){this.trigger("backgrid:"+(e?"loading":"loaded")),this.header&&this.header.loading&&this.header.loading(e),this.body&&this.body.loading&&this.body.loading(e),this.footer&&this.footer.loading&&this.footer.loading(e)},paginate:function(e,i,n){this.state.currentPage=parseInt(e,10)||1,t.isUndefined(i)||(this.state.pageSize=parseInt(i,10)),n||this.reset()},setFilter:function(e,i,n,s,o){s||(this.userFilterChanged=!0);var a={property:e,term:i,minimum:n,required:!0};-1===n&&(a.negate=!0,a.minimum=1),(o||!t.isEqual(a,this.state.filters[e]))&&(this.state.filters[e]=a,s||this._filter())},removeFilter:function(e,t){t||(this.userFilterChanged=!0),this.state.filters[e]&&(delete this.state.filters[e],t||this._filter())},clearFilters:function(e){e||(this.userFilterChanged=!0),this.state.filters={},e||this._filter()},isFiltered:function(){return!t.isEmpty(this.state.filters)},_filter:function(){this.loading(!0),t.delay(n.proxy(function(){t.size(this.state.filters)?n.when(this.collection.deferredSearch(this.state.filters)).then(n.proxy(function(e){this.collections.filtered=e,this.loading(!1),this.userFilterChanged?(this.paginate(1),this.userFilterChanged=!1):this.paginate(this.state.currentPage)},this)):(this.collections.filtered=null,this.loading(!1),this.userFilterChanged?(this.paginate(1),this.userFilterChanged=!1):this.paginate(this.state.currentPage))},this),300)},handleAdd:function(e){var t=this.collection.indexOf(e);this.state.paginateToAddedModel&&(this.state.currentPage=Math.ceil((t+1)/this.state.pageSize)),this._syncState()},handleRemove:function(){var e=t.size(this.collection),i=Math.ceil(e/this.state.pageSize);this.state.currentPage>i&&(this.state.currentPage=i),this._syncState()},_syncState:function(){!this.state.syncing&&(this.state.syncing=!0)&&(this.collections.filtered?this._filter():this._reset(),this.state.syncing=!1)},_syncSort:function(e){this.state.currentPage=1,this.state.sort=e.comparator,this.reset()},_collection:function(e){var i=this.collections.filtered||this.collection;if(this.state.size=t.size(i),i.comparator!=this.state.sort&&(i.comparator=this.state.sort)&&i.sort(),t.isNumber(e=t.isUndefined(e)?this.state.pageSize:e)&&this.state.size>e){var n=((this.state.currentPage||1)-1)*e,s=n+e;i=new i.constructor(e>0?i.slice(n,s):[]),this.collections.paginated=i}else this.state.pageSize?(i=new i.constructor(i.models),this.collections.paginated=i):this.collections.paginated=null;return i},_reset:function(e){if(this.rendered){var i=this._collection();e?t.each(["header","body","footer"],function(e){this[e]&&(this[e]=new(this[e].remove().constructor)(t.extend({},this.options,{collection:i})),this.$el.append(this[e].render().$el))},this):t.each(["header","body","footer"],function(e){this[e]&&this[e].reset&&this[e].reset(i)},this),this.options.columns.each(function(e,t){e.get("customClass")&&this.header.$el.find("th:nth-child("+(t+1)+")").addClass(e.get("customClass"))},this)}},remove:function(){this.stopListening(this.collection),i.Grid.prototype.remove.apply(this,arguments)}}),l.Backgrid.Cells=l.Backgrid.Cells||{},l.Backgrid.Cells.RawCellEditor=i.InputCellEditor.extend({render:function(){return this.$el.val(this.model.get(this.column.get("name"))),this}}),l.Backgrid.Cells.HtmlCell=i.Cell.extend({className:"html-cell",editor:l.Backgrid.Cells.RawCellEditor,render:function(){return this.$el.empty().append(this.formatter.fromRaw(this.model.get(this.column.get("name")))),this}}),l.Backgrid.Cells.ActionsCell=i.Cell.extend({className:"actions-cell",editor:l.Backgrid.Cells.RawCellEditor,actions:[],initialize:function(e){i.Cell.prototype.initialize.call(this,e),this.listenTo(this.model,"change",function(){this.$el.hasClass("editor")||this.render()})},render:function(){return this.$el.find("button").off(),this.$el.empty(),t.each(this.actions,function(e,t){var i=e.icon||"button-"+t+"-icon",s=e.text||t,o=e.callback||n.noop,a=this.model,r=e.options,l="button button-"+t+" lighter skinny "+(e.buttonClasses||"");e.iconOnly&&(l+=" icon-only"),e.requiresAdminPrivilege&&(l+=" is-admin"),e.classCallback&&(l+=" "+e.classCallback(a)),(!e.render||e.render(a,r))&&this.$el.append(n('<button class="'+l+'"><span class="ui-button-icon-primary '+i+'"></span>'+(e.iconOnly?"":s)+"</button>").on("click",function(e){o(a,e)}))},this),this},remove:function(){this.stopListening(this.model,"change"),i.Cell.prototype.remove.apply(this,arguments)}}),l.Backgrid.Cells.CheckboxCell=i.Cell.extend({className:"checkbox-cell",editor:l.Backgrid.Cells.RawCellEditor,initialize:function(e){i.Cell.prototype.initialize.call(this,e),this.listenTo(this.model,"change",function(){this.$el.hasClass("editor")||this.render()})},render:function(){var e=!!this.$checkbox;if(!e){this.$checkbox=this.$el.find('input[type="checkbox"]'),this.$el.empty();var t=this.config,i=t.callback||n.noop,s=this.model,o=t.options;(!t.render||t.render(s,o))&&this.$el.append(n('<input type="checkbox" id="'+s.id+'">').on("click",function(e){e.stopPropagation(),i(s,e)}))}return this},remove:function(){this.stopListening(this.model,"change"),this.$el.find('.input[type="checkbox"]').off("click"),i.Cell.prototype.remove.apply(this,arguments)}}),l.Backgrid.Cells.ModelCell=i.Cell.extend({className:"model-cell",editor:l.Backgrid.Cells.RawCellEditor,callback:null,initialize:function(e){if(i.Cell.prototype.initialize.call(this,e),this.listenTo(this.model,"change",function(){this.$el.hasClass("editor")||this.render()}),!this.callback)throw"Missing callback"},render:function(){return this.$el.empty().text(this.model[this.callback]?this.formatter.fromRaw(this.model[this.callback]()):""),this},remove:function(){this.stopListening(this.model,"change"),i.Cell.prototype.remove.apply(this,arguments)}}),l.Backgrid.Cells.ComplexCell=i.Cell.extend({className:"complex-cell",editor:l.Backgrid.Cells.RawCellEditor,callback:null,initialize:function(e){i.Cell.prototype.initialize.call(this,e),this.listenTo(this.model,"change",function(){this.$el.hasClass("editor")||this.render()})},render:function(){return this.$el.empty().text(this.formatter.fromRaw(this.model)),this},remove:function(){this.stopListening(this.model,"change"),i.Cell.prototype.remove.apply(this,arguments)}}),l.Backgrid.Cells.ComplexHtmlCell=l.Backgrid.Cells.ComplexCell.extend({render:function(){return this.$el.empty().append(this.formatter.fromRaw(this.model)),this}}),l.Backgrid.Cells.SelectCell=i.Cell.extend({id:"_id",property:"name",first:null,collection:null,styled:!0,events:{},render:function(){var e=!!this.$select;if(e?this.$select.empty():(this.$select=n("<select></select>"),this.$el.empty().append(this.$select),this.styled&&(this.$select.selectmenu({parent:this.$el,appendTo:this.$el,icons:{button:"ubnt-icon-arrow-down secondary-color"},change:n.proxy(function(e,t){this.$select.attr("has-changed",t.item.value),n(e.target).trigger("change")},this)}),this.$select.selectmenu("resize",120)),this.change&&this.$select.on("change",this.change)),t.isNull(this.first)||this.$select.append(n('<option value="" />').text(this.first)),this.collection.each(function(e){var i;i=t.isFunction(this.property)?this.property(e):e.get(this.property),this.$select.append(n("<option />").attr("value",e.get(this.id)).text(i))},this),this.populate&&(this.$select.attr("has-changed")?this.$select.find("option[value="+this.$select.attr("has-changed")+"]").prop("selected",!0):this.$select.find("option[value="+this.populate(this.model,this.collection)+"]").prop("selected",!0)),e)try{this.$select.selectmenu("refresh")}catch(i){}return this},remove:function(){if(this.$select.off("change"),this.styled&&this.$select)try{this.$select.selectmenu("destroy")}catch(e){}this.$select.off(),i.Cell.prototype.remove.apply(this,arguments)}}),l.Backgrid.Headers=l.Backgrid.Headers||{},l.Backgrid.Headers.customSortHeader=l.Backgrid.HeaderCell.extend({sort:function(t,i,n){if(e.PageableCollection&&this.collection instanceof e.PageableCollection)throw new Error("Cannot use customSortHeader with Backbone.PageableCollection");var s=this.options.column.get("sortValue"),o=this.options.column.get("sortFormatter");if(!s)throw new Error("Missing the sortValue configuration");switch(i){case"ascending":n=function(e,t){var n="function"==typeof s?s(e,i):e[s](),a="function"==typeof s?s(t,i):t[s]();return o&&(n=n?n[o]():n,a=a?a[o]():a),n===a?0:a>n?-1:1};break;case"descending":n=function(e,t){var n="function"==typeof s?s(e,i):e[s](),a="function"==typeof s?s(t,i):t[s]();return o&&(n=n?n[o]():n,a=a?a[o]():a),n===a?0:n>a?-1:1}}l.Backgrid.HeaderCell.prototype.sort.call(this,t,i,n)}}),l.Backgrid.Headers.noSortHeader=l.Backgrid.HeaderCell.extend({render:function(){return l.Backgrid.HeaderCell.prototype.render.call(this),this.$el.addClass("nosort").find(".sort-caret").remove(),this}}),l.Backgrid.Headers.noLinkHeader=l.Backgrid.Headers.noSortHeader.extend({render:function(){l.Backgrid.Headers.noSortHeader.prototype.render.call(this);var e=this.$("a").html();return this.$("a").remove(),this.$el.append(e),this}}),l.Backgrid.Headers.emptyHeader=l.Backgrid.HeaderCell.extend({render:function(){return this.$el.html("&nbsp;"),this}}),l.Backgrid.Headers.CheckboxHeader=l.Backgrid.HeaderCell.extend({render:function(){return this.$el.addClass("nosort").find(".sort-caret").remove(),this.$el.empty(),this.$el.append(n('<input type="checkbox">').on("change",function(e){e.stopPropagation(),n(this).closest(".backgrid").find('.checkbox-cell input[type="checkbox"]:not([disabled])').prop("checked",!n(e.target).is(":checked")).trigger("click",e)})),this},remove:function(){this.$el.find('.input[type="checkbox"]').off("change"),l.Backgrid.HeaderCell.prototype.remove.apply(this,arguments)}}),l.Backgrid.Formatters=l.Backgrid.Formatters||{},l.Backgrid.Formatters.Boolean={fromRaw:function(e){return e?"Yes":"No"},toRaw:function(e){return e}},l.Backgrid.Formatters.Span={className:"",fromRaw:function(e){var i=e.replace(/ +/g,"-").toLowerCase(),s=n("<span></span>");return s.attr("class",i),s.html(t.escape(e)),s},toRaw:function(e){return e}},l.Backgrid.Formatters.Grid={className:"",levels:[],fromRaw:function(e){var i=n('<div class="grid '+this.className+'"></div>');return t.each(this.levels,function(t){e>t&&i.append(n("<span></span>"))}),i.attr("data-value",e||"0"),i},toRaw:function(e){return e}},l.Backgrid.Formatters.Bytes={fromRaw:function(e){if(e){var t=["","K","M","G","T"],i=t.length,n=0;for(e=parseInt(e,10)||0;i>n;n++){if(999.5>e)return e.toPrecision(3)+t[n];if(1024>e)return e.toFixed(0)+t[n];e/=1024}return e.toFixed(0)+t[i-1]}return""},toRaw:function(e){return e}},l.Backgrid.Formatters.BytesPerSecond={fromRaw:function(e){var t=l.Backgrid.Formatters.Bytes.fromRaw(e);return t?t+"B/s":""},toRaw:function(e){return e}},l.Backgrid.Formatters.BitsPerSecond={fromRaw:function(e){var t=l.Backgrid.Formatters.Bytes.fromRaw(8*e);return t?t+"bps":""},toRaw:function(e){return e}},l.Backgrid.Formatters.BitsPerSecondFromKbps={fromRaw:function(e){var t=l.Backgrid.Formatters.Bytes.fromRaw(1024*e);return t?t+"bps":""},toRaw:function(e){return e}},l.Backgrid.Formatters.Seconds={fromRaw:function(e){var t,i,s,o;s=Math.floor(e/60),o=e%60,i=Math.floor(s/60),s%=60,t=Math.floor(i/24),i%=24;var a="";return t&&(a+=t+"d "),i&&(a+=i+"h "),s&&(a+=s+"m "),o&&(a+=Math.floor(o)+"s "),n.trim(a)},toRaw:function(e){return e}},l.Backgrid.Formatters.Milliseconds={fromRaw:function(e){return l.Backgrid.Formatters.Seconds.fromRaw(e/1e3)},toRaw:function(e){return e}},l.Backgrid.Formatters.Minutes={fromRaw:function(e){return l.Backgrid.Formatters.Seconds.fromRaw(60*e)},toRaw:function(e){return e}},l.Backgrid.Formatters.Moment={fromFormat:"X",toFormat:"YYYY/MM/DD HH:mm:ss",relative:!1,prefix:"",suffix:"",fromRaw:function(e){return this.relative?this.prefix+s(""+e,this.fromFormat).fromNow()+this.suffix:this.prefix+s(""+e,this.fromFormat).format(this.toFormat)+this.suffix},toRaw:function(e){return e}},l.Backgrid.Formatters.Duration={fromRaw:function(e){var t,i=[],n=["d","h","m","s"],s=[86400,3600,60,1],o=n.length;if(isNaN(e)||0===e)return"0s";e=parseInt(e,10);for(var a=0;o>a&&(t=Math.floor(e/s[a]),t&&(i.push(t+n[a]),e%=s[a]),!(i.length>2));a++);return i.join(" ")},toRaw:function(e){return e}},l.Backgrid.Formatters.Postfix={postfix:"",fromRaw:function(e){return e+this.postfix},toRaw:function(e){return e.substring(0,e.length-this.postfix.length)}},l.Backgrid.Formatters.Placeholder={placeholder:"",fromRaw:function(){return this.placeholder},toRaw:function(e){return e}},l.Backgrid.Formatters.Percentage={fromRaw:function(e,t){return"undefined"==typeof t?parseFloat(e).toFixed(1)+"%":0===t?"0%":(parseInt(e,10)/t).toFixed(1)+"%"},toRaw:function(e){return e}},l.Backgrid.Formatters.PhoneNumber={fromRaw:function(e){if(e){switch(e.length){case 11:if("1"==e.substring(0,1))return e.substring(1,4)+"-"+e.substring(4,7)+"-"+e.substring(7,11)}return e}},toRaw:function(e){return e.replace("-","")}},l.Backgrid.Formatters.Currency={currency:"currency",amount:"amount",fromRaw:function(e){if("undefined"!=typeof e.get(this.currency)&&"undefined"!=typeof e.get(this.amount))switch(e.get(this.currency)){case"USD":return"$"+e.get(this.amount);
case"EUR":return"&#8364;"+e.get(this.amount);default:return e.get(this.currency)+" "+e.get(this.amount)}},toRaw:function(e){return e}},l.Backgrid.Paginators=l.Backgrid.Paginators||{},l.Backgrid.Paginators.Default=l.Backgrid.Footer.extend({template:t.template(a),events:{"click a":"changePage"},initialize:function(e){i.Footer.prototype.initialize.call(this,e),this.grid=e.grid,this.listenTo(this.columns,"add",this.render),this.listenTo(this.columns,"remove",this.render),this.listenTo(this.columns,"change:renderable",this.render),this.listenTo(this.collection,"add",this.render),this.listenTo(this.collection,"remove",this.render),this.listenTo(this.collection,"reset",this.render)},render:function(){if(this.$el.find("tr:not(.loading)").remove(),this.grid.state.currentPage&&(this.currentPage=this.grid.state.currentPage,this.totalPages=Math.ceil(this.grid.state.size/this.grid.state.pageSize),this.totalPages>1)){var e=t.reduce(this.columns.pluck("renderable"),function(e,t){return t?e+1:e},0);this.$el.append(this.template({colspan:e,currentPage:this.currentPage,totalPages:this.totalPages,handles:this.makeHandles()})),this.delegateEvents()}return this},makeHandles:function(){var e=[];e.push({page:"first",className:"first"+(1==this.currentPage?" disabled":""),title:"first",label:"&lt;&lt;",icon:"ubnt-icon-arrows-left"}),e.push({page:"prev",className:"prev"+(1==this.currentPage?" disabled":""),title:"prev",label:"&lt;",icon:"ubnt-icon-arrow-left"});for(var t=7,i=Math.max(1,this.currentPage-Math.floor((t-1)/2)),n=Math.min(this.totalPages,i+t-1);t-1>n-i&&i>1;)i--;for(var s=i;n>=s;s++)e.push({page:s,className:"numeric"+(this.currentPage==s?" active":""),title:s,label:s});return e.push({page:"next",className:"next"+(this.currentPage==this.totalPages?" disabled":""),title:"next",label:"&gt;",icon:"ubnt-icon-arrow-right"}),e.push({page:"last",className:"last"+(this.currentPage==this.totalPages?" disabled":""),title:"last",label:"&gt;&gt;",icon:"ubnt-icon-arrows-right"}),e},changePage:function(e){e.preventDefault();var t=n(e.target).parent().addBack().filter("a").data("page");switch(t){case"first":t=1;break;case"prev":t=Math.max(this.currentPage-1,1);break;case"next":t=Math.min(this.currentPage+1,this.totalPages);break;case"last":t=this.totalPages}this.grid.paginate(t)},refresh:function(){this.render()},remove:function(){this.stopListening(this.columns),this.stopListening(this.collection),l.Backgrid.Footer.prototype.remove.apply(this,arguments)}}),l.Backgrid.Paginators.Mini=l.Backgrid.Paginators.Default.extend({template:t.template(r),makeHandles:function(){return{prev:{page:"prev",className:"prev"+(1==this.currentPage?" disabled":""),title:"prev",label:"&lt;",icon:"ubnt-icon-arrow-left"},next:{page:"next",className:"next"+(this.currentPage==this.totalPages?" disabled":""),title:"next",label:"&gt;",icon:"ubnt-icon-arrow-right"}}}}),l.Backgrid.Titles=l.Backgrid.Titles||{},l.Backgrid.Titles.Title=e.View.extend({initialize:function(e){this.columns=e.columns},render:function(e){if(this.$el.find("tr.title").remove(),e){this.colspan=t.reduce(this.columns.pluck("renderable"),function(e,t){return t?e+1:e},0);var i=this,s=null;this.$el.children("tr:not(.title)").each(function(){var e=i.formatTitle(n(this).find(".title-cell").text());e!=s&&(i.insertRow(n(this),e),s=e)})}return this},formatTitle:function(e){return e},insertRow:function(e,t){e.before(n('<tr class="title"><td colspan="'+this.colspan+'">'+t+"</td></tr>"))}}),l.Backgrid.Titles.Moment=l.Backgrid.Titles.Title.extend({render:function(e){return s.lang("en",{calendar:{lastDay:"[Yesterday]",sameDay:"[Today]",nextDay:"[Tomorrow]",lastWeek:"MMMM D, YYYY",nextWeek:"MMMM D, YYYY",sameElse:"MMMM D, YYYY"}}),l.Backgrid.Titles.Title.prototype.render.call(this,e),this},formatTitle:function(e){return e?s(e).calendar():""}}),l.Backgrid}),define("text!includes/global/errorTemplate.html",[],function(){return'<div class="error-takeover">\n    <div class="message"><%- error %></div>\n    <div class="actions"></div>\n</div>'}),define("unifi/view/app/ListContentView",["unifi/view/app/ContentView","ubnt/backgrid","underscore","msg/Msg","jquery","text!includes/global/errorTemplate.html"],function(e,t,i,n,s,o){"use strict";return e.extend({_templateId:"",_collectionType:{},_gridClass:t.Grid,_gridTitles:null,_gridRowClassName:null,_pageable:!1,_filterMinimum:.3,_autoRender:!0,_autoLoad:!0,initialize:function(t){if(!this._collectionType)throw"Missing _collectionType";if(!this._templateId)throw"Missing _templateId";e.prototype.initialize.call(this,t),s.when(this._rendered=s.Deferred(),this._loaded=s.Deferred(),this._dependencies=s.Deferred()).then(this.grid,this.failed),s.when(this._loaded).then(this.searchable),this._reloadingStack=0,this._autoLoad&&this.load(),this.dependencies(),this.grids={},this._autoRender&&this.render()},load:function(e,t){"resolved"==this._loaded.state()&&(this.reloading(),s.when(this._loaded=s.Deferred()).then(this.reloaded,this.failed)),this.collection=this.app.collection(this._collectionType.name,{},this._collectionType.Class),this.app.collection(this._collectionType.name,{fetch:{reload:!!e,deferred:this._loaded,options:i.extend(t||{},this._fetchOpts),method:this._fetchMethod}},this._collectionType.Class)},reloading:function(){this._reloadingStack++,this.$loading.show(),this.$table.hide()},reloaded:function(){--this._reloadingStack||i.delay(function(e,t){e&&e.show(),t&&t.hide()},300,this.$table,this.$loading)},dependencies:function(){this._dependencies.resolve()},searchable:function(){},render:function(t){return e.prototype.render.call(this),!this.rendered&&(this.rendered=!0)&&(this.$el.html(i.template(this._templateId,{msg:n})),this.$el.find(".buttonset").buttonset(),this.$el.find("form.data-filters").on("submit",function(e){e.preventDefault()}),this.$search=this.$el.find("input[name=search]"),this.$search.on("keyup",i.debounce(this.filter,300)),this.$pageSize=this.$pageSize?this.$pageSize:this.$el.find("select[name=items-per-page]"),this.$el.find("select:not(.plain)").each(function(){var e=s(this),t=e.parent();e.selectmenu({parent:t,appendTo:t,label:e.data("label"),icons:{button:"ubnt-icon-arrow-down secondary-color"},position:{at:"left bottom",collision:"flip"},change:function(){e.trigger("change")}})}),!t&&this._rendered.resolve()),this},columns:function(){throw"Missing columns()"},grid:function(e){var n={columns:this.columns(),collection:this.collection,pageable:this._pageable};this._pageable&&(n.footer=t.Paginators.Default),this._gridTitles&&(n.titles=this._gridTitles),this._gridRowClassName&&(n.rowClassName=this._gridRowClassName);var o=this.grids.content=new this._gridClass(n);return this._pageable&&this.$pageSize.on("change",function(e,t){o.paginate(1,s(this).find("option:selected").val(),t)}).trigger("change",!0),e&&i.each(e,function(e){o.setFilter.apply(o,e)}),this.$el.find(".data-table").append(o.render().$el),this.$table=this.$el.find(".data-table table"),this.$loading=this.$el.find(".data-table .loading").hide(),this.listenTo(o,"backgrid:loading",this.reloading),this.listenTo(o,"backgrid:loaded",this.reloaded),this},failed:function(){var e=this;this.$el.html(i.template(o,{error:n.E_DataLoad})),this.$el.find("div.actions").append(s('<button class="button">Retry</button>').on("click",function(){var t=s(this);t.attr("disabled","disabled"),e.collection.fetch({success:function(){e.rendered=!1,e.render(),e.grid()},error:function(){t.removeAttr("disabled","disabled")}})}))},filter:function(e,t,n){t=s.trim(t||this.$search.val()),i.each(this.grids,function(e){t?e.setFilter(null,t,this._filterMinimum,!1,n):e.removeFilter(null)},this)},remove:function(){this.$el.find("form.data-filters").off(),this.$search.off(),this.$pageSize.off(),this.$el.find("div.actions button").off(),this.stopListening(this.grids.content,"backgrid:loading",this.reloading),this.stopListening(this.grids.content,"backgrid:loaded",this.reloaded),i.each(this.grids,function(e){e.remove&&e.remove()},this),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/view/app/ValidatorMixin",["jquery","underscore","backbone","msg/Msg"],function(e,t,i,n){"use strict";return{_modelSave:"save",_collectionCreate:"create",_save:function(i,s,o){var a,r;return r=(i?i[this._modelSave]:this.collection[this._collectionCreate]).call(i||this.collection,this.gather(s),t.extend({wait:!0,success:e.proxy(function(e,t,i){this.collection&&this.collection.add(e,{merge:!0}),this.trigger("save-success",e,t,i)},this),error:e.proxy(function(e,t){this.trigger("save-error",e,t)},this),complete:e.proxy(function(){this.trigger("save-complete",s)},this)},o||{})),i?r?a=!0:this.invalid(i.validationError,s):r?r.validationError?this.invalid(r.validationError,s):a=!0:this.error(i,{statusText:n.E_MissingModel}),a},fieldmap:function(){this._fieldmap={},t.each(this._prevalidate,function(e,t){var i=e.map||t;this._fieldmap[(e.subsection||"")+"-"+i]=t},this)},prevalidator:function(){this._inputs=[],this.fieldmap(),t.each(this._prevalidate,function(i,n){var s,o=i.map||n;switch(i.input){case"text":case"password":s=this.$el.find("input[name="+n+("password"==i.input?"-text":"")+"]"),s.on("keyup.validator",{$input:s,property:o,validator:i},t.debounce(this._validate,500)),s.on("blur.validator validate.validator",{$input:s,property:o,validator:i},this._validate)}t.size(s)&&(i.onchange&&s.on("change.validator",e.proxy(function(){t.isArray(i.onchange)?t.each(i.onchange,function(e){this.$el.find("input[name="+e+"]").trigger("validate")},this):this.$el.find("input[name="+i.onchange+"]").trigger("validate")},this)),this._inputs.push(s))},this)},_validate:function(e){var t=e.data.$input,i=e.data.property,n=e.data.validator,s=n.model||this.model;if(!t||!i||!n)throw new Error("Missing _validate event data");if(s){this.valid([i],n.subsection);var o={};n.complex?o=this.gather(n.subsection):o[i]=t.val();var a=s.validate(o,{partial:i,extra:n.extra});a&&this.invalid(a,n.subsection)}},valid:function(e,i){var n=[];return e&&(this._fieldmap||this.fieldmap(),t.each(e,function(e){var t=this._fieldmap[(i||"")+"-"+e],s=this._prevalidate[t];if(s)switch(s.input){case"text":this.$el.find("input[name="+t+"]").removeClass("error").parent().find(".error-msg").remove();break;case"password":this.$el.find("input[name="+t+"]").removeClass("error").parent().find(".error-msg").remove(),this.$el.find("input[name="+t+"-text]").removeClass("error");break;default:n.push(e)}},this)),n},invalid:function(e,i){var n={};return e&&(this._fieldmap||this.fieldmap(),t.each(e,function(e,t){var s=this._fieldmap[(i||"")+"-"+t],o=this._prevalidate[s];if(o)switch(o.input){case"text":this.$el.find("input[name="+s+"]").addClass("error").parent().append('<div class="error-msg">'+e+"</div>");break;case"password":this.$el.find("input[name="+s+"]").addClass("error").parent().append('<div class="error-msg">'+e+"</div>"),this.$el.find("input[name="+s+"-text]").addClass("error");break;default:n[t]=e}},this)),n},clear:function(){this.$el.find(".error").removeClass("error").end().find(".error-msg, .success-msg").remove()},devalidate:function(){this._inputs&&t.each(this._inputs,function(e){e.off(".validator")})}}}),function(e,t){function i(t,i){var s,o,a,r=t.nodeName.toLowerCase();return"area"===r?(s=t.parentNode,o=s.name,t.href&&o&&"map"===s.nodeName.toLowerCase()?(a=e("img[usemap=#"+o+"]")[0],!!a&&n(a)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,o=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var n,s,o=e(this[0]);o.length&&o[0]!==document;){if(n=o.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(o.css("zIndex"),10),!isNaN(s)&&0!==s))return s;o=o.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){o.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(o,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var o="Width"===n?["Left","Right"]:["Top","Bottom"],a=n.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?r["inner"+n].call(this):this.each(function(){e(this).css(a,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?r["outer"+n].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,n){var s,o=e.ui[t].prototype;for(s in n)o.plugins[s]=o.plugins[s]||[],o.plugins[s].push([i,n[s]])},call:function(e,t,i){var n,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;n<s.length;n++)e.options[s[n][0]]&&s[n][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[n]>0?!0:(t[n]=1,s=t[n]>0,t[n]=0,s)}})}(jQuery),function(e,t){var i=0,n=Array.prototype.slice,s=e.cleanData;e.cleanData=function(t){for(var i,n=0;null!=(i=t[n]);n++)try{e(i).triggerHandler("remove")}catch(o){}s(t)},e.widget=function(t,i,n){var s,o,a,r,l={},u=t.split(".")[0];t=t.split(".")[1],s=u+"-"+t,n||(n=i,i=e.Widget),e.expr[":"][s.toLowerCase()]=function(t){return!!e.data(t,s)},e[u]=e[u]||{},o=e[u][t],a=e[u][t]=function(e,t){return this._createWidget?void(arguments.length&&this._createWidget(e,t)):new a(e,t)},e.extend(a,o,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(n,function(t,n){return e.isFunction(n)?void(l[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},s=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,o=this._superApply;return this._super=e,this._superApply=s,t=n.apply(this,arguments),this._super=i,this._superApply=o,t}}()):void(l[t]=n)}),a.prototype=e.widget.extend(r,{widgetEventPrefix:o?r.widgetEventPrefix:t},l,{constructor:a,namespace:u,widgetName:t,widgetFullName:s}),o?(e.each(o._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,a,i._proto)}),delete o._childConstructors):i._childConstructors.push(a),e.widget.bridge(t,a)},e.widget.extend=function(i){for(var s,o,a=n.call(arguments,1),r=0,l=a.length;l>r;r++)for(s in a[r])o=a[r][s],a[r].hasOwnProperty(s)&&o!==t&&(i[s]=e.isPlainObject(o)?e.isPlainObject(i[s])?e.widget.extend({},i[s],o):e.widget.extend({},o):o);return i},e.widget.bridge=function(i,s){var o=s.prototype.widgetFullName||i;e.fn[i]=function(a){var r="string"==typeof a,l=n.call(arguments,1),u=this;return a=!r&&l.length?e.widget.extend.apply(null,[a].concat(l)):a,this.each(r?function(){var n,s=e.data(this,o);return s?e.isFunction(s[a])&&"_"!==a.charAt(0)?(n=s[a].apply(s,l),n!==s&&n!==t?(u=n&&n.jquery?u.pushStack(n.get()):n,!1):void 0):e.error("no such method '"+a+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; attempted to call method '"+a+"'")}:function(){var t=e.data(this,o);t?t.option(a||{})._init():e.data(this,o,new s(a,this))}),u}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,n){var s,o,a,r=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(r={},s=i.split("."),i=s.shift(),s.length){for(o=r[i]=e.widget.extend({},this.options[i]),a=0;a<s.length-1;a++)o[s[a]]=o[s[a]]||{},o=o[s[a]];if(i=s.pop(),n===t)return o[i]===t?null:o[i];o[i]=n}else{if(n===t)return this.options[i]===t?null:this.options[i];r[i]=n}return this._setOptions(r),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,i,n){var s,o=this;"boolean"!=typeof t&&(n=i,i=t,t=!1),n?(i=s=e(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,s=this.widget()),e.each(n,function(n,a){function r(){return t||o.options.disabled!==!0&&!e(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||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+o.eventNamespace,c=l[2];c?s.delegate(c,u,r):i.bind(u,r)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?n[e]:e).apply(n,arguments)}var n=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,n){var s,o,a=this.options[t];if(n=n||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(s in o)s in i||(i[s]=o[s]);return this.element.trigger(i,n),!(e.isFunction(a)&&a.apply(this.element[0],[i].concat(n))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(n,s,o){"string"==typeof s&&(s={effect:s});var a,r=s?s===!0||"number"==typeof s?i:s.effect||i:t;s=s||{},"number"==typeof s&&(s={duration:s}),a=!e.isEmptyObject(s),s.complete=o,s.delay&&n.delay(s.delay),a&&e.effects&&e.effects.effect[r]?n[t](s):r!==t&&n[r]?n[r](s.duration,s.easing,o):n.queue(function(i){e(this)[t](),o&&o.call(n[0]),i()})}})}(jQuery),function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var n=this,s=1===i.which,o="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return s&&!o&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return n._mouseMove(e)},this._mouseUpDelegate=function(e){return n._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var i=this.options;return this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var n=this._uiHash();if(this._trigger("drag",t,n)===!1)return this._mouseUp({}),!1;this.position=n.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,n=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1),"original"!==this.options.helper||e.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!n||"valid"===this.options.revert&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var i=this.options,n=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){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(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,n,s=this.options;return s.containment?"window"===s.containment?void(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===s.containment?void(this.containment=[0,0,e(document).width()-this.helperProportions.width-this.margins.left,(e(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):s.containment.constructor===Array?void(this.containment=s.containment):("parent"===s.containment&&(s.containment=this.helper[0].parentNode),i=e(s.containment),n=i[0],void(n&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i))):void(this.containment=null)
},_convertPositionTo:function(t,i){i||(i=this.position);var n="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:s.scrollTop(),left:s.scrollLeft()}),{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*n,left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*n}},_generatePosition:function(t){var i,n,s,o,a=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=t.pageX,u=t.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(n=this.relative_container.offset(),i=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(u=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(u=i[3]+this.offset.click.top)),a.grid&&(s=a.grid[1]?this.originalPageY+Math.round((u-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,u=i?s-this.offset.click.top>=i[1]||s-this.offset.click.top>i[3]?s:s-this.offset.click.top>=i[1]?s-a.grid[1]:s+a.grid[1]:s,o=a.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o)),{top:u-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,i,n){return n=n||this._uiHash(),e.ui.plugin.call(this,t,[i,n]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var n=e(this).data("ui-draggable"),s=n.options,o=e.extend({},i,{item:n.element});n.sortables=[],e(s.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(n.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,o))})},stop:function(t,i){var n=e(this).data("ui-draggable"),s=e.extend({},i,{item:n.element});e.each(n.sortables,function(){this.instance.isOver?(this.instance.isOver=0,n.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===n.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,s))})},drag:function(t,i){var n=e(this).data("ui-draggable"),s=this;e.each(n.sortables,function(){var o=!1,a=this;this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,e.each(n.sortables,function(){return this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this!==a&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(a.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(s).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=n.offset.click.top,this.instance.offset.click.left=n.offset.click.left,this.instance.offset.parent.left-=n.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=n.offset.parent.top-this.instance.offset.parent.top,n._trigger("toSortable",t),n.dropped=this.instance.element,n.currentItem=n.element,this.instance.fromOutside=n),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),n._trigger("fromSortable",t),n.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var n=e(i.helper),s=e(this).data("ui-draggable").options;n.css("opacity")&&(s._opacity=n.css("opacity")),n.css("opacity",s.opacity)},stop:function(t,i){var n=e(this).data("ui-draggable").options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),n=i.options,s=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(n.axis&&"x"===n.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?i.scrollParent[0].scrollTop=s=i.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-i.overflowOffset.top<n.scrollSensitivity&&(i.scrollParent[0].scrollTop=s=i.scrollParent[0].scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?i.scrollParent[0].scrollLeft=s=i.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-i.overflowOffset.left<n.scrollSensitivity&&(i.scrollParent[0].scrollLeft=s=i.scrollParent[0].scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(document).scrollTop()<n.scrollSensitivity?s=e(document).scrollTop(e(document).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<n.scrollSensitivity&&(s=e(document).scrollTop(e(document).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(document).scrollLeft()<n.scrollSensitivity?s=e(document).scrollLeft(e(document).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<n.scrollSensitivity&&(s=e(document).scrollLeft(e(document).scrollLeft()+n.scrollSpeed)))),s!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(i,t)}}),e.ui.plugin.add("draggable","snap",{start:function(){var t=e(this).data("ui-draggable"),i=t.options;t.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=e(this),n=i.offset();this!==t.element[0]&&t.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:n.top,left:n.left})})},drag:function(t,i){var n,s,o,a,r,l,u,c,d,h,p=e(this).data("ui-draggable"),f=p.options,m=f.snapTolerance,g=i.offset.left,_=g+p.helperProportions.width,v=i.offset.top,b=v+p.helperProportions.height;for(d=p.snapElements.length-1;d>=0;d--)r=p.snapElements[d].left,l=r+p.snapElements[d].width,u=p.snapElements[d].top,c=u+p.snapElements[d].height,r-m>_||g>l+m||u-m>b||v>c+m||!e.contains(p.snapElements[d].item.ownerDocument,p.snapElements[d].item)?(p.snapElements[d].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[d].item})),p.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=Math.abs(u-b)<=m,s=Math.abs(c-v)<=m,o=Math.abs(r-_)<=m,a=Math.abs(l-g)<=m,n&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),s&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),h=n||s||o||a,"outer"!==f.snapMode&&(n=Math.abs(u-v)<=m,s=Math.abs(c-b)<=m,o=Math.abs(r-g)<=m,a=Math.abs(l-_)<=m,n&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),s&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[d].snapping&&(n||s||o||a||h)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[d].item})),p.snapElements[d].snapping=n||s||o||a||h)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,n=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});n.length&&(t=parseInt(e(n[0]).css("zIndex"),10)||0,e(n).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+n.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var n=e(i.helper),s=e(this).data("ui-draggable").options;n.css("zIndex")&&(s._zIndex=n.css("zIndex")),n.css("zIndex",s.zIndex)},stop:function(t,i){var n=e(this).data("ui-draggable").options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}})}(jQuery),function(e){function t(e,t,i){return e>t&&t+i>e}e.widget("ui.droppable",{version:"1.10.3",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t=this.options,i=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(i)?i:function(e){return e.is(i)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var t=0,i=e.ui.ddmanager.droppables[this.options.scope];t<i.length;t++)i[t]===this&&i.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){"accept"===t&&(this.accept=e.isFunction(i)?i:function(e){return e.is(i)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var n=i||e.ui.ddmanager.current,s=!1;return n&&(n.currentItem||n.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");return t.options.greedy&&!t.options.disabled&&t.options.scope===n.options.scope&&t.accept.call(t.element[0],n.currentItem||n.element)&&e.ui.intersect(n,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(s=!0,!1):void 0}),s?!1:this.accept.call(this.element[0],n.currentItem||n.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(n)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,i,n){if(!i.offset)return!1;var s,o,a=(e.positionAbs||e.position.absolute).left,r=a+e.helperProportions.width,l=(e.positionAbs||e.position.absolute).top,u=l+e.helperProportions.height,c=i.offset.left,d=c+i.proportions.width,h=i.offset.top,p=h+i.proportions.height;switch(n){case"fit":return a>=c&&d>=r&&l>=h&&p>=u;case"intersect":return c<a+e.helperProportions.width/2&&r-e.helperProportions.width/2<d&&h<l+e.helperProportions.height/2&&u-e.helperProportions.height/2<p;case"pointer":return s=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,o=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,t(o,h,i.proportions.height)&&t(s,c,i.proportions.width);case"touch":return(l>=h&&p>=l||u>=h&&p>=u||h>l&&u>p)&&(a>=c&&d>=a||r>=c&&d>=r||c>a&&r>d);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var n,s,o=e.ui.ddmanager.droppables[t.options.scope]||[],a=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(n=0;n<o.length;n++)if(!(o[n].options.disabled||t&&!o[n].accept.call(o[n].element[0],t.currentItem||t.element))){for(s=0;s<r.length;s++)if(r[s]===o[n].element[0]){o[n].proportions.height=0;continue e}o[n].visible="none"!==o[n].element.css("display"),o[n].visible&&("mousedown"===a&&o[n]._activate.call(o[n],i),o[n].offset=o[n].element.offset(),o[n].proportions={width:o[n].element[0].offsetWidth,height:o[n].element[0].offsetHeight})}},drop:function(t,i){var n=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(n=this._drop.call(this,i)||n),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),n},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var n,s,o,a=e.ui.intersect(t,this,this.options.tolerance),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(s=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===s}),o.length&&(n=e.data(o[0],"ui-droppable"),n.greedyChild="isover"===r)),n&&"isover"===r&&(n.isover=!1,n.isout=!0,n._out.call(n,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),n&&"isout"===r&&(n.isout=!1,n.isover=!0,n._over.call(n,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}}}(jQuery),function(e){function t(e){return parseInt(e,10)||0}function i(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,i,n,s,o,a=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("<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.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{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"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;i<t.length;i++)n=e.trim(t[i]),o="ui-resizable-"+n,s=e("<div class='ui-resizable-handle "+o+"'></div>"),s.css({zIndex:r.zIndex}),"se"===n&&s.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[n]=".ui-resizable-"+n,this.element.append(s);this._renderAxis=function(t){var i,n,s,o;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=e(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(n=e(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?n.outerHeight():n.outerWidth(),s=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(s,o),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){a.resizing||(this.className&&(s=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=s&&s[1]?s[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),a._handles.show())}).mouseleave(function(){r.disabled||a.resizing||(e(this).addClass("ui-resizable-autohide"),a._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,n,s=!1;for(i in this.handles)n=e(this.handles[i])[0],(n===t.target||e.contains(n,t.target))&&(s=!0);return!this.options.disabled&&s},_mouseStart:function(i){var n,s,o,a=this.options,r=this.element.position(),l=this.element;return this.resizing=!0,/absolute/.test(l.css("position"))?l.css({position:"absolute",top:l.css("top"),left:l.css("left")}):l.is(".ui-draggable")&&l.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),n=t(this.helper.css("left")),s=t(this.helper.css("top")),a.containment&&(n+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:n,top:s},this.size=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()},this.originalSize=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()},this.originalPosition={left:n,top:s},this.sizeDiff={width:l.outerWidth()-l.width(),height:l.outerHeight()-l.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,o=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===o?this.axis+"-resize":o),l.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(t){var i,n=this.helper,s={},o=this.originalMousePosition,a=this.axis,r=this.position.top,l=this.position.left,u=this.size.width,c=this.size.height,d=t.pageX-o.left||0,h=t.pageY-o.top||0,p=this._change[a];return p?(i=p.apply(this,[t,d,h]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==r&&(s.top=this.position.top+"px"),this.position.left!==l&&(s.left=this.position.left+"px"),this.size.width!==u&&(s.width=this.size.width+"px"),this.size.height!==c&&(s.height=this.size.height+"px"),n.css(s),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,n,s,o,a,r,l,u=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,n=i.length&&/textarea/i.test(i[0].nodeName),s=n&&e.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,o=n?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-s},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,l=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,u.animate||this.element.css(e.extend(a,{top:l,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!u.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,n,s,o,a,r=this.options;a={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,n=a.maxHeight*this.aspectRatio,o=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),n<a.maxWidth&&(a.maxWidth=n),o<a.maxHeight&&(a.maxHeight=o)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),i(e.left)&&(this.position.left=e.left),i(e.top)&&(this.position.top=e.top),i(e.height)&&(this.size.height=e.height),i(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,n=this.size,s=this.axis;return i(e.height)?e.width=e.height*this.aspectRatio:i(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(n.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(n.height-e.height),e.left=t.left+(n.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,n=this.axis,s=i(e.width)&&t.maxWidth&&t.maxWidth<e.width,o=i(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=i(e.width)&&t.minWidth&&t.minWidth>e.width,r=i(e.height)&&t.minHeight&&t.minHeight>e.height,l=this.originalPosition.left+this.originalSize.width,u=this.position.top+this.size.height,c=/sw|nw|w/.test(n),d=/nw|ne|n/.test(n);return a&&(e.width=t.minWidth),r&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),o&&(e.height=t.maxHeight),a&&c&&(e.left=l-t.minWidth),s&&c&&(e.left=l-t.maxWidth),r&&d&&(e.top=u-t.minHeight),o&&d&&(e.top=u-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,n,s,o=this.helper||this.element;for(e=0;e<this._proportionallyResizeElements.length;e++){if(s=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[s.css("borderTopWidth"),s.css("borderRightWidth"),s.css("borderBottomWidth"),s.css("borderLeftWidth")],n=[s.css("paddingTop"),s.css("paddingRight"),s.css("paddingBottom"),s.css("paddingLeft")],t=0;t<i.length;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(n[t],10)||0);s.css({height:o.height()-this.borderDif[0]-this.borderDif[2]||0,width:o.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,n=this.originalPosition;return{left:n.left+t,width:i.width-t}},n:function(e,t,i){var n=this.originalSize,s=this.originalPosition;return{top:s.top+i,height:n.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,n){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,n]))},sw:function(t,i,n){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,n]))},ne:function(t,i,n){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,n]))},nw:function(t,i,n){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,n]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).data("ui-resizable"),n=i.options,s=i._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),a=o&&e.ui.hasScroll(s[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,l={width:i.size.width-r,height:i.size.height-a},u=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(l,c&&u?{top:c,left:u}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var n={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var i,n,s,o,a,r,l,u=e(this).data("ui-resizable"),c=u.options,d=u.element,h=c.containment,p=h instanceof e?h.get(0):/parent/.test(h)?d.parent().get(0):h;p&&(u.containerElement=e(p),/document/.test(h)||h===document?(u.containerOffset={left:0,top:0},u.containerPosition={left:0,top:0},u.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(i=e(p),n=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){n[e]=t(i.css("padding"+s))}),u.containerOffset=i.offset(),u.containerPosition=i.position(),u.containerSize={height:i.innerHeight()-n[3],width:i.innerWidth()-n[1]},s=u.containerOffset,o=u.containerSize.height,a=u.containerSize.width,r=e.ui.hasScroll(p,"left")?p.scrollWidth:a,l=e.ui.hasScroll(p)?p.scrollHeight:o,u.parentData={element:p,left:s.left,top:s.top,width:r,height:l}))},resize:function(t){var i,n,s,o,a=e(this).data("ui-resizable"),r=a.options,l=a.containerOffset,u=a.position,c=a._aspectRatio||t.shiftKey,d={top:0,left:0},h=a.containerElement;h[0]!==document&&/static/.test(h.css("position"))&&(d=l),u.left<(a._helper?l.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-l.left:a.position.left-d.left),c&&(a.size.height=a.size.width/a.aspectRatio),a.position.left=r.helper?l.left:0),u.top<(a._helper?l.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-l.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio),a.position.top=a._helper?l.top:0),a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top,i=Math.abs((a._helper?a.offset.left-d.left:a.offset.left-d.left)+a.sizeDiff.width),n=Math.abs((a._helper?a.offset.top-d.top:a.offset.top-l.top)+a.sizeDiff.height),s=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),s&&o&&(i-=a.parentData.left),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio)),n+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-n,c&&(a.size.width=a.size.height*a.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,n=t.containerOffset,s=t.containerPosition,o=t.containerElement,a=e(t.helper),r=a.offset(),l=a.outerWidth()-t.sizeDiff.width,u=a.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(o.css("position"))&&e(this).css({left:r.left-s.left-n.left,width:l,height:u}),t._helper&&!i.animate&&/static/.test(o.css("position"))&&e(this).css({left:r.left-s.left-n.left,width:l,height:u})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,n=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?n(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],n(i.alsoResize)):e.each(i.alsoResize,function(e){n(e)})},resize:function(t,i){var n=e(this).data("ui-resizable"),s=n.options,o=n.originalSize,a=n.originalPosition,r={height:n.size.height-o.height||0,width:n.size.width-o.width||0,top:n.position.top-a.top||0,left:n.position.left-a.left||0},l=function(t,n){e(t).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),o={},a=n&&n.length?n:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(s[t]||0)+(r[t]||0);i&&i>=0&&(o[t]=i||null)}),t.css(o)})};"object"!=typeof s.alsoResize||s.alsoResize.nodeType?l(s.alsoResize):e.each(s.alsoResize,function(e,t){l(e,t)
})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,n=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),i=t.options,n=t.size,s=t.originalSize,o=t.originalPosition,a=t.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,l=r[0]||1,u=r[1]||1,c=Math.round((n.width-s.width)/l)*l,d=Math.round((n.height-s.height)/u)*u,h=s.width+c,p=s.height+d,f=i.maxWidth&&i.maxWidth<h,m=i.maxHeight&&i.maxHeight<p,g=i.minWidth&&i.minWidth>h,_=i.minHeight&&i.minHeight>p;i.grid=r,g&&(h+=l),_&&(p+=u),f&&(h-=l),m&&(p-=u),/^(se|s|e)$/.test(a)?(t.size.width=h,t.size.height=p):/^(ne)$/.test(a)?(t.size.width=h,t.size.height=p,t.position.top=o.top-d):/^(sw)$/.test(a)?(t.size.width=h,t.size.height=p,t.position.left=o.left-c):(t.size.width=h,t.size.height=p,t.position.top=o.top-d,t.position.left=o.left-c)}})}(jQuery),function(e){e.widget("ui.selectable",e.ui.mouse,{version:"1.10.3",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,n=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(n.filter,this.element[0]),this._trigger("start",t),e(n.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),n.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var n=e.data(this,"selectable-item");n.startselected=!0,t.metaKey||t.ctrlKey||(n.$element.removeClass("ui-selected"),n.selected=!1,n.$element.addClass("ui-unselecting"),n.unselecting=!0,i._trigger("unselecting",t,{unselecting:n.element}))}),e(t.target).parents().addBack().each(function(){var n,s=e.data(this,"selectable-item");return s?(n=!t.metaKey&&!t.ctrlKey||!s.$element.hasClass("ui-selected"),s.$element.removeClass(n?"ui-unselecting":"ui-selected").addClass(n?"ui-selecting":"ui-unselecting"),s.unselecting=!n,s.selecting=n,s.selected=n,n?i._trigger("selecting",t,{selecting:s.element}):i._trigger("unselecting",t,{unselecting:s.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,n=this,s=this.options,o=this.opos[0],a=this.opos[1],r=t.pageX,l=t.pageY;return o>r&&(i=r,r=o,o=i),a>l&&(i=l,l=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:l-a}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),u=!1;i&&i.element!==n.element[0]&&("touch"===s.tolerance?u=!(i.left>r||i.right<o||i.top>l||i.bottom<a):"fit"===s.tolerance&&(u=i.left>o&&i.right<r&&i.top>a&&i.bottom<l),u?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,n._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),n._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,n._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var n=e.data(this,"selectable-item");n.$element.removeClass("ui-unselecting"),n.unselecting=!1,n.startselected=!1,i._trigger("unselected",t,{unselected:n.element})}),e(".ui-selecting",this.element[0]).each(function(){var n=e.data(this,"selectable-item");n.$element.removeClass("ui-selecting").addClass("ui-selected"),n.selecting=!1,n.selected=!0,n.startselected=!0,i._trigger("selected",t,{selected:n.element})}),this._trigger("stop",t),this.helper.remove(),!1}})}(jQuery),function(e){function t(e,t,i){return e>t&&t+i>e}function i(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))}e.widget("ui.sortable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===e.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,i){"disabled"===t?(this.options[t]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,i){var n=null,s=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,o.widgetName+"-item")===o?(n=e(this),!1):void 0}),e.data(t.target,o.widgetName+"-item")===o&&(n=e(t.target)),n&&(!this.options.handle||i||(e(this.options.handle,n).find("*").addBack().each(function(){this===t.target&&(s=!0)}),s))?(this.currentItem=n,this._removeCurrentsFromItems(),!0):!1)},_mouseStart:function(t,i,n){var s,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=e("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!a.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,n,s,o,a=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:t.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:t.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(t.pageY-e(document).scrollTop()<a.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-a.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<a.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+a.scrollSpeed)),t.pageX-e(document).scrollLeft()<a.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-a.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<a.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+a.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!a.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(n=this.items[i],s=n.item[0],o=this._intersectsWithPointer(n),o&&n.instance===this.currentContainer&&s!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==s&&!e.contains(this.placeholder[0],s)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],s):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(n))break;this._rearrange(t,n),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var n=this,s=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){n._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),n=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&n.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!n.length&&t.key&&n.push(t.key+"="),n.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),n=[];return t=t||{},i.each(function(){n.push(e(t.item||this).attr(t.attribute||"id")||"")}),n},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,n=this.positionAbs.top,s=n+this.helperProportions.height,o=e.left,a=o+e.width,r=e.top,l=r+e.height,u=this.offset.click.top,c=this.offset.click.left,d="x"===this.options.axis||n+u>r&&l>n+u,h="y"===this.options.axis||t+c>o&&a>t+c,p=d&&h;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:o<t+this.helperProportions.width/2&&i-this.helperProportions.width/2<a&&r<n+this.helperProportions.height/2&&s-this.helperProportions.height/2<l},_intersectsWithPointer:function(e){var i="x"===this.options.axis||t(this.positionAbs.top+this.offset.click.top,e.top,e.height),n="y"===this.options.axis||t(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=i&&n,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(e){var i=t(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),n=t(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&n||"left"===o&&!n:s&&("down"===s&&i||"up"===s&&!i)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var i,n,s,o,a=[],r=[],l=this._connectWith();if(l&&t)for(i=l.length-1;i>=0;i--)for(s=e(l[i]),n=s.length-1;n>=0;n--)o=e.data(s[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&r.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(r.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=r.length-1;i>=0;i--)r[i][0].each(function(){a.push(this)});return e(a)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;i<t.length;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,n,s,o,a,r,l,u,c=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],h=this._connectWith();if(h&&this.ready)for(i=h.length-1;i>=0;i--)for(s=e(h[i]),n=s.length-1;n>=0;n--)o=e.data(s[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(d.push([e.isFunction(o.options.items)?o.options.items.call(o.element[0],t,{item:this.currentItem}):e(o.options.items,o.element),o]),this.containers.push(o));for(i=d.length-1;i>=0;i--)for(a=d[i][1],r=d[i][0],n=0,u=r.length;u>n;n++)l=e(r[n]),l.data(this.widgetName+"-item",a),c.push({item:l,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,n,s,o;for(i=this.items.length-1;i>=0;i--)n=this.items[i],n.instance!==this.currentContainer&&this.currentContainer&&n.item[0]!==this.currentItem[0]||(s=this.options.toleranceElement?e(this.options.toleranceElement,n.item):n.item,t||(n.width=s.outerWidth(),n.height=s.outerHeight()),o=s.offset(),n.left=o.left,n.top=o.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--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.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(t){t=t||this;var i,n=t.options;n.placeholder&&n.placeholder.constructor!==String||(i=n.placeholder,n.placeholder={element:function(){var n=t.currentItem[0].nodeName.toLowerCase(),s=e("<"+n+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===n?t.currentItem.children().each(function(){e("<td>&#160;</td>",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(s)}):"img"===n&&s.attr("src",t.currentItem.attr("src")),i||s.css("visibility","hidden"),s},update:function(e,s){(!i||n.forcePlaceholderSize)&&(s.height()||s.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),s.width()||s.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(n.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),n.placeholder.update(t,t.placeholder)},_contactContainers:function(n){var s,o,a,r,l,u,c,d,h,p,f=null,m=null;for(s=this.containers.length-1;s>=0;s--)if(!e.contains(this.currentItem[0],this.containers[s].element[0]))if(this._intersectsWith(this.containers[s].containerCache)){if(f&&e.contains(this.containers[s].element[0],f.element[0]))continue;f=this.containers[s],m=s}else this.containers[s].containerCache.over&&(this.containers[s]._trigger("out",n,this._uiHash(this)),this.containers[s].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger("over",n,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(a=1e4,r=null,p=f.floating||i(this.currentItem),l=p?"left":"top",u=p?"width":"height",c=this.positionAbs[l]+this.offset.click[l],o=this.items.length-1;o>=0;o--)e.contains(this.containers[m].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||t(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(d=this.items[o].item.offset()[l],h=!1,Math.abs(d-c)>Math.abs(d+this.items[o][u]-c)&&(h=!0,d+=this.items[o][u]),Math.abs(d-c)<a&&(a=Math.abs(d-c),r=this.items[o],this.direction=h?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[m])return;r?this._rearrange(n,r,null,!0):this._rearrange(n,null,this.containers[m].element,!0),this._trigger("change",n,this._uiHash()),this.containers[m]._trigger("change",n,this._uiHash(this)),this.currentContainer=this.containers[m],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[m]._trigger("over",n,this._uiHash(this)),this.containers[m].containerCache.over=1}},_createHelper:function(t){var i=this.options,n=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return n.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(n[0]),n[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")}),(!n[0].style.width||i.forceHelperSize)&&n.width(this.currentItem.width()),(!n[0].style.height||i.forceHelperSize)&&n.height(this.currentItem.height()),n},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,n,s=this.options;"parent"===s.containment&&(s.containment=this.helper[0].parentNode),("document"===s.containment||"window"===s.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e("document"===s.containment?document:window).width()-this.helperProportions.width-this.margins.left,(e("document"===s.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(s.containment)||(t=e(s.containment)[0],i=e(s.containment).offset(),n="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(n?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(n?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var n="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:s.scrollTop())*n,left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*n}},_generatePosition:function(t){var i,n,s=this.options,o=t.pageX,a=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),s.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-s.grid[1]:i+s.grid[1]:i,n=this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0],o=this.containment?n-this.offset.click.left>=this.containment[0]&&n-this.offset.click.left<=this.containment[2]?n:n-this.offset.click.left>=this.containment[0]?n-s.grid[0]:n+s.grid[0]:n)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:r.scrollLeft())}},_rearrange:function(e,t,i,n){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var s=this.counter;this._delay(function(){s===this.counter&&this.refreshPositions(!n)})},_clear:function(e,t){this.reverting=!1;var i,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)t||n.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(n.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!t){for(this._trigger("beforeStop",e,this._uiHash()),i=0;i<n.length;i++)n[i].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!t){for(i=0;i<n.length;i++)n[i].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}})}(jQuery),function(e,t){var i="ui-effects-";e.effects={effect:{}},function(e,t){function i(e,t,i){var n=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=n.floor?~~e:parseFloat(e),isNaN(e)?t.def:n.mod?(e+n.mod)%n.mod:0>e?0:n.max<e?n.max:e)}function n(t){var i=u(),n=i._rgba=[];return t=t.toLowerCase(),f(l,function(e,s){var o,a=s.re.exec(t),r=a&&s.parse(a),l=s.space||"rgba";return r?(o=i[l](r),i[c[l].cache]=o[c[l].cache],n=i._rgba=o._rgba,!1):void 0}),n.length?("0,0,0,0"===n.join()&&e.extend(n,o.transparent),i):o[t]}function s(e,t,i){return i=(i+1)%1,1>6*i?e+(t-e)*i*6:1>2*i?t:2>3*i?e+(t-e)*(2/3-i)*6:e}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],u=e.Color=function(t,i,n,s){return new e.Color.fn.parse(t,i,n,s)},c={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"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},h=u.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",h.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),u.fn=e.extend(u.prototype,{parse:function(s,a,r,l){if(s===t)return this._rgba=[null,null,null,null],this;(s.jquery||s.nodeType)&&(s=e(s).css(a),a=t);var d=this,h=e.type(s),p=this._rgba=[];return a!==t&&(s=[s,a,r,l],h="array"),"string"===h?this.parse(n(s)||o._default):"array"===h?(f(c.rgba.props,function(e,t){p[t.idx]=i(s[t.idx],t)}),this):"object"===h?(s instanceof u?f(c,function(e,t){s[t.cache]&&(d[t.cache]=s[t.cache].slice())}):f(c,function(t,n){var o=n.cache;
f(n.props,function(e,t){if(!d[o]&&n.to){if("alpha"===e||null==s[e])return;d[o]=n.to(d._rgba)}d[o][t.idx]=i(s[e],t,!0)}),d[o]&&e.inArray(null,d[o].slice(0,3))<0&&(d[o][3]=1,n.from&&(d._rgba=n.from(d[o])))}),this):void 0},is:function(e){var t=u(e),i=!0,n=this;return f(c,function(e,s){var o,a=t[s.cache];return a&&(o=n[s.cache]||s.to&&s.to(n._rgba)||[],f(s.props,function(e,t){return null!=a[t.idx]?i=a[t.idx]===o[t.idx]:void 0})),i}),i},_space:function(){var e=[],t=this;return f(c,function(i,n){t[n.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var n=u(e),s=n._space(),o=c[s],a=0===this.alpha()?u("transparent"):this,r=a[o.cache]||o.to(a._rgba),l=r.slice();return n=n[o.cache],f(o.props,function(e,s){var o=s.idx,a=r[o],u=n[o],c=d[s.type]||{};null!==u&&(null===a?l[o]=u:(c.mod&&(u-a>c.mod/2?a+=c.mod:a-u>c.mod/2&&(a-=c.mod)),l[o]=i((u-a)*t+a,s)))}),this[s](l)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),n=i.pop(),s=u(t)._rgba;return u(e.map(i,function(e,t){return(1-n)*s[t]+n*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),n=i.pop();return t&&i.push(~~(255*n)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),u.fn.parse.prototype=u.fn,c.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,n=e[0]/255,s=e[1]/255,o=e[2]/255,a=e[3],r=Math.max(n,s,o),l=Math.min(n,s,o),u=r-l,c=r+l,d=.5*c;return t=l===r?0:n===r?60*(s-o)/u+360:s===r?60*(o-n)/u+120:60*(n-s)/u+240,i=0===u?0:.5>=d?u/c:u/(2-c),[Math.round(t)%360,i,d,null==a?1:a]},c.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],n=e[2],o=e[3],a=.5>=n?n*(1+i):n+i-n*i,r=2*n-a;return[Math.round(255*s(r,a,t+1/3)),Math.round(255*s(r,a,t)),Math.round(255*s(r,a,t-1/3)),o]},f(c,function(n,s){var o=s.props,a=s.cache,l=s.to,c=s.from;u.fn[n]=function(n){if(l&&!this[a]&&(this[a]=l(this._rgba)),n===t)return this[a].slice();var s,r=e.type(n),d="array"===r||"object"===r?n:arguments,h=this[a].slice();return f(o,function(e,t){var n=d["object"===r?e:t.idx];null==n&&(n=h[t.idx]),h[t.idx]=i(n,t)}),c?(s=u(c(h)),s[a]=h,s):u(h)},f(o,function(t,i){u.fn[t]||(u.fn[t]=function(s){var o,a=e.type(s),l="alpha"===t?this._hsla?"hsla":"rgba":n,u=this[l](),c=u[i.idx];return"undefined"===a?c:("function"===a&&(s=s.call(this,c),a=e.type(s)),null==s&&i.empty?this:("string"===a&&(o=r.exec(s),o&&(s=c+parseFloat(o[2])*("+"===o[1]?1:-1))),u[i.idx]=s,this[l](u)))})})}),u.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,s){var o,a,r="";if("transparent"!==s&&("string"!==e.type(s)||(o=n(s)))){if(s=u(o||s),!h.rgba&&1!==s._rgba[3]){for(a="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&a&&a.style;)try{r=e.css(a,"backgroundColor"),a=a.parentNode}catch(l){}s=s.blend(r&&"transparent"!==r?r:"_default")}s=s.toRgbaString()}try{t.style[i]=s}catch(l){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=u(t.elem,i),t.end=u(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},u.hook(a),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,n){t["border"+n+"Color"]=e}),t}},o=e.Color.names={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",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(t){var i,n,s=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,o={};if(s&&s.length&&s[0]&&s[s[0]])for(n=s.length;n--;)i=s[n],"string"==typeof s[i]&&(o[e.camelCase(i)]=s[i]);else for(i in s)"string"==typeof s[i]&&(o[i]=s[i]);return o}function n(t,i){var n,s,a={};for(n in i)s=i[n],t[n]!==s&&(o[n]||(e.fx.step[n]||!isNaN(parseFloat(s)))&&(a[n]=s));return a}var s=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(jQuery.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(t,o,a,r){var l=e.speed(o,a,r);return this.queue(function(){var o,a=e(this),r=a.attr("class")||"",u=l.children?a.find("*").addBack():a;u=u.map(function(){var t=e(this);return{el:t,start:i(this)}}),o=function(){e.each(s,function(e,i){t[i]&&a[i+"Class"](t[i])})},o(),u=u.map(function(){return this.end=i(this.el[0]),this.diff=n(this.start,this.end),this}),a.attr("class",r),u=u.map(function(){var t=this,i=e.Deferred(),n=e.extend({},l,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,n),i.promise()}),e.when.apply(e,u.get()).done(function(){o(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),l.complete.call(a[0])})})},e.fn.extend({addClass:function(t){return function(i,n,s,o){return n?e.effects.animateClass.call(this,{add:i},n,s,o):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,n,s,o){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},n,s,o):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(i){return function(n,s,o,a,r){return"boolean"==typeof s||s===t?o?e.effects.animateClass.call(this,s?{add:n}:{remove:n},o,a,r):i.apply(this,arguments):e.effects.animateClass.call(this,{toggle:n},s,o,a)}}(e.fn.toggleClass),switchClass:function(t,i,n,s,o){return e.effects.animateClass.call(this,{add:i,remove:t},n,s,o)}})}(),function(){function n(t,i,n,s){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(s=i,n=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(s=n,n=i,i={}),e.isFunction(n)&&(s=n,n=null),i&&e.extend(t,i),n=n||i.duration,t.duration=e.fx.off?0:"number"==typeof n?n:n in e.fx.speeds?e.fx.speeds[n]:e.fx.speeds._default,t.complete=s||i.complete,t}function s(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.10.3",save:function(e,t){for(var n=0;n<t.length;n++)null!==t[n]&&e.data(i+t[n],e[0].style[t[n]])},restore:function(e,n){var s,o;for(o=0;o<n.length;o++)null!==n[o]&&(s=e.data(i+n[o]),s===t&&(s=""),e.css(n[o],s))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,n;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":n=0;break;case"center":n=.5;break;case"right":n=1;break;default:n=e[1]/t.width}return{x:n,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},n=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),s={width:t.width(),height:t.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return t.wrap(n),(t[0]===o||e.contains(t[0],o))&&e(o).focus(),n=t.parent(),"static"===t.css("position")?(n.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,n){i[n]=t.css(n),isNaN(parseInt(i[n],10))&&(i[n]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(s),n.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,n,s){return s=s||{},e.each(i,function(e,i){var o=t.cssUnit(i);o[0]>0&&(s[i]=o[0]*n+o[1])}),s}}),e.fn.extend({effect:function(){function t(t){function n(){e.isFunction(o)&&o.call(s[0]),e.isFunction(t)&&t()}var s=e(this),o=i.complete,r=i.mode;(s.is(":hidden")?"hide"===r:"show"===r)?(s[r](),n()):a.call(s[0],i,n)}var i=n.apply(this,arguments),s=i.mode,o=i.queue,a=e.effects.effect[i.effect];return e.fx.off||!a?s?this[s](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):o===!1?this.each(t):this.queue(o||"fx",t)},show:function(e){return function(t){if(s(t))return e.apply(this,arguments);var i=n.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(e.fn.show),hide:function(e){return function(t){if(s(t))return e.apply(this,arguments);var i=n.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(e.fn.hide),toggle:function(e){return function(t){if(s(t)||"boolean"==typeof t)return e.apply(this,arguments);var i=n.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),n=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(n=[parseFloat(i),t])}),n}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;e<((t=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}()}(jQuery),function(e){var t=0,i={},n={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",n.height=n.paddingTop=n.paddingBottom=n.borderTopWidth=n.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.10.3",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e(),content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?void this._activate(t):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),void("disabled"===e&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)))},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,n=this.headers.length,s=this.headers.index(t.target),o=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(s+1)%n];break;case i.LEFT:case i.UP:o=this.headers[(s-1+n)%n];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[n-1]}o&&(e(t.target).attr("tabIndex",-1),e(o).attr("tabIndex",0),o.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,n=this.options,s=n.heightStyle,o=this.element.parent(),a=this.accordionId="ui-accordion-"+(this.element.attr("id")||++t);this.active=this._findActive(n.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(t){var i=e(this),n=i.attr("id"),s=i.next(),o=s.attr("id");n||(n=a+"-header-"+t,i.attr("id",n)),o||(o=a+"-panel-"+t,s.attr("id",o)),i.attr("aria-controls",o),s.attr("aria-labelledby",n)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(n.event),"fill"===s?(i=o.height(),this.element.siblings(":visible").each(function(){var t=e(this),n=t.css("position");"absolute"!==n&&"fixed"!==n&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(i=0,this.headers.next().each(function(){i=Math.max(i,e(this).css("height","").height())}).height(i))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,n=this.active,s=e(t.currentTarget),o=s[0]===n[0],a=o&&i.collapsible,r=a?e():s.next(),l=n.next(),u={oldHeader:n,oldPanel:l,newHeader:a?e():s,newPanel:r};t.preventDefault(),o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=a?!1:this.headers.index(s),this.active=o?e():s,this._toggle(u),n.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),o||(s.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),s.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,n=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=n,this.options.animate?this._animate(i,n,t):(n.hide(),i.show(),this._toggleComplete(t)),n.attr({"aria-expanded":"false","aria-hidden":"true"}),n.prev().attr("aria-selected","false"),i.length&&n.length?n.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,s){var o,a,r,l=this,u=0,c=e.length&&(!t.length||e.index()<t.index()),d=this.options.animate||{},h=c&&d.down||d,p=function(){l._toggleComplete(s)};return"number"==typeof h&&(r=h),"string"==typeof h&&(a=h),a=a||h.easing||d.easing,r=r||h.duration||d.duration,t.length?e.length?(o=e.show().outerHeight(),t.animate(i,{duration:r,easing:a,step:function(e,t){t.now=Math.round(e)}}),void e.hide().animate(n,{duration:r,easing:a,complete:p,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?u+=i.now:"content"!==l.options.heightStyle&&(i.now=Math.round(o-t.outerHeight()-u),u=0)}})):t.animate(i,r,a,p):e.animate(n,r,a,p)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}})}(jQuery),function(e){var t=0;e.widget("ui.autocomplete",{version:"1.10.3",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},pending:0,_create:function(){var t,i,n,s=this.element[0].nodeName.toLowerCase(),o="textarea"===s,a="input"===s;this.isMultiLine=o?!0:a?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(s){if(this.element.prop("readOnly"))return t=!0,n=!0,void(i=!0);t=!1,n=!1,i=!1;var o=e.ui.keyCode;switch(s.keyCode){case o.PAGE_UP:t=!0,this._move("previousPage",s);break;case o.PAGE_DOWN:t=!0,this._move("nextPage",s);break;case o.UP:t=!0,this._keyEvent("previous",s);break;case o.DOWN:t=!0,this._keyEvent("next",s);break;case o.ENTER:case o.NUMPAD_ENTER:this.menu.active&&(t=!0,s.preventDefault(),this.menu.select(s));break;case o.TAB:this.menu.active&&this.menu.select(s);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(s),s.preventDefault());break;default:i=!0,this._searchTimeout(s)}},keypress:function(n){if(t)return t=!1,void((!this.isMultiLine||this.menu.element.is(":visible"))&&n.preventDefault());if(!i){var s=e.ui.keyCode;switch(n.keyCode){case s.PAGE_UP:this._move("previousPage",n);break;case s.PAGE_DOWN:this._move("nextPage",n);break;case s.UP:this._keyEvent("previous",n);break;case s.DOWN:this._keyEvent("next",n)}}},input:function(e){return n?(n=!1,void e.preventDefault()):void this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(e),void this._change(e))}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(n){n.target===t.element[0]||n.target===i||e.contains(i,n.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)});var n=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:n})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value):this.liveRegion.text(n.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,n=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,n){n(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,s){n.xhr&&n.xhr.abort(),n.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){s(e)},error:function(){s([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=this,i=++t;return function(n){i===t&&e.__response(n),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var n=this;e.each(i,function(e,i){n._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),void this.menu.blur()):void this.menu[e](t):void this.search(null,t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var n=new RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return n.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})}(jQuery),function(e){var t,i,n,s,o="ui-button ui-widget ui-state-default ui-corner-all",a="ui-state-hover ui-state-active ",r="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",l=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},u=function(t){var i=t.name,n=t.form,s=e([]);return i&&(i=i.replace(/'/g,"\\'"),s=n?e(n).find("[name='"+i+"']"):e("[name='"+i+"']",t.ownerDocument).filter(function(){return!this.form})),s};e.widget("ui.button",{version:"1.10.3",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,l),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var a=this,r=this.options,c="checkbox"===this.type||"radio"===this.type,d=c?"":"ui-state-active",h="ui-state-focus";null===r.label&&(r.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){r.disabled||this===t&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){r.disabled||e(this).removeClass(d)}).bind("click"+this.eventNamespace,function(e){r.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){a.buttonElement.addClass(h)}).bind("blur"+this.eventNamespace,function(){a.buttonElement.removeClass(h)}),c&&(this.element.bind("change"+this.eventNamespace,function(){s||a.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){r.disabled||(s=!1,i=e.pageX,n=e.pageY)}).bind("mouseup"+this.eventNamespace,function(e){r.disabled||(i!==e.pageX||n!==e.pageY)&&(s=!0)})),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return r.disabled||s?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(r.disabled||s)return!1;e(this).addClass("ui-state-active"),a.buttonElement.attr("aria-pressed","true");var t=a.element[0];u(t).not(t).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return r.disabled?!1:(e(this).addClass("ui-state-active"),t=this,void a.document.one("mouseup",function(){t=null}))}).bind("mouseup"+this.eventNamespace,function(){return r.disabled?!1:void e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){return r.disabled?!1:void((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"))}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",r.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+a+" "+r).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?void(t?this.element.prop("disabled",!0):this.element.prop("disabled",!1)):void this._resetButton()},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?u(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return void(this.options.label&&this.element.val(this.options.label));var t=this.buttonElement.removeClass(r),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),n=this.options.icons,s=n.primary&&n.secondary,o=[];n.primary||n.secondary?(this.options.text&&o.push("ui-button-text-icon"+(s?"s":n.primary?"-primary":"-secondary")),n.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+n.primary+"'></span>"),n.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+n.secondary+"'></span>"),this.options.text||(o.push(s?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):o.push("ui-button-text-only"),t.addClass(o.join(" "))}}),e.widget("ui.buttonset",{version:"1.10.3",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")
},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})}(jQuery),function(e,t){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.dpDiv=n(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){e.datepicker._isDisabledDatepicker(o.inline?t.parent()[0]:o.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function s(t,i){e.extend(t,i);for(var n in i)null==i[n]&&(t[n]=i[n]);return t}e.extend(e.ui,{datepicker:{version:"1.10.3"}});var o,a="datepicker";e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return s(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var n,s,o;n=t.nodeName.toLowerCase(),s="div"===n||"span"===n,t.id||(this.uuid+=1,t.id="dp"+this.uuid),o=this._newInst(e(t),s),o.settings=e.extend({},i||{}),"input"===n?this._connectDatepicker(t,o):s&&this._inlineDatepicker(t,o)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var n=e(t);i.append=e([]),i.trigger=e([]),n.hasClass(this.markerClassName)||(this._attachments(n,i),n.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,a,i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var n,s,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=e("<span class='"+this._appendClass+"'>"+a+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),n=this._get(i,"showOn"),("focus"===n||"both"===n)&&t.focus(this._showDatepicker),("button"===n||"both"===n)&&(s=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:o,alt:s,title:s}):e("<button type='button'></button>").addClass(this._triggerClass).html(o?e("<img/>").attr({src:o,alt:s,title:s}):s)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,n,s,o=new Date(2009,11,20),a=this._get(e,"dateFormat");a.match(/[DM]/)&&(t=function(e){for(i=0,n=0,s=0;s<e.length;s++)e[s].length>i&&(i=e[s].length,n=s);return n},o.setMonth(t(this._get(e,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(t(this._get(e,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),e.input.attr("size",this._formatDate(e,o).length)}},_inlineDatepicker:function(t,i){var n=e(t);n.hasClass(this.markerClassName)||(n.addClass(this.markerClassName).append(i.dpDiv),e.data(t,a,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,n,o,r){var l,u,c,d,h,p=this._dialogInst;return p||(this.uuid+=1,l="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+l+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],a,p)),s(p.settings,o||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=r?r.length?r:[r.pageX,r.pageY]:null,this._pos||(u=document.documentElement.clientWidth,c=document.documentElement.clientHeight,d=document.documentElement.scrollLeft||document.body.scrollLeft,h=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[u/2-100+d,c/2-150+h]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],a,p),this},_destroyDatepicker:function(t){var i,n=e(t),s=e.data(t,a);n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,a),"input"===i?(s.append.remove(),s.trigger.remove(),n.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&n.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,n,s=e(t),o=e.data(t,a);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(n=s.children("."+this._inlineClass),n.children().removeClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,n,s=e(t),o=e.data(t,a);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(n=s.children("."+this._inlineClass),n.children().addClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,a)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,n,o){var a,r,l,u,c=this._getInst(i);return 2===arguments.length&&"string"==typeof n?"defaults"===n?e.extend({},e.datepicker._defaults):c?"all"===n?e.extend({},c.settings):this._get(c,n):null:(a=n||{},"string"==typeof n&&(a={},a[n]=o),void(c&&(this._curInst===c&&this._hideDatepicker(),r=this._getDateDatepicker(i,!0),l=this._getMinMaxDate(c,"min"),u=this._getMinMaxDate(c,"max"),s(c.settings,a),null!==l&&a.dateFormat!==t&&a.minDate===t&&(c.settings.minDate=this._formatDate(c,l)),null!==u&&a.dateFormat!==t&&a.maxDate===t&&(c.settings.maxDate=this._formatDate(c,u)),"disabled"in a&&(a.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(e(i),c),this._autoSize(c),this._setDate(c,r),this._updateAlternate(c),this._updateDatepicker(c))))},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,n,s,o=e.datepicker._getInst(t.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),a=!1;break;case 13:return s=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",o.dpDiv),s[0]&&e.datepicker._selectDay(t.target,o.selectedMonth,o.selectedYear,s[0]),i=e.datepicker._get(o,"onSelect"),i?(n=e.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[n,o])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(o,"stepBigMonths"):-e.datepicker._get(o,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(o,"stepBigMonths"):+e.datepicker._get(o,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),a=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),a=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),a=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(o,"stepBigMonths"):-e.datepicker._get(o,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),a=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),a=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(o,"stepBigMonths"):+e.datepicker._get(o,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),a=t.ctrlKey||t.metaKey;break;default:a=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):a=!1;a&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,n,s=e.datepicker._getInst(t.target);return e.datepicker._get(s,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(s,"dateFormat")),n=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">n||!i||i.indexOf(n)>-1):void 0},_doKeyUp:function(t){var i,n=e.datepicker._getInst(t.target);if(n.input.val()!==n.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(n,"dateFormat"),n.input?n.input.val():null,e.datepicker._getFormatConfig(n)),i&&(e.datepicker._setDateFromField(n),e.datepicker._updateAlternate(n),e.datepicker._updateDatepicker(n))}catch(s){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,o,a,r,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),o=n?n.apply(t,[t,i]):{},o!==!1&&(s(i.settings,o),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),a=!1,e(t).parents().each(function(){return a|="fixed"===e(this).css("position"),!a}),r={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),r=e.datepicker._checkOffset(i,r,a),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":a?"fixed":"absolute",display:"none",left:r.left+"px",top:r.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,o=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,n=this._getNumberOfMonths(t),s=n[1],a=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",a*s+"em"),t.dpDiv[(1!==n[0]||1!==n[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,n){var s=t.dpDiv.outerWidth(),o=t.dpDiv.outerHeight(),a=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,l=document.documentElement.clientWidth+(n?0:e(document).scrollLeft()),u=document.documentElement.clientHeight+(n?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?s-a:0,i.left-=n&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=n&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+s>l&&l>s?Math.abs(i.left+s-l):0),i.top-=Math.min(i.top,i.top+o>u&&u>o?Math.abs(o+r):0),i},_findPos:function(t){for(var i,n=this._getInst(t),s=this._get(n,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,n,s,o,r=this._curInst;!r||t&&r!==e.data(t,a)||this._datepickerShowing&&(i=this._get(r,"showAnim"),n=this._get(r,"duration"),s=function(){e.datepicker._tidyDialog(r)},e.effects&&(e.effects.effect[i]||e.effects[i])?r.dpDiv.hide(i,e.datepicker._get(r,"showOptions"),n,s):r.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?n:null,s),i||s(),this._datepickerShowing=!1,o=this._get(r,"onClose"),o&&o.apply(r.input?r.input[0]:null,[r.input?r.input.val():"",r]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),n=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==n)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,n){var s=e(t),o=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(o,i+("M"===n?this._get(o,"showCurrentAtPos"):0),n),this._updateDatepicker(o))},_gotoToday:function(t){var i,n=e(t),s=this._getInst(n[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(i=new Date,s.selectedDay=i.getDate(),s.drawMonth=s.selectedMonth=i.getMonth(),s.drawYear=s.selectedYear=i.getFullYear()),this._notifyChange(s),this._adjustDate(n)},_selectMonthYear:function(t,i,n){var s=e(t),o=this._getInst(s[0]);o["selected"+("M"===n?"Month":"Year")]=o["draw"+("M"===n?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(s)},_selectDay:function(t,i,n,s){var o,a=e(t);e(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=e("a",s).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=n,this._selectDate(t,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var n,s=e(t),o=this._getInst(s[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),n=this._get(o,"onSelect"),n?n.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,n,s,o=this._get(t,"altField");o&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),n=this._getDate(t),s=this.formatDate(i,n,this._getFormatConfig(t)),e(o).each(function(){e(this).val(s)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,n){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?i.toString():i+"",""===i)return null;var s,o,a,r,l=0,u=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof u?u:(new Date).getFullYear()%100+parseInt(u,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,h=(n?n.dayNames:null)||this._defaults.dayNames,p=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,f=(n?n.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,_=-1,v=-1,b=!1,A=function(e){var i=s+1<t.length&&t.charAt(s+1)===e;return i&&s++,i},y=function(e){var t=A(e),n="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,s=new RegExp("^\\d{1,"+n+"}"),o=i.substring(l).match(s);if(!o)throw"Missing number at position "+l;return l+=o[0].length,parseInt(o[0],10)},C=function(t,n,s){var o=-1,a=e.map(A(t)?s:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(a,function(e,t){var n=t[1];return i.substr(l,n.length).toLowerCase()===n.toLowerCase()?(o=t[0],l+=n.length,!1):void 0}),-1!==o)return o+1;throw"Unknown name at position "+l},F=function(){if(i.charAt(l)!==t.charAt(s))throw"Unexpected literal at position "+l;l++};for(s=0;s<t.length;s++)if(b)"'"!==t.charAt(s)||A("'")?F():b=!1;else switch(t.charAt(s)){case"d":_=y("d");break;case"D":C("D",d,h);break;case"o":v=y("o");break;case"m":g=y("m");break;case"M":g=C("M",p,f);break;case"y":m=y("y");break;case"@":r=new Date(y("@")),m=r.getFullYear(),g=r.getMonth()+1,_=r.getDate();break;case"!":r=new Date((y("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,_=r.getDate();break;case"'":A("'")?F():b=!0;break;default:F()}if(l<i.length&&(a=i.substr(l),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c>=m?0:-100)),v>-1)for(g=1,_=v;;){if(o=this._getDaysInMonth(m,g-1),o>=_)break;g++,_-=o}if(r=this._daylightSavingAdjust(new Date(m,g-1,_)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==_)throw"Invalid date";return r},ATOM:"yy-mm-dd",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",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(e,t,i){if(!t)return"";var n,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,l=function(t){var i=n+1<e.length&&e.charAt(n+1)===t;return i&&n++,i},u=function(e,t,i){var n=""+t;if(l(e))for(;n.length<i;)n="0"+n;return n},c=function(e,t,i,n){return l(e)?n[t]:i[t]},d="",h=!1;if(t)for(n=0;n<e.length;n++)if(h)"'"!==e.charAt(n)||l("'")?d+=e.charAt(n):h=!1;else switch(e.charAt(n)){case"d":d+=u("d",t.getDate(),2);break;case"D":d+=c("D",t.getDay(),s,o);break;case"o":d+=u("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=u("m",t.getMonth()+1,2);break;case"M":d+=c("M",t.getMonth(),a,r);break;case"y":d+=l("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":l("'")?d+="'":h=!0;break;default:d+=e.charAt(n)}return d},_possibleChars:function(e){var t,i="",n=!1,s=function(i){var n=t+1<e.length&&e.charAt(t+1)===i;return n&&t++,n};for(t=0;t<e.length;t++)if(n)"'"!==e.charAt(t)||s("'")?i+=e.charAt(t):n=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":s("'")?i+="'":n=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,i){return e.settings[i]!==t?e.settings[i]:this._defaults[i]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),n=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),o=s,a=this._getFormatConfig(e);try{o=this.parseDate(i,n,a)||s}catch(r){n=t?"":n}e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),e.currentDay=n?o.getDate():0,e.currentMonth=n?o.getMonth():0,e.currentYear=n?o.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,n){var s=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},o=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(n){}for(var s=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,o=s.getFullYear(),a=s.getMonth(),r=s.getDate(),l=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,u=l.exec(i);u;){switch(u[2]||"d"){case"d":case"D":r+=parseInt(u[1],10);break;case"w":case"W":r+=7*parseInt(u[1],10);break;case"m":case"M":a+=parseInt(u[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(u[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(o,a))}u=l.exec(i)}return new Date(o,a,r)},a=null==i||""===i?n:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?n:s(i):new Date(i.getTime());return a=a&&"Invalid Date"===a.toString()?n:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var n=!t,s=e.selectedMonth,o=e.selectedYear,a=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=a.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=a.getMonth(),e.drawYear=e.selectedYear=e.currentYear=a.getFullYear(),s===e.selectedMonth&&o===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(n?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),n="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(n,-i,"M")},next:function(){e.datepicker._adjustDate(n,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(n)},selectDay:function(){return e.datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(n,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,n,s,o,a,r,l,u,c,d,h,p,f,m,g,_,v,b,A,y,C,F,w,E,D,S,x,G,k,B,P,T,I,N,M,$,R,U,L=new Date,O=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),H=this._get(e,"isRTL"),z=this._get(e,"showButtonPanel"),W=this._get(e,"hideIfNoPrevNext"),j=this._get(e,"navigationAsDateFormat"),V=this._getNumberOfMonths(e),q=this._get(e,"showCurrentAtPos"),Y=this._get(e,"stepMonths"),K=1!==V[0]||1!==V[1],X=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),J=this._getMinMaxDate(e,"min"),Q=this._getMinMaxDate(e,"max"),Z=e.drawMonth-q,et=e.drawYear;if(0>Z&&(Z+=12,et--),Q)for(t=this._daylightSavingAdjust(new Date(Q.getFullYear(),Q.getMonth()-V[0]*V[1]+1,Q.getDate())),t=J&&J>t?J:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=j?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-Y,1)),this._getFormatConfig(e)):i,n=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(H?"e":"w")+"'>"+i+"</span></a>":W?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(H?"e":"w")+"'>"+i+"</span></a>",s=this._get(e,"nextText"),s=j?this.formatDate(s,this._daylightSavingAdjust(new Date(et,Z+Y,1)),this._getFormatConfig(e)):s,o=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(H?"w":"e")+"'>"+s+"</span></a>":W?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(H?"w":"e")+"'>"+s+"</span></a>",a=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?X:O,a=j?this.formatDate(a,r,this._getFormatConfig(e)):a,l=e.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(e,"closeText")+"</button>",u=z?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(H?l:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(H?"":l)+"</div>":"",c=parseInt(this._get(e,"firstDay"),10),c=isNaN(c)?0:c,d=this._get(e,"showWeek"),h=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),v=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),A="",C=0;C<V[0];C++){for(F="",this.maxRows=4,w=0;w<V[1];w++){if(E=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),D=" ui-corner-all",S="",K){if(S+="<div class='ui-datepicker-group",V[1]>1)switch(w){case 0:S+=" ui-datepicker-group-first",D=" ui-corner-"+(H?"right":"left");break;case V[1]-1:S+=" ui-datepicker-group-last",D=" ui-corner-"+(H?"left":"right");break;default:S+=" ui-datepicker-group-middle",D=""}S+="'>"}for(S+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+D+"'>"+(/all|left/.test(D)&&0===C?H?o:n:"")+(/all|right/.test(D)&&0===C?H?n:o:"")+this._generateMonthYearHeader(e,Z,et,J,Q,C>0||w>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead><tr>",x=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",y=0;7>y;y++)G=(y+c)%7,x+="<th"+((y+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+h[G]+"'>"+p[G]+"</span></th>";for(S+=x+"</tr></thead><tbody>",k=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,k)),B=(this._getFirstDayOfMonth(et,Z)-c+7)%7,P=Math.ceil((B+k)/7),T=K&&this.maxRows>P?this.maxRows:P,this.maxRows=T,I=this._daylightSavingAdjust(new Date(et,Z,1-B)),N=0;T>N;N++){for(S+="<tr>",M=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(I)+"</td>":"",y=0;7>y;y++)$=g?g.apply(e.input?e.input[0]:null,[I]):[!0,""],R=I.getMonth()!==Z,U=R&&!v||!$[0]||J&&J>I||Q&&I>Q,M+="<td class='"+((y+c+6)%7>=5?" ui-datepicker-week-end":"")+(R?" ui-datepicker-other-month":"")+(I.getTime()===E.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===I.getTime()&&b.getTime()===E.getTime()?" "+this._dayOverClass:"")+(U?" "+this._unselectableClass+" ui-state-disabled":"")+(R&&!_?"":" "+$[1]+(I.getTime()===X.getTime()?" "+this._currentClass:"")+(I.getTime()===O.getTime()?" ui-datepicker-today":""))+"'"+(R&&!_||!$[2]?"":" title='"+$[2].replace(/'/g,"&#39;")+"'")+(U?"":" data-handler='selectDay' data-event='click' data-month='"+I.getMonth()+"' data-year='"+I.getFullYear()+"'")+">"+(R&&!_?"&#xa0;":U?"<span class='ui-state-default'>"+I.getDate()+"</span>":"<a class='ui-state-default"+(I.getTime()===O.getTime()?" ui-state-highlight":"")+(I.getTime()===X.getTime()?" ui-state-active":"")+(R?" ui-priority-secondary":"")+"' href='#'>"+I.getDate()+"</a>")+"</td>",I.setDate(I.getDate()+1),I=this._daylightSavingAdjust(I);S+=M+"</tr>"}Z++,Z>11&&(Z=0,et++),S+="</tbody></table>"+(K?"</div>"+(V[0]>0&&w===V[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),F+=S}A+=F}return A+=u,e._keyEvent=!1,A},_generateMonthYearHeader:function(e,t,i,n,s,o,a,r){var l,u,c,d,h,p,f,m,g=this._get(e,"changeMonth"),_=this._get(e,"changeYear"),v=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",A="";
if(o||!g)A+="<span class='ui-datepicker-month'>"+a[t]+"</span>";else{for(l=n&&n.getFullYear()===i,u=s&&s.getFullYear()===i,A+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!l||c>=n.getMonth())&&(!u||c<=s.getMonth())&&(A+="<option value='"+c+"'"+(c===t?" selected='selected'":"")+">"+r[c]+"</option>");A+="</select>"}if(v||(b+=A+(!o&&g&&_?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",o||!_)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),h=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?h+parseInt(e,10):parseInt(e,10);return isNaN(t)?h:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=n?Math.max(f,n.getFullYear()):f,m=s?Math.min(m,s.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),v&&(b+=(!o&&g&&_?"":"&#xa0;")+A),b+="</div>"},_adjustInstDate:function(e,t,i){var n=e.drawYear+("Y"===i?t:0),s=e.drawMonth+("M"===i?t:0),o=Math.min(e.selectedDay,this._getDaysInMonth(n,s))+("D"===i?t:0),a=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(n,s,o)));e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),s=i&&i>t?i:t;return n&&s>n?n:s},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,n){var s=this._getNumberOfMonths(e),o=this._daylightSavingAdjust(new Date(i,n+(0>t?t:s[0]*s[1]),1));return 0>t&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(e,o)},_isInRange:function(e,t){var i,n,s=this._getMinMaxDate(e,"min"),o=this._getMinMaxDate(e,"max"),a=null,r=null,l=this._get(e,"yearRange");return l&&(i=l.split(":"),n=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=n),i[1].match(/[+\-].*/)&&(r+=n)),(!s||t.getTime()>=s.getTime())&&(!o||t.getTime()<=o.getTime())&&(!a||t.getFullYear()>=a)&&(!r||t.getFullYear()<=r)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,n){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(n,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.3"}(jQuery),function(e){var t={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.10.3",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){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"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i=this;this._isOpen&&this._trigger("beforeClose",t)!==!1&&(this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||e(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!t&&this._trigger("focus",e),i},open:function(){var t=this;return this._isOpen?void(this._moveToTop()&&this._focusTabbable()):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),void this._trigger("open"))},_focusTabbable:function(){var e=this.element.find("[autofocus]");e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);if(t.keyCode===e.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),n=i.filter(":first"),s=i.filter(":last");t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==n[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(s.focus(1),t.preventDefault()):(n.focus(1),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?void this.uiDialog.removeClass("ui-dialog-buttons"):(e.each(i,function(i,n){var s,o;n=e.isFunction(n)?{click:n,text:i}:n,n=e.extend({type:"button"},n),s=n.click,n.click=function(){s.apply(t.element[0],arguments)},o={icons:n.icons,text:n.showText},delete n.icons,delete n.showText,e("<button></button>",n).button(o).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),void this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,s){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",n,t(s))},drag:function(e,n){i._trigger("drag",e,t(n))},stop:function(s,o){n.position=[o.position.left-i.document.scrollLeft(),o.position.top-i.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",s,t(o))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,n=this.options,s=n.resizable,o=this.uiDialog.css("position"),a="string"==typeof s?s:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:a,start:function(n,s){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",n,t(s))},resize:function(e,n){i._trigger("resize",e,t(n))},stop:function(s,o){n.height=e(this).height(),n.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",s,t(o))}}).css("position",o)},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(n){var s=this,o=!1,a={};e.each(n,function(e,n){s._setOption(e,n),e in t&&(o=!0),e in i&&(a[e]=n)}),o&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",a)},_setOption:function(e,t){var i,n,s=this.uiDialog;"dialogClass"===e&&s.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=s.is(":data(ui-draggable)"),i&&!t&&s.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(n=s.is(":data(ui-resizable)"),n&&!t&&s.resizable("destroy"),n&&"string"==typeof t&&s.resizable("option","handles",t),n||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,n=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),n.minWidth>n.width&&(n.width=n.minWidth),e=this.uiDialog.css({height:"auto",width:n.width}).outerHeight(),t=Math.max(0,n.minHeight-e),i="number"==typeof n.maxHeight?Math.max(0,n.maxHeight-e):"none","auto"===n.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,n.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=this,i=this.widgetFullName;e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(n){t._allowInteraction(n)||(n.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),e.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(e.ui.dialog.overlayInstances--,e.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),e.ui.dialog.overlayInstances=0,e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{_position:function(){var t,i=this.options.position,n=[],s=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(n=i.split?i.split(" "):[i[0],i[1]],1===n.length&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(s[e]=n[e],n[e]=t)}),i={my:n[0]+(s[0]<0?s[0]:"+"+s[0])+" "+n[1]+(s[1]<0?s[1]:"+"+s[1]),at:n.join(" ")}),i=e.extend({},e.ui.dialog.prototype.options.position,i)):i=e.ui.dialog.prototype.options.position,t=this.uiDialog.is(":visible"),t||this.uiDialog.show(),this.uiDialog.position(i),t||this.uiDialog.hide()}})}(jQuery),function(e){var t=/up|down|vertical/,i=/up|left|vertical|horizontal/;e.effects.effect.blind=function(n,s){var o,a,r,l=e(this),u=["position","top","bottom","left","right","height","width"],c=e.effects.setMode(l,n.mode||"hide"),d=n.direction||"up",h=t.test(d),p=h?"height":"width",f=h?"top":"left",m=i.test(d),g={},_="show"===c;l.parent().is(".ui-effects-wrapper")?e.effects.save(l.parent(),u):e.effects.save(l,u),l.show(),o=e.effects.createWrapper(l).css({overflow:"hidden"}),a=o[p](),r=parseFloat(o.css(f))||0,g[p]=_?a:0,m||(l.css(h?"bottom":"right",0).css(h?"top":"left","auto").css({position:"absolute"}),g[f]=_?r:a+r),_&&(o.css(p,0),m||o.css(f,r+a)),o.animate(g,{duration:n.duration,easing:n.easing,queue:!1,complete:function(){"hide"===c&&l.hide(),e.effects.restore(l,u),e.effects.removeWrapper(l),s()}})}}(jQuery),function(e){e.effects.effect.bounce=function(t,i){var n,s,o,a=e(this),r=["position","top","bottom","left","right","height","width"],l=e.effects.setMode(a,t.mode||"effect"),u="hide"===l,c="show"===l,d=t.direction||"up",h=t.distance,p=t.times||5,f=2*p+(c||u?1:0),m=t.duration/f,g=t.easing,_="up"===d||"down"===d?"top":"left",v="up"===d||"left"===d,b=a.queue(),A=b.length;for((c||u)&&r.push("opacity"),e.effects.save(a,r),a.show(),e.effects.createWrapper(a),h||(h=a["top"===_?"outerHeight":"outerWidth"]()/3),c&&(o={opacity:1},o[_]=0,a.css("opacity",0).css(_,v?2*-h:2*h).animate(o,m,g)),u&&(h/=Math.pow(2,p-1)),o={},o[_]=0,n=0;p>n;n++)s={},s[_]=(v?"-=":"+=")+h,a.animate(s,m,g).animate(o,m,g),h=u?2*h:h/2;u&&(s={opacity:0},s[_]=(v?"-=":"+=")+h,a.animate(s,m,g)),a.queue(function(){u&&a.hide(),e.effects.restore(a,r),e.effects.removeWrapper(a),i()}),A>1&&b.splice.apply(b,[1,0].concat(b.splice(A,f+1))),a.dequeue()}}(jQuery),function(e){e.effects.effect.clip=function(t,i){var n,s,o,a=e(this),r=["position","top","bottom","left","right","height","width"],l=e.effects.setMode(a,t.mode||"hide"),u="show"===l,c=t.direction||"vertical",d="vertical"===c,h=d?"height":"width",p=d?"top":"left",f={};e.effects.save(a,r),a.show(),n=e.effects.createWrapper(a).css({overflow:"hidden"}),s="IMG"===a[0].tagName?n:a,o=s[h](),u&&(s.css(h,0),s.css(p,o/2)),f[h]=u?o:0,f[p]=u?0:o/2,s.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){u||a.hide(),e.effects.restore(a,r),e.effects.removeWrapper(a),i()}})}}(jQuery),function(e){e.effects.effect.drop=function(t,i){var n,s=e(this),o=["position","top","bottom","left","right","opacity","height","width"],a=e.effects.setMode(s,t.mode||"hide"),r="show"===a,l=t.direction||"left",u="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l?"pos":"neg",d={opacity:r?1:0};e.effects.save(s,o),s.show(),e.effects.createWrapper(s),n=t.distance||s["top"===u?"outerHeight":"outerWidth"](!0)/2,r&&s.css("opacity",0).css(u,"pos"===c?-n:n),d[u]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+n,s.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}}(jQuery),function(e){e.effects.effect.explode=function(t,i){function n(){b.push(this),b.length===d*h&&s()}function s(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var o,a,r,l,u,c,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,h=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),_=Math.ceil(p.outerWidth()/h),v=Math.ceil(p.outerHeight()/d),b=[];for(o=0;d>o;o++)for(l=g.top+o*v,c=o-(d-1)/2,a=0;h>a;a++)r=g.left+a*_,u=a-(h-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*_,top:-o*v}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:_,height:v,left:r+(m?u*_:0),top:l+(m?c*v:0),opacity:m?0:1}).animate({left:r+(m?0:u*_),top:l+(m?0:c*v),opacity:m?1:0},t.duration||500,t.easing,n)}}(jQuery),function(e){e.effects.effect.fade=function(t,i){var n=e(this),s=e.effects.setMode(n,t.mode||"toggle");n.animate({opacity:s},{queue:!1,duration:t.duration,easing:t.easing,complete:i})}}(jQuery),function(e){e.effects.effect.fold=function(t,i){var n,s,o=e(this),a=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(o,t.mode||"hide"),l="show"===r,u="hide"===r,c=t.size||15,d=/([0-9]+)%/.exec(c),h=!!t.horizFirst,p=l!==h,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},_={};e.effects.save(o,a),o.show(),n=e.effects.createWrapper(o).css({overflow:"hidden"}),s=p?[n.width(),n.height()]:[n.height(),n.width()],d&&(c=parseInt(d[1],10)/100*s[u?0:1]),l&&n.css(h?{height:0,width:c}:{height:c,width:0}),g[f[0]]=l?s[0]:c,_[f[1]]=l?s[1]:0,n.animate(g,m,t.easing).animate(_,m,t.easing,function(){u&&o.hide(),e.effects.restore(o,a),e.effects.removeWrapper(o),i()})}}(jQuery),function(e){e.effects.effect.highlight=function(t,i){var n=e(this),s=["backgroundImage","backgroundColor","opacity"],o=e.effects.setMode(n,t.mode||"show"),a={backgroundColor:n.css("backgroundColor")};"hide"===o&&(a.opacity=0),e.effects.save(n,s),n.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,s),i()}})}}(jQuery),function(e){e.effects.effect.pulsate=function(t,i){var n,s=e(this),o=e.effects.setMode(s,t.mode||"show"),a="show"===o,r="hide"===o,l=a||"hide"===o,u=2*(t.times||5)+(l?1:0),c=t.duration/u,d=0,h=s.queue(),p=h.length;for((a||!s.is(":visible"))&&(s.css("opacity",0).show(),d=1),n=1;u>n;n++)s.animate({opacity:d},c,t.easing),d=1-d;s.animate({opacity:d},c,t.easing),s.queue(function(){r&&s.hide(),i()}),p>1&&h.splice.apply(h,[1,0].concat(h.splice(p,u+1))),s.dequeue()}}(jQuery),function(e){e.effects.effect.puff=function(t,i){var n=e(this),s=e.effects.setMode(n,t.mode||"hide"),o="hide"===s,a=parseInt(t.percent,10)||150,r=a/100,l={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:s,complete:i,percent:o?a:100,from:o?l:{height:l.height*r,width:l.width*r,outerHeight:l.outerHeight*r,outerWidth:l.outerWidth*r}}),n.effect(t)},e.effects.effect.scale=function(t,i){var n=e(this),s=e.extend(!0,{},t),o=e.effects.setMode(n,t.mode||"effect"),a=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===o?0:100),r=t.direction||"both",l=t.origin,u={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()},c={y:"horizontal"!==r?a/100:1,x:"vertical"!==r?a/100:1};s.effect="size",s.queue=!1,s.complete=i,"effect"!==o&&(s.origin=l||["middle","center"],s.restore=!0),s.from=t.from||("show"===o?{height:0,width:0,outerHeight:0,outerWidth:0}:u),s.to={height:u.height*c.y,width:u.width*c.x,outerHeight:u.outerHeight*c.y,outerWidth:u.outerWidth*c.x},s.fade&&("show"===o&&(s.from.opacity=0,s.to.opacity=1),"hide"===o&&(s.from.opacity=1,s.to.opacity=0)),n.effect(s)},e.effects.effect.size=function(t,i){var n,s,o,a=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],u=["width","height","overflow"],c=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(a,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],_=a.css("position"),v=f?r:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&a.show(),n={height:a.height(),width:a.width(),outerHeight:a.outerHeight(),outerWidth:a.outerWidth()},"toggle"===t.mode&&"show"===p?(a.from=t.to||b,a.to=t.from||n):(a.from=t.from||("show"===p?b:n),a.to=t.to||("hide"===p?b:n)),o={from:{y:a.from.height/n.height,x:a.from.width/n.width},to:{y:a.to.height/n.height,x:a.to.width/n.width}},("box"===m||"both"===m)&&(o.from.y!==o.to.y&&(v=v.concat(d),a.from=e.effects.setTransition(a,d,o.from.y,a.from),a.to=e.effects.setTransition(a,d,o.to.y,a.to)),o.from.x!==o.to.x&&(v=v.concat(h),a.from=e.effects.setTransition(a,h,o.from.x,a.from),a.to=e.effects.setTransition(a,h,o.to.x,a.to))),("content"===m||"both"===m)&&o.from.y!==o.to.y&&(v=v.concat(c).concat(u),a.from=e.effects.setTransition(a,c,o.from.y,a.from),a.to=e.effects.setTransition(a,c,o.to.y,a.to)),e.effects.save(a,v),a.show(),e.effects.createWrapper(a),a.css("overflow","hidden").css(a.from),g&&(s=e.effects.getBaseline(g,n),a.from.top=(n.outerHeight-a.outerHeight())*s.y,a.from.left=(n.outerWidth-a.outerWidth())*s.x,a.to.top=(n.outerHeight-a.to.outerHeight)*s.y,a.to.left=(n.outerWidth-a.to.outerWidth)*s.x),a.css(a.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(c),h=h.concat(["marginLeft","marginRight"]),u=r.concat(d).concat(h),a.find("*[width]").each(function(){var i=e(this),n={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&e.effects.save(i,u),i.from={height:n.height*o.from.y,width:n.width*o.from.x,outerHeight:n.outerHeight*o.from.y,outerWidth:n.outerWidth*o.from.x},i.to={height:n.height*o.to.y,width:n.width*o.to.x,outerHeight:n.height*o.to.y,outerWidth:n.width*o.to.x},o.from.y!==o.to.y&&(i.from=e.effects.setTransition(i,d,o.from.y,i.from),i.to=e.effects.setTransition(i,d,o.to.y,i.to)),o.from.x!==o.to.x&&(i.from=e.effects.setTransition(i,h,o.from.x,i.from),i.to=e.effects.setTransition(i,h,o.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,u)})})),a.animate(a.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===a.to.opacity&&a.css("opacity",a.from.opacity),"hide"===p&&a.hide(),e.effects.restore(a,v),f||("static"===_?a.css({position:"relative",top:a.to.top,left:a.to.left}):e.each(["top","left"],function(e,t){a.css(t,function(t,i){var n=parseInt(i,10),s=e?a.to.left:a.to.top;return"auto"===i?s+"px":n+s+"px"})})),e.effects.removeWrapper(a),i()}})}}(jQuery),function(e){e.effects.effect.shake=function(t,i){var n,s=e(this),o=["position","top","bottom","left","right","height","width"],a=e.effects.setMode(s,t.mode||"effect"),r=t.direction||"left",l=t.distance||20,u=t.times||3,c=2*u+1,d=Math.round(t.duration/c),h="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},_=s.queue(),v=_.length;for(e.effects.save(s,o),s.show(),e.effects.createWrapper(s),f[h]=(p?"-=":"+=")+l,m[h]=(p?"+=":"-=")+2*l,g[h]=(p?"-=":"+=")+2*l,s.animate(f,d,t.easing),n=1;u>n;n++)s.animate(m,d,t.easing).animate(g,d,t.easing);s.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===a&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}),v>1&&_.splice.apply(_,[1,0].concat(_.splice(v,c+1))),s.dequeue()}}(jQuery),function(e){e.effects.effect.slide=function(t,i){var n,s=e(this),o=["position","top","bottom","left","right","width","height"],a=e.effects.setMode(s,t.mode||"show"),r="show"===a,l=t.direction||"left",u="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,d={};e.effects.save(s,o),s.show(),n=t.distance||s["top"===u?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(s).css({overflow:"hidden"}),r&&s.css(u,c?isNaN(n)?"-"+n:-n:n),d[u]=(r?c?"+=":"-=":c?"-=":"+=")+n,s.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}}(jQuery),function(e){e.effects.effect.transfer=function(t,i){var n=e(this),s=e(t.to),o="fixed"===s.css("position"),a=e("body"),r=o?a.scrollTop():0,l=o?a.scrollLeft():0,u=s.offset(),c={top:u.top-r,left:u.left-l,height:s.innerHeight(),width:s.innerWidth()},d=n.offset(),h=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-l,height:n.innerHeight(),width:n.innerWidth(),position:o?"fixed":"absolute"}).animate(c,t.duration,t.easing,function(){h.remove(),i()})}}(jQuery),function(e){e.widget("ui.menu",{version:"1.10.3",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var i=e(t.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(t),i.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var i=e(t.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,s,o,a,r,l=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:l=!1,s=this.previousFilter||"",o=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),o===s?a=!0:o=s+o,r=new RegExp("^"+i(o),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(e(this).children("a").text())}),n=a&&-1!==n.index(this.active.next())?this.active.nextAll(".ui-menu-item"):n,n.length||(o=String.fromCharCode(t.keyCode),r=new RegExp("^"+i(o),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,i=this.options.icons.submenu,n=this.element.find(this.options.menus);n.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),n=t.prev("a"),s=e("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);n.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",n.attr("id"))}),t=n.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);
/[^\-\u2014\u2013\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),this._super(e,t)},focus:function(e,t){var i,n;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),n=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",n.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,n,s,o,a,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,n=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,s=t.offset().top-this.activeMenu.offset().top-i-n,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=t.height(),0>s?this.activeMenu.scrollTop(o+s):s+r>a&&this.activeMenu.scrollTop(o+s-a+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var n=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));n.length||(n=this.element),this._close(n),this.blur(t),this.activeMenu=n},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var n;this.active&&(n="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),n&&n.length&&this.active||(n=this.activeMenu.children(".ui-menu-item")[t]()),this.focus(i,n)},nextPage:function(t){var i,n,s;return this.active?void(this.isLastItem()||(this._hasScroll()?(n=this.active.offset().top,s=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-n-s<0}),this.focus(t,i)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]()))):void this.next(t)},previousPage:function(t){var i,n,s;return this.active?void(this.isFirstItem()||(this._hasScroll()?(n=this.active.offset().top,s=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-n+s>0}),this.focus(t,i)):this.focus(t,this.activeMenu.children(".ui-menu-item").first()))):void this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)}})}(jQuery),function(e,t){function i(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function n(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var o,a=Math.max,r=Math.abs,l=Math.round,u=/left|center|right/,c=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,h=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(o!==t)return o;var i,n,s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),i=a.offsetWidth,s.css("overflow","scroll"),n=a.offsetWidth,i===n&&(n=s[0].clientWidth),s.remove(),o=i-n},getScrollInfo:function(t){var i=t.isWindow?"":t.element.css("overflow-x"),n=t.isWindow?"":t.element.css("overflow-y"),s="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,o="scroll"===n||"auto"===n&&t.height<t.element[0].scrollHeight;return{width:o?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),n=e.isWindow(i[0]);return{element:i,isWindow:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:n?i.width():i.outerWidth(),height:n?i.height():i.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return f.apply(this,arguments);t=e.extend({},t);var o,p,m,g,_,v,b=e(t.of),A=e.position.getWithinInfo(t.within),y=e.position.getScrollInfo(A),C=(t.collision||"flip").split(" "),F={};return v=s(b),b[0].preventDefault&&(t.at="left top"),p=v.width,m=v.height,g=v.offset,_=e.extend({},g),e.each(["my","at"],function(){var e,i,n=(t[this]||"").split(" ");1===n.length&&(n=u.test(n[0])?n.concat(["center"]):c.test(n[0])?["center"].concat(n):["center","center"]),n[0]=u.test(n[0])?n[0]:"center",n[1]=c.test(n[1])?n[1]:"center",e=d.exec(n[0]),i=d.exec(n[1]),F[this]=[e?e[0]:0,i?i[0]:0],t[this]=[h.exec(n[0])[0],h.exec(n[1])[0]]}),1===C.length&&(C[1]=C[0]),"right"===t.at[0]?_.left+=p:"center"===t.at[0]&&(_.left+=p/2),"bottom"===t.at[1]?_.top+=m:"center"===t.at[1]&&(_.top+=m/2),o=i(F.at,p,m),_.left+=o[0],_.top+=o[1],this.each(function(){var s,u,c=e(this),d=c.outerWidth(),h=c.outerHeight(),f=n(this,"marginLeft"),v=n(this,"marginTop"),w=d+f+n(this,"marginRight")+y.width,E=h+v+n(this,"marginBottom")+y.height,D=e.extend({},_),S=i(F.my,c.outerWidth(),c.outerHeight());"right"===t.my[0]?D.left-=d:"center"===t.my[0]&&(D.left-=d/2),"bottom"===t.my[1]?D.top-=h:"center"===t.my[1]&&(D.top-=h/2),D.left+=S[0],D.top+=S[1],e.support.offsetFractions||(D.left=l(D.left),D.top=l(D.top)),s={marginLeft:f,marginTop:v},e.each(["left","top"],function(i,n){e.ui.position[C[i]]&&e.ui.position[C[i]][n](D,{targetWidth:p,targetHeight:m,elemWidth:d,elemHeight:h,collisionPosition:s,collisionWidth:w,collisionHeight:E,offset:[o[0]+S[0],o[1]+S[1]],my:t.my,at:t.at,within:A,elem:c})}),t.using&&(u=function(e){var i=g.left-D.left,n=i+p-d,s=g.top-D.top,o=s+m-h,l={target:{element:b,left:g.left,top:g.top,width:p,height:m},element:{element:c,left:D.left,top:D.top,width:d,height:h},horizontal:0>n?"left":i>0?"right":"center",vertical:0>o?"top":s>0?"bottom":"middle"};d>p&&r(i+n)<p&&(l.horizontal="center"),h>m&&r(s+o)<m&&(l.vertical="middle"),l.important=a(r(i),r(n))>a(r(s),r(o))?"horizontal":"vertical",t.using.call(this,e,l)}),c.offset(e.extend(D,{using:u}))})},e.ui.position={fit:{left:function(e,t){var i,n=t.within,s=n.isWindow?n.scrollLeft:n.offset.left,o=n.width,r=e.left-t.collisionPosition.marginLeft,l=s-r,u=r+t.collisionWidth-o-s;t.collisionWidth>o?l>0&&0>=u?(i=e.left+l+t.collisionWidth-o-s,e.left+=l-i):e.left=u>0&&0>=l?s:l>u?s+o-t.collisionWidth:s:l>0?e.left+=l:u>0?e.left-=u:e.left=a(e.left-r,e.left)},top:function(e,t){var i,n=t.within,s=n.isWindow?n.scrollTop:n.offset.top,o=t.within.height,r=e.top-t.collisionPosition.marginTop,l=s-r,u=r+t.collisionHeight-o-s;t.collisionHeight>o?l>0&&0>=u?(i=e.top+l+t.collisionHeight-o-s,e.top+=l-i):e.top=u>0&&0>=l?s:l>u?s+o-t.collisionHeight:s:l>0?e.top+=l:u>0?e.top-=u:e.top=a(e.top-r,e.top)}},flip:{left:function(e,t){var i,n,s=t.within,o=s.offset.left+s.scrollLeft,a=s.width,l=s.isWindow?s.scrollLeft:s.offset.left,u=e.left-t.collisionPosition.marginLeft,c=u-l,d=u+t.collisionWidth-a-l,h="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>c?(i=e.left+h+p+f+t.collisionWidth-a-o,(0>i||i<r(c))&&(e.left+=h+p+f)):d>0&&(n=e.left-t.collisionPosition.marginLeft+h+p+f-l,(n>0||r(n)<d)&&(e.left+=h+p+f))},top:function(e,t){var i,n,s=t.within,o=s.offset.top+s.scrollTop,a=s.height,l=s.isWindow?s.scrollTop:s.offset.top,u=e.top-t.collisionPosition.marginTop,c=u-l,d=u+t.collisionHeight-a-l,h="top"===t.my[1],p=h?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>c?(n=e.top+p+f+m+t.collisionHeight-a-o,e.top+p+f+m>c&&(0>n||n<r(c))&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-l,e.top+p+f+m>d&&(i>0||r(i)<d)&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,n,s,o,a=document.getElementsByTagName("body")[0],r=document.createElement("div");t=document.createElement(a?"div":"body"),n={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},a&&e.extend(n,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in n)t.style[o]=n[o];t.appendChild(r),i=a||document.documentElement,i.insertBefore(t,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",s=e(r).offset().left,e.support.offsetFractions=s>10&&11>s,t.innerHTML="",i.removeChild(t)}()}(jQuery),function(e,t){e.widget("ui.progressbar",{version:"1.10.3",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return e===t?this.options.value:(this.options.value=this._constrainedValue(e),void this._refreshValue())},_constrainedValue:function(e){return e===t&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}})}(jQuery),function(e){var t=5;e.widget("ui.slider",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,n=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",a=[];for(i=n.values&&n.values.length||1,s.length>i&&(s.slice(i).remove(),s=s.slice(0,i)),t=s.length;i>t;t++)a.push(o);this.handles=s.add(e(a.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):this.range=e([])},_setupEvents:function(){var e=this.handles.add(this.range).filter("a");this._off(e),this._on(e,this._handleEvents),this._hoverable(e),this._focusable(e)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,n,s,o,a,r,l,u,c=this,d=this.options;return d.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},n=this._normValueFromMouse(i),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(n-c.values(t));(s>i||s===i&&(t===c._lastChangedValue||c.values(t)===d.min))&&(s=i,o=e(this),a=t)}),r=this._start(t,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,o.addClass("ui-state-active").focus(),l=o.offset(),u=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=u?{left:0,top:0}:{left:t.pageX-l.left-o.width()/2,top:t.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,a,n),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,n,s,o;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),n=i/t,n>1&&(n=1),0>n&&(n=0),"vertical"===this.orientation&&(n=1-n),s=this._valueMax()-this._valueMin(),o=this._valueMin()+n*s,this._trimAlignValue(o)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var n,s,o;this.options.values&&this.options.values.length?(n=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>n||1===t&&n>i)&&(i=n),i!==this.values(t)&&(s=this.values(),s[t]=i,o=this._trigger("slide",e,{handle:this.handles[t],value:i,values:s}),n=this.values(t?0:1),o!==!1&&this.values(t,i,!0))):i!==this.value()&&(o=this._trigger("slide",e,{handle:this.handles[t],value:i}),o!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),void this._change(null,0)):this._value()},values:function(t,i){var n,s,o;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),void this._change(null,t);if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(n=this.options.values,s=arguments[0],o=0;o<n.length;o+=1)n[o]=this._trimAlignValue(s[o]),this._change(null,o);this._refreshValue()},_setOption:function(t,i){var n,s=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(s=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),n=0;s>n;n+=1)this._change(null,n);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,n;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(i[n]);return i}return[]},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,n=e-i;return 2*Math.abs(i)>=t&&(n+=i>0?t:-t),parseFloat(n.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,i,n,s,o,a=this.options.range,r=this.options,l=this,u=this._animateOff?!1:r.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(n){i=(l.values(n)-l._valueMin())/(l._valueMax()-l._valueMin())*100,c["horizontal"===l.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[u?"animate":"css"](c,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===n&&l.range.stop(1,1)[u?"animate":"css"]({left:i+"%"},r.animate),1===n&&l.range[u?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===n&&l.range.stop(1,1)[u?"animate":"css"]({bottom:i+"%"},r.animate),1===n&&l.range[u?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(n=this.value(),s=this._valueMin(),o=this._valueMax(),i=o!==s?(n-s)/(o-s)*100:0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[u?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range[u?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range[u?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var n,s,o,a,r=e(i.target).data("ui-slider-handle-index");switch(i.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(i.target).addClass("ui-state-active"),n=this._start(i,r),n===!1))return}switch(a=this.options.step,s=o=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case e.ui.keyCode.HOME:o=this._valueMin();break;case e.ui.keyCode.END:o=this._valueMax();break;case e.ui.keyCode.PAGE_UP:o=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/t);break;case e.ui.keyCode.PAGE_DOWN:o=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/t);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;o=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;o=this._trimAlignValue(s-a)}this._slide(i,r,o)},click:function(e){e.preventDefault()},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}})}(jQuery),function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.10.3",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,n){var s=i.attr(n);void 0!==s&&s.length&&(t[n]=s)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?void delete this.cancelBlur:(this._stop(),this._refresh(),void(this.previous!==this.element.val()&&this._trigger("change",e)))},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:void this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,n=e.ui.keyCode;switch(t.keyCode){case n.UP:return this._repeat(null,1,t),!0;case n.DOWN:return this._repeat(null,-1,t),!0;case n.PAGE_UP:return this._repeat(null,i.page,t),!0;case n.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span></a><a class='ui-spinner-button ui-spinner-down ui-corner-br'><span class='ui-icon "+this.options.icons.down+"'>&#9660;</span></a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,n=this.options;return t=null!==n.min?n.min:0,i=e-t,i=Math.round(i/n.step)*n.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==n.max&&e>n.max?n.max:null!==n.min&&e<n.min?n.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,void this.element.val(this._format(i))}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(t?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:t(function(e){this._super(e),this._value(this.element.val())}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?void t(this._value).call(this,e):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})}(jQuery),function(e,t){function i(){return++s}function n(e){return e.hash.length>1&&decodeURIComponent(e.href.replace(o,""))===decodeURIComponent(location.href.replace(o,""))}var s=0,o=/#.*$/;e.widget("ui.tabs",{version:"1.10.3",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,n=location.hash.substring(1);return null===t&&(n&&this.tabs.each(function(i,s){return e(s).attr("aria-controls")===n?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),n=this.tabs.index(i),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:n++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:s=!1,n--;break;case e.ui.keyCode.END:n=this.anchors.length-1;break;case e.ui.keyCode.HOME:n=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(n);case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(n===this.options.active?!1:n);default:return}t.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,s),t.ctrlKey||(i.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())
},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function n(){return t>s&&(t=0),0>t&&(t=s),t}for(var s=this.tabs.length-1;-1!==e.inArray(n(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?void this._activate(t):"disabled"===e?void this._setupDisabled(t):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),void("heightStyle"===e&&this._setupHeightStyle(t)))},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var o,a,r,l=e(s).uniqueId().attr("id"),u=e(s).closest("li"),c=u.attr("aria-controls");n(s)?(o=s.hash,a=t.element.find(t._sanitizeSelector(o))):(r=t._tabId(u),o="#"+r,a=t.element.find(o),a.length||(a=t._createPanel(r),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),c&&u.data("ui-tabs-aria-controls",c),u.attr({"aria-controls":o.substring(1),"aria-labelledby":l}),a.attr("aria-labelledby",l)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,n=0;i=this.tabs[n];n++)t===!0||-1!==e.inArray(n,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,n=this.element.parent();"fill"===t?(i=n.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),n=t.css("position");"absolute"!==n&&"fixed"!==n&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,n=this.active,s=e(t.currentTarget),o=s.closest("li"),a=o[0]===n[0],r=a&&i.collapsible,l=r?e():this._getPanelForTab(o),u=n.length?this._getPanelForTab(n):e(),c={oldTab:n,oldPanel:u,newTab:r?e():o,newPanel:l};t.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",t,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?e():o,this.xhr&&this.xhr.abort(),u.length||l.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(o),t),this._toggle(t,c))},_toggle:function(t,i){function n(){o.running=!1,o._trigger("activate",t,i)}function s(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,n):(a.show(),n())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),s()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var i,n=this._findActive(t);n[0]!==this.active[0]&&(n.length||(n=this.active),i=n.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var n=this.options.disabled;n!==!1&&(i===t?n=!1:(i=this._getIndex(i),n=e.isArray(n)?e.map(n,function(e){return e!==i?e:null}):e.map(this.tabs,function(e,t){return t!==i?t:null})),this._setupDisabled(n))},disable:function(i){var n=this.options.disabled;if(n!==!0){if(i===t)n=!0;else{if(i=this._getIndex(i),-1!==e.inArray(i,n))return;n=e.isArray(n)?e.merge([i],n).sort():[i]}this._setupDisabled(n)}},load:function(t,i){t=this._getIndex(t);var s=this,o=this.tabs.eq(t),a=o.find(".ui-tabs-anchor"),r=this._getPanelForTab(o),l={tab:o,panel:r};n(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,l)),this.xhr&&"canceled"!==this.xhr.statusText&&(o.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){r.html(e),s._trigger("load",i,l)},1)}).complete(function(e,t){setTimeout(function(){"abort"===t&&s.panels.stop(!1,!0),o.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr},1)})))},_ajaxSettings:function(t,i,n){var s=this;return{url:t.attr("href"),beforeSend:function(t,o){return s._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:o},n))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})}(jQuery),function(e){function t(t,i){var n=(t.attr("aria-describedby")||"").split(/\s+/);n.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(n.join(" ")))}function i(t){var i=t.data("ui-tooltip-id"),n=(t.attr("aria-describedby")||"").split(/\s+/),s=e.inArray(i,n);-1!==s&&n.splice(s,1),t.removeData("ui-tooltip-id"),n=e.trim(n.join(" ")),n?t.attr("aria-describedby",n):t.removeAttr("aria-describedby")}var n=0;e.widget("ui.tooltip",{version:"1.10.3",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(t,i){var n=this;return"disabled"===t?(this[i?"_disable":"_enable"](),void(this.options[t]=i)):(this._super(t,i),void("content"===t&&e.each(this.tooltips,function(e,t){n._updateContent(t)})))},_disable:function(){var t=this;e.each(this.tooltips,function(i,n){var s=e.Event("blur");s.target=s.currentTarget=n[0],t.close(s,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,n=e(t?t.target:this.element).closest(this.options.items);n.length&&!n.data("ui-tooltip-id")&&(n.attr("title")&&n.data("ui-tooltip-title",n.attr("title")),n.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&n.parents().each(function(){var t,n=e(this);n.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),n.attr("title")&&(n.uniqueId(),i.parents[this.id]={element:this,title:n.attr("title")},n.attr("title",""))}),this._updateContent(n,t))},_updateContent:function(e,t){var i,n=this.options.content,s=this,o=t?t.type:null;return"string"==typeof n?this._open(t,e,n):(i=n.call(e[0],function(i){e.data("ui-tooltip-open")&&s._delay(function(){t&&(t.type=o),this._open(t,e,i)})}),void(i&&this._open(t,e,i)))},_open:function(i,n,s){function o(e){u.of=e,a.is(":hidden")||a.position(u)}var a,r,l,u=e.extend({},this.options.position);if(s){if(a=this._find(n),a.length)return void a.find(".ui-tooltip-content").html(s);n.is("[title]")&&(i&&"mouseover"===i.type?n.attr("title",""):n.removeAttr("title")),a=this._tooltip(n),t(n,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):a.position(e.extend({of:n},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(l=this.delayedShow=setInterval(function(){a.is(":visible")&&(o(u.of),clearInterval(l))},e.fx.interval)),this._trigger("open",i,{tooltip:a}),r={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var i=e.Event(t);i.currentTarget=n[0],this.close(i,!0)}},remove:function(){this._removeTooltip(a)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,n,r)}},close:function(t){var n=this,s=e(t?t.currentTarget:this.element),o=this._find(s);this.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&s.attr("title",s.data("ui-tooltip-title")),i(s),o.stop(!0),this._hide(o,this.options.hide,function(){n._removeTooltip(e(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:o}),this.closing=!1)},_tooltip:function(t){var i="ui-tooltip-"+n++,s=e("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("<div>").addClass("ui-tooltip-content").appendTo(s),s.appendTo(this.document[0].body),this.tooltips[i]=t,s},_find:function(t){var i=t.data("ui-tooltip-id");return i?e("#"+i):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,n){var s=e.Event("blur");s.target=s.currentTarget=n[0],t.close(s,!0),e("#"+i).remove(),n.data("ui-tooltip-title")&&(n.attr("title",n.data("ui-tooltip-title")),n.removeData("ui-tooltip-title"))})}})}(jQuery),define("jquery-ui",function(){}),define("ubnt/ubnt.password",["jquery","jquery-ui"],function(e){"use strict";e.widget("ubnt.password",{_create:function(){var t=this,i=this.element.attr("name");this.$textbox=e('<input type="text" value="" />'),this.element.after(this.$textbox.hide()),this.element.on("focus",function(){t.focus()}),this.$textbox.on("blur",function(){t.blur()}),this.$textbox.on("keyup",function(){t.change()}),this.options.suffix&&i&&this.$textbox.attr("name",i+this.options.suffix)},focus:function(){this.element.hide(),this.$textbox.show().val(this.element.val()).focus()},blur:function(){this.$textbox.hide(),this.element.show().val(this.$textbox.val())},change:function(){this.element.val(this.$textbox.val())},textbox:function(){return this.$textbox}})}),define("ubnt/ubnt.buttonalert",["jquery","msg/Msg","jquery-ui"],function(e,t){"use strict";e.widget("ubnt.buttonalert",{options:{noflash:500,delay:2500,defaults:{saving:'<span class="ui-button-icon ubnt-icon-refresh"></span>'+t.G_Saving,invalid:'<span class="ui-button-icon ubnt-icon-warning"></span>'+t.G_Invalid,success:'<span class="ui-button-icon ubnt-icon-check"></span>'+t.G_Saved,error:'<span class="ui-button-icon ubnt-icon-warning"></span>'+t.E_Error2},states:{}},_create:function(){this.options.states=this.options.states.length?this.options.states:this.options.defaults,this.options.states.reset=this.element.html(),e.each(this.options.states,e.proxy(function(t){this.element.on(t,e.proxy(this._state,this))},this))},_state:function(t,i){var n=t.type;this.timeout&&clearTimeout(this.timeout),"saving"==n||i?this.element.html(this.options.states[n]):this.timeout=setTimeout(e.proxy(function(){this.element.html(this.options.states[n])},this),this.options.noflash),("invalid"==n||"success"==n||"error"==n)&&(this.timeout=setTimeout(e.proxy(function(){this.element.html(this.options.states.reset)},this),this.options.delay-this.options.noflash))}})}),define("unifi/view/app/FormView",["unifi/view/app/ValidatorMixin","backbone","underscore","msg/Msg","jquery","ubnt/ubnt.password","ubnt/ubnt.buttonalert"],function(e,t,i,n,s){"use strict";return t.View.extend(i.extend({},e,{_templateId:"",_fadeIn:!1,initialize:function(e){i.bindAll(this),this.model&&this.model.on("remove",this.remove),this.create=!this.model||!this.model.id,this.collection=e.collection,this.app=e.app,this.template=i.template(this._templateId),this.$container=e.container,this.id=e.count||0,this.on("save-success",function(e,t,i){this.success.call(this,e,t,i)},this),this.on("save-error",function(e,t){this.error.call(this,e,t)},this)},render:function(e){this.$container.show(),!this.rendered&&(this.rendered=!0)?(this.$el.html(this.template(this.args())),this.$el.find(".buttonset").buttonset(),this.$el.find("input[type=password]").password({suffix:"-text"}),this.$el.find("select").each(function(){var e=s(this),t=e.parent();e.selectmenu({parent:t,appendTo:t,label:e.data("label"),icons:{button:"ubnt-icon-arrow-down secondary-color"},position:{at:"left bottom"},change:function(){e.trigger("change")}})}),this.$el.find("form").addClass(this.create?"create":"edit").on("submit",this.save).find("button.cancel").on("click",this.remove).end(),this.$el.find("form legend.toggle").on("click",function(e,t){var i=s(this);i.find("span").toggleClass("ubnt-icon-arrow-right",t).toggleClass("ubnt-icon-arrow-down",!i.find("span").hasClass("ubnt-icon-arrow-right")).end().siblings().toggleClass("hidden",t)}).trigger("click",!0),this.$container.prepend(this._fadeIn?this.$el.hide().fadeIn():this.$el),this.$el.find("select").selectmenu("resize"),this.$submit=this.$el.find("button.save"),this.$submit.buttonalert()):this.$container.prepend(this.$el.detach()),e||this.populate(),this.trigger("render")},args:function(){return{id:this.id}},populate:function(){},gather:function(){throw"Missing gather()"},save:function(e){e&&e.preventDefault(),this.clear(),this.$submit.trigger("saving");var t=this._save(this.model);t||this.$submit.trigger("error",!0)},success:function(){this.$submit.trigger("success")},error:function(){this.$submit.trigger("error")},remove:function(e){e&&(e.stopPropagation(),e.preventDefault()),this.model.off("remove",this.remove),this.off("save-success"),this.off("save-error"),this.$el.find("form").off(),this.$el.find("form legend.toggle").off("click"),this.$el.find("form button.cancel").off(),this.devalidate(),this.rendered=!1,t.View.prototype.remove.apply(this,arguments),this.trigger("remove")},reset:function(){this.remove()}}))}),define("unifi/view/app/DialogView",["underscore","jquery","backbone"],function(e,t,i){"use strict";return i.View.extend({exists:!1,permanent:!1,open:function(){var i=this,n={autoOpen:!0,width:900,height:900,modal:!0,resizable:!1,draggable:!1},s=e.extend(n,this.dialogOptions||{});this.render(),!this.exists&&(this.exists=!0)?(t.Body.append(this.$el),this.$el.dialog(s),this.$el.on("dialogclose",function(){i.close()})):(this.$el.dialog("open"),this.center()),s.disableAutofocus&&this.$(":tabbable:first").blur()},close:function(){this.permanent?this.$el.dialog("close"):(this.$el.empty().dialog("destroy").remove(),this.exists=!1)},center:function(){this.$el.dialog("option","position","center")},remove:function(){this.close(),i.View.prototype.remove.apply(this,arguments)}})}),define("text!includes/global/changePasswordTemplate.html",[],function(){return'<div id="ChangePasswordForm" class="dialog-change-password dialog-simple-form">\n	<div class="content left">\n		<form name="change-password" class="left">\n			<div class="row">\n                <!-- Chrome autocomplete erroneously assumes field before password is the username.\n                 Workaround: catch the erroneous input into fake fields -->\n				<input style="display:none" name="fakename" type="text" class="input" />\n				<input style="display:none" name="fakepassword" type="password" class="input" />\n				<input name="admin-name" type="text" class="input" placeholder="Admin Name" />\n				<input name="email" type="text" class="input" placeholder="<%- msg.G_Email %>" />\n			</div>\n			<div class="row">\n				<input name="password" type="password" class="input"  placeholder="<%- msg.G_PW %>" />\n				<input name="confirm-password" type="password" class="input" placeholder="<%- msg.G_ConfirmPW %>" />\n			</div>\n			<div class="footer"> <br />\n				<div class="right">\n	            	<button type="button" class="button tall auto white cancel">\n	            		<span class="ui-button-icon ubnt-icon-close"></span>\n	            		<%- msg.G_Cancel %>\n	            	</button>\n	            	<button type="submit" class="button tall green save">\n	            		<span class="ui-button-icon ubnt-icon-check"></span>\n	            		<%- msg.G_Save %>\n	            	</button>\n	            </div>\n        	</div>\n		</form>\n	</div>\n</div>\n'}),define("unifi/model/ChangePassword",["unifi/model/Model","underscore","backbone"],function(e,t,i){"use strict";return e.extend({sync:function(e,t,n){switch(n=n||{},e){case"create":n.url="/api/self",n.type="PUT",n.data=JSON.stringify({name:n.name,x_password:n.password,email:n.email})}return i.sync.call(this,e,t,n)}})}),define("unifi/view/app/ChangePasswordView",["unifi/view/app/DialogView","text!includes/global/changePasswordTemplate.html","unifi/model/ChangePassword","msg/Msg","backbone","underscore","jquery","libs/jquery.cookie"],function(e,t,i,n,s,o,a){"use strict";return e.extend({events:{"keyup input[name=admin-name]":"validateInputs","keyup input[name=email]":"validateInputs","keyup input[name=password]":"validateInputs","keyup input[name=confirm-password]":"validateInputs","click .cancel":"close","click .save":"onSubmit"},dialogOptions:{title:n.G_ChangeMyPassword,width:"auto",height:"auto",modal:!0,resizable:!1,draggable:!1,dialogClass:"dialog-change-password dialog-simple"},initialize:function(e){o.bindAll(this),this.app=e.app,this.changePassword=new i},render:function(){var e=this;this.$el.html(o.template(t,{msg:n})),this.$changePasswordForm=this.$("#changePasswordForm"),this.$adminNameInput=this.$("input[name=admin-name]"),this.$emailInput=this.$("input[name=email]"),this.$password=this.$("input[name=password]"),this.$confirmPassword=this.$("input[name=confirm-password]"),this.$submit=this.$(".save"),this.$cancel=this.$(".cancel"),this.$footer=this.$(".footer"),this.$submit.buttonalert(),this.$adminNameInput.val(this.model.get("name")),this.$emailInput.val(this.model.get("email")),this.$el.on("dialogbeforeclose",this.beforeClose),e.passwordChangeRequired=a.Body.hasClass("passwordChangeRequired"),e.passwordChangeRequired?o.delay(function(){e.$password.focus()},10):this.$adminNameInput.focus()},open:function(){e.prototype.open.call(this),a.Window.on("resize",this.onResizeWindow),this.$submit.prop("disabled",!0),this.onResizeWindow(),!this.rendered&&(this.rendered=!0)&&this.$el.find("select").each(function(){var e=a(this),t=e.parent();e.selectmenu({parent:t,appendTo:t,label:e.data("label"),icons:{button:"ubnt-icon-arrow-down secondary-color"},position:{at:"left bottom"},select:function(){}})})},beforeClose:function(){return this.passwordChangeRequired?!1:void 0},close:function(t){t&&(t.stopPropagation(),t.preventDefault()),e.prototype.close.call(this),a.Window.off("resize")},onResizeWindow:o.debounce(function(){this.center()},250),validateInputs:function(){var e,t=0,i=[this.$adminNameInput,this.$emailInput];this.$adminNameInput.removeClass("error"),this.$footer.find(".error-msg").remove(),this.passwordChangeRequired&&i.push(this.$password,this.$confirmPassword),o.each(i,function(e){e.val()||t++},this),this.model.validator.email(this.$emailInput.val())?this.$emailInput.removeClass("error"):(e=n.localize(n.E_InvalidEmail,n.G_SettingsAdminEmail),this.$emailInput.addClass("error")),this.model.validator.accountName(this.$adminNameInput.val())?this.$adminNameInput.removeClass("error"):(e=n.localize(n.E_InvalidAdminName,n.G_SettingsAdminName),this.$adminNameInput.addClass("error")),this.validatePasswordMatch(),this.validatePasswordMatch()&&!e?this.$submit.prop("disabled",!!t):this.$submit.prop("disabled",!0),e&&this.$footer.prepend(a('<div class="left error-msg"></div>').text(e))},validatePasswordMatch:function(){var e;return e=this.$password.val()===this.$confirmPassword.val()?!0:!1},onSubmit:function(e){e.preventDefault();var t=this.$adminNameInput.val(),i=this.$emailInput.val(),s=this.$el.find(".footer"),o={name:t,email:i,success:a.proxy(function(){this.$submit.trigger("success"),a.Body.removeClass("passwordChangeRequired"),delete this.passwordChangeRequired,this.model.fetch(),this.model.trigger("change"),this.close()},this),error:a.proxy(function(e){s.append(a('<div class="left error-msg" />').text(n.apiError(e))),this.$submit.trigger("error",!0)},this)};(this.$password.val()||this.passwordChangeRequired)&&(o.password=this.$password.val()),s.find(".error-msg").remove(),this.$submit.trigger("saving"),this.changePassword.sync("create",this,o)},remove:function(){this.$el.off("dialogbeforeclose",this.beforeClose),a.Window.off("resize",this.onResizeWindow),e.prototype.remove.apply(this,arguments)}})}),define("unifi/view/app/UserPopOverView",["unifi/view/app/ChangePasswordView","backbone","underscore","jquery"],function(e,t,i){"use strict";return t.View.extend({events:{"click #ChangePassword":"changePassword"},el:"#UserPopOver",initialize:function(){i.bindAll(this),this.$userName=this.$(".user-name"),this.$userEmail=this.$(".user-email"),this.$userProfileAvatarImage=this.$(".user-avatar img"),this.$userMessageAvatarImage=this.$(".small-avatar img"),this.$el.click(function(e){e.stopPropagation()}),this.model.on("change",this.render,this),this.render()},render:function(){this.$userName.text(this.model.getName()),this.$userEmail.text(this.model.get("email")),this.updateProfileAvatar(),this.updateMessageAvatar()},show:function(){this.$el.removeClass("visuallyhidden")},hide:function(){this.$el.addClass("visuallyhidden")},toggle:function(){this.$el.toggle()},toggleClass:function(){this.$el.toggleClass("visuallyhidden")},changePassword:function(t){if(t.preventDefault(),this.model.get("is_local")){var i=new e({model:this.model});i.open()}},updateProfileAvatar:function(){this.$userProfileAvatarImage.attr("src",this.model.get("avatar_url"))},updateMessageAvatar:function(){this.$userMessageAvatarImage.attr("src",this.model.get("avatar_sm_url"))},remove:function(){this.model.off("change",this.render),t.View.prototype.remove.apply(this,arguments)}})}),define("unifi/model/Site",["unifi/model/Model","underscore","backbone","msg/Msg"],function(e,t,i,n){"use strict";return e.extend({ignoreUnset:["key"],validate:function(e,i){var s={},o=i?i.partial:null;return o&&"desc"!=o||(e.desc?this.validator.name(e.desc)||(s.desc=n.localize(n.E_InvalidName,n.G_Name)):o||(s.desc=n.localize(n.E_CannotBeEmpty,n.G_Name))),t.size(s)?s:void 0},sync:function(e,n,s){switch(e){case"create":s.url="/api/s/"+SITE.name+"/cmd/sitemgr",s.contentType="application/json; charset=utf-8",s.type="POST",s.data=JSON.stringify(t.extend(n.toJSON(s),{cmd:"add-site"}));break;case"update":s.url="/api/s/"+SITE.name+"/cmd/sitemgr",s.contentType="application/json; charset=utf-8",s.type="POST",s.data=JSON.stringify(t.extend(n.toJSON(s),{cmd:"update-site"}));break;case"delete":s.url="/api/s/"+SITE.name+"/cmd/sitemgr",s.contentType="application/json; charset=utf-8",s.type="POST",s.data=JSON.stringify({site:n.id,cmd:"delete-site"})}return i.sync.call(this,e,n,s)}})}),define("unifi/collection/Sites",["unifi/collection/Collection","backbone","unifi/model/Site"],function(e,t,i){"use strict";return e.extend({model:i,bySite:!1,url:function(){return"/api/self/sites"},sync:function(e,i,n){return t.sync.call(this,e,i,n)},comparator:function(e){return e.get("desc")?e.get("desc").toLowerCase():"default"}})}),define("text!includes/settings/settingsChromeTemplate.html",[],function(){return'<div class="columnOuterContainer dialogColumn">\n    <div class="columnInnerContainer">\n        <div id="dialogMain">\n            <div class="content">\n                <div id="dialogMainContent">\n                    <div class="container content">\n                        <ul id="settingsNav" class="subnav">\n                            <li id="navSettingsSite"><a href="#" data-section="site"><%- msg.G_SettingsSite %></a></li>\n                            <li id="navSettingsWirelessNetworks"><a href="#" data-section="wirelessnetworks"><%- msg.G_SettingsWirelessNetworks %></a></li>\n                            <li id="navSettingsNetworks"><a href="#" data-section="networks"><%- msg.G_SettingsNetworks %></a></li>\n                            <li id="navSettingsGuestControl"><a href="#" data-section="guestcontrol"><%- msg.G_SettingsGuestCtrl %></a></li>\n                            <li id="navSettingsAdmins" class="is-admin"><a href="#" data-section="admins"><%- msg.G_SettingsAdmins %></a></li>\n                            <li id="navSettingsUserGroups" class="end-section"><a href="#" data-section="usergroups"><%- msg.G_SettingsUserGroups %></a></li>\n                            <li id="navSettingsVoip"><a href="#" data-section="voip"><%- msg.G_SettingsVoip %></a></li>\n                            <li id="navSettingsExtensions" class="has-voip"><a href="#" data-section="extensions"><%- msg.G_SettingsExtensions %></a></li>\n                            <li class="end-section"></li>\n                            <li id="navSettingsController" class="is-super"><a href="#" data-section="controller"><%- msg.G_SettingsController %></a></li>\n                            <li id="navSettingsMaintenance" class="is-super"><a href="#" data-section="maintenance"><%- msg.G_SettingsMaintenance %></a></li>\n                        </ul>\n                        <div id="settingsContent" class="subcontent">\n                            <!-- settings content -->\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n'}),define("unifi/view/settings/FormView",["unifi/view/app/FormView","underscore","msg/Msg","jquery"],function(e,t,i,n){"use strict";return e.extend({render:function(t){var i=this.rendered;e.prototype.render.call(this,t),i||(this.$el.find("input:first").setCaret(0),this.app.isReadOnly||this.prevalidator())},success:function(){e.prototype.success.call(this),this.create&&this._permanent?this._constant||this.$el.find("form").each(function(){this.reset()}):this.remove()},error:function(t,s){e.prototype.error.call(this),this.$el.find("fieldset.actions").prepend(n('<div class="error-msg">'+i.E_DataSave+": "+i.apiError(s)+"</div>"))},remove:function(){this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("text!includes/settings/settingsAdminsFormTemplate.html",[],function(){return'<form class="complex-form">\n    <h2><%- headline %></h2>\n\n    <fieldset class="basic">\n        <div class="fields">\n            <div>\n                <label for="accountEmail<%- id %>"><%- msg.G_Email %></label>\n                <input type="text" id="accountEmail<%- id %>" name="email" value="" />\n            </div>\n            <div>\n                <label for="accountName<%- id %>"><%- msg.G_SettingsAdminName %></label>\n                <input type="text" id="accountName<%- id %>" name="name" value="" />\n            </div>\n            <div>\n                <label for="accountRole<%- id %>"><%- msg.G_Role %></label>\n                <div class="select">\n                    <select id="accountRole<%- id %>" name="role">\n                        <option value="admin"><%- msg.G_Administrator %></option>\n                        <option value="readonly"><%- msg.G_ReadOnly %></option>\n                    </select>\n                </div>\n            </div>\n        </div>\n    </fieldset>\n    <fieldset class="actions">\n        <button type="button" class="button tall auto white cancel">\n            <span class="ui-button-icon ubnt-icon-close"></span>\n            <%- msg.G_Cancel %>\n        </button>\n        <button type="submit" class="button tall auto green save">\n            <span class="ui-button-icon ubnt-icon-check"></span>\n            <%- msg.G_Invite %>\n        </button>\n    </fieldset>\n</form>'}),define("unifi/view/settings/AdminsFormView",["unifi/view/settings/FormView","underscore","jquery","msg/Msg","text!includes/settings/settingsAdminsFormTemplate.html"],function(e,t,i,n,s){"use strict";return e.extend({_templateId:s,_prevalidate:{name:{input:"text"},email:{input:"text"}},args:function(){return{id:this.id,headline:this.create?n.G_SettingsCreateNewAdmin:n.G_SettingsEditAdmin+" - "+this.model.get("name"),msg:n}
},populate:function(){this.model&&(this.$el.find("input[name=email]").val(this.model.get("email")),this.$el.find("input[name=name]").val(this.model.get("name")),this.$el.find("select[name=role]").val(this.model.get("role")).trigger("change"))},gather:function(){return{name:this.$el.find("input[name=name]").val(),email:this.$el.find("input[name=email]").val(),role:this.$el.find("select[name=role] option:selected").val()}}})}),define("ubnt/view/modals/WaitingModalView",["backbone","underscore","jquery"],function(e,t,i){"use strict";return e.View.extend({initialize:function(){t.bindAll(this),this.template=t.template(i.trim(i("#WaitingModalTemplate").html())),this.el=this.template({}),this.$el=i(this.el),this.$el.hide(),this.$dialog=this.$(".loading-indicator"),this.$message=this.$(".loading-message"),this.$progressBar=this.$(".progress-bar"),this.$progressBarFill=this.$(".progress-bar .fill")},center:function(){this.$dialog.css("marginLeft",-(this.$dialog.outerWidth()/2)),this.$dialog.css("marginTop",-(this.$dialog.outerHeight()/2))},setProgress:function(e){0===e?this.$progressBarFill.css("width","0%"):this.$progressBarFill.stop().animate({width:e+"%"},"fast",function(){}),this.$progressBar.show()},show:function(e,t){this.$progressBar.hide(),t&&t.append(this.$el),this.$el.show(),e&&this.$message.text(e),this.center()},hide:function(){this.$el.hide()}})}),define("ubnt/view/dialogs/DialogView",["backbone","underscore","ubnt/view/modals/WaitingModalView","msg/Msg","jquery","text!includes/map/messageDialogTemplate.html","jquery-ui"],function(e,t,i,n,s,o){"use strict";return e.View.extend({_fullyQualifiedName:"UBNT.views.dialogs.Dialog",initialize:function(){t.bindAll(this),this.hasMoved=!1,this.isRendered=!1,this.isMaximixed=!1,this.template||(this.template=t.template(o));var e={title:"",autoOpen:!1,width:"auto",height:"auto",resizable:!1,modal:!0,draggable:!1};this.options.dialogOptions=t.extend(e,this.options.dialogOptions),this.buttonElements={},this.buttonsDef=[],t.each(this.options.dialogOptions.buttons,function(e,t){"object"==typeof e?(this.buttonsDef.push(e),this.options.dialogOptions.buttons[t]=e.handler):this.buttonsDef.push({buttonClass:"",handler:e})},this)},render:function(e){var n=this,o=e&&e.template_json?e.template_json:{};return n.isRendered||(n.isRendered=!0,n.el=n.template(o),n.$el=s(n.el),this.$el.bind("dialogresize",this.resizeHandler),this.$el.bind("dialogresizestop",this.resizeHandler),this.$el.bind("dialogdragstop",this.dragStopHandler),this.$el.on("dialogbeforeclose",this.dialogCloseHandler),this.$el.bind("dialogopen",this.dialogOpenHandler),s.Window.on("resize",t.debounce(this.center,250)),n.$el.dialog(this.options.dialogOptions),n.$dialog=n.$el.parents(".ui-dialog"),n.waitingModal=new i,n.$dialog.append(this.waitingModal.$el),this.$buttonBar=this.$dialog.find(".ui-dialog-buttonpane"),t.each(this.$buttonBar.find("button"),function(e,t){var i=s(e).button("option","label");this.buttonElements[i]=s(e),s(e).addClass(this.buttonsDef[t].buttonClass)},this)),n.$dialog},bindHandlers:function(){},unbindHandlers:function(){},show:function(e,t,i){this.open(e,t,i)},open:function(e,t,i){var n=this;if(n.render(),n.callBack=t||function(){n.$el.dialog("close")},n.context=i||n,!this.isOpen){n.isMaximixed=!1,n.$el.dialog("open"),n.$el.dialog("option",{position:"center"});{n.$el.parents(".ui-dialog").offset()}}this.isOpen=!0,e&&this.$el.find(".message").text(e),this.bindHandlers(),n.$el.dialog("moveToTop"),n.$el.trigger("show")},hide:function(e,t){var i=this;i.context=t||i,i.cancelCallback=e||function(){i.$el.dialog("close")}},close:function(){this.$el.dialog("close")},showModal:function(e){this.waitingModal.show(e?e:n.G_SavingPleaseWait)},hideModal:function(){this.waitingModal.hide()},setModalProgress:function(e){this.waitingModal.setProgress(e)},setTitle:function(e){this.$el.dialog("option","title",e)},getButton:function(e){return this.buttonElements[e]},resizeHandler:function(){},dragStopHandler:function(){this.hasMoved=!0},dialogCloseHandler:function(){this.isOpen=!1,this.unbindHandlers()},dialogOpenHandler:function(){},center:function(){try{this.$el.dialog("option","position","center")}catch(e){}},destroy:function(){this.dialogCloseHandler(),this.$el.dialog("destroy")},remove:function(){this.$el.unbind("dialogresize",this.resizeHandler),this.$el.unbind("dialogresizestop",this.resizeHandler),this.$el.unbind("dialogdragstop",this.dragStopHandler),this.$el.off("dialogbeforeclose",this.dialogCloseHandler),this.$el.unbind("dialogopen",this.dialogOpenHandler),s.Window.off("resize",t.debounce(this.center,250)),this.isRendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("ubnt/view/dialogs/ConfirmDialogView",["underscore","ubnt/view/dialogs/DialogView","msg/Msg","jquery","text!includes/map/messageDialogTemplate.html"],function(e,t,i,n,s){"use strict";return t.extend({_fullyQualifiedName:"UBNT.views.dialogs.ConfirmDialog",initialize:function(){e.bindAll(this),this.template=e.template(s);var n={title:i.G_PleaseConfirm,autoOpen:!0,width:300,resizable:!1,draggable:!1,modal:!0,dialogClass:"confirm-dialog",ConfirmButton:{buttonClass:"ui-alert-negative",handler:this.confirmHandler},CancelButton:{handler:this.cancelHandler},buttons:{}};n.buttons[i.G_Confirm]=n.ConfirmButton,n.buttons[i.G_Cancel]=n.CancelButton,this.options.dialogOptions=e.extend(n,this.options.dialogOptions||{}),t.prototype.initialize.apply(this,[this.options])},render:function(){t.prototype.render.apply(this,[]),this.$message=this.$el.find(".message"),this.$message.text(this.message)},show:function(e,t,i){this.message=e,this.open(e,t,i)},closeDialog:function(e,t){this.hide(e,t)},confirmHandler:function(){this.callBack.call(this.context),this.$el.dialog("close")},cancelHandler:function(){this.cancelCallback&&this.cancelCallback.call(this.context),this.$el.dialog("close")}})}),define("unifi/view/settings/BreadcrumbMixin",["jquery"],function(e){"use strict";return{renderChild:function(t){var i=e.trim(t.$el.find("h2:first").clone().find("span").remove().end().text());this.$(".section-home").hide(),this.$(".breadcrumb").text(i),this.$(".breadcrumb-child").show(),this.$(".breadcrumb-home").addClass("linkify").one("click",function(){t.remove()})},removeChild:function(){this.$(".section-home").show(),this.$(".breadcrumb-child").hide(),this.$(".breadcrumb").empty(),this.$(".breadcrumb-home").removeClass("linkify")}}}),define("unifi/view/settings/ListContentView",["unifi/view/app/ListContentView","ubnt/view/dialogs/ErrorDialogView","ubnt/view/dialogs/ConfirmDialogView","unifi/view/settings/BreadcrumbMixin","msg/Msg","libs/backgrid","ubnt/backgrid","underscore","jquery"],function(e,t,i,n,s,o,a,r,l){"use strict";return e.extend(r.extend({},n,{_formClass:"",_autoRender:!1,initialize:function(t){this.forms={},e.prototype.initialize.call(this,t)},grid:function(t){if(e.prototype.grid.call(this,t),this.$createBtn=this.$el.find(".create-form"),this.$createBtn.on("click",l.proxy(function(){this.form(new this.collection.model)},this)).show(),this.$forms=this.$el.find("div.forms"),this.options.edit){var i=this.collection.get(this.options.edit);i&&this.rowEdit(i),delete this.options.edit}return this},form:function(e,t,i){var n=e&&e.id?e.id:null,s=n&&this.forms[n]?this.forms[n]:null,o=this;return this.$forms.empty(),s||(s=new this._formClass(r.extend({container:this.$forms,model:e,collection:this.collection,count:r.size(this.forms)+1,app:this.app},this.formAttributes(e))),s.bind("render",function(){o.renderForm(s)}).bind("remove",function(){o.removeForm(s)}),n&&(this.forms[n]=s)),i||s.render(),s},formAttributes:function(){return{}},renderForm:function(e){this.renderChild(e)},removeForm:function(e){e.model&&e.model.id&&this.forms[e.model.id]&&(this.forms[e.model.id]=null),e.unbind("render").unbind("remove"),this.removeChild()},rowEdit:function(e,t){t&&t.preventDefault(),this.form(e,t?l(t.target).parents("tr"):null),this.$el.trigger("edit")},rowDelete:function(e,n){n&&n.preventDefault(),(new i).show(s.N_ConfirmDeleteSetting,function(){e.destroy({wait:!0,error:function(e,i){(new t).open(s.apiError(i,!0))}})})},whenReady:function(e){l.when(this._rendered,this._loaded,this._dependencies).then(l.proxy(function(){e.apply(this)},this))},remove:function(){this.$createBtn.off(),r.each(this.forms,function(e){e&&(e.unbind("render").unbind("remove"),e=null)}),this.forms={},e.prototype.remove.apply(this,arguments)}}))}),define("unifi/model/Admin",["unifi/model/Model","underscore","backbone","msg/Msg"],function(e,t,i,n){"use strict";return e.extend({url:function(){return"/api/s/"+SITE.name+"/cmd/sitemgr"},validate:function(e,i){var s={},o=i?i.partial:null;return o&&"email"!=o||(e.email?this.validator.email(e.email)||(s.email=n.localize(n.E_IncorrectEmailAddress,e.email)):o||(s.email=n.localize(n.E_CannotBeEmpty,n.G_Email))),o&&"name"!=o||(e.name?this.validator.accountName(e.name)||(s.name=n.localize(n.E_InvalidAdminName,n.G_Name)):o||(s.name=n.localize(n.E_CannotBeEmpty,n.G_Name))),t.size(s)?s:void 0},invite:function(e){return this.sync("invite",this,e)},sync:function(e,n,s){switch(e){case"create":s.contentType="application/json; charset=utf-8",s.type="POST",s.data=JSON.stringify(t.extend(n.toJSON(s),{cmd:"invite-admin"}));break;case"delete":s.contentType="application/json; charset=utf-8",s.type="POST",s.data=JSON.stringify({admin:n.id,cmd:"revoke-admin"});break;case"invite":s.contentType="application/json; charset=utf-8",s.type="POST",s.data=JSON.stringify({email:n.get("email"),cmd:"invite-admin",name:n.get("name"),role:n.get("role")})}return i.sync.call(this,e,n,s)}})}),define("unifi/collection/Admins",["unifi/collection/Collection","backbone","unifi/model/Admin"],function(e,t,i){"use strict";return e.extend({model:i,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/cmd/sitemgr"},sync:function(e,i,n){switch(e){case"read":n.type="POST",n.data=JSON.stringify({cmd:"get-admins"})}return t.sync.call(this,e,i,n)}})}),define("text!includes/settings/settingsAdminsTemplate.html",[],function(){return'<div class="section section-main">\n    <h1>\n        <span class="breadcrumb-home"><%- msg.G_SettingsAdmins %></span>\n        <span class="breadcrumb-child hidden">\n            <span class="ubnt-icon-arrow-right"></span>\n            <span class="breadcrumb"></span>\n        </span>\n    </h1>\n\n    <div class="section-home">\n        <div class="data-table untitled">\n            <div class="loading"><span><%- msg.N_Loading %></span></div>\n        </div>\n        <div class="buttons">\n            <button class="button tall auto white create-form hidden" data-type="create-form">\n                <span class="ui-button-icon ubnt-icon-gear gear"></span><%- msg.G_SettingsCreateNewAdmin %>\n            </button>\n        </div>\n    </div>\n    <div class="forms hidden"></div>\n</div>'}),define("unifi/view/settings/AdminsView",["underscore","jquery","unifi/view/settings/ListContentView","unifi/view/settings/AdminsFormView","ubnt/view/dialogs/AlertDialogView","ubnt/view/dialogs/ErrorDialogView","ubnt/backgrid","msg/Msg","unifi/collection/Admins","text!includes/settings/settingsAdminsTemplate.html"],function(e,t,i,n,s,o,a,r,l,u){"use strict";return i.extend({id:"settingsAdmins",_templateId:e.template(u,{msg:r}),_formClass:n,_collectionType:{name:"Admins",Class:l},_pageable:!1,columns:function(){return[{name:"name",label:r.G_UN,editable:!1,cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:t.proxy(function(e){return(e.get("name")||"("+r.G_Unconfigured+")")+(e.get("is_verified")?"":" ("+r.G_Unverified+")")},this)}})},{name:"email",label:r.G_Email,editable:!1,cell:"string"},{name:"role",label:r.G_Role,editable:!1,cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:t.proxy(function(e){return"admin"==e.get("role")?r.G_Admin:r.G_ReadOnly},this)}})},{name:"_id",label:r.G_Actions,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ActionsCell.extend({actions:{invite:{icon:"ubnt-icon-mail",callback:this.rowInvite,text:"Re-invite",render:function(e){return!e.get("is_verified")&&"hotspot"!=e.get("role")&&!e.get("is_super")&&e.id!=USER.id}},revoke:{icon:"ubnt-icon-close",callback:this.rowDelete,text:"Revoke",render:function(e){return e.id!=USER.id&&!e.get("is_super")}},edit:{icon:"ubnt-icon-edit",callback:this.rowEdit,text:"Edit",render:function(e){return e.id===USER.id}}}})}]},rowInvite:function(e,i){var n=this,s=t(i.target);s.prop("disabled",!0),e.invite({success:function(){n.options.app.views.app.flash("success","Success",r.localize(r.G_AccountReinvited,e.get("name")))},error:function(e){n.options.app.views.app.flash("error","Error",r.apiError(e))},complete:function(){s.prop("disabled",!1)}})},rowEdit:function(e,i){t(i.target);t("#ChangePassword").click()}})}),define("unifi/model/Setting",["unifi/model/Model","underscore","backbone","msg/Msg"],function(e,t,i,n){"use strict";return e.extend({validate:function(e,i){var s={},o=i?i.partial:null;switch(e.key||(s.key=n.localize(n.E_CannotBeEmpty,n.G_SettingsKey)),e.key){case"guest_access":if(e.portal_enabled){switch(o&&"expire"!=o||"custom"==e.expire&&(this.validator.digits(e.expire_number)||(s.name=n.localize(n.E_IncorrectIntegerType,n.G_Expiration))),e.auth){case"none":break;case"password":o&&"x_password"!=o||e.x_password||(s.x_password=n.localize(n.E_CannotBeEmpty,n.G_PW));break;case"hotspot":if(o&&"authorization"!=o||e.voucher_enabled||e.payment_enabled||(s.authorization=n.localize(n.E_GuestNoHotspotPaymentSelected)),e.payment_enabled)switch(e.gateway){case"paypal":o&&"x_paypal_username"!=o||e.x_paypal_username||(s.x_paypal_username=n.localize(n.E_CannotBeEmpty,n.G_UN)),o&&"x_paypal_password"!=o||e.x_paypal_password||(s.x_paypal_password=n.localize(n.E_CannotBeEmpty,n.G_PW)),o&&"x_paypal_signature"!=o||e.x_paypal_signature||(s.x_paypal_signature=n.localize(n.E_CannotBeEmpty,n.G_Signature));break;case"stripe":o&&"x_stripe_api_key"!=o||e.x_stripe_api_key||(s.x_stripe_api_key=n.localize(n.E_CannotBeEmpty,n.G_SettingsAPIKey));break;case"quickpay":o&&"x_quickpay_merchantid"!=o||e.x_quickpay_merchantid||(s.x_quickpay_merchantid=n.localize(n.E_CannotBeEmpty,n.G_SettingsMerchantId)),o&&"x_quickpay_md5secret"!=o||e.x_quickpay_md5secret||(s.x_quickpay_md5secret=n.localize(n.E_CannotBeEmpty,n.G_SetttingsMD5Secret));break;case"authorize":o&&"x_authorize_loginid"!=o||e.x_authorize_loginid||(s.x_authorize_loginid=n.localize(n.E_CannotBeEmpty,n.G_SettingsAPILoginId)),o&&"x_authorize_transactionkey"!=o||e.x_authorize_transactionkey||(s.x_authorize_transactionkey=n.localize(n.E_CannotBeEmpty,n.G_SettingsTransactionKey));break;case"merchantwarrior":o&&"x_merchantwarrior_merchantuuid"!=o||e.x_merchantwarrior_merchantuuid||(s.x_merchantwarrior_merchantuuid=n.localize(n.E_CannotBeEmpty,n.G_SettingsMerchantUuid)),o&&"x_merchantwarrior_apikey"!=o||e.x_merchantwarrior_apikey||(s.x_merchantwarrior_apikey=n.localize(n.E_CannotBeEmpty,n.G_SettingsAPIKey)),o&&"x_merchantwarrior_apipassphrase"!=o||e.x_merchantwarrior_apipassphrase||(s.x_merchantwarrior_apipassphrase=n.localize(n.E_CannotBeEmpty,n.G_SettingsAPIPassphrase));break;case"ippay":o&&"x_ippay_terminalid"!=o||e.x_ippay_terminalid||(s.x_ippay_terminalid=n.localize(n.E_CannotBeEmpty,n.G_SettingsTerminalId))}break;case"custom":o&&"custom_ip"!=o||(e.custom_ip?this.validator.ip(e.custom_ip)||(s.custom_ip=n.localize(n.E_IncorrectIPAddress,n.G_IPAddress)):s.custom_ip=n.localize(n.E_CannotBeEmpty,n.G_IPAddress))}o&&"redirect_url"!=o||e.redirect_enabled&&!e.redirect_url&&(s.redirect_url=n.localize(n.E_CannotBeEmpty,n.G_SettingsPromoURL)),o&&"portal_hostname"!=o||e.portal_use_hostname&&(e.portal_hostname?this.validator.hostname(e.portal_hostname)||(s.portal_hostname=n.localize(n.E_InvalidHostname,n.G_Hostname)):s.portal_hostname=n.localize(n.E_CannotBeEmpty,n.G_Hostname))}var a=[];t.each(["restricted","allowed"],function(t){for(var i=1,n=null;32>i;i++)(n=e[t+"_subnet_"+i])&&(this.validator.subnet(n)||a.push(n))},this),t.size(a)&&(s.subnets=n.localize(n.E_InvalidSubnetList,a.join(", ")));break;case"connectivity":e.enabled&&"custom"==e.uplink_type&&(o&&"uplink_host"!=o||(e.uplink_host?this.validator.ip(e.uplink_host)||(s.uplink_host=n.localize(n.E_IncorrectIPAddress,n.G_UplinkIPAddress)):s.uplink_host=n.localize(n.E_CannotBeEmpty,n.G_UplinkIPAddress)));break;case"mgmt":o&&"x_ssh_username"!=o||(e.x_ssh_username?this.validator.deviceAccountName(e.x_ssh_username)||(s.x_ssh_username=n.localize(n.E_InvalidDeviceAdminName,n.G_UN)):s.x_ssh_username=n.localize(n.E_CannotBeEmpty,n.G_UN)),o&&"x_ssh_password"!=o||e.x_ssh_password||(s.x_ssh_password=n.localize(n.E_CannotBeEmpty,n.G_PW));break;case"snmp":e.enabled&&(o&&"snmp_community"!=o||e.community||(s.snmp_community=n.localize(n.E_CannotBeEmpty,n.G_SettingsSNMPCommunity)));break;case"rsyslogd":e.enabled&&(o&&"ip"!=o||e.ip||(s.ip=n.localize(n.E_CannotBeEmpty,n.G_SettingsRemoteIPAddress)),o&&"port"!=o||(e.port?this.validator.range(e.port,1,65535)||(s.port=n.localize(n.E_IncorrectNumberRange,n.G_Port,1,65535)):s.port=n.localize(n.E_CannotBeEmpty,n.G_Port)));break;case"super_smtp":e.enabled&&(o&&"host"!=o||e.host||(s.host=n.localize(n.E_CannotBeEmpty,n.G_SettingsSMTPHost)),o&&"port"!=o||(e.port?this.validator.range(e.port,1,65535)||(s.port=n.localize(n.E_IncorrectNumberRange,n.G_Port,1,65535)):s.port=n.localize(n.E_CannotBeEmpty,n.G_Port)),e.use_auth&&(o&&"username"!=o||e.username||(s.username=n.localize(n.E_CannotBeEmpty,n.G_UN)),o&&"x_password"!=o||e.x_password||(s.x_password=n.localize(n.E_CannotBeEmpty,n.G_PW))));break;case"provider":o&&"sip_server"!=o||e.sip_server||(s.sip_server=n.localize(n.E_CannotBeEmpty,n.G_SettingsSipServer))}return t.size(s)?s:void 0},sync:function(e,t,n){return n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/set/setting/"+t.get("key"),n.type="POST",n.data=JSON.stringify(t.toJSON({exclude:["_id"]})),i.sync.call(this,e,t,n)}})}),define("unifi/collection/Settings",["unifi/collection/Collection","underscore","backbone","unifi/model/Setting"],function(e,t,i,n){"use strict";return e.extend({model:n,bySite:!0,getSettingFromKey:function(e,i){var s=t(this.filter(function(t){return t.get("key")==e&&(!i||t.get("site_id")==i)})).last();return s||(s=new n({key:e,site_id:i})),s},url:function(){return"/api/s/"+SITE.name+"/get/setting"},testMail:function(e){return this.sync("test-mail",this,e)},sync:function(e,n,s){switch(s=s||{},e){case"test-mail":s.contentType="application/json; charset=utf-8",s.url="/api/s/"+SITE.name+"/cmd/cfgmgr",s.type="POST",s.data=JSON.stringify(t.extend(s.data||{},{cmd:"test_mail"}))}return i.sync.call(this,e,n,s)}})}),define("text!includes/settings/settingsSiteTemplate.html",[],function(){return'<div class="section section-main">\n    <button type="button" class="button tall auto red delete left right is-admin">\n        <span class="ui-button-icon ubnt-icon-close"></span><%- msg.G_SettingsDeleteSite %></button>\n\n    <h1><%- msg.G_SettingsSite %></h1>\n\n    <form class="complex-form">\n        <h2><%- msg.G_SettingsSiteConfig %></h2>\n\n        <fieldset class="basic">\n            <div class="fields">\n                <div>\n                    <label for="configureSiteName"><%- msg.G_SettingsSiteName %></label>\n                    <input type="text" id="configureSiteName" name="site-name" value="" />\n                </div>\n                <div class="secondary">\n                    <label for="configureCountry"><%- msg.G_SettingsCountry %></label>\n                    <div>\n                        <span>\n                            <select id="configureCountry" name="country">\n                                <%= countryOptionsTemplate() %>\n                            </select>\n                        </span>\n                    </div>\n                </div>\n                <div class="secondary">\n                    <label for="configureTimezone"><%- msg.G_SettingsTimezone %></label>\n                    <div>\n                        <span>\n                            <select id="configureTimezone" name="timezone">\n                                <%= timezoneOptionsTemplate() %>\n                            </select>\n                        </span>\n                    </div>\n                </div>\n            </div>\n        </fieldset>\n\n        <h2><%- msg.G_SettingsServices %></h2>\n\n        <fieldset class="services">\n            <div class="fields">\n                <div>\n                    <label for="configureAutomaticUpgradeAP"><%- msg.G_SettingsAutoUpgrade %></label>\n                    <input type="checkbox" id="configureAutomaticUpgradeAP" name="enable-auto-upgrade-ap" value="1" />\n                    <span><%- msg.G_SettingsAutoUpgradeAPFirm %></span>\n                </div>\n                <div>\n                    <label for="configureAutomaticUpgradePhone"></label>\n                    <input type="checkbox" id="configureAutomaticUpgradePhone" name="enable-auto-upgrade-phone" value="1" />\n                    <span><%- msg.G_SettingsAutoUpgradePhoneFirm %></span>\n                </div>\n                <div>\n                    <label for="configureLed"><%- msg.G_SettingsLED %></label>\n                    <input type="checkbox" id="configureLed" name="enable-led" value="1" checked="checked" />\n                    <span><%- msg.G_SettingsEnblStatusLED %></span>\n                </div>\n                <div>\n                    <label for="configureAlertEmails"><%- msg.G_SettingsAlert %></label>\n                    <input type="checkbox" id="configureAlertEmails" name="enable-alert" value="1" checked="checked" />\n                    <span><%- msg.G_SettingsEnblAlertEmails %></span>\n                </div>\n                <div>\n                    <label for="configureConnectivityMonitor">\n                        <%- msg.G_SettingsUplnkConnMonitor %></label>\n                    <input type="checkbox" id="configureConnectivityMonitor" name="enable-connectivity-monitor" value="1" checked="checked" />\n                    <span><%- msg.G_SettingsEnableConnMonWireUplnk %></span>\n                    <div id="connectivityUplink" class="indented inline-form">\n                        <div class="buttonset">\n                            <input type="radio" id="configureUplinkTypeDefaultGateway" name="uplink-type" value="gateway" checked="checked" /><label for="configureUplinkTypeDefaultGateway"><%- msg.G_SettingsDefaultGateway %></label>\n                            <input type="radio" id="configureUplinkTypeCustomIP" name="uplink-type" value="custom" />\n                            <label for="configureUplinkTypeCustomIP"><%- msg.G_SettingsCustomIP %></label>\n                        </div>\n\n                        <input type="text" id="configureUplinkCustomHost" name="uplink_host" value="" placeholder="<%- msg.G_UplinkIPAddress %>" />\n                    </div>\n                </div>\n                <div>\n                    <label for="configureSnmp"><%- msg.G_SettingsSNMP %></label>\n                    <input type="checkbox" id="configureSnmp" name="enable-snmp" value="1" />\n                    <span><%- msg.G_SettingsEnblSNMP %>, <%- msg.G_SettingsSNMPCommunity %></span>\n                    <input type="text" name="snmp_community" value="" placeholder="public" />\n                </div>\n                <div>\n                    <label for="configureRemoteLogging"><%- msg.G_SettingsRemoteLogging %></label>\n                    <input type="checkbox" id="configureRemoteLogging" name="enable-remote-logging" value="1" />\n                    <span><%- msg.G_SettingsEnblRemoteSysServ %></span>\n                    <input type="text" name="ip" placeholder="<%- msg.G_SettingsRemoteIPAddress %>" value="" />\n                    <span><%- msg.G_Port %></span>\n                    <input type="text" name="port" value="" size="4" />\n                </div>\n                <div class="rsyslog-toggled unlabeled">\n                    <input type="checkbox" id="enableDebugLogging" name="debug" value="0" />\n                    <span class="padded"><%- msg.G_SettingsLoggingDebug %></span>\n                </div>\n                <div>\n                    <label for="configureDeviceAuth"><%- msg.G_SettingsDeviceAuth %></label>\n                    <span><%- msg.G_UN %></span>\n                    <input type="text" id="configureDeviceAuth" name="x_ssh_username" value="">\n                    <span><%- msg.G_PW %></span>\n                    <input type="password" name="x_ssh_password" value="">\n                </div>\n            </div>\n        </fieldset>\n\n        <fieldset class="actions">\n            <button type="submit" class="button tall auto green save is-admin">\n                <span class="ui-button-icon ubnt-icon-check"></span><%- msg.G_Apply %></button>\n        </fieldset>\n    </form>\n</div>\n'}),define("text!includes/global/countryOptions.html",[],function(){return'<option value="8">Albania</option>\n<option value="12">Algeria</option>\n<option value="32">Argentina</option>\n<option value="51">Armenia</option>\n<option value="533">Aruba</option>\n<option value="36">Australia</option>\n<option value="40">Austria</option>\n<option value="31">Azerbaijan</option>\n<option value="48">Bahrain</option>\n<option value="50">Bangladesh</option>\n<option value="52">Barbados</option>\n<option value="112">Belarus</option>\n<option value="56">Belgium</option>\n<option value="84">Belize</option>\n<option value="68">Bolivia</option>\n<option value="70">Bosnia and Herzegovina</option>\n<option value="76">Brazil</option>\n<option value="96">Brunei Darussalam</option>\n<option value="100">Bulgaria</option>\n<option value="116">Cambodia</option>\n<option value="124">Canada</option>\n<option value="152">Chile</option>\n<option value="156">China</option>\n<option value="170">Colombia</option>\n<option value="188">Costa rica</option>\n<option value="191">Croatia</option>\n<option value="196">Cyprus</option>\n<option value="203">Czech Republic</option>\n<option value="208">Denmark</option>\n<option value="214">Dominican Republic</option>\n<option value="218">Ecuador</option>\n<option value="818">Egypt</option>\n<option value="222">El Salvador</option>\n<option value="233">Estonia</option>\n<option value="246">Finland</option>\n<option value="250">France</option>\n<option value="268">Georgia</option>\n<option value="276">Germany</option>\n<option value="300">Greece</option>\n<option value="304">Greenland</option>\n<option value="308">Grenada</option>\n<option value="316">Guam</option>\n<option value="320">Guatemala</option>\n<option value="332">Haiti</option>\n<option value="340">Honduras</option>\n<option value="344">Hong Kong</option>\n<option value="348">Hungary</option>\n<option value="352">Iceland</option>\n<option value="356">India</option>\n<option value="360">Indonesia</option>\n<option value="372">Ireland</option>\n<option value="376">Israel</option>\n<option value="380">Italy</option>\n<option value="388">Jamaica</option>\n<option value="400">Jordan</option>\n<option value="398">Kazakhstan</option>\n<option value="404">Kenya</option>\n<option value="410">Korea Republic</option>\n<option value="414">Kuwait</option>\n<option value="428">Latvia</option>\n<option value="422">Lebanon</option>\n<option value="438">Liechtenstein</option>\n<option value="440">Lithuania</option>\n<option value="442">Luxembourg</option>\n<option value="446">Macau</option>\n<option value="807">Macedonia</option>\n<option value="458">Malaysia</option>\n<option value="470">Malta</option>\n<option value="484">Mexico</option>\n<option value="492">Monaco</option>\n<option value="499">Montenegro</option>\n<option value="504">Morocco</option>\n<option value="524">Nepal</option>\n<option value="528">Netherlands</option>\n<option value="530">Netherlands Antilles</option>\n<option value="554">New Zealand</option>\n<option value="578">Norway</option>\n<option value="512">Oman</option>\n<option value="586">Pakistan</option>\n<option value="591">Panama</option>\n<option value="598">Papua New Guinea</option>\n<option value="604">Peru</option>\n<option value="608">Philippines</option>\n<option value="616">Poland</option>\n<option value="620">Portugal</option>\n<option value="630">Puerto Rico</option>\n<option value="634">Qatar</option>\n<option value="688">Republic of Serbia</option>\n<option value="642">Romania</option>\n<option value="643">Russia</option>\n<option value="646">Rwanda</option>\n<option value="682">Saudi Arabia</option>\n<option value="702">Singapore</option>\n<option value="703">Slovakia</option>\n<option value="705">Slovenia</option>\n<option value="710">South Africa</option>\n<option value="724">Spain</option>\n<option value="144">Sri Lanka</option>\n<option value="752">Sweden</option>\n<option value="756">Switzerland</option>\n<option value="158">Taiwan</option>\n<option value="764">Thailand</option>\n<option value="780">Trinidad and Tobago</option>\n<option value="788">Tunisia</option>\n<option value="792">Turkey</option>\n<option value="800">Uganda</option>\n<option value="804">Ukraine</option>\n<option value="784">United Arab Emirates</option>\n<option value="826">United Kingdom</option>\n<option value="840">United States</option>\n<option value="858">Uruguay</option>\n<option value="860">Uzbekistan</option>\n<option value="862">Venezuela</option>\n<option value="704">Viet Nam</option>\n<option value="887">Yemen</option>\n<option value="716">Zimbabwe</option>\n'}),define("text!includes/global/timezoneOptions.html",[],function(){return'<option value="Pacific/Wake">(UTC-12:00) International Date Line West</option>\n<option value="Pacific/Midway" title="-11">(UTC-11:00) Midway Islands</option>\n<option value="Pacific/Honolulu" title="-10">(UTC-10:00) Hawaii</option>\n<option value="America/Anchorage" title="-9">(UTC-09:00) Alaska</option>\n<option value="America/Los_Angeles" title="-8">(UTC-08:00) Pacific Time (US &amp; Canada)</option>\n<option value="America/Phoenix">(UTC-07:00) Arizona</option>\n<option value="America/Chihuahua">(UTC-07:00) Chihuahua, La Paz, Mazatlan</option>\n<option value="America/Denver" title="-7">(UTC-07:00) Mountain Time (US &amp; Canada)</option>\n<option value="America/Tegucigalpa">(UTC-06:00) Central America</option>\n<option value="America/Chicago" title="-6">(UTC-06:00) Central Time (US &amp; Canada)</option>\n<option value="America/Mexico_City">(UTC-06:00) Guadalajara, Mexico City, Monterrey</option>\n<option value="Canada/Saskatchewan">(UTC-06:00) Saskatchewan</option>\n<option value="America/Bogota">(UTC-05:00) Bogota, Lima, Quito</option>\n<option value="America/New_York" title="-5">(UTC-05:00) Eastern Time (US &amp; Canada)</option>\n<option value="America/Indiana/Indianapolis">(UTC-05:00) Indiana (East)</option>\n<option value="America/Caracas">(UTC-04:30) Caracas</option>\n<option value="America/Asuncion">(UTC-04:00) Asuncion</option>\n<option value="America/Halifax" title="-4">(UTC-04:00) Atlantic Time (Canada)</option>\n<option value="America/Cuiaba">(UTC-04:00) Cuiaba</option>\n<option value="America/La_Paz">(UTC-04:00) Georgetown, La Paz, Manaus, San Juan</option>\n<option value="America/Santiago">(UTC-04:00) Santiago</option>\n<option value="Canada/Newfoundland">(UTC-03:30) Newfoundland</option>\n<option value="America/Sao_Paulo">(UTC-03:00) Brasilia, Sao Paulo</option>\n<option value="America/Buenos_Aires" title="-3">(UTC-03:00) Buenos Aires</option>\n<option value="America/Cayenne">(UTC-03:00) Cayenne, Fortaleza, Salvador</option>\n<option value="America/Godthab">(UTC-03:00) Greenland</option>\n<option value="America/Montevideo">(UTC-03:00) Montevideo</option>\n<option value="Atlantic/South_Georgia" title="-2">(UTC-02:00) Mid-Atlantic</option>\n<option value="Atlantic/Azores" title="-1">(UTC-01:00) Azores</option>\n<option value="Atlantic/Cape_Verde">(UTC-01:00) Cape Verde Is.</option>\n<option value="Africa/Casablanca">(UTC) Casablanca</option>\n<option value="UTC" title="0">(UTC) Coordinated Universal Time</option>\n<option value="Europe/London">(UTC) Dublin, Edinburgh, Lisbon, London</option>\n<option value="Atlantic/Reykjavik">(UTC) Monrovia, Reykjavik</option>\n<option value="Europe/Amsterdam">(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna</option>\n<option value="Europe/Belgrade">(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague</option>\n<option value="Europe/Brussels" title="1">(UTC+01:00) Brussels, Copenhagen, Madrid, Paris</option>\n<option value="Europe/Sarajevo">(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb</option>\n<option value="Africa/Algiers">(UTC+01:00) West Central Africa</option>\n<option value="Europe/Athens" title="2">(UTC+02:00) Athens, Bucharest</option>\n<option value="Asia/Beirut">(UTC+02:00) Beirut</option>\n<option value="Africa/Cairo">(UTC+02:00) Cairo</option>\n<option value="Asia/Damascus">(UTC+02:00) Damascus</option>\n<option value="Africa/Harare">(UTC+02:00) Harare, Pretoria</option>\n<option value="Europe/Vilnius">(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius</option>\n<option value="Asia/Istanbul">(UTC+02:00) Istanbul</option>\n<option value="Asia/Jerusalem">(UTC+02:00) Jerusalem </option>\n<option value="Asia/Amman">(UTC+03:00) Amman</option>\n<option value="Asia/Baghdad">(UTC+03:00) Baghdad</option>\n<option value="Europe/Minsk">(UTC+03:00) Kaliningrad, Minsk</option>\n<option value="Asia/Kuwait">(UTC+03:00) Kuwait, Riyadh</option>\n<option value="Africa/Nairobi">(UTC+03:00) Nairobi</option>\n<option value="Asia/Tehran">(UTC+03:30) Tehran</option>\n<option value="Asia/Muscat">(UTC+04:00) Abu Dhabi, Muscat</option>\n<option value="Asia/Baku">(UTC+04:00) Baku</option>\n<option value="Europe/Moscow" title="3">(UTC+04:00) Moscow, St. Petersburg, Volgograd</option>\n<option value="Asia/Tbilisi" title="4">(UTC+04:00) Tbilisi</option>\n<option value="Asia/Yerevan">(UTC+04:00) Yerevan</option>\n<option value="Asia/Kabul">(UTC+04:30) Kabul</option>\n<option value="Asia/Karachi" title="5">(UTC+05:00) Islamabad, Karachi</option>\n<option value="Asia/Tashkent">(UTC+05:00) Tashkent</option>\n<option value="Asia/Kolkata">(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi</option>\n<option value="Asia/Colombo">(UTC+05:30) Sri Jayawardenepura</option>\n<option value="Asia/Katmandu">(UTC+05:45) Kathmandu</option>\n<option value="Asia/Dhaka">(UTC+06:00) Astana, Dhaka</option>\n<option value="Asia/Yekaterinburg" title="6">(UTC+06:00) Ekaterinburg</option>\n<option value="Asia/Rangoon">(UTC+06:30) Yangon (Rangoon)</option>\n<option value="Asia/Bangkok" title="7">(UTC+07:00) Bangkok, Hanoi, Jakarta</option>\n<option value="Asia/Novosibirsk">(UTC+07:00) Novosibirsk</option>\n<option value="Asia/Hong_Kong">(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi</option>\n<option value="Asia/Krasnoyarsk">(UTC+08:00) Krasnoyarsk</option>\n<option value="Asia/Kuala_Lumpur">(UTC+08:00) Kuala Lumpur, Singapore</option>\n<option value="Australia/Perth">(UTC+08:00) Perth</option>\n<option value="Asia/Taipei" title="8">(UTC+08:00) Taipei</option>\n<option value="Asia/Ulaanbaatar">(UTC+08:00) Ulaanbaatar</option>\n<option value="Asia/Irkutsk">(UTC+09:00) Irkutsk</option>\n<option value="Asia/Tokyo" title="9">(UTC+09:00) Osaka, Sapporo, Tokyo</option>\n<option value="Asia/Seoul">(UTC+09:00) Seoul</option>\n<option value="Australia/Adelaide">(UTC+09:30) Adelaide</option>\n<option value="Australia/Darwin">(UTC+09:30) Darwin</option>\n<option value="Australia/Brisbane">(UTC+10:00) Brisbane</option>\n<option value="Australia/Canberra" title="10">(UTC+10:00) Canberra, Melbourne, Sydney</option>\n<option value="Pacific/Guam">(UTC+10:00) Guam, Port Moresby</option>\n<option value="Australia/Hobart">(UTC+10:00) Hobart</option>\n<option value="Asia/Yakutsk">(UTC+10:00) Yakutsk</option>\n<option value="Pacific/Noumea" title="11">(UTC+11:00) Solomon Is., New Caledonia</option>\n<option value="Asia/Vladivostok">(UTC+11:00) Vladivostok</option>\n<option value="Pacific/Auckland" title="12">(UTC+12:00) Auckland, Wellington</option>\n<option value="Pacific/Fiji">(UTC+12:00) Fiji</option>\n<option value="Asia/Magadan">(UTC+12:00) Magadan</option>\n<option value="Asia/Kamchatka">(UTC+12:00) Kamchatka</option>\n<option value="Pacific/Tongatapu" title="13">(UTC+13:00) Nuku\'alofa</option>\n'
}),define("unifi/view/settings/SiteView",["unifi/view/app/ContentView","unifi/view/app/ValidatorMixin","underscore","jquery","msg/Msg","unifi/collection/Settings","unifi/collection/Sites","ubnt/view/dialogs/ConfirmDialogView","ubnt/view/dialogs/ErrorDialogView","unifi/view/settings/ChromeView","text!includes/settings/settingsSiteTemplate.html","text!includes/global/countryOptions.html","text!includes/global/timezoneOptions.html","ubnt/ubnt.password","ubnt/ubnt.buttonalert"],function(e,t,i,n,s,o,a,r,l,u,c,d,h){"use strict";return e.extend(i.extend({},t,{id:"settingsSite",_prevalidate:{"site-name":{input:"text",complex:!1,model:"tbd",subsection:"site",map:"desc"},uplink_host:{input:"text",complex:!0,model:"tbd",subsection:"connectivity"},x_ssh_username:{input:"text",complex:!0,model:"tbd",subsection:"mgmt"},x_ssh_password:{input:"password",complex:!0,model:"tbd",subsection:"mgmt"},systemName:{input:"text",complex:!0,model:"tbd",subsection:"super_identity"},"enable-snmp":{input:"text",onchange:"snmp_community",complex:!0,model:"tbd",subsection:"snmp"},snmp_community:{input:"text",complex:!0,model:"tbd",subsection:"snmp"},"enable-remote-logging":{input:"text",onchange:"ip",complex:!0,model:"tbd",subsection:"rsyslogd"},ip:{input:"text",complex:!0,onchange:"port",model:"tbd",subsection:"rsyslogd"},port:{input:"text",complex:!0,model:"tbd",subsection:"rsyslogd"},debug:{input:"text",complex:!0,model:"tbd",subsection:"rsyslogd"}},initialize:function(t){e.prototype.initialize.call(this,t),n.when(this._rendered=n.Deferred(),this._loaded=n.Deferred()).then(this.populate),this.models={},this.collection=this.app.collection("Settings",{fetch:{reload:!1,deferred:this._loaded}},o),this.models.site=this.app.collection("Sites",{},a).get(SITE.id),this.on("save-success",function(e){this.collection.add(e,{merge:!0}),this._deferred[e.get("key")].resolve()},this),this.on("save-error",function(e,t){this._deferred[e.get("key")].reject(e,t)},this),this.render()},render:function(){if(e.prototype.render.call(this),!this.rendered&&(this.rendered=!0)){this.$el.html(i.template(c,{countryOptionsTemplate:i.template(d),timezoneOptionsTemplate:i.template(h),msg:s})),this.$el.find(".buttonset").buttonset(),this.$el.find("input[type=password]").password({suffix:"-text"});var t=this;this.$el.find("select").each(function(){var e=n(this),t=e.parent();e.selectmenu({parent:t,appendTo:t,label:e.data("label"),icons:{button:"ubnt-icon-arrow-down secondary-color"},position:{at:"left bottom"}})}),this.$el.find(".buttonset input[name=uplink-type]").on("change",function(e){"custom"==n(e.target).val()?(n("#configureUplinkCustomHost").show(),n("#connectivityUplink").find(".error-msg").show()):(n("#configureUplinkCustomHost").hide(),n("#connectivityUplink").find(".error-msg").hide())}).filter(":checked").trigger("change"),this.$el.find("#configureConnectivityMonitor").on("change",function(){n(this).is(":checked")?n("#connectivityUplink").show():n("#connectivityUplink").hide()}).trigger("change"),this.$el.find("#configureSnmp").on("change",function(){var e=n(this);e.is(":checked")?e.parent().find("input").not(e).prop("disabled",!1):e.parent().find("input").not(e).prop("disabled",!0)}).trigger("change"),this.$el.find("#configureRemoteLogging").on("change",function(){var e=n(this);e.is(":checked")?(e.parent().find("input").not(e).prop("disabled",!1),t.$el.find(".rsyslog-toggled").show()):(e.parent().find("input").not(e).prop("disabled",!0),t.$el.find(".rsyslog-toggled").hide())}).trigger("change"),this.$el.find("#runIsolatedApScan").on("click",function(e){e.preventDefault();var s=n(this),o=t.app.collection("Devices");s.prop("disabled",!0),o.scanUplink(),i.delay(function(){s.prop("disabled",!1)},15e3)});var o=this.models.site;o.get("attr_no_delete")?this.$el.find("button.delete").remove():this.$el.find("button.delete").on("click",function(e){e.preventDefault();var i=new r;i.show(s.N_ConfirmSiteDelete,function(){o.destroy({wait:!0,success:function(){window.location.href="/logout"},error:function(e,i){t.app.views.app.flash("error","Error",s.apiError(i))}})})}),this.$el.find("fieldset.actions button.cancel").on("click",function(e){e.preventDefault(),t.clear(),t.populate()}),this.$el.find("form").on("submit",function(e){e.preventDefault(),t.save()}),this.$submit=this.$el.find("button.save"),this.$submit.buttonalert(),this.app.isReadOnly||this.prevalidator(),this._rendered.resolve()}else this.populate()},populate:function(){i.each(["country","connectivity","locale","mgmt","snmp","rsyslogd"],function(e){this.models[e]=this.collection.getSettingFromKey(e,SITE.id)||new this.collection.model({key:e,site_id:SITE.id})},this),this.models.site.set({key:"site"}),i.each(this._prevalidate,function(e,t){this._prevalidate[t].model=this.models[e.subsection]},this),this.$el.find("form")[0].reset(),this.models.site&&this.$el.find("input[name=site-name]").val(this.models.site.get("desc")||this.models.site.get("name")),this.models.country?this.$el.find("select[name=country]").val(this.models.country.get("code")||840).trigger("change"):this.$el.find("select[name=country]").val(840).trigger("change"),this.models.locale?this.$el.find("select[name=timezone]").val(this.models.locale.get("timezone")||"America/Los_Angeles").trigger("change"):this.$el.find("select[name=timezone]").val("America/Los_Angeles").trigger("change"),this.models.connectivity?(this.$el.find("input[name=enable-connectivity-monitor]").attr("checked",this.models.connectivity.get("enabled")).trigger("change"),this.$el.find("input[name=uplink-type][value="+this.models.connectivity.get("uplink_type")+"]").attr("checked",!0).trigger("change"),this.$el.find("input[name=uplink_host]").val(this.models.connectivity.get("uplink_host"))):(this.$el.find("input[name=enable-connectivity-monitor]").trigger("change"),this.$el.find("input[name=uplink-type]").trigger("change")),this.models.mgmt&&(this.$el.find("input[name=enable-led]").attr("checked",this.models.mgmt.get("led_enabled")),this.$el.find("input[name=enable-alert]").attr("checked",this.models.mgmt.get("alert_enabled")),this.$el.find("input[name=enable-auto-upgrade-ap]").attr("checked",this.models.mgmt.get("auto_upgrade")),this.$el.find("input[name=enable-auto-upgrade-phone]").attr("checked",this.models.mgmt.get("auto_upgrade_phone")),this.$el.find("input[name=x_ssh_username]").val(this.models.mgmt.get("x_ssh_username")),this.$el.find("input[name=x_ssh_password]").val(this.models.mgmt.get("x_ssh_password"))),this.models.snmp?(this.$el.find("input[name=snmp_community]").val(this.models.snmp.get("community")),this.$el.find("input[name=enable-snmp]").attr("checked",this.models.snmp.get("enabled")).trigger("change")):this.$el.find("input[name=enable-snmp]").trigger("change"),this.models.rsyslogd?(this.$el.find("input[name=ip]").val(this.models.rsyslogd.get("ip")),this.$el.find("input[name=port]").val(this.models.rsyslogd.get("port")||514),this.$el.find("input[name=debug]").attr("checked",this.models.rsyslogd.get("debug")).trigger("change"),this.$el.find("input[name=enable-remote-logging]").attr("checked",this.models.rsyslogd.get("enabled")).trigger("change")):(this.$el.find("input[name=port]").val(514),this.$el.find("input[name=debug]").val(0),this.$el.find("input[name=enable-remote-logging]").trigger("change"))},gather:function(e){var t={};return e&&"site"!=e||(t.site={name:this.models.site?this.models.site.get("name"):this.$el.find("input[name=site-name]").val().replace(/^[a-zA-Z0-9]+$/,""),desc:this.$el.find("input[name=site-name]").val()}),e&&"country"!=e||(t.country={code:this.$el.find("select[name=country] option:selected").val()}),e&&"locale"!=e||(t.locale={timezone:this.$el.find("select[name=timezone] option:selected").val()}),e&&"connectivity"!=e||(t.connectivity={enabled:this.$el.find("input[name=enable-connectivity-monitor]").is(":checked"),uplink_type:this.$el.find("input[name=uplink-type]:checked").val(),uplink_host:this.$el.find("input[name=uplink_host]").val()}),e&&"mgmt"!=e||(t.mgmt={led_enabled:this.$el.find("input[name=enable-led]").is(":checked"),alert_enabled:this.$el.find("input[name=enable-alert]").is(":checked"),auto_upgrade:this.$el.find("input[name=enable-auto-upgrade-ap]").is(":checked"),auto_upgrade_phone:this.$el.find("input[name=enable-auto-upgrade-phone]").is(":checked"),x_ssh_username:this.$el.find("input[name=x_ssh_username]").val(),x_ssh_password:this.$el.find("input[name=x_ssh_password]").val()}),e&&"snmp"!=e||(t.snmp={enabled:this.$el.find("input[name=enable-snmp]").is(":checked")},t.snmp.enabled&&(t.snmp.community=this.$el.find("input[name=snmp_community]").val())),e&&"rsyslogd"!=e||(t.rsyslogd={enabled:this.$el.find("input[name=enable-remote-logging]").is(":checked")},t.rsyslogd.enabled&&(t.rsyslogd.ip=this.$el.find("input[name=ip]").val(),t.rsyslogd.port=this.$el.find("input[name=port]").val(),t.rsyslogd.debug=this.$el.find("input[name=debug]").is(":checked"))),e&&(t[e].key=e),e?t[e]:t},save:function(e){e&&e.preventDefault(),this.clear();var t=[];if(i.each(this.models,function(e,n){var s=e.validate(this.gather(n));i.size(s)&&(this.invalid(s,n),t.push(n))},this),i.size(t))this.$submit.trigger("invalid");else{this.$submit.trigger("saving"),this._deferred={};var s=[];i.each(this.models,function(e,t){s.push(this._deferred[t]=n.Deferred())},this),n.when.apply(n,s).then(n.proxy(this.success,this),n.proxy(this.error,this)),i.each(this.models,function(e,t){this._save(e,t)},this)}},success:function(){this.$submit.trigger("success")},error:function(e,t){this.$el.find("fieldset.actions").prepend(n('<div class="error-msg">'+s.E_DataSave+": "+s.apiError(t)+"</div>")),this.$submit.trigger("error")},remove:function(){this.off("save-success"),this.off("save-error"),this.$el.find(".buttonset input[name=uplink-type]").off(),this.$el.find("#configureConnectivityMonitor").off(),this.$el.find("#configureSnmp, #configureRemoteLogging").off(),this.$el.find("#runIsolatedApScan").off(),this.$el.find("button.delete").off(),this.$el.find("fieldset.actions button.cancel").off(),this.$el.find("form").off(),this.$el.find(".buttonset input[name=uplink-type]").off("change"),this.devalidate(),this.rendered=!1,e.prototype.remove.apply(this,arguments)}}))}),define("text!includes/settings/settingsGuestControlTemplate.html",[],function(){return'<div class="section section-main">\n    <h1><%- msg.G_SettingsGuestCtrl %></h1>\n\n    <form class="complex-form">\n        <h2><%- msg.G_SettingsGuestPolicies %></h2>\n\n        <fieldset class="basic">\n            <div class="fields">\n                <div>\n                    <label for="guestControlEnable"><%- msg.G_SettingsEnblGuestPortal %></label>\n                    <input type="checkbox" id="guestControlEnable" name="enable" value="1" />\n                </div>\n            </div>\n            <div class="fields enabled">\n                <div>\n                    <label><%- msg.G_Auth %></label>\n                    <div class="buttonset">\n                        <input type="radio" id="guestControlAuthNone" name="authentication" value="none" checked="checked" /><label for="guestControlAuthNone"><%- msg.G_SettingsNoAuth %></label>\n                        <input type="radio" id="guestControlAuthPassword" name="authentication" value="password" /><label for="guestControlAuthPassword"><%- msg.G_SettingsSimplePW %></label>\n                        <input type="radio" id="guestControlAuthHotspot" name="authentication" value="hotspot" /><label for="guestControlAuthHotspot"><%- msg.G_SettingsHotspot %></label>\n                        <input type="radio" id="guestControlAuthCustom" name="authentication" value="custom" /><label for="guestControlAuthCustom"><%- msg.G_SettingsExtPortalServer %></label>\n                    </div>\n                </div>\n                <div class="auth-toggled auth-password">\n                    <label for="guestControlGuestPassword"><%- msg.G_SettingsGuestPW %></label>\n                    <input type="password" id="guestControlGuestPassword" name="x_password" value="" />\n                </div>\n                <div class="secondary inline-form auth-toggled auth-none auth-password">\n                    <label><%- msg.G_Expiration %></label>\n                    <div>\n                        <span>\n                            <select name="expire" data-adjust-width="10">\n                                <option value="480">8 <%- msg.G_Hours %></option>\n                                <option value="1440">24 <%- msg.G_Hours %></option>\n                                <option value="2880">2 <%- msg.G_Days %></option>\n                                <option value="4320">3 <%- msg.G_Days %></option>\n                                <option value="5760">4 <%- msg.G_Days %></option>\n                                <option value="10080">7 <%- msg.G_Days %></option>\n                                <option value="custom"><%- msg.G_SettingsUserDefined %></option>\n                            </select>\n                        </span>\n\n                        <span class="custom-expire">\n                            <input type="text" name="custom-expire-amount" value="8" size="4" />\n\n                            <span>\n                                <select name="custom-expire-unit" data-adjust-width="10">\n                                    <option value="1"><%- msg.G_Minutes %></option>\n                                    <option value="60" selected="selected"><%- msg.G_Hours %></option>\n                                    <option value="1440"><%- msg.G_Days %></option>\n                                </select>\n                            </span>\n                        </span>\n                    </div>\n                </div>\n                <div class="secondary inline-form auth-toggled auth-none auth-password auth-hotspot">\n                    <label><%- msg.G_SettingsLandingPage %></label>\n                    <div>\n                        <div class="buttonset">\n                            <input type="radio" id="guestControlLandingPageOriginal" name="redirect_enabled" value="original" checked="checked" />\n                            <label for="guestControlLandingPageOriginal"><%- msg.G_SettingsRedirectOriginalURL %></label>\n                            <input type="radio" id="guestControlLandingPagePromo" name="redirect_enabled" value="promotional" />\n                            <label for="guestControlLandingPagePromo"><%- msg.G_SettingsPromoURL %></label>\n                        </div>\n                        <input type="text" id="guestControlLandingPagePromoUrl" name="redirect_url" value="" placeholder="<%- msg.G_UrlPlaceholder %>" />\n                    </div>\n                </div>\n                <div class="auth-toggled auth-custom">\n                    <label for="guestControlCustomPortalIp"><%- msg.G_SettingsCustomPortal %></label>\n                    <span><%- msg.G_IPAddress %></span>\n                    <input type="text" id="guestControlCustomPortalIp" name="custom_ip" value="" />\n                </div>\n                <div class="auth-toggled auth-none auth-password auth-hotspot">\n                    <label for="guestControlPortalCustomization"><%- msg.G_SettingsPortalCustomization %></label>\n                    <input type="checkbox" id="guestControlPortalCustomization" name="enable-custom-portal" value="1" />\n                    <span><%- msg.G_SettingsEnblPortalCustomization %></span>\n                </div>\n                <div>\n                    <label for="guestControlPortalUrlHostname"><%- msg.G_SettingsPortalURLHostname %></label>\n                    <input type="checkbox" id="guestControlPortalUrlHostname" name="portal_use_hostname" value="1" />\n                    <span><%- msg.G_SettingsRediectHostname %></span>\n                    <input type="text" name="portal_hostname" value="" placeholder="<%- msg.G_Hostname %>" />\n                </div>\n            </div>\n        </fieldset>\n\n        <h2 class="auth-toggled auth-hotspot"><%- msg.G_SettingsHotspot %></h2>\n\n        <fieldset class="hotspot auth-toggled auth-hotspot">\n            <div class="fields">\n                <div>\n                    <label for="guestControlHotspotEnableVouchers"><%- msg.G_SettingsVoucher %></label>\n                    <input type="checkbox" id="guestControlHotspotEnableVouchers" name="enable-vouchers" value="1" />\n                    <span><%- msg.G_SettingsEnblVoucherAuth %></span>\n                </div>\n                <div>\n                    <label for="guestControlHotspotEnablePayments"><%- msg.G_SettingsPayment %></label>\n                    <input type="checkbox" id="guestControlHotspotEnablePayments" name="enable-payments" value="1" />\n                    <span><%- msg.G_SettingsEnblPaymentAuth %></span>\n                </div>\n                <div class="secondary payment-toggled">\n                    <label for="guestControlHotspotGateway"><%- msg.G_SettingsGateway %></label>\n                    <div>\n                        <select id="guestControlHotspotGateway" name="gateway" data-adjust-width="20">\n            				<option value="paypal"><%- msg.G_SettingsPaypalWebPaymentPro %></option>\n            				<option value="stripe"><%- msg.G_SettingsStripe %></option>\n            				<option value="quickpay"><%- msg.G_SettingsQuickPay %></option>\n            				<option value="authorize"><%- msg.G_SettingsAuthorizenet %></option>\n            				<option value="merchantwarrior"><%- msg.G_SettingsMerchantWarrior %></option>\n                            <option value="ippay"><%- msg.G_SettingsIPpay %></option>\n            			</select>\n                    </div>\n                </div>\n                <div class="secondary payment-toggled gateway-toggled paypal">\n                    <label><%- msg.G_SettingsPayPal %></label>\n                    <div>\n                        <div class="spaced bottom">\n                            <label for="guestControlPayPalUsername"><%- msg.G_UN %></label>\n                            <input type="text" id="guestControlPayPalUsername" name="x_paypal_username" value="" />\n                        </div>\n                        <div class="spaced bottom">\n                            <label for="guestControlPayPalPassword"><%- msg.G_PW %></label>\n                            <input type="text" id="guestControlPayPalPassword" name="x_paypal_password" value="" />\n                        </div>\n                        <div class="spaced bottom">\n                            <label for="guestControlPayPalSignature"><%- msg.G_Signature %></label>\n                            <input type="text" id="guestControlPayPalSignature" name="x_paypal_signature" value="" />\n                        </div>\n                        <label>\n                            <input type="checkbox" name="paypal-sandbox" value="1" />\n                            <span><%- msg.G_SettingsUsePayPalSandbox %> (\n                                <a href="https://developer.paypal.com/" target="_blank">\n                                    <%- msg.G_SettingsApplySandboxAccount %></a>)\n                            </span>\n                        </label>\n                    </div>\n                </div>\n                <div class="secondary payment-toggled gateway-toggled stripe">\n                    <label><%- msg.G_SettingsStripe %></label>\n                    <div>\n                        <div>\n                            <label for="guestControlStripeApiKey"><%- msg.G_SettingsAPIKey %></label>\n                            <input type="text" id="guestControlStripeApiKey" name="x_stripe_api_key" value="" />\n                        </div>\n                    </div>\n                </div>\n                <div class="secondary payment-toggled gateway-toggled quickpay">\n                    <label><%- msg.G_SettingsQuickPay %></label>\n                    <div>\n                        <div class="spaced bottom">\n                            <label for="guestControlQuickpayMerchantId"><%- msg.G_SettingsMerchantId %></label>\n                            <input type="text" id="guestControlQuickpayMerchantId" name="x_quickpay_merchantid" value="" />\n                        </div>\n                        <div>\n                            <label for="guestControlQuickpayMd5Secret"><%- msg.G_SetttingsMD5Secret %></label>\n                            <input type="text" id="guestControlQuickpayMd5Secret" name="x_quickpay_md5secret" value="" />\n                        </div>\n                    </div>\n                </div>\n                <div class="secondary payment-toggled gateway-toggled authorize">\n                    <label><%- msg.G_SettingsAuthorizenet %></label>\n                    <div>\n                        <div class="spaced bottom">\n                            <label for="guestControlAuthorizeLoginId"><%- msg.G_SettingsAPILoginId %></label>\n                            <input type="text" id="guestControlAuthorizeLoginId" name="x_authorize_loginid" value="" />\n                        </div>\n                        <div class="spaced bottom">\n                            <label for="guestControlAuthorizeTransationKey"><%- msg.G_SettingsTransactionKey %></label>\n                            <input type="text" id="guestControlAuthorizeTransationKey" name="x_authorize_transactionkey" value="" />\n                        </div>\n                        <label>\n                            <input type="checkbox" name="authorize_use_sandbox" value="1" />\n                            <span><%- msg.G_SettingsUseTestAccount %> (<a href="http://developer.authorize.net/testaccount/" target="_blank"><%- msg.G_SettingsApplyTestAccount %></a>)</span>\n                        </label>\n                    </div>\n                </div>\n                <div class="secondary payment-toggled gateway-toggled merchantwarrior">\n                    <label><%- msg.G_SettingsMerchantWarrior %></label>\n                    <div>\n                        <div class="spaced bottom">\n                            <label for="guestControlMerchantWarriorUuid"><%- msg.G_SettingsMerchantUuid %></label>\n                            <input type="text" id="guestControlMerchantWarriorUuid" name="x_merchantwarrior_merchantuuid" value="" />\n                        </div>\n                        <div class="spaced bottom">\n                            <label for="guestControlMerchantWarriorApiKey"><%- msg.G_SettingsAPIKey %></label>\n                            <input type="text" id="guestControlMerchantWarriorApiKey" name="x_merchantwarrior_apikey" value="" />\n                        </div>\n                        <div class="spaced bottom">\n                            <label for="guestControlMerchantWarriorApiPassphrase"><%- msg.G_SettingsAPIPassphrase %></label>\n                            <input type="text" id="guestControlMerchantWarriorApiPassphrase" name="x_merchantwarrior_apipassphrase" value="" />\n                        </div>\n                        <label>\n                            <input type="checkbox" name="merchantwarrior_use_sandbox" value="1" />\n                            <span><%- msg.G_SettingsUseTestAccount %> (<a href="https://www.merchantwarrior.com/join" target="_blank"><%- msg.G_SettingsApplyTestAccount %></a>)</span>\n                        </label>\n                    </div>\n                </div>\n                <div class="secondary payment-toggled gateway-toggled ippay">\n                    <label><%- msg.G_SettingsIPpay %></label>\n                    <div>\n                        <div class="spaced bottom">\n                            <label for="guestControlIPpayTerminalId"><%- msg.G_SettingsTerminalId %></label>\n                            <input type="text" id="guestControlIPpayTerminalId" name="x_ippay_terminalid" value="" />\n                        </div>\n                        <label>\n                            <input type="checkbox" name="ippay_use_sandbox" value="1" />\n                            <span><%- msg.G_SettingsUseTestAccount %> (<a href="http://www.converge-tech.com/IPPay-s/1821.htm" target="_blank"><%- msg.G_SettingsApplyTestAccount %></a>)</span>\n                        </label>\n                    </div>\n                </div>\n                <div class="spaced top">\n                    <label><%- msg.G_SettingsHopspotOp %></label><a class="btn-hotspot" href="/hotspot" target="_blank"><%- msg.G_SettingsGoToHotpotMgr %></a>\n                </div>\n            </div>\n        </fieldset>\n\n        <h2><%- msg.G_SettingsAccessCntrl %></h2>\n\n        <fieldset class="subnets">\n            <div class="fields clearfix">\n                <div class="left">\n                    <label><%- msg.G_SettingsRestrictedSubnets %></label>\n                    <div class="addable restricted">\n                        <div>\n                            <input type="text" name="restricted" value="" />\n                            <button class="button icon-only is-admin"><span class="ubnt-icon-close"></span></button>\n                        </div>\n                    </div>\n                </div>\n\n                <div class="left">\n                    <label><%- msg.G_SettingsAllowedSubnets %></label>\n                    <div class="addable allowed">\n                        <div>\n                            <input type="text" name="allowed" value="" />\n                            <button class="button icon-only is-admin"><span class="ubnt-icon-close"></span></button>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </fieldset>\n\n        <fieldset class="actions">\n            <button type="submit" class="button tall auto green save is-admin"><span class="ui-button-icon ubnt-icon-check"></span><%- msg.G_Apply %></button>\n        </fieldset>\n    </form>\n</div>\n'}),define("ubnt/ubnt.radiotoggle",["jquery","jquery-ui"],function(e){"use strict";e.widget("ubnt.radiotoggle",{options:{prefix:null,container:null},_create:function(){this._on(this.element,{change:this.toggle}),this.element.filter(":checked").trigger("change")},toggle:function(t){var i=this.options.prefix||this.element.attr("name"),n=this.options.container||e("body");n.find("."+i+"-toggled").hide().filter("."+i+"-"+e(t.target).val()).show()},_destroy:function(){this._off(this.element,"change")}})}),define("ubnt/ubnt.addable",["jquery","jquery-ui"],function(e){"use strict";e.widget("ubnt.addable",{options:{max:null,min:1,template:null,add:null,added:null},_create:function(){var e=this;this.constrain=!0,this.options.add&&this.element.append(this.options.add.on("click",function(t){t.preventDefault(),e.add()}))},_constrain:function(){var e=this.count();if(this.options.min>e)for(var t=e;t<this.options.min;t++)this.add(!0);e>=this.options.max?this.options.add.hide():this.options.add.show()},reset:function(t){this.element.find(".ui-addable-added").each(e.proxy(function(i,n){this.remove(e(n),t)},this)),t||this._constrain()},count:function(){return this.element.find(".ui-addable-added").length},add:function(e,t){this.$inserted=this.template().addClass("ui-addable-added"),this.options.add?this.options.add.before(this.$inserted):this.element.append(this.$inserted),this.options.added&&this.options.added.call(this,this.$inserted,t),e||this._constrain()},remove:function(e,t){e.parents(".ui-addable-added").andSelf().remove(),t||this._constrain(),this.options.removed&&this.options.removed.call(this,e)},last:function(){return this.$inserted},template:function(){return this.options.template.clone()}})}),define("unifi/view/settings/GuestControlView",["unifi/view/app/ContentView","unifi/view/app/ValidatorMixin","underscore","jquery","msg/Msg","text!includes/settings/settingsGuestControlTemplate.html","ubnt/ubnt.radiotoggle","ubnt/ubnt.addable"],function(e,t,i,n,s,o){"use strict";return e.extend(i.extend({},t,{id:"settingsGuestControl",_prevalidate:{expire:{input:"text",complex:!0},x_password:{input:"password",complex:!0},custom_ip:{input:"text",complex:!0},redirect_url:{input:"text",complex:!0},portal_hostname:{input:"text",complex:!0},authorization:{input:"custom",complex:!0},x_paypal_username:{input:"text",complex:!0},x_paypal_password:{input:"text",complex:!0},x_paypal_signature:{input:"text",complex:!0},paypal_use_sandbox:{input:"text",complex:!0},x_stripe_api_key:{input:"text",complex:!0},x_quickpay_merchantid:{input:"text",complex:!0},x_quickpay_md5secret:{input:"text",complex:!0},x_authorize_loginid:{input:"text",complex:!0},x_authorize_transactionkey:{input:"text",complex:!0},x_merchantwarrior_merchantuuid:{input:"text",complex:!0},x_merchantwarrior_apikey:{input:"text",complex:!0},x_merchantwarrior_apipassphrase:{input:"text",complex:!0},x_ippay_terminalid:{input:"text",complex:!0},subnets:{input:"custom",complex:!0},portal_use_hostname:{onchange:"portal_hostname"}},initialize:function(t){e.prototype.initialize.call(this,t),n.when(this._rendered=n.Deferred(),this._loaded=n.Deferred()).then(this.populate),this.collection=this.app.collection("Settings",{fetch:{reload:!1,deferred:this._loaded}}),this.on("save-success",function(e,t,i){this.collection.add(e,{merge:!0}),this.success.call(this,e,t,i)},this),this.on("save-error",function(e,t){this.error.call(this,e,t)},this),this.render()},render:function(){if(e.prototype.render.call(this),!this.rendered&&(this.rendered=!0)){this.$el.html(i.template(o,{msg:s})),this.$el.find(".buttonset").buttonset(),this.$el.find("input[type=password]").password({suffix:"-text"});var t=this;this.$el.find("select").each(function(){var e=n(this),t=e.parent();e.selectmenu({parent:t,appendTo:t,label:e.data("label"),widthAdjust:parseInt(e.data("adjust-width"),10)||0,icons:{button:"ubnt-icon-arrow-down secondary-color"},position:{at:"left bottom"},change:function(){e.trigger("change")}})}),this.$el.find("input[name=enable]").on("change",function(){n(this).is(":checked")?(t.$el.find("div.enabled").show(),t.$el.find("#guestControlAuthHotspot").is(":checked")&&t.$el.find(".auth-toggled.auth-hotspot").show(),t.$el.find(".buttonset input[name=authentication]").filter(":checked").trigger("change")):(t.$el.find("div.enabled").hide(),t.$el.find(".auth-toggled.auth-hotspot").hide())}).trigger("change"),this.$el.find("select[name=expire]").on("change",function(){"custom"==n(this).find("option:selected").val()?t.$el.find(".custom-expire").show():t.$el.find(".custom-expire").hide()}).trigger("change"),this.$el.find(".buttonset input[name=authentication]").radiotoggle({container:this.$el,prefix:"auth"}),this.$el.find(".buttonset input[name=redirect_enabled]").on("change",function(e){"promotional"==n(e.target).val()?n("#guestControlLandingPagePromoUrl").show():n("#guestControlLandingPagePromoUrl").hide()}).filter(":checked").trigger("change"),this.$el.find("#guestControlPortalUrlHostname").on("change",function(){var e=n(this);e.is(":checked")?e.parent().find("input").not(e).prop("disabled",!1):e.parent().find("input").not(e).prop("disabled",!0)}).trigger("change"),this.$el.find("#guestControlHotspotEnablePayments").on("change",function(){n(this).is(":checked")?t.$el.find(".payment-toggled").removeClass("hide-payment-toggled"):t.$el.find(".payment-toggled").addClass("hide-payment-toggled")}).trigger("change"),this.$el.find("#guestControlHotspotGateway").on("change",function(){var e=n(this).val();t.$el.find(".gateway-toggled").addClass("hide-gateway-toggled").filter("."+e).removeClass("hide-gateway-toggled")}).trigger("change"),this.$el.find("div.addable").each(function(){var e=n(this);e.addable({min:1,max:1e3,template:e.find("> div").clone(),add:n('<button class="button addable">'+s.G_AddNew+"</button>"),added:function(t){!this.options.min||this.count()>this.options.min?t.find("button").on("click",function(t){return t.preventDefault(),e.addable("remove",n(this)),!1}):t.find("button").remove()}}),e.children(":not(button.addable)").remove(),e.addable("reset")
}),this.$el.find("form").on("submit",function(e){e.preventDefault(),t.save()}),this.$submit=this.$el.find("button.save"),this.$submit.buttonalert(),this.$(".btn-hotspot").on("click",function(){n(this).attr("href","/hotspot/s/"+SITE.name)}),this.app.isReadOnly||this.prevalidator(),this._rendered.resolve()}else this.populate()},populate:function(){this.model=this.collection.getSettingFromKey("guest_access",SITE.id),this.model?(this.$el.find("input[name=authentication][value="+this.model.get("auth")+"]").prop("checked",!0).trigger("change"),this.$el.find("input[name=x_password]").val(this.model.get("x_password")),this.model.get("expire")&&this.$el.find("select[name=expire]").val(this.model.get("expire")).trigger("change"),this.$el.find("input[name=custom-expire-amount]").val(this.model.get("expire_number")||8),this.$el.find("select[name=custom-expire-unit] option[value="+this.model.get("expire_unit")+"]").prop("selected",!0).trigger("change"),this.$el.find("input[name=redirect_enabled][value="+(this.model.get("redirect_enabled")?"promotional":"original")+"]").prop("checked",!0).trigger("change"),this.$el.find("input[name=redirect_url]").val(this.model.get("redirect_url")),this.$el.find("input[name=custom_ip]").val(this.model.get("custom_ip")),this.$el.find("input[name=enable-custom-portal]").prop("checked",this.model.get("portal_customized")),this.$el.find("input[name=portal_use_hostname]").prop("checked",this.model.get("portal_use_hostname")).trigger("change"),this.$el.find("input[name=portal_hostname]").val(this.model.get("portal_hostname")),this.$el.find("input[name=enable-vouchers]").prop("checked",this.model.get("voucher_enabled")),this.$el.find("input[name=enable-payments]").prop("checked",this.model.get("payment_enabled")).trigger("change"),this.$el.find("select[name=gateway]").val(this.model.get("gateway")||"paypal").trigger("change"),this.$el.find("input[name=x_paypal_username]").val(this.model.get("x_paypal_username")),this.$el.find("input[name=x_paypal_password]").val(this.model.get("x_paypal_password")),this.$el.find("input[name=x_paypal_signature]").val(this.model.get("x_paypal_signature")),this.$el.find("input[name=paypal-sandbox]").prop("checked",this.model.get("paypal_use_sandbox")).trigger("change"),this.$el.find("input[name=x_stripe_api_key]").val(this.model.get("x_stripe_api_key")),this.$el.find("input[name=x_quickpay_merchantid]").val(this.model.get("x_quickpay_merchantid")),this.$el.find("input[name=x_quickpay_md5secret]").val(this.model.get("x_quickpay_md5secret")),this.$el.find("input[name=x_authorize_loginid]").val(this.model.get("x_authorize_loginid")),this.$el.find("input[name=x_authorize_transactionkey]").val(this.model.get("x_authorize_transactionkey")),this.$el.find("input[name=authorize_use_sandbox]").prop("checked",this.model.get("authorize_use_sandbox")),this.$el.find("input[name=x_merchantwarrior_merchantuuid]").val(this.model.get("x_merchantwarrior_merchantuuid")),this.$el.find("input[name=x_merchantwarrior_apikey]").val(this.model.get("x_merchantwarrior_apikey")),this.$el.find("input[name=x_merchantwarrior_apipassphrase]").val(this.model.get("x_merchantwarrior_apipassphrase")),this.$el.find("input[name=merchantwarrior_use_sandbox]").prop("checked",this.model.get("merchantwarrior_use_sandbox")),this.$el.find("input[name=x_ippay_terminalid]").val(this.model.get("x_ippay_terminalid")),this.$el.find("input[name=ippay_use_sandbox]").val(this.model.get("ippay_use_sandbox")),this.$el.find("input[name=enable]").prop("checked",this.model.get("portal_enabled")).trigger("change"),i.each(["restricted","allowed"],function(e){var t=this.$el.find("div.addable."+e);t.addable("reset",!0);for(var i=1,n=null;1e3>i;i++)(n=this.model.get(e+"_subnet_"+i))&&t.addable("add").addable("last").find("input").val(n);0===parseInt(t.addable("count"),10)&&t.addable("add")},this)):(this.$el.find("form")[0].reset(),this.$el.find("input[name=authentication]").trigger("change"),this.$el.find("select[name=expire]").trigger("change"),this.$el.find("input[name=redirect_enabled]").trigger("change"),this.$el.find("input[name=portal_use_hostname]").trigger("change"),this.$el.find("input[name=enable-payments]").trigger("change"),this.$el.find("select[name=gateway]").trigger("change"),this.$el.find("input[name=paypal-sandbox]").trigger("change"),this.$el.find("input[name=enable]").trigger("change"),this.model=new this.collection.model({key:"guest_access",site_id:SITE.id}))},gather:function(){var e={portal_enabled:this.$el.find("input[name=enable]").is(":checked"),auth:this.$el.find("input[name=authentication]:checked").val(),x_password:this.$el.find("input[name=x_password]").val(),expire:this.$el.find("select[name=expire]").val(),redirect_enabled:"promotional"==this.$el.find("input[name=redirect_enabled]:checked").val(),redirect_url:this.$el.find("input[name=redirect_url]").val(),custom_ip:this.$el.find("input[name=custom_ip]").val(),portal_customized:this.$el.find("input[name=enable-custom-portal]").is(":checked"),portal_use_hostname:this.$el.find("input[name=portal_use_hostname]").is(":checked"),portal_hostname:this.$el.find("input[name=portal_hostname]").val(),voucher_enabled:this.$el.find("input[name=enable-vouchers]").is(":checked"),payment_enabled:this.$el.find("input[name=enable-payments]").is(":checked"),gateway:this.$el.find("select[name=gateway] option:selected").val()};return e=i.extend(e,{x_paypal_username:this.$el.find("input[name=x_paypal_username]").val(),x_paypal_password:this.$el.find("input[name=x_paypal_password]").val(),x_paypal_signature:this.$el.find("input[name=x_paypal_signature]").val(),paypal_use_sandbox:this.$el.find("input[name=paypal-sandbox]").is(":checked")}),e=i.extend(e,{x_stripe_api_key:this.$el.find("input[name=x_stripe_api_key]").val()}),e=i.extend(e,{x_quickpay_merchantid:this.$el.find("input[name=x_quickpay_merchantid]").val(),x_quickpay_md5secret:this.$el.find("input[name=x_quickpay_md5secret]").val()}),e=i.extend(e,{x_authorize_loginid:this.$el.find("input[name=x_authorize_loginid]").val(),x_authorize_transactionkey:this.$el.find("input[name=x_authorize_transactionkey]").val(),authorize_use_sandbox:this.$el.find("input[name=authorize_use_sandbox]").is(":checked")}),e=i.extend(e,{x_merchantwarrior_merchantuuid:this.$el.find("input[name=x_merchantwarrior_merchantuuid]").val(),x_merchantwarrior_apikey:this.$el.find("input[name=x_merchantwarrior_apikey]").val(),x_merchantwarrior_apipassphrase:this.$el.find("input[name=x_merchantwarrior_apipassphrase]").val(),merchantwarrior_use_sandbox:this.$el.find("input[name=merchantwarrior_use_sandbox]").is(":checked")}),e=i.extend(e,{x_ippay_terminalid:this.$el.find("input[name=x_ippay_terminalid]").val(),ippay_use_sandbox:this.$el.find("input[name=ippay_use_sandbox]").is(":checked")}),"custom"==e.expire&&(e.expire_number=this.$el.find("input[name=custom-expire-amount]").val(),e.expire_unit=this.$el.find("select[name=custom-expire-unit]").val()),i.each(["restricted","allowed"],function(t){var i=this.$el.find("input[name="+t+"]");if(i.each(function(i){++i,e[t+"_subnet_"+i]=n(this).val()||null}),this.model)for(var s=i.length+1;1e3>s;s++)this.model.get(t+"_subnet_"+s)&&(e[t+"_subnet_"+s]=null)},this),i.extend(e,{key:"guest_access",site_id:SITE.id}),e},save:function(e){e&&e.preventDefault(),this.clear(),this.$submit.trigger("saving");var t=this._save();t||this.$submit.trigger("error",!0)},prevalidator:function(){t.prevalidator.call(this);var e=this;this.$el.find("input[name=enable-vouchers], input[name=enable-payments]").on("change",function(){if(e.model){e.valid(["authorization"]);var t=e.model.validate(e.gather(),{partial:"authorization"});t&&e.invalid(t)}})},valid:function(e){var n=t.valid.call(this,e);i.each(n,function(e){switch(e){case"authorization":this.$el.find("input[name=enable-vouchers]").parent().removeClass("error").find(".error-msg").remove(),this.$el.find("input[name=enable-payments]").parent().removeClass("error");break;case"subnets":this.$el.find("fieldset.subnets .error-msg").remove()}},this)},invalid:function(e){var n=t.invalid.call(this,e);i.each(n,function(e,t){switch(t){case"authorization":this.$el.find("input[name=enable-vouchers]").parent().addClass("error").append('<div class="error-msg">'+e+"</div>"),this.$el.find("input[name=enable-payments]").parent().addClass("error");break;case"subnets":this.$el.find("fieldset.subnets").prepend('<div class="error-msg">'+e+"</div>")}},this)},success:function(){this.$submit.trigger("success")},error:function(e,t){this.$el.find("fieldset.actions").prepend(n('<div class="error-msg">'+s.E_DataSave+": "+s.apiError(t)+"</div>")),this.$submit.trigger("error")},remove:function(){this.devalidate(),this.off("save-success"),this.off("save-error"),this.$el.find("input[name=enable]").off(),this.$el.find("select[name=expire]").off(),this.$el.find(".buttonset input[name=redirect_enabled]").off(),this.$el.find("#guestControlPortalUrlHostname").off(),this.$el.find("#guestControlHotspotEnablePayments").off(),this.$el.find("#guestControlHotspotGateway").off(),this.$el.find("form").off(),this.$(".btn-hotspot").off(),this.$el.find("input[name=enable-vouchers], input[name=enable-payments]").off(),this.rendered=!1,e.prototype.remove.apply(this,arguments)}}))}),define("text!includes/settings/settingsUserGroupsFormTemplate.html",[],function(){return'<form class="complex-form">\n    <h2><%- headline %></h2>\n\n    <fieldset class="basic">\n        <div class="fields">\n            <div>\n                <label for="userGroupName<%- id %>"><%- msg.G_Name %></label>\n                <input type="text" id="userGroupName<%- id %>" name="name" value="" />\n            </div>\n            <div>\n                <label for="userGroupDownRateEnabled<%- id %>"><%- msg.G_SettingsBandwidthLimitDL %></label>\n                <input type="checkbox" id="userGroupDownRateEnabled<%- id %>" name="downrate-enabled" value="1" />\n                <span><%- msg.G_SettingsLimitedTo %></span>\n                <input type="text" id="userGroupDownRate<%- id %>" name="qos_rate_max_down" size="5" value="" />\n                <span><%- msg.G_SettingsKbps %></span>\n            </div>\n            <div>\n                <label for="userGroupUpRateEnabled<%- id %>"><%- msg.G_SettingsBandwidthLimitUL %></label>\n                <input type="checkbox" id="userGroupUpRateEnabled<%- id %>" name="uprate-enabled" value="1" />\n                <span><%- msg.G_SettingsLimitedTo %></span>\n                <input type="text" id="userGroupUpRate<%- id %>" name="qos_rate_max_up" size="5" value="" />\n                <span><%- msg.G_SettingsKbps %></span>\n            </div>\n        </div>\n    </fieldset>\n\n    <fieldset class="actions">\n        <button type="button" class="button tall auto white cancel"><span class="ui-button-icon ubnt-icon-close"></span><%- msg.G_Cancel %></button>\n        <button type="submit" class="button tall auto green save is-admin"><span class="ui-button-icon ubnt-icon-check"></span><%- msg.G_Save %></button>\n    </fieldset>\n</form>'}),define("unifi/view/settings/UserGroupsFormView",["unifi/view/settings/FormView","underscore","jquery","msg/Msg","text!includes/settings/settingsUserGroupsFormTemplate.html"],function(e,t,i,n,s){"use strict";return e.extend({_templateId:s,_prevalidate:{name:{input:"text"},qos_rate_max_down:{input:"text",complex:!0},qos_rate_max_up:{input:"text",complex:!0},"downrate-enabled":{onchange:"qos_rate_max_down"},"uprate-enabled":{onchange:"qos_rate_max_up"}},render:function(){var t=this.rendered;e.prototype.render.call(this),t||this.$el.find("input[name=downrate-enabled], input[name=uprate-enabled]").on("change",function(){var e=i(this);e.is(":checked")?e.parent().find("input").not(e).prop("disabled",!1):e.parent().find("input").not(e).prop("disabled",!0)}).trigger("change")},args:function(){return{id:this.id,headline:this.create?n.G_SettingsCreateNewUserGroup:n.G_SettingsEditUserGroup+" - "+this.model.get("name"),msg:n}},populate:function(){this.model&&(this.$el.find("input[name=name]").val(this.model.get("name")),this.$el.find("input[name=downrate-enabled]").prop("checked",this.model.get("qos_rate_max_down")&&-1!=this.model.get("qos_rate_max_down")).trigger("change"),this.$el.find("input[name=qos_rate_max_down]").val(-1!=this.model.get("qos_rate_max_down")?this.model.get("qos_rate_max_down"):""),this.$el.find("input[name=uprate-enabled]").prop("checked",this.model.get("qos_rate_max_up")&&-1!=this.model.get("qos_rate_max_up")).trigger("change"),this.$el.find("input[name=qos_rate_max_up]").val(-1!=this.model.get("qos_rate_max_up")?this.model.get("qos_rate_max_up"):""))},gather:function(){return{name:this.$el.find("input[name=name]").val(),qos_rate_max_down:this.$el.find("input[name=downrate-enabled]").is(":checked")?this.$el.find("input[name=qos_rate_max_down]").val():"-1",qos_rate_max_up:this.$el.find("input[name=uprate-enabled]").is(":checked")?this.$el.find("input[name=qos_rate_max_up]").val():"-1"}},remove:function(){this.$el.find("input[name=downrate-enabled], input[name=uprate-enabled]").off(),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/model/UserGroup",["unifi/model/Model","underscore","backbone","msg/Msg"],function(e,t,i,n){"use strict";return e.extend({validate:function(e,i){var s={},o=i?i.partial:null;return o&&"name"!=o||(e.name?this.validator.name(e.name)||(s.name=n.localize(n.E_InvalidName,n.G_Name)):s.name=n.localize(n.E_CannotBeEmpty,n.G_Name)),o&&"qos_rate_max_down"!=o||e.downRate_enabled&&(e.qos_rate_max_down?this.validator.digits(e.qos_rate_max_down)||(s.qos_rate_max_down=n.localize(n.E_IncorrectIntegerType,n.G_SettingsBandwidthLimitDL)):s.qos_rate_max_down=n.localize(n.E_CannotBeEmpty,n.G_SettingsBandwidthLimitDL)),o&&"qos_rate_max_up"!=o||e.upRate_enabled&&(e.qos_rate_max_up?this.validator.digits(e.qos_rate_max_up)||(s.qos_rate_max_up=n.localize(n.E_IncorrectIntegerType,n.G_SettingsBandwidthLimitUL)):s.qos_rate_max_up=n.localize(n.E_CannotBeEmpty,n.G_SettingsBandwidthLimitUL)),t.size(s)?s:void 0},sync:function(e,t,n){switch(e){case"create":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/add/usergroup",n.type="POST";break;case"update":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/upd/usergroup/"+t.id,n.type="POST",n.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/del/usergroup/"+t.id,n.type="POST"}return i.sync.call(this,e,t,n)}})}),define("unifi/collection/UserGroups",["unifi/collection/Collection","unifi/model/UserGroup"],function(e,t){"use strict";return e.extend({model:t,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/list/usergroup"}})}),define("ubnt/ubnt.ip",["underscore","jquery"],function(e,t){"use strict";t.ip2long=function(e){var t=!1,i=[];return e&&e.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)&&(i=e.split("."),t=16777216*i[0]+65536*i[1]+256*i[2]+1*i[3]),t},t.long2ip=function(e){return[e>>>24,e>>>16&255,e>>>8&255,255&e].join(".")},t.ipsubnet_recommend=function(e,i){var n=t._ipsubnet2network(e);return i===!1?i=0:(isNaN(i)||0>=i)&&(i=n.bits<25?5*(25-n.bits):1),{ip:n.ip,is_ip_valid:t.ipsubnet_hasip(e,n.ip),is_mask_valid:n.bits<31&&n.bits>0,ipsubnet:t.long2ip(n.min_iplong)+"/"+n.bits,dhcp_start_ip:t.long2ip(n.min_iplong+i),dhcp_end_ip:t.long2ip(n.max_iplong)}},t.ipsubnet_hasip=function(e,i){var n=t.ip2long(i),s=t._ipsubnet2network(e);return n>=s.min_iplong&&n<=s.max_iplong},t._bits2netmask=function(e){for(var t=4294967295,i=1,n=e;32>n;n++)t^=i,i<<=1;return t},t._ipsubnet2network=function(e){var i=e.split("/")[0],n=parseInt(e.split("/")[1],10),s=t._bits2netmask(n),o=~s,a=(t.ip2long(i)&s)>>>0,r=(t.ip2long(i)|o)>>>0;return a+=1,r-=1,{ip:i,ip_long:t.ip2long(i)>>>0,bits:n,netmask:s,min_iplong:a,max_iplong:r,num_ips:r-a+1}},t.ip_in_subnet=function(e,i,n){var s=t.ip2long(e),o=t.ip2long(i),a=(1<<32-n)-1^4294967295;return 0===((s^o)&a)}}),define("unifi/model/Client",["unifi/model/Model","jquery","backbone","underscore","ubnt/backgrid","libs/moment","msg/Msg","ubnt/ubnt.ip"],function(e,t,i,n,s,o,a){"use strict";return e.extend({parse:function(t,i){return t=e.prototype.parse.call(this,t,i),t&&(t.tx_bytes=t.tx_bytes?parseInt(t.tx_bytes,10):0,t.rx_bytes=t.rx_bytes?parseInt(t.rx_bytes,10):0,t.last_seen=t.last_seen?parseInt(t.last_seen,10):0),t},toSearch:function(){return{mac:this.attributes.mac,name:this.name(),ip:this.attributes.ip,connection:this.attributes.essid,is_guest:this.isGuest(),last_seen:this.absoluteLastSeen(),ap:this.attributes.ap_mac,sw:this.attributes.sw_mac}},validate:function(e,t){{var i={};t?t.partial:null}return e.name&&!this.validator.name(e.name)&&(i.name=a.localize(a.E_InvalidName,a.G_PropertiesAlias)),n.size(i)?i:void 0},name:function(){return this.get("name")||this.get("hostname")||this.get("mac")},ip2long:function(){return t.ip2long(this.get("ip"))},sortStatus:function(){return this.get("authorized")?1:0},authorizable:function(){return this.isGuest()&&(!this.get("is_wired")||this.get("is_wired")&&this.get("gw_mac"))},switch_port_suffix:function(e){var t=this.get("sw_mac"),i=this.get("sw_port");return t&&i?" #"+(e&&1===i.toString().length?" ":"")+i:""},wired_connection:function(){{var e=this.get("sw_mac"),t=this.get("gw_mac");this.get("sw_port")}return e?e+this.switch_port_suffix(!0):t?t:""},connection:function(){return this.get(this.get("is_wired")?"network":"essid")},isConnected:function(){return this.get("mac")&&!this.get("blocked")&&this.get("uptime")?!0:!1},userOrGuest:function(){return this.get("is_guest")?a.G_Guest:a.G_User},isGuest:function(){return this.get("is_guest")},uptime:function(e){return e=e||this.get("uptime"),e>0?s.Formatters.Duration.fromRaw(e||0):""},rssi:function(){var e=parseFloat(this.get("rssi"));return e||0===e?(e>45?e=45:5>e&&(e=5),e=(e-5)/40*99,(0===e?"0":e.toPrecision(2))+"%"):""},lastSeen:function(){var e,t=this.get("last_seen");return t?(e=(new Date).getTime()/1e3-parseInt(t,10),isNaN(e)?"":86400>e?s.Formatters.Duration.fromRaw(e)+" ago":o(t+"","X").format("YYYY/MM/DD HH:mm:ss")):""},absoluteLastSeen:function(){var e=this.get("last_seen");return e?o(e+"","X").format("YYYY/MM/DD HH:mm:ss"):""},radioType:function(){return this.get("radio_proto")},is5g:function(){return"na"==this.get("radio")},signalWithDbm:function(){return(this.get("rssi")||0)-95+" dBm"},txRateInM:function(){return this.get("tx_rate")?this.get("tx_rate")/1e3+"M":""},rxRateInM:function(){return this.get("rx_rate")?this.get("rx_rate")/1e3+"M":""},activity:function(){var e=this.get("bytes-r")||0;return e?s.Formatters.Bytes.fromRaw(e)+"B/sec":""},activitySort:function(){return this.get("bytes-r")||0},powersave:function(){return this.get("powersave_enabled")?"Enabled":"Not Enabled"},receivedPacketsOverBytes:function(){var e=this.get("rx_packets"),t=this.get("rx_bytes");return e&&t?s.Formatters.Bytes.fromRaw(e)+" / "+s.Formatters.Bytes.fromRaw(t):""},sentPacketsOverBytes:function(){var e=this.get("tx_packets"),t=this.get("tx_bytes");return e&&t?s.Formatters.Bytes.fromRaw(e)+" / "+s.Formatters.Bytes.fromRaw(t):""},reconnect:function(e){this.sync("reconnect",this,e)},block:function(e){this.sync("block",this,e)},unblock:function(e){this.sync("unblock",this,e)},unauthorize:function(e){this.sync("unauthorize",this,e)},authorize:function(e){this.sync("authorize",this,e)},sync:function(e,t,n){switch(n=n||{},e){case"update":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/upd/user/"+t.get("_id"),n.type="POST",n.data=JSON.stringify(t.changed);break;case"reconnect":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/cmd/stamgr",n.type="POST",n.data=JSON.stringify({mac:t.get("mac"),cmd:"kick-sta"});break;case"block":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/cmd/stamgr",n.type="POST",n.data=JSON.stringify({mac:t.get("mac"),cmd:"block-sta"});break;case"unblock":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/cmd/stamgr",n.type="POST",n.data=JSON.stringify({mac:t.get("mac"),cmd:"unblock-sta"});break;case"unauthorize":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/cmd/stamgr",n.type="POST",n.data=JSON.stringify({mac:t.get("mac"),cmd:"unauthorize-guest"});break;case"authorize":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/cmd/stamgr",n.type="POST",n.data=JSON.stringify({mac:t.get("mac"),cmd:"authorize-guest"})}return i.sync.call(this,e,t,n)}})}),define("unifi/collection/Clients",["unifi/collection/Collection","unifi/model/Client","underscore"],function(e,t,i){"use strict";return e.extend({model:t,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/sta"},getClientFromMac:function(e){return this.find(function(t){return t.get("mac")==e})},getUserFromIp:function(e){return this.find(function(t){return t.get("ip")==e})},sortByBytes:function(){var e=this.sortBy(function(e){return-1*(e.get("tx_bytes")+e.get("rx_bytes"))});return e},sortByUptime:function(){var e=this.sortBy(function(e){return-1*e.get("uptime")});return e},clientsPerEssid:function(){var e=this.filter(function(e){return e.get("essid")}),t=i.groupBy(e,function(e){return e.get("essid")});return t},clientsPerEssidStats:function(){var t,n=this.clientsPerEssid(),s=[];return i.each(n,function(e,t){s.push({name:t,count:e.length})}),t=new e(s),t.sortBy(function(e){return-1*e.get("count")})}})}),define("unifi/model/insights/KnownClient",["unifi/model/Client","backbone","ubnt/backgrid","libs/moment"],function(e){"use strict";return e.extend({toSearch:function(){return{name:this.name(),mac:this.attributes.mac,is_guest:this.isGuest(),last_seen:this.absoluteLastSeen()}}})}),define("unifi/collection/insights/KnownClients",["backbone","underscore","unifi/collection/Clients","unifi/model/insights/KnownClient","app"],function(e,t,i,n,s){"use strict";return i.extend({model:n,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/alluser"},parse:function(e){if(!s.data.Clients)return e.data;var i=[],n=e.data;return t.each(s.collection("Clients").models,function(e){i.push(e.attributes)}),this.mergeByProperty(n,i,"mac"),n},mergeByProperty:function(e,i,n){t.each(i,function(i){var s=t.find(e,function(e){return e[n]===i[n]});s?t.extend(s,i):e.push(i)})},sync:function(i,n,s){switch(s=s||{},i){case"read":s.contentType="application/json; charset=utf-8",s.type="POST",s.data=JSON.stringify(t.extend(s.data||{}))}return e.sync.call(this,i,n,s)}})}),define("text!includes/settings/settingsUserGroupsTemplate.html",[],function(){return'<div class="section section-main">\n    <h1>\n        <span class="breadcrumb-home"><%- msg.G_SettingsUserGroups %></span>\n        <span class="breadcrumb-child hidden">\n            <span class="ubnt-icon-arrow-right"></span>\n            <span class="breadcrumb"></span>\n        </span>\n    </h1>\n\n    <div class="section-home">\n        <div class="data-table untitled">\n            <div class="loading"><span><%- msg.N_Loading %></span></div>\n        </div>\n        <div class="buttons is-admin">\n            <button class="button tall auto white create-form hidden" data-type="create-form">\n                <span class="ui-button-icon ubnt-icon-gear gear"></span>\n                <%- msg.G_SettingsCreateNewUserGroup %>\n            </button>\n        </div>\n    </div>\n    <div class="forms hidden"></div>\n</div>\n'}),define("unifi/view/settings/UserGroupsView",["unifi/view/settings/ListContentView","unifi/view/settings/UserGroupsFormView","underscore","jquery","ubnt/backgrid","unifi/collection/UserGroups","msg/Msg","ubnt/view/dialogs/ErrorDialogView","ubnt/view/dialogs/ConfirmDialogView","unifi/collection/insights/KnownClients","text!includes/settings/settingsUserGroupsTemplate.html"],function(e,t,i,n,s,o,a,r,l,u,c){"use strict";return e.extend({id:"settingsUserGroups",_templateId:i.template(c,{msg:a}),_formClass:t,_collectionType:{name:"UserGroups",Class:o},_pageable:!1,dependencies:function(){var e={KnownClients:u},t=[],s={},o=this;i.each(e,function(e,i){t.push(s[i]=n.Deferred())},this),n.when.apply(n,t).then(function(){o._dependencies.resolve()},function(){o._dependencies.reject()}),i.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:s[t]}},e)},this)},columns:function(){return[{name:"name",label:a.G_Name,editable:!1,cell:"string"},{name:"bandwidth",label:a.G_SettingsBandwidthLimit,editable:!1,cell:s.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){var t=-1==e.get("qos_rate_max_down")?a.G_Unlimited:e.get("qos_rate_max_down")+" "+a.G_SettingsKbps,i=-1==e.get("qos_rate_max_up")?a.G_Unlimited:e.get("qos_rate_max_up")+" "+a.G_SettingsKbps;return a.G_Download+": "+t+", "+a.G_Upload+": "+i},toRaw:function(e){return e}}})},{name:"_id",label:a.G_Actions,editable:!1,sortable:!1,headerCell:s.Headers.noSortHeader,cell:s.Cells.ActionsCell.extend({actions:{edit:{icon:"ubnt-icon-edit",callback:this.rowEdit},"delete":{icon:"ubnt-icon-trash",callback:this.rowDelete,render:function(e){return!e.get("attr_no_delete")}}}})}]},grid:function(){return e.prototype.grid.call(this),this},rowDelete:function(e){var t=this;(new l).show(a.N_ConfirmDeleteSetting,function(){e.destroy({wait:!0,error:function(e,i){if("api.err.ObjectReferredBy"===i.responseJSON.meta.msg){var n,s,o=JSON.parse(i.responseText).meta,l=o.name;s=t.options.app.collection("Clients").findWhere({mac:l}),s||(s=t.options.app.collection("KnownClients").findWhere({mac:l})),s&&(n=s.name(),i.responseJSON.meta.name=n,i.responseText=i.responseText.replace(l,n))}(new r).open(a.apiError(i,!0))}})})}})}),define("text!includes/settings/settingsNetworksFormTemplate.html",[],function(){return'<form class="complex-form">\n    <h2><%- headline %></h2>\n\n    <fieldset class="basic">\n        <div class="fields">\n            <div>\n                <label for="networkName<%- id %>"><%- msg.G_Name %></label>\n                <input type="text" id="networkName<%- id %>" name="name" value="" />\n            </div>\n            <div>\n                <label><%- msg.G_SettingsPurpose %></label>\n                <div class="buttonset">\n                    <input type="radio" id="networkPurposeCorporate" name="purpose" value="corporate" checked="checked" /><label for="networkPurposeCorporate"><%- msg.G_SettingsPurposeCorporate %></label>\n                    <input type="radio" id="networkPurposeGuest" name="purpose" value="guest" /><label for="networkPurposeGuest"><%- msg.G_SettingsPurposeGuest %></label>\n                    <input type="radio" id="networkPurposeRemoteUserVPN" name="purpose" value="remote-user-vpn" /><label for="networkPurposeRemoteUserVPN"><%- msg.G_SettingsPurposeRemoteUserVPN %></label>\n                    <input type="radio" id="networkPurposeSiteToSiteVPN" name="purpose" value="site-vpn" /><label for="networkPurposeSiteToSiteVPN"><%- msg.G_SettingsPurposeSiteToSiteVPN %></label>\n                    <input type="radio" id="networkPurposeVoip" name="purpose" value="voip" /><label for="networkPurposeVoip"><%- msg.G_SettingsPurposeVoip %></label>\n                    <input type="radio" id="networkPurposeVlanOnly" name="purpose" value="vlan-only" /><label for="networkPurposeVlanOnly"><%- msg.G_SettingsPurposeVlanOnly %></label>\n                </div>\n            </div>\n            <div class="purpose-toggled purpose-corporate purpose-guest purpose-remote-user-vpn purpose-voip">\n                <label for="networkSubnet<%- id %>"><%- msg.G_SettingsIPSubnet %></label>\n                <input type="text" id="networkSubnet<%- id %>" name="ip_subnet" value="" />\n                <span class="recommend"><%- msg.G_SettingNetworksUpdateDHCPRange %></span>\n            </div>\n            <div class="purpose-toggled purpose-corporate purpose-guest purpose-vlan-only vlan">\n                <label for="networkVLAN<%- id %>"><%- msg.G_SettingsVLAN %></label>\n                <input type="text" id="networkVLAN<%- id %>" name="vlan" size="4" value="" />\n            </div>\n            <div class="purpose-toggled purpose-corporate purpose-guest purpose-voip">\n                <label for="networkDHCPServer"><%- msg.G_SettingsDHCPServer %></label>\n                <input type="checkbox" id="networkDHCPServer" name="dhcpd_enabled" value="1" />\n                <span><%- msg.G_SettingsEnableDHCPServer %></span>\n            </div>\n\n            <div class="dhcp-range purpose-toggled purpose-corporate purpose-guest purpose-voip purpose-remote-user-vpn">\n                <label for="networkDHCPRangeStart<%- id %>">\n                    <span class="purpose-toggled purpose-corporate purpose-guest purpose-voip">\n                        <%- msg.G_SettingsDHCPRange %>\n                    </span>\n                    <span class="purpose-toggled purpose-remote-user-vpn">\n                        <%- msg.G_SettingsIPPool %>\n                    </span>\n                </label>\n                <input type="text" id="networkDHCPRangeStart<%- id %>" name="dhcpd_start" value="" />\n                <span>-</span>\n                <input type="text" id="networkDHCPRangeEnd<%- id %>" name="dhcpd_stop" value="" />\n            </div>\n\n            <div class="dhcpd_nameserver purpose-toggled purpose-corporate purpose-guest purpose-voip purpose-remote-user-vpn">\n                <label for="networkDHCPNameServer">\n                    <span class="purpose-toggled purpose-corporate purpose-guest purpose-voip">\n                        <%- msg.G_SettingsDHCPNameServer %>\n                    </span>\n                    <span class="purpose-toggled purpose-remote-user-vpn">\n                        <%- msg.G_SettingsNameServer %>\n                    </span>\n                </label>\n\n                <div class="buttonset">\n                   <input type="radio" id="dhcp_nameserver_auto" name="dhcp_nameserver_source" value="auto" checked="checked" /><label for="dhcp_nameserver_auto"><%- msg.G_SettingsNameServerAuto %></label>\n                   <input type="radio" id="dhcp_nameserver_manual" name="dhcp_nameserver_source" value="manual" /><label for="dhcp_nameserver_manual"><%- msg.G_SettingsNameServerManual %></label>\n                </div>\n                <input type="text" id="dhcpd_dns_1" name="dhcpd_dns_1" value="" placeholder="<%- msg.G_SettingsNameServer1 %>"/>\n                <input type="text" id="dhcpd_dns_2" name="dhcpd_dns_2" value="" placeholder="<%- msg.G_SettingsNameServer2 %>"/>\n            </div>\n\n            <div class="dhcpd_winsserver purpose-toggled purpose-corporate purpose-guest purpose-voip purpose-remote-user-vpn">\n                <label for="networkDHCPWinsServer">\n                    <span class="purpose-toggled purpose-corporate purpose-guest purpose-voip">\n                        <%- msg.G_SettingsDHCPWinsServer %>\n                    </span>\n                    <span class="purpose-toggled purpose-remote-user-vpn">\n                        <%- msg.G_SettingsWinsServer %>\n                    </span>\n                </label>\n                <input type="checkbox" id="networkDHCPWinsServer" name="dhcpd_winsserver_enabled" value="1" />\n                <span class="purpose-toggled purpose-corporate purpose-guest purpose-voip"><%- msg.G_SettingsEnableDHCPWinsServer %></span>\n                <span class="purpose-toggled purpose-remote-user-vpn"><%- msg.G_SettingsEnableWinsServer %></span>\n                <input type="text" id="dhcpd_wins_1" name="dhcpd_wins_1" value="" placeholder="<%- msg.G_SettingsWinsServer1 %>"/>\n                <input type="text" id="dhcpd_wins_2" name="dhcpd_wins_2" value="" placeholder="<%- msg.G_SettingsWinsServer2 %>"/>\n            </div>\n\n            <div class="dhcpd_leasetime purpose-toggled purpose-corporate purpose-guest purpose-voip">\n                <label for="dhcpd_leasetime"><%- msg.G_SettingsDHCPLeaseTime %></label>\n                <input type="text" id="dhcpd_leasetime" name="dhcpd_leasetime" size="6" value="" />\n                <span><%- msg.G_SettingsLeaseTimeSeconds %></span>\n            </div>\n\n            <div class="purpose-toggled purpose-corporate purpose-guest purpose-voip purpose-vlan-only">\n                <label for="networkDHCPGuard"><%- msg.G_SettingsDHCPDHCPGuarding %></label>\n                <input type="checkbox" id="networkDHCPGuard" name="dhcpguard_enabled" value="0" />\n                <span><%- msg.G_SettingsEnableDHCPGuarding %></span>\n                <input type="text" id="networkDHCPGuardServer" name="dhcpd_ip_1" value placeholder="<%- msg.G_SettingsDHCPTrustedServerIp %>" />\n            </div>\n\n            <div class="purpose-toggled purpose-site-vpn">\n                <label for="networkRemoteSite<%- id %>"><%- msg.G_SettingsRemoteSite %></label>\n                <div class="select">\n                    <select id="networkRemoteSite<%- id %>" name="remote_site_id">\n                    </select>\n                </div>\n            </div>\n            <div class="purpose-toggled purpose-remote-user-vpn">\n                <label for="networkRadiusIP<%- id %>"><%- msg.G_SettingsRadiusIP %></label>\n                <input type="text" id="networkRadiusIP<%- id %>" name="radius_ip_1" value="" />\n            </div>\n            <div class="purpose-toggled purpose-remote-user-vpn">\n                <label for="networkRadiusPassword<%- id %>"><%- msg.G_SettingsRadiusPassword %></label>\n                <input type="password" id="networkRadiusPassword<%- id %>" name="x_radius_secret_1" value="" />\n            </div>\n            <div class="purpose-toggled purpose-remote-user-vpn">\n                <label for="exposedToSiteToSiteVPN"><%- msg.G_SettingsExposedToVPN %></label>\n                <input type="checkbox" id="exposedToSiteToSiteVPN" name="exposed_to_site_vpn" value="" />\n                <span><%- msg.G_SettingsExposedToSiteToSiteVPN %></span>\n            </div>\n        </div>\n    </fieldset>\n\n    <fieldset class="actions">\n        <button type="button" class="button tall auto white cancel"><span class="ui-button-icon ubnt-icon-close"></span><%- msg.G_Cancel %></button>\n        <button type="submit" class="button tall auto green save is-admin"><span class="ui-button-icon ubnt-icon-check"></span><%- msg.G_Save %></button>\n    </fieldset>\n</form>\n'
}),define("unifi/view/settings/NetworksFormView",["unifi/view/settings/FormView","unifi/view/app/ValidatorMixin","unifi/view/app/FormView","underscore","jquery","msg/Msg","text!includes/settings/settingsNetworksFormTemplate.html","ubnt/ubnt.ip"],function(e,t,i,n,s,o,a){"use strict";return e.extend({_templateId:a,_prevalidate:{name:{input:"text"},vlan:{input:"text",complex:!0},ip_subnet:{input:"text",complex:!0},dhcpd_enabled:{input:"checkbox",onchange:["dhcpd_start","dhcpd_stop"]},dhcpd_start:{input:"text",complex:!0},dhcpd_stop:{input:"text",complex:!0},dhcpguard_enabled:{input:"checkbox",complex:!0},dhcpd_ip_1:{input:"text",complex:!0},exposed_to_site_vpn:{input:"checkbox",complex:!0},radius_ip_1:{input:"text",complex:!0},x_radius_secret_1:{input:"text",complex:!0},dhcpd_leasetime:{input:"text",complex:!0},dhcpd_dns_1:{input:"text",complex:!0},dhcpd_dns_2:{input:"text",complex:!0},dhcpd_wins_1:{input:"text",complex:!0},dhcpd_wins_2:{input:"text",complex:!0}},initialize:function(t){e.prototype.initialize.call(this,t),this.sites=this.app.collection("Sites"),this.listenTo(this.sites,"change",this.renderSites)},render:function(){var t=this.rendered;if(e.prototype.render.call(this,!0),!t){var i=this.$el.find(".buttonset input[name=purpose]"),n=this.$el.find("input[name=dhcpd_enabled]"),o=this.$el.find("input[name=dhcpd_start]"),a=this.$el.find("input[name=dhcpd_stop]"),r=this.$el.find("input[name=dhcpd_winsserver_enabled]"),l=this.$el.find(".buttonset input[name=dhcp_nameserver_source]"),u=this.$el.find("input[name=dhcpd_dns_1]"),c=this.$el.find("input[name=dhcpd_dns_2]"),d=this.$el.find("input[name=dhcpd_wins_1]"),h=this.$el.find("input[name=dhcpd_wins_2]"),p=(this.$el.find("input[name=dhcpd_leasetime]"),this.$el.find("input[name=dhcpguard_enabled]")),f=this.$el.find("input[name=dhcpd_ip_1]"),m=this.$el.find("input[name=ip_subnet]"),g=this.$el.find(".recommend"),_=this.$el.find(".dhcpd_nameserver"),v=this.$el.find(".dhcpd_winsserver"),b=this.$el.find(".dhcp-range"),A=this.$el.find(".dhcpd_leasetime");i.radiotoggle({container:this.$el,prefix:"purpose"}),this.create&&(this.$el.find(".buttonset input[name=purpose][value=voip]").button("disable"),this.collection.filterByPurpose("remote-user-vpn").length&&this.$el.find(".buttonset input[name=purpose][value=remote-user-vpn]").button("disable")),this.create||(i.on("change",function(){s(this).button("enable").siblings("input").not(":checked").button("disable")}),this.model.get("attr_hidden_id")&&this.$el.find("input[name=vlan]").parent("div").remove()),m.on("change",function(e,t){var r,l=s(this),u=l.val(),c=0;"remote-user-vpn"==i.filter(":checked").val()&&(c=!1,t=!0),u&&n.is(":checked")&&(r=s.ipsubnet_recommend(u,c))&&((!o.val()||t)&&o.val(r.dhcp_start_ip).trigger("change",!0).trigger("validate.validator"),(!a.val()||t)&&a.val(r.dhcp_end_ip).trigger("change",!0).trigger("validate.validator")),l.trigger("suggest",r)}),m.on("suggest",function(e,t){var r=s(this),l=r.val(),u=!1,c=0;"remote-user-vpn"==i.filter(":checked").val()&&(c=!1),l&&n.is(":checked")&&(t=t||s.ipsubnet_recommend(l,c))&&(u=o.val()!=t.dhcp_start_ip||a.val()!=t.dhcp_end_ip),g[u?"show":"hide"]()}),g.on("click",function(e){e.preventDefault(),m.trigger("change",!0)}),o.add(a).add(n).on("change",function(e,t){t||m.trigger("suggest")}),n.on("change",function(){var e=s(this);e.is(":visible")&&(e.is(":checked")?(o.add(a).prop("disabled",!1),b.show(),_.show(),v.show(),A.show()):(o.add(a).prop("disabled",!0),b.hide(),_.hide(),v.hide(),A.hide()))}).trigger("change"),p.on("change",function(){var e=s(this);e.is(":visible")&&(e.is(":checked")?f.prop("disabled",!1):f.prop("disabled",!0))}).trigger("change"),i.on("change",function(){"remote-user-vpn"==s(this).val()?(o.add(a).prop("disabled",!0),m.trigger("change")):(n.trigger("change"),m.trigger("suggest"))}),l.on("change",function(){var e=s(this).val();"auto"===e?(s("input[name=dhcpd_dns_1]").hide(),s("input[name=dhcpd_dns_2]").hide(),u.removeClass("error"),c.removeClass("error"),_.find(".error-msg").remove()):"manual"===e&&(s("input[name=dhcpd_dns_1]").show(),s("input[name=dhcpd_dns_2]").show())}).trigger("change"),r.on("change",function(){var e=s(this);e.is(":checked")?(d.prop("disabled",!1),h.prop("disabled",!1)):(d.prop("disabled",!0),h.prop("disabled",!0),d.removeClass("error"),h.removeClass("error"),v.find(".error-msg").remove())}).trigger("change"),this.$el.find(".buttonset input[name=purpose]:checked").filter(":checked").trigger("change"),this.renderSites()}this.populate()},renderSites:function(){var e=this.$el.find("select[name=remote_site_id]"),t=e.val(),i=n.compact(this.collection.pluck("remote_site_id")),o=this.sites.where({role:"admin"});e.empty(),n.each(o,s.proxy(function(t){t.id==SITE.id||t.id!=this.model.get("remote_site_id")&&-1!==n.indexOf(i,t.id)||e.append(s('<option value="'+t.id+'"></option>').text(t.get("desc")))},this)),e.val(t||e.first().val()).trigger("change")},args:function(){return{id:this.id,headline:this.create?o.G_SettingsCreateNewNetwork:o.G_SettingsEditNetwork+" - "+this.model.get("name"),msg:o}},populate:function(){this.model&&(this.$el.find("input[name=name]").val(this.model.get("name")),this.$el.find("input[name=purpose][value="+(this.model.get("purpose")||"corporate")+"]").prop("checked",!0).trigger("change"),this.$el.find("input[name=vlan]").val(this.model.get("vlan")),this.$el.find("input[name=ip_subnet]").val(this.model.get("ip_subnet")),this.$el.find("input[name=dhcpd_enabled]").prop("checked",this.model.get("dhcpd_enabled")||this.create).trigger("change"),this.$el.find("input[name=dhcpd_start]").val(this.model.get("dhcpd_start")?this.model.get("dhcpd_start"):""),this.$el.find("input[name=dhcpd_stop]").val(this.model.get("dhcpd_stop")?this.model.get("dhcpd_stop"):""),this.$el.find("input[name=dhcpguard_enabled]").prop("checked",this.model.get("dhcpguard_enabled")),this.$el.find("input[name=dhcpd_ip_1]").val(this.model.get("dhcpd_ip_1")?this.model.get("dhcpd_ip_1"):""),this.$el.find("select[name=remote_site_id]").val(this.model.get("remote_site_id")?this.model.get("remote_site_id"):""),this.$el.find("input[name=exposed_to_site_vpn]").prop("checked",this.model.get("exposed_to_site_vpn")||this.create),this.$el.find("input[name=radius_ip_1]").val(this.model.get("radius_ip_1")?this.model.get("radius_ip_1"):""),this.$el.find("input[name=x_radius_secret_1]").val(this.model.get("x_radius_secret_1")?this.model.get("x_radius_secret_1"):""),this.$el.find("input[name=dhcp_nameserver_source][value="+(this.model.get("dhcpd_dns_enabled")?"manual":"auto")+"]").prop("checked",!0).trigger("change"),this.$el.find("input[name=dhcpd_dns_1]").val(this.model.get("dhcpd_dns_1")),this.$el.find("input[name=dhcpd_dns_2]").val(this.model.get("dhcpd_dns_2")),this.$el.find("input[name=dhcpd_winsserver_enabled]").prop("checked",this.model.get("dhcpd_wins_enabled")).trigger("change"),this.$el.find("input[name=dhcpd_wins_1]").val(this.model.get("dhcpd_wins_1")),this.$el.find("input[name=dhcpd_wins_2]").val(this.model.get("dhcpd_wins_2")),this.$el.find("input[name=dhcpd_leasetime]").val(this.model.get("dhcpd_leasetime")?this.model.get("dhcpd_leasetime"):86400)),this.$el.find("input[name=ip_subnet]").trigger("suggest")},gather:function(){var e=this.$el.find("input[name=purpose]:checked").val(),t=this.$el.find("input[name=vlan]").val(),i=this.$el.find("input[name=dhcpd_enabled]").is(function(){return s(this).is(":visible")&&s(this).is(":checked")})||"remote-user-vpn"==e,o=this.$el.find("input[name=dhcp_nameserver_source]:checked").val(),a="manual"===o?!0:!1,r=this.$el.find("input[name=dhcpd_winsserver_enabled]").is(":checked"),l={name:this.$el.find("input[name=name]").val(),enabled:this.model.get("id")?this.model.get("enabled"):!0,purpose:e,is_nat:"site-vpn"==e?!1:!0};if(("corporate"==e||"guest"==e||"remote-user-vpn"==e||"voip"==e)&&(l=n.extend(l,{ip_subnet:this.$el.find("input[name=ip_subnet]").val(),dhcpd_enabled:i,dhcpd_start:this.$el.find("input[name=dhcpd_start]").val(),dhcpd_stop:this.$el.find("input[name=dhcpd_stop]").val(),dhcpd_dns_enabled:a,dhcpd_wins_enabled:r}),a&&(l=n.extend(l,{dhcpd_dns_1:this.$el.find("input[name=dhcpd_dns_1]").val()||"",dhcpd_dns_2:this.$el.find("input[name=dhcpd_dns_2]").val()||""})),r&&(l=n.extend(l,{dhcpd_wins_1:this.$el.find("input[name=dhcpd_wins_1]").val()||"",dhcpd_wins_2:this.$el.find("input[name=dhcpd_wins_2]").val()||""}))),"corporate"==e||"guest"==e||"voip"==e){var u=this.$el.find("input[name=dhcpd_leasetime]").val();u&&(l=n.extend(l,{dhcpd_leasetime:u}))}return("corporate"==e||"guest"==e||"vlan-only"==e||"voip"==e)&&(l=n.extend(l,{dhcpguard_enabled:this.$el.find("input[name=dhcpguard_enabled]").is(function(){return s(this).is(":visible")&&s(this).is(":checked")}),dhcpd_ip_1:this.$el.find("input[name=dhcpd_ip_1]").val()})),("corporate"==e||"guest"==e||"vlan-only"==e)&&(l=n.extend(l,{vlan_enabled:!!t,vlan:t})),"site-vpn"==e&&(l=n.extend(l,{remote_site_id:this.$el.find("select[name=remote_site_id]").val()})),"remote-user-vpn"==e&&(l=n.extend(l,{exposed_to_site_vpn:this.$el.find("input[name=exposed_to_site_vpn]").is(function(){return s(this).is(":visible")&&s(this).is(":checked")}),radius_ip_1:this.$el.find("input[name=radius_ip_1]").val(),x_radius_secret_1:this.$el.find("input[name=x_radius_secret_1]").val()})),this.model&&this.model.get("attr_hidden_id")&&(delete l.vlan,delete l.vlan_enabled),l},remove:function(){this.stopListening(this.sites,"change"),this.$el.find(".buttonset input[name=purpose]").off(),this.$el.find("input[name=ip_subnet]").off(),this.$el.find("input[name=dhcpd_start]").off(),this.$el.find("input[name=dhcpd_stop]").off(),this.$el.find("input[name=dhcpd_enabled]").off(),this.$el.find("input[name=dhcpguard_enabled]").off(),this.$el.find("input[name=dhcpd_ip_1]").off(),this.$el.find("input[name=exposed_to_site_vpn]").off(),this.$el.find(".updateDHCPRange").off(),this.$el.find(".recommend").off(),this.rendered=!1,e.prototype.remove.apply(this,arguments)},error:function(e,t){i.prototype.error.call(this),this.$el.find("fieldset.actions").prepend(s('<div class="error-msg">'+o.E_DataSave+": "+o.apiError(t,!0)+"</div>"))}})}),define("unifi/model/Network",["unifi/model/Model","jquery","underscore","backbone","msg/Msg","ubnt/ubnt.ip"],function(e,t,i,n,s){"use strict";return e.extend({validate:function(e,n){var o,a,r={},l=n?n.partial:null,u=e.ip_subnet?e.ip_subnet.split("/"):null,c=!1;if(u&&u.length>1&&(o=u[0],a=u[1]),l&&"name"!=l||(e.name?this.validator.name(e.name)||(r.name=s.localize(s.E_InvalidName,s.G_Name)):l||(r.name=s.localize(s.E_CannotBeEmpty,s.G_Name))),l&&"vlan"!=l||(("corporate"==e.purpose||"guest"==e.purpose)&&(e.vlan||this.get("attr_no_delete")||"default"==this.get("attr_hidden_id")||(r.vlan=s.localize(s.E_CannotBeEmpty,s.G_SettingsVLAN))),e.vlan&&!this.validator.range(e.vlan,2,4009)&&(r.vlan=s.localize(s.E_IncorrectNumberRange,s.G_SettingsVLAN,2,4009))),!(l&&"ip_subnet"!=l||"corporate"!=e.purpose&&"guest"!=e.purpose&&"remote-user-vpn"!=e.purpose&&"voip"!=e.purpose))if(e.ip_subnet)if(this.validator.subnet(e.ip_subnet)){var d=t.ipsubnet_recommend(e.ip_subnet);d.is_ip_valid&&d.is_mask_valid||(r.ip_subnet=s.localize(s.E_IncorrectIPSubnetSpec,e.ip_subnet))}else r.ip_subnet=s.localize(s.E_IncorrectIPSubnetSpec,e.ip_subnet);else l||(r.ip_subnet=s.localize(s.E_CannotBeEmpty,s.G_SettingsIPSubnet));return l&&"dhcpd_start"!=l||(e.dhcpd_enabled?e.dhcpd_start?this.validator.ip(e.dhcpd_start)?t.ip_in_subnet(o,e.dhcpd_start,a)||(r.dhcpd_start=s.localize(s.E_InvalidDHCPRange,e.dbchp_start),c=!0):r.dhcpd_start=s.localize(s.E_IncorrectIPAddress,e.dhcpd_start):l||(r.dhcpd_start=s.localize(s.E_CannotBeEmpty,s.G_SettingsIPStart)):e.dhcpd_start&&!this.validator.ip(e.dhcpd_start)&&(r.dhcpd_start=s.localize(s.E_IncorrectIPAddress,e.dhcpd_start))),l&&"dhcpd_stop"!=l||(e.dhcpd_enabled?e.dhcpd_stop?this.validator.ip(e.dhcpd_stop)?c||t.ip_in_subnet(o,e.dhcpd_stop,a)||(r.dhcpd_stop=s.localize(s.E_InvalidDHCPRange,e.dhcpd_stop)):r.dhcpd_stop=s.localize(s.E_IncorrectIPAddress,e.dhcpd_stop):l||(r.dhcpd_stop=s.localize(s.E_CannotBeEmpty,s.G_SettingsIPEnd)):e.dhcpd_stop&&!this.validator.ip(e.dhcpd_stop)&&(r.dhcpd_stop=s.localize(s.E_IncorrectIPAddress,e.dhcpd_stop))),l&&"dhcpd_leasetime"!=l||e.dhcpd_leasetime&&!this.validator.range(e.dhcpd_leasetime,0,31536e3)&&(r.dhcpd_leasetime=s.localize(s.E_IncorrectNumberRange,s.G_SettingsDHCPLeaseTime,0,31536e3)),l&&"dhcpd_dns_1"!=l||e.dhcpd_dns_enabled&&(e.dhcpd_dns_1?this.validator.ip(e.dhcpd_dns_1)||(r.dhcpd_dns_1=s.localize(s.E_IncorrectIPAddress,e.dhcpd_dns_1)):r.dhcpd_dns_1=s.localize(s.E_CannotBeEmpty,s.G_SettingsDHCPNameServer)),l&&"dhcpd_dns_2"!=l||e.dhcpd_dns_enabled&&e.dhcpd_dns_2&&!this.validator.ip(e.dhcpd_dns_2)&&(r.dhcpd_dns_2=s.localize(s.E_IncorrectIPAddress,e.dhcpd_dns_2)),l&&"dhcpd_wins_1"!=l||e.dhcpd_wins_enabled&&(e.dhcpd_wins_1?this.validator.ip(e.dhcpd_wins_1)||(r.dhcpd_wins_1=s.localize(s.E_IncorrectIPAddress,e.dhcpd_wins_1)):r.dhcpd_wins_1=s.localize(s.E_CannotBeEmpty,s.G_SettingsDHCPWinsServer)),l&&"dhcpd_wins_2"!=l||e.dhcpd_wins_enabled&&e.dhcpd_wins_2&&!this.validator.ip(e.dhcpd_wins_2)&&(r.dhcpd_wins_2=s.localize(s.E_IncorrectIPAddress,e.dhcpd_wins_2)),l&&"radius_ip_1"!=l||(e.radius_ip_1?this.validator.ip(e.radius_ip_1)||(r.radius_ip_1=s.localize(s.E_IncorrectIPAddress,e.radius_ip_1)):"remote-user-vpn"==e.purpose&&(l||(r.radius_ip_1=s.localize(s.E_CannotBeEmpty,s.G_SettingsRadiusIP)))),l&&"dhcpd_ip_1"!=l||e.dhcpguard_enabled&&(e.dhcpd_ip_1?e.dhcpd_ip_1&&!this.validator.ip(e.dhcpd_ip_1)&&(r.dhcpd_ip_1=s.localize(s.E_IncorrectIPAddress,e.dhcpd_ip_1)):l?this.validator.ip(e.dhcpd_ip_1)||(r.dhcpd_ip_1=s.localize(s.E_IncorrectIPAddress,e.dhcpd_ip_1)):r.dhcpd_ip_1=s.localize(s.E_CannotBeEmpty,s.G_SettingsDHCPTrustedServerIp)),l&&"x_radius_secret_1"!=l||e.x_radius_secret_1||"remote-user-vpn"==e.purpose&&(l||(r.x_radius_secret_1=s.localize(s.E_CannotBeEmpty,s.G_SettingsRadiusPassword))),i.size(r)?r:void 0},enable:function(e){return this.save({enabled:!0},i.extend(e,{_method:"enable"}))},disable:function(e){return this.save({enabled:!1},i.extend(e,{_method:"disable"}))},rebuild:function(e){return this.sync("rebuild",this,e)},sync:function(e,t,i){if(i=i||{},i._method&&(e=i._method,delete i._method),"site-vpn"==this.get("purpose"))switch(e){case"create":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/sitemgr",i.type="POST",i.data=JSON.stringify({cmd:"add-site-vpn",name:this.get("name"),site:this.get("remote_site_id")});break;case"enable":case"disable":case"rebuild":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/sitemgr",i.type="POST",i.data=JSON.stringify({cmd:e+"-site-vpn",name:this.get("name"),site:this.get("remote_site_id")});break;case"delete":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/sitemgr",i.type="POST",i.data=JSON.stringify({cmd:"delete-site-vpn",site:this.get("remote_site_id")})}else switch(e){case"create":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/add/networkconf",i.type="POST";break;case"enable":case"disable":case"update":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/upd/networkconf/"+t.id,i.type="POST",i.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/del/networkconf/"+t.id,i.type="POST"}return n.sync.call(this,e,t,i)}})}),define("unifi/collection/Networks",["unifi/collection/Collection","underscore","unifi/model/Network"],function(e,t,i){"use strict";return e.extend({model:i,bySite:!0,parse:function(i){return i=e.prototype.parse.call(this,i),t.each(i,function(e,t){!e.purpose&&e.remote_site_id&&(i[t].purpose="site-vpn")}),i},filterByPurpose:function(e){return this.filter(function(i){return t.isArray(e)?-1!=t.indexOf(e,i.get("purpose")):i.get("purpose")==e})},url:function(){return"/api/s/"+SITE.name+"/list/networkconf"}})}),define("text!includes/settings/settingsNetworksTemplate.html",[],function(){return'<div class="section section-main">\n    <h1>\n        <span class="breadcrumb-home"><%- msg.G_SettingsNetworks %></span>\n        <span class="breadcrumb-child hidden">\n            <span class="ubnt-icon-arrow-right"></span>\n            <span class="breadcrumb"></span>\n        </span>\n    </h1>\n\n    <div class="section-home">\n        <div class="data-table untitled">\n            <div class="loading"><span><%- msg.N_Loading %></span></div>\n        </div>\n        <div class="buttons is-admin">\n            <button class="button tall auto white create-form hidden" data-type="create-form">\n                <span class="ui-button-icon ubnt-icon-gear gear"></span>\n                <%- msg.G_SettingsCreateNewNetwork %>\n            </button>\n        </div>\n    </div>\n    <div class="forms hidden"></div>\n</div>'}),define("unifi/view/settings/NetworksView",["unifi/view/settings/ListContentView","unifi/view/settings/NetworksFormView","underscore","jquery","ubnt/backgrid","unifi/collection/Networks","msg/Msg","text!includes/settings/settingsNetworksTemplate.html"],function(e,t,i,n,s,o,a,r){"use strict";return e.extend({id:"settingsNetworks",_templateId:i.template(r,{msg:a}),_formClass:t,_collectionType:{name:"Networks",Class:o},_pageable:!1,columns:function(){return[{name:"name",label:a.G_Name,editable:!1,cell:s.Cells.ComplexCell.extend({formatter:{fromRaw:n.proxy(function(e){if("site-vpn"==e.get("purpose")){var t=this.app.collection("Sites"),i=t.findWhere({_id:e.get("remote_site_id")}),n="";return i&&"admin"==i.get("role")&&(n=" (Site: "+i.get("desc")+")"),e.get("name")+n}return e.get("name")},this),toRaw:function(e){return e}}})},{name:"purpose",label:a.G_SettingsPurpose,editable:!1,cell:"string"},{name:"ip_subnet",label:a.G_SettingsSubnet,editable:!1,cell:s.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){return"site-vpn"==e.get("purpose")?(e.get("remote_site_subnets")||[]).join(", "):e.get("ip_subnet")},toRaw:function(e){return e}}})},{name:"vlan",label:a.G_SettingsVLAN,editable:!1,cell:"string"},{name:"enabled",label:a.G_Actions,editable:!1,sortable:!1,headerCell:s.Headers.noSortHeader,cell:s.Cells.ActionsCell.extend({actions:{edit:{icon:"ubnt-icon-edit",callback:this.rowEdit,render:function(e){return"site-vpn"!=e.get("purpose")}},"delete":{requiresAdminPrivilege:!0,icon:"ubnt-icon-trash",callback:this.rowDelete,options:this.app.collection("Sites"),render:function(e,t){if("site-vpn"==e.get("purpose")){var i=t.findWhere({_id:e.get("remote_site_id")});return i&&"admin"==i.get("role")}return!e.get("attr_no_delete")}}}})}]},rowRebuild:function(e){var t=this;e.rebuild({success:function(i,n,s){s.enabled&&t.options.app.views.app.flash("success","Success",a.localize(a.G_SettingsNetworkEnabled,e.get("name"))),e.set("enabled",!0)}})},rowEnable:function(e,t){var i=this,s=n(t.target);s.prop("disabled",!0),e.enable({wait:!0,success:function(t,n,s){s.enabled&&(i.options.app.views.app.flash("success","Success",a.localize(a.G_SettingsNetworkEnabled,e.get("name"))),e.set("enabled",s.enabled)),e.set("enabled",s.enabled)},error:function(e){i.options.app.views.app.flash("error","Error",a.apiError(e))},complete:function(){s.prop("disabled",!1)}})},rowDisable:function(e,t){var i=this,s=n(t.target);s.prop("disabled",!0),e.disable({wait:!0,success:function(){i.options.app.views.app.flash("success","Success",a.localize(a.G_SettingsNetworkDisabled,e.get("name")))},error:function(e){i.options.app.views.app.flash("error","Error",a.apiError(e))},complete:function(){s.prop("disabled",!1)}})}})}),define("unifi/view/app/ScheduleMixin",["jquery","underscore","libs/moment","msg/Msg"],function(e,t,i){"use strict";return{renderSchedule:function(){this.$el.find(".row").each(function(){var t=e(this),n=t.find(".day input[type=checkbox]"),s=t.find(".slider"),o=t.find(".hours");n.on("change",function(){e(this).is(":checked")?(o.show(),s.show()):(o.hide(),s.hide())}).trigger("change"),s.slider({range:!0,min:0,max:1439,step:15,slide:function(){e(this).slider("option","change").apply(this,arguments)},change:function(t,n){var s=e(this),a=Math.max(n.values[0],s.slider("option","min")),r=Math.floor(a/60),l=a-60*r,u=Math.min(n.values[1],s.slider("option","max")),c=Math.floor(u/60),d=u-60*c,h="h:mma";o.find("strong").text(i({hour:r,minute:l}).format(h)+"-"+i({hour:c,minute:d}).format(h))}}),s.slider("values",[480,1080])}),this._defaultSchedule&&this.populateSchedule(this._defaultSchedule)},populateSchedule:function(i){var n=this.$el.find(".day input[type=checkbox]");n.prop("checked",!1),i&&t.each(i,e.proxy(function(i){var n,s=i.match(/([a-z]+)(-([a-z]+))?\|([\d]+)-([\d]+)/),o=s[1],a=s[3],r=parseInt(s[4].substr(0,2),10),l=parseInt(s[4].substr(2),10),u=parseInt(s[5].substr(0,2),10),c=parseInt(s[5].substr(2),10);switch(o+"-"+a){case"mon-fri":n=["mon","tue","wed","thu","fri"];break;case"sat-sun":n=["sat","sun"];break;case"mon-sun":n=["mon","tue","wed","thu","fri","sat","sun"];break;default:n=[o]}t.each(n,e.proxy(function(e){this.$el.find("input[type=checkbox][name="+e+"]").prop("checked",!0),this.$el.find(".row."+e+" .slider").slider("values",[60*r+l,60*u+c])},this))},this)),n.trigger("change")},gatherSchedule:function(){var n=[];return t.each(["mon","tue","wed","thu","fri","sat","sun"],e.proxy(function(e){if(this.$el.find("input[type=checkbox][name="+e+"]").is(":checked")){var t,s,o=this.$el.find(".row."+e+" .slider").slider("values");t=i({hour:Math.floor(o[0]/60),minute:Math.round(60*(o[0]/60%1))}).format("HHmm"),s=i({hour:Math.floor(o[1]/60),minute:Math.round(60*(o[1]/60%1))}).format("HHmm"),n.push(e+"|"+t+"-"+s)}},this)),n},removeSchedule:function(){return this.$el.find(".row input[type=checkbox]").off(),!1}}}),define("text!includes/settings/settingsWirelessNetworksFormTemplate.html",[],function(){return'<form class="complex-form hours-form">\n    <h2><%- headline %> <span class="group"><%- msg.G_SettingsWLANGroup %>: <%- group %></span></h2>\n\n    <fieldset class="basic">\n        <div class="fields">\n            <div>\n                <label for="wirelessNetworkName<%- id %>"><%- msg.G_SettingsNameSSID %></label>\n                <input type="text" id="wirelessNetworkName<%- id %>" name="name" value="" />\n            </div>\n            <div>\n                <label for="wirelessNetworkEnabled<%- id %>"><%- msg.G_Enabled %></label>\n                <input type="checkbox" id="wirelessNetworkEnabled<%- id %>" name="enabled" value="1" checked="checked" />\n            </div>\n            <div>\n                <label><%- msg.G_Security %></label>\n                <div class="buttonset security">\n                    <span class="roam-enabled">\n                        <input type="radio" id="wirelessNetworkSecurityOpen<%- id %>" name="security" value="open" checked="checked" />\n                        <label for="wirelessNetworkSecurityOpen<%- id %>"><%- msg.G_Open %></label>\n                    </span>\n                    <span class="roam-enabled">\n                        <input type="radio" id="wirelessNetworkSecurityWep<%- id %>" name="security" value="wep" />\n                        <label for="wirelessNetworkSecurityWep<%- id %>"><%- msg.G_SettingsWEP %></label>\n                    </span>\n                    <input type="radio" id="wirelessNetworkSecurityWpaPersonal<%- id %>" name="security" value="wpapsk" />\n                    <label for="wirelessNetworkSecurityWpaPersonal<%- id %>"><%- msg.G_SettingsWPAPersonal %></label>\n                    <input type="radio" id="wirelessNetworkSecurityWpaEnterprise<%- id %>" name="security" value="wpaeap" />\n                    <label for="wirelessNetworkSecurityWpaEnterprise<%- id %>"><%- msg.G_SettingsWPAEnterprise %></label>\n                </div>\n            </div>\n            <div class="security-toggled security-wep">\n                <label for="wirelessNetworkWepKey<%- id %>"><%- msg.G_SettingsWEPKey %></label>\n                <input type="password" id="wirelessNetworkWepKey<%- id %>" name="x_wep" value="" />\n                <span><%- msg.G_SettingsKeyIndex %></span>\n                <span>\n                    <select id="wirelessNetworkWepKeyIndex<%- id %>" name="wep_idx">\n                        <option value="1">1</option>\n                        <option value="2">2</option>\n                        <option value="3">3</option>\n                        <option value="4">4</option>\n                    </select>\n                </span>\n            </div>\n            <div class="security-toggled security-wpapsk">\n                <label for="wirelessNetworkSecurityKey<%- id %>"><%- msg.G_SettingsSecurityKey %></label>\n                <input type="password" id="wirelessNetworkSecurityKey<%- id %>" name="x_passphrase" value="" />\n            </div>\n            <div class="security-toggled security-wpaeap">\n                <label class="addableLabel"><%- msg.G_SettingsRadiusServer %></label>\n                <div class="addable radius">\n                    <div class="row">\n                        <span class="serverIndex"></span>\n                        <span><%- msg.G_IPAddress %></span>\n                        <input type="text" id="wirelessNetworkSecurityRadiusIp" name="radius_ip" value="" />\n                        <span><%- msg.G_Port %></span>\n                        <input type="text" id="wirelessNetworkSecurityRadiusPort" name="radius_port" size="4" value="1812" />\n                        <span><%- msg.G_PW %></span>\n                        <input type="password" id="wirelessNetworkSecurityRadiusPassword" name="x_radius_secret" value="" autocomplete="off" />\n                        <button class="button icon-only"><span class="ubnt-icon-close remove"></span></button>\n                    </div>\n                </div>\n            </div>\n            <div class="security-toggled security-wpaeap">\n                <label class="addableLabel"><%- msg.G_SettingsRadiusAccountingServer %></label>\n                <div class="addable radius_acct">\n                    <div class="row">\n                        <span class="serverIndex"></span>\n                        <span><%- msg.G_IPAddress %></span>\n                        <input type="text" name="radius_acct_ip" value="" autocomplete="off"/>\n                        <span><%- msg.G_Port %></span>\n                        <input type="text" name="radius_acct_port" size="4" value="1813" />\n                        <span><%- msg.G_PW %></span>\n                        <input type="password" name="x_radius_acct_secret" value="" autocomplete="off" />\n                        <button class="button icon-only"><span class="ubnt-icon-close remove"></span></button>\n                    </div>\n                </div>\n            </div>\n            <div>\n                <label for="wirelessNetworkGuestPolicy<%- id %>"><%- msg.G_SettingsGuestPolicy %></label>\n                <input type="checkbox" id="wirelessNetworkGuestPolicy<%- id %>" name="guest-policy" value="1" />\n                <span><%- msg.G_SettingsApplyGuestPolicies %></span>\n            </div>\n        </div>\n    </fieldset>\n\n    <fieldset class="advanced">\n        <legend class="toggle"><%- msg.G_SettingsAdvancedOpts %> <span class="ubnt-icon-arrow-down secondary-color"></span></legend>\n        <div class="fields">\n            <div>\n                <label for="wirelessNetworkUseVlanId<%- id %>"><%- msg.G_SettingsVLAN %></label>\n                <input type="checkbox" id="wirelessNetworkUseVlanId<%- id %>" name="use-vlan-id" value="1" />\n                <span><%- msg.G_SettingsUseVLANId %></span>\n                <input type="text" id="wirelessNetworkVlan<%- id %>" name="vlan" size="4" value="" />\n                <span>(2-4095)</span>\n            </div>\n            <div class="roam-enabled">\n                <label for="wirelessNetworkHideSsid<%- id %>"><%- msg.G_SettingsHideSSID %></label>\n                <input type="checkbox" id="wirelessNetworkHideSsid<%- id %>" name="hide-ssid" value="1" />\n            </div>\n            <div class="security-toggled security-wpapsk security-wpaeap roam-enabled">\n                <label for="wirelessNetworkWpaMode<%- id %>"><%- msg.G_SettingsWPAMode %></label>\n                <div class="select">\n                    <select id="wirelessNetworkWpaMode<%- id %>" name="wpa-mode">\n                        <option value="auto"><%- msg.G_Both %></option>\n                        <option value="wpa1"><%- msg.G_SettingsWPA1Only %></option>\n                        <option value="wpa2"><%- msg.G_SettingsWPA2Only %></option>\n                    </select>\n                </div>\n\n                <label for="wirelessNetworkEncryption<%- id %>"><%- msg.G_Encryption %></label>\n                <div class="select">\n                    <select id="wirelessNetworkEncryption<%- id %>" name="encryption">\n                        <option value="auto"><%- msg.G_Auto %></option>\n                        <option value="tkip"><%- msg.G_SettingsTKIPOnly %></option>\n                        <option value="ccmp"><%- msg.G_SettingsAESCCMPOnly %></option>\n                    </select>\n                </div>\n            </div>\n            <div>\n                <label for="wirelessNetworkUserGroup<%- id %>"><%- msg.G_SettingsUserGroup %></label>\n                <div class="select">\n                    <select id="wirelessNetworkUserGroup<%- id %>" name="user-group">\n                        <!-- to be populated by the view -->\n                    </select>\n                </div>\n            </div>\n            <div>\n                <label for="wirelessNetworkUAPSDEnable"><%- msg.G_SettingsUAPSD %></label>\n                <input type="checkbox" id="wirelessNetworkUAPSDEnable" name="enable-uapsd" value="1" />\n                <span><%- msg.G_SettingsEnableUAPSD %></span>\n            </div>\n            <div>\n                <label for="wirelessNetworkScheduleEnable"><%- msg.G_SettingsScheduled %></label>\n                <input type="checkbox" id="wirelessNetworkScheduleEnable" name="enable-schedule" value="1" />\n                <span><%- msg.G_SettingsEnableWLANSchedule %></span>\n            </div>\n        </div>\n    </fieldset>\n\n    <fieldset class="schedule sliders">\n        <div class="row mon">\n            <label class="day"><input type="checkbox" name="mon" /> <%- msg.G_CalendarMonday %></label>\n            <div class="hours"><%- msg.G_SettingsScheduleHours %>: <strong></strong></div>\n            <div class="slider"></div>\n        </div>\n        <div class="row tue">\n            <label class="day"><input type="checkbox" name="tue" /> <%- msg.G_CalendarTuesday %></label>\n            <div class="hours"><%- msg.G_SettingsScheduleHours %>: <strong></strong></div>\n            <div class="slider"></div>\n        </div>\n        <div class="row wed">\n            <label class="day"><input type="checkbox" name="wed" /> <%- msg.G_CalendarWednesday %></label>\n            <div class="hours"><%- msg.G_SettingsScheduleHours %>: <strong></strong></div>\n            <div class="slider"></div>\n        </div>\n        <div class="row thu">\n            <label class="day"><input type="checkbox" name="thu" /> <%- msg.G_CalendarThursday %></label>\n            <div class="hours"><%- msg.G_SettingsScheduleHours %>: <strong></strong></div>\n            <div class="slider"></div>\n        </div>\n        <div class="row fri">\n            <label class="day"><input type="checkbox" name="fri" /> <%- msg.G_CalendarFriday %></label>\n            <div class="hours"><%- msg.G_SettingsScheduleHours %>: <strong></strong></div>\n            <div class="slider"></div>\n        </div>\n        <div class="row sat">\n            <label class="day"><input type="checkbox" name="sat" /> <%- msg.G_CalendarSaturday %></label>\n            <div class="hours"><%- msg.G_SettingsScheduleHours %>: <strong></strong></div>\n            <div class="slider"></div>\n        </div>\n        <div class="row sun">\n            <label class="day"><input type="checkbox" name="sun" /> <%- msg.G_CalendarSunday %></label>\n            <div class="hours"><%- msg.G_SettingsScheduleHours %>: <strong></strong></div>\n            <div class="slider"></div>\n        </div>\n    </fieldset>\n\n    <fieldset class="actions">\n        <button type="button" class="button tall auto white cancel"><span class="ui-button-icon ubnt-icon-close"></span><%- msg.G_Cancel %></button>\n        <button type="submit" class="button tall auto green save is-admin"><span class="ui-button-icon ubnt-icon-check"></span><%- msg.G_Save %></button>\n    </fieldset>\n</form>\n'
}),define("unifi/view/settings/WirelessNetworksFormView",["unifi/view/settings/FormView","unifi/view/app/ScheduleMixin","unifi/view/app/ValidatorMixin","underscore","jquery","msg/Msg","text!includes/settings/settingsWirelessNetworksFormTemplate.html","ubnt/ubnt.addable"],function(e,t,i,n,s,o,a){"use strict";return e.extend(n.extend({},t,{_templateId:a,_defaultSchedule:["mon-sun|0800-1800"],_prevalidate:{name:{input:"text"},x_wep:{input:"password",complex:!0},x_passphrase:{input:"password",complex:!0},radius_ip_1:{input:"text",complex:!0},radius_port_1:{input:"text",complex:!0},x_radius_secret_1:{input:"password",complex:!0},radius_ip_2:{input:"text",complex:!0},radius_port_2:{input:"text",complex:!0},x_radius_secret_2:{input:"password",complex:!0},radius_ip_3:{input:"text",complex:!0},radius_port_3:{input:"text",complex:!0},x_radius_secret_3:{input:"password",complex:!0},radius_ip_4:{input:"text",complex:!0},radius_port_4:{input:"text",complex:!0},x_radius_secret_4:{input:"password",complex:!0},vlan:{input:"text",complex:!0},"use-vlan-id":{input:"text",onchange:"vlan"}},render:function(){var t=this.rendered;if(e.prototype.render.call(this,!0),!t){this.renderSchedule();var i=this.$el.find("select[name=user-group]").empty();if(this.groups.user.each(function(e){i.append(s('<option value="'+e.id+'"></option>').prop("selected",e.get("attr_no_delete")).text(e.get("name")))},this),i.trigger("change"),i.selectmenu("refresh"),this.model&&this.groups.wlan&&this.groups.wlan.get("roam_enabled")){var a=this.$el.find(".buttonset.security");a.buttonset("destroy"),this.$el.find(".roam-enabled").remove(),a.find("input[type=radio]").first().prop("checked",!0),a.buttonset()}n.defer(s.proxy(function(){this.$el.find(".buttonset input[name=security]").radiotoggle({container:this.$el})},this)),n.each(["radius","radius_acct"],function(e){var t=this,i=this.$el.find("div.addable."+e),a=this.model._addableSettings[e].min,r=this.model._addableSettings[e].max;i.sortable({cursor:"move",items:"div.row",update:function(){var e=i.hasClass("radius_acct")?"radius_acct":"radius";l(),t.validateRadius(e)}});var l=function(){var e=i.find(".row"),t=s(e).length,o=1;n.each(e,function(e){var t=s(e);t.hasClass("error-msg")||t.find(".serverIndex").text(o++ +" ")},this),!a||t>a?i.find(".row button").removeClass("hidden"):i.find(".row button").addClass("hidden"),t>1?(i.sortable("option","disabled",!1),i.find("div.row").css("cursor","move")):(i.sortable("option","disabled",!0),i.find("div.row").css("cursor","inherit"))};i.addable({min:a,max:r,template:i.find("> div.row").clone(),add:s('<button class="button addable">'+("radius"==e?o.G_AddNewRadius:o.G_AddNewRadiusAccounting)+"</button>"),added:function(e){e.find("button").on("click",function(e){return e.preventDefault(),i.addable("remove",s(this)),!1}),l(),e.find("input[type=password]").password({suffix:"-text"})},removed:function(){var e=this.element.hasClass("radius_acct")?"radius_acct":"radius";l(),t.validateRadius(e)}}),i.children(":not(button.addable)").remove(),i.addable("reset")},this),this.$el.find("input[name=use-vlan-id]").on("change",function(){var e=s(this);e.is(":checked")?e.parent().find("input").not(e).prop("disabled",!1):e.parent().find("input").not(e).prop("disabled",!0)}).trigger("change");var r=this.$el.find("fieldset.schedule");this.$el.find("input[name=enable-schedule]").on("change",function(){var e=s(this);e.is(":checked")?r.show():r.hide()}).trigger("change")}this.populate()},args:function(){return{id:this.id,headline:this.create?o.G_SettingsCreateNewWirelessNetwork:o.G_SettingsEditWirelessNetwork+" - "+this.model.get("name"),group:this.groups.wlan.get("name"),msg:o}},populate:function(){if(this.model){this.$el.find("input[name=name]").val(this.model.get("name")),this.$el.find("input[name=enabled]").prop("checked",this.model.get("enabled")),this.$el.find("input[name=security][value="+this.model.get("security")+"]").prop("checked",!0).trigger("change"),this.$el.find("input[name=x_wep]").val(this.model.get("x_wep")),this.$el.find("select[name=wep_idx]").val(this.model.get("wep_idx")),this.$el.find("input[name=x_passphrase]").val(this.model.get("x_passphrase")),this.$el.find("input[name=guest-policy]").prop("checked",this.model.get("is_guest")),this.$el.find("input[name=use-vlan-id]").prop("checked",this.model.get("vlan_enabled")),this.$el.find("input[name=vlan]").val(this.model.get("vlan")),this.$el.find("input[name=hide-ssid]").prop("checked",this.model.get("hide_ssid")),this.$el.find("input[name=enable-uapsd]").prop("checked",this.model.get("uapsd_enabled")),this.$el.find("input[name=enable-schedule]").prop("checked",this.model.get("schedule_enabled")).trigger("change"),this.$el.find("select[name=wpa-mode]").val(this.model.get("wpa_mode")||"wpa2").trigger("change"),this.$el.find("select[name=encryption]").val(this.model.get("wpa_enc")||"ccmp").trigger("change"),this.$el.find("input[name=use-vlan-id]").trigger("change"),n.each(["radius","radius_acct"],function(e){var t=this.$el.find("div.addable."+e),i=this.model._addableSettings[e].min,n=this.model._addableSettings[e].max,s=this.model._addableSettings[e].defaultPort;t.addable("reset",!0);for(var o=1,a=null,r=null,l=null;n>=o;o++)(a=this.model.get(e+"_ip_"+o))&&(r=this.model.get(e+"_port_"+o)||s,l=this.model.get("x_"+e+"_secret_"+o),t.addable("add").addable("last").find('input[name="'+e+'_ip"]').val(a).end().find('input[name="'+e+'_port"]').val(r).end().find('input[name="x_'+e+'_secret"]').val(l));i&&0===parseInt(t.addable("count"),10)&&t.addable("add")},this),this.$el.find("select[name=user-group]").find("option[value="+this.model.get("usergroup_id")+"]").prop("selected",!0).end().trigger("change");var e=this.model.get("schedule");e&&this.populateSchedule(e)}},gather:function(){var e={name:this.$el.find("input[name=name]").val(),enabled:this.$el.find("input[name=enabled]").is(":checked"),security:this.$el.find("input[name=security]:checked").val(),x_wep:this.$el.find("input[name=x_wep]").val(),wep_idx:this.$el.find("select[name=wep_idx] option:selected").val(),x_passphrase:this.$el.find("input[name=x_passphrase]").val(),is_guest:this.$el.find("input[name=guest-policy]").is(":checked"),vlan_enabled:this.$el.find("input[name=use-vlan-id]").is(":checked"),vlan:this.$el.find("input[name=vlan]").val(),hide_ssid:this.$el.find("input[name=hide-ssid]").is(":checked"),uapsd_enabled:this.$el.find("input[name=enable-uapsd]").is(":checked"),schedule_enabled:this.$el.find("input[name=enable-schedule]").is(":checked"),wpa_mode:this.$el.find("select[name=wpa-mode] option:selected").val(),wpa_enc:this.$el.find("select[name=encryption] option:selected").val(),usergroup_id:this.$el.find("select[name=user-group] option:selected").val(),wlangroup_id:this.groups.wlan.id,schedule:[]};return e.vlan_enabled||delete e.vlan,"wpaeap"===e.security&&n.each(["radius","radius_acct"],function(t){for(var i=this.$el.find("div.addable."+t+" > div"),n=i.length,s=(this.model._addableSettings[t].min,this.model._addableSettings[t].max),o=1;s>=o;o++){var a=o-1,r=n>a?i.eq(a):null;e[t+"_ip_"+o]=r?r.find('input[name="'+t+'_ip"]').val()||null:"",e[t+"_port_"+o]=r?r.find('input[name="'+t+'_port"]').val()||null:"",e["x_"+t+"_secret_"+o]=r?r.find('input[name="x_'+t+'_secret"]').val()||null:""}},this),e.schedule_enabled&&(e.schedule=this.gatherSchedule()),e},validateRadius:function(e){var t=this.$el.find(".addable."+e),i=t.find(".row"),o=!0;this.valid(e),n.each(i,function(t){if(o){var i=['input[name="'+e+'_ip"]','input[name="'+e+'_port"]','input[name="x_'+e+'_secret"]'];n.each(i,function(e){if(o){var i=s(t).find(e);o=this.validateRadiusElement(i)}},this)}},this)},validateRadiusElement:function(e){var t=this,i=null;if(t.model){var n=e.attr("name"),s=e.parent().index();e.closest(".addable").find("div:first-child").hasClass("error-msg")||(s+=1),i=t.model.validate(t.gather(),{partial:n+"_"+s}),i&&t.invalid(i)}return!i},prevalidator:function(){i.prevalidator.call(this);var e=this;n.each(["radius","radius_acct"],function(t){var i=['input[name="'+t+'_ip"]','input[name="'+t+'_port"]','input[name="x_'+t+'_secret"]'];this.$el.on("change",i.join(", "),function(){e.validateRadius(t)})},this)},valid:function(e){var t=(i.valid.call(this,e),-1!==e.indexOf("radius_acct")?"radius_acct":-1!==e.indexOf("radius")?"radius":e);switch(t){case"radius":case"radius_acct":var n=e.split("_"),s=(n.join("_"),['input[name="'+t+'_ip"]','input[name="'+t+'_port"]','input[name="x_'+t+'_secret"]']);this.$el.find(".addable."+t+" .row").find(s.join(", ")).removeClass("error"),this.$el.find(".addable."+t+" .error-msg").remove()}},invalid:function(e){i.invalid.call(this,e);n.each(e,function(e,t){var i=-1!==t.indexOf("radius_acct")?"radius_acct":-1!==t.indexOf("radius")?"radius":t;switch(i){case"radius":case"radius_acct":if(0===this.$el.find(".addable."+i+" .error-msg").length){var n=t.split("_"),o=n.splice(n.length-1,1)[0],a=n.join("_");this.$el.find(".addable."+i+" .row:nth-child("+o+")").find('input[name="'+a+'"]').addClass("error"),s('<div class="error-msg">'+e+"</div>").insertBefore(this.$el.find(".addable."+i+" .row:first-child"))}}},this)},remove:function(){this.$el.find(".buttonset input[name=security][value=wpaeap]").off(),this.$el.find("input[name=use-vlan-id]").off("change"),this.$el.find("input[name=enable-schedule]").off("change"),this.$el.off("change"),this.removeSchedule(),this.rendered=!1,e.prototype.remove.apply(this,arguments)}}))}),define("text!includes/settings/settingsWirelessNetworksGroupFormTemplate.html",[],function(){return'<form class="complex-form">\n    <h2><%- headline %></h2>\n    <fieldset class="basic">\n        <div class="fields basic">\n            <div>\n                <label for="wlanGroupName<%- id %>"><%- msg.G_Name %></label>\n                <input type="text" id="wlanGroupName<%- id %>" name="name" value="" />\n            </div>\n            <div>\n                <label for="wlanGroupRoaming<%- id %>"><%- msg.G_SettingsMobility %></label>\n                <input type="checkbox" id="wlanGroupRoaming<%- id %>" name="roaming-enabled" value="1" />\n                <span><%- msg.G_SettingsEnblSmlssRoaming %></span>\n            </div>\n        </div>\n\n        <div class="fields mobility">\n            <div>\n                <label for="wlanGroupRoamingRadio<%- id %>"><%- msg.G_SettingsRadio %></label>\n                <div class="select">\n                    <select id="wlanGroupRoamingRadio<%- id %>" name="roaming-radio">\n                        <option value="ng"><%- msg.G_Settings2G802 %></option>\n                        <option value="na"><%- msg.G_Settings5G802 %></option>\n                    </select>\n                </div>\n            </div>\n            <div class="roaming-channel roaming-channel-ng">\n                <label for="wlanGroupRoamingChannelNg<%- id %>"><%- msg.G_Channel %></label>\n                <div class="select">\n                   <select id="wlanGroupRoamingChannelNg<%- id %>" name="roaming-channel-ng"></select>\n               </div>\n            </div>\n            <div class="roaming-channel roaming-channel-na">\n                <label for="wlanGroupRoamingChannelNa<%- id %>"><%- msg.G_Channel %></label>\n                <div class="select">\n                   <select id="wlanGroupRoamingChannelNa<%- id %>" name="roaming-channel-na"></select>\n                </div>\n            </div>\n        </div>\n        <div class="fields etc">\n            <div>\n                <label for="wlanGroupLoadBalancingEnabled<%- id %>"><%- msg.G_SettingsLoadBalancing %></label>\n                <input type="checkbox" id="wlanGroupLoadBalancingEnabled<%- id %>" name="load-balancing-enabled" value="1" />\n                <span><%- msg.G_SettingsBalanceNumbrClnts %></span>\n                <input type="text" id="wlanGroupLoadBalancingClients<%- id %>" name="maxsta" size="4" value="" />\n            </div>\n            <div>\n                <label for="wlanGroupLegacySupportEnabled<%- id %>"><%- msg.G_SettingsLegacySupport %></label>\n                <input type="checkbox" id="wlanGroupLegacySupportEnabled<%- id %>" name="legacy-support-enabled" value="1" />\n                <span><%- msg.G_SettingsEnblLegacyDevice %></span>\n            </div>\n        </div>\n    </fieldset>\n\n    <fieldset class="actions">\n        <button type="button" class="button tall auto white cancel"><span class="ui-button-icon ubnt-icon-close"></span><%- msg.G_Cancel %></button>\n        <button type="submit" class="button tall auto green save is-admin"><span class="ui-button-icon ubnt-icon-check"></span><%- msg.G_Save %></button>\n    </fieldset>\n</form>\n'}),define("unifi/model/SystemInfo",["unifi/model/Model","underscore","backbone"],function(e,t,i){"use strict";return e.extend({backup:function(e){return this.sync("backup",this,e)},setBackupDays:function(e){return this.sync("backupDays",this,e)},restore:function(e){return this.sync("restore",this,e)},downloadSupportLink:function(e){return this.sync("downloadSupportLink",this,e)},setDebugLevel:function(e){return this.sync("setDebugLevel",this,e)},sync:function(e,t,n){switch(n=n||{},e){case"backup":n.url="/api/s/"+SITE.name+"/cmd/system",n.contentType="application/json; charset=utf-8",n.type="POST",n.data=JSON.stringify({cmd:"backup",days:n.days});break;case"restore":n.url="/api/s/"+SITE.name+"/cmd/system",n.contentType="application/json; charset=utf-8",n.type="POST",n.data=JSON.stringify({cmd:"restore"});break;case"downloadSupportLink":n.url="/api/s/"+SITE.name+"/cmd/system",n.contentType="application/json; charset=utf-8",n.type="POST",n.data=JSON.stringify({cmd:"support",userAgent:navigator.userAgent,language:navigator.language});break;case"backupDays":n.url="/api/s/"+SITE.name+"/cmd/system",n.contentType="application/json; charset=utf-8",n.type="POST",n.data=JSON.stringify({cmd:"set-param",key:"download_timeframe",value:n.days});break;case"setDebugLevel":n.url="/api/s/"+SITE.name+"/cmd/system",n.contentType="application/json; charset=utf-8",n.type="POST",n.data=JSON.stringify({cmd:"set-param",key:"debug."+n.debug_type,value:n.debug_value})}return i.sync.call(this,e,t,n)}})}),define("unifi/collection/SystemInfos",["unifi/collection/Collection","backbone","unifi/model/SystemInfo"],function(e,t,i){"use strict";return e.extend({model:i,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/sysinfo"}})}),define("unifi/view/settings/WirelessNetworksGroupFormView",["unifi/view/settings/FormView","underscore","jquery","msg/Msg","text!includes/settings/settingsWirelessNetworksGroupFormTemplate.html","unifi/collection/SystemInfos"],function(e,t,i,n,s,o){"use strict";return e.extend({_templateId:s,_prevalidate:{name:{input:"text"},maxsta:{input:"text",complex:!0},"load-balancing-enabled":{onchange:"maxsta"}},initialize:function(t){e.prototype.initialize.call(this,t),this.app=t.app,i.when(this._dependencies=i.Deferred()).then(this.populate,this.failed),this.dependencies()},dependencies:function(){var e={SystemInfos:o},n=[],s={},a=this;t.each(e,function(e,t){n.push(s[t]=i.Deferred())},this),i.when.apply(i,n).then(function(){a._dependencies.resolve()},function(){a._dependencies.reject()}),t.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:s[t]}},e)},this)},render:function(){var t=this.rendered;if(e.prototype.render.call(this,!0),!t){var n=this;this.$el.find("select[name=roaming-radio]").on("change",this.updateChannelSelectCallback),this.$el.find("input[name=roaming-enabled]").on("change",function(){i(this).is(":checked")?(n.$el.find("div.fields.mobility").show(),n.$el.find("div.fields.etc").hide(),n.$el.find("select[name=roaming-radio]").trigger("change")):(n.$el.find("div.fields.mobility").hide(),n.$el.find("div.fields.etc").show())}),this.$el.find("input[name=minimum-rssi-enabled], input[name=load-balancing-enabled]").on("change",function(){var e=i(this);e.is(":checked")?e.parent().find("input").not(e).prop("disabled",!1):e.parent().find("input").not(e).prop("disabled",!0)}),this.create||(this.$el.find("select[name=roaming-radio]").disable(),this.$el.find("input[name=roaming-enabled]").prop("disabled",!0))}this.populate()},args:function(){return{id:this.id,headline:this.create?n.G_SettingsAddWLANGroup:n.G_SettingsEditWLANGroup+" - "+this.model.get("name"),msg:n}},populate:function(){this._dependencies&&"resolved"==this._dependencies.state()&&(this.model&&(this.$el.find("input[name=name]").val(this.model.get("name")),this.$el.find("input[name=roaming-enabled]").prop("checked",this.model.get("roam_enabled")).trigger("change"),this.$el.find("select[name=roaming-radio]").val(this.model.get("roam_radio")||"ng").trigger("change"),this.$el.find("input[name=load-balancing-enabled]").prop("checked",this.model.get("loadbalance_enabled")),this.$el.find("input[name=maxsta]").val(this.model.get("maxsta")||30),this.$el.find("input[name=legacy-support-enabled]").prop("checked",this.model.get("b_supported"))),this.$el.find("input[name=minimum-rssi-enabled], input[name=load-balancing-enabled]").trigger("change"))},gather:function(){var e=this.$el.find("input[name=load-balancing-enabled]").is(":checked"),t=this.$el.find("select[name=roaming-radio] option:selected").val(),i={name:this.$el.find("input[name=name]").val(),roam_enabled:this.$el.find("input[name=roaming-enabled]").is(":checked"),roam_radio:this.$el.find("select[name=roaming-radio] option:selected").val(),loadbalance_enabled:this.$el.find("input[name=load-balancing-enabled]").is(":checked"),b_supported:this.$el.find("input[name=legacy-support-enabled]").is(":checked")};return"na"==t?i.roam_channel_na=this.$el.find("select[name=roaming-channel-na]").val():i.roam_channel_ng=this.$el.find("select[name=roaming-channel-ng]").val(),i.maxsta=e?this.$el.find("input[name=maxsta]").val():"",i},updateChannelSelectCallback:function(e){var n=i(e.target).val(),s=this.$el.find('select[name="roaming-channel-'+n+'"]');if(this.$el.find(".roaming-channel").hide(),this.$el.find(".roaming-channel-"+n).show(),s.empty(),this._dependencies&&"resolved"==this._dependencies.state()){var o=this.app.collection("SystemInfos").at(0).get("cur_ccode");if("na"==n){var a=t.difference(o.channels_na,o.channels_na_dfs);t.each(a,i.proxy(function(e){var t=i("<option />").attr("value",e).text(e);s.append(t)},this)),this.$el.find("select[name=roaming-channel-na]").val(this.model.get("roam_channel_na")||this.$el.find("select[name=roaming-channel-na]").find("option:first").val()).trigger("change")}else t.each(o.channels_ng,i.proxy(function(e){var t=i("<option />").attr("value",e).text(e);s.append(t)},this)),this.$el.find("select[name=roaming-channel-ng]").val(this.model.get("roam_channel_ng")||this.$el.find("select[name=roaming-channel-ng]").find("option:first").val()).trigger("change")}},remove:function(){this.$el.find("select[name=roaming-radio]").off("change"),this.$el.find("input[name=roaming-enabled]").off("change"),this.$el.find("input[name=minimum-rssi-enabled], input[name=load-balancing-enabled]").off("change"),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("ubnt/view/uicomponents/SelectMenuView",["backbone","underscore","jquery"],function(e,t,i){"use strict";return t.extend(e.Model.prototype,{getSelectMenuLabel:function(){if(void 0!==this.get("roam_enabled")&&this.get("roam_enabled")){var e,t=this.get("roam_radio");return"na"===t?e=this.get("roam_channel_na"):"ng"===t&&(e=this.get("roam_channel_ng")),this.get("name")+" (Zero-Handoff, radio "+t+", channel "+e+")"||"Unlabeled"}return this.get("name")||"Unlabeled"}}),e.View.extend({_fullyQualifiedName:"UBNT.views.uicomponents.SelectMenu",initialize:function(){t.bindAll(this),this.isRendered=!1,this.isComparatorSort=this.options.isComparatorSort,this.value=this.options.value,this.collections=this.options.collections,this.render()},render:function(){return this.isComparatorSort&&(this.collection.comparator=function(e){return e.get("name").toLowerCase()},this.collection.sort()),this.options.defaultOption&&("string"==typeof this.options.defaultOption?this.$el.append(i('<option value=""></option>').text(this.options.defaultOption).addClass("permanent")):"object"==typeof this.options.defaultOption&&this.$el.append(i("<option></option>").text(this.options.defaultOption.label).val(this.options.defaultOption.value).addClass("permanent"))),this.reset(),this.enable(),this},set:function(e){var t=this;t.value=e,e?(t.$el.val(t.value),t.$el.selectmenu("refresh",!0)):t.$el.find("option:first").click()},addOption:function(e,t){if(!this.options.addable||this.options.addable(e,t)){var n=i("<option></option>").val(e.id).text(e.getSelectMenuLabel());t?t.append(n):this.$el.append(n)}},reset:function(){var e=this;this.value=this.$el.val()||this.value,this.collections?(this.$el.find("option:not(.permanent)").remove(),t.each(this.collections,function(e){var t=i("<optgroup></optgroup>").attr("label",e.label);this.$el.append(t),e.collection.each(function(e){this.addOption(e,t)},this)},this)):this.collection&&(this.$el.find("option:not(.permanent)").remove(),this.collection.each(function(e){this.addOption(e)},this)),this.$el.selectmenu({parent:this.$el.parent(),appendTo:this.$el.parent(),icons:{button:"ubnt-icon-arrow-down secondary-color"},create:this.options.create||i.noop,width:this.options.width||this.constructor.WIDTH,menuWidth:this.options.menuWidth||this.options.width||this.constructor.WIDTH,value:this.value,transferClasses:!0,change:function(t){e.$el.trigger("change"),t.preventDefault()}}),this.value&&this.set(this.value)},change:function(){this.render()},enable:function(){var e=this;e.collection&&(e.collection.bind("add",e.reset,e),e.collection.bind("reset",e.reset,e),e.collection.bind("change",e.reset,e),e.collection.bind("remove",e.reset,e)),e.$el.bind("change",function(){e.$el.trigger("click")}),e.reset()},disable:function(){this.collection&&(this.collection.unbind("add",this.reset),this.collection.unbind("reset",this.reset),this.collection.unbind("change",this.reset),this.collection.unbind("remove",this.reset)),this.$el.unbind("change")},remove:function(){this.disable(),e.View.prototype.remove.apply(this,arguments)}},{WIDTH:300})}),define("unifi/model/WlanGroup",["unifi/model/Model","underscore","backbone","msg/Msg"],function(e,t,i,n){"use strict";return e.extend({validate:function(e,i){var s={},o=i?i.partial:null;return o&&"name"!=o||(e.name?this.validator.name(e.name)||(s.name=n.localize(n.E_InvalidName,n.G_Name)):s.name=n.localize(n.E_CannotBeEmpty,n.G_Name)),o&&"maxsta"!=o||e.loadbalance_enabled&&(e.maxsta?this.validator.range(e.maxsta,1,65535)||(s.maxsta=n.localize(n.G_MaximumNumberClnts,1,128)):s.maxsta=n.localize(n.E_CannotBeEmpty,n.G_SettingsNumClients)),t.size(s)?s:void 0},sync:function(e,t,n){switch(e){case"create":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/add/wlangroup",n.type="POST";break;case"update":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/upd/wlangroup/"+this.id,n.type="POST",n.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/del/wlangroup/"+this.id,n.type="POST"}return i.sync.call(this,e,t,n)}})}),define("unifi/collection/WlanGroups",["unifi/collection/Collection","unifi/model/WlanGroup"],function(e,t){"use strict";return e.extend({model:t,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/list/wlangroup"},getDefault:function(){return this.find(function(e){return e.get("attr_no_delete")===!0&&!e.get("attr_hidden")})}})}),define("unifi/model/Wlan",["unifi/model/Model","underscore","backbone","msg/Msg"],function(e,t,i,n){"use strict";return e.extend({_addableSettings:{radius:{min:1,max:4,defaultPort:1812},radius_acct:{min:0,max:4,defaultPort:1813}},validate:function(e,i){var s={},o=i?i.partial:null;switch(o&&"name"!=o||(e.name?this.validator.ssid(e.name)||(s.name=n.localize(n.E_InvalidSSID,n.G_Name)):o||(s.name=n.localize(n.E_CannotBeEmpty,n.G_Name))),e.security){case"wep":o&&"x_wep"!=o||(e.x_wep?this.validator.wep(e.x_wep)||(s.x_wep=n.localize(n.E_InvalidWEP,n.G_SettingsWEPKey)):s.x_wep=n.localize(n.E_CannotBeEmpty,n.G_SettingsWEPKey));break;case"wpapsk":o&&"x_passphrase"!=o||(e.x_passphrase?this.validator.password(e.x_passphrase)||(s.x_passphrase=n.localize(n.E_InvalidPassphrase,n.G_SettingsSecurityKey)):s.x_passphrase=n.localize(n.E_CannotBeEmpty,n.G_SettingsSecurityKey));break;case"wpaeap":t.each(["radius","radius_acct"],function(t){for(var i=[],a=1;a<=this._addableSettings[t].max;a++){var r=null;if(o&&o!=t+"_ip_"+a||""!==e[t+"_ip_"+a]&&(null===e[t+"_ip_"+a]?s[t+"_ip_"+a]=n.localize(n.E_CannotBeEmpty,n.G_IPAddress):this.validator.ip(e[t+"_ip_"+a])||(s[t+"_ip_"+a]=n.localize(n.E_IncorrectIPAddress,n.G_IPAddress))),o&&o!=t+"_port_"+a||""!==e[t+"_port_"+a]&&(null===e[t+"_port_"+a]?s[t+"_port_"+a]=n.localize(n.E_CannotBeEmpty,n.G_Port):this.validator.range(e[t+"_port_"+a],1,65535)||(s[t+"_port_"+a]=n.localize(n.E_IncorrectNumberRange,n.G_Port,1,65535))),o&&o!="x_"+t+"_secret_"+a||""!==e["x_"+t+"_secret_"+a]&&null===e["x_"+t+"_secret_"+a]&&(s["x_"+t+"_secret_"+a]=n.localize(n.E_CannotBeEmpty,n.G_PW)),e[t+"_ip_"+a]&&(r=e[t+"_ip_"+a]+"|",e[t+"_port_"+a]&&(r+=e[t+"_port_"+a])),(!o||o==t+"_ip_"+a||o==t+"_port_"+a)&&-1!==i.indexOf(r)){var l="radius"==t?n.G_SettingsRadiusServer:n.G_SettingsRadiusAccountingServer;s[t+"_ip_"+a]=n.localize(n.E_MustBeUnique,l)}r&&i.push(r)}},this)}return o&&"vlan"!=o||e.vlan_enabled&&(e.vlan?this.validator.range(e.vlan,2,4095)||(s.vlan=n.localize(n.E_IncorrectNumberRange,n.G_SettingsVLANId,2,4095)):s.vlan=n.localize(n.E_CannotBeEmpty,n.G_SettingsVLANId)),t.size(s)?s:void 0},sync:function(e,t,n){switch(e){case"create":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/add/wlanconf",n.type="POST";break;case"update":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/upd/wlanconf/"+this.id,n.type="POST",n.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/del/wlanconf/"+this.id,n.type="POST"}return i.sync.call(this,e,t,n)}})}),define("unifi/collection/Wlans",["unifi/collection/Collection","unifi/model/Wlan"],function(e,t){"use strict";return e.extend({model:t,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/list/wlanconf"},getWlanGroupId:function(e){return this.find(function(t){return t.get("wlangroup_id")==e})}})}),define("text!includes/settings/settingsWirelessNetworksTemplate.html",[],function(){return'<div class="section section-main">\n    <h1>\n        <span class="breadcrumb-home"><%- msg.G_SettingsWirelessNetworks %></span>\n        <span class="breadcrumb-child hidden">\n            <span class="ubnt-icon-arrow-right"></span>\n            <span class="breadcrumb"></span>\n        </span>\n    </h1>\n\n    <div class="header-options">\n        <form class="groups" class="hidden">\n            <div class="left">\n                <label for="wirelessNetworkGroupList"><%- msg.G_SettingsWLANGroup %></label>\n                <select name="wlan-groups" class="plain wlan-groups"></select>\n            </div>\n\n            <div class="left">\n                <button type="button" name="add" class="button icon-only plain add-group is-admin"><span class="ubnt-icon-plus"></span></button>\n                <button type="button" name="delete" class="button icon-only plain delete-group is-admin"><span class="ubnt-icon-minus"></span></button>\n                <button type="button" name="options" class="button plain edit-group"><span class="ui-button-icon ubnt-icon-gear"></span><%- msg.G_Options %></button>\n            </div>\n        </form>\n    </div>\n    \n    <div class="group-forms hidden"></div>\n    <div class="section-home">\n        <div class="data-table untitled">\n            <div class="loading"><span><%- msg.N_Loading %></span></div>\n        </div>\n        <div class="buttons is-admin">\n            <button class="button tall auto white create-form hidden is-admin" data-type="create-form">\n                <span class="ui-button-icon ubnt-icon-gear gear"></span>\n                <%- msg.G_SettingsCreateNewWirelessNetwork %>\n            </button>\n            \n            <span class="note"><%- msg.G_SettingsCreateNewWirelessNetworkNote %></span>\n        </div>\n    </div>\n    <div class="forms hidden"></div>\n</div>\n\n'}),define("unifi/view/settings/WirelessNetworksView",["unifi/view/settings/ListContentView","unifi/view/settings/WirelessNetworksFormView","unifi/view/settings/WirelessNetworksGroupFormView","ubnt/view/uicomponents/SelectMenuView","ubnt/view/dialogs/ConfirmDialogView","libs/backgrid","ubnt/backgrid","underscore","jquery","unifi/collection/WlanGroups","unifi/collection/UserGroups","unifi/collection/Wlans","msg/Msg","text!includes/settings/settingsWirelessNetworksTemplate.html"],function(e,t,i,n,s,o,a,r,l,u,c,d,h,p){"use strict";return e.extend({id:"settingsWirelessNetworks",_templateId:r.template(p,{msg:h}),_formClass:t,_groupFormClass:i,_collectionType:{name:"Wlans",Class:d},_pageable:!1,initialize:function(t){this.models={},this.groupForms={},e.prototype.initialize.call(this,t)},columns:function(){return[{name:"name",label:h.G_Name,editable:!1,cell:"string"},{name:"security",label:h.G_Security,editable:!1,cell:"string"},{name:"is_guest",label:h.G_GuestNet,editable:!1,cell:o.StringCell.extend({formatter:a.Formatters.Boolean})},{name:"_id",label:h.G_Actions,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ActionsCell.extend({actions:{edit:{icon:"ubnt-icon-edit",callback:this.rowEdit},"delete":{requiresAdminPrivilege:!0,icon:"ubnt-icon-trash",callback:this.rowDelete}}})}]},load:function(){e.prototype.load.apply(this,arguments),this.listenTo(this.collection,"add",this.checkAddable),this.listenTo(this.collection,"remove",this.checkAddable),this.listenTo(this.collection,"sync",this.checkAddable)},dependencies:function(){var e={WlanGroups:u,UserGroups:c},t=[],i={},n=this;r.each(e,function(e,n){t.push(i[n]=l.Deferred())},this),l.when.apply(l,t).then(function(){n._dependencies.resolve()},function(){n._dependencies.reject()}),r.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:i[t]}},e)},this)},grid:function(){e.prototype.grid.call(this,[["wlangroup_id",this.app.collection("WlanGroups").getDefault().id,1]]),this.checkAddable(),this.$groupForms=this.$el.find("div.group-forms"),this.groups()},groups:function(){var e=this,t=this.app.collection("WlanGroups"),i=t.getDefault().id,o=this.$el.find("form.groups"),a=o.find("button.add-group"),u=o.find("button.edit-group"),c=o.find("button.delete-group"),d=o.find("select[name=wlan-groups]");a.on("click",function(){e.groupForm(new t.model)}),u.on("click",function(){e.groupForm(e.models.group)}),c.on("click",function(){var t=e.models.group;t.get("attr_no_delete")||(new s).show(h.N_ConfirmDeleteWlanGroup,function(){t.destroy({wait:!0,success:function(){d.val(i).trigger("change").selectmenu("close").selectmenu("resize"),e.app.refresh()}})})}),this.$groupSelectMenu=new n({el:d,collection:t,isComparatorSort:!0,addable:function(e){return!e.get("attr_hidden")}}),d.on("buttons",function(){var i=e.models.group=t.get(l(this).val());i&&(c.prop("disabled",i.get("attr_no_delete")===!0),u.prop("disabled",i.get("attr_no_edit")===!0),e.grids.content.setFilter("wlangroup_id",i.id,1),e.checkAddable())}).on("change",function(){l(this).trigger("buttons")}).val(i).trigger("change").selectmenu("close").selectmenu("resize");var p=function(){r.delay(function(){d.val(e.models.group.id).trigger("change").selectmenu("close").selectmenu("resize")},10)};this.listenTo(t,"add",p)},groupButtons:function(){0===this.$groupForms.find("> div").length?(this.$el.find("form.groups button.add-group").prop("disabled",!1),this.$el.find("select[name=wlan-groups]").selectmenu("enable"),this.$el.find("select[name=wlan-groups]").trigger("buttons")):(this.$el.find("select[name=wlan-groups]").selectmenu("disable"),this.$el.find("form.groups button").prop("disabled",!0))
},groupForm:function(e){var t=e&&e.id?e.id:null,i=t&&this.groupForms[t]?this.groupForms[t]:null,n=this;return i||(i=new this._groupFormClass({app:this.app,container:this.$groupForms,model:e,collection:this.app.collection("WlanGroups"),count:r.size(this.groupForms)+1}),this.listenTo(i,"render",function(){n.groupButtons(),n.renderForm(i)}),this.listenTo(i,"remove",function(){n.removeForm(i),n.groupButtons()}),this.listenTo(i,"save-success",l.proxy(function(e){this.models.group=e},this)),t&&(this.groupForms[t]=i)),i.render(),this.$el.trigger("groupForm"),i},form:function(t,i){var n=e.prototype.form.call(this,t,i,!0);return n.groups={wlan:t&&t.id?this.app.collection("WlanGroups").get(t.get("wlangroup_id")):this.models.group,user:this.app.collection("UserGroups",{},c)},n.render(),n},reloading:function(){},reloaded:function(){},renderForm:function(t){e.prototype.renderForm.call(this,t),this.$el.find(".header-options").hide()},removeForm:function(t){t.model&&(this.groupForms[t.model.id]=null),e.prototype.removeForm.call(this,t),this.$el.find(".header-options").show()},checkAddable:function(){if(this.collection&&this.models.group){var e=r.size(this.collection.where({wlangroup_id:this.models.group.id}));this.$createBtn[e>=4?"hide":"show"]()}},remove:function(){var t=this.app.collection("WlanGroups"),i=(t.getDefault().id,this.$el.find("form.groups")),n=i.find("button.add-group"),s=i.find("button.edit-group"),o=i.find("button.delete-group"),a=i.find("select[name=wlan-groups]");this.stopListening(this.collection,"add",this.checkAddable),this.stopListening(this.collection,"remove",this.checkAddable),this.stopListening(this.collection,"sync",this.checkAddable),n.off("click"),s.off("click"),o.off("click"),a.off("buttons"),a.off("change"),this.stopListening(t,"add"),e.prototype.remove.apply(this,arguments)}})}),define("text!includes/settings/settingsVoipTemplate.html",[],function(){return'<div class="section section-main">\n    <h1>\n        <span class="breadcrumb-home"><%- msg.G_SettingsVoip %></span>\n        <span class="breadcrumb-child hidden">\n            <span class="ubnt-icon-arrow-right"></span>\n            <span class="breadcrumb"></span>\n        </span>\n    </h1>\n\n    <form class="section-home primary-form complex-form">\n        <h2><%- msg.G_SettingsVoipGlobal %></h2>\n        <fieldset class="basic">\n            <div class="fields">\n                <div>\n                    <label for="voipEnabled"><%- msg.G_SettingsVoipIsEnabled %></label>\n                    <input type="checkbox" id="voipEnabled" name="enabled" value="1" />\n                    <span><%- msg.G_SettingsVoipEnable %></span>\n                </div>\n            </div>\n        </fieldset>\n\n        <h2 class="provider"><%- msg.G_SettingsProviderSetup %></h2>\n        <fieldset class="provider">\n            <div class="fields">\n                <div>\n                    <label><%- msg.G_SettingsSipServer %></label>\n                    <input type="text" name="sip_server" value="" />\n                </div>\n                <div>\n                    <label><%- msg.G_SettingsSipAuth %></label>\n                    <div class="buttonset sip_auth">\n                        <input type="radio" id="providerAuthUser" name="sip_auth" value="user" checked="checked" /><label for="providerAuthUser"><%- msg.G_SettingsProviderAuthUser %></label>\n                        <input type="radio" id="providerAuthIP" name="sip_auth" value="ip" /><label for="providerAuthIP"><%- msg.G_SettingsProviderAuthIP %></label>\n                    </div>\n                </div>\n            </div>\n        </fieldset>\n\n        <fieldset class="provider provider-advance">\n            <legend class="toggle"><%- msg.G_SettingsAdvancedOpts %> <span class="ubnt-icon-arrow-down secondary-color"></span></legend>\n            <div class="fields">\n                <div>\n                    <label><%- msg.G_SettingsSipProxy %></label>\n                    <input type="text" name="sip_proxy" value="" />\n                </div>\n                <div>\n                    <label><%- msg.G_SettingsSipVoicemailURL %></label>\n                    <input title="<%- msg.G_SettingsSipVoicemailURLTitle %>" type="text" name="sip_voicemail" value="" />\n                </div>\n            </div>\n        </fieldset>\n\n        <fieldset class="actions">\n            <button type="submit" class="button tall auto green save is-admin"><span class="ui-button-icon ubnt-icon-check"></span><%- msg.G_Apply %></button>\n        </fieldset>\n    </form>\n</div>\n'}),define("unifi/view/settings/VoipView",["unifi/view/app/ContentView","unifi/view/app/ValidatorMixin","unifi/collection/Sites","unifi/collection/Settings","underscore","jquery","msg/Msg","text!includes/settings/settingsVoipTemplate.html"],function(e,t,i,n,s,o,a,r){"use strict";return e.extend(s.extend({},t,{id:"settingsVoip",_prevalidate:{sip_server:{input:"text",complex:!0,model:"tbd",subsection:"provider"}},initialize:function(t){e.prototype.initialize.call(this,t),o.when(this._rendered=o.Deferred(),this._loaded=o.Deferred()).then(this.populate),this.models={},this.collection=this.app.collection("Settings",{fetch:{reload:!1,deferred:this._loaded}},n),this.on("save-success",function(e){this.collection.add(e,{merge:!0}),this._deferred[e.get("key")].resolve()},this),this.on("save-error",function(e,t){this._deferred[e.get("key")].reject(e,t)},this),this.render()},render:function(){if(e.prototype.render.call(this),!this.rendered&&(this.rendered=!0)){var t=this;this.$el.html(s.template(r,{msg:a})),this.$form=this.$el.find("form"),this.$form.on("submit",this.save),this.$submit=this.$el.find("button.save"),this.$submit.buttonalert();var i=this.collection,n=i.findWhere({key:"voip",site_id:SITE.id});n||(n=i.getSettingFromKey("voip",SITE.id),i.add(n)),this.listenTo(i,"change",this.populate),this.$el.find("#voipEnabled").on("change",function(){var e=o(this);e.is(":checked")?t.$el.find(".provider").show():t.$el.find(".provider").hide()}).trigger("change"),this.$el.find("#voipEnabled").on("click",function(){t.stopListening(i,"change",t.populate)}),t.$el.find("form legend.toggle").on("click",function(e,t){var i=o(this);i.find("span").toggleClass("ubnt-icon-arrow-right",t).toggleClass("ubnt-icon-arrow-down",!i.find("span").hasClass("ubnt-icon-arrow-right")).end().siblings().toggleClass("hidden",t)}).trigger("click",!0),this.$el.find(".buttonset").buttonset(),this.app.isReadOnly||this.prevalidator(),this._rendered.resolve()}this.populate()},populate:function(){s.each(["provider"],function(e){this.models[e]=this.collection.getSettingFromKey(e,SITE.id)||new this.collection.model({key:e,site_id:SITE.id})},this),s.each(this._prevalidate,function(e,t){this._prevalidate[t].model=this.models[e.subsection]},this),this.refresh_voipEnabled(),this.refresh_provider()},refresh_provider:function(){var e=this.collection,t=e.getSettingFromKey("provider",SITE.id);this.$el.find("input[name=sip_server]").val(t.get("sip_server"));var i=t.get("sip_auth")||"user";this.$el.find("input[name=sip_auth][value="+i+"]").prop("checked",!0).trigger("change"),this.$el.find("input[name=sip_proxy]").val(t.get("sip_proxy")),this.$el.find("input[name=sip_voicemail]").val(t.get("sip_voicemail"))},refresh_voipEnabled:function(){var e=this.collection,t=e.getSettingFromKey("voip",SITE.id),i=!(!t||!t.get("enabled"));t?this.$el.find("input[name=enabled]").prop("checked",i).trigger("change"):this.$el.find("input[name=enabled]").prop("checked",!1).trigger("change"),this.$form.toggleClass("voip-enabled",i)},gather:function(e){var t={provider:{sip_server:this.$el.find("input[name=sip_server]").val(),sip_auth:this.$el.find("input[name=sip_auth]:checked").val(),sip_proxy:this.$el.find("input[name=sip_proxy]").val(),sip_voicemail:this.$el.find("input[name=sip_voicemail]").val(),key:"provider"},voip:{enabled:this.$el.find("input[name=enabled]").is(":checked"),key:"voip"}};return"provider"===e?t.provider:"voip"===e?t.voip:t},save:function(e){e&&e.preventDefault();var t=this,i=this.collection,n=i.getSettingFromKey("voip",SITE.id),o=this.gather("voip"),a=this.gather("provider");if(o.enabled===!0){var r=i.getSettingFromKey("provider",SITE.id),l=r.validate(a);s.size(l)?(this.$el.find("input[name=sip_server]").hasClass("error")||this.$el.find("input[name=sip_server]").addClass("error").parent().append('<div class="error-msg">'+l.sip_server+"</div>"),t.$submit.trigger("error")):r.save({sip_server:a.sip_server,sip_auth:a.sip_auth,sip_proxy:a.sip_proxy,sip_voicemail:a.sip_voicemail},{wait:!0,success:function(){n.save({enabled:o.enabled},{wait:!0,success:function(){i.fetch(),t.$submit.trigger("success"),t.stopListening(i,"change",t.populate),t.listenTo(i,"change",t.populate)},beforeSend:function(){t.$submit.trigger("saving")},error:function(){t.$submit.trigger("error")}})},beforeSend:function(){t.$submit.trigger("saving")},error:function(){t.$submit.trigger("error")}})}else n.save({enabled:o.enabled},{wait:!0,success:function(){t.$submit.trigger("success"),t.stopListening(i,"change",t.populate),t.listenTo(i,"change",t.populate)},beforeSend:function(){t.$submit.trigger("saving")},error:function(){t.$submit.trigger("error")}})},remove:function(){this.$el.find("fieldset.basic button.check").off("click"),this.$el.find(".buttonset input[name=sip_auth]").off(),this.$form.off("submit"),this.$submit.off(),this.stopListening(this.app.collection("Settings"),"change",this.populate),this.rendered=!1,e.prototype.remove.apply(this,arguments)}}))}),define("text!includes/settings/settingsExtensionsFormTemplate.html",[],function(){return'<form class="complex-form">\n    <h2><%- headline %></h2>\n\n    <fieldset class="basic">\n        <div class="fields">\n            <div>\n                <label for="extensionNumber<%- id %>"><%- msg.G_SettingsVoipExtension %></label>\n                <input type="text" id="extensionNumber<%- id %>" name="extension" class="extension" value="<%- extension %>" />\n            </div>\n            <div>\n                <label for="extensionName<%- id %>"><%- msg.G_Name %></label>\n                <input type="text" id="extensionName<%- id %>" name="name" value="" />\n            </div>\n            <div class="external-user-only">\n                <label for="sipUsername<%- id %>"><%- msg.G_SettingsSipUsername %></label>\n                <input type="text" id="sipUsername<%- id %>" name="x_sip_username" value="" />\n            </div>\n            <div class="external-user-only">\n                <label for="sipPassword<%- id %>"><%- msg.G_SettingsSipPassword %></label>\n                <input type="password" id="sipPassword<%- id %>" name="x_sip_password" value="" />\n            </div>\n            <div>\n                <label for="extensionDevice<%- id %>"><%- msg.G_SettingsExtPhone %></label>\n                <div class="select">\n                    <select id="extensionDevice<%- id %>" name="device_mac"></select>\n                </div>\n            </div>\n        </div>\n    </fieldset>\n    <fieldset class="advanced">\n         <legend class="toggle"><%- msg.G_SettingsAdvancedOpts %> <span class="ubnt-icon-arrow-down secondary-color"></span></legend>\n         <div class="fields">\n            <div class="external-user-only">\n                <label for="sipAuthName<%- id %>"><%- msg.G_SettingsSipAuthName %></label>\n                <input type="text" id="sipAuthName<%- id %>" name="sip_authname" value="" />\n            </div>\n            <div>\n                <label for="sipProxy<%- id %>"><%- msg.G_SettingsSipProxy %></label>\n                <input type="text" id="sipProxy<%- id %>" name="sip_proxy" value="" />\n            </div>\n            <div>\n                <label for="sipVoicemailURL<%- id %>"><%- msg.G_SettingsSipVoicemailURL %></label>\n                <input title="<%- msg.G_SettingsSipVoicemailURLTitle %>" type="text" id="sipVoicemailURL<%- id %>" name="sip_voicemail" value="" />\n            </div>\n        </div>\n    </fieldset>\n    <fieldset class="actions">\n        <button type="button" class="button tall auto white cancel">\n            <span class="ui-button-icon ubnt-icon-close"></span>\n            <%- msg.G_Cancel %>\n        </button>\n        <button type="submit" class="button tall auto green save is-admin">\n            <span class="ui-button-icon ubnt-icon-check"></span>\n            <%- msg.G_Save %>\n        </button>\n    </fieldset>\n</form>\n'}),define("unifi/view/settings/ExtensionsFormView",["unifi/view/settings/FormView","underscore","jquery","msg/Msg","text!includes/settings/settingsExtensionsFormTemplate.html"],function(e,t,i,n,s){"use strict";return e.extend({_templateId:s,_prevalidate:{extension:{input:"text"},name:{input:"text"}},render:function(){var t=this.rendered;if(e.prototype.render.call(this,!0),!t){this.$memberList=this.$el.find("ul.member-list"),this.renderDevices();var i=this.app.collection("Settings").findWhere({key:"provider"});this.toggleUI(i);var n=this;this.provider=i,this.listenTo(i,"change",function(e){n.toggleUI(e)})}this.populate()},toggleUI:function(e){var t="user"===(e.get("sip_auth")||"user");this.$el.find("form").toggleClass("external-user",t)},renderDevices:function(){var e=this.$el.find("select[name=device_mac]").empty(),s=this.app.collection("Devices"),o=this.app.collection("Extensions");e.append(i('<option value=""></option>').text(n.G_SelectOne)),t.each(s.where({type:s.typeMap.phone,adopted:!0}),function(t){return t.get("mac")!=this.model.get("device_mac")&&o.findWhere({device_mac:t.get("mac")})?!0:void e.append(i('<option value="'+t.get("mac")+'"></option>').text(t.get("mac")))},this),this.model&&e.find('option[value="'+(this.model.get("device_mac")||"")+'"]').prop("selected",!0).trigger("change")},args:function(){return{id:this.id,headline:this.create?n.G_SettingsCreateNewExtension:n.G_SettingsEditExtension+" - "+this.model.get("name"),extension:this.getExtensionNumber(),msg:n}},getExtensionNumber:function(){var e=this.model?this.model.get("extension"):null;if(!e)for(var i=t.map(this.collection.models,function(e){return parseInt(e.get("extension"),10)}).sort(),n=101,s=999999999999999,o=i[0]||n;s>o;o++)if(-1===t.indexOf(i,o)){e=o;break}return e},populate:function(){this.model&&(this.$el.find("input[name=name]").val(this.model.get("name")),this.$el.find("select[name=device_mac]").val(this.model.get("device_mac")).trigger("change"),this.$el.find("input[name=x_sip_username]").val(this.model.get("x_sip_username")),this.$el.find("input[name=x_sip_password]").val(this.model.get("x_sip_password")),this.$el.find("input[name=sip_proxy]").val(this.model.get("sip_proxy")),this.$el.find("input[name=sip_authname]").val(this.model.get("sip_authname")),this.$el.find("input[name=sip_voicemail]").val(this.model.get("sip_voicemail")))},gather:function(){var e={extension:this.$el.find("input[name=extension]").val(),name:this.$el.find("input[name=name]").val()};return e.device_mac=this.$el.find("select[name=device_mac]").val(),e.x_sip_username=this.$el.find("input[name=x_sip_username]").val(),e.x_sip_password=this.$el.find("input[name=x_sip_password]").val(),e.sip_proxy=this.$el.find("input[name=sip_proxy]").val(),e.sip_authname=this.$el.find("input[name=sip_authname]").val(),e.sip_voicemail=this.$el.find("input[name=sip_voicemail]").val(),e},remove:function(){this.$resend&&this.$resend.off(),this.stopListening(this.provider),e.prototype.remove.apply(this,arguments)}})}),define("unifi/model/Extension",["unifi/model/Model","jquery","backbone","underscore","msg/Msg"],function(e,t,i,n,s){"use strict";return e.extend({display:function(){return this.get("name")+" ("+this.get("extension")+")"},validate:function(e,t){var i={},o=t?t.partial:null;return o&&"extension"!=o||(e.extension?this.validator.digits(e.extension)?this.validator.length_limit(e.extension,15)||(i.extension=s.localize(s.E_TooManyDigits,s.G_SettingsVoipExtension,15)):i.extension=s.localize(s.E_IncorrectDigits,s.G_SettingsVoipExtension):o||(i.extension=s.localize(s.E_CannotBeEmpty,s.G_SettingsVoipExtension))),o&&"name"!=o||e.name||o||(i.name=s.localize(s.E_CannotBeEmpty,s.G_Name)),n.size(i)?i:void 0},parse:function(t,i){return t=e.prototype.parse.call(this,t,i),t&&(t.extension=t.extension?parseInt(t.extension,10):0),t},ext_mac:function(){var e=this.get("extension");return this.get("device_mac")||(e+="  ("+s.G_SettingsVoipExtPhoneUnassigned+")"),e},sync:function(e,t,n){switch(n=n||{},e){case"create":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/add/extension",n.type="POST";break;case"update":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/upd/extension/"+t.id,n.type="POST",n.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/del/extension/"+t.id,n.type="POST"}return i.sync.call(this,e,t,n)}})}),define("unifi/collection/Extensions",["unifi/collection/Collection","unifi/model/Extension","underscore"],function(e,t,i){"use strict";return e.extend({model:t,bySite:!0,comparator:function(e){return e.get("extension")},filterByExtension:function(e){return e?(e=e.toString(),i(this.filter(function(t){return t.get("extension")==e})).last()):null},url:function(){return"/api/s/"+SITE.name+"/list/extension"}})}),define("text!includes/settings/settingsExtensionsTemplate.html",[],function(){return'<div class="section section-main">\n    <h1>\n        <span class="breadcrumb-home"><%- msg.G_SettingsExtensions %></span>\n        <span class="breadcrumb-child hidden">\n            <span class="ubnt-icon-arrow-right"></span>\n            <span class="breadcrumb"></span>\n        </span>\n    </h1>\n\n    <div class="section-home">\n        <div class="data-table untitled">\n            <div class="loading"><span><%- msg.N_Loading %></span></div>\n        </div>\n        <div class="buttons is-admin">\n            <button class="button tall auto white create-form hidden is-admin" data-type="create-form">\n                <span class="ui-button-icon ubnt-icon-gear gear"></span>\n                <%- msg.G_SettingsCreateNewExtension %>\n            </button>\n        </div>\n    </div>\n    <div class="forms hidden"></div>\n</div>\n'}),define("unifi/view/settings/ExtensionsView",["unifi/view/settings/ListContentView","unifi/view/settings/ExtensionsFormView","underscore","jquery","libs/backgrid","ubnt/backgrid","unifi/collection/Extensions","msg/Msg","text!includes/settings/settingsExtensionsTemplate.html"],function(e,t,i,n,s,o,a,r,l){"use strict";return e.extend({id:"settingsExtensions",_templateId:i.template(l,{msg:r}),_formClass:t,_collectionType:{name:"Extensions",Class:a},_pageable:!1,columns:function(){return[{name:"extension",label:r.G_SettingsVoipExtension,editable:!1,sortValue:"extension",cell:o.Cells.ModelCell.extend({callback:"ext_mac"})},{name:"name",label:r.G_Name,editable:!1,cell:"string"},{name:"_id",label:r.G_Actions,editable:!1,sortable:!1,headerCell:o.Headers.noSortHeader,cell:o.Cells.ActionsCell.extend({actions:{edit:{icon:"ubnt-icon-edit",callback:this.rowEdit},"delete":{requiresAdminPrivilege:!0,icon:"ubnt-icon-trash",callback:this.rowDelete,render:function(e){return!e.get("attr_no_delete")}}}})}]},remove:function(){this.stopListening(this.collection),e.prototype.remove.apply(this,arguments)}})}),define("unifi/model/SdnStat",["unifi/model/Model"],function(e){"use strict";return e.extend({url:function(){return"/api/s/"+SITE.name+"/stat/sdn"}})}),define("text!includes/settings/settingsControllerTemplate.html",[],function(){return'<div class="section section-main">\n    <h1><%- msg.G_SettingsController %></h1>\n\n    <form class="complex-form">\n        <h2><%- msg.G_SettingsControllerSettings %></h2>\n\n        <fieldset class="controller-settings">\n            <div class="fields">\n                <div>\n                    <label for="controllerHostnameIP"><%- msg.G_SettingsCntrlHostnameIP %></label>\n                    <input type="text" id="controllerHostnameIP" name="systemName" value="" size="25" />\n                </div>\n                <div>\n                    <label for="networkDiscovery"><%- msg.G_SettingsNetDiscovery %></label>\n                    <input type="checkbox" id="networkDiscovery" name="enableServerDiscoverable" value="1" />\n                    <span><%- msg.G_SettingsMakeCntrlDiscvL2Net %></span>\n                </div>\n                <div>\n                    <label for="voipUpdateCacheEnabled"><%- msg.G_SettingsVoipUpdateCache %></label>\n                    <input type="checkbox" id="voipUpdateCacheEnabled" name="voip_image_cache_enabled" value="1" />\n                    <span><%- msg.G_SettingsVoipUpdateCacheEnable %></span>\n                </div>\n                <div class="field-options">\n                    <button type="button" title="<%- msg.G_CheckTitle %>" class="button auto check"><%- msg.G_Check %></button>\n                </div>\n            </div>\n        </fieldset>\n\n        <h2 class="is-super"><%- msg.G_SettingsMailServer %></h2>\n\n        <fieldset class="mail is-super">\n            <div class="fields">\n                <div>\n                    <label for="configureMailServer"><%- msg.G_SettingsSMTPServ %></label>\n                    <input type="checkbox" id="configureMailServer" name="enable-mail-server" value="1" />\n                    <span><%- msg.G_SettingsEnblMailServ %></span>\n\n                    <input type="text" name="smtp-server" placeholder="<%- msg.G_SettingsSMTPHost %>" value="" />\n                    <span><%- msg.G_Port %></span>\n                    <input type="text" name="smtp-port" value="" size="4" />\n\n                    <span><input type="checkbox" name="smtp-enable-ssl" value="1" /><span>\n                    <span><%- msg.G_SettingsEnblSSL %></span>\n                </div>\n                <div class="smtp-toggled unlabeled">\n                    <input type="checkbox" id="configureMailServerAuthentication" name="enable-mail-server-auth" value="1" checked="checked" />\n                    <span class="padded"><%- msg.G_SettingsEnblAuth %></span>\n\n                    <span><%- msg.G_UN %></span>\n                    <input type="text" name="smtp-username" value="" />\n                    <span><%- msg.G_PW %></span>\n                    <input type="password" name="smtp-password" value="" />\n                </div>\n                <div class="smtp-toggled unlabeled">\n                    <input type="checkbox" id="configureMailServerFrom" name="enable-smtp-from" value="1" />\n                    <span class="padded"><%- msg.G_SettingsSpecifySendAdd %></span>\n\n                    <input type="text" name="smtp-from-address" value="" />\n                </div>\n                <div class="smtp-toggled">\n                    <label for="configureMailServerTest"><%- msg.G_SettingsTestSMTPServ %></label>\n                    <span><%- msg.G_SettingsSendTestEmail %></span>\n                    <input type="text" id="configureMailServerTest" name="smtp-test-email" value="" />\n                    <button id="runMailServerTest" class="button"><%- msg.G_Send %></button>\n                <div>\n            </div>\n        </fieldset>\n\n        <h2 class="is-super" style="display:none">UniFi SDN</h2>\n\n        <fieldset class="sdn is-super" style="display:none">\n            <div class="fields">\n                <div>\n                    <label for="configureSdn">SDN Connectivity</label>\n                    <input type="checkbox" id="configureSdn" name="enable-sdn" value="1" checked="checked" />\n                    <span>Enable SDN Features</span>\n                </div>\n                <div class="sdn-toggled">\n                    <label for="configureSsoUsername">SSO Username</label>\n                    <input type="text" id="configureSsoUsername" name="sso_username" value="" />\n                </div>\n                <div class="sdn-toggled">\n                    <label for="configureSsoPassword">SSO Password</label>\n                    <input type="password" id="configureSsoPassword" name="x_sso_password" value="" />\n                </div>\n                <div class="sdn-status">\n                    <label for="sdnControllerUrl">SSO Status</label>\n                    <span>\n                        <a href="https://sdn.ubnt.com/unifi/1866c7ef-cac4-40e9-a9dc-526773494fe6">https://sdn.ubnt.com/unifi/1866c7ef-cac4-40e9-a9dc-526773494fe6</a>\n                    </span>\n                    <button class="button refresh"><%- msg.G_Refresh %></button>\n                </div>\n\n            </div>\n        </fieldset>\n\n        <fieldset class="actions">\n            <button type="submit" class="button tall auto green save is-admin">\n                <span class="ui-button-icon ubnt-icon-check"></span><%- msg.G_Apply %></button>\n        </fieldset>\n    </form>\n</div>\n'}),define("unifi/view/settings/ControllerView",["unifi/view/app/ContentView","unifi/view/app/ValidatorMixin","underscore","jquery","msg/Msg","unifi/collection/Settings","unifi/model/Setting","unifi/collection/Sites","unifi/model/SdnStat","ubnt/view/dialogs/ConfirmDialogView","ubnt/view/dialogs/ErrorDialogView","unifi/view/settings/ChromeView","text!includes/settings/settingsControllerTemplate.html","ubnt/ubnt.password","ubnt/ubnt.buttonalert"],function(e,t,i,n,s,o,a,r,l,u,c,d,h){"use strict";return e.extend(i.extend({},t,{id:"settingsController",_prevalidate:{"smtp-server":{input:"text",complex:!0,model:"tbd",subsection:"super_smtp",map:"host"},"smtp-port":{input:"text",complex:!0,model:"tbd",subsection:"super_smtp",map:"port"},"smtp-username":{input:"text",complex:!0,model:"tbd",subsection:"super_smtp",map:"username"},"smtp-password":{input:"password",complex:!0,model:"tbd",subsection:"super_smtp",map:"x_password"}},initialize:function(t){e.prototype.initialize.call(this,t),n.when(this._rendered=n.Deferred(),this._loaded=n.Deferred()).then(this.populate),this.models={},this.collection=this.app.collection("Settings",{fetch:{reload:!1,deferred:this._loaded}},o),this.on("save-success",function(e){this.collection.add(e,{merge:!0}),this._deferred[e.get("key")].resolve()},this),this.on("save-error",function(e){this._deferred[e.get("key")].reject()},this),this.refreshSdnStat=i.debounce(this._refreshSdnStat,1e3),this.render(),this.listenTo(this.collection,"change sync add",this.reflectSettingChanges),this.reflectSettingChanges()},render:function(){if(e.prototype.render.call(this),!this.rendered&&(this.rendered=!0)){this.$el.html(i.template(h,{msg:s})),this.$el.find("input[type=password]").password({suffix:"-text"});var t=this;this.$el.find("fieldset.controller-settings button.check").on("click",this.sendCheckCmd),this.$el.find("#configureMailServer").on("change",function(){var e=n(this);e.is(":checked")?t.$el.find(".smtp-toggled").show():t.$el.find(".smtp-toggled").hide()}).trigger("change"),this.$el.find("input[name=smtp-enable-ssl]").on("change",function(){var e=n(this),t=n(this).parents("div").find("input[name=smtp-port]"),i=t.val();i&&465!=i&&25!=i||t.val(e.is(":checked")?465:25)}).trigger("change"),this.$el.find("#configureMailServer, #configureMailServerAuthentication, #configureMailServerFrom").on("change",function(){var e=n(this);e.is(":checked")?e.parent().find("input").not(e).prop("disabled",!1):e.parent().find("input").not(e).prop("disabled",!0)}).trigger("change"),this.$el.find("#runMailServerTest").on("click",function(e){e.preventDefault();var i=n(this),o=t.gather("super_smtp");o.email=t.$el.find("input[name=smtp-test-email]").val(),delete o.enable,o.use_auth||(delete o.username,o.x_password),o.use_sender||delete o.sender,i.prop("disabled",!0),i.siblings(".error-msg, .success-msg").remove(),t.collection.testMail({data:o,success:function(e){i.after(e&&e.meta&&"ok"==e.meta.rc?n('<div class="success-msg">'+s.localize(s.N_SmtpEmailSent,o.email)+"</div>"):n('<div class="error-msg">'+s.E_SmtpUnknownFailed+"</div>"))},error:function(e){i.after(n('<div class="error-msg">'+s.apiError(e)+"</div>"))},complete:function(){i.prop("disabled",!1)}})}),this.$el.find("#configureSdn").on("change",function(){var e=n(this);t.$el.find(".sdn-toggled").toggle(e.is(":checked"))}),this.$el.find("fieldset.actions button.cancel").on("click",function(e){e.preventDefault(),t.clear(),t.populate()}),this.$el.find("form").on("submit",function(e){e.preventDefault(),t.save()}),this.$el.find(".sdn-status .refresh").on("click",this.refreshSdnStat),this.$submit=this.$el.find("button.save"),this.$submit.buttonalert(),this.prevalidator(),this._rendered.resolve()}else this.populate()},populate:function(){i.each(["super_smtp","super_identity","super_mgmt","super_sdn"],function(e){this.models[e]=this.collection.getSettingFromKey(e)||new this.collection.model({key:e,site_id:SITE.id})},this),i.each(this._prevalidate,function(e,t){this._prevalidate[t].model=this.models[e.subsection]},this),this.$el.find("form")[0].reset(),this.models.super_identity&&this.$el.find("input[name=systemName]").val(this.models.super_identity.get("name")),this.models.super_mgmt&&(this.$el.find("input[name=enableServerDiscoverable]").attr("checked",this.models.super_mgmt.get("discoverable")===!0).trigger("change"),this.$el.find("input[name=voip_image_cache_enabled]").attr("checked",this.models.super_mgmt.get("voip_image_cache_enabled")===!0).trigger("change")),this.models.super_smtp?(this.$el.find("input[name=enable-mail-server]").attr("checked",this.models.super_smtp.get("enabled")).trigger("change"),this.$el.find("input[name=smtp-server]").val(this.models.super_smtp.get("host")),this.$el.find("input[name=smtp-port]").val(this.models.super_smtp.get("port")),this.$el.find("input[name=smtp-enable-ssl]").attr("checked",this.models.super_smtp.get("use_ssl")).trigger("change"),this.$el.find("input[name=enable-mail-server-auth]").attr("checked",this.models.super_smtp.get("use_auth")).trigger("change"),this.$el.find("input[name=smtp-username]").val(this.models.super_smtp.get("username")),this.$el.find("input[name=smtp-password]").val(this.models.super_smtp.get("x_password")),this.$el.find("input[name=enable-smtp-from]").attr("checked",this.models.super_smtp.get("use_sender")).trigger("change"),this.$el.find("input[name=smtp-from-address]").val(this.models.super_smtp.get("sender"))):(this.$el.find("input[name=enable-mail-server]").trigger("change"),this.$el.find("input[name=smtp-enable-ssl]").trigger("change"),this.$el.find("input[name=enable-mail-server-auth]").trigger("change"),this.$el.find("input[name=enable-smtp-from]").trigger("change"))},_refreshSdnStat:function(){var e=this.models.super_sdn||new a({key:"super_sdn"});return this.$el.find("input[name=enable-sdn]").attr("checked",!!e.get("enabled")).trigger("change"),this.$el.find("input[name=sso_username]").val(e.get("sso_username")||""),this.$el.find("input[name=x_sso_password]").val(e.get("x_sso_password")||""),this.$el.find(".sdn-status").toggle(e.get("enabled")),e.get("enabled")&&(this.$el.find(".sdn-status span").text("Checking..."),this.sdnStat=new l,this.sdnStat.fetch({global:!1}).always(n.proxy(function(){var e=this.sdnStat.get("status"),t=this.$el.find(".sdn-status span");if(t.empty(),"connected"===e){var i=this.sdnStat.get("url"),s=n("<a />").attr("href",i).text(i);t.append(s)}else t.append("unknown"===e?"Checking...":"loginfailed"===e?"Invalid SSO Username or Password":"Unrechable")},this))),!1},sendCheckCmd:function(){this.app.collection("Devices");n.ajax({contentType:"application/json; charset=utf-8",url:"/api/s/"+SITE.name+"/cmd/system",type:"POST",data:JSON.stringify({cmd:"check-phone-update"}),success:function(){},error:function(e){(new u).open(s.apiError(e,!0))}})},gather:function(e){var t={};return e&&"super_identity"!=e||(t.super_identity={name:this.$el.find("input[name=systemName]").val()}),e&&"super_mgmt"!=e||(t.super_mgmt={discoverable:this.$el.find("input[name=enableServerDiscoverable]").is(":checked"),voip_image_cache_enabled:this.$el.find("input[name=voip_image_cache_enabled]").is(":checked")}),e&&"super_smtp"!=e||(t.super_smtp={enabled:this.$el.find("input[name=enable-mail-server]").is(":checked"),host:this.$el.find("input[name=smtp-server]").val(),port:this.$el.find("input[name=smtp-port]").val(),use_ssl:this.$el.find("input[name=smtp-enable-ssl]").is(":checked"),use_auth:this.$el.find("input[name=enable-mail-server-auth]").is(":checked"),username:this.$el.find("input[name=smtp-username]").val(),x_password:this.$el.find("input[name=smtp-password]").val(),use_sender:this.$el.find("input[name=enable-smtp-from]").is(":checked"),sender:this.$el.find("input[name=smtp-from-address]").val()}),e&&"super_sdn"!=e||(t.super_sdn={enabled:this.$el.find("input[name=enable-sdn]").is(":checked"),sso_username:this.$el.find("input[name=sso_username]").val(),x_sso_password:this.$el.find("input[name=x_sso_password]").val()}),e&&(t[e].key=e),e?t[e]:t
},save:function(e){e&&e.preventDefault(),this.clear();var t=[];if(i.each(this.models,function(e,n){var s=e.validate(this.gather(n));i.size(s)&&(this.invalid(s,n),t.push(n))},this),i.size(t))this.$submit.trigger("invalid");else{this.$submit.trigger("saving"),this._deferred={};var s=[];i.each(this.models,function(e,t){s.push(this._deferred[t]=n.Deferred())},this),n.when.apply(n,s).then(n.proxy(this.success,this),n.proxy(this.error,this)),i.each(this.models,function(e,t){this._save(e,t)},this)}},reflectSettingChanges:function(){this.refreshSdnStat()},success:function(){this.$submit.trigger("success")},error:function(e,t){this.$el.find("fieldset.actions").prepend(n('<div class="error-msg">'+s.E_DataSave+": "+s.apiError(t)+"</div>")),this.$submit.trigger("error")},remove:function(){this.off("save-success"),this.off("save-error"),this.stopListening(this.collection),this.$el.find("#configureMailServer").off(),this.$el.find("input[name=smtp-ssl]").off(),this.$el.find("#configureMailServer, #configureMailServerAuthentication, #configureMailServerFrom").off(),this.$el.find("#runMailServerTest").off(),this.$el.find("fieldset.actions button.cancel").off(),this.$el.find("form").off(),this.$el.find("#configureSdn").off("change"),this.devalidate(),this.rendered=!1,e.prototype.remove.apply(this,arguments)}}))}),define("text!includes/settings/settingsMaintenanceTemplate.html",[],function(){return'<div class="section section-main">\n    <h1><%- msg.G_SettingsMaintenance %></h1>\n\n    <form class="complex-form">\n        <h2><%- msg.G_AdminServerInformation %></h2>\n\n        <fieldset class="version">\n            <div class="fields">\n                <div>\n                    <label for="serverVersion"><%- msg.G_Version %></label>\n                    <span id="serverVersion"></span>\n                    <span id="upgradeVersion"></span>\n                </div>\n            </div>\n        </fieldset>\n\n        <h2><%- msg.G_AdminServices %></h2>\n\n        <fieldset class="backup">\n            <div class="fields">\n                <div>\n                    <label for="downloadTimeframe"><%- msg.G_AdminDownloadTimeframe %></label>\n                    <span><%- msg.G_AdminDownloadTimeframeUpTo %></span>\n                    <div class="inline">\n                        <select id="downloadTimeframe" name="days">\n                            <option value="7">1 <%- msg.G_Week %></option>\n                            <option value="30">30 <%- msg.G_Days %></option>\n                            <option value="60">60 <%- msg.G_Days %></option>\n                            <option value="90">90 <%- msg.G_Days %></option>\n                            <option value="180">180 <%- msg.G_Days %></option>\n                            <option value="365">365 <%- msg.G_Days %></option>\n                            <option value="-1"><%- msg.G_AdminDownloadTimeframeAllTime %></option>\n                        </select>\n                    </div>\n                </div>\n                <div>\n                    <label for="downloadBackupLink"><%- msg.G_Download %></label>\n                    <button class="button auto" id="downloadBackupLink"><%- msg.G_AdminDownloadBackupSettings %></button>\n                </div>\n            </div>\n        </fieldset>\n\n        <h2><%- msg.G_AdminRestore %></h2>\n\n        <fieldset class="restore">\n            <div class="fields">\n                <div>\n                    <label for="restore"><%- msg.G_AdminBrowse %></label>\n                    <input type="file" name="file" id="restoreFile"/>\n                    <progress />\n                </div>\n            </div>\n        </fieldset>\n\n        <h2><%- msg.G_AdminSupportInfo %></h2>\n\n        <fieldset class="support-info">\n            <div class="fields">\n                <div>\n                    <label for="debugLog"><%- msg.G_AdminDebugLog %></label>\n                    <span><%- msg.G_AdminDevice %></span>\n                    <div class="inline">\n                        <select name="device">\n                            <option value="warn"><%- msg.G_Normal %></option>\n                            <option value="info"><%- msg.G_More %></option>\n                            <option value="debug"><%- msg.G_AdminDebug %></option>\n                        </select>\n                    </div>\n                    <span><%- msg.G_AdminMGMT %></span>\n                    <div class="inline">\n                        <select name="mgmt">\n                            <option value="warn"><%- msg.G_Normal %></option>\n                            <option value="info"><%- msg.G_More %></option>\n                            <option value="debug"><%- msg.G_AdminDebug %></option>\n                        </select>\n                    </div>\n                    <span><%- msg.G_AdminSystem %></span>\n                    <div class="inline">\n                        <select name="system">\n                            <option value="warn"><%- msg.G_Normal %></option>\n                            <option value="info"><%- msg.G_More %></option>\n                            <option value="debug"><%- msg.G_AdminDebug %></option>\n                        </select>\n                    </div>\n                </div>\n                <div>\n                    <label for="downloadSupportLink"><%- msg.G_Download %></label>\n                    <button class="button auto" id="downloadSupportLink"><%- msg.G_AdminDownloadSupportInfo %></button>\n                </div>\n            </div>\n        </fieldset>\n\n        <fieldset class="actions">\n            <button type="submit" class="button tall auto green save is-admin"><span class="ui-button-icon ubnt-icon-check"></span><%- msg.G_Apply %></button>\n        </fieldset>\n    </form>\n</div>\n'}),define("unifi/model/Status",["unifi/model/Model","underscore","backbone"],function(e){"use strict";return e.extend({url:"/status"})}),define("ubnt/view/dialogs/WorkingDialogView",["ubnt/view/dialogs/AlertDialogView","backbone","underscore","msg/Msg","jquery"],function(e,t,i,n){"use strict";return e.extend({options:{title:n.G_WorkingPleaseWait,dialogClass:"no-close dialog-working",closeOnEscape:!1,draggable:!1},buttons:function(){return{}},render:function(){var t=this.rendered;e.prototype.render.call(this),t||this.$el.append()},remove:function(){this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("libs/fileupload",["jquery","underscore","backbone","msg/Msg"],function(e){"use strict";function t(i,n,s){var o=i.contents().find("div#"+n);if(o.size()>0){var a=e.parseJSON(o.attr("response"));s.resolve(a),i.remove()}else setTimeout(function(){t(i,n,s)},500)}function i(){this.xhrSupport="FormData"in window}return i.prototype.upload=function(i,n){var s,o=e('[type="file"]',i),a=o.get(0),r=e.Deferred();if(this.xhrSupport){s=a.files[0];var l=new XMLHttpRequest,u=new FormData;return u.append("file",s),l.upload.addEventListener("progress",r.notify,!1),l.addEventListener("load",function(t){try{r.resolve(e.parseJSON(t.currentTarget.response),status,l)}catch(i){r.reject(l,"error")}},!1),l.addEventListener("error",function(e,t,i){r.reject(e,t,i)},!1),l.open("POST",n.url),l.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.cookie("csrf_token")&&l.setRequestHeader("X-Csrf-Token",e.cookie("csrf_token")),l.send(u),r.promise()}var c=o.parent(),d=o.clone(!0);o=o.detach(),a=o.get(0);var h=e('<iframe src="/iframe.html" class="jupload-IF"></iframe>');h.attr("id",a.id+"IF").attr("name",a.id+"IF").appendTo(i);var p=e('<form method="post" enctype="multipart/form-data"><input type="hidden" name="id" value="'+a.id+'"/></form>');return p.append(o).attr("id",a.id+"form").attr("target",a.id+"IF").attr("action",n.url),h.one("load",function(){p.appendTo(h.contents().find("body")),p.submit(),c.append(d)}),t(h,a.id,r),r.promise()},i}),define("unifi/view/settings/MaintenanceView",["unifi/view/app/ContentView","underscore","msg/Msg","jquery","text!includes/settings/settingsMaintenanceTemplate.html","unifi/collection/SystemInfos","unifi/model/SystemInfo","unifi/model/Status","ubnt/view/dialogs/ConfirmDialogView","ubnt/view/dialogs/ErrorDialogView","ubnt/view/dialogs/WorkingDialogView","libs/fileupload"],function(e,t,i,n,s,o,a,r,l,u,c,d){"use strict";return e.extend({id:"settingsMaintenance",_templateId:s,initialize:function(t){e.prototype.initialize.call(this,t),this.app=t.app,n.when(this._rendered=n.Deferred(),this._dependencies=n.Deferred()).then(this.populate,this.failed),this.dependencies()},dependencies:function(){var e={SystemInfos:o},i=[],s={},a=this;t.each(e,function(e,t){i.push(s[t]=n.Deferred())},this),n.when.apply(n,i).then(function(){a._dependencies.resolve()},function(){a._dependencies.reject()}),t.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:s[t]}},e)},this)},render:function(){if(e.prototype.render.call(this),!this.rendered&&(this.rendered=!0)){var s=this;this.$el.html(t.template(this._templateId,{msg:i})),this.$el.find("select:not(.plain)").each(function(){var e=n(this),t=e.parent();e.selectmenu({parent:t,appendTo:t,label:e.data("label"),widthAdjust:10,icons:{button:"ubnt-icon-arrow-down secondary-color"},position:{at:"left bottom",collision:"flip"},change:function(){e.trigger("change")}})}),this.$downloadBackupDays=this.$el.find("#downloadTimeframe"),this.$downloadBackupLink=this.$el.find("#downloadBackupLink"),this.$downloadBackupLink.on("click",this.downloadBackupLink),this.$downloadSupportLink=this.$el.find("#downloadSupportLink"),this.$downloadSupportLink.on("click",this.downloadSupportLink),this.$el.find("form").on("submit",function(e){e.preventDefault(),s.save()}),this.$submit=this.$el.find("button.save"),this.$submit.buttonalert(),this.$serverVersion=this.$el.find("#serverVersion"),this.$upgradeVersion=this.$el.find("#upgradeVersion"),this.$restoreFile=this.$el.find("#restoreFile"),this.$restoreFile.on("change",this.uploadRestoreFile),this.$restoreProgress=this.$restoreFile.siblings("progress"),"resolved"===this._rendered.state()&&"resolved"==this._dependencies.state()?this.populate():"pending"===this._rendered.state()&&this._rendered.resolve()}},populate:function(){if(this._dependencies&&"resolved"==this._dependencies.state()){var e,t,i=this;this.systemInfo=this.app.collection("SystemInfos").at(0),this.$serverVersion.text(this.systemInfo.get("version")),this.systemInfo.get("update_available")&&this.systemInfo.get("update_downloaded")&&this.$upgradeVersion.text(" (Update "+this.systemInfo.get("update_version")+" is available)"),this.$el.find(".support-info select").each(function(){e=n(this),t=e.attr("name"),e.val(i.systemInfo.get("debug_"+t)||"warn").change()}),this.$downloadBackupDays.val(this.systemInfo.get("download_timeframe")||"7").change()}},failed:function(){(new u).open(i.E_DataLoad)},downloadBackupLink:function(){var e=this;return this.$downloadBackupLink.disable(),this.backupNotify=new c,this.backupNotify.open(i.I_ServerDownloading),this.systemInfo.backup({days:this.$downloadBackupDays.val(),success:function(t){location.replace(t.data[0].url),e.$downloadBackupLink.enable(),e.backupNotify.close(),e.backupNotify.remove()},error:function(){e.$downloadBackupLink.enable(),e.backupNotify.close(),e.backupNotify.remove()}}),!1},downloadSupportLink:function(){var e=this;return this.$downloadSupportLink.disable(),this.backupNotify=new c,this.backupNotify.open(i.I_ServerDownloadingSupport),this.systemInfo.downloadSupportLink({success:function(){location.replace("/dl/support"),e.$downloadSupportLink.enable(),e.backupNotify.close(),e.backupNotify.remove()},error:function(){e.$downloadSupportLink.enable(),e.backupNotify.close(),e.backupNotify.remove()}}),!1},uploadRestoreFile:function(){this.$restoreProgress.show(),this.$restoreFile.hide();var e=new d;e.upload(this.$el.find("form"),{url:"/upload/backup"}).progress(this.onRestoreProgress).done(this.onRestoreDone).fail(this.onRestoreDone)},onRestoreProgress:function(e){var t=this.$restoreProgress.get(0);this.$restoreProgress.val(e.loaded),e.total!==t.max&&(t.max=e.total)},onRestoreDone:function(e){this.$restoreProgress.hide(),this.$restoreFile=this.$el.find("#restoreFile").show(),e&&e.meta&&"ok"==e.meta.rc?(new l).show(i.localize(i.I_ConfirmRestore,e.meta.filename,new Date(parseInt(e.meta.timestamp,10))),n.proxy(function(){this.notify=new c,this.notify.open(i.I_AlertRestore),(new a).restore().always(n.proxy(function(e){e&&e.meta&&"ok"===e.meta.rc?(this.app.ajaxErrorOff(),this.poll(null,function(){location.reload()})):(this.notify.close(),this.notify.remove(),(new u).open(i.E_Fatal+": "+e.msg))},this))},this)):(new u).open("api.err.InvalidBackupVersion"===e.meta.msg?i.localize(i.E_InvalidBackupVersion,e.meta.filename,e.meta.version):i.localize(i.E_InvalidBackup,e.meta.filename))},poll:function(e,s){e=e||new r,e.fetch({global:!1}).always(n.proxy(function(n){if(n&&n.meta){if(n.meta.up===!0)return s&&s.apply(this,arguments);n.meta.msg&&(this.notify=this.notify||new c,this.notify.open(i[n.meta.msg]))}t.delay(this.poll,1500,e,s)},this))},save:function(){var e=this;this.$submit.trigger("saving"),n.when(e.systemInfo.setDebugLevel({debug_type:e.$el.find(".support-info select:eq(0)").attr("name"),debug_value:e.$el.find(".support-info select:eq(0)").val()}),e.systemInfo.setDebugLevel({debug_type:e.$el.find(".support-info select:eq(1)").attr("name"),debug_value:e.$el.find(".support-info select:eq(1)").val()}),e.systemInfo.setDebugLevel({debug_type:e.$el.find(".support-info select:eq(2)").attr("name"),debug_value:e.$el.find(".support-info select:eq(2)").val()}),e.systemInfo.setBackupDays({days:e.$downloadBackupDays.val()})).then(n.proxy(this.success,this),n.proxy(this.error,this))},success:function(){this.$submit.trigger("success")},error:function(){this.$submit.trigger("error")},remove:function(){this.$downloadBackupLink.off("click",this.downloadBackupLink),this.$downloadSupportLink.off("click",this.downloadSupportLink),this.$el.find("form").off("submit"),this.$restoreFile.off("change"),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/view/settings/ChromeView",["unifi/view/app/DialogView","underscore","jquery","backbone","msg/Msg","text!includes/settings/settingsChromeTemplate.html","unifi/view/settings/AdminsFormView","unifi/view/settings/AdminsView","unifi/view/settings/ChromeView","unifi/view/settings/SiteView","unifi/view/settings/FormView","unifi/view/settings/GuestControlView","unifi/view/settings/ListContentView","unifi/view/settings/UserGroupsFormView","unifi/view/settings/UserGroupsView","unifi/view/settings/NetworksFormView","unifi/view/settings/NetworksView","unifi/view/settings/WirelessNetworksFormView","unifi/view/settings/WirelessNetworksView","unifi/view/settings/VoipView","unifi/view/settings/ExtensionsView","unifi/view/settings/ControllerView","unifi/view/settings/MaintenanceView"],function(e,t,i,n,s,o,a,r,l,u,c,d,h,p,f,m,g,_,v,b,A,y,C){"use strict";return e.extend({id:"settingsChrome",className:"container",permanent:!0,dialogOptions:{dialogClass:"dialog-settings",title:"Settings",disableAutofocus:!0},sections:{site:u,admins:r,usergroups:f,wirelessnetworks:v,networks:g,guestcontrol:d,voip:b,extensions:A,controller:y,maintenance:C},initialize:function(i){e.prototype.initialize.call(this),this.app=i.app,this.views={},t.bindAll(this,"onResizeWindow","onBodyClick")},render:function(){!this.rendered&&(this.rendered=!0)&&(this.$el.html(t.template(o,{msg:s})),this.$content=this.$el.find("#settingsContent"),this.$settingsNav=this.$("#settingsNav"),this.$settingsNav.find("a").on("click",i.proxy(function(e){e.preventDefault();var t=i(e.currentTarget),n=t.data("section");this.renderSection(n)},this)))},renderSection:function(e,t){this.views[e]||(this.views[e]=new this.sections[e]({app:this.app,container:this.$content})),this.app.settings=e,this.views[e].render(),t&&this.views[e].whenReady(function(){var e=this.collection.get(t);this.rowEdit(e)}),this.$settingsNav.find("li").removeClass("active").has("a[data-section="+e+"]").addClass("active")},open:function(n){e.prototype.open.call(this),this.app.settings=this.app.settings||"site",this.renderSection(this.app.settings,n),i.Window.on("resize.settingsDialog",t.debounce(this.onResizeWindow,250)),this.onResizeWindow()},close:function(){e.prototype.close.call(this),i.Body.off("click",this.onBodyClick),i.Window.off("resize.settingsDialog")},onBodyClick:function(e){var t=i(e.target);!this.$el.dialog("isOpen")||t.is(".ui-dialog a")||t.closest(".ui-dialog").length||t.closest(".ui-menu-item").length||this.close()},onResizeWindow:function(){var e={},n={width:1140,height:400};t.each(["width","height"],function(t){var s=.9*i.Window[t]();e[t]=s<n[t]?n[t]:s}),this.$el.dialog(e),this.$el.dialog("option","position","center")},detectChanges:function(){this.$cancel=this.$("button.cancel"),this.$submit=this.$el.find("button.save"),this.setElements()},setElements:function(){var e,i,n;e=[this.$file=this.$("#settingsContent fieldset").find('input[type="file"]'),this.$checkbox=this.$("#settingsContent fieldset").find('input[type="checkbox"]'),this.$select=this.$("#settingsContent fieldset").find("select"),this.$inputText=this.$("#settingsContent fieldset").find('input[type="text"]'),this.$button=this.$("#settingsContent fieldset").find("button"),this.$uiButton=this.$("#settingsContent fieldset").find(".ui-button"),this.$selectButton=this.$("#settingsContent fieldset").find(".ui-selectmenu-button")],t.each(e,function(e){switch(i=e.attr("type")){case"checkbox":case"file":n="change";break;case"text":n="keyup";break;case void 0:n="click"}})},reset:function(){this.close(),this.$settingsNav.find("a").off(),t.each(this.views,function(e){e.remove&&e.remove()},this),this.views={},this.rendered=!1},remove:function(){t.each(this.views,function(e){e.remove&&e.remove()},this),this.views={},this.$settingsNav.find("a").off("click"),i.Body.off("click",this.onBodyClick),i.Window.off("resize.settingsDialog"),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("text!includes/roadblock/roadBlockTemplate.html",[],function(){return'<div id="RoadBlock">\n	<div class="content">\n		<div class="edge-logo"><img src="/lib/4.7.6/images/edge-max.png" /></div>\n		<h1><%- msg.G_roadblockEdge %></h1>\n		<h3><%- msg.G_roadBlockMillPerSec %></h3>\n		<p><%- msg.G_roadBlockCopy %></p>\n		<div class="bottom">\n			<a href="#" class="roadblock"><%- msg.G_roadBlockMoreDetails %></a> \n			<div class="left">\n				<label for="showRoadblock">\n					<input id="showRoadblock" type="checkbox" name="showRadblock" />\n					<%- msg.G_roadBlockDontShow %>\n				</label>\n			</div>\n			<div class="right">\n				<a href="#"><%- msg.G_roadBlockSkipPromo %> <span class="ubnt-icon-arrow-right"></span></a>\n			</div>\n		</div>\n	</div>\n</div>'}),define("unifi/view/roadblock/ChromeView",["unifi/view/app/DialogView","underscore","jquery","backbone","msg/Msg","text!includes/roadblock/roadBlockTemplate.html","libs/jquery.cookie"],function(e,t,i,n,s,o){"use strict";return e.extend({id:"roadBlockChrome",className:"container",dialogOptions:{dialogClass:"dialog-roadblock",title:"",width:1024,height:768,disableAutofocus:!0},initialize:function(i){e.prototype.initialize.call(this),this.app=i.app,t.bindAll(this)},render:function(){this.$el.html(t.template(o,{msg:s}))},open:function(){e.prototype.open.call(this),i.Window.on("resize.addDeviceDialog",t.debounce(this.onResizeWindow,250)),this.onResizeWindow()},onResizeWindow:function(){this.center()},close:function(){e.prototype.close.call(this),i.Window.off("resize.settingsDialog")}})}),define("text!includes/add_site/add_site.html",[],function(){return'<div id="add-site" class="dialog-simple-form">\n    <div class="content left">\n        <div class="errors" style="display:none"></div>\n\n        <form id="addSiteForm" action="" class="left">\n            <div id="addNewSiteRow" class="row">\n                <input id="siteName" \n                       name="site-name" \n                       type="text" \n                       placeholder="<%- msg.G_SettingsSiteName %>" \n                       class="input site-name" />\n            </div>\n\n            <div class="footer">\n                <button class="button button-submit tall green right" type="submit">\n                    <span class="ubnt-icon-check ui-button-icon button-check-icon"></span>\n                </button>\n            </div>\n        </form>\n    </div>\n</div>\n'}),define("unifi/view/app/AddSiteView",["unifi/view/app/DialogView","text!includes/add_site/add_site.html","msg/Msg","backbone","underscore","jquery"],function(e,t,i,n,s,o){"use strict";return e.extend({events:{"keyup input[name=site-name]":"validateInputs","click .button-submit":"onSubmit","submit #addSiteForm":"onSubmit"},dialogOptions:{title:i.G_AddNewSite,width:"auto",height:"auto",modal:!0,resizable:!1,draggable:!1,dialogClass:"dialog-add-site dialog-simple"},initialize:function(e){s.bindAll(this),this.app=e.app},render:function(){this.$el.html(s.template(t,{msg:i})),this.$siteNameInput=this.$("input[name=site-name]").focus(),this.$submitButton=this.$(".button-submit"),this.$errors=this.$(".errors"),this.$submitButton.find("span").after(i.G_Submit)},open:function(){e.prototype.open.call(this),o.Window.on("resize.addSiteDialog",s.debounce(this.onResizeWindow,250)),this.$submitButton.prop("disabled",!0),this.onResizeWindow()},close:function(){e.prototype.close.call(this),o.Window.off("resize.addSiteDialog")},onResizeWindow:function(){this.center()},validateInputs:function(){var e,t=0,n=[this.$siteNameInput];this.$siteNameInput.removeClass("error"),this.$errors.hide(),this.$errors.find(".error-msg").remove(),s.each(n,function(e){e.val()||t++},this),this.app.data.Sites.collection.models[0].validator.name(this.$siteNameInput.val())||(e=i.localize(i.E_InvalidName,i.G_Name),this.$siteNameInput.addClass("error")),e?this.$submitButton.prop("disabled",!0):this.$submitButton.prop("disabled",!!t),e&&(this.$errors.show(),this.$errors.prepend(o('<div class="left error-msg"></div>').text(e)))},onSubmit:function(){var e=this,t=this.app.collection("Sites"),n={desc:this.$siteNameInput.val()};return t.create(n,{wait:!0,success:function(t){var i=t.id;e.app.changeSite(i),e.close()},error:function(t,n){var s=(n.responseJSON.meta.msg,i.apiError(n));e.$errors.show().text(s)}}),!1}})}),function(e,t){e.widget("ui.selectmenu",{version:"@VERSION",defaultElement:"<select>",options:{appendTo:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={id:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._on(document,this._documentClick),this.options.disabled&&this.disable()},_drawButton:function(){var t=this.element.attr("tabindex");this.label=e("label[for='"+this.ids.id+"']").attr("for",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<a>",{"class":"ui-button ui-widget ui-state-default ui-corner-all",href:"#"+this.ids.id,tabindex:t?t:this.options.disabled?-1:0,id:this.ids.button,width:this.element.outerWidth(),role:"combobox","aria-expanded":!1,"aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":!0}),this.button.prepend(e("<span>",{"class":"ui-icon "+this.options.icons.button})),this.buttonText=e("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this.buttonWrap=e("<span>",{"class":"ui-selectmenu-button"}).append(this.button).insertAfter(this.element),this._on(this.button,this._buttonEvents),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var i,n=this;this.menu=e("<ul>",{"aria-hidden":!0,"aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>",{"class":"ui-selectmenu-menu",width:this.button.outerWidth()}).append(this.menu).appendTo(this._appendTo()),i=this.menu.menu({select:function(e,t){var i=t.item.data("ui-selectmenu-item");n._select(i,e),n.isOpen&&(e.preventDefault(),n.close(e))},focus:function(e,i){var s=i.item.data("ui-selectmenu-item");n.focus!==t&&s.index!==n.focus&&(n._trigger("focus",e,{item:s}),n.isOpen||n._select(s,e)),n.focus=s.index,n.button.attr("aria-activedescendant",n.menuItems.eq(s.index).find("a").attr("id"))},role:"listbox"}).data("ui-menu"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),i.delay=999999999,i._off(this.menu,"mouseleave")},refresh:function(){this.menu.empty();var e,t=this.element.find("option");t.length&&(this._readOptions(t),this._renderMenu(this.menu,this.items),this.menu.menu("refresh"),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),e=this._getSelectedItem(),this.menu.menu("focus",null,e),this._setSelected(e.data("ui-selectmenu-item")),this._setOption("disabled",this._getCreateOptions().disabled))},open:function(t){this.options.disabled||(this.isOpen=!0,this._toggleAttr(),this.menuWrap.position(e.extend({of:this.button},this.options.position)),this._trigger("open",t))},close:function(e){if(this.isOpen){if(this.isOpen=!1,this._toggleAttr(),this.menuItems){var t=this._getSelectedItem().find("a").attr("id");this.button.attr("aria-activedescendant",t),this.menu.attr("aria-activedescendant",t)}this._trigger("close",e)}},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,i){var n=this,s="";e.each(i,function(i,o){o.optgroup!==s&&(e("<li>",{"class":"ui-selectmenu-optgroup"+(o.element.parent("optgroup").attr("disabled")?" ui-state-disabled":""),text:o.optgroup}).appendTo(t),s=o.optgroup),n._renderItem(t,o)})},_renderItem:function(t,i){var n=e("<li>").data("ui-selectmenu-item",i),s=e("<a>",{href:"#"});return i.disabled&&n.addClass("ui-state-disabled"),this._setText(s,i.label),n.append(s).appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){"first"===e||"last"===e?this.menu.menu("focus",t,this.menuItems[e]()):this.menu.menu(e,t)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this.isOpen?this.close(e):this.open(e)},_documentClick:{click:function(t){this.isOpen&&!e(t.target).closest("li.ui-state-disabled, li.ui-selectmenu-optgroup, #"+this.ids.button).length&&this.close(t)}},_buttonEvents:{focus:function(){this.refresh(),this.button.addClass("ui-state-focus"),this._off(this.button,"focus")},click:function(e){this._toggle(e),e.preventDefault()},keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.isOpen&&this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this.menu.menu("select",t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("previous",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this.menu.menu("select",t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("previous",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setSelected(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e})},_setSelected:function(e){this._setText(this.buttonText,e.label),this.menuItems.find("a").attr("aria-selected",!1),this.menuItems.eq(e.index).find("a").attr("aria-selected",!0),this.button.attr("aria-labelledby",this.menuItems.eq(e.index).find("a").attr("id"))},_setOption:function(e,t){"icons"===e&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"disabled"===e&&(this.menu.menu("option","disabled",t),t?(this.element.attr("disabled","disabled"),this.button.attr("tabindex",-1),this.close()):(this.element.removeAttr("disabled"),this.button.attr("tabindex",0)))},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen),this.button.attr("aria-expanded",this.isOpen)},_getCreateOptions:function(){return{disabled:!!this.element.attr("disabled")}},_readOptions:function(t){var i=[];t.each(function(t,n){var s=e(n),o=s.parent("optgroup");i.push({element:s,index:t,value:s.attr("value"),label:s.text(),optgroup:o.attr("label")||"",disabled:o.attr("disabled")||s.attr("disabled")})}),this.items=i},_destroy:function(){this.menuWrap.remove(),this.buttonWrap.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.id)}})}(jQuery),define("libs/jquery.ui.selectmenu",function(){}),define("ubnt/ubnt.selectmenu",["jquery","jquery-ui","libs/jquery.ui.selectmenu"],function(e){"use strict";e.widget("ubnt.selectmenu",e.ui.selectmenu,{_create:function(){var t=this;this.options.position&&!this.options.position.using&&(this.options.position.using=function(){t._using.apply(t,arguments)}),this.options.widthAdjust&&this.element.width(e.proxy(function(e,t){return t+this.options.widthAdjust},this)),e.ui.selectmenu.prototype._create.apply(this,arguments),this.options.parent.attr("id")||this.options.parent.uniqueId(),this.options.parent.addClass("ui-selectmenu-parent").on("click",function(e){t._validTarget(e)&&(e.preventDefault(),t.refresh(),t._toggle(e))}),this.element.on("change",function(){t.menuItems?t._setSelected(t._getSelectedItem().data("ui-selectmenu-item")):t.refresh()})},_using:function(e,t){"vertical"==t.important&&("top"==t.vertical?(this.button.removeClass("ui-flipped-vertical"),this.menuWrap.removeClass("ui-flipped-vertical"),this.button.addClass("ui-normal-vertical"),this.menuWrap.addClass("ui-normal-vertical")):(this.button.removeClass("ui-normal-vertical"),this.menuWrap.removeClass("ui-normal-vertical"),this.button.addClass("ui-flipped-vertical"),this.menuWrap.addClass("ui-flipped-vertical"))),this.menuWrap.css(e)},_validTarget:function(t){var i=e(t.target),n=this.options.parent.attr("id");return i.parents("#"+n).length||i.attr("id")==n},_drawButton:function(){e.ui.selectmenu.prototype._drawButton.apply(this,arguments),this.label.off("click"),this.button.off("click").off("focus")},_drawMenu:function(){e.ui.selectmenu.prototype._drawMenu.apply(this,arguments),this.menu.menu("option","focus",function(){})},_setText:function(t,i){e.ui.selectmenu.prototype._setText.call(this,t,(this.options.label||"")+i)},_getCreateEventData:function(){return{menu:this.menu,menuWrap:this.menuWrap}},open:function(){e.ui.selectmenu.prototype.open.apply(this,arguments),this.menuWrap.width(this.options.sizeToParent?this.options.parent.outerWidth():this.options.sizeToButtonOuter?this.button.outerWidth():this.button.width()),this.options.parent.addClass("active"),this.button.focus()},close:function(){e.ui.selectmenu.prototype.close.apply(this,arguments),this.options.parent.removeClass("active")},resize:function(e){this.button.width(e||this.element.outerWidth())},_documentClick:{click:function(t){this.isOpen&&!e(t.target).closest("li.ui-state-disabled, li.ui-selectmenu-optgroup, #"+this.ids.button).length&&(this._validTarget(t)||this.close(t))}}})}),window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}(),window.requestInterval=function(e,t){function i(){var o=(new Date).getTime(),a=o-n;
a>=t&&(e.call(),n=(new Date).getTime()),s.value=requestAnimFrame(i)}if(!(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame&&window.mozCancelRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame))return window.setInterval(e,t);var n=(new Date).getTime(),s={};return s.value=requestAnimFrame(i),s},window.clearRequestInterval=function(e){window.cancelAnimationFrame?window.cancelAnimationFrame(e.value):window.webkitCancelAnimationFrame?window.webkitCancelAnimationFrame(e.value):window.webkitCancelRequestAnimationFrame?window.webkitCancelRequestAnimationFrame(e.value):window.mozCancelRequestAnimationFrame?window.mozCancelRequestAnimationFrame(e.value):window.oCancelRequestAnimationFrame?window.oCancelRequestAnimationFrame(e.value):window.msCancelRequestAnimationFrame?window.msCancelRequestAnimationFrame(e.value):clearInterval(e)},window.requestTimeout=function(e,t){function i(){var o=(new Date).getTime(),a=o-n;a>=t?e.call():s.value=requestAnimFrame(i)}if(!(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame&&window.mozCancelRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame))return window.setTimeout(e,t);var n=(new Date).getTime(),s={};return s.value=requestAnimFrame(i),s},window.clearRequestTimeout=function(e){window.cancelAnimationFrame?window.cancelAnimationFrame(e.value):window.webkitCancelAnimationFrame?window.webkitCancelAnimationFrame(e.value):window.webkitCancelRequestAnimationFrame?window.webkitCancelRequestAnimationFrame(e.value):window.mozCancelRequestAnimationFrame?window.mozCancelRequestAnimationFrame(e.value):window.oCancelRequestAnimationFrame?window.oCancelRequestAnimationFrame(e.value):window.msCancelRequestAnimationFrame?window.msCancelRequestAnimationFrame(e.value):clearTimeout(e)},define("libs/raf",function(){}),function(e){e.fn.extend({retinise:function(t){var i={suffix:"@2x",srcattr:"data-src",retattr:"data-ret",altattr:"data-alt"},n=e.extend(i,t),s=window.devicePixelRatio,o=s>1?!0:!1;e(this).each(function(){var t=e(this),i=t.css("display");if(t.css("display","none"),t.attr(n.srcattr)){var a=t.attr(n.srcattr),r=t.attr(n.altattr),l=t.attr(n.retattr);o===!0?(t.attr(t.attr(n.retattr)?{src:l,alt:r}:{src:a.replace(/\.\w+$/,function(e){return n.suffix+e}),alt:r}),t.load(function(){var e=t.height()/s,n=t.width()/s;t.attr({height:e,width:n}).css({display:i})})):t.attr({src:a,alt:r}).css({display:i})}})}})}(jQuery),define("retina",["jquery"],function(){}),define("unifi/view/app/ChromeView",["backbone","underscore","unifi/view/app/UserPopOverView","msg/Msg","jquery","unifi/collection/Sites","ubnt/GoogleAnalytics","unifi/view/settings/ChromeView","unifi/view/roadblock/ChromeView","unifi/view/app/AddSiteView","ubnt/ubnt.selectmenu","libs/jquery.cookie","libs/raf","retina"],function(e,t,i,n,s,o,a,r,l,u){"use strict";return e.View.extend({initialize:function(e){this.app=e.app,this.config=e.config,this.title=document.title,this.views={},this.setElement(s("#columnMainContent")),s("body").append(this.$flashes=s('<div id="flashes"></div>'))},render:function(){if(this.$preload=s("#preload").detach(),!this.rendered&&(this.rendered=!0)){s("#header form").show();var e=this,a=s("#navigation");t.each(["location","refresh"],function(t){var i=s("select#"+t),o=i.parents("fieldset"),a=s.noop;if("location"==t&&"Admin"==this.config.site&&(a=function(t,i){s('<button class="button header is-super"><span class="ubnt-icon-plus ui-button-icon button-add-icon"></span>'+n.G_AddSite+"</button>").on("click",function(){var t=new u({app:e.app});t.open()}).appendTo(i.menuWrap)}),"refresh"==t){var r=s.cookie("refreshInterval");i.find("option[value="+r+"]").prop("selected",!0)}i.selectmenu({parent:o,appendTo:s("#header"),sizeToParent:!0,icons:{button:"ubnt-icon-arrow-down header-select-arrow"},position:{at:"left bottom+12"},change:function(){i.trigger("change")},create:a})},this),"Operator"==this.config.site&&this.options.cloudUser&&"admin"==this.options.cloudUser.get("site_role")&&a.append('<li id="navOperators">    <a href="/operators" data-page="operators">        <span class="ubnt-icon-id nav-icons nav-operators"></span>        <span class="nav-text"></span>    </a></li>'),s("#refresh").after(s('<div class="refresh-status"><span>'+n.G_Refresh+"</span></div>").on("click",function(t){t.stopPropagation(),e.app.refresh(!0)})),s("#refresh").on("change",function(){var t=s(this).find("option:selected").val(),i=!1;e._refreshInterval&&window[i?"clearRequestInterval":"clearInterval"](e._refreshInterval),t>0&&(e._refreshInterval=window[i?"requestInterval":"setInterval"](function(){e.app.refresh(!1)},1e3*t)),t>=120?s.cookie("refreshInterval",t):s.cookie("refreshInterval",120)}).trigger("change"),s("#location").on("change",function(t,i){i||e.app.changeSite(s(this).find("option:selected").val())});var c=this.app.collection("Sites",{},o);this.listenTo(c,"change",this.populateLocation),this.listenTo(c,"remove",this.populateLocation),this.listenTo(c,"add",this.populateLocation),this.populateLocation(),s(".retina").retinise(),this.userPopOver=new i({model:this.options.cloudUser}),s("#headerAvatar .user").on("click",function(){return e.userPopOver.toggleClass(),!1}),s(document).click(function(){e.userPopOver.hide()}),s("#headerAvatar").show(),s("body").on("click","span",this.onSpanClick),this.app.updatePushStateUrls(a.find("a")),a.find("a").not("a[data-page=settings]").on("click",function(t){t.preventDefault();var i=s(t.currentTarget),n=i.data("page");e.app.routers[n].navigate(n,{trigger:!0})}),a.find("a[data-page=settings]").on("click",s.proxy(function(e,t){e.preventDefault(),this.views.settings||(this.views.settings=new r({app:this.options.app})),this.views.settings.open(t)},this));var d=(new l({app:e.options.app}),s("#navDashboard")),h=s("#navMap"),p=s("#navDevices"),f=s("#navClients"),m=s("#navStatistics"),g=s("#navInsights"),_=s("#navSupport"),v=s("#navSettings"),b=s("#navGuests"),A=s("#navPayments"),y=s("#navVouchers"),C=s("#navOperators"),F=s("#navTest");b.find(".nav-text").text(n.G_HotspotNavGuests),A.find(".nav-text").text(n.G_HotspotNavPayments),y.find(".nav-text").text(n.G_HotspotNavVouchers),C.find(".nav-text").text(n.G_HotspotNavOperators),d.find(".nav-text").text(n.G_NavDashboard),h.find(".nav-text").text(n.G_NavMap),p.find(".nav-text").text(n.G_NavDevices),f.find(".nav-text").text(n.G_NavClients),m.find(".nav-text").text(n.G_NavStatistics),g.find(".nav-text").text(n.G_NavInsights),_.find(".nav-text").text(n.G_NavSupport),v.find(".nav-text").text(n.G_NavSettings),F.find(".nav-text").text("Test")}else s("#location").val(SITE.id).trigger("change",!0);return this},flash:function(e,i,n,o){var a,r;switch(e){case"success":i=i||"Success",a="ubnt-icon-check checkmark",r="status-success";break;case"error":i=i||"Error",a="ubnt-icon-warning alert",r="status-error"}var l=s('<div class="status-alert '+r+'">'+i+"</div>");a&&l.prepend(s('<span class="'+a+'"></span>&nbsp;')),n&&l.append(s('<div class="details">'+n+"</div>")),this.$flashes.append(l),o||t.delay(function(e){e.fadeOut(function(){s(this).remove()})},3e3,l)},refreshing:function(e){var i=s("#header .refresh-status");t.isUndefined(e)?i.addClass("active"):(t.delay(function(){i.removeClass("active"),i.addClass(e?"success":"error")},1e3),t.delay(function(e){i.removeClass(e)},3e3,e?"success":"error"))},populateLocation:function(){var e=s("#location").empty();this.app.collection("Sites",{},o).each(function(t){t.get("attr_hidden")||e.append(s('<option value="'+t.id+'"></option>').text(t.get("desc")||t.get("name")).attr("selected",t.id==SITE.id))},this),e.selectmenu("refresh")},updateTitle:function(t){var i=(e.history.fragment," | ");document.title=this.title+i+t},reset:function(){s("body").append(this.$preload),t.each(this.views,function(e){e.reset&&e.reset()},this),this.$el.find("> .content").remove()},navigate:function(e){var t=s("#nav"+(e.charAt(0).toUpperCase()+e.slice(1))),i=t.find("a");s("#navigation").find("li").removeClass("active"),t.addClass("active");var n=i.data("title");if(!n){var o=i.data("page");n=o.charAt(0).toUpperCase()+o.substr(1)}this.updateTitle(n),a.trackPage()},onSpanClick:function(e){var i=s(e.currentTarget),n=i.prev();t.contains(["checkbox","radio"],n.attr("type"))&&n.click()},remove:function(){t.each(this.views,function(e){e.remove&&e.remove()},this),this.views={},this.rendered=!1,e.View.prototype.remove.apply(this,arguments)}})});