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

/*
  SpeedTestView.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  dashboard.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/**
 * KineticJS JavaScript Framework v4.3.3
 * http://www.kineticjs.com/
 * Copyright 2013, Eric Rowell
 * Licensed under the MIT or GPL Version 2 licenses.
 * Date: Feb 12 2013
 *
 * Copyright (C) 2011 - 2013 by Eric Rowell
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

/** @license
 * RequireJS plugin for async dependency load like JSONP and Google Maps
 * Author: Miller Medeiros
 * Version: 0.1.1 (2011/11/17)
 * Released under the MIT license
 */

/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version: 3.1.6
 *
 * Requires: jQuery 1.2.2+
 */

/*
 * heatmap.js v2.0.0 | JavaScript Heatmap Library
 *
 * Copyright 2008-2014 Patrick Wied <heatmapjs@patrick-wied.at> - All rights reserved.
 * Dual licensed under MIT and Beerware license 
 *
 * :: 2014-10-31 21:16
 */

/*
* heatmap.js gmaps overlay
*
* Copyright (c) 2014, Patrick Wied (http://www.patrick-wied.at)
* Dual-licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and the Beerware (http://en.wikipedia.org/wiki/Beerware) license.
*/

/*!
 * jQuery Validation Plugin 1.12.0pre
 *
 * http://jqueryvalidation.org//
 *
 * Copyright 2013 Jörn Zaefferer
 * Released under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 */

/*
  map.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
// the regular expression composed & commented
// could be easily tweaked for RFC compliance,
// it was expressly modified to fit & satisfy
// these test for an URL shortener:
//
//   http://mathiasbynens.be/demo/url-regex
//
// Notes on possible differences from a standard/generic validation:
//
// - utf-8 char class take in consideration the full Unicode range
// - TLDs have been made mandatory so single names like "localhost" fails
// - protocols have been restricted to ftp, http and https only as requested
//
// Changes:
//
// - IP address dotted notation validation, range: 1.0.0.0 - 223.255.255.255
//   first and last IP address of each class is considered invalid
//   (since they are broadcast/network addresses)
//
// - Added exclusion of private, reserved and/or local networks ranges
//
// - Made starting path slash optional (http://example.com?foo=bar)
//
// - Allow a dot (.) at the end of hostnames (http://example.com.)
//
// Compressed one-line versions:
//
// Javascript version
//
// /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/i
//
// PHP version
//
// _^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}-\x{ffff}0-9]-*)*[a-z\x{00a1}-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]-*)*[a-z\x{00a1}-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$_iuS
//

/*
  devices.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  FormView.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  gateways.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  switches.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  phones.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  AddDeviceView.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  devices/IndexView.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  clients.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

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

/*
  statistics.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  insights.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  switchstatsview.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  remoteuservpnstats.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  support.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 */

/*
  ubnt.layout.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 
  To be used to add draggable handles to each layout panel and
  also to resize a panel manually. Each panel can be dragged
  from one or more directions (north, south, east or west) and
  can trigger the resize of other panels at the same time (eg. if
  one panel should expand while another collapses).
 
  Usage:
    //initialize the east column to have a handler on the west to change its width
    $('#columnEast').layout({
      'directions': {
        'west': {                                            //add a handle to the west side
          'draggable': true,                                 //allow the panel to be dragged to resize
          'property': 'width',                               //resize the panel's width attribute
          'also': [{
            'element': $('#columnMain > .content'),          //also resize this element
            'property': 'margin-right',                      //resize this element's margin-right
            'inverse': false                                 //don't resize inversely to the main panel
          }]
        }
      }
    });
 
    //resize the east column (using the west handler config) to be 30 pixels wider
    $('#columnEast').layout('resize', 'west', 30, true);
 
    //resize the west column (using the east handler config) to a dynamic value and animate the transition
    $('#columnWest').layout('resize', 'east', function() {
      var left = $('#columnEast').offset().left;
      return left ? left : $(window).width();
    }, false, { duration: 350 });
 */

/*
  ubnt.panel.js
  Copyright 2016 Ubiquiti Networks, Inc. All rights reserved.
 
  An extenstion of the ubnt.layout.js plugin that treats each
  layout element as a panel that can be toggled on or off using
  one or more buttons. A panel toggled to off is completely
  gone, not just minimized.
 
  Usage:
    //initialize the east column to have a handler on the west to change its width
    $('#columnEast').layout({
      'duration': 350,                                       //the duration for the panel show/hide animation
      'directions': {
        'west': {                                            //add a handle to the west side
          'draggable': true,                                 //allow the panel to be dragged to resize
          'property': 'width',                               //resize the panel's width attribute
          'also': [{
            'element': $('#columnMain > .content'),          //also resize this element
            'property': 'margin-right',                      //resize this element's margin-right
            'inverse': false                                 //don't resize inversely to the main panel
          }],
          buttons: [                                         //the button(s) to toggle the east column
            $('#toggleEast')
          ]
        }
      }
    });
 */

define("text!includes/dashboard/dashboardTableItemTemplate.html",[],function(){return'<div class="unknown <%- subsystem %> table-item">\n    <div class="header">\n        <div class="icon <%- icon %>"></div>\n        <%- subsystem.toUpperCase() %>\n    </div>\n    <div class="current-state">\n        <div class="state">\n            <%- msg.G_DashboardNoDataAvailable %>\n        </div>\n    </div>\n    <div class="stats"></div>\n    <div class="no-data"><%- msg.G_DashboardNoDataAvailable %></div>\n    <div class="footer">\n        <% if(statsLink) { %>\n        <div class="link left btn-stats">\n            <div class="button-hover sprite-button-hover"></div>\n            <div class="icon ubnt-icon-histogram"></div>\n        </div>\n        <% } %>\n        <% if(configureLink) { %>\n            <div class="link right btn-configure">\n                <div class="button-hover sprite-button-hover"></div>\n                <div class="icon ubnt-icon-wrench"></div>\n            </div>\n        <% } %>\n    </div>\n</div>\n'}),define("text!includes/dashboard/dashboardStatRowTemplate.html",[],function(){return'<div class="row">\n    <div class="stat-name"><%- name %></div>\n    <div class="stat-value stat-value-<%- name.replace(/\\s/g, \'-\') %>"><%- value %></div>\n</div>'}),define("unifi/model/Subsystem",["unifi/model/Model","underscore","jquery","ubnt/backgrid"],function(e,t,i,a){"use strict";return e.extend({notifications:0,possibleStates:["ok","unknown","warning","error"],state:function(){return this.get("status")},icon:function(){switch(this.get("subsystem")){case"www":return"ubnt-icon-globe";case"wan":return"ubnt-icon-lock";case"lan":return"ubnt-icon-files";case"wlan":return"ubnt-icon-wifi"}},stats:function(){var e,t,n,o,r,s,c=[];switch(this.get("subsystem")){case"www":var l=this.get("ip"),d=this.get("nameservers"),m=this.get("uptime");if(s=this.get("gateways"),l&&c.push({name:"IP",value:this.get("ip")}),i.isArray(s)&&s.length>0&&c.push({name:"GATEWAY",value:this.get("gateways").join(" ")}),i.isArray(d)&&d.length>0&&c.push({name:"DNS",value:this.get("nameservers").join(" ")}),m){if(this.has("latency")){var u=this.get("latency");c.push({name:"LATENCY",value:(1>=u?"<1":u)+" ms"})}c.push({name:"UPTIME",value:a.Formatters.Seconds.fromRaw(m)})}return c;case"wan":var h=this.get("num_gateway"),g=this.get("num_sta");return n=this.get("tx_bytes-r"),o=this.get("rx_bytes-r"),void 0!==h||void 0!==g||void 0!==o||void 0!==n?[{name:"LAN IP",value:this.get("lan_ip")},{name:"CLIENTS",value:g},{name:"DOWN",value:a.Formatters.BytesPerSecond.fromRaw(o)||0},{name:"UP",value:a.Formatters.BytesPerSecond.fromRaw(n)||0}]:null;case"lan":var p=this.get("num_sw");return r=this.get("num_adopted"),s=this.get("gateways"),e=this.get("num_user"),t=this.get("num_guest"),o=this.get("tx_bytes-r"),n=this.get("rx_bytes-r"),void 0!==p||void 0!==t||void 0!==o||void 0!==n?(c=[{name:"SWITCHES",value:p==r?p:p+" / "+r},{name:"USERS",value:e},{name:"GUESTS",value:t}],i.isArray(s)&&s.length>0&&c.push({name:"DOWN",value:a.Formatters.BytesPerSecond.fromRaw(o)||0},{name:"UP",value:a.Formatters.BytesPerSecond.fromRaw(n)||0}),c):null;case"wlan":var y=this.get("num_ap");return r=this.get("num_adopted"),e=this.get("num_user"),t=this.get("num_guest"),o=this.get("tx_bytes-r"),n=this.get("rx_bytes-r"),void 0!==y||void 0!==e||void 0!==t||void 0!==o||void 0!==n?[{name:"APS",value:y==r?y:y+" / "+r},{name:"USERS",value:e},{name:"GUESTS",value:t},{name:"DOWN",value:a.Formatters.BytesPerSecond.fromRaw(o)||0},{name:"UP",value:a.Formatters.BytesPerSecond.fromRaw(n)||0}]:null}}})}),!function(){function e(e,t){return t>e?-1:e>t?1:e>=t?0:NaN}function t(e){return null===e?NaN:+e}function i(e){return!isNaN(e)}function a(e){return{left:function(t,i,a,n){for(arguments.length<3&&(a=0),arguments.length<4&&(n=t.length);n>a;){var o=a+n>>>1;e(t[o],i)<0?a=o+1:n=o}return a},right:function(t,i,a,n){for(arguments.length<3&&(a=0),arguments.length<4&&(n=t.length);n>a;){var o=a+n>>>1;e(t[o],i)>0?n=o:a=o+1}return a}}}function n(e){return e.length}function o(e){for(var t=1;e*t%1;)t*=10;return t}function r(e,t){for(var i in t)Object.defineProperty(e.prototype,i,{value:t[i],enumerable:!1})}function s(){this._=Object.create(null)}function c(e){return(e+="")===dr||e[0]===mr?mr+e:e}function l(e){return(e+="")[0]===mr?e.slice(1):e}function d(e){return c(e)in this._}function m(e){return(e=c(e))in this._&&delete this._[e]}function u(){var e=[];for(var t in this._)e.push(l(t));return e}function h(){var e=0;for(var t in this._)++e;return e}function g(){for(var e in this._)return!1;return!0}function p(){this._=Object.create(null)}function y(e,t,i){return function(){var a=i.apply(t,arguments);return a===t?e:a}}function f(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var i=0,a=ur.length;a>i;++i){var n=ur[i]+t;if(n in e)return n}}function _(){}function v(){}function b(e){function t(){for(var t,a=i,n=-1,o=a.length;++n<o;)(t=a[n].on)&&t.apply(this,arguments);return e}var i=[],a=new s;return t.on=function(t,n){var o,r=a.get(t);return arguments.length<2?r&&r.on:(r&&(r.on=null,i=i.slice(0,o=i.indexOf(r)).concat(i.slice(o+1)),a.remove(t)),n&&i.push(a.set(t,{on:n})),e)},t}function w(){Yo.event.preventDefault()}function S(){for(var e,t=Yo.event;e=t.sourceEvent;)t=e;return t}function C(e){for(var t=new v,i=0,a=arguments.length;++i<a;)t[arguments[i]]=b(t);return t.of=function(i,a){return function(n){try{var o=n.sourceEvent=Yo.event;n.target=e,Yo.event=n,t[n.type].apply(i,a)}finally{Yo.event=o}}},t}function x(e){return gr(e,vr),e}function k(e){return"function"==typeof e?e:function(){return pr(e,this)}}function P(e){return"function"==typeof e?e:function(){return yr(e,this)}}function M(e,t){function i(){this.removeAttribute(e)}function a(){this.removeAttributeNS(e.space,e.local)}function n(){this.setAttribute(e,t)}function o(){this.setAttributeNS(e.space,e.local,t)}function r(){var i=t.apply(this,arguments);null==i?this.removeAttribute(e):this.setAttribute(e,i)}function s(){var i=t.apply(this,arguments);null==i?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}return e=Yo.ns.qualify(e),null==t?e.local?a:i:"function"==typeof t?e.local?s:r:e.local?o:n}function T(e){return e.trim().replace(/\s+/g," ")}function D(e){return new RegExp("(?:^|\\s+)"+Yo.requote(e)+"(?:\\s+|$)","g")}function A(e){return(e+"").trim().split(/^|\s+/)}function $(e,t){function i(){for(var i=-1;++i<n;)e[i](this,t)}function a(){for(var i=-1,a=t.apply(this,arguments);++i<n;)e[i](this,a)}e=A(e).map(G);var n=e.length;return"function"==typeof t?a:i}function G(e){var t=D(e);return function(i,a){if(n=i.classList)return a?n.add(e):n.remove(e);var n=i.getAttribute("class")||"";a?(t.lastIndex=0,t.test(n)||i.setAttribute("class",T(n+" "+e))):i.setAttribute("class",T(n.replace(t," ")))}}function F(e,t,i){function a(){this.style.removeProperty(e)}function n(){this.style.setProperty(e,t,i)}function o(){var a=t.apply(this,arguments);null==a?this.style.removeProperty(e):this.style.setProperty(e,a,i)}return null==t?a:"function"==typeof t?o:n}function N(e,t){function i(){delete this[e]}function a(){this[e]=t}function n(){var i=t.apply(this,arguments);null==i?delete this[e]:this[e]=i}return null==t?i:"function"==typeof t?n:a}function R(e){return"function"==typeof e?e:(e=Yo.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,e)}}function I(e){return{__data__:e}}function E(e){return function(){return _r(this,e)}}function L(t){return arguments.length||(t=e),function(e,i){return e&&i?t(e.__data__,i.__data__):!e-!i}}function B(e,t){for(var i=0,a=e.length;a>i;i++)for(var n,o=e[i],r=0,s=o.length;s>r;r++)(n=o[r])&&t(n,r,i);return e}function U(e){return gr(e,wr),e}function O(e){var t,i;return function(a,n,o){var r,s=e[o].update,c=s.length;for(o!=i&&(i=o,t=0),n>=t&&(t=n+1);!(r=s[t])&&++t<c;);return r}}function H(){var e=this.__transition__;e&&++e.active}function V(e,t,i){function a(){var t=this[r];t&&(this.removeEventListener(e,t,t.$),delete this[r])}function n(){var n=c(t,Jo(arguments));a.call(this),this.addEventListener(e,this[r]=n,n.$=i),n._=t}function o(){var t,i=new RegExp("^__on([^.]+)"+Yo.requote(e)+"$");for(var a in this)if(t=a.match(i)){var n=this[a];this.removeEventListener(t[1],n,n.$),delete this[a]}}var r="__on"+e,s=e.indexOf("."),c=W;s>0&&(e=e.slice(0,s));var l=Cr.get(e);return l&&(e=l,c=z),s?t?n:a:t?_:o}function W(e,t){return function(i){var a=Yo.event;Yo.event=i,t[0]=this.__data__;try{e.apply(this,t)}finally{Yo.event=a}}}function z(e,t){var i=W(e,t);return function(e){var t=this,a=e.relatedTarget;a&&(a===t||8&a.compareDocumentPosition(t))||i.call(t,e)}}function K(){var e=".dragsuppress-"+ ++kr,t="click"+e,i=Yo.select(er).on("touchmove"+e,w).on("dragstart"+e,w).on("selectstart"+e,w);if(xr){var a=Qo.style,n=a[xr];a[xr]="none"}return function(o){function r(){i.on(t,null)}i.on(e,null),xr&&(a[xr]=n),o&&(i.on(t,function(){w(),r()},!0),setTimeout(r,0))}}function j(e,t){t.changedTouches&&(t=t.changedTouches[0]);var i=e.ownerSVGElement||e;if(i.createSVGPoint){var a=i.createSVGPoint();if(0>Pr&&(er.scrollX||er.scrollY)){i=Yo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var n=i[0][0].getScreenCTM();Pr=!(n.f||n.e),i.remove()}return Pr?(a.x=t.pageX,a.y=t.pageY):(a.x=t.clientX,a.y=t.clientY),a=a.matrixTransform(e.getScreenCTM().inverse()),[a.x,a.y]}var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}function q(){return Yo.event.changedTouches[0].identifier}function Y(){return Yo.event.target}function X(){return er}function J(e){return e>0?1:0>e?-1:0}function Z(e,t,i){return(t[0]-e[0])*(i[1]-e[1])-(t[1]-e[1])*(i[0]-e[0])}function Q(e){return e>1?0:-1>e?Mr:Math.acos(e)}function ee(e){return e>1?Dr:-1>e?-Dr:Math.asin(e)}function te(e){return((e=Math.exp(e))-1/e)/2}function ie(e){return((e=Math.exp(e))+1/e)/2}function ae(e){return((e=Math.exp(2*e))-1)/(e+1)}function ne(e){return(e=Math.sin(e/2))*e}function oe(){}function re(e,t,i){return this instanceof re?(this.h=+e,this.s=+t,void(this.l=+i)):arguments.length<2?e instanceof re?new re(e.h,e.s,e.l):be(""+e,we,re):new re(e,t,i)}function se(e,t,i){function a(e){return e>360?e-=360:0>e&&(e+=360),60>e?o+(r-o)*e/60:180>e?r:240>e?o+(r-o)*(240-e)/60:o}function n(e){return Math.round(255*a(e))}var o,r;return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)?0:0>t?0:t>1?1:t,i=0>i?0:i>1?1:i,r=.5>=i?i*(1+t):i+t-i*t,o=2*i-r,new ye(n(e+120),n(e),n(e-120))}function ce(e,t,i){return this instanceof ce?(this.h=+e,this.c=+t,void(this.l=+i)):arguments.length<2?e instanceof ce?new ce(e.h,e.c,e.l):e instanceof de?ue(e.l,e.a,e.b):ue((e=Se((e=Yo.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new ce(e,t,i)}function le(e,t,i){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new de(i,Math.cos(e*=Gr)*t,Math.sin(e)*t)}function de(e,t,i){return this instanceof de?(this.l=+e,this.a=+t,void(this.b=+i)):arguments.length<2?e instanceof de?new de(e.l,e.a,e.b):e instanceof ce?le(e.h,e.c,e.l):Se((e=ye(e)).r,e.g,e.b):new de(e,t,i)}function me(e,t,i){var a=(e+16)/116,n=a+t/500,o=a-i/200;return n=he(n)*Vr,a=he(a)*Wr,o=he(o)*zr,new ye(pe(3.2404542*n-1.5371385*a-.4985314*o),pe(-.969266*n+1.8760108*a+.041556*o),pe(.0556434*n-.2040259*a+1.0572252*o))}function ue(e,t,i){return e>0?new ce(Math.atan2(i,t)*Fr,Math.sqrt(t*t+i*i),e):new ce(NaN,NaN,e)}function he(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function ge(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function pe(e){return Math.round(255*(.00304>=e?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function ye(e,t,i){return this instanceof ye?(this.r=~~e,this.g=~~t,void(this.b=~~i)):arguments.length<2?e instanceof ye?new ye(e.r,e.g,e.b):be(""+e,ye,se):new ye(e,t,i)}function fe(e){return new ye(e>>16,e>>8&255,255&e)}function _e(e){return fe(e)+""}function ve(e){return 16>e?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function be(e,t,i){var a,n,o,r=0,s=0,c=0;if(a=/([a-z]+)\((.*)\)/i.exec(e))switch(n=a[2].split(","),a[1]){case"hsl":return i(parseFloat(n[0]),parseFloat(n[1])/100,parseFloat(n[2])/100);case"rgb":return t(xe(n[0]),xe(n[1]),xe(n[2]))}return(o=qr.get(e))?t(o.r,o.g,o.b):(null==e||"#"!==e.charAt(0)||isNaN(o=parseInt(e.slice(1),16))||(4===e.length?(r=(3840&o)>>4,r=r>>4|r,s=240&o,s=s>>4|s,c=15&o,c=c<<4|c):7===e.length&&(r=(16711680&o)>>16,s=(65280&o)>>8,c=255&o)),t(r,s,c))}function we(e,t,i){var a,n,o=Math.min(e/=255,t/=255,i/=255),r=Math.max(e,t,i),s=r-o,c=(r+o)/2;return s?(n=.5>c?s/(r+o):s/(2-r-o),a=e==r?(t-i)/s+(i>t?6:0):t==r?(i-e)/s+2:(e-t)/s+4,a*=60):(a=NaN,n=c>0&&1>c?0:a),new re(a,n,c)}function Se(e,t,i){e=Ce(e),t=Ce(t),i=Ce(i);var a=ge((.4124564*e+.3575761*t+.1804375*i)/Vr),n=ge((.2126729*e+.7151522*t+.072175*i)/Wr),o=ge((.0193339*e+.119192*t+.9503041*i)/zr);return de(116*n-16,500*(a-n),200*(n-o))}function Ce(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function xe(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}function ke(e){return"function"==typeof e?e:function(){return e}}function Pe(e){return e}function Me(e){return function(t,i,a){return 2===arguments.length&&"function"==typeof i&&(a=i,i=null),Te(t,i,e,a)}}function Te(e,t,i,a){function n(){var e,t=c.status;if(!t&&Ae(c)||t>=200&&300>t||304===t){try{e=i.call(o,c)}catch(a){return void r.error.call(o,a)}r.load.call(o,e)}else r.error.call(o,c)}var o={},r=Yo.dispatch("beforesend","progress","load","error"),s={},c=new XMLHttpRequest,l=null;return!er.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(e)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=n:c.onreadystatechange=function(){c.readyState>3&&n()},c.onprogress=function(e){var t=Yo.event;Yo.event=e;try{r.progress.call(o,c)}finally{Yo.event=t}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?s[e]:(null==t?delete s[e]:s[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(t=null==e?null:e+"",o):t},o.responseType=function(e){return arguments.length?(l=e,o):l},o.response=function(e){return i=e,o},["get","post"].forEach(function(e){o[e]=function(){return o.send.apply(o,[e].concat(Jo(arguments)))}}),o.send=function(i,a,n){if(2===arguments.length&&"function"==typeof a&&(n=a,a=null),c.open(i,e,!0),null==t||"accept"in s||(s.accept=t+",*/*"),c.setRequestHeader)for(var d in s)c.setRequestHeader(d,s[d]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=l&&(c.responseType=l),null!=n&&o.on("error",n).on("load",function(e){n(null,e)}),r.beforesend.call(o,c),c.send(null==a?null:a),o},o.abort=function(){return c.abort(),o},Yo.rebind(o,r,"on"),null==a?o:o.get(De(a))}function De(e){return 1===e.length?function(t,i){e(null==t?i:null)}:e}function Ae(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}function $e(){var e=Ge(),t=Fe()-e;t>24?(isFinite(t)&&(clearTimeout(Zr),Zr=setTimeout($e,t)),Jr=0):(Jr=1,es($e))}function Ge(){var e=Date.now();for(Qr=Yr;Qr;)e>=Qr.t&&(Qr.f=Qr.c(e-Qr.t)),Qr=Qr.n;return e}function Fe(){for(var e,t=Yr,i=1/0;t;)t.f?t=e?e.n=t.n:Yr=t.n:(t.t<i&&(i=t.t),t=(e=t).n);return Xr=e,i}function Ne(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}function Re(e,t){var i=Math.pow(10,3*lr(8-t));return{scale:t>8?function(e){return e/i}:function(e){return e*i},symbol:e}}function Ie(e){var t=e.decimal,i=e.thousands,a=e.grouping,n=e.currency,o=a&&i?function(e,t){for(var n=e.length,o=[],r=0,s=a[0],c=0;n>0&&s>0&&(c+s+1>t&&(s=Math.max(1,t-c)),o.push(e.substring(n-=s,n+s)),!((c+=s+1)>t));)s=a[r=(r+1)%a.length];return o.reverse().join(i)}:Pe;return function(e){var i=is.exec(e),a=i[1]||" ",r=i[2]||">",s=i[3]||"-",c=i[4]||"",l=i[5],d=+i[6],m=i[7],u=i[8],h=i[9],g=1,p="",y="",f=!1,_=!0;switch(u&&(u=+u.substring(1)),(l||"0"===a&&"="===r)&&(l=a="0",r="="),h){case"n":m=!0,h="g";break;case"%":g=100,y="%",h="f";break;case"p":g=100,y="%",h="r";break;case"b":case"o":case"x":case"X":"#"===c&&(p="0"+h.toLowerCase());case"c":_=!1;case"d":f=!0,u=0;break;case"s":g=-1,h="r"}"$"===c&&(p=n[0],y=n[1]),"r"!=h||u||(h="g"),null!=u&&("g"==h?u=Math.max(1,Math.min(21,u)):("e"==h||"f"==h)&&(u=Math.max(0,Math.min(20,u)))),h=as.get(h)||Ee;var v=l&&m;return function(e){var i=y;if(f&&e%1)return"";var n=0>e||0===e&&0>1/e?(e=-e,"-"):"-"===s?"":s;if(0>g){var c=Yo.formatPrefix(e,u);e=c.scale(e),i=c.symbol+y}else e*=g;e=h(e,u);var b,w,S=e.lastIndexOf(".");if(0>S){var C=_?e.lastIndexOf("e"):-1;0>C?(b=e,w=""):(b=e.substring(0,C),w=e.substring(C))}else b=e.substring(0,S),w=t+e.substring(S+1);!l&&m&&(b=o(b,1/0));var x=p.length+b.length+w.length+(v?0:n.length),k=d>x?new Array(x=d-x+1).join(a):"";return v&&(b=o(k+b,k.length?d-w.length:1/0)),n+=p,e=b+w,("<"===r?n+e+k:">"===r?k+n+e:"^"===r?k.substring(0,x>>=1)+n+e+k.substring(x):n+(v?e:k+e))+i}}}function Ee(e){return e+""}function Le(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Be(e,t,i){function a(t){var i=e(t),a=o(i,1);return a-t>t-i?i:a}function n(i){return t(i=e(new os(i-1)),1),i}function o(e,i){return t(e=new os(+e),i),e}function r(e,a,o){var r=n(e),s=[];if(o>1)for(;a>r;)i(r)%o||s.push(new Date(+r)),t(r,1);else for(;a>r;)s.push(new Date(+r)),t(r,1);return s}function s(e,t,i){try{os=Le;var a=new Le;return a._=e,r(a,t,i)}finally{os=Date}}e.floor=e,e.round=a,e.ceil=n,e.offset=o,e.range=r;var c=e.utc=Ue(e);return c.floor=c,c.round=Ue(a),c.ceil=Ue(n),c.offset=Ue(o),c.range=s,e}function Ue(e){return function(t,i){try{os=Le;var a=new Le;return a._=t,e(a,i)._}finally{os=Date}}}function Oe(e){function t(e){function t(t){for(var i,n,o,r=[],s=-1,c=0;++s<a;)37===e.charCodeAt(s)&&(r.push(e.slice(c,s)),null!=(n=ss[i=e.charAt(++s)])&&(i=e.charAt(++s)),(o=T[i])&&(i=o(t,null==n?"e"===i?" ":"0":n)),r.push(i),c=s+1);return r.push(e.slice(c,s)),r.join("")}var a=e.length;return t.parse=function(t){var a={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},n=i(a,e,t,0);if(n!=t.length)return null;"p"in a&&(a.H=a.H%12+12*a.p);var o=null!=a.Z&&os!==Le,r=new(o?Le:os);return"j"in a?r.setFullYear(a.y,0,a.j):"w"in a&&("W"in a||"U"in a)?(r.setFullYear(a.y,0,1),r.setFullYear(a.y,0,"W"in a?(a.w+6)%7+7*a.W-(r.getDay()+5)%7:a.w+7*a.U-(r.getDay()+6)%7)):r.setFullYear(a.y,a.m,a.d),r.setHours(a.H+(a.Z/100|0),a.M+a.Z%100,a.S,a.L),o?r._:r},t.toString=function(){return e},t}function i(e,t,i,a){for(var n,o,r,s=0,c=t.length,l=i.length;c>s;){if(a>=l)return-1;if(n=t.charCodeAt(s++),37===n){if(r=t.charAt(s++),o=D[r in ss?t.charAt(s++):r],!o||(a=o(e,i,a))<0)return-1}else if(n!=i.charCodeAt(a++))return-1}return a}function a(e,t,i){S.lastIndex=0;var a=S.exec(t.slice(i));return a?(e.w=C.get(a[0].toLowerCase()),i+a[0].length):-1}function n(e,t,i){b.lastIndex=0;var a=b.exec(t.slice(i));return a?(e.w=w.get(a[0].toLowerCase()),i+a[0].length):-1}function o(e,t,i){P.lastIndex=0;var a=P.exec(t.slice(i));return a?(e.m=M.get(a[0].toLowerCase()),i+a[0].length):-1}function r(e,t,i){x.lastIndex=0;var a=x.exec(t.slice(i));return a?(e.m=k.get(a[0].toLowerCase()),i+a[0].length):-1}function s(e,t,a){return i(e,T.c.toString(),t,a)}function c(e,t,a){return i(e,T.x.toString(),t,a)}function l(e,t,a){return i(e,T.X.toString(),t,a)}function d(e,t,i){var a=v.get(t.slice(i,i+=2).toLowerCase());return null==a?-1:(e.p=a,i)}var m=e.dateTime,u=e.date,h=e.time,g=e.periods,p=e.days,y=e.shortDays,f=e.months,_=e.shortMonths;t.utc=function(e){function i(e){try{os=Le;var t=new os;return t._=e,a(t)}finally{os=Date}}var a=t(e);return i.parse=function(e){try{os=Le;var t=a.parse(e);return t&&t._}finally{os=Date}},i.toString=a.toString,i},t.multi=t.utc.multi=st;var v=Yo.map(),b=Ve(p),w=We(p),S=Ve(y),C=We(y),x=Ve(f),k=We(f),P=Ve(_),M=We(_);g.forEach(function(e,t){v.set(e.toLowerCase(),t)});var T={a:function(e){return y[e.getDay()]},A:function(e){return p[e.getDay()]},b:function(e){return _[e.getMonth()]},B:function(e){return f[e.getMonth()]},c:t(m),d:function(e,t){return He(e.getDate(),t,2)},e:function(e,t){return He(e.getDate(),t,2)},H:function(e,t){return He(e.getHours(),t,2)},I:function(e,t){return He(e.getHours()%12||12,t,2)},j:function(e,t){return He(1+ns.dayOfYear(e),t,3)},L:function(e,t){return He(e.getMilliseconds(),t,3)},m:function(e,t){return He(e.getMonth()+1,t,2)},M:function(e,t){return He(e.getMinutes(),t,2)},p:function(e){return g[+(e.getHours()>=12)]},S:function(e,t){return He(e.getSeconds(),t,2)},U:function(e,t){return He(ns.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return He(ns.mondayOfYear(e),t,2)},x:t(u),X:t(h),y:function(e,t){return He(e.getFullYear()%100,t,2)},Y:function(e,t){return He(e.getFullYear()%1e4,t,4)},Z:ot,"%":function(){return"%"}},D={a:a,A:n,b:o,B:r,c:s,d:Qe,e:Qe,H:tt,I:tt,j:et,L:nt,m:Ze,M:it,p:d,S:at,U:Ke,w:ze,W:je,x:c,X:l,y:Ye,Y:qe,Z:Xe,"%":rt};return t}function He(e,t,i){var a=0>e?"-":"",n=(a?-e:e)+"",o=n.length;return a+(i>o?new Array(i-o+1).join(t)+n:n)}function Ve(e){return new RegExp("^(?:"+e.map(Yo.requote).join("|")+")","i")}function We(e){for(var t=new s,i=-1,a=e.length;++i<a;)t.set(e[i].toLowerCase(),i);return t}function ze(e,t,i){cs.lastIndex=0;var a=cs.exec(t.slice(i,i+1));return a?(e.w=+a[0],i+a[0].length):-1}function Ke(e,t,i){cs.lastIndex=0;var a=cs.exec(t.slice(i));return a?(e.U=+a[0],i+a[0].length):-1}function je(e,t,i){cs.lastIndex=0;var a=cs.exec(t.slice(i));return a?(e.W=+a[0],i+a[0].length):-1}function qe(e,t,i){cs.lastIndex=0;var a=cs.exec(t.slice(i,i+4));return a?(e.y=+a[0],i+a[0].length):-1}function Ye(e,t,i){cs.lastIndex=0;var a=cs.exec(t.slice(i,i+2));return a?(e.y=Je(+a[0]),i+a[0].length):-1}function Xe(e,t,i){return/^[+-]\d{4}$/.test(t=t.slice(i,i+5))?(e.Z=-t,i+5):-1}function Je(e){return e+(e>68?1900:2e3)}function Ze(e,t,i){cs.lastIndex=0;var a=cs.exec(t.slice(i,i+2));return a?(e.m=a[0]-1,i+a[0].length):-1}function Qe(e,t,i){cs.lastIndex=0;var a=cs.exec(t.slice(i,i+2));return a?(e.d=+a[0],i+a[0].length):-1}function et(e,t,i){cs.lastIndex=0;var a=cs.exec(t.slice(i,i+3));return a?(e.j=+a[0],i+a[0].length):-1}function tt(e,t,i){cs.lastIndex=0;var a=cs.exec(t.slice(i,i+2));return a?(e.H=+a[0],i+a[0].length):-1}function it(e,t,i){cs.lastIndex=0;var a=cs.exec(t.slice(i,i+2));return a?(e.M=+a[0],i+a[0].length):-1}function at(e,t,i){cs.lastIndex=0;var a=cs.exec(t.slice(i,i+2));return a?(e.S=+a[0],i+a[0].length):-1}function nt(e,t,i){cs.lastIndex=0;var a=cs.exec(t.slice(i,i+3));return a?(e.L=+a[0],i+a[0].length):-1}function ot(e){var t=e.getTimezoneOffset(),i=t>0?"-":"+",a=lr(t)/60|0,n=lr(t)%60;return i+He(a,"0",2)+He(n,"0",2)}function rt(e,t,i){ls.lastIndex=0;var a=ls.exec(t.slice(i,i+1));return a?i+a[0].length:-1}function st(e){for(var t=e.length,i=-1;++i<t;)e[i][0]=this(e[i][0]);return function(t){for(var i=0,a=e[i];!a[1](t);)a=e[++i];return a[0](t)}}function ct(){}function lt(e,t,i){var a=i.s=e+t,n=a-e,o=a-n;i.t=e-o+(t-n)}function dt(e,t){e&&hs.hasOwnProperty(e.type)&&hs[e.type](e,t)}function mt(e,t,i){var a,n=-1,o=e.length-i;for(t.lineStart();++n<o;)a=e[n],t.point(a[0],a[1],a[2]);t.lineEnd()}function ut(e,t){var i=-1,a=e.length;for(t.polygonStart();++i<a;)mt(e[i],t,1);t.polygonEnd()}function ht(){function e(e,t){e*=Gr,t=t*Gr/2+Mr/4;var i=e-a,r=i>=0?1:-1,s=r*i,c=Math.cos(t),l=Math.sin(t),d=o*l,m=n*c+d*Math.cos(s),u=d*r*Math.sin(s);ps.add(Math.atan2(u,m)),a=e,n=c,o=l}var t,i,a,n,o;ys.point=function(r,s){ys.point=e,a=(t=r)*Gr,n=Math.cos(s=(i=s)*Gr/2+Mr/4),o=Math.sin(s)},ys.lineEnd=function(){e(t,i)}}function gt(e){var t=e[0],i=e[1],a=Math.cos(i);return[a*Math.cos(t),a*Math.sin(t),Math.sin(i)]}function pt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yt(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function ft(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function _t(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function vt(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function bt(e){return[Math.atan2(e[1],e[0]),ee(e[2])]}function wt(e,t){return lr(e[0]-t[0])<Ar&&lr(e[1]-t[1])<Ar}function St(e,t){e*=Gr;var i=Math.cos(t*=Gr);Ct(i*Math.cos(e),i*Math.sin(e),Math.sin(t))}function Ct(e,t,i){++fs,vs+=(e-vs)/fs,bs+=(t-bs)/fs,ws+=(i-ws)/fs}function xt(){function e(e,n){e*=Gr;var o=Math.cos(n*=Gr),r=o*Math.cos(e),s=o*Math.sin(e),c=Math.sin(n),l=Math.atan2(Math.sqrt((l=i*c-a*s)*l+(l=a*r-t*c)*l+(l=t*s-i*r)*l),t*r+i*s+a*c);_s+=l,Ss+=l*(t+(t=r)),Cs+=l*(i+(i=s)),xs+=l*(a+(a=c)),Ct(t,i,a)}var t,i,a;Ts.point=function(n,o){n*=Gr;var r=Math.cos(o*=Gr);t=r*Math.cos(n),i=r*Math.sin(n),a=Math.sin(o),Ts.point=e,Ct(t,i,a)}}function kt(){Ts.point=St}function Pt(){function e(e,t){e*=Gr;var i=Math.cos(t*=Gr),r=i*Math.cos(e),s=i*Math.sin(e),c=Math.sin(t),l=n*c-o*s,d=o*r-a*c,m=a*s-n*r,u=Math.sqrt(l*l+d*d+m*m),h=a*r+n*s+o*c,g=u&&-Q(h)/u,p=Math.atan2(u,h);ks+=g*l,Ps+=g*d,Ms+=g*m,_s+=p,Ss+=p*(a+(a=r)),Cs+=p*(n+(n=s)),xs+=p*(o+(o=c)),Ct(a,n,o)}var t,i,a,n,o;Ts.point=function(r,s){t=r,i=s,Ts.point=e,r*=Gr;var c=Math.cos(s*=Gr);a=c*Math.cos(r),n=c*Math.sin(r),o=Math.sin(s),Ct(a,n,o)},Ts.lineEnd=function(){e(t,i),Ts.lineEnd=kt,Ts.point=St}}function Mt(){return!0}function Tt(e,t,i,a,n){var o=[],r=[];if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,i=e[0],a=e[t];if(wt(i,a)){n.lineStart();for(var s=0;t>s;++s)n.point((i=e[s])[0],i[1]);return void n.lineEnd()}var c=new At(i,e,null,!0),l=new At(i,null,c,!1);c.o=l,o.push(c),r.push(l),c=new At(a,e,null,!1),l=new At(a,null,c,!0),c.o=l,o.push(c),r.push(l)}}),r.sort(t),Dt(o),Dt(r),o.length){for(var s=0,c=i,l=r.length;l>s;++s)r[s].e=c=!c;for(var d,m,u=o[0];;){for(var h=u,g=!0;h.v;)if((h=h.n)===u)return;d=h.z,n.lineStart();do{if(h.v=h.o.v=!0,h.e){if(g)for(var s=0,l=d.length;l>s;++s)n.point((m=d[s])[0],m[1]);else a(h.x,h.n.x,1,n);h=h.n}else{if(g){d=h.p.z;for(var s=d.length-1;s>=0;--s)n.point((m=d[s])[0],m[1])}else a(h.x,h.p.x,-1,n);h=h.p}h=h.o,d=h.z,g=!g}while(!h.v);n.lineEnd()}}}function Dt(e){if(t=e.length){for(var t,i,a=0,n=e[0];++a<t;)n.n=i=e[a],i.p=n,n=i;n.n=i=e[0],i.p=n}}function At(e,t,i,a){this.x=e,this.z=t,this.o=i,this.e=a,this.v=!1,this.n=this.p=null}function $t(e,t,i,a){return function(n,o){function r(t,i){var a=n(t,i);e(t=a[0],i=a[1])&&o.point(t,i)}function s(e,t){var i=n(e,t);y.point(i[0],i[1])}function c(){_.point=s,y.lineStart()}function l(){_.point=r,y.lineEnd()}function d(e,t){p.push([e,t]);var i=n(e,t);b.point(i[0],i[1])}function m(){b.lineStart(),p=[]}function u(){d(p[0][0],p[0][1]),b.lineEnd();var e,t=b.clean(),i=v.buffer(),a=i.length;if(p.pop(),g.push(p),p=null,a)if(1&t){e=i[0];var n,a=e.length-1,r=-1;if(a>0){for(w||(o.polygonStart(),w=!0),o.lineStart();++r<a;)o.point((n=e[r])[0],n[1]);o.lineEnd()}}else a>1&&2&t&&i.push(i.pop().concat(i.shift())),h.push(i.filter(Gt))}var h,g,p,y=t(o),f=n.invert(a[0],a[1]),_={point:r,lineStart:c,lineEnd:l,polygonStart:function(){_.point=d,_.lineStart=m,_.lineEnd=u,h=[],g=[]},polygonEnd:function(){_.point=r,_.lineStart=c,_.lineEnd=l,h=Yo.merge(h);var e=Lt(f,g);h.length?(w||(o.polygonStart(),w=!0),Tt(h,Nt,e,i,o)):e&&(w||(o.polygonStart(),w=!0),o.lineStart(),i(null,null,1,o),o.lineEnd()),w&&(o.polygonEnd(),w=!1),h=g=null},sphere:function(){o.polygonStart(),o.lineStart(),i(null,null,1,o),o.lineEnd(),o.polygonEnd()}},v=Ft(),b=t(v),w=!1;return _}}function Gt(e){return e.length>1}function Ft(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,i){e.push([t,i])},lineEnd:_,buffer:function(){var i=t;return t=[],e=null,i},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Nt(e,t){return((e=e.x)[0]<0?e[1]-Dr-Ar:Dr-e[1])-((t=t.x)[0]<0?t[1]-Dr-Ar:Dr-t[1])}function Rt(e){var t,i=NaN,a=NaN,n=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,r){var s=o>0?Mr:-Mr,c=lr(o-i);lr(c-Mr)<Ar?(e.point(i,a=(a+r)/2>0?Dr:-Dr),e.point(n,a),e.lineEnd(),e.lineStart(),e.point(s,a),e.point(o,a),t=0):n!==s&&c>=Mr&&(lr(i-n)<Ar&&(i-=n*Ar),lr(o-s)<Ar&&(o-=s*Ar),a=It(i,a,o,r),e.point(n,a),e.lineEnd(),e.lineStart(),e.point(s,a),t=0),e.point(i=o,a=r),n=s},lineEnd:function(){e.lineEnd(),i=a=NaN},clean:function(){return 2-t}}}function It(e,t,i,a){var n,o,r=Math.sin(e-i);return lr(r)>Ar?Math.atan((Math.sin(t)*(o=Math.cos(a))*Math.sin(i)-Math.sin(a)*(n=Math.cos(t))*Math.sin(e))/(n*o*r)):(t+a)/2}function Et(e,t,i,a){var n;if(null==e)n=i*Dr,a.point(-Mr,n),a.point(0,n),a.point(Mr,n),a.point(Mr,0),a.point(Mr,-n),a.point(0,-n),a.point(-Mr,-n),a.point(-Mr,0),a.point(-Mr,n);else if(lr(e[0]-t[0])>Ar){var o=e[0]<t[0]?Mr:-Mr;n=i*o/2,a.point(-o,n),a.point(0,n),a.point(o,n)}else a.point(t[0],t[1])}function Lt(e,t){var i=e[0],a=e[1],n=[Math.sin(i),-Math.cos(i),0],o=0,r=0;ps.reset();for(var s=0,c=t.length;c>s;++s){var l=t[s],d=l.length;if(d)for(var m=l[0],u=m[0],h=m[1]/2+Mr/4,g=Math.sin(h),p=Math.cos(h),y=1;;){y===d&&(y=0),e=l[y];var f=e[0],_=e[1]/2+Mr/4,v=Math.sin(_),b=Math.cos(_),w=f-u,S=w>=0?1:-1,C=S*w,x=C>Mr,k=g*v;if(ps.add(Math.atan2(k*S*Math.sin(C),p*b+k*Math.cos(C))),o+=x?w+S*Tr:w,x^u>=i^f>=i){var P=yt(gt(m),gt(e));vt(P);var M=yt(n,P);vt(M);var T=(x^w>=0?-1:1)*ee(M[2]);(a>T||a===T&&(P[0]||P[1]))&&(r+=x^w>=0?1:-1)}if(!y++)break;u=f,g=v,p=b,m=e}}return(-Ar>o||Ar>o&&0>ps)^1&r}function Bt(e){function t(e,t){return Math.cos(e)*Math.cos(t)>o}function i(e){var i,o,c,l,d;return{lineStart:function(){l=c=!1,d=1},point:function(m,u){var h,g=[m,u],p=t(m,u),y=r?p?0:n(m,u):p?n(m+(0>m?Mr:-Mr),u):0;if(!i&&(l=c=p)&&e.lineStart(),p!==c&&(h=a(i,g),(wt(i,h)||wt(g,h))&&(g[0]+=Ar,g[1]+=Ar,p=t(g[0],g[1]))),p!==c)d=0,p?(e.lineStart(),h=a(g,i),e.point(h[0],h[1])):(h=a(i,g),e.point(h[0],h[1]),e.lineEnd()),i=h;else if(s&&i&&r^p){var f;y&o||!(f=a(g,i,!0))||(d=0,r?(e.lineStart(),e.point(f[0][0],f[0][1]),e.point(f[1][0],f[1][1]),e.lineEnd()):(e.point(f[1][0],f[1][1]),e.lineEnd(),e.lineStart(),e.point(f[0][0],f[0][1])))}!p||i&&wt(i,g)||e.point(g[0],g[1]),i=g,c=p,o=y},lineEnd:function(){c&&e.lineEnd(),i=null},clean:function(){return d|(l&&c)<<1}}}function a(e,t,i){var a=gt(e),n=gt(t),r=[1,0,0],s=yt(a,n),c=pt(s,s),l=s[0],d=c-l*l;if(!d)return!i&&e;var m=o*c/d,u=-o*l/d,h=yt(r,s),g=_t(r,m),p=_t(s,u);ft(g,p);var y=h,f=pt(g,y),_=pt(y,y),v=f*f-_*(pt(g,g)-1);if(!(0>v)){var b=Math.sqrt(v),w=_t(y,(-f-b)/_);if(ft(w,g),w=bt(w),!i)return w;var S,C=e[0],x=t[0],k=e[1],P=t[1];C>x&&(S=C,C=x,x=S);var M=x-C,T=lr(M-Mr)<Ar,D=T||Ar>M;if(!T&&k>P&&(S=k,k=P,P=S),D?T?k+P>0^w[1]<(lr(w[0]-C)<Ar?k:P):k<=w[1]&&w[1]<=P:M>Mr^(C<=w[0]&&w[0]<=x)){var A=_t(y,(-f+b)/_);return ft(A,g),[w,bt(A)]}}}function n(t,i){var a=r?e:Mr-e,n=0;return-a>t?n|=1:t>a&&(n|=2),-a>i?n|=4:i>a&&(n|=8),n}var o=Math.cos(e),r=o>0,s=lr(o)>Ar,c=hi(e,6*Gr);return $t(t,i,c,r?[0,-e]:[-Mr,e-Mr])}function Ut(e,t,i,a){return function(n){var o,r=n.a,s=n.b,c=r.x,l=r.y,d=s.x,m=s.y,u=0,h=1,g=d-c,p=m-l;if(o=e-c,g||!(o>0)){if(o/=g,0>g){if(u>o)return;h>o&&(h=o)}else if(g>0){if(o>h)return;o>u&&(u=o)}if(o=i-c,g||!(0>o)){if(o/=g,0>g){if(o>h)return;o>u&&(u=o)}else if(g>0){if(u>o)return;h>o&&(h=o)}if(o=t-l,p||!(o>0)){if(o/=p,0>p){if(u>o)return;h>o&&(h=o)}else if(p>0){if(o>h)return;o>u&&(u=o)}if(o=a-l,p||!(0>o)){if(o/=p,0>p){if(o>h)return;o>u&&(u=o)}else if(p>0){if(u>o)return;h>o&&(h=o)}return u>0&&(n.a={x:c+u*g,y:l+u*p}),1>h&&(n.b={x:c+h*g,y:l+h*p}),n}}}}}}function Ot(e,t,i,a){function n(a,n){return lr(a[0]-e)<Ar?n>0?0:3:lr(a[0]-i)<Ar?n>0?2:1:lr(a[1]-t)<Ar?n>0?1:0:n>0?3:2}function o(e,t){return r(e.x,t.x)}function r(e,t){var i=n(e,1),a=n(t,1);return i!==a?i-a:0===i?t[1]-e[1]:1===i?e[0]-t[0]:2===i?e[1]-t[1]:t[0]-e[0]}return function(s){function c(e){for(var t=0,i=y.length,a=e[1],n=0;i>n;++n)for(var o,r=1,s=y[n],c=s.length,l=s[0];c>r;++r)o=s[r],l[1]<=a?o[1]>a&&Z(l,o,e)>0&&++t:o[1]<=a&&Z(l,o,e)<0&&--t,l=o;return 0!==t}function l(o,s,c,l){var d=0,m=0;if(null==o||(d=n(o,c))!==(m=n(s,c))||r(o,s)<0^c>0){do l.point(0===d||3===d?e:i,d>1?a:t);while((d=(d+c+4)%4)!==m)}else l.point(s[0],s[1])}function d(n,o){return n>=e&&i>=n&&o>=t&&a>=o}function m(e,t){d(e,t)&&s.point(e,t)}function u(){D.point=g,y&&y.push(f=[]),x=!0,C=!1,w=S=NaN}function h(){p&&(g(_,v),b&&C&&M.rejoin(),p.push(M.buffer())),D.point=m,C&&s.lineEnd()}function g(e,t){e=Math.max(-As,Math.min(As,e)),t=Math.max(-As,Math.min(As,t));var i=d(e,t);if(y&&f.push([e,t]),x)_=e,v=t,b=i,x=!1,i&&(s.lineStart(),s.point(e,t));else if(i&&C)s.point(e,t);else{
var a={a:{x:w,y:S},b:{x:e,y:t}};T(a)?(C||(s.lineStart(),s.point(a.a.x,a.a.y)),s.point(a.b.x,a.b.y),i||s.lineEnd(),k=!1):i&&(s.lineStart(),s.point(e,t),k=!1)}w=e,S=t,C=i}var p,y,f,_,v,b,w,S,C,x,k,P=s,M=Ft(),T=Ut(e,t,i,a),D={point:m,lineStart:u,lineEnd:h,polygonStart:function(){s=M,p=[],y=[],k=!0},polygonEnd:function(){s=P,p=Yo.merge(p);var t=c([e,a]),i=k&&t,n=p.length;(i||n)&&(s.polygonStart(),i&&(s.lineStart(),l(null,null,1,s),s.lineEnd()),n&&Tt(p,o,t,l,s),s.polygonEnd()),p=y=f=null}};return D}}function Ht(e,t){function i(i,a){return i=e(i,a),t(i[0],i[1])}return e.invert&&t.invert&&(i.invert=function(i,a){return i=t.invert(i,a),i&&e.invert(i[0],i[1])}),i}function Vt(e){var t=0,i=Mr/3,a=oi(e),n=a(t,i);return n.parallels=function(e){return arguments.length?a(t=e[0]*Mr/180,i=e[1]*Mr/180):[t/Mr*180,i/Mr*180]},n}function Wt(e,t){function i(e,t){var i=Math.sqrt(o-2*n*Math.sin(t))/n;return[i*Math.sin(e*=n),r-i*Math.cos(e)]}var a=Math.sin(e),n=(a+Math.sin(t))/2,o=1+a*(2*n-a),r=Math.sqrt(o)/n;return i.invert=function(e,t){var i=r-t;return[Math.atan2(e,i)/n,ee((o-(e*e+i*i)*n*n)/(2*n))]},i}function zt(){function e(e,t){Gs+=n*e-a*t,a=e,n=t}var t,i,a,n;Es.point=function(o,r){Es.point=e,t=a=o,i=n=r},Es.lineEnd=function(){e(t,i)}}function Kt(e,t){Fs>e&&(Fs=e),e>Rs&&(Rs=e),Ns>t&&(Ns=t),t>Is&&(Is=t)}function jt(){function e(e,t){r.push("M",e,",",t,o)}function t(e,t){r.push("M",e,",",t),s.point=i}function i(e,t){r.push("L",e,",",t)}function a(){s.point=e}function n(){r.push("Z")}var o=qt(4.5),r=[],s={point:e,lineStart:function(){s.point=t},lineEnd:a,polygonStart:function(){s.lineEnd=n},polygonEnd:function(){s.lineEnd=a,s.point=e},pointRadius:function(e){return o=qt(e),s},result:function(){if(r.length){var e=r.join("");return r=[],e}}};return s}function qt(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function Yt(e,t){vs+=e,bs+=t,++ws}function Xt(){function e(e,a){var n=e-t,o=a-i,r=Math.sqrt(n*n+o*o);Ss+=r*(t+e)/2,Cs+=r*(i+a)/2,xs+=r,Yt(t=e,i=a)}var t,i;Bs.point=function(a,n){Bs.point=e,Yt(t=a,i=n)}}function Jt(){Bs.point=Yt}function Zt(){function e(e,t){var i=e-a,o=t-n,r=Math.sqrt(i*i+o*o);Ss+=r*(a+e)/2,Cs+=r*(n+t)/2,xs+=r,r=n*e-a*t,ks+=r*(a+e),Ps+=r*(n+t),Ms+=3*r,Yt(a=e,n=t)}var t,i,a,n;Bs.point=function(o,r){Bs.point=e,Yt(t=a=o,i=n=r)},Bs.lineEnd=function(){e(t,i)}}function Qt(e){function t(t,i){e.moveTo(t,i),e.arc(t,i,r,0,Tr)}function i(t,i){e.moveTo(t,i),s.point=a}function a(t,i){e.lineTo(t,i)}function n(){s.point=t}function o(){e.closePath()}var r=4.5,s={point:t,lineStart:function(){s.point=i},lineEnd:n,polygonStart:function(){s.lineEnd=o},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(e){return r=e,s},result:_};return s}function ei(e){function t(e){return(s?a:i)(e)}function i(t){return ai(t,function(i,a){i=e(i,a),t.point(i[0],i[1])})}function a(t){function i(i,a){i=e(i,a),t.point(i[0],i[1])}function a(){v=NaN,x.point=o,t.lineStart()}function o(i,a){var o=gt([i,a]),r=e(i,a);n(v,b,_,w,S,C,v=r[0],b=r[1],_=i,w=o[0],S=o[1],C=o[2],s,t),t.point(v,b)}function r(){x.point=i,t.lineEnd()}function c(){a(),x.point=l,x.lineEnd=d}function l(e,t){o(m=e,u=t),h=v,g=b,p=w,y=S,f=C,x.point=o}function d(){n(v,b,_,w,S,C,h,g,m,p,y,f,s,t),x.lineEnd=r,r()}var m,u,h,g,p,y,f,_,v,b,w,S,C,x={point:i,lineStart:a,lineEnd:r,polygonStart:function(){t.polygonStart(),x.lineStart=c},polygonEnd:function(){t.polygonEnd(),x.lineStart=a}};return x}function n(t,i,a,s,c,l,d,m,u,h,g,p,y,f){var _=d-t,v=m-i,b=_*_+v*v;if(b>4*o&&y--){var w=s+h,S=c+g,C=l+p,x=Math.sqrt(w*w+S*S+C*C),k=Math.asin(C/=x),P=lr(lr(C)-1)<Ar||lr(a-u)<Ar?(a+u)/2:Math.atan2(S,w),M=e(P,k),T=M[0],D=M[1],A=T-t,$=D-i,G=v*A-_*$;(G*G/b>o||lr((_*A+v*$)/b-.5)>.3||r>s*h+c*g+l*p)&&(n(t,i,a,s,c,l,T,D,P,w/=x,S/=x,C,y,f),f.point(T,D),n(T,D,P,w,S,C,d,m,u,h,g,p,y,f))}}var o=.5,r=Math.cos(30*Gr),s=16;return t.precision=function(e){return arguments.length?(s=(o=e*e)>0&&16,t):Math.sqrt(o)},t}function ti(e){var t=ei(function(t,i){return e([t*Fr,i*Fr])});return function(e){return ri(t(e))}}function ii(e){this.stream=e}function ai(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function ni(e){return oi(function(){return e})()}function oi(e){function t(e){return e=s(e[0]*Gr,e[1]*Gr),[e[0]*u+c,l-e[1]*u]}function i(e){return e=s.invert((e[0]-c)/u,(l-e[1])/u),e&&[e[0]*Fr,e[1]*Fr]}function a(){s=Ht(r=li(f,_,v),o);var e=o(p,y);return c=h-e[0]*u,l=g+e[1]*u,n()}function n(){return d&&(d.valid=!1,d=null),t}var o,r,s,c,l,d,m=ei(function(e,t){return e=o(e,t),[e[0]*u+c,l-e[1]*u]}),u=150,h=480,g=250,p=0,y=0,f=0,_=0,v=0,b=Ds,w=Pe,S=null,C=null;return t.stream=function(e){return d&&(d.valid=!1),d=ri(b(r,m(w(e)))),d.valid=!0,d},t.clipAngle=function(e){return arguments.length?(b=null==e?(S=e,Ds):Bt((S=+e)*Gr),n()):S},t.clipExtent=function(e){return arguments.length?(C=e,w=e?Ot(e[0][0],e[0][1],e[1][0],e[1][1]):Pe,n()):C},t.scale=function(e){return arguments.length?(u=+e,a()):u},t.translate=function(e){return arguments.length?(h=+e[0],g=+e[1],a()):[h,g]},t.center=function(e){return arguments.length?(p=e[0]%360*Gr,y=e[1]%360*Gr,a()):[p*Fr,y*Fr]},t.rotate=function(e){return arguments.length?(f=e[0]%360*Gr,_=e[1]%360*Gr,v=e.length>2?e[2]%360*Gr:0,a()):[f*Fr,_*Fr,v*Fr]},Yo.rebind(t,m,"precision"),function(){return o=e.apply(this,arguments),t.invert=o.invert&&i,a()}}function ri(e){return ai(e,function(t,i){e.point(t*Gr,i*Gr)})}function si(e,t){return[e,t]}function ci(e,t){return[e>Mr?e-Tr:-Mr>e?e+Tr:e,t]}function li(e,t,i){return e?t||i?Ht(mi(e),ui(t,i)):mi(e):t||i?ui(t,i):ci}function di(e){return function(t,i){return t+=e,[t>Mr?t-Tr:-Mr>t?t+Tr:t,i]}}function mi(e){var t=di(e);return t.invert=di(-e),t}function ui(e,t){function i(e,t){var i=Math.cos(t),s=Math.cos(e)*i,c=Math.sin(e)*i,l=Math.sin(t),d=l*a+s*n;return[Math.atan2(c*o-d*r,s*a-l*n),ee(d*o+c*r)]}var a=Math.cos(e),n=Math.sin(e),o=Math.cos(t),r=Math.sin(t);return i.invert=function(e,t){var i=Math.cos(t),s=Math.cos(e)*i,c=Math.sin(e)*i,l=Math.sin(t),d=l*o-c*r;return[Math.atan2(c*o+l*r,s*a+d*n),ee(d*a-s*n)]},i}function hi(e,t){var i=Math.cos(e),a=Math.sin(e);return function(n,o,r,s){var c=r*t;null!=n?(n=gi(i,n),o=gi(i,o),(r>0?o>n:n>o)&&(n+=r*Tr)):(n=e+r*Tr,o=e-.5*c);for(var l,d=n;r>0?d>o:o>d;d-=c)s.point((l=bt([i,-a*Math.cos(d),-a*Math.sin(d)]))[0],l[1])}}function gi(e,t){var i=gt(t);i[0]-=e,vt(i);var a=Q(-i[1]);return((-i[2]<0?-a:a)+2*Math.PI-Ar)%(2*Math.PI)}function pi(e,t,i){var a=Yo.range(e,t-Ar,i).concat(t);return function(e){return a.map(function(t){return[e,t]})}}function yi(e,t,i){var a=Yo.range(e,t-Ar,i).concat(t);return function(e){return a.map(function(t){return[t,e]})}}function fi(e){return e.source}function _i(e){return e.target}function vi(e,t,i,a){var n=Math.cos(t),o=Math.sin(t),r=Math.cos(a),s=Math.sin(a),c=n*Math.cos(e),l=n*Math.sin(e),d=r*Math.cos(i),m=r*Math.sin(i),u=2*Math.asin(Math.sqrt(ne(a-t)+n*r*ne(i-e))),h=1/Math.sin(u),g=u?function(e){var t=Math.sin(e*=u)*h,i=Math.sin(u-e)*h,a=i*c+t*d,n=i*l+t*m,r=i*o+t*s;return[Math.atan2(n,a)*Fr,Math.atan2(r,Math.sqrt(a*a+n*n))*Fr]}:function(){return[e*Fr,t*Fr]};return g.distance=u,g}function bi(){function e(e,n){var o=Math.sin(n*=Gr),r=Math.cos(n),s=lr((e*=Gr)-t),c=Math.cos(s);Us+=Math.atan2(Math.sqrt((s=r*Math.sin(s))*s+(s=a*o-i*r*c)*s),i*o+a*r*c),t=e,i=o,a=r}var t,i,a;Os.point=function(n,o){t=n*Gr,i=Math.sin(o*=Gr),a=Math.cos(o),Os.point=e},Os.lineEnd=function(){Os.point=Os.lineEnd=_}}function wi(e,t){function i(t,i){var a=Math.cos(t),n=Math.cos(i),o=e(a*n);return[o*n*Math.sin(t),o*Math.sin(i)]}return i.invert=function(e,i){var a=Math.sqrt(e*e+i*i),n=t(a),o=Math.sin(n),r=Math.cos(n);return[Math.atan2(e*o,a*r),Math.asin(a&&i*o/a)]},i}function Si(e,t){function i(e,t){r>0?-Dr+Ar>t&&(t=-Dr+Ar):t>Dr-Ar&&(t=Dr-Ar);var i=r/Math.pow(n(t),o);return[i*Math.sin(o*e),r-i*Math.cos(o*e)]}var a=Math.cos(e),n=function(e){return Math.tan(Mr/4+e/2)},o=e===t?Math.sin(e):Math.log(a/Math.cos(t))/Math.log(n(t)/n(e)),r=a*Math.pow(n(e),o)/o;return o?(i.invert=function(e,t){var i=r-t,a=J(o)*Math.sqrt(e*e+i*i);return[Math.atan2(e,i)/o,2*Math.atan(Math.pow(r/a,1/o))-Dr]},i):xi}function Ci(e,t){function i(e,t){var i=o-t;return[i*Math.sin(n*e),o-i*Math.cos(n*e)]}var a=Math.cos(e),n=e===t?Math.sin(e):(a-Math.cos(t))/(t-e),o=a/n+e;return lr(n)<Ar?si:(i.invert=function(e,t){var i=o-t;return[Math.atan2(e,i)/n,o-J(n)*Math.sqrt(e*e+i*i)]},i)}function xi(e,t){return[e,Math.log(Math.tan(Mr/4+t/2))]}function ki(e){var t,i=ni(e),a=i.scale,n=i.translate,o=i.clipExtent;return i.scale=function(){var e=a.apply(i,arguments);return e===i?t?i.clipExtent(null):i:e},i.translate=function(){var e=n.apply(i,arguments);return e===i?t?i.clipExtent(null):i:e},i.clipExtent=function(e){var r=o.apply(i,arguments);if(r===i){if(t=null==e){var s=Mr*a(),c=n();o([[c[0]-s,c[1]-s],[c[0]+s,c[1]+s]])}}else t&&(r=null);return r},i.clipExtent(null)}function Pi(e,t){return[Math.log(Math.tan(Mr/4+t/2)),-e]}function Mi(e){return e[0]}function Ti(e){return e[1]}function Di(e){for(var t=e.length,i=[0,1],a=2,n=2;t>n;n++){for(;a>1&&Z(e[i[a-2]],e[i[a-1]],e[n])<=0;)--a;i[a++]=n}return i.slice(0,a)}function Ai(e,t){return e[0]-t[0]||e[1]-t[1]}function $i(e,t,i){return(i[0]-t[0])*(e[1]-t[1])<(i[1]-t[1])*(e[0]-t[0])}function Gi(e,t,i,a){var n=e[0],o=i[0],r=t[0]-n,s=a[0]-o,c=e[1],l=i[1],d=t[1]-c,m=a[1]-l,u=(s*(c-l)-m*(n-o))/(m*r-s*d);return[n+u*r,c+u*d]}function Fi(e){var t=e[0],i=e[e.length-1];return!(t[0]-i[0]||t[1]-i[1])}function Ni(){ta(this),this.edge=this.site=this.circle=null}function Ri(e){var t=Qs.pop()||new Ni;return t.site=e,t}function Ii(e){Ki(e),Xs.remove(e),Qs.push(e),ta(e)}function Ei(e){var t=e.circle,i=t.x,a=t.cy,n={x:i,y:a},o=e.P,r=e.N,s=[e];Ii(e);for(var c=o;c.circle&&lr(i-c.circle.x)<Ar&&lr(a-c.circle.cy)<Ar;)o=c.P,s.unshift(c),Ii(c),c=o;s.unshift(c),Ki(c);for(var l=r;l.circle&&lr(i-l.circle.x)<Ar&&lr(a-l.circle.cy)<Ar;)r=l.N,s.push(l),Ii(l),l=r;s.push(l),Ki(l);var d,m=s.length;for(d=1;m>d;++d)l=s[d],c=s[d-1],Zi(l.edge,c.site,l.site,n);c=s[0],l=s[m-1],l.edge=Xi(c.site,l.site,null,n),zi(c),zi(l)}function Li(e){for(var t,i,a,n,o=e.x,r=e.y,s=Xs._;s;)if(a=Bi(s,r)-o,a>Ar)s=s.L;else{if(n=o-Ui(s,r),!(n>Ar)){a>-Ar?(t=s.P,i=s):n>-Ar?(t=s,i=s.N):t=i=s;break}if(!s.R){t=s;break}s=s.R}var c=Ri(e);if(Xs.insert(t,c),t||i){if(t===i)return Ki(t),i=Ri(t.site),Xs.insert(c,i),c.edge=i.edge=Xi(t.site,c.site),zi(t),void zi(i);if(!i)return void(c.edge=Xi(t.site,c.site));Ki(t),Ki(i);var l=t.site,d=l.x,m=l.y,u=e.x-d,h=e.y-m,g=i.site,p=g.x-d,y=g.y-m,f=2*(u*y-h*p),_=u*u+h*h,v=p*p+y*y,b={x:(y*_-h*v)/f+d,y:(u*v-p*_)/f+m};Zi(i.edge,l,g,b),c.edge=Xi(l,e,null,b),i.edge=Xi(e,g,null,b),zi(t),zi(i)}}function Bi(e,t){var i=e.site,a=i.x,n=i.y,o=n-t;if(!o)return a;var r=e.P;if(!r)return-(1/0);i=r.site;var s=i.x,c=i.y,l=c-t;if(!l)return s;var d=s-a,m=1/o-1/l,u=d/l;return m?(-u+Math.sqrt(u*u-2*m*(d*d/(-2*l)-c+l/2+n-o/2)))/m+a:(a+s)/2}function Ui(e,t){var i=e.N;if(i)return Bi(i,t);var a=e.site;return a.y===t?a.x:1/0}function Oi(e){this.site=e,this.edges=[]}function Hi(e){for(var t,i,a,n,o,r,s,c,l,d,m=e[0][0],u=e[1][0],h=e[0][1],g=e[1][1],p=Ys,y=p.length;y--;)if(o=p[y],o&&o.prepare())for(s=o.edges,c=s.length,r=0;c>r;)d=s[r].end(),a=d.x,n=d.y,l=s[++r%c].start(),t=l.x,i=l.y,(lr(a-t)>Ar||lr(n-i)>Ar)&&(s.splice(r,0,new Qi(Ji(o.site,d,lr(a-m)<Ar&&g-n>Ar?{x:m,y:lr(t-m)<Ar?i:g}:lr(n-g)<Ar&&u-a>Ar?{x:lr(i-g)<Ar?t:u,y:g}:lr(a-u)<Ar&&n-h>Ar?{x:u,y:lr(t-u)<Ar?i:h}:lr(n-h)<Ar&&a-m>Ar?{x:lr(i-h)<Ar?t:m,y:h}:null),o.site,null)),++c)}function Vi(e,t){return t.angle-e.angle}function Wi(){ta(this),this.x=this.y=this.arc=this.site=this.cy=null}function zi(e){var t=e.P,i=e.N;if(t&&i){var a=t.site,n=e.site,o=i.site;if(a!==o){var r=n.x,s=n.y,c=a.x-r,l=a.y-s,d=o.x-r,m=o.y-s,u=2*(c*m-l*d);if(!(u>=-$r)){var h=c*c+l*l,g=d*d+m*m,p=(m*h-l*g)/u,y=(c*g-d*h)/u,m=y+s,f=ec.pop()||new Wi;f.arc=e,f.site=n,f.x=p+r,f.y=m+Math.sqrt(p*p+y*y),f.cy=m,e.circle=f;for(var _=null,v=Zs._;v;)if(f.y<v.y||f.y===v.y&&f.x<=v.x){if(!v.L){_=v.P;break}v=v.L}else{if(!v.R){_=v;break}v=v.R}Zs.insert(_,f),_||(Js=f)}}}}function Ki(e){var t=e.circle;t&&(t.P||(Js=t.N),Zs.remove(t),ec.push(t),ta(t),e.circle=null)}function ji(e){for(var t,i=qs,a=Ut(e[0][0],e[0][1],e[1][0],e[1][1]),n=i.length;n--;)t=i[n],(!qi(t,e)||!a(t)||lr(t.a.x-t.b.x)<Ar&&lr(t.a.y-t.b.y)<Ar)&&(t.a=t.b=null,i.splice(n,1))}function qi(e,t){var i=e.b;if(i)return!0;var a,n,o=e.a,r=t[0][0],s=t[1][0],c=t[0][1],l=t[1][1],d=e.l,m=e.r,u=d.x,h=d.y,g=m.x,p=m.y,y=(u+g)/2,f=(h+p)/2;if(p===h){if(r>y||y>=s)return;if(u>g){if(o){if(o.y>=l)return}else o={x:y,y:c};i={x:y,y:l}}else{if(o){if(o.y<c)return}else o={x:y,y:l};i={x:y,y:c}}}else if(a=(u-g)/(p-h),n=f-a*y,-1>a||a>1)if(u>g){if(o){if(o.y>=l)return}else o={x:(c-n)/a,y:c};i={x:(l-n)/a,y:l}}else{if(o){if(o.y<c)return}else o={x:(l-n)/a,y:l};i={x:(c-n)/a,y:c}}else if(p>h){if(o){if(o.x>=s)return}else o={x:r,y:a*r+n};i={x:s,y:a*s+n}}else{if(o){if(o.x<r)return}else o={x:s,y:a*s+n};i={x:r,y:a*r+n}}return e.a=o,e.b=i,!0}function Yi(e,t){this.l=e,this.r=t,this.a=this.b=null}function Xi(e,t,i,a){var n=new Yi(e,t);return qs.push(n),i&&Zi(n,e,t,i),a&&Zi(n,t,e,a),Ys[e.i].edges.push(new Qi(n,e,t)),Ys[t.i].edges.push(new Qi(n,t,e)),n}function Ji(e,t,i){var a=new Yi(e,null);return a.a=t,a.b=i,qs.push(a),a}function Zi(e,t,i,a){e.a||e.b?e.l===i?e.b=a:e.a=a:(e.a=a,e.l=t,e.r=i)}function Qi(e,t,i){var a=e.a,n=e.b;this.edge=e,this.site=t,this.angle=i?Math.atan2(i.y-t.y,i.x-t.x):e.l===t?Math.atan2(n.x-a.x,a.y-n.y):Math.atan2(a.x-n.x,n.y-a.y)}function ea(){this._=null}function ta(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function ia(e,t){var i=t,a=t.R,n=i.U;n?n.L===i?n.L=a:n.R=a:e._=a,a.U=n,i.U=a,i.R=a.L,i.R&&(i.R.U=i),a.L=i}function aa(e,t){var i=t,a=t.L,n=i.U;n?n.L===i?n.L=a:n.R=a:e._=a,a.U=n,i.U=a,i.L=a.R,i.L&&(i.L.U=i),a.R=i}function na(e){for(;e.L;)e=e.L;return e}function oa(e,t){var i,a,n,o=e.sort(ra).pop();for(qs=[],Ys=new Array(e.length),Xs=new ea,Zs=new ea;;)if(n=Js,o&&(!n||o.y<n.y||o.y===n.y&&o.x<n.x))(o.x!==i||o.y!==a)&&(Ys[o.i]=new Oi(o),Li(o),i=o.x,a=o.y),o=e.pop();else{if(!n)break;Ei(n.arc)}t&&(ji(t),Hi(t));var r={cells:Ys,edges:qs};return Xs=Zs=qs=Ys=null,r}function ra(e,t){return t.y-e.y||t.x-e.x}function sa(e,t,i){return(e.x-i.x)*(t.y-e.y)-(e.x-t.x)*(i.y-e.y)}function ca(e){return e.x}function la(e){return e.y}function da(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function ma(e,t,i,a,n,o){if(!e(t,i,a,n,o)){var r=.5*(i+n),s=.5*(a+o),c=t.nodes;c[0]&&ma(e,c[0],i,a,r,s),c[1]&&ma(e,c[1],r,a,n,s),c[2]&&ma(e,c[2],i,s,r,o),c[3]&&ma(e,c[3],r,s,n,o)}}function ua(e,t){e=Yo.rgb(e),t=Yo.rgb(t);var i=e.r,a=e.g,n=e.b,o=t.r-i,r=t.g-a,s=t.b-n;return function(e){return"#"+ve(Math.round(i+o*e))+ve(Math.round(a+r*e))+ve(Math.round(n+s*e))}}function ha(e,t){var i,a={},n={};for(i in e)i in t?a[i]=ya(e[i],t[i]):n[i]=e[i];for(i in t)i in e||(n[i]=t[i]);return function(e){for(i in a)n[i]=a[i](e);return n}}function ga(e,t){return e=+e,t=+t,function(i){return e*(1-i)+t*i}}function pa(e,t){var i,a,n,o=ic.lastIndex=ac.lastIndex=0,r=-1,s=[],c=[];for(e+="",t+="";(i=ic.exec(e))&&(a=ac.exec(t));)(n=a.index)>o&&(n=t.slice(o,n),s[r]?s[r]+=n:s[++r]=n),(i=i[0])===(a=a[0])?s[r]?s[r]+=a:s[++r]=a:(s[++r]=null,c.push({i:r,x:ga(i,a)})),o=ac.lastIndex;return o<t.length&&(n=t.slice(o),s[r]?s[r]+=n:s[++r]=n),s.length<2?c[0]?(t=c[0].x,function(e){return t(e)+""}):function(){return t}:(t=c.length,function(e){for(var i,a=0;t>a;++a)s[(i=c[a]).i]=i.x(e);return s.join("")})}function ya(e,t){for(var i,a=Yo.interpolators.length;--a>=0&&!(i=Yo.interpolators[a](e,t)););return i}function fa(e,t){var i,a=[],n=[],o=e.length,r=t.length,s=Math.min(e.length,t.length);for(i=0;s>i;++i)a.push(ya(e[i],t[i]));for(;o>i;++i)n[i]=e[i];for(;r>i;++i)n[i]=t[i];return function(e){for(i=0;s>i;++i)n[i]=a[i](e);return n}}function _a(e){return function(t){return 0>=t?0:t>=1?1:e(t)}}function va(e){return function(t){return 1-e(1-t)}}function ba(e){return function(t){return.5*(.5>t?e(2*t):2-e(2-2*t))}}function wa(e){return e*e}function Sa(e){return e*e*e}function Ca(e){if(0>=e)return 0;if(e>=1)return 1;var t=e*e,i=t*e;return 4*(.5>e?i:3*(e-t)+i-.75)}function xa(e){return function(t){return Math.pow(t,e)}}function ka(e){return 1-Math.cos(e*Dr)}function Pa(e){return Math.pow(2,10*(e-1))}function Ma(e){return 1-Math.sqrt(1-e*e)}function Ta(e,t){var i;return arguments.length<2&&(t=.45),arguments.length?i=t/Tr*Math.asin(1/e):(e=1,i=t/4),function(a){return 1+e*Math.pow(2,-10*a)*Math.sin((a-i)*Tr/t)}}function Da(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}}function Aa(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function $a(e,t){e=Yo.hcl(e),t=Yo.hcl(t);var i=e.h,a=e.c,n=e.l,o=t.h-i,r=t.c-a,s=t.l-n;return isNaN(r)&&(r=0,a=isNaN(a)?t.c:a),isNaN(o)?(o=0,i=isNaN(i)?t.h:i):o>180?o-=360:-180>o&&(o+=360),function(e){return le(i+o*e,a+r*e,n+s*e)+""}}function Ga(e,t){e=Yo.hsl(e),t=Yo.hsl(t);var i=e.h,a=e.s,n=e.l,o=t.h-i,r=t.s-a,s=t.l-n;return isNaN(r)&&(r=0,a=isNaN(a)?t.s:a),isNaN(o)?(o=0,i=isNaN(i)?t.h:i):o>180?o-=360:-180>o&&(o+=360),function(e){return se(i+o*e,a+r*e,n+s*e)+""}}function Fa(e,t){e=Yo.lab(e),t=Yo.lab(t);var i=e.l,a=e.a,n=e.b,o=t.l-i,r=t.a-a,s=t.b-n;return function(e){return me(i+o*e,a+r*e,n+s*e)+""}}function Na(e,t){return t-=e,function(i){return Math.round(e+t*i)}}function Ra(e){var t=[e.a,e.b],i=[e.c,e.d],a=Ea(t),n=Ia(t,i),o=Ea(La(i,t,-n))||0;t[0]*i[1]<i[0]*t[1]&&(t[0]*=-1,t[1]*=-1,a*=-1,n*=-1),this.rotate=(a?Math.atan2(t[1],t[0]):Math.atan2(-i[0],i[1]))*Fr,this.translate=[e.e,e.f],this.scale=[a,o],this.skew=o?Math.atan2(n,o)*Fr:0}function Ia(e,t){return e[0]*t[0]+e[1]*t[1]}function Ea(e){var t=Math.sqrt(Ia(e,e));return t&&(e[0]/=t,e[1]/=t),t}function La(e,t,i){return e[0]+=i*t[0],e[1]+=i*t[1],e}function Ba(e,t){var i,a=[],n=[],o=Yo.transform(e),r=Yo.transform(t),s=o.translate,c=r.translate,l=o.rotate,d=r.rotate,m=o.skew,u=r.skew,h=o.scale,g=r.scale;return s[0]!=c[0]||s[1]!=c[1]?(a.push("translate(",null,",",null,")"),n.push({i:1,x:ga(s[0],c[0])},{i:3,x:ga(s[1],c[1])})):c[0]||c[1]?a.push("translate("+c+")"):a.push(""),l!=d?(l-d>180?d+=360:d-l>180&&(l+=360),n.push({i:a.push(a.pop()+"rotate(",null,")")-2,x:ga(l,d)})):d&&a.push(a.pop()+"rotate("+d+")"),m!=u?n.push({i:a.push(a.pop()+"skewX(",null,")")-2,x:ga(m,u)}):u&&a.push(a.pop()+"skewX("+u+")"),h[0]!=g[0]||h[1]!=g[1]?(i=a.push(a.pop()+"scale(",null,",",null,")"),n.push({i:i-4,x:ga(h[0],g[0])},{i:i-2,x:ga(h[1],g[1])})):(1!=g[0]||1!=g[1])&&a.push(a.pop()+"scale("+g+")"),i=n.length,function(e){for(var t,o=-1;++o<i;)a[(t=n[o]).i]=t.x(e);return a.join("")}}function Ua(e,t){return t=(t-=e=+e)||1/t,function(i){return(i-e)/t}}function Oa(e,t){return t=(t-=e=+e)||1/t,function(i){return Math.max(0,Math.min(1,(i-e)/t))}}function Ha(e){for(var t=e.source,i=e.target,a=Wa(t,i),n=[t];t!==a;)t=t.parent,n.push(t);for(var o=n.length;i!==a;)n.splice(o,0,i),i=i.parent;return n}function Va(e){for(var t=[],i=e.parent;null!=i;)t.push(e),e=i,i=i.parent;return t.push(e),t}function Wa(e,t){if(e===t)return e;for(var i=Va(e),a=Va(t),n=i.pop(),o=a.pop(),r=null;n===o;)r=n,n=i.pop(),o=a.pop();return r}function za(e){e.fixed|=2}function Ka(e){e.fixed&=-7}function ja(e){e.fixed|=4,e.px=e.x,e.py=e.y}function qa(e){e.fixed&=-5}function Ya(e,t,i){var a=0,n=0;if(e.charge=0,!e.leaf)for(var o,r=e.nodes,s=r.length,c=-1;++c<s;)o=r[c],null!=o&&(Ya(o,t,i),e.charge+=o.charge,a+=o.charge*o.cx,n+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var l=t*i[e.point.index];e.charge+=e.pointCharge=l,a+=l*e.point.x,n+=l*e.point.y}e.cx=a/e.charge,e.cy=n/e.charge}function Xa(e,t){return Yo.rebind(e,t,"sort","children","value"),e.nodes=e,e.links=an,e}function Ja(e,t){for(var i=[e];null!=(e=i.pop());)if(t(e),(n=e.children)&&(a=n.length))for(var a,n;--a>=0;)i.push(n[a])}function Za(e,t){for(var i=[e],a=[];null!=(e=i.pop());)if(a.push(e),(o=e.children)&&(n=o.length))for(var n,o,r=-1;++r<n;)i.push(o[r]);for(;null!=(e=a.pop());)t(e)}function Qa(e){return e.children}function en(e){return e.value}function tn(e,t){return t.value-e.value}function an(e){return Yo.merge(e.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}function nn(e){return e.x}function on(e){return e.y}function rn(e,t,i){e.y0=t,e.y=i}function sn(e){return Yo.range(e.length)}function cn(e){for(var t=-1,i=e[0].length,a=[];++t<i;)a[t]=0;return a}function ln(e){for(var t,i=1,a=0,n=e[0][1],o=e.length;o>i;++i)(t=e[i][1])>n&&(a=i,n=t);return a}function dn(e){return e.reduce(mn,0)}function mn(e,t){return e+t[1]}function un(e,t){return hn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function hn(e,t){for(var i=-1,a=+e[0],n=(e[1]-a)/t,o=[];++i<=t;)o[i]=n*i+a;return o}function gn(e){return[Yo.min(e),Yo.max(e)]}function pn(e,t){return e.value-t.value}function yn(e,t){var i=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=i,i._pack_prev=t}function fn(e,t){e._pack_next=t,t._pack_prev=e}function _n(e,t){var i=t.x-e.x,a=t.y-e.y,n=e.r+t.r;return.999*n*n>i*i+a*a}function vn(e){function t(e){d=Math.min(e.x-e.r,d),m=Math.max(e.x+e.r,m),u=Math.min(e.y-e.r,u),h=Math.max(e.y+e.r,h)}if((i=e.children)&&(l=i.length)){var i,a,n,o,r,s,c,l,d=1/0,m=-(1/0),u=1/0,h=-(1/0);if(i.forEach(bn),a=i[0],a.x=-a.r,a.y=0,t(a),l>1&&(n=i[1],n.x=n.r,n.y=0,t(n),l>2))for(o=i[2],Cn(a,n,o),t(o),yn(a,o),a._pack_prev=o,yn(o,n),n=a._pack_next,r=3;l>r;r++){Cn(a,n,o=i[r]);var g=0,p=1,y=1;for(s=n._pack_next;s!==n;s=s._pack_next,p++)if(_n(s,o)){g=1;break}if(1==g)for(c=a._pack_prev;c!==s._pack_prev&&!_n(c,o);c=c._pack_prev,y++);g?(y>p||p==y&&n.r<a.r?fn(a,n=s):fn(a=c,n),r--):(yn(a,o),n=o,t(o))}var f=(d+m)/2,_=(u+h)/2,v=0;for(r=0;l>r;r++)o=i[r],o.x-=f,o.y-=_,v=Math.max(v,o.r+Math.sqrt(o.x*o.x+o.y*o.y));e.r=v,i.forEach(wn)}}function bn(e){e._pack_next=e._pack_prev=e}function wn(e){delete e._pack_next,delete e._pack_prev}function Sn(e,t,i,a){var n=e.children;if(e.x=t+=a*e.x,e.y=i+=a*e.y,e.r*=a,n)for(var o=-1,r=n.length;++o<r;)Sn(n[o],t,i,a)}function Cn(e,t,i){var a=e.r+i.r,n=t.x-e.x,o=t.y-e.y;if(a&&(n||o)){var r=t.r+i.r,s=n*n+o*o;r*=r,a*=a;var c=.5+(a-r)/(2*s),l=Math.sqrt(Math.max(0,2*r*(a+s)-(a-=s)*a-r*r))/(2*s);i.x=e.x+c*n+l*o,i.y=e.y+c*o-l*n}else i.x=e.x+a,i.y=e.y}function xn(e,t){return e.parent==t.parent?1:2}function kn(e){var t=e.children;return t.length?t[0]:e.t}function Pn(e){var t,i=e.children;return(t=i.length)?i[t-1]:e.t}function Mn(e,t,i){var a=i/(t.i-e.i);t.c-=a,t.s+=i,e.c+=a,t.z+=i,t.m+=i}function Tn(e){for(var t,i=0,a=0,n=e.children,o=n.length;--o>=0;)t=n[o],t.z+=i,t.m+=i,i+=t.s+(a+=t.c)}function Dn(e,t,i){return e.a.parent===t.parent?e.a:i}function An(e){return 1+Yo.max(e,function(e){return e.y})}function $n(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}function Gn(e){var t=e.children;return t&&t.length?Gn(t[0]):e}function Fn(e){var t,i=e.children;return i&&(t=i.length)?Fn(i[t-1]):e}function Nn(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function Rn(e,t){var i=e.x+t[3],a=e.y+t[0],n=e.dx-t[1]-t[3],o=e.dy-t[0]-t[2];return 0>n&&(i+=n/2,n=0),0>o&&(a+=o/2,o=0),{x:i,y:a,dx:n,dy:o}}function In(e){var t=e[0],i=e[e.length-1];return i>t?[t,i]:[i,t]}function En(e){return e.rangeExtent?e.rangeExtent():In(e.range())}function Ln(e,t,i,a){var n=i(e[0],e[1]),o=a(t[0],t[1]);return function(e){return o(n(e))}}function Bn(e,t){var i,a=0,n=e.length-1,o=e[a],r=e[n];return o>r&&(i=a,a=n,n=i,i=o,o=r,r=i),e[a]=t.floor(o),e[n]=t.ceil(r),e}function Un(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:gc}function On(e,t,i,a){var n=[],o=[],r=0,s=Math.min(e.length,t.length)-1;for(e[s]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++r<=s;)n.push(i(e[r-1],e[r])),o.push(a(t[r-1],t[r]));return function(t){var i=Yo.bisect(e,t,1,s)-1;return o[i](n[i](t))}}function Hn(e,t,i,a){function n(){var n=Math.min(e.length,t.length)>2?On:Ln,c=a?Oa:Ua;return r=n(e,t,c,i),s=n(t,e,c,ya),o}function o(e){return r(e)}var r,s;return o.invert=function(e){return s(e)},o.domain=function(t){return arguments.length?(e=t.map(Number),n()):e},o.range=function(e){return arguments.length?(t=e,n()):t},o.rangeRound=function(e){return o.range(e).interpolate(Na)},o.clamp=function(e){return arguments.length?(a=e,n()):a},o.interpolate=function(e){return arguments.length?(i=e,n()):i},o.ticks=function(t){return Kn(e,t)},o.tickFormat=function(t,i){return jn(e,t,i)},o.nice=function(t){return Wn(e,t),n()},o.copy=function(){return Hn(e,t,i,a)},n()}function Vn(e,t){return Yo.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Wn(e,t){return Bn(e,Un(zn(e,t)[2]))}function zn(e,t){null==t&&(t=10);var i=In(e),a=i[1]-i[0],n=Math.pow(10,Math.floor(Math.log(a/t)/Math.LN10)),o=t/a*n;return.15>=o?n*=10:.35>=o?n*=5:.75>=o&&(n*=2),i[0]=Math.ceil(i[0]/n)*n,i[1]=Math.floor(i[1]/n)*n+.5*n,i[2]=n,i}function Kn(e,t){return Yo.range.apply(Yo,zn(e,t))}function jn(e,t,i){var a=zn(e,t);if(i){var n=is.exec(i);if(n.shift(),"s"===n[8]){var o=Yo.formatPrefix(Math.max(lr(a[0]),lr(a[1])));return n[7]||(n[7]="."+qn(o.scale(a[2]))),n[8]="f",i=Yo.format(n.join("")),function(e){return i(o.scale(e))+o.symbol}}n[7]||(n[7]="."+Yn(n[8],a)),i=n.join("")}else i=",."+qn(a[2])+"f";return Yo.format(i)}function qn(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}function Yn(e,t){var i=qn(t[2]);return e in pc?Math.abs(i-qn(Math.max(lr(t[0]),lr(t[1]))))+ +("e"!==e):i-2*("%"===e)}function Xn(e,t,i,a){function n(e){return(i?Math.log(0>e?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function o(e){return i?Math.pow(t,e):-Math.pow(t,-e)}function r(t){return e(n(t))}return r.invert=function(t){return o(e.invert(t))},r.domain=function(t){return arguments.length?(i=t[0]>=0,e.domain((a=t.map(Number)).map(n)),r):a},r.base=function(i){return arguments.length?(t=+i,e.domain(a.map(n)),r):t},r.nice=function(){var t=Bn(a.map(n),i?Math:fc);return e.domain(t),a=t.map(o),r},r.ticks=function(){var e=In(a),r=[],s=e[0],c=e[1],l=Math.floor(n(s)),d=Math.ceil(n(c)),m=t%1?2:t;if(isFinite(d-l)){if(i){for(;d>l;l++)for(var u=1;m>u;u++)r.push(o(l)*u);r.push(o(l))}else for(r.push(o(l));l++<d;)for(var u=m-1;u>0;u--)r.push(o(l)*u);for(l=0;r[l]<s;l++);for(d=r.length;r[d-1]>c;d--);r=r.slice(l,d)}return r},r.tickFormat=function(e,t){if(!arguments.length)return yc;arguments.length<2?t=yc:"function"!=typeof t&&(t=Yo.format(t));var a,s=Math.max(.1,e/r.ticks().length),c=i?(a=1e-12,Math.ceil):(a=-1e-12,Math.floor);return function(e){return e/o(c(n(e)+a))<=s?t(e):""}},r.copy=function(){return Xn(e.copy(),t,i,a)},Vn(r,e)}function Jn(e,t,i){function a(t){return e(n(t))}var n=Zn(t),o=Zn(1/t);return a.invert=function(t){return o(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain((i=t.map(Number)).map(n)),a):i},a.ticks=function(e){return Kn(i,e)},a.tickFormat=function(e,t){return jn(i,e,t)},a.nice=function(e){return a.domain(Wn(i,e))},a.exponent=function(r){return arguments.length?(n=Zn(t=r),o=Zn(1/t),e.domain(i.map(n)),a):t},a.copy=function(){return Jn(e.copy(),t,i)},Vn(a,e)}function Zn(e){return function(t){return 0>t?-Math.pow(-t,e):Math.pow(t,e)}}function Qn(e,t){function i(i){return o[((n.get(i)||("range"===t.t?n.set(i,e.push(i)):NaN))-1)%o.length]}function a(t,i){return Yo.range(e.length).map(function(e){return t+i*e})}var n,o,r;return i.domain=function(a){if(!arguments.length)return e;e=[],n=new s;for(var o,r=-1,c=a.length;++r<c;)n.has(o=a[r])||n.set(o,e.push(o));return i[t.t].apply(i,t.a)},i.range=function(e){return arguments.length?(o=e,r=0,t={t:"range",a:arguments},i):o},i.rangePoints=function(n,s){arguments.length<2&&(s=0);var c=n[0],l=n[1],d=(l-c)/(Math.max(1,e.length-1)+s);return o=a(e.length<2?(c+l)/2:c+d*s/2,d),r=0,t={t:"rangePoints",a:arguments},i},i.rangeBands=function(n,s,c){arguments.length<2&&(s=0),arguments.length<3&&(c=s);var l=n[1]<n[0],d=n[l-0],m=n[1-l],u=(m-d)/(e.length-s+2*c);return o=a(d+u*c,u),l&&o.reverse(),r=u*(1-s),t={t:"rangeBands",a:arguments},i},i.rangeRoundBands=function(n,s,c){arguments.length<2&&(s=0),arguments.length<3&&(c=s);var l=n[1]<n[0],d=n[l-0],m=n[1-l],u=Math.floor((m-d)/(e.length-s+2*c)),h=m-d-(e.length-s)*u;return o=a(d+Math.round(h/2),u),l&&o.reverse(),r=Math.round(u*(1-s)),t={t:"rangeRoundBands",a:arguments},i},i.rangeBand=function(){return r},i.rangeExtent=function(){return In(t.a[0])},i.copy=function(){return Qn(e,t)},i.domain(e)}function eo(a,n){function o(){var e=0,t=n.length;for(s=[];++e<t;)s[e-1]=Yo.quantile(a,e/t);return r}function r(e){return isNaN(e=+e)?void 0:n[Yo.bisect(s,e)]}var s;return r.domain=function(n){return arguments.length?(a=n.map(t).filter(i).sort(e),o()):a},r.range=function(e){return arguments.length?(n=e,o()):n},r.quantiles=function(){return s},r.invertExtent=function(e){return e=n.indexOf(e),0>e?[NaN,NaN]:[e>0?s[e-1]:a[0],e<s.length?s[e]:a[a.length-1]]},r.copy=function(){return eo(a,n)},o()}function to(e,t,i){function a(t){return i[Math.max(0,Math.min(r,Math.floor(o*(t-e))))]}function n(){return o=i.length/(t-e),r=i.length-1,a}var o,r;return a.domain=function(i){return arguments.length?(e=+i[0],t=+i[i.length-1],n()):[e,t]},a.range=function(e){return arguments.length?(i=e,n()):i},a.invertExtent=function(t){return t=i.indexOf(t),t=0>t?NaN:t/o+e,[t,t+1/o]},a.copy=function(){return to(e,t,i)},n()}function io(e,t){function i(i){return i>=i?t[Yo.bisect(e,i)]:void 0}return i.domain=function(t){return arguments.length?(e=t,i):e},i.range=function(e){return arguments.length?(t=e,i):t},i.invertExtent=function(i){return i=t.indexOf(i),[e[i-1],e[i]]},i.copy=function(){return io(e,t)},i}function ao(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(i){return arguments.length?(e=i.map(t),t):e},t.ticks=function(t){return Kn(e,t)},t.tickFormat=function(t,i){return jn(e,t,i)},t.copy=function(){return ao(e)},t}function no(e){return e.innerRadius}function oo(e){return e.outerRadius}function ro(e){return e.startAngle}function so(e){return e.endAngle}function co(e){function t(t){function r(){l.push("M",o(e(d),s))}for(var c,l=[],d=[],m=-1,u=t.length,h=ke(i),g=ke(a);++m<u;)n.call(this,c=t[m],m)?d.push([+h.call(this,c,m),+g.call(this,c,m)]):d.length&&(r(),d=[]);return d.length&&r(),l.length?l.join(""):null}var i=Mi,a=Ti,n=Mt,o=lo,r=o.key,s=.7;return t.x=function(e){return arguments.length?(i=e,t):i},t.y=function(e){return arguments.length?(a=e,t):a},t.defined=function(e){return arguments.length?(n=e,t):n},t.interpolate=function(e){return arguments.length?(r="function"==typeof e?o=e:(o=xc.get(e)||lo).key,t):r},t.tension=function(e){return arguments.length?(s=e,t):s},t}function lo(e){return e.join("L")}function mo(e){return lo(e)+"Z"}function uo(e){for(var t=0,i=e.length,a=e[0],n=[a[0],",",a[1]];++t<i;)n.push("H",(a[0]+(a=e[t])[0])/2,"V",a[1]);return i>1&&n.push("H",a[0]),n.join("")}function ho(e){for(var t=0,i=e.length,a=e[0],n=[a[0],",",a[1]];++t<i;)n.push("V",(a=e[t])[1],"H",a[0]);return n.join("")}function go(e){for(var t=0,i=e.length,a=e[0],n=[a[0],",",a[1]];++t<i;)n.push("H",(a=e[t])[0],"V",a[1]);return n.join("")}function po(e,t){return e.length<4?lo(e):e[1]+_o(e.slice(1,e.length-1),vo(e,t))}function yo(e,t){return e.length<3?lo(e):e[0]+_o((e.push(e[0]),e),vo([e[e.length-2]].concat(e,[e[1]]),t))}function fo(e,t){return e.length<3?lo(e):e[0]+_o(e,vo(e,t))}function _o(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return lo(e);var i=e.length!=t.length,a="",n=e[0],o=e[1],r=t[0],s=r,c=1;if(i&&(a+="Q"+(o[0]-2*r[0]/3)+","+(o[1]-2*r[1]/3)+","+o[0]+","+o[1],n=e[1],c=2),t.length>1){s=t[1],o=e[c],c++,a+="C"+(n[0]+r[0])+","+(n[1]+r[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var l=2;l<t.length;l++,c++)o=e[c],s=t[l],a+="S"+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1]}if(i){var d=e[c];a+="Q"+(o[0]+2*s[0]/3)+","+(o[1]+2*s[1]/3)+","+d[0]+","+d[1]}return a}function vo(e,t){for(var i,a=[],n=(1-t)/2,o=e[0],r=e[1],s=1,c=e.length;++s<c;)i=o,o=r,r=e[s],a.push([n*(r[0]-i[0]),n*(r[1]-i[1])]);return a}function bo(e){if(e.length<3)return lo(e);var t=1,i=e.length,a=e[0],n=a[0],o=a[1],r=[n,n,n,(a=e[1])[0]],s=[o,o,o,a[1]],c=[n,",",o,"L",xo(Mc,r),",",xo(Mc,s)];
for(e.push(e[i-1]);++t<=i;)a=e[t],r.shift(),r.push(a[0]),s.shift(),s.push(a[1]),ko(c,r,s);return e.pop(),c.push("L",a),c.join("")}function wo(e){if(e.length<4)return lo(e);for(var t,i=[],a=-1,n=e.length,o=[0],r=[0];++a<3;)t=e[a],o.push(t[0]),r.push(t[1]);for(i.push(xo(Mc,o)+","+xo(Mc,r)),--a;++a<n;)t=e[a],o.shift(),o.push(t[0]),r.shift(),r.push(t[1]),ko(i,o,r);return i.join("")}function So(e){for(var t,i,a=-1,n=e.length,o=n+4,r=[],s=[];++a<4;)i=e[a%n],r.push(i[0]),s.push(i[1]);for(t=[xo(Mc,r),",",xo(Mc,s)],--a;++a<o;)i=e[a%n],r.shift(),r.push(i[0]),s.shift(),s.push(i[1]),ko(t,r,s);return t.join("")}function Co(e,t){var i=e.length-1;if(i)for(var a,n,o=e[0][0],r=e[0][1],s=e[i][0]-o,c=e[i][1]-r,l=-1;++l<=i;)a=e[l],n=l/i,a[0]=t*a[0]+(1-t)*(o+n*s),a[1]=t*a[1]+(1-t)*(r+n*c);return bo(e)}function xo(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function ko(e,t,i){e.push("C",xo(kc,t),",",xo(kc,i),",",xo(Pc,t),",",xo(Pc,i),",",xo(Mc,t),",",xo(Mc,i))}function Po(e,t){return(t[1]-e[1])/(t[0]-e[0])}function Mo(e){for(var t=0,i=e.length-1,a=[],n=e[0],o=e[1],r=a[0]=Po(n,o);++t<i;)a[t]=(r+(r=Po(n=o,o=e[t+1])))/2;return a[t]=r,a}function To(e){for(var t,i,a,n,o=[],r=Mo(e),s=-1,c=e.length-1;++s<c;)t=Po(e[s],e[s+1]),lr(t)<Ar?r[s]=r[s+1]=0:(i=r[s]/t,a=r[s+1]/t,n=i*i+a*a,n>9&&(n=3*t/Math.sqrt(n),r[s]=n*i,r[s+1]=n*a));for(s=-1;++s<=c;)n=(e[Math.min(c,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+r[s]*r[s])),o.push([n||0,r[s]*n||0]);return o}function Do(e){return e.length<3?lo(e):e[0]+_o(e,To(e))}function Ao(e){for(var t,i,a,n=-1,o=e.length;++n<o;)t=e[n],i=t[0],a=t[1]+Sc,t[0]=i*Math.cos(a),t[1]=i*Math.sin(a);return e}function $o(e){function t(t){function c(){p.push("M",s(e(f),m),d,l(e(y.reverse()),m),"Z")}for(var u,h,g,p=[],y=[],f=[],_=-1,v=t.length,b=ke(i),w=ke(n),S=i===a?function(){return h}:ke(a),C=n===o?function(){return g}:ke(o);++_<v;)r.call(this,u=t[_],_)?(y.push([h=+b.call(this,u,_),g=+w.call(this,u,_)]),f.push([+S.call(this,u,_),+C.call(this,u,_)])):y.length&&(c(),y=[],f=[]);return y.length&&c(),p.length?p.join(""):null}var i=Mi,a=Mi,n=0,o=Ti,r=Mt,s=lo,c=s.key,l=s,d="L",m=.7;return t.x=function(e){return arguments.length?(i=a=e,t):a},t.x0=function(e){return arguments.length?(i=e,t):i},t.x1=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(n=o=e,t):o},t.y0=function(e){return arguments.length?(n=e,t):n},t.y1=function(e){return arguments.length?(o=e,t):o},t.defined=function(e){return arguments.length?(r=e,t):r},t.interpolate=function(e){return arguments.length?(c="function"==typeof e?s=e:(s=xc.get(e)||lo).key,l=s.reverse||s,d=s.closed?"M":"L",t):c},t.tension=function(e){return arguments.length?(m=e,t):m},t}function Go(e){return e.radius}function Fo(e){return[e.x,e.y]}function No(e){return function(){var t=e.apply(this,arguments),i=t[0],a=t[1]+Sc;return[i*Math.cos(a),i*Math.sin(a)]}}function Ro(){return 64}function Io(){return"circle"}function Eo(e){var t=Math.sqrt(e/Mr);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Lo(e,t){return gr(e,Fc),e.id=t,e}function Bo(e,t,i,a){var n=e.id;return B(e,"function"==typeof i?function(e,o,r){e.__transition__[n].tween.set(t,a(i.call(e,e.__data__,o,r)))}:(i=a(i),function(e){e.__transition__[n].tween.set(t,i)}))}function Uo(e){return null==e&&(e=""),function(){this.textContent=e}}function Oo(e,t,i,a){var n=e.__transition__||(e.__transition__={active:0,count:0}),o=n[i];if(!o){var r=a.time;o=n[i]={tween:new s,time:r,ease:a.ease,delay:a.delay,duration:a.duration},++n.count,Yo.timer(function(a){function s(a){return n.active>i?l():(n.active=i,o.event&&o.event.start.call(e,d,t),o.tween.forEach(function(i,a){(a=a.call(e,d,t))&&p.push(a)}),void Yo.timer(function(){return g.c=c(a||1)?Mt:c,1},0,r))}function c(a){if(n.active!==i)return l();for(var r=a/h,s=m(r),c=p.length;c>0;)p[--c].call(e,s);return r>=1?(o.event&&o.event.end.call(e,d,t),l()):void 0}function l(){return--n.count?delete n[i]:delete e.__transition__,1}var d=e.__data__,m=o.ease,u=o.delay,h=o.duration,g=Qr,p=[];return g.t=u+r,a>=u?s(a-u):void(g.c=s)},0,r)}}function Ho(e,t,i){e.attr("transform",function(e){var a=t(e);return"translate("+(isFinite(a)?a:i(e))+",0)"})}function Vo(e,t,i){e.attr("transform",function(e){var a=t(e);return"translate(0,"+(isFinite(a)?a:i(e))+")"})}function Wo(e){return e.toISOString()}function zo(e,t,i){function a(t){return e(t)}function n(e,i){var a=e[1]-e[0],n=a/i,o=Yo.bisect(Hc,n);return o==Hc.length?[t.year,zn(e.map(function(e){return e/31536e6}),i)[2]]:o?t[n/Hc[o-1]<Hc[o]/n?o-1:o]:[zc,zn(e,i)[2]]}return a.invert=function(t){return Ko(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain(t),a):e.domain().map(Ko)},a.nice=function(e,t){function i(i){return!isNaN(i)&&!e.range(i,Ko(+i+1),t).length}var o=a.domain(),r=In(o),s=null==e?n(r,10):"number"==typeof e&&n(r,e);return s&&(e=s[0],t=s[1]),a.domain(Bn(o,t>1?{floor:function(t){for(;i(t=e.floor(t));)t=Ko(t-1);return t},ceil:function(t){for(;i(t=e.ceil(t));)t=Ko(+t+1);return t}}:e))},a.ticks=function(e,t){var i=In(a.domain()),o=null==e?n(i,10):"number"==typeof e?n(i,e):!e.range&&[{range:e},t];return o&&(e=o[0],t=o[1]),e.range(i[0],Ko(+i[1]+1),1>t?1:t)},a.tickFormat=function(){return i},a.copy=function(){return zo(e.copy(),t,i)},Vn(a,e)}function Ko(e){return new Date(e)}function jo(e){return JSON.parse(e.responseText)}function qo(e){var t=Zo.createRange();return t.selectNode(Zo.body),t.createContextualFragment(e.responseText)}var Yo={version:"3.4.13"};Date.now||(Date.now=function(){return+new Date});var Xo=[].slice,Jo=function(e){return Xo.call(e)},Zo=document,Qo=Zo.documentElement,er=window;try{Jo(Qo.childNodes)[0].nodeType}catch(tr){Jo=function(e){for(var t=e.length,i=new Array(t);t--;)i[t]=e[t];return i}}try{Zo.createElement("div").style.setProperty("opacity",0,"")}catch(ir){var ar=er.Element.prototype,nr=ar.setAttribute,or=ar.setAttributeNS,rr=er.CSSStyleDeclaration.prototype,sr=rr.setProperty;ar.setAttribute=function(e,t){nr.call(this,e,t+"")},ar.setAttributeNS=function(e,t,i){or.call(this,e,t,i+"")},rr.setProperty=function(e,t,i){sr.call(this,e,t+"",i)}}Yo.ascending=e,Yo.descending=function(e,t){return e>t?-1:t>e?1:t>=e?0:NaN},Yo.min=function(e,t){var i,a,n=-1,o=e.length;if(1===arguments.length){for(;++n<o&&!(null!=(i=e[n])&&i>=i);)i=void 0;for(;++n<o;)null!=(a=e[n])&&i>a&&(i=a)}else{for(;++n<o&&!(null!=(i=t.call(e,e[n],n))&&i>=i);)i=void 0;for(;++n<o;)null!=(a=t.call(e,e[n],n))&&i>a&&(i=a)}return i},Yo.max=function(e,t){var i,a,n=-1,o=e.length;if(1===arguments.length){for(;++n<o&&!(null!=(i=e[n])&&i>=i);)i=void 0;for(;++n<o;)null!=(a=e[n])&&a>i&&(i=a)}else{for(;++n<o&&!(null!=(i=t.call(e,e[n],n))&&i>=i);)i=void 0;for(;++n<o;)null!=(a=t.call(e,e[n],n))&&a>i&&(i=a)}return i},Yo.extent=function(e,t){var i,a,n,o=-1,r=e.length;if(1===arguments.length){for(;++o<r&&!(null!=(i=n=e[o])&&i>=i);)i=n=void 0;for(;++o<r;)null!=(a=e[o])&&(i>a&&(i=a),a>n&&(n=a))}else{for(;++o<r&&!(null!=(i=n=t.call(e,e[o],o))&&i>=i);)i=void 0;for(;++o<r;)null!=(a=t.call(e,e[o],o))&&(i>a&&(i=a),a>n&&(n=a))}return[i,n]},Yo.sum=function(e,t){var a,n=0,o=e.length,r=-1;if(1===arguments.length)for(;++r<o;)i(a=+e[r])&&(n+=a);else for(;++r<o;)i(a=+t.call(e,e[r],r))&&(n+=a);return n},Yo.mean=function(e,a){var n,o=0,r=e.length,s=-1,c=r;if(1===arguments.length)for(;++s<r;)i(n=t(e[s]))?o+=n:--c;else for(;++s<r;)i(n=t(a.call(e,e[s],s)))?o+=n:--c;return c?o/c:void 0},Yo.quantile=function(e,t){var i=(e.length-1)*t+1,a=Math.floor(i),n=+e[a-1],o=i-a;return o?n+o*(e[a]-n):n},Yo.median=function(a,n){var o,r=[],s=a.length,c=-1;if(1===arguments.length)for(;++c<s;)i(o=t(a[c]))&&r.push(o);else for(;++c<s;)i(o=t(n.call(a,a[c],c)))&&r.push(o);return r.length?Yo.quantile(r.sort(e),.5):void 0};var cr=a(e);Yo.bisectLeft=cr.left,Yo.bisect=Yo.bisectRight=cr.right,Yo.bisector=function(t){return a(1===t.length?function(i,a){return e(t(i),a)}:t)},Yo.shuffle=function(e){for(var t,i,a=e.length;a;)i=Math.random()*a--|0,t=e[a],e[a]=e[i],e[i]=t;return e},Yo.permute=function(e,t){for(var i=t.length,a=new Array(i);i--;)a[i]=e[t[i]];return a},Yo.pairs=function(e){for(var t,i=0,a=e.length-1,n=e[0],o=new Array(0>a?0:a);a>i;)o[i]=[t=n,n=e[++i]];return o},Yo.zip=function(){if(!(a=arguments.length))return[];for(var e=-1,t=Yo.min(arguments,n),i=new Array(t);++e<t;)for(var a,o=-1,r=i[e]=new Array(a);++o<a;)r[o]=arguments[o][e];return i},Yo.transpose=function(e){return Yo.zip.apply(Yo,e)},Yo.keys=function(e){var t=[];for(var i in e)t.push(i);return t},Yo.values=function(e){var t=[];for(var i in e)t.push(e[i]);return t},Yo.entries=function(e){var t=[];for(var i in e)t.push({key:i,value:e[i]});return t},Yo.merge=function(e){for(var t,i,a,n=e.length,o=-1,r=0;++o<n;)r+=e[o].length;for(i=new Array(r);--n>=0;)for(a=e[n],t=a.length;--t>=0;)i[--r]=a[t];return i};var lr=Math.abs;Yo.range=function(e,t,i){if(arguments.length<3&&(i=1,arguments.length<2&&(t=e,e=0)),(t-e)/i===1/0)throw new Error("infinite range");var a,n=[],r=o(lr(i)),s=-1;if(e*=r,t*=r,i*=r,0>i)for(;(a=e+i*++s)>t;)n.push(a/r);else for(;(a=e+i*++s)<t;)n.push(a/r);return n},Yo.map=function(e){var t=new s;if(e instanceof s)e.forEach(function(e,i){t.set(e,i)});else for(var i in e)t.set(i,e[i]);return t};var dr="__proto__",mr="\x00";r(s,{has:d,get:function(e){return this._[c(e)]},set:function(e,t){return this._[c(e)]=t},remove:m,keys:u,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:l(t),value:this._[t]});return e},size:h,empty:g,forEach:function(e){for(var t in this._)e.call(this,l(t),this._[t])}}),Yo.nest=function(){function e(t,r,c){if(c>=o.length)return a?a.call(n,r):i?r.sort(i):r;for(var l,d,m,u,h=-1,g=r.length,p=o[c++],y=new s;++h<g;)(u=y.get(l=p(d=r[h])))?u.push(d):y.set(l,[d]);return t?(d=t(),m=function(i,a){d.set(i,e(t,a,c))}):(d={},m=function(i,a){d[i]=e(t,a,c)}),y.forEach(m),d}function t(e,i){if(i>=o.length)return e;var a=[],n=r[i++];return e.forEach(function(e,n){a.push({key:e,values:t(n,i)})}),n?a.sort(function(e,t){return n(e.key,t.key)}):a}var i,a,n={},o=[],r=[];return n.map=function(t,i){return e(i,t,0)},n.entries=function(i){return t(e(Yo.map,i,0),0)},n.key=function(e){return o.push(e),n},n.sortKeys=function(e){return r[o.length-1]=e,n},n.sortValues=function(e){return i=e,n},n.rollup=function(e){return a=e,n},n},Yo.set=function(e){var t=new p;if(e)for(var i=0,a=e.length;a>i;++i)t.add(e[i]);return t},r(p,{has:d,add:function(e){return this._[c(e+="")]=!0,e},remove:m,values:u,size:h,empty:g,forEach:function(e){for(var t in this._)e.call(this,l(t))}}),Yo.behavior={},Yo.rebind=function(e,t){for(var i,a=1,n=arguments.length;++a<n;)e[i=arguments[a]]=y(e,t,t[i]);return e};var ur=["webkit","ms","moz","Moz","o","O"];Yo.dispatch=function(){for(var e=new v,t=-1,i=arguments.length;++t<i;)e[arguments[t]]=b(e);return e},v.prototype.on=function(e,t){var i=e.indexOf("."),a="";if(i>=0&&(a=e.slice(i+1),e=e.slice(0,i)),e)return arguments.length<2?this[e].on(a):this[e].on(a,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(a,null);return this}},Yo.event=null,Yo.requote=function(e){return e.replace(hr,"\\$&")};var hr=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,gr={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)e[i]=t[i]},pr=function(e,t){return t.querySelector(e)},yr=function(e,t){return t.querySelectorAll(e)},fr=Qo.matches||Qo[f(Qo,"matchesSelector")],_r=function(e,t){return fr.call(e,t)};"function"==typeof Sizzle&&(pr=function(e,t){return Sizzle(e,t)[0]||null},yr=Sizzle,_r=Sizzle.matchesSelector),Yo.selection=function(){return Sr};var vr=Yo.selection.prototype=[];vr.select=function(e){var t,i,a,n,o=[];e=k(e);for(var r=-1,s=this.length;++r<s;){o.push(t=[]),t.parentNode=(a=this[r]).parentNode;for(var c=-1,l=a.length;++c<l;)(n=a[c])?(t.push(i=e.call(n,n.__data__,c,r)),i&&"__data__"in n&&(i.__data__=n.__data__)):t.push(null)}return x(o)},vr.selectAll=function(e){var t,i,a=[];e=P(e);for(var n=-1,o=this.length;++n<o;)for(var r=this[n],s=-1,c=r.length;++s<c;)(i=r[s])&&(a.push(t=Jo(e.call(i,i.__data__,s,n))),t.parentNode=i);return x(a)};var br={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};Yo.ns={prefix:br,qualify:function(e){var t=e.indexOf(":"),i=e;return t>=0&&(i=e.slice(0,t),e=e.slice(t+1)),br.hasOwnProperty(i)?{space:br[i],local:e}:e}},vr.attr=function(e,t){if(arguments.length<2){if("string"==typeof e){var i=this.node();return e=Yo.ns.qualify(e),e.local?i.getAttributeNS(e.space,e.local):i.getAttribute(e)}for(t in e)this.each(M(t,e[t]));return this}return this.each(M(e,t))},vr.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var i=this.node(),a=(e=A(e)).length,n=-1;if(t=i.classList){for(;++n<a;)if(!t.contains(e[n]))return!1}else for(t=i.getAttribute("class");++n<a;)if(!D(e[n]).test(t))return!1;return!0}for(t in e)this.each($(t,e[t]));return this}return this.each($(e,t))},vr.style=function(e,t,i){var a=arguments.length;if(3>a){if("string"!=typeof e){2>a&&(t="");for(i in e)this.each(F(i,e[i],t));return this}if(2>a)return er.getComputedStyle(this.node(),null).getPropertyValue(e);i=""}return this.each(F(e,t,i))},vr.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(N(t,e[t]));return this}return this.each(N(e,t))},vr.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},vr.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},vr.append=function(e){return e=R(e),this.select(function(){return this.appendChild(e.apply(this,arguments))})},vr.insert=function(e,t){return e=R(e),t=k(t),this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})},vr.remove=function(){return this.each(function(){var e=this.parentNode;e&&e.removeChild(this)})},vr.data=function(e,t){function i(e,i){var a,n,o,r=e.length,m=i.length,u=Math.min(r,m),h=new Array(m),g=new Array(m),p=new Array(r);if(t){var y,f=new s,_=new Array(r);for(a=-1;++a<r;)f.has(y=t.call(n=e[a],n.__data__,a))?p[a]=n:f.set(y,n),_[a]=y;for(a=-1;++a<m;)(n=f.get(y=t.call(i,o=i[a],a)))?n!==!0&&(h[a]=n,n.__data__=o):g[a]=I(o),f.set(y,!0);for(a=-1;++a<r;)f.get(_[a])!==!0&&(p[a]=e[a])}else{for(a=-1;++a<u;)n=e[a],o=i[a],n?(n.__data__=o,h[a]=n):g[a]=I(o);for(;m>a;++a)g[a]=I(i[a]);for(;r>a;++a)p[a]=e[a]}g.update=h,g.parentNode=h.parentNode=p.parentNode=e.parentNode,c.push(g),l.push(h),d.push(p)}var a,n,o=-1,r=this.length;if(!arguments.length){for(e=new Array(r=(a=this[0]).length);++o<r;)(n=a[o])&&(e[o]=n.__data__);return e}var c=U([]),l=x([]),d=x([]);if("function"==typeof e)for(;++o<r;)i(a=this[o],e.call(a,a.parentNode.__data__,o));else for(;++o<r;)i(a=this[o],e);return l.enter=function(){return c},l.exit=function(){return d},l},vr.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},vr.filter=function(e){var t,i,a,n=[];"function"!=typeof e&&(e=E(e));for(var o=0,r=this.length;r>o;o++){n.push(t=[]),t.parentNode=(i=this[o]).parentNode;for(var s=0,c=i.length;c>s;s++)(a=i[s])&&e.call(a,a.__data__,s,o)&&t.push(a)}return x(n)},vr.order=function(){for(var e=-1,t=this.length;++e<t;)for(var i,a=this[e],n=a.length-1,o=a[n];--n>=0;)(i=a[n])&&(o&&o!==i.nextSibling&&o.parentNode.insertBefore(i,o),o=i);return this},vr.sort=function(e){e=L.apply(this,arguments);for(var t=-1,i=this.length;++t<i;)this[t].sort(e);return this.order()},vr.each=function(e){return B(this,function(t,i,a){e.call(t,t.__data__,i,a)})},vr.call=function(e){var t=Jo(arguments);return e.apply(t[0]=this,t),this},vr.empty=function(){return!this.node()},vr.node=function(){for(var e=0,t=this.length;t>e;e++)for(var i=this[e],a=0,n=i.length;n>a;a++){var o=i[a];if(o)return o}return null},vr.size=function(){var e=0;return B(this,function(){++e}),e};var wr=[];Yo.selection.enter=U,Yo.selection.enter.prototype=wr,wr.append=vr.append,wr.empty=vr.empty,wr.node=vr.node,wr.call=vr.call,wr.size=vr.size,wr.select=function(e){for(var t,i,a,n,o,r=[],s=-1,c=this.length;++s<c;){a=(n=this[s]).update,r.push(t=[]),t.parentNode=n.parentNode;for(var l=-1,d=n.length;++l<d;)(o=n[l])?(t.push(a[l]=i=e.call(n.parentNode,o.__data__,l,s)),i.__data__=o.__data__):t.push(null)}return x(r)},wr.insert=function(e,t){return arguments.length<2&&(t=O(this)),vr.insert.call(this,e,t)},vr.transition=function(){for(var e,t,i=Dc||++Nc,a=[],n=Ac||{time:Date.now(),ease:Ca,delay:0,duration:250},o=-1,r=this.length;++o<r;){a.push(e=[]);for(var s=this[o],c=-1,l=s.length;++c<l;)(t=s[c])&&Oo(t,c,i,n),e.push(t)}return Lo(a,i)},vr.interrupt=function(){return this.each(H)},Yo.select=function(e){var t=["string"==typeof e?pr(e,Zo):e];return t.parentNode=Qo,x([t])},Yo.selectAll=function(e){var t=Jo("string"==typeof e?yr(e,Zo):e);return t.parentNode=Qo,x([t])};var Sr=Yo.select(Qo);vr.on=function(e,t,i){var a=arguments.length;if(3>a){if("string"!=typeof e){2>a&&(t=!1);for(i in e)this.each(V(i,e[i],t));return this}if(2>a)return(a=this.node()["__on"+e])&&a._;i=!1}return this.each(V(e,t,i))};var Cr=Yo.map({mouseenter:"mouseover",mouseleave:"mouseout"});Cr.forEach(function(e){"on"+e in Zo&&Cr.remove(e)});var xr="onselectstart"in Zo?null:f(Qo.style,"userSelect"),kr=0;Yo.mouse=function(e){return j(e,S())};var Pr=/WebKit/.test(er.navigator.userAgent)?-1:0;Yo.touch=function(e,t,i){if(arguments.length<3&&(i=t,t=S().changedTouches),t)for(var a,n=0,o=t.length;o>n;++n)if((a=t[n]).identifier===i)return j(e,a)},Yo.behavior.drag=function(){function e(){this.on("mousedown.drag",n).on("touchstart.drag",o)}function t(e,t,n,o,r){return function(){function s(){var e,i,a=t(u,p);a&&(e=a[0]-v[0],i=a[1]-v[1],g|=e|i,v=a,h({type:"drag",x:a[0]+l[0],y:a[1]+l[1],dx:e,dy:i}))}function c(){t(u,p)&&(f.on(o+y,null).on(r+y,null),_(g&&Yo.event.target===m),h({type:"dragend"}))}var l,d=this,m=Yo.event.target,u=d.parentNode,h=i.of(d,arguments),g=0,p=e(),y=".drag"+(null==p?"":"-"+p),f=Yo.select(n()).on(o+y,s).on(r+y,c),_=K(),v=t(u,p);a?(l=a.apply(d,arguments),l=[l.x-v[0],l.y-v[1]]):l=[0,0],h({type:"dragstart"})}}var i=C(e,"drag","dragstart","dragend"),a=null,n=t(_,Yo.mouse,X,"mousemove","mouseup"),o=t(q,Yo.touch,Y,"touchmove","touchend");return e.origin=function(t){return arguments.length?(a=t,e):a},Yo.rebind(e,i,"on")},Yo.touches=function(e,t){return arguments.length<2&&(t=S().touches),t?Jo(t).map(function(t){var i=j(e,t);return i.identifier=t.identifier,i}):[]};var Mr=Math.PI,Tr=2*Mr,Dr=Mr/2,Ar=1e-6,$r=Ar*Ar,Gr=Mr/180,Fr=180/Mr,Nr=Math.SQRT2,Rr=2,Ir=4;Yo.interpolateZoom=function(e,t){function i(e){var t=e*_;if(f){var i=ie(p),r=o/(Rr*u)*(i*ae(Nr*t+p)-te(p));return[a+r*l,n+r*d,o*i/ie(Nr*t+p)]}return[a+e*l,n+e*d,o*Math.exp(Nr*t)]}var a=e[0],n=e[1],o=e[2],r=t[0],s=t[1],c=t[2],l=r-a,d=s-n,m=l*l+d*d,u=Math.sqrt(m),h=(c*c-o*o+Ir*m)/(2*o*Rr*u),g=(c*c-o*o-Ir*m)/(2*c*Rr*u),p=Math.log(Math.sqrt(h*h+1)-h),y=Math.log(Math.sqrt(g*g+1)-g),f=y-p,_=(f||Math.log(c/o))/Nr;return i.duration=1e3*_,i},Yo.behavior.zoom=function(){function e(e){e.on(M,l).on(Br+".zoom",m).on("dblclick.zoom",u).on(A,d)}function t(e){return[(e[0]-x.x)/x.k,(e[1]-x.y)/x.k]}function i(e){return[e[0]*x.k+x.x,e[1]*x.k+x.y]}function a(e){x.k=Math.max(P[0],Math.min(P[1],e))}function n(e,t){t=i(t),x.x+=e[0]-t[0],x.y+=e[1]-t[1]}function o(){v&&v.domain(_.range().map(function(e){return(e-x.x)/x.k}).map(_.invert)),S&&S.domain(b.range().map(function(e){return(e-x.y)/x.k}).map(b.invert))}function r(e){e({type:"zoomstart"})}function s(e){o(),e({type:"zoom",scale:x.k,translate:[x.x,x.y]})}function c(e){e({type:"zoomend"})}function l(){function e(){d=1,n(Yo.mouse(a),u),s(l)}function i(){m.on(T,null).on(D,null),h(d&&Yo.event.target===o),c(l)}var a=this,o=Yo.event.target,l=$.of(a,arguments),d=0,m=Yo.select(er).on(T,e).on(D,i),u=t(Yo.mouse(a)),h=K();H.call(a),r(l)}function d(){function e(){var e=Yo.touches(h);return u=x.k,e.forEach(function(e){e.identifier in p&&(p[e.identifier]=t(e))}),e}function i(){var t=Yo.event.target;Yo.select(t).on(v,o).on(b,m),S.push(t);for(var i=Yo.event.changedTouches,r=0,c=i.length;c>r;++r)p[i[r].identifier]=null;var l=e(),d=Date.now();if(1===l.length){if(500>d-f){var u=l[0],h=p[u.identifier];a(2*x.k),n(u,h),w(),s(g)}f=d}else if(l.length>1){var u=l[0],_=l[1],C=u[0]-_[0],k=u[1]-_[1];y=C*C+k*k}}function o(){for(var e,t,i,o,r=Yo.touches(h),c=0,l=r.length;l>c;++c,o=null)if(i=r[c],o=p[i.identifier]){if(t)break;e=i,t=o}if(o){var d=(d=i[0]-e[0])*d+(d=i[1]-e[1])*d,m=y&&Math.sqrt(d/y);e=[(e[0]+i[0])/2,(e[1]+i[1])/2],t=[(t[0]+o[0])/2,(t[1]+o[1])/2],a(m*u)}f=null,n(e,t),s(g)}function m(){if(Yo.event.touches.length){for(var t=Yo.event.changedTouches,i=0,a=t.length;a>i;++i)delete p[t[i].identifier];for(var n in p)return void e()}Yo.selectAll(S).on(_,null),C.on(M,l).on(A,d),k(),c(g)}var u,h=this,g=$.of(h,arguments),p={},y=0,_=".zoom-"+Yo.event.changedTouches[0].identifier,v="touchmove"+_,b="touchend"+_,S=[],C=Yo.select(h),k=K();H.call(h),i(),r(g),C.on(M,null).on(A,i)}function m(){var e=$.of(this,arguments);y?clearTimeout(y):(h=t(g=p||Yo.mouse(this)),H.call(this),r(e)),y=setTimeout(function(){y=null,c(e)},50),w(),a(Math.pow(2,.002*Er())*x.k),n(g,h),s(e)}function u(){var e=$.of(this,arguments),i=Yo.mouse(this),o=t(i),l=Math.log(x.k)/Math.LN2;r(e),a(Math.pow(2,Yo.event.shiftKey?Math.ceil(l)-1:Math.floor(l)+1)),n(i,o),s(e),c(e)}var h,g,p,y,f,_,v,b,S,x={x:0,y:0,k:1},k=[960,500],P=Lr,M="mousedown.zoom",T="mousemove.zoom",D="mouseup.zoom",A="touchstart.zoom",$=C(e,"zoomstart","zoom","zoomend");return e.event=function(e){e.each(function(){var e=$.of(this,arguments),t=x;Dc?Yo.select(this).transition().each("start.zoom",function(){x=this.__chart__||{x:0,y:0,k:1},r(e)}).tween("zoom:zoom",function(){var i=k[0],a=k[1],n=i/2,o=a/2,r=Yo.interpolateZoom([(n-x.x)/x.k,(o-x.y)/x.k,i/x.k],[(n-t.x)/t.k,(o-t.y)/t.k,i/t.k]);return function(t){var a=r(t),c=i/a[2];this.__chart__=x={x:n-a[0]*c,y:o-a[1]*c,k:c},s(e)}}).each("end.zoom",function(){c(e)}):(this.__chart__=x,r(e),s(e),c(e))})},e.translate=function(t){return arguments.length?(x={x:+t[0],y:+t[1],k:x.k},o(),e):[x.x,x.y]},e.scale=function(t){return arguments.length?(x={x:x.x,y:x.y,k:+t},o(),e):x.k},e.scaleExtent=function(t){return arguments.length?(P=null==t?Lr:[+t[0],+t[1]],e):P},e.center=function(t){return arguments.length?(p=t&&[+t[0],+t[1]],e):p},e.size=function(t){return arguments.length?(k=t&&[+t[0],+t[1]],e):k},e.x=function(t){return arguments.length?(v=t,_=t.copy(),x={x:0,y:0,k:1},e):v},e.y=function(t){return arguments.length?(S=t,b=t.copy(),x={x:0,y:0,k:1},e):S},Yo.rebind(e,$,"on")};var Er,Lr=[0,1/0],Br="onwheel"in Zo?(Er=function(){return-Yo.event.deltaY*(Yo.event.deltaMode?120:1)},"wheel"):"onmousewheel"in Zo?(Er=function(){return Yo.event.wheelDelta},"mousewheel"):(Er=function(){return-Yo.event.detail},"MozMousePixelScroll");Yo.color=oe,oe.prototype.toString=function(){return this.rgb()+""},Yo.hsl=re;var Ur=re.prototype=new oe;Ur.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new re(this.h,this.s,this.l/e)},Ur.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new re(this.h,this.s,e*this.l)},Ur.rgb=function(){return se(this.h,this.s,this.l)},Yo.hcl=ce;var Or=ce.prototype=new oe;Or.brighter=function(e){return new ce(this.h,this.c,Math.min(100,this.l+Hr*(arguments.length?e:1)))},Or.darker=function(e){return new ce(this.h,this.c,Math.max(0,this.l-Hr*(arguments.length?e:1)))},Or.rgb=function(){return le(this.h,this.c,this.l).rgb()},Yo.lab=de;var Hr=18,Vr=.95047,Wr=1,zr=1.08883,Kr=de.prototype=new oe;Kr.brighter=function(e){return new de(Math.min(100,this.l+Hr*(arguments.length?e:1)),this.a,this.b)},Kr.darker=function(e){return new de(Math.max(0,this.l-Hr*(arguments.length?e:1)),this.a,this.b)},Kr.rgb=function(){return me(this.l,this.a,this.b)},Yo.rgb=ye;var jr=ye.prototype=new oe;jr.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,i=this.g,a=this.b,n=30;return t||i||a?(t&&n>t&&(t=n),i&&n>i&&(i=n),a&&n>a&&(a=n),new ye(Math.min(255,t/e),Math.min(255,i/e),Math.min(255,a/e))):new ye(n,n,n)},jr.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new ye(e*this.r,e*this.g,e*this.b)},jr.hsl=function(){return we(this.r,this.g,this.b)},jr.toString=function(){return"#"+ve(this.r)+ve(this.g)+ve(this.b)};var qr=Yo.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});qr.forEach(function(e,t){qr.set(e,fe(t))}),Yo.functor=ke,Yo.xhr=Me(Pe),Yo.dsv=function(e,t){function i(e,i,o){arguments.length<3&&(o=i,i=null);var r=Te(e,t,null==i?a:n(i),o);return r.row=function(e){return arguments.length?r.response(null==(i=e)?a:n(e)):i},r}function a(e){return i.parse(e.responseText)}function n(e){return function(t){return i.parse(t.responseText,e)}}function o(t){return t.map(r).join(e)}function r(e){return s.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}var s=new RegExp('["'+e+"\n]"),c=e.charCodeAt(0);return i.parse=function(e,t){var a;return i.parseRows(e,function(e,i){if(a)return a(e,i-1);var n=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}");a=t?function(e,i){return t(n(e),i)}:n})},i.parseRows=function(e,t){function i(){if(d>=l)return r;if(n)return n=!1,o;var t=d;if(34===e.charCodeAt(t)){for(var i=t;i++<l;)if(34===e.charCodeAt(i)){if(34!==e.charCodeAt(i+1))break;++i}d=i+2;var a=e.charCodeAt(i+1);return 13===a?(n=!0,10===e.charCodeAt(i+2)&&++d):10===a&&(n=!0),e.slice(t+1,i).replace(/""/g,'"')}for(;l>d;){var a=e.charCodeAt(d++),s=1;if(10===a)n=!0;else if(13===a)n=!0,10===e.charCodeAt(d)&&(++d,++s);else if(a!==c)continue;return e.slice(t,d-s)}return e.slice(t)}for(var a,n,o={},r={},s=[],l=e.length,d=0,m=0;(a=i())!==r;){for(var u=[];a!==o&&a!==r;)u.push(a),a=i();t&&null==(u=t(u,m++))||s.push(u)}return s},i.format=function(t){if(Array.isArray(t[0]))return i.formatRows(t);var a=new p,n=[];return t.forEach(function(e){for(var t in e)a.has(t)||n.push(a.add(t))}),[n.map(r).join(e)].concat(t.map(function(t){return n.map(function(e){return r(t[e])}).join(e)})).join("\n")},i.formatRows=function(e){return e.map(o).join("\n")},i},Yo.csv=Yo.dsv(",","text/csv"),Yo.tsv=Yo.dsv("	","text/tab-separated-values");var Yr,Xr,Jr,Zr,Qr,es=er[f(er,"requestAnimationFrame")]||function(e){setTimeout(e,17)};Yo.timer=function(e,t,i){var a=arguments.length;2>a&&(t=0),3>a&&(i=Date.now());var n=i+t,o={c:e,t:n,f:!1,n:null};Xr?Xr.n=o:Yr=o,Xr=o,Jr||(Zr=clearTimeout(Zr),Jr=1,es($e))},Yo.timer.flush=function(){Ge(),Fe()},Yo.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var ts=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Re);Yo.formatPrefix=function(e,t){var i=0;return e&&(0>e&&(e*=-1),t&&(e=Yo.round(e,Ne(e,t))),i=1+Math.floor(1e-12+Math.log(e)/Math.LN10),i=Math.max(-24,Math.min(24,3*Math.floor((i-1)/3)))),ts[8+i/3]};var is=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,as=Yo.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(e,t){return(e=Yo.round(e,Ne(e,t))).toFixed(Math.max(0,Math.min(20,Ne(e*(1+1e-15),t))))}}),ns=Yo.time={},os=Date;Le.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){rs.setUTCDate.apply(this._,arguments)},setDay:function(){rs.setUTCDay.apply(this._,arguments)},setFullYear:function(){rs.setUTCFullYear.apply(this._,arguments)},setHours:function(){rs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){rs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){rs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){rs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){rs.setUTCSeconds.apply(this._,arguments)},setTime:function(){rs.setTime.apply(this._,arguments)}};var rs=Date.prototype;ns.year=Be(function(e){return e=ns.day(e),e.setMonth(0,1),e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()}),ns.years=ns.year.range,ns.years.utc=ns.year.utc.range,ns.day=Be(function(e){var t=new os(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t},function(e,t){e.setDate(e.getDate()+t)},function(e){return e.getDate()-1}),ns.days=ns.day.range,ns.days.utc=ns.day.utc.range,ns.dayOfYear=function(e){var t=ns.year(e);return Math.floor((e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(e,t){
t=7-t;var i=ns[e]=Be(function(e){return(e=ns.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e},function(e,t){e.setDate(e.getDate()+7*Math.floor(t))},function(e){var i=ns.year(e).getDay();return Math.floor((ns.dayOfYear(e)+(i+t)%7)/7)-(i!==t)});ns[e+"s"]=i.range,ns[e+"s"].utc=i.utc.range,ns[e+"OfYear"]=function(e){var i=ns.year(e).getDay();return Math.floor((ns.dayOfYear(e)+(i+t)%7)/7)}}),ns.week=ns.sunday,ns.weeks=ns.sunday.range,ns.weeks.utc=ns.sunday.utc.range,ns.weekOfYear=ns.sundayOfYear;var ss={"-":"",_:" ",0:"0"},cs=/^\s*\d+/,ls=/^%/;Yo.locale=function(e){return{numberFormat:Ie(e),timeFormat:Oe(e)}};var ds=Yo.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Yo.format=ds.numberFormat,Yo.geo={},ct.prototype={s:0,t:0,add:function(e){lt(e,this.t,ms),lt(ms.s,this.s,this),this.s?this.t+=ms.t:this.s=ms.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ms=new ct;Yo.geo.stream=function(e,t){e&&us.hasOwnProperty(e.type)?us[e.type](e,t):dt(e,t)};var us={Feature:function(e,t){dt(e.geometry,t)},FeatureCollection:function(e,t){for(var i=e.features,a=-1,n=i.length;++a<n;)dt(i[a].geometry,t)}},hs={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var i=e.coordinates,a=-1,n=i.length;++a<n;)e=i[a],t.point(e[0],e[1],e[2])},LineString:function(e,t){mt(e.coordinates,t,0)},MultiLineString:function(e,t){for(var i=e.coordinates,a=-1,n=i.length;++a<n;)mt(i[a],t,0)},Polygon:function(e,t){ut(e.coordinates,t)},MultiPolygon:function(e,t){for(var i=e.coordinates,a=-1,n=i.length;++a<n;)ut(i[a],t)},GeometryCollection:function(e,t){for(var i=e.geometries,a=-1,n=i.length;++a<n;)dt(i[a],t)}};Yo.geo.area=function(e){return gs=0,Yo.geo.stream(e,ys),gs};var gs,ps=new ct,ys={sphere:function(){gs+=4*Mr},point:_,lineStart:_,lineEnd:_,polygonStart:function(){ps.reset(),ys.lineStart=ht},polygonEnd:function(){var e=2*ps;gs+=0>e?4*Mr+e:e,ys.lineStart=ys.lineEnd=ys.point=_}};Yo.geo.bounds=function(){function e(e,t){v.push(b=[d=e,u=e]),m>t&&(m=t),t>h&&(h=t)}function t(t,i){var a=gt([t*Gr,i*Gr]);if(f){var n=yt(f,a),o=[n[1],-n[0],0],r=yt(o,n);vt(r),r=bt(r);var c=t-g,l=c>0?1:-1,p=r[0]*Fr*l,y=lr(c)>180;if(y^(p>l*g&&l*t>p)){var _=r[1]*Fr;_>h&&(h=_)}else if(p=(p+360)%360-180,y^(p>l*g&&l*t>p)){var _=-r[1]*Fr;m>_&&(m=_)}else m>i&&(m=i),i>h&&(h=i);y?g>t?s(d,t)>s(d,u)&&(u=t):s(t,u)>s(d,u)&&(d=t):u>=d?(d>t&&(d=t),t>u&&(u=t)):t>g?s(d,t)>s(d,u)&&(u=t):s(t,u)>s(d,u)&&(d=t)}else e(t,i);f=a,g=t}function i(){w.point=t}function a(){b[0]=d,b[1]=u,w.point=e,f=null}function n(e,i){if(f){var a=e-g;_+=lr(a)>180?a+(a>0?360:-360):a}else p=e,y=i;ys.point(e,i),t(e,i)}function o(){ys.lineStart()}function r(){n(p,y),ys.lineEnd(),lr(_)>Ar&&(d=-(u=180)),b[0]=d,b[1]=u,f=null}function s(e,t){return(t-=e)<0?t+360:t}function c(e,t){return e[0]-t[0]}function l(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var d,m,u,h,g,p,y,f,_,v,b,w={point:e,lineStart:i,lineEnd:a,polygonStart:function(){w.point=n,w.lineStart=o,w.lineEnd=r,_=0,ys.polygonStart()},polygonEnd:function(){ys.polygonEnd(),w.point=e,w.lineStart=i,w.lineEnd=a,0>ps?(d=-(u=180),m=-(h=90)):_>Ar?h=90:-Ar>_&&(m=-90),b[0]=d,b[1]=u}};return function(e){h=u=-(d=m=1/0),v=[],Yo.geo.stream(e,w);var t=v.length;if(t){v.sort(c);for(var i,a=1,n=v[0],o=[n];t>a;++a)i=v[a],l(i[0],n)||l(i[1],n)?(s(n[0],i[1])>s(n[0],n[1])&&(n[1]=i[1]),s(i[0],n[1])>s(n[0],n[1])&&(n[0]=i[0])):o.push(n=i);for(var r,i,g=-(1/0),t=o.length-1,a=0,n=o[t];t>=a;n=i,++a)i=o[a],(r=s(n[1],i[0]))>g&&(g=r,d=i[0],u=n[1])}return v=b=null,d===1/0||m===1/0?[[NaN,NaN],[NaN,NaN]]:[[d,m],[u,h]]}}(),Yo.geo.centroid=function(e){fs=_s=vs=bs=ws=Ss=Cs=xs=ks=Ps=Ms=0,Yo.geo.stream(e,Ts);var t=ks,i=Ps,a=Ms,n=t*t+i*i+a*a;return $r>n&&(t=Ss,i=Cs,a=xs,Ar>_s&&(t=vs,i=bs,a=ws),n=t*t+i*i+a*a,$r>n)?[NaN,NaN]:[Math.atan2(i,t)*Fr,ee(a/Math.sqrt(n))*Fr]};var fs,_s,vs,bs,ws,Ss,Cs,xs,ks,Ps,Ms,Ts={sphere:_,point:St,lineStart:xt,lineEnd:kt,polygonStart:function(){Ts.lineStart=Pt},polygonEnd:function(){Ts.lineStart=xt}},Ds=$t(Mt,Rt,Et,[-Mr,-Mr/2]),As=1e9;Yo.geo.clipExtent=function(){var e,t,i,a,n,o,r={stream:function(e){return n&&(n.valid=!1),n=o(e),n.valid=!0,n},extent:function(s){return arguments.length?(o=Ot(e=+s[0][0],t=+s[0][1],i=+s[1][0],a=+s[1][1]),n&&(n.valid=!1,n=null),r):[[e,t],[i,a]]}};return r.extent([[0,0],[960,500]])},(Yo.geo.conicEqualArea=function(){return Vt(Wt)}).raw=Wt,Yo.geo.albers=function(){return Yo.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Yo.geo.albersUsa=function(){function e(e){var o=e[0],r=e[1];return t=null,i(o,r),t||(a(o,r),t)||n(o,r),t}var t,i,a,n,o=Yo.geo.albers(),r=Yo.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=Yo.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(e,i){t=[e,i]}};return e.invert=function(e){var t=o.scale(),i=o.translate(),a=(e[0]-i[0])/t,n=(e[1]-i[1])/t;return(n>=.12&&.234>n&&a>=-.425&&-.214>a?r:n>=.166&&.234>n&&a>=-.214&&-.115>a?s:o).invert(e)},e.stream=function(e){var t=o.stream(e),i=r.stream(e),a=s.stream(e);return{point:function(e,n){t.point(e,n),i.point(e,n),a.point(e,n)},sphere:function(){t.sphere(),i.sphere(),a.sphere()},lineStart:function(){t.lineStart(),i.lineStart(),a.lineStart()},lineEnd:function(){t.lineEnd(),i.lineEnd(),a.lineEnd()},polygonStart:function(){t.polygonStart(),i.polygonStart(),a.polygonStart()},polygonEnd:function(){t.polygonEnd(),i.polygonEnd(),a.polygonEnd()}}},e.precision=function(t){return arguments.length?(o.precision(t),r.precision(t),s.precision(t),e):o.precision()},e.scale=function(t){return arguments.length?(o.scale(t),r.scale(.35*t),s.scale(t),e.translate(o.translate())):o.scale()},e.translate=function(t){if(!arguments.length)return o.translate();var l=o.scale(),d=+t[0],m=+t[1];return i=o.translate(t).clipExtent([[d-.455*l,m-.238*l],[d+.455*l,m+.238*l]]).stream(c).point,a=r.translate([d-.307*l,m+.201*l]).clipExtent([[d-.425*l+Ar,m+.12*l+Ar],[d-.214*l-Ar,m+.234*l-Ar]]).stream(c).point,n=s.translate([d-.205*l,m+.212*l]).clipExtent([[d-.214*l+Ar,m+.166*l+Ar],[d-.115*l-Ar,m+.234*l-Ar]]).stream(c).point,e},e.scale(1070)};var $s,Gs,Fs,Ns,Rs,Is,Es={point:_,lineStart:_,lineEnd:_,polygonStart:function(){Gs=0,Es.lineStart=zt},polygonEnd:function(){Es.lineStart=Es.lineEnd=Es.point=_,$s+=lr(Gs/2)}},Ls={point:Kt,lineStart:_,lineEnd:_,polygonStart:_,polygonEnd:_},Bs={point:Yt,lineStart:Xt,lineEnd:Jt,polygonStart:function(){Bs.lineStart=Zt},polygonEnd:function(){Bs.point=Yt,Bs.lineStart=Xt,Bs.lineEnd=Jt}};Yo.geo.path=function(){function e(e){return e&&("function"==typeof s&&o.pointRadius(+s.apply(this,arguments)),r&&r.valid||(r=n(o)),Yo.geo.stream(e,r)),o.result()}function t(){return r=null,e}var i,a,n,o,r,s=4.5;return e.area=function(e){return $s=0,Yo.geo.stream(e,n(Es)),$s},e.centroid=function(e){return vs=bs=ws=Ss=Cs=xs=ks=Ps=Ms=0,Yo.geo.stream(e,n(Bs)),Ms?[ks/Ms,Ps/Ms]:xs?[Ss/xs,Cs/xs]:ws?[vs/ws,bs/ws]:[NaN,NaN]},e.bounds=function(e){return Rs=Is=-(Fs=Ns=1/0),Yo.geo.stream(e,n(Ls)),[[Fs,Ns],[Rs,Is]]},e.projection=function(e){return arguments.length?(n=(i=e)?e.stream||ti(e):Pe,t()):i},e.context=function(e){return arguments.length?(o=null==(a=e)?new jt:new Qt(e),"function"!=typeof s&&o.pointRadius(s),t()):a},e.pointRadius=function(t){return arguments.length?(s="function"==typeof t?t:(o.pointRadius(+t),+t),e):s},e.projection(Yo.geo.albersUsa()).context(null)},Yo.geo.transform=function(e){return{stream:function(t){var i=new ii(t);for(var a in e)i[a]=e[a];return i}}},ii.prototype={point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Yo.geo.projection=ni,Yo.geo.projectionMutator=oi,(Yo.geo.equirectangular=function(){return ni(si)}).raw=si.invert=si,Yo.geo.rotation=function(e){function t(t){return t=e(t[0]*Gr,t[1]*Gr),t[0]*=Fr,t[1]*=Fr,t}return e=li(e[0]%360*Gr,e[1]*Gr,e.length>2?e[2]*Gr:0),t.invert=function(t){return t=e.invert(t[0]*Gr,t[1]*Gr),t[0]*=Fr,t[1]*=Fr,t},t},ci.invert=si,Yo.geo.circle=function(){function e(){var e="function"==typeof a?a.apply(this,arguments):a,t=li(-e[0]*Gr,-e[1]*Gr,0).invert,n=[];return i(null,null,1,{point:function(e,i){n.push(e=t(e,i)),e[0]*=Fr,e[1]*=Fr}}),{type:"Polygon",coordinates:[n]}}var t,i,a=[0,0],n=6;return e.origin=function(t){return arguments.length?(a=t,e):a},e.angle=function(a){return arguments.length?(i=hi((t=+a)*Gr,n*Gr),e):t},e.precision=function(a){return arguments.length?(i=hi(t*Gr,(n=+a)*Gr),e):n},e.angle(90)},Yo.geo.distance=function(e,t){var i,a=(t[0]-e[0])*Gr,n=e[1]*Gr,o=t[1]*Gr,r=Math.sin(a),s=Math.cos(a),c=Math.sin(n),l=Math.cos(n),d=Math.sin(o),m=Math.cos(o);return Math.atan2(Math.sqrt((i=m*r)*i+(i=l*d-c*m*s)*i),c*d+l*m*s)},Yo.geo.graticule=function(){function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return Yo.range(Math.ceil(o/y)*y,n,y).map(u).concat(Yo.range(Math.ceil(l/f)*f,c,f).map(h)).concat(Yo.range(Math.ceil(a/g)*g,i,g).filter(function(e){return lr(e%y)>Ar}).map(d)).concat(Yo.range(Math.ceil(s/p)*p,r,p).filter(function(e){return lr(e%f)>Ar}).map(m))}var i,a,n,o,r,s,c,l,d,m,u,h,g=10,p=g,y=90,f=360,_=2.5;return e.lines=function(){return t().map(function(e){return{type:"LineString",coordinates:e}})},e.outline=function(){return{type:"Polygon",coordinates:[u(o).concat(h(c).slice(1),u(n).reverse().slice(1),h(l).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.majorExtent(t).minorExtent(t):e.minorExtent()},e.majorExtent=function(t){return arguments.length?(o=+t[0][0],n=+t[1][0],l=+t[0][1],c=+t[1][1],o>n&&(t=o,o=n,n=t),l>c&&(t=l,l=c,c=t),e.precision(_)):[[o,l],[n,c]]},e.minorExtent=function(t){return arguments.length?(a=+t[0][0],i=+t[1][0],s=+t[0][1],r=+t[1][1],a>i&&(t=a,a=i,i=t),s>r&&(t=s,s=r,r=t),e.precision(_)):[[a,s],[i,r]]},e.step=function(t){return arguments.length?e.majorStep(t).minorStep(t):e.minorStep()},e.majorStep=function(t){return arguments.length?(y=+t[0],f=+t[1],e):[y,f]},e.minorStep=function(t){return arguments.length?(g=+t[0],p=+t[1],e):[g,p]},e.precision=function(t){return arguments.length?(_=+t,d=pi(s,r,90),m=yi(a,i,_),u=pi(l,c,90),h=yi(o,n,_),e):_},e.majorExtent([[-180,-90+Ar],[180,90-Ar]]).minorExtent([[-180,-80-Ar],[180,80+Ar]])},Yo.geo.greatArc=function(){function e(){return{type:"LineString",coordinates:[t||a.apply(this,arguments),i||n.apply(this,arguments)]}}var t,i,a=fi,n=_i;return e.distance=function(){return Yo.geo.distance(t||a.apply(this,arguments),i||n.apply(this,arguments))},e.source=function(i){return arguments.length?(a=i,t="function"==typeof i?null:i,e):a},e.target=function(t){return arguments.length?(n=t,i="function"==typeof t?null:t,e):n},e.precision=function(){return arguments.length?e:0},e},Yo.geo.interpolate=function(e,t){return vi(e[0]*Gr,e[1]*Gr,t[0]*Gr,t[1]*Gr)},Yo.geo.length=function(e){return Us=0,Yo.geo.stream(e,Os),Us};var Us,Os={sphere:_,point:_,lineStart:bi,lineEnd:_,polygonStart:_,polygonEnd:_},Hs=wi(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(Yo.geo.azimuthalEqualArea=function(){return ni(Hs)}).raw=Hs;var Vs=wi(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},Pe);(Yo.geo.azimuthalEquidistant=function(){return ni(Vs)}).raw=Vs,(Yo.geo.conicConformal=function(){return Vt(Si)}).raw=Si,(Yo.geo.conicEquidistant=function(){return Vt(Ci)}).raw=Ci;var Ws=wi(function(e){return 1/e},Math.atan);(Yo.geo.gnomonic=function(){return ni(Ws)}).raw=Ws,xi.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-Dr]},(Yo.geo.mercator=function(){return ki(xi)}).raw=xi;var zs=wi(function(){return 1},Math.asin);(Yo.geo.orthographic=function(){return ni(zs)}).raw=zs;var Ks=wi(function(e){return 1/(1+e)},function(e){return 2*Math.atan(e)});(Yo.geo.stereographic=function(){return ni(Ks)}).raw=Ks,Pi.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-Dr]},(Yo.geo.transverseMercator=function(){var e=ki(Pi),t=e.center,i=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return e?i([e[0],e[1],e.length>2?e[2]+90:90]):(e=i(),[e[0],e[1],e[2]-90])},i([0,0,90])}).raw=Pi,Yo.geom={},Yo.geom.hull=function(e){function t(e){if(e.length<3)return[];var t,n=ke(i),o=ke(a),r=e.length,s=[],c=[];for(t=0;r>t;t++)s.push([+n.call(this,e[t],t),+o.call(this,e[t],t),t]);for(s.sort(Ai),t=0;r>t;t++)c.push([s[t][0],-s[t][1]]);var l=Di(s),d=Di(c),m=d[0]===l[0],u=d[d.length-1]===l[l.length-1],h=[];for(t=l.length-1;t>=0;--t)h.push(e[s[l[t]][2]]);for(t=+m;t<d.length-u;++t)h.push(e[s[d[t]][2]]);return h}var i=Mi,a=Ti;return arguments.length?t(e):(t.x=function(e){return arguments.length?(i=e,t):i},t.y=function(e){return arguments.length?(a=e,t):a},t)},Yo.geom.polygon=function(e){return gr(e,js),e};var js=Yo.geom.polygon.prototype=[];js.area=function(){for(var e,t=-1,i=this.length,a=this[i-1],n=0;++t<i;)e=a,a=this[t],n+=e[1]*a[0]-e[0]*a[1];return.5*n},js.centroid=function(e){var t,i,a=-1,n=this.length,o=0,r=0,s=this[n-1];for(arguments.length||(e=-1/(6*this.area()));++a<n;)t=s,s=this[a],i=t[0]*s[1]-s[0]*t[1],o+=(t[0]+s[0])*i,r+=(t[1]+s[1])*i;return[o*e,r*e]},js.clip=function(e){for(var t,i,a,n,o,r,s=Fi(e),c=-1,l=this.length-Fi(this),d=this[l-1];++c<l;){for(t=e.slice(),e.length=0,n=this[c],o=t[(a=t.length-s)-1],i=-1;++i<a;)r=t[i],$i(r,d,n)?($i(o,d,n)||e.push(Gi(o,r,d,n)),e.push(r)):$i(o,d,n)&&e.push(Gi(o,r,d,n)),o=r;s&&e.push(e[0]),d=n}return e};var qs,Ys,Xs,Js,Zs,Qs=[],ec=[];Oi.prototype.prepare=function(){for(var e,t=this.edges,i=t.length;i--;)e=t[i].edge,e.b&&e.a||t.splice(i,1);return t.sort(Vi),t.length},Qi.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},ea.prototype={insert:function(e,t){var i,a,n;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;i=e}else this._?(e=na(this._),t.P=null,t.N=e,e.P=e.L=t,i=e):(t.P=t.N=null,this._=t,i=null);for(t.L=t.R=null,t.U=i,t.C=!0,e=t;i&&i.C;)a=i.U,i===a.L?(n=a.R,n&&n.C?(i.C=n.C=!1,a.C=!0,e=a):(e===i.R&&(ia(this,i),e=i,i=e.U),i.C=!1,a.C=!0,aa(this,a))):(n=a.L,n&&n.C?(i.C=n.C=!1,a.C=!0,e=a):(e===i.L&&(aa(this,i),e=i,i=e.U),i.C=!1,a.C=!0,ia(this,a))),i=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,i,a,n=e.U,o=e.L,r=e.R;if(i=o?r?na(r):o:r,n?n.L===e?n.L=i:n.R=i:this._=i,o&&r?(a=i.C,i.C=e.C,i.L=o,o.U=i,i!==r?(n=i.U,i.U=e.U,e=i.R,n.L=e,i.R=r,r.U=i):(i.U=n,n=i,e=i.R)):(a=e.C,e=i),e&&(e.U=n),!a){if(e&&e.C)return void(e.C=!1);do{if(e===this._)break;if(e===n.L){if(t=n.R,t.C&&(t.C=!1,n.C=!0,ia(this,n),t=n.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,aa(this,t),t=n.R),t.C=n.C,n.C=t.R.C=!1,ia(this,n),e=this._;break}}else if(t=n.L,t.C&&(t.C=!1,n.C=!0,aa(this,n),t=n.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,ia(this,t),t=n.L),t.C=n.C,n.C=t.L.C=!1,aa(this,n),e=this._;break}t.C=!0,e=n,n=n.U}while(!e.C);e&&(e.C=!1)}}},Yo.geom.voronoi=function(e){function t(e){var t=new Array(e.length),a=s[0][0],n=s[0][1],o=s[1][0],r=s[1][1];return oa(i(e),s).cells.forEach(function(i,s){var c=i.edges,l=i.site,d=t[s]=c.length?c.map(function(e){var t=e.start();return[t.x,t.y]}):l.x>=a&&l.x<=o&&l.y>=n&&l.y<=r?[[a,r],[o,r],[o,n],[a,n]]:[];d.point=e[s]}),t}function i(e){return e.map(function(e,t){return{x:Math.round(o(e,t)/Ar)*Ar,y:Math.round(r(e,t)/Ar)*Ar,i:t}})}var a=Mi,n=Ti,o=a,r=n,s=tc;return e?t(e):(t.links=function(e){return oa(i(e)).edges.filter(function(e){return e.l&&e.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},t.triangles=function(e){var t=[];return oa(i(e)).cells.forEach(function(i,a){for(var n,o,r=i.site,s=i.edges.sort(Vi),c=-1,l=s.length,d=s[l-1].edge,m=d.l===r?d.r:d.l;++c<l;)n=d,o=m,d=s[c].edge,m=d.l===r?d.r:d.l,a<o.i&&a<m.i&&sa(r,o,m)<0&&t.push([e[a],e[o.i],e[m.i]])}),t},t.x=function(e){return arguments.length?(o=ke(a=e),t):a},t.y=function(e){return arguments.length?(r=ke(n=e),t):n},t.clipExtent=function(e){return arguments.length?(s=null==e?tc:e,t):s===tc?null:s},t.size=function(e){return arguments.length?t.clipExtent(e&&[[0,0],e]):s===tc?null:s&&s[1]},t)};var tc=[[-1e6,-1e6],[1e6,1e6]];Yo.geom.delaunay=function(e){return Yo.geom.voronoi().triangles(e)},Yo.geom.quadtree=function(e,t,i,a,n){function o(e){function o(e,t,i,a,n,o,r,s){if(!isNaN(i)&&!isNaN(a))if(e.leaf){var c=e.x,d=e.y;if(null!=c)if(lr(c-i)+lr(d-a)<.01)l(e,t,i,a,n,o,r,s);else{var m=e.point;e.x=e.y=e.point=null,l(e,m,c,d,n,o,r,s),l(e,t,i,a,n,o,r,s)}else e.x=i,e.y=a,e.point=t}else l(e,t,i,a,n,o,r,s)}function l(e,t,i,a,n,r,s,c){var l=.5*(n+s),d=.5*(r+c),m=i>=l,u=a>=d,h=(u<<1)+m;e.leaf=!1,e=e.nodes[h]||(e.nodes[h]=da()),m?n=l:s=l,u?r=d:c=d,o(e,t,i,a,n,r,s,c)}var d,m,u,h,g,p,y,f,_,v=ke(s),b=ke(c);if(null!=t)p=t,y=i,f=a,_=n;else if(f=_=-(p=y=1/0),m=[],u=[],g=e.length,r)for(h=0;g>h;++h)d=e[h],d.x<p&&(p=d.x),d.y<y&&(y=d.y),d.x>f&&(f=d.x),d.y>_&&(_=d.y),m.push(d.x),u.push(d.y);else for(h=0;g>h;++h){var w=+v(d=e[h],h),S=+b(d,h);p>w&&(p=w),y>S&&(y=S),w>f&&(f=w),S>_&&(_=S),m.push(w),u.push(S)}var C=f-p,x=_-y;C>x?_=y+C:f=p+x;var k=da();if(k.add=function(e){o(k,e,+v(e,++h),+b(e,h),p,y,f,_)},k.visit=function(e){ma(e,k,p,y,f,_)},h=-1,null==t){for(;++h<g;)o(k,e[h],m[h],u[h],p,y,f,_);--h}else e.forEach(k.add);return m=u=e=d=null,k}var r,s=Mi,c=Ti;return(r=arguments.length)?(s=ca,c=la,3===r&&(n=i,a=t,i=t=0),o(e)):(o.x=function(e){return arguments.length?(s=e,o):s},o.y=function(e){return arguments.length?(c=e,o):c},o.extent=function(e){return arguments.length?(null==e?t=i=a=n=null:(t=+e[0][0],i=+e[0][1],a=+e[1][0],n=+e[1][1]),o):null==t?null:[[t,i],[a,n]]},o.size=function(e){return arguments.length?(null==e?t=i=a=n=null:(t=i=0,a=+e[0],n=+e[1]),o):null==t?null:[a-t,n-i]},o)},Yo.interpolateRgb=ua,Yo.interpolateObject=ha,Yo.interpolateNumber=ga,Yo.interpolateString=pa;var ic=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ac=new RegExp(ic.source,"g");Yo.interpolate=ya,Yo.interpolators=[function(e,t){var i=typeof t;return("string"===i?qr.has(t)||/^(#|rgb\(|hsl\()/.test(t)?ua:pa:t instanceof oe?ua:Array.isArray(t)?fa:"object"===i&&isNaN(t)?ha:ga)(e,t)}],Yo.interpolateArray=fa;var nc=function(){return Pe},oc=Yo.map({linear:nc,poly:xa,quad:function(){return wa},cubic:function(){return Sa},sin:function(){return ka},exp:function(){return Pa},circle:function(){return Ma},elastic:Ta,back:Da,bounce:function(){return Aa}}),rc=Yo.map({"in":Pe,out:va,"in-out":ba,"out-in":function(e){return ba(va(e))}});Yo.ease=function(e){var t=e.indexOf("-"),i=t>=0?e.slice(0,t):e,a=t>=0?e.slice(t+1):"in";return i=oc.get(i)||nc,a=rc.get(a)||Pe,_a(a(i.apply(null,Xo.call(arguments,1))))},Yo.interpolateHcl=$a,Yo.interpolateHsl=Ga,Yo.interpolateLab=Fa,Yo.interpolateRound=Na,Yo.transform=function(e){var t=Zo.createElementNS(Yo.ns.prefix.svg,"g");return(Yo.transform=function(e){if(null!=e){t.setAttribute("transform",e);var i=t.transform.baseVal.consolidate()}return new Ra(i?i.matrix:sc)})(e)},Ra.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var sc={a:1,b:0,c:0,d:1,e:0,f:0};Yo.interpolateTransform=Ba,Yo.layout={},Yo.layout.bundle=function(){return function(e){for(var t=[],i=-1,a=e.length;++i<a;)t.push(Ha(e[i]));return t}},Yo.layout.chord=function(){function e(){var e,l,m,u,h,g={},p=[],y=Yo.range(o),f=[];for(i=[],a=[],e=0,u=-1;++u<o;){for(l=0,h=-1;++h<o;)l+=n[u][h];p.push(l),f.push(Yo.range(o)),e+=l}for(r&&y.sort(function(e,t){return r(p[e],p[t])}),s&&f.forEach(function(e,t){e.sort(function(e,i){return s(n[t][e],n[t][i])})}),e=(Tr-d*o)/e,l=0,u=-1;++u<o;){for(m=l,h=-1;++h<o;){var _=y[u],v=f[_][h],b=n[_][v],w=l,S=l+=b*e;g[_+"-"+v]={index:_,subindex:v,startAngle:w,endAngle:S,value:b}}a[_]={index:_,startAngle:m,endAngle:l,value:(l-m)/e},l+=d}for(u=-1;++u<o;)for(h=u-1;++h<o;){var C=g[u+"-"+h],x=g[h+"-"+u];(C.value||x.value)&&i.push(C.value<x.value?{source:x,target:C}:{source:C,target:x})}c&&t()}function t(){i.sort(function(e,t){return c((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)})}var i,a,n,o,r,s,c,l={},d=0;return l.matrix=function(e){return arguments.length?(o=(n=e)&&n.length,i=a=null,l):n},l.padding=function(e){return arguments.length?(d=e,i=a=null,l):d},l.sortGroups=function(e){return arguments.length?(r=e,i=a=null,l):r},l.sortSubgroups=function(e){return arguments.length?(s=e,i=null,l):s},l.sortChords=function(e){return arguments.length?(c=e,i&&t(),l):c},l.chords=function(){return i||e(),i},l.groups=function(){return a||e(),a},l},Yo.layout.force=function(){function e(e){return function(t,i,a,n){if(t.point!==e){var o=t.cx-e.x,r=t.cy-e.y,s=n-i,c=o*o+r*r;if(c>s*s/y){if(g>c){var l=t.charge/c;e.px-=o*l,e.py-=r*l}return!0}if(t.point&&c&&g>c){var l=t.pointCharge/c;e.px-=o*l,e.py-=r*l}}return!t.charge}}function t(e){e.px=Yo.event.x,e.py=Yo.event.y,s.resume()}var i,a,n,o,r,s={},c=Yo.dispatch("start","tick","end"),l=[1,1],d=.9,m=cc,u=lc,h=-30,g=dc,p=.1,y=.64,f=[],_=[];return s.tick=function(){if((a*=.99)<.005)return c.end({type:"end",alpha:a=0}),!0;var t,i,s,m,u,g,y,v,b,w=f.length,S=_.length;for(i=0;S>i;++i)s=_[i],m=s.source,u=s.target,v=u.x-m.x,b=u.y-m.y,(g=v*v+b*b)&&(g=a*o[i]*((g=Math.sqrt(g))-n[i])/g,v*=g,b*=g,u.x-=v*(y=m.weight/(u.weight+m.weight)),u.y-=b*y,m.x+=v*(y=1-y),m.y+=b*y);if((y=a*p)&&(v=l[0]/2,b=l[1]/2,i=-1,y))for(;++i<w;)s=f[i],s.x+=(v-s.x)*y,s.y+=(b-s.y)*y;if(h)for(Ya(t=Yo.geom.quadtree(f),a,r),i=-1;++i<w;)(s=f[i]).fixed||t.visit(e(s));for(i=-1;++i<w;)s=f[i],s.fixed?(s.x=s.px,s.y=s.py):(s.x-=(s.px-(s.px=s.x))*d,s.y-=(s.py-(s.py=s.y))*d);c.tick({type:"tick",alpha:a})},s.nodes=function(e){return arguments.length?(f=e,s):f},s.links=function(e){return arguments.length?(_=e,s):_},s.size=function(e){return arguments.length?(l=e,s):l},s.linkDistance=function(e){return arguments.length?(m="function"==typeof e?e:+e,s):m},s.distance=s.linkDistance,s.linkStrength=function(e){return arguments.length?(u="function"==typeof e?e:+e,s):u},s.friction=function(e){return arguments.length?(d=+e,s):d},s.charge=function(e){return arguments.length?(h="function"==typeof e?e:+e,s):h},s.chargeDistance=function(e){return arguments.length?(g=e*e,s):Math.sqrt(g)},s.gravity=function(e){return arguments.length?(p=+e,s):p},s.theta=function(e){return arguments.length?(y=e*e,s):Math.sqrt(y)},s.alpha=function(e){return arguments.length?(e=+e,a?a=e>0?e:0:e>0&&(c.start({type:"start",alpha:a=e}),Yo.timer(s.tick)),s):a},s.start=function(){function e(e,a){if(!i){for(i=new Array(c),s=0;c>s;++s)i[s]=[];for(s=0;l>s;++s){var n=_[s];i[n.source.index].push(n.target),i[n.target.index].push(n.source)}}for(var o,r=i[t],s=-1,l=r.length;++s<l;)if(!isNaN(o=r[s][e]))return o;return Math.random()*a}var t,i,a,c=f.length,d=_.length,g=l[0],p=l[1];for(t=0;c>t;++t)(a=f[t]).index=t,a.weight=0;for(t=0;d>t;++t)a=_[t],"number"==typeof a.source&&(a.source=f[a.source]),"number"==typeof a.target&&(a.target=f[a.target]),++a.source.weight,++a.target.weight;for(t=0;c>t;++t)a=f[t],isNaN(a.x)&&(a.x=e("x",g)),isNaN(a.y)&&(a.y=e("y",p)),isNaN(a.px)&&(a.px=a.x),isNaN(a.py)&&(a.py=a.y);if(n=[],"function"==typeof m)for(t=0;d>t;++t)n[t]=+m.call(this,_[t],t);else for(t=0;d>t;++t)n[t]=m;if(o=[],"function"==typeof u)for(t=0;d>t;++t)o[t]=+u.call(this,_[t],t);else for(t=0;d>t;++t)o[t]=u;if(r=[],"function"==typeof h)for(t=0;c>t;++t)r[t]=+h.call(this,f[t],t);else for(t=0;c>t;++t)r[t]=h;return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){return i||(i=Yo.behavior.drag().origin(Pe).on("dragstart.force",za).on("drag.force",t).on("dragend.force",Ka)),arguments.length?void this.on("mouseover.force",ja).on("mouseout.force",qa).call(i):i},Yo.rebind(s,c,"on")};var cc=20,lc=1,dc=1/0;Yo.layout.hierarchy=function(){function e(n){var o,r=[n],s=[];for(n.depth=0;null!=(o=r.pop());)if(s.push(o),(l=i.call(e,o,o.depth))&&(c=l.length)){for(var c,l,d;--c>=0;)r.push(d=l[c]),d.parent=o,d.depth=o.depth+1;a&&(o.value=0),o.children=l}else a&&(o.value=+a.call(e,o,o.depth)||0),delete o.children;return Za(n,function(e){var i,n;t&&(i=e.children)&&i.sort(t),a&&(n=e.parent)&&(n.value+=e.value)}),s}var t=tn,i=Qa,a=en;return e.sort=function(i){return arguments.length?(t=i,e):t},e.children=function(t){return arguments.length?(i=t,e):i},e.value=function(t){return arguments.length?(a=t,e):a},e.revalue=function(t){return a&&(Ja(t,function(e){e.children&&(e.value=0)}),Za(t,function(t){var i;t.children||(t.value=+a.call(e,t,t.depth)||0),(i=t.parent)&&(i.value+=t.value)})),t},e},Yo.layout.partition=function(){function e(t,i,a,n){var o=t.children;if(t.x=i,t.y=t.depth*n,t.dx=a,t.dy=n,o&&(r=o.length)){var r,s,c,l=-1;for(a=t.value?a/t.value:0;++l<r;)e(s=o[l],i,c=s.value*a,n),i+=c}}function t(e){var i=e.children,a=0;if(i&&(n=i.length))for(var n,o=-1;++o<n;)a=Math.max(a,t(i[o]));return 1+a}function i(i,o){var r=a.call(this,i,o);return e(r[0],0,n[0],n[1]/t(r[0])),r}var a=Yo.layout.hierarchy(),n=[1,1];return i.size=function(e){return arguments.length?(n=e,i):n},Xa(i,a)},Yo.layout.pie=function(){function e(o){var r=o.map(function(i,a){return+t.call(e,i,a)}),s=+("function"==typeof a?a.apply(this,arguments):a),c=(("function"==typeof n?n.apply(this,arguments):n)-s)/Yo.sum(r),l=Yo.range(o.length);null!=i&&l.sort(i===mc?function(e,t){return r[t]-r[e]}:function(e,t){return i(o[e],o[t])});var d=[];return l.forEach(function(e){var t;d[e]={data:o[e],value:t=r[e],startAngle:s,endAngle:s+=t*c}}),d}var t=Number,i=mc,a=0,n=Tr;return e.value=function(i){return arguments.length?(t=i,e):t},e.sort=function(t){return arguments.length?(i=t,e):i},e.startAngle=function(t){return arguments.length?(a=t,e):a},e.endAngle=function(t){return arguments.length?(n=t,e):n},e};var mc={};Yo.layout.stack=function(){function e(s,c){if(!(u=s.length))return s;var l=s.map(function(i,a){return t.call(e,i,a)}),d=l.map(function(t){return t.map(function(t,i){return[o.call(e,t,i),r.call(e,t,i)]})}),m=i.call(e,d,c);l=Yo.permute(l,m),d=Yo.permute(d,m);var u,h,g,p,y=a.call(e,d,c),f=l[0].length;for(g=0;f>g;++g)for(n.call(e,l[0][g],p=y[g],d[0][g][1]),h=1;u>h;++h)n.call(e,l[h][g],p+=d[h-1][g][1],d[h][g][1]);return s}var t=Pe,i=sn,a=cn,n=rn,o=nn,r=on;return e.values=function(i){return arguments.length?(t=i,e):t},e.order=function(t){return arguments.length?(i="function"==typeof t?t:uc.get(t)||sn,e):i},e.offset=function(t){return arguments.length?(a="function"==typeof t?t:hc.get(t)||cn,e):a},e.x=function(t){return arguments.length?(o=t,e):o},e.y=function(t){return arguments.length?(r=t,e):r},e.out=function(t){return arguments.length?(n=t,e):n},e};var uc=Yo.map({"inside-out":function(e){var t,i,a=e.length,n=e.map(ln),o=e.map(dn),r=Yo.range(a).sort(function(e,t){return n[e]-n[t]}),s=0,c=0,l=[],d=[];for(t=0;a>t;++t)i=r[t],c>s?(s+=o[i],l.push(i)):(c+=o[i],d.push(i));return d.reverse().concat(l)},reverse:function(e){return Yo.range(e.length).reverse()},"default":sn}),hc=Yo.map({silhouette:function(e){var t,i,a,n=e.length,o=e[0].length,r=[],s=0,c=[];for(i=0;o>i;++i){for(t=0,a=0;n>t;t++)a+=e[t][i][1];a>s&&(s=a),r.push(a)}for(i=0;o>i;++i)c[i]=(s-r[i])/2;return c},wiggle:function(e){var t,i,a,n,o,r,s,c,l,d=e.length,m=e[0],u=m.length,h=[];for(h[0]=c=l=0,i=1;u>i;++i){for(t=0,n=0;d>t;++t)n+=e[t][i][1];for(t=0,o=0,s=m[i][0]-m[i-1][0];d>t;++t){for(a=0,r=(e[t][i][1]-e[t][i-1][1])/(2*s);t>a;++a)r+=(e[a][i][1]-e[a][i-1][1])/s;o+=r*e[t][i][1]}h[i]=c-=n?o/n*s:0,l>c&&(l=c)}for(i=0;u>i;++i)h[i]-=l;return h},expand:function(e){var t,i,a,n=e.length,o=e[0].length,r=1/n,s=[];for(i=0;o>i;++i){for(t=0,a=0;n>t;t++)a+=e[t][i][1];if(a)for(t=0;n>t;t++)e[t][i][1]/=a;else for(t=0;n>t;t++)e[t][i][1]=r}for(i=0;o>i;++i)s[i]=0;return s},zero:cn});Yo.layout.histogram=function(){function e(e,o){for(var r,s,c=[],l=e.map(i,this),d=a.call(this,l,o),m=n.call(this,d,l,o),o=-1,u=l.length,h=m.length-1,g=t?1:1/u;++o<h;)r=c[o]=[],r.dx=m[o+1]-(r.x=m[o]),r.y=0;if(h>0)for(o=-1;++o<u;)s=l[o],s>=d[0]&&s<=d[1]&&(r=c[Yo.bisect(m,s,1,h)-1],r.y+=g,r.push(e[o]));return c}var t=!0,i=Number,a=gn,n=un;return e.value=function(t){return arguments.length?(i=t,e):i},e.range=function(t){return arguments.length?(a=ke(t),e):a},e.bins=function(t){return arguments.length?(n="number"==typeof t?function(e){return hn(e,t)}:ke(t),e):n},e.frequency=function(i){return arguments.length?(t=!!i,e):t},e},Yo.layout.pack=function(){function e(e,o){var r=i.call(this,e,o),s=r[0],c=n[0],l=n[1],d=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(s.x=s.y=0,Za(s,function(e){e.r=+d(e.value)}),Za(s,vn),a){var m=a*(t?1:Math.max(2*s.r/c,2*s.r/l))/2;Za(s,function(e){e.r+=m}),Za(s,vn),Za(s,function(e){e.r-=m})}return Sn(s,c/2,l/2,t?1:1/Math.max(2*s.r/c,2*s.r/l)),r}var t,i=Yo.layout.hierarchy().sort(pn),a=0,n=[1,1];return e.size=function(t){return arguments.length?(n=t,e):n},e.radius=function(i){return arguments.length?(t=null==i||"function"==typeof i?i:+i,e):t},e.padding=function(t){return arguments.length?(a=+t,e):a},Xa(e,i)},Yo.layout.tree=function(){function e(e,n){var d=r.call(this,e,n),m=d[0],u=t(m);if(Za(u,i),u.parent.m=-u.z,Ja(u,a),l)Ja(m,o);else{var h=m,g=m,p=m;Ja(m,function(e){e.x<h.x&&(h=e),e.x>g.x&&(g=e),e.depth>p.depth&&(p=e)});var y=s(h,g)/2-h.x,f=c[0]/(g.x+s(g,h)/2+y),_=c[1]/(p.depth||1);Ja(m,function(e){e.x=(e.x+y)*f,e.y=e.depth*_})}return d}function t(e){for(var t,i={A:null,children:[e]},a=[i];null!=(t=a.pop());)for(var n,o=t.children,r=0,s=o.length;s>r;++r)a.push((o[r]=n={_:o[r],parent:t,children:(n=o[r].children)&&n.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:r}).a=n);return i.children[0]}function i(e){var t=e.children,i=e.parent.children,a=e.i?i[e.i-1]:null;if(t.length){Tn(e);var o=(t[0].z+t[t.length-1].z)/2;a?(e.z=a.z+s(e._,a._),e.m=e.z-o):e.z=o}else a&&(e.z=a.z+s(e._,a._));e.parent.A=n(e,a,e.parent.A||i[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function n(e,t,i){if(t){for(var a,n=e,o=e,r=t,c=n.parent.children[0],l=n.m,d=o.m,m=r.m,u=c.m;r=Pn(r),n=kn(n),r&&n;)c=kn(c),o=Pn(o),o.a=e,a=r.z+m-n.z-l+s(r._,n._),a>0&&(Mn(Dn(r,e,i),e,a),l+=a,d+=a),m+=r.m,l+=n.m,u+=c.m,d+=o.m;r&&!Pn(o)&&(o.t=r,o.m+=m-d),n&&!kn(c)&&(c.t=n,c.m+=l-u,i=e)}return i}function o(e){e.x*=c[0],e.y=e.depth*c[1]}var r=Yo.layout.hierarchy().sort(null).value(null),s=xn,c=[1,1],l=null;return e.separation=function(t){return arguments.length?(s=t,e):s},e.size=function(t){return arguments.length?(l=null==(c=t)?o:null,e):l?null:c},e.nodeSize=function(t){return arguments.length?(l=null==(c=t)?null:o,e):l?c:null},Xa(e,r)},Yo.layout.cluster=function(){function e(e,o){var r,s=t.call(this,e,o),c=s[0],l=0;Za(c,function(e){var t=e.children;t&&t.length?(e.x=$n(t),e.y=An(t)):(e.x=r?l+=i(e,r):0,e.y=0,r=e)});var d=Gn(c),m=Fn(c),u=d.x-i(d,m)/2,h=m.x+i(m,d)/2;return Za(c,n?function(e){e.x=(e.x-c.x)*a[0],e.y=(c.y-e.y)*a[1]}:function(e){e.x=(e.x-u)/(h-u)*a[0],e.y=(1-(c.y?e.y/c.y:1))*a[1]}),s}var t=Yo.layout.hierarchy().sort(null).value(null),i=xn,a=[1,1],n=!1;return e.separation=function(t){return arguments.length?(i=t,e):i},e.size=function(t){return arguments.length?(n=null==(a=t),e):n?null:a},e.nodeSize=function(t){return arguments.length?(n=null!=(a=t),e):n?a:null},Xa(e,t)},Yo.layout.treemap=function(){function e(e,t){for(var i,a,n=-1,o=e.length;++n<o;)a=(i=e[n]).value*(0>t?0:t),i.area=isNaN(a)||0>=a?0:a}function t(i){var o=i.children;if(o&&o.length){var r,s,c,l=m(i),d=[],u=o.slice(),g=1/0,p="slice"===h?l.dx:"dice"===h?l.dy:"slice-dice"===h?1&i.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(e(u,l.dx*l.dy/i.value),d.area=0;(c=u.length)>0;)d.push(r=u[c-1]),d.area+=r.area,"squarify"!==h||(s=a(d,p))<=g?(u.pop(),g=s):(d.area-=d.pop().area,n(d,p,l,!1),
p=Math.min(l.dx,l.dy),d.length=d.area=0,g=1/0);d.length&&(n(d,p,l,!0),d.length=d.area=0),o.forEach(t)}}function i(t){var a=t.children;if(a&&a.length){var o,r=m(t),s=a.slice(),c=[];for(e(s,r.dx*r.dy/t.value),c.area=0;o=s.pop();)c.push(o),c.area+=o.area,null!=o.z&&(n(c,o.z?r.dx:r.dy,r,!s.length),c.length=c.area=0);a.forEach(i)}}function a(e,t){for(var i,a=e.area,n=0,o=1/0,r=-1,s=e.length;++r<s;)(i=e[r].area)&&(o>i&&(o=i),i>n&&(n=i));return a*=a,t*=t,a?Math.max(t*n*g/a,a/(t*o*g)):1/0}function n(e,t,i,a){var n,o=-1,r=e.length,s=i.x,l=i.y,d=t?c(e.area/t):0;if(t==i.dx){for((a||d>i.dy)&&(d=i.dy);++o<r;)n=e[o],n.x=s,n.y=l,n.dy=d,s+=n.dx=Math.min(i.x+i.dx-s,d?c(n.area/d):0);n.z=!0,n.dx+=i.x+i.dx-s,i.y+=d,i.dy-=d}else{for((a||d>i.dx)&&(d=i.dx);++o<r;)n=e[o],n.x=s,n.y=l,n.dx=d,l+=n.dy=Math.min(i.y+i.dy-l,d?c(n.area/d):0);n.z=!1,n.dy+=i.y+i.dy-l,i.x+=d,i.dx-=d}}function o(a){var n=r||s(a),o=n[0];return o.x=0,o.y=0,o.dx=l[0],o.dy=l[1],r&&s.revalue(o),e([o],o.dx*o.dy/o.value),(r?i:t)(o),u&&(r=n),n}var r,s=Yo.layout.hierarchy(),c=Math.round,l=[1,1],d=null,m=Nn,u=!1,h="squarify",g=.5*(1+Math.sqrt(5));return o.size=function(e){return arguments.length?(l=e,o):l},o.padding=function(e){function t(t){var i=e.call(o,t,t.depth);return null==i?Nn(t):Rn(t,"number"==typeof i?[i,i,i,i]:i)}function i(t){return Rn(t,e)}if(!arguments.length)return d;var a;return m=null==(d=e)?Nn:"function"==(a=typeof e)?t:"number"===a?(e=[e,e,e,e],i):i,o},o.round=function(e){return arguments.length?(c=e?Math.round:Number,o):c!=Number},o.sticky=function(e){return arguments.length?(u=e,r=null,o):u},o.ratio=function(e){return arguments.length?(g=e,o):g},o.mode=function(e){return arguments.length?(h=e+"",o):h},Xa(o,s)},Yo.random={normal:function(e,t){var i=arguments.length;return 2>i&&(t=1),1>i&&(e=0),function(){var i,a,n;do i=2*Math.random()-1,a=2*Math.random()-1,n=i*i+a*a;while(!n||n>1);return e+t*i*Math.sqrt(-2*Math.log(n)/n)}},logNormal:function(){var e=Yo.random.normal.apply(Yo,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=Yo.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,i=0;e>i;i++)t+=Math.random();return t}}},Yo.scale={};var gc={floor:Pe,ceil:Pe};Yo.scale.linear=function(){return Hn([0,1],[0,1],ya,!1)};var pc={s:1,g:1,p:1,r:1,e:1};Yo.scale.log=function(){return Xn(Yo.scale.linear().domain([0,1]),10,!0,[1,10])};var yc=Yo.format(".0e"),fc={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};Yo.scale.pow=function(){return Jn(Yo.scale.linear(),1,[0,1])},Yo.scale.sqrt=function(){return Yo.scale.pow().exponent(.5)},Yo.scale.ordinal=function(){return Qn([],{t:"range",a:[[]]})},Yo.scale.category10=function(){return Yo.scale.ordinal().range(_c)},Yo.scale.category20=function(){return Yo.scale.ordinal().range(vc)},Yo.scale.category20b=function(){return Yo.scale.ordinal().range(bc)},Yo.scale.category20c=function(){return Yo.scale.ordinal().range(wc)};var _c=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_e),vc=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_e),bc=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_e),wc=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_e);Yo.scale.quantile=function(){return eo([],[])},Yo.scale.quantize=function(){return to(0,1,[0,1])},Yo.scale.threshold=function(){return io([.5],[0,1])},Yo.scale.identity=function(){return ao([0,1])},Yo.svg={},Yo.svg.arc=function(){function e(){var e=t.apply(this,arguments),o=i.apply(this,arguments),r=a.apply(this,arguments)+Sc,s=n.apply(this,arguments)+Sc,c=(r>s&&(c=r,r=s,s=c),s-r),l=Mr>c?"0":"1",d=Math.cos(r),m=Math.sin(r),u=Math.cos(s),h=Math.sin(s);return c>=Cc?e?"M0,"+o+"A"+o+","+o+" 0 1,1 0,"+-o+"A"+o+","+o+" 0 1,1 0,"+o+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+-e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+o+"A"+o+","+o+" 0 1,1 0,"+-o+"A"+o+","+o+" 0 1,1 0,"+o+"Z":e?"M"+o*d+","+o*m+"A"+o+","+o+" 0 "+l+",1 "+o*u+","+o*h+"L"+e*u+","+e*h+"A"+e+","+e+" 0 "+l+",0 "+e*d+","+e*m+"Z":"M"+o*d+","+o*m+"A"+o+","+o+" 0 "+l+",1 "+o*u+","+o*h+"L0,0Z"}var t=no,i=oo,a=ro,n=so;return e.innerRadius=function(i){return arguments.length?(t=ke(i),e):t},e.outerRadius=function(t){return arguments.length?(i=ke(t),e):i},e.startAngle=function(t){return arguments.length?(a=ke(t),e):a},e.endAngle=function(t){return arguments.length?(n=ke(t),e):n},e.centroid=function(){var e=(t.apply(this,arguments)+i.apply(this,arguments))/2,o=(a.apply(this,arguments)+n.apply(this,arguments))/2+Sc;return[Math.cos(o)*e,Math.sin(o)*e]},e};var Sc=-Dr,Cc=Tr-Ar;Yo.svg.line=function(){return co(Pe)};var xc=Yo.map({linear:lo,"linear-closed":mo,step:uo,"step-before":ho,"step-after":go,basis:bo,"basis-open":wo,"basis-closed":So,bundle:Co,cardinal:fo,"cardinal-open":po,"cardinal-closed":yo,monotone:Do});xc.forEach(function(e,t){t.key=e,t.closed=/-closed$/.test(e)});var kc=[0,2/3,1/3,0],Pc=[0,1/3,2/3,0],Mc=[0,1/6,2/3,1/6];Yo.svg.line.radial=function(){var e=co(Ao);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},ho.reverse=go,go.reverse=ho,Yo.svg.area=function(){return $o(Pe)},Yo.svg.area.radial=function(){var e=$o(Ao);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},Yo.svg.chord=function(){function e(e,s){var c=t(this,o,e,s),l=t(this,r,e,s);return"M"+c.p0+a(c.r,c.p1,c.a1-c.a0)+(i(c,l)?n(c.r,c.p1,c.r,c.p0):n(c.r,c.p1,l.r,l.p0)+a(l.r,l.p1,l.a1-l.a0)+n(l.r,l.p1,c.r,c.p0))+"Z"}function t(e,t,i,a){var n=t.call(e,i,a),o=s.call(e,n,a),r=c.call(e,n,a)+Sc,d=l.call(e,n,a)+Sc;return{r:o,a0:r,a1:d,p0:[o*Math.cos(r),o*Math.sin(r)],p1:[o*Math.cos(d),o*Math.sin(d)]}}function i(e,t){return e.a0==t.a0&&e.a1==t.a1}function a(e,t,i){return"A"+e+","+e+" 0 "+ +(i>Mr)+",1 "+t}function n(e,t,i,a){return"Q 0,0 "+a}var o=fi,r=_i,s=Go,c=ro,l=so;return e.radius=function(t){return arguments.length?(s=ke(t),e):s},e.source=function(t){return arguments.length?(o=ke(t),e):o},e.target=function(t){return arguments.length?(r=ke(t),e):r},e.startAngle=function(t){return arguments.length?(c=ke(t),e):c},e.endAngle=function(t){return arguments.length?(l=ke(t),e):l},e},Yo.svg.diagonal=function(){function e(e,n){var o=t.call(this,e,n),r=i.call(this,e,n),s=(o.y+r.y)/2,c=[o,{x:o.x,y:s},{x:r.x,y:s},r];return c=c.map(a),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=fi,i=_i,a=Fo;return e.source=function(i){return arguments.length?(t=ke(i),e):t},e.target=function(t){return arguments.length?(i=ke(t),e):i},e.projection=function(t){return arguments.length?(a=t,e):a},e},Yo.svg.diagonal.radial=function(){var e=Yo.svg.diagonal(),t=Fo,i=e.projection;return e.projection=function(e){return arguments.length?i(No(t=e)):t},e},Yo.svg.symbol=function(){function e(e,a){return(Tc.get(t.call(this,e,a))||Eo)(i.call(this,e,a))}var t=Io,i=Ro;return e.type=function(i){return arguments.length?(t=ke(i),e):t},e.size=function(t){return arguments.length?(i=ke(t),e):i},e};var Tc=Yo.map({circle:Eo,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Gc)),i=t*Gc;return"M0,"+-t+"L"+i+",0 0,"+t+" "+-i+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/$c),i=t*$c/2;return"M0,"+i+"L"+t+","+-i+" "+-t+","+-i+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/$c),i=t*$c/2;return"M0,"+-i+"L"+t+","+i+" "+-t+","+i+"Z"}});Yo.svg.symbolTypes=Tc.keys();var Dc,Ac,$c=Math.sqrt(3),Gc=Math.tan(30*Gr),Fc=[],Nc=0;Fc.call=vr.call,Fc.empty=vr.empty,Fc.node=vr.node,Fc.size=vr.size,Yo.transition=function(e){return arguments.length?Dc?e.transition():e:Sr.transition()},Yo.transition.prototype=Fc,Fc.select=function(e){var t,i,a,n=this.id,o=[];e=k(e);for(var r=-1,s=this.length;++r<s;){o.push(t=[]);for(var c=this[r],l=-1,d=c.length;++l<d;)(a=c[l])&&(i=e.call(a,a.__data__,l,r))?("__data__"in a&&(i.__data__=a.__data__),Oo(i,l,n,a.__transition__[n]),t.push(i)):t.push(null)}return Lo(o,n)},Fc.selectAll=function(e){var t,i,a,n,o,r=this.id,s=[];e=P(e);for(var c=-1,l=this.length;++c<l;)for(var d=this[c],m=-1,u=d.length;++m<u;)if(a=d[m]){o=a.__transition__[r],i=e.call(a,a.__data__,m,c),s.push(t=[]);for(var h=-1,g=i.length;++h<g;)(n=i[h])&&Oo(n,h,r,o),t.push(n)}return Lo(s,r)},Fc.filter=function(e){var t,i,a,n=[];"function"!=typeof e&&(e=E(e));for(var o=0,r=this.length;r>o;o++){n.push(t=[]);for(var i=this[o],s=0,c=i.length;c>s;s++)(a=i[s])&&e.call(a,a.__data__,s,o)&&t.push(a)}return Lo(n,this.id)},Fc.tween=function(e,t){var i=this.id;return arguments.length<2?this.node().__transition__[i].tween.get(e):B(this,null==t?function(t){t.__transition__[i].tween.remove(e)}:function(a){a.__transition__[i].tween.set(e,t)})},Fc.attr=function(e,t){function i(){this.removeAttribute(s)}function a(){this.removeAttributeNS(s.space,s.local)}function n(e){return null==e?i:(e+="",function(){var t,i=this.getAttribute(s);return i!==e&&(t=r(i,e),function(e){this.setAttribute(s,t(e))})})}function o(e){return null==e?a:(e+="",function(){var t,i=this.getAttributeNS(s.space,s.local);return i!==e&&(t=r(i,e),function(e){this.setAttributeNS(s.space,s.local,t(e))})})}if(arguments.length<2){for(t in e)this.attr(t,e[t]);return this}var r="transform"==e?Ba:ya,s=Yo.ns.qualify(e);return Bo(this,"attr."+e,t,s.local?o:n)},Fc.attrTween=function(e,t){function i(e,i){var a=t.call(this,e,i,this.getAttribute(n));return a&&function(e){this.setAttribute(n,a(e))}}function a(e,i){var a=t.call(this,e,i,this.getAttributeNS(n.space,n.local));return a&&function(e){this.setAttributeNS(n.space,n.local,a(e))}}var n=Yo.ns.qualify(e);return this.tween("attr."+e,n.local?a:i)},Fc.style=function(e,t,i){function a(){this.style.removeProperty(e)}function n(t){return null==t?a:(t+="",function(){var a,n=er.getComputedStyle(this,null).getPropertyValue(e);return n!==t&&(a=ya(n,t),function(t){this.style.setProperty(e,a(t),i)})})}var o=arguments.length;if(3>o){if("string"!=typeof e){2>o&&(t="");for(i in e)this.style(i,e[i],t);return this}i=""}return Bo(this,"style."+e,t,n)},Fc.styleTween=function(e,t,i){function a(a,n){var o=t.call(this,a,n,er.getComputedStyle(this,null).getPropertyValue(e));return o&&function(t){this.style.setProperty(e,o(t),i)}}return arguments.length<3&&(i=""),this.tween("style."+e,a)},Fc.text=function(e){return Bo(this,"text",e,Uo)},Fc.remove=function(){return this.each("end.transition",function(){var e;this.__transition__.count<2&&(e=this.parentNode)&&e.removeChild(this)})},Fc.ease=function(e){var t=this.id;return arguments.length<1?this.node().__transition__[t].ease:("function"!=typeof e&&(e=Yo.ease.apply(Yo,arguments)),B(this,function(i){i.__transition__[t].ease=e}))},Fc.delay=function(e){var t=this.id;return arguments.length<1?this.node().__transition__[t].delay:B(this,"function"==typeof e?function(i,a,n){i.__transition__[t].delay=+e.call(i,i.__data__,a,n)}:(e=+e,function(i){i.__transition__[t].delay=e}))},Fc.duration=function(e){var t=this.id;return arguments.length<1?this.node().__transition__[t].duration:B(this,"function"==typeof e?function(i,a,n){i.__transition__[t].duration=Math.max(1,e.call(i,i.__data__,a,n))}:(e=Math.max(1,e),function(i){i.__transition__[t].duration=e}))},Fc.each=function(e,t){var i=this.id;if(arguments.length<2){var a=Ac,n=Dc;Dc=i,B(this,function(t,a,n){Ac=t.__transition__[i],e.call(t,t.__data__,a,n)}),Ac=a,Dc=n}else B(this,function(a){var n=a.__transition__[i];(n.event||(n.event=Yo.dispatch("start","end"))).on(e,t)});return this},Fc.transition=function(){for(var e,t,i,a,n=this.id,o=++Nc,r=[],s=0,c=this.length;c>s;s++){r.push(e=[]);for(var t=this[s],l=0,d=t.length;d>l;l++)(i=t[l])&&(a=Object.create(i.__transition__[n]),a.delay+=a.duration,Oo(i,l,o,a)),e.push(i)}return Lo(r,o)},Yo.svg.axis=function(){function e(e){e.each(function(){var e,l=Yo.select(this),d=this.__chart__||i,m=this.__chart__=i.copy(),u=null==c?m.ticks?m.ticks.apply(m,s):m.domain():c,h=null==t?m.tickFormat?m.tickFormat.apply(m,s):Pe:t,g=l.selectAll(".tick").data(u,m),p=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Ar),y=Yo.transition(g.exit()).style("opacity",Ar).remove(),f=Yo.transition(g.order()).style("opacity",1),_=Math.max(n,0)+r,v=En(m),b=l.selectAll(".domain").data([0]),w=(b.enter().append("path").attr("class","domain"),Yo.transition(b));p.append("line"),p.append("text");var S,C,x,k,P=p.select("line"),M=f.select("line"),T=g.select("text").text(h),D=p.select("text"),A=f.select("text"),$="top"===a||"left"===a?-1:1;if("bottom"===a||"top"===a?(e=Ho,S="x",x="y",C="x2",k="y2",T.attr("dy",0>$?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+v[0]+","+$*o+"V0H"+v[1]+"V"+$*o)):(e=Vo,S="y",x="x",C="y2",k="x2",T.attr("dy",".32em").style("text-anchor",0>$?"end":"start"),w.attr("d","M"+$*o+","+v[0]+"H0V"+v[1]+"H"+$*o)),P.attr(k,$*n),D.attr(x,$*_),M.attr(C,0).attr(k,$*n),A.attr(S,0).attr(x,$*_),m.rangeBand){var G=m,F=G.rangeBand()/2;d=m=function(e){return G(e)+F}}else d.rangeBand?d=m:y.call(e,m,d);p.call(e,d,m),f.call(e,m,m)})}var t,i=Yo.scale.linear(),a=Rc,n=6,o=6,r=3,s=[10],c=null;return e.scale=function(t){return arguments.length?(i=t,e):i},e.orient=function(t){return arguments.length?(a=t in Ic?t+"":Rc,e):a},e.ticks=function(){return arguments.length?(s=arguments,e):s},e.tickValues=function(t){return arguments.length?(c=t,e):c},e.tickFormat=function(i){return arguments.length?(t=i,e):t},e.tickSize=function(t){var i=arguments.length;return i?(n=+t,o=+arguments[i-1],e):n},e.innerTickSize=function(t){return arguments.length?(n=+t,e):n},e.outerTickSize=function(t){return arguments.length?(o=+t,e):o},e.tickPadding=function(t){return arguments.length?(r=+t,e):r},e.tickSubdivide=function(){return arguments.length&&e},e};var Rc="bottom",Ic={top:1,right:1,bottom:1,left:1};Yo.svg.brush=function(){function e(o){o.each(function(){var o=Yo.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",n).on("touchstart.brush",n),r=o.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),o.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=o.selectAll(".resize").data(g,Pe);s.exit().remove(),s.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return Ec[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),s.style("display",e.empty()?"none":null);var d,m=Yo.transition(o),u=Yo.transition(r);c&&(d=En(c),u.attr("x",d[0]).attr("width",d[1]-d[0]),i(m)),l&&(d=En(l),u.attr("y",d[0]).attr("height",d[1]-d[0]),a(m)),t(m)})}function t(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+d[+/e$/.test(e)]+","+m[+/^s/.test(e)]+")"})}function i(e){e.select(".extent").attr("x",d[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",d[1]-d[0])}function a(e){e.select(".extent").attr("y",m[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",m[1]-m[0])}function n(){function n(){32==Yo.event.keyCode&&(T||(_=null,A[0]-=d[1],A[1]-=m[1],T=2),w())}function g(){32==Yo.event.keyCode&&2==T&&(A[0]+=d[1],A[1]+=m[1],T=0,w())}function p(){var e=Yo.mouse(b),n=!1;v&&(e[0]+=v[0],e[1]+=v[1]),T||(Yo.event.altKey?(_||(_=[(d[0]+d[1])/2,(m[0]+m[1])/2]),A[0]=d[+(e[0]<_[0])],A[1]=m[+(e[1]<_[1])]):_=null),P&&y(e,c,0)&&(i(x),n=!0),M&&y(e,l,1)&&(a(x),n=!0),n&&(t(x),C({type:"brush",mode:T?"move":"resize"}))}function y(e,t,i){var a,n,s=En(t),c=s[0],l=s[1],g=A[i],p=i?m:d,y=p[1]-p[0];return T&&(c-=g,l-=y+g),a=(i?h:u)?Math.max(c,Math.min(l,e[i])):e[i],T?n=(a+=g)+y:(_&&(g=Math.max(c,Math.min(l,2*_[i]-a))),a>g?(n=a,a=g):n=g),p[0]!=a||p[1]!=n?(i?r=null:o=null,p[0]=a,p[1]=n,!0):void 0}function f(){p(),x.style("pointer-events","all").selectAll(".resize").style("display",e.empty()?"none":null),Yo.select("body").style("cursor",null),$.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),D(),C({type:"brushend"})}var _,v,b=this,S=Yo.select(Yo.event.target),C=s.of(b,arguments),x=Yo.select(b),k=S.datum(),P=!/^(n|s)$/.test(k)&&c,M=!/^(e|w)$/.test(k)&&l,T=S.classed("extent"),D=K(),A=Yo.mouse(b),$=Yo.select(er).on("keydown.brush",n).on("keyup.brush",g);if(Yo.event.changedTouches?$.on("touchmove.brush",p).on("touchend.brush",f):$.on("mousemove.brush",p).on("mouseup.brush",f),x.interrupt().selectAll("*").interrupt(),T)A[0]=d[0]-A[0],A[1]=m[0]-A[1];else if(k){var G=+/w$/.test(k),F=+/^n/.test(k);v=[d[1-G]-A[0],m[1-F]-A[1]],A[0]=d[G],A[1]=m[F]}else Yo.event.altKey&&(_=A.slice());x.style("pointer-events","none").selectAll(".resize").style("display",null),Yo.select("body").style("cursor",S.style("cursor")),C({type:"brushstart"}),p()}var o,r,s=C(e,"brushstart","brush","brushend"),c=null,l=null,d=[0,0],m=[0,0],u=!0,h=!0,g=Lc[0];return e.event=function(e){e.each(function(){var e=s.of(this,arguments),t={x:d,y:m,i:o,j:r},i=this.__chart__||t;this.__chart__=t,Dc?Yo.select(this).transition().each("start.brush",function(){o=i.i,r=i.j,d=i.x,m=i.y,e({type:"brushstart"})}).tween("brush:brush",function(){var i=fa(d,t.x),a=fa(m,t.y);return o=r=null,function(n){d=t.x=i(n),m=t.y=a(n),e({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,r=t.j,e({type:"brush",mode:"resize"}),e({type:"brushend"})}):(e({type:"brushstart"}),e({type:"brush",mode:"resize"}),e({type:"brushend"}))})},e.x=function(t){return arguments.length?(c=t,g=Lc[!c<<1|!l],e):c},e.y=function(t){return arguments.length?(l=t,g=Lc[!c<<1|!l],e):l},e.clamp=function(t){return arguments.length?(c&&l?(u=!!t[0],h=!!t[1]):c?u=!!t:l&&(h=!!t),e):c&&l?[u,h]:c?u:l?h:null},e.extent=function(t){var i,a,n,s,u;return arguments.length?(c&&(i=t[0],a=t[1],l&&(i=i[0],a=a[0]),o=[i,a],c.invert&&(i=c(i),a=c(a)),i>a&&(u=i,i=a,a=u),(i!=d[0]||a!=d[1])&&(d=[i,a])),l&&(n=t[0],s=t[1],c&&(n=n[1],s=s[1]),r=[n,s],l.invert&&(n=l(n),s=l(s)),n>s&&(u=n,n=s,s=u),(n!=m[0]||s!=m[1])&&(m=[n,s])),e):(c&&(o?(i=o[0],a=o[1]):(i=d[0],a=d[1],c.invert&&(i=c.invert(i),a=c.invert(a)),i>a&&(u=i,i=a,a=u))),l&&(r?(n=r[0],s=r[1]):(n=m[0],s=m[1],l.invert&&(n=l.invert(n),s=l.invert(s)),n>s&&(u=n,n=s,s=u))),c&&l?[[i,n],[a,s]]:c?[i,a]:l&&[n,s])},e.clear=function(){return e.empty()||(d=[0,0],m=[0,0],o=r=null),e},e.empty=function(){return!!c&&d[0]==d[1]||!!l&&m[0]==m[1]},Yo.rebind(e,s,"on")};var Ec={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Lc=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Bc=ns.format=ds.timeFormat,Uc=Bc.utc,Oc=Uc("%Y-%m-%dT%H:%M:%S.%LZ");Bc.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Wo:Oc,Wo.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Wo.toString=Oc.toString,ns.second=Be(function(e){return new os(1e3*Math.floor(e/1e3))},function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))},function(e){return e.getSeconds()}),ns.seconds=ns.second.range,ns.seconds.utc=ns.second.utc.range,ns.minute=Be(function(e){return new os(6e4*Math.floor(e/6e4))},function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))},function(e){return e.getMinutes()}),ns.minutes=ns.minute.range,ns.minutes.utc=ns.minute.utc.range,ns.hour=Be(function(e){var t=e.getTimezoneOffset()/60;return new os(36e5*(Math.floor(e/36e5-t)+t))},function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))},function(e){return e.getHours()}),ns.hours=ns.hour.range,ns.hours.utc=ns.hour.utc.range,ns.month=Be(function(e){return e=ns.day(e),e.setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),ns.months=ns.month.range,ns.months.utc=ns.month.utc.range;var Hc=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Vc=[[ns.second,1],[ns.second,5],[ns.second,15],[ns.second,30],[ns.minute,1],[ns.minute,5],[ns.minute,15],[ns.minute,30],[ns.hour,1],[ns.hour,3],[ns.hour,6],[ns.hour,12],[ns.day,1],[ns.day,2],[ns.week,1],[ns.month,1],[ns.month,3],[ns.year,1]],Wc=Bc.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&1!=e.getDate()}],["%b %d",function(e){return 1!=e.getDate()}],["%B",function(e){return e.getMonth()}],["%Y",Mt]]),zc={range:function(e,t,i){return Yo.range(Math.ceil(e/i)*i,+t,i).map(Ko)},floor:Pe,ceil:Pe};Vc.year=ns.year,ns.scale=function(){return zo(Yo.scale.linear(),Vc,Wc)};var Kc=Vc.map(function(e){return[e[0].utc,e[1]]}),jc=Uc.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&1!=e.getUTCDate()}],["%b %d",function(e){return 1!=e.getUTCDate()}],["%B",function(e){return e.getUTCMonth()}],["%Y",Mt]]);Kc.year=ns.year.utc,ns.scale.utc=function(){return zo(Yo.scale.linear(),Kc,jc)},Yo.text=Me(function(e){return e.responseText}),Yo.json=function(e,t){return Te(e,"application/json",jo,t)},Yo.html=function(e,t){return Te(e,"text/html",qo,t)},Yo.xml=Me(function(e){return e.responseXML}),"function"==typeof define&&define.amd?define("libs/d3",Yo):"object"==typeof module&&module.exports&&(module.exports=Yo),this.d3=Yo}(),define("unifi/util/DpiRuleMap",[],function(){"use strict";return{applications:{1:{category_id:0,name:"MSN"},10:{category_id:0,name:"Gadu-Gadu"},100:{category_id:0,name:"Verychat(M)"},101:{category_id:0,name:"Voxer(M)"},102:{category_id:0,name:"TextMe(M)"},103:{category_id:0,name:"Bump(M)"},104:{category_id:0,name:"CoolMessenger"},105:{category_id:0,name:"NateOn"},106:{category_id:0,name:"WeChat(M)"},107:{category_id:0,name:"Snapchat(M)"},108:{category_id:0,name:"Wangxin"},11:{category_id:0,name:"Yixin"},1114113:{category_id:17,name:"WatchGuard WSM Management"},1114114:{category_id:17,name:"WatchGuard Web Management UI"},1114115:{category_id:17,name:"WatchGuard Authentication Access"},1114117:{category_id:17,name:"WatchGuard external Webblocker database fetch"},1114118:{category_id:17,name:"Livelink"},1114119:{category_id:17,name:"Altiris"},1114120:{category_id:17,name:"AMS"},1114121:{category_id:17,name:"Apache Synapse"},1114122:{category_id:17,name:"WatchGuard CLI "},1114124:{category_id:17,name:"Webex"},1114125:{category_id:17,name:"Webex-WebOffice"},1114128:{category_id:17,name:"Avamar"},1114129:{category_id:17,name:"Avaya"},1114130:{category_id:17,name:"BackupExec"},1114131:{category_id:17,name:"Bitcoin Core"},1114133:{category_id:17,name:"Microsoft OS license"},1114134:{category_id:17,name:"Microsoft Office 2013 license"},1114138:{category_id:17,name:"BZFlag"},1114140:{category_id:17,name:"CAJO"},1114141:{category_id:17,name:"Cisco HSRP"},1114142:{category_id:17,name:"SkyDesk"},1114150:{category_id:17,name:"openQRM"},1114151:{category_id:17,name:"Citrix"},1114152:{category_id:17,name:"CodeMeter"},1114155:{category_id:17,name:"Corba"},1114158:{category_id:17,name:"Cups"},1114160:{category_id:17,name:"Cvsup"},1114161:{category_id:17,name:"DameWare"},1114167:{category_id:17,name:"Db2"},1114169:{category_id:17,name:"Dclink"},1114170:{category_id:17,name:"Urchin Web Analytics"},1114176:{category_id:17,name:"EForward-document transport system"},1114177:{category_id:17,name:"EMWIN"},1114180:{category_id:17,name:"ESRI"},1114182:{category_id:17,name:"Big Brother"},1114187:{category_id:17,name:"Freeciv"},1114188:{category_id:17,name:"Microsoft Lync"},1114191:{category_id:17,name:"Websense"},1114195:{category_id:17,name:"Whisker"},1114198:{category_id:17,name:"Hewlett-Packard"},1114201:{category_id:17,name:"HP-JetDirect"},1114203:{category_id:17,name:"VMWare"},1114205:{category_id:17,name:"IBM HTTP"},1114206:{category_id:17,name:"IBM SmartCloud"},1114212:{category_id:17,name:"IMS"},1114213:{category_id:17,name:"Infomix"},1114222:{category_id:17,name:"Limelight"},1114229:{category_id:17,name:"Lawson-m3"},1114238:{category_id:17,name:"Meeting-maker"},1114239:{category_id:17,name:"Zendesk"},1114246:{category_id:17,name:"Microsoft DTC"},1114248:{category_id:17,name:"Microsoft Netlogon"},1114250:{category_id:17,name:"Microsoft Remote Web Workplace"},1114252:{category_id:17,name:"Sharepoint-wiki"},1114253:{category_id:17,name:"Microsoft SSDP"},1114255:{category_id:17,name:"GatherPlace"},1114269:{category_id:17,name:"Xgrid"},1114272:{category_id:17,name:"Backweb"},1114273:{category_id:17,name:"Bugzilla"},1114274:{category_id:17,name:"NCube"},1114275:{category_id:17,name:"WinboxRouterOS"},1114277:{category_id:17,name:"WSO2"},1114279:{category_id:17,name:"NetFlow"},1114289:{category_id:17,name:"concur"},1114290:{category_id:17,name:"NetSupport"},1114308:{category_id:17,name:"DirectAdmin"},1114309:{category_id:17,name:"EasyBits"},1114310:{category_id:17,name:"Eiq-sec-analyzer"},1114311:{category_id:17,name:"Netbotz"},1114318:{category_id:17,name:"Perforce"},1114320:{category_id:17,name:"TiVoConnect"},1114321:{category_id:17,name:"Polycom"},1114322:{category_id:17,name:"WebSphere"},1114330:{category_id:17,name:"Radacct RADIUS"},1114331:{category_id:17,name:"Psiphon"},1114334:{category_id:17,name:"Securemeeting"},1114335:{category_id:17,name:"SW Soft Plesk"},1114337:{category_id:17,name:"SANE"},1114339:{category_id:17,name:"WebHost"},1114340:{category_id:17,name:"CPanel"},1114342:{category_id:17,name:"Sibelius"},1114343:{category_id:17,name:"Siebel-crm"},1114347:{category_id:17,name:"SMS"},1114350:{category_id:17,name:"Spirent"},1114351:{category_id:17,name:"SPSS"},1114352:{category_id:17,name:"Subversion"},1114355:{category_id:17,name:"Tripwire"},1114359:{category_id:17,name:"WatchGuard Webblocker database transfer"},1114361:{category_id:17,name:"WatchGuard Security Event Processor logging"},1114363:{category_id:17,name:"Genesys Meeting Center"},1114365:{category_id:17,name:"Nagios"},1179649:{category_id:18,name:"TCP Port Service Multiplexer"},1179650:{category_id:18,name:"Management Utility"},1179651:{category_id:18,name:"Compression Process"},1179653:{category_id:18,name:"Echo"},1179654:{category_id:18,name:"Discard"},1179655:{category_id:18,name:"Active"},1179660:{category_id:18,name:"Character Generator"},1179665:{category_id:18,name:"any private mail system"},1179667:{category_id:18,name:"AltaVista Firewall97"},1179668:{category_id:18,name:"NSW User System FE"},1179669:{category_id:18,name:"MSG ICP"},1179670:{category_id:18,name:"MSG Authentication"},1179671:{category_id:18,name:"Display Support Protocol"},1179672:{category_id:18,name:"any private printer server"},1179673:{category_id:18,name:"Time"},1179674:{category_id:18,name:"Route Access Protocol"},1179675:{category_id:18,name:"Resource Location Protocol"},1179676:{category_id:18,name:"graphics"},1179677:{category_id:18,name:"Host Name Server"},1179678:{category_id:18,name:"NIC Name"},1179679:{category_id:18,name:"MPM FLAGS Protocol"},1179680:{category_id:18,name:"Message Processing Module [recv]"},1179681:{category_id:18,name:"MPM [default send]"},1179682:{category_id:18,name:"NI FTP"},1179683:{category_id:18,name:"Digital Audit Daemon"},1179684:{category_id:18,name:"Login Host Protocol (TACACS)"},1179685:{category_id:18,name:"Remote Mail Checking Protocol"},1179686:{category_id:18,name:"IMP Logical Address Maintenance"},1179687:{category_id:18,name:"XNS Time Protocol"},1179688:{category_id:18,name:"Domain Name Server"},1179689:{category_id:18,name:"XNS Clearinghouse"},1179690:{category_id:18,name:"ISI Graphics Language"},1179691:{category_id:18,name:"XNS Authentication"},1179692:{category_id:18,name:"Mail Transfer Protocol (MTP)"},1179693:{category_id:18,name:"XNS Mail"},1179694:{category_id:18,name:"any private file service"},1179695:{category_id:18,name:"NI MAIL"},1179696:{category_id:18,name:"ACA Services"},1179697:{category_id:18,name:"VIA Systems - FTP whois++"},1179698:{category_id:18,name:"Communications Integrator (CI)"},1179699:{category_id:18,name:"TACACS-Database Service"},1179700:{category_id:18,name:"Oracle SQL-NET"},1179701:{category_id:18,name:"Bootstrap Protocol Server"},1179702:{category_id:18,name:"Bootstrap Protocol Client"},1179704:{category_id:18,name:"Gopher"},1179705:{category_id:18,name:"Remote Job Service"},1179706:{category_id:18,name:"any private dial out service"},1179707:{category_id:18,name:"Distributed External Object Store"},1179708:{category_id:18,name:"any private RJE service netrjs"},1179709:{category_id:18,name:"Vet TCP"},1179710:{category_id:18,name:"Finger"},1179711:{category_id:18,name:"World Wide Web HTTP"},1179712:{category_id:18,name:"Torpark"},1179713:{category_id:18,name:"XFER Utility"},1179714:{category_id:18,name:"MIT ML Device"},1179715:{category_id:18,name:"Common Trace Facility"},1179716:{category_id:18,name:"Micro Focus Cobol"},1179717:{category_id:18,name:"any private terminal link ttylink"},1179718:{category_id:18,name:"Kerberos"},1179719:{category_id:18,name:"SU MIT Telnet Gateway"},1179720:{category_id:18,name:"DNSIX Securit Attribute Token Map"},1179721:{category_id:18,name:"MIT Dover Spooler"},1179722:{category_id:18,name:"Network Printing Protocol"},1179723:{category_id:18,name:"Device Control Protocol"},1179724:{category_id:18,name:"Tivoli Object Dispatcher"},1179725:{category_id:18,name:"BSD supdupd(8)"},1179726:{category_id:18,name:"DIXIE Protocol Specification"},1179727:{category_id:18,name:"Swift Remote Virtural File Protocol"},1179728:{category_id:18,name:"linuxconf"},1179729:{category_id:18,name:"Metagram Relay"},1179731:{category_id:18,name:"NIC Host Name Server"},1179732:{category_id:18,name:"ISO-TSAP Class 0"},1179733:{category_id:18,name:"Genesis Point-to-Point Trans Net"},1179734:{category_id:18,name:"ACR-NEMA Digital Imag. &amp; Comm. 300"},1179735:{category_id:18,name:"Mailbox Name Nameserver"},1179737:{category_id:18,name:"Eudora compatible PW changer"},1179739:{category_id:18,name:"SNA Gateway Access Server"},1179740:{category_id:18,name:"PostOffice V.2"},1179742:{category_id:18,name:"Portmapper RPC Bind"},1179743:{category_id:18,name:"McIDAS Data Transmission Protocol"},1179744:{category_id:18,name:"Ident Tap Authentication Service"},1179745:{category_id:18,name:"Audio News Multicast"},1179746:{category_id:18,name:"Simple File Transfer Protocol"},1179747:{category_id:18,name:"ANSA REX Notify"},1179748:{category_id:18,name:"UUCP Path Service"},1179749:{category_id:18,name:"SQL Services"},1179752:{category_id:18,name:"Encore Expedited Remote Pro.Call"},1179753:{category_id:18,name:"Smakynet"},1179754:{category_id:18,name:"NTP"},1179755:{category_id:18,name:"ANSA REX Trader"},1179756:{category_id:18,name:"Locus PC-Interface Net Map Ser"},1179757:{category_id:18,name:"Unisys Unitary Login"},1179758:{category_id:18,name:"Locus PC-Interface Conn Server"},1179759:{category_id:18,name:"GSS X License Verification"},1179760:{category_id:18,name:"Password Generator Protocol"},1179761:{category_id:18,name:"Cisco FNATIVE"},1179762:{category_id:18,name:"Cisco TNATIVE"},1179763:{category_id:18,name:"Cisco SYSMAINT"},1179764:{category_id:18,name:"Statistics Service"},1179765:{category_id:18,name:"INGRES-NET Service"},1179766:{category_id:18,name:"NCS local location broker"},1179767:{category_id:18,name:"PROFILE Naming System"},1179768:{category_id:18,name:"NetBIOS Name Service"},1179769:{category_id:18,name:"NetBIOS Datagram Service"
},1179770:{category_id:18,name:"NetBIOS Session Service"},1179771:{category_id:18,name:"EMFIS Data Service"},1179772:{category_id:18,name:"EMFIS Control Service"},1179773:{category_id:18,name:"Britton-Lee IDM"},1179774:{category_id:18,name:"Internet Message Access Protocol"},1179775:{category_id:18,name:"Universal Management Architecture"},1179776:{category_id:18,name:"UAAC Protocol"},1179777:{category_id:18,name:"iso-ip0"},1179778:{category_id:18,name:"iso-ip"},1179779:{category_id:18,name:"Jargon"},1179780:{category_id:18,name:"AED 512 Emulation Service"},1179781:{category_id:18,name:"SQL-net"},1179782:{category_id:18,name:"HEMS"},1179783:{category_id:18,name:"Background File Transfer Program (BFTP)"},1179784:{category_id:18,name:"SGMP"},1179785:{category_id:18,name:"NetSC-prod"},1179786:{category_id:18,name:"NetSC-dev"},1179787:{category_id:18,name:"SQL Service"},1179788:{category_id:18,name:"KNET VM Command Message Protocol"},1179789:{category_id:18,name:"PCMail Server"},1179790:{category_id:18,name:"NSS-Routing"},1179791:{category_id:18,name:"SGMP-traps"},1179793:{category_id:18,name:"SNMPTRAP"},1179794:{category_id:18,name:"CMIP TCP Manager"},1179795:{category_id:18,name:"CMIP TCP Agent"},1179796:{category_id:18,name:"Xerox"},1179797:{category_id:18,name:"Sirius Systems"},1179798:{category_id:18,name:"namp"},1179799:{category_id:18,name:"rsvd"},1179800:{category_id:18,name:"send"},1179801:{category_id:18,name:"Network PostScript"},1179802:{category_id:18,name:"Network Innovations Multiplex"},1179803:{category_id:18,name:"Network Innovations CL 1"},1179804:{category_id:18,name:"xyplex-mux"},1179805:{category_id:18,name:"mailq"},1179806:{category_id:18,name:"vmnet"},1179807:{category_id:18,name:"genrad-mux"},1179808:{category_id:18,name:"X Display Manager Control Protocol"},1179809:{category_id:18,name:"NextStep Window Server"},1179810:{category_id:18,name:"Border Gateway Protocol"},1179811:{category_id:18,name:"Intergraph"},1179812:{category_id:18,name:"unify"},1179813:{category_id:18,name:"Unisys Audit SITP"},1179814:{category_id:18,name:"ocbinder"},1179815:{category_id:18,name:"ocserver"},1179816:{category_id:18,name:"remote-kis"},1179817:{category_id:18,name:"KIS Protocol"},1179818:{category_id:18,name:"Application Communication Interface"},1179819:{category_id:18,name:"Plus Fives MUMPS"},1179820:{category_id:18,name:"Queued File Transport"},1179821:{category_id:18,name:"Gateway Access Control Protocol"},1179822:{category_id:18,name:"Prospero Directory Service"},1179823:{category_id:18,name:"OSU Network Monitoring System"},1179824:{category_id:18,name:"Spider Remote Monitoring Protocol"},1179825:{category_id:18,name:"Internet Relay Chat"},1179826:{category_id:18,name:"DNSIX Network Level Module Audit"},1179827:{category_id:18,name:"DNSIX Session Mgt Module Audit Redir"},1179828:{category_id:18,name:"Directory Location Service"},1179829:{category_id:18,name:"Directory Location Service Monitor"},1179830:{category_id:18,name:"SMUX"},1179831:{category_id:18,name:"IBM System Resource Controller"},1179832:{category_id:18,name:"AppleTalk Routing Maintenance"},1179833:{category_id:18,name:"AppleTalk Name Binding"},1179834:{category_id:18,name:"AppleTalk Unused"},1179835:{category_id:18,name:"AppleTalk Echo"},1179836:{category_id:18,name:"AppleTalk Zone Information"},1179838:{category_id:18,name:"Trivial Authenticated Mail Protocol"},1179839:{category_id:18,name:"ANSI Z39.50"},1179840:{category_id:18,name:"Texas Instruments"},1179841:{category_id:18,name:"ATEXSSTR"},1179842:{category_id:18,name:"IPX"},1179843:{category_id:18,name:"vmpwscs"},1179844:{category_id:18,name:"Insignia Solutions"},1179845:{category_id:18,name:"Computer Associates Intl License Server"},1179846:{category_id:18,name:"dBASE Unix"},1179847:{category_id:18,name:"Netix Message Posting Protocol"},1179848:{category_id:18,name:"Unisys ARPs"},1179849:{category_id:18,name:"Interactive Mail Access Protocol v3"},1179850:{category_id:18,name:"Berkeley rlogind with SPX auth"},1179851:{category_id:18,name:"Berkeley rshd with SPX auth"},1179852:{category_id:18,name:"Certificate Distribution Center"},1179853:{category_id:18,name:"masqdialer"},1179854:{category_id:18,name:"direct"},1179855:{category_id:18,name:"Survey Measurement"},1179856:{category_id:18,name:"inbusiness"},1179857:{category_id:18,name:"link"},1179858:{category_id:18,name:"Display Systems Protocol"},1179860:{category_id:18,name:"bhfhs"},1179862:{category_id:18,name:"RAP (Route Access Protocol)"},1179863:{category_id:18,name:"Checkpoint Firewall-1"},1179864:{category_id:18,name:"Efficient Short Remote Operations"},1179865:{category_id:18,name:"openport"},1179866:{category_id:18,name:"Checkpoint Firewall-1 Management"},1179867:{category_id:18,name:"arcisdms"},1179868:{category_id:18,name:"hdap"},1179869:{category_id:18,name:"Border Gateway Multicast Protocol (BGMP)"},1179870:{category_id:18,name:"X-Bone CTL"},1179871:{category_id:18,name:"SCSI on ST"},1179872:{category_id:18,name:"Tobit David Service Layer"},1179873:{category_id:18,name:"Tobit David Replica"},1179874:{category_id:18,name:"http-mgmt"},1179875:{category_id:18,name:"personal-link"},1179876:{category_id:18,name:"Cable Port A X"},1179877:{category_id:18,name:"rescap"},1179878:{category_id:18,name:"corerjd"},1179879:{category_id:18,name:"FXP-1"},1179880:{category_id:18,name:"K-BLOCK"},1179881:{category_id:18,name:"Novastor Backup"},1179882:{category_id:18,name:"entrusttime"},1179883:{category_id:18,name:"bhmds"},1179884:{category_id:18,name:"AppleShare IP WebAdmin"},1179885:{category_id:18,name:"VSLMP"},1179886:{category_id:18,name:"magenta-logic"},1179887:{category_id:18,name:"opalis-robot"},1179888:{category_id:18,name:"DPSI"},1179889:{category_id:18,name:"decAuth"},1179890:{category_id:18,name:"zannet"},1179891:{category_id:18,name:"PKIX TimeStamp"},1179892:{category_id:18,name:"PTP Event"},1179893:{category_id:18,name:"PTP General"},1179894:{category_id:18,name:"Programmable Interconnect Point (PIP)"},1179895:{category_id:18,name:"RTSPS"},1179896:{category_id:18,name:"Texar Security Port"},1179897:{category_id:18,name:"Prospero Data Access Protocol"},1179898:{category_id:18,name:"Perf Analysis Workbench"},1179899:{category_id:18,name:"Zebra server"},1179900:{category_id:18,name:"Fatmen Server"},1179901:{category_id:18,name:"Cabletron Management Protocol"},1179902:{category_id:18,name:"mftp"},1179903:{category_id:18,name:"MATIP Type A"},12:{category_id:0,name:"POPO"},1245187:{category_id:19,name:"DTAG or bhoedap4"},1245188:{category_id:19,name:"ndsauth"},1245189:{category_id:19,name:"bh611"},1245190:{category_id:19,name:"datex-asn"},1245191:{category_id:19,name:"Cloanto Net 1"},1245192:{category_id:19,name:"bhevent"},1245193:{category_id:19,name:"shrinkwrap"},1245195:{category_id:19,name:"Tenebris Network Trace Service"},1245196:{category_id:19,name:"scoi2odialog"},1245197:{category_id:19,name:"semantix"},1245198:{category_id:19,name:"SRS Send"},1245200:{category_id:19,name:"aurora-cmgr"},1245201:{category_id:19,name:"DTK"},1245202:{category_id:19,name:"odmr"},1245203:{category_id:19,name:"mortgageware"},1245204:{category_id:19,name:"qbikgdp"},1245205:{category_id:19,name:"rpc2portmap"},1245206:{category_id:19,name:"Coda authentication server (codaauth2)"},1245207:{category_id:19,name:"ClearCase"},1245208:{category_id:19,name:"ListProcessor"},1245209:{category_id:19,name:"Legent Corporation"},1245210:{category_id:19,name:"hassle"},1245211:{category_id:19,name:"Amiga Envoy Network Inquiry Proto"},1245212:{category_id:19,name:"NEC Corporation"},1245213:{category_id:19,name:"TIA EIA IS-99 modem client"},1245214:{category_id:19,name:"TIA EIA IS-99 modem server"},1245215:{category_id:19,name:"HP Performance data collector"},1245216:{category_id:19,name:"HP Performance data managed node"},1245217:{category_id:19,name:"HP Performance data alarm manager"},1245218:{category_id:19,name:"A Remote Network Server System"},1245219:{category_id:19,name:"IBM Application"},1245220:{category_id:19,name:"ASA Message Router Object Def."},1245221:{category_id:19,name:"Appletalk Update-Based Routing Pro."},1245222:{category_id:19,name:"Unidata LDM"},1245223:{category_id:19,name:"Lightweight Directory Access Protocol"},1245224:{category_id:19,name:"uis"},1245225:{category_id:19,name:"SynOptics SNMP Relay Port"},1245226:{category_id:19,name:"SynOptics Port Broker Port"},1245228:{category_id:19,name:"Meta5"},1245229:{category_id:19,name:"EMBL Nucleic Data Transfer"},1245230:{category_id:19,name:"NETscout Control Protocol"},1245231:{category_id:19,name:"Novell Netware over IP"},1245232:{category_id:19,name:"Multi Protocol Trans. Net."},1245233:{category_id:19,name:"kryptolan"},1245234:{category_id:19,name:"ISO Transport Class 2 Non-Control over TCP"},1245235:{category_id:19,name:"Workstation Solutions"},1245236:{category_id:19,name:"Uninterruptible Power Supply"},1245237:{category_id:19,name:"Genie Protocol"},1245238:{category_id:19,name:"decap"},1245239:{category_id:19,name:"nced"},1245240:{category_id:19,name:"ncld"},1245241:{category_id:19,name:"Interactive Mail Support Protocol"},1245242:{category_id:19,name:"timbuktu"},1245243:{category_id:19,name:"Prospero Resource Manager Sys. Man."},1245244:{category_id:19,name:"Prospero Resource Manager Node Man."},1245245:{category_id:19,name:"DECLadebug Remote Debug Protocol"},1245246:{category_id:19,name:"Remote MT Protocol"},1245247:{category_id:19,name:"Trap Convention Port"},1245248:{category_id:19,name:"smsp"},1245249:{category_id:19,name:"infoseek"},1245250:{category_id:19,name:"bnet"},1245251:{category_id:19,name:"silverplatter"},1245252:{category_id:19,name:"onmux"},1245253:{category_id:19,name:"hyper-g"},1245254:{category_id:19,name:"ariel1"},1245255:{category_id:19,name:"smpte"},1245256:{category_id:19,name:"ariel2"},1245257:{category_id:19,name:"ariel3"},1245258:{category_id:19,name:"IBM Operations Planning and Control Start"},1245259:{category_id:19,name:"IBM Operations Planning and Control Track"},1245260:{category_id:19,name:"icad-el"},1245261:{category_id:19,name:"smartsdp"},1245262:{category_id:19,name:"Server Location"},1245263:{category_id:19,name:"ocs_cmu"},1245264:{category_id:19,name:"ocs_amu"},1245265:{category_id:19,name:"utmpsd"},1245266:{category_id:19,name:"utmpcd"},1245267:{category_id:19,name:"iasd"},1245268:{category_id:19,name:"Usenet Network News Transfer"},1245269:{category_id:19,name:"mobileip-agent"},1245270:{category_id:19,name:"mobilip-mn"},1245271:{category_id:19,name:"dna-cml"},1245272:{category_id:19,name:"comscm"},1245273:{category_id:19,name:"dsfgw"},1245274:{category_id:19,name:"dasp"},1245275:{category_id:19,name:"sgcp"},1245276:{category_id:19,name:"decvms-sysmgt"},1245277:{category_id:19,name:"cvc_hostd"},1245278:{category_id:19,name:"HTTP Protocol over TLS SSL"},1245279:{category_id:19,name:"Simple Network Paging Protocol"},1245280:{category_id:19,name:"Win2k+ Server Message Block"},1245281:{category_id:19,name:"ddm-rdb"},1245282:{category_id:19,name:"ddm-dfm"},1245283:{category_id:19,name:"DDM-SSL"},1245284:{category_id:19,name:"AS Server Mapper"},1245285:{category_id:19,name:"tserver"},1245286:{category_id:19,name:"Cray Network Semaphore server"},1245287:{category_id:19,name:"Cray SFS config server"},1245288:{category_id:19,name:"creativeserver"},1245289:{category_id:19,name:"contentserver"},1245290:{category_id:19,name:"creativepartnr"},1245291:{category_id:19,name:"macon-tcp"},1245292:{category_id:19,name:"scohelp"},1245294:{category_id:19,name:"ampr-rcmd"},1245295:{category_id:19,name:"skronk"},1245296:{category_id:19,name:"datasurfsrv"},1245297:{category_id:19,name:"datasurfsrvsec"},1245298:{category_id:19,name:"Alpes"},1245299:{category_id:19,name:"kpasswd"},1245300:{category_id:19,name:"SMTP Protocol over TLS SSL (was SSMTP)"},1245301:{category_id:19,name:"digital-vrc"},1245302:{category_id:19,name:"mylex-mapd"},1245303:{category_id:19,name:"Photuris Key Management"},1245304:{category_id:19,name:"Radio Control Protocol"},1245305:{category_id:19,name:"scx-proxy"},1245306:{category_id:19,name:"mondex"},1245307:{category_id:19,name:"ljk-login"},1245308:{category_id:19,name:"hybrid-pop"},1245309:{category_id:19,name:"tn-tl-w1"},1245310:{category_id:19,name:"Tcpnethaspsrv Protocol"},1245311:{category_id:19,name:"tn-tl-fd1"},1245312:{category_id:19,name:"ss7ns"},1245313:{category_id:19,name:"spsc"},1245314:{category_id:19,name:"iafserver"},1245316:{category_id:19,name:"loadsrv"},1245318:{category_id:19,name:"dvs"},1245319:{category_id:19,name:"bgs-nsi"},1245320:{category_id:19,name:"ulpnet"},1245321:{category_id:19,name:"Integra Software Management Environment"},1245322:{category_id:19,name:"Air Soft Power Burst"},1245324:{category_id:19,name:"sstats"},1245325:{category_id:19,name:"saft Simple Asynchronous File Transfer"},1245326:{category_id:19,name:"gss-http"},1245327:{category_id:19,name:"nest-protocol"},1245328:{category_id:19,name:"micom-pfs"},1245329:{category_id:19,name:"go-login"},1245330:{category_id:19,name:"Transport Independent Convergence for FNA"},1245331:{category_id:19,name:"pov-ray"},1245332:{category_id:19,name:"intecourier"},1245333:{category_id:19,name:"pim-rp-disc"},1245334:{category_id:19,name:"dantz"},1245335:{category_id:19,name:"siam"},1245336:{category_id:19,name:"ISO ILL Protocol"},1245337:{category_id:19,name:"VPN Key Exchange"},1245338:{category_id:19,name:"Simple Transportation Management Framework (STMF)"},1245339:{category_id:19,name:"asa-appl-proto"},1245340:{category_id:19,name:"intrinsa"},1245341:{category_id:19,name:"Citadel"},1245342:{category_id:19,name:"mailbox-lm"},1245343:{category_id:19,name:"ohimsrv"},1245344:{category_id:19,name:"crs"},1245345:{category_id:19,name:"xvttp"},1245346:{category_id:19,name:"snare"},1245347:{category_id:19,name:"FirstClass Protocol"},1245348:{category_id:19,name:"passgo"},1245349:{category_id:19,name:"BSD rexecd(8)"},1245350:{category_id:19,name:"BSD rlogind(8)"},1245351:{category_id:19,name:"BSD rshd(8)"},1245352:{category_id:19,name:"spooler"},1245353:{category_id:19,name:"videotex"},1245354:{category_id:19,name:"like tenex link but across"},1245355:{category_id:19,name:"ntalk"},1245356:{category_id:19,name:"unixtime"},1245357:{category_id:19,name:"Routing Information Protocol (RIP)"},1245358:{category_id:19,name:"ripng"},1245359:{category_id:19,name:"ulp"},1245360:{category_id:19,name:"ibm-db2"},1245361:{category_id:19,name:"NetWare Core Protocol (NCP)"},1245362:{category_id:19,name:"Timeserver"},1245363:{category_id:19,name:"newdate"},1245364:{category_id:19,name:"Stock IXChange"},1245365:{category_id:19,name:"Customer IXChange"},1245366:{category_id:19,name:"irc-serv"},1245370:{category_id:19,name:"readnews"},1245371:{category_id:19,name:"netwall for emergency broadcasts"},1245372:{category_id:19,name:"MegaMedia Admin"},1245373:{category_id:19,name:"iiop"},1245374:{category_id:19,name:"opalis-rdv"},1245375:{category_id:19,name:"Networked Media Streaming Protocol"},1245376:{category_id:19,name:"gdomap"},1245377:{category_id:19,name:"Apertus Technologies Load Determination"},1245378:{category_id:19,name:"uucpd"},1245379:{category_id:19,name:"uucp-rlogin"},1245380:{category_id:19,name:"Commerce"},1245381:{category_id:19,name:"klogin"},1245382:{category_id:19,name:"krcmd"},1245383:{category_id:19,name:"Kerberos encrypted remote shell"},1245384:{category_id:19,name:"DHCPv6 Client"},1245385:{category_id:19,name:"DHCPv6 Server"},1245386:{category_id:19,name:"AFP over TCP"},1245387:{category_id:19,name:"idfp"},1245388:{category_id:19,name:"new-who"},1245389:{category_id:19,name:"cybercash"},1245390:{category_id:19,name:"deviceshare"},1245391:{category_id:19,name:"pirp"},1245392:{category_id:19,name:"Real Time Stream Control Protocol"},1245393:{category_id:19,name:"dsf"},1245394:{category_id:19,name:"Remote File System (RFS)"},1245395:{category_id:19,name:"openvms-sysipc"},1245396:{category_id:19,name:"sdnskmp"},1245397:{category_id:19,name:"teedtap"},1245398:{category_id:19,name:"rmonitord"},1245399:{category_id:19,name:"monitor"},1245400:{category_id:19,name:"chcmd"},1245402:{category_id:19,name:"snews"},1245403:{category_id:19,name:"plan 9 file service"},1245404:{category_id:19,name:"whoami"},1245405:{category_id:19,name:"streettalk"},1245406:{category_id:19,name:"banyan-rpc"},1245407:{category_id:19,name:"Microsoft shuttle"},1245408:{category_id:19,name:"Microsoft rome"},1245409:{category_id:19,name:"demon"},1245410:{category_id:19,name:"udemon"},1245411:{category_id:19,name:"sonar"},1245412:{category_id:19,name:"banyan-vip"},1245413:{category_id:19,name:"FTP Software Agent System"},1245414:{category_id:19,name:"vemmi"},1245415:{category_id:19,name:"ipcd"},1245416:{category_id:19,name:"vnas"},1245417:{category_id:19,name:"ipdd"},1245418:{category_id:19,name:"decbsrv"},1245419:{category_id:19,name:"sntp-heartbeat"},1245420:{category_id:19,name:"Bundle Discovery Protocol"},1245421:{category_id:19,name:"scc-security"},1245422:{category_id:19,name:"Philips Video-Conferencing"},1245423:{category_id:19,name:"keyserver"},1245424:{category_id:19,name:"IMAP4+SSL"},1245425:{category_id:19,name:"password-chg"},1245426:{category_id:19,name:"submission"},1245427:{category_id:19,name:"cal"},1245428:{category_id:19,name:"eyelink"},1245429:{category_id:19,name:"tns-cml"},1245430:{category_id:19,name:"FileMaker Pro"},1245431:{category_id:19,name:"eudora-set"},1245432:{category_id:19,name:"HTTP RPC Ep Map"},1245433:{category_id:19,name:"tpip"},1245434:{category_id:19,name:"cab-protocol"},1245435:{category_id:19,name:"smsd"},1245436:{category_id:19,name:"PTC Name Service"},1245437:{category_id:19,name:"SCO Web Server Manager 3"},1245438:{category_id:19,name:"Aeolon Core Protocol"},1245439:{category_id:19,name:"Sun IPC server"},13:{category_id:0,name:"Tlen"},1310721:{category_id:20,name:"nqs"},1310722:{category_id:20,name:"Sender-Initiated Unsolicited File Transfer"},1310723:{category_id:20,name:"npmp-trap"},1310724:{category_id:20,name:"npmp-local"},1310725:{category_id:20,name:"npmp-gui"},1310726:{category_id:20,name:"HMMP Indication"},1310727:{category_id:20,name:"HMMP Operation"},1310728:{category_id:20,name:"SSLshell"},1310729:{category_id:20,name:"Internet Configuration Manager"},1310730:{category_id:20,name:"SCO System Administration Server"},1310731:{category_id:20,name:"SCO Desktop Administration Server"},1310732:{category_id:20,name:"DEI-ICDA"},1310733:{category_id:20,name:"Digital EVM"},1310734:{category_id:20,name:"SCO WebServer Manager"},1310735:{category_id:20,name:"ESCP"},1310736:{category_id:20,name:"Collaborator"},1310737:{category_id:20,name:"Aux Bus Shunt"},1310738:{category_id:20,name:"Crypto Admin"},1310739:{category_id:20,name:"DEC DLM"},1310740:{category_id:20,name:"ASIA"},1310741:{category_id:20,name:"PassGo Tivoli"},1310742:{category_id:20,name:"QMQP (qmail)"},1310743:{category_id:20,name:"3Com AMP3"},1310744:{category_id:20,name:"RDA"},1310745:{category_id:20,name:"IPP (Internet Printing Protocol)"},1310746:{category_id:20,name:"bmpp"},1310747:{category_id:20,name:"Service Status update (Sterling Software)"},1310748:{category_id:20,name:"ginad"},1310749:{category_id:20,name:"RLZ DBase"},1310750:{category_id:20,name:"LDAP Protocol over TLS SSL (was SLDAP)"},1310751:{category_id:20,name:"lanserver"},1310752:{category_id:20,name:"mcns-sec"},1310753:{category_id:20,name:"Multicast Source Discovery Protocol (MSDP)"},1310754:{category_id:20,name:"entrust-sps"},1310755:{category_id:20,name:"repcmd"},1310756:{category_id:20,name:"ESRO-EMSDP V1.3"},1310757:{category_id:20,name:"SANity"},1310758:{category_id:20,name:"dwr"},1310759:{category_id:20,name:"PSSC"},1310760:{category_id:20,name:"Label Distribution Protocol (LDP)"},1310761:{category_id:20,name:"DHCP Failover"},1310762:{category_id:20,name:"Registry Registrar Protocol (RRP)"},1310763:{category_id:20,name:"Aminet"},1310764:{category_id:20,name:"OBEX"},1310765:{category_id:20,name:"IEEE MMS"},1310766:{category_id:20,name:"HELLO_PORT"},1310767:{category_id:20,name:"AODV"},1310768:{category_id:20,name:"TINC"},1310769:{category_id:20,name:"SPMP"},1310770:{category_id:20,name:"RMC"},1310771:{category_id:20,name:"TenFold"},1310772:{category_id:20,name:"URL Rendezvous"},1310773:{category_id:20,name:"MacOS Server Admin"},1310774:{category_id:20,name:"HAP"},1310775:{category_id:20,name:"PFTP"},1310776:{category_id:20,name:"PureNoise"},1310777:{category_id:20,name:"Secure Aux Bus"},1310778:{category_id:20,name:"Sun DR"},1310779:{category_id:20,name:"doom Id Software"},1310780:{category_id:20,name:"campaign contribution disclosures - SDR Technologies"},1310781:{category_id:20,name:"MeComm"},1310782:{category_id:20,name:"MeRegister"},1310783:{category_id:20,name:"VACDSM-SWS"},1310784:{category_id:20,name:"VACDSM-APP"},1310785:{category_id:20,name:"VPPS-QUA"},1310786:{category_id:20,name:"CIMPLEX"},1310787:{category_id:20,name:"ACAP"},1310788:{category_id:20,name:"DCTP"},1310789:{category_id:20,name:"VPPS Via"},1310790:{category_id:20,name:"Virtual Presence Protocol"},1310791:{category_id:20,name:"GNU Gereration Foundation NCP"},1310792:{category_id:20,name:"MRM"},1310793:{category_id:20,name:"entrust-aaas"},1310794:{category_id:20,name:"entrust-aams"},1310795:{category_id:20,name:"XFR"},1310796:{category_id:20,name:"CORBA IIOP"},1310797:{category_id:20,name:"CORBA IIOP SSL"},1310798:{category_id:20,name:"MDC Port Mapper"},1310799:{category_id:20,name:"Hardware Control Protocol Wismar"},1310800:{category_id:20,name:"asipregistry"},1310801:{category_id:20,name:"REALM-RUSD"},1310802:{category_id:20,name:"NMAP"},1310803:{category_id:20,name:"VATP"},1310804:{category_id:20,name:"MS Exchange Routing"},1310805:{category_id:20,name:"Hyperwave-ISP"},1310806:{category_id:20,name:"connendp"},1310807:{category_id:20,name:"Linux-HA (High-Availability Linux)"},1310808:{category_id:20,name:"IEEE-MMS-SSL"},1310809:{category_id:20,name:"RUSHD"},1310810:{category_id:20,name:"UUIDGEN"},1310811:{category_id:20,name:"OLSR"},1310812:{category_id:20,name:"Access Network"},1310813:{category_id:20,name:"errlog copy server daemon"},1310814:{category_id:20,name:"AgentX"},1310815:{category_id:20,name:"Secure Internet Live Conferencing (SILC)"},1310816:{category_id:20,name:"Borland DSJ"},1310817:{category_id:20,name:"Entrust Key Management Service Handler"},1310818:{category_id:20,name:"Entrust Administration Service Handler"},1310819:{category_id:20,name:"Cisco TDP"},1310820:{category_id:20,name:"IBM NetView DM 6000 Server Client"},1310821:{category_id:20,name:"IBM NetView DM 6000 send tcp"},1310822:{category_id:20,name:"IBM NetView DM 6000 receive tcp"},1310823:{category_id:20,name:"netGW"},1310824:{category_id:20,name:"Network based Rev. Cont. Sys."},1310825:{category_id:20,name:"Flexible License Manager"},1310826:{category_id:20,name:"Fujitsu Device Control"},1310827:{category_id:20,name:"Russell Info Sci Calendar Manager"},1310828:{category_id:20,name:"Kerberos 5 admin changepw"},1310830:{category_id:20,name:"rfile"},1310832:{category_id:20,name:"pump"},1310833:{category_id:20,name:"qrh"},1310834:{category_id:20,name:"rrh"},1310835:{category_id:20,name:"kerberos v5 server propagation"},1310836:{category_id:20,name:"nlogin"},1310837:{category_id:20,name:"con"},1310839:{category_id:20,name:"ns"},1310840:{category_id:20,name:"kpwd Kerberos (v4) passwd"},1310841:{category_id:20,name:"quotad"},1310842:{category_id:20,name:"cycleserv"},1310843:{category_id:20,name:"omserv"},1310844:{category_id:20,name:"webster"},1310845:{category_id:20,name:"phone"},1310846:{category_id:20,name:"vid"},1310847:{category_id:20,name:"cadlock"},1310848:{category_id:20,name:"rtip"},1310849:{category_id:20,name:"cycleserv2"},1310850:{category_id:20,name:"submit"},1310851:{category_id:20,name:"rpasswd"},1310852:{category_id:20,name:"entomb"},1310853:{category_id:20,name:"wpages"},1310854:{category_id:20,name:"Hummingbird Exceed jconfig"},1310855:{category_id:20,name:"wpgs"},1310856:{category_id:20,name:"concert"},1310857:{category_id:20,name:"QSC"},1310858:{category_id:20,name:"controlit"},1310859:{category_id:20,name:"mdbs_daemon"},1310860:{category_id:20,name:"device"},1310861:{category_id:20,name:"FCP"},1310862:{category_id:20,name:"itm-mcell-s"},1310863:{category_id:20,name:"PKIX-3 CA RA"},1310864:{category_id:20,name:"DHCP Failover 2"},1310865:{category_id:20,name:"SUP server"},1310866:{category_id:20,name:"rsync"},1310867:{category_id:20,name:"ICL coNETion locate server"},1310868:{category_id:20,name:"ICL coNETion server info"},1310869:{category_id:20,name:"AccessBuilder"},1310870:{category_id:20,name:"OMG Initial Refs"},1310871:{category_id:20,name:"Samba SWAT Tool"},1310872:{category_id:20,name:"IDEAFARM-CHAT"},1310873:{category_id:20,name:"IDEAFARM-CATCH"},1310874:{category_id:20,name:"xact-backup"},1310875:{category_id:20,name:"SecureNet Pro sensor"},1310878:{category_id:20,name:"Netnews Administration System"},1310879:{category_id:20,name:"Telnet Protocol over TLS SSL"},1310880:{category_id:20,name:"IMAP4 Protocol over TLS SSL"},1310881:{category_id:20,name:"ICP Protocol over TLS SSL"},1310882:{category_id:20,name:"POP3 Protocol over TLS SSL"},1310883:{category_id:20,name:"bhoetty"},1310884:{category_id:20,name:"Cray Unified Resource Manager"},1310887:{category_id:20,name:"Microsoft Authentication via SSL"},1310888:{category_id:20,name:"Google(SSL)"},1310889:{category_id:20,name:"Yahoo Authentication via SSL"},1310890:{category_id:20,name:"AOL Authentication via SSL"},1310891:{category_id:20,name:"FIX"},1310892:{category_id:20,name:"STUN"},1310893:{category_id:20,name:"Dynamic Host Configuration Protocol (DHCP)"},1310894:{category_id:20,name:"Megaco"},1310895:{category_id:20,name:"Rstatd"},1310896:{category_id:20,name:"RSVP"},1310897:{category_id:20,name:"SOAP"},1310898:{category_id:20,name:"Ess Apple Authentication via SSL"},1310899:{category_id:20,name:"TFTP"},1310900:{category_id:20,name:"Daytime"},1310902:{category_id:20,name:"MicrosoftOnline Authentication via SSL"},1310903:{category_id:20,name:"Microsoft WINS"},1310904:{category_id:20,name:"Remote Procedure Call (RPC)"},1310905:{category_id:20,name:"SSL/TLS"},1310906:{category_id:20,name:"Google APIs(SSL)"},1310907:{category_id:20,name:"Sina Authentication via SSL"},1310908:{category_id:20,name:"Google App Engine(SSL)"},1310909:{category_id:20,name:"Google User Content(SSL)"},1310910:{category_id:20,name:"Blackberry Authentication via SSL"},1376306:{category_id:21,name:"Apple iMessage"},1376323:{category_id:21,name:"ezRead Touch"},1376357:{category_id:21,name:"Android browser"},1376359:{category_id:21,name:"Symbian browser"},14:{category_id:0,name:"Wlt"},15:{category_id:0,name:"RenRen"},1507329:{category_id:23,name:"QQ Private Protocol"},1507330:{category_id:23,name:"Thunder Private Protocol"},1507333:{category_id:23,name:"Jabber Private Protocol"},1572865:{category_id:24,name:"Classmates"},1572866:{category_id:24,name:"Yik Yak"},1572867:{category_id:24,name:"Facebook"},1572868:{category_id:24,name:"Flickr"},1572870:{category_id:24,name:"Friendfeed"},1572871:{category_id:24,name:"Hi5"},1572872:{category_id:24,name:"Linkedin"},1572873:{category_id:24,name:"Livejournal"},1572874:{category_id:24,name:"Twitter"},1572875:{category_id:24,name:"Plurk"},1572876:{category_id:24,name:"MySpace"},1572880:{category_id:24,name:"Khan Academy"},1572881:{category_id:24,name:"Pinterest"},1572882:{category_id:24,name:"Tumblr"},1572883:{category_id:24,name:"MeetMe"},1572884:{category_id:24,name:"VKontakte"},1572885:{category_id:24,name:"Odnoklassniki"},1572886:{category_id:24,name:"Niwota"},1572887:{category_id:24,name:"Tagged"},1572889:{category_id:24,name:"PerfSpot"},1572890:{category_id:24,name:"Me2day"},1572891:{category_id:24,name:"Mekusharim"},1572892:{category_id:24,name:"Draugiem"},1572893:{category_id:24,name:"Badoo"},1572894:{category_id:24,name:"Meetup"},1572895:{category_id:24,name:"Foursquare"},1572896:{category_id:24,name:"Ning"},1572897:{category_id:24,name:"i-Part"},1572898:{category_id:24,name:"Wretch"},1572899:{category_id:24,name:"Dudu"},1572900:{category_id:24,name:"Mig33"},1572901:{category_id:24,name:"Hatena"},1572902:{category_id:24,name:"eHarmony"},1572903:{category_id:24,name:"Fotolog "},1572905:{category_id:24,name:"Tencent QQ"},1572906:{category_id:24,name:"Pixnet"},1572907:{category_id:24,name:"Nk.Pl"},1572908:{category_id:24,name:"K.ai"},1572909:{category_id:24,name:"Twoo"},1572910:{category_id:24,name:"Plaxo"},1572911:{category_id:24,name:"Cyworld"},1572912:{category_id:24,name:"Jivesoftware"},1572913:{category_id:24,name:"WordPress"},1572914:{category_id:24,name:"FMyLife"},1572915:{category_id:24,name:"Dcinside"},1572916:{category_id:24,name:"Class Chinaren"},1572917:{category_id:24,name:"Bai Sohu"},1572918:{category_id:24,name:"Yammer"},1572919:{category_id:24,name:"Douban"},1572920:{category_id:24,name:"Gamer"},1572921:{category_id:24,name:"Xuite"},1572922:{category_id:24,name:"ChatMe"},1572923:{category_id:24,name:"Clien.net"},1572927:{category_id:24,name:"AdultFriendFinder"},1572928:{category_id:24,name:"Fling.com"},1572929:{category_id:24,name:"Delicious"},1572930:{category_id:24,name:"Mei.fm"},1572931:{category_id:24,name:"Streetlife"},1572967:{category_id:24,name:"Daum-blog"},1572968:{category_id:24,name:"Naver-blog"},1572970:{category_id:24,name:"Panoramio"},1572974:{category_id:24,name:"Blogger "},1572975:{category_id:24,name:"FC2"},1572976:{category_id:24,name:"Yahoo Blog"},1572977:{category_id:24,name:"Friendster"},1572978:{category_id:24,name:"Ameba"},1572980:{category_id:24,name:"Bebo social network"},1572981:{category_id:24,name:"Kaixin"},1572983:{category_id:24,name:"Orkut"},1572985:{category_id:24,name:"Aol-Answers"},1572987:{category_id:24,name:"CoolTalk social network"},1572988:{category_id:24,name:"RenRen.com"},1572989:{category_id:24,name:"TweetDeck"},1572990:{category_id:24,name:"Hootsuite"},1572998:{category_id:24,name:"Xing"},1572999:{category_id:24,name:"Lokalisten"},1573000:{category_id:24,name:"meinVZ/studiVZ"},1573004:{category_id:24,name:"Viadeo"},1573005:{category_id:24,name:"Tuenti"},1573006:{category_id:24,name:"Hyves"},1573007:{category_id:24,name:"Mixi.jp"},1573008:{category_id:24,name:"Yahoo-mbga.jp"},1573009:{category_id:24,name:"Gree.jp"},1573010:{category_id:24,name:"Netlog"},1573011:{category_id:24,name:"2ch"},1573014:{category_id:24,name:"LoveTheseCurves"},1573015:{category_id:24,name:"Weibo"},1573016:{category_id:24,name:"Google-plus"},1573017:{category_id:24,name:"Skyrock"},1573018:{category_id:24,name:"51.com"},1573019:{category_id:24,name:"Jackd(M)"},1573020:{category_id:24,name:"Touch(M)"},1573021:{category_id:24,name:"Skout(M)"},1573022:{category_id:24,name:"Instagram"},1573023:{category_id:24,name:"Jiayuan"},1573024:{category_id:24,name:"Zoosk(M)"},1573025:{category_id:24,name:"DatingDNA(M)"},1573026:{category_id:24,name:"500px"},1573027:{category_id:24,name:"Socialcam(M)"},1573028:{category_id:24,name:"iAround(M)"},1573029:{category_id:24,name:"MomoChat(M)"},1573030:{category_id:24,name:"Path(M)"},1573031:{category_id:24,name:"WeHeartIt"},1573032:{category_id:24,name:"Fancy(M)"},1573033:{category_id:24,name:"Vine(M)"},1573035:{category_id:24,name:"Miliao"},16:{category_id:0,name:"Omegle"},16777215:{category_id:255,name:"Unknown"},17:{category_id:0,name:"IPMSG"},18:{category_id:0,name:"Aliww"},1835009:{category_id:28,name:"LiveJasmin"},1835010:{category_id:28,name:"Youporn"},1835011:{category_id:28,name:"XNXX Galleries"},1835012:{category_id:28,name:"Adult Friendfinder"},1835013:{category_id:28,name:"FreeOnes"},1835014:{category_id:28,name:"Streamate"},1835015:{category_id:28,name:"Fling"},1835016:{category_id:28,name:"Literotica.Com"},1835017:{category_id:28,name:"Adam4Adam"},1835018:{category_id:28,name:"Playboy Digital"},1835019:{category_id:28,name:"VICE"},1835020:{category_id:28,name:"Manhunt"},1835021:{category_id:28,name:"GayRomeo"},1835022:{category_id:28,name:"Newgrounds"},1835023:{category_id:28,name:"Payserve"},1835024:{category_id:28,
name:"eBaums World"},1835025:{category_id:28,name:"Flirt4Free"},1835026:{category_id:28,name:"Be Naughty"},1835027:{category_id:28,name:"Debonairblog"},1835028:{category_id:28,name:"AEBN"},1835029:{category_id:28,name:"FetLife"},1835030:{category_id:28,name:"ImLive"},1835031:{category_id:28,name:"Video Sex Archive"},1835032:{category_id:28,name:"Mr. Skin"},1835033:{category_id:28,name:"Clips4Sale"},1835034:{category_id:28,name:"Femjoy"},1835035:{category_id:28,name:"HQ Porn Links"},1835036:{category_id:28,name:"The Voyeurweb"},1835037:{category_id:28,name:"Alt.Sex.Stories Text Repository"},1835038:{category_id:28,name:"Xcams"},1835039:{category_id:28,name:"AV Entertainments"},1835040:{category_id:28,name:"Indian Sex Stories"},1835041:{category_id:28,name:"World Sex"},1835042:{category_id:28,name:"Fur Affinity"},1835043:{category_id:28,name:"Celebrity Movie Archive"},1835044:{category_id:28,name:"The Erotic Review"},1835045:{category_id:28,name:"Internet Adult Film Database"},1835046:{category_id:28,name:"Shoosh Time"},1835047:{category_id:28,name:"Thumblogger"},1835048:{category_id:28,name:"First Time Videos"},1835049:{category_id:28,name:"The Huns Yellow Pages"},1835050:{category_id:28,name:"CollarMe"},1835051:{category_id:28,name:"Sex in the UK"},1835052:{category_id:28,name:"Links Hit"},1835053:{category_id:28,name:"Peachy Forum"},1835054:{category_id:28,name:"Swing Life Style"},1835055:{category_id:28,name:"Scoreland Tits"},1835056:{category_id:28,name:"Girlfriend Videos"},1835057:{category_id:28,name:"Digital Playground"},1835058:{category_id:28,name:"Penthouse"},1835059:{category_id:28,name:"Squirt.org"},1835060:{category_id:28,name:"MPL Studios"},1835061:{category_id:28,name:"Wicked Weasel Bikinis"},1835062:{category_id:28,name:"Nifty Erotic Stories Archive"},1835063:{category_id:28,name:"VideoBox"},1835064:{category_id:28,name:"EdenFantasys"},1835065:{category_id:28,name:"Vintage Erotica Forum"},1835066:{category_id:28,name:"PHE"},1835067:{category_id:28,name:"DudesNude"},1835068:{category_id:28,name:"Heaven 666"},1835069:{category_id:28,name:"GameLink"},1835070:{category_id:28,name:"Ask Jolene"},1835071:{category_id:28,name:"Polyner Artist Web Ring"},1835072:{category_id:28,name:"VirtuaGirl 2"},1835073:{category_id:28,name:"Inthecrack"},1835074:{category_id:28,name:"Suicide Girls"},1835075:{category_id:28,name:"Fleshbot"},1835076:{category_id:28,name:"Oglaf"},1835077:{category_id:28,name:"ALS Scan"},1835078:{category_id:28,name:"Odloty"},1835079:{category_id:28,name:"Southern Charms"},1835080:{category_id:28,name:"Fab Swingers"},1835081:{category_id:28,name:"The Stile Project"},1835082:{category_id:28,name:"Hentai Foundry"},1835083:{category_id:28,name:"Adult DVD Empire"},1835084:{category_id:28,name:"Webcams"},1835085:{category_id:28,name:"Cityvibe"},1835086:{category_id:28,name:"Manjam"},1835087:{category_id:28,name:"XBIZ"},1835088:{category_id:28,name:"Rogan"},1835089:{category_id:28,name:"AVN Media Network"},1835090:{category_id:28,name:"Fleshlight"},1835091:{category_id:28,name:"Fucking Machines"},1835092:{category_id:28,name:"Recon"},1835093:{category_id:28,name:"Hogtied"},1835094:{category_id:28,name:"Swingers Date Club"},1835095:{category_id:28,name:"Sex Toys Uk"},1835096:{category_id:28,name:"Lush Sex Stories"},1835097:{category_id:28,name:"NiteFlirt"},1835098:{category_id:28,name:"Wife Lovers"},1835099:{category_id:28,name:"Sucksex"},1835100:{category_id:28,name:"Project Voyeur"},1835101:{category_id:28,name:"Fritchy Forums"},1835102:{category_id:28,name:"AL4A"},1835103:{category_id:28,name:"What The Fuck!?"},1835104:{category_id:28,name:"Kaktuz"},1835105:{category_id:28,name:"Rabbits Reviews"},1835106:{category_id:28,name:"Truth or Dare Pics"},1835107:{category_id:28,name:"Sunny Leone"},1835108:{category_id:28,name:"SPAcash"},19:{category_id:0,name:"Mail.ru IM"},1900545:{category_id:29,name:"The Internet Movie Database"},1900546:{category_id:29,name:"BBC Online"},1900547:{category_id:29,name:"CNN Interactive"},1900548:{category_id:29,name:"ESPN.com"},1900549:{category_id:29,name:"The Weather Channel"},1900550:{category_id:29,name:"FoxNews"},1900551:{category_id:29,name:"deviantART"},1900552:{category_id:29,name:"Yahoo! Movies"},1900553:{category_id:29,name:"NBC News"},1900554:{category_id:29,name:"Yahoo! TV"},1900555:{category_id:29,name:"ABCNews"},1900556:{category_id:29,name:"NDTV"},1900557:{category_id:29,name:"CBS News"},1900558:{category_id:29,name:"CNN/Money"},1900559:{category_id:29,name:"TMZ"},1900560:{category_id:29,name:"CNBC"},1900561:{category_id:29,name:"Wired"},1900562:{category_id:29,name:"Fox Sports Network"},1900563:{category_id:29,name:"CNN/SI Network Page"},1900564:{category_id:29,name:"Rotten Tomatoes"},1900565:{category_id:29,name:"Disney"},1900566:{category_id:29,name:"Urban Dictionary"},1900567:{category_id:29,name:"Food Network"},1900568:{category_id:29,name:"British Sky Broadcasting"},1900569:{category_id:29,name:"NPR Online- National Public Radio"},1900570:{category_id:29,name:"Gawker"},1900571:{category_id:29,name:"Last.fm"},1900572:{category_id:29,name:"Comcast Corporation"},1900573:{category_id:29,name:"ABC"},1900574:{category_id:29,name:"CBS"},1900575:{category_id:29,name:"Salon"},1900576:{category_id:29,name:"CBC Television"},1900577:{category_id:29,name:"E Online"},1900578:{category_id:29,name:"FanFiction.Net"},1900579:{category_id:29,name:"Ultimate Guitar Archive"},1900580:{category_id:29,name:"Deezer.com"},1900581:{category_id:29,name:"Fandango"},1900582:{category_id:29,name:"Copyscape"},1900583:{category_id:29,name:"A-Z Lyrics"},1900584:{category_id:29,name:"Atlantic Online"},1900585:{category_id:29,name:"Discovery Channel"},1900586:{category_id:29,name:"Australian Broadcasting Corporation"},1900587:{category_id:29,name:"Egotastic"},1900588:{category_id:29,name:"NBC"},1900589:{category_id:29,name:"MetroLyrics"},1900590:{category_id:29,name:"TV Guide"},1900591:{category_id:29,name:"MTV"},1900592:{category_id:29,name:"Entertainment Weekly"},1900593:{category_id:29,name:"ksl"},1900594:{category_id:29,name:"World Wrestling Entertainment"},1900595:{category_id:29,name:"Cartoon Network"},1900596:{category_id:29,name:"xkcd"},1900597:{category_id:29,name:"SkyscraperCity"},1900598:{category_id:29,name:"DIRECTV"},1900599:{category_id:29,name:"Discogs"},1900600:{category_id:29,name:"PBS Online"},1900601:{category_id:29,name:"PBS Kids!"},1900602:{category_id:29,name:"The Hollywood Reporter"},1900603:{category_id:29,name:"Nickelodeon"},1900604:{category_id:29,name:"TV"},1900605:{category_id:29,name:"Ravelry"},1900606:{category_id:29,name:"Nick Jr."},1900607:{category_id:29,name:"Rollingstone Magazine"},1900608:{category_id:29,name:"India Forums "},1900609:{category_id:29,name:"Deutsche Welle Radio"},1900610:{category_id:29,name:"Cox Communications"},1900611:{category_id:29,name:"Voice of America"},1900612:{category_id:29,name:"AMC"},1900613:{category_id:29,name:"Metacritic"},1900614:{category_id:29,name:"Islamic Republic of Iran Broadcasting"},1900615:{category_id:29,name:"goComics"},1900616:{category_id:29,name:"The New Yorker"},1900617:{category_id:29,name:"B92"},1900618:{category_id:29,name:"Moviefone"},1900619:{category_id:29,name:"Lyrics Freak"},1900620:{category_id:29,name:"Oprah"},1900621:{category_id:29,name:"Comedy Central"},1900622:{category_id:29,name:"Veoh"},1900623:{category_id:29,name:"Box Office Mojo"},1900624:{category_id:29,name:"All Music Guide"},1900625:{category_id:29,name:"Billboard"},1900626:{category_id:29,name:"RAI"},1900627:{category_id:29,name:"Home and Garden Television (HGTV)"},1900628:{category_id:29,name:"Canon World Wide Gateway"},1900629:{category_id:29,name:"Lorem Ipsum"},1966081:{category_id:30,name:"PayPal"},1966082:{category_id:30,name:"Alibaba"},1966083:{category_id:30,name:"Yahoo! Finance"},1966084:{category_id:30,name:"Bank of America"},1966085:{category_id:30,name:"Chase Bank"},1966086:{category_id:30,name:"Wells Fargo"},1966087:{category_id:30,name:"The Wall Street Journal Interactive Edition"},1966088:{category_id:30,name:"Samsung Electronics"},1966089:{category_id:30,name:"UPS"},196609:{category_id:3,name:"FTP Applications"},1966090:{category_id:30,name:"Target Corporation"},1966091:{category_id:30,name:"Reuters Group PLC"},1966092:{category_id:30,name:"Indeed"},1966093:{category_id:30,name:"Forbes Magazine"},1966094:{category_id:30,name:"Constant Contact"},1966095:{category_id:30,name:"Shutterstock"},1966096:{category_id:30,name:"ClickBank"},1966097:{category_id:30,name:"AT&T"},1966098:{category_id:30,name:"American Express"},1966099:{category_id:30,name:"FedEx"},196610:{category_id:3,name:"GetRight"},1966100:{category_id:30,name:"EzineArticles"},1966101:{category_id:30,name:"Commission Junction"},1966102:{category_id:30,name:"TechCrunch"},1966103:{category_id:30,name:"HDFC Bank Ltd."},1966104:{category_id:30,name:"Verizon Wireless"},1966105:{category_id:30,name:"Freelancer"},1966106:{category_id:30,name:"iStockphoto"},1966107:{category_id:30,name:"Bloomberg"},1966108:{category_id:30,name:"Capital One Financial Corp."},1966109:{category_id:30,name:"Fotolia"},196611:{category_id:3,name:"FlashGet"},1966110:{category_id:30,name:"ICICI Bank"},1966111:{category_id:30,name:"123RF Royalty Free Stock Photos"},1966112:{category_id:30,name:"Zillow"},1966113:{category_id:30,name:"Monster"},1966114:{category_id:30,name:"TradeDoubler"},1966115:{category_id:30,name:"Industrial and Commercial Bank of China"},1966116:{category_id:30,name:"Nokia"},1966117:{category_id:30,name:"Sears"},1966118:{category_id:30,name:"CNET News"},1966119:{category_id:30,name:"Indian Railways"},196612:{category_id:3,name:"AsianDVDClub"},1966120:{category_id:30,name:"The Sun"},1966121:{category_id:30,name:"Verizon Corporation"},1966122:{category_id:30,name:"Elance"},1966123:{category_id:30,name:"CareerBuilder"},1966124:{category_id:30,name:"Citibank U.S."},1966125:{category_id:30,name:"GetResponse Email Marketing"},1966126:{category_id:30,name:"Business Week"},1966127:{category_id:30,name:"MarketWatch"},1966128:{category_id:30,name:"Shareasale"},1966129:{category_id:30,name:"SiteSell"},196613:{category_id:3,name:"Web File Transfer"},1966130:{category_id:30,name:"Manta"},1966131:{category_id:30,name:"Eventbrite"},1966132:{category_id:30,name:"Citibank Online"},1966133:{category_id:30,name:"Dreamstime Stock Photography"},1966134:{category_id:30,name:"Costco Wholesale Corporation"},1966135:{category_id:30,name:"H&M"},1966136:{category_id:30,name:"Merriam-Webster"},1966137:{category_id:30,name:"The Economic Times"},1966138:{category_id:30,name:"U.S. Bank"},1966139:{category_id:30,name:"TD Bank"},196614:{category_id:3,name:"FileZilla"},1966140:{category_id:30,name:"Intel Corp"},1966141:{category_id:30,name:"Zazzle"},1966142:{category_id:30,name:"Behance Network"},1966143:{category_id:30,name:"Commonwealth Bank of Australia"},1966144:{category_id:30,name:"La Caja de Ahorros y Pensiones de Barcelona"},1966145:{category_id:30,name:"ZDNet"},1966146:{category_id:30,name:"Realtor"},1966147:{category_id:30,name:"New York Post Online Edition"},1966148:{category_id:30,name:"glispa"},1966149:{category_id:30,name:"Financial Times News"},196615:{category_id:3,name:"Kuaipan"},1966150:{category_id:30,name:"SitePoint"},1966151:{category_id:30,name:"T-Mobile"},1966152:{category_id:30,name:"National Hurricane Center"},1966153:{category_id:30,name:"ForexFactory"},1966154:{category_id:30,name:"Sprint"},1966155:{category_id:30,name:"Sony Electronics"},1966156:{category_id:30,name:"VistaPrint"},1966157:{category_id:30,name:"MOJO Works"},1966158:{category_id:30,name:"TD Canada Trust"},1966159:{category_id:30,name:"Zara"},196616:{category_id:3,name:"DBank"},1966160:{category_id:30,name:"Cisco"},1966161:{category_id:30,name:"WebMoney Transfer"},1966162:{category_id:30,name:"Fidelity Investments"},1966163:{category_id:30,name:"USAA"},1966164:{category_id:30,name:"Discover Financial Services"},1966165:{category_id:30,name:"Lego Company"},1966166:{category_id:30,name:"Axis Bank"},1966167:{category_id:30,name:"The Economist"},1966168:{category_id:30,name:"Kmart"},1966169:{category_id:30,name:"Inc"},196617:{category_id:3,name:"115.com"},1966170:{category_id:30,name:"Univision"},1966171:{category_id:30,name:"DHL Worldwide Express"},1966172:{category_id:30,name:"PNC Financial Services Group"},1966173:{category_id:30,name:"WebEx Communications"},196618:{category_id:3,name:"Weiyun"},196619:{category_id:3,name:"Rayfile"},196620:{category_id:3,name:"0zz0"},196621:{category_id:3,name:"Herosh"},196622:{category_id:3,name:"2Shared"},196624:{category_id:3,name:"BIZHARD"},196626:{category_id:3,name:"UPlusBox"},196627:{category_id:3,name:"Filebox.ro"},196628:{category_id:3,name:"Qnext"},196629:{category_id:3,name:"OneDrive"},196630:{category_id:3,name:"YunFile"},196631:{category_id:3,name:"Filehosting"},196632:{category_id:3,name:"Dev-Host"},196633:{category_id:3,name:"Solidfiles"},196634:{category_id:3,name:"IBackup"},196635:{category_id:3,name:"FileSwap"},196637:{category_id:3,name:"Temp-Share"},196638:{category_id:3,name:"WikiUpload"},196640:{category_id:3,name:"MEGA"},196641:{category_id:3,name:"Copy.com"},196642:{category_id:3,name:"4Shared"},196643:{category_id:3,name:"HiCloud"},196644:{category_id:3,name:"Depositfiles"},196645:{category_id:3,name:"Docstoc"},196646:{category_id:3,name:"360 Cloud"},196647:{category_id:3,name:"Symantec Nomdb"},196648:{category_id:3,name:"Baidu Cloud"},196649:{category_id:3,name:"GitHub"},196650:{category_id:3,name:"FileDropper"},196651:{category_id:3,name:"CrashPlan"},196652:{category_id:3,name:"Net2FTP"},196653:{category_id:3,name:"Mediafire"},196655:{category_id:3,name:"Carbonite"},196656:{category_id:3,name:"Mozy"},196657:{category_id:3,name:"SOS Online Backup"},196669:{category_id:3,name:"cute-ftp(HTTP)"},196676:{category_id:3,name:"Box"},196678:{category_id:3,name:"Scribd"},196680:{category_id:3,name:"Rapidshare"},196681:{category_id:3,name:"Sendspace"},196683:{category_id:3,name:"Hightail"},196684:{category_id:3,name:"Diino"},196686:{category_id:3,name:"Fluxiom"},196689:{category_id:3,name:"Nomadesk"},196692:{category_id:3,name:"Dropbox"},196693:{category_id:3,name:"Filesend.to"},196694:{category_id:3,name:"Firestorage"},196695:{category_id:3,name:"Naver Ndrive"},196696:{category_id:3,name:"Filesend.net"},196697:{category_id:3,name:"Crocko"},196700:{category_id:3,name:"Fileserve"},196701:{category_id:3,name:"Netload"},196702:{category_id:3,name:"Megashares"},196703:{category_id:3,name:"TransferBigFiles"},196705:{category_id:3,name:"Filemail"},196706:{category_id:3,name:"Zamzar"},196708:{category_id:3,name:"Divshare"},196709:{category_id:3,name:"DL Free"},196711:{category_id:3,name:"Nakido"},196713:{category_id:3,name:"Gigaup"},196714:{category_id:3,name:"Filestube"},196716:{category_id:3,name:"Filer.cx"},196717:{category_id:3,name:"Cx.com"},196718:{category_id:3,name:"Elephantdrive"},196722:{category_id:3,name:"Zshare"},196723:{category_id:3,name:"Freakshare"},196724:{category_id:3,name:"Uploading"},196725:{category_id:3,name:"Bitshare"},196726:{category_id:3,name:"Letitbit.net"},196727:{category_id:3,name:"Extabit"},196728:{category_id:3,name:"Filefactory"},196729:{category_id:3,name:"Furk"},196731:{category_id:3,name:"GoldFile"},196732:{category_id:3,name:"GigaSize"},196733:{category_id:3,name:"Turbobit"},196735:{category_id:3,name:"Hitfile"},196737:{category_id:3,name:"Zippyshare"},196738:{category_id:3,name:"SoundCloud"},196739:{category_id:3,name:"SpeedyShare"},196742:{category_id:3,name:"FilePost.net"},196743:{category_id:3,name:"GlumboUploads"},196744:{category_id:3,name:"RapidGator.net"},196746:{category_id:3,name:"Clip2net"},196747:{category_id:3,name:"Datei.to"},196748:{category_id:3,name:"Totodisk"},196749:{category_id:3,name:"LeapFile"},196750:{category_id:3,name:"BigUpload"},196751:{category_id:3,name:"OnlineFileFolder"},196752:{category_id:3,name:"ASUSWebStorage"},196753:{category_id:3,name:"File-Upload.net"},196754:{category_id:3,name:"File-Works"},196755:{category_id:3,name:"Zumodrive"},196756:{category_id:3,name:"PutLocker"},196757:{category_id:3,name:"Wetransfer"},196758:{category_id:3,name:"iCloud"},196759:{category_id:3,name:"CloudMe"},196760:{category_id:3,name:"Beanywhere"},196761:{category_id:3,name:"Sugarsync"},196762:{category_id:3,name:"DriveHQ"},196764:{category_id:3,name:"Backblaze"},196765:{category_id:3,name:"AirSet"},196766:{category_id:3,name:"SpiderOak"},196767:{category_id:3,name:"1337X"},196768:{category_id:3,name:"MailBigFile"},196769:{category_id:3,name:"GoldCoupon.co.kr"},196770:{category_id:3,name:"Egnyte"},196771:{category_id:3,name:"SmugMug"},196772:{category_id:3,name:"SlideShare.net"},196773:{category_id:3,name:"4Sync"},196774:{category_id:3,name:"IDrive"},196775:{category_id:3,name:"Mendeley"},196777:{category_id:3,name:"Daum-cloud"},2:{category_id:0,name:"Yahoo Messenger"},20:{category_id:0,name:"Kubao"},2031617:{category_id:31,name:"Yahoo!"},2031618:{category_id:31,name:"Yahoo! Mail"},2031619:{category_id:31,name:"Windows Live Hotmail"},2031620:{category_id:31,name:"Yahoo! Search"},2031621:{category_id:31,name:"Google Docs"},2031622:{category_id:31,name:"Alexa Internet"},2031623:{category_id:31,name:"Bing"},2031624:{category_id:31,name:"Babylon"},2031625:{category_id:31,name:"Google+"},2031626:{category_id:31,name:"Microsoft Corporation"},2031627:{category_id:31,name:"Apple Inc."},2031628:{category_id:31,name:"Go"},2031629:{category_id:31,name:"Ask"},2031630:{category_id:31,name:"Adobe Systems Incorporated"},2031631:{category_id:31,name:"AVG | Antivirus and Security Software"},2031632:{category_id:31,name:"The Pirate Bay"},2031633:{category_id:31,name:"www.ZEDO"},2031634:{category_id:31,name:"Babylon Search"},2031635:{category_id:31,name:"Stack Overflow"},2031636:{category_id:31,name:"About"},2031637:{category_id:31,name:"Google Adwords"},2031638:{category_id:31,name:"Imgur.com"},2031639:{category_id:31,name:"Go Daddy"},2031640:{category_id:31,name:"Google Play"},2031641:{category_id:31,name:"Vimeo.com"},2031642:{category_id:31,name:"The Apple Store"},2031643:{category_id:31,name:"Badoo.Com"},2031644:{category_id:31,name:"AWeber Systems"},2031645:{category_id:31,name:"SourceForge"},2031646:{category_id:31,name:"SlideShare"},2031647:{category_id:31,name:"Mozilla"},2031648:{category_id:31,name:"Wikia"},2031649:{category_id:31,name:"Google AdSense"},2031650:{category_id:31,name:"Fiverr"},2031651:{category_id:31,name:"Photobucket image hosting and photo sharing"},2031652:{category_id:31,name:"Clicksor"},2031653:{category_id:31,name:"HootSuite Social Media Dashboard"},2031654:{category_id:31,name:"1-Click Answers"},2031655:{category_id:31,name:"StatCounter"},2031656:{category_id:31,name:"CNET Download"},2031657:{category_id:31,name:"Rediff"},2031658:{category_id:31,name:"My Yahoo"},2031659:{category_id:31,name:"The Internet Archive"},2031660:{category_id:31,name:"isoHunt"},2031661:{category_id:31,name:"DomainTools"},2031662:{category_id:31,name:"CNET"},2031663:{category_id:31,name:"GitHub.com"},2031664:{category_id:31,name:"Host Gator"},2031665:{category_id:31,name:"PHP"},2031666:{category_id:31,name:"GMX"},2031667:{category_id:31,name:"Microsoft Developer Network"},2031668:{category_id:31,name:"ImageShack"},2031669:{category_id:31,name:"Dell Inc."},2031670:{category_id:31,name:"Microsoft Office Online"},2031671:{category_id:31,name:"Mashable"},2031672:{category_id:31,name:"Digital Point Solutions"},2031673:{category_id:31,name:"Digital Point Forums"},2031674:{category_id:31,name:"Mail Chimp"},2031675:{category_id:31,name:"Joomla!"},2031676:{category_id:31,name:"TypePad"},2031677:{category_id:31,name:"SEOmoz.org"},2031678:{category_id:31,name:"Google Groups"},2031679:{category_id:31,name:"Webs"},2031680:{category_id:31,name:"Speedtest.net"},2097153:{category_id:32,name:"IGN"},2097154:{category_id:32,name:"Publishers Clearing House"},2097155:{category_id:32,name:"MiniClip"},2097156:{category_id:32,name:"888"},2097157:{category_id:32,name:"Xbox"},2097158:{category_id:32,name:"GameSpot"},2097159:{category_id:32,name:"Steam"},2097160:{category_id:32,name:"League of Legends"},2097161:{category_id:32,name:"GameFAQs"},2097162:{category_id:32,name:"Yahoo! Games"},2097163:{category_id:32,name:"William Hill Online"},2097164:{category_id:32,name:"Electronic Arts"},2097165:{category_id:32,name:"Betfair"},2097166:{category_id:32,name:"Wowhead"},2097167:{category_id:32,name:"World of PlayStation"},2097168:{category_id:32,name:"Kongregate"},2097169:{category_id:32,name:"Hattrick"},2097170:{category_id:32,name:"Roblox"},2097171:{category_id:32,name:"King"},2097172:{category_id:32,name:"Chess"},2097173:{category_id:32,name:"Ubi Soft Entertainment"},2097174:{category_id:32,name:"Minepedia"},2097175:{category_id:32,name:"Call of Duty"},2097176:{category_id:32,name:"Addictinggames"},2097177:{category_id:32,name:"MMO-Champion"},2097178:{category_id:32,name:"Bet at Home"},2097179:{category_id:32,name:"FreeLotto"},2097180:{category_id:32,name:"Square Enix"},2097181:{category_id:32,name:"PlayStation"},2097182:{category_id:32,name:"Travian"},2097183:{category_id:32,name:"MSN Gaming Zone"},2097184:{category_id:32,name:"Games"},2097185:{category_id:32,name:"Rockstar Games"},2097186:{category_id:32,name:"N4G"},2097187:{category_id:32,name:"Planet Minecraft"},2097188:{category_id:32,name:"Nvidia"},2097189:{category_id:32,name:"FreeOnlineGames"},2097190:{category_id:32,name:"Nintendo of America"},2097191:{category_id:32,name:"PopCap Games"},2097192:{category_id:32,name:"Game Trailers"},2097193:{category_id:32,name:"Covers"},2097194:{category_id:32,name:"California Lottery"},2097195:{category_id:32,name:"Team Liquid"},2097196:{category_id:32,name:"Eurogamer.net"},2097197:{category_id:32,name:"Party Casino"},2097198:{category_id:32,name:"Game Informer"},2097199:{category_id:32,name:"Penny Arcade"},2097200:{category_id:32,name:"GiantBomb"},2097201:{category_id:32,name:"GameHouse"},2097202:{category_id:32,name:"Curse"},2097203:{category_id:32,name:"Star Wars"},2097204:{category_id:32,name:"PC Gamer Online"},2097205:{category_id:32,name:"BoardGameGeek"},2097206:{category_id:32,name:"Bet365 Affiliates"},2097207:{category_id:32,name:"Bulbagarden / Bulbapedia"},2097208:{category_id:32,name:"OGame.org"},2097209:{category_id:32,name:"Space Federation"},2097210:{category_id:32,name:"Hasbro"},2097211:{category_id:32,name:"Enjin"},2097212:{category_id:32,name:"Perfect World Entertainment"},2097213:{category_id:32,name:"Ladbrokes"},2097214:{category_id:32,name:"Florida Lottery"},2097215:{category_id:32,name:"Paddy Power"},2097216:{category_id:32,name:"Shockwave"},2097217:{category_id:32,name:"Virtua Fighter 4"},2097218:{category_id:32,name:"Cheat Code Central"},2097219:{category_id:32,name:"Bukkit"},2097220:{category_id:32,name:"Oddschecker"},2097221:{category_id:32,name:"Xbox Media Center"},2097222:{category_id:32,name:"BioWare"},2097223:{category_id:32,name:"WoWWiki"},2097224:{category_id:32,name:"Games Radar US"},2097225:{category_id:32,name:"G4 TV"},2097226:{category_id:32,name:"JigZone"},2097227:{category_id:32,name:"Two Plus Two Publishing"},2097228:{category_id:32,name:"Win Every Game"},2097229:{category_id:32,name:"Zylom"},2097230:{category_id:32,name:"Station"},2097231:{category_id:32,name:"Blizzard.com"},2097232:{category_id:32,name:"Super Cheats"},2097233:{category_id:32,name:"TheSims3"},2097234:{category_id:32,name:"Computer and Video Games"},2097235:{category_id:32,name:"Xbox 360 Achievements"},2097236:{category_id:32,name:"Soccer Manager"},2097237:{category_id:32,name:"FreeGamePick"},2097238:{category_id:32,name:"Battlefield Play4Free"},2097239:{category_id:32,name:"The Trivia Portal"},2097240:{category_id:32,name:"VG247"},2097241:{category_id:32,name:"Affiliates United"},2097242:{category_id:32,name:"Stardock"},2097243:{category_id:32,name:"Gearbox Software"},2097244:{category_id:32,name:"sporcle"},2097245:{category_id:32,name:"Gamasutra"},2097246:{category_id:32,name:"Poker News"},2097247:{category_id:32,name:"Nexon America Inc."},21:{category_id:0,name:"Lava-Lava"},2162689:{category_id:33,name:"National Institutes of Health (NIH)"},2162690:{category_id:33,name:"WebMD"},2162691:{category_id:33,name:"PubMed"},2162692:{category_id:33,name:"MayoClinic"},2162693:{category_id:33,name:"Medicine Net"},2162694:{category_id:33,name:"Natural Health Information Articles and Health Newsletter by Dr. Joseph Mercola"},2162695:{category_id:33,name:"Drugs"},2162696:{category_id:33,name:"Mens Health"},2162697:{category_id:33,name:"MedlinePlus"},2162698:{category_id:33,name:"WeightWatchers"},2162699:{category_id:33,name:"Centers for Disease Control and Prevention"},2162700:{category_id:33,name:"Psychology Today"},2162701:{category_id:33,name:"Calorie Count"},2162702:{category_id:33,name:"AIDS Patent Database"},2162703:{category_id:33,name:"Dr. Batras"},2162704:{category_id:33,name:"Medscape"},2162705:{category_id:33,name:"nhs.uk"},2162706:{category_id:33,name:"Kaiser Permanente"},2162707:{category_id:33,name:"who.int"},2162708:{category_id:33,name:"Health Boards"},2162709:{category_id:33,name:"Health Media Ventures"},2162710:{category_id:33,name:"KidsHealth"},2162711:{category_id:33,name:"Food and Drug Administration"},2162712:{category_id:33,name:"Self Magazine"},2162713:{category_id:33,name:"Makeup Alley"},2162714:{category_id:33,name:"HealthCentral"},2162715:{category_id:33,name:"Prevention Magazine"},2162716:{category_id:33,name:"RealAge"},2162717:{category_id:33,name:"NetDoctor"},2162718:{category_id:33,name:"FEMA"},2162719:{category_id:33,name:"Fitness Magazine"},2162720:{category_id:33,name:"Vitals"},2162721:{category_id:33,name:"Total Beauty"},2162722:{category_id:33,name:"RxList"},2162723:{category_id:33,name:"British Medical Journal"},2162724:{category_id:33,name:"Steve Pavlina"},2162725:{category_id:33,name:"American Psychological Association"},2162726:{category_id:33,name:"MedcoHealth"},2162727:{category_id:33,name:"eMedTV Health Information"},2162728:{category_id:33,name:"American Cancer Society"},2162729:{category_id:33,name:"Self Nutrition Data"},2162730:{category_id:33,name:"Nuance Communications"},2162731:{category_id:33,name:"Tehran University of Medical Sciences"},2162732:{category_id:33,name:"Weil Lifestyle"},2162733:{category_id:33,name:"Wellness"},2162734:{category_id:33,name:"PatientUK"},2162735:{category_id:33,name:"National Cancer Institute"},2162736:{category_id:33,name:"24 Hour Fitness"},2162737:{category_id:33,name:"San Diego State University Graduate School of Public Health"},2162738:{category_id:33,name:"Telegraph Health"},2162739:{category_id:33,name:"Earth Clinic"},2162740:{category_id:33,name:"Mens Fitness"},2162741:{category_id:33,name:"Anthony Robbins"},2162742:{category_id:33,name:"Health Guru"},2162743:{category_id:33,name:"Cleveland Clinic"},2162744:{category_id:33,name:"BioMed Central"},2162745:{category_id:33,name:"Become Gorgeous"},2162746:{category_id:33,name:"The Student Doctor Network"},2162747:{category_id:33,name:"The New England Journal of Medicine"},2162748:{category_id:33,name:"American Diabetes Association"},2162749:{category_id:33,name:"Spine Health"},2162750:{category_id:33,name:"Social Anxiety Support"},2162751:{category_id:33,name:"Institute for Integrative Nutrition"},2162752:{category_id:33,name:"The Penis Exercise Forum"},2162753:{category_id:33,name:"3 Fat Chicks on a Diet!"},2162754:{category_id:33,name:"NaturallyCurly"},2162755:{category_id:33,name:"Allnurses"},2162756:{category_id:33,name:"Cure Zone"},2162757:{category_id:33,name:"DocCheck"},2162758:{category_id:33,name:"menshealth.co.uk"},2162759:{category_id:33,name:"Occupational Safety &amp; Health Administration"},2162760:{category_id:33,name:"Planned Parenthood Federation of America"},2162761:{category_id:33,name:"DrRobertRey"},2162762:{category_id:33,name:"Sutter Health"},2162763:{category_id:33,name:"My Home Remedies"},2162764:{category_id:33,name:"Lab Tests Online"},2162765:{category_id:33,name:"American Academy of Family Physicians"},2162766:{category_id:33,name:"American Medical Association"},2162767:{category_id:33,name:"Shiraz University of Medical Sciences"},2162768:{category_id:33,name:"PetMD"},2162769:{category_id:33,name:"Health and Safety Executive"},2162770:{category_id:33,name:"SCORE Counselors to Americas Small Business"},2162771:{category_id:33,name:"Laboratory Corporation of America"},2162772:{category_id:33,name:"Alzheimer s Association"},2162773:{category_id:33,name:"Isfahan University of Medical Sciences"},2162774:{category_id:33,name:"National Institute of Diabetes and Digestive and Kidney Diseases"},2162775:{category_id:33,name:"Celiac Disease and Gluten-Free Diet Support Center"},2162776:{category_id:33,name:"Best Health"},2162777:{category_id:33,name:"Hairfinder Hair Fashion Portal"},2162778:{category_id:33,name:"Medical News Daily"},2162779:{category_id:33,name:"UKhairdressers"},22:{category_id:0,name:"PaltalkScene"},2228225:{category_id:34,name:"eHow"},2228226:{category_id:34,name:"Yelp"},2228227:{category_id:34,name:"Groupon"},2228228:{category_id:34,name:"Engadget"},2228229:{category_id:34,name:"GSM Arena"},2228230:{category_id:34,name:"Allrecipes"},2228231:{category_id:34,name:"RetailMeNot"},2228232:{category_id:34,name:"CNET Reviews"},2228233:{category_id:34,name:"Coupons"},2228234:{category_id:34,name:"Gizmodo"},2228235:{category_id:34,name:"BabyCenter"},2228236:{category_id:34,name:"Yahoo! Shopping"},2228237:{category_id:34,name:"Nextag"},2228238:{category_id:34,name:"Toms Hardware Guide"},2228239:{category_id:34,name:"Yahoo Autos"},2228240:{category_id:34,name:"Digital Photography Review"},2228241:{category_id:34,name:"FixYa"},2228242:{category_id:34,name:"Instructables"},2228243:{category_id:34,name:"The Verge"},2228244:{category_id:34,name:"Shopping"},2228245:{category_id:34,name:"Better Business Bureau"},2228246:{category_id:34,name:"FatWallet"},2228247:{category_id:34,name:"CafeMom"},2228248:{category_id:34,name:"Internal Revenue Service"},2228249:{category_id:34,name:"The Motley Fool"},2228250:{category_id:34,name:"Edmunds"},2228251:{category_id:34,name:"bankrate"},2228252:{category_id:34,name:"Martha Stewart Living Omnimedia"},2228253:{category_id:34,name:"mobile9"},2228254:{category_id:34,name:"Kelley Blue Book"},2228255:{category_id:34,name:"Better Homes &amp; Gardens"},2228256:{category_id:34,name:"Consumer Reports Online"},2228257:{category_id:34,name:"Phone Arena"},2228258:{category_id:34,name:"Real Simple"},2228259:{category_id:34,name:"Apartment Therapy"},2228260:{category_id:34,name:"PriceGrabber"},2228261:{category_id:34,name:"Shopzilla"},2228262:{category_id:34,name:"Bureau of Consular Affairs"},2228263:{category_id:34,name:"Cooks"},2228264:{category_id:34,name:"Epinions"},2228265:{category_id:34,name:"bradsdeals"},2228266:{category_id:34,name:"MouthShut"},2228267:{category_id:34,name:"Blu-ray"},2228268:{category_id:34,name:"Epicurious"},2228269:{category_id:34,name:"Digital Trends"},2228270:{category_id:34,name:"Betty Crocker"},2228271:{category_id:34,name:"OpenDNS"},2228272:{category_id:34,name:"AOL Autos"},2228273:{category_id:34,name:"GardenWeb"},2228274:{category_id:34,name:"Ciao"},2228275:{category_id:34,name:"BGR"},2228276:{category_id:34,name:"Motor Trend Online"},2228277:{category_id:34,name:"Simply Recipes"},2228278:{category_id:34,name:"Rip-off Report"},2228279:{category_id:34,name:"Broadband Reports"},2228280:{category_id:34,name:"Kraft Foods Recipes"},2228281:{category_id:34,name:"Military"},2228282:{category_id:34,name:"Kaboodle"},2228283:{category_id:34,name:"DIY Network"},2228284:{category_id:34,name:"Apartment Therapys The Kitchn"},2228285:{category_id:34,name:"Parents"},2228286:{category_id:34,name:"The Pillsbury Company"},2228287:{category_id:34,name:"Care"},2228288:{category_id:34,name:"Ubergizmo"},2228289:{category_id:34,name:"EatingWell"},2228290:{category_id:34,name:"AVForums"},2228291:{category_id:34,name:"Cooking Light"},2228292:{category_id:34,name:"lifehack.org"
},2228293:{category_id:34,name:"Carfax"},2228294:{category_id:34,name:"Social Security Administration"},2228295:{category_id:34,name:"Forums for the Chaotic Home"},2228296:{category_id:34,name:"This Old House Online"},2228297:{category_id:34,name:"ReviewCentre"},2228298:{category_id:34,name:"Kiplinger"},2228299:{category_id:34,name:"Coupon Mom"},2228300:{category_id:34,name:"Food &amp; Wine Online"},2228301:{category_id:34,name:"Jamie Oliver"},2228302:{category_id:34,name:"ConsumerSearch"},2228303:{category_id:34,name:"Geekologie"},2228304:{category_id:34,name:"Photography on the Net"},2228305:{category_id:34,name:"Medicare"},2228306:{category_id:34,name:"GasBuddy Organization Inc."},2228307:{category_id:34,name:"Complaints Board"},2228308:{category_id:34,name:"Good Housekeeping"},2228309:{category_id:34,name:"Pampers"},2228310:{category_id:34,name:"Southern Living Online"},2228311:{category_id:34,name:"Become"},2228312:{category_id:34,name:"Moms Who Think"},2228313:{category_id:34,name:"Mothering Magazine"},2228314:{category_id:34,name:"Think Baby Names"},2293761:{category_id:35,name:"Thesaurus"},2293762:{category_id:35,name:"Weebly"},2293763:{category_id:35,name:"ESPN Cricinfo"},2293764:{category_id:35,name:"Y8"},2293765:{category_id:35,name:"Universal Currency Converter"},2293766:{category_id:35,name:"Time and Date"},2293767:{category_id:35,name:"How Stuff Works"},2293768:{category_id:35,name:"Soccernet"},2293769:{category_id:35,name:"Reverso"},2293770:{category_id:35,name:"Stardoll"},2293771:{category_id:35,name:"000webhost"},2293772:{category_id:35,name:"Uefa"},2293773:{category_id:35,name:"The Toronto Star"},2293774:{category_id:35,name:"FIFA.com"},2293775:{category_id:35,name:"Girls Go Games"},2293776:{category_id:35,name:"Dynamic Drive DHTML Code Library"},2293777:{category_id:35,name:"Bureau of Meteorology"},2293778:{category_id:35,name:"ScienceDaily"},2293779:{category_id:35,name:"Manchester United Football Club"},2293780:{category_id:35,name:"Khan Academy"},2293781:{category_id:35,name:"Earthquake Information"},2293782:{category_id:35,name:"Barbie"},2293783:{category_id:35,name:"National Post"},2293784:{category_id:35,name:"WebDeveloper"},2293785:{category_id:35,name:"Starfall"},2293786:{category_id:35,name:"The Irish Times"},2293787:{category_id:35,name:"AOL Weather"},2293788:{category_id:35,name:"History Channel"},2293789:{category_id:35,name:"Honda Motor Co."},2293790:{category_id:35,name:"Space"},2293791:{category_id:35,name:"The Dilbert Zone"},2293792:{category_id:35,name:"Free Website Builder"},2293793:{category_id:35,name:"Warner Bros. Online"},2293794:{category_id:35,name:"Neopets"},2293795:{category_id:35,name:"USA.gov"},2293796:{category_id:35,name:"US Courts"},2293797:{category_id:35,name:"Popular Science"},2293798:{category_id:35,name:"Webopedia"},2293799:{category_id:35,name:"The Student Room"},2293800:{category_id:35,name:"Gaia Interactive"},2293801:{category_id:35,name:"Encyclopaedia Britannica Online"},2293802:{category_id:35,name:"New Scientist"},2293803:{category_id:35,name:"HTML Goodies"},2293804:{category_id:35,name:"Biography"},2293805:{category_id:35,name:"Maths Is Fun"},2293806:{category_id:35,name:"Archives"},2293807:{category_id:35,name:"Jet Propulsion Laboratory"},2293808:{category_id:35,name:"CBS.Sports"},2293809:{category_id:35,name:"Physics Forums"},2293810:{category_id:35,name:"National Portal of India"},2293811:{category_id:35,name:"ThinkQuest"},2293812:{category_id:35,name:"SpongeBob SquarePants at Nick"},2293813:{category_id:35,name:"Animal Planet Channel Online"},2293814:{category_id:35,name:"Funbrain"},2293815:{category_id:35,name:"StarWars"},2293816:{category_id:35,name:"Enchanted Learning"},2293817:{category_id:35,name:"GameSpy"},2293818:{category_id:35,name:"Spelling City"},2293819:{category_id:35,name:"Pokemon"},2293820:{category_id:35,name:"The Holy See"},2293821:{category_id:35,name:"Fupa Games"},2293822:{category_id:35,name:"Gameloft"},23:{category_id:0,name:"UcTalk"},2359297:{category_id:36,name:"Yahoo News"},2359298:{category_id:36,name:"The Huffington Post"},2359299:{category_id:36,name:"New York Times"},2359300:{category_id:36,name:"Google News"},2359301:{category_id:36,name:"Reddit"},2359302:{category_id:36,name:"The Guardian"},2359303:{category_id:36,name:"The Times of India"},2359304:{category_id:36,name:"Washington Post"},2359305:{category_id:36,name:"Drudge Report"},2359306:{category_id:36,name:"USA Today"},2359307:{category_id:36,name:"Examiner"},2359308:{category_id:36,name:"AccuWeather"},2359309:{category_id:36,name:"Los Angeles Times"},2359310:{category_id:36,name:"Time Magazine"},2359311:{category_id:36,name:"Weather Underground"},2359312:{category_id:36,name:"News.au"},2359313:{category_id:36,name:"The Sydney Morning Herald"},2359314:{category_id:36,name:"Yahoo Weather"},2359315:{category_id:36,name:"Al Arabiya News Channel"},2359316:{category_id:36,name:"Breitbart"},2359317:{category_id:36,name:"San Francisco Chronicle"},2359318:{category_id:36,name:"National Geographic"},2359319:{category_id:36,name:"HindustanTimes"},2359320:{category_id:36,name:"NewsMax"},2359321:{category_id:36,name:"Topix"},2359322:{category_id:36,name:"Chicago Tribune"},2359323:{category_id:36,name:"Houston Chronicle"},2359324:{category_id:36,name:"PRWeb"},2359325:{category_id:36,name:"The Globe and Mail"},2359326:{category_id:36,name:"The Age"},2359327:{category_id:36,name:"Christian Science Monitor"},2359328:{category_id:36,name:"New Jersey Online"},2359329:{category_id:36,name:"WorldNetDaily"},2359330:{category_id:36,name:"Navbharat Times"},2359331:{category_id:36,name:"Washington Times"},2359332:{category_id:36,name:"Eenadu"},2359333:{category_id:36,name:"The Associated Press"},2359334:{category_id:36,name:"Digital Spy"},2359335:{category_id:36,name:"bdnews24"},2359336:{category_id:36,name:"U.S. News &amp; World Report"},2359337:{category_id:36,name:"Yr.no"},2359338:{category_id:36,name:"The Onion"},2359339:{category_id:36,name:"Metafilter"},2359340:{category_id:36,name:"Sky News"},2359341:{category_id:36,name:"The Hill"},2359342:{category_id:36,name:"The Examiner"},2359343:{category_id:36,name:"Philly"},2359344:{category_id:36,name:"The Indian Express"},2359345:{category_id:36,name:"National Review Online"},2359346:{category_id:36,name:"DNA"},2359347:{category_id:36,name:"Malayala Manorama"},2359348:{category_id:36,name:"DailyFinance"},2359349:{category_id:36,name:"France 24"},2359350:{category_id:36,name:"Fark"},2359351:{category_id:36,name:"Intellicast"},2359352:{category_id:36,name:"NewsNow"},2359353:{category_id:36,name:"The Denver Post"},2359354:{category_id:36,name:"PR Newswire"},2359355:{category_id:36,name:"Chicago Sun-Times"},2359356:{category_id:36,name:"The Atlanta Journal-Constitution"},2359357:{category_id:36,name:"Herald Sun"},2359358:{category_id:36,name:"The Australian"},2359359:{category_id:36,name:"The Arizona Republic"},2359360:{category_id:36,name:"Detroit Free Press"},2359361:{category_id:36,name:"Mathrubhumi Daily"},2359362:{category_id:36,name:"San Jose Mercury News"},2359363:{category_id:36,name:"Newsday"},2359364:{category_id:36,name:"Vancouver Province"},2359365:{category_id:36,name:"Star Tribune"},24:{category_id:0,name:"WinpopupX"},2424833:{category_id:37,name:"Booking"},2424834:{category_id:37,name:"TripAdvisor"},2424835:{category_id:37,name:"9Gag"},2424836:{category_id:37,name:"Agoda"},2424837:{category_id:37,name:"Expedia"},2424838:{category_id:37,name:"Southwest"},2424839:{category_id:37,name:"Priceline"},2424840:{category_id:37,name:"CRACKED"},2424841:{category_id:37,name:"Kayak"},2424842:{category_id:37,name:"United Airlines"},2424843:{category_id:37,name:"Delta Air Lines"},2424844:{category_id:37,name:"American Airlines"},2424845:{category_id:37,name:"Lonely Planet"},2424846:{category_id:37,name:"Orbitz"},2424847:{category_id:37,name:"Travelocity"},2424848:{category_id:37,name:"Marriott International"},2424849:{category_id:37,name:"Ryanair"},2424850:{category_id:37,name:"Hilton"},2424851:{category_id:37,name:"EasyJet"},2424852:{category_id:37,name:"Yahoo! Travel"},2424853:{category_id:37,name:"Autoblog"},2424854:{category_id:37,name:"CouchSurfing"},2424855:{category_id:37,name:"British Airways"},2424856:{category_id:37,name:"Hotwire"},2424857:{category_id:37,name:"Emirates"},2424858:{category_id:37,name:"Lufthansa"},2424859:{category_id:37,name:"CollegeHumor"},2424860:{category_id:37,name:"Travelzoo"},2424861:{category_id:37,name:"Japan Airlines"},2424862:{category_id:37,name:"Ford Motor Company"},2424863:{category_id:37,name:"Open Table"},2424864:{category_id:37,name:"Wikitravel"},2424865:{category_id:37,name:"Time Out"},2424866:{category_id:37,name:"Metropolitan Transportation Authority"},2424867:{category_id:37,name:"US Airways"},2424868:{category_id:37,name:"Vacation Rentals by Owner"},2424869:{category_id:37,name:"LanChile"},2424870:{category_id:37,name:"KLM Royal Dutch Airlines"},2424871:{category_id:37,name:"Petfinder"},2424872:{category_id:37,name:"Accorhotels"},2424873:{category_id:37,name:"Library of Congress"},2424874:{category_id:37,name:"Venere"},2424875:{category_id:37,name:"SkyScanner"},2424876:{category_id:37,name:"Hyatt Hotels and Resorts"},2424877:{category_id:37,name:"Geocaching"},2424878:{category_id:37,name:"Aero Berlin"},2424879:{category_id:37,name:"Virgin Atlantic Airlines"},2424880:{category_id:37,name:"Airliners.net"},2424881:{category_id:37,name:"HomeAway Vacation Rentals Worldwide"},2424882:{category_id:37,name:"Jalopnik"},2424883:{category_id:37,name:"Turkish Airlines"},2424884:{category_id:37,name:"NetCarShow"},2424885:{category_id:37,name:"Qatar Airways"},2424886:{category_id:37,name:"Hostelworld"},2424887:{category_id:37,name:"The Straight Dope by Cecil Adams"},2424888:{category_id:37,name:"Flightradar24"},2424889:{category_id:37,name:"HRS Hotel Reservation Service"},2424890:{category_id:37,name:"Hostelbookers"},2424891:{category_id:37,name:"Qantas Airways"},2424892:{category_id:37,name:"Alaska Airlines"},2424893:{category_id:37,name:"Restaurant"},2424894:{category_id:37,name:"Car and Driver"},2424895:{category_id:37,name:"VirtualTourist"},2424896:{category_id:37,name:"Air Canada"},2424897:{category_id:37,name:"Expedia.ca"},2424898:{category_id:37,name:"Volvo Car Corporation"},2424899:{category_id:37,name:"Late Rooms"},2424900:{category_id:37,name:"Intercontinental Hotels Group"},2424901:{category_id:37,name:"Saudi Arabian Airlines"},2424902:{category_id:37,name:"Top Gear"},2424903:{category_id:37,name:"Porsche"},2424904:{category_id:37,name:"Crave Online"},2424905:{category_id:37,name:"Cathay Pacific Airways"},2424906:{category_id:37,name:"Cebu Pacific Air"},2424907:{category_id:37,name:"Iberia"},2424908:{category_id:37,name:"Cheap Tickets"},2424909:{category_id:37,name:"Florida Department of Transportation"},2424910:{category_id:37,name:"Cheap Flights"},2424911:{category_id:37,name:"AR15"},2424912:{category_id:37,name:"Frommers"},2424913:{category_id:37,name:"Fodors Travel Online"},2424914:{category_id:37,name:"AirTran Airways"},2424915:{category_id:37,name:"Popular Mechanics"},2424916:{category_id:37,name:"AeroMexico"},2424917:{category_id:37,name:"Carnival Cruise Lines"},2424918:{category_id:37,name:"Honda Cars"},2424919:{category_id:37,name:"Aeroflot"},2424920:{category_id:37,name:"Travel and Leisure Magazine"},2490369:{category_id:38,name:"Yahoo! Answers"},2490370:{category_id:38,name:"WikiAnswers"},2490371:{category_id:38,name:"WordReference"},2490372:{category_id:38,name:"The Free Dictionary"},2490373:{category_id:38,name:"Goodreads"},2490374:{category_id:38,name:"LEO English-German Dictionary"},2490375:{category_id:38,name:"World Wide Web Consortium"},2490376:{category_id:38,name:"MapQuest"},2490377:{category_id:38,name:"YELLOWPAGES"},2490378:{category_id:38,name:"Dict.cc"},2490379:{category_id:38,name:"WhitePages"},2490380:{category_id:38,name:"Blackboard"},2490381:{category_id:38,name:"Massachusetts Institute of Technology"},2490382:{category_id:38,name:"Stanford University"},2490383:{category_id:38,name:"JustAnswer"},2490384:{category_id:38,name:"BrainyQuote"},2490385:{category_id:38,name:"Harvard University"},2490386:{category_id:38,name:"Investopedia"},2490387:{category_id:38,name:"Lumosity"},2490388:{category_id:38,name:"eCollege"},2490389:{category_id:38,name:"University of California"},2490390:{category_id:38,name:"SuperPages"},2490391:{category_id:38,name:"Sulekha Yellow Pages India"},2490392:{category_id:38,name:"University of Phoenix"},2490393:{category_id:38,name:"MyLife"},2490394:{category_id:38,name:"wiseGEEK"},2490395:{category_id:38,name:"The University of Michigan"},2490396:{category_id:38,name:"Cornell University"},2490397:{category_id:38,name:"The University of Texas at Austin"},2490398:{category_id:38,name:"The Pennsylvania State University"},2490399:{category_id:38,name:"GMT"},2490400:{category_id:38,name:"U. S. Department of Education"},2490401:{category_id:38,name:"Wikiquote"},2490402:{category_id:38,name:"yourDictionary"},2490403:{category_id:38,name:"University of Washington"},2490404:{category_id:38,name:"Cambridge University Press"},2490405:{category_id:38,name:"192"},2490406:{category_id:38,name:"Columbia University"},2490407:{category_id:38,name:"Purdue University"},2490408:{category_id:38,name:"University of Wisconsin-Madison"},2490409:{category_id:38,name:"Elsevier"},2490410:{category_id:38,name:"YellowPages.ca"},2490411:{category_id:38,name:"University of Pennsylvania"},2490412:{category_id:38,name:"Yahoo! Maps and Driving Directions."},2490413:{category_id:38,name:"Spanish Dictionary"},2490414:{category_id:38,name:"The City University of New York (CUNY)"},2490415:{category_id:38,name:"Coursera"},2490416:{category_id:38,name:"Mappy"},2490417:{category_id:38,name:"New York University"},2490418:{category_id:38,name:"Listal"},2490419:{category_id:38,name:"Experts Exchange"},2490420:{category_id:38,name:"Collegeboard.org"},2490421:{category_id:38,name:"University of Tehran"},2490422:{category_id:38,name:"Yale University"},2490423:{category_id:38,name:"ThinkExist"},2490424:{category_id:38,name:"AllExperts Questions &amp; Answers"},2490425:{category_id:38,name:"WorldCat"},2490426:{category_id:38,name:"University of Florida"},2490427:{category_id:38,name:"Princeton University"},2490428:{category_id:38,name:"Shabdkosh"},2490429:{category_id:38,name:"University of Toronto"},2490430:{category_id:38,name:"University of Cambridge"},2490431:{category_id:38,name:"Maps of World"},2490432:{category_id:38,name:"Michigan State University"},2490433:{category_id:38,name:"RateMyProfessors"},2490434:{category_id:38,name:"K12"},2490435:{category_id:38,name:"Cambridge Dictionary"},2490436:{category_id:38,name:"USP"},2490437:{category_id:38,name:"The Open University"},2490438:{category_id:38,name:"Carnegie Mellon University"},2490439:{category_id:38,name:"Educational Testing Service (ETS)"},2490440:{category_id:38,name:"University of Oxford"},2490441:{category_id:38,name:"University of North Carolina at Chapel Hill"},2490442:{category_id:38,name:"University of Southern California"},2490443:{category_id:38,name:"Moodle"},2490444:{category_id:38,name:"Arizona State University"},2490445:{category_id:38,name:"The University of Arizona"},2490446:{category_id:38,name:"University of Virginia"},2490447:{category_id:38,name:"Chronicle of Higher Education"},25:{category_id:0,name:"BeeTalk"},2555905:{category_id:39,name:"Google India"},2555906:{category_id:39,name:"Google UK"},2555907:{category_id:39,name:"Amazon.co.jp"},2555908:{category_id:39,name:"Amazon.co.uk"},2555909:{category_id:39,name:"Google Australia"},2555910:{category_id:39,name:"eBay UK"},2555911:{category_id:39,name:"The Daily Mail"},2555912:{category_id:39,name:"Indiatimes"},2555913:{category_id:39,name:"Wal-Mart Online"},2555914:{category_id:39,name:"Yahoo! India"},2555915:{category_id:39,name:"Best Buy Co."},2555916:{category_id:39,name:"Bet365"},2555917:{category_id:39,name:"CNN"},2555918:{category_id:39,name:"United States Postal Service (USPS)"},2555919:{category_id:39,name:"eBay India"},2555920:{category_id:39,name:"eBay.au"},2555921:{category_id:39,name:"Indian Railway Catering and Tourism Corporation"},2555922:{category_id:39,name:"Yahoo UK and Ireland"},2555923:{category_id:39,name:"POLITICO"},2555924:{category_id:39,name:"Naukri"},2555925:{category_id:39,name:"The Home Depot"},2555926:{category_id:39,name:"Macys"},2555927:{category_id:39,name:"Zhaopin"},2555928:{category_id:39,name:"Road Runner"},2555929:{category_id:39,name:"Kijiji"},2555930:{category_id:39,name:"Yahoo India News Services"},2555931:{category_id:39,name:"Maktoob"},2555932:{category_id:39,name:"RealClear Politics"},2555933:{category_id:39,name:"IBM Corporation"},2555934:{category_id:39,name:"OneIndia.in"},2555935:{category_id:39,name:"National Oceanic and Atmospheric Administration (NOAA)"},2555936:{category_id:39,name:"Government of Canada"},2555937:{category_id:39,name:"Google News India"},2555938:{category_id:39,name:"IBN Live"},2555939:{category_id:39,name:"Toys R Us"},2555940:{category_id:39,name:"MoneyControl"},2555941:{category_id:39,name:"State of California"},2555942:{category_id:39,name:"New York Daily News"},2555943:{category_id:39,name:"Google NewZealand"},2555944:{category_id:39,name:"NHK"},2555945:{category_id:39,name:"MSN UK"},2555946:{category_id:39,name:"Official Major League Baseball"},2555947:{category_id:39,name:"Slate Magazine"},2555948:{category_id:39,name:"Nordstrom"},2555949:{category_id:39,name:"craigslist"},2555950:{category_id:39,name:"Trulia"},26:{category_id:0,name:"Squiggle"},2621441:{category_id:40,name:"Yahoo! Japan"},2621442:{category_id:40,name:"TED"},2621443:{category_id:40,name:"ScienceDirect"},2621444:{category_id:40,name:"United States Geological Survey (USGS)"},2621445:{category_id:40,name:"Care2"},2621446:{category_id:40,name:"Nature"},2621447:{category_id:40,name:"Japan Meteorological Agency"},2621448:{category_id:40,name:"IEEE"},2621449:{category_id:40,name:"U.S. Department of Agriculture"},262145:{category_id:4,name:"Windows Media Player"},2621450:{category_id:40,name:"JSTOR"},2621451:{category_id:40,name:"RedOrbit"},2621452:{category_id:40,name:"Scientific American"},2621453:{category_id:40,name:"Foreign Policy"},2621454:{category_id:40,name:"LiveScience"},2621455:{category_id:40,name:"National Park Service"},2621456:{category_id:40,name:"Mother Nature Network"},2621457:{category_id:40,name:"US Census Bureau"},2621458:{category_id:40,name:"Bureau of Labor Statistics"},2621459:{category_id:40,name:"Met Office"},262146:{category_id:4,name:"RealPlayer"},2621460:{category_id:40,name:"Environmental Protection Agency"},2621461:{category_id:40,name:"Technology Review"},2621462:{category_id:40,name:"National Geographic News"},2621463:{category_id:40,name:"University of Colorado at Boulder"},2621464:{category_id:40,name:"Wolfram Research"},2621465:{category_id:40,name:"Metric Conversions"},2621466:{category_id:40,name:"Head-Fi"},2621467:{category_id:40,name:"Online Conversion"},2621468:{category_id:40,name:"American Chemical Society"},2621469:{category_id:40,name:"ResearchGATE"},262147:{category_id:4,name:"Winamp"},2621470:{category_id:40,name:"Food and Agriculture Organization (FAO)"},2621471:{category_id:40,name:"Science Magazine"},2621472:{category_id:40,name:"The MathWorks"},2621473:{category_id:40,name:"Azteca Systems Cityworks"},2621474:{category_id:40,name:"arXiv.org e-Print Archive"},2621475:{category_id:40,name:"Gramota.ru"},2621476:{category_id:40,name:"Hydrometeorological Prediction Center"},2621477:{category_id:40,name:"Discover Magazine"},2621478:{category_id:40,name:"italki"},2621479:{category_id:40,name:"arabic keyboard"},262148:{category_id:4,name:"QuickTime"},2621480:{category_id:40,name:"Coolmath"},2621481:{category_id:40,name:"Alldatasheet"},2621482:{category_id:40,name:"Nikon Corporation (Global)"},2621483:{category_id:40,name:"GeoNames"},2621484:{category_id:40,name:"Connexor Parsers"},2621485:{category_id:40,name:"National Institute for Statistics and Economic Studies"},2621486:{category_id:40,name:"Indian Institute of Technology"},2621487:{category_id:40,name:"NIST. National Institute of Standards and Technology"},2621488:{category_id:40,name:"Social Science Research Network"},2621489:{category_id:40,name:"Behind the Name"},262149:{category_id:4,name:"Weather Channel"},2621490:{category_id:40,name:"SpaceWeather"},2621491:{category_id:40,name:"LyngSat"},2621492:{category_id:40,name:"Botanical"},2621493:{category_id:40,name:"Grist Magazine"},2621494:{category_id:40,name:"Blue Letter Bible"},2621495:{category_id:40,name:"European Southern Observatory (ESO)"},2621496:{category_id:40,name:"ScienceBlogs"},2621497:{category_id:40,name:"Iranian Seismological Center"},2621498:{category_id:40,name:"EurekAlert!"},2621499:{category_id:40,name:"IBGE"},262150:{category_id:4,name:"PPTV (PPLive)"},2621500:{category_id:40,name:"Environmental Graffiti"},2621501:{category_id:40,name:"University of Missouri"},2621502:{category_id:40,name:"About Psychology"},2621503:{category_id:40,name:"MathWorld"},262151:{category_id:4,name:"QQLive"},262152:{category_id:4,name:"LOVEFiLM"},262153:{category_id:4,name:"ITV"},262154:{category_id:4,name:"iTunes"},262155:{category_id:4,name:"Adobe Flash"},262156:{category_id:4,name:"Channel 5"},262157:{category_id:4,name:"iQIYI/PPS"},262158:{category_id:4,name:"Headweb"},262159:{category_id:4,name:"Viaplay"},262160:{category_id:4,name:"KKBox"},262161:{category_id:4,name:"WATCHEVER"},262162:{category_id:4,name:"Maxdome"},262163:{category_id:4,name:"Twitch.tv"},262164:{category_id:4,name:"TED"},262165:{category_id:4,name:"RTP"},262166:{category_id:4,name:"SBS"},262167:{category_id:4,name:"UUSee"},262168:{category_id:4,name:"SopCast"},262169:{category_id:4,name:"KeyHoleTV"},262170:{category_id:4,name:"Sina Video"},262171:{category_id:4,name:"Metacafe"},262172:{category_id:4,name:"Wuaki.tv"},262173:{category_id:4,name:"SHOUTcast"},262174:{category_id:4,name:"BBC-iplayer"},262175:{category_id:4,name:"Live365"},262176:{category_id:4,name:"Dailymotion"},262177:{category_id:4,name:"Filmin"},262178:{category_id:4,name:"Flixster"},262179:{category_id:4,name:"Hulu"},262181:{category_id:4,name:"NUBEOX"},262182:{category_id:4,name:"Kugou"},262183:{category_id:4,name:"MoveNetworks"},262184:{category_id:4,name:"Babelgum"},262185:{category_id:4,name:"Livestation"},262186:{category_id:4,name:"iTunes Radio"},262187:{category_id:4,name:"Miro"},262188:{category_id:4,name:"Smithsonian Channel"},262189:{category_id:4,name:"NHL"},262190:{category_id:4,name:"NicoNicoDouga"},262191:{category_id:4,name:"Ooyala"},262192:{category_id:4,name:"Photobucket"},262193:{category_id:4,name:"MLSsoccer"},262194:{category_id:4,name:"Channel 4"},262195:{category_id:4,name:"VideoDetective"},262196:{category_id:4,name:"Ustream.tv"},262197:{category_id:4,name:"Veetle"},262198:{category_id:4,name:"VeohTV"},262199:{category_id:4,name:"iTunes Festival"},262200:{category_id:4,name:"SiriusXM"},262201:{category_id:4,name:"Break.com"},262202:{category_id:4,name:"CinemaNow"},262203:{category_id:4,name:"Letv"},262204:{category_id:4,name:"RTSP"},262205:{category_id:4,name:"Funshion"},262207:{category_id:4,name:"MTV.com"},262208:{category_id:4,name:"Sohu TV"},262209:{category_id:4,name:"MP4"},262210:{category_id:4,name:"MMS/WMSP"},262211:{category_id:4,name:"FLV"},262212:{category_id:4,name:"PIPI"},262213:{category_id:4,name:"Hulkshare"},262214:{category_id:4,name:"Tudou"},262215:{category_id:4,name:"Ifeng Video "},262216:{category_id:4,name:"WSJ Live"},262217:{category_id:4,name:"Cradio"},262218:{category_id:4,name:"Roku"},262219:{category_id:4,name:"Amazon Prime Music"},262220:{category_id:4,name:"Crackle"},262221:{category_id:4,name:"Blip.tv"},262223:{category_id:4,name:"Audible"},262224:{category_id:4,name:"Web Streaming"},262226:{category_id:4,name:"Vyclone"},262227:{category_id:4,name:"China Streaming Video"},262228:{category_id:4,name:"Crunchyroll"},262229:{category_id:4,name:"EmpFlix"},262230:{category_id:4,name:"Porn.com"},262231:{category_id:4,name:"EskimoTube"},262232:{category_id:4,name:"NewBigTube"},262233:{category_id:4,name:"Madbitties"},262234:{category_id:4,name:"RTMP"},262235:{category_id:4,name:"Hustlertube"},262236:{category_id:4,name:"TnaFlix"},262237:{category_id:4,name:"Xtube"},262238:{category_id:4,name:"Yobt.tv"},262239:{category_id:4,name:"Youjizz"},262245:{category_id:4,name:"Pandora"},262246:{category_id:4,name:"Deezer"},262247:{category_id:4,name:"VLC"},262250:{category_id:4,name:"Livesearch.tv/CoolStreaming"},262251:{category_id:4,name:"Qello"},262252:{category_id:4,name:"CNTV"},262254:{category_id:4,name:"Thunderkankan"},262256:{category_id:4,name:"Youtube"},262258:{category_id:4,name:"56.com"},262259:{category_id:4,name:"RMVB"},262260:{category_id:4,name:"Youku.com"},262261:{category_id:4,name:"SWF"},262262:{category_id:4,name:"AVI"},262263:{category_id:4,name:"MP3"},262264:{category_id:4,name:"WMA"},262265:{category_id:4,name:"MOV"},262266:{category_id:4,name:"WMV"},262267:{category_id:4,name:"ASF"},262268:{category_id:4,name:"Vudu"},262270:{category_id:4,name:"PBS Video"},262271:{category_id:4,name:"Freecast"},262272:{category_id:4,name:"Ku6"},262274:{category_id:4,name:"Spotify"},262275:{category_id:4,name:"LastFM"},262276:{category_id:4,name:"Netflix"},262277:{category_id:4,name:"Uitzendinggemist"},262278:{category_id:4,name:"RTL.nl"},262279:{category_id:4,name:"TudouVa"},262280:{category_id:4,name:"GYAO"},262281:{category_id:4,name:"BARKS"},262283:{category_id:4,name:"Baofeng"},262284:{category_id:4,name:"Qvod/Bobohu"},262285:{category_id:4,name:"Grooveshark"},262286:{category_id:4,name:"Microsoft Silverlight"},262287:{category_id:4,name:"6.cn"},262288:{category_id:4,name:"Rhapsody"},262290:{category_id:4,name:"Imgo TV"},262291:{category_id:4,name:"Joy.cn"},262292:{category_id:4,name:"Yinyuetai"},262293:{category_id:4,name:"Hichannel"},262294:{category_id:4,name:"ADNstream"},262295:{category_id:4,name:"Livestream"},262296:{category_id:4,name:"YoukuVa "},262298:{category_id:4,name:"Voddler"},262301:{category_id:4,name:"Flixwagon"},262302:{category_id:4,name:"M4V"},262303:{category_id:4,name:"Podcast"},262305:{category_id:4,name:"Shazam"},262306:{category_id:4,name:"TuneIn"},262308:{category_id:4,name:"BaiduMusic"},262310:{category_id:4,name:"DoubanFM"},262311:{category_id:4,name:"IMDb.com"},262312:{category_id:4,name:"XVideos.com"},262313:{category_id:4,name:"xHamster.com"},262314:{category_id:4,name:"PornHub.com"},262315:{category_id:4,name:"LiveJasmin.com"},262316:{category_id:4,name:"XNXX.com"},262317:{category_id:4,name:"YouPorn.com"},262318:{category_id:4,name:"MajorLeagueGaming"},262319:{category_id:4,name:"Wowtv.co.kr"},262320:{category_id:4,name:"iMBC"},262321:{category_id:4,name:"AfreecaTV"},262322:{category_id:4,name:"Arirang"},262323:{category_id:4,name:"KCTVjeju"},262324:{category_id:4,name:"CJB.co.kr"},262325:{category_id:4,name:"MBN"},262326:{category_id:4,name:"MYSolive"},262327:{category_id:4,name:"KBS"},262328:{category_id:4,name:"Mwave"},262329:{category_id:4,name:"YTN"},262330:{category_id:4,name:"Musicsoda"},262331:{category_id:4,name:"FreeOnes.com"},262332:{category_id:4,name:"Streamate.com"},262333:{category_id:4,name:"Airplay"},262334:{category_id:4,name:"DAAP"},262335:{category_id:4,name:"M1905"},262336:{category_id:4,name:"VEVO"},262337:{category_id:4,name:"Amazon Instant Video"},262338:{category_id:4,name:"MixBit"},262339:{category_id:4,name:"Baomihua"},262340:{category_id:4,name:"FORA.tv"},262341:{category_id:4,name:"Vimeo"},262342:{category_id:4,name:"Vube"},262343:{category_id:4,name:"RedTube.com"},262344:{category_id:4,name:"Tube8"},262345:{category_id:4,name:"Mgoon"},262346:{category_id:4,name:"Trailers"},262347:{category_id:4,name:"HBOGO"},262348:{category_id:4,name:"MLB.com"},262349:{category_id:4,name:"Kaltura.com"},2686977:{category_id:41,name:"eBay"},2686978:{category_id:41,name:"IKEA"},2686979:{category_id:41,name:"NewEgg"},2686980:{category_id:41,name:"Multiply"},2686981:{category_id:41,name:"Gap"},2686982:{category_id:41,name:"LivingSocial"},2686983:{category_id:41,name:"Kohls"},2686984:{category_id:41,name:"Zappos"},2686985:{category_id:41,name:"BodyBuilding"},2686986:{category_id:41,name:"Overstock"},2686987:{category_id:41,name:"Barnes and Noble"},2686988:{category_id:41,name:"Lowes"},2686989:{category_id:41,name:"JCPenney"},2686990:{category_id:41,name:"Shutterfly"},2686991:{category_id:41,name:"QVC"},2686992:{category_id:41,name:"Legacy"},2686993:{category_id:41,name:"Staples"},2686994:{category_id:41,name:"Nike"},2686995:{category_id:41,name:"B&H Photo Video"},2686996:{category_id:41,name:"Ticketmaster USA"},2686997:{category_id:41,name:"Walgreens"},2686998:{category_id:41,name:"TigerDirect"},2686999:{category_id:41,name:"Victorias Secret"},2687000:{category_id:41,name:"Pixmania"},2687001:{category_id:41,name:"GameStop"},2687002:{category_id:41,name:"Buy"},2687003:{category_id:41,name:"Trade Me"},2687004:{category_id:41,name:"AutoTrader"},2687005:{category_id:41,name:"Home Shopping Network"},2687006:{category_id:41,name:"Sams Club"},2687007:{category_id:41,name:"Bed"},2687008:{category_id:41,name:"CafePress"},2687009:{category_id:41,name:"Souq"},2687010:{category_id:41,name:"6pm"},2687011:{category_id:41,name:"CVS/pharmacy Online CVS"},2687012:{category_id:41,name:"cars"},2687013:{category_id:41,name:"Sephora"},2687014:{category_id:41,name:"Cabelas"},2687015:{category_id:41,name:"Forever 21"},2687016:{category_id:41,name:"Lands End"},2687017:{category_id:41,name:"John Wiley and Sons"},2687018:{category_id:41,name:"Play"},2687019:{category_id:41,name:"Drugstore"},2687020:{category_id:41,name:"Blockbuster"},2687021:{category_id:41,name:"M and S Gifts"},2687022:{category_id:41,name:"Neiman Marcus"},2687023:{category_id:41,name:"Office Depot"},2687024:{category_id:41,name:"CD Universe"},2687025:{category_id:41,name:"Shopbop"},2687026:{category_id:41,name:"Recreational Equipment Incorporated"},2687027:{category_id:41,name:"StubHub"},2687028:{category_id:41,name:"JCrew"},2687029:{category_id:41,name:"NET-A-PORTER.COM"},2687030:{category_id:41,name:"iHerb"},2687031:{category_id:41,name:"Frys"},2687032:{category_id:41,name:"Focalprice"},2687033:{category_id:41,name:"L.L.Bean"},2687034:{category_id:41,name:"Saks Fifth Avenue"},2687035:{category_id:41,name:"Bloomingdales"},2687036:{category_id:41,name:"Vitacost"},2687037:{category_id:41,name:"Yoox"},2687038:{category_id:41,name:"Pottery Barn"},2687039:{category_id:41,name:"Urban Outfitters"},2687040:{category_id:41,name:"American Eagle Outfitters"},2687041:{category_id:41,name:"Disney Store"},2687042:{category_id:41,name:"Scholastic Corporation"},2687043:{category_id:41,name:"Sierra Trading Post"},2687044:{category_id:41,name:"Redbubble"},2687045:{category_id:41,name:"ModCloth Indie Clothing"},2687046:{category_id:41,name:"Future Shop"},2687047:{category_id:41,name:"Musicians Friend"},2687048:{category_id:41,name:"Advanced Book Exchange"},2687049:{category_id:41,name:"Joann"},2687050:{category_id:41,name:"GameFly"},2687051:{category_id:41,name:"Dicks Sporting Goods"},2687052:{category_id:41,name:"Harbor Freight"},2687053:{category_id:41,name:"Ralph Lauren"},2687054:{category_id:41,name:"OfficeMax"},2687055:{category_id:41,name:"Snapfish"},2687056:{category_id:41,name:"PetSmart"},2752513:{category_id:42,name:"SiteAdvisor"},2752514:{category_id:42,name:"Yahoo! Shine"},2752515:{category_id:42,name:"Match"},2752516:{category_id:42,name:"Ancestry"},2752517:{category_id:42,name:"Digg"},2752518:{category_id:42,name:"Sulekha"},2752519:{category_id:42,name:"Europa"},2752520:{category_id:42,name:"U.S. Department of State"},2752521:{category_id:42,name:"Bible Gateway"},2752522:{category_id:42,name:"Correios"},2752523:{category_id:42,name:"Wonder Wall"},2752524:{category_id:42,name:"Japan Post Service Co."},2752525:{category_id:42,name:"Change.org"},2752526:{category_id:42,name:"The Weekly Standard"},2752527:{
category_id:42,name:"European Commission"},2752528:{category_id:42,name:"Daily Kos"},2752529:{category_id:42,name:"Infowars"},2752530:{category_id:42,name:"SheKnows"},2752531:{category_id:42,name:"President Barack H. Obama"},2752532:{category_id:42,name:"Ask Men"},2752533:{category_id:42,name:"Slashdot"},2752534:{category_id:42,name:"Townhall"},2752535:{category_id:42,name:"Royal Mail"},2752536:{category_id:42,name:"Snopes"},2752537:{category_id:42,name:"AARP"},2752538:{category_id:42,name:"Church of Jesus Christ of Latter-day Saints"},2752539:{category_id:42,name:"Just Jared"},2752540:{category_id:42,name:"Complex"},2752541:{category_id:42,name:"Gallup"},2752542:{category_id:42,name:"The Register"},2752543:{category_id:42,name:"Official Resources Web Site"},2752544:{category_id:42,name:"Creative Commons"},2752545:{category_id:42,name:"NewsBusters.org"},2752546:{category_id:42,name:"The Jerusalem Post"},2752547:{category_id:42,name:"Immigration and Naturalization Service (Employment)"},2752548:{category_id:42,name:"Deutsche Post"},2752549:{category_id:42,name:"Department of Veterans Affairs"},2752550:{category_id:42,name:"DateHookup"},2752551:{category_id:42,name:"Avaaz"},2752552:{category_id:42,name:"The Animal Rescue Site"},2752553:{category_id:42,name:"PeopleSmart"},2752554:{category_id:42,name:"United Nations"},2752555:{category_id:42,name:"Free Republic"},2752556:{category_id:42,name:"Canada Post / Postes Canada"},2752557:{category_id:42,name:"MoveOn.org"},2752558:{category_id:42,name:"Astrodienst"},2752559:{category_id:42,name:"The Christian Post"},2752560:{category_id:42,name:"The Superficial"},2752561:{category_id:42,name:"La Poste"},2752562:{category_id:42,name:"Made Man"},2752563:{category_id:42,name:"Find A Grave"},2752564:{category_id:42,name:"Answerbag"},2752565:{category_id:42,name:"FamilySearch"},2752566:{category_id:42,name:"RootsWeb"},2752567:{category_id:42,name:"American Red Cross"},2752568:{category_id:42,name:"IMDb"},2752569:{category_id:42,name:"Online Parallel Bible"},2752570:{category_id:42,name:"Above Top Secret"},2752571:{category_id:42,name:"Companies House"},2752572:{category_id:42,name:"CaringBridge"},2752573:{category_id:42,name:"The World Bank Group"},2752574:{category_id:42,name:"Christian Book Distributors"},2752575:{category_id:42,name:"The Knot"},2752576:{category_id:42,name:"Australia Post"},2752577:{category_id:42,name:"Expat Blog"},2752578:{category_id:42,name:"Islamic Finder"},2752579:{category_id:42,name:"Central Bank of the Islamic Republic of Iran"},2752580:{category_id:42,name:"Treehugger"},2752581:{category_id:42,name:"David Icke"},2752582:{category_id:42,name:"Cosmopolitan"},2752583:{category_id:42,name:"Securities and Exchange Commission (SEC)"},2752584:{category_id:42,name:"FindLaw"},2752585:{category_id:42,name:"LewRockwell"},2752586:{category_id:42,name:"Esquire"},2752587:{category_id:42,name:"Avvo"},2752588:{category_id:42,name:"Foreign and Commonwealth Office"},2752589:{category_id:42,name:"GoodSearch"},2752590:{category_id:42,name:"Horoscope"},2752591:{category_id:42,name:"GQ"},28:{category_id:0,name:"Pidgin"},2818049:{category_id:43,name:"Yahoo Sports"},2818050:{category_id:43,name:"NFL.COM"},2818051:{category_id:43,name:"NBA"},2818052:{category_id:43,name:"LiveScore"},2818053:{category_id:43,name:"Bleacher Report"},2818054:{category_id:43,name:"Premierleague"},2818055:{category_id:43,name:"SkySports"},2818056:{category_id:43,name:"Fantasy games"},2818057:{category_id:43,name:"British Eurosport"},2818058:{category_id:43,name:"Rivals"},2818059:{category_id:43,name:"Formula1"},2818060:{category_id:43,name:"Scout"},2818061:{category_id:43,name:"ATPworldtour"},2818062:{category_id:43,name:"Rotoworld"},2818063:{category_id:43,name:"Sporting News"},2818064:{category_id:43,name:"NASCAR Online"},2818065:{category_id:43,name:"SB Nation"},2818066:{category_id:43,name:"FlashScore"},2818067:{category_id:43,name:"Yardbarker"},2818068:{category_id:43,name:"Deadspin"},2818069:{category_id:43,name:"The Sports Network"},2818070:{category_id:43,name:"Arsenal"},2818071:{category_id:43,name:"Liverpool Football Club"},2818072:{category_id:43,name:"Pro Football Talk"},2818073:{category_id:43,name:"NHL.com"},2818074:{category_id:43,name:"My Fantasy League"},2818075:{category_id:43,name:"ESPN Star Sports"},2818076:{category_id:43,name:"FootyTube"},2818077:{category_id:43,name:"Cricbuzz"},2818078:{category_id:43,name:"FilGoal"},2818079:{category_id:43,name:"FC Barcelona"},2818080:{category_id:43,name:"Sporting Life"},2818081:{category_id:43,name:"MaxPreps"},2818082:{category_id:43,name:"Chelsea Football Club"},2818083:{category_id:43,name:"autosport"},2818084:{category_id:43,name:"Sherdog"},2818085:{category_id:43,name:"Surfline"},2818086:{category_id:43,name:"Ultimate Fighting Championship"},2818087:{category_id:43,name:"Runners World Online"},2818088:{category_id:43,name:"Racing Post"},2818089:{category_id:43,name:"MSNBC Sports"},2818090:{category_id:43,name:"101 Great Goals"},2818091:{category_id:43,name:"Cyclingnews"},2818092:{category_id:43,name:"The Hong Kong Jockey Club"},2818093:{category_id:43,name:"Real Madrid"},2818094:{category_id:43,name:"XScores"},2818095:{category_id:43,name:"PGA Tour"},2818096:{category_id:43,name:"TEAMtalk "},2818097:{category_id:43,name:"Football365"},2818098:{category_id:43,name:"Real GM"},2818099:{category_id:43,name:"RealTime Fantasy Sports"},2818100:{category_id:43,name:"Eurosport"},2818101:{category_id:43,name:"MLB Trade Rumors"},2818102:{category_id:43,name:"Baseball Reference"},29:{category_id:0,name:"ISPQ"},3:{category_id:0,name:"AIM/ICQ/iIM"},31:{category_id:0,name:"ChatON(M)"},32:{category_id:0,name:"Caihong"},327681:{category_id:5,name:"SMTP"},327682:{category_id:5,name:"POP3"},327683:{category_id:5,name:"IMAP4"},327684:{category_id:5,name:"NNTP"},327685:{category_id:5,name:"Twig"},327686:{category_id:5,name:"GroupWise"},327687:{category_id:5,name:"au one net"},327689:{category_id:5,name:"PChome"},327690:{category_id:5,name:"DTI MyMail"},327691:{category_id:5,name:"Ymail"},327692:{category_id:5,name:"IIJ MailViewer"},327693:{category_id:5,name:"Telenet Mail"},327694:{category_id:5,name:"Open Mail"},327695:{category_id:5,name:"InfoSphere Webmail"},327696:{category_id:5,name:"Goo Mail"},327697:{category_id:5,name:"Nifty"},327698:{category_id:5,name:"QQ Mail"},327699:{category_id:5,name:"Roundcubemail"},327700:{category_id:5,name:"Zenno"},327701:{category_id:5,name:"Itm-asp"},327702:{category_id:5,name:"Biglobe"},327703:{category_id:5,name:"SquirrelMail"},327704:{category_id:5,name:"Zoho Mail"},327705:{category_id:5,name:"Inter7"},327706:{category_id:5,name:"TOK2"},327707:{category_id:5,name:"Smoug"},327708:{category_id:5,name:"1und1"},327709:{category_id:5,name:"Plala"},327710:{category_id:5,name:"WAKWAK"},327711:{category_id:5,name:"Eyejot"},327712:{category_id:5,name:"AsahiNet"},327713:{category_id:5,name:"Aikq"},327714:{category_id:5,name:"Yandex"},327715:{category_id:5,name:"Arcor"},327716:{category_id:5,name:"Bluewin"},327717:{category_id:5,name:"Directbox"},327718:{category_id:5,name:"Freenet"},327720:{category_id:5,name:"Smart Mail"},327722:{category_id:5,name:"WEB.DE"},327723:{category_id:5,name:"MS Exchange Server"},327732:{category_id:5,name:"Webmail.de"},327742:{category_id:5,name:"NETEASE Mail"},327743:{category_id:5,name:"Gmx Mail"},327744:{category_id:5,name:"Excite"},327745:{category_id:5,name:"InfoSeek Mail"},327746:{category_id:5,name:"Livedoor"},327747:{category_id:5,name:"Nate Mail"},327749:{category_id:5,name:"Optimum"},327751:{category_id:5,name:"Secureserver"},327753:{category_id:5,name:"Sina Mail"},327755:{category_id:5,name:"Rambler"},327760:{category_id:5,name:"Daum Mail"},327761:{category_id:5,name:"Mail.com"},327762:{category_id:5,name:"OCN"},327763:{category_id:5,name:"MailChimp"},327764:{category_id:5,name:"Rediff Mail"},327770:{category_id:5,name:"Korea Mail"},327774:{category_id:5,name:"Hotmail"},327775:{category_id:5,name:"Gmail"},327776:{category_id:5,name:"AOL Mail"},327778:{category_id:5,name:"COX"},327779:{category_id:5,name:"Hushmail"},327780:{category_id:5,name:"Mail.ru"},327781:{category_id:5,name:"HiNet Mail"},327782:{category_id:5,name:"Horde"},327783:{category_id:5,name:"Fastmail"},327784:{category_id:5,name:"Comcast"},327785:{category_id:5,name:"Laposte"},327786:{category_id:5,name:"Yahoo Mail"},327787:{category_id:5,name:"Usermin Mail"},327788:{category_id:5,name:"Tistory"},327789:{category_id:5,name:"Orange"},327790:{category_id:5,name:"012mail"},327791:{category_id:5,name:"T-Online"},327792:{category_id:5,name:"Jubii Mail"},327793:{category_id:5,name:"Whalemail"},327794:{category_id:5,name:"Lavabit"},327795:{category_id:5,name:"Tiscali"},33:{category_id:0,name:"KC"},34:{category_id:0,name:"IMVU"},35:{category_id:0,name:"Instan-t"},36:{category_id:0,name:"PiIM"},37:{category_id:0,name:"Xfire"},38:{category_id:0,name:"Raidcall"},393217:{category_id:6,name:"Skype"},393218:{category_id:6,name:"H.323"},393220:{category_id:6,name:"Facetime"},393221:{category_id:6,name:"Juiker"},393222:{category_id:6,name:"Sqwiggle"},393223:{category_id:6,name:"ooVoo"},393225:{category_id:6,name:"TeamSpeak"},393226:{category_id:6,name:"Ventrilo"},393228:{category_id:6,name:"SIP"},393229:{category_id:6,name:"NetMeeting"},393230:{category_id:6,name:"Inter-Asterisk"},393231:{category_id:6,name:"Net2Phone"},393232:{category_id:6,name:"MSRP"},393234:{category_id:6,name:"LINE(M)"},393235:{category_id:6,name:"Fring(M)"},393236:{category_id:6,name:"Goober"},393238:{category_id:6,name:"Viber(M)"},393239:{category_id:6,name:"Kakao(M)"},393240:{category_id:6,name:"iCall"},393242:{category_id:6,name:"Nimbuzz"},393243:{category_id:6,name:"Bobsled(M)"},393244:{category_id:6,name:"indoona"},393246:{category_id:6,name:"Tango(M)"},393247:{category_id:6,name:"Ooma"},4:{category_id:0,name:"QQ/TM"},41:{category_id:0,name:"WhatsApp(M)"},42:{category_id:0,name:"Userplane"},43:{category_id:0,name:"24im"},44:{category_id:0,name:"Camfrog"},458753:{category_id:7,name:"MSSQL"},458754:{category_id:7,name:"MySQL"},458755:{category_id:7,name:"Oracle"},458756:{category_id:7,name:"PostgreSQL"},458757:{category_id:7,name:"SAP"},458760:{category_id:7,name:"Etelos"},458761:{category_id:7,name:"Centriccrm"},458763:{category_id:7,name:"FileMaker"},458766:{category_id:7,name:"MongoDB"},458767:{category_id:7,name:"Salesforce"},458768:{category_id:7,name:"MariaDB"},46:{category_id:0,name:"Digsby"},49:{category_id:0,name:"Message Send Protocol"},5:{category_id:0,name:"Laiwang(M)"},524289:{category_id:8,name:"QQ Game"},524290:{category_id:8,name:"Our Game"},524291:{category_id:8,name:"Cga.com"},524292:{category_id:8,name:"FIFA"},524293:{category_id:8,name:"PopKart"},524294:{category_id:8,name:"Archlord"},524295:{category_id:8,name:"AddictingGames.com"},524296:{category_id:8,name:"Realgame"},524297:{category_id:8,name:"Audition"},524298:{category_id:8,name:"Koramgame"},524299:{category_id:8,name:"BnB Game"},524300:{category_id:8,name:"Chinagame"},524301:{category_id:8,name:"CS Game"},524302:{category_id:8,name:"Diablo"},524303:{category_id:8,name:"Legend"},524304:{category_id:8,name:"Lineage"},524306:{category_id:8,name:"Quake Game"},524307:{category_id:8,name:"Diablo3"},524308:{category_id:8,name:"Sina Web Game"},524310:{category_id:8,name:"WOW Game"},524311:{category_id:8,name:"Ispeakgame"},524312:{category_id:8,name:"Torchlight2"},524313:{category_id:8,name:"MapleStory"},524314:{category_id:8,name:"TowerOfSaviors(M)"},524315:{category_id:8,name:"Wolfenstein"},524316:{category_id:8,name:"Second Life"},524317:{category_id:8,name:"Kimi"},524318:{category_id:8,name:"Doof Game"},524319:{category_id:8,name:"PartyPoker"},524320:{category_id:8,name:"Pogo"},524321:{category_id:8,name:"PokerStars"},524322:{category_id:8,name:"Zango"},524323:{category_id:8,name:"Little Fighter 2"},524324:{category_id:8,name:"BomberClone"},524326:{category_id:8,name:"FSJOY"},524327:{category_id:8,name:"175pt"},524328:{category_id:8,name:"Zhuxian"},524329:{category_id:8,name:"GameTea/GameABC"},524330:{category_id:8,name:"Talesrunner"},524331:{category_id:8,name:"PK Game"},524332:{category_id:8,name:"Concerto Gate"},524333:{category_id:8,name:"TLBB"},524334:{category_id:8,name:"YBOnline"},524335:{category_id:8,name:"Xunyou"},524336:{category_id:8,name:"Mwo"},524337:{category_id:8,name:"ZF.91"},524338:{category_id:8,name:"WuLin"},524339:{category_id:8,name:"DNF Game"},524340:{category_id:8,name:"Bo Game"},524341:{category_id:8,name:"Gran Turismo"},524343:{category_id:8,name:"Electronic Arts"},524344:{category_id:8,name:"ZhengTu"},524345:{category_id:8,name:"SGOL"},524346:{category_id:8,name:"XY2Online"},524347:{category_id:8,name:"Asherons Call"},524348:{category_id:8,name:"Kali"},524349:{category_id:8,name:"EverQuest"},524350:{category_id:8,name:"XBOX"},524351:{category_id:8,name:"BrettspielWelt"},524352:{category_id:8,name:"Bet-at-Home"},524353:{category_id:8,name:"City of Heroes"},524354:{category_id:8,name:"ClubPenguin"},524355:{category_id:8,name:"StepMania"},524356:{category_id:8,name:"Battle.net"},524358:{category_id:8,name:"Apprentice"},524359:{category_id:8,name:"EA SPORTS"},524360:{category_id:8,name:"FreeLotto Game"},524361:{category_id:8,name:"Halo"},524362:{category_id:8,name:"iSketch"},524363:{category_id:8,name:"RuneScape"},524364:{category_id:8,name:"FUNMILY"},524365:{category_id:8,name:"Yeapgame"},524366:{category_id:8,name:"Grand Theft Auto"},524367:{category_id:8,name:"Lineage2"},524368:{category_id:8,name:"GM99 Game"},524369:{category_id:8,name:"RayCity"},524370:{category_id:8,name:"Rockstar Games"},524371:{category_id:8,name:"Aleph One"},524372:{category_id:8,name:"Wayi"},524373:{category_id:8,name:"CMWEBGAME"},524374:{category_id:8,name:"Call of Duty"},524375:{category_id:8,name:"CAPTAN"},524376:{category_id:8,name:"Supercell(Clash of Clans/Hay Day)"},524377:{category_id:8,name:"Need for Speed"},524379:{category_id:8,name:"Madden NFL"},524380:{category_id:8,name:"Half-Life"},524381:{category_id:8,name:"Team Fortress"},524383:{category_id:8,name:"Final Fantasy"},524384:{category_id:8,name:"Mythic"},524385:{category_id:8,name:"NetPanzer"},524386:{category_id:8,name:"Sdo.com"},524388:{category_id:8,name:"Pokemon Netbattle"},524389:{category_id:8,name:"RunUO-Ultima"},524390:{category_id:8,name:"Soldat Dedicated"},524391:{category_id:8,name:"Blizzard Entertainment"},524392:{category_id:8,name:"RIFT"},524393:{category_id:8,name:"TetriNET"},524394:{category_id:8,name:"Tibia"},524395:{category_id:8,name:"PlanetSide"},524396:{category_id:8,name:"TripleA"},524398:{category_id:8,name:"Unreal"},524399:{category_id:8,name:"Valve Steam"},524400:{category_id:8,name:"WesNOth"},524401:{category_id:8,name:"Xpilot"},524402:{category_id:8,name:"Swtor"},524403:{category_id:8,name:"EVEOnline"},524404:{category_id:8,name:"Hearthstone"},524405:{category_id:8,name:"Guild Wars"},524406:{category_id:8,name:"Zhong Hua Hero"},524407:{category_id:8,name:"Wizard101"},524408:{category_id:8,name:"SD Gundam"},524409:{category_id:8,name:"Prius"},524410:{category_id:8,name:"Age of Conan"},524411:{category_id:8,name:"RF Returns"},524412:{category_id:8,name:"AION"},524413:{category_id:8,name:"POPO Game"},524414:{category_id:8,name:"War-Rock"},524415:{category_id:8,name:"TEN Game"},524416:{category_id:8,name:"LUNA2"},524417:{category_id:8,name:"Karos"},524418:{category_id:8,name:"SPOnline"},524419:{category_id:8,name:"RO Game"},524420:{category_id:8,name:"StarCraft2"},524421:{category_id:8,name:"Itaiwanmj"},524422:{category_id:8,name:"CMWEBGAME Game"},524423:{category_id:8,name:"Beanfun Game"},524424:{category_id:8,name:"JXW"},524425:{category_id:8,name:"Nobol"},524426:{category_id:8,name:"DragonNest"},524427:{category_id:8,name:"BBonline"},524428:{category_id:8,name:"Hangame"},524429:{category_id:8,name:"Homygame"},524430:{category_id:8,name:"Sony PlayStation"},524431:{category_id:8,name:"Garena"},524432:{category_id:8,name:"91555"},524433:{category_id:8,name:"JJ Game"},524434:{category_id:8,name:"YHgame"},524435:{category_id:8,name:"Mdm365"},524436:{category_id:8,name:"7fgame"},524437:{category_id:8,name:"Dokee"},524438:{category_id:8,name:"VSA"},524439:{category_id:8,name:"Funtown"},524440:{category_id:8,name:"SF Game"},524441:{category_id:8,name:"173kh"},524442:{category_id:8,name:"Boyaapoker"},524443:{category_id:8,name:"GameCenter"},524444:{category_id:8,name:"Minecraft"},524445:{category_id:8,name:"Dark Souls"},524446:{category_id:8,name:"The Secret World"},524447:{category_id:8,name:"World2"},524448:{category_id:8,name:"CrossFire"},524449:{category_id:8,name:"XYQ"},524450:{category_id:8,name:"Nexon"},524451:{category_id:8,name:"Vindictus"},524452:{category_id:8,name:"DotA"},524453:{category_id:8,name:"PAYDAY"},524454:{category_id:8,name:"Wayi Game"},524455:{category_id:8,name:"War Thunder"},524456:{category_id:8,name:"Warframe"},524457:{category_id:8,name:"TT-Play Game"},524458:{category_id:8,name:"TT-Play"},524459:{category_id:8,name:"Robocraft"},524460:{category_id:8,name:"World of Tanks"},524461:{category_id:8,name:"Divinity"},524462:{category_id:8,name:"Left 4 Dead 2"},524463:{category_id:8,name:"DayZ"},524466:{category_id:8,name:"TXWY Game"},524479:{category_id:8,name:"Yeapgame Game"},524491:{category_id:8,name:"FUNMILY Game"},524512:{category_id:8,name:"Sony Online Entertainment"},524513:{category_id:8,name:"WSOP(M)"},524514:{category_id:8,name:"TexasHoldemPoker(M)"},524515:{category_id:8,name:"DarkSummoner(M)"},524516:{category_id:8,name:"AjaxPlay"},524517:{category_id:8,name:"AirlineMogul"},524518:{category_id:8,name:"Evony"},524519:{category_id:8,name:"BasketBallZone"},524520:{category_id:8,name:"Y8 Game"},524521:{category_id:8,name:"Y8-Y8"},524522:{category_id:8,name:"KIZI-GAMES"},524523:{category_id:8,name:"Ibibo"},524524:{category_id:8,name:"Hattrick Game"},524525:{category_id:8,name:"Godgame"},524526:{category_id:8,name:"Aswordtw(M)"},524527:{category_id:8,name:"Qme RO(M)"},524529:{category_id:8,name:"THE WORLD(M)"},524530:{category_id:8,name:"Qme JH(M)"},524531:{category_id:8,name:"Qme COS(M)"},524532:{category_id:8,name:"Qme SG(M)"},524533:{category_id:8,name:"Origin"},524534:{category_id:8,name:"LoL"},524535:{category_id:8,name:"THISISGAME"},524536:{category_id:8,name:"Miniclip Game"},524537:{category_id:8,name:"888games"},524538:{category_id:8,name:"WilliamHill"},524539:{category_id:8,name:"Betfair Game"},524540:{category_id:8,name:"Kongregate Game"},524541:{category_id:8,name:"Roblox Game"},524542:{category_id:8,name:"King Game"},524543:{category_id:8,name:"Chess Game"},54:{category_id:0,name:"Fetion"},55:{category_id:0,name:"Heyyo"},56:{category_id:0,name:"Alicall"},57:{category_id:0,name:"Qeshow"},58:{category_id:0,name:"MissLee"},589828:{category_id:9,name:"IGMP"},589829:{category_id:9,name:"SNMP"},589885:{category_id:9,name:"DNS"},589888:{category_id:9,name:"Multicast DNS"},589890:{category_id:9,name:"Finger protocol"},589916:{category_id:9,name:"DCE-RPC"},589933:{category_id:9,name:"SSDP"},589934:{category_id:9,name:"SMB"},589942:{category_id:9,name:"ICMP"},589951:{category_id:9,name:"UPnP"},59:{category_id:0,name:"Jctrans"},6:{category_id:0,name:"IRC"},61:{category_id:0,name:"BaiduHi"},62:{category_id:0,name:"TELTEL"},64:{category_id:0,name:"9158"},65:{category_id:0,name:"Kltx"},655361:{category_id:10,name:"pcAnywhere"},655362:{category_id:10,name:"VNC"},655363:{category_id:10,name:"TeamViewer"},655364:{category_id:10,name:"MS Remote Desktop Protocol (RDP)"},655365:{category_id:10,name:"Chrome Remote Desktop"},655366:{category_id:10,name:"NTRglobal"},655367:{category_id:10,name:"RemoteCall"},655369:{category_id:10,name:"GoToMyPC"},655370:{category_id:10,name:"Pulseway"},655371:{category_id:10,name:"Radmin"},655372:{category_id:10,name:"Beinsync"},655373:{category_id:10,name:"Fastviewer"},655374:{category_id:10,name:"CrossTec Remote Control"},655375:{category_id:10,name:"GoToMeeting"},655376:{category_id:10,name:"ShowMyPC"},655377:{category_id:10,name:"Join.me"},655378:{category_id:10,name:"Telnet"},655379:{category_id:10,name:"Techinline"},65538:{category_id:1,name:"BitTorrent Series"},655380:{category_id:10,name:"ISL Online"},655381:{category_id:10,name:"Secure Shell (SSH)"},655385:{category_id:10,name:"IBM Remote monitoring and Control"},655395:{category_id:10,name:"Netviewer"},655396:{category_id:10,name:"VT100"},655398:{category_id:10,name:"X11"},65540:{category_id:1,name:"DirectConnect"},655402:{category_id:10,name:"Instanthousecall"},655403:{category_id:10,name:"Ammyy"},65542:{category_id:1,name:"eDonkey Series"},65543:{category_id:1,name:"FastTrack"},65544:{category_id:1,name:"Gnutella"},65545:{category_id:1,name:"WinMX"},65546:{category_id:1,name:"Foxy"},65547:{category_id:1,name:"Winny"},65548:{category_id:1,name:"POCO"},65549:{category_id:1,name:"iMesh"},65550:{category_id:1,name:"ClubBox"},65551:{category_id:1,name:"Vagaa"},65552:{category_id:1,name:"Share"},65553:{category_id:1,name:"Thunder Series"},65554:{category_id:1,name:"myMusic"},65555:{category_id:1,name:"QQDownload"},65557:{category_id:1,name:"easyMule"},65559:{category_id:1,name:"Fileguri"},65563:{category_id:1,name:"Soulseek"},65565:{category_id:1,name:"GNUnet"},65566:{category_id:1,name:"XNap"},65568:{category_id:1,name:"Kceasy"},65569:{category_id:1,name:"Aria2"},65570:{category_id:1,name:"Arctic"},65571:{category_id:1,name:"Artemis"},65572:{category_id:1,name:"Bitflu"},65573:{category_id:1,name:"BTG"},65574:{category_id:1,name:"Pando"},65575:{category_id:1,name:"Lphant"},65576:{category_id:1,name:"BitBlinder"},65577:{category_id:1,name:"Deepnet Explorer"},65578:{category_id:1,name:"aMule"},65580:{category_id:1,name:"Ares"},65581:{category_id:1,name:"Azureus"},65582:{category_id:1,name:"BCDC++"},65583:{category_id:1,name:"BitBuddy"},65584:{category_id:1,name:"BitComet"},65585:{category_id:1,name:"BitTornado"},65587:{category_id:1,name:"ApexDC++"},65588:{category_id:1,name:"Bearshare"},65590:{category_id:1,name:"BitLord"},65591:{category_id:1,name:"BitSpirit"},65594:{category_id:1,name:"Shareaza"},65598:{category_id:1,name:"eMule"},65600:{category_id:1,name:"eMule Plus"},65604:{category_id:1,name:"FileScope"},65609:{category_id:1,name:"GoGoBox"},65612:{category_id:1,name:"Hydranode"},65613:{category_id:1,name:"BitTorrent Pro"},65617:{category_id:1,name:"Kazaa Lite Tools K++"},65620:{category_id:1,name:"BitRocket"},65621:{category_id:1,name:"MlDonkey"},65622:{category_id:1,name:"MooPolice"},65630:{category_id:1,name:"Phex"},65633:{category_id:1,name:"RevConnect"},65634:{category_id:1,name:"Rufus"},65635:{category_id:1,name:"SababaDC"},65636:{category_id:1,name:"Shareaza Plus"},65640:{category_id:1,name:"BTSlave"},65642:{category_id:1,name:"TorrentStorm"},65648:{category_id:1,name:"uTorrent"},65652:{category_id:1,name:"ZipTorrent"},65655:{category_id:1,name:"BitPump"},65664:{category_id:1,name:"BBtor"},65665:{category_id:1,name:"Tuotu"},65666:{category_id:1,name:"BitWombat"},65685:{category_id:1,name:"Vuze"},65688:{category_id:1,name:"Bittorrent X"},65689:{category_id:1,name:"DelugeTorrent"},65690:{category_id:1,name:"CTorrent"},65691:{category_id:1,name:"Propagate Data Client"},65692:{category_id:1,name:"EBit"},65693:{category_id:1,name:"Electric Sheep"},65694:{category_id:1,name:"FileCroc"},65695:{category_id:1,name:"FoxTorrent"},65696:{category_id:1,name:"GSTorrent"},65697:{category_id:1,name:"Hekate"},65698:{category_id:1,name:"Halite"},65699:{category_id:1,name:"hMule"},65700:{category_id:1,name:"KGet"},65701:{category_id:1,name:"KTorrent"},65702:{category_id:1,name:"LeechCraft"},65703:{category_id:1,name:"LH-ABC"},65704:{category_id:1,name:"libTorrent"},65705:{category_id:1,name:"LimeWire"},65706:{category_id:1,name:"Meerkat"},65707:{category_id:1,name:"MonoTorrent"},65708:{category_id:1,name:"MoonlightTorrent"},65709:{category_id:1,name:"Net Transport"},65710:{category_id:1,name:"OneSwarm"},65711:{category_id:1,name:"OmegaTorrent"},65712:{category_id:1,name:"Protocol::BitTorrent"},65713:{category_id:1,name:"PHPTracker"},65714:{category_id:1,name:"qBittorrent"},65715:{category_id:1,name:"Qt 4 Torrent example"},65716:{category_id:1,name:"Retriever"},65717:{category_id:1,name:"RezTorrent"},65718:{category_id:1,name:"Swiftbit"},65719:{category_id:1,name:"SoMud"},65720:{category_id:1,name:"SwarmScope"},65721:{category_id:1,name:"SymTorrent"},65722:{category_id:1,name:"Sharktorrent"},65723:{category_id:1,name:"Terasaur Seed Bank"},65724:{category_id:1,name:"TorrentDotNET"},65725:{category_id:1,name:"Transmission"},65726:{category_id:1,name:"uLeecher"},65727:{category_id:1,name:"BitLet"},65728:{category_id:1,name:"FireTorrent"},65729:{category_id:1,name:"XSwifter"},65730:{category_id:1,name:"XanTorrent"},65731:{category_id:1,name:"Xtorrent"},65732:{category_id:1,name:"Pruna"},65733:{category_id:1,name:"Soribada"},65734:{category_id:1,name:"Gample"},65735:{category_id:1,name:"DIYHARD"},65736:{category_id:1,name:"LottoFile"},65737:{category_id:1,name:"ShareBox"},65738:{category_id:1,name:"Bondisk"},65739:{category_id:1,name:"Filei"},65740:{category_id:1,name:"KDISK"},65741:{category_id:1,name:"Ondisk"},65742:{category_id:1,name:"FILEJO"},65743:{category_id:1,name:"FILEDOK"},65744:{category_id:1,name:"Tomatopang/Santa25"},65745:{category_id:1,name:"Webhard"},65746:{category_id:1,name:"TPLE"},65747:{category_id:1,name:"DiskPump"},65748:{category_id:1,name:"NETFOLDER"},65749:{category_id:1,name:"QFILE"},65750:{category_id:1,name:"DISKMAN"},65751:{category_id:1,name:"DBGO"},65752:{category_id:1,name:"Congaltan"},65753:{category_id:1,name:"Diskpot"},65754:{category_id:1,name:"Ipopclub"},65755:{category_id:1,name:"Yesfile"},65756:{category_id:1,name:"Nedisk"},65757:{category_id:1,name:"Me2disk"},65758:{category_id:1,name:"Odisk"},65759:{category_id:1,name:"Tomfile"},65760:{category_id:1,name:"Adrive.co.kr"},65761:{category_id:1,name:"ZIOfile"},65762:{category_id:1,name:"APPLEFILE"},65763:{category_id:1,name:"SUPERDOWN"},65764:{category_id:1,name:"Hidisk"},65765:{category_id:1,name:"Downs"},65766:{category_id:1,name:"DownDay"},65767:{category_id:1,name:"BOMULBOX"},65768:{category_id:1,name:"FILEHAM"},65769:{category_id:1,name:"Tdisk"},65770:{category_id:1,name:"Filehon"},65771:{category_id:1,name:"Jjangfile"},65772:{category_id:1,name:"Onehard.com"},65773:{category_id:1,name:"Pdpop"},65774:{category_id:1,name:"AirFile"},65775:{category_id:1,name:"FILEZZIM"},65776:{category_id:1,name:"Atomfile.co.kr"},65777:{category_id:1,name:"QDOWN.com"},65778:{category_id:1,name:"Alfile.net"},65779:{category_id:1,name:"Bigfile.co.kr"},65780:{category_id:1,name:"Hardmoa.com"},65781:{category_id:1,name:"Redfile.co.kr"},65782:{category_id:1,name:"FILETV.co.kr"},65783:{category_id:1,name:"Now.co.kr"},65784:{category_id:1,name:"JustBeamIt"},65785:{category_id:1,name:"reep.io"},65786:{category_id:1,name:"GnucDNA/Gimme"},65787:{category_id:1,name:"MyNapster"},66:{category_id:0,name:"IM+(M)"},67:{category_id:0,name:"Imi"},68:{category_id:0,name:"Netcall"},69:{category_id:0,name:"ECP"},7:{category_id:0,name:"Yoics"},72:{category_id:0,name:"Etnano"},720898:{category_id:11,name:"VNN"},720899:{category_id:11,name:"Spotflux"},720900:{category_id:11,name:"SoftEther/PacketiX"},720901:{category_id:11,name:"TinyVPN"},720902:{category_id:11,name:"HTTP-Tunnel"},720903:{category_id:11,name:"Tor"},720904:{category_id:11,name:"Ping Tunnel"},720905:{category_id:11,name:"Wujie/UltraSurf"},720906:{category_id:11,name:"Freegate"},720907:{category_id:11,name:"Hidemyass"},720909:{category_id:11,name:"Vedivi"},720910:{category_id:11,name:"ZenMate"},720911:{category_id:11,name:"Hamachi"},720912:{category_id:11,name:"Disconnect.me"},720913:{category_id:11,name:"Psiphon 3"},720914:{category_id:11,name:"Asproxy"},720915:{category_id:11,name:"OpenDoor"},720916:{category_id:11,name:"NSTX DNS Tunnel"},720917:{category_id:11,name:"Coralcdn"},720918:{category_id:11,name:"Glype"},720919:{category_id:11,name:"GPass"},720920:{category_id:11,name:"Kproxy"},720921:{category_id:11,name:"Megaproxy"},720922:{category_id:11,name:"FreeSafeIP"},720925:{category_id:11,name:"Surrogafier"},720926:{category_id:11,name:"Vtunnel"},720928:{category_id:11,name:"BypassThat"},720930:{category_id:11,name:"JAP/JonDo"},720933:{category_id:11,name:"SofaWare"},720946:{category_id:11,name:"Hidedoor"},720948:{category_id:11,name:"CGIProxy"},720950:{category_id:11,name:"Phproxy"},720951:{category_id:11,name:"OpenVPN"},720952:{category_id:11,name:"CCProxy"},720954:{category_id:11,name:"PD-Proxy"},720959:{category_id:11,name:"Rtmpt"},720960:{category_id:11,name:"LogMeIn"},720961:{category_id:11,name:"HotspotShield"},720962:{category_id:11,name:"ExpressVPN"},720963:{category_id:11,name:"GogoNET"},720964:{category_id:11,name:"HTTP Proxy Server"},720966:{category_id:11,name:"Texasproxy"},720967:{category_id:11,name:"Ourproxy"},720969:{category_id:11,name:"Fast Proxy"},720970:{category_id:11,name:"Zalmos"},720971:{category_id:11,name:"Easy Proxy"},720972:{category_id:11,name:"Proxy Era"},720973:{category_id:11,name:"DotVPN"},720974:{category_id:11,name:"BrowSec"},720977:{category_id:11,name:"Air-Proxy"},720979:{category_id:11,name:"Defilter"},720980:{category_id:11,name:"SSLunblock"},720983:{category_id:11,name:"K12History"},720984:{category_id:11,name:"SurfEasy"},720985:{category_id:11,name:"Frozenway"},720986:{category_id:11,name:"CyberGhostVPN"},720987:{category_id:11,name:"SecurityKISS"},720988:{category_id:11,name:"WebWarper"},720989:{category_id:11,name:"Guardster"},720991:{category_id:11,name:"TunnelBear"},720992:{category_id:11,name:"AstrillVPN"},77:{category_id:0,name:"ProvideSupport"},78:{category_id:0,name:"Dudu IM"},786434:{category_id:12,name:"DZH"},786435:{category_id:12,name:"10JQKA"},786437:{category_id:12,name:"Qianlong"},786438:{category_id:12,name:"Compass.cn"},786439:{category_id:12,name:"Huaan"},786440:{category_id:12,name:"StockStar "},786441:{category_id:12,name:"TDX"},786443:{category_id:12,name:"Hexun"},786444:{category_id:12,name:"Hypwise"},786449:{category_id:12,name:"Kiwoom"},786450:{category_id:12,name:"Windin"},786451:{category_id:12,name:"SamsungPoP"},786453:{category_id:12,name:"StockTrace"},786454:{category_id:12,name:"JRJ"},786455:{category_id:12,name:"TradeFields(M)"},786457:{category_id:12,name:"Netdania"},786458:{category_id:12,name:"TradeInterceptor"},8:{category_id:0,name:"Rediff BOL"},80:{category_id:0,name:"Weibo IM"},81:{category_id:0,name:"WO"},82:{category_id:0,name:"Guagua"},83:{category_id:0,name:"Hangouts"},84:{category_id:0,name:"ClubCooee"},85:{category_id:0,name:"Palringo"},851969:{category_id:13,name:"WhiteHat Aviator"},851970:{category_id:13,name:"HTC Widget(M)"},851971:{category_id:13,name:"Doodle"},851972:{category_id:13,name:"Level3"},851973:{category_id:13,name:"FuzeMeeting"},851974:{category_id:13,name:"Mobile01"},851975:{category_id:13,name:"Speedtest.net"},851976:{category_id:13,name:"Google Chrome"},851977:{category_id:13,name:"Babelfish"},851978:{category_id:13,name:"Google-translate"},851980:{category_id:13,name:"Mozilla Firefox"},851981:{category_id:13,name:"Apple Safari"},851982:{category_id:13,name:"Opera browser"},851983:{category_id:13,name:"Google"},851984:{category_id:13,name:"Google-books"},851985:{category_id:13,name:"eBay"},851986:{category_id:13,name:"hao123"},851987:{category_id:13,name:"Soso"},851988:{category_id:13,name:"Tmall"},851989:{category_id:13,name:"PayPal.com"},851990:{category_id:13,name:"Ask.com"},851991:{category_id:13,name:"BBC"},851992:{category_id:13,name:"Alibaba.com"},851993:{category_id:13,name:"CNN.com"},851995:{category_id:13,name:"Sogou.com"},851996:{category_id:13,name:"Evernote"},851997:{category_id:13,name:"About.com"},851998:{category_id:13,name:"Alipay.com"},851999:{category_id:13,name:"Imgur"},852000:{category_id:13,name:"Adcash"},852001:{category_id:13,name:"Huffington Post"},852002:{category_id:13,name:"360buy"},852003:{category_id:13,name:"ESPN"},852004:{category_id:13,name:"Books"},852005:{category_id:13,name:"Craigslist.org"},852006:{category_id:13,name:"Google-analytics"
},852007:{category_id:13,name:"Bing Maps"},852008:{category_id:13,name:"ETtoday "},852009:{category_id:13,name:"104 Job Bank"},852010:{category_id:13,name:"NOWnews"},852011:{category_id:13,name:"518 Job Bank"},852012:{category_id:13,name:"Chinatimes.com"},852013:{category_id:13,name:"GOHAPPY"},852014:{category_id:13,name:"591"},852015:{category_id:13,name:"8591"},852016:{category_id:13,name:"Chinatrust"},852017:{category_id:13,name:"Donga.com"},852018:{category_id:13,name:"Gmarket"},852019:{category_id:13,name:"Chosun.com"},852020:{category_id:13,name:"Cafe24.com"},852021:{category_id:13,name:"11st"},852022:{category_id:13,name:"MK.co.kr"},852023:{category_id:13,name:"Auction"},852024:{category_id:13,name:"Hankyung"},852025:{category_id:13,name:"Ppomppu"},852026:{category_id:13,name:"MT.co.kr"},852027:{category_id:13,name:"Zum.com"},852028:{category_id:13,name:"Hankooki"},852029:{category_id:13,name:"JOBKOREA"},852031:{category_id:13,name:"Khan.co.kr"},852032:{category_id:13,name:"Incruit"},852033:{category_id:13,name:"YES24"},852034:{category_id:13,name:"Amazon CloudFront"},852035:{category_id:13,name:"Pcstore"},852036:{category_id:13,name:"Myfreshnet.com"},852037:{category_id:13,name:"Microsoft.com"},852038:{category_id:13,name:"Life.com.tw"},852039:{category_id:13,name:"Libertytimes"},852040:{category_id:13,name:"Lativ"},852041:{category_id:13,name:"Inven"},852042:{category_id:13,name:"cnYES"},852043:{category_id:13,name:"Babyhome"},852044:{category_id:13,name:"8comic.com"},852045:{category_id:13,name:"Ck101.com"},852046:{category_id:13,name:"Taiwanlottery"},852047:{category_id:13,name:"Momoshop"},852048:{category_id:13,name:"Eyny.com"},852049:{category_id:13,name:"Yam.com"},852050:{category_id:13,name:"PChome.com"},852051:{category_id:13,name:"Gamme"},852052:{category_id:13,name:"Apple.com"},852053:{category_id:13,name:"Hinet.net"},852054:{category_id:13,name:"Google-earth"},852055:{category_id:13,name:"Saramin"},852056:{category_id:13,name:"KoreaHerald"},852057:{category_id:13,name:"Plus28.com"},852058:{category_id:13,name:"ChunghwaPost "},852059:{category_id:13,name:"Gomaji "},852060:{category_id:13,name:"NewSen"},852061:{category_id:13,name:"Etnews.com"},852062:{category_id:13,name:"Seoul.co.kr"},852063:{category_id:13,name:"YONHAPNEWS"},852064:{category_id:13,name:"Etoday.co.kr"},852065:{category_id:13,name:"Yesky.com"},852066:{category_id:13,name:"1111 Job Bank"},852067:{category_id:13,name:"Emart"},852068:{category_id:13,name:"KBstar"},852069:{category_id:13,name:"HERALDCORP"},852070:{category_id:13,name:"ActiveX"},852071:{category_id:13,name:"MSN.com"},852072:{category_id:13,name:"Edaily"},852073:{category_id:13,name:"Segye"},852074:{category_id:13,name:"Bobaedream"},852075:{category_id:13,name:"Nocutnews"},852076:{category_id:13,name:"MONETA.co.kr"},852077:{category_id:13,name:"Kukinews"},852078:{category_id:13,name:"Java Applet"},852079:{category_id:13,name:"Todayhumor"},852080:{category_id:13,name:"Inews24"},852081:{category_id:13,name:"KoreaTimes"},852082:{category_id:13,name:"OhmyNews"},852083:{category_id:13,name:"Aladin.co.kr"},852084:{category_id:13,name:"SK Encar"},852085:{category_id:13,name:"eTorrent"},852086:{category_id:13,name:"TVREPORT"},852087:{category_id:13,name:"Mydaily"},852088:{category_id:13,name:"Microsoft Live.com"},852089:{category_id:13,name:"News1.kr"},852090:{category_id:13,name:"Munhwa"},852091:{category_id:13,name:"Dreamwiz"},852092:{category_id:13,name:"Dailian.co.kr"},852093:{category_id:13,name:"Rediff.com"},852094:{category_id:13,name:"Akamai.net"},852097:{category_id:13,name:"Yugma"},852098:{category_id:13,name:"TPB PirateBrowser"},852100:{category_id:13,name:"Wikispaces"},852101:{category_id:13,name:"Wikidot"},852102:{category_id:13,name:"Google-play"},852103:{category_id:13,name:"Wetpaint"},852104:{category_id:13,name:"Windows Store"},852105:{category_id:13,name:"Webshots"},852106:{category_id:13,name:"Kindle Cloud Reader"},852107:{category_id:13,name:"Nice264"},852109:{category_id:13,name:"Vyew"},852110:{category_id:13,name:"TikiWiki"},852111:{category_id:13,name:"Castfire"},852113:{category_id:13,name:"SugarCRM"},852115:{category_id:13,name:"Stumbleupon"},852119:{category_id:13,name:"Spark"},852120:{category_id:13,name:"Socialtext"},852122:{category_id:13,name:"PBworks"},852123:{category_id:13,name:"Fool"},852124:{category_id:13,name:"Showbie"},852125:{category_id:13,name:"MorningStar"},852127:{category_id:13,name:"MoinMoin"},852128:{category_id:13,name:"AppStore"},852129:{category_id:13,name:"Ragingbull"},852130:{category_id:13,name:"Daum"},852131:{category_id:13,name:"Google-docs"},852133:{category_id:13,name:"Naver"},852134:{category_id:13,name:"Editgrid"},852135:{category_id:13,name:"Jaspersoft"},852136:{category_id:13,name:"Clarizen"},852139:{category_id:13,name:"Interpark"},852140:{category_id:13,name:"Hyundaihmall"},852141:{category_id:13,name:"Groupon"},852142:{category_id:13,name:"Gsshop"},852143:{category_id:13,name:"Wemakeprice"},852144:{category_id:13,name:"Lotte.com"},852145:{category_id:13,name:"Coupang"},852147:{category_id:13,name:"Google-alerts"},852149:{category_id:13,name:"Dnshop.com"},852150:{category_id:13,name:"ZoomSpider crawler"},852151:{category_id:13,name:"Win Web Crawler"},852152:{category_id:13,name:"HTTrack crawler"},852153:{category_id:13,name:"Abot crawler"},852154:{category_id:13,name:"Googlebot crawler"},852155:{category_id:13,name:"Microsoft bingbot crawler"},852156:{category_id:13,name:"Yahoo Slurp crawler"},852157:{category_id:13,name:"Beanfun"},852159:{category_id:13,name:"ifeng.com"},852160:{category_id:13,name:"Conduit Mobile"},852162:{category_id:13,name:"Gamebase"},852163:{category_id:13,name:"Kingstone"},852164:{category_id:13,name:"Udn.com"},852166:{category_id:13,name:"Sportsseoul"},852167:{category_id:13,name:"Babylon "},852168:{category_id:13,name:"Yahoo Finance"},852171:{category_id:13,name:"Jira"},852172:{category_id:13,name:"PHPwiki"},852174:{category_id:13,name:"WebCT"},852175:{category_id:13,name:"Youseemore"},852176:{category_id:13,name:"Zwiki-editing"},852177:{category_id:13,name:"Adobe.com"},852178:{category_id:13,name:"Backpackit/Campfire"},852180:{category_id:13,name:"ERoom-net"},852184:{category_id:13,name:"Glide"},852186:{category_id:13,name:"Mediawiki"},852189:{category_id:13,name:"MSN Money"},852190:{category_id:13,name:"HTTP"},852191:{category_id:13,name:"AOL Toolbar"},852193:{category_id:13,name:"Uber"},852194:{category_id:13,name:"Web-crawler"},852195:{category_id:13,name:"RSS"},852196:{category_id:13,name:"WeatherBug"},852197:{category_id:13,name:"Yahoo Toolbar"},852198:{category_id:13,name:"Alexa Toolbar"},852199:{category_id:13,name:"Internet Archive"},852200:{category_id:13,name:"Wikipedia"},852201:{category_id:13,name:"Wiktionary"},852202:{category_id:13,name:"Amazon"},852203:{category_id:13,name:"Google-toolbar"},852204:{category_id:13,name:"Google-maps"},852205:{category_id:13,name:"Zoho"},852206:{category_id:13,name:"Microsoft Internet Explorer"},852207:{category_id:13,name:"Localmind"},852208:{category_id:13,name:"PulseNews"},852209:{category_id:13,name:"BookU(M)"},852210:{category_id:13,name:"Zappos"},852211:{category_id:13,name:"Expedia(M)"},852212:{category_id:13,name:"AdF.ly"},852213:{category_id:13,name:"Baidu"},852214:{category_id:13,name:"Yahoo"},852215:{category_id:13,name:"Taobao"},852216:{category_id:13,name:"163.com"},852217:{category_id:13,name:"Sina.com"},852218:{category_id:13,name:"Bing.com"},852219:{category_id:13,name:"Ruten"},852220:{category_id:13,name:"Shop.com"},852221:{category_id:13,name:"Appledaily"},852222:{category_id:13,name:"CWB"},852223:{category_id:13,name:"CNA"},86:{category_id:0,name:"KikMessenger"},87:{category_id:0,name:"Doshow"},88:{category_id:0,name:"Mibbit"},89:{category_id:0,name:"YY"},9:{category_id:0,name:"Google Talk"},90:{category_id:0,name:"Ispeak"},91:{category_id:0,name:"VzoChat"},917508:{category_id:14,name:"BitDefender"},917509:{category_id:14,name:"360Safe"},917510:{category_id:14,name:"Rising"},917511:{category_id:14,name:"TortoiseSVN"},917513:{category_id:14,name:"Microsoft Windows Update"},917514:{category_id:14,name:"Norton"},917515:{category_id:14,name:"Sophos"},917516:{category_id:14,name:"Yum"},917517:{category_id:14,name:"MIUI"},917518:{category_id:14,name:"Adobe"},917519:{category_id:14,name:"InstallAnyWhere"},917520:{category_id:14,name:"Kaspersky"},917521:{category_id:14,name:"Mcafee"},917522:{category_id:14,name:"TrendMicro"},917523:{category_id:14,name:"F-Secure"},917524:{category_id:14,name:"NOD32"},917525:{category_id:14,name:"Avast"},917526:{category_id:14,name:"Jiangmin"},917527:{category_id:14,name:"Avira"},917528:{category_id:14,name:"Emsisoft"},917529:{category_id:14,name:"Panda"},917530:{category_id:14,name:"AVG"},917531:{category_id:14,name:"PCTools"},917533:{category_id:14,name:"Outpost"},917534:{category_id:14,name:"Spybot"},917535:{category_id:14,name:"Duba"},917536:{category_id:14,name:"Apple"},917538:{category_id:14,name:"Google Update"},917540:{category_id:14,name:"JAVA Update"},917541:{category_id:14,name:"SONY PC Companion"},917542:{category_id:14,name:"SketchUp"},917543:{category_id:14,name:"Webroot"},92:{category_id:0,name:"Trillian"},93:{category_id:0,name:"HipChat"},94:{category_id:0,name:"IntraMessenger"},95:{category_id:0,name:"BitWise"},96:{category_id:0,name:"Barablu"},97:{category_id:0,name:"Whoshere(M)"},98:{category_id:0,name:"LiiHo(M)"},983043:{category_id:15,name:"eBuddy.com"},983044:{category_id:15,name:"iLoveIM.com"},983047:{category_id:15,name:"imo.im"},983048:{category_id:15,name:"Chikka"},983050:{category_id:15,name:"QQ Web Messenger"},983051:{category_id:15,name:"AOL"},983054:{category_id:15,name:"ICQ Web Messenger"},983057:{category_id:15,name:"AirAim"},983058:{category_id:15,name:"Instan-t Web Messenger"},983065:{category_id:15,name:"TaoBao AliWW"},983069:{category_id:15,name:"Gadu-Gadu Web Messenger"},983070:{category_id:15,name:"Karoo Lark"},983072:{category_id:15,name:"IM+"},99:{category_id:0,name:"Appme(M)"}},categories:{0:{applications:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,31,32,33,34,35,36,37,38,41,42,43,44,46,49,54,55,56,57,58,59,61,62,64,65,66,67,68,69,72,77,78,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108],name:"Instant messaging"},1:{applications:[65538,65540,65542,65543,65544,65545,65546,65547,65548,65549,65550,65551,65552,65553,65554,65555,65557,65559,65563,65565,65566,65568,65569,65570,65571,65572,65573,65574,65575,65576,65577,65578,65580,65581,65582,65583,65584,65585,65587,65588,65590,65591,65594,65598,65600,65604,65609,65612,65613,65617,65620,65621,65622,65630,65633,65634,65635,65636,65640,65642,65648,65652,65655,65664,65665,65666,65685,65688,65689,65690,65691,65692,65693,65694,65695,65696,65697,65698,65699,65700,65701,65702,65703,65704,65705,65706,65707,65708,65709,65710,65711,65712,65713,65714,65715,65716,65717,65718,65719,65720,65721,65722,65723,65724,65725,65726,65727,65728,65729,65730,65731,65732,65733,65734,65735,65736,65737,65738,65739,65740,65741,65742,65743,65744,65745,65746,65747,65748,65749,65750,65751,65752,65753,65754,65755,65756,65757,65758,65759,65760,65761,65762,65763,65764,65765,65766,65767,65768,65769,65770,65771,65772,65773,65774,65775,65776,65777,65778,65779,65780,65781,65782,65783,65784,65785,65786,65787],name:"P2P"},10:{applications:[655361,655362,655363,655364,655365,655366,655367,655369,655370,655371,655372,655373,655374,655375,655376,655377,655378,655379,655380,655381,655385,655395,655396,655398,655402,655403],name:"Remote Access Terminals"},11:{applications:[720898,720899,720900,720901,720902,720903,720904,720905,720906,720907,720909,720910,720911,720912,720913,720914,720915,720916,720917,720918,720919,720920,720921,720922,720925,720926,720928,720930,720933,720946,720948,720950,720951,720952,720954,720959,720960,720961,720962,720963,720964,720966,720967,720969,720970,720971,720972,720973,720974,720977,720979,720980,720983,720984,720985,720986,720987,720988,720989,720991,720992],name:"Bypass Proxies and Tunnels"},12:{applications:[786434,786435,786437,786438,786439,786440,786441,786443,786444,786449,786450,786451,786453,786454,786455,786457,786458],name:"Stock Market"},13:{applications:[851969,851970,851971,851972,851973,851974,851975,851976,851977,851978,851980,851981,851982,851983,851984,851985,851986,851987,851988,851989,851990,851991,851992,851993,851995,851996,851997,851998,851999,852e3,852001,852002,852003,852004,852005,852006,852007,852008,852009,852010,852011,852012,852013,852014,852015,852016,852017,852018,852019,852020,852021,852022,852023,852024,852025,852026,852027,852028,852029,852031,852032,852033,852034,852035,852036,852037,852038,852039,852040,852041,852042,852043,852044,852045,852046,852047,852048,852049,852050,852051,852052,852053,852054,852055,852056,852057,852058,852059,852060,852061,852062,852063,852064,852065,852066,852067,852068,852069,852070,852071,852072,852073,852074,852075,852076,852077,852078,852079,852080,852081,852082,852083,852084,852085,852086,852087,852088,852089,852090,852091,852092,852093,852094,852097,852098,852100,852101,852102,852103,852104,852105,852106,852107,852109,852110,852111,852113,852115,852119,852120,852122,852123,852124,852125,852127,852128,852129,852130,852131,852133,852134,852135,852136,852139,852140,852141,852142,852143,852144,852145,852147,852149,852150,852151,852152,852153,852154,852155,852156,852157,852159,852160,852162,852163,852164,852166,852167,852168,852171,852172,852174,852175,852176,852177,852178,852180,852184,852186,852189,852190,852191,852193,852194,852195,852196,852197,852198,852199,852200,852201,852202,852203,852204,852205,852206,852207,852208,852209,852210,852211,852212,852213,852214,852215,852216,852217,852218,852219,852220,852221,852222,852223],name:"Web / Web 2.0"},14:{applications:[917508,917509,917510,917511,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917533,917534,917535,917536,917538,917540,917541,917542,917543],name:"Security Update"},15:{applications:[983043,983044,983047,983048,983050,983051,983054,983057,983058,983065,983069,983070,983072],name:"Web IM"},17:{applications:[1114113,1114114,1114115,1114117,1114118,1114119,1114120,1114121,1114122,1114124,1114125,1114128,1114129,1114130,1114131,1114133,1114134,1114138,1114140,1114141,1114142,1114150,1114151,1114152,1114155,1114158,1114160,1114161,1114167,1114169,1114170,1114176,1114177,1114180,1114182,1114187,1114188,1114191,1114195,1114198,1114201,1114203,1114205,1114206,1114212,1114213,1114222,1114229,1114238,1114239,1114246,1114248,1114250,1114252,1114253,1114255,1114269,1114272,1114273,1114274,1114275,1114277,1114279,1114289,1114290,1114308,1114309,1114310,1114311,1114318,1114320,1114321,1114322,1114330,1114331,1114334,1114335,1114337,1114339,1114340,1114342,1114343,1114347,1114350,1114351,1114352,1114355,1114359,1114361,1114363,1114365],name:"Business"},18:{applications:[1179649,1179650,1179651,1179653,1179654,1179655,1179660,1179665,1179667,1179668,1179669,1179670,1179671,1179672,1179673,1179674,1179675,1179676,1179677,1179678,1179679,1179680,1179681,1179682,1179683,1179684,1179685,1179686,1179687,1179688,1179689,1179690,1179691,1179692,1179693,1179694,1179695,1179696,1179697,1179698,1179699,1179700,1179701,1179702,1179704,1179705,1179706,1179707,1179708,1179709,1179710,1179711,1179712,1179713,1179714,1179715,1179716,1179717,1179718,1179719,1179720,1179721,1179722,1179723,1179724,1179725,1179726,1179727,1179728,1179729,1179731,1179732,1179733,1179734,1179735,1179737,1179739,1179740,1179742,1179743,1179744,1179745,1179746,1179747,1179748,1179749,1179752,1179753,1179754,1179755,1179756,1179757,1179758,1179759,1179760,1179761,1179762,1179763,1179764,1179765,1179766,1179767,1179768,1179769,1179770,1179771,1179772,1179773,1179774,1179775,1179776,1179777,1179778,1179779,1179780,1179781,1179782,1179783,1179784,1179785,1179786,1179787,1179788,1179789,1179790,1179791,1179793,1179794,1179795,1179796,1179797,1179798,1179799,1179800,1179801,1179802,1179803,1179804,1179805,1179806,1179807,1179808,1179809,1179810,1179811,1179812,1179813,1179814,1179815,1179816,1179817,1179818,1179819,1179820,1179821,1179822,1179823,1179824,1179825,1179826,1179827,1179828,1179829,1179830,1179831,1179832,1179833,1179834,1179835,1179836,1179838,1179839,1179840,1179841,1179842,1179843,1179844,1179845,1179846,1179847,1179848,1179849,1179850,1179851,1179852,1179853,1179854,1179855,1179856,1179857,1179858,1179860,1179862,1179863,1179864,1179865,1179866,1179867,1179868,1179869,1179870,1179871,1179872,1179873,1179874,1179875,1179876,1179877,1179878,1179879,1179880,1179881,1179882,1179883,1179884,1179885,1179886,1179887,1179888,1179889,1179890,1179891,1179892,1179893,1179894,1179895,1179896,1179897,1179898,1179899,1179900,1179901,1179902,1179903],name:"Network Protocols"},19:{applications:[1245187,1245188,1245189,1245190,1245191,1245192,1245193,1245195,1245196,1245197,1245198,1245200,1245201,1245202,1245203,1245204,1245205,1245206,1245207,1245208,1245209,1245210,1245211,1245212,1245213,1245214,1245215,1245216,1245217,1245218,1245219,1245220,1245221,1245222,1245223,1245224,1245225,1245226,1245228,1245229,1245230,1245231,1245232,1245233,1245234,1245235,1245236,1245237,1245238,1245239,1245240,1245241,1245242,1245243,1245244,1245245,1245246,1245247,1245248,1245249,1245250,1245251,1245252,1245253,1245254,1245255,1245256,1245257,1245258,1245259,1245260,1245261,1245262,1245263,1245264,1245265,1245266,1245267,1245268,1245269,1245270,1245271,1245272,1245273,1245274,1245275,1245276,1245277,1245278,1245279,1245280,1245281,1245282,1245283,1245284,1245285,1245286,1245287,1245288,1245289,1245290,1245291,1245292,1245294,1245295,1245296,1245297,1245298,1245299,1245300,1245301,1245302,1245303,1245304,1245305,1245306,1245307,1245308,1245309,1245310,1245311,1245312,1245313,1245314,1245316,1245318,1245319,1245320,1245321,1245322,1245324,1245325,1245326,1245327,1245328,1245329,1245330,1245331,1245332,1245333,1245334,1245335,1245336,1245337,1245338,1245339,1245340,1245341,1245342,1245343,1245344,1245345,1245346,1245347,1245348,1245349,1245350,1245351,1245352,1245353,1245354,1245355,1245356,1245357,1245358,1245359,1245360,1245361,1245362,1245363,1245364,1245365,1245366,1245370,1245371,1245372,1245373,1245374,1245375,1245376,1245377,1245378,1245379,1245380,1245381,1245382,1245383,1245384,1245385,1245386,1245387,1245388,1245389,1245390,1245391,1245392,1245393,1245394,1245395,1245396,1245397,1245398,1245399,1245400,1245402,1245403,1245404,1245405,1245406,1245407,1245408,1245409,1245410,1245411,1245412,1245413,1245414,1245415,1245416,1245417,1245418,1245419,1245420,1245421,1245422,1245423,1245424,1245425,1245426,1245427,1245428,1245429,1245430,1245431,1245432,1245433,1245434,1245435,1245436,1245437,1245438,1245439],name:"Network Protocols"},20:{applications:[1310721,1310722,1310723,1310724,1310725,1310726,1310727,1310728,1310729,1310730,1310731,1310732,1310733,1310734,1310735,1310736,1310737,1310738,1310739,1310740,1310741,1310742,1310743,1310744,1310745,1310746,1310747,1310748,1310749,1310750,1310751,1310752,1310753,1310754,1310755,1310756,1310757,1310758,1310759,1310760,1310761,1310762,1310763,1310764,1310765,1310766,1310767,1310768,1310769,1310770,1310771,1310772,1310773,1310774,1310775,1310776,1310777,1310778,1310779,1310780,1310781,1310782,1310783,1310784,1310785,1310786,1310787,1310788,1310789,1310790,1310791,1310792,1310793,1310794,1310795,1310796,1310797,1310798,1310799,1310800,1310801,1310802,1310803,1310804,1310805,1310806,1310807,1310808,1310809,1310810,1310811,1310812,1310813,1310814,1310815,1310816,1310817,1310818,1310819,1310820,1310821,1310822,1310823,1310824,1310825,1310826,1310827,1310828,1310830,1310832,1310833,1310834,1310835,1310836,1310837,1310839,1310840,1310841,1310842,1310843,1310844,1310845,1310846,1310847,1310848,1310849,1310850,1310851,1310852,1310853,1310854,1310855,1310856,1310857,1310858,1310859,1310860,1310861,1310862,1310863,1310864,1310865,1310866,1310867,1310868,1310869,1310870,1310871,1310872,1310873,1310874,1310875,1310878,1310879,1310880,1310881,1310882,1310883,1310884,1310887,1310888,1310889,1310890,1310891,1310892,1310893,1310894,1310895,1310896,1310897,1310898,1310899,1310900,1310902,1310903,1310904,1310905,1310906,1310907,1310908,1310909,1310910],name:"Network Protocols"},21:{applications:[1376306,1376323,1376357,1376359],name:"Mobile"},23:{applications:[1507329,1507330,1507333],name:"Private Protocol"},24:{applications:[1572865,1572866,1572867,1572868,1572870,1572871,1572872,1572873,1572874,1572875,1572876,1572880,1572881,1572882,1572883,1572884,1572885,1572886,1572887,1572889,1572890,1572891,1572892,1572893,1572894,1572895,1572896,1572897,1572898,1572899,1572900,1572901,1572902,1572903,1572905,1572906,1572907,1572908,1572909,1572910,1572911,1572912,1572913,1572914,1572915,1572916,1572917,1572918,1572919,1572920,1572921,1572922,1572923,1572927,1572928,1572929,1572930,1572931,1572967,1572968,1572970,1572974,1572975,1572976,1572977,1572978,1572980,1572981,1572983,1572985,1572987,1572988,1572989,1572990,1572998,1572999,1573e3,1573004,1573005,1573006,1573007,1573008,1573009,1573010,1573011,1573014,1573015,1573016,1573017,1573018,1573019,1573020,1573021,1573022,1573023,1573024,1573025,1573026,1573027,1573028,1573029,1573030,1573031,1573032,1573033,1573035],name:"Social Network"},255:{applications:[65535],name:"Unknown"},28:{applications:[1835009,1835010,1835011,1835012,1835013,1835014,1835015,1835016,1835017,1835018,1835019,1835020,1835021,1835022,1835023,1835024,1835025,1835026,1835027,1835028,1835029,1835030,1835031,1835032,1835033,1835034,1835035,1835036,1835037,1835038,1835039,1835040,1835041,1835042,1835043,1835044,1835045,1835046,1835047,1835048,1835049,1835050,1835051,1835052,1835053,1835054,1835055,1835056,1835057,1835058,1835059,1835060,1835061,1835062,1835063,1835064,1835065,1835066,1835067,1835068,1835069,1835070,1835071,1835072,1835073,1835074,1835075,1835076,1835077,1835078,1835079,1835080,1835081,1835082,1835083,1835084,1835085,1835086,1835087,1835088,1835089,1835090,1835091,1835092,1835093,1835094,1835095,1835096,1835097,1835098,1835099,1835100,1835101,1835102,1835103,1835104,1835105,1835106,1835107,1835108],name:"TopSites-Adult"},29:{applications:[1900545,1900546,1900547,1900548,1900549,1900550,1900551,1900552,1900553,1900554,1900555,1900556,1900557,1900558,1900559,1900560,1900561,1900562,1900563,1900564,1900565,1900566,1900567,1900568,1900569,1900570,1900571,1900572,1900573,1900574,1900575,1900576,1900577,1900578,1900579,1900580,1900581,1900582,1900583,1900584,1900585,1900586,1900587,1900588,1900589,1900590,1900591,1900592,1900593,1900594,1900595,1900596,1900597,1900598,1900599,1900600,1900601,1900602,1900603,1900604,1900605,1900606,1900607,1900608,1900609,1900610,1900611,1900612,1900613,1900614,1900615,1900616,1900617,1900618,1900619,1900620,1900621,1900622,1900623,1900624,1900625,1900626,1900627,1900628,1900629],name:"TopSites-Arts"},3:{applications:[196609,196610,196611,196612,196613,196614,196615,196616,196617,196618,196619,196620,196621,196622,196624,196626,196627,196628,196629,196630,196631,196632,196633,196634,196635,196637,196638,196640,196641,196642,196643,196644,196645,196646,196647,196648,196649,196650,196651,196652,196653,196655,196656,196657,196669,196676,196678,196680,196681,196683,196684,196686,196689,196692,196693,196694,196695,196696,196697,196700,196701,196702,196703,196705,196706,196708,196709,196711,196713,196714,196716,196717,196718,196722,196723,196724,196725,196726,196727,196728,196729,196731,196732,196733,196735,196737,196738,196739,196742,196743,196744,196746,196747,196748,196749,196750,196751,196752,196753,196754,196755,196756,196757,196758,196759,196760,196761,196762,196764,196765,196766,196767,196768,196769,196770,196771,196772,196773,196774,196775,196777],name:"File Transfer"},30:{applications:[1966081,1966082,1966083,1966084,1966085,1966086,1966087,1966088,1966089,1966090,1966091,1966092,1966093,1966094,1966095,1966096,1966097,1966098,1966099,1966100,1966101,1966102,1966103,1966104,1966105,1966106,1966107,1966108,1966109,1966110,1966111,1966112,1966113,1966114,1966115,1966116,1966117,1966118,1966119,1966120,1966121,1966122,1966123,1966124,1966125,1966126,1966127,1966128,1966129,1966130,1966131,1966132,1966133,1966134,1966135,1966136,1966137,1966138,1966139,1966140,1966141,1966142,1966143,1966144,1966145,1966146,1966147,1966148,1966149,1966150,1966151,1966152,1966153,1966154,1966155,1966156,1966157,1966158,1966159,1966160,1966161,1966162,1966163,1966164,1966165,1966166,1966167,1966168,1966169,1966170,1966171,1966172,1966173],name:"TopSites-Business"},31:{applications:[2031617,2031618,2031619,2031620,2031621,2031622,2031623,2031624,2031625,2031626,2031627,2031628,2031629,2031630,2031631,2031632,2031633,2031634,2031635,2031636,2031637,2031638,2031639,2031640,2031641,2031642,2031643,2031644,2031645,2031646,2031647,2031648,2031649,2031650,2031651,2031652,2031653,2031654,2031655,2031656,2031657,2031658,2031659,2031660,2031661,2031662,2031663,2031664,2031665,2031666,2031667,2031668,2031669,2031670,2031671,2031672,2031673,2031674,2031675,2031676,2031677,2031678,2031679,2031680],name:"TopSites-Computers"},32:{applications:[2097153,2097154,2097155,2097156,2097157,2097158,2097159,2097160,2097161,2097162,2097163,2097164,2097165,2097166,2097167,2097168,2097169,2097170,2097171,2097172,2097173,2097174,2097175,2097176,2097177,2097178,2097179,2097180,2097181,2097182,2097183,2097184,2097185,2097186,2097187,2097188,2097189,2097190,2097191,2097192,2097193,2097194,2097195,2097196,2097197,2097198,2097199,2097200,2097201,2097202,2097203,2097204,2097205,2097206,2097207,2097208,2097209,2097210,2097211,2097212,2097213,2097214,2097215,2097216,2097217,2097218,2097219,2097220,2097221,2097222,2097223,2097224,2097225,2097226,2097227,2097228,2097229,2097230,2097231,2097232,2097233,2097234,2097235,2097236,2097237,2097238,2097239,2097240,2097241,2097242,2097243,2097244,2097245,2097246,2097247],name:"TopSites-Games"},33:{applications:[2162689,2162690,2162691,2162692,2162693,2162694,2162695,2162696,2162697,2162698,2162699,2162700,2162701,2162702,2162703,2162704,2162705,2162706,2162707,2162708,2162709,2162710,2162711,2162712,2162713,2162714,2162715,2162716,2162717,2162718,2162719,2162720,2162721,2162722,2162723,2162724,2162725,2162726,2162727,2162728,2162729,2162730,2162731,2162732,2162733,2162734,2162735,2162736,2162737,2162738,2162739,2162740,2162741,2162742,2162743,2162744,2162745,2162746,2162747,2162748,2162749,2162750,2162751,2162752,2162753,2162754,2162755,2162756,2162757,2162758,2162759,2162760,2162761,2162762,2162763,2162764,2162765,2162766,2162767,2162768,2162769,2162770,2162771,2162772,2162773,2162774,2162775,2162776,2162777,2162778,2162779],name:"TopSites-Health"},34:{applications:[2228225,2228226,2228227,2228228,2228229,2228230,2228231,2228232,2228233,2228234,2228235,2228236,2228237,2228238,2228239,2228240,2228241,2228242,2228243,2228244,2228245,2228246,2228247,2228248,2228249,2228250,2228251,2228252,2228253,2228254,2228255,2228256,2228257,2228258,2228259,2228260,2228261,2228262,2228263,2228264,2228265,2228266,2228267,2228268,2228269,2228270,2228271,2228272,2228273,2228274,2228275,2228276,2228277,2228278,2228279,2228280,2228281,2228282,2228283,2228284,2228285,2228286,2228287,2228288,2228289,2228290,2228291,2228292,2228293,2228294,2228295,2228296,2228297,2228298,2228299,2228300,2228301,2228302,2228303,2228304,2228305,2228306,2228307,2228308,2228309,2228310,2228311,2228312,2228313,2228314],name:"TopSites-Home"},35:{applications:[2293761,2293762,2293763,2293764,2293765,2293766,2293767,2293768,2293769,2293770,2293771,2293772,2293773,2293774,2293775,2293776,2293777,2293778,2293779,2293780,2293781,2293782,2293783,2293784,2293785,2293786,2293787,2293788,2293789,2293790,2293791,2293792,2293793,2293794,2293795,2293796,2293797,2293798,2293799,2293800,2293801,2293802,2293803,2293804,2293805,2293806,2293807,2293808,2293809,2293810,2293811,2293812,2293813,2293814,2293815,2293816,2293817,2293818,2293819,2293820,2293821,2293822],name:"TopSites-KidsnTeens"},36:{applications:[2359297,2359298,2359299,2359300,2359301,2359302,2359303,2359304,2359305,2359306,2359307,2359308,2359309,2359310,2359311,2359312,2359313,2359314,2359315,2359316,2359317,2359318,2359319,2359320,2359321,2359322,2359323,2359324,2359325,2359326,2359327,2359328,2359329,2359330,2359331,2359332,2359333,2359334,2359335,2359336,2359337,2359338,2359339,2359340,2359341,2359342,2359343,2359344,2359345,2359346,2359347,2359348,2359349,2359350,2359351,2359352,2359353,2359354,2359355,2359356,2359357,2359358,2359359,2359360,2359361,2359362,2359363,2359364,2359365],name:"TopSites-News"},37:{applications:[2424833,2424834,2424835,2424836,2424837,2424838,2424839,2424840,2424841,2424842,2424843,2424844,2424845,2424846,2424847,2424848,2424849,2424850,2424851,2424852,2424853,2424854,2424855,2424856,2424857,2424858,2424859,2424860,2424861,2424862,2424863,2424864,2424865,2424866,2424867,2424868,2424869,2424870,2424871,2424872,2424873,2424874,2424875,2424876,2424877,2424878,2424879,2424880,2424881,2424882,2424883,2424884,2424885,2424886,2424887,2424888,2424889,2424890,2424891,2424892,2424893,2424894,2424895,2424896,2424897,2424898,2424899,2424900,2424901,2424902,2424903,2424904,2424905,2424906,2424907,2424908,2424909,2424910,2424911,2424912,2424913,2424914,2424915,2424916,2424917,2424918,2424919,2424920],name:"TopSites-Recreation"},38:{applications:[2490369,2490370,2490371,2490372,2490373,2490374,2490375,2490376,2490377,2490378,2490379,2490380,2490381,2490382,2490383,2490384,2490385,2490386,2490387,2490388,2490389,2490390,2490391,2490392,2490393,2490394,2490395,2490396,2490397,2490398,2490399,2490400,2490401,2490402,2490403,2490404,2490405,2490406,2490407,2490408,2490409,2490410,2490411,2490412,2490413,2490414,2490415,2490416,2490417,2490418,2490419,2490420,2490421,2490422,2490423,2490424,2490425,2490426,2490427,2490428,2490429,2490430,2490431,2490432,2490433,2490434,2490435,2490436,2490437,2490438,2490439,2490440,2490441,2490442,2490443,2490444,2490445,2490446,2490447],name:"TopSites-Reference"},39:{applications:[2555905,2555906,2555907,2555908,2555909,2555910,2555911,2555912,2555913,2555914,2555915,2555916,2555917,2555918,2555919,2555920,2555921,2555922,2555923,2555924,2555925,2555926,2555927,2555928,2555929,2555930,2555931,2555932,2555933,2555934,2555935,2555936,2555937,2555938,2555939,2555940,2555941,2555942,2555943,2555944,2555945,2555946,2555947,2555948,2555949,2555950],name:"TopSites-Regional"},4:{applications:[262145,262146,262147,262148,262149,262150,262151,262152,262153,262154,262155,262156,262157,262158,262159,262160,262161,262162,262163,262164,262165,262166,262167,262168,262169,262170,262171,262172,262173,262174,262175,262176,262177,262178,262179,262181,262182,262183,262184,262185,262186,262187,262188,262189,262190,262191,262192,262193,262194,262195,262196,262197,262198,262199,262200,262201,262202,262203,262204,262205,262207,262208,262209,262210,262211,262212,262213,262214,262215,262216,262217,262218,262219,262220,262221,262223,262224,262226,262227,262228,262229,262230,262231,262232,262233,262234,262235,262236,262237,262238,262239,262245,262246,262247,262250,262251,262252,262254,262256,262258,262259,262260,262261,262262,262263,262264,262265,262266,262267,262268,262270,262271,262272,262274,262275,262276,262277,262278,262279,262280,262281,262283,262284,262285,262286,262287,262288,262290,262291,262292,262293,262294,262295,262296,262298,262301,262302,262303,262305,262306,262308,262310,262311,262312,262313,262314,262315,262316,262317,262318,262319,262320,262321,262322,262323,262324,262325,262326,262327,262328,262329,262330,262331,262332,262333,262334,262335,262336,262337,262338,262339,262340,262341,262342,262343,262344,262345,262346,262347,262348,262349],name:"Streaming Media"},40:{applications:[2621441,2621442,2621443,2621444,2621445,2621446,2621447,2621448,2621449,2621450,2621451,2621452,2621453,2621454,2621455,2621456,2621457,2621458,2621459,2621460,2621461,2621462,2621463,2621464,2621465,2621466,2621467,2621468,2621469,2621470,2621471,2621472,2621473,2621474,2621475,2621476,2621477,2621478,2621479,2621480,2621481,2621482,2621483,2621484,2621485,2621486,2621487,2621488,2621489,2621490,2621491,2621492,2621493,2621494,2621495,2621496,2621497,2621498,2621499,2621500,2621501,2621502,2621503],
name:"TopSites-Science"},41:{applications:[2686977,2686978,2686979,2686980,2686981,2686982,2686983,2686984,2686985,2686986,2686987,2686988,2686989,2686990,2686991,2686992,2686993,2686994,2686995,2686996,2686997,2686998,2686999,2687e3,2687001,2687002,2687003,2687004,2687005,2687006,2687007,2687008,2687009,2687010,2687011,2687012,2687013,2687014,2687015,2687016,2687017,2687018,2687019,2687020,2687021,2687022,2687023,2687024,2687025,2687026,2687027,2687028,2687029,2687030,2687031,2687032,2687033,2687034,2687035,2687036,2687037,2687038,2687039,2687040,2687041,2687042,2687043,2687044,2687045,2687046,2687047,2687048,2687049,2687050,2687051,2687052,2687053,2687054,2687055,2687056],name:"TopSites-Shopping"},42:{applications:[2752513,2752514,2752515,2752516,2752517,2752518,2752519,2752520,2752521,2752522,2752523,2752524,2752525,2752526,2752527,2752528,2752529,2752530,2752531,2752532,2752533,2752534,2752535,2752536,2752537,2752538,2752539,2752540,2752541,2752542,2752543,2752544,2752545,2752546,2752547,2752548,2752549,2752550,2752551,2752552,2752553,2752554,2752555,2752556,2752557,2752558,2752559,2752560,2752561,2752562,2752563,2752564,2752565,2752566,2752567,2752568,2752569,2752570,2752571,2752572,2752573,2752574,2752575,2752576,2752577,2752578,2752579,2752580,2752581,2752582,2752583,2752584,2752585,2752586,2752587,2752588,2752589,2752590,2752591],name:"TopSites-Society"},43:{applications:[2818049,2818050,2818051,2818052,2818053,2818054,2818055,2818056,2818057,2818058,2818059,2818060,2818061,2818062,2818063,2818064,2818065,2818066,2818067,2818068,2818069,2818070,2818071,2818072,2818073,2818074,2818075,2818076,2818077,2818078,2818079,2818080,2818081,2818082,2818083,2818084,2818085,2818086,2818087,2818088,2818089,2818090,2818091,2818092,2818093,2818094,2818095,2818096,2818097,2818098,2818099,2818100,2818101,2818102],name:"TopSites-Sports"},5:{applications:[327681,327682,327683,327684,327685,327686,327687,327689,327690,327691,327692,327693,327694,327695,327696,327697,327698,327699,327700,327701,327702,327703,327704,327705,327706,327707,327708,327709,327710,327711,327712,327713,327714,327715,327716,327717,327718,327720,327722,327723,327732,327742,327743,327744,327745,327746,327747,327749,327751,327753,327755,327760,327761,327762,327763,327764,327770,327774,327775,327776,327778,327779,327780,327781,327782,327783,327784,327785,327786,327787,327788,327789,327790,327791,327792,327793,327794,327795],name:"Mail and Collaboration"},6:{applications:[393217,393218,393220,393221,393222,393223,393225,393226,393228,393229,393230,393231,393232,393234,393235,393236,393238,393239,393240,393242,393243,393244,393246,393247],name:"Voice over IP"},7:{applications:[458753,458754,458755,458756,458757,458760,458761,458763,458766,458767,458768],name:"Database"},8:{applications:[524289,524290,524291,524292,524293,524294,524295,524296,524297,524298,524299,524300,524301,524302,524303,524304,524306,524307,524308,524310,524311,524312,524313,524314,524315,524316,524317,524318,524319,524320,524321,524322,524323,524324,524326,524327,524328,524329,524330,524331,524332,524333,524334,524335,524336,524337,524338,524339,524340,524341,524343,524344,524345,524346,524347,524348,524349,524350,524351,524352,524353,524354,524355,524356,524358,524359,524360,524361,524362,524363,524364,524365,524366,524367,524368,524369,524370,524371,524372,524373,524374,524375,524376,524377,524379,524380,524381,524383,524384,524385,524386,524388,524389,524390,524391,524392,524393,524394,524395,524396,524398,524399,524400,524401,524402,524403,524404,524405,524406,524407,524408,524409,524410,524411,524412,524413,524414,524415,524416,524417,524418,524419,524420,524421,524422,524423,524424,524425,524426,524427,524428,524429,524430,524431,524432,524433,524434,524435,524436,524437,524438,524439,524440,524441,524442,524443,524444,524445,524446,524447,524448,524449,524450,524451,524452,524453,524454,524455,524456,524457,524458,524459,524460,524461,524462,524463,524466,524479,524491,524512,524513,524514,524515,524516,524517,524518,524519,524520,524521,524522,524523,524524,524525,524526,524527,524529,524530,524531,524532,524533,524534,524535,524536,524537,524538,524539,524540,524541,524542,524543],name:"Games"},9:{applications:[589828,589829,589885,589888,589890,589916,589933,589934,589942,589951],name:"Network Management"}},version:{major:1,minor:52}}}),define("unifi/util/DpiIconMap",[],function(){"use strict";return{applications:{1:{category_id:0,name:"MSN",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/msn.com/favicon.ico"},10:{category_id:0,name:"Gadu-Gadu"},100:{category_id:0,name:"Verychat(M)"},101:{category_id:0,name:"Voxer(M)"},102:{category_id:0,name:"TextMe(M)"},103:{category_id:0,name:"Bump(M)"},104:{category_id:0,name:"CoolMessenger"},105:{category_id:0,name:"NateOn"},106:{category_id:0,name:"WeChat(M)"},107:{category_id:0,name:"Snapchat(M)"},108:{category_id:0,name:"Wangxin"},11:{category_id:0,name:"Yixin"},1114113:{category_id:17,name:"WatchGuard WSM Management"},1114114:{category_id:17,name:"WatchGuard Web Management UI"},1114115:{category_id:17,name:"WatchGuard Authentication Access"},1114117:{category_id:17,name:"WatchGuard external Webblocker database fetch"},1114118:{category_id:17,name:"Livelink"},1114119:{category_id:17,name:"Altiris"},1114120:{category_id:17,name:"AMS"},1114121:{category_id:17,name:"Apache Synapse"},1114122:{category_id:17,name:"WatchGuard CLI "},1114124:{category_id:17,name:"Webex"},1114125:{category_id:17,name:"Webex-WebOffice"},1114128:{category_id:17,name:"Avamar"},1114129:{category_id:17,name:"Avaya"},1114130:{category_id:17,name:"BackupExec"},1114131:{category_id:17,name:"Bitcoin Core"},1114133:{category_id:17,name:"Microsoft OS license",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},1114134:{category_id:17,name:"Microsoft Office 2013 license",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},1114138:{category_id:17,name:"BZFlag"},1114140:{category_id:17,name:"CAJO"},1114141:{category_id:17,name:"Cisco HSRP"},1114142:{category_id:17,name:"SkyDesk"},1114150:{category_id:17,name:"openQRM"},1114151:{category_id:17,name:"Citrix"},1114152:{category_id:17,name:"CodeMeter"},1114155:{category_id:17,name:"Corba"},1114158:{category_id:17,name:"Cups"},1114160:{category_id:17,name:"Cvsup"},1114161:{category_id:17,name:"DameWare"},1114167:{category_id:17,name:"Db2"},1114169:{category_id:17,name:"Dclink"},1114170:{category_id:17,name:"Urchin Web Analytics"},1114176:{category_id:17,name:"EForward-document transport system"},1114177:{category_id:17,name:"EMWIN"},1114180:{category_id:17,name:"ESRI"},1114182:{category_id:17,name:"Big Brother"},1114187:{category_id:17,name:"Freeciv"},1114188:{category_id:17,name:"Microsoft Lync",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},1114191:{category_id:17,name:"Websense"},1114195:{category_id:17,name:"Whisker"},1114198:{category_id:17,name:"Hewlett-Packard"},1114201:{category_id:17,name:"HP-JetDirect"},1114203:{category_id:17,name:"VMWare"},1114205:{category_id:17,name:"IBM HTTP"},1114206:{category_id:17,name:"IBM SmartCloud"},1114212:{category_id:17,name:"IMS"},1114213:{category_id:17,name:"Infomix"},1114222:{category_id:17,name:"Limelight"},1114229:{category_id:17,name:"Lawson-m3"},1114238:{category_id:17,name:"Meeting-maker"},1114239:{category_id:17,name:"Zendesk"},1114246:{category_id:17,name:"Microsoft DTC",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},1114248:{category_id:17,name:"Microsoft Netlogon",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},1114250:{category_id:17,name:"Microsoft Remote Web Workplace",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},1114252:{category_id:17,name:"Sharepoint-wiki"},1114253:{category_id:17,name:"Microsoft SSDP",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},1114255:{category_id:17,name:"GatherPlace"},1114269:{category_id:17,name:"Xgrid"},1114272:{category_id:17,name:"Backweb"},1114273:{category_id:17,name:"Bugzilla"},1114274:{category_id:17,name:"NCube"},1114275:{category_id:17,name:"WinboxRouterOS"},1114277:{category_id:17,name:"WSO2"},1114279:{category_id:17,name:"NetFlow"},1114289:{category_id:17,name:"concur"},1114290:{category_id:17,name:"NetSupport"},1114308:{category_id:17,name:"DirectAdmin"},1114309:{category_id:17,name:"EasyBits"},1114310:{category_id:17,name:"Eiq-sec-analyzer"},1114311:{category_id:17,name:"Netbotz"},1114318:{category_id:17,name:"Perforce"},1114320:{category_id:17,name:"TiVoConnect"},1114321:{category_id:17,name:"Polycom"},1114322:{category_id:17,name:"WebSphere"},1114330:{category_id:17,name:"Radacct RADIUS"},1114331:{category_id:17,name:"Psiphon"},1114334:{category_id:17,name:"Securemeeting"},1114335:{category_id:17,name:"SW Soft Plesk"},1114337:{category_id:17,name:"SANE"},1114339:{category_id:17,name:"WebHost"},1114340:{category_id:17,name:"CPanel"},1114342:{category_id:17,name:"Sibelius"},1114343:{category_id:17,name:"Siebel-crm"},1114347:{category_id:17,name:"SMS"},1114350:{category_id:17,name:"Spirent"},1114351:{category_id:17,name:"SPSS"},1114352:{category_id:17,name:"Subversion"},1114355:{category_id:17,name:"Tripwire"},1114359:{category_id:17,name:"WatchGuard Webblocker database transfer"},1114361:{category_id:17,name:"WatchGuard Security Event Processor logging"},1114363:{category_id:17,name:"Genesys Meeting Center"},1114365:{category_id:17,name:"Nagios"},1179649:{category_id:18,name:"TCP Port Service Multiplexer"},1179650:{category_id:18,name:"Management Utility"},1179651:{category_id:18,name:"Compression Process"},1179653:{category_id:18,name:"Echo"},1179654:{category_id:18,name:"Discard"},1179655:{category_id:18,name:"Active"},1179660:{category_id:18,name:"Character Generator"},1179665:{category_id:18,name:"any private mail system"},1179667:{category_id:18,name:"AltaVista Firewall97"},1179668:{category_id:18,name:"NSW User System FE"},1179669:{category_id:18,name:"MSG ICP"},1179670:{category_id:18,name:"MSG Authentication"},1179671:{category_id:18,name:"Display Support Protocol"},1179672:{category_id:18,name:"any private printer server"},1179673:{category_id:18,name:"Time"},1179674:{category_id:18,name:"Route Access Protocol"},1179675:{category_id:18,name:"Resource Location Protocol"},1179676:{category_id:18,name:"graphics"},1179677:{category_id:18,name:"Host Name Server"},1179678:{category_id:18,name:"NIC Name"},1179679:{category_id:18,name:"MPM FLAGS Protocol"},1179680:{category_id:18,name:"Message Processing Module [recv]"},1179681:{category_id:18,name:"MPM [default send]"},1179682:{category_id:18,name:"NI FTP"},1179683:{category_id:18,name:"Digital Audit Daemon"},1179684:{category_id:18,name:"Login Host Protocol (TACACS)"},1179685:{category_id:18,name:"Remote Mail Checking Protocol"},1179686:{category_id:18,name:"IMP Logical Address Maintenance"},1179687:{category_id:18,name:"XNS Time Protocol"},1179688:{category_id:18,name:"Domain Name Server"},1179689:{category_id:18,name:"XNS Clearinghouse"},1179690:{category_id:18,name:"ISI Graphics Language"},1179691:{category_id:18,name:"XNS Authentication"},1179692:{category_id:18,name:"Mail Transfer Protocol (MTP)"},1179693:{category_id:18,name:"XNS Mail"},1179694:{category_id:18,name:"any private file service"},1179695:{category_id:18,name:"NI MAIL"},1179696:{category_id:18,name:"ACA Services"},1179697:{category_id:18,name:"VIA Systems - FTP whois++"},1179698:{category_id:18,name:"Communications Integrator (CI)"},1179699:{category_id:18,name:"TACACS-Database Service"},1179700:{category_id:18,name:"Oracle SQL-NET"},1179701:{category_id:18,name:"Bootstrap Protocol Server"},1179702:{category_id:18,name:"Bootstrap Protocol Client"},1179704:{category_id:18,name:"Gopher"},1179705:{category_id:18,name:"Remote Job Service"},1179706:{category_id:18,name:"any private dial out service"},1179707:{category_id:18,name:"Distributed External Object Store"},1179708:{category_id:18,name:"any private RJE service netrjs"},1179709:{category_id:18,name:"Vet TCP"},1179710:{category_id:18,name:"Finger"},1179711:{category_id:18,name:"World Wide Web HTTP"},1179712:{category_id:18,name:"Torpark"},1179713:{category_id:18,name:"XFER Utility"},1179714:{category_id:18,name:"MIT ML Device"},1179715:{category_id:18,name:"Common Trace Facility"},1179716:{category_id:18,name:"Micro Focus Cobol"},1179717:{category_id:18,name:"any private terminal link ttylink"},1179718:{category_id:18,name:"Kerberos"},1179719:{category_id:18,name:"SU MIT Telnet Gateway"},1179720:{category_id:18,name:"DNSIX Securit Attribute Token Map"},1179721:{category_id:18,name:"MIT Dover Spooler"},1179722:{category_id:18,name:"Network Printing Protocol"},1179723:{category_id:18,name:"Device Control Protocol"},1179724:{category_id:18,name:"Tivoli Object Dispatcher"},1179725:{category_id:18,name:"BSD supdupd(8)"},1179726:{category_id:18,name:"DIXIE Protocol Specification"},1179727:{category_id:18,name:"Swift Remote Virtural File Protocol"},1179728:{category_id:18,name:"linuxconf"},1179729:{category_id:18,name:"Metagram Relay"},1179731:{category_id:18,name:"NIC Host Name Server"},1179732:{category_id:18,name:"ISO-TSAP Class 0"},1179733:{category_id:18,name:"Genesis Point-to-Point Trans Net"},1179734:{category_id:18,name:"ACR-NEMA Digital Imag. &amp; Comm. 300"},1179735:{category_id:18,name:"Mailbox Name Nameserver"},1179737:{category_id:18,name:"Eudora compatible PW changer"},1179739:{category_id:18,name:"SNA Gateway Access Server"},1179740:{category_id:18,name:"PostOffice V.2"},1179742:{category_id:18,name:"Portmapper RPC Bind"},1179743:{category_id:18,name:"McIDAS Data Transmission Protocol"},1179744:{category_id:18,name:"Ident Tap Authentication Service"},1179745:{category_id:18,name:"Audio News Multicast"},1179746:{category_id:18,name:"Simple File Transfer Protocol"},1179747:{category_id:18,name:"ANSA REX Notify"},1179748:{category_id:18,name:"UUCP Path Service"},1179749:{category_id:18,name:"SQL Services"},1179752:{category_id:18,name:"Encore Expedited Remote Pro.Call"},1179753:{category_id:18,name:"Smakynet"},1179754:{category_id:18,name:"NTP"},1179755:{category_id:18,name:"ANSA REX Trader"},1179756:{category_id:18,name:"Locus PC-Interface Net Map Ser"},1179757:{category_id:18,name:"Unisys Unitary Login"},1179758:{category_id:18,name:"Locus PC-Interface Conn Server"},1179759:{category_id:18,name:"GSS X License Verification"},1179760:{category_id:18,name:"Password Generator Protocol"},1179761:{category_id:18,name:"Cisco FNATIVE"},1179762:{category_id:18,name:"Cisco TNATIVE"},1179763:{category_id:18,name:"Cisco SYSMAINT"},1179764:{category_id:18,name:"Statistics Service"},1179765:{category_id:18,name:"INGRES-NET Service"},1179766:{category_id:18,name:"NCS local location broker"},1179767:{category_id:18,name:"PROFILE Naming System"},1179768:{category_id:18,name:"NetBIOS Name Service"},1179769:{category_id:18,name:"NetBIOS Datagram Service"},1179770:{category_id:18,name:"NetBIOS Session Service"},1179771:{category_id:18,name:"EMFIS Data Service"},1179772:{category_id:18,name:"EMFIS Control Service"},1179773:{category_id:18,name:"Britton-Lee IDM"},1179774:{category_id:18,name:"Internet Message Access Protocol"},1179775:{category_id:18,name:"Universal Management Architecture"},1179776:{category_id:18,name:"UAAC Protocol"},1179777:{category_id:18,name:"iso-ip0"},1179778:{category_id:18,name:"iso-ip"},1179779:{category_id:18,name:"Jargon"},1179780:{category_id:18,name:"AED 512 Emulation Service"},1179781:{category_id:18,name:"SQL-net"},1179782:{category_id:18,name:"HEMS"},1179783:{category_id:18,name:"Background File Transfer Program (BFTP)"},1179784:{category_id:18,name:"SGMP"},1179785:{category_id:18,name:"NetSC-prod"},1179786:{category_id:18,name:"NetSC-dev"},1179787:{category_id:18,name:"SQL Service"},1179788:{category_id:18,name:"KNET VM Command Message Protocol"},1179789:{category_id:18,name:"PCMail Server"},1179790:{category_id:18,name:"NSS-Routing"},1179791:{category_id:18,name:"SGMP-traps"},1179793:{category_id:18,name:"SNMPTRAP"},1179794:{category_id:18,name:"CMIP TCP Manager"},1179795:{category_id:18,name:"CMIP TCP Agent"},1179796:{category_id:18,name:"Xerox"},1179797:{category_id:18,name:"Sirius Systems"},1179798:{category_id:18,name:"namp"},1179799:{category_id:18,name:"rsvd"},1179800:{category_id:18,name:"send"},1179801:{category_id:18,name:"Network PostScript"},1179802:{category_id:18,name:"Network Innovations Multiplex"},1179803:{category_id:18,name:"Network Innovations CL 1"},1179804:{category_id:18,name:"xyplex-mux"},1179805:{category_id:18,name:"mailq"},1179806:{category_id:18,name:"vmnet"},1179807:{category_id:18,name:"genrad-mux"},1179808:{category_id:18,name:"X Display Manager Control Protocol"},1179809:{category_id:18,name:"NextStep Window Server"},1179810:{category_id:18,name:"Border Gateway Protocol"},1179811:{category_id:18,name:"Intergraph"},1179812:{category_id:18,name:"unify"},1179813:{category_id:18,name:"Unisys Audit SITP"},1179814:{category_id:18,name:"ocbinder"},1179815:{category_id:18,name:"ocserver"},1179816:{category_id:18,name:"remote-kis"},1179817:{category_id:18,name:"KIS Protocol"},1179818:{category_id:18,name:"Application Communication Interface"},1179819:{category_id:18,name:"Plus Fives MUMPS"},1179820:{category_id:18,name:"Queued File Transport"},1179821:{category_id:18,name:"Gateway Access Control Protocol"},1179822:{category_id:18,name:"Prospero Directory Service"},1179823:{category_id:18,name:"OSU Network Monitoring System"},1179824:{category_id:18,name:"Spider Remote Monitoring Protocol"},1179825:{category_id:18,name:"Internet Relay Chat"},1179826:{category_id:18,name:"DNSIX Network Level Module Audit"},1179827:{category_id:18,name:"DNSIX Session Mgt Module Audit Redir"},1179828:{category_id:18,name:"Directory Location Service"},1179829:{category_id:18,name:"Directory Location Service Monitor"},1179830:{category_id:18,name:"SMUX"},1179831:{category_id:18,name:"IBM System Resource Controller"},1179832:{category_id:18,name:"AppleTalk Routing Maintenance",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},1179833:{category_id:18,name:"AppleTalk Name Binding",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},1179834:{category_id:18,name:"AppleTalk Unused",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},1179835:{category_id:18,name:"AppleTalk Echo",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},1179836:{category_id:18,name:"AppleTalk Zone Information",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},1179838:{category_id:18,name:"Trivial Authenticated Mail Protocol"},1179839:{category_id:18,name:"ANSI Z39.50"},1179840:{category_id:18,name:"Texas Instruments"},1179841:{category_id:18,name:"ATEXSSTR"},1179842:{category_id:18,name:"IPX"},1179843:{category_id:18,name:"vmpwscs"},1179844:{category_id:18,name:"Insignia Solutions"},1179845:{category_id:18,name:"Computer Associates Intl License Server"},1179846:{category_id:18,name:"dBASE Unix"},1179847:{category_id:18,name:"Netix Message Posting Protocol"},1179848:{category_id:18,name:"Unisys ARPs"},1179849:{category_id:18,name:"Interactive Mail Access Protocol v3"},1179850:{category_id:18,name:"Berkeley rlogind with SPX auth"},1179851:{category_id:18,name:"Berkeley rshd with SPX auth"},1179852:{category_id:18,name:"Certificate Distribution Center"},1179853:{category_id:18,name:"masqdialer"},1179854:{category_id:18,name:"direct"},1179855:{category_id:18,name:"Survey Measurement"},1179856:{category_id:18,name:"inbusiness"},1179857:{category_id:18,name:"link"},1179858:{category_id:18,name:"Display Systems Protocol"},1179860:{category_id:18,name:"bhfhs"},1179862:{category_id:18,name:"RAP (Route Access Protocol)"},1179863:{category_id:18,name:"Checkpoint Firewall-1"},1179864:{category_id:18,name:"Efficient Short Remote Operations"},1179865:{category_id:18,name:"openport"},1179866:{category_id:18,name:"Checkpoint Firewall-1 Management"},1179867:{category_id:18,name:"arcisdms"},1179868:{category_id:18,name:"hdap"},1179869:{category_id:18,name:"Border Gateway Multicast Protocol (BGMP)"},1179870:{category_id:18,name:"X-Bone CTL"},1179871:{category_id:18,name:"SCSI on ST"},1179872:{category_id:18,name:"Tobit David Service Layer"},1179873:{category_id:18,name:"Tobit David Replica"},1179874:{category_id:18,name:"http-mgmt"},1179875:{category_id:18,name:"personal-link"},1179876:{category_id:18,name:"Cable Port A X"},1179877:{category_id:18,name:"rescap"},1179878:{category_id:18,name:"corerjd"},1179879:{category_id:18,name:"FXP-1"},1179880:{category_id:18,name:"K-BLOCK"},1179881:{category_id:18,name:"Novastor Backup"},1179882:{category_id:18,name:"entrusttime"},1179883:{category_id:18,name:"bhmds"},1179884:{category_id:18,name:"AppleShare IP WebAdmin",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},1179885:{category_id:18,name:"VSLMP"},1179886:{category_id:18,name:"magenta-logic"},1179887:{category_id:18,name:"opalis-robot"},1179888:{category_id:18,name:"DPSI"},1179889:{category_id:18,name:"decAuth"},1179890:{category_id:18,name:"zannet"},1179891:{category_id:18,name:"PKIX TimeStamp"},1179892:{category_id:18,name:"PTP Event"},1179893:{category_id:18,name:"PTP General"},1179894:{category_id:18,name:"Programmable Interconnect Point (PIP)"},1179895:{category_id:18,name:"RTSPS"},1179896:{category_id:18,name:"Texar Security Port"},1179897:{category_id:18,name:"Prospero Data Access Protocol"},1179898:{category_id:18,name:"Perf Analysis Workbench"},1179899:{category_id:18,name:"Zebra server"},1179900:{category_id:18,name:"Fatmen Server"},1179901:{category_id:18,name:"Cabletron Management Protocol"},1179902:{category_id:18,name:"mftp"},1179903:{category_id:18,name:"MATIP Type A"},12:{category_id:0,name:"POPO"},1245187:{category_id:19,name:"DTAG or bhoedap4"},1245188:{category_id:19,name:"ndsauth"},1245189:{category_id:19,name:"bh611"},1245190:{category_id:19,name:"datex-asn"},1245191:{category_id:19,name:"Cloanto Net 1"},1245192:{category_id:19,name:"bhevent"},1245193:{category_id:19,name:"shrinkwrap"},1245195:{category_id:19,name:"Tenebris Network Trace Service"},1245196:{category_id:19,name:"scoi2odialog"},1245197:{category_id:19,name:"semantix"},1245198:{category_id:19,name:"SRS Send"},1245200:{category_id:19,name:"aurora-cmgr"},1245201:{category_id:19,name:"DTK"},1245202:{category_id:19,name:"odmr"},1245203:{category_id:19,name:"mortgageware"},1245204:{category_id:19,name:"qbikgdp"},1245205:{category_id:19,name:"rpc2portmap"},1245206:{category_id:19,name:"Coda authentication server (codaauth2)"},1245207:{category_id:19,name:"ClearCase"},1245208:{category_id:19,name:"ListProcessor"},1245209:{category_id:19,name:"Legent Corporation"},1245210:{category_id:19,name:"hassle"},1245211:{category_id:19,name:"Amiga Envoy Network Inquiry Proto"},1245212:{category_id:19,name:"NEC Corporation"},1245213:{category_id:19,name:"TIA EIA IS-99 modem client"},1245214:{category_id:19,name:"TIA EIA IS-99 modem server"},1245215:{category_id:19,name:"HP Performance data collector"},1245216:{category_id:19,name:"HP Performance data managed node"},1245217:{category_id:19,name:"HP Performance data alarm manager"},1245218:{category_id:19,name:"A Remote Network Server System"},1245219:{category_id:19,name:"IBM Application"},1245220:{category_id:19,name:"ASA Message Router Object Def."},1245221:{category_id:19,name:"Appletalk Update-Based Routing Pro.",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},1245222:{category_id:19,name:"Unidata LDM"},1245223:{category_id:19,name:"Lightweight Directory Access Protocol"},1245224:{category_id:19,name:"uis"},1245225:{category_id:19,name:"SynOptics SNMP Relay Port"},1245226:{category_id:19,name:"SynOptics Port Broker Port"},1245228:{category_id:19,name:"Meta5"},1245229:{category_id:19,name:"EMBL Nucleic Data Transfer"},1245230:{category_id:19,name:"NETscout Control Protocol"},1245231:{category_id:19,name:"Novell Netware over IP"},1245232:{category_id:19,name:"Multi Protocol Trans. Net."},1245233:{category_id:19,name:"kryptolan"},1245234:{category_id:19,name:"ISO Transport Class 2 Non-Control over TCP"},1245235:{category_id:19,name:"Workstation Solutions"},1245236:{category_id:19,name:"Uninterruptible Power Supply"},1245237:{category_id:19,name:"Genie Protocol"},1245238:{category_id:19,name:"decap"},1245239:{category_id:19,name:"nced"},1245240:{category_id:19,name:"ncld"},1245241:{category_id:19,name:"Interactive Mail Support Protocol"},1245242:{category_id:19,name:"timbuktu"},1245243:{category_id:19,name:"Prospero Resource Manager Sys. Man."},1245244:{category_id:19,name:"Prospero Resource Manager Node Man."},1245245:{category_id:19,name:"DECLadebug Remote Debug Protocol"},1245246:{category_id:19,name:"Remote MT Protocol"},1245247:{category_id:19,name:"Trap Convention Port"},1245248:{category_id:19,name:"smsp"},1245249:{category_id:19,name:"infoseek"},1245250:{category_id:19,name:"bnet"},1245251:{category_id:19,name:"silverplatter"},1245252:{category_id:19,name:"onmux"},1245253:{category_id:19,name:"hyper-g"},1245254:{category_id:19,name:"ariel1"},1245255:{category_id:19,name:"smpte"},1245256:{category_id:19,name:"ariel2"},1245257:{category_id:19,name:"ariel3"},1245258:{category_id:19,name:"IBM Operations Planning and Control Start"},1245259:{category_id:19,name:"IBM Operations Planning and Control Track"},1245260:{category_id:19,name:"icad-el"},1245261:{category_id:19,name:"smartsdp"},1245262:{category_id:19,name:"Server Location"},1245263:{category_id:19,name:"ocs_cmu"},1245264:{category_id:19,name:"ocs_amu"},1245265:{category_id:19,name:"utmpsd"},1245266:{category_id:19,name:"utmpcd"},1245267:{category_id:19,name:"iasd"},1245268:{category_id:19,name:"Usenet Network News Transfer"},1245269:{category_id:19,name:"mobileip-agent"},1245270:{category_id:19,name:"mobilip-mn"},1245271:{category_id:19,name:"dna-cml"},1245272:{category_id:19,name:"comscm"},1245273:{category_id:19,name:"dsfgw"},1245274:{category_id:19,name:"dasp"},1245275:{category_id:19,name:"sgcp"},1245276:{category_id:19,name:"decvms-sysmgt"},1245277:{category_id:19,name:"cvc_hostd"},1245278:{category_id:19,name:"HTTP Protocol over TLS SSL"},1245279:{category_id:19,name:"Simple Network Paging Protocol"},1245280:{category_id:19,name:"Win2k+ Server Message Block"},1245281:{category_id:19,name:"ddm-rdb"},1245282:{category_id:19,name:"ddm-dfm"},1245283:{category_id:19,name:"DDM-SSL"},1245284:{category_id:19,name:"AS Server Mapper"},1245285:{category_id:19,name:"tserver"},1245286:{category_id:19,name:"Cray Network Semaphore server"},1245287:{category_id:19,name:"Cray SFS config server"},1245288:{category_id:19,name:"creativeserver"},1245289:{category_id:19,name:"contentserver"},1245290:{category_id:19,name:"creativepartnr"},1245291:{category_id:19,name:"macon-tcp"},1245292:{category_id:19,name:"scohelp"},1245294:{category_id:19,name:"ampr-rcmd"},1245295:{category_id:19,name:"skronk"},1245296:{category_id:19,name:"datasurfsrv"},1245297:{category_id:19,name:"datasurfsrvsec"},1245298:{category_id:19,name:"Alpes"},1245299:{category_id:19,name:"kpasswd"},1245300:{category_id:19,name:"SMTP Protocol over TLS SSL (was SSMTP)"},1245301:{category_id:19,name:"digital-vrc"},1245302:{category_id:19,name:"mylex-mapd"},1245303:{category_id:19,name:"Photuris Key Management"},1245304:{category_id:19,name:"Radio Control Protocol"},1245305:{category_id:19,name:"scx-proxy"},1245306:{category_id:19,name:"mondex"},1245307:{category_id:19,name:"ljk-login"},1245308:{category_id:19,name:"hybrid-pop"},1245309:{category_id:19,name:"tn-tl-w1"},1245310:{category_id:19,name:"Tcpnethaspsrv Protocol"},1245311:{category_id:19,name:"tn-tl-fd1"},1245312:{category_id:19,name:"ss7ns"},1245313:{category_id:19,name:"spsc"},1245314:{category_id:19,name:"iafserver"},1245316:{category_id:19,name:"loadsrv"},1245318:{category_id:19,name:"dvs"},1245319:{category_id:19,name:"bgs-nsi"},1245320:{category_id:19,name:"ulpnet"},1245321:{category_id:19,name:"Integra Software Management Environment"},1245322:{category_id:19,name:"Air Soft Power Burst"},1245324:{category_id:19,name:"sstats"},1245325:{category_id:19,name:"saft Simple Asynchronous File Transfer"},1245326:{category_id:19,name:"gss-http"},1245327:{category_id:19,name:"nest-protocol"},1245328:{category_id:19,name:"micom-pfs"},1245329:{category_id:19,name:"go-login"},1245330:{category_id:19,name:"Transport Independent Convergence for FNA"},1245331:{category_id:19,name:"pov-ray"},1245332:{category_id:19,name:"intecourier"},1245333:{category_id:19,name:"pim-rp-disc"},1245334:{category_id:19,name:"dantz"},1245335:{category_id:19,name:"siam"},1245336:{category_id:19,name:"ISO ILL Protocol"},1245337:{category_id:19,name:"VPN Key Exchange"},1245338:{category_id:19,name:"Simple Transportation Management Framework (STMF)"},1245339:{category_id:19,name:"asa-appl-proto"},1245340:{category_id:19,name:"intrinsa"},1245341:{category_id:19,name:"Citadel"},1245342:{category_id:19,name:"mailbox-lm"},1245343:{category_id:19,name:"ohimsrv"},1245344:{category_id:19,name:"crs"},1245345:{category_id:19,name:"xvttp"},1245346:{category_id:19,name:"snare"},1245347:{category_id:19,name:"FirstClass Protocol"},1245348:{category_id:19,name:"passgo"},1245349:{category_id:19,name:"BSD rexecd(8)"},1245350:{category_id:19,name:"BSD rlogind(8)"},1245351:{category_id:19,name:"BSD rshd(8)"},1245352:{category_id:19,name:"spooler"},1245353:{category_id:19,name:"videotex"},1245354:{category_id:19,name:"like tenex link but across"},1245355:{category_id:19,name:"ntalk"},1245356:{category_id:19,name:"unixtime"},1245357:{category_id:19,name:"Routing Information Protocol (RIP)"},1245358:{category_id:19,name:"ripng"},1245359:{category_id:19,name:"ulp"},1245360:{category_id:19,name:"ibm-db2"},1245361:{category_id:19,name:"NetWare Core Protocol (NCP)"},1245362:{category_id:19,name:"Timeserver"},1245363:{category_id:19,name:"newdate"},1245364:{category_id:19,name:"Stock IXChange"},1245365:{category_id:19,name:"Customer IXChange"},1245366:{category_id:19,name:"irc-serv"},1245370:{category_id:19,name:"readnews"},1245371:{category_id:19,name:"netwall for emergency broadcasts"},1245372:{category_id:19,name:"MegaMedia Admin"},1245373:{category_id:19,name:"iiop"},1245374:{category_id:19,name:"opalis-rdv"},1245375:{category_id:19,name:"Networked Media Streaming Protocol"},1245376:{category_id:19,name:"gdomap"},1245377:{category_id:19,name:"Apertus Technologies Load Determination"},1245378:{category_id:19,name:"uucpd"},1245379:{category_id:19,name:"uucp-rlogin"},1245380:{category_id:19,name:"Commerce"},1245381:{category_id:19,name:"klogin"},1245382:{category_id:19,name:"krcmd"},1245383:{category_id:19,name:"Kerberos encrypted remote shell"},1245384:{category_id:19,name:"DHCPv6 Client"},1245385:{category_id:19,name:"DHCPv6 Server"},1245386:{category_id:19,name:"AFP over TCP"},1245387:{category_id:19,name:"idfp"},1245388:{category_id:19,name:"new-who"},1245389:{category_id:19,name:"cybercash"},1245390:{category_id:19,name:"deviceshare"},1245391:{category_id:19,name:"pirp"},1245392:{category_id:19,name:"Real Time Stream Control Protocol"},1245393:{category_id:19,name:"dsf"},1245394:{category_id:19,name:"Remote File System (RFS)"},1245395:{category_id:19,name:"openvms-sysipc"},1245396:{category_id:19,name:"sdnskmp"},1245397:{category_id:19,name:"teedtap"},1245398:{category_id:19,name:"rmonitord"},1245399:{category_id:19,name:"monitor"},1245400:{category_id:19,name:"chcmd"},1245402:{category_id:19,name:"snews"},1245403:{category_id:19,name:"plan 9 file service"},1245404:{category_id:19,name:"whoami"},1245405:{category_id:19,name:"streettalk"},1245406:{category_id:19,name:"banyan-rpc"},1245407:{category_id:19,name:"Microsoft shuttle",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},1245408:{category_id:19,name:"Microsoft rome",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},1245409:{category_id:19,name:"demon"},1245410:{category_id:19,name:"udemon"},1245411:{category_id:19,name:"sonar"},1245412:{category_id:19,name:"banyan-vip"},1245413:{category_id:19,name:"FTP Software Agent System"},1245414:{category_id:19,name:"vemmi"},1245415:{
category_id:19,name:"ipcd"},1245416:{category_id:19,name:"vnas"},1245417:{category_id:19,name:"ipdd"},1245418:{category_id:19,name:"decbsrv"},1245419:{category_id:19,name:"sntp-heartbeat"},1245420:{category_id:19,name:"Bundle Discovery Protocol"},1245421:{category_id:19,name:"scc-security"},1245422:{category_id:19,name:"Philips Video-Conferencing"},1245423:{category_id:19,name:"keyserver"},1245424:{category_id:19,name:"IMAP4+SSL"},1245425:{category_id:19,name:"password-chg"},1245426:{category_id:19,name:"submission"},1245427:{category_id:19,name:"cal"},1245428:{category_id:19,name:"eyelink"},1245429:{category_id:19,name:"tns-cml"},1245430:{category_id:19,name:"FileMaker Pro"},1245431:{category_id:19,name:"eudora-set"},1245432:{category_id:19,name:"HTTP RPC Ep Map"},1245433:{category_id:19,name:"tpip"},1245434:{category_id:19,name:"cab-protocol"},1245435:{category_id:19,name:"smsd"},1245436:{category_id:19,name:"PTC Name Service"},1245437:{category_id:19,name:"SCO Web Server Manager 3"},1245438:{category_id:19,name:"Aeolon Core Protocol"},1245439:{category_id:19,name:"Sun IPC server"},13:{category_id:0,name:"Tlen"},1310721:{category_id:20,name:"nqs"},1310722:{category_id:20,name:"Sender-Initiated Unsolicited File Transfer"},1310723:{category_id:20,name:"npmp-trap"},1310724:{category_id:20,name:"npmp-local"},1310725:{category_id:20,name:"npmp-gui"},1310726:{category_id:20,name:"HMMP Indication"},1310727:{category_id:20,name:"HMMP Operation"},1310728:{category_id:20,name:"SSLshell"},1310729:{category_id:20,name:"Internet Configuration Manager"},1310730:{category_id:20,name:"SCO System Administration Server"},1310731:{category_id:20,name:"SCO Desktop Administration Server"},1310732:{category_id:20,name:"DEI-ICDA"},1310733:{category_id:20,name:"Digital EVM"},1310734:{category_id:20,name:"SCO WebServer Manager"},1310735:{category_id:20,name:"ESCP"},1310736:{category_id:20,name:"Collaborator"},1310737:{category_id:20,name:"Aux Bus Shunt"},1310738:{category_id:20,name:"Crypto Admin"},1310739:{category_id:20,name:"DEC DLM"},1310740:{category_id:20,name:"ASIA"},1310741:{category_id:20,name:"PassGo Tivoli"},1310742:{category_id:20,name:"QMQP (qmail)"},1310743:{category_id:20,name:"3Com AMP3"},1310744:{category_id:20,name:"RDA"},1310745:{category_id:20,name:"IPP (Internet Printing Protocol)"},1310746:{category_id:20,name:"bmpp"},1310747:{category_id:20,name:"Service Status update (Sterling Software)"},1310748:{category_id:20,name:"ginad"},1310749:{category_id:20,name:"RLZ DBase"},1310750:{category_id:20,name:"LDAP Protocol over TLS SSL (was SLDAP)"},1310751:{category_id:20,name:"lanserver"},1310752:{category_id:20,name:"mcns-sec"},1310753:{category_id:20,name:"Multicast Source Discovery Protocol (MSDP)"},1310754:{category_id:20,name:"entrust-sps"},1310755:{category_id:20,name:"repcmd"},1310756:{category_id:20,name:"ESRO-EMSDP V1.3"},1310757:{category_id:20,name:"SANity"},1310758:{category_id:20,name:"dwr"},1310759:{category_id:20,name:"PSSC"},1310760:{category_id:20,name:"Label Distribution Protocol (LDP)"},1310761:{category_id:20,name:"DHCP Failover"},1310762:{category_id:20,name:"Registry Registrar Protocol (RRP)"},1310763:{category_id:20,name:"Aminet"},1310764:{category_id:20,name:"OBEX"},1310765:{category_id:20,name:"IEEE MMS"},1310766:{category_id:20,name:"HELLO_PORT"},1310767:{category_id:20,name:"AODV"},1310768:{category_id:20,name:"TINC"},1310769:{category_id:20,name:"SPMP"},1310770:{category_id:20,name:"RMC"},1310771:{category_id:20,name:"TenFold"},1310772:{category_id:20,name:"URL Rendezvous"},1310773:{category_id:20,name:"MacOS Server Admin"},1310774:{category_id:20,name:"HAP"},1310775:{category_id:20,name:"PFTP"},1310776:{category_id:20,name:"PureNoise"},1310777:{category_id:20,name:"Secure Aux Bus"},1310778:{category_id:20,name:"Sun DR"},1310779:{category_id:20,name:"doom Id Software"},1310780:{category_id:20,name:"campaign contribution disclosures - SDR Technologies"},1310781:{category_id:20,name:"MeComm"},1310782:{category_id:20,name:"MeRegister"},1310783:{category_id:20,name:"VACDSM-SWS"},1310784:{category_id:20,name:"VACDSM-APP"},1310785:{category_id:20,name:"VPPS-QUA"},1310786:{category_id:20,name:"CIMPLEX"},1310787:{category_id:20,name:"ACAP"},1310788:{category_id:20,name:"DCTP"},1310789:{category_id:20,name:"VPPS Via"},1310790:{category_id:20,name:"Virtual Presence Protocol"},1310791:{category_id:20,name:"GNU Gereration Foundation NCP"},1310792:{category_id:20,name:"MRM"},1310793:{category_id:20,name:"entrust-aaas"},1310794:{category_id:20,name:"entrust-aams"},1310795:{category_id:20,name:"XFR"},1310796:{category_id:20,name:"CORBA IIOP"},1310797:{category_id:20,name:"CORBA IIOP SSL"},1310798:{category_id:20,name:"MDC Port Mapper"},1310799:{category_id:20,name:"Hardware Control Protocol Wismar"},1310800:{category_id:20,name:"asipregistry"},1310801:{category_id:20,name:"REALM-RUSD"},1310802:{category_id:20,name:"NMAP"},1310803:{category_id:20,name:"VATP"},1310804:{category_id:20,name:"MS Exchange Routing"},1310805:{category_id:20,name:"Hyperwave-ISP"},1310806:{category_id:20,name:"connendp"},1310807:{category_id:20,name:"Linux-HA (High-Availability Linux)"},1310808:{category_id:20,name:"IEEE-MMS-SSL"},1310809:{category_id:20,name:"RUSHD"},1310810:{category_id:20,name:"UUIDGEN"},1310811:{category_id:20,name:"OLSR"},1310812:{category_id:20,name:"Access Network"},1310813:{category_id:20,name:"errlog copy server daemon"},1310814:{category_id:20,name:"AgentX"},1310815:{category_id:20,name:"Secure Internet Live Conferencing (SILC)"},1310816:{category_id:20,name:"Borland DSJ"},1310817:{category_id:20,name:"Entrust Key Management Service Handler"},1310818:{category_id:20,name:"Entrust Administration Service Handler"},1310819:{category_id:20,name:"Cisco TDP"},1310820:{category_id:20,name:"IBM NetView DM 6000 Server Client"},1310821:{category_id:20,name:"IBM NetView DM 6000 send tcp"},1310822:{category_id:20,name:"IBM NetView DM 6000 receive tcp"},1310823:{category_id:20,name:"netGW"},1310824:{category_id:20,name:"Network based Rev. Cont. Sys."},1310825:{category_id:20,name:"Flexible License Manager"},1310826:{category_id:20,name:"Fujitsu Device Control"},1310827:{category_id:20,name:"Russell Info Sci Calendar Manager"},1310828:{category_id:20,name:"Kerberos 5 admin changepw"},1310830:{category_id:20,name:"rfile"},1310832:{category_id:20,name:"pump"},1310833:{category_id:20,name:"qrh"},1310834:{category_id:20,name:"rrh"},1310835:{category_id:20,name:"kerberos v5 server propagation"},1310836:{category_id:20,name:"nlogin"},1310837:{category_id:20,name:"con"},1310839:{category_id:20,name:"ns"},1310840:{category_id:20,name:"kpwd Kerberos (v4) passwd"},1310841:{category_id:20,name:"quotad"},1310842:{category_id:20,name:"cycleserv"},1310843:{category_id:20,name:"omserv"},1310844:{category_id:20,name:"webster"},1310845:{category_id:20,name:"phone"},1310846:{category_id:20,name:"vid"},1310847:{category_id:20,name:"cadlock"},1310848:{category_id:20,name:"rtip"},1310849:{category_id:20,name:"cycleserv2"},1310850:{category_id:20,name:"submit"},1310851:{category_id:20,name:"rpasswd"},1310852:{category_id:20,name:"entomb"},1310853:{category_id:20,name:"wpages"},1310854:{category_id:20,name:"Hummingbird Exceed jconfig"},1310855:{category_id:20,name:"wpgs"},1310856:{category_id:20,name:"concert"},1310857:{category_id:20,name:"QSC"},1310858:{category_id:20,name:"controlit"},1310859:{category_id:20,name:"mdbs_daemon"},1310860:{category_id:20,name:"device"},1310861:{category_id:20,name:"FCP"},1310862:{category_id:20,name:"itm-mcell-s"},1310863:{category_id:20,name:"PKIX-3 CA RA"},1310864:{category_id:20,name:"DHCP Failover 2"},1310865:{category_id:20,name:"SUP server"},1310866:{category_id:20,name:"rsync"},1310867:{category_id:20,name:"ICL coNETion locate server"},1310868:{category_id:20,name:"ICL coNETion server info"},1310869:{category_id:20,name:"AccessBuilder"},1310870:{category_id:20,name:"OMG Initial Refs"},1310871:{category_id:20,name:"Samba SWAT Tool"},1310872:{category_id:20,name:"IDEAFARM-CHAT"},1310873:{category_id:20,name:"IDEAFARM-CATCH"},1310874:{category_id:20,name:"xact-backup"},1310875:{category_id:20,name:"SecureNet Pro sensor"},1310878:{category_id:20,name:"Netnews Administration System"},1310879:{category_id:20,name:"Telnet Protocol over TLS SSL"},1310880:{category_id:20,name:"IMAP4 Protocol over TLS SSL"},1310881:{category_id:20,name:"ICP Protocol over TLS SSL"},1310882:{category_id:20,name:"POP3 Protocol over TLS SSL"},1310883:{category_id:20,name:"bhoetty"},1310884:{category_id:20,name:"Cray Unified Resource Manager"},1310887:{category_id:20,name:"Microsoft Authentication via SSL",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},1310888:{category_id:20,name:"Google(SSL)",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},1310889:{category_id:20,name:"Yahoo Authentication via SSL",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},1310890:{category_id:20,name:"AOL Authentication via SSL",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/aol.com/favicon.ico"},1310891:{category_id:20,name:"FIX"},1310892:{category_id:20,name:"STUN"},1310893:{category_id:20,name:"Dynamic Host Configuration Protocol (DHCP)"},1310894:{category_id:20,name:"Megaco"},1310895:{category_id:20,name:"Rstatd"},1310896:{category_id:20,name:"RSVP"},1310897:{category_id:20,name:"SOAP"},1310898:{category_id:20,name:"Ess Apple Authentication via SSL",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},1310899:{category_id:20,name:"TFTP"},1310900:{category_id:20,name:"Daytime"},1310902:{category_id:20,name:"MicrosoftOnline Authentication via SSL",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},1310903:{category_id:20,name:"Microsoft WINS",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},1310904:{category_id:20,name:"Remote Procedure Call (RPC)"},1310905:{category_id:20,name:"SSL/TLS"},1310906:{category_id:20,name:"Google APIs(SSL)",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},1310907:{category_id:20,name:"Sina Authentication via SSL"},1310908:{category_id:20,name:"Google App Engine(SSL)",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},1310909:{category_id:20,name:"Google User Content(SSL)",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},1310910:{category_id:20,name:"Blackberry Authentication via SSL"},1376306:{category_id:21,name:"Apple iMessage",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},1376323:{category_id:21,name:"ezRead Touch"},1376357:{category_id:21,name:"Android browser"},1376359:{category_id:21,name:"Symbian browser"},14:{category_id:0,name:"Wlt"},15:{category_id:0,name:"RenRen"},1507329:{category_id:23,name:"QQ Private Protocol"},1507330:{category_id:23,name:"Thunder Private Protocol"},1507333:{category_id:23,name:"Jabber Private Protocol"},1572865:{category_id:24,name:"Classmates"},1572866:{category_id:24,name:"Yik Yak"},1572867:{category_id:24,name:"Facebook",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/facebook.com/favicon.ico"},1572868:{category_id:24,name:"Flickr"},1572870:{category_id:24,name:"Friendfeed"},1572871:{category_id:24,name:"Hi5"},1572872:{category_id:24,name:"Linkedin",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/linkedin.com/favicon.ico"},1572873:{category_id:24,name:"Livejournal"},1572874:{category_id:24,name:"Twitter",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/twitter.com/favicon.ico"},1572875:{category_id:24,name:"Plurk"},1572876:{category_id:24,name:"MySpace"},1572880:{category_id:24,name:"Khan Academy"},1572881:{category_id:24,name:"Pinterest",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/pinterest.com/favicon.ico"},1572882:{category_id:24,name:"Tumblr",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/tumblr.com/favicon.ico"},1572883:{category_id:24,name:"MeetMe"},1572884:{category_id:24,name:"VKontakte"},1572885:{category_id:24,name:"Odnoklassniki"},1572886:{category_id:24,name:"Niwota"},1572887:{category_id:24,name:"Tagged"},1572889:{category_id:24,name:"PerfSpot"},1572890:{category_id:24,name:"Me2day"},1572891:{category_id:24,name:"Mekusharim"},1572892:{category_id:24,name:"Draugiem"},1572893:{category_id:24,name:"Badoo"},1572894:{category_id:24,name:"Meetup"},1572895:{category_id:24,name:"Foursquare"},1572896:{category_id:24,name:"Ning"},1572897:{category_id:24,name:"i-Part"},1572898:{category_id:24,name:"Wretch"},1572899:{category_id:24,name:"Dudu"},1572900:{category_id:24,name:"Mig33"},1572901:{category_id:24,name:"Hatena"},1572902:{category_id:24,name:"eHarmony"},1572903:{category_id:24,name:"Fotolog "},1572905:{category_id:24,name:"Tencent QQ"},1572906:{category_id:24,name:"Pixnet"},1572907:{category_id:24,name:"Nk.Pl"},1572908:{category_id:24,name:"K.ai"},1572909:{category_id:24,name:"Twoo"},1572910:{category_id:24,name:"Plaxo"},1572911:{category_id:24,name:"Cyworld"},1572912:{category_id:24,name:"Jivesoftware"},1572913:{category_id:24,name:"WordPress",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/wordpress.com/favicon.ico"},1572914:{category_id:24,name:"FMyLife"},1572915:{category_id:24,name:"Dcinside"},1572916:{category_id:24,name:"Class Chinaren"},1572917:{category_id:24,name:"Bai Sohu"},1572918:{category_id:24,name:"Yammer"},1572919:{category_id:24,name:"Douban"},1572920:{category_id:24,name:"Gamer"},1572921:{category_id:24,name:"Xuite"},1572922:{category_id:24,name:"ChatMe"},1572923:{category_id:24,name:"Clien.net"},1572927:{category_id:24,name:"AdultFriendFinder"},1572928:{category_id:24,name:"Fling.com"},1572929:{category_id:24,name:"Delicious"},1572930:{category_id:24,name:"Mei.fm"},1572931:{category_id:24,name:"Streetlife"},1572967:{category_id:24,name:"Daum-blog"},1572968:{category_id:24,name:"Naver-blog"},1572970:{category_id:24,name:"Panoramio"},1572974:{category_id:24,name:"Blogger "},1572975:{category_id:24,name:"FC2"},1572976:{category_id:24,name:"Yahoo Blog",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},1572977:{category_id:24,name:"Friendster"},1572978:{category_id:24,name:"Ameba"},1572980:{category_id:24,name:"Bebo social network"},1572981:{category_id:24,name:"Kaixin"},1572983:{category_id:24,name:"Orkut"},1572985:{category_id:24,name:"Aol-Answers",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/aol.com/favicon.ico"},1572987:{category_id:24,name:"CoolTalk social network"},1572988:{category_id:24,name:"RenRen.com"},1572989:{category_id:24,name:"TweetDeck"},1572990:{category_id:24,name:"Hootsuite"},1572998:{category_id:24,name:"Xing"},1572999:{category_id:24,name:"Lokalisten"},1573000:{category_id:24,name:"meinVZ/studiVZ"},1573004:{category_id:24,name:"Viadeo"},1573005:{category_id:24,name:"Tuenti"},1573006:{category_id:24,name:"Hyves"},1573007:{category_id:24,name:"Mixi.jp"},1573008:{category_id:24,name:"Yahoo-mbga.jp",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},1573009:{category_id:24,name:"Gree.jp"},1573010:{category_id:24,name:"Netlog"},1573011:{category_id:24,name:"2ch"},1573014:{category_id:24,name:"LoveTheseCurves"},1573015:{category_id:24,name:"Weibo"},1573016:{category_id:24,name:"Google-plus",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},1573017:{category_id:24,name:"Skyrock"},1573018:{category_id:24,name:"51.com"},1573019:{category_id:24,name:"Jackd(M)"},1573020:{category_id:24,name:"Touch(M)"},1573021:{category_id:24,name:"Skout(M)"},1573022:{category_id:24,name:"Instagram",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/instagram.com/favicon.ico"},1573023:{category_id:24,name:"Jiayuan"},1573024:{category_id:24,name:"Zoosk(M)"},1573025:{category_id:24,name:"DatingDNA(M)"},1573026:{category_id:24,name:"500px"},1573027:{category_id:24,name:"Socialcam(M)"},1573028:{category_id:24,name:"iAround(M)"},1573029:{category_id:24,name:"MomoChat(M)"},1573030:{category_id:24,name:"Path(M)"},1573031:{category_id:24,name:"WeHeartIt"},1573032:{category_id:24,name:"Fancy(M)"},1573033:{category_id:24,name:"Vine(M)"},1573035:{category_id:24,name:"Miliao"},16:{category_id:0,name:"Omegle"},16777215:{category_id:255,name:"Unknown"},17:{category_id:0,name:"IPMSG"},18:{category_id:0,name:"Aliww"},1835009:{category_id:28,name:"LiveJasmin"},1835010:{category_id:28,name:"Youporn"},1835011:{category_id:28,name:"XNXX Galleries"},1835012:{category_id:28,name:"Adult Friendfinder"},1835013:{category_id:28,name:"FreeOnes"},1835014:{category_id:28,name:"Streamate"},1835015:{category_id:28,name:"Fling"},1835016:{category_id:28,name:"Literotica.Com"},1835017:{category_id:28,name:"Adam4Adam"},1835018:{category_id:28,name:"Playboy Digital"},1835019:{category_id:28,name:"VICE"},1835020:{category_id:28,name:"Manhunt"},1835021:{category_id:28,name:"GayRomeo"},1835022:{category_id:28,name:"Newgrounds"},1835023:{category_id:28,name:"Payserve"},1835024:{category_id:28,name:"eBaums World"},1835025:{category_id:28,name:"Flirt4Free"},1835026:{category_id:28,name:"Be Naughty"},1835027:{category_id:28,name:"Debonairblog"},1835028:{category_id:28,name:"AEBN"},1835029:{category_id:28,name:"FetLife"},1835030:{category_id:28,name:"ImLive"},1835031:{category_id:28,name:"Video Sex Archive"},1835032:{category_id:28,name:"Mr. Skin"},1835033:{category_id:28,name:"Clips4Sale"},1835034:{category_id:28,name:"Femjoy"},1835035:{category_id:28,name:"HQ Porn Links"},1835036:{category_id:28,name:"The Voyeurweb"},1835037:{category_id:28,name:"Alt.Sex.Stories Text Repository"},1835038:{category_id:28,name:"Xcams"},1835039:{category_id:28,name:"AV Entertainments"},1835040:{category_id:28,name:"Indian Sex Stories"},1835041:{category_id:28,name:"World Sex"},1835042:{category_id:28,name:"Fur Affinity"},1835043:{category_id:28,name:"Celebrity Movie Archive"},1835044:{category_id:28,name:"The Erotic Review"},1835045:{category_id:28,name:"Internet Adult Film Database"},1835046:{category_id:28,name:"Shoosh Time"},1835047:{category_id:28,name:"Thumblogger"},1835048:{category_id:28,name:"First Time Videos"},1835049:{category_id:28,name:"The Huns Yellow Pages"},1835050:{category_id:28,name:"CollarMe"},1835051:{category_id:28,name:"Sex in the UK"},1835052:{category_id:28,name:"Links Hit"},1835053:{category_id:28,name:"Peachy Forum"},1835054:{category_id:28,name:"Swing Life Style"},1835055:{category_id:28,name:"Scoreland Tits"},1835056:{category_id:28,name:"Girlfriend Videos"},1835057:{category_id:28,name:"Digital Playground"},1835058:{category_id:28,name:"Penthouse"},1835059:{category_id:28,name:"Squirt.org"},1835060:{category_id:28,name:"MPL Studios"},1835061:{category_id:28,name:"Wicked Weasel Bikinis"},1835062:{category_id:28,name:"Nifty Erotic Stories Archive"},1835063:{category_id:28,name:"VideoBox"},1835064:{category_id:28,name:"EdenFantasys"},1835065:{category_id:28,name:"Vintage Erotica Forum"},1835066:{category_id:28,name:"PHE"},1835067:{category_id:28,name:"DudesNude"},1835068:{category_id:28,name:"Heaven 666"},1835069:{category_id:28,name:"GameLink"},1835070:{category_id:28,name:"Ask Jolene"},1835071:{category_id:28,name:"Polyner Artist Web Ring"},1835072:{category_id:28,name:"VirtuaGirl 2"},1835073:{category_id:28,name:"Inthecrack"},1835074:{category_id:28,name:"Suicide Girls"},1835075:{category_id:28,name:"Fleshbot"},1835076:{category_id:28,name:"Oglaf"},1835077:{category_id:28,name:"ALS Scan"},1835078:{category_id:28,name:"Odloty"},1835079:{category_id:28,name:"Southern Charms"},1835080:{category_id:28,name:"Fab Swingers"},1835081:{category_id:28,name:"The Stile Project"},1835082:{category_id:28,name:"Hentai Foundry"},1835083:{category_id:28,name:"Adult DVD Empire"},1835084:{category_id:28,name:"Webcams"},1835085:{category_id:28,name:"Cityvibe"},1835086:{category_id:28,name:"Manjam"},1835087:{category_id:28,name:"XBIZ"},1835088:{category_id:28,name:"Rogan"},1835089:{category_id:28,name:"AVN Media Network"},1835090:{category_id:28,name:"Fleshlight"},1835091:{category_id:28,name:"Fucking Machines"},1835092:{category_id:28,name:"Recon"},1835093:{category_id:28,name:"Hogtied"},1835094:{category_id:28,name:"Swingers Date Club"},1835095:{category_id:28,name:"Sex Toys Uk"},1835096:{category_id:28,name:"Lush Sex Stories"},1835097:{category_id:28,name:"NiteFlirt"},1835098:{category_id:28,name:"Wife Lovers"},1835099:{category_id:28,name:"Sucksex"},1835100:{category_id:28,name:"Project Voyeur"},1835101:{category_id:28,name:"Fritchy Forums"},1835102:{category_id:28,name:"AL4A"},1835103:{category_id:28,name:"What The Fuck!?"},1835104:{category_id:28,name:"Kaktuz"},1835105:{category_id:28,name:"Rabbits Reviews"},1835106:{category_id:28,name:"Truth or Dare Pics"},1835107:{category_id:28,name:"Sunny Leone"},1835108:{category_id:28,name:"SPAcash"},19:{category_id:0,name:"Mail.ru IM"},1900545:{category_id:29,name:"The Internet Movie Database"},1900546:{category_id:29,name:"BBC Online"},1900547:{category_id:29,name:"CNN Interactive",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/cnn.com/favicon.ico"},1900548:{category_id:29,name:"ESPN.com",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/espn.go.com/favicon.ico"},1900549:{category_id:29,name:"The Weather Channel"},1900550:{category_id:29,name:"FoxNews"},1900551:{category_id:29,name:"deviantART"},1900552:{category_id:29,name:"Yahoo! Movies",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},1900553:{category_id:29,name:"NBC News"},1900554:{category_id:29,name:"Yahoo! TV",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},1900555:{category_id:29,name:"ABCNews"},1900556:{category_id:29,name:"NDTV"},1900557:{category_id:29,name:"CBS News"},1900558:{category_id:29,name:"CNN/Money",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/cnn.com/favicon.ico"},1900559:{category_id:29,name:"TMZ"},1900560:{category_id:29,name:"CNBC"},1900561:{category_id:29,name:"Wired"},1900562:{category_id:29,name:"Fox Sports Network"},1900563:{category_id:29,name:"CNN/SI Network Page",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/cnn.com/favicon.ico"},1900564:{category_id:29,name:"Rotten Tomatoes"},1900565:{category_id:29,name:"Disney"},1900566:{category_id:29,name:"Urban Dictionary"},1900567:{category_id:29,name:"Food Network"},1900568:{category_id:29,name:"British Sky Broadcasting"},1900569:{category_id:29,name:"NPR Online- National Public Radio"},1900570:{category_id:29,name:"Gawker"},1900571:{category_id:29,name:"Last.fm"},1900572:{category_id:29,name:"Comcast Corporation"},1900573:{category_id:29,name:"ABC"},1900574:{category_id:29,name:"CBS"},1900575:{category_id:29,name:"Salon"},1900576:{category_id:29,name:"CBC Television"},1900577:{category_id:29,name:"E Online"},1900578:{category_id:29,name:"FanFiction.Net"},1900579:{category_id:29,name:"Ultimate Guitar Archive"},1900580:{category_id:29,name:"Deezer.com"},1900581:{category_id:29,name:"Fandango"},1900582:{category_id:29,name:"Copyscape"},1900583:{category_id:29,name:"A-Z Lyrics"},1900584:{category_id:29,name:"Atlantic Online"},1900585:{category_id:29,name:"Discovery Channel"},1900586:{category_id:29,name:"Australian Broadcasting Corporation"},1900587:{category_id:29,name:"Egotastic"},1900588:{category_id:29,name:"NBC"},1900589:{category_id:29,name:"MetroLyrics"},1900590:{category_id:29,name:"TV Guide"},1900591:{category_id:29,name:"MTV"},1900592:{category_id:29,name:"Entertainment Weekly"},1900593:{category_id:29,name:"ksl"},1900594:{category_id:29,name:"World Wrestling Entertainment"},1900595:{category_id:29,name:"Cartoon Network"},1900596:{category_id:29,name:"xkcd"},1900597:{category_id:29,name:"SkyscraperCity"},1900598:{category_id:29,name:"DIRECTV"},1900599:{category_id:29,name:"Discogs"},1900600:{category_id:29,name:"PBS Online"},1900601:{category_id:29,name:"PBS Kids!"},1900602:{category_id:29,name:"The Hollywood Reporter"},1900603:{category_id:29,name:"Nickelodeon"},1900604:{category_id:29,name:"TV"},1900605:{category_id:29,name:"Ravelry"},1900606:{category_id:29,name:"Nick Jr."},1900607:{category_id:29,name:"Rollingstone Magazine"},1900608:{category_id:29,name:"India Forums "},1900609:{category_id:29,name:"Deutsche Welle Radio"},1900610:{category_id:29,name:"Cox Communications"},1900611:{category_id:29,name:"Voice of America"},1900612:{category_id:29,name:"AMC"},1900613:{category_id:29,name:"Metacritic"},1900614:{category_id:29,name:"Islamic Republic of Iran Broadcasting"},1900615:{category_id:29,name:"goComics"},1900616:{category_id:29,name:"The New Yorker"},1900617:{category_id:29,name:"B92"},1900618:{category_id:29,name:"Moviefone"},1900619:{category_id:29,name:"Lyrics Freak"},1900620:{category_id:29,name:"Oprah"},1900621:{category_id:29,name:"Comedy Central"},1900622:{category_id:29,name:"Veoh"},1900623:{category_id:29,name:"Box Office Mojo"},1900624:{category_id:29,name:"All Music Guide"},1900625:{category_id:29,name:"Billboard"},1900626:{category_id:29,name:"RAI"},1900627:{category_id:29,name:"Home and Garden Television (HGTV)"},1900628:{category_id:29,name:"Canon World Wide Gateway"},1900629:{category_id:29,name:"Lorem Ipsum"},1966081:{category_id:30,name:"PayPal",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/paypal.com/favicon.ico"},1966082:{category_id:30,name:"Alibaba"},1966083:{category_id:30,name:"Yahoo! Finance",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},1966084:{category_id:30,name:"Bank of America",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/bankofamerica.com/favicon.ico"},1966085:{category_id:30,name:"Chase Bank",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/chase.com/favicon.ico"},1966086:{category_id:30,name:"Wells Fargo",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/wellsfargo.com/favicon.ico"},1966087:{category_id:30,name:"The Wall Street Journal Interactive Edition"},1966088:{category_id:30,name:"Samsung Electronics"},1966089:{category_id:30,name:"UPS"},196609:{category_id:3,name:"FTP Applications"},1966090:{category_id:30,name:"Target Corporation",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/target.com/favicon.ico"},1966091:{category_id:30,name:"Reuters Group PLC"},1966092:{category_id:30,name:"Indeed"},1966093:{category_id:30,name:"Forbes Magazine"},1966094:{category_id:30,name:"Constant Contact"},1966095:{category_id:30,name:"Shutterstock"},1966096:{category_id:30,name:"ClickBank"},1966097:{category_id:30,name:"AT&T"},1966098:{category_id:30,name:"American Express"},1966099:{category_id:30,name:"FedEx"},196610:{category_id:3,name:"GetRight"},1966100:{category_id:30,name:"EzineArticles"},1966101:{category_id:30,name:"Commission Junction"},1966102:{category_id:30,name:"TechCrunch"},1966103:{category_id:30,name:"HDFC Bank Ltd."},1966104:{category_id:30,name:"Verizon Wireless"},1966105:{category_id:30,name:"Freelancer"},1966106:{category_id:30,name:"iStockphoto"},1966107:{category_id:30,name:"Bloomberg"},1966108:{category_id:30,name:"Capital One Financial Corp."},1966109:{category_id:30,name:"Fotolia"},196611:{category_id:3,name:"FlashGet"},1966110:{category_id:30,name:"ICICI Bank"},1966111:{category_id:30,name:"123RF Royalty Free Stock Photos"},1966112:{category_id:30,name:"Zillow",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/zillow.com/favicon.ico"},1966113:{category_id:30,name:"Monster"},1966114:{category_id:30,name:"TradeDoubler"},1966115:{category_id:30,name:"Industrial and Commercial Bank of China"},1966116:{category_id:30,name:"Nokia"},1966117:{category_id:30,name:"Sears"},1966118:{category_id:30,name:"CNET News"},1966119:{category_id:30,name:"Indian Railways"},196612:{category_id:3,name:"AsianDVDClub"},1966120:{category_id:30,name:"The Sun"},1966121:{category_id:30,name:"Verizon Corporation"},1966122:{category_id:30,name:"Elance"},1966123:{category_id:30,name:"CareerBuilder"},1966124:{category_id:30,name:"Citibank U.S."},1966125:{category_id:30,name:"GetResponse Email Marketing"},1966126:{category_id:30,name:"Business Week"},1966127:{category_id:30,name:"MarketWatch"},1966128:{category_id:30,name:"Shareasale"},1966129:{category_id:30,name:"SiteSell"},196613:{category_id:3,name:"Web File Transfer"},1966130:{category_id:30,name:"Manta"},1966131:{category_id:30,name:"Eventbrite"},1966132:{category_id:30,name:"Citibank Online"},1966133:{category_id:30,name:"Dreamstime Stock Photography"},1966134:{category_id:30,name:"Costco Wholesale Corporation"},1966135:{category_id:30,name:"H&M"},1966136:{category_id:30,name:"Merriam-Webster"},1966137:{category_id:30,name:"The Economic Times"},1966138:{category_id:30,name:"U.S. Bank"},1966139:{category_id:30,name:"TD Bank"},196614:{category_id:3,name:"FileZilla"},1966140:{category_id:30,name:"Intel Corp"},1966141:{category_id:30,name:"Zazzle"},1966142:{category_id:30,name:"Behance Network"},1966143:{category_id:30,name:"Commonwealth Bank of Australia"},1966144:{category_id:30,name:"La Caja de Ahorros y Pensiones de Barcelona"},1966145:{category_id:30,name:"ZDNet"},1966146:{category_id:30,name:"Realtor"},1966147:{category_id:30,name:"New York Post Online Edition"},1966148:{category_id:30,name:"glispa"},1966149:{category_id:30,name:"Financial Times News"},196615:{category_id:3,name:"Kuaipan"},1966150:{category_id:30,name:"SitePoint"},1966151:{category_id:30,name:"T-Mobile"},1966152:{category_id:30,name:"National Hurricane Center"},1966153:{category_id:30,name:"ForexFactory"},1966154:{category_id:30,name:"Sprint"},1966155:{category_id:30,name:"Sony Electronics"},1966156:{category_id:30,name:"VistaPrint"},1966157:{category_id:30,name:"MOJO Works"},1966158:{category_id:30,name:"TD Canada Trust"},1966159:{category_id:30,name:"Zara"},196616:{category_id:3,name:"DBank"},1966160:{category_id:30,name:"Cisco"},1966161:{category_id:30,name:"WebMoney Transfer"},1966162:{category_id:30,name:"Fidelity Investments"},1966163:{category_id:30,name:"USAA"},1966164:{category_id:30,name:"Discover Financial Services"},1966165:{category_id:30,name:"Lego Company"},1966166:{category_id:30,name:"Axis Bank"},1966167:{category_id:30,name:"The Economist"},1966168:{category_id:30,name:"Kmart"},1966169:{category_id:30,name:"Inc"},196617:{category_id:3,name:"115.com"},1966170:{category_id:30,name:"Univision"},1966171:{category_id:30,name:"DHL Worldwide Express"},1966172:{category_id:30,name:"PNC Financial Services Group"},1966173:{category_id:30,name:"WebEx Communications"},196618:{category_id:3,name:"Weiyun"},196619:{category_id:3,name:"Rayfile"},196620:{category_id:3,name:"0zz0"},196621:{category_id:3,name:"Herosh"},196622:{category_id:3,name:"2Shared"},196624:{category_id:3,name:"BIZHARD"},196626:{category_id:3,name:"UPlusBox"},196627:{category_id:3,name:"Filebox.ro"},196628:{category_id:3,name:"Qnext"},196629:{category_id:3,name:"OneDrive"},196630:{category_id:3,name:"YunFile"},196631:{category_id:3,name:"Filehosting"},196632:{category_id:3,name:"Dev-Host"},196633:{category_id:3,name:"Solidfiles"},196634:{category_id:3,name:"IBackup"},196635:{category_id:3,name:"FileSwap"},196637:{category_id:3,name:"Temp-Share"},196638:{category_id:3,name:"WikiUpload"},196640:{category_id:3,name:"MEGA"},196641:{category_id:3,name:"Copy.com"},196642:{category_id:3,name:"4Shared"},196643:{category_id:3,name:"HiCloud"},196644:{category_id:3,name:"Depositfiles"},196645:{category_id:3,name:"Docstoc"},196646:{category_id:3,name:"360 Cloud"},196647:{category_id:3,name:"Symantec Nomdb"},196648:{category_id:3,name:"Baidu Cloud"},196649:{category_id:3,name:"GitHub"},196650:{category_id:3,name:"FileDropper"},196651:{category_id:3,name:"CrashPlan"},196652:{category_id:3,name:"Net2FTP"},196653:{category_id:3,name:"Mediafire"},196655:{category_id:3,name:"Carbonite"},196656:{category_id:3,name:"Mozy"},196657:{category_id:3,name:"SOS Online Backup"},196669:{category_id:3,name:"cute-ftp(HTTP)"},196676:{category_id:3,name:"Box"},196678:{category_id:3,name:"Scribd"},196680:{category_id:3,name:"Rapidshare"},196681:{category_id:3,name:"Sendspace"},196683:{category_id:3,name:"Hightail"},196684:{category_id:3,name:"Diino"},196686:{category_id:3,name:"Fluxiom"},196689:{category_id:3,name:"Nomadesk"},196692:{category_id:3,name:"Dropbox"},196693:{category_id:3,name:"Filesend.to"},196694:{category_id:3,name:"Firestorage"},196695:{category_id:3,name:"Naver Ndrive"},196696:{category_id:3,name:"Filesend.net"},196697:{category_id:3,name:"Crocko"},196700:{category_id:3,name:"Fileserve"},196701:{category_id:3,name:"Netload"},196702:{category_id:3,name:"Megashares"},196703:{category_id:3,name:"TransferBigFiles"},196705:{category_id:3,name:"Filemail"},196706:{category_id:3,name:"Zamzar"},196708:{category_id:3,name:"Divshare"},196709:{category_id:3,name:"DL Free"},196711:{category_id:3,name:"Nakido"},196713:{category_id:3,
name:"Gigaup"},196714:{category_id:3,name:"Filestube"},196716:{category_id:3,name:"Filer.cx"},196717:{category_id:3,name:"Cx.com"},196718:{category_id:3,name:"Elephantdrive"},196722:{category_id:3,name:"Zshare"},196723:{category_id:3,name:"Freakshare"},196724:{category_id:3,name:"Uploading"},196725:{category_id:3,name:"Bitshare"},196726:{category_id:3,name:"Letitbit.net"},196727:{category_id:3,name:"Extabit"},196728:{category_id:3,name:"Filefactory"},196729:{category_id:3,name:"Furk"},196731:{category_id:3,name:"GoldFile"},196732:{category_id:3,name:"GigaSize"},196733:{category_id:3,name:"Turbobit"},196735:{category_id:3,name:"Hitfile"},196737:{category_id:3,name:"Zippyshare"},196738:{category_id:3,name:"SoundCloud"},196739:{category_id:3,name:"SpeedyShare"},196742:{category_id:3,name:"FilePost.net"},196743:{category_id:3,name:"GlumboUploads"},196744:{category_id:3,name:"RapidGator.net"},196746:{category_id:3,name:"Clip2net"},196747:{category_id:3,name:"Datei.to"},196748:{category_id:3,name:"Totodisk"},196749:{category_id:3,name:"LeapFile"},196750:{category_id:3,name:"BigUpload"},196751:{category_id:3,name:"OnlineFileFolder"},196752:{category_id:3,name:"ASUSWebStorage"},196753:{category_id:3,name:"File-Upload.net"},196754:{category_id:3,name:"File-Works"},196755:{category_id:3,name:"Zumodrive"},196756:{category_id:3,name:"PutLocker"},196757:{category_id:3,name:"Wetransfer"},196758:{category_id:3,name:"iCloud",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},196759:{category_id:3,name:"CloudMe"},196760:{category_id:3,name:"Beanywhere"},196761:{category_id:3,name:"Sugarsync"},196762:{category_id:3,name:"DriveHQ"},196764:{category_id:3,name:"Backblaze"},196765:{category_id:3,name:"AirSet"},196766:{category_id:3,name:"SpiderOak"},196767:{category_id:3,name:"1337X"},196768:{category_id:3,name:"MailBigFile"},196769:{category_id:3,name:"GoldCoupon.co.kr"},196770:{category_id:3,name:"Egnyte"},196771:{category_id:3,name:"SmugMug"},196772:{category_id:3,name:"SlideShare.net"},196773:{category_id:3,name:"4Sync"},196774:{category_id:3,name:"IDrive"},196775:{category_id:3,name:"Mendeley"},196777:{category_id:3,name:"Daum-cloud"},2:{category_id:0,name:"Yahoo Messenger",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},20:{category_id:0,name:"Kubao"},2031617:{category_id:31,name:"Yahoo!",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2031618:{category_id:31,name:"Yahoo! Mail",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2031619:{category_id:31,name:"Windows Live Hotmail"},2031620:{category_id:31,name:"Yahoo! Search",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2031621:{category_id:31,name:"Google Docs",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},2031622:{category_id:31,name:"Alexa Internet"},2031623:{category_id:31,name:"Bing",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/bing.com/favicon.ico"},2031624:{category_id:31,name:"Babylon"},2031625:{category_id:31,name:"Google+",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},2031626:{category_id:31,name:"Microsoft Corporation",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},2031627:{category_id:31,name:"Apple Inc.",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},2031628:{category_id:31,name:"Go"},2031629:{category_id:31,name:"Ask"},2031630:{category_id:31,name:"Adobe Systems Incorporated"},2031631:{category_id:31,name:"AVG | Antivirus and Security Software"},2031632:{category_id:31,name:"The Pirate Bay"},2031633:{category_id:31,name:"www.ZEDO"},2031634:{category_id:31,name:"Babylon Search"},2031635:{category_id:31,name:"Stack Overflow"},2031636:{category_id:31,name:"About"},2031637:{category_id:31,name:"Google Adwords",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},2031638:{category_id:31,name:"Imgur.com",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/imgur.com/favicon.ico"},2031639:{category_id:31,name:"Go Daddy"},2031640:{category_id:31,name:"Google Play",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},2031641:{category_id:31,name:"Vimeo.com"},2031642:{category_id:31,name:"The Apple Store",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},2031643:{category_id:31,name:"Badoo.Com"},2031644:{category_id:31,name:"AWeber Systems"},2031645:{category_id:31,name:"SourceForge"},2031646:{category_id:31,name:"SlideShare"},2031647:{category_id:31,name:"Mozilla"},2031648:{category_id:31,name:"Wikia",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/wikia.com/favicon.ico"},2031649:{category_id:31,name:"Google AdSense",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},2031650:{category_id:31,name:"Fiverr"},2031651:{category_id:31,name:"Photobucket image hosting and photo sharing"},2031652:{category_id:31,name:"Clicksor"},2031653:{category_id:31,name:"HootSuite Social Media Dashboard"},2031654:{category_id:31,name:"1-Click Answers"},2031655:{category_id:31,name:"StatCounter"},2031656:{category_id:31,name:"CNET Download"},2031657:{category_id:31,name:"Rediff"},2031658:{category_id:31,name:"My Yahoo",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2031659:{category_id:31,name:"The Internet Archive"},2031660:{category_id:31,name:"isoHunt"},2031661:{category_id:31,name:"DomainTools"},2031662:{category_id:31,name:"CNET"},2031663:{category_id:31,name:"GitHub.com"},2031664:{category_id:31,name:"Host Gator"},2031665:{category_id:31,name:"PHP"},2031666:{category_id:31,name:"GMX"},2031667:{category_id:31,name:"Microsoft Developer Network",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/msdn.com/favicon.ico"},2031668:{category_id:31,name:"ImageShack"},2031669:{category_id:31,name:"Dell Inc."},2031670:{category_id:31,name:"Microsoft Office Online",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},2031671:{category_id:31,name:"Mashable"},2031672:{category_id:31,name:"Digital Point Solutions"},2031673:{category_id:31,name:"Digital Point Forums"},2031674:{category_id:31,name:"Mail Chimp"},2031675:{category_id:31,name:"Joomla!"},2031676:{category_id:31,name:"TypePad"},2031677:{category_id:31,name:"SEOmoz.org"},2031678:{category_id:31,name:"Google Groups",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},2031679:{category_id:31,name:"Webs"},2031680:{category_id:31,name:"Speedtest.net"},2097153:{category_id:32,name:"IGN"},2097154:{category_id:32,name:"Publishers Clearing House"},2097155:{category_id:32,name:"MiniClip"},2097156:{category_id:32,name:"888"},2097157:{category_id:32,name:"Xbox"},2097158:{category_id:32,name:"GameSpot"},2097159:{category_id:32,name:"Steam"},2097160:{category_id:32,name:"League of Legends"},2097161:{category_id:32,name:"GameFAQs"},2097162:{category_id:32,name:"Yahoo! Games",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2097163:{category_id:32,name:"William Hill Online"},2097164:{category_id:32,name:"Electronic Arts"},2097165:{category_id:32,name:"Betfair"},2097166:{category_id:32,name:"Wowhead"},2097167:{category_id:32,name:"World of PlayStation"},2097168:{category_id:32,name:"Kongregate"},2097169:{category_id:32,name:"Hattrick"},2097170:{category_id:32,name:"Roblox"},2097171:{category_id:32,name:"King"},2097172:{category_id:32,name:"Chess"},2097173:{category_id:32,name:"Ubi Soft Entertainment"},2097174:{category_id:32,name:"Minepedia"},2097175:{category_id:32,name:"Call of Duty"},2097176:{category_id:32,name:"Addictinggames"},2097177:{category_id:32,name:"MMO-Champion"},2097178:{category_id:32,name:"Bet at Home"},2097179:{category_id:32,name:"FreeLotto"},2097180:{category_id:32,name:"Square Enix"},2097181:{category_id:32,name:"PlayStation"},2097182:{category_id:32,name:"Travian"},2097183:{category_id:32,name:"MSN Gaming Zone",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/msn.com/favicon.ico"},2097184:{category_id:32,name:"Games"},2097185:{category_id:32,name:"Rockstar Games"},2097186:{category_id:32,name:"N4G"},2097187:{category_id:32,name:"Planet Minecraft"},2097188:{category_id:32,name:"Nvidia"},2097189:{category_id:32,name:"FreeOnlineGames"},2097190:{category_id:32,name:"Nintendo of America"},2097191:{category_id:32,name:"PopCap Games"},2097192:{category_id:32,name:"Game Trailers"},2097193:{category_id:32,name:"Covers"},2097194:{category_id:32,name:"California Lottery"},2097195:{category_id:32,name:"Team Liquid"},2097196:{category_id:32,name:"Eurogamer.net"},2097197:{category_id:32,name:"Party Casino"},2097198:{category_id:32,name:"Game Informer"},2097199:{category_id:32,name:"Penny Arcade"},2097200:{category_id:32,name:"GiantBomb"},2097201:{category_id:32,name:"GameHouse"},2097202:{category_id:32,name:"Curse"},2097203:{category_id:32,name:"Star Wars"},2097204:{category_id:32,name:"PC Gamer Online"},2097205:{category_id:32,name:"BoardGameGeek"},2097206:{category_id:32,name:"Bet365 Affiliates"},2097207:{category_id:32,name:"Bulbagarden / Bulbapedia"},2097208:{category_id:32,name:"OGame.org"},2097209:{category_id:32,name:"Space Federation"},2097210:{category_id:32,name:"Hasbro"},2097211:{category_id:32,name:"Enjin"},2097212:{category_id:32,name:"Perfect World Entertainment"},2097213:{category_id:32,name:"Ladbrokes"},2097214:{category_id:32,name:"Florida Lottery"},2097215:{category_id:32,name:"Paddy Power"},2097216:{category_id:32,name:"Shockwave"},2097217:{category_id:32,name:"Virtua Fighter 4"},2097218:{category_id:32,name:"Cheat Code Central"},2097219:{category_id:32,name:"Bukkit"},2097220:{category_id:32,name:"Oddschecker"},2097221:{category_id:32,name:"Xbox Media Center"},2097222:{category_id:32,name:"BioWare"},2097223:{category_id:32,name:"WoWWiki"},2097224:{category_id:32,name:"Games Radar US"},2097225:{category_id:32,name:"G4 TV"},2097226:{category_id:32,name:"JigZone"},2097227:{category_id:32,name:"Two Plus Two Publishing"},2097228:{category_id:32,name:"Win Every Game"},2097229:{category_id:32,name:"Zylom"},2097230:{category_id:32,name:"Station"},2097231:{category_id:32,name:"Blizzard.com"},2097232:{category_id:32,name:"Super Cheats"},2097233:{category_id:32,name:"TheSims3"},2097234:{category_id:32,name:"Computer and Video Games"},2097235:{category_id:32,name:"Xbox 360 Achievements"},2097236:{category_id:32,name:"Soccer Manager"},2097237:{category_id:32,name:"FreeGamePick"},2097238:{category_id:32,name:"Battlefield Play4Free"},2097239:{category_id:32,name:"The Trivia Portal"},2097240:{category_id:32,name:"VG247"},2097241:{category_id:32,name:"Affiliates United"},2097242:{category_id:32,name:"Stardock"},2097243:{category_id:32,name:"Gearbox Software"},2097244:{category_id:32,name:"sporcle"},2097245:{category_id:32,name:"Gamasutra"},2097246:{category_id:32,name:"Poker News"},2097247:{category_id:32,name:"Nexon America Inc."},21:{category_id:0,name:"Lava-Lava"},2162689:{category_id:33,name:"National Institutes of Health (NIH)"},2162690:{category_id:33,name:"WebMD"},2162691:{category_id:33,name:"PubMed"},2162692:{category_id:33,name:"MayoClinic"},2162693:{category_id:33,name:"Medicine Net"},2162694:{category_id:33,name:"Natural Health Information Articles and Health Newsletter by Dr. Joseph Mercola"},2162695:{category_id:33,name:"Drugs"},2162696:{category_id:33,name:"Mens Health"},2162697:{category_id:33,name:"MedlinePlus"},2162698:{category_id:33,name:"WeightWatchers"},2162699:{category_id:33,name:"Centers for Disease Control and Prevention"},2162700:{category_id:33,name:"Psychology Today"},2162701:{category_id:33,name:"Calorie Count"},2162702:{category_id:33,name:"AIDS Patent Database"},2162703:{category_id:33,name:"Dr. Batras"},2162704:{category_id:33,name:"Medscape"},2162705:{category_id:33,name:"nhs.uk"},2162706:{category_id:33,name:"Kaiser Permanente"},2162707:{category_id:33,name:"who.int"},2162708:{category_id:33,name:"Health Boards"},2162709:{category_id:33,name:"Health Media Ventures"},2162710:{category_id:33,name:"KidsHealth"},2162711:{category_id:33,name:"Food and Drug Administration"},2162712:{category_id:33,name:"Self Magazine"},2162713:{category_id:33,name:"Makeup Alley"},2162714:{category_id:33,name:"HealthCentral"},2162715:{category_id:33,name:"Prevention Magazine"},2162716:{category_id:33,name:"RealAge"},2162717:{category_id:33,name:"NetDoctor"},2162718:{category_id:33,name:"FEMA"},2162719:{category_id:33,name:"Fitness Magazine"},2162720:{category_id:33,name:"Vitals"},2162721:{category_id:33,name:"Total Beauty"},2162722:{category_id:33,name:"RxList"},2162723:{category_id:33,name:"British Medical Journal"},2162724:{category_id:33,name:"Steve Pavlina"},2162725:{category_id:33,name:"American Psychological Association"},2162726:{category_id:33,name:"MedcoHealth"},2162727:{category_id:33,name:"eMedTV Health Information"},2162728:{category_id:33,name:"American Cancer Society"},2162729:{category_id:33,name:"Self Nutrition Data"},2162730:{category_id:33,name:"Nuance Communications"},2162731:{category_id:33,name:"Tehran University of Medical Sciences"},2162732:{category_id:33,name:"Weil Lifestyle"},2162733:{category_id:33,name:"Wellness"},2162734:{category_id:33,name:"PatientUK"},2162735:{category_id:33,name:"National Cancer Institute"},2162736:{category_id:33,name:"24 Hour Fitness"},2162737:{category_id:33,name:"San Diego State University Graduate School of Public Health"},2162738:{category_id:33,name:"Telegraph Health"},2162739:{category_id:33,name:"Earth Clinic"},2162740:{category_id:33,name:"Mens Fitness"},2162741:{category_id:33,name:"Anthony Robbins"},2162742:{category_id:33,name:"Health Guru"},2162743:{category_id:33,name:"Cleveland Clinic"},2162744:{category_id:33,name:"BioMed Central"},2162745:{category_id:33,name:"Become Gorgeous"},2162746:{category_id:33,name:"The Student Doctor Network"},2162747:{category_id:33,name:"The New England Journal of Medicine"},2162748:{category_id:33,name:"American Diabetes Association"},2162749:{category_id:33,name:"Spine Health"},2162750:{category_id:33,name:"Social Anxiety Support"},2162751:{category_id:33,name:"Institute for Integrative Nutrition"},2162752:{category_id:33,name:"The Penis Exercise Forum"},2162753:{category_id:33,name:"3 Fat Chicks on a Diet!"},2162754:{category_id:33,name:"NaturallyCurly"},2162755:{category_id:33,name:"Allnurses"},2162756:{category_id:33,name:"Cure Zone"},2162757:{category_id:33,name:"DocCheck"},2162758:{category_id:33,name:"menshealth.co.uk"},2162759:{category_id:33,name:"Occupational Safety &amp; Health Administration"},2162760:{category_id:33,name:"Planned Parenthood Federation of America"},2162761:{category_id:33,name:"DrRobertRey"},2162762:{category_id:33,name:"Sutter Health"},2162763:{category_id:33,name:"My Home Remedies"},2162764:{category_id:33,name:"Lab Tests Online"},2162765:{category_id:33,name:"American Academy of Family Physicians"},2162766:{category_id:33,name:"American Medical Association"},2162767:{category_id:33,name:"Shiraz University of Medical Sciences"},2162768:{category_id:33,name:"PetMD"},2162769:{category_id:33,name:"Health and Safety Executive"},2162770:{category_id:33,name:"SCORE Counselors to Americas Small Business"},2162771:{category_id:33,name:"Laboratory Corporation of America"},2162772:{category_id:33,name:"Alzheimer s Association"},2162773:{category_id:33,name:"Isfahan University of Medical Sciences"},2162774:{category_id:33,name:"National Institute of Diabetes and Digestive and Kidney Diseases"},2162775:{category_id:33,name:"Celiac Disease and Gluten-Free Diet Support Center"},2162776:{category_id:33,name:"Best Health"},2162777:{category_id:33,name:"Hairfinder Hair Fashion Portal"},2162778:{category_id:33,name:"Medical News Daily"},2162779:{category_id:33,name:"UKhairdressers"},22:{category_id:0,name:"PaltalkScene"},2228225:{category_id:34,name:"eHow"},2228226:{category_id:34,name:"Yelp",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yelp.com/favicon.ico"},2228227:{category_id:34,name:"Groupon"},2228228:{category_id:34,name:"Engadget"},2228229:{category_id:34,name:"GSM Arena"},2228230:{category_id:34,name:"Allrecipes"},2228231:{category_id:34,name:"RetailMeNot"},2228232:{category_id:34,name:"CNET Reviews"},2228233:{category_id:34,name:"Coupons"},2228234:{category_id:34,name:"Gizmodo"},2228235:{category_id:34,name:"BabyCenter"},2228236:{category_id:34,name:"Yahoo! Shopping",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2228237:{category_id:34,name:"Nextag"},2228238:{category_id:34,name:"Toms Hardware Guide"},2228239:{category_id:34,name:"Yahoo Autos",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2228240:{category_id:34,name:"Digital Photography Review"},2228241:{category_id:34,name:"FixYa"},2228242:{category_id:34,name:"Instructables"},2228243:{category_id:34,name:"The Verge"},2228244:{category_id:34,name:"Shopping"},2228245:{category_id:34,name:"Better Business Bureau"},2228246:{category_id:34,name:"FatWallet"},2228247:{category_id:34,name:"CafeMom"},2228248:{category_id:34,name:"Internal Revenue Service"},2228249:{category_id:34,name:"The Motley Fool"},2228250:{category_id:34,name:"Edmunds"},2228251:{category_id:34,name:"bankrate"},2228252:{category_id:34,name:"Martha Stewart Living Omnimedia"},2228253:{category_id:34,name:"mobile9"},2228254:{category_id:34,name:"Kelley Blue Book"},2228255:{category_id:34,name:"Better Homes &amp; Gardens"},2228256:{category_id:34,name:"Consumer Reports Online"},2228257:{category_id:34,name:"Phone Arena"},2228258:{category_id:34,name:"Real Simple"},2228259:{category_id:34,name:"Apartment Therapy"},2228260:{category_id:34,name:"PriceGrabber"},2228261:{category_id:34,name:"Shopzilla"},2228262:{category_id:34,name:"Bureau of Consular Affairs"},2228263:{category_id:34,name:"Cooks"},2228264:{category_id:34,name:"Epinions"},2228265:{category_id:34,name:"bradsdeals"},2228266:{category_id:34,name:"MouthShut"},2228267:{category_id:34,name:"Blu-ray"},2228268:{category_id:34,name:"Epicurious"},2228269:{category_id:34,name:"Digital Trends"},2228270:{category_id:34,name:"Betty Crocker"},2228271:{category_id:34,name:"OpenDNS"},2228272:{category_id:34,name:"AOL Autos",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/aol.com/favicon.ico"},2228273:{category_id:34,name:"GardenWeb"},2228274:{category_id:34,name:"Ciao"},2228275:{category_id:34,name:"BGR"},2228276:{category_id:34,name:"Motor Trend Online"},2228277:{category_id:34,name:"Simply Recipes"},2228278:{category_id:34,name:"Rip-off Report"},2228279:{category_id:34,name:"Broadband Reports"},2228280:{category_id:34,name:"Kraft Foods Recipes"},2228281:{category_id:34,name:"Military"},2228282:{category_id:34,name:"Kaboodle"},2228283:{category_id:34,name:"DIY Network"},2228284:{category_id:34,name:"Apartment Therapys The Kitchn"},2228285:{category_id:34,name:"Parents"},2228286:{category_id:34,name:"The Pillsbury Company"},2228287:{category_id:34,name:"Care"},2228288:{category_id:34,name:"Ubergizmo"},2228289:{category_id:34,name:"EatingWell"},2228290:{category_id:34,name:"AVForums"},2228291:{category_id:34,name:"Cooking Light"},2228292:{category_id:34,name:"lifehack.org"},2228293:{category_id:34,name:"Carfax"},2228294:{category_id:34,name:"Social Security Administration"},2228295:{category_id:34,name:"Forums for the Chaotic Home"},2228296:{category_id:34,name:"This Old House Online"},2228297:{category_id:34,name:"ReviewCentre"},2228298:{category_id:34,name:"Kiplinger"},2228299:{category_id:34,name:"Coupon Mom"},2228300:{category_id:34,name:"Food &amp; Wine Online"},2228301:{category_id:34,name:"Jamie Oliver"},2228302:{category_id:34,name:"ConsumerSearch"},2228303:{category_id:34,name:"Geekologie"},2228304:{category_id:34,name:"Photography on the Net"},2228305:{category_id:34,name:"Medicare"},2228306:{category_id:34,name:"GasBuddy Organization Inc."},2228307:{category_id:34,name:"Complaints Board"},2228308:{category_id:34,name:"Good Housekeeping"},2228309:{category_id:34,name:"Pampers"},2228310:{category_id:34,name:"Southern Living Online"},2228311:{category_id:34,name:"Become"},2228312:{category_id:34,name:"Moms Who Think"},2228313:{category_id:34,name:"Mothering Magazine"},2228314:{category_id:34,name:"Think Baby Names"},2293761:{category_id:35,name:"Thesaurus"},2293762:{category_id:35,name:"Weebly"},2293763:{category_id:35,name:"ESPN Cricinfo"},2293764:{category_id:35,name:"Y8"},2293765:{category_id:35,name:"Universal Currency Converter"},2293766:{category_id:35,name:"Time and Date"},2293767:{category_id:35,name:"How Stuff Works"},2293768:{category_id:35,name:"Soccernet"},2293769:{category_id:35,name:"Reverso"},2293770:{category_id:35,name:"Stardoll"},2293771:{category_id:35,name:"000webhost"},2293772:{category_id:35,name:"Uefa"},2293773:{category_id:35,name:"The Toronto Star"},2293774:{category_id:35,name:"FIFA.com"},2293775:{category_id:35,name:"Girls Go Games"},2293776:{category_id:35,name:"Dynamic Drive DHTML Code Library"},2293777:{category_id:35,name:"Bureau of Meteorology"},2293778:{category_id:35,name:"ScienceDaily"},2293779:{category_id:35,name:"Manchester United Football Club"},2293780:{category_id:35,name:"Khan Academy"},2293781:{category_id:35,name:"Earthquake Information"},2293782:{category_id:35,name:"Barbie"},2293783:{category_id:35,name:"National Post"},2293784:{category_id:35,name:"WebDeveloper"},2293785:{category_id:35,name:"Starfall"},2293786:{category_id:35,name:"The Irish Times"},2293787:{category_id:35,name:"AOL Weather",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/aol.com/favicon.ico"},2293788:{category_id:35,name:"History Channel"},2293789:{category_id:35,name:"Honda Motor Co."},2293790:{category_id:35,name:"Space"},2293791:{category_id:35,name:"The Dilbert Zone"},2293792:{category_id:35,name:"Free Website Builder"},2293793:{category_id:35,name:"Warner Bros. Online"},2293794:{category_id:35,name:"Neopets"},2293795:{category_id:35,name:"USA.gov"},2293796:{category_id:35,name:"US Courts"},2293797:{category_id:35,name:"Popular Science"},2293798:{category_id:35,name:"Webopedia"},2293799:{category_id:35,name:"The Student Room"},2293800:{category_id:35,name:"Gaia Interactive"},2293801:{category_id:35,name:"Encyclopaedia Britannica Online"},2293802:{category_id:35,name:"New Scientist"},2293803:{category_id:35,name:"HTML Goodies"},2293804:{category_id:35,name:"Biography"},2293805:{category_id:35,name:"Maths Is Fun"},2293806:{category_id:35,name:"Archives"},2293807:{category_id:35,name:"Jet Propulsion Laboratory"},2293808:{category_id:35,name:"CBS.Sports"},2293809:{category_id:35,name:"Physics Forums"},2293810:{category_id:35,name:"National Portal of India"},2293811:{category_id:35,name:"ThinkQuest"},2293812:{category_id:35,name:"SpongeBob SquarePants at Nick"},2293813:{category_id:35,name:"Animal Planet Channel Online"},2293814:{category_id:35,name:"Funbrain"},2293815:{category_id:35,name:"StarWars"},2293816:{category_id:35,name:"Enchanted Learning"},2293817:{category_id:35,name:"GameSpy"},2293818:{category_id:35,name:"Spelling City"},2293819:{category_id:35,name:"Pokemon"},2293820:{category_id:35,name:"The Holy See"},2293821:{category_id:35,name:"Fupa Games"},2293822:{category_id:35,name:"Gameloft"},23:{category_id:0,name:"UcTalk"},2359297:{category_id:36,name:"Yahoo News",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2359298:{category_id:36,name:"The Huffington Post",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/huffingtonpost.com/favicon.ico"},2359299:{category_id:36,name:"New York Times"},2359300:{category_id:36,name:"Google News",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},2359301:{category_id:36,name:"Reddit",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/reddit.com/favicon.ico"},2359302:{category_id:36,name:"The Guardian"},2359303:{category_id:36,name:"The Times of India"},2359304:{category_id:36,name:"Washington Post"},2359305:{category_id:36,name:"Drudge Report"},2359306:{category_id:36,name:"USA Today"},2359307:{category_id:36,name:"Examiner"},2359308:{category_id:36,name:"AccuWeather"},2359309:{category_id:36,name:"Los Angeles Times"},2359310:{category_id:36,name:"Time Magazine"},2359311:{category_id:36,name:"Weather Underground"},2359312:{category_id:36,name:"News.au"},2359313:{category_id:36,name:"The Sydney Morning Herald"},2359314:{category_id:36,name:"Yahoo Weather",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2359315:{category_id:36,name:"Al Arabiya News Channel"},2359316:{category_id:36,name:"Breitbart"},2359317:{category_id:36,name:"San Francisco Chronicle"},2359318:{category_id:36,name:"National Geographic"},2359319:{category_id:36,name:"HindustanTimes"},2359320:{category_id:36,name:"NewsMax"},2359321:{category_id:36,name:"Topix"},2359322:{category_id:36,name:"Chicago Tribune"},2359323:{category_id:36,name:"Houston Chronicle"},2359324:{category_id:36,name:"PRWeb"},2359325:{category_id:36,name:"The Globe and Mail"},2359326:{category_id:36,name:"The Age"},2359327:{category_id:36,name:"Christian Science Monitor"},2359328:{category_id:36,name:"New Jersey Online"},2359329:{category_id:36,name:"WorldNetDaily"},2359330:{category_id:36,name:"Navbharat Times"},2359331:{category_id:36,name:"Washington Times"},2359332:{category_id:36,name:"Eenadu"},2359333:{category_id:36,name:"The Associated Press"},2359334:{category_id:36,name:"Digital Spy"},2359335:{category_id:36,name:"bdnews24"},2359336:{category_id:36,name:"U.S. News &amp; World Report"},2359337:{category_id:36,name:"Yr.no"},2359338:{category_id:36,name:"The Onion"},2359339:{category_id:36,name:"Metafilter"},2359340:{category_id:36,name:"Sky News"},2359341:{category_id:36,name:"The Hill"},2359342:{category_id:36,name:"The Examiner"},2359343:{category_id:36,name:"Philly"},2359344:{category_id:36,name:"The Indian Express"},2359345:{category_id:36,name:"National Review Online"},2359346:{category_id:36,name:"DNA"},2359347:{category_id:36,name:"Malayala Manorama"},2359348:{category_id:36,name:"DailyFinance"},2359349:{category_id:36,name:"France 24"},2359350:{category_id:36,name:"Fark"},2359351:{category_id:36,name:"Intellicast"},2359352:{category_id:36,name:"NewsNow"},2359353:{category_id:36,name:"The Denver Post"},2359354:{category_id:36,name:"PR Newswire"},2359355:{category_id:36,name:"Chicago Sun-Times"},2359356:{category_id:36,name:"The Atlanta Journal-Constitution"},2359357:{category_id:36,name:"Herald Sun"},2359358:{category_id:36,name:"The Australian"},2359359:{category_id:36,name:"The Arizona Republic"},2359360:{category_id:36,name:"Detroit Free Press"},2359361:{category_id:36,name:"Mathrubhumi Daily"},2359362:{category_id:36,name:"San Jose Mercury News"},2359363:{category_id:36,name:"Newsday"},2359364:{category_id:36,name:"Vancouver Province"},2359365:{category_id:36,name:"Star Tribune"},24:{category_id:0,name:"WinpopupX"},2424833:{category_id:37,name:"Booking"},2424834:{category_id:37,name:"TripAdvisor"},2424835:{category_id:37,name:"9Gag"},2424836:{category_id:37,name:"Agoda"},2424837:{category_id:37,name:"Expedia"},2424838:{category_id:37,name:"Southwest"},2424839:{category_id:37,name:"Priceline"},2424840:{category_id:37,name:"CRACKED"},2424841:{category_id:37,name:"Kayak"},2424842:{category_id:37,name:"United Airlines"},2424843:{category_id:37,name:"Delta Air Lines"},2424844:{category_id:37,name:"American Airlines"},2424845:{category_id:37,name:"Lonely Planet"},2424846:{category_id:37,name:"Orbitz"},2424847:{category_id:37,name:"Travelocity"},2424848:{category_id:37,name:"Marriott International"},2424849:{category_id:37,name:"Ryanair"},2424850:{category_id:37,name:"Hilton"},2424851:{category_id:37,name:"EasyJet"},2424852:{category_id:37,name:"Yahoo! Travel",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2424853:{category_id:37,name:"Autoblog"},2424854:{category_id:37,name:"CouchSurfing"},2424855:{category_id:37,name:"British Airways"},2424856:{category_id:37,name:"Hotwire"},2424857:{category_id:37,name:"Emirates"},2424858:{category_id:37,name:"Lufthansa"},2424859:{category_id:37,name:"CollegeHumor"},2424860:{category_id:37,name:"Travelzoo"},2424861:{category_id:37,name:"Japan Airlines"},2424862:{category_id:37,name:"Ford Motor Company"},2424863:{category_id:37,name:"Open Table"},2424864:{category_id:37,name:"Wikitravel"},2424865:{category_id:37,name:"Time Out"},2424866:{category_id:37,name:"Metropolitan Transportation Authority"},2424867:{category_id:37,name:"US Airways"},2424868:{category_id:37,name:"Vacation Rentals by Owner"},2424869:{category_id:37,name:"LanChile"},2424870:{category_id:37,name:"KLM Royal Dutch Airlines"},2424871:{category_id:37,name:"Petfinder"},2424872:{category_id:37,name:"Accorhotels"},2424873:{category_id:37,name:"Library of Congress"},2424874:{category_id:37,name:"Venere"},2424875:{category_id:37,name:"SkyScanner"},2424876:{category_id:37,name:"Hyatt Hotels and Resorts"},2424877:{category_id:37,name:"Geocaching"},2424878:{category_id:37,name:"Aero Berlin"},2424879:{category_id:37,name:"Virgin Atlantic Airlines"},2424880:{category_id:37,name:"Airliners.net"},2424881:{category_id:37,name:"HomeAway Vacation Rentals Worldwide"},2424882:{category_id:37,name:"Jalopnik"},2424883:{category_id:37,name:"Turkish Airlines"},2424884:{category_id:37,name:"NetCarShow"},2424885:{category_id:37,name:"Qatar Airways"},2424886:{category_id:37,name:"Hostelworld"},2424887:{category_id:37,name:"The Straight Dope by Cecil Adams"},2424888:{category_id:37,name:"Flightradar24"},2424889:{category_id:37,name:"HRS Hotel Reservation Service"},2424890:{category_id:37,name:"Hostelbookers"},2424891:{category_id:37,name:"Qantas Airways"},2424892:{category_id:37,name:"Alaska Airlines"},2424893:{category_id:37,name:"Restaurant"},2424894:{category_id:37,name:"Car and Driver"},2424895:{category_id:37,name:"VirtualTourist"},2424896:{category_id:37,name:"Air Canada"},2424897:{category_id:37,name:"Expedia.ca"},2424898:{category_id:37,name:"Volvo Car Corporation"},2424899:{category_id:37,name:"Late Rooms"},2424900:{category_id:37,name:"Intercontinental Hotels Group"},2424901:{category_id:37,name:"Saudi Arabian Airlines"},2424902:{category_id:37,name:"Top Gear"},2424903:{category_id:37,name:"Porsche"},2424904:{category_id:37,name:"Crave Online"},2424905:{category_id:37,name:"Cathay Pacific Airways"},2424906:{category_id:37,name:"Cebu Pacific Air"},2424907:{category_id:37,name:"Iberia"},2424908:{category_id:37,name:"Cheap Tickets"},2424909:{category_id:37,name:"Florida Department of Transportation"},2424910:{category_id:37,name:"Cheap Flights"},2424911:{category_id:37,name:"AR15"},2424912:{category_id:37,name:"Frommers"},2424913:{category_id:37,name:"Fodors Travel Online"},2424914:{category_id:37,name:"AirTran Airways"},2424915:{category_id:37,name:"Popular Mechanics"},2424916:{category_id:37,name:"AeroMexico"},2424917:{category_id:37,name:"Carnival Cruise Lines"},2424918:{category_id:37,name:"Honda Cars"},2424919:{category_id:37,name:"Aeroflot"},2424920:{category_id:37,name:"Travel and Leisure Magazine"},2490369:{category_id:38,name:"Yahoo! Answers",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2490370:{category_id:38,name:"WikiAnswers"},2490371:{category_id:38,name:"WordReference"},2490372:{category_id:38,name:"The Free Dictionary"},2490373:{category_id:38,name:"Goodreads"},2490374:{category_id:38,name:"LEO English-German Dictionary"},2490375:{category_id:38,name:"World Wide Web Consortium"},2490376:{category_id:38,name:"MapQuest"},2490377:{category_id:38,name:"YELLOWPAGES"},2490378:{category_id:38,name:"Dict.cc"},2490379:{category_id:38,name:"WhitePages"},2490380:{category_id:38,name:"Blackboard"},2490381:{category_id:38,name:"Massachusetts Institute of Technology"},2490382:{category_id:38,name:"Stanford University"},2490383:{category_id:38,name:"JustAnswer"},2490384:{category_id:38,name:"BrainyQuote"},2490385:{category_id:38,name:"Harvard University"},2490386:{category_id:38,name:"Investopedia"},2490387:{category_id:38,name:"Lumosity"},2490388:{category_id:38,name:"eCollege"},2490389:{category_id:38,name:"University of California"},2490390:{category_id:38,name:"SuperPages"},2490391:{category_id:38,name:"Sulekha Yellow Pages India"},2490392:{category_id:38,name:"University of Phoenix"},2490393:{category_id:38,name:"MyLife"},2490394:{category_id:38,name:"wiseGEEK"},2490395:{category_id:38,name:"The University of Michigan"},2490396:{category_id:38,name:"Cornell University"},2490397:{category_id:38,name:"The University of Texas at Austin"},2490398:{category_id:38,name:"The Pennsylvania State University"},2490399:{category_id:38,name:"GMT"},2490400:{category_id:38,
name:"U. S. Department of Education"},2490401:{category_id:38,name:"Wikiquote"},2490402:{category_id:38,name:"yourDictionary"},2490403:{category_id:38,name:"University of Washington"},2490404:{category_id:38,name:"Cambridge University Press"},2490405:{category_id:38,name:"192"},2490406:{category_id:38,name:"Columbia University"},2490407:{category_id:38,name:"Purdue University"},2490408:{category_id:38,name:"University of Wisconsin-Madison"},2490409:{category_id:38,name:"Elsevier"},2490410:{category_id:38,name:"YellowPages.ca"},2490411:{category_id:38,name:"University of Pennsylvania"},2490412:{category_id:38,name:"Yahoo! Maps and Driving Directions.",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2490413:{category_id:38,name:"Spanish Dictionary"},2490414:{category_id:38,name:"The City University of New York (CUNY)"},2490415:{category_id:38,name:"Coursera"},2490416:{category_id:38,name:"Mappy"},2490417:{category_id:38,name:"New York University"},2490418:{category_id:38,name:"Listal"},2490419:{category_id:38,name:"Experts Exchange"},2490420:{category_id:38,name:"Collegeboard.org"},2490421:{category_id:38,name:"University of Tehran"},2490422:{category_id:38,name:"Yale University"},2490423:{category_id:38,name:"ThinkExist"},2490424:{category_id:38,name:"AllExperts Questions &amp; Answers"},2490425:{category_id:38,name:"WorldCat"},2490426:{category_id:38,name:"University of Florida"},2490427:{category_id:38,name:"Princeton University"},2490428:{category_id:38,name:"Shabdkosh"},2490429:{category_id:38,name:"University of Toronto"},2490430:{category_id:38,name:"University of Cambridge"},2490431:{category_id:38,name:"Maps of World"},2490432:{category_id:38,name:"Michigan State University"},2490433:{category_id:38,name:"RateMyProfessors"},2490434:{category_id:38,name:"K12"},2490435:{category_id:38,name:"Cambridge Dictionary"},2490436:{category_id:38,name:"USP"},2490437:{category_id:38,name:"The Open University"},2490438:{category_id:38,name:"Carnegie Mellon University"},2490439:{category_id:38,name:"Educational Testing Service (ETS)"},2490440:{category_id:38,name:"University of Oxford"},2490441:{category_id:38,name:"University of North Carolina at Chapel Hill"},2490442:{category_id:38,name:"University of Southern California"},2490443:{category_id:38,name:"Moodle"},2490444:{category_id:38,name:"Arizona State University"},2490445:{category_id:38,name:"The University of Arizona"},2490446:{category_id:38,name:"University of Virginia"},2490447:{category_id:38,name:"Chronicle of Higher Education"},25:{category_id:0,name:"BeeTalk"},2555905:{category_id:39,name:"Google India",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},2555906:{category_id:39,name:"Google UK",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},2555907:{category_id:39,name:"Amazon.co.jp",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/amazon.com/favicon.ico"},2555908:{category_id:39,name:"Amazon.co.uk",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/amazon.com/favicon.ico"},2555909:{category_id:39,name:"Google Australia",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},2555910:{category_id:39,name:"eBay UK",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/ebay.com/favicon.ico"},2555911:{category_id:39,name:"The Daily Mail"},2555912:{category_id:39,name:"Indiatimes"},2555913:{category_id:39,name:"Wal-Mart Online"},2555914:{category_id:39,name:"Yahoo! India",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2555915:{category_id:39,name:"Best Buy Co."},2555916:{category_id:39,name:"Bet365"},2555917:{category_id:39,name:"CNN",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/cnn.com/favicon.ico"},2555918:{category_id:39,name:"United States Postal Service (USPS)"},2555919:{category_id:39,name:"eBay India",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/ebay.com/favicon.ico"},2555920:{category_id:39,name:"eBay.au",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/ebay.com/favicon.ico"},2555921:{category_id:39,name:"Indian Railway Catering and Tourism Corporation"},2555922:{category_id:39,name:"Yahoo UK and Ireland",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2555923:{category_id:39,name:"POLITICO"},2555924:{category_id:39,name:"Naukri"},2555925:{category_id:39,name:"The Home Depot"},2555926:{category_id:39,name:"Macys"},2555927:{category_id:39,name:"Zhaopin"},2555928:{category_id:39,name:"Road Runner"},2555929:{category_id:39,name:"Kijiji"},2555930:{category_id:39,name:"Yahoo India News Services",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2555931:{category_id:39,name:"Maktoob"},2555932:{category_id:39,name:"RealClear Politics"},2555933:{category_id:39,name:"IBM Corporation"},2555934:{category_id:39,name:"OneIndia.in"},2555935:{category_id:39,name:"National Oceanic and Atmospheric Administration (NOAA)"},2555936:{category_id:39,name:"Government of Canada"},2555937:{category_id:39,name:"Google News India",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},2555938:{category_id:39,name:"IBN Live"},2555939:{category_id:39,name:"Toys R Us"},2555940:{category_id:39,name:"MoneyControl"},2555941:{category_id:39,name:"State of California"},2555942:{category_id:39,name:"New York Daily News"},2555943:{category_id:39,name:"Google NewZealand",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},2555944:{category_id:39,name:"NHK"},2555945:{category_id:39,name:"MSN UK",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/msn.com/favicon.ico"},2555946:{category_id:39,name:"Official Major League Baseball"},2555947:{category_id:39,name:"Slate Magazine"},2555948:{category_id:39,name:"Nordstrom"},2555949:{category_id:39,name:"craigslist",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/craigslist.com/favicon.ico"},2555950:{category_id:39,name:"Trulia"},26:{category_id:0,name:"Squiggle"},2621441:{category_id:40,name:"Yahoo! Japan",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2621442:{category_id:40,name:"TED"},2621443:{category_id:40,name:"ScienceDirect"},2621444:{category_id:40,name:"United States Geological Survey (USGS)"},2621445:{category_id:40,name:"Care2"},2621446:{category_id:40,name:"Nature"},2621447:{category_id:40,name:"Japan Meteorological Agency"},2621448:{category_id:40,name:"IEEE"},2621449:{category_id:40,name:"U.S. Department of Agriculture"},262145:{category_id:4,name:"Windows Media Player"},2621450:{category_id:40,name:"JSTOR"},2621451:{category_id:40,name:"RedOrbit"},2621452:{category_id:40,name:"Scientific American"},2621453:{category_id:40,name:"Foreign Policy"},2621454:{category_id:40,name:"LiveScience"},2621455:{category_id:40,name:"National Park Service"},2621456:{category_id:40,name:"Mother Nature Network"},2621457:{category_id:40,name:"US Census Bureau"},2621458:{category_id:40,name:"Bureau of Labor Statistics"},2621459:{category_id:40,name:"Met Office"},262146:{category_id:4,name:"RealPlayer"},2621460:{category_id:40,name:"Environmental Protection Agency"},2621461:{category_id:40,name:"Technology Review"},2621462:{category_id:40,name:"National Geographic News"},2621463:{category_id:40,name:"University of Colorado at Boulder"},2621464:{category_id:40,name:"Wolfram Research"},2621465:{category_id:40,name:"Metric Conversions"},2621466:{category_id:40,name:"Head-Fi"},2621467:{category_id:40,name:"Online Conversion"},2621468:{category_id:40,name:"American Chemical Society"},2621469:{category_id:40,name:"ResearchGATE"},262147:{category_id:4,name:"Winamp"},2621470:{category_id:40,name:"Food and Agriculture Organization (FAO)"},2621471:{category_id:40,name:"Science Magazine"},2621472:{category_id:40,name:"The MathWorks"},2621473:{category_id:40,name:"Azteca Systems Cityworks"},2621474:{category_id:40,name:"arXiv.org e-Print Archive"},2621475:{category_id:40,name:"Gramota.ru"},2621476:{category_id:40,name:"Hydrometeorological Prediction Center"},2621477:{category_id:40,name:"Discover Magazine"},2621478:{category_id:40,name:"italki"},2621479:{category_id:40,name:"arabic keyboard"},262148:{category_id:4,name:"QuickTime"},2621480:{category_id:40,name:"Coolmath"},2621481:{category_id:40,name:"Alldatasheet"},2621482:{category_id:40,name:"Nikon Corporation (Global)"},2621483:{category_id:40,name:"GeoNames"},2621484:{category_id:40,name:"Connexor Parsers"},2621485:{category_id:40,name:"National Institute for Statistics and Economic Studies"},2621486:{category_id:40,name:"Indian Institute of Technology"},2621487:{category_id:40,name:"NIST. National Institute of Standards and Technology"},2621488:{category_id:40,name:"Social Science Research Network"},2621489:{category_id:40,name:"Behind the Name"},262149:{category_id:4,name:"Weather Channel"},2621490:{category_id:40,name:"SpaceWeather"},2621491:{category_id:40,name:"LyngSat"},2621492:{category_id:40,name:"Botanical"},2621493:{category_id:40,name:"Grist Magazine"},2621494:{category_id:40,name:"Blue Letter Bible"},2621495:{category_id:40,name:"European Southern Observatory (ESO)"},2621496:{category_id:40,name:"ScienceBlogs"},2621497:{category_id:40,name:"Iranian Seismological Center"},2621498:{category_id:40,name:"EurekAlert!"},2621499:{category_id:40,name:"IBGE"},262150:{category_id:4,name:"PPTV (PPLive)"},2621500:{category_id:40,name:"Environmental Graffiti"},2621501:{category_id:40,name:"University of Missouri"},2621502:{category_id:40,name:"About Psychology"},2621503:{category_id:40,name:"MathWorld"},262151:{category_id:4,name:"QQLive"},262152:{category_id:4,name:"LOVEFiLM"},262153:{category_id:4,name:"ITV"},262154:{category_id:4,name:"iTunes",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},262155:{category_id:4,name:"Adobe Flash"},262156:{category_id:4,name:"Channel 5"},262157:{category_id:4,name:"iQIYI/PPS"},262158:{category_id:4,name:"Headweb"},262159:{category_id:4,name:"Viaplay"},262160:{category_id:4,name:"KKBox"},262161:{category_id:4,name:"WATCHEVER"},262162:{category_id:4,name:"Maxdome"},262163:{category_id:4,name:"Twitch.tv"},262164:{category_id:4,name:"TED"},262165:{category_id:4,name:"RTP"},262166:{category_id:4,name:"SBS"},262167:{category_id:4,name:"UUSee"},262168:{category_id:4,name:"SopCast"},262169:{category_id:4,name:"KeyHoleTV"},262170:{category_id:4,name:"Sina Video"},262171:{category_id:4,name:"Metacafe"},262172:{category_id:4,name:"Wuaki.tv"},262173:{category_id:4,name:"SHOUTcast"},262174:{category_id:4,name:"BBC-iplayer"},262175:{category_id:4,name:"Live365"},262176:{category_id:4,name:"Dailymotion"},262177:{category_id:4,name:"Filmin"},262178:{category_id:4,name:"Flixster"},262179:{category_id:4,name:"Hulu"},262181:{category_id:4,name:"NUBEOX"},262182:{category_id:4,name:"Kugou"},262183:{category_id:4,name:"MoveNetworks"},262184:{category_id:4,name:"Babelgum"},262185:{category_id:4,name:"Livestation"},262186:{category_id:4,name:"iTunes Radio"},262187:{category_id:4,name:"Miro"},262188:{category_id:4,name:"Smithsonian Channel"},262189:{category_id:4,name:"NHL"},262190:{category_id:4,name:"NicoNicoDouga"},262191:{category_id:4,name:"Ooyala"},262192:{category_id:4,name:"Photobucket"},262193:{category_id:4,name:"MLSsoccer"},262194:{category_id:4,name:"Channel 4"},262195:{category_id:4,name:"VideoDetective"},262196:{category_id:4,name:"Ustream.tv"},262197:{category_id:4,name:"Veetle"},262198:{category_id:4,name:"VeohTV"},262199:{category_id:4,name:"iTunes Festival"},262200:{category_id:4,name:"SiriusXM"},262201:{category_id:4,name:"Break.com"},262202:{category_id:4,name:"CinemaNow"},262203:{category_id:4,name:"Letv"},262204:{category_id:4,name:"RTSP"},262205:{category_id:4,name:"Funshion"},262207:{category_id:4,name:"MTV.com"},262208:{category_id:4,name:"Sohu TV"},262209:{category_id:4,name:"MP4"},262210:{category_id:4,name:"MMS/WMSP"},262211:{category_id:4,name:"FLV"},262212:{category_id:4,name:"PIPI"},262213:{category_id:4,name:"Hulkshare"},262214:{category_id:4,name:"Tudou"},262215:{category_id:4,name:"Ifeng Video "},262216:{category_id:4,name:"WSJ Live"},262217:{category_id:4,name:"Cradio"},262218:{category_id:4,name:"Roku"},262219:{category_id:4,name:"Amazon Prime Music",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/amazon.com/favicon.ico"},262220:{category_id:4,name:"Crackle"},262221:{category_id:4,name:"Blip.tv"},262223:{category_id:4,name:"Audible"},262224:{category_id:4,name:"Web Streaming"},262226:{category_id:4,name:"Vyclone"},262227:{category_id:4,name:"China Streaming Video"},262228:{category_id:4,name:"Crunchyroll"},262229:{category_id:4,name:"EmpFlix"},262230:{category_id:4,name:"Porn.com"},262231:{category_id:4,name:"EskimoTube"},262232:{category_id:4,name:"NewBigTube"},262233:{category_id:4,name:"Madbitties"},262234:{category_id:4,name:"RTMP"},262235:{category_id:4,name:"Hustlertube"},262236:{category_id:4,name:"TnaFlix"},262237:{category_id:4,name:"Xtube"},262238:{category_id:4,name:"Yobt.tv"},262239:{category_id:4,name:"Youjizz"},262245:{category_id:4,name:"Pandora"},262246:{category_id:4,name:"Deezer"},262247:{category_id:4,name:"VLC"},262250:{category_id:4,name:"Livesearch.tv/CoolStreaming"},262251:{category_id:4,name:"Qello"},262252:{category_id:4,name:"CNTV"},262254:{category_id:4,name:"Thunderkankan"},262256:{category_id:4,name:"Youtube",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/youtube.com/favicon.ico"},262258:{category_id:4,name:"56.com"},262259:{category_id:4,name:"RMVB"},262260:{category_id:4,name:"Youku.com"},262261:{category_id:4,name:"SWF"},262262:{category_id:4,name:"AVI"},262263:{category_id:4,name:"MP3"},262264:{category_id:4,name:"WMA"},262265:{category_id:4,name:"MOV"},262266:{category_id:4,name:"WMV"},262267:{category_id:4,name:"ASF"},262268:{category_id:4,name:"Vudu"},262270:{category_id:4,name:"PBS Video"},262271:{category_id:4,name:"Freecast"},262272:{category_id:4,name:"Ku6"},262274:{category_id:4,name:"Spotify"},262275:{category_id:4,name:"LastFM"},262276:{category_id:4,name:"Netflix",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/netflix.com/favicon.ico"},262277:{category_id:4,name:"Uitzendinggemist"},262278:{category_id:4,name:"RTL.nl"},262279:{category_id:4,name:"TudouVa"},262280:{category_id:4,name:"GYAO"},262281:{category_id:4,name:"BARKS"},262283:{category_id:4,name:"Baofeng"},262284:{category_id:4,name:"Qvod/Bobohu"},262285:{category_id:4,name:"Grooveshark"},262286:{category_id:4,name:"Microsoft Silverlight",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},262287:{category_id:4,name:"6.cn"},262288:{category_id:4,name:"Rhapsody"},262290:{category_id:4,name:"Imgo TV"},262291:{category_id:4,name:"Joy.cn"},262292:{category_id:4,name:"Yinyuetai"},262293:{category_id:4,name:"Hichannel"},262294:{category_id:4,name:"ADNstream"},262295:{category_id:4,name:"Livestream"},262296:{category_id:4,name:"YoukuVa "},262298:{category_id:4,name:"Voddler"},262301:{category_id:4,name:"Flixwagon"},262302:{category_id:4,name:"M4V"},262303:{category_id:4,name:"Podcast"},262305:{category_id:4,name:"Shazam"},262306:{category_id:4,name:"TuneIn"},262308:{category_id:4,name:"BaiduMusic"},262310:{category_id:4,name:"DoubanFM"},262311:{category_id:4,name:"IMDb.com",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/imdb.com/favicon.ico"},262312:{category_id:4,name:"XVideos.com"},262313:{category_id:4,name:"xHamster.com"},262314:{category_id:4,name:"PornHub.com"},262315:{category_id:4,name:"LiveJasmin.com"},262316:{category_id:4,name:"XNXX.com"},262317:{category_id:4,name:"YouPorn.com"},262318:{category_id:4,name:"MajorLeagueGaming"},262319:{category_id:4,name:"Wowtv.co.kr"},262320:{category_id:4,name:"iMBC"},262321:{category_id:4,name:"AfreecaTV"},262322:{category_id:4,name:"Arirang"},262323:{category_id:4,name:"KCTVjeju"},262324:{category_id:4,name:"CJB.co.kr"},262325:{category_id:4,name:"MBN"},262326:{category_id:4,name:"MYSolive"},262327:{category_id:4,name:"KBS"},262328:{category_id:4,name:"Mwave"},262329:{category_id:4,name:"YTN"},262330:{category_id:4,name:"Musicsoda"},262331:{category_id:4,name:"FreeOnes.com"},262332:{category_id:4,name:"Streamate.com"},262333:{category_id:4,name:"Airplay"},262334:{category_id:4,name:"DAAP"},262335:{category_id:4,name:"M1905"},262336:{category_id:4,name:"VEVO"},262337:{category_id:4,name:"Amazon Instant Video",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/amazon.com/favicon.ico"},262338:{category_id:4,name:"MixBit"},262339:{category_id:4,name:"Baomihua"},262340:{category_id:4,name:"FORA.tv"},262341:{category_id:4,name:"Vimeo"},262342:{category_id:4,name:"Vube"},262343:{category_id:4,name:"RedTube.com"},262344:{category_id:4,name:"Tube8"},262345:{category_id:4,name:"Mgoon"},262346:{category_id:4,name:"Trailers"},262347:{category_id:4,name:"HBOGO"},262348:{category_id:4,name:"MLB.com"},262349:{category_id:4,name:"Kaltura.com"},2686977:{category_id:41,name:"eBay",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/ebay.com/favicon.ico"},2686978:{category_id:41,name:"IKEA"},2686979:{category_id:41,name:"NewEgg"},2686980:{category_id:41,name:"Multiply"},2686981:{category_id:41,name:"Gap"},2686982:{category_id:41,name:"LivingSocial"},2686983:{category_id:41,name:"Kohls"},2686984:{category_id:41,name:"Zappos"},2686985:{category_id:41,name:"BodyBuilding"},2686986:{category_id:41,name:"Overstock"},2686987:{category_id:41,name:"Barnes and Noble"},2686988:{category_id:41,name:"Lowes"},2686989:{category_id:41,name:"JCPenney"},2686990:{category_id:41,name:"Shutterfly"},2686991:{category_id:41,name:"QVC"},2686992:{category_id:41,name:"Legacy"},2686993:{category_id:41,name:"Staples"},2686994:{category_id:41,name:"Nike"},2686995:{category_id:41,name:"B&H Photo Video"},2686996:{category_id:41,name:"Ticketmaster USA"},2686997:{category_id:41,name:"Walgreens"},2686998:{category_id:41,name:"TigerDirect"},2686999:{category_id:41,name:"Victorias Secret"},2687000:{category_id:41,name:"Pixmania"},2687001:{category_id:41,name:"GameStop"},2687002:{category_id:41,name:"Buy"},2687003:{category_id:41,name:"Trade Me"},2687004:{category_id:41,name:"AutoTrader"},2687005:{category_id:41,name:"Home Shopping Network"},2687006:{category_id:41,name:"Sams Club"},2687007:{category_id:41,name:"Bed"},2687008:{category_id:41,name:"CafePress"},2687009:{category_id:41,name:"Souq"},2687010:{category_id:41,name:"6pm"},2687011:{category_id:41,name:"CVS/pharmacy Online CVS"},2687012:{category_id:41,name:"cars"},2687013:{category_id:41,name:"Sephora"},2687014:{category_id:41,name:"Cabelas"},2687015:{category_id:41,name:"Forever 21"},2687016:{category_id:41,name:"Lands End"},2687017:{category_id:41,name:"John Wiley and Sons"},2687018:{category_id:41,name:"Play"},2687019:{category_id:41,name:"Drugstore"},2687020:{category_id:41,name:"Blockbuster"},2687021:{category_id:41,name:"M and S Gifts"},2687022:{category_id:41,name:"Neiman Marcus"},2687023:{category_id:41,name:"Office Depot"},2687024:{category_id:41,name:"CD Universe"},2687025:{category_id:41,name:"Shopbop"},2687026:{category_id:41,name:"Recreational Equipment Incorporated"},2687027:{category_id:41,name:"StubHub"},2687028:{category_id:41,name:"JCrew"},2687029:{category_id:41,name:"NET-A-PORTER.COM"},2687030:{category_id:41,name:"iHerb"},2687031:{category_id:41,name:"Frys"},2687032:{category_id:41,name:"Focalprice"},2687033:{category_id:41,name:"L.L.Bean"},2687034:{category_id:41,name:"Saks Fifth Avenue"},2687035:{category_id:41,name:"Bloomingdales"},2687036:{category_id:41,name:"Vitacost"},2687037:{category_id:41,name:"Yoox"},2687038:{category_id:41,name:"Pottery Barn"},2687039:{category_id:41,name:"Urban Outfitters"},2687040:{category_id:41,name:"American Eagle Outfitters"},2687041:{category_id:41,name:"Disney Store"},2687042:{category_id:41,name:"Scholastic Corporation"},2687043:{category_id:41,name:"Sierra Trading Post"},2687044:{category_id:41,name:"Redbubble"},2687045:{category_id:41,name:"ModCloth Indie Clothing"},2687046:{category_id:41,name:"Future Shop"},2687047:{category_id:41,name:"Musicians Friend"},2687048:{category_id:41,name:"Advanced Book Exchange"},2687049:{category_id:41,name:"Joann"},2687050:{category_id:41,name:"GameFly"},2687051:{category_id:41,name:"Dicks Sporting Goods"},2687052:{category_id:41,name:"Harbor Freight"},2687053:{category_id:41,name:"Ralph Lauren"},2687054:{category_id:41,name:"OfficeMax"},2687055:{category_id:41,name:"Snapfish"},2687056:{category_id:41,name:"PetSmart"},2752513:{category_id:42,name:"SiteAdvisor"},2752514:{category_id:42,name:"Yahoo! Shine",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2752515:{category_id:42,name:"Match"},2752516:{category_id:42,name:"Ancestry"},2752517:{category_id:42,name:"Digg"},2752518:{category_id:42,name:"Sulekha"},2752519:{category_id:42,name:"Europa"},2752520:{category_id:42,name:"U.S. Department of State"},2752521:{category_id:42,name:"Bible Gateway"},2752522:{category_id:42,name:"Correios"},2752523:{category_id:42,name:"Wonder Wall"},2752524:{category_id:42,name:"Japan Post Service Co."},2752525:{category_id:42,name:"Change.org"},2752526:{category_id:42,name:"The Weekly Standard"},2752527:{category_id:42,name:"European Commission"},2752528:{category_id:42,name:"Daily Kos"},2752529:{category_id:42,name:"Infowars"},2752530:{category_id:42,name:"SheKnows"},2752531:{category_id:42,name:"President Barack H. Obama"},2752532:{category_id:42,name:"Ask Men"},2752533:{category_id:42,name:"Slashdot"},2752534:{category_id:42,name:"Townhall"},2752535:{category_id:42,name:"Royal Mail"},2752536:{category_id:42,name:"Snopes"},2752537:{category_id:42,name:"AARP"},2752538:{category_id:42,name:"Church of Jesus Christ of Latter-day Saints"},2752539:{category_id:42,name:"Just Jared"},2752540:{category_id:42,name:"Complex"},2752541:{category_id:42,name:"Gallup"},2752542:{category_id:42,name:"The Register"},2752543:{category_id:42,name:"Official Resources Web Site"},2752544:{category_id:42,name:"Creative Commons"},2752545:{category_id:42,name:"NewsBusters.org"},2752546:{category_id:42,name:"The Jerusalem Post"},2752547:{category_id:42,name:"Immigration and Naturalization Service (Employment)"},2752548:{category_id:42,name:"Deutsche Post"},2752549:{category_id:42,name:"Department of Veterans Affairs"},2752550:{category_id:42,name:"DateHookup"},2752551:{category_id:42,name:"Avaaz"},2752552:{category_id:42,name:"The Animal Rescue Site"},2752553:{category_id:42,name:"PeopleSmart"},2752554:{category_id:42,name:"United Nations"},2752555:{category_id:42,name:"Free Republic"},2752556:{category_id:42,name:"Canada Post / Postes Canada"},2752557:{category_id:42,name:"MoveOn.org"},2752558:{category_id:42,name:"Astrodienst"},2752559:{category_id:42,name:"The Christian Post"},2752560:{category_id:42,name:"The Superficial"},2752561:{category_id:42,name:"La Poste"},2752562:{category_id:42,name:"Made Man"},2752563:{category_id:42,name:"Find A Grave"},2752564:{category_id:42,name:"Answerbag"},2752565:{category_id:42,name:"FamilySearch"},2752566:{category_id:42,name:"RootsWeb"},2752567:{category_id:42,name:"American Red Cross"},2752568:{category_id:42,name:"IMDb",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/imdb.com/favicon.ico"},2752569:{category_id:42,name:"Online Parallel Bible"},2752570:{category_id:42,name:"Above Top Secret"},2752571:{category_id:42,name:"Companies House"},2752572:{category_id:42,name:"CaringBridge"},2752573:{category_id:42,name:"The World Bank Group"},2752574:{category_id:42,name:"Christian Book Distributors"},2752575:{category_id:42,name:"The Knot"},2752576:{category_id:42,name:"Australia Post"},2752577:{category_id:42,name:"Expat Blog"},2752578:{category_id:42,name:"Islamic Finder"},2752579:{category_id:42,name:"Central Bank of the Islamic Republic of Iran"},2752580:{category_id:42,name:"Treehugger"},2752581:{category_id:42,name:"David Icke"},2752582:{category_id:42,name:"Cosmopolitan"},2752583:{category_id:42,name:"Securities and Exchange Commission (SEC)"},2752584:{category_id:42,name:"FindLaw"},2752585:{category_id:42,name:"LewRockwell"},2752586:{category_id:42,name:"Esquire"},2752587:{category_id:42,name:"Avvo"},2752588:{category_id:42,name:"Foreign and Commonwealth Office"},2752589:{category_id:42,name:"GoodSearch"},2752590:{category_id:42,name:"Horoscope"},2752591:{category_id:42,name:"GQ"},28:{category_id:0,name:"Pidgin"},2818049:{category_id:43,name:"Yahoo Sports",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},2818050:{category_id:43,name:"NFL.COM"},2818051:{category_id:43,name:"NBA"},2818052:{category_id:43,name:"LiveScore"},2818053:{category_id:43,name:"Bleacher Report"},2818054:{category_id:43,name:"Premierleague"},2818055:{category_id:43,name:"SkySports"},2818056:{category_id:43,name:"Fantasy games"},2818057:{category_id:43,name:"British Eurosport"},2818058:{category_id:43,name:"Rivals"},2818059:{category_id:43,name:"Formula1"},2818060:{category_id:43,name:"Scout"},2818061:{category_id:43,name:"ATPworldtour"},2818062:{category_id:43,name:"Rotoworld"},2818063:{category_id:43,name:"Sporting News"},2818064:{category_id:43,name:"NASCAR Online"},2818065:{category_id:43,name:"SB Nation"},2818066:{category_id:43,name:"FlashScore"},2818067:{category_id:43,name:"Yardbarker"},2818068:{category_id:43,name:"Deadspin"},2818069:{category_id:43,name:"The Sports Network"},2818070:{category_id:43,name:"Arsenal"},2818071:{category_id:43,name:"Liverpool Football Club"},2818072:{category_id:43,name:"Pro Football Talk"},2818073:{category_id:43,name:"NHL.com"},2818074:{category_id:43,name:"My Fantasy League"},2818075:{category_id:43,name:"ESPN Star Sports"},2818076:{category_id:43,name:"FootyTube"},2818077:{category_id:43,name:"Cricbuzz"},2818078:{category_id:43,name:"FilGoal"},2818079:{category_id:43,name:"FC Barcelona"},2818080:{category_id:43,name:"Sporting Life"},2818081:{category_id:43,name:"MaxPreps"},2818082:{category_id:43,name:"Chelsea Football Club"},2818083:{category_id:43,name:"autosport"},2818084:{category_id:43,name:"Sherdog"},2818085:{category_id:43,name:"Surfline"},2818086:{category_id:43,name:"Ultimate Fighting Championship"},2818087:{category_id:43,name:"Runners World Online"},2818088:{category_id:43,name:"Racing Post"},2818089:{category_id:43,name:"MSNBC Sports"},2818090:{category_id:43,name:"101 Great Goals"},2818091:{category_id:43,name:"Cyclingnews"},2818092:{category_id:43,name:"The Hong Kong Jockey Club"},2818093:{category_id:43,name:"Real Madrid"},2818094:{category_id:43,name:"XScores"},2818095:{category_id:43,name:"PGA Tour"},2818096:{category_id:43,name:"TEAMtalk "},2818097:{category_id:43,name:"Football365"},2818098:{category_id:43,name:"Real GM"},2818099:{category_id:43,name:"RealTime Fantasy Sports"},2818100:{category_id:43,name:"Eurosport"},2818101:{category_id:43,name:"MLB Trade Rumors"},2818102:{category_id:43,name:"Baseball Reference"},29:{category_id:0,name:"ISPQ"},3:{category_id:0,name:"AIM/ICQ/iIM"},31:{category_id:0,name:"ChatON(M)"},32:{category_id:0,name:"Caihong"},327681:{category_id:5,name:"SMTP"},327682:{category_id:5,name:"POP3"},327683:{category_id:5,name:"IMAP4"},327684:{category_id:5,name:"NNTP"},327685:{category_id:5,name:"Twig"},327686:{category_id:5,name:"GroupWise"},327687:{category_id:5,name:"au one net"},327689:{category_id:5,name:"PChome"},327690:{category_id:5,name:"DTI MyMail"},327691:{category_id:5,name:"Ymail"},327692:{category_id:5,name:"IIJ MailViewer"},327693:{category_id:5,name:"Telenet Mail"},327694:{category_id:5,name:"Open Mail"},327695:{category_id:5,name:"InfoSphere Webmail"},327696:{category_id:5,name:"Goo Mail"},327697:{category_id:5,name:"Nifty"},327698:{category_id:5,name:"QQ Mail"},327699:{category_id:5,name:"Roundcubemail"},327700:{category_id:5,name:"Zenno"},327701:{category_id:5,name:"Itm-asp"},327702:{category_id:5,name:"Biglobe"},327703:{category_id:5,name:"SquirrelMail"},327704:{category_id:5,name:"Zoho Mail"},327705:{category_id:5,name:"Inter7"},327706:{category_id:5,name:"TOK2"},327707:{category_id:5,name:"Smoug"},327708:{category_id:5,name:"1und1"},327709:{category_id:5,name:"Plala"},327710:{category_id:5,name:"WAKWAK"},327711:{category_id:5,name:"Eyejot"},327712:{category_id:5,name:"AsahiNet"},327713:{category_id:5,name:"Aikq"},327714:{category_id:5,name:"Yandex"},327715:{category_id:5,name:"Arcor"},327716:{category_id:5,name:"Bluewin"},327717:{category_id:5,name:"Directbox"},327718:{category_id:5,name:"Freenet"},327720:{category_id:5,name:"Smart Mail"},327722:{category_id:5,name:"WEB.DE"},327723:{category_id:5,name:"MS Exchange Server"},327732:{category_id:5,name:"Webmail.de"},327742:{category_id:5,name:"NETEASE Mail"},327743:{category_id:5,name:"Gmx Mail"},327744:{category_id:5,name:"Excite"},327745:{category_id:5,name:"InfoSeek Mail"},327746:{category_id:5,name:"Livedoor"},327747:{category_id:5,name:"Nate Mail"},327749:{category_id:5,name:"Optimum"},327751:{category_id:5,name:"Secureserver"},327753:{category_id:5,name:"Sina Mail"},327755:{category_id:5,name:"Rambler"},327760:{category_id:5,name:"Daum Mail"},327761:{category_id:5,name:"Mail.com"},327762:{category_id:5,name:"OCN"},327763:{category_id:5,name:"MailChimp"},327764:{category_id:5,name:"Rediff Mail"},327770:{category_id:5,name:"Korea Mail"},327774:{category_id:5,name:"Hotmail"},327775:{category_id:5,name:"Gmail"},327776:{category_id:5,name:"AOL Mail",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/aol.com/favicon.ico"},327778:{category_id:5,name:"COX"},327779:{category_id:5,name:"Hushmail"},327780:{category_id:5,name:"Mail.ru"},327781:{category_id:5,name:"HiNet Mail"},327782:{category_id:5,name:"Horde"},327783:{category_id:5,name:"Fastmail"},327784:{category_id:5,name:"Comcast",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/comcast.com/favicon.ico"},327785:{category_id:5,name:"Laposte"},327786:{category_id:5,name:"Yahoo Mail",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},327787:{category_id:5,name:"Usermin Mail"},327788:{category_id:5,name:"Tistory"},327789:{category_id:5,name:"Orange"},327790:{category_id:5,name:"012mail"},327791:{category_id:5,name:"T-Online"},327792:{category_id:5,name:"Jubii Mail"},327793:{category_id:5,name:"Whalemail"},327794:{category_id:5,name:"Lavabit"},327795:{category_id:5,name:"Tiscali"},33:{category_id:0,name:"KC"},34:{category_id:0,name:"IMVU"},35:{category_id:0,name:"Instan-t"},36:{category_id:0,name:"PiIM"},37:{category_id:0,name:"Xfire"},38:{category_id:0,name:"Raidcall"},393217:{category_id:6,name:"Skype"},393218:{category_id:6,name:"H.323"},393220:{category_id:6,name:"Facetime"},393221:{category_id:6,name:"Juiker"},393222:{category_id:6,name:"Sqwiggle"},393223:{category_id:6,name:"ooVoo"},393225:{category_id:6,name:"TeamSpeak"},393226:{category_id:6,name:"Ventrilo"},393228:{category_id:6,name:"SIP"},393229:{category_id:6,name:"NetMeeting"},393230:{category_id:6,name:"Inter-Asterisk"},393231:{category_id:6,name:"Net2Phone"},393232:{category_id:6,name:"MSRP"},393234:{category_id:6,name:"LINE(M)"},393235:{category_id:6,name:"Fring(M)"},393236:{category_id:6,name:"Goober"},393238:{category_id:6,name:"Viber(M)"},393239:{category_id:6,name:"Kakao(M)"},393240:{category_id:6,name:"iCall"},393242:{category_id:6,name:"Nimbuzz"},393243:{category_id:6,name:"Bobsled(M)"},393244:{category_id:6,name:"indoona"},393246:{category_id:6,name:"Tango(M)"},393247:{category_id:6,name:"Ooma"},4:{category_id:0,name:"QQ/TM"},41:{category_id:0,name:"WhatsApp(M)"},42:{category_id:0,name:"Userplane"},43:{category_id:0,name:"24im"},44:{category_id:0,name:"Camfrog"},458753:{category_id:7,name:"MSSQL"},458754:{category_id:7,name:"MySQL"},458755:{category_id:7,name:"Oracle"},458756:{category_id:7,name:"PostgreSQL"},458757:{category_id:7,name:"SAP"},458760:{category_id:7,name:"Etelos"},458761:{category_id:7,name:"Centriccrm"},458763:{category_id:7,name:"FileMaker"},458766:{category_id:7,name:"MongoDB"},458767:{category_id:7,name:"Salesforce"},458768:{category_id:7,name:"MariaDB"},46:{category_id:0,name:"Digsby"},49:{category_id:0,name:"Message Send Protocol"},5:{category_id:0,name:"Laiwang(M)"},524289:{category_id:8,name:"QQ Game"},524290:{category_id:8,name:"Our Game"},524291:{category_id:8,name:"Cga.com"},524292:{category_id:8,name:"FIFA"},524293:{category_id:8,name:"PopKart"},524294:{category_id:8,name:"Archlord"},524295:{category_id:8,name:"AddictingGames.com"},524296:{category_id:8,name:"Realgame"},524297:{category_id:8,name:"Audition"},524298:{category_id:8,name:"Koramgame"},524299:{category_id:8,name:"BnB Game"},524300:{category_id:8,name:"Chinagame"},524301:{category_id:8,name:"CS Game"},524302:{category_id:8,name:"Diablo"},524303:{category_id:8,name:"Legend"},524304:{category_id:8,
name:"Lineage"},524306:{category_id:8,name:"Quake Game"},524307:{category_id:8,name:"Diablo3"},524308:{category_id:8,name:"Sina Web Game"},524310:{category_id:8,name:"WOW Game"},524311:{category_id:8,name:"Ispeakgame"},524312:{category_id:8,name:"Torchlight2"},524313:{category_id:8,name:"MapleStory"},524314:{category_id:8,name:"TowerOfSaviors(M)"},524315:{category_id:8,name:"Wolfenstein"},524316:{category_id:8,name:"Second Life"},524317:{category_id:8,name:"Kimi"},524318:{category_id:8,name:"Doof Game"},524319:{category_id:8,name:"PartyPoker"},524320:{category_id:8,name:"Pogo"},524321:{category_id:8,name:"PokerStars"},524322:{category_id:8,name:"Zango"},524323:{category_id:8,name:"Little Fighter 2"},524324:{category_id:8,name:"BomberClone"},524326:{category_id:8,name:"FSJOY"},524327:{category_id:8,name:"175pt"},524328:{category_id:8,name:"Zhuxian"},524329:{category_id:8,name:"GameTea/GameABC"},524330:{category_id:8,name:"Talesrunner"},524331:{category_id:8,name:"PK Game"},524332:{category_id:8,name:"Concerto Gate"},524333:{category_id:8,name:"TLBB"},524334:{category_id:8,name:"YBOnline"},524335:{category_id:8,name:"Xunyou"},524336:{category_id:8,name:"Mwo"},524337:{category_id:8,name:"ZF.91"},524338:{category_id:8,name:"WuLin"},524339:{category_id:8,name:"DNF Game"},524340:{category_id:8,name:"Bo Game"},524341:{category_id:8,name:"Gran Turismo"},524343:{category_id:8,name:"Electronic Arts"},524344:{category_id:8,name:"ZhengTu"},524345:{category_id:8,name:"SGOL"},524346:{category_id:8,name:"XY2Online"},524347:{category_id:8,name:"Asherons Call"},524348:{category_id:8,name:"Kali"},524349:{category_id:8,name:"EverQuest"},524350:{category_id:8,name:"XBOX"},524351:{category_id:8,name:"BrettspielWelt"},524352:{category_id:8,name:"Bet-at-Home"},524353:{category_id:8,name:"City of Heroes"},524354:{category_id:8,name:"ClubPenguin"},524355:{category_id:8,name:"StepMania"},524356:{category_id:8,name:"Battle.net"},524358:{category_id:8,name:"Apprentice"},524359:{category_id:8,name:"EA SPORTS"},524360:{category_id:8,name:"FreeLotto Game"},524361:{category_id:8,name:"Halo"},524362:{category_id:8,name:"iSketch"},524363:{category_id:8,name:"RuneScape"},524364:{category_id:8,name:"FUNMILY"},524365:{category_id:8,name:"Yeapgame"},524366:{category_id:8,name:"Grand Theft Auto"},524367:{category_id:8,name:"Lineage2"},524368:{category_id:8,name:"GM99 Game"},524369:{category_id:8,name:"RayCity"},524370:{category_id:8,name:"Rockstar Games"},524371:{category_id:8,name:"Aleph One"},524372:{category_id:8,name:"Wayi"},524373:{category_id:8,name:"CMWEBGAME"},524374:{category_id:8,name:"Call of Duty"},524375:{category_id:8,name:"CAPTAN"},524376:{category_id:8,name:"Supercell(Clash of Clans/Hay Day)"},524377:{category_id:8,name:"Need for Speed"},524379:{category_id:8,name:"Madden NFL"},524380:{category_id:8,name:"Half-Life"},524381:{category_id:8,name:"Team Fortress"},524383:{category_id:8,name:"Final Fantasy"},524384:{category_id:8,name:"Mythic"},524385:{category_id:8,name:"NetPanzer"},524386:{category_id:8,name:"Sdo.com"},524388:{category_id:8,name:"Pokemon Netbattle"},524389:{category_id:8,name:"RunUO-Ultima"},524390:{category_id:8,name:"Soldat Dedicated"},524391:{category_id:8,name:"Blizzard Entertainment"},524392:{category_id:8,name:"RIFT"},524393:{category_id:8,name:"TetriNET"},524394:{category_id:8,name:"Tibia"},524395:{category_id:8,name:"PlanetSide"},524396:{category_id:8,name:"TripleA"},524398:{category_id:8,name:"Unreal"},524399:{category_id:8,name:"Valve Steam"},524400:{category_id:8,name:"WesNOth"},524401:{category_id:8,name:"Xpilot"},524402:{category_id:8,name:"Swtor"},524403:{category_id:8,name:"EVEOnline"},524404:{category_id:8,name:"Hearthstone"},524405:{category_id:8,name:"Guild Wars"},524406:{category_id:8,name:"Zhong Hua Hero"},524407:{category_id:8,name:"Wizard101"},524408:{category_id:8,name:"SD Gundam"},524409:{category_id:8,name:"Prius"},524410:{category_id:8,name:"Age of Conan"},524411:{category_id:8,name:"RF Returns"},524412:{category_id:8,name:"AION"},524413:{category_id:8,name:"POPO Game"},524414:{category_id:8,name:"War-Rock"},524415:{category_id:8,name:"TEN Game"},524416:{category_id:8,name:"LUNA2"},524417:{category_id:8,name:"Karos"},524418:{category_id:8,name:"SPOnline"},524419:{category_id:8,name:"RO Game"},524420:{category_id:8,name:"StarCraft2"},524421:{category_id:8,name:"Itaiwanmj"},524422:{category_id:8,name:"CMWEBGAME Game"},524423:{category_id:8,name:"Beanfun Game"},524424:{category_id:8,name:"JXW"},524425:{category_id:8,name:"Nobol"},524426:{category_id:8,name:"DragonNest"},524427:{category_id:8,name:"BBonline"},524428:{category_id:8,name:"Hangame"},524429:{category_id:8,name:"Homygame"},524430:{category_id:8,name:"Sony PlayStation"},524431:{category_id:8,name:"Garena"},524432:{category_id:8,name:"91555"},524433:{category_id:8,name:"JJ Game"},524434:{category_id:8,name:"YHgame"},524435:{category_id:8,name:"Mdm365"},524436:{category_id:8,name:"7fgame"},524437:{category_id:8,name:"Dokee"},524438:{category_id:8,name:"VSA"},524439:{category_id:8,name:"Funtown"},524440:{category_id:8,name:"SF Game"},524441:{category_id:8,name:"173kh"},524442:{category_id:8,name:"Boyaapoker"},524443:{category_id:8,name:"GameCenter"},524444:{category_id:8,name:"Minecraft"},524445:{category_id:8,name:"Dark Souls"},524446:{category_id:8,name:"The Secret World"},524447:{category_id:8,name:"World2"},524448:{category_id:8,name:"CrossFire"},524449:{category_id:8,name:"XYQ"},524450:{category_id:8,name:"Nexon"},524451:{category_id:8,name:"Vindictus"},524452:{category_id:8,name:"DotA"},524453:{category_id:8,name:"PAYDAY"},524454:{category_id:8,name:"Wayi Game"},524455:{category_id:8,name:"War Thunder"},524456:{category_id:8,name:"Warframe"},524457:{category_id:8,name:"TT-Play Game"},524458:{category_id:8,name:"TT-Play"},524459:{category_id:8,name:"Robocraft"},524460:{category_id:8,name:"World of Tanks"},524461:{category_id:8,name:"Divinity"},524462:{category_id:8,name:"Left 4 Dead 2"},524463:{category_id:8,name:"DayZ"},524466:{category_id:8,name:"TXWY Game"},524479:{category_id:8,name:"Yeapgame Game"},524491:{category_id:8,name:"FUNMILY Game"},524512:{category_id:8,name:"Sony Online Entertainment"},524513:{category_id:8,name:"WSOP(M)"},524514:{category_id:8,name:"TexasHoldemPoker(M)"},524515:{category_id:8,name:"DarkSummoner(M)"},524516:{category_id:8,name:"AjaxPlay"},524517:{category_id:8,name:"AirlineMogul"},524518:{category_id:8,name:"Evony"},524519:{category_id:8,name:"BasketBallZone"},524520:{category_id:8,name:"Y8 Game"},524521:{category_id:8,name:"Y8-Y8"},524522:{category_id:8,name:"KIZI-GAMES"},524523:{category_id:8,name:"Ibibo"},524524:{category_id:8,name:"Hattrick Game"},524525:{category_id:8,name:"Godgame"},524526:{category_id:8,name:"Aswordtw(M)"},524527:{category_id:8,name:"Qme RO(M)"},524529:{category_id:8,name:"THE WORLD(M)"},524530:{category_id:8,name:"Qme JH(M)"},524531:{category_id:8,name:"Qme COS(M)"},524532:{category_id:8,name:"Qme SG(M)"},524533:{category_id:8,name:"Origin"},524534:{category_id:8,name:"LoL"},524535:{category_id:8,name:"THISISGAME"},524536:{category_id:8,name:"Miniclip Game"},524537:{category_id:8,name:"888games"},524538:{category_id:8,name:"WilliamHill"},524539:{category_id:8,name:"Betfair Game"},524540:{category_id:8,name:"Kongregate Game"},524541:{category_id:8,name:"Roblox Game"},524542:{category_id:8,name:"King Game"},524543:{category_id:8,name:"Chess Game"},54:{category_id:0,name:"Fetion"},55:{category_id:0,name:"Heyyo"},56:{category_id:0,name:"Alicall"},57:{category_id:0,name:"Qeshow"},58:{category_id:0,name:"MissLee"},589828:{category_id:9,name:"IGMP"},589829:{category_id:9,name:"SNMP"},589885:{category_id:9,name:"DNS"},589888:{category_id:9,name:"Multicast DNS"},589890:{category_id:9,name:"Finger protocol"},589916:{category_id:9,name:"DCE-RPC"},589933:{category_id:9,name:"SSDP"},589934:{category_id:9,name:"SMB"},589942:{category_id:9,name:"ICMP"},589951:{category_id:9,name:"UPnP"},59:{category_id:0,name:"Jctrans"},6:{category_id:0,name:"IRC"},61:{category_id:0,name:"BaiduHi"},62:{category_id:0,name:"TELTEL"},64:{category_id:0,name:"9158"},65:{category_id:0,name:"Kltx"},655361:{category_id:10,name:"pcAnywhere"},655362:{category_id:10,name:"VNC"},655363:{category_id:10,name:"TeamViewer"},655364:{category_id:10,name:"MS Remote Desktop Protocol (RDP)"},655365:{category_id:10,name:"Chrome Remote Desktop"},655366:{category_id:10,name:"NTRglobal"},655367:{category_id:10,name:"RemoteCall"},655369:{category_id:10,name:"GoToMyPC"},655370:{category_id:10,name:"Pulseway"},655371:{category_id:10,name:"Radmin"},655372:{category_id:10,name:"Beinsync"},655373:{category_id:10,name:"Fastviewer"},655374:{category_id:10,name:"CrossTec Remote Control"},655375:{category_id:10,name:"GoToMeeting"},655376:{category_id:10,name:"ShowMyPC"},655377:{category_id:10,name:"Join.me"},655378:{category_id:10,name:"Telnet"},655379:{category_id:10,name:"Techinline"},65538:{category_id:1,name:"BitTorrent Series"},655380:{category_id:10,name:"ISL Online"},655381:{category_id:10,name:"Secure Shell (SSH)"},655385:{category_id:10,name:"IBM Remote monitoring and Control"},655395:{category_id:10,name:"Netviewer"},655396:{category_id:10,name:"VT100"},655398:{category_id:10,name:"X11"},65540:{category_id:1,name:"DirectConnect"},655402:{category_id:10,name:"Instanthousecall"},655403:{category_id:10,name:"Ammyy"},65542:{category_id:1,name:"eDonkey Series"},65543:{category_id:1,name:"FastTrack"},65544:{category_id:1,name:"Gnutella"},65545:{category_id:1,name:"WinMX"},65546:{category_id:1,name:"Foxy"},65547:{category_id:1,name:"Winny"},65548:{category_id:1,name:"POCO"},65549:{category_id:1,name:"iMesh"},65550:{category_id:1,name:"ClubBox"},65551:{category_id:1,name:"Vagaa"},65552:{category_id:1,name:"Share"},65553:{category_id:1,name:"Thunder Series"},65554:{category_id:1,name:"myMusic"},65555:{category_id:1,name:"QQDownload"},65557:{category_id:1,name:"easyMule"},65559:{category_id:1,name:"Fileguri"},65563:{category_id:1,name:"Soulseek"},65565:{category_id:1,name:"GNUnet"},65566:{category_id:1,name:"XNap"},65568:{category_id:1,name:"Kceasy"},65569:{category_id:1,name:"Aria2"},65570:{category_id:1,name:"Arctic"},65571:{category_id:1,name:"Artemis"},65572:{category_id:1,name:"Bitflu"},65573:{category_id:1,name:"BTG"},65574:{category_id:1,name:"Pando"},65575:{category_id:1,name:"Lphant"},65576:{category_id:1,name:"BitBlinder"},65577:{category_id:1,name:"Deepnet Explorer"},65578:{category_id:1,name:"aMule"},65580:{category_id:1,name:"Ares"},65581:{category_id:1,name:"Azureus"},65582:{category_id:1,name:"BCDC++"},65583:{category_id:1,name:"BitBuddy"},65584:{category_id:1,name:"BitComet"},65585:{category_id:1,name:"BitTornado"},65587:{category_id:1,name:"ApexDC++"},65588:{category_id:1,name:"Bearshare"},65590:{category_id:1,name:"BitLord"},65591:{category_id:1,name:"BitSpirit"},65594:{category_id:1,name:"Shareaza"},65598:{category_id:1,name:"eMule"},65600:{category_id:1,name:"eMule Plus"},65604:{category_id:1,name:"FileScope"},65609:{category_id:1,name:"GoGoBox"},65612:{category_id:1,name:"Hydranode"},65613:{category_id:1,name:"BitTorrent Pro"},65617:{category_id:1,name:"Kazaa Lite Tools K++"},65620:{category_id:1,name:"BitRocket"},65621:{category_id:1,name:"MlDonkey"},65622:{category_id:1,name:"MooPolice"},65630:{category_id:1,name:"Phex"},65633:{category_id:1,name:"RevConnect"},65634:{category_id:1,name:"Rufus"},65635:{category_id:1,name:"SababaDC"},65636:{category_id:1,name:"Shareaza Plus"},65640:{category_id:1,name:"BTSlave"},65642:{category_id:1,name:"TorrentStorm"},65648:{category_id:1,name:"uTorrent"},65652:{category_id:1,name:"ZipTorrent"},65655:{category_id:1,name:"BitPump"},65664:{category_id:1,name:"BBtor"},65665:{category_id:1,name:"Tuotu"},65666:{category_id:1,name:"BitWombat"},65685:{category_id:1,name:"Vuze"},65688:{category_id:1,name:"Bittorrent X"},65689:{category_id:1,name:"DelugeTorrent"},65690:{category_id:1,name:"CTorrent"},65691:{category_id:1,name:"Propagate Data Client"},65692:{category_id:1,name:"EBit"},65693:{category_id:1,name:"Electric Sheep"},65694:{category_id:1,name:"FileCroc"},65695:{category_id:1,name:"FoxTorrent"},65696:{category_id:1,name:"GSTorrent"},65697:{category_id:1,name:"Hekate"},65698:{category_id:1,name:"Halite"},65699:{category_id:1,name:"hMule"},65700:{category_id:1,name:"KGet"},65701:{category_id:1,name:"KTorrent"},65702:{category_id:1,name:"LeechCraft"},65703:{category_id:1,name:"LH-ABC"},65704:{category_id:1,name:"libTorrent"},65705:{category_id:1,name:"LimeWire"},65706:{category_id:1,name:"Meerkat"},65707:{category_id:1,name:"MonoTorrent"},65708:{category_id:1,name:"MoonlightTorrent"},65709:{category_id:1,name:"Net Transport"},65710:{category_id:1,name:"OneSwarm"},65711:{category_id:1,name:"OmegaTorrent"},65712:{category_id:1,name:"Protocol::BitTorrent"},65713:{category_id:1,name:"PHPTracker"},65714:{category_id:1,name:"qBittorrent"},65715:{category_id:1,name:"Qt 4 Torrent example"},65716:{category_id:1,name:"Retriever"},65717:{category_id:1,name:"RezTorrent"},65718:{category_id:1,name:"Swiftbit"},65719:{category_id:1,name:"SoMud"},65720:{category_id:1,name:"SwarmScope"},65721:{category_id:1,name:"SymTorrent"},65722:{category_id:1,name:"Sharktorrent"},65723:{category_id:1,name:"Terasaur Seed Bank"},65724:{category_id:1,name:"TorrentDotNET"},65725:{category_id:1,name:"Transmission"},65726:{category_id:1,name:"uLeecher"},65727:{category_id:1,name:"BitLet"},65728:{category_id:1,name:"FireTorrent"},65729:{category_id:1,name:"XSwifter"},65730:{category_id:1,name:"XanTorrent"},65731:{category_id:1,name:"Xtorrent"},65732:{category_id:1,name:"Pruna"},65733:{category_id:1,name:"Soribada"},65734:{category_id:1,name:"Gample"},65735:{category_id:1,name:"DIYHARD"},65736:{category_id:1,name:"LottoFile"},65737:{category_id:1,name:"ShareBox"},65738:{category_id:1,name:"Bondisk"},65739:{category_id:1,name:"Filei"},65740:{category_id:1,name:"KDISK"},65741:{category_id:1,name:"Ondisk"},65742:{category_id:1,name:"FILEJO"},65743:{category_id:1,name:"FILEDOK"},65744:{category_id:1,name:"Tomatopang/Santa25"},65745:{category_id:1,name:"Webhard"},65746:{category_id:1,name:"TPLE"},65747:{category_id:1,name:"DiskPump"},65748:{category_id:1,name:"NETFOLDER"},65749:{category_id:1,name:"QFILE"},65750:{category_id:1,name:"DISKMAN"},65751:{category_id:1,name:"DBGO"},65752:{category_id:1,name:"Congaltan"},65753:{category_id:1,name:"Diskpot"},65754:{category_id:1,name:"Ipopclub"},65755:{category_id:1,name:"Yesfile"},65756:{category_id:1,name:"Nedisk"},65757:{category_id:1,name:"Me2disk"},65758:{category_id:1,name:"Odisk"},65759:{category_id:1,name:"Tomfile"},65760:{category_id:1,name:"Adrive.co.kr"},65761:{category_id:1,name:"ZIOfile"},65762:{category_id:1,name:"APPLEFILE"},65763:{category_id:1,name:"SUPERDOWN"},65764:{category_id:1,name:"Hidisk"},65765:{category_id:1,name:"Downs"},65766:{category_id:1,name:"DownDay"},65767:{category_id:1,name:"BOMULBOX"},65768:{category_id:1,name:"FILEHAM"},65769:{category_id:1,name:"Tdisk"},65770:{category_id:1,name:"Filehon"},65771:{category_id:1,name:"Jjangfile"},65772:{category_id:1,name:"Onehard.com"},65773:{category_id:1,name:"Pdpop"},65774:{category_id:1,name:"AirFile"},65775:{category_id:1,name:"FILEZZIM"},65776:{category_id:1,name:"Atomfile.co.kr"},65777:{category_id:1,name:"QDOWN.com"},65778:{category_id:1,name:"Alfile.net"},65779:{category_id:1,name:"Bigfile.co.kr"},65780:{category_id:1,name:"Hardmoa.com"},65781:{category_id:1,name:"Redfile.co.kr"},65782:{category_id:1,name:"FILETV.co.kr"},65783:{category_id:1,name:"Now.co.kr"},65784:{category_id:1,name:"JustBeamIt"},65785:{category_id:1,name:"reep.io"},65786:{category_id:1,name:"GnucDNA/Gimme"},65787:{category_id:1,name:"MyNapster"},66:{category_id:0,name:"IM+(M)"},67:{category_id:0,name:"Imi"},68:{category_id:0,name:"Netcall"},69:{category_id:0,name:"ECP"},7:{category_id:0,name:"Yoics"},72:{category_id:0,name:"Etnano"},720898:{category_id:11,name:"VNN"},720899:{category_id:11,name:"Spotflux"},720900:{category_id:11,name:"SoftEther/PacketiX"},720901:{category_id:11,name:"TinyVPN"},720902:{category_id:11,name:"HTTP-Tunnel"},720903:{category_id:11,name:"Tor"},720904:{category_id:11,name:"Ping Tunnel"},720905:{category_id:11,name:"Wujie/UltraSurf"},720906:{category_id:11,name:"Freegate"},720907:{category_id:11,name:"Hidemyass"},720909:{category_id:11,name:"Vedivi"},720910:{category_id:11,name:"ZenMate"},720911:{category_id:11,name:"Hamachi"},720912:{category_id:11,name:"Disconnect.me"},720913:{category_id:11,name:"Psiphon 3"},720914:{category_id:11,name:"Asproxy"},720915:{category_id:11,name:"OpenDoor"},720916:{category_id:11,name:"NSTX DNS Tunnel"},720917:{category_id:11,name:"Coralcdn"},720918:{category_id:11,name:"Glype"},720919:{category_id:11,name:"GPass"},720920:{category_id:11,name:"Kproxy"},720921:{category_id:11,name:"Megaproxy"},720922:{category_id:11,name:"FreeSafeIP"},720925:{category_id:11,name:"Surrogafier"},720926:{category_id:11,name:"Vtunnel"},720928:{category_id:11,name:"BypassThat"},720930:{category_id:11,name:"JAP/JonDo"},720933:{category_id:11,name:"SofaWare"},720946:{category_id:11,name:"Hidedoor"},720948:{category_id:11,name:"CGIProxy"},720950:{category_id:11,name:"Phproxy"},720951:{category_id:11,name:"OpenVPN"},720952:{category_id:11,name:"CCProxy"},720954:{category_id:11,name:"PD-Proxy"},720959:{category_id:11,name:"Rtmpt"},720960:{category_id:11,name:"LogMeIn"},720961:{category_id:11,name:"HotspotShield"},720962:{category_id:11,name:"ExpressVPN"},720963:{category_id:11,name:"GogoNET"},720964:{category_id:11,name:"HTTP Proxy Server"},720966:{category_id:11,name:"Texasproxy"},720967:{category_id:11,name:"Ourproxy"},720969:{category_id:11,name:"Fast Proxy"},720970:{category_id:11,name:"Zalmos"},720971:{category_id:11,name:"Easy Proxy"},720972:{category_id:11,name:"Proxy Era"},720973:{category_id:11,name:"DotVPN"},720974:{category_id:11,name:"BrowSec"},720977:{category_id:11,name:"Air-Proxy"},720979:{category_id:11,name:"Defilter"},720980:{category_id:11,name:"SSLunblock"},720983:{category_id:11,name:"K12History"},720984:{category_id:11,name:"SurfEasy"},720985:{category_id:11,name:"Frozenway"},720986:{category_id:11,name:"CyberGhostVPN"},720987:{category_id:11,name:"SecurityKISS"},720988:{category_id:11,name:"WebWarper"},720989:{category_id:11,name:"Guardster"},720991:{category_id:11,name:"TunnelBear"},720992:{category_id:11,name:"AstrillVPN"},77:{category_id:0,name:"ProvideSupport"},78:{category_id:0,name:"Dudu IM"},786434:{category_id:12,name:"DZH"},786435:{category_id:12,name:"10JQKA"},786437:{category_id:12,name:"Qianlong"},786438:{category_id:12,name:"Compass.cn"},786439:{category_id:12,name:"Huaan"},786440:{category_id:12,name:"StockStar "},786441:{category_id:12,name:"TDX"},786443:{category_id:12,name:"Hexun"},786444:{category_id:12,name:"Hypwise"},786449:{category_id:12,name:"Kiwoom"},786450:{category_id:12,name:"Windin"},786451:{category_id:12,name:"SamsungPoP"},786453:{category_id:12,name:"StockTrace"},786454:{category_id:12,name:"JRJ"},786455:{category_id:12,name:"TradeFields(M)"},786457:{category_id:12,name:"Netdania"},786458:{category_id:12,name:"TradeInterceptor"},8:{category_id:0,name:"Rediff BOL"},80:{category_id:0,name:"Weibo IM"},81:{category_id:0,name:"WO"},82:{category_id:0,name:"Guagua"},83:{category_id:0,name:"Hangouts"},84:{category_id:0,name:"ClubCooee"},85:{category_id:0,name:"Palringo"},851969:{category_id:13,name:"WhiteHat Aviator"},851970:{category_id:13,name:"HTC Widget(M)"},851971:{category_id:13,name:"Doodle"},851972:{category_id:13,name:"Level3"},851973:{category_id:13,name:"FuzeMeeting"},851974:{category_id:13,name:"Mobile01"},851975:{category_id:13,name:"Speedtest.net"},851976:{category_id:13,name:"Google Chrome",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},851977:{category_id:13,name:"Babelfish"},851978:{category_id:13,name:"Google-translate",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},851980:{category_id:13,name:"Mozilla Firefox"},851981:{category_id:13,name:"Apple Safari",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},851982:{category_id:13,name:"Opera browser"},851983:{category_id:13,name:"Google",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},851984:{category_id:13,name:"Google-books",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},851985:{category_id:13,name:"eBay",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/ebay.com/favicon.ico"},851986:{category_id:13,name:"hao123"},851987:{category_id:13,name:"Soso"},851988:{category_id:13,name:"Tmall"},851989:{category_id:13,name:"PayPal.com",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/paypal.com/favicon.ico"},851990:{category_id:13,name:"Ask.com"},851991:{category_id:13,name:"BBC"},851992:{category_id:13,name:"Alibaba.com"},851993:{category_id:13,name:"CNN.com",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/cnn.com/favicon.ico"},851995:{category_id:13,name:"Sogou.com"},851996:{category_id:13,name:"Evernote"},851997:{category_id:13,name:"About.com"},851998:{category_id:13,name:"Alipay.com"},851999:{category_id:13,name:"Imgur",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/imgur.com/favicon.ico"},852000:{category_id:13,name:"Adcash"},852001:{category_id:13,name:"Huffington Post",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/huffingtonpost.com/favicon.ico"},852002:{category_id:13,name:"360buy"},852003:{category_id:13,name:"ESPN"},852004:{category_id:13,name:"Books"},852005:{category_id:13,name:"Craigslist.org",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/craigslist.com/favicon.ico"},852006:{category_id:13,name:"Google-analytics",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},852007:{category_id:13,name:"Bing Maps",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/bing.com/favicon.ico"},852008:{category_id:13,name:"ETtoday "},852009:{category_id:13,name:"104 Job Bank"},852010:{category_id:13,name:"NOWnews"},852011:{category_id:13,name:"518 Job Bank"},852012:{category_id:13,name:"Chinatimes.com"},852013:{category_id:13,name:"GOHAPPY"},852014:{category_id:13,name:"591"},852015:{category_id:13,name:"8591"},852016:{category_id:13,name:"Chinatrust"},852017:{category_id:13,name:"Donga.com"},852018:{category_id:13,name:"Gmarket"},852019:{category_id:13,name:"Chosun.com"},852020:{category_id:13,name:"Cafe24.com"},852021:{category_id:13,name:"11st"},852022:{category_id:13,name:"MK.co.kr"},852023:{category_id:13,name:"Auction"},852024:{category_id:13,name:"Hankyung"},852025:{category_id:13,name:"Ppomppu"},852026:{category_id:13,name:"MT.co.kr"},852027:{category_id:13,name:"Zum.com"},852028:{category_id:13,name:"Hankooki"},852029:{category_id:13,name:"JOBKOREA"},852031:{category_id:13,name:"Khan.co.kr"},852032:{category_id:13,name:"Incruit"},852033:{category_id:13,name:"YES24"},852034:{category_id:13,name:"Amazon CloudFront",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/amazon.com/favicon.ico"},852035:{category_id:13,name:"Pcstore"},852036:{category_id:13,name:"Myfreshnet.com"},852037:{category_id:13,name:"Microsoft.com",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},852038:{category_id:13,name:"Life.com.tw"},852039:{category_id:13,name:"Libertytimes"},852040:{category_id:13,name:"Lativ"},852041:{category_id:13,name:"Inven"},852042:{category_id:13,name:"cnYES"},852043:{category_id:13,name:"Babyhome"},852044:{category_id:13,name:"8comic.com"},852045:{category_id:13,name:"Ck101.com"},852046:{category_id:13,name:"Taiwanlottery"},852047:{category_id:13,name:"Momoshop"},852048:{category_id:13,name:"Eyny.com"},852049:{category_id:13,name:"Yam.com"},852050:{category_id:13,name:"PChome.com"},852051:{category_id:13,name:"Gamme"},852052:{category_id:13,name:"Apple.com",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},852053:{category_id:13,name:"Hinet.net"},852054:{category_id:13,name:"Google-earth",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},852055:{category_id:13,name:"Saramin"},852056:{category_id:13,name:"KoreaHerald"},852057:{category_id:13,name:"Plus28.com"},852058:{category_id:13,name:"ChunghwaPost "},852059:{category_id:13,name:"Gomaji "},852060:{category_id:13,name:"NewSen"},852061:{category_id:13,name:"Etnews.com"},852062:{category_id:13,name:"Seoul.co.kr"},852063:{category_id:13,name:"YONHAPNEWS"},852064:{category_id:13,name:"Etoday.co.kr"},852065:{category_id:13,name:"Yesky.com"},852066:{category_id:13,name:"1111 Job Bank"},852067:{category_id:13,name:"Emart"},852068:{category_id:13,name:"KBstar"},852069:{category_id:13,name:"HERALDCORP"},852070:{category_id:13,name:"ActiveX"},852071:{category_id:13,name:"MSN.com",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/msn.com/favicon.ico"},852072:{category_id:13,name:"Edaily"},852073:{category_id:13,name:"Segye"},852074:{category_id:13,name:"Bobaedream"},852075:{category_id:13,name:"Nocutnews"},852076:{category_id:13,name:"MONETA.co.kr"},852077:{category_id:13,name:"Kukinews"},852078:{category_id:13,name:"Java Applet"},852079:{category_id:13,name:"Todayhumor"},852080:{category_id:13,name:"Inews24"},852081:{category_id:13,name:"KoreaTimes"},852082:{category_id:13,name:"OhmyNews"},852083:{category_id:13,name:"Aladin.co.kr"},852084:{category_id:13,name:"SK Encar"},852085:{category_id:13,name:"eTorrent"},852086:{category_id:13,name:"TVREPORT"},852087:{category_id:13,name:"Mydaily"},852088:{category_id:13,name:"Microsoft Live.com",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},852089:{category_id:13,name:"News1.kr"},852090:{category_id:13,name:"Munhwa"},852091:{category_id:13,name:"Dreamwiz"},852092:{category_id:13,name:"Dailian.co.kr"},852093:{category_id:13,name:"Rediff.com"},852094:{category_id:13,name:"Akamai.net"},852097:{category_id:13,name:"Yugma"},852098:{category_id:13,name:"TPB PirateBrowser"},852100:{category_id:13,name:"Wikispaces"},852101:{category_id:13,name:"Wikidot"},852102:{category_id:13,name:"Google-play",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},852103:{category_id:13,name:"Wetpaint"},852104:{category_id:13,name:"Windows Store"},852105:{category_id:13,name:"Webshots"},852106:{category_id:13,name:"Kindle Cloud Reader"},852107:{category_id:13,name:"Nice264"},852109:{category_id:13,name:"Vyew"},852110:{category_id:13,name:"TikiWiki"},852111:{category_id:13,name:"Castfire"},852113:{category_id:13,name:"SugarCRM"},852115:{category_id:13,name:"Stumbleupon"},852119:{category_id:13,name:"Spark"},852120:{category_id:13,name:"Socialtext"},852122:{category_id:13,name:"PBworks"},852123:{category_id:13,name:"Fool"},852124:{category_id:13,name:"Showbie"},852125:{category_id:13,name:"MorningStar"},852127:{category_id:13,name:"MoinMoin"},852128:{category_id:13,name:"AppStore"},852129:{category_id:13,name:"Ragingbull"},852130:{category_id:13,name:"Daum"},852131:{category_id:13,name:"Google-docs",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},852133:{category_id:13,name:"Naver"},852134:{category_id:13,name:"Editgrid"},852135:{category_id:13,name:"Jaspersoft"},852136:{category_id:13,name:"Clarizen"},852139:{category_id:13,name:"Interpark"},852140:{category_id:13,name:"Hyundaihmall"},852141:{category_id:13,name:"Groupon"},852142:{category_id:13,name:"Gsshop"},852143:{category_id:13,name:"Wemakeprice"},852144:{category_id:13,name:"Lotte.com"},852145:{category_id:13,name:"Coupang"},852147:{category_id:13,name:"Google-alerts",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},852149:{category_id:13,name:"Dnshop.com"},852150:{category_id:13,name:"ZoomSpider crawler"},852151:{category_id:13,name:"Win Web Crawler"},852152:{category_id:13,name:"HTTrack crawler"},852153:{category_id:13,name:"Abot crawler"},852154:{category_id:13,name:"Googlebot crawler",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},852155:{category_id:13,name:"Microsoft bingbot crawler",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},852156:{category_id:13,name:"Yahoo Slurp crawler",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},852157:{category_id:13,name:"Beanfun"},852159:{category_id:13,name:"ifeng.com"},852160:{category_id:13,name:"Conduit Mobile"},852162:{category_id:13,name:"Gamebase"},852163:{category_id:13,name:"Kingstone"},852164:{category_id:13,name:"Udn.com"},852166:{category_id:13,name:"Sportsseoul"},852167:{category_id:13,name:"Babylon "},852168:{category_id:13,name:"Yahoo Finance",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},852171:{category_id:13,name:"Jira"},852172:{category_id:13,name:"PHPwiki"},852174:{category_id:13,name:"WebCT"},852175:{category_id:13,name:"Youseemore"},852176:{category_id:13,name:"Zwiki-editing"},852177:{category_id:13,name:"Adobe.com"},852178:{category_id:13,name:"Backpackit/Campfire"},852180:{category_id:13,name:"ERoom-net"},852184:{category_id:13,name:"Glide"},852186:{category_id:13,name:"Mediawiki"},852189:{category_id:13,name:"MSN Money",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/msn.com/favicon.ico"},852190:{category_id:13,name:"HTTP"},852191:{category_id:13,name:"AOL Toolbar",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/aol.com/favicon.ico"},852193:{category_id:13,name:"Uber"},852194:{category_id:13,name:"Web-crawler"},852195:{category_id:13,name:"RSS"},852196:{category_id:13,name:"WeatherBug"},852197:{category_id:13,name:"Yahoo Toolbar",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},852198:{category_id:13,name:"Alexa Toolbar"},852199:{category_id:13,name:"Internet Archive"},852200:{category_id:13,name:"Wikipedia",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/wikipedia.com/favicon.ico"},852201:{category_id:13,name:"Wiktionary"},852202:{category_id:13,name:"Amazon",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/amazon.com/favicon.ico"},852203:{category_id:13,name:"Google-toolbar",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},852204:{category_id:13,name:"Google-maps",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},852205:{category_id:13,name:"Zoho"},852206:{category_id:13,name:"Microsoft Internet Explorer",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},852207:{category_id:13,name:"Localmind"},852208:{category_id:13,name:"PulseNews"},852209:{category_id:13,name:"BookU(M)"},852210:{category_id:13,name:"Zappos"},852211:{category_id:13,name:"Expedia(M)"},852212:{category_id:13,name:"AdF.ly"},852213:{category_id:13,name:"Baidu"},852214:{category_id:13,name:"Yahoo",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/yahoo.com/favicon.ico"},852215:{category_id:13,name:"Taobao"},852216:{category_id:13,name:"163.com"},852217:{category_id:13,name:"Sina.com"},852218:{category_id:13,name:"Bing.com",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/bing.com/favicon.ico"},852219:{category_id:13,name:"Ruten"},852220:{category_id:13,name:"Shop.com"},852221:{category_id:13,name:"Appledaily"},852222:{category_id:13,name:"CWB"},852223:{category_id:13,name:"CNA"},86:{category_id:0,name:"KikMessenger"},87:{category_id:0,name:"Doshow"},88:{category_id:0,name:"Mibbit"},89:{category_id:0,name:"YY"},9:{category_id:0,name:"Google Talk",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},90:{category_id:0,name:"Ispeak"},91:{category_id:0,name:"VzoChat"},917508:{category_id:14,name:"BitDefender"},917509:{category_id:14,name:"360Safe"},917510:{category_id:14,name:"Rising"},917511:{category_id:14,name:"TortoiseSVN"},917513:{category_id:14,name:"Microsoft Windows Update",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/microsoft.com/favicon.ico"},917514:{category_id:14,name:"Norton"},917515:{category_id:14,name:"Sophos"},917516:{category_id:14,name:"Yum"},917517:{category_id:14,name:"MIUI"},917518:{category_id:14,name:"Adobe"},917519:{category_id:14,name:"InstallAnyWhere"},917520:{category_id:14,name:"Kaspersky"},917521:{category_id:14,name:"Mcafee"},917522:{category_id:14,name:"TrendMicro"},917523:{category_id:14,name:"F-Secure"},917524:{category_id:14,name:"NOD32"},917525:{category_id:14,name:"Avast"},917526:{category_id:14,name:"Jiangmin"},917527:{category_id:14,name:"Avira"},917528:{category_id:14,name:"Emsisoft"},917529:{category_id:14,name:"Panda"},917530:{category_id:14,name:"AVG"},917531:{category_id:14,name:"PCTools"},917533:{category_id:14,name:"Outpost"},917534:{category_id:14,name:"Spybot"},917535:{category_id:14,name:"Duba"},917536:{category_id:14,name:"Apple",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/apple.com/favicon.ico"},917538:{category_id:14,
name:"Google Update",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/google.com/favicon.ico"},917540:{category_id:14,name:"JAVA Update"},917541:{category_id:14,name:"SONY PC Companion"},917542:{category_id:14,name:"SketchUp"},917543:{category_id:14,name:"Webroot"},92:{category_id:0,name:"Trillian"},93:{category_id:0,name:"HipChat"},94:{category_id:0,name:"IntraMessenger"},95:{category_id:0,name:"BitWise"},96:{category_id:0,name:"Barablu"},97:{category_id:0,name:"Whoshere(M)"},98:{category_id:0,name:"LiiHo(M)"},983043:{category_id:15,name:"eBuddy.com"},983044:{category_id:15,name:"iLoveIM.com"},983047:{category_id:15,name:"imo.im"},983048:{category_id:15,name:"Chikka"},983050:{category_id:15,name:"QQ Web Messenger"},983051:{category_id:15,name:"AOL",iconUrl:"/lib/4_8_15_7440/images/dpi_icons/aol.com/favicon.ico"},983054:{category_id:15,name:"ICQ Web Messenger"},983057:{category_id:15,name:"AirAim"},983058:{category_id:15,name:"Instan-t Web Messenger"},983065:{category_id:15,name:"TaoBao AliWW"},983069:{category_id:15,name:"Gadu-Gadu Web Messenger"},983070:{category_id:15,name:"Karoo Lark"},983072:{category_id:15,name:"IM+"},99:{category_id:0,name:"Appme(M)"}},categories:{0:{applications:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,31,32,33,34,35,36,37,38,41,42,43,44,46,49,54,55,56,57,58,59,61,62,64,65,66,67,68,69,72,77,78,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108],name:"Instant messaging"},1:{applications:[65538,65540,65542,65543,65544,65545,65546,65547,65548,65549,65550,65551,65552,65553,65554,65555,65557,65559,65563,65565,65566,65568,65569,65570,65571,65572,65573,65574,65575,65576,65577,65578,65580,65581,65582,65583,65584,65585,65587,65588,65590,65591,65594,65598,65600,65604,65609,65612,65613,65617,65620,65621,65622,65630,65633,65634,65635,65636,65640,65642,65648,65652,65655,65664,65665,65666,65685,65688,65689,65690,65691,65692,65693,65694,65695,65696,65697,65698,65699,65700,65701,65702,65703,65704,65705,65706,65707,65708,65709,65710,65711,65712,65713,65714,65715,65716,65717,65718,65719,65720,65721,65722,65723,65724,65725,65726,65727,65728,65729,65730,65731,65732,65733,65734,65735,65736,65737,65738,65739,65740,65741,65742,65743,65744,65745,65746,65747,65748,65749,65750,65751,65752,65753,65754,65755,65756,65757,65758,65759,65760,65761,65762,65763,65764,65765,65766,65767,65768,65769,65770,65771,65772,65773,65774,65775,65776,65777,65778,65779,65780,65781,65782,65783,65784,65785,65786,65787],name:"P2P"},10:{applications:[655361,655362,655363,655364,655365,655366,655367,655369,655370,655371,655372,655373,655374,655375,655376,655377,655378,655379,655380,655381,655385,655395,655396,655398,655402,655403],name:"Remote Access Terminals"},11:{applications:[720898,720899,720900,720901,720902,720903,720904,720905,720906,720907,720909,720910,720911,720912,720913,720914,720915,720916,720917,720918,720919,720920,720921,720922,720925,720926,720928,720930,720933,720946,720948,720950,720951,720952,720954,720959,720960,720961,720962,720963,720964,720966,720967,720969,720970,720971,720972,720973,720974,720977,720979,720980,720983,720984,720985,720986,720987,720988,720989,720991,720992],name:"Bypass Proxies and Tunnels"},12:{applications:[786434,786435,786437,786438,786439,786440,786441,786443,786444,786449,786450,786451,786453,786454,786455,786457,786458],name:"Stock Market"},13:{applications:[851969,851970,851971,851972,851973,851974,851975,851976,851977,851978,851980,851981,851982,851983,851984,851985,851986,851987,851988,851989,851990,851991,851992,851993,851995,851996,851997,851998,851999,852e3,852001,852002,852003,852004,852005,852006,852007,852008,852009,852010,852011,852012,852013,852014,852015,852016,852017,852018,852019,852020,852021,852022,852023,852024,852025,852026,852027,852028,852029,852031,852032,852033,852034,852035,852036,852037,852038,852039,852040,852041,852042,852043,852044,852045,852046,852047,852048,852049,852050,852051,852052,852053,852054,852055,852056,852057,852058,852059,852060,852061,852062,852063,852064,852065,852066,852067,852068,852069,852070,852071,852072,852073,852074,852075,852076,852077,852078,852079,852080,852081,852082,852083,852084,852085,852086,852087,852088,852089,852090,852091,852092,852093,852094,852097,852098,852100,852101,852102,852103,852104,852105,852106,852107,852109,852110,852111,852113,852115,852119,852120,852122,852123,852124,852125,852127,852128,852129,852130,852131,852133,852134,852135,852136,852139,852140,852141,852142,852143,852144,852145,852147,852149,852150,852151,852152,852153,852154,852155,852156,852157,852159,852160,852162,852163,852164,852166,852167,852168,852171,852172,852174,852175,852176,852177,852178,852180,852184,852186,852189,852190,852191,852193,852194,852195,852196,852197,852198,852199,852200,852201,852202,852203,852204,852205,852206,852207,852208,852209,852210,852211,852212,852213,852214,852215,852216,852217,852218,852219,852220,852221,852222,852223],name:"Web / Web 2.0"},14:{applications:[917508,917509,917510,917511,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917533,917534,917535,917536,917538,917540,917541,917542,917543],name:"Security Update"},15:{applications:[983043,983044,983047,983048,983050,983051,983054,983057,983058,983065,983069,983070,983072],name:"Web IM"},17:{applications:[1114113,1114114,1114115,1114117,1114118,1114119,1114120,1114121,1114122,1114124,1114125,1114128,1114129,1114130,1114131,1114133,1114134,1114138,1114140,1114141,1114142,1114150,1114151,1114152,1114155,1114158,1114160,1114161,1114167,1114169,1114170,1114176,1114177,1114180,1114182,1114187,1114188,1114191,1114195,1114198,1114201,1114203,1114205,1114206,1114212,1114213,1114222,1114229,1114238,1114239,1114246,1114248,1114250,1114252,1114253,1114255,1114269,1114272,1114273,1114274,1114275,1114277,1114279,1114289,1114290,1114308,1114309,1114310,1114311,1114318,1114320,1114321,1114322,1114330,1114331,1114334,1114335,1114337,1114339,1114340,1114342,1114343,1114347,1114350,1114351,1114352,1114355,1114359,1114361,1114363,1114365],name:"Business"},18:{applications:[1179649,1179650,1179651,1179653,1179654,1179655,1179660,1179665,1179667,1179668,1179669,1179670,1179671,1179672,1179673,1179674,1179675,1179676,1179677,1179678,1179679,1179680,1179681,1179682,1179683,1179684,1179685,1179686,1179687,1179688,1179689,1179690,1179691,1179692,1179693,1179694,1179695,1179696,1179697,1179698,1179699,1179700,1179701,1179702,1179704,1179705,1179706,1179707,1179708,1179709,1179710,1179711,1179712,1179713,1179714,1179715,1179716,1179717,1179718,1179719,1179720,1179721,1179722,1179723,1179724,1179725,1179726,1179727,1179728,1179729,1179731,1179732,1179733,1179734,1179735,1179737,1179739,1179740,1179742,1179743,1179744,1179745,1179746,1179747,1179748,1179749,1179752,1179753,1179754,1179755,1179756,1179757,1179758,1179759,1179760,1179761,1179762,1179763,1179764,1179765,1179766,1179767,1179768,1179769,1179770,1179771,1179772,1179773,1179774,1179775,1179776,1179777,1179778,1179779,1179780,1179781,1179782,1179783,1179784,1179785,1179786,1179787,1179788,1179789,1179790,1179791,1179793,1179794,1179795,1179796,1179797,1179798,1179799,1179800,1179801,1179802,1179803,1179804,1179805,1179806,1179807,1179808,1179809,1179810,1179811,1179812,1179813,1179814,1179815,1179816,1179817,1179818,1179819,1179820,1179821,1179822,1179823,1179824,1179825,1179826,1179827,1179828,1179829,1179830,1179831,1179832,1179833,1179834,1179835,1179836,1179838,1179839,1179840,1179841,1179842,1179843,1179844,1179845,1179846,1179847,1179848,1179849,1179850,1179851,1179852,1179853,1179854,1179855,1179856,1179857,1179858,1179860,1179862,1179863,1179864,1179865,1179866,1179867,1179868,1179869,1179870,1179871,1179872,1179873,1179874,1179875,1179876,1179877,1179878,1179879,1179880,1179881,1179882,1179883,1179884,1179885,1179886,1179887,1179888,1179889,1179890,1179891,1179892,1179893,1179894,1179895,1179896,1179897,1179898,1179899,1179900,1179901,1179902,1179903],name:"Network Protocols"},19:{applications:[1245187,1245188,1245189,1245190,1245191,1245192,1245193,1245195,1245196,1245197,1245198,1245200,1245201,1245202,1245203,1245204,1245205,1245206,1245207,1245208,1245209,1245210,1245211,1245212,1245213,1245214,1245215,1245216,1245217,1245218,1245219,1245220,1245221,1245222,1245223,1245224,1245225,1245226,1245228,1245229,1245230,1245231,1245232,1245233,1245234,1245235,1245236,1245237,1245238,1245239,1245240,1245241,1245242,1245243,1245244,1245245,1245246,1245247,1245248,1245249,1245250,1245251,1245252,1245253,1245254,1245255,1245256,1245257,1245258,1245259,1245260,1245261,1245262,1245263,1245264,1245265,1245266,1245267,1245268,1245269,1245270,1245271,1245272,1245273,1245274,1245275,1245276,1245277,1245278,1245279,1245280,1245281,1245282,1245283,1245284,1245285,1245286,1245287,1245288,1245289,1245290,1245291,1245292,1245294,1245295,1245296,1245297,1245298,1245299,1245300,1245301,1245302,1245303,1245304,1245305,1245306,1245307,1245308,1245309,1245310,1245311,1245312,1245313,1245314,1245316,1245318,1245319,1245320,1245321,1245322,1245324,1245325,1245326,1245327,1245328,1245329,1245330,1245331,1245332,1245333,1245334,1245335,1245336,1245337,1245338,1245339,1245340,1245341,1245342,1245343,1245344,1245345,1245346,1245347,1245348,1245349,1245350,1245351,1245352,1245353,1245354,1245355,1245356,1245357,1245358,1245359,1245360,1245361,1245362,1245363,1245364,1245365,1245366,1245370,1245371,1245372,1245373,1245374,1245375,1245376,1245377,1245378,1245379,1245380,1245381,1245382,1245383,1245384,1245385,1245386,1245387,1245388,1245389,1245390,1245391,1245392,1245393,1245394,1245395,1245396,1245397,1245398,1245399,1245400,1245402,1245403,1245404,1245405,1245406,1245407,1245408,1245409,1245410,1245411,1245412,1245413,1245414,1245415,1245416,1245417,1245418,1245419,1245420,1245421,1245422,1245423,1245424,1245425,1245426,1245427,1245428,1245429,1245430,1245431,1245432,1245433,1245434,1245435,1245436,1245437,1245438,1245439],name:"Network Protocols"},20:{applications:[1310721,1310722,1310723,1310724,1310725,1310726,1310727,1310728,1310729,1310730,1310731,1310732,1310733,1310734,1310735,1310736,1310737,1310738,1310739,1310740,1310741,1310742,1310743,1310744,1310745,1310746,1310747,1310748,1310749,1310750,1310751,1310752,1310753,1310754,1310755,1310756,1310757,1310758,1310759,1310760,1310761,1310762,1310763,1310764,1310765,1310766,1310767,1310768,1310769,1310770,1310771,1310772,1310773,1310774,1310775,1310776,1310777,1310778,1310779,1310780,1310781,1310782,1310783,1310784,1310785,1310786,1310787,1310788,1310789,1310790,1310791,1310792,1310793,1310794,1310795,1310796,1310797,1310798,1310799,1310800,1310801,1310802,1310803,1310804,1310805,1310806,1310807,1310808,1310809,1310810,1310811,1310812,1310813,1310814,1310815,1310816,1310817,1310818,1310819,1310820,1310821,1310822,1310823,1310824,1310825,1310826,1310827,1310828,1310830,1310832,1310833,1310834,1310835,1310836,1310837,1310839,1310840,1310841,1310842,1310843,1310844,1310845,1310846,1310847,1310848,1310849,1310850,1310851,1310852,1310853,1310854,1310855,1310856,1310857,1310858,1310859,1310860,1310861,1310862,1310863,1310864,1310865,1310866,1310867,1310868,1310869,1310870,1310871,1310872,1310873,1310874,1310875,1310878,1310879,1310880,1310881,1310882,1310883,1310884,1310887,1310888,1310889,1310890,1310891,1310892,1310893,1310894,1310895,1310896,1310897,1310898,1310899,1310900,1310902,1310903,1310904,1310905,1310906,1310907,1310908,1310909,1310910],name:"Network Protocols"},21:{applications:[1376306,1376323,1376357,1376359],name:"Mobile"},23:{applications:[1507329,1507330,1507333],name:"Private Protocol"},24:{applications:[1572865,1572866,1572867,1572868,1572870,1572871,1572872,1572873,1572874,1572875,1572876,1572880,1572881,1572882,1572883,1572884,1572885,1572886,1572887,1572889,1572890,1572891,1572892,1572893,1572894,1572895,1572896,1572897,1572898,1572899,1572900,1572901,1572902,1572903,1572905,1572906,1572907,1572908,1572909,1572910,1572911,1572912,1572913,1572914,1572915,1572916,1572917,1572918,1572919,1572920,1572921,1572922,1572923,1572927,1572928,1572929,1572930,1572931,1572967,1572968,1572970,1572974,1572975,1572976,1572977,1572978,1572980,1572981,1572983,1572985,1572987,1572988,1572989,1572990,1572998,1572999,1573e3,1573004,1573005,1573006,1573007,1573008,1573009,1573010,1573011,1573014,1573015,1573016,1573017,1573018,1573019,1573020,1573021,1573022,1573023,1573024,1573025,1573026,1573027,1573028,1573029,1573030,1573031,1573032,1573033,1573035],name:"Social Network"},255:{applications:[65535],name:"Unknown"},28:{applications:[1835009,1835010,1835011,1835012,1835013,1835014,1835015,1835016,1835017,1835018,1835019,1835020,1835021,1835022,1835023,1835024,1835025,1835026,1835027,1835028,1835029,1835030,1835031,1835032,1835033,1835034,1835035,1835036,1835037,1835038,1835039,1835040,1835041,1835042,1835043,1835044,1835045,1835046,1835047,1835048,1835049,1835050,1835051,1835052,1835053,1835054,1835055,1835056,1835057,1835058,1835059,1835060,1835061,1835062,1835063,1835064,1835065,1835066,1835067,1835068,1835069,1835070,1835071,1835072,1835073,1835074,1835075,1835076,1835077,1835078,1835079,1835080,1835081,1835082,1835083,1835084,1835085,1835086,1835087,1835088,1835089,1835090,1835091,1835092,1835093,1835094,1835095,1835096,1835097,1835098,1835099,1835100,1835101,1835102,1835103,1835104,1835105,1835106,1835107,1835108],name:"TopSites-Adult"},29:{applications:[1900545,1900546,1900547,1900548,1900549,1900550,1900551,1900552,1900553,1900554,1900555,1900556,1900557,1900558,1900559,1900560,1900561,1900562,1900563,1900564,1900565,1900566,1900567,1900568,1900569,1900570,1900571,1900572,1900573,1900574,1900575,1900576,1900577,1900578,1900579,1900580,1900581,1900582,1900583,1900584,1900585,1900586,1900587,1900588,1900589,1900590,1900591,1900592,1900593,1900594,1900595,1900596,1900597,1900598,1900599,1900600,1900601,1900602,1900603,1900604,1900605,1900606,1900607,1900608,1900609,1900610,1900611,1900612,1900613,1900614,1900615,1900616,1900617,1900618,1900619,1900620,1900621,1900622,1900623,1900624,1900625,1900626,1900627,1900628,1900629],name:"TopSites-Arts"},3:{applications:[196609,196610,196611,196612,196613,196614,196615,196616,196617,196618,196619,196620,196621,196622,196624,196626,196627,196628,196629,196630,196631,196632,196633,196634,196635,196637,196638,196640,196641,196642,196643,196644,196645,196646,196647,196648,196649,196650,196651,196652,196653,196655,196656,196657,196669,196676,196678,196680,196681,196683,196684,196686,196689,196692,196693,196694,196695,196696,196697,196700,196701,196702,196703,196705,196706,196708,196709,196711,196713,196714,196716,196717,196718,196722,196723,196724,196725,196726,196727,196728,196729,196731,196732,196733,196735,196737,196738,196739,196742,196743,196744,196746,196747,196748,196749,196750,196751,196752,196753,196754,196755,196756,196757,196758,196759,196760,196761,196762,196764,196765,196766,196767,196768,196769,196770,196771,196772,196773,196774,196775,196777],name:"File Transfer"},30:{applications:[1966081,1966082,1966083,1966084,1966085,1966086,1966087,1966088,1966089,1966090,1966091,1966092,1966093,1966094,1966095,1966096,1966097,1966098,1966099,1966100,1966101,1966102,1966103,1966104,1966105,1966106,1966107,1966108,1966109,1966110,1966111,1966112,1966113,1966114,1966115,1966116,1966117,1966118,1966119,1966120,1966121,1966122,1966123,1966124,1966125,1966126,1966127,1966128,1966129,1966130,1966131,1966132,1966133,1966134,1966135,1966136,1966137,1966138,1966139,1966140,1966141,1966142,1966143,1966144,1966145,1966146,1966147,1966148,1966149,1966150,1966151,1966152,1966153,1966154,1966155,1966156,1966157,1966158,1966159,1966160,1966161,1966162,1966163,1966164,1966165,1966166,1966167,1966168,1966169,1966170,1966171,1966172,1966173],name:"TopSites-Business"},31:{applications:[2031617,2031618,2031619,2031620,2031621,2031622,2031623,2031624,2031625,2031626,2031627,2031628,2031629,2031630,2031631,2031632,2031633,2031634,2031635,2031636,2031637,2031638,2031639,2031640,2031641,2031642,2031643,2031644,2031645,2031646,2031647,2031648,2031649,2031650,2031651,2031652,2031653,2031654,2031655,2031656,2031657,2031658,2031659,2031660,2031661,2031662,2031663,2031664,2031665,2031666,2031667,2031668,2031669,2031670,2031671,2031672,2031673,2031674,2031675,2031676,2031677,2031678,2031679,2031680],name:"TopSites-Computers"},32:{applications:[2097153,2097154,2097155,2097156,2097157,2097158,2097159,2097160,2097161,2097162,2097163,2097164,2097165,2097166,2097167,2097168,2097169,2097170,2097171,2097172,2097173,2097174,2097175,2097176,2097177,2097178,2097179,2097180,2097181,2097182,2097183,2097184,2097185,2097186,2097187,2097188,2097189,2097190,2097191,2097192,2097193,2097194,2097195,2097196,2097197,2097198,2097199,2097200,2097201,2097202,2097203,2097204,2097205,2097206,2097207,2097208,2097209,2097210,2097211,2097212,2097213,2097214,2097215,2097216,2097217,2097218,2097219,2097220,2097221,2097222,2097223,2097224,2097225,2097226,2097227,2097228,2097229,2097230,2097231,2097232,2097233,2097234,2097235,2097236,2097237,2097238,2097239,2097240,2097241,2097242,2097243,2097244,2097245,2097246,2097247],name:"TopSites-Games"},33:{applications:[2162689,2162690,2162691,2162692,2162693,2162694,2162695,2162696,2162697,2162698,2162699,2162700,2162701,2162702,2162703,2162704,2162705,2162706,2162707,2162708,2162709,2162710,2162711,2162712,2162713,2162714,2162715,2162716,2162717,2162718,2162719,2162720,2162721,2162722,2162723,2162724,2162725,2162726,2162727,2162728,2162729,2162730,2162731,2162732,2162733,2162734,2162735,2162736,2162737,2162738,2162739,2162740,2162741,2162742,2162743,2162744,2162745,2162746,2162747,2162748,2162749,2162750,2162751,2162752,2162753,2162754,2162755,2162756,2162757,2162758,2162759,2162760,2162761,2162762,2162763,2162764,2162765,2162766,2162767,2162768,2162769,2162770,2162771,2162772,2162773,2162774,2162775,2162776,2162777,2162778,2162779],name:"TopSites-Health"},34:{applications:[2228225,2228226,2228227,2228228,2228229,2228230,2228231,2228232,2228233,2228234,2228235,2228236,2228237,2228238,2228239,2228240,2228241,2228242,2228243,2228244,2228245,2228246,2228247,2228248,2228249,2228250,2228251,2228252,2228253,2228254,2228255,2228256,2228257,2228258,2228259,2228260,2228261,2228262,2228263,2228264,2228265,2228266,2228267,2228268,2228269,2228270,2228271,2228272,2228273,2228274,2228275,2228276,2228277,2228278,2228279,2228280,2228281,2228282,2228283,2228284,2228285,2228286,2228287,2228288,2228289,2228290,2228291,2228292,2228293,2228294,2228295,2228296,2228297,2228298,2228299,2228300,2228301,2228302,2228303,2228304,2228305,2228306,2228307,2228308,2228309,2228310,2228311,2228312,2228313,2228314],name:"TopSites-Home"},35:{applications:[2293761,2293762,2293763,2293764,2293765,2293766,2293767,2293768,2293769,2293770,2293771,2293772,2293773,2293774,2293775,2293776,2293777,2293778,2293779,2293780,2293781,2293782,2293783,2293784,2293785,2293786,2293787,2293788,2293789,2293790,2293791,2293792,2293793,2293794,2293795,2293796,2293797,2293798,2293799,2293800,2293801,2293802,2293803,2293804,2293805,2293806,2293807,2293808,2293809,2293810,2293811,2293812,2293813,2293814,2293815,2293816,2293817,2293818,2293819,2293820,2293821,2293822],name:"TopSites-KidsnTeens"},36:{applications:[2359297,2359298,2359299,2359300,2359301,2359302,2359303,2359304,2359305,2359306,2359307,2359308,2359309,2359310,2359311,2359312,2359313,2359314,2359315,2359316,2359317,2359318,2359319,2359320,2359321,2359322,2359323,2359324,2359325,2359326,2359327,2359328,2359329,2359330,2359331,2359332,2359333,2359334,2359335,2359336,2359337,2359338,2359339,2359340,2359341,2359342,2359343,2359344,2359345,2359346,2359347,2359348,2359349,2359350,2359351,2359352,2359353,2359354,2359355,2359356,2359357,2359358,2359359,2359360,2359361,2359362,2359363,2359364,2359365],name:"TopSites-News"},37:{applications:[2424833,2424834,2424835,2424836,2424837,2424838,2424839,2424840,2424841,2424842,2424843,2424844,2424845,2424846,2424847,2424848,2424849,2424850,2424851,2424852,2424853,2424854,2424855,2424856,2424857,2424858,2424859,2424860,2424861,2424862,2424863,2424864,2424865,2424866,2424867,2424868,2424869,2424870,2424871,2424872,2424873,2424874,2424875,2424876,2424877,2424878,2424879,2424880,2424881,2424882,2424883,2424884,2424885,2424886,2424887,2424888,2424889,2424890,2424891,2424892,2424893,2424894,2424895,2424896,2424897,2424898,2424899,2424900,2424901,2424902,2424903,2424904,2424905,2424906,2424907,2424908,2424909,2424910,2424911,2424912,2424913,2424914,2424915,2424916,2424917,2424918,2424919,2424920],name:"TopSites-Recreation"},38:{applications:[2490369,2490370,2490371,2490372,2490373,2490374,2490375,2490376,2490377,2490378,2490379,2490380,2490381,2490382,2490383,2490384,2490385,2490386,2490387,2490388,2490389,2490390,2490391,2490392,2490393,2490394,2490395,2490396,2490397,2490398,2490399,2490400,2490401,2490402,2490403,2490404,2490405,2490406,2490407,2490408,2490409,2490410,2490411,2490412,2490413,2490414,2490415,2490416,2490417,2490418,2490419,2490420,2490421,2490422,2490423,2490424,2490425,2490426,2490427,2490428,2490429,2490430,2490431,2490432,2490433,2490434,2490435,2490436,2490437,2490438,2490439,2490440,2490441,2490442,2490443,2490444,2490445,2490446,2490447],name:"TopSites-Reference"},39:{applications:[2555905,2555906,2555907,2555908,2555909,2555910,2555911,2555912,2555913,2555914,2555915,2555916,2555917,2555918,2555919,2555920,2555921,2555922,2555923,2555924,2555925,2555926,2555927,2555928,2555929,2555930,2555931,2555932,2555933,2555934,2555935,2555936,2555937,2555938,2555939,2555940,2555941,2555942,2555943,2555944,2555945,2555946,2555947,2555948,2555949,2555950],name:"TopSites-Regional"},4:{applications:[262145,262146,262147,262148,262149,262150,262151,262152,262153,262154,262155,262156,262157,262158,262159,262160,262161,262162,262163,262164,262165,262166,262167,262168,262169,262170,262171,262172,262173,262174,262175,262176,262177,262178,262179,262181,262182,262183,262184,262185,262186,262187,262188,262189,262190,262191,262192,262193,262194,262195,262196,262197,262198,262199,262200,262201,262202,262203,262204,262205,262207,262208,262209,262210,262211,262212,262213,262214,262215,262216,262217,262218,262219,262220,262221,262223,262224,262226,262227,262228,262229,262230,262231,262232,262233,262234,262235,262236,262237,262238,262239,262245,262246,262247,262250,262251,262252,262254,262256,262258,262259,262260,262261,262262,262263,262264,262265,262266,262267,262268,262270,262271,262272,262274,262275,262276,262277,262278,262279,262280,262281,262283,262284,262285,262286,262287,262288,262290,262291,262292,262293,262294,262295,262296,262298,262301,262302,262303,262305,262306,262308,262310,262311,262312,262313,262314,262315,262316,262317,262318,262319,262320,262321,262322,262323,262324,262325,262326,262327,262328,262329,262330,262331,262332,262333,262334,262335,262336,262337,262338,262339,262340,262341,262342,262343,262344,262345,262346,262347,262348,262349],name:"Streaming Media"},40:{applications:[2621441,2621442,2621443,2621444,2621445,2621446,2621447,2621448,2621449,2621450,2621451,2621452,2621453,2621454,2621455,2621456,2621457,2621458,2621459,2621460,2621461,2621462,2621463,2621464,2621465,2621466,2621467,2621468,2621469,2621470,2621471,2621472,2621473,2621474,2621475,2621476,2621477,2621478,2621479,2621480,2621481,2621482,2621483,2621484,2621485,2621486,2621487,2621488,2621489,2621490,2621491,2621492,2621493,2621494,2621495,2621496,2621497,2621498,2621499,2621500,2621501,2621502,2621503],name:"TopSites-Science"},41:{applications:[2686977,2686978,2686979,2686980,2686981,2686982,2686983,2686984,2686985,2686986,2686987,2686988,2686989,2686990,2686991,2686992,2686993,2686994,2686995,2686996,2686997,2686998,2686999,2687e3,2687001,2687002,2687003,2687004,2687005,2687006,2687007,2687008,2687009,2687010,2687011,2687012,2687013,2687014,2687015,2687016,2687017,2687018,2687019,2687020,2687021,2687022,2687023,2687024,2687025,2687026,2687027,2687028,2687029,2687030,2687031,2687032,2687033,2687034,2687035,2687036,2687037,2687038,2687039,2687040,2687041,2687042,2687043,2687044,2687045,2687046,2687047,2687048,2687049,2687050,2687051,2687052,2687053,2687054,2687055,2687056],name:"TopSites-Shopping"},42:{applications:[2752513,2752514,2752515,2752516,2752517,2752518,2752519,2752520,2752521,2752522,2752523,2752524,2752525,2752526,2752527,2752528,2752529,2752530,2752531,2752532,2752533,2752534,2752535,2752536,2752537,2752538,2752539,2752540,2752541,2752542,2752543,2752544,2752545,2752546,2752547,2752548,2752549,2752550,2752551,2752552,2752553,2752554,2752555,2752556,2752557,2752558,2752559,2752560,2752561,2752562,2752563,2752564,2752565,2752566,2752567,2752568,2752569,2752570,2752571,2752572,2752573,2752574,2752575,2752576,2752577,2752578,2752579,2752580,2752581,2752582,2752583,2752584,2752585,2752586,2752587,2752588,2752589,2752590,2752591],name:"TopSites-Society"},43:{applications:[2818049,2818050,2818051,2818052,2818053,2818054,2818055,2818056,2818057,2818058,2818059,2818060,2818061,2818062,2818063,2818064,2818065,2818066,2818067,2818068,2818069,2818070,2818071,2818072,2818073,2818074,2818075,2818076,2818077,2818078,2818079,2818080,2818081,2818082,2818083,2818084,2818085,2818086,2818087,2818088,2818089,2818090,2818091,2818092,2818093,2818094,2818095,2818096,2818097,2818098,2818099,2818100,2818101,2818102],name:"TopSites-Sports"},5:{applications:[327681,327682,327683,327684,327685,327686,327687,327689,327690,327691,327692,327693,327694,327695,327696,327697,327698,327699,327700,327701,327702,327703,327704,327705,327706,327707,327708,327709,327710,327711,327712,327713,327714,327715,327716,327717,327718,327720,327722,327723,327732,327742,327743,327744,327745,327746,327747,327749,327751,327753,327755,327760,327761,327762,327763,327764,327770,327774,327775,327776,327778,327779,327780,327781,327782,327783,327784,327785,327786,327787,327788,327789,327790,327791,327792,327793,327794,327795],name:"Mail and Collaboration"},6:{applications:[393217,393218,393220,393221,393222,393223,393225,393226,393228,393229,393230,393231,393232,393234,393235,393236,393238,393239,393240,393242,393243,393244,393246,393247],name:"Voice over IP"},7:{applications:[458753,458754,458755,458756,458757,458760,458761,458763,458766,458767,458768],name:"Database"},8:{applications:[524289,524290,524291,524292,524293,524294,524295,524296,524297,524298,524299,524300,524301,524302,524303,524304,524306,524307,524308,524310,524311,524312,524313,524314,524315,524316,524317,524318,524319,524320,524321,524322,524323,524324,524326,524327,524328,524329,524330,524331,524332,524333,524334,524335,524336,524337,524338,524339,524340,524341,524343,524344,524345,524346,524347,524348,524349,524350,524351,524352,524353,524354,524355,524356,524358,524359,524360,524361,524362,524363,524364,524365,524366,524367,524368,524369,524370,524371,524372,524373,524374,524375,524376,524377,524379,524380,524381,524383,524384,524385,524386,524388,524389,524390,524391,524392,524393,524394,524395,524396,524398,524399,524400,524401,524402,524403,524404,524405,524406,524407,524408,524409,524410,524411,524412,524413,524414,524415,524416,524417,524418,524419,524420,524421,524422,524423,524424,524425,524426,524427,524428,524429,524430,524431,524432,524433,524434,524435,524436,524437,524438,524439,524440,524441,524442,524443,524444,524445,524446,524447,524448,524449,524450,524451,524452,524453,524454,524455,524456,524457,524458,524459,524460,524461,524462,524463,524466,524479,524491,524512,524513,524514,524515,524516,524517,524518,524519,524520,524521,524522,524523,524524,524525,524526,524527,524529,524530,524531,524532,524533,524534,524535,524536,524537,524538,524539,524540,524541,524542,524543],name:"Games"},9:{applications:[589828,589829,589885,589888,589890,589916,589933,589934,589942,589951],name:"Network Management"}},version:{major:1,minor:52}}}),define("unifi/model/GatewayDpi",["unifi/model/Model","jquery","underscore","unifi/util/DpiRuleMap","unifi/util/DpiIconMap","msg/Msg"],function(e,t,i,a,n,o){"use strict";return e.extend({otherBytesMaximumPercent:.05,parseData:function(){this.set({by_cat:this.sortData(this.get("by_cat")),by_app:this.sortData(this.get("by_app")),by_cat_total:this.totalCategoryData(this.get("by_cat")),by_app_total:this.totalApplicationData(this.get("by_app"))},{silent:!0}),this.set({by_cat_other:this.totalCategoryData(this.get("by_cat"),this.otherBytesMaximumPercent),by_app_other:this.totalApplicationData(this.get("by_app"),this.otherBytesMaximumPercent)},{silent:!0})},getName:function(e,t){var i=t.cat&&t.app?65536*t.cat+t.app:t.cat,n="by_cat"==e?"categories":"applications",r=a[n][i],s=r?r.name:"("+o.G_Unknown.toLowerCase()+")",c=t.name||s;return c},getIconUrl:function(e,t){var i=t.cat&&t.app?65536*t.cat+t.app:t.cat,a="by_cat"==e?"categories":"applications",o=n[a][i];return o?o.iconUrl:null},sortData:function(e){return i.sortBy(e,function(e){return-((e.tx_bytes||0)+(e.rx_bytes||0))})},totalCategoryData:function(e,t){return i.reduce(e,function(e,i){var a,n;return void 0!==t&&(a=this.get("by_cat_total"),n=(a.rx_bytes+a.tx_bytes)*t,e.name=o.G_Other),(void 0===n||i.tx_bytes+i.rx_bytes<n)&&(e.tx_bytes+=i.tx_bytes||0,e.rx_bytes+=i.rx_bytes||0,e.tx_packets+=i.tx_packets||0,e.rx_packets+=i.rx_packets||0,void 0!==t&&(e.isGrouped=!0)),e},{tx_bytes:0,rx_bytes:0,tx_packets:0,rx_packets:0},this)},totalApplicationData:function(e,t){return i.reduce(e,function(e,i){var a,n,r=i.cat;return void 0!==t&&(a=this.get("by_app_total")[r],n=(a.rx_bytes+a.tx_bytes)*t),(void 0===n||i.tx_bytes+i.rx_bytes<n)&&(e[r]?(e[r].apps.push(i.app),e[r].tx_bytes+=i.tx_bytes||0,e[r].rx_bytes+=i.rx_bytes||0,e[r].tx_packets+=i.tx_packets||0,e[r].rx_packets+=i.rx_packets||0):(e[r]={},e[r].cat=Number.MAX_VALUE,e[r].apps=[i.app],e[r].tx_bytes=i.tx_bytes||0,e[r].rx_bytes=i.rx_bytes||0,e[r].tx_packets=i.tx_packets||0,e[r].rx_packets=i.rx_packets||0,e[r].name=o.G_Other),void 0!==t&&(e[r].isGrouped=!0)),e},{},this)}})}),define("unifi/view/dashboard/DpiDashboardOverlayView",["backbone","underscore","msg/Msg","jquery","libs/d3","unifi/model/GatewayDpi","libs/backgrid","ubnt/backgrid"],function(e,t,i,a,n,o,r,s){"use strict";return e.View.extend({initialize:function(e){this.app=e.app,this.parentView=e.parentView,this.gatewayDevice=e.gatewayDevice,this.width=374,this.height=374,this.parentWidth=this.parentView.$el.width(),this.parentHeight=this.parentView.$el.height(),this.chartInnerRadius=this.parentWidth/2+15,this.chartOuterRadius=this.parentWidth/2+35,this.render()},render:function(){var e=this;if(!this.rendered&&(this.rendered=!0)){var t=-(this.width/2-this.parentWidth/2),i=-(this.height/2-this.parentHeight/2);this.$el=a('<div class="dpi-chart"></div>').css({width:this.width+"px",height:this.height+"px",left:t+"px",top:i+"px"}),this.svgContainer=n.select(this.$el.get(0)).append("svg").attr("id","dpi-dashboard-overlay").attr("width",this.width).attr("height",this.height),this.parentView.$el.append(this.$el),this.$labels=a('<div class="labels"></div>'),this.$tooltips=a('<div class="tooltips"></div>'),this.$centerLabel=a('<div class="centerDiv"><div class="percent"></div><div class="name"></div></div>'),this.$centerLabel.hide(),this.$el.append(this.$labels),this.$el.append(this.$tooltips),this.$el.append(this.$centerLabel),this.$tooltips.on("click",".tooltip",function(t){return"true"!=a(this).attr("data-grouped")?(this.categoryIndex=a(this).attr("data-cat"),this.categoryName=a(this).find("span.name").text(),this.categoryPercent=a(this).find("span.percent").text(),this.applicationIndex=a(this).attr("data-app"),this.applicationIndex>=0?void e.app.routers.devices.views.index.property(e.gatewayDevice,{section:"dpi",cat:this.categoryIndex,app:this.applicationIndex}):void e.renderChart(this.categoryIndex,this.categoryName,this.categoryPercent)):void 0}),this.$centerLabel.on("click",function(t){e.resetChart()}),this.hide()}},resetChart:function(){this.categoryIndex=void 0,this.categoryName=void 0,this.categoryPercent=void 0,
this.applicationIndex=void 0,this.renderChart()},getDataSet:function(e,i,a){var n=e?t.where(this.model.get(i),{cat:+a}):this.model.get(i);n||this.resetChart();var o=e?this.model.get(i+"_other")[+a]:this.model.get(i+"_other"),r=e?this.model.get(i+"_total")[a]:this.model.get(i+"_total"),s=r?(r.rx_bytes+r.tx_bytes)*this.model.otherBytesMaximumPercent:null,c=t.filter(n,function(e){return e.rx_bytes+e.tx_bytes>=s});return o&&c.push(o),c},renderChart:function(e,t,i){var o=this,r=void 0!==e,c=r?"by_app":"by_cat",l=this.getDataSet(r,c,e);l||this.resetChart();var d=r?this.model.get(c+"_total")[e]:this.model.get(c+"_total"),m=(d.rx_bytes||0)+(d.tx_bytes||0),u=0,h=!1;this.$labels.empty(),this.$tooltips.empty(),r?(this.$centerLabel.find(".name").text(t),this.$centerLabel.find(".percent").text(i+"%"),this.$centerLabel.show()):(this.$centerLabel.find(".name").text(""),this.$centerLabel.find(".percent").text(""),this.$centerLabel.hide()),this.circle||(this.circle=this.svgContainer.append("g").append("circle").attr("cx",this.width/2).attr("cy",this.width/2).attr("r",140).attr("fill","none").attr("stroke","rgb(180, 180, 180)").attr("stroke-width",5).attr("stroke-linecap","round").attr("stroke-dasharray","1, 10")),this.pieChart&&this.pieChart.remove(),this.pieChart=this.svgContainer.append("g").attr("class","arcs").attr("transform","translate("+this.width/2+","+this.height/2+")");var g=n.svg.arc().outerRadius(this.chartOuterRadius).innerRadius(this.chartInnerRadius),p=n.layout.pie().sort(null).value(function(e){return e.rx_bytes+e.tx_bytes}),y=this.pieChart.selectAll(".arc").data(p(l)).enter().append("g").attr("class","arc"),f=function(e){var t,i,n=20,r=20,s=g.centroid(e),l=s[0],m=s[1],u=Math.sqrt(l*l+m*m),h=o.chartOuterRadius+r+2,p=l/u*h,y=m/u*h,f=e.data,_=o.model.getIconUrl(c,e.data),v=((f.tx_bytes||0)+(f.rx_bytes||0))/(d.tx_bytes+d.rx_bytes),b=(100*v).toFixed(0);g.centroid(e);return 1>b&&(b="< 1"),0>p&&(p-=n),0>y&&(y-=r),t=a('<div class="label"></div').attr("data-grouped",f.isGrouped).attr("data-cat",f.cat).attr("data-app",f.app||null).css({width:n+"px",height:r+"px",left:p+"px",top:y+"px"}),_?t.addClass("icon").css({background:"url("+_+")"}):(i=a("<div></div>").text(b+"% "),t.append(i)),o.$labels.prepend(t),t},_=function(e){var t,i,n,r,l,m=200,u=32,h=g.centroid(e),p=h[0],y=h[1],f=Math.sqrt(p*p+y*y),_=o.chartOuterRadius+u/2,v=p/f*_,b=y/f*_,w=e.data,S=s.Formatters.Bytes.fromRaw((w.rx_bytes||0)+(w.tx_bytes||0)),C=s.Formatters.Bytes.fromRaw(w.rx_bytes||0),x=s.Formatters.Bytes.fromRaw(w.tx_bytes||0),k=((w.tx_bytes||0)+(w.rx_bytes||0))/(d.tx_bytes+d.rx_bytes),P=(100*k).toFixed(1),M=(g.centroid(e),o.model.getName(c,e.data)),T=o.model.getIconUrl(c,e.data),D=!1;return 1>P&&(P="< 1"),0>v&&(v-=m,D=!0),0>b&&(b-=u),t=a('<div class="tooltip"></div').attr("data-cat",w.cat).attr("data-app",w.app||null).css({width:m+"px",height:u+"px",left:v+"px",top:b+"px"}),w.isGrouped&&t.css({cursor:"default"}),T&&(i=a('<div class="tooltipIcon"></div>').css({background:'url("'+T+'")'})),n=a('<div class="tooltipText"></div').css({width:m-u-5+"px",height:u+"px","float":T||D?"right":"left"}),r=a("<div></div>").html('<span class="percent">'+P+'</span>% <span class="name">'+M+"</span>"),l=a("<div></div>").html('<span class="totalBytes">'+S+'</span> (    <span class="ubnt-icon-arrow-down"></span>     <span class="rxBytes">'+C+'</span>      <span class="ubnt-icon-arrow-up"></span>     <span class="txBytes">'+x+"</span>)"),n.append(r),n.append(l),t.append(i),t.append(n),o.$tooltips.append(t),t};y.append("path").attr("d",g).attr("data-percent",function(e){var t=e.data,i=(t.rx_bytes||0)+(t.tx_bytes||0),a=i/m,n=(100*a).toFixed(1);return n}).style("fill",function(e){var t=e.data,i=((t.rx_bytes||0)+(t.tx_bytes||0),110+10*u++);return i>200&&(i=200),h||(h=!0,n.select(this.parentNode).attr("class","arc selected"),_(e)),t.isGrouped&&n.select(this).style("cursor","default"),f(e),"rgb("+i+","+i+","+i+")"}).on("mouseover",function(e){y.attr("class",null).attr("class","arc"),n.select(this.parentNode).attr("class","arc selected"),o.$tooltips.empty(),_(e)}).on("click",function(e){return e.data.isGrouped?void 0:(o.categoryIndex=e.data.cat,o.categoryName=o.model.getName(c,e.data),o.categoryPercent=a(this).attr("data-percent"),o.applicationIndex=e.data.app||void 0,o.applicationIndex>=0?void o.app.routers.devices.views.index.property(o.gatewayDevice,{section:"dpi",cat:o.categoryIndex,app:o.applicationIndex}):void o.renderChart(o.categoryIndex,o.categoryName,o.categoryPercent))})},setData:function(e){e&&(this.model||(this.model=new o),this.model.set({by_cat:e.by_cat||[],by_app:e.by_app||[]},{silent:!0}),this.model.parseData(),this.renderChart(this.categoryIndex,this.categoryName,this.categoryPercent))},clearData:function(e){this.$("#dpi-dashboard-overlay").empty(),this.$labels.empty(),this.$tooltips.empty(),this.$centerLabel.find("div").empty(),this.$centerLabel.hide(),this.circle=void 0,this.categoryIndex=void 0,this.categoryName=void 0,this.categoryPercent=void 0,this.applicationIndex=void 0},show:function(){this.$el.show()},hide:function(){this.$el.hide()},remove:function(){this.clearData(),this.$tooltips&&this.$tooltips.off("click",".tooltip"),this.$centerLabel.off("click"),this.rendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("unifi/view/dashboard/LayerView",["unifi/view/dashboard/LayerView","backbone","underscore","jquery","text!includes/dashboard/dashboardTableItemTemplate.html","text!includes/dashboard/dashboardStatRowTemplate.html","msg/Msg","unifi/model/Subsystem","unifi/view/dashboard/DpiDashboardOverlayView"],function(e,t,i,a,n,o,r,s,c){"use strict";return t.View.extend({initialize:function(e){i.bindAll(this),this.dashboardTable=a("#dashboardTable"),this.tableItemTemplate=i.template(n),this.model=e.model,this.app=e.app,this.$notifications=this.$(".drop-count").on("click",this.viewNotifications),this.$el.on("mouseover",this.mouseoverLayer),this.$el.on("mouseout",this.mouseoutLayer),this.render()},render:function(){var e=this,t=this.model.get("subsystem");if(!this.rendered&&(this.rendered=!0)){this.gatewayDevice=this.app.collection("Devices").where({type:"ugw",site_id:SITE.id}),this.gatewayDevice.length&&(this.gatewayDeviceModel=this.gatewayDevice[0]),this.dashboardTable.append(this.tableItemTemplate(i.extend(this.model.toJSON(),{icon:this.model.icon(),stats:this.model.stats(),state:this.model.state(),configureLink:i.isFunction(this.model.get("configureLink")),statsLink:i.isFunction(this.model.get("statsLink")),msg:r}))),this.configureLink=this.model.get("configureLink"),this.statsLink=this.model.get("statsLink"),this.$tableItem=this.dashboardTable.find(".table-item."+t),this.$tableItem.on("mouseover",this.mouseoverLayer),this.$tableItem.on("mouseout",this.mouseoutLayer),this.$tableItem.find(".btn-stats").on("click",this.clickStats),this.$tableItem.find(".btn-configure").on("click",this.clickConfigure);this.$el.find(".inner").eq(0);"wan"===this.model.get("subsystem")&&this.gatewayDevice.length&&(this.addDpi(),this.listenTo(this.app.collection("Devices"),"remove",function(t,i){e.gatewayDeviceModel&&"ugw"==t.get("type")&&t.get("site_id")==SITE.id&&(e.removeDpi(),e.gatewayDeviceModel=null)}),this.listenTo(this.app.collection("Devices"),"add change",function(t,i){e.gatewayDeviceModel||"ugw"!=t.get("type")||t.get("site_id")!=SITE.id||(e.gatewayDeviceModel=t,e.addDpi())})),this.updateNotifications(),this.updateState()}return this},removeDpi:function(){this.gatewayDeviceModel&&this.gatewayDeviceModel.off("change:dpistats_table",this.updateDpiData),this.dpiDashboardOverlayView&&(this.$el.off("mouseover",this.dpiDashboardOverlayView.show.bind(this.dpiDashboardOverlayView)),this.$el.off("mouseout",this.dpiDashboardOverlayView.hide.bind(this.dpiDashboardOverlayView)),this.$tableItem.off("mouseover",this.dpiDashboardOverlayView.show.bind(this.dpiDashboardOverlayView)),this.$tableItem.off("mouseout",this.dpiDashboardOverlayView.hide.bind(this.dpiDashboardOverlayView)),this.dpiDashboardOverlayView.remove())},addDpi:function(){this.dpiDashboardOverlayView=new c({parentView:this,gatewayDevice:this.gatewayDeviceModel,app:this.app}),this.gatewayDeviceModel.on("change:dpistats_table",this.updateDpiData),this.$el.on("mouseover",this.dpiDashboardOverlayView.show.bind(this.dpiDashboardOverlayView)),this.$el.on("mouseout",this.dpiDashboardOverlayView.hide.bind(this.dpiDashboardOverlayView)),this.$tableItem.on("mouseover",this.dpiDashboardOverlayView.show.bind(this.dpiDashboardOverlayView)),this.$tableItem.on("mouseout",this.dpiDashboardOverlayView.hide.bind(this.dpiDashboardOverlayView)),this.updateDpiData()},updateDpiData:function(){var e=this.gatewayDeviceModel&&this.gatewayDeviceModel.get("dpistats_table")||null;e&&e.by_cat&&e.by_cat.length&&e.by_app&&e.by_app.length?this.dpiDashboardOverlayView&&this.dpiDashboardOverlayView.setData(e):this.dpiDashboardOverlayView&&this.dpiDashboardOverlayView.clearData()},update:function(e){this.model&&e&&(this.model.clear({silent:!0}),this.model=new s(e.toJSON())),this.updateState(),this.updateStats(),this.updateNotifications()},updateState:function(){var e=this.model.state(),t=this.model.possibleStates;this.$el.removeClass(t.join(" ")).addClass(e),this.$tableItem.removeClass(t.join(" ")).addClass(e);var i=this.$tableItem.find(".state");i.removeClass(t.join(" ")).addClass(e),i.text(r[this.model.get("status_text")])},updateStats:function(){var e=this.model.stats(),t=this.$tableItem.find(".stats"),a=this.$tableItem.find(".no-data");if(e?(t.empty().removeClass("hidden"),a.addClass("hidden"),i.each(e,function(e){t.append(i.template(o,e))},this)):(t.empty().addClass("hidden"),a.removeClass("hidden")),"wan"===this.model.get("subsystem")){var n=this.model.get("gw_mac")?!0:!1;this.$tableItem.find(".btn-configure").toggle(n)}},updateNotifications:function(){var e=i.size(this.model.get("notifications"));e>0?this.showNotifications():this.hideNotifications();var t=this.$notifications.find(".count");parseInt(t.text(),10)<e&&this.$notifications.effect("shake",{direction:"up",times:1,distance:5},300),t.text(e)},showNotifications:function(){this.$notifications.show()},hideNotifications:function(){this.$notifications.hide()},viewNotifications:function(){var e=this.model.get("subsystem"),t=a("#panelAlerts"),i=t.is(":visible");i||a("#toggleAlerts").click(),t.find(".data-filters").find('input[value="'+e+'"]').click()},mouseoverLayer:function(){this.$el.addClass("over"),this.$tableItem.addClass("over")},mouseoutLayer:function(){this.$el.removeClass("over"),this.$tableItem.removeClass("over")},clickStats:function(){return this.statsLink&&this.statsLink.call(this),!1},clickConfigure:function(){return this.configureLink&&this.configureLink.call(this),!1},remove:function(){this.$(".drop-count").off("click",this.viewNotifications),this.$el.off("mouseover",this.mouseoverLayer),this.$el.off("mouseout",this.mouseoutLayer),this.gatewayDeviceModel&&this.gatewayDeviceModel.off("change:dpistats_table",this.updateDpiData),this.$el.off("mouseover",this.dpiDashboardOverlayView.show.bind(this.dpiDashboardOverlayView)),this.$el.off("mouseout",this.dpiDashboardOverlayView.hide.bind(this.dpiDashboardOverlayView)),this.$tableItem.off("mouseover",this.dpiDashboardOverlayView.show.bind(this.dpiDashboardOverlayView)),this.$tableItem.off("mouseout",this.dpiDashboardOverlayView.hide.bind(this.dpiDashboardOverlayView)),this.dpiDashboardOverlayView&&this.dpiDashboardOverlayView.remove(),this.stopListening(this.app.collection("Devices"),"remove"),this.stopListening(this.app.collection("Devices"),"add change"),this.rendered=!1,t.View.prototype.remove.apply(this,arguments)}})}),define("unifi/collection/Subsystems",["unifi/collection/Collection","backbone","unifi/model/Subsystem","ubnt/backgrid"],function(e,t,i,a){"use strict";return e.extend({model:i,bySite:!0,possibleSubsystems:["www","wan","lan","wlan"],url:function(){return"/api/s/"+SITE.name+"/stat/health"},getSubsystem:function(e){return this.findWhere({subsystem:e})}})}),define("unifi/model/SpeedTest",["unifi/model/Model","backbone","underscore","msg/Msg","libs/moment"],function(e,t,i,a,n){"use strict";return e.extend({isTesting:!1,speedtestIndex:1,speedtestMaxIndex:11,download_id:0,upload_id:0,download_array:[],upload_array:[],download_arrayIndex:0,upload_arrayIndex:0,download_value:0,upload_value:0,sync:function(e,i,a){var n=[];switch(a=a||{},a._method&&(e=a._method,delete a._method),e){case"read":if(a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/cmd/devmgr",this.isTesting&&(a.url="/data/speedtest/"+this.speedtestIndex+".json"),a.type="POST",a.data=JSON.stringify({cmd:"speedtest-status"}),1===this.getStatus("download")){if(this.download_arrayIndex<this.download_array.length){if(n=this.download_array[this.download_arrayIndex],void 0===n){this._increaseTestIndex();break}return this.download_value=n[1]/100,this.set("xput_download",this.download_value),void this.download_arrayIndex++}this._increaseTestIndex();break}if(1===this.getStatus("upload")){if(this.upload_arrayIndex<this.upload_array.length){if(n=this.upload_array[this.upload_arrayIndex],void 0===n){this._increaseTestIndex();break}return this.upload_value=n[1]/100,this.set("xput_upload",this.upload_value),void this.upload_arrayIndex++}this._increaseTestIndex();break}this._increaseTestIndex();break;case"start":this.initializeProgressRecords(),a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/cmd/devmgr",a.type="POST",a.data=JSON.stringify({cmd:"speedtest"})}return t.sync.call(this,e,i,a)},_increaseTestIndex:function(){this.isTesting&&(this.speedtestIndex++,this.speedtestIndex>this.speedtestMaxIndex&&(this.speedtestIndex=1))},clearArray:function(e){for(;e.length;)e.pop()},initializeProgressRecords:function(){var e=this;i.each(["download","upload"],function(t){e[t+"_id"]=0,e[t+"_value"]=0,e[t+"_arrayIndex"]=0,e.clearArray(e[t+"_array"])})},getStatus:function(e){return e?this.get("status_"+e):this.get("summary_status")},getResult:function(e){switch(e){case"ping":return this.getPing();case"download":return this.getDownloadSpeed();case"upload":return this.getUploadSpeed()}},getPing:function(){return parseInt(this.get("latency")||0,10)},getUploadSpeed:function(){return parseFloat(this.upload_value||this.get("xput_upload")||0).toFixed(2)},getDownloadSpeed:function(){return parseFloat(this.download_value||this.get("xput_download")||0).toFixed(2)},getLastRun:function(){return n(this.get("rundate"),"X").format("YYYY/MM/DD HH:mm:ss")},getProgressRecords:function(){var e=this,t=[];i.each(["download","upload"],function(a){t=e.get(a+"-progress"),i.each(t,function(t){t.id>e[a+"_id"]&&(e[a+"_id"]=t.id,e[a+"_array"]=e[a+"_array"].concat(t.records))})})},convertToMbps:function(e){return e/100},convertMbpsToPercentage:function(e,t){var i=this.convertToMbps(e);return i>t&&(i=t),i/t*100}})}),define("unifi/model/Event",["unifi/model/Model","underscore"],function(e,t){"use strict";return e.extend({toSearch:function(){var e,i,a={};return(e=this.attributes.msg.match(/([a-z0-9\-]{2,})/gi))&&t.each(e,function(e,t){a["word"+t]=e}),(i=this.attributes.msg.match(/(([0-9A-F]{2}:){5}([0-9A-F]{2}))/gi))&&t.each(i,function(e,t){a["mac"+t]=e}),a}})}),define("unifi/model/Alert",["unifi/model/Event","backbone"],function(e,t){"use strict";return e.extend({archive:function(e){return this.sync("archive",this,e)},sync:function(e,i,a){switch(a=a||{},e){case"archive":a.url="/api/s/"+SITE.name+"/cmd/evtmgr",a.contentType="application/json; charset=utf-8",a.type="POST",a.data=JSON.stringify({_id:i.id,cmd:"archive-alarm"})}return t.sync.call(this,e,i,a)}})}),define("unifi/collection/Alerts",["unifi/collection/Collection","backbone","unifi/model/Alert","libs/moment","underscore"],function(e,t,i,a,n){"use strict";return e.extend({model:i,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/list/alarm"},comparator:function(e){return-a(e.get("datetime"))},parse:function(t,i){return n.filter(e.prototype.parse.call(this,t,i),function(e){return!!e.msg})},archiveAll:function(e){return this.sync("archive-all",this,e)},archived:function(e){return this.fetch(n.extend(e,{_method:"read-archived"}))},unarchived:function(e){return this.fetch(n.extend(e,{_method:"read-unarchived"}))},sync:function(e,i,a){switch(a=a||{},a._method&&(e=a._method,delete a._method),e){case"read":a.url="/api/s/"+SITE.name+"/list/alarm",a.contentType="application/json; charset=utf-8",a.type="POST",a.data=JSON.stringify({_sort:"-time"});break;case"read-archived":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/list/alarm",a.type="POST",a.data=JSON.stringify({_sort:"-time",archived:!0});break;case"read-unarchived":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/list/alarm",a.type="POST",a.data=JSON.stringify({_sort:"-time",archived:!1});break;case"archive-all":a.url="/api/s/"+SITE.name+"/cmd/evtmgr",a.contentType="application/json; charset=utf-8",a.type="POST",a.data=JSON.stringify({cmd:"archive-all-alarms"})}return t.sync.call(this,e,i,a)}})}),define("unifi/model/PortModel",["unifi/model/Model","underscore","backbone","msg/Msg","app","ubnt/backgrid"],function(e,t,i,a,n,o){"use strict";return e.extend({diagramClasses:function(){var e=[];return this.get("poe_enable")&&e.push("poe"),"mirror"==this.get("op_mode")&&e.push("mirror"),this.get("enable")||e.push("shutdown"),this.get("up")&&(e.push("up"),1e3==this.get("speed")?e.push("green"):(100==this.get("speed")||10==this.get("speed"))&&e.push("orange"),"discarding"==this.get("stp_state")&&e.push("block")),e.join(" ")},diagramTooltip:function(){var e="<table>",t=this.portIdxText(),i=this.get("name"),n=this.get("media"),r=this.statusText(),s=this.get("tx_bytes")&&o.Formatters.Bytes.fromRaw(this.get("tx_bytes")),c=this.get("rx_bytes")&&o.Formatters.Bytes.fromRaw(this.get("rx_bytes")),l=this.poeModeText(),d=this.networksVlansText(),m='<tr class="table-row"><td class="column-name">{1}</td><td class="column-value">{2}</td></tr>';if(t&&(e+=a.localize(m,a.G_Port,t)),i&&(e+=a.localize(m,a.G_Name,i)),r&&(e+=a.localize(m,a.G_Status,r)),s&&(e+=a.localize(m,a.G_DevicesTX,s)),c&&(e+=a.localize(m,a.G_DevicesRX,c)),l&&(e+=a.localize(m,a.G_PropertiesPoE,l)),d&&(e+=a.localize(m,a.G_PropertiesNetworksVLANs,d)),("SFP"===n||"SFP+"===n)&&this.get("sfp_found")){var u=this.get("sfp_vendor"),h=this.get("sfp_serial"),g=this.get("sfp_part"),p=this.get("sfp_rev"),y=this.get("sfp_compliance"),f=this.get("sfp_voltage"),_=this.get("sfp_current"),v=this.get("sfp_txpower"),b=this.get("sfp_rxpower"),w=this.get("sfp_temperature"),S=this.get("sfp_txfault"),C=this.get("sfp_rxfault");u&&(e+=a.localize(m,a.G_PropertiesSFPVendor,u)),h&&(e+=a.localize(m,a.G_PropertiesSFPSerial,h)),g&&(e+=a.localize(m,a.G_PropertiesSFPPartNum,g)),p&&(e+=a.localize(m,a.G_PropertiesSFPRev,p)),y&&(e+=a.localize(m,a.G_PropertiesSFPCompliance,y)),f&&(e+=a.localize(m,a.G_PropertiesSFPVoltage,f)),_&&(e+=a.localize(m,a.G_PropertiesSFPCurrent,_)),w&&(e+=a.localize(m,a.G_Temperature,w+a.G_DegreeCelsius)),v&&(e+=a.localize(m,a.G_PropertiesSFPOutputPower,v)),b&&(e+=a.localize(m,a.G_PropertiesSFPInputPower,b)),S&&(e+=a.localize(m,a.G_PropertiesSFPTXError,S)),C&&(e+=a.localize(m,a.G_PropertiesSFPRXError,C))}return e+="</table>"},portIdxText:function(){var e=this.get("port_idx");return this.get("masked")?"":("aggregate"==this.get("op_mode")&&(e+="-"+(parseInt(e,10)+parseInt(this.get("aggregate_num_ports")-1,10))),e)},statusText:function(){if(this.get("up")){var e=this.get("speed");return e+=" ",e+=this.get("full_duplex")?a.G_PropertiesFullDuplexAbbrv:a.G_PropertiesHalfDuplexAbbrv,this.get("is_uplink")&&(e+=" ("+a.G_PropertiesUplink+")"),"discarding"==this.get("stp_state")&&(e+=" ("+a.G_PropertiesBlocked+")"),e}return""},poeModeText:function(){if(!this.get("port_poe"))return"";if("switch"!==this.get("op_mode")||this.get("masked"))return"";var e=this.get("poe_mode");return"auto"===e&&this.get("poe_enable")?this.get("poe_power")+"w":"auto"===e?a.G_PropertiesPoEModePoEPlus:"pasv24"===e?a.G_PropertiesPoEModePassive:e},networksVlansText:function(){if(this.get("aggregated_by"))return a.G_PropertiesAggregatedByPort+" "+this.get("aggregated_by");if("mirror"==this.get("op_mode"))return a.G_PropertiesMirroringPort+" "+this.get("mirror_port_idx");var e=this.get("portconf_id");if(e){var t=n.collection("PortConf").get(e);if(t)return t.get("name")}}})}),define("unifi/model/Device",["unifi/model/Model","unifi/model/PortModel","jquery","backbone","ubnt/backgrid","msg/Msg","underscore","libs/moment","ubnt/ubnt.ip"],function(e,t,i,a,n,o,r,s){"use strict";return e.extend({typeMap:{gateway:"ugw","switch":"usw",ap:"uap",phone:"uph"},copyConfigMap:{US24:["US24P250","US24P500"],US24P250:["US24","US24P500"],US24P500:["US24","US24P250"],US48:["US48P500","US48P750"],US48P500:["US48","US48P750"],US48P750:["US48","US48P500"]},initialize:function(){this.collections={},this.listenTo(this,"change:port_table",this.syncPortTable),this.listenTo(this,"change:port_overrides",this.syncPortTable),(this.attributes.port_table||"usw"==this.attributes.type)&&this.syncPortTable()},validate:function(e,t){var i={},a=t?t.partial:null;if("advance-adopt"==a&&(e.username||(i.username=o.localize(o.E_CannotBeEmpty,o.G_UN)),e.password||(i.password=o.localize(o.E_CannotBeEmpty,o.G_PW))),e.port_overrides&&t.extra&&t.extra.portidx){var n=r.findWhere(e.port_overrides,{port_idx:t.extra.portidx});if(n){if("aggregate"==n.op_mode&&(!a||"aggregate_num_ports"==a)){for(var s=t.extra.portidx+1,c=t.extra.portidx+3,l=this.numPorts(),d=4,m=this.get("port_table"),u=(m.length,t.extra.portidx);c>u;u++)if(c>u){var h=m[u];if(h&&"switch"!==h.op_mode){c=u,d=c-t.extra.portidx+1;break}}c>l&&(c=l,d=c-t.extra.portidx+1),this.validator.range(n.aggregate_num_ports,2,d)||(i.aggregate_num_ports=o.localize(o.E_IncorrectNumberRange,o.G_PropertiesAggregatePorts,s,c))}"mirror"!=n.op_mode||a&&"mirror_port_idx"!=a||n.mirror_port_idx!=t.extra.portidx&&this.validator.range(n.mirror_port_idx,1,this.numPorts())||(i.mirror_port_idx=o.localize(o.E_InvalidMirroringPort,n.mirror_port_idx)),"switch"!=n.op_mode||a&&"stormctrl_ucast_rate"!=a||!n.stormctrl_ucast_enabled||(""===n.stormctrl_ucast_rate?i.stormctrl_ucast_rate=o.localize(o.E_CannotBeEmpty,o.G_PropertiesUcast):this.validator.range(n.stormctrl_ucast_rate,0,1488e4)||(i.stormctrl_ucast_rate=o.localize(o.E_IncorrectNumberRange,o.G_PropertiesUcast,0,1488e4))),"switch"!=n.op_mode||a&&"stormctrl_mcast_rate"!=a||!n.stormctrl_mcast_enabled||(""===n.stormctrl_mcast_rate?i.stormctrl_mcast_rate=o.localize(o.E_CannotBeEmpty,o.G_PropertiesMcast):this.validator.range(n.stormctrl_mcast_rate,0,1488e4)||(i.stormctrl_mcast_rate=o.localize(o.E_IncorrectNumberRange,o.G_PropertiesMcast,0,1488e4))),"switch"!=n.op_mode||a&&"stormctrl_bcast_rate"!=a||!n.stormctrl_bcast_enabled||(""===n.stormctrl_bcast_rate?i.stormctrl_bcast_rate=o.localize(o.E_CannotBeEmpty,o.G_PropertiesBcast):this.validator.range(n.stormctrl_bcast_rate,0,1488e4)||(i.stormctrl_bcast_rate=o.localize(o.E_IncorrectNumberRange,o.G_PropertiesBcast,0,1488e4)))}}return a&&"config_network_wan"!=a||e.config_network_wan&&(r.size(i.config_network_wan=this.validateNetwork(e,"config_network_wan"))||delete i.config_network_wan),a&&"config_network_wan2"!=a||e.config_network_wan2&&(r.size(i.config_network_wan2=this.validateNetwork(e,"config_network_wan2"))||delete i.config_network_wan2),a&&"config_network"!=a||e.config_network&&(r.size(i.config_network=this.validateNetwork(e,"config_network"))||delete i.config_network),a&&"wlan_overrides"!=a||e.wlan_overrides&&(i.wlan_overrides={},r.each(e.wlan_overrides,function(t,a){i.wlan_overrides[a]={};var n;if(e.hasOwnProperty("wlanconf")){var s=e.wlanconf.attributes.vlan_enabled;n=t.hasOwnProperty("vlan_enabled")?t.vlan_enabled:s}else n=t.vlan_enabled;n&&""===t.vlan?i.wlan_overrides[a].vlan=o.localize(o.E_CannotBeEmpty,o.G_PropertiesVLAN):t.vlan&&!this.validator.range(t.vlan,2,4095)&&(i.wlan_overrides[a].vlan=o.localize(o.E_IncorrectNumberRange,o.G_PropertiesVLAN,2,4095)),""===t.x_passphrase?i.wlan_overrides[a].x_passphrase=o.localize(o.E_CannotBeEmpty,o.G_PropertiesPSK):t.x_passphrase&&!this.validator.password(t.x_passphrase)&&(i.wlan_overrides[a].x_passphrase=o.localize(o.E_InvalidPassphrase,o.G_PropertiesPSK)),r.size(i.wlan_overrides[a])||delete i.wlan_overrides[a]},this),r.size(i.wlan_overrides)||delete i.wlan_overrides),e.name&&!this.validator.name(e.name)&&e.name.toLowerCase()!==e.mac.toLowerCase()&&(i.name=o.localize(o.E_InvalidName,o.G_PropertiesAlias)),r.size(i)?i:void 0},validateNetwork:function(e,t){var i={};switch(e[t].type){case"dhcp":e[t].dns1&&!this.validator.ip(e[t].dns1)&&(i.dns1=o.localize(o.E_IncorrectIPAddress,o.G_PropertiesPreferredDNS)),e[t].dns2&&!this.validator.ip(e[t].dns2)&&(i.dns2=o.localize(o.E_IncorrectIPAddress,o.G_PropertiesAlternateDNS)),e[t].vlan_enabled&&!e[t].vlan?i.vlan=o.localize(o.E_CannotBeEmpty,o.G_PropertiesVLAN):e[t].vlan&&!this.validator.range(e[t].vlan,2,4095)&&(i.vlan=o.localize(o.E_IncorrectNumberRange,o.G_PropertiesVLAN,2,4095));break;case"pppoe":e[t].username||(i.username=o.localize(o.E_CannotBeEmpty,o.G_UN)),e[t].x_password||(i.x_password=o.localize(o.E_CannotBeEmpty,o.G_PW)),e[t].dns1&&!this.validator.ip(e[t].dns1)&&(i.dns1=o.localize(o.E_IncorrectIPAddress,o.G_PropertiesPreferredDNS)),e[t].dns2&&!this.validator.ip(e[t].dns2)&&(i.dns2=o.localize(o.E_IncorrectIPAddress,o.G_PropertiesAlternateDNS)),e[t].vlan_enabled&&""===e[t].vlan?i.vlan=o.localize(o.E_CannotBeEmpty,o.G_PropertiesVLAN):e[t].vlan&&!this.validator.range(e[t].vlan,2,4095)&&(i.vlan=o.localize(o.E_IncorrectNumberRange,o.G_PropertiesVLAN,2,4095));break;case"static":e[t].ip?this.validator.ip(e[t].ip)||(i.ip=o.localize(o.E_IncorrectIPAddress,o.G_IPAddress)):i.ip=o.localize(o.E_CannotBeEmpty,o.G_IPAddress),e[t].netmask?this.validator.netmask(e[t].netmask,e[t].ip)||(i.netmask=o.localize(o.E_IncorrectNetmask,o.G_Netmask)):i.netmask=o.localize(o.E_CannotBeEmpty,o.G_Netmask),e[t].gateway&&!this.validator.ip(e[t].gateway)&&(i.gateway=o.localize(o.E_IncorrectIPAddress,o.G_PropertiesGateway)),e[t].dns1&&!this.validator.ip(e[t].dns1)&&(i.dns1=o.localize(o.E_IncorrectIPAddress,o.G_PropertiesPreferredDNS)),e[t].dns2&&!this.validator.ip(e[t].dns2)&&(i.dns2=o.localize(o.E_IncorrectIPAddress,o.G_PropertiesAlternateDNS)),e[t].vlan_enabled&&!e[t].vlan?i.vlan=o.localize(o.E_CannotBeEmpty,o.G_PropertiesVLAN):e[t].vlan&&!this.validator.range(e[t].vlan,2,4095)&&(i.vlan=o.localize(o.E_IncorrectNumberRange,o.G_PropertiesVLAN,2,4095))}return i},parse:function(t,i){return t=e.prototype.parse.call(this,t,i),t&&0!==parseInt(t.state,10)&&(t.restarting=!1),t&&(t.uptime?t.uptime=parseInt(t.uptime,10):t.uptime=0),t},toSearch:function(){var e={name:this.attributes.name,mac:this.attributes.mac,ip:this.attributes.ip,status:this.status(),model:this.apModel(),version:this.attributes.version};return this.attributes.vap_table&&r.each(this.attributes.vap_table,function(t,i){e["bssid_"+i]=t.bssid}),e},name:function(){return this.get("name")||this.get("mac")},ip2long:function(){return i.ip2long(this.get("ip"))},getMacNoColons:function(){return this.get("mac").replace(/:/g,"")},apModel:function(){var e=this.get("model")||"";switch(e){case"BZ2":return"UniFi AP";case"BZ2LR":return"UniFi AP-LR";case"U2S48":return"UniFi AP";case"U2L48":return"UniFi AP-LR";case"U2HSR":return"UniFi AP-Outdoor+";case"U2O":return"UniFi AP-Outdoor";case"U5O":return"UniFi AP-Outdoor 5G";case"U7P":return"UniFi AP-Pro";case"U7PG2":return"UniFi AP-AC-Pro";case"U7EDU":return"UniFi AP-AC-EDU";case"U7LR":return"UniFi AP-AC-LR";case"U7LT":return"UniFi AP-AC-Lite";case"U2M":return"UniFi AP-Mini";case"U2IW":return"UniFi AP-In Wall";case"U7E":return"UniFi AP-AC";case"U7Ev2":return"UniFi AP-AC v2";case"U2Sv2":return"UniFi AP v2";case"U2Lv2":return"UniFi AP-LR v2";case"U7O":return"UniFi AP-AC Outdoor";case"p2N":return"PicoStation M2";case"US24":return"UniFi Switch 24";case"US24P250":return"UniFi Switch 24 POE-250W";case"US24P500":return"UniFi Switch 24 POE-500W";case"US48":return"UniFi Switch 48";case"US48P500":return"UniFi Switch 48 POE-500W";case"US48P750":return"UniFi Switch 48 POE-750W";case"US16P150":return"UniFi Switch 16 POE-150W";case"US8P150":return"UniFi Switch 8 POE-150W";case"UGW3":return"UniFi Security Gateway 3P";case"UGW4":return"UniFi Security Gateway 4P";case"UGW8":return"UniFi Security Gateway 8P";case"UP5":return"UniFi Phone";case"UP5t":return"UniFi Phone-Pro";case"UP7":return"UniFi Phone-Executive";case"UP4":return"UniFi Phone-X";case"UP5c":return"UniFi Phone";case"UP5tc":return"UniFi Phone-Pro";case"UP7c":return"UniFi Phone-Executive"}return"UniFi "+e},isGen2Ap:function(){var e=this.get("model")||"";switch(e){case"U7PG2":case"U7EDU":case"U7LR":case"U7LT":return!0}return!1},isAntennaGainEditable:function(){var e=this.get("model")||"",t=["U2O","U5O","U2HSR"];return-1!==r.indexOf(t,e)?!0:!1},apIcon:function(){var e=this.get("model")||"";switch(e){case"U7P":return"ap-pro-icon";default:return"ap-icon"}},numPorts:function(){switch(this.get("model")){case"US24":case"US24P250":case"US24P500":return 26;case"US48":case"US48P500":case"US48P750":return 52;case"US16P150":return 18;case"US8P150":return 10;case"UGW3":return 3;case"UGW4":return 4;case"UGW8":return 8}},txPower:function(){var e=this.transmitPower("ng"),t=this.transmitPower("na");return r.isUndefined(t)||r.isUndefined(e)?r.isUndefined(t)?r.isUndefined(e)?void 0:e:t:e>t?e:t},getFrequency:function(e,t){if("ng"==e){var i={1:2412,2:2417,3:2422,4:2427,5:2432,6:2437,7:2442,8:2447,9:2452,10:2457,11:2462,12:2467,13:2472,14:2484};return i[t]}if("na"==e){var a={7:5035,8:5040,9:5045,11:5055,12:5060,16:5080,34:5170,36:5180,38:5190,40:5200,42:5210,44:5220,46:5230,48:5240,52:5260,56:5280,60:5300,64:5320,100:5500,104:5520,108:5540,112:5560,116:5580,120:5600,124:5620,128:5640,132:5660,136:5680,140:5700,149:5745,153:5765,157:5785,161:5805,165:5825,183:4915,184:4920,185:4925,187:4935,188:4940,189:4945,192:4960,196:4980};return a[t]}},transmitFrequency:function(e){if("ng"==e){var t=this.transmitPower("ng"),i=this.get("ng-channel");if(!r.isUndefined(t))return this.getFrequency(e,i)}if("na"==e){var a=this.transmitPower("na"),n=this.get("na-channel");if(!r.isUndefined(a))return this.getFrequency(e,n)}},uptime:function(e){return e=e||this.get("uptime"),e>0?n.Formatters.Duration.fromRaw(e||0):""},power:function(){var e=0;return r.each(this.get("port_table"),function(t,i){e+=parseFloat(t.poe_power||0,10)}),e.toFixed(2)},fan_level:function(){var e=this.get("fan_level");return e>=0?e:o.G_SettingsOff},uplink:function(){return this.isConnected()?this.get("uplink"):this.get("last_uplink")||this.get("uplink")},wan1:function(){return this.isConnected()?this.get("wan1"):this.get("last_wan1")||this.get("wan1")},wan2:function(){return this.isConnected()?this.get("wan2"):this.get("last_wan2")||this.get("wan2")},uplinks:function(){return this.get("uplink_table")||{}},uplinkDeviceMac:function(){var e=this.uplink();if(e){var t;if(e.hasOwnProperty("uplink_mac")?t=e.uplink_mac:"wireless"===e.type&&e.hasOwnProperty("ap_mac")&&(t=e.ap_mac),t)return t}return""},uplinkDeviceText:function(){var e=this.uplink();if(e){var t=this.uplinkDeviceMac(),i=this.collection.findWhere({mac:t});return i?i.name()+(e.uplink_remote_port?" #"+e.uplink_remote_port:""):t}return""},uplinkRemotePort:function(){var e=this.uplink();if(e){var t=this.uplinkDeviceMac(),i=this.collection.findWhere({mac:t});if(i&&e.uplink_remote_port)return e.uplink_remote_port}return null},uplinkRssi:function(){var e=this.uplink();return e?this.calcRssi(e.rssi):void 0},calcRssi:function(e){return void 0===e&&(e=this.get("rssi")),e=parseFloat(e),e?(e>45?e=45:5>e&&(e=5),e=(e-5)/40*99,(0===e?"0":e.toPrecision(2))+"%"):""},apXRate:function(e){return isNaN(e)?"":parseInt(e,10)/1e3+"M"},uplinkTxRate:function(){var e=this.uplink();return e?this.apXRate(e.tx_rate):""},uplinkRxRate:function(){var e=this.uplink();return e?this.apXRate(e.rx_rate):""},uplinkSpeed:function(){var e=this.uplink();return e?e.speed:"Unknown"},uplinkDuplex:function(){
var e=this.uplink();return e&&e.full_duplex?"Full Duplex":"Half Duplex"},uplinkDownPackets:function(){var e=this.uplink();return e&&e.rx_packets&&e.rx_bytes?n.Formatters.Bytes.fromRaw(e.rx_packets)+"/"+n.Formatters.Bytes.fromRaw(e.rx_bytes):"0.00 / 0.00"},uplinkUpPackets:function(){var e=this.uplink();return e&&e.tx_packets&&e.tx_bytes?n.Formatters.Bytes.fromRaw(e.tx_packets)+"/"+n.Formatters.Bytes.fromRaw(e.tx_bytes):"0.00 / 0.00"},wan1Speed:function(){var e=this.wan1();return e?e.speed:"Unknown"},wan1Duplex:function(){var e=this.wan1();return e&&e.full_duplex?"Full Duplex":"Half Duplex"},wan1DownPackets:function(){var e=this.wan1();return e&&e.rx_packets&&e.rx_bytes?n.Formatters.Bytes.fromRaw(e.rx_packets)+"/"+n.Formatters.Bytes.fromRaw(e.rx_bytes):"0.00 / 0.00"},wan1UpPackets:function(){var e=this.wan1();return e&&e.tx_packets&&e.tx_bytes?n.Formatters.Bytes.fromRaw(e.tx_packets)+"/"+n.Formatters.Bytes.fromRaw(e.tx_bytes):"0.00 / 0.00"},wan2Speed:function(){var e=this.wan2();return e?e.speed:"Unknown"},wan2Duplex:function(){var e=this.wan2();return e&&e.full_duplex?"Full Duplex":"Half Duplex"},wan2DownPackets:function(){var e=this.wan2();return e&&e.rx_packets&&e.rx_bytes?n.Formatters.Bytes.fromRaw(e.rx_packets)+"/"+n.Formatters.Bytes.fromRaw(e.rx_bytes):"0.00 / 0.00"},wan2UpPackets:function(){var e=this.wan2();return e&&e.tx_packets&&e.tx_bytes?n.Formatters.Bytes.fromRaw(e.tx_packets)+"/"+n.Formatters.Bytes.fromRaw(e.tx_bytes):"0.00 / 0.00"},uplinkActivity:function(){var e=this.uplink(),t=e?e["tx_bytes-r"]:0,i=e?e["rx_bytes-r"]:0,a=t+i,o=0;return a&&(o=n.Formatters.Bytes.fromRaw(a)),o+"B / sec"},uplinkActivityDown:function(){var e=this.uplink(),t=e?e["rx_bytes-r"]:0,i=0;return t&&(i=n.Formatters.Bytes.fromRaw(t)),i+"B / sec"},uplinkActivityUp:function(){var e=this.uplink(),t=e?e["tx_bytes-r"]:0,i=0;return t&&(i=n.Formatters.Bytes.fromRaw(t)),i+"B / sec"},wan1ActivityDown:function(){var e=this.wan1(),t=e?e["rx_bytes-r"]:0,i=0;return t&&(i=n.Formatters.Bytes.fromRaw(t)),i+"B / sec"},wan1ActivityUp:function(){var e=this.wan1(),t=e?e["tx_bytes-r"]:0,i=0;return t&&(i=n.Formatters.Bytes.fromRaw(t)),i+"B / sec"},wan2ActivityDown:function(){var e=this.wan2(),t=e?e["rx_bytes-r"]:0,i=0;return t&&(i=n.Formatters.Bytes.fromRaw(t)),i+"B / sec"},wan2ActivityUp:function(){var e=this.wan2(),t=e?e["tx_bytes-r"]:0,i=0;return t&&(i=n.Formatters.Bytes.fromRaw(t)),i+"B / sec"},adoptIp:function(){return this.get("adopt_ip")||this.get("ip")},adoptPort:function(){return this.get("sshd_port")},adoptUrl:function(){return this.get("adopt_url")||this.get("inform_url")||"http://unifi:8080/inform"},downlinks:function(){return this.get("downlink_table")||[]},networks:function(){return this.get("network_table")||[]},getChannel:function(){var e=this.get("ng-channel"),t=this.get("na-channel"),i=[];return e&&i.push(e+" (2G)"),t&&i.push(t+" (5G)"),i.length?i.join(", "):""},apChannel:function(){if(!this.get("vap_table"))return"";var e,t,a,n=[];return a=this.get("model"),r.each(this.get("vap_table"),function(o,r){return 0===o.channel?!0:"RUN"!=(o.state||"RUN")?!0:(t=o.radio,"na"!=t||"U7E"!=a&&"U7O"!=a&&"U7Ev2"!=a&&"U7PG2"!=a&&"U7EDU"!=a&&"U7LR"!=a&&"U7LT"!=a||(t="ac"),e=o.channel+" ("+t+")",void(i.inArray(e,n)<0&&("ng"==o.radio?n=[e].concat(n):n.push(e))))}),n.join(", ")},sortApChannel:function(){if(!this.get("vap_table"))return-1;var e=0;return r.each(this.get("vap_table"),function(t,i){if(0===t.channel)return!0;if("RUN"!=(t.state||"RUN"))return!0;var a=t.radio;"na"==a?e+=1e3*(parseInt(t.channel,10)||0):"ng"==a&&(e+=parseInt(t.channel,10)||0)}),e},getRadio:function(e){return r.find(this.get("radio_table"),function(t){return t.hasOwnProperty("radio")?t.radio===e:void 0})},getNss:function(e){var t=this.getRadio(e);return t&&t.nss?t.nss:null},hasRadio:function(e){return void 0===this.getRadio(e)?!1:!0},channel:function(e){var t=this.get(e+"-state")||"INIT",i=this.get(e+"-extchannel")||0,a=i>0?",+1":0>i?",-1":"",n=this.get(e+"-channel")+a;return"INIT"==t?n="":"DFS_WAIT"==t&&(n+=" (DFS Waiting)"),n},transmitPower:function(e){var t=this.get(e+"-state")||"INIT";if("INIT"!=t){var i=Math.min(this.get(e+"-tx_power"),30),a=this.get(e+"-gain")||0,n=this.get(e+"-eirp")||parseInt(i,10)+a;return n}},packetsPerBytes:function(e,t){var i=this.get("stat"),a=i?i[e+"-"+t+"_packets"]:0,o=i?i[e+"-"+t+"_bytes"]:0;return a=a||0,o=o||0,n.Formatters.Bytes.fromRaw(a)+" / "+n.Formatters.Bytes.fromRaw(o)},errorPercentage:function(e,t){var i,a=this.get("stat"),o=a?a[e+"-"+t+"_retries"]:0,r=a?a[e+"-"+t+"_packets"]:0,s=a?a[e+"-"+t+"_dropped"]:0;return o=o||0,r=r||0,s=s||0,i=r+s,n.Formatters.Percentage.fromRaw(o,i)+" / "+n.Formatters.Percentage.fromRaw(s,i)},getOverride:function(e,t){var i=null,a=this.get("wlan_overrides")||[];return r.each(a,function(a){return a.wlan_id==e&&a.radio==t?(i=a,!1):void 0}),i},hasOverrides:function(e,t){var i=!1,a=this.get("wlan_overrides")||[];return r.each(a,function(e){return e.radio==t?(i=!0,!1):void 0}),i},wlan2G:function(e){return this.wlangroup(this.get("wlangroup_id_ng"),"ng",e)},wlan5G:function(e){return this.wlangroup(this.get("wlangroup_id_na"),"na",e)},wlangroup:function(e,t,i){if(!(this.get("adopted")&&this.get("radio_"+t)&&i&&r.size(i)))return"";var a=i.findWhere({_id:e})||i.findWhere({attr_hidden_id:"Default"}),n=a.get("name");return a.get("roam_enabled")?n+=" (ZH)":this.hasOverrides(a.get("id"),t)&&(n+=" (*)"),n},radio2G:function(){return this.radioChannelAndPower(this.get("radio_ng"))},radio5G:function(){return this.radioChannelAndPower(this.get("radio_na"))},radioChannelAndPower:function(e){if(!this.get("adopted")||!e)return"";var t=e.channel&&!isNaN(e.channel)?parseInt(e.channel,10):"auto",i=e.tx_power_mode||"auto";return"custom"===i&&(i=e.builtin_antenna===!0?parseInt(e.tx_power,10)+parseInt(e.builtin_ant_gain,10)+" dBm":parseInt(e.tx_power,10)+parseInt(e.antenna_gain,10)+" dBm"),0===t&&(t="auto"),t+" / "+i},sortRadio2G:function(){return this.sortRadio(this.get("radio_ng"),"ng")},sortRadio5G:function(){return this.sortRadio(this.get("radio_na"),"na")},sortRadio:function(e,t){if(void 0===e||null===e)return-1;var i=e.channel&&!isNaN(e.channel)?parseInt(e.channel,10):0,a=this.transmitPower(t);return void 0===a&&(a=0),1e3*i+a},clientName:function(e){return e.hostname||e.mac},deviceName:function(e){return e.essid||e.mac},status:function(){var e,t=this.uplink()||{};switch(parseInt(this.get("state"),10)||0){case 0:e=this.get("restarting")?o.G_APRestarting:o.G_APDisconnected;break;case 1:e=o.G_APConnected,this.get("isolated")?e+=" (limited)":"wire"==t.type?"ugw"!==this.get("type")&&(t.max_speed==t.speed&&t.full_duplex||(e+=" ("+t.speed+" "+(t.full_duplex?"FDX":"HDX")+")")):"wireless"==t.type&&(e+=" (wireless)"),this.get("version_incompatible")&&(e+=" (needs upgrade)");break;case 2:e=this.get("default")?"scan"==this.get("discovered_via")?o.G_APIsolatedPending:o.G_APPending:o.G_APManagedByOthers;break;case 3:e=o.G_APFirmwareMismatch;break;case 4:e=o.G_APUpgrading;break;case 5:e=o.G_APProvisioning;break;case 6:e=o.G_APHeartbeatMissed;break;case 7:e=o.G_APAdopting,"wireless"==t.type&&(e+=" (wireless)");break;case 8:e=o.G_APDeleting;break;case 9:e=o.G_APDisconnected;break;case 10:e=o.G_APAdoptFailed;break;case 11:e=o.G_APIsolated}return e},statusType:function(){switch(parseInt(this.get("state"),10)||0){case 1:case 4:case 5:return"ok";case 2:case 7:case 13:return"pending";case 0:case 3:case 9:case 10:case 11:return"error";default:return"error"}},isConnected:function(){return"ok"===this.statusType()},is11ac:function(){return-1!==i.inArray(this.get("model"),["U7E","U7O","U7Ev2","U7PG2","U7EDU","U7LR","U7LT"])},hasDfs:function(){return-1!==i.inArray(this.get("model"),["U5O","U7P"])},hasBandsteering:function(){var e=this.hasRadio("ng"),t=this.hasRadio("na");return t&&e?-1!==i.inArray(this.get("model"),["U7P","U7PG2","U7EDU","U7LR","U7LT"]):!1},noZh:function(){return-1!==i.inArray(this.get("model"),["U7E","U7O","U7Ev2","U7PG2","U7EDU","U7LR","U7LT"])},lastSeen:function(){var e,t=this.get("last_seen");return t?(e=(new Date).getTime()/1e3-parseInt(t,10),isNaN(e)?"":86400>e?n.Formatters.Duration.fromRaw(e)+" "+o.G_Ago:s(t+"","X").format("YYYY/MM/DD HH:mm:ss")):o.G_Never},lastScan:function(e){if(e){var t=(new Date).getTime()/1e3-parseInt(e,10);return isNaN(t)?o.G_Never:86400>t?n.Formatters.Duration.fromRaw(t)+" "+o.G_Ago:s(e+"","X").format("YYYY/MM/DD HH:mm:ss")}return o.G_Never},absoluteLastSeen:function(){var e=this.get("last_seen");return e?s(e+"","X").format("YYYY/MM/DD HH:mm:ss"):""},syncPortTable:function(e,n){this.collections.portTable||(this.collections.portTable=new(a.Collection.extend({model:t.extend({idAttribute:"port_idx"})}))),r.each(this.attributes.port_table,i.proxy(function(e){var t=r.filter(this.attributes.port_overrides,function(t){return t.port_idx==e.port_idx});t.length&&(e=r.extend(e,t[0])),e.device=this.get("mac"),this.collections.portTable.add(e,{merge:!0})},this)),this.trigger("syncPortTable")},upgrade:function(e){return this.sync("upgrade",this,e)},adopt:function(e){return this.sync("adopt",this,e)},advanceAdopt:function(e){return this.validationError=this.validate(e.data,r.extend({partial:"advance-adopt"},e)),this.validationError?!1:this.sync("advance-adopt",this,e)},forget:function(e){return this.sync("forget",this,e)},restart:function(e){return this.sync("restart",this,e)},powerCyclePort:function(e){return this.sync("power-cycle",this,e)},clearSwitchCounters:function(e){return this.sync("clear-switch-counters",this,e)},clearPortCounters:function(e){return this.sync("clear-switch-port-counters",this,e)},setVwireUplink:function(e){return this.sync("set-vwire-uplink",this,e)},unsetVwireUplink:function(e){return this.sync("unset-vwire-uplink",this,e)},move:function(e){return this.sync("move",this,e)},copyConfig:function(e){return this.sync("copy-config",this,e)},update:function(e){return this.sync("update",this,e)},customUpgrade:function(e){return this.sync("upgrade-external",this,e)},locate:function(e){return this.sync("locate",this,e)},spectrumScan:function(e){this.sync("spectrum-scan",this,e)},updateWlanGroup:function(e,t){var i={};return i["wlangroup_id_"+e]=t.wlangroup_id,i.wlan_overrides=r.reject(this.get("wlan_overrides"),function(t){return t.radio==e}),this.save(i,r.extend(t,{_method:"update-wlangroup-"+e}))},sort_Clients:function(){return void 0===this.get("num_sta")?-1:parseInt(this.get("num_sta"),10)},sort_2GClients:function(){return void 0===this.get("ng-num_sta")?-1:parseInt(this.get("ng-num_sta"),10)},sort_5GClients:function(){return void 0===this.get("na-num_sta")?-1:parseInt(this.get("na-num_sta"),10)},sort_txBytesD:function(){return void 0===this.get("tx_bytes-d")?-1:this.get("tx_bytes-d")},sort_rxBytesD:function(){return void 0===this.get("rx_bytes-d")?-1:this.get("rx_bytes-d")},sort_txBytes2g:function(){var e=(parseInt(this.get("ng_ast_be_xmit"),10)||0)+(parseInt(this.get("ng_tx_packets"),10)||0);return e},sort_txBytes5g:function(){var e=(parseInt(this.get("na_ast_be_xmit"),10)||0)+(parseInt(this.get("na_tx_packets"),10)||0);return e},sync:function(e,t,i,n){switch(i=i||{},i._method&&(e=i._method,delete i._method),e){case"read":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/stat/device/"+t.get("mac"),i.type="GET";break;case"update":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/upd/device/"+t.id,i.type="POST",i.data=i.data?JSON.stringify(i.data):JSON.stringify(t.changed);break;case"adopt":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr",i.type="POST",i.data=JSON.stringify(r.extend(i.data||{},{mac:t.get("mac"),cmd:"adopt"}));break;case"advance-adopt":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr",i.type="POST",i.data=JSON.stringify(r.extend(i.data||{},{mac:t.get("mac"),cmd:"adv-adopt"}));break;case"power-cycle":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr",i.type="POST",i.data=JSON.stringify(r.extend(i.data||{},{mac:t.get("mac"),cmd:"power-cycle"}));break;case"clear-switch-counters":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr",i.type="POST",i.data=JSON.stringify(r.extend(i.data||{},{mac:t.get("mac"),cmd:"clear-switch-counters"}));break;case"clear-switch-port-counters":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr",i.type="POST",i.data=JSON.stringify(r.extend(i.data||{},{mac:t.get("mac"),cmd:"clear-switch-port-counters"}));break;case"set-vwire-uplink":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr",i.type="POST",i.data=JSON.stringify(r.extend(i.data||{},{cmd:"set-vwire-uplink"}));break;case"unset-vwire-uplink":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr",i.type="POST",i.data=JSON.stringify(r.extend(i.data||{},{cmd:"unset-vwire-uplink"}));break;case"forget":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/sitemgr",i.type="POST",i.data=JSON.stringify({mac:t.get("mac"),cmd:"delete-device"});break;case"restart":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr",i.type="POST",i.data=JSON.stringify({mac:t.get("mac"),cmd:"restart"});break;case"upgrade":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr",i.type="POST",i.data=JSON.stringify({mac:t.get("mac"),cmd:"upgrade"});break;case"move":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/sitemgr/",i.type="POST",i.data=JSON.stringify(r.extend(i.data||{},{mac:t.get("mac"),cmd:"move-device"}));break;case"copy-config":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr/",i.type="POST",i.data=JSON.stringify(r.extend(i.data||{},{mac:t.get("mac"),cmd:"clone-config",origin:i.selectedMac}));break;case"add-device":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/sitemgr/",i.type="POST",i.data=JSON.stringify({macid:i.macidqr,cmd:"add-device"});break;case"locate":t.get("adopted")?t.set({locating:!t.get("locating")}):t.set({locating:!1}),i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr",i.type="POST",i.data=JSON.stringify({mac:t.get("mac"),cmd:t.get("adopted")?t.get("locating")?"set-locate":"unset-locate":"locate"});break;case"update-wlangroup-ng":i.contentType="application/json",i.url="/api/s/"+SITE.name+"/upd/device/"+t.id,i.type="POST",i.data=JSON.stringify(r.extend(i.data||{},{wlangroup_id_ng:t.get("wlangroup_id_ng"),wlan_overrides:t.get("wlan_overrides")}));break;case"update-wlangroup-na":i.contentType="application/json",i.url="/api/s/"+SITE.name+"/upd/device/"+t.id,i.type="POST",i.data=JSON.stringify(r.extend(i.data||{},{wlangroup_id_na:t.get("wlangroup_id_na"),wlan_overrides:t.get("wlan_overrides")}));break;case"spectrum-scan":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr",i.type="POST",i.data=JSON.stringify({mac:t.get("mac"),cmd:"spectrum-scan"});break;case"upgrade-external":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/cmd/devmgr",i.type="POST",i.data=JSON.stringify({mac:t.get("mac"),cmd:"upgrade-external",url:i.upgradePath})}return a.sync.call(this,e,t,i)}})}),define("unifi/collection/Devices",["unifi/collection/Collection","underscore","backbone","unifi/model/Device"],function(e,t,i,a){"use strict";return e.extend({model:a,bySite:!0,initialize:function(t){e.prototype.initialize.call(this,t),this.typeMap=(new this.model).typeMap},get:function(i){var a=e.prototype.get.call(this,i);return!a&&t.isObject(i)&&!i.id&&i.get("mac")&&(a=this.getDeviceFromMac(i.get("mac"))),a},getInformIP:function(){var e=this.find(function(e){return e.get("adopted")&&1==e.get("state")&&e.get("inform_ip")});return void 0===e?"":e.get("inform_ip")},hasUpgradableAP:function(){var e=this.find(function(e){return"uap"==e.get("type")&&1==e.get("state")&&e.get("upgradable")});return e?!0:!1},hasUpgradablePhone:function(){var e=this.find(function(e){return"uph"==e.get("type")&&1==e.get("state")&&e.get("upgradable")});return e?!0:!1},isUpgradingDevices:function(){var e=this.find(function(e){return e.get("rollupgrade")});return e?!0:!1},getDeviceFromMac:function(e){return this.find(function(t){return t.get("mac")==e})},sortByBytes:function(){var e=this.sortBy(function(e){return-1*(e.get("bytes")||0)});return e},sortByBytesOnlyAdoptedAps:function(){var e=this.sortByBytes();return t.filter(e,function(e){return"uap"===e.get("type")&&e.get("adopted")===!0})},url:function(){return"/api/s/"+SITE.name+"/stat/device"},all:function(e){return this.fetch(t.extend(e,{_method:"read-all"}))},discover:function(){return this.fetch({_method:"discover"})},scanUplink:function(e){return this.sync("scan-uplink",this,e)},upgradeAPs:function(e){return this.sync("upgrade-aps",this,e)},upgradePhones:function(e){return this.sync("upgrade-phones",this,e)},sync:function(e,a,n){switch(n=n||{},n._method&&(e=n._method,delete n._method),e){case"read-all":n.contentType="application/json; charset=utf-8",n.url="/api/stat/device",n.type="POST",n.data=JSON.stringify(n.data||{});break;case"discover":n.contentType="application/json; charset=utf-8",n.url="/api/stat/device",n.type="POST",n.data=JSON.stringify({state:2,"default":!0});break;case"read":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/stat/device",n.type="GET";break;case"scan-uplink":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/cmd/devmgr",n.type="POST",n.data=JSON.stringify(t.extend(n.data||{},{cmd:"scan-uplink"}));break;case"upgrade-aps":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/cmd/devmgr",n.type="POST",n.data=JSON.stringify(t.extend(n.data||{},{cmd:this.isUpgradingDevices()?"unset-rollupgrade":"set-rollupgrade"}));break;case"upgrade-phones":n.contentType="application/json; charset=utf-8",n.url="/api/s/"+SITE.name+"/cmd/devmgr",n.type="POST",n.data=JSON.stringify(t.extend(n.data||{},{cmd:"upgrade-all",type:"uph"}))}return i.sync.call(this,e,a,n)}})}),define("text!includes/dashboard/dashboardIndexTemplate.html",[],function(){return'<h1><%-msg.G_DashboardNetworkHealth %></h1>\n\n<div class="diagram">\n    <div class="nodes">\n        <div class="unknown www layer">\n            <div id="speedtest">\n                <div class="speedtest-inner">\n                    <div class="mini">\n                        <h2><span class="speedtest-icon"></span> <%- msg.G_Speedtest %></h2>\n                        <a href="#" class="button button-test"><%- msg.G_StartNow %></a>\n                        <div class="speedtest-download">\n                            <div class="result">\n                                <span class="arrow sprite-arrow-down-gray"></span>\n                                <span class="value">&nbsp;?&nbsp;</span>\n                                <span class="unit">Mbps</span>\n                            </div>\n                        </div>\n                        <div class="speedtest-upload">\n                            <div class="result">\n                                <span class="arrow sprite-arrow-up-gray"></span>\n                                <span class="value">&nbsp;?&nbsp;</span>\n                                <span class="unit">Mbps</span>\n                            </div>\n                        </div>\n                        <div class="speedtest-lastrun">\n                            <div class="result">\n                                <span class="unit">Last run:</span>\n                                <span class="value"></span>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n            <div class="drop-count hidden">\n                <div class="ubnt-icon-drop"></div>\n                <div class="count"></div>\n            </div>\n            <div class="inner">\n                <div class="image ubnt-icon-globe"></div>\n                <div class="title"><%-msg.G_DashboardDiagramWWW %></div>\n            </div>\n            <div class="ubnt-icon-arrow-right"></div>\n            <div class="connector right"><span></span></div>\n        </div>\n        <div class="unknown wan layer">\n            <div class="drop-count hidden">\n                <div class="ubnt-icon-drop"></div>\n                <div class="count"></div>\n            </div>\n            <div class="inner">\n                <div class="image ubnt-icon-lock"></div>\n                <div class="title"><%-msg.G_DashboardDiagramWAN %></div>\n            </div>\n            <div class="ubnt-icon-arrow-left"></div>\n            <div class="connector left"><span></span></div>\n            <div class="ubnt-icon-arrow-right"></div>\n            <div class="connector right"><span></span></div>\n        </div>\n        <div class="unknown lan layer">\n            <div class="drop-count hidden">\n                <div class="ubnt-icon-drop"></div>\n                <div class="count"></div>\n            </div>\n            <div class="inner">\n                <div class="image ubnt-icon-files"></div>\n                <div class="title"><%-msg.G_DashboardDiagramLAN %></div>\n            </div>\n            <div class="ubnt-icon-arrow-left"></div>\n            <div class="connector left"><span></span></div>\n            <div class="ubnt-icon-arrow-right"></div>\n            <div class="connector right"><span></span></div>\n        </div>\n        <div class="unknown wlan layer">\n            <div class="drop-count hidden">\n                <div class="ubnt-icon-drop"></div>\n                <div class="count"></div>\n            </div>\n            <div class="inner">\n                <div class="image ubnt-icon-wifi"></div>\n                <div class="title"><%-msg.G_DashboardDiagramWLAN %></div>\n            </div>\n            <div class="ubnt-icon-arrow-left"></div>\n            <div class="connector left"><span></span></div>\n        </div>\n    </div>\n    <div id="dashboardTable" class="table"></div>\n</div>\n'}),define("text!includes/dashboard/speedTestTemplate.html",[],function(){return'<div class="speedometer">\n    <div class="speedometer-tachring speedometer-ring--grey"></div>\n    <div class="speedometer-tachring speedometer-ring--glow"></div>\n    <div class="speedometer-tachring speedometer-tach--grey"></div>\n    <div class="speedometer-tachring">\n        <span class="speedometer-tach-icon speedometer-tach-icon-1"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-2"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-3"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-4"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-5"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-6"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-7"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-8"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-9"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-10"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-11"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-12"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-13"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-14"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-15"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-16"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-17"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-18"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-19"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-20"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-21"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-22"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-23"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-24"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-25"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-26"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-27"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-28"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-29"></span>\n        <span class="speedometer-tach-icon speedometer-tach-icon-30"></span>\n    </div>\n    \n    <div class="speedometer-stats">\n        <span class="testing-ping"><%- msg.G_TestingPing %></span>\n        <div class="speedtest-error-message"><%- msg.E_Retest %></div>\n        <a href="#" class="button button-test"><%- msg.G_Retest %></a>\n        <div class="result">\n            <span class="value"></span>\n            <span class="unit">Mbps</span>\n        </div>\n    </div>\n</div>\n\n<div class="speedtest-progress">\n    <div class="icon icon-globe"></div>\n    <div id="speedtest-progress-bars" class="speedtest-progress-bars"></div>\n    <div class="icon icon-shield"></div>\n</div>\n\n<div class="speedtest-results">\n    <div class="speedtest-result speedtest-ping">\n        <div class="appSpinner"></div>\n        <div class="result">\n            <span class="value"></span>\n            <span class="unit">ms</span>\n        </div>\n        <h4><%- msg.G_Ping %></h4>\n    </div>\n    <div class="speedtest-result speedtest-download">\n        <div class="appSpinner"></div>\n        <div class="result">\n            <span class="value"></span>\n            <span class="unit">Mbps</span>\n        </div>\n        <h4><%- msg.G_Download %></h4>\n    </div>\n    <div class="speedtest-result speedtest-upload">\n        <div class="appSpinner"></div>\n        <div class="result">\n            <span class="value"></span>\n            <span class="unit">Mbps</span>\n        </div>\n        <h4><%- msg.G_Upload %></h4>\n    </div>\n</div>\n'}),define("libs/fixedqueue",["jquery","underscore","backbone","msg/Msg"],function(e,t,i,a){"use strict";function n(e,t){t=t||[];var i=Array.apply(null,t);return i.fixedSize=e,i.push=n.push,i.splice=n.splice,i.unshift=n.unshift,i.setAll=n.setAll,n.trimTail.call(i),i}return n.trimHead=function(){this.length<=this.fixedSize||Array.prototype.splice.call(this,0,this.length-this.fixedSize)},n.trimTail=function(){this.length<=this.fixedSize||Array.prototype.splice.call(this,this.fixedSize,this.length-this.fixedSize)},n.wrapMethod=function(e,t){var i=function(){var i=Array.prototype[e],a=i.apply(this,arguments);return t.call(this),a};return i},n.push=n.wrapMethod("push",n.trimHead),n.splice=n.wrapMethod("splice",n.trimTail),n.unshift=n.wrapMethod("unshift",n.trimTail),n.setAll=function(e){for(var t=0;t<this.fixedSize;t++)this.push(e)},n}),define("unifi/view/dashboard/SpeedTestView",["unifi/view/app/DialogView","text!includes/dashboard/speedTestTemplate.html","msg/Msg","backbone","underscore","jquery","libs/fixedqueue"],function(e,t,i,a,n,o,r){"use strict";return e.extend({fastInterval:50,slowInterval:3e3,pollingIntervalms:3e3,uploadInitialized:!1,progressBarCount:66,tachIconCount:30,tachDelayInterval:35,tachFadeSpeed:80,maxMbps:100,dialogOptions:{width:430,height:435,modal:!0,resizable:!1,draggable:!1,dialogClass:"dialog-speedtest"},initialize:function(e){n.bindAll(this),this.app=e.app,this.model=e.model,this.progressBars=new r(this.progressBarCount)},render:function(){this.$el.html(n.template(t,{msg:i})),this.$speedometerGlow=this.$(".speedometer-ring--glow"),this.$testingPing=this.$(".testing-ping"),this.$buttonTest=this.$(".button-test"),this.$errorMessage=this.$(".speedtest-error-message"),this.$speedometerStatsResult=this.$(".speedometer-stats").find(".result"),this.$speedometerStatsValue=this.$speedometerStatsResult.find(".value"),this.$(".ui-icon-closethick").removeClass("ui-icon-closethick"),this.$tachRing=this.$(".speedometer-tachring"),this.$tachSegments=this.$(".speedometer-tach-icon"),this.currentTachSegmentsGlowing=0,this.$progressBars=this.$("#speedtest-progress-bars"),this.$pingWrapper=this.$(".speedtest-ping"),this.$pingResult=this.$(".speedtest-ping.speedtest-result").find(".result"),this.$pingValue=this.$pingResult.find(".value"),this.$downloadWrapper=this.$(".speedtest-download"),this.$downloadResult=this.$(".speedtest-download.speedtest-result").find(".result"),this.$downloadValue=this.$downloadResult.find(".value"),this.$uploadWrapper=this.$(".speedtest-upload"),this.$uploadResult=this.$(".speedtest-upload.speedtest-result").find(".result"),this.$uploadValue=this.$uploadResult.find(".value"),this.generateSpeedTestProgressBarHTML(),this.bindEventListeners()},bindEventListeners:function(){this.listenTo(this.model,"sync",this.onTestProgress),this.listenTo(this.model,"change:xput_download",this.onDownloadStatusChange),this.listenTo(this.model,"change:xput_upload",this.onUploadStatusChange),this.listenTo(this.model,"change:status_ping",this.onPingStatusChange),this.listenTo(this.model,"change:status_download",this.onDownloadStatusChange),this.listenTo(this.model,"change:status_upload",this.onUploadStatusChange),this.listenTo(this.model,"change:status_summary",this.onSummaryStatusChange),this.listenTo(this.model,"change:timestamp",this.onUpdateFromServer),this.$buttonTest.on("click",this.startTest)},open:function(){e.prototype.open.call(this),o.Window.on("resize.speedTestDialog",n.debounce(this.onResizeWindow,250)),this.onResizeWindow(),this.startTest(),this.removeTooltips()},close:function(){e.prototype.close.call(this),o.Window.off("resize.speedTestDialog"),this.removeTooltips()},removeTooltips:function(){o(".ui-tooltip-content").parents("div").remove()},onResizeWindow:function(){this.center()},generateSpeedTestProgressBarHTML:function(){for(var e=[],t=0;t<this.progressBarCount;t++)e.push('<span class="speedtest-progress-bar speedtest-progress-bar-'+t+'"><span class="value"></span></span>');this.$progressBars.html(e.join(""))},polling:function(){var e=this;this.pollingInterval&&this.stopPolling(),1===this.model.getStatus("download")||1===this.model.getStatus("upload")?this.pollingIntervalms=this.fastInterval:this.pollingIntervalms=this.slowInterval,this.pollingInterval=window.setInterval(function(){e.model.fetch()},this.pollingIntervalms)},stopPolling:function(){window.clearInterval(this.pollingInterval)},startTest:function(e){e&&e.preventDefault(),this.uploadInitialized=!1,this.progressBars.setAll(0),this.model.clear(),this.model.sync("start",this.model,{}),this.onTestStart()},onTestStart:function(){this.$speedometerGlow.show(),this.$testingPing.show(),this.$speedometerStatsResult.hide(),this.$buttonTest.hide(),this.hideErrorMessage(),this.hideResults(),this.onTestProgress()},hideResults:function(){this.$pingResult.addClass("hide"),this.$downloadResult.addClass("hide"),this.$uploadResult.addClass("hide")},hideStatuses:function(){this.$testingPing.hide(),this.$speedometerStatsResult.hide()},onTestProgress:function(){this.onPingStatusChange(),this.onDownloadStatusChange(),this.onUploadStatusChange(),this.onSummaryStatusChange()},onTestComplete:function(){this.stopPolling(),this.$speedometerGlow.hide(),this.$speedometerStatsResult.hide(),this.resetProgressBars(),this.resetTachRing(),this.$buttonTest.show()},onPingStatusChange:function(){this.updateStatus("ping",this.$pingResult,this.$pingValue,this.$pingWrapper)},onDownloadStatusChange:function(){this.updateStatus("download",this.$downloadResult,this.$downloadValue,this.$downloadWrapper)},onUploadStatusChange:function(){this.updateStatus("upload",this.$uploadResult,this.$uploadValue,this.$uploadWrapper);
},onSummaryStatusChange:function(){this.updateStatus("summary")},onUpdateFromServer:function(){this.model.getProgressRecords()},updateStatusTitle:function(e,t){var i=this.model.getStatus(e);"ping"===e&&2>i||1===i?t.addClass("running"):t.removeClass("running")},updateStatus:function(e,t,i,a){var n=!1;switch("summary"!==e&&this.updateStatusTitle(e,a),this.model.getStatus(e)){case 0:break;case 1:("download"===e||"upload"===e)&&("upload"===e&&this.uploadInitialized===!1&&(this.progressBars.setAll(0),this.resetProgressBars(),this.resetTachRing(),this.uploadInitialized=!0),this.updateTachRing(e),this.updateProgressBars(e));break;case 2:"summary"===e?n=!0:("ping"===e&&this.$testingPing.hide(),a.removeClass("running"),this.showResult(this.model.getResult(e),t,i));break;case 3:n=!0,this.hideStatuses(),this.showErrorMessage()}n?this.onTestComplete():this.polling()},showResult:function(e,t,i){i.text(e),t.removeClass("hide")},updateTachRing:function(e){var t,i,a,n=100*this.model.getResult(e),o=this.model.convertMbpsToPercentage(n,this.maxMbps),r=Math.ceil(this.tachIconCount*(o/100));if(t=r-this.currentTachSegmentsGlowing,0!==t){if(this.removeFlickeringTachSegment(this.currentTachSegmentsGlowing-1),t>0)for(i=0;t>i;i++)this._fadeTachSegment(this.currentTachSegmentsGlowing+i,i*this.tachDelayInterval,!0);else if(0>t)for(i=-1,a=1;i>=t;i--,a++)this._fadeTachSegment(this.currentTachSegmentsGlowing+i,a*this.tachDelayInterval,!1);this.flickerTachSegment(r-1),this.currentTachSegmentsGlowing=r}this.$speedometerStatsResult.show(),this.$speedometerStatsValue.text(this.model.convertToMbps(n).toFixed(2))},flickerTachSegment:function(e){e>-1&&e<this.tachIconCount&&this.$tachSegments.eq(e).addClass("flicker")},removeFlickeringTachSegment:function(e){e>-1&&e<this.tachIconCount&&this.$tachSegments.eq(e).removeClass("flicker")},_fadeTachSegment:function(e,t,i){e>-1&&e<this.tachIconCount&&this.$tachSegments.eq(e).delay(t).stop(!0,!0)[i?"fadeIn":"fadeOut"](this.tachFadeSpeed)},resetTachRing:function(){this.removeFlickeringTachSegment(this.currentTachSegmentsGlowing);for(var e=0,t=1;e>=-this.currentTachSegmentsGlowing;e--,t++)this.tachIconCount+e>-1&&this.$tachSegments.eq(this.currentTachSegmentsGlowing+e).delay(t*this.tachDelayInterval).fadeOut(this.tachFadeSpeed);this.currentTachSegmentsGlowing=0},updateProgressBars:function(e){var t,i,a=100*this.model.getResult(e);"download"===e?this.progressBars.push(a):this.progressBars.unshift(a),n.each(this.progressBars,function(e,a){t=this.model.convertMbpsToPercentage(e,this.maxMbps),i=(100-t).toFixed(2),this.$progressBars.find(".speedtest-progress-bar-"+a).find(".value").height(i+"%")},this)},resetProgressBars:function(){this.$progressBars.find(".speedtest-progress-bar").find(".value").height("100%")},showErrorMessage:function(){this.$errorMessage.show()},hideErrorMessage:function(){this.$errorMessage.hide()},remove:function(){this.stopListening(this.model,"sync",this.onTestProgress),this.stopListening(this.model,"change:xput_download",this.onDownloadStatusChange),this.stopListening(this.model,"change:xput_upload",this.onUploadStatusChange),this.stopListening(this.model,"change:status_ping",this.onPingStatusChange),this.stopListening(this.model,"change:status_download",this.onDownloadStatusChange),this.stopListening(this.model,"change:status_upload",this.onUploadStatusChange),this.stopListening(this.model,"change:status_summary",this.onSummaryStatusChange),this.stopListening(this.model,"change:timestamp",this.onUpdateFromServer),this.$buttonTest.off("click",this.startTest),o.Window.off("resize.speedTestDialog"),e.prototype.remove.apply(this,arguments)}})}),define("unifi/view/dashboard/IndexView",["unifi/view/app/ContentView","unifi/view/dashboard/LayerView","unifi/collection/Subsystems","unifi/model/Subsystem","unifi/model/SpeedTest","ubnt/backgrid","underscore","jquery","unifi/collection/Alerts","unifi/collection/Devices","text!includes/dashboard/dashboardIndexTemplate.html","unifi/view/dashboard/SpeedTestView","ubnt/view/dialogs/ErrorDialogView","msg/Msg"],function(e,t,i,a,n,o,r,s,c,l,d,m,u,h){"use strict";return e.extend({id:"dashboardIndex",layers:{},speedtest_status:"",pollingSpeedtestInterval:null,initialize:function(t){e.prototype.initialize.call(this,t),this.layers={},this.template=r.template(d),s.when(this._rendered=s.Deferred(),this._dependencies=s.Deferred()).then(this.populate,this.failed),this.dependencies(),this.render()},dependencies:function(){var e,t={Subsystems:i,Alerts:c,Devices:l},a=[],n={},o=this;r.each(t,function(e,t){a.push(n[t]=s.Deferred())},this),s.when.apply(s,a).then(function(){o._dependencies.resolve()},function(){o._dependencies.reject()}),r.each(t,function(t,i){e={fetch:{reload:!1,deferred:n[i]}},"Alerts"===i&&(e.fetch.method="unarchived"),this.options.app.collection(i,e,t)},this)},failed:function(){(new u).open(h.E_DataLoad)},onAlertsChange:function(){r.each(this.subsystems.possibleSubsystems,function(e){this.layers[e.toUpperCase()].model.set("notifications",this.alerts.where({system:e,archived:!1}))},this)},render:function(){if(e.prototype.render.call(this),!this.rendered&&(this.rendered=!0)){var i,o,c,l=this;this.$el.html(this.template({msg:h})),this.speedTestModel=new n,this.speedTestModel.fetch(),this.speedTestView=new m({app:this.app,model:this.speedTestModel}),this.subsystems=this.options.app.collection("Subsystems"),this.alerts=this.options.app.collection("Alerts"),this.devices=this.options.app.collection("Devices"),this.listenTo(this.alerts,"change",r.debounce(this.onAlertsChange,500)),this.listenTo(this.alerts,"add",r.debounce(this.onAlertsChange,500)),this.listenTo(this.alerts,"remove",r.debounce(this.onAlertsChange,500)),this.listenTo(this.alerts,"reset",r.debounce(this.onAlertsChange,500)),this.listenTo(this.subsystems,"reset change sync",r.debounce(this.populate,500)),this.$speedTest=s("#speedtest"),this.$speedTestButton=this.$speedTest.find(".button-test").on("click",this.triggerSpeedTest),this.$speedTestUploadResult=this.$speedTest.find(".speedtest-upload .result"),this.$speedTestUploadValue=this.$speedTestUploadResult.find(".value"),this.$speedTestDownloadResult=this.$speedTest.find(".speedtest-download .result"),this.$speedTestDownloadValue=this.$speedTestDownloadResult.find(".value"),this.$speedLastRunResult=this.$speedTest.find(".speedtest-lastrun .result"),this.$speedLastRunValue=this.$speedLastRunResult.find(".value"),this.listenTo(this.speedTestModel,"change:status_download change:status_upload change:timestamp",this.onSpeedTestChangeStatus),c=s("#navSettings").find("a"),r.each(this.subsystems.possibleSubsystems,function(e,n){switch(i=!1,o=function(){l.app.routers.statistics.forward()},e){case"www":o=!1;break;case"wan":i=function(){var t=l.subsystems.findWhere({subsystem:e}),i=l.devices.findWhere({mac:t.get("gw_mac")});s("#devicesIndex").find(".mac-"+i.getMacNoColons()+" .column-name").click()},o=!1;break;case"lan":i=function(){c.click(),s("#navSettingsNetworks").find("a").click()},o=!1;break;case"wlan":i=function(){c.click(),s("#navSettingsWirelessNetworks").find("a").click()}}l.layers[e.toUpperCase()]=new t({model:new a({subsystem:e,configureLink:i,statsLink:o}),$tableItem:l.$(".table-item."+e),el:".layer."+e,app:l.app})}),this.$nodeWWW=s(".nodes .www"),"resolved"===this._rendered.state()&&"resolved"==this._dependencies.state()?this.populate():"pending"===this._rendered.state()&&this._rendered.resolve()}},populate:function(){var e;r.each(this.subsystems.possibleSubsystems,function(t){e=this.subsystems.findWhere({subsystem:t}),this.layers[t.toUpperCase()].update(e)},this),this.$nodeWWW.hasClass("ok")?this.addSpeedTestEvents():this.removeSpeedTestEvents(),this.speedTestModel.isTesting&&this.addSpeedTestEvents()},showSpeedTest:function(){this.$speedTest.show()},hideSpeedTest:function(){this.$speedTest.hide()},closeSpeedTest:function(){return this.hideSpeedTest(),this.addSpeedTestEvents(),!1},addSpeedTestEvents:function(){this.$nodeWWW.on("mouseenter",this.showSpeedTest).on("mouseleave",this.hideSpeedTest)},removeSpeedTestEvents:function(){this.$nodeWWW.off("mouseenter",this.showSpeedTest).off("mouseleave",this.hideSpeedTest)},triggerSpeedTest:function(){return this.speedTestView.open(),this.$speedTestButton.text(h.localize(h.G_Retest)),!1},onSpeedTestChangeStatus:function(){var e=!1,t=!1,i=!1;2===this.speedTestModel.getStatus("download")&&(this.$speedTestDownloadValue.text(this.speedTestModel.getDownloadSpeed()),this.$speedTestDownloadResult.show(),e=!0),2===this.speedTestModel.getStatus("upload")&&(this.$speedTestUploadValue.text(this.speedTestModel.getUploadSpeed()),this.$speedTestUploadResult.show(),t=!0),this.speedTestModel.get("rundate")&&(this.$speedLastRunValue.text(this.speedTestModel.getLastRun()),this.$speedLastRunResult.show(),i=!0),e&&t&&i?this.$speedTest.removeClass("notrun"):(this.$speedTest.addClass("notrun"),this.$speedTestDownloadValue.text(""),this.$speedTestUploadValue.text(""),this.$speedLastRunValue.text(""),this.$speedTestDownloadResult.hide(),this.$speedTestUploadResult.hide(),this.$speedLastRunResult.hide())},remove:function(){this.stopListening(this.alerts),this.stopListening(this.subsystems),this.$speedTest.find(".button-test").off("click",this.triggerSpeedTest),this.removeSpeedTestEvents(),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/router/DashboardRouter",["unifi/router/Router","unifi/view/dashboard/IndexView","unifi/view/dashboard/LayerView"],function(e,t,i){"use strict";return e.extend({_fullyQualifiedName:"UNIFI.Routers.Dashboard",_associatedViews:{Index:t,Layer:i},routes:{dashboard:"index","dashboard?d=:d":"index"}})}),define("text!includes/map/mapIndexTemplate.html",[],function(){return'<div id="Map" class="tab-content">\n    <div class="toolbar">\n        <div class="map-configuration-items">\n            <div class="buttonset left coverage">\n                <input type="radio" id="mapFilterCoverage2G" name="coverageFilter" value="2G" checked="checked"/>\n                <label for="mapFilterCoverage2G"><%- msg.G_2G %></label>\n                <input type="radio" id="mapFilterCoverage5G" name="coverageFilter" value="5G" />\n                <label for="mapFilterCoverage5G"><%- msg.G_5G %></label>\n            </div>\n            <div class="buttonset left mainToggles">\n                <input type="checkbox" id="mapFilterDetails" name="filter" value="details" />\n                <label for="mapFilterDetails"><%- msg.G_MapDetails %></label>\n                <input type="checkbox" id="mapFilterCoverage" name="filter" value="coverage" />\n                <label for="mapFilterCoverage"><%- msg.G_MapCoverage %></label>\n                <input type="checkbox" id="mapFilterTopology" name="filter" value="topology" />\n                <label for="mapFilterTopology"><%- msg.G_MapTopology %></label>\n            </div>\n            <div class="right">\n                <select name="mapSelect" class="mapSelect"></select>\n            </div>\n        </div>\n        <div class="zoom-controls">\n            <div class="ir zoom-icon plus"><div class="plus-icon ubnt-icon-plus"></div></div>\n            <div class="zoom-slider"></div>\n            <div class="ir zoom-icon minus"><div class="minus-icon ubnt-icon-minus"></div></div>\n        </div>\n        <div class="ruler is-admin">\n            <div class="ruler-icon ubnt-icon-scale"></div>\n            <div class="sub-section">\n                <div class="sub-section-title"><%- msg.G_MapSetMapScale %></div>\n                <div class="ubnt-icon-close close handle"></div>\n                <div class="tip"><%- msg.G_MapDrawLine %></div>\n                <form action="#" class="frm-map-scale">\n                    <input name="distance" type="text" maxlength="4" placeholder="distance" class="input distance left disabled" disabled/>\n                    <div>\n                        <select name="units" class="input units right">\n                            <option value="m"><%- msg.G_MapMeters %></option>\n                            <option value="f"><%- msg.G_MapFeet %></option>\n                        </select>\n                    </div>\n                    <button type="submit" class="button submit right disabled" disabled>\n                        <span class="icon ubnt-icon-check"></span>\n                        <%- msg.G_MapSetScale %>\n                    </button>\n                </form>\n            </div>\n        </div>\n    </div>\n\n    <div class="ubnt-map-widget">\n        <div class="image-map-container map-container">\n            <div class="image-map-coverage-layer"></div>\n            <div class="image-drag-layer">\n                <div class="image-map-layer">\n                    <canvas class="map-canvas"></canvas>\n                </div>\n                <div class="sub-marker-layer"></div>\n                <div class="marker-layer"></div>\n            </div>\n        </div>\n        <div class="google-map-container map-container">\n            <div class="loading"></div>\n        </div>\n    </div>\n\n    <div class="scale">\n        <div class="scale-icon"></div>\n        <div class="scale-measurement"></div>\n    </div>\n\n    <div class="marker-drawer">\n        <button class="button header handle is-admin"><span class="unplaced-markers-count"></span> <%- msg.G_MapUnplacedDevices %></button>\n        <div class="unplaced-devices">\n            <h3 class="sub-section-title"><%- msg.G_MapUnplacedDevices %></h3>\n            <div class="ubnt-icon-close close handle"></div>\n            <ul class="marker-list draggable-list"></ul>\n        </div>\n    </div>\n</div>'}),define("text!includes/map/mapMarkerTemplate.html",[],function(){return'<div class="marker connected disconnected expand">\n    <div class="marker-button">\n        <div class="marker-icon device-icons access-point ir forceRetina"></div>\n    </div>\n\n    <div class="status-icon">\n        <div class="disconnected sprite-status-disconnected"></div>\n        <div class="isolated sprite-status-isolated"></div>\n        <div class="vwireless sprite-status-vwireless"></div>\n    </div>\n    <div class="title"></div>\n    <div class="details">\n        <div class="detail"><div class="ap-name"></div></div>\n        <div class="detail mac-text"><span></span> <div class="mac"></div></div>\n        <div class="detail users-text"><span></span> <div class="users"></div></div>\n        <div class="detail guests-text"><span></span> <div class="guests"></div></div>\n    </div>\n    <div class="halo"></div>\n    <div class="ir move"></div>\n    <div class="sub-buttons">\n        <div class="button-container lock">\n            <div class="button"><div class="icon ubnt-icon-unlock"></div></div>\n        </div>\n\n        <div class="button-container config">\n            <div class="button"><div class="icon ubnt-icon-gear"></div></div>\n        </div>\n\n        <div class="button-container remove">\n            <div class="button"><div class="icon ubnt-icon-close"></div></div>\n        </div>\n\n        <div class="button-container scan">\n            <div class="button"><div class="icon ubnt-icon-histogram"></div></div>\n        </div>\n    </div>\n</div>'}),define("text!includes/map/mapUnplacedMarkerTemplate.html",[],function(){return'<li class="device-list-item">\n    <a href="#">\n    	<span class="ui-icon device-icons access-point half"></span>\n    	<span class="item-label"></span>\n    </a>\n</li>'}),define("text!includes/map/mapUnplacedMarkerDraggableTemplate.html",[],function(){return'<div class="map-widget-marker helper marker expand">\n    <div class="marker-button">\n        <div class="marker-icon device-icons access-point ir ui-icon"></div>\n    </div>\n</div>'});var Kinetic={};!function(){Kinetic.version="4.3.3",Kinetic.Filters={},Kinetic.Plugins={},Kinetic.Global={stages:[],idCounter:0,ids:{},names:{},shapes:{},warn:function(e){window.console&&console.warn&&console.warn("Kinetic warning: "+e)},extend:function(e,t){for(var i in t.prototype)i in e.prototype||(e.prototype[i]=t.prototype[i])},_addId:function(e,t){void 0!==t&&(this.ids[t]=e)},_removeId:function(e){void 0!==e&&delete this.ids[e]},_addName:function(e,t){void 0!==t&&(void 0===this.names[t]&&(this.names[t]=[]),this.names[t].push(e))},_removeName:function(e,t){if(void 0!==e){var i=this.names[e];if(void 0!==i){for(var a=0;a<i.length;a++){var n=i[a];n._id===t&&i.splice(a,1)}0===i.length&&delete this.names[e]}}}}}(),function(e,t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define("libs/kinetic",t):e.returnExports=t()}(this,function(){return Kinetic}),function(){Kinetic.Type={_isElement:function(e){return!(!e||1!=e.nodeType)},_isFunction:function(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isObject:function(e){return!!e&&e.constructor==Object},_isArray:function(e){return"[object Array]"==Object.prototype.toString.call(e)},_isNumber:function(e){return"[object Number]"==Object.prototype.toString.call(e)},_isString:function(e){return"[object String]"==Object.prototype.toString.call(e)},_hasMethods:function(e){var t=[];for(var i in e)this._isFunction(e[i])&&t.push(i);return t.length>0},_isInDocument:function(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_getXY:function(e){if(this._isNumber(e))return{x:e,y:e};if(this._isArray(e)){if(1===e.length){var t=e[0];if(this._isNumber(t))return{x:t,y:t};if(this._isArray(t))return{x:t[0],y:t[1]};if(this._isObject(t))return t}else if(e.length>=2)return{x:e[0],y:e[1]}}else if(this._isObject(e))return e;return null},_getSize:function(e){if(this._isNumber(e))return{width:e,height:e};if(this._isArray(e))if(1===e.length){var t=e[0];if(this._isNumber(t))return{width:t,height:t};if(this._isArray(t)){if(t.length>=4)return{width:t[2],height:t[3]};if(t.length>=2)return{width:t[0],height:t[1]}}else if(this._isObject(t))return t}else{if(e.length>=4)return{width:e[2],height:e[3]};if(e.length>=2)return{width:e[0],height:e[1]}}else if(this._isObject(e))return e;return null},_getPoints:function(e){if(void 0===e)return[];if(this._isArray(e[0])){for(var t=[],i=0;i<e.length;i++)t.push({x:e[i][0],y:e[i][1]});return t}if(this._isObject(e[0]))return e;for(var t=[],i=0;i<e.length;i+=2)t.push({x:e[i],y:e[i+1]});return t},_getImage:function(e,t){if(e)if(this._isElement(e))t(e);else if(this._isString(e)){var i=new Image;i.onload=function(){t(i)},i.src=e}else if(e.data){var a=document.createElement("canvas");a.width=e.width,a.height=e.height;var n=a.getContext("2d");n.putImageData(e,0,0);var o=a.toDataURL(),i=new Image;i.onload=function(){t(i)},i.src=o}else t(null);else t(null)},_rgbToHex:function(e,t,i){return((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1)},_hexToRgb:function(e){var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},_getRandomColorKey:function(){var e=Math.round(255*Math.random()),t=Math.round(255*Math.random()),i=Math.round(255*Math.random());return this._rgbToHex(e,t,i)},_merge:function(e,t){var i=this._clone(t);for(var a in e)this._isObject(e[a])?i[a]=this._merge(e[a],i[a]):i[a]=e[a];return i},_clone:function(e){var t={};for(var i in e)this._isObject(e[i])?t[i]=this._clone(e[i]):t[i]=e[i];return t},_degToRad:function(e){return e*Math.PI/180},_radToDeg:function(e){return 180*e/Math.PI}}}(),function(){var e=document.createElement("canvas"),t=e.getContext("2d"),i=window.devicePixelRatio||1,a=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1,n=i/a;Kinetic.Canvas=function(e,t,i){this.pixelRatio=i||n,this.width=e,this.height=t,this.element=document.createElement("canvas"),this.context=this.element.getContext("2d"),this.setSize(e||0,t||0)},Kinetic.Canvas.prototype={clear:function(){var e=this.getContext(),t=this.getElement();e.clearRect(0,0,t.width,t.height)},getElement:function(){return this.element},getContext:function(){return this.context},setWidth:function(e){this.width=e,this.element.width=e*this.pixelRatio,this.element.style.width=e+"px"},setHeight:function(e){this.height=e,this.element.height=e*this.pixelRatio,this.element.style.height=e+"px"},getWidth:function(){return this.width},getHeight:function(){return this.height},setSize:function(e,t){this.setWidth(e),this.setHeight(t)},toDataURL:function(e,t){try{return this.element.toDataURL(e,t)}catch(i){try{return this.element.toDataURL()}catch(i){return Kinetic.Global.warn("Unable to get data URL. "+i.message),""}}},fill:function(e){e.getFillEnabled()&&this._fill(e)},stroke:function(e){e.getStrokeEnabled()&&this._stroke(e)},fillStroke:function(e){var t=e.getFillEnabled();t&&this._fill(e),e.getStrokeEnabled()&&this._stroke(e,e.hasShadow()&&e.hasFill()&&t)},applyShadow:function(e,t){var i=this.context;i.save(),this._applyShadow(e),t(),i.restore(),t()},_applyLineCap:function(e){var t=e.getLineCap();t&&(this.context.lineCap=t)},_applyOpacity:function(e){var t=e.getAbsoluteOpacity();1!==t&&(this.context.globalAlpha=t)},_applyLineJoin:function(e){var t=e.getLineJoin();t&&(this.context.lineJoin=t)},_applyAncestorTransforms:function(e){var t=this.context;e._eachAncestorReverse(function(e){var i=e.getTransform(),a=i.getMatrix();t.transform(a[0],a[1],a[2],a[3],a[4],a[5])},!0)}},Kinetic.SceneCanvas=function(e,t,i){Kinetic.Canvas.call(this,e,t,i)},Kinetic.SceneCanvas.prototype={setWidth:function(e){var t=this.pixelRatio;Kinetic.Canvas.prototype.setWidth.call(this,e),this.context.scale(t,t)},setHeight:function(e){var t=this.pixelRatio;Kinetic.Canvas.prototype.setHeight.call(this,e),this.context.scale(t,t)},_fillColor:function(e){var t=this.context,i=e.getFill();t.fillStyle=i,e._fillFunc(t)},_fillPattern:function(e){var t=this.context,i=e.getFillPatternImage(),a=e.getFillPatternX(),n=e.getFillPatternY(),o=e.getFillPatternScale(),r=e.getFillPatternRotation(),s=e.getFillPatternOffset(),c=e.getFillPatternRepeat();(a||n)&&t.translate(a||0,n||0),r&&t.rotate(r),o&&t.scale(o.x,o.y),s&&t.translate(-1*s.x,-1*s.y),t.fillStyle=t.createPattern(i,c||"repeat"),t.fill()},_fillLinearGradient:function(e){for(var t=this.context,i=e.getFillLinearGradientStartPoint(),a=e.getFillLinearGradientEndPoint(),n=e.getFillLinearGradientColorStops(),o=t.createLinearGradient(i.x,i.y,a.x,a.y),r=0;r<n.length;r+=2)o.addColorStop(n[r],n[r+1]);t.fillStyle=o,t.fill()},_fillRadialGradient:function(e){for(var t=this.context,i=e.getFillRadialGradientStartPoint(),a=e.getFillRadialGradientEndPoint(),n=e.getFillRadialGradientStartRadius(),o=e.getFillRadialGradientEndRadius(),r=e.getFillRadialGradientColorStops(),s=t.createRadialGradient(i.x,i.y,n,a.x,a.y,o),c=0;c<r.length;c+=2)s.addColorStop(r[c],r[c+1]);t.fillStyle=s,t.fill()},_fill:function(e,t){var i=this.context,a=e.getFill(),n=e.getFillPatternImage(),o=e.getFillLinearGradientStartPoint(),r=e.getFillRadialGradientStartPoint(),s=e.getFillPriority();i.save(),!t&&e.hasShadow()&&this._applyShadow(e),a&&"color"===s?this._fillColor(e):n&&"pattern"===s?this._fillPattern(e):o&&"linear-gradient"===s?this._fillLinearGradient(e):r&&"radial-gradient"===s?this._fillRadialGradient(e):a?this._fillColor(e):n?this._fillPattern(e):o?this._fillLinearGradient(e):r&&this._fillRadialGradient(e),i.restore(),!t&&e.hasShadow()&&this._fill(e,!0)},_stroke:function(e,t){var i=this.context,a=e.getStroke(),n=e.getStrokeWidth(),o=e.getDashArray();(a||n)&&(i.save(),this._applyLineCap(e),o&&e.getDashArrayEnabled()&&(i.setLineDash?i.setLineDash(o):"mozDash"in i?i.mozDash=o:"webkitLineDash"in i&&(i.webkitLineDash=o)),!t&&e.hasShadow()&&this._applyShadow(e),i.lineWidth=n||2,i.strokeStyle=a||"black",e._strokeFunc(i),i.restore(),!t&&e.hasShadow()&&this._stroke(e,!0))},_applyShadow:function(e){var t=this.context;if(e.hasShadow()&&e.getShadowEnabled()){var i=e.getAbsoluteOpacity(),a=e.getShadowColor()||"black",n=e.getShadowBlur()||5,o=e.getShadowOffset()||{x:0,y:0};e.getShadowOpacity()&&(t.globalAlpha=e.getShadowOpacity()*i),t.shadowColor=a,t.shadowBlur=n,t.shadowOffsetX=o.x,t.shadowOffsetY=o.y}}},Kinetic.Global.extend(Kinetic.SceneCanvas,Kinetic.Canvas),Kinetic.HitCanvas=function(e,t,i){Kinetic.Canvas.call(this,e,t,i)},Kinetic.HitCanvas.prototype={_fill:function(e){var t=this.context;t.save(),t.fillStyle="#"+e.colorKey,e._fillFuncHit(t),t.restore()},_stroke:function(e){var t=this.context,i=e.getStroke(),a=e.getStrokeWidth();(i||a)&&(this._applyLineCap(e),t.save(),t.lineWidth=a||2,t.strokeStyle="#"+e.colorKey,e._strokeFuncHit(t),t.restore())}},Kinetic.Global.extend(Kinetic.HitCanvas,Kinetic.Canvas)}(),function(){Kinetic.Tween=function(e,t,i,a,n,o){this._listeners=[],this.addListener(this),this.obj=e,this.propFunc=t,this.begin=a,this._pos=a,this.setDuration(o),this.isPlaying=!1,this._change=0,this.prevTime=0,this.prevPos=0,this.looping=!1,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.name="",this.func=i,this.setFinish(n)},Kinetic.Tween.prototype={setTime:function(e){this.prevTime=this._time,e>this.getDuration()?this.looping?(this.rewind(e-this._duration),this.update(),this.broadcastMessage("onLooped",{target:this,type:"onLooped"})):(this._time=this._duration,this.update(),this.stop(),this.broadcastMessage("onFinished",{target:this,type:"onFinished"})):0>e?(this.rewind(),this.update()):(this._time=e,this.update())},getTime:function(){return this._time},setDuration:function(e){this._duration=null===e||0>=e?1e5:e},getDuration:function(){return this._duration},setPosition:function(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e,this.broadcastMessage("onChanged",{target:this,type:"onChanged"})},getPosition:function(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this._duration)},setFinish:function(e){this._change=e-this.begin},getFinish:function(){return this.begin+this._change},start:function(){this.rewind(),this.startEnterFrame(),this.broadcastMessage("onStarted",{target:this,type:"onStarted"})},rewind:function(e){this.stop(),this._time=void 0===e?0:e,this.fixTime(),this.update()},fforward:function(){this._time=this._duration,this.fixTime(),this.update()},update:function(){this.setPosition(this.getPosition(this._time))},startEnterFrame:function(){this.stopEnterFrame(),this.isPlaying=!0,this.onEnterFrame()},onEnterFrame:function(){this.isPlaying&&this.nextFrame()},nextFrame:function(){this.setTime((this.getTimer()-this._startTime)/1e3)},stop:function(){this.stopEnterFrame(),this.broadcastMessage("onStopped",{target:this,type:"onStopped"})},stopEnterFrame:function(){this.isPlaying=!1},continueTo:function(e,t){this.begin=this._pos,this.setFinish(e),void 0!==this._duration&&this.setDuration(t),this.start()},resume:function(){this.fixTime(),this.startEnterFrame(),this.broadcastMessage("onResumed",{target:this,type:"onResumed"})},yoyo:function(){this.continueTo(this.begin,this._time)},addListener:function(e){return this.removeListener(e),this._listeners.push(e)},removeListener:function(e){for(var t=this._listeners,i=t.length;i--;)if(t[i]==e)return t.splice(i,1),!0;return!1},broadcastMessage:function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);for(var i=e.shift(),a=this._listeners,n=a.length,t=0;n>t;t++)a[t][i]&&a[t][i].apply(a[t],e)},fixTime:function(){this._startTime=this.getTimer()-1e3*this._time},getTimer:function(){return(new Date).getTime()-this._time}},Kinetic.Tweens={"back-ease-in":function(e,t,i,a,n,o){var r=1.70158;return i*(e/=a)*e*((r+1)*e-r)+t},"back-ease-out":function(e,t,i,a,n,o){var r=1.70158;return i*((e=e/a-1)*e*((r+1)*e+r)+1)+t},"back-ease-in-out":function(e,t,i,a,n,o){var r=1.70158;return(e/=a/2)<1?i/2*(e*e*(((r*=1.525)+1)*e-r))+t:i/2*((e-=2)*e*(((r*=1.525)+1)*e+r)+2)+t},"elastic-ease-in":function(e,t,i,a,n,o){var r=0;return 0===e?t:1==(e/=a)?t+i:(o||(o=.3*a),!n||n<Math.abs(i)?(n=i,r=o/4):r=o/(2*Math.PI)*Math.asin(i/n),-(n*Math.pow(2,10*(e-=1))*Math.sin((e*a-r)*(2*Math.PI)/o))+t)},"elastic-ease-out":function(e,t,i,a,n,o){var r=0;return 0===e?t:1==(e/=a)?t+i:(o||(o=.3*a),!n||n<Math.abs(i)?(n=i,r=o/4):r=o/(2*Math.PI)*Math.asin(i/n),n*Math.pow(2,-10*e)*Math.sin((e*a-r)*(2*Math.PI)/o)+i+t)},"elastic-ease-in-out":function(e,t,i,a,n,o){var r=0;return 0===e?t:2==(e/=a/2)?t+i:(o||(o=a*(.3*1.5)),!n||n<Math.abs(i)?(n=i,r=o/4):r=o/(2*Math.PI)*Math.asin(i/n),1>e?-.5*(n*Math.pow(2,10*(e-=1))*Math.sin((e*a-r)*(2*Math.PI)/o))+t:n*Math.pow(2,-10*(e-=1))*Math.sin((e*a-r)*(2*Math.PI)/o)*.5+i+t)},"bounce-ease-out":function(e,t,i,a){return(e/=a)<1/2.75?i*(7.5625*e*e)+t:2/2.75>e?i*(7.5625*(e-=1.5/2.75)*e+.75)+t:2.5/2.75>e?i*(7.5625*(e-=2.25/2.75)*e+.9375)+t:i*(7.5625*(e-=2.625/2.75)*e+.984375)+t},"bounce-ease-in":function(e,t,i,a){return i-Kinetic.Tweens["bounce-ease-out"](a-e,0,i,a)+t},"bounce-ease-in-out":function(e,t,i,a){return a/2>e?.5*Kinetic.Tweens["bounce-ease-in"](2*e,0,i,a)+t:.5*Kinetic.Tweens["bounce-ease-out"](2*e-a,0,i,a)+.5*i+t},"ease-in":function(e,t,i,a){return i*(e/=a)*e+t},"ease-out":function(e,t,i,a){return-i*(e/=a)*(e-2)+t},"ease-in-out":function(e,t,i,a){return(e/=a/2)<1?i/2*e*e+t:-i/2*(--e*(e-2)-1)+t},"strong-ease-in":function(e,t,i,a){return i*(e/=a)*e*e*e*e+t},"strong-ease-out":function(e,t,i,a){return i*((e=e/a-1)*e*e*e*e+1)+t},"strong-ease-in-out":function(e,t,i,a){return(e/=a/2)<1?i/2*e*e*e*e*e+t:i/2*((e-=2)*e*e*e*e+2)+t},linear:function(e,t,i,a){return i*e/a+t}}}(),function(){Kinetic.Transform=function(){this.m=[1,0,0,1,0,0]},Kinetic.Transform.prototype={translate:function(e,t){this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t},scale:function(e,t){this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t},rotate:function(e){var t=Math.cos(e),i=Math.sin(e),a=this.m[0]*t+this.m[2]*i,n=this.m[1]*t+this.m[3]*i,o=this.m[0]*-i+this.m[2]*t,r=this.m[1]*-i+this.m[3]*t;this.m[0]=a,this.m[1]=n,this.m[2]=o,this.m[3]=r},getTranslation:function(){return{x:this.m[4],y:this.m[5]}},multiply:function(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],i=this.m[1]*e.m[0]+this.m[3]*e.m[1],a=this.m[0]*e.m[2]+this.m[2]*e.m[3],n=this.m[1]*e.m[2]+this.m[3]*e.m[3],o=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],r=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];this.m[0]=t,this.m[1]=i,this.m[2]=a,this.m[3]=n,this.m[4]=o,this.m[5]=r},invert:function(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,i=-this.m[1]*e,a=-this.m[2]*e,n=this.m[0]*e,o=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),r=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);this.m[0]=t,this.m[1]=i,this.m[2]=a,this.m[3]=n,this.m[4]=o,this.m[5]=r},getMatrix:function(){return this.m}}}(),function(){Kinetic.Collection=function(){var e=[].slice.call(arguments),t=e.length,i=0;for(this.length=t;t>i;i++)this[i]=e[i];return this},Kinetic.Collection.prototype=new Array,Kinetic.Collection.prototype.apply=function(e){args=[].slice.call(arguments),args.shift();for(var t=0;t<this.length;t++)Kinetic.Type._isFunction(this[t][e])&&this[t][e].apply(this[t],args)},Kinetic.Collection.prototype.each=function(e){for(var t=0;t<this.length;t++)e.call(this[t],t,this[t])}}(),function(){Kinetic.Filters.Grayscale=function(e,t){for(var i=e.data,a=0;a<i.length;a+=4){var n=.34*i[a]+.5*i[a+1]+.16*i[a+2];i[a]=n,i[a+1]=n,i[a+2]=n}}}(),function(){Kinetic.Filters.Brighten=function(e,t){for(var i=t.val||0,a=e.data,n=0;n<a.length;n+=4)a[n]+=i,a[n+1]+=i,a[n+2]+=i}}(),function(){Kinetic.Filters.Invert=function(e,t){for(var i=e.data,a=0;a<i.length;a+=4)i[a]=255-i[a],i[a+1]=255-i[a+1],i[a+2]=255-i[a+2]}}(),function(){Kinetic.Node=function(e){this._nodeInit(e)},Kinetic.Node.prototype={_nodeInit:function(e){this._id=Kinetic.Global.idCounter++,this.defaultNodeAttrs={visible:!0,listening:!0,name:void 0,opacity:1,x:0,y:0,scale:{x:1,y:1},rotation:0,offset:{x:0,y:0},draggable:!1,dragOnTop:!0},this.setDefaultAttrs(this.defaultNodeAttrs),this.eventListeners={},this.setAttrs(e)},on:function(e,t){for(var i=e.split(" "),a=i.length,n=0;a>n;n++){var o=i[n],r=o,s=r.split("."),c=s[0],l=s.length>1?s[1]:"";this.eventListeners[c]||(this.eventListeners[c]=[]),this.eventListeners[c].push({name:l,handler:t})}},off:function(e){for(var t=e.split(" "),i=t.length,a=0;i>a;a++){var n=t[a],o=n,r=o.split("."),s=r[0];if(r.length>1)if(s)this.eventListeners[s]&&this._off(s,r[1]);else for(var n in this.eventListeners)this._off(n,r[1]);else delete this.eventListeners[s];
}},remove:function(){var e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices()),delete this.parent},destroy:function(){for(var e=(this.getParent(),this.getStage(),Kinetic.DD),t=Kinetic.Global;this.children&&this.children.length>0;)this.children[0].destroy();t._removeId(this.getId()),t._removeName(this.getName(),this._id),e&&e.node&&e.node._id===this._id&&node._endDrag(),this.trans&&this.trans.stop(),this.remove()},getAttrs:function(){return this.attrs},setDefaultAttrs:function(e){if(void 0===this.attrs&&(this.attrs={}),e)for(var t in e)void 0===this.attrs[t]&&(this.attrs[t]=e[t])},setAttrs:function(e){if(e)for(var t in e){var i="set"+t.charAt(0).toUpperCase()+t.slice(1);Kinetic.Type._isFunction(this[i])?this[i](e[t]):this.setAttr(t,e[t])}},getVisible:function(){var e=this.attrs.visible,t=this.getParent();return e&&t&&!t.getVisible()?!1:e},getListening:function(){var e=this.attrs.listening,t=this.getParent();return e&&t&&!t.getListening()?!1:e},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},getZIndex:function(){return this.index},getAbsoluteZIndex:function(){function e(n){for(var o=[],r=n.length,s=0;r>s;s++){var c=n[s];a++,"Shape"!==c.nodeType&&(o=o.concat(c.getChildren())),c._id===i._id&&(s=r)}o.length>0&&o[0].getLevel()<=t&&e(o)}var t=this.getLevel(),i=(this.getStage(),this),a=0;return"Stage"!==i.nodeType&&e(i.getStage().getChildren()),a},getLevel:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e},setPosition:function(){var e=Kinetic.Type._getXY([].slice.call(arguments));this.setAttr("x",e.x),this.setAttr("y",e.y)},getPosition:function(){var e=this.attrs;return{x:e.x,y:e.y}},getAbsolutePosition:function(){var e=this.getAbsoluteTransform(),t=this.getOffset();return e.translate(t.x,t.y),e.getTranslation()},setAbsolutePosition:function(){var e=Kinetic.Type._getXY([].slice.call(arguments)),t=this._clearTransform();this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y;var i=this.getAbsoluteTransform();i.invert(),i.translate(e.x,e.y),e={x:this.attrs.x+i.getTranslation().x,y:this.attrs.y+i.getTranslation().y},this.setPosition(e.x,e.y),this._setTransform(t)},move:function(){var e=Kinetic.Type._getXY([].slice.call(arguments)),t=this.getX(),i=this.getY();void 0!==e.x&&(t+=e.x),void 0!==e.y&&(i+=e.y),this.setPosition(t,i)},_eachAncestorReverse:function(e,t){var i=[],a=this.getParent();for(t&&i.unshift(this);a;)i.unshift(a),a=a.parent;for(var n=i.length,o=0;n>o;o++)e(i[o])},rotate:function(e){this.setRotation(this.getRotation()+e)},rotateDeg:function(e){this.setRotation(this.getRotation()+Kinetic.Type._degToRad(e))},moveToTop:function(){var e=this.index;return this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0},moveUp:function(){var e=this.index,t=this.parent.getChildren().length;return t-1>e?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):void 0},moveDown:function(){var e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):void 0},moveToBottom:function(){var e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):void 0},setZIndex:function(e){var t=this.index;this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices()},getAbsoluteOpacity:function(){var e=this.getOpacity();return this.getParent()&&(e*=this.getParent().getAbsoluteOpacity()),e},moveTo:function(e){Kinetic.Node.prototype.remove.call(this),e.add(this)},toObject:function(){var e=Kinetic.Type,t={},i=this.attrs;t.attrs={};for(var a in i){var n=i[a];e._isFunction(n)||e._isElement(n)||e._isObject(n)&&e._hasMethods(n)||(t.attrs[a]=n)}return t.nodeType=this.nodeType,t.shapeType=this.shapeType,t},toJSON:function(){return JSON.stringify(this.toObject())},getParent:function(){return this.parent},getLayer:function(){return this.getParent().getLayer()},getStage:function(){return this.getParent()?this.getParent().getStage():void 0},simulate:function(e,t){this._handleEvent(e,t||{})},fire:function(e,t){this._executeHandlers(e,t||{})},getAbsoluteTransform:function(){var e=new Kinetic.Transform;return this._eachAncestorReverse(function(t){var i=t.getTransform();e.multiply(i)},!0),e},getTransform:function(){var e=new Kinetic.Transform,t=this.attrs,i=t.x,a=t.y,n=t.rotation,o=t.scale,r=o.x,s=o.y,c=t.offset,l=c.x,d=c.y;return(0!==i||0!==a)&&e.translate(i,a),0!==n&&e.rotate(n),(1!==r||1!==s)&&e.scale(r,s),(0!==l||0!==d)&&e.translate(-1*l,-1*d),e},clone:function(e){var t=this.shapeType||this.nodeType,i=new Kinetic[t](this.attrs);for(var a in this.eventListeners)for(var n=this.eventListeners[a],o=n.length,r=0;o>r;r++){var s=n[r];s.name.indexOf("kinetic")<0&&(i.eventListeners[a]||(i.eventListeners[a]=[]),i.eventListeners[a].push(s))}return i.setAttrs(e),i},toDataURL:function(e){e=e||{};var t,i,a=e.mimeType||null,n=e.quality||null,o=e.x||0,r=e.y||0;return e.width&&e.height?t=new Kinetic.SceneCanvas(e.width,e.height,1):(t=this.getStage().bufferCanvas,t.clear()),i=t.getContext(),i.save(),(o||r)&&i.translate(-1*o,-1*r),this.drawScene(t),i.restore(),t.toDataURL(a,n)},toImage:function(e){Kinetic.Type._getImage(this.toDataURL(e),function(t){e.callback(t)})},setSize:function(){var e=Kinetic.Type._getSize(Array.prototype.slice.call(arguments));this.setWidth(e.width),this.setHeight(e.height)},getSize:function(){return{width:this.getWidth(),height:this.getHeight()}},getWidth:function(){return this.attrs.width||0},getHeight:function(){return this.attrs.height||0},_get:function(e){return this.nodeType===e?[this]:[]},_off:function(e,t){for(var i=0;i<this.eventListeners[e].length;i++)if(this.eventListeners[e][i].name===t){if(this.eventListeners[e].splice(i,1),0===this.eventListeners[e].length){delete this.eventListeners[e];break}i--}},_clearTransform:function(){var e=this.attrs,t=e.scale,i=e.offset,a={x:e.x,y:e.y,rotation:e.rotation,scale:{x:t.x,y:t.y},offset:{x:i.x,y:i.y}};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scale={x:1,y:1},this.attrs.offset={x:0,y:0},a},_setTransform:function(e){for(var t in e)this.attrs[t]=e[t]},_fireBeforeChangeEvent:function(e,t,i){this._handleEvent("before"+e.toUpperCase()+"Change",{oldVal:t,newVal:i})},_fireChangeEvent:function(e,t,i){this._handleEvent(e+"Change",{oldVal:t,newVal:i})},setId:function(e){var t=this.getId(),i=(this.getStage(),Kinetic.Global);i._removeId(t),i._addId(this,e),this.setAttr("id",e)},setName:function(e){var t=this.getName(),i=(this.getStage(),Kinetic.Global);i._removeName(t,this._id),i._addName(this,e),this.setAttr("name",e)},setAttr:function(e,t){if(void 0!==t){var i=this.attrs[e];this._fireBeforeChangeEvent(e,i,t),this.attrs[e]=t,this._fireChangeEvent(e,i,t)}},_handleEvent:function(e,t,i){t&&"Shape"===this.nodeType&&(t.shape=this);var a=(this.getStage(),this.eventListeners),n=!0;"mouseenter"===e&&i&&this._id===i._id?n=!1:"mouseleave"===e&&i&&this._id===i._id&&(n=!1),n&&(a[e]&&this.fire(e,t),t&&!t.cancelBubble&&this.parent&&(i&&i.parent?this._handleEvent.call(this.parent,e,t,i.parent):this._handleEvent.call(this.parent,e,t)))},_executeHandlers:function(e,t){for(var i=this.eventListeners[e],a=i.length,n=0;a>n;n++)i[n].handler.apply(this,[t])}},Kinetic.Node.addSetters=function(e,t){for(var i=t.length,a=0;i>a;a++){var n=t[a];this._addSetter(e,n)}},Kinetic.Node.addPointSetters=function(e,t){for(var i=t.length,a=0;i>a;a++){var n=t[a];this._addPointSetter(e,n)}},Kinetic.Node.addRotationSetters=function(e,t){for(var i=t.length,a=0;i>a;a++){var n=t[a];this._addRotationSetter(e,n)}},Kinetic.Node.addGetters=function(e,t){for(var i=t.length,a=0;i>a;a++){var n=t[a];this._addGetter(e,n)}},Kinetic.Node.addRotationGetters=function(e,t){for(var i=t.length,a=0;i>a;a++){var n=t[a];this._addRotationGetter(e,n)}},Kinetic.Node.addGettersSetters=function(e,t){this.addSetters(e,t),this.addGetters(e,t)},Kinetic.Node.addPointGettersSetters=function(e,t){this.addPointSetters(e,t),this.addGetters(e,t)},Kinetic.Node.addRotationGettersSetters=function(e,t){this.addRotationSetters(e,t),this.addRotationGetters(e,t)},Kinetic.Node._addSetter=function(e,t){var i="set"+t.charAt(0).toUpperCase()+t.slice(1);e.prototype[i]=function(e){this.setAttr(t,e)}},Kinetic.Node._addPointSetter=function(e,t){var i="set"+t.charAt(0).toUpperCase()+t.slice(1);e.prototype[i]=function(){var e=Kinetic.Type._getXY([].slice.call(arguments));e&&void 0===e.x&&(e.x=this.attrs[t].x),e&&void 0===e.y&&(e.y=this.attrs[t].y),this.setAttr(t,e)}},Kinetic.Node._addRotationSetter=function(e,t){var i="set"+t.charAt(0).toUpperCase()+t.slice(1);e.prototype[i]=function(e){this.setAttr(t,e)},e.prototype[i+"Deg"]=function(e){this.setAttr(t,Kinetic.Type._degToRad(e))}},Kinetic.Node._addGetter=function(e,t){var i="get"+t.charAt(0).toUpperCase()+t.slice(1);e.prototype[i]=function(e){return this.attrs[t]}},Kinetic.Node._addRotationGetter=function(e,t){var i="get"+t.charAt(0).toUpperCase()+t.slice(1);e.prototype[i]=function(){return this.attrs[t]},e.prototype[i+"Deg"]=function(){return Kinetic.Type._radToDeg(this.attrs[t])}},Kinetic.Node.create=function(e,t){return this._createNode(JSON.parse(e),t)},Kinetic.Node._createNode=function(e,t){var i;i="Shape"===e.nodeType?void 0===e.shapeType?"Shape":e.shapeType:e.nodeType,t&&(e.attrs.container=t);var a=new Kinetic[i](e.attrs);if(e.children)for(var n=e.children.length,o=0;n>o;o++)a.add(this._createNode(e.children[o]));return a},Kinetic.Node.addGettersSetters(Kinetic.Node,["x","y","opacity"]),Kinetic.Node.addGetters(Kinetic.Node,["name","id"]),Kinetic.Node.addRotationGettersSetters(Kinetic.Node,["rotation"]),Kinetic.Node.addPointGettersSetters(Kinetic.Node,["scale","offset"]),Kinetic.Node.addSetters(Kinetic.Node,["width","height","listening","visible"]),Kinetic.Node.prototype.isListening=Kinetic.Node.prototype.getListening,Kinetic.Node.prototype.isVisible=Kinetic.Node.prototype.getVisible;for(var e=["on","off"],t=0;2>t;t++)!function(t){var i=e[t];Kinetic.Collection.prototype[i]=function(){var e=[].slice.call(arguments);e.unshift(i),this.apply.apply(this,e)}}(t)}(),function(){Kinetic.Animation=function(e,t){this.func=e,this.node=t,this.id=Kinetic.Animation.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:(new Date).getTime()}},Kinetic.Animation.prototype={isRunning:function(){for(var e=Kinetic.Animation,t=e.animations,i=0;i<t.length;i++)if(t[i].id===this.id)return!0;return!1},start:function(){this.stop(),this.frame.timeDiff=0,this.frame.lastTime=(new Date).getTime(),Kinetic.Animation._addAnimation(this)},stop:function(){Kinetic.Animation._removeAnimation(this)},_updateFrameObject:function(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}},Kinetic.Animation.animations=[],Kinetic.Animation.animIdCounter=0,Kinetic.Animation.animRunning=!1,Kinetic.Animation.fixedRequestAnimFrame=function(e){window.setTimeout(e,1e3/60)},Kinetic.Animation._addAnimation=function(e){this.animations.push(e),this._handleAnimation()},Kinetic.Animation._removeAnimation=function(e){for(var t=e.id,i=this.animations,a=i.length,n=0;a>n;n++)if(i[n].id===t){this.animations.splice(n,1);break}},Kinetic.Animation._runFrames=function(){for(var e={},t=this.animations,i=0;i<t.length;i++){var a=t[i],n=a.node,o=a.func;a._updateFrameObject((new Date).getTime()),n&&void 0!==n._id&&(e[n._id]=n),o&&o(a.frame)}for(var r in e)e[r].draw()},Kinetic.Animation._animationLoop=function(){var e=this;this.animations.length>0?(this._runFrames(),Kinetic.Animation.requestAnimFrame(function(){e._animationLoop()})):this.animRunning=!1},Kinetic.Animation._handleAnimation=function(){var e=this;this.animRunning||(this.animRunning=!0,e._animationLoop())},RAF=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||Kinetic.Animation.fixedRequestAnimFrame}(),Kinetic.Animation.requestAnimFrame=function(e){var t=Kinetic.DD&&Kinetic.DD.moving?this.fixedRequestAnimFrame:RAF;t(e)};var e=Kinetic.Node.prototype.moveTo;Kinetic.Node.prototype.moveTo=function(t){e.call(this,t)}}(),function(){Kinetic.DD={anim:new Kinetic.Animation,moving:!1,offset:{x:0,y:0}},Kinetic.getNodeDragging=function(){return Kinetic.DD.node},Kinetic.DD._setupDragLayerAndGetContainer=function(e){var t,i,a=e.getStage();e.nodeType;return e._eachAncestorReverse(function(e){"Layer"===e.nodeType?(a.dragLayer.setAttrs(e.getAttrs()),t=a.dragLayer,a.add(a.dragLayer)):"Group"===e.nodeType&&(i=new Kinetic.Group(e.getAttrs()),t.add(i),t=i)}),t},Kinetic.DD._initDragLayer=function(e){e.dragLayer=new Kinetic.Layer,e.dragLayer.getCanvas().getElement().className="kinetic-drag-and-drop-layer"},Kinetic.DD._drag=function(e){var t=Kinetic.DD,i=t.node;if(i){var a=i.getStage().getUserPosition(),n=i.attrs.dragBoundFunc,o={x:a.x-t.offset.x,y:a.y-t.offset.y};void 0!==n&&(o=n.call(i,o,e)),i.setAbsolutePosition(o),t.moving||(t.moving=!0,i.setListening(!1),i._handleEvent("dragstart",e)),i._handleEvent("dragmove",e)}},Kinetic.DD._endDrag=function(e){var t=Kinetic.DD,i=t.node;if(i){var a=i.nodeType;i.getStage();i.setListening(!0),"Stage"===a?i.draw():(("Group"===a||"Shape"===a)&&i.getDragOnTop()&&t.prevParent&&(i.moveTo(t.prevParent),i.getStage().dragLayer.remove(),t.prevParent=null),i.getLayer().draw()),delete t.node,t.anim.stop(),t.moving&&(t.moving=!1,i._handleEvent("dragend",e))}},Kinetic.Node.prototype._startDrag=function(e){var t=Kinetic.DD,i=this,a=this.getStage(),n=a.getUserPosition();if(n){var o,r=(this.getTransform().getTranslation(),this.getAbsolutePosition()),s=this.nodeType;t.node=this,t.offset.x=n.x-r.x,t.offset.y=n.y-r.y,"Stage"===s||"Layer"===s?(t.anim.node=this,t.anim.start()):this.getDragOnTop()?(o=t._setupDragLayerAndGetContainer(this),t.anim.node=a.dragLayer,t.prevParent=this.getParent(),setTimeout(function(){t.node&&(i.moveTo(o),t.prevParent.getLayer().draw(),a.dragLayer.draw(),t.anim.start())},0)):(t.anim.node=this.getLayer(),t.anim.start())}},Kinetic.Node.prototype.setDraggable=function(e){this.setAttr("draggable",e),this._dragChange()},Kinetic.Node.prototype.getDraggable=function(){return this.attrs.draggable},Kinetic.Node.prototype.isDragging=function(){var e=Kinetic.DD;return e.node&&e.node._id===this._id&&e.moving},Kinetic.Node.prototype._listenDrag=function(){this._dragCleanup();var e=this;this.on("mousedown.kinetic touchstart.kinetic",function(t){Kinetic.getNodeDragging()||e._startDrag(t)})},Kinetic.Node.prototype._dragChange=function(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var e=this.getStage(),t=Kinetic.DD;e&&t.node&&t.node._id===this._id&&t._endDrag()}},Kinetic.Node.prototype._dragCleanup=function(){this.off("mousedown.kinetic"),this.off("touchstart.kinetic")},Kinetic.Node.prototype.isDraggable=Kinetic.Node.prototype.getDraggable,Kinetic.Node.addGettersSetters(Kinetic.Node,["dragBoundFunc","dragOnTop"]);var e=document.getElementsByTagName("html")[0];e.addEventListener("mouseup",Kinetic.DD._endDrag,!0),e.addEventListener("touchend",Kinetic.DD._endDrag,!0)}(),function(){Kinetic.Transition=function(e,t){function i(e,t,n,o){for(var r in e)"duration"!==r&&"easing"!==r&&"callback"!==r&&(Kinetic.Type._isObject(e[r])?(n[r]={},i(e[r],t[r],n[r],o)):a._add(a._getTween(t,r,e[r],n,o)))}var a=this,n={};this.node=e,this.config=t,this.tweens=[],i(t,e.attrs,n,n),this.tweens[0].onStarted=function(){},this.tweens[0].onStopped=function(){e.transAnim.stop()},this.tweens[0].onResumed=function(){e.transAnim.start()},this.tweens[0].onLooped=function(){},this.tweens[0].onChanged=function(){},this.tweens[0].onFinished=function(){var i={};for(var a in t)"duration"!==a&&"easing"!==a&&"callback"!==a&&(i[a]=t[a]);e.transAnim.stop(),e.setAttrs(i),t.callback&&t.callback()}},Kinetic.Transition.prototype={start:function(){for(var e=0;e<this.tweens.length;e++)this.tweens[e].start()},stop:function(){for(var e=0;e<this.tweens.length;e++)this.tweens[e].stop()},resume:function(){for(var e=0;e<this.tweens.length;e++)this.tweens[e].resume()},_onEnterFrame:function(){for(var e=0;e<this.tweens.length;e++)this.tweens[e].onEnterFrame()},_add:function(e){this.tweens.push(e)},_getTween:function(e,t,i,a,n){var o=this.config,r=this.node,s=o.easing;void 0===s&&(s="linear");var c=new Kinetic.Tween(r,function(e){a[t]=e,r.setAttrs(n)},Kinetic.Tweens[s],e[t],i,o.duration);return c}},Kinetic.Node.prototype.transitionTo=function(e){var t=new Kinetic.Transition(this,e);return this.transAnim||(this.transAnim=new Kinetic.Animation),this.transAnim.func=function(){t._onEnterFrame()},this.transAnim.node="Stage"===this.nodeType?this:this.getLayer(),t.start(),this.transAnim.start(),this.trans=t,t}}(),function(){Kinetic.Container=function(e){this._containerInit(e)},Kinetic.Container.prototype={_containerInit:function(e){this.children=[],Kinetic.Node.call(this,e)},getChildren:function(){return this.children},removeChildren:function(){for(;this.children.length>0;)this.children[0].remove()},add:function(e){var t=(Kinetic.Global,this.children);return e.index=t.length,e.parent=this,t.push(e),this},get:function(e){var t=new Kinetic.Collection;if("#"===e.charAt(0)){var i=this._getNodeById(e.slice(1));i&&t.push(i)}else if("."===e.charAt(0)){var a=this._getNodesByName(e.slice(1));Kinetic.Collection.apply(t,a)}else{for(var n=[],o=this.getChildren(),r=o.length,s=0;r>s;s++)n=n.concat(o[s]._get(e));Kinetic.Collection.apply(t,n)}return t},_getNodeById:function(e){var t=(this.getStage(),Kinetic.Global),i=t.ids[e];return void 0!==i&&this.isAncestorOf(i)?i:null},_getNodesByName:function(e){var t=Kinetic.Global,i=t.names[e]||[];return this._getDescendants(i)},_get:function(e){for(var t=Kinetic.Node.prototype._get.call(this,e),i=this.getChildren(),a=i.length,n=0;a>n;n++)t=t.concat(i[n]._get(e));return t},toObject:function(){var e=Kinetic.Node.prototype.toObject.call(this);e.children=[];for(var t=this.getChildren(),i=t.length,a=0;i>a;a++){var n=t[a];e.children.push(n.toObject())}return e},_getDescendants:function(e){for(var t=[],i=e.length,a=0;i>a;a++){var n=e[a];this.isAncestorOf(n)&&t.push(n)}return t},isAncestorOf:function(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1},clone:function(e){var t=Kinetic.Node.prototype.clone.call(this,e);for(var i in this.children)t.add(this.children[i].clone());return t},getIntersections:function(){for(var e=Kinetic.Type._getXY(Array.prototype.slice.call(arguments)),t=[],i=this.get("Shape"),a=i.length,n=0;a>n;n++){var o=i[n];o.isVisible()&&o.intersects(e)&&t.push(o)}return t},_setChildrenIndices:function(){for(var e=this.children,t=e.length,i=0;t>i;i++)e[i].index=i},draw:function(){this.drawScene(),this.drawHit()},drawScene:function(e){if(this.isVisible())for(var t=this.children,i=t.length,a=0;i>a;a++)t[a].drawScene(e)},drawHit:function(){if(this.isVisible()&&this.isListening())for(var e=this.children,t=e.length,i=0;t>i;i++)e[i].drawHit()}},Kinetic.Global.extend(Kinetic.Container,Kinetic.Node)}(),function(){function e(e){e.fill()}function t(e){e.stroke()}function i(e){e.fill()}function a(e){e.stroke()}Kinetic.Shape=function(e){this._initShape(e)},Kinetic.Shape.prototype={_initShape:function(n){this.setDefaultAttrs({fillEnabled:!0,strokeEnabled:!0,shadowEnabled:!0,dashArrayEnabled:!0,fillPriority:"color"}),this.nodeType="Shape",this._fillFunc=e,this._strokeFunc=t,this._fillFuncHit=i,this._strokeFuncHit=a;for(var o,r=Kinetic.Global.shapes;;)if(o=Kinetic.Type._getRandomColorKey(),o&&!(o in r))break;this.colorKey=o,r[o]=this,Kinetic.Node.call(this,n)},getContext:function(){return this.getLayer().getContext()},getCanvas:function(){return this.getLayer().getCanvas()},hasShadow:function(){return!!(this.getShadowColor()||this.getShadowBlur()||this.getShadowOffset())},hasFill:function(){return!!(this.getFill()||this.getFillPatternImage()||this.getFillLinearGradientStartPoint()||this.getFillRadialGradientStartPoint())},_get:function(e){return this.nodeType===e||this.shapeType===e?[this]:[]},intersects:function(){var e=Kinetic.Type._getXY(Array.prototype.slice.call(arguments)),t=this.getStage(),i=t.hitCanvas;i.clear(),this.drawScene(i);var a=i.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data;return a[3]>0},enableFill:function(){this.setAttr("fillEnabled",!0)},disableFill:function(){this.setAttr("fillEnabled",!1)},enableStroke:function(){this.setAttr("strokeEnabled",!0)},disableStroke:function(){this.setAttr("strokeEnabled",!1)},enableShadow:function(){this.setAttr("shadowEnabled",!0)},disableShadow:function(){this.setAttr("shadowEnabled",!1)},enableDashArray:function(){this.setAttr("dashArrayEnabled",!0)},disableDashArray:function(){this.setAttr("dashArrayEnabled",!1)},remove:function(){Kinetic.Node.prototype.remove.call(this),delete Kinetic.Global.shapes[this.colorKey]},drawScene:function(e){var t=this.attrs,i=t.drawFunc,e=e||this.getLayer().getCanvas(),a=e.getContext();i&&this.isVisible()&&(a.save(),e._applyOpacity(this),e._applyLineJoin(this),e._applyAncestorTransforms(this),i.call(this,e),a.restore())},drawHit:function(){var e=this.attrs,t=e.drawHitFunc||e.drawFunc,i=this.getLayer().hitCanvas,a=i.getContext();t&&this.isVisible()&&this.isListening()&&(a.save(),i._applyLineJoin(this),i._applyAncestorTransforms(this),t.call(this,i),a.restore())},_setDrawFuncs:function(){!this.attrs.drawFunc&&this.drawFunc&&this.setDrawFunc(this.drawFunc),!this.attrs.drawHitFunc&&this.drawHitFunc&&this.setDrawHitFunc(this.drawHitFunc)}},Kinetic.Global.extend(Kinetic.Shape,Kinetic.Node),Kinetic.Node.addGettersSetters(Kinetic.Shape,["stroke","lineJoin","lineCap","strokeWidth","drawFunc","drawHitFunc","dashArray","shadowColor","shadowBlur","shadowOpacity","fillPatternImage","fill","fillPatternX","fillPatternY","fillLinearGradientColorStops","fillRadialGradientStartRadius","fillRadialGradientEndRadius","fillRadialGradientColorStops","fillPatternRepeat","fillEnabled","strokeEnabled","shadowEnabled","dashArrayEnabled","fillPriority"]),Kinetic.Node.addPointGettersSetters(Kinetic.Shape,["fillPatternOffset","fillPatternScale","fillLinearGradientStartPoint","fillLinearGradientEndPoint","fillRadialGradientStartPoint","fillRadialGradientEndPoint","shadowOffset"]),Kinetic.Node.addRotationGettersSetters(Kinetic.Shape,["fillPatternRotation"])}(),function(){Kinetic.Stage=function(e){this._initStage(e)},Kinetic.Stage.prototype={_initStage:function(e){var t=Kinetic.DD;this.setDefaultAttrs({width:400,height:200}),Kinetic.Container.call(this,e),this._setStageDefaultProperties(),this._id=Kinetic.Global.idCounter++,this._buildDOM(),this._bindContentEvents(),Kinetic.Global.stages.push(this),t&&t._initDragLayer(this)},setContainer:function(e){"string"==typeof e&&(e=document.getElementById(e)),this.setAttr("container",e)},setHeight:function(e){Kinetic.Node.prototype.setHeight.call(this,e),this._resizeDOM()},setWidth:function(e){Kinetic.Node.prototype.setWidth.call(this,e),this._resizeDOM()},clear:function(){for(var e=this.children,t=0;t<e.length;t++)e[t].clear()},remove:function(){var e=this.content;Kinetic.Node.prototype.remove.call(this),e&&Kinetic.Type._isInDocument(e)&&this.attrs.container.removeChild(e)},reset:function(){this.removeChildren(),this._setStageDefaultProperties(),this.setAttrs(this.defaultNodeAttrs)},getMousePosition:function(){return this.mousePos},getTouchPosition:function(){return this.touchPos},getUserPosition:function(){return this.getTouchPosition()||this.getMousePosition()},getStage:function(){return this},getContent:function(){return this.content},toDataURL:function(e){function t(n){var o=c[n],l=o.toDataURL(),d=new Image;d.onload=function(){s.drawImage(d,0,0),n<c.length-1?t(n+1):e.callback(r.toDataURL(i,a))},d.src=l}e=e||{};var i=e.mimeType||null,a=e.quality||null,n=e.x||0,o=e.y||0,r=new Kinetic.SceneCanvas(e.width||this.getWidth(),e.height||this.getHeight()),s=r.getContext(),c=this.children;(n||o)&&s.translate(-1*n,-1*o),t(0)},toImage:function(e){var t=e.callback;e.callback=function(e){Kinetic.Type._getImage(e,function(e){t(e)})},this.toDataURL(e)},getIntersection:function(e){for(var t,i=this.getChildren(),a=i.length-1;a>=0;a--){var n=i[a];if(n.isVisible()&&n.isListening()){var o=n.hitCanvas.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data;if(255===o[3]){var r=Kinetic.Type._rgbToHex(o[0],o[1],o[2]);return t=Kinetic.Global.shapes[r],{shape:t,pixel:o}}if(o[0]>0||o[1]>0||o[2]>0||o[3]>0)return{pixel:o}}}return null},_resizeDOM:function(){if(this.content){var e=this.attrs.width,t=this.attrs.height;this.content.style.width=e+"px",this.content.style.height=t+"px",this.bufferCanvas.setSize(e,t,1),this.hitCanvas.setSize(e,t);for(var i=this.children,a=0;a<i.length;a++){var n=i[a];n.getCanvas().setSize(e,t),n.hitCanvas.setSize(e,t),n.draw()}}},add:function(e){return Kinetic.Container.prototype.add.call(this,e),e.canvas.setSize(this.attrs.width,this.attrs.height),e.hitCanvas.setSize(this.attrs.width,this.attrs.height),e.draw(),this.content.appendChild(e.canvas.element),this},getDragLayer:function(){return this.dragLayer},_setUserPosition:function(e){e||(e=window.event),this._setMousePosition(e),this._setTouchPosition(e)},_bindContentEvents:function(){for(var e=(Kinetic.Global,this),t=["mousedown","mousemove","mouseup","mouseout","touchstart","touchmove","touchend"],i=0;i<t.length;i++){var a=t[i];!function(){var t=a;e.content.addEventListener(t,function(i){e["_"+t](i)},!1)}()}},_mouseout:function(e){this._setUserPosition(e);var t=Kinetic.DD,i=this.targetShape;!i||t&&t.moving||(i._handleEvent("mouseout",e),i._handleEvent("mouseleave",e),this.targetShape=null),this.mousePos=void 0},_mousemove:function(e){this._setUserPosition(e);var t=Kinetic.DD,i=this.getIntersection(this.getUserPosition());if(i){var a=i.shape;a&&(t&&t.moving||255!==i.pixel[3]||this.targetShape&&this.targetShape._id===a._id?a._handleEvent("mousemove",e):(this.targetShape&&(this.targetShape._handleEvent("mouseout",e,a),this.targetShape._handleEvent("mouseleave",e,a)),a._handleEvent("mouseover",e,this.targetShape),a._handleEvent("mouseenter",e,this.targetShape),this.targetShape=a))}else!this.targetShape||t&&t.moving||(this.targetShape._handleEvent("mouseout",e),this.targetShape._handleEvent("mouseleave",e),this.targetShape=null);t&&t._drag(e)},_mousedown:function(e){var t,i=Kinetic.DD;if(this._setUserPosition(e),t=this.getIntersection(this.getUserPosition()),t&&t.shape){var a=t.shape;this.clickStart=!0,a._handleEvent("mousedown",e)}i&&this.attrs.draggable&&!i.node&&this._startDrag(e)},_mouseup:function(e){this._setUserPosition(e);var t=this,i=Kinetic.DD,a=this.getIntersection(this.getUserPosition());if(a&&a.shape){var n=a.shape;n._handleEvent("mouseup",e),this.clickStart&&(i&&i.moving&&i.node||(n._handleEvent("click",e),this.inDoubleClickWindow&&n._handleEvent("dblclick",e),this.inDoubleClickWindow=!0,setTimeout(function(){t.inDoubleClickWindow=!1},this.dblClickWindow)))}this.clickStart=!1},_touchstart:function(e){var t,i=Kinetic.DD;if(this._setUserPosition(e),e.preventDefault(),t=this.getIntersection(this.getUserPosition()),t&&t.shape){var a=t.shape;this.tapStart=!0,a._handleEvent("touchstart",e)}i&&this.attrs.draggable&&!i.node&&this._startDrag(e)},_touchend:function(e){this._setUserPosition(e);var t=this,i=Kinetic.DD,a=this.getIntersection(this.getUserPosition());if(a&&a.shape){var n=a.shape;n._handleEvent("touchend",e),this.tapStart&&(i&&i.moving&&i.node||(n._handleEvent("tap",e),this.inDoubleClickWindow&&n._handleEvent("dbltap",e),this.inDoubleClickWindow=!0,setTimeout(function(){t.inDoubleClickWindow=!1},this.dblClickWindow)))}this.tapStart=!1},_touchmove:function(e){this._setUserPosition(e);var t=Kinetic.DD;e.preventDefault();var i=this.getIntersection(this.getUserPosition());if(i&&i.shape){var a=i.shape;a._handleEvent("touchmove",e)}t&&t._drag(e)},_setMousePosition:function(e){var t=e.clientX-this._getContentPosition().left,i=e.clientY-this._getContentPosition().top;this.mousePos={x:t,y:i}},_setTouchPosition:function(e){if(void 0!==e.touches&&1===e.touches.length){var t=e.touches[0],i=t.clientX-this._getContentPosition().left,a=t.clientY-this._getContentPosition().top;this.touchPos={x:i,y:a}}},_getContentPosition:function(){var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left}},_buildDOM:function(){this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.display="inline-block",this.content.className="kineticjs-content",this.attrs.container.appendChild(this.content),this.bufferCanvas=new Kinetic.SceneCanvas,this.hitCanvas=new Kinetic.HitCanvas,this._resizeDOM()},_onContent:function(e,t){for(var i=e.split(" "),a=0;a<i.length;a++){var n=i[a];this.content.addEventListener(n,t,!1)}},_setStageDefaultProperties:function(){this.nodeType="Stage",this.dblClickWindow=400,this.targetShape=null,this.mousePos=void 0,this.clickStart=!1,this.touchPos=void 0,this.tapStart=!1}},Kinetic.Global.extend(Kinetic.Stage,Kinetic.Container),Kinetic.Node.addGetters(Kinetic.Stage,["container"])}(),function(){Kinetic.Layer=function(e){this._initLayer(e)},Kinetic.Layer.prototype={_initLayer:function(e){this.setDefaultAttrs({clearBeforeDraw:!0}),this.nodeType="Layer",this.beforeDrawFunc=void 0,this.afterDrawFunc=void 0,this.canvas=new Kinetic.SceneCanvas,this.canvas.getElement().style.position="absolute",this.hitCanvas=new Kinetic.HitCanvas,Kinetic.Container.call(this,e)},draw:function(){this.getContext();void 0!==this.beforeDrawFunc&&this.beforeDrawFunc.call(this),Kinetic.Container.prototype.draw.call(this),void 0!==this.afterDrawFunc&&this.afterDrawFunc.call(this)},drawHit:function(){this.hitCanvas.clear(),Kinetic.Container.prototype.drawHit.call(this)},drawScene:function(e){e=e||this.getCanvas(),this.attrs.clearBeforeDraw&&e.clear(),Kinetic.Container.prototype.drawScene.call(this,e)},toDataURL:function(e){e=e||{};var t=e.mimeType||null,i=e.quality||null;e.x||0,e.y||0;return e.width||e.height||e.x||e.y?Kinetic.Node.prototype.toDataURL.call(this,e):this.getCanvas().toDataURL(t,i)},beforeDraw:function(e){this.beforeDrawFunc=e},afterDraw:function(e){this.afterDrawFunc=e},getCanvas:function(){return this.canvas},getContext:function(){return this.canvas.context},clear:function(){this.getCanvas().clear()},setVisible:function(e){Kinetic.Node.prototype.setVisible.call(this,e),e?(this.canvas.element.style.display="block",this.hitCanvas.element.style.display="block"):(this.canvas.element.style.display="none",this.hitCanvas.element.style.display="none")},setZIndex:function(e){Kinetic.Node.prototype.setZIndex.call(this,e);var t=this.getStage();t&&(t.content.removeChild(this.canvas.element),e<t.getChildren().length-1?t.content.insertBefore(this.canvas.element,t.getChildren()[e+1].canvas.element):t.content.appendChild(this.canvas.element))},moveToTop:function(){Kinetic.Node.prototype.moveToTop.call(this);var e=this.getStage();e&&(e.content.removeChild(this.canvas.element),e.content.appendChild(this.canvas.element))},moveUp:function(){if(Kinetic.Node.prototype.moveUp.call(this)){var e=this.getStage();e&&(e.content.removeChild(this.canvas.element),this.index<e.getChildren().length-1?e.content.insertBefore(this.canvas.element,e.getChildren()[this.index+1].canvas.element):e.content.appendChild(this.canvas.element))}},moveDown:function(){if(Kinetic.Node.prototype.moveDown.call(this)){var e=this.getStage();if(e){var t=e.getChildren();e.content.removeChild(this.canvas.element),e.content.insertBefore(this.canvas.element,t[this.index+1].canvas.element)}}},moveToBottom:function(){if(Kinetic.Node.prototype.moveToBottom.call(this)){var e=this.getStage();if(e){var t=e.getChildren();e.content.removeChild(this.canvas.element),e.content.insertBefore(this.canvas.element,t[1].canvas.element)}}},getLayer:function(){return this},remove:function(){var e=this.getStage(),t=this.canvas,i=t.element;Kinetic.Node.prototype.remove.call(this),
e&&t&&Kinetic.Type._isInDocument(i)&&e.content.removeChild(i)}},Kinetic.Global.extend(Kinetic.Layer,Kinetic.Container),Kinetic.Node.addGettersSetters(Kinetic.Layer,["clearBeforeDraw"])}(),function(){Kinetic.Group=function(e){this._initGroup(e)},Kinetic.Group.prototype={_initGroup:function(e){this.nodeType="Group",Kinetic.Container.call(this,e)}},Kinetic.Global.extend(Kinetic.Group,Kinetic.Container)}(),function(){Kinetic.Rect=function(e){this._initRect(e)},Kinetic.Rect.prototype={_initRect:function(e){this.setDefaultAttrs({width:0,height:0,cornerRadius:0}),Kinetic.Shape.call(this,e),this.shapeType="Rect",this._setDrawFuncs()},drawFunc:function(e){var t=e.getContext();t.beginPath();var i=this.getCornerRadius(),a=this.getWidth(),n=this.getHeight();0===i?t.rect(0,0,a,n):(t.moveTo(i,0),t.lineTo(a-i,0),t.arc(a-i,i,i,3*Math.PI/2,0,!1),t.lineTo(a,n-i),t.arc(a-i,n-i,i,0,Math.PI/2,!1),t.lineTo(i,n),t.arc(i,n-i,i,Math.PI/2,Math.PI,!1),t.lineTo(0,i),t.arc(i,i,i,Math.PI,3*Math.PI/2,!1)),t.closePath(),e.fillStroke(this)}},Kinetic.Global.extend(Kinetic.Rect,Kinetic.Shape),Kinetic.Node.addGettersSetters(Kinetic.Rect,["cornerRadius"])}(),function(){Kinetic.Circle=function(e){this._initCircle(e)},Kinetic.Circle.prototype={_initCircle:function(e){this.setDefaultAttrs({radius:0}),Kinetic.Shape.call(this,e),this.shapeType="Circle",this._setDrawFuncs()},drawFunc:function(e){var t=e.getContext();t.beginPath(),t.arc(0,0,this.getRadius(),0,2*Math.PI,!0),t.closePath(),e.fillStroke(this)},getWidth:function(){return 2*this.getRadius()},getHeight:function(){return 2*this.getRadius()},setWidth:function(e){Kinetic.Node.prototype.setWidth.call(this,e),this.setRadius(e/2)},setHeight:function(e){Kinetic.Node.prototype.setHeight.call(this,e),this.setRadius(e/2)}},Kinetic.Global.extend(Kinetic.Circle,Kinetic.Shape),Kinetic.Node.addGettersSetters(Kinetic.Circle,["radius"])}(),function(){Kinetic.Wedge=function(e){this._initWedge(e)},Kinetic.Wedge.prototype={_initWedge:function(e){this.setDefaultAttrs({radius:0,angle:0,clockwise:!1}),Kinetic.Shape.call(this,e),this.shapeType="Wedge",this._setDrawFuncs()},drawFunc:function(e){var t=e.getContext();t.beginPath(),t.arc(0,0,this.getRadius(),0,this.getAngle(),this.getClockwise()),t.lineTo(0,0),t.closePath(),e.fillStroke(this)},setAngleDeg:function(e){this.setAngle(Kinetic.Type._degToRad(e))},getAngleDeg:function(){return Kinetic.Type._radToDeg(this.getAngle())}},Kinetic.Global.extend(Kinetic.Wedge,Kinetic.Shape),Kinetic.Node.addGettersSetters(Kinetic.Wedge,["radius","angle","clockwise"])}(),function(){Kinetic.Ellipse=function(e){this._initEllipse(e)},Kinetic.Ellipse.prototype={_initEllipse:function(e){this.setDefaultAttrs({radius:{x:0,y:0}}),Kinetic.Shape.call(this,e),this.shapeType="Ellipse",this._setDrawFuncs()},drawFunc:function(e){var t=e.getContext(),i=this.getRadius();t.beginPath(),t.save(),i.x!==i.y&&t.scale(1,i.y/i.x),t.arc(0,0,i.x,0,2*Math.PI,!0),t.restore(),t.closePath(),e.fillStroke(this)},getWidth:function(){return 2*this.getRadius().x},getHeight:function(){return 2*this.getRadius().y},setWidth:function(e){Kinetic.Node.prototype.setWidth.call(this,e),this.setRadius({x:e/2})},setHeight:function(e){Kinetic.Node.prototype.setHeight.call(this,e),this.setRadius({y:e/2})}},Kinetic.Global.extend(Kinetic.Ellipse,Kinetic.Shape),Kinetic.Node.addPointGettersSetters(Kinetic.Ellipse,["radius"])}(),function(){Kinetic.Image=function(e){this._initImage(e)},Kinetic.Image.prototype={_initImage:function(e){Kinetic.Shape.call(this,e),this.shapeType="Image",this._setDrawFuncs();var t=this;this.on("imageChange",function(e){t._syncSize()}),this._syncSize()},drawFunc:function(e){var t,i=this.getWidth(),a=this.getHeight(),n=this,o=e.getContext();if(o.beginPath(),o.rect(0,0,i,a),o.closePath(),e.fillStroke(this),this.attrs.image){if(this.attrs.crop&&this.attrs.crop.width&&this.attrs.crop.height){var r=this.attrs.crop.x||0,s=this.attrs.crop.y||0,c=this.attrs.crop.width,l=this.attrs.crop.height;t=[this.attrs.image,r,s,c,l,0,0,i,a]}else t=[this.attrs.image,0,0,i,a];this.hasShadow()?e.applyShadow(this,function(){n._drawImage(o,t)}):this._drawImage(o,t)}},drawHitFunc:function(e){var t=this.getWidth(),i=this.getHeight(),a=this.imageHitRegion,n=e.getContext();a?(n.drawImage(a,0,0,t,i),n.beginPath(),n.rect(0,0,t,i),n.closePath(),e.stroke(this)):(n.beginPath(),n.rect(0,0,t,i),n.closePath(),e.fillStroke(this))},applyFilter:function(e,t,i){var a=new Kinetic.Canvas(this.attrs.image.width,this.attrs.image.height),n=a.getContext();n.drawImage(this.attrs.image,0,0);try{var o=n.getImageData(0,0,a.getWidth(),a.getHeight());e(o,t);var r=this;Kinetic.Type._getImage(o,function(e){r.setImage(e),i&&i()})}catch(s){Kinetic.Global.warn("Unable to apply filter. "+s.message)}},setCrop:function(){var e=[].slice.call(arguments),t=Kinetic.Type._getXY(e),i=Kinetic.Type._getSize(e),a=Kinetic.Type._merge(t,i);this.setAttr("crop",Kinetic.Type._merge(a,this.getCrop()))},createImageHitRegion:function(e){var t=new Kinetic.Canvas(this.attrs.width,this.attrs.height),i=t.getContext();i.drawImage(this.attrs.image,0,0);try{for(var a=i.getImageData(0,0,t.getWidth(),t.getHeight()),n=a.data,o=Kinetic.Type._hexToRgb(this.colorKey),r=0,s=n.length;s>r;r+=4)n[r]=o.r,n[r+1]=o.g,n[r+2]=o.b;var c=this;Kinetic.Type._getImage(a,function(t){c.imageHitRegion=t,e&&e()})}catch(l){Kinetic.Global.warn("Unable to create image hit region. "+l.message)}},clearImageHitRegion:function(){delete this.imageHitRegion},_syncSize:function(){this.attrs.image&&(this.attrs.width||this.setWidth(this.attrs.image.width),this.attrs.height||this.setHeight(this.attrs.image.height))},_drawImage:function(e,t){5===t.length?e.drawImage(t[0],t[1],t[2],t[3],t[4]):9===t.length&&e.drawImage(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}},Kinetic.Global.extend(Kinetic.Image,Kinetic.Shape),Kinetic.Node.addGettersSetters(Kinetic.Image,["image"]),Kinetic.Node.addGetters(Kinetic.Image,["crop"])}(),function(){Kinetic.Polygon=function(e){this._initPolygon(e)},Kinetic.Polygon.prototype={_initPolygon:function(e){this.setDefaultAttrs({points:[]}),Kinetic.Shape.call(this,e),this.shapeType="Polygon",this._setDrawFuncs()},drawFunc:function(e){var t=e.getContext(),i=this.getPoints(),a=i.length;t.beginPath(),t.moveTo(i[0].x,i[0].y);for(var n=1;a>n;n++)t.lineTo(i[n].x,i[n].y);t.closePath(),e.fillStroke(this)},setPoints:function(e){this.setAttr("points",Kinetic.Type._getPoints(e))}},Kinetic.Global.extend(Kinetic.Polygon,Kinetic.Shape),Kinetic.Node.addGetters(Kinetic.Polygon,["points"])}(),function(){function e(e){e.fillText(this.partialText,0,0)}function t(e){e.strokeText(this.partialText,0,0)}var i="auto",a="Calibri",o="canvas",r="center",s="Change.kinetic",c="2d",l="\n",d="",m="left",u="\n",h="text",g="Text",p="top",y="middle",f="normal",_="px ",v=" ",b="right",w=["fontFamily","fontSize","fontStyle","padding","align","lineHeight","text","width","height"],S=w.length;Kinetic.Text=function(e){this._initText(e)},Kinetic.Text.prototype={_initText:function(n){var r=this;this.setDefaultAttrs({fontFamily:a,text:d,fontSize:12,align:m,verticalAlign:p,fontStyle:f,padding:0,width:i,height:i,lineHeight:1}),this.dummyCanvas=document.createElement(o),Kinetic.Shape.call(this,n),this._fillFunc=e,this._strokeFunc=t,this.shapeType=g,this._setDrawFuncs();for(var c=0;S>c;c++)this.on(w[c]+s,r._setTextData);this._setTextData()},drawFunc:function(e){var t=e.getContext(),i=this.getPadding(),a=this.getFontStyle(),n=this.getFontSize(),o=this.getFontFamily(),s=this.getTextHeight(),c=this.getLineHeight()*s,l=this.textArr,d=l.length,u=this.getWidth();t.font=a+v+n+_+o,t.textBaseline=y,t.textAlign=m,t.save(),t.translate(i,0),t.translate(0,i+s/2);for(var h=0;d>h;h++){var g=l[h],p=g.text,f=g.width;t.save(),this.getAlign()===b?t.translate(u-f-2*i,0):this.getAlign()===r&&t.translate((u-f-2*i)/2,0),this.partialText=p,e.fillStroke(this),t.restore(),t.translate(0,c)}t.restore()},drawHitFunc:function(e){var t=e.getContext(),i=this.getWidth(),a=this.getHeight();t.beginPath(),t.rect(0,0,i,a),t.closePath(),e.fillStroke(this)},setText:function(e){var t=Kinetic.Type._isString(e)?e:e.toString();this.setAttr(h,t)},getWidth:function(){return this.attrs.width===i?this.getTextWidth()+2*this.getPadding():this.attrs.width},getHeight:function(){return this.attrs.height===i?this.getTextHeight()*this.textArr.length*this.attrs.lineHeight+2*this.attrs.padding:this.attrs.height},getTextWidth:function(){return this.textWidth},getTextHeight:function(){return this.textHeight},_getTextSize:function(e){var t,i=this.dummyCanvas,a=i.getContext(c),n=this.getFontSize();return a.save(),a.font=this.getFontStyle()+v+n+_+this.getFontFamily(),t=a.measureText(e),a.restore(),{width:t.width,height:parseInt(n,10)}},_expandTextData:function(e){var t=e.length;for(n=0,text=d,newArr=[],n=0;n<t;n++)text=e[n],newArr.push({text:text,width:this._getTextSize(text).width});return newArr},_setTextData:function(){var e=this.getText().split(d),t=[],a=0;for(addLine=!0,lineHeightPx=0,padding=this.getPadding(),this.textWidth=0,this.textHeight=this._getTextSize(this.getText()).height,lineHeightPx=this.getLineHeight()*this.textHeight;e.length>0&&addLine&&(this.attrs.height===i||lineHeightPx*(a+1)<this.attrs.height-2*padding);){var n=0,o=void 0;for(addLine=!1;n<e.length;){if(e.indexOf(u)===n){e.splice(n,1),o=e.splice(0,n).join(d);break}var r=e.slice(0,n);if(this.attrs.width!==i&&this._getTextSize(r.join(d)).width>this.attrs.width-2*padding){if(0==n)break;var s=r.lastIndexOf(v),c=r.lastIndexOf(l),m=Math.max(s,c);if(m>=0){o=e.splice(0,1+m).join(d);break}o=e.splice(0,n).join(d);break}n++,n===e.length&&(o=e.splice(0,n).join(d))}this.textWidth=Math.max(this.textWidth,this._getTextSize(o).width),void 0!==o&&(t.push(o),addLine=!0),a++}this.textArr=this._expandTextData(t)}},Kinetic.Global.extend(Kinetic.Text,Kinetic.Shape),Kinetic.Node.addGettersSetters(Kinetic.Text,["fontFamily","fontSize","fontStyle","padding","align","lineHeight"]),Kinetic.Node.addGetters(Kinetic.Text,[h])}(),function(){Kinetic.Line=function(e){this._initLine(e)},Kinetic.Line.prototype={_initLine:function(e){this.setDefaultAttrs({points:[],lineCap:"butt"}),Kinetic.Shape.call(this,e),this.shapeType="Line",this._setDrawFuncs()},drawFunc:function(e){var t=this.getPoints(),i=t.length,a=e.getContext();a.beginPath(),a.moveTo(t[0].x,t[0].y);for(var n=1;i>n;n++){var o=t[n];a.lineTo(o.x,o.y)}e.stroke(this)},setPoints:function(e){this.setAttr("points",Kinetic.Type._getPoints(e))}},Kinetic.Global.extend(Kinetic.Line,Kinetic.Shape),Kinetic.Node.addGetters(Kinetic.Line,["points"])}(),function(){Kinetic.Spline=function(e){this._initSpline(e)},Kinetic.Spline._getControlPoints=function(e,t,i,a){var n=e.x,o=e.y,r=t.x,s=t.y,c=i.x,l=i.y,d=Math.sqrt(Math.pow(r-n,2)+Math.pow(s-o,2)),m=Math.sqrt(Math.pow(c-r,2)+Math.pow(l-s,2)),u=a*d/(d+m),h=a*m/(d+m),g=r-u*(c-n),p=s-u*(l-o),y=r+h*(c-n),f=s+h*(l-o);return[{x:g,y:p},{x:y,y:f}]},Kinetic.Spline.prototype={_initSpline:function(e){this.setDefaultAttrs({tension:1}),Kinetic.Line.call(this,e),this.shapeType="Spline"},drawFunc:function(e){var t=this.getPoints(),i=t.length,a=e.getContext(),n=this.getTension();if(a.beginPath(),a.moveTo(t[0].x,t[0].y),0!==n&&i>2){var o=this.allPoints,r=o.length;a.quadraticCurveTo(o[0].x,o[0].y,o[1].x,o[1].y);for(var s=2;r-1>s;)a.bezierCurveTo(o[s].x,o[s++].y,o[s].x,o[s++].y,o[s].x,o[s++].y);a.quadraticCurveTo(o[r-1].x,o[r-1].y,t[i-1].x,t[i-1].y)}else for(var s=1;i>s;s++){var c=t[s];a.lineTo(c.x,c.y)}e.stroke(this)},setPoints:function(e){Kinetic.Line.prototype.setPoints.call(this,e),this._setAllPoints()},setTension:function(e){this.setAttr("tension",e),this._setAllPoints()},_setAllPoints:function(){for(var e=this.getPoints(),t=e.length,i=this.getTension(),a=[],n=1;t-1>n;n++){var o=Kinetic.Spline._getControlPoints(e[n-1],e[n],e[n+1],i);a.push(o[0]),a.push(e[n]),a.push(o[1])}this.allPoints=a}},Kinetic.Global.extend(Kinetic.Spline,Kinetic.Line),Kinetic.Node.addGetters(Kinetic.Spline,["tension"])}(),function(){Kinetic.Blob=function(e){this._initBlob(e)},Kinetic.Blob.prototype={_initBlob:function(e){Kinetic.Spline.call(this,e),this.shapeType="Blob"},drawFunc:function(e){var t=this.getPoints(),i=t.length,a=e.getContext(),n=this.getTension();if(a.beginPath(),a.moveTo(t[0].x,t[0].y),0!==n&&i>2)for(var o=this.allPoints,r=o.length,s=0;r-1>s;)a.bezierCurveTo(o[s].x,o[s++].y,o[s].x,o[s++].y,o[s].x,o[s++].y);else for(var s=1;i>s;s++){var c=t[s];a.lineTo(c.x,c.y)}a.closePath(),e.fillStroke(this)},_setAllPoints:function(){var e=this.getPoints(),t=e.length,i=this.getTension(),a=Kinetic.Spline._getControlPoints(e[t-1],e[0],e[1],i),n=Kinetic.Spline._getControlPoints(e[t-2],e[t-1],e[0],i);Kinetic.Spline.prototype._setAllPoints.call(this),this.allPoints.unshift(a[1]),this.allPoints.push(n[0]),this.allPoints.push(e[t-1]),this.allPoints.push(n[1]),this.allPoints.push(a[0]),this.allPoints.push(e[0])}},Kinetic.Global.extend(Kinetic.Blob,Kinetic.Spline)}(),function(){Kinetic.Sprite=function(e){this._initSprite(e)},Kinetic.Sprite.prototype={_initSprite:function(e){this.setDefaultAttrs({index:0,frameRate:17}),Kinetic.Shape.call(this,e),this.shapeType="Sprite",this._setDrawFuncs(),this.anim=new Kinetic.Animation;var t=this;this.on("animationChange",function(){t.setIndex(0)})},drawFunc:function(e){var t=this.attrs.animation,i=this.attrs.index,a=this.attrs.animations[t][i],n=e.getContext(),o=this.attrs.image;o&&n.drawImage(o,a.x,a.y,a.width,a.height,0,0,a.width,a.height)},drawHitFunc:function(e){var t=this.attrs.animation,i=this.attrs.index,a=this.attrs.animations[t][i],n=e.getContext();n.beginPath(),n.rect(0,0,a.width,a.height),n.closePath(),e.fill(this)},start:function(){var e=this,t=this.getLayer();this.anim.node=t,this.interval=setInterval(function(){var t=e.attrs.index;e._updateIndex(),e.afterFrameFunc&&t===e.afterFrameIndex&&(e.afterFrameFunc(),delete e.afterFrameFunc,delete e.afterFrameIndex)},1e3/this.attrs.frameRate),this.anim.start()},stop:function(){this.anim.stop(),clearInterval(this.interval)},afterFrame:function(e,t){this.afterFrameIndex=e,this.afterFrameFunc=t},_updateIndex:function(){var e=this.attrs.index,t=this.attrs.animation;e<this.attrs.animations[t].length-1?this.attrs.index++:this.attrs.index=0}},Kinetic.Global.extend(Kinetic.Sprite,Kinetic.Shape),Kinetic.Node.addGettersSetters(Kinetic.Sprite,["animation","animations","index"])}(),function(){Kinetic.Star=function(e){this._initStar(e)},Kinetic.Star.prototype={_initStar:function(e){this.setDefaultAttrs({numPoints:0,innerRadius:0,outerRadius:0}),Kinetic.Shape.call(this,e),this.shapeType="Star",this._setDrawFuncs()},drawFunc:function(e){var t=e.getContext(),i=this.attrs.innerRadius,a=this.attrs.outerRadius,n=this.attrs.numPoints;t.beginPath(),t.moveTo(0,0-this.attrs.outerRadius);for(var o=1;2*n>o;o++){var r=o%2===0?a:i,s=r*Math.sin(o*Math.PI/n),c=-1*r*Math.cos(o*Math.PI/n);t.lineTo(s,c)}t.closePath(),e.fillStroke(this)}},Kinetic.Global.extend(Kinetic.Star,Kinetic.Shape),Kinetic.Node.addGettersSetters(Kinetic.Star,["numPoints","innerRadius","outerRadius"])}(),function(){Kinetic.RegularPolygon=function(e){this._initRegularPolygon(e)},Kinetic.RegularPolygon.prototype={_initRegularPolygon:function(e){this.setDefaultAttrs({radius:0,sides:0}),Kinetic.Shape.call(this,e),this.shapeType="RegularPolygon",this._setDrawFuncs()},drawFunc:function(e){var t=e.getContext(),i=this.attrs.sides,a=this.attrs.radius;t.beginPath(),t.moveTo(0,0-a);for(var n=1;i>n;n++){var o=a*Math.sin(2*n*Math.PI/i),r=-1*a*Math.cos(2*n*Math.PI/i);t.lineTo(o,r)}t.closePath(),e.fillStroke(this)}},Kinetic.Global.extend(Kinetic.RegularPolygon,Kinetic.Shape),Kinetic.Node.addGettersSetters(Kinetic.RegularPolygon,["radius","sides"])}(),function(){Kinetic.Path=function(e){this._initPath(e)},Kinetic.Path.prototype={_initPath:function(e){this.dataArray=[];var t=this;Kinetic.Shape.call(this,e),this.shapeType="Path",this._setDrawFuncs(),this.dataArray=Kinetic.Path.parsePathData(this.attrs.data),this.on("dataChange",function(){t.dataArray=Kinetic.Path.parsePathData(t.attrs.data)})},drawFunc:function(e){var t=this.dataArray,i=e.getContext();i.beginPath();for(var a=0;a<t.length;a++){var n=t[a].command,o=t[a].points;switch(n){case"L":i.lineTo(o[0],o[1]);break;case"M":i.moveTo(o[0],o[1]);break;case"C":i.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":i.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":var r=o[0],s=o[1],c=o[2],l=o[3],d=o[4],m=o[5],u=o[6],h=o[7],g=c>l?c:l,p=c>l?1:c/l,y=c>l?l/c:1;i.translate(r,s),i.rotate(u),i.scale(p,y),i.arc(0,0,g,d,d+m,1-h),i.scale(1/p,1/y),i.rotate(-u),i.translate(-r,-s);break;case"z":i.closePath()}}e.fillStroke(this)}},Kinetic.Global.extend(Kinetic.Path,Kinetic.Shape),Kinetic.Path.getLineLength=function(e,t,i,a){return Math.sqrt((i-e)*(i-e)+(a-t)*(a-t))},Kinetic.Path.getPointOnLine=function(e,t,i,a,n,o,r){void 0===o&&(o=t),void 0===r&&(r=i);var s=(n-i)/(a-t+1e-8),c=Math.sqrt(e*e/(1+s*s));t>a&&(c*=-1);var l,d=s*c;if((r-i)/(o-t+1e-8)===s)l={x:o+c,y:r+d};else{var m,u,h=this.getLineLength(t,i,a,n);if(1e-8>h)return;var g=(o-t)*(a-t)+(r-i)*(n-i);g/=h*h,m=t+g*(a-t),u=i+g*(n-i);var p=this.getLineLength(o,r,m,u),y=Math.sqrt(e*e-p*p);c=Math.sqrt(y*y/(1+s*s)),t>a&&(c*=-1),d=s*c,l={x:m+c,y:u+d}}return l},Kinetic.Path.getPointOnCubicBezier=function(e,t,i,a,n,o,r,s,c){function l(e){return e*e*e}function d(e){return 3*e*e*(1-e)}function m(e){return 3*e*(1-e)*(1-e)}function u(e){return(1-e)*(1-e)*(1-e)}var h=s*l(e)+o*d(e)+a*m(e)+t*u(e),g=c*l(e)+r*d(e)+n*m(e)+i*u(e);return{x:h,y:g}},Kinetic.Path.getPointOnQuadraticBezier=function(e,t,i,a,n,o,r){function s(e){return e*e}function c(e){return 2*e*(1-e)}function l(e){return(1-e)*(1-e)}var d=o*s(e)+a*c(e)+t*l(e),m=r*s(e)+n*c(e)+i*l(e);return{x:d,y:m}},Kinetic.Path.getPointOnEllipticalArc=function(e,t,i,a,n,o){var r=Math.cos(o),s=Math.sin(o),c={x:i*Math.cos(n),y:a*Math.sin(n)};return{x:e+(c.x*r-c.y*s),y:t+(c.x*s+c.y*r)}},Kinetic.Path.parsePathData=function(e){if(!e)return[];var t=e,i=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];t=t.replace(new RegExp(" ","g"),",");for(var a=0;a<i.length;a++)t=t.replace(new RegExp(i[a],"g"),"|"+i[a]);for(var n=t.split("|"),o=[],r=0,s=0,a=1;a<n.length;a++){var c=n[a],l=c.charAt(0);c=c.slice(1),c=c.replace(new RegExp(",-","g"),"-"),c=c.replace(new RegExp("-","g"),",-"),c=c.replace(new RegExp("e,-","g"),"e-");var d=c.split(",");d.length>0&&""===d[0]&&d.shift();for(var m=0;m<d.length;m++)d[m]=parseFloat(d[m]);for(;d.length>0&&!isNaN(d[0]);){var u=null,h=[],g=r,p=s;switch(l){case"l":r+=d.shift(),s+=d.shift(),u="L",h.push(r,s);break;case"L":r=d.shift(),s=d.shift(),h.push(r,s);break;case"m":r+=d.shift(),s+=d.shift(),u="M",h.push(r,s),l="l";break;case"M":r=d.shift(),s=d.shift(),u="M",h.push(r,s),l="L";break;case"h":r+=d.shift(),u="L",h.push(r,s);break;case"H":r=d.shift(),u="L",h.push(r,s);break;case"v":s+=d.shift(),u="L",h.push(r,s);break;case"V":s=d.shift(),u="L",h.push(r,s);break;case"C":h.push(d.shift(),d.shift(),d.shift(),d.shift()),r=d.shift(),s=d.shift(),h.push(r,s);break;case"c":h.push(r+d.shift(),s+d.shift(),r+d.shift(),s+d.shift()),r+=d.shift(),s+=d.shift(),u="C",h.push(r,s);break;case"S":var y=r,f=s,_=o[o.length-1];"C"===_.command&&(y=r+(r-_.points[2]),f=s+(s-_.points[3])),h.push(y,f,d.shift(),d.shift()),r=d.shift(),s=d.shift(),u="C",h.push(r,s);break;case"s":var y=r,f=s,_=o[o.length-1];"C"===_.command&&(y=r+(r-_.points[2]),f=s+(s-_.points[3])),h.push(y,f,r+d.shift(),s+d.shift()),r+=d.shift(),s+=d.shift(),u="C",h.push(r,s);break;case"Q":h.push(d.shift(),d.shift()),r=d.shift(),s=d.shift(),h.push(r,s);break;case"q":h.push(r+d.shift(),s+d.shift()),r+=d.shift(),s+=d.shift(),u="Q",h.push(r,s);break;case"T":var y=r,f=s,_=o[o.length-1];"Q"===_.command&&(y=r+(r-_.points[0]),f=s+(s-_.points[1])),r=d.shift(),s=d.shift(),u="Q",h.push(y,f,r,s);break;case"t":var y=r,f=s,_=o[o.length-1];"Q"===_.command&&(y=r+(r-_.points[0]),f=s+(s-_.points[1])),r+=d.shift(),s+=d.shift(),u="Q",h.push(y,f,r,s);break;case"A":var v=d.shift(),b=d.shift(),w=d.shift(),S=d.shift(),C=d.shift(),x=r,k=s;r=d.shift(),s=d.shift(),u="A",h=this.convertEndpointToCenterParameterization(x,k,r,s,S,C,v,b,w);break;case"a":var v=d.shift(),b=d.shift(),w=d.shift(),S=d.shift(),C=d.shift(),x=r,k=s;r+=d.shift(),s+=d.shift(),u="A",h=this.convertEndpointToCenterParameterization(x,k,r,s,S,C,v,b,w)}o.push({command:u||l,points:h,start:{x:g,y:p},pathLength:this.calcLength(g,p,u||l,h)})}("z"===l||"Z"===l)&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o},Kinetic.Path.calcLength=function(e,i,a,n){var o,r,s,c=Kinetic.Path;switch(a){case"L":return c.getLineLength(e,i,n[0],n[1]);case"C":for(o=0,r=c.getPointOnCubicBezier(0,e,i,n[0],n[1],n[2],n[3],n[4],n[5]),t=.01;t<=1;t+=.01)s=c.getPointOnCubicBezier(t,e,i,n[0],n[1],n[2],n[3],n[4],n[5]),o+=c.getLineLength(r.x,r.y,s.x,s.y),r=s;return o;case"Q":for(o=0,r=c.getPointOnQuadraticBezier(0,e,i,n[0],n[1],n[2],n[3]),t=.01;t<=1;t+=.01)s=c.getPointOnQuadraticBezier(t,e,i,n[0],n[1],n[2],n[3]),o+=c.getLineLength(r.x,r.y,s.x,s.y),r=s;return o;case"A":o=0;var l=n[4],d=n[5],m=n[4]+d,u=Math.PI/180;if(Math.abs(l-m)<u&&(u=Math.abs(l-m)),r=c.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],l,0),0>d)for(t=l-u;t>m;t-=u)s=c.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],t,0),o+=c.getLineLength(r.x,r.y,s.x,s.y),r=s;else for(t=l+u;t<m;t+=u)s=c.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],t,0),o+=c.getLineLength(r.x,r.y,s.x,s.y),r=s;return s=c.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],m,0),o+=c.getLineLength(r.x,r.y,s.x,s.y)}return 0},Kinetic.Path.convertEndpointToCenterParameterization=function(e,t,i,a,n,o,r,s,c){var l=c*(Math.PI/180),d=Math.cos(l)*(e-i)/2+Math.sin(l)*(t-a)/2,m=-1*Math.sin(l)*(e-i)/2+Math.cos(l)*(t-a)/2,u=d*d/(r*r)+m*m/(s*s);u>1&&(r*=Math.sqrt(u),s*=Math.sqrt(u));var h=Math.sqrt((r*r*(s*s)-r*r*(m*m)-s*s*(d*d))/(r*r*(m*m)+s*s*(d*d)));n==o&&(h*=-1),isNaN(h)&&(h=0);var g=h*r*m/s,p=h*-s*d/r,y=(e+i)/2+Math.cos(l)*g-Math.sin(l)*p,f=(t+a)/2+Math.sin(l)*g+Math.cos(l)*p,_=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},v=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(_(e)*_(t))},b=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(v(e,t))},w=b([1,0],[(d-g)/r,(m-p)/s]),S=[(d-g)/r,(m-p)/s],C=[(-1*d-g)/r,(-1*m-p)/s],x=b(S,C);return v(S,C)<=-1&&(x=Math.PI),v(S,C)>=1&&(x=0),0===o&&x>0&&(x-=2*Math.PI),1==o&&0>x&&(x+=2*Math.PI),[y,f,r,s,w,x,l,o]},Kinetic.Node.addGettersSetters(Kinetic.Path,["data"])}(),function(){function e(e){e.fillText(this.partialText,0,0)}function t(e){e.strokeText(this.partialText,0,0)}Kinetic.TextPath=function(e){this._initTextPath(e)},Kinetic.TextPath.prototype={_initTextPath:function(i){this.setDefaultAttrs({fontFamily:"Calibri",fontSize:12,fontStyle:"normal",text:""}),this.dummyCanvas=document.createElement("canvas"),this.dataArray=[];var a=this;Kinetic.Shape.call(this,i),this._fillFunc=e,this._strokeFunc=t,this.shapeType="TextPath",this._setDrawFuncs(),this.dataArray=Kinetic.Path.parsePathData(this.attrs.data),this.on("dataChange",function(){a.dataArray=Kinetic.Path.parsePathData(this.attrs.data)});for(var n=["text","textStroke","textStrokeWidth"],o=0;o<n.length;o++){var r=n[o];this.on(r+"Change",a._setTextData)}a._setTextData()},drawFunc:function(e){var t=(this.charArr,e.getContext());t.font=this.attrs.fontStyle+" "+this.attrs.fontSize+"pt "+this.attrs.fontFamily,t.textBaseline="middle",t.textAlign="left",t.save();for(var i=this.glyphInfo,a=0;a<i.length;a++){t.save();var n=i[a].p0;i[a].p1,parseFloat(this.attrs.fontSize);t.translate(n.x,n.y),t.rotate(i[a].rotation),this.partialText=i[a].text,e.fillStroke(this),t.restore()}t.restore()},getTextWidth:function(){return this.textWidth},getTextHeight:function(){return this.textHeight},setText:function(e){Kinetic.Text.prototype.setText.call(this,e)},_getTextSize:function(e){var t=this.dummyCanvas,i=t.getContext("2d");i.save(),i.font=this.attrs.fontStyle+" "+this.attrs.fontSize+"pt "+this.attrs.fontFamily;var a=i.measureText(e);return i.restore(),{width:a.width,height:parseInt(this.attrs.fontSize,10)}},_setTextData:function(){var e=this,t=this._getTextSize(this.attrs.text);this.textWidth=t.width,this.textHeight=t.height,this.glyphInfo=[];for(var i,a,n,o=this.attrs.text.split(""),r=-1,s=0,c=function(){s=0;for(var t=e.dataArray,a=r+1;a<t.length;a++){if(t[a].pathLength>0)return r=a,t[a];"M"==t[a].command&&(i={x:t[a].points[0],y:t[a].points[1]})}return{}},l=function(t,o){var r=e._getTextSize(t).width,l=0,d=0;for(a=void 0;Math.abs(r-l)/r>.01&&25>d;){d++;for(var m=l;void 0===n;)n=c(),n&&m+n.pathLength<r&&(m+=n.pathLength,n=void 0);if(n==={}||void 0===i)return;var u=!1;switch(n.command){case"L":Kinetic.Path.getLineLength(i.x,i.y,n.points[0],n.points[1])>r?a=Kinetic.Path.getPointOnLine(r,i.x,i.y,n.points[0],n.points[1],i.x,i.y):n=void 0;break;case"A":var h=n.points[4],g=n.points[5],p=n.points[4]+g;0===s?s=h+1e-8:r>l?s+=Math.PI/180*g/Math.abs(g):s-=Math.PI/360*g/Math.abs(g),Math.abs(s)>Math.abs(p)&&(s=p,u=!0),a=Kinetic.Path.getPointOnEllipticalArc(n.points[0],n.points[1],n.points[2],n.points[3],s,n.points[6]);break;case"C":0===s?s=r>n.pathLength?1e-8:r/n.pathLength:r>l?s+=(r-l)/n.pathLength:s-=(l-r)/n.pathLength,s>1&&(s=1,u=!0),a=Kinetic.Path.getPointOnCubicBezier(s,n.start.x,n.start.y,n.points[0],n.points[1],n.points[2],n.points[3],n.points[4],n.points[5]);break;case"Q":0===s?s=r/n.pathLength:r>l?s+=(r-l)/n.pathLength:s-=(l-r)/n.pathLength,s>1&&(s=1,u=!0),a=Kinetic.Path.getPointOnQuadraticBezier(s,n.start.x,n.start.y,n.points[0],n.points[1],n.points[2],n.points[3])}void 0!==a&&(l=Kinetic.Path.getLineLength(i.x,i.y,a.x,a.y)),u&&(u=!1,n=void 0)}},d=0;d<o.length&&(l(o[d]),void 0!==i&&void 0!==a);d++){var m=Kinetic.Path.getLineLength(i.x,i.y,a.x,a.y),u=0,h=Kinetic.Path.getPointOnLine(u+m/2,i.x,i.y,a.x,a.y),g=Math.atan2(a.y-i.y,a.x-i.x);this.glyphInfo.push({transposeX:h.x,transposeY:h.y,text:o[d],rotation:g,p0:i,p1:a}),i=a}}},Kinetic.Global.extend(Kinetic.TextPath,Kinetic.Shape),Kinetic.Node.addGettersSetters(Kinetic.TextPath,["fontFamily","fontSize","fontStyle"]),Kinetic.Node.addGetters(Kinetic.TextPath,["text"])}(),define("ubnt/view/map/RulerView",["backbone","underscore","libs/kinetic","jquery"],function(e,t,i,a){"use strict";return e.View.extend({_fullyQualifiedName:"UBNT.views.map.Ruler",events:{click:"onRulerClick","click .close":"onCloseClick","click .submit":"onFormSubmit"},initialize:function(){t.bindAll(this),this.distance=0,this.measuredDistance=0,this.scale=0,this.render()},render:function(){!this.rendered&&(this.rendered=!0)&&(this.$distance=this.$(".distance"),this.$units=this.$(".units"),this.$submit=this.$(".submit"))},setupStage:function(){var e=a("#Map");this.layer=new i.Layer,this.stage=new i.Stage({container:"Map",width:e.width(),height:e.height()}),this.background=new i.Rect({x:0,y:0,width:this.stage.getWidth(),height:this.stage.getHeight(),fill:"#1292c5",opacity:.1}),this.line=new i.Line({points:[0,0,0,0],stroke:"red"}),this.moving=!1,this.layer.add(this.background),this.layer.add(this.line),this.stage.add(this.layer)},destroyStage:function(){this.line.destroy(),this.background.destroy(),this.layer.destroy(),this.stage.destroy()},bindStageEvents:function(){this.stage.on("mousedown",this.onStageMouseDown),this.stage.on("mousemove",this.onStageMouseMove),this.stage.on("mouseup",this.onStageMouseUp)},unbindStageEvents:function(){this.stage.off("mousedown",this.onStageMouseDown),this.stage.off("mousemove",this.onStageMouseMove),this.stage.off("mouseup",this.onStageMouseUp)},onStageMouseDown:function(){if(this.moving)this.moving=!1,this.layer.draw();else{var e=this.stage.getMousePosition();this.line.getPoints()[0].x=e.x,this.line.getPoints()[0].y=e.y,this.line.getPoints()[1].x=e.x,this.line.getPoints()[1].y=e.y,this.moving=!0,this.layer.drawScene()}},onStageMouseMove:function(){if(this.moving){var e=this.stage.getMousePosition();e.x,e.y;this.line.getPoints()[1].x=e.x,this.line.getPoints()[1].y=e.y,this.moving=!0,this.layer.drawScene()}},onStageMouseUp:function(){var e=this.line.getPoints();this.measuredDistance=this.getDistance(e[0],e[1]),this.moving=!1,this.measuredDistance>0&&(this.$distance.prop("disabled",!1).removeClass("disabled").focus(),this.$submit.prop("disabled",!1).removeClass("disabled"))},onRulerClick:function(e){this.$el.hasClass("is-open")||(this.$el.addClass("is-open"),this.setupStage(),this.bindStageEvents()),e.preventDefault()},onCloseClick:function(e){return this.$el.removeClass("is-open"),this.unbindStageEvents(),this.destroyStage(),e.preventDefault(),e.stopPropagation(),!1},onFormSubmit:function(e){var t=parseFloat(this.$distance.val(),10),i=t/this.measuredDistance,a=this.$units.val();t&&(this.onCloseClick(e),this.$el.trigger("scaled",[i,a]),this.$distance.val(""))},getDistance:function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},remove:function(){this.unbindStageEvents(),this.rendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("ubnt/EventDispatcher",{bind:function(e,t,i){"use strict";var a=this._callbacks||(this._callbacks={}),n=a[e]||(a[e]=[]);return n.push([t,i]),this},unbind:function(e,t){"use strict";var i;if(e){if(i=this._callbacks)if(t){var a=i[e];if(!a)return this;for(var n=0,o=a.length;o>n;n++)if(a[n]&&t===a[n][0]){a[n]=null;break}}else i[e]=[]}else this._callbacks={};return this},trigger:function(e){"use strict";var t,i,a,n,o,r=2;if(!(i=this._callbacks))return this;for(;r--;)if(a=r?e:"all",t=i[a])for(var s=0,c=t.length;c>s;s++)(n=t[s])?(o=r?Array.prototype.slice.call(arguments,1):arguments,n[0].apply(n[1]||this,o)):(t.splice(s,1),s--,c--);return this}}),define("ubnt/TimerEvent",{TIMER_COMPLETE:"timer complete",TIMER:"timer"}),define("ubnt/Timer",["underscore","ubnt/EventDispatcher","ubnt/TimerEvent"],function(e,t,i){"use strict";var a=function(t,i){e.bindAll(this),this._delay=t,this._repeatCount=i||0,this._interval=void 0,this._currentCount=0,this._isRunning=!1};return e.extend(a.prototype,t,{setRunning:function(){throw new Error("running is read-only")},setCurrentCount:function(){throw new Error("currentCount is read-only")},setDelay:function(e){this._delay=e},setRepeatCount:function(e){this._repeatCount=e||0},reset:function(){this.stop(),this._currentCount=0},start:function(){this._interval||this._repeatCount&&this._currentCount>=this._repeatCount||(this._interval=setTimeout(this.tick,this._delay))},stop:function(){this._interval&&clearTimeout(this._interval),this._interval=void 0},tick:function(){return this._currentCount+=1,this._repeatCount&&this._currentCount>=this._repeatCount?(this.reset(),void this.trigger(i.TIMER_COMPLETE,{target:this})):(this._interval=setTimeout(this.tick,this._delay),void this.trigger(i.TIMER))}}),a}),define("ubnt/view/map/MarkerView",["backbone","underscore","ubnt/Timer","ubnt/TimerEvent","jquery"],function(e,t,i,a,n){"use strict";return e.View.extend({_fullyQualifiedName:"UBNT.views.map.Marker",initialize:function(e){t.bindAll(this),this.isHoldToDrag=!1,this.isMoving=!1,this.el=this.template({}),this.$el=n(this.el),this.$el.draggable({}).data("view",this),this.$marker=this.$(".marker-button"),this.$el.removeClass("expand"),this.$el.addClass("ap-model-"+this.model.get("model")),this.initHandlers(),this.render()},initHandlers:function(){this.isHoldToDrag&&(this.holdTimer=new i(500,1),this.holdTimer.bind(a.TIMER_COMPLETE,this.enableMove)),this.$el.on("drag",this.dragHandler),this.$el.on("dragstop",this.dragStopHandler),this.bindHandlers()},bindHandlers:function(){this.$marker.on("mousedown",this.markerMouseDownHandler),this.isHoldToDrag&&this.$marker.on("mouseout",this.holdTimer.reset)},dragHandler:function(){return this.isMoving?(this.setExpanded(!1),this.trigger("markerchange"),!0):!1},dragStopHandler:function(e,t){this.trigger("dragstop",e,t)},render:function(){},show:function(){this.$el.show()},hide:function(){this.$el.hide()},pulse:function(){this.$el.addClass("show-halo")},enableMove:function(){this.isMoving=!0,this.isHoldToDrag&&(this.$el.addClass("show-move"),this.$el.removeClass("expand")),this.trigger("dragstart",this)},disableMove:function(){this.$el.removeClass("show-move"),this.isMoving=!1,
this.trigger("dragstop",this)},setPosition:function(e,t){this.x=e,this.y=t,this.$el.css({left:this.x,top:this.y})},setExpanded:function(e){e?this.isExpanded||(this.$el.addClass("expand"),this.trigger("markerselect",this)):this.isExpanded&&(this.$el.removeClass("expand"),this.trigger("markerdeselect",this))},markerMouseDownHandler:function(e){this.isHoldToDrag&&this.holdTimer.start(),this.$el.toggleClass("expand"),this.isExpanded()?this.trigger("markerselect",this):this.trigger("markerdeselect",this),this.trigger("markerchange",this),this.isHoldToDrag||this.enableMove(),n("body").bind("mouseup",this.markerMouseUpHandler)},isExpanded:function(){return this.$el.hasClass("expand")},markerMouseUpHandler:function(e){this.isHoldToDrag&&this.holdTimer.reset(),this.disableMove(),n("body").unbind("mouseup",this.markerMouseUpHandler)},handleRemoveClick:function(){this.save({map_id:"",x:"",y:""})},remove:function(){this.$el.off("drag",this.dragHandler),this.$el.off("dragstop",this.dragStopHandler),this.$marker.off("mousedown",this.markerMouseDownHandler),n("body").unbind("mouseup",this.markerMouseUpHandler),e.View.prototype.remove.apply(this,arguments)}})}),define("unifi/view/map/MarkerView",["ubnt/view/map/MarkerView","underscore","jquery","msg/Msg"],function(e,t,i,a){"use strict";return e.extend({initialize:function(i){t.bindAll(this),this.template=this.options.template,this.map=this.options.map,e.prototype.initialize.apply(this,[i]),this.updateState(),this.updateUplink()},initHandlers:function(){e.prototype.initHandlers.apply(this,[]),this.$lockButton=this.$(".lock"),this.$configButton=this.$(".config"),this.$scanButton=this.$(".scan"),this.$removeButton=this.$(".remove"),this.$lockButtonIcon=this.$lockButton.find(".icon"),this.$lockButton.on("click",this.lockClickHandler),this.$configButton.on("click",this.configClickHandler),this.$removeButton.on("click",this.handleRemoveClick),this.model.isGen2Ap()&&(this.$scanButton.on("click",this.scanClickHandler),this.$el.addClass("gen-2")),this.listenTo(this.model,"change:name",this.updateName),this.listenTo(this.model,"change:mac",this.updateMac),this.listenTo(this.model,"change:user-num_sta",this.updateUsers),this.listenTo(this.model,"change:user-num_sta",this.updateUsers),this.listenTo(this.model,"change:na-user-num_sta",this.updateUsers),this.listenTo(this.model,"change:na-guest-num_sta",this.updateGuests),this.listenTo(this.model,"change:ng-guest-num_sta",this.updateGuests),this.listenTo(this.model,"change:ng-guest-num_sta",this.updateGuests),this.listenTo(this.model,"change:state",this.updateState),this.listenTo(this.model,"change:uplink",this.updateUplink),this.listenTo(this.model,"change:locked",this.updateLocked),this.updateLocked()},updateLocked:function(){this.model.get("locked")?(this.$el.toggleClass("locked",!0),this.$el.draggable("disable"),this.$lockButtonIcon.removeClass("ubnt-icon-unlock").addClass("ubnt-icon-lock")):(this.$el.toggleClass("locked",!1),this.$el.draggable("enable"),this.$lockButtonIcon.removeClass("ubnt-icon-lock").addClass("ubnt-icon-unlock"))},enableMove:function(){this.model.get("locked")||e.prototype.enableMove.apply(this,arguments)},lockClickHandler:function(e){var t=!this.model.get("locked");this.$el.toggleClass("locked",t),this.$el.draggable(t?"disable":"enable"),t?this.$lockButtonIcon.removeClass("ubnt-icon-unlock").addClass("ubnt-icon-lock"):this.$lockButtonIcon.removeClass("ubnt-icon-lock").addClass("ubnt-icon-unlock"),this.app.isReadOnly?this.model.set({locked:t}):this.model.save({locked:t})},configClickHandler:function(e){var i=this;if(this.app.routers.devices.views.index.properties[this.model.get("mac")]){var a=function(){i.app.routers.devices.views.index.properties[i.model.get("mac")].setSection("config")};t.delay(a,0)}else this.app.routers.devices.views.index.property(this.model,{section:"config"})},scanClickHandler:function(e){var i=this;if(this.app.routers.devices.views.index.properties[this.model.get("mac")]){var a=function(){i.app.routers.devices.views.index.properties[i.model.get("mac")].setSection("rfMap")};t.delay(a,0)}else this.app.routers.devices.views.index.property(this.model,{section:"rfMap"})},handleRemoveClick:function(t){this.model.get("locked")||e.prototype.handleRemoveClick.apply(this,arguments)},render:function(){e.prototype.render.apply(this,[]);var t=this;!this.rendered&&(this.rendered=!0)&&(this.$details=this.$(".details"),i(".ruler").on("scaled",this.updateRulerScale),this.$coverageToggle2g=i("#mapFilterCoverage2G"),this.$coverageToggle2g.on("change",function(){t.is2gCoverageEnabled=t.$coverageToggle2g.is(":checked"),t.updateUsers(),t.updateGuests()}),this.$coverageToggle5g=i("#mapFilterCoverage5G"),this.$coverageToggle5g.on("change",function(){t.is2gCoverageEnabled=!t.$coverageToggle5g.is(":checked"),t.updateUsers(),t.updateGuests()}),this.is2gCoverageEnabled=this.$coverageToggle2g.is(":checked")),this.updateName(),this.updateMac(),this.updateUsers(),this.updateGuests(),this.$(".marker-icon").addClass(this.model.apIcon()),this.$el.addClass(this.model.get("type"))},updateName:function(){this.$(".title").text(this.model.name());var e="";switch(this.model.get("type")){case this.model.typeMap.ap:e="AP";break;case this.model.typeMap.gateway:e="Gateway";break;case this.model.typeMap["switch"]:e="Switch";break;case this.model.typeMap.phone:e="Phone"}this.$details.find(".ap-name").text(this.model.get("name")||"Unnamed "+e)},updateMac:function(){this.$details.find(".mac").text(this.model.get("mac"))},updateUsers:function(){if(this.model.get("type")===this.model.typeMap.phone)this.$details.find(".users").parent().hide();else{var e=this.model.get("user-num_sta"),t=this.is2gCoverageEnabled?this.model.get("ng-user-num_sta"):this.model.get("na-user-num_sta");this.model.get("type")===this.model.typeMap.ap?this.$details.find(".users").text((t||0)+" / "+(e||0)):this.$details.find(".users").text(e||0)}},updateGuests:function(){if(this.model.get("type")===this.model.typeMap.phone)this.$details.find(".guests").parent().hide();else{var e=this.model.get("guest-num_sta"),t=this.is2gCoverageEnabled?this.model.get("ng-guest-num_sta"):this.model.get("na-guest-num_sta");this.model.get("type")===this.model.typeMap.ap?this.$details.find(".guests").text((t||0)+" / "+(e||0)):this.$details.find(".guests").text(e||0)}},updateState:function(){this.model.isConnected()?this.$el.addClass("ap-connected").removeClass("ap-disconnected"):this.$el.addClass("ap-disconnected").removeClass("ap-connected"),11===parseInt(this.model.get("state"),10)?this.$el.addClass("ap-isolated"):this.$el.removeClass("ap-isolated")},updateUplink:function(){var e=this.model.uplink();e&&"ath0"==e.name?this.$el.addClass("ap-vwireless"):this.$el.removeClass("ap-vwireless")},updateRulerScale:function(e,t,i){this.map.model.set({upp:t,unit:i}),this.map.$el.click()},save:function(e){this.app.isReadOnly?this.model.set({map_id:void 0!==e.map_id?e.map_id:this.model.get("map_id"),x:void 0!==e.x?e.x:this.model.get("x"),y:void 0!==e.y?e.y:this.model.get("y"),locked:void 0!==e.locked?e.locked:this.model.get("locked")}):(this.model.unset("x",{silent:!0}),this.model.unset("y",{silent:!0}),this.model.unset("map_id",{silent:!0}),this.model.unset("locked",{silent:!0}),this.model.save({map_id:void 0!==e.map_id?e.map_id:this.model.get("map_id"),x:void 0!==e.x?e.x:this.model.get("x"),y:void 0!==e.y?e.y:this.model.get("y"),locked:void 0!==e.locked?e.locked:this.model.get("locked")}))},pulse:function(){this.$el.stop().effect("pulsate",{times:2},2500)},remove:function(){this.$lockButton.off("click",this.lockClickHandler),this.$configButton.off("click",this.configClickHandler),this.$scanButton.on("scan",this.scanClickHandler),this.$removeButton.off("click",this.handleRemoveClick),this.stopListening(this.model,"change:name",this.updateName),this.stopListening(this.model,"change:mac",this.updateMac),this.stopListening(this.model,"change:user-num_sta",this.updateUsers),this.stopListening(this.model,"change:guest-num_sta",this.updateGuests),this.stopListening(this.model,"change:state",this.updateState),this.stopListening(this.model,"change:uplink",this.updateUplink),i(".ruler").off("scaled",this.updateRulerScale),this.rfMap&&(this.rfMap.remove(),this.rfMap=null),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("ubnt/view/map/UnplacedMarkerView",["backbone","underscore","jquery"],function(e,t,i){"use strict";return e.View.extend({initialize:function(){var e=this;t.bindAll(this),this.el=this.template({}),this.$el=i(this.el),this.draggableTemplate=this.options.draggableTemplate||this.draggableTemplate,this.$draggableHelper=i(this.draggableTemplate({})),this.$draggableHelper.addClass("ap-model-"+this.model.get("model")),this.$el.addClass("unplaced-marker ap-model-"+this.model.get("model")).draggable({appendTo:"#Map",helper:function(){return e.$draggableHelper.get(0)},cursorAt:{right:0,bottom:0}}),this.$draggableHelper.data("view",this),this.model.bind("change",this.updateMarker),this.model.bind("remove",this.removeMarker),this.updateMarker(this.model)},updateMarker:function(e){e.isConnected()?(this.$el.addClass("ap-connected").removeClass("ap-disconnected"),this.$draggableHelper.addClass("ap-connected").removeClass("ap-disconnected")):(this.$el.addClass("ap-disconnected").removeClass("ap-connected"),this.$draggableHelper.addClass("ap-disconnected").removeClass("ap-connected"))},remove:function(){this.model.unbind("change",this.updateMarker),this.model.unbind("remove",this.removeMarker),e.View.prototype.remove.apply(this,arguments)}})}),define("ubnt/view/map/MarkerDrawerView",["backbone","underscore","ubnt/view/map/UnplacedMarkerView","jquery"],function(e,t,i,a){"use strict";return e.View.extend({_fullyQualifiedName:"UBNT.views.map.MarkerDrawer",initialize:function(){t.bindAll(this),this.$markerList=this.$(".marker-list"),this.markerViews={},this.markerView=this.options.markerView||i,this.unplacedMarkerTemplate=this.options.unplacedMarkerTemplate,this.unplacedMarkerDraggableTemplate=this.options.unplacedMarkerDraggableTemplate,this.collections={},this.collections.markers=this.options.markers,this.collections.maps=this.options.maps,this.listenTo(this.collections.markers,"add",this.addMarker),this.listenTo(this.collections.markers,"change",this.updateMarker),this.listenTo(this.collections.markers,"reset",this.resetMarkers),this.listenTo(this.collections.markers,"remove",this.removeMarker),this.$unplacedMarkerCountElt=this.$(".unplaced-markers-count")},render:function(){return this.isRendered||(this.isRendered=!0,this.resetMarkers()),this.$el},isMarkerMappable:function(e){return e.id&&e.get("adopted")},addMultipleMarkers:function(e){var t,i,a,n,o=this,r=e.length,s=document.createDocumentFragment();for(n=0;r>n;n++)t=e[n],i=t.get("map_id"),i||o.collections.maps.get(i)||!o.isMarkerMappable(t)||(a=new o.markerView({model:t,template:o.unplacedMarkerTemplate,draggableTemplate:o.unplacedMarkerDraggableTemplate}),a.render(),s.appendChild(a.$el[0]),o.markerViews[t.id]=a);o.$markerList.append(s),o.updateUnplacedMarkerCount()},addMarker:function(e){if((!e.get("map_id")||!this.collections.maps.get(e.get("map_id"))||this.isMarkerMappable(e))&&e.id){var t=new this.markerView({model:e,template:this.unplacedMarkerTemplate,draggableTemplate:this.unplacedMarkerDraggableTemplate});t.render(),this.$markerList.append(t.$el),this.markerViews[e.id]=t,this.updateUnplacedMarkerCount()}},updateMarker:function(e){e.changedAttributes();this.isMarkerMappable(e)&&(e.get("map_id")||this.collections.maps.get(e.get("map_id"))?this.removeMarker(e):(null===this.markerViews[e.id]||void 0===this.markerViews[e.id])&&this.addMarker(e))},resetMarkers:function(){a.each(this.markerViews,function(e,t){t.remove()}),this.markerViews={},this.addMultipleMarkers(this.collections.markers.models),this.updateUnplacedMarkerCount()},removeMarker:function(e){this.markerViews[e.id]&&(this.markerViews[e.id].remove(),delete this.markerViews[e.id],this.updateUnplacedMarkerCount())},hasUnplacedMarkers:function(){return a.isEmptyObject(this.markerViews)?!1:!0},updateUnplacedMarkerCount:function(){var e=t.size(this.markerViews);this.$unplacedMarkerCountElt.text(e),e?this.show():this.hide()},show:function(){this.$el.show()},hide:function(){this.$el.hide()},remove:function(){this.stopListening(this.collections.markers,"add",this.addMarker),this.stopListening(this.collections.markers,"change",this.updateMarker),this.stopListening(this.collections.markers,"reset",this.resetMarkers),this.stopListening(this.collections.markers,"remove",this.removeMarker),this.isRendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("unifi/view/map/UnplacedMarkerView",["ubnt/view/map/UnplacedMarkerView","underscore"],function(e,t){"use strict";return e.extend({initialize:function(t){this.template=this.options.template,this.listenTo(this.model,"change:name",this.updateName),e.prototype.initialize.apply(this,[t]),this.$itemLabel=this.$(".item-label"),this.$UIicon=this.$(".ui-icon"),this.$draggableHelperUIicon=this.$draggableHelper.find(".ui-icon")},render:function(){this.updateName(),this.$UIicon.addClass(this.model.apIcon()),this.$draggableHelperUIicon.addClass(this.model.apIcon()).text(this.model.name()),this.listenTo(this.model,"change:state",this.updateState),this.updateState()},updateName:function(){this.$itemLabel.html(t.escape(this.model.name()))},updateState:function(){this.model.isConnected()?this.$el.addClass("ap-connected"):this.$el.addClass("ap-disconnected"),11===parseInt(this.model.get("state"),10)?this.$el.addClass("ap-isolated"):this.$el.removeClass("ap-isolated")},remove:function(){this.stopListening(this.model,"change:name",this.updateName),this.stopListening(this.model,"change:state",this.updateState),e.prototype.remove.apply(this,arguments)}})}),define("ubnt/view/map/MapBase",["backbone","underscore","jquery","msg/Msg"],function(e,t,i,a){"use strict";return e.View.extend({_fullyQualifiedName:"UBNT.views.map.MapBase",initialize:function(){t.bindAll(this),this.collections={},this.collections.markers=this.options.markers,this.MarkerView=this.options.markerView,this.markerTemplate=this.options.markerTemplate,this.markerViews={},this.layers={},this.layerItems={},this.layerZ=1},bindHandlers:function(){this.collections.markers.on("add",this.addMarker),this.collections.markers.on("change",this.updateMarker),this.collections.markers.on("reset",this.resetMarkers),this.collections.markers.on("remove",this.removeMarker),t.each(this.layers,function(e){e.bindHandlers()},this)},unbindHandlers:function(){this.collections.markers.off("add",this.addMarker),this.collections.markers.off("change",this.updateMarker),this.collections.markers.off("reset",this.resetMarkers),this.collections.markers.off("remove",this.removeMarker),t.each(this.layers,function(e){e.unbindHandlers()},this)},getMap:function(){return this.model},show:function(){this.$el.show()},hide:function(){this.$el.hide()},resize:function(){},mapChangeHandler:function(){},toggleLabels:function(){i.each(this.markers,function(e,t){t.toggleLabel()})},toggleDetails:function(){i.each(this.markers,function(e,t){t.toggleDetail()})},bringLayerItemToTop:function(e){var t=this.layerItems[e.cid];t&&(t.$el.css("zIndex",this.layerZ),this.layerZ++)},addMarker:function(e,t){var i=e.get("map_id"),n=e.id;if(this.model&&t&&i==this.model.id&&(null===this.markerViews[n]||void 0===this.markerViews[n])){var o=new this.MarkerView({model:e,map:this,template:this.markerTemplate});o.bind("markerselect",this.markerSelectHandler),o.bind("markerdeselect",this.markerDeselectHandler),this.markerViews[n]=o;var r=o.$(".detail.mac-text"),s=o.$(".detail.channel-text"),c=o.$(".detail.users-text"),l=o.$(".detail.guests-text");r.find("span").text(a.G_MapMAC),s.find("span").text(a.G_MapChannel),c.find("span").text(a.G_MapUsers),l.find("span").text(a.G_MapGuests)}},updateMarker:function(){throw"updateMarker: You must override this function."},resetMarkers:function(){t.each(this.markerViews,function(e){this.removeMarker(e.model)},this),this.markerViews={},this.collections.markers.each(function(e){this.addMarker(e)},this)},removeMarker:function(e){var t=this.markerViews[e.id];t&&(this.markerViews[e.id].remove(),delete this.markerViews[e.id],this.trigger("mapremovemarker",t))},getMarkers:function(){return this.markerViews},addLayerItem:function(){throw"addLayerItem: You must override this function."},removeLayerItem:function(){throw"removeLayerItem: You must override this function."},dropHandler:function(){throw"dropHandler: You must override this function."},enableMapDrag:function(){throw"enableMapDrag: You must override this function."},disableMapDrag:function(){throw"disableMapDrag: You must override this function."},computeDistanceBetween:function(){throw"computeDistanceBetween: You must override this function."},computeOffset:function(){throw"computeOffset: You must override this function."},translateToPixelCoordinates:function(){throw"translateToPixelCoordinates: You must override this function."},translateToMapCoordinates:function(){throw"translateToMapCoordinates: You must override this function."},markerSelectHandler:function(e){t.each(this.markerViews,function(t){t!==e&&t.setExpanded(!1)},this)},markerDeselectHandler:function(){},remove:function(){this.unbindHandlers(),t.each(this.markerViews,function(e){e.unbind("markerselect",this.markerSelectHandler),e.unbind("markerdeselect",this.markerDeselectHandler)},this),e.View.prototype.remove.apply(this,arguments)}},{MAP_PANE:"mapPane",OVERLAY_LAYER:"overlayLayer",OVERLAY_SHADOW:"overlayShadow",OVERLAY_IMAGE:"overlayImage",FLOAT_SHADOW:"floatShadow",OVERLAY_MOUSE_TARGET:"overlayMouseTarget",FLOAT_PANE:"floatPane"})}),define("ubnt/view/map/GoogleMapOverlayWrapperView",[],function(){"use strict";return{Overlay:function(e,t){return this.view=e,this},initialize:function(){this.Overlay.prototype=new google.maps.OverlayView,this.Overlay.prototype.onAdd=function(){var e=this.getPanes();e[this.view.getPane()].appendChild(this.view.$el.get(0))},this.Overlay.prototype.onRemove=function(){this.view.$el.hide()},this.Overlay.prototype.draw=function(){this.view.trigger("layeritemadded"),this.view.$el.show()},this.Overlay.prototype.hide=function(){this.view.$el.hide()},this.Overlay.prototype.show=function(){this.draw(),this.view.$el.show()},this.Overlay.prototype.toggle=function(){this.view.$el.toggle()}}}}),define("unifi/view/map/MarkerRfMapView",["backbone","underscore","jquery","libs/d3","msg/Msg"],function(e,t,i,a,n){"use strict";return e.View.extend({rfMapBorderData:{normalCircle:{cx:75,cy:75,r:65,fill:"none",stroke:"rgba(50,110,140,1)","stroke-width":2},warningPath:{data1:{fill:"none",stroke:"#FBE800","stroke-width":2,"stroke-miterlimit":10,d:"M592,306.9c0,1.6-4.6,3-4.7,4.5c-0.1,1.5,4.4,3.5,4.2,5c-0.2,1.5-4.9,2.5-5.2,4c-0.2,1.5,4,3.9,3.6,5.4c-0.3,1.5-5.1,1.9-5.6,3.4c-0.4,1.5,3.5,4.3,3,5.8c-0.5,1.5-5.3,1.3-5.9,2.8c-0.6,1.4,3,4.7,2.4,6.1c-0.7,1.4-5.4,0.7-6.2,2.1c-0.7,1.4,2.5,5,1.7,6.3c-0.8,1.3-5.5,0.2-6.3,1.4c-0.9,1.3,1.9,5.2,1,6.4c-0.9,1.2-5.5-0.4-6.5,0.7c-1,1.2,1.4,5.4,0.3,6.5c-1.1,1.1-5.4-1-6.5,0c-1.1,1.1,0.8,5.5-0.4,6.5c-1.2,1-5.2-1.6-6.5-0.7c-1.2,0.9,0.2,5.5-1.1,6.4c-1.3,0.9-5-2.2-6.4-1.4c-1.3,0.8-0.4,5.5-1.8,6.3c-1.4,0.7-4.8-2.7-6.2-2c-1.4,0.6-1,5.5-2.4,6c-1.4,0.6-4.5-3.2-5.9-2.7c-1.5,0.5-1.6,5.3-3.1,5.7c-1.5,0.4-4.1-3.7-5.6-3.3c-1.5,0.3-2.2,5.1-3.7,5.4c-1.5,0.2-3.7-4.1-5.2-3.9c-1.5,0.2-2.7,4.8-4.2,4.9c-1.5,0.1-3.2-4.4-4.7-4.4c-1.6,0-3.2,4.5-4.7,4.4c-1.5-0.1-2.7-4.8-4.2-4.9c-1.5-0.2-3.7,4.2-5.2,3.9c-1.5-0.2-2.2-5-3.7-5.4c-1.5-0.3-4.1,3.7-5.6,3.3c-1.5-0.4-1.6-5.2-3.1-5.7c-1.5-0.5-4.5,3.3-5.9,2.7c-1.4-0.6-1-5.4-2.4-6c-1.4-0.7-4.8,2.8-6.2,2c-1.4-0.7-0.5-5.5-1.8-6.3c-1.3-0.8-5.1,2.2-6.4,1.4c-1.3-0.9,0.1-5.5-1.1-6.4c-1.2-0.9-5.3,1.7-6.5,0.7c-1.2-1,0.7-5.4-0.4-6.5c-1.1-1.1-5.4,1.1-6.5,0c-1.1-1.1,1.3-5.3,0.3-6.5c-1-1.2-5.5,0.5-6.5-0.7c-0.9-1.2,1.9-5.1,1-6.4c-0.9-1.3-5.5-0.1-6.3-1.4c-0.8-1.3,2.4-4.9,1.7-6.3c-0.7-1.4-5.5-0.7-6.2-2.1c-0.6-1.4,2.9-4.6,2.4-6.1c-0.6-1.4-5.4-1.3-5.9-2.8c-0.5-1.5,3.4-4.3,3-5.8c-0.4-1.5-5.2-1.9-5.6-3.4c-0.3-1.5,3.9-3.9,3.6-5.4c-0.2-1.5-5-2.4-5.2-4c-0.2-1.5,4.3-3.4,4.2-5c-0.1-1.5-4.7-3-4.7-4.5s4.6-3,4.7-4.5c0.1-1.5-4.4-3.5-4.2-5c0.2-1.5,4.9-2.5,5.2-4c0.2-1.5-4-3.9-3.6-5.4c0.3-1.5,5.1-1.9,5.6-3.4c0.4-1.5-3.5-4.3-3-5.8c0.5-1.5,5.3-1.3,5.9-2.8c0.6-1.4-3-4.7-2.4-6.1c0.6-1.4,5.4-0.7,6.2-2.1c0.7-1.4-2.5-5-1.7-6.3c0.8-1.3,5.5-0.2,6.3-1.4c0.9-1.3-1.9-5.2-1-6.4c0.9-1.2,5.5,0.4,6.5-0.7c1-1.2-1.4-5.4-0.3-6.5c1.1-1.1,5.4,1,6.5,0c1.1-1.1-0.8-5.5,0.4-6.5c1.2-1,5.2,1.6,6.5,0.7c1.2-0.9-0.2-5.5,1.1-6.4c1.3-0.9,5,2.2,6.4,1.4c1.3-0.8,0.4-5.5,1.8-6.3c1.4-0.7,4.8,2.7,6.2,2c1.4-0.6,1-5.5,2.4-6c1.4-0.6,4.5,3.2,5.9,2.7c1.5-0.5,1.6-5.3,3.1-5.7c1.5-0.4,4.1,3.7,5.6,3.3c1.5-0.3,2.2-5.1,3.7-5.4c1.5-0.2,3.7,4.1,5.2,3.9c1.5-0.2,2.7-4.8,4.2-4.9c1.5-0.1,3.2,4.4,4.7,4.4s3.2-4.5,4.7-4.4c1.5,0.1,2.7,4.8,4.2,4.9c1.5,0.2,3.7-4.2,5.2-3.9c1.5,0.2,2.2,5,3.7,5.4c1.5,0.3,4.1-3.7,5.6-3.3c1.5,0.4,1.6,5.2,3.1,5.7c1.5,0.5,4.5-3.3,5.9-2.7c1.4,0.6,1,5.4,2.4,6c1.4,0.7,4.8-2.8,6.2-2c1.4,0.7,0.5,5.5,1.8,6.3c1.3,0.8,5.1-2.2,6.4-1.4c1.3,0.9-0.1,5.5,1.1,6.4c1.2,0.9,5.3-1.7,6.5-0.7c1.2,1-0.7,5.4,0.4,6.5c1.1,1.1,5.4-1.1,6.5,0c1.1,1.1-1.3,5.3-0.3,6.5c1,1.2,5.5-0.5,6.5,0.7c0.9,1.2-1.9,5.1-1,6.4c0.9,1.3,5.5,0.1,6.3,1.4c0.8,1.3-2.4,4.9-1.7,6.3c0.7,1.4,5.5,0.7,6.2,2.1c0.6,1.4-2.9,4.6-2.4,6.1c0.6,1.4,5.4,1.3,5.9,2.8c0.5,1.5-3.4,4.3-3,5.8c0.4,1.5,5.2,1.9,5.6,3.4c0.3,1.5-3.9,3.9-3.6,5.4c0.2,1.5,5,2.4,5.2,4c0.2,1.5-4.3,3.4-4.2,5C587.4,304,592,305.4,592,306.9z",transform:"translate(-304,-156) scale(0.75)"},data2:{fill:"none",stroke:"#FBE800","stroke-width":2,"stroke-miterlimit":10,d:"M592,306.9c0,1.6-4.6,3-4.7,4.5c-0.1,1.5,4.4,3.5,4.2,5c-0.2,1.5-4.9,2.5-5.2,4c-0.2,1.5,4,3.9,3.6,5.4c-0.3,1.5-5.1,1.9-5.6,3.4c-0.4,1.5,3.5,4.3,3,5.8c-0.5,1.5-5.3,1.3-5.9,2.8c-0.6,1.4,3,4.7,2.4,6.1c-0.7,1.4-5.4,0.7-6.2,2.1c-0.7,1.4,2.5,5,1.7,6.3c-0.8,1.3-5.5,0.2-6.3,1.4c-0.9,1.3,1.9,5.2,1,6.4c-0.9,1.2-5.5-0.4-6.5,0.7c-1,1.2,1.4,5.4,0.3,6.5c-1.1,1.1-5.4-1-6.5,0c-1.1,1.1,0.8,5.5-0.4,6.5c-1.2,1-5.2-1.6-6.5-0.7c-1.2,0.9,0.2,5.5-1.1,6.4c-1.3,0.9-5-2.2-6.4-1.4c-1.3,0.8-0.4,5.5-1.8,6.3c-1.4,0.7-4.8-2.7-6.2-2c-1.4,0.6-1,5.5-2.4,6c-1.4,0.6-4.5-3.2-5.9-2.7c-1.5,0.5-1.6,5.3-3.1,5.7c-1.5,0.4-4.1-3.7-5.6-3.3c-1.5,0.3-2.2,5.1-3.7,5.4c-1.5,0.2-3.7-4.1-5.2-3.9c-1.5,0.2-2.7,4.8-4.2,4.9c-1.5,0.1-3.2-4.4-4.7-4.4c-1.6,0-3.2,4.5-4.7,4.4c-1.5-0.1-2.7-4.8-4.2-4.9c-1.5-0.2-3.7,4.2-5.2,3.9c-1.5-0.2-2.2-5-3.7-5.4c-1.5-0.3-4.1,3.7-5.6,3.3c-1.5-0.4-1.6-5.2-3.1-5.7c-1.5-0.5-4.5,3.3-5.9,2.7c-1.4-0.6-1-5.4-2.4-6c-1.4-0.7-4.8,2.8-6.2,2c-1.4-0.7-0.5-5.5-1.8-6.3c-1.3-0.8-5.1,2.2-6.4,1.4c-1.3-0.9,0.1-5.5-1.1-6.4c-1.2-0.9-5.3,1.7-6.5,0.7c-1.2-1,0.7-5.4-0.4-6.5c-1.1-1.1-5.4,1.1-6.5,0c-1.1-1.1,1.3-5.3,0.3-6.5c-1-1.2-5.5,0.5-6.5-0.7c-0.9-1.2,1.9-5.1,1-6.4c-0.9-1.3-5.5-0.1-6.3-1.4c-0.8-1.3,2.4-4.9,1.7-6.3c-0.7-1.4-5.5-0.7-6.2-2.1c-0.6-1.4,2.9-4.6,2.4-6.1c-0.6-1.4-5.4-1.3-5.9-2.8c-0.5-1.5,3.4-4.3,3-5.8c-0.4-1.5-5.2-1.9-5.6-3.4c-0.3-1.5,3.9-3.9,3.6-5.4c-0.2-1.5-5-2.4-5.2-4c-0.2-1.5,4.3-3.4,4.2-5c-0.1-1.5-4.7-3-4.7-4.5s4.6-3,4.7-4.5c0.1-1.5-4.4-3.5-4.2-5c0.2-1.5,4.9-2.5,5.2-4c0.2-1.5-4-3.9-3.6-5.4c0.3-1.5,5.1-1.9,5.6-3.4c0.4-1.5-3.5-4.3-3-5.8c0.5-1.5,5.3-1.3,5.9-2.8c0.6-1.4-3-4.7-2.4-6.1c0.6-1.4,5.4-0.7,6.2-2.1c0.7-1.4-2.5-5-1.7-6.3c0.8-1.3,5.5-0.2,6.3-1.4c0.9-1.3-1.9-5.2-1-6.4c0.9-1.2,5.5,0.4,6.5-0.7c1-1.2-1.4-5.4-0.3-6.5c1.1-1.1,5.4,1,6.5,0c1.1-1.1-0.8-5.5,0.4-6.5c1.2-1,5.2,1.6,6.5,0.7c1.2-0.9-0.2-5.5,1.1-6.4c1.3-0.9,5,2.2,6.4,1.4c1.3-0.8,0.4-5.5,1.8-6.3c1.4-0.7,4.8,2.7,6.2,2c1.4-0.6,1-5.5,2.4-6c1.4-0.6,4.5,3.2,5.9,2.7c1.5-0.5,1.6-5.3,3.1-5.7c1.5-0.4,4.1,3.7,5.6,3.3c1.5-0.3,2.2-5.1,3.7-5.4c1.5-0.2,3.7,4.1,5.2,3.9c1.5-0.2,2.7-4.8,4.2-4.9c1.5-0.1,3.2,4.4,4.7,4.4s3.2-4.5,4.7-4.4c1.5,0.1,2.7,4.8,4.2,4.9c1.5,0.2,3.7-4.2,5.2-3.9c1.5,0.2,2.2,5,3.7,5.4c1.5,0.3,4.1-3.7,5.6-3.3c1.5,0.4,1.6,5.2,3.1,5.7c1.5,0.5,4.5-3.3,5.9-2.7c1.4,0.6,1,5.4,2.4,6c1.4,0.7,4.8-2.8,6.2-2c1.4,0.7,0.5,5.5,1.8,6.3c1.3,0.8,5.1-2.2,6.4-1.4c1.3,0.9-0.1,5.5,1.1,6.4c1.2,0.9,5.3-1.7,6.5-0.7c1.2,1-0.7,5.4,0.4,6.5c1.1,1.1,5.4-1.1,6.5,0c1.1,1.1-1.3,5.3-0.3,6.5c1,1.2,5.5-0.5,6.5,0.7c0.9,1.2-1.9,5.1-1,6.4c0.9,1.3,5.5,0.1,6.3,1.4c0.8,1.3-2.4,4.9-1.7,6.3c0.7,1.4,5.5,0.7,6.2,2.1c0.6,1.4-2.9,4.6-2.4,6.1c0.6,1.4,5.4,1.3,5.9,2.8c0.5,1.5-3.4,4.3-3,5.8c0.4,1.5,5.2,1.9,5.6,3.4Ic0.3,1.5-3.9,3.9-3.6,5.4c0.2,1.5,5,2.4,5.2,4c0.2,1.5-4.3,3.4-4.2,5C587.4,304,592,305.4,592,306.9z",transform:"translate(-304,-156) scale(0.75)"}},dangerPolygon:{data1:{fill:"none",stroke:"#ED2224","stroke-width":2,"stroke-miterlimit":10,points:"591.4,308.6 595.2,311.8 589.4,314.6 592.1,317.9 589.3,320.7 594.2,324.6 595.2,328.2 593.3,331.1 587.7,332.8 586.8,335.8 587.1,339.1 582.6,340.7 581.7,343.5 581.8,346.9 577.7,348.2 582.5,354.4 577.8,355.3 580.5,360.9 575.9,361.5 576.5,366.1 572.8,367.2 570,368.9 565.1,368.5 563,370.7 560.4,372.4 557.9,374.1 557.8,378.9 554.4,379.5 552.7,382.5 549.4,383.1 548.2,387.3 545,388.1 541.3,387.8 539.5,391.4 536.5,392.7 533.7,394.4 529,389.6 526.4,391.8 524.3,396.6 520,390.8 517.8,396.6 514.4,394.9 511.8,401.2 508.4,398.7 505.2,400.1 502.1,393.9 498.8,397.3 495.8,395.1 493.4,390.6 490.1,392.1 487,392.1 484.2,390.8 480.5,392.4 476.5,394.5 474,392.2 470.4,392.4 466.7,392.8 463.9,391 460.8,389.8 458.9,386.6 455.8,385.4 453.5,382.9 454.8,375.8 450.3,376.6 445.1,377.9 442.2,376.2 442.6,371.1 441.1,368.2 441.8,363.5 439.4,361.5 432.7,362.8 435.9,356.7 428.4,357.9 428.4,354.1 427.3,351.1 426.4,348 428.8,343.4 428.9,340.1 420.2,340.2 418.2,337.5 416,334.7 422.8,329.6 420.3,327 419.1,324.1 413.6,321.7 412.8,318.5 416.9,314.9 419.3,311.6 420.4,308.6 419.2,305.5 420,302.5 422.8,299.7 417.2,295.9 423.2,293.8 422.1,290.5 422.7,287.5 417.3,282.8 425.6,282.1 422.9,277.9 423.7,274.8 421.3,270.3 428.2,270 429.6,267.3 433.7,266.1 430.3,260.4 435.8,260.4 432.8,254.4 440.7,256.6 439.5,251.7 439.9,247.8 441.9,245.3 446.8,245.9 447.3,241.8 447.7,237.3 453.1,239.1 452.2,232.4 458.3,235.7 458.7,230.3 464.1,233.3 465.4,229.1 470,231.6 472,228.4 475.6,229.3 477.2,224.5 481.5,228 483.3,223 486.1,221 489.7,223 492.2,218.2 495.7,220.9 498.7,218.5 501.9,218.4 505.2,223.9 508.5,216.2 511.6,218.2 514.2,224.3 518.2,217.8 521.4,218.3 523.7,223.6 527.3,222 531.1,220.2 532.9,225.2 535.9,226.2 538.3,228.6 540.8,230.5 545.6,227.9 546,233.7 547.3,237.6 554.5,231.9 558,232.5 555.9,240.8 562.1,237.9 562.3,242.6 566.9,242.2 570.6,243.1 571.6,246.7 571.8,250.9 574.4,252.7 572.7,258 580.6,256.2 579.4,260.9 577.3,265.8 577.9,268.8 586.5,267.8 584.3,272.4 584.5,275.7 586.6,278.2 588.4,280.8 592.1,283 587.2,287.6 587.4,290.7 593.7,292.6 593.3,295.9 588.1,299.6 593.1,302.3 590,305.5",transform:"translate(-304,-157) scale(0.75)"},data2:{fill:"none",stroke:"#ED2224","stroke-width":1.2,"stroke-miterlimit":10,points:"458.4,379.7 453.1,381.9 452.4,377.5 447.8,378.2 449.8,371.1 442.7,374.2 441.8,370.6 444.1,364.2 435,368.1 433.9,364.7 436.9,358.5 433,357.6 427.2,357.5 426,354.4 426.7,350.3 425,347.6 423.1,345 423.4,341.4 423,338.2 422.6,335.1 422.2,332 419.6,329.4 420.4,326.1 420.1,323 418.3,320.1 416.9,317.1 412.7,314.2 419,310.7 422,307.7 416.5,304.5 422.4,301.8 423.1,298.9 421.7,295.7 416.9,291.7 415.2,288 418.4,285.4 418.9,282.3 423.8,280.5 425,277.7 421,272.7 429.9,273.3 430.4,270.2 425.4,263.9 434.7,265.8 431.4,260.1 432.2,256.8 432.3,252.8 437.5,252.8 440.9,251.7 440.7,247.3 444.6,246.7 448,245.8 446.3,239.2 448.5,236.8 451.3,235.1 456.4,236.7 457.5,232.7 460,230.5 464.3,231.8 466.3,228.9 469.3,227.9 470.9,223.3 476.2,228.3 479.7,229.2 482.3,227.7 484.9,225.4 488,225.6 489.7,217.3 493.7,222.5 496.7,221.1 500.1,225 502.9,218.2 506.1,216.4 509,225.7 512.5,219.6 514.8,226.6 518.6,221.3 522.1,219.9 525.4,219.8 528.7,220.1 530.3,226.2 532.2,230.2 537.4,224.8 541,224.5 543.4,227 543.6,233.8 547.5,233 548,238.1 550.8,239.2 557.8,234.4 561,235.5 560.5,241.4 563.1,243.2 567.8,242.7 568.4,246.7 571,248.6 570,253.6 577.7,251.4 572.7,259.1 577.5,259.5 578.7,262.4 581.9,264.1 586.4,265.3 582,271.1 580.9,274.9 585.8,276.1 584.7,279.9 583.7,283.4 592.1,284 590.6,287.7 588.4,291.4 591.9,293.9 587,297.7 593.3,300 597.7,302.9 594.3,306.3 595.7,309.5 590.7,312.5 588.3,315.4 591.4,318.8 594.8,322.4 592.3,325.2 588.2,327.6 588.7,330.8 589.5,334.3 591.2,338.2 585,339.3 587.4,343.7 587.4,347.2 584.8,349.5 577.3,348.9 576.1,351.7 581,358.5 572.5,356.4 576.4,363.1 572.4,363.9 568.5,364.6 571.8,372 567.6,372.4 563.8,372.9 563.8,377.7 560.2,378.4 554.1,375.5 555.7,383.1 553.6,385.7 549.8,385.7 545.9,385.1 545.4,391.2 540.2,387.5 537.1,388.2 536.4,395.1 531.4,390.4 528.5,391.3 526,394.1 523.8,398.7 520.4,398.4 516.4,393.4 513.7,397.1 510.7,399.5 507.4,397.3 504.2,396.1 501.2,393.5 497.7,399.5 494.9,395.4 491.9,394 489,393.2 485.6,393.9 482.3,394.3 479.6,392.4 475.7,394.1 473,392.1 470.1,390.7 470,383.4 463.7,389.2 464.4,381.4 462.1,379.4",transform:"translate(-304,-157) scale(0.75)"}}},initialize:function(t){e.View.prototype.initialize.apply(this,arguments),this.markerView=t.markerView,this.model=this.markerView.model,this.render()},render:function(){var e=this;!this.rendered&&(this.rendered=!0)&&(this.width=150,this.height=150,this.$el=i("<div></div>"),this.$el.addClass("rfmap"),this.$el.css({position:"absolute",width:this.width+"px",height:this.height+"px","z-index":2}),this.svgContainer=a.select(this.$el.get(0)).append("svg").attr("width",this.width).attr("height",this.height),this.$labels=i('<div class="labels"></div'),this.$el.append(this.$labels),this.$upperLabels=i('<div class="upperLabels"></div'),this.$labels.append(this.$upperLabels),this.$lowerLabels=i('<div class="lowerLabels"></div'),this.$labels.append(this.$lowerLabels),this.$mapToggles=i(".buttonset.mainToggles input"),this.$mapToggles.on("click",this.toggleRfMap.bind(this)),this.$coverageToggle2g=i("#mapFilterCoverage2G"),this.$coverageToggle2g.on("change",function(){e.is2gCoverageEnabled=e.$coverageToggle2g.is(":checked"),e.toggleRfMap(),e.renderComponents()}),this.$coverageToggle5g=i("#mapFilterCoverage5G"),this.$coverageToggle5g.on("change",function(){e.is2gCoverageEnabled=!e.$coverageToggle5g.is(":checked"),e.toggleRfMap(),e.renderComponents()}),this.is2gCoverageEnabled=this.$coverageToggle2g.is(":checked"),this.markerView.$el.before(this.$el),this.markerView.$el.on("drag",function(t,i){e.setPosition(i.position.left,i.position.top)}),this.listenTo(this.model,"change:state",this.renderComponents),this.listenTo(this.model,"change:ng-channel change:na-channel",this.renderChannelLabel),this.listenTo(this.model,"change:ng-tx_power change:na-tx_power change:ng-gain change:na-gain change:ng-eirp change:na-eirp",this.renderTxPowerLabel)),this.toggleRfMap(),this.renderComponents()},renderComponents:function(){this.renderBackgroundCircle(),this.renderChannelLabel(),this.renderBandLabel(),this.renderAntennaLabel(),this.renderTxPowerLabel(),this.renderBackgroundCircleOutline()},toggleRfMap:function(){i("#Map").hasClass("details")&&this.isRfMapSupported()?(this.$el.show(),this.markerView.$el.addClass("withRfMap")):(this.$el.hide(),this.markerView.$el.removeClass("withRfMap"))},isRfMapSupported:function(){return this.model.isConnected()&&(this.is2gCoverageEnabled?this.model.hasRadio("ng"):this.model.hasRadio("na"))?!0:!1},renderBackgroundCircle:function(){this.backgroundCircle&&this.backgroundCircle.remove(),this.backgroundCircle=this.svgContainer.append("g"),this.backgroundCircle.append("circle").attr("cx",75).attr("cy",75).attr("r",60).attr("fill","rgba(80,80,80,0.7)").attr("stroke","rgba(80,80,80,0.85)").attr("stroke-width",1)},renderBackgroundCircleOutlineShape:function(e,i,a){var n=e.append(i);return t.each(a,function(e,t){n.attr(t,e)}),n},renderBackgroundCircleOutline:function(){this.backgroundCircleOutline&&this.backgroundCircleOutline.remove(),this.backgroundCircleOutline=this.svgContainer.append("g"),this.renderBackgroundCircleOutlineShape(this.backgroundCircleOutline,"circle",this.rfMapBorderData.normalCircle)},renderThroughputChart:function(){var e,t=0;this.throughputChart&&this.throughputChart.remove(),this.throughputChart=this.svgContainer.append("g");for(var i=0;8>i;i++)e=i>=8*t?.5:1,this.throughputChart.append("rect").attr("x",47).attr("y",88-4*i).attr("width",5).attr("height",2.75).attr("fill","rgba(255,255,255,"+e+")");
},renderThroughputChartLabel:function(){var e="0",t="mbps";this.throughputChartLabel&&this.throughputChartLabel.remove(),this.throughputChartLabel=i("<div></div").addClass("throughputChartLabel"),this.throughputChartLabel.append(i("<div></div>").text(e).addClass("mediumText")),this.throughputChartLabel.append(i("<div></div>").text(t).addClass("smallText")),this.$labels.append(this.throughputChartLabel)},renderUtilizationChart:function(){var e=0;this.utilizationChart&&this.utilizationChart.remove(),this.utilizationChart=this.svgContainer.append("g"),this.utilizationChart.append("rect").attr("x",98).attr("y",60).attr("width",5).attr("height",30*(1-e)).attr("fill","rgba(255,255,255,0.5)"),this.utilizationChart.append("rect").attr("x",98).attr("y",60+32*(1-e)).attr("width",5).attr("height",30*e).attr("fill","rgba(255,255,255,1)")},renderUtilizationChartLabel:function(){var e="0",t="%";this.utilizationChartLabel&&this.utilizationChartLabel.remove(),this.utilizationChartLabel=i("<div></div").addClass("utilizationChartLabel"),this.utilizationChartLabel.append(i("<span></span>").text(e).addClass("mediumText")),this.utilizationChartLabel.append(i("<span></span>").text(t).addClass("smallText")),this.$labels.append(this.utilizationChartLabel)},renderChannelLabel:function(){var e="ch",t=this.is2gCoverageEnabled?this.model.channel("ng"):this.model.channel("na");this.channelLabel&&this.channelLabel.remove(),this.channelLabel=i("<div></div").addClass("channelLabel"),this.channelLabel.append(i("<span></span>").text(e).addClass("smallText")),this.channelLabel.append(i("<span></span>").text(t).addClass("mediumText")),this.$upperLabels.append(this.channelLabel)},renderAntennaLabel:function(){var e=this.is2gCoverageEnabled?this.model.getNss("ng"):this.model.getNss("na"),t=e,a=e;e&&(this.antennaLabel&&this.antennaLabel.remove(),this.antennaLabel=i("<div></div").addClass("antennaLabel"),this.antennaLabel.append(i("<span></span>").text(t).addClass("mediumText")),this.antennaLabel.append(i("<span></span>").text("x").addClass("smallText")),this.antennaLabel.append(i("<span></span>").text(a).addClass("mediumText")),this.$lowerLabels.append(this.antennaLabel))},renderBandLabel:function(){var e="11",t=this.is2gCoverageEnabled?"n/b/g":this.model.is11ac()?"n/a/ac":"n/a";this.bandLabel&&this.bandLabel.remove(),t&&(this.bandLabel=i("<div></div").addClass("bandLabel"),this.bandLabel.append(i("<span></span>").text(e).addClass("smallText")),this.bandLabel.append(i("<span></span>").text(t).addClass("mediumText")),this.$lowerLabels.append(this.bandLabel))},renderTxPowerLabel:function(){var e=this.is2gCoverageEnabled?this.model.transmitPower("ng"):this.model.transmitPower("na"),t="dbm";this.txPowerLabel&&this.txPowerLabel.remove(),e&&(this.txPowerLabel=i("<div></div").addClass("txPowerLabel"),this.txPowerLabel.append(i("<span></span>").text(e).addClass("mediumText")),this.txPowerLabel.append(i("<span></span>").text(t).addClass("smallText")),this.$upperLabels.append(this.txPowerLabel))},setPosition:function(e,t){this.$el.css({left:e-75,top:t-75})},remove:function(){e.View.prototype.remove.apply(this,arguments)}})}),define("ubnt/view/map/GoogleMapMarkerWrapperView",["unifi/view/map/MarkerRfMapView"],function(e){"use strict";return{Overlay:function(e,t){return this.markerView=e,this},initialize:function(){this.Overlay.prototype=new google.maps.OverlayView,this.Overlay.prototype.onAdd=function(){var e=this.getPanes();e.floatPane.appendChild(this.markerView.$el.get(0))},this.Overlay.prototype.onRemove=function(){this.markerView.$el.hide()},this.Overlay.prototype.draw=function(){var t=this.getProjection(),i=t.fromLatLngToDivPixel(new google.maps.LatLng(this.markerView.model.get("x"),this.markerView.model.get("y")));this.markerView.$el.css("position","absolute"),this.markerView.$el.css("top",i.y+"px"),this.markerView.$el.css("left",i.x+"px"),this.markerView.$el.show(),!this.markerView.rfMap&&this.markerView.$el.parent().size()&&this.markerView.model.get("type")==this.markerView.model.typeMap.ap&&(this.markerView.rfMap=new e({markerView:this.markerView})),this.markerView.rfMap&&this.markerView.rfMap.setPosition(i.x,i.y)},this.Overlay.prototype.hide=function(){this.container.hide()},this.Overlay.prototype.show=function(){this.draw(),this.container.show()},this.Overlay.prototype.toggle=function(){this.container.toggle()}}}}),define("async",[],function(){function e(e){var t,i;t=document.createElement("script"),t.type="text/javascript",t.async=!0,t.src=e,i=document.getElementsByTagName("script")[0],i.parentNode.insertBefore(t,i)}function t(e,t){var i=/!(.+)/,n=e.replace(i,""),o=i.test(e)?e.replace(/.+!/,""):a;return n+=n.indexOf("?")<0?"?":"&",n+o+"="+t}function i(){return n+=1,"__async_req_"+n+"__"}var a="callback",n=0;return{load:function(a,n,o,r){if(r.isBuild)o(null);else{var s=i();window[s]=o,e(t(a,s))}}}}),define("gmaps",["jquery"],function(e){"use strict";if(window.google&&window.google.maps)return window.google;var t=e.Deferred();return require(["async!//maps.google.com/maps/api/js?libraries=geometry!callback"],function(){t.resolve(window.google)},function(e){window.googleMapsNotLoaded(),t.reject()}),t.promise()}),define("ubnt/view/map/GoogleMapView",["underscore","ubnt/view/map/MapBase","ubnt/view/map/GoogleMapOverlayWrapperView","ubnt/view/map/GoogleMapMarkerWrapperView","ubnt/Timer","ubnt/TimerEvent","jquery","msg/Msg","gmaps"],function(e,t,i,a,n,o,r,s,c){"use strict";return t.extend({_fullyQualifiedName:"UBNT.views.map.GoogleMap",initialize:function(i){e.bindAll(this),this.app=i.app,this.loaded=!1,c.maps?r("body").hasClass("googlemaps-notLoaded")||(this.loaded=!0):c.done(r.proxy(function(e){c=e,this.onLoad()},this)).fail(function(){r("body").addClass("googlemaps-notLoaded")}),this.mapBaseType="google",t.prototype.initialize.apply(this,[i]),this.markerViewOverlays={},this.layerItemOverlays={},this.layerQueue=[]},onLoad:function(){this.loaded=!0,a.initialize(),i.initialize(),this.trigger("googlemaps-loaded")},setMap:function(e){this.model&&(this.model.off("change:zoom",this.mapZoomHandler),this.model.off("change:lat",this.mapOffsetHandler),this.model.off("change:lng",this.mapOffsetHandler),this.model.off("change:mapTypeId",this.mapTypeHandler)),this.model=e,this.model.on("change:zoom",this.mapZoomHandler),this.model.on("change:lat",this.mapOffsetHandler),this.model.on("change:lng",this.mapOffsetHandler),this.model.on("change:mapTypeId",this.mapTypeHandler),this.zoomLevel=this.model.get("zoom"),r("body").hasClass("googlemaps-notLoaded")?window.googleMapsNotLoaded():this.renderMap()},mapChangeHandler:function(){this.renderMap()},getMap:function(){return this.model},render:function(){return this.model&&this.setOffset(this.model.get("lat")||0,this.model.get("lng")||0,!0),this.$el},renderMap:function(){if(!this.loaded)return this.renderOnLoad=!0;this.calculateScale();var t=this,i={zoom:this.model?this.model.get("zoom"):1,center:new c.maps.LatLng(this.model.get("lat"),this.model.get("lng")),mapTypeId:c.maps.MapTypeId[this.model.get("mapTypeId").toUpperCase()],tilt:0,tiltControl:!1,rotateControl:!1,zoomControl:!1,scaleControl:!0,mapTypeControl:!0,mapTypeControlOptions:{style:c.maps.MapTypeControlStyle.HORIZONTAL_BAR,position:c.maps.ControlPosition.TOP_RIGHT},disableDoubleClickZoom:!0,streetViewControl:!1,panControl:!1};this.googleMap?this.googleMap.setOptions(i):(this.googleMap=new c.maps.Map(this.$el.get(0),i),c.maps.event.addListener(this.googleMap,"zoom_changed",function(){var e=t.googleMap.getZoom();e>20&&(e=20),1>e&&(e=1),t.setZoom(e)}),c.maps.event.addListener(this.googleMap,"center_changed",function(){t.setOffset(t.googleMap.center.lat(),t.googleMap.center.lng())}),c.maps.event.addListener(this.googleMap,"maptypeid_changed",function(){t.setMapType(t.googleMap.getMapTypeId())}),this.googleMapOverlay=new c.maps.OverlayView,this.googleMapOverlay.onAdd=function(){},this.googleMapOverlay.draw=function(){},this.googleMapOverlay.onRemove=function(){},this.googleMapOverlay.setMap(this.googleMap),e.each(this.layerQueue,function(e){this.layers[e.cid]=e,e.bindHandlers()},this),this.layerQueue=[],this.loaded=!0),this.previousMapZoom=i.zoom,this.googleMapOverlay&&this.resetMarkers()},addLayer:function(t,i){var a=e.extend(i,{mapBase:this}),n=new t(a);null===this.googleMap||void 0===this.googleMap?this.layerQueue.push(n):this.layers[n.cid]=t},addLayerItem:function(e){if(this.googleMap){var t=new i.Overlay(e,this.googleMap);t.setMap(this.googleMap),this.layerItems[e.cid]=e,this.layerItemOverlays[e.cid]=t,e.$el.css("zIndex",this.layerZ),this.layerZ++,e.trigger("layeritemadded")}},removeLayerItem:function(e){var t=this.layerItemOverlays[e.cid];t&&t.setMap(null)},positionMarker:function(e){this.googleMap&&this.markerViewOverlays[e.model.id]&&(e.model.attributes.map_id==this.model.id?this.markerViewOverlays[e.model.id].setMap(this.googleMap):this.markerViewOverlays[e.model.id].setMap(null))},updateMarkerPositions:function(){e.each(this.markerViews,this.positionMarker)},addMarker:function(e){t.prototype.addMarker.apply(this,[e,this.model]);var i=this.markerViews[e.id];if(i){(null===this.markerViewOverlays[e.id]||void 0===this.markerViewOverlays[e.id])&&(this.markerViewOverlays[e.id]=new a.Overlay(i,this.googleMap));var n=this.markerViewOverlays[e.id];this.model&&this.model.id==e.attributes.map_id&&n.setMap(this.googleMap),i.unbind("dragstart",this.markerDragStartHandler).bind("dragstart",this.markerDragStartHandler),i.unbind("dragstop",this.markerDragStopHandler).bind("dragstop",this.markerDragStopHandler)}},updateMarker:function(e){void 0!==e.get("map_id")&&(this.model&&e.get("map_id")==this.model.id?this.addMarker(e):this.removeMarker(e))},removeMarker:function(e){this.markerViewOverlays[e.id];this.markerViewOverlays[e.id]&&(this.markerViewOverlays[e.id].setMap(null),delete this.markerViewOverlays[e.id]),t.prototype.removeMarker.apply(this,[e])},resize:function(){this.loaded&&this.googleMap&&c.maps.event.trigger(this.googleMap,"resize")},markerDragStartHandler:function(){this.isMarkerDragging=!0,this.disableMapDrag()},markerDragStopHandler:function(e,t){if(this.isMarkerDragging=!1,this.enableMapDrag(),t&&t.position){var i=this.googleMapOverlay.getProjection().fromDivPixelToLatLng(new c.maps.Point(t.position.left,t.position.top)),a=t.helper.data("view"),n=a.model;this.app.isReadOnly?n.set({x:Number(i.lat().toFixed(5)),y:Number(i.lng().toFixed(5))}):n.save({x:Number(i.lat().toFixed(5)),y:Number(i.lng().toFixed(5))})}},dropHandler:function(e,t){var i=this.googleMapOverlay.getProjection().fromContainerPixelToLatLng(new c.maps.Point(t.position.left,t.position.top-42)),a=t.helper.data("view"),n=a.model;this.app.isReadOnly?n.set({x:Number(i.lat().toFixed(5)),y:Number(i.lng().toFixed(5)),map_id:this.model.id}):n.save({x:Number(i.lat().toFixed(5)),y:Number(i.lng().toFixed(5)),map_id:this.model.id})},enableMapDrag:function(){this.googleMap&&this.googleMap.setOptions({draggable:!0})},disableMapDrag:function(){this.googleMap&&this.googleMap.setOptions({draggable:!1})},calculateScale:function(){this.scale=1/Math.pow(2,20-this.zoomLevel)/5},mapTypeHandler:function(e){this.setMapType(e.get("mapTypeId"),!0)},setMapType:function(e,t){this.model.set({mapTypeId:e}),t||this.app.isReadOnly||this.saveMapType(e)},saveMapType:e.debounce(function(e){this.model.unset("mapTypeId",{silent:!0}),this.model.save({mapTypeId:e},{silent:!0})},250),mapOffsetHandler:function(e){this.setOffset(e.get("lat")||0,e.get("lng")||0,!0)},setOffset:function(e,t,i){this.model.set({lat:e,lng:t}),i||this.app.isReadOnly||this.saveOffset(e,t)},saveOffset:e.debounce(function(e,t){this.model.unset("lat",{silent:!0}),this.model.unset("lng",{silent:!0}),this.model.save({lat:e,lng:t},{silent:!0})},250),mapZoomHandler:function(e){this.setZoom(e.get("zoom")||this.zoomLevel,!0),this.renderMap(),this.updateMarkerPositions()},setZoom:function(e,t){this.zoomLevel!=e&&(this.zoomLevel=e,this.model.set({zoom:e}),t||this.app.isReadOnly||this.saveZoom(e))},saveZoom:e.debounce(function(e){this.model.unset("zoom",{silent:!0}),this.model.save({zoom:e},{silent:!0})},250),computeDistanceBetween:function(e,t,i,a){var n=this.googleMapOverlay.getProjection().fromDivPixelToLatLng(new c.maps.Point(e,t)),o=this.googleMapOverlay.getProjection().fromDivPixelToLatLng(new c.maps.Point(i,a));return c.maps.geometry.spherical.computeDistanceBetween(n,o)},computeOffset:function(e,t,i,a){var n=this.googleMapOverlay.getProjection().fromDivPixelToLatLng(new c.maps.Point(e,t)),o=c.maps.geometry.spherical.computeOffset(n,i,(a+Math.PI)*(180/Math.PI)),r=this.googleMapOverlay.getProjection().fromLatLngToDivPixel(o);return{x:Math.round(r.x),y:Math.round(r.y)}},translateToPixelCoordinates:function(e,t){var i=this.googleMapOverlay.getProjection().fromLatLngToDivPixel(new c.maps.LatLng(e,t));return i},translateToMapCoordinates:function(e,t){var i=this.googleMapOverlay.getProjection().fromDivPixelToLatLng(new c.maps.Point(e,t));return{x:i.lat(),y:i.lng()}},remove:function(){this.model.off("change",this.mapChangeHandler),e.each(this.markerViews,function(e){e.unbind("dragstart",this.markerDragStartHandler),e.unbind("dragstop",this.markerDragStopHandler)},this),this.googleMap&&(c.maps.event.removeListener(this.googleMap,"zoom_changed"),c.maps.event.removeListener(this.googleMap,"center_changed"),c.maps.event.removeListener(this.googleMap,"bounds_changed"),c.maps.event.removeListener(this.googleMap,"maptypeid_changed")),this.model&&(this.model.off("change:zoom",this.mapZoomHandler),this.model.off("change:lat",this.mapOffsetHandler),this.model.off("change:lng",this.mapOffsetHandler),this.model.off("change:mapTypeId",this.mapTypeHandler)),t.prototype.remove.apply(this,arguments)}})}),function(e){"function"==typeof define&&define.amd?define("libs/jquery.mousewheel",["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var o=t||window.event,r=s.call(arguments,1),c=0,l=0,d=0,m=0;return t=e.event.fix(o),t.type="mousewheel","detail"in o&&(d=-1*o.detail),"wheelDelta"in o&&(d=o.wheelDelta),"wheelDeltaY"in o&&(d=o.wheelDeltaY),"wheelDeltaX"in o&&(l=-1*o.wheelDeltaX),"axis"in o&&o.axis===o.HORIZONTAL_AXIS&&(l=-1*d,d=0),c=0===d?l:d,"deltaY"in o&&(d=-1*o.deltaY,c=d),"deltaX"in o&&(l=o.deltaX,0===d&&(c=-1*l)),0!==d||0!==l?(m=Math.max(Math.abs(d),Math.abs(l)),(!n||n>m)&&(n=m),c=Math[c>=1?"floor":"ceil"](c/n),l=Math[l>=1?"floor":"ceil"](l/n),d=Math[d>=1?"floor":"ceil"](d/n),t.deltaX=l,t.deltaY=d,t.deltaFactor=n,r.unshift(t,c,l,d),a&&clearTimeout(a),a=setTimeout(i,200),(e.event.dispatch||e.event.handle).apply(this,r)):void 0}function i(){n=null}var a,n,o=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],s=Array.prototype.slice;if(e.event.fixHooks)for(var c=o.length;c;)e.event.fixHooks[o[--c]]=e.event.mouseHooks;e.event.special.mousewheel={version:"3.1.6",setup:function(){if(this.addEventListener)for(var e=r.length;e;)this.addEventListener(r[--e],t,!1);else this.onmousewheel=t},teardown:function(){if(this.removeEventListener)for(var e=r.length;e;)this.removeEventListener(r[--e],t,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),define("ubnt/view/map/ImageMapView",["ubnt/view/map/MapBase","underscore","jquery","unifi/webrtc/WebRtcHelpers","config/ManageConfig","unifi/view/map/MarkerRfMapView","libs/jquery.mousewheel"],function(e,t,i,a,n,o){"use strict";return e.extend({_fullyQualifiedName:"UBNT.views.map.ImageMap",initialize:function(i){t.bindAll(this),this.mapBaseType="image",this.app=i.app,e.prototype.initialize.apply(this,[i]),this.zoom=1,this.scale=1,this.$dragLayer=this.$(".image-drag-layer"),this.$subMarkerLayer=this.$(".sub-marker-layer"),this.$markerLayer=this.$(".marker-layer"),this.mapImages=[],this.initHandlers()},initHandlers:function(){this.$el.bind("mousedown",this.mouseDownHandler),this.$el.bind("mousewheel",this.mouseWheelHandler)},setMap:function(e){if(this.model&&(this.model.off("change:zoom",this.mapZoomHandler),this.model.off("change:offset_left",this.mapOffsetHandler),this.model.off("change:offset_right",this.mapOffsetHandler),this.model.off("change:url",this.loadMap)),this.model=e,this.$img=this.mapImages[this.model.id],this.$(".image-map-layer").empty(),void 0===this.$img)this.loadMap();else{var t=this.$el.width(),i=this.$el.height();this.imgWidth=this.$img[0].width,this.imgHeight=this.$img[0].height,this.scale=1,this.imgWidth/this.imgHeight>t/i?(this.$img.height(t/this.imgWidth*this.imgHeight),this.$img.width(t)):(this.$img.width(i/this.imgHeight*this.imgWidth),this.$img.height(i)),this.$dragLayer.css("top",(i-this.imgHeight)/2+"px"),this.$dragLayer.css("left",(t-this.imgWidth)/2+"px"),this.$(".image-map-layer").append(this.$img),this.resetMarkers(),this.model.on("change:zoom",this.mapZoomHandler),this.model.on("change:offset_left",this.mapOffsetHandler),this.model.on("change:offset_right",this.mapOffsetHandler),this.model.on("change:url",this.loadMap),this.mapZoomHandler(this.model),this.mapOffsetHandler(this.model)}},mapZoomHandler:function(e){this.setZoom(e.get("zoom"),!0)},mapOffsetHandler:function(e){this.setOffset(e.get("offset_top")||0,e.get("offset_left")||0,!0)},loadMap:function(e,t,o){var r=this;this.$img=i(new Image),this.$img.load(function(){r.mapImages=[],r.mapImages[r.model.id]=i(this),r.$img.unbind("load"),r.setMap(r.model)}),n.USE_WEBRTC?i.ajax({type:"GET",dataType:"arraybuffer",processData:!1,xhrFields:{withCredentials:!0},url:r.model.get("url"),success:function(e){r.$img.attr("src","data:image;base64,"+btoa(a.Uint8ArrayToBinaryString(e)))},error:function(){console.log("error!")}}):this.$img.attr("src",this.model.get("url"))},render:function(){return this.updateMarkerPositions(),this.model&&this.setOffset(this.model.get("offset_top")||0,this.model.get("offset_left")||0,!0),this.$el},preventEventPropagationFunc:function(e){e.stopPropagation()},addMarker:function(t){e.prototype.addMarker.apply(this,[t,this.model]);var i=this.markerViews[t.id];i&&(i.$el.unbind("mousedown",this.preventEventPropagationFunc).bind("mousedown",this.preventEventPropagationFunc),i.unbind("dragstart",this.markerDragStartHandler).bind("dragstart",this.markerDragStartHandler),i.unbind("dragstop",this.markerDragStopHandler).bind("dragstop",this.markerDragStopHandler),this.positionMarker(i),this.$markerLayer.append(i.$el))},updateMarker:function(e){void 0!==e.get("map_id")&&(this.model&&e.get("map_id")==this.model.id?this.addMarker(e):this.removeMarker(e))},positionMarker:function(e){if(this.model&&e.model.attributes.map_id==this.model.id){var t=e.model.get("x")*this.zoom,i=e.model.get("y")*this.zoom;e.setPosition(t,i),e.show(),!e.rfMap&&e.$el.parent().size()&&e.model.get("type")==e.model.typeMap.ap&&(e.rfMap=new o({markerView:e})),e.rfMap&&e.rfMap.setPosition(t,i)}else e.hide()},updateMarkerPositions:function(){t.each(this.markerViews,this.positionMarker)},addLayer:function(e,i){var a=t.extend(i,{mapBase:this}),n=new e(a);this.layers[n.cid]=n},addLayerItem:function(e){this.$subMarkerLayer.append(e.$el),e.trigger("layeritemadded")},removeLayerItem:function(e){e.$el.remove()},markerDragStartHandler:function(e){this.isMarkerDragging=!0},markerDragStopHandler:function(e,t){if(this.isMarkerDragging=!1,t&&t.helper){var i=t.helper.data("view"),a=i.model;this.app.isReadOnly?a.set({x:t.position.left/this.zoom,y:t.position.top/this.zoom}):a.save({x:t.position.left/this.zoom,y:t.position.top/this.zoom})}},mouseDownHandler:function(e){return 2==e.button?(e.preventDefault(),e.stopPropagation(),!1):(this.startPageX=e.pageX,this.startPageY=e.pageY,i("body").bind("mouseup",this.mouseUpHandler),this.$el.bind("mousemove",this.mouseMoveHandler),!1)},mouseWheelHandler:function(e,t,i,a){},mouseUpHandler:function(){i("body").unbind("mouseup",this.mouseUpHandler),this.$el.unbind("mousemove",this.mouseMoveHandler)},mouseMoveHandler:function(e){if(!this.isMarkerDragging){this.deltaX=e.pageX-this.startPageX,this.deltaY=e.pageY-this.startPageY,this.startPageX=e.pageX,this.startPageY=e.pageY;var t=this.$dragLayer.offset(),i=t.top+this.deltaY,a=t.left+this.deltaX;this.setOffset(i,a)}},clickHandler:function(e){var t=i(e.target);t.hasClass("phone-icon")&&(t.parent().css("z-index",this.currentZIndex),this.currentZIndex++)},dropHandler:function(e,t){var i=t.helper.data("view"),a=i.model,n=this.$dragLayer.position(),o=(t.position.left-n.left)/this.zoom,r=(t.position.top-n.top-42)/this.zoom;this.app.isReadOnly?a.set({x:o,y:r,map_id:this.model.id}):a.save({x:o,y:r,map_id:this.model.id})},setOffset:function(e,t,i){this.$dragLayer.offset({top:e,left:t}),this.model.set({offset_top:e,offset_left:t}),i||this.app.isReadOnly||this.saveOffset(e,t)},saveOffset:t.debounce(function(e,t){this.model.unset("offset_top",{silent:!0}),this.model.unset("offset_left",{silent:!0}),this.model.save({offset_top:e,offset_left:t},{silent:!0})},250),setZoom:function(e){this.$dragLayer.position(),this.$el.width(),this.$el.height();this.zoom=e/10,this.$img.width(this.scale*this.imgWidth*this.zoom),this.$img.height(this.scale*this.imgHeight*this.zoom),this.updateMarkerPositions()},setFocus:function(e,t,i){var a=this.translateToPixelCoordinates(e,t),n=this.$el.width(),o=this.$el.height(),r=n/2-a.x,s=o/2-a.y;i||(this.$dragLayer.css("top",s+"px"),this.$dragLayer.css("left",r+"px"))},enableMapDrag:function(){this.$el.on("mousedown",this.mouseDownHandler)},disableMapDrag:function(){this.$el.off("mousedown",this.mouseDownHandler)},translateToPixelCoordinates:function(e,t){return{x:e*this.scale*this.zoom,y:t*this.scale*this.zoom}},translateToMapCoordinates:function(e,t){return{x:e/this.scale/this.zoom,y:t/this.scale/this.zoom}},computeOffset:function(e,t,i,a){return{x:e+Math.sin(a)*(i*this.scale*this.zoom),y:t-Math.cos(a)*(i*this.scale*this.zoom)}},computeDistanceBetween:function(e,t,i,a){var n=this.translateToMapCoordinates(e,t),o=this.translateToMapCoordinates(i,a);return Math.sqrt((o.x-n.x)*(o.x-n.x)+(o.y-n.y)*(o.y-n.y))},remove:function(){this.$el.unbind("mousedown",this.mouseDownHandler),this.$el.unbind("mousewheel",this.mouseWheelHandler),t.each(this.markerViews,function(e){e.$el.unbind("mousedown"),e.unbind("dragstart",this.markerDragStartHandler),e.unbind("dragstop",this.markerDragStopHandler)},this),i("body").unbind("mouseup",this.mouseUpHandler),this.$el.unbind("mousemove",this.mouseMoveHandler),this.$el.off("mousedown",this.mouseDownHandler),this.model&&(this.model.off("change:zoom",this.mapZoomHandler),this.model.off("change:offset_left",this.mapOffsetHandler),this.model.off("change:offset_right",this.mapOffsetHandler),this.model.off("change:url",this.loadMap)),e.prototype.remove.apply(this,arguments)}})}),define("ubnt/view/uicomponents/DroppableItemView",["backbone","jquery"],function(e,t){"use strict";return e.View.extend({_fullyQualifiedName:"UBNT.views.uicomponents.DroppableItem",initialize:function(){this.scope=this.options.scope||"global",this.accept=this.options.accept,this.drop=this.options.drop,this._greedy=this.options.greedy||!0;var e=this;this.$el.droppable({tolerance:"pointer",accept:this.accept,greedy:this._greedy,activeClass:"droppable",drop:function(i,a){t(this).removeClass("ui-state-highlight"),e.trigger("drop",i,a)},over:function(i,a){t(this).addClass("ui-state-highlight"),e.trigger("over",i,a)},out:function(i,a){t(this).removeClass("ui-state-highlight"),e.trigger("out",i,a)}})},destroy:function(){this.$el.droppable("destroy")},setScope:function(e){this.$el.droppable("option","scope",e)},setAccept:function(e){this.$el.droppable("option","accept",e)}})}),define("ubnt/view/map/MapWidgetView",["backbone","jquery","underscore","ubnt/view/map/MarkerView","ubnt/view/map/GoogleMapView","ubnt/view/map/ImageMapView","ubnt/view/uicomponents/DroppableItemView","libs/jquery.mousewheel"],function(e,t,i,a,n,o,r){"use strict";return e.View.extend({_fullyQualifiedName:"UBNT.views.map.MapWidget",initialize:function(){i.bindAll(this),this.markerView=this.options.markerView||a,this.markerTemplate=this.options.markerTemplate,this.layers={},this.maps=this.options.maps,this.markers=this.options.markers,this.app=this.options.app,this.zoomLevel=1,this.$googleMapContainer=this.$(".google-map-container"),this.googleMap=new n({app:this.app,el:this.$googleMapContainer,collection:this.maps,markers:this.markers,markerView:this.markerView,markerTemplate:this.markerTemplate}),this.$imageMapContainer=this.$(".image-map-container"),this.imageMap=new o({app:this.app,el:this.$imageMapContainer,collection:this.maps,markers:this.markers,markerView:this.markerView,markerTemplate:this.markerTemplate}),this.initHandlers(),this.initDroppable()},initHandlers:function(){this.$el.bind("mousewheel",this.mouseWheelHandler)},bindHandlers:function(){this.googleMap.bindHandlers(),this.imageMap.bindHandlers()},unbindHandlers:function(){this.googleMap.unbindHandlers(),this.imageMap.unbindHandlers()},render:function(){this.$googleMap=this.googleMap.render(),this.$imageMap=this.imageMap.render(),this.isRendered||(this.isRendered=!0)},locateDevice:function(e){if(this.isRendered){if(this.markers.get(e)&&this.model.id==e.get("map_id")){var t;if(t="googleMap"===this.model.get("type")?this.googleMap.markerViews[e.id]:this.imageMap.markerViews[e.id]){if("imageMap"===this.model.get("type")){var a=t.$el.position(),n=this.imageMap.translateToMapCoordinates(a.left,a.top);this.imageMap.setFocus(n.x,n.y)}t.pulse()}else i.delay(this.locateDevice,50,e)}}else i.delay(this.locateDevice,50,e)},addLayer:function(e,t){this.googleMap.addLayer(e,t),this.imageMap.addLayer(e,t)},setMap:function(e){e&&(this.model&&this.model.off("change:type",this.setMap),this.model=e,this.model.on("change:type",this.setMap),"googleMap"===e.get("type")?(this.googleMap.show(),this.googleMap.setMap(e),this.imageMap.hide(),t("#Map").addClass("isGoogleMap")):(this.imageMap.show(),this.imageMap.setMap(e),this.googleMap.hide(),t("#Map").removeClass("isGoogleMap")),this.zoomLevel=e.get("zoom"))},initDroppable:function(){this.droppable=new r({el:this.el,accept:".unplaced-marker"}),this.droppable.bind("drop",this.dropHandler)},dropHandler:function(e,t){"googleMap"==this.model.attributes.type?this.googleMap.dropHandler(e,t):this.imageMap.dropHandler(e,t)},mouseWheelHandler:function(e,t,i,a){a=a||e.originalEvent.wheelDeltaY;var n=this.zoomLevel;if(a>0){if(!(this.zoomLevel<20))return;n+=1}else{if(!(this.zoomLevel>1))return;n-=1}this.setZoom(n)},setZoom:function(e,t){this.zoomLevel!=e&&(this.zoomLevel=e,this.model.set({zoom:e}),t||this.app.isReadOnly||this.saveZoom(e))},saveZoom:i.debounce(function(e){this.model.unset("zoom",{silent:!0}),this.model.save({zoom:e},{silent:!0})},250),resize:function(){this.imageMap&&this.imageMap.resize(),this.googleMap&&this.googleMap.resize()},remove:function(){this.unbindHandlers(),this.model.off("change:type",this.setMap),this.$el.unbind("mousewheel",this.mouseWheelHandler),this.droppable.unbind("drop",this.dropHandler),this.model.off("change:type",this.setMap),this.isRendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("ubnt/view/map/MapView",["backbone","underscore","jquery","ubnt/view/map/MapWidgetView","msg/Msg","libs/jquery.cookie"],function(e,t,i,a,n){"use strict";return e.View.extend({_fullyQualifiedName:"UBNT.views.map.Map",initialize:function(){this.markers=this.options.markers,this.maps=this.options.maps,this.markerView=this.options.markerView,this.markerTemplate=this.options.markerTemplate,this.app=this.options.app,this.mapWidget=new a({app:this.app,el:this.$(".ubnt-map-widget"),maps:this.maps,markers:this.markers,markerView:this.markerView,markerTemplate:this.markerTemplate})},setMap:function(e){this.model=e,this.mapWidget.setMap(e)},tabShowHandler:function(e,t){i("#Map:visible").length?(this.visible=!0,this.mapWidget.resize()):this.visible===!0&&(this.visible=!1)},render:function(){!this.rendered&&(this.rendered=!0)&&this.mapWidget.bindHandlers(),this.mapWidget.render(),this.tabShowHandler()},locateDevice:function(e){this.rendered?this.markers.get(e)&&this.mapWidget.locateDevice(e):t.delay(this.locateDevice,50,e)},remove:function(){this.rendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("unifi/view/map/TopologyView",["backbone","underscore","jquery","libs/kinetic"],function(e,t,i,a){"use strict";return e.View.extend({LINK_COLOR:[{value:45,color:"#57c23e"},{value:30,color:"#f78100"},{value:20,color:"#ff0000"}],DISCONNECTED_COLOR:"#CCCCCC",initialize:function(e){t.bindAll(this),this.indexView=e.indexView,this.markers=this.indexView.app.collection("Devices"),this.linkLines=[],this.isMoving=!1,this.isVisible=!1},setMap:function(e){this.model&&(this.model.off("change:zoom",this.mapChangeHandler),this.model.off("change:offset_left",this.mapChangeHandler),this.model.off("change:offset_top",this.mapChangeHandler),this.model.off("change:lng",this.mapChangeHandler),this.model.off("change:lat",this.mapChangeHandler),this.model.off("change:upp",this.mapChangeHandler),this.model.off("change:unit",this.mapChangeHandler)),this.model=e,this.isVisible&&this.rebuildUplinks(),this.model.on("change:zoom",this.mapChangeHandler),this.model.on("change:offset_left",this.mapChangeHandler),this.model.on("change:offset_top",this.mapChangeHandler),this.model.on("change:lng",this.mapChangeHandler),this.model.on("change:lat",this.mapChangeHandler),this.model.on("change:upp",this.mapChangeHandler),this.model.on("change:unit",this.mapChangeHandler),this.mapChangeHandler()},bindListeners:function(){this.markers.on("add",this.mapChangeHandler),this.markers.on("remove",this.mapChangeHandler),this.markers.on("change:map_id",this.mapChangeHandler),this.markers.on("change:x",this.mapChangeHandler),this.markers.on("change:y",this.mapChangeHandler)},unbindListeners:function(){this.markers.off("add",this.mapChangeHandler),this.markers.off("remove",this.mapChangeHandler),this.markers.off("change:map_id",this.mapChangeHandler),this.markers.off("change:x",this.mapChangeHandler),this.markers.off("change:y",this.mapChangeHandler)},mapChangeHandler:function(){this.isVisible&&this.rebuildUplinks()},show:function(){this.isVisible||(this.isVisible=!0,this.bindListeners(),this.setupStage(),this.rebuildUplinks(),this.markers.on("change",this.rebuildUplinks))},hide:function(){this.isVisible&&(this.isVisible=!1,this.unbindListeners(),this.markers.off("change",this.rebuildUplinks),this.destroyStage())},setupStage:function(){var e=i(".marker-layer");this.layer=new a.Layer,this.stage=new a.Stage({container:e[0],width:e.width(),height:e.parent().height()}),this.stage.add(this.layer)},destroyStage:function(){this.layer&&(this.layer.destroy(),this.stage.destroy())},getMarkerPosition:function(e){var t=this.markers.get(e),i=this.model.get("zoom");if("googleMap"===this.model.get("type")){var a=this.indexView.getActiveMap().googleMapOverlay.getProjection(),n=a.fromLatLngToDivPixel(new google.maps.LatLng(t.get("x"),t.get("y")));return{left:n.x,top:n.y}}return{left:t.get("x")*i/10,top:t.get("y")*i/10}},rebuildUplinks:function(){if("googleMap"!==this.model.get("type")){var e,i,a;this.model&&(e=this.markers.filter(function(e){return e.get("map_id")===this.model.get("_id")},this),t.each(this.linkLines,function(e){e.line.destroy()}),this.linkLines=[],this.layer.removeChildren(),t.each(e,function(e){i=e.uplinks(),t.each(i,function(t){t.configured&&(a=this.markers.findWhere({mac:t.mac}),a&&a.get("map_id")===this.model.get("_id")&&this.setTopologyLink(e,a,t))},this)},this))}},setTopologyLink:function(e,i,a){var n,o,r,s=.8,c=this.getMarkerPosition(e.id),l=this.getMarkerPosition(i.id);a.configured?(a.up?(n=!0,o=this.LINK_COLOR[0].color,t.each(this.LINK_COLOR,function(e){a.rssi<e.value&&(o=e.color)},this)):(n=!0,o=this.DISCONNECTED_COLOR),s=1):s=.25,r=this._createLine(c.left,c.top,l.left,l.top,o,s),this.linkLines.push({line:r,islandDevice:e,uplinkDevice:i}),this.layer.add(r),this.layer.drawScene();
},_createLine:function(e,t,i,n,o,r){var s=new a.Line({points:this._getArrowPoints(e,t,i,n),stroke:o,opacity:r,dashArray:[10,10]});return s},_getArrowPoints:function(e,t,i,a){return[e,t,i,a]},remove:function(){this.unbindListeners(),this.model.off("change:zoom",this.mapChangeHandler),this.model.off("change:offset_left",this.mapChangeHandler),this.model.off("change:offset_top",this.mapChangeHandler),this.model.off("change:lng",this.mapChangeHandler),this.model.off("change:lat",this.mapChangeHandler),this.model.off("change:upp",this.mapChangeHandler),this.model.off("change:unit",this.mapChangeHandler),this.markers.off("change",this.rebuildUplinks),e.View.prototype.remove.apply(this,arguments)}})}),function(e,t,i){"undefined"!=typeof module&&module.exports?module.exports=i():"function"==typeof define&&define.amd?define("heatmap",i):t[e]=i()}("h337",this,function(){var e={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},t=function(){var t=function(e){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=e.xField||e.defaultXField,this._yField=e.yField||e.defaultYField,this._valueField=e.valueField||e.defaultValueField,e.radius&&(this._cfgRadius=e.radius)},i=e.defaultRadius;return t.prototype={_organiseData:function(e,t){var a=e[this._xField],n=e[this._yField],o=this._radi,r=this._data,s=this._max,c=this._min,l=e[this._valueField]||1,d=e.radius||this._cfgRadius||i;return r[a]||(r[a]=[],o[a]=[]),r[a][n]?r[a][n]+=l:(r[a][n]=l,o[a][n]=d),r[a][n]>s?(t?this.setDataMax(r[a][n]):this._max=r[a][n],!1):{x:a,y:n,value:l,radius:d,min:c,max:s}},_unOrganizeData:function(){var e=[],t=this._data,i=this._radi;for(var a in t)for(var n in t[a])e.push({x:a,y:n,radius:i[a][n],value:t[a][n]});return{min:this._min,max:this._max,data:e}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var e=arguments[0],t=e.length;t--;)this.addData.call(this,e[t]);else{var i=this._organiseData(arguments[0],!0);i&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[i]})}return this},setData:function(e){var t=e.data,i=t.length;this._data=[],this._radi=[];for(var a=0;i>a;a++)this._organiseData(t[a],!1);return this._max=e.max,this._min=e.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(e){return this._max=e,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(e){return this._min=e,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(e){this._coordinator=e},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},t}(),i=function(){function e(e){var i=e.container,a=this.shadowCanvas=document.createElement("canvas"),n=this.canvas=e.canvas||document.createElement("canvas"),o=(this._renderBoundaries=[1e4,1e4,0,0],getComputedStyle(e.container)||{});n.className="heatmap-canvas",this._width=n.width=a.width=+o.width.replace(/px/,""),this._height=n.height=a.height=+o.height.replace(/px/,""),this.shadowCtx=a.getContext("2d"),this.ctx=n.getContext("2d"),n.style.cssText=a.style.cssText="position:absolute;left:0;top:0;",i.style.position="relative",i.appendChild(n),this._palette=t(e),this._templates={},this._setStyles(e)}var t=function(e){var t=e.gradient||e.defaultGradient,i=document.createElement("canvas"),a=i.getContext("2d");i.width=256,i.height=1;var n=a.createLinearGradient(0,0,256,1);for(var o in t)n.addColorStop(o,t[o]);return a.fillStyle=n,a.fillRect(0,0,256,1),a.getImageData(0,0,256,1).data},i=function(e,t){var i=document.createElement("canvas"),a=i.getContext("2d"),n=e,o=e;if(i.width=i.height=2*e,1==t)a.beginPath(),a.arc(n,o,e,0,2*Math.PI,!1),a.fillStyle="rgba(0,0,0,1)",a.fill();else{var r=a.createRadialGradient(n,o,e*t,n,o,e);r.addColorStop(0,"rgba(0,0,0,1)"),r.addColorStop(1,"rgba(0,0,0,0)"),a.fillStyle=r,a.fillRect(0,0,2*e,2*e)}return i},a=function(e){for(var t=[],i=e.min,a=e.max,n=e.radi,e=e.data,o=Object.keys(e),r=o.length;r--;)for(var s=o[r],c=Object.keys(e[s]),l=c.length;l--;){var d=c[l],m=e[s][d],u=n[s][d];t.push({x:s,y:d,value:m,radius:u})}return{min:i,max:a,data:t}};return e.prototype={renderPartial:function(e){this._drawAlpha(e),this._colorize()},renderAll:function(e){this._clear(),this._drawAlpha(a(e)),this._colorize()},_updateGradient:function(e){this._palette=t(e)},updateConfig:function(e){e.gradient&&this._updateGradient(e),this._setStyles(e)},setDimensions:function(e,t){this._width=e,this._height=t,this.canvas.width=this.shadowCanvas.width=e,this.canvas.height=this.shadowCanvas.height=t},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(e){this._blur=0==e.blur?0:e.blur||e.defaultBlur,e.backgroundColor&&(this.canvas.style.backgroundColor=e.backgroundColor),this._opacity=255*(e.opacity||0),this._maxOpacity=255*(e.maxOpacity||e.defaultMaxOpacity),this._minOpacity=255*(e.minOpacity||e.defaultMinOpacity),this._useGradientOpacity=!!e.useGradientOpacity},_drawAlpha:function(e){for(var t=this._min=e.min,a=this._max=e.max,e=e.data||[],n=e.length,o=1-this._blur;n--;){var r,s=e[n],c=s.x,l=s.y,d=s.radius,m=Math.min(s.value,a),u=c-d,h=l-d,g=this.shadowCtx;this._templates[d]?r=this._templates[d]:this._templates[d]=r=i(d,o),g.globalAlpha=(m-t)/(a-t),g.drawImage(r,u,h),u<this._renderBoundaries[0]&&(this._renderBoundaries[0]=u),h<this._renderBoundaries[1]&&(this._renderBoundaries[1]=h),u+2*d>this._renderBoundaries[2]&&(this._renderBoundaries[2]=u+2*d),h+2*d>this._renderBoundaries[3]&&(this._renderBoundaries[3]=h+2*d)}},_colorize:function(){var e=this._renderBoundaries[0],t=this._renderBoundaries[1],i=this._renderBoundaries[2]-e,a=this._renderBoundaries[3]-t,n=this._width,o=this._height,r=this._opacity,s=this._maxOpacity,c=this._minOpacity,l=this._useGradientOpacity;0>e&&(e=0),0>t&&(t=0),e+i>n&&(i=n-e),t+a>o&&(a=o-t);for(var d=this.shadowCtx.getImageData(e,t,i,a),m=d.data,u=m.length,h=this._palette,g=3;u>g;g+=4){var p=m[g],y=4*p;if(y){var f;f=r>0?r:s>p?c>p?c:p:s,m[g-3]=h[y],m[g-2]=h[y+1],m[g-1]=h[y+2],m[g]=l?h[y+3]:f}}d.data=m,this.ctx.putImageData(d,e,t),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(e){var t,i=this.shadowCtx,a=i.getImageData(e.x,e.y,1,1),n=a.data[3],o=this._max,r=this._min;return t=Math.abs(o-r)*(n/255)>>0},getDataURL:function(){return this.canvas.toDataURL()}},e}(),a=function(){var t=!1;return"canvas2d"===e.defaultRenderer&&(t=i),t}(),n={merge:function(){for(var e={},t=arguments.length,i=0;t>i;i++){var a=arguments[i];for(var n in a)e[n]=a[n]}return e}},o=function(){function i(){var i=this._config=n.merge(e,arguments[0]||{});if(this._coordinator=new o,i.plugin){var s=i.plugin;if(!e.plugins[s])throw new Error("Plugin '"+s+"' not found. Maybe it was not registered.");var c=e.plugins[s];this._renderer=new c.renderer(i),this._store=new c.store(i)}else this._renderer=new a(i),this._store=new t(i);r(this)}var o=function(){function e(){this.cStore={}}return e.prototype={on:function(e,t,i){var a=this.cStore;a[e]||(a[e]=[]),a[e].push(function(e){return t.call(i,e)})},emit:function(e,t){var i=this.cStore;if(i[e])for(var a=i[e].length,n=0;a>n;n++){var o=i[e][n];o(t)}}},e}(),r=function(e){var t=e._renderer,i=e._coordinator,a=e._store;i.on("renderpartial",t.renderPartial,t),i.on("renderall",t.renderAll,t),i.on("extremachange",function(t){e._config.onExtremaChange&&e._config.onExtremaChange({min:t.min,max:t.max,gradient:e._config.gradient||e._config.defaultGradient})}),a.setCoordinator(i)};return i.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(e){return this._config=n.merge(this._config,e),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(e){return this._store.getValueAt?this._store.getValueAt(e):this._renderer.getValueAt?this._renderer.getValueAt(e):null}},i}(),r={create:function(e){return new o(e)},register:function(t,i){e.plugins[t]=i}};return r}),function(e,t,i){"undefined"!=typeof module&&module.exports?module.exports=i(require("jquery"),require("heatmap"),require("gmaps")):"function"==typeof define&&define.amd?define("heatmap-gmaps",["jquery","heatmap","gmaps"],i):t[e]=i($,h337,google)}("HeatmapOverlay",this,function(e,t,i){if(window.HeatmapOverlay)return window.HeatmapOverlay;var a=e.Deferred(),n=function(e){var i=function(e,t){this.setMap(e),this.initialize(t||{})};return i.prototype=new e.maps.OverlayView,i.CSS_TRANSFORM=function(){for(var e=document.createElement("div"),t=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],i=0;i<t.length;i++){var a=t[i];if(void 0!==e.style[a])return a}return t[0]}(),i.prototype.initialize=function(e){this.cfg=e;var t=this.map=this.getMap(),i=this.container=document.createElement("div"),a=t.getDiv(),n=this.width=a.clientWidth,o=this.height=a.clientHeight;i.style.cssText="width:"+n+"px;height:"+o+"px;",this.data=[],this.max=1,this.min=0,e.container=i},i.prototype.onAdd=function(){this.getPanes().overlayLayer.appendChild(this.container),this.changeHandler=e.maps.event.addListener(this.map,"bounds_changed",this.draw),this.heatmap||(this.heatmap=t.create(this.cfg)),this.draw()},i.prototype.onRemove=function(){this.map&&(this.map=null,this.container.parentElement.removeChild(this.container),this.container=null,this.changeHandler&&(e.maps.event.removeListener(this.changeHandler),this.changeHandler=null))},i.prototype.draw=function(){if(this.map){var t=this.map.getBounds(),a=new e.maps.LatLng(t.getNorthEast().lat(),t.getSouthWest().lng()),n=this.getProjection(),o=n.fromLatLngToDivPixel(a);this.container.style[i.CSS_TRANSFORM]="translate("+Math.round(o.x)+"px,"+Math.round(o.y)+"px)",this.update()}},i.prototype.resize=function(){if(this.map){var e=this.map.getDiv(),t=e.clientWidth,i=e.clientHeight;(t!=this.width||i!=this.height)&&(this.width=t,this.height=i,this.heatmap._renderer.setDimensions(t,i),this.update())}},i.prototype.update=function(){var t,i,a,n,o=this.map.getProjection();if(o&&(a=this.map.getBounds(),n=new e.maps.LatLng(a.getNorthEast().lat(),a.getSouthWest().lng()),t=this.map.getZoom(),i=Math.pow(2,t),this.resize(),0!=this.data.length)){for(var r={max:this.max,min:this.min},s=[],c=this.data.length,l=this.getProjection(),d=l.fromLatLngToDivPixel(n),m=this.cfg.scaleRadius?i:1,u=0,h=0,g=this.cfg.valueField||"value";c--;){var p=this.data[c],y=p[g],f=p.latlng;if(a.contains(f)){u=Math.max(y,u),h=Math.min(y,h);var _=l.fromLatLngToDivPixel(f),v={x:Math.round(_.x-d.x),y:Math.round(_.y-d.y)};v[g]=y;var b;b=p.radius?p.radius*m:(this.cfg.radius||2)*m,v.radius=b,s.push(v)}}this.cfg.useLocalExtrema&&(r.max=u,r.min=h),r.data=s,this.heatmap.setData(r)}},i.prototype.setData=function(t){this.max=t.max,this.min=t.min;for(var i=this.cfg.latField||"lat",a=this.cfg.lngField||"lng",n=this.cfg.valueField||"value",t=t.data,o=t.length,r=[];o--;){var s=t[o],c=new e.maps.LatLng(s[i],s[a]),l={latlng:c};l[n]=s[n],s.radius&&(l.radius=s.radius),r.push(l)}this.data=r,this.update()},i.prototype.addData=function(t){if(t.length>0)for(var i=t.length;i--;)this.addData(t[i]);else{var a=this.cfg.latField||"lat",n=this.cfg.lngField||"lng",o=this.cfg.valueField||"value",r=t,s=new e.maps.LatLng(r[a],r[n]),c={latlng:s};c[o]=r[o],r.radius&&(c.radius=r.radius),this.max=Math.max(this.max,c[o]),this.min=Math.min(this.min,c[o]),this.data.push(c),this.update()}},i};return i.maps?n(i):(i.done(e.proxy(function(e){i=e;var t=n(i);t.isResolved=!0,a.resolve(t)},this)).fail(function(){a.reject()}),a.promise())}),define("unifi/view/map/CoverageView",["backbone","underscore","jquery","heatmap","heatmap-gmaps"],function(e,t,i,a,n){"use strict";return e.View.extend({el:".image-map-coverage-layer",initialize:function(e){t.bindAll(this);this.indexView=e.indexView,this.markers=this.indexView.app.collection("Devices"),this.isVisible=!1,this.dataSetMax=10,this.dataSetMin=0,this.markerHeatmapCount=9,this.coverageFilter="2G",this.heatmapOptions={radius:200,maxOpacity:.7,useLocalExtrema:!0,latField:"lat",lngField:"lng",gradient:{0:"rgba(000,000,255,0)",.2:"rgba(000,000,255,1)",.4:"rgba(000,255,255,1)",.6:"rgba(000,255,000,1)",.8:"rgba(255,255,000,1)",1:"rgba(255,000,000,1)"}},this.$heatmapElt=this.$el,this.heatmapElt=this.$heatmapElt[0],i(window).on("resize",this.resize)},setCoverageFilter:function(e){this.coverageFilter=e,this.mapChangeHandler()},setMap:function(e){this.model&&(this.model.off("change:zoom",this.mapChangeHandler),this.model.off("change:offset_left",this.mapChangeHandler),this.model.off("change:offset_top",this.mapChangeHandler),this.model.off("change:lng",this.mapChangeHandler),this.model.off("change:lat",this.mapChangeHandler),this.model.off("change:upp",this.mapChangeHandler),this.model.off("change:unit",this.mapChangeHandler)),this.model=e,this.model.on("change:zoom",this.mapChangeHandler),this.model.on("change:offset_left",this.mapChangeHandler),this.model.on("change:offset_top",this.mapChangeHandler),this.model.on("change:lng",this.mapChangeHandler),this.model.on("change:lat",this.mapChangeHandler),this.model.on("change:upp",this.mapChangeHandler),this.model.on("change:unit",this.mapChangeHandler),this.mapChangeHandler()},mapChangeHandler:function(){this.isVisible&&this.updateCoverage()},show:function(){this.isVisible||(this.bindListeners(),this.isVisible=!0,this.updateCoverage())},hide:function(){this.isVisible&&(this.unbindListeners(),this.$el.empty(),this.isVisible=!1,this.googleHeatmap&&(this.googleHeatmap.onRemove(),this.googleHeatmap=null))},bindListeners:function(){this.markers.on("add",this.mapChangeHandler),this.markers.on("remove",this.mapChangeHandler),this.markers.on("change:map_id",this.mapChangeHandler),this.markers.on("change:x",this.mapChangeHandler),this.markers.on("change:y",this.mapChangeHandler),this.markers.on("change:ng-tx_power",this.mapChangeHandler),this.markers.on("change:ng-gain",this.mapChangeHandler),this.markers.on("change:ng-eirp",this.mapChangeHandler),this.markers.on("change:na-tx_power",this.mapChangeHandler),this.markers.on("change:na-gain",this.mapChangeHandler),this.markers.on("change:na-eirp",this.mapChangeHandler)},unbindListeners:function(){this.markers.off("add",this.mapChangeHandler),this.markers.off("remove",this.mapChangeHandler),this.markers.off("change:map_id",this.mapChangeHandler),this.markers.off("change:x",this.mapChangeHandler),this.markers.off("change:y",this.mapChangeHandler),this.markers.off("change:ng-tx_power",this.mapChangeHandler),this.markers.off("change:ng-gain",this.mapChangeHandler),this.markers.off("change:ng-eirp",this.mapChangeHandler),this.markers.off("change:na-tx_power",this.mapChangeHandler),this.markers.off("change:na-gain",this.mapChangeHandler),this.markers.off("change:na-eirp",this.mapChangeHandler)},resize:function(){var e=i(".image-map-container");if(e.length){var t=i(".ubnt-map-widget").outerWidth(),a=i(".ubnt-map-widget").outerHeight();this.$heatmapElt.css({width:t,height:a});var n=this.$heatmapElt.find("canvas");if(n.length){var o=n[0].getContext("2d");o.canvas.style.width=t+"px",o.canvas.style.height=a+"px",o.canvas.width=t,o.canvas.height=a}this.updateCoverage(!0)}},updateCoverage:t.debounce(function(t){if("map"===e.history.fragment.split("?")[0]&&this.model&&this.isVisible){if(!t)return void this.resize();"googleMap"===this.model.get("type")?this.updateGoogleMapCoverage():this.updateImageMapCoverage()}},100),updateGoogleMapCoverage:function(){var e=this;if(e.HeatmapOverlay)e._updateGoogleMapCoverage();else{if(e.HeatmapOverlayLoading)return;e.HeatmapOverlayLoading=!0,n.isResolved?(e.HeatmapOverlay=n,e._updateGoogleMapCoverage()):n.done(i.proxy(function(t){e.HeatmapOverlay=t,e._updateGoogleMapCoverage()},this))}},_updateGoogleMapCoverage:function(){var e=this.indexView.map.mapWidget.googleMap,i=e.googleMap;if(window.google.maps.hasOwnProperty("OverlayView")&&e.loaded&&google.maps){this.googleHeatmap&&(this.googleHeatmap.onRemove(),this.googleHeatmap=null),this.googleHeatmap=new this.HeatmapOverlay(i,this.heatmapOptions);var a=function(){return this.googleHeatmap.heatmap?(this.googleData=[],t.each(e.markerViews,function(e){var t=this.calculateCoverage(e.model);t>=0&&this.googleData.push({lat:e.model.get("x"),lng:e.model.get("y"),value:this.markerHeatmapCount,radius:t})},this),void(this.googleData.length?this.googleHeatmap.setData({max:this.dataSetMax,min:this.dataSetMin,data:this.googleData}):this.googleHeatmap.heatmap.setData({data:[]}))):void t.delay(t.bind(a,this),50)};t.delay(t.bind(a,this),50)}},updateImageMapCoverage:function(){var e,n,o,r=this,s=i(".image-map-container"),c=s.find(".marker"),l=i(".image-drag-layer").position(),d=[];this.$el.empty(),this.heatmap=a.create(t.extend(this.heatmapOptions,{container:this.heatmapElt})),window.heatmap=this.heatmap;var m=function(){c.each(function(t){e=i(this),n=e.position(),o=e.find(".mac").text();var a=r.calculateCoverage(r.markers.findWhere({mac:o}));a>=0&&d.push({x:n.left+l.left,y:n.top+l.top,value:r.markerHeatmapCount,radius:a})}),this.heatmap.setData({max:this.dataSetMax,min:this.dataSetMin,data:d})};t.delay(t.bind(m,this),50)},calculateCoverage:function(e){var t,i,a,n=100,o=1,r="2G"==this.coverageFilter?e.transmitPower("ng"):e.transmitPower("na"),s="2G"==this.coverageFilter?e.transmitFrequency("ng"):e.transmitFrequency("na"),c=this.model.get("unit")||"m",l=this.model.get("upp")||10,d=this.model.get("zoom")||1,m=this.indexView.getActiveMap().scale||1;return l>0?(o=1,l/="m"===c?1:3.2808399,o=10/l*d*m):o=15*d*m,1==e.get("state")&&r>=0?(t=o,i=r,a=Math.pow(10,i/20)/(s/3e5),t*=Math.sqrt(a/200),1>t&&(t=1),t=Math.floor(t),n=t):void 0},remove:function(){i(window).off("resize",this.resize),this.model&&(this.model.off("change:zoom",this.mapChangeHandler),this.model.off("change:offset_left",this.mapChangeHandler),this.model.off("change:offset_top",this.mapChangeHandler),this.model.off("change:lng",this.mapChangeHandler),this.model.off("change:lat",this.mapChangeHandler),this.model.off("change:upp",this.mapChangeHandler),this.model.off("change:unit",this.mapChangeHandler)),this.unbindListeners(),this.googleHeatmap&&(this.googleHeatmap.onRemove(),this.googleHeatmap=null),e.View.prototype.remove.apply(this,arguments)}})}),define("unifi/model/Map",["unifi/model/Model","backbone"],function(e,t){"use strict";return e.extend({defaults:{upp:.5,unit:"m",offset_top:130,offset_left:200,zoom:10},sync:function(e,i,a){switch(a=a||{},e){case"update":a.contentType="application/json; charset=utf-8","googleMap"===this.get("type")?(a.url="/api/s/"+SITE.name+"/rest/map/"+i.id,a.type="PUT",a.data=JSON.stringify(i.attributes)):(a.url="/api/s/"+SITE.name+"/rest/map/"+i.id,a.type="PUT",a.data=JSON.stringify(i.changed));break;case"delete":a.url="/api/s/"+SITE.name+"/rest/map/"+i.id}return t.sync.call(this,e,i,a)}})}),define("unifi/collection/Maps",["unifi/collection/Collection","unifi/model/Map","underscore"],function(e,t,i){"use strict";return e.extend({model:t,bySite:!0,url:function(e,t){return e?t?"/api/s/"+SITE.name+"/rest/map/":"/upload/map/s/"+SITE.name:"/api/s/"+SITE.name+"/list/map"},createGoogleMapModel:function(e,t){return t=t||{data:null},t.url=this.url(!0,!0),t.data=JSON.stringify(e),this.create(e,t)},comparator:function(e){return e.get("name")}})}),define("text!includes/map/addEditMapDialogTemplate.html",[],function(){return'<div class="dialog-content add-map-dialog-content">\n    <div class="content-area">\n        <form name="addEditMapForm" class="side-by-side ui-form clearfix">\n            <fieldset class="fieldset">\n                <div class="row">\n                    <input name="name" type="text" placeholder="Enter new map name" class="input map-name" tabindex="1" />\n                    <div class="buttonset map-type-select">\n                        <input type="radio" id="mapTypeImage" name="type" value="imageMap" class="image-map-radio" />\n                        <label for="mapTypeImage"> </label>\n                        <input type="radio" id="mapTypeGoogleMaps" name="type" value="googleMap" class="google-map-radio" />\n                        <label for="mapTypeGoogleMaps"></label>\n                    </div>\n                    <input name="Filedata" type="file" style="position: absolute; left: -9999px;" accept="image/x-png, image/png, image/jpg, image/jpe, image/jpeg, image/pjpeg, image/gif" />\n                </div>\n            </fieldset>\n\n            <!-- Workaround to avoid corrupted XHR2 request body in IE10 / IE11 -->\n            <input type="hidden" name="_dontcare">\n        </form>\n        <div class="map-container">\n            <img class="image-map" />\n            <div class="google-map-container"></div>\n            <div class="select-a-different-map">\n                <span class="not-map-text"></span>\n                <a href="#"></a>\n            </div>\n            <div class="set-location">\n                <form name="setLocation" class="ui-form clearfix">\n                    <fieldset>\n                        <p>\n                            <input name="location" type="text" placeholder="Enter location" class="set-location-input input" tabindex="2" />\n                            <button name="searchButton" type="submit" value="Locate" class="button set-location-button" tabindex="3">\n                                <span class="ubnt-icon-location ui-button-icon"></span>\n                                <span class="copy"></span>\n                            </button>\n                        </p>\n                    </fieldset>\n                </form>\n            </div>\n        </div>\n    </div>\n</div>'}),function(e){e.extend(e.fn,{validate:function(t){if(!this.length)return void(t&&t.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var i=e.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new e.validator(t,this[0]),e.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(t){i.settings.submitHandler&&(i.submitButton=t.target),e(t.target).hasClass("cancel")&&(i.cancelSubmit=!0),void 0!==e(t.target).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.submit(function(t){function a(){var a;return i.settings.submitHandler?(i.submitButton&&(a=e("<input type='hidden'/>").attr("name",i.submitButton.name).val(e(i.submitButton).val()).appendTo(i.currentForm)),i.settings.submitHandler.call(i,i.currentForm,t),i.submitButton&&a.remove(),!1):!0}return i.settings.debug&&t.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,a()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):a():(i.focusInvalid(),!1)})),i)},valid:function(){if(e(this[0]).is("form"))return this.validate().form();var t=!0,i=e(this[0].form).validate();return this.each(function(){t=t&&i.element(this)}),t},removeAttrs:function(t){var i={},a=this;return e.each(t.split(/\s/),function(e,t){i[t]=a.attr(t),a.removeAttr(t)}),i},rules:function(t,i){var a=this[0];if(t){var n=e.data(a.form,"validator").settings,o=n.rules,r=e.validator.staticRules(a);switch(t){case"add":e.extend(r,e.validator.normalizeRule(i)),delete r.messages,o[a.name]=r,i.messages&&(n.messages[a.name]=e.extend(n.messages[a.name],i.messages));break;case"remove":if(!i)return delete o[a.name],r;var s={};return e.each(i.split(/\s/),function(e,t){s[t]=r[t],delete r[t]}),s}}var c=e.validator.normalizeRules(e.extend({},e.validator.classRules(a),e.validator.attributeRules(a),e.validator.dataRules(a),e.validator.staticRules(a)),a);if(c.required){var l=c.required;delete c.required,c=e.extend({required:l},c)}return c}}),e.extend(e.expr[":"],{blank:function(t){return!e.trim(""+e(t).val())},filled:function(t){return!!e.trim(""+e(t).val())},unchecked:function(t){return!e(t).prop("checked")}}),e.validator=function(t,i){this.settings=e.extend(!0,{},e.validator.defaults,t),this.currentForm=i,this.init()},e.validator.format=function(t,i){return 1===arguments.length?function(){var i=e.makeArray(arguments);return i.unshift(t),e.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!==Array&&(i=e.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),e.each(i,function(e,i){t=t.replace(new RegExp("\\{"+e+"\\}","g"),function(){return i})}),t)},e.extend(e.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:e([]),errorLabelContainer:e([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(e,t){this.lastActive=e,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,e,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(e)).hide())},onfocusout:function(e,t){this.checkable(e)||!(e.name in this.submitted)&&this.optional(e)||this.element(e)},onkeyup:function(e,t){(9!==t.which||""!==this.elementValue(e))&&(e.name in this.submitted||e===this.lastElement)&&this.element(e)},onclick:function(e,t){e.name in this.submitted?this.element(e):e.parentNode.name in this.submitted&&this.element(e.parentNode)},highlight:function(t,i,a){"radio"===t.type?this.findByName(t.name).addClass(i).removeClass(a):e(t).addClass(i).removeClass(a)},unhighlight:function(t,i,a){"radio"===t.type?this.findByName(t.name).removeClass(i).addClass(a):e(t).removeClass(i).addClass(a)}},setDefaults:function(t){e.extend(e.validator.defaults,t)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:e.validator.format("Please enter no more than {0} characters."),minlength:e.validator.format("Please enter at least {0} characters."),rangelength:e.validator.format("Please enter a value between {0} and {1} characters long."),range:e.validator.format("Please enter a value between {0} and {1}."),max:e.validator.format("Please enter a value less than or equal to {0}."),min:e.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function t(t){var i=e.data(this[0].form,"validator"),a="on"+t.type.replace(/^validate/,"");i.settings[a]&&i.settings[a].call(i,this[0],t)}this.labelContainer=e(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||e(this.currentForm),this.containers=e(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var i=this.groups={};e.each(this.settings.groups,function(t,a){"string"==typeof a&&(a=a.split(/\s/)),e.each(a,function(e,a){i[a]=t})});var a=this.settings.rules;e.each(a,function(t,i){a[t]=e.validator.normalizeRule(i)}),e(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",t).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",t),this.settings.invalidHandler&&e(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),e.extend(this.submitted,this.errorMap),this.invalid=e.extend({},this.errorMap),this.valid()||e(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var e=0,t=this.currentElements=this.elements();t[e];e++)this.check(t[e]);return this.valid()},element:function(t){t=this.validationTargetFor(this.clean(t)),this.lastElement=t,this.prepareElement(t),this.currentElements=e(t);var i=this.check(t)!==!1;return i?delete this.invalid[t.name]:this.invalid[t.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),i},showErrors:function(t){if(t){e.extend(this.errorMap,t),this.errorList=[];for(var i in t)this.errorList.push({message:t[i],element:this.findByName(i)[0]});this.successList=e.grep(this.successList,function(e){return!(e.name in t)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){e.fn.resetForm&&e(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(e){var t=0;for(var i in e)t++;return t},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{e(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var t=this.lastActive;return t&&1===e.grep(this.errorList,function(e){return e.element.name===t.name}).length&&t},elements:function(){var t=this,i={};return e(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&t.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in i||!t.objectLength(e(this).rules())?!1:(i[this.name]=!0,!0)})},clean:function(t){return e(t)[0]},errors:function(){var t=this.settings.errorClass.replace(" ",".");return e(this.settings.errorElement+"."+t,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=e([]),this.toHide=e([]),this.currentElements=e([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(e){this.reset(),this.toHide=this.errorsFor(e)},elementValue:function(t){var i=e(t).attr("type"),a=e(t).val();return"radio"===i||"checkbox"===i?e("input[name='"+e(t).attr("name")+"']:checked").val():"string"==typeof a?a.replace(/\r/g,""):a},check:function(t){t=this.validationTargetFor(this.clean(t));var i,a=e(t).rules(),n=!1,o=this.elementValue(t);for(var r in a){var s={method:r,parameters:a[r]};try{if(i=e.validator.methods[r].call(this,o,t,s.parameters),"dependency-mismatch"===i){n=!0;continue}if(n=!1,"pending"===i)return void(this.toHide=this.toHide.not(this.errorsFor(t)));if(!i)return this.formatAndAdd(t,s),!1}catch(c){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+t.id+", check the '"+s.method+"' method.",c),c}}return n?void 0:(this.objectLength(a)&&this.successList.push(t),
!0)},customDataMessage:function(t,i){return e(t).data("msg-"+i.toLowerCase())||t.attributes&&e(t).attr("data-msg-"+i.toLowerCase())},customMessage:function(e,t){var i=this.settings.messages[e];return i&&(i.constructor===String?i:i[t])},findDefined:function(){for(var e=0;e<arguments.length;e++)if(void 0!==arguments[e])return arguments[e]},defaultMessage:function(t,i){return this.findDefined(this.customMessage(t.name,i),this.customDataMessage(t,i),!this.settings.ignoreTitle&&t.title||void 0,e.validator.messages[i],"<strong>Warning: No message defined for "+t.name+"</strong>")},formatAndAdd:function(t,i){var a=this.defaultMessage(t,i.method),n=/\$?\{(\d+)\}/g;"function"==typeof a?a=a.call(this,i.parameters,t):n.test(a)&&(a=e.validator.format(a.replace(n,"{$1}"),i.parameters)),this.errorList.push({message:a,element:t}),this.errorMap[t.name]=a,this.submitted[t.name]=a},addWrapper:function(e){return this.settings.wrapper&&(e=e.add(e.parent(this.settings.wrapper))),e},defaultShowErrors:function(){var e,t;for(e=0;this.errorList[e];e++){var i=this.errorList[e];this.settings.highlight&&this.settings.highlight.call(this,i.element,this.settings.errorClass,this.settings.validClass),this.showLabel(i.element,i.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(e=0;this.successList[e];e++)this.showLabel(this.successList[e]);if(this.settings.unhighlight)for(e=0,t=this.validElements();t[e];e++)this.settings.unhighlight.call(this,t[e],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return e(this.errorList).map(function(){return this.element})},showLabel:function(t,i){var a=this.errorsFor(t);a.length?(a.removeClass(this.settings.validClass).addClass(this.settings.errorClass),a.html(i)):(a=e("<"+this.settings.errorElement+">").attr("for",this.idOrName(t)).addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(a=a.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(a).length||(this.settings.errorPlacement?this.settings.errorPlacement(a,e(t)):a.insertAfter(t))),!i&&this.settings.success&&(a.text(""),"string"==typeof this.settings.success?a.addClass(this.settings.success):this.settings.success(a,t)),this.toShow=this.toShow.add(a)},errorsFor:function(t){var i=this.idOrName(t);return this.errors().filter(function(){return e(this).attr("for")===i})},idOrName:function(e){return this.groups[e.name]||(this.checkable(e)?e.name:e.id||e.name)},validationTargetFor:function(e){return this.checkable(e)&&(e=this.findByName(e.name).not(this.settings.ignore)[0]),e},checkable:function(e){return/radio|checkbox/i.test(e.type)},findByName:function(t){return e(this.currentForm).find("[name='"+t+"']")},getLength:function(t,i){switch(i.nodeName.toLowerCase()){case"select":return e("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return t.length},depend:function(e,t){return this.dependTypes[typeof e]?this.dependTypes[typeof e](e,t):!0},dependTypes:{"boolean":function(e,t){return e},string:function(t,i){return!!e(t,i.form).length},"function":function(e,t){return e(t)}},optional:function(t){var i=this.elementValue(t);return!e.validator.methods.required.call(this,i,t)&&"dependency-mismatch"},startRequest:function(e){this.pending[e.name]||(this.pendingRequest++,this.pending[e.name]=!0)},stopRequest:function(t,i){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[t.name],i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(e(this.currentForm).submit(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(e(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t){return e.data(t,"previousValue")||e.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(t,i){t.constructor===String?this.classRuleSettings[t]=i:e.extend(this.classRuleSettings,t)},classRules:function(t){var i={},a=e(t).attr("class");return a&&e.each(a.split(" "),function(){this in e.validator.classRuleSettings&&e.extend(i,e.validator.classRuleSettings[this])}),i},attributeRules:function(t){var i={},a=e(t),n=a[0].getAttribute("type");for(var o in e.validator.methods){var r;"required"===o?(r=a.get(0).getAttribute(o),""===r&&(r=!0),r=!!r):r=a.attr(o),/min|max/.test(o)&&(null===n||/number|range|text/.test(n))&&(r=Number(r)),r?i[o]=r:n===o&&"range"!==n&&(i[o]=!0)}return i.maxlength&&/-1|2147483647|524288/.test(i.maxlength)&&delete i.maxlength,i},dataRules:function(t){var i,a,n={},o=e(t);for(i in e.validator.methods)a=o.data("rule-"+i.toLowerCase()),void 0!==a&&(n[i]=a);return n},staticRules:function(t){var i={},a=e.data(t.form,"validator");return a.settings.rules&&(i=e.validator.normalizeRule(a.settings.rules[t.name])||{}),i},normalizeRules:function(t,i){return e.each(t,function(a,n){if(n===!1)return void delete t[a];if(n.param||n.depends){var o=!0;switch(typeof n.depends){case"string":o=!!e(n.depends,i.form).length;break;case"function":o=n.depends.call(i,i)}o?t[a]=void 0!==n.param?n.param:!0:delete t[a]}}),e.each(t,function(a,n){t[a]=e.isFunction(n)?n(i):n}),e.each(["minlength","maxlength"],function(){t[this]&&(t[this]=Number(t[this]))}),e.each(["rangelength","range"],function(){var i;t[this]&&(e.isArray(t[this])?t[this]=[Number(t[this][0]),Number(t[this][1])]:"string"==typeof t[this]&&(i=t[this].split(/[\s,]+/),t[this]=[Number(i[0]),Number(i[1])]))}),e.validator.autoCreateRanges&&(t.min&&t.max&&(t.range=[t.min,t.max],delete t.min,delete t.max),t.minlength&&t.maxlength&&(t.rangelength=[t.minlength,t.maxlength],delete t.minlength,delete t.maxlength)),t},normalizeRule:function(t){if("string"==typeof t){var i={};e.each(t.split(/\s/),function(){i[this]=!0}),t=i}return t},addMethod:function(t,i,a){e.validator.methods[t]=i,e.validator.messages[t]=void 0!==a?a:e.validator.messages[t],i.length<3&&e.validator.addClassRules(t,e.validator.normalizeRule(t))},methods:{required:function(t,i,a){if(!this.depend(a,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var n=e(i).val();return n&&n.length>0}return this.checkable(i)?this.getLength(t,i)>0:e.trim(t).length>0},email:function(e,t){return this.optional(t)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(e)},url:function(e,t){return this.optional(t)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)},date:function(e,t){return this.optional(t)||!/Invalid|NaN/.test(new Date(e).toString())},dateISO:function(e,t){return this.optional(t)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(e)},number:function(e,t){return this.optional(t)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e)},digits:function(e,t){return this.optional(t)||/^\d+$/.test(e)},creditcard:function(e,t){if(this.optional(t))return"dependency-mismatch";if(/[^0-9 \-]+/.test(e))return!1;var i=0,a=0,n=!1;e=e.replace(/\D/g,"");for(var o=e.length-1;o>=0;o--){var r=e.charAt(o);a=parseInt(r,10),n&&(a*=2)>9&&(a-=9),i+=a,n=!n}return i%10===0},minlength:function(t,i,a){var n=e.isArray(t)?t.length:this.getLength(e.trim(t),i);return this.optional(i)||n>=a},maxlength:function(t,i,a){var n=e.isArray(t)?t.length:this.getLength(e.trim(t),i);return this.optional(i)||a>=n},rangelength:function(t,i,a){var n=e.isArray(t)?t.length:this.getLength(e.trim(t),i);return this.optional(i)||n>=a[0]&&n<=a[1]},min:function(e,t,i){return this.optional(t)||e>=i},max:function(e,t,i){return this.optional(t)||i>=e},range:function(e,t,i){return this.optional(t)||e>=i[0]&&e<=i[1]},equalTo:function(t,i,a){var n=e(a);return this.settings.onfocusout&&n.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){e(i).valid()}),t===n.val()},remote:function(t,i,a){if(this.optional(i))return"dependency-mismatch";var n=this.previousValue(i);if(this.settings.messages[i.name]||(this.settings.messages[i.name]={}),n.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=n.message,a="string"==typeof a&&{url:a}||a,n.old===t)return n.valid;n.old=t;var o=this;this.startRequest(i);var r={};return r[i.name]=t,e.ajax(e.extend(!0,{url:a,mode:"abort",port:"validate"+i.name,dataType:"json",data:r,success:function(a){o.settings.messages[i.name].remote=n.originalMessage;var r=a===!0||"true"===a;if(r){var s=o.formSubmitted;o.prepareElement(i),o.formSubmitted=s,o.successList.push(i),delete o.invalid[i.name],o.showErrors()}else{var c={},l=a||o.defaultMessage(i,"remote");c[i.name]=n.message=e.isFunction(l)?l(t):l,o.invalid[i.name]=!0,o.showErrors(c)}n.valid=r,o.stopRequest(i,r)}},a)),"pending"}}}),e.format=e.validator.format}(jQuery),function(e){var t={};if(e.ajaxPrefilter)e.ajaxPrefilter(function(e,i,a){var n=e.port;"abort"===e.mode&&(t[n]&&t[n].abort(),t[n]=a)});else{var i=e.ajax;e.ajax=function(a){var n=("mode"in a?a:e.ajaxSettings).mode,o=("port"in a?a:e.ajaxSettings).port;return"abort"===n?(t[o]&&t[o].abort(),t[o]=i.apply(this,arguments),t[o]):i.apply(this,arguments)}}}(jQuery),function(e){e.extend(e.fn,{validateDelegate:function(t,i,a){return this.bind(i,function(i){var n=e(i.target);return n.is(t)?a.apply(n,arguments):void 0})}})}(jQuery),define("libs/jquery.validate",["jquery-ui"],function(){}),define("ubnt/view/map/AddEditMapDialogView",["underscore","ubnt/view/dialogs/DialogView","ubnt/view/dialogs/ErrorDialogView","msg/Msg","jquery","xregexp","ubnt/view/map/GoogleMapView","ubnt/view/map/GoogleMapOverlayWrapperView","ubnt/view/map/GoogleMapMarkerWrapperView","text!includes/map/addEditMapDialogTemplate.html","unifi/webrtc/WebRtcHelpers","config/ManageConfig","libs/jquery.validate"],function(e,t,i,a,n,o,r,s,c,l,d,m){"use strict";return t.extend({_fullyQualifiedName:"UBNT.views.map.AddEditMapDialog",initialize:function(i){e.bindAll(this);var n=this;this.template=e.template(l),this.mapIndexView=i.mapIndexView;var o={title:a.G_MapAddMapHeader,autoOpen:!0,width:640,resizable:!1,draggable:!1,modal:!0,dialogClass:"ubnt-map-add-map-dialog",CancelButton:{buttonClass:"ui-button-cancel button tall auto",handler:function(){n.mapIndexView.addMapPending=!1,n.destroy(),n.mapIndexView.configureMapsHandler()}},DoneButton:{buttonClass:"ui-button-positive button tall auto green",handler:this.addMapHandler},buttons:{},close:this.destroy};o.buttons[a.G_Cancel]=o.CancelButton,o.buttons[a.G_Done]=o.DoneButton,i.dialogOptions=e.extend(o,i.dialogOptions||{}),t.prototype.initialize.apply(this,[i])},initElements:function(){this.$mapTypeSelect=this.$('input[name="type"]'),this.$mapImageBrowser=this.$('input[name="Filedata"]'),this.$googleMapContainer=this.$(".google-map-container"),this.$form=this.$('form[name="addEditMapForm"]'),this.$setLocationForm=this.$('form[name="setLocation"]'),this.$mapLabel=this.$('input[name="name"]'),this.$imageMapContainer=this.$(".map-container"),this.$mapImage=this.$("img.image-map"),this.$selectMapLink=this.$(".select-a-different-map"),this.$setLocation=this.$(".set-location"),this.$setLocation.find('input[type="button"]'),this.$searchButton=this.$el.find('input[name="searchButton"]'),this.$addMapButtonText=this.$el.parent().find(".ui-dialog-buttonpane button:first-child span"),this.$uploadImageLabel=this.$('label[for="mapTypeImage"]'),this.$mapTypeLabel=this.$('label[for="mapTypeGoogleMaps"]'),this.$notMap=this.$(".select-a-different-map").find(".not-map-text"),this.$selectDiffMap=this.$(".select-a-different-map").find("a"),this.$buttonLocate=this.$('button[name="searchButton"]'),this.$el.find(".buttonset").buttonset()},initHandlers:function(){this.$selectMapLink.find("a").on("click",this.showMapImageBrowser),this.$mapImageBrowser.on("change",this.setImageMap),this.$mapTypeSelect.on("change",this.mapTypeChangeHandler),this.$mapImage.on("load",this.imageMapLoadHandler)},initValidation:function(){n.validator.addMethod("regex",function(e,t,i){return this.optional(t)||i.test(e)},""),n.validator.addMethod("custom_xregex",function(e,t){var i=new o("^[\\p{L}\\p{Z}\\p{P}\\p{S}\\p{N}]{0,}$");return this.optional(t)||i.test(e)},""),this.$form.validate({rules:{name:{required:!0,custom_xregex:!0}},submitHandler:this.saveMap}),this.$setLocationForm.validate({rules:{location:{required:!0}},submitHandler:this.setLocation})},setLocation:function(){var e=this;return this.geocoder.geocode({address:n('input[name="location"]').val()},function(t,n){if(n===google.maps.GeocoderStatus.OK)e.googleMap.setOptions({center:t[0].geometry.location});else switch(e.errorDialog||(e.errorDialog=new i),n){case"ZERO_RESULTS":e.errorDialog.open(a.E_GoogleNotFound);break;default:e.errorDialog.open(n)}}),!1},setImageMap:function(){var e=this.$mapImageBrowser.get(0).files[0],t=new FileReader,i=this;t.onload=function(e){i.$mapImage.attr("src",e.target.result)},t.readAsDataURL(e)},showMapImageBrowser:function(){return this.$mapImageBrowser.val(""),this.$mapImage.removeAttr("src"),this.$mapImage.hide(),this.$mapImageBrowser.click(),this.$setLocation.hide(),!1},showImageMap:function(){this.$mapImage.show(),this.$selectMapLink.show(),this.$setLocation.hide(),this.$googleMapContainer.hide()},showGoogleMap:function(){var e=n("body");if(this.$mapImage.hide(),this.$selectMapLink.hide(),this.$setLocation.show(),this.$googleMapContainer.show(),e.hasClass("googlemaps-notLoaded"))window.googleMapsNotLoaded();else if(r.loaded||n("body").bind("googleMapsLoaded.AddMapDialog",this.googleMapLoadedHandler),r.loading||r.loaded||(window.UBNTMapGoogleMapCallback=function(){r.loaded=!0,c.initialize(),s.initialize(),n("body").trigger("googleMapsLoaded")},r.loading=!0,window.google&&window.google.maps&&window.UBNTMapGoogleMapCallback()),r.loaded){var t=new google.maps.LatLng(37.411146,-121.943083),i={};i=this.model&&"googleMap"===this.model.get("type")?{zoom:this.model.get("zoom"),center:new google.maps.LatLng(this.model.get("lat"),this.model.get("lng")),mapTypeId:this.model.get("mapTypeId"),tilt:0,tiltControl:!1,rotateControl:!1,mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,position:google.maps.ControlPosition.TOP_RIGHT},zoomControl:!0,scaleControl:!1,zoomControlOptions:{position:google.maps.ControlPosition.LEFT_TOP},streetViewControl:!1}:{zoom:14,center:t,mapTypeId:google.maps.MapTypeId.SATELLITE,tilt:0,tiltControl:!1,rotateControl:!1,mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,position:google.maps.ControlPosition.TOP_RIGHT},zoomControl:!0,scaleControl:!1,zoomControlOptions:{position:google.maps.ControlPosition.LEFT_TOP},streetViewControl:!1},null===this.googleMap||void 0===this.googleMap?(this.googleMap=new google.maps.Map(this.$googleMapContainer.get(0),i),this.geocoder=new google.maps.Geocoder):this.googleMap.setOptions(i)}},setModel:function(e){this.model=e,this.render()},removeMarkers:function(){var t=this,i=e.filter(this.mapIndexView.markers.models,function(e){return t.model&&e.get("map_id")==t.model.id});e.each(i,function(e){e.save({map_id:"",x:"",y:""})})},saveMap:function(){var e=this,t={name:this.$mapLabel.val(),type:this.$('input[type="radio"]:checked').val()};switch(t.type){case"imageMap":var o=this.$mapImageBrowser.get(0).files[0];if(o){this.mapIndexView.addMapPending=!0,this.removeMarkers();var r,s;m.USE_WEBRTC?(r="/upload/s/"+SITE.name+"/map/"+t.type+"/"+encodeURI(t.name)+(null===this.model?"":"/"+this.model.get("_id")),s=e.$mapImage.attr("src")):(r="/upload/s/"+SITE.name+"/map"+(null===this.model?"":"/"+this.model.get("_id")),s=new FormData(this.$form.get(0))),n.ajax({url:r,data:s,cache:!1,processData:!1,contentType:!1,dataType:"json",unifi_convertToBinary:!0,type:"POST",success:e.handleUploadComplete,error:e.handleUploadFailed})}else this.model&&this.$mapImage.attr("src")?this.model.save(t,{success:this.destroy}):(this.errorDialog||(this.errorDialog=new i),this.errorDialog.open(a.E_NoImageSpecified));break;case"googleMap":t.lat=this.googleMap.getCenter().lat(),t.lng=this.googleMap.getCenter().lng(),t.zoom=this.googleMap.getZoom(),t.tilt=this.googleMap.getTilt(),t.mapTypeId=this.googleMap.getMapTypeId(),this.model?(this.removeMarkers(),this.model.save(t,{wait:!0,success:e.destroy})):(this.mapIndexView.addMapPending=!0,this.collection.createGoogleMapModel(t,{wait:!0,success:e.destroy}))}},render:function(){if(t.prototype.render.apply(this,[]),this.isRenderedd||(this.isRenderedd=!0,this.initElements(),this.initHandlers(),this.initValidation(),this.$searchButton.button(),n(".ui-button-cancel").attr("tabindex",4).button({icons:{primary:"ubnt-icon-close"}}),n(".ui-button-positive").attr("tabindex",5).button({icons:{primary:"ubnt-icon-check"}}),this.$uploadImageLabel.find(".ui-button-text").text(a.G_MapUploadImage),this.$mapTypeLabel.find(".ui-button-text").text(a.G_MapGoogleMaps),this.$notMap.text(a.G_MapNotWhatYouLookingFor),this.$selectDiffMap.text(a.G_MapSelectDiffMap),this.$buttonLocate.find("span.copy").text(a.G_Locate)),this.$mapLabel.val(""),this.$mapImage.hide(),this.model){var e=this;this.$el.dialog("option",{title:a.G_MapEditMapHeader}),this.$mapLabel.val(this.model.get("name"));var i=this.model.get("type")||"imageMap";"imageMap"===i?(this.$("input.image-map-radio").click(),m.USE_WEBRTC?n.ajax({type:"GET",dataType:"arraybuffer",processData:!1,xhrFields:{withCredentials:!0},url:e.model.get("url"),success:function(t){e.$mapImage.attr("src","data:image;base64,"+btoa(d.Uint8ArrayToBinaryString(t)))},error:function(){console.log("error!")}}):this.$mapImage.attr("src",this.model.get("url"))):(this.$("input.google-map-radio").click(),this.showGoogleMap()),this.$mapTypeSelect.find(n('input[value="'+i+'"]'))}else this.$el.dialog("option",{title:a.G_MapAddMapHeader}),this.$addMapButtonText.text("Add Map"),this.$googleMapContainer.hide(),this.setDefaultMapType||(this.$("input.image-map-radio").click(),this.showMapImageBrowser(),this.setDefaultMapType=!0);this.$('input[name="key"]').val(n.cookie("unifises"))},imageMapLoadHandler:function(e){this.$mapImage.css("width","auto"),this.$mapImage.css("height","auto");var t=e.target.width,i=e.target.height,a=this.$imageMapContainer.width(),n=this.$imageMapContainer.height();t/i>a/n?(this.$mapImage.height(a/t*i),this.$mapImage.width(a),this.$mapImage.css("margin-top",(n-this.$mapImage.height())/2+"px"),this.$mapImage.css("margin-left","0px")):(this.$mapImage.width(n/i*t),this.$mapImage.height(n),this.$mapImage.css("margin-left",(a-this.$mapImage.width())/2+"px"),this.$mapImage.css("margin-top","0px")),this.$googleMapContainer.hide(),this.$setLocation.hide(),this.$selectMapLink.show(),this.$mapImage.show()},mapTypeChangeHandler:function(e){var t=n(e.target).val();switch(t){case"imageMap":this.showImageMap();break;case"googleMap":this.showGoogleMap()}},googleMapLoadedHandler:function(){n("body").unbind("googleMapsLoaded.AddMapDialog"),this.showGoogleMap()},addMapHandler:function(){this.$form.submit()},handleUploadProgress:function(e){},handleUploadComplete:function(e,i,a){var n=e.data[0],o=this.collection.get(n._id);o?o.set(n,{silent:!1}):this.collection.add(n),t.prototype.destroy.apply(this,arguments),this.$mapImageBrowser.val("")},handleUploadFailed:function(e,t,i){},handleUploadCanceled:function(e){},dialogOpenHandler:function(e,t){this.model&&"googleMap"===this.model.get("type")?(this.$("input.image-map-radio").removeAttr("checked"),this.$("input.image-map-radio").next("label").removeClass("ui-state-active"),this.$("input.google-map-radio").attr("checked","checked"),this.$("input.google-map-radio").next("label").addClass("ui-state-active")):(this.$("input.image-map-radio").attr("checked","checked"),this.$("input.image-map-radio").next("label").addClass("ui-state-active"),this.$("input.google-map-radio").removeAttr("checked"),this.$("input.google-map-radio").next("label").removeClass("ui-state-active"))},dialogCloseHandler:function(e,i){t.prototype.dialogCloseHandler.apply(this,arguments),this.setDefaultMapType=null},hide:function(){t.prototype.hide.apply(this,arguments)},destroy:function(){t.prototype.destroy.apply(this,arguments)},remove:function(){this.$selectMapLink.find("a").off("click",this.showMapImageBrowser),this.$mapImageBrowser.off("change",this.setImageMap),this.$mapTypeSelect.off("change",this.mapTypeChangeHandler),this.$mapImage.off("load",this.imageMapLoadHandler),n("body").unbind("googleMapsLoaded.AddMapDialog",this.googleMapLoadedHandler),this.isRenderedd=!1,t.prototype.remove.apply(this,arguments)}})}),define("text!includes/map/confirmRemoveDialogTemplate.html",[],function(){return'<div class="dialog-content configure-maps-dialog">\n    <div class="content-area">\n        <img class="image" src="/lib/4_8_15_7440/images/1x1.gif" alt="" />\n        <div class="confirmation">\n            \n            <div class="map-name"></div>\n        </div>\n    </div>\n</div>'}),define("ubnt/view/map/ConfirmRemoveMapDialogView",["underscore","ubnt/view/dialogs/DialogView","msg/Msg","jquery","text!includes/map/confirmRemoveDialogTemplate.html","unifi/webrtc/WebRtcHelpers","config/ManageConfig"],function(e,t,i,a,n,o,r){"use strict";return t.extend({_fullyQualifiedName:"UBNT.views.dialogs.ConfirmRemoveDialog",initialize:function(){e.bindAll(this),this.template=e.template(n);var a={title:i.G_PleaseConfirm,autoOpen:!0,width:430,height:265,resizable:!1,draggable:!1,modal:!0,dialogClass:"confirm-dialog confirm-remove-dialog",CancelButton:{buttonClass:"button tall auto ui-button-cancel",handler:this.cancelHandler},ConfirmButton:{buttonClass:"button tall auto red",handler:this.confirmHandler},buttons:{}};a.buttons[i.G_Cancel]=a.CancelButton,a.buttons[i.G_Confirm]=a.ConfirmButton,this.options.dialogOptions=e.extend(a,this.options.dialogOptions||{}),t.prototype.initialize.apply(this,[this.options])},render:function(){if(t.prototype.render.apply(this,[]),a(".ui-button-cancel").button({icons:{primary:"ubnt-icon-close"}}),this.$image=this.$el.find(".image"),this.$mapName=this.$el.find(".map-name"),this.map&&this.map.get("url")&&"imageMap"===this.map.get("type"))if(this.$el.removeClass("no-image"),r.USE_WEBRTC){var e=this;a.ajax({type:"GET",dataType:"arraybuffer",processData:!1,xhrFields:{withCredentials:!0},url:e.map.get("url"),success:function(t){e.$image.attr("src","data:image;base64,"+btoa(o.Uint8ArrayToBinaryString(t)))},error:function(){console.log("error!")}})}else this.$image.attr("src",this.map.get("url"));else this.$el.addClass("no-image"),this.$image.attr("src","/lib/4_8_15_7440/images/1x1.gif");this.$confirmation=this.$el.find(".confirmation"),this.$confirmation.find("div").before(i.G_RemoveMap),this.$mapName.text(this.mapName)},show:function(e){this.map=e,this.mapName=e.get("name"),this.open()},confirmHandler:function(){this.options.confirmHandler.call(this.context,this.map),this.destroy()},cancelHandler:function(){this.options.cancelHandler.call(this.context,this.map),this.destroy()}})}),define("text!includes/map/configureMapsDialogTemplate.html",[],function(){return'<div class="dialog-content configure-maps-dialog">\n    <% if(items.length > 0) { %>\n        <table class="table maps">\n            <thead class="thead">\n                <tr class="table-row">\n                    <td class="table-cell table-cell-map-name"></td>\n                    <td class="table-cell table-cell-actions"></td>\n                </tr>\n            </thead>\n            <tbody class="tbody">\n                <% for(var key in items) { %>\n                <tr class="table-row map-<%- items[key]._id %>" data-id="<%- items[key]._id %>">\n                    <td class="table-cell table-cell-map-name"><%- items[key].name %></td>\n                    <td class="table-cell table-cell-actions">\n                        <button class="button edit skinny"><span class="ui-icon ubnt-icon-edit"></span></button>\n                        <button class="button remove skinny" \n                            <% if (items[key].attr_no_delete) { %>disabled="disabled"<% } %>><span class="ui-icon ubnt-icon-trash"></span></button>\n                    </td>\n                </tr>\n                <% } %>\n            </tbody>\n        </table>\n    <% } else { %>\n        <div class="no-maps"></div>\n    <% } %>\n</div>'}),define("ubnt/view/map/ConfigureMapsDialogView",["underscore","ubnt/view/dialogs/DialogView","msg/Msg","jquery","text!includes/map/configureMapsDialogTemplate.html"],function(e,t,i,a,n){"use strict";return t.extend({_fullyQualifiedName:"UBNT.views.map.ConfigureMapsDialog",initialize:function(a){e.bindAll(this),this.mapIndexView=a.mapIndexView,this.template=e.template(n);var o={title:i.G_ConfigureMaps,autoOpen:!0,width:430,resizable:!1,draggable:!1,modal:!0,dialogClass:"ubnt-map-configure-maps-dialog",AddMapButton:{buttonClass:"ui-button-positive button tall green add-a-map",handler:this.addMapHandler},DoneButton:{buttonClass:"ui-button-cancel button tall right",handler:this.destroy},buttons:{},close:this.destroy};o.buttons[i.G_MapAddMap]=o.AddMapButton,o.buttons[i.G_Done]=o.DoneButton,a.dialogOptions=e.extend(o,a.dialogOptions||{}),t.prototype.initialize.apply(this,[a]),this.collection.on("change",this.updateMapNames)},render:function(){var e={items:this.collection.toJSON(),length:this.collection.length};t.prototype.render.apply(this,[{template_json:e}]),this.$tableCellMapName=a("thead .table-cell-map-name"),this.$tableCellActions=a("thead .table-cell-actions"),this.$noMaps=a(".no-maps"),this.$edit=a(".edit span"),this.$remove=a(".remove span"),this.$tableCellMapName.text(i.G_Name),this.$tableCellActions.text(i.G_Actions),this.$noMaps.text(i.G_MapNoMaps),this.$edit.after(i.G_Edit),this.$remove.after(i.G_Delete),this.isRenderedd||(a(".ui-button-cancel").button({icons:{primary:"ubnt-icon-close"}}),a(".ui-button-positive").button({icons:{primary:"ubnt-icon-check"}}),this.$el.one("click",".edit",this.editMapHandler),this.$el.one("click",".remove",this.removeMapHandler)),this.isRendered=!1},updateMapNames:function(){var t=this;e.each(this.collection.models,function(e){t.$(".map-"+e.get("_id")).find(".table-cell-map-name").text(e.get("name"))})},setModel:function(e){this.model=e},editMapHandler:function(e){this.destroy(),this.mapIndexView.editMapClickHandler(e)},removeMapHandler:function(e){this.destroy();var t=a(e.target).parents(".table-row").data("id"),i=this.collection.findWhere({_id:t});this.mapIndexView.removeMapClickHandler(i)},addMapHandler:function(){this.destroy(),this.mapIndexView.addMapClickHandler()},remove:function(){this.collection.off("change",this.updateMapNames),this.isRendered=!1,t.prototype.remove.apply(this,arguments)}})}),define("unifi/view/map/IndexView",["backbone","underscore","jquery","msg/Msg","unifi/view/app/ContentView","text!includes/map/mapIndexTemplate.html","text!includes/map/mapMarkerTemplate.html","text!includes/map/mapUnplacedMarkerTemplate.html","text!includes/map/mapUnplacedMarkerDraggableTemplate.html","ubnt/view/map/RulerView","unifi/view/map/MarkerView","ubnt/view/map/MarkerDrawerView","unifi/view/map/UnplacedMarkerView","ubnt/view/map/MapView","unifi/view/map/TopologyView","unifi/view/map/CoverageView","unifi/collection/Maps","ubnt/view/uicomponents/SelectMenuView","ubnt/view/map/AddEditMapDialogView","ubnt/view/map/ConfirmRemoveMapDialogView","ubnt/view/map/ConfigureMapsDialogView","ubnt/view/dialogs/ErrorDialogView"],function(e,t,i,a,n,o,r,s,c,l,d,m,u,h,g,p,y,f,_,v,b,w){"use strict";return n.extend({template:t.template(o),id:"mapIndex",initialize:function(e){n.prototype.initialize.call(this,e),this._dependencies=i.Deferred(),this.drawerHidden=!0,i.when(this._dependencies).then(this.render,this.failed),this.dependencies()},render:function(){if("pending"!==this._dependencies.state()){var e=this;if(n.prototype.render.call(this),!this.rendered&&(this.rendered=!0)){if(this.maps=this.app.collection("Maps"),this.markers=this.options.app.collection("Devices"),this.$el.html(this.template({msg:a})),this.$el.find("select").each(function(){var e=i(this),t=e.parent();"mapSelect"!=e.attr("name")&&e.selectmenu({parent:t,appendTo:t,icons:{button:"ubnt-icon-arrow-down secondary-color"},position:{at:"left bottom"}})}),this.$mapSelect=this.$el.find('select[name="mapSelect"]'),this.$drawerHandle=this.$el.find(".marker-drawer").find(".handle"),this.mapSelector=new f({el:this.$mapSelect,collection:this.maps,width:200,create:function(t,n){n.menuWrap.append(i('<div class="ui-menu-item configure-maps is-admin"><span class="ubnt-icon-gear gear"></span>'+a.G_ConfigureMaps+"</div>").on("click",function(t){e.configureMapsHandler()}).on("mouseover",function(e){n.menu.find(".ui-state-focus").removeClass("ui-state-focus")}))}}),this.$slider=this.$el.find(".zoom-slider").slider({min:1,max:20,value:10,step:1,slide:this.slideHandler,orientation:"vertical",range:"min"}),this.$zoomOut=this.$el.find(".zoom-controls").find(".minus").click(this.zoomOut),this.$zoomIn=this.$el.find(".zoom-controls").find(".plus").click(this.zoomIn),this.markerDrawer=new m({el:this.$("div.marker-drawer"),markers:this.markers,maps:this.maps,markerView:u,unplacedMarkerTemplate:t.template(s),unplacedMarkerDraggableTemplate:t.template(c)}),this.$markerDrawer=this.markerDrawer.render(),this.maps.models[0]){var o=i.cookie?i.cookie("default-map"):null,y=this.maps.get(o)||this.maps.models[0];y&&(this.mapSelector.set(y.id),this.mapSelector.$el.trigger("change"),this.mapSelector.$el.selectmenu("close"))}this.$drawerHandle.on("click",this.toggleDrawer),this.$mapSelect.on("change",this.mapSelectHandler),this.map=new h({app:this.options.app,el:"#Map",maps:this.maps,markers:this.markers,markerView:d.extend({app:this.options.app}),markerTemplate:t.template(r)}),this.coverageView=new p({indexView:this}),this.topologyView=new g({indexView:this}),this.$(".buttonset").buttonset(),
this.$(".buttonset.mainToggles input").on("click",this.mapViewClick),this.mapViewClick(),this.$(".buttonset.coverage input").on("click",this.mapCoverageViewClick),this.$(".buttonset.coverage").hide(),this.$ruler=new l({el:".ruler"}),this.$ruler.$el.on("scaled",this.setUpp),this.$scale=this.$(".scale"),this.$scaleMeasurement=this.$scale.find(".scale-measurement"),this.$scaleIcon=this.$scale.find(".scale-icon"),this.setMap(this.maps.findWhere({_id:this.$mapSelect.val()})),this.markers.bind("add",this.addDevice),this.markers.bind("change",this.updateDevice),this.markers.bind("remove",this.removeDevice),this.markers.bind("reset",this.resetDevices),this.maps.bind("add",this.addMap),this.maps.bind("change",this.updateMap),this.maps.bind("remove",this.removeMap),this.maps.bind("reset",this.resetMaps)}this.map.render(),this.coverageView.updateCoverage()}},addDevice:function(e,t){this.markerDrawer.hasUnplacedMarkers()&&this.showDrawer()},updateDevice:function(e,t){var i=e.changedAttributes();(void 0!==i.map_id||void 0!==i.provisioned)&&(this.markerDrawer.hasUnplacedMarkers()?this.showDrawer():this.hideDrawer())},removeDevice:function(e,t){this.markerDrawer.hasUnplacedMarkers()?this.showDrawer():this.hideDrawer()},resetDevices:function(){},configureMapsHandler:function(){var e=new b({mapIndexView:this,collection:this.maps});e.render()},toggleDrawer:function(){this.drawerHidden?this.showDrawer():this.hideDrawer()},showDrawer:function(e){this.markerDrawer.$el.addClass("is-open"),this.drawerHidden=!1},hideDrawer:function(e){this.markerDrawer.$el.removeClass("is-open"),this.drawerHidden=!0},mapSelectHandler:function(){var e=this.$mapSelect.val();i.cookie&&i.cookie("default-map",e);var t=this.maps.findWhere({_id:e});this.setMap(t)},setMap:function(e){this.model&&this.model.off("change:zoom",this.mapZoomHandler),this.model=e,this.model.on("change:zoom",this.mapZoomHandler),this.map.setMap(e),this.coverageView.setMap(e),this.topologyView.setMap(e),this.setZoom(this.model.get("zoom"),!0)},getActiveMap:function(){var e=this.model;return e?"googleMap"===e.get("type")?this.map.mapWidget.googleMap:this.map.mapWidget.imageMap:null},setScaleBar:function(){var e,t,i=this.getActiveMap(),a=1;i&&(t=this.model.get("upp")||.5,e=1*i.scale*(i.zoomLevel*t),a=e>1e4||Math.abs(e-1e4)<Math.abs(e-5e3)?1e4:e>5e3||Math.abs(e-5e3)<Math.abs(e-1e3)?5e3:e>1e3||Math.abs(e-1e3)<Math.abs(e-500)?1e3:e>500||Math.abs(e-500)<Math.abs(e-100)?500:e>100||Math.abs(e-100)<Math.abs(e-50)?100:Math.abs(e-50)<Math.abs(e-20)?50:Math.abs(e-20)<Math.abs(e-10)?20:Math.abs(e-10)<Math.abs(e-5)?10:Math.abs(e-5)<Math.abs(e-1)?5:1,this.$scaleMeasurement.text(a+" "+(this.model.get("unit")||"m")),this.$scaleIcon.width(a*i.scale*this.model.get("zoom")/t),this.$scale.show())},setUpp:function(e,t,i){var a,n=this.getActiveMap();return n&&(a=t*n.scale*this.model.get("zoom"),this.app.isReadOnly?n.model.set({upp:a,unit:i}):n.model.save({upp:a,unit:i}),this.setScaleBar()),!1},mapViewClick:function(){var e=this.$('input[name="filter"]:checked'),a=[];e.each(function(){a.push(i(this).val())}),this.mapView||(this.mapView=[]),this.map.$el.removeClass(this.mapView.join(" ")).addClass(a.join(" ")),this.mapView=a,t.contains(this.mapView,"details")?(i("#mapFilterDetails").next("label:first").addClass("ui-state-active"),this.map.$el.removeClass("labels")):this.map.$el.addClass("labels"),t.contains(this.mapView,"coverage")?(i("#mapFilterCoverage").next("label:first").addClass("ui-state-active"),this.coverageView.show()):this.coverageView.hide(),t.contains(this.mapView,"details")||t.contains(this.mapView,"coverage")?this.$(".buttonset.coverage").show():this.$(".buttonset.coverage").hide(),t.contains(this.mapView,"topology")?(i("#mapFilterTopology").next("label:first").addClass("ui-state-active"),this.topologyView.show()):this.topologyView.hide()},mapCoverageViewClick:function(){var e=this.$('input[name="coverageFilter"]:checked'),a=[];e.each(function(){a.push(i(this).val())}),this.mapViewCoverageType||(this.mapViewCoverageType=[]),this.map.$el.removeClass(this.mapViewCoverageType.join(" ")).addClass(a.join(" ")),this.mapViewCoverageType=a,t.contains(this.mapViewCoverageType,"2G")&&(i("#mapFilterCoverage2G").next("label:first").addClass("ui-state-active"),i("#mapFilterCoverage5G").prop("checked",!1).next("label:first").removeClass("ui-state-active"),this.coverageView.setCoverageFilter("2G")),t.contains(this.mapViewCoverageType,"5G")&&(i("#mapFilterCoverage5G").next("label:first").addClass("ui-state-active"),i("#mapFilterCoverage2G").prop("checked",!1).next("label:first").removeClass("ui-state-active"),this.coverageView.setCoverageFilter("5G"))},slideHandler:function(e,t){var i=t.value;this.setZoom(i,!1,!0)},zoomOut:function(){var e=this.$slider.slider("value"),t=this.$slider.slider("option","min"),i=e-1;return i>=t&&this.setZoom(i),!1},zoomIn:function(){var e=this.$slider.slider("value"),t=this.$slider.slider("option","max"),i=e+1;return t>=i&&this.setZoom(i),!1},mapZoomHandler:function(e){this.setZoom(e.get("zoom"),!0)},setZoom:function(e,t,i){i||this.$slider.slider("option","value",e),this.model.set({zoom:e}),this.setScaleBar(),t||this.app.isReadOnly||this.saveZoom(e)},saveZoom:t.debounce(function(e){this.model.unset("zoom",{silent:!0}),this.model.save({zoom:e},{silent:!0})},250),addMapClickHandler:function(){this.addEditMapDialog=new _({collection:this.maps,mapIndexView:this}),this.$addEditMapDialog=this.addEditMapDialog.render(),this.addEditMapDialog.setModel(null),this.addEditMapDialog.show()},editMapClickHandler:function(e){var t=this.maps.get(i(e.target).parents(".table-row:first").data("id"));t&&(this.addEditMapDialog=new _({collection:this.maps,model:t,mapIndexView:this}),this.$addEditMapDialog=this.addEditMapDialog.render(),this.addEditMapDialog.setModel(t),this.addEditMapDialog.show())},removeMapClickHandler:function(e){var t=new v({cancelHandler:this.cancelRemoveMapHandler,confirmHandler:this.confirmRemoveMapHandler});t.show(e)},cancelRemoveMapHandler:function(){this.configureMapsHandler(),this.removeMapPending=!1},confirmRemoveMapHandler:function(e){var t=this;e&&(this.maps.remove(e),e.destroy({success:function(){var e=t.maps.at(0);e&&(t.setMap(e),t.mapSelector.set(e.id))}})),this.configureMapsHandler()},addMap:function(e,t){this.addMapPending&&(this.addMapPending=!1,i(".ui-dialog").is(":visible")||this.configureMapsHandler(),this.setMap(e),this.mapSelector.set(e.id))},updateMap:function(e,t){},removeMap:function(e,t){if(this.model.id===e.id){var i=this.maps.at(0);i&&(this.setMap(i),this.mapSelector.set(i.id))}this.removeMapPending&&(this.removeMapPending=!1,this.configureMapsHandler())},resetMaps:function(){},dependencies:function(){var e={Maps:y},a=[],n={},o=this;t.each(e,function(e,t){a.push(n[t]=i.Deferred())},this),i.when.apply(i,a).then(function(){o._dependencies.resolve()},function(){o._dependencies.reject()}),t.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:n[t]}},e)},this)},failed:function(){(new w).open(a.E_DataLoad)},locateDevice:function(e){this.rendered?(this.$mapSelect.val(e.get("map_id")),this.mapSelectHandler(),this.markers.get(e)&&this.map.locateDevice(e)):t.delay(this.locateDevice,50,e)},remove:function(){this.$ruler.$el.off("scaled",this.setUpp),this.$(".buttonset input").off("click",this.mapViewClick),this.$drawerHandle.off("click",this.toggleDrawer),this.$mapSelect.off("change",this.mapSelectHandler),this.markers.unbind("add",this.addDevice),this.markers.unbind("change",this.updateDevice),this.markers.unbind("remove",this.removeDevice),this.markers.unbind("reset",this.resetDevices),this.maps.unbind("add",this.addMap),this.maps.unbind("change",this.updateMap),this.maps.unbind("remove",this.removeMap),this.maps.unbind("reset",this.resetMaps),this.rendered=!1,n.prototype.remove.apply(this,arguments)}})}),define("unifi/router/MapRouter",["unifi/router/Router","unifi/view/map/IndexView","unifi/view/map/MarkerView","unifi/view/map/UnplacedMarkerView"],function(e,t,i,a){"use strict";return e.extend({_fullyQualifiedName:"UNIFI.Routers.Map",_associatedViews:{Index:t,Marker:i,UnplacedMarker:a},routes:{map:"index","map?d=:d":"index"}})}),define("unifi/view/app/PropertyView",["backbone","underscore","jquery","ubnt/backgrid","ubnt/view/dialogs/ErrorDialogView","msg/Msg"],function(e,t,i,a,n,o){"use strict";return e.View.extend({tagName:"div",className:"properties accordion",templateId:null,_autoRender:!1,_detached:!1,initialize:function(e){if(!this.templateId)throw"Missing templateId";t.bindAll(this),this.template=t.template(this.templateId),this.properties=e.properties,this.parent=e.parent,this.app=this.parent.app,this.id=e.property_id,this.$container=this.properties.$el,this.grids={},this.collections={},this.model.on("change:name",this.render,!0),this.model.on("remove",this.remove),i(window).bind("resize",this.position),this._autoRender&&this.render()},render:function(e){return!this.rendered&&(this.rendered=!0)?(this.$el.html(this.template(t.extend(this.args(),this.model))),this.$tabs=this.$(".tabs"),this.$statusSaved=this.$(".status-success"),this.$statusError=this.$(".status-error"),this.$overflow=this.$(".properties-container.overflow"),this.$el.find(".accordion").andSelf().accordion({header:"> .accordion-header",heightStyle:"content",collapsible:!0,animate:200,beforeActivate:function(e,t){return i(this).hasClass("ui-dragging-stopped")?!1:void 0},activate:i.proxy(function(e,t){this.position()},this)}),this.$el.find(".accordion .accordion-header").on("click",this.renderSelects),this.$el.find(".accordion-header .remove").on("click",i.proxy(function(e){e.stopPropagation(),e.preventDefault(),this.remove()},this)),this.$el.find(".accordion-header .detach").on("click",i.proxy(function(e){e.stopPropagation(),e.preventDefault(),this._detached?this.attach():this.detach()},this)),this.$tabs.tabs({activate:i.proxy(function(e,t){this.position(),this.$tabs.trigger("change")},this)}),this.$tabs.find("a").on("click",this.renderSelects),this.$container.prepend(this.$el.hide().fadeIn()),this.attach(!0)):(e||(this._detached?this.detach():this.attach()),this.$el.find(".accordion-header .title-text").text(this.model.get("name"))),this.$container.scrollTop(0),this.position(),this},renderSelects:function(){this.$("select:visible").each(function(){var e=i(this),t=e.parent(),a=e.data("selectRendered"),n=e.data("myposition")||"left top",o=e.data("atposition")||"left bottom";a||(e.selectmenu({parent:t,appendTo:t,icons:{button:"ubnt-icon-arrow-down secondary-color"},position:{my:n,at:o,collision:"flip"},change:function(t,i){var a=i.item.element.parents(".row:first"),n=a.next(".custom:first");"custom"===i.item.value?n.show():n.hide(),e.trigger("change")}}),e.data("selectRendered",!0).trigger("change",!0))})},args:function(){return{_id:this.id,msg:o}},remove:function(){this.model&&(this.parent.properties[this.model.get("mac")]=null,delete this.parent.properties[this.model.get("mac")]),this.rendered=!1,this.model.off("change:name",this.render,!0),this.model.off("remove",this.remove),i(window).unbind("resize",this.position),this.$el.find(".accordion-header .remove").off(),this.$el.find(".accordion .accordion-header").off(),this.$el.find(".accordion-header .detach").off(),this.$tabs.find("a").off(),t.each(this.grids,function(e){e.remove()}),this.grids={},this.removeTooltips(),this.$el.fadeOut(i.proxy(function(){e.View.prototype.remove.apply(this,arguments),this.$container.trigger("property:remove")},this))},attach:function(e){this.removeTooltips(),e||this.$container.prepend(this.$el.detach()),this.$el.accordion("option","active",0),this.$el.is(".ui-draggable")&&this.$el.draggable("destroy"),this.$el.is(".ui-resizable")&&(this.$el.resizable("destroy"),this.$el.css("width","")),this.$el.css({position:"static",top:0,left:0,"z-index":""}).find(".accordion-header .detach").attr("title",o.G_Detach).tooltip({show:!1,hide:!1,track:!0,close:i.proxy(function(e,t){this.$el.find(".accordion-header .detach").attr("title",this._detached?o.G_Attach:o.G_Detach)},this)}),this.overflow(!1),this._detached=!1,this.$container.trigger("property:render")},detach:function(e){var t=this.properties.$detached.find("> div.properties").size();this.removeTooltips(),e||this.properties.$detached.append(this.$el.detach()),this.$el.accordion("option","animate",!1).accordion("option","active",0).draggable({handle:".accordion-header",stack:".properties",containment:"window",opacity:.95,stop:function(e){i(e.target).addClass("ui-dragging-stopped").delay(300).queue(function(e){i(this).removeClass("ui-dragging-stopped"),e()})}}).resizable({handles:"e"}).css("width","").css("position","absolute").position({my:"center+"+10*t+" center+"+10*t,of:i.Window}).accordion("option","animate",200).trigger("click").find(".accordion-header .detach").attr("title",o.G_Attach).tooltip({show:!1,hide:!1,track:!0,close:i.proxy(function(e,t){this.$el.find(".accordion-header .detach").attr("title",this._detached?o.G_Attach:o.G_Detach)},this)}),this._detached=!0,this.position(),this.$container.trigger("property:remove")},removeTooltips:function(){i(".ui-tooltip-content").parents("div").remove()},overflow:function(e){if(this.$overflow.css("max-height",""),e){var t=i(window).height(),a=this.$el.outerHeight(!0)-this.$overflow.height();this.$overflow.css("max-height",Math.max(0,t-a)+"px")}},position:function(){if(this._detached){this.overflow(!1);var e=this.$el.offset().top;0>e&&this.$el.css("top",e=0);var t,a=e+this.$el.outerHeight(!0),n=a-i(window).height();n>0&&((t=(e-=n)<0)&&(e=0),this.$el.css("top",e),t&&this.overflow(!0))}},grid:function(e,i,n,o,r){if(i){var s=new a.Grid(r=t.extend({columns:e,collection:i,pageable:!0,footer:a.Paginators.Mini,noRows:o},r||{}));return n.html(s.render().$el),r.pageable&&s.paginate(1,5),s}o&&n.html(o)},failed:function(){(new n).open(o.E_DataLoad)},showSavedState:function(){this.$statusSaved.stop().fadeIn().delay(2e3).fadeOut()},showErrorState:function(){this.$statusError.stop().fadeIn().delay(2e3).fadeOut()}})}),define("regex-weburl",[],function(){var e=new RegExp("^(?:(?:https?|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))\\.?)(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");return e}),define("text!includes/devices/CustomUpgradeDialogTemplate.html",[],function(){return'<div class="dialog-content custom-upgrade-dialog-content">\n    <div class="content-area">\n        <form name="customUpgradeForm" class="ui-form clearfix">\n            <fieldset class="fieldset">\n                <div class="row">\n                    <label><%- msg.G_UpgradeUrlPrompt %></label>\n                </div>\n                <br/>\n                <div class="row">\n                    <input name="upgrade-url" type="text" placeholder="<%- msg.G_UpgradeUrlPlaceholder %>" class="input upgrade-url" tabindex="1" />\n                </div>\n            </fieldset>\n        </form>\n    </div>\n</div>'}),define("ubnt/view/dialogs/CustomUpgradeDialogView",["underscore","ubnt/view/dialogs/DialogView","msg/Msg","jquery","xregexp","regex-weburl","text!includes/devices/CustomUpgradeDialogTemplate.html","libs/jquery.validate"],function(e,t,i,a,n,o,r){"use strict";return t.extend({_fullyQualifiedName:"UBNT.views.devices.CustomUpgradeDialog",initialize:function(a){e.bindAll(this);this.template=e.template(r);var n={title:i.G_PropertiesCustomUpgrade,autoOpen:!0,width:440,resizable:!1,draggable:!1,modal:!0,dialogClass:"ubnt-devices-custom-upgrade-dialog",CancelButton:{buttonClass:"ui-button-cancel button auto",handler:this.close},UpgradeButton:{buttonClass:"ui-button-positive button auto red",handler:this.doneHandler},buttons:{},close:this.destroy};n.buttons[i.G_Upgrade]=n.UpgradeButton,n.buttons[i.G_Cancel]=n.CancelButton,a.dialogOptions=e.extend(n,a.dialogOptions||{}),t.prototype.initialize.apply(this,[a])},initValidation:function(){var e=this;a.validator.addMethod("custom_xregex",function(e,t){var i=new n(o);return this.optional(t)||i.test(e)},i.G_UpgradeUrlError),this.$form.validate({rules:{"upgrade-url":{required:!0,custom_xregex:!0}},submitHandler:function(){e.options.upgradeHandler(e.$el.find('input[name="upgrade-url"]').val()),e.close()}})},render:function(){var e={msg:i};t.prototype.render.apply(this,[{template_json:e}]),this.isRenderedd||(this.isRenderedd=!0,this.$form=this.$('form[name="customUpgradeForm"]'),this.initValidation())},doneHandler:function(){this.$form.submit()},remove:function(){this.isRenderedd=!1,t.prototype.remove.apply(this,arguments)}})}),function(e){Backbone.Stickit={_handlers:[],addHandler:function(e){e=_.map(_.flatten([e]),function(e){return _.extend({updateModel:!0,updateView:!0,updateMethod:"text"},e)}),this._handlers=this._handlers.concat(e)}},_.extend(Backbone.View.prototype,{_modelBindings:null,unstickit:function(e){_.each(this._modelBindings,_.bind(function(t,i){return e&&t.model!==e?!1:(t.model.off(t.event,t.fn),void delete this._modelBindings[i])},this)),this._modelBindings=_.compact(this._modelBindings),this.$el.off(".stickit"+(e?"."+e.cid:""))},stickit:function(e,t){var a=this,u=e||this.model,h=".stickit."+u.cid,g=t||this.bindings||{};this._modelBindings||(this._modelBindings=[]),this.unstickit(u),_.each(_.keys(g),function(e){var t,p,y,f,v=g[e]||{},b=_.uniqueId();":el"!=e?t=a.$(e):(t=a.$el,e=""),t.length&&(_.isString(v)&&(v={observe:v}),f=c(t,v),y=f.observe,p=_.extend({bindKey:b},f.setOptions||{}),l(a,t,f,u,y),d(a,t,f,u,y),y&&(_.each(f.events||[],function(i){var o=i+h,s=function(e){var i=f.getVal.call(a,t,e,f);n(a,f.updateModel,i,f)&&r(u,y,i,p,a,f)};""===e?a.$el.on(o,s):a.$el.on(o,e,s)}),_.each(_.flatten([y]),function(e){o(u,a,"change:"+e,function(e,i,n){(null==n||n.bindKey!=b)&&m(a,t,f,s(e,y,f,a),e)})}),m(a,t,f,s(u,y,f,a),u,!0)),i(a,f.initialize,t,u,f))}),this.remove=_.wrap(this.remove,function(e){a.unstickit(),e&&e.call(a)})}});var t=function(e,t){var i=(t||"").split("."),a=_.reduce(i,function(e,t){return e[t]},e);return null==a?e:a},i=function(e,t){return t?(_.isString(t)?e[t]:t).apply(e,_.toArray(arguments).slice(2)):void 0},a=function(e){return e.find("option").not(function(){return!this.selected})},n=function(e,t){return _.isBoolean(t)?t:_.isFunction(t)||_.isString(t)?i.apply(this,_.toArray(arguments)):!1},o=function(e,t,i,a){e.on(i,a,t),t._modelBindings.push({model:e,event:i,fn:a})},r=function(e,t,a,n,o,r){r.onSet&&(a=i(o,r.onSet,a,r)),e.set(t,a,n)},s=function(e,t,a,n){var o,r=function(t){var i=a.escape?e.escape(t):e.get(t);return _.isUndefined(i)?"":i};return o=_.isArray(t)?_.map(t,r):r(t),a.onGet?i(n,a.onGet,o,a):o},c=function(e,t){var i=[{updateModel:!1,updateView:!0,updateMethod:"text",update:function(e,t,i,a){e[a.updateMethod](t)},getVal:function(e,t,i){return e[i.updateMethod]()}}];_.each(Backbone.Stickit._handlers,function(t){e.is(t.selector)&&i.push(t)}),i.push(t);var a=_.extend.apply(_,i);return delete a.selector,a},l=function(e,t,i,a,n){var r=["autofocus","autoplay","async","checked","controls","defer","disabled","hidden","loop","multiple","open","readonly","required","scoped","selected"];_.each(i.attributes||[],function(i){var c="",l=i.observe||(i.observe=n),d=function(){var n=_.indexOf(r,i.name,!0)>-1?"prop":"attr",o=s(a,l,i,e);"class"==i.name?(t.removeClass(c).addClass(o),c=o):t[n](i.name,o)};_.each(_.flatten([l]),function(t){o(a,e,"change:"+t,d)}),d()})},d=function(e,t,a,n,r){if(null!=a.visible){var c=function(){var o=a.visible,c=a.visibleFn,l=s(n,r,a,e),d=!!l;(_.isFunction(o)||_.isString(o))&&(d=i(e,o,l,a)),c?i(e,c,t,d,a):d?t.show():t.hide()};_.each(_.flatten([r]),function(t){o(n,e,"change:"+t,c)}),c()}},m=function(e,t,a,o,r,s){n(e,a.updateView,o,a)&&(a.update.call(e,t,o,r,a),s||i(e,a.afterUpdate,t,o,a))};Backbone.Stickit.addHandler([{selector:'[contenteditable="true"]',updateMethod:"html",events:["keyup","change","paste","cut"]},{selector:"input",events:["keyup","change","paste","cut"],update:function(e,t){e.val(t)},getVal:function(e){var t=e.val();return e.is('[type="number"]')?null==t?t:Number(t):t}},{selector:"textarea",events:["keyup","change","paste","cut"],update:function(e,t){e.val(t)},getVal:function(e){return e.val()}},{selector:'input[type="radio"]',events:["change"],update:function(e,t){e.filter('[value="'+t+'"]').prop("checked",!0)},getVal:function(e){return e.filter(":checked").val()}},{selector:'input[type="checkbox"]',events:["change"],update:function(t,i,a,n){t.length>1?(i||(i=[]),_.each(t,function(t){_.indexOf(i,e(t).val())>-1?e(t).prop("checked",!0):e(t).prop("checked",!1)})):_.isBoolean(i)?t.prop("checked",i):t.prop("checked",i==t.val())},getVal:function(t){var i;if(t.length>1)i=_.reduce(t,function(t,i){return e(i).prop("checked")&&t.push(e(i).val()),t},[]);else{i=t.prop("checked");var a=t.val();"on"!=a&&null!=a&&(i=i?t.val():null)}return i}},{selector:"select",events:["change"],update:function(a,n,o,r){var s,c=r.selectOptions,l=c&&c.collection||void 0,d=a.prop("multiple");if(!c){c={};var m=function(e){return e.find("option").map(function(){return{value:this.value,label:this.text}}).get()};a.find("optgroup").length?(l={opt_labels:[]},_.each(a.find("optgroup"),function(t){var i=e(t).attr("label");l.opt_labels.push(i),l[i]=m(e(t))})):l=m(a)}c.valuePath=c.valuePath||"value",c.labelPath=c.labelPath||"label";var u=function(i,a,n){c.defaultOption&&(i=_.clone(i),i.unshift("__default__")),_.each(i,function(i){var o=e("<option/>"),r=i,s=function(e,t){o.text(e),r=t,o.data("stickit_bind_val",r),_.isArray(r)||_.isObject(r)||o.val(r)};"__default__"===i?s(c.defaultOption.label,c.defaultOption.value):s(t(i,c.labelPath),t(i,c.valuePath)),!d&&null!=r&&null!=n&&r==n||_.isObject(n)&&_.isEqual(r,n)?o.prop("selected",!0):d&&_.isArray(n)&&_.each(n,function(e){_.isObject(e)&&(e=t(e,c.valuePath)),(e==r||_.isObject(e)&&_.isEqual(r,e))&&o.prop("selected",!0)}),a.append(o)})};a.html("");var h=function(e,i){var a=window;return 0===i.indexOf("this.")&&(a=e),i=i.replace(/^[a-z]*\.(.+)$/,"$1"),t(a,i)};s=_.isString(l)?h(this,l):_.isFunction(l)?i(this,l,a,r):l,s instanceof Backbone.Collection&&(s=s.toJSON()),_.isArray(s)?u(s,a,n):_.each(s.opt_labels,function(t){var i=e("<optgroup/>").attr("label",t);u(s[t],i,n),a.append(i)})},getVal:function(t){var i;return i=t.prop("multiple")?e(a(t).map(function(){return e(this).data("stickit_bind_val")})).get():a(t).data("stickit_bind_val")}}])}(window.jQuery||window.Zepto),define("stickit",["backbone"],function(){}),define("unifi/view/devices/PropertyView",["unifi/view/app/PropertyView","ubnt/backgrid","underscore","backbone","jquery","msg/Msg","ubnt/view/dialogs/ConfirmDialogView","ubnt/view/dialogs/CustomUpgradeDialogView","stickit"],function(e,t,i,a,n,o,r,s){"use strict";return e.extend({initialize:function(t){e.prototype.initialize.call(this,t),this.model.on("change",this.populate),n.when(this._rendered=n.Deferred(),this._dependencies=n.Deferred()).then(this.populate,this.failed),this.dependencies(),this.render()},bindings:function(){return{".button-locate":{observe:["state","map_id","default","upgradable","locating"],onGet:function(){1==this.model.get("state")?this.$btnLocate.show():this.$btnLocate.hide(),this.model.get("adopted")&&(this.$btnLocate.removeClass("on"),this.model.get("locating")?this.$btnLocate.addClass("locating"):this.$btnLocate.removeClass("locating")),1==this.model.get("state")?this.$btnRestart.show():this.$btnRestart.hide(),2!=this.model.get("state")&&12!=this.model.get("state")||!this.model.get("default")?this.$btnAdopt.hide():"scan"==this.model.get("discovered_via")&&this.model.get("vwireEnabled")===!1?this.$btnAdopt.hide():this.$btnAdopt.show(),5==this.model.get("state")&&this.$btnAdopt.hide(),1==this.model.get("state")&&this.model.get("upgradable")===!0?this.$btnUpdate.show():this.$btnUpdate.hide()}},".bind-status":{observe:"state",onGet:function(){this.$statusBar.removeClass("ok pending error").addClass(this.model.statusType()).text(this.model.status())}},".bind-version":"version",".bind-ip":"ip",".bind-uptime":{observe:"uptime",onGet:function(){this.$bindUptime.text(this.model.uptime())}},".bind-adopt-ip":{observe:["adopt_ip","ip"],onGet:function(){return this.model.adoptIp()}},".bind-adopt-port":{observe:["sshd_port"],onGet:function(){return this.model.adoptPort()}},".bind-adopt-url":{observe:["adopt_url","inform_url"],onGet:function(){return this.model.adoptUrl()}}}},dependencies:function(){this._dependencies.resolve()},render:function(t){var i=this.rendered;return e.prototype.render.call(this,t),i||(this.$statusBar=this.$(".device-status"),this.$bindUptime=this.$(".bind-uptime"),this.$aliasForm=this.$(".aliasForm"),this.$forget=this.$(".forget"),this.$customUpgrade=this.$("button.custom-upgrade"),this.$moveDropdown=this.$(".move-dropdown"),this.$copyConfigDropdown=this.$(".copyConfig-dropdown"),this.$btnUpdate=this.$(".button-update"),this.$btnAdopt=this.$(".button-adopt"),this.$btnLocate=this.$(".button-locate"),this.$btnRestart=this.$(".button-restart"),this.$aliasForm.on("submit",this.updateAlias),this.$forget.on("click",this.forget),this.$moveDropdown.on("change",this.moveDropdownChange),this.$copyConfigDropdown.on("change",this.copyConfigDropdownChange),this.$btnAdopt.on("click",this.adopt),this.$btnUpdate.on("click",this.upgrade),this.$btnLocate.on("click",this.locate),this.$btnRestart.on("click",this.restart),this.$customUpgrade.on("click",this.customUpgradeDialog)),this},populate:function(){if(this._dependencies&&"resolved"==this._dependencies.state()){this.$el.find(".property-content .loading").remove(),this.$el.removeClass("ap-connected ap-disconnected ap-upgradable ap-adopted ap-pending ap-adoptfailed ap-adopting ap-unmanaged has-uplink-dev"),this.$el.addClass("device-properties"),this.$el.addClass("mac-"+this.model.get("mac").replace(/:/g,"")),this.$el.addClass("ap-model-"+this.model.get("model")),this.model.isConnected()?(this.$el.addClass("ap-connected"),this.model.get("upgradable")&&this.$el.addClass("ap-upgradable")):this.$el.addClass("ap-disconnected"),this.model.get("adopted")?(this.$el.addClass("ap-adopted"),10==parseInt(this.model.get("state"),10)&&this.$el.addClass("ap-adoptfailed")):(this.$el.addClass("ap-pending"),this.model.get("default")||this.$el.addClass("ap-unmanaged")),"Adopting"===this.model.status()&&(this.$el.addClass("ap-adopting"),this.$el.find(".basic-overview").show());var e=this.model.uplinkDeviceMac();""!==e&&this.$el.addClass("has-uplink-dev"),this.setupMoveDropdown(),this.setupCopyConfigDropdown()}},populateNetworkForm:function(e,t,i){e[0].reset();var a="config_network_wan2"===i?this.$connection2Type:this.$connectionType;"pppoe"==t.type?(a.val("pppoe").trigger("change"),e.find("input[name=username]").val(t.username),e.find("input[name=x_password]").val(t.x_password),e.find("input[name=dns1]").val(t.dns1),e.find("input[name=dns2]").val(t.dns2),e.find("input[name=dnssuffix]").val(t.dnssuffix),e.find("input[name=vlanEnabled]").prop("checked",t.vlan_enabled),e.find("input[name=vlan]").val(t.vlan)):"static"==t.type?(a.val("static").trigger("change"),e.find("input[name=ip]").val(t.ip),e.find("input[name=netmask]").val(t.netmask),e.find("input[name=gateway]").val(t.gateway),e.find("input[name=dns1]").val(t.dns1),e.find("input[name=dns2]").val(t.dns2),e.find("input[name=dnssuffix]").val(t.dnssuffix),e.find("input[name=vlanEnabled]").prop("checked",t.vlan_enabled),e.find("input[name=vlan]").val(t.vlan)):"dhcp"==t.type?(a.val("dhcp").trigger("change"),e.find("input[name=dns1]").val(t.dns1),e.find("input[name=dns2]").val(t.dns2),e.find("input[name=dnssuffix]").val(t.dnssuffix),e.find("input[name=vlanEnabled]").prop("checked",t.vlan_enabled),e.find("input[name=vlan]").val(t.vlan)):a.val("disabled").trigger("change")},setupMoveDropdown:function(){this.$moveDropdown.empty().append(n('<option value=""></option>').text(o.G_MoveTo)),this.app.collection("Sites").each(function(e){if(!e.get("attr_hidden")){var t=e.get("desc");e.get("_id")==SITE.id&&(t+=" (current)"),this.$moveDropdown.append(n('<option value="'+e.get("_id")+'"></option>').text(t))}},this)},setupCopyConfigDropdown:function(){this.$copyConfigDropdown.empty().append(n('<option value=""></option>').text(o.G_CopyFrom)),this.app.collection("Devices").each(function(e){var t=e.get("mac"),i=e.get("type"),a=e.get("model");if(i===this.model.typeMap["switch"]&&t!==this.model.get("mac")&&(this.model.copyConfigMap[this.model.get("model")]&&this.model.copyConfigMap[this.model.get("model")].indexOf(a)>-1||a===this.model.get("model"))){var o=e.get("name");this.$copyConfigDropdown.append(n('<option value="'+t+'"></option>').text(o?o+" ("+t+")":t))}},this)},moveDropdownChange:function(){var e=this.$moveDropdown.val(),t=this.$moveDropdown.find("option:selected").text(),i=this,a=o.localize(o.G_PropertiesMoveDeviceConfirmTxt,t,t);if(e&&e!=SITE.id){var s=new r;s.options.dialogOptions.title=o.G_PropertiesMoveDeviceConfirmTitle,s.show(a,n.proxy(function(){i.model.move({data:{site:e},success:function(e,t){n("#header .refresh-status").click()},error:n.proxy(function(e){i.app.views.app.flash("error","Error",o.apiError(e))},i)})},i)),s.closeDialog(function(){i.$moveDropdown.val("").trigger("change")},i)}},copyConfigDropdownChange:function(){var e=this,t=this.$copyConfigDropdown.val();if(t){var i=this.$copyConfigDropdown.find("option:selected").text(),a=o.localize(o.G_PropertiesCopyDeviceConfigConfirmTxt,i),s=new r;s.options.dialogOptions.title=o.G_PropertiesCopyDeviceConfigConfirmTitle,s.show(a,n.proxy(function(){e.model.copyConfig({selectedMac:t,success:function(e,t){n("#header .refresh-status").click()},error:n.proxy(function(t){e.app.views.app.flash("error","Error",o.apiError(t))},e)})})),s.closeDialog(function(){e.$copyConfigDropdown.val("").trigger("change")},e)}},updateAlias:function(){var e,t,i=this,a=this.$aliasForm.find('input[name="name"]'),o=a.val(),r=!1;return this.$aliasForm.find(".error").removeClass("error"),this.$aliasForm.find(".row-error").remove(),""===o?(r=!0,o=this.model.get("mac"),e={name:o}):e=this.$aliasForm.serializeObject(),t=this.model.save(e,{wait:!0,data:e,success:function(e,t){"ok"===t.meta.rc?(i.showSavedState(),a.val(r?"":o)):i.showErrorState()},error:function(){i.showErrorState()}}),!t&&this.model.validationError&&this.model.validationError.name&&(a.addClass("error"),this.$aliasForm.find(".row").after(n('<div class="row row-error"></div>').text(this.model.validationError.name))),!1},updateNetwork:function(e,t){e.find(".error-msg").remove();var a={},o="config_network_wan2"===t?this.$connection2Type.val():this.$connectionType.val();switch(o){case"pppoe":a[t]={type:"pppoe",username:e.find("input[name=username]").val(),x_password:e.find("input[name=x_password]").val(),dns1:e.find("input[name=dns1]").val(),dns2:e.find("input[name=dns2]").val(),dnssuffix:e.find("input[name=dnssuffix]").val(),vlan_enabled:e.find("input[name=vlanEnabled]").is(":checked"),vlan:parseInt(e.find("input[name=vlan]").val(),10)},a[t].dns1||delete a[t].dns1,a[t].dns2||delete a[t].dns2,a[t].dnssuffix||delete a[t].dnssuffix,a[t].vlan_enabled||delete a[t].vlan_enabled,a[t].vlan||delete a[t].vlan;break;case"static":a[t]={type:"static",ip:e.find("input[name=ip]").val(),netmask:e.find("input[name=netmask]").val(),gateway:e.find("input[name=gateway]").val(),dns1:e.find("input[name=dns1]").val(),dns2:e.find("input[name=dns2]").val(),dnssuffix:e.find("input[name=dnssuffix]").val(),vlan_enabled:e.find("input[name=vlanEnabled]").is(":checked"),vlan:parseInt(e.find("input[name=vlan]").val(),10)},a[t].gateway||delete a[t].gateway,a[t].dns1||delete a[t].dns1,a[t].dns2||delete a[t].dns2,a[t].dnssuffix||delete a[t].dnssuffix,a[t].vlan_enabled||delete a[t].vlan_enabled,a[t].vlan||delete a[t].vlan;break;case"dhcp":a[t]={type:"dhcp",dns1:e.find("input[name=dns1]").val(),dns2:e.find("input[name=dns2]").val(),dnssuffix:e.find("input[name=dnssuffix]").val(),vlan_enabled:e.find("input[name=vlanEnabled]").is(":checked"),
vlan:parseInt(e.find("input[name=vlan]").val(),10)},a[t].dns1||delete a[t].dns1,a[t].dns2||delete a[t].dns2,a[t].dnssuffix||delete a[t].dnssuffix,a[t].vlan_enabled||delete a[t].vlan_enabled,a[t].vlan||delete a[t].vlan;break;case"disabled":a[t]={type:"disabled"}}e.find(".error").removeClass("error");var r=this.model.save(a,{success:n.proxy(function(e,t){"ok"===t.meta.rc?this.showSavedState():this.showErrorState()},this),error:n.proxy(function(){this.showErrorState()},this)});!r&&this.model.validationError&&this.model.validationError[t]&&i.each(this.model.validationError[t],function(t,i){switch(i){case"username":case"x_password":case"ip":case"netmask":case"gateway":case"dns1":case"dns2":case"dnssuffix":case"vlan":e.find('input[name="'+i+'"]').addClass("error").parent().append('<div class="span error-msg">'+t+"</div>")}},this)},forget:function(){var e=new r;return e.options.dialogOptions.title=o.G_PropertiesForgetDeviceConfirmTitle,e.show(o.G_PropertiesForgetDeviceConfirmTxt,n.proxy(function(){this.model.forget({success:n.proxy(function(){this.app.collection("Devices").remove(this.model),this.remove()},this),error:n.proxy(function(e){this.app.views.app.flash("error","Error",o.apiError(e))},this)})},this)),!1},adopt:function(){return this.parent.rowAdopt(this.model),!1},upgrade:function(){return this.parent.rowUpgrade(this.model),!1},locate:function(){return this.parent.rowLocate(this.model),!1},restart:function(){return this.parent.rowRestart(this.model),!1},customUpgradeDialog:function(){this.customUpgradeDialog=new s({upgradeHandler:this.customUpgradeConfirmDialog}),this.$customUpgradeDialog=this.customUpgradeDialog.render(),this.customUpgradeDialog.show()},customUpgradeConfirmDialog:function(e){var t=this,i=new r;i.options.dialogOptions.title=o.G_PropertiesConfirmCustomUpgrade,i.options.dialogOptions.width=440,i.show(o.G_PropertiesConfirmCustomUpgradeText,function(){t.model.customUpgrade({upgradePath:e})})},remove:function(){this.model.off("change",this.populate),this.$aliasForm.off(),this.$forget.off(),this.$moveDropdown.off(),this.$btnAdopt.off(),this.$btnUpdate.off(),this.$btnLocate.off(),this.$btnRestart.off(),this.rendered=!1,e.prototype.remove.call(this)}})}),define("unifi/model/RfItemModel",["backbone","underscore"],function(e,t){"use strict";return e.Model.extend({defaults:{utilization:0,interference:0,frequencies:[],channels:[]}})}),define("unifi/view/aps/RfItemView",["backbone","jquery","libs/d3"],function(e,t,i){"use strict";return e.View.extend({TRAPEZOID_X_OFFSET:8,render:function(){var e,t=this.model.get("width"),a=this.options.frequencies[0],n=a-10,o=n+t,r=0,s=0;switch(t){case 80:e=4,r=-90,s=-26;break;case 40:e=2,r=-93,s=-29;break;default:r=-96,s=-32,e=1}this.svgEl=i.select(this.el).append("svg"),this.svgEl.attr("data-channel",this.model.get("channel")).attr("data-start-frequency",n).attr("data-end-frequency",o).attr("data-utilization",this.model.get("utilization")).attr("data-interference",this.model.get("interference")).attr("data-interference-histogram",this.model.get("rssi_histogram")).attr("data-interference-types",this.model.get("interference_type")).attr("class","unifiRf__item unifiRf__item--"+e).attr("data-interference-histogram-start_dbm",r).attr("data-interference-histogram-end_dbm",s),this._renderBackgroundRectangle(),this._renderLevelRectangle(),this._renderValue()},_renderBackgroundRectangle:function(){var e=t(this.svgEl.node()).width(),i=t(this.svgEl.node()).height(),a=this.svgEl.append("rect").attr("width",e).attr("height",i).attr("class","unifiRf__itemBackground");if(this.options.radioChannelWidth==this.model.get("width")&&this.options.highlightChannel==this.model.get("channel")){var n=(this.model.get("utilization"),this.model.get("interference")),o=this._calculateHue(n),r="stroke: hsl("+o+", 75%, 50%) !important; stroke-width: 2px";a.attr("style",r)}},_renderLevelRectangle:function(){var e=this.model.get("utilization"),i=this.model.get("interference"),a=t(this.svgEl.node()).width(),n=t(this.svgEl.node()).height(),o=n*e/100,r=n-o,s=this._calculateHue(i),c="fill: hsl("+s+", 75%, 50%) !important";this.svgEl.append("rect").attr("width",a).attr("height",o).attr("style",c).attr("y",r).attr("class","unifiRf__itemLevel")},_renderValue:function(){this.svgEl.append("svg:text").attr("class","unifiRf__value").attr("x","50%").attr("y","50%").attr("dy","30px").text(this.model.get("channel"))},_calculateHue:function(e){var t=120,i=32,a=96,n=(a- -e)/(a-i)*100,o=n/100*t;return t-o}})}),define("unifi/view/aps/RfLegendView",["underscore","backbone","jquery","libs/d3"],function(e,t,i,a){"use strict";return t.View.extend({options:{precision:15,maxHueValue:120,itemHeight:5,padding:1,labels:[-96,-80,-64,-48,-32]},render:function(){this.svgEl=a.select(this.el).append("svg"),this._renderColorItems(),this._renderLabels()},_renderColorItems:function(){for(var e=this.options.padding,t=i(this.svgEl.node()).width(),a=i(this.svgEl.node()).height(),n=this.options.precision,o=(t-e)/n+e/n,r=a-this.options.itemHeight,s=0;n>s;s++){var c=o*s+(s>0?e*s:0),l=this._calculateHue(s),d="hsl("+l+", 75%, 50%)";this.svgEl.append("rect").attr("x",c).attr("y",r).attr("width",o).attr("height",a).attr("fill",d)}},_renderLabels:function(){for(var e=this.options.labels,t=i(this.svgEl.node()).width(),a=this.svgEl.append("g"),n=0;n<e.length;n++){var o=t/(e.length-1)*n;a.append("svg:text").attr("class","unifiRf__legendLabel").attr("x",o).attr("y","0").attr("dy","8px").text(e[n])}},_calculateHue:function(e){var t=e/(this.options.precision-1)*this.options.maxHueValue;return this.options.maxHueValue-t}})}),define("unifi/view/aps/RfInterferenceLevelView",["underscore","backbone","jquery","libs/d3"],function(e,t,i,a){"use strict";return t.View.extend({options:{minValue:0,maxValue:10,minOpacity:0,maxOpacity:100},render:function(){this.svgEl=a.select(this.el).append("svg"),this._renderHistogram()},_renderHistogram:function(){var e=i(this.svgEl.node()).width(),t=i(this.svgEl.node()).height(),a=this.model.get("interference"),n=this.options.maxValue,o=this.options.minValue,r=Math.round(e/a.length);this.svgEl.append("rect").attr("class","background").attr("x",0).attr("y",0).attr("width",32*r).attr("height",t);for(var s=0;s<a.length;s++){var c=r*s,l=this._calculateOpacity(a[s],n,o)/100;this.svgEl.append("rect").attr("x",c).attr("y",0).attr("width",r).attr("height",t).attr("fill-opacity",l)}},_calculateOpacity:function(e,t,i){t>this.options.maxValue&&(t=this.options.maxValue),i<this.options.minValue&&(i=this.options.minValue);var a=t-i,n=this.options.maxOpacity-this.options.minOpacity;return(e-i)*n/a+this.options.minOpacity}})}),define("text!includes/aps/rfEnvironmentTemplate.html",[],function(){return'<div class="unifiRf__items">\n    <div class="unifiRf__scrollable">\n        <% bandwidthGroups.forEach(function(group) { %>\n        <div class="unifiRf__row unifiRf__row<%- group.width %>">\n            <div class="unifiRf__bandwidthLegend"><%- group.width %> MHz</div>\n        </div>\n        <% }); %>\n    </div>\n</div>\n'}),define("text!includes/aps/rfTooltipTemplate.html",[],function(){return'<div class="unifiRf__tooltip">\n    <h2>Channel <%- channel %></h2>\n    <h3><%- startFrequency %> - <%- endFrequency %></h3>\n\n    <dl>\n        <dt class="unifiRf__tooltipKey unifiRf__tooltipKey--inline"><%- msg.G_PropertiesRFUtilization %>:</dt>\n        <dd class="unifiRf__tooltipValue unifiRf__tooltipValue--inline unifiRf__tooltipValue--highlighted"><%- utilization %>%</dd>\n        <br/>\n\n        <dt class="unifiRf__tooltipKey unifiRf__tooltipKey--inline"><%- msg.G_PropertiesRFInterference %>:</dt>\n        <dd class="unifiRf__tooltipValue unifiRf__tooltipValue--inline unifiRf__tooltipValue--highlighted"><%- interference %><%- msg.G_PropertiesDBM %></dd>\n\n        <dd class="unifiRf__tooltipValue">\n            <div class="unifiRf__interferenceLevel"></div>\n            <div class="unifiRf__interferenceLevelLegend">\n                <div class="unifiRf__interferenceLevelLegend--left"><%- startDbm %></div>\n                <div class="unifiRf__interferenceLevelLegend--right"><%- endDbm %></div>\n            </div>\n        </dd>\n\n        <dt class="unifiRf__tooltipKey"><%- msg.G_PropertiesRFInterferenceTypes %>:</dt>\n        <dd class="unifiRf__tooltipValue interference">\n            <% interferenceTypes.forEach(function(interferenceType) { %>\n            <div class="interference-type">\n	            <span class="interference-icon interference-<%- interferenceType %> half"></span>\n	            <span class="interference-title"><%- interferenceType %></span>\n	        </div>\n            <% }); %>\n        </dd>\n    </dl>\n</div>\n'}),define("unifi/view/aps/RfEnvironmentView",["underscore","backbone","jquery","unifi/model/RfItemModel","unifi/view/aps/RfItemView","unifi/view/aps/RfLegendView","unifi/view/aps/RfInterferenceLevelView","text!includes/aps/rfEnvironmentTemplate.html","text!includes/aps/rfTooltipTemplate.html","msg/Msg"],function(e,t,i,a,n,o,r,s,c,l){"use strict";return t.View.extend({initialize:function(e){t.View.prototype.initialize.call(this,e),this.bandwidthGroups=this._getProcessedBandwidthGroups(),this.radioChannel=e.radioChannel,this.radioChannelWidth=e.radioChannelWidth,this.radioHt=e.radioHt},_getProcessedBandwidthGroups:function(){var t=this.model.get("bandwidthGroups"),i=e.chain(t).groupBy("width").map(function(e,t){return{width:t,data:e}}).value();return i.reverse()},render:function(){this._renderLayout(),this._renderItems(),this._setupTooltips()},_renderLayout:function(){this.$el.html(e.template(s,{bandwidthGroups:this.bandwidthGroups}))},_renderItems:function(){e.each(this.bandwidthGroups,e.bind(function(t){var i=this._highlightChannel(t.data,this.radioChannel);e.each(t.data,e.bind(function(e){var o=this.$(".unifiRf__row"+t.width),r=new n({el:o,model:new a(e),radioChannel:this.radioChannel,radioChannelWidth:this.radioChannelWidth,frequencies:e.frequencies,highlightChannel:i});r.render()},this))},this))},_highlightChannel:function(e,t){for(var i=0;i<e.length-1;i++)if(e[i].channel<=t&&e[i+1].channel>t)return e[i].channel;return e[e.length-1].channel},_setupTooltips:function(){this.$(".unifiRf__item").attr("title","").tooltip({show:!1,hide:!1,content:function(){var t=i(this),a={msg:l,channel:t.attr("data-channel"),startFrequency:t.attr("data-start-frequency"),endFrequency:t.attr("data-end-frequency"),utilization:t.attr("data-utilization"),interference:t.attr("data-interference"),interferenceTypes:t.attr("data-interference-types").split(","),startDbm:t.attr("data-interference-histogram-start_dbm"),endDbm:t.attr("data-interference-histogram-end_dbm")};return e.template(c,a)},position:{at:"center+20 top-2",my:"right bottom"},open:function(e,a){i(".ui-tooltip:not(:last-child)").remove();var n=i(this),o=new r({el:i(a.tooltip[0]).find(".unifiRf__interferenceLevel"),model:new t.Model({interference:n.attr("data-interference-histogram").split(",")})});o.render()}})}})}),define("text!includes/aps/apPropertiesTemplate.html",[],function(){return'<div class="accordion-header">\n    <div class="accordion-title">\n        <span class="device-icons access-point half"></span>\n        <span class="title-text"><%- name() %></span>\n        <div class="ubnt-icon-arrow-down sidebar-icons minmax minimize"></div>\n    </div>\n    <div class="right">\n        <div class="ubnt-icon-new-window sidebar-icons detach" title="Detach"></div>\n        <div class="ubnt-icon-close sidebar-icons remove" title="Close"></div>\n    </div>\n</div>\n<div class="property-content">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n\n    <div class="device-status-wrapper">\n        <div class="device-status bind-status"></div>\n    </div>\n    <div class="status-alert status-success"><span class="ubnt-icon-check checkmark"></span><%- msg.G_Saved %></div>\n    <div class="status-alert status-error"><span class="ubnt-icon-warning alert"></span><%- msg.E_Error %></div>\n    <div class="tabs">\n        <ul>\n            <li class="tab-nav-list-item">\n                <a class="tab-button" href="#deviceDetails<%- _id %>"><%- msg.G_PropertiesDetails %></a>\n            </li>\n            <li class="tab-nav-list-item station-details">\n                <a class="tab-button" href="#deviceUsers<%- _id %>"><%- msg.G_Users %></a>\n            </li>\n            <li class="tab-nav-list-item station-details">\n                <a class="tab-button" href="#deviceGuests<%- _id %>"><%- msg.G_Guests %></a>\n            </li>\n            <li class="tab-nav-list-item ap-configs">\n                <a class="tab-button" href="#deviceConfig<%- _id %>"><%- msg.G_PropertiesConfiguration %></a>\n            </li>\n        </ul>\n        <div class="properties-container overflow">\n            <div id="deviceDetails<%- _id %>" class="tab-content">\n                <div class="accordion">\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_DevicesOverview %></div>\n                    </div>\n                    <div class="basic-overview">\n                        <table>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesMACAddress %></td>\n                                <td class="column-value"><%- get(\'mac\') %></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_DevicesModel %></td>\n                                <td class="column-value"><%- apModel() %></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Version %></td>\n                                <td class="column-value bind-version"></td>\n                            </tr>\n                        </table>\n                        <hr />\n                        <table>\n                            <tr class="table-row ip-address">\n                                <td class="column-name"><%- msg.G_IPAddress %></td>\n                                <td class="column-value bind-ip"></td>\n                            </tr>\n                            <tr class="table-row uptime">\n                                <td class="column-name"><%- msg.G_Uptime %></td>\n                                <td class="column-value bind-uptime"></td>\n                            </tr>\n                            <tr class="table-row last-uplink">\n                                <td class="column-name"><%- msg.G_LastUplink %></td>\n                                <td class="column-value">\n                                    <a class="bind-lastuplink button-uplink-device" href="#"></a>\n                                </td>\n                            </tr>\n                            <tr class="table-row last-seen">\n                                <td class="column-name"><%- msg.G_LastSeen %></td>\n                                <td class="column-value bind-lastseen"></td>\n                            </tr>\n                        </table>\n                        <hr class="station-details" />\n                        <table class="station-details">\n                            <tr class="table-row">\n                                <td class="column-name"># <%- msg.G_Users %></td>\n                                <td class="column-value bind-num-users"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"># <%- msg.G_Guests %></td>\n                                <td class="column-value bind-num-guests"></td>\n                            </tr>\n                        </table>\n                    </div>\n                    <div class="accordion-header ap-uplink-details">\n                        <div class="accordion-title"><%- msg.G_PropertiesUplink %> <span class="uplink-type"></span></div>\n                    </div>\n                    <div class="ap-uplink-details">\n                        <table class="wireless">\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesUplinkAP %></td>\n                                <td class="column-value">\n                                    <a class="bind-uplink-device button-uplink-device" href="#"></a>\n                                </td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesSignal %></td>\n                                <td class="column-value bind-uplink-rssi"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesTXRate %></td>\n                                <td class="column-value bind-uplink-tx-rate"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesRXRate %></td>\n                                <td class="column-value bind-uplink-rx-rate"></td>\n                            </tr>\n                        </table>\n                        <table class="wire">\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Speed %></td>\n                                <td class="column-value bind-uplink-speed"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesDuplex %></td>\n                                <td class="column-value bind-uplink-duplex"></td>\n                            </tr>\n                            <tr class="table-row uplink-device">\n                                <td class="column-name"><%- msg.G_PropertiesUplink %></td>\n                                <td class="column-value">\n                                    <a class="bind-uplink-device button-uplink-device" href="#"></a>\n                                </td>\n                            </tr>\n                        </table>\n                        <hr />\n                        <table>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesDownPktsBytes %></td>\n                                <td class="column-value bind-uplink-down-packets"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesUpPktsBytes %></td>\n                                <td class="column-value bind-uplink-up-packets"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Activity %></td>\n                                <td class="column-value bind-uplink-activity"></td>\n                            </tr>\n                        </table>\n                    </div>\n                    <div class="accordion-header ap-adv-adopt">\n                        <div class="accordion-title"><%- msg.G_PropertiesAdvancedOpts %></div>\n                    </div>\n                    <div class="ap-adv-adopt">\n                        <form action="" class="advAdoptForm ap-adv-adopt">\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_IP %></label>\n                                <input class="input inline medium bind-adopt-ip" type="text" value="" name="ip" />\n                                <span class="colon">:</span>\n                                <input class="input inline small" type="text" value="22" name="port" />\n                            </div>\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_UN %></label>\n                                <input class="input inline" type="text" value="" name="username" />\n                            </div>\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_PW %></label>\n                                <input class="input inline" type="password" value="" name="password" />\n                            </div>\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_PropertiesInformURL %></label>\n                                <input class="input inline bind-adopt-url" type="text" value="" name="url" />\n                            </div>\n                            <button class="button is-admin" type="submit"><%- msg.G_Adopt %></button>\n                        </form>\n                    </div>\n                    <div class="accordion-header ap-downlink-details">\n                        <div class="accordion-title"><%- msg.G_PropertiesDownlinks %></div>\n                    </div>\n                    <div class="ap-downlink-details ap-downlink-content">\n                        <div class="data-table data-table-downlinks bind-downlinks"></div>\n                    </div>\n                    <div class="accordion-header radio-ng ap-ng-details">\n                        <div class="accordion-title"><%- msg.G_PropertiesRadio11NBG %></div>\n                    </div>\n                    <div class="radio-ng ap-ng-details">\n                        <table>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Channel %></td>\n                                <td class="column-value bind-ng-channel"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesTransmitPower %></td>\n                                <td class="column-value"><span class="bind-ng-transmit-power"></span></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesTXPktsBytes %></td>\n                                <td class="column-value bind-ng-tx-packets"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesRXPktsBytes %></td>\n                                <td class="column-value bind-ng-rx-packets"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesTXRetryDropped %></td>\n                                <td class="column-value bind-ng-tx-retry"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesRXRetryDropped %></td>\n                                <td class="column-value bind-ng-rx-retry"></td>\n                            </tr>\n                        </table>\n                        <hr />\n                        <table>\n                            <tr class="table-row">\n                                <td class="column-name"># <%- msg.G_Users %></td>\n                                <td class="column-value bind-ng-users"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"># <%- msg.G_Guests %></td>\n                                <td class="column-value bind-ng-guests"></td>\n                            </tr>\n                        </table>\n                    </div>\n                    <div class="accordion-header radio-na ap-na-details">\n                        <div class="accordion-title"><%- msg.G_PropertiesRadio11NA %></div>\n                    </div>\n                    <div class="radio-na ap-na-details">\n                        <table>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Channel %></td>\n                                <td class="column-value bind-na-channel"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesTransmitPower %></td>\n                                <td class="column-value"><span class="bind-na-transmit-power"></span></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesTXPktsBytes %></td>\n                                <td class="column-value bind-na-tx-packets"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesRXPktsBytes %></td>\n                                <td class="column-value bind-na-rx-packets"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesTXRetryDropped %></td>\n                                <td class="column-value bind-na-tx-retry"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesRXRetryDropped %></td>\n                                <td class="column-value bind-na-rx-retry"></td>\n                            </tr>\n                        </table>\n                        <hr />\n                        <table>\n                            <tr class="table-row">\n                                <td class="column-name"># <%- msg.G_Users %></td>\n                                <td class="column-value bind-na-users"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"># <%- msg.G_Guests %></td>\n                                <td class="column-value bind-na-guests"></td>\n                            </tr>\n                        </table>\n                    </div>\n\n                    <div class="accordion-header ap-rf-environment">\n                        <div class="accordion-title"><%- msg.G_PropertiesRFEnvironment %></div>\n                    </div>\n                    <div class="radio-na ap-rf-environment unifiRf">\n                        <form class="data-filters ap-rf-environment-frequency-filters clearfix">\n                            <div class="buttonset frequency-filters ui-buttonset">\n                                <input type="radio" id="frequencyFilter2G_<%- _id %>" name="ap-rf-frequency-filter" value="2G" checked="checked" /><label for="frequencyFilter2G_<%- _id %>"><%- msg.G_2G %></label>\n                                <input type="radio" id="frequencyFilter5G_<%- _id %>" name="ap-rf-frequency-filter" value="5G" /><label for="frequencyFilter5G_<%- _id %>"><%- msg.G_5G %></label>\n                            </div>\n                        </form>\n                        <div class="bind-rf-legend unifiRf__legend"></div>\n\n                        <div class="bind-rf-environment bind-rf-environment-2G"></div>\n                        <div class="bind-rf-environment bind-rf-environment-5G"></div>\n\n                        <br />\n\n                        <div class="bind-rf-environment-last-updated bind-rf-environment-last-updated-2G unifiRf__lastUpdated unifiRf__lastUpdated--inline"></div>\n                        <div class="bind-rf-environment-last-updated bind-rf-environment-last-updated-5G unifiRf__lastUpdated unifiRf__lastUpdated--inline"></div>\n                        <button class="button button-rfScan right lighter skinny unifiRf__scan is-admin">\n                            <span class="ui-button-icon-primary ubnt-icon-refresh sidebar-icons"></span>\n                            <span class="text"><%- msg.G_PropertiesRFScan %></span>\n                        </button>\n                    </div>\n\n                </div>\n            </div>\n            <div id="deviceUsers<%- _id %>" class="tab-content minigrid">\n                <div class="data-table data-table-users"><%- msg.G_PropertiesNoUsersConnected %></div>\n            </div>\n            <div id="deviceGuests<%- _id %>" class="tab-content minigrid">\n                <div class="data-table data-table-guests"><%- msg.G_PropertiesNoGuestsConnected %></div>\n            </div>\n            <div id="deviceConfig<%- _id %>" class="tab-content ap-configs">\n                <div class="accordion">\n                    <div class="accordion-header ap-configs">\n                        <div class="accordion-title"><%- msg.G_Config %></div>\n                    </div>\n                    <div class="ap-configs">\n                        <form action="" class="aliasForm">\n                            <div class="row">\n                                <label for="aliasName<%- _id %>" class="label"><%- msg.G_PropertiesAlias %></label>\n                                <input name="name" id="aliasName<%- _id %>" type="text" class="input" value="<%- get(\'name\') %>" pattern=".{1,128}" title="<%- msg.E_AliasName %>" />\n                            </div>\n                            <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n                        </form>\n                    </div>\n\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_PropertiesRadios %></div>\n                    </div>\n                    <div>\n                        <form action="" class="radiosForm">\n                            <fieldset class="fieldset radio-ng ap-ng-configs">\n                                <legend class="legend"><%- msg.G_PropertiesRadio2G11NBG %></legend>\n                                <div class="row">\n                                    <input type="hidden" class="hidden" name="ng.radio" value="ng" />\n                                    <label for="channel-radio-nbg<%- _id %>" class="label label-selectmenu"><%- msg.G_Channel %></label>\n                                    <div class="selectmenu-group">\n                                        <div>\n                                            <select name="ng.channel" id="channel-radio-nbg<%- _id %>" class="radio-channel inline"></select>\n                                        </div>\n                                        <div>\n                                            <select name="ng.ht" class="inline radio-ht" data-radio="ng">\n                                                <option value="20"><%- msg.G_PropertiesHT20 %></option>\n                                                <option value="40"><%- msg.G_PropertiesHT40 %></option>\n                                            </select>\n                                        </div>\n                                    </div>\n                                </div>\n                                <div class="row">\n                                    <label for="txPower-radio-nbg<%- _id %>" class="label label-selectmenu"><%- msg.G_PropertiesTXPower %></label>\n                                    <select name="ng.tx_power_mode" id="txPower-radio-nbg<%- _id %>" class="inline">\n                                        <option value="auto"><%- msg.G_Auto %></option>\n                                        <option value="high"><%- msg.G_High %></option>\n                                        <option value="medium"><%- msg.G_Medium %></option>\n                                        <option value="low"><%- msg.G_Low %></option>\n                                        <option value="custom"><%- msg.G_Custom %></option>\n                                    </select>\n                                </div>\n                                <div class="custom">\n                                    <div class="row">\n                                        <input class="input no-label" type="text" name="ng.tx_power" size="2" value="<%- get(\'ng.tx_power\') || \'0\' %>" />\n                                        <label class="label unit"><%- msg.G_PropertiesDBM %></label>\n                                    </div>\n                                </div>\n                                <div class="row antenna-gain">\n                                    <label class="label custom-label" for="antenna-gain<%- _id %>"><%- msg.G_PropertiesAntennaGain %></label>\n                                    <input class="custom input" id="antenna-gain<%- _id %>" type="number" max="99" min="-99" step="1" name="ng.antenna_gain" value="<%- get(\'ng.antenna_gain\') || \'6\' %>" />\n                                    <label class="label unit"><%- msg.G_PropertiesDBI %></label>\n                                </div>\n                                <div class="row">\n                                    <label for="minRssiEnabled-radio-ng<%- _id %>" class="label label-selectmenu"><%- msg.G_SettingsMinRSSI %></label>\n                                    <input class="input rssiCheckbox" type="checkbox" name="ng.min_rssi_enabled" id="minRssiEnabled-radio-ng<%- _id %>" />\n                                    <input class="input inline rssiInput" type="number" name="ng.min_rssi" id="minRssi-radio-ng<%- _id %>" size="2" title="<%- msg.G_SettingsRecntClntsRSSI %>" min="-94" max="-1"/>\n                                    <span class="span rssiSpan"> <%- msg.G_PropertiesDBM %></span>\n                                </div>\n                            </fieldset>\n                            <fieldset class="fieldset radio-na ap-na-configs">\n                                <legend class="legend"><%- msg.G_PropertiesRadio5G11NA %></legend>\n                                <div class="row">\n                                    <input type="hidden" class="hidden" name="na.radio" value="na" />\n                                    <label for="channel-radio-na<%- _id %>" class="label label-selectmenu"><%- msg.G_Channel %></label>\n                                    <div class="selectmenu-group">\n                                        <div>\n                                            <select name="na.channel" id="channel-radio-na<%- _id %>" class="radio-channel inline"></select>\n                                        </div>\n                                        <div>\n                                            <select name="na.ht" class="radio-ht inline" data-radio="na">\n                                                <option value="20"><%- msg.G_PropertiesHT20 %></option>\n                                                <option value="40"><%- msg.G_PropertiesHT40 %></option>\n                                                <option value="80"><%- msg.G_PropertiesHT80 %></option>\n                                            </select>\n                                        </div>\n                                    </div>\n                                </div>\n                                <div class="row">\n                                    <label for="txPower-radio-na<%- _id %>" class="label label-selectmenu"><%- msg.G_PropertiesTXPower %></label>\n                                    <select name="na.tx_power_mode" id="txPower-radio-na<%- _id %>" class="inline">\n                                        <option value="auto"><%- msg.G_Auto %></option>\n                                        <option value="high"><%- msg.G_High %></option>\n                                        <option value="medium"><%- msg.G_Medium %></option>\n                                        <option value="low"><%- msg.G_Low %></option>\n                                        <option value="custom"><%- msg.G_Custom %></option>\n                                    </select>\n                                </div>\n                                <div class="custom">\n                                    <div class="row">\n                                        <input class="input no-label" type="text" name="na.tx_power" size="2" value="<%- get(\'na.tx_power\') || \'0\' %>" />\n                                        <label class="label unit"><%- msg.G_PropertiesDBM %></label>\n                                    </div>\n                                </div>\n                                <div class="row antenna-gain">\n                                    <label class="label custom-label" for="antenna-gain-na<%- _id %>"><%- msg.G_PropertiesAntennaGain %></label>\n                                    <input class="custom input" id="antenna-gain-na<%- _id %>" type="number" max="99" min="-99" step="1" name="na.antenna_gain" value="<%- get(\'na.antenna_gain\') || \'6\' %>" />\n                                    <label class="label unit"><%- msg.G_PropertiesDBI %></label>\n                                </div>\n                                <div class="row">\n                                    <label for="minRssiEnabled-radio-na<%- _id %>" class="label label-selectmenu"><%- msg.G_SettingsMinRSSI %></label>\n                                    <input class="input rssiCheckbox" type="checkbox" name="na.min_rssi_enabled" id="minRssiEnabled-radio-na<%- _id %>" />\n                                    <input class="input inline rssiInput" type="number" name="na.min_rssi" id="minRssi-radio-na<%- _id %>" size="2" title="<%- msg.G_SettingsRecntClntsRSSI %>" min="-94" max="-1"/>\n                                    <span class="span rssiSpan"> <%- msg.G_PropertiesDBM %></span>\n                                </div>\n                            </fieldset>\n                            <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n                        </form>\n                    </div>\n\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_PropertiesWLANS %></div>\n                    </div>\n                    <div>\n                        <fieldset class="fieldset ap-ng-configs radio-ng fieldset-wlan">\n                            <div class="settings-list">\n                                <legend class="legend"><%- msg.G_PropertiesWLANS2G11NBG %></legend>\n                                <div class="row">\n                                    <label for="wlan-group-ng<%- _id %>" class="label label-selectmenu wide"><%- msg.G_PropertiesWLANGroup %></label>\n                                    <div class="is-admin bind-wlan-group-ng">\n                                        <select name="wlan-group-ng" id="wlan-group-ng<%- _id %>" data-radio="ng" class="inline select-wlan wlan-group-ng"></select>\n                                    </div>\n                                    <div class="table-wlans table-wlans-ng data-table data-table-wlans-ng"></div>\n                            </div>\n                        </fieldset>\n                        <fieldset class="fieldset ap-na-configs radio-na fieldset-wlan">\n                            <div class="settings-list">\n                                <legend class="legend"><%- msg.G_PropertiesWLANS5G11NA %></legend>\n                                <div class="row">\n                                    <label for="wlan-group-na<%- _id %>" class="label label-selectmenu wide"><%- msg.G_PropertiesWLANGroup %></label>\n                                    <div class="is-admin bind-wlan-group-na">\n                                        <select name="wlan-group-na" id="wlan-group-na<%- _id %>" data-radio="na" class="inline select-wlan wlan-group-na"></select>\n                                    </div>\n                                    <div class="table-wlans table-wlans-na data-table data-table-wlans-na"></div>\n                                    <div class=\'WLANSDisabled\'><%- msg.G_5GWLANSDisabled %></div>\n                                </div>\n                            </div>\n                        </fieldset>\n                        <fieldset class="fieldset override-form">\n                            <form>\n                                <legend class="legend"><%- msg.G_Override %></legend>\n                                <div class="row">\n                                    <label class="label" for="override-enabled<%- _id %>"><%- msg.G_Enabled %></label>\n                                    <input class="input checkbox" type="checkbox" name="wlanEnabled" id="override-enabled<%- _id %>" />\n                                    <span><%- msg.G_PropertiesEnblOnAP %></span>\n                                </div>\n                                <div class="row">\n                                    <label class="label" for="override-vlan<%- _id %>"><%- msg.G_PropertiesVLAN %></label>\n                                    <input class="input checkbox" type="checkbox" name="vlanEnabled" id="override-vlan<%- _id %>" />\n                                    <span><%- msg.G_PropertiesUseVLANId %></span>\n                                    <input class="input small" type="text" name="vlan" maxlength="4" size="3" />\n                                </div>\n                                <div class="row ssid-row">\n                                    <label class="label inline" for="override-ssid<%- _id %>"><%- msg.G_PropertiesSSID %></label>\n                                    <input class="input inline" type="text" name="name" id="override-ssid<%- _id %>" />\n                                </div>\n                                <div class="row wpapsk">\n                                    <label class="label inline" for="override-psk<%- _id %>"><%- msg.G_PropertiesPSK %></label>\n                                    <input class="input inline" type="text" name="passphrase" id="override-psk<%- _id %>" />\n                                </div>\n                                <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n                                <button class="button is-admin" name="restore" value="Restore" type="button"><%- msg.G_PropertiesRestore %></button>\n                                <button class="button" name="cancel" value="Cancel" type="button"><%- msg.G_Cancel %></button>\n                            </form>\n                        </fieldset>\n                    </div>\n\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_Network %></div>\n                    </div>\n                    <div>\n                        <form action="" class="networkForm bind-network">\n                            <div class="clearfix">\n                                <div class="side-by-side">\n                                    <div class="row">\n                                        <label for="configure-ip<%- _id %>" class="label inline"><%- msg.G_PropertiesConfigIP %></label>\n                                        <select name="type" class="configure-ip" id="configure-ip<%- _id %>">\n                                            <option value="dhcp"><%- msg.G_PropertiesUsingDHCP %></option>\n                                            <option value="static"><%- msg.G_PropertiesStaticIP %></option>\n                                        </select>\n                                    </div>\n                                </div>\n                            </div>\n\n                            <div class="clearfix">\n                                <div class="side-by-side">\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_IPAddress %></label>\n                                        <input type="text" class="input inline" name="ip" size="17" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_PropertiesSubnetMask %></label>\n                                        <input type="text" class="input inline" name="netmask" size="17" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_PropertiesGateway %></label>\n                                        <input type="text" class="input inline" name="gateway" size="17" value="" />\n                                    </div>\n                                </div>\n\n                                <div class="side-by-side">\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_PropertiesPreferredDNS %></label>\n                                        <input type="text" class="input inline" name="dns1" size="17" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_PropertiesAlternateDNS %></label>\n                                        <input type="text" class="input inline" name="dns2" size="17" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_PropertiesDNSSuffix %></label>\n                                        <input type="text" class="input inline" name="dnssuffix" size="17" value="" />\n                                    </div>\n                                </div>\n                            </div>\n                            <button class="button is-admin"><%- msg.G_Apply %></button>\n                        </form>\n                    </div>\n                    <div class="accordion-header ap-dualband-configs">\n                        <div class="accordion-title"><%- msg.G_PropertiesBandSteering %></div>\n                    </div>\n                    <div class="ap-dualband-configs">\n                        <form>\n                            <div class="clearfix">\n                                <div class="buttonset band-steering">\n                                  <input type="radio" id="bandSteeringTo5G_<%- _id %>" name="bandSteeringSelection" value="prefer_5g" />\n                                  <label for="bandSteeringTo5G_<%- _id %>"><%- msg.G_PropertiesPrefer5G %></label>\n                                  <input type="radio" id="bandSteeringEqual_<%- _id %>" name="bandSteeringSelection" value="equal" />\n                                  <label for="bandSteeringEqual_<%- _id %>"><%- msg.G_PropertiesBalanced %></label>\n                                  <input type="radio" id="bandSteeringOff_<%- _id %>" name="bandSteeringSelection" value="off" />\n                                  <label for="bandSteeringOff_<%- _id %>"><%- msg.G_SettingsOff %></label>\n                              </div>\n                            </div>\n                        </form>\n                    </div>\n                    <!-- <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_PropertiesAirtimeFairness %></div>\n                    </div>\n                    <div>\n                        <form>\n                            <div class="clearfix">\n                                <div class="buttonset airtime-fairness">\n                                    <input type="radio" id="airtimeFairnessOff_<%- _id %>" name="bandSteeringSelection" value="false" />\n                                    <label for="airtimeFairnessOff_<%- _id %>"><%- msg.G_SettingsOff %></label>\n                                    <input type="radio" id="airtimeFairnessOn_<%- _id %>" name="bandSteeringSelection" value="true" />\n                                    <label for="airtimeFairnessOn_<%- _id %>"><%- msg.G_SettingsOn %></label>\n                                </div>\n                            </div>\n                        </form>\n                    </div> -->\n                    <!-- <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_PropertiesAggregationFragmentation %></div>\n                    </div>\n                    <div>\n                        <fieldset class="fieldset">\n                            <form>\n                                <div class="clearfix">\n                                    <div class="buttonset aggregation-fragmentation">\n                                        <input type="radio" id="aggregationFragmentationOff_<%- _id %>" name="bandSteeringSelection" value="off" />\n                                        <label for="aggregationFragmentationOff_<%- _id %>"><%- msg.G_SettingsOff %></label>\n                                        <input type="radio" id="aggregationFragmentationOn_<%- _id %>" name="bandSteeringSelection" value="on" />\n                                        <label for="aggregationFragmentationOn_<%- _id %>"><%- msg.G_SettingsOn %></label>\n                                        <input type="radio" id="aggregationFragmentationAuto_<%- _id %>" name="bandSteeringSelection" value="auto" />\n                                        <label for="aggregationFragmentationAuto_<%- _id %>"><%- msg.G_PropertiesAuto %></label>\n                                    </div>\n                                    <br/>\n                                    <legend class="legend">Adjust Setting</legend>\n                                    <div class=\'slider-wrapper\'>\n                                        <div class=\'aggregation-fragmentation-slider slider\'></div>\n                                        <label>Lower Latency</label>\n                                        <label>Higher Throughput</label>\n                                    </div>\n                                </div>\n                            </form>\n                        </fieldset>\n                    </div> -->\n                    <div class="accordion-header ap-uplinks-select">\n                        <div class="accordion-title"><%- msg.G_PropertiesWirelessUplinks %></div>\n                    </div>\n                    <div class="ap-uplinks-select ap-uplinks-content">\n                        <div class="data-table-uplinks-none"><%- msg.G_PropertiesNoWirelssUplnks %></div>\n                        <div class="data-table data-table-uplinks"></div>\n                    </div>\n\n                    <div class="accordion-header is-admin">\n                        <div class="accordion-title"><%- msg.G_PropertiesCustomUpgrade %></div>\n                    </div>\n                    <div class="is-admin">\n                        <div class="row">\n                            <%- msg.G_PropertiesCustomFirmwareTxt %>\n                        </div>\n                        <button class="button custom-upgrade left">\n                            <span class="ui-button-icon-primary ubnt-icon-download"></span>\n                            <span class="nav-text"><%- msg.G_PropertiesCustomUpgrade %></span>\n                        </button>\n                    </div>\n\n                    <div class="accordion-header is-admin">\n                        <div class="accordion-title"><%- msg.G_PropertiesForgetAP %></div>\n                    </div>\n                    <div class="is-admin">\n                        <div class="row">\n                            <%- msg.G_PropertiesForgetAPTxt %>\n                        </div>\n                        <button class="button forget left">\n                            <span class="ui-button-icon-primary ubnt-icon-forget-this-network"></span>\n                            <span class="nav-text"><%- msg.G_PropertiesForget %></span>\n                        </button>\n                        <div class="left">\n                            <select name="move" class="move-dropdown" data-myposition="left bottom" data-atposition="left top"></select>\n                        </div>\n                        <!--<button class="button shell">Shell</button>-->\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="dialog-controls is-admin clearfix">\n            <button class="button button-locate left">\n                <span class="ui-button-icon-primary ubnt-icon-location sidebar-icons locate"></span>\n                <span class="nav-text"><%- msg.G_Locate %></span>\n            </button>\n            <button class="button button-restart left">\n                <span class="ui-button-icon-primary ubnt-icon-rotate sidebar-icons restart"></span>\n                <span class="nav-text"><%- msg.G_Restart %></span>\n            </button>\n            <button class="button button-update left">\n                <span class="ui-button-icon-primary ubnt-icon-download sidebar-icons update"></span>\n                <span class="nav-text"><%- msg.G_Upgrade %></span>\n            </button>\n            <button class="button button-adopt left">\n                <span class="ui-button-icon-primary ubnt-icon-plus sidebar-icons adopt"></span>\n                <span class="nav-text"><%- msg.G_Adopt %></span>\n            </button>\n        </div>\n    </div>\n</div>\n';
}),define("unifi/view/aps/PropertyView",["unifi/view/devices/PropertyView","unifi/view/aps/RfEnvironmentView","unifi/view/aps/RfLegendView","ubnt/backgrid","underscore","backbone","jquery","msg/Msg","unifi/model/Device","unifi/collection/SystemInfos","unifi/collection/WlanGroups","unifi/collection/Wlans","unifi/collection/Sites","text!includes/aps/apPropertiesTemplate.html","ubnt/view/dialogs/AlertDialogView","ubnt/view/dialogs/ConfirmDialogView","libs/moment","stickit"],function(e,t,i,a,n,o,r,s,c,l,d,m,u,h,g,p,y){"use strict";return e.extend({templateId:h,events:{"change input[name=ap-rf-frequency-filter]":"_onRfEnvironmentFrequencyChange"},initialize:function(t){this.configuredRadios=!1,e.prototype.initialize.call(this,t),this.listenTo(this.app.collection("Wlans"),"add remove destroy change",this.setupWlanPanel),this.listenTo(this.model,"change:radio_na change:radio_ng",r.proxy("updateRadiosForm",this))},bindings:function(){var t={".bind-lastseen":{observe:"last_seen",onGet:function(){this.$bindLastseen.text(this.model.lastSeen())}},".bind-lastuplink":{observe:["last_uplink","uplink"],onGet:function(){this.$bindLastUplink.text(this.model.uplinkDeviceText())}},".bind-num-users":{observe:"user-num_sta",onGet:function(e){this.$bindNumUsers.text(e||0)}},".bind-num-guests":{observe:"guest-num_sta",onGet:function(e){this.$bindNumGuests.text(e||0)}},".bind-uplink-device":{observe:"uplink",onGet:function(){this.$bindUplinkDevice.text(this.model.uplinkDeviceText()),this.$bindUplinkRssi.text(this.model.uplinkRssi()),this.$bindUplinkTxRate.text(this.model.uplinkTxRate()),this.$bindUplinkRxRate.text(this.model.uplinkRxRate()),this.$bindUplinkSpeed.text(this.model.uplinkSpeed()),this.$bindUplinkDuplex.text(this.model.uplinkDuplex()),this.$bindUplinkDownPackets.text(this.model.uplinkDownPackets()),this.$bindUplinkUpPackets.text(this.model.uplinkUpPackets()),this.$bindUplinkActivity.text(this.model.uplinkActivity()),this.$statusBar.removeClass("ok pending error").addClass(this.model.statusType()).text(this.model.status())}},".bind-ng-channel":{observe:["ng-state","ng-extchannel","ng-channel","na-state","na-extchannel","na-channel"],onGet:function(){this.$bindNgChannel.text(this.model.channel("ng")),this.$bindNaChannel.text(this.model.channel("na"))}},".bind-ng-transmit-power":{observe:["ng-tx_power","ng-gain","ng-eirp","na-tx_power","na-gain","na-eirp"],onGet:function(){var e=this.model.transmitPower("ng"),t=this.model.transmitPower("na"),i=" "+s.G_PropertiesDBM+" ("+s.G_PropertiesEIRP+")";this.$bindNgTransmitPower.text(n.isUndefined(e)?"":e+i),this.$bindNaTransmitPower.text(n.isUndefined(t)?"":t+i)}},".bind-ng-tx-packets":{observe:"stat",onGet:function(){this.$bindNgTxPackets.text(this.model.packetsPerBytes("ng","tx")),this.$bindNgRxPackets.text(this.model.packetsPerBytes("ng","rx")),this.$bindNgTxRetry.text(this.model.errorPercentage("ng","tx")),this.$bindNgRxRetry.text(this.model.errorPercentage("ng","rx")),this.$bindNaTxPackets.text(this.model.packetsPerBytes("na","tx")),this.$bindNaRxPackets.text(this.model.packetsPerBytes("na","rx")),this.$bindNaTxRetry.text(this.model.errorPercentage("na","tx")),this.$bindNaRxRetry.text(this.model.errorPercentage("na","rx"))}},".bind-na-users":{observe:["na-user-num_sta"],onGet:function(){this.$bindNaUsers.text(this.model.get("na-user-num_sta")||0)}},".bind-ng-users":{observe:["ng-user-num_sta"],onGet:function(){this.$bindNgUsers.text(this.model.get("ng-user-num_sta")||0)}},".bind-na-guests":{observe:["na-guest-num_sta"],onGet:function(){this.$bindNaGuests.text(this.model.get("na-guest-num_sta")||0)}},".bind-ng-guests":{observe:["ng-guest-num_sta"],onGet:function(){this.$bindNgGuests.text(this.model.get("ng-guest-num_sta")||0)}},".bind-wlan-group-ng":{observe:"wlangroup_id_ng",updateView:!1,onGet:function(e){this.$bindWlanGroupNg.find("select").val(e).trigger("change",!0),this.setupWlanTable("ng")}},".bind-wlan-group-na":{observe:"wlangroup_id_na",updateView:!1,onGet:function(e){this.$bindWlanGroupNa.find("select").val(e).trigger("change",!0),this.setupWlanTable("na")}},".bind-network":{observe:"config_network",onGet:function(e){this.populateNetworkForm(this.$networkForm,e)}}},i={};return this.model.isGen2Ap()&&n.extend(i,{".bind-rf-environment-2G":{observe:"spectrum_table_ng",onGet:function(e){this.populateRfEnvironment(this.$bindRfEnvironment2G,e,"ng")}},".bind-rf-environment-5G":{observe:"spectrum_table_na",onGet:function(e){this.populateRfEnvironment(this.$bindRfEnvironment5G,e,"na")}}}),n.extend({},e.prototype.bindings.call(this),t,i)},updateScanDisplay:function(){var e=this.model.get("spectrum_scanning"),t=this.model.get("spectrum_table_time_na"),i=this.model.get("spectrum_table_time_ng");e?(this.$bindRfEnvironmentLastUpdated2G.text(s.G_PropertiesRFScanScanning),this.$bindRfEnvironmentLastUpdated5G.text(s.G_PropertiesRFScanScanning)):(this.$bindRfEnvironmentLastUpdated5G.text(s.localize(s.G_PropertiesRFLastUpdated,this.model.lastScan(t))),this.$bindRfEnvironmentLastUpdated2G.text(s.localize(s.G_PropertiesRFLastUpdated,this.model.lastScan(i)))),this.toggleRfScanButton(e)},dependencies:function(){var e={SystemInfos:l,WlanGroups:d,Wlans:m,Sites:u},t=[],i={},a=this;n.each(e,function(e,a){t.push(i[a]=r.Deferred())},this),r.when.apply(r,t).then(function(){a._dependencies.resolve()},function(){a._dependencies.reject()}),n.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:i[t]}},e)},this)},render:function(t){var i=this.rendered;return e.prototype.render.call(this,t),i||(this.$advAdoptForm=this.$(".advAdoptForm"),this.$radiosForm=this.$(".radiosForm"),this.$networkForm=this.$(".networkForm"),this.$shell=this.$(".shell"),this.$connectionType=this.$(".configure-ip"),this.$bandSteering=this.$(".band-steering"),this.$btnLocate=this.$(".button-locate"),this.$btnRestart=this.$(".button-restart"),this.$btnUpdate=this.$(".button-update"),this.$btnAdopt=this.$(".button-adopt"),this.$overrideFieldset=this.$(".override-form"),this.$overrideForm=this.$overrideFieldset.find("form"),this.$fieldsetWlans=this.$(".fieldset-wlan"),this.$uplinkDevice=this.$(".button-uplink-device"),this.$bindUptime=this.$(".bind-uptime"),this.$bindLastseen=this.$(".bind-lastseen"),this.$bindLastUplink=this.$(".bind-lastuplink"),this.$bindNumUsers=this.$(".bind-num-users"),this.$bindNumGuests=this.$(".bind-num-guests"),this.$bindUplinkDevice=this.$(".bind-uplink-device"),this.$bindUplinkRssi=this.$(".bind-uplink-rssi"),this.$bindUplinkTxRate=this.$(".bind-uplink-tx-rate"),this.$bindUplinkRxRate=this.$(".bind-uplink-rx-rate"),this.$bindUplinkSpeed=this.$(".bind-uplink-speed"),this.$bindUplinkDuplex=this.$(".bind-uplink-duplex"),this.$bindUplinkDownPackets=this.$(".bind-uplink-down-packets"),this.$bindUplinkUpPackets=this.$(".bind-uplink-up-packets"),this.$bindUplinkActivity=this.$(".bind-uplink-activity"),this.$bindAdoptIp=this.$(".bind-adopt-ip"),this.$bindAdoptUrl=this.$(".bind-adopt-url"),this.$bindDownlinks=this.$(".bind-downlinks"),this.$bindNgChannel=this.$(".bind-ng-channel"),this.$bindNgTransmitPower=this.$(".bind-ng-transmit-power"),this.$bindNgTxPackets=this.$(".bind-ng-tx-packets"),this.$bindNgRxPackets=this.$(".bind-ng-rx-packets"),this.$bindNgTxRetry=this.$(".bind-ng-tx-retry"),this.$bindNgRxRetry=this.$(".bind-ng-rx-retry"),this.$bindNgUsers=this.$(".bind-ng-users"),this.$bindNgGuests=this.$(".bind-ng-guests"),this.$bindNaChannel=this.$(".bind-na-channel"),this.$bindNaTransmitPower=this.$(".bind-na-transmit-power"),this.$bindNaTxPackets=this.$(".bind-na-tx-packets"),this.$bindNaRxPackets=this.$(".bind-na-rx-packets"),this.$bindNaTxRetry=this.$(".bind-na-tx-retry"),this.$bindNaRxRetry=this.$(".bind-na-rx-retry"),this.$bindNaUsers=this.$(".bind-na-users"),this.$bindNaGuests=this.$(".bind-na-guests"),this.$bindWlanGroupNg=this.$(".bind-wlan-group-ng"),this.$bindWlanGroupNa=this.$(".bind-wlan-group-na"),this.$rfScanButton=this.$(".button-rfScan"),this.$bindRfEnvironment=this.$(".bind-rf-environment"),this.$bindRfEnvironment2G=this.$(".bind-rf-environment-2G"),this.$bindRfEnvironment5G=this.$(".bind-rf-environment-5G"),this.$bindRfEnvironmentLastUpdated=this.$(".bind-rf-environment-last-updated"),this.$bindRfEnvironmentLastUpdated2G=this.$(".bind-rf-environment-last-updated-2G"),this.$bindRfEnvironmentLastUpdated5G=this.$(".bind-rf-environment-last-updated-5G"),this.$bindRfLegend=this.$(".bind-rf-legend"),this.noUserRows=this.$(".data-table-users").html(),this.noGuestRows=this.$(".data-table-guests").html(),this.noDownlinkRows=this.$(".data-table-downlinks").html(),this.noUplinkRows=this.$(".data-table-uplinks").html(),this.noWlanRows_ng=this.$(".data-table-wlans-ng").html(),this.noWlanRows_na=this.$(".data-table-wlans-na").html(),this.wLanOverrideModel=null,this.wLanOverrideRadio=null,this.$(".buttonset").buttonset(),this.$advAdoptForm.on("submit",this.onAdvAdoptFormSubmit),this.$networkForm.on("submit",r.proxy(function(e){e.preventDefault(),this.updateNetwork(this.$networkForm,"config_network")},this)),this.$radiosForm.on("submit",this.updateRadios),this.$bandSteering.on("change","input",this.saveBandSteering),this.$shell.on("click",this.shell),this.$(".button-block").on("click",this.blockUser),this.$(".button-reconnect").on("click",this.reconnectUser),this.$uplinkDevice.on("click",this.displayUplinkDevice),this.$connectionType.on("change",r.proxy(function(e){var t=r(e.target).val();this.$networkForm.find(".connection-toggled").hide().filter(".connection-"+t).show()},this)).trigger("change"),this.$overrideForm.on("submit",this.onOverrideFormSubmit),this.$overrideForm.find('button[name="restore"]').on("click",this.onOverrideFormRestore),this.$overrideForm.find('button[name="cancel"]').on("click",this.onOverrideFormCancel),this.$("select.wlan-group-ng").on("change",this.updateWlan),this.$("select.wlan-group-na").on("change",this.updateWlan),this.$('input[name="ng.min_rssi_enabled"]').on("change",this.updateMinRSSIForm),this.$('input[name="na.min_rssi_enabled"]').on("change",this.updateMinRSSIForm),this.$("select.radio-ht").on("change",this.updateChannelSelect),"resolved"===this._rendered.state()&&"resolved"==this._dependencies.state()?(this.configuredRadios=!1,this.populate()):"pending"===this._rendered.state()&&this._rendered.resolve(),this.model.isGen2Ap()?(this._showRfTab(this.$bindRfEnvironment2G,this.$bindRfEnvironmentLastUpdated2G),this.renderRfLegend(),this.$rfScanButton.on("click",this.onRfScanClick),this.updateScanDisplay(this.model.get("spectrum_scanning"))):this.$(".ap-rf-environment").hide(),this.stickit(this.model,this.bindings())),this.options.options&&this.options.options.section&&this.setSection(this.options.options.section),this},setSection:function(e){if(e){var t,i;switch(e){case"rfMap":t=0,i=6;break;case"config":t=3,i=0}this.$tabs.tabs("option","active",t),this.$el.find(".properties-container > div:nth-child("+(t+1)+") > .accordion").accordion("option","active",i),this.options.options.section=null}},toggleRfScanButton:function(e){e===!0?this.$rfScanButton.addClass("disabled").attr("disabled","disabled"):this.$rfScanButton.removeClass("disabled").removeAttr("disabled")},populate:function(){if(e.prototype.populate.call(this),this._dependencies&&"resolved"==this._dependencies.state()){var t=this.model.isConnected(),i=this.model.uplink(),a=i?"wireless"===i.type:!1,o=!1;this.$el.removeClass("ap-uplink-wire ap-uplink-wireless ap-has-downlinks ap-needs-uplinks ap-ng-radio ap-na-radio ap-dualband-radio"),this.model.get("adopted")&&(this.model.get("locating")?this.$btnLocate.addClass("locating"):this.$btnLocate.removeClass("locating")),this.setupAP(),n.each(this.model.uplinks(),function(e,t){t.configured&&(o=!0)}),this.model.get("vwireEnabled")&&(a||o||!t)&&(this.$el.addClass("ap-needs-uplinks"),t||this.setupUplinksTable()),this.model.isGen2Ap()&&this.updateScanDisplay(),this.position()}},setupAP:function(){var e=this.model.hasRadio("ng"),t=this.model.hasRadio("na"),i=n.size(this.model.downlinks())>0,a=this.model.uplink()||{},o=(this.model.downlinks(),this.model.is11ac());"eth0"==a.name||"eth1"==a.name?(this.$el.addClass("ap-uplink-wire"),this.$(".uplink-type").text("("+s.G_Wire+")")):"ath0"==a.name&&(this.$el.addClass("ap-uplink-wireless"),this.$(".uplink-type").text("("+s.G_Wireless+")")),this.setupUplinksTable(),this.setupDownlinksTable(),this.systemInfo=this.app.collection("SystemInfos").at(0),this.currentCCode=this.systemInfo.get("cur_ccode"),this.currentCountryKey=this.currentCCode.key,this.currentCCode.ht40_ng||this.$('select[name="ng.ht"] option[value=40]').remove(),this.currentCCode.ht40_na||this.$('select[name="na.ht"] option[value=40]').remove(),this.currentCCode.channels_na_80&&0!==this.currentCCode.channels_na_80.length&&this.model.is11ac()||this.$('select[name="na.ht"] option[value=80]').remove(),i&&this.$el.addClass("ap-has-downlinks"),e&&this.$el.addClass("ap-ng-radio"),t&&(this.$el.addClass("ap-na-radio"),o&&(this.$("fieldset.ap-na-configs legend").text(s.G_PropertiesRadio5G11AC),this.$("fieldset.ap-na-configs.fieldset-wlan legend").text(s.G_PropertiesWLANS5G11AC),this.$("div.radio-na").find("div.accordion-title").text(s.G_PropertiesRadio11AC))),t&&e&&this.$el.addClass("ap-dualband-radio"),this.configuredRadios||this.updateRadiosForm(),this.updateBandSteering(),this.userTable(),this.guestTable(),this.$("select.radio-ht").each(function(){r(this).trigger("change")}),this.setupWlanPanel()},onRfScanClick:function(e){var t=r(e.target);if(!t.hasClass("disabled")){var i=new p;return i.options.dialogOptions.title=s.G_PropertiesRFScanConfirmTitle,i.show(s.G_PropertiesRFScanConfirmTxt,r.proxy(function(){this.toggleRfScanButton(!0),this.$bindRfEnvironmentLastUpdated2G.text(s.G_PropertiesRFScanScanning),this.$bindRfEnvironmentLastUpdated5G.text(s.G_PropertiesRFScanScanning),this.model.spectrumScan()},this)),!1}},onAdvAdoptFormSubmit:function(e){e.preventDefault();var t=this,i=this.model,a=r(e.target).find("button");this.$advAdoptForm.find(".error").removeClass("error"),a.attr("disabled","disabled");var o=i.advanceAdopt({data:{ip:this.$advAdoptForm.find('input[name="ip"]').val(),port:this.$advAdoptForm.find('input[name="port"]').val(),username:this.$advAdoptForm.find('input[name="username"]').val(),password:this.$advAdoptForm.find('input[name="password"]').val(),url:this.$advAdoptForm.find('input[name="url"]').val()},success:function(e){"ok"===e.meta.rc?i.fetch({success:function(e,i,a){"ok"===i.meta.rc&&t.parent.property(e)},complete:function(){a.removeAttr("disabled")}}):(t.showErrorState(),a.removeAttr("disabled"))},error:function(){t.showErrorState(),a.removeAttr("disabled")}});!o&&this.model.validationError&&n.each(this.model.validationError,function(e,t){switch(t){case"username":case"password":this.$advAdoptForm.find('input[name="'+t+'"]').addClass("error"),a.removeAttr("disabled")}},this)},displayUplinkDevice:function(){var e=this.app.routers.devices.views.index,t=e.collection.getDeviceFromMac(this.model.uplinkDeviceMac()),i=t&&e.property(t),a=this.model.uplinkRemotePort();return a&&(i.$el.find(".switchPorts-anchor").click(),n.delay(function(){i.$el.find(".port-"+a).click()},100)),!1},userAndGuestColumns:function(){var e=this;return[{name:"hostname",label:s.G_Name,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ModelCell.extend({callback:"name"}),callback:function(t){var i=e.app.routers.clients.views.index,a=i.collection.getClientFromMac(t.get("mac"));i.property(a)}},{name:"essid",label:s.G_Wlan,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:"string"},{name:"signal",label:s.G_DevicesSignal,editable:!1,cell:a.Cells.ModelCell.extend({callback:"signalWithDbm"})},{name:"tx_rate",label:s.G_DevicesTX,editable:!1,cell:a.Cells.ModelCell.extend({callback:"txRateInM"})}]},userTable:function(){if(!this.rendered)return!1;var e=this.app.collection("Clients"),t=e.where({ap_mac:this.model.get("mac"),is_guest:!1});this.grids.users?this.grids.users.collection.set(t):this.grids.users=this.grid(this.userAndGuestColumns(),new o.Collection(t),this.$(".data-table-users"),this.noUserRows)},guestTable:function(){if(!this.rendered)return!1;var e=this.app.collection("Clients"),t=e.where({ap_mac:this.model.get("mac"),is_guest:!0});this.grids.guests?this.grids.guests.collection.set(t):this.grids.guests=this.grid(this.userAndGuestColumns(),new o.Collection(t),this.$(".data-table-guests"),this.noGuestRows)},updateRadioTable:function(e){var t,i=this;n.each(e,function(e){if(t=i.model.getRadio(e.radio),void 0!==t)for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a])})},updateRadiosForm:function(){var e,t,i=this;n.each(this.model.get("radio_table"),function(a){t=a.radio,e=i.$("fieldset.radio-"+t),e.find('select[name="'+t+'.ht"]').val(a.ht||("ng"==t?20:40)).change(),e.find('select[name="'+t+'.tx_power_mode"]').val(a.tx_power_mode||"auto").change(),e.find('input[name="'+t+'.tx_power"]').val(a.tx_power||"0"),e.find('input[name="'+t+'.antenna_gain"]').val(a.antenna_gain||"6"),e.find('input[name="'+t+'.min_rssi_enabled"]').prop("checked",a.min_rssi_enabled||!1),e.find('input[name="'+t+'.min_rssi"]').val(a.min_rssi||"-94"),a.builtin_antenna!==!1&&e.find("div.antenna-gain").remove(),"custom"===a.tx_power_mode?e.find("div.custom").show():e.find("div.custom").hide(),this.configuredRadios=!0},this),this.configuredRadios&&(this.updateMinRSSIForm(),this.renderSelects())},updateRadios:function(){var e=this,t=this.$radiosForm.serializeObject(),i={},a={},o=[],r=0,c=0,l="",d=!0,m={};return n.each(t,function(e,t){0===t.indexOf("ng.")?i[t.replace("ng.","")]=e:0===t.indexOf("na.")&&(a[t.replace("na.","")]=e)}),i&&this.model.hasRadio("ng")&&(this.$radiosForm.find('input[name="ng.min_rssi_enabled"]').prop("checked")?i.min_rssi_enabled=!0:(i.min_rssi_enabled=!1,delete i.min_rssi),o.push(i)),a&&this.model.hasRadio("na")&&(this.$radiosForm.find('input[name="na.min_rssi_enabled"]').prop("checked")?a.min_rssi_enabled=!0:(a.min_rssi_enabled=!1,delete a.min_rssi),o.push(a)),n.each(o,function(t){return l=t.radio,"custom"===t.tx_power_mode&&(r=e.model.get("radio_"+l).max_txpower||"0",c=e.model.get("radio_"+l).min_txpower||"0",t.tx_power>r||t.tx_power<c)?((new g).open(s.localize(s.E_IncorrectNumberRange,("ng"===l?s.G_2G:s.G_5G)+" "+s.G_PropertiesTransmitPower,c,r)),void(d=!1)):void 0}),d?(this.model.update({data:{radio_table:o},success:function(t){"ok"===t.meta.rc?(m=n.find(t.data,function(t){return t.mac===e.model.get("mac")}),void 0!==m&&e.updateRadioTable(m.radio_table),e.updateRadiosForm(),e.showSavedState()):e.showErrorState()},error:function(){e.showErrorState()}}),!1):!1},updateMinRSSIForm:function(){var e,t,i=this,a=this.app.collection("WlanGroups");n.each(this.model.get("radio_table"),function(n){var o=i.model.get("wlangroup_id_"+n.radio),r=a.findWhere({_id:o});t=n.radio,e=i.$("fieldset.radio-"+t),r&&r.get("roam_enabled")?(e.find('input[name="'+t+'.min_rssi_enabled"]').prop("disabled",!0),e.find('input[name="'+t+'.min_rssi"]').prop("disabled",!0)):(e.find('input[name="'+t+'.min_rssi_enabled"]').prop("disabled",!1),e.find('input[name="'+t+'.min_rssi_enabled"]').prop("checked")===!0?e.find('input[name="'+t+'.min_rssi"]').prop("disabled",!1):e.find('input[name="'+t+'.min_rssi"]').prop("disabled",!0))})},updateBandSteering:function(){var e=this.model.get("bandsteering_mode")||"off",t=this.model.isGen2Ap();t||(this.$bandSteering.find('input[value="equal"]').prop("disabled",!0),this.$bandSteering.find('input[value="equal"] + label').hide()),this.model.hasBandsteering()||this.$bandSteering.find("input").prop("disabled",!0),this.$bandSteering.find("input").prop("checked",!1),this.$bandSteering.find('input[value="'+e+'"]').prop("checked",!0),this.app.isReadOnly&&(this.$bandSteering.find('input[value="'+e+'"]').prop("disabled",!1),this.$bandSteering.find('input:not(input[value="'+e+'"])').prop("disabled",!0)),this.$bandSteering.buttonset("refresh")},saveBandSteering:function(){var e=this,t=this.$bandSteering.find("input:checked").val();return this.model.save({bandsteering_mode:t},{wait:!0,data:{bandsteering_mode:t},success:function(t,i){if("ok"===i.meta.rc){n.find(i.data,function(t){return t.mac===e.model.get("mac")});e.updateBandSteering(),e.showSavedState()}else e.showErrorState()},error:function(){e.showErrorState()}}),!1},saveAirtimeFairness:function(){},shell:function(){return window.open("/shell?mac="+this.model.get("mac")+"&name="+this.model.name(),"_blank","toolbar=no,menubar=0,status=0,copyhistory=0,scrollbars=yes,resizable=1,location=0,Width=800,Height=600"),!1},blockUser:function(e){var t=r(e.target),i=t.data("mac"),a=this.app.collection("Clients"),n=a.getClientFromMac(i);n.block()},reconnectUser:function(){var e=r(event.target),t=e.data("mac"),i=this.app.collection("Clients"),a=i.getClientFromMac(t);a.reconnect()},updateChannelSelect:function(e){var t,i=r(e.target),a=i.val()||20,o=i.data("radio"),c=this.$('select[name="'+o+'.channel"]'),l=c.val()||(this.model.get("radio_"+o)||{}).channel,d=this.model.hasDfs();if(c.empty().append(r('<option value="auto" />').text(s.G_Auto)),n.each(this.currentCCode["channels_"+o+(20==a?"":"_"+a)],r.proxy(function(e){var t=r("<option />").attr("value",e).text(e);if("na"==o){var i=-1!==r.inArray(e,this.currentCCode.channels_na_dfs);if(i){if(!d)return;t.text(function(e,t){return t+" (dfs)"})}t.attr("band",n.escape(52>e?1:149>e?2:3))}c.append(t)},this)),"na"==o&&("US"==this.currentCountryKey||"CA"==this.currentCountryKey))switch(this.model.get("model")){case"U5O":c.find("[band=1]").remove(),c.find("[band=2]").remove();break;case"U7P":c.find("[band=2]").remove()}t=c.find("option[value="+l+"]"),t.length||(t=c.find("option[value=auto]")),t.attr("selected",!0).trigger("change")},updateWlan:function(e,t){var i,a=r(e.target),n=a.data("radio"),o=a.val(),s=this.app.collection("WlanGroups"),c=s.findWhere({_id:o}),l=this.app.collection("Wlans");l.findWhere({wlangroup_id:o});if(a.data("wlangroup",c),i=this.$radiosForm.find(".radio-"+n),c&&c.get("roam_enabled")){i.find('select[name="'+n+'.channel"]').val("ng"==n?c.get("roam_channel_ng"):c.get("roam_channel_na")).disable(),i.find('select[name="'+n+'.ht"]').disable(),"resolved"===this._rendered.state()&&"resolved"==this._dependencies.state()&&i.find('select[name="'+n+'.ht"]').val("20").change();try{i.find('select[name="'+n+'.channel"]').selectmenu("disable"),i.find('select[name="'+n+'.ht"]').selectmenu("disable")}catch(d){}}else{i.find('select[name="'+n+'.channel"]').enable(),i.find('select[name="'+n+'.ht"]').enable();try{i.find('select[name="'+n+'.channel"]').selectmenu("enable"),i.find('select[name="'+n+'.ht"]').selectmenu("enable")}catch(d){}}this.updateMinRSSIForm(),t||this.model.get("_id")&&this.model.get("wlangroup_id_"+n)!=o&&this.model.updateWlanGroup(n,{wait:!0,wlangroup_id:o,success:r.proxy(function(){this.showSavedState(),this.setupWlanTable(n)},this),error:r.proxy(function(){this.showErrorState()},this)})},setupWlanPanel:function(){var e=this,t=["ng","na"],i=this.app.collection("WlanGroups");n.each(t,function(t,a){var o=e.$("select.wlan-group-"+t);o.empty(),n.each(i.models,function(i,a){var s=r('<option value="'+n.escape(i.get("_id"))+'"></option>');if(i.get("roam_enabled")){if(t!=i.get("roam_radio"))return null;s.addClass("roam"),s.text(i.get("name")+" (Zero-Handoff)")}else s.text(i.get("name"));s.hasClass("roam")&&(e.$el.hasClass("ap-uplink-wireless")||e.model.noZh())?s=null:o.append(s)});try{o.selectmenu("refresh")}catch(s){}var c=e.model.get("wlangroup_id_"+t);c&&(o.val(c).trigger("change",!0),e.setupWlanTable(t,c))})},fillWlanForm:function(e){if(this.$overrideForm.find(".error").removeClass("error"),this.$overrideForm.find(".row-error").remove(),this.wLanOverrideModel){var t=this.wLanOverrideModel.get("_id"),i=this.wLanOverrideRadio,a=this.model.getOverride(t,i),n=this.wLanOverrideModel.toJSON();(!a||e)&&(a=this.wLanOverrideModel.toJSON()),this.$overrideForm.find('input[name="name"]').val(a.hasOwnProperty("name")?a.name:n.name),this.$overrideForm.find('input[name="wlanEnabled"]').prop("checked",a.hasOwnProperty("enabled")?a.enabled===!0:n.enabled===!0),this.$overrideForm.find('input[name="vlanEnabled"]').prop("checked",a.hasOwnProperty("vlan_enabled")?a.vlan_enabled===!0:n.vlan_enabled===!0),this.$overrideForm.find('input[name="vlan"]').val(a.hasOwnProperty("vlan")?a.vlan>1?a.vlan:"":n.vlan>1?n.vlan:""),this.$overrideForm.find(".wpapsk").attr("display",a.hasOwnProperty("security")?"wpapsk"==a.security?"block":"none":"wpapsk"==n.security?"block":"none"),this.$overrideForm.find('input[name="passphrase"]').val(a.hasOwnProperty("x_passphrase")?a.x_passphrase:n.x_passphrase),"wpapsk"==this.wLanOverrideModel.get("security")?this.$overrideForm.find("div.row.wpapsk").show():this.$overrideForm.find("div.row.wpapsk").hide()}var o=this.$overrideForm.find('input[name="vlanEnabled"]'),r=this.$overrideForm.find('input[name="vlan"]');o.prop("checked")===!0?r.prop("disabled",!1):r.prop("disabled",!0),o.click(function(){o.is(":checked")?r.prop("disabled",!1):r.prop("disabled",!0)})},onOverrideFormSubmit:function(e){e&&e.preventDefault(),this.submitOverride(!1)},submitOverride:function(e){if(this.$overrideForm.find(".error").removeClass("error"),this.$overrideForm.find(".row-error").remove(),this.wLanOverrideModel){var t=this,i=this.model.get("wlan_overrides")||[],a=this.wLanOverrideModel.get("_id"),o=this.wLanOverrideRadio,s=this.model.getOverride(a,o)||this.wLanOverrideModel.toJSON(),c=!0;if(i=r.grep(i,function(e){return e!=s}),!e){var l=["enabled","name","radio","vlan","vlan_enabled","wlan_id","x_passphrase"];s=n.pick(s,l),s.wlan_id=a,s.radio=o,s.name=this.$overrideForm.find('input[name="name"]').val(),s.enabled=this.$overrideForm.find('input[name="wlanEnabled"]').is(":checked");var d=s.vlan_enabled=this.$overrideForm.find('input[name="vlanEnabled"]').is(":checked");s.vlan=this.$overrideForm.find('input[name="vlan"]').val(),s.x_passphrase=this.$overrideForm.find('input[name="passphrase"]').val();var m=this.wLanOverrideModel;s.name!=m.get("name")?c=!1:delete s.name,s.enabled!=m.get("enabled")?c=!1:delete s.enabled,s.vlan_enabled!=m.get("vlan_enabled")?c=!1:delete s.vlan_enabled,""===s.vlan?d?c=!1:delete s.vlan:s.vlan!=m.get("vlan")?c=!1:delete s.vlan,s.x_passphrase!=m.get("x_passphrase")?c=!1:delete s.x_passphrase,c||i.push(s)}n.each(i,function(e){var t=this.app.collection("Wlans").findWhere({_id:e.wlan_id});"wep"!==t.get("security")&&"wpapsk"!==t.get("security")&&void 0!==e.x_passphrase&&delete e.x_passphrase},this);var u=this.model.save({wlan_overrides:i,wlanconf:this.app.collection("Wlans").findWhere({_id:a})},{wait:!0,data:{wlan_overrides:i},success:function(e,i){"ok"===i.meta.rc?(t.setupWlanTable(o),t.$el.removeClass("ap-show-override"),t.showSavedState()):t.showErrorState()},error:function(){t.showErrorState()}});!u&&this.model.validationError&&this.model.validationError.wlan_overrides&&n.each(this.model.validationError.wlan_overrides,function(e,t){n.each(e,function(e,t){var i;switch(t){case"name":case"vlan":i=this.$overrideForm.find('input[name="'+t+'"]').addClass("error");break;case"x_passphrase":i=this.$overrideForm.find('input[name="passphrase"]').addClass("error")}i.parents(".row").after(r('<div class="row row-error"></div>').text(e))},this)},this)}},onOverrideFormRestore:function(e,t){return this.fillWlanForm(!0),!t&&this.submitOverride(!0),!1},onOverrideFormCancel:function(e){return this.onOverrideFormRestore(null,!0),this.$el.removeClass("ap-show-override"),!1},setupWlanTable:function(e,t){if(!this.rendered)return!1;var i=this,o=i.$("select.wlan-group-"+e),r=t||o.val(),c=this.app.collection("Wlans").filter(function(e){return e.get("wlangroup_id")==r}),l=this.$(".data-table-wlans-"+e);if(l.next(".WLANSDisabled").hide(),this.grids["wlan_"+e])this.grids["wlan_"+e].collection.reset(),this.grids["wlan_"+e].collection.set(c);else{var d=[{name:"name",label:s.G_Name,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ComplexCell.extend({className:"string-cell",formatter:{fromRaw:function(e){var t=(e.get("enabled")||!1,e.get("name"));return t},toRaw:function(e){return e}}})},{name:"essid",label:s.G_Overrides,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ComplexCell.extend({className:"string-cell",formatter:{fromRaw:function(t){var a=[],n=i.model.getOverride(t.get("_id"),e);if(!n)return"";if(n.hasOwnProperty("enabled")&&n.enabled!=t.get("enabled")){if(n.enabled===!0)return s.G_Enabled;if(n.enabled===!1)return s.G_Disabled}n.hasOwnProperty("name")&&n.name!=t.get("name")&&a.push("SSID:"+n.name),n.hasOwnProperty("vlan_enabled")&&(t.get("vlan_enabled")&&!n.vlan_enabled?a.push("VLAN:"+s.G_Disabled):!t.get("vlan_enabled")&&n.vlan_enabled&&a.push("VLAN:"+s.G_Enabled));var o=t.get("vlan_enabled")===!0&&n.vlan_enabled!==!1||t.get("vlan_enabled")===!1&&n.vlan_enabled===!0;return n.hasOwnProperty("vlan")&&o&&t.get("vlan")!=n.vlan&&a.push("VLAN:"+n.vlan),n.hasOwnProperty("x_passphrase")&&"wpapsk"==t.get("security")&&n.x_passphrase!=t.get("x_passphrase")&&a.push("PSK"),a.join(", ")},toRaw:function(e){return e}}})},{name:"_id",label:s.G_Actions,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ActionsCell.extend({actions:{override:{render:function(e){var t=i.app.collection("WlanGroups"),a=t.findWhere({_id:e.get("wlangroup_id")});return a&&a.get("roam_enabled")?!1:!0},callback:function(t){i.wLanOverrideModel=t,i.wLanOverrideRadio=e,i.$el.addClass("ap-show-override"),i.fillWlanForm()}}}})}];this.grids["wlan_"+e]=this.grid(d,new m(c),l,this["noWlanRows_"+e])}n.size(c)?l.show():l.hide();try{o.selectmenu("refresh")}catch(u){}},setupUplinksTable:function(){if(!this.rendered)return!1;var e=this,t=this.app.routers.devices.views.index,i=this.model.uplinks(),l=this.$(".data-table-uplinks"),d=this.$(".data-table-uplinks-none");if(n.size(i)?(l.show(),d.hide()):(l.hide(),d.show()),this.grids.uplinks)this.grids.uplinks.collection.set(i);else{var m=[{name:"mac",label:s.G_AP,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){var i=t.collection.getDeviceFromMac(e.get("mac"));return i||(i=e),i.name()},toRaw:function(e){return e}}}),callback:function(e){var i=t.collection.getDeviceFromMac(e.get("mac"));i&&t.property(i)},title:"mac"},{name:"channel",label:s.G_ChannelAbbrev,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:"string"},{name:"rssi",label:s.G_DevicesSignal,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ModelCell.extend({callback:"calcRssi"})},{name:"configured",label:s.G_Actions,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ActionsCell.extend({actions:{select:{buttonClasses:"narrow",render:function(e){return!e.get("configured")},callback:function(t,i){var a=r(i.currentTarget);a.prop("disabled",!0),e.model.setVwireUplink({data:{uplink:t.get("mac"),mac:e.model.get("mac")},success:function(){(new g).open(s.G_DevicesTopologyChanged)},complete:function(){a.prop("disabled",!1)}})}},remove:{buttonClasses:"narrow",render:function(e){return e.get("configured")},callback:function(t,i){var a=r(i.currentTarget);a.prop("disabled",!0),e.model.unsetVwireUplink({data:{uplink:t.get("mac"),mac:e.model.get("mac")},success:function(){(new g).open(s.G_DevicesTopologyChanged)},complete:function(){a.prop("disabled",!1)}})}}}})}];this.grids.uplinks=this.grid(m,new o.Collection(i,{model:c}),this.$(".data-table-uplinks"),this.noUplinkRows)}},setupDownlinksTable:function(){if(!this.rendered)return!1;var e=this,t=this.app.routers.devices.views.index;if(this.grids.downlinks)this.grids.downlinks.collection.set(this.model.downlinks());else{var i=[{name:"ap_mac",label:s.G_AP,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){var i=t.collection.getDeviceFromMac(e.get("ap_mac"));return i||(i=e),i.name()},toRaw:function(e){return e}}}),callback:function(e){var i=e.get("ap_mac"),a=t.collection.getDeviceFromMac(i);t.property(a)},title:"ap_mac"},{name:"rssi",label:s.G_DevicesSignal,editable:!1,
sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ModelCell.extend({callback:"calcRssi"})},{name:"_id",label:s.G_Actions,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ActionsCell.extend({actions:{remove:{buttonClasses:"narrow",callback:function(t,i){var a=r(i.currentTarget);a.prop("disabled",!0),e.model.unsetVwireUplink({data:{mac:t.get("ap_mac"),uplink:e.model.get("mac")},success:function(){(new g).open(s.G_DevicesTopologyChanged)},complete:function(){a.prop("disabled",!1)}})}}}})}];this.grids.downlinks=this.grid(i,new o.Collection(this.model.downlinks(),{model:c}),this.$(".data-table-downlinks"),this.noDownlinkRows)}},renderRfLegend:function(){var e=new i({el:this.$bindRfLegend});e.render()},populateRfEnvironment:function(e,i,a){var r=this,s=n.map(i,function(e){return n.extend({},e,{frequencies:[r.model.getFrequency(a,e.channel)]})}),c="ng"==a?this.model.get("ng-channel"):this.model.get("na-channel"),l=n.findWhere(this.model.get("radio_table"),{radio:a}),d=l?l.ht?l.ht:"ng"==a?"20":"40":null,m=new t({el:e,model:new o.Model({bandwidthGroups:s}),radioChannel:c,radioChannelWidth:d});m.render()},_onRfEnvironmentFrequencyChange:function(e){switch(r(e.target).val()){case"2G":this._showRfTab(this.$bindRfEnvironment2G,this.$bindRfEnvironmentLastUpdated2G);break;case"5G":this._showRfTab(this.$bindRfEnvironment5G,this.$bindRfEnvironmentLastUpdated5G)}},_hideAllRfTabs:function(){this.$bindRfEnvironment.hide(),this.$bindRfEnvironmentLastUpdated.hide()},_showRfTab:function(e,t){this._hideAllRfTabs(),e.show(),t.show()},remove:function(){this.onOverrideFormCancel(),this.stopListening(this.app.collection("Wlans"),"add remove destroy change",this.setupWlanPanel),this.stopListening(this.model,"change:radio_na change:radio_ng"),this.$advAdoptForm.off("submit"),this.$networkForm.off("submit"),this.$radiosForm.off("submit"),this.$shell.off("click"),this.$customUpgrade.off("click",this.customUpgrade),this.$(".button-block").off("click"),this.$(".button-reconnect").off("click"),this.$uplinkDevice.off("click"),this.$connectionType.off("change"),this.$overrideForm.off("submit"),this.$overrideForm.find('button[name="restore"]').off("click"),this.$overrideForm.find('button[name="cancel"]').off("click"),this.$("select.wlan-group-ng").off("change"),this.$("select.wlan-group-na").off("change"),this.$('input[name="ng.min_rssi_enabled"]').off("change"),this.$('input[name="na.min_rssi_enabled"]').off("change"),this.$("select.radio-ht").off("change"),this.unstickit(this.model),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("text!includes/gateway/gatewayPortForwardFormTemplate.html",[],function(){return'<form>\n    <fieldset class="fieldset">\n        <div class="row">\n            <label class="label inline"><%- msg.G_Name %></label>\n            <input type="text" class="input inline" name="name" value="" />\n        </div>\n        <div class="row source">\n            <label class="label inline"><%- msg.G_PortForwardSource %></label>\n            \n            <div class="radio-group left">\n                <label><input type="radio" name="src_type" value="any" /> <%- msg.G_PropertiesPortFwdSrcAnywhere %></label>\n                <label><input type="radio" name="src_type" value="limited" /> <%- msg.G_PropertiesPortFwdSrcLimited %></label>\n            </div>\n            \n            <input type="text" class="input inline" name="src" value="" />\n        </div>\n        <div class="row">\n            <label class="label inline"><%- msg.G_Port %></label>\n            <input type="text" class="input inline" name="dst_port" value="" />\n            <label class="tip inline">(1000,1002-1004,...)\n        </div>\n        <div class="row">\n            <label class="label inline"><%- msg.G_PortForwardDestIp %></label>\n            <input type="text" class="input inline" name="fwd" value="" />\n        </div>\n        <div class="row">\n            <label class="label inline"><%- msg.G_PortForwardDestPort %></label>\n            <input type="text" class="input inline" name="fwd_port" value="" />\n        </div>\n    </fieldset>\n    \n    <fieldset class="fieldset">\n        <legend class="legend"><%- msg.G_SettingsAdvancedOpts %></legend>\n        \n        <div class="row">\n            <label class="label inline"><%- msg.G_PropertiesProtocol %></label>\n            \n            <div class="radio-group">\n                <label><input type="radio" name="proto" value="tcp_udp" /> <%- msg.G_Both %></label>\n                <label><input type="radio" name="proto" value="tcp" /> <%- msg.G_PropertiesTcp %></label>\n                <label><input type="radio" name="proto" value="udp" /> <%- msg.G_PropertiesUdp %></label>\n            </div>\n        </div>\n    </fieldset>\n    \n    <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n    <button class="button" name="cancel" value="Cancel" type="button"><%- msg.G_Cancel %></button>\n</form>'}),define("unifi/view/gateway/PortForwardFormView",["unifi/view/app/FormView","jquery","underscore","msg/Msg","text!includes/gateway/gatewayPortForwardFormTemplate.html"],function(e,t,i,a,n){"use strict";return e.extend({_templateId:i.template(n,{msg:a}),_prevalidate:{name:{input:"text"},src:{input:"text"},dst_port:{input:"text"},fwd:{input:"text"},fwd_port:{input:"text"}},events:{"click button[name=cancel]":"remove"},render:function(){var t=this,i=this.rendered;e.prototype.render.call(this);var a=this.$container.parents(".portfwd-config");if(a.addClass("show-form"),!i){this.on("remove",function(){a.removeClass("show-form")}),this.$fwdPort=this.$("input[name=fwd_port]"),this.$dstPort=this.$("input[name=dst_port]"),this.$src_type=this.$("input[name=src_type]"),this.$src_type_limited=this.$("input[name=src_type][value=limited]"),this.$src=this.$("input[name=src]"),this.$dstPort.on("change",function(e){var i=t.$dstPort.val().indexOf("-")>=0||t.$dstPort.val().indexOf(",")>=0;t.$fwdPort.val(t.$dstPort.val()),t.$fwdPort.enable(),i&&t.$fwdPort.disable()}),this.$fwdPort.on("change",function(e){var i=t.$fwdPort.val().indexOf("-")>=0||t.$fwdPort.val().indexOf(",")>=0;t.$fwdPort.enable(),i&&(t.$dstPort.val(t.$fwdPort.val()),t.$fwdPort.disable())});var n=this.$dstPort.val().indexOf("-")>=0||this.$dstPort.val().indexOf(",")>=0,o=this.$fwdPort.val().indexOf("-")>=0||this.$fwdPort.val().indexOf(",")>=0;this.$fwdPort.enable(),n?(this.$fwdPort.val(this.$dstPort.val()),this.$fwdPort.disable()):o&&this.$fwdPort.val(this.$dstPort.val()),this.$src_type.on("change",function(e){t.$src_type_limited.is(":checked")?t.$src.enable():(t.$src.disable(),t.$src.val(""),t.valid(["src"]))}),this.$src_type_limited.is(":checked")?this.$src.enable():this.$src.disable(),this.app.isReadOnly||this.prevalidator()}},populate:function(){var e=this.model.get("src"),t=!e||"any"==e;this.model&&(this.$el.find("input[name=name]").val(this.model.get("name")),this.$el.find("input[name=src_type][value="+(t?"any":"limited")+"]").prop("checked",!0),this.$el.find("input[name=src]").val(t?"":e),this.$el.find("input[name=dst_port]").val(this.model.get("dst_port")),this.$el.find("input[name=fwd]").val(this.model.get("fwd")),this.$el.find("input[name=fwd_port]").val(this.model.get("fwd_port")),this.$el.find("input[name=proto][value="+(this.model.get("proto")||"tcp_udp")+"]").prop("checked",!0))},gather:function(){var e=this.$el.find("input[name=src]").val(),t="any"==this.$el.find("input[name=src_type]:checked").val();return{name:this.$el.find("input[name=name]").val(),src:t?"any":e,dst_port:this.$el.find("input[name=dst_port]").val(),fwd:this.$el.find("input[name=fwd]").val(),fwd_port:this.$el.find("input[name=fwd_port]").val(),proto:this.$el.find("input[name=proto]:checked").val()}},success:function(){this.remove()},error:function(e,t){this.options.app.views.app.flash("error","Error",a.apiError(t))},remove:function(){this.$("input[name=dst_port]").off(),e.prototype.remove.apply(this,arguments)}})}),define("text!includes/gateway/gatewayDynamicDNSFormTemplate.html",[],function(){return'<form>\n    <fieldset class="fieldset">\n        <div class="row">\n            <label class="label inline"><%- msg.G_PropertiesDDNSService %></label>\n            <select name="service" class="input inline">\n                <option value="afraid" selected="selected"><%- msg.G_PropertiesDDNSServiceAfraid %></option>\n                <option value="dnspark"><%- msg.G_PropertiesDDNSServiceDnspark %></option>\n                <option value="dslreports"><%- msg.G_PropertiesDDNSServiceDslreports %></option>\n                <option value="dyndns"><%- msg.G_PropertiesDDNSServiceDyndns %></option>\n                <option value="easydns"><%- msg.G_PropertiesDDNSServiceEasydns %></option>\n                <option value="namecheap"><%- msg.G_PropertiesDDNSServiceNamecheap %></option>\n                <option value="sitelutions"><%- msg.G_PropertiesDDNSServiceSitelutions %></option>\n                <option value="zoneedit"><%- msg.G_PropertiesDDNSServiceZoneedit %></option>\n            </select>\n        </div>\n        <div class="row">\n            <label class="label inline"><%- msg.G_PropertiesDDNSHostname %></label>\n            <input type="text" class="input inline" name="host_name" value="" />\n        </div>\n        <div class="row">\n            <label class="label inline"><%- msg.G_PropertiesDDNSUsername %></label>\n            <input type="text" class="input inline" name="login" value="" />\n        </div>\n        <div class="row">\n            <label class="label inline"><%- msg.G_PropertiesDDNSPassword %></label>\n            <input type="password" class="input inline" name="x_password" value="" />\n        </div>\n        <div class="row">\n            <label class="label inline"><%- msg.G_PropertiesDDNSServer %></label>\n            <input type="text" class="input inline" name="server" value="" />\n        </div>\n    </fieldset>\n\n    <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n    <button class="button" name="cancel" value="Cancel" type="button"><%- msg.G_Cancel %></button>\n</form>\n'}),define("unifi/view/gateway/DynamicDNSFormView",["unifi/view/app/FormView","jquery","underscore","msg/Msg","text!includes/gateway/gatewayDynamicDNSFormTemplate.html"],function(e,t,i,a,n){"use strict";return e.extend({_templateId:i.template(n,{msg:a}),_prevalidate:{login:{input:"text"},x_password:{input:"password"},host_name:{input:"text"},server:{input:"text"}},events:{"click button[name=cancel]":"remove"},render:function(){var t=this.rendered;e.prototype.render.call(this);var i=this.$container.parents(".dynamicdns-config");i.addClass("show-form"),this.$el.find("input[name=x_password-text]").addClass("input inline"),t||(this.on("remove",function(){i.removeClass("show-form")}),this.app.isReadOnly||this.prevalidator())},populate:function(){this.model&&(this.$el.find("select[name=service]").val(this.model.get("service")||"afraid").trigger("change"),this.$el.find("input[name=host_name]").val(this.model.get("host_name")),this.$el.find("input[name=login]").val(this.model.get("login")),this.$el.find("input[name=x_password]").val(this.model.get("x_password")),this.$el.find("input[name=server]").val(this.model.get("server")))},gather:function(){var e={service:this.$el.find("select[name=service] option:selected").val(),host_name:this.$el.find("input[name=host_name]").val(),login:this.$el.find("input[name=login]").val(),x_password:this.$el.find("input[name=x_password]").val(),server:this.$el.find("input[name=server]").val()};return e},success:function(){this.remove()},error:function(e,t){this.options.app.views.app.flash("error","Error",a.apiError(t,!0))},remove:function(){e.prototype.remove.apply(this,arguments)}})}),define("text!includes/gateway/DpiPropertyTemplate.html",[],function(){return'<div class="category header">\n    <span><%- msg.G_PropertiesTotalUsage %></span>\n     - \n    <span class="totalBytes"></span> \n    (\n        <span class="ubnt-icon-arrow-down"></span> \n        <span class="rxBytes"></span>  \n        <span class="ubnt-icon-arrow-up"></span> \n        <span class="txBytes"></span>\n    )\n</div>\n<div class="category graph">\n    <div class="chart"></div>\n    <div class="chartDetail">\n        <span class="name"></span> - \n        <span class="totalBytes"></span> \n        (\n            <span class="ubnt-icon-arrow-down"></span> \n            <span class="rxBytes"></span>  \n            <span class="ubnt-icon-arrow-up"></span> \n            <span class="txBytes"></span>\n        )\n    </div>\n</div>\n<div class="category detail"></div>\n\n<div class="application header">\n    <div class="back"><%- msg.G_PropertiesTotalUsage %> ></div>\n    <div class="title">"<span class="name"></span>" <%- msg.G_PropertiesUsageByClient %></div>\n</div>\n<div class="application chart data-table">\n</div>\n'}),define("unifi/model/ClientDpi",["unifi/model/Model","unifi/util/DpiRuleMap","unifi/util/DpiIconMap","msg/Msg"],function(e,t,i,a){"use strict";return e.extend({idAttribute:"app",name:function(){var e=t.applications[65536*this.get("cat")+this.get("app")];return e?e.name:"("+a.G_Unknown.toLowerCase()+")"},iconUrl:function(){var e=i.applications[65536*this.get("cat")+this.get("app")];return e?e.iconUrl:null},bytesTotal:function(){var e=this.get("rx_bytes")||0,t=this.get("tx_bytes")||0;return e+t},packetsTotal:function(){var e=this.get("rx_packets")||0,t=this.get("tx_packets")||0;return e+t}})}),define("unifi/util/DpiDevidMap",[],function(){"use strict";return{devids:{dev_type_ids:{1:{name:"Desktop/Laptop"},10:{name:"VoIP Gateway"},11:{name:"Printer"},12:{name:"Wireless Access Point"},13:{name:"Switch"},14:{name:"Wireless Controller"},15:{name:"Media Link Controller"},16:{name:"Network Diagnostics"},17:{name:"Game Console"},18:{name:"NAS"},19:{name:"PDA"},2:{name:"Router"},20:{name:"Multimedia Device"},21:{name:"eBook Reader"},22:{name:"Scanner"},23:{name:"Video Conferencing"},24:{name:"DVR"},25:{name:"Thin Client"},255:{name:"Unknown"},26:{name:"Phone"},27:{name:"Video Phone"},28:{name:"Workstation"},29:{name:"Apple iOS Device"},3:{name:"VoIP Phone"},30:{name:"Tablet"},31:{name:"SmartTV"},32:{name:"Android Device"},33:{name:"Automation Switch"},34:{name:"Projector"},35:{name:"Wireless Lighting"},4:{name:"Miscellaneous"},5:{name:"IPTV"},6:{name:"Smartphone"},7:{name:"UPS"},8:{name:"Wireless Router"},9:{name:"IP Network Camera"}},device_ids:{1:{name:"2Wire Residential Gateway"},10:{name:"Android 1.0"},100:{name:"Gentoo 2006.1"},101:{name:"Gentoo 2007.0"},102:{name:"Gentoo 2008.0 R1"},103:{name:"Haiku"},104:{name:"Hakin9 Live 2.8"},105:{name:"Hewlett-Packard iLO Agent"},106:{name:"Hewlett-Packard iLO Agent (Not Configured)"},107:{name:"Hewlett-Packard JetDirect (J311xA/J32xxx)"},108:{name:"Hewlett-Packard JetDirect (J4169A/J6035D/J6038A/J6..."},109:{name:"Hewlett-Packard JetDirect (J6035A)"},11:{name:"Android 1.5-2.1"},110:{name:"Hewlett-Packard JetDirect (J7973E)"},111:{name:"Hewlett-Packard LaserJet P2015 Printer Series"},112:{name:"Hewlett-Packard Printer"},113:{name:"Hewlett-Packard Printer MFP"},114:{name:"Hewlett-Packard Procurve"},115:{name:"Hewlett-Packard ProCurve AP"},116:{name:"Hotway LanDrive"},117:{name:"Internet Connection Sharing - Microsoft"},118:{name:"iPhone/iPad/iPod"},119:{name:"Amazon Kindle"},12:{name:"Android 2.2-2.3"},120:{name:"Knoppix"},121:{name:"Kyocera FS-1028MFP"},122:{name:"Kyocera KM-XXXX"},123:{name:"Kyocera Printer"},124:{name:"Lexmark MFP Printer"},125:{name:"Lexmark Printer"},126:{name:"LifeSize Room"},127:{name:"Linksys BEFW11S4"},128:{name:"Linksys PAP2/SPA 941"},129:{name:"Linksys Router"},13:{name:"Android 3.0-4.1"},130:{name:"Linux 2.0.x"},131:{name:"Linux 2.2.x"},132:{name:"Linux 2.4.x"},133:{name:"Linux 2.6.x"},134:{name:"Linux Mint Debian"},135:{name:"Mac OS 9.1"},136:{name:"Mac OS 9.2"},137:{name:"Mac OS 9.x"},138:{name:"Mac OS X"},139:{name:"Mandriva 2011"},14:{name:"Android 4.2-4.4"},140:{name:"Mediatrix VoIP Adapter"},141:{name:"Meraki Indoor"},142:{name:"Mitel IP Phone"},143:{name:"Moneris HiSpeed 3100IP"},144:{name:"Motorola NIM100"},145:{name:"Motorola Router"},146:{name:"Neoware Capio Thin Client (Windows CE)"},147:{name:"Neoware e100 Thin Client (NeoLinux)"},148:{name:"NetBotz WallBotz 400C"},149:{name:"NetBotz WallBotz 420E"},15:{name:"Android 4.4"},150:{name:"NetBotz WallBotz 500"},151:{name:"NETGEAR FVS114"},152:{name:"NETGEAR Router"},153:{name:"NETGEAR WGR614v6"},154:{name:"NETGEAR WGT624v4"},155:{name:"NETGEAR WNDR3000"},156:{name:"NETGEAR WNR3500L"},157:{name:"NETGEAR WNR854T"},158:{name:"Nokia 6086 UMA"},159:{name:"Nokia E-Series"},16:{name:"Anonym.OS"},160:{name:"Nokia Internet Tablet"},161:{name:"Nortel IP Phone"},162:{name:"Novell NetWare Client"},163:{name:"OpenBSD"},164:{name:"OpenSolaris 2008.11 - 2010.02"},165:{name:"openSUSE 12.1"},166:{name:"OS/2 Warp"},167:{name:"PC-BSD 1.4"},168:{name:"PC-BSD 1.5"},169:{name:"pdaNet"},17:{name:"APC UPS"},170:{name:"PlayStation 2"},171:{name:"PlayStation 3"},172:{name:"Polycom Video Phone (VSX 3000A)"},173:{name:"Polycom ViewStation"},174:{name:"Porteus 1.0"},175:{name:"Puppy Linux 4.x"},176:{name:"PXE Client"},177:{name:"PXE Client (ZEN)"},178:{name:"Red Hat Linux"},179:{name:"ReplayTV"},18:{name:"Apple Airport"},180:{name:"ShoreTel IP Phone"},181:{name:"Siemens OpenStage 20/40/60/80"},182:{name:"Siemens optiPoint 150 S"},183:{name:"Siemens optiPoint 410/420"},184:{name:"Siemens optiPoint WL2 professional"},185:{name:"Sipura VoIP Adaptor"},186:{name:"Slax 5.x-6.x based distros"},187:{name:"SLED 10"},188:{name:"SLED 10.1"},189:{name:"Slingbox"},19:{name:"Apple Airport Extreme"},190:{name:"SPA 942"},191:{name:"Sun Blade 100 Workstation"},192:{name:"SunOS 5.6"},193:{name:"SunRocket Gizmo"},194:{name:"SUSE Linux Enterprise"},195:{name:"SUSE Linux Enterprise 9.3"},196:{name:"Sweex LW050 WAP"},197:{name:"Symbol Wireless Access Point"},198:{name:"Symbol Wireless Switch"},199:{name:"TallyGenicom Printer"},2:{name:"3Com IP Phone"},20:{name:"Apple Netboot"},200:{name:"TANDBERG"},201:{name:"TANDBERG 1000"},202:{name:"TiVo"},203:{name:"TP-LINK Wireless LAN Router"},204:{name:"Trapeze 2330 Wireless Access Point"},205:{name:"Trapeze MP-422 Wireless Access Point"},206:{name:"Trendnet IP Camera"},207:{name:"Trendnet Print Server"},208:{name:"Trendnet Wireless Access Point"},209:{name:"Ubuntu"},21:{name:"Avaya IP Phone"},210:{name:"Ubuntu 11 based distro"},211:{name:"Ubuntu 6.0.6"},212:{name:"Ubuntu 6.10"},213:{name:"Ubuntu 7.x based distro"},214:{name:"Ubuntu 8.04"},215:{name:"Ubuntu 8.10 based distro"},216:{name:"Ubuntu 9-10 based distro"},217:{name:"UniData IP Phone"},218:{name:"Uniden DTA VoIP Adapater"},219:{name:"UTStarcom F3000"},22:{name:"Axis Network Camera"},220:{name:"WD My Book World Edition"},221:{name:"WD ShareSpace"},222:{name:"Wii"},223:{name:"Windows 2000"},224:{name:"Windows 7"},225:{name:"Windows 8"},226:{name:"Windows 95"},227:{name:"Windows 95 B"},228:{name:"Windows 98"},229:{name:"Windows 98 SE"},23:{name:"Backtrack 1.0"},230:{name:"Windows CE"},231:{name:"Windows ME"},232:{name:"Windows NT 4"},233:{name:"Windows Phone 7.5"},234:{name:"Windows Phone 8.0"},235:{name:"Windows Server 2003"},236:{name:"Windows Server 2008"},237:{name:"Windows Vista"},238:{name:"Windows XP"},239:{name:"Windows"},24:{name:"BATM VoIP Adapter"},240:{name:"Xbox"},241:{name:"Xbox 360"},242:{name:"Xerox Printer"},243:{name:"Xerox WorkCentre"},244:{name:"Zenwalk based distro"},245:{name:"ZyXEL WiFi Phone"},246:{name:"Apple iPod"},247:{name:"Apple iPhone"},248:{name:"Apple iPad"},249:{name:"Apple TV"},25:{name:"Belkin F5D8235-4 v2"},250:{name:"BarnesNoble NOOK"},251:{name:"SonyEricsson Symbian Phone"},252:{name:"SonyEricsson Android Phone"},253:{name:"Sony Android Device"},254:{name:"Sony PSP"},255:{name:"Unknown"},256:{name:"Nintendo Wii"},257:{name:"Nokia Symbian"},258:{name:"Nokia Lumia"},259:{name:"Nokia Windows Phone"},26:{name:"Belkin Skype Phone"},260:{name:"Google Nexus Series"},261:{name:"HTC Android Phone"},262:{name:"HTC Windows Phone"},263:{name:"ASUS Transformer"},264:{name:"ASUS PadFone"},265:{name:"Motorola XOOM"},266:{name:"Motorola Droid"},267:{name:"Motorola Android Phone"},268:{name:"Huawei Android Phone"},269:{name:"Samsung Smartphone"},27:{name:"BeOS 4.x"},270:{name:"Samsung Symbian"},271:{name:"Samsung Android Tab"},272:{name:"Samsung Android Phone"},273:{name:"Samsung Windows Phone"},274:{name:"LG Android Tab"},275:{name:"LG Android Phone"},276:{name:"Android Device"},277:{name:"Windows Mobile Device"},278:{name:"Windows Phone Device"},279:{name:"Macintosh"},28:{name:"BeOS 5.0"},280:{name:"FreeBSD"},281:{name:"SunOS"},282:{name:"Solaris"},283:{name:"Linux"},284:{name:"Sony PlayStation 2"},285:{name:"Sony PlayStation 3"},286:{name:"Firefox Device"},287:{name:"D-Link Boxee"},288:{name:"Belkin wemo"},289:{name:"Canon Photo Printer"},29:{name:"BlackBerry"},290:{name:"NEC M300X"},291:{name:"Roku"},292:{name:"Roku Device"},293:{name:"FirefoxOS Mobile"},294:{name:"NETGEAR NTV300"},295:{name:"TrendMicro JewelryBox"},296:{name:"Chromecast"},297:{name:"Samsung SmartTV"},298:{name:"Xbox One"},299:{name:"Amazon Kindle Fire"},3:{name:"Adobe Flash Player"},30:{name:"Bluesocket BSC"},300:{name:"Sony Android Tab"},301:{name:"Asus Pad"},302:{name:"Alcatel Device"},303:{name:"Apple iPhone 5s"},304:{name:"Apple iPhone 5"},305:{name:"Apple iPhone 5c"},306:{name:"Sharp SmartTV"},307:{name:"Xiaomi Router"},308:{name:"Apple iPhone 6 Plus"},309:{name:"Apple iPhone 6"},31:{name:"Brother Printer"},310:{name:"Apple iPhone 4s"},311:{name:"Apple iPhone 4"},312:{name:"Apple iPad Mini"},313:{name:"Apple iPad Air"},314:{name:"Apple iPad 4"},315:{name:"Apple iPad 3"},316:{name:"Apple iPad 2"},317:{name:"Samsung Galaxy S5"},318:{name:"Samsung Galaxy S4"},319:{name:"Samsung Galaxy S3"},32:{name:"Brother Printer 2"},320:{name:"Samsung Galaxy Note 4"},321:{name:"Samsung Galaxy Note 3"},322:{name:"Samsung Galaxy Note 3 Neo"},323:{name:"Samsung Galaxy Note 2"},324:{name:"Samsung Galaxy Note"},325:{name:"Samsung Galaxy NotePRO"},326:{name:"Samsung Galaxy Tab"},327:{name:"Samsung Galaxy Tab S"},328:{name:"Samsung Galaxy TabPRO"},329:{name:"Sony Xperia Z3"},33:{name:"Buffalo Wireless Access Point"},330:{name:"Sony Xperia Z3 Compact"},331:{name:"Sony Xperia Z3 Tablet"},332:{name:"Sony Xperia Z2a"},333:{name:"Sony Xperia Z2"},334:{name:"Sony Xperia Z2 Tablet"},335:{name:"Sony Xperia Z1"},336:{name:"Sony Xperia Z1 Compact"},337:{name:"Sony Xperia Tablet Z"},338:{name:"Sony Xperia Z Ultra"},339:{name:"Sony Xperia Z"},34:{name:"Canon Printer"},340:{name:"Sony Xperia L"},341:{name:"Sony Xperia ZR"},342:{name:"Sony Xperia SP"},343:{name:"Sony Xperia ZL"},344:{name:"Sony Xperia C"},345:{name:"Sony Xperia C3"},346:{name:"Sony Xperia T3"},347:{name:"Sony Xperia E1"},348:{name:"Sony Xperia E3"},349:{name:"Sony Xperia M"},35:{name:"Cisco 7905 IP Phone"},350:{name:"Sony Xperia M2"},351:{name:"Sony Xperia M2 Agua"},352:{name:"HTC Butterfly 2"},353:{name:"HTC Butterfly Series"},354:{name:"HTC Desire 610"},355:{name:"HTC Desire 816"},356:{name:"HTC Desire Series"},357:{name:"HTC One E8"},358:{name:"HTC One M8"},359:{name:"HTC One Max"},36:{name:"Cisco 7910 IP Phone"},360:{name:"HTC One Mini 2"},361:{name:"HTC One Mini"},362:{name:"HTC One X+"},363:{name:"HTC One Series"},364:{name:"HTC EVO Series"},365:{name:"HTC J"},366:{name:"HTC Flyer"},367:{name:"HTC Sensation Series"},368:{name:"HTC Wildfire Series"},369:{name:"Sony PlayStation 4"},37:{name:"Cisco 7911x IP Phone"},370:{name:"Synology NAS"},371:{name:"Apple iPad Mini 3"},372:{name:"Apple iPad Air 2"},373:{name:"Amazon Fire TV"},374:{name:"Nintendo 3DS"},375:{name:"Google Nexus 4"},376:{name:"Google Nexus 5"},377:{name:"Google Nexus 7"},378:{name:"Google Nexus 9"},379:{name:"Google Nexus 10"},38:{name:"Cisco 7912 IP Phone"},380:{name:"Huawei MediaPad"},381:{name:"Xiaomi Redmi"},382:{name:"Xiaomi Mi 3"},383:{name:"Xiaomi Mi 2 Series"},384:{name:"Lenovo YOGA Tablet"},385:{name:"Philips hue"},386:{name:"Vonage VoIP Phone"},387:{name:"Sony BRAVIA SmartTV"},388:{name:"Sony Xperia Z1 f"},389:{name:"Sony Xperia AX"},39:{name:"Cisco 7935 IP Phone"},390:{name:"Sony Xperia GX"},391:{name:"Sony Xperia SX"},392:{name:"Sony Reader PRS-T3"},393:{name:"HTC INFOBAR"},394:{name:"HTC J One"},395:{name:"Samsung Galaxy Tab Plus"},396:{name:"LG SmartTV"},397:{name:"Fujitsu ANTEPRIMA F-09D"},398:{name:"Sharp AQUOS PAD"},399:{name:"Sharp AQUOS PHONE Xx"},4:{name:"Alcatel 4037 Advanced Reflex IP Phone"},40:{name:"Cisco 7940/7960x IP Phone"},400:{name:"Sharp AQUOS PHONE Xx mini"},401:{name:"Sharp AQUOS PHONE SL"},402:{name:"Sharp AQUOS PHONE CL"},403:{name:"Sharp AQUOS PHONE EX"},404:{name:"Sharp AQUOS PHONE SERIE"},405:{name:"Sharp AQUOS PHONE SERIE mini"},406:{name:"Sharp AQUOS PHONE si"},407:{name:"Sharp AQUOS PHONE ss"},408:{name:"Sharp AQUOS PHONE st"},409:{name:"Sharp AQUOS PHONE sv"},41:{name:"Cisco 7961G IP Phone"},410:{name:"Sharp AQUOS PHONE ZETA"},411:{name:"Sharp AQUOS ZETA"},412:{name:"Sharp AQUOS SmartTV"},413:{name:"Sharp AQUOS PHONE Vivienne Westwood"},414:{name:"Fujitsu ARROWS A"},415:{name:"Fujitsu ARROWS ef"},416:{name:"Fujitsu ARROWS Kiss"},417:{name:"Fujitsu ARROWS V"},418:{name:"Fujitsu ARROWS X"},419:{name:"Fujitsu ARROWS NX"},42:{name:"Cisco 7965G IP Phone"},420:{name:"Fujitsu ARROWS Z"},421:{name:"Fujitsu ARROWS REGZA Phone"},422:{name:"Fujitsu ARROWS Tab"},423:{name:"Hitachi SmartTV"},424:{name:"Mitsubishi SmartTV"},425:{name:"Panasonic Viera SmartTV"},426:{name:"Toshiba REGZA SmartTV"},427:{name:"NEC MEDIAS W"},428:{name:"Kyocera URBANO L01"},429:{name:"Kyocera URBANO L02"},43:{name:"Cisco Aironet 1100"},430:{name:"Kyocera URBANO L03"},431:{name:"Kyocera TORQUE G01"},432:{name:"Chromebook"},433:{name:"Hitachi Wooo TV"},434:{name:"Mitsubishi LCD SmartTV"},435:{name:"Panasoic DMR"},436:{name:"Panasoic SmartTV"},437:{name:"Pioneer BDP"},438:{name:"Sony BDZ"},439:{name:"Sony BDP"},44:{name:"Cisco Aironet 1130"},440:{name:"Sony PlayStation Portable"},441:{name:"Sony PlayStation Vita"},442:{name:"Toshiba DBR"},443:{name:"Toshiba SmartTV"},444:{name:"Nintendo Wii U"},445:{name:"Ooma VoIP Adapter"},446:{name:"Fujitsu ARROWS"},447:{name:"Fujitsu Disney"},448:{name:"Fujitsu Raku-Raku"},449:{name:"Sharp AQUOS PHONE"},45:{name:"Cisco Aironet 1140"},450:{name:"Sharp AQUOS PHONE THE PREMIUM"},451:{name:"Sharp AQUOS PHONE THE HYBRID"},452:{name:"Sharp PANTON 4"},453:{name:"Sharp PANTON 5"},454:{name:"Sharp PANTON 6"},455:{name:"Sharp PANTON WATERPROOF"},456:{name:"Sharp Galapagos"},457:{name:"NEC MEDIAS CH"},458:{name:"NEC MEDIAS BR"},459:{name:"NEC MEDIAS PP"},46:{name:"Cisco Aironet 1200"},460:{name:"NEC MEDIAS U"},461:{name:"NEC Disney"},462:{name:"NEC MEDIAS"},463:{name:"NEC MEDIAS X"},464:{name:"NEC MEDIAS ES"},465:{name:"NEC MEDIAS WP"},466:{name:"NEC MEDIAS Tab"},467:{name:"NEC MEDIAS Tab UL"},468:{name:"Kyocera DIGNO S"},469:{name:"Kyocera DIGNO M"},47:{name:"Cisco Aironet 1240"},470:{name:"Alcatel One Touch Evolve"},471:{name:"ASUS PadFone 2"},472:{name:"Asus Fonepad"},473:{name:"Asus Fonepad 7"},474:{name:"CASIO GzOne TYPE-L"},475:{name:"Fujitsu ARROWS Me"},476:{name:"HTC J Butterfly"},477:{name:"Huawei Stream"},478:{name:"Huawei Stream S"},479:{name:"Huawei Stream X"},48:{name:"Cisco Aironet 1300"},480:{name:"Huawei MediaPad 7 Lite"},481:{name:"Kobo Arc 7 HD"},482:{name:"Kyocera Honey Bee"},483:{name:"Kyocera DIGNO R"},484:{name:"Kyocera Disney"},485:{name:"Kyocera URBANO PROGRESSO"},486:{name:"Kyocera Digno Dual 2"},487:{name:"Lenovo IdeaTab"},488:{name:"LG Optimus L1 II Dual"},489:{name:"LG Optimus L5II"},49:{name:"Cisco Aironet 1310"},490:{name:"LG Optimus L5II Duet"},491:{name:"LG Optimus Vu JOJO"},492:{name:"LG Optimus G"},493:{name:"LG Optimus G Flex"},494:{name:"LG Optimus L7"},495:{name:"LG Optimus F5"},496:{name:"Motorola Droid RAZR M"},497:{name:"Motorola Droid RAZR HD"},498:{name:"Motorola Droid XYBOARD"},499:{name:"Motorola DEFY Mini"},5:{name:"Alcatel IP Touch 8 Series Phones"},50:{name:"Cisco Aironet 1500"},500:{name:"Motorola DEFY XT"},501:{name:"Motorola Admiral"},502:{name:"Motorola Master"},503:{name:"Motorola MOTO"},504:{name:"Motorola Electrify 2"},505:{name:"Motorola Droid RAZR V"},506:{name:"Motorola RAZR i"},507:{name:"Motorola Photon Q"},508:{name:"Motorola Electrify M"},509:{name:"Motorola RAZR M"},51:{name:"Cisco Aironet 4800"},510:{name:"Motorola Droid RAZR M"},511:{name:"Motorola RAZR XT910"},512:{name:"Motorola RAZR D1"},513:{name:"Motorola RAZR D3"},514:{name:"NEC LifeTouch L"},515:{name:"NEC LaVie Tab S"},516:{name:"Panasonic Eluga"},517:{name:"Panasonic Disney"},518:{name:"Panasonic Eluga V"},519:{name:"Panasonic Eluga Power"},52:{name:"Cisco ATA 186"},520:{name:"Panasonic Eluga Live"},521:{name:"Samsung Galaxy Core"},522:{name:"Samsung Galaxy Win"},523:{name:"Samsung Galaxy Mega"},524:{name:"Samsung Galaxy Pocket Neo"},525:{name:"Samsung Galaxy Fame"},526:{name:"Samsung Galaxy Ace 3"},527:{name:"Samsung Galaxy S II"},528:{name:"Samsung Galaxy Young"},529:{name:"Samsung Galaxy Fame Lite"},53:{name:"Cisco Catalyst 29xx"},530:{name:"Samsung Galaxy Fame Lite Duos"},531:{name:"Samsung Galaxy Trend Lite"},532:{name:"Samsung Galaxy S Duos"},533:{name:"Samsung Galaxy S Duos 2"},534:{name:"Samsung Galaxy S"},535:{name:"Samsung Galaxy J"},536:{name:"Samsung Galaxy S III alpha"},537:{name:"Sharp Disney"},538:{name:"Sharp AQUOS PHONE CRYSTAL"},539:{name:"Sharp AQUOS PHONE Slider"},54:{name:"Cisco Catalyst 35xx"},540:{name:"Sharp Q-pot PHONE"},541:{name:"Sharp Junior"},542:{name:"Sharp AQUOS PHONE NERV"},543:{name:"Sharp Lynx"},544:{name:"Sharp Shot PHONE"},545:{name:"Sony Xperia T2 Ultra"},546:{name:"Sony Xperia Arc"},547:{name:"Sony Xperia Tablet S"},548:{name:"Sony Xperia A"},549:{name:"Sony Xperia VL"},55:{name:"Cisco IP Phone"},550:{name:"Sony Xperia UL"},551:{name:"Sony Xperia ZL2"},552:{name:"Sony Xperia tipo"},553:{name:"Toshiba Tablet"},554:{name:"Toshiba REGZA Tablet"},555:{name:"Alcatel One Touch Idol"},556:{name:"Alcatel One Touch Idol X"},557:{name:"Mitsubishi DVR"},558:{name:"Nintendo DSi"},559:{name:"Coolpad 5216D"},56:{name:"Cisco Wireless Access Point"},560:{name:"Coolpad 5879T"},561:{name:"Coolpad 5890"},562:{name:"Coolpad 5951"},563:{name:"Coolpad 5950T"},564:{name:"Coolpad 7270"},565:{name:"Coolpad 7295T"},566:{name:"Coolpad 7620L"},567:{name:"Coolpad 8012"},568:{name:"Coolpad 8297"},569:{name:"Coolpad 8720L"},57:{name:"Clipcomm IP Phone"},570:{name:"Coolpad 9080W"},571:{name:"Coolpad D530TW"},572:{name:"Coolpad device"},573:{name:"Fujitsu Girls"},574:{name:"Android 5.0"},575:{name:"D-Link IPCam"},576:{name:"FreeBSD 10.1"},58:{name:"Compex Wireless Access Point"},59:{name:"DD-WRT Router"},6:{name:"Amino AmiNET110"},60:{name:"Debian 3.1"},61:{name:"Debian 4 based distro"},62:{name:"Debian 6"},63:{name:"Debian-based Linux"},64:{name:"Dell Printer"},65:{name:"D-Link Wireless Router"},66:{name:"DNSChanger Trojan"},67:{name:"DSL 4.4.x"},68:{name:"Enterasys HiPath Wireless Access Point 2610/2620/2..."},69:{name:"Enterasys HiPath Wireless Access Point 2630/2640"},7:{name:"Amino AmiNET110 (Not configured)"},70:{name:"Enterasys HiPath Wireless Access Point 3610/3620"},71:{name:"Enterasys HiPath Wireless C20N Controller"},72:{name:"Enterasys Matrix N-Series DFE-G/P/D"},73:{name:"Enterasys RBT-1002-EU Wireless Access Point"},74:{name:"Enterasys RBT-1602 Wireless Access Point"},75:{name:"Enterasys RBT-1602C Wireless Access Point"},76:{name:"Enterasys RBT-4102C-EU Wireless Access Point"},77:{name:"Enterasys RBT-4102-EU Wireless Access Point"},78:{name:"Enterasys RBT-8200 Wireless Controller"},79:{name:"Enterasys SecureStack A2"},8:{name:"Anaconda"},80:{name:"Enterasys SecureStack B2/B3/C2/C3"},81:{name:"Epson Printer"},82:{name:"Etherboot/gPXE"},83:{name:"Extron MLC 226 IP"},84:{name:"Eye-Fi Wireless Memory Card"},85:{name:"Fedora 13 based distro"},86:{name:"Fedora 14 based distro"},87:{name:"Fedora 15-16 based distro"},88:{name:"Fedora 3-8 based distro"},89:{name:"Fedora 9-12 based distro"},9:{name:"Android 0.9"},90:{name:"Fluke OneTouch Series II/III"
},91:{name:"FreeBSD 6.0-6.2"},92:{name:"FreeBSD 6.3-7.2"},93:{name:"FreeNAS 0.7"},94:{name:"GameCube"},95:{name:"Gemtek Wireless Router"},96:{name:"Generic Printer"},97:{name:"Gentoo 2004.3"},98:{name:"Gentoo 2005.0"},99:{name:"Gentoo 2006.0"}},family_ids:{1:{name:"Smart TV &amp;  Set-top box"},2:{name:"Game Console"},255:{name:"Unknown"},3:{name:"Handheld"},4:{name:"Computer"},5:{name:"Intelligent Home Appliances"},6:{name:"Wearable devices"},7:{name:"Network &amp; Peripheral"}},os_class_ids:{1:{name:"Others"},10:{name:"Cisco Native Unix"},11:{name:"Cisco IOS"},12:{name:"Threat"},13:{name:"FreeBSD"},14:{name:"Haiku"},15:{name:"Windows"},16:{name:"Apple iOS"},17:{name:"Solaris"},18:{name:"OS/2 Warp"},19:{name:"XMB"},2:{name:"VxWorks"},20:{name:"Network Bootloader"},21:{name:"Unix"},22:{name:"Wii system"},23:{name:"Xbox"},24:{name:"Symbian"},25:{name:"Bada"},255:{name:"Unknown"},26:{name:"Firefox OS"},27:{name:"FirefoxOS"},28:{name:"ChromeOS"},3:{name:"Linux"},4:{name:"Network Boot Loader"},5:{name:"Android"},6:{name:"OpenBSD"},7:{name:"Mac OS"},8:{name:"BeOS"},9:{name:"BlackBerry"}},os_name_ids:{1:{name:"Others"},10:{name:"Android 4.4"},11:{name:"OpenBSD"},12:{name:"Mac OS X"},13:{name:"Linux 2.6"},14:{name:"BeOS 4"},15:{name:"BeOS 5"},16:{name:"BlackBerry"},17:{name:"Cisco Native Unix"},18:{name:"Cisco IOS"},19:{name:"Windows"},2:{name:"VxWorks"},20:{name:"Linux 2.4"},21:{name:"FreeBSD 6.0"},22:{name:"FreeBSD 6.3"},23:{name:"FreeNAS"},24:{name:"Haiku"},25:{name:"Apple iOS"},255:{name:"Unknown"},26:{name:"Linux 2.0"},27:{name:"Linux 2.2"},28:{name:"Mac OS 9.1"},29:{name:"Mac OS 9.2"},3:{name:"Linux"},30:{name:"Mac OS 9.x"},31:{name:"FreeBSD"},32:{name:"Maemo"},33:{name:"OpenSolaris"},34:{name:"OS/2 Warp"},35:{name:"FreeBSD 6.2"},36:{name:"XMB"},37:{name:"VxWorks 5.4"},38:{name:"SunOS"},39:{name:"VxWorks 5.5"},4:{name:"Android 0.9"},40:{name:"Wii system"},41:{name:"Windows 2000"},42:{name:"Windows 7"},43:{name:"Windows 8"},44:{name:"Windows 95"},45:{name:"Windows 95 B"},46:{name:"Windows 98"},47:{name:"Windows 98 SE"},48:{name:"Windows CE"},49:{name:"Windows ME"},5:{name:"Android 1.0"},50:{name:"Windows NT 4"},51:{name:"Windows Phone"},52:{name:"Windows Server 2003"},53:{name:"Windows Server 2008"},54:{name:"Windows Vista"},55:{name:"Windows XP"},56:{name:"Xbox"},57:{name:"Android"},58:{name:"Symbian"},59:{name:"Bada"},6:{name:"Android 1.5-2.1"},60:{name:"Windows Mobile"},61:{name:"Ubuntu"},62:{name:"Firefox OS"},63:{name:"FirefoxOS 1.3"},64:{name:"ChromeOS"},65:{name:"Android 5.0"},66:{name:"FreeBSD 10.1"},7:{name:"Android 2.2-2.3"},8:{name:"Android 3.0-4.1"},9:{name:"Android 4.2-4.3"}},vendor_ids:{1:{name:"Others"},10:{name:"American Power Conversion Corp."},100:{name:"BlackBerry Limited"},101:{name:"Nokia Oyj"},102:{name:"HTC Corporation"},103:{name:"ASUSTeK Computer Inc."},104:{name:"Huawei Technologies Co. Ltd."},105:{name:"Samsung Group"},106:{name:"LG Corporation"},107:{name:"Xerox Corp."},108:{name:"Zenwalk.org"},109:{name:"ZyXEL Corp."},11:{name:"Apple, Inc."},110:{name:"Mozilla Corporation"},111:{name:"D-Link Corporation"},112:{name:"NEC Corporation"},113:{name:"Roku, Inc."},114:{name:"Mozilla"},115:{name:"Trend Micro Inc."},116:{name:"Sharp Corporation"},117:{name:"Xiaomi Inc."},118:{name:"Synology Inc."},119:{name:"Lenovo Group Ltd."},12:{name:"Apple"},120:{name:"Philips"},121:{name:"Vonage Holdings Corp."},122:{name:"Fujitsu Ltd."},123:{name:"Hitachi, Ltd."},124:{name:"Mitsubishi Electric Corporation"},125:{name:"Panasonic Corporation"},126:{name:"Toshiba Corporation"},127:{name:"Pioneer Corporation"},128:{name:"Ooma, Inc."},13:{name:"Avaya, Inc."},14:{name:"Axis Communications"},15:{name:"remote-exploit.org"},16:{name:"BATM"},17:{name:"Belkin"},18:{name:"Be, Inc."},19:{name:"BlackBerry"},2:{name:"2Wire, Inc."},20:{name:"Bluesocket"},21:{name:"Brother Industries, Ltd."},22:{name:"Buffalo Technology, Inc."},23:{name:"Canon, Inc."},24:{name:"Cisco Systems, Inc."},25:{name:"Clipcomm, Inc."},255:{name:"Unknown"},26:{name:"Compex Systems Pte, Ltd."},27:{name:"DD-WRT"},28:{name:"Debian"},29:{name:"Dell, Inc."},3:{name:"3Com"},30:{name:"D-Link Systems, Inc."},31:{name:"Damn Small Linux"},32:{name:"Enterasys Networks, Inc."},33:{name:"Seiko Epson Corp."},34:{name:"Etherboot"},35:{name:"Extron"},36:{name:"EyeFi, Inc."},37:{name:"Fluke Electronics"},38:{name:"FreeBSD"},39:{name:"FreeNAS"},4:{name:"Adobe"},40:{name:"Nintendo Co., Ltd."},41:{name:"Gemtek Technology Co., Ltd."},42:{name:"Gentoo"},43:{name:"Haiku, Inc."},44:{name:"Hakin9"},45:{name:"Hewlett-Packard"},46:{name:"Hotway"},47:{name:"Microsoft Corp."},48:{name:"Microsoft"},49:{name:"Amazon"},5:{name:"Alcatel-Lucent"},50:{name:"Knoppix"},51:{name:"Kyocera Mita Corp."},52:{name:"Lexmark International, Inc."},53:{name:"LifeSize Communications, Inc."},54:{name:"Linksys"},55:{name:"Linux Mint"},56:{name:"Mediatrix Telecom"},57:{name:"Meraki"},58:{name:"Mitel Corp."},59:{name:"Moneris Solutions"},6:{name:"Amino Technologies"},60:{name:"Motorola, Inc."},61:{name:"Netbotz"},62:{name:"NETGEAR"},63:{name:"Nokia"},64:{name:"Maemo"},65:{name:"Nortel Networks"},66:{name:"Novell, Inc."},67:{name:"Sun Microsystems, Inc."},68:{name:"IBM Corp."},69:{name:"PC-BSD"},7:{name:"Fedora"},70:{name:"Linux"},71:{name:"Sony"},72:{name:"Polycom, Inc."},73:{name:"Porteus"},74:{name:"Puppy Linux"},75:{name:"Red Hat"},76:{name:"DIRECTV, Inc."},77:{name:"ShoreTel, Inc."},78:{name:"Infineon Technologies AG"},79:{name:"Wind River"},8:{name:"Google Inc."},80:{name:"Sipura Technology"},81:{name:"Slax"},82:{name:"SUSE"},83:{name:"Sling Media"},84:{name:"InnoMedia, Inc."},85:{name:"Symbol"},86:{name:"TallyGenicom LP"},87:{name:"TANDBERG"},88:{name:"TiVo"},89:{name:"TP-LINK Technologies Co., Ltd."},9:{name:"OpenBSD"},90:{name:"Trapeze Networks"},91:{name:"TRENDnet"},92:{name:"Ubuntu"},93:{name:"UniData Communications Systems Inc."},94:{name:"Uniden"},95:{name:"UTStarcom, Inc."},96:{name:"Western Digital Corp."},97:{name:"Amazon.com, Inc."},98:{name:"Barnes &amp; Noble, Inc."},99:{name:"Sony Corporation"}}},version:{major:0,minor:0}}}),define("unifi/model/Client",["unifi/model/Model","jquery","backbone","underscore","ubnt/backgrid","libs/moment","unifi/util/DpiDevidMap","msg/Msg","ubnt/ubnt.ip"],function(e,t,i,a,n,o,r,s){"use strict";return e.extend({parse:function(t,i){return t=e.prototype.parse.call(this,t,i),t&&(t.tx_bytes?t.tx_bytes=parseInt(t.tx_bytes,10):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 i={};t?t.partial:null;return e.name&&!this.validator.name(e.name)&&(i.name=s.localize(s.E_InvalidName,s.G_PropertiesAlias)),a.size(i)?i:void 0},name:function(){return this.get("name")||this.get("hostname")||this.get("mac")},ip2long:function(){return t.ip2long(this.get("ip"))},sortStatus:function(){return this.get("authorized")?1:0},authorizable:function(){return this.isGuest()&&(!this.get("is_wired")||this.get("is_wired")&&this.get("gw_mac"))},switch_port_suffix:function(e){var t=this.get("sw_mac"),i=this.get("sw_port");return t&&i?" #"+(e&&1===i.toString().length?" ":"")+i:""},wired_connection:function(){var e=this.get("sw_mac"),t=this.get("gw_mac");this.get("sw_port");return e?e+this.switch_port_suffix(!0):t?t:""},connection:function(){return this.get("is_wired")?this.get("network"):this.get("essid")},isConnected:function(){return this.get("mac")&&!this.get("blocked")&&this.get("uptime")?!0:!1},userOrGuest:function(){return this.get("is_guest")?s.G_Guest:s.G_User},isGuest:function(){return this.get("is_guest")},uptime:function(e){return e=e||this.get("uptime"),e>0?n.Formatters.Duration.fromRaw(e||0):""},rssi:function(){var e=parseFloat(this.get("rssi"));return e||0===e?(e>45?e=45:5>e&&(e=5),e=(e-5)/40*99,(0===e?"0":e.toPrecision(2))+"%"):""},lastSeen:function(){var e,t=this.get("last_seen");return t?(e=(new Date).getTime()/1e3-parseInt(t,10),isNaN(e)?"":86400>e?n.Formatters.Duration.fromRaw(e)+" ago":o(t+"","X").format("YYYY/MM/DD HH:mm:ss")):""},absoluteLastSeen:function(){var e=this.get("last_seen");return e?o(e+"","X").format("YYYY/MM/DD HH:mm:ss"):""},dpiDeviceType:function(){var e=this.get("dev_cat");if(e){var t=r.devids.dev_type_ids[e];return t?t.name:"("+s.G_Unknown.toLowerCase()+")"}return""},dpiDeviceId:function(){var e=this.get("dev_id");if(e){var t=r.devids.device_ids[e];return t?t.name:"("+s.G_Unknown.toLowerCase()+")"}return""},dpiDeviceVendor:function(){var e=this.get("dev_vendor");if(e){var t=r.devids.vendor_ids[e];return t?t.name:"("+s.G_Unknown.toLowerCase()+")"}return""},dpiDeviceFamily:function(){var e=this.get("dev_family");if(e){var t=r.devids.family_ids[e];return t?t.name:"("+s.G_Unknown.toLowerCase()+")"}return""},dpiDeviceOSClass:function(){var e=this.get("os_class");if(e){var t=r.devids.os_class_ids[e];return t?t.name:"("+s.G_Unknown.toLowerCase()+")"}return""},dpiDeviceOSName:function(){var e=this.get("os_name");if(e){var t=r.devids.os_name_ids[e];return t?t.name:"("+s.G_Unknown.toLowerCase()+")"}return""},radioType:function(){return this.get("radio_proto")},is5g:function(){return"na"==this.get("radio")},signalWithDbm:function(){return(this.get("rssi")||0)-95+" dBm"},txRateInM:function(){return this.get("tx_rate")?this.get("tx_rate")/1e3+"M":""},rxRateInM:function(){return this.get("rx_rate")?this.get("rx_rate")/1e3+"M":""},activity:function(){var e=this.get("bytes-r")||0;return e?n.Formatters.Bytes.fromRaw(e)+"B/sec":""},activitySort:function(){return this.get("bytes-r")||0},powersave:function(){return this.get("powersave_enabled")?"Enabled":"Not Enabled"},receivedPacketsOverBytes:function(){var e=this.get("rx_packets"),t=this.get("rx_bytes");return e&&t?n.Formatters.Bytes.fromRaw(e)+" / "+n.Formatters.Bytes.fromRaw(t):""},sentPacketsOverBytes:function(){var e=this.get("tx_packets"),t=this.get("tx_bytes");return e&&t?n.Formatters.Bytes.fromRaw(e)+" / "+n.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)},queryDpiStats:function(e){this.sync("query-dpi-stats",this,e)},sync:function(e,t,a){switch(a=a||{},e){case"update":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/upd/user/"+t.get("_id"),a.type="POST",a.data=JSON.stringify(t.changed);break;case"reconnect":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/cmd/stamgr",a.type="POST",a.data=JSON.stringify({mac:t.get("mac"),cmd:"kick-sta"});break;case"block":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/cmd/stamgr",a.type="POST",a.data=JSON.stringify({mac:t.get("mac"),cmd:"block-sta"});break;case"unblock":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/cmd/stamgr",a.type="POST",a.data=JSON.stringify({mac:t.get("mac"),cmd:"unblock-sta"});break;case"unauthorize":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/cmd/stamgr",a.type="POST",a.data=JSON.stringify({mac:t.get("mac"),cmd:"unauthorize-guest"});break;case"authorize":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/cmd/stamgr",a.type="POST",a.data=JSON.stringify({mac:t.get("mac"),cmd:"authorize-guest"});break;case"query-dpi-stats":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/cmd/devmgr",a.type="POST",a.data=JSON.stringify({mac:t.get("mac"),cmd:"query-dpi-stats"})}return i.sync.call(this,e,t,a)}})}),define("unifi/collection/Clients",["unifi/collection/Collection","unifi/model/Client","underscore"],function(e,t,i){"use strict";return e.extend({model:t,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/sta"},getClientFromMac:function(e){return this.find(function(t){return t.get("mac")==e})},getUserFromIp:function(e){return this.find(function(t){return t.get("ip")==e})},sortByBytes:function(){var e=this.sortBy(function(e){return-1*(e.get("tx_bytes")+e.get("rx_bytes"))});return e},sortByUptime:function(){var e=this.sortBy(function(e){return-1*e.get("uptime")});return e},clientsPerEssid:function(){var e=this.filter(function(e){return e.get("essid")}),t=i.groupBy(e,function(e){return e.get("essid")});return t},clientsPerEssidStats:function(){var t,a=this.clientsPerEssid(),n=[];return i.each(a,function(e,t){n.push({name:t,count:e.length})}),t=new e(n),t.sortBy(function(e){return-1*e.get("count")})}})}),define("unifi/model/insights/KnownClient",["unifi/model/Client","backbone","ubnt/backgrid","libs/moment"],function(e,t,i,a){"use strict";return e.extend({toSearch:function(){return{name:this.name(),mac:this.attributes.mac,is_guest:this.isGuest(),last_seen:this.absoluteLastSeen()}}})}),define("unifi/collection/insights/KnownClients",["backbone","underscore","unifi/collection/Clients","unifi/model/insights/KnownClient","app"],function(e,t,i,a,n){"use strict";return i.extend({model:a,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/alluser"},parse:function(e){if(!n.data.Clients)return e.data;var i=[],a=e.data;return t.each(n.collection("Clients").models,function(e){i.push(e.attributes)}),this.mergeByProperty(a,i,"mac"),a},mergeByProperty:function(e,i,a){t.each(i,function(i){var n=t.find(e,function(e){return e[a]===i[a]});n?t.extend(n,i):e.push(i)})},sync:function(i,a,n){switch(n=n||{},i){case"read":n.contentType="application/json; charset=utf-8",n.type="POST",n.data=JSON.stringify(t.extend(n.data||{}))}return e.sync.call(this,i,a,n)}})}),define("unifi/view/gateway/DpiPropertyView",["backbone","underscore","msg/Msg","jquery","text!includes/gateway/DpiPropertyTemplate.html","libs/d3","libs/backgrid","ubnt/backgrid","unifi/model/GatewayDpi","unifi/collection/Collection","unifi/model/ClientDpi","unifi/collection/insights/KnownClients"],function(e,t,i,a,n,o,r,s,c,l,d,m){"use strict";return e.View.extend({template:t.template(n),initialize:function(e){t.bindAll(this),this.app=e.app,this.grids={},this.render()},showCategories:function(){this.$categorySections.show(),this.$applicationSections.hide(),this.$clientSections.hide()},showApplications:function(e){this.$categorySections.hide(),this.$applicationSections.show(),this.$clientSections.hide(),this.renderAppClientChart(e)},showClients:function(e){this.$categorySections.hide(),this.$applicationSections.hide(),this.$clientSections.show()},render:function(){var e=this;this.model&&!t.isEmpty(this.model.get("by_cat"))&&(!this.rendered&&(this.rendered=!0)&&(this.$el.html(this.template({msg:i})),this.$categorySections=this.$el.find("> .category"),this.$applicationSections=this.$el.find("> .application"),this.$clientSections=this.$el.find("> .client"),this.$totalBytes=this.$el.find("> .category.header > .totalBytes"),this.$rxBytes=this.$el.find("> .category.header > .rxBytes"),this.$txBytes=this.$el.find("> .category.header > .txBytes"),this.$chart=this.$el.find("> .category.graph > .chart"),this.$chartDetail=this.$el.find("> .category.graph > .chartDetail"),this.$detail=this.$el.find("> .category.detail"),this.$chart.on("mouseover","> .chartSection",function(t){var i=a(this);e.$detail.scrollTop(0),e.$currentCategoryRow=i,e.renderRowDetail(e.$currentCategoryRow)}),this.$detail.on("click","> div.appTile > div",function(t){var i=a(this);e.$currentApplicationRow=i,e.showApplications(e.$currentApplicationRow)}),this.$applicationHeader=this.$el.find("> .application.header"),this.$applicationBack=this.$applicationHeader.find("> .back"),this.$applicationName=this.$applicationHeader.find("> .title > .name"),this.$applicationChart=this.$el.find("> .application.chart"),this.$applicationBack.on("click",function(t){e.$currentApplicationRow=null,e.showCategories()}),this.showCategories()),this.populate())},display:function(e,t){var i=this.$chart.find('.chartSection[data-cat="'+e+'"]');this.$chart.find("> div").removeClass("selected"),i.addClass("selected"),this.$detail.scrollTop(0),this.$currentCategoryRow=i,i.css({cursor:"default"}),this.renderRowDetail(this.$currentCategoryRow),void 0!==t&&(this.$currentApplicationRow=this.$detail.find('.appTile[data-cat="'+e+'"][data-app="'+t+'"] > div'),this.showApplications(this.$currentApplicationRow))},populate:function(){this.renderTotalData(),this.renderGraph(),this.$currentCategoryRow&&this.renderRowDetail(this.$currentCategoryRow),this.$currentApplicationRow&&this.showApplications(this.$currentApplicationRow)},renderTotalData:function(){var e=this.model.get("by_cat_total"),t=s.Formatters.Bytes.fromRaw((e.rx_bytes||0)+(e.tx_bytes||0)),i=s.Formatters.Bytes.fromRaw(e.rx_bytes||0),a=s.Formatters.Bytes.fromRaw(e.tx_bytes||0);this.$totalBytes.text(t),this.$rxBytes.text(i),this.$txBytes.text(a)},renderGraph:function(){var e,i,n,o,r,c,l,d,m,u,h,g,p,y=this.model.get("by_cat"),f=this.model.get("by_cat_total"),_=(f.rx_bytes||0)+(f.tx_bytes||0),v=(this.$chart.width(),this.$currentCategoryRow&&this.$currentCategoryRow.attr("data-cat")),b=this.$currentCategoryRow&&this.$currentCategoryRow.attr("data-app");this.$chart.empty(),t.each(y,function(t,y){e=(t.rx_bytes||0)+(t.tx_bytes||0),i=s.Formatters.Bytes.fromRaw((t.rx_bytes||0)+(t.tx_bytes||0)),n=s.Formatters.Bytes.fromRaw(t.rx_bytes||0),o=s.Formatters.Bytes.fromRaw(t.tx_bytes||0),r=this.model.getName("by_cat",t),c=t.cat,l=t.app,d=e/_,m=100*d,u=m.toFixed(1),h=90+15*y,1>u&&(u="< 1"),h>200&&(h=200),g=a('<div class="chartSection"></div>').attr("data-cat",c).attr("data-app",l).attr("data-bytes_rx",n).attr("data-bytes_tx",o).attr("data-bytes_total",i).attr("data-name",u+"% "+r).css({width:m+"%"}),(v==c&&b==l||!this.graphRendered)&&(this.graphRendered=!0,this.$currentCategoryRow=g),p=a('<div class="bar"></div>').css({"background-color":"rgb("+h+","+h+","+h+")"}),g.append(p),g.append(a('<div class="calloutTop"></div><div class="calloutBottom"></div>')),this.$chart.append(g)},this)},renderRowDetail:function(e){this.$chart.find("> div").removeClass("selected"),e.css({cursor:"default"}),e.addClass("selected");var t={tx_bytes:e.attr("data-bytes_tx"),rx_bytes:e.attr("data-bytes_rx"),total_bytes:e.attr("data-bytes_total"),name:e.attr("data-name")},i=a('<div>    <span class="name"></span> -     <span class="totalBytes"></span>     (        <span class="ubnt-icon-arrow-down"></span>         <span class="rxBytes"></span>          <span class="ubnt-icon-arrow-up"></span>         <span class="txBytes"></span>    )</div>');i.find(".totalBytes").text(t.total_bytes),i.find(".rxBytes").text(t.rx_bytes),i.find(".txBytes").text(t.tx_bytes),i.find(".name").text(t.name),this.$chartDetail.empty().append(i),this.renderAppData(e)},renderAppData:function(e){var i,n,o,r,s,c,l,d,m=e.attr("data-cat"),u=t.where(this.model.get("by_app"),{cat:+m}),h=this.model.totalCategoryData(u),g=this.$currentApplicationRow&&this.$currentApplicationRow.attr("app")||null,p=this.$currentApplicationRow&&this.$currentApplicationRow.attr("cat")||null;this.$detail.empty(),t.each(u,function(e){s=((e.tx_bytes||0)+(e.rx_bytes||0))/(h.tx_bytes+h.rx_bytes),c=(100*s).toFixed(1),l=this.model.getName("by_app",e),d=this.model.getIconUrl("by_app",e),1>c&&(c="< 1"),i=a('<div class="appTile"></div>').attr("data-app",e.app).attr("data-cat",e.cat).attr("title",l),g==e.cat&&p==e.app&&(this.$currentApplicationRow=i),n=a('<div class="appIcon"></div>'),o=a('<div class="inner"></div>'),d?o.prepend(a('<div class="appLogo"></div>').css({background:'url("'+d+'")'})):o.text(l),n.append(o),r=a('<div class="appPercent"></div>').text(c+"%"),i.append(n).append(r),this.$detail.append(i)},this)},setData:function(e){e&&(this.model||(this.model=new c),this.model.set({by_cat:e.by_cat||[],by_app:e.by_app||[]},{silent:!0}),this.model.parseData(),this.render())},renderAppClientChart:function(i){var a=this,n=i.parent().attr("data-cat"),o=i.parent().attr("data-app"),r=t.where(this.model.get("by_app"),{cat:+n,app:+o})[0],s=this.model.getName("by_app",r),c=t.reduce(r.clients,function(e,t){var i=a.app.collection("Clients").findWhere({mac:t.mac});return i&&(t.staData=i,e.push(t)),e},[]),l=e.Collection.extend({model:d}),m=new l;m.reset(c),this.$applicationName.text(s),this.clientDpiTableGrid(this.$applicationChart,m)},clientDpiTableGrid:function(e,t){if(!this.grids.appClientDpi){var n=this,o=[{name:"mac",label:i.G_ClientsNameMACAddress,editable:!1,headerCell:s.Headers.customSortHeader,cell:s.Cells.ComplexHtmlCell.extend({formatter:{fromRaw:function(e){var t=e.get("staData"),i=a('<span "macCell"></span>');return i.text(t.name()).on("click",function(){n.clientProperty(t)}).css({color:"#1292c5",cursor:"pointer"}),i},toRaw:function(e){return e}},className:"mac-cell"}),sortValue:function(e){var t=n.app.collection("Clients").findWhere({mac:e.get("mac")});return t?t.name():e.get("mac")},remove:function(){this.$el.find(".macCell").off("click"),s.Cells.ComplexHtmlCell.remove.apply(this,arguments)}},{name:"packets",label:i.G_PortForwardUpPkts,editable:!1,headerCell:s.Headers.customSortHeader,cell:s.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){var t=new r.NumberFormatter({decimals:0});return t.fromRaw(e.packetsTotal())},toRaw:function(e){return e}},className:"packets-cell"}),sortValue:function(e){return e.packetsTotal()}},{name:"bytes",label:i.G_PortForwardUpBytes,editable:!1,headerCell:s.Headers.customSortHeader,cell:s.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){return s.Formatters.Bytes.fromRaw(e.bytesTotal())},toRaw:function(e){return e}},className:"bytes-cell"}),sortValue:function(e){return e.bytesTotal()}}];this.grids.dpi=this.grid(o,t,e)}},grid:function(e,i,a,n,o){if(i){var r=new s.Grid(o=t.extend({columns:e,collection:i,pageable:!0,footer:s.Paginators.Mini,noRows:n},o||{}));return a.html(r.render().$el),o.pageable&&r.paginate(1,4),r}n&&a.html(n)},clientProperty:function(e){this.app.routers.clients.views.index.property(e,{section:"dpi"})},remove:function(){t.each(this.grids,function(e){e.remove()}),this.grids={},this.$currentCategoryRow=null,this.$chart&&this.$chart.off("click","> div"),this.rendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("unifi/model/PortForward",["unifi/model/Model","underscore","backbone","msg/Msg"],function(e,t,i,a){"use strict";return e.extend({validate:function(e,i){var n={},o=i?i.partial:null;return o&&"name"!=o||(e.name?this.validator.name(e.name)||(n.name=a.localize(a.E_InvalidName,a.G_Name)):n.name=a.localize(a.E_CannotBeEmpty,a.G_Name)),o&&"src"!=o||(e.src?"any"==e.src||this.validator.ip(e.src)||this.validator.iprange(e.src)||this.validator.subnet(e.src)||"!"===e.src.charAt(0)&&(this.validator.ip(e.src.substring(1))||this.validator.iprange(e.src.substring(1))||this.validator.subnet(e.src.substring(1)))||(n.src=a.localize(a.E_IncorrectIPRangeSubnet,a.G_PortForwardSource)):n.src=a.localize(a.E_CannotBeEmpty,a.G_PortForwardSource)),o&&"dst_port"!=o||(e.dst_port?this.validator.rangeList(e.dst_port,",-",15,1,65535)||(n.dst_port=a.localize(a.E_IncorrectNumberRangeList,a.G_Port,15,1,65535)):n.dst_port=a.localize(a.E_CannotBeEmpty,a.G_Port)),o&&"fwd"!=o||(e.fwd?this.validator.ip(e.fwd)||(n.fwd=a.localize(a.E_IncorrectIPAddress,a.G_PortForwardDestIp)):n.fwd=a.localize(a.E_CannotBeEmpty,a.G_PortForwardDestIp)),o&&"fwd_port"!=o||(e.fwd_port?this.validator.rangeList(e.fwd_port,",-",15,1,65535)||(n.fwd_port=a.localize(a.E_IncorrectNumberRangeList,a.G_PortForwardDestPort,15,1,65535)):n.fwd_port=a.localize(a.E_CannotBeEmpty,a.G_PortForwardDestPort)),t.size(n)?n:void 0},sync:function(e,t,a){switch(a=a||{},e){case"create":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/add/portforward",a.type="POST";break;case"update":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/upd/portforward/"+t.id,a.type="POST",a.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/del/portforward/"+t.id,a.type="POST"}return i.sync.call(this,e,t,a)}})}),define("unifi/collection/PortForward",["unifi/collection/Collection","underscore","unifi/model/PortForward"],function(e,t,i){"use strict";return e.extend({model:i,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/list/portforward"}})}),define("unifi/model/DynamicDNS",["unifi/model/Model","underscore","backbone","msg/Msg"],function(e,t,i,a){"use strict";return e.extend({validate:function(e,i){var n={},o=i?i.partial:null;return o&&"login"!=o||e.login||(n.login=a.localize(a.E_CannotBeEmpty,a.G_PropertiesDDNSUsername)),o&&"x_password"!=o||e.x_password||(n.x_password=a.localize(a.E_CannotBeEmpty,a.G_PropertiesDDNSPassword)),o&&"host_name"!=o||e.host_name||(n.host_name=a.localize(a.E_CannotBeEmpty,a.G_PropertiesDDNSHostname)),t.size(n)?n:void 0},service:function(){return this.get("service")},hostname:function(){return this.get("host_name")},server:function(){return this.get("server")},username:function(){return this.get("login")},sync:function(e,t,a){switch(a=a||{},e){case"create":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/add/dynamicdns",a.type="POST";break;case"update":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/upd/dynamicdns/"+t.id,a.type="POST",a.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/del/dynamicdns/"+t.id,a.type="POST"}return i.sync.call(this,e,t,a)}})}),define("unifi/collection/DynamicDNS",["unifi/collection/Collection","underscore","unifi/model/DynamicDNS"],function(e,t,i){"use strict";return e.extend({model:i,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/list/dynamicdns"}})}),define("text!includes/gateway/gatewayPropertiesTemplate.html",[],function(){return'<div class="accordion-header">\n    <div class="accordion-title">\n        <span class="device-icons access-point half"></span>\n        <span class="title-text"><%- name() %></span>\n        <div class="ubnt-icon-arrow-down sidebar-icons minmax minimize"></div>\n    </div>\n    <div class="right">\n        <div class="ubnt-icon-new-window sidebar-icons detach" title="Detach"></div>\n        <div class="ubnt-icon-close sidebar-icons remove" title="Close"></div>\n    </div>\n</div>\n<div class="property-content">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n\n    <%= diagram %>\n\n    <div class="status-alert status-success"><span class="ubnt-icon-check checkmark"></span><%- msg.G_Saved %></div>\n    <div class="status-alert status-error"><span class="ubnt-icon-warning alert"></span><%- msg.E_Error %></div>\n\n    <div class="tabs">\n        <ul>\n            <li class="tab-nav-list-item">\n                <a class="tab-button" href="#gatewayDetails<%- _id %>"><%- msg.G_PropertiesDetails %></a>\n            </li>\n            <li class="tab-nav-list-item">\n                <a class="tab-button" href="#gatewayStatistics<%- _id %>"><%- msg.G_Stats %></a>\n            </li>\n            <li class="tab-nav-list-item">\n                <a class="tab-button" href="#gatewayNetworks<%- _id %>"><%- msg.G_PropertiesNetworks %></a>\n            </li>\n            <li class="tab-nav-list-item ap-configs">\n                <a class="tab-button" href="#gatewayConfig<%- _id %>"><%- msg.G_PropertiesConfiguration %></a>\n            </li>\n        </ul>\n        <div class="properties-container overflow">\n            <div id="gatewayDetails<%- _id %>" class="gateway-details tab-content">\n                <div class="accordion">\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_DevicesOverview %></div>\n                    </div>\n                    <div class="basic-overview">\n                        <table>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesMACAddress %></td>\n                                <td class="column-value"><%- get(\'mac\') %></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_DevicesModel %></td>\n                                <td class="column-value"><%- apModel() %></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Version %></td>\n                                <td class="column-value bind-version"></td>\n                            </tr>\n                        </table>\n                        <hr />\n                        <table>\n                            <tr class="table-row ip-address">\n                                <td class="column-name"><%- msg.G_PropertiesLANIPAddress %></td>\n                                <td class="column-value bind-lan-ip"></td>\n                            </tr>\n                            <tr class="table-row uptime">\n                                <td class="column-name"><%- msg.G_Uptime %></td>\n                                <td class="column-value bind-uptime"></td>\n                            </tr>\n                        </table>\n                    </div>\n                    <div class="accordion-header gw-wan-details">\n                        <div class="accordion-title"><%- msg.G_DevicesWan %></div>\n                    </div>\n                    <div class="devices-wan gw-wan-details">\n                        <table class="side-by-side">\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_IPAddress %></td>\n                                <td class="column-value bind-wan-ip"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Speed %></td>\n                                <td class="column-value bind-wan1-speed"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesDuplex %></td>\n                                <td class="column-value bind-wan1-duplex"></td>\n                            </tr>\n                        </table>\n\n                        <table class="side-by-side">\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesDownPktsBytes %></td>\n                                <td class="column-value bind-wan1-down-packets"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesUpPktsBytes %></td>\n                                <td class="column-value bind-wan1-up-packets"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesDownActivity %></td>\n                                <td class="column-value bind-wan1-down-rate"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesUpActivity %></td>\n                                <td class="column-value bind-wan1-up-rate"></td>\n                            </tr>\n                        </table>\n                    </div>\n                    <div class="accordion-header gw-wan2-details">\n                        <div class="accordion-title"><%- msg.G_DevicesWan %> 2</div>\n                    </div>\n                    <div class="devices-wan gw-wan2-details">\n                        <table class="side-by-side">\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_IPAddress %></td>\n                                <td class="column-value bind-wan-ip2"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Speed %></td>\n                                <td class="column-value bind-wan2-speed"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesDuplex %></td>\n                                <td class="column-value bind-wan2-duplex"></td>\n                            </tr>\n                        </table>\n\n                        <table class="side-by-side">\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesDownPktsBytes %></td>\n                                <td class="column-value bind-wan2-down-packets"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesUpPktsBytes %></td>\n                                <td class="column-value bind-wan2-up-packets"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesDownActivity %></td>\n                                <td class="column-value bind-wan2-down-rate"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesUpActivity %></td>\n                                <td class="column-value bind-wan2-up-rate"></td>\n                            </tr>\n                        </table>\n                    </div>\n                    <div class="accordion-header gw-adv-adopt">\n                        <div class="accordion-title"><%- msg.G_PropertiesAdvancedOpts %></div>\n                    </div>\n                    <div class="gw-adv-adopt">\n                        <form action="" class="advAdoptForm gw-adv-adopt">\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_IP %></label>\n                                <input class="input inline medium bind-adopt-ip" type="text" value="" name="ip" />\n                                <span class="colon">:</span>\n                                <input class="input inline small" type="text" value="22" name="port" />\n                            </div>\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_UN %></label>\n                                <input class="input inline" type="text" value="" name="username" />\n                            </div>\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_PW %></label>\n                                <input class="input inline" type="password" value="" name="password" />\n                            </div>\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_PropertiesInformURL %></label>\n                                <input class="input inline bind-adopt-url" type="text" value="" name="url" />\n                            </div>\n                            <button class="button is-admin" type="submit"><%- msg.G_Adopt %></button>\n                        </form>\n                    </div>\n                </div>\n            </div>\n            <div id="gatewayStatistics<%- _id %>" class="tab-content statistics">\n                <div class="statistics-tab-content"><%- msg.G_PropertiesNoGatewayDpi %></div>\n            </div>\n            <div id="gatewayNetworks<%- _id %>" class="tab-content minigrid">\n                <div class="data-table data-table-networks bind-networks"><%- msg.G_PropertiesNoNetworksConfigured %></div>\n            </div>\n            <div id="gatewayConfig<%- _id %>" class="tab-content ap-configs">\n                <div class="accordion">\n                    <div class="accordion-header ap-configs">\n                        <div class="accordion-title"><%- msg.G_Config %></div>\n                    </div>\n                    <div class="ap-configs">\n                        <form action="" class="aliasForm">\n                            <div class="row">\n                                <label for="aliasName<%- _id %>" class="label"><%- msg.G_PropertiesAlias %></label>\n                                <input name="name" id="aliasName<%- _id %>" type="text" class="input" value="<%- get(\'name\') %>" pattern=".{1,128}" title="<%- msg.E_AliasName %>" />\n                            </div>\n                            <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n                        </form>\n                    </div>\n                    <div class="accordion-header wan-config">\n                        <div class="accordion-title"><%- msg.G_DevicesWan %></div>\n                    </div>\n                    <div class="wan-config">\n                        <form class="wanForm bind-wan">\n                            <div class="clearfix">\n                                <div class="row">\n                                   <label for="connectionnType<%- _id %>" class="label inline"><%- msg.G_PropertiesConnectionType %></label>\n                                   <select name="connectionType" class="connection-type" id="connectionnType<%- _id %>">\n                                       <option value="dhcp"><%- msg.G_PropertiesUsingDHCP %></option>\n                                       <option value="static"><%- msg.G_PropertiesStaticIP %></option>\n                                       <option value="pppoe"><%- msg.G_PropertiesPPPoE %></option>\n                                   </select>\n                                </div>\n\n                                <div class="side-by-side">\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_IPAddress %></label>\n                                        <input type="text" class="input inline" name="ip" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_PropertiesSubnetMask %></label>\n                                        <input type="text" class="input inline" name="netmask" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-static">\n                                        <label for="gateway<%- _id %>" class="label inline"><%- msg.G_PropertiesRouter %></label>\n                                        <input type="text" class="input inline" name="gateway" id="gateway<%- _id %>" value="" />\n                                    </div>\n\n                                    <div class="row connection-toggled connection-pppoe">\n                                        <label class="label inline"><%- msg.G_UN %></label>\n                                        <input type="text" class="input inline" name="username" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-pppoe">\n                                        <label class="label inline"><%- msg.G_PW %></label>\n                                        <input type="text" class="input inline" name="x_password" value="" />\n                                    </div>\n                                </div>\n\n                                <div class="side-by-side">\n                                    <div class="row connection-toggled connection-dhcp connection-static connection-pppoe">\n                                        <label class="label inline"><%- msg.G_PropertiesPreferredDNS %></label>\n                                        <input type="text" class="input inline" name="dns1" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-dhcp connection-static connection-pppoe">\n                                        <label class="label inline"><%- msg.G_PropertiesAlternateDNS %></label>\n                                        <input type="text" class="input inline" name="dns2" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-dhcp connection-static connection-pppoe">\n                                        <label class="label inline"><%- msg.G_PropertiesUseVLANId %></label>\n                                        <input type="checkbox" class="input inline" name="vlanEnabled" value="" />\n                                        <input type="text" class="input inline vlanId" name="vlan" value="" />\n                                    </div>\n                                </div>\n                            </div>\n\n                            <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n                        </form>\n                    </div>\n                    <div class="accordion-header wan2-config">\n                        <div class="accordion-title"><%- msg.G_DevicesWan %> 2</div>\n                    </div>\n                    <div class="wan2-config">\n                        <form class="wan2Form bind-wan2">\n                            <div class="clearfix">\n                                <div class="row">\n                                   <label for="connectionnType<%- _id %>" class="label inline"><%- msg.G_PropertiesConnectionType %></label>\n                                   <select name="connectionType" class="connection-type" id="connectionnType<%- _id %>">\n                                       <option value="disabled"><%- msg.G_SettingsDisabled %></option>\n                                       <option value="dhcp"><%- msg.G_PropertiesUsingDHCP %></option>\n                                       <option value="static"><%- msg.G_PropertiesStaticIP %></option>\n                                       <option value="pppoe"><%- msg.G_PropertiesPPPoE %></option>\n                                   </select>\n                                </div>\n\n                                <div class="side-by-side">\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_IPAddress %></label>\n                                        <input type="text" class="input inline" name="ip" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_PropertiesSubnetMask %></label>\n                                        <input type="text" class="input inline" name="netmask" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-static">\n                                        <label for="gateway<%- _id %>" class="label inline"><%- msg.G_PropertiesRouter %></label>\n                                        <input type="text" class="input inline" name="gateway" id="gateway<%- _id %>" value="" />\n                                    </div>\n\n                                    <div class="row connection-toggled connection-pppoe">\n                                        <label class="label inline"><%- msg.G_UN %></label>\n                                        <input type="text" class="input inline" name="username" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-pppoe">\n                                        <label class="label inline"><%- msg.G_PW %></label>\n                                        <input type="text" class="input inline" name="x_password" value="" />\n                                    </div>\n                                </div>\n\n                                <div class="side-by-side">\n                                    <div class="row connection-toggled connection-dhcp connection-static connection-pppoe">\n                                        <label class="label inline"><%- msg.G_PropertiesPreferredDNS %></label>\n                                        <input type="text" class="input inline" name="dns1" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-dhcp connection-static connection-pppoe">\n                                        <label class="label inline"><%- msg.G_PropertiesAlternateDNS %></label>\n                                        <input type="text" class="input inline" name="dns2" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-dhcp connection-static connection-pppoe">\n                                        <label class="label inline"><%- msg.G_PropertiesUseVLANId %></label>\n                                        <input type="checkbox" class="input inline" name="vlanEnabled" value="" />\n                                        <input type="text" class="input inline vlanId" name="vlan" value="" />\n                                    </div>\n                                </div>\n                            </div>\n\n                            <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n                        </form>\n                    </div>\n                    <div class="accordion-header portfwd-config">\n                        <div class="accordion-title"><%- msg.G_PropertiesPortForward %></div>\n                    </div>\n                    <div class="portfwd-config">\n                        <button class="button portfwd-create is-admin" name="create">\n                            <span class="ui-button-icon-primary ubnt-icon-plus"></span>\n                            <span class="nav-text"><%- msg.G_Create %></span>\n                        </button>\n\n                        <div class="portfwd-list">\n                            <div class="data-table data-table-portfwd data-table-fit"><%- msg.G_PropertiesNoPortForwardingConfigured %></div>\n                        </div>\n\n                        <div class="portfwd-form"></div>\n                    </div>\n                    <div class="accordion-header dynamicdns-config">\n                        <div class="accordion-title"><%- msg.G_PropertiesDynamicDNS %></div>\n                    </div>\n                    <div class="dynamicdns-config">\n                        <button class="button dynamicdns-create is-admin" name="create">\n                            <span class="ui-button-icon-primary ubnt-icon-plus"></span>\n                            <span class="nav-text"><%- msg.G_Create %></span>\n                        </button>\n                        <div class="dynamicdns-list">\n                            <div class="data-table data-table-dynamicdns data-table-fit"><%- msg.G_PropertiesNoDynamicDNSConfigured %></div>\n                        </div>\n                        <div class="dynamicdns-form"></div>\n                    </div>\n\n                    <div class="accordion-header is-admin">\n                        <div class="accordion-title"><%- msg.G_PropertiesCustomUpgrade %></div>\n                    </div>\n                    <div class="is-admin">\n                        <div class="row">\n                            <%- msg.G_PropertiesCustomFirmwareTxt %>\n                        </div>\n                        <button class="button custom-upgrade left">\n                            <span class="ui-button-icon-primary ubnt-icon-download"></span>\n                            <span class="nav-text"><%- msg.G_PropertiesCustomUpgrade %></span>\n                        </button>\n                    </div>\n\n                    <div class="accordion-header is-admin">\n                        <div class="accordion-title"><%- msg.G_PropertiesForgetGateway %></div>\n                    </div>\n                    <div class="is-admin">\n                        <div class="row">\n                            <%- msg.G_PropertiesForgetGatewayTxt %>\n                        </div>\n                        <button class="button forget left">\n                            <span class="ui-button-icon-primary ubnt-icon-forget-this-network"></span>\n                            <span class="nav-text"><%- msg.G_PropertiesForget %></span>\n                        </button>\n                        <div class="left">\n                            <select name="move" class="move-dropdown" data-myposition="left bottom" data-atposition="left top"></select>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="dialog-controls is-admin clearfix">\n            <button class="button button-locate left">\n                <span class="ui-button-icon-primary ubnt-icon-location sidebar-icons locate"></span>\n                <span class="nav-text"><%- msg.G_Locate %></span>\n            </button>\n            <button class="button button-restart left">\n                <span class="ui-button-icon-primary ubnt-icon-rotate sidebar-icons restart"></span>\n                <span class="nav-text"><%- msg.G_Restart %></span>\n            </button>\n            <button class="button button-update left">\n                <span class="ui-button-icon-primary ubnt-icon-download sidebar-icons update"></span>\n                <span class="nav-text"><%- msg.G_Upgrade %></span>\n            </button>\n            <button class="button button-adopt left">\n                <span class="ui-button-icon-primary ubnt-icon-plus sidebar-icons adopt"></span>\n                <span class="nav-text"><%- msg.G_Adopt %></span>\n            </button>\n        </div>\n    </div>\n</div>\n';
}),define("text!includes/gateway/gatewayDiagramUGW3Template.html",[],function(){return'<div class="diagram gateway port3 bind-state">\n    <div class="port wan"><div class="status"></div><div class="name"><%- msg.G_DevicesWan %></div></div>\n    <div class="port lan"><div class="status"></div><div class="name"><%- msg.G_DevicesLan %></div></div>\n    <div class="port voip"><div class="status"></div><div class="name"><%- msg.G_DevicesVoip %></div></div>\n</div>'}),define("text!includes/gateway/gatewayDiagramUGW4Template.html",[],function(){return'<div class="diagram gateway port4 bind-state">\n    <div class="port lan"><div class="status"></div><div class="name"><%- msg.G_DevicesLan %> 1</div></div>\n    <div class="port voip"><div class="status"></div><div class="name"><%- msg.G_DevicesLan %> 2</div></div>\n    <div class="port wan wan1"><div class="status"></div><div class="name"><%- msg.G_DevicesWan %>1</div></div>\n    <div class="port wan wan2"><div class="status"></div><div class="name"><%- msg.G_DevicesWan %>2</div></div>\n</div>'}),define("text!includes/gateway/gatewayDiagramUGW8Template.html",[],function(){return'<div class="diagram gateway port8 bind-state">\n    <div class="port lan lan1"><div class="status"></div><div class="name"><%- msg.G_DevicesLan %>1</div></div>\n    <div class="port lan lan2"><div class="status"></div><div class="name"><%- msg.G_DevicesLan %>2</div></div>\n    <div class="port lan lan3"><div class="status"></div><div class="name"><%- msg.G_DevicesLan %>3</div></div>\n    <div class="port lan lan4"><div class="status"></div><div class="name"><%- msg.G_DevicesLan %>4</div></div>\n    <div class="port lan lan5"><div class="status"></div><div class="name"><%- msg.G_DevicesLan %>5</div></div>\n    <div class="port voip"><div class="status"></div><div class="name"><%- msg.G_DevicesVoip %></div></div>\n    <div class="port wan wan1"><div class="status"></div><div class="name"><%- msg.G_DevicesWan %>1</div></div>\n    <div class="port wan wan2"><div class="status"></div><div class="name"><%- msg.G_DevicesWan %>2</div></div>\n</div>'}),define("unifi/view/gateway/PropertyView",["unifi/view/devices/PropertyView","unifi/view/gateway/PortForwardFormView","unifi/view/gateway/DynamicDNSFormView","unifi/view/gateway/DpiPropertyView","ubnt/backgrid","libs/backgrid","underscore","backbone","jquery","msg/Msg","unifi/collection/PortForward","unifi/collection/DynamicDNS","text!includes/gateway/gatewayPropertiesTemplate.html","text!includes/gateway/gatewayDiagramUGW3Template.html","text!includes/gateway/gatewayDiagramUGW4Template.html","text!includes/gateway/gatewayDiagramUGW8Template.html","ubnt/view/dialogs/AlertDialogView","ubnt/view/dialogs/ConfirmDialogView","stickit"],function(e,t,i,a,n,o,r,s,c,l,d,m,u,h,g,p,y,f){"use strict";return e.extend({templateId:u,diagramTemplate:null,bindings:function(){return r.extend({},e.prototype.bindings.call(this),{".bind-wan-ip":{observe:"wan1",onGet:function(e){this.$bindWanIp.text(e.ip),this.$bindWan1Speed.text(this.model.wan1Speed()),this.$bindWan1Duplex.text(this.model.wan1Duplex()),this.$bindWan1DownPackets.text(this.model.wan1DownPackets()),this.$bindWan1UpPackets.text(this.model.wan1UpPackets()),this.$bindWan1DownRate.text(this.model.wan1ActivityDown()),this.$bindWan1UpRate.text(this.model.wan1ActivityUp())}},".bind-wan-ip2":{observe:"wan2",onGet:function(e){this.$bindWanIp2.text(e.ip),this.$bindWan2Speed.text(this.model.wan2Speed()),this.$bindWan2Duplex.text(this.model.wan2Duplex()),this.$bindWan2DownPackets.text(this.model.wan2DownPackets()),this.$bindWan2UpPackets.text(this.model.wan2UpPackets()),this.$bindWan2DownRate.text(this.model.wan2ActivityDown()),this.$bindWan2UpRate.text(this.model.wan2ActivityUp())}},".bind-wan":{observe:"config_network_wan",onGet:function(e){this.populateNetworkForm(this.$wanForm,e)}},".bind-wan2":{observe:"config_network_wan2",onGet:function(e){this.populateNetworkForm(this.$wan2Form,e,"config_network_wan2")}},".bind-networks":{observe:"network_table",onGet:function(e){this.networkTable()}},".bind-state":{observe:["uplink","port_table"],onGet:function(){this.populateStates()}},".bind-lan-ip":{observe:"port_table",onGet:function(e){var t=r.findWhere(e,{name:"lan"});t&&this.$bindLanIp.text(t.ip||"")}},".statistics-tab-content":{observe:"dpistats_table",onGet:function(){this.renderDpi()}}})},initialize:function(t){switch(this.model.get("model")){case"UGW3":this.diagramTemplate=r.template(h,{msg:l});break;case"UGW4":this.diagramTemplate=r.template(g,{msg:l});break;case"UGW8":this.diagramTemplate=r.template(p,{msg:l})}e.prototype.initialize.call(this,t)},dependencies:function(){var e={PortForward:d,DynamicDNS:m},t=[],i={},a=this;r.each(e,function(e,a){t.push(i[a]=c.Deferred())},this),c.when.apply(c,t).then(function(){a._dependencies.resolve()},function(){a._dependencies.reject()}),r.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:i[t]}},e)},this)},render:function(t){var i=this.rendered;return e.prototype.render.call(this,t),i||(this.forms={},this.listenTo(this.app.collection("PortForward"),"add remove",this.portForwardTable),this.listenTo(this.app.collection("DynamicDNS"),"add remove",this.dynamicDNSTable),this.noPortFwdRows=this.$(".data-table-portfwd").html(),this.noDynamicDNSRows=this.$(".data-table-dynamicdns").html(),this.noNetworkRows=this.$(".data-table-networks").html(),this.$advAdoptForm=this.$(".advAdoptForm"),this.$gatewayDetails=this.$(".gateway-details"),this.$gatewayConfig=this.$(".ap-configs"),this.$wanForm=this.$(".wanForm"),this.$wan2Form=this.$(".wan2Form"),this.$connectionType=this.$wanForm.find("select[name=connectionType]"),this.$connection2Type=this.$wan2Form.find("select[name=connectionType]"),this.$connectionVlanEnabled=this.$wanForm.find("input[name=vlanEnabled]"),this.$connection2VlanEnabled=this.$wan2Form.find("input[name=vlanEnabled]"),this.$bindWanIp=this.$(".bind-wan-ip"),this.$bindWan1Speed=this.$(".bind-wan1-speed"),this.$bindWan1Duplex=this.$(".bind-wan1-duplex"),this.$bindWan1DownPackets=this.$(".bind-wan1-down-packets"),this.$bindWan1UpPackets=this.$(".bind-wan1-up-packets"),this.$bindWan1DownRate=this.$(".bind-wan1-down-rate"),this.$bindWan1UpRate=this.$(".bind-wan1-up-rate"),this.$bindWanIp2=this.$(".bind-wan-ip2"),this.$bindWan2Speed=this.$(".bind-wan2-speed"),this.$bindWan2Duplex=this.$(".bind-wan2-duplex"),this.$bindWan2DownPackets=this.$(".bind-wan2-down-packets"),this.$bindWan2UpPackets=this.$(".bind-wan2-up-packets"),this.$bindWan2DownRate=this.$(".bind-wan2-down-rate"),this.$bindWan2UpRate=this.$(".bind-wan2-up-rate"),this.$bindLanIp=this.$(".bind-lan-ip"),this.$portFwdCreate=this.$('.portfwd-config button[name="create"]'),this.$portFwdList=this.$(".portfwd-list"),this.$portFwdForm=this.$(".portfwd-form"),this.$portFwdCreate.on("click",c.proxy(function(){this.portForwardForm()},this)),this.$portFwdForm.hide(),this.$dynamicDNSCreate=this.$('.dynamicdns-config button[name="create"]'),this.$dynamicDNSList=this.$(".dynamicdns-list"),this.$dynamicDNSForm=this.$(".dynamicdns-form"),this.$dynamicDNSCreate.on("click",c.proxy(function(){this.dynamicDNSForm()},this)),this.$dynamicDNSForm.hide(),this.$connectionVlanEnabled.on("change",c.proxy(function(e){c(e.target).is(":checked")?this.$wanForm.find("input[name=vlan]").prop("disabled",!1):this.$wanForm.find("input[name=vlan]").prop("disabled",!0).val("")},this)).trigger("change"),this.$connection2VlanEnabled.on("change",c.proxy(function(e){c(e.target).is(":checked")?this.$wan2Form.find("input[name=vlan]").prop("disabled",!1):this.$wan2Form.find("input[name=vlan]").prop("disabled",!0).val("")},this)).trigger("change"),this.$connectionType.on("change",c.proxy(function(e){var t=c(e.target).val();this.$wanForm.find(".connection-toggled").hide().filter(".connection-"+t).show()},this)).trigger("change"),this.model.get("config_network_wan2")?(this.$(".wan-config").find(".accordion-title").text(l.G_DevicesWan+" 1"),this.$(".gw-wan-details").find(".accordion-title").text(l.G_DevicesWan+" 1")):(this.$(".wan2-config").hide(),this.$(".gw-wan2-details").hide()),this.$connection2Type.on("change",c.proxy(function(e){var t=c(e.target).val();this.$wan2Form.find(".connection-toggled").hide().filter(".connection-"+t).show()},this)).trigger("change"),this.$wanForm.on("submit",c.proxy(function(e){e.preventDefault(),this.updateNetwork(this.$wanForm,"config_network_wan")},this)),this.$wan2Form.on("submit",c.proxy(function(e){e.preventDefault(),this.updateNetwork(this.$wan2Form,"config_network_wan2")},this)),this.renderDiagram(),"resolved"===this._rendered.state()&&"resolved"==this._dependencies.state()?this.populate():"pending"===this._rendered.state()&&this._rendered.resolve(),this.stickit(this.model,this.bindings())),this.populateStates(),this.networkTable(),this.portForwardTable(),this.dynamicDNSTable(),this.toggleAdvancedAdoption(),i||this.detach(),this.options.options&&"lan"==this.options.options.port&&this.$diagramLan.click(),this.renderDpi(),this.options.options&&this.options.options.section&&this.setSection(this.options.options.section,this.options.options.cat,this.options.options.app),this},setSection:function(e,t,i){if(t||i){var a;switch(e){case"dpi":a=1}this.$tabs.tabs("option","active",a),this.options.options.section=null,this.options.options.cat=null,this.options.options.app=null,this.dpiPropertyView&&this.dpiPropertyView.display(t,i)}},toggleAdvancedAdoption:function(){var e=this.app.collection("Devices"),t=e.where({type:"ugw",site_id:SITE.id});t.length?(this.isAdoptable?(this.$el.find("div.gw-adv-adopt").hide(),this.$advAdoptForm.off("submit",this.onAdvAdoptFormSubmit)):void 0===this.isAdoptable&&this.$el.find("div.gw-adv-adopt").hide(),this.isAdoptable=!1):this.isAdoptable||(this.isAdoptable=!0,this.$el.find("div.gw-adv-adopt").hide(),this.$el.find("div.gw-adv-adopt.accordion-header").show(),this.$advAdoptForm.on("submit",this.onAdvAdoptFormSubmit))},renderDiagram:function(){this.$diagram=this.$(".diagram"),this.$diagramWan=this.$(".diagram .port.wan"),this.$diagramLan=this.$(".diagram .port.lan"),this.$diagramVoice=this.$(".diagram .port.voip"),this.$diagramWan.on("click",c.proxy(function(e){var t=c(e.delegateTarget),i=t.hasClass("wan2"),a=i?r.findWhere(this.model.get("port_table"),{name:"wan2"}):r.findWhere(this.model.get("port_table"),{name:"wan"}),n=a&&a.up?a.up:!1;i?n&&(this.$tabs.tabs("option","active",0),this.$gatewayDetails.find(".accordion").accordion("option","active",2)):n&&(this.$tabs.tabs("option","active",0),this.$gatewayDetails.find(".accordion").accordion("option","active",1))},this)),this.$diagramLan.on("click",c.proxy(function(){this.$tabs.tabs("option","active",2)},this)),this.$diagramVoice.on("click",c.proxy(function(){this.$el.hasClass("gw-has-voip")&&this.$tabs.tabs("option","active",2)},this))},args:function(){return{_id:this.id,diagram:this.diagramTemplate,msg:l}},onAdvAdoptFormSubmit:function(e){e.preventDefault();var t=this,i=this.model,a=c(e.target).find("button");this.$advAdoptForm.find(".error").removeClass("error"),a.attr("disabled","disabled");var n=i.advanceAdopt({data:{ip:this.$advAdoptForm.find('input[name="ip"]').val(),port:this.$advAdoptForm.find('input[name="port"]').val(),username:this.$advAdoptForm.find('input[name="username"]').val(),password:this.$advAdoptForm.find('input[name="password"]').val(),url:this.$advAdoptForm.find('input[name="url"]').val()},success:function(e){"ok"===e.meta.rc?i.fetch({success:function(e,i,a){"ok"===i.meta.rc&&t.parent.property(e)},complete:function(){a.removeAttr("disabled")}}):(t.showErrorState(),a.removeAttr("disabled"))},error:function(){t.showErrorState(),a.removeAttr("disabled")}});!n&&this.model.validationError&&r.each(this.model.validationError,function(e,t){switch(t){case"username":case"password":this.$advAdoptForm.find('input[name="'+t+'"]').addClass("error"),a.removeAttr("disabled")}},this)},populate:function(){this.$el.addClass("gateway-properties"),e.prototype.populate.call(this),this._dependencies&&"resolved"==this._dependencies.state()&&this.position()},renderDpi:function(){var e=this.model.get("dpistats_table");e&&e.by_cat&&e.by_cat.length&&e.by_app&&e.by_app.length?(this.dpiPropertyView||(this.dpiPropertyView=new a({app:this.app,el:this.$el.find(".statistics-tab-content").get(0)})),this.dpiPropertyView&&this.dpiPropertyView.setData(e)):(this.dpiPropertyView&&this.dpiPropertyView.remove(),this.dpiPropertyView=null,this.$el.find(".tab-content.statistics").html('<div class="statistics-tab-content">'+l.G_PropertiesNoGatewayDpi+"</div>"))},populateStates:function(){this.$el.removeClass("gw-has-wan gw-has-wan2 gw-has-lan gw-has-voip"),r.each(this.model.get("port_table")||[],c.proxy(function(e){var t=this.$diagram.find(".port."+e.name);t.removeClass("shutdown up green orange"),e.enable||t.addClass("shutdown"),e.up&&(this.$el.addClass("gw-has-"+e.name.replace(/[^a-z0-9]/,"")),t.addClass("up"),1e3==e.speed?t.addClass("green"):(100==e.speed||10==e.speed)&&t.addClass("orange"))},this))},networkTable:function(){if(!this.rendered)return!1;if(this.grids.networks)this.grids.networks.collection.set(this.model.networks());else{var e=[{name:"name",label:l.G_Network,editable:!1,cell:"string"},{name:"ip",label:l.G_IP,editable:!1,cell:"string"},{name:"tx_bytes",label:l.G_DevicesTX,editable:!1,cell:o.StringCell.extend({formatter:n.Formatters.Bytes})},{name:"rx_bytes",label:l.G_DevicesRX,editable:!1,cell:o.StringCell.extend({formatter:n.Formatters.Bytes})},{name:"num_sta",label:l.G_PropertiesNumHosts,editable:!1,cell:"integer"}];this.grids.networks=this.grid(e,new s.Collection(this.model.networks()),this.$(".data-table-networks"),this.noNetworkRows)}},portForwardTable:function(){if(!this.rendered)return!1;if(!this.grids.portfwd){var e=[{name:"name",label:l.G_Name,editable:!1,cell:"string"},{name:"src",label:l.G_PortForwardSource,editable:!1,cell:o.StringCell.extend({formatter:{fromRaw:function(e){return e&&"any"!=e?e:"*"},toRaw:function(e){return e}}})},{name:"dst_port",label:l.G_Port,customClass:"detached-only",editable:!1,cell:"string"},{name:"fwd",label:l.G_PortForwardDest,customClass:"detached-only",editable:!1,cell:n.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){return r.filter([e.get("fwd"),e.get("fwd_port")],function(e){return e}).join(":")},toRaw:function(e){return e}}})},{name:"_id",label:l.G_Actions,customClass:"column-actions",editable:!1,sortable:!1,headerCell:n.Headers.noSortHeader,cell:n.Cells.ActionsCell.extend({actions:{edit:{icon:"ubnt-icon-edit",iconOnly:!0,requiresAdminPrivilege:!0,callback:this.portForwardForm},remove:{icon:"ubnt-icon-trash",iconOnly:!0,requiresAdminPrivilege:!0,callback:c.proxy(function(e){(new f).show(l.G_PropertiesPortForwardDeleteConfirm,c.proxy(function(){e.destroy({success:c.proxy(function(e,t){"ok"===t.meta.rc?this.showSavedState():this.showErrorState()},this),error:c.proxy(function(){this.showErrorState()},this)})},this))},this)}}})}];this.grids.portfwd=this.grid(e,this.app.collection("PortForward"),this.$(".data-table-portfwd"),this.noPortFwdRows,{paginateToAddedModel:!0}),this.grids.portfwd&&this.grids.portfwd.setFilter("name")}},portForwardForm:function(e){var i=this.app.collection("PortForward");this.forms.PortForward=new t({app:this.app,container:this.$portFwdForm,collection:i,model:e||new i.model}),this.listenTo(this.forms.PortForward,"remove",c.proxy(function(){this.forms.PortForward=null},this)),this.forms.PortForward.render(),this.position()},dynamicDNSTable:function(){if(!this.rendered)return!1;if(!this.grids.dynamicdns){var e=[{name:"service",label:l.G_PropertiesDDNSService,editable:!1,cell:"string"},{name:"host_name",label:l.G_PropertiesDDNSHostname,editable:!1,cell:"string"},{name:"login",label:l.G_PropertiesDDNSUsername,customClass:"detached-only",editable:!1,cell:"string"},{name:"x_password",label:l.G_PropertiesDDNSPassword,customClass:"detached-only",editable:!1,cell:"string"},{name:"server",label:l.G_PropertiesDDNSServer,customClass:"detached-only",editable:!1,cell:"string"},{name:"_id",label:l.G_Actions,customClass:"column-actions",editable:!1,sortable:!1,headerCell:n.Headers.noSortHeader,cell:n.Cells.ActionsCell.extend({actions:{edit:{icon:"ubnt-icon-edit",iconOnly:!0,requiresAdminPrivilege:!0,callback:this.dynamicDNSForm},remove:{icon:"ubnt-icon-trash",iconOnly:!0,requiresAdminPrivilege:!0,callback:c.proxy(function(e){(new f).show(l.G_PropertiesDDNSDynamicDNSDeleteConfirm,c.proxy(function(){e.destroy({success:c.proxy(function(e,t){"ok"===t.meta.rc?this.showSavedState():this.showErrorState()},this),error:c.proxy(function(){this.showErrorState()},this)})},this))},this)}}})}];this.grids.dynamicdns=this.grid(e,this.app.collection("DynamicDNS"),this.$(".data-table-dynamicdns"),this.noDynamicDNSRows,{paginateToAddedModel:!0}),this.grids.dynamicdns&&this.grids.dynamicdns.setFilter("service")}},dynamicDNSForm:function(e){var t=this.app.collection("DynamicDNS");this.forms.DynamicDNS=new i({app:this.app,container:this.$dynamicDNSForm,collection:t,model:e||new t.model}),this.listenTo(this.forms.DynamicDNS,"remove",c.proxy(function(){this.forms.DynamicDNS=null},this)),this.forms.DynamicDNS.render(),this.position()},statsDynamicDNSForm:function(e,t){this.$tabs.tabs("option","active",2),this.$gatewayConfig.find(".accordion").accordion("option","active",3),t&&this.dynamicDNSForm(e)},statsPortForwardForm:function(e,t){this.$tabs.tabs("option","active",2),this.$gatewayConfig.find(".accordion").accordion("option","active",2),t&&this.portForwardForm(e)},remove:function(){this.dpiPropertyView&&this.dpiPropertyView.remove(),this.listenTo(this.app.collection("PortForward"),"add remove",this.portForwardTable),this.$portFwdCreate.off("click"),this.$connectionType.off("change"),this.$wanForm.off("submit"),this.$diagramWan.off("click"),this.$diagramLan.off("click"),this.$diagramVoice.off("click"),this.stopListening(this.forms.PortForward,"remove"),this.forms.PortForward&&this.forms.PortForward.remove(),this.unstickit(this.model),this.$advAdoptForm.off("submit",this.onAdvAdoptFormSubmit),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("text!includes/switches/switchNetworksVlanFormTemplate.html",[],function(){return'<form>\n    <fieldset class="fieldset">\n        <div class="row">\n            <label class="label inline"><%- msg.G_Name %></label>\n            <input type="text" class="input inline" name="name" value="" />\n        </div>\n        <div class="row forward-native forward-customize">\n            <label class="label inline"><%- msg.G_NativeNetwork %></label>\n            <select id="network" name="network" class="input inline"></select>\n        </div>\n        <div class="row forward-customize">\n            <label class="label inline"><%- msg.G_PropertiesTaggedNetworks %></label>\n\n            <div class="networks checkbox-group left"></div>\n        </div>\n    </fieldset>\n\n    <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n    <button class="button" name="cancel" value="Cancel" type="button"><%- msg.G_Cancel %></button>\n</form>\n'}),define("unifi/view/switches/NetworksVlanFormView",["unifi/view/app/FormView","jquery","underscore","msg/Msg","text!includes/switches/switchNetworksVlanFormTemplate.html","ubnt/ubnt.radiotoggle"],function(e,t,i,a,n){"use strict";return e.extend({_templateId:i.template(n,{msg:a}),_prevalidate:{name:{input:"text"}},events:{"change #network":"onNetworkChange","click button[name=cancel]":"remove",'click input[name="networks"]':"onTaggedNetworkChange"},onNetworkChange:function(e){var t=this.$el.find("input[type=checkbox][name=networks]");t.prop("disabled",!1),t.filter(":checkbox[value="+e.target.value+"]").prop("checked",!1).prop("disabled",!0)},onTaggedNetworkChange:function(e){var i=t(e.target),a=this.$el.find("select[name=network]"),n=a.find('option[value="'+i.val()+'"]');i.is(":checked")&&(n.prop("selected",!1),a.val()==i.val()&&(n=a.find("option:first"),n.prop("selected",!0))),a.selectmenu("refresh")},render:function(){var t=this.rendered;e.prototype.render.call(this);var i=this.$container.parents(".networks-vlan-config");i.addClass("show-form"),t||(this.listenTo(this.app.collection("Networks"),"add remove",this.renderNetworks),this.on("remove",function(){i.removeClass("show-form")}),this.renderNetworks(),this.app.isReadOnly||this.prevalidator())},renderNetworks:function(){var e=this.app.collection("Networks").filterByPurpose(["corporate","guest","voip","vlan-only"]),n=this.$("select[name=network]"),o=this.$(".networks");o.empty(),n.empty(),n.append(t('<option value=""></option>').text(a.G_None)),i.each(e,function(e){o.append(t('<label><input type="checkbox" name="networks" value="'+e.id+'" /> '+e.get("name")+"</label>")),n.append(t('<option value="'+e.id+'"></option>').text(e.get("name")))}),n.selectmenu("refresh"),this.populate()},populate:function(){if(this.model){this.$el.find("input[name=name]").val(this.model.get("name")),this.$el.find("select[name=network]").val(this.model.get("native_networkconf_id")).trigger("change");var e=this.$el.find("input[type=checkbox][name=networks]");e.prop("checked",!1),i.each(this.model.get("tagged_networkconf_ids")||[],function(t){e.filter(":checkbox[value="+t+"]").prop("checked",!0)})}},gather:function(){var e={name:this.$el.find("input[name=name]").val()};return e.native_networkconf_id=this.$el.find("select[name=network] option:selected").val(),e.tagged_networkconf_ids=this.$el.find("input[name=networks]:checked").map(function(){return t(this).val()}).get(),e.native_networkconf_id&&i.isEmpty(e.tagged_networkconf_ids)?e.forward="native":e.forward="customize",e},success:function(){this.remove()},error:function(e,t){this.options.app.views.app.flash("error","Error",a.apiError(t))},remove:function(){this.stopListening(this.app.collection("Networks"),"add remove"),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("text!includes/switches/switchPortFormTemplate.html",[],function(){return'<form class="tab-form">\n    <fieldset>\n        <div class="row">\n            <span class="label inline"><%- msg.G_Port %></span>\n            <span class="label inline label-fit label-light portidx"></span>\n        </div>\n        <div class="name">\n            <div class="row">\n                <label class="label inline"><%- msg.G_Name %></label>\n                <input type="text" class="input inline" name="name" value="" />\n            </div>\n        </div>\n        <div class="poe">\n            <div class="row op_mode-toggled op_mode-switch">\n                <label class="label inline"><%- msg.G_PropertiesPoE %></label>\n\n                <div class="port-group left">\n                    <label><input type="radio" name="poe_mode" value="off" /> <%- msg.G_SettingsOff %></label>\n                    <label><input type="radio" name="poe_mode" value="pasv24" /> <%- msg.G_PropertiesPoEModePassive %></label>\n                    <label><input type="radio" name="poe_mode" value="auto" /> <%- msg.G_PropertiesPoEModePoEPlus %></label>\n                </div>\n            </div>\n        </div>\n        <div class="row op_mode-toggled op_mode-switch op_mode-aggregate">\n            <label class="label inline"><%- msg.G_PropertiesNetworksVLANs %></label>\n            <select name="portconf_id" class="input inline"></select>\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\n        <div class="advanced">\n            <div class="row">\n                <label class="label inline"><%- msg.G_PropertiesOperation %></label>\n                <div class="port-group left">\n                    <label><input type="radio" name="op_mode" value="switch" /><%- msg.G_PropertiesSwitching %></label>\n                    <label><input type="radio" name="op_mode" value="mirror" /><%- msg.G_PropertiesMirroring %></label>\n                    <label><input type="radio" name="op_mode" value="aggregate" /><%- msg.G_PropertiesAggregate %></label>\n                </div>\n            </div>\n            <div class="row op_mode-toggled op_mode-mirror">\n                <label class="label inline"><%- msg.G_PropertiesMirroringPort %></label>\n                <input type="text" class="input inline" name="mirror_port_idx" value="" />\n            </div>\n            <div class="row op_mode-toggled op_mode-aggregate">\n                <label class="label inline"><%- msg.G_PropertiesAggregatePorts %></label>\n                <input type="text" class="input inline small" name="aggregate_start" value="" disabled="disabled" />\n                <span class="label inline label-fit label-light"><%- msg.G_To %></span>\n                <input type="text" class="input inline small" name="aggregate_num_ports" value="" />\n                <span class="aggregate-limits tip inline"></span>\n            </div>\n            <div class="row autoneg">\n                <label class="label inline"><%- msg.G_PropertiesAutoneg %></label>\n                <div class="port-group left">\n                    <label><input type="radio" name="autoneg" value="auto" /><%- msg.G_PropertiesAuto %></label>\n                    <label><input type="radio" name="autoneg" value="manual" /><%- msg.G_PropertiesManual %></label>\n                </div>\n            </div>\n            <div class="row autoneg-disable duplex autoneg">\n                <label class="label inline"><%- msg.G_PropertiesFullDuplex %></label>\n                <div class="port-group left">\n                    <label><input type="checkbox" name="fullduplex"><%- msg.G_PropertiesEnable %></label>\n                </div>\n            </div>\n            <div class="row autoneg-disable autoneg">\n                <label class="label inline"><%- msg.G_PropertiesSpeed %></label>\n                <div class="port-group left">\n                    <select id="speed" class="input inline" name="speed">\n                        <option value="10000"><%- msg.G_Properties10Gbps %></option>\n                        <option value="1000"><%- msg.G_Properties1000Mbps %></option>\n                        <option value="100"><%- msg.G_Properties100Mbps %></option>\n                        <option value="10"><%- msg.G_Properties10Mbps %></option>\n                    </select>\n                </div>\n            </div>\n            <div class="row isolation">\n                <label class="label inline"><%- msg.G_PropertiesIsolation %></label>\n                <div class="port-group">\n                    <label><input type="checkbox" name="isolation"><%- msg.G_PropertiesEnableIsolation %></label>\n                </div>\n            </div>\n            <div class="row stormctrl">\n                <label class="label inline"><%- msg.G_PropertiesStormCtrl %></label>\n                <div class="port-group">\n                    <label class="fix-width"><input type="checkbox" name="stormctrl_ucast_enabled"><%- msg.G_PropertiesUcast %></label>\n                    <input type="number" name="stormctrl_ucast_rate" value="" class="small">\n                    <span><%- msg.G_PropertiesStormCtrlRate %></span>\n                </div>\n                <label class="label inline">&nbsp</label>\n                <div class="port-group">\n                    <label class="fix-width"><input type="checkbox" name="stormctrl_mcast_enabled"><%- msg.G_PropertiesMcast %></label>\n                    <input type="number" name="stormctrl_mcast_rate" value="" class="small">\n                    <span><%- msg.G_PropertiesStormCtrlRate %></span>\n                </div>\n                <label class="label inline">&nbsp</label>\n                <div class="port-group">\n                    <label class="fix-width"><input type="checkbox" name="stormctrl_bcast_enabled"><%- msg.G_PropertiesBcast %></label>\n                    <input type="number" name="stormctrl_bcast_rate" value="" class="small">\n                    <span><%- msg.G_PropertiesStormCtrlRate %></span>\n                </div>\n            </div>\n        </div>\n    </fieldset>\n    <div class="form-controls">\n        <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n        <button class="button" name="cancel" value="Cancel" type="button"><%- msg.G_Cancel %></button>\n    </div>\n</form>\n'}),define("unifi/view/switches/PortFormView",["unifi/view/app/FormView","ubnt/view/dialogs/ConfirmDialogView","jquery","underscore","msg/Msg","text!includes/switches/switchPortFormTemplate.html"],function(e,t,i,a,n,o){"use strict";return e.extend({_templateId:a.template(o,{msg:n}),_prevalidate:{aggregate_num_ports:{input:"text",complex:!0,extra:{portidx:"tbd"}},mirror_port_idx:{input:"text",complex:!0,extra:{portidx:"tbd"}},stormctrl_ucast_rate:{input:"text",complex:!0,extra:{portidx:"tbd"}},stormctrl_mcast_rate:{input:"text",complex:!0,extra:{portidx:"tbd"}},stormctrl_bcast_rate:{input:"text",complex:!0,extra:{portidx:"tbd"}}},events:{"click button[name=cancel]":"remove"},render:function(){var t=this.rendered;this.formResult="",this.selection={},this.selection.count=this.options.overrides.length,this.selection.firstIdx=this.options.overrides[0].get("port_idx"),this.selection.lastIdx=this.options.overrides[this.selection.count-1].get("port_idx");var n=[],o=null,r=!1;a.each(this.options.overrides,function(e){var t=e.get("port_idx");r||(r=e.get("port_poe")),"aggregate"==e.get("op_mode")?(n.push(t+"-"+(t+e.get("aggregate_num_ports")-1)),o=null):t===this.selection.firstIdx?n.push(t):t!==o+1?(n[n.length-1]!==o&&(n[n.length-1]+="-"+o),n.push(t)):t===this.selection.lastIdx&&(t===o+1?n[n.length-1]+="-"+t:n.push(t)),o=t},this),this.selection.indexesLabel=n.join(", "),this.selection.supportsPoe=r,e.prototype.render.call(this);var s=this.$container.parents(".port-list-config");s.addClass("show-form");this.$el;if(!t){this.on("remove",function(){s.removeClass("show-form")}),this.$el.find("input[name=op_mode]").radiotoggle({container:this.$el});var c=1===this.selection.count?this.options.overrides[0]:null;c?c.get("media")?(this.$el.find(".autoneg").show(),this.$el.find("input[name=autoneg]").on("change",function(e){"auto"===i(e.target).val()?this.$el.find(".autoneg-disable").hide():(this.$el.find(".autoneg-disable").show(),("SFP"===c.get("media")||"SFP+"===c.get("media"))&&this.$el.find(".duplex").hide())}.bind(this))):this.$el.find(".autoneg").hide():(this.$el.find(".autoneg").hide(),this.$el.find(".stormctrl").hide(),this.$el.find(".isolation").hide()),1===this.selection.count&&this.$el.find("input[name=op_mode]").on("change",function(e){"switch"===i(e.target).val()?(this.$el.find(".stormctrl").show(),this.$el.find(".isolation").show()):(this.$el.find(".stormctrl").hide(),this.$el.find(".isolation").hide())}.bind(this)),this.$el.find(".stormctrl").find(":checkbox").each(function(){i(this).change(function(){var e=i(this);e.is(":checked")?e.parent().parent().find("input").not(e).prop("disabled",!1):e.parent().parent().find("input").not(e).prop("disabled",!0)}.bind(this))}),this.listenTo(this.app.collection("PortConf"),"add remove change",this.renderPortConf),this.renderPortConf(),this.$el.find('[name="stormctrl_ucast_enabled"]').on("change",function(e){var t=i(this),a=t.closest("div");t.is(":checked")?a.find('input[type="number"]').trigger("validate"):(a.find(".error").removeClass("error"),a.find(".error-msg").remove())}),this.$el.find('[name="stormctrl_mcast_enabled"]').on("change",function(e){var t=i(this),a=t.closest("div");t.is(":checked")?a.find('input[type="number"]').trigger("validate"):(a.find(".error").removeClass("error"),a.find(".error-msg").remove())}),this.$el.find('[name="stormctrl_bcast_rate"]').on("change",function(e){var t=i(this),a=t.closest("div");t.is(":checked")?a.find('input[type="number"]').trigger("validate"):(a.find(".error").removeClass("error"),a.find(".error-msg").remove())}),this.app.isReadOnly||this.prevalidator()}},renderPortConf:function(){var e=this.$el.find("select[name=portconf_id]");
e.empty(),this.selection.count>1&&e.append(i('<option value=""></option>').text("(Keep existing)")),this.app.collection("PortConf").each(function(t){e.append(i('<option value="'+t.id+'"></option>').text(t.get("name")))}),this.portidx=parseInt(this.selection.firstIdx,10),this.$el.find(".portidx").text(this.selection.indexesLabel),this.$el.find("div.poe").toggle(this.selection.supportsPoe),e.selectmenu("refresh"),this.populate()},populate:function(){var e=1===this.selection.count?this.options.overrides[0]:null,t=e?e.get("poe_mode")||"auto":"auto",o=e?e.get("op_mode")||"switch":"switch",r={};if(a.each(this.model.get("port_overrides"),function(e){r[e.port_idx]=!0},this),e){this.$el.find("input[name=name]").val(e.get("name")),this.$el.find("input[name=poe_mode][value="+t+"]").prop("checked",!0).trigger("change"),this.$el.find("select[name=portconf_id]").val(e.get("portconf_id")||"").trigger("change"),this.$el.find("input[name=op_mode][value="+o+"]").prop("checked",!0).trigger("change"),this.$el.find("input[name=mirror_port_idx]").val(e.get("mirror_port_idx")),this.$el.find("input[name=isolation]").prop("checked",e.get("isolation")).trigger("change"),this.$el.find("input[name=aggregate_num_ports]").val(e.get("aggregate_num_ports")?parseInt(e.get("port_idx"),10)+parseInt(e.get("aggregate_num_ports"),10)-1:""),this.$el.find("input[name=stormctrl_ucast_enabled]").prop("checked",e.get("stormctrl_ucast_enabled")).trigger("change"),this.$el.find("input[name=stormctrl_ucast_rate]").val(e.get("stormctrl_ucast_rate")?parseInt(e.get("stormctrl_ucast_rate"),10):0),this.$el.find("input[name=stormctrl_mcast_enabled]").prop("checked",e.get("stormctrl_mcast_enabled")).trigger("change"),this.$el.find("input[name=stormctrl_mcast_rate]").val(e.get("stormctrl_mcast_rate")?parseInt(e.get("stormctrl_mcast_rate"),10):0),this.$el.find("input[name=stormctrl_bcast_enabled]").prop("checked",e.get("stormctrl_bcast_enabled")).trigger("change"),this.$el.find("input[name=stormctrl_bcast_rate]").val(e.get("stormctrl_bcast_rate")?parseInt(e.get("stormctrl_bcast_rate"),10):0);var s,c,l;r[e.get("port_idx")]?(s=e.get("autoneg")?"auto":"manual",c=e.get("full_duplex"),l=e.get("speed")):(s="auto",c=!0,l="1000");e.get("media");"SFP"!==e.get("media")&&"SFP+"!==e.get("media")?this.$el.find('select[name="speed"] option[value=10000]').remove():"SFP+"===e.get("media")?(this.$el.find('select[name="speed"] option[value=100]').remove(),this.$el.find('select[name="speed"] option[value=10]').remove()):"SFP"===e.get("media")&&(this.$el.find('select[name="speed"] option[value=10000]').remove(),this.$el.find('select[name="speed"] option[value=100]').remove(),this.$el.find('select[name="speed"] option[value=10]').remove()),this.$el.find("input[name=autoneg][value="+s+"]").prop("checked",!0).trigger("change"),this.$el.find("input[name=fullduplex]").prop("checked",c).trigger("change"),this.$el.find("select[name=speed]").val(l).trigger("change"),"switch"!=o&&this.$el.find("legend.toggle").trigger("click",!1)}else this.$el.find("input[name=name]").val("(Keep existing)"),this.$el.find("input[name=poe_mode][value=auto]").prop("checked",!0).trigger("change"),this.$el.find("input[name=op_mode][value=switch]").prop("checked",!0).trigger("change");if(1===this.selection.count){this.$el.find("fieldset.advanced input").prop("disabled",!1),this.$el.find(".stormctrl").find(":checkbox").each(function(){i(this).trigger("change")}),this.$el.find("input[name=aggregate_start]").val(e.get("port_idx")).disable();for(var d=this.selection.firstIdx+1,m=this.selection.firstIdx+3,u=this.model.numPorts(),h=this.$el.find("input[name=aggregate_num_ports]"),g=this.model.get("port_table"),p=(g.length,this.selection.firstIdx);m>p;p++)if(m>p){var y=g[p];if(y&&"switch"!==y.op_mode){m=p;break}}m>u&&(m=u),this.$el.find('input[name=op_mode][value="aggregate"]').parents("label:first").css("display",d>u||d>m?"none":"inline-block"),m-d>0?(this.$el.find(".aggregate-limits").text("("+n.localize(n.G_BetweenXandY,d,m)+")"),h.enable()):(h.val(d),h.disable()),this._prevalidate.aggregate_num_ports.extra.portidx=this.selection.firstIdx,this._prevalidate.mirror_port_idx.extra.portidx=this.selection.firstIdx,this._prevalidate.stormctrl_ucast_rate.extra.portidx=this.selection.firstIdx,this._prevalidate.stormctrl_bcast_rate.extra.portidx=this.selection.firstIdx,this._prevalidate.stormctrl_mcast_rate.extra.portidx=this.selection.firstIdx}else this.$el.find("fieldset.advanced").prop("disabled",!0)},gather:function(){var e=a.clone(this.model.get("port_overrides")),t=[],i=this.$el.find("input[name=name]").val(),n=this.$el.find("input[name=poe_mode]:checked").val(),o=this.$el.find("select[name=portconf_id]").val(),r=this.$el.find("input[name=op_mode]:checked").val();a.each(this.options.overrides,function(e){var a={port_idx:e.get("port_idx"),name:"(Keep existing)"===i?e.get("name"):i,portconf_id:o||e.get("portconf_id"),op_mode:r};if(this.selection.supportsPoe&&"SFP"!==e.get("media")&&"SFP+"!==e.get("media")&&(a.poe_mode=n),!a.name)switch(a.name="Port "+e.get("port_idx"),this.model.get("model")){case"US8P150":a.port_idx>8&&(a.name="SFP "+(a.port_idx-8));break;case"US16P150":a.port_idx>16&&(a.name="SFP "+(a.port_idx-16));break;case"US24":case"US24P250":case"US24P500":a.port_idx>24&&(a.name="SFP "+(a.port_idx-24));break;case"US48":case"US48P500":case"US48P750":a.port_idx>50?a.name="SFP "+(a.port_idx-50):a.port_idx>48&&(a.name="SFP+ "+(a.port_idx-48))}if("mirror"==a.op_mode)a.mirror_port_idx=this.$el.find("input[name=mirror_port_idx]").val();else if("aggregate"==a.op_mode)a.aggregate_num_ports=this.$el.find("input[name=aggregate_num_ports]").val()-this.selection.firstIdx+1;else if("switch"==a.op_mode)if(1===this.selection.count){if(a.isolation=this.$el.find("input[name=isolation]:checked").is(":checked"),a.stormctrl_ucast_enabled=this.$el.find("input[name=stormctrl_ucast_enabled]:checked").is(":checked"),a.stormctrl_ucast_enabled===!0){var s=this.$el.find("input[name=stormctrl_ucast_rate]").val();a.stormctrl_ucast_rate=s?parseInt(s,10):""}if(a.stormctrl_mcast_enabled=this.$el.find("input[name=stormctrl_mcast_enabled]:checked").is(":checked"),a.stormctrl_mcast_enabled===!0){var c=this.$el.find("input[name=stormctrl_mcast_rate]").val();a.stormctrl_mcast_rate=c?parseInt(c,10):""}if(a.stormctrl_bcast_enabled=this.$el.find("input[name=stormctrl_bcast_enabled]:checked").is(":checked"),a.stormctrl_bcast_enabled===!0){var l=this.$el.find("input[name=stormctrl_bcast_rate]").val();a.stormctrl_bcast_rate=l?parseInt(l,10):""}}else a.isolation=e.get("isolation"),a.stormctrl_ucast_enabled=e.get("stormctrl_ucast_enabled"),a.stormctrl_ucast_rate=e.get("stormctrl_ucast_rate"),a.stormctrl_mcast_enabled=e.get("stormctrl_mcast_enabled"),a.stormctrl_mcast_rate=e.get("stormctrl_mcast_rate"),a.stormctrl_bcast_enabled=e.get("stormctrl_bcast_enabled"),a.stormctrl_bcast_rate=e.get("stormctrl_bcast_rate");this.$el.find(".autoneg").is(":visible")&&(a.autoneg="auto"===this.$el.find("input[name=autoneg]:checked").val()?!0:!1,a.autoneg||(this.$el.find(".duplex").is(":visible")&&(a.full_duplex=this.$el.find("input[name=fullduplex]:checked").is(":checked")),a.speed=this.$el.find("select[name=speed]").val()||this.$el.find("select[name=speed] option").first().val())),t.push(a)},this);var s=t.map(function(e){return e.port_idx});return e=e?a.reject(e,function(e){return s.indexOf(e.port_idx)>-1}):[],e=e.concat(t),{port_overrides:e}},save:function(e){e&&e.preventDefault();var a=i.proxy(function(){this.clear(),this.$submit.trigger("saving");var e=this._save(this.model,null,{wait:!0,data:this.gather(),extra:{portidx:this.selection.firstIdx}});e?this.formResult="success":this.$submit.trigger("error",!0)},this),o=this.model.get("inform_ip"),r=this.app.collection("Clients").getUserFromIp(o);"undefined"!=typeof r&&this.model.get("mac")===r.get("sw_mac")&&this.portidx==r.get("sw_port")?(new t).show(n.localize(n.N_ConfirmPortConfigApply,this.portidx,o),a):a()},success:function(){this.model.fetch(),this.remove()},error:function(e,t){this.options.app.views.app.flash("error","Error",n.apiError(t,!0))},remove:function(){this.rendered=!1,this.stopListening(this.app.collection("PortConf"),"add remove change",this.renderPortConf),this.$el.find("input[name=autoneg]").off(),this.$el.find('[name="stormctrl_ucast_enabled"]').off(),this.$el.find('[name="stormctrl_mcast_enabled"]').off(),this.$el.find('[name="stormctrl_bcast_rate"]').off(),this.$el.find("input[name=op_mode]").off(),this.$el.find("input[name=autoneg]").off(),e.prototype.remove.apply(this,arguments)}})}),define("unifi/model/PortConf",["unifi/model/Model","underscore","backbone","msg/Msg"],function(e,t,i,a){"use strict";return e.extend({validate:function(e,i){var n={},o=i?i.partial:null;return o&&"name"!=o||(e.name?this.validator.name(e.name)||(n.name=a.localize(a.E_InvalidName,a.G_Name)):o||(n.name=a.localize(a.E_CannotBeEmpty,a.G_Name))),t.size(n)?n:void 0},sync:function(e,t,a){switch(a=a||{},e){case"create":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/add/portconf",a.type="POST";break;case"update":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/upd/portconf/"+t.id,a.type="POST",a.data=JSON.stringify(t.toJSON({exclude:["_id","site_id"]}));break;case"delete":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/del/portconf/"+t.id,a.type="POST"}return i.sync.call(this,e,t,a)}})}),define("unifi/collection/PortConf",["unifi/collection/Collection","underscore","unifi/model/PortConf"],function(e,t,i){"use strict";return e.extend({model:i,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/list/portconf"}})}),define("text!includes/switches/switchPropertiesTemplate.html",[],function(){return'<div class="accordion-header">\n    <div class="accordion-title">\n        <span class="device-icons access-point half"></span>\n        <span class="title-text"><%- name() %></span>\n        <div class="ubnt-icon-arrow-down sidebar-icons minmax minimize"></div>\n    </div>\n    <div class="right">\n        <div class="ubnt-icon-new-window sidebar-icons detach" title="Detach"></div>\n        <div class="ubnt-icon-close sidebar-icons remove" title="Close"></div>\n    </div>\n</div>\n<div class="property-content">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n\n    <div class="device-status-wrapper">\n        <div class="device-status bind-status"></div>\n    </div>\n\n    <%= diagram %>\n\n    <div class="status-alert status-success"><span class="ubnt-icon-check checkmark"></span><%- msg.G_Saved %></div>\n    <div class="status-alert status-error"><span class="ubnt-icon-warning alert"></span><%- msg.E_Error %></div>\n    <div class="tabs">\n        <ul>\n            <li class="tab-nav-list-item">\n                <a class="tab-button" href="#switchDetails<%- _id %>"><%- msg.G_PropertiesDetails %></a>\n            </li>\n            <li class="tab-nav-list-item ap-configs">\n                <a class="tab-button switchPorts-anchor" href="#switchPorts<%- _id %>"><%- msg.G_Ports %></a>\n            </li>\n            <li class="tab-nav-list-item ap-configs">\n                <a class="tab-button" href="#switchConfig<%- _id %>"><%- msg.G_PropertiesConfiguration %></a>\n            </li>\n        </ul>\n        <div class="properties-container overflow">\n            <div id="switchDetails<%- _id %>" class="tab-content">\n                <div class="accordion">\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_DevicesOverview %></div>\n                    </div>\n                    <div class="basic-overview">\n                        <table>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesMACAddress %></td>\n                                <td class="column-value"><%- get(\'mac\') %></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_DevicesModel %></td>\n                                <td class="column-value"><%- apModel() %></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Version %></td>\n                                <td class="column-value bind-version"></td>\n                            </tr>\n                        </table>\n                        <hr />\n                        <table>\n                            <tr class="table-row ip-address">\n                                <td class="column-name"><%- msg.G_IPAddress %></td>\n                                <td class="column-value bind-ip"></td>\n                            </tr>\n                            <tr class="table-row power-consumption">\n                                <td class="column-name"><%- msg.G_PowerConsumption %></td>\n                                <td class="column-value bind-power-consumption"></td>\n                            </tr>\n                            <tr class="table-row temperature">\n                                <td class="column-name"><%- msg.G_Temperature %></td>\n                                <td class="column-value bind-temperature"></td>\n                            </tr>\n                            <tr class="table-row fan-level sw-fan-details">\n                                <td class="column-name"><%- msg.G_FanLevel %></td>\n                                <td class="column-value bind-fan-level"></td>\n                            </tr>\n                            <tr class="table-row uptime">\n                                <td class="column-name"><%- msg.G_Uptime %></td>\n                                <td class="column-value bind-uptime"></td>\n                            </tr>\n                            <tr class="table-row last-uplink">\n                                <td class="column-name"><%- msg.G_LastUplink %></td>\n                                <td class="column-value">\n                                    <a class="bind-lastuplink button-uplink-device" href="#"></a>\n                                </td>\n                            </tr>\n                            <tr class="table-row last-seen">\n                                <td class="column-name"><%- msg.G_LastSeen %></td>\n                                <td class="column-value bind-lastseen"></td>\n                            </tr>\n                        </table>\n                    </div>\n\n                    <div class="accordion-header sw-uplink-details">\n                        <div class="accordion-title"><%- msg.G_PropertiesUplink %></div>\n                    </div>\n                    <div class="uplinks bind-uplink sw-uplink-details">\n                        <table class="side-by-side">\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Port %></td>\n                                <td class="column-value bind-uplink-port"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesUplink %></td>\n                                <td class="column-value column-callback bind-uplink-device button-uplink-device"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Speed %></td>\n                                <td class="column-value bind-uplink-speed"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesDuplex %></td>\n                                <td class="column-value bind-uplink-duplex"></td>\n                            </tr>\n                        </table>\n\n                        <table class="side-by-side">\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesDownPktsBytes %></td>\n                                <td class="column-value bind-uplink-down-packets"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesUpPktsBytes %></td>\n                                <td class="column-value bind-uplink-up-packets"></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Activity %></td>\n                                <td class="column-value bind-uplink-activity"></td>\n                            </tr>\n                        </table>\n                    </div>\n\n                    <div class="accordion-header sw-adv-adopt">\n                        <div class="accordion-title"><%- msg.G_PropertiesAdvancedOpts %></div>\n                    </div>\n                    <div class="sw-adv-adopt">\n                        <form action="" class="advAdoptForm sw-adv-adopt">\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_IP %></label>\n                                <input class="input inline medium bind-adopt-ip" type="text" value="" name="ip" />\n                                <span class="colon">:</span>\n                                <input class="input inline small" type="text" value="22" name="port" />\n                            </div>\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_UN %></label>\n                                <input class="input inline" type="text" value="" name="username" />\n                            </div>\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_PW %></label>\n                                <input class="input inline" type="password" value="" name="password" />\n                            </div>\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_PropertiesInformURL %></label>\n                                <input class="input inline bind-adopt-url" type="text" value="" name="url" />\n                            </div>\n                            <button class="button is-admin" type="submit"><%- msg.G_Adopt %></button>\n                        </form>\n                    </div>\n\n                    <div class="accordion-header sw-downlink-details">\n                        <div class="accordion-title"><%- msg.G_PropertiesDownlinks %></div>\n                    </div>\n                    <div class="downlinks sw-downlink-details minigrid">\n                        <div class="data-table data-table-downlinks data-table-fit bind-downlinks"><%- msg.G_PropertiesNoDownlinksConnected %></div>\n                    </div>\n                </div>\n            </div>\n            <div id="switchPorts<%- _id %>" class="tab-content minigrid port-list-config ap-configs">\n                <div class="data-table data-table-ports data-table-fit bind-ports port-list"><%- msg.G_PropertiesNoPorts %></div>\n                <div class="port-form"></div>\n            </div>\n            <div id="switchConfig<%- _id %>" class="tab-content ap-configs">\n                <div class="accordion">\n                    <div class="accordion-header ap-configs">\n                        <div class="accordion-title"><%- msg.G_Config %></div>\n                    </div>\n                    <div class="ap-configs">\n                        <form action="" class="aliasForm">\n                            <div class="row">\n                                <label for="aliasName<%- _id %>" class="label"><%- msg.G_PropertiesAlias %></label>\n                                <input name="name" id="aliasName<%- _id %>" type="text" class="input" value="<%- get(\'name\') %>" pattern=".{1,128}" title="<%- msg.E_AliasName %>" />\n                            </div>\n                            <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n                        </form>\n                    </div>\n\n                    <div class="accordion-header" class="networks-vlan-config">\n                        <div class="accordion-title"><%- msg.G_PropertiesNetworksVLANs %></div>\n                    </div>\n                    <div class="networks-vlan-config">\n                        <button class="button networks-vlan-create is-admin" name="create">\n                            <span class="ui-button-icon-primary ubnt-icon-plus"></span>\n                            <span class="nav-text"><%- msg.G_Create %></span>\n                        </button>\n\n                        <div class="networks-vlan-list">\n                            <div class="data-table data-table-networks-vlan data-table-fit"><%- msg.G_PropertiesNoNetworksVLANsConfigured %></div>\n                        </div>\n\n                        <div class="networks-vlan-form"></div>\n                    </div>\n\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_Services %></div>\n                    </div>\n                    <div>\n                        <form action="" class="servicesForm">\n                            <div class="clearfix">\n                                <div class="side-by-side">\n                                    <div class="row">\n                                        <label class="label inline"><%- msg.G_PropertiesManagementVLAN %></label>\n                                        <select name="mgmt_network" id="mgmt_network<%- _id %>">\n                                        </select>\n                                    </div>\n                                </div>\n                            </div>\n\n                            <div class="row">\n                                <label class="wrapper"><input type="checkbox" name="jumboframe_enabled" value="1" /><%- msg.G_PropertiesEnableJumboFrame %></label>\n                            </div>\n                            <div class="row">\n                                <label class="wrapper"><input type="checkbox" name="flowctrl_enabled" value="1" /><%- msg.G_PropertiesEnableFlowControl %></label>\n                            </div>\n\n                            <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n                        </form>\n                    </div>\n\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_Network %></div>\n                    </div>\n                    <div>\n                        <form action="" class="networkForm bind-network">\n                            <div class="clearfix">\n                                <div class="side-by-side">\n                                    <div class="row">\n                                        <label for="configure-ip<%- _id %>" class="label inline"><%- msg.G_PropertiesConfigIP %></label>\n                                        <select name="type" class="configure-ip" id="configure-ip<%- _id %>">\n                                            <option value="dhcp"><%- msg.G_PropertiesUsingDHCP %></option>\n                                            <option value="static"><%- msg.G_PropertiesStaticIP %></option>\n                                        </select>\n                                    </div>\n                                </div>\n                            </div>\n\n                            <div class="clearfix">\n                                <div class="side-by-side">\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_IPAddress %></label>\n                                        <input type="text" class="input inline" name="ip" size="17" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_PropertiesSubnetMask %></label>\n                                        <input type="text" class="input inline" name="netmask" size="17" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_PropertiesGateway %></label>\n                                        <input type="text" class="input inline" name="gateway" size="17" value="" />\n                                    </div>\n                                </div>\n\n                                <div class="side-by-side">\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_PropertiesPreferredDNS %></label>\n                                        <input type="text" class="input inline" name="dns1" size="17" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_PropertiesAlternateDNS %></label>\n                                        <input type="text" class="input inline" name="dns2" size="17" value="" />\n                                    </div>\n                                    <div class="row connection-toggled connection-static">\n                                        <label class="label inline"><%- msg.G_PropertiesDNSSuffix %></label>\n                                        <input type="text" class="input inline" name="dnssuffix" size="17" value="" />\n                                    </div>\n                                </div>\n                            </div>\n                            <button class="button is-admin"><%- msg.G_Apply %></button>\n                        </form>\n                    </div>\n\n                    <div class="accordion-header is-admin">\n                        <div class="accordion-title"><%- msg.G_PropertiesCopySwitchConfig %></div>\n                    </div>\n                    <div class="is-admin">\n                        <div class="row">\n                            <%- msg.G_PropertiesCopySwitchConfigTxt %>\n                        </div>\n                        <div class="left">\n                            <select name="copyConfig" class="copyConfig-dropdown" data-myposition="left bottom" data-atposition="left top"></select>\n                        </div>\n                    </div>\n\n                    <div class="accordion-header is-admin">\n                        <div class="accordion-title"><%- msg.G_PropertiesCustomUpgrade %></div>\n                    </div>\n                    <div class="is-admin">\n                        <div class="row">\n                            <%- msg.G_PropertiesCustomFirmwareTxt %>\n                        </div>\n                        <button class="button custom-upgrade left">\n                            <span class="ui-button-icon-primary ubnt-icon-download"></span>\n                            <span class="nav-text"><%- msg.G_PropertiesCustomUpgrade %></span>\n                        </button>\n                    </div>\n\n                    <div class="accordion-header is-admin">\n                        <div class="accordion-title"><%- msg.G_PropertiesForgetSwitch %></div>\n                    </div>\n                    <div class="is-admin">\n                        <div class="row">\n                            <%- msg.G_PropertiesForgetSwitchTxt %>\n                        </div>\n                        <button class="button forget left">\n                            <span class="ui-button-icon-primary ubnt-icon-forget-this-network"></span>\n                            <span class="nav-text"><%- msg.G_PropertiesForget %></span>\n                        </button>\n                        <div class="left">\n                            <select name="move" class="move-dropdown" data-myposition="left bottom" data-atposition="left top"></select>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="dialog-controls is-admin clearfix">\n            <button class="button button-locate left">\n                <span class="ui-button-icon-primary ubnt-icon-location sidebar-icons locate"></span>\n                <span class="nav-text"><%- msg.G_Locate %></span>\n            </button>\n            <button class="button button-restart left">\n                <span class="ui-button-icon-primary ubnt-icon-rotate sidebar-icons restart"></span>\n                <span class="nav-text"><%- msg.G_Restart %></span>\n            </button>\n            <button class="button button-update left">\n                <span class="ui-button-icon-primary ubnt-icon-download sidebar-icons update"></span>\n                <span class="nav-text"><%- msg.G_Upgrade %></span>\n            </button>\n            <button class="button button-adopt left">\n                <span class="ui-button-icon-primary ubnt-icon-plus sidebar-icons adopt"></span>\n                <span class="nav-text"><%- msg.G_Adopt %></span>\n            </button>\n            <button class="button button-edit right disabled">\n                <span class="ui-button-icon-primary ubnt-icon-edit sidebar-icons edit"></span>\n                <span class="nav-text"><%- msg.G_EditSelected %></span>\n            </button>\n        </div>\n    </div>\n</div>\n'}),define("text!includes/switches/switchDiagramUS8PTemplate.html",[],function(){return'<div class="diagram switch port8 bind-state">\n    <div class="detached">\n        <div class="top">\n            <div class="port sfp port-9" data-port="9">\n                <div class="num">SFP1</div>\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n        <div class="bottom">\n            <% for (var i = 1; i <= 8; i++) { %>\n            <div class="port port-<%= i %>" data-port="<%= i %>">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n                <div class="num"><%= i %></div>\n            </div>\n            <% } %>\n\n            <div class="port sfp port-10" data-port="10">\n                <div class="num">SFP2</div>\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n    </div>\n    <div class="attached">\n        <div class="top">\n            <div class="port sfp port-9" data-port="9">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n\n        <div class="bottom">\n            <% for (var i = 1; i <= 8; i++) { %>\n            <div class="port port-<%= i %>" data-port="<%= i %>">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n            <% } %>\n\n            <div class="port sfp port-10" data-port="10">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n';
}),define("text!includes/switches/switchDiagramUS16PTemplate.html",[],function(){return'<div class="diagram switch port16 bind-state">\n    <div class="detached">\n        <div class="top">\n            <% for (var i = 1; i <= 16; i+=2) { %>\n            <div class="port port-<%= i %>" data-port="<%= i %>">\n                <div class="num"><%= i %></div>\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n            <% } %>\n\n            <div class="port sfp port-17" data-port="17">\n                <div class="num">SFP1</div>\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n\n        <div class="bottom">\n            <% for (var i = 2; i <= 16; i+=2) { %>\n            <div class="port port-<%= i %>" data-port="<%= i %>">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n                <div class="num"><%= i %></div>\n            </div>\n            <% } %>\n\n            <div class="port sfp port-18" data-port="18">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n                <div class="num">SFP2</div>\n            </div>\n        </div>\n    </div>\n    <div class="attached">\n        <div class="top">\n            <% for (var i = 1; i <= 16; i+=2) { %>\n            <div class="port port-<%= i %>" data-port="<%= i %>">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n            <% } %>\n\n            <div class="port sfp port-17" data-port="17">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n\n        <div class="bottom">\n            <% for (var i = 2; i <= 16; i+=2) { %>\n            <div class="port port-<%= i %>" data-port="<%= i %>">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n            <% } %>\n\n            <div class="port sfp port-18" data-port="18">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n'}),define("text!includes/switches/switchDiagramUS24PTemplate.html",[],function(){return'<div class="diagram switch port24 bind-state">\n    <div class="detached">\n        <div class="top">\n            <% for (var i = 1; i <= 24; i+=2) { %>\n            <div class="port port-<%= i %>" data-port="<%= i %>">\n                <div class="num"><%= i %></div>\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n            <% } %>\n\n            <div class="port sfp port-25" data-port="25">\n                <div class="num">SFP1</div>\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n\n        <div class="bottom">\n            <% for (var i = 2; i <= 24; i+=2) { %>\n            <div class="port port-<%= i %>" data-port="<%= i %>">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n                <div class="num"><%= i %></div>\n            </div>\n            <% } %>\n\n            <div class="port sfp port-26" data-port="26">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n                <div class="num">SFP2</div>\n            </div>\n        </div>\n    </div>\n    <div class="attached">\n        <div class="top">\n            <% for (var i = 1; i <= 24; i+=2) { %>\n            <div class="port port-<%= i %>" data-port="<%= i %>">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n            <% } %>\n\n            <div class="port sfp port-25" data-port="25">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n\n        <div class="bottom">\n            <% for (var i = 2; i <= 24; i+=2) { %>\n            <div class="port port-<%= i %>" data-port="<%= i %>">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n            <% } %>\n\n            <div class="port sfp port-26" data-port="26">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n'}),define("text!includes/switches/switchDiagramUS48PTemplate.html",[],function(){return'<div class="diagram switch port48 bind-state">\n    <div class="detached">\n        <div class="top">\n            <% for (var i = 1; i <= 48; i+=2) { %>\n                <div class="port port-<%= i %>" data-port="<%= i %>">\n                    <div class="num"><%= i %></div>\n                    <div class="status">\n                        <div class="poe"></div>\n                        <div class="mirror"></div>\n                        <div class="block"></div>\n                    </div>\n                </div>\n            <% } %>\n\n            <div class="port sfp port-49" data-port="49">\n                <div class="num">SFP+1</div>\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n\n            <div class="port sfp port-51" data-port="51">\n                <div class="num">SFP1</div>\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n\n        <div class="bottom">\n            <% for (var i = 2; i <= 48; i+=2) { %>\n                <div class="port port-<%= i %>" data-port="<%= i %>">\n                    <div class="status">\n                        <div class="poe"></div>\n                        <div class="mirror"></div>\n                        <div class="block"></div>\n                    </div>\n                    <div class="num"><%= i %></div>\n                </div>\n            <% } %>\n\n            <div class="port sfp port-50" data-port="50">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n                <div class="num">SFP+2</div>\n            </div>\n            <div class="port sfp port-52" data-port="52">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n                <div class="num">SFP2</div>\n            </div>\n        </div>\n    </div>\n    <div class="attached">\n        <div class="top">\n            <% for (var i = 1; i <= 48; i+=2) { %>\n                <div class="port port-<%= i %>" data-port="<%= i %>">\n                    <div class="status">\n                        <div class="poe"></div>\n                        <div class="mirror"></div>\n                        <div class="block"></div>\n                    </div>\n                </div>\n            <% } %>\n\n            <div class="port sfp port-49" data-port="49">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n\n            <div class="port sfp port-51" data-port="51">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n\n        <div class="bottom">\n            <% for (var i = 2; i <= 48; i+=2) { %>\n                <div class="port port-<%= i %>" data-port="<%= i %>">\n                    <div class="status">\n                        <div class="poe"></div>\n                        <div class="mirror"></div>\n                        <div class="block"></div>\n                    </div>\n                </div>\n            <% } %>\n\n            <div class="port sfp port-50" data-port="50">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n            <div class="port sfp port-52" data-port="52">\n                <div class="status">\n                    <div class="poe"></div>\n                    <div class="mirror"></div>\n                    <div class="block"></div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n'}),define("unifi/view/switches/PropertyView",["unifi/view/devices/PropertyView","unifi/view/switches/NetworksVlanFormView","unifi/view/switches/PortFormView","ubnt/backgrid","libs/backgrid","underscore","backbone","jquery","msg/Msg","unifi/collection/PortConf","unifi/collection/Networks","text!includes/switches/switchPropertiesTemplate.html","text!includes/switches/switchDiagramUS8PTemplate.html","text!includes/switches/switchDiagramUS16PTemplate.html","text!includes/switches/switchDiagramUS24PTemplate.html","text!includes/switches/switchDiagramUS48PTemplate.html","ubnt/view/dialogs/AlertDialogView","ubnt/view/dialogs/ConfirmDialogView","stickit"],function(e,t,i,a,n,o,r,s,c,l,d,m,u,h,g,p,y,f){"use strict";return e.extend({templateId:m,diagramTemplate:null,bindings:function(){return o.extend({},e.prototype.bindings.call(this),{".bind-uplink":{observe:"uplink",onGet:function(e){if(e){var t=this.parent.options.app.collection("Devices").getDeviceFromMac(e.uplink_mac);t&&this.$bindUplinkDevice.text(t.name()).data("mac",t.get("mac")||""),this.$bindUplinkPort.text(e.port_idx),this.$bindUplinkSpeed.text(this.model.uplinkSpeed()),this.$bindUplinkDuplex.text(this.model.uplinkDuplex()),this.$bindUplinkDownPackets.text(this.model.uplinkDownPackets()),this.$bindUplinkUpPackets.text(this.model.uplinkUpPackets()),this.$bindUplinkActivity.text(this.model.uplinkActivity())}}},".bind-lastseen":{observe:"last_seen",onGet:function(){this.$bindLastseen.text(this.model.lastSeen())}},".bind-lastuplink":{observe:["last_uplink","uplink"],onGet:function(){this.$bindLastUplink.text(this.model.uplinkDeviceText())}},".bind-state":{observe:"uplink",onGet:function(){this.populateStates()}},".bind-downlinks":{observe:"downlink_table",onGet:function(e){this.downlinksTable()}},".bind-ports":{observe:"port_table",onGet:function(e){this.portsTable(!0)}},".bind-power-consumption":{observe:"port_table",onGet:function(e){this.$bindPowerConsumption.text(this.model.power()+" "+c.G_Watt)}},".bind-temperature":{observe:"general_temperature",onGet:function(e){var t=parseInt(this.model.get("general_temperature"),10)||-1;this.$bindTemperature.empty(),t>0&&this.$bindTemperature.text(this.model.get("general_temperature")).append(c.G_DegreeCelsius)}},".bind-fan-level":{observe:"fan_level",onGet:function(e){this.$bindFanLevel.text(this.model.fan_level())}},".bind-network":{observe:"config_network",onGet:function(e){this.populateNetworkForm(this.$networkForm,e)}},".button-edit":{observe:["state","map_id","default","upgradable","locating"],onGet:function(){this.toggleEditButton()}}})},initialize:function(t){switch(this.portConfCollection=t.parent.options.app.collection("PortConf"),this.model.get("model")){case"US8P150":this.diagramTemplate=o.template(u,{msg:c});break;case"US16P150":this.diagramTemplate=o.template(h,{msg:c});break;case"US24":case"US24P250":case"US24P500":this.diagramTemplate=o.template(g,{msg:c});break;case"US48":case"US48P500":case"US48P750":this.diagramTemplate=o.template(p,{msg:c})}this.listenTo(this.portConfCollection,"add remove change",s.proxy(function(){this.networksVlanTable(),this.portsTable(!0)},this)),e.prototype.initialize.call(this,t)},dependencies:function(){var e={PortConf:l,Networks:d},t=[],i={},a=this;o.each(e,function(e,a){t.push(i[a]=s.Deferred())},this),s.when.apply(s,t).then(function(){a._dependencies.resolve()},function(){a._dependencies.reject()}),o.each(e,function(e,t){this.options.parent.app.collection(t,{fetch:{reload:!1,deferred:i[t]}},e)},this)},render:function(t){var i=this.rendered;return e.prototype.render.call(this,t),i||(this.forms={},this.noDownlinksRows=this.$(".data-table-downlinks").html(),this.noPortsRows=this.$(".data-table-ports").html(),this.noNetworksVlanRows=this.$(".data-table-networks-vlan").html(),this.$advAdoptForm=this.$(".advAdoptForm"),this.$btnEdit=this.$(".button-edit"),this.$diagram=this.$(".diagram"),this.$portList=this.$(".port-list"),this.$portForm=this.$(".port-form"),this.$bindLastseen=this.$(".bind-lastseen"),this.$bindLastUplink=this.$(".bind-lastuplink"),this.$bindPowerConsumption=this.$(".bind-power-consumption"),this.$bindTemperature=this.$(".bind-temperature"),this.$bindFanLevel=this.$(".bind-fan-level"),this.$bindUplinkPort=this.$(".bind-uplink-port"),this.$bindUplinkDevice=this.$(".bind-uplink-device"),this.$bindUplinkSpeed=this.$(".bind-uplink-speed"),this.$bindUplinkDuplex=this.$(".bind-uplink-duplex"),this.$bindUplinkDownPackets=this.$(".bind-uplink-down-packets"),this.$bindUplinkUpPackets=this.$(".bind-uplink-up-packets"),this.$bindUplinkActivity=this.$(".bind-uplink-activity"),this.$uplinkDevice=this.$(".button-uplink-device"),this.$servicesForm=this.$(".servicesForm"),this.$networkForm=this.$(".networkForm"),this.$connectionType=this.$(".configure-ip"),this.$networksVlanCreate=this.$('.networks-vlan-config button[name="create"]'),this.$networksVlanList=this.$(".networks-vlan-list"),this.$networksVlanForm=this.$(".networks-vlan-form"),this.$advAdoptForm.on("submit",this.onAdvAdoptFormSubmit),this.$btnEdit.on("click",this.edit),this.$uplinkDevice.on("click",this.displayUplinkDevice),this.$servicesForm.on("submit",s.proxy(function(e){e.preventDefault(),this.updateServices()},this)),this.$networkForm.on("submit",s.proxy(function(e){e.preventDefault(),this.updateNetwork(this.$networkForm,"config_network")},this)),this.$connectionType.on("change",s.proxy(function(e){var t=s(e.target).val();this.$networkForm.find(".connection-toggled").hide().filter(".connection-"+t).show()},this)).trigger("change"),this.$networksVlanCreate.on("click",s.proxy(function(){this.networksVlanForm()},this)),this.$networksVlanForm.hide(),this.$portList.on("click","tr",s.proxy(function(e){var t,i=s(e.target).closest("tr");if(e.metaKey||e.ctrlKey){var a=i.closest("tr").find(".column-checkboxes input:not([disabled])");a.is(":checked");window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),a.trigger("click"),this.highlightPort(t)}else"tbody"==i.parent().prop("tagName").toLowerCase()&&(t=i.attr("class").replace("port-","")),this.highlightPort(t)},this)),this.$diagram.on("click",".port",s.proxy(function(e){if(e.preventDefault(),!this.forms.Port){var t=s(e.target).closest(".port"),i=t.data("port");if(e.metaKey||e.ctrlKey){var a=this.$portList.find("tr.port-"+i).find(".column-checkboxes input:not([disabled])");a.trigger("click"),this.highlightPort(i)}else this.highlightPort(i)}},this)),"resolved"===this._rendered.state()&&"resolved"===this._dependencies.state()?this.populate():"pending"===this._rendered.state()&&this._rendered.resolve(),this.adjustData&&this.adjustData(),this.stickit(this.model,this.bindings()),this.$tabs.on("change",s.proxy(function(e){this.toggleEditButton()},this)),this.toggleEditButton(),this.listenTo(this.app.collection("Networks"),"add remove",this.renderMgmtNetworks)),this.networksVlanTable(),this.portsTable(!0),this.renderMgmtNetworks(),i||this.detach(),this.options.options&&this.options.options.port&&this.highlightPort(this.options.options.port),this},renderMgmtNetworks:function(){var e=this.app.collection("Networks").filterByPurpose(["corporate","guest","voip","vlan-only"]),t=this.$("select[name=mgmt_network]"),i=this.model.get("networkgroup")||"LAN",a=o.find(e,function(e){return e.get("attr_no_delete")===!0&&e.get("networkgroup")===i})||e[0],n=this.model.get("mgmt_network_id")||a.id;t.empty(),o.each(e,function(e){t.append(s('<option value="'+e.id+'"></option>').text(e.get("name")))}),t.find('option[value="'+n+'"]').prop("selected",!0)},toggleEditButton:function(){1!==this.$tabs.tabs("option","active")||this.forms.Port?this.$tabs.find(".dialog-controls .button-edit").hide():this.$tabs.find(".dialog-controls .button-edit").show();var e=this.model.get("state");e!==this.lastPortState&&(this.position(),this.lastPortState=e)},edit:function(e){var t=s(e.target),i=t.hasClass("disabled"),a=this.$portList.find('.checkbox-cell input[type="checkbox"]:checked'),n=o.map(a,function(e){return e.id}),r=o.filter(this.model.collections.portTable.models,function(e){return-1!==n.indexOf(""+e.id)});!i&&a.length&&(this.portForm(r,null,!0),this.toggleEditButton())},args:function(){return{_id:this.id,diagram:this.diagramTemplate,msg:c}},adjustData:function(){},onAdvAdoptFormSubmit:function(e){e.preventDefault();var t=this,i=this.model,a=s(e.target).find("button");this.$advAdoptForm.find(".error").removeClass("error"),a.attr("disabled","disabled");var n=i.advanceAdopt({data:{ip:this.$advAdoptForm.find('input[name="ip"]').val(),port:this.$advAdoptForm.find('input[name="port"]').val(),username:this.$advAdoptForm.find('input[name="username"]').val(),password:this.$advAdoptForm.find('input[name="password"]').val(),url:this.$advAdoptForm.find('input[name="url"]').val()},success:function(e){"ok"===e.meta.rc?i.fetch({success:function(e,i,a){"ok"===i.meta.rc&&t.parent.property(e)},complete:function(){a.removeAttr("disabled")}}):(t.showErrorState(),a.removeAttr("disabled"))},error:function(){t.showErrorState(),a.removeAttr("disabled")}});!n&&this.model.validationError&&o.each(this.model.validationError,function(e,t){switch(t){case"username":case"password":this.$advAdoptForm.find('input[name="'+t+'"]').addClass("error"),a.removeAttr("disabled")}},this)},populate:function(){var t=this.$(".properties-container"),i=t.scrollTop();this.$el.addClass("switch-properties"),e.prototype.populate.call(this),this._dependencies&&"resolved"==this._dependencies.state()&&(this.$servicesForm.find("input[name=jumboframe_enabled]").prop("checked",this.model.get("jumboframe_enabled")),this.$servicesForm.find("input[name=flowctrl_enabled]").prop("checked",this.model.get("flowctrl_enabled")),o.each(this.model.collections.portTable.models||[],s.proxy(function(e){var t=this.$diagram.find(".port-"+e.id);t.removeClass("shutdown up green orange poe mirror block").addClass(e.diagramClasses()).attr("title","Port "+e.get("port_idx")).tooltip({show:!1,hide:!1,track:!0,content:function(){return e.diagramTooltip()}})},this)),this.position(),o.delay(function(){t.scrollTop(i)},0))},populateStates:function(){this.$el.removeClass("sw-has-fan, sw-has-uplink, sw-has-downlinks"),this.model.get("uplink")&&this.$el.addClass("sw-has-uplink"),this.model.get("downlink_table")&&this.$el.addClass("sw-has-downlinks"),this.model.get("has_fan")&&this.$el.addClass("sw-has-fan")},downlinksTable:function(){if(!this.rendered)return!1;if(this.grids.downlinks)this.grids.downlinks.collection.set(this.model.get("downlink_table"));else{var e=[{name:"port_idx",label:c.G_Port,editable:!1,cell:"integer"},{name:"mac",label:c.G_PropertiesDevice,editable:!1,cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:s.proxy(function(e){var t=this.parent.options.app.collection("Devices"),i=e.get("mac")?t.getDeviceFromMac(e.get("mac")):null;return i?i.name():e.get("mac")},this),toRaw:function(e){return e}}}),callback:s.proxy(function(e){var t=this.parent.options.app.routers.devices.views.index,i=t.collection.getDeviceFromMac(e.get("mac"));t.property(i)},this)},{name:"model",label:c.G_DevicesModel,editable:!1,headerCell:a.Headers.customSortHeader,sortValue:s.proxy(function(e){var t=this.parent.options.app.collection("Devices"),i=e.get("mac")?t.getDeviceFromMac(e.get("mac")):null;return i?i.apModel():""},this),cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:s.proxy(function(e){var t=this.parent.options.app.collection("Devices"),i=e.get("mac")?t.getDeviceFromMac(e.get("mac")):null;return i?i.apModel():""},this),toRaw:function(e){return e}}})},{name:"status",label:c.G_Status,editable:!1,headerCell:a.Headers.customSortHeader,sortValue:s.proxy(function(e){var t=e.get("speed")+" ";return t+=e.get("full_duplex")?c.G_PropertiesFullDuplexAbbrv:c.G_PropertiesHalfDuplexAbbrv},this),cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){var t=e.get("speed")+" ";return t+=e.get("full_duplex")?c.G_PropertiesFullDuplexAbbrv:c.G_PropertiesHalfDuplexAbbrv},toRaw:function(e){return e}}})}];this.grids.downlinks=this.grid(e,new r.Collection(this.model.get("downlink_table")),this.$(".data-table-downlinks"),this.noDownlinksRows)}},displayUplinkDevice:function(){var e=this.app.routers.devices.views.index,t=e.collection.getDeviceFromMac(this.model.uplinkDeviceMac());return t&&e.property(t),!1},portsTable:function(e){if(this.lastPortState=null,!this.rendered)return!1;if(this.grids.ports)this.grids.ports.refresh();else{var t=[{name:"_checkboxes",customClass:"column-checkboxes",editable:!1,sortable:!1,headerCell:a.Headers.CheckboxHeader,cell:a.Cells.CheckboxCell.extend({config:{callback:this.portSelectionChanged},render:function(){var e=!!this.$checkbox;if(!e){this.$checkbox=this.$el.find('input[type="checkbox"]'),this.$el.empty();var t=this.config,i=t.callback||s.noop,a=this.model,n=t.options;(!t.render||t.render(a,n))&&this.$el.append(s('<input type="checkbox" id="'+a.id+'">').on("click",function(e){var t=s(e.target),n=t.is(":checked");n?(t.closest("tr").addClass("select"),t.closest(".property-content").find(".diagram div.port-"+a.id).addClass("select")):(t.closest("tr").removeClass("select"),t.closest(".property-content").find(".diagram div.port-"+a.id).removeClass("select")),e.stopPropagation(),i(a,e)}))}return this.model.get("aggregated_by")||"switch"!==this.model.get("op_mode")?this.$el.find('input[type="checkbox"]').prop("checked",!1).prop("disabled",!0).addClass("disabled"):this.$el.find('input[type="checkbox"]').prop("disabled",!1).removeClass("disabled"),this}})},{name:"port_idx",label:c.G_Port,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){return e.portIdxText()},toRaw:function(e){return e}}})},{name:"name",label:c.G_Name,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:"string"},{name:"speed",label:c.G_Status,customClass:"detached-only",editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){return e.statusText()},toRaw:function(e){return e}}})},{name:"tx_bytes",label:c.G_DevicesTX,customClass:"detached-only",editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:n.StringCell.extend({formatter:a.Formatters.Bytes})},{name:"rx_bytes",label:c.G_DevicesRX,customClass:"detached-only",editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:n.StringCell.extend({formatter:a.Formatters.Bytes})},{name:"poe_mode",label:c.G_PropertiesPoE,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:s.proxy(function(e){return e.poeModeText()},this),toRaw:function(e){return e}}})},{name:"portconf_id",label:c.G_PropertiesNetworksVLANs,customClass:"detached-only",editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:s.proxy(function(e){return e.networksVlansText()},this),toRaw:function(e){return e}}})},{name:"_id",label:c.G_Actions,customClass:"column-actions",editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ActionsCell.extend({actions:{edit:{icon:"ubnt-icon-edit",iconOnly:!0,requiresAdminPrivilege:!0,callback:this.portForm,render:function(e){return!e.get("masked")}},restart:{icon:"ubnt-icon-rotate",iconOnly:!0,callback:this.rowPowerCycle,requiresAdminPrivilege:!0,render:function(e){return e.get("poe_enable")}}}})}],i={pageable:!1,rowClassName:function(e){return"port-"+e.get("port_idx")}};this.grids.ports=this.grid(t,this.model.collections.portTable,this.$(".data-table-ports"),this.noPortsRows,i)}if(this.grids.ports){var o,r;(o=this.$diagram.find("div.highlight"))&&(r=o.data("port"))&&this.highlightPort(r,!0,e)}},statsPortForm:function(e,t){this.$tabs.tabs("option","active",1);var i=e.get("port_idx");this.highlightPort(i),t&&(this.forms.Port&&this.forms.Port.remove(),this.portForm(e))},portForm:function(e,t,a){t&&t.stopPropagation();var n=this,r=(this.parent.options.app.collection("PortConf"),this.$(".properties-container")),c=r.scrollTop();this.forms.Port=new i({app:this.parent.options.app,container:this.$portForm,model:this.model,overrides:a?e:[e]}),this.forms.Port.render(),this.position(),a||(this.$diagram.find("div.port.select").removeClass("select"),this.highlightPort(e.id)),this.listenTo(this.forms.Port,"remove",s.proxy(function(){this.position();var e=this.$portList.find('.checkbox-cell input[type="checkbox"]:checked'),t=o.map(e,function(e){return e.id}),i=this.forms.Port.formResult&&"success"===this.forms.Port.formResult||!1,a=this.$diagram.find("div.port.highlight"),n=this.$portList.find("tr.highlight");t.length&&(a.removeClass("highlight"),n.removeClass("highlight"),o.each(t,function(e){this.$diagram.find("div.port.port-"+e).addClass("select")},this),!n.length&&i&&this.$portList.find('thead .column-checkboxes input[type="checkbox"]').prop("checked",!1).trigger("change")),this.forms.Port=null},this)),this.forms.Port.$el.one("remove",function(){o.delay(function(){r.scrollTop(c),n.toggleEditButton()},0)})},portSelectionChanged:o.debounce(function(e){var t=this.$portList.find('.checkbox-cell input[type="checkbox"]:checked');t.length?this.$tabs.find(".dialog-controls .button-edit").removeClass("disabled"):this.$tabs.find(".dialog-controls .button-edit").addClass("disabled")},100),networksVlanTable:function(){var e=this;if(!this.rendered)return!1;if(!this.grids.networks){var t=[{name:"name",label:c.G_Name,editable:!1,cell:"string"},{name:"forward",label:c.G_Config,editable:!1,cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:function(t){var i="",a=e.app.collection("Networks"),n=a.filterByPurpose(["corporate","guest","voip","vlan-only"]),r=o.findWhere(n,{id:t.get("native_networkconf_id")});switch(t.get("forward")){case"customize":i+=c.G_PropertiesCustomized;break;case"native":i+=c.G_PropertiesNative,r&&(i+=" ("+r.get("name")+")")}return i},toRaw:function(e){return e}}})},{name:"_id",label:c.G_Actions,customClass:"column-actions",editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ActionsCell.extend({actions:{edit:{icon:"ubnt-icon-edit",iconOnly:!0,requiresAdminPrivilege:!0,callback:this.networksVlanForm},remove:{icon:"ubnt-icon-trash",iconOnly:!0,requiresAdminPrivilege:!0,callback:s.proxy(function(e){(new f).show(c.G_PropertiesNetworkDeleteConfirm,s.proxy(function(){e.destroy({success:s.proxy(function(e,t){"ok"===t.meta.rc?this.showSavedState():this.showErrorState()},this),error:s.proxy(function(){this.showErrorState()},this)})},this))},this)}}})}];this.grids.networks=this.grid(t,this.parent.options.app.collection("PortConf"),this.$(".data-table-networks-vlan"),this.noNetworksVlanRows,{paginateToAddedModel:!0})}this.grids.networks&&this.grids.networks.setFilter("forward",["native","customize"],1)},networksVlanForm:function(e){var i=this.parent.options.app.collection("PortConf");this.forms.NetworksVlan=new t({app:this.parent.options.app,container:this.$networksVlanForm,collection:i,model:e||new i.model}),this.listenTo(this.forms.NetworksVlan,"remove",s.proxy(function(){this.forms.NetworksVlan=null},this)),this.forms.NetworksVlan.render(),this.position()},updateServices:function(){var e={mgmt_network_id:this.$servicesForm.find("select[name=mgmt_network]").val(),jumboframe_enabled:this.$servicesForm.find("input[name=jumboframe_enabled]").is(":checked"),flowctrl_enabled:this.$servicesForm.find("input[name=flowctrl_enabled]").is(":checked")};return this.model.save(e,{success:s.proxy(function(e,t){"ok"===t.meta.rc?this.showSavedState():this.showErrorState()},this),error:s.proxy(function(){this.showErrorState()},this)}),!1},highlightPort:function(e,t,i){var a=this.$portList.find("tr.port-"+e),n=this.$diagram.find("div.port-"+e),r=o.isUndefined(t)?n.hasClass("highlight"):!t,s=this.$diagram.find("div.port.select").length>0;this.$portList.find("tr.highlight").removeClass("highlight"),this.$diagram.find("div.port.highlight").removeClass("highlight"),r||(s||n.addClass("highlight"),!i&&this.$tabs.tabs("option","active",1),a.length&&(s||a.addClass("highlight"))),a.length&&this.$(".properties-container").scrollTop(a.position().top),this.options&&this.options.options&&this.options.options.port&&(this.options.options.port=null)},rowPowerCycle:function(e){var t=this,i=function(){t.model.powerCyclePort({data:{port_idx:e.get("port_idx")},success:function(e,i,a){t.model.fetch()},error:function(e,i,a){t.app.views.app.flash("error","Error",c.apiError(e))}})};(new f).show(c.localize(c.N_ConfirmPowerCyclePort,e.get("port_idx")),i)},remove:function(){this.stopListening(this.portConfCollection,"add remove change"),this.stopListening(this.forms.Port,"remove"),this.stopListening(this.forms.NetworksVlan,"remove"),this.$bindUplinkDevice.off(),this.$connectionType.off(),this.$servicesForm.off(),this.$networkForm.off(),this.$networksVlanCreate.off(),this.$portList.off(),this.$diagram.off(),this.unstickit(this.model),this.$btnEdit.off("click",this.edit),this.$uplinkDevice.off("click",this.displayUplinkDevice),this.unstickit(this.model),this.$tabs.off("change"),this.forms.Port&&this.forms.Port.$el.off(),this.$advAdoptForm.off("submit",this.onAdvAdoptFormSubmit),this.forms.Port&&this.forms.Port.remove(),
this.forms.NetworksVlan&&this.forms.NetworksVlan.remove(),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("text!includes/phones/phonePropertiesTemplate.html",[],function(){return'<div class="accordion-header">\n    <div class="accordion-title">\n        <span class="device-icons access-point half"></span>\n        <span class="title-text"><%- name() %></span>\n        <div class="ubnt-icon-arrow-down sidebar-icons minmax minimize"></div>\n    </div>\n    <div class="right">\n        <div class="ubnt-icon-new-window sidebar-icons detach" title="Detach"></div>\n        <div class="ubnt-icon-close sidebar-icons remove" title="Close"></div>\n    </div>\n</div>\n<div class="property-content">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n\n    <div class="device-status-wrapper">\n        <div class="device-status bind-status"></div>\n    </div>\n    <div class="status-alert status-success"><span class="ubnt-icon-check checkmark"></span><%- msg.G_Saved %></div>\n    <div class="status-alert status-error"><span class="ubnt-icon-warning alert"></span><%- msg.E_Error %></div>\n    <div class="tabs">\n        <ul>\n            <li class="tab-nav-list-item">\n                <a class="tab-button" href="#deviceDetails<%- _id %>"><%- msg.G_PropertiesDetails %></a>\n            </li>\n            <li class="tab-nav-list-item ap-configs">\n                <a class="tab-button" href="#deviceConfig<%- _id %>"><%- msg.G_PropertiesConfiguration %></a>\n            </li>\n        </ul>\n        <div class="properties-container overflow">\n            <div id="deviceDetails<%- _id %>" class="tab-content">\n                <div class="accordion">\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_DevicesOverview %></div>\n                    </div>\n                    <div class="basic-overview">\n                        <table>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesMACAddress %></td>\n                                <td class="column-value"><%- get(\'mac\') %></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_DevicesModel %></td>\n                                <td class="column-value"><%- apModel() %></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_Version %></td>\n                                <td class="column-value bind-version"></td>\n                            </tr>\n                        </table>\n                        <hr />\n                        <table>\n                            <tr class="table-row ip-address">\n                                <td class="column-name"><%- msg.G_IPAddress %></td>\n                                <td class="column-value bind-ip"></td>\n                            </tr>\n                            <tr class="table-row uptime">\n                                <td class="column-name"><%- msg.G_Uptime %></td>\n                                <td class="column-value bind-uptime"></td>\n                            </tr>\n                        </table>\n                    </div>\n                    <div class="accordion-header sw-adv-adopt">\n                        <div class="accordion-title"><%- msg.G_PropertiesAdvancedOpts %></div>\n                    </div>\n                    <div class="sw-adv-adopt">\n                        <form action="" class="advAdoptForm ph-adv-adopt">\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_IP %></label>\n                                <input class="input inline medium bind-adopt-ip" type="text" value="" name="ip" />\n                                <span class="colon">:</span>\n                                <input class="input inline small bind-adopt-port" type="text" value="" name="port" />\n                            </div>\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_UN %></label>\n                                <input class="input inline" type="text" value="" name="username" />\n                            </div>\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_PW %></label>\n                                <input class="input inline" type="password" value="" name="password" />\n                            </div>\n                            <div class="row">\n                                <label class="label inline"><%- msg.G_PropertiesInformURL %></label>\n                                <input class="input inline bind-adopt-url" type="text" value="" name="url" />\n                            </div>\n                            <button class="button is-admin" type="submit"><%- msg.G_Adopt %></button>\n                        </form>\n                    </div>\n                </div>\n            </div>\n            <div id="deviceConfig<%- _id %>" class="tab-content ap-configs">\n                <div class="accordion">\n                    <div class="accordion-header is-admin">\n                        <div class="accordion-title"><%- msg.G_PropertiesForgetPhone %></div>\n                    </div>\n                    <div class="is-admin">\n                        <div class="row">\n                            <%- msg.G_PropertiesForgetPhoneTxt %>\n                        </div>\n                        <button class="button forget left is-admin">\n                            <span class="ui-button-icon-primary ubnt-icon-forget-this-network"></span>\n                            <span class="nav-text"><%- msg.G_PropertiesForget %></span>\n                        </button>\n                        <div class="left">\n                            <select name="move" class="move-dropdown" data-myposition="left bottom" data-atposition="left top"></select>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="dialog-controls is-admin clearfix">\n            <button class="button button-locate left">\n                <span class="ui-button-icon-primary ubnt-icon-location sidebar-icons locate"></span>\n                <span class="nav-text"><%- msg.G_Locate %></span>\n            </button>\n            <button class="button button-restart left">\n                <span class="ui-button-icon-primary ubnt-icon-rotate sidebar-icons restart"></span>\n                <span class="nav-text"><%- msg.G_Restart %></span>\n            </button>\n            <button class="button button-update left">\n                <span class="ui-button-icon-primary ubnt-icon-download sidebar-icons update"></span>\n                <span class="nav-text"><%- msg.G_Upgrade %></span>\n            </button>\n            <button class="button button-adopt left">\n                <span class="ui-button-icon-primary ubnt-icon-plus sidebar-icons adopt"></span>\n                <span class="nav-text"><%- msg.G_Adopt %></span>\n            </button>\n        </div>\n    </div>\n</div>\n'}),define("unifi/view/phones/PropertyView",["unifi/view/devices/PropertyView","ubnt/backgrid","underscore","backbone","libs/backgrid","jquery","msg/Msg","unifi/model/Device","text!includes/phones/phonePropertiesTemplate.html","ubnt/view/dialogs/AlertDialogView","stickit"],function(e,t,i,a,n,o,r,s,c,l){"use strict";return e.extend(i.extend({},{templateId:c,render:function(t){var i=this.rendered;return e.prototype.render.call(this,t),i||(this.$advAdoptForm=this.$(".advAdoptForm"),this.$advAdoptForm.on("submit",this.onAdvAdoptFormSubmit),"resolved"===this._rendered.state()&&"resolved"==this._dependencies.state()?this.populate():"pending"===this._rendered.state()&&this._rendered.resolve(),this.stickit(this.model,this.bindings())),this},onAdvAdoptFormSubmit:function(e){e.preventDefault();var t=this,a=this.model,n=o(e.target).find("button");this.$advAdoptForm.find(".error").removeClass("error"),n.attr("disabled","disabled");var r=a.advanceAdopt({data:{ip:this.$advAdoptForm.find('input[name="ip"]').val(),port:this.$advAdoptForm.find('input[name="port"]').val(),username:this.$advAdoptForm.find('input[name="username"]').val(),password:this.$advAdoptForm.find('input[name="password"]').val(),url:this.$advAdoptForm.find('input[name="url"]').val()},success:function(e){"ok"===e.meta.rc?a.fetch({success:function(e,i,a){"ok"===i.meta.rc&&t.parent.property(e)},complete:function(){n.removeAttr("disabled")}}):(t.showErrorState(),n.removeAttr("disabled"))},error:function(){t.showErrorState(),n.removeAttr("disabled")}});!r&&this.model.validationError&&i.each(this.model.validationError,function(e,t){switch(t){case"username":case"password":this.$advAdoptForm.find('input[name="'+t+'"]').addClass("error"),n.removeAttr("disabled")}},this)},populate:function(){e.prototype.populate.call(this),this._dependencies&&"resolved"==this._dependencies.state()&&this.position()},remove:function(){this.rendered=!1,this.unstickit(this.model),this.$advAdoptForm.off("submit",this.onAdvAdoptFormSubmit),e.prototype.remove.apply(this,arguments)}}))}),define("text!includes/devices/devicesAddDeviceDialog.html",[],function(){return'<div id="add-device" class="dialog-simple-form">\n    <div class="content left">\n        <div class="errors" style="display:none"></div>\n        <div class="success" style="display:none"></div>\n\n        <form id="addDeviceForm" action="" class="left">\n            <div class="row">\n\n                <input id="deviceAddress" \n                       name="device-address" \n                       type="text" \n                       placeholder="<%- msg.G_PropertiesMACAddress %>" \n                       class="input device-address"\n                       maxlength="17" />\n\n                <input id="deviceCode" \n                       name="device-code" \n                       type="text" \n                       placeholder="<%- msg.G_DeviceCode %>" \n                       class="input device-code"\n                       maxlength="6" />\n            </div>\n\n            <div class="footer">\n                <button class="button button-submit right tall green" type="submit">\n                    <span class="ubnt-icon-check ui-button-icon button-check-icon"></span>\n                    <%- msg.G_Submit %>\n                </button>\n            </div>\n        </form>\n    </div>\n</div>\n'}),define("unifi/view/devices/AddDeviceView",["unifi/view/app/DialogView","text!includes/devices/devicesAddDeviceDialog.html","unifi/model/Device","msg/Msg","backbone","underscore","jquery"],function(e,t,i,a,n,o,r){"use strict";return e.extend({events:{"keyup input[name=device-address]":"validateInputs","keyup input[name=device-code]":"validateInputs","click .button-submit":"onSubmit","submit #addSiteForm":"onSubmit"},dialogOptions:{title:a.G_DevicesAddNewDevice,width:"auto",height:"auto",modal:!0,resizable:!1,draggable:!1,dialogClass:"dialog-add-device dialog-simple"},initialize:function(e){o.bindAll(this),this.app=e.app,this.device=new i},render:function(){this.$el.html(o.template(t,{msg:a})),this.$deviceAddressInput=this.$("input[name=device-address]").focus(),this.$deviceCodeInput=this.$("input[name=device-code]").focus(),this.$submitButton=this.$(".button-submit"),this.$errors=this.$(".errors"),this.$success=this.$(".success")},open:function(){e.prototype.open.call(this),r.Window.on("resize.addDeviceDialog",o.debounce(this.onResizeWindow,250)),this.$submitButton.prop("disabled",!0),this.onResizeWindow()},close:function(){e.prototype.close.call(this),r.Window.off("resize.addDeviceDialog")},onResizeWindow:function(){this.center()},validateInputs:function(){var e=0,t=[this.$deviceAddressInput];o.each(t,function(t){t.val()||e++},this),this.$submitButton.prop("disabled",!!e)},onSubmit:function(e){e.preventDefault();var t=this,i=this.$deviceAddressInput.val(),n=this.$deviceCodeInput.val(),o=i+n,r={macidqr:o,success:function(e){"ok"===e.meta.rc&&(t.$errors.hide(),t.$success.show(),t.$success.text(a.G_DevicesAddSuccess),t.app.refresh(),setTimeout(function(){t.close()},1e3))},error:function(e){"Bad Request"===e.statusText&&(t.$errors.show(),t.$errors.text(a.E_InvalidDevice))}};return this.device.sync("add-device",this,r)},remove:function(){r.Window.off("resize.addDeviceDialog"),e.prototype.remove.apply(this,arguments)}})}),define("text!includes/devices/devicesIndexTemplate.html",[],function(){return'<div class="section section-main">\n    <h1><%- msg.G_Devices %></h1>\n    <form class="data-filters clearfix">\n        <span class="ubnt-icon-search"></span>\n        <input type="text" name="search" class="search left" />\n        \n        <div class="buttonset type-filters">\n            <input type="radio" id="devicesFilterAll" name="type-filter" value="all" checked="checked" /><label for="devicesFilterAll"><%- msg.G_All %></label>\n            <input type="radio" id="devicesFilterGatewaySwitch" name="type-filter" value="gateway-switch" /><label for="devicesFilterGatewaySwitch"><%- msg.G_DevicesGatewaySwitches %></label>\n            <input type="radio" id="devicesFilterAccessPoints" name="type-filter" value="ap" /><label for="devicesFilterAccessPoints"><%- msg.G_DevicesAPs %></label>\n            <input type="radio" id="devicesFilterPhones" name="type-filter" value="phone" /><label for="devicesFilterPhones"><%- msg.G_DevicesPhones %></label>\n        </div>\n        \n        <div class="buttonset ap-filters">\n            <input type="radio" id="devicesFilterOverview" name="ap-filter" value="overview" checked="checked" /><label for="devicesFilterOverview"><%- msg.G_DevicesOverview %></label>\n            <input type="radio" id="devicesFilterConfig" name="ap-filter" value="config" /><label for="devicesFilterConfig"><%- msg.G_Config %></label>\n            <input type="radio" id="devicesFilterPerformance" name="ap-filter" value="performance" /><label for="devicesFilterPerformance"><%- msg.G_DevicesPerformance %></label>\n        </div>\n        \n        <div class="right">\n            <select name="items-per-page" data-label="<%- msg.G_FilterItemsPerPage %>">\n                <option value="10">10</option>\n                <option value="50" selected="selected">50</option>\n                <option value="100">100</option>\n                <option value="200">200</option>\n            </select>\n        </div>\n    </form>\n    \n    <div class="global-actions">\n        <button type="button" class="button lighter auto is-admin" style="display:none" id="addDevice">\n            <span class="ui-button-icon-primary ubnt-icon-plus"></span>\n            <%- msg.G_AddDevice %>\n        </button>\n        <button type="button" class="button lighter auto is-admin" id="upgradeAPs">\n            <span class="ubnt-icon-download"></span>\n            <span class="copy"><%- msg.G_DevicesStartRollingUpgrade %></span>\n        </button>\n        <button type="button" class="button lighter auto is-admin" id="upgradePhones">\n            <span class="ubnt-icon-download"></span>\n            <span class="copy"><%- msg.G_UpgradeAll %></span>\n        </button>\n    </div>\n\n    <div class="data-table untitled">\n        <div class="loading"><span><%- msg.N_Loading %></span></div>\n    </div>\n</div>\n'}),define("unifi/view/devices/IndexView",["unifi/view/app/ListContentView","unifi/view/aps/PropertyView","unifi/view/gateway/PropertyView","unifi/view/switches/PropertyView","unifi/view/phones/PropertyView","unifi/view/devices/AddDeviceView","ubnt/view/dialogs/ConfirmDialogView","underscore","libs/backgrid","ubnt/backgrid","msg/Msg","jquery","unifi/collection/Devices","unifi/collection/WlanGroups","unifi/collection/Extensions","ubnt/GoogleAnalytics","text!includes/devices/devicesIndexTemplate.html","ubnt/view/dialogs/AlertDialogView"],function(e,t,i,a,n,o,r,s,c,l,d,m,u,h,g,p,y,f){"use strict";return e.extend({id:"devicesIndex",_templateId:y,_collectionType:{name:"Devices",Class:u},_pageable:!0,_filterMinimum:.1,initialize:function(t){this.properties={},this.locateTimer=null,this.locateLit=!1,e.prototype.initialize.call(this,t),this.listenTo(this.collection,"change:upgradable change:rollupgrade add remove sync",s.debounce(this.changeUpgradeButtonStatus,250)),this.listenTo(this.collection,"remove",s.debounce(this.removeProperty,250)),this.listenTo(this.collection,"change:locating",s.debounce(this.toggleLocating,250)),this.listenTo(this.collection,"sync",s.debounce(this.enableLocateTimerIfNeeded,250))},render:function(){var t=this.rendered;e.prototype.render.call(this,!0),t||(this.$btnAddDevice=m("#addDevice"),this.$btnAddDevice.on("click",this.addDevice),this.$btnUpgradeAPs=m("#upgradeAPs"),this.$btnUpgradeAPsCopy=this.$btnUpgradeAPs.find(".copy"),this.$btnUpgradeAPs.on("click",this.upgradeAPs),this.changeUpgradeAPsStatus(),this.$btnUpgradePhones=m("#upgradePhones"),this.$btnUpgradePhones.on("click",this.upgradePhones),this.changeUpgradePhonesStatus(),this._rendered.resolve())},dependencies:function(){this._dependencies.resolve(),this.wlanGroups=this.app.collection("WlanGroups",{fetch:{reload:!1}},h),this.listenTo(this.wlanGroups,"sync",m.proxy(function(){this.grids.content&&this.grids.content.reset()},this)),this.extensions=this.app.collection("Extensions",{fetch:{reload:!1}},g)},columns:function(){var e=this;return[{name:"state",customClass:"column-name",editable:!1,sortable:!1,headerCell:l.Headers.emptyHeader,cell:l.Cells.ComplexHtmlCell.extend({formatter:{fromRaw:function(e){return m("<div />").addClass("ap-model-"+e.get("model")).addClass(e.isConnected()?"ap-connected":"ap-disconnected").append(m('<div class="device-icons access-point half"></div>'))},toRaw:function(e){return e}}})},{name:"name",label:d.G_DevicesNameMACAddress,customClass:"column-name",editable:!1,sortValue:"name",sortFormatter:"toLowerCase",headerCell:l.Headers.customSortHeader,cell:l.Cells.ModelCell.extend({callback:"name"}),callback:this.property,title:"mac"},{name:"mac",label:d.G_NameMACAddress,customClass:"column-mac",editable:!1,cell:"string"},{name:"ip",label:d.G_IPAddress,customClass:"column-ip",editable:!1,sortValue:"ip2long",headerCell:l.Headers.customSortHeader,cell:l.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){if(e.get("type")===e.typeMap.gateway){var t=s.findWhere(e.get("port_table"),{name:"lan"});if(t&&t.ip)return t.ip}return e.get("ip")},toRaw:function(e){return e}}})},{name:"state",label:d.G_Status,customClass:"column-state",editable:!1,sortValue:"status",headerCell:l.Headers.customSortHeader,cell:l.Cells.ComplexHtmlCell.extend({formatter:{fromRaw:function(e){return m("<span />").addClass(e.statusType()).text(e.status())},toRaw:function(e){return e}}})},{name:"model",label:d.G_DevicesModel,customClass:"column-model",editable:!1,sortValue:"apModel",headerCell:l.Headers.customSortHeader,cell:l.Cells.ModelCell.extend({callback:"apModel"})},{name:"version",label:d.G_Version,customClass:"column-version",editable:!1,cell:"string",title:function(e){return e.get("type")===e.typeMap.phone?e.get("version")+" / "+e.get("platform_version"):""}},{name:"num_sta",label:d.G_DevicesClients,customClass:"column-num_sta",editable:!1,sortValue:"sort_Clients",headerCell:l.Headers.customSortHeader,cell:"integer"},{name:"ng-num_sta",label:d.G_Devices2GClients,customClass:"column-ng-num_sta",editable:!1,sortValue:"sort_2GClients",headerCell:l.Headers.customSortHeader,cell:"integer"},{name:"na-num_sta",label:d.G_Devices5GClients,customClass:"column-na-num_sta",editable:!1,sortValue:"sort_5GClients",headerCell:l.Headers.customSortHeader,cell:"integer"},{name:"tx_bytes",label:d.G_DevicesDown,customClass:"column-tx_bytes",editable:!1,cell:c.StringCell.extend({formatter:l.Formatters.Bytes})},{name:"rx_bytes",label:d.G_DevicesUp,customClass:"column-rx_bytes",editable:!1,cell:c.StringCell.extend({formatter:l.Formatters.Bytes})},{name:"tx_bytes-d",label:d.G_DevicesTX,customClass:"column-tx_bytes-d",editable:!1,sortValue:"sort_txBytesD",headerCell:l.Headers.customSortHeader,cell:c.StringCell.extend({formatter:l.Formatters.Bytes})},{name:"rx_bytes-d",label:d.G_DevicesRX,customClass:"column-rx_bytes-d",editable:!1,sortValue:"sort_rxBytesD",headerCell:l.Headers.customSortHeader,cell:c.StringCell.extend({formatter:l.Formatters.Bytes})},{name:"tx_bytes_2g",label:d.G_DevicesTX2G,customClass:"column-tx_bytes_2g",editable:!1,sortValue:"sort_txBytes2g",headerCell:l.Headers.customSortHeader,cell:l.Cells.ComplexHtmlCell.extend({formatter:{fromRaw:m.proxy(function(e){return this.radioBar("ng",e)},this)}})},{name:"tx_bytes_5g",label:d.G_DevicesTX5G,customClass:"column-tx_bytes_5g",editable:!1,sortValue:"sort_txBytes5g",headerCell:l.Headers.customSortHeader,cell:l.Cells.ComplexHtmlCell.extend({formatter:{fromRaw:m.proxy(function(e){return this.radioBar("na",e)},this)}})},{name:"ng-channel",label:d.G_DevicesChannel,customClass:"column-ng-channel",editable:!1,sortValue:"sortApChannel",headerCell:l.Headers.customSortHeader,cell:l.Cells.ModelCell.extend({callback:"apChannel"})},{name:"wlangroup_id_na",label:d.G_DevicesWLAN2G,customClass:"column-wlangroup_id_na",editable:!1,sortValue:m.proxy(function(t,i){return t.wlan2G(e.app.collection("WlanGroups"))},this),headerCell:l.Headers.customSortHeader,cell:l.Cells.ComplexCell.extend({formatter:{fromRaw:function(t){return t.wlan2G(e.app.collection("WlanGroups"))},toRaw:function(e){return e}}})},{name:"wlangroup_id_ng",label:d.G_DevicesWLAN5G,customClass:"column-wlangroup_id_ng",editable:!1,sortValue:m.proxy(function(t,i){return t.wlan5G(e.app.collection("WlanGroups"))},this),headerCell:l.Headers.customSortHeader,cell:l.Cells.ComplexCell.extend({formatter:{fromRaw:function(t){return t.wlan5G(e.app.collection("WlanGroups"))},toRaw:function(e){return e}}})},{name:"radio_ng",label:d.G_DevicesRadio2G,customClass:"column-radio_ng",editable:!1,sortValue:"sortRadio2G",headerCell:l.Headers.customSortHeader,cell:l.Cells.ModelCell.extend({callback:"radio2G"})},{name:"radio_na",label:d.G_DevicesRadio5G,customClass:"column-radio_na",editable:!1,sortValue:"sortRadio5G",headerCell:l.Headers.customSortHeader,cell:l.Cells.ModelCell.extend({callback:"radio5G"})},{name:"extension",label:d.G_DevicesExtension,customClass:"column-extension",editable:!1,cell:l.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){return e.get("extension")},toRaw:function(e){return e}}}),callback:function(t){var i=e.app.collection("Extensions").filterByExtension(t.get("extension"));i&&e.options.app.views.app.openSettings("extensions",i.id)}},{name:"uptime",label:d.G_Uptime,customClass:"column-uptime",editable:!1,cell:l.Cells.ModelCell.extend({callback:"uptime"})},{name:"_id",label:d.G_Actions,customClass:"column-actions",editable:!1,sortable:!1,headerCell:l.Headers.noSortHeader,cell:l.Cells.ActionsCell.extend({actions:{locate:{icon:"ubnt-icon-location",callback:this.rowLocate,requiresAdminPrivilege:!0,classCallback:function(e){return e.get("locating")?"locating":""},render:function(e){return 1==e.get("state")}},restart:{icon:"ubnt-icon-rotate",callback:this.rowRestart,requiresAdminPrivilege:!0,render:function(e){return 1==e.get("state")}},adopt:{icon:"ubnt-icon-plus",callback:this.rowAdopt,requiresAdminPrivilege:!0,render:function(e){return 2!=e.get("state")&&12!=e.get("state")||!e.get("default")?!1:"scan"==e.get("discovered_via")&&e.get("vwireEnabled")===!1?!1:!0}},upgrade:{icon:"ubnt-icon-download",callback:this.rowUpgrade,requiresAdminPrivilege:!0,render:function(e){if(e.get("upgradable")===!0){if(1==e.get("state"))return!0;if(2==e.get("state"))return e.get("uplink")&&"wireless"===e.get("uplink").type?!1:!0}return!1}}}})}]},grid:function(){this._gridRowClassName=this.gridRowClassName,e.prototype.grid.call(this);var t=this.grids.content,i=this.$el.find(".buttonset.type-filters"),a=i.find("input[name=type-filter]"),n=this.$el.find(".buttonset.ap-filters"),o=n.find("input[name=ap-filter]"),r=[],c=[],l=this.collection.typeMap,d=this.$btnUpgradeAPs,u=this.$btnUpgradePhones;return a.filter('[value="'+(m.cookie("filterDeviceType")||"all")+'"]').click(),o.filter('[value="'+(m.cookie("filterDeviceAp")||"overview")+'"]').click(),s.each(a,function(e,t){r.push(e.value)}),s.each(o,function(e,t){c.push(e.value)}),a.on("change",function(e){var i=m(this).val(),a=i?i.split("-"):null,c=[];a&&s.each(a,function(e,t){l[e]&&c.push(l[e])}),c&&c.length?t.setFilter("type",c.length>1?c:c[0],1):t.removeFilter("type"),t.$el.removeClass(r.join(" ")).addClass(i||r[0]),"ap"==i?(n.show(),d.show(),u.hide()):"phone"==i?(n.hide(),d.hide(),u.show()):(n.hide(),d.hide(),u.hide()),o.filter(":checked").trigger("change"),m.cookie("filterDeviceType",i)}).filter(":checked").trigger("change"),o.on("change",function(e){var i=m(this),a=i.val();t.$el.removeClass(c.join(" ")).addClass(i.is(":visible")?a||c[0]:""),m.cookie("filterDeviceAp",a)}).filter(":checked").trigger("change"),this},gridRowClassName:function(e){return"mac-"+e.getMacNoColons()},property:function(e,o){if(!e)throw"Missing model";var r,s=e.get("mac");if(this.properties[s])this.properties[s].render(),this.properties[s].setSection&&this.properties[s].setSection(o);else{switch(e.get("type")){case e.typeMap.ap:r=t;break;case e.typeMap.gateway:r=i;break;case e.typeMap["switch"]:r=a;break;case e.typeMap.phone:r=n}r&&(this.properties[s]=new r({properties:this.app.views.app.views.properties,parent:this,model:e,property_id:s.split(":").join(""),show:!0,options:o}))}return this.properties[s]},removeProperty:function(e){var t=e.get("mac");this.properties[t]&&delete this.properties[t]},rowLocate:function(e){e.locate(),1===e.get("state")&&e.get("map_id")&&(this.app.routers.map.forward(),this.app.routers.map.views.index.locateDevice(e))},toggleLocating:function(e){1===e.get("state")&&e.get("locating")?this.getLocateButtons(e).addClass("locating"):this.getLocateButtons(e).removeClass("locating"),this.enableLocateTimerIfNeeded()},enableLocateTimerIfNeeded:function(){var e=this,t=this.collection.findWhere({locating:!0});t?this.locateTimer||(e.locateLit=!0,this.locateTimer=window.setInterval(function(){m(".button-locate.locating").toggleClass("on",e.locateLit),e.locateLit=!e.locateLit},500)):(this.locateTimer&&(clearTimeout(this.locateTimer),delete this.locateTimer),this.locateTimer=null)},getLocateButtons:function(e){return m("."+this.gridRowClassName(e)).find(".button-locate")},rowRestart:function(e){var t=this,i=function(){e.restart({success:function(i,a,n){"ok"===i.meta.rc?(e.fetch(),e.set({restarting:!0})):t.app.views.app.flash("error")},error:function(e,i,a){t.app.views.app.flash("error","Error",d.apiError(e))}})};e.get("type")===e.typeMap.gateway||e.get("type")===e.typeMap["switch"]?(new r).show(d.N_ConfirmRestartDevice,i):i()},rowAdopt:function(e){var t=this;e.adopt({success:function(i,a,n){"ok"===i.meta.rc?e.fetch({success:function(){},error:function(){t.app.views.app.flash("error")}}):t.app.views.app.flash("error")},error:function(e,i,a){t.app.views.app.flash("error","Error",d.apiError(e))}})},rowUpgrade:function(e){var t=this,i=function(){e.upgrade({success:function(i,a,n){"ok"===i.meta.rc?e.fetch({success:function(){"ok"===i.meta.rc&&t.app.views.app.flash("success")}}):t.app.views.app.flash("error")},error:function(e,i,a){t.app.views.app.flash("error","Error",d.apiError(e))}})};e.get("type")===e.typeMap.gateway||e.get("type")===e.typeMap["switch"]?(new r).show(d.N_ConfirmUpgradeDevice,i):i()},changeUpgradeButtonStatus:function(){this.changeUpgradeAPsStatus(),this.changeUpgradePhonesStatus()},changeUpgradeAPsStatus:function(){this.collection.hasUpgradableAP()?this.$btnUpgradeAPs.removeAttr("disabled"):this.$btnUpgradeAPs.attr("disabled","disabled"),this.changeUpgradeAPsText()},changeUpgradeAPsText:function(){this.collection.isUpgradingDevices()?this.$btnUpgradeAPsCopy.text(d.G_DevicesRollingUpgradeInProgress):this.$btnUpgradeAPsCopy.text(d.G_DevicesStartRollingUpgrade)},upgradeAPs:function(){var e=this;this.collection.upgradeAPs({success:function(){e.collection.isUpgradingDevices()?(new f).open(d.G_DevicesRollingUpgradeCancelled):(new f).open(d.G_APRollingUpgrade),e.app.refresh(),e.changeUpgradeAPsStatus()}})},changeUpgradePhonesStatus:function(){this.collection.hasUpgradablePhone()?this.$btnUpgradePhones.removeAttr("disabled"):this.$btnUpgradePhones.attr("disabled","disabled"),this.changeUpgradeAPsText()},upgradePhones:function(){var e=this;this.collection.upgradePhones({success:function(){e.app.refresh(),e.changeUpgradePhonesStatus()}})},addDevice:function(){var e=new o({app:this.app});e.open()},radioBar:function(e,t){if(!t.get("adopted")||1!=t.get("state")||!t.get("radio_"+e))return"";var i,a,n=(parseInt(t.get(e+"_ast_txto"),10)||0)+(parseInt(t.get(e+"_ast_cst"),10)||0),o=parseInt(t.get(e+"_tx_retries"),10)||0,r=(parseInt(t.get(e+"_ast_be_xmit"),10)||0)+(parseInt(t.get(e+"_tx_packets"),10)||0),c=[n,o,r],l=["red","yellow","green"],d=100;if(!(i=s.reduce(c,function(e,t){return e+t},0)))return"";var u=m('<ul class="ratio-bar"></ul>');return s.each(c,function(e,t){a=Math.ceil(100*e/i),a>d&&(a=d),m("<li></li>",{"class":l[t],width:(t+1==c.length?d:a)+"%"}).appendTo(u),d-=a}),u.attr("title",c.join(" / ")),u},remove:function(){this.stopListening(this.collection),this.$btnAddDevice.off("click",this.addDevice),this.$btnUpgradeAPs.off("click",this.upgradeAPs),this.$btnUpgradePhones.off("click",this.upgradePhones);var t=this.$el.find(".buttonset.type-filters"),i=t.find("input[name=type-filter]"),a=this.$el.find(".buttonset.ap-filters"),n=a.find("input[name=ap-filter]");i.off("change"),n.off("change"),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/router/DevicesRouter",["unifi/router/Router","unifi/view/devices/IndexView","unifi/view/devices/PropertyView"],function(e,t,i){"use strict";return e.extend({_fullyQualifiedName:"UNIFI.Routers.Devices",_associatedViews:{Index:t,Property:i},routes:{devices:"index","devices?d=:d":"index"}})}),define("unifi/model/ClientHistory",["unifi/model/Model"],function(e){"use strict";return e.extend()}),define("unifi/collection/ClientHistory",["unifi/collection/Collection","backbone","underscore","unifi/model/ClientHistory"],function(e,t,i,a){"use strict";return e.extend({model:a,bySite:!0,initialize:function(t){this.mac=t.mac,e.prototype.initialize.call(this,t)},url:function(){return"/api/s/"+SITE.name+"/stat/session"},sync:function(e,i,a){switch(a=a||{},e){case"read":a.contentType="application/json; charset=utf-8",a.type="POST",a.data=JSON.stringify({mac:this.mac,_limit:5,_sort:"-assoc_time"})}return t.sync.call(this,e,i,a)},parse:function(e){var t=e.data;return i.where(t,{mac:this.mac})}})}),define("unifi/model/User",["unifi/model/Model","jquery","underscore","backbone","msg/Msg","ubnt/ubnt.ip"],function(e,t,i,a,n){"use strict";return e.extend({validate:function(e,a){var o={},r=a?a.partial:null;return r&&"fixed_ip"!=r||e.use_fixedip&&(this.validator.ip(e.fixed_ip)?a.extra&&a.extra.subnet&&!t.ipsubnet_hasip(a.extra.subnet,e.fixed_ip)&&(o.fixed_ip=n.localize(n.E_IncorrectIPSubnet,e.fixed_ip,a.extra.subnet)):o.fixed_ip=n.localize(n.E_IncorrectIPAddress,n.G_ClientsFixedIP)),i.size(o)?o:void 0},sync:function(e,t,i){switch(i=i||{},e){case"read":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/rest/user/"+t.id,i.type="GET";break;case"create":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/rest/user",i.type="PUT";break;case"update":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/rest/user/"+t.id,i.type="PUT",i.data=JSON.stringify(t.toJSON({exclude:["_id","site_id","first_seen","is_guest","is_wired","mac","oui"]}));break;case"delete":i.contentType="application/json; charset=utf-8",i.url="/api/s/"+SITE.name+"/rest/user/"+t.id,
i.type="DELETE"}return a.sync.call(this,e,t,i)}})}),define("text!includes/clients/clientsPropertiesTemplate.html",[],function(){return'<div class="accordion-header">\n    <div class="accordion-title">\n        <span class="device-icons station"></span>\n        <span class="title-text"><%- name() %></span>\n        <div class="ubnt-icon-arrow-down sidebar-icons minmax minimize"></div>\n    </div>\n    <div class="right">\n        <div class="ubnt-icon-new-window sidebar-icons detach" title="Detach"></div>\n        <div class="ubnt-icon-close sidebar-icons remove" title="Close"></div>\n    </div>\n</div>\n<div class="property-content">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n\n    <div class="status-alert status-success"><span class="ubnt-icon-check checkmark"></span> <%- msg.G_Saved %></div>\n    <div class="status-alert status-error"><span class="ubnt-icon-warning alert"></span> <%- msg.E_Error %></div>\n    <div class="tabs">\n        <ul>\n            <li class="tab-nav-list-item">\n                <a class="tab-button" href="#clientDetails<%- _id %>"><%- msg.G_PropertiesDetails %></a>\n            </li>\n            <li class="tab-nav-list-item statistics-tab">\n                <a class="tab-button" href="#clientStatistics<%- _id %>"><%- msg.G_Stats %></a>\n            </li>\n            <li class="tab-nav-list-item">\n                <a class="tab-button" href="#clientHistory<%- _id %>"><%- msg.G_PropertiesHistory %></a>\n            </li>\n            <li class="tab-nav-list-item">\n                <a class="tab-button" href="#clientConfig<%- _id %>"><%- msg.G_Configuration %></a>\n            </li>\n        </ul>\n        <div class="properties-container overflow">\n            <div id="clientDetails<%- _id %>" class="tab-content">\n                <div class="table-basic">\n                    <table>\n                        <tr class="table-row">\n                            <td class="column-name"><%- msg.G_PropertiesMACAddress %></td>\n                            <td class="column-value"><%- get(\'mac\') %></td>\n                        </tr>\n                        <tr class="table-row">\n                            <td class="column-name"><%- msg.G_Hostname %></td>\n                            <td class="column-value hostname bind-hostname"></td>\n                        </tr>\n                    </table>\n                    <hr />\n                    <table>\n                        <tr class="table-row ip-address">\n                            <td class="column-name"><%- msg.G_IPAddress %></td>\n                            <td class="column-value bind-ip"></td>\n                        </tr>\n                        <tr class="table-row uptime">\n                            <td class="column-name"><%- msg.G_Uptime %></td>\n                            <td class="column-value bind-uptime"></td>\n                        </tr>\n                        <tr class="table-row connected-ap wireless-only">\n                            <td class="column-name"><%- msg.G_PropertiesConnectedAP %></td>\n                            <td class="column-value">\n                                <a class="bind-connected-ap" href="#"></a>\n                            </td>\n                        </tr>\n                        <tr class="table-row connected-network wired-only">\n                            <td class="column-name"><%- msg.G_Network %></td>\n                            <td class="column-value bind-connected-network"></td>\n                        </tr>\n                        <tr class="table-row connected-port wired-only">\n                            <td class="column-name"><%- msg.G_Port %></td>\n                            <td class="column-value">\n                                <a class="bind-connected-port" href="#"></a>\n                            </td>\n                        </tr>\n                        <tr class="table-row last-seen">\n                            <td class="column-name"><%- msg.G_LastSeen %></td>\n                            <td class="column-value bind-last-seen"></td>\n                        </tr>\n                    </table>\n                </div>\n            </div>\n            <div id="clientStatistics<%- _id %>" class="tab-content">\n                <div class="accordion">\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_PropertiesOverview %></div>\n                    </div>\n                    <div>\n                        <div class="table-basic">\n                            <table class="wireless-only">\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_PropertiesESSID %></td>\n                                    <td class="column-value bind-essid"></td>\n                                </tr>\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_PropertiesConnectedAP %></td>\n                                    <td class="column-value">\n                                        <a class="bind-connected-ap" href="#"></a>\n                                    </td>\n                                </tr>\n                            </table>\n                            <table class="wired-only">\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_Network %></td>\n                                    <td class="column-value bind-connected-network"></td>\n                                </tr>\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_Port %></td>\n                                    <td class="column-value">\n                                        <a class="bind-connected-port" href="#"></a>\n                                    </td>\n                                </tr>\n                            </table>\n                            <hr />\n                            <table class="wireless-only">\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_Channel %></td>\n                                    <td class="column-value"><span class="bind-channel"></span> (11<span class="bind-radio-type"></span>)</td>\n                                </tr>\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_PropertiesSignal %></td>\n                                    <td class="column-value"><span class="bind-rssi"></span> (<span class="bind-signal-with-dbm"></span>)</td>\n                                </tr>\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_PropertiesTXRate %></td>\n                                    <td class="column-value bind-tx-rate"></td>\n                                </tr>\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_PropertiesRXRate %></td>\n                                    <td class="column-value bind-rx-rate"></td>\n                                </tr>\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_PropertiesPowerSave %></td>\n                                    <td class="column-value bind-powersave"></td>\n                                </tr>\n                            </table>\n                            <hr class="wireless-only" />\n                            <table>\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_Activity %></td>\n                                    <td class="column-value bind-activity"></td>\n                                </tr>\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_PropertiesDownPktsBytes %></td>\n                                    <td class="column-value bind-sent-packets"></td>\n                                </tr>\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_PropertiesUpPktsBytes %></td>\n                                    <td class="column-value bind-received-packets"></td>\n                                </tr>\n                            </table>\n                        </div>\n                    </div>\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_PropertiesDPI %></div>\n                    </div>\n                    <div>\n                        <table>\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesDPIDeviceID %></td>\n                                <td class="column-value bind-dpi-dev-id"></td>\n                            </tr>\n                            <!--\n                            <tr class="table-row">\n                                <td class="column-name"><%- \'Type\' %></td>\n                                <td class="column-value bind-dpi-dev-type"><%- dpiDeviceType() %></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- \'Vendor\' %></td>\n                                <td class="column-value bind-dpi-dev-vendor"><%- dpiDeviceVendor() %></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- \'Family\' %></td>\n                                <td class="column-value bind-dpi-dev-family"><%- dpiDeviceFamily() %></td>\n                            </tr>\n                            <tr class="table-row">\n                                <td class="column-name"><%- \'OS Class\' %></td>\n                                <td class="column-value bind-dpi-dev-os-class"><%- dpiDeviceOSClass() %></td>\n                            </tr>\n                            -->\n                            <tr class="table-row">\n                                <td class="column-name"><%- msg.G_PropertiesDPIOSName %></td>\n                                <td class="column-value bind-dpi-dev-os-name"></td>\n                            </tr>\n                        </table>\n                        <hr />\n                        <div class="data-table data-table-clients-dpi"><%- msg.G_PropertiesNoClientDpi %></div>\n                    </div>\n                </div>\n            </div>\n            <div id="clientHistory<%- _id %>" class="tab-content minigrid">\n                <div class="data-table data-table-clients-history"><%- msg.G_PropertiesNoHistory %></div>\n            </div>\n            <div id="clientConfig<%- _id %>" class="tab-content">\n                <div class="accordion">\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_Config %></div>\n                    </div>\n                    <div>\n                        <form action="" class="configForm">\n                            <div class="row">\n                                <label for="aliasName<%- _id %>" class="label"><%- msg.G_PropertiesAlias %></label>\n                                <input name="name" id="aliasName<%- _id %>" type="text" class="input" value="<%- get(\'name\') %>" />\n                            </div>\n\n                            <div class="row">\n                                <label for="note<%- _id %>" class="label"><%- msg.G_Note %></label>\n								<textarea id="note<%- _id %>" name="note" class="textarea"><%- get(\'note\') %></textarea>\n                            </div>\n                            <div class="row">\n                                <label for="usergroups<%- _id %>" class="label label-selectmenu"><%- msg.G_PropertiesUsergroups %></label>\n                                <select id="usergroups<%- _id %>" name="usergroup_id" class="bind-usergroups">\n                                    <option value="null"><%- msg.G_PropertiesAutomatic %></option>\n                                    <option value="default"><%- msg.G_Default %></option>\n                                </select>\n                            </div>\n                            <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n                        </form>\n                    </div>\n                    <div class="accordion-header">\n                        <div class="accordion-title"><%- msg.G_ClientsIPConfig %></div>\n                    </div>\n                    <div>\n                        <form action="" class="configIpForm">\n                            <fieldset>\n                                <div class="row">\n                                    <label for="useFixedIp<%- _id %>" class="label inline"><%- msg.G_ClientsFixedIP %></label>\n                                    <label class="label inline wrapper label-fit label-light"><input type="checkbox" class="checkbox" id="useFixedIp<%- _id %>" name="use_fixedip" value="1" /> <%- msg.G_ClientsUseFixedIP %></label>\n                                </div>\n                                <div class="row">\n                                    <label for="fixedNetwork<%- _id %>" class="label inline"><%- msg.G_Network %></label>\n                                    <select id="fixedNetwork<%- _id %>" name="network_id" class="bind-networks"></select>\n                                </div>\n                                <div class="row">\n                                    <label for="fixedIp<%- _id %>" class="label inline"><%- msg.G_IP %></label>\n                                    <input id="fixedIp<%- _id %>" type="text" class="input inline" name="fixed_ip" />\n                                </div>\n                            </fieldset>\n                            <button class="button is-admin" type="submit"><%- msg.G_Apply %></button>\n                        </form>\n                    </div>\n                    <div class="accordion-header is-admin">\n                        <div class="accordion-title"><%- msg.G_PropertiesDebug %></div>\n                    </div>\n                    <div class="is-admin">\n                        <div class="row">\n                            <table>\n                                <tr class="table-row">\n                                    <td class="column-name"><%- msg.G_PropertiesDeviceType %></td>\n                                    <td class="column-value"><%- get(\'oui\') %></td>\n                                </tr>\n                            </table>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="dialog-controls is-admin clearfix">\n            <button class="button button-block left auto">\n                <span class="ui-button-icon-primary ubnt-icon-close sidebar-icons block bind-block"></span>\n                <span class="nav-text"><%- msg.G_Block %></span>\n            </button>\n            <button class="button button-unblock left auto">\n                <span class="ui-button-icon-primary ubnt-icon-undo sidebar-icons unblock bind-unblock"></span>\n                <span class="nav-text"><%- msg.G_Unblock %></span>\n            </button>\n            <button class="button button-reconnect left narrow wireless-only">\n                <span class="ui-button-icon-primary ubnt-icon-reconnect sidebar-icons restart"></span>\n                <span class="nav-text"><%- msg.G_PropertiesReconnect %></span>\n            </button>\n            <button class="button button-unauthorize left narrow">\n                <span class="ui-button-icon-primary ubnt-icon-undo sidebar-icons block"></span>\n                <span class="nav-text"><%- msg.G_PropertiesUnauthorize %></span>\n            </button>\n            <button class="button button-authorize left narrow">\n                <span class="ui-button-icon-primary ubnt-icon-plus sidebar-icons block"></span>\n                <span class="nav-text"><%- msg.G_PropertiesAuthorize %></span>\n            </button>\n        </div>\n    </div>\n</div>\n'}),define("unifi/view/clients/PropertyView",["unifi/view/app/PropertyView","unifi/collection/ClientHistory","unifi/collection/UserGroups","unifi/collection/Networks","unifi/model/User","unifi/model/ClientDpi","jquery","backbone","underscore","msg/Msg","libs/backgrid","ubnt/backgrid","text!includes/clients/clientsPropertiesTemplate.html"],function(e,t,i,a,n,o,r,s,c,l,d,m,u){"use strict";return e.extend({templateId:u,initialize:function(t){e.prototype.initialize.call(this,t),r.when(this._rendered=r.Deferred(),this._dependencies=r.Deferred()).then(this.populate,this.failed),this.user=new n,this.user.id=this.model.id,this.listenTo(this.user,"change",this.populateConfigIp),this.listenTo(this.model,"change:dpi_stats",this.setStatsCollection),this.dependencies(),this.render()},bindings:function(){return{".bind-hostname":{observe:["name","hostname"],onGet:function(){this.$bindHostname.text(this.model.name()),this.$titleText.text(this.model.name())}},".bind-ip":"ip",".bind-uptime":{observe:"uptime",onGet:function(){this.$bindUptime.text(this.model.uptime())}},".bind-connected-ap":{observe:"ap_mac",onGet:this.populateDeviceName},".bind-connected-network":{observe:"network_id",onGet:function(e){if(e){var t=this.networks.get(e);this.$bindConnectedNetwork.text(t.get("name")),this.$selectNetwork.val(t.get("_id"))}}},".bind-connected-port":{observe:["gw_mac","sw_mac","sw_port"],onGet:this.populateDeviceName},".bind-last-seen":{observe:"last_seen",onGet:function(){this.$bindLastSeen.text(this.model.lastSeen())}},".bind-essid":"essid",".bind-channel":"channel",".bind-radio-type":{observe:["radio","radio_proto"],onGet:function(){this.$bindRadioType.text(this.model.radioType())}},".bind-rssi":{observe:"rssi",onGet:function(){this.$bindRssi.text(this.model.rssi())}},".bind-signal-with-dbm":{observe:"signal",onGet:function(){this.$bindSignalWithDbm.text(this.model.signalWithDbm())}},".bind-tx-rate":{observe:"tx_rate",onGet:function(){this.$bindTxRate.text(this.model.txRateInM())}},".bind-rx-rate":{observe:"rx_rate",onGet:function(){this.$bindRxRate.text(this.model.rxRateInM())}},".bind-activity":{observe:["tx_bytes-r","rx_bytes-r"],onGet:function(){this.$bindActivity.text(this.model.activity())}},".bind-powersave":{observe:"powersave_enabled",onGet:function(){this.$bindPowersave.text(this.model.powersave())}},".bind-received-packets":{observe:["rx_packets","rx_bytes"],onGet:function(){this.$bindReceivedPackets.text(this.model.receivedPacketsOverBytes())}},".bind-sent-packets":{observe:["tx_packets","tx_bytes"],onGet:function(){this.$bindSentPackets.text(this.model.sentPacketsOverBytes())}},".bind-dpi-dev-id":{observe:"dev_id",onGet:function(){this.$bindDpiDevId.text(this.model.dpiDeviceId())}},".bind-dpi-dev-os-name":{observe:"os_name",onGet:function(){this.$bindDpiDevOSName.text(this.model.dpiDeviceOSName())}},".bind-oui":"oui"}},dependencies:function(){var e={UserGroups:i,Networks:a},t=[],n={},o=this;c.each(e,function(e,i){t.push(n[i]=r.Deferred())},this),t.push(n.user=r.Deferred()),r.when.apply(r,t).then(function(){o._dependencies.resolve()},function(){o._dependencies.reject()}),c.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:n[t]}},e)},this),this.user.fetch({complete:function(){n.user.resolve()}})},render:function(a){var n=this.rendered;return e.prototype.render.call(this,a),n||(this.$titleText=this.$(".title-text"),this.$configForm=this.$(".configForm"),this.$configIpForm=this.$(".configIpForm"),this.$bindHostname=this.$(".bind-hostname"),this.$bindUptime=this.$(".bind-uptime"),this.$bindConnectedAP=this.$(".bind-connected-ap"),this.$bindConnectedNetwork=this.$(".bind-connected-network"),this.$bindConnectedPort=this.$(".bind-connected-port"),this.$bindLastSeen=this.$(".bind-last-seen"),this.$bindRadioType=this.$(".bind-radio-type"),this.$bindRssi=this.$(".bind-rssi"),this.$bindSignalWithDbm=this.$(".bind-signal-with-dbm"),this.$bindTxRate=this.$(".bind-tx-rate"),this.$bindRxRate=this.$(".bind-rx-rate"),this.$bindActivity=this.$(".bind-activity"),this.$bindPowersave=this.$(".bind-powersave"),this.$bindReceivedPackets=this.$(".bind-received-packets"),this.$bindSentPackets=this.$(".bind-sent-packets"),this.$bindUserGroups=this.$(".bind-usergroups"),this.$bindDpiDevId=this.$(".bind-dpi-dev-id"),this.$bindDpiDevOSName=this.$(".bind-dpi-dev-os-name"),this.$useFixedIp=this.$("input[name=use_fixedip]"),this.$fixedIp=this.$("input[name=fixed_ip]"),this.$selectNetwork=this.$("select[name=network_id]"),this.$buttonBlock=this.$(".button-block"),this.$buttonUnblock=this.$(".button-unblock"),this.$buttonBlock.on("click",this.block),this.$buttonUnblock.on("click",this.unblock),this.$(".button-reconnect").on("click",this.reconnect),this.$(".button-unauthorize").on("click",this.unauthorize),this.$(".button-authorize").on("click",this.authorize),this.$configForm.on("submit",this.updateConfig),this.$configIpForm.on("submit",this.updateConfigIp),this.$bindConnectedAP.on("click",this.displayConnectedAP),this.$bindConnectedPort.on("click",this.displayConnectedPort),this.$useFixedIp.on("change",r.proxy(function(e){var t=r(e.target);t.parents(".row").siblings().toggle(t.is(":checked")),t.is(":checked")&&this.renderSelects()},this)).trigger("change"),this.collections.history=new t({mac:this.model.get("mac")}),this.noClientHistoryRows=this.$(".data-table-clients-history").html(),this.noClientDpiRows=this.$(".data-table-clients-dpi").html(),this.model.on("change:name",this.onChangeName),this.model.on("change",this.populate),this.devices=this.app.collection("Devices"),this.devices.on("change",this.populateDeviceName),this.networks=this.app.collection("Networks"),this.listenTo(this.networks,"add remove change",this.setupNetworks),this.setupNetworks(),this.devices.on("change",this.toggleFixedIP),this.toggleFixedIP(),this.userGroups=this.app.collection("UserGroups",{},i),this.listenTo(this.userGroups,"add remove change",this.setupUserGroups),"resolved"===this._rendered.state()&&"resolved"==this._dependencies.state()?this.populate():"pending"===this._rendered.state()&&this._rendered.resolve(),this.stickit(this.model,this.bindings()),this.setStatsCollection(),this.app.isReadOnly||(this.queryDpiStats(),this.dpiQueryInterval=setInterval(this.queryDpiStats,6e4))),this.options.options&&this.options.options.section&&this.setSection(this.options.options.section),this},setSection:function(e){if(e){var t,i;switch(e){case"details":t=0,i=null;break;case"dpi":t=1,i=1}null!==t&&(this.$tabs.tabs("option","active",t),null!==i&&this.$el.find(".properties-container > div:nth-child("+(t+1)+") > .accordion").accordion("option","active",i)),this.options&&this.options.options&&this.options.options.section&&(this.options.options.section=null)}},queryDpiStats:function(){this.model.queryDpiStats()},populate:function(){if(this._dependencies&&"resolved"==this._dependencies.state()){this.$el.find(".property-content .loading").remove();var e=this.model.isConnected(),t=this.model.get("is_wired"),i=this.model.get("is_guest"),a=this.model.get("blocked"),n=this.model.authorizable(),o=this.model.get("authorized");this.$el.removeClass("sta-connected sta-disconnected sta-isguest sta-authorizable sta-authorized sta-blocked sta-wired sta-wireless"),this.$el.addClass("client-properties"),e?(this.$el.addClass("sta-connected"),i&&this.$el.addClass("sta-isguest"),n&&this.$el.addClass("sta-authorizable"),o&&this.$el.addClass("sta-authorized")):(this.$el.addClass("sta-disconnected"),"1"==this.$tabs.tabs("option","active")&&this.$tabs.tabs("option","active",0)),t?this.$el.addClass("sta-wired"):this.$el.addClass("sta-wireless"),a&&this.$el.addClass("sta-blocked"),this.populateConfigIp(),this.setupUserGroups(),this.collections.history.fetch().done(this.historyTableGrid),this.dpiTableGrid(),this.position()}},populateConfigIp:function(){this.$useFixedIp.prop("checked",this.user.get("use_fixedip")).trigger("change"),this.$fixedIp.val(this.user.get("fixed_ip")||this.model.get("ip")),this.user.get("network_id")&&this.$selectNetwork.val(this.user.get("network_id"))},populateDeviceName:function(){var e,t="";this.model.get("is_wired")?(this.model.get("sw_mac")?t=(e=this.devices.getDeviceFromMac(this.model.get("sw_mac")))?e.name()+(this.model.get("sw_port")?" #"+this.model.get("sw_port"):""):this.model.get("sw_mac"):this.model.get("gw_mac")&&(t=(e=this.devices.getDeviceFromMac(this.model.get("gw_mac")))?e.name():this.model.get("gw_mac")),this.$bindConnectedPort.text(t)):(t=(e=this.model.get("ap_mac")?this.devices.getDeviceFromMac(this.model.get("ap_mac")):null)?e.name():this.model.get("ap_mac"),this.$bindConnectedAP.text(t))},onChangeName:function(){this.$(".hostname").text(this.model.get("name"))},block:function(){this.setSection("details"),this.parent.rowBlock(this.model)},unblock:function(){this.parent.rowUnblock(this.model)},reconnect:function(){this.parent.rowReconnect(this.model,{success:r.proxy(function(){this.remove()},this)})},unauthorize:function(){var e=this;return this.model.unauthorize({success:function(){e.$el.removeClass("sta-authorized"),e.model.set({authorized:!1})}}),!1},authorize:function(){var e=this;return this.model.authorize({success:function(){e.$el.addClass("sta-authorized"),e.model.set({authorized:!0})}}),!1},updateConfig:function(e){e&&e.preventDefault();var t,i=this,a=this.$configForm.serializeObject(),n=this.$configForm.find('input[name="name"]');return this.$configForm.find(".error").removeClass("error"),this.$configForm.find(".row-error").remove(),this.model.get("name")||""!==a.name||delete a.name,a.noted=a.note?!0:!1,t=this.model.save(a,{data:a,success:function(e,t){if("ok"===t.meta.rc){var a=i.app.collection("Clients");if(c.each(a.where({mac:e.get("mac")}),function(t){t.set(e.attributes)}),i.app.data.hasOwnProperty("KnownClients")){var n=i.app.collection("KnownClients");c.each(n.where({mac:e.get("mac")}),function(t){t.set(e.attributes)})}i.showSavedState()}else i.showErrorState()},error:function(){i.showErrorState()}}),!t&&this.model.validationError&&this.model.validationError.name&&(n.addClass("error"),this.$configForm.find(".row").after(r('<div class="row row-error"></div>').text(this.model.validationError.name))),!1},toggleFixedIP:function(){var e=this.devices.where({type:"ugw",adopted:!0}),t=this.networks.where({dhcpd_enabled:!0}),i=e.length&&t.length;i?this.$useFixedIp.removeAttr("disabled"):this.$useFixedIp.attr("disabled","disabled")},updateConfigIp:function(e){e&&e.preventDefault(),this.$configIpForm.find(".error").removeClass("error"),this.$configIpForm.find(".error-msg").remove();var t,i,a=this,n=this.$configIpForm.find("input[name=use_fixedip]").is(":checked"),o={use_fixedip:n};n&&(o.network_id=this.$configIpForm.find("select[name=network_id]").val(),o.fixed_ip=this.$configIpForm.find("input[name=fixed_ip]").val(),o.network_id&&(t=this.networks.get(o.network_id))&&(i=t.get("ip_subnet")));var s=this.user.save(o,{extra:{subnet:i},success:function(e,t){"ok"===t.meta.rc?a.showSavedState():a.showErrorState()},error:function(e,t){a.app.views.app.flash("error","Error",l.apiError(t,!0))}});return!s&&this.user.validationError&&c.each(this.user.validationError,r.proxy(function(e,t){this.$configIpForm.find("[name="+t+"]").addClass("error").parent().append('<div class="error-msg">'+e+"</div>")},this)),!1},displayConnectedAP:function(){var e=this.app.routers.devices.views.index,t=e.collection.getDeviceFromMac(this.model.get("ap_mac"));return e.property(t),!1},displayConnectedPort:function(){var e=this.app.routers.devices.views.index,t=e.collection.getDeviceFromMac(this.model.get("sw_mac")?this.model.get("sw_mac"):this.model.get("gw_mac"));return e.property(t,{port:this.model.get("sw_mac")?this.model.get("sw_port"):"lan"}),!1},historyTableGrid:function(){if(!this.rendered)return!1;if(!this.grids.history){var e=[{name:"assoc_time",label:l.G_DateTime,editable:!1,cell:d.StringCell.extend({formatter:m.Formatters.Moment,className:"time-cell"})},{name:"duration",label:l.G_Duration,editable:!1,cell:d.StringCell.extend({formatter:m.Formatters.Duration,className:"duration-cell"})},{name:"tx_bytes",label:l.G_Down,editable:!1,cell:d.StringCell.extend({formatter:m.Formatters.Bytes,className:"down-cell"})},{name:"rx_bytes",label:l.G_Up,editable:!1,cell:d.StringCell.extend({formatter:m.Formatters.Bytes,className:"up-cell"})}];this.grids.history=this.grid(e,this.collections.history,this.$(".data-table-clients-history"),this.noClientHistoryRows)}},setStatsCollection:function(){var e=this.model.isConnected()?this.model.get("dpi_stats"):[];if(!this.collections.dpiCollection){var t=s.Collection.extend({model:o});this.collections.dpiCollection=new t}this.collections.dpiCollection.reset(e)},dpiTableGrid:function(){if(!this.rendered)return!1;if(!this.grids.dpi){var e=[{name:"icon",editable:!1,sortable:!1,headerCell:m.Headers.emptyHeader,cell:m.Cells.ComplexHtmlCell.extend({formatter:{fromRaw:function(e){var t=e.iconUrl();return t?r("<div />").append(r('<div class="appLogo"></div>').css({background:'url("'+t+'")'})):""},toRaw:function(e){return e}}})},{name:"app",label:l.G_StatsApplication,editable:!1,headerCell:m.Headers.customSortHeader,cell:m.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){return e.name()},toRaw:function(e){return e}},className:"app-cell"}),sortValue:function(e){return e.name()}},{name:"packets",label:l.G_PortForwardUpPkts,editable:!1,headerCell:m.Headers.customSortHeader,cell:m.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){var t=new d.NumberFormatter({decimals:0});return t.fromRaw(e.packetsTotal())},toRaw:function(e){return e}},className:"packets-cell"}),sortValue:function(e){return e.packetsTotal()}},{name:"bytes",label:l.G_PortForwardUpBytes,editable:!1,headerCell:m.Headers.customSortHeader,cell:m.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){return m.Formatters.Bytes.fromRaw(e.bytesTotal())},toRaw:function(e){return e}},className:"bytes-cell"}),sortValue:function(e){return e.bytesTotal()}}];this.grids.dpi=this.grid(e,this.collections.dpiCollection,this.$(".data-table-clients-dpi"),this.noClientdpiRows),this.grids.dpi.paginate(1,10)}},setupUserGroups:function(){var e=this.app.collection("UserGroups");if(this.$bindUserGroups.empty(),this.$bindUserGroups.append(r('<option value=""></option>').text(l.G_PropertiesAutomatic)),e.each(function(e){e.get("site_id")===SITE.id&&this.$bindUserGroups.append(r('<option value="'+e.get("_id")+'"></option>').text(e.get("name")))},this),this.model.get("usergroup_id")){this.$bindUserGroups.val(this.model.get("usergroup_id"));try{this.$bindUserGroups.selectmenu("refresh")}catch(t){}}},setupNetworks:function(){if(this.$selectNetwork.empty(),c.each(this.networks.filterByPurpose(["corporate","guest","voip"]),r.proxy(function(e){this.$selectNetwork.append(r('<option value="'+e.get("_id")+'"></option>').text(e.get("name")))},this)),this.user.get("network_id")){this.$selectNetwork.val(this.user.get("network_id"));try{this.$selectNetwork.selectmenu("refresh")}catch(e){}}},remove:function(){this.dpiQueryInterval&&clearInterval(this.dpiQueryInterval),this.stopListening(this.user,"change",this.populateConfigIp),this.$buttonBlock.off("click",this.block),this.$buttonUnblock.off("click",this.unblock),this.$(".button-reconnect").off("click",this.reconnect),this.$(".button-unauthorize").off("click",this.unauthorize),this.$(".button-authorize").off("click",this.authorize),this.$configForm.off("submit",this.updateConfig),
this.$configIpForm.off("submit",this.updateConfigIp),this.$bindConnectedAP.off("click",this.displayConnectedAP),this.$bindConnectedPort.off("click",this.displayConnectedPort),this.$useFixedIp.off("change"),this.model.off("change:name",this.onChangeName),this.model.off("change",this.populate),this.devices.off("change",this.populateDeviceName),this.stopListening(this.networks,"add remove change",this.setupNetworks),this.devices.off("change",this.toggleFixedIP),this.stopListening(this.userGroups,"add remove change",this.setupUserGroups),this.rendered=!1;var t=this.app.routers.clients.views.index.properties;for(var i in t)i===this.model.get("mac")&&delete t[i];e.prototype.remove.apply(this,arguments)}})}),define("text!includes/clients/clientsIndexTemplate.html",[],function(){return'<div class="section section-main">\n    <h1><%- msg.G_Clients %></h1>\n\n    <form class="data-filters clearfix">\n        <span class="ubnt-icon-search"></span>\n        <input type="text" name="search" class="search left" />\n        <div class="buttonset conn-filters">\n            <input type="radio" id="clientsFilterConnAll" name="conn-filter" value="conn-all" checked="checked" /><label for="clientsFilterConnAll"><%- msg.G_All %></label>\n            <input type="radio" id="clientsFilterConnWireless" name="conn-filter" value="wireless" /><label for="clientsFilterConnWireless"><%- msg.G_Wireless %></label>\n            <input type="radio" id="clientsFilterConnWired" name="conn-filter" value="wired" /><label for="clientsFilterConnWired"><%- msg.G_Wired %></label>\n        </div>\n        \n        <div class="buttonset wireless-filters">\n            <input type="radio" id="clientsFilterWirelessAll" name="wireless-filter" value="wireless-all" checked="checked" /><label for="clientsFilterWirelessAll"><%- msg.G_All %></label>\n            <input type="radio" id="clientsFilterWireless2g" name="wireless-filter" value="ng" /><label for="clientsFilterWireless2g"><%- msg.G_2G %></label>\n            <input type="radio" id="clientsFilterWireless5g" name="wireless-filter" value="na" /><label for="clientsFilterWireless5g"><%- msg.G_5G %></label>\n        </div>\n\n        <div class="buttonset access-filters">\n            <input type="radio" id="clientsFilterAccessAll" name="access-filter" value="access-all" /><label for="clientsFilterAccessAll"><%- msg.G_All %></label>\n            <input type="radio" id="clientsFilterAccessUsers" name="access-filter" value="users" checked="checked" /><label for="clientsFilterAccessUsers"><%- msg.G_Users %></label>\n            <input type="radio" id="clientsFilterAccessGuests" name="access-filter" value="guests" /><label for="clientsFilterAccessGuests"><%- msg.G_Guests %></label>\n        </div>\n\n        <div class="network-filters">\n            <div class="ap-filter">\n                <select name="ap-filter" data-label="<%- msg.G_AP %>: "></select>\n            </div>\n            <div class="network-filter">\n                <select name="network-filter" data-label="<%- msg.G_Network %>: "></select>\n            </div>\n        </div>\n\n        <div class="right">\n            <select name="items-per-page" data-label="<%- msg.G_FilterItemsPerPage %>">\n                <option value="10">10</option>\n                <option value="50" selected="selected">50</option>\n                <option value="100">100</option>\n                <option value="200">200</option>\n            </select>\n        </div>\n    </form>\n\n    <div class="data-table untitled">\n        <div class="loading"><span><%- msg.N_Loading %></span></div>\n    </div>\n</div>'}),define("unifi/view/clients/IndexView",["unifi/view/app/ListContentView","unifi/view/clients/PropertyView","ubnt/view/dialogs/ConfirmDialogView","libs/backgrid","ubnt/backgrid","underscore","jquery","msg/Msg","unifi/collection/Clients","unifi/model/Client","unifi/collection/insights/KnownClients","unifi/collection/Networks","text!includes/clients/clientsIndexTemplate.html","libs/jquery.cookie"],function(e,t,i,a,n,o,r,s,c,l,d,m,u){"use strict";return e.extend({id:"clientsIndex",_templateId:u,_collectionType:{name:"Clients",Class:c},_pageable:!0,initialize:function(t,i){if(this.properties={},e.prototype.initialize.call(this,t),!t.skipBindings){var a=this;this.listenTo(this.options.app.collection("Devices"),"change:name",function(e){var t,i,n=e.get("type");if("usw"===n?t=a.collection.where({is_wired:!0,sw_mac:e.get("mac")}):"ugw"===n?t=a.collection.where({is_wired:!0,gw_mac:e.get("mac")}):"uap"===n&&(t=a.collection.where({is_wired:!1,ap_mac:e.get("mac")})),t&&t.length)for(i=0;i<t.length;i++)t[i].trigger("change",t[i])}),this.listenTo(this.collection,"change",o.debounce(function(){o.each(a.options.app.routers.clients.views.index.properties,function(e,t){var i=a.app.collection("Clients"),n=a.app.data.KnownClients?a.app.collection("KnownClients"):null,o=i.findWhere({mac:e.model.get("mac")});o&&(e.model.clear({silent:!0}),e.model.set(o.attributes));var r=n?n.findWhere({mac:e.model.get("mac")}):null;r&&(e.model.clear({silent:!0}),e.model.set(r.attributes)),o||r||e.model.fetch()})},250))}},render:function(){var t=this.rendered;e.prototype.render.call(this,!0),t||(this.$apFilter=this.$el.find("select[name=ap-filter]"),this.$networkFilter=this.$el.find("select[name=network-filter]"),this._rendered.resolve())},columns:function(){var e=this;return[{name:"hostname",label:s.G_ClientsNameMACAddress,customClass:"column-name",editable:!1,sortValue:"name",sortFormatter:"toLowerCase",headerCell:n.Headers.customSortHeader,cell:n.Cells.ModelCell.extend({callback:"name"}),callback:this.property,title:"mac"},{name:"ip",label:s.G_IPAddress,customClass:"column-ip",editable:!1,sortValue:"ip2long",headerCell:n.Headers.customSortHeader,cell:"string"},{name:"status",label:s.G_Status,customClass:"column-status",editable:!1,sortValue:"sortStatus",headerCell:n.Headers.customSortHeader,cell:n.Cells.ComplexHtmlCell.extend({formatter:{fromRaw:function(e){return e.authorizable()?r(e.get("authorized")?'<span class="ok">'+s.G_ClientsAuthorized+"</span>":'<span class="pending">'+s.G_ClientsPending+"</span>"):void 0},toRaw:function(e){return e}}})},{name:"network",label:s.G_ClientsConnection,customClass:"column-connection",editable:!1,sortValue:"connection",headerCell:n.Headers.customSortHeader,cell:n.Cells.ModelCell.extend({callback:"connection"})},{name:"network",label:s.G_Network,customClass:"column-network",editable:!1,cell:"string"},{name:"essid",label:s.G_ClientsWLAN,customClass:"column-wlan",editable:!1,cell:"string"},{name:"sw_port",label:s.G_Port,customClass:"column-port",editable:!1,sortValue:"wired_connection",headerCell:n.Headers.customSortHeader,cell:n.Cells.ComplexCell.extend({formatter:{fromRaw:function(t){var i,a=e.app.collection("Devices");return t.get("sw_mac")?(i=a.getDeviceFromMac(t.get("sw_mac")))?i.name()+t.switch_port_suffix(!1):t.get("sw_mac"):t.get("gw_mac")?(i=a.getDeviceFromMac(t.get("gw_mac")))?i.name():t.get("gw_mac"):void 0},toRaw:function(e){return e}}}),callback:function(t){var i=e.app.routers.devices.views.index,a=i.collection.getDeviceFromMac(t.get("sw_mac")?t.get("sw_mac"):t.get("gw_mac"));i.property(a,{port:t.get("sw_mac")?t.get("sw_port"):"lan"})},title:function(e){return e.get("sw_mac")||e.get("gw_mac")}},{name:"ap_mac",label:s.G_ClientsAP,customClass:"column-ap",editable:!1,cell:n.Cells.ComplexCell.extend({formatter:{fromRaw:function(t){var i=e.app.collection("Devices"),a=t.get("ap_mac")?i.getDeviceFromMac(t.get("ap_mac")):null;return a?a.name():t.get("ap_mac")},toRaw:function(e){return e}}}),callback:function(t){var i=e.app.routers.devices.views.index,a=i.collection.getDeviceFromMac(t.get("ap_mac"));i.property(a)},title:"ap_mac"},{name:"sw_mac",label:s.G_ClientsAPPort,customClass:"column-apport",editable:!1,sortable:!1,headerCell:n.Headers.noSortHeader,cell:n.Cells.ComplexCell.extend({formatter:{fromRaw:function(t){var i,a=e.app.collection("Devices");return t.get("is_wired")?t.get("sw_mac")?(i=a.getDeviceFromMac(t.get("sw_mac")))?i.name()+t.switch_port_suffix(!1):t.get("sw_mac"):t.get("gw_mac")?(i=a.getDeviceFromMac(t.get("gw_mac")))?i.name():t.get("gw_mac"):void 0:(i=t.get("ap_mac")?a.getDeviceFromMac(t.get("ap_mac")):null,i?i.name():t.get("ap_mac"))},toRaw:function(e){return e}}}),callback:function(t){var i,a=e.app.routers.devices.views.index;t.get("is_wired")?(i=a.collection.getDeviceFromMac(t.get("sw_mac")?t.get("sw_mac"):t.get("gw_mac")),a.property(i,{port:t.get("sw_mac")?t.get("sw_port"):"lan"})):(i=a.collection.getDeviceFromMac(t.get("ap_mac")),a.property(i))},title:"ap_mac"},{name:"rssi",label:s.G_Signal,customClass:"column-signal",editable:!1,cell:n.Cells.ComplexHtmlCell.extend({className:"rssiWithRadio",formatter:{fromRaw:function(e){var t=e.rssi(),i="sprite-";return i+=e.radioType(),i+="-"+(e.is5g()?"5g":"2g"),i+=e.get("powersave_enabled")?"-powersave":"",'<span class="signal-value">'+t+'</span><span class="signal-icon '+i+'"></span>'},toRaw:function(e){return e}}})},{name:"tx_bytes",label:s.G_Down,customClass:"column-down",editable:!1,cell:a.StringCell.extend({formatter:n.Formatters.Bytes})},{name:"rx_bytes",label:s.G_Up,customClass:"column-up",editable:!1,cell:a.StringCell.extend({formatter:n.Formatters.Bytes})},{name:"bytes-r",label:s.G_Activity,customClass:"column-activity",editable:!1,sortValue:"activitySort",headerCell:n.Headers.customSortHeader,cell:n.Cells.HtmlCell.extend({formatter:o.extend({},n.Formatters.Grid,{className:"green-cells",levels:[2048e3,512e3,64e3,8e3,500]})})},{name:"uptime",label:s.G_Uptime,customClass:"column-uptime",editable:!1,cell:a.StringCell.extend({formatter:n.Formatters.Seconds})},{name:"_id",label:s.G_Actions,customClass:"column-actions is-admin",editable:!1,sortable:!1,headerCell:n.Headers.noSortHeader,cell:n.Cells.ActionsCell.extend({actions:{block:{icon:"ubnt-icon-close",callback:this.rowBlock,requiresAdminPrivilege:!0,render:function(e){return!e.get("blocked")}},unblock:{icon:"ubnt-icon-undo",callback:this.rowUnblock,requiresAdminPrivilege:!0,render:function(e){return e.get("blocked")}},reconnect:{icon:"ubnt-icon-reconnect",callback:this.rowReconnect,requiresAdminPrivilege:!0,buttonClasses:"narrow",render:function(e){return!e.get("is_wired")}},authorize:{icon:"ubnt-icon-plus",callback:this.rowAuthorize,requiresAdminPrivilege:!0,buttonClasses:"narrow",render:function(e){return e.authorizable()&&!e.get("authorized")}},unauthorize:{icon:"ubnt-icon-undo",callback:this.rowUnauthorize,requiresAdminPrivilege:!0,buttonClasses:"narrow",render:function(e){return e.authorizable()&&e.get("authorized")}}}})}]},load:function(t,i){return i=i||{},i.reset=!0,e.prototype.load.call(this,t,i)},grid:function(){this._gridRowClassName=this.gridRowClassName,e.prototype.grid.call(this);var t=this.grids.content,i=this.$el.find(".network-filters .ap-filter"),a=this.$el.find(".network-filters .network-filter"),n=this.$el.find(".buttonset.conn-filters"),s=n.find("input[name=conn-filter]"),c=this.$el.find(".buttonset.wireless-filters"),l=c.find("input[name=wireless-filter]"),d=this.$el.find(".buttonset.access-filters"),u=d.find("input[name=access-filter]"),h=[],g=[],p=[],y=this;return this.devices=this.app.collection("Devices"),this.listenTo(this.devices,"add remove change",o.debounce(this.setupApFilter,250)),this.setupApFilter(),this.networks=this.app.collection("Networks",{fetch:{reload:!1}},m),this.clients=this.app.collection("Clients"),this.listenTo(this.networks,"add remove change",this.setupNetworkFilter),this.listenTo(this.clients,"add remove change",this.setupNetworkFilter),this.setupNetworkFilter(),this.$el.find('.buttonset input[name=conn-filter][value="'+(r.cookie("filterClientConn")||"conn-all")+'"]').click(),this.$el.find('.buttonset input[name=wireless-filter][value="'+(r.cookie("filterClientWireless")||"wireless-all")+'"]').click(),this.$el.find('.buttonset input[name=access-filter][value="'+(r.cookie("filterClientAccess")||"access-all")+'"]').click(),o.each(s,function(e,t){h.push(e.value)}),o.each(l,function(e,t){g.push(e.value)}),o.each(u,function(e,t){p.push(e.value)}),s.on("change",function(e){var n=r(this).val();"wired"==n?(t.setFilter("is_wired",!0,1),i.hide(),a.show()):"wireless"==n?(t.setFilter("is_wired",!0,-1),i.show(),a.hide()):(t.removeFilter("is_wired"),i.hide(),a.hide()),"wireless"==n?c.show():c.hide(),t.$el.removeClass(h.join(" ")).addClass(n||h[0]),l.filter(":checked").trigger("change"),i.trigger("change"),a.trigger("change"),r.cookie("filterClientConn",n)}).filter(":checked").trigger("change"),l.on("change",function(){var e=r(this),i=e.val(),a=e.is(":visible");!a||"na"!=i&&"ng"!=i?t.removeFilter("radio"):t.setFilter("radio",i,1),t.$el.removeClass(g.join(" ")).addClass(a?i||g[0]:""),y.setupApFilter(),r.cookie("filterClientWireless",i)}).filter(":checked").trigger("change"),u.on("change",function(){var e=r(this).val();"users"==e?t.setFilter("is_guest",!1,1):"guests"==e?t.setFilter("is_guest",!0,1):t.removeFilter("is_guest");var i=y.$el.find("input:radio[name=conn-filter]:checked").val();"wireless"===i?y.setupApFilter():"wired"===i&&y.setupNetworkFilter(),t.$el.removeClass(p.join(" ")).addClass(e||p[0]),r.cookie("filterClientAccess",e)}).filter(":checked").trigger("change"),i.on("change",function(){var e=r(this),i=e.find("option:selected").val(),a=e.is(":visible");a&&i?t.setFilter("ap_mac",i,1):t.removeFilter("ap_mac")}),a.on("change",function(){var e=r(this),i=e.find("option:selected").val(),a=e.is(":visible");a&&i?t.setFilter("network_id",i,1):t.removeFilter("network_id")}),this},gridRowClassName:function(e){return"id-"+e.id},property:function(e,i){if(!e)throw"Missing model";var a=e.get("mac")||e.id,n=this,o=this.options.app.routers.clients.views.index.properties;if(!o[a]){var r=new l;r.url="/api/s/"+SITE.name+"/stat/user/"+a,o[a]=!0,r.fetch({success:function(){o[a]=new t({properties:n.app.views.app.views.properties,parent:n,model:r,property_id:a.split(":").join(""),show:!0,options:i})},error:function(e,t,i){delete o[a],n.app.views.app.flash("error","Error",s.apiError(e,!0))}})}},updateBlocked:function(e,t){var i=this.app.collection("Clients",{},c),a=e.get("mac"),n=this.options.app.routers.clients.views.index.properties[a],r=n?n.model:null;if(r&&r.set({blocked:t})&&r.set({uptime:null}),o.each(i.where({mac:a}),function(e){e.set({blocked:t}),e.set({uptime:null})}),this.app.data.KnownClients){var s=this.app.collection("KnownClients");o.each(s.where({mac:a}),function(e){e.set({blocked:t,silent:!1}),e.set({uptime:null,silent:!1})})}},rowUnblock:function(e){var t=this;e.unblock({success:function(i,a,n){t.updateBlocked(e,!1)},error:function(e,i,a){t.app.views.app.flash("error","Error",s.apiError(e,!0))}})},rowBlock:function(e){var t=this,a=t.app.collection("Devices").getInformIP(),n=function(){e.block({success:function(i,a,n){t.updateBlocked(e,!0)},error:function(e,i,a){t.app.views.app.flash("error","Error",s.apiError(e,!0))}})};e.get("ip")===a?(new i).show(s.localize(s.N_ConfirmBlockController,e.get("mac")),n):n()},rowReconnect:function(e,t){var i=this;e.reconnect({success:function(a,n,r){var s=i.app.collection("Clients",{},c),l=e.get("mac"),d=i.options.app.routers.clients.views.index.properties[l],m=d?d.model:null;m&&m.set({uptime:null}),d&&d.remove(),o.each(s.where({mac:l}),function(e){e.set({uptime:null})}),i.app.refresh(),t&&t.success&&t.success()},error:function(e,t,a){i.app.views.app.flash("error","Error",s.apiError(e))}})},updateAuthorized:function(e,t){var i=this.app.collection("Clients",{},c);o.each(i.where({mac:e}),function(e){e.set({authorized:t})})},rowAuthorize:function(e,t){var i=this;e.authorize({success:function(t,a,n){i.updateAuthorized(e.get("mac"),!0)},error:function(e,t,a){i.app.views.app.flash("error","Error",s.apiError(e))}})},rowUnauthorize:function(e,t){var i=this;e.unauthorize({success:function(e,t,a){i.app.refresh()},error:function(e,t,a){i.app.views.app.flash("error","Error",s.apiError(e))}})},setupApFilter:function(){var e,t=this.$apFilter.find("option:selected").val(),i=this.$el.find("input:radio[name=wireless-filter]:checked").val(),a=this.$el.find("input:radio[name=access-filter]:checked").val();"wireless-all"===i&&"access-all"===a?e="num_sta":"wireless-all"===i&&"users"===a?e="user-num_sta":"wireless-all"===i&&"guests"===a?e="guest-num_sta":"na"===i&&"access-all"===a?e="na-num_sta":"na"===i&&"users"===a?e="na-user-num_sta":"na"===i&&"guests"===a?e="na-guest-num_sta":"ng"===i&&"access-all"===a?e="ng-num_sta":"ng"===i&&"users"===a?e="ng-user-num_sta":"ng"===i&&"guests"===a&&(e="ng-guest-num_sta"),this.$apFilter.empty(),this.$apFilter.append(r('<option value=""></option>').text(s.G_All));var n=0;this.devices&&o.each(this.devices.where({type:this.devices.typeMap.ap}),r.proxy(function(t){t.isConnected()&&(this.$apFilter.append(r("<option />").attr("value",t.get("mac")).text(t.name()+" ("+t.get(e)+")")),n+=t.get(e))},this)),this.$apFilter.find("option:first").text(s.G_All+" ("+n+")"),this.$apFilter.val(t),this.$apFilter.selectmenu("refresh")},setupNetworkFilter:function(){var e=this.$networkFilter.find("option:selected").val(),t=this.$el.find("input:radio[name=access-filter]:checked").val(),i={};"users"===t?i.is_guest=!1:"guests"===t&&(i.is_guest=!0);var a={},n=this.app.collection("Clients",{},c);n&&o.each(n.where(o.extend({is_wired:!0},i)),function(e){e&&(a.hasOwnProperty(e.get("network"))?a[e.get("network")]=a[e.get("network")]+1:a[e.get("network")]=1)}),this.$networkFilter.empty(),this.$networkFilter.append(r('<option value=""></option>').text(s.G_All));var l=0;this.networks&&o.each(this.networks.filterByPurpose(["corporate","guest","voip","vlan-only"]),r.proxy(function(e){var t=e.get("name"),i=0;a.hasOwnProperty(t)&&(i=a[t]),l+=i,this.$networkFilter.append(r("<option />").attr("value",e.id).text(t+" ("+i+")"))},this)),this.$networkFilter.find("option:first").text(s.G_All+" ("+l+")"),this.$networkFilter.val(e),this.$networkFilter.selectmenu("refresh")},searchable:function(){var t=this.app.collection("Devices"),i=r.proxy(function(e){var i;e.get("is_wired")?e.get("sw_mac")?(i=t.getDeviceFromMac(e.get("sw_mac")),i&&e.addSearchString("device-name",i.name()+e.switch_port_suffix(!1))):e.get("gw_mac")&&(i=t.getDeviceFromMac(e.get("gw_mac")),i&&e.addSearchString("device-name",i.name())):(i=e.get("ap_mac")?t.getDeviceFromMac(e.get("ap_mac")):null,i&&e.addSearchString("device-name",i.name()))},this),a=r.proxy(function(){this.collection.each(i),this.trigger("search:indexed")},this);this.listenTo(this.collection,"change",i),this.listenTo(this.collection,"add",i),this.listenTo(this.collection,"reset",a),a(),e.prototype.searchable.call(this)},remove:function(){this.rendered=!1,this.stopListening(this.devices),this.stopListening(this.networks),this.$el.find(".buttonset.conn-filters input[name=conn-filter]").off("change"),e.prototype.remove.apply(this,arguments)}})}),define("unifi/router/ClientsRouter",["unifi/router/Router","unifi/view/clients/IndexView","unifi/view/clients/PropertyView"],function(e,t,i){"use strict";return e.extend({_fullyQualifiedName:"UNIFI.Routers.Clients",_associatedViews:{Index:t,Property:i},routes:{clients:"index","clients?d=:d":"index"}})}),define("unifi/model/StatisticsColors",["backbone","underscore"],function(e,t){"use strict";return e.Model.extend({initialize:function(){this.colors=["#23B1E6","#EE6B79","#52CC74","#EE472B","#F7931E","#52C1C4","#D2C485","#50B748","#F071A6","#3186C1","#C3DFB0","#F15A24","#159653","#F6C2D9","#E60688","#045AA6","#B8B34B","#8C2473","#B66BA5","#BFD637"],this.index=0,this.numColors=this.colors.length},first:function(){return t.first(this.colors)},getAllButFirst:function(){return t.rest(this.colors)},getNext:function(){return this.index++,this.getCurrent()},getIndex:function(){return this.index%this.numColors},getCurrent:function(){return this.colors[this.getIndex()]},getAtIndex:function(e){return this.colors[e%this.numColors]}})}),define("unifi/collection/stats/Stats",["unifi/collection/Collection","backbone","unifi/model/Model","libs/moment","underscore"],function(e,t,i,a,n){"use strict";return e.extend({model:i,bySite:!0,_o:null,_type:null,toGraph:function(e){var t,i,a=this,o=n.compact(a.chain().filter(function(t){return e&&e.filter?t.get(a._o)==e.filter:!0}).map(function(e){if(e.get("o")==a._o){var t=e.toJSON();return t.datetime=new Date(e.get("time")),t}}).value());if(e&&e.units){var r=["B","KB","MB","GB","TB"];t=e.units,i=Math.pow(1e3,r.indexOf(t))}else{var s=n.max(o,function(e){return e.bytes}).bytes;t=s>(i=Math.pow(1e3,4))?"TB":s>(i=Math.pow(1e3,3))?"GB":s>(i=Math.pow(1e3,2))?"MB":s>(i=1e3)?"KB":"B"}if(e.fill===!0&&e.interval){for(var c=n.pluck(o,"time"),l=n.min(c),d=n.max(c),m=l;d>m;m+=1e3*e.interval)-1===c.indexOf(m)&&o.push({bytes:null,num_sta:null,datetime:new Date(m)});o=n.sortBy(o,function(e){return e.datetime})}return o.map(function(e){return delete e.time,delete e.o,delete e.site,e.bytesFmt=e.bytes?+(e.bytes/i).toPrecision(2):null,e.bytesLbl=t,e})},validatePointsHasProp:function(e,t){for(var i=0,a=e.length;a>i;i++)if(n.has(e[i],t)&&!n.isNull(e[i][t]))return!0;return!1},orderByBytes:function(){var e=this,t=this.sortBy(function(e){return e.get("bytes")});return t=t.reverse(),t=n.uniq(t,!1,function(t){return t.attributes[e._o]})},comparator:function(e){return-a(e.get("time"))},hourly:function(e){return this.fetch(n.extend(e,{_method:"read-hourly"}))},daily:function(e){return this.fetch(n.extend(e,{_method:"read-daily"}))},clearStats:function(e){this.sync("clear",this,e)},sync:function(e,i,a){switch(a=a||{},a._method&&(e=a._method,delete a._method),e){case"read-hourly":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/stat/report/hourly."+this._type,a.type="POST",a.data=JSON.stringify(n.extend({attrs:["bytes","num_sta","time"]},a.data||{}));break;case"read-daily":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/stat/report/daily."+this._type,a.type="POST",a.data=JSON.stringify(n.extend({attrs:["bytes","num_sta","time"]},a.data||{}));break;case"clear":a.contentType="application/json; charset=utf-8",a.url="/api/s/"+SITE.name+"/cmd/stat",a.type="POST",a.data=JSON.stringify(n.extend({cmd:"reset-current"},a.data||{}))}return t.sync.call(this,e,i,a)}})}),define("unifi/collection/stats/SiteStats",["unifi/collection/stats/Stats"],function(e){"use strict";return e.extend({_o:"site",_type:"site"})}),define("unifi/collection/stats/ClientStats",["unifi/collection/stats/Stats"],function(e){"use strict";return e.extend({_o:"user",_type:"user"})}),define("unifi/collection/stats/DeviceStats",["unifi/collection/stats/Stats"],function(e){"use strict";return e.extend({_o:"ap",_type:"ap"})}),define("unifi/view/statistics/LineChartView",["backbone","underscore","msg/Msg","jquery","libs/d3","ubnt/backgrid"],function(e,t,i,a,n,o){"use strict";return e.View.extend({initialize:function(e){this.config=e.config,this.data=e.data,this.plottable=!1,this.components={},this.mouse=[0,0],this.xpos,this.render()},render:function(){var e=this.config,t=this.data,i=this.components;!this.rendered&&(this.rendered=!0)&&(this.renderChart(),e.overlays.databox&&this.renderDatabox(),e.overlays.ticktip&&this.renderTicktip(),this.hideOverlays(!0),i.overlays.style("visibility","visible")),t.points.length&&this.update(!0)},renderChart:function(){var e=this.config,t=this.data,a=this.components;a.xScale=n.time.scale().domain([0,24]).range([0,e.width()]),a.yScale=n.scale.linear().domain([e.height,0]).range([0,e.height]),a.xAxis=n.svg.axis().scale(a.xScale).orient("bottom").ticks(24).tickSize.apply(null,e.ticksize).tickFormat(""),a.yAxis=n.svg.axis().scale(a.yScale).orient("right").ticks(6).tickSize(-e.width(),0,0).tickPadding(5),e.yFormat&&a.yAxis.tickFormat(n.format(e.yFormat)),a.container=n.select(this.$el[0]).append("svg").attr("width",e.width()+e.margin.left+e.margin.right).attr("height",e.height+e.margin.top+e.margin.bottom),a.title=a.container.append("text").attr("x",e.margin.left).attr("y",e.margin.top/2).attr("class","title").text(e.title),a.chart=a.container.append("g").attr("class","chart").attr("transform","translate("+e.margin.left+","+e.margin.top+")"),a.border=a.chart.append("rect").attr("height",e.height).attr("width",e.width()).attr("class","border");var o=a.chart.append("svg:defs");o.append("svg:pattern").attr("id","hatched").attr("patternUnits","userSpaceOnUse").attr("x","0").attr("y","0").attr("width","4").attr("height","4").attr("patternTransform","rotate(-45)").append("svg:path").attr("d","M 0 1 L 4 1").style("fill","none").style("stroke-width",1).style("stroke","#ccc").style("stroke-opacity",".5"),o.append("clipPath").attr("id","clip").append("rect").attr("width",e.width()).attr("height",e.height),a.chart.append("g").attr("class","x axis").attr("transform","translate(0,"+e.height+")"),a.chart.append("g").attr("class","y axis").attr("transform","translate("+e.width()+",0)"),a.chart.append("g").attr("clip-path","url(#clip)").attr("class","x grid").attr("width",e.width()).attr("height",e.height),a.datasets=a.chart.append("g").attr("class","datasets"),a.overlays=a.chart.append("g").attr("class","overlays").style("visibility","hidden"),a.line=n.svg.line().defined(function(e){return null!==e[t.yprop]}).x(function(e){return a.xScale(e[t.xprop])}).y(function(e){return a.yScale(e[t.yprop]||0)}),a.moreDataNeeded=a.container.append("text").attr("class","more-data-needed").text(i.G_StatsMoreDataPoints);var r=a.moreDataNeeded[0][0].getBBox();a.moreDataNeededBBox=r,a.moreDataNeeded.attr("x",(e.width()-r.width)/2).attr("y",(e.height+r.height)/2),a.moreDataNeeded.style("visibility","hidden")},renderDatabox:function(){var e=this.config,t=this.components;t.databox=t.overlays.append("g").attr("width",e.overlays.databox.width).attr("height",e.height+e.overlays.databox.heightDiff).attr("class","databox");var i=t.databox.append("svg:defs").append("svg:filter").attr("id","blur");i.append("svg:feGaussianBlur").attr("in","SourceAlpha").attr("stdDeviation",2),i.append("svg:feOffset").attr("dx",0).attr("dy",0).attr("result","offsetblur"),i.append("svg:feComponentTransfer").append("svg:feFuncA").attr("type","linear").attr("slope",".13");var a=i.append("svg:feMerge");a.append("svg:feMergeNode"),a.append("svg:feMergeNode").attr("in","SourceGraphic"),t.databox.append("rect").attr("y",-e.overlays.databox.heightDiff/2).attr("width",e.overlays.databox.width).attr("height",e.height+e.overlays.databox.heightDiff).attr("filter","url(#blur)"),t.databox.append("g").attr("class","labels").attr("transform","translate(0,20)")},updateYAxisLabel:function(e){var t=this.config,i=this.components;i.chart.selectAll(".y-axis-label").remove(),i.chart.append("text").attr("x",t.width()+t.margin.right/2).attr("y",t.height/2).attr("dx","1em").style("text-anchor","middle").attr("class","y-axis-label").text(e)},renderTicktip:function(){var e=this.config,t=this.components;t.ticktip=t.overlays.append("g").attr("class","ticktip"),t.ticktip.append("rect").attr("width",e.overlays.ticktip.width.min).attr("height",e.overlays.ticktip.height).attr("rx","3"),t.ticktip.append("text"),t.ticktip.style("visibility","hidden")},update:function(e){var i=(this.config,this.data),a=this.components,o=n.merge(i.points);o=t.filter(o,function(e){return null!==e[i.yprop]}),a.xScale.domain(i.xDomain||n.extent(o,function(e){return e[i.xprop]})),a.yScale.domain([n.max(o,function(e){return e[i.yprop]||0}),t.isUndefined(i.yMinDomain)?n.min(o,function(e){return e[i.yprop]||0}):i.yMinDomain]),t.isUndefined(i.yAxisLabel)||this.updateYAxisLabel(i.yAxisLabel),e===!0&&a.datasets.selectAll(".dataset").remove(),this.updateChart(),this.updateSections(),this.updateOverlays(!0)},updateChart:function(){var e=this.config,t=this.data,i=this.components;return this.plottable=t.points.length&&t.points[0]&&(t.points[0].length||t.points[1]&&t.points[1].length),i.container.attr("width",e.width()+e.margin.left+e.margin.right),i.border.attr("width",e.width()),i.xScale.range([0,e.width()]),i.chart.select("#clip rect").attr("width",e.width()),i.chart.select(".y.axis").attr("transform","translate("+e.width()+",0)"),i.chart.select(".x.grid").attr("width",e.width()),i.container.select(".more-data-needed").attr("x",(e.width()-i.moreDataNeededBBox.width)/2),this.plottable?(i.moreDataNeeded.style("visibility","hidden"),i.chart.select(".x.axis").call(i.xAxis),i.chart.select(".y.axis").call(i.yAxis),i.data=i.datasets.selectAll(".dataset").data(t.points),i.data.enter().append("g").attr("class",function(e,t){return"dataset dataset-"+t}),i.data.exit().remove(),i.paths=i.data.selectAll("path").data(function(e){return[e]}).attr("d",i.line),i.paths.enter().append("path").attr("d",i.line).attr("class","line").attr("clip-path","url(#clip)").style("stroke",function(t,i,a){return e.colors[a]}),i.paths.exit().remove(),i.circles=i.data.selectAll("circle").data(function(e){return e.filter(function(e){return null!==e[t.yprop]})},function(e){return e[t.idprop]}).attr("cx",i.line.x()).attr("cy",i.line.y()||0),i.circles.enter().append("circle").attr("cx",i.line.x()).attr("cy",i.line.y()||0).attr("r",e.points.off).attr("class","point").attr("fill",function(t,i,a){return e.colors[a]}),void i.circles.exit().remove()):(i.moreDataNeeded.style("visibility","visible"),void this.hideOverlays(!0))},updateSections:function(){var e=this.config,t=this.components,i=t.chart.selectAll(".x.grid"),a=t.chart.selectAll(".x.axis .tick"),o=4,r=Math.round(a[0].length/o),s=e.width()/(a[0].length-1)*o,c=[];i.selectAll("rect").remove(),c=a[0].map(function(e){return parseFloat(n.select(e).attr("transform").match(/translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/)[1])}).sort(function(e,t){return e-t}),s=c[o]-c[0]||s;for(var l=0;r>l;l++)l%2&&i.insert("svg:rect").attr("transform","translate("+c[l*o]+",0)").attr("height",e.height).attr("width",s).style("fill","url(#hatched)")},updateOverlays:function(e){var i,a=this.config,r=this.data,s=this.components;i=Math.max(Math.min(this.mouse[0]-10,a.width()),0);var c=[],l=[];if(s.data&&t.each(s.data.selectAll("circle"),function(e,o){var r,s;t.each(e,function(e){e=n.select(e);var o=e.attr("cx")-i;o>=0&&(t.isUndefined(r)||r>o)&&(s=e,r=o),e.attr("r",a.points.off)},this),s&&(s.attr("r",a.points.on),c[o]=s,l[o]=r)},this),t.each(l,function(e,i){e>t.min(l)&&delete c[i]}),c.length&&(i=t.first(t.compact(c)).attr("cx"),e||i!=this.xpos)){if(a.overlays.databox){s.databox.selectAll("circle").remove(),t.each(c,function(e,t){e.attr("cx")>a.overlays.databox.width&&s.databox.append("circle").attr("cx",a.overlays.databox.width).attr("cy",e.attr("cy")).attr("r",a.points.on).attr("class","point").attr("fill",a.colors[t])});var d=s.databox.select(".labels");d.selectAll("g").remove(),t.each(r.labels,function(e,t){if(c[t]){var i=d.append("g").attr("transform","translate(0,"+30*t+")").style("fill",a.colors[t]),n=c[t].datum();if(r.formatBytes===!0){var s=o.Formatters.Bytes.fromRaw(n.bytes||0)+"B";i.append("text").attr("x",a.overlays.databox.valueWidth).attr("width",a.overlays.databox.valueWidth).attr("class","value").text(s),i.append("text").attr("x",a.overlays.databox.valueWidth+5).text(" "+e)}else i.append("text").attr("x",a.overlays.databox.valueWidth).attr("width",a.overlays.databox.valueWidth).attr("class","value").text(n[r.yprop]||0),i.append("text").attr("x",a.overlays.databox.valueWidth+5).text((r.labelprop?n[r.labelprop]+" ":"")+e)}}),s.databox.attr("transform","translate("+Math.max(0,i-a.overlays.databox.width)+",0)")}if(a.overlays.ticktip){var m=t.first(t.values(c)).datum()[r.xprop],u=s.ticktip.select("text");u.text(a.overlays.ticktip.format?a.overlays.ticktip.format(m,this.config.range):m);var h=Math.max(a.overlays.ticktip.width.min,Math.min(u.node().getComputedTextLength()+2*a.overlays.ticktip.width.padding,a.overlays.ticktip.width.max));u.attr("transform","translate("+(h-a.overlays.ticktip.width.padding)+",17)"),s.ticktip.attr("transform","translate("+Math.max(a.overlays.databox.width-h,i-h)+","+(a.height+a.overlays.ticktip.bottom)+")").select("rect").attr("width",h),s.ticktip.style("visibility","visible")}}this.xpos=i},hideOverlays:function(e){
var t=this,i=this.config,a=this.components;a.data&&a.data.selectAll("circle").transition().duration(e?0:600).attr("r",i.points.off),a.overlays&&a.overlays.transition().duration(e?0:600).style("opacity",0).each("end",function(){t._overlaysVisible=!1})},showOverlays:function(){if(this.plottable){var e=this.components;this._overlaysVisible=!0,e.overlays.transition().duration(0).style("opacity",null)}},remove:function(){this.rendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("unifi/view/statistics/PieChartView",["backbone","underscore","msg/Msg","jquery","libs/d3","ubnt/backgrid"],function(e,t,i,a,n,o){"use strict";return e.View.extend({initialize:function(e){this.config=e.config,this.data=e.data,this.components={},this.render()},render:function(){var e=this,t=(this.config,this.data);this.components;!this.rendered&&(this.rendered=!0)&&(this.renderChart(),this.$el.on("mouseover",".arc",function(t){var i=a(this),n=i.data("arc");e.$(".tooltip-"+n).css({visibility:"visible"}),e.$(".piechart-item-"+n).addClass("over"),e.tooltipIndex=n}).on("mouseout",".arc",function(t){var i=(a(this),a(this).data("arc"));e.$(".tooltip-"+i).css({visibility:"hidden"}),e.$(".piechart-item-"+i).removeClass("over")})),t.points.length&&this.update()},renderChart:function(){var e=this.config,t=this.data,i=this.components;i.pie=n.layout.pie().sort(null).value(function(e){return e.get(t.prop)||0}),i.arc=n.svg.arc().innerRadius(0).outerRadius(this.config.radius-10),i.svg=n.select(this.$(e.pieChart)[0]).append("svg").attr("width",e.width).attr("height",e.height).append("g").attr("transform","translate("+e.width/2+","+e.height/2+")"),e.legend&&this.renderLegend()},renderLegend:function(){var e,i=this.config,a=this.data;i.legend&&(this.$legend=this.$legend||this.$(".piechart-legend"),this.$legend.empty(),t.each(a.points,function(t,a){e="function"==typeof t.name?t.name():t.get("name"),this.$legend.append('<div class="piechart-legend-item piechart-item-'+a+'"><div class="piechart-legend-color" style="background-color:'+i.colors[a]+'"></div>'+e+"</div>")},this))},update:function(){var e=this.config,t=this.data,i=this.components;t.points&&(i.g=i.svg.selectAll(".arc").data(i.pie(t.points)),i.g.enter().append("g").attr("class","arc").attr("data-arc",function(e,t,i){return t}),i.g.selectAll("text").remove(),i.g.append("text").attr("class",function(e,t,i){return"tooltip tooltip-"+t}).attr("data-arc",function(e,t,i){return t}).attr("transform",function(t){var a=i.arc.centroid(t),n=a[0],o=a[1],r=Math.sqrt(n*n+o*o);return"translate("+n/r*(e.radius-3)+","+o/r*(e.radius-3)+")"}).attr("dy",".35em").style("text-anchor",function(e){return(e.endAngle+e.startAngle)/2>Math.PI?"end":"start"}).style("visibility","hidden").text(function(e){var i=e.data.get(t.prop)||0;return t.formatBytes&&(i=o.Formatters.Bytes.fromRaw(i)),i}),i.g.selectAll("path").remove(),i.g.append("path").attr("d",i.arc).attr("fill",function(t,i,a){return e.colors[i]}),i.g.exit().remove(),this.renderLegend())},remove:function(){this.$el.off("mouseover",".arc").off("mouseout",".arc"),this.rendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("unifi/view/statistics/DatetimeNavView",["backbone","underscore","msg/Msg","libs/moment","jquery","jquery-ui"],function(e,t,i,a,n){"use strict";return e.View.extend({initialize:function(e){t.bindAll(this),this.RANGE_1HOUR=n(".dateRange1HourBtn").val(),this.RANGE_24HOUR=n(".dateRange24HourBtn").val(),this.RANGE_MONTH=n(".dateRangeMonthBtn").val(),this.RANGE_7DAY=n(".dateRange7DayBtn").val(),this.useCurrentTimeForRange=!1,e.useCurrentTimeForRange&&(this.useCurrentTimeForRange=e.useCurrentTimeForRange),this.originalSettings={},this.momentDate=a(),this.momentDateMax=a(),this.momentDate.startOf("hour"),this.momentDateMax.startOf("hour"),this.momentHourFormat="ha",this.momentDatetimeFormat="YYYY/M/D",this.render()},render:function(){!this.rendered&&(this.rendered=!0)&&(this.$el.addClass("datetimeNav"),this.$buttonset=this.$(".buttonset"),this.$buttonset.buttonset(),this.$datepicker=this.$(".datepicker").datepicker({showOtherMonths:!0,selectOtherMonths:!0,dayNamesMin:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dateFormat:"yy/m/d",onSelect:this.onDatepickerSelect,onChangeMonthYear:this.onDatepickerChangeMonthYear}),this.$rangeButtonset=this.$(".range-buttonset"),this.$rangeButtonset.find("input").on("change",this.onRangeChange),this.$rangeButtonset.find("input:checked").change(),this.$(".date-nav .ui-button").mousedown(function(){n(this).addClass("ui-state-active")}).on("mouseup mouseout",function(){var e=n(this);t.delay(function(){e.removeClass("ui-state-active")},20)}),this.$dateToggle=this.$(".date-nav").find(".dateToggle"),this.$datePopover=this.$(".date-popover"),this.$(".dateToggleBtn").on("click",this.openPopover),this.$microRangePrev=this.$(".date-micro-range .prev"),this.$microRangePrev.on("click",this.onMicroRangePrevClick).disableSelection(),this.$microRangeNext=this.$(".date-micro-range .next"),this.$microRangeNext.on("click",this.onMicroRangeNextClick).disableSelection(),this.$hour=this.$(".hour"),this.$datetime=this.$(".datetime"),this.$datetimeMax=this.$(".datetimeMax"),this.$update=this.$("button.update"),this.$update.on("click",this.onUpdate),this.$cancel=this.$("button.cancel"),this.$cancel.on("click",this.onCancel),this.$title=this.$(".title"),this.$dateRange1Hour=this.$(".date-range-1hour"),this.$dateRangeHour=this.$(".date-range-hour"),this.$dateRangeMonth=this.$(".date-range-month"),this.$dateRange7Day=this.$(".date-range-7day"),this.$title.find(".ui-button-text").text(i.G_StatsDisplayRange),this.$dateRange1Hour.find(".ui-button-text").text(i.G_Stats1Hour),this.$dateRangeHour.find(".ui-button-text").text(i.G_Stats24Hour),this.$dateRangeMonth.find(".ui-button-text").text(i.G_Month),this.$dateRange7Day.find(".ui-button-text").text(i.G_Insights7Days),this.$update.find("span").after(i.G_Update),this.$cancel.find("span").after(i.G_Cancel),this.options.is7Day&&(this.$buttonset.addClass("is7Day"),this.$dateRange1Hour.css("display","inline-block"),this.$dateRange1Hour.find(".ui-button-text").show(),this.$dateRange7Day.show(),this.$dateRange7Day.find(".ui-button-text").show(),this.$dateRangeMonth.hide(),this.$dateRangeMonth.find(".ui-button-text").show()),this.updateHour(),this.updateDatetime())},onMicroRangePrevClick:function(e){this.range===this.RANGE_1HOUR?(this.momentDate.subtract("hours",1),this.updateHour()):this.range===this.RANGE_24HOUR?this.momentDateMax.subtract("days",1):(this.range===this.RANGE_MONTH||this.range==this.RANGE_7DAY)&&this.momentDateMax.subtract("days",1),this.updateDatetime(),n(e.currentTarget).hasClass("ui-button")&&this.onUpdate(e)},onMicroRangeNextClick:function(e){this.range===this.RANGE_1HOUR?(this.momentDate.add("hours",1),this.updateHour()):this.range===this.RANGE_24HOUR?this.momentDateMax.add("days",1):(this.range===this.RANGE_MONTH||this.range===this.RANGE_7DAY)&&this.momentDateMax.add("days",1),this.updateDatetime(),n(e.currentTarget).hasClass("ui-button")&&this.onUpdate(e)},onDatepickerSelect:function(e){this.momentDate=a(e).hour(this.momentDate.hour()),this.momentDateMax=this.momentDate.clone(),this.updateDatetime()},onDatepickerChangeMonthYear:function(e,i){var a=this;(this.range===this.RANGE_MONTH||this.range===this.RANGE_7DAY)&&t.delay(function(){a.setDaysInActiveRange()},100)},onRangeChange:function(e){var t=n(e.target),i=t.attr("id"),a=t.val();return this.$buttonset.find(".ui-button").removeClass("ui-state-active"),this.$buttonset.find("input").prop("checked",""),a&&(a===this.RANGE_24HOUR?(this.range=this.RANGE_24HOUR,this.$el.removeClass("isMonth is1Hr").addClass("is24Hr"),this.removeDaysInActiveRange(),this.momentDate=this.momentDateMax.clone()):a===this.RANGE_1HOUR?(this.range=this.RANGE_1HOUR,this.$el.removeClass("isMonth is24Hr").addClass("is1Hr"),this.removeDaysInActiveRange(),this.momentDate=this.momentDateMax.clone()):a===this.RANGE_MONTH?(this.range=this.RANGE_MONTH,this.$el.removeClass("is24Hr is1Hr").addClass("isMonth")):a===this.RANGE_7DAY&&(this.range=this.RANGE_7DAY,this.$el.removeClass("is24Hr is1Hr").addClass("isMonth"))),this.updateDatetime(),this.$buttonset.find('label[for="'+i+'"]').addClass("ui-state-active"),!1},updateHour:function(){this.$hour.text(this.momentDate.format(this.momentHourFormat).toUpperCase())},updateDatetime:function(){var e=this;this.range&&(this.range===this.RANGE_1HOUR?this.momentDateMax=this.momentDate.clone():this.range===this.RANGE_24HOUR?(this.momentDate=this.momentDateMax.clone(),this.momentDate.subtract("days",1)):this.range===this.RANGE_MONTH?(this.momentDate=this.momentDateMax.clone(),this.momentDate.subtract("months",1)):this.range===this.RANGE_7DAY&&(this.momentDate=this.momentDateMax.clone(),this.momentDate.subtract("days",7)),t.delay(function(){e.setDaysInActiveRange()},100),this.updateDatetimeText())},updateDatetimeText:function(){this.$datetime&&this.$datetimeMax&&(this.$datetime.text(this.momentDate.format(this.momentDatetimeFormat)),this.$datetimeMax.text(this.momentDateMax.format(this.momentDatetimeFormat)))},setDaysInActiveRange:function(){var e,i,o,r,s,c=this.$datepicker.find("tbody td"),l=(c.length,this.momentDate.clone()),d=this.momentDateMax.clone();l=l.startOf("day"),d=d.startOf("day"),this.range==this.RANGE_24HOUR&&l.add("day",1),this.removeDaysInActiveRange(),t.each(c,function(t,c){e=n(t),i=e.data("month")+1,r=e.data("year"),o=e.text(),s=a(r+"/"+i+"/"+o,"YYYY/MM/DD"),s.startOf("hour"),s>=l&&d>=s&&e.find("a").addClass("ui-state-active-range")})},removeDaysInActiveRange:function(){if(this.$datepicker.find(".ui-state-active-range").removeClass("ui-state-active-range"),this.range==this.RANGE_24HOUR){var e=this.$datepicker.find(".ui-datepicker-current-day");e.removeClass("ui-datepicker-current-day"),e.find(".ui-state-active").removeClass("ui-state-active")}},getDateRange:function(){var e,t,i=this.momentDate.clone().startOf("hour"),a=this.momentDateMax.clone().startOf("hour"),n={range:this.range,start:i.utc().unix()};return this.range===this.RANGE_24HOUR?(this.useCurrentTimeForRange?(e=a,t=a.clone().subtract("days",1)):(e=a.endOf("day"),t=a.clone().startOf("day")),n.end=e.utc().unix(),n.start=t.utc().unix()):this.range===this.RANGE_1HOUR?(t=i,e=i.clone().endOf("hour"),n.start=t.utc().unix(),n.end=e.utc().unix()):this.range===this.RANGE_MONTH?(e=a.endOf("day"),t=e.clone().subtract("months",1).startOf("day"),n.end=e.utc().unix(),n.start=t.utc().unix()):this.range===this.RANGE_7DAY&&(e=a.endOf("day"),t=e.clone().subtract("days",7).startOf("day"),n.end=e.utc().unix(),n.start=t.utc().unix()),n.start=parseInt(n.start+"000",10),n.end=parseInt(n.end+"000",10),n},openPopover:function(){this.originalSettings=this.getDateRange(),this.$datePopover.show(),n("body").on("click",this.onBodyClick)},closePopover:function(){this.$datePopover.hide(),n("body").off("click",this.onBodyClick)},onBodyClick:function(e){var t=this,i=n(e.target);i.hasClass("filter")&&t.closePopover(),i.hasClass("date-popover")||i.parents(".date-popover").length||i.parents(".date-nav").length||i.hasClass("ui-datepicker-next")||i.hasClass("ui-datepicker-prev")||i.hasClass("filter")||i.parents(".filter-popover").length||t.onCancel()},onUpdate:function(e){e.preventDefault(),this.closePopover(),this.$el.trigger("change",this.getDateRange())},onCancel:function(){this.revertSettings(),this.closePopover()},revertSettings:function(){this.$buttonset.find("input[value="+this.originalSettings.range+"]").click(),this.$datepicker.datepicker("setDate",new Date(this.originalSettings.end)),this.onDatepickerSelect(this.originalSettings.end)},remove:function(){this.$(".date-nav .ui-button").off(),this.$(".dateToggleBtn").on("click",this.openPopover),this.$microRangePrev.off("click",this.onMicroRangePrevClick).disableSelection(),this.$microRangeNext.off("click",this.onMicroRangeNextClick).disableSelection(),this.$update.off("click",this.onUpdate),this.$cancel.off("click",this.onCancel),this.$rangeButtonset.find("input").off("change",this.onRangeChange),n("body").off("click",this.onBodyClick),this.rendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("text!includes/statistics/statisticsFilterListItemTemplate.html",[],function(){return'<li>\n    <span class="title"><%- title %></span>\n    <span class="size"><%- size %></span>\n</li>\n'}),define("unifi/view/statistics/FilterNavView",["backbone","underscore","jquery","msg/Msg","ubnt/backgrid","text!includes/statistics/statisticsFilterListItemTemplate.html"],function(e,t,i,a,n,o){"use strict";return e.View.extend({initialize:function(e){t.bindAll(this),this.colors=e.colors,this.maxItemsToDisplay=10,this.collections=e.collections,this.collections.filtered={},this.collections.stats.site.on("sync",this.updateDeviceList),this.collections.stats.devices.on("sync change",this.updateDeviceList),this.collections.devices.on("sync change",this.updateDeviceList),this.render()},render:function(){var n=this;!this.rendered&&(this.rendered=!0)&&(this.$filterButton=this.$("button.filter"),this.$filterButton.on("click",this.openPopover),i("body").on("click",this.onBodyClick),this.$popover=this.$(".filter-popover"),this.$buttonset=this.$(".buttonset"),this.$buttonset.buttonset(),this.$buttonset.find("input").change(this.onChangeFilter),this.listItemTemplate=t.template(o),this.$listApplications=i("#listApplications").find(".list"),this.$listDevices=i("#listDevices").find(".list"),this.$listClients=i("#listClients").find(".list"),this.applicationCollection=new e.Collection([{title:"YouTube",size:"30GB",percentage:"30%"},{title:"Facebook",size:"20GB",percentage:"20%"},{title:"Netflix",size:"12GB",percentage:"12%"},{title:"Hulu",size:"8GB",percentage:"8%"},{title:"Google",size:"6GB",percentage:"6%"}]),this.clientsCollection=new e.Collection([{title:"mFi",size:"30GB",percentage:"30%"},{title:"RLDP",size:"20GB",percentage:"20%"},{title:"ubnt5-PC",size:"12GB",percentage:"12%"},{title:"mFi 10.1.6.31",size:"8GB",percentage:"8%"},{title:"android-99aeb09cc5054ac3",size:"6GB",percentage:"6%"}]),this.applicationCollection.each(function(e){n.$listApplications.append(n.listItemTemplate(e.toJSON()))}),this.clientsCollection.each(function(e){n.$listClients.append(n.listItemTemplate(e.toJSON()))}),this.$buttonfilter=this.$("button.filter"),this.$filterApplicationsLabel=this.$("label[for=filterApplications]"),this.$filterDevicesLabel=this.$("label[for=filterDevices]"),this.$filterClientsLabel=this.$("label[for=filterClients]"),this.$buttonfilter.find("span").after(a.G_Filter),this.$filterApplicationsLabel.find(".ui-button-text").text(a.G_StatsApplications),this.$filterDevicesLabel.find(".ui-button-text").text(a.G_Devices),this.$filterClientsLabel.find(".ui-button-text").text(a.G_Clients),this.$(".list-wrapper").on("click","li",this.onListItemClick),this.$listApplications.show())},updateClientList:function(){var i=this,a=this.collections.stats.clients.orderByBytes(),o={};i.$listClients.empty(),a=t.first(a,this.maxItemsToDisplay),t.each(a,function(e){o={title:"title",size:n.Formatters.Bytes.fromRaw(e.attributes.bytes),percentage:"0%"},i.$listClients.append(i.listItemTemplate(o))}),this.collections.filtered.clients=new e.Collection(a)},updateDeviceList:function(){var i,a=this,o=this.collections.stats.devices.orderByBytes(),r={};a.$listDevices.empty(),o=t.first(o,this.maxItemsToDisplay),t.each(o,function(e){i=a.collections.devices.getDeviceFromMac(e.attributes.ap),r={title:i?i.name():e.attributes.ap,size:n.Formatters.Bytes.fromRaw(e.attributes.bytes),percentage:"0%"},a.$listDevices.append(a.listItemTemplate(r))}),this.collections.filtered.devices=new e.Collection(o)},onChangeFilter:function(e){var t=i(e.target),a=t.val();a&&(this.$(".list-wrapper").hide(),this.$(".list-wrapper."+a).show())},onListItemClick:function(e){var t,a,n,o=i(e.currentTarget),r=(o.parents("ul"),o.index()),s=this.$buttonset.find("input[name=filter]:checked").val(),c=this.collections.filtered[s].at(r),l=c.get("o"),d=o.hasClass("selected");this.$el.find("li").removeClass("selected").css("background-color",""),d?(o.css("background-color",""),s=null,t=null,a=null,n=null):(o.addClass("selected").css("background-color",this.colors[r]),t=o.find(".title").text(),a=c.get(l),n=this.colors[r]),this.$el.trigger("change",{filter:s,name:t,oPropValue:a,color:n})},openPopover:function(e){e.preventDefault(),this.$popover.show(),this.$filterButton.addClass("ui-state-selected")},closePopover:function(){this.$popover.hide(),this.$filterButton.removeClass("ui-state-selected")},onBodyClick:function(e){var t=this,a=i(e.target);a.hasClass("filter-popover")||a.parents(".filter-popover").length||a.hasClass("filter")||a.parents(".filter").length||t.closePopover()},remove:function(){this.collections.stats.site.off("sync",this.updateDeviceList),this.collections.stats.devices.off("sync change",this.updateDeviceList),this.collections.devices.off("sync change",this.updateDeviceList),i("body").off("click",this.onBodyClick),this.$(".list-wrapper").off("click","li"),this.rendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("text!includes/statistics/statisticsIndexTemplate.html",[],function(){return'<div class="section section-main">\n    <h1><%- msg.G_Stats %></h1>\n    <form class="data-filters clearfix">\n        <div class="left">\n            <select name="system">\n                <option value="overview"><%- msg.G_PropertiesOverview %></option>\n            </select>\n            <a id="clearCurrentStats" href="#" class="link is-admin"><%- msg.G_StatsClearCurrentStats %></a>\n        </div>\n\n        <div class="right">\n            <div id="datetimeNav" class="left is24Hr">\n                <%= statisticsDateNavTemplate %>\n            </div>\n            <%= statisticsFilterTemplate() %>\n        </div>\n    </form>\n\n    <div class="data-stats-group data-stats-group-top">\n        <div id="statsClientsTotal" class="data-stats-group-small">\n            <div class="data-stats-group-cell">\n                <h2><%- msg.G_StatsClientsTitle %></h2>\n            </div>\n            <div id="clientsTotalPieChart" class="data-stats-group-cell data-stats-group-cell-content">\n                <div class="more-data-needed-title"><%- msg.G_StatsMoreDataPoints %></div>\n                <div class="data-stats-content">\n                    <div class="piechart-legend"></div>\n                    <div class="piechart-wrapper">\n                        <div class="piechart-title"><%- msg.G_StatsNumOfClients %></div>\n                        <div class="piechart"></div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div id="statsCurrentUsage" class="data-stats-group-medium">\n            <div class="data-stats-group-cell">\n                <h2><%- msg.G_StatsCurrentUsageTopAPS %></h2>\n            </div>\n            <div id="clientsCurrentUsagePieCharts" class="data-stats-group-cell data-stats-group-cell-content">\n                <div class="more-data-needed-title"><%- msg.G_StatsMoreDataPoints %></div>\n                <div class="data-stats-content">\n                    <div class="piechart-legend"></div>\n                    <div class="piechart-wrapper">\n                        <div class="piechart-title"><%- msg.G_StatsNumOfClients %></div>\n                        <div class="piechart piechart-numClients"></div>\n                    </div>\n                    <div class="piechart-wrapper">\n                        <div class="piechart-title"><%- msg.G_StatsTrafficTitle %></div>\n                        <div class="piechart piechart-traffic"></div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n\n    <div class="data-stats-group data-stats-group-bottom">\n        <div id="statsQuickLook" class="data-stats-group-small">\n            <div class="data-stats-group-cell">\n                <h2><%- msg.G_StatsQuickLook %></h2>\n            </div>\n            <div class="data-stats-group-cell data-stats-group-cell-content">\n                <div class="more-data-needed-title"><%- msg.G_StatsMoreDataPoints %></div>\n                <ul class="data-stats-content">\n                    <li class="data-stats-most-active-ap">\n                        <h4><%- msg.G_StatsMostActiveAP %></h4>\n                        <div class="name link"></div>\n                        <div class="down"><div class="sprite-arrow-down"></div> <span class="value"></span></div>\n                        <div class="up"><div class="sprite-arrow-up"></div> <span class="value"></span></div>\n                    </li>\n                    <li class="data-stats-most-active-client">\n                        <h4><%- msg.G_StatsMostActiveClient %></h4>\n                        <div class="name link"></div>\n                        <div class="down"><div class="sprite-arrow-down"></div> <span class="value"></span></div>\n                        <div class="up"><div class="sprite-arrow-up"></div> <span class="value"></span></div>\n                    </li>\n                    <li class="data-stats-all-time-top-client">\n                        <h4><%- msg.G_StatsAllTimeTopClient %></h4>\n                        <div class="name link"></div>\n                        <div class="down"><div class="sprite-arrow-down"></div> <span class="value"></span></div>\n                        <div class="up"><div class="sprite-arrow-up"></div> <span class="value"></span></div>\n                        <div class="duration"></div>\n                    </li>\n                </ul>\n            </div>\n        </div>\n        <div id="statsCurrentUsage" class="data-stats-group-medium">\n            <div class="data-stats-group-cell">\n                <h2><%- msg.G_StatsRecentActivities %></h2>\n            </div>\n            <div class="data-stats-group-cell data-stats-group-cell-content">\n                <div class="data-grids">\n                    <div id="clientsGrid" />\n                    <div id="trafficGrid" />\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n'}),define("text!includes/statistics/statisticsDateNavTemplate.html",[],function(){return'<div>\n    <div class="date-nav buttonset date-micro-range">\n        <input type="radio" id="dateNavPrev<%- id %>"/><label for="dateNavPrev<%- id %>" class="prev"><span class="ubnt-icon-angle-left"></span></label>\n        <input type="radio" id="dateToggle<%- id %>" class="dateToggleBtn"><label for="dateToggle<%- id %>" class="dateToggle"><span class="ubnt-icon-calendar-2"></span>\n        <span class="dateRange1Hr">\n            <span class="hour"></span> <span class="datetime"></span>\n        </span>\n        <span class="dateRange24Hr">\n            <span class="datetimeMax"></span>\n        </span>\n        <span class="dateRangeMonth">\n            <span class="datetime"></span> - <span class="datetimeMax"></span>\n        </span>\n    </label>\n        <input type="radio" id="dateNavNext<%- id %>"/><label for="dateNavNext<%- id %>" class="next"><span class="ubnt-icon-angle-right"></span></label>\n    </div>\n    <div class="date-popover">\n        <div class="date-popover-content">\n            <div class="header left">\n                <span class="title left"></span>\n                <div class="buttonset range-buttonset">\n                    <input type="radio" id="dateRange1Hour<%- id %>" class="dateRange1HourBtn" value="1hr" />\n                    <label class="date-range-1hour" for="dateRange1Hour<%- id %>"></label>\n                    <input type="radio" id="dateRange24Hour<%- id %>" class="dateRange24HourBtn" value="24hr" checked="checked" />\n                    <label class="date-range-hour" for="dateRange24Hour<%- id %>"></label>\n                    <input type="radio" id="dateRange7Day<%- id %>" class="dateRange7DayBtn" value="7day" />\n                    <label class="date-range-7day" for="dateRange7Day<%- id %>"></label>\n                    <input type="radio" id="dateRangeMonth<%- id %>" class="dateRangeMonthBtn" value="month" />\n                    <label class="date-range-month" for="dateRangeMonth<%- id %>"></label>\n                </div>\n            </div>\n            <div class="date-micro-range left">\n                <div class="dateRange1Hr">\n                    <span class="prev ubnt-icon-angle-left"></span>\n                    <span class="hour"></span>\n                    <span class="next ubnt-icon-angle-right"></span>\n                    <span class="datetime"></span>\n                </div>\n                <div class="dateRange24Hr">\n                    <span class="prev ubnt-icon-angle-left"></span>\n                    <span class="datetimeMax"></span>\n                    <span class="next ubnt-icon-angle-right"></span>\n                </div>\n                <div class="dateRangeMonth">\n                    <span class="prev ubnt-icon-angle-left"></span>\n                    <span class="datetime"></span>\n                    -\n                    <span class="datetimeMax"></span>\n                    <span class="next ubnt-icon-angle-right"></span>\n                </div>\n            </div>\n            <div class="datepicker left"></div>\n        </div>\n        <div class="footer left">\n            <button class="button tall blue update"><span class="ubnt-icon-check ui-button-icon"></span></button>\n            <button class="button tall cancel"><span class="ubnt-icon-close ui-button-icon"></span></button>\n        </div>\n    </div>\n</div>'}),define("text!includes/statistics/statisticsFilterTemplate.html",[],function(){return'<div id="filterNav" class="left">\n    <button class="button ui-button ui-state-default filter">\n        <span class="ubnt-icon-graph ui-button-icon"></span>\n        \n    </button>\n    <div class="filter-popover">\n        <div class="buttonset left hidden">\n            <input type="radio" id="filterApplications" name="filter" value="applications" />\n            <label for="filterApplications"></label>\n            <input type="radio" id="filterDevices" name="filter" value="devices" checked="checked" />\n            <label for="filterDevices"></label>\n            <input type="radio" id="filterClients" name="filter" value="clients" />\n            <label for="filterClients"></label>\n        </div>\n        <div id="listApplications" class="list-wrapper applications hidden">\n            <ul class="left list"></ul>\n        </div>\n\n        <div id="listDevices" class="list-wrapper devices" style="display:block">\n            <ul class="left list"></ul>\n        </div>\n\n        <div id="listClients" class="list-wrapper clients hidden">\n            <ul class="left list"></ul>\n        </div>\n    </div>\n</div>'}),define("unifi/view/statistics/IndexView",["unifi/view/app/ContentView","underscore","jquery","libs/d3","libs/moment","msg/Msg","ubnt/backgrid","unifi/model/StatisticsColors","unifi/collection/stats/SiteStats","unifi/collection/stats/ClientStats","unifi/collection/stats/DeviceStats","unifi/view/statistics/LineChartView","unifi/view/statistics/PieChartView","unifi/view/statistics/DatetimeNavView","unifi/view/statistics/FilterNavView","text!includes/statistics/statisticsIndexTemplate.html","text!includes/statistics/statisticsDateNavTemplate.html","text!includes/statistics/statisticsFilterTemplate.html"],function(e,t,i,a,n,o,r,s,c,l,d,m,u,h,g,p,y,f){"use strict";return e.extend({id:"statisticsIndex",charts:{},pieCharts:{},collections:{},intervals:{},_limitStart:"",_limitEnd:"",_limitRange:"",_limitFilter:"",_limitFilterName:"",_limitFilterValue:"",_limitFilterColor:"",_chartConfig:{margin:{top:22,right:50,bottom:30,left:10},widthOffset:-40,height:90,points:{off:0,on:7},overlays:{databox:{width:180,heightDiff:16,valueWidth:60}}},_pieChartConfig:{width:200,height:150,radius:70,colors:["#00acfc","#f8ad18","#c96353","#0bde9b","#7562ac"],legend:!0},initialize:function(a){e.prototype.initialize.call(this,a),this.updateCharts=t.debounce(this._updateCharts,300),this.colors=new s,this.collections.clients=this.options.app.collection("Clients"),this.collections.devices=this.options.app.collection("Devices"),this.collections.stats={},this.collections.stats.clients=this.options.app.collection("ClientStats",null,l),this.collections.stats.devices=this.options.app.collection("DeviceStats",null,d),this.collections.stats.site=this.options.app.collection("SiteStats",null,c),this.collections.stats.site.on("sync change",this.updateCharts),this.collections.stats.clients.on("sync change",this.updateStats),this.collections.stats.devices.on("sync change",this.updateStats),this.render(),this.clients(),this.traffic(),this.clientStats(),this.currentUsage(),this.calendar=new h({el:"#datetimeNav",useCurrentTimeForRange:!0}),this.calendar.$el.on("change",i.proxy(function(e,t){t&&(this._limitRange=t.range,this._limitStart=t.start,this._limitEnd=t.end,this.load())},this)),this.filterNav=new g({el:"#filterNav",colors:this.colors.getAllButFirst(),collections:this.collections}),this.filterNav.$el.on("change",i.proxy(function(e,t){t&&(this._limitFilter=t.filter,this._limitFilterName=t.name,this._limitFilterValue=t.oPropValue,this._limitFilterColor=t.color,this.updateCharts())},this));var n=this.calendar.getDateRange();this._limitRange=n.range,this._limitStart=n.start,this._limitEnd=n.end,this.load()},load:function(e){var a=[],n="24hr"==this._limitRange?"hourly":"daily",o=[];e&&o.push(e),t.each(this.collections.stats,function(e,t){a.push(this.collections.stats[t][n]({silent:!0,data:{start:this._limitStart,end:this._limitEnd}})),o.push(function(){e.trigger("change")})},this),i.when.apply(null,a).done(function(){t.each(o,function(e){e()})})},render:function(){if(e.prototype.render.call(this),!this.rendered&&(this.rendered=!0)){var a=this;this.$el.html(t.template(p,{statisticsDateNavTemplate:t.template(y,{id:"statisticsDateNav"}),msg:o,statisticsFilterTemplate:t.template(f)})),this.$grids=this.$el.find(".data-grids"),this.$stats=this.$el.find(".data-stats"),this.$statsClientsTotal=this.$("#statsClientsTotal"),this.$statsCurrentUsage=this.$("#statsCurrentUsage"),this.$statsQuickLook=this.$("#statsQuickLook"),this.$mostActiveAp=this.$(".data-stats-most-active-ap"),this.$mostActiveClient=this.$(".data-stats-most-active-client"),this.$allTimeTopClient=this.$(".data-stats-all-time-top-client"),this.$clearCurrentStats=this.$("#clearCurrentStats"),this.$clearCurrentStats.on("click",this.clearCurrentStats),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")}})}),i("#clientsGrid, #trafficGrid").on("mousemove",function(e){var n=e.pageX-i(this).offset().left,o=e.pageY-i(this).offset().top;t.each(a.charts,function(e){e.mouse=[n,o],e.updateOverlays()})}),this.$el.find(".data-grids").on("mouseleave",function(e){a.intervals.overlays||(a.intervals.overlays=setTimeout(function(){t.each(a.charts,function(e){e.hideOverlays()})},1e3))}).on("mouseenter",function(e){clearTimeout(a.intervals.overlays),delete a.intervals.overlays,t.each(a.charts,function(e){e.showOverlays()})}),i(window).resize(function(){a.charts.clients.update(!0),a.charts.traffic.update(!0)})}this.charts&&this.charts.clients&&this.charts.clients.update(!0),this.charts&&this.charts.traffic&&this.charts.traffic.update(!0)},clients:function(){var e=this,t=i("#clientsGrid");this.charts.clients=new m({el:t,config:{title:o.G_StatsClientsTitle,margin:this._chartConfig.margin,yFormat:"d",width:function(){return t.width()+e._chartConfig.widthOffset},height:this._chartConfig.height,ticksize:[0,0,0],points:this._chartConfig.points,overlays:{databox:this._chartConfig.overlays.databox},colors:[this.colors.first()]},data:{xprop:"datetime",yprop:"num_sta",yMinDomain:0,idprop:"_id",labels:[o.G_StatsClientsLabel],points:[]}})},traffic:function(){
var e=this,t=i("#trafficGrid");this.charts.traffic=new m({el:t,config:{title:o.G_StatsTrafficTitle,margin:this._chartConfig.margin,width:function(){return t.width()+e._chartConfig.widthOffset},height:this._chartConfig.height,ticksize:[6,0,0],points:this._chartConfig.points,overlays:{databox:this._chartConfig.overlays.databox,ticktip:{format:function(e,t){return"24hr"==t?n(e).format("hA"):n(e).format("MMM D")},width:{min:60,max:150,padding:20},height:26,bottom:-1}},colors:[this.colors.first()]},data:{xprop:"datetime",yprop:"bytesFmt",yMinDomain:0,idprop:"_id",formatBytes:!0,labels:[o.G_StatsTrafficLabel],points:[]}})},_updateCharts:function(){var e="24hr"==this._limitRange?3600:86400,i=this.collections.stats.site.toGraph({fill:!0,interval:e});if(i){if(this.charts.clients.data.points[0]=this.collections.stats.site.validatePointsHasProp(i,this.charts.clients.data.yprop)?t.clone(i):[],this.charts.traffic.data.points[0]=this.collections.stats.site.validatePointsHasProp(i,this.charts.traffic.data.yprop)?t.clone(i):[],this.charts.traffic.data.points[0].length&&(this.charts.traffic.data.yAxisLabel=i[0].bytesLbl),"24hr"==this._limitRange){var a=[new Date(n(this._limitStart).startOf("hour")),new Date(n(this._limitEnd).startOf("hour"))];this.charts.clients.data.xDomain=a,this.charts.traffic.data.xDomain=a}else delete this.charts.clients.data.xDomain,delete this.charts.traffic.data.xDomain;if(this._limitFilter){var o=this.collections.stats[this._limitFilter];i=o.toGraph({filter:this._limitFilterValue,fill:!0,interval:e,units:i[0].bytesLbl}),this.charts.clients.data.points[1]=o.validatePointsHasProp(i,this.charts.clients.data.yprop)?t.clone(i):[],this.charts.traffic.data.points[1]=o.validatePointsHasProp(i,this.charts.traffic.data.yprop)?t.clone(i):[],this.charts.clients.data.labels[1]=this._limitFilterName,this.charts.traffic.data.labels[1]=this._limitFilterName,this.charts.clients.config.colors[1]=this._limitFilterColor,this.charts.traffic.config.colors[1]=this._limitFilterColor}else this.charts.clients.data.points.length>1&&(this.charts.clients.data.points.pop(),this.charts.traffic.data.points.pop(),this.charts.clients.data.labels.pop(),this.charts.traffic.data.labels.pop(),this.charts.clients.config.colors.pop(),this.charts.traffic.config.colors.pop());this.charts.clients.config.range=this._limitRange,this.charts.traffic.config.range=this._limitRange,this.charts.clients.update(!0),this.charts.traffic.update(!0)}},updateStats:function(){this.apsSortByBytes=this.collections.devices.sortByBytesOnlyAdoptedAps(),this.clientsSortedByBytes=this.collections.clients.sortByBytes(),this.clientsSortedByUptime=this.collections.clients.sortByUptime(),this.clientsByEssid=this.collections.clients.clientsPerEssidStats(),this.updatePieCharts(),this.updateQuickLook()},clientStats:function(){var e=i("#clientsTotalPieChart");this.pieCharts.clientStats=new u({el:e,config:{width:this._pieChartConfig.width,height:this._pieChartConfig.height,radius:this._pieChartConfig.radius,colors:this._pieChartConfig.colors,legend:this._pieChartConfig.legend,pieChart:".piechart"},data:{prop:"count",points:[]}})},updatePieCharts:function(){this._updateClientStats(),this._updateDeviceStats()},_updateClientStats:function(){var e=this.clientsByEssid.slice(0,5);this.pieCharts.clientStats&&e&&e.length?(this.pieCharts.clientStats.data.points=e,this.$statsClientsTotal.removeClass("more-data-needed"),this.pieCharts.clientStats.update()):this.$statsClientsTotal.addClass("more-data-needed")},_updateDeviceStats:function(){var e=this.apsSortByBytes.slice(0,5);this.pieCharts.numClients&&this.pieCharts.traffic&&e&&e.length?(this.pieCharts.numClients.data.points=e,this.pieCharts.traffic.data.points=e,this.$statsCurrentUsage.removeClass("more-data-needed"),this.pieCharts.numClients.update(),this.pieCharts.traffic.update()):this.$statsCurrentUsage.addClass("more-data-needed")},currentUsage:function(){var e=i("#clientsCurrentUsagePieCharts");this.pieCharts.numClients=new u({el:e,config:{width:this._pieChartConfig.width,height:this._pieChartConfig.height,radius:this._pieChartConfig.radius,colors:this._pieChartConfig.colors,legend:this._pieChartConfig.legend,pieChart:".piechart-numClients"},data:{prop:"num_sta",points:[]}}),this.pieCharts.traffic=new u({el:e,config:{width:this._pieChartConfig.width,height:this._pieChartConfig.height,radius:this._pieChartConfig.radius,colors:this._pieChartConfig.colors,legend:this._pieChartConfig.legend,pieChart:".piechart-traffic"},data:{prop:"bytes",formatBytes:!0,points:[]}})},updateQuickLook:function(){var e=this,t=0;this.apsSortByBytes&&this.apsSortByBytes.length&&this.apsSortByBytes[0].get("rx_bytes")>0&&this.apsSortByBytes[0].get("tx_bytes")>0?(this.$mostActiveAp.find(".name").off().on("click",function(){var t=e.apsSortByBytes[0],i=e.collections.devices,a=i.getDeviceFromMac(t.get("ap_mac"));a||(a=t),e.options.app.routers.devices.views.index.property(a)}).text(this.apsSortByBytes[0].name()),this.$mostActiveAp.find(".down .value").text(r.Formatters.Bytes.fromRaw(this.apsSortByBytes[0].get("tx_bytes"))),this.$mostActiveAp.find(".up .value").text(r.Formatters.Bytes.fromRaw(this.apsSortByBytes[0].get("rx_bytes"))),this.$mostActiveAp.show(),t++):this.$mostActiveAp.hide(),this.clientsSortedByBytes&&this.clientsSortedByBytes.length&&this.clientsSortedByBytes[0].get("rx_bytes")>0&&this.clientsSortedByBytes[0].get("tx_bytes")>0?(this.$mostActiveClient.find(".name").off().on("click",function(){var t=e.clientsSortedByBytes[0],i=e.options.app.collection("Clients"),a=i.getClientFromMac(t.get("mac"));a||(a=t),e.options.app.routers.clients.views.index.property(a)}).text(this.clientsSortedByBytes[0].name()),this.$mostActiveClient.find(".down .value").text(r.Formatters.Bytes.fromRaw(this.clientsSortedByBytes[0].get("tx_bytes"))),this.$mostActiveClient.find(".up .value").text(r.Formatters.Bytes.fromRaw(this.clientsSortedByBytes[0].get("rx_bytes"))),this.$mostActiveClient.show(),t++):this.$mostActiveClient.hide(),this.clientsSortedByUptime&&this.clientsSortedByUptime.length&&this.clientsSortedByUptime[0].get("rx_bytes")>0&&this.clientsSortedByUptime[0].get("tx_bytes")>0?(this.$allTimeTopClient.find(".name").off().on("click",function(){var t=e.clientsSortedByUptime[0],i=e.options.app.collection("Clients"),a=i.getClientFromMac(t.get("mac"));a||(a=t),e.options.app.routers.clients.views.index.property(a)}).text(this.clientsSortedByUptime[0].name()),this.$allTimeTopClient.find(".down .value").text(r.Formatters.Bytes.fromRaw(this.clientsSortedByUptime[0].get("tx_bytes"))),this.$allTimeTopClient.find(".up .value").text(r.Formatters.Bytes.fromRaw(this.clientsSortedByUptime[0].get("rx_bytes"))),this.$allTimeTopClient.find(".duration").text(r.Formatters.Duration.fromRaw(this.clientsSortedByUptime[0].get("uptime"))),this.$allTimeTopClient.show(),t++):this.$allTimeTopClient.hide(),t>0?this.$statsQuickLook.removeClass("more-data-needed"):this.$statsQuickLook.addClass("more-data-needed")},clearCurrentStats:function(){var e=this;return this.collections.stats.site.clearStats({success:function(t){"ok"===t.meta.rc&&(e.apsSortByBytes=[],e._updateDeviceStats())}}),!1},remove:function(){this.collections.stats.site.off("sync change",this.updateCharts),this.collections.stats.clients.off("sync change",this.updateStats),this.collections.stats.devices.off("sync change",this.updateStats),this.calendar.$el.off("change"),this.filterNav.$el.off("change"),this.$clearCurrentStats.off("click"),i("#clientsGrid, #trafficGrid").off("mousemove"),this.$el.find(".data-grids").off("mouseleave").off("mouseenter"),this.$mostActiveAp.find(".name").off(),this.$mostActiveClient.find(".name").off(),this.$allTimeTopClient.find(".name").off(),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/router/StatisticsRouter",["unifi/router/Router","unifi/view/statistics/IndexView"],function(e,t){"use strict";return e.extend({_fullyQualifiedName:"UNIFI.Routers.Statistics",_associatedViews:{Index:t},routes:{statistics:"index","statistics?d=:d":"index"}})}),define("text!includes/insights/insightsChromeTemplate.html",[],function(){return'<div class="section section-main">\n    <h1><%- msg.G_Insights %></h1>\n\n    <div class="subnav">\n        <select name="insights-dropdown" id="insightsDropdown">\n            <option value="knownclients" selected="selected"><%- msg.G_InsightsKnownClients %></option>\n            <option value="rogueaccesspoints"><%- msg.G_InsightsRogueAccessPoints %></option>\n            <option value="pastconnections"><%- msg.G_InsightsPastConnections %></option>\n            <option value="pastguestauthorizations"><%- msg.G_InsightsPastGuestAuthorizations %></option>\n            <option value="switchstats"><%- msg.G_InsightsSwitchStats %></option>\n            <option value="remoteuservpnstats"><%- msg.G_InsightsRemoteUserVPNStats %></option>\n            <option value="dynamicdnsstats"><%- msg.G_InsightsDynamicDNS %></option>\n            <option value="portforwardstats"><%- msg.G_InsightsPortForwardStats %></option>\n        </select>\n    </div>\n\n    <form class="data-filters clearfix">\n        <span class="ubnt-icon-search"></span>\n        <input type="text" name="search" class="search left" />\n\n        <div class="knownclients data-filter left">\n            <div class="buttonset">\n                <input type="radio" id="knownClientsAll" name="client-table-filter-type" value="all" checked="checked"/>\n                <label for="knownClientsAll"><%- msg.G_All %></label>\n                <input type="radio" id="knownClientsUser" name="client-table-filter-type" value="user"/>\n                <label for="knownClientsUser"><%- msg.G_User %></label>\n                <input type="radio" id="knownClientsGuest" name="client-table-filter-type" value="guest"/>\n                <label for="knownClientsGuest"><%- msg.G_Guest %></label>\n            </div>\n        \n            <div class="buttonset">\n                <input type="checkbox" id="knownClientsBlocked" name="client-table-filter-type-options" value="blocked"/>\n                <label for="knownClientsBlocked"><%- msg.G_InsightsBlocked %></label>\n                <input type="checkbox" id="knownClientsNoted" name="client-table-filter-type-options" value="noted"/>\n                <label for="knownClientsNoted"><%- msg.G_Noted %></label>\n                <input type="checkbox" id="knownClientsStaticIP" name="client-table-filter-type-options" value="staticIP"/>\n                <label for="knownClientsStaticIP"><%- msg.G_StaticIP %></label>\n            </div>\n            \n            <div class="buttonset conn-filters">\n                <input type="radio" id="knownClientsConnAll" name="table-filter-conn" value="all" checked="checked" /><label for="knownClientsConnAll"><%- msg.G_All %></label>\n                <input type="radio" id="knownClientsConnWireless" name="table-filter-conn" value="wireless" /><label for="knownClientsConnWireless"><%- msg.G_Wireless %></label>\n                <input type="radio" id="knownClientsConnWired" name="table-filter-conn" value="wired" /><label for="knownClientsConnWired"><%- msg.G_Wired %></label>\n            </div>\n            \n            <div>\n                <select class="knownClientsLastSeen" name="knownClientsLastSeen" data-label="<%- msg.G_LastSeen %>: ">\n                    <option value="24" selected="selected"><%- msg.G_Insights1Day %></option>\n                    <option value="72"><%- msg.G_Insights3Days %></option>\n                    <option value="168"><%- msg.G_Insights7Days %></option>\n                    <option value="336"><%- msg.G_Insights2Weeks %></option>\n                    <option value="720"><%- msg.G_Insights1Month %></option>\n                    <option value="1400"><%- msg.G_Insights2Months %></option>\n                    <option value="87600"><%- msg.G_InsightsAll %></option>\n                </select>\n            </div>\n        </div>\n\n        <div class="rogueaccesspoints data-filter left">\n            <div>\n                <select name="rogueAccessPointsLastSeen" data-label="<%- msg.G_LastSeen %>: ">\n                    <option value="24"><%- msg.G_Insights1Day %></option>\n                    <option value="72"><%- msg.G_Insights3Days %></option>\n                    <option value="168" selected="selected"><%- msg.G_Insights7Days %></option>\n                    <option value="336"><%- msg.G_Insights2Weeks %></option>\n                    <option value="720"><%- msg.G_Insights1Month %></option>\n                    <option value="1400"><%- msg.G_Insights2Months %></option>\n                    <option value="87600"><%- msg.G_InsightsAll %></option>\n                </select>\n            </div>\n        </div>\n\n        <div class="pastconnections data-filter left">\n            <div class="buttonset">\n                <input type="radio" id="pastConnectionsAll" name="table-filter-type" value="all" checked="checked"/>\n                <label for="pastConnectionsAll"><%- msg.G_All %></label>\n                <input type="radio" id="pastConnectionsUser" name="table-filter-type" value="user"/>\n                <label for="pastConnectionsUser"><%- msg.G_User %></label>\n                <input type="radio" id="pastConnectionsGuest" name="table-filter-type" value="guest"/>\n                <label for="pastConnectionsGuest"><%- msg.G_Guest %></label>\n            </div>\n\n            <div id="pastconnections-datetimeNav" class="left is24Hr">\n                <%= pastConnectionsCalendarTemplate %>\n            </div>\n        </div>\n\n        <div class="pastguestauthorizations data-filter left">\n            <div id="pastguestauthorizations-datetimeNav" class="left is24Hr">\n                <%= pastGuestAuthorizationsCalendarTemplate %>\n            </div>\n        </div>\n\n        <div class="switchstats data-filter left">\n            <div class="switch-filter left">\n                <select name="switch-filter" class="wide" data-label="<%- msg.G_InsightsSwitch %>: "></select>\n            </div>\n\n            <div class="network-link-filter left">\n                <select name="network-link-filter" class="wide" data-label="<%- msg.G_InsightsNetworkLinkStatus %>: "></select>\n            </div>\n\n            <div class="buttonset switch-subtab-filters">\n                <input type="radio" id="switchFilterOverview" name="switch-subtab-filter" value="overview" checked="checked" /><label for="switchFilterOverview"><%- msg.G_DevicesOverview %></label>\n                <input type="radio" id="switchFilterPOE" name="switch-subtab-filter" value="poe" /><label for="switchFilterPOE">POE</label>\n                <input type="radio" id="switchFilterCounters" name="switch-subtab-filter" value="counters" /><label for="switchFilterCounters"><%- msg.G_InsightsCounters %></label>\n            </div>\n\n            <div class="poe-filter left">\n                <select name="poe-filter" class="wide" data-label="<%- msg.G_InsightsPoeMode %>: "></select>\n            </div>\n\n            <div class="clear-counters left">\n                <select class="clear-counters" name="clear-counters" data-label="<%- msg.G_InsightsClearCounters %>: "></select>\n            </div>\n        </div>\n\n        <div class="remoteuservpnstats data-filter left">\n        </div>\n\n        <div class="dynamicdnsstats data-filter left">\n        </div>\n\n        <div class="portforwardstats data-filter left">\n            <div class="buttonset portforward-subtab-filters">\n                <input type="radio" id="portforwardFilterAll" name="portforward-subtab-filter" value="all" checked="checked" /><label for="portforwardFilterAll"><%- msg.G_PortForwardAll %></label>\n                <input type="radio" id="portforwardFilterUserDefined" name="portforward-subtab-filter" value="user_defined" /><label for="portforwardFilterUserDefined"><%- msg.G_PortForwardUserDefined %></label>\n                <input type="radio" id="portforwardFilterUpnp" name="portforward-subtab-filter" value="upnp" /><label for="portforwardFilterUpnp"><%- msg.G_PortForwardUpnp %></label>\n            </div>\n        </div>\n\n        <div class="right">\n            <select name="items-per-page" data-label="<%- msg.G_FilterItemsPerPage %>">\n                <option value="10">10</option>\n                <option value="50" selected="selected">50</option>\n                <option value="100">100</option>\n                <option value="200">200</option>\n            </select>\n        </div>\n    </form>\n\n    <div id="insightsContent" class="">\n        <!-- insights content -->\n    </div>\n\n</div>\n'}),define("unifi/view/insights/ChromeView",["unifi/view/app/ContentView","underscore","jquery","msg/Msg","text!includes/insights/insightsChromeTemplate.html","text!includes/statistics/statisticsDateNavTemplate.html",""],function(e,t,i,a,n,o){"use strict";return e.extend({id:"insightsChrome",_templateId:n,_contentView:null,initialize:function(t){e.prototype.initialize.call(this,t),this.render()},render:function(){if(e.prototype.render.call(this),!this.rendered&&(this.rendered=!0)){var n=this,r=t.template(o,{id:"pastconnections"}),s=t.template(o,{id:"pastguestauthorizations"});this.$el.html(t.template(this._templateId,{pastConnectionsCalendarTemplate:r,pastGuestAuthorizationsCalendarTemplate:s,msg:a})),this.$content=this.$el.find("#insightsContent"),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",t.debounce(this.filter,300)),this.$insightsDropdown=this.$el.find("#insightsDropdown"),this.$insightsDropdown.on("change",function(e){e.preventDefault();var t=i(this).val()||"knownclients";n.navigate(t+location.search||""),n.app.routers.insights.navigate("insights/"+t+location.search||"",{trigger:!0})})}},renderSelects:function(){i("#insightsChrome .section").find("select:visible").each(function(){var e=i(this),t=e.parent(),a=e.data("selectRendered"),n=e.data("myposition")||"left top";a||(e.selectmenu({parent:t,appendTo:t,label:e.data("label"),icons:{button:"ubnt-icon-arrow-down secondary-color"},position:{my:n,at:"left bottom",collision:"flip"},change:function(t,i){e.trigger("change")}}),e.data("selectRendered",!0).trigger("change",!0))})},navigate:function(e){var t=e.replace(location.search,"");this.$insightsDropdown.val()!=t&&this.$insightsDropdown.val(t).change(),this.$content.find("> div").hide(),this.$content.find("#"+t).show(),this.$(".section").attr("id","insights"+t),this.renderSelects()},filter:function(){this._contentView&&this._contentView.filter.call(this,null,this.$search.val())},remove:function(){t.each(this.views,function(e){e.remove&&e.remove()},this),this.views={},this.$el.find("form.data-filters").off("submit"),this.$search.off("keyup"),this.$insightsDropdown.off("change"),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("text!includes/insights/knownClientsTemplate.html",[],function(){return'<div class="data-table untitled">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n</div>'}),define("unifi/view/insights/KnownClientsView",["unifi/view/app/ListContentView","unifi/view/clients/IndexView","libs/backgrid","ubnt/backgrid","underscore","jquery","unifi/collection/insights/KnownClients","text!includes/insights/knownClientsTemplate.html","msg/Msg"],function(e,t,i,a,n,o,r,s,c){"use strict";return t.extend({id:"knownclients",_templateId:s,_collectionType:{name:"KnownClients",Class:r},_pageable:!0,_limitType:"all",_limitConn:"all",_limitTimeframe:"24",_includeTimeframe:!0,_filterMinimum:.1,initialize:function(e){this.$insightsChrome=o("#insightsChrome"),t.prototype.initialize.call(this,n.extend({skipBindings:!0},e)),this.$el.removeClass("content"),this.listenTo(this.collection,"change:blocked",this.handleBlockedChange)},columns:function(){var e=this;return[{name:"mac",customClass:"column-name",label:c.G_InsightsNameMACAddress,editable:!1,cell:a.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){return e.name()},toRaw:function(e){return e}}}),callback:function(t){e.options.app.routers.clients.views.index.property(t)},title:"mac"},{name:"oui",label:c.G_InsightsManufacturer,editable:!1,cell:"string"},{name:"is_guest",label:c.G_UserGuest,editable:!1,cell:a.Cells.ModelCell.extend({callback:"userOrGuest"})},{name:"tx_bytes",label:c.G_Down,editable:!1,cell:i.StringCell.extend({formatter:a.Formatters.Bytes})},{name:"rx_bytes",label:c.G_Up,editable:!1,cell:i.StringCell.extend({formatter:a.Formatters.Bytes})},{name:"last_seen",label:c.G_LastSeen,editable:!1,cell:a.Cells.ModelCell.extend({callback:"absoluteLastSeen"})},{name:"_id",label:c.G_Actions,editable:!1,sortable:!1,headerCell:a.Headers.noSortHeader,cell:a.Cells.ActionsCell.extend({actions:{unblock:{icon:"ubnt-icon-undo",callback:this.rowUnblock,requiresAdminPrivilege:!0,render:function(e){return e.get("blocked")}},block:{icon:"ubnt-icon-close",callback:this.rowBlock,requiresAdminPrivilege:!0,render:function(e){return!e.get("blocked")}}}})}]},render:function(){var e=this.rendered;if(e||(this.$pageSize=this.$insightsChrome.find("select[name=items-per-page]")),t.prototype.render.call(this),!e){var i=(this.options.app.collection("Clients"),this);this.$inputFilterType=this.$insightsChrome.find('.knownclients input[name="client-table-filter-type"]'),this.$inputFilterTypeOptions=this.$insightsChrome.find('.knownclients input[name="client-table-filter-type-options"]'),this.$inputFilterWired=this.$insightsChrome.find('.knownclients input[name="table-filter-conn"]'),this.$lastSeenDropdown=this.$insightsChrome.find('.knownclients select[name="knownClientsLastSeen"]'),this.$insightsChrome.find('.knownclients input[name="client-table-filter-type"][value="'+(o.cookie("filterInsightsKnownClientsType")||"all")+'"]').click(),this.$insightsChrome.find('.knownclients input[name="table-filter-conn"][value="'+(o.cookie("filterInsightsKnownClientsConn")||"all")+'"]').click(),n.each((o.cookie("filterInsightsKnownClientsTypeOptions")||"").split(","),function(e){i.$insightsChrome.find('.knownclients input[name="client-table-filter-type-options"][value="'+e+'"]').click()}),this.$inputFilterType.on("change",this.handleFilterChange),this.$inputFilterTypeOptions.on("change",this.handleFilterChange),this.$inputFilterWired.on("change",this.handleFilterChange),this.$lastSeenDropdown.on("change",function(){i._limitTimeframe=Math.max(parseInt(o(this).find("option:selected").val(),10),24),i.load(!0)}),this.$lastSeenDropdownParent=null}},handleFilterChange:function(){var e=this.$inputFilterType.first().parent().find("input:checked").val(),t=this.grids.content;if(t){switch(this.$lastSeenDropdownParent||(this.$lastSeenDropdownParent=this.$lastSeenDropdown.parents(".ui-selectmenu-parent:first")),this._limitType=e||void 0,t.removeFilter("is_guest",!0),e){case"user":t.setFilter("is_guest",!1,1),this.$lastSeenDropdownParent.show();break;case"guest":t.setFilter("is_guest",!0,1),this.$lastSeenDropdownParent.show();break;case"all":this.$lastSeenDropdownParent.show()}this._includeTimeframe&&(this._limitTimeframe=Math.max(parseInt(this.$lastSeenDropdown.find("option:selected").val(),10),24)),o.cookie("filterInsightsKnownClientsType",e);var i=[];this.$inputFilterTypeOptions.first().parent().find("input:checked").each(function(e,t){i.push(o(t).val())}),this.$lastSeenDropdownParent||(this.$lastSeenDropdownParent=this.$lastSeenDropdown.parents(".ui-selectmenu-parent:first")),t.removeFilter("blocked",!0),t.removeFilter("noted",!0),t.removeFilter("use_fixedip",!0),this._includeTimeframe=!0,this._limitBlocked=void 0,this._limitNoted=void 0,this._limitFixed=void 0,i.indexOf("blocked")>=0&&(t.setFilter("blocked",!0,1),this.$lastSeenDropdownParent.hide(),this._includeTimeframe=!1,this._limitBlocked=!0),i.indexOf("noted")>=0&&(t.setFilter("noted",!0,1),this.$lastSeenDropdownParent.hide(),this._includeTimeframe=!1,this._limitNoted=!0),i.indexOf("staticIP")>=0&&(t.setFilter("use_fixedip",!0,1),this.$lastSeenDropdownParent.hide(),this._includeTimeframe=!1,this._limitFixed=!0),this._includeTimeframe&&(this._limitTimeframe=Math.max(parseInt(this.$lastSeenDropdown.find("option:selected").val(),10),24)),o.cookie("filterInsightsKnownClientsTypeOptions",i.join(","));var a=this.$inputFilterWired.first().parent().find("input:checked").val();switch(this._limitConn=a,t.removeFilter("is_wired",!0),a){case"wired":t.setFilter("is_wired",!0,1,!1,!0);break;case"wireless":t.setFilter("is_wired",!0,-1,!1,!0);break;case"all":}o.cookie("filterInsightsKnownClientsConn",a),this.load(!0)}},load:function(e){if(e=e||!this.collection,!this.collection||e){var i={type:this._limitType,conn:this._limitConn,use_fixedip:this._limitFixed,noted:this._limitNoted,blocked:this._limitBlocked};this._includeTimeframe&&(i.within=this._limitTimeframe),t.prototype.load.call(this,e,{data:i})}},grid:function(){e.prototype.grid.call(this),this.handleFilterChange()},handleBlockedChange:function(){"blocked"==this._limitType&&this.grids.content._filter()},searchable:function(){var t=o.proxy(function(e){var t=this.options.app.collection("Clients").getClientFromMac(e.get("mac"));t&&e.addSearchString("alias_name",t.name())},this),i=o.proxy(function(){this.collection.each(t),this.trigger("search:indexed")},this);this.listenTo(this.collection,"change",t),this.listenTo(this.collection,"add",t),this.listenTo(this.collection,"reset",i),i(),e.prototype.searchable.call(this)},remove:function(){this.stopListening(this.collection),this.stopListening(this.options.app.collection("Clients")),this.$inputFilterType.off("change",this.handleFilterChange),this.$inputFilterTypeOptions.off("change",this.handleFilterChange),this.$inputFilterIp.off("change",this.handleFilterChange),this.$inputFilterWired.off("change",this.handleFilterChange),this.$lastSeenDropdown.off("change"),this.rendered=!1,t.prototype.remove.apply(this,arguments)}})}),define("unifi/model/insights/RogueAccessPoint",["unifi/model/Device","backbone","ubnt/backgrid","libs/moment","msg/Msg"],function(e,t,i,a,n){"use strict";return e.extend({toSearch:function(){return{name:this.name(),essid:this.essid(),bssid:this.attributes.bssid,mac:this.attributes.mac,ip:this.attributes.ip,location:this.attributes.ap_mac,lastSeen:this.absoluteLastSeen(),oui:this.attributes.oui}},essid:function(){return this.get("essid")||"<hidden>"},channelWithRadio:function(){return this.get("channel")+" ("+this.get("radio")+")"},type:function(){return this.get("security")+(this.get("is_adhoc")?" (Ad-Hoc)":"")}})}),define("unifi/collection/insights/RogueAccessPoints",["backbone","underscore","unifi/collection/Devices","unifi/model/insights/RogueAccessPoint"],function(e,t,i,a){"use strict";return i.extend({model:a,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/rogueap"},sync:function(i,a,n){switch(n=n||{},i){case"read":n.contentType="application/json; charset=utf-8",n.type="POST",n.data=JSON.stringify(t.extend(n.data||{}))}return e.sync.call(this,i,a,n)}})}),define("text!includes/insights/rogueAccessPointsTemplate.html",[],function(){return'<div class="data-table untitled">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n</div>'}),define("unifi/view/insights/RogueAccessPointsView",["unifi/view/app/ListContentView","libs/backgrid","ubnt/backgrid","underscore","jquery","msg/Msg","unifi/collection/insights/RogueAccessPoints","text!includes/insights/rogueAccessPointsTemplate.html"],function(e,t,i,a,n,o,r,s){"use strict";return e.extend({id:"rogueaccesspoints",_templateId:s,_collectionType:{name:"Rogueaccesspoints",Class:r},_pageable:!0,_limitTimeframe:"24",initialize:function(t){this.$insightsChrome=n("#insightsChrome"),e.prototype.initialize.call(this,t),this.$el.removeClass("content")},columns:function(){var e=this;return[{name:"essid",label:o.G_InsightsNameSSI,editable:!1,cell:i.Cells.ModelCell.extend({callback:"essid"})},{name:"bssid",label:o.G_InsightsBSSID,editable:!1,cell:"string"},{name:"channel",label:o.G_Channel,editable:!1,cell:i.Cells.ModelCell.extend({callback:"channelWithRadio"})},{name:"security",label:o.G_InsightsRogueType,editable:!1,cell:i.Cells.ModelCell.extend({callback:"type"})},{name:"oui",label:o.G_InsightsManufacturer,editable:!1,cell:"string"},{name:"ap_mac",label:o.G_InsightsLocation,editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:function(t){var i=e.options.app.collection("Devices"),a=i.getDeviceFromMac(t.get("ap_mac"));return"near "+(a?a.name():t.get("ap_mac"))},toRaw:function(e){return e}}})},{name:"rssi",label:o.G_Signal,customClass:"column-signal",editable:!1,cell:i.Cells.ComplexHtmlCell.extend({className:"rssiWithRadio",formatter:{fromRaw:function(e){var t=e.get("rssi"),i=e.get("radio"),a="sprite-";return a+=i+"-"+("na"===i?"5g":"2g"),'<span class="signal-value">'+t+'</span><span class="signal-icon '+a+'"></span>'},toRaw:function(e){return e}}})},{name:"last_seen",label:o.G_InsightsLastSeen,editable:!1,cell:i.Cells.ModelCell.extend({callback:"absoluteLastSeen"})}]},render:function(){var t=this.rendered;if(t||(this.$pageSize=this.$insightsChrome.find("select[name=items-per-page]")),e.prototype.render.call(this),!t){var i=this;this.$lastSeenDropdown=this.$insightsChrome.find('.rogueaccesspoints select[name="rogueAccessPointsLastSeen"]').on("change",function(){i._limitTimeframe=Math.max(parseInt(n(this).find("option:selected").val(),10),24),i.load(!0)})}},load:function(t){t=t||!this.collection,(!this.collection||t)&&e.prototype.load.call(this,t,{data:{within:this._limitTimeframe}})},searchable:function(){var t=n.proxy(function(e){var t=this.options.app.collection("Devices").getDeviceFromMac(e.get("ap_mac"));t&&e.addSearchString("near",t.name()),e.addSearchString("channel",e.channelWithRadio()),e.addSearchString("type",e.type())},this),i=n.proxy(function(){this.collection.each(t),this.trigger("search:indexed")},this);this.listenTo(this.collection,"change",t),this.listenTo(this.collection,"add",t),this.listenTo(this.collection,"reset",i),i(),e.prototype.searchable.call(this)},remove:function(){this.$insightsChrome.find('.rogueaccesspoints select[name="rogueAccessPointsLastSeen"]').off("change"),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/model/insights/PastConnection",["unifi/model/Client","backbone","ubnt/backgrid","libs/moment"],function(e,t,i,a){"use strict";return e.extend({toSearch:function(){return{name:this.name(),mac:this.attributes.mac,is_guest:this.isGuest(),assoc_time:i.Formatters.Moment.fromRaw(this.attributes.assoc_time)}}})}),define("unifi/collection/insights/PastConnections",["backbone","underscore","unifi/collection/Clients","unifi/model/insights/PastConnection"],function(e,t,i,a){"use strict";return i.extend({model:a,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/session"},sync:function(i,a,n){switch(n=n||{},i){case"read":n.contentType="application/json; charset=utf-8",n.type="POST",n.data=JSON.stringify(t.extend(n.data||{}))}return e.sync.call(this,i,a,n)}})}),define("text!includes/insights/pastConnectionsTemplate.html",[],function(){return'<div class="data-table untitled">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n</div>'}),define("unifi/view/insights/PastConnectionsView",["unifi/view/app/ListContentView","libs/backgrid","ubnt/backgrid","underscore","jquery","msg/Msg","unifi/collection/insights/PastConnections","text!includes/insights/pastConnectionsTemplate.html","unifi/view/statistics/DatetimeNavView"],function(e,t,i,a,n,o,r,s,c){"use strict";return e.extend({id:"pastconnections",_templateId:s,_collectionType:{name:"PastConnections",Class:r},_pageable:!0,_limitType:"all",_limitStart:null,_limitEnd:null,initialize:function(t){this.$insightsChrome=n("#insightsChrome"),e.prototype.initialize.call(this,t),this.$el.removeClass("content");var i=this;this.listenTo(this.options.app.collection("Clients"),"change:name",function(e){var t,a=i.collection.where({mac:e.get("mac")
});for(t=0;t<a.length;t++)a[t].trigger("change",a[t])}),this.listenTo(this.options.app.collection("Devices"),"change:name",function(e){var t,a,n=e.get("type");for("usw"===n?t=i.collection.where({is_wired:!0,sw_mac:e.get("mac")}):"ugw"===n?t=i.collection.where({is_wired:!0,gw_mac:e.get("mac")}):"uap"===n&&(t=i.collection.where({is_wired:!1,ap_mac:e.get("mac")})),a=0;a<t.length;a++)t[a].trigger("change",t[a])})},columns:function(){var e=this;return[{name:"mac",label:o.G_InsightsNameMACAddress,editable:!1,sortValue:"name",headerCell:i.Headers.customSortHeader,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:function(t){var i=e.options.app.collection("Clients"),a=i.getClientFromMac(t.get("mac"));return a||(a=t),a.name()},toRaw:function(e){return e}}}),callback:function(t){var i=e.options.app.collection("Clients"),a=i.getClientFromMac(t.get("mac"));a?a.set({blocked:t.get("blocked")},{silent:!0}):a=t,e.options.app.routers.clients.views.index.property(a)},title:"mac"},{name:"is_guest",label:o.G_UserGuest,editable:!1,cell:i.Cells.ModelCell.extend({callback:"userOrGuest"})},{name:"assoc_time",label:o.G_InsightsAssociated,editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Moment})},{name:"duration",label:o.G_Duration,editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Duration})},{name:"tx_bytes",label:o.G_Down,editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Bytes})},{name:"rx_bytes",label:o.G_Up,editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Bytes})},{name:"ip",label:o.G_IP,editable:!1,sortValue:"ip2long",headerCell:i.Headers.customSortHeader,cell:"string"},{name:"ap_mac",label:o.G_InsightsLastAPPort,customClass:"column-apport",editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:function(t){var i,a=e.app.collection("Devices");return t.get("is_wired")?t.get("sw_mac")?(i=a.getDeviceFromMac(t.get("sw_mac")))?i.name()+t.switch_port_suffix(!1):t.get("sw_mac"):t.get("gw_mac")?(i=a.getDeviceFromMac(t.get("gw_mac")))?i.name():t.get("gw_mac"):void 0:(i=t.get("ap_mac")?a.getDeviceFromMac(t.get("ap_mac")):null,i?i.name():t.get("ap_mac"))},toRaw:function(e){return e}}}),callback:function(t){var i,a=e.app.routers.devices.views.index;t.get("is_wired")?(i=a.collection.getDeviceFromMac(t.get("sw_mac")?t.get("sw_mac"):t.get("gw_mac")),a.property(i,{port:t.get("sw_mac")?t.get("sw_port"):"lan"})):(i=a.collection.getDeviceFromMac(t.get("ap_mac")),a.property(i))}}]},render:function(){var t=this.rendered;if(t||(this.$pageSize=this.$insightsChrome.find("select[name=items-per-page]")),e.prototype.render.call(this),!t){var i=this;this.$inputFilterType=this.$insightsChrome.find('.pastconnections input[name="table-filter-type"]').on("change",function(){var e=n(this).val();i._limitType=e,n.cookie("filterInsightsPastConnectionsType",e),i.load(!0)}),this.$insightsChrome.find('.pastconnections input[name="table-filter-type"][value="'+(n.cookie("filterInsightsPastConnectionsType")||"all")+'"]').click(),this.calendar=new c({el:"#pastconnections-datetimeNav",is7Day:!0});var a=this.calendar.getDateRange();a&&(i._limitStart=a.start,i._limitEnd=a.end,i.load(!0)),this.calendar.$el.on("change",function(e,t){t&&(i._limitStart=t.start,i._limitEnd=t.end,i.load(!0))})}},load:function(t){t=t||!this.collection,(!this.collection||t)&&this._limitStart&&this._limitEnd&&(this.collection&&this.collection.reset(),e.prototype.load.call(this,t,{data:{type:this._limitType,start:this._limitStart/1e3,end:this._limitEnd/1e3}}))},searchable:function(){var t=n.proxy(function(e){var t=this.options.app.collection("Devices").getDeviceFromMac(e.get("ap_mac"));t&&e.addSearchString("device_name",t.name());var i=this.options.app.collection("Clients").getClientFromMac(e.get("mac"));i&&e.addSearchString("alias_name",i.name())},this),i=n.proxy(function(){this.collection.each(t),this.trigger("search:indexed")},this);this.listenTo(this.collection,"change",t),this.listenTo(this.collection,"add",t),this.listenTo(this.collection,"reset",i),i(),e.prototype.searchable.call(this)},remove:function(){this.stopListening(this.options.app.collection("Clients")),this.stopListening(this.options.app.collection("Devices")),this.$insightsChrome.find('.pastconnections input[name="table-filter-type"]').off("change"),this.calendar.$el.off("change"),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/model/Guest",["unifi/model/Model","backbone","ubnt/backgrid"],function(e,t,i){"use strict";return e.extend({name:function(){return this.get("name")||this.get("hostname")||this.get("mac")},authorization:function(){var e,t,a,n;switch(this.get("authorized_by")){case"none":return"None";case"password":return"Password";case"api":return"API";case"voucher":return t=this.get("voucher_code"),e="Voucher",t&&(e+="["+t+"]"),e;case"credit":return a=this.get("package"),n=this.get("amount"),e=this.get("payment_cardtype")||"Credit Card",a&&n&&(e+="("+a+","+i.Formatters.Currency.fromRaw(this)+")"),e;case"paypal":return"PayPal";default:return"None"}},extend:function(e){return this.sync("extend",this,e)},sync:function(e,i,a){switch(e){case"delete":a.contentType="application/json; charset=utf-8",a.type="POST",a.url="/api/s/"+SITE.name+"/cmd/hotspot",a.data=JSON.stringify({_id:i.id,cmd:"terminate"});break;case"extend":a.contentType="application/json; charset=utf-8",a.type="POST",a.url="/api/s/"+SITE.name+"/cmd/hotspot",a.data=JSON.stringify({_id:i.id,cmd:"extend"})}return t.sync.call(this,e,i,a)},toSearch:function(){return{name:this.attributes.name,ap:this.attributes.ap_mac,"package":this.attributes["package"],amount:this.attributes.amount,authorization:this.authorization(),mac:this.attributes.mac,hostname:this.attributes.hostname}}})}),define("unifi/collection/Guests",["unifi/collection/Collection","backbone","unifi/model/Guest"],function(e,t,i){"use strict";return e.extend({model:i,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/guest"},sync:function(e,i,a){switch(e){case"read":a.type="POST",a.data=JSON.stringify(a.data)}return t.sync.call(this,e,i,a)}})}),define("unifi/model/insights/PastGuestAuthorization",["unifi/model/Guest","backbone","ubnt/backgrid","libs/moment"],function(e,t,i,a){"use strict";return e.extend({toSearch:function(){return{name:this.attributes.name,hostname:this.attributes.hostname,mac:this.attributes.mac,ap:this.attributes.ap_mac,"package":this.attributes["package"],amount:this.attributes.amount,authorization:this.authorization()}}})}),define("unifi/collection/insights/PastGuestAuthorizations",["backbone","underscore","unifi/collection/Guests","unifi/model/insights/PastGuestAuthorization"],function(e,t,i,a){"use strict";return i.extend({model:a,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/authorization"},sync:function(i,a,n){switch(n=n||{},i){case"read":n.contentType="application/json; charset=utf-8",n.type="POST",n.data=JSON.stringify(t.extend(n.data||{}))}return e.sync.call(this,i,a,n)}})}),define("text!includes/insights/pastGuestAuthorizationsTemplate.html",[],function(){return'<div class="data-table untitled">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n</div>'}),define("unifi/view/insights/PastGuestAuthorizationsView",["unifi/view/app/ListContentView","libs/backgrid","ubnt/backgrid","underscore","jquery","msg/Msg","unifi/collection/insights/PastGuestAuthorizations","text!includes/insights/pastGuestAuthorizationsTemplate.html","unifi/view/statistics/DatetimeNavView"],function(e,t,i,a,n,o,r,s,c){"use strict";return e.extend({id:"pastguestauthorizations",_templateId:s,_collectionType:{name:"PastGuestAuthorizations",Class:r},_pageable:!0,initialize:function(t){this.$insightsChrome=n("#insightsChrome"),e.prototype.initialize.call(this,t),this.$el.removeClass("content");var i=this;this.listenTo(this.options.app.collection("Clients"),"change:name",function(e){var t,a=i.collection.where({mac:e.get("mac")});for(t=0;t<a.length;t++)a[t].trigger("change",a[t])}),this.listenTo(this.options.app.collection("Devices"),"change:name",function(e){var t,a=i.collection.where({ap_mac:e.get("mac")});for(t=0;t<a.length;t++)a[t].trigger("change",a[t])})},columns:function(){var e=this;return[{name:"mac",label:o.G_InsightsNameMACAddress,editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:function(t){var i=e.options.app.collection("Clients"),a=i.getClientFromMac(t.get("mac"));return a||(a=t),a.name()},toRaw:function(e){return e}}}),callback:function(t){var i=e.options.app.collection("Clients"),a=i.getClientFromMac(t.get("mac"));a?a.set({blocked:t.get("blocked")},{silent:!0}):a=t,e.options.app.routers.clients.views.index.property(a)},title:"mac"},{name:"package",label:o.G_Package,editable:!1,cell:"string"},{name:"amount",label:o.G_Amount,editable:!1,cell:i.Cells.ComplexCell.extend({formatter:i.Formatters.Currency})},{name:"authorized_by",label:o.G_InsightsAuthorizedBy,editable:!1,cell:i.Cells.ModelCell.extend({callback:"authorization"})},{name:"start",label:o.G_Start,editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Moment})},{name:"duration",label:o.G_Duration,editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Duration})},{name:"tx_bytes",label:o.G_Down,editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Bytes})},{name:"rx_bytes",label:o.G_Up,editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Bytes})},{name:"ip",label:o.G_IP,editable:!1,cell:"string"},{name:"ap_mac",label:o.G_InsightsLastAP,editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:function(t){var i=e.options.app.collection("Devices"),a=i.getDeviceFromMac(t.get("ap_mac"));return a||(a=t),a.name()},toRaw:function(e){return e}}}),callback:function(t){var i=e.options.app.collection("Devices"),a=i.getDeviceFromMac(t.get("ap_mac"));a||(a=t),e.options.app.routers.devices.views.index.property(a)}}]},render:function(){var t=this.rendered;if(t||(this.$pageSize=this.$insightsChrome.find("select[name=items-per-page]")),e.prototype.render.call(this),!t){var i=this;this.calendar=new c({el:"#pastguestauthorizations-datetimeNav",is7Day:!0});var a=this.calendar.getDateRange();a&&(i._limitStart=a.start,i._limitEnd=a.end,i.load(!0)),this.calendar.$el.on("change",function(e,t){t&&(i._limitStart=t.start,i._limitEnd=t.end,i.load(!0))})}},load:function(t){t=t||!this.collection,(!this.collection||t)&&this._limitStart&&this._limitEnd&&(this.collection&&this.collection.reset(),e.prototype.load.call(this,t,{data:{start:this._limitStart/1e3,end:this._limitEnd/1e3}}))},searchable:function(){var t=n.proxy(function(e){var t=this.options.app.collection("Devices").getDeviceFromMac(e.get("ap_mac"));t&&e.addSearchString("device_name",t.name());var i=this.options.app.collection("Clients").getClientFromMac(e.get("mac"));i&&e.addSearchString("alias_name",i.name())},this),i=n.proxy(function(){this.collection.each(t),this.trigger("search:indexed")},this);this.listenTo(this.collection,"change",t),this.listenTo(this.collection,"add",t),this.listenTo(this.collection,"reset",i),i(),e.prototype.searchable.call(this)},remove:function(){this.stopListening(this.options.app.collection("Clients")),this.stopListening(this.options.app.collection("Devices")),this.calendar.$el.off("change"),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/model/insights/SwitchStats",["underscore","unifi/model/PortModel","ubnt/backgrid","msg/Msg"],function(e,t,i,a){"use strict";return t.extend({initialize:function(t,i){this.on("change:device change:port_idx",e.bind(this.generateId,this))},speed:function(){if(this.get("up")){var e=this.get("speed");return 1e3>e?e+="M":(e/=1e3,e+="G"),e}return""},linkUsage:function(e){var t,i;return this.get("up")?(t="tx"===e?this.get("tx_bytes-r"):"rx"===e?this.get("rx_bytes-r"):this.get("bytes-r"),i=8*t*100/(1024*this.get("speed")*1024),i.toFixed(2)):0},opMode:function(){return this.get("aggregated_by")?"aggregate":this.get("op_mode")||"switch"},opModeText:function(){var e=this.opMode();return"switch"===e?a.G_PropertiesSwitching:"aggregate"===e?a.G_PropertiesAggregate:"mirror"===e?a.G_PropertiesMirroring:""},poeMode:function(){return this.get("port_poe")?"switch"!==this.get("op_mode")||this.get("masked")?"":this.get("poe_mode")||"off":""},poeModeText:function(){var e=this.poeMode();return"auto"===e?a.G_PropertiesPoEModePoEPlus:"pasv24"===e?a.G_PropertiesPoEModePassive:a.G_InsightsPoeDisabled},isPDDetected:function(){return"auto"===this.poeMode()&&this.get("poe_enable")},poeDetection:function(){var e=this.poeMode();return"auto"===e?this.get("poe_enable")?this.get("poe_good")?a.G_InsightsPoeGood:a.G_InsightsPoeCpdHigh:a.G_InsightsPoeNotDetected:"pasv24"===e?a.G_InsightsPoePassive:""},isPoeEnabled:function(){return"off"!==this.poeMode()&&""!==this.poeMode()},isPassivePoe:function(){return"pasv24"===this.poeMode()},isPoePowerOn:function(){return this.isPassivePoe()||this.isPDDetected()},poeVoltage:function(){var e=this.poeMode();return this.isPDDetected()||"pasv24"===e?this.get("poe_voltage"):""},generateId:function(){this.set("id",this.get("device")+"-"+this.get("port_idx"))}})}),define("unifi/collection/insights/SwitchStats",["backbone","underscore","unifi/collection/Collection","unifi/model/insights/SwitchStats"],function(e,t,i,a){"use strict";return i.extend({model:a,bySite:!0})}),define("text!includes/insights/switchStatsTemplate.html",[],function(){return'<div class="data-table untitled">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n</div>'}),define("unifi/view/insights/SwitchStatsView",["unifi/view/app/ListContentView","libs/backgrid","ubnt/backgrid","ubnt/view/dialogs/ConfirmDialogView","underscore","jquery","msg/Msg","unifi/collection/PortConf","unifi/collection/insights/SwitchStats","text!includes/insights/switchStatsTemplate.html"],function(e,t,i,a,n,o,r,s,c,l){"use strict";return e.extend({id:"switchstats",_templateId:l,_collectionType:{name:"SwitchStats",Class:c},_pageable:!0,initialize:function(t){this.$insightsChrome=o("#insightsChrome"),e.prototype.initialize.call(this,t),this.$el.removeClass("content")},load:function(e,t){"resolved"!==this._loaded.state()&&(this.collection=new c,this.devices=this.app.collection("Devices"),this.devices&&n.each(this.devices.where({type:this.devices.typeMap["switch"]}),this.onSwitchAdd),this.listenTo(this.devices,"add",this.onSwitchAdd),this.listenTo(this.devices,"remove",this.onSwitchRemove),this.listenTo(this.devices,"add remove change",function(){this.trigger("device_change")}),this._loaded.resolve())},onSwitchAdd:function(e){e.get("type")===e.typeMap["switch"]&&(this.listenTo(e,"syncPortTable",o.proxy(function(){this.resetSwitchStats(e)},this)),this.resetSwitchStats(e))},onSwitchRemove:function(e){e.get("type")===e.typeMap["switch"]&&(this.collection.remove(this.collection.where({device:e.get("mac")})),this.stopListening(e,"syncPortTable"))},resetSwitchStats:function(e){var t=this.collection.where({device:e.get("mac")});e.collections.portTable.each(function(e){var i=n.find(t,function(t){return e.get("port_idx")===t.get("port_idx")});i?i.set(e.attributes):this.collection.add(e.toJSON())},this)},dependencies:function(){var e={PortConf:s},t=[],i={},a=this;n.each(e,function(e,a){t.push(i[a]=o.Deferred())},this),o.when.apply(o,t).then(function(){a._dependencies.resolve()},function(){a._dependencies.reject()}),n.each(e,function(e,t){this.app.collection(t,{fetch:{reload:!1,deferred:i[t]}},e)},this)},columns:function(){var e=this;return[{name:"diagram",customClass:"column-diagram",editable:!1,sortable:!1,headerCell:i.Headers.emptyHeader,cell:i.Cells.ComplexHtmlCell.extend({formatter:{fromRaw:function(e){var t=o('<div class="properties"<div class="properties"><div class="diagram switch port24"><div class="port port-'+e.id+" "+e.diagramClasses()+'" data-port="'+e.id+'"><div class="status"><div class="poe"></div><div class="mirror"></div><div class="block"></div></div></div></div></div>');return t.find(".port").attr("title","Port "+e.get("port_idx")).tooltip({show:!1,hide:!1,track:!0,content:function(){return e.diagramTooltip()}}),t},toRaw:function(e){return e}}}),callback:this.rowView},{name:"device",label:r.G_InsightsSwitch,customClass:"column-device",editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:function(t){var i=e.app.collection("Devices"),a=i.getDeviceFromMac(t.get("device"));return a?a.name():t.get("device")},toRaw:function(e){return e}}}),callback:this.rowView},{name:"port_idx",label:r.G_Port,customClass:"column-port_idx",editable:!1,cell:"integer"},{name:"name",label:r.G_Name,customClass:"column-name",editable:!1,cell:"string"},{name:"poe_summary",label:r.G_PropertiesPoE,customClass:"column-poe_summary",editable:!1,sortable:!1,headerCell:i.Headers.noSortHeader,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:o.proxy(function(e){var t=e.poeModeText();return"auto"==e.get("poe_mode")&&e.get("poe_enable")?e.get("poe_power")+"w":t},this),toRaw:function(e){return e}}})},{name:"op_mode",label:r.G_InsightsMode,customClass:"column-op_mode",editable:!1,sortValue:"opModeText",headerCell:i.Headers.customSortHeader,cell:i.Cells.ModelCell.extend({callback:"opModeText"})},{name:"portconf_id",label:r.G_PropertiesNetworksVLANs,customClass:"column-portconf_id",editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:o.proxy(function(t){if(t.get("aggregated_by"))return r.G_PropertiesAggregatedByPort+" "+t.get("aggregated_by");if("mirror"==t.get("op_mode"))return r.G_PropertiesMirroringPort+" "+t.get("mirror_port_idx");var i=t.get("portconf_id");if(i){var a=e.app.collection("PortConf").get(i);if(a)return a.get("name")}},this),toRaw:function(e){return e}}})},{name:"speed",label:r.G_InsightsNetworkLinkStatus,customClass:"column-speed",editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:function(e){if(e.get("up")){var t=e.speed();return t+=" ",t+=e.get("full_duplex")?r.G_PropertiesFullDuplexAbbrv:r.G_PropertiesHalfDuplexAbbrv,e.get("is_uplink")&&(t+=" ("+r.G_PropertiesUplink+")"),t}return""},toRaw:function(e){return e}}})},{name:"stp_state",label:r.G_InsightsSTP,customClass:"column-stp_state",editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:o.proxy(function(e){if(e.get("up")){if("discarding"===e.get("stp_state"))return r.G_InsightsSTPDiscarding;if("forwarding"===e.get("stp_state"))return r.G_InsightsSTPForwarding;if("disabled"===e.get("stp_state"))return r.G_InsightsSTPDisabled}return""},this),toRaw:function(e){return e}}})},{name:"tx_bytes",label:r.G_DevicesTX,customClass:"column-tx_bytes-abbrv",editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Bytes})},{name:"rx_bytes",label:r.G_DevicesRX,customClass:"column-rx_bytes-abbrv",editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Bytes})},{name:"tx_bytes-r",label:r.G_PropertiesTXRate,customClass:"column-tx_bytes-r",editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.BitsPerSecond})},{name:"rx_bytes-r",label:r.G_PropertiesRXRate,customClass:"column-rx_bytes-r",editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.BitsPerSecond})},{name:"bytes-r",label:r.G_Activity,customClass:"column-bytes-r",editable:!1,cell:i.Cells.ComplexHtmlCell.extend({formatter:{fromRaw:o.proxy(function(e){var t=e.linkUsage("tx"),a=e.linkUsage("rx"),r=o('<div class="grid green-cells quarter"></div>'),s=o('<div class="grid green-cells quarter"></div>'),c=o('<div class="grid-wrapper"></div>'),l=[90,80,70,60,50,40,30,20,10,0];return n.each(l,function(e){t>e&&r.append(o('<span class="quarter red"></span>')),a>e&&s.append(o('<span class="quarter blue"></span>'))}),c.append(r.attr("data-value",t).attr("title","Tx: "+i.Formatters.BitsPerSecond.fromRaw(e.get("tx_bytes-r")))),c.append(s.attr("data-value",a).attr("title","Rx: "+i.Formatters.BitsPerSecond.fromRaw(e.get("rx_bytes-r")))),c},this),toRaw:o.proxy(function(e){return e.linkUsage()},this)}})},{name:"poe_mode",label:r.G_InsightsPoeMode,customClass:"column-poe_mode",editable:!1,sortValue:"poeModeText",headerCell:i.Headers.customSortHeader,cell:i.Cells.ModelCell.extend({callback:"poeModeText"})},{name:"poe_detection",label:r.G_InsightsPoeDetection,customClass:"column-poe_detection",editable:!1,sortValue:"poeDetection",headerCell:i.Headers.customSortHeader,cell:i.Cells.ModelCell.extend({callback:"poeDetection"})},{name:"poe_class",label:r.G_InsightsPoeClass,customClass:"column-poe_class",editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:o.proxy(function(e){return e.isPDDetected()?e.get("poe_class"):""},this),toRaw:function(e){return e}}})},{name:"poe_power",label:r.G_InsightsPoePower,customClass:"column-poe_power",editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:o.proxy(function(e){return e.isPDDetected()?e.get("poe_power"):""},this),toRaw:function(e){return e}}})},{name:"poe_voltage",label:r.G_InsightsPoeVoltage,customClass:"column-poe_voltage",editable:!1,sortValue:"poeVoltage",headerCell:i.Headers.customSortHeader,cell:i.Cells.ModelCell.extend({callback:"poeVoltage"})},{name:"poe_current",label:r.G_InsightsPoeCurrent,customClass:"column-poe_current",editable:!1,cell:i.Cells.ComplexCell.extend({formatter:{fromRaw:o.proxy(function(e){return e.isPDDetected()?e.get("poe_current"):""},this),toRaw:function(e){return e}}})},{name:"tx_bytes",label:r.G_InsightsCountersTxBytes,customClass:"column-tx_bytes",editable:!1,cell:"integer"},{name:"tx_packets",label:r.G_InsightsCountersTxFrames,customClass:"column-tx_packets",editable:!1,cell:"integer"},{name:"tx_multicast",label:r.G_InsightsCountersTxMulticast,customClass:"column-tx_multicast",editable:!1,cell:"integer"},{name:"tx_broadcast",label:r.G_InsightsCountersTxBroadcast,customClass:"column-tx_broadcast",editable:!1,cell:"integer"},{name:"tx_errors",label:r.G_InsightsCountersTxErrors,customClass:"column-tx_errors",editable:!1,cell:"integer"},{name:"rx_bytes",label:r.G_InsightsCountersRxBytes,customClass:"column-rx_bytes",editable:!1,cell:"integer"},{name:"rx_packets",label:r.G_InsightsCountersRxFrames,customClass:"column-rx_packets",editable:!1,cell:"integer"},{name:"rx_multicast",label:r.G_InsightsCountersRxMulticast,customClass:"column-rx_multicast",editable:!1,cell:"integer"},{name:"rx_broadcast",label:r.G_InsightsCountersRxBroadcast,customClass:"column-rx_broadcast",editable:!1,cell:"integer"},{name:"rx_errors",label:r.G_InsightsCountersRxErrors,customClass:"column-rx_errors",editable:!1,cell:"integer"},{name:"_id",label:r.G_Actions,customClass:"column-actions",editable:!1,sortable:!1,headerCell:i.Headers.noSortHeader,cell:i.Cells.ActionsCell.extend({actions:{edit:{icon:"ubnt-icon-edit",requiresAdminPrivilege:!0,buttonClasses:"narrow",callback:this.rowEdit,render:function(e){return!e.get("masked")}},restart:{icon:"ubnt-icon-rotate",text:r.G_InsightsPowerCycle,callback:this.rowPowerCycle,requiresAdminPrivilege:!0,buttonClasses:"narrow",render:function(e){return e.get("poe_enable")}},clearCounters:{icon:"ubnt-icon-trash",text:r.G_InsightsClear,callback:this.rowClearCounters,requiresAdminPrivilege:!0,buttonClasses:"narrow",render:function(e){return!0}}}})}]},render:function(){var t=this.rendered;t||(this.$pageSize=this.$insightsChrome.find("select[name=items-per-page]")),e.prototype.render.call(this)},grid:function(){e.prototype.grid.call(this);var t=this.grids.content,i=this.$insightsChrome.find(".buttonset.switch-subtab-filters"),a=i.find("input[name=switch-subtab-filter]"),r=[];this.$switchFilter=this.$insightsChrome.find(".switchstats .switch-filter select"),this.$switchFilter.on("change",o.proxy(function(e){var i=o(e.target).val();i?(t.setFilter("device",i,1),t.$el.addClass("single-switch")):(t.removeFilter("device"),t.$el.removeClass("single-switch")),o.cookie("filterInsightsSwitchStatsSwitch",i)},this)),this.listenTo(this,"device_change",n.debounce(this.setupSwitchFilter,250)),this.setupSwitchFilter(),this.$switchFilter.val(o.cookie("filterInsightsSwitchStatsSwitch")||"overview").selectmenu("close").trigger("change"),this.$poeFilter=this.$insightsChrome.find(".switchstats .poe-filter select");var s=this.$poeFilter;this.$poeFilter.on("change",o.proxy(function(e){var i=o(e.target).val();t.removeFilter("isPoeEnabled"),t.removeFilter("isPassivePoe"),t.removeFilter("isPoePowerOn"),"enabled"==i?t.setFilter("isPoeEnabled",!0,1):"powerOn"==i?t.setFilter("isPoePowerOn",!0,1):"passive"==i?t.setFilter("isPassivePoe",!0,1):"disabled"==i&&t.setFilter("isPoeEnabled",!1,1),o.cookie("filterInsightsSwitchStatsPoeMode",i)},this)),this.setupPoeFilter(),this.$poeFilter.val(o.cookie("filterInsightsSwitchStatsPoeMode")||"").selectmenu("close").trigger("change"),this.$clearCounters=this.$insightsChrome.find(".switchstats .clear-counters select");var c=this.$clearCounters;this.$clearCounters.on("change",o.proxy(function(e){var t=o(e.target),i=t.val(),a=this.app.collection("Devices"),n=i&&"all"!=i?a.getDeviceFromMac(i):null;i&&(this.clearCounters(n),c.val(c.find("option:first").val()).selectmenu("close"))},this)),this.listenTo(this,"device_change",n.debounce(this.setupSwitchClearCounters,250)),this.setupSwitchClearCounters(),this.$linkStatusFilter=this.$insightsChrome.find(".switchstats .network-link-filter select"),this.$linkStatusFilter.on("change",o.proxy(function(e){var i=o(e.target).val();"connected"==i?t.setFilter("up",!0,1):"disconnected"==i?t.setFilter("up",!0,-1):t.removeFilter("up"),o.cookie("filterInsightsSwitchStatsLinkStatus",i)},this)),this.setupLinkFilter(),this.$linkStatusFilter.val(o.cookie("filterInsightsSwitchStatsLinkStatus")||"all").selectmenu("close").trigger("change"),n.each(a,function(e,t){r.push(e.value)}),a.filter('[value="'+(o.cookie("filterInsightsSwitchStatsSubtab")||"overview")+'"]').click(),a.on("change",function(e){var i=o(this),a=i.val();s.closest(".ui-selectmenu-parent").hide(),c.closest(".ui-selectmenu-parent").hide(),"poe"===a?(t.setFilter("port_poe",!0,1),s.closest(".ui-selectmenu-parent").show()):("counters"===a&&c.closest(".ui-selectmenu-parent").show(),t.removeFilter("port_poe"),s.val("").selectmenu("close").trigger("change")),t.$el.removeClass(r.join(" ")).addClass(a||"overview"),o.cookie("filterInsightsSwitchStatsSubtab",a)}).filter(":checked").trigger("change")},searchable:function(){var t=this.app.collection("Devices"),i=o.proxy(function(e){e.addSearchString("device-name",t.getDeviceFromMac(e.get("device")).name())},this),a=o.proxy(function(){this.collection.each(i),this.trigger("search:indexed")},this);this.listenTo(this.collection,"change",i),this.listenTo(this.collection,"add",i),this.listenTo(this.collection,"reset",a),a(),e.prototype.searchable.call(this)},setupLinkFilter:function(){var e=this.$linkStatusFilter.find("options:selected").val();this.$linkStatusFilter.empty(),this.$linkStatusFilter.append(o('<option value="all"></option>').text(r.G_All)),this.$linkStatusFilter.append(o('<option value="connected"></option>').text(r.G_APConnected)),this.$linkStatusFilter.append(o('<option value="disconnected"></option>').text(r.G_APDisconnected)),this.$linkStatusFilter.find('option[value="'+(e||"")+'"]').prop("selected",!0),this.$linkStatusFilter.selectmenu("refresh")},setupSwitchFilter:function(){var e=this.$switchFilter.find("option:selected").val();this.$switchFilter.empty(),this.$switchFilter.append(o('<option value=""></option>').text(r.G_All));var t=this.devices.where({type:this.devices.typeMap["switch"],adopted:!0}).sort(function(e,t){return e.name()>t.name()?1:e.name()<t.name()?-1:0});this.devices&&n.each(t,o.proxy(function(e){this.$switchFilter.append(o("<option />").attr("value",e.get("mac")).text(e.name()))},this)),this.$switchFilter.find('option[value="'+(e||"")+'"]').prop("selected",!0),this.$switchFilter.selectmenu("refresh")},setupPoeFilter:function(){var e=this.$poeFilter.find("option:selected").val(),t={enabled:r.G_InsightsPoeEnabled,powerOn:r.G_InsightsPoePowerOn,passive:r.G_InsightsPoePassive,disabled:r.G_InsightsPoeDisabled},i=this.$poeFilter;this.$poeFilter.empty(),this.$poeFilter.append(o('<option value=""></option>').text(r.G_All)),n.each(t,function(e,t){i.append(o('<option value="'+t+'"></option>').text(e))}),this.$poeFilter.find('option[value="'+(e||"")+'"]').prop("selected",!0),this.$poeFilter.selectmenu("refresh"),this.$poeFilter.closest(".ui-selectmenu-parent").css({position:"static",left:0})},setupSwitchClearCounters:function(){var e=this.$clearCounters.find("option:selected").val();this.$clearCounters.empty(),this.$clearCounters.append(o('<option value="none"></option>')),this.$clearCounters.append(o('<option value="all"></option>').text(r.G_All)),this.devices&&n.each(this.devices.where({type:this.devices.typeMap["switch"]}),o.proxy(function(e){e.get("adopted")&&this.$clearCounters.append(o("<option />").attr("value",e.get("mac")).text(e.name()))},this)),this.$clearCounters.find('option[value="'+(e||"")+'"]').prop("selected",!0),this.$clearCounters.selectmenu("refresh"),this.$clearCounters.closest(".ui-selectmenu-parent").css({position:"static",left:0})},rowEdit:function(e){this.rowView(e,!0)},rowView:function(e,t){var i=this.app.collection("Devices"),a=i.getDeviceFromMac(e.get("device")),n=this.app.routers.devices.views.index.property(a);n.statsPortForm(e,t)},clearAllCounters:function(){this.app.collection("Devices");o.ajax({contentType:"application/json; charset=utf-8",url:"/api/s/"+SITE.name+"/cmd/devmgr",type:"POST",data:JSON.stringify({cmd:"clear-all-switch-counters"}),success:function(e,t,i){this.devices&&n.each(this.devices.where({type:this.devices.typeMap["switch"]}),o.proxy(function(e){e.fetch()},this))},error:function(e,t,i){this.app.views.app.flash("error","Error",r.apiError(e))}})},clearCounters:function(e,t){var i=this.app.collection("Devices"),n=e?i.getDeviceFromMac(e.get("mac")):void 0,s=e?e.get("mac"):void 0,c=t?t:void 0,l={mac:s,port_idx:c},d=this.clearAllCounters,m=r.G_ConfirmClearAllCounters;t?(d=n.clearPortCounters,m=r.localize(r.G_ConfirmClearPortCounters,e.name(),t)):e&&(d=n.clearSwitchCounters,m=r.localize(r.G_ConfirmClearSwitchCounters,e.name())),(new a).show(m,o.proxy(function(){t||e?d.call(n,{data:l,success:function(e,t,i){n&&n.fetch()},error:o.proxy(function(e,t,i){this.app.views.app.flash("error","Error",r.apiError(e))},this)}):d.call(this)},this))},rowClearCounters:function(e){var t=this.app.collection("Devices"),i=t.getDeviceFromMac(e.get("device")),a=e.get("port_idx");this.clearCounters(i,a)},rowPowerCycle:function(e){var t=this.app.collection("Devices"),i=t.getDeviceFromMac(e.get("device"));(new a).show(r.localize(r.N_ConfirmPowerCyclePort,e.get("port_idx")),o.proxy(function(){i.powerCyclePort({data:{port_idx:e.get("port_idx")},success:function(e,t,a){i.fetch()},error:o.proxy(function(e,t,i){this.app.views.app.flash("error","Error",r.apiError(e))},this)})},this))},remove:function(){this.stopListening(this.devices),this.devices&&n.each(this.devices.where({type:this.devices.typeMap["switch"]}),function(e){this.stopListening(e)},this),this.$switchFilter.off("change"),this.stopListening(this,"device_change"),this.$poeFilter.off("change"),this.$clearCounters.off("change"),this.$insightsChrome.find(".buttonset.switch-subtab-filters").find("input[name=switch-subtab-filter]").off("change"),this.stopListening(this.collection),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/model/insights/RemoteUserVPNStats",["jquery","underscore","unifi/model/Model","ubnt/backgrid","msg/Msg","libs/moment"],function(e,t,i,a,n,o){"use strict";return i.extend({toSearch:function(){return{"interface":this.gw_interface(),remote_ip:this.remote_ip(),user:this.user()}},gw_interface:function(){return this.get("interface")},remote_ip:function(){return this.get("remote_ip")},remoteip2long:function(){return e.ip2long(this.get("remote_ip"))},rx_bytes:function(){return this.get("rx_bytes")},rx_packets:function(){return this.get("rx_packets")},tx_bytes:function(){return this.get("tx_bytes")},tx_packets:function(){return this.get("tx_packets")},uptime:function(e){return e=e||this.get("uptime"),e>0?a.Formatters.Duration.fromRaw(e||0):""},user:function(){return this.get("user")},up:function(){return this.get("up")}})}),
define("unifi/collection/insights/RemoteUserVPNStats",["backbone","underscore","unifi/collection/Collection","unifi/model/insights/RemoteUserVPNStats"],function(e,t,i,a){"use strict";return i.extend({model:a,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/remoteuservpn"},sync:function(i,a,n){switch(n=n||{},i){case"read":n.contentType="application/json; charset=utf-8",n.type="POST",n.data=JSON.stringify(t.extend(n.data||{}))}return e.sync.call(this,i,a,n)}})}),define("text!includes/insights/remoteUserVPNStatsTemplate.html",[],function(){return'<div class="data-table untitled">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n</div>'}),define("unifi/view/insights/RemoteUserVPNStatsView",["unifi/view/app/ListContentView","libs/backgrid","ubnt/backgrid","underscore","jquery","msg/Msg","unifi/collection/insights/RemoteUserVPNStats","text!includes/insights/remoteUserVPNStatsTemplate.html","ubnt/view/dialogs/ConfirmDialogView"],function(e,t,i,a,n,o,r,s,c){"use strict";return e.extend({id:"remoteuservpnstats",_templateId:s,_collectionType:{name:"RemoteUserVPNStats",Class:r},_pageable:!0,initialize:function(t){this.$insightsChrome=n("#insightsChrome"),e.prototype.initialize.call(this,t),this.$el.removeClass("content")},columns:function(){return[{name:"interface",label:o.G_RemoteUserVPNInterface,editable:!1,cell:"string"},{name:"remote_ip",label:o.G_RemoteUserVPNRemoteIP,editable:!1,sortValue:"remoteip2long",headerCell:i.Headers.customSortHeader,cell:"string"},{name:"user",label:o.G_RemoteUserVPNUser,editable:!1,cell:"string"},{name:"rx_packets",label:o.G_RemoteUserVPNRxPackets,editable:!1,cell:"integer"},{name:"rx_bytes",label:o.G_RemoteUserVPNRxBytes,editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Bytes})},{name:"tx_packets",label:o.G_RemoteUserVPNTxPackets,editable:!1,cell:"integer"},{name:"tx_bytes",label:o.G_RemoteUserVPNTxBytes,editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Bytes})},{name:"uptime",label:o.G_Uptime,editable:!1,cell:i.Cells.ModelCell.extend({callback:"uptime"})},{name:"_id",label:o.G_Actions,customClass:"column-actions",editable:!1,sortable:!1,headerCell:i.Headers.noSortHeader,cell:i.Cells.ActionsCell.extend({actions:{terminate:{icon:"ubnt-icon-unlink",requiresAdminPrivilege:!0,buttonClasses:"narrow",callback:this.termiteRemoteInterface,render:function(e){return!e.get("masked")}}}})}]},render:function(){var t=this.rendered;t||(this.$pageSize=this.$insightsChrome.find("select[name=items-per-page]")),e.prototype.render.call(this)},termiteRemoteInterface:function(e){var t=this;(new c).show(o.N_ConfirmTerminateRemoteUserVPNConnection,function(){n.ajax({contentType:"application/json; charset=utf-8",url:"/api/s/"+SITE.name+"/cmd/devmgr",type:"POST",data:JSON.stringify({cmd:"terminate-remote-user-vpn","interface":e.get("interface"),user:e.get("user"),remote_ip:e.get("remote_ip")}),success:function(i,a,n){var o=t.grids.content.collection.where({"interface":e.get("interface"),user:e.get("user"),remote_ip:e.get("remote_ip")});t.grids.content.removeRow(o)},error:function(e,t,i){this.app.views.app.flash("error","Error",o.apiError(e))}})})},searchable:function(){e.prototype.searchable.call(this)},remove:function(){this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/model/insights/DynamicDNSStat",["unifi/model/DynamicDNS","jquery","backbone","msg/Msg","ubnt/backgrid","libs/moment"],function(e,t,i,a,n,o){"use strict";return e.extend({toSearch:function(){return{service:this.service(),host_name:this.hostname(),server:this.server(),login:this.username(),ip:this.ip(),status:this.status(),last_updated:this.lastUpdated()}},ip:function(){return this.get("ip")},ddnsStatus:function(){switch(this.get("status")){case"good":return a.G_PropertiesDDNSStatusGood;case"failed":case"noconnect":return a.G_PropertiesDDNSStatusFailed;case"updating":return a.G_PropertiesDDNSStatusUpdating;default:return a.G_Unknown}},ip2long:function(){return t.ip2long(this.get("ip"))},lastUpdated:function(){var e=this.get("last_updated");return e>0?n.Formatters.Duration.fromRaw(e||0):""}})}),define("unifi/collection/insights/DynamicDNSStat",["backbone","underscore","unifi/collection/Collection","unifi/model/insights/DynamicDNSStat"],function(e,t,i,a){"use strict";return i.extend({model:a,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/dynamicdns"},sync:function(i,a,n){switch(n=n||{},i){case"read":n.contentType="application/json; charset=utf-8",n.type="POST",n.data=JSON.stringify(t.extend(n.data||{}))}return e.sync.call(this,i,a,n)}})}),define("text!includes/insights/DynamicDNSStatsTemplate.html",[],function(){return'<div class="data-table untitled">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n</div>'}),define("unifi/view/insights/DynamicDNSStatsView",["unifi/view/app/ListContentView","libs/backgrid","ubnt/backgrid","underscore","jquery","msg/Msg","unifi/collection/insights/DynamicDNSStat","text!includes/insights/DynamicDNSStatsTemplate.html"],function(e,t,i,a,n,o,r,s){"use strict";return e.extend({id:"dynamicdnsstats",_templateId:s,_collectionType:{name:"DynamicDNSStat",Class:r},_pageable:!0,initialize:function(t){this.$insightsChrome=n("#insightsChrome"),e.prototype.initialize.call(this,t),this.$el.removeClass("content")},columns:function(){return[{name:"service",label:o.G_PropertiesDDNSService,editable:!1,cell:"string"},{name:"status",label:o.G_PropertiesDDNSStatus,editable:!1,cell:i.Cells.ModelCell.extend({callback:"ddnsStatus"})},{name:"host_name",label:o.G_PropertiesDDNSHostname,editable:!1,cell:"string"},{name:"login",label:o.G_PropertiesDDNSUsername,editable:!1,cell:"string"},{name:"server",label:o.G_PropertiesDDNSServer,editable:!1,cell:"string"},{name:"ip",label:o.G_PropertiesDDNSIp,editable:!1,sortValue:"ip2long",headerCell:i.Headers.customSortHeader,cell:"string"},{name:"last_updated",label:o.G_PropertiesDDNSLastUpdated,editable:!1,cell:i.Cells.ModelCell.extend({callback:"lastUpdated"})},{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",requiresAdminPrivilege:!0,buttonClasses:"narrow",callback:this.rowEdit,render:function(e){return!e.get("masked")}}}})}]},rowEdit:function(e){var t,i=this.app.collection("Devices"),a=i.where({type:"ugw",site_id:SITE.id});a.length>0&&(t=this.app.routers.devices.views.index.property(a[0]),t.statsDynamicDNSForm(e,!0))},render:function(){var t=this.rendered;t||(this.$pageSize=this.$insightsChrome.find("select[name=items-per-page]")),e.prototype.render.call(this)},searchable:function(){e.prototype.searchable.call(this)},remove:function(){this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/model/insights/PortForwardStats",["jquery","underscore","unifi/model/PortForward","ubnt/backgrid","msg/Msg","libs/moment"],function(e,t,i,a,n,o){"use strict";return i.extend({toSearch:function(){return{name:this.name(),src:this.src(),fwd:this.fwd(),fwd_port:this.fwd_port(),proto:this.proto()}},name:function(){return this.get("name")},src:function(){return this.get("src")},fwd:function(){return this.get("fwd")},ip2long:function(){return e.ip2long(this.get("fwd"))},sort_port:function(e,t){for(var i=e.toString().replace("-",",").split(","),a=[],n=0;n<i.length;n++)a.push(parseInt(i[n],10)||0);if(a.length>0){if(a.sort(function(e,t){return e-t}),"ascending"===t)return a[0];if("descending"===t)return a[a.length-1]}return 0},fwd_port:function(){return this.get("fwd_port")},proto:function(){return this.get("proto")},protoText:function(){var e=this.proto();return"tcp_udp"===e?n.G_Both:"tcp"===e?n.G_PropertiesTcp:"udp"===e?n.G_PropertiesUdp:e},srcText:function(){var e=this.src();return"any"===e?n.G_PropertiesPortFwdSrcAnywhere:e},leaseDuration:function(){var e=this.get("lease_duration");return e?a.Formatters.Duration.fromRaw(e||0):""}})}),define("unifi/collection/insights/PortForwardStats",["backbone","underscore","unifi/collection/Collection","unifi/model/insights/PortForwardStats"],function(e,t,i,a){"use strict";return i.extend({model:a,bySite:!0,url:function(){return"/api/s/"+SITE.name+"/stat/portforward"},sync:function(i,a,n){switch(n=n||{},i){case"read":n.contentType="application/json; charset=utf-8",n.type="POST",n.data=JSON.stringify(t.extend(n.data||{}))}return e.sync.call(this,i,a,n)}})}),define("text!includes/insights/PortForwardStatsTemplate.html",[],function(){return'<div class="data-table untitled">\n    <div class="loading"><span><%- msg.N_Loading %></span></div>\n</div>'}),define("unifi/view/insights/PortForwardStatsView",["unifi/view/app/ListContentView","libs/backgrid","ubnt/backgrid","underscore","jquery","msg/Msg","unifi/collection/insights/PortForwardStats","text!includes/insights/PortForwardStatsTemplate.html"],function(e,t,i,a,n,o,r,s){"use strict";return e.extend({id:"portforwardstats",_templateId:s,_collectionType:{name:"PortForwardStats",Class:r},_pageable:!0,initialize:function(t){this.$insightsChrome=n("#insightsChrome"),e.prototype.initialize.call(this,t),this.$el.removeClass("content")},columns:function(){return[{name:"name",label:o.G_PortForwardName,customClass:"column-name",editable:!1,cell:"string"},{name:"src",label:o.G_PortForwardSource,customClass:"column-src",editable:!1,cell:i.Cells.ModelCell.extend({callback:"srcText"})},{name:"proto",label:o.G_PortForwardProtocol,customClass:"column-proto",editable:!1,cell:i.Cells.ModelCell.extend({callback:"protoText"})},{name:"dst_port",label:o.G_PortForwardDestinationPort,customClass:"column-dst_port",editable:!1,sortValue:n.proxy(function(e,t){return e.sort_port(e.get("dst_port"),t)},this),headerCell:i.Headers.customSortHeader,cell:"string"},{name:"fwd",label:o.G_PortForwardDestIp,customClass:"column-fwd",editable:!1,sortValue:"ip2long",headerCell:i.Headers.customSortHeader,cell:"string"},{name:"fwd_port",label:o.G_PortForwardDestPort,customClass:"column-fwd_port",editable:!1,sortValue:n.proxy(function(e,t){return e.sort_port(e.get("fwd_port"),t)},this),headerCell:i.Headers.customSortHeader,cell:"string"},{name:"rx_packets",label:o.G_PortForwardUpPkts,customClass:"column-rx_packets",editable:!1,cell:"integer"},{name:"rx_bytes",label:o.G_PortForwardUpBytes,customClass:"column-rx_bytes",editable:!1,cell:t.StringCell.extend({formatter:i.Formatters.Bytes})},{name:"lease_duration",label:o.G_PortForwardLeaseDuration,customClass:"column-duration",editable:!1,cell:i.Cells.ModelCell.extend({callback:"leaseDuration"})},{name:"_id",label:o.G_Actions,customClass:"column-actions",editable:!1,sortable:!1,headerCell:i.Headers.noSortHeader,cell:i.Cells.ActionsCell.extend({actions:{edit:{icon:"ubnt-icon-edit",requiresAdminPrivilege:!0,buttonClasses:"narrow",callback:this.rowEdit,render:function(e){return!e.get("is_upnp")}}}})}]},rowEdit:function(e){var t,i=this.app.collection("Devices"),a=i.where({type:"ugw",site_id:SITE.id});a.length>0&&(t=this.app.routers.devices.views.index.property(a[0]),t.statsPortForwardForm(e,!0))},render:function(){var t=this.rendered;t||(this.$pageSize=this.$insightsChrome.find("select[name=items-per-page]")),e.prototype.render.call(this)},grid:function(){e.prototype.grid.call(this);var t=this.grids.content,i=this.$insightsChrome.find(".buttonset.portforward-subtab-filters"),o=i.find("input[name=portforward-subtab-filter]"),r=[];a.each(o,function(e,t){r.push(e.value)}),o.on("change",function(e){var i=n(this),a=i.val();t.removeFilter("is_upnp"),"upnp"===a?t.setFilter("is_upnp",!0,1):"user_defined"===a&&t.setFilter("is_upnp",!0,-1),t.$el.removeClass(r.join(" ")).addClass(a||"all"),n.cookie("filterInsightsPortForwardStatsSubtab",a)}).filter(":checked").trigger("change"),o.filter('[value="'+(n.cookie("filterInsightsPortForwardStatsSubtab")||"all")+'"]').click()},searchable:function(){e.prototype.searchable.call(this)},remove:function(){this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/router/InsightsRouter",["unifi/router/Router","unifi/view/insights/ChromeView","unifi/view/insights/KnownClientsView","unifi/view/insights/RogueAccessPointsView","unifi/view/insights/PastConnectionsView","unifi/view/insights/PastGuestAuthorizationsView","unifi/view/insights/SwitchStatsView","unifi/view/insights/RemoteUserVPNStatsView","unifi/view/insights/DynamicDNSStatsView","unifi/view/insights/PortForwardStatsView"],function(e,t,i,a,n,o,r,s,c,l){"use strict";return e.extend({_fullyQualifiedName:"UNIFI.Routers.Insights",_associatedViews:{Chrome:t,Knownclients:i,Rogueaccesspoints:a,Pastconnections:n,Pastguestauthorizations:o,Switchstats:r,Remoteuservpnstats:s,Dynamicdnsstats:c,Portforwardstats:l},routes:{insights:"index","insights?d=:d":"index","insights/knownclients":"knownclients","insights/knownclients?d=:d":"knownclients","insights/rogueaccesspoints":"rogueaccesspoints","insights/rogueaccesspoints?d=:d":"rogueaccesspoints","insights/pastconnections":"pastconnections","insights/pastconnections?d=:d":"pastconnections","insights/pastguestauthorizations":"pastguestauthorizations","insights/pastguestauthorizations?d=:d":"pastguestauthorizations","insights/switchstats":"switchstats","insights/switchstats?d=:d":"switchstats","insights/remoteuservpnstats":"remoteuservpnstats","insights/remoteuservpnstats?d=:d":"remoteuservpnstats","insights/dynamicdnsstats":"dynamicdnsstats","insights/dynamicdnsstats?d=:d":"dynamicdnsstats","insights/portforwardstats":"portforwardstats","insights/portforwardstats?d=:d":"portforwardstats"},initialize:function(t){e.prototype.initialize.call(this,t),this.on("route",function(e){"index"!=e&&this.views.chrome&&this.views.chrome.navigate(e.replace(location.search,"")+location.search||"")})},_render:function(t){e.prototype._render.call(this,"chrome"),e.prototype._render.call(this,t,this.views.chrome.$content),this.views.chrome._contentView=this.views[t]},index:function(){this.navigate("insights/knownclients"+location.search||"",{replace:!0,trigger:!0})},knownclients:function(){this._render("knownclients")},rogueaccesspoints:function(){this._render("rogueaccesspoints")},pastconnections:function(){this._render("pastconnections")},pastguestauthorizations:function(){this._render("pastguestauthorizations")},switchstats:function(){this._render("switchstats")},remoteuservpnstats:function(){this._render("remoteuservpnstats")},dynamicdnsstats:function(){this._render("dynamicdnsstats")},portforwardstats:function(){this._render("portforwardstats")}})}),define("unifi/view/support/ChatView",["backbone","underscore","msg/Msg","jquery"],function(e,t,i,a){"use strict";return e.View.extend({initialize:function(){t.bindAll(this),this.num_agents=0,a.getJSON("https://ubnt.zendesk.com/node/ubnt/v2/availability/?callback=?",this.render)},render:function(e){var t=i.E_NoAgentsAvailable;this.num_agents=e&&e.online&&e.online>0?e.online:0,this.$link=this.$(".option-header-link").on("click",this.onLiveChatClick),this.$subtitle=this.$(".subtitle"),this.num_agents&&(t=i.G_AgentsAvailable,this.$link.removeClass("disabled")),this.$subtitle.text(t)},onLiveChatClick:function(){if(this.num_agents){var e=this.options.cloudUser.get("community_id")||this.options.cloudUser.get("name"),t=this.options.cloudUser.get("email")||"",i="";window.open("https://ubnt.zendesk.com/chat?dropboxID=20114087&user[name]="+e+"&user[email]="+t+"&user[subject]="+i+"]")}return!1},remove:function(){this.$(".option-header-link").off("click",this.onLiveChatClick),e.View.prototype.remove.apply(this,arguments)}})}),define("unifi/view/support/RequestFormView",["backbone","underscore","jquery"],function(e,t,i){"use strict";return e.View.extend({initialize:function(){t.bindAll(this),this.render()},render:function(){this.$subject=this.$("input[name=subject]"),this.$description=this.$("textarea[name=description]"),this.$el.on("submit",this.onSubmitHandler)},onSubmitHandler:function(){var e,t=this;return e=this.validateField(this.$subject),e&&(e=this.validateField(this.$description)),e&&i.ajax({url:"/api/cloud/ticket",type:"POST",data:{subject:encodeURIComponent(this.$subject.val()),message:encodeURIComponent(this.$description.val())}}).done(function(){t.$(".message").fadeIn().delay(3e3).fadeOut(),t.$subject.val(""),t.$description.val("")}),!1},validateField:function(e){var t=i.trim(e.val());return t.length>5?(e.removeClass("error"),!0):(e.addClass("error"),!1)},remove:function(){this.$el.off("submit",this.onSubmitHandler),e.View.prototype.remove.apply(this,arguments)}})}),define("text!includes/support/supportIndexTemplate.html",[],function(){return'<div class="section section-main">\n    <iframe src="https://community.ubnt.com/ubnt/plugins/custom/ubiquiti/ubnt/unifi_support"></iframe>\n\n    <div id="supportSidebar">\n        <h2><%- msg.G_SupportMoreSupportOpts %></h2>\n        <div class="options">\n\n            <div class="option-row option-request">\n                <div class="option-header">\n                    <span class="icon ubnt-icon-request"></span>\n                    <span class="title"><%- msg.G_SupportSbmtSupportReq %></span>\n                </div>\n                <form id="frmSupportRequest" action="javascript:void()" class="frm-support-request" method="post">\n                    <label for="supportRequestQuestion" class="label"><%- msg.G_SupportQuestion %>*</label>\n                    <input name="subject" type="text" id="supportRequestQuestion" placeholder="<%- msg.G_SupportBriefDescribeQuestion %>" class="input"/>\n                    <label for="supportRequestDetails" class="label"><%- msg.G_SupportDetails %>*</label>\n                    <textarea name="description" id="supportRequestDetails" placeholder="<%- msg.G_SupportFillDetails %>" class="input textarea"></textarea>\n                    <div class="message"><%- msg.G_SupportReqSubmitted %></div>\n                    <button type="submit" class="button submit"><span class="icon ubnt-icon-check"></span><%- msg.G_Submit %></button>\n                </form>\n            </div>\n\n            <div id="supportChat" class="option-row option-chat">\n                <a id="ZendeskSupportLink" href="javascript:void()" target="_blank" class="option-header option-header-link disabled">\n                    <span class="icon ubnt-icon-chat-bubbles"></span>\n                    <span class="title"><%- msg.G_SupportChatSupportAgt %></span>\n                    <span class="subtitle"></span>\n                    <span class="icon link-out"></span>\n                </a>\n            </div>\n\n            <div class="option-row option-community">\n                <a href="http://community.ubnt.com/t5/forums/postpage/board-id/UniFi" target="_blank" class="option-header option-header-link">\n                    <span class="icon ubnt-icon-people"></span>\n                    <span class="title"><%- msg.G_SupportAskComm %></span>\n                    <span class="icon link-out"></span>\n                </a>\n            </div>\n\n        </div>\n    </div>\n</div>'}),define("unifi/view/support/IndexView",["unifi/view/app/ContentView","underscore","backbone","unifi/view/support/RequestFormView","unifi/view/support/ChatView","jquery","msg/Msg","text!includes/support/supportIndexTemplate.html"],function(e,t,i,a,n,o,r,s){"use strict";return e.extend({id:"supportIndex",initialize:function(i){e.prototype.initialize.call(this,i),this.template=t.template(s),this.render()},render:function(){e.prototype.render.call(this);!this.rendered&&(this.rendered=!0)&&(this.$el.html(this.template({msg:r})),this.supportRequest=new a({el:"#frmSupportRequest"}),this.supportChat=new n({el:"#supportChat",cloudUser:this.options.app.views.app.options.cloudUser}))},remove:function(){this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/router/SupportRouter",["unifi/router/Router","unifi/view/support/ChatView","unifi/view/support/IndexView","unifi/view/support/RequestFormView"],function(e,t,i,a){"use strict";return e.extend({_fullyQualifiedName:"UNIFI.Routers.Support",_associatedViews:{Chat:t,Index:i,Request:a},routes:{support:"index","support?d=:d":"index"}})}),define("unifi/view/app/SearchableMixin",["jquery","underscore"],function(e,t){"use strict";return{searchable:function(){this._initializedCollectionSearch=!1,this._runningCollectionSearch=!1,this._completedCollectionSearch=!1,this._searchEnabled=!1,this.$search.one("focus",e.proxy(function(){this._initializedCollectionSearch=!0,this._enableSearch()},this)),this.$search.on("focus",e.proxy(function(){this._completedCollectionSearch||this._prepareCollectionSearch()},this)),this.listenTo(this.collection,"add change",this._reconcileSearch),this.listenTo(this.collection,"sync",this._reconcileSearch),this.listenTo(this,"search:indexed",e.proxy(function(){this._completedCollectionSearch=!0,this._addSearchListeners()},this)),this.$el.on("content:show",this._enableSearch),this.$el.on("content:hide",this._disableSearch)},filter:function(i,a,n){a=e.trim(a||this.$search.val()),a&&this._runningCollectionSearch?!this._delayedFilter&&(this._delayedFilter=!0)&&this.listenToOnce(this,"search:indexed",e.proxy(function(){t.each(this.grids,function(e){a?e.setFilter(null,a,this._filterMinimum,!1,n):e.removeFilter(null)},this),this._delayedFilter=!1},this)):t.each(this.grids,function(e){a?e.setFilter(null,a,this._filterMinimum,!1,n):e.removeFilter(null)},this)},_enableSearch:function(){this._initializedCollectionSearch&&(this._initializedCollectionSearch=!0,this._searchEnabled=!0,this._addSearchListeners(),e.trim(this.$search.val())&&(this._completedCollectionSearch||(this._prepareCollectionSearch(),this.filter(null,null,!0))))},_disableSearch:function(){this._initializedCollectionSearch&&(this._searchEnabled=!1,this._removeSearchListeners())},_reconcileSearch:t.throttle(function(){this._searchEnabled||(this._completedCollectionSearch=!1)},1e3),_addSearchListeners:function(){this._removeSearchListeners(),this._completedCollectionSearch?this.listenTo(this.collection,"add change",this._prepareModelSearch):this.listenTo(this.collection,"sync",this._prepareCollectionSearch)},_removeSearchListeners:function(){this.stopListening(this.collection,"add change",this._prepareModelSearch),this.stopListening(this.collection,"sync",this._prepareCollectionSearch)},_prepareModelSearch:function(e){throw new Error("_prepareModelSearch must be overriden")},_prepareCollectionSearch:function(){if(!this._runningCollectionSearch&&(this._runningCollectionSearch=!0)){this.$search.addClass("indexing");var i=e.proxy(function(e,a,n){for(var o=n*a,r=Math.min(o+a,e.length);r>o;o++)this._prepareModelSearch(e[o]);o<e.length?t.defer(i,e,a,++n):(this.trigger("search:indexed"),this.$search.removeClass("indexing"),this._runningCollectionSearch=!1)},this);i(this.collection.models,500,0)}},searchableRemove:function(){this._disableSearch(),this.$search.off(),this.stopListening(this,"search:indexed"),this.stopListening(this.collection,"add change",this._reconcileSearch),this.stopListening(this.collection,"sync",this._reconcileSearch),this.stopListening(this.collection,"add change",this._prepareModelSearch),this.stopListening(this.collection,"sync",this._prepareCollectionSearch),this.$el.off("content:show",this._enableSearch),this.$el.off("content:hide",this._disableSearch)}}}),define("unifi/view/app/PanelListContentView",["jquery","underscore","libs/moment","unifi/view/app/ListContentView","unifi/view/app/SearchableMixin","libs/backgrid","ubnt/backgrid"],function(e,t,i,a,n,o,r){"use strict";return a.extend(t.extend({},n,{_gridTitles:r.Titles.Moment,_pageable:!0,_maxRecords:1e5,_perPage:50,_autoRender:!1,_autoLoad:!1,_filterMinimum:.1,_msgRegex:/((User|AP|Switch|Gateway|Phone|Guest|Client|Voucher|Admin)\[(.*?)\])/g,initialize:function(e){a.prototype.initialize.call(this,e);var t=this;this.$container.on("show:complete",function(){t.load()}),this.$container.on("hide:complete",this._disableSearch)},render:function(){var t=this.rendered;a.prototype.render.call(this),t||this._renderBadge&&e(this._badgeSelector).append(this.$badge=e('<div class="drop-count hidden"><div class="ubnt-icon-drop"></div><div class="count"></div></div>').on("change",function(t,i){var a=e(this),n=a.find(".count");parseInt(n.text(),10)<i&&a.effect("shake",{direction:"up",times:1,distance:5},300),a[i>0?"show":"hide"](),n.text(i)}))},badge:function(){this.$badge&&this.$badge.trigger("change",this.collection.size())},columns:function(){var t=this;return[{name:"datetime",renderable:!1,cell:o.StringCell.extend({className:"title-cell"})},{name:"key",label:"Type",editable:!1,sortable:!1,headerCell:r.Headers.noSortHeader,cell:r.Cells.HtmlCell.extend({className:"icon-cell",formatter:{fromRaw:function(e){if(e){var t;switch(e.substr(4,2)){case"AD":case"CF":case"DE":t="ubnt-icon-wrench";break;case"WW":t="ubnt-icon-globe";break;case"GW":t="ubnt-icon-lock";break;case"SW":t="ubnt-icon-files";break;case"AP":t="ubnt-icon-wifi";break;case"PH":t="ubnt-icon-dial";break;case"LC":case"LU":case"LG":case"WC":case"WU":case"WG":case"HS":t="ubnt-icon-person"}return'<div class="panel-icons '+t+'"></div>'}return""},toRaw:function(e){return e}}})},{name:"msg",label:"Message",editable:!1,sortable:!1,headerCell:r.Headers.noSortHeader,cell:r.Cells.ComplexHtmlCell.extend({formatter:{fromRaw:function(a){var n=a.get("msg");if(n){var o=e("<span>"+n.replace(t._msgRegex,function(i,a,n,o,r,s){var c=o,l=n.toLowerCase(),d=t.model(l,c);return d?e('<a href="#" data-mac="'+c+'" data-type="'+n+'" class="link"></a>').text(n+" "+d.name()).prop("outerHTML"):e('<span class="deleted"></span>').text(n+" "+c).prop("outerHTML")})+"</span>");return o.find("a").on("click",t.link),o.append(e('<span class="timestamp">'+i(a.get("datetime")).format("h:mma")+"</span>")),o}},toRaw:function(e){return e}}})}]},_prepareModelSearch:function(e){for(var t,i,a=[];t=this._msgRegex.exec(e.get("msg"));)(i=this.model(t[2].toLowerCase(),t[3]))&&a.push(i.name());e.addSearchString("names",a)},model:function(e,t){var i;return t&&("ap"==e||"switch"==e||"gateway"==e||"phone"==e?i=this.collections.devices.getDeviceFromMac(t):("user"==e||"client"==e||"guest"==e)&&(i=this.collections.clients.getClientFromMac(t))),i},link:function(t){t.preventDefault();var i=e(t.target),a=i.data("mac"),n=i.data("type").toLowerCase(),o=this.model(n,a);o&&("ap"==n||"switch"==n||"gateway"==n||"phone"==n?this.app.routers.devices.views.index.property(o):("user"==n||"client"==n||"guest"==n)&&this.app.routers.clients.views.index.property(o))},load:function(e,i){var n=!this.collection;(n||e)&&(i=i||{},i.reset=!1,this._maxRecords&&(i.data=t.extend(i.data||{},{_start:0,_limit:this._maxRecords}))),a.prototype.load.call(this,e,i),n&&(this._renderBadge&&(this.listenTo(this.collection,"add",t.debounce(this.badge,250)),this.listenTo(this.collection,"remove",t.debounce(this.badge,250)),this.listenTo(this.collection,"sync",t.debounce(this.badge,250)),this.badge()),this.collections={},this.collections.devices=this.app.collection("Devices"),this.collections.clients=this.app.collection("Clients")),n||e||!this.grids.content||this.grids.content.refresh()},grid:function(){var e={columns:this.columns(),collection:this.collection,titles:this._gridTitles,footer:r.Paginators.Default},t=this.grids.content=new r.Grid(e);return t.paginate(1,this._perPage,!0),this.$el.find(".data-table").append(t.render().$el),this.$table=this.$el.find(".data-table table"),this.$loading=this.$el.find(".data-table .loading").hide(),this.listenTo(t,"backgrid:loading",this.reloading),this.listenTo(t,"backgrid:loaded",this.reloaded),this},reset:function(){this.searchableRemove(),this.$container.off("hide:complete",this._disableSearch),this.$container.off("show:complete").empty(),this.$badge&&this.$badge.remove(),this.stopListening(this.collection),this.collection=null,this.initialize(this.options)},remove:function(){this.$container.off("show:complete"),this.$container.off("hide:complete",this._disableSearch),this.$badge&&this.$badge.off("change"),this.stopListening(this.collection),this.stopListening(this.grids.content),this.rendered=!1,a.prototype.remove.apply(this,arguments)}}))}),define("text!includes/alerts/alertsTemplate.html",[],function(){return'<div class="section section-panel section-alerts">\n    <div class="section-header clearfix">\n        <h2><%- msg.G_Alerts %></h2>\n        <div class="hide-panel ubnt-icon-arrows-down right"></div>\n\n        <form class="data-filters clearfix">\n            <!--\n            <div class="buttonset">\n                <input type="radio" id="alertsFilterAll" name="filter" value="" checked="checked" /><label for="alertsFilterAll">All</label>\n                <input type="radio" id="alertsFilterWww" name="filter" value="www" /><label for="alertsFilterWww">WWW</label>\n                <input type="radio" id="alertsFilterWan" name="filter" value="wan" disabled="disabled" /><label for="alertsFilterWan">WAN</label>\n                <input type="radio" id="alertsFilterLan" name="filter" value="lan" disabled="disabled" /><label for="alertsFilterLan">LAN</label>\n                <input type="radio" id="alertsFilterWlan" name="filter" value="wlan" /><label for="alertsFilterWlan">WLAN</label>\n                <input type="radio" id="alertsFilterVoip" name="filter" value="voip" disabled="disabled" /><label for="alertsFilterVoip">VOIP</label>\n            </div>\n            -->\n\n            <div class="options">\n                <input type="checkbox" name="archived" id="showArchivedAlerts" class="checkbox left" />\n                <label for="showArchivedAlerts" class="label left"><%- msg.G_AlertsShowArchivedAlerts %></label>\n            </div>\n\n            <button type="button" class="button lightest archive-all is-admin"><%- msg.G_AlertsArchiveAll %></button>\n\n            <span class="ubnt-icon-search"></span>\n            <input type="text" name="search" class="search right" />\n        </form>\n    </div>\n\n    <div class="data-table simple">\n        <div class="loading"><span><%- msg.N_Loading %></span></div>\n    </div>\n</div>'}),define("unifi/view/app/AlertsView",["unifi/view/app/PanelListContentView","unifi/collection/Alerts","underscore","msg/Msg","jquery","ubnt/backgrid","text!includes/alerts/alertsTemplate.html"],function(e,t,i,a,n,o,r){"use strict";return e.extend({id:"alerts",_templateId:i.template(r,{msg:a}),_collectionType:{name:"Alerts",Class:t},_pageable:!1,_hideArchived:!0,_renderBadge:!0,_badgeSelector:"#toggleAlerts",render:function(){var t=this.rendered;if(e.prototype.render.call(this),!t){var i=this;this.$el.find("button.archive-all").on("click",this.archive),this.$el.find("input[name=archived]").on("change",function(){n(this).is(":checked")?i._hideArchived=!1:i._hideArchived=!0,i.load(!0)}),this.$(".hide-panel").on("click",function(){n("#toggleAlerts").trigger("click")})}},badge:function(){this.$badge&&this.$badge.trigger("change",i.size(this.collection.where({archived:!1})))},columns:function(){var t=e.prototype.columns.call(this),i=this;return t.push({name:"system",label:a.G_AlertsSystem,editable:!1,sortable:!1,headerCell:o.Headers.noSortHeader,cell:o.Cells.ComplexHtmlCell.extend({className:"system-cell",formatter:{fromRaw:function(e){var t=e.get("system");return t?n("<strong />").text(a.G_AlertsSystem+":").prop("outerHTML")+" "+n("<span />").text(t.toUpperCase()).prop("innerHTML"):""},toRaw:function(e){return e}}})}),t.push({name:"device",label:a.G_AlertsDevice,editable:!1,sortable:!1,headerCell:o.Headers.noSortHeader,cell:o.Cells.ComplexHtmlCell.extend({className:"device-cell",formatter:{fromRaw:function(e){var t=i.app.collection("Devices"),o=null;return e.get("ap")?o=t.getDeviceFromMac(e.get("ap")):e.get("gw")?o=t.getDeviceFromMac(e.get("gw")):e.get("sw")?o=t.getDeviceFromMac(e.get("sw")):e.get("ph")&&(o=t.getDeviceFromMac(e.get("ph"))),o?n("<strong />").text(a.G_AlertsDevice+":").prop("outerHTML")+" "+n("<span />").text(o.apModel()).prop("innerHTML"):""},toRaw:function(e){return e}}})}),t.push({name:"archived",label:a.G_AlertsArchive,editable:!1,sortable:!1,headerCell:o.Headers.noSortHeader,
cell:o.Cells.HtmlCell.extend({className:"icon-cell transparent-cell",formatter:{fromRaw:function(e){return e?"":'<div class="ubnt-icon-archive archive"></div>'},toRaw:function(e){return e}}}),callback:function(e){e.archive().done(function(t){t.meta&&"ok"===t.meta.rc&&(e.set({archived:!0}),i._hideArchived&&e.collection.remove(e))})}}),t},load:function(t){t=t||!this.collection,(!this.collection||t)&&(this._hideArchived?this._fetchMethod="unarchived":this._fetchMethod="",this.collection&&this.collection.reset()),e.prototype.load.call(this,t)},archive:function(){var e=this;this.collection.archiveAll().done(function(t){t.meta&&"ok"===t.meta.rc&&e.load(!0)})},grid:function(){e.prototype.grid.call(this);var t=this.grids.content;return this.$el.find(".buttonset input[name=filter]").on("change",function(e){var i=n(this).val();i?t.setFilter("system",i,1):t.removeFilter("system")}),this},remove:function(){this.$el.find("button.archive-all").off("click",this.archive),this.$el.find("input[name=archived]").off("change"),this.$(".hide-panel").off("click"),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/collection/Events",["unifi/collection/Collection","backbone","unifi/model/Event","libs/moment","underscore"],function(e,t,i,a,n){"use strict";return e.extend({model:i,bySite:!0,triggerReset:!1,url:function(){return"/api/s/"+SITE.name+"/stat/event"},comparator:function(e){return-a(e.get("datetime"))},filtered:function(e){return this.fetch(n.extend(e,{_method:"read-filtered"}))},sync:function(e,i,a){switch(a=a||{},a._method&&(e=a._method,delete a._method),e){case"read":a.url="/api/s/"+SITE.name+"/stat/event",a.contentType="application/json; charset=utf-8",a.type="POST",a.data=JSON.stringify({_sort:"-time"});break;case"read-filtered":a.url="/api/s/"+SITE.name+"/stat/event",a.contentType="application/json; charset=utf-8",a.type="POST",a.data=JSON.stringify(n.extend({_sort:"-time"},a.data||{}))}return t.sync.call(this,e,i,a)}})}),define("text!includes/events/eventsTemplate.html",[],function(){return'<div class="section section-panel section-events">\n    <div class="section-header clearfix">\n        <h2><%- msg.G_Events %></h2>\n        <div class="hide-panel ubnt-icon-arrows-down right"></div>\n\n        <form class="data-filters clearfix">\n            <div class="buttonset">\n                <input type="radio" id="eventsFilterAll" name="filter" value="" checked="checked" />\n                <label for="eventsFilterAll"><%- msg.G_EventsAll %></label>\n                <input type="radio" id="eventsFilterAdmin" name="filter" value="admin" />\n                <label for="eventsFilterAdmin"><%- msg.G_EventsAdmin %></label>\n                <input type="radio" id="eventsFilterLan" name="filter" value="lan" />\n                <label for="eventsFilterLan"><%- msg.G_EventLan %></label>\n                <input type="radio" id="eventsFilterWlan" name="filter" value="wlan" />\n                <label for="eventsFilterWlan"><%- msg.G_EventWlan %></label>\n            </div>\n\n            <div class="options">\n                <label for="eventsTimeframe" class="label left"><%- msg.G_EventsWithin %></label>\n\n                <div class="select left">\n                    <select name="time-filter" id="eventsTimeframe" class="plain">\n                        <option value="1" selected="selected">1 <%- msg.G_Hour %></option>\n                        <option value="8">8 <%- msg.G_Hours %></option>\n                        <option value="24">24 <%- msg.G_Hours %></option>\n                        <option value="48">2 <%- msg.G_Days %></option>\n                        <option value="168">7 <%- msg.G_Days %></option>\n                        <option value="336">2 <%- msg.G_Weeks %></option>\n                        <option value="720">1 <%- msg.G_Month %></option>\n                    </select>\n                </div>\n            </div>\n\n            <span class="ubnt-icon-search"></span>\n            <input type="text" name="search" class="search right" />\n        </form>\n    </div>\n\n    <div class="data-table simple">\n        <div class="loading"><span><%- msg.N_Loading %></span></div>\n    </div>\n</div>\n'}),define("unifi/view/app/EventsView",["unifi/view/app/PanelListContentView","unifi/collection/Events","underscore","jquery","msg/Msg","text!includes/events/eventsTemplate.html"],function(e,t,i,a,n,o){"use strict";return e.extend({id:"events",_templateId:i.template(o,{msg:n}),_collectionType:{name:"Events",Class:t},_fetchMethod:"filtered",_limitTimeframe:1,_limitType:null,_renderBadge:!1,_badgeSelector:"#toggleEvents",render:function(){var t=this.rendered;if(e.prototype.render.call(this),!t){this.$(".hide-panel").on("click",function(){a("#toggleEvents").trigger("click")}),this.$container.one("show",function(e){a(e.target).find("select").each(function(){var e=a(this);e.selectmenu({parent:e.parent(),appendTo:a("#columnMainPanel"),icons:{button:"ubnt-icon-arrow-down secondary-color"},position:{at:"left bottom",collision:"flip"},change:function(){e.trigger("change")}})})});var i=this;this.$el.find("select[name=time-filter]").on("change",function(){i._limitTimeframe=Math.max(parseInt(a(this).find("option:selected").val(),10),1),i.load(!0)}),this.$el.find(".buttonset input[name=filter]").on("change",function(){i._limitType=a(this).val(),i.load(!0)})}},load:function(t){t=t||!this.collection,(!this.collection||t)&&(this.collection&&this.collection.reset(),e.prototype.load.call(this,t,{data:{within:this._limitTimeframe,type:this._limitType}}))},remove:function(){this.$(".hide-panel").off("click"),this.$el.find("select[name=time-filter]").off("change"),this.$el.find(".buttonset input[name=filter]").off("change"),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),define("unifi/view/app/PropertiesView",["backbone","jquery"],function(e,t){"use strict";return e.View.extend({render:function(){if(!this.rendered&&(this.rendered=!0)){t.expr[":"].activeAccordion=function(e){return t(e).find("> .ui-accordion-header").hasClass("ui-state-active")};var e=this.$el;e.on("toggle",function(){var e=t(this),i=e.find("> .accordion");i.length===i.filter(":activeAccordion").length?e.trigger("minimize"):e.trigger("maximize")}).on("minimize",function(){t(this).find("> .accordion:activeAccordion").find(".ui-accordion-header").click()}).on("maximize",function(){t(this).find("> :not(.accordion:activeAccordion)").find(".ui-accordion-header").click()}).on("empty",function(){t(this).find("> .accordion").find(".remove").click()}),t("#columnEastHeader .toggle-all").on("click",function(){e.trigger("toggle")}),t("#columnEastHeader .remove-all").on("click",function(){e.trigger("empty")}),this.$el.sortable({axis:"y",handle:"> .accordion-header",containment:"parent",opacity:.8,tolerance:"pointer",stop:function(e,t){t.item.find("> .accordion-header").triggerHandler("focusout")}}),this.$el.on("property:remove",function(){e.find("> .accordion").size()||t("#columnEast").panel("hide","west",!0)}),this.$el.on("property:render",function(){t("#columnEast").panel("show","west",!0)}),t.Body.append(this.$detached=t('<div id="propertiesLayer" />')),this.$detached.on("click","> .properties",function(e){var i=t(e.target),a=i.hasClass("properties")?i:i.parents(".properties"),n=t.makeArray(a.siblings(".properties")).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});if(n.length){var o=parseInt(t(n[0]).css("zIndex"),10)||0;t(n).each(function(e){t(this).css("zIndex",o+e)}),a.css("zIndex",o+n.length)}})}},remove:function(){this.$el.off("toggle").off("minimize").off("maximize").off("empty"),t("#columnEastHeader .toggle-all").off("click"),t("#columnEastHeader .remove-all").off("click"),this.$el.off("property:remove"),this.$el.off("property:render"),this.$detached.off("click","> .properties"),this.rendered=!1,e.View.prototype.remove.apply(this,arguments)}})}),define("ubnt/ubnt.layout",["jquery","jquery-ui"],function(e){"use strict";e.widget("ubnt.layout",e.ui.mouse,{_create:function(){this.handles=[],this.elements=[],this.direction=null,this.originalMousePosition=null;for(var e in this.options.directions)this.options.directions.hasOwnProperty(e)&&this._initDirection(e,this.options.directions[e]);this._mouseInit()},_destroy:function(){this._mouseDestroy();for(var t in this.handles)this.handles.hasOwnProperty(t)&&this.handles[t].remove();this.element.removeClass("ubnt-layout ubnt-layout-resizing"),e("body").css("cursor","auto")},_initDirection:function(t,i){e.inArray(t,-1!==["north","south","east","west"])&&(this.element.addClass("ubnt-layout"),i.draggable&&this.element.append(this.handles[t]=e('<div class="ubnt-layout drag-handle '+t+'" title="drag to expand or collapse"></div>')),this.elements[t]=i.also||[],this.elements[t].unshift({element:this.element,property:i.property,inverse:!1}))},_setInitial:function(e){for(var t in this.elements[e])if(this.elements[e].hasOwnProperty(t)){var i=this.elements[e][t];this.elements[e][t].initial=parseInt(i.element.css(i.property),10)}},_mouseCapture:function(t){for(var i in this.handles)if(e(this.handles[i])[0]==t.target)return this.direction=i,!0},_mouseStart:function(t){this.originalMousePosition={left:t.pageX,top:t.pageY},this._setInitial(this.direction),this.element.addClass("ubnt-layout-resizing"),e("body").css("cursor",this.direction.substring(0,1)+"-resize")},_mouseDrag:function(e,t,i){var a=0;switch(t=t||e.pageX-this.originalMousePosition.left||0,i=i||e.pageY-this.originalMousePosition.top||0,this.direction){case"north":a=-i;break;case"south":a=i;break;case"east":a=t;break;case"west":a=-t}this._resize(this.direction,a,!0)},_mouseStop:function(){this._constrain(this.direction),this.direction=null,this.element.removeClass("ubnt-layout-resizing"),e("body").css("cursor","auto")},_constrain:function(t){var i=this.options.directions[t],a=i.constraints,n=null,o=null;if(a){if(o=parseInt(this.element.css(i.property),10),a.min&&(n=e.isFunction(a.min)?a.min():a.min,n>o))return this._resize(t,n,!1);if(a.max&&(n=e.isFunction(a.max)?a.max():a.max,o>n))return this._resize(t,n,!1)}},_resize:function(e,t,i,a){i||(t-=this.elements[e][0].initial);for(var n in this.elements[e])if(this.elements[e].hasOwnProperty(n)){var o=this.elements[e][n];if(a){var r={};r[o.property]=(o.initial||0)+(o.inverse?-t:t),n>0&&delete a.complete,o.element.animate(r,a)}else o.element.css(o.property,(o.initial||0)+(o.inverse?-t:t))}},resize:function(t,i,a,n,o){this._setInitial(t),i=e.isFunction(i)?i():i,this._resize(t,i,a,n),o&&this._constrain(t)},position:function(e){var t=this.elements[e][0];return parseInt(t.element.css(t.property),10)}})}),define("ubnt/ubnt.panel",["jquery","jquery-ui","ubnt/ubnt.layout"],function(e){"use strict";e.widget("ubnt.panel",e.ubnt.layout,{_create:function(){e.ubnt.layout.prototype._create.apply(this,arguments),this.options.id=this.element.attr("id"),this.options.active="active",this._animating=0,this._visible={};var t=this.element.is(":visible");for(var i in this.options.directions)if(this.options.directions[i].hasOwnProperty("property")&&(this._visible[i]=t,this.options.directions.hasOwnProperty(i)&&this.options.directions[i].hasOwnProperty("buttons")))for(var a in this.options.directions[i].buttons)this.options.directions[i].buttons.hasOwnProperty(a)&&(this.options.directions[i].buttons[a].on("click",e.proxy(this,"toggle",i)),t?this.options.directions[i].buttons[a].addClass(this.options.active):this.element.data(this._datavar(i),this.position(i)))},_destroy:function(){e.ubnt.layout.prototype._destroy.apply(this,arguments);for(var t in this.options.directions)if(this.options.directions.hasOwnProperty(t)){this.element.removeData(this._datavar(this.options.directions[t]));for(var i in this.options.directions[t].buttons)this.options.directions[t].buttons.hasOwnProperty(t)&&this.options.directions[t].buttons[t].off("click").removeClass(this.options.active)}},_datavar:function(e){return"layout-position-"+e},show:function(t,i,a){if(!this._animating&&!this.visible(t)){var n=this.options.directions[t].callbacks;n&&n.beforeShow&&n.beforeShow(),e("body").removeClass(this.options.id+"Hidden"),this.element.show(),this._animating++,this.resize(t,this.element.data(this._datavar(t)),!1,{duration:i?0:this.options.duration,start:e.proxy(function(){this.element.trigger("ubnt.panel.showing")},this),complete:e.proxy(function(){this.element.trigger("ubnt.panel.shown"),this._visible[t]=!0,this._animating--,a&&a(i),n&&n.show&&n.show(i)},this)});var o=this.options.directions[t].buttons;for(var r in o)o.hasOwnProperty(r)&&o[r].addClass(this.options.active)}},hide:function(t,i){if(!this._animating&&this.visible(t)){var a=this.options.directions[t].callbacks;a&&a.beforeHide&&a.beforeHide(),this.element.data(this._datavar(t),this.position(t)),this._animating++,this.resize(t,0,!1,{duration:i?0:this.options.duration,start:e.proxy(function(){this.element.trigger("ubnt.panel.hiding")},this),complete:e.proxy(function(){e("body").addClass(this.options.id+"Hidden"),this.element.trigger("ubnt.panel.hidden"),this._visible[t]=!1,this._animating--,a&&a.hide&&a.hide(i)},this)});var n=this.options.directions[t].buttons;for(var o in n)n.hasOwnProperty(o)&&n[o].removeClass(this.options.active)}},toggle:function(e){this.visible(e)?this.hide(e):this.show(e)},visible:function(e){return this._visible[e]}})}),define("unifi/view/app/AdminView",["unifi/view/app/ChromeView","unifi/view/app/AlertsView","unifi/view/app/EventsView","unifi/view/app/PropertiesView","underscore","msg/Msg","jquery","ubnt/GoogleAnalytics","ubnt/ubnt.panel"],function(e,t,i,a,n,o,r,s){"use strict";return e.extend({initialize:function(o){e.prototype.initialize.call(this,o),this.$properties=r("#columnEastContent > .content"),this.$content=r("#columnMainContent"),this.$panel=r("#columnMainPanel"),this.$alerts=r("#panelAlerts"),this.$events=r("#panelEvents"),this.contentSize=n.bind(this.contentSize,this),r(window).on("resize",this.contentSize),this.views.alerts=new t({container:this.$alerts,app:this.options.app}),this.views.events=new i({container:this.$events,app:this.options.app}),this.views.properties=new a({el:this.$properties})},render:function(){var t=this.rendered;if(e.prototype.render.call(this),!t){r("#columnWestToggles").append(r('<li id="toggleAlerts"><div class="ubnt-icon-warning toggle-icons toggle-alerts"><span class="ir">'+o.G_ToggleAlerts+"</span></div></li>")).append(r('<li id="toggleEvents"><div class="ubnt-icon-calendar toggle-icons toggle-events"><span class="ir">'+o.G_ToggleEvents+"</span></div></li>")),r.Body.append(r('<div id="showSidebar" class="show-sidebar" title="Show Properties"><span class="ubnt-icon-properties-drop"></span><span class="underlay"></span><span class="ir">'+o.G_ShowSidebar+"</div>")),r("#columnEast").panel({duration:350,directions:{west:{draggable:!1,property:"width",constraints:{max:500,min:r("#columnEast").width()},also:[{element:r("#columnMain > .content"),property:"margin-right",inverse:!1}],buttons:[r("#columnEastHeader .toggle-sidebar"),r("#showSidebar")],callbacks:{beforeShow:this.contentSize,hide:function(e){e||r("#showSidebar").effect("shake",{times:1,distance:5},300)}}}}}),r("#columnMainPanel").panel({duration:350,directions:{north:{draggable:!0,property:"height",constraints:{max:r(window).height()-r("#header").height(),min:35},also:[{element:r("#columnMainContent"),property:"bottom",inverse:!1}]}}}),r("#columnMainPanel").panel("hide","north",!0),r("#columnEast").panel("hide","west",!0),r(".columnOuterContainer").removeClass("invisible"),r("#toggleAlerts, #toggleEvents").on("click",r.proxy(function(e){var t=r(e.target).closest("li"),i=t.attr("id").replace("toggle",""),a=r("#panel"+i);t.hasClass("active")?(this.$panel.one("ubnt.panel.hidden",function(){t.removeClass("active")}),this.$panel.panel("hide","north")):(this.$panel.panel("visible","north")?(this.showPanel(a,t),a.trigger("show:complete")):(this.$panel.one("ubnt.panel.showing",r.proxy(function(){this.showPanel(a,t)},this)),this.$panel.panel("show","north",!1,function(){a.trigger("show:complete")})),s.trackEvent("button","click","open "+i.toLowerCase()))},this)),r("#columnWestToggles").show(),r.Body.removeClass("columnWestTogglesHidden");var i=new RegExp("[?&]settings=([^&]*)(&id=([a-z0-9]*))?").exec(window.location.search);i&&this.openSettings(decodeURIComponent(i[1].replace(/\+/g," ")),i[3])}return n.each(this.views,function(e,t){e.render()},this),this.views.alerts._renderBadge&&this.views.alerts.load(),this.views.events._renderBadge&&this.views.events.load(),this.settings&&this.stopListening(this.settings,"change sync add",this.reflectSettingChanges),this.settings=this.app.collection("Settings"),this.listenTo(this.settings,"change sync add",this.reflectSettingChanges),this.reflectSettingChanges(),this},showPanel:function(e,t){t.addClass("active").siblings("li").removeClass("active"),e.show().trigger("show").siblings().hide().trigger("hide")},contentSize:function(){},openSettings:function(e,t){e&&(this.options.app.settings=e,r("#navigation").find("a[data-page=settings]").trigger("click",t))},reflectSettingChanges:function(){var e=this.app.collection("Settings"),t=e.getSettingFromKey("voip",SITE.id),i=!(!t||!t.get("enabled"));r.Body.toggleClass("hasVoip",i)},reset:function(){e.prototype.reset.call(this),r("#columnWestToggles li.active").removeClass("active"),r("#columnMainPanel").panel("hide","north",!0),r("#columnEast").panel("hide","west",!0)},remove:function(){n.each(this.views,function(e){e.remove&&e.remove()},this),this.views={},r(window).off("resize",this.contentSize),r("#toggleAlerts, #toggleEvents").off("click"),this.stopListening(this.settings,"change sync add",this.reflectSettingChanges),this.rendered=!1,e.prototype.remove.apply(this,arguments)}})}),require(["jquery","app","msg/Msg","unifi/router/DashboardRouter","unifi/router/MapRouter","unifi/router/DevicesRouter","unifi/router/ClientsRouter","unifi/router/StatisticsRouter","unifi/router/InsightsRouter","unifi/router/SupportRouter","unifi/view/app/AdminView","unifi/collection/Sites","unifi/collection/Devices","unifi/collection/Clients","unifi/collection/Settings"],function(e,t,i,a,n,o,r,s,c,l,d,m,u,h,g){"use strict";e(function(){e("#preload-message").text(i.I_LoadingSiteData);var p={Dashboard:a,Map:n,Devices:o,Clients:r,Statistics:s,Insights:c,Support:l},y={Sites:m,Devices:u,Clients:h,Settings:g};t.initialize(p,y,d)})}),define("manage",function(){});