/*!
 * 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.6.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.6.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.6.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 H(e){var t=e.length,n=w.type(e);return w.isWindow(e)?!1:e.nodeType===1&&t?!0:n==="array"||n!=="function"&&(t===0||typeof t=="number"&&t>0&&t-1 in e)}function j(e){var t=B[e]={};return w.each(e.match(S)||[],function(e,n){t[n]=!0}),t}function q(e,n,r,i){if(!w.acceptData(e))return;var s,o,u=w.expando,a=e.nodeType,f=a?w.cache:e,l=a?e[u]:e[u]&&u;if((!l||!f[l]||!i&&!f[l].data)&&r===t&&typeof n=="string")return;l||(a?l=e[u]=c.pop()||w.guid++:l=u),f[l]||(f[l]=a?{}:{toJSON:w.noop});if(typeof n=="object"||typeof n=="function")i?f[l]=w.extend(f[l],n):f[l].data=w.extend(f[l].data,n);return o=f[l],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[w.camelCase(n)]=r),typeof n=="string"?(s=o[n],s==null&&(s=o[w.camelCase(n)])):s=o,s}function R(e,t,n){if(!w.acceptData(e))return;var r,i,s=e.nodeType,o=s?w.cache:e,u=s?e[w.expando]:w.expando;if(!o[u])return;if(t){r=n?o[u]:o[u].data;if(r){w.isArray(t)?t=t.concat(w.map(t,w.camelCase)):t in r?t=[t]:(t=w.camelCase(t),t in r?t=[t]:t=t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!z(r):!w.isEmptyObject(r))return}}if(!n){delete o[u].data;if(!z(o[u]))return}s?w.cleanData([e],!0):w.support.deleteExpando||o!=o.window?delete o[u]:o[u]=null}function U(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(I,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:F.test(r)?w.parseJSON(r):r}catch(s){}w.data(e,n,r)}else r=t}return r}function z(e){var t;for(t in e){if(t==="data"&&w.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function it(){return!0}function st(){return!1}function ot(){try{return o.activeElement}catch(e){}}function ct(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ht(e,t,n){if(w.isFunction(t))return w.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return w.grep(e,function(e){return e===t!==n});if(typeof t=="string"){if(ut.test(t))return w.filter(t,e,n);t=w.filter(t,e)}return w.grep(e,function(e){return w.inArray(e,t)>=0!==n})}function pt(e){var t=dt.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Mt(e,t){return w.nodeName(e,"table")&&w.nodeName(t.nodeType===1?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function _t(e){return e.type=(w.find.attr(e,"type")!==null)+"/"+e.type,e}function Dt(e){var t=Ct.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Pt(e,t){var n,r=0;for(;(n=e[r])!=null;r++)w._data(n,"globalEval",!t||w._data(t[r],"globalEval"))}function Ht(e,t){if(t.nodeType!==1||!w.hasData(e))return;var n,r,i,s=w._data(e),o=w._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)w.event.add(t,n,u[n][r])}o.data&&(o.data=w.extend({},o.data))}function Bt(e,t){var n,r,i;if(t.nodeType!==1)return;n=t.nodeName.toLowerCase();if(!w.support.noCloneEvent&&t[w.expando]){i=w._data(t);for(r in i.events)w.removeEvent(t,r,i.handle);t.removeAttribute(w.expando)}if(n==="script"&&t.text!==e.text)_t(t).text=e.text,Dt(t);else if(n==="object")t.parentNode&&(t.outerHTML=e.outerHTML),w.support.html5Clone&&e.innerHTML&&!w.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML);else if(n==="input"&&xt.test(e.type))t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value);else if(n==="option")t.defaultSelected=t.selected=e.defaultSelected;else if(n==="input"||n==="textarea")t.defaultValue=e.defaultValue}function jt(e,n){var r,s,o=0,u=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!u)for(u=[],r=e.childNodes||e;(s=r[o])!=null;o++)!n||w.nodeName(s,n)?u.push(s):w.merge(u,jt(s,n));return n===t||n&&w.nodeName(e,n)?w.merge([e],u):u}function Ft(e){xt.test(e.type)&&(e.defaultChecked=e.checked)}function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--){t=en[i]+n;if(t in e)return t}return r}function nn(e,t){return e=t||e,w.css(e,"display")==="none"||!w.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,s=[],o=0,u=e.length;for(;o<u;o++){r=e[o];if(!r.style)continue;s[o]=w._data(r,"olddisplay"),n=r.style.display,t?(!s[o]&&n==="none"&&(r.style.display=""),r.style.display===""&&nn(r)&&(s[o]=w._data(r,"olddisplay",an(r.nodeName)))):s[o]||(i=nn(r),(n&&n!=="none"||!i)&&w._data(r,"olddisplay",i?n:w.css(r,"display")))}for(o=0;o<u;o++){r=e[o];if(!r.style)continue;if(!t||r.style.display==="none"||r.style.display==="")r.style.display=t?s[o]||"":"none"}return e}function sn(e,t,n){var r=$t.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function on(e,t,n,r,i){var s=n===(r?"border":"content")?4:t==="width"?1:0,o=0;for(;s<4;s+=2)n==="margin"&&(o+=w.css(e,n+Zt[s],!0,i)),r?(n==="content"&&(o-=w.css(e,"padding"+Zt[s],!0,i)),n!=="margin"&&(o-=w.css(e,"border"+Zt[s]+"Width",!0,i))):(o+=w.css(e,"padding"+Zt[s],!0,i),n!=="padding"&&(o+=w.css(e,"border"+Zt[s]+"Width",!0,i)));return o}function un(e,t,n){var r=!0,i=t==="width"?e.offsetWidth:e.offsetHeight,s=qt(e),o=w.support.boxSizing&&w.css(e,"boxSizing",!1,s)==="border-box";if(i<=0||i==null){i=Rt(e,t,s);if(i<0||i==null)i=e.style[t];if(Jt.test(i))return i;r=o&&(w.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+on(e,t,n||(o?"border":"content"),r,s)+"px"}function an(e){var t=o,n=Qt[e];if(!n){n=fn(e,t);if(n==="none"||!n)It=(It||w("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(It[0].contentWindow||It[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=fn(e,t),It.detach();Qt[e]=n}return n}function fn(e,t){var n=w(t.createElement(e)).appendTo(t.body),r=w.css(n[0],"display");return n.remove(),r}function vn(e,t,n,r){var i;if(w.isArray(t))w.each(t,function(t,i){n||cn.test(e)?r(e,i):vn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&w.type(t)==="object")for(i in t)vn(e+"["+i+"]",t[i],n,r);else r(e,t)}function _n(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i=0,s=t.toLowerCase().match(S)||[];if(w.isFunction(n))while(r=s[i++])r[0]==="+"?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Dn(e,t,n,r){function o(u){var a;return i[u]=!0,w.each(e[u]||[],function(e,u){var f=u(t,n,r);if(typeof f=="string"&&!s&&!i[f])return t.dataTypes.unshift(f),o(f),!1;if(s)return!(a=f)}),a}var i={},s=e===An;return o(t.dataTypes[0])||!i["*"]&&o("*")}function Pn(e,n){var r,i,s=w.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((s[i]?e:r||(r={}))[i]=n[i]);return r&&w.extend(!0,e,r),e}function Hn(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes;while(f[0]==="*")f.shift(),s===t&&(s=e.mimeType||n.getResponseHeader("Content-Type"));if(s)for(u in a)if(a[u]&&a[u].test(s)){f.unshift(u);break}if(f[0]in r)o=f[0];else{for(u in r){if(!f[0]||e.converters[u+" "+f[0]]){o=u;break}i||(i=u)}o=o||i}if(o)return o!==f[0]&&f.unshift(o),r[o]}function Bn(e,t,n,r){var i,s,o,u,a,f={},l=e.dataTypes.slice();if(l[1])for(o in e.converters)f[o.toLowerCase()]=e.converters[o];s=l.shift();while(s){e.responseFields[s]&&(n[e.responseFields[s]]=t),!a&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a=s,s=l.shift();if(s)if(s==="*")s=a;else if(a!=="*"&&a!==s){o=f[a+" "+s]||f["* "+s];if(!o)for(i in f){u=i.split(" ");if(u[1]===s){o=f[a+" "+u[0]]||f["* "+u[0]];if(o){o===!0?o=f[i]:f[i]!==!0&&(s=u[0],l.unshift(u[1]));break}}}if(o!==!0)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(c){return{state:"parsererror",error:o?c:"No conversion from "+a+" to "+s}}}}return{state:"success",data:t}}function zn(){try{return new e.XMLHttpRequest}catch(t){}}function Wn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Yn(){return setTimeout(function(){Xn=t}),Xn=w.now()}function Zn(e,t,n){var r,i=(Gn[t]||[]).concat(Gn["*"]),s=0,o=i.length;for(;s<o;s++)if(r=i[s].call(n,t,e))return r}function er(e,t,n){var r,i,s=0,o=Qn.length,u=w.Deferred().always(function(){delete a.elem}),a=function(){if(i)return!1;var t=Xn||Yn(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,s=1-r,o=0,a=f.tweens.length;for(;o<a;o++)f.tweens[o].run(s);return u.notifyWith(e,[f,s,n]),s<1&&a?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Yn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(r),r},stop:function(t){var n=0,r=t?f.tweens.length:0;if(i)return this;i=!0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;tr(l,f.opts.specialEasing);for(;s<o;s++){r=Qn[s].call(f,e,l,f.opts);if(r)return r}return w.map(l,Zn,f),w.isFunction(f.opts.start)&&f.opts.start.call(e,f),w.fx.timer(w.extend(a,{elem:e,anim:f,queue:f.opts.queue})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function tr(e,t){var n,r,i,s,o;for(n in e){r=w.camelCase(n),i=t[r],s=e[n],w.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=w.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function nr(e,t,n){var r,i,s,o,u,a,f=this,l={},c=e.style,h=e.nodeType&&nn(e),p=w._data(e,"fxshow");n.queue||(u=w._queueHooks(e,"fx"),u.unqueued==null&&(u.unqueued=0,a=u.empty.fire,u.empty.fire=function(){u.unqueued||a()}),u.unqueued++,f.always(function(){f.always(function(){u.unqueued--,w.queue(e,"fx").length||u.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[c.overflow,c.overflowX,c.overflowY],w.css(e,"display")==="inline"&&w.css(e,"float")==="none"&&(!w.support.inlineBlockNeedsLayout||an(e.nodeName)==="inline"?c.display="inline-block":c.zoom=1)),n.overflow&&(c.overflow="hidden",w.support.shrinkWrapBlocks||f.always(function(){c.overflow=n.overflow[0],c.overflowX=n.overflow[1],c.overflowY=n.overflow[2]}));for(r in t){i=t[r];if($n.exec(i)){delete t[r],s=s||i==="toggle";if(i===(h?"hide":"show"))continue;l[r]=p&&p[r]||w.style(e,r)}}if(!w.isEmptyObject(l)){p?"hidden"in p&&(h=p.hidden):p=w._data(e,"fxshow",{}),s&&(p.hidden=!h),h?w(e).show():f.done(function(){w(e).hide()}),f.done(function(){var t;w._removeData(e,"fxshow");for(t in l)w.style(e,t,l[t])});for(r in l)o=Zn(h?p[r]:0,r,f),r in p||(p[r]=o.start,h&&(o.end=o.start,o.start=r==="width"||r==="height"?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}function ir(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function sr(e){return w.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=typeof t,s=e.location,o=e.document,u=o.documentElement,a=e.jQuery,f=e.$,l={},c=[],h="1.10.2",p=c.concat,d=c.push,v=c.slice,m=c.indexOf,g=l.toString,y=l.hasOwnProperty,b=h.trim,w=function(e,t){return new w.fn.init(e,t,r)},E=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,S=/\S+/g,x=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,N=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,C=/^[\],:{}\s]*$/,k=/(?:^|:|,)(?:\s*\[)+/g,L=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,O=/^-ms-/,M=/-([\da-z])/gi,_=function(e,t){return t.toUpperCase()},D=function(e){if(o.addEventListener||e.type==="load"||o.readyState==="complete")P(),w.ready()},P=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",D,!1),e.removeEventListener("load",D,!1)):(o.detachEvent("onreadystatechange",D),e.detachEvent("onload",D))};w.fn=w.prototype={jquery:h,constructor:w,init:function(e,n,r){var i,s;if(!e)return this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?i=[null,e,null]:i=T.exec(e);if(i&&(i[1]||!n)){if(i[1]){n=n instanceof w?n[0]:n,w.merge(this,w.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0));if(N.test(i[1])&&w.isPlainObject(n))for(i in n)w.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}s=o.getElementById(i[2]);if(s&&s.parentNode){if(s.id!==i[2])return r.find(e);this.length=1,this[0]=s}return this.context=o,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return e.nodeType?(this.context=this[0]=e,this.length=1,this):w.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),w.makeArray(e,this))},selector:"",length:0,toArray:function(){return v.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return w.each(this,e,t)},ready:function(e){return w.ready.promise().done(e),this},slice:function(){return this.pushStack(v.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},w.fn.init.prototype=w.fn,w.extend=w.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!w.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((s=arguments[a])!=null)for(i in s){e=u[i],r=s[i];if(u===r)continue;l&&r&&(w.isPlainObject(r)||(n=w.isArray(r)))?(n?(n=!1,o=e&&w.isArray(e)?e:[]):o=e&&w.isPlainObject(e)?e:{},u[i]=w.extend(l,o,r)):r!==t&&(u[i]=r)}return u},w.extend({expando:"jQuery"+(h+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===w&&(e.$=f),t&&e.jQuery===w&&(e.jQuery=a),w},isReady:!1,readyWait:1,holdReady:function(e){e?w.readyWait++:w.ready(!0)},ready:function(e){if(e===!0?--w.readyWait:w.isReady)return;if(!o.body)return setTimeout(w.ready);w.isReady=!0;if(e!==!0&&--w.readyWait>0)return;n.resolveWith(o,[w]),w.fn.trigger&&w(o).trigger("ready").off("ready")},isFunction:function(e){return w.type(e)==="function"},isArray:Array.isArray||function(e){return w.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):typeof e=="object"||typeof e=="function"?l[g.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||w.type(e)!=="object"||e.nodeType||w.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(w.support.ownLast)for(n in e)return y.call(e,n);for(n in e);return n===t||y.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){if(!e||typeof e!="string")return null;typeof t=="boolean"&&(n=t,t=!1),t=t||o;var r=N.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=w.buildFragment([e],t,i),i&&w(i).remove(),w.merge([],r.childNodes))},parseJSON:function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(t===null)return t;if(typeof t=="string"){t=w.trim(t);if(t&&C.test(t.replace(L,"@").replace(A,"]").replace(k,"")))return(new Function("return "+t))()}w.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&w.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&w.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(O,"ms-").replace(M,_)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,s=e.length,o=H(e);if(n)if(o)for(;i<s;i++){r=t.apply(e[i],n);if(r===!1)break}else for(i in e){r=t.apply(e[i],n);if(r===!1)break}else if(o)for(;i<s;i++){r=t.call(e[i],i,e[i]);if(r===!1)break}else for(i in e){r=t.call(e[i],i,e[i]);if(r===!1)break}return e},trim:b&&!b.call("﻿ ")?function(e){return e==null?"":b.call(e)}:function(e){return e==null?"":(e+"").replace(x,"")},makeArray:function(e,t){var n=t||[];return e!=null&&(H(Object(e))?w.merge(n,typeof e=="string"?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,t,n){var r,i=0,s=e.length,o=H(e),u=[];if(o)for(;i<s;i++)r=t(e[i],i,n),r!=null&&(u[u.length]=r);else for(i in e)r=t(e[i],i,n),r!=null&&(u[u.length]=r);return p.apply([],u)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(s=e[n],n=e,e=s),w.isFunction(e)?(r=v.call(arguments,2),i=function(){return e.apply(n||this,r.concat(v.call(arguments)))},i.guid=e.guid=e.guid||w.guid++,i):t},access:function(e,n,r,i,s,o,u){var a=0,f=e.length,l=r==null;if(w.type(r)==="object"){s=!0;for(a in r)w.access(e,n,a,r[a],!0,o,u)}else if(i!==t){s=!0,w.isFunction(i)||(u=!0),l&&(u?(n.call(e,i),n=null):(l=n,n=function(e,t,n){return l.call(w(e),n)}));if(n)for(;a<f;a++)n(e[a],r,u?i:i.call(e[a],a,n(e[a],r)))}return s?e:l?n.call(e):f?n(e[0],r):o},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];i=n.apply(e,r||[]);for(s in t)e.style[s]=o[s];return i}}),w.ready.promise=function(t){if(!n){n=w.Deferred();if(o.readyState==="complete")setTimeout(w.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",D,!1),e.addEventListener("load",D,!1);else{o.attachEvent("onreadystatechange",D),e.attachEvent("onload",D);var r=!1;try{r=e.frameElement==null&&o.documentElement}catch(i){}r&&r.doScroll&&function s(){if(!w.isReady){try{r.doScroll("left")}catch(e){return setTimeout(s,50)}P(),w.ready()}}()}}return n.promise(t)},w.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()}),r=w(o),function(e,t){function ot(e,t,n,i){var s,o,u,a,f,l,p,m,g,w;(t?t.ownerDocument||t:E)!==h&&c(t),t=t||h,n=n||[];if(!e||typeof e!="string")return n;if((a=t.nodeType)!==1&&a!==9)return[];if(d&&!i){if(s=Z.exec(e))if(u=s[1]){if(a===9){o=t.getElementById(u);if(!o||!o.parentNode)return n;if(o.id===u)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(u))&&y(t,o)&&o.id===u)return n.push(o),n}else{if(s[2])return H.apply(n,t.getElementsByTagName(e)),n;if((u=s[3])&&r.getElementsByClassName&&t.getElementsByClassName)return H.apply(n,t.getElementsByClassName(u)),n}if(r.qsa&&(!v||!v.test(e))){m=p=b,g=t,w=a===9&&e;if(a===1&&t.nodeName.toLowerCase()!=="object"){l=mt(e),(p=t.getAttribute("id"))?m=p.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",f=l.length;while(f--)l[f]=m+gt(l[f]);g=$.test(e)&&t.parentNode||t,w=l.join(",")}if(w)try{return H.apply(n,g.querySelectorAll(w)),n}catch(S){}finally{p||t.removeAttribute("id")}}}return Nt(e.replace(W,"$1"),t,n,i)}function ut(){function t(n,r){return e.push(n+=" ")>s.cacheLength&&delete t[e.shift()],t[n]=r}var e=[];return t}function at(e){return e[b]=!0,e}function ft(e){var t=h.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),r=e.length;while(r--)s.attrHandle[n[r]]=t}function ct(e,t){var n=t&&e,r=n&&e.nodeType===1&&t.nodeType===1&&(~t.sourceIndex||O)-(~e.sourceIndex||O);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function dt(e){return at(function(t){return t=+t,at(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function vt(){}function mt(e,t){var n,r,i,o,u,a,f,l=N[e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=s.preFilter;while(u){if(!n||(r=X.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(i=[]);n=!1;if(r=V.exec(u))n=r.shift(),i.push({value:n,type:r[0].replace(W," ")}),u=u.slice(n.length);for(o in s.filter)(r=G[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(n=r.shift(),i.push({value:n,type:o,matches:r}),u=u.slice(n.length));if(!n)break}return t?u.length:u?ot.error(e):N(e,a).slice(0)}function gt(e){var t=0,n=e.length,r="";for(;t<n;t++)r+=e[t].value;return r}function yt(e,t,n){var r=t.dir,s=n&&r==="parentNode",o=x++;return t.first?function(t,n,i){while(t=t[r])if(t.nodeType===1||s)return e(t,n,i)}:function(t,n,u){var a,f,l,c=S+" "+o;if(u){while(t=t[r])if(t.nodeType===1||s)if(e(t,n,u))return!0}else while(t=t[r])if(t.nodeType===1||s){l=t[b]||(t[b]={});if((f=l[r])&&f[0]===c){if((a=f[1])===!0||a===i)return a===!0}else{f=l[r]=[c],f[1]=e(t,n,u)||i;if(f[1]===!0)return!0}}}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function wt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function Et(e,t,n,r,i,s){return r&&!r[b]&&(r=Et(r)),i&&!i[b]&&(i=Et(i,s)),at(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||Tt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?wt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=wt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?j.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=wt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):H.apply(o,g)})}function St(e){var t,n,r,i=e.length,o=s.relative[e[0].type],u=o||s.relative[" "],a=o?1:0,l=yt(function(e){return e===t},u,!0),c=yt(function(e){return j.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];for(;a<i;a++)if(n=s.relative[e[a].type])h=[yt(bt(h),n)];else{n=s.filter[e[a].type].apply(null,e[a].matches);if(n[b]){r=++a;for(;r<i;r++)if(s.relative[e[r].type])break;return Et(a>1&&bt(h),a>1&&gt(e.slice(0,a-1).concat({value:e[a-2].type===" "?"*":""})).replace(W,"$1"),n,a<r&&St(e.slice(a,r)),r<i&&St(e=e.slice(r)),r<i&&gt(e))}h.push(n)}return bt(h)}function xt(e,t){var n=0,r=t.length>0,o=e.length>0,u=function(u,a,l,c,p){var d,v,m,g=[],y=0,b="0",w=u&&[],E=p!=null,x=f,T=u||o&&s.find.TAG("*",p&&a.parentNode||a),N=S+=x==null?1:Math.random()||.1;E&&(f=a!==h&&a,i=n);for(;(d=T[b])!=null;b++){if(o&&d){v=0;while(m=e[v++])if(m(d,a,l)){c.push(d);break}E&&(S=N,i=++n)}r&&((d=!m&&d)&&y--,u&&w.push(d))}y+=b;if(r&&b!==y){v=0;while(m=t[v++])m(w,g,a,l);if(u){if(y>0)while(b--)!w[b]&&!g[b]&&(g[b]=D.call(c));g=wt(g)}H.apply(c,g),E&&!u&&g.length>0&&y+t.length>1&&ot.uniqueSort(c)}return E&&(S=N,f=x),w};return r?at(u):u}function Tt(e,t,n){var r=0,i=t.length;for(;r<i;r++)ot(e,t[r],n);return n}function Nt(e,t,n,i){var o,u,f,l,c,h=mt(e);if(!i&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&r.getById&&t.nodeType===9&&d&&s.relative[u[1].type]){t=(s.find.ID(f.matches[0].replace(rt,it),t)||[])[0];if(!t)return n;e=e.slice(u.shift().value.length)}o=G.needsContext.test(e)?0:u.length;while(o--){f=u[o];if(s.relative[l=f.type])break;if(c=s.find[l])if(i=c(f.matches[0].replace(rt,it),$.test(u[0].type)&&t.parentNode||t)){u.splice(o,1),e=i.length&&gt(u);if(!e)return H.apply(n,i),n;break}}}return a(e,h)(i,t,!d,n,$.test(e)),n}var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b="sizzle"+ -(new Date),E=e.document,S=0,x=0,T=ut(),N=ut(),C=ut(),k=!1,L=function(e,t){return e===t?(k=!0,0):0},A=typeof t,O=1<<31,M={}.hasOwnProperty,_=[],D=_.pop,P=_.push,H=_.push,B=_.slice,j=_.indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",I="[\\x20\\t\\r\\n\\f]",q="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",R=q.replace("w","w#"),U="\\["+I+"*("+q+")"+I+"*(?:([*^$|!~]?=)"+I+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+R+")|)|)"+I+"*\\]",z=":("+q+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+U.replace(3,8)+")*)|.*)\\)|)",W=new RegExp("^"+I+"+|((?:^|[^\\\\])(?:\\\\.)*)"+I+"+$","g"),X=new RegExp("^"+I+"*,"+I+"*"),V=new RegExp("^"+I+"*([>+~]|"+I+")"+I+"*"),$=new RegExp(I+"*[+~]"),J=new RegExp("="+I+"*([^\\]'\"]*)"+I+"*\\]","g"),K=new RegExp(z),Q=new RegExp("^"+R+"$"),G={ID:new RegExp("^#("+q+")"),CLASS:new RegExp("^\\.("+q+")"),TAG:new RegExp("^("+q.replace("w","w*")+")"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+I+"*(even|odd|(([+-]|)(\\d*)n|)"+I+"*(?:([+-]|)"+I+"*(\\d+)|))"+I+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+I+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+I+"*((?:-\\d)?\\d*)"+I+"*\\)|)(?=[^-]|$)","i")},Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=new RegExp("\\\\([\\da-f]{1,6}"+I+"?|("+I+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)};try{H.apply(_=B.call(E.childNodes),E.childNodes),_[E.childNodes.length].nodeType}catch(st){H={apply:_.length?function(e,t){P.apply(e,B.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}u=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},r=ot.support={},c=ot.setDocument=function(e){var t=e?e.ownerDocument||e:E,n=t.defaultView;if(t===h||t.nodeType!==9||!t.documentElement)return h;h=t,p=t.documentElement,d=!u(t),n&&n.attachEvent&&n!==n.top&&n.attachEvent("onbeforeunload",function(){c()}),r.attributes=ft(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ft(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ft(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",e.getElementsByClassName("i").length===2}),r.getById=ft(function(e){return p.appendChild(e).id=b,!t.getElementsByName||!t.getElementsByName(b).length}),r.getById?(s.find.ID=function(e,t){if(typeof t.getElementById!==A&&d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},s.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete s.find.ID,s.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),s.find.TAG=r.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==A)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++])n.nodeType===1&&r.push(n);return r}return s},s.find.CLASS=r.getElementsByClassName&&function(e,t){if(typeof t.getElementsByClassName!==A&&d)return t.getElementsByClassName(e)},m=[],v=[];if(r.qsa=Y.test(t.querySelectorAll))ft(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||v.push("\\["+I+"*(?:value|"+F+")"),e.querySelectorAll(":checked").length||v.push(":checked")}),ft(function(e){var n=t.createElement("input");n.setAttribute("type","hidden"),e.appendChild(n).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&v.push("[*^$]="+I+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")});return(r.matchesSelector=Y.test(g=p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ft(function(e){r.disconnectedMatch=g.call(e,"div"),g.call(e,"[s!='']:x"),m.push("!=",z)}),v=v.length&&new RegExp(v.join("|")),m=m.length&&new RegExp(m.join("|")),y=Y.test(p.contains)||p.compareDocumentPosition?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&r.nodeType===1&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16)}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},L=p.compareDocumentPosition?function(e,n){if(e===n)return k=!0,0;var i=n.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(n);if(i)return i&1||!r.sortDetached&&n.compareDocumentPosition(e)===i?e===t||y(E,e)?-1:n===t||y(E,n)?1:l?j.call(l,e)-j.call(l,n):0:i&4?-1:1;return e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,s=e.parentNode,o=n.parentNode,u=[e],a=[n];if(e===n)return k=!0,0;if(!s||!o)return e===t?-1:n===t?1:s?-1:o?1:l?j.call(l,e)-j.call(l,n):0;if(s===o)return ct(e,n);r=e;while(r=r.parentNode)u.unshift(r);r=n;while(r=r.parentNode)a.unshift(r);while(u[i]===a[i])i++;return i?ct(u[i],a[i]):u[i]===E?-1:a[i]===E?1:0},t},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){(e.ownerDocument||e)!==h&&c(e),t=t.replace(J,"='$1']");if(r.matchesSelector&&d&&(!m||!m.test(t))&&(!v||!v.test(t)))try{var n=g.call(e,t);if(n||r.disconnectedMatch||e.document&&e.document.nodeType!==11)return n}catch(i){}return ot(t,h,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==h&&c(e),y(e,t)},ot.attr=function(e,n){(e.ownerDocument||e)!==h&&c(e);var i=s.attrHandle[n.toLowerCase()],o=i&&M.call(s.attrHandle,n.toLowerCase())?i(e,n,!d):t;return o===t?r.attributes||!d?e.getAttribute(n):(o=e.getAttributeNode(n))&&o.specified?o.value:null:o},ot.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,n=[],i=0,s=0;k=!r.detectDuplicates,l=!r.sortStable&&e.slice(0),e.sort(L);if(k){while(t=e[s++])t===e[s]&&(i=n.push(s));while(i--)e.splice(n[i],1)}return e},o=ot.getText=function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r];r++)n+=o(t);else if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(i===3||i===4)return e.nodeValue;return n},s=ot.selectors={cacheLength:50,createPseudo:at,match:G,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(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1].slice(0,3)==="nth"?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd")),e[5]=+(e[7]+e[8]||e[3]==="odd")):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return G.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&K.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return e==="*"?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+I+")"+e+"("+I+"|$)"))&&T(e,function(e){return t.test(typeof e.className=="string"&&e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return i==null?t==="!=":t?(i+="",t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v])if(u?c.nodeName.toLowerCase()===g:c.nodeType===1)return!1;d=v=e==="only"&&!d&&"nextSibling"}return!0}d=[o?m.firstChild:m.lastChild];if(o&&y){l=m[b]||(m[b]={}),f=l[e]||[],p=f[0]===S&&f[1],h=f[0]===S&&f[2],c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if(c.nodeType===1&&++h&&c===t){l[e]=[S,p,h];break}}else if(y&&(f=(t[b]||(t[b]={}))[e])&&f[0]===S)h=f[1];else while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if((u?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++h){y&&((c[b]||(c[b]={}))[e]=[S,h]);if(c===t)break}return h-=i,h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,r=s.pseudos[e]||s.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],s.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=j.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:at(function(e){var t=[],n=[],r=a(e.replace(W,"$1"));return r[b]?at(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:at(function(e){return Q.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||n.indexOf(e+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.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 t==="input"&&!!e.checked||t==="option"&&!!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>"@"||e.nodeType===3||e.nodeType===4)return!1;return!0},parent:function(e){return!s.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()===e.type)},first:dt(function(){return[0]}),last:dt(function(e,t){return[t-1]}),eq:dt(function(e,t,n){return[n<0?n+t:n]}),even:dt(function(e,t){var n=0;for(;n<t;n+=2)e.push(n);return e}),odd:dt(function(e,t){var n=1;for(;n<t;n+=2)e.push(n);return e}),lt:dt(function(e,t,n){var r=n<0?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:dt(function(e,t,n){var r=n<0?n+t:n;for(;++r<t;)e.push(r);return e})}},s.pseudos.nth=s.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})s.pseudos[n]=ht(n);for(n in{submit:!0,reset:!0})s.pseudos[n]=pt(n);vt.prototype=s.filters=s.pseudos,s.setFilters=new vt,a=ot.compile=function(e,t){var n,r=[],i=[],s=C[e+" "];if(!s){t||(t=mt(e)),n=t.length;while(n--)s=St(t[n]),s[b]?r.push(s):i.push(s);s=C(e,xt(i,r))}return s},r.sortStable=b.split("").sort(L).join("")===b,r.detectDuplicates=k,c(),r.sortDetached=ft(function(e){return e.compareDocumentPosition(h.createElement("div"))&1}),ft(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild.getAttribute("href")==="#"})||lt("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,t.toLowerCase()==="type"?1:2)}),(!r.attributes||!ft(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),e.firstChild.getAttribute("value")===""}))&&lt("value",function(e,t,n){if(!n&&e.nodeName.toLowerCase()==="input")return e.defaultValue}),ft(function(e){return e.getAttribute("disabled")==null})||lt(F,function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===!0?t.toLowerCase():null}),w.find=ot,w.expr=ot.selectors,w.expr[":"]=w.expr.pseudos,w.unique=ot.uniqueSort,w.text=ot.getText,w.isXMLDoc=ot.isXML,w.contains=ot.contains}(e);var B={};w.Callbacks=function(e){e=typeof e=="string"?B[e]||j(e):w.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){r=e.memory&&t,i=!0,o=u||0,u=0,s=a.length,n=!0;for(;a&&o<s;o++)if(a[o].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,a&&(f?f.length&&l(f.shift()):r?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function i(t){w.each(t,function(t,n){var r=w.type(n);r==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&r!=="string"&&i(n)})})(arguments),n?s=a.length:r&&(u=t,l(r))}return this},remove:function(){return a&&w.each(arguments,function(e,t){var r;while((r=w.inArray(t,a,r))>-1)a.splice(r,1),n&&(r<=s&&s--,r<=o&&o--)}),this},has:function(e){return e?w.inArray(e,a)>-1:!!a&&!!a.length},empty:function(){return a=[],s=0,this},disable:function(){return a=f=r=t,this},disabled:function(){return!a},lock:function(){return f=t,r||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return a&&(!i||f)&&(t=t||[],t=[e,t.slice?t.slice():t],n?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},w.extend({Deferred:function(e){var t=[["resolve","done",w.Callbacks("once memory"),"resolved"],["reject","fail",w.Callbacks("once memory"),"rejected"],["notify","progress",w.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return w.Deferred(function(n){w.each(t,function(t,s){var o=s[0],u=w.isFunction(e[t])&&e[t];i[s[1]](function(){var e=u&&u.apply(this,arguments);e&&w.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===r?n.promise():this,u?[e]:arguments)})}),e=null}).promise()},promise:function(e){return e!=null?w.extend(e,r):r}},i={};return r.pipe=r.then,w.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=function(){return i[s[0]+"With"](this===i?r:this,arguments),this},i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=v.call(arguments),r=n.length,i=r!==1||e&&w.isFunction(e.promise)?r:0,s=i===1?e:w.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?v.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&w.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),w.support=function(t){var n,r,s,u,a,f,l,c,h,p=o.createElement("div");p.setAttribute("className","t"),p.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*")||[],r=p.getElementsByTagName("a")[0];if(!r||!r.style||!n.length)return t;u=o.createElement("select"),f=u.appendChild(o.createElement("option")),s=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute=p.className!=="t",t.leadingWhitespace=p.firstChild.nodeType===3,t.tbody=!p.getElementsByTagName("tbody").length,t.htmlSerialize=!!p.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized=r.getAttribute("href")==="/a",t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!s.value,t.optSelected=f.selected,t.enctype=!!o.createElement("form").enctype,t.html5Clone=o.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",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,u.disabled=!0,t.optDisabled=!f.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}s=o.createElement("input"),s.setAttribute("value",""),t.input=s.getAttribute("value")==="",s.value="t",s.setAttribute("type","radio"),t.radioValue=s.value==="t",s.setAttribute("checked","t"),s.setAttribute("name","t"),a=o.createDocumentFragment(),a.appendChild(s),t.appendChecked=s.checked,t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){t.noCloneEvent=!1}),p.cloneNode(!0).click());for(h in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+h,"t"),t[h+"Bubbles"]=l in e||p.attributes[l].expando===!1;p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle=p.style.backgroundClip==="content-box";for(h in w(t))break;return t.ownLast=h!=="0",w(function(){var n,r,s,u="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",a=o.getElementsByTagName("body")[0];if(!a)return;n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(p),p.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=p.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,p.innerHTML="",p.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%;",w.swap(a,a.style.zoom!=null?{zoom:1}:{},function(){t.boxSizing=p.offsetWidth===4}),e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(p,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(p,null)||{width:"4px"}).width==="4px",r=p.appendChild(o.createElement("div")),r.style.cssText=p.style.cssText=u,r.style.marginRight=r.style.width="0",p.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof p.style.zoom!==i&&(p.innerHTML="",p.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.innerHTML="<div></div>",p.firstChild.style.width="5px",t.shrinkWrapBlocks=p.offsetWidth!==3,t.inlineBlockNeedsLayout&&(a.style.zoom=1)),a.removeChild(n),n=p=s=r=null}),n=u=a=f=r=s=null,t}({});var F=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;w.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?w.cache[e[w.expando]]:e[w.expando],!!e&&!z(e)},data:function(e,t,n){return q(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return q(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&e.nodeType!==1&&e.nodeType!==9)return!1;var t=e.nodeName&&w.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),w.fn.extend({data:function(e,n){var r,i,s=null,o=0,u=this[0];if(e===t){if(this.length){s=w.data(u);if(u.nodeType===1&&!w._data(u,"parsedAttrs")){r=u.attributes;for(;o<r.length;o++)i=r[o].name,i.indexOf("data-")===0&&(i=w.camelCase(i.slice(5)),U(u,i,s[i]));w._data(u,"parsedAttrs",!0)}}return s}return typeof e=="object"?this.each(function(){w.data(this,e)}):arguments.length>1?this.each(function(){w.data(this,e,n)}):u?U(u,e,w.data(u,e)):null},removeData:function(e){return this.each(function(){w.removeData(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=w._data(e,t),n&&(!r||w.isArray(n)?r=w._data(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),s=w._queueHooks(e,t),o=function(){w.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return w._data(e,n)||w._data(e,n,{empty:w.Callbacks("once memory").add(function(){w._removeData(e,t+"queue"),w._removeData(e,n)})})}}),w.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?w.queue(this[0],e):n===t?this:this.each(function(){var t=w.queue(this,e,n);w._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},delay:function(e,t){return e=w.fx?w.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=w.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=w._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var W,X,V=/[\t\r\n\f]/g,$=/\r/g,J=/^(?:input|select|textarea|button|object)$/i,K=/^(?:a|area)$/i,Q=/^(?:checked|selected)$/i,G=w.support.getSetAttribute,Y=w.support.input;w.fn.extend({attr:function(e,t){return w.access(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})},prop:function(e,t){return w.access(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return e=w.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o=0,u=this.length,a=typeof e=="string"&&e;if(w.isFunction(e))return this.each(function(t){w(this).addClass(e.call(this,t,this.className))});if(a){t=(e||"").match(S)||[];for(;o<u;o++){n=this[o],r=n.nodeType===1&&(n.className?(" "+n.className+" ").replace(V," "):" ");if(r){s=0;while(i=t[s++])r.indexOf(" "+i+" ")<0&&(r+=i+" ");n.className=w.trim(r)}}}return this},removeClass:function(e){var t,n,r,i,s,o=0,u=this.length,a=arguments.length===0||typeof e=="string"&&e;if(w.isFunction(e))return this.each(function(t){w(this).removeClass(e.call(this,t,this.className))});if(a){t=(e||"").match(S)||[];for(;o<u;o++){n=this[o],r=n.nodeType===1&&(n.className?(" "+n.className+" ").replace(V," "):"");if(r){s=0;while(i=t[s++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?w.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e;return typeof t=="boolean"&&n==="string"?t?this.addClass(e):this.removeClass(e):w.isFunction(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var t,r=0,s=w(this),o=e.match(S)||[];while(t=o[r++])s.hasClass(t)?s.removeClass(t):s.addClass(t)}else if(n===i||n==="boolean")this.className&&w._data(this,"__className__",this.className),this.className=this.className||e===!1?"":w._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(V," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return r=w.valHooks[s.type]||w.valHooks[s.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(s,"value"))!==t?n:(n=s.value,typeof n=="string"?n.replace($,""):n==null?"":n);return}return i=w.isFunction(e),this.each(function(n){var s;if(this.nodeType!==1)return;i?s=e.call(this,n,w(this).val()):s=e,s==null?s="":typeof s=="number"?s+="":w.isArray(s)&&(s=w.map(s,function(e){return e==null?"":e+""})),r=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()];if(!r||!("set"in r)||r.set(this,s,"value")===t)this.value=s})}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return t!=null?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(w.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!w.nodeName(n.parentNode,"optgroup"))){t=w(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n,r,i=e.options,s=w.makeArray(t),o=i.length;while(o--){r=i[o];if(r.selected=w.inArray(w(r).val(),s)>=0)n=!0}return n||(e.selectedIndex=-1),s}}},attr:function(e,n,r){var s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;if(typeof e.getAttribute===i)return w.prop(e,n,r);if(u!==1||!w.isXMLDoc(e))n=n.toLowerCase(),s=w.attrHooks[n]||(w.expr.match.bool.test(n)?X:W);if(r===t)return s&&"get"in s&&(o=s.get(e,n))!==null?o:(o=w.find.attr(e,n),o==null?t:o);if(r!==null)return s&&"set"in s&&(o=s.set(e,r,n))!==t?o:(e.setAttribute(n,r+""),r);w.removeAttr(e,n)},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(S);if(s&&e.nodeType===1)while(n=s[i++])r=w.propFix[n]||n,w.expr.match.bool.test(n)?Y&&G||!Q.test(n)?e[r]=!1:e[w.camelCase("default-"+n)]=e[r]=!1:w.attr(e,n,""),e.removeAttribute(G?n:r)},attrHooks:{type:{set:function(e,t){if(!w.support.radioValue&&t==="radio"&&w.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!w.isXMLDoc(e),o&&(n=w.propFix[n]||n,s=w.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):J.test(e.nodeName)||K.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?w.removeAttr(e,n):Y&&G||!Q.test(n)?e.setAttribute(!G&&w.propFix[n]||n,n):e[w.camelCase("default-"+n)]=e[n]=!0,n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,n){var r=w.expr.attrHandle[n]||w.find.attr;w.expr.attrHandle[n]=Y&&G||!Q.test(n)?function(e,n,i){var s=w.expr.attrHandle[n],o=i?t:(w.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return w.expr.attrHandle[n]=s,o}:function(e,n,r){return r?t:e[w.camelCase("default-"+n)]?n.toLowerCase():null}});if(!Y||!G)w.attrHooks.value={set:function(e,t,n){if(!w.nodeName(e,"input"))return W&&W.set(e,t,n);e.defaultValue=t}};G||(W={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="",r==="value"||n===e.getAttribute(r)?n:t}},w.expr.attrHandle.id=w.expr.attrHandle.name=w.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.value!==""?i.value:null},w.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:W.set},w.attrHooks.contenteditable={set:function(e,t,n){W.set(e,t===""?!1:t,n)}},w.each(["width","height"],function(e,t){w.attrHooks[t]={set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}}})),w.support.hrefNormalized||w.each(["href","src"],function(e,t){w.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),w.support.style||(w.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),w.support.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this}),w.support.enctype||(w.propFix.enctype="encoding"),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(w.isArray(t))return e.checked=w.inArray(w(e).val(),t)>=0}},w.support.checkOn||(w.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;w.event={global:{},add:function(e,n,r,s,o){var u,a,f,l,c,h,p,d,v,m,g,y=w._data(e);if(!y)return;r.handler&&(l=r,r=l.handler,o=l.selector),r.guid||(r.guid=w.guid++),(a=y.events)||(a=y.events={}),(h=y.handle)||(h=y.handle=function(e){return typeof w===i||!!e&&w.event.triggered===e.type?t:w.event.dispatch.apply(h.elem,arguments)},h.elem=e),n=(n||"").match(S)||[""],f=n.length;while(f--){u=rt.exec(n[f])||[],v=g=u[1],m=(u[2]||"").split(".").sort();if(!v)continue;c=w.event.special[v]||{},v=(o?c.delegateType:c.bindType)||v,c=w.event.special[v]||{},p=w.extend({type:v,origType:g,data:s,handler:r,guid:r.guid,selector:o,needsContext:o&&w.expr.match.needsContext.test(o),namespace:m.join(".")},l);if(!(d=a[v])){d=a[v]=[],d.delegateCount=0;if(!c.setup||c.setup.call(e,s,m,h)===!1)e.addEventListener?e.addEventListener(v,h,!1):e.attachEvent&&e.attachEvent("on"+v,h)}c.add&&(c.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,p):d.push(p),w.event.global[v]=!0}e=null},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=w.hasData(e)&&w._data(e);if(!m||!(l=m.events))return;t=(t||"").match(S)||[""],f=t.length;while(f--){u=rt.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort();if(!p){for(p in l)w.event.remove(e,p+t[f],n,r,!0);continue}c=w.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,h=l[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=h.length;while(s--)o=h[s],(i||v===o.origType)&&(!n||n.guid===o.guid)&&(!u||u.test(o.namespace))&&(!r||r===o.selector||r==="**"&&o.selector)&&(h.splice(s,1),o.selector&&h.delegateCount--,c.remove&&c.remove.call(e,o));a&&!h.length&&((!c.teardown||c.teardown.call(e,d,m.handle)===!1)&&w.removeEvent(e,p,m.handle),delete l[p])}w.isEmptyObject(l)&&(delete m.handle,w._removeData(e,"events"))},trigger:function(n,r,i,s){var u,a,f,l,c,h,p,d=[i||o],v=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];f=h=i=i||o;if(i.nodeType===3||i.nodeType===8)return;if(nt.test(v+w.event.triggered))return;v.indexOf(".")>=0&&(m=v.split("."),v=m.shift(),m.sort()),a=v.indexOf(":")<0&&"on"+v,n=n[w.expando]?n:new w.Event(v,typeof n=="object"&&n),n.isTrigger=s?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=r==null?[n]:w.makeArray(r,[n]),c=w.event.special[v]||{};if(!s&&c.trigger&&c.trigger.apply(i,r)===!1)return;if(!s&&!c.noBubble&&!w.isWindow(i)){l=c.delegateType||v,nt.test(l+v)||(f=f.parentNode);for(;f;f=f.parentNode)d.push(f),h=f;h===(i.ownerDocument||o)&&d.push(h.defaultView||h.parentWindow||e)}p=0;while((f=d[p++])&&!n.isPropagationStopped())n.type=p>1?l:c.bindType||v,u=(w._data(f,"events")||{})[n.type]&&w._data(f,"handle"),u&&u.apply(f,r),u=a&&f[a],u&&w.acceptData(f)&&u.apply&&u.apply(f,r)===!1&&n.preventDefault();n.type=v;if(!s&&!n.isDefaultPrevented()&&(!c._default||c._default.apply(d.pop(),r)===!1)&&w.acceptData(i)&&a&&i[v]&&!w.isWindow(i)){h=i[a],h&&(i[a]=null),w.event.triggered=v;try{i[v]()}catch(g){}w.event.triggered=t,h&&(i[a]=h)}return n.result},dispatch:function(e){e=w.event.fix(e);var n,r,i,s,o,u=[],a=v.call(arguments),f=(w._data(this,"events")||{})[e.type]||[],l=w.event.special[e.type]||{};a[0]=e,e.delegateTarget=this;if(l.preDispatch&&l.preDispatch.call(this,e)===!1)return;u=w.event.handlers.call(this,e,f),n=0;while((s=u[n++])&&!e.isPropagationStopped()){e.currentTarget=s.elem,o=0;while((i=s.handlers[o++])&&!e.isImmediatePropagationStopped())if(!e.namespace_re||e.namespace_re.test(i.namespace))e.handleObj=i,e.data=i.data,r=((w.event.special[i.origType]||{}).handle||i.handler).apply(s.elem,a),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation())}return l.postDispatch&&l.postDispatch.call(this,e),e.result},handlers:function(e,n){var r,i,s,o,u=[],a=n.delegateCount,f=e.target;if(a&&f.nodeType&&(!e.button||e.type!=="click"))for(;f!=this;f=f.parentNode||this)if(f.nodeType===1&&(f.disabled!==!0||e.type!=="click")){s=[];for(o=0;o<a;o++)i=n[o],r=i.selector+" ",s[r]===t&&(s[r]=i.needsContext?w(r,this).index(f)>=0:w.find(r,this,null,[f]).length),s[r]&&s.push(i);s.length&&u.push({elem:f,handlers:s})}return a<n.length&&u.push({elem:this,handlers:n.slice(a)}),u},fix:function(e){if(e[w.expando])return e;var t,n,r,i=e.type,s=e,u=this.fixHooks[i];u||(this.fixHooks[i]=u=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=u.props?this.props.concat(u.props):this.props,e=new w.Event(s),t=r.length;while(t--)n=r[t],e[n]=s[n];return e.target||(e.target=s.srcElement||o),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,u.filter?u.filter(e,s):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 e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,s,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(i=e.target.ownerDocument||o,s=i.documentElement,r=i.body,e.pageX=n.clientX+(s&&s.scrollLeft||r&&r.scrollLeft||0)-(s&&s.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||r&&r.scrollTop||0)-(s&&s.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ot()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){if(this===ot()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(w.nodeName(this,"input")&&this.type==="checkbox"&&this.click)return this.click(),!1},_default:function(e){return w.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=w.extend(new w.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?w.event.trigger(i,null,t):w.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},w.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:st):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||w.now(),this[w.expando]=!0},w.Event.prototype={isDefaultPrevented:st,isPropagationStopped:st,isImmediatePropagationStopped:st,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},w.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj;if(!i||i!==r&&!w.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),w.support.submitBubbles||(w.event.special.submit={setup:function(){if(w.nodeName(this,"form"))return!1;w.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=w.nodeName(n,"input")||w.nodeName(n,"button")?n.form:t;r&&!w._data(r,"submitBubbles")&&(w.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),w._data(r,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&w.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(w.nodeName(this,"form"))return!1;w.event.remove(this,"._submit")}}),w.support.changeBubbles||(w.event.special.change={setup:function(){if(Z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")w.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),w.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),w.event.simulate("change",this,e,!0)});return!1}w.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!w._data(t,"changeBubbles")&&(w.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&w.event.simulate("change",this.parentNode,e,!0)}),w._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return w.event.remove(this,"._change"),!Z.test(this.nodeName)}}),w.support.focusinBubbles||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){w.event.simulate(t,e.target,w.event.fix(e),!0)};w.event.special[t]={setup:function(){n++===0&&o.addEventListener(e,r,!0)},teardown:function(){--n===0&&o.removeEventListener(e,r,!0)}}}),w.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(o in e)this.on(o,n,r,e[o],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=st;else if(!i)return this;return s===1&&(u=i,i=function(e){return w().off(e),u.apply(this,arguments)},i.guid=u.guid||(u.guid=w.guid++)),this.each(function(){w.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,w(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=st),this.each(function(){w.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}});var ut=/^.[^:#\[\.,]*$/,at=/^(?:parents|prev(?:Until|All))/,ft=w.expr.match.needsContext,lt={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if(typeof e!="string")return this.pushStack(w(e).filter(function(){for(t=0;t<i;t++)if(w.contains(r[t],this))return!0}));for(t=0;t<i;t++)w.find(e,r[t],n);return n=this.pushStack(i>1?w.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=w(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(w.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ht(this,e||[],!0))},filter:function(e){return this.pushStack(ht(this,e||[],!1))},is:function(e){return!!ht(this,typeof e=="string"&&ft.test(e)?w(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,s=[],o=ft.test(e)||typeof e!="string"?w(e,t||this.context):0;for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:n.nodeType===1&&w.find.matchesSelector(n,e))){n=s.push(n);break}return this.pushStack(s.length>1?w.unique(s):s)},index:function(e){return e?typeof e=="string"?w.inArray(this[0],w(e)):w.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?w(e,t):w.makeArray(e&&e.nodeType?[e]:e),r=w.merge(this.get(),n);return this.pushStack(w.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),w.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return w.dir(e,"parentNode")},parentsUntil:function(e,t,n){return w.dir(e,"parentNode",n)},next:function(e){return ct(e,"nextSibling")},prev:function(e){return ct(e,"previousSibling")},nextAll:function(e){return w.dir(e,"nextSibling")},prevAll:function(e){return w.dir(e,"previousSibling")},nextUntil:function(e,t,n){return w.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return w.dir(e,"previousSibling",n)},siblings:function(e){return w.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return w.sibling(e.firstChild)},contents:function(e){return w.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:w.merge([],e.childNodes)}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return e.slice(-5)!=="Until"&&(r=n),r&&typeof r=="string"&&(i=w.filter(r,i)),this.length>1&&(lt[e]||(i=w.unique(i)),at.test(e)&&(i=i.reverse())),this.pushStack(i)}}),w.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),t.length===1&&r.nodeType===1?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return e.nodeType===1}))},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!w(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var dt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",vt=/ jQuery\d+="(?:null|\d+)"/g,mt=new RegExp("<(?:"+dt+")[\\s/>]","i"),gt=/^\s+/,yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,wt=/<tbody/i,Et=/<|&#?\w+;/,St=/<(?:script|style|link)/i,xt=/^(?:checkbox|radio)$/i,Tt=/checked\s*(?:[^=]|=\s*.checked.)/i,Nt=/^$|\/(?:java|ecma)script/i,Ct=/^true\/(.*)/,kt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Lt={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:w.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},At=pt(o),Ot=At.appendChild(o.createElement("div"));Lt.optgroup=Lt.option,Lt.tbody=Lt.tfoot=Lt.colgroup=Lt.caption=Lt.thead,Lt.th=Lt.td,w.fn.extend({text:function(e){return w.access(this,function(e){return e===t?w.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=Mt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=Mt(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){var n,r=e?w.filter(e,this):this,i=0;for(;(n=r[i])!=null;i++)!t&&n.nodeType===1&&w.cleanData(jt(n)),n.parentNode&&(t&&w.contains(n.ownerDocument,n)&&Pt(jt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&w.cleanData(jt(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&w.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return w.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(vt,""):t;if(typeof e=="string"&&!St.test(e)&&(w.support.htmlSerialize||!mt.test(e))&&(w.support.leadingWhitespace||!gt.test(e))&&!Lt[(bt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(yt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(w.cleanData(jt(n,!1)),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=w.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),w(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=p.apply([],e);var r,i,s,o,u,a,f=0,l=this.length,c=this,h=l-1,d=e[0],v=w.isFunction(d);if(v||!(l<=1||typeof d!="string"||w.support.checkClone||!Tt.test(d)))return this.each(function(r){var i=c.eq(r);v&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t,n)});if(l){a=w.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=a.firstChild,a.childNodes.length===1&&(a=r);if(r){o=w.map(jt(a,"script"),_t),s=o.length;for(;f<l;f++)i=a,f!==h&&(i=w.clone(i,!0,!0),s&&w.merge(o,jt(i,"script"))),t.call(this[f],i,f);if(s){u=o[o.length-1].ownerDocument,w.map(o,Dt);for(f=0;f<s;f++)i=o[f],Nt.test(i.type||"")&&!w._data(i,"globalEval")&&w.contains(u,i)&&(i.src?w._evalUrl(i.src):w.globalEval((i.text||i.textContent||i.innerHTML||"").replace(kt,"")))}a=r=null}}return this}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){var n,r=0,i=[],s=w(e),o=s.length-1;for(;r<=o;r++)n=r===o?this:this.clone(!0),w(s[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}}),w.extend({clone:function(e,t,n){var r,i,s,o,u,a=w.contains(e.ownerDocument,e);w.support.html5Clone||w.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(Ot.innerHTML=e.outerHTML,Ot.removeChild(s=Ot.firstChild));if((!w.support.noCloneEvent||!w.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!w.isXMLDoc(e)){r=jt(s),u=jt(e);for(o=0;(i=u[o])!=null;++o)r[o]&&Bt(i,r[o])}if(t)if(n){u=u||jt(e),r=r||jt(s);for(o=0;(i=u[o])!=null;o++)Ht(i,r[o])}else Ht(e,s);return r=jt(s,"script"),r.length>0&&Pt(r,!a&&jt(e,"script")),r=u=i=null,s},buildFragment:function(e,t,n,r){var i,s,o,u,a,f,l,c=e.length,h=pt(t),p=[],d=0;for(;d<c;d++){s=e[d];if(s||s===0)if(w.type(s)==="object")w.merge(p,s.nodeType?[s]:s);else if(!Et.test(s))p.push(t.createTextNode(s));else{u=u||h.appendChild(t.createElement("div")),a=(bt.exec(s)||["",""])[1].toLowerCase(),l=Lt[a]||Lt._default,u.innerHTML=l[1]+s.replace(yt,"<$1></$2>")+l[2],i=l[0];while(i--)u=u.lastChild;!w.support.leadingWhitespace&&gt.test(s)&&p.push(t.createTextNode(gt.exec(s)[0]));if(!w.support.tbody){s=a==="table"&&!wt.test(s)?u.firstChild:l[1]==="<table>"&&!wt.test(s)?u:0,i=s&&s.childNodes.length;while(i--)w.nodeName(f=s.childNodes[i],"tbody")&&!f.childNodes.length&&s.removeChild(f)}w.merge(p,u.childNodes),u.textContent="";while(u.firstChild)u.removeChild(u.firstChild);u=h.lastChild}}u&&h.removeChild(u),w.support.appendChecked||w.grep(jt(p,"input"),Ft),d=0;while(s=p[d++]){if(r&&w.inArray(s,r)!==-1)continue;o=w.contains(s.ownerDocument,s),u=jt(h.appendChild(s),"script"),o&&Pt(u);if(n){i=0;while(s=u[i++])Nt.test(s.type||"")&&n.push(s)}}return u=null,h},cleanData:function(e,t){var n,r,s,o,u=0,a=w.expando,f=w.cache,l=w.support.deleteExpando,h=w.event.special;for(;(n=e[u])!=null;u++)if(t||w.acceptData(n)){s=n[a],o=s&&f[s];if(o){if(o.events)for(r in o.events)h[r]?w.event.remove(n,r):w.removeEvent(n,r,o.handle);f[s]&&(delete f[s],l?delete n[a]:typeof n.removeAttribute!==i?n.removeAttribute(a):n[a]=null,c.push(s))}}},_evalUrl:function(e){return w.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),w.fn.extend({wrapAll:function(e){if(w.isFunction(e))return this.each(function(t){w(this).wrapAll(e.call(this,t))});if(this[0]){var t=w(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return w.isFunction(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=w.isFunction(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){w.nodeName(this,"body")||w(this).replaceWith(this.childNodes)}).end()}});var It,qt,Rt,Ut=/alpha\([^)]*\)/i,zt=/opacity\s*=\s*([^)]*)/,Wt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Vt=/^margin/,$t=new RegExp("^("+E+")(.*)$","i"),Jt=new RegExp("^("+E+")(?!px)[a-z%]+$","i"),Kt=new RegExp("^([+-])=("+E+")","i"),Qt={BODY:"block"},Gt={position:"absolute",visibility:"hidden",display:"block"},Yt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];w.fn.extend({css:function(e,n){return w.access(this,function(e,n,r){var i,s,o={},u=0;if(w.isArray(n)){s=qt(e),i=n.length;for(;u<i;u++)o[n[u]]=w.css(e,n[u],!1,s);return o}return r!==t?w.style(e,n,r):w.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return typeof e=="boolean"?e?this.show():this.hide():this.each(function(){nn(this)?w(this).show():w(this).hide()})}}),w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Rt(e,"opacity");return n===""?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":w.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=w.camelCase(n),f=e.style;n=w.cssProps[a]||(w.cssProps[a]=tn(f,a)),u=w.cssHooks[n]||w.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=Kt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(w.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!w.cssNumber[a]&&(r+="px"),!w.support.clearCloneStyle&&r===""&&n.indexOf("background")===0&&(f[n]="inherit");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=w.camelCase(n);return n=w.cssProps[a]||(w.cssProps[a]=tn(e.style,a)),u=w.cssHooks[n]||w.cssHooks[a],u&&"get"in u&&(o=u.get(e,!0,r)),o===t&&(o=Rt(e,n,i)),o==="normal"&&n in Yt&&(o=Yt[n]),r===""||r?(s=parseFloat(o),r===!0||w.isNumeric(s)?s||0:o):o}}),e.getComputedStyle?(qt=function(t){return e.getComputedStyle(t,null)},Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u.getPropertyValue(n)||u[n]:t,f=e.style;return u&&(a===""&&!w.contains(e.ownerDocument,e)&&(a=w.style(e,n)),Jt.test(a)&&Vt.test(n)&&(i=f.width,s=f.minWidth,o=f.maxWidth,f.minWidth=f.maxWidth=f.width=a,a=u.width,f.width=i,f.minWidth=s,f.maxWidth=o)),a}):o.documentElement.currentStyle&&(qt=function(e){return e.currentStyle},Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u[n]:t,f=e.style;return a==null&&f&&f[n]&&(a=f[n]),Jt.test(a)&&!Wt.test(n)&&(i=f.left,s=e.runtimeStyle,o=s&&s.left,o&&(s.left=e.currentStyle.left),f.left=n==="fontSize"?"1em":a,a=f.pixelLeft+"px",f.left=i,o&&(s.left=o)),a===""?"auto":a}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&Xt.test(w.css(e,"display"))?w.swap(e,Gt,function(){return un(e,t,r)}):un(e,t,r)},set:function(e,n,r){var i=r&&qt(e);return sn(e,n,r?on(e,t,r,w.support.boxSizing&&w.css(e,"boxSizing",!1,i)==="border-box",i):0)}}}),w.support.opacity||(w.cssHooks.opacity={get:function(e,t){return zt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=w.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if((t>=1||t==="")&&w.trim(s.replace(Ut,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(t===""||r&&!r.filter)return}n.filter=Ut.test(s)?s.replace(Ut,i):s+" "+i}}),w(function(){w.support.reliableMarginRight||(w.cssHooks.marginRight={get:function(e,t){if(t)return w.swap(e,{display:"inline-block"},Rt,[e,"marginRight"])}}),!w.support.pixelPosition&&w.fn.position&&w.each(["top","left"],function(e,t){w.cssHooks[t]={get:function(e,n){if(n)return n=Rt(e,t),Jt.test(n)?w(e).position()[t]+"px":n}}})}),w.expr&&w.expr.filters&&(w.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!w.support.reliableHiddenOffsets&&(e.style&&e.style.display||w.css(e,"display"))==="none"},w.expr.filters.visible=function(e){return!w.expr.filters.hidden(e)}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){var r=0,i={},s=typeof n=="string"?n.split(" "):[n];for(;r<4;r++)i[e+Zt[r]+t]=s[r]||s[r-2]||s[0];return i}},Vt.test(e)||(w.cssHooks[e+t].set=sn)});var ln=/%20/g,cn=/\[\]$/,hn=/\r?\n/g,pn=/^(?:submit|button|image|reset|file)$/i,dn=/^(?:input|select|textarea|keygen)/i;w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&dn.test(this.nodeName)&&!pn.test(e)&&(this.checked||!xt.test(e))}).map(function(e,t){var n=w(this).val();return n==null?null:w.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(hn,"\r\n")}}):{name:t.name,value:n.replace(hn,"\r\n")}}).get()}}),w.param=function(e,n){var r,i=[],s=function(e,t){t=w.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=w.ajaxSettings&&w.ajaxSettings.traditional);if(w.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){s(this.name,this.value)});else for(r in e)vn(r,e[r],n,s);return i.join("&").replace(ln,"+")},w.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){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,gn,yn=w.now(),bn=/\?/,wn=/#.*$/,En=/([?&])_=[^&]*/,Sn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,xn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Tn=/^(?:GET|HEAD)$/,Nn=/^\/\//,Cn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,kn=w.fn.load,Ln={},An={},On="*/".concat("*");try{gn=s.href}catch(Mn){gn=o.createElement("a"),gn.href="",gn=gn.href}mn=Cn.exec(gn.toLowerCase())||[],w.fn.load=function(e,n,r){if(typeof e!="string"&&kn)return kn.apply(this,arguments);var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),w.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(o="POST"),u.length>0&&w.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){s=arguments,u.html(i?w("<div>").append(w.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){u.each(r,s||[e.responseText,t,e])}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gn,type:"GET",isLocal:xn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":On,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":w.parseJSON,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Pn(Pn(e,w.ajaxSettings),t):Pn(w.ajaxSettings,e)},ajaxPrefilter:_n(Ln),ajaxTransport:_n(An),ajax:function(e,n){function N(e,n,r,i){var l,g,y,E,S,T=n;if(b===2)return;b=2,u&&clearTimeout(u),f=t,o=i||"",x.readyState=e>0?4:0,l=e>=200&&e<300||e===304,r&&(E=Hn(c,x,r)),E=Bn(c,E,x,l);if(l)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(w.lastModified[s]=S),S=x.getResponseHeader("etag"),S&&(w.etag[s]=S)),e===204||c.type==="HEAD"?T="nocontent":e===304?T="notmodified":(T=E.state,g=E.data,y=E.error,l=!y);else{y=T;if(e||!T)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[g,T,x]):d.rejectWith(h,[x,T,y]),x.statusCode(m),m=t,a&&p.trigger(l?"ajaxSuccess":"ajaxError",[x,c,l?g:y]),v.fireWith(h,[x,T]),a&&(p.trigger("ajaxComplete",[x,c]),--w.active||w.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=w.ajaxSetup({},n),h=c.context||c,p=c.context&&(h.nodeType||h.jquery)?w(h):w.event,d=w.Deferred(),v=w.Callbacks("once memory"),m=c.statusCode||{},g={},y={},b=0,E="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(b===2){if(!l){l={};while(t=Sn.exec(o))l[t[1].toLowerCase()]=t[2]}t=l[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return b===2?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,g[e]=t),this},overrideMimeType:function(e){return b||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)m[t]=[m[t],e[t]];else x.always(e[x.status]);return this},abort:function(e){var t=e||E;return f&&f.abort(t),N(0,t),this}};d.promise(x).complete=v.add,x.success=x.done,x.error=x.fail,c.url=((e||c.url||gn)+"").replace(wn,"").replace(Nn,mn[1]+"//"),c.type=n.method||n.type||c.method||c.type,c.dataTypes=w.trim(c.dataType||"*").toLowerCase().match(S)||[""],c.crossDomain==null&&(r=Cn.exec(c.url.toLowerCase()),c.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||(r[1]==="http:"?"80":"443"))===(mn[3]||(mn[1]==="http:"?"80":"443")))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=w.param(c.data,c.traditional)),Dn(Ln,c,n,x);if(b===2)return x;a=c.global,a&&w.active++===0&&w.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Tn.test(c.type),s=c.url,c.hasContent||(c.data&&(s=c.url+=(bn.test(s)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=En.test(s)?s.replace(En,"$1_="+yn++):s+(bn.test(s)?"&":"?")+"_="+yn++)),c.ifModified&&(w.lastModified[s]&&x.setRequestHeader("If-Modified-Since",w.lastModified[s]),w.etag[s]&&x.setRequestHeader("If-None-Match",w.etag[s])),(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+On+"; q=0.01":""):c.accepts["*"]);for(i in c.headers)x.setRequestHeader(i,c.headers[i]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&b!==2){E="abort";for(i in{success:1,error:1,complete:1})x[i](c[i]);f=Dn(An,c,n,x);if(!f)N(-1,"No Transport");else{x.readyState=1,a&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{b=1,f.send(g,N)}catch(T){if(!(b<2))throw T;N(-1,T)}}return x}return x.abort()},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,n){return w.get(e,t,n,"script")}}),w.each(["get","post"],function(e,n){w[n]=function(e,r,i,s){return w.isFunction(r)&&(s=s||i,i=r,r=t),w.ajax({url:e,type:n,dataType:s,data:r,success:i})}}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),w.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||w("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){if(t||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var jn=[],Fn=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=jn.pop()||w.expando+"_"+yn++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.jsonp!==!1&&(Fn.test(n.url)?"url":typeof n.data=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Fn.test(n.data)&&"data");if(a||n.dataTypes[0]==="jsonp")return s=n.jsonpCallback=w.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a?n[a]=n[a].replace(Fn,"$1"+s):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||w.error(s+" was not called"),u[0]},n.dataTypes[0]="json",o=e[s],e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,jn.push(s)),u&&w.isFunction(o)&&o(u[0]),u=o=t}),"script"});var In,qn,Rn=0,Un=e.ActiveXObject&&function(){var e;for(e in In)In[e](t,!0)};w.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&zn()||Wn()}:zn,qn=w.ajaxSettings.xhr(),w.support.cors=!!qn&&"withCredentials"in qn,qn=w.support.ajax=!!qn,qn&&w.ajaxTransport(function(n){if(!n.crossDomain||w.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=w.noop,Un&&delete In[o]);if(i)a.readyState!==4&&a.abort();else{c={},u=a.status,f=a.getAllResponseHeaders(),typeof a.responseText=="string"&&(c.text=a.responseText);try{l=a.statusText}catch(h){l=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(p){i||s(-1,p)}c&&s(u,l,c,f)},n.async?a.readyState===4?setTimeout(r):(o=++Rn,Un&&(In||(In={},w(e).unload(Un)),In[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Vn,$n=/^(?:toggle|show|hide)$/,Jn=new RegExp("^(?:([+-])=|)("+E+")([a-z%]*)$","i"),Kn=/queueHooks$/,Qn=[nr],Gn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Jn.exec(t),s=i&&i[3]||(w.cssNumber[e]?"":"px"),o=(w.cssNumber[e]||s!=="px"&&+r)&&Jn.exec(w.css(n.elem,e)),u=1,a=20;if(o&&o[3]!==s){s=s||o[3],i=i||[],o=+r||1;do u=u||".5",o/=u,w.style(n.elem,e,o+s);while(u!==(u=n.cur()/r)&&u!==1&&--a)}return i&&(o=n.start=+o||+r||0,n.unit=s,n.end=i[1]?o+(i[1]+1)*i[2]:+i[2]),n}]};w.Animation=w.extend(er,{tweener:function(e,t){w.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Gn[n]=Gn[n]||[],Gn[n].unshift(t)},prefilter:function(e,t){t?Qn.unshift(e):Qn.push(e)}}),w.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(w.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=w.css(e.elem,e.prop,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):e.elem.style&&(e.elem.style[w.cssProps[e.prop]]!=null||w.cssHooks[e.prop])?w.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return e==null||typeof e=="boolean"?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),s=w.speed(t,n,r),o=function(){var t=er(this,w.extend({},e),s);(i||w._data(this,"finish"))&&t.stop(!0)};return o.finish=o,i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=w.timers,o=w._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Kn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&w.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=w._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],s=w.timers,o=r?r.length:0;n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0);for(t=s.length;t--;)s[t].elem===this&&s[t].queue===e&&(s[t].anim.stop(!0),s.splice(t,1));for(t=0;t<o;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.speed=function(e,t,n){var r=e&&typeof e=="object"?w.extend({},e):{complete:n||!n&&t||w.isFunction(e)&&e,duration:e,easing:n&&t||t&&!w.isFunction(t)&&t};r.duration=w.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in w.fx.speeds?w.fx.speeds[r.duration]:w.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){w.isFunction(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},w.timers=[],w.fx=rr.prototype.init,w.fx.tick=function(){var e,n=w.timers,r=0;Xn=w.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||w.fx.stop(),Xn=t},w.fx.timer=function(e){e()&&w.timers.push(e)&&w.fx.start()},w.fx.interval=13,w.fx.start=function(){Vn||(Vn=setInterval(w.fx.tick,w.fx.interval))},w.fx.stop=function(){clearInterval(Vn),Vn=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fx.step={},w.expr&&w.expr.filters&&(w.expr.filters.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length}),w.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){w.offset.setOffset(this,e,t)});var n,r,s={top:0,left:0},o=this[0],u=o&&o.ownerDocument;if(!u)return;return n=u.documentElement,w.contains(n,o)?(typeof o.getBoundingClientRect!==i&&(s=o.getBoundingClientRect()),r=sr(u),{top:s.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:s.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):s},w.offset={setOffset:function(e,t,n){var r=w.css(e,"position");r==="static"&&(e.style.position="relative");var i=w(e),s=i.offset(),o=w.css(e,"top"),u=w.css(e,"left"),a=(r==="absolute"||r==="fixed")&&w.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),w.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},w.fn.extend({position:function(){if(!this[0])return;var e,t,n={top:0,left:0},r=this[0];return w.css(r,"position")==="fixed"?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),w.nodeName(e[0],"html")||(n=e.offset()),n.top+=w.css(e[0],"borderTopWidth",!0),n.left+=w.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-w.css(r,"marginTop",!0),left:t.left-n.left-w.css(r,"marginLeft",!0)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||u;while(e&&!w.nodeName(e,"html")&&w.css(e,"position")==="static")e=e.offsetParent;return e||u})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);w.fn[e]=function(i){return w.access(this,function(e,i,s){var o=sr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?w(o).scrollLeft():s,r?s:w(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),w.each({Height:"height",Width:"width"},function(e,n){w.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){w.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return w.access(this,function(n,r,i){var s;return w.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?w.css(n,r,u):w.style(n,r,i,u)},n,o?i:t,o,null)}})}),w.fn.size=function(){return this.length},w.fn.andSelf=w.fn.addBack,typeof module=="object"&&module&&typeof module.exports=="object"?module.exports=w:(e.jQuery=e.$=w,typeof define=="function"&&define.amd&&define("jquery",[],function(){return w}))}(window),function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.5.2";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else{var o=x.keys(e);for(var i=0,s=o.length;i<s;i++)if(t.call(r,e[o[i]],o[i],e)===n)return}};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r.push(t.call(n,e,i,s))}),r)};var N="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?void 0:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},x.shuffle=function(e){var t,n=0,r=[];return T(e,function(e){t=x.random(n++),r[n-1]=r[t],r[t]=e}),r},x.sample=function(e,t,n){return arguments.length<2||n?e[x.random(e.length-1)]:x.shuffle(e).slice(0,Math.max(0,t))};var k=function(e){return x.isFunction(e)?e:function(t){return t[e]}};x.sortBy=function(e,t,n){var r=k(t);return x.pluck(x.map(e,function(e,t,i){return{value:e,index:t,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index-t.index}),"value")};var L=function(e){return function(t,n,r){var i={},s=n==null?x.identity:k(n);return T(t,function(n,o){var u=s.call(r,n,o,t);e(i,u,n)}),i}};x.groupBy=L(function(e,t,n){(x.has(e,t)?e[t]:e[t]=[]).push(n)}),x.indexBy=L(function(e,t,n){e[t]=n}),x.countBy=L(function(e,t){x.has(e,t)?e[t]++:e[t]=1}),x.sortedIndex=function(e,t,n,r){n=n==null?x.identity:k(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s},x.toArray=function(e){return e?x.isArray(e)?u.call(e):e.length===+e.length?x.map(e,x.identity):x.values(e):[]},x.size=function(e){return e==null?0:e.length===+e.length?e.length:x.keys(e).length},x.first=x.head=x.take=function(e,t,n){return e==null?void 0:t==null||n?e[0]:u.call(e,0,t)},x.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},x.last=function(e,t,n){return e==null?void 0:t==null||n?e[e.length-1]:u.call(e,Math.max(e.length-t,0))},x.rest=x.tail=x.drop=function(e,t,n){return u.call(e,t==null||n?1:t)},x.compact=function(e){return x.filter(e,x.identity)};var A=function(e,t,n){return t&&x.every(e,x.isArray)?a.apply(n,e):(T(e,function(e){x.isArray(e)||x.isArguments(e)?t?o.apply(n,e):A(e,t,n):n.push(e)}),n)};x.flatten=function(e,t){return A(e,t,[])},x.without=function(e){return x.difference(e,u.call(arguments,1))},x.uniq=x.unique=function(e,t,n,r){x.isFunction(t)&&(r=n,n=t,t=!1);var i=n?x.map(e,n,r):e,s=[],o=[];return T(i,function(n,r){if(t?!r||o[o.length-1]!==n:!x.contains(o,n))o.push(n),s.push(e[r])}),s},x.union=function(){return x.uniq(x.flatten(arguments,!0))},x.intersection=function(e){var t=u.call(arguments,1);return x.filter(x.uniq(e),function(e){return x.every(t,function(t){return x.indexOf(t,e)>=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=x.max(x.pluck(arguments,"length").concat(0)),t=new Array(e);for(var n=0;n<e;n++)t[n]=x.pluck(arguments,""+n);return t},x.object=function(e,t){if(e==null)return{};var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},x.indexOf=function(e,t,n){if(e==null)return-1;var r=0,i=e.length;if(n){if(typeof n!="number")return r=x.sortedIndex(e,t),e[r]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(y&&e.indexOf===y)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},x.lastIndexOf=function(e,t,n){if(e==null)return-1;var r=n!=null;if(b&&e.lastIndexOf===b)return r?e.lastIndexOf(t,n):e.lastIndexOf(t);var i=r?n:e.length;while(i--)if(e[i]===t)return i;return-1},x.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var O=function(){};x.bind=function(e,t){var n,r;if(S&&e.bind===S)return S.apply(e,u.call(arguments,1));if(!x.isFunction(e))throw new TypeError;return n=u.call(arguments,2),r=function(){if(this instanceof r){O.prototype=e.prototype;var i=new O;O.prototype=null;var s=e.apply(i,n.concat(u.call(arguments)));return Object(s)===s?s:i}return e.apply(t,n.concat(u.call(arguments)))}},x.partial=function(e){var t=u.call(arguments,1);return function(){return e.apply(this,t.concat(u.call(arguments)))}},x.bindAll=function(e){var t=u.call(arguments,1);if(t.length===0)throw new Error("bindAll must be passed function names");return T(t,function(t){e[t]=x.bind(e[t],e)}),e},x.memoize=function(e,t){var n={};return t||(t=x.identity),function(){var r=t.apply(this,arguments);return x.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},x.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},x.defer=function(e){return x.delay.apply(x,[e,1].concat(u.call(arguments,1)))},x.throttle=function(e,t,n){var r,i,s,o=null,u=0;n||(n={});var a=function(){u=n.leading===!1?0:new Date,o=null,s=e.apply(r,i)};return function(){var f=new Date;!u&&n.leading===!1&&(u=f);var l=t-(f-u);return r=this,i=arguments,l<=0?(clearTimeout(o),o=null,u=f,s=e.apply(r,i)):!o&&n.trailing!==!1&&(o=setTimeout(a,l)),s}},x.debounce=function(e,t,n){var r,i,s,o,u;return function(){s=this,i=arguments,o=new Date;var a=function(){var f=new Date-o;f<t?r=setTimeout(a,t-f):(r=null,n||(u=e.apply(s,i)))},f=n&&!r;return r||(r=setTimeout(a,t)),f&&(u=e.apply(s,i)),u}},x.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},x.wrap=function(e,t){return function(){var n=[e];return o.apply(n,arguments),t.apply(this,n)}},x.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&t.push(n);return t},x.values=function(e){var t=x.keys(e),n=t.length,r=new Array(n);for(var i=0;i<n;i++)r[i]=e[t[i]];return r},x.pairs=function(e){var t=x.keys(e),n=t.length,r=new Array(n);for(var i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r},x.invert=function(e){var t={},n=x.keys(e);for(var r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return T(n,function(n){n in e&&(t[n]=e[n])}),t},x.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t},x.defaults=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?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(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;var o=e.constructor,u=t.constructor;if(o!==u&&!(x.isFunction(o)&&o instanceof o&&x.isFunction(u)&&u instanceof u))return!1;n.push(e),r.push(t);var a=0,l=!0;if(i=="[object Array]"){a=e.length,l=a==t.length;if(l)while(a--)if(!(l=M(e[a],t[a],n,r)))break}else{for(var c in e)if(x.has(e,c)){a++;if(!(l=x.has(t,c)&&M(e[c],t[c],n,r)))break}if(l){for(c in t)if(x.has(t,c)&&!(a--))break;l=!a}}return n.pop(),r.pop(),l};x.isEqual=function(e,t){return M(e,t,[],[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType===1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!=+e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){var r=Array(Math.max(0,e));for(var i=0;i<e;i++)r[i]=t.call(n,i);return r},x.random=function(e,t){return t==null&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var _={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};_.unescape=x.invert(_.escape);var D={escape:new RegExp("["+x.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(_.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),x.result=function(e,t){if(e==null)return void 0;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(x,e))}})};var P=0;x.uniqueId=function(e){var t=++P+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(j,function(e){return"\\"+B[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var F=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("underscore",function(e){return function(){var t,n;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";if(typeof InstallTrigger!="undefined")e="firefox";else if(Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0)e="safari";else if(!!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={},n=this.serializeArray();return t.each(n,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 n=t.createTextRange();n.collapse(!0),n.moveEnd("character",e),n.moveStart("character",e),n.select()}},t.parse_qs=function(e){var t=e||window.location,n={},r,i=/\+/g,s=/([^&=]+)=?([^&]*)/g,o=function(e){return decodeURIComponent(e.replace(i," "))},u=t.search.substring(1);while(r=s.exec(u))n[o(r[1])]=o(r[2]);return n},t.get_site_name=function(){var e=window.location.pathname.split("/");for(var t=0;t<e.length;t++)if(e[t]=="s"&&e.length>t+1)return e[t+1];return""},e.mixin({bindAll:function(t){var n=Array.prototype.slice.call(arguments,1);return n.length===0&&(n=e.functions(t)),e.each(n,function(n){t[n]=e.bind(t[n],t)}),t}})}),function(){var e=this,t=e.Backbone,n=[],r=n.push,i=n.slice,s=n.splice,o;typeof exports!="undefined"?o=exports:o=e.Backbone={},o.VERSION="1.0.0";var u=e._;!u&&typeof require!="undefined"&&(u=require("underscore")),o.$=e.jQuery||e.Zepto||e.ender||e.$,o.noConflict=function(){return e.Backbone=t,this},o.emulateHTTP=!1,o.emulateJSON=!1;var a=o.Events={on:function(e,t,n){if(!l(this,"on",e,[t,n])||!t)return this;this._events||(this._events={});var r=this._events[e]||(this._events[e]=[]);return r.push({callback:t,context:n,ctx:n||this}),this},once:function(e,t,n){if(!l(this,"once",e,[t,n])||!t)return this;var r=this,i=u.once(function(){r.off(e,i),t.apply(this,arguments)});return i._callback=t,this.on(e,i,n)},off:function(e,t,n){var r,i,s,o,a,f,c,h;if(!this._events||!l(this,"off",e,[t,n]))return this;if(!e&&!t&&!n)return this._events={},this;o=e?[e]:u.keys(this._events);for(a=0,f=o.length;a<f;a++){e=o[a];if(s=this._events[e]){this._events[e]=r=[];if(t||n)for(c=0,h=s.length;c<h;c++)i=s[c],(t&&t!==i.callback&&t!==i.callback._callback||n&&n!==i.context)&&r.push(i);r.length||delete this._events[e]}}return this},trigger:function(e){if(!this._events)return this;var t=i.call(arguments,1);if(!l(this,"trigger",e,t))return this;var n=this._events[e],r=this._events.all;return n&&c(n,t),r&&c(r,arguments),this},stopListening:function(e,t,n){var r=this._listeners;if(!r)return this;var i=!t&&!n;typeof t=="object"&&(n=this),e&&((r={})[e._listenerId]=e);for(var s in r)r[s].off(t,n,this),i&&delete this._listeners[s];return this}},f=/\s+/,l=function(e,t,n,r){if(!n)return!0;if(typeof n=="object"){for(var i in n)e[t].apply(e,[i,n[i]].concat(r));return!1}if(f.test(n)){var s=n.split(f);for(var o=0,u=s.length;o<u;o++)e[t].apply(e,[s[o]].concat(r));return!1}return!0},c=function(e,t){var n,r=-1,i=e.length,s=t[0],o=t[1],u=t[2];switch(t.length){case 0:while(++r<i)(n=e[r]).callback.call(n.ctx);return;case 1:while(++r<i)(n=e[r]).callback.call(n.ctx,s);return;case 2:while(++r<i)(n=e[r]).callback.call(n.ctx,s,o);return;case 3:while(++r<i)(n=e[r]).callback.call(n.ctx,s,o,u);return;default:while(++r<i)(n=e[r]).callback.apply(n.ctx,t)}},h={listenTo:"on",listenToOnce:"once"};u.each(h,function(e,t){a[t]=function(t,n,r){var i=this._listeners||(this._listeners={}),s=t._listenerId||(t._listenerId=u.uniqueId("l"));return i[s]=t,typeof n=="object"&&(r=this),t[e](n,r,this),this}}),a.bind=a.on,a.unbind=a.off,u.extend(o,a);var p=o.Model=function(e,t){var n,r=e||{};t||(t={}),this.cid=u.uniqueId("c"),this.attributes={},u.extend(this,u.pick(t,d)),t.parse&&(r=this.parse(r,t)||{});if(n=u.result(this,"defaults"))r=u.defaults({},r,n);this.set(r,t),this.changed={},this.initialize.apply(this,arguments)},d=["url","urlRoot","collection"];u.extend(p.prototype,a,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(e){return u.clone(this.attributes)},sync:function(){return o.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return u.escape(this.get(e))},has:function(e){return this.get(e)!=null},set:function(e,t,n){var r,i,s,o,a,f,l,c;if(e==null)return this;typeof e=="object"?(i=e,n=t):(i={})[e]=t,n||(n={});if(!this._validate(i,n))return!1;s=n.unset,a=n.silent,o=[],f=this._changing,this._changing=!0,f||(this._previousAttributes=u.clone(this.attributes),this.changed={}),c=this.attributes,l=this._previousAttributes,this.idAttribute in i&&(this.id=i[this.idAttribute]);for(r in i)t=i[r],u.isEqual(c[r],t)||o.push(r),u.isEqual(l[r],t)?delete this.changed[r]:this.changed[r]=t,s?delete c[r]:c[r]=t;if(!a){o.length&&(this._pending=!0);for(var h=0,p=o.length;h<p;h++)this.trigger("change:"+o[h],this,c[o[h]],n)}if(f)return this;if(!a)while(this._pending)this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,u.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var n in this.attributes)t[n]=void 0;return this.set(t,u.extend({},e,{unset:!0}))},hasChanged:function(e){return e==null?!u.isEmpty(this.changed):u.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?u.clone(this.changed):!1;var t,n=!1,r=this._changing?this._previousAttributes:this.attributes;for(var i in e){if(u.isEqual(r[i],t=e[i]))continue;(n||(n={}))[i]=t}return n},previous:function(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]},previousAttributes:function(){return u.clone(this._previousAttributes)},fetch:function(e){e=e?u.clone(e):{},e.parse===void 0&&(e.parse=!0);var t=this,n=e.success;return e.success=function(r){if(!t.set(t.parse(r,e),e))return!1;n&&n(t,r,e),t.trigger("sync",t,r,e)},j(this,e),this.sync("read",this,e)},save:function(e,t,n){var r,i,s,o=this.attributes;e==null||typeof e=="object"?(r=e,n=t):(r={})[e]=t;if(r&&(!n||!n.wait)&&!this.set(r,n))return!1;n=u.extend({validate:!0},n);if(!this._validate(r,n))return!1;r&&n.wait&&(this.attributes=u.extend({},o,r)),n.parse===void 0&&(n.parse=!0);var a=this,f=n.success;return n.success=function(e){a.attributes=o;var t=a.parse(e,n);n.wait&&(t=u.extend(r||{},t));if(u.isObject(t)&&!a.set(t,n))return!1;f&&f(a,e,n),a.trigger("sync",a,e,n)},j(this,n),i=this.isNew()?"create":n.patch?"patch":"update",i==="patch"&&(n.attrs=r),s=this.sync(i,this,n),r&&n.wait&&(this.attributes=o),s},destroy:function(e){e=e?u.clone(e):{};var t=this,n=e.success,r=function(){t.trigger("destroy",t,t.collection,e)};e.success=function(i){(e.wait||t.isNew())&&r(),n&&n(t,i,e),t.isNew()||t.trigger("sync",t,i,e)};if(this.isNew())return e.success(),!1;j(this,e);var i=this.sync("delete",this,e);return e.wait||r(),i},url:function(){var e=u.result(this,"urlRoot")||u.result(this.collection,"url")||B();return this.isNew()?e:e+(e.charAt(e.length-1)==="/"?"":"/")+encodeURIComponent(this.id)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return this.id==null},isValid:function(e){return this._validate({},u.extend(e||{},{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=u.extend({},this.attributes,e);var n=this.validationError=this.validate(e,t)||null;return n?(this.trigger("invalid",this,n,u.extend(t||{},{validationError:n})),!1):!0}});var v=["keys","values","pairs","invert","pick","omit"];u.each(v,function(e){p.prototype[e]=function(){var t=i.call(arguments);return t.unshift(this.attributes),u[e].apply(u,t)}});var m=o.Collection=function(e,t){t||(t={}),t.url&&(this.url=t.url),t.model&&(this.model=t.model),t.comparator!==void 0&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,u.extend({silent:!0},t))},g={add:!0,remove:!0,merge:!0},y={add:!0,merge:!1,remove:!1};u.extend(m.prototype,a,{model:p,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return o.sync.apply(this,arguments)},add:function(e,t){return this.set(e,u.defaults(t||{},y))},remove:function(e,t){e=u.isArray(e)?e.slice():[e],t||(t={});var n,r,i,s;for(n=0,r=e.length;n<r;n++){s=this.get(e[n]);if(!s)continue;delete this._byId[s.id],delete this._byId[s.cid],i=this.indexOf(s),this.models.splice(i,1),this.length--,t.silent||(t.index=i,s.trigger("remove",s,this,t)),this._removeReference(s)}return this},set:function(e,t){t=u.defaults(t||{},g),t.parse&&(e=this.parse(e,t)),u.isArray(e)||(e=e?[e]:[]);var n,i,o,a,f,l,c=t.at,h=this.comparator&&c==null&&t.sort!==!1,p=u.isString(this.comparator)?this.comparator:null,d=[],v=[],m={};for(n=0,i=e.length;n<i;n++){if(!(o=this._prepareModel(e[n],t)))continue;(f=this.get(o))?(t.remove&&(m[f.cid]=!0),t.merge&&(f.set(o.attributes,t),h&&!l&&f.hasChanged(p)&&(l=!0))):t.add&&(d.push(o),o.on("all",this._onModelEvent,this),this._byId[o.cid]=o,o.id!=null&&(this._byId[o.id]=o))}if(t.remove){for(n=0,i=this.length;n<i;++n)m[(o=this.models[n]).cid]||v.push(o);v.length&&this.remove(v,t)}d.length&&(h&&(l=!0),this.length+=d.length,c!=null?s.apply(this.models,[c,0].concat(d)):r.apply(this.models,d)),l&&this.sort({silent:!0});if(t.silent)return this;for(n=0,i=d.length;n<i;n++)(o=d[n]).trigger("add",o,this,t);return l&&this.trigger("sort",this,t),this},reset:function(e,t){t||(t={});for(var n=0,r=this.models.length;n<r;n++)this._removeReference(this.models[n]);return t.previousModels=this.models,this._reset(),this.add(e,u.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,u.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,u.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 e==null?void 0:this._byId[e.id!=null?e.id:e.cid||e]},at:function(e){return this.models[e]},where:function(e,t){return u.isEmpty(e)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var n in e)if(e[n]!==t.get(n))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={}),u.isString(this.comparator)||this.comparator.length===1?this.models=this.sortBy(this.comparator,this):this.models.sort(u.bind(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},sortedIndex:function(e,t,n){t||(t=this.comparator);var r=u.isFunction(t)?t:function(e){return e.get(t)};return u.sortedIndex(this.models,e,r,n)},pluck:function(e){return u.invoke(this.models,"get",e)},fetch:function(e){e=e?u.clone(e):{},e.parse===void 0&&(e.parse=!0);var t=e.success,n=this;return e.success=function(r){var i=e.reset?"reset":"set";n[i](r,e),t&&t(n,r,e),n.trigger("sync",n,r,e)},j(this,e),this.sync("read",this,e)},create:function(e,t){t=t?u.clone(t):{};if(!(e=this._prepareModel(e,t)))return!1;t.wait||this.add(e,t);var n=this,r=t.success;return t.success=function(i){t.wait&&n.add(e,t),r&&r(e,i,t)},e.save(null,t),e},parse:function(e,t){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 n=new this.model(e,t);return n._validate(e,t)?n:(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,n,r){if((e==="add"||e==="remove")&&n!==this)return;e==="destroy"&&this.remove(t,r),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],t.id!=null&&(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"];u.each(b,function(e){m.prototype[e]=function(){var t=i.call(arguments);return t.unshift(this.models),u[e].apply(u,t)}});var w=["groupBy","countBy","sortBy"];u.each(w,function(e){m.prototype[e]=function(t,n){var r=u.isFunction(t)?t:function(e){return e.get(t)};return u[e](this.models,r,n)}});var E=o.View=function(e){this.cid=u.uniqueId("view"),this._configure(e||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},S=/^(\S+)\s*(.*)$/,x=["model","collection","el","id","attributes","className","tagName","events"];u.extend(E.prototype,a,{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(e,t){return this.$el&&this.undelegateEvents(),this.$el=e instanceof o.$?e:o.$(e),this.el=this.$el[0],t!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=u.result(this,"events")))return this;this.undelegateEvents();for(var t in e){var n=e[t];u.isFunction(n)||(n=this[e[t]]);if(!n)continue;var r=t.match(S),i=r[1],s=r[2];n=u.bind(n,this),i+=".delegateEvents"+this.cid,s===""?this.$el.on(i,n):this.$el.on(i,s,n)}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_configure:function(e){this.options&&(e=u.extend({},u.result(this,"options"),e)),u.extend(this,u.pick(e,x)),this.options=e},_ensureElement:function(){if(!this.el){var e=u.extend({},u.result(this,"attributes"));this.id&&(e.id=u.result(this,"id")),this.className&&(e["class"]=u.result(this,"className"));var t=o.$("<"+u.result(this,"tagName")+">").attr(e);this.setElement(t,!1)}else this.setElement(u.result(this,"el"),!1)}}),o.sync=function(e,t,n){var r=T[e];u.defaults(n||(n={}),{emulateHTTP:o.emulateHTTP,emulateJSON:o.emulateJSON});var i={type:r,dataType:"json"};n.url||(i.url=u.result(t,"url")||B()),n.data==null&&t&&(e==="create"||e==="update"||e==="patch")&&(i.contentType="application/json",i.data=JSON.stringify(n.attrs||t.toJSON(n))),n.emulateJSON&&(i.contentType="application/x-www-form-urlencoded",i.data=i.data?{model:i.data}:{});if(n.emulateHTTP&&(r==="PUT"||r==="DELETE"||r==="PATCH")){i.type="POST",n.emulateJSON&&(i.data._method=r);var s=n.beforeSend;n.beforeSend=function(e){e.setRequestHeader("X-HTTP-Method-Override",r);if(s)return s.apply(this,arguments)}}i.type!=="GET"&&!n.emulateJSON&&(i.processData=!1),i.type==="PATCH"&&window.ActiveXObject&&(!window.external||!window.external.msActiveXFilteringEnabled)&&(i.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var a=n.xhr=o.ajax(u.extend(i,n));return t.trigger("request",t,a,n),a};var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};o.ajax=function(){return o.$.ajax.apply(o.$,arguments)};var N=o.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},C=/\((.*?)\)/g,k=/(\(\?)?:\w+/g,L=/\*\w+/g,A=/[\-{}\[\]+?.,\\\^$|#\s]/g;u.extend(N.prototype,a,{initialize:function(){},route:function(e,t,n){u.isRegExp(e)||(e=this._routeToRegExp(e)),u.isFunction(t)&&(n=t,t=""),n||(n=this[t]);var r=this;return o.history.route(e,function(i){var s=r._extractParameters(e,i);n&&n.apply(r,s),r.trigger.apply(r,["route:"+t].concat(s)),r.trigger("route",t,s),o.history.trigger("route",r,t,s)}),this},navigate:function(e,t){return o.history.navigate(e,t),this},_bindRoutes:function(){if(!this.routes)return;this.routes=u.result(this,"routes");var e,t=u.keys(this.routes);while((e=t.pop())!=null)this.route(e,this.routes[e])},_routeToRegExp:function(e){return e=e.replace(A,"\\$&").replace(C,"(?:$1)?").replace(k,function(e,t){return t?e:"([^/]+)"}).replace(L,"(.*?)"),new RegExp("^"+e+"$")},_extractParameters:function(e,t){var n=e.exec(t).slice(1);return u.map(n,function(e){return e?decodeURIComponent(e):null})}});var O=o.History=function(){this.handlers=[],u.bindAll(this,"checkUrl"),typeof window!="undefined"&&(this.location=window.location,this.history=window.history)},M=/^[#\/]|\s+$/g,_=/^\/+|\/+$/g,D=/msie [\w.]+/,P=/\/$/;O.started=!1,u.extend(O.prototype,a,{interval:50,getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(e,t){if(e==null)if(this._hasPushState||!this._wantsHashChange||t){e=this.location.pathname;var n=this.root.replace(P,"");e.indexOf(n)||(e=e.substr(n.length))}else e=this.getHash();return e.replace(M,"")},start:function(e){if(O.started)throw new Error("Backbone.history has already been started");O.started=!0,this.options=u.extend({},{root:"/"},this.options,e),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 t=this.getFragment(),n=document.documentMode,r=D.exec(navigator.userAgent.toLowerCase())&&(!n||n<=7);this.root=("/"+this.root+"/").replace(_,"/"),r&&this._wantsHashChange&&(this.iframe=o.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(t)),this._hasPushState?o.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!r?o.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=t;var i=this.location,s=i.pathname.replace(/[^\/]$/,"$&/")===this.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!s)return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+this.location.search+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&s&&i.hash&&(this.fragment=this.getHash().replace(M,""),this.history.replaceState({},document.title,this.root+this.fragment+i.search));if(!this.options.silent)return this.loadUrl()},stop:function(){o.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),O.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();t===this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe)));if(t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(e){var t=this.fragment=this.getFragment(e),n=u.any(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0});return n},navigate:function(e,t){if(!O.started)return!1;if(!t||t===!0)t={trigger:t};e=this.getFragment(e||"");if(this.fragment===e)return;this.fragment=e;var n=this.root+e;if(this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);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,n){if(n){var r=e.href.replace(/(javascript:|#).*$/,"");e.replace(r+"#"+t)}else e.hash="#"+t}}),o.history=new O;var H=function(e,t){var n=this,r;e&&u.has(e,"constructor")?r=e.constructor:r=function(){return n.apply(this,arguments)},u.extend(r,n,t);var i=function(){this.constructor=r};return i.prototype=n.prototype,r.prototype=new i,e&&u.extend(r.prototype,e),r.__super__=n.prototype,r};p.extend=m.extend=N.extend=E.extend=O.extend=H;var B=function(){throw new Error('A "url" property or function must be specified')},j=function(e,t){var n=t.error;t.error=function(r){n&&n(e,r,t),e.trigger("error",e,r,t)}}}.call(this),define("backbone",["underscore","jquery","ubnt/ubnt.utils"],function(e){return function(){var t,n;return t||e.Backbone}}(this)),function(){"use strict";function t(e,t,n,r,i,s){t[e]&&(n.push(e),(t[e]===!0||t[e]===1)&&r.push(i+e+"/"+s))}function n(e,t,n,r,i){var s=r+t+"/"+i;require._fileExists(e.toUrl(s+".js"))&&n.push(s)}function r(e,t,n){var i;for(i in t)t.hasOwnProperty(i)&&(!e.hasOwnProperty(i)||n)?e[i]=t[i]:typeof t[i]=="object"&&(!e[i]&&t[i]&&(e[i]={}),r(e[i],t[i],n))}var e=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(i){var s=i.config?i.config():{};return{version:"2.0.4",load:function(i,o,u,a){a=a||{},a.locale&&(s.locale=a.locale);var f,l=e.exec(i),c=l[1],h=l[4],p=l[5],d=h.split("-"),v=[],m={},g,y,b="";l[5]?(c=l[1],f=c+p):(f=i,p=l[4],h=s.locale,h||(h=s.locale=typeof navigator=="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),d=h.split("-"));if(a.isBuild){v.push(f),n(o,"root",v,c,p);for(g=0;g<d.length;g++)y=d[g],b+=(b?"-":"")+y,n(o,b,v,c,p);o(v,function(){u()})}else o([f],function(e){var n=[],i;t("root",e,n,v,c,p);for(g=0;g<d.length;g++)i=d[g],b+=(b?"-":"")+i,t(b,e,n,v,c,p);o(v,function(){var t,i,s;for(t=n.length-1;t>-1&&n[t];t--){s=n[t],i=e[s];if(i===!0||i===1)i=o(c+s+"/"+p);r(m,i)}u(m)})})}}})}(),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.",E_Success:"Success",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_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_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",G_NavDashboard:"Dashboard",G_NavMap:"Map",G_NavDevices:"Devices",G_NavClients:"Clients",G_NavCalls:"Calls",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_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_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?",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_DevicesNumCalls:"Num Calls",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_PortForwardDestIp:"Forward IP",G_PortForwardDestPort:"Forward Port",G_PortForwardDest:"Dest IP/Port",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_Calls:"Calls",G_CallsManageExtensions:"Manage Extensions",G_CallsDirection:"Direction",G_CallsOrigin:"Origin",G_CallsRecipient:"Recipient",G_CallsStartTime:"Start Time",G_CallIsInternational:" (International)",G_CallsStatusAnswered:"Successful",G_CallsStatusGroupNoAnswer:"Missed (Group)",G_CallsStatusNoAnswer:"Missed",G_CallsStatusRejected:"Rejected",G_CallsStatusVoicemail:"Voicemail",G_CallsStatusTransferTo:"Transferred to ",G_CallsStatusConference:"Conference",G_CallsUnknown:"Unknown",G_CallsExtension:"Extension",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_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_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_SettingsScanIsoAPS:"Scan for Isolated APS",G_SettingsDefaultGateway:"Default Gateway",G_SettingsCustomIP:"Custom IP",G_UplinkIPAddress:"Uplink IP Address",G_SettingsSNMP:"SNMP",G_SettingsEnblSNMP:"Enable SNMPv1, Community String",G_SettingsRemoteLogging:"Remote Logging",G_SettingsEnblRemoteSysServ:"Enable remote syslog server",G_SettingsLoggingDebug:"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_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_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_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_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_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_SettingsUseLAN:"VOIP Port",G_SettingsUseLANDesc:"Use LAN Port to connect the phones (when separated networks / wiring is not available)",G_SettingsProviderNumbers:"Provider & Numbers",G_SettingsProviderChoice:"SIP Provider",G_SettingsProvider:"VOIP Provider",G_SettingsSipServer:"SIP Server",G_SettingsSipAuth:"SIP Authentication Method",G_SettingsSipAuthName:"Authorization ID",G_SettingsSipProxy:"Outbound Proxy",G_SettingsSipFromUser:"SIP From User",G_SettingsSipFromUserTitle:"Username to use in from-user: *optional* field",G_SettingsSipVoicemailURL:"SIP Voicemail",G_SettingsSipVoicemailURLTitle:"Voicemail URL or number from SIP provider",G_SettingsSipUsername:"SIP Username",G_SettingsSipPassword:"SIP Password",G_SettingsSipTechPrefix:"Tech Prefix",G_SettingsProviderSetup:"Provider Setup",G_SettingsProviderUbnt:"Ubiquiti",G_SettingsProviderCustom:"Manual",G_SettingsProviderExternal:"External",G_SettingsProviderNone:"None",G_SettingsProviderUbntNote:"Sign up with your UBNT account",G_SettingsProviderCustomNote:"Use UniFi Security Gateway as PBX with your own SIP credentials",G_SettingsProviderExternalNote:"Provide your own PBX. Use UniFi to mass-provision phones",G_SettingsProviderNoneNote:"Leave it unconfigured, local testing only",G_SettingsProviderAuthUser:"User-based (most common)",G_SettingsProviderAuthIP:"IP-based",G_SettingsCreateNewNumber:"Create New Number",G_SettingsEditNumber:"Edit Number",G_SettingsVoipGlobal:"Global",G_SettingsIntlCalling:"International Calling",G_SettingsCallScreening:"Call Screening",G_SettingsDefaultHoldAudio:"Default Hold Audio",G_SettingsVoipNumber:"Number",G_SettingsVoipExtension:"Extension",G_SettingsVoipType:"Type",G_SettingsVoipExtPhone:"Phone",G_SettingsVoipExtPhoneUnassigned:"unassigned",G_SettingsVoipExtConference:"Conference",G_SettingsVoipExtGroup:"Group",G_SettingsVoipExtIVR:"Auto-Responder",G_SettingsNumberManage:"Manage",G_SettingsNumberRefresh:"Refresh",G_SettingsNumberAdd:"Add",G_SettingsAutoResponder:"Auto-Responder",G_SettingsAutoRespBusinessHours:"Business Hours",G_SettingsAutoRespAfterHours:"After Hours",G_SettingsAutoRespEditHours:"Edit Business Hours",G_SettingsAutoRespGreeting:"Greeting",G_SettingsAutoRespMenu:"Menu",G_SettingsAutoRespGreetingTip:"Please set up your greeting to correctly align with your menu options.",G_SettingsAutoRespHoursTip:"Any hours not indicated as Business Hours will be considered After Hours.",G_SettingsAutoRespHours:"Hours",G_SettingsAutoRespMenuPress:"Press",G_SettingsAutoRespMenuFor:"For",G_SettingsAutoRespMenuPlayAudio:"Play Audio",G_SettingsAutoRespMenuVoicemail:"Voicemail",G_SettingsAutoRespMenuTransfer:"Transfer",G_SettingsAutoRespMenuAdd:"Add Option",G_SettingsAutoRespMenuRemove:"Remove Option",G_SettingsExtensions:"Extensions",G_SettingsExtensionImport:"Import",G_SettingsCreateNewExtension:"Create New Extension",G_SettingsEditExtension:"Edit Extension",G_SettingsCreateNewConference:"Create New Conference",G_SettingsEditConference:"Edit Conference",G_SettingsCreateNewGroup:"Create New Group",G_SettingsEditGroup:"Edit Group",G_SettingsExtDirectLine:"Direct Line",G_SettingsExtPhone:"Phone",G_SettingsExtMembers:"Members",G_SettingsExtMembersPlaceholder:"Enter Name or Email Address",G_SettingsExtRequirePin:"Require PIN",G_SettingsExtPin:"PIN",G_SettingsExtGreeting:"Greeting",G_SettingsExtVoicemailPin:"Voicemail PIN",G_SettingsExtResendPin:"Resend PIN",G_SettingAudioPickerFilename:"Filename: ",G_SettingsAudioPickerUploadAudio:"Upload Audio (.mp3, .wav)",G_SettingsAudioPickerTextToSpeech:"Text to Speech",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_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_PropertiesNetworks:"Networks",G_PropertiesLANIPAddress:"LAN IP Address",G_PropertiesDownActivity:"Down Activity",G_PropertiesUpActivity:"Up Activity",G_PropertiesNumPhones:"Num Phones",G_PropertiesNumCalls:"Num Calls",G_PropertiesActiveCalls:"Active Calls",G_PropertiesNoNetworksConfigured:"No networks configured",G_PropertiesNumClients:"Num Clients",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_PropertiesEnable:"Enable",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_HotspotCreateTitle:"Number of vouchers from 1 to 10000",G_HotspotOnetime:"One time",G_HotspotMultiuse:"Multi use",G_HotspotVouchersFor:"vouchers for",G_HotspotUserDefined:"User-defined",G_HotspotTimeUnitTitle:"Number of time units from 1 to 10000",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:"会话超时, 请重新登录.",E_Success:"成功",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:"无法加载 Google 地图,请连接互联网并重新加载页面.",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_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_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_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_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} 必须是唯一的",G_NavDashboard:"操作面板",G_NavMap:"地图",G_NavDevices:"设备",G_NavClients:"客户端",G_NavCalls:"来电",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_User:"用户",G_Users:"用户",G_Noted:"已标注的",G_Guest:"来宾",G_OfflineOnly:"只显示离线",G_Download:"下载",G_Guests:"来宾",G_Down:"下行",G_Up:"上行",G_Activity:"活跃度",G_Filter:"筛选器",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_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_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_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}. 您确定要应用变更?",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:"Google 地图",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_DevicesNumCalls:"通话数量",G_DevicesMinutes:"分钟",G_DevicesOverview:"概览",G_DevicesPerformance:"性能",G_DevicesAddSuccess:"添加设备成功",G_DevicesChangePassword:"修改密码",G_DevicesAddNewDevice:"新增一个设备",G_DevicesUpdateAll:"全部更新",G_DevicesStartRollingUpgrade:"开始滚动升级",G_DevicesRollingUpgradeInProgress:"滚动升级正在进行中(请勿断开设备电源)",G_DevicesRollingUpgradeCancelled:"滚动升级已取消",G_DevicesTopologyChanged:"拓扑结构已变更,新的设定正在传送中,请稍等",G_MoveTo:"移动到…",N_ConfirmPowerCyclePort:'您确定要将交换器端口 "{1}" 的供电关闭五秒钟?',G_DevicesConsole:"控制台",G_DevicesWan:"WAN",G_DevicesLan:"LAN",G_DevicesVoip:"VOIP",G_PortForwardSource:"来自",G_PortForwardDestIp:"转发 IP",G_PortForwardDestPort:"转发端口",G_PortForwardDest:"目标 IP/端口",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_Calls:"通话",G_CallsManageExtensions:"管理分机",G_CallsDirection:"方向",G_CallsOrigin:"主叫方",G_CallsRecipient:"被叫方",G_CallsStartTime:"通话时间",G_CallsStatusOngoing:"正在通话",G_CallsStatusInitiating:"开启中",G_CallsStatusSuccessful:"成功",G_CallsStatusVoicemail:"语音信箱",G_CallsStatusTransferred:"呼叫已转接",G_CallsStatusTerminated:"已结束",G_CallsUnknown:"未知",G_CallsExtension:"分机",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_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:"Good",G_InsightsPoeCpdHigh:"CPD 过高",G_InsightsPoePassive:"被动式",G_InsightsPoeNotDetected:"未检测到",G_InsightsCountersTxBytes:"TX Bytes",G_InsightsCountersTxFrames:"TX 帧",G_InsightsCountersTxMulticast:"TX 组播",G_InsightsCountersTxBroadcast:"TX 广播",G_InsightsCountersTxErrors:"TX 错误",G_InsightsCountersRxBytes:"RX Bytes",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_SettingsSiteConfig:"站点配置",G_SettingsSite:"站点",G_SettingsServices:"服务",G_SettingsController:"控制器",G_SettingsControllerSettings:"控制器设置",G_SettingsMailServer:"邮件服务器",G_SettingsSiteName:"站点名称",G_SettingsCountry:"国家",G_SettingsTimezone:"时区",G_SettingsAutoUpgrade:"自动升级",G_SettingsAutoUpgradeAPFirm:"自动升级 AP 固件",G_SettingsAutoUpgradePhoneFirm:"自动升级话机固件",G_SettingsLED:"LED 指示灯",G_SettingsEnblStatusLED:"启用 LED 状态指示灯",G_SettingsAlert:"警示",G_SettingsEnblAlertEmails:"启用邮件提醒",G_SettingsUplnkConnMonitor:"上行连接性监视",G_SettingsEnableConnMonWireUplnk:"启用连接性监视和无线上行",G_SettingsScanIsoAPS:"扫描隔离的客户端",G_SettingsDefaultGateway:"默认网关",G_SettingsCustomIP:"自定义 IP",G_UplinkIPAddress:"上行 IP 地址",G_SettingsSNMP:"SNMP",G_SettingsEnblSNMP:"启用 SNMPv1, 社区字符串",G_SettingsRemoteLogging:"远程日志",G_SettingsEnblRemoteSysServ:"启用远程系统日志服务器",G_SettingsLoggingDebug:"调试级别系统日志",G_SettingsRemoteIPAddress:"远程 IP 地址",G_SettingsDeviceAuth:"设备身份验证",G_SettingsCntrlHostnameIP:"控制器主机名/IP",G_SettingsNetDiscovery:"网络发现",G_SettingsMakeCntrlDiscvL2Net:"确保控制器在 L2 网络中可被发现",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_SettingsEditAdmin:"编辑管理员",G_SettingsUserGroup:"用户群组",G_SettingsUserGroups:"用户群组",G_SettingsCreateNewUserGroup:"创建一个新用户群组",G_SettingsEditUserGroup:"编辑用户群组",G_SettingsBandwidthLimit:"带宽限制",G_SettingsBandwidthLimitDL:"带宽限制 (下载)",G_SettingsBandwidthLimitUL:"带宽限制 (上传)",G_SettingsLimitedTo:"限制为",G_SettingsKbps:"Kbps",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_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_SettingsHideSSID:"隐藏 SSID",G_SettingsWPAMode:"WPA 模式",G_SettingsEnableWLANSchedule:"启用 WLAN 日程表",G_SettingsScheduled:"日程表",G_SettingsWLANSchedule:"WLAN 日程表",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_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_SettingsUseLAN:"VOIP 端口",G_SettingsUseLANDesc:"使用 LAN 接口连接到电话(当独立网络 / 线路不可用时)",G_SettingsProviderNumbers:"运营商 & 号码",G_SettingsProviderChoice:"SIP 提供商",G_SettingsProvider:"VOIP 提供商",G_SettingsSipServer:"SIP 服务器",G_SettingsSipAuth:"SIP 验证方式",G_SettingsSipAuthName:"验证 ID",G_SettingsSipProxy:"外发代理",G_SettingsSipFromUser:"SIP From User",G_SettingsSipFromUserTitle:"用户名的格式如下: *可选*, 如果为空的话, 和用户名一样",G_SettingsSipVoicemailURL:"SIP 语音信箱",G_SettingsSipVoicemailURLTitle:"来自 SIP 提供商的语音信箱 URL 或号码",G_SettingsSipUsername:"SIP 用户名",G_SettingsSipPassword:"SIP 密码",G_SettingsSipTechPrefix:"Tech Prefix",G_SettingsProviderSetup:"提供商设置",G_SettingsProviderUbnt:"Ubiquiti",G_SettingsProviderCustom:"手动",G_SettingsProviderExternal:"外部",G_SettingsProviderNone:"无",G_SettingsProviderUbntNote:"登录您的 UBNT 帐号",G_SettingsProviderCustomNote:"使用您自己的 SIP 证书, 将 UniFi 安全网关做为 PBX 来用",G_SettingsProviderExternalNote:"提供您自己的 PBX. 利用 UniFi 来批量管理电话",G_SettingsProviderNoneNote:"暂不配置, 仅供本地测试",G_SettingsProviderAuthUser:"基于使用者 (较常见)",G_SettingsProviderAuthIP:"基于 IP",G_SettingsCreateNewNumber:"创建一个新号码",G_SettingsEditNumber:"编辑号码",G_SettingsVoipGlobal:"全球",G_SettingsIntlCalling:"国际电话",G_SettingsCallScreening:"呼叫筛选",G_SettingsDefaultHoldAudio:"默认 Hold Audio",G_SettingsVoipNumber:"号码",G_SettingsVoipExtension:"分机",G_SettingsVoipType:"类型",G_SettingsVoipExtPhone:"电话",G_SettingsVoipExtPhoneUnassigned:"未指定",G_SettingsVoipExtConference:"会议",G_SettingsVoipExtGroup:"群组",G_SettingsVoipExtIVR:"自动答录机",G_SettingsNumberManage:"管理",G_SettingsNumberRefresh:"刷新",G_SettingsNumberAdd:"添加",G_SettingsAutoResponder:"自动答录机",G_SettingsAutoRespBusinessHours:"上班时间",G_SettingsAutoRespAfterHours:"下班时间",G_SettingsAutoRespEditHours:"编辑上班时间",G_SettingsAutoRespGreeting:"问候语",G_SettingsAutoRespMenu:"菜单",G_SettingsAutoRespGreetingTip:"请参照您的菜单选项正确设置问候语.",G_SettingsAutoRespHoursTip:"请注意上班时间是针对全球所有电话号码和自动答录机的. 设定中所有未包含在上班时间之内的时间均会被视做下班时间.",G_SettingsAutoRespHours:"时间",G_SettingsAutoRespMenuPress:"请按",G_SettingsAutoRespMenuFor:"接",G_SettingsAutoRespMenuPlayAudio:"播放语音",G_SettingsAutoRespMenuVoicemail:"语音信箱",G_SettingsAutoRespMenuTransfer:"转接",G_SettingsAutoRespMenuAdd:"增加选项",G_SettingsAutoRespMenuRemove:"移除选项",G_SettingsExtensions:"分机",G_SettingsExtensionImport:"导入",G_SettingsCreateNewExtension:"创建新分机",G_SettingsEditExtension:"编辑分机",G_SettingsCreateNewConference:"创建新会议",G_SettingsEditConference:"编辑会议",G_SettingsCreateNewGroup:"创建新群组",G_SettingsEditGroup:"编辑群组",G_SettingsExtDirectLine:"直线",G_SettingsExtPhone:"电话",G_SettingsExtMembers:"号码",G_SettingsExtMembersPlaceholder:"输入名称或邮箱地址",G_SettingsExtRequirePin:"要求 PIN 码",G_SettingsExtPin:"PIN",G_SettingsExtGreeting:"问候语",G_SettingsExtVoicemailPin:"语音信箱 PIN",G_SettingsExtResendPin:"重新发送 PIN",G_SettingAudioPickerFilename:"文件名: ",G_SettingsAudioPickerUploadAudio:"上传语音（.mp3,.wav）",G_SettingsAudioPickerTextToSpeech:"文本转语音",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_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:"下行 Pkts/Bytes",G_PropertiesUpPktsBytes:"上行 Pkts/Bytes",G_PropertiesAdvancedOpts:"高级选项",G_PropertiesInformURL:"通知 URL",G_PropertiesUplinks:"上行链接",G_PropertiesDownlinks:"下行链接",G_PropertiesRadio11NBG:"无线广播 (11N/B/G)",G_PropertiesTransmitPower:"发射功率",G_PropertiesTXPktsBytes:"发射 Pkts/Bytes",G_PropertiesRXPktsBytes:"接收 Pkts/Bytes",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_PropertiesNetworks:"网络",G_PropertiesLANIPAddress:"LAN IP 地址",G_PropertiesDownActivity:"下行活跃度",G_PropertiesUpActivity:"上行活跃度",G_PropertiesNumPhones:"电话数量",G_PropertiesNumCalls:"通话数量",G_PropertiesActiveCalls:"活跃通话",G_PropertiesNoNetworksConfigured:"无网络配置",G_PropertiesNumClients:"客户端数量",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_PropertiesNetworksVLANs:"网络/VLANs",G_PropertiesForgetSwitch:"移除该交换机",G_PropertiesForgetSwitchTxt:"如果您不希望再管理此交换机, 可以将其移除, 注意所有关于此交换机的配置及历史记录也都将会清除.",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_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_HotspotOnetime:"单次有效",G_HotspotMultiuse:"多次有效",G_HotspotVouchersFor:"凭证有效期",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:"完成",E_WontWork:"这将会无法工作.",E_WontWorkDetail:"Internet Explorer 8 以及更早版本当前无法兼容我们的部分 UI<br/>功能. 请先用别的网页浏览器再试一次.",G_WelcomeSelectLanguage:"请选择您的首选语言",G_WelcomeSelectCountry:"选择您的国家",G_WelcomeSelectTimezone:"选择您的时区",G_WelcomeRestoreLinkPrefix:"您还可以",G_WelcomeRestoreLinkText:"从之前的备份中恢复",G_Refresh:"刷新",G_DiscoverMessage:"请选择您要配置的设备.",G_WirelessMessage:"关于无线网络, 本安装向导可为您创建一个安全的简单无线网络. 在下面输入您想要使用的无线设置:",G_WirelessMessageSkip:"如果没有安装 UniFi AP 的话, 您可以跳过该步骤.",G_WirelessSecureSsid:"Secure SSID",G_WirelessSecureSsidTitle:"SSID 只能是可打印的 ASCII 字符",G_WirelessSecurityKey:"安全密钥",G_WirelessSecurityKeyTitle:"安全密钥至少要有 8 个字符",G_WirelessOptionMessage:"如有需要,请可以为您的来宾创建一个不加密的无线网络",G_WirelessEnableGuestAccess:"启用来宾接入",G_WirelessGuestSsid:"来宾 SSID",G_PasswordMessage:"请提供一个管理员名称和密码来登录 UniFi 控制器.",G_PasswordAdminName:"管理员名称",G_ConfirmPassword:"确认密码",G_FinishMessage:'请再确认以下设置, 点击"退回"来修改设置或点击"完成"来激活设置. 完成后您将会被跳转到管理界面.',E_PasswordRequired:"必须填入密码",E_PasswordsDontMatch:"密码不匹配",E_SsidAlphanumeric:"ssid 必须为可打印的字母或数字",E_SsidPasswordLength:"密码长度必须为 8 到 63 位的字符",E_AdminNameAlphanumeric:"管理员名称必须是字母或数字",E_NoDevicesMsg:"未发现任何设备.",E_NoDevicesInstructions:"请先确保所有设备在同一个 L2/交换网络中后再试一次.",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 n=e;return n.apiError=function(t,n){var r;if(t.responseText)try{var i=JSON.parse(t.responseText).meta;r=e[i.msg.replace("api.err.","E_")];if(r&&n===!0){var s=/{(\w+)}/g,o=r,u;while(u=s.exec(r))i[u[1]]&&(o=o.replace(u[0],i[u[1]]));r=o}}catch(a){r=e.E_InvalidResponse}else r=t.statusText;return r||e.E_UnspecifiedError},n.localize=function(e){var t=[].slice.call(arguments,1),n=t.length;if(n)for(var r=0;r<n;r++)e=e.replace(/{[0-9]+}/,this.sanitize(t[r]));return e},n.sanitize=function(e){return t("<div />").text(e).html()},n});var XRegExp;XRegExp=XRegExp||function(e){"use strict";function b(e,n,r){var i;for(i in t.prototype)t.prototype.hasOwnProperty(i)&&(e[i]=t.prototype[i]);return e.xregexp={captureNames:n,isNative:!!r},e}function w(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function E(e,n,r){if(!t.isRegExp(e))throw new TypeError("type RegExp expected");var i=s.replace.call(w(e)+(n||""),p,"");return r&&(i=s.replace.call(i,new RegExp("["+r+"]+","g"),"")),e.xregexp&&!e.xregexp.isNative?e=b(t(e.source,i),e.xregexp.captureNames?e.xregexp.captureNames.slice(0):null):e=b(new RegExp(e.source,i),null,!0),e}function S(e,t){var n=e.length;if(Array.prototype.lastIndexOf)return e.lastIndexOf(t);while(n--)if(e[n]===t)return n;return-1}function x(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object "+t+"]"}function T(e){return e=e||{},e==="all"||e.all?e={natives:!0,extensibility:!0}:x(e,"string")&&(e=t.forEach(e,/[^\s,]+/,function(e){this[e]=!0},{})),e}function N(e,t,n,r){var i=a.length,s=null,u,f;g=!0;try{while(i--){f=a[i];if((f.scope==="all"||f.scope===n)&&(!f.trigger||f.trigger.call(r))){f.pattern.lastIndex=t,u=o.exec.call(f.pattern,e);if(u&&u.index===t){s={output:f.handler.call(r,u,n),match:u};break}}}}catch(l){throw l}finally{g=!1}return s}function C(e){t.addToken=n[e?"on":"off"],i.extensibility=e}function k(e){RegExp.prototype.exec=(e?o:s).exec,RegExp.prototype.test=(e?o:s).test,String.prototype.match=(e?o:s).match,String.prototype.replace=(e?o:s).replace,String.prototype.split=(e?o:s).split,i.natives=e}var t,n,r,i={natives:!1,extensibility:!1},s={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},o={},u={},a=[],f="default",l="class",c={"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]))/},h=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,p=/([\s\S])(?=[\s\S]*\1)/g,d=/^(?:[?*+]|{\d+(?:,\d*)?})\??/,v=s.exec.call(/()??/,"")[1]===e,m=RegExp.prototype.sticky!==e,g=!1,y="gim"+(m?"y":"");return t=function(n,r){if(t.isRegExp(n)){if(r!==e)throw new TypeError("can't supply flags when constructing one RegExp from another");return E(n)}if(g)throw new Error("can't call the XRegExp constructor within token definition functions");var i=[],o=f,u={hasNamedCapture:!1,captureNames:[],hasFlag:function(e){return r.indexOf(e)>-1}},a=0,h,d,v;n=n===e?"":String(n),r=r===e?"":String(r);if(s.match.call(r,p))throw new SyntaxError("invalid duplicate regular expression flag");n=s.replace.call(n,/^\(\?([\w$]+)\)/,function(e,t){if(s.test.call(/[gy]/,t))throw new SyntaxError("can't use flag g or y in mode modifier");return r=s.replace.call(r+t,p,""),""}),t.forEach(r,/[\s\S]/,function(e){if(y.indexOf(e[0])<0)throw new SyntaxError("invalid regular expression flag "+e[0])});while(a<n.length)h=N(n,a,o,u),h?(i.push(h.output),a+=h.match[0].length||1):(d=s.exec.call(c[o],n.slice(a)),d?(i.push(d[0]),a+=d[0].length):(v=n.charAt(a),v==="["?o=l:v==="]"&&(o=f),i.push(v),++a));return b(new RegExp(i.join(""),s.replace.call(r,/[^gimy]+/g,"")),u.hasNamedCapture?u.captureNames:null)},n={on:function(e,t,n){n=n||{},e&&a.push({pattern:E(e,"g"+(m?"y":"")),handler:t,scope:n.scope||f,trigger:n.trigger||null}),n.customFlags&&(y=s.replace.call(y+n.customFlags,p,""))},off:function(){throw new Error("extensibility must be installed before using addToken")}},t.addToken=n.off,t.cache=function(e,n){var r=e+"/"+(n||"");return u[r]||(u[r]=t(e,n))},t.escape=function(e){return s.replace.call(e,/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},t.exec=function(e,t,n,r){var i=E(t,"g"+(r&&m?"y":""),r===!1?"y":""),s;return i.lastIndex=n=n||0,s=o.exec.call(i,e),r&&s&&s.index!==n&&(s=null),t.global&&(t.lastIndex=s?i.lastIndex:0),s},t.forEach=function(e,n,r,i){var s=0,o=-1,u;while(u=t.exec(e,n,s))r.call(i,u,++o,e,n),s=u.index+(u[0].length||1);return i},t.globalize=function(e){return E(e,"g")},t.install=function(e){e=T(e),!i.natives&&e.natives&&k(!0),!i.extensibility&&e.extensibility&&C(!0)},t.isInstalled=function(e){return!!i[e]},t.isRegExp=function(e){return x(e,"regexp")},t.matchChain=function(e,n){return function r(e,i){var s=n[i].regex?n[i]:{regex:n[i]},o=[],u=function(e){o.push(s.backref?e[s.backref]||"":e[0])},a;for(a=0;a<e.length;++a)t.forEach(e[a],s.regex,u);return i===n.length-1||!o.length?o:r(o,i+1)}([e],0)},t.replace=function(n,r,i,s){var u=t.isRegExp(r),a=r,f;return u?(s===e&&r.global&&(s="all"),a=E(r,s==="all"?"g":"",s==="all"?"":"g")):s==="all"&&(a=new RegExp(t.escape(String(r)),"g")),f=o.replace.call(String(n),a,i),u&&r.global&&(r.lastIndex=0),f},t.split=function(e,t,n){return o.split.call(e,t,n)},t.test=function(e,n,r,i){return!!t.exec(e,n,r,i)},t.uninstall=function(e){e=T(e),i.natives&&e.natives&&k(!1),i.extensibility&&e.extensibility&&C(!1)},t.union=function(e,n){var r=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,i=0,s,o,u=function(e,t,n){var r=o[i-s];if(t){++i;if(r)return"(?<"+r+">"}else if(n)return"\\"+(+n+s);return e},a=[],f,l;if(!x(e,"array")||!e.length)throw new TypeError("patterns must be a nonempty array");for(l=0;l<e.length;++l)f=e[l],t.isRegExp(f)?(s=i,o=f.xregexp&&f.xregexp.captureNames||[],a.push(t(f.source).source.replace(r,u))):a.push(t.escape(f));return t(a.join("|"),n)},t.version="2.0.0",o.exec=function(t){var n,r,i,o,u;this.global||(o=this.lastIndex),n=s.exec.apply(this,arguments);if(n){!v&&n.length>1&&S(n,"")>-1&&(i=new RegExp(this.source,s.replace.call(w(this),"g","")),s.replace.call(String(t).slice(n.index),i,function(){var t;for(t=1;t<arguments.length-2;++t)arguments[t]===e&&(n[t]=e)}));if(this.xregexp&&this.xregexp.captureNames)for(u=1;u<n.length;++u)r=this.xregexp.captureNames[u-1],r&&(n[r]=n[u]);this.global&&!n[0].length&&this.lastIndex>n.index&&(this.lastIndex=n.index)}return this.global||(this.lastIndex=o),n},o.test=function(e){return!!o.exec.call(this,e)},o.match=function(e){if(!t.isRegExp(e))e=new RegExp(e);else if(e.global){var n=s.match.apply(this,arguments);return e.lastIndex=0,n}return o.exec.call(e,this)},o.replace=function(e,n){var r=t.isRegExp(e),i,o,u,a;return r?(e.xregexp&&(i=e.xregexp.captureNames),e.global||(a=e.lastIndex)):e+="",x(n,"function")?o=s.replace.call(String(this),e,function(){var t=arguments,s;if(i){t[0]=new String(t[0]);for(s=0;s<i.length;++s)i[s]&&(t[0][i[s]]=t[s+1])}return r&&e.global&&(e.lastIndex=t[t.length-2]+t[0].length),n.apply(null,t)}):(u=String(this),o=s.replace.call(u,e,function(){var e=arguments;return s.replace.call(String(n),h,function(t,n,r){var s;if(n){s=+n;if(s<=e.length-3)return e[s]||"";s=i?S(i,n):-1;if(s<0)throw new SyntaxError("backreference to undefined group "+t);return e[s+1]||""}if(r==="$")return"$";if(r==="&"||+r===0)return e[0];if(r==="`")return e[e.length-1].slice(0,e[e.length-2]);if(r==="'")return e[e.length-1].slice(e[e.length-2]+e[0].length);r=+r;if(!isNaN(r)){if(r>e.length-3)throw new SyntaxError("backreference to undefined group "+t);return e[r]||""}throw new SyntaxError("invalid token "+t)})})),r&&(e.global?e.lastIndex=0:e.lastIndex=a),o},o.split=function(n,r){if(!t.isRegExp(n))return s.split.apply(this,arguments);var i=String(this),o=n.lastIndex,u=[],a=0,f;return r=(r===e?-1:r)>>>0,t.forEach(i,n,function(e){e.index+e[0].length>a&&(u.push(i.slice(a,e.index)),e.length>1&&e.index<i.length&&Array.prototype.push.apply(u,e.slice(1)),f=e[0].length,a=e.index+f)}),a===i.length?(!s.test.call(n,"")||f)&&u.push(""):u.push(i.slice(a)),n.lastIndex=o,u.length>r?u.slice(0,r):u},r=n.on,r(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,function(e,t){if(e[1]==="B"&&t===f)return e[0];throw new SyntaxError("invalid escape "+e[0])},{scope:"all"}),r(/\[(\^?)]/,function(e){return e[1]?"[\\s\\S]":"\\b\\B"}),r(/(?:\(\?#[^)]*\))+/,function(e){return s.test.call(d,e.input.slice(e.index+e[0].length))?"":"(?:)"}),r(/\\k<([\w$]+)>/,function(e){var t=isNaN(e[1])?S(this.captureNames,e[1])+1:+e[1],n=e.index+e[0].length;if(!t||t>this.captureNames.length)throw new SyntaxError("backreference to undefined group "+e[0]);return"\\"+t+(n===e.input.length||isNaN(e.input.charAt(n))?"":"(?:)")}),r(/(?:\s+|#.*)+/,function(e){return s.test.call(d,e.input.slice(e.index+e[0].length))?"":"(?:)"},{trigger:function(){return this.hasFlag("x")},customFlags:"x"}),r(/\./,function(){return"[\\s\\S]"},{trigger:function(){return this.hasFlag("s")},customFlags:"s"}),r(/\(\?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,"("}),r(/\\(\d+)/,function(e,t){if(!(t===f&&/^[1-9]/.test(e[1])&&+e[1]<=this.captureNames.length)&&e[1]!=="0")throw new SyntaxError("can't use octal escape or backreference to undefined group "+e[0]);return e[0]},{scope:"all"}),r(/\((?!\?)/,function(){return this.hasFlag("n")?"(?:":(this.captureNames.push(null),"(")},{customFlags:"n"}),typeof exports!="undefined"&&(exports.XRegExp=t),t}(),function(e){"use strict";function n(e){return e.replace(/[- _]+/g,"").toLowerCase()}function r(e){return e.replace(/\w{4}/g,"\\u$&")}function i(e){while(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 u(t){var n=[],r=-1,u;return e.forEach(t,/\\u(\w{4})(?:-\\u(\w{4}))?/,function(e){u=s(e[1]),u>r+1&&(n.push("\\u"+i(o(r+1))),u>r+2&&n.push("-\\u"+i(o(u-1)))),r=s(e[2]||e[1])}),r<65535&&(n.push("\\u"+i(o(r+1))),r<65534&&n.push("-\\uFFFF")),n.join("")}function a(e){return t["^"+e]||(t["^"+e]=u(t[e]))}var t={};e.install("extensibility"),e.addUnicodePackage=function(i,s){var o;if(!e.isInstalled("extensibility"))throw new Error("extensibility must be installed before adding Unicode packages");if(i)for(o in i)i.hasOwnProperty(o)&&(t[n(o)]=r(i[o]));if(s)for(o in s)s.hasOwnProperty(o)&&(t[n(s[o])]=t[n(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,r){var i=e[1]==="P"||e[2]?"^":"",s=n(e[3]);if(e[1]==="P"&&e[2])throw new SyntaxError("invalid double negation \\P{^");if(!t.hasOwnProperty(s))throw new SyntaxError("invalid or unknown Unicode property "+e[0]);return r==="class"?i?a(s):t[s]:"["+i+t[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,n,r){return{value:e,name:t,start:n,end:r}}e.matchRecursive=function(n,r,i,s,o){s=s||"",o=o||{};var u=s.indexOf("g")>-1,a=s.indexOf("y")>-1,f=s.replace(/y/g,""),l=o.escapeChar,c=o.valueNames,h=[],p=0,d=0,v=0,m=0,g,y,b,w,E;r=e(r,f),i=e(i,f);if(l){if(l.length>1)throw new SyntaxError("can't use more than one escape character");l=e.escape(l),E=new RegExp("(?:"+l+"[\\S\\s]|(?:(?!"+e.union([r,i]).source+")[^"+l+"])+)+",s.replace(/[^im]+/g,""))}for(;;){l&&(v+=(e.exec(n,E,v,"sticky")||[""])[0].length),b=e.exec(n,r,v),w=e.exec(n,i,v),b&&w&&(b.index<=w.index?w=null:b=null);if(b||w)d=(b||w).index,v=d+(b||w)[0].length;else if(!p)break;if(a&&!p&&d>m)break;if(b)p||(g=d,y=v),++p;else{if(!w||!p)throw new Error("string contains unbalanced delimiters");if(!--p){c?(c[0]&&g>m&&h.push(t(c[0],n.slice(m,g),m,g)),c[1]&&h.push(t(c[1],n.slice(g,y),g,y)),c[2]&&h.push(t(c[2],n.slice(y,d),y,d)),c[3]&&h.push(t(c[3],n.slice(d,v),d,v))):h.push(n.slice(y,d)),m=v;if(!u)break}}d===v&&++v}return u&&!a&&c&&c[0]&&n.length>m&&h.push(t(c[0],n.slice(m),m,n.length)),h}}(XRegExp),function(e){"use strict";function r(e){var t=/^(?:\(\?:\))?\^/,n=/\$(?:\(\?:\))?$/;return n.test(e.replace(/\\[\s\S]/g,""))?e.replace(t,"").replace(n,""):e}function i(t){return e.isRegExp(t)?t.xregexp&&!t.xregexp.isNative?t:e(t.source):e(t)}var t=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,n=e.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/,t],"g");e.build=function(s,o,u){var a=/^\(\?([\w$]+)\)/.exec(s),f={},l=0,c,h=0,p=[0],d,v,m;a&&(u=u||"",a[1].replace(/./g,function(e){u+=u.indexOf(e)>-1?"":e}));for(m in o)o.hasOwnProperty(m)&&(v=i(o[m]),f[m]={pattern:r(v.source),names:v.xregexp.captureNames||[]});return s=i(s),d=s.xregexp.captureNames||[],s=s.source.replace(n,function(e,n,r,i,s){var o=n||r,u,a;if(o){if(!f.hasOwnProperty(o))throw new ReferenceError("undefined property "+e);return n?(u=d[h],p[++h]=++l,a="(?<"+(u||o)+">"):a="(?:",c=l,a+f[o].pattern.replace(t,function(e,t,n){if(t){u=f[o].names[l-c],++l;if(u)return"(?<"+u+">"}else if(n)return"\\"+(+n+c);return e})+")"}if(i){u=d[h],p[++h]=++l;if(u)return"(?<"+u+">"}else if(s)return"\\"+p[+s];return e}),e(s,u)}}(XRegExp),function(e){"use strict";function t(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}t(e.prototype,{apply:function(e,t){return this.test(t[0])},call:function(e,t){return this.test(t)},forEach:function(t,n,r){return e.forEach(t,this,n,r)},globalize:function(){return e.globalize(this)},xexec:function(t,n,r){return e.exec(t,this,n,r)},xtest:function(t,n,r){return e.test(t,this,n,r)}})}(XRegExp),define("xregexp",function(e){return function(){var t,n;return t||e.XRegExp}}(this)),String.prototype.score=function(e,t){if(this==e)return 1;if(e=="")return 0;var n=0,r,i,s=this,o=s.toLowerCase(),u=s.length,a=e.toLowerCase(),f=e.length,l,c=0,h=1,p;t&&(p=1-t);if(t)for(var d=0;d<f;++d){l=o.indexOf(a[d],c);if(-1===l){h+=p;continue}c===l?r=.7:(r=.1,s[l-1]===" "&&(r+=.8)),s[l]===e[d]&&(r+=.1),n+=r,c=l+1}else for(var d=0;d<f;++d){l=o.indexOf(a[d],c);if(-1===l)return 0;c===l?r=.7:(r=.1,s[l-1]===" "&&(r+=.8)),s[l]===e[d]&&(r+=.1),n+=r,c=l+1}return i=.5*(n/u+n/f)/h,a[0]===o[0]&&i<.85&&(i+=.15),i},define("libs/string_score",function(){}),define("unifi/model/Model",["underscore","backbone","jquery","xregexp","libs/string_score"],function(e,t,n,r){"use strict";return t.Model.prototype.search=function(t,r,i){var s=this.toSearch?this.toSearch():this.toJSON(),o=0,u=!1,a=this.getSearchStrings();a&&(s=e.extend(s,a));var f=s[r]||this.get(r);!f&&typeof this[r]=="function"&&(f=this[r]()),r&&(s={x:f});if(e.size(s)>0){var l=e.map(e.isArray(t)?t:[t],function(e){return n.trim(e)});e.each(s,function(t){if(e.isArray(t)||e.isObject(t))t=JSON.stringify(t);if(e.isNumber(t)||e.isBoolean(t))t=t.toString();if(e.isString(t)){if(u&&!String.prototype.score)throw"Missing String.prototype.score";e.each(l,function(e){i?u?o+=t.score(e):o+=t.search(new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"i"))>=0?1:0:u?o=Math.max(o,t.score(e)):o=Math.max(o,t.search(new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"i"))>=0?1:0)})}},this)}return o},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 t[0]*16777216+t[1]*65536+t[2]*256+t[3]*1}},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&&t.length==2&&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("/"),n=e.substring(0,t),r=parseInt(e.substring(t+1),10);return this.ip(n)&&r<=32}},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,n){return this.digits(e)&&e<=n&&e>=t},rangeList:function(t,n,r,i,s){var o=!0,u=new RegExp("["+n+"]+","g"),a=t.replace(/[,]+/g,",").split(u),f=t.match(/\d*-\d*/g);return a.length>r&&(o=!1),e.each(a,function(e){this.range(e,i,s)||(o=!1)},this),e.each(f,function(e){var t=e.split("-");1*t[0]>=1*t[1]&&(o=!1)},this),o},length_limit:function(e,t){return e.length===undefined||e.length<=t},netmask:function(e,t){if(e&&e.match(this._regex.netmask)){e=this._ip2long(e),t=this._ip2long(t);if(t^t&e)return!0}},name:function(e){var t=new r("^[\\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 r("^\\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 n=e.clone(this.attributes);return t&&t.exclude&&e.each(t.exclude,function(e){delete n[e]}),n},set:function(r,i,s){return typeof r=="object"&&(s=i),e.isObject(s)&&s.fetched&&this.fetchWithUnset&&e.each(e.keys(this.attributes),n.proxy(function(t){e.isUndefined(r[t])&&e.indexOf(this.ignoreUnset,t)===-1&&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.6.6/images/default-message-avatar.jpg"),this.set("avatar_url","/lib/4.6.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){if(t&&t.xhr&&t.xhr.status!==200)return;return this.set("linked",!0),e.data[0]}})}),define("unifi/model/AdminPref",["backbone","underscore"],function(e,t){"use strict";return e.Model.extend({sync:function(t,n,r){r=r||{};switch(t){case"update":r.url="/api/self",r.type="PUT",r.data=JSON.stringify({last_site_name:r.last_site_name})}return e.sync.call(this,t,n,r)}})}),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,n,r,i){e.GoogleAnalyticsObject=n,e[n]||(e[n]=function(){(e[n].q=e[n].q||[]).push(arguments)}),e[n].l=+(new Date),r=t.createElement("script"),i=t.scripts[0],r.src="//www.google-analytics.com/analytics.js",i.parentNode.insertBefore(r,i)}(window,document,"ga"),window.ga("create",e),this.account=e)},trackEvent:function(e,t,n){this.enabled&&(window.ga("send","event",e,t,n),this.log({category:"event",action:e,label:t,value:n}))},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,n,r,i,s,o=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],u=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,f=typeof location!="undefined"&&location.href,l=f&&location.protocol&&location.protocol.replace(/\:/,""),c=f&&location.hostname,h=f&&(location.port||undefined),p={},d=e.config&&e.config()||{};t={version:"2.0.10",strip:function(e){if(e){e=e.replace(u,"");var t=e.match(a);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:d.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=o[t];try{e=new ActiveXObject(n)}catch(r){}if(e){o=[n];break}}return e},parseName:function(e){var t,n,r,i=!1,s=e.indexOf("."),o=e.indexOf("./")===0||e.indexOf("../")===0;return s!==-1&&(!o||s>1)?(t=e.substring(0,s),n=e.substring(s+1,e.length)):t=e,r=n||t,s=r.indexOf("!"),s!==-1&&(i=r.substring(s+1)==="strip",r=r.substring(0,s),n?n=r:t=r),{moduleName:t,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||u===i)):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,d.isBuild&&(p[e]=r),i(r)},load:function(e,n,r,i){if(i.isBuild&&!i.inlineText){r();return}d.isBuild=i.isBuild;var s=t.parseName(e),o=s.moduleName+(s.ext?"."+s.ext:""),u=n.toUrl(o),a=d.useXhr||t.useXhr;if(u.indexOf("empty:")===0){r();return}!f||a(u,l,c,h)?t.get(u,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([o],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(p.hasOwnProperty(n)){var s=t.jsEscape(p[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.ext?"."+o.ext:"",a=o.moduleName+u,f=r.toUrl(o.moduleName+u)+".js";t.load(a,r,function(n){var r=function(e){return i(f,e)};r.asModule=function(e,t){return i.asModule(e,f,t)},t.write(e,a,r,s)},s)}};if(d.env==="node"||!d.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node&&!process.versions["node-webkit"])n=require.nodeRequire("fs"),t.get=function(e,t,r){try{var i=n.readFileSync(e,"utf8");i.indexOf("﻿")===0&&(i=i.substring(1)),t(i)}catch(s){r(s)}};else if(d.env==="xhr"||!d.env&&t.createXhr())t.get=function(e,n,r,i){var s=t.createXhr(),o;s.open("GET",e,!0);if(i)for(o in i)i.hasOwnProperty(o)&&s.setRequestHeader(o.toLowerCase(),i[o]);d.onXhr&&d.onXhr(s,e),s.onreadystatechange=function(t){var i,o;s.readyState===4&&(i=s.status,i>399&&i<600?(o=new Error(e+" HTTP status: "+i),o.xhr=s,r(o)):n(s.responseText),d.onXhrComplete&&d.onXhrComplete(s,e))},s.send(null)};else if(d.env==="rhino"||!d.env&&typeof Packages!="undefined"&&typeof java!="undefined")t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),r!==null&&n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};else if(d.env==="xpconnect"||!d.env&&typeof Components!="undefined"&&Components.classes&&Components.interfaces)r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),s="@mozilla.org/windows-registry-key;1"in r,t.get=function(e,t){var n,o,u,a={};s&&(e=e.replace(/\//g,"\\")),u=new FileUtils.File(e);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(u,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),a),o.close(),n.close(),t(a.value)}catch(f){throw new Error((u&&u.path||"")+": "+f)}};return 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="600">10 <%- 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.6.6/images/default-message-avatar.jpg" data-ret="/lib/4.6.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.6.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.6.6/images/default-profile-avatar.jpg" data-ret="/lib/4.6.6/images/default-profile-avatar@2x.jpg" class="retina" />\n            <noscript>\n                <img src="/lib/4.6.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,n,r,i){"use strict";return e.View.extend({initialize:function(){var e=this;t.bindAll(e),e.isRendered=!1,e.template=t.template(i)},render:function(){var e=this;e.isRendered||(e.isRendered=!0,e.el=e.template({}),e.$el=r(e.el).dialog({title:n.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;t.isRendered||t.render();switch(typeof e){case"string":t.$message.text(e);break;case"object":e.msg?n.ErrorRenderer[e.msg]?t.$message.text(n.ErrorRenderer[e.msg](e)):t.$message.text(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,n,r,i){"use strict";return e.View.extend({initialize:function(){t.bindAll(this),this.isRendered=!1,this.template=t.template(i)},buttons:function(){return{Close:r.proxy(function(){this.$el.dialog("close")},this)}},render:function(){!this.rendered&&(this.rendered=!0)&&(this.el=this.template(),this.$el=r(this.el).dialog(t.extend({title:n.E_Alert,autoOpen:!0,width:300,buttons:this.buttons(),resizable:!1,modal:!0},this.options)),this.$message=this.$el.find(".message"))},open:function(e){this.rendered||this.render();switch(typeof e){case"string":this.$message.text(e);break;case"object":e.msg?n.ErrorRenderer[e.msg]?this.$message.text(n.ErrorRenderer[e.msg](e)):this.$message.text(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,n,r,i){"use strict";return e.View.extend({initialize:function(e){var n=this;t.bindAll(n),n.isRendered=!1,n.buttons=e.buttons,n.template=t.template(i)},render:function(){var e=this;e.isRendered||(e.isRendered=!0,e.el=e.template({}),e.$el=r(e.el).dialog({title:n.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(n.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,n){function i(e){return e}function s(e){return o(decodeURIComponent(e.replace(r," ")))}function o(e){return e.indexOf('"')===0&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")),e}function u(e){return a.json?JSON.parse(e):e}var r=/\+/g,a=e.cookie=function(r,o,f){if(o!==n){f=e.extend({},a.defaults,f),o===null&&(f.expires=-1);if(typeof f.expires=="number"){var l=f.expires,c=f.expires=new Date;c.setDate(c.getDate()+l)}return o=a.json?JSON.stringify(o):String(o),t.cookie=[encodeURIComponent(r),"=",a.raw?o:encodeURIComponent(o),f.expires?"; expires="+f.expires.toUTCString():"",f.path?"; path="+f.path:"",f.domain?"; domain="+f.domain:"",f.secure?"; secure":""].join("")}var h=a.raw?i:s,p=t.cookie.split("; "),d=r?null:{};for(var v=0,m=p.length;v<m;v++){var g=p[v].split("="),y=h(g.shift()),b=h(g.join("="));if(r&&r===y){d=u(b);break}r||(d[y]=u(b))}return d};a.defaults={},e.removeCookie=function(t,n){return e.cookie(t)!==null?(e.cookie(t,null,n),!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,n,r,i,s,o,u,a,f,l){"use strict";function h(){return"/"+(CONFIG.site==="Admin"?"manage":"hotspot")+"/s/"+SITE.name+"/"}function p(){n.delay(function(){e("#ChangePassword").click()},1e3)}var c={};return c.initialize=function(t,o,a){var f=this;this.routers={},this.views={},this.data={},this.adminPref=new s,this.collections=o,e.cookie.defaults.path="/",e(document).ajaxSend(function(t,n,r){r.type=="POST"&&n.setRequestHeader("X-Csrf-Token",e.cookie("csrf_token"))}),this.cloudUser=new i,this.cloudUser.fetch().done(function(){f.cloudUserCallback(),f.views.app=new a({config:CONFIG,app:f,cloudUser:f.cloudUser}),e("#header").html(n.template(u,{msg:r})),CONFIG.site==="Operator"&&(e("#header").find("fieldset.left").remove(),e("body").addClass("isHotspot")),n.each(t,function(e,t){var n=t[0].toLowerCase()+t.substr(1);f.routers[n]=new e({app:f}),f.routers[n].on("route",function(e){f.views.app.navigate(n)})},f),e(document).ajaxError(f.ajaxError),f.suppressAjaxErrors=0,e(document).tooltip({show:!1,hide:!1,track:!0}),f.preload(f.collections)}).error(function(){window.location.href=(CONFIG.site==="Admin"?"":"/hotspot")+"/logout"})},c.cloudUserCallback=function(){var t=this,n=this.cloudUser;window.SITE={id:n.get("site_id"),name:n.get("site_name")},window.USER={id:n.get("admin_id"),role:n.get("site_role"),"super":n.get("is_super"),is_local:n.get("is_local")},n.get("site_role")==="admin"&&n.get("is_super")===!0?(e.Body.addClass("isSuper"),t.isSuper=!0):(e.Body.removeClass("isSuper"),t.isSuper=!1),n.get("site_role")==="readonly"?(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)),n.get("is_local")?(e.Body.addClass("isLocalUser"),t.isLocalUser=!0):(e.Body.removeClass("isLocalUser"),t.isLocalUser=!1),n.get("requires_new_password")?(e.Body.addClass("passwordChangeRequired"),p()):e.Body.removeClass("passwordChangeRequired")},c.ignore_enter_keypress=function(e){if(e.keyCode==13)return e.preventDefault(),!1},c.preload=function(t){var r=[],i={};n.each(t,function(t,n){r.push(i[n]=e.Deferred())},this),e.when.apply(e,r).then(function(){c.render()},function(){c.fatal()}),n.each(t,function(e,t){this.collection(t,{fetch:{reload:!1,deferred:i[t]}},e)},this)},c.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:h()})}catch(n){t.history.root=h();var r=e("#navigation");c.updatePushStateUrls(r.find("a").not("a[data-page=settings]"))}var i=t.history.fragment||CONFIG.start;t.history.loadUrl(""),this.routers[i.split("/")[0]].navigate(i,{replace:!1,trigger:!0})},c.refresh=function(t){c.lostConnectionDialog&&c.lostConnectionDialog.$el.is(":visible")&&c.lostConnectionDialog.hide();if(!this._refreshing&&(this._refreshing=!0)){var r=[],i={},s=this,o=this.views.app;o.refreshing(),n.each(this.data,function(t,n){r.push(i[n]=e.Deferred())}),e.when.apply(e,r).then(function(){s._refreshing=!1,o.refreshing(!0)},function(){s._refreshing=!1,o.refreshing(!1)}),n.each(this.data,function(e,t){s.collection(t,{fetch:{reload:!0,method:"reload",deferred:i[t]}})},this)}},c.changeSite=function(e,i){try{var s=e?this.collection("Sites").get(e):this.collection("Sites").first();if(!s||!s.id)throw r.E_ChangeSite;SITE={id:s.id,name:s.get("name"),route:i||t.history.fragment},this.adminPref.sync("update",this.adminPref,{last_site_name:SITE.name}),this.views.app.reset(),n.each(this.routers,function(e,t){e.reset&&e.reset()},this),n.each(this.data,function(e,t){var n=e.collection;n.bySite&&(n.reset(),delete this.data[t])},this);var o=this;this.cloudUser.url="/api/s/"+s.get("name")+"/self",this.cloudUser.fetch().done(function(){o.cloudUserCallback(),o.preload(o.collections),o.views.app.cloudUser=o.cloudUser})}catch(u){this.views.app.flash("error","Error",u);return}},c.collection=function(e,t,r){t=t||{},t.init=t.init||{},t.fetch=t.fetch||{};if(n.isUndefined(this.data[e]))try{n.isObject(r)||(r=require("unifi/collection/"+e)),this.data[e]={collection:new r(t.init.models,t.init.options),state:null,deferred:[]}}catch(i){throw t.fetch&&t.fetch.deferred&&t.fetch.deferred.reject(),"Invalid collection: "+e}var s=this.data[e];return n.size(t.fetch)&&(t.fetch.deferred&&s.deferred.push(t.fetch.deferred),s.state!="fetching"&&(!s.state||t.fetch.reload?(s.state="fetching",s.collection[t.fetch.method||"fetch"](n.extend(t.fetch.options||{},{success:function(){s.state="fetched",s.deferred&&n.each(s.deferred,function(e,t){e.state()=="pending"&&(e.resolve(arguments),delete s.deferred[t])})},error:function(){s.state="fetched",s.deferred&&n.each(s.deferred,function(e,t){e.state()=="pending"&&(e.reject(arguments),delete s.deferred[t])})}}))):s.deferred&&n.each(s.deferred,function(e,t){e.state()=="pending"&&(e.resolve(),delete s.deferred[t])}))),s.collection},c.fatal=function(){this.views.app?this.views.app.flash("error","Fatal Error",r.E_Fatal,!0):(new a).open(r.E_Fatal)},c.ajaxError=function(e,t,i,s){if(c.suppressAjaxErrors)return;t.status===401||t.status===403?(c.lostConnectionDialog&&c.lostConnectionDialog.$el.is(":visible")&&c.lostConnectionDialog.hide(),c.alertDialog||(c.alertDialog=new f),c.alertDialog.$el.is(":visible")||(c.alertDialog.open(r.E_SessionExpired),n.delay(function(){document.location="/"},2e3))):t.readyState===0&&t.status===0&&t.statusText==="error"&&(c.lostConnectionDialog||(c.lostConnectionDialog=new l({buttons:{"Try Again":function(){c.refresh(!0)}}})),c.lostConnectionDialog.$el.is(":visible")||c.lostConnectionDialog.show())},c.ajaxErrorOff=function(){c.suppressAjaxErrors++},c.ajaxErrorOn=function(){c.suppressAjaxErrors>0&&c.suppressAjaxErrors--},c.updatePushStateUrls=function(n){n.each(function(){var n=e(this),r=n.data("page"),i=(t.history.root||h())+r.toLowerCase();n.attr("href",i)})},window.googleMapsNotLoaded=function(){e(".google-map-container").html('<div class="googleMapsError">'+r.E_GoogleMapsNotLoaded+"</div>")},c});var libFuncName=null;if(typeof jQuery=="undefined"&&typeof Zepto=="undefined"&&typeof $=="function")libFuncName=$;else if(typeof jQuery=="function")libFuncName=jQuery;else{if(typeof Zepto!="function")throw new TypeError;libFuncName=Zepto}(function(e){(function(){Array.prototype.filter||(Array.prototype.filter=function(e){"use strict";if(this==null)throw new TypeError;var t=Object(this),n=t.length>>>0;if(typeof e!="function")try{throw new TypeError}catch(r){return}var i=[],s=arguments[1];for(var o=0;o<n;o++)if(o in t){var u=t[o];e&&e.call(s,u,o,t)&&i.push(u)}return i},Function.prototype.bind||(Function.prototype.bind=function(e){if(typeof this!="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,i.prototype=new r,i})),e.fn.stop=e.fn.stop||function(){return this}})(),function(t,n,r){"use strict";t.Foundation={name:"Foundation",version:"4.0.8",cache:{},init:function(e,t,n,r,i,s){var o,u=[e,n,r,i],a=[],s=s||!1;s&&(this.nc=s),this.scope=e||this.scope;if(t&&typeof t=="string"){if(/off/i.test(t))return this.off();o=t.split(" ");if(o.length>0)for(var f=o.length-1;f>=0;f--)a.push(this.init_lib(o[f],u))}else for(var l in this.libs)a.push(this.init_lib(l,u));return typeof t=="function"&&u.unshift(t),this.response_obj(a,u)},response_obj:function(e,t){for(var n in t)if(typeof t[n]=="function")return t[n]({errors:e.filter(function(e){if(typeof e=="string")return e})});return e},init_lib:function(e,t){return this.trap(function(){if(this.libs.hasOwnProperty(e))return this.patch(this.libs[e]),this.libs[e].init.apply(this.libs[e],t)}.bind(this),e)},trap:function(e,t){if(!this.nc)try{return e()}catch(n){return this.error({name:t,message:"could not be initialized",more:n.name+" "+n.message})}return e()},patch:function(e){this.fix_outer(e)},inherit:function(e,t){var n=t.split(" ");for(var r=n.length-1;r>=0;r--)this.lib_methods.hasOwnProperty(n[r])&&(this.libs[e.name][n[r]]=this.lib_methods[n[r]])},random_str:function(e){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split("");e||(e=Math.floor(Math.random()*t.length));var n="";for(var r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n},libs:{},lib_methods:{set_data:function(e,t){var n=[this.name,+(new Date),Foundation.random_str(5)].join("-");return Foundation.cache[n]=t,e.attr("data-"+this.name+"-id",n),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 n=null;return function(){var r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){e.apply(r,i)},t)}},data_options:function(t){function u(e){return!isNaN(e-0)&&e!==null&&e!==""&&e!==!1&&e!==!0}function a(t){return typeof t=="string"?e.trim(t):t}var n={},r,i,s=(t.attr("data-options")||":").split(";"),o=s.length;for(r=o-1;r>=0;r--)i=s[r].split(":"),/true/i.test(i[1])&&(i[1]=!0),/false/i.test(i[1])&&(i[1]=!1),u(i[1])&&(i[1]=parseInt(i[1],10)),i.length===2&&i[0].length>0&&(n[a(i[0])]=a(i[1]));return n},delay:function(e,t){return setTimeout(e,t)},scrollTo:function(n,r,i){if(i<0)return;var s=r-e(t).scrollTop(),o=s/i*10;this.scrollToTimerCache=setTimeout(function(){isNaN(parseInt(o,10))||(t.scrollTo(0,e(t).scrollTop()+o),this.scrollTo(n,r,i-10))}.bind(this),10)},scrollLeft:function(e){if(!e.length)return;return"scrollLeft"in e[0]?e[0].scrollLeft:e[0].pageXOffset},empty:function(e){if(e.length&&e.length>0)return!1;if(e.length&&e.length===0)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 typeof Zepto=="function"?e.height():typeof t!="undefined"?e.outerHeight(t):e.outerHeight()},e.outerWidth=function(e){return typeof Zepto=="function"?e.width():typeof bool!="undefined"?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,n,r){"use strict";return n.Collection.prototype.searchModel=function(e,n){var r=!1;return e._searchScore=0,t.each(n,function(t){var n=e.search(t.term,t.property);t.negate===!0&&(n=n===0?1:0),n>=(t.minimum||0)?e._searchScore+=n:t.required&&(r=!0)}),e._searchScore&&!r},n.Collection.prototype.search=function(e){var t=new this.constructor,n=[];return t.comparator=function(e){return-1*e._searchScore},this.each(function(t){this.searchModel(t,e)&&n.push(t)},this),t.add(n),t},n.Collection.prototype.deferredSearch=function(n){var r=new this.constructor,i=[],s=e.Deferred(),o=this.searchModel;r.comparator=function(e){return-1*e._searchScore};var u=function(e,a,f){for(var l=f*a,c=Math.min(l+a,e.length);l<c;l++)o(e[l],n)&&i.push(e[l]);l<e.length?t.defer(u,e,a,++f):(r.add(i),s.resolve(r))};return u(this.models,500,0),s.promise()},n.Collection.extend({model:r,bySite:!1,triggerReset:!0,lastFetch:{},initialize:function(){this.triggerReset&&this.on("reset",function(e,n){t.each(n.previousModels,function(e){e.trigger("remove")})})},fetch:function(e){return this.lastFetch=t.omit(e,["success","error","complete"]),n.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,n,r){"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=n("<"+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(){n(this).trigger("content:hide")}}),this.$el.show({easing:null,duration:0,complete:function(){n(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,n,r){"use strict";function a(e){return String.fromCharCode(e.charCodeAt(0)-32)+e.slice(1)}function f(e,t,n){var r=t-(e+"").length;r=r<0?0:r;var i="";for(var s=0;s<r;s++)i+=n;return i+e}var i=e,s="	\n\f\r   ᠎             　\u2028\u2029﻿";if(!String.prototype.trim||s.trim()){s="["+s+"]";var o=new RegExp("^"+s+s+"*"),u=new RegExp(s+s+"*$");String.prototype.trim=function(){if(this===undefined||this===null)throw new TypeError("can't convert "+this+" to object");return String(this).replace(o,"").replace(u,"")}}var l=e.Backgrid={VERSION:"0.2.6",Extension:{},requireOptions:function(e,t){for(var r=0;r<t.length;r++){var i=t[r];if(n.isUndefined(e[i]))throw new TypeError("'"+i+"' is required")}},resolveNameToClass:function(e,t){if(n.isString(e)){var r=n.map(e.split("-"),function(e){return a(e)}).join("")+t,i=l[r]||l.Extension[r];if(n.isUndefined(i))throw new ReferenceError("Class '"+r+"' not found");return i}return e}};n.extend(l,r.Events);var c=l.Command=function(e){n.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})};n.extend(c.prototype,{moveUp:function(){return this.keyCode==38},moveDown:function(){return this.keyCode===40},moveLeft:function(){return this.shiftKey&&this.keyCode===9},moveRight:function(){return!this.shiftKey&&this.keyCode===9},save:function(){return this.keyCode===13},cancel:function(){return this.keyCode===27},passThru:function(){return!(this.moveUp()||this.moveDown()||this.moveLeft()||this.moveRight()||this.save()||this.cancel())}});var h=l.CellFormatter=function(){};n.extend(h.prototype,{fromRaw:function(e){return e},toRaw:function(e){return e}});var p=l.NumberFormatter=function(e){e=e?n.clone(e):{},n.extend(this,this.defaults,e);if(this.decimals<0||this.decimals>20)throw new RangeError("decimals must be between 0 and 20")};p.prototype=new h,n.extend(p.prototype,{defaults:{decimals:2,decimalSeparator:".",orderSeparator:","},HUMANIZED_NUM_RE:/(\d)(?=(?:\d{3})+$)/g,fromRaw:function(e){if(n.isNull(e)||n.isUndefined(e))return"";e=e.toFixed(~~this.decimals);var t=e.split("."),r=t[0],i=t[1]?(this.decimalSeparator||".")+t[1]:"";return r.replace(this.HUMANIZED_NUM_RE,"$1"+this.orderSeparator)+i},toRaw:function(e){var t="",r=e.trim().split(this.orderSeparator);for(var i=0;i<r.length;i++)t+=r[i];var s=t.split(this.decimalSeparator);t="";for(var i=0;i<s.length;i++)t=t+s[i]+".";t[t.length-1]==="."&&(t=t.slice(0,t.length-1));var o=(t*1).toFixed(~~this.decimals)*1;if(n.isNumber(o)&&!n.isNaN(o))return o}});var d=l.DatetimeFormatter=function(e){e=e?n.clone(e):{},n.extend(this,this.defaults,e);if(!this.includeDate&&!this.includeTime)throw new Error("Either includeDate or includeTime must be true")};d.prototype=new h,n.extend(d.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 r,i=null;if(n.isNumber(e)){var s=new Date(e);r=f(s.getUTCFullYear(),4,0)+"-"+f(s.getUTCMonth()+1,2,0)+"-"+f(s.getUTCDate(),2,0),i=f(s.getUTCHours(),2,0)+":"+f(s.getUTCMinutes(),2,0)+":"+f(s.getUTCSeconds(),2,0)}else{e=e.trim();var o=e.split(this.ISO_SPLITTER_RE)||[];r=this.DATE_RE.test(o[0])?o[0]:"",i=r&&o[1]?o[1]:this.TIME_RE.test(o[0])?o[0]:""}var u=this.DATE_RE.exec(r)||[],a=this.TIME_RE.exec(i)||[];if(t){if(this.includeDate&&n.isUndefined(u[0]))return;if(this.includeTime&&n.isUndefined(a[0]))return;if(!this.includeDate&&r)return;if(!this.includeTime&&i)return}var s=new Date(Date.UTC(u[1]*1||0,u[2]*1-1||0,u[3]*1||0,a[1]*1||null,a[2]*1||null,a[3]*1||null,a[5]*1||null)),l="";return this.includeDate&&(l=f(s.getUTCFullYear(),4,0)+"-"+f(s.getUTCMonth()+1,2,0)+"-"+f(s.getUTCDate(),2,0)),this.includeTime&&(l=l+(this.includeDate?"T":"")+f(s.getUTCHours(),2,0)+":"+f(s.getUTCMinutes(),2,0)+":"+f(s.getUTCSeconds(),2,0),this.includeMilli&&(l=l+"."+f(s.getUTCMilliseconds(),3,0))),this.includeDate&&this.includeTime&&(l+="Z"),l},fromRaw:function(e){return n.isNull(e)||n.isUndefined(e)?"":this._convert(e)},toRaw:function(e){return this._convert(e,!0)}});var v=l.StringFormatter=function(){};v.prototype=new h,n.extend(v.prototype,{fromRaw:function(e){return n.isUndefined(e)||n.isNull(e)?"":e+""}});var m=l.EmailFormatter=function(){};m.prototype=new h,n.extend(m.prototype,{toRaw:function(e){var t=e.trim().split("@");if(t.length===2&&n.all(t))return e}});var g=l.SelectFormatter=function(){};g.prototype=new h,n.extend(g.prototype,{fromRaw:function(e){return n.isArray(e)?e:e!=null?[e]:[]}});var y=l.CellEditor=r.View.extend({initialize:function(e){l.requireOptions(e,["formatter","column","model"]),this.formatter=e.formatter,this.column=e.column,this.column instanceof D||(this.column=new D(this.column)),this.listenTo(this.model,"backgrid:editing",this.postRender)},postRender:function(e,t){return(t==null||t.get("name")==this.column.get("name"))&&this.$el.focus(),this}}),b=l.InputCellEditor=y.extend({tagName:"input",attributes:{type:"text"},events:{blur:"saveOrCancel",keydown:"saveOrCancel"},initialize:function(e){y.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,r=this.model,i=this.column,s=new c(e),o=e.type==="blur";if(s.moveUp()||s.moveDown()||s.moveLeft()||s.moveRight()||s.save()||o){e.preventDefault(),e.stopPropagation();var u=this.$el.val(),a=t.toRaw(u);n.isUndefined(a)?r.trigger("backgrid:error",r,i,u):(r.set(i.get("name"),a),r.trigger("backgrid:edited",r,i,s))}else s.cancel()&&(e.stopPropagation(),r.trigger("backgrid:edited",r,i,s))},postRender:function(e,t){if(t==null||t.get("name")==this.column.get("name"))if(this.$el.css("text-align")==="right"){var n=this.$el.val();this.$el.focus().val(null).val(n)}else this.$el.focus();return this}}),w=l.Cell=r.View.extend({tagName:"td",formatter:new h,editor:b,events:{click:"enterEditMode"},initialize:function(e){l.requireOptions(e,["model","column"]),this.column=e.column,this.column instanceof D||(this.column=new D(this.column)),this.formatter=l.resolveNameToClass(this.column.get("formatter")||this.formatter,"Formatter"),this.editor=l.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){(t==null||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),r.View.prototype.remove.apply(this,arguments)}}),E=l.StringCell=w.extend({className:"string-cell",formatter:new v}),S=l.UriCell=w.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}}),x=l.EmailCell=E.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}}),T=l.NumberCell=w.extend({className:"number-cell",decimals:p.prototype.defaults.decimals,decimalSeparator:p.prototype.defaults.decimalSeparator,orderSeparator:p.prototype.defaults.orderSeparator,formatter:p,initialize:function(e){w.prototype.initialize.apply(this,arguments),this.formatter=new this.formatter({decimals:this.decimals,decimalSeparator:this.decimalSeparator,orderSeparator:this.orderSeparator})}}),N=l.IntegerCell=T.extend({className:"integer-cell",decimals:0}),C=l.DatetimeCell=w.extend({className:"datetime-cell",includeDate:d.prototype.defaults.includeDate,includeTime:d.prototype.defaults.includeTime,includeMilli:d.prototype.defaults.includeMilli,formatter:d,initialize:function(e){w.prototype.initialize.apply(this,arguments),this.formatter=new this.formatter({includeDate:this.includeDate,includeTime:this.includeTime,includeMilli:this.includeMilli});var t=this.includeDate?"YYYY-MM-DD":"";t+=this.includeDate&&this.includeTime?"T":"",t+=this.includeTime?"HH:mm:ss":"",t+=this.includeTime&&this.includeMilli?".SSS":"",this.editor=this.editor.extend({attributes:n.extend({},this.editor.prototype.attributes,this.editor.attributes,{placeholder:t})})}}),k=l.DateCell=C.extend({className:"date-cell",includeTime:!1}),L=l.TimeCell=C.extend({className:"time-cell",includeDate:!1}),A=l.BooleanCellEditor=y.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,n=this.column,r=this.formatter,i=new c(e);if(i.passThru()&&e.type!="change")return!0;i.cancel()&&(e.stopPropagation(),t.trigger("backgrid:edited",t,n,i));var s=this.$el;if(i.save()||i.moveLeft()||i.moveRight()||i.moveUp()||i.moveDown()){e.preventDefault(),e.stopPropagation();var o=r.toRaw(s.prop("checked"));t.set(n.get("name"),o),t.trigger("backgrid:edited",t,n,i)}else if(e.type=="change"){var o=r.toRaw(s.prop("checked"));t.set(n.get("name"),o),s.focus()}}}),O=l.BooleanCell=w.extend({className:"boolean-cell",editor:A,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}}),M=l.SelectCellEditor=y.extend({tagName:"select",events:{change:"save",blur:"close",keydown:"close"},template:n.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){var n="";for(var r=0;r<e.length;r++)n+=this.template({text:e[r][0],value:e[r][1],selected:t.indexOf(e[r][1])>-1});return n},render:function(){this.$el.empty();var e=n.result(this,"optionValues"),r=this.formatter.fromRaw(this.model.get(this.column.get("name")));if(!n.isArray(e))throw TypeError("optionValues must be an array");var i=null,s=null,i=null,o=null,u=null;for(var a=0;a<e.length;a++){var i=e[a];if(n.isArray(i))s=i[0],i=i[1],this.$el.append(this.template({text:s,value:i,selected:r.indexOf(i)>-1}));else{if(!n.isObject(i))throw TypeError("optionValues elements must be a name-value pair or an object hash of { name: 'optgroup label', value: [option name-value pairs] }");o=i.name,u=t("<optgroup></optgroup>",{label:o}),u.append(this._renderOptions(i.values,r)),this.$el.append(u)}}return this.delegateEvents(),this},save:function(e){var t=this.model,n=this.column;t.set(n.get("name"),this.formatter.toRaw(this.$el.val())),t.trigger("backgrid:edited",t,n,new c(e))},close:function(e){var t=this.model,n=this.column,r=new c(e);if(r.cancel())e.stopPropagation(),t.trigger("backgrid:edited",t,n,new c(e));else if(r.save()||r.moveLeft()||r.moveRight()||r.moveUp()||r.moveDown()||e.type=="blur")e.preventDefault(),e.stopPropagation(),e.type=="blur"&&this.$el.find("option").length===1&&t.set(n.get("name"),this.formatter.toRaw(this.$el.val())),t.trigger("backgrid:edited",t,n,new c(e))}}),_=l.SelectCell=w.extend({className:"select-cell",editor:M,multiple:!1,formatter:new g,optionValues:undefined,delimiter:", ",initialize:function(e){w.prototype.initialize.apply(this,arguments),l.requireOptions(this,["optionValues"]),this.listenTo(this.model,"backgrid:edit",function(e,t,n,r){t.get("name")==this.column.get("name")&&(r.setOptionValues(this.optionValues),r.setMultiple(this.multiple))})},render:function(){this.$el.empty();var e=this.optionValues,t=this.formatter.fromRaw(this.model.get(this.column.get("name"))),r=[];try{if(!n.isArray(e)||n.isEmpty(e))throw new TypeError;for(var i=0;i<t.length;i++){var s=t[i];for(var o=0;o<e.length;o++){var u=e[o];if(n.isArray(u)){var a=u[0],u=u[1];u==s&&r.push(a)}else{if(!n.isObject(u))throw new TypeError;var f=u.values;for(var l=0;l<f.length;l++){var c=f[l];c[1]==s&&r.push(c[0])}}}}this.$el.append(r.join(this.delimiter))}catch(h){throw h instanceof TypeError?TypeError("'optionValues' must be of type {Array.<Array>|Array.<{name: string, values: Array.<Array>}>}"):h}return this.delegateEvents(),this}}),D=l.Column=r.Model.extend({defaults:{name:undefined,label:undefined,sortable:!0,editable:!0,renderable:!0,formatter:undefined,cell:undefined,headerCell:undefined},initialize:function(e){l.requireOptions(e,["cell","name"]),this.has("label")||this.set({label:this.get("name")},{silent:!0});var t=l.resolveNameToClass(this.get("headerCell"),"HeaderCell"),n=l.resolveNameToClass(this.get("cell"),"Cell");this.set({cell:n,headerCell:t},{silent:!0})}}),P=l.Columns=r.Collection.extend({model:D}),H=l.Row=r.View.extend({tagName:"tr",requiredOptions:["columns","model"],initialize:function(e){l.requireOptions(e,this.requiredOptions);var t=this.columns=e.columns;t instanceof r.Collection||(t=this.columns=new P(t));var n=this.cells=[];for(var i=0;i<t.length;i++)n.push(this.makeCell(t.at(i),e));this.listenTo(t,"change:renderable",function(e,t){for(var r=0;r<n.length;r++){var i=n[r];i.column.get("name")==e.get("name")&&(t?i.$el.show():i.$el.hide())}}),this.listenTo(t,"add",function(t,r){var i=r.indexOf(t),s=this.makeCell(t,e);n.splice(i,0,s),s.column.get("renderable")||s.$el.hide();var o=this.$el;i===0?o.prepend(s.render().$el):i===r.length-1?o.append(s.render().$el):o.children().eq(i).before(s.render().$el)}),this.listenTo(t,"remove",function(e,t,r){n[r.index].remove(),n.splice(r.index,1)})},makeCell:function(e){return new(e.get("cell"))({column:e,model:this.model})},render:function(){this.$el.empty();var e=document.createDocumentFragment();for(var t=0;t<this.cells.length;t++){var n=this.cells[t];e.appendChild(n.render().el),n.column.get("renderable")||n.$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 r.View.prototype.remove.apply(this,arguments)}}),B=l.EmptyRow=r.View.extend({tagName:"tr",emptyText:null,initialize:function(e){l.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}}),j=l.HeaderCell=r.View.extend({tagName:"th",events:{"click a":"onClick"},_direction:null,initialize:function(e){l.requireOptions(e,["column","collection"]),this.column=e.column,this.column instanceof D||(this.column=new D(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,n,r){r==this.collection&&(e!==this.column.get("name")?this.direction(null):this.direction(t))},onClick:function(e){e.preventDefault();var t=this.column.get("name");this.column.get("sortable")&&(this.direction()==="ascending"?this.sort(t,"descending",function(e,n){var r=e.get(t),i=n.get(t);return r===i?0:r>i?-1:1}):this.direction()==="descending"?this.sort(t,null):this.sort(t,"ascending",function(e,n){var r=e.get(t),i=n.get(t);return r===i?0:r<i?-1:1}))},sort:function(e,t,n){n=n||this._cidComparator;var i=this.collection;if(r.PageableCollection&&i instanceof r.PageableCollection){var s;t==="ascending"?s=-1:t==="descending"?s=1:s=null,i.setSorting(s?e:null,s),i.mode=="client"?(i.fullCollection.comparator||(i.fullCollection.comparator=n),i.fullCollection.sort()):i.fetch({reset:!0})}else i.comparator=n,i.sort();this.collection.trigger("backgrid:sort",e,t,n,this.collection)},_cidComparator:function(e,t){var r=e.cid,i=t.cid;if(!n.isUndefined(r)&&!n.isUndefined(i)){r=r.slice(1)*1,i=i.slice(1)*1;if(r<i)return-1;if(r>i)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}}),F=l.HeaderRow=l.Row.extend({requiredOptions:["columns","collection"],initialize:function(){l.Row.prototype.initialize.apply(this,arguments)},makeCell:function(e,t){var n=e.get("headerCell")||t.headerCell||j;return n=new n({column:e,collection:this.collection}),n}}),I=l.Header=r.View.extend({tagName:"thead",initialize:function(e){l.requireOptions(e,["columns","collection"]),this.columns=e.columns,this.columns instanceof r.Collection||(this.columns=new P(this.columns)),this.row=new l.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),r.View.prototype.remove.apply(this,arguments)}}),q=l.Body=r.View.extend({tagName:"tbody",initialize:function(e){l.requireOptions(e,["columns","collection"]),this.columns=e.columns,this.columns instanceof r.Collection||(this.columns=new P(this.columns)),this.row=e.row||H,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(){this.rows.length===0&&this.emptyText!=null&&this.rows.unshift(new B({emptyText:this.emptyText,columns:this.columns}))},insertRow:function(e,t,i){this.rows[0]instanceof B&&this.rows.pop().remove();if(!(t instanceof r.Collection)&&!i){this.collection.add(e,i=t);return}i=n.extend({render:!0},i||{});var s=new this.row({columns:this.columns,model:e}),o=t.indexOf(e);this.rows.splice(o,0,s);var u=this.$el,a=u.children(),f=s.render().$el;i.render&&(o>=a.length?u.append(f):a.eq(o).before(f))},removeRow:function(e,t,r){if(!r){this.collection.remove(e,r=t),this._unshiftEmptyRowMayBe();return}(n.isUndefined(r.render)||r.render)&&this.rows[r.index].remove(),this.rows.splice(r.index,1),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();var e=document.createDocumentFragment();for(var t=0;t<this.rows.length;t++){var n=this.rows[t];e.appendChild(n.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 r.View.prototype.remove.apply(this,arguments)},moveToNextCell:function(e,t,n){var r=this.collection.indexOf(e),i=this.columns.indexOf(t);if(n.moveUp()||n.moveDown()||n.moveLeft()||n.moveRight()||n.save()){var s=this.columns.length,o=s*this.collection.length;if(n.moveUp()||n.moveDown()){var u=this.rows[r+(n.moveUp()?-1:1)];u&&u.cells[i].enterEditMode()}else if(n.moveLeft()||n.moveRight()){var a=n.moveRight();for(var f=r*s+i+(a?1:-1);f>=0&&f<o;a?f++:f--){var l=~~(f/s),c=f-l*s,h=this.rows[l].cells[c];if(h.column.get("renderable")&&h.column.get("editable")){h.enterEditMode();break}}}}this.rows[r].cells[i].exitEditMode()}}),R=l.Footer=r.View.extend({tagName:"tfoot",initialize:function(e){l.requireOptions(e,["columns","collection"]),this.columns=e.columns,this.columns instanceof r.Collection||(this.columns=new l.Columns(this.columns))}}),U=l.Grid=r.View.extend({tagName:"table",className:"backgrid",header:I,body:q,footer:null,initialize:function(e){l.requireOptions(e,["columns","collection"]),e.columns instanceof r.Collection||(e.columns=new P(e.columns)),this.columns=e.columns;var t=n.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,n){return this.body.insertRow(e,t,n)},removeRow:function(e,t,n){return this.body.removeRow(e,t,n)},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),r.View.prototype.remove.apply(this,arguments)}})}(this,jQuery,_,Backbone),define("libs/backgrid",["backbone","underscore","jquery"],function(e){return function(){var t,n;return t||e.Backgrid}}(this)),function(e){function Y(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function Z(e,n){function i(){t.suppressDeprecationWarnings===!1&&typeof console!="undefined"&&console.warn&&console.warn("Deprecation warning: "+e)}var r=!0;return st(function(){return r&&(i(),r=!1),n.apply(this,arguments)},n)}function et(e,t){return function(n){return at(e.call(this,n),t)}}function tt(e,t){return function(n){return this.lang().ordinal(e.call(this,n),t)}}function nt(){}function rt(e){Et(e),st(this,e)}function it(e){var t=dt(e),n=t.year||0,r=t.quarter||0,i=t.month||0,s=t.week||0,o=t.day||0,u=t.hour||0,a=t.minute||0,f=t.second||0,l=t.millisecond||0;this._milliseconds=+l+f*1e3+a*6e4+u*36e5,this._days=+o+s*7,this._months=+i+r*3+n*12,this._data={},this._bubble()}function st(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return t.hasOwnProperty("toString")&&(e.toString=t.toString),t.hasOwnProperty("valueOf")&&(e.valueOf=t.valueOf),e}function ot(e){var t={},n;for(n in e)e.hasOwnProperty(n)&&v.hasOwnProperty(n)&&(t[n]=e[n]);return t}function ut(e){return e<0?Math.ceil(e):Math.floor(e)}function at(e,t,n){var r=""+Math.abs(e),i=e>=0;while(r.length<t)r="0"+r;return(i?n?"+":"":"-")+r}function ft(e,n,r,i){var s=n._milliseconds,o=n._days,u=n._months;i=i==null?!0:i,s&&e._d.setTime(+e._d+s*r),o&&en(e,"Date",Zt(e,"Date")+o*r),u&&Yt(e,Zt(e,"Month")+u*r),i&&t.updateOffset(e,o||u)}function lt(e){return Object.prototype.toString.call(e)==="[object Array]"}function ct(e){return Object.prototype.toString.call(e)==="[object Date]"||e instanceof Date}function ht(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),s=0,o;for(o=0;o<r;o++)(n&&e[o]!==t[o]||!n&&mt(e[o])!==mt(t[o]))&&s++;return s+i}function pt(e){if(e){var t=e.toLowerCase().replace(/(.)s$/,"$1");e=X[e]||V[t]||t}return e}function dt(e){var t={},n,r;for(r in e)e.hasOwnProperty(r)&&(n=pt(r),n&&(t[n]=e[r]));return t}function vt(n){var r,i;if(n.indexOf("week")===0)r=7,i="day";else{if(n.indexOf("month")!==0)return;r=12,i="month"}t[n]=function(s,o){var u,a,f=t.fn._lang[n],l=[];typeof s=="number"&&(o=s,s=e),a=function(e){var n=t().utc().set(i,e);return f.call(t.fn._lang,n,s||"")};if(o!=null)return a(o);for(u=0;u<r;u++)l.push(a(u));return l}}function mt(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(t>=0?n=Math.floor(t):n=Math.ceil(t)),n}function gt(e,t){return(new Date(Date.UTC(e,t+1,0))).getUTCDate()}function yt(e,n,r){return Kt(t([e,11,31+n-r]),n,r).week}function bt(e){return wt(e)?366:365}function wt(e){return e%4===0&&e%100!==0||e%400===0}function Et(e){var t;e._a&&e._pf.overflow===-2&&(t=e._a[a]<0||e._a[a]>11?a:e._a[f]<1||e._a[f]>gt(e._a[u],e._a[a])?f:e._a[l]<0||e._a[l]>23?l:e._a[c]<0||e._a[c]>59?c:e._a[h]<0||e._a[h]>59?h:e._a[p]<0||e._a[p]>999?p:-1,e._pf._overflowDayOfYear&&(t<u||t>f)&&(t=f),e._pf.overflow=t)}function St(e){return e._isValid==null&&(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&&e._pf.charsLeftOver===0&&e._pf.unusedTokens.length===0)),e._isValid}function xt(e){return e?e.toLowerCase().replace("_","-"):e}function Tt(e,n){return n._isUTC?t(e).zone(n._offset||0):t(e).local()}function Nt(e,t){return t.abbr=e,d[e]||(d[e]=new nt),d[e].set(t),d[e]}function Ct(e){delete d[e]}function kt(e){var n=0,r,i,s,o,u=function(e){if(!d[e]&&m)try{require("./lang/"+e)}catch(t){}return d[e]};if(!e)return t.fn._lang;if(!lt(e)){i=u(e);if(i)return i;e=[e]}while(n<e.length){o=xt(e[n]).split("-"),r=o.length,s=xt(e[n+1]),s=s?s.split("-"):null;while(r>0){i=u(o.slice(0,r).join("-"));if(i)return i;if(s&&s.length>=r&&ht(o,s,!0)>=r-1)break;r--}n++}return t.fn._lang}function Lt(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function At(e){var t=e.match(w),n,r;for(n=0,r=t.length;n<r;n++)Q[t[n]]?t[n]=Q[t[n]]:t[n]=Lt(t[n]);return function(i){var s="";for(n=0;n<r;n++)s+=t[n]instanceof Function?t[n].call(i,e):t[n];return s}}function Ot(e,t){return e.isValid()?(t=Mt(t,e.lang()),$[t]||($[t]=At(t)),$[t](e)):e.lang().invalidDate()}function Mt(e,t){function r(e){return t.longDateFormat(e)||e}var n=5;E.lastIndex=0;while(n>=0&&E.test(e))e=e.replace(E,r),E.lastIndex=0,n-=1;return e}function _t(e,t){var n,r=t._strict;switch(e){case"Q":return _;case"DDDD":return P;case"YYYY":case"GGGG":case"gggg":return r?H:T;case"Y":case"G":case"g":return j;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return r?B:N;case"S":if(r)return _;case"SS":if(r)return D;case"SSS":if(r)return P;case"DDD":return x;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return k;case"a":case"A":return kt(t._l)._meridiemParse;case"X":return O;case"Z":case"ZZ":return L;case"T":return A;case"SSSS":return C;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return r?D:S;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return S;case"Do":return M;default:return n=new RegExp(qt(It(e.replace("\\","")),"i")),n}}function Dt(e){e=e||"";var t=e.match(L)||[],n=t[t.length-1]||[],r=(n+"").match(U)||["-",0,0],i=+(r[1]*60)+mt(r[2]);return r[0]==="+"?-i:i}function Pt(e,n,r){var i,s=r._a;switch(e){case"Q":n!=null&&(s[a]=(mt(n)-1)*3);break;case"M":case"MM":n!=null&&(s[a]=mt(n)-1);break;case"MMM":case"MMMM":i=kt(r._l).monthsParse(n),i!=null?s[a]=i:r._pf.invalidMonth=n;break;case"D":case"DD":n!=null&&(s[f]=mt(n));break;case"Do":n!=null&&(s[f]=mt(parseInt(n,10)));break;case"DDD":case"DDDD":n!=null&&(r._dayOfYear=mt(n));break;case"YY":s[u]=t.parseTwoDigitYear(n);break;case"YYYY":case"YYYYY":case"YYYYYY":s[u]=mt(n);break;case"a":case"A":r._isPm=kt(r._l).isPM(n);break;case"H":case"HH":case"h":case"hh":s[l]=mt(n);break;case"m":case"mm":s[c]=mt(n);break;case"s":case"ss":s[h]=mt(n);break;case"S":case"SS":case"SSS":case"SSSS":s[p]=mt(("0."+n)*1e3);break;case"X":r._d=new Date(parseFloat(n)*1e3);break;case"Z":case"ZZ":r._useUTC=!0,r._tzm=Dt(n);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),n&&(r._w=r._w||{},r._w[e]=n)}}function Ht(e){var n,r,i=[],s,o,h,p,d,v,m,g;if(e._d)return;s=jt(e),e._w&&e._a[f]==null&&e._a[a]==null&&(h=function(n){var r=parseInt(n,10);return n?n.length<3?r>68?1900+r:2e3+r:r:e._a[u]==null?t().weekYear():e._a[u]},p=e._w,p.GG!=null||p.W!=null||p.E!=null?d=Qt(h(p.GG),p.W||1,p.E,4,1):(v=kt(e._l),m=p.d!=null?Vt(p.d,v):p.e!=null?parseInt(p.e,10)+v._week.dow:0,g=parseInt(p.w,10)||1,p.d!=null&&m<v._week.dow&&g++,d=Qt(h(p.gg),g,m,v._week.doy,v._week.dow)),e._a[u]=d.year,e._dayOfYear=d.dayOfYear),e._dayOfYear&&(o=e._a[u]==null?s[u]:e._a[u],e._dayOfYear>bt(o)&&(e._pf._overflowDayOfYear=!0),r=Xt(o,0,e._dayOfYear),e._a[a]=r.getUTCMonth(),e._a[f]=r.getUTCDate());for(n=0;n<3&&e._a[n]==null;++n)e._a[n]=i[n]=s[n];for(;n<7;n++)e._a[n]=i[n]=e._a[n]==null?n===2?1:0:e._a[n];i[l]+=mt((e._tzm||0)/60),i[c]+=mt((e._tzm||0)%60),e._d=(e._useUTC?Xt:Wt).apply(null,i)}function Bt(e){var t;if(e._d)return;t=dt(e._i),e._a=[t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond],Ht(e)}function jt(e){var t=new Date;return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Ft(e){e._a=[],e._pf.empty=!0;var t=kt(e._l),n=""+e._i,r,i,s,o,u,a=n.length,f=0;s=Mt(e._f,t).match(w)||[];for(r=0;r<s.length;r++)o=s[r],i=(n.match(_t(o,e))||[])[0],i&&(u=n.substr(0,n.indexOf(i)),u.length>0&&e._pf.unusedInput.push(u),n=n.slice(n.indexOf(i)+i.length),f+=i.length),Q[o]?(i?e._pf.empty=!1:e._pf.unusedTokens.push(o),Pt(o,i,e)):e._strict&&!i&&e._pf.unusedTokens.push(o);e._pf.charsLeftOver=a-f,n.length>0&&e._pf.unusedInput.push(n),e._isPm&&e._a[l]<12&&(e._a[l]+=12),e._isPm===!1&&e._a[l]===12&&(e._a[l]=0),Ht(e),Et(e)}function It(e){return e.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i})}function qt(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Rt(e){var t,n,r,i,s;if(e._f.length===0){e._pf.invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<e._f.length;i++){s=0,t=st({},e),t._pf=Y(),t._f=e._f[i],Ft(t);if(!St(t))continue;s+=t._pf.charsLeftOver,s+=t._pf.unusedTokens.length*10,t._pf.score=s;if(r==null||s<r)r=s,n=t}st(e,n||t)}function Ut(e){var n,r,i=e._i,s=F.exec(i);if(s){e._pf.iso=!0;for(n=0,r=q.length;n<r;n++)if(q[n][1].exec(i)){e._f=q[n][0]+(s[6]||" ");break}for(n=0,r=R.length;n<r;n++)if(R[n][1].exec(i)){e._f+=R[n][0];break}i.match(L)&&(e._f+="Z"),Ft(e)}else t.createFromInputFallback(e)}function zt(n){var r=n._i,i=g.exec(r);r===e?n._d=new Date:i?n._d=new Date(+i[1]):typeof r=="string"?Ut(n):lt(r)?(n._a=r.slice(0),Ht(n)):ct(r)?n._d=new Date(+r):typeof r=="object"?Bt(n):typeof r=="number"?n._d=new Date(r):t.createFromInputFallback(n)}function Wt(e,t,n,r,i,s,o){var u=new Date(e,t,n,r,i,s,o);return e<1970&&u.setFullYear(e),u}function Xt(e){var t=new Date(Date.UTC.apply(null,arguments));return e<1970&&t.setUTCFullYear(e),t}function Vt(e,t){if(typeof e=="string")if(!isNaN(e))e=parseInt(e,10);else{e=t.weekdaysParse(e);if(typeof e!="number")return null}return e}function $t(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function Jt(e,t,n){var r=s(Math.abs(e)/1e3),i=s(r/60),o=s(i/60),u=s(o/24),a=s(u/365),f=r<45&&["s",r]||i===1&&["m"]||i<45&&["mm",i]||o===1&&["h"]||o<22&&["hh",o]||u===1&&["d"]||u<=25&&["dd",u]||u<=45&&["M"]||u<345&&["MM",s(u/30)]||a===1&&["y"]||["yy",a];return f[2]=t,f[3]=e>0,f[4]=n,$t.apply({},f)}function Kt(e,n,r){var i=r-n,s=r-e.day(),o;return s>i&&(s-=7),s<i-7&&(s+=7),o=t(e).add("d",s),{week:Math.ceil(o.dayOfYear()/7),year:o.year()}}function Qt(e,t,n,r,i){var s=Xt(e,0,1).getUTCDay(),o,u;return n=n!=null?n:i,o=i-s+(s>r?7:0)-(s<i?7:0),u=7*(t-1)+(n-i)+o+1,{year:u>0?e:e-1,dayOfYear:u>0?u:bt(e-1)+u}}function Gt(n){var r=n._i,i=n._f;return r===null||i===e&&r===""?t.invalid({nullInput:!0}):(typeof r=="string"&&(n._i=r=kt().preparse(r)),t.isMoment(r)?(n=ot(r),n._d=new Date(+r._d)):i?lt(i)?Rt(n):Ft(n):zt(n),new rt(n))}function Yt(e,t){var n;if(typeof t=="string"){t=e.lang().monthsParse(t);if(typeof t!="number")return e}return n=Math.min(e.date(),gt(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Zt(e,t){return e._d["get"+(e._isUTC?"UTC":"")+t]()}function en(e,t,n){return t==="Month"?Yt(e,n):e._d["set"+(e._isUTC?"UTC":"")+t](n)}function tn(e,n){return function(r){return r!=null?(en(this,e,r),t.updateOffset(this,n),this):Zt(this,e)}}function nn(e){t.duration.fn[e]=function(){return this._data[e]}}function rn(e,n){t.duration.fn["as"+e]=function(){return+this/n}}function sn(e){if(typeof ender!="undefined")return;i=r.moment,e?r.moment=Z("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",t):r.moment=t}var t,n="2.6.0",r=typeof global!="undefined"?global:this,i,s=Math.round,o,u=0,a=1,f=2,l=3,c=4,h=5,p=6,d={},v={_isAMomentObject:null,_i:null,_f:null,_l:null,_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},m=typeof module!="undefined"&&module.exports,g=/^\/?Date\((\-?\d+)/i,y=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,b=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,w=/(\[[^\[]*\])|(\\)?(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,E=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,S=/\d\d?/,x=/\d{1,3}/,T=/\d{1,4}/,N=/[+\-]?\d{1,6}/,C=/\d+/,k=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,L=/Z|[\+\-]\d\d:?\d\d/gi,A=/T/i,O=/[\+\-]?\d+(\.\d{1,3})?/,M=/\d{1,2}/,_=/\d/,D=/\d\d/,P=/\d{3}/,H=/\d{4}/,B=/[+-]?\d{6}/,j=/[+-]?\d+/,F=/^\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)?)?$/,I="YYYY-MM-DDTHH:mm:ssZ",q=[["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}/]],R=[["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/]],U=/([\+\-]|\d\d)/gi,z="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),W={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},X={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"},V={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},$={},J="DDD w W M D d".split(" "),K="M D H h m s w W".split(" "),Q={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 at(this.year()%100,2)},YYYY:function(){return at(this.year(),4)},YYYYY:function(){return at(this.year(),5)},YYYYYY:function(){var e=this.year(),t=e>=0?"+":"-";return t+at(Math.abs(e),6)},gg:function(){return at(this.weekYear()%100,2)},gggg:function(){return at(this.weekYear(),4)},ggggg:function(){return at(this.weekYear(),5)},GG:function(){return at(this.isoWeekYear()%100,2)},GGGG:function(){return at(this.isoWeekYear(),4)},GGGGG:function(){return at(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 mt(this.milliseconds()/100)},SS:function(){return at(mt(this.milliseconds()/10),2)},SSS:function(){return at(this.milliseconds(),3)},SSSS:function(){return at(this.milliseconds(),3)},Z:function(){var e=-this.zone(),t="+";return e<0&&(e=-e,t="-"),t+at(mt(e/60),2)+":"+at(mt(e)%60,2)},ZZ:function(){var e=-this.zone(),t="+";return e<0&&(e=-e,t="-"),t+at(mt(e/60),2)+at(mt(e)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},G=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];while(J.length)o=J.pop(),Q[o+"o"]=tt(Q[o],o);while(K.length)o=K.pop(),Q[o+o]=et(Q[o],2);Q.DDDD=et(Q.DDD,3),st(nt.prototype,{set:function(e){var t,n;for(n in e)t=e[n],typeof t=="function"?this[n]=t:this["_"+n]=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 n,r,i;this._monthsParse||(this._monthsParse=[]);for(n=0;n<12;n++){this._monthsParse[n]||(r=t.utc([2e3,n]),i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[n]=new RegExp(i.replace(".",""),"i"));if(this._monthsParse[n].test(e))return n}},_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 n,r,i;this._weekdaysParse||(this._weekdaysParse=[]);for(n=0;n<7;n++){this._weekdaysParse[n]||(r=t([2e3,1]).day(n),i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[n]=new RegExp(i.replace(".",""),"i"));if(this._weekdaysParse[n].test(e))return n}},_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(e+"").toLowerCase().charAt(0)==="p"},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(e,t,n){return e>11?n?"pm":"PM":n?"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 n=this._calendar[e];return typeof n=="function"?n.apply(t):n},_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,n,r){var i=this._relativeTime[n];return typeof i=="function"?i(e,t,n,r):i.replace(/%d/i,e)},pastFuture:function(e,t){var n=this._relativeTime[e>0?"future":"past"];return typeof n=="function"?n(t):n.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 Kt(e,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),t=function(t,n,r,i){var s;return typeof r=="boolean"&&(i=r,r=e),s={},s._isAMomentObject=!0,s._i=t,s._f=n,s._l=r,s._strict=i,s._isUTC=!1,s._pf=Y(),Gt(s)},t.suppressDeprecationWarnings=!1,t.createFromInputFallback=Z("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)}),t.utc=function(t,n,r,i){var s;return typeof r=="boolean"&&(i=r,r=e),s={},s._isAMomentObject=!0,s._useUTC=!0,s._isUTC=!0,s._l=r,s._i=t,s._f=n,s._strict=i,s._pf=Y(),Gt(s).utc()},t.unix=function(e){return t(e*1e3)},t.duration=function(e,n){var r=e,i=null,s,o,u;return t.isDuration(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:typeof e=="number"?(r={},n?r[n]=e:r.milliseconds=e):(i=y.exec(e))?(s=i[1]==="-"?-1:1,r={y:0,d:mt(i[f])*s,h:mt(i[l])*s,m:mt(i[c])*s,s:mt(i[h])*s,ms:mt(i[p])*s}):!(i=b.exec(e))||(s=i[1]==="-"?-1:1,u=function(e){var t=e&&parseFloat(e.replace(",","."));return(isNaN(t)?0:t)*s},r={y:u(i[2]),M:u(i[3]),d:u(i[4]),h:u(i[5]),m:u(i[6]),s:u(i[7]),w:u(i[8])}),o=new it(r),t.isDuration(e)&&e.hasOwnProperty("_lang")&&(o._lang=e._lang),o},t.version=n,t.defaultFormat=I,t.momentProperties=v,t.updateOffset=function(){},t.lang=function(e,n){var r;return e?(n?Nt(xt(e),n):n===null?(Ct(e),e="en"):d[e]||kt(e),r=t.duration.fn._lang=t.fn._lang=kt(e),r._abbr):t.fn._lang._abbr},t.langData=function(e){return e&&e._lang&&e._lang._abbr&&(e=e._lang._abbr),kt(e)},t.isMoment=function(e){return e instanceof rt||e!=null&&e.hasOwnProperty("_isAMomentObject")},t.isDuration=function(e){return e instanceof it};for(o=G.length-1;o>=0;--o)vt(G[o]);t.normalizeUnits=function(e){return pt(e)},t.invalid=function(e){var n=t.utc(NaN);return e!=null?st(n._pf,e):n._pf.userInvalidated=!0,n},t.parseZone=function(){return t.apply(null,arguments).parseZone()},t.parseTwoDigitYear=function(e){return mt(e)+(mt(e)>68?1900:2e3)},st(t.fn=rt.prototype,{clone:function(){return t(this)},valueOf:function(){return+this._d+(this._offset||0)*6e4},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=t(this).utc();return 0<e.year()&&e.year()<=9999?Ot(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):Ot(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 St(this)},isDSTShifted:function(){return this._a?this.isValid()&&ht(this._a,(this._isUTC?t.utc(this._a):t(this._a)).toArray())>0:!1},parsingFlags:function(){return st({},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 n=Ot(this,e||t.defaultFormat);return this.lang().postformat(n)},add:function(e,n){var r;return typeof e=="string"?r=t.duration(+n,e):r=t.duration(e,n),ft(this,r,1),this},subtract:function(e,n){var r;return typeof e=="string"?r=t.duration(+n,e):r=t.duration(e,n),ft(this,r,-1),this},diff:function(e,n,r){var i=Tt(e,this),s=(this.zone()-i.zone())*6e4,o,u;return n=pt(n),n==="year"||n==="month"?(o=(this.daysInMonth()+i.daysInMonth())*432e5,u=(this.year()-i.year())*12+(this.month()-i.month()),u+=(this-t(this).startOf("month")-(i-t(i).startOf("month")))/o,u-=(this.zone()-t(this).startOf("month").zone()-(i.zone()-t(i).startOf("month").zone()))*6e4/o,n==="year"&&(u/=12)):(o=this-i,u=n==="second"?o/1e3:n==="minute"?o/6e4:n==="hour"?o/36e5:n==="day"?(o-s)/864e5:n==="week"?(o-s)/6048e5:o),r?u:ut(u)},from:function(e,n){return t.duration(this.diff(e)).lang(this.lang()._abbr).humanize(!n)},fromNow:function(e){return this.from(t(),e)},calendar:function(){var e=Tt(t(),this).startOf("day"),n=this.diff(e,"days",!0),r=n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse";return this.format(this.lang().calendar(r,this))},isLeapYear:function(){return wt(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 e!=null?(e=Vt(e,this.lang()),this.add({d:e-t})):t},month:tn("Month",!0),startOf:function(e){e=pt(e);switch(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 e==="week"?this.weekday(0):e==="isoWeek"&&this.isoWeekday(1),e==="quarter"&&this.month(Math.floor(this.month()/3)*3),this},endOf:function(e){return e=pt(e),this.startOf(e).add(e==="isoWeek"?"week":e,1).subtract("ms",1)},isAfter:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)>+t(e).startOf(n)},isBefore:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)<+t(e).startOf(n)},isSame:function(e,t){return t=t||"ms",+this.clone().startOf(t)===+Tt(e,this).startOf(t)},min:function(e){return e=t.apply(null,arguments),e<this?this:e},max:function(e){return e=t.apply(null,arguments),e>this?this:e},zone:function(e,n){var r=this._offset||0;return e==null?this._isUTC?r:this._d.getTimezoneOffset():(typeof e=="string"&&(e=Dt(e)),Math.abs(e)<16&&(e*=60),this._offset=e,this._isUTC=!0,r!==e&&(!n||this._changeInProgress?ft(this,t.duration(r-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.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):typeof this._i=="string"&&this.zone(this._i),this},hasAlignedHourOffset:function(e){return e?e=t(e).zone():e=0,(this.zone()-e)%60===0},daysInMonth:function(){return gt(this.year(),this.month())},dayOfYear:function(e){var n=s((t(this).startOf("day")-t(this).startOf("year"))/864e5)+1;return e==null?n:this.add("d",e-n)},quarter:function(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)},weekYear:function(e){var t=Kt(this,this.lang()._week.dow,this.lang()._week.doy).year;return e==null?t:this.add("y",e-t)},isoWeekYear:function(e){var t=Kt(this,1,4).year;return e==null?t:this.add("y",e-t)},week:function(e){var t=this.lang().week(this);return e==null?t:this.add("d",(e-t)*7)},isoWeek:function(e){var t=Kt(this,1,4).week;return e==null?t:this.add("d",(e-t)*7)},weekday:function(e){var t=(this.day()+7-this.lang()._week.dow)%7;return e==null?t:this.add("d",e-t)},isoWeekday:function(e){return e==null?this.day()||7:this.day(this.day()%7?e:e-7)},isoWeeksInYear:function(){return yt(this.year(),1,4)},weeksInYear:function(){var e=this._lang._week;return yt(this.year(),e.dow,e.doy)},get:function(e){return e=pt(e),this[e]()},set:function(e,t){return e=pt(e),typeof this[e]=="function"&&this[e](t),this},lang:function(t){return t===e?this._lang:(this._lang=kt(t),this)}}),t.fn.millisecond=t.fn.milliseconds=tn("Milliseconds",!1),t.fn.second=t.fn.seconds=tn("Seconds",!1),t.fn.minute=t.fn.minutes=tn("Minutes",!1),t.fn.hour=t.fn.hours=tn("Hours",!0),t.fn.date=tn("Date",!0),t.fn.dates=Z("dates accessor is deprecated. Use date instead.",tn("Date",!0)),t.fn.year=tn("FullYear",!0),t.fn.years=Z("years accessor is deprecated. Use year instead.",tn("FullYear",!0)),t.fn.days=t.fn.day,t.fn.months=t.fn.month,t.fn.weeks=t.fn.week,t.fn.isoWeeks=t.fn.isoWeek,t.fn.quarters=t.fn.quarter,t.fn.toJSON=t.fn.toISOString,st(t.duration.fn=it.prototype,{_bubble:function(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,s,o,u;r.milliseconds=e%1e3,i=ut(e/1e3),r.seconds=i%60,s=ut(i/60),r.minutes=s%60,o=ut(s/60),r.hours=o%24,t+=ut(o/24),r.days=t%30,n+=ut(t/30),r.months=n%12,u=ut(n/12),r.years=u},weeks:function(){return ut(this.days()/7)},valueOf:function(){return this._milliseconds+this._days*864e5+this._months%12*2592e6+mt(this._months/12)*31536e6},humanize:function(e){var t=+this,n=Jt(t,!e,this.lang());return e&&(n=this.lang().pastFuture(t,n)),this.lang().postformat(n)},add:function(e,n){var r=t.duration(e,n);return this._milliseconds+=r._milliseconds,this._days+=r._days,this._months+=r._months,this._bubble(),this},subtract:function(e,n){var r=t.duration(e,n);return this._milliseconds-=r._milliseconds,this._days-=r._days,this._months-=r._months,this._bubble(),this},get:function(e){return e=pt(e),this[e.toLowerCase()+"s"]()},as:function(e){return e=pt(e),this["as"+e.charAt(0).toUpperCase()+e.slice(1)+"s"]()},lang:t.fn.lang,toIsoString:function(){var e=Math.abs(this.years()),t=Math.abs(this.months()),n=Math.abs(this.days()),r=Math.abs(this.hours()),i=Math.abs(this.minutes()),s=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(e?e+"Y":"")+(t?t+"M":"")+(n?n+"D":"")+(r||i||s?"T":"")+(r?r+"H":"")+(i?i+"M":"")+(s?s+"S":""):"P0D"}});for(o in W)W.hasOwnProperty(o)&&(rn(o,W[o]),nn(o.toLowerCase()));rn("Weeks",6048e5),t.duration.fn.asMonths=function(){return(+this-this.years()*31536e6)/2592e6+this.years()*12},t.lang("en",{ordinal:function(e){var t=e%10,n=mt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),m?module.exports=t:typeof define=="function"&&define.amd?(define("moment",["require","exports","module"],function(e,n,s){return s.config&&s.config()&&s.config().noGlobal===!0&&(r.moment=i),t}),sn(!0)):sn()}.call(this),define("libs/moment",function(e){return function(){var t,n;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,n,r,i,s,o,u){"use strict";var a={Backgrid:{}};return a.Backgrid.Row=n.Row.extend({render:function(){n.Row.prototype.render.call(this);var e=this.$el.find("td"),i=this;t.each(this.cells,function(n,s){var o=n.options.column,u=o.get("callback"),a=o.get("customClass"),f=o.get("title"),l=r(e[s]);u&&t.isFunction(u)&&!l.is(":empty")&&l.addClass("callback-trigger").on("click",function(e){e.stopPropagation(),u(i.model)}),a&&l.addClass(a),f&&l.attr("title",t.isFunction(f)?f(i.model):i.model.get(f))},this),this.$el.on("disable",function(){r(this).addClass("disabled").find("button").attr("disabled","disabled")}).on("enable",function(){r(this).removeClass("disabled").find("button").removeAttr("disabled")});if(this.rowClassName){var s=t.isFunction(this.rowClassName)?this.rowClassName(this.model):this.model.get(this.rowClassName);s&&this.$el.addClass(s)}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(){n.Row.prototype.remove.apply(e,arguments)})}}),a.Backgrid.HeaderCell=n.HeaderCell.extend({onClick:function(e){e.preventDefault(),this.column.get("sortable")&&this.direction()==="descending"&&this.direction(null),n.HeaderCell.prototype.onClick.call(this,e)}}),a.Backgrid.Header=n.Header.extend({initialize:function(t){n.requireOptions(t,["columns","collection"]),this.columns=t.columns,this.columns instanceof e.Collection||(this.columns=new n.Columns(this.columns)),this.row=new n.HeaderRow({columns:this.columns,collection:this.collection,headerCell:a.Backgrid.HeaderCell})},reset:function(e){return this.collection=e,this.row.collection=e,this.refresh&&this.refresh(),this},render:function(){return n.Header.prototype.render.call(this),this.$el.find(".sort-caret").addClass("ubnt-icon-arrows-sort"),this}}),a.Backgrid.Body=n.Body.extend({initialize:function(e){e.row=a.Backgrid.Row,e.rowClassName&&(e.row=e.row.extend({rowClassName:e.rowClassName})),this.throttled={alert:t.throttle(r.proxy(this.alert,this),200),title:t.throttle(r.proxy(this.title,this),200)},n.Body.prototype.initialize.call(this,e),this.noRows=e.noRows||s.N_NoRows,this.titles=e.titles?new e.titles({el:this.$el,collection:this.collection,columns:this.columns}):null},insertRow:function(e,t,r){n.Body.prototype.insertRow.call(this,e,t,r),this.throttled.alert(),this.throttled.title()},removeRow:function(e,t,r){n.Body.prototype.removeRow.call(this,e,t,r),this.throttled.alert(),this.throttled.title()},render:function(){return n.Body.prototype.render.call(this),this.alert(),this.title(),this},loading:function(e){this._isLoading=e,this.alert()},alert:function(){this.$el.find("tr.alert").remove();if(!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(r('<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 n.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),n.Body.prototype.remove.apply(this,arguments)}}),a.Backgrid.Footer=n.Footer.extend({reset:function(e){return this.collection=e,this.refresh&&this.refresh(),this}}),a.Backgrid.Grid=n.Grid.extend({header:a.Backgrid.Header,body:a.Backgrid.Body,footer:a.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};var r=this.collection=e.collection;e.collection=this._collection(0),e.grid=this,this.listenTo(e.collection,"sort",this._syncSort),n.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)&&(n.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,n,r){this.state.currentPage=parseInt(e,10)||1,t.isUndefined(n)||(this.state.pageSize=parseInt(n,10)),r||this.reset()},setFilter:function(e,n,r,i,s){i||(this.userFilterChanged=!0);var o={property:e,term:n,minimum:r,required:!0};r===-1&&(o.negate=!0,o.minimum=1);if(s||!t.isEqual(o,this.state.filters[e]))this.state.filters[e]=o,i||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(r.proxy(function(){t.size(this.state.filters)?r.when(this.collection.deferredSearch(this.state.filters)).then(r.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(e){var n=t.size(this.collection),r=Math.ceil(n/this.state.pageSize);this.state.currentPage>r&&(this.state.currentPage=r),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 n=this.collections.filtered||this.collection;this.state.size=t.size(n),n.comparator!=this.state.sort&&(n.comparator=this.state.sort)&&n.sort();if(t.isNumber(e=t.isUndefined(e)?this.state.pageSize:e)&&this.state.size>e){var r=((this.state.currentPage||1)-1)*e,i=r+e;n=new n.constructor(e>0?n.slice(r,i):[]),this.collections.paginated=n}else this.state.pageSize?(n=new n.constructor(n.models),this.collections.paginated=n):this.collections.paginated=null;return n},_reset:function(e){if(this.rendered){var n=this._collection();e?t.each(["header","body","footer"],function(e){this[e]&&(this[e]=new(this[e].remove().constructor)(t.extend({},this.options,{collection:n})),this.$el.append(this[e].render().$el))},this):t.each(["header","body","footer"],function(e){this[e]&&this[e].reset&&this[e].reset(n)},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),n.Grid.prototype.remove.apply(this,arguments)}}),a.Backgrid.Cells=a.Backgrid.Cells||{},a.Backgrid.Cells.RawCellEditor=n.InputCellEditor.extend({render:function(){return this.$el.val(this.model.get(this.column.get("name"))),this}}),a.Backgrid.Cells.HtmlCell=n.Cell.extend({className:"html-cell",editor:a.Backgrid.Cells.RawCellEditor,render:function(){return this.$el.empty().append(this.formatter.fromRaw(this.model.get(this.column.get("name")))),this}}),a.Backgrid.Cells.ActionsCell=n.Cell.extend({className:"actions-cell",editor:a.Backgrid.Cells.RawCellEditor,actions:[],initialize:function(e){n.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 n=e.icon||"button-"+t+"-icon",i=e.text||t,s=e.callback||r.noop,o=this.model,u=e.options,a="button button-"+t+" lighter skinny "+(e.buttonClasses||"");e.iconOnly&&(a+=" icon-only"),e.requiresAdminPrivilege&&(a+=" is-admin"),e.classCallback&&(a+=" "+e.classCallback(o)),(!e.render||e.render(o,u))&&this.$el.append(r('<button class="'+a+'"><span class="ui-button-icon-primary '+n+'"></span>'+(e.iconOnly?"":i)+"</button>").on("click",function(e){s(o,e)}))},this),this},remove:function(){this.stopListening(this.model,"change"),n.Cell.prototype.remove.apply(this,arguments)}}),a.Backgrid.Cells.CheckboxCell=n.Cell.extend({className:"checkbox-cell",editor:a.Backgrid.Cells.RawCellEditor,initialize:function(e){n.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,n=t.callback||r.noop,i=this.model,s=t.options;(!t.render||t.render(i,s))&&this.$el.append(r('<input type="checkbox" id="'+i.id+'">').on("click",function(e){e.stopPropagation(),n(i,e)}))}return this},remove:function(){this.stopListening(this.model,"change"),this.$el.find('.input[type="checkbox"]').off("click"),n.Cell.prototype.remove.apply(this,arguments)}}),a.Backgrid.Cells.ModelCell=n.Cell.extend({className:"model-cell",editor:a.Backgrid.Cells.RawCellEditor,callback:null,initialize:function(e){n.Cell.prototype.initialize.call(this,e),this.listenTo(this.model,"change",function(){this.$el.hasClass("editor")||this.render()});if(!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"),n.Cell.prototype.remove.apply(this,arguments)}}),a.Backgrid.Cells.ComplexCell=n.Cell.extend({className:"complex-cell",editor:a.Backgrid.Cells.RawCellEditor,callback:null,initialize:function(e){n.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"),n.Cell.prototype.remove.apply(this,arguments)}}),a.Backgrid.Cells.ComplexHtmlCell=a.Backgrid.Cells.ComplexCell.extend({render:function(){return this.$el.empty().append(this.formatter.fromRaw(this.model)),this}}),a.Backgrid.Cells.SelectCell=n.Cell.extend({id:"_id",property:"name",first:null,collection:null,styled:!0,events:{},render:function(e){var n=!!this.$select;n?this.$select.empty():(this.$select=r("<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:r.proxy(function(e,t){this.$select.attr("has-changed",t.item.value),r(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(r('<option value="" />').text(this.first)),this.collection.each(function(e){var n;t.isFunction(this.property)?n=this.property(e):n=e.get(this.property),this.$select.append(r("<option />").attr("value",e.get(this.id)).text(n))},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));if(n)try{this.$select.selectmenu("refresh")}catch(i){}return this},remove:function(){this.$select.off("change");if(this.styled&&this.$select)try{this.$select.selectmenu("destroy")}catch(e){}this.$select.off(),n.Cell.prototype.remove.apply(this,arguments)}}),a.Backgrid.Headers=a.Backgrid.Headers||{},a.Backgrid.Headers.customSortHeader=a.Backgrid.HeaderCell.extend({sort:function(t,n,r){if(e.PageableCollection&&this.collection instanceof e.PageableCollection)throw new Error("Cannot use customSortHeader with Backbone.PageableCollection");var i=this.options.column.get("sortValue"),s=this.options.column.get("sortFormatter");if(!i)throw new Error("Missing the sortValue configuration");switch(n){case"ascending":r=function(e,t){var n=typeof i=="function"?i(e):e[i](),r=typeof i=="function"?i(t):t[i]();return s&&(n=n?n[s]():n,r=r?r[s]():r),n===r?0:n<r?-1:1};break;case"descending":r=function(e,t){var n=typeof i=="function"?i(e):e[i](),r=typeof i=="function"?i(t):t[i]();return s&&(n=n?n[s]():n,r=r?r[s]():r),n===r?0:n>r?-1:1}}a.Backgrid.HeaderCell.prototype.sort.call(this,t,n,r)}}),a.Backgrid.Headers.noSortHeader=a.Backgrid.HeaderCell.extend({render:function(){return a.Backgrid.HeaderCell.prototype.render.call(this),this.$el.addClass("nosort").find(".sort-caret").remove(),this}}),a.Backgrid.Headers.noLinkHeader=a.Backgrid.Headers.noSortHeader.extend({render:function(){a.Backgrid.Headers.noSortHeader.prototype.render.call(this);var e=this.$("a").html();return this.$("a").remove(),this.$el.append(e),this}}),a.Backgrid.Headers.emptyHeader=a.Backgrid.HeaderCell.extend({render:function(){return this.$el.html("&nbsp;"),this}}),a.Backgrid.Headers.CheckboxHeader=a.Backgrid.HeaderCell.extend({render:function(){return this.$el.addClass("nosort").find(".sort-caret").remove(),this.$el.empty(),this.$el.append(r('<input type="checkbox">').on("change",function(e){e.stopPropagation(),r(this).closest(".backgrid").find('.checkbox-cell input[type="checkbox"]:not([disabled])').prop("checked",!r(e.target).is(":checked")).trigger("click",e)})),this},remove:function(){this.$el.find('.input[type="checkbox"]').off("change"),a.Backgrid.HeaderCell.prototype.remove.apply(this,arguments)}}),a.Backgrid.Formatters=a.Backgrid.Formatters||{},a.Backgrid.Formatters.Boolean={fromRaw:function(e){return e?"Yes":"No"},toRaw:function(e){return e}},a.Backgrid.Formatters.Span={className:"",fromRaw:function(e){var n=e.replace(/ +/g,"-").toLowerCase(),i=r("<span></span>");return i.attr("class",n),i.html(t.escape(e)),i},toRaw:function(e){return e}},a.Backgrid.Formatters.Grid={className:"",levels:[],fromRaw:function(e){var n=r('<div class="grid '+this.className+'"></div>');return t.each(this.levels,function(t){e>t&&n.append(r("<span></span>"))}),n.attr("data-value",e),n},toRaw:function(e){return e}},a.Backgrid.Formatters.Bytes={fromRaw:function(e){if(e){var t=["","K","M","G","T"],n=t.length,r=0;e=parseInt(e,10)||0;for(;r<n;r++){if(e<999.5)return e.toPrecision(3)+t[r];if(e<1024)return e.toFixed(0)+t[r];e/=1024}return e.toFixed(0)+t[n-1]}return""},toRaw:function(e){return e}},a.Backgrid.Formatters.BytesPerSecond={fromRaw:function(e){var t=a.Backgrid.Formatters.Bytes.fromRaw(e);return t?t+"B/s":""},toRaw:function(e){return e}},a.Backgrid.Formatters.BitsPerSecond={fromRaw:function(e){var t=a.Backgrid.Formatters.Bytes.fromRaw(e*8);return t?t+"bps":""},toRaw:function(e){return e}},a.Backgrid.Formatters.Seconds={fromRaw:function(e){var t,n,i,s;i=Math.floor(e/60),s=e%60,n=Math.floor(i/60),i%=60,t=Math.floor(n/24),n%=24;var o="";return t&&(o+=t+"d "),n&&(o+=n+"h "),i&&(o+=i+"m "),s&&(o+=Math.floor(s)+"s "),r.trim(o)},toRaw:function(e){return e}},a.Backgrid.Formatters.Milliseconds={fromRaw:function(e){return a.Backgrid.Formatters.Seconds.fromRaw(e/1e3)},toRaw:function(e){return e}},a.Backgrid.Formatters.Minutes={fromRaw:function(e){return a.Backgrid.Formatters.Seconds.fromRaw(e*60)},toRaw:function(e){return e}},a.Backgrid.Formatters.Moment={fromFormat:"X",toFormat:"YYYY/MM/DD HH:mm:ss",relative:!1,prefix:"",suffix:"",fromRaw:function(e){return this.relative?this.prefix+i(""+e,this.fromFormat).fromNow()+this.suffix:this.prefix+i(""+e,this.fromFormat).format(this.toFormat)+this.suffix},toRaw:function(e){return e}},a.Backgrid.Formatters.Duration={fromRaw:function(e){var t=[],n=["d","h","m","s"],r=[86400,3600,60,1],i=n.length,s;if(isNaN(e)||e===0)return"0s";e=parseInt(e,10);for(var o=0;o<i;o++){s=Math.floor(e/r[o]),s&&(t.push(s+n[o]),e%=r[o]);if(t.length>2)break}return t.join(" ")},toRaw:function(e){return e}},a.Backgrid.Formatters.Postfix={postfix:"",fromRaw:function(e){return e+this.postfix},toRaw:function(e){return e.substring(0,e.length-this.postfix.length)}},a.Backgrid.Formatters.Placeholder={placeholder:"",fromRaw:function(e){return this.placeholder},toRaw:function(e){return e}},a.Backgrid.Formatters.Percentage={fromRaw:function(e,t){return typeof t=="undefined"?parseFloat(e).toFixed(1)+"%":t===0?"0%":(parseInt(e,10)/t).toFixed(1)+"%"},toRaw:function(e){return e}},a.Backgrid.Formatters.PhoneNumber={fromRaw:function(e){if(e){switch(e.length){case 11:if(e.substring(0,1)=="1")return e.substring(1,4)+"-"+e.substring(4,7)+"-"+e.substring(7,11)}return e}},toRaw:function(e){return e.replace("-","")}},a.Backgrid.Formatters.Currency={currency:"currency",amount:"amount",fromRaw:function(e){if(typeof e.get(this.currency)=="undefined")return;if(typeof e.get(this.amount)=="undefined")return;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}},a.Backgrid.Paginators=a.Backgrid.Paginators||{},a.Backgrid.Paginators.Default=a.Backgrid.Footer.extend({template:t.template(o),events:{"click a":"changePage"},initialize:function(e){n.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(){this.$el.find("tr:not(.loading)").remove();if(this.grid.state.currentPage){this.currentPage=this.grid.state.currentPage,this.totalPages=Math.ceil(this.grid.state.size/this.grid.state.pageSize);if(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"+(this.currentPage==1?" disabled":""),title:"first",label:"&lt;&lt;",icon:"ubnt-icon-arrows-left"}),e.push({page:"prev",className:"prev"+(this.currentPage==1?" disabled":""),title:"prev",label:"&lt;",icon:"ubnt-icon-arrow-left"});var t=7,n=Math.max(1,this.currentPage-Math.floor((t-1)/2)),r=Math.min(this.totalPages,n+t-1);while(r-n<t-1&&n>1)n--;for(var i=n;i<=r;i++)e.push({page:i,className:"numeric"+(this.currentPage==i?" active":""),title:i,label:i});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=r(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),a.Backgrid.Footer.prototype.remove.apply(this,arguments)}}),a.Backgrid.Paginators.Mini=a.Backgrid.Paginators.Default.extend({template:t.template(u),makeHandles:function(){return{prev:{page:"prev",className:"prev"+(this.currentPage==1?" 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"}}}}),a.Backgrid.Titles=a.Backgrid.Titles||{},a.Backgrid.Titles.Title=e.View.extend({initialize:function(e){this.columns=e.columns},render:function(e){this.$el.find("tr.title").remove();if(e){this.colspan=t.reduce(this.columns.pluck("renderable"),function(e,t){return t?e+1:e},0);var n=this,i=null;this.$el.children("tr:not(.title)").each(function(){var e=n.formatTitle(r(this).find(".title-cell").text());e!=i&&(n.insertRow(r(this),e),i=e)})}return this},formatTitle:function(e){return e},insertRow:function(e,t){e.before(r('<tr class="title"><td colspan="'+this.colspan+'">'+t+"</td></tr>"))}}),a.Backgrid.Titles.Moment=a.Backgrid.Titles.Title.extend({render:function(e){return i.lang("en",{calendar:{lastDay:"[Yesterday]",sameDay:"[Today]",nextDay:"[Tomorrow]",lastWeek:"MMMM D, YYYY",nextWeek:"MMMM D, YYYY",sameElse:"MMMM D, YYYY"}}),a.Backgrid.Titles.Title.prototype.render.call(this,e),this},formatTitle:function(e){return e?i(e).calendar():""}}),a.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,n,r,i,s){"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),i.when(this._rendered=i.Deferred(),this._loaded=i.Deferred(),this._dependencies=i.Deferred()).then(this.grid,this.failed),i.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){this._loaded.state()=="resolved"&&(this.reloading(),i.when(this._loaded=i.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:n.extend(t||{},this._fetchOpts),method:this._fetchMethod}},this._collectionType.Class)},reloading:function(){this._reloadingStack++,this.$loading.show(),this.$table.hide()},reloaded:function(){--this._reloadingStack||n.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(n.template(this._templateId,{msg:r})),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",n.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=i(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 r={columns:this.columns(),collection:this.collection,pageable:this._pageable};this._pageable&&(r.footer=t.Paginators.Default),this._gridTitles&&(r.titles=this._gridTitles),this._gridRowClassName&&(r.rowClassName=this._gridRowClassName);var s=this.grids.content=new this._gridClass(r);return this._pageable&&this.$pageSize.on("change",function(e,t){s.paginate(1,i(this).find("option:selected").val(),t)}).trigger("change",!0),e&&n.each(e,function(e){s.setFilter.apply(s,e)}),this.$el.find(".data-table").append(s.render().$el),this.$table=this.$el.find(".data-table table"),this.$loading=this.$el.find(".data-table .loading").hide(),this.listenTo(s,"backgrid:loading",this.reloading),this.listenTo(s,"backgrid:loaded",this.reloaded),this},failed:function(){var e=this;this.$el.html(n.template(s,{error:r.E_DataLoad})),this.$el.find("div.actions").append(i('<button class="button">Retry</button>').on("click",function(){var t=i(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,r){t=i.trim(t||this.$search.val()),n.each(this.grids,function(e){t?e.setFilter(null,t,this._filterMinimum,!1,r):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),n.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,n,r){"use strict";return{_modelSave:"save",_collectionCreate:"create",_save:function(n,i,s){var o,u;return u=(n?n[this._modelSave]:this.collection[this._collectionCreate]).call(n||this.collection,this.gather(i),t.extend({wait:!0,success:e.proxy(function(e,t,n){this.collection&&this.collection.add(e,{merge:!0}),this.trigger("save-success",e,t,n)},this),error:e.proxy(function(e,t){this.trigger("save-error",e,t)},this),complete:e.proxy(function(){this.trigger("save-complete",i)},this)},s||{})),n?u?o=!0:this.invalid(n.validationError,i):u?u.validationError?this.invalid(u.validationError,i):o=!0:this.error(n,{statusText:r.E_MissingModel}),o},fieldmap:function(){this._fieldmap={},t.each(this._prevalidate,function(e,t){var n=e.map||t;this._fieldmap[(e.subsection||"")+"-"+n]=t},this)},prevalidator:function(){this._inputs=[],this.fieldmap(),t.each(this._prevalidate,function(n,r){var i=n.map||r,s;switch(n.input){case"text":case"password":s=this.$el.find("input[name="+r+(n.input=="password"?"-text":"")+"]"),s.on("keyup.validator",{$input:s,property:i,validator:n},t.debounce(this._validate,500)),s.on("blur.validator validate.validator",{$input:s,property:i,validator:n},this._validate)}if(!t.size(s))return;n.onchange&&s.on("change.validator",e.proxy(function(){t.isArray(n.onchange)?t.each(n.onchange,function(e){this.$el.find("input[name="+e+"]").trigger("validate")},this):this.$el.find("input[name="+n.onchange+"]").trigger("validate")},this)),this._inputs.push(s)},this)},_validate:function(e){var t=e.data.$input,n=e.data.property,r=e.data.validator,i=r.model||this.model;if(!t||!n||!r)throw new Error("Missing _validate event data");if(i){this.valid([n],r.subsection);var s={};r.complex?s=this.gather(r.subsection):s[n]=t.val();var o=i.validate(s,{partial:n,extra:r.extra});o&&this.invalid(o,r.subsection)}},valid:function(e,n){var r=[];return e&&(this._fieldmap||this.fieldmap(),t.each(e,function(e){var t=this._fieldmap[(n||"")+"-"+e],i=this._prevalidate[t];if(i)switch(i.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:r.push(e)}},this)),r},invalid:function(e,n){var r={};return e&&(this._fieldmap||this.fieldmap(),t.each(e,function(e,t){var i=this._fieldmap[(n||"")+"-"+t],s=this._prevalidate[i];if(s)switch(s.input){case"text":this.$el.find("input[name="+i+"]").addClass("error").parent().append('<div class="error-msg">'+e+"</div>");break;case"password":this.$el.find("input[name="+i+"]").addClass("error").parent().append('<div class="error-msg">'+e+"</div>"),this.$el.find("input[name="+i+"-text]").addClass("error");break;default:r[t]=e}},this)),r},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,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^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(n,r){return typeof n=="number"?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),r&&r.call(t)},n)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=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):t=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(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(e==null?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(n){return arguments.length?t.call(this,e.camelCase(n)):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,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r<i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},hasScroll:function(t,n){if(e(t).css("overflow")==="hidden")return!1;var r=n&&n==="left"?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)}})}(jQuery),function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;(r=t[n])!=null;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget=function(t,n,r){var i,s,o,u,a={},f=t.split(".")[0];t=t.split(".")[1],i=f+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[f]=e[f]||{},s=e[f][t],o=e[f][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,r){if(!e.isFunction(r)){a[t]=r;return}a[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},i=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=i,s=r.apply(this,arguments),this._super=t,this._superApply=n,s}}()}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix:t},a,{constructor:o,namespace:f,widgetName:t,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o)},e.widget.extend=function(n){var i=r.call(arguments,1),s=0,o=i.length,u,a;for(;s<o;s++)for(u in i[s])a=i[s][u],i[s].hasOwnProperty(u)&&a!==t&&(e.isPlainObject(a)?n[u]=e.isPlainObject(n[u])?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=a);return n},e.widget.bridge=function(n,i){var s=i.prototype.widgetFullName||n;e.fn[n]=function(o){var u=typeof o=="string",a=r.call(arguments,1),f=this;return o=!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,u?this.each(function(){var r,i=e.data(this,s);if(!i)return e.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+o+"'");if(!e.isFunction(i[o])||o.charAt(0)==="_")return e.error("no such method '"+o+"' for "+n+" widget instance");r=i[o].apply(i,a);if(r!==i&&r!==t)return f=r&&r.jquery?f.pushStack(r.get()):r,!1}):this.each(function(){var t=e.data(this,s);t?t.option(o||{})._init():e.data(this,s,new i(o,this))}),f}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,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(),r!==this&&(e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),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(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u<s.length-1;u++)o[s[u]]=o[s[u]]||{},o=o[s[u]];n=s.pop();if(r===t)return o[n]===t?null:o[n];o[n]=r}else{if(r===t)return this.options[n]===t?null:this.options[n];i[n]=r}}return this._setOptions(i),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,e==="disabled"&&(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,n,r){var i,s=this;typeof t!="boolean"&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^(\w+)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,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,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&e.effects.effect[u]?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}})}(jQuery),function(e,t){var n=!1;e(document).mouseup(function(){n=!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(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),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(t){if(n)return;this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=t.which===1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!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,t){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(){this.options.helper==="original"&&!/^(?: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 n=this.options;return this.helper||n.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.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 n=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,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.offsetParentCssPosition==="fixed"&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!=="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!=="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=this,r=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(r=e.ui.ddmanager.drop(this,t)),this.dropped&&(r=this.dropped,this.dropped=!1),this.options.helper==="original"&&!e.contains(this.element[0].ownerDocument,this.element[0])?!1:(this.options.revert==="invalid"&&!r||this.options.revert==="valid"&&r||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,r)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){n._trigger("stop",t)!==!1&&n._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!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 n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper==="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo==="parent"?this.element[0].parentNode:n.appendTo),r[0]!==this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(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();this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){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,n,r,i=this.options;if(!i.containment){this.containment=null;return}if(i.containment==="window"){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];return}if(i.containment==="document"){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];return}if(i.containment.constructor===Array){this.containment=i.containment;return}i.containment==="parent"&&(i.containment=this.helper[0].parentNode),n=e(i.containment),r=n[0];if(!r)return;t=n.css("overflow")!=="hidden",this.containment=[(parseInt(n.css("borderLeftWidth"),10)||0)+(parseInt(n.css("paddingLeft"),10)||0),(parseInt(n.css("borderTopWidth"),10)||0)+(parseInt(n.css("paddingTop"),10)||0),(t?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(n.css("borderRightWidth"),10)||0)-(parseInt(n.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(n.css("borderBottomWidth"),10)||0)-(parseInt(n.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n},_convertPositionTo:function(t,n){n||(n=this.position);var r=t==="absolute"?1:-1,i=this.cssPosition!=="absolute"||this.scrollParent[0]!==document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:i.scrollTop(),left:i.scrollLeft()}),{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():this.offset.scroll.top)*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():this.offset.scroll.left)*r}},_generatePosition:function(t){var n,r,i,s,o=this.options,u=this.cssPosition!=="absolute"||this.scrollParent[0]!==document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=t.pageX,f=t.pageY;return this.offset.scroll||(this.offset.scroll={top:u.scrollTop(),left:u.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(r=this.relative_container.offset(),n=[this.containment[0]+r.left,this.containment[1]+r.top,this.containment[2]+r.left,this.containment[3]+r.top]):n=this.containment,t.pageX-this.offset.click.left<n[0]&&(a=n[0]+this.offset.click.left),t.pageY-this.offset.click.top<n[1]&&(f=n[1]+this.offset.click.top),t.pageX-this.offset.click.left>n[2]&&(a=n[2]+this.offset.click.left),t.pageY-this.offset.click.top>n[3]&&(f=n[3]+this.offset.click.top)),o.grid&&(i=o.grid[1]?this.originalPageY+Math.round((f-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,f=n?i-this.offset.click.top>=n[1]||i-this.offset.click.top>n[3]?i:i-this.offset.click.top>=n[1]?i-o.grid[1]:i+o.grid[1]:i,s=o.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,a=n?s-this.offset.click.left>=n[0]||s-this.offset.click.left>n[2]?s:s-this.offset.click.left>=n[0]?s-o.grid[0]:s+o.grid[0]:s)),{top:f-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-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,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r]),t==="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},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,n){var r=e(this).data("ui-draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"ui-sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function(t,n){var r=e(this).data("ui-draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.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,r.options.helper==="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,n){var r=e(this).data("ui-draggable"),i=this;e.each(r.sortables,function(){var s=!1,o=this;this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(s=!0,e.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(s=!1),s})),s?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).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 n.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),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(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),n=e(this).data("ui-draggable").options;t.css("cursor")&&(n._cursor=t.css("cursor")),t.css("cursor",n.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,n){var r=e(n.helper),i=e(this).data("ui-draggable").options;r.css("opacity")&&(i._opacity=r.css("opacity")),r.css("opacity",i.opacity)},stop:function(t,n){var r=e(this).data("ui-draggable").options;r._opacity&&e(n.helper).css("opacity",r._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&t.scrollParent[0].tagName!=="HTML"&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var n=e(this).data("ui-draggable"),r=n.options,i=!1;if(n.scrollParent[0]!==document&&n.scrollParent[0].tagName!=="HTML"){if(!r.axis||r.axis!=="x")n.overflowOffset.top+n.scrollParent[0].offsetHeight-t.pageY<r.scrollSensitivity?n.scrollParent[0].scrollTop=i=n.scrollParent[0].scrollTop+r.scrollSpeed:t.pageY-n.overflowOffset.top<r.scrollSensitivity&&(n.scrollParent[0].scrollTop=i=n.scrollParent[0].scrollTop-r.scrollSpeed);if(!r.axis||r.axis!=="y")n.overflowOffset.left+n.scrollParent[0].offsetWidth-t.pageX<r.scrollSensitivity?n.scrollParent[0].scrollLeft=i=n.scrollParent[0].scrollLeft+r.scrollSpeed:t.pageX-n.overflowOffset.left<r.scrollSensitivity&&(n.scrollParent[0].scrollLeft=i=n.scrollParent[0].scrollLeft-r.scrollSpeed)}else{if(!r.axis||r.axis!=="x")t.pageY-e(document).scrollTop()<r.scrollSensitivity?i=e(document).scrollTop(e(document).scrollTop()-r.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<r.scrollSensitivity&&(i=e(document).scrollTop(e(document).scrollTop()+r.scrollSpeed));if(!r.axis||r.axis!=="y")t.pageX-e(document).scrollLeft()<r.scrollSensitivity?i=e(document).scrollLeft(e(document).scrollLeft()-r.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<r.scrollSensitivity&&(i=e(document).scrollLeft(e(document).scrollLeft()+r.scrollSpeed))}i!==!1&&e.ui.ddmanager&&!r.dropBehaviour&&e.ui.ddmanager.prepareOffsets(n,t)}}),e.ui.plugin.add("draggable","snap",{start:function(){var t=e(this).data("ui-draggable"),n=t.options;t.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var n=e(this),r=n.offset();this!==t.element[0]&&t.snapElements.push({item:this,width:n.outerWidth(),height:n.outerHeight(),top:r.top,left:r.left})})},drag:function(t,n){var r,i,s,o,u,a,f,l,c,h,p=e(this).data("ui-draggable"),d=p.options,v=d.snapTolerance,m=n.offset.left,g=m+p.helperProportions.width,y=n.offset.top,b=y+p.helperProportions.height;for(c=p.snapElements.length-1;c>=0;c--){u=p.snapElements[c].left,a=u+p.snapElements[c].width,f=p.snapElements[c].top,l=f+p.snapElements[c].height;if(g<u-v||m>a+v||b<f-v||y>l+v||!e.contains(p.snapElements[c].item.ownerDocument,p.snapElements[c].item)){p.snapElements[c].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=!1;continue}d.snapMode!=="inner"&&(r=Math.abs(f-b)<=v,i=Math.abs(l-y)<=v,s=Math.abs(u-g)<=v,o=Math.abs(a-m)<=v,r&&(n.position.top=p._convertPositionTo("relative",{top:f-p.helperProportions.height,left:0}).top-p.margins.top),i&&(n.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),s&&(n.position.left=p._convertPositionTo("relative",{top:0,left:u-p.helperProportions.width}).left-p.margins.left),o&&(n.position.left=p._convertPositionTo("relative",{top:0,left:a}).left-p.margins.left)),h=r||i||s||o,d.snapMode!=="outer"&&(r=Math.abs(f-y)<=v,i=Math.abs(l-b)<=v,s=Math.abs(u-m)<=v,o=Math.abs(a-g)<=v,r&&(n.position.top=p._convertPositionTo("relative",{top:f,left:0}).top-p.margins.top),i&&(n.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),s&&(n.position.left=p._convertPositionTo("relative",{top:0,left:u}).left-p.margins.left),o&&(n.position.left=p._convertPositionTo("relative",{top:0,left:a-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[c].snapping&&(r||i||s||o||h)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=r||i||s||o||h}}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,n=this.data("ui-draggable").options,r=e.makeArray(e(n.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!r.length)return;t=parseInt(e(r[0]).css("zIndex"),10)||0,e(r).each(function(n){e(this).css("zIndex",t+n)}),this.css("zIndex",t+r.length)}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n){var r=e(n.helper),i=e(this).data("ui-draggable").options;r.css("zIndex")&&(i._zIndex=r.css("zIndex")),r.css("zIndex",i.zIndex)},stop:function(t,n){var r=e(this).data("ui-draggable").options;r._zIndex&&e(n.helper).css("zIndex",r._zIndex)}})}(jQuery),function(e,t){function n(e,t,n){return e>t&&e<t+n}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,n=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(n)?n:function(e){return e.is(n)},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(){var t=0,n=e.ui.ddmanager.droppables[this.options.scope];for(;t<n.length;t++)n[t]===this&&n.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,n){t==="accept"&&(this.accept=e.isFunction(n)?n:function(e){return e.is(n)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]===this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]===this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current,i=!1;return!r||(r.currentItem||r.element)[0]===this.element[0]?!1:(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");if(t.options.greedy&&!t.options.disabled&&t.options.scope===r.options.scope&&t.accept.call(t.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(t,{offset:t.element.offset()}),t.options.tolerance))return i=!0,!1}),i?!1:this.accept.call(this.element[0],r.currentItem||r.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(r)),this.element):!1)},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,t,r){if(!t.offset)return!1;var i,s,o=(e.positionAbs||e.position.absolute).left,u=o+e.helperProportions.width,a=(e.positionAbs||e.position.absolute).top,f=a+e.helperProportions.height,l=t.offset.left,c=l+t.proportions.width,h=t.offset.top,p=h+t.proportions.height;switch(r){case"fit":return l<=o&&u<=c&&h<=a&&f<=p;case"intersect":return l<o+e.helperProportions.width/2&&u-e.helperProportions.width/2<c&&h<a+e.helperProportions.height/2&&f-e.helperProportions.height/2<p;case"pointer":return i=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,s=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,n(s,h,t.proportions.height)&&n(i,l,t.proportions.width);case"touch":return(a>=h&&a<=p||f>=h&&f<=p||a<h&&f>p)&&(o>=l&&o<=c||u>=l&&u<=c||o<l&&u>c);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r,i,s=e.ui.ddmanager.droppables[t.options.scope]||[],o=n?n.type:null,u=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(r=0;r<s.length;r++){if(s[r].options.disabled||t&&!s[r].accept.call(s[r].element[0],t.currentItem||t.element))continue;for(i=0;i<u.length;i++)if(u[i]===s[r].element[0]){s[r].proportions.height=0;continue e}s[r].visible=s[r].element.css("display")!=="none";if(!s[r].visible)continue;o==="mousedown"&&s[r]._activate.call(s[r],n),s[r].offset=s[r].element.offset(),s[r].proportions={width:s[r].element[0].offsetWidth,height:s[r].element[0].offsetHeight}}},drop:function(t,n){var r=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){if(!this.options)return;!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(r=this._drop.call(this,n)||r),!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,n))}),r},dragStart:function(t,n){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var r,i,s,o=e.ui.intersect(t,this,this.options.tolerance),u=!o&&this.isover?"isout":o&&!this.isover?"isover":null;if(!u)return;this.options.greedy&&(i=this.options.scope,s=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===i}),s.length&&(r=e.data(s[0],"ui-droppable"),r.greedyChild=u==="isover")),r&&u==="isover"&&(r.isover=!1,r.isout=!0,r._out.call(r,n)),this[u]=!0,this[u==="isout"?"isover":"isout"]=!1,this[u==="isover"?"_over":"_out"].call(this,n),r&&u==="isout"&&(r.isout=!1,r.isover=!0,r._over.call(r,n))})},dragStop:function(t,n){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}}}(jQuery),function(e,t){function n(e){return parseInt(e,10)||0}function r(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,n,r,i,s,o=this,u=this.options;this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!u.aspectRatio,aspectRatio:u.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:u.helper||u.ghost||u.animate?u.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=u.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");if(this.handles.constructor===String){this.handles==="all"&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={};for(n=0;n<t.length;n++)r=e.trim(t[n]),s="ui-resizable-"+r,i=e("<div class='ui-resizable-handle "+s+"'></div>"),i.css({zIndex:u.zIndex}),"se"===r&&i.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[r]=".ui-resizable-"+r,this.element.append(i)}this._renderAxis=function(t){var n,r,i,s;t=t||this.element;for(n in this.handles){this.handles[n].constructor===String&&(this.handles[n]=e(this.handles[n],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(r=e(this.handles[n],this.element),s=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth(),i=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize());if(!e(this.handles[n]).length)continue}},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=i&&i[1]?i[1]:"se")}),u.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(u.disabled)return;e(this).removeClass("ui-resizable-autohide"),o._handles.show()}).mouseleave(function(){if(u.disabled)return;o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,n=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&&(n(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),n(this.originalElement),this},_mouseCapture:function(t){var n,r,i=!1;for(n in this.handles){r=e(this.handles[n])[0];if(r===t.target||e.contains(r,t.target))i=!0}return!this.options.disabled&&i},_mouseStart:function(t){var r,i,s,o=this.options,u=this.element.position(),a=this.element;return this.resizing=!0,/absolute/.test(a.css("position"))?a.css({position:"absolute",top:a.css("top"),left:a.css("left")}):a.is(".ui-draggable")&&a.css({position:"absolute",top:u.top,left:u.left}),this._renderProxy(),r=n(this.helper.css("left")),i=n(this.helper.css("top")),o.containment&&(r+=e(o.containment).scrollLeft()||0,i+=e(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:r,top:i},this.size=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.originalPosition={left:r,top:i},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof o.aspectRatio=="number"?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor",s==="auto"?this.axis+"-resize":s),a.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var n,r=this.helper,i={},s=this.originalMousePosition,o=this.axis,u=this.position.top,a=this.position.left,f=this.size.width,l=this.size.height,c=t.pageX-s.left||0,h=t.pageY-s.top||0,p=this._change[o];if(!p)return!1;n=p.apply(this,[t,c,h]),this._updateVirtualBoundaries(t.shiftKey);if(this._aspectRatio||t.shiftKey)n=this._updateRatio(n,t);return n=this._respectSize(n,t),this._updateCache(n),this._propagate("resize",t),this.position.top!==u&&(i.top=this.position.top+"px"),this.position.left!==a&&(i.left=this.position.left+"px"),this.size.width!==f&&(i.width=this.size.width+"px"),this.size.height!==l&&(i.height=this.size.height+"px"),r.css(i),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(i)||this._trigger("resize",t,this.ui()),!1},_mouseStop:function(t){this.resizing=!1;var n,r,i,s,o,u,a,f=this.options,l=this;return this._helper&&(n=this._proportionallyResizeElements,r=n.length&&/textarea/i.test(n[0].nodeName),i=r&&e.ui.hasScroll(n[0],"left")?0:l.sizeDiff.height,s=r?0:l.sizeDiff.width,o={width:l.helper.width()-s,height:l.helper.height()-i},u=parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left)||null,a=parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top)||null,f.animate||this.element.css(e.extend(o,{top:a,left:u})),l.helper.height(l.size.height),l.helper.width(l.size.width),this._helper&&!f.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,i,s,o,u=this.options;o={minWidth:r(u.minWidth)?u.minWidth:0,maxWidth:r(u.maxWidth)?u.maxWidth:Infinity,minHeight:r(u.minHeight)?u.minHeight:0,maxHeight:r(u.maxHeight)?u.maxHeight:Infinity};if(this._aspectRatio||e)t=o.minHeight*this.aspectRatio,i=o.minWidth/this.aspectRatio,n=o.maxHeight*this.aspectRatio,s=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),i>o.minHeight&&(o.minHeight=i),n<o.maxWidth&&(o.maxWidth=n),s<o.maxHeight&&(o.maxHeight=s);this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset(),r(e.left)&&(this.position.left=e.left),r(e.top)&&(this.position.top=e.top),r(e.height)&&(this.size.height=e.height),r(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,n=this.size,i=this.axis;return r(e.height)?e.width=e.height*this.aspectRatio:r(e.width)&&(e.height=e.width/this.aspectRatio),i==="sw"&&(e.left=t.left+(n.width-e.width),e.top=null),i==="nw"&&(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,i=r(e.width)&&t.maxWidth&&t.maxWidth<e.width,s=r(e.height)&&t.maxHeight&&t.maxHeight<e.height,o=r(e.width)&&t.minWidth&&t.minWidth>e.width,u=r(e.height)&&t.minHeight&&t.minHeight>e.height,a=this.originalPosition.left+this.originalSize.width,f=this.position.top+this.size.height,l=/sw|nw|w/.test(n),c=/nw|ne|n/.test(n);return o&&(e.width=t.minWidth),u&&(e.height=t.minHeight),i&&(e.width=t.maxWidth),s&&(e.height=t.maxHeight),o&&l&&(e.left=a-t.minWidth),i&&l&&(e.left=a-t.maxWidth),u&&c&&(e.top=f-t.minHeight),s&&c&&(e.top=f-t.maxHeight),!e.width&&!e.height&&!e.left&&e.top?e.top=null:!e.width&&!e.height&&!e.top&&e.left&&(e.left=null),e},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length)return;var e,t,n,r,i,s=this.helper||this.element;for(e=0;e<this._proportionallyResizeElements.length;e++){i=this._proportionallyResizeElements[e];if(!this.borderDif){this.borderDif=[],n=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],r=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")];for(t=0;t<n.length;t++)this.borderDif[t]=(parseInt(n[t],10)||0)+(parseInt(r[t],10)||0)}i.css({height:s.height()-this.borderDif[0]-this.borderDif[2]||0,width:s.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var t=this.element,n=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:++n.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 n=this.originalSize,r=this.originalPosition;return{left:r.left+t,width:n.width-t}},n:function(e,t,n){var r=this.originalSize,i=this.originalPosition;return{top:i.top+n,height:r.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),t!=="resize"&&this._trigger(t,n,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 n=e(this).data("ui-resizable"),r=n.options,i=n._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&e.ui.hasScroll(i[0],"left")?0:n.sizeDiff.height,u=s?0:n.sizeDiff.width,a={width:n.size.width-u,height:n.size.height-o},f=parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left)||null,l=parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top)||null;n.element.animate(e.extend(a,l&&f?{top:l,left:f}:{}),{duration:r.animateDuration,easing:r.animateEasing,step:function(){var r={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};i&&i.length&&e(i[0]).css({width:r.width,height:r.height}),n._updateCache(r),n._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,r,i,s,o,u,a,f=e(this).data("ui-resizable"),l=f.options,c=f.element,h=l.containment,p=h instanceof e?h.get(0):/parent/.test(h)?c.parent().get(0):h;if(!p)return;f.containerElement=e(p),/document/.test(h)||h===document?(f.containerOffset={left:0,top:0},f.containerPosition={left:0,top:0},f.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(p),r=[],e(["Top","Right","Left","Bottom"]).each(function(e,i){r[e]=n(t.css("padding"+i))}),f.containerOffset=t.offset(),f.containerPosition=t.position(),f.containerSize={height:t.innerHeight()-r[3],width:t.innerWidth()-r[1]},i=f.containerOffset,s=f.containerSize.height,o=f.containerSize.width,u=e.ui.hasScroll(p,"left")?p.scrollWidth:o,a=e.ui.hasScroll(p)?p.scrollHeight:s,f.parentData={element:p,left:i.left,top:i.top,width:u,height:a})},resize:function(t){var n,r,i,s,o=e(this).data("ui-resizable"),u=o.options,a=o.containerOffset,f=o.position,l=o._aspectRatio||t.shiftKey,c={top:0,left:0},h=o.containerElement;h[0]!==document&&/static/.test(h.css("position"))&&(c=a),f.left<(o._helper?a.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-a.left:o.position.left-c.left),l&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=u.helper?a.left:0),f.top<(o._helper?a.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-a.top:o.position.top),l&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?a.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,n=Math.abs((o._helper?o.offset.left-c.left:o.offset.left-c.left)+o.sizeDiff.width),r=Math.abs((o._helper?o.offset.top-c.top:o.offset.top-a.top)+o.sizeDiff.height),i=o.containerElement.get(0)===o.element.parent().get(0),s=/relative|absolute/.test(o.containerElement.css("position")),i&&s&&(n-=o.parentData.left),n+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-n,l&&(o.size.height=o.size.width/o.aspectRatio)),r+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-r,l&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),n=t.options,r=t.containerOffset,i=t.containerPosition,s=t.containerElement,o=e(t.helper),u=o.offset(),a=o.outerWidth()-t.sizeDiff.width,f=o.outerHeight()-t.sizeDiff.height;t._helper&&!n.animate&&/relative/.test(s.css("position"))&&e(this).css({left:u.left-i.left-r.left,width:a,height:f}),t._helper&&!n.animate&&/static/.test(s.css("position"))&&e(this).css({left:u.left-i.left-r.left,width:a,height:f})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),n=t.options,r=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)})})};typeof n.alsoResize=="object"&&!n.alsoResize.parentNode?n.alsoResize.length?(n.alsoResize=n.alsoResize[0],r(n.alsoResize)):e.each(n.alsoResize,function(e){r(e)}):r(n.alsoResize)},resize:function(t,n){var r=e(this).data("ui-resizable"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0},a=function(t,r){e(t).each(function(){var t=e(this),i=e(this).data("ui-resizable-alsoresize"),s={},o=r&&r.length?r:t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var n=(i[t]||0)+(u[t]||0);n&&n>=0&&(s[t]=n||null)}),t.css(s)})};typeof i.alsoResize=="object"&&!i.alsoResize.nodeType?e.each(i.alsoResize,function(e,t){a(e,t)}):a(i.alsoResize)},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),n=t.options,r=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:r.height,width:r.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof n.ghost=="string"?n.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"),n=t.options,r=t.size,i=t.originalSize,s=t.originalPosition,o=t.axis,u=typeof n.grid=="number"?[n.grid,n.grid]:n.grid,a=u[0]||1,f=u[1]||1,l=Math.round((r.width-i.width)/a)*a,c=Math.round((r.height-i.height)/f)*f,h=i.width+l,p=i.height+c,d=n.maxWidth&&n.maxWidth<h,v=n.maxHeight&&n.maxHeight<p,m=n.minWidth&&n.minWidth>h,g=n.minHeight&&n.minHeight>p;n.grid=u,m&&(h+=a),g&&(p+=f),d&&(h-=a),v&&(p-=f),/^(se|s|e)$/.test(o)?(t.size.width=h,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=h,t.size.height=p,t.position.top=s.top-c):/^(sw)$/.test(o)?(t.size.width=h,t.size.height=p,t.position.left=s.left-l):(t.size.width=h,t.size.height=p,t.position.top=s.top-c,t.position.left=s.left-l)}})}(jQuery),function(e,t){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,n=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(n.options.filter,n.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.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 n=this,r=this.options;this.opos=[t.pageX,t.pageY];if(this.options.disabled)return;this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,!t.metaKey&&!t.ctrlKey&&(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().addBack().each(function(){var r,i=e.data(this,"selectable-item");if(i)return r=!t.metaKey&&!t.ctrlKey||!i.$element.hasClass("ui-selected"),i.$element.removeClass(r?"ui-unselecting":"ui-selected").addClass(r?"ui-selecting":"ui-unselecting"),i.unselecting=!r,i.selecting=r,i.selected=r,r?n._trigger("selecting",t,{selecting:i.element}):n._trigger("unselecting",t,{unselecting:i.element}),!1})},_mouseDrag:function(t){this.dragged=!0;if(this.options.disabled)return;var n,r=this,i=this.options,s=this.opos[0],o=this.opos[1],u=t.pageX,a=t.pageY;return s>u&&(n=u,u=s,s=n),o>a&&(n=a,a=o,o=n),this.helper.css({left:s,top:o,width:u-s,height:a-o}),this.selectees.each(function(){var n=e.data(this,"selectable-item"),f=!1;if(!n||n.element===r.element[0])return;i.tolerance==="touch"?f=!(n.left>u||n.right<s||n.top>a||n.bottom<o):i.tolerance==="fit"&&(f=n.left>s&&n.right<u&&n.top>o&&n.bottom<a),f?(n.selected&&(n.$element.removeClass("ui-selected"),n.selected=!1),n.unselecting&&(n.$element.removeClass("ui-unselecting"),n.unselecting=!1),n.selecting||(n.$element.addClass("ui-selecting"),n.selecting=!0,r._trigger("selecting",t,{selecting:n.element}))):(n.selecting&&((t.metaKey||t.ctrlKey)&&n.startselected?(n.$element.removeClass("ui-selecting"),n.selecting=!1,n.$element.addClass("ui-selected"),n.selected=!0):(n.$element.removeClass("ui-selecting"),n.selecting=!1,n.startselected&&(n.$element.addClass("ui-unselecting"),n.unselecting=!0),r._trigger("unselecting",t,{unselecting:n.element}))),n.selected&&!t.metaKey&&!t.ctrlKey&&!n.startselected&&(n.$element.removeClass("ui-selected"),n.selected=!1,n.$element.addClass("ui-unselecting"),n.unselecting=!0,r._trigger("unselecting",t,{unselecting:n.element})))}),!1},_mouseStop:function(t){var n=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-selecting").addClass("ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}})}(jQuery),function(e,t){function n(e,t,n){return e>t&&e<t+n}function r(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?e.axis==="x"||r(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,n){t==="disabled"?(this.options[t]=n,this.widget().toggleClass("ui-sortable-disabled",!!n)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,n){var r=null,i=!1,s=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type==="static")return!1;this._refreshItems(t),e(t.target).parents().each(function(){if(e.data(this,s.widgetName+"-item")===s)return r=e(this),!1}),e.data(t.target,s.widgetName+"-item")===s&&(r=e(t.target));if(!r)return!1;if(this.options.handle&&!n){e(this.options.handle,r).find("*").addBack().each(function(){this===t.target&&(i=!0)});if(!i)return!1}return this.currentItem=r,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,n,r){var i,s,o=this.options;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,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&o.cursor!=="auto"&&(s=this.document.find("body"),this.storedCursor=s.css("cursor"),s.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(s)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var n,r,i,s,o=this.options,u=!1;this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-e(document).scrollTop()<o.scrollSensitivity?u=e(document).scrollTop(e(document).scrollTop()-o.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<o.scrollSensitivity&&(u=e(document).scrollTop(e(document).scrollTop()+o.scrollSpeed)),t.pageX-e(document).scrollLeft()<o.scrollSensitivity?u=e(document).scrollLeft(e(document).scrollLeft()-o.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<o.scrollSensitivity&&(u=e(document).scrollLeft(e(document).scrollLeft()+o.scrollSpeed))),u!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!=="x")this.helper[0].style.top=this.position.top+"px";for(n=this.items.length-1;n>=0;n--){r=this.items[n],i=r.item[0],s=this._intersectsWithPointer(r);if(!s)continue;if(r.instance!==this.currentContainer)continue;if(i!==this.currentItem[0]&&this.placeholder[s===1?"next":"prev"]()[0]!==i&&!e.contains(this.placeholder[0],i)&&(this.options.type==="semi-dynamic"?!e.contains(this.element[0],i):!0)){this.direction=s===1?"down":"up";if(this.options.tolerance!=="pointer"&&!this._intersectsWithSides(r))break;this._rearrange(t,r),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,n){if(!t)return;e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t);if(this.options.revert){var r=this,i=this.placeholder.offset(),s=this.options.axis,o={};if(!s||s==="x")o.left=i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft);if(!s||s==="y")o.top=i.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(o,parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1},cancel:function(){if(this.dragging){this._mouseUp({target:null}),this.options.helper==="original"?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]),this.options.helper!=="original"&&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 n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c=this.options.axis==="x"||r+f>u&&r+f<a,h=this.options.axis==="y"||t+l>s&&t+l<o,p=c&&h;return this.options.tolerance==="pointer"||this.options.forcePointerForContainers||this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:s<t+this.helperProportions.width/2&&n-this.helperProportions.width/2<o&&u<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<a},_intersectsWithPointer:function(e){var t=this.options.axis==="x"||n(this.positionAbs.top+this.offset.click.top,e.top,e.height),r=this.options.axis==="y"||n(this.positionAbs.left+this.offset.click.left,e.left,e.width),i=t&&r,s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return i?this.floating?o&&o==="right"||s==="down"?2:1:s&&(s==="down"?2:1):!1},_intersectsWithSides:function(e){var t=n(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),r=n(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?s==="right"&&r||s==="left"&&!r:i&&(i==="down"&&t||i==="up"&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return e!==0&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!==0&&(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 n,r,i,s,o=[],u=[],a=this._connectWith();if(a&&t)for(n=a.length-1;n>=0;n--){i=e(a[n]);for(r=i.length-1;r>=0;r--)s=e.data(i[r],this.widgetFullName),s&&s!==this&&!s.options.disabled&&u.push([e.isFunction(s.options.items)?s.options.items.call(s.element):e(s.options.items,s.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),s])}u.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]);for(n=u.length-1;n>=0;n--)u[n][0].each(function(){o.push(this)});return e(o)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;n<t.length;n++)if(t[n]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var n,r,i,s,o,u,a,f,l=this.items,c=[[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(n=h.length-1;n>=0;n--){i=e(h[n]);for(r=i.length-1;r>=0;r--)s=e.data(i[r],this.widgetFullName),s&&s!==this&&!s.options.disabled&&(c.push([e.isFunction(s.options.items)?s.options.items.call(s.element[0],t,{item:this.currentItem}):e(s.options.items,s.element),s]),this.containers.push(s))}for(n=c.length-1;n>=0;n--){o=c[n][1],u=c[n][0];for(r=0,f=u.length;r<f;r++)a=e(u[r]),a.data(this.widgetName+"-item",o),l.push({item:a,instance:o,width:0,height:0,left:0,top:0})}},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var n,r,i,s;for(n=this.items.length-1;n>=0;n--){r=this.items[n];if(r.instance!==this.currentContainer&&this.currentContainer&&r.item[0]!==this.currentItem[0])continue;i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item,t||(r.width=i.outerWidth(),r.height=i.outerHeight()),s=i.offset(),r.left=s.left,r.top=s.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--)s=this.containers[n].element.offset(),this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var n,r=t.options;if(!r.placeholder||r.placeholder.constructor===String)n=r.placeholder,r.placeholder={element:function(){var r=t.currentItem[0].nodeName.toLowerCase(),i=e("<"+r+">",t.document[0]).addClass(n||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return r==="tr"?t.currentItem.children().each(function(){e("<td>&#160;</td>",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)}):r==="img"&&i.attr("src",t.currentItem.attr("src")),n||i.css("visibility","hidden"),i},update:function(e,i){if(n&&!r.forcePlaceholderSize)return;i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10))}};t.placeholder=e(r.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),r.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var i,s,o,u,a,f,l,c,h,p,d=null,v=null;for(i=this.containers.length-1;i>=0;i--){if(e.contains(this.currentItem[0],this.containers[i].element[0]))continue;if(this._intersectsWith(this.containers[i].containerCache)){if(d&&e.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],v=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0)}if(!d)return;if(this.containers.length===1)this.containers[v].containerCache.over||(this.containers[v]._trigger("over",t,this._uiHash(this)),this.containers[v].containerCache.over=1);else{o=1e4,u=null,p=d.floating||r(this.currentItem),a=p?"left":"top",f=p?"width":"height",l=this.positionAbs[a]+this.offset.click[a];for(s=this.items.length-1;s>=0;s--){if(!e.contains(this.containers[v].element[0],this.items[s].item[0]))continue;if(this.items[s].item[0]===this.currentItem[0])continue;if(p&&!n(this.positionAbs.top+this.offset.click.top,this.items[s].top,this.items[s].height))continue;c=this.items[s].item.offset()[a],h=!1,Math.abs(c-l)>Math.abs(c+this.items[s][f]-l)&&(h=!0,c+=this.items[s][f]),Math.abs(c-l)<o&&(o=Math.abs(c-l),u=this.items[s],this.direction=h?"up":"down")}if(!u&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[v])return;u?this._rearrange(t,u,null,!0):this._rearrange(t,null,this.containers[v].element,!0),this._trigger("change",t,this._uiHash()),this.containers[v]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[v],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[v]._trigger("over",t,this._uiHash(this)),this.containers[v].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):n.helper==="clone"?this.currentItem.clone():this.currentItem;return r.parents("body").length||e(n.appendTo!=="parent"?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[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")}),(!r[0].style.width||n.forceHelperSize)&&r.width(this.currentItem.width()),(!r[0].style.height||n.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(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();this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){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,n,r,i=this.options;i.containment==="parent"&&(i.containment=this.helper[0].parentNode);if(i.containment==="document"||i.containment==="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e(i.containment==="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e(i.containment==="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];/^(document|window|parent)$/.test(i.containment)||(t=e(i.containment)[0],n=e(i.containment).offset(),r=e(t).css("overflow")!=="hidden",this.containment=[n.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?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,n.top+(r?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,n){n||(n=this.position);var r=t==="absolute"?1:-1,i=this.cssPosition!=="absolute"||this.scrollParent[0]!==document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(i[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():s?0:i.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():s?0:i.scrollLeft())*r}},_generatePosition:function(t){var n,r,i=this.options,s=t.pageX,o=t.pageY,u=this.cssPosition!=="absolute"||this.scrollParent[0]!==document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(u[0].tagName);return this.cssPosition==="relative"&&(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]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),i.grid&&(n=this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1],o=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-i.grid[1]:n+i.grid[1]:n,r=this.originalPageX+Math.round((s-this.originalPageX)/i.grid[0])*i.grid[0],s=this.containment?r-this.offset.click.left>=this.containment[0]&&r-this.offset.click.left<=this.containment[2]?r:r-this.offset.click.left>=this.containment[0]?r-i.grid[0]:r+i.grid[0]:r)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():a?0:u.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():a?0:u.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction==="down"?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i===this.counter&&this.refreshPositions(!r)})},_clear:function(e,t){this.reverting=!1;var n,r=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)if(this._storedCSS[n]==="auto"||this._storedCSS[n]==="static")this._storedCSS[n]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!t&&r.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&&r.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(r.push(function(e){this._trigger("remove",e,this._uiHash())}),r.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))));for(n=this.containers.length-1;n>=0;n--)t||r.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[n])),this.containers[n].containerCache.over&&(r.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[n])),this.containers[n].containerCache.over=0);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",this._storedZIndex==="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!t){this._trigger("beforeStop",e,this._uiHash());for(n=0;n<r.length;n++)r[n].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}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;if(!t){for(n=0;n<r.length;n++)r[n].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 n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}})}(jQuery),function(e,t){var n="ui-effects-";e.effects={effect:{}},function(e,t){function h(e,t,n){var r=u[t.type]||{};return e==null?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:r.max<e?r.max:e)}function p(t){var n=s(),r=n._rgba=[];return t=t.toLowerCase(),c(i,function(e,i){var s,u=i.re.exec(t),a=u&&i.parse(u),f=i.space||"rgba";if(a)return s=n[f](a),n[o[f].cache]=s[o[f].cache],r=n._rgba=s._rgba,!1}),r.length?(r.join()==="0,0,0,0"&&e.extend(r,l.transparent),n):l[t]}function d(e,t,n){return n=(n+1)%1,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var n="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,i=[{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[e[1]*2.55,e[2]*2.55,e[3]*2.55,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]]}}],s=e.Color=function(t,n,r,i){return new e.Color.fn.parse(t,n,r,i)},o={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"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},a=s.support={},f=e("<p>")[0],l,c=e.each;f.style.cssText="background-color:rgba(1,1,1,.5)",a.rgba=f.style.backgroundColor.indexOf("rgba")>-1,c(o,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),s.fn=e.extend(s.prototype,{parse:function(n,r,i,u){if(n===t)return this._rgba=[null,null,null,null],this;if(n.jquery||n.nodeType)n=e(n).css(r),r=t;var a=this,f=e.type(n),d=this._rgba=[];r!==t&&(n=[n,r,i,u],f="array");if(f==="string")return this.parse(p(n)||l._default);if(f==="array")return c(o.rgba.props,function(e,t){d[t.idx]=h(n[t.idx],t)}),this;if(f==="object")return n instanceof s?c(o,function(e,t){n[t.cache]&&(a[t.cache]=n[t.cache].slice())}):c(o,function(t,r){var i=r.cache;c(r.props,function(e,t){if(!a[i]&&r.to){if(e==="alpha"||n[e]==null)return;a[i]=r.to(a._rgba)}a[i][t.idx]=h(n[e],t,!0)}),a[i]&&e.inArray(null,a[i].slice(0,3))<0&&(a[i][3]=1,r.from&&(a._rgba=r.from(a[i])))}),this},is:function(e){var t=s(e),n=!0,r=this;return c(o,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],c(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return c(o,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=s(e),r=n._space(),i=o[r],a=this.alpha()===0?s("transparent"):this,f=a[i.cache]||i.to(a._rgba),l=f.slice();return n=n[i.cache],c(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],a=u[r.type]||{};if(o===null)return;s===null?l[i]=o:(a.mod&&(o-s>a.mod/2?s+=a.mod:s-o>a.mod/2&&(s-=a.mod)),l[i]=h((o-s)*t+s,r))}),this[r](l)},blend:function(t){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=s(t)._rgba;return s(e.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var t="rgba(",n=e.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),t="rgb("),t+n.join()+")"},toHslaString:function(){var t="hsla(",n=e.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),t="hsl("),t+n.join()+")"},toHexString:function(t){var n=this._rgba.slice(),r=n.pop();return t&&n.push(~~(r*255)),"#"+e.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),s.fn.parse.prototype=s.fn,o.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,u===0?c=0:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},o.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(d(o,s,t+1/3)*255),Math.round(d(o,s,t)*255),Math.round(d(o,s,t-1/3)*255),i]},c(o,function(n,i){var o=i.props,u=i.cache,a=i.to,f=i.from;s.fn[n]=function(n){a&&!this[u]&&(this[u]=a(this._rgba));if(n===t)return this[u].slice();var r,i=e.type(n),l=i==="array"||i==="object"?n:arguments,p=this[u].slice();return c(o,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=p[t.idx]),p[t.idx]=h(n,t)}),f?(r=s(f(p)),r[u]=p,r):s(p)},c(o,function(t,i){if(s.fn[t])return;s.fn[t]=function(s){var o=e.type(s),u=t==="alpha"?this._hsla?"hsla":"rgba":n,a=this[u](),f=a[i.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=e.type(s)),s==null&&i.empty?this:(o==="string"&&(l=r.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[i.idx]=s,this[u](a)))}})}),s.hook=function(t){var n=t.split(" ");c(n,function(t,n){e.cssHooks[n]={set:function(t,r){var i,o,u="";if(r!=="transparent"&&(e.type(r)!=="string"||(i=p(r)))){r=s(i||r);if(!a.rgba&&r._rgba[3]!==1){o=n==="backgroundColor"?t.parentNode:t;while((u===""||u==="transparent")&&o&&o.style)try{u=e.css(o,"backgroundColor"),o=o.parentNode}catch(f){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{t.style[n]=r}catch(f){}}},e.fx.step[n]=function(t){t.colorInit||(t.start=s(t.elem,n),t.end=s(t.end),t.colorInit=!0),e.cssHooks[n].set(t.elem,t.start.transition(t.end,t.pos))}})},s.hook(n),e.cssHooks.borderColor={expand:function(e){var t={};return c(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},l=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 n,r,i=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,s={};if(i&&i.length&&i[0]&&i[i[0]]){r=i.length;while(r--)n=i[r],typeof i[n]=="string"&&(s[e.camelCase(n)]=i[n])}else for(n in i)typeof i[n]=="string"&&(s[n]=i[n]);return s}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={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,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").addBack():r;f=f.map(function(){var t=e(this);return{el:t,start:i(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=e.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({addClass:function(t){return function(n,r,i,s){return r?e.effects.animateClass.call(this,{add:n},r,i,s):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(n,r,i,s){return arguments.length>1?e.effects.animateClass.call(this,{remove:n},r,i,s):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(n){return function(r,i,s,o,u){return typeof i=="boolean"||i===t?s?e.effects.animateClass.call(this,i?{add:r}:{remove:r},s,o,u):n.apply(this,arguments):e.effects.animateClass.call(this,{toggle:r},i,s,o)}}(e.fn.toggleClass),switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function r(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function i(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?!0:e.isFunction(t)?!0:typeof t=="object"&&!t.effect?!0:!1}e.extend(e.effects,{version:"1.10.3",save:function(e,t){for(var r=0;r<t.length;r++)t[r]!==null&&e.data(n+t[r],e[0].style[t[r]])},restore:function(e,r){var i,s;for(s=0;s<r.length;s++)r[s]!==null&&(i=e.data(n+r[s]),i===t&&(i=""),e.css(r[s],i))},setMode:function(e,t){return t==="toggle"&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var n,r;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=e[1]/t.width}return{x:r,y:n}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var n={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},r=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function o(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,o=t.mode;(r.is(":hidden")?o==="hide":o==="show")?(r[o](),u()):s.call(r[0],t,u)}var t=r.apply(this,arguments),n=t.mode,i=t.queue,s=e.effects.effect[t.effect];return e.fx.off||!s?n?this[n](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):i===!1?this.each(o):this.queue(i||"fx",o)},show:function(e){return function(t){if(i(t))return e.apply(this,arguments);var n=r.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(t){if(i(t))return e.apply(this,arguments);var n=r.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(t){if(i(t)||typeof t=="boolean")return e.apply(this,arguments);var n=r.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=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 e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery),function(e,t){var n=0,r={},i={};r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="hide",i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.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||t.active==null)&&(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")}),this.options.heightStyle!=="content"&&e.css("height","")},_setOption:function(e,t){if(e==="active"){this._activate(t);return}e==="event"&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),e==="collapsible"&&!t&&this.options.active===!1&&this._activate(0),e==="icons"&&(this._destroyIcons(),t&&this._createIcons()),e==="disabled"&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)},_keydown:function(t){if(t.altKey||t.ctrlKey)return;var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._eventHandler(t);break;case n.HOME:s=this.headers[0];break;case n.END:s=this.headers[r-1]}s&&(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),s.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 t,r=this.options,i=r.heightStyle,s=this.element.parent(),o=this.accordionId="ui-accordion-"+(this.element.attr("id")||++n);this.active=this._findActive(r.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 n=e(this),r=n.attr("id"),i=n.next(),s=i.attr("id");r||(r=o+"-header-"+t,n.attr("id",r)),s||(s=o+"-panel-"+t,i.attr("id",s)),n.attr("aria-controls",s),i.attr("aria-labelledby",r)}).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(r.event),i==="fill"?(t=s.height(),this.element.siblings(":visible").each(function(){var n=e(this),r=n.css("position");if(r==="absolute"||r==="fixed")return;t-=n.outerHeight(!0)}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):i==="auto"&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var n=this._findActive(t)[0];if(n===this.active[0])return;n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return typeof t=="number"?this.headers.eq(t):e()},_setupEvents:function(t){var n={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,n),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i[0]===r[0],o=s&&n.collapsible,u=o?e():i.next(),a=r.next(),f={oldHeader:r,oldPanel:a,newHeader:o?e():i,newPanel:u};t.preventDefault();if(s&&!n.collapsible||this._trigger("beforeActivate",t,f)===!1)return;n.active=o?!1:this.headers.index(i),this.active=s?e():i,this._toggle(f),r.removeClass("ui-accordion-header-active ui-state-active"),n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),s||(i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),i.next().addClass("ui-accordion-content-active"))},_toggle:function(t){var n=t.newPanel,r=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=r,this.options.animate?this._animate(n,r,t):(r.hide(),n.show(),this._toggleComplete(t)),r.attr({"aria-expanded":"false","aria-hidden":"true"}),r.prev().attr("aria-selected","false"),n.length&&r.length?r.prev().attr("tabIndex",-1):n.length&&this.headers.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),n.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,n){var s,o,u,a=this,f=0,l=e.length&&(!t.length||e.index()<t.index()),c=this.options.animate||{},h=l&&c.down||c,p=function(){a._toggleComplete(n)};typeof h=="number"&&(u=h),typeof h=="string"&&(o=h),o=o||h.easing||c.easing,u=u||h.duration||c.duration;if(!t.length)return e.animate(i,u,o,p);if(!e.length)return t.animate(r,u,o,p);s=e.show().outerHeight(),t.animate(r,{duration:u,easing:o,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(i,{duration:u,easing:o,complete:p,step:function(e,n){n.now=Math.round(e),n.prop!=="height"?f+=n.now:a.options.heightStyle!=="content"&&(n.now=Math.round(s-t.outerHeight()-f),f=0)}})},_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,t){var n=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,n,r,i=this.element[0].nodeName.toLowerCase(),s=i==="textarea",o=i==="input";this.isMultiLine=s?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[s||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly")){t=!0,r=!0,n=!0;return}t=!1,r=!1,n=!1;var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",i);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",i);break;case s.UP:t=!0,this._keyEvent("previous",i);break;case s.DOWN:t=!0,this._keyEvent("next",i);break;case s.ENTER:case s.NUMPAD_ENTER:this.menu.active&&(t=!0,i.preventDefault(),this.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault());break;default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(t){t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&r.preventDefault();return}if(n)return;var i=e.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}},input:function(e){if(r){r=!1,e.preventDefault();return}this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(this.searching),this.close(e),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 n=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(r){r.target!==t.element[0]&&r.target!==n&&!e.contains(n,r.target)&&t.close()})})},menufocus:function(t,n){if(this.isNewMenu){this.isNewMenu=!1;if(t.originalEvent&&/^mouse/.test(t.originalEvent.type)){this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)});return}}var r=n.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:r})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(r.value):this.liveRegion.text(r.value)},menuselect:function(e,t){var n=t.item.data("ui-autocomplete-item"),r=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=r,this._delay(function(){this.previous=r,this.selectedItem=n})),!1!==this._trigger("select",e,{item:n})&&this._value(n.value),this.term=this._value(),this.close(e),this.selectedItem=n}}),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),e==="source"&&this._initSource(),e==="appendTo"&&this.menu.element.appendTo(this._appendTo()),e==="disabled"&&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,n,r=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(n,r){r(e.ui.autocomplete.filter(t,n.term))}):typeof this.options.source=="string"?(n=this.options.source,this.source=function(t,i){r.xhr&&r.xhr.abort(),r.xhr=e.ajax({url:n,data:t,dataType:"json",success:function(e){i(e)},error:function(){i([])}})}):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){e=e!=null?e:this._value(),this.term=this._value();if(e.length<this.options.minLength)return this.close(t);if(this._trigger("search",t)===!1)return;return this._search(e)},_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,t=++n;return function(r){t===n&&e.__response(r),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 typeof t=="string"?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var n=this.menu.element.empty();this._renderMenu(n,t),this.isNewMenu=!0,this.menu.refresh(),n.show(),this._resizeMenu(),n.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,n){var r=this;e.each(n,function(e,n){r._renderItemData(t,n)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,n){return e("<li>").append(e("<a>").text(n.label)).appendTo(t)},_move:function(e,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}if(this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)){this._value(this.term),this.menu.blur();return}this.menu[e](t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){if(!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,n){var r=new RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.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);if(this.options.disabled||this.cancelSearch)return;e&&e.length?t=this.options.messages.results(e.length):t=this.options.messages.noResults,this.liveRegion.text(t)}})}(jQuery),function(e,t){var n,r,i,s,o="ui-button ui-widget ui-state-default ui-corner-all",u="ui-state-hover ui-state-active ",a="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",f=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},l=function(t){var n=t.name,r=t.form,i=e([]);return n&&(n=n.replace(/'/g,"\\'"),r?i=e(r).find("[name='"+n+"']"):i=e("[name='"+n+"']",t.ownerDocument).filter(function(){return!this.form})),i};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,f),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,u=this.options,a=this.type==="checkbox"||this.type==="radio",c=a?"":"ui-state-active",h="ui-state-focus";u.label===null&&(u.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(u.disabled)return;this===n&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){if(u.disabled)return;e(this).removeClass(c)}).bind("click"+this.eventNamespace,function(e){u.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){t.buttonElement.addClass(h)}).bind("blur"+this.eventNamespace,function(){t.buttonElement.removeClass(h)}),a&&(this.element.bind("change"+this.eventNamespace,function(){if(s)return;t.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){if(u.disabled)return;s=!1,r=e.pageX,i=e.pageY}).bind("mouseup"+this.eventNamespace,function(e){if(u.disabled)return;if(r!==e.pageX||i!==e.pageY)s=!0})),this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var n=t.element[0];l(n).not(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).addClass("ui-state-active"),n=this,t.document.one("mouseup",function(){n=null})}).bind("mouseup"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(u.disabled)return!1;(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",u.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button",this.type==="checkbox"||this.type==="radio"?(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"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+u+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){this._super(e,t);if(e==="disabled"){t?this.element.prop("disabled",!0):this.element.prop("disabled",!1);return}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),this.type==="radio"?l(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")}):this.type==="checkbox"&&(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(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var t=this.buttonElement.removeClass(a),n=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+r.primary+"'></span>"),r.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+r.secondary+"'></span>"),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.push("ui-button-text-only"),t.addClass(s.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){e==="disabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t=this.element.css("direction")==="rtl";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=s(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(t){var n="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(n,"mouseout",function(){e(this).removeClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&e(this).removeClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(n,"mouseover",function(){e.datepicker._isDisabledDatepicker(r.inline?t.parent()[0]:r.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&e(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&e(this).addClass("ui-datepicker-next-hover"))})}function o(t,n){e.extend(t,n);for(var r in n)n[r]==null&&(t[r]=n[r]);return t}e.extend(e.ui,{datepicker:{version:"1.10.3"}});var n="datepicker",r;e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return o(this._defaults,e||{}),this},_attachDatepicker:function(t,n){var r,i,s;r=t.nodeName.toLowerCase(),i=r==="div"||r==="span",t.id||(this.uuid+=1,t.id="dp"+this.uuid),s=this._newInst(e(t),i),s.settings=e.extend({},n||{}),r==="input"?this._connectDatepicker(t,s):i&&this._inlineDatepicker(t,s)},_newInst:function(t,n){var r=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:r,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:n,dpDiv:n?s(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,r){var i=e(t);r.append=e([]),r.trigger=e([]);if(i.hasClass(this.markerClassName))return;this._attachments(i,r),i.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(r),e.data(t,n,r),r.settings.disabled&&this._disableDatepicker(t)},_attachments:function(t,n){var r,i,s,o=this._get(n,"appendText"),u=this._get(n,"isRTL");n.append&&n.append.remove(),o&&(n.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[u?"before":"after"](n.append)),t.unbind("focus",this._showDatepicker),n.trigger&&n.trigger.remove(),r=this._get(n,"showOn"),(r==="focus"||r==="both")&&t.focus(this._showDatepicker);if(r==="button"||r==="both")i=this._get(n,"buttonText"),s=this._get(n,"buttonImage"),n.trigger=e(this._get(n,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:s,alt:i,title:i}):e("<button type='button'></button>").addClass(this._triggerClass).html(s?e("<img/>").attr({src:s,alt:i,title:i}):i)),t[u?"before":"after"](n.trigger),n.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,n,r,i,s=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){n=0,r=0;for(i=0;i<e.length;i++)e[i].length>n&&(n=e[i].length,r=i);return r},s.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),s.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-s.getDay())),e.input.attr("size",this._formatDate(e,s).length)}},_inlineDatepicker:function(t,r){var i=e(t);if(i.hasClass(this.markerClassName))return;i.addClass(this.markerClassName).append(r.dpDiv),e.data(t,n,r),this._setDate(r,this._getDefaultDate(r),!0),this._updateDatepicker(r),this._updateAlternate(r),r.settings.disabled&&this._disableDatepicker(t),r.dpDiv.css("display","block")},_dialogDatepicker:function(t,r,i,s,u){var a,f,l,c,h,p=this._dialogInst;return p||(this.uuid+=1,a="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+a+"' 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],n,p)),o(p.settings,s||{}),r=r&&r.constructor===Date?this._formatDate(p,r):r,this._dialogInput.val(r),this._pos=u?u.length?u:[u.pageX,u.pageY]:null,this._pos||(f=document.documentElement.clientWidth,l=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,h=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[f/2-100+c,l/2-150+h]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],n,p),this},_destroyDatepicker:function(t){var r,i=e(t),s=e.data(t,n);if(!i.hasClass(this.markerClassName))return;r=t.nodeName.toLowerCase(),e.removeData(t,n),r==="input"?(s.append.remove(),s.trigger.remove(),i.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(r==="div"||r==="span")&&i.removeClass(this.markerClassName).empty()},_enableDatepicker:function(t){var r,i,s=e(t),o=e.data(t,n);if(!s.hasClass(this.markerClassName))return;r=t.nodeName.toLowerCase();if(r==="input")t.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(r==="div"||r==="span")i=s.children("."+this._inlineClass),i.children().removeClass("ui-state-disabled"),i.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 r,i,s=e(t),o=e.data(t,n);if(!s.hasClass(this.markerClassName))return;r=t.nodeName.toLowerCase();if(r==="input")t.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(r==="div"||r==="span")i=s.children("."+this._inlineClass),i.children().addClass("ui-state-disabled"),i.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,n)}catch(r){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(n,r,i){var s,u,a,f,l=this._getInst(n);if(arguments.length===2&&typeof r=="string")return r==="defaults"?e.extend({},e.datepicker._defaults):l?r==="all"?e.extend({},l.settings):this._get(l,r):null;s=r||{},typeof r=="string"&&(s={},s[r]=i),l&&(this._curInst===l&&this._hideDatepicker(),u=this._getDateDatepicker(n,!0),a=this._getMinMaxDate(l,"min"),f=this._getMinMaxDate(l,"max"),o(l.settings,s),a!==null&&s.dateFormat!==t&&s.minDate===t&&(l.settings.minDate=this._formatDate(l,a)),f!==null&&s.dateFormat!==t&&s.maxDate===t&&(l.settings.maxDate=this._formatDate(l,f)),"disabled"in s&&(s.disabled?this._disableDatepicker(n):this._enableDatepicker(n)),this._attachments(e(n),l),this._autoSize(l),this._setDate(l,u),this._updateAlternate(l),this._updateDatepicker(l))},_changeDatepicker:function(e,t,n){this._optionDatepicker(e,t,n)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var n=this._getInst(e);n&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(e,t){var n=this._getInst(e);return n&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(t){var n,r,i,s=e.datepicker._getInst(t.target),o=!0,u=s.dpDiv.is(".ui-datepicker-rtl");s._keyEvent=!0;if(e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return i=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",s.dpDiv),i[0]&&e.datepicker._selectDay(t.target,s.selectedMonth,s.selectedYear,i[0]),n=e.datepicker._get(s,"onSelect"),n?(r=e.datepicker._formatDate(s),n.apply(s.input?s.input[0]:null,[r,s])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(s,"stepBigMonths"):-e.datepicker._get(s,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(s,"stepBigMonths"):+e.datepicker._get(s,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,u?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(s,"stepBigMonths"):-e.datepicker._get(s,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,u?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(s,"stepBigMonths"):+e.datepicker._get(s,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else t.keyCode===36&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var n,r,i=e.datepicker._getInst(t.target);if(e.datepicker._get(i,"constrainInput"))return n=e.datepicker._possibleChars(e.datepicker._get(i,"dateFormat")),r=String.fromCharCode(t.charCode==null?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||r<" "||!n||n.indexOf(r)>-1},_doKeyUp:function(t){var n,r=e.datepicker._getInst(t.target);if(r.input.val()!==r.lastVal)try{n=e.datepicker.parseDate(e.datepicker._get(r,"dateFormat"),r.input?r.input.val():null,e.datepicker._getFormatConfig(r)),n&&(e.datepicker._setDateFromField(r),e.datepicker._updateAlternate(r),e.datepicker._updateDatepicker(r))}catch(i){}return!0},_showDatepicker:function(t){t=t.target||t,t.nodeName.toLowerCase()!=="input"&&(t=e("input",t.parentNode)[0]);if(e.datepicker._isDisabledDatepicker(t)||e.datepicker._lastInput===t)return;var n,r,i,s,u,a,f;n=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==n&&(e.datepicker._curInst.dpDiv.stop(!0,!0),n&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),r=e.datepicker._get(n,"beforeShow"),i=r?r.apply(t,[t,n]):{};if(i===!1)return;o(n.settings,i),n.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(n),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),s=!1,e(t).parents().each(function(){return s|=e(this).css("position")==="fixed",!s}),u={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(n),u=e.datepicker._checkOffset(n,u,s),n.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":s?"fixed":"absolute",display:"none",left:u.left+"px",top:u.top+"px"}),n.inline||(a=e.datepicker._get(n,"showAnim"),f=e.datepicker._get(n,"duration"),n.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[a]?n.dpDiv.show(a,e.datepicker._get(n,"showOptions"),f):n.dpDiv[a||"show"](a?f:null),e.datepicker._shouldFocusInput(n)&&n.input.focus(),e.datepicker._curInst=n)},_updateDatepicker:function(t){this.maxRows=4,r=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var n,i=this._getNumberOfMonths(t),s=i[1],o=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",o*s+"em"),t.dpDiv[(i[0]!==1||i[1]!==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&&(n=t.yearshtml,setTimeout(function(){n===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),n=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,n,r){var i=t.dpDiv.outerWidth(),s=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,u=t.input?t.input.outerHeight():0,a=document.documentElement.clientWidth+(r?0:e(document).scrollLeft()),f=document.documentElement.clientHeight+(r?0:e(document).scrollTop());return n.left-=this._get(t,"isRTL")?i-o:0,n.left-=r&&n.left===t.input.offset().left?e(document).scrollLeft():0,n.top-=r&&n.top===t.input.offset().top+u?e(document).scrollTop():0,n.left-=Math.min(n.left,n.left+i>a&&a>i?Math.abs(n.left+i-a):0),n.top-=Math.min(n.top,n.top+s>f&&f>s?Math.abs(s+u):0),n},_findPos:function(t){var n,r=this._getInst(t),i=this._get(r,"isRTL");while(t&&(t.type==="hidden"||t.nodeType!==1||e.expr.filters.hidden(t)))t=t[i?"previousSibling":"nextSibling"];return n=e(t).offset(),[n.left,n.top]},_hideDatepicker:function(t){var r,i,s,o,u=this._curInst;if(!u||t&&u!==e.data(t,n))return;this._datepickerShowing&&(r=this._get(u,"showAnim"),i=this._get(u,"duration"),s=function(){e.datepicker._tidyDialog(u)},e.effects&&(e.effects.effect[r]||e.effects[r])?u.dpDiv.hide(r,e.datepicker._get(u,"showOptions"),i,s):u.dpDiv[r==="slideDown"?"slideUp":r==="fadeIn"?"fadeOut":"hide"](r?i:null,s),r||s(),this._datepickerShowing=!1,o=this._get(u,"onClose"),o&&o.apply(u.input?u.input[0]:null,[u.input?u.input.val():"",u]),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)return;var n=e(t.target),r=e.datepicker._getInst(n[0]);(n[0].id!==e.datepicker._mainDivId&&n.parents("#"+e.datepicker._mainDivId).length===0&&!n.hasClass(e.datepicker.markerClassName)&&!n.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||n.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==r)&&e.datepicker._hideDatepicker()},_adjustDate:function(t,n,r){var i=e(t),s=this._getInst(i[0]);if(this._isDisabledDatepicker(i[0]))return;this._adjustInstDate(s,n+(r==="M"?this._get(s,"showCurrentAtPos"):0),r),this._updateDatepicker(s)},_gotoToday:function(t){var n,r=e(t),i=this._getInst(r[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(n=new Date,i.selectedDay=n.getDate(),i.drawMonth=i.selectedMonth=n.getMonth(),i.drawYear=i.selectedYear=n.getFullYear()),this._notifyChange(i),this._adjustDate(r)},_selectMonthYear:function(t,n,r){var i=e(t),s=this._getInst(i[0]);s["selected"+(r==="M"?"Month":"Year")]=s["draw"+(r==="M"?"Month":"Year")]=parseInt(n.options[n.selectedIndex].value,10),this._notifyChange(s),this._adjustDate(i)},_selectDay:function(t,n,r,i){var s,o=e(t);if(e(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0]))return;s=this._getInst(o[0]),s.selectedDay=s.currentDay=e("a",i).html(),s.selectedMonth=s.currentMonth=n,s.selectedYear=s.currentYear=r,this._selectDate(t,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear))},_clearDate:function(t){var n=e(t);this._selectDate(n,"")},_selectDate:function(t,n){var r,i=e(t),s=this._getInst(i[0]);n=n!=null?n:this._formatDate(s),s.input&&s.input.val(n),this._updateAlternate(s),r=this._get(s,"onSelect"),r?r.apply(s.input?s.input[0]:null,[n,s]):s.input&&s.input.trigger("change"),s.inline?this._updateDatepicker(s):(this._hideDatepicker(),this._lastInput=s.input[0],typeof s.input[0]!="object"&&s.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var n,r,i,s=this._get(t,"altField");s&&(n=this._get(t,"altFormat")||this._get(t,"dateFormat"),r=this._getDate(t),i=this.formatDate(n,r,this._getFormatConfig(t)),e(s).each(function(){e(this).val(i)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},iso8601Week:function(e){var t,n=new Date(e.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),t=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((t-n)/864e5)/7)+1},parseDate:function(t,n,r){if(t==null||n==null)throw"Invalid arguments";n=typeof n=="object"?n.toString():n+"";if(n==="")return null;var i,s,o,u=0,a=(r?r.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=typeof a!="string"?a:(new Date).getFullYear()%100+parseInt(a,10),l=(r?r.dayNamesShort:null)||this._defaults.dayNamesShort,c=(r?r.dayNames:null)||this._defaults.dayNames,h=(r?r.monthNamesShort:null)||this._defaults.monthNamesShort,p=(r?r.monthNames:null)||this._defaults.monthNames,d=-1,v=-1,m=-1,g=-1,y=!1,b,w=function(e){var n=i+1<t.length&&t.charAt(i+1)===e;return n&&i++,n},E=function(e){var t=w(e),r=e==="@"?14:e==="!"?20:e==="y"&&t?4:e==="o"?3:2,i=new RegExp("^\\d{1,"+r+"}"),s=n.substring(u).match(i);if(!s)throw"Missing number at position "+u;return u+=s[0].length,parseInt(s[0],10)},S=function(t,r,i){var s=-1,o=e.map(w(t)?i:r,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});e.each(o,function(e,t){var r=t[1];if(n.substr(u,r.length).toLowerCase()===r.toLowerCase())return s=t[0],u+=r.length,!1});if(s!==-1)return s+1;throw"Unknown name at position "+u},x=function(){if(n.charAt(u)!==t.charAt(i))throw"Unexpected literal at position "+u;u++};for(i=0;i<t.length;i++)if(y)t.charAt(i)==="'"&&!w("'")?y=!1:x();else switch(t.charAt(i)){case"d":m=E("d");break;case"D":S("D",l,c);break;case"o":g=E("o");break;case"m":v=E("m");break;case"M":v=S("M",h,p);break;case"y":d=E("y");break;case"@":b=new Date(E("@")),d=b.getFullYear(),v=b.getMonth()+1,m=b.getDate();break;case"!":b=new Date((E("!")-this._ticksTo1970)/1e4),d=b.getFullYear(),v=b.getMonth()+1,m=b.getDate();break;case"'":w("'")?x():y=!0;break;default:x()}if(u<n.length){o=n.substr(u);if(!/^\s+/.test(o))throw"Extra/unparsed characters found in date: "+o}d===-1?d=(new Date).getFullYear():d<100&&(d+=(new Date).getFullYear()-(new Date).getFullYear()%100+(d<=f?0:-100));if(g>-1){v=1,m=g;do{s=this._getDaysInMonth(d,v-1);if(m<=s)break;v++,m-=s}while(!0)}b=this._daylightSavingAdjust(new Date(d,v-1,m));if(b.getFullYear()!==d||b.getMonth()+1!==v||b.getDate()!==m)throw"Invalid date";return b},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:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(e,t,n){if(!t)return"";var r,i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=function(t){var n=r+1<e.length&&e.charAt(r+1)===t;return n&&r++,n},f=function(e,t,n){var r=""+t;if(a(e))while(r.length<n)r="0"+r;return r},l=function(e,t,n,r){return a(e)?r[t]:n[t]},c="",h=!1;if(t)for(r=0;r<e.length;r++)if(h)e.charAt(r)==="'"&&!a("'")?h=!1:c+=e.charAt(r);else switch(e.charAt(r)){case"d":c+=f("d",t.getDate(),2);break;case"D":c+=l("D",t.getDay(),i,s);break;case"o":c+=f("o",Math.round(((new Date(t.getFullYear(),t.getMonth(),t.getDate())).getTime()-(new Date(t.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":c+=f("m",t.getMonth()+1,2);break;case"M":c+=l("M",t.getMonth(),o,u);break;case"y":c+=a("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":c+=t.getTime();break;case"!":c+=t.getTime()*1e4+this._ticksTo1970;break;case"'":a("'")?c+="'":h=!0;break;default:c+=e.charAt(r)}return c},_possibleChars:function(e){var t,n="",r=!1,i=function(n){var r=t+1<e.length&&e.charAt(t+1)===n;return r&&t++,r};for(t=0;t<e.length;t++)if(r)e.charAt(t)==="'"&&!i("'")?r=!1:n+=e.charAt(t);else switch(e.charAt(t)){case"d":case"m":case"y":case"@":n+="0123456789";break;case"D":case"M":return null;case"'":i("'")?n+="'":r=!0;break;default:n+=e.charAt(t)}return n},_get:function(e,n){return e.settings[n]!==t?e.settings[n]:this._defaults[n]},_setDateFromField:function(e,t){if(e.input.val()===e.lastVal)return;var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i=this._getDefaultDate(e),s=i,o=this._getFormatConfig(e);try{s=this.parseDate(n,r,o)||i}catch(u){r=t?"":r}e.selectedDay=s.getDate(),e.drawMonth=e.selectedMonth=s.getMonth(),e.drawYear=e.selectedYear=s.getFullYear(),e.currentDay=r?s.getDate():0,e.currentMonth=r?s.getMonth():0,e.currentYear=r?s.getFullYear():0,this._adjustInstDate(e)},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,n,r){var i=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},s=function(n){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),n,e.datepicker._getFormatConfig(t))}catch(r){}var i=(n.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,s=i.getFullYear(),o=i.getMonth(),u=i.getDate(),a=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,f=a.exec(n);while(f){switch(f[2]||"d"){case"d":case"D":u+=parseInt(f[1],10);break;case"w":case"W":u+=parseInt(f[1],10)*7;break;case"m":case"M":o+=parseInt(f[1],10),u=Math.min(u,e.datepicker._getDaysInMonth(s,o));break;case"y":case"Y":s+=parseInt(f[1],10),u=Math.min(u,e.datepicker._getDaysInMonth(s,o))}f=a.exec(n)}return new Date(s,o,u)},o=n==null||n===""?r:typeof n=="string"?s(n):typeof n=="number"?isNaN(n)?r:i(n):new Date(n.getTime());return o=o&&o.toString()==="Invalid Date"?r:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),(i!==e.selectedMonth||s!==e.selectedYear)&&!n&&this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":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 n=this._get(t,"stepMonths"),r="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(r,-n,"M")},next:function(){e.datepicker._adjustDate(r,+n,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(r)},selectDay:function(){return e.datepicker._selectDay(r,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(r,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(r,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q=new Date,R=this._daylightSavingAdjust(new Date(q.getFullYear(),q.getMonth(),q.getDate())),U=this._get(e,"isRTL"),z=this._get(e,"showButtonPanel"),W=this._get(e,"hideIfNoPrevNext"),X=this._get(e,"navigationAsDateFormat"),V=this._getNumberOfMonths(e),$=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),K=V[0]!==1||V[1]!==1,Q=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(e,"min"),Y=this._getMinMaxDate(e,"max"),Z=e.drawMonth-$,et=e.drawYear;Z<0&&(Z+=12,et--);if(Y){t=this._daylightSavingAdjust(new Date(Y.getFullYear(),Y.getMonth()-V[0]*V[1]+1,Y.getDate())),t=G&&t<G?G:t;while(this._daylightSavingAdjust(new Date(et,Z,1))>t)Z--,Z<0&&(Z=11,et--)}e.drawMonth=Z,e.drawYear=et,n=this._get(e,"prevText"),n=X?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):n,r=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+n+"</span></a>":W?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+n+"</span></a>",i=this._get(e,"nextText"),i=X?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+i+"</span></a>":W?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+i+"</span></a>",o=this._get(e,"currentText"),u=this._get(e,"gotoCurrent")&&e.currentDay?Q:R,o=X?this.formatDate(o,u,this._getFormatConfig(e)):o,a=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>",f=z?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(U?a:"")+(this._isInRange(e,u)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(U?"":a)+"</div>":"",l=parseInt(this._get(e,"firstDay"),10),l=isNaN(l)?0:l,c=this._get(e,"showWeek"),h=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),d=this._get(e,"monthNames"),v=this._get(e,"monthNamesShort"),m=this._get(e,"beforeShowDay"),g=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),w="",E;for(S=0;S<V[0];S++){x="",this.maxRows=4;for(T=0;T<V[1];T++){N=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),C=" ui-corner-all",k="";if(K){k+="<div class='ui-datepicker-group";if(V[1]>1)switch(T){case 0:k+=" ui-datepicker-group-first",C=" ui-corner-"+(U?"right":"left");break;case V[1]-1:k+=" ui-datepicker-group-last",C=" ui-corner-"+(U?"left":"right");break;default:k+=" ui-datepicker-group-middle",C=""}k+="'>"}k+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+C+"'>"+(/all|left/.test(C)&&S===0?U?s:r:"")+(/all|right/.test(C)&&S===0?U?r:s:"")+this._generateMonthYearHeader(e,Z,et,G,Y,S>0||T>0,d,v)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",L=c?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"";for(E=0;E<7;E++)A=(E+l)%7,L+="<th"+((E+l+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+h[A]+"'>"+p[A]+"</span></th>";k+=L+"</tr></thead><tbody>",O=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,O)),M=(this._getFirstDayOfMonth(et,Z)-l+7)%7,_=Math.ceil((M+O)/7),D=K?this.maxRows>_?this.maxRows:_:_,this.maxRows=D,P=this._daylightSavingAdjust(new Date(et,Z,1-M));for(H=0;H<D;H++){k+="<tr>",B=c?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(P)+"</td>":"";for(E=0;E<7;E++)j=m?m.apply(e.input?e.input[0]:null,[P]):[!0,""],F=P.getMonth()!==Z,I=F&&!y||!j[0]||G&&P<G||Y&&P>Y,B+="<td class='"+((E+l+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(P.getTime()===N.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===P.getTime()&&b.getTime()===N.getTime()?" "+this._dayOverClass:"")+(I?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!g?"":" "+j[1]+(P.getTime()===Q.getTime()?" "+this._currentClass:"")+(P.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+((!F||g)&&j[2]?" title='"+j[2].replace(/'/g,"&#39;")+"'":"")+(I?"":" data-handler='selectDay' data-event='click' data-month='"+P.getMonth()+"' data-year='"+P.getFullYear()+"'")+">"+(F&&!g?"&#xa0;":I?"<span class='ui-state-default'>"+P.getDate()+"</span>":"<a class='ui-state-default"+(P.getTime()===R.getTime()?" ui-state-highlight":"")+(P.getTime()===Q.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+P.getDate()+"</a>")+"</td>",P.setDate(P.getDate()+1),P=this._daylightSavingAdjust(P);k+=B+"</tr>"}Z++,Z>11&&(Z=0,et++),k+="</tbody></table>"+(K?"</div>"+(V[0]>0&&T===V[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=k}w+=x}return w+=f,e._keyEvent=!1,w},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a,f,l,c,h,p,d,v,m=this._get(e,"changeMonth"),g=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",w="";if(s||!m)w+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{a=r&&r.getFullYear()===n,f=i&&i.getFullYear()===n,w+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";for(l=0;l<12;l++)(!a||l>=r.getMonth())&&(!f||l<=i.getMonth())&&(w+="<option value='"+l+"'"+(l===t?" selected='selected'":"")+">"+u[l]+"</option>");w+="</select>"}y||(b+=w+(s||!m||!g?"&#xa0;":""));if(!e.yearshtml){e.yearshtml="";if(s||!g)b+="<span class='ui-datepicker-year'>"+n+"</span>";else{c=this._get(e,"yearRange").split(":"),h=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?n+parseInt(e.substring(1),10):e.match(/[+\-].*/)?h+parseInt(e,10):parseInt(e,10);return isNaN(t)?h:t},d=p(c[0]),v=Math.max(d,p(c[1]||"")),d=r?Math.max(d,r.getFullYear()):d,v=i?Math.min(v,i.getFullYear()):v,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";for(;d<=v;d++)e.yearshtml+="<option value='"+d+"'"+(d===n?" selected='selected'":"")+">"+d+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}}return b+=this._get(e,"yearSuffix"),y&&(b+=(s||!m||!g?"&#xa0;":"")+w),b+="</div>",b},_adjustInstDate:function(e,t,n){var r=e.drawYear+(n==="Y"?t:0),i=e.drawMonth+(n==="M"?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+(n==="D"?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),(n==="M"||n==="Y")&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&t<n?n:t;return r&&i>r?r:i},_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 t==null?[1,1]:typeof t=="number"?[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,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(t<0?t:i[0]*i[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n,r,i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),o=null,u=null,a=this._get(e,"yearRange");return a&&(n=a.split(":"),r=(new Date).getFullYear(),o=parseInt(n[0],10),u=parseInt(n[1],10),n[0].match(/[+\-].*/)&&(o+=r),n[1].match(/[+\-].*/)&&(u+=r)),(!i||t.getTime()>=i.getTime())&&(!s||t.getTime()<=s.getTime())&&(!o||t.getFullYear()>=o)&&(!u||t.getFullYear()<=u)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t=typeof t!="string"?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,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,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),e("#"+e.datepicker._mainDivId).length===0&&e("body").append(e.datepicker.dpDiv);var n=Array.prototype.slice.call(arguments,1);return typeof t!="string"||t!=="isDisabled"&&t!=="getDate"&&t!=="widget"?t==="option"&&arguments.length===2&&typeof arguments[1]=="string"?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(n)):this.each(function(){typeof t=="string"?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(n)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(n))},e.datepicker=new i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.3"}(jQuery),function(e,t){var n={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},r={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 n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},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 n=this;if(!this._isOpen||this._trigger("beforeClose",t)===!1)return;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(){n._trigger("close",t)})},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var n=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return n&&!t&&this._trigger("focus",e),n},open:function(){var t=this;if(this._isOpen){this._moveToTop()&&this._focusTabbable();return}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")}),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 n(){var t=this.document[0].activeElement,n=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);n||this._focusTabbable()}t.preventDefault(),n.call(this),this._delay(n)},_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){t.preventDefault(),this.close(t);return}if(t.keyCode!==e.ui.keyCode.TAB)return;var n=this.uiDialog.find(":tabbable"),r=n.filter(":first"),i=n.filter(":last");t.target!==i[0]&&t.target!==this.uiDialog[0]||!!t.shiftKey?(t.target===r[0]||t.target===this.uiDialog[0])&&t.shiftKey&&(i.focus(1),t.preventDefault()):(r.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,n=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty();if(e.isEmptyObject(n)||e.isArray(n)&&!n.length){this.uiDialog.removeClass("ui-dialog-buttons");return}e.each(n,function(n,r){var i,s;r=e.isFunction(r)?{click:r,text:n}:r,r=e.extend({type:"button"},r),i=r.click,r.click=function(){i.apply(t.element[0],arguments)},s={icons:r.icons,text:r.showText},delete r.icons,delete r.showText,e("<button></button>",r).button(s).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._blockFrames(),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._unblockFrames(),t._trigger("dragStop",i,r(s))}})},_makeResizable:function(){function o(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var t=this,n=this.options,r=n.resizable,i=this.uiDialog.css("position"),s=typeof r=="string"?r:"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:s,start:function(n,r){e(this).addClass("ui-dialog-resizing"),t._blockFrames(),t._trigger("resizeStart",n,o(r))},resize:function(e,n){t._trigger("resize",e,o(n))},stop:function(r,i){n.height=e(this).height(),n.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),t._unblockFrames(),t._trigger("resizeStop",r,o(i))}}).css("position",i)},_minHeight:function(){var e=this.options;return e.height==="auto"?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(t){var i=this,s=!1,o={};e.each(t,function(e,t){i._setOption(e,t),e in n&&(s=!0),e in r&&(o[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(e,t){var n,r,i=this.uiDialog;e==="dialogClass"&&i.removeClass(this.options.dialogClass).addClass(t);if(e==="disabled")return;this._super(e,t),e==="appendTo"&&this.uiDialog.appendTo(this._appendTo()),e==="buttons"&&this._createButtons(),e==="closeText"&&this.uiDialogTitlebarClose.button({label:""+t}),e==="draggable"&&(n=i.is(":data(ui-draggable)"),n&&!t&&i.draggable("destroy"),!n&&t&&this._makeDraggable()),e==="position"&&this._position(),e==="resizable"&&(r=i.is(":data(ui-resizable)"),r&&!t&&i.resizable("destroy"),r&&typeof t=="string"&&i.resizable("option","handles",t),!r&&t!==!1&&this._makeResizable()),e==="title"&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title"))},_size:function(){var e,t,n,r=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),r.minWidth>r.width&&(r.width=r.minWidth),e=this.uiDialog.css({height:"auto",width:r.width}).outerHeight(),t=Math.max(0,r.minHeight-e),n=typeof r.maxHeight=="number"?Math.max(0,r.maxHeight-e):"none",r.height==="auto"?this.element.css({minHeight:t,maxHeight:n,height:"auto"}):this.element.height(Math.max(0,r.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)return;var t=this,n=this.widgetFullName;e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(r){t._allowInteraction(r)||(r.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data(n)._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(){if(!this.options.modal)return;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=this.options.position,n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()}})}(jQuery),function(e,t){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,i){var s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a=t.direction||"up",f=n.test(a),l=f?"height":"width",c=f?"top":"left",h=r.test(a),p={},d=u==="show",v,m,g;s.parent().is(".ui-effects-wrapper")?e.effects.save(s.parent(),o):e.effects.save(s,o),s.show(),v=e.effects.createWrapper(s).css({overflow:"hidden"}),m=v[l](),g=parseFloat(v.css(c))||0,p[l]=d?m:0,h||(s.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),p[c]=d?g:m+g),d&&(v.css(l,0),h||v.css(c,g+m)),v.animate(p,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){u==="hide"&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}}(jQuery),function(e,t){e.effects.effect.bounce=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=s==="hide",u=s==="show",a=t.direction||"up",f=t.distance,l=t.times||5,c=l*2+(u||o?1:0),h=t.duration/c,p=t.easing,d=a==="up"||a==="down"?"top":"left",v=a==="up"||a==="left",m,g,y,b=r.queue(),w=b.length;(u||o)&&i.push("opacity"),e.effects.save(r,i),r.show(),e.effects.createWrapper(r),f||(f=r[d==="top"?"outerHeight":"outerWidth"]()/3),u&&(y={opacity:1},y[d]=0,r.css("opacity",0).css(d,v?-f*2:f*2).animate(y,h,p)),o&&(f/=Math.pow(2,l-1)),y={},y[d]=0;for(m=0;m<l;m++)g={},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p).animate(y,h,p),f=o?f*2:f/2;o&&(g={opacity:0},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p)),r.queue(function(){o&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),w>1&&b.splice.apply(b,[1,0].concat(b.splice(w,c+1))),r.dequeue()}}(jQuery),function(e,t){e.effects.effect.clip=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"vertical",a=u==="vertical",f=a?"height":"width",l=a?"top":"left",c={},h,p,d;e.effects.save(r,i),r.show(),h=e.effects.createWrapper(r).css({overflow:"hidden"}),p=r[0].tagName==="IMG"?h:r,d=p[f](),o&&(p.css(f,0),p.css(l,d/2)),c[f]=o?d:0,c[l]=o?0:d/2,p.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o||r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}}(jQuery),function(e,t){e.effects.effect.drop=function(t,n){var r=e(this),i=["position","top","bottom","left","right","opacity","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left"?"pos":"neg",l={opacity:o?1:0},c;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),c=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0)/2,o&&r.css("opacity",0).css(a,f==="pos"?-c:c),l[a]=(o?f==="pos"?"+=":"-=":f==="pos"?"-=":"+=")+c,r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}}(jQuery),function(e,t){e.effects.effect.explode=function(t,n){function y(){c.push(this),c.length===r*i&&b()}function b(){s.css({visibility:"visible"}),e(c).remove(),u||s.hide(),n()}var r=t.pieces?Math.round(Math.sqrt(t.pieces)):3,i=r,s=e(this),o=e.effects.setMode(s,t.mode||"hide"),u=o==="show",a=s.show().css("visibility","hidden").offset(),f=Math.ceil(s.outerWidth()/i),l=Math.ceil(s.outerHeight()/r),c=[],h,p,d,v,m,g;for(h=0;h<r;h++){v=a.top+h*l,g=h-(r-1)/2;for(p=0;p<i;p++)d=a.left+p*f,m=p-(i-1)/2,s.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-p*f,top:-h*l}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:l,left:d+(u?m*f:0),top:v+(u?g*l:0),opacity:u?0:1}).animate({left:d+(u?0:m*f),top:v+(u?0:g*l),opacity:u?1:0},t.duration||500,t.easing,y)}}}(jQuery),function(e,t){e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}}(jQuery),function(e,t){e.effects.effect.fold=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=s==="hide",a=t.size||15,f=/([0-9]+)%/.exec(a),l=!!t.horizFirst,c=o!==l,h=c?["width","height"]:["height","width"],p=t.duration/2,d,v,m={},g={};e.effects.save(r,i),r.show(),d=e.effects.createWrapper(r).css({overflow:"hidden"}),v=c?[d.width(),d.height()]:[d.height(),d.width()],f&&(a=parseInt(f[1],10)/100*v[u?0:1]),o&&d.css(l?{height:0,width:a}:{height:a,width:0}),m[h[0]]=o?v[0]:a,g[h[1]]=o?v[1]:0,d.animate(m,p,t.easing).animate(g,p,t.easing,function(){u&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()})}}(jQuery),function(e,t){e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};s==="hide"&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),n()}})}}(jQuery),function(e,t){e.effects.effect.pulsate=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"show"),s=i==="show",o=i==="hide",u=s||i==="hide",a=(t.times||5)*2+(u?1:0),f=t.duration/a,l=0,c=r.queue(),h=c.length,p;if(s||!r.is(":visible"))r.css("opacity",0).show(),l=1;for(p=1;p<a;p++)r.animate({opacity:l},f,t.easing),l=1-l;r.animate({opacity:l},f,t.easing),r.queue(function(){o&&r.hide(),n()}),h>1&&c.splice.apply(c,[1,0].concat(c.splice(h,a+1))),r.dequeue()}}(jQuery),function(e,t){e.effects.effect.puff=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"hide"),s=i==="hide",o=parseInt(t.percent,10)||150,u=o/100,a={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:s?o:100,from:s?a:{height:a.height*u,width:a.width*u,outerHeight:a.outerHeight*u,outerWidth:a.outerWidth*u}}),r.effect(t)},e.effects.effect.scale=function(t,n){var r=e(this),i=e.extend(!0,{},t),s=e.effects.setMode(r,t.mode||"effect"),o=parseInt(t.percent,10)||(parseInt(t.percent,10)===0?0:s==="hide"?0:100),u=t.direction||"both",a=t.origin,f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},l={y:u!=="horizontal"?o/100:1,x:u!=="vertical"?o/100:1};i.effect="size",i.queue=!1,i.complete=n,s!=="effect"&&(i.origin=a||["middle","center"],i.restore=!0),i.from=t.from||(s==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:f),i.to={height:f.height*l.y,width:f.width*l.x,outerHeight:f.outerHeight*l.y,outerWidth:f.outerWidth*l.x},i.fade&&(s==="show"&&(i.from.opacity=0,i.to.opacity=1),s==="hide"&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},e.effects.effect.size=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),d=t.restore||p!=="effect",v=t.scale||"both",m=t.origin||["middle","center"],g=o.css("position"),y=d?u:a,b={height:0,width:0,outerHeight:0,outerWidth:0};p==="show"&&o.show(),r={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},t.mode==="toggle"&&p==="show"?(o.from=t.to||b,o.to=t.from||r):(o.from=t.from||(p==="show"?b:r),o.to=t.to||(p==="hide"?b:r)),s={from:{y:o.from.height/r.height,x:o.from.width/r.width},to:{y:o.to.height/r.height,x:o.to.width/r.width}};if(v==="box"||v==="both")s.from.y!==s.to.y&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,s.from.y,o.from),o.to=e.effects.setTransition(o,c,s.to.y,o.to)),s.from.x!==s.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,s.from.x,o.from),o.to=e.effects.setTransition(o,h,s.to.x,o.to));(v==="content"||v==="both")&&s.from.y!==s.to.y&&(y=y.concat(l).concat(f),o.from=e.effects.setTransition(o,l,s.from.y,o.from),o.to=e.effects.setTransition(o,l,s.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(i=e.effects.getBaseline(m,r),o.from.top=(r.outerHeight-o.outerHeight())*i.y,o.from.left=(r.outerWidth-o.outerWidth())*i.x,o.to.top=(r.outerHeight-o.to.outerHeight)*i.y,o.to.left=(r.outerWidth-o.to.outerWidth)*i.x),o.css(o.from);if(v==="content"||v==="both")c=c.concat(["marginTop","marginBottom"]).concat(l),h=h.concat(["marginLeft","marginRight"]),f=u.concat(c).concat(h),o.find("*[width]").each(function(){var n=e(this),r={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};d&&e.effects.save(n,f),n.from={height:r.height*s.from.y,width:r.width*s.from.x,outerHeight:r.outerHeight*s.from.y,outerWidth:r.outerWidth*s.from.x},n.to={height:r.height*s.to.y,width:r.width*s.to.x,outerHeight:r.height*s.to.y,outerWidth:r.width*s.to.x},s.from.y!==s.to.y&&(n.from=e.effects.setTransition(n,c,s.from.y,n.from),n.to=e.effects.setTransition(n,c,s.to.y,n.to)),s.from.x!==s.to.x&&(n.from=e.effects.setTransition(n,h,s.from.x,n.from),n.to=e.effects.setTransition(n,h,s.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.easing,function(){d&&e.effects.restore(n,f)})});o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o.to.opacity===0&&o.css("opacity",o.from.opacity),p==="hide"&&o.hide(),e.effects.restore(o,y),d||(g==="static"?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,n){var r=parseInt(n,10),i=e?o.to.left:o.to.top;return n==="auto"?i+"px":r+i+"px"})})),e.effects.removeWrapper(o),n()}})}}(jQuery),function(e,t){e.effects.effect.shake=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=t.direction||"left",u=t.distance||20,a=t.times||3,f=a*2+1,l=Math.round(t.duration/f),c=o==="up"||o==="down"?"top":"left",h=o==="up"||o==="left",p={},d={},v={},m,g=r.queue(),y=g.length;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),p[c]=(h?"-=":"+=")+u,d[c]=(h?"+=":"-=")+u*2,v[c]=(h?"-=":"+=")+u*2,r.animate(p,l,t.easing);for(m=1;m<a;m++)r.animate(d,l,t.easing).animate(v,l,t.easing);r.animate(d,l,t.easing).animate(p,l/2,t.easing).queue(function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),y>1&&g.splice.apply(g,[1,0].concat(g.splice(y,f+1))),r.dequeue()}}(jQuery),function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}}(jQuery),function(e,t){e.effects.effect.transfer=function(t,n){var r=e(this),i=e(t.to),s=i.css("position")==="fixed",o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),n()})}}(jQuery),function(e,t){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 n=e(t.target).closest(".ui-menu-item");!this.mouseHandled&&n.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(t),n.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},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 a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!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:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&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,n=this.options.icons.submenu,r=this.element.find(this.options.menus);r.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),r=t.prev("a"),i=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),t=r.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){e==="icons"&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),this._super(e,t)},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=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(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},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,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_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 n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)}})}(jQuery),function(e,t){function h(e,t,n){return[parseFloat(e[0])*(l.test(e[0])?t/100:1),parseFloat(e[1])*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}function d(t){var n=t[0];return n.nodeType===9?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+(\.[\d]+)?%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width<t.element[0].scrollWidth,s=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:s?e.position.scrollbarWidth():0,height:i?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width():n.outerWidth(),height:r?n.height():n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var n,l,v,m,g,y,b=e(t.of),w=e.position.getWithinInfo(t.within),E=e.position.getScrollInfo(w),S=(t.collision||"flip").split(" "),x={};return y=d(b),b[0].preventDefault&&(t.at="left top"),l=y.width,v=y.height,m=y.offset,g=e.extend({},m),e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;e.length===1&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]),e[0]=o.test(e[0])?e[0]:"center",e[1]=u.test(e[1])?e[1]:"center",n=a.exec(e[0]),r=a.exec(e[1]),x[this]=[n?n[0]:0,r?r[0]:0],t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]}),S.length===1&&(S[1]=S[0]),t.at[0]==="right"?g.left+=l:t.at[0]==="center"&&(g.left+=l/2),t.at[1]==="bottom"?g.top+=v:t.at[1]==="center"&&(g.top+=v/2),n=h(x.at,l,v),g.left+=n[0],g.top+=n[1],this.each(function(){var o,u,a=e(this),f=a.outerWidth(),c=a.outerHeight(),d=p(this,"marginLeft"),y=p(this,"marginTop"),T=f+d+p(this,"marginRight")+E.width,N=c+y+p(this,"marginBottom")+E.height,C=e.extend({},g),k=h(x.my,a.outerWidth(),a.outerHeight());t.my[0]==="right"?C.left-=f:t.my[0]==="center"&&(C.left-=f/2),t.my[1]==="bottom"?C.top-=c:t.my[1]==="center"&&(C.top-=c/2),C.left+=k[0],C.top+=k[1],e.support.offsetFractions||(C.left=s(C.left),C.top=s(C.top)),o={marginLeft:d,marginTop:y},e.each(["left","top"],function(r,i){e.ui.position[S[r]]&&e.ui.position[S[r]][i](C,{targetWidth:l,targetHeight:v,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:w,elem:a})}),t.using&&(u=function(e){var n=m.left-C.left,s=n+l-f,o=m.top-C.top,u=o+v-c,h={target:{element:b,left:m.left,top:m.top,width:l,height:v},element:{element:a,left:C.left,top:C.top,width:f,height:c},horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};l<f&&i(n+s)<l&&(h.horizontal="center"),v<c&&i(o+u)<v&&(h.vertical="middle"),r(i(n),i(s))>r(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p<i(a))e.left+=l+c+h}else if(f>0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=l+c+h}},top:function(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l=t.my[1]==="top",c=l?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,h=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,p=-2*t.offset[1],d,v;a<0?(v=e.top+c+h+p+t.collisionHeight-s-r,e.top+c+h+p>a&&(v<0||v<i(a))&&(e.top+=c+h+p)):f>0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)<f)&&(e.top+=c+h+p))}},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,n,r,i,s,o=document.getElementsByTagName("body")[0],u=document.createElement("div");t=document.createElement(o?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(s in r)t.style[s]=r[s];t.appendChild(u),n=o||document.documentElement,n.insertBefore(t,n.firstChild),u.style.cssText="position: absolute; left: 10.7432222px;",i=e(u).offset().left,e.support.offsetFractions=i>10&&i<11,t.innerHTML="",n.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){if(e===t)return this.options.value;this.options.value=this._constrainedValue(e),this._refreshValue()},_constrainedValue:function(e){return e===t&&(e=this.options.value),this.indeterminate=e===!1,typeof e!="number"&&(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){e==="max"&&(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,n=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(n.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,t){var n=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,n,r=this.options,i=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),s="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];n=r.values&&r.values.length||1,i.length>n&&(i.slice(n).remove(),i=i.slice(0,n));for(t=i.length;t<n;t++)o.push(s);this.handles=i.add(e(o.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,n="";t.range?(t.range===!0&&(t.values?t.values.length&&t.values.length!==2?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=e("<div></div>").appendTo(this.element),n="ui-slider-range ui-widget-header ui-corner-all"):this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}),this.range.addClass(n+(t.range==="min"||t.range==="max"?" 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 n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));if(i>n||i===n&&(t===l._lastChangedValue||l.values(t)===c.min))i=n,s=e(this),o=t}),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!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=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n<r)&&(n=r),n!==this.values(t)&&(i=this.values(),i[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:i}),r=this.values(t?0:1),s!==!1&&this.values(t,n,!0))):n!==this.value()&&(s=this._trigger("slide",e,{handle:this.handles[t],value:n}),s!==!1&&this.value(n))},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,n)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(t,n){var r,i,s;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s<r.length;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;t==="range"&&this.options.range===!0&&(n==="min"?(this.options.value=this._values(0),this.options.values=null):n==="max"&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(i=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(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":this._animateOff=!0,this._refreshValue();for(r=0;r<i;r+=1)this._change(null,r);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),e},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t),t;if(this.options.values&&this.options.values.length){n=this.options.values.slice();for(r=0;r<n.length;r+=1)n[r]=this._trimAlignValue(n[r]);return n}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,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))},_handleEvents:{keydown:function(t){var r,i,s,o,u=e(t.target).data("ui-slider-handle-index");switch(t.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:t.preventDefault();if(!this._keySliding){this._keySliding=!0,e(t.target).addClass("ui-state-active"),r=this._start(t,u);if(r===!1)return}}o=this.options.step,this.options.values&&this.options.values.length?i=s=this.values(u):i=s=this.value();switch(t.keyCode){case e.ui.keyCode.HOME:s=this._valueMin();break;case e.ui.keyCode.END:s=this._valueMax();break;case e.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-o)}this._slide(t,u,s)},click:function(e){e.preventDefault()},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),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={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),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){if(this.cancelBlur){delete this.cancelBlur;return}this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;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 r(){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(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"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(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.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?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(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 this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e<r.min?r.min:e},_stop:function(e){if(!this.spinning)return;clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e)},_setOption:function(e,t){if(e==="culture"||e==="numberFormat"){var n=this._parse(this.element.val());this.options[e]=t,this.element.val(this._format(n));return}(e==="max"||e==="min"||e==="step")&&typeof t=="string"&&(t=this._parse(t)),e==="icons"&&(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),e==="disabled"&&(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 typeof e=="string"&&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 n;e!==""&&(n=this._parse(e),n!==null&&(t||(n=this._adjustValue(n)),e=this._format(n))),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){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,e)},widget:function(){return this.uiSpinner}})}(jQuery),function(e,t){function i(){return++n}function s(e){return e.hash.length>1&&decodeURIComponent(e.href.replace(r,""))===decodeURIComponent(location.href.replace(r,""))}var n=0,r=/#.*$/;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,n=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.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(),n.active=this._initialActive(),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(n.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_initialActive:function(){var t=this.options.active,n=this.options.collapsible,r=location.hash.substring(1);if(t===null){r&&this.tabs.each(function(n,i){if(e(i).attr("aria-controls")===r)return t=n,!1}),t===null&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(t===null||t===-1)t=this.tabs.length?0:!1}return t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),t===-1&&(t=n?!1:0)),!n&&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 n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?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){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&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,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):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),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(n,r){var i,o,u,a=e(r).uniqueId().attr("id"),f=e(r).closest("li"),l=f.attr("aria-controls");s(r)?(i=r.hash,o=t.element.find(t._sanitizeSelector(i))):(u=t._tabId(f),i="#"+u,o=t.element.find(i),o.length||(o=t._createPanel(u),o.insertAfter(t.panels[n-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),l&&f.data("ui-tabs-aria-controls",l),f.attr({"aria-controls":i.substring(1),"aria-labelledby":a}),o.attr("aria-labelledby",a)}),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 n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r=this.element.parent();t==="fill"?(n=r.height(),n-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(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),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled;if(r===!1)return;n===t?r=!1:(n=this._getIndex(n),e.isArray(r)?r=e.map(r,function(e){return e!==n?e:null}):r=e.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(r)},disable:function(n){var r=this.options.disabled;if(r===!0)return;if(n===t)r=!0;else{n=this._getIndex(n);if(e.inArray(n,r)!==-1)return;e.isArray(r)?r=e.merge([n],r).sort():r=[n]}this._setupDisabled(r)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),o=i.find(".ui-tabs-anchor"),u=this._getPanelForTab(i),a={tab:i,panel:u};if(s(o[0]))return;this.xhr=e.ajax(this._ajaxSettings(o,n,a)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),u.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){u.html(e),r._trigger("load",n,a)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),u.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}})}(jQuery),function(e){function n(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))}function r(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);i!==-1&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")}var t=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,n){var r=this;if(t==="disabled"){this[n?"_disable":"_enable"](),this.options[t]=n;return}this._super(t,n),t==="content"&&e.each(this.tooltips,function(e,t){r._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!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 n=this,r=e(t?t.target:this.element).closest(this.options.items);if(!r.length||r.data("ui-tooltip-id"))return;r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&t.type==="mouseover"&&r.parents().each(function(){var t=e(this),r;t.data("ui-tooltip-open")&&(r=e.Event("blur"),r.target=r.currentTarget=this,n.close(r,!0)),t.attr("title")&&(t.uniqueId(),n.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._updateContent(r,t)},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;if(typeof r=="string")return this._open(t,e,r);n=r.call(e[0],function(n){if(!e.data("ui-tooltip-open"))return;i._delay(function(){t&&(t.type=s),this._open(t,e,n)})}),n&&this._open(t,e,n)},_open:function(t,r,i){function f(e){a.of=e;if(s.is(":hidden"))return;s.position(a)}var s,o,u,a=e.extend({},this.options.position);if(!i)return;s=this._find(r);if(s.length){s.find(".ui-tooltip-content").html(i);return}r.is("[title]")&&(t&&t.type==="mouseover"?r.attr("title",""):r.removeAttr("title")),s=this._tooltip(r),n(r,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:f}),f(t)):s.position(e.extend({of:r},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(u=this.delayedShow=setInterval(function(){s.is(":visible")&&(f(a.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:s}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}};if(!t||t.type==="mouseover")o.mouseleave="close";if(!t||t.type==="focusin")o.focusout="close";this._on(!0,r,o)},close:function(t){var n=this,i=e(t?t.currentTarget:this.element),s=this._find(i);if(this.closing)return;clearInterval(this.delayedShow),i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),r(i),s.stop(!0),this._hide(s,this.options.hide,function(){n._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&e.each(this.parents,function(t,r){e(r.element).attr("title",r.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:s}),this.closing=!1},_tooltip:function(n){var r="ui-tooltip-"+t++,i=e("<div>").attr({id:r,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[r]=n,i},_find:function(t){var n=t.data("ui-tooltip-id");return n?e("#"+n):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0),e("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.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,n=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&&n&&this.$textbox.attr("name",n+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,n){var r=t.type;this.timeout&&clearTimeout(this.timeout),r=="saving"||n?this.element.html(this.options.states[r]):this.timeout=setTimeout(e.proxy(function(){this.element.html(this.options.states[r])},this),this.options.noflash);if(r=="invalid"||r=="success"||r=="error")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,n,r,i){"use strict";return t.View.extend(n.extend({},e,{_templateId:"",_fadeIn:!1,initialize:function(e){n.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=n.template(this._templateId),this.$container=e.container,this.id=e.count||0,this.on("save-success",function(e,t,n){this.success.call(this,e,t,n)},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=i(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 n=i(this);n.find("span").toggleClass("ubnt-icon-arrow-right",t).toggleClass("ubnt-icon-arrow-down",!n.find("span").hasClass("ubnt-icon-arrow-right")).end().siblings().toggleClass("hidden",t)}).trigger("click",!0),this._fadeIn?this.$container.prepend(this.$el.hide().fadeIn()):this.$container.prepend(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(e,t){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,n){"use strict";return n.View.extend({exists:!1,permanent:!1,open:function(){var n=this,r={autoOpen:!0,width:900,height:900,modal:!0,resizable:!1,draggable:!1},i=e.extend(r,this.dialogOptions||{});this.render(),!this.exists&&(this.exists=!0)?(t.Body.append(this.$el),this.$el.dialog(i),this.$el.on("dialogclose",function(e,t){n.close()})):(this.$el.dialog("open"),this.center()),i.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(),n.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,n){"use strict";return e.extend({sync:function(e,t,r){r=r||{};switch(e){case"create":r.url="/api/self",r.type="PUT",r.data=JSON.stringify({name:r.name,x_password:r.password,email:r.email})}return n.sync.call(this,e,t,r)}})}),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,n,r,i,s,o){"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:r.G_ChangeMyPassword,width:"auto",height:"auto",modal:!0,resizable:!1,draggable:!1,dialogClass:"dialog-change-password dialog-simple"},initialize:function(e){s.bindAll(this),this.app=e.app,this.changePassword=new n},render:function(){var e=this;this.$el.html(s.template(t,{msg:r})),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=o.Body.hasClass("passwordChangeRequired"),e.passwordChangeRequired?s.delay(function(){e.$password.focus()},10):this.$adminNameInput.focus()},open:function(){e.prototype.open.call(this),o.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=o(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(){if(this.passwordChangeRequired)return!1},close:function(t){t&&(t.stopPropagation(),t.preventDefault()),e.prototype.close.call(this),o.Window.off("resize")},onResizeWindow:s.debounce(function(){this.center()},250),validateInputs:function(){var e=0,t=[this.$adminNameInput,this.$emailInput],n;this.$adminNameInput.removeClass("error"),this.$footer.find(".error-msg").remove(),this.passwordChangeRequired&&t.push(this.$password,this.$confirmPassword),s.each(t,function(t){t.val()||e++},this),this.model.validator.email(this.$emailInput.val())?this.$emailInput.removeClass("error"):(n=r.localize(r.E_InvalidEmail,r.G_SettingsAdminEmail),this.$emailInput.addClass("error")),this.model.validator.accountName(this.$adminNameInput.val())?this.$adminNameInput.removeClass("error"):(n=r.localize(r.E_InvalidAdminName,r.G_SettingsAdminName),this.$adminNameInput.addClass("error")),this.validatePasswordMatch(),this.validatePasswordMatch()&&!n?this.$submit.prop("disabled",!!e):this.$submit.prop("disabled",!0),n&&this.$footer.prepend(o('<div class="left error-msg"></div>').text(n))},validatePasswordMatch:function(){var e;return this.$password.val()===this.$confirmPassword.val()?e=!0:e=!1,e},onSubmit:function(e){e.preventDefault();var t=this.$adminNameInput.val(),n=this.$emailInput.val(),i=this.$el.find(".footer"),s={name:t,email:n,success:o.proxy(function(e){this.$submit.trigger("success"),o.Body.removeClass("passwordChangeRequired"),delete this.passwordChangeRequired,this.model.fetch(),this.model.trigger("change"),this.close()},this),error:o.proxy(function(e,t,n){i.append(o('<div class="left error-msg" />').text(r.apiError(e))),this.$submit.trigger("error",!0)},this)};if(this.$password.val()||this.passwordChangeRequired)s.password=this.$password.val();i.find(".error-msg").remove(),this.$submit.trigger("saving"),this.changePassword.sync("create",this,s)},remove:function(){this.$el.off("dialogbeforeclose",this.beforeClose),o.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,n,r){"use strict";return t.View.extend({events:{"click #ChangePassword":"changePassword"},el:"#UserPopOver",initialize:function(){n.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){t.preventDefault();if(this.model.get("is_local")){var n=new e({model:this.model});n.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,n,r){"use strict";return e.extend({ignoreUnset:["key"],validate:function(e,n){var i={},s=n?n.partial:null;if(!s||s=="desc")e.desc?this.validator.name(e.desc)||(i.desc=r.localize(r.E_InvalidName,r.G_Name)):s||(i.desc=r.localize(r.E_CannotBeEmpty,r.G_Name));if(t.size(i))return i},sync:function(e,r,i){switch(e){case"create":i.url="/api/s/"+SITE.name+"/cmd/sitemgr",i.contentType="application/json; charset=utf-8",i.type="POST",i.data=JSON.stringify(t.extend(r.toJSON(i),{cmd:"add-site"}));break;case"update":i.url="/api/s/"+SITE.name+"/cmd/sitemgr",i.contentType="application/json; charset=utf-8",i.type="POST",i.data=JSON.stringify(t.extend(r.toJSON(i),{cmd:"update-site"}));break;case"delete":i.url="/api/s/"+SITE.name+"/cmd/sitemgr",i.contentType="application/json; charset=utf-8",i.type="POST",i.data=JSON.stringify({site:r.id,cmd:"delete-site"})}return n.sync.call(this,e,r,i)}})}),define("unifi/collection/Sites",["unifi/collection/Collection","backbone","unifi/model/Site"],function(e,t,n){"use strict";return e.extend({model:n,bySite:!1,url:function(){return"/api/self/sites"},sync:function(e,n,r){return t.sync.call(this,e,n,r)},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 id="navSettingsAutoResponder" class="has-voip internal-pbx"><a href="#" data-section="autoresponder"><%- msg.G_SettingsAutoResponder %></a></li>\n                            \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,n,r){"use strict";return e.extend({render:function(t){var n=this.rendered;e.prototype.render.call(this,t),n||(this.$el.find("input:first").setCaret(0),this.app.isReadOnly||this.prevalidator())},success:function(){e.prototype.success.call(this),!this.create||!this._permanent?this.remove():this._constant||this.$el.find("form").each(function(){this.reset()})},error:function(t,i){e.prototype.error.call(this),this.$el.find("fieldset.actions").prepend(r('<div class="error-msg">'+n.E_DataSave+": "+n.apiError(i)+"</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,n,r,i){"use strict";return e.extend({_templateId:i,_prevalidate:{name:{input:"text"},email:{input:"text"}},args:function(){return{id:this.id,headline:this.create?r.G_SettingsCreateNewAdmin:r.G_SettingsEditAdmin+" - "+this.model.get("name"),msg:r}},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,n){"use strict";return e.View.extend({initialize:function(){t.bindAll(this),this.template=t.template(n.trim(n("#WaitingModalTemplate").html())),this.el=this.template({}),this.$el=n(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){e===0?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,n,r,i,s){"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(s));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){typeof e=="object"?(this.buttonsDef.push(e),this.options.dialogOptions.buttons[t]=e.handler):this.buttonsDef.push({buttonClass:"",handler:e})},this)},render:function(e){var r=this,s=e&&e.template_json?e.template_json:{};return r.isRendered||(r.isRendered=!0,r.el=r.template(s),r.$el=i(r.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),i.Window.on("resize",t.debounce(this.center,250)),r.$el.dialog(this.options.dialogOptions),r.$dialog=r.$el.parents(".ui-dialog"),r.waitingModal=new n,r.$dialog.append(this.waitingModal.$el),this.$buttonBar=this.$dialog.find(".ui-dialog-buttonpane"),t.each(this.$buttonBar.find("button"),function(e,t){var n=i(e).button("option","label");this.buttonElements[n]=i(e),i(e).addClass(this.buttonsDef[t].buttonClass)},this)),r.$dialog},bindHandlers:function(){},unbindHandlers:function(){},show:function(e,t,n){this.open(e,t,n)},open:function(e,t,n){var r=this;r.render(),r.callBack=t||function(){r.$el.dialog("close")},r.context=n||r;if(!this.isOpen){r.isMaximixed=!1,r.$el.dialog("open"),r.$el.dialog("option",{position:"center"});var i=r.$el.parents(".ui-dialog").offset()}this.isOpen=!0,e&&this.$el.find(".message").text(e),this.bindHandlers(),r.$el.dialog("moveToTop"),r.$el.trigger("show")},hide:function(e,t){var n=this;n.context=t||n,n.cancelCallback=e||function(){n.$el.dialog("close")}},close:function(){this.$el.dialog("close")},showModal:function(e){e?this.waitingModal.show(e):this.waitingModal.show(r.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),i.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,n,r,i){"use strict";return t.extend({_fullyQualifiedName:"UBNT.views.dialogs.ConfirmDialog",initialize:function(){e.bindAll(this),this.template=e.template(i);var r={title:n.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:{}};r.buttons[n.G_Confirm]=r.ConfirmButton,r.buttons[n.G_Cancel]=r.CancelButton,this.options.dialogOptions=e.extend(r,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,n){this.message=e,this.open(e,t,n)},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 n=e.trim(t.$el.find("h2:first").clone().find("span").remove().end().text());this.$(".section-home").hide(),this.$(".breadcrumb").text(n),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,n,r,i,s,o,u,a){"use strict";return e.extend(u.extend({},r,{_formClass:"",_autoRender:!1,initialize:function(t){this.forms={},e.prototype.initialize.call(this,t)},grid:function(t){e.prototype.grid.call(this,t),this.$createBtn=this.$el.find(".create-form"),this.$createBtn.on("click",a.proxy(function(){this.form(new this.collection.model)},this)).show(),this.$forms=this.$el.find("div.forms");if(this.options.edit){var n=this.collection.get(this.options.edit);n&&this.rowEdit(n),delete this.options.edit}return this},form:function(e,t,n){var r=e&&e.id?e.id:null,i=r&&this.forms[r]?this.forms[r]:null,s=this;return this.$forms.empty(),i||(i=new this._formClass(u.extend({container:this.$forms,model:e,collection:this.collection,count:u.size(this.forms)+1,app:this.app},this.formAttributes(e))),i.bind("render",function(){s.renderForm(i)}).bind("remove",function(){s.removeForm(i)}),r&&(this.forms[r]=i)),n||i.render(),i},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?a(t.target).parents("tr"):null),this.$el.trigger("edit")},rowDelete:function(e,r){r&&r.preventDefault(),(new n).show(i.N_ConfirmDeleteSetting,function(){e.destroy({wait:!0,error:function(e,n){(new t).open(i.apiError(n,!0))}})})},whenReady:function(e){a.when(this._rendered,this._loaded,this._dependencies).then(a.proxy(function(){e.apply(this)},this))},remove:function(){this.$createBtn.off(),u.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,n,r){"use strict";return e.extend({url:function(){return"/api/s/"+SITE.name+"/cmd/sitemgr"},validate:function(e,n){var i={},s=n?n.partial:null;if(!s||s=="email")e.email?this.validator.email(e.email)||(i.email=r.localize(r.E_IncorrectEmailAddress,e.email)):s||(i.email=r.localize(r.E_CannotBeEmpty,"Email"));if(!s||s=="name")e.name?this.validator.accountName(e.name)||(i.name=r.localize(r.E_InvalidAdminName,r.G_Name)):s||(i.name=r.localize(r.E_CannotBeEmpty,"Name"));if(t.size(i))return i},invite:function(e){return this.sync("invite",this,e)},sync:function(e,r,i){switch(e){case"create":i.contentType="application/json; charset=utf-8",i.type="POST",i.data=JSON.stringify(t.extend(r.toJSON(i),{cmd:"invite-admin"}));break;case"delete":i.contentType="application/json; charset=utf-8",i.type="POST",i.data=JSON.stringify({admin:r.id,cmd:"revoke-admin"});break;case"invite":i.contentType="application/json; charset=utf-8",i.type="POST",i.data=JSON.stringify({email:r.get("email"),cmd:"invite-admin",name:r.get("name"),role:r.get("role")})}return n.sync.call(this,e,r,i)}})}),define("unifi/collection/Admins",["unifi/collection/Collection","backbone","unifi/model/Admin"],function(e,t,n){"use strict";return e.extend({model:n,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/cmd/sitemgr"},sync:function(e,n,r){switch(e){case"read":r.type="POST",r.data=JSON.stringify({cmd:"get-admins"})}return t.sync.call(this,e,n,r)}})}),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,n,r,i,s,o,u,a,f){"use strict";return n.extend({id:"settingsAdmins",_templateId:e.template(f,{msg:u}),_formClass:r,_collectionType:{name:"Admins",Class:a},_pageable:!1,columns:function(){return[{name:"name",label:u.G_UN,editable:!1,cell:o.Cells.ComplexCell.extend({formatter:{fromRaw:t.proxy(function(e){return(e.get("name")||"("+u.G_Unconfigured+")")+(e.get("is_verified")?"":" ("+u.G_Unverified+")")},this)}})},{name:"email",label:u.G_Email,editable:!1,cell:"string"},{name:"role",label:u.G_Role,editable:!1,cell:o.Cells.ComplexCell.extend({formatter:{fromRaw:t.proxy(function(e){return e.get("role")=="admin"?u.G_Admin:u.G_ReadOnly},this)}})},{name:"_id",label:u.G_Actions,editable:!1,sortable:!1,headerCell:o.Headers.noSortHeader,cell:o.Cells.ActionsCell.extend({actions:{invite:{icon:"ubnt-icon-mail",callback:this.rowInvite,text:"Re-invite",render:function(e){return!e.get("is_verified")&&e.get("role")!="hotspot"&&!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,n){var r=this,i=t(n.target);i.prop("disabled",!0),e.invite({success:function(t,n,i){r.options.app.views.app.flash("success","Success",u.localize(u.G_AccountReinvited,e.get("name")))},error:function(e){r.options.app.views.app.flash("error","Error",u.apiError(e))},complete:function(){i.prop("disabled",!1)}})},rowEdit:function(e,n){var r=this,i=t(n.target);t("#ChangePassword").click()}})}),define("unifi/model/Setting",["unifi/model/Model","underscore","backbone","msg/Msg"],function(e,t,n,r){"use strict";return e.extend({validate:function(e,n){var i={},s=n?n.partial:null;e.key||(i.key=r.localize(r.E_CannotBeEmpty,"Key"));switch(e.key){case"guest_access":if(e.portal_enabled){(!s||s=="expire")&&e.expire=="custom"&&(this.validator.digits(e.expire_number)||(i.name=r.localize(r.E_IncorrectIntegerType,r.G_Expiration)));switch(e.auth){case"none":break;case"password":if(!s||s=="x_password")e.x_password||(i.x_password=r.localize(r.E_CannotBeEmpty,r.G_PW));break;case"hotspot":(!s||s=="authorization")&&!e.voucher_enabled&&!e.payment_enabled&&(i.authorization=r.localize(r.E_GuestNoHotspotPaymentSelected));if(e.payment_enabled)switch(e.gateway){case"paypal":if(!s||s=="x_paypal_username")e.x_paypal_username||(i.x_paypal_username=r.localize(r.E_CannotBeEmpty,r.G_UN));if(!s||s=="x_paypal_password")e.x_paypal_password||(i.x_paypal_password=r.localize(r.E_CannotBeEmpty,r.G_PW));if(!s||s=="x_paypal_signature")e.x_paypal_signature||(i.x_paypal_signature=r.localize(r.E_CannotBeEmpty,r.G_Signature));break;case"stripe":if(!s||s=="x_stripe_api_key")e.x_stripe_api_key||(i.x_stripe_api_key=r.localize(r.E_CannotBeEmpty,r.G_SettingsAPIKey));break;case"quickpay":if(!s||s=="x_quickpay_merchantid")e.x_quickpay_merchantid||(i.x_quickpay_merchantid=r.localize(r.E_CannotBeEmpty,r.G_SettingsMerchantId));if(!s||s=="x_quickpay_md5secret")e.x_quickpay_md5secret||(i.x_quickpay_md5secret=r.localize(r.E_CannotBeEmpty,r.G_SetttingsMD5Secret));break;case"authorize":if(!s||s=="x_authorize_loginid")e.x_authorize_loginid||(i.x_authorize_loginid=r.localize(r.E_CannotBeEmpty,r.G_SettingsAPILoginId));if(!s||s=="x_authorize_transactionkey")e.x_authorize_transactionkey||(i.x_authorize_transactionkey=r.localize(r.E_CannotBeEmpty,r.G_SettingsTransactionKey));break;case"merchantwarrior":if(!s||s=="x_merchantwarrior_merchantuuid")e.x_merchantwarrior_merchantuuid||(i.x_merchantwarrior_merchantuuid=r.localize(r.E_CannotBeEmpty,r.G_SettingsMerchantUuid));if(!s||s=="x_merchantwarrior_apikey")e.x_merchantwarrior_apikey||(i.x_merchantwarrior_apikey=r.localize(r.E_CannotBeEmpty,r.G_SettingsAPIKey));if(!s||s=="x_merchantwarrior_apipassphrase")e.x_merchantwarrior_apipassphrase||(i.x_merchantwarrior_apipassphrase=r.localize(r.E_CannotBeEmpty,r.G_SettingsAPIPassphrase));break;case"ippay":if(!s||s=="x_ippay_terminalid")e.x_ippay_terminalid||(i.x_ippay_terminalid=r.localize(r.E_CannotBeEmpty,r.G_SettingsTerminalId))}break;case"custom":if(!s||s=="custom_ip")e.custom_ip?this.validator.ip(e.custom_ip)||(i.custom_ip=r.localize(r.E_IncorrectIPAddress,r.G_IPAddress)):i.custom_ip=r.localize(r.E_CannotBeEmpty,r.G_IPAddress)}(!s||s=="redirect_url")&&e.redirect_enabled&&!e.redirect_url&&(i.redirect_url=r.localize(r.E_CannotBeEmpty,r.G_SettingsPromoURL)),(!s||s=="portal_hostname")&&e.portal_use_hostname&&(e.portal_hostname?this.validator.hostname(e.portal_hostname)||(i.portal_hostname=r.localize(r.E_InvalidHostname,r.G_Hostname)):i.portal_hostname=r.localize(r.E_CannotBeEmpty,r.G_Hostname))}var o=[];t.each(["restricted","allowed"],function(t){for(var n=1,r=null;n<32;n++)if(r=e[t+"_subnet_"+n])this.validator.subnet(r)||o.push(r)},this),t.size(o)&&(i.subnets=r.localize(r.E_InvalidSubnetList,o.join(", ")));break;case"connectivity":e.enabled&&e.uplink_type=="custom"&&(!s||s=="uplink_host")&&(e.uplink_host?this.validator.ip(e.uplink_host)||(i.uplink_host=r.localize(r.E_IncorrectIPAddress,r.G_UplinkIPAddress)):i.uplink_host=r.localize(r.E_CannotBeEmpty,r.G_UplinkIPAddress));break;case"mgmt":if(!s||s=="x_ssh_username")e.x_ssh_username?this.validator.deviceAccountName(e.x_ssh_username)||(i.x_ssh_username=r.localize(r.E_InvalidDeviceAdminName,r.G_UN)):i.x_ssh_username=r.localize(r.E_CannotBeEmpty,r.G_UN);if(!s||s=="x_ssh_password")e.x_ssh_password||(i.x_ssh_password=r.localize(r.E_CannotBeEmpty,r.G_PW));break;case"rsyslogd":if(e.enabled){if(!s||s=="ip")e.ip||(i.ip=r.localize(r.E_CannotBeEmpty,r.G_SettingsRemoteIPAddress));if(!s||s=="port")e.port?this.validator.range(e.port,1,65535)||(i.port=r.localize(r.E_IncorrectNumberRange,r.G_Port,1,65535)):i.port=r.localize(r.E_CannotBeEmpty,r.G_Port)}break;case"super_smtp":if(e.enabled){if(!s||s=="host")e.host||(i.host=r.localize(r.E_CannotBeEmpty,r.G_SettingsSMTPHost));if(!s||s=="port")e.port?this.validator.range(e.port,1,65535)||(i.port=r.localize(r.E_IncorrectNumberRange,r.G_Port,1,65535)):i.port=r.localize(r.E_CannotBeEmpty,r.G_Port);if(e.use_auth){if(!s||s=="username")e.username||(i.username=r.localize(r.E_CannotBeEmpty,r.G_UN));if(!s||s=="x_password")e.x_password||(i.x_password=r.localize(r.E_CannotBeEmpty,r.G_PW))}}break;case"provider":e.type==="ubnt"?(e.x_sso_username||(i.x_sso_username=r.localize(r.E_CannotBeEmpty,r.G_UN)),e.x_sso_password||(i.x_sso_password=r.localize(r.E_CannotBeEmpty,r.G_PW))):e.type==="custom"?(e.sip_server||(i.sip_server=r.localize(r.E_CannotBeEmpty,r.G_SettingsSipServer)),e.sip_auth==="user"?(e.x_sip_username||(i.x_sip_username=r.localize(r.E_CannotBeEmpty,r.G_SettingsSipUsername)),e.x_sip_password||(i.x_sip_password=r.localize(r.E_CannotBeEmpty,r.G_SettingsSipPassword))):e.sip_auth==="ip"):e.type==="external"&&(e.sip_server||(i.sip_server=r.localize(r.E_CannotBeEmpty,r.G_SettingsSipServer)))}if(t.size(i))return i},sync:function(e,t,r){return r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/set/setting/"+t.get("key"),r.type="POST",r.data=JSON.stringify(t.toJSON({exclude:["_id"]})),n.sync.call(this,e,t,r)}})}),define("unifi/collection/Settings",["unifi/collection/Collection","underscore","backbone","unifi/model/Setting"],function(e,t,n,r){"use strict";return e.extend({model:r,bySite:!0,getSettingFromKey:function(e,n){var i=t(this.filter(function(t){return t.get("key")==e&&(!n||t.get("site_id")==n)})).last();return i||(i=new r({key:e,site_id:n})),i},url:function(){return"/api/s/"+SITE.name+"/get/setting"},testMail:function(e){return this.sync("test-mail",this,e)},sync:function(e,r,i){i=i||{};switch(e){case"test-mail":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/cfgmgr",i.type="POST",i.data=JSON.stringify(t.extend(i.data||{},{cmd:"test_mail"}))}return n.sync.call(this,e,r,i)}})}),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 %></span>\n\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="checkbox" id="enableDebugLogging" name="debug" value="0" />\n                    <span><%- msg.G_SettingsLoggingDebug %></span>\n                    <div id="configureRemoteSyslog" class="indented inline-form">\n                        <div class="syslog-config">\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>\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,n,r,i,s,o,u,a,f,l,c,h){"use strict";return e.extend(n.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"},ip:{input:"text",complex:!0,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),r.when(this._rendered=r.Deferred(),this._loaded=r.Deferred()).then(this.populate),this.models={},this.collection=this.app.collection("Settings",{fetch:{reload:!1,deferred:this._loaded}},s),this.models.site=this.app.collection("Sites",{},o).get(SITE.id),this.on("save-success",function(e,t,n){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(){e.prototype.render.call(this);if(!this.rendered&&(this.rendered=!0)){this.$el.html(n.template(l,{countryOptionsTemplate:n.template(c),timezoneOptionsTemplate:n.template(h),msg:i})),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=r(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){r(e.target).val()=="custom"?(r("#configureUplinkCustomHost").show(),r("#connectivityUplink").find(".error-msg").show()):(r("#configureUplinkCustomHost").hide(),r("#connectivityUplink").find(".error-msg").hide())}).filter(":checked").trigger("change"),this.$el.find("#configureConnectivityMonitor").on("change",function(){r(this).is(":checked")?r("#connectivityUplink").show():r("#connectivityUplink").hide()}).trigger("change"),this.$el.find("#configureSnmp, #configureRemoteLogging").on("change",function(){r(this).is(":checked")?r("#configureRemoteSyslog").show():r("#configureRemoteSyslog").hide()}).trigger("change"),this.$el.find("#runIsolatedApScan").on("click",function(e){e.preventDefault();var i=r(this),s=t.app.collection("Devices");i.prop("disabled",!0),s.scanUplink(),n.delay(function(){i.prop("disabled",!1)},15e3)});var s=this.models.site;s.get("attr_no_delete")?this.$el.find("button.delete").remove():this.$el.find("button.delete").on("click",function(e){e.preventDefault();var n=new u;n.show(i.N_ConfirmSiteDelete,function(){s.destroy({wait:!0,success:function(){window.location.href="/logout"},error:function(e,n,r){t.app.views.app.flash("error","Error",i.apiError(n))}})})}),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(){n.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"}),n.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=enable-snmp]").attr("checked",this.models.snmp.get("enabled")).trigger("change"),this.$el.find("input[name=snmp-community]").val(this.models.snmp.get("community"))):this.$el.find("input[name=enable-snmp]").trigger("change"),this.models.rsyslogd?(this.$el.find("input[name=enable-remote-logging]").attr("checked",this.models.rsyslogd.get("enabled")).trigger("change"),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]").trigger("change"),this.$el.find("input[name=port]").val(514),this.$el.find("input[name=debug]").val(0))},gather:function(e){var t={};if(!e||e=="site")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()};if(!e||e=="country")t.country={code:this.$el.find("select[name=country] option:selected").val()};if(!e||e=="locale")t.locale={timezone:this.$el.find("select[name=timezone] option:selected").val()};if(!e||e=="connectivity")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()};if(!e||e=="mgmt")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()};if(!e||e=="snmp")t.snmp={enabled:this.$el.find("input[name=enable-snmp]").is(":checked"),community:this.$el.find("input[name=snmp-community]").val()};if(!e||e=="rsyslogd")t.rsyslogd={enabled:this.$el.find("input[name=enable-remote-logging]").is(":checked"),ip:this.$el.find("input[name=ip]").val(),port:this.$el.find("input[name=port]").val(),debug:this.$el.find("input[name=debug]").is(":checked")};return e&&(t[e].key=e),e?t[e]:t},save:function(e){e&&e.preventDefault(),this.clear();var t=[];n.each(this.models,function(e,r){var i=e.validate(this.gather(r));n.size(i)&&(this.invalid(i,r),t.push(r))},this);if(!n.size(t)){this.$submit.trigger("saving"),this._deferred={};var i=[];n.each(this.models,function(e,t){i.push(this._deferred[t]=r.Deferred())},this),r.when.apply(r,i).then(r.proxy(this.success,this),r.proxy(this.error,this)),n.each(this.models,function(e,t){this._save(e,t)},this)}else this.$submit.trigger("invalid")},success:function(){this.$submit.trigger("success")},error:function(e,t){this.$el.find("fieldset.actions").prepend(r('<div class="error-msg">'+i.E_DataSave+": "+i.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="https://testgtwy.ippay.com/ippay/" 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 n=this.options.prefix||this.element.attr("name"),r=this.options.container||e("body");r.find("."+n+"-toggled").hide().filter("."+n+"-"+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(n,r){this.remove(e(r),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,n,r,i,s){"use strict";return e.extend(n.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),r.when(this._rendered=r.Deferred(),this._loaded=r.Deferred()).then(this.populate),this.collection=this.app.collection("Settings",{fetch:{reload:!1,deferred:this._loaded}}),this.on("save-success",function(e,t,n){this.collection.add(e,{merge:!0}),this.success.call(this,e,t,n)},this),this.on("save-error",function(e,t){this.error.call(this,e,t)},this),this.render()},render:function(){e.prototype.render.call(this);if(!this.rendered&&(this.rendered=!0)){this.$el.html(n.template(s,{msg:i})),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=r(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(){r(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(){r(this).find("option:selected").val()=="custom"?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){r(e.target).val()=="promotional"?r("#guestControlLandingPagePromoUrl").show():r("#guestControlLandingPagePromoUrl").hide()}).filter(":checked").trigger("change"),this.$el.find("#guestControlPortalUrlHostname").on("change",function(){var e=r(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(){r(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=r(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=r(this);e.addable({min:1,max:1e3,template:e.find("> div").clone(),add:r('<button class="button addable">'+i.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",r(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(e){r(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"),n.each(["restricted","allowed"],function(e){var t=this.$el.find("div.addable."+e);t.addable("reset",!0);for(var n=1,r=null;n<1e3;n++)(r=this.model.get(e+"_subnet_"+n))&&t.addable("add").addable("last").find("input").val(r);parseInt(t.addable("count"),10)===0&&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:this.$el.find("input[name=redirect_enabled]:checked").val()=="promotional",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=n.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=n.extend(e,{x_stripe_api_key:this.$el.find("input[name=x_stripe_api_key]").val()}),e=n.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=n.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=n.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=n.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")}),e.expire=="custom"&&(e.expire_number=this.$el.find("input[name=custom-expire-amount]").val(),e.expire_unit=this.$el.find("select[name=custom-expire-unit]").val()),n.each(["restricted","allowed"],function(t){var n=this.$el.find("input[name="+t+"]");n.each(function(n){++n,e[t+"_subnet_"+n]=r(this).val()||null});if(this.model)for(var i=n.length+1;i<1e3;i++)this.model.get(t+"_subnet_"+i)&&(e[t+"_subnet_"+i]=null)},this),n.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 r=t.valid.call(this,e);n.each(r,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 r=t.invalid.call(this,e);n.each(r,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(r('<div class="error-msg">'+i.E_DataSave+": "+i.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,n,r,i){"use strict";return e.extend({_templateId:i,_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=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")},args:function(){return{id:this.id,headline:this.create?r.G_SettingsCreateNewUserGroup:r.G_SettingsEditUserGroup+" - "+this.model.get("name"),msg:r}},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")&&this.model.get("qos_rate_max_down")!=-1).trigger("change"),this.$el.find("input[name=qos_rate_max_down]").val(this.model.get("qos_rate_max_down")!=-1?this.model.get("qos_rate_max_down"):""),this.$el.find("input[name=uprate-enabled]").prop("checked",this.model.get("qos_rate_max_up")&&this.model.get("qos_rate_max_up")!=-1).trigger("change"),this.$el.find("input[name=qos_rate_max_up]").val(this.model.get("qos_rate_max_up")!=-1?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,n,r){"use strict";return e.extend({validate:function(e,n){var i={},s=n?n.partial:null;if(!s||s=="name")e.name?this.validator.name(e.name)||(i.name=r.localize(r.E_InvalidName,r.G_Name)):i.name=r.localize(r.E_CannotBeEmpty,"Name");(!s||s=="qos_rate_max_down")&&e.downRate_enabled&&(e.qos_rate_max_down?this.validator.digits(e.qos_rate_max_down)||(i.qos_rate_max_down=r.localize(r.E_IncorrectIntegerType,"Downrate")):i.qos_rate_max_down=r.localize(r.E_CannotBeEmpty,"Downrate")),(!s||s=="qos_rate_max_up")&&e.upRate_enabled&&(e.qos_rate_max_up?this.validator.digits(e.qos_rate_max_up)||(i.qos_rate_max_up=r.localize(r.E_IncorrectIntegerType,"Uprate")):i.qos_rate_max_up=r.localize(r.E_CannotBeEmpty,"Uprate"));if(t.size(i))return i},sync:function(e,t,r){switch(e){case"create":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/add/usergroup",r.type="POST";break;case"update":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/upd/usergroup/"+t.id,r.type="POST",r.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/del/usergroup/"+t.id,r.type="POST"}return n.sync.call(this,e,t,r)}})}),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,n=[];return e&&e.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)&&(n=e.split("."),t=n[0]*16777216+n[1]*65536+n[2]*256+n[3]*1),t},t.long2ip=function(e){return[e>>>24,e>>>16&255,e>>>8&255,e&255].join(".")},t.ipsubnet_recommend=function(e,n){var r=t._ipsubnet2network(e);if(n===!1)n=0;else if(isNaN(n)||n<=0)n=r.bits<25?(25-r.bits)*5:1;return{ip:r.ip,is_ip_valid:t.ipsubnet_hasip(e,r.ip),is_mask_valid:r.bits<31&&r.bits>0,ipsubnet:t.long2ip(r.min_iplong)+"/"+r.bits,dhcp_start_ip:t.long2ip(r.min_iplong+n),dhcp_end_ip:t.long2ip(r.max_iplong)}},t.ipsubnet_hasip=function(e,n){var r=t.ip2long(n),i=t._ipsubnet2network(e);return r>=i.min_iplong&&r<=i.max_iplong},t._bits2netmask=function(e){var t=4294967295,n=1;for(var r=e;r<32;r++)t^=n,n<<=1;return t},t._ipsubnet2network=function(e){var n=e.split("/")[0],r=parseInt(e.split("/")[1],10),i=t._bits2netmask(r),s=~i,o=(t.ip2long(n)&i)>>>0,u=(t.ip2long(n)|s)>>>0;return o+=1,u-=1,{ip:n,ip_long:t.ip2long(n)>>>0,bits:r,netmask:i,min_iplong:o,max_iplong:u,num_ips:u-o+1}},t.ip_in_subnet=function(e,n,r){var i=t.ip2long(e),s=t.ip2long(n),o=(1<<32-r)-1^4294967295;return((i^s)&o)===0}}),define("unifi/model/Client",["unifi/model/Model","jquery","backbone","underscore","ubnt/backgrid","libs/moment","msg/Msg","ubnt/ubnt.ip"],function(e,t,n,r,i,s,o){"use strict";return e.extend({parse:function(t,n){return t=e.prototype.parse.call(this,t,n),t&&(t.tx_bytes?t.tx_bytes=parseInt(t.tx_bytes,10):t.tx_bytes=0,t.rx_bytes?t.rx_bytes=parseInt(t.rx_bytes,10):t.rx_bytes=0,t.last_seen?t.last_seen=parseInt(t.last_seen,10):t.last_seen=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 n={},i=t?t.partial:null;e.name&&!this.validator.name(e.name)&&(n.name=o.localize(o.E_InvalidName,o.G_PropertiesAlias));if(r.size(n))return n},name:function(){return this.get("name")||this.get("hostname")||this.get("mac")},ip2long:function(){return t.ip2long(this.get("ip"))},switch_port_suffix:function(e){var t=this.get("sw_mac"),n=this.get("sw_port");return t&&n?" #"+(e&&n.toString().length===1?" ":"")+n:""},wired_connection:function(){var e=this.get("sw_mac"),t=this.get("gw_mac"),n=this.get("sw_port");return e?e+this.switch_port_suffix(!0):t?t:""},connection:function(){return this.get("is_wired")?this.get("network"):this.get("essid")},isConnected:function(){var e=this.get("mac")&&!this.get("blocked");return e?!0:!1},userOrGuest:function(){return this.get("is_guest")?o.G_Guest:o.G_User},isGuest:function(){return this.get("is_guest")},uptime:function(e){return e=e||this.get("uptime"),e>0?i.Formatters.Duration.fromRaw(e||0):""},rssi:function(){var e=parseFloat(this.get("rssi"));return e||e===0?(e>45?e=45:e<5&&(e=5),e=(e-5)/40*99,(e===0?"0":e.toPrecision(2))+"%"):""},lastSeen:function(){var e=this.get("last_seen"),t;return e?(t=(new Date).getTime()/1e3-parseInt(e,10),isNaN(t)?"":t<86400?i.Formatters.Duration.fromRaw(t)+" ago":s(e+"","X").format("YYYY/MM/DD HH:mm:ss")):""},absoluteLastSeen:function(){var e=this.get("last_seen");return e?s(e+"","X").format("YYYY/MM/DD HH:mm:ss"):""},radioType:function(){return this.get("radio_proto")},is5g:function(){return this.get("radio")=="na"},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?i.Formatters.Bytes.fromRaw(e)+"B/sec":""},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?i.Formatters.Bytes.fromRaw(e)+" / "+i.Formatters.Bytes.fromRaw(t):""},sentPacketsOverBytes:function(){var e=this.get("tx_packets"),t=this.get("tx_bytes");return e&&t?i.Formatters.Bytes.fromRaw(e)+" / "+i.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,r){r=r||{};switch(e){case"update":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/upd/user/"+t.get("_id"),r.type="POST",r.data=JSON.stringify(t.changed);break;case"reconnect":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/cmd/stamgr",r.type="POST",r.data=JSON.stringify({mac:t.get("mac"),cmd:"kick-sta"});break;case"block":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/cmd/stamgr",r.type="POST",r.data=JSON.stringify({mac:t.get("mac"),cmd:"block-sta"});break;case"unblock":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/cmd/stamgr",r.type="POST",r.data=JSON.stringify({mac:t.get("mac"),cmd:"unblock-sta"});break;case"unauthorize":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/cmd/stamgr",r.type="POST",r.data=JSON.stringify({mac:t.get("mac"),cmd:"unauthorize-guest"});break;case"authorize":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/cmd/stamgr",r.type="POST",r.data=JSON.stringify({mac:t.get("mac"),cmd:"authorize-guest"})}return n.sync.call(this,e,t,r)}})}),define("unifi/collection/Clients",["unifi/collection/Collection","unifi/model/Client","underscore"],function(e,t,n){"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=n.groupBy(e,function(e){return e.get("essid")});return t},clientsPerEssidStats:function(){var t=this.clientsPerEssid(),r=[],i;return n.each(t,function(e,t){r.push({name:t,count:e.length})}),i=new e(r),i.sortBy(function(e){return-1*e.get("count")})}})}),define("unifi/model/insights/KnownClient",["unifi/model/Client","backbone","ubnt/backgrid","libs/moment"],function(e,t,n,r){"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"],function(e,t,n,r){"use strict";return n.extend({model:r,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/alluser"},sync:function(n,r,i){i=i||{};switch(n){case"read":i.contentType="application/json; charset=utf-8",i.type="POST",i.data=JSON.stringify(t.extend(i.data||{}))}return e.sync.call(this,n,r,i)}})}),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,n,r,i,s,o,u,a,f,l){"use strict";return e.extend({id:"settingsUserGroups",_templateId:n.template(l,{msg:o}),_formClass:t,_collectionType:{name:"UserGroups",Class:s},_pageable:!1,dependencies:function(){var e={KnownClients:f},t=[],i={},s=this;n.each(e,function(e,n){t.push(i[n]=r.Deferred())},this),r.when.apply(r,t).then(function(){s._dependencies.resolve()},function(){s._dependencies.reject()}),n.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:i[t]}},e)},this)},columns:function(){return[{name:"name",label:o.G_Name,editable:!1,cell:"string"},{name:"bandwidth",label:o.G_SettingsBandwidthLimit,editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){var t=e.get("qos_rate_max_down")==-1?"Unlimited":e.get("qos_rate_max_down")+" Kbps",n=e.get("qos_rate_max_up")==-1?"Unlimited":e.get("qos_rate_max_up")+" Kbps";return o.G_Download+": "+t+", "+o.G_Upload+": "+n},toRaw:function(e){return e}}})},{name:"_id",label:o.G_Actions,editable:!1,sortable:!1,headerCell:i.Headers.noSortHeader,cell:i.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 a).show(o.N_ConfirmDeleteSetting,function(){e.destroy({wait:!0,error:function(e,n){if(n.responseJSON.meta.msg==="api.err.ObjectReferredBy"){var r=JSON.parse(n.responseText).meta,i=r.name,s,a;a=t.options.app.collection("Clients").findWhere({mac:i}),a||(a=t.options.app.collection("KnownClients").findWhere({mac:i})),a&&(s=a.name(),n.responseJSON.meta.name=s,n.responseText=n.responseText.replace(i,s))}(new u).open(o.apiError(n,!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            <div class="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            <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            <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/FormView","underscore","jquery","msg/Msg","text!includes/settings/settingsNetworksFormTemplate.html","ubnt/ubnt.ip"],function(e,t,n,r,i,s){"use strict";return e.extend({_templateId:s,_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}},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;e.prototype.render.call(this);if(!t){var n=this.$el.find(".buttonset input[name=purpose]"),i=this.$el.find("input[name=dhcpd_enabled]"),s=this.$el.find("input[name=dhcpd_start]"),o=this.$el.find("input[name=dhcpd_stop]"),u=this.$el.find("input[name=dhcpguard_enabled]"),a=this.$el.find("input[name=dhcpd_ip_1]"),f=this.$el.find("input[name=ip_subnet]"),l=this.$el.find(".recommend");n.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||(n.on("change",function(){r(this).button("enable").siblings("input").not(":checked").button("disable")}),this.model.get("attr_hidden_id")&&this.$el.find("input[name=vlan]").parent("div").remove()),f.on("change",function(e,t){var u=r(this),a=u.val(),f=0,l;n.filter(":checked").val()=="remote-user-vpn"&&(f=!1,t=!0),a&&i.is(":checked")&&(l=r.ipsubnet_recommend(a,f))&&((!s.val()||t)&&s.val(l.dhcp_start_ip).trigger("change",!0).trigger("validate.validator"),(!o.val()||t)&&o.val(l.dhcp_end_ip).trigger("change",!0).trigger("validate.validator")),u.trigger("suggest",l)}),f.on("suggest",function(e,t){var u=r(this),a=u.val(),f=!1,c=0;n.filter(":checked").val()=="remote-user-vpn"&&(c=!1),a&&i.is(":checked")&&(t=t||r.ipsubnet_recommend(a,c))&&(f=s.val()!=t.dhcp_start_ip||o.val()!=t.dhcp_end_ip),l[f?"show":"hide"]()}),l.on("click",function(e){e.preventDefault(),f.trigger("change",!0)}),s.add(o).add(i).on("change",function(e,t){t||f.trigger("suggest")}),i.on("change",function(){var e=r(this);e.is(":visible")&&(e.is(":checked")?s.add(o).prop("disabled",!1):s.add(o).prop("disabled",!0))}).trigger("change"),u.on("change",function(){var e=r(this);e.is(":visible")&&(e.is(":checked")?a.prop("disabled",!1):a.prop("disabled",!0))}).trigger("change"),n.on("change",function(){r(this).val()=="remote-user-vpn"?(s.add(o).prop("disabled",!0),f.trigger("change")):(i.trigger("change"),f.trigger("suggest"))}),this.$el.find(".buttonset input[name=purpose]:checked").filter(":checked").trigger("change"),this.renderSites()}},renderSites:function(){var e=this.$el.find("select[name=remote_site_id]"),t=e.val(),i=n.compact(this.collection.pluck("remote_site_id")),s=this.sites.where({role:"admin"});e.empty(),n.each(s,r.proxy(function(t){t.id!=SITE.id&&(t.id==this.model.get("remote_site_id")||n.indexOf(i,t.id)===-1)&&e.append(r('<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?i.G_SettingsCreateNewNetwork:i.G_SettingsEditNetwork+" - "+this.model.get("name"),msg:i}},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),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"):""))},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 r(this).is(":visible")&&r(this).is(":checked")})||e=="remote-user-vpn",s={name:this.$el.find("input[name=name]").val(),enabled:this.model.get("id")?this.model.get("enabled"):!0,purpose:e,is_nat:e=="site-vpn"?!1:!0};if(e=="corporate"||e=="guest"||e=="remote-user-vpn"||e=="voip")s=n.extend(s,{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()});if(e=="corporate"||e=="guest"||e=="vlan-only"||e=="voip")s=n.extend(s,{dhcpguard_enabled:this.$el.find("input[name=dhcpguard_enabled]").is(function(){return r(this).is(":visible")&&r(this).is(":checked")}),dhcpd_ip_1:this.$el.find("input[name=dhcpd_ip_1]").val()});if(e=="corporate"||e=="guest"||e=="vlan-only")s=n.extend(s,{vlan_enabled:!!t,vlan:t});return e=="site-vpn"&&(s=n.extend(s,{remote_site_id:this.$el.find("select[name=remote_site_id]").val()})),e=="remote-user-vpn"&&(s=n.extend(s,{exposed_to_site_vpn:this.$el.find("input[name=exposed_to_site_vpn]").is(function(){return r(this).is(":visible")&&r(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 s.vlan,delete s.vlan_enabled),s},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,n){t.prototype.error.call(this),this.$el.find("fieldset.actions").prepend(r('<div class="error-msg">'+i.E_DataSave+": "+i.apiError(n,!0)+"</div>"))}})}),define("unifi/model/Network",["unifi/model/Model","jquery","underscore","backbone","msg/Msg","ubnt/ubnt.ip"],function(e,t,n,r,i){"use strict";return e.extend({validate:function(e,r){var s={},o=r?r.partial:null,u=e.ip_subnet?e.ip_subnet.split("/"):null,a=!1,f,l;u&&u.length>1&&(f=u[0],l=u[1]);if(!o||o=="name")e.name?this.validator.name(e.name)||(s.name=i.localize(i.E_InvalidName,i.G_Name)):o||(s.name=i.localize(i.E_CannotBeEmpty,i.G_Name));if(!o||o=="vlan"){if(e.purpose=="corporate"||e.purpose=="guest")e.vlan||!this.get("attr_no_delete")&&this.get("attr_hidden_id")!="default"&&(s.vlan=i.localize(i.E_CannotBeEmpty,i.G_SettingsVLAN));e.vlan&&!this.validator.range(e.vlan,2,4009)&&(s.vlan=i.localize(i.E_IncorrectNumberRange,i.G_SettingsVLAN,2,4009))}if(!o||o=="ip_subnet")if(e.purpose=="corporate"||e.purpose=="guest"||e.purpose=="remote-user-vpn"||e.purpose=="voip")if(!e.ip_subnet)o||(s.ip_subnet=i.localize(i.E_CannotBeEmpty,i.G_SettingsIPSubnet));else if(!this.validator.subnet(e.ip_subnet))s.ip_subnet=i.localize(i.E_IncorrectIPSubnetSpec,e.ip_subnet);else{var c=t.ipsubnet_recommend(e.ip_subnet);if(!c.is_ip_valid||!c.is_mask_valid)s.ip_subnet=i.localize(i.E_IncorrectIPSubnetSpec,e.ip_subnet)}if(!o||o=="dhcpd_start")e.dhcpd_enabled?e.dhcpd_start?this.validator.ip(e.dhcpd_start)?t.ip_in_subnet(f,e.dhcpd_start,l)||(s.dhcpd_start=i.localize(i.E_InvalidDHCPRange,e.dbchp_start),a=!0):s.dhcpd_start=i.localize(i.E_IncorrectIPAddress,e.dhcpd_start):o||(s.dhcpd_start=i.localize(i.E_CannotBeEmpty,i.G_SettingsIPStart)):e.dhcpd_start&&!this.validator.ip(e.dhcpd_start)&&(s.dhcpd_start=i.localize(i.E_IncorrectIPAddress,e.dhcpd_start));if(!o||o=="dhcpd_stop")e.dhcpd_enabled?e.dhcpd_stop?this.validator.ip(e.dhcpd_stop)?!a&&!t.ip_in_subnet(f,e.dhcpd_stop,l)&&(s.dhcpd_stop=i.localize(i.E_InvalidDHCPRange,e.dhcpd_stop)):s.dhcpd_stop=i.localize(i.E_IncorrectIPAddress,e.dhcpd_stop):o||(s.dhcpd_stop=i.localize(i.E_CannotBeEmpty,i.G_SettingsIPEnd)):e.dhcpd_stop&&!this.validator.ip(e.dhcpd_stop)&&(s.dhcpd_stop=i.localize(i.E_IncorrectIPAddress,e.dhcpd_stop));if(!o||o=="radius_ip_1")e.radius_ip_1?this.validator.ip(e.radius_ip_1)||(s.radius_ip_1=i.localize(i.E_IncorrectIPAddress,e.radius_ip_1)):e.purpose=="remote-user-vpn"&&(o||(s.radius_ip_1=i.localize(i.E_CannotBeEmpty,i.G_SettingsRadiusIP)));(!o||o=="dhcpd_ip_1")&&e.dhcpguard_enabled&&(e.dhcpd_ip_1?e.dhcpd_ip_1&&!this.validator.ip(e.dhcpd_ip_1)&&(s.dhcpd_ip_1=i.localize(i.E_IncorrectIPAddress,e.dhcpd_ip_1)):o?this.validator.ip(e.dhcpd_ip_1)||(s.dhcpd_ip_1=i.localize(i.E_IncorrectIPAddress,e.dhcpd_ip_1)):s.dhcpd_ip_1=i.localize(i.E_CannotBeEmpty,i.G_SettingsDHCPTrustedServerIp));if(!o||o=="x_radius_secret_1")e.x_radius_secret_1||e.purpose=="remote-user-vpn"&&(o||(s.x_radius_secret_1=i.localize(i.E_CannotBeEmpty,i.G_SettingsRadiusPassword)));if(n.size(s))return s},enable:function(e){return this.save({enabled:!0},n.extend(e,{_method:"enable"}))},disable:function(e){return this.save({enabled:!1},n.extend(e,{_method:"disable"}))},rebuild:function(e){return this.sync("rebuild",this,e)},sync:function(e,t,n){n=n||{},n._method&&(e=n._method,delete n._method);if(this.get("purpose")=="site-vpn")switch(e){case"create":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/cmd/sitemgr",n.type="POST",n.data=JSON.stringify({cmd:"add-site-vpn",name:this.get("name"),site:this.get("remote_site_id")});break;case"enable":case"disable":case"rebuild":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/cmd/sitemgr",n.type="POST",n.data=JSON.stringify({cmd:e+"-site-vpn",name:this.get("name"),site:this.get("remote_site_id")});break;case"delete":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/cmd/sitemgr",n.type="POST",n.data=JSON.stringify({cmd:"delete-site-vpn",site:this.get("remote_site_id")})}else switch(e){case"create":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/add/networkconf",n.type="POST";break;case"enable":case"disable":case"update":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/upd/networkconf/"+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/networkconf/"+t.id,n.type="POST"}return r.sync.call(this,e,t,n)}})}),define("unifi/collection/Networks",["unifi/collection/Collection","underscore","unifi/model/Network"],function(e,t,n){"use strict";return e.extend({model:n,bySite:!0,parse:function(n){return n=e.prototype.parse.call(this,n),t.each(n,function(e,t){!e.purpose&&e.remote_site_id&&(n[t].purpose="site-vpn")}),n},filterByPurpose:function(e){return this.filter(function(n){return t.isArray(e)?t.indexOf(e,n.get("purpose"))!=-1:n.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,n,r,i,s,o,u){"use strict";return e.extend({id:"settingsNetworks",_templateId:n.template(u,{msg:o}),_formClass:t,_collectionType:{name:"Networks",Class:s},_pageable:!1,columns:function(){return[{name:"name",label:o.G_Name,editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:r.proxy(function(e){if(e.get("purpose")=="site-vpn"){var t=this.app.collection("Sites"),n=t.findWhere({_id:e.get("remote_site_id")}),r="";return n&&n.get("role")=="admin"&&(r=" (Site: "+n.get("desc")+")"),e.get("name")+r}return e.get("name")},this),toRaw:function(e){return e}}})},{name:"purpose",label:o.G_SettingsPurpose,editable:!1,cell:"string"},{name:"ip_subnet",label:o.G_SettingsSubnet,editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){return e.get("purpose")=="site-vpn"?(e.get("remote_site_subnets")||[]).join(", "):e.get("ip_subnet")},toRaw:function(e){return e}}})},{name:"vlan",label:o.G_SettingsVLAN,editable:!1,cell:"string"},{name:"enabled",label:o.G_Actions,editable:!1,sortable:!1,headerCell:i.Headers.noSortHeader,cell:i.Cells.ActionsCell.extend({actions:{edit:{icon:"ubnt-icon-edit",callback:this.rowEdit,render:function(e){return e.get("purpose")!="site-vpn"}},"delete":{requiresAdminPrivilege:!0,icon:"ubnt-icon-trash",callback:this.rowDelete,options:this.app.collection("Sites"),render:function(e,t){if(e.get("purpose")=="site-vpn"){var n=t.findWhere({_id:e.get("remote_site_id")});return n&&n.get("role")=="admin"}return!e.get("attr_no_delete")}}}})}]},rowRebuild:function(e,t){var n=this;e.rebuild({success:function(t,r,i){i.enabled&&n.options.app.views.app.flash("success","Success",o.localize(o.G_SettingsNetworkEnabled,e.get("name"))),e.set("enabled",!0)}})},rowEnable:function(e,t){var n=this,i=r(t.target);i.prop("disabled",!0),e.enable({wait:!0,success:function(t,r,i){i.enabled&&(n.options.app.views.app.flash("success","Success",o.localize(o.G_SettingsNetworkEnabled,e.get("name"))),e.set("enabled",i.enabled)),e.set("enabled",i.enabled)},error:function(e){n.options.app.views.app.flash("error","Error",o.apiError(e))},complete:function(){i.prop("disabled",!1)}})},rowDisable:function(e,t){var n=this,i=r(t.target);i.prop("disabled",!0),e.disable({wait:!0,success:function(t,r,i){n.options.app.views.app.flash("success","Success",o.localize(o.G_SettingsNetworkDisabled,e.get("name")))},error:function(e){n.options.app.views.app.flash("error","Error",o.apiError(e))},complete:function(){i.prop("disabled",!1)}})}})}),define("unifi/view/app/ScheduleMixin",["jquery","underscore","libs/moment","msg/Msg"],function(e,t,n,r){"use strict";return{renderSchedule:function(){this.$el.find(".row").each(function(){var t=e(this),r=t.find(".day input[type=checkbox]"),i=t.find(".slider"),s=t.find(".hours");r.on("change",function(){e(this).is(":checked")?(s.show(),i.show()):(s.hide(),i.hide())}).trigger("change"),i.slider({range:!0,min:0,max:1439,step:15,slide:function(t,n){e(this).slider("option","change").apply(this,arguments)},change:function(t,r){var i=e(this),o=Math.max(r.values[0],i.slider("option","min")),u=Math.floor(o/60),a=o-u*60,f=Math.min(r.values[1],i.slider("option","max")),l=Math.floor(f/60),c=f-l*60,h="h:mma";s.find("strong").text(n({hour:u,minute:a}).format(h)+"-"+n({hour:l,minute:c}).format(h))}}),i.slider("values",[480,1080])}),this._defaultSchedule&&this.populateSchedule(this._defaultSchedule)},populateSchedule:function(n){var r=this.$el.find(".day input[type=checkbox]");r.prop("checked",!1),n&&t.each(n,e.proxy(function(n){var r=n.match(/([a-z]+)(-([a-z]+))?\|([\d]+)-([\d]+)/),i=r[1],s=r[3],o=parseInt(r[4].substr(0,2),10),u=parseInt(r[4].substr(2),10),a=parseInt(r[5].substr(0,2),10),f=parseInt(r[5].substr(2),10),l;switch(i+"-"+s){case"mon-fri":l=["mon","tue","wed","thu","fri"];break;case"sat-sun":l=["sat","sun"];break;case"mon-sun":l=["mon","tue","wed","thu","fri","sat","sun"];break;default:l=[i]}t.each(l,e.proxy(function(e){this.$el.find("input[type=checkbox][name="+e+"]").prop("checked",!0),this.$el.find(".row."+e+" .slider").slider("values",[o*60+u,a*60+f])},this))},this)),r.trigger("change")},gatherSchedule:function(){var r=[];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=this.$el.find(".row."+e+" .slider").slider("values"),i,s;i=n({hour:Math.floor(t[0]/60),minute:Math.round(60*(t[0]/60%1))}).format("HHmm"),s=n({hour:Math.floor(t[1]/60),minute:Math.round(60*(t[1]/60%1))}).format("HHmm"),r.push(e+"|"+i+"-"+s)}},this)),r},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_SettingsAutoRespHours %>: <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_SettingsAutoRespHours %>: <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_SettingsAutoRespHours %>: <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_SettingsAutoRespHours %>: <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_SettingsAutoRespHours %>: <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_SettingsAutoRespHours %>: <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_SettingsAutoRespHours %>: <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,n,r,i,s,o){"use strict";return e.extend(r.extend({},t,{_templateId:o,_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;e.prototype.render.call(this,!0);if(!t){this.renderSchedule();var n=this.$el.find("select[name=user-group]").empty();this.groups.user.each(function(e){n.append(i('<option value="'+e.id+'"></option>').prop("selected",e.get("attr_no_delete")).text(e.get("name")))},this),n.trigger("change"),n.selectmenu("refresh");if(this.model&&this.groups.wlan&&this.groups.wlan.get("roam_enabled")){var o=this.$el.find(".buttonset.security");o.buttonset("destroy"),this.$el.find(".roam-enabled").remove(),o.find("input[type=radio]").first().prop("checked",!0),o.buttonset()}r.defer(i.proxy(function(){this.$el.find(".buttonset input[name=security]").radiotoggle({container:this.$el})},this)),r.each(["radius","radius_acct"],function(e){var t=this,n=this.$el.find("div.addable."+e),o=this.model._addableSettings[e].min,u=this.model._addableSettings[e].max;n.sortable({cursor:"move",items:"div.row",update:function(e,r){var i=n.hasClass("radius_acct")?"radius_acct":"radius";a(),t.validateRadius(i)}});var a=function(){var e=n.find(".row"),t=i(e).length,s=1;r.each(e,function(e,t){var n=i(e);n.hasClass("error-msg")||n.find(".serverIndex").text(s++ +" ")},this),!o||t>o?n.find(".row button").removeClass("hidden"):n.find(".row button").addClass("hidden"),t>1?(n.sortable("option","disabled",!1),n.find("div.row").css("cursor","move")):(n.sortable("option","disabled",!0),n.find("div.row").css("cursor","inherit"))};n.addable({min:o,max:u,template:n.find("> div.row").clone(),add:i('<button class="button addable">'+(e=="radius"?s.G_AddNewRadius:s.G_AddNewRadiusAccounting)+"</button>"),added:function(e){e.find("button").on("click",function(e){return e.preventDefault(),n.addable("remove",i(this)),!1}),a(),e.find("input[type=password]").password({suffix:"-text"})},removed:function(){var e=this.element.hasClass("radius_acct")?"radius_acct":"radius";a(),t.validateRadius(e)}}),n.children(":not(button.addable)").remove(),n.addable("reset")},this),this.$el.find("input[name=use-vlan-id]").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");var u=this.$el.find("fieldset.schedule");this.$el.find("input[name=enable-schedule]").on("change",function(){var e=i(this);e.is(":checked")?u.show():u.hide()}).trigger("change")}this.populate()},args:function(){return{id:this.id,headline:this.create?s.G_SettingsCreateNewWirelessNetwork:s.G_SettingsEditWirelessNetwork+" - "+this.model.get("name"),group:this.groups.wlan.get("name"),msg:s}},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")||"auto").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"),r.each(["radius","radius_acct"],function(e){var t=this.$el.find("div.addable."+e),n=this.model._addableSettings[e].min,r=this.model._addableSettings[e].max,i=this.model._addableSettings[e].defaultPort;t.addable("reset",!0);for(var s=1,o=null,u=null,a=null;s<=r;s++)if(o=this.model.get(e+"_ip_"+s))u=this.model.get(e+"_port_"+s)||i,a=this.model.get("x_"+e+"_secret_"+s),t.addable("add").addable("last").find('input[name="'+e+'_ip"]').val(o).end().find('input[name="'+e+'_port"]').val(u).end().find('input[name="x_'+e+'_secret"]').val(a);n&&parseInt(t.addable("count"),10)===0&&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,e.security==="wpaeap"&&r.each(["radius","radius_acct"],function(t){var n=this.$el.find("div.addable."+t+" > div"),r=n.length,i=this.model._addableSettings[t].min,s=this.model._addableSettings[t].max;for(var o=1,u=null,a=null,f=null;o<=s;o++){var l=o-1,c=l<r?n.eq(l):null;e[t+"_ip_"+o]=c?c.find('input[name="'+t+'_ip"]').val()||null:"",e[t+"_port_"+o]=c?c.find('input[name="'+t+'_port"]').val()||null:"",e["x_"+t+"_secret_"+o]=c?c.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),n=t.find(".row"),s=!0;this.valid(e),r.each(n,function(t){if(s){var n=['input[name="'+e+'_ip"]','input[name="'+e+'_port"]','input[name="x_'+e+'_secret"]'];r.each(n,function(e){if(s){var n=i(t).find(e);s=this.validateRadiusElement(n)}},this)}},this)},validateRadiusElement:function(e){var t=this,n=null;if(t.model){var r=e.attr("name"),i=e.parent().index();e.closest(".addable").find("div:first-child").hasClass("error-msg")||(i+=1),n=t.model.validate(t.gather(),{partial:r+"_"+i}),n&&t.invalid(n)}return!n},prevalidator:function(){n.prevalidator.call(this);var e=this;r.each(["radius","radius_acct"],function(t){var n=['input[name="'+t+'_ip"]','input[name="'+t+'_port"]','input[name="x_'+t+'_secret"]'];this.$el.on("change",n.join(", "),function(n){e.validateRadius(t)})},this)},valid:function(e){var t=n.valid.call(this,e),r=e.indexOf("radius_acct")!==-1?"radius_acct":e.indexOf("radius")!==-1?"radius":e;switch(r){case"radius":case"radius_acct":var i=e.split("_"),s=i.join("_"),o=['input[name="'+r+'_ip"]','input[name="'+r+'_port"]','input[name="x_'+r+'_secret"]'];this.$el.find(".addable."+r+" .row").find(o.join(", ")).removeClass("error"),this.$el.find(".addable."+r+" .error-msg").remove()}},invalid:function(e){var t=n.invalid.call(this,e);r.each(e,function(e,t){var n=t.indexOf("radius_acct")!==-1?"radius_acct":t.indexOf("radius")!==-1?"radius":t;switch(n){case"radius":case"radius_acct":if(this.$el.find(".addable."+n+" .error-msg").length===0){var r=t.split("_"),s=r.splice(r.length-1,1)[0],o=r.join("_");this.$el.find(".addable."+n+" .row:nth-child("+s+")").find('input[name="'+o+'"]').addClass("error"),i('<div class="error-msg">'+e+"</div>").insertBefore(this.$el.find(".addable."+n+" .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">\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    					<option value="5">5</option>\n    					<option value="6">6</option>\n    					<option value="7">7</option>\n    					<option value="8">8</option>\n    					<option value="9">9</option>\n    					<option value="10">10</option>\n    					<option value="11">11</option>\n    				</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">\n    					<option value="36" band="1">36</option>\n    					<option value="40" band="1">40</option>\n    					<option value="44" band="1">44</option>\n    					<option value="48" band="1">48</option>\n    					<option value="149" band="3">149</option>\n    					<option value="153" band="3">153</option>\n    					<option value="157" band="3">157</option>\n    					<option value="161" band="3">161</option>\n    					<option value="165" band="3">165</option>\n    				</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/view/settings/WirelessNetworksGroupFormView",["unifi/view/settings/FormView","underscore","jquery","msg/Msg","text!includes/settings/settingsWirelessNetworksGroupFormTemplate.html"],function(e,t,n,r,i){"use strict";return e.extend({_templateId:i,_prevalidate:{name:{input:"text"},maxsta:{input:"text",complex:!0},"load-balancing-enabled":{onchange:"maxsta"}},render:function(){var t=this.rendered;e.prototype.render.call(this);if(!t){var r=this;this.$el.find("select[name=roaming-radio]").on("change",function(){r.$el.find(".roaming-channel").hide().filter(".roaming-channel-"+n(this).val()).show()}).trigger("change"),this.$el.find("input[name=roaming-enabled]").on("change",function(){n(this).is(":checked")?(r.$el.find("div.fields.mobility").show(),r.$el.find("div.fields.etc").hide(),r.$el.find("select[name=roaming-radio]").trigger("change")):(r.$el.find("div.fields.mobility").hide(),r.$el.find("div.fields.etc").show())}).trigger("change"),this.$el.find("input[name=minimum-rssi-enabled], input[name=load-balancing-enabled]").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.create||this.$el.find("input[name=roaming-enabled]").prop("disabled",!0)}},args:function(){return{id:this.id,headline:this.create?r.G_SettingsAddWLANGroup:r.G_SettingsEditWLANGroup+" - "+this.model.get("name"),msg:r}},populate:function(){var e=this;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")),this.$el.find("select[name=roaming-radio]").val(this.model.get("roam_radio")||"ng"),this.$el.find("select[name=roaming-channel-ng]").val(function(){return e.model.get("roam_channel_ng")||n(n(this).find("option")[0]).val()}),this.$el.find("select[name=roaming-channel-na]").val(function(){return e.model.get("roam_channel_na")||n(n(this).find("option")[0]).val()}),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("select[name=roaming-radio]").trigger("change"),this.$el.find("input[name=roaming-enabled]").trigger("change"),this.$el.find("select[name=roaming-channel-ng]").trigger("change"),this.$el.find("select[name=roaming-channel-na]").trigger("change"),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={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(),roam_channel_ng:this.$el.find("select[name=roaming-channel-ng]").val(),roam_channel_na:this.$el.find("select[name=roaming-channel-na]").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 e?t.maxsta=this.$el.find("input[name=maxsta]").val():t.maxsta="",t},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,n){"use strict";return t.extend(e.Model.prototype,{getSelectMenuLabel:function(){if(this.get("roam_enabled")!==undefined&&this.get("roam_enabled")){var e=this.get("roam_radio"),t;return e==="na"?t=this.get("roam_channel_na"):e==="ng"&&(t=this.get("roam_channel_ng")),this.get("name")+" (Zero-Handoff, radio "+e+", channel "+t+")"||"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&&(typeof this.options.defaultOption=="string"?this.$el.append(n('<option value=""></option>').text(this.options.defaultOption).addClass("permanent")):typeof this.options.defaultOption=="object"&&this.$el.append(n("<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 r=this,i=n("<option></option>").val(e.id).text(e.getSelectMenuLabel());t?t.append(i):this.$el.append(i)}},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=n("<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||n.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,n,r){"use strict";return e.extend({validate:function(e,n){var i={},s=n?n.partial:null;if(!s||s=="name")e.name?this.validator.name(e.name)||(i.name=r.localize(r.E_InvalidName,r.G_Name)):i.name=r.localize(r.E_CannotBeEmpty,r.G_Name);(!s||s=="maxsta")&&e.loadbalance_enabled&&(e.maxsta?this.validator.range(e.maxsta,1,65535)||(i.maxsta=r.localize(r.G_MaximumNumberClnts,1,128)):i.maxsta=r.localize(r.E_CannotBeEmpty,"Number of clients"));if(t.size(i))return i},sync:function(e,t,r){switch(e){case"create":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/add/wlangroup",r.type="POST";break;case"update":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/upd/wlangroup/"+this.id,r.type="POST",r.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/del/wlangroup/"+this.id,r.type="POST"}return n.sync.call(this,e,t,r)}})}),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(e){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,n,r){"use strict";return e.extend({_addableSettings:{radius:{min:1,max:4,defaultPort:1812},radius_acct:{min:0,max:4,defaultPort:1813}},validate:function(e,n){var i={},s=n?n.partial:null;if(!s||s=="name")e.name?this.validator.ssid(e.name)||(i.name=r.localize(r.E_InvalidSSID,r.G_Name)):s||(i.name=r.localize(r.E_CannotBeEmpty,r.G_Name));switch(e.security){case"wep":if(!s||s=="x_wep")e.x_wep?this.validator.wep(e.x_wep)||(i.x_wep=r.localize(r.E_InvalidWEP,r.G_SettingsWEPKey)):i.x_wep=r.localize(r.E_CannotBeEmpty,r.G_SettingsWEPKey);break;case"wpapsk":if(!s||s=="x_passphrase")e.x_passphrase?this.validator.password(e.x_passphrase)||(i.x_passphrase=r.localize(r.E_InvalidPassphrase,r.G_SettingsSecurityKey)):i.x_passphrase=r.localize(r.E_CannotBeEmpty,r.G_SettingsSecurityKey);break;case"wpaeap":t.each(["radius","radius_acct"],function(t){var n=[];for(var o=1;o<=this._addableSettings[t].max;o++){var u=null;(!s||s==t+"_ip_"+o)&&e[t+"_ip_"+o]!==""&&(e[t+"_ip_"+o]===null?i[t+"_ip_"+o]=r.localize(r.E_CannotBeEmpty,r.G_IPAddress):this.validator.ip(e[t+"_ip_"+o])||(i[t+"_ip_"+o]=r.localize(r.E_IncorrectIPAddress,r.G_IPAddress))),(!s||s==t+"_port_"+o)&&e[t+"_port_"+o]!==""&&(e[t+"_port_"+o]===null?i[t+"_port_"+o]=r.localize(r.E_CannotBeEmpty,r.G_Port):this.validator.range(e[t+"_port_"+o],1,65535)||(i[t+"_port_"+o]=r.localize(r.E_IncorrectNumberRange,r.G_Port,1,65535))),(!s||s=="x_"+t+"_secret_"+o)&&e["x_"+t+"_secret_"+o]!==""&&e["x_"+t+"_secret_"+o]===null&&(i["x_"+t+"_secret_"+o]=r.localize(r.E_CannotBeEmpty,r.G_PW)),e[t+"_ip_"+o]&&(u=e[t+"_ip_"+o]+"|",e[t+"_port_"+o]&&(u+=e[t+"_port_"+o]));if(!s||s==t+"_ip_"+o||s==t+"_port_"+o)if(n.indexOf(u)!==-1){var a=t=="radius"?r.G_SettingsRadiusServer:r.G_SettingsRadiusAccountingServer;i[t+"_ip_"+o]=r.localize(r.E_MustBeUnique,a)}u&&n.push(u)}},this)}(!s||s=="vlan")&&e.vlan_enabled&&(e.vlan?this.validator.range(e.vlan,2,4095)||(i.vlan=r.localize(r.E_IncorrectNumberRange,r.G_SettingsVLANId,2,4095)):i.vlan=r.localize(r.E_CannotBeEmpty,r.G_SettingsVLANId));if(t.size(i))return i},sync:function(e,t,r){switch(e){case"create":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/add/wlanconf",r.type="POST";break;case"update":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/upd/wlanconf/"+this.id,r.type="POST",r.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/del/wlanconf/"+this.id,r.type="POST"}return n.sync.call(this,e,t,r)}})}),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,n,r,i,s,o,u,a,f,l,c,h,p){"use strict";return e.extend({id:"settingsWirelessNetworks",_templateId:u.template(p,{msg:h}),_formClass:t,_groupFormClass:n,_collectionType:{name:"Wlans",Class:c},_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:s.StringCell.extend({formatter:o.Formatters.Boolean})},{name:"_id",label:h.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}}})}]},load:function(t,n){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:f,UserGroups:l},t=[],n={},r=this;u.each(e,function(e,r){t.push(n[r]=a.Deferred())},this),a.when.apply(a,t).then(function(){r._dependencies.resolve()},function(){r._dependencies.reject()}),u.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:n[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"),n=t.getDefault().id,s=this.$el.find("form.groups"),o=s.find("button.add-group"),f=s.find("button.edit-group"),l=s.find("button.delete-group"),c=s.find("select[name=wlan-groups]");o.on("click",function(){e.groupForm(new t.model)}),f.on("click",function(t){e.groupForm(e.models.group)}),l.on("click",function(t){var r=e.models.group;r.get("attr_no_delete")||(new i).show(h.N_ConfirmDeleteWlanGroup,function(){r.destroy({wait:!0,success:function(){c.val(n).trigger("change").selectmenu("close").selectmenu("resize"),e.app.refresh()}})})}),this.$groupSelectMenu=new r({el:c,collection:t,isComparatorSort:!0,addable:function(e){return!e.get("attr_hidden")}}),c.on("buttons",function(){var n=e.models.group=t.get(a(this).val());n&&(l.prop("disabled",n.get("attr_no_delete")===!0),f.prop("disabled",n.get("attr_no_edit")===!0),e.grids.content.setFilter("wlangroup_id",n.id,1),e.checkAddable())}).on("change",function(){a(this).trigger("buttons")}).val(n).trigger("change").selectmenu("close").selectmenu("resize");var p=function(){u.delay(function(){c.val(e.models.group.id).trigger("change").selectmenu("close").selectmenu("resize")},10)};this.listenTo(t,"add",p)},groupButtons:function(){this.$groupForms.find("> div").length===0?(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,n=t&&this.groupForms[t]?this.groupForms[t]:null,r=this;return n||(n=new this._groupFormClass({app:this.app,container:this.$groupForms,model:e,collection:this.app.collection("WlanGroups"),count:u.size(this.groupForms)+1}),this.listenTo(n,"render",function(){r.groupButtons(),r.renderForm(n)}),this.listenTo(n,"remove",function(){r.removeForm(n),r.groupButtons()}),this.listenTo(n,"save-success",a.proxy(function(e){this.models.group=e},this)),t&&(this.groupForms[t]=n)),n.render(),this.$el.trigger("groupForm"),n},form:function(t,n){var r=e.prototype.form.call(this,t,n,!0);return r.groups={wlan:t&&t.id?this.app.collection("WlanGroups").get(t.get("wlangroup_id")):this.models.group,user:this.app.collection("UserGroups",{},l)},r.render(),r},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=u.size(this.collection.where({wlangroup_id:this.models.group.id}));this.$createBtn[e>=4?"hide":"show"]()}},remove:function(){var t=this,n=this.app.collection("WlanGroups"),r=n.getDefault().id,i=this.$el.find("form.groups"),s=i.find("button.add-group"),o=i.find("button.edit-group"),u=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),s.off("click"),o.off("click"),u.off("click"),a.off("buttons"),a.off("change"),this.stopListening(n,"add"),e.prototype.remove.apply(this,arguments)}})}),define("unifi/model/Audio",["unifi/model/Model","underscore","backbone"],function(e,t,n){"use strict";return e.extend({url:function(e){return e?"/upload/audio/s/"+SITE.name:"/api/s/"+SITE.name+"/list/audio"},getUploadUrl:function(){return"/upload/s/"+SITE.name+"/audio/"+this.get("_id")},getFileUrl:function(){return this.get("url")},sync:function(e,t,r){r=r||{};switch(e){case"create":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/add/audio",r.type="POST";break;case"update":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/upd/audio/"+t.id,r.type="POST",r.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"read":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/get/audio/"+t.get("_id"),r.type="GET"}return n.sync.call(this,e,t,r)}})}),define("text!includes/settings/settingsVoipAudioPickerTemplate.html",[],function(){return'<div class="audio-picker">\n    <div class="audio-info">\n        <span class="type-file label"><%- msg.G_SettingAudioPickerFilename %></span><span class="type-file filename"></span>\n        <span class="type-tts label"><%- msg.G_SettingsAudioPickerTextToSpeech %></span><span class="type-tts text"></span>\n        <span class="converting">Converting...</span>\n        <audio class="audio" preload="none"><source type="audio/mp3" /></audio>\n        <button class="button auto play">Play</button>\n        <button class="button auto edit">Edit</button>\n    </div>\n    <div class="audio-form">\n        <div class="audio-type">\n            <select name="<%- name %>">\n                <option value="file"><%- msg.G_SettingsAudioPickerUploadAudio %></option>\n                <option value="tts"><%- msg.G_SettingsAudioPickerTextToSpeech %></option>\n            </select>\n        </div>\n        \n        <div class="next-steps for for-file">\n            <input type="file" name="file" style="position: absolute; left: -9999px;" accept="audio/wav, audio/mp3" />\n        </div>\n        \n        <div class="next-steps for for-tts">\n            <textarea name="text" class="textarea"></textarea>\n        </div>\n        <div class="next-steps">\n            <button class="button auto choose for for-file">Choose</button>\n            <button class="button auto save-tts for for-tts">Save</button>\n            <button class="button auto cancel">Cancel</button>\n        </div>\n    </div>\n</div>'}),define("unifi/view/settings/VoipAudioPickerView",["unifi/model/Audio","underscore","backbone","jquery","msg/Msg","text!includes/settings/settingsVoipAudioPickerTemplate.html"],function(e,t,n,r,i,s){"use strict";return n.View.extend({_templateId:"",_fadeIn:!1,initialize:function(n){t.bindAll(this),this.model=n.model||new e,this.collection=n.collection,this.render()},render:function(){if(!this.rendered&&(this.rendered=!0)){this.$el.html(t.template(s,{name:this.options.name,msg:i})),this.$info=this.$el.find(".audio-info"),this.$form=this.$el.find(".audio-form"),this.$edit=this.$el.find(".audio-info .edit"),this.$select=this.$el.find("select"),this.$converting=this.$el.find(".converting"),this.$play=this.$el.find("button.play"),this.$choose=this.$el.find("button.choose"),this.$save=this.$el.find("button.save-tts"),this.$file=this.$el.find("input[name=file]"),this.$cancel=this.$el.find("button.cancel"),this.$audio=this.$el.find("audio");var e=this.$select,n=this.$choose,o=this.$save,u=e.parent();e.selectmenu({parent:u,appendTo:u,icons:{button:"ubnt-icon-arrow-down secondary-color"},position:{at:"left bottom"},change:function(){e.trigger("change")}}),e.on("change",r.proxy(function(e){this.$form.find(".for").hide().filter(".for-"+r(e.currentTarget).val()).show()},this)).trigger("change");var a=this;this.$file.on("change",r.proxy(function(){var e=this.$file.get(0).files[0],t=new FileReader;t.onload=function(e){var t=a.$file.get(0).files[0];if(t){var n=new XMLHttpRequest,r=new FormData;a.model.get("_id")&&r.append("id",a.model.get("_id")),r.append("type","file"),r.append("file",t),n.upload.addEventListener("progress",a.handleUploadProgress,!1),n.addEventListener("load",a.handleUploadComplete,!1),n.addEventListener("error",a.handleUploadFailed,!1),n.addEventListener("abort",a.handleUploadCanceled,!1),n.open("POST",a.model.getUploadUrl()),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(r)}},t.readAsDataURL(e)},this)),this.$choose.on("click",r.proxy(function(e){return this.$file.click(),!1},this)),this.$save.on("click",function(e){var t=a.$select.val();return a.model.save({type:a.$select.val(),text:a.$el.find("textarea[name=text]").val()},{success:function(){t!="default"&&(a.populate(),a.monitorConversion())}}),!1}),this.$edit.on("click",function(e){return clearTimeout(a.monitor),a.$info.hide(),a.$form.show(),!1}),this.$cancel.on("click",function(e){return a.populate(),a.monitorConversion(),a.$info.show(),a.$form.hide(),!1}),this.$audio.on("ended",function(){a.$play.enable()}),this.$play.on("click",function(e){var t=a.$el.find("audio");return a.$audio.find("source").attr("src",a.model.getFileUrl()),a.$audio.trigger("load").trigger("play"),a.$play.disable(),!1})}},handleUploadProgress:function(e){},handleUploadComplete:function(e){var t=r.parseJSON(e.currentTarget.response).data[0],n=this.collection.get(t._id);n?n.set(t):this.collection.add(t),this.$file.val(""),this.model=n,this.populate(),this.monitorConversion()},handleUploadFailed:function(e){},handleUploadCanceled:function(e){},monitorConversion:function(){this.model.fetch().done(r.proxy(function(){this.model.get("ready")!==!0?this.monitor=setTimeout(r.proxy(function(){this.monitorConversion()},this),2e3):this.populate()},this))},populate:function(){this.$play.hide(),this.$converting.hide(),this.$form.hide(),this.$info.show();if(this.model){var e=this.model.get("type")||"file",t=this.model.get("ready")||!1;this.$form.find("input[name=id]").val(this.model.get("_id")),this.$info.find(".type-file, .type-tts").hide(),e==="file"?(this.$info.find(".type-file").show(),this.$info.find(".filename").text(this.model.get("filename"))):(this.$info.find(".type-tts").show(),this.$info.find(".text").text('"'+this.model.get("text")+'"')),this.$select.find("option[value="+e+"]").prop("selected",!0).trigger("change"),this.$play.toggle(t),this.$play.find("source").attr("src",this.model.getFileUrl()),this.$converting.toggle(!t),this.$el.find("textarea[name=text]").val(this.model.get("text")||"")}else console.log("TODO: invalid model"),this.$select.val("default").trigger("change")},remove:function(){try{this.$select.selectmenu("destroy"),this.$select.off(),this.$file.off(),this.$choose.off(),this.$save.off(),this.$edit.off(),this.$cancel.off(),this.$audio.off(),this.$play.off()}catch(e){}this.rendered=!1,n.View.prototype.remove.apply(this,arguments),this.trigger("remove")}})}),define("text!includes/settings/settingsProviderFormTemplate.html",[],function(){return'<form class="complex-form">\n    <h2><%- headline %></h2>\n\n    <fieldset>\n        <div class="fields">\n            <div>\n                <label for="provider"><%- msg.G_SettingsProviderChoice %></label>\n                <div class="buttonset provider">\n                    <!--\n                    <input type="radio" id="voipProviderUbnt" name="provider" value="ubnt" disabled="disabled" /><label for="voipProviderUbnt"><%- msg.G_SettingsProviderUbnt %></label>\n                    -->\n                    <input type="radio" id="voipProviderCustom" name="provider" value="custom"  checked="checked"/><label for="voipProviderCustom"><%- msg.G_SettingsProviderCustom %></label>\n                    <input type="radio" id="voipProviderExternal" name="provider" value="external" /><label for="voipProviderExternal"><%- msg.G_SettingsProviderExternal %></label>\n                    <input type="radio" id="voipProviderNone" name="provider" value="none" /><label for="voipProviderNone"><%- msg.G_SettingsProviderNone %></label>\n                </div>\n                <span class="provider-toggled provider-ubnt">\n                    <%- msg.G_SettingsProviderUbntNote %>\n                </span>\n                <span class="provider-toggled provider-custom">\n                    <%- msg.G_SettingsProviderCustomNote %>\n                </span>\n                <span class="provider-toggled provider-external">\n                    <%- msg.G_SettingsProviderExternalNote %>\n                </span>\n                <span class="provider-toggled provider-none">\n                    <%- msg.G_SettingsProviderNoneNote %>\n                </span>\n            </div>\n            <div class="provider-toggled provider-ubnt">\n                <label>Ubiquiti Username</label>\n                <input type="text" name="x_sso_username" value="" />\n            </div>\n            <div class="provider-toggled provider-ubnt">\n                <label>Ubiquiti Password</label>\n                <input type="password" name="x_sso_password" value="" />\n            </div>\n            <div class="provider-toggled provider-custom provider-external">\n                <label><%- msg.G_SettingsSipServer %></label>\n                <input type="text" name="sip_server" value="" />\n            </div>\n            <div class="provider-toggled provider-custom provider-external">\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 class="provider-toggled provider-custom sip_auth-toggled sip_auth-user">\n                <label><%- msg.G_SettingsSipUsername %></label>\n                <input type="text" name="x_sip_username" value="" />\n            </div>\n            <div class="provider-toggled provider-custom sip_auth-toggled sip_auth-user">\n                <label><%- msg.G_SettingsSipPassword %></label>\n                <input type="password" name="x_sip_password" value="" />\n            </div>\n        </div>\n    </fieldset>\n    <fieldset class="advanced provider-toggled provider-custom provider-external">\n        <legend class="toggle"><%- msg.G_SettingsAdvancedOpts %> <span class="ubnt-icon-arrow-down secondary-color"></span></legend>\n        <div class="fields">\n            <div class="provider-toggled provider-custom provider-external">\n                <label><%- msg.G_SettingsSipProxy %></label>\n                <input type="text" name="sip_proxy" value="" />\n            </div>\n            <div class="provider-toggled provider-custom sip_auth-toggled sip_auth-user">\n                <label><%- msg.G_SettingsSipAuthName %></label>\n                <input type="text" name="sip_authname" value="" />\n            </div>\n            <div class="provider-toggled provider-custom sip_auth-toggled sip_auth-ip">\n                <label><%- msg.G_SettingsSipTechPrefix %></label>\n                <input type="text" name="x_sip_tech_prefix" value="" />\n            </div>\n            <div class="provider-toggled provider-custom sip_auth-toggled sip_auth-ip">\n                <label><%- msg.G_SettingsSipFromUser %></label>\n                <input title="<%- msg.G_SettingsSipFromUserTitle %>" type="text" name="sip_from_user" value="" />\n            </div>\n            <div class="provider-toggled provider-external">\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    <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/VoipProviderView",["unifi/view/settings/FormView","unifi/view/app/ScheduleMixin","underscore","backbone","jquery","libs/moment","msg/Msg","text!includes/settings/settingsProviderFormTemplate.html"],function(e,t,n,r,i,s,o,u){"use strict";return e.extend(n.extend({},t,{_prevalidate:{sip_server:{input:"text",complex:!0},sip_proxy:{input:"text",complex:!0},sip_authname:{input:"text",complex:!0},sip_from_user:{input:"text",complex:!0},sip_voicemail:{input:"text",complex:!0},x_sip_username:{input:"text",complex:!0},x_sip_password:{input:"password",complex:!0},x_sso_username:{input:"text",complex:!0},x_sso_password:{input:"password",complex:!0}},_templateId:u,initialize:function(e){n.bindAll(this),this.model&&this.listenTo(this.model,"change",this.populate),this.template=n.template(this._templateId),this.$container=e.container,this.on("save-success",function(e,t,n){this.collection.add(e,{merge:!0}),this.remove()},this)},render:function(){var e=this;!this.rendered&&(this.rendered=!0)?(this.$el.html(this.template({msg:o,headline:o.G_SettingsProviderSetup,instructions:o.G_SettingsAutoRespHoursTip})),this.$container.prepend(this.$el),n.delay(function(){e.$el.find(".buttonset input[name=provider]").radiotoggle({container:e.$el}).on("change",function(){var t=e.$el.find("input[name=provider]:checked").val();t==="custom"?e.$el.find("input[name=sip_auth]:checked").trigger("change"):t==="external"&&e.$el.find("input[name=sip_auth]:checked").trigger("change")}),e.$el.find(".buttonset input[name=sip_auth]").radiotoggle({container:e.$el}).on("change",function(){e.$el.find("input[name=provider]:checked").val()=="external"&&e.$el.find(".sip_auth-toggled").hide()}),e.$el.find("form legend.toggle").on("click",function(e,t){var n=i(this);n.find("span").toggleClass("ubnt-icon-arrow-right",t).toggleClass("ubnt-icon-arrow-down",!n.find("span").hasClass("ubnt-icon-arrow-right")).end().siblings().toggleClass("hidden",t)}).trigger("click",!0),e.populate()},0),this.$el.find(".buttonset").buttonset(),this.$el.find("form").on("submit",this.save).find("button.cancel").on("click",this.remove).end(),this.$submit=this.$el.find("button.save"),this.$submit.buttonalert(),this.$el.find("input[type=password]").password({suffix:"-text"})):this.$container.prepend(this.$el.detach())},populate:function(){var e=this.model.get("type")||"none",t=this.model.get("sip_auth")||"user";this.$el.find("input[name=sip_auth][value="+t+"]").prop("checked",!0).trigger("change"),this.$el.find("input[name=provider][value="+e+"]").prop("checked",!0).trigger("change"),this.$el.find("input[name=sip_server]").val(this.model.get("sip_server")),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_from_user]").val(this.model.get("sip_from_user")),this.$el.find("input[name=sip_voicemail]").val(this.model.get("sip_voicemail")),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=x_sip_tech_prefix]").val(this.model.get("x_tech_prefix"))},gather:function(){var e=this.$el.find("input[name=provider]:checked").val();return e=="ubnt"?{type:e,x_sso_username:this.$el.find("input[name=x_sso_username]").val(),x_sso_password:this.$el.find("input[name=x_sso_password]").val()}:{type:e,sip_server:this.$el.find("input[name=sip_server]").val(),sip_proxy:this.$el.find("input[name=sip_proxy]").val(),sip_authname:this.$el.find("input[name=sip_authname]").val(),sip_from_user:this.$el.find("input[name=sip_from_user]").val(),sip_voicemail:this.$el.find("input[name=sip_voicemail]").val(),sip_auth:this.$el.find("input[name=sip_auth]:checked").val(),x_sip_username:this.$el.find("input[name=x_sip_username]").val(),x_sip_password:this.$el.find("input[name=x_sip_password]").val(),x_tech_prefix:this.$el.find("input[name=x_sip_tech_prefix]").val()}},remove:function(){this.stopListening(this.model),this.off("save-success"),this.$el.find("form").off(),this.$el.find("form button.cancel").off(),this.$el.find(".buttonset input[name=provider]").off(),this.$el.find(".buttonset input[name=sip_auth]").off(),this.$el.find("form legend.toggle").off(),this.$el.find("form button.cancel").off(),this.rendered=!1,e.prototype.remove.apply(this,arguments),this.trigger("remove")}}))}),define("text!includes/settings/settingsNumberFormTemplate.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="didNumber<%- id %>"><%- msg.G_SettingsVoipNumber %></label>\n                <input type="text" id="didNumber<%- id %>" name="number" value="" />\n            </div>\n            <div>\n                <label for="didExtension<%- id %>"><%- msg.G_SettingsVoipExtension %></label>\n                <div class="select">\n                    <select id="didExtension<%- id %>" name="extension_id"></select>\n                </div>\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/NumberFormView",["unifi/view/settings/FormView","underscore","jquery","msg/Msg","text!includes/settings/settingsNumberFormTemplate.html"],function(e,t,n,r,i){"use strict";return e.extend({_templateId:i,_prevalidate:{number:{input:"number"}},render:function(){var t=this.rendered;e.prototype.render.call(this),!t},args:function(){return{id:this.id,headline:this.create?r.G_SettingsCreateNewNumber:r.G_SettingsEditNumber+" - "+this.model.get("name")||this.model.get("number"),msg:r}},setupExtensionsDropdown:function(){var e=this.$el.find("select[name=extension_id]"),r=e.val(),i=this.app.collection("Extensions");e.empty(),e.append(n("<option />").attr("value","").text("")),i&&t.each(i.models,n.proxy(function(t){e.append(n("<option />").attr("value",t.id).text(t.get("name")+" ("+t.get("extension")+")"))},this)),e.find('option[value="'+(r||this.model.get("extension_id"))+'"]').prop("selected",!0),e.selectmenu("refresh")},populate:function(){this.model&&(this.$el.find("input[name=number]").val(this.model.get("number")),this.setupExtensionsDropdown())},gather:function(){return this.model.unset("extension_id",{silent:!0}),this.model.unset("number",{silent:!0}),{number:this.$el.find("input[name=number]").val(),extension_id:this.$el.find("select[name=extension_id]").val()}},remove:function(){this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/model/Number",["unifi/model/Model","underscore","backbone"],function(e,t,n){"use strict";return e.extend({sync:function(e,t,r){r=r||{};switch(e){case"create":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/add/number",r.type="POST";break;case"update":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/upd/number/"+t.id,r.type="POST",r.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/del/number/"+t.id,r.type="POST"}return n.sync.call(this,e,t,r)}})}),define("unifi/collection/Numbers",["unifi/collection/Collection","backbone","unifi/model/Number"],function(e,t,n){"use strict";return e.extend({model:n,bySite:!0,filterByExtension:function(e){switch(e.get("target")){case"ivr":return this.findWhere({target:"ivr"});case"phone":case"group":case"conference":return this.findWhere({target:"extension",extension:e.get("_id")})}},url:function(){return"/api/s/"+SITE.name+"/list/number"}})}),define("unifi/model/Extension",["unifi/model/Model","jquery","backbone","underscore","msg/Msg"],function(e,t,n,r,i){"use strict";return e.extend({display:function(){return this.get("name")+" ("+this.get("extension")+")"},validate:function(e,t){var n={},s=t?t.partial:null;if(!s||s=="extension")e.extension?this.validator.digits(e.extension)?this.validator.length_limit(e.extension,15)||(n.extension=i.localize(i.E_TooManyDigits,i.G_SettingsVoipExtension,15)):n.extension=i.localize(i.E_IncorrectDigits,i.G_SettingsVoipExtension):s||(n.extension=i.localize(i.E_CannotBeEmpty,i.G_SettingsVoipExtension));if(!s||s=="name")e.name||s||(n.name=i.localize(i.E_CannotBeEmpty,i.G_Name));(!s||s=="email")&&e.target=="phone"&&e.email&&!this.validator.email(e.email)&&(n.email=i.localize(i.E_IncorrectEmailAddress,e.email)),(!s||s=="pin")&&e.target=="conference"&&e.pin_enabled&&(e.pin?this.validator.digits(e.pin)||(n.pin=i.localize(i.E_IncorrectDigits,e.pin)):s||(n.pin=i.localize(i.E_CannotBeEmpty,i.G_SettingsExtPin)));if(r.size(n))return n},parse:function(t,n){return t=e.prototype.parse.call(this,t,n),t&&(t.extension?t.extension=parseInt(t.extension,10):t.extension=0),t},type:function(){switch(this.get("target")){case"phone":return i.G_SettingsVoipExtPhone;case"group":return i.G_SettingsVoipExtGroup;case"conference":return i.G_SettingsVoipExtConference;case"ivr":return i.G_SettingsVoipExtIVR}},type_mac:function(){var e=this.type();return this.get("target")==="phone"&&!this.get("device_mac")&&(e+="  ("+i.G_SettingsVoipExtPhoneUnassigned+")"),e},sync:function(e,t,r){r=r||{};switch(e){case"create":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/add/extension",r.type="POST";break;case"update":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/upd/extension/"+t.id,r.type="POST",r.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":r.contentType="application/json; charset=utf-8",r.url="/api/s/"+SITE.name+"/del/extension/"+t.id,r.type="POST"}return n.sync.call(this,e,t,r)}})}),define("unifi/collection/Extensions",["unifi/collection/Collection","unifi/model/Extension","underscore"],function(e,t,n){"use strict";return e.extend({model:t,bySite:!0,comparator:function(e){return e.get("extension")},filterByExtension:function(e){if(!e)return null;e=e.toString();var t=e.substring(0,e.length-3);return t&&(e=e.substring(e.length-3)),n(this.filter(function(n){return t?n.get("extension")==e&&n.get("branch")==t:n.get("extension")==e&&!n.get("branch")})).last()},url:function(){return"/api/s/"+SITE.name+"/list/extension"}})}),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\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 class="options" style="display:none">\n                    <label for="voipAutoAdopt"><%- msg.G_SettingsPhoneAdopt %></label>\n                    <input type="checkbox" id="voipAutoAdopt" name="auto_adopt" value="1" />\n                    <span><%- msg.G_SettingsPhoneAutoAdopt %></span>\n                </div>\n                <div class="options" style="display:none">\n                    <label for="voipUseLAN"><%- msg.G_SettingsUseLAN %></label>\n                    <input type="checkbox" id="voipUseLAN" name="use_lan_for_voip" value="1" />\n                    <span><%- msg.G_SettingsUseLANDesc %></span>\n                </div>\n                <div style="display:none">\n                    <label><%- msg.G_SettingsIntlCalling %></label>\n                    <div class="buttonset">\n                        <input type="radio" id="voipIntlCallingOn" name="international" value="1" checked="checked" /><label for="voipIntlCallingOn"><%- msg.G_SettingsOn %></label>\n                        <input type="radio" id="voipIntlCallingOff" name="international" value="0" /><label for="voipIntlCallingOff"><%- msg.G_SettingsOff %></label>\n                    </div>\n                </div>\n                <div style="display:none">\n                    <label><%- msg.G_SettingsCallScreening %></label>\n                    <div class="buttonset">\n                        <input type="radio" id="voipCallScreeningOn" name="screening" value="1" checked="checked" /><label for="voipCallScreeningOn"><%- msg.G_SettingsOn %></label>\n                        <input type="radio" id="voipCallScreeningOff" name="screening" value="0" /><label for="voipCallScreeningOff"><%- msg.G_SettingsOff %></label>\n                    </div>\n                </div>\n                <div style="display:none">\n                    <label><%- msg.G_SettingsDefaultHoldAudio %></label>\n                    <div class="audio-picker-container"></div>\n                </div>\n            </div>\n        </fieldset>\n\n        <h2 class="numbers"><%- msg.G_SettingsProviderNumbers %></h2>\n        <fieldset class="provider">\n            <div class="fields">\n                <div>\n                    <label><%- msg.G_SettingsProvider %></label>\n                    <input type="text" class="current-provider" name="provider" value="<%- msg.G_SettingsProviderNone %>" disabled="disabled" />\n                </div>\n                <div class="field-options">\n                    <button type="button" class="button auto setup"><%- msg.G_Setup %></button>\n                </div>\n            </div>\n        </fieldset>\n        <fieldset class="numbers internal-pbx">\n            <div class="data-table">\n                <div class="loading"><span><%- msg.N_Loading %></span></div>\n            </div>\n            <div class="actions ubnt">\n                <button type="button" class="button tall auto refresh is-admin"><%- msg.G_SettingsNumberRefresh %></button>\n                <button type="button" class="button tall auto manage is-admin"><%- msg.G_SettingsNumberManage %></button>\n            </div>\n            <div class="actions custom">\n                <button type="button" class="button tall auto add create-form is-admin"><%- msg.G_SettingsNumberAdd %></button>\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 class="forms hidden"></div>\n</div>\n'}),define("unifi/view/settings/VoipView",["unifi/view/settings/ListContentView","unifi/view/settings/BreadcrumbMixin","unifi/view/settings/VoipAudioPickerView","unifi/view/settings/VoipProviderView","unifi/view/settings/NumberFormView","ubnt/view/dialogs/ErrorDialogView","ubnt/view/dialogs/ConfirmDialogView","unifi/collection/Numbers","unifi/collection/Extensions","unifi/collection/Settings","underscore","jquery","libs/backgrid","ubnt/backgrid","msg/Msg","text!includes/settings/settingsVoipTemplate.html"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v){"use strict";return e.extend(l.extend({},t,{id:"settingsVoip",_templateId:l.template(v,{msg:d}),_formClass:i,_collectionType:{name:"Numbers",Class:u},_pageable:!1,views:{},render:function(){var t=this.rendered;e.prototype.render.call(this,!0);if(!t){this.views.audioPicker=new n({el:this.$el.find("div.audio-picker-container"),name:"hold-audio"}),this.$el.find("fieldset.provider button.setup").on("click",this.showProvider),this.$numbers=this.$el.find(".data-table"),this.$refresh=this.$el.find("fieldset.numbers button.refresh"),this.$refresh.on("click",c.proxy(function(e){e.preventDefault(),this.collection.reload()},this)),this.$manage=this.$el.find("fieldset.numbers button.manage"),this.$manage.on("click",function(e){e.preventDefault(),console.log("TODO: manage link")}),this.$form=this.$el.find("form"),this.$form.on("submit",this.save),this.$submit=this.$el.find("button.save"),this.$submit.buttonalert();var r=this.app.collection("Settings"),i=r.findWhere({key:"voip",site_id:SITE.id});i||(i=r.getSettingFromKey("voip",SITE.id),r.add(i)),this.listenTo(r,"change sync add",this.populate),this._rendered.resolve()}this.populate()},columns:function(){return[{name:"number",label:d.G_SettingsVoipNumber,customClass:"column-number",editable:!1,sortable:!1,headerCell:p.Headers.noSortHeader,cell:h.StringCell.extend({formatter:p.Formatters.PhoneNumber})},{name:"extension",label:d.G_SettingsVoipExtension,customClass:"column-extension",editable:!1,sortable:!1,headerCell:p.Headers.noSortHeader,cell:p.Cells.SelectCell.extend({collection:this.app.collection("Extensions"),numbers:this.app.collection("Numbers"),id:"_id",property:function(e){return e.get("name")+" ("+e.get("extension")+")"},first:"",styled:!0,initialize:function(e){h.Cell.prototype.initialize.call(this,e),this.listenTo(this.model,"backgrid.column-sync",c.proxy(function(){this.$select&&this.$select.trigger("change")},this)),this.listenTo(this.collection,"add remove reset sync",this.render),this.listenTo(this.numbers,"add remove reset sync",this.render)},populate:c.proxy(function(e,t){var n=this.getExtensionFromNumber(e);if(n)return n.get("_id")},this),change:c.proxy(function(e){var t=c(e.target),n=this.app.collection("Extensions"),r=n.get(t.val());t.parents("td").siblings(".column-target").text(r?r.type_mac()||"":"")},this)})},{name:"target",label:d.G_SettingsVoipType,customClass:"column-target",editable:!1,sortable:!1,headerCell:p.Headers.noSortHeader,cell:h.StringCell.extend({collection:this.app.collection("Extensions"),formatter:p.Formatters.Placeholder,initialize:function(e){h.Cell.prototype.initialize.call(this,e),this.listenTo(this.collection,"add remove reset sync",this.render)},render:function(){return l.delay(c.proxy(function(){this.model.trigger("backgrid.column-sync")},this),300),this}})},{name:"_id",label:d.G_Actions,editable:!1,sortable:!1,headerCell:p.Headers.noSortHeader,cell:p.Cells.ActionsCell.extend({actions:{edit:{icon:"ubnt-icon-edit",classCallback:function(e){return"button-provider-custom"},callback:this.rowEdit},"delete":{requiresAdminPrivilege:!0,classCallback:function(e){return"button-provider-custom"},icon:"ubnt-icon-trash",callback:this.rowDelete}}})}]},gridRowClassName:function(e){return"num-"+e.id},getExtensionFromNumber:function(e){return this.app.collection("Extensions").get(e.get("extension_id"))},dependencies:function(){var e={Extensions:a,Settings:f},t=[],n={},r=this;l.each(e,function(e,r){t.push(n[r]=c.Deferred())},this),c.when.apply(c,t).then(function(){r._dependencies.resolve()},function(){r._dependencies.reject()}),l.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:n[t]}},e)},this)},grid:function(){return this._gridRowClassName=this.gridRowClassName,e.prototype.grid.call(this),this},showProvider:function(){var e=this;if(!this.views.provider){var t=this.app.collection("Settings");this.views.provider=new r({container:this.$el.find(".forms"),collection:this.app.collection("Settings"),model:this.app.collection("Settings").getSettingFromKey("provider",SITE.id)||new this.collection.model({key:"provider",site_id:SITE.id})}),this.listenTo(this.views.provider,"remove",this.hideProvider)}this.views.provider.render(),this.renderChild(this.views.provider),this.$el.find(".header-options, .primary-form").hide(),this.$el.find(".forms").show()},hideProvider:function(){this.removeChild(this.views.provider),this.$el.find(".header-options, .primary-form").show(),this.$el.find(".forms").hide(),this.populate(),this.views.provider=null},populate:function(){var e=this.app.collection("Settings"),t=e.getSettingFromKey("voip",SITE.id),n=!!t&&!!t.get("enabled");t?(this.$el.find("input[name=enabled]").prop("checked",t.get("enabled")).trigger("change"),this.$el.find("input[name=auto_adopt]").prop("checked",t.get("auto_adopt")),this.$el.find("input[name=use_lan_for_voip]").prop("checked",t.get("use_lan_for_voip"))):(this.$el.find("input[name=enabled]").prop("checked",!1).trigger("change"),this.$el.find("input[name=use_lan_for_voip]").prop("checked",!1)),this.$form.toggleClass("voip-enabled",n);var r=this.$el.find("fieldset.numbers"),i=e.getSettingFromKey("provider",SITE.id),s=i.get("type");r.removeClass("provider-ubnt provider-custom provider-external provider-none"),s==="ubnt"?(r.addClass("provider-ubnt"),this.$el.find(".current-provider").val(d.G_SettingsProviderUbnt),this.$el.find(".numbers").show()):s==="custom"?(r.addClass("provider-custom"),this.$el.find(".current-provider").val(d.G_SettingsProviderCustom),this.$el.find(".numbers").show()):s==="external"?(r.addClass("provider-external"),this.$el.find(".current-provider").val(d.G_SettingsProviderExternal),this.$el.find(".numbers").hide()):s==="none"&&(r.addClass("provider-none"),this.$el.find(".current-provider").val(d.G_SettingsProviderNone),this.$el.find(".numbers").hide()),this.views.audioPicker&&this.views.audioPicker.populate()},save:function(e){var t=this;e&&e.preventDefault();var n=this.app.collection("Extensions");this.collection.each(function(e){var r=this.$numbers.find("tr."+this.gridRowClassName(e)),i=r.find("select").removeAttr("has-changed").val(),s=this.getExtensionFromNumber(e),o=s?s.get("_id"):"";if(o!=i){var u=n.get(i),a={number:e.get("number"),extension_id:i};r.addClass("saving"),e.unset("extension_id",{silent:!0}),e.unset("number",{silent:!0}),e.save(a,{wait:!0,success:function(e,n,i){var s=c('<span class="result success ubnt-icon-check"></span>');r.find("td:last-child").append(s),l.delay(function(){s.remove()},500),t.$submit.trigger("success")},error:function(e,t){var n=c('<span class="result error ubnt-icon-warning"></span>');r.find("td:last-child").append(n),l.delay(function(){n.remove()},500)},beforeSend:function(e,n,r){t.$submit.trigger("saving")},complete:function(){r.removeClass("saving")}})}},this);var r=this.app.collection("Settings"),i=r.getSettingFromKey("voip",SITE.id);i.save({enabled:this.$el.find("input[name=enabled]").is(":checked"),auto_adopt:this.$el.find("input[name=auto_adopt]").is(":checked"),use_lan_for_voip:this.$el.find("input[name=use_lan_for_voip]").is(":checked")},{wait:!0,success:function(e,n,i){r.trigger("change"),t.app.collection("Extensions").fetch(),t.$submit.trigger("success")},beforeSend:function(e,n,r){t.$submit.trigger("saving")}})},success:function(){this.$submit.trigger("success")},error:function(e,t){this.$el.find("fieldset.actions").prepend(c('<div class="error-msg">'+d.E_DataSave+": "+d.apiError(t)+"</div>")),this.$submit.trigger("error")},remove:function(){this.$el.find("fieldset.provider button.setup").off("click"),this.$el.find("fieldset.basic button.check").off("click"),this.$form.off("submit"),this.$submit.off(),this.$refresh.off("click"),this.$manage.off("click"),this.stopListening(this.app.collection("Settings"),"change sync add",this.populate),this.stopListening(this.views.provider),l.each(this.views,function(e,t){e&&e.remove&&e.remove(),delete this.views[t]},this),this.views={},this.rendered=!1,e.prototype.remove.apply(this,arguments)},rowEdit:function(e,t){t&&t.preventDefault(),c(t.target).closest("tr").find(".column-extension select").removeAttr("has-changed"),this.form(e,t?c(t.target).parents("tr"):null),this.$el.trigger("edit")}}))}),define("unifi/view/settings/AutoResponderMenuItemView",["unifi/view/settings/VoipAudioPickerView","backbone","underscore","msg/Msg","jquery"],function(e,t,n,r,i){"use strict";return t.View.extend({initialize:function(e){n.bindAll(this),this.$parent=e.parent,this.render()},render:function(){if(!this.rendered&&(this.rendered=!0)){this.$el.find("select").each(function(){var e=i(this),t=e.parent();e.selectmenu({parent:t,appendTo:t,icons:{button:"ubnt-icon-arrow-down secondary-color"},position:{at:"left bottom"},change:function(){e.trigger("change")}})}),this.$key=this.$el.find("select[name=key]"),this.$action=this.$el.find("select[name=action]"),this.$extension=this.$el.find("select[name=extension]"),this.$audio=this.$el.find(".audio-picker-container"),this.$audio.one("show",this.setupAudioPicker),this.listenTo(this.collection,"add remove change reset",this.setupRecipient),this.setupRecipient(),this.$action.on("change",i.proxy(function(e){var t=i(e.target).val();this.$extension.parents(".extension").css("display",t=="voicemail"||t=="extension"?"block":"none"),this.$audio.css("display",t=="audio"?"block":"none").trigger(t=="audio"?"show":"hide")},this)).trigger("change");var e=this.$parent,t=e.addable("count");this.$el.find("select[name=key] option[value="+(t==10?"0":t)+"]").prop("selected",!0).trigger("change")}this.populate()},setupRecipient:function(){this.$extension.empty(),this.$extension.append(i('<option value=""></option>').text(r.G_SelectOne)),this.collection.each(function(e){this.$extension.append(i('<option value="'+e.get("_id")+'"></option>').text(e.get("name")+" ("+e.get("extension")+")"))},this);try{this.$extension.trigger("change"),this.$extension.selectmenu("resize",200)}catch(e){}},setupAudioPicker:function(){this.audioPicker=new e({el:this.$audio,name:"menu-audio"}),this.audioPicker.populate()},populate:function(){if(this.model){var e=this.model.get("type");e&&e!="extension"&&e!="voicemail"&&(e="none"),this.$key.find("option[value="+this.model.get("key")+"]").prop("selected",!0).trigger("change"),this.$action.find("option[value="+e+"]").prop("selected",!0).trigger("change"),this.$extension.find("option[value="+this.model.get("extension_id")+"]").prop("selected",!0).trigger("change"),this.audioPicker&&this.audioPicker.model.set({type:this.model.get("type"),file:this.model.get("audio"),text:this.model.get("text")})}this.audioPicker&&this.audioPicker.populate()},gather:function(){var e={},t=this.$el.find("select[name=action]").val();switch(t){case"audio":case"tts":e=n.extend(this.audioPicker.gather(),e);break;case"voicemail":case"extension":e.type=t,e.extension_id=this.$el.find("select[name=extension]").val();break;default:e.type="none"}return e.key=this.$el.find("select[name=key]").val(),e},remove:function(){if(this.rendered){try{this.$el.find("select").selectmenu("destroy"),this.$el.find("button.remove").off(),this.$audio.off()}catch(e){}this.audioPicker&&this.audioPicker.remove(),this.stopListening(this.collection,"add remove change reset"),this.$action.off("change"),this.rendered=!1}t.View.prototype.remove.apply(this,arguments),this.trigger("remove")}})}),define("text!includes/settings/settingsAutoResponderHoursTemplate.html",[],function(){return'<form class="complex-form hours-form">\n    <% if (typeof(headline) != "undefined") { %>\n    <h2><%- headline %></h2>\n    <% } %>\n    \n    <% if (typeof(instructions) != "undefined") { %>\n    <div class="instructions"><%- instructions %></div>\n    <% } %>\n\n    <fieldset class="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_SettingsAutoRespHours %>: <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_SettingsAutoRespHours %>: <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_SettingsAutoRespHours %>: <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_SettingsAutoRespHours %>: <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_SettingsAutoRespHours %>: <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_SettingsAutoRespHours %>: <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_SettingsAutoRespHours %>: <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>'}),define("unifi/view/settings/AutoResponderHoursView",["unifi/view/app/ScheduleMixin","underscore","backbone","jquery","libs/moment","msg/Msg","text!includes/settings/settingsAutoResponderHoursTemplate.html"],function(e,t,n,r,i,s,o){"use strict";return n.View.extend(t.extend({},e,{_templateId:o,_defaultSchedule:["mon-fri|0900-1700"],initialize:function(e){t.bindAll(this),this.model&&this.listenTo(this.model,"change",this.populate),this.template=t.template(this._templateId),this.$container=e.container},render:function(){!this.rendered&&(this.rendered=!0)?(this.$el.html(this.template({msg:s,headline:s.G_SettingsAutoRespEditHours,instructions:s.G_SettingsAutoRespHoursTip})),this.$container.prepend(this.$el),this.$el.find("form").on("submit",this.save).find("button.cancel").on("click",this.remove).end(),this.renderSchedule(),this.$submit=this.$el.find("button.save"),this.$submit.buttonalert()):this.$container.prepend(this.$el.detach()),this.populate()},populate:function(){if(this.model){var e=this.model.get("hours");e&&this.populateSchedule(e)}},gather:function(){return{hours:this.gatherSchedule()}},save:function(e){e.preventDefault(),this.$submit.trigger("saving"),this.model.save(this.gather(),{wait:!0,success:r.proxy(function(e,t,n){this.$submit.trigger("success",!0),this.trigger("save-success",e,t,n),this.remove()},this),error:r.proxy(function(e,t){this.$submit.trigger("error",!0),this.trigger("save-error",e,t)},this),complete:r.proxy(function(){this.trigger("save-complete")},this)})},remove:function(){this.stopListening(this.model,"change"),this.$el.find("form").off(),this.$el.find("form button.cancel").off(),this.removeSchedule(),this.rendered=!1,n.View.prototype.remove.apply(this,arguments),this.trigger("remove")}}))}),define("unifi/collection/Audios",["unifi/collection/Collection","backbone","unifi/model/Audio"],function(e,t,n){"use strict";return e.extend({model:n,bySite:!0,getAudio:function(e,t,n){return e=e.match("on")?"on":"off",this.findWhere({attr_hidden_id:e+"_"+t+(t==="action"?"_"+n:"")})},url:function(){return"/api/s/"+SITE.name+"/list/audio"}})}),define("text!includes/settings/settingsAutoResponderTemplate.html",[],function(){return'<div class="section section-main">\n    <h1>\n        <span class="breadcrumb-home"><%- msg.G_SettingsAutoResponder %></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        <div class="buttonset left">\n            <input type="radio" id="autoRespBusinessHours" name="hours" value="ivr_on" checked="checked" /><label for="autoRespBusinessHours"><%- msg.G_SettingsAutoRespBusinessHours %></label>\n            <input type="radio" id="autoRespAfterHours" name="hours" value="ivr_off" /><label for="autoRespAfterHours"><%- msg.G_SettingsAutoRespAfterHours %></label>\n        </div>\n        \n        <div class="actions left">\n            <button id="editBusinessHours" class="button auto is-admin"><%- msg.G_SettingsAutoRespEditHours %></button>\n        </div>\n    </div>\n\n    <form class="primary-form complex-form">\n        <h2><%- msg.G_SettingsAutoRespGreeting %></h2>\n\n        <fieldset class="basic greeting">\n            <div class="fields">\n                <div class="tip"><%- msg.G_SettingsAutoRespGreetingTip %></div>\n                <div class="audio-picker-container"></div>\n            </div>\n        </fieldset>\n\n        <h2><%- msg.G_SettingsAutoRespMenu %></h2>\n\n        <fieldset class="basic menu">\n            <div class="fields"></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_Save %></button>\n        </fieldset>\n    </form>\n    \n    <div class="forms hidden"></div>\n</div>'}),define("text!includes/settings/settingsAutoResponderMenuItemTemplate.html",[],function(){return'<div class="menu-item">\n    <span><%- msg.G_SettingsAutoRespMenuPress %></span>\n    \n    <div class="key">\n        <select name="key">\n            <% _.each(keys, function(key) { %>\n            <option value="<%- _.isArray(key) ? key[0] : key %>"><%- _.isArray(key) ? key[1] : key %></option>\n            <% }) %>\n        </select>\n    </div>\n    \n    <span><%- msg.G_SettingsAutoRespMenuFor %></span>\n    \n    <div class="action">\n        <select name="action">\n            <option value="extension"><%- msg.G_SettingsAutoRespMenuTransfer %></option>\n            <option value="voicemail"><%- msg.G_SettingsAutoRespMenuVoicemail %></option>\n            <!--\n            <option value="audio"><%- msg.G_SettingsAutoRespMenuPlayAudio %></option>\n            -->\n        </select>\n    </div>\n    \n    <div class="audio-picker-container"></div>\n    \n    <div class="extension">\n        <select name="extension"></select>\n    </div>\n    \n    <button class="button remove auto"><span class="ui-button-icon-primary ubnt-icon-close"></span><%- msg.G_SettingsAutoRespMenuRemove %></button>\n</div>'}),define("unifi/view/settings/AutoResponderView",["unifi/view/app/ContentView","unifi/view/app/ValidatorMixin","unifi/view/settings/BreadcrumbMixin","unifi/view/settings/AutoResponderMenuItemView","unifi/view/settings/AutoResponderHoursView","unifi/view/settings/VoipAudioPickerView","unifi/collection/Extensions","unifi/collection/Audios","backbone","underscore","jquery","msg/Msg","text!includes/settings/settingsAutoResponderTemplate.html","text!includes/settings/settingsAutoResponderMenuItemTemplate.html","ubnt/ubnt.addable"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p){"use strict";return e.extend(f.extend({},t,n,{id:"settingsAutoResponder",_prevalidate:{},views:{},menuItems:{},menuKeys:["0","1","2","3","4","5","6","7","8","9"],hours:null,initialize:function(t){e.prototype.initialize.call(this,t),l.when(this._rendered=l.Deferred(),this._loaded=l.Deferred(),this._dependencies=l.Deferred()).then(this.populate),this.collection=this.app.collection("Settings",{fetch:{reload:!1,deferred:this._loaded}}),this.on("save-success",function(e,t,n){this.collection.add(e,{merge:!0}),this.success.call(this,e,t,n)},this),this.on("save-error",function(e,t){this.error.call(this,e,t)},this),this.dependencies()},render:function(){e.prototype.render.call(this);if(!this.rendered&&(this.rendered=!0)){this.$el.html(f.template(h,{msg:c})),this.$el.find(".buttonset").buttonset(),this.$el.find(".buttonset input[name=hours]").on("change",l.proxy(function(e){this.hours=l(e.target).val(),this._rendered.state()=="resolved"&&this._dependencies.state()=="resolved"&&this.populate()},this)),this.$el.find(".buttonset input[name=hours]:checked").trigger("change"),this.$el.find("#editBusinessHours").on("click",this.showBusinessHours),this.views.greeting=new s({app:this.app,collection:this.app.collection("Audios"),el:this.$el.find(".greeting div.audio-picker-container")});var t=this.$menuFields=this.$el.find("fieldset.menu > .fields");this.$menuFields.addable({min:0,max:this.menuKeys.length,template:l(f.template(p,{keys:this.menuKeys,msg:c})),add:l('<button class="button addable auto"><span class="ui-button-icon-primary ubnt-icon-plus"></span>'+c.G_SettingsAutoRespMenuAdd+"</button>"),added:l.proxy(function(e,n){var i=new r({el:e,collection:this.app.collection("Extensions"),model:n,parent:t}),s=t.addable("option","min"),o=t.addable("count");s||o>s?e.find("button.remove").on("click",function(n){return n.preventDefault(),t.addable("remove",e),!1}):e.find("button.remove").remove(),e.uniqueId(),this.menuItems[e.attr("id")]=i},this),removed:l.proxy(function(e){this.menuItems[e.attr("id")].remove(),delete this.menuItems[e.attr("id")]},this)}),this.$el.find("form").on("submit",l.proxy(function(e){e.preventDefault(),this.save()},this)),this.$submit=this.$el.find("button.save"),this.$submit.buttonalert(),this.app.isReadOnly||this.prevalidator(),this._rendered.resolve()}else this.populate()},dependencies:function(){var e={Extensions:o,Audios:u},t=[],n={},r=this;f.each(e,function(e,r){t.push(n[r]=l.Deferred())},this),l.when.apply(l,t).then(function(){r._dependencies.resolve()},function(){r._dependencies.reject()}),f.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:n[t]}},e)},this)},addMenuItem:function(e){this.$menuFields.addable("add",!1,e).addable("last")},showBusinessHours:function(){this.views.hours||(this.views.hours=new i({container:this.$el.find(".forms"),model:this.collection.getSettingFromKey("ivr_hours",SITE.id)||new this.collection.model({key:"ivr_hours",site_id:SITE.id})}),this.listenTo(this.views.hours,"remove",this.hideBusinessHours),this.listenTo(this.views.hours,"save-success",l.proxy(function(e,t,n,r){this.collection.add(t,{merge:!0})},this))),this.views.hours.render(),this.renderChild(this.views.hours),this.$el.find(".header-options, .primary-form").hide(),this.$el.find(".forms").show()},hideBusinessHours:function(){this.removeChild(this.views.hours),this.$el.find(".header-options, .primary-form").show(),this.$el.find(".forms").hide(),this.views.hours=null},populate:function(){this.$menuFields.addable("reset");var e=this.collection.getSettingFromKey(this.hours,SITE.id);if(e){if(this.views.greeting){var t=this.app.collection("Audios").getAudio(this.hours,"greeting");this.views.greeting.model.set(t.attributes),this.views.greeting.populate()}f.each(this.menuKeys,l.proxy(function(t){f.isArray(t)&&(t=t[0]);var n=e.get("action_type_"+t);n&&n!="none"&&this.addMenuItem(new a.Model({key:t,type:e.get("action_type_"+t),extension_id:e.get("action_extension_id_"+t),text:e.get("action_text_"+t),file:e.get("action_file_"+t)}))},this))}else this.views.greeting&&(this.views.greeting.model.clear(),this.views.greeting.populate()),this.addMenuItem(new a.Model)},gather:function(){if(this.hours=="ivr_on"||this.hours=="ivr_off"){var e={key:this.hours,site_id:SITE.id};return f.each(this.menuItems,function(t){var n=t.gather();e["action_type_"+n.key]=n.type,e["action_extension_id_"+n.key]=n.extension_id,e["action_text_"+n.key]=n.text,e["action_file_"+n.key]=n.file}),f.each(this.menuKeys,l.proxy(function(t){f.isArray(t)&&(t=t[0]),e["action_type_"+t]||(e["action_type_"+t]="none")},this)),e}},save:function(e){e&&e.preventDefault(),this.clear(),this.$submit.trigger("saving");var t=this._save();t||this.$submit.trigger("error",!0)},success:function(){this.$submit.trigger("success")},error:function(e,t){this.$el.find("fieldset.actions").prepend(l('<div class="error-msg">'+c.E_DataSave+": "+c.apiError(t)+"</div>")),this.$submit.trigger("error")},remove:function(){this.devalidate(),this.$el.find("form").off(),this.$el.find(".buttonset input[name=hours]").off(),this.$el.find("#editBusinessHours").off(),this.off("save-success"),this.off("save-error"),this.views.greeting&&(this.views.greeting.remove(),this.views.greeting=null,delete this.views.greeting),this.views.hours&&(this.views.hours.remove(),this.views.hours=null,delete this.views.hours),this.stopListening(this.views.hours),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\n            <div class="phone-only">\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 class="phone-only">\n                <label for="extensionEmail<%- id %>"><%- msg.G_Email %></label>\n                <input type="text" id="extensionEmail<%- id %>" name="email" value="" />\n            </div>\n            <div class="phone-only edit-only" style="display:none">\n                <label><%- msg.G_SettingsExtVoicemailPin %></label>\n                <button class="button resend"><%- msg.G_SettingsExtResendPin %></button>\n            </div>\n\n            <div class="group-only">\n                <label><%- msg.G_SettingsCallScreening %></label>\n                <div class="buttonset">\n                    <input type="radio" id="extensionCallScreeningOn<%- id %>" name="screening" value="1" checked="checked" /><label for="extensionCallScreeningOn<%- id %>"><%- msg.G_SettingsOn %></label>\n                    <input type="radio" id="extensionCallScreeningOff<%- id %>" name="screening" value="0" /><label for="extensionCallScreeningOff<%- id %>"><%- msg.G_SettingsOff %></label>\n                </div>\n            </div>\n            <div class="group-only ui-autocomplete-compact">\n                <label for="extensionMembers<%- id %>"><%- msg.G_SettingsExtMembers %></label>\n                <input type="text" id="extensionName<%- id %>" name="members" class="autocomplete" placeholder="<%- msg.G_SettingsExtMembersPlaceholder %>" />\n                <ul class="member-list"></ul>\n            </div>\n\n            <div class="conference-only">\n                <label for="extensionPinEnabled<%- id %>"><%- msg.G_SettingsExtRequirePin %></label>\n                <input type="checkbox" id="extensionPinEnabled<%- id %>" name="pin_enabled" value="1" />\n                <span><%- msg.G_SettingsExtPin %></span>\n                <input type="text" id="extensionPin<%- id %>" name="pin" size="5" value="" />\n            </div>\n            <div class="conference-only audio">\n                <label><%- msg.G_SettingsExtGreeting %></label>\n                <div class="audio-picker-container"></div>\n            </div>\n        </div>\n    </fieldset>\n    <fieldset class="phone-only external-only">\n        <div class="fields">\n            <div class="phone-only external-only 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="phone-only external-only 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 class="phone-only external-only 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 class="phone-only external-only" >\n                <label for="sipProxy<%- id %>"><%- msg.G_SettingsSipProxy %></label>\n                <input type="text" id="sipProxy<%- id %>" name="sip_proxy" value="" />\n            </div>\n            <div class="phone-only external-only" >\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","unifi/view/settings/VoipAudioPickerView","underscore","jquery","msg/Msg","text!includes/settings/settingsExtensionsFormTemplate.html"],function(e,t,n,r,i,s){"use strict";return e.extend({_templateId:s,_prevalidate:{extension:{input:"text"},name:{input:"text"},email:{input:"text",complex:!0},pin_enabled:{input:"checkbox",onchange:["pin_enabled"]},pin:{input:"text",complex:!0}},render:function(){var t=this.rendered;e.prototype.render.call(this,!0);if(!t){this.$el.find("form").addClass(this.options.target),this.$memberList=this.$el.find("ul.member-list"),this.options.target=="phone"&&(this.$resend=this.$el.find("button.resend"),this.$resend.on("click",this.resendPin),this.renderDevices()),this.options.target=="group"&&(this.$members=this.$el.find("input[name=members]"),this.$members.autocomplete({appendTo:this.$members.parent(),source:this.suggestMember,select:r.proxy(function(e,t){return this.addMember(t.item.id,t.item.label),this.$members.val(""),!1},this)})),this.options.target=="conference"&&(this._audioCollectionLoaded=r.Deferred(),r.when(this._audioCollectionLoaded).then(this.populateAudioPicker),this.audioCollection=this.app.collection("Audios",{fetch:{reload:!0,deferred:this._audioCollectionLoaded}}),this.$el.find("input[name=pin_enabled]").on("change",function(){var e=r(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 n=this.app.collection("Settings").findWhere({key:"provider"}),i=n&&n.get("type")==="external",s=!!i&&n.get("sip_auth")==="user";this.$el.find("form").toggleClass("external",!!i),this.$el.find("form").toggleClass("external-user",!!s)}this.populate()},renderDevices:function(){var e=this.$el.find("select[name=device_mac]").empty(),t=this.app.collection("Devices"),s=this.app.collection("Extensions");e.append(r('<option value=""></option>').text(i.G_SelectOne)),n.each(t.where({type:t.typeMap.phone,adopted:!0}),function(t){if(t.get("mac")!=this.model.get("device_mac")&&s.findWhere({target:"phone",device_mac:t.get("mac")}))return!0;e.append(r('<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")},suggestMember:function(e,t){var n=[],r=[{property:"name",term:e.term,minimum:.25},{property:"email",term:e.term,minimum:.25},{property:"extension",term:e.term}];this.app.collection("Extensions").search(r).each(function(e){e.get("target")=="phone"&&n.push({label:e.display(),email:e.get("email"),value:e.get("extension"),id:e.id})}),t(n)},addMember:function(e,t){var n=this.$memberList.find("li").filter(function(){return r(this).data("id")==e});n.length?n.addClass("highlight",100).delay(100).queue(function(){r(this).removeClass("highlight",100).dequeue()}):(n=r("<li />").data("id",e).text(t),this.$memberList.append(n),n.append(r('<span class="ubnt-icon-close icon-after"></span>').bind("click",function(e){e.preventDefault(),e.stopPropagation(),r(e.target).parents("li").remove()})))},args:function(){var e,t;switch(this.options.target){case"phone":e=i.G_SettingsCreateNewExtension,t=i.G_SettingsEditExtension;break;case"group":e=i.G_SettingsCreateNewGroup,t=i.G_SettingsEditGroup;break;case"conference":e=i.G_SettingsCreateNewConference,t=i.G_SettingsEditConference}return{id:this.id,headline:this.create?e:t+" - "+this.model.get("name"),target:this.options.target,extension:this.getExtensionNumber(),msg:i}},getExtensionNumber:function(){var e=this.model?this.model.get("extension"):null;if(!e){var t=n.map(this.collection.filter(function(e){return e.get("target")==="phone"||e.get("target")==="group"||e.get("target")==="conference"}),function(e){return e.get("extension")}).sort(),r=n.map(this.collection.where({target:this.options.target}),function(e){return e.get("extension")}).sort(),i=0,s=9999999;switch(this.options.target){case"phone":i=101;break;case"group":i=200;break;case"conference":i=300}for(var o=n.last(r)||i;o<s;o++)if(n.indexOf(t,o)===-1){e=o;break}}return e},resendPin:function(){console.log("TODO: resend PIN")},populate:function(){if(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=email]").val(this.model.get("email")),this.$el.find("input[name=screening][value="+(this.model.get("screening")?"1":"0")+"]").prop("checked",!0).trigger("change"),this.$el.find("input[name=pin_enabled]").prop("checked",this.model.get("pin_enabled")).trigger("change"),this.$el.find("input[name=pin]").val(this.model.get("pin")),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"));if(this.model.get("target")=="group"){var e=this.app.collection("Extensions");n.each(this.model.get("extension_ids")||{},r.proxy(function(t){var n=e.get(t);this.addMember(t,n.display())},this))}else this.model.get("target")=="conference"&&(this.model.get("_id")||this.$el.find(".conference-only.audio").hide())}},populateAudioPicker:function(){if(this.model.get("target")=="conference"){this.audioPicker=new t({app:this.app,collection:this.app.collection("Audios"),el:this.$el.find("div.audio-picker-container")}),this.listenTo(this.audioPicker,"remove",function(){this.audiopicker=null});if(this.model.get("_id")){var e=this.audioCollection.findWhere({extension_id:this.model.get("_id")});this.audioPicker.model.set(e.attributes),this.audioPicker.populate()}}},gather:function(){var e={target:this.options.target,extension:this.$el.find("input[name=extension]").val(),name:this.$el.find("input[name=name]").val()};switch(this.options.target){case"phone":e.device_mac=this.$el.find("select[name=device_mac]").val(),e.email=this.$el.find("input[name=email]").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();break;case"group":e.screening=this.$el.find("input[name=screening]:checked").val()=="1",e.extension_ids=this.$memberList.find("li").map(function(){return r(this).data("id")}).get();break;case"conference":e.pin_enabled=this.$el.find("input[name=pin_enabled]").prop("checked"),e.pin=this.$el.find("input[name=pin]").val()}return e},remove:function(){this.$resend&&this.$resend.off(),this.$el.find("input[name=pin_enabled]").off("change"),this.audioPicker&&this.audioPicker.remove(),e.prototype.remove.apply(this,arguments)}})}),define("text!includes/settings/settingsExtensionsTemplate.html",[],function(){return'<div class="section section-main">\n    <button type="button" name="options" class="button plain left right edit-group is-admin external-pbx disabled"><span class="ui-button-icon ubnt-icon-gear"></span><%- msg.G_SettingsExtensionImport %></button>\n\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-phone 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\n            <button class="button tall auto white create-form-group hidden is-admin" data-type="create-form">\n                <span class="ui-button-icon ubnt-icon-gear gear"></span>\n                <%- msg.G_SettingsCreateNewGroup %>\n            </button>\n\n            <button class="button tall auto white create-form-conference hidden is-admin" data-type="create-form">\n                <span class="ui-button-icon ubnt-icon-gear gear"></span>\n                <%- msg.G_SettingsCreateNewConference %>\n            </button>\n        </div>\n    </div>\n    <div class="forms hidden"></div>\n</div>'}),define("unifi/view/settings/ExtensionsView",["unifi/view/settings/ListContentView","unifi/view/settings/ExtensionsFormView","underscore","jquery","libs/backgrid","ubnt/backgrid","unifi/collection/Extensions","unifi/collection/Numbers","msg/Msg","text!includes/settings/settingsExtensionsTemplate.html"],function(e,t,n,r,i,s,o,u,a,f){"use strict";return e.extend({id:"settingsExtensions",_templateId:n.template(f,{msg:a}),_formClass:t,_collectionType:{name:"Extensions",Class:o},_pageable:!1,columns:function(){var e=this.app.collection("Numbers");return[{name:"extension",label:a.G_SettingsVoipExtension,editable:!1,cell:"string"},{name:"name",label:a.G_Name,editable:!1,cell:"string"},{name:"number",label:a.G_SettingsExtDirectLine,editable:!1,cell:i.StringCell.extend({formatter:s.Formatters.PhoneNumber})},{name:"target",label:a.G_SettingsVoipType,editable:!1,cell:s.Cells.ModelCell.extend({callback:"type_mac"})},{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,render:function(e){return e.get("target")!="ivr"}},"delete":{requiresAdminPrivilege:!0,icon:"ubnt-icon-trash",callback:this.rowDelete,render:function(e){return e.get("target")!="ivr"&&!e.get("attr_no_delete")}}}})}]},dependencies:function(){var e={Numbers:u},t=[],i={},s=this;n.each(e,function(e,n){t.push(i[n]=r.Deferred())},this),r.when.apply(r,t).then(function(){s._dependencies.resolve()},function(){s._dependencies.reject()}),n.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:i[t]}},e)},this)},formAttributes:function(e){return{target:e?e.get("target"):null}},grid:function(t){var n=this.app.collection("Numbers");this.listenTo(n,"add remove reset sync change",this.addNumberToExtensions),this.listenTo(this.collection,"reset sync",this.addNumberToExtensions),this.listenTo(this.collection,"add",this.addNumberToExtension),this.addNumberToExtensions(),e.prototype.grid.call(this,t);var r=this;return this.$el.find(".create-form-phone").on("click",function(){r.form(new r.collection.model({target:"phone"}))}).show(),this.$el.find(".create-form-group").on("click",function(){r.form(new r.collection.model({target:"group"}))}).show(),this.$el.find(".create-form-conference").on("click",function(){r.form(new r.collection.model({target:"conference"}))}).show(),this},addNumberToExtensions:function(){this.collection&&this.collection.each(this.addNumberToExtension)},addNumberToExtension:function(e){var t=this.app.collection("Numbers"),n=t.filterByExtension(e);n?e.set({number:n.get("number")}):e.unset("number")},remove:function(){this.stopListening(this.app.collection("Numbers")),this.stopListening(this.collection),this.$el.find(".create-form-phone").off("click"),this.$el.find(".create-form-group").off("click"),this.$el.find(".create-form-conference").on("click"),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,n,r,i,s,o,u,a,f,l,c,h){"use strict";return e.extend(n.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),r.when(this._rendered=r.Deferred(),this._loaded=r.Deferred()).then(this.populate),this.models={},this.collection=this.app.collection("Settings",{fetch:{reload:!1,deferred:this._loaded}},s),this.on("save-success",function(e,t,n){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()},this),this.refreshSdnStat=n.debounce(this._refreshSdnStat,1e3),this.render(),this.listenTo(this.collection,"change sync add",this.reflectSettingChanges),this.reflectSettingChanges()},render:function(){e.prototype.render.call(this);if(!this.rendered&&(this.rendered=!0)){this.$el.html(n.template(h,{msg:i})),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=r(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=r(this),t=r(this).parents("div").find("input[name=smtp-port]"),n=t.val();if(!n||n==465||n==25)e.is(":checked")?t.val(465):t.val(25)}).trigger("change"),this.$el.find("#configureMailServer, #configureMailServerAuthentication, #configureMailServerFrom").on("change",function(){var e=r(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 n=r(this),s=t.gather("super_smtp");s.email=t.$el.find("input[name=smtp-test-email]").val(),delete s.enable,s.use_auth||(delete s.username,s.x_password),s.use_sender||delete s.sender,n.prop("disabled",!0),n.siblings(".error-msg, .success-msg").remove(),t.collection.testMail({data:s,success:function(e,t,o){e&&e.meta&&e.meta.rc=="ok"?n.after(r('<div class="success-msg">'+i.localize(i.N_SmtpEmailSent,s.email)+"</div>")):n.after(r('<div class="error-msg">'+i.E_SmtpUnknownFailed+"</div>"))},error:function(e,t,s){n.after(r('<div class="error-msg">'+i.apiError(e)+"</div>"))},complete:function(){n.prop("disabled",!1)}})}),this.$el.find("#configureSdn").on("change",function(){var e=r(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(){n.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),n.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 o({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 a,this.sdnStat.fetch({global:!1}).always(r.proxy(function(e){var t=this.sdnStat.get("status"),n=this.$el.find(".sdn-status span");n.empty();if("connected"===t){var i=this.sdnStat.get("url"),s=r("<a />").attr("href",i).text(i);n.append(s)}else"unknown"===t?n.append("Checking..."):"loginfailed"===t?n.append("Invalid SSO Username or Password"):n.append("Unrechable")},this))),!1},sendCheckCmd:function(){var e=this,t=this.app.collection("Devices");r.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(e,t,n){},error:function(e,t,n){(new f).open(i.apiError(e,!0))}})},gather:function(e){var t={};if(!e||e=="super_identity")t.super_identity={name:this.$el.find("input[name=systemName]").val()};if(!e||e=="super_mgmt")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")};if(!e||e=="super_smtp")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()};if(!e||e=="super_sdn")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()};return e&&(t[e].key=e),e?t[e]:t},save:function(e){e&&e.preventDefault(),this.clear();var t=[];n.each(this.models,function(e,r){var i=e.validate(this.gather(r));n.size(i)&&(this.invalid(i,r),t.push(r))},this);if(!n.size(t)){this.$submit.trigger("saving"),this._deferred={};var i=[];n.each(this.models,function(e,t){i.push(this._deferred[t]=r.Deferred())},this),r.when.apply(r,i).then(r.proxy(this.success,this),r.proxy(this.error,this)),n.each(this.models,function(e,t){this._save(e,t)},this)}else this.$submit.trigger("invalid")},reflectSettingChanges:function(){this.refreshSdnStat()},success:function(){this.$submit.trigger("success")},error:function(e,t){this.$el.find("fieldset.actions").prepend(r('<div class="error-msg">'+i.E_DataSave+": "+i.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/SystemInfo",["unifi/model/Model","underscore","backbone"],function(e,t,n){"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,r){r=r||{};switch(e){case"backup":r.url="/api/s/"+SITE.name+"/cmd/system",r.contentType="application/json; charset=utf-8",r.type="POST",r.data=JSON.stringify({cmd:"backup",days:r.days});break;case"restore":r.url="/api/s/"+SITE.name+"/cmd/system",r.contentType="application/json; charset=utf-8",r.type="POST",r.data=JSON.stringify({cmd:"restore"});break;case"downloadSupportLink":r.url="/api/s/"+SITE.name+"/cmd/system",r.contentType="application/json; charset=utf-8",r.type="POST",r.data=JSON.stringify({cmd:"support",userAgent:navigator.userAgent,language:navigator.language});break;case"backupDays":r.url="/api/s/"+SITE.name+"/cmd/system",r.contentType="application/json; charset=utf-8",r.type="POST",r.data=JSON.stringify({cmd:"set-param",key:"download_timeframe",value:r.days});break;case"setDebugLevel":r.url="/api/s/"+SITE.name+"/cmd/system",r.contentType="application/json; charset=utf-8",r.type="POST",r.data=JSON.stringify({cmd:"set-param",key:"debug."+r.debug_type,value:r.debug_value})}return n.sync.call(this,e,t,r)}})}),define("unifi/collection/SystemInfos",["unifi/collection/Collection","backbone","unifi/model/SystemInfo"],function(e,t,n){"use strict";return e.extend({model:n,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/sysinfo"}})}),define("unifi/model/Status",["unifi/model/Model","underscore","backbone"],function(e,t,n){"use strict";return e.extend({url:"/status"})}),define("ubnt/view/dialogs/WorkingDialogView",["ubnt/view/dialogs/AlertDialogView","backbone","underscore","msg/Msg","jquery"],function(e,t,n,r,i){"use strict";return e.extend({options:{title:r.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,t,n,r){"use strict";function i(t,n,r){var s=t.contents().find("div#"+n);if(s.size()>0){var o=e.parseJSON(s.attr("response"));r.resolve(o),t.remove()}else setTimeout(function(){i(t,n,r)},500)}function s(){this.xhrSupport="FormData"in window}return s.prototype.upload=function(n,r){var s=this,o=e('[type="file"]',n),u=o.get(0),a=e.Deferred(),f;if(this.xhrSupport){f=u.files[0];var l=new XMLHttpRequest,c=new FormData;return c.append("file",f),l.upload.addEventListener("progress",a.notify,!1),l.addEventListener("load",function(t){try{a.resolve(e.parseJSON(t.currentTarget.response),status,l)}catch(n){a.reject(l,"error")}},!1),l.addEventListener("error",function(e,t,n){a.reject(e,t,n)},!1),l.open("POST",r.url),l.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.cookie("csrf_token")&&l.setRequestHeader("X-Csrf-Token",e.cookie("csrf_token")),l.send(c),a.promise()}var h=o.parent(),p=o.clone(!0);o=o.detach(),u=o.get(0);var d=e('<iframe src="/iframe.html" class="jupload-IF"></iframe>');d.attr("id",u.id+"IF").attr("name",u.id+"IF").appendTo(n);var v=e('<form method="post" enctype="multipart/form-data"><input type="hidden" name="id" value="'+u.id+'"/></form>');return v.append(o).attr("id",u.id+"form").attr("target",u.id+"IF").attr("action",r.url),d.one("load",function(){v.appendTo(d.contents().find("body")),v.submit(),h.append(p)}),i(d,u.id,a),a.promise()},s}),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,n,r,i,s,o,u,a,f,l,c){"use strict";return e.extend({id:"settingsMaintenance",_templateId:i,initialize:function(t){e.prototype.initialize.call(this,t),this.app=t.app,r.when(this._rendered=r.Deferred(),this._dependencies=r.Deferred()).then(this.populate,this.failed),this.dependencies()},dependencies:function(){var e={SystemInfos:s},n=[],i={},o=this;t.each(e,function(e,t){n.push(i[t]=r.Deferred())},this),r.when.apply(r,n).then(function(){o._dependencies.resolve()},function(){o._dependencies.reject()}),t.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:i[t]}},e)},this)},render:function(){e.prototype.render.call(this);if(!this.rendered&&(this.rendered=!0)){var i=this;this.$el.html(t.template(this._templateId,{msg:n})),this.$el.find("select:not(.plain)").each(function(){var e=r(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(),i.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"),this._rendered.state()==="resolved"&&this._dependencies.state()=="resolved"?this.populate():this._rendered.state()==="pending"&&this._rendered.resolve()}},populate:function(){if(this._dependencies&&this._dependencies.state()=="resolved"){var e=this,t,n;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(i){t=r(this),n=t.attr("name"),t.val(e.systemInfo.get("debug_"+n)||"warn").change()}),this.$downloadBackupDays.val(this.systemInfo.get("download_timeframe")||"7").change()}},failed:function(){(new f).open(n.E_DataLoad)},downloadBackupLink:function(){var e=this;return this.$downloadBackupLink.disable(),this.backupNotify=new l,this.backupNotify.open(n.I_ServerDownloading),this.systemInfo.backup({days:this.$downloadBackupDays.val(),success:function(t,n,r){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 l,this.backupNotify.open(n.I_ServerDownloadingSupport),this.systemInfo.downloadSupportLink({success:function(t,n,r){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 c;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,t,i){this.$restoreProgress.hide(),this.$restoreFile=this.$el.find("#restoreFile").show(),!e||!e.meta||e.meta.rc!="ok"?(new f).open(e.meta.msg==="api.err.InvalidBackupVersion"?n.localize(n.E_InvalidBackupVersion,e.meta.filename,e.meta.version):n.localize(n.E_InvalidBackup,e.meta.filename)):(new a).show(n.localize(n.I_ConfirmRestore,e.meta.filename,new Date(parseInt(e.meta.timestamp,10))),r.proxy(function(){this.notify=new l,this.notify.open(n.I_AlertRestore),(new o).restore().always(r.proxy(function(e){e&&e.meta&&e.meta.rc==="ok"?(this.app.ajaxErrorOff(),this.poll(null,function(){location.reload()})):(this.notify.close(),this.notify.remove(),(new f).open(n.E_Fatal+": "+e.msg))},this))},this))},poll:function(e,i){e=e||new u,e.fetch({global:!1}).always(r.proxy(function(r){if(r&&r.meta){if(r.meta.up===!0)return i&&i.apply(this,arguments);r.meta.msg&&(this.notify=this.notify||new l,this.notify.open(n[r.meta.msg]))}t.delay(this.poll,1500,e,i)},this))},save:function(e){var t=this;this.$submit.trigger("saving"),r.when(t.systemInfo.setDebugLevel({debug_type:t.$el.find(".support-info select:eq(0)").attr("name"),debug_value:t.$el.find(".support-info select:eq(0)").val()}),t.systemInfo.setDebugLevel({debug_type:t.$el.find(".support-info select:eq(1)").attr("name"),debug_value:t.$el.find(".support-info select:eq(1)").val()}),t.systemInfo.setDebugLevel({debug_type:t.$el.find(".support-info select:eq(2)").attr("name"),debug_value:t.$el.find(".support-info select:eq(2)").val()}),t.systemInfo.setBackupDays({days:t.$downloadBackupDays.val()})).then(r.proxy(this.success,this),r.proxy(this.error,this))},success:function(){this.$submit.trigger("success")},error:function(e,t){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/AutoResponderView","unifi/view/settings/ExtensionsView","unifi/view/settings/ControllerView","unifi/view/settings/MaintenanceView"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x){"use strict";return e.extend({id:"settingsChrome",className:"container",permanent:!0,dialogOptions:{dialogClass:"dialog-settings",title:"Settings",disableAutofocus:!0},sections:{site:f,admins:u,usergroups:d,wirelessnetworks:y,networks:m,guestcontrol:c,voip:b,autoresponder:w,extensions:E,controller:S,maintenance:x},initialize:function(n){e.prototype.initialize.call(this),this.app=n.app,this.views={},t.bindAll(this,"onResizeWindow","onBodyClick")},render:function(){!this.rendered&&(this.rendered=!0)&&(this.$el.html(t.template(s,{msg:i})),this.$content=this.$el.find("#settingsContent"),this.$settingsNav=this.$("#settingsNav"),this.$settingsNav.find("a").on("click",n.proxy(function(e){e.preventDefault();var t=n(e.currentTarget),r=t.data("section");this.renderSection(r)},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(r){e.prototype.open.call(this),this.app.settings=this.app.settings||"site",this.renderSection(this.app.settings,r),n.Window.on("resize.settingsDialog",t.debounce(this.onResizeWindow,250)),this.onResizeWindow()},close:function(){e.prototype.close.call(this),n.Body.off("click",this.onBodyClick),n.Window.off("resize.settingsDialog")},onBodyClick:function(e){var t=n(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={},r={width:1140,height:400};t.each(["width","height"],function(t){var i=n.Window[t]()*.9;e[t]=i<r[t]?r[t]:i}),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=this,n,r,i;n=[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(n,function(e,t){r=e.attr("type");switch(r){case"checkbox":case"file":i="change";break;case"text":i="keyup";break;case undefined:i="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"),n.Body.off("click",this.onBodyClick),n.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.6.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,n,r,i,s){"use strict";return e.extend({id:"roadBlockChrome",className:"container",dialogOptions:{dialogClass:"dialog-roadblock",title:"",width:1024,height:768,disableAutofocus:!0},initialize:function(n){e.prototype.initialize.call(this),this.app=n.app,t.bindAll(this)},render:function(){this.$el.html(t.template(s,{msg:i}))},open:function(){e.prototype.open.call(this),n.Window.on("resize.addDeviceDialog",t.debounce(this.onResizeWindow,250)),this.onResizeWindow()},onResizeWindow:function(){this.center()},close:function(){e.prototype.close.call(this),n.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,n,r,i,s){"use strict";return e.extend({events:{"keyup input[name=site-name]":"validateInputs","click .button-submit":"onSubmit","submit #addSiteForm":"onSubmit"},dialogOptions:{title:n.G_AddNewSite,width:"auto",height:"auto",modal:!0,resizable:!1,draggable:!1,dialogClass:"dialog-add-site dialog-simple"},initialize:function(e){i.bindAll(this),this.app=e.app},render:function(){this.$el.html(i.template(t,{msg:n})),this.$siteNameInput=this.$("input[name=site-name]").focus(),this.$submitButton=this.$(".button-submit"),this.$errors=this.$(".errors"),this.$submitButton.find("span").after(n.G_Submit)},open:function(){e.prototype.open.call(this),s.Window.on("resize.addSiteDialog",i.debounce(this.onResizeWindow,250)),this.$submitButton.prop("disabled",!0),this.onResizeWindow()},close:function(){e.prototype.close.call(this),s.Window.off("resize.addSiteDialog")},onResizeWindow:function(){this.center()},validateInputs:function(){var e=0,t=[this.$siteNameInput],r;this.$siteNameInput.removeClass("error"),this.$errors.hide(),this.$errors.find(".error-msg").remove(),i.each(t,function(t){t.val()||e++},this),this.app.data.Sites.collection.models[0].validator.name(this.$siteNameInput.val())||(r=n.localize(n.E_InvalidName,n.G_Name),this.$siteNameInput.addClass("error")),r?this.$submitButton.prop("disabled",!0):this.$submitButton.prop("disabled",!!e),r&&(this.$errors.show(),this.$errors.prepend(s('<div class="left error-msg"></div>').text(r)))},onSubmit:function(){var e=this,t=this.app.collection("Sites"),r={desc:this.$siteNameInput.val()};return t.create(r,{wait:!0,success:function(t){var n=t.id;e.app.changeSite(n),e.close()},error:function(t,r,i){var s=r.responseJSON.meta.msg,o=n.apiError(r);e.$errors.show().text(o)}}),!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 n,r=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()),n=this.menu.menu({select:function(e,t){var n=t.item.data("ui-selectmenu-item");r._select(n,e),r.isOpen&&(e.preventDefault(),r.close(e))},focus:function(e,n){var i=n.item.data("ui-selectmenu-item");r.focus!==t&&i.index!==r.focus&&(r._trigger("focus",e,{item:i}),r.isOpen||r._select(i,e)),r.focus=i.index,r.button.attr("aria-activedescendant",r.menuItems.eq(i.index).find("a").attr("id"))},role:"listbox"}).data("ui-menu"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),n.delay=999999999,n._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){if(this.options.disabled)return;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)return;this.isOpen=!1,this._toggleAttr();if(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,n){var r=this,i="";e.each(n,function(n,s){s.optgroup!==i&&(e("<li>",{"class":"ui-selectmenu-optgroup"+(s.element.parent("optgroup").attr("disabled")?" ui-state-disabled":""),text:s.optgroup}).appendTo(t),i=s.optgroup),r._renderItem(t,s)})},_renderItem:function(t,n){var r=e("<li>").data("ui-selectmenu-item",n),i=e("<a>",{href:"#"});return n.disabled&&r.addClass("ui-state-disabled"),this._setText(i,n.label),r.append(i).appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){e==="first"||e==="last"?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 n=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.isOpen&&this.close(t),n=!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),n=!1}n&&t.preventDefault()}},_select:function(e,t){var n=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setSelected(e),this._trigger("select",t,{item:e}),e.index!==n&&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){e==="icons"&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),e==="appendTo"&&this.menuWrap.appendTo(this._appendTo()),e==="disabled"&&(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 n=[];t.each(function(t,r){var i=e(r),s=i.parent("optgroup");n.push({element:i,index:t,value:i.attr("value"),label:i.text(),optgroup:s.attr("label")||"",disabled:s.attr("disabled")||i.attr("disabled")})}),this.items=n},_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){t.important=="vertical"&&(t.vertical=="top"?(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 n=e(t.target),r=this.options.parent.attr("id");return n.parents("#"+r).length||n.attr("id")==r},_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,n){e.ui.selectmenu.prototype._setText.call(this,t,(this.options.label||"")+n)},_getCreateEventData:function(){return{menu:this.menu,menuWrap:this.menuWrap}},open:function(t){e.ui.selectmenu.prototype.open.apply(this,arguments),this.options.sizeToParent?this.menuWrap.width(this.options.parent.outerWidth()):this.options.sizeToButtonOuter?this.menuWrap.width(this.button.outerWidth()):this.menuWrap.width(this.button.width()),this.options.parent.addClass("active"),this.button.focus()},close:function(t){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,t){window.setTimeout(e,1e3/60)}}(),window.requestInterval=function(e,t){function i(){var s=(new Date).getTime(),o=s-n;o>=t&&(e.call(),n=(new Date).getTime()),r.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(),r={};return r.value=requestAnimFrame(i),r},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 s=(new Date).getTime(),o=s-n;o>=t?e.call():r.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(),r={};return r.value=requestAnimFrame(i),r},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 n={suffix:"@2x",srcattr:"data-src",retattr:"data-ret",altattr:"data-alt"},r=e.extend(n,t),i=window.devicePixelRatio,s=i>1?!0:!1;e(this).each(function(){var t=e(this),n=t.css("display");t.css("display","none");if(t.attr(r.srcattr)){var o=t.attr(r.srcattr),u=t.attr(r.altattr),a=t.attr(r.retattr);s===!0?(t.attr(r.retattr)?t.attr({src:a,alt:u}):t.attr({src:o.replace(/\.\w+$/,function(e){return r.suffix+e}),alt:u}),t.load(function(){var e=t.height()/i,r=t.width()/i;t.attr({height:e,width:r}).css({display:n})})):t.attr({src:o,alt:u}).css({display:n})}})}})}(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,n,r,i,s,o,u,a,f){"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(i("#columnMainContent")),i("body").append(this.$flashes=i('<div id="flashes"></div>'))},render:function(){this.$preload=i("#preload").detach();if(!this.rendered&&(this.rendered=!0)){i("#header form").show();var e=this,o=i("#navigation");t.each(["location","refresh"],function(t){var n=i("select#"+t),s=n.parents("fieldset"),o=i.noop;t=="location"&&this.config.site=="Admin"&&(o=function(t,n){i('<button class="button header is-super"><span class="ubnt-icon-plus ui-button-icon button-add-icon"></span>'+r.G_AddSite+"</button>").on("click",function(){var t=new f({app:e.app});t.open()}).appendTo(n.menuWrap)});if(t=="refresh"){var u=i.cookie("refreshInterval");n.find("option[value="+u+"]").prop("selected",!0)}n.selectmenu({parent:s,appendTo:i("#header"),sizeToParent:!0,icons:{button:"ubnt-icon-arrow-down header-select-arrow"},position:{at:"left bottom+12"},change:function(){n.trigger("change")},create:o})},this),this.config.site=="Operator"&&this.options.cloudUser&&this.options.cloudUser.get("site_role")=="admin"&&o.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>'),i("#refresh").after(i('<div class="refresh-status"><span>'+r.G_Refresh+"</span></div>").on("click",function(t){t.stopPropagation(),e.app.refresh(!0)})),i("#refresh").on("change",function(){var t=i(this).find("option:selected").val(),n=!1;e._refreshInterval&&window[n?"clearRequestInterval":"clearInterval"](e._refreshInterval),t>0&&(e._refreshInterval=window[n?"requestInterval":"setInterval"](function(){e.app.refresh(!1)},t*1e3)),t>=120?i.cookie("refreshInterval",t):i.cookie("refreshInterval",120)}).trigger("change"),i("#location").on("change",function(t,n){n||e.app.changeSite(i(this).find("option:selected").val())});var l=this.app.collection("Sites",{},s);this.listenTo(l,"change",this.populateLocation),this.listenTo(l,"remove",this.populateLocation),this.listenTo(l,"add",this.populateLocation),this.populateLocation(),i(".retina").retinise(),this.userPopOver=new n({model:this.options.cloudUser}),i("#headerAvatar .user").on("click",function(){return e.userPopOver.toggleClass(),!1}),i(document).click(function(){e.userPopOver.hide()}),i("#headerAvatar").show(),i("body").on("click","span",this.onSpanClick),this.app.updatePushStateUrls(o.find("a")),o.find("a").not("a[data-page=settings]").on("click",function(t){t.preventDefault();var n=i(t.currentTarget),r=n.data("page");e.app.routers[r].navigate(r,{trigger:!0})}),o.find("a[data-page=settings]").on("click",i.proxy(function(e,t){e.preventDefault(),this.views.settings||(this.views.settings=new u({app:this.options.app})),this.views.settings.open(t)},this));var c=new a({app:e.options.app}),h=i("#navDashboard"),p=i("#navMap"),d=i("#navDevices"),v=i("#navClients"),m=i("#navCalls"),g=i("#navStatistics"),y=i("#navInsights"),b=i("#navSupport"),w=i("#navSettings"),E=i("#navGuests"),S=i("#navPayments"),x=i("#navVouchers"),T=i("#navOperators"),N=i("#navTest");E.find(".nav-text").text(r.G_HotspotNavGuests),S.find(".nav-text").text(r.G_HotspotNavPayments),x.find(".nav-text").text(r.G_HotspotNavVouchers),T.find(".nav-text").text(r.G_HotspotNavOperators),h.find(".nav-text").text(r.G_NavDashboard),p.find(".nav-text").text(r.G_NavMap),d.find(".nav-text").text(r.G_NavDevices),v.find(".nav-text").text(r.G_NavClients),m.find(".nav-text").text(r.G_NavCalls),g.find(".nav-text").text(r.G_NavStatistics),y.find(".nav-text").text(r.G_NavInsights),b.find(".nav-text").text(r.G_NavSupport),w.find(".nav-text").text(r.G_NavSettings),N.find(".nav-text").text("Test")}else i("#location").val(SITE.id).trigger("change",!0);return this},flash:function(e,n,r,s){var o,u;switch(e){case"success":n=n||"Success",o="ubnt-icon-check checkmark",u="status-success";break;case"error":n=n||"Error",o="ubnt-icon-warning alert",u="status-error"}var a=i('<div class="status-alert '+u+'">'+n+"</div>");o&&a.prepend(i('<span class="'+o+'"></span>&nbsp;')),r&&a.append(i('<div class="details">'+r+"</div>")),this.$flashes.append(a),s||t.delay(function(e){e.fadeOut(function(){i(this).remove()})},3e3,a)},refreshing:function(e){var n=i("#header .refresh-status");t.isUndefined(e)?n.addClass("active"):(t.delay(function(){n.removeClass("active"),n.addClass(e?"success":"error")},1e3),t.delay(function(e){n.removeClass(e)},3e3,e?"success":"error"))},populateLocation:function(){var e=i("#location").empty();this.app.collection("Sites",{},s).each(function(t){t.get("attr_hidden")||e.append(i('<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 n=e.history.fragment,r=" | ";document.title=this.title+r+t},reset:function(){i("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=i("#nav"+(e.charAt(0).toUpperCase()+e.slice(1))),n=t.find("a");i("#navigation").find("li").removeClass("active"),t.addClass("active");var r=n.data("title");if(!r){var s=n.data("page");r=s.charAt(0).toUpperCase()+s.substr(1)}this.updateTitle(r),o.trackPage()},onSpanClick:function(e){var n=i(e.currentTarget),r=n.prev();t.contains(["checkbox","radio"],r.attr("type"))&&r.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)}})});