One Hat Cyber Team
Your IP :
216.73.216.135
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
UniFi
/
webapps
/
ROOT
/
app-unifi
/
js
/
Edit File:
main.wizard.js
!function(){return function e(t,n,i){function r(o,a){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){return r(t[o][1][e]||e)},l,l.exports,e,t,n,i)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<i.length;o++)r(i[o]);return r}}()({1:[function(e,t,n){},{}],2:[function(e,t,n){t.exports={BZ2:{name:"UniFi AP",type:"uap",features:{zh:!0},radios:{ng:{maxPower:23,gain:5}}},BZ2LR:{name:"UniFi AP-LR",type:"uap",features:{zh:!0},radios:{ng:{maxPower:28,gain:3}}},U2HSR:{name:"UniFi AP-Outdoor+",type:"uap",features:{zh:!0},radios:{ng:{maxPower:30,gain:5}}},U2IW:{name:"UniFi AP-In Wall",type:"uap",hybrid:"uap+usw",features:{zh:!0},ports:{standard:2},radios:{ng:{maxPower:18,gain:1}}},U2L48:{name:"UniFi AP-LR",type:"uap",radios:{ng:{maxPower:29,gain:0}}},U2Lv2:{name:"UniFi AP-LR v2",type:"uap",features:{zh:!0},radios:{ng:{maxPower:28,gain:3}}},U2M:{name:"UniFi AP-Mini",type:"uap",radios:{ng:{maxPower:18,gain:0}}},U2O:{name:"UniFi AP-Outdoor",type:"uap",features:{zh:!0},radios:{ng:{maxPower:28,gain:6}}},U2S48:{name:"UniFi AP",type:"uap",radios:{ng:{maxPower:23,gain:0}}},U2Sv2:{name:"UniFi AP v2",type:"uap",features:{zh:!0},radios:{ng:{maxPower:23,gain:0}}},U5O:{name:"UniFi AP-Outdoor 5G",type:"uap",features:{dfs:!0,zh:!0},radios:{na:{maxPower:27,gain:6}}},U7E:{name:"UniFi AP-AC",type:"uap",features:{ac:!0,brcm:!0},radios:{na:{maxPower:24,gain:4},ng:{maxPower:22,gain:4}}},U7EDU:{name:"UniFi AP-AC-EDU",type:"uap",features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:22,gain:3},ng:{maxPower:22,gain:3}}},U7Ev2:{name:"UniFi AP-AC v2",type:"uap",features:{ac:!0,brcm:!0},radios:{na:{maxPower:24,gain:3},ng:{maxPower:22,gain:4}}},U7HD:{name:"UniFi AP-HD",type:"uap",features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:25,gain:4},ng:{maxPower:25,gain:3}}},U7SHD:{name:"UniFi AP-SHD",type:"uap",features:{gen:2,ac:!0,bandsteer:!0,airTime:!0,airView:!0},radios:{na:{maxPower:25,gain:8},ng:{maxPower:25,gain:6}}},U7NHD:{name:"UniFi AP-nanoHD",type:"uap",features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:25,gain:4},ng:{maxPower:20,gain:3}}},UHDIW:{name:"UniFi AP-HD-In Wall",type:"uap",hybrid:"uap+usw",ports:{standard:4},features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:25,gain:4},ng:{maxPower:20,gain:3}}},UCXG:{name:"UniFi AP-XG",type:"uap",features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:25,gain:8},ng:{maxPower:25,gain:6}}},UXSDM:{name:"UniFi AP-BaseStationXG",type:"uap",features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:25,gain:10}}},UXBSDM:{name:"UniFi AP-BaseStationXG-Black",type:"uap",features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:25,gain:10}}},UCMSH:{name:"UniFi AP-MeshXG",type:"uap",features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:25,gain:10},ng:{maxPower:25,gain:15}}},U7IW:{name:"UniFi AP-AC-In Wall",type:"uap",hybrid:"uap+usw",ports:{standard:2},features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:20,gain:1},ng:{maxPower:20,gain:2}}},U7IWP:{name:"UniFi AP-AC-In Wall Pro",type:"uap",hybrid:"uap+usw",ports:{standard:2},features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:22,gain:6},ng:{maxPower:22,gain:5}}},U7MP:{name:"UniFi AP-AC-Mesh-Pro",type:"uap",features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:22,gain:8},ng:{maxPower:22,gain:8}}},U7LR:{name:"UniFi AP-AC-LR",type:"uap",features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:22,gain:3},ng:{maxPower:24,gain:3}}},U7LT:{name:"UniFi AP-AC-Lite",type:"uap",features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:20,gain:3},ng:{maxPower:20,gain:3}}},U7O:{name:"UniFi AP-AC Outdoor",type:"uap",features:{ac:!0,brcm:!0},radios:{na:{maxPower:24,gain:4},ng:{maxPower:22,gain:4}}},U7P:{name:"UniFi AP-Pro",type:"uap",features:{dfs:!0,bandsteer:!0,zh:!0},radios:{na:{maxPower:23,gain:4},ng:{maxPower:30,gain:5}}},U7MSH:{name:"UniFi AP-AC-Mesh",type:"uap",features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:20,gain:4},ng:{maxPower:20,gain:3}}},U7PG2:{name:"UniFi AP-AC-Pro",type:"uap",features:{gen:2,ac:!0,bandsteer:!0},radios:{na:{maxPower:23,gain:3},ng:{maxPower:22,gain:3}}},p2N:{name:"PicoStation M2",type:"uap",features:{zh:!0},radios:{na:{maxPower:22,gain:3},ng:{maxPower:22,gain:3}}},US8:{name:"UniFi Switch 8",type:"usw",features:{poe:!0},ports:{standard:8},power:{capacity:10}},US8P60:{name:"UniFi Switch 8 POE-60W",type:"usw",features:{poe:!0},ports:{standard:8},power:{capacity:60}},US8P150:{name:"UniFi Switch 8 POE-150W",type:"usw",features:{poe:!0},ports:{standard:8,sfp:[9,10]},power:{capacity:150}},S28150:{name:"UniFi Switch 8 AT-150W",type:"usw",features:{poe:!0},ports:{standard:8,sfp:[9,10]},power:{capacity:150}},USC8:{name:"UniFi Switch 8",type:"usw",features:{poe:!0},ports:{standard:8},power:{capacity:10}},USC8P60:{name:"UniFi Switch 8 POE-60W",type:"usw",features:{poe:!0},ports:{standard:8},power:{capacity:60}},USC8P150:{name:"UniFi Switch 8 POE-150W",type:"usw",features:{poe:!0},ports:{standard:8,sfp:[9,10]},power:{capacity:150}},US16P150:{name:"UniFi Switch 16 POE-150W",type:"usw",features:{poe:!0,fan:"simple"},ports:{standard:16,sfp:[17,18]},power:{capacity:150}},S216150:{name:"UniFi Switch 16 AT-150W",type:"usw",features:{poe:!0,fan:"simple"},ports:{standard:16,sfp:[17,18]},power:{capacity:150}},US24:{name:"UniFi Switch 24",type:"usw",features:{fan:"simple"},ports:{standard:24,sfp:[25,26]}},US24PRO:{name:"UniFi Switch 24 PRO",type:"usw",features:{poe:!0},ports:{standard:24,plus:[25,26]}},US24P250:{name:"UniFi Switch 24 POE-250W",type:"usw",features:{poe:!0,fan:"alwayson"},ports:{standard:24,sfp:[25,26]},power:{capacity:250}},US24PL2:{name:"UniFi Switch 24 L2 POE",type:"usw",features:{poe:!0,fan:"alwayson"},ports:{standard:24,sfp:[25,26]}},US24P500:{name:"UniFi Switch 24 POE-500W",type:"usw",features:{poe:!0,fan:"alwayson"},ports:{standard:24,sfp:[25,26]},power:{capacity:500}},S224250:{name:"UniFi Switch 24 AT-250W",type:"usw",features:{poe:!0,fan:"alwayson"},ports:{standard:24,sfp:[25,26]},power:{capacity:250}},S224500:{name:"UniFi Switch 24 AT-500W",type:"usw",features:{poe:!0,fan:"alwayson"},ports:{standard:24,sfp:[25,26]},power:{capacity:500}},US48:{name:"UniFi Switch 48",type:"usw",features:{fan:"simple"},ports:{standard:48,sfp:[51,52],plus:[49,50]}},US48PRO:{name:"UniFi Switch 48 PRO",type:"usw",features:{poe:!0},ports:{standard:48,plus:"49-52"}},US48P500:{name:"UniFi Switch 48 POE-500W",type:"usw",features:{poe:!0,fan:"alwayson"},ports:{standard:48,sfp:[51,52],plus:[49,50]},power:{capacity:500}},US48PL2:{name:"UniFi Switch 48 L2 POE",type:"usw",features:{poe:!0,fan:"alwayson"},ports:{standard:48,sfp:[51,52],plus:[49,50]}},US48P750:{name:"UniFi Switch 48 POE-750W",type:"usw",features:{poe:!0,fan:"alwayson"},ports:{standard:48,sfp:[51,52],plus:[49,50]},power:{capacity:750}},S248500:{name:"UniFi Switch 48 AT-500W",type:"usw",features:{poe:!0,fan:"alwayson"},ports:{standard:48,sfp:[51,52],plus:[49,50]},power:{capacity:500}},S248750:{name:"UniFi Switch 48 AT-750W",type:"usw",features:{poe:!0,fan:"alwayson"},ports:{standard:48,sfp:[51,52],plus:[49,50]},power:{capacity:750}},US6XG150:{name:"UniFi Switch XG 6POE",type:"usw",features:{poe:!0},ports:{standard:"1-4",plus:"5-6"},ledColors:{amber:[],green:[1e3,100],white:[1e4,5e3,2500]},diagram:["01 02 03 04 __ 05 06"]},USXG:{name:"UniFi Switch 16XG",type:"usw",ports:{plus:"1-12",standard:"13-16"},diagram:["01 03 05 07 09 11 __ __ __ __ __","02 04 06 08 10 12 __ 13 14 15 16"]},USC8P450:{name:"UniFi Industrial Switch 8 POE-450W",type:"usw",features:{poe:!0},ports:{standard:10},diagram:["__ __ __ __ __ __ __ __ __ 09","01 02 03 04 05 06 07 08 __ 10"],power:{capacity:450}},UGW3:{name:"UniFi Security Gateway 3P",type:"ugw",diagram:["00 01 02"],ports:{eth0:"WAN 1",eth1:"LAN 1",eth2:"WAN 2/LAN 2"},networkGroups:{eth0:"WAN",eth1:"LAN",eth2:"LAN2"},linkNegotiation:{eth0:{portIdx:1,supportedValues:["autoneg","100 FDX","100 HDX","10 FDX","10 HDX"]},eth1:{portIdx:2,supportedValues:["autoneg","100 FDX","100 HDX","10 FDX","10 HDX"]},eth2:{portIdx:3,supportedValues:["autoneg","100 FDX","100 HDX","10 FDX","10 HDX"]}},features:{legacyPortRemap:!0}},UGW4:{name:"UniFi Security Gateway 4P",type:"ugw",diagram:["00 01 02 03"],temperatureSensors:[{sensor:"PHY",maxTemp:105},{sensor:"CPU",maxTemp:100},{sensor:"Board (PHY)"},{sensor:"Board (CPU)"}],ports:{eth0:"LAN1",eth1:"LAN2",eth2:"WAN1",eth3:"WAN2"},networkGroups:{eth0:"LAN",eth1:"LAN2",eth2:"WAN",eth3:"WAN2"},linkNegotiation:{eth0:{portIdx:1,supportedValues:["autoneg","100 FDX","100 HDX","10 FDX","10 HDX"]},eth1:{portIdx:2,supportedValues:["autoneg","100 FDX","100 HDX","10 FDX","10 HDX"]}}},UGWHD4:{name:"UniFi Security Gateway HD",type:"ugw",diagram:["00 01 02 03"],ports:{eth0:"0",eth1:"1",eth2:"2",eth3:"3"}},UGWXG:{name:"UniFi Security Gateway XG-8",type:"ugw",ports:{eth0:"0",eth1:"1",eth2:"2",eth3:"3",eth4:"4",eth5:"5",eth6:"6",eth7:"7",eth8:"8"},networkGroups:{eth0:"WAN2",eth1:"LAN",eth2:"LAN2",eth3:"LAN3",eth4:"LAN4",eth5:"LAN5",eth6:"LAN6",eth7:"LAN7",eth8:"WAN"},linkNegotiation:{eth0:{portIdx:1,supportedValues:["autoneg","100 FDX","100 HDX","10 FDX","10 HDX"]},eth1:{portIdx:2,supportedValues:["autoneg","10000 FDX","1000 FDX"]},eth2:{bindWith:"eth1"},eth3:{bindWith:"eth1"},eth4:{bindWith:"eth1"},eth5:{portIdx:6,supportedValues:["autoneg","10000 FDX","1000 FDX"]},eth6:{bindWith:"eth5"},eth7:{bindWith:"eth5"},eth8:{bindWith:"eth5"}},diagram:["01 03 05 07 __","02 04 06 08 00"],features:{sfpPlusSupported:!0},temperatureSensors:[{sensor:"Board 1"},{sensor:"Board 2"},{sensor:"CPU",maxTemp:95},{sensor:"PHY 1",maxTemp:100},{sensor:"PHY 2",maxTemp:100}],bleServices:{default:"60dbfe9e-6b5d-11e8-adc0-fa7ae01bbebc",configured:"8e760c3c-6b5d-11e8-adc0-fa7ae01bbebc"}},UP4:{name:"UniFi Phone-X",type:"uph"},UP5:{name:"UniFi Phone",type:"uph"},UP5t:{name:"UniFi Phone-Pro",type:"uph"},UP7:{name:"UniFi Phone-Executive",type:"uph"},UP5c:{name:"UniFi Phone",type:"uph"},UP5tc:{name:"UniFi Phone-Pro",type:"uph"},UP7c:{name:"UniFi Phone-Executive",type:"uph"},UCK:{name:"UniFi Cloud Key",type:"uck"},"UCK-v2":{name:"UniFi Cloud Key v2",type:"uck"},"UCK-v3":{name:"UniFi Cloud Key v3",type:"uck",bleServices:{default:"bc3caa52-e57c-4eb3-a609-ed7310564517",configured:"054e1ac8-1ad8-4c10-a0de-e55fc4f268e5"}},UCKG2:{name:"UniFi Cloud Key Gen2",type:"uck",bleServices:{default:"78c68045-eba1-40f3-bf5e-52bc7f9ed797",configured:"45caadb4-6de8-4466-9680-313f1a692594"}},UCKP:{name:"UniFi Cloud Key Gen2 Plus",type:"uck",bleServices:{default:"59352787-2e1d-4dcd-874d-d351b6a8938d",configured:"9287211b-af83-4542-97fb-f9a845475309"}},UASXG:{name:"UniFi Application Server XG",type:"uas",bleServices:{default:"6868ac9f-fb18-4f2c-9b01-50ab0743907d",configured:"8eeb0dea-f4cd-4c8a-8e6e-5e385ca18dae"}}}},{}],3:[function(e,t,n){"use strict";n.Address4=e("./lib/ipv4.js"),n.Address6=e("./lib/ipv6.js"),n.v6={helpers:e("./lib/v6/helpers.js")}},{"./lib/ipv4.js":5,"./lib/ipv6.js":6,"./lib/v6/helpers.js":10}],4:[function(e,t,n){"use strict";var i=n.falseIfInvalid=function(e){return function(){return!!this.valid&&e.apply(this,arguments)}};n.isInSubnet=i(function(e){return!(this.subnetMask<e.subnetMask)&&this.mask(e.subnetMask)===e.mask()}),n.isCorrect=function(e){return i(function(){return this.addressMinusSuffix===this.correctForm()&&(this.subnetMask===e&&!this.parsedSubnet||this.parsedSubnet===String(this.subnetMask))})}},{}],5:[function(e,t,n){"use strict";var i=e("jsbn").BigInteger,r=e("./common.js"),s=e("lodash.padstart"),o=e("lodash.repeat"),a=e("sprintf-js").sprintf,u=e("./v4/constants.js");function c(e){this.valid=!1,this.address=e,this.groups=u.GROUPS,this.v4=!0,this.subnet="/32",this.subnetMask=32;var t=u.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet="/"+this.subnetMask,this.subnetMask<0||this.subnetMask>u.BITS)return this.valid=!1,void(this.error="Invalid subnet mask.");e=e.replace(u.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}c.prototype.parse=function(e){var t=e.split(".");return e.match(u.RE_ADDRESS)?this.valid=!0:this.error="Invalid IPv4 address.",t},c.prototype.isValid=function(){return this.valid},c.prototype.correctForm=function(){return this.parsedAddress.map(function(e){return parseInt(e,10)}).join(".")},c.prototype.isCorrect=r.isCorrect(u.BITS),c.fromHex=function(e){var t,n=s(e.replace(/:/g,""),8,"0"),i=[];for(t=0;t<8;t+=2){var r=n.slice(t,t+2);i.push(parseInt(r,16))}return new c(i.join("."))},c.fromInteger=function(e){return c.fromHex(e.toString(16))},c.prototype.toHex=function(){return this.parsedAddress.map(function(e){return a("%02x",parseInt(e,10))}).join(":")},c.prototype.toArray=function(){return this.parsedAddress.map(function(e){return parseInt(e,10)})},c.prototype.toGroup6=function(){var e,t=[];for(e=0;e<u.GROUPS;e+=2){var n=a("%02x%02x",parseInt(this.parsedAddress[e],10),parseInt(this.parsedAddress[e+1],10));t.push(a("%x",parseInt(n,16)))}return t.join(":")},c.prototype.bigInteger=function(){return this.valid?new i(this.parsedAddress.map(function(e){return a("%02x",parseInt(e,10))}).join(""),16):null},c.prototype.startAddress=function(){var e=new i(this.mask()+o(0,u.BITS-this.subnetMask),2);return c.fromBigInteger(e)},c.prototype.endAddress=function(){var e=new i(this.mask()+o(1,u.BITS-this.subnetMask),2);return c.fromBigInteger(e)},c.fromBigInteger=function(e){return c.fromInteger(parseInt(e.toString(),10))},c.prototype.mask=function(e){return void 0===e&&(e=this.subnetMask),this.getBitsBase2(0,e)},c.prototype.getBitsBase2=function(e,t){return this.binaryZeroPad().slice(e,t)},c.prototype.isInSubnet=r.isInSubnet,c.prototype.binaryZeroPad=function(){return s(this.bigInteger().toString(2),u.BITS,"0")},t.exports=c},{"./common.js":4,"./v4/constants.js":7,jsbn:13,"lodash.padstart":17,"lodash.repeat":18,"sprintf-js":20}],6:[function(e,t,n){"use strict";var i=e("jsbn").BigInteger,r=e("lodash.find"),s=e("lodash.max"),o=e("lodash.merge"),a=e("lodash.padstart"),u=e("lodash.repeat"),c=e("sprintf-js").sprintf,l=e("./v4/constants.js"),d=e("./v6/constants.js"),p=e("./ipv4.js");function f(e){return e=(e=e.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2')).replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2')}function h(e,t){this.groups=void 0===t?d.GROUPS:t,this.v4=!1,this.subnet="/128",this.subnetMask=128,this.zone="",this.address=e;var n=d.RE_SUBNET_STRING.exec(e);if(n){if(this.parsedSubnet=n[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet="/"+this.subnetMask,isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>d.BITS)return this.valid=!1,void(this.error="Invalid subnet mask.");e=e.replace(d.RE_SUBNET_STRING,"")}else if(/\//.test(e))return this.valid=!1,void(this.error="Invalid subnet mask.");var i=d.RE_ZONE_STRING.exec(e);i&&(this.zone=i[0],e=e.replace(d.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}function v(e){return c("%04x",parseInt(e,16))}function g(e){return 255&e}o(h.prototype,e("./v6/attributes.js")),o(h.prototype,e("./v6/html.js")),o(h.prototype,e("./v6/regular-expressions.js")),h.fromBigInteger=function(e){var t,n=a(e.toString(16),32,"0"),i=[];for(t=0;t<d.GROUPS;t++)i.push(n.slice(4*t,4*(t+1)));return new h(i.join(":"))},h.fromURL=function(e){var t,n,i;if(-1!==e.indexOf("[")&&-1!==e.indexOf("]:")){if(null===(i=d.RE_URL_WITH_PORT.exec(e)))return{error:"failed to parse address with port",address:null,port:null};t=i[1],n=i[2]}else if(-1!==e.indexOf("/")){if(e=e.replace(/^[a-z0-9]+:\/\//,""),null===(i=d.RE_URL.exec(e)))return{error:"failed to parse address from URL",address:null,port:null};t=i[1]}else t=e;return n?((n=parseInt(n,10))<0||n>65536)&&(n=null):n=null,{address:new h(t),port:n}},h.fromAddress4=function(e){e=new p(e);var t=d.BITS-(l.BITS-e.subnetMask);return new h("::ffff:"+e.correctForm()+"/"+t)},h.fromArpa=function(e){var t=e.replace(/(\.ip6\.arpa)?\.$/,"");if(63!==t.length)return t={error:"Not Valid 'ip6.arpa' form",address:null};t=t.split(".").reverse();for(var n=7;n>0;n--){var i=4*n;t.splice(i,0,":")}return new h(t=t.join(""))},h.prototype.microsoftTranscription=function(){return c("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))},h.prototype.mask=function(e){return void 0===e&&(e=this.subnetMask),this.getBitsBase2(0,e)},h.prototype.possibleSubnets=function(e){void 0===e&&(e=128);var t=d.BITS-this.subnetMask-Math.abs(e-d.BITS);return t<0?"0":function(e){for(var t=/(\d+)(\d{3})/;t.test(e);)e=e.replace(t,"$1,$2");return e}(new i("2",10).pow(t).toString(10))},h.prototype.startAddress=function(){var e=new i(this.mask()+u(0,d.BITS-this.subnetMask),2);return h.fromBigInteger(e)},h.prototype.endAddress=function(){var e=new i(this.mask()+u(1,d.BITS-this.subnetMask),2);return h.fromBigInteger(e)},h.prototype.getScope=function(){var e=d.SCOPES[this.getBits(12,16)];return"Global unicast"===this.getType()&&"Link local"!==e&&(e="Global"),e},h.prototype.getType=function(){var e=this;return r(d.TYPES,function(t,n){return e.isInSubnet(new h(n))})||"Global unicast"},h.prototype.getBits=function(e,t){return new i(this.getBitsBase2(e,t),2)},h.prototype.getBitsBase2=function(e,t){return this.binaryZeroPad().slice(e,t)},h.prototype.getBitsBase16=function(e,t){var n=t-e;return n%4!=0?null:a(this.getBits(e,t).toString(16),n/4,"0")},h.prototype.getBitsPastSubnet=function(){return this.getBitsBase2(this.subnetMask,d.BITS)},h.prototype.reverseForm=function(e){e||(e={});var t=Math.floor(this.subnetMask/4),n=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?n:c("%s.ip6.arpa.",n):e.omitSuffix?"":"ip6.arpa."},h.prototype.correctForm=function(){if(!this.parsedAddress)return null;var e,t=[],n=0,i=[];for(e=0;e<this.parsedAddress.length;e++){var r=parseInt(this.parsedAddress[e],16);0===r&&n++,0!==r&&n>0&&(n>1&&i.push([e-n,e-1]),n=0)}n>1&&i.push([this.parsedAddress.length-n,this.parsedAddress.length-1]);var o=i.map(function(e){return e[1]-e[0]+1});if(i.length>0){var a=o.indexOf(s(o));t=function(e,t){var n,i=[],r=[];for(n=0;n<e.length;n++)n<t[0]?i.push(e[n]):n>t[1]&&r.push(e[n]);return i.concat(["compact"]).concat(r)}(this.parsedAddress,i[a])}else t=this.parsedAddress;for(e=0;e<t.length;e++)"compact"!==t[e]&&(t[e]=parseInt(t[e],16).toString(16));var u=t.join(":");return u=(u=(u=u.replace(/^compact$/,"::")).replace(/^compact|compact$/,":")).replace(/compact/,"")},h.prototype.binaryZeroPad=function(){return a(this.bigInteger().toString(2),d.BITS,"0")},h.prototype.parse4in6=function(e){var t=e.split(":"),n=t.slice(-1)[0].match(l.RE_ADDRESS);if(n){for(var i=new p(n[0]),r=0;r<i.groups;r++)if(/^0[0-9]+/.test(i.parsedAddress[r]))return this.valid=!1,this.error="IPv4 addresses can not have leading zeroes.",this.parseError=e.replace(l.RE_ADDRESS,i.parsedAddress.map(f).join(".")),null;this.v4=!0,t[t.length-1]=i.toGroup6(),e=t.join(":")}return e},h.prototype.parse=function(e){if(e=this.parse4in6(e),this.error)return null;var t=e.match(d.RE_BAD_CHARACTERS);if(t)return this.valid=!1,this.error=c("Bad character%s detected in address: %s",t.length>1?"s":"",t.join("")),this.parseError=e.replace(d.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'),null;var n=e.match(d.RE_BAD_ADDRESS);if(n)return this.valid=!1,this.error=c("Address failed regex: %s",n.join("")),this.parseError=e.replace(d.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'),null;var i=[],r=e.split("::");if(2===r.length){var s=r[0].split(":"),o=r[1].split(":");1===s.length&&""===s[0]&&(s=[]),1===o.length&&""===o[0]&&(o=[]);var a=this.groups-(s.length+o.length);if(!a)return this.valid=!1,this.error="Error parsing groups",null;this.elidedGroups=a,this.elisionBegin=s.length,this.elisionEnd=s.length+this.elidedGroups,s.forEach(function(e){i.push(e)});for(var u=0;u<a;u++)i.push(0);o.forEach(function(e){i.push(e)})}else{if(1!==r.length)return this.valid=!1,this.error="Too many :: groups found",null;i=e.split(":"),this.elidedGroups=0}return(i=i.map(function(e){return c("%x",parseInt(e,16))})).length!==this.groups?(this.valid=!1,this.error="Incorrect number of groups found",null):(this.valid=!0,i)},h.prototype.canonicalForm=function(){return this.valid?this.parsedAddress.map(v).join(":"):null},h.prototype.decimal=function(){return this.valid?this.parsedAddress.map(function(e){return c("%05d",parseInt(e,16))}).join(":"):null},h.prototype.bigInteger=function(){return this.valid?new i(this.parsedAddress.map(v).join(""),16):null},h.prototype.to4=function(){var e=this.binaryZeroPad().split("");return p.fromHex(new i(e.slice(96,128).join(""),2).toString(16))},h.prototype.to4in6=function(){var e=this.to4(),t=new h(this.parsedAddress.slice(0,6).join(":"),6),n=t.correctForm(),i="";return/:$/.test(n)||(i=":"),t.correctForm()+i+e.address},h.prototype.inspectTeredo=function(){var e=this.getBitsBase16(0,32),t=this.getBits(80,96).xor(new i("ffff",16)).toString(),n=p.fromHex(this.getBitsBase16(32,64)),r=p.fromHex(this.getBits(96,128).xor(new i("ffffffff",16)).toString(16)),s=this.getBits(64,80),o=this.getBitsBase2(64,80),a=s.testBit(15),u=s.testBit(14),l=s.testBit(8),d=s.testBit(9),f=new i(o.slice(2,6)+o.slice(8,16),2).toString(10);return{prefix:c("%s:%s",e.slice(0,4),e.slice(4,8)),server4:n.address,client4:r.address,flags:o,coneNat:a,microsoft:{reserved:u,universalLocal:d,groupIndividual:l,nonce:f},udpPort:t}},h.prototype.inspect6to4=function(){var e=this.getBitsBase16(0,16),t=p.fromHex(this.getBitsBase16(16,48));return{prefix:c("%s",e.slice(0,4)),gateway:t.address}},h.prototype.to6to4=function(){return this.is4()?new h(["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":")):null},h.prototype.toByteArray=function(){var e=this.bigInteger().toByteArray();return 17===e.length&&0===e[0]?e.slice(1):e},h.prototype.toUnsignedByteArray=function(){return this.toByteArray().map(g)},h.fromByteArray=function(e){return this.fromUnsignedByteArray(e.map(g))},h.fromUnsignedByteArray=function(e){for(var t=new i("256",10),n=new i("0",10),r=new i("1",10),s=e.length-1;s>=0;s--)n=n.add(r.multiply(new i(e[s].toString(10),10))),r=r.multiply(t);return h.fromBigInteger(n)},t.exports=h},{"./ipv4.js":5,"./v4/constants.js":7,"./v6/attributes.js":8,"./v6/constants.js":9,"./v6/html.js":11,"./v6/regular-expressions.js":12,jsbn:13,"lodash.find":14,"lodash.max":15,"lodash.merge":16,"lodash.padstart":17,"lodash.repeat":18,"sprintf-js":20}],7:[function(e,t,n){n.BITS=32,n.GROUPS=4,n.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,n.RE_SUBNET_STRING=/\/\d{1,2}$/},{}],8:[function(e,t,n){"use strict";var i=e("../common.js"),r=e("./constants.js");n.isValid=function(){return this.valid},n.isInSubnet=i.isInSubnet,n.isCorrect=i.isCorrect(r.BITS),n.isCanonical=i.falseIfInvalid(function(){return this.addressMinusSuffix===this.canonicalForm()}),n.isLinkLocal=i.falseIfInvalid(function(){return"1111111010000000000000000000000000000000000000000000000000000000"===this.getBitsBase2(0,64)}),n.isMulticast=i.falseIfInvalid(function(){return"Multicast"===this.getType()}),n.is4=i.falseIfInvalid(function(){return this.v4}),n.isTeredo=i.falseIfInvalid(function(){return this.isInSubnet(new this.constructor("2001::/32"))}),n.is6to4=i.falseIfInvalid(function(){return this.isInSubnet(new this.constructor("2002::/16"))}),n.isLoopback=i.falseIfInvalid(function(){return"Loopback"===this.getType()})},{"../common.js":4,"./constants.js":9}],9:[function(e,t,n){n.BITS=128,n.GROUPS=8,n.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"},n.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"},n.RE_BAD_CHARACTERS=/([^0-9a-f:\/%])/gi,n.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,n.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/,n.RE_ZONE_STRING=/%.*$/,n.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/),n.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)},{}],10:[function(e,t,n){"use strict";var i=e("sprintf-js").sprintf,r=n.spanAllZeroes=function(e){return e.replace(/(0+)/g,'<span class="zero">$1</span>')};function s(e){return e.replace(/^(0+)/,'<span class="zero">$1</span>')}n.spanAll=function(e,t){return void 0===t&&(t=0),e.split("").map(function(e,n){return i('<span class="digit value-%s position-%d">%s</span>',e,n+t,r(e))}).join("")},n.spanLeadingZeroes=function(e){return e.split(":").map(function(e){return s(e)}).join(":")},n.simpleGroup=function(e,t){var n=e.split(":");return t||(t=0),n.map(function(e,n){return/group-v4/.test(e)?e:i('<span class="hover-group group-%d">%s</span>',n+t,s(e))}).join(":")}},{"sprintf-js":20}],11:[function(e,t,n){"use strict";var i=e("../v4/constants.js"),r=e("./helpers.js"),s=e("sprintf-js").sprintf;n.href=function(e){return e=void 0===e?"":s(":%s",e),s("http://[%s]%s/",this.correctForm(),e)},n.link=function(e){e||(e={}),void 0===e.className&&(e.className=""),void 0===e.prefix&&(e.prefix="/#address="),void 0===e.v4&&(e.v4=!1);var t=this.correctForm;return e.v4&&(t=this.to4in6),e.className?s('<a href="%1$s%2$s" class="%3$s">%2$s</a>',e.prefix,t.call(this),e.className):s('<a href="%1$s%2$s">%2$s</a>',e.prefix,t.call(this))},n.group=function(){var e,t=this.address.match(i.RE_ADDRESS);if(t){var n=t[0].split(".");this.address=this.address.replace(i.RE_ADDRESS,s('<span class="hover-group group-v4 group-6">%s</span>.<span class="hover-group group-v4 group-7">%s</span>',n.slice(0,2).join("."),n.slice(2,4).join(".")))}if(0===this.elidedGroups)return r.simpleGroup(this.address);var o=[],a=this.address.split("::");a[0].length?o.push(r.simpleGroup(a[0])):o.push("");var u=["hover-group"];for(e=this.elisionBegin;e<this.elisionBegin+this.elidedGroups;e++)u.push(s("group-%d",e));return o.push(s('<span class="%s"></span>',u.join(" "))),a[1].length?o.push(r.simpleGroup(a[1],this.elisionEnd)):o.push(""),o.join(":")}},{"../v4/constants.js":7,"./helpers.js":10,"sprintf-js":20}],12:[function(e,t,n){"use strict";var i=e("sprintf-js").sprintf,r=e("./constants.js");function s(e){return i("(%s)",e.join("|"))}function o(e){return e.length<4?i("0{0,%d}%s",4-e.length,e):e}function a(e){var t=[];e.forEach(function(e,n){0===parseInt(e,16)&&t.push(n)});var n=t.map(function(t){return e.map(function(e,n){if(n===t){var i=0===n||n===r.GROUPS-1?":":"";return s([o(e),i])}return o(e)}).join(":")});return n.push(e.map(o).join(":")),s(n)}function u(e,t,n){var r=t?"":":",o=n?"":":",a=[];t||n||a.push("::"),t&&n&&a.push(""),(n&&!t||!n&&t)&&a.push(":"),a.push(i("%s(:0{1,4}){1,%d}",r,e-1)),a.push(i("(0{1,4}:){1,%d}%s",e-1,o)),a.push(i("(0{1,4}:){%d}0{1,4}",e-1));for(var u=1;u<e-1;u++)for(var c=1;c<e-u;c++)a.push(i("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",c,e-c-u-1));return s(a)}n.regularExpressionString=function(e){void 0===e&&(e=!1);var t=[],n=new this.constructor(this.correctForm());if(0===n.elidedGroups)t.push(a(n.parsedAddress));else if(n.elidedGroups===r.GROUPS)t.push(u(r.GROUPS));else{var i=n.address.split("::");i[0].length&&t.push(a(i[0].split(":"))),t.push(u(n.elidedGroups,0!==i[0].length,0!==i[1].length)),i[1].length&&t.push(a(i[1].split(":"))),t=[t.join(":")]}return e||(t=[].concat("(?=^|\\b|[^\\w\\:])(",t,")(?=[^\\w\\:]|\\b|$)")),t.join("")},n.regularExpression=function(e){return new RegExp(this.regularExpressionString(e),"i")}},{"./constants.js":9,"sprintf-js":20}],13:[function(e,t,n){(function(){var e;function i(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function r(){return new i(null)}var s="undefined"!=typeof navigator;s&&"Microsoft Internet Explorer"==navigator.appName?(i.prototype.am=function(e,t,n,i,r,s){for(var o=32767&t,a=t>>15;--s>=0;){var u=32767&this[e],c=this[e++]>>15,l=a*u+c*o;r=((u=o*u+((32767&l)<<15)+n[i]+(1073741823&r))>>>30)+(l>>>15)+a*c+(r>>>30),n[i++]=1073741823&u}return r},e=30):s&&"Netscape"!=navigator.appName?(i.prototype.am=function(e,t,n,i,r,s){for(;--s>=0;){var o=t*this[e++]+n[i]+r;r=Math.floor(o/67108864),n[i++]=67108863&o}return r},e=26):(i.prototype.am=function(e,t,n,i,r,s){for(var o=16383&t,a=t>>14;--s>=0;){var u=16383&this[e],c=this[e++]>>14,l=a*u+c*o;r=((u=o*u+((16383&l)<<14)+n[i]+r)>>28)+(l>>14)+a*c,n[i++]=268435455&u}return r},e=28),i.prototype.DB=e,i.prototype.DM=(1<<e)-1,i.prototype.DV=1<<e;i.prototype.FV=Math.pow(2,52),i.prototype.F1=52-e,i.prototype.F2=2*e-52;var o,a,u="0123456789abcdefghijklmnopqrstuvwxyz",c=new Array;for(o="0".charCodeAt(0),a=0;a<=9;++a)c[o++]=a;for(o="a".charCodeAt(0),a=10;a<36;++a)c[o++]=a;for(o="A".charCodeAt(0),a=10;a<36;++a)c[o++]=a;function l(e){return u.charAt(e)}function d(e,t){var n=c[e.charCodeAt(t)];return null==n?-1:n}function p(e){var t=r();return t.fromInt(e),t}function f(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function h(e){this.m=e}function v(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function g(e,t){return e&t}function _(e,t){return e|t}function E(e,t){return e^t}function m(e,t){return e&~t}function S(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function C(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function y(){}function b(e){return e}function I(e){this.r2=r(),this.q3=r(),i.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}h.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},h.prototype.revert=function(e){return e},h.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},h.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},h.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},v.prototype.convert=function(e){var t=r();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(i.ZERO)>0&&this.m.subTo(t,t),t},v.prototype.revert=function(e){var t=r();return e.copyTo(t),this.reduce(t),t},v.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],i=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,i,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},v.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},i.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},i.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},i.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var r=e.length,s=!1,o=0;--r>=0;){var a=8==n?255&e[r]:d(e,r);a<0?"-"==e.charAt(r)&&(s=!0):(s=!1,0==o?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,(o+=n)>=this.DB&&(o-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),s&&i.ZERO.subTo(this,this)},i.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},i.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},i.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},i.prototype.lShiftTo=function(e,t){var n,i=e%this.DB,r=this.DB-i,s=(1<<r)-1,o=Math.floor(e/this.DB),a=this.s<<i&this.DM;for(n=this.t-1;n>=0;--n)t[n+o+1]=this[n]>>r|a,a=(this[n]&s)<<i;for(n=o-1;n>=0;--n)t[n]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},i.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var i=e%this.DB,r=this.DB-i,s=(1<<i)-1;t[0]=this[n]>>i;for(var o=n+1;o<this.t;++o)t[o-n-1]|=(this[o]&s)<<r,t[o-n]=this[o]>>i;i>0&&(t[this.t-n-1]|=(this.s&s)<<r),t.t=this.t-n,t.clamp()}},i.prototype.subTo=function(e,t){for(var n=0,i=0,r=Math.min(e.t,this.t);n<r;)i+=this[n]-e[n],t[n++]=i&this.DM,i>>=this.DB;if(e.t<this.t){for(i-=e.s;n<this.t;)i+=this[n],t[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<e.t;)i-=e[n],t[n++]=i&this.DM,i>>=this.DB;i-=e.s}t.s=i<0?-1:0,i<-1?t[n++]=this.DV+i:i>0&&(t[n++]=i),t.t=n,t.clamp()},i.prototype.multiplyTo=function(e,t){var n=this.abs(),r=e.abs(),s=n.t;for(t.t=s+r.t;--s>=0;)t[s]=0;for(s=0;s<r.t;++s)t[s+n.t]=n.am(0,r[s],t,s,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&i.ZERO.subTo(t,t)},i.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var i=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,i,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},i.prototype.divRemTo=function(e,t,n){var s=e.abs();if(!(s.t<=0)){var o=this.abs();if(o.t<s.t)return null!=t&&t.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=r());var a=r(),u=this.s,c=e.s,l=this.DB-f(s[s.t-1]);l>0?(s.lShiftTo(l,a),o.lShiftTo(l,n)):(s.copyTo(a),o.copyTo(n));var d=a.t,p=a[d-1];if(0!=p){var h=p*(1<<this.F1)+(d>1?a[d-2]>>this.F2:0),v=this.FV/h,g=(1<<this.F1)/h,_=1<<this.F2,E=n.t,m=E-d,S=null==t?r():t;for(a.dlShiftTo(m,S),n.compareTo(S)>=0&&(n[n.t++]=1,n.subTo(S,n)),i.ONE.dlShiftTo(d,S),S.subTo(a,a);a.t<d;)a[a.t++]=0;for(;--m>=0;){var C=n[--E]==p?this.DM:Math.floor(n[E]*v+(n[E-1]+_)*g);if((n[E]+=a.am(0,C,n,m,0,d))<C)for(a.dlShiftTo(m,S),n.subTo(S,n);n[E]<--C;)n.subTo(S,n)}null!=t&&(n.drShiftTo(d,t),u!=c&&i.ZERO.subTo(t,t)),n.t=d,n.clamp(),l>0&&n.rShiftTo(l,n),u<0&&i.ZERO.subTo(n,n)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},i.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},i.prototype.exp=function(e,t){if(e>4294967295||e<1)return i.ONE;var n=r(),s=r(),o=t.convert(this),a=f(e)-1;for(o.copyTo(n);--a>=0;)if(t.sqrTo(n,s),(e&1<<a)>0)t.mulTo(s,o,n);else{var u=n;n=s,s=u}return t.revert(n)},i.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,i=(1<<t)-1,r=!1,s="",o=this.t,a=this.DB-o*this.DB%t;if(o-- >0)for(a<this.DB&&(n=this[o]>>a)>0&&(r=!0,s=l(n));o>=0;)a<t?(n=(this[o]&(1<<a)-1)<<t-a,n|=this[--o]>>(a+=this.DB-t)):(n=this[o]>>(a-=t)&i,a<=0&&(a+=this.DB,--o)),n>0&&(r=!0),r&&(s+=l(n));return r?s:"0"},i.prototype.negate=function(){var e=r();return i.ZERO.subTo(this,e),e},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+f(this[this.t-1]^this.s&this.DM)},i.prototype.mod=function(e){var t=r();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(i.ZERO)>0&&e.subTo(t,t),t},i.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new h(t):new v(t),this.exp(e,n)},i.ZERO=p(0),i.ONE=p(1),y.prototype.convert=b,y.prototype.revert=b,y.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},y.prototype.sqrTo=function(e,t){e.squareTo(t)},I.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=r();return e.copyTo(t),this.reduce(t),t},I.prototype.revert=function(e){return e},I.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},I.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},I.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var A,T,D,R=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],w=(1<<26)/R[R.length-1];function N(){var e;e=(new Date).getTime(),T[D++]^=255&e,T[D++]^=e>>8&255,T[D++]^=e>>16&255,T[D++]^=e>>24&255,D>=B&&(D-=B)}if(i.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},i.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),i=p(n),s=r(),o=r(),a="";for(this.divRemTo(i,s,o);s.signum()>0;)a=(n+o.intValue()).toString(e).substr(1)+a,s.divRemTo(i,s,o);return o.intValue().toString(e)+a},i.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var n=this.chunkSize(t),r=Math.pow(t,n),s=!1,o=0,a=0,u=0;u<e.length;++u){var c=d(e,u);c<0?"-"==e.charAt(u)&&0==this.signum()&&(s=!0):(a=t*a+c,++o>=n&&(this.dMultiply(r),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),s&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(e,t,n){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(i.ONE.shiftLeft(e-1),_,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(i.ONE.shiftLeft(e-1),this);else{var r=new Array,s=7&e;r.length=1+(e>>3),t.nextBytes(r),s>0?r[0]&=(1<<s)-1:r[0]=0,this.fromString(r,256)}},i.prototype.bitwiseTo=function(e,t,n){var i,r,s=Math.min(e.t,this.t);for(i=0;i<s;++i)n[i]=t(this[i],e[i]);if(e.t<this.t){for(r=e.s&this.DM,i=s;i<this.t;++i)n[i]=t(this[i],r);n.t=this.t}else{for(r=this.s&this.DM,i=s;i<e.t;++i)n[i]=t(r,e[i]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()},i.prototype.changeBit=function(e,t){var n=i.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n},i.prototype.addTo=function(e,t){for(var n=0,i=0,r=Math.min(e.t,this.t);n<r;)i+=this[n]+e[n],t[n++]=i&this.DM,i>>=this.DB;if(e.t<this.t){for(i+=e.s;n<this.t;)i+=this[n],t[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<e.t;)i+=e[n],t[n++]=i&this.DM,i>>=this.DB;i+=e.s}t.s=i<0?-1:0,i>0?t[n++]=i:i<-1&&(t[n++]=this.DV+i),t.t=n,t.clamp()},i.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},i.prototype.multiplyLowerTo=function(e,t,n){var i,r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n[--r]=0;for(i=n.t-this.t;r<i;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()},i.prototype.multiplyUpperTo=function(e,t,n){--t;var i=n.t=this.t+e.t-t;for(n.s=0;--i>=0;)n[i]=0;for(i=Math.max(t-this.t,0);i<e.t;++i)n[this.t+i-t]=this.am(t-i,e[i],n,0,0,this.t+i-t);n.clamp(),n.drShiftTo(1,n)},i.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var i=this.t-1;i>=0;--i)n=(t*n+this[i])%e;return n},i.prototype.millerRabin=function(e){var t=this.subtract(i.ONE),n=t.getLowestSetBit();if(n<=0)return!1;var s=t.shiftRight(n);(e=e+1>>1)>R.length&&(e=R.length);for(var o=r(),a=0;a<e;++a){o.fromInt(R[Math.floor(Math.random()*R.length)]);var u=o.modPow(s,this);if(0!=u.compareTo(i.ONE)&&0!=u.compareTo(t)){for(var c=1;c++<n&&0!=u.compareTo(t);)if(0==(u=u.modPowInt(2,this)).compareTo(i.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0},i.prototype.clone=function(){var e=r();return this.copyTo(e),e},i.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},i.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},i.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var n,i=this.DB-e*this.DB%8,r=0;if(e-- >0)for(i<this.DB&&(n=this[e]>>i)!=(this.s&this.DM)>>i&&(t[r++]=n|this.s<<this.DB-i);e>=0;)i<8?(n=(this[e]&(1<<i)-1)<<8-i,n|=this[--e]>>(i+=this.DB-8)):(n=this[e]>>(i-=8)&255,i<=0&&(i+=this.DB,--e)),0!=(128&n)&&(n|=-256),0==r&&(128&this.s)!=(128&n)&&++r,(r>0||n!=this.s)&&(t[r++]=n);return t},i.prototype.equals=function(e){return 0==this.compareTo(e)},i.prototype.min=function(e){return this.compareTo(e)<0?this:e},i.prototype.max=function(e){return this.compareTo(e)>0?this:e},i.prototype.and=function(e){var t=r();return this.bitwiseTo(e,g,t),t},i.prototype.or=function(e){var t=r();return this.bitwiseTo(e,_,t),t},i.prototype.xor=function(e){var t=r();return this.bitwiseTo(e,E,t),t},i.prototype.andNot=function(e){var t=r();return this.bitwiseTo(e,m,t),t},i.prototype.not=function(){for(var e=r(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},i.prototype.shiftLeft=function(e){var t=r();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},i.prototype.shiftRight=function(e){var t=r();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},i.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+S(this[e]);return this.s<0?this.t*this.DB:-1},i.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=C(this[n]^t);return e},i.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},i.prototype.setBit=function(e){return this.changeBit(e,_)},i.prototype.clearBit=function(e){return this.changeBit(e,m)},i.prototype.flipBit=function(e){return this.changeBit(e,E)},i.prototype.add=function(e){var t=r();return this.addTo(e,t),t},i.prototype.subtract=function(e){var t=r();return this.subTo(e,t),t},i.prototype.multiply=function(e){var t=r();return this.multiplyTo(e,t),t},i.prototype.divide=function(e){var t=r();return this.divRemTo(e,t,null),t},i.prototype.remainder=function(e){var t=r();return this.divRemTo(e,null,t),t},i.prototype.divideAndRemainder=function(e){var t=r(),n=r();return this.divRemTo(e,t,n),new Array(t,n)},i.prototype.modPow=function(e,t){var n,i,s=e.bitLength(),o=p(1);if(s<=0)return o;n=s<18?1:s<48?3:s<144?4:s<768?5:6,i=s<8?new h(t):t.isEven()?new I(t):new v(t);var a=new Array,u=3,c=n-1,l=(1<<n)-1;if(a[1]=i.convert(this),n>1){var d=r();for(i.sqrTo(a[1],d);u<=l;)a[u]=r(),i.mulTo(d,a[u-2],a[u]),u+=2}var g,_,E=e.t-1,m=!0,S=r();for(s=f(e[E])-1;E>=0;){for(s>=c?g=e[E]>>s-c&l:(g=(e[E]&(1<<s+1)-1)<<c-s,E>0&&(g|=e[E-1]>>this.DB+s-c)),u=n;0==(1&g);)g>>=1,--u;if((s-=u)<0&&(s+=this.DB,--E),m)a[g].copyTo(o),m=!1;else{for(;u>1;)i.sqrTo(o,S),i.sqrTo(S,o),u-=2;u>0?i.sqrTo(o,S):(_=o,o=S,S=_),i.mulTo(S,a[g],o)}for(;E>=0&&0==(e[E]&1<<s);)i.sqrTo(o,S),_=o,o=S,S=_,--s<0&&(s=this.DB-1,--E)}return i.revert(o)},i.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return i.ZERO;for(var n=e.clone(),r=this.clone(),s=p(1),o=p(0),a=p(0),u=p(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),t?(s.isEven()&&o.isEven()||(s.addTo(this,s),o.subTo(e,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;r.isEven();)r.rShiftTo(1,r),t?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(e,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);n.compareTo(r)>=0?(n.subTo(r,n),t&&s.subTo(a,s),o.subTo(u,o)):(r.subTo(n,r),t&&a.subTo(s,a),u.subTo(o,u))}return 0!=r.compareTo(i.ONE)?i.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},i.prototype.pow=function(e){return this.exp(e,new y)},i.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var i=t;t=n,n=i}var r=t.getLowestSetBit(),s=n.getLowestSetBit();if(s<0)return t;for(r<s&&(s=r),s>0&&(t.rShiftTo(s,t),n.rShiftTo(s,n));t.signum()>0;)(r=t.getLowestSetBit())>0&&t.rShiftTo(r,t),(r=n.getLowestSetBit())>0&&n.rShiftTo(r,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return s>0&&n.lShiftTo(s,n),n},i.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=R[R.length-1]){for(t=0;t<R.length;++t)if(n[0]==R[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<R.length;){for(var i=R[t],r=t+1;r<R.length&&i<w;)i*=R[r++];for(i=n.modInt(i);t<r;)if(i%R[t++]==0)return!1}return n.millerRabin(e)},i.prototype.square=function(){var e=r();return this.squareTo(e),e},i.prototype.Barrett=I,null==T){var O;if(T=new Array,D=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var P=new Uint8Array(32);for(window.crypto.getRandomValues(P),O=0;O<32;++O)T[D++]=P[O]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var U=window.crypto.random(32);for(O=0;O<U.length;++O)T[D++]=255&U.charCodeAt(O)}for(;D<B;)O=Math.floor(65536*Math.random()),T[D++]=O>>>8,T[D++]=255&O;D=0,N()}function L(){if(null==A){for(N(),(A=new F).init(T),D=0;D<T.length;++D)T[D]=0;D=0}return A.next()}function M(){}function F(){this.i=0,this.j=0,this.S=new Array}M.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;++t)e[t]=L()},F.prototype.init=function(e){var t,n,i;for(t=0;t<256;++t)this.S[t]=t;for(n=0,t=0;t<256;++t)n=n+this.S[t]+e[t%e.length]&255,i=this.S[t],this.S[t]=this.S[n],this.S[n]=i;this.i=0,this.j=0},F.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var B=256;void 0!==n?n=t.exports={default:i,BigInteger:i,SecureRandom:M}:this.jsbn={BigInteger:i,SecureRandom:M}}).call(this)},{}],14:[function(e,t,n){(function(e){ /** * lodash (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors <https://jquery.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ var i=200,r="Expected a function",s="__lodash_hash_undefined__",o=1,a=2,u=1/0,c=9007199254740991,l=1.7976931348623157e308,d=NaN,p="[object Arguments]",f="[object Array]",h="[object Boolean]",v="[object Date]",g="[object Error]",_="[object Function]",E="[object GeneratorFunction]",m="[object Map]",S="[object Number]",C="[object Object]",y="[object RegExp]",b="[object Set]",I="[object String]",A="[object Symbol]",T="[object ArrayBuffer]",D="[object DataView]",R=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,w=/^\w*$/,N=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,P=/^\s+|\s+$/g,U=/\\(\\)?/g,L=/^[-+]0x[0-9a-f]+$/i,M=/^0b[01]+$/i,F=/^\[object .+?Constructor\]$/,B=/^0o[0-7]+$/i,k=/^(?:0|[1-9]\d*)$/,x={};x["[object Float32Array]"]=x["[object Float64Array]"]=x["[object Int8Array]"]=x["[object Int16Array]"]=x["[object Int32Array]"]=x["[object Uint8Array]"]=x["[object Uint8ClampedArray]"]=x["[object Uint16Array]"]=x["[object Uint32Array]"]=!0,x[p]=x[f]=x[T]=x[h]=x[D]=x[v]=x[g]=x[_]=x[m]=x[S]=x[C]=x[y]=x[b]=x[I]=x["[object WeakMap]"]=!1;var j=parseInt,G="object"==typeof e&&e&&e.Object===Object&&e,V="object"==typeof self&&self&&self.Object===Object&&self,W=G||V||Function("return this")(),z="object"==typeof n&&n&&!n.nodeType&&n,H=z&&"object"==typeof t&&t&&!t.nodeType&&t,q=H&&H.exports===z&&G.process,$=function(){try{return q&&q.binding("util")}catch(e){}}(),K=$&&$.isTypedArray;function X(e,t){for(var n=-1,i=e?e.length:0;++n<i;)if(t(e[n],n,e))return!0;return!1}function Y(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function Z(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function Q(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var J,ee,te,ne=Array.prototype,ie=Function.prototype,re=Object.prototype,se=W["__core-js_shared__"],oe=(J=/[^.]+$/.exec(se&&se.keys&&se.keys.IE_PROTO||""))?"Symbol(src)_1."+J:"",ae=ie.toString,ue=re.hasOwnProperty,ce=re.toString,le=RegExp("^"+ae.call(ue).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),de=W.Symbol,pe=W.Uint8Array,fe=re.propertyIsEnumerable,he=ne.splice,ve=(ee=Object.keys,te=Object,function(e){return ee(te(e))}),ge=Math.max,_e=$e(W,"DataView"),Ee=$e(W,"Map"),me=$e(W,"Promise"),Se=$e(W,"Set"),Ce=$e(W,"WeakMap"),ye=$e(Object,"create"),be=tt(_e),Ie=tt(Ee),Ae=tt(me),Te=tt(Se),De=tt(Ce),Re=de?de.prototype:void 0,we=Re?Re.valueOf:void 0,Ne=Re?Re.toString:void 0;function Oe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Pe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ue(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Le(e){var t=-1,n=e?e.length:0;for(this.__data__=new Ue;++t<n;)this.add(e[t])}function Me(e){this.__data__=new Pe(e)}function Fe(e,t){var n=at(e)||ot(e)?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],i=n.length,r=!!i;for(var s in e)!t&&!ue.call(e,s)||r&&("length"==s||Xe(s,i))||n.push(s);return n}function Be(e,t){for(var n=e.length;n--;)if(st(e[n][0],t))return n;return-1}function ke(e,t){for(var n=0,i=(t=Ye(t,e)?[t]:ze(t)).length;null!=e&&n<i;)e=e[et(t[n++])];return n&&n==i?e:void 0}function xe(e,t){return null!=e&&t in Object(e)}function je(e,t,n,i,r){return e===t||(null==e||null==t||!dt(e)&&!pt(t)?e!=e&&t!=t:function(e,t,n,i,r,s){var u=at(e),c=at(t),l=f,d=f;u||(l=(l=Ke(e))==p?C:l);c||(d=(d=Ke(t))==p?C:d);var _=l==C&&!Y(e),E=d==C&&!Y(t),R=l==d;if(R&&!_)return s||(s=new Me),u||ht(e)?He(e,t,n,i,r,s):function(e,t,n,i,r,s,u){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!i(new pe(e),new pe(t)));case h:case v:case S:return st(+e,+t);case g:return e.name==t.name&&e.message==t.message;case y:case I:return e==t+"";case m:var c=Z;case b:var l=s&a;if(c||(c=Q),e.size!=t.size&&!l)return!1;var d=u.get(e);if(d)return d==t;s|=o,u.set(e,t);var p=He(c(e),c(t),i,r,s,u);return u.delete(e),p;case A:if(we)return we.call(e)==we.call(t)}return!1}(e,t,l,n,i,r,s);if(!(r&a)){var w=_&&ue.call(e,"__wrapped__"),N=E&&ue.call(t,"__wrapped__");if(w||N){var O=w?e.value():e,P=N?t.value():t;return s||(s=new Me),n(O,P,i,r,s)}}if(!R)return!1;return s||(s=new Me),function(e,t,n,i,r,s){var o=r&a,u=vt(e),c=u.length,l=vt(t).length;if(c!=l&&!o)return!1;for(var d=c;d--;){var p=u[d];if(!(o?p in t:ue.call(t,p)))return!1}var f=s.get(e);if(f&&s.get(t))return f==t;var h=!0;s.set(e,t),s.set(t,e);for(var v=o;++d<c;){p=u[d];var g=e[p],_=t[p];if(i)var E=o?i(_,g,p,t,e,s):i(g,_,p,e,t,s);if(!(void 0===E?g===_||n(g,_,i,r,s):E)){h=!1;break}v||(v="constructor"==p)}if(h&&!v){var m=e.constructor,S=t.constructor;m!=S&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof S&&S instanceof S)&&(h=!1)}return s.delete(e),s.delete(t),h}(e,t,n,i,r,s)}(e,t,je,n,i,r))}function Ge(e){return!(!dt(e)||oe&&oe in e)&&(ct(e)||Y(e)?le:F).test(tt(e))}function Ve(e){return"function"==typeof e?e:null==e?gt:"object"==typeof e?at(e)?function(e,t){if(Ye(e)&&Ze(t))return Qe(et(e),t);return function(n){var i=function(e,t,n){var i=null==e?void 0:ke(e,t);return void 0===i?n:i}(n,e);return void 0===i&&i===t?function(e,t){return null!=e&&function(e,t,n){var i,r=-1,s=(t=Ye(t,e)?[t]:ze(t)).length;for(;++r<s;){var o=et(t[r]);if(!(i=null!=e&&n(e,o)))break;e=e[o]}if(i)return i;return!!(s=e?e.length:0)&<(s)&&Xe(o,s)&&(at(e)||ot(e))}(e,t,xe)}(n,e):je(t,i,void 0,o|a)}}(e[0],e[1]):function(e){var t=function(e){var t=vt(e),n=t.length;for(;n--;){var i=t[n],r=e[i];t[n]=[i,r,Ze(r)]}return t}(e);if(1==t.length&&t[0][2])return Qe(t[0][0],t[0][1]);return function(n){return n===e||function(e,t,n,i){var r=n.length,s=r,u=!i;if(null==e)return!s;for(e=Object(e);r--;){var c=n[r];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++r<s;){var l=(c=n[r])[0],d=e[l],p=c[1];if(u&&c[2]){if(void 0===d&&!(l in e))return!1}else{var f=new Me;if(i)var h=i(d,p,l,e,t,f);if(!(void 0===h?je(p,d,i,o|a,f):h))return!1}}return!0}(n,e,t)}}(e):Ye(t=e)?(n=et(t),function(e){return null==e?void 0:e[n]}):function(e){return function(t){return ke(t,e)}}(t);var t,n}function We(e){if(n=(t=e)&&t.constructor,i="function"==typeof n&&n.prototype||re,t!==i)return ve(e);var t,n,i,r=[];for(var s in Object(e))ue.call(e,s)&&"constructor"!=s&&r.push(s);return r}function ze(e){return at(e)?e:Je(e)}function He(e,t,n,i,r,s){var u=r&a,c=e.length,l=t.length;if(c!=l&&!(u&&l>c))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var p=-1,f=!0,h=r&o?new Le:void 0;for(s.set(e,t),s.set(t,e);++p<c;){var v=e[p],g=t[p];if(i)var _=u?i(g,v,p,t,e,s):i(v,g,p,e,t,s);if(void 0!==_){if(_)continue;f=!1;break}if(h){if(!X(t,function(e,t){if(!h.has(t)&&(v===e||n(v,e,i,r,s)))return h.add(t)})){f=!1;break}}else if(v!==g&&!n(v,g,i,r,s)){f=!1;break}}return s.delete(e),s.delete(t),f}function qe(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function $e(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Ge(n)?n:void 0}Oe.prototype.clear=function(){this.__data__=ye?ye(null):{}},Oe.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Oe.prototype.get=function(e){var t=this.__data__;if(ye){var n=t[e];return n===s?void 0:n}return ue.call(t,e)?t[e]:void 0},Oe.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:ue.call(t,e)},Oe.prototype.set=function(e,t){return this.__data__[e]=ye&&void 0===t?s:t,this},Pe.prototype.clear=function(){this.__data__=[]},Pe.prototype.delete=function(e){var t=this.__data__,n=Be(t,e);return!(n<0||(n==t.length-1?t.pop():he.call(t,n,1),0))},Pe.prototype.get=function(e){var t=this.__data__,n=Be(t,e);return n<0?void 0:t[n][1]},Pe.prototype.has=function(e){return Be(this.__data__,e)>-1},Pe.prototype.set=function(e,t){var n=this.__data__,i=Be(n,e);return i<0?n.push([e,t]):n[i][1]=t,this},Ue.prototype.clear=function(){this.__data__={hash:new Oe,map:new(Ee||Pe),string:new Oe}},Ue.prototype.delete=function(e){return qe(this,e).delete(e)},Ue.prototype.get=function(e){return qe(this,e).get(e)},Ue.prototype.has=function(e){return qe(this,e).has(e)},Ue.prototype.set=function(e,t){return qe(this,e).set(e,t),this},Le.prototype.add=Le.prototype.push=function(e){return this.__data__.set(e,s),this},Le.prototype.has=function(e){return this.__data__.has(e)},Me.prototype.clear=function(){this.__data__=new Pe},Me.prototype.delete=function(e){return this.__data__.delete(e)},Me.prototype.get=function(e){return this.__data__.get(e)},Me.prototype.has=function(e){return this.__data__.has(e)},Me.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Pe){var r=n.__data__;if(!Ee||r.length<i-1)return r.push([e,t]),this;n=this.__data__=new Ue(r)}return n.set(e,t),this};var Ke=function(e){return ce.call(e)};function Xe(e,t){return!!(t=null==t?c:t)&&("number"==typeof e||k.test(e))&&e>-1&&e%1==0&&e<t}function Ye(e,t){if(at(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ft(e))||(w.test(e)||!R.test(e)||null!=t&&e in Object(t))}function Ze(e){return e==e&&!dt(e)}function Qe(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}(_e&&Ke(new _e(new ArrayBuffer(1)))!=D||Ee&&Ke(new Ee)!=m||me&&"[object Promise]"!=Ke(me.resolve())||Se&&Ke(new Se)!=b||Ce&&"[object WeakMap]"!=Ke(new Ce))&&(Ke=function(e){var t=ce.call(e),n=t==C?e.constructor:void 0,i=n?tt(n):void 0;if(i)switch(i){case be:return D;case Ie:return m;case Ae:return"[object Promise]";case Te:return b;case De:return"[object WeakMap]"}return t});var Je=rt(function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ft(e))return Ne?Ne.call(e):"";var t=e+"";return"0"==t&&1/e==-u?"-0":t}(t);var n=[];return N.test(e)&&n.push(""),e.replace(O,function(e,t,i,r){n.push(i?r.replace(U,"$1"):t||e)}),n});function et(e){if("string"==typeof e||ft(e))return e;var t=e+"";return"0"==t&&1/e==-u?"-0":t}function tt(e){if(null!=e){try{return ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var nt,it=(nt=function(e,t,n){var i=e?e.length:0;if(!i)return-1;var r,s,o=null==n?0:(r=function(e){if(!e)return 0===e?e:0;if((e=function(e){if("number"==typeof e)return e;if(ft(e))return d;if(dt(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=dt(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(P,"");var n=M.test(e);return n||B.test(e)?j(e.slice(2),n?2:8):L.test(e)?d:+e}(e))===u||e===-u){var t=e<0?-1:1;return t*l}return e==e?e:0}(n),s=r%1,r==r?s?r-s:r:0);return o<0&&(o=ge(i+o,0)),function(e,t,n,i){for(var r=e.length,s=n+(i?1:-1);i?s--:++s<r;)if(t(e[s],s,e))return s;return-1}(e,Ve(t),o)},function(e,t,n){var i=Object(e);if(!ut(e)){var r=Ve(t);e=vt(e),t=function(e){return r(i[e],e,i)}}var s=nt(e,t,n);return s>-1?i[r?e[s]:s]:void 0});function rt(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(r);var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=e.apply(this,i);return n.cache=s.set(r,o),o};return n.cache=new(rt.Cache||Ue),n}function st(e,t){return e===t||e!=e&&t!=t}function ot(e){return function(e){return pt(e)&&ut(e)}(e)&&ue.call(e,"callee")&&(!fe.call(e,"callee")||ce.call(e)==p)}rt.Cache=Ue;var at=Array.isArray;function ut(e){return null!=e&<(e.length)&&!ct(e)}function ct(e){var t=dt(e)?ce.call(e):"";return t==_||t==E}function lt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=c}function dt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function pt(e){return!!e&&"object"==typeof e}function ft(e){return"symbol"==typeof e||pt(e)&&ce.call(e)==A}var ht=K?function(e){return function(t){return e(t)}}(K):function(e){return pt(e)&<(e.length)&&!!x[ce.call(e)]};function vt(e){return ut(e)?Fe(e):We(e)}function gt(e){return e}t.exports=it}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],15:[function(e,t,n){ /** * lodash (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors <https://jquery.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ var i="[object Symbol]",r=Object.prototype.toString;function s(e,t){return e>t}function o(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&r.call(e)==i}function a(e){return e}t.exports=function(e){return e&&e.length?function(e,t,n){for(var i=-1,r=e.length;++i<r;){var s=e[i],a=t(s);if(null!=a&&(void 0===u?a==a&&!o(a):n(a,u)))var u=a,c=s}return c}(e,a,s):void 0}},{}],16:[function(e,t,n){(function(e){ /** * Lodash (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright JS Foundation and other contributors <https://js.foundation/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ var i=200,r="__lodash_hash_undefined__",s=800,o=16,a=9007199254740991,u="[object Arguments]",c="[object AsyncFunction]",l="[object Function]",d="[object GeneratorFunction]",p="[object Null]",f="[object Object]",h="[object Proxy]",v="[object Undefined]",g=/^\[object .+?Constructor\]$/,_=/^(?:0|[1-9]\d*)$/,E={};E["[object Float32Array]"]=E["[object Float64Array]"]=E["[object Int8Array]"]=E["[object Int16Array]"]=E["[object Int32Array]"]=E["[object Uint8Array]"]=E["[object Uint8ClampedArray]"]=E["[object Uint16Array]"]=E["[object Uint32Array]"]=!0,E[u]=E["[object Array]"]=E["[object ArrayBuffer]"]=E["[object Boolean]"]=E["[object DataView]"]=E["[object Date]"]=E["[object Error]"]=E[l]=E["[object Map]"]=E["[object Number]"]=E[f]=E["[object RegExp]"]=E["[object Set]"]=E["[object String]"]=E["[object WeakMap]"]=!1;var m="object"==typeof e&&e&&e.Object===Object&&e,S="object"==typeof self&&self&&self.Object===Object&&self,C=m||S||Function("return this")(),y="object"==typeof n&&n&&!n.nodeType&&n,b=y&&"object"==typeof t&&t&&!t.nodeType&&t,I=b&&b.exports===y,A=I&&m.process,T=function(){try{return A&&A.binding&&A.binding("util")}catch(e){}}(),D=T&&T.isTypedArray;function R(e,t){return"__proto__"==t?void 0:e[t]}var w,N,O,P=Array.prototype,U=Function.prototype,L=Object.prototype,M=C["__core-js_shared__"],F=U.toString,B=L.hasOwnProperty,k=(w=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",x=L.toString,j=F.call(Object),G=RegExp("^"+F.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V=I?C.Buffer:void 0,W=C.Symbol,z=C.Uint8Array,H=V?V.allocUnsafe:void 0,q=(N=Object.getPrototypeOf,O=Object,function(e){return N(O(e))}),$=Object.create,K=L.propertyIsEnumerable,X=P.splice,Y=W?W.toStringTag:void 0,Z=function(){try{var e=ye(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Q=V?V.isBuffer:void 0,J=Math.max,ee=Date.now,te=ye(C,"Map"),ne=ye(Object,"create"),ie=function(){function e(){}return function(t){if(!Ue(t))return{};if($)return $(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function re(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function se(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function oe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function ae(e){var t=this.__data__=new se(e);this.size=t.size}function ue(e,t){var n=Re(e),i=!n&&De(e),r=!n&&!i&&Ne(e),s=!n&&!i&&!r&&Me(e),o=n||i||r||s,a=o?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],u=a.length;for(var c in e)!t&&!B.call(e,c)||o&&("length"==c||r&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||be(c,u))||a.push(c);return a}function ce(e,t,n){(void 0===n||Te(e[t],n))&&(void 0!==n||t in e)||pe(e,t,n)}function le(e,t,n){var i=e[t];B.call(e,t)&&Te(i,n)&&(void 0!==n||t in e)||pe(e,t,n)}function de(e,t){for(var n=e.length;n--;)if(Te(e[n][0],t))return n;return-1}function pe(e,t,n){"__proto__"==t&&Z?Z(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}re.prototype.clear=function(){this.__data__=ne?ne(null):{},this.size=0},re.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},re.prototype.get=function(e){var t=this.__data__;if(ne){var n=t[e];return n===r?void 0:n}return B.call(t,e)?t[e]:void 0},re.prototype.has=function(e){var t=this.__data__;return ne?void 0!==t[e]:B.call(t,e)},re.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ne&&void 0===t?r:t,this},se.prototype.clear=function(){this.__data__=[],this.size=0},se.prototype.delete=function(e){var t=this.__data__,n=de(t,e);return!(n<0||(n==t.length-1?t.pop():X.call(t,n,1),--this.size,0))},se.prototype.get=function(e){var t=this.__data__,n=de(t,e);return n<0?void 0:t[n][1]},se.prototype.has=function(e){return de(this.__data__,e)>-1},se.prototype.set=function(e,t){var n=this.__data__,i=de(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},oe.prototype.clear=function(){this.size=0,this.__data__={hash:new re,map:new(te||se),string:new re}},oe.prototype.delete=function(e){var t=Ce(this,e).delete(e);return this.size-=t?1:0,t},oe.prototype.get=function(e){return Ce(this,e).get(e)},oe.prototype.has=function(e){return Ce(this,e).has(e)},oe.prototype.set=function(e,t){var n=Ce(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},ae.prototype.clear=function(){this.__data__=new se,this.size=0},ae.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ae.prototype.get=function(e){return this.__data__.get(e)},ae.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.set=function(e,t){var n=this.__data__;if(n instanceof se){var r=n.__data__;if(!te||r.length<i-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new oe(r)}return n.set(e,t),this.size=n.size,this};var fe,he=function(e,t,n){for(var i=-1,r=Object(e),s=n(e),o=s.length;o--;){var a=s[fe?o:++i];if(!1===t(r[a],a,r))break}return e};function ve(e){return null==e?void 0===e?v:p:Y&&Y in Object(e)?function(e){var t=B.call(e,Y),n=e[Y];try{e[Y]=void 0;var i=!0}catch(e){}var r=x.call(e);i&&(t?e[Y]=n:delete e[Y]);return r}(e):function(e){return x.call(e)}(e)}function ge(e){return Le(e)&&ve(e)==u}function _e(e){return!(!Ue(e)||k&&k in e)&&(Oe(e)?G:g).test(function(e){if(null!=e){try{return F.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function Ee(e){if(!Ue(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Ie(e),n=[];for(var i in e)("constructor"!=i||!t&&B.call(e,i))&&n.push(i);return n}function me(e,t,n,i,r){e!==t&&he(t,function(s,o){if(Ue(s))r||(r=new ae),function(e,t,n,i,r,s,o){var a=R(e,n),u=R(t,n),c=o.get(u);if(c)return void ce(e,n,c);var l=s?s(a,u,n+"",e,t,o):void 0,d=void 0===l;if(d){var p=Re(u),h=!p&&Ne(u),v=!p&&!h&&Me(u);l=u,p||h||v?Re(a)?l=a:Le(S=a)&&we(S)?l=function(e,t){var n=-1,i=e.length;t||(t=Array(i));for(;++n<i;)t[n]=e[n];return t}(a):h?(d=!1,l=function(e,t){if(t)return e.slice();var n=e.length,i=H?H(n):new e.constructor(n);return e.copy(i),i}(u,!0)):v?(d=!1,g=u,_=!0?(E=g.buffer,m=new E.constructor(E.byteLength),new z(m).set(new z(E)),m):g.buffer,l=new g.constructor(_,g.byteOffset,g.length)):l=[]:function(e){if(!Le(e)||ve(e)!=f)return!1;var t=q(e);if(null===t)return!0;var n=B.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&F.call(n)==j}(u)||De(u)?(l=a,De(a)?l=function(e){return function(e,t,n,i){var r=!n;n||(n={});var s=-1,o=t.length;for(;++s<o;){var a=t[s],u=i?i(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),r?pe(n,a,u):le(n,a,u)}return n}(e,Fe(e))}(a):(!Ue(a)||i&&Oe(a))&&(l=function(e){return"function"!=typeof e.constructor||Ie(e)?{}:ie(q(e))}(u))):d=!1}var g,_,E,m;var S;d&&(o.set(u,l),r(l,u,i,s,o),o.delete(u));ce(e,n,l)}(e,t,o,n,me,i,r);else{var a=i?i(R(e,o),s,o+"",e,t,r):void 0;void 0===a&&(a=s),ce(e,o,a)}},Fe)}function Se(e,t){return Ae(function(e,t,n){return t=J(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,s=J(i.length-t,0),o=Array(s);++r<s;)o[r]=i[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=i[r];return a[t]=n(o),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,a)}}(e,t,xe),e+"")}function Ce(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function ye(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return _e(n)?n:void 0}function be(e,t){var n=typeof e;return!!(t=null==t?a:t)&&("number"==n||"symbol"!=n&&_.test(e))&&e>-1&&e%1==0&&e<t}function Ie(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||L)}var Ae=function(e){var t=0,n=0;return function(){var i=ee(),r=o-(i-n);if(n=i,r>0){if(++t>=s)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Z?function(e,t){return Z(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:xe);function Te(e,t){return e===t||e!=e&&t!=t}var De=ge(function(){return arguments}())?ge:function(e){return Le(e)&&B.call(e,"callee")&&!K.call(e,"callee")},Re=Array.isArray;function we(e){return null!=e&&Pe(e.length)&&!Oe(e)}var Ne=Q||function(){return!1};function Oe(e){if(!Ue(e))return!1;var t=ve(e);return t==l||t==d||t==c||t==h}function Pe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Ue(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Le(e){return null!=e&&"object"==typeof e}var Me=D?function(e){return function(t){return e(t)}}(D):function(e){return Le(e)&&Pe(e.length)&&!!E[ve(e)]};function Fe(e){return we(e)?ue(e,!0):Ee(e)}var Be,ke=(Be=function(e,t,n){me(e,t,n)},Se(function(e,t){var n=-1,i=t.length,r=i>1?t[i-1]:void 0,s=i>2?t[2]:void 0;for(r=Be.length>3&&"function"==typeof r?(i--,r):void 0,s&&function(e,t,n){if(!Ue(n))return!1;var i=typeof t;return!!("number"==i?we(n)&&be(t,n.length):"string"==i&&t in n)&&Te(n[t],e)}(t[0],t[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++n<i;){var o=t[n];o&&Be(e,o,n,r)}return e}));function xe(e){return e}t.exports=ke}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],17:[function(e,t,n){(function(e){ /** * lodash (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors <https://jquery.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ var n,i=1/0,r=9007199254740991,s=1.7976931348623157e308,o=NaN,a="[object Symbol]",u=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,d=/^0o[0-7]+$/i,p="[\\ud800-\\udfff]",f="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",h="\\ud83c[\\udffb-\\udfff]",v="[^\\ud800-\\udfff]",g="(?:\\ud83c[\\udde6-\\uddff]){2}",_="[\\ud800-\\udbff][\\udc00-\\udfff]",E="(?:"+f+"|"+h+")"+"?",m="[\\ufe0e\\ufe0f]?"+E+("(?:\\u200d(?:"+[v,g,_].join("|")+")[\\ufe0e\\ufe0f]?"+E+")*"),S="(?:"+[v+f+"?",f,g,_,p].join("|")+")",C=RegExp(h+"(?="+h+")|"+S+m,"g"),y=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),b=parseInt,I="object"==typeof e&&e&&e.Object===Object&&e,A="object"==typeof self&&self&&self.Object===Object&&self,T=I||A||Function("return this")(),D=(n="length",function(e){return null==e?void 0:e[n]});function R(e){return y.test(e)}function w(e){return R(e)?function(e){var t=C.lastIndex=0;for(;C.test(e);)t++;return t}(e):D(e)}function N(e){return R(e)?function(e){return e.match(C)||[]}(e):function(e){return e.split("")}(e)}var O=Object.prototype.toString,P=T.Symbol,U=Math.ceil,L=Math.floor,M=P?P.prototype:void 0,F=M?M.toString:void 0;function B(e,t){var n="";if(!e||t<1||t>r)return n;do{t%2&&(n+=e),(t=L(t/2))&&(e+=e)}while(t);return n}function k(e){if("string"==typeof e)return e;if(G(e))return F?F.call(e):"";var t=e+"";return"0"==t&&1/e==-i?"-0":t}function x(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:function(e,t,n){var i=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(r);++i<r;)s[i]=e[i+t];return s}(e,t,n)}function j(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function G(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&O.call(e)==a}function V(e){return e?(e=function(e){if("number"==typeof e)return e;if(G(e))return o;if(j(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=j(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(u,"");var n=l.test(e);return n||d.test(e)?b(e.slice(2),n?2:8):c.test(e)?o:+e}(e))===i||e===-i?(e<0?-1:1)*s:e==e?e:0:0===e?e:0}t.exports=function(e,t,n){var i;e=null==(i=e)?"":k(i);var r=(t=function(e){var t=V(e),n=t%1;return t==t?n?t-n:t:0}(t))?w(e):0;return t&&r<t?function(e,t){var n=(t=void 0===t?" ":k(t)).length;if(n<2)return n?B(t,e):t;var i=B(t,U(e/w(t)));return R(t)?x(N(i),0,e).join(""):i.slice(0,e)}(t-r,n)+e:e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],18:[function(e,t,n){(function(e){ /** * lodash (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors <https://jquery.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ var n=1/0,i=9007199254740991,r=1.7976931348623157e308,s=NaN,o="[object Function]",a="[object GeneratorFunction]",u="[object Symbol]",c=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,p=/^0o[0-7]+$/i,f=/^(?:0|[1-9]\d*)$/,h=parseInt,v="object"==typeof e&&e&&e.Object===Object&&e,g="object"==typeof self&&self&&self.Object===Object&&self,_=v||g||Function("return this")(),E=Object.prototype.toString,m=_.Symbol,S=Math.floor,C=m?m.prototype:void 0,y=C?C.toString:void 0;function b(e,t,n){if(!I(n))return!1;var r=typeof t;return!!("number"==r?function(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}(e.length)&&!function(e){var t=I(e)?E.call(e):"";return t==o||t==a}(e)}(n)&&function(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||f.test(e))&&e>-1&&e%1==0&&e<t}(t,n.length):"string"==r&&t in n)&&function(e,t){return e===t||e!=e&&t!=t}(n[t],e)}function I(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function A(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&E.call(e)==u}function T(e){return e?(e=function(e){if("number"==typeof e)return e;if(A(e))return s;if(I(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=I(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(c,"");var n=d.test(e);return n||p.test(e)?h(e.slice(2),n?2:8):l.test(e)?s:+e}(e))===n||e===-n?(e<0?-1:1)*r:e==e?e:0:0===e?e:0}function D(e){return null==e?"":function(e){if("string"==typeof e)return e;if(A(e))return y?y.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}(e)}t.exports=function(e,t,n){var r,s;return(n?b(e,t,n):void 0===t)?t=1:(r=T(t),s=r%1,t=r==r?s?r-s:r:0),function(e,t){var n="";if(!e||t<1||t>i)return n;do{t%2&&(n+=e),(t=S(t/2))&&(e+=e)}while(t);return n}(D(e),t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],19:[function(e,t,n){"use strict";var i=Object.prototype.hasOwnProperty;function r(e,t){return Array.isArray(e)?function(e,t){for(var n,i="",s="",o=Array.isArray(t),a=0;a<e.length;a++)(n=r(e[a]))&&(o&&t[a]&&(n=u(n)),i=i+s+n,s=" ");return i}(e,t):e&&"object"==typeof e?function(e){var t="",n="";for(var r in e)r&&e[r]&&i.call(e,r)&&(t=t+n+r,n=" ");return t}(e):e||""}function s(e){if(!e)return"";if("object"==typeof e){var t="";for(var n in e)i.call(e,n)&&(t=t+n+":"+e[n]+";");return t}return e+""}function o(e,t,n,i){return!1!==t&&null!=t&&(t||"class"!==e&&"style"!==e)?!0===t?" "+(i?e:e+'="'+e+'"'):("function"==typeof t.toJSON&&(t=t.toJSON()),"string"==typeof t||(t=JSON.stringify(t),n||-1===t.indexOf('"'))?(n&&(t=u(t))," "+e+'="'+t+'"'):" "+e+"='"+t.replace(/'/g,"'")+"'"):""}n.merge=function e(t,n){if(1===arguments.length){for(var i=t[0],r=1;r<t.length;r++)i=e(i,t[r]);return i}for(var o in n)if("class"===o){var a=t[o]||[];t[o]=(Array.isArray(a)?a:[a]).concat(n[o]||[])}else if("style"===o){var a=s(t[o]);a=a&&";"!==a[a.length-1]?a+";":a;var u=s(n[o]);u=u&&";"!==u[u.length-1]?u+";":u,t[o]=a+u}else t[o]=n[o];return t},n.classes=r,n.style=s,n.attr=o,n.attrs=function(e,t){var n="";for(var a in e)if(i.call(e,a)){var u=e[a];if("class"===a){u=r(u),n=o(a,u,!1,t)+n;continue}"style"===a&&(u=s(u)),n+=o(a,u,!1,t)}return n};var a=/["&<>]/;function u(e){var t=""+e,n=a.exec(t);if(!n)return e;var i,r,s,o="";for(i=n.index,r=0;i<t.length;i++){switch(t.charCodeAt(i)){case 34:s=""";break;case 38:s="&";break;case 60:s="<";break;case 62:s=">";break;default:continue}r!==i&&(o+=t.substring(r,i)),r=i+1,o+=s}return r!==i?o+t.substring(r,i):o}n.escape=u,n.rethrow=function t(n,i,r,s){if(!(n instanceof Error))throw n;if(!("undefined"==typeof window&&i||s))throw n.message+=" on line "+r,n;try{s=s||e("fs").readFileSync(i,"utf8")}catch(e){t(n,null,r)}var o=3,a=s.split("\n"),u=Math.max(r-o,0),c=Math.min(a.length,r+o);var o=a.slice(u,c).map(function(e,t){var n=t+u+1;return(n==r?" > ":" ")+n+"| "+e}).join("\n");n.path=i;n.message=(i||"Pug")+":"+r+"\n"+o+"\n\n"+n.message;throw n}},{fs:1}],20:[function(e,t,n){!function(e){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};function i(){var e=arguments[0],t=i.cache;return t[e]||(t[e]=i.parse(e)),i.format.call(null,t[e],arguments)}i.format=function(e,n){var r,o,u,c,l,d,p,f=1,h=e.length,v="",g=[],_=!0,E="";for(o=0;o<h;o++)if("string"===(v=s(e[o])))g[g.length]=e[o];else if("array"===v){if((c=e[o])[2])for(r=n[f],u=0;u<c[2].length;u++){if(!r.hasOwnProperty(c[2][u]))throw new Error(i('[sprintf] property "%s" does not exist',c[2][u]));r=r[c[2][u]]}else r=c[1]?n[c[1]]:n[f++];if(t.not_type.test(c[8])&&t.not_primitive.test(c[8])&&"function"==s(r)&&(r=r()),t.numeric_arg.test(c[8])&&"number"!=s(r)&&isNaN(r))throw new TypeError(i("[sprintf] expecting number but found %s",s(r)));switch(t.number.test(c[8])&&(_=r>=0),c[8]){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,c[6]?parseInt(c[6]):0);break;case"e":r=c[7]?parseFloat(r).toExponential(c[7]):parseFloat(r).toExponential();break;case"f":r=c[7]?parseFloat(r).toFixed(c[7]):parseFloat(r);break;case"g":r=c[7]?parseFloat(r).toPrecision(c[7]):parseFloat(r);break;case"o":r=r.toString(8);break;case"s":r=String(r),r=c[7]?r.substring(0,c[7]):r;break;case"t":r=String(!!r),r=c[7]?r.substring(0,c[7]):r;break;case"T":r=s(r),r=c[7]?r.substring(0,c[7]):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=c[7]?r.substring(0,c[7]):r;break;case"x":r=parseInt(r,10).toString(16);break;case"X":r=parseInt(r,10).toString(16).toUpperCase()}t.json.test(c[8])?g[g.length]=r:(!t.number.test(c[8])||_&&!c[3]?E="":(E=_?"+":"-",r=r.toString().replace(t.sign,"")),d=c[4]?"0"===c[4]?"0":c[4].charAt(1):" ",p=c[6]-(E+r).length,l=c[6]&&p>0?a(d,p):"",g[g.length]=c[5]?E+r+l:"0"===d?E+l+r:l+E+r)}return g.join("")},i.cache=Object.create(null),i.parse=function(e){for(var n=e,i=[],r=[],s=0;n;){if(null!==(i=t.text.exec(n)))r[r.length]=i[0];else if(null!==(i=t.modulo.exec(n)))r[r.length]="%";else{if(null===(i=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(i[2]){s|=1;var o=[],a=i[2],u=[];if(null===(u=t.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o[o.length]=u[1];""!==(a=a.substring(u[0].length));)if(null!==(u=t.key_access.exec(a)))o[o.length]=u[1];else{if(null===(u=t.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");o[o.length]=u[1]}i[2]=o}else s|=2;if(3===s)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r[r.length]=i}n=n.substring(i[0].length)}return r};var r=function(e,t,n){return(n=(t||[]).slice(0)).splice(0,0,e),i.apply(null,n)};function s(e){return"number"==typeof e?"number":"string"==typeof e?"string":Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}var o={0:["","0","00","000","0000","00000","000000","0000000"]," ":[""," "," "," "," "," "," "," "],_:["","_","__","___","____","_____","______","_______"]};function a(e,t){return t>=0&&t<=7&&o[e]?o[e][t]:Array(t+1).join(e)}void 0!==n&&(n.sprintf=i,n.vsprintf=r),void 0!==e&&(e.sprintf=i,e.vsprintf=r,"function"==typeof define&&define.amd&&define(function(){return{sprintf:i,vsprintf:r}}))}("undefined"==typeof window?this:window)},{}],21:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").directive("unifiBlacklist",function(){return{require:"ngModel",link:function(e,t,n,i){var r=n.unifiBlacklist.split(","),s=function(e){return e=e||"",-1===r.indexOf(e)?(i.$setValidity("blacklist",!0),e):(i.$setValidity("blacklist",!1),null)};i.$parsers.unshift(s),i.$formatters.unshift(s),e.$watch(n.ngModel,function(){s(i.$viewValue)})}}})},{}],22:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").directive("unifiValidatePasswordDuplicate",function(){return{scope:{passwordToCompare:"=unifiValidatePasswordDuplicate"},restrict:"A",require:"ngModel",link:function(e,t,n,i){e.$watch("passwordToCompare",function(){angular.forEach(i.$parsers,function(e){e(i.$viewValue)})}),i.$parsers.push(function(t){return i.$setValidity("passwordDuplicate",t!==e.passwordToCompare),t})}}})},{}],23:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").controller("WizardHeaderController",["$state","$scope",function(e,t){this.params=e.params,t.$on("$stateChangeSuccess",function(){this.params=e.params}.bind(this)),this.getProgress=function(){return Math.round(this.params.index/this.params.steps*100)},this.getStepTitle=function(){return this.params.title}}])},{}],24:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").directive("unifiWizardHeader",[function(){return{controller:"WizardHeaderController",controllerAs:"wizardHeaderCtrl",template:e("./wizardHeader.pug")(),replace:!0,restrict:"E"}}])},{"./wizardHeader.pug":25}],25:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<div class="unifiWizardHeader"><h3 class="mb-3" translate="{{wizardHeaderCtrl.getStepTitle()}}"></h3><div class="ubntStatusBar ubntStatusBar--success mb-2"><div class="ubntStatusBar__status" ng-style="{width: wizardHeaderCtrl.getProgress() + \'%\'}"></div></div></div>'}},{"pug-runtime":19}],26:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").controller("WizardStepController",["$q","$scope","$state","system","ENV","wizard",function(e,t,n,i,r,s){this.canProceed=!0,this.params=n.params,this.ENV=r,this.system=i,t.$on("$stateChangeSuccess",function(){this.params=n.params}.bind(this)),this.onSubmit=function(){this.params.next?this.gotoNext():this.params.last&&this.finish()},this.gotoPrevious=function(){this.onPrevious&&this.onPrevious(),n.go(this.params.previous)},this.gotoNext=function(){this.canProceed&&(this.isSubmitting=!0,e.when(this.onNext&&this.onNext()).then(function(e){n.go(e||this.params.next)}.bind(this)).finally(function(){this.isSubmitting=!1}.bind(this)))},this.skip=function(){e.when(this.onSkip&&this.onSkip()).then(function(e){n.go(e||this.params.next)}.bind(this))},this.finish=function(){this.canProceed&&(this.onFinish?(this.isFinishing=!0,this.onFinish().then(function(){n.go(this.ENV.LOGIN_STATE)}.bind(this)).finally(function(){this.isFinishing=!1}.bind(this))):n.go(this.ENV.LOGIN_STATE))},this.skipWizard=function(){if(!this.params.last)return this.isFinishing=!0,s.setupCompleted().then(function(){n.go(this.ENV.LOGIN_STATE)}.bind(this)).finally(function(){this.isFinishing=!1}.bind(this))}}])},{}],27:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").directive("unifiWizardStep",[function(){return{controller:"WizardStepController",controllerAs:"wizardStepCtrl",template:e("./wizardStep.pug")(),bindToController:!0,restrict:"E",scope:{onNext:"&?",onPrevious:"&?",onFinish:"&?",onSkip:"&?",canProceed:"=?"},transclude:!0}}])},{"./wizardStep.pug":28}],28:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t=t+'<form class="unifiWizardStep ubntForm" name="wizardStepCtrl.form" ng-submit="wizardStepCtrl.onSubmit()"><ng-transclude class="unifiWizardStepContent"></ng-transclude><div class="unifiWizardNavigation ubntFooter"><div class="ubntFooter__actions"><div class="ubntButtonGroup ubntButtonGroup--cozy"><button class="ubntButton ubntButton--secondary" ng-if="wizardStepCtrl.params.previous" ng-click="wizardStepCtrl.gotoPrevious()" type="button">{{ \'COMMON_ACTIONS_BACK\' | translate }}</button></div></div><div class="ubntFooter__actions"><div class="ubntButtonGroup ubntButtonGroup--cozy"><button class="ubntButton ubntButton--secondary" ng-if="wizardStepCtrl.params.skippable" ng-click="wizardStepCtrl.skip()" type="button">{{ \'COMMON_ACTIONS_SKIP\' | translate }}</button><button class="ubntButton ubntButton--secondary" ng-if="!wizardStepCtrl.params.previous && wizardStepCtrl.system.isUnifiGo()" ng-click="wizardStepCtrl.skipWizard()" busy-toggle="wizardStepCtrl.isFinishing" busy-toggle-spinner-classes="[\'appSpinner appSpinner--light appSpinner--centered appSpinner--small\']" type="button">{{\'COMMON_ACTIONS_SKIP_WIZARD\' | translate}}</button><button class="ubntButton ubntButton--primary" ng-if="wizardStepCtrl.params.next" ng-disabled="!wizardStepCtrl.canProceed" busy-toggle="wizardStepCtrl.isSubmitting" busy-toggle-spinner-classes="[\'appSpinner appSpinner--light appSpinner--centered appSpinner--small\']" type="submit">{{ \'COMMON_ACTIONS_NEXT\' | translate }}</button><button class="ubntButton ubntButton--primary"'+(n="autofocus",r=!0,s=!0,o=!0,!1!==r&&null!=r&&(r||"class"!==n&&"style"!==n)?!0===r?" "+(o?n:n+'="'+n+'"'):("function"==typeof r.toJSON&&(r=r.toJSON()),"string"==typeof r||(r=JSON.stringify(r),s||-1===r.indexOf('"'))?(s&&(r=function(e){var t=""+e,n=i.exec(t);if(!n)return e;var r,s,o,a="";for(r=n.index,s=0;r<t.length;r++){switch(t.charCodeAt(r)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==r&&(a+=t.substring(s,r)),s=r+1,a+=o}return s!==r?a+t.substring(s,r):a}(r))," "+n+'="'+r+'"'):" "+n+"='"+r.replace(/'/g,"'")+"'"):"")+' ng-if="wizardStepCtrl.params.last" busy-toggle="wizardStepCtrl.isFinishing" busy-toggle-spinner-classes="[\'appSpinner appSpinner--light appSpinner--centered appSpinner--small\']" type="submit">{{\'COMMON_ACTIONS_FINISH\' | translate}}</button></div></div></div></form>';var n,r,s,o};var i=/["&<>]/},{"pug-runtime":19}],29:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").constant("FLAGS",{enableOptimizeNetwork:!0})},{}],30:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").config(["frameProvider",function(t){t.when("alert",{layout:"alertLayout",controller:"AlertController",controllerAs:"alertCtrl",template:e("../frames/alert/alert.pug")()}).when("sshCredentials",{controller:"SshCredentialsController",controllerAs:"sshCredentialsCtrl",layout:"sshCredentialsLayout",template:e("../frames/sshCredentials/sshCredentials.pug")()})}])},{"../frames/alert/alert.pug":38,"../frames/sshCredentials/sshCredentials.pug":40}],31:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").config(["$urlRouterProvider","$locationProvider",function(e,t){e.otherwise("/wizard/"),t.html5Mode({enabled:!0,requireBase:!1})}])},{}],32:[function(e,t,n){"use strict";var i=e("../lib/resolve");angular.module("app-unifi-wizard").config(["$stateProvider",function(t){t.state("wizard",{url:"/wizard",abstract:!0,template:e("../views/wizard/wizard.pug")(),resolve:i.wizard}).state("wizard.step",{abstract:!0,template:e("../views/wizard.step/wizardStep.pug")(),params:{steps:5}}).state("wizard.step.update",{url:"/",template:e("../views/wizard.step.update/wizardStepUpdate.pug")(),controller:"WizardStepUpdateController",controllerAs:"wizardStepUpdateCtrl",params:{title:"WIZARD_UPDATE_FIRMWARE_TITLE",index:0,skippable:!0,skipTo:"wizard.step.init"},resolve:i.update}).state("wizard.step.init",{url:"/",template:e("../views/wizard.step.init/wizardStepInit.pug")(),controller:"WizardStepInitController",controllerAs:"wizardStepInitCtrl",params:{title:"WIZARD_WELCOME_TITLE",index:1,next:"wizard.step.discover"},resolve:i.init}).state("wizard.step.discover",{url:"/",template:e("../views/wizard.step.discover/wizardStepDiscover.pug")(),controller:"WizardStepDiscoverController",controllerAs:"wizardStepDiscoverCtrl",params:{title:"WIZARD_DISCOVER_TITLE",index:2,previous:"wizard.step.init",next:"wizard.step.wifi"},resolve:i.discover}).state("wizard.step.wifi",{url:"/",template:e("../views/wizard.step.wifi/wizardStepWifi.pug")(),controller:"WizardStepWifiController",controllerAs:"wizardStepWifiCtrl",params:{title:"WIZARD_WIFI_TITLE",index:3,previous:"wizard.step.discover",next:"wizard.step.credentials",skippable:!0}}).state("wizard.step.credentials",{url:"/",template:e("../views/wizard.step.credentials/wizardStepCredentials.pug")(),controller:"WizardStepCredentialsController",controllerAs:"wizardStepCredentialsCtrl",params:{title:"WIZARD_CREDENTIALS_TITLE",index:4,previous:"wizard.step.wifi",next:"wizard.step.finish"},resolve:i.credentials}).state("wizard.step.finish",{url:"/",template:e("../views/wizard.step.finish/wizardStepFinish.pug")(),controller:"WizardStepFinishController",controllerAs:"wizardStepFinishCtrl",params:{title:"WIZARD_FINISH_TITLE",index:5,previous:"wizard.step.credentials",last:!0}}).state("wizard.login",{url:"/login",controller:"WizardLoginController",controllerAs:"loginCtrl"}).state("wizard.ssologin",{url:"/sso_login/:sso_token/:ubic_uuid/:site_id",template:e("../../base-unifi/views/ssoLogin.pug")(),resolve:i.ssoLogin}).state("wizard.fatal",{controller:"FatalController",controllerAs:"fatalCtrl",url:"/fatal/:error",template:e("../../base-unifi/views/fatal.pug")(),params:{error:{value:"400",squash:!0}},resolve:i.fatal})}])},{"../../base-unifi/views/fatal.pug":206,"../../base-unifi/views/ssoLogin.pug":207,"../lib/resolve":41,"../views/wizard.step.credentials/wizardStepCredentials.pug":55,"../views/wizard.step.discover/wizardStepDiscover.pug":57,"../views/wizard.step.finish/wizardStepFinish.pug":59,"../views/wizard.step.init/wizardStepInit.pug":61,"../views/wizard.step.update/wizardStepUpdate.pug":63,"../views/wizard.step.wifi/wizardStepWifi.pug":65,"../views/wizard.step/wizardStep.pug":66,"../views/wizard/wizard.pug":67}],33:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").constant("APP_PREFERENCES",{ROWS_PER_PAGE:10})},{}],34:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").value("LoginLocation","/manage/").value("CountryEndpoint","/set/setting/country").value("MgmtEndpoint","/set/setting/mgmt").value("NetworkOptimizationEndpoint","/set/setting/network_optimization").value("SuperMgmtEndpoint","/set/setting/super_mgmt").value("TimezoneEndpoint","/set/setting/locale")},{}],35:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").constant("ENV",{APP:"app-unifi-wizard",APP_STATE_PREFIX:"wizard.",LOGIN_STATE:"wizard.login",HOME_STATE:"wizard.step.update",FATAL_STATE:"wizard.fatal",STORE_ACTIVE_SITE:!1})},{}],36:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").controller("WizardController",["preferences","ENV",function(e,t){return new function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this.ENV=t,e.fetchPreferences()}}])},{}],37:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").controller("AlertController",["title","message",function(e,t){return new function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this.message=t,this.title=e}}])},{}],38:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<div class="ubntModal ubntModal--small"><div class="ubntModal__header pb-0"><div class="ubntHeader ubntHeader--centered"><div class="ubntHeader__title">{{alertCtrl.title}}</div><div class="ubntHeader__actions"><div class="ubntIconGroup"><unifi-aura-icon unifi-aura-icon="::\'close\'" unifi-aura-icon-class="::[\'ubntIcon\', \'ubntIcon--actionable\']" frame-close="alert"></unifi-aura-icon></div></div></div></div><div class="ubntModal__main"><div class="ubntModalContent pb-0">{{ alertCtrl.message }}</div></div><div class="ubntModal__footer"><div class="ubntFooter"><div class="ubntFooter__buttons"><div class="ubntButtonGroup ubntButtonGroup--cozy"><button class="ubntButton ubntButton--primary" frame-close="alert" translate="COMMON_ACTIONS_CLOSE"></button></div></div></div></div></div>'}},{"pug-runtime":19}],39:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("app-unifi-wizard").controller("SshCredentialsController",["$rootScope","frame","REGEX_PATTERNS",function(e,t,n){return new(function(){function r(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var i=e.$on("$frameClose:sshCredentials",function(){t.close(),i()});this.patterns={sshUsername:n.SSH_USERNAME}}return i(r,[{key:"submit",value:function(){t.getLayout("sshCredentialsLayout").resolve({sshUsername:this.sshUsername,sshPassword:this.sshPassword})}},{key:"isSubmitAllowed",value:function(){return this.form.$valid&&!this.form.$pristine}},{key:"close",value:function(){return t.getLayout("sshCredentialsLayout").reject()}}]),r}())}])},{}],40:[function(e,t,n){e("pug-runtime");function i(e,t,n,i){return!1!==t&&null!=t&&(t||"class"!==e&&"style"!==e)?!0===t?" "+(i?e:e+'="'+e+'"'):("function"==typeof t.toJSON&&(t=t.toJSON()),"string"==typeof t||(t=JSON.stringify(t),n||-1===t.indexOf('"'))?(n&&(t=function(e){var t=""+e,n=r.exec(t);if(!n)return e;var i,s,o,a="";for(i=n.index,s=0;i<t.length;i++){switch(t.charCodeAt(i)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==i&&(a+=t.substring(s,i)),s=i+1,a+=o}return s!==i?a+t.substring(s,i):a}(t))," "+e+'="'+t+'"'):" "+e+"='"+t.replace(/'/g,"'")+"'"):""}t.exports=function(e){var t="";return t=t+'<div class="ubntModal ubntModal--medium"><form class="ubntForm"'+i("novalidate",!0,!0,!0)+' autocomplete="off" name="sshCredentialsCtrl.form" ng-class="{ \'is-form-validation-visible\': sshCredentialsCtrl.showValidation, \'is-validation-hidden\': !sshCredentialsCtrl.showValidation }" ng-submit="sshCredentialsCtrl.isSubmitAllowed() && sshCredentialsCtrl.submit()"><div class="ubntModal__header pb-0"><div class="ubntHeader ubntHeader--centered"><div class="ubntHeader__title" translate="WIZARD_CREDENTIALS_CHANGE_SSH_CREDENTIALS_TITLE"></div><div class="ubntHeader__actions"><div class="ubntIconGroup"><unifi-aura-icon unifi-aura-icon="::\'close\'" unifi-aura-icon-class="::[\'ubntIcon\', \'ubntIcon--actionable\']" ng-click="sshCredentialsCtrl.close()"></unifi-aura-icon></div></div></div></div><div class="ubntModal__main"><div class="ubntModalContent pb-0"><div class="container container--horizontal-cozy container--vertical-comfy container--flush"><div class="row"><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_CREDENTIALS_SSH_USERNAME"></label><input class="width-full" name="sshU" ng-class="{\'is-empty\': sshCredentialsCtrl.form.sshU.$untouched}" ng-minlength="4" ng-model="sshCredentialsCtrl.sshUsername" ng-maxlength="sshCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_SSH_USERNAME_LENGTH" ng-pattern="sshCredentialsCtrl.patterns.sshUsername"'+i("required",!0,!0,!0)+' type="text"><div class="appInputFeedback appInputFeedback--danger" ng-show="sshCredentialsCtrl.form.sshU.$error.maxlength" translate="VALIDATION_HINT_MAX_LENGTH" translate-values="{ max: sshCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_SSH_USERNAME_LENGTH }"></div><div class="appInputFeedback appInputFeedback--danger" ng-show="sshCredentialsCtrl.form.sshU.$error.pattern" translate="VALIDATION_HINT_ADMIN_NAME"></div></div></div><div class="row"><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_CREDENTIALS_SSH_PASSWORD"></label><input class="width-full" name="sshP" ng-class="{\'is-empty\': sshCredentialsCtrl.form.sshP.$untouched}" ng-minlength="4" ng-model="sshCredentialsCtrl.sshPassword" ng-maxlength="sshCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_SSH_PASSWORD_LENGTH"'+i("required",!0,!0,!0)+' type="password" unifi-blacklist="ubnt"><div class="appInputFeedback appInputFeedback--danger" ng-show="sshCredentialsCtrl.form.sshP.$error.minlength" translate="WIZARD_CREDENTIALS_SSH_PASSWORD_TOO_SHORT_ERROR"></div><div class="appInputFeedback appInputFeedback--danger" ng-show="sshCredentialsCtrl.form.sshP.$error.blacklist" translate="WIZARD_CREDENTIALS_SSH_PASSWORD_DEFAULT_ERROR"></div><div class="appInputFeedback appInputFeedback--danger" ng-show="sshCredentialsCtrl.form.sshP.$error.maxlength" translate="VALIDATION_HINT_MAX_LENGTH" translate-values="{ max: sshCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_SSH_PASSWORD_LENGTH }"></div></div><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_CREDENTIALS_SSH_CONFIRM_PASSWORD"></label><input class="width-full" name="sshConfirmP" ng-class="{\'is-empty\': sshCredentialsCtrl.form.sshConfirmP.$untouched}" ng-minlength="4" ng-model="sshCredentialsCtrl.sshConfirmPassword" passwordcontrol-validate-confirm="sshCredentialsCtrl.sshPassword"'+i("required",!0,!0,!0)+' type="password"><div class="appInputFeedback appInputFeedback--danger" ng-show="sshCredentialsCtrl.form.sshP.$valid && sshCredentialsCtrl.form.sshConfirmP.$error.passwordConfirm" translate="WIZARD_CREDENTIALS_PASSWORD_NO_MATCH_ERROR"></div></div></div></div></div></div><div class="ubntModal__footer"><div class="ubntFooter"><div class="ubntFooter__buttons"><div class="ubntButtonGroup ubntButtonGroup--cozy"><button class="ubntButton ubntButton--secondary" type="button" frame-close="sshCredentials" ng-click="sshCredentialsCtrl.close()">{{\'COMMON_ACTIONS_CANCEL\' | translate}}</button><button class="ubntButton ubntButton--primary" ng-click="sshCredentialsCtrl.showValidation = true" busy-toggle="sshCredentialsCtrl.isSubmitting" busy-toggle-spinner-classes="[\'appSpinner appSpinner--light appSpinner--centered appSpinner--small\']">{{\'COMMON_ACTIONS_SUBMIT\' | translate}}</button></div></div></div></div></form></div>'};var r=/["&<>]/},{"pug-runtime":19}],41:[function(e,t,n){"use strict";var i={};i.allowAdminAccess=e("../../base-unifi/lib/routeResolvers/resolveAllowAdminAccess"),i.wizard=e("./routeResolvers/resolveWizard"),i.login=e("../../base-unifi/lib/routeResolvers/resolveLogin"),i.ssoLogin=e("../../base-unifi/lib/routeResolvers/resolveSsoLogin"),t.exports={},t.exports.wizard={routeDeps:["$injector",function(e){return e.get("translateResolver").resolve("common","settings")}]},t.exports.update={routeDeps:["$injector","$q",function(e,t){return e.get("wizardResolver").resolve().then(function(){return t.all([e.get("system").repository.fetch()])}).then(function(){return e.get("updateFirmwareResolver").resolve()})}]},t.exports.init={routeDeps:["$injector","$q",function(e,t){var n=e.get("system");return e.get("wizardResolver").resolve().then(function(){return n.isUnifiGo()?i.login(e).then(function(){return i.allowAdminAccess(e)}):t.when()}).then(function(){var i=[e.get("countries").repository.fetch(),e.get("wirelessNetworkGroups").repository.fetch(),e.get("translateResolver").resolve("settings"),e.get("sdn").repository.fetch()];return n.isUnifiGo()||i.push(e.get("backup").repository.fetch()),t.all(i)}).then(function(){return i.wizard(e)})}]},t.exports.discover={routeDeps:["$injector","$q",function(e,t){return t.all([e.get("devices").repository.fetch(),e.get("translateResolver").resolve("devices")])}]},t.exports.credentials={routeDeps:["$injector",function(e){return e.get("credentialsResolver").resolve()}]},t.exports.cloudAccess={PreviousState:["$state","$q",function(e,t){return t.when(e.current.name)}]},t.exports.fatal={routeDeps:["$injector",function(e){return e.get("translateResolver").resolve("fatal")}]},t.exports.ssoLogin={routeDeps:["account","$state","$stateParams","site","translateResolver","ENV",function(e,t,n,r,s,o){return i.ssoLogin(e,t,n,r,s,o)}]},t.exports.resolvers=i},{"../../base-unifi/lib/routeResolvers/resolveAllowAdminAccess":203,"../../base-unifi/lib/routeResolvers/resolveLogin":204,"../../base-unifi/lib/routeResolvers/resolveSsoLogin":205,"./routeResolvers/resolveWizard":42}],42:[function(e,t,n){"use strict";t.exports=function(e){var t=e.get("$q");return e.get("wizard").resolveWizard(),t.when()}},{}],43:[function(e,t,n){"use strict";e("../base-unifi-device/main"),e("../base-unifi-maintenance/main"),angular.module("app-unifi-wizard",["base-unifi-device","base-unifi-maintenance","ng-timezone","passwordcontrol"]),e("./components/blacklist/blacklist.js"),e("./components/validatePasswordDuplicate/validatePasswordDuplicate.js"),e("./components/wizardHeader/WizardHeaderController.js"),e("./components/wizardHeader/wizardHeader.js"),e("./components/wizardStep/WizardStepController.js"),e("./components/wizardStep/wizardStep.js"),e("./config/flags.js"),e("./config/frames.js"),e("./config/routes.js"),e("./config/states.js"),e("./constants/APP_PREFERENCES.js"),e("./constants/ENDPOINTS.js"),e("./constants/ENV.js"),e("./controllers/WizardController.js"),e("./frames/alert/AlertController.js"),e("./frames/sshCredentials/SshCredentialsController.js"),e("./lib/resolve.js"),e("./lib/routeResolvers/resolveWizard.js"),e("./run/queryString.js"),e("./services/devices.js"),e("./services/models/SystemCmdModel.js"),e("./services/models/WizardModel.js"),e("./services/resolvers/credentialsResolver.js"),e("./services/resolvers/updateFirmwareResolver.js"),e("./services/resolvers/wizardResolver.js"),e("./services/stateUtils.js"),e("./services/wizard.js"),e("./views/wizard.login/WizardLoginController.js"),e("./views/wizard.step.credentials/WizardStepCredentialsController.js"),e("./views/wizard.step.discover/WizardStepDiscoverController.js"),e("./views/wizard.step.finish/WizardStepFinishController.js"),e("./views/wizard.step.init/WizardStepInitController.js"),e("./views/wizard.step.update/WizardStepUpdateController.js"),e("./views/wizard.step.wifi/WizardStepWifiController.js"),window.unifiIsUnit||angular.bootstrap(document,["app-unifi-wizard"])},{"../base-unifi-device/main":131,"../base-unifi-maintenance/main":197,"./components/blacklist/blacklist.js":21,"./components/validatePasswordDuplicate/validatePasswordDuplicate.js":22,"./components/wizardHeader/WizardHeaderController.js":23,"./components/wizardHeader/wizardHeader.js":24,"./components/wizardStep/WizardStepController.js":26,"./components/wizardStep/wizardStep.js":27,"./config/flags.js":29,"./config/frames.js":30,"./config/routes.js":31,"./config/states.js":32,"./constants/APP_PREFERENCES.js":33,"./constants/ENDPOINTS.js":34,"./constants/ENV.js":35,"./controllers/WizardController.js":36,"./frames/alert/AlertController.js":37,"./frames/sshCredentials/SshCredentialsController.js":39,"./lib/resolve.js":41,"./lib/routeResolvers/resolveWizard.js":42,"./run/queryString.js":44,"./services/devices.js":45,"./services/models/SystemCmdModel.js":46,"./services/models/WizardModel.js":47,"./services/resolvers/credentialsResolver.js":48,"./services/resolvers/updateFirmwareResolver.js":49,"./services/resolvers/wizardResolver.js":50,"./services/stateUtils.js":51,"./services/wizard.js":52,"./views/wizard.login/WizardLoginController.js":53,"./views/wizard.step.credentials/WizardStepCredentialsController.js":54,"./views/wizard.step.discover/WizardStepDiscoverController.js":56,"./views/wizard.step.finish/WizardStepFinishController.js":58,"./views/wizard.step.init/WizardStepInitController.js":60,"./views/wizard.step.update/WizardStepUpdateController.js":62,"./views/wizard.step.wifi/WizardStepWifiController.js":64}],44:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").run(["$rootScope","$location",function(e,t){var n;e.$on("$stateChangeStart",function(){n=t.search()}),e.$on("$stateChangeSuccess",function(){t.search(n)})}])},{}],45:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").service("devices",["$q","BaseCollectionRepository","DeviceCollection","discoveredDevices",function(e,t,n,i){this.repository=new t(new n);var r=function(){return i.mergeToDevicesCollection(this.repository.collection),e.when(this.repository.collection)}.bind(this);this.repository.fetch=function(){return t.prototype.fetch.apply(this,arguments).then(r)},i.repository.collection.onUpdate(r.bind(this),{leading:!0}),this.repository.register()}])},{}],46:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").factory("SystemCmdModel",["CORSModel","siteUrlMixin",function(e,t){return e.extend(t).extend({siteUrl:"cmd/system",_isActiveSiteOptional:!0})}])},{}],47:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").factory("WizardModel",["BaseModel",function(e){return e.extend({defaults:{selectedDevices:[]}})}])},{}],48:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").service("credentialsResolver",["$q","system","wizard","DEFAULT_UCK_SSH_CREDENTIALS",function(e,t,n,i){this.resolve=function(){return t.isCloudKey()?t.checkSshCredentials(i).then(function(e){n.model.set("defaultSshCredentials",e)}).catch(function(){n.model.set("defaultSshCredentials",!1)}):e.when()}}])},{}],49:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").service("updateFirmwareResolver",["$q","system",function(e,t){this.resolve=function(){return t.repository.register().fetch().then(function(){return e.when(t.isCloudKey()&&t.isCloudKeyFirmwareUpdateAvailable())}).catch(angular.noop).then(function(){return e.when(t.isCloudKey()&&t.checkUpdateStatus())}).catch(angular.noop)}}])},{}],50:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").service("wizardResolver",["$q","translateResolver",function(e,t){this.resolve=function(){return t.resolve("modules","wizard")}}])},{}],51:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").service("stateUtils",["$state","system",function(e,t){this.handleStateTransition=function(n){t.isUnifiGo()&&(n===e.params.next?e.go(e.params.previous):e.go(e.params.next))}}])},{}],52:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").service("wizard",["$http","$q","$translate","account","apiResults","BACKUP_DEFAULTS","CountryEndpoint","deviceAdoptStrategy","DeviceMgrModel","EditAccountModel","frame","heyToasts","MgmtEndpoint","NetworkOptimizationEndpoint","sdn","site","SiteMgrModel","SuperMgmtEndpoint","system","SystemCmdModel","TimezoneEndpoint","UnifiAPIBasePath","wirelessNetworkGroups","WirelessNetworkModel","WizardModel","NETWORK_OPTIMIZATION_SETTINGS",function(e,t,n,i,r,s,o,a,u,c,l,d,p,f,h,v,g,_,E,m,S,C,y,b,I,A){var T=this;this.model=new I,this.resolveWizard=function(){return this.model.set("wlangroup_id",y.repository.collection.models[0].get("_id")),this.model},this.save=function(){return(E.isUnifiGo()?this.updateAdmin_().then(this.wlangroup_.bind(this)).then(this.wlangroupGuest_.bind(this)).then(this.adopt_.bind(this)).then(this.country_.bind(this)).then(this.timezone_.bind(this)).then(this.optimizeNetwork_.bind(this)).then(this.deviceAuth_.bind(this)).then(this.setupCompleted):this.createAdmin_().then(this.changeSshCredentials_.bind(this)).then(this.wlangroup_.bind(this)).then(this.wlangroupGuest_.bind(this)).then(this.adopt_.bind(this)).then(this.country_.bind(this)).then(this.timezone_.bind(this)).then(this.optimizeNetwork_.bind(this)).then(this.autobackup_.bind(this)).then(this.deviceAuth_.bind(this)).then(this.registerInCloud_.bind(this)).then(this.setupCompleted)).catch(function(e){var i=r.appendErrorMsg(n.instant("WIZARD_FINISH_ERROR_MESSAGE"),e);return d.pushError(i),t.reject(i)})},this.createAdmin_=function(){return(new g).save({name:this.model.get("adminName"),email:this.model.get("adminEmail"),x_password:this.model.get("password"),cmd:"add-default-admin"})},this.updateAdmin_=function(){return(new c).save({name:this.model.get("adminName"),x_password:this.model.get("password")})},this.changeSshCredentials_=function(){if(E.isCloudKey()&&this.model.get("defaultSshCredentials")){var e=this.model.get("sameSshCredentialsAsController")?this.model.get("adminName"):this.model.get("sshUsername"),n=this.model.get("sameSshCredentialsAsController")?this.model.get("password"):this.model.get("sshPassword");return E.changeSshUsername(e).then(function(){return E.changeSshPassword({username:e,password:n})}).catch(function(e){return d.pushError(e)})}return t.when()},this.wlangroup_=function(){if(!this.model.get("secureSSID"))return!0;var e={wlangroup_id:this.model.get("wlangroup_id"),enabled:!0,name:this.model.get("secureSSID"),security:"wpapsk",wpa_mode:"wpa2",wpa_enc:"ccmp",x_passphrase:this.model.get("securityKey")};return(new b).save(e)},this.wlangroupGuest_=function(){if(!this.model.get("secureSSID")||!this.model.get("guestSSID"))return!0;var e={wlangroup_id:this.model.get("wlangroup_id"),is_guest:!0,enabled:!0,name:this.model.get("guestSSID"),security:"open"};return(new b).save(e)},this.adopt_=function(){return a.adoptDevices(this.model.get("selectedDevices")).catch(function(e){d.pushError(e)})},this.country_=function(){return e.post(C+(v.getActiveSite()?"/s/"+v.getActiveSite():"")+o,{code:this.model.get("selectedCountry")},{withCredentials:!!E.isUnifiGo()})},this.timezone_=function(){return e.post(C+(v.getActiveSite()?"/s/"+v.getActiveSite():"")+S,{timezone:this.model.get("selectedTimezone")},{withCredentials:!!E.isUnifiGo()})},this.optimizeNetwork_=function(){return T.model.get("optimizeNetworkEnable")?e.post(C+(v.getActiveSite()?"/s/"+v.getActiveSite():"")+f,A.WIZARD_DEFAULTS,{withCredentials:!!E.isUnifiGo()}):t.when()},this.autobackup_=function(){return this.model.get("autobackupEnabled")?e.post(C+_,{autobackup_enabled:!0,autobackup_cron_expr:s.MONTHLY_OCCURANCE,autobackup_timezone:"UTC",autobackup_days:30}):t.when()},this.registerInCloud_=function(){return l.show("cloudAccessUser").then(function(e){return h.registerInWizard(e).catch(function(n){return n===h.ERROR.TOKEN_2FA_REQUIRED?this.request2faToken(e):t.reject(n)}.bind(this))}.bind(this)).catch(function(e){return e&&d.pushError(e),e&&this.registerInCloud_()}.bind(this))},this.request2faToken=function(e){return l.show("cloudAccess2faToken").then(function(t){return h.registerInWizard(angular.extend({},e,{token:t}))}).catch(function(t){return t&&d.pushError(t),t&&this.request2faToken(e)}.bind(this))},this.deviceAuth_=function(){return e.post(C+(v.getActiveSite()?"/s/"+v.getActiveSite():"")+p,{x_ssh_username:this.model.get("deviceAdminName"),x_ssh_password:this.model.get("devicePassword")},{withCredentials:!!E.isUnifiGo()})},this.setupCompleted=function(){return(new m).save({cmd:"set-installed"})},this.changeSshCredentials=function(e){return this.model.set("sshUsername",e.sshUsername),this.model.set("sshPassword",e.sshPassword),this.changeSshCredentials_().catch(function(e){var i=r.appendErrorMsg(n.instant("WIZARD_CREDENTIALS_CHANGE_SSH_CREDENTIALS_ERROR"),e);return d.pushError(i),t.reject(i)})}}])},{}],53:[function(e,t,n){"use strict";angular.module("app-unifi-wizard").controller("WizardLoginController",["$window","LoginLocation",function(e,t){return new function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),e.location.href=t}}])},{}],54:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("app-unifi-wizard").controller("WizardStepCredentialsController",["featureFlag","passwordUtils","random","system","wizard","CREDENTIALS_SETTINGS","PASSWORD_FEEDBACK_TRANSLATIONS","PASSWORD_SCORE_TRANSLATIONS","REGEX_PATTERNS",function(e,t,n,r,s,o,a,u,c){return new(function(){function l(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),this.model=s.model,this.system=r,this.CREDENTIALS_SETTINGS=o,this.PASSWORD_FEEDBACK_TRANSLATIONS=a,this.PASSWORD_SCORE_TRANSLATIONS=u,angular.isUndefined(this.model.get("sameSshCredentialsAsController"))&&this.model.set("sameSshCredentialsAsController",!0),this.model.get("devicePassword")||this.model.set("devicePassword",n.getRandomString(16)),this.model.get("deviceAdminName")||this.model.set("deviceAdminName","admin"),this.model.get("password")&&this.passwordStrength(),e.isEnabled("enableOptimizeNetwork")&&void 0===this.model.get("optimizeNetworkEnable")&&this.model.set("optimizeNetworkEnable",!0),this.patterns={email:c.EMAIL,name:c.ADMIN_NAME,sshUsername:c.SSH_USERNAME},this.changeSshCredentialsRequired=r.isCloudKey()&&this.model.get("defaultSshCredentials")}return i(l,[{key:"canProceed",value:function(){return Boolean(this.form&&this.form.$valid)}},{key:"passwordStrength",value:function(){var e=this;t.getPasswordFeedback(this.model.get("password")).then(function(t){e.passwordScore=t.passwordScore,e.isPasswordGood=t.isPasswordGood,e.passwordSuggestions=t.passwordSuggestions,e.passwordWarning=t.passwordWarning})}}]),l}())}])},{}],55:[function(e,t,n){e("pug-runtime");function i(e,t,n,i){return!1!==t&&null!=t&&(t||"class"!==e&&"style"!==e)?!0===t?" "+(i?e:e+'="'+e+'"'):("function"==typeof t.toJSON&&(t=t.toJSON()),"string"==typeof t||(t=JSON.stringify(t),n||-1===t.indexOf('"'))?(n&&(t=function(e){var t=""+e,n=r.exec(t);if(!n)return e;var i,s,o,a="";for(i=n.index,s=0;i<t.length;i++){switch(t.charCodeAt(i)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==i&&(a+=t.substring(s,i)),s=i+1,a+=o}return s!==i?a+t.substring(s,i):a}(t))," "+e+'="'+t+'"'):" "+e+"='"+t.replace(/'/g,"'")+"'"):""}t.exports=function(e){var t="";return t=t+'<unifi-wizard-step class="mt-2" can-proceed="wizardStepCredentialsCtrl.canProceed() && wizardStepCredentialsCtrl.isPasswordGood" on-next="wizardStepCredentialsCtrl.submit()"><div class="ubntForm is-form-validation-visible" ng-form="wizardStepCredentialsCtrl.form"><div class="container container--horizontal-cozy container--vertical-comfy container--flush"><div class="row"><div class="col"><p class="justified" translate="WIZARD_CREDENTIALS_MESSAGE"></p></div></div><div class="row"><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_CREDENTIALS_ADMIN_NAME"></label><input class="width-full"'+i("autofocus",!0,!0,!0)+' name="adminName" ng-class="{\'is-empty\': wizardStepCredentialsCtrl.form.adminName.$untouched}" ng-model="wizardStepCredentialsCtrl.model.attributes.adminName" ng-pattern="wizardStepCredentialsCtrl.patterns.name" ng-maxlength="wizardStepCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_ADMIN_NAME_LENGTH"'+i("required",!0,!0,!0)+' type="text"><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.adminName.$error.pattern" translate="VALIDATION_HINT_ADMIN_NAME"></div><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.adminName.$error.maxlength" translate="VALIDATION_HINT_MAX_LENGTH" translate-values="{ max: wizardStepCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_ADMIN_NAME_LENGTH }"></div></div><div class="col-6 ubntFormGroup" ng-if="!wizardStepCredentialsCtrl.system.isUnifiGo()"><label class="ubntLabel" translate="WIZARD_CREDENTIALS_ADMIN_EMAIL"></label><input class="width-full" name="adminEmail" ng-class="{\'is-empty\': wizardStepCredentialsCtrl.form.adminEmail.$untouched}" ng-model="wizardStepCredentialsCtrl.model.attributes.adminEmail" ng-pattern="wizardStepCredentialsCtrl.patterns.email"'+i("required",!0,!0,!0)+' type="email"></div></div><div class="row"><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_CREDENTIALS_PASSWORD"></label><input class="width-full with-validation-meter without-standard-validation" name="p" ng-class="{ \'is-empty\': wizardStepCredentialsCtrl.form.p.$untouched && wizardStepCredentialsCtrl.passwordScore === undefined, \'is-input-invalid\': wizardStepCredentialsCtrl.passwordScore <= 1, \'is-input-warning\': wizardStepCredentialsCtrl.passwordScore === 2, \'is-input-success\': wizardStepCredentialsCtrl.passwordScore > 2 }" ng-model="wizardStepCredentialsCtrl.model.attributes.password"'+i("required",!0,!0,!0)+' type="password" unifi-blacklist="ubnt" ng-change="wizardStepCredentialsCtrl.passwordStrength()" ng-maxlength="wizardStepCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_ADMIN_PASSWORD_LENGTH"><div class="appInputFeedback" ng-show="wizardStepCredentialsCtrl.passwordScore > -1 && !wizardStepCredentialsCtrl.form.p.$error.maxlength" ng-class="{ \'appInputFeedback--danger\': wizardStepCredentialsCtrl.passwordScore <= 1 || wizardStepCredentialsCtrl.form.p.$error.blacklist, \'appInputFeedback--warning\': wizardStepCredentialsCtrl.passwordScore === 2, \'appInputFeedback--success\': wizardStepCredentialsCtrl.passwordScore > 2 }"><label class="d-inline-block" translate="{{wizardStepCredentialsCtrl.PASSWORD_SCORE_TRANSLATIONS[wizardStepCredentialsCtrl.passwordScore]}}"></label><unifi-tooltip unifi-tooltip-class="\'ubntTooltip--small\'" ng-show="wizardStepCredentialsCtrl.passwordScore < 3"><content><span>{{(wizardStepCredentialsCtrl.isPasswordGood ? \'CREDENTIALS_SSH_PASSWORD_REQUIREMENT_MET\' : \'CREDENTIALS_SSH_PASSWORD_REQUIREMENT_NOT_MET\') | translate}}\n{{wizardStepCredentialsCtrl.passwordSuggestions}}\n{{wizardStepCredentialsCtrl.passwordWarning}}</span></content></unifi-tooltip></div><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.p.$error.blacklist" translate="CREDENTIALS_SSH_PASSWORD_DEFAULT_ERROR"></div><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.p.$error.maxlength" translate="VALIDATION_HINT_MAX_LENGTH" translate-values="{ max: wizardStepCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_ADMIN_PASSWORD_LENGTH }"></div></div><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_CREDENTIALS_CONFIRM_PASSWORD"></label><input class="width-full" name="confirmP" ng-class="{\'is-empty\': wizardStepCredentialsCtrl.form.confirmP.$untouched && wizardStepCredentialsCtrl.form.p.$untouched}" ng-model="wizardStepCredentialsCtrl.confirmPassword" passwordcontrol-validate-confirm="wizardStepCredentialsCtrl.model.attributes.password"'+i("required",!0,!0,!0)+' type="password"><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.confirmP.$touched && wizardStepCredentialsCtrl.form.confirmP.$error.passwordConfirm" translate="WIZARD_CREDENTIALS_PASSWORD_NO_MATCH_ERROR"></div></div></div></div><div class="container container--horizontal-cozy container--vertical-comfy container--flush" ng-if="wizardStepCredentialsCtrl.changeSshCredentialsRequired"><div class="row"><div class="col-6 flex-centered-vertically"><label class="ubntLabel ubntLabel--primary" for="sameSshCredentialsAsController" translate="WIZARD_CREDENTIALS_ENABLE_SAME_SSH_CREDENTIALS_AS_CONTROLLER"></label></div><div class="col-2"><div class="ubntToggle"><input type="checkbox" name="sameSshCredentialsAsController" id="sameSshCredentialsAsController" ng-model="wizardStepCredentialsCtrl.model.attributes.sameSshCredentialsAsController"><label for="sameSshCredentialsAsController"></label></div></div></div><div class="row" ng-if="!wizardStepCredentialsCtrl.model.attributes.sameSshCredentialsAsController"><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_CREDENTIALS_SSH_USERNAME"></label><input class="width-full" name="sshU" ng-class="{\'is-empty\': wizardStepCredentialsCtrl.form.sshU.$untouched}" ng-minlength="4" ng-model="wizardStepCredentialsCtrl.model.attributes.sshUsername" ng-maxlength="wizardStepCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_SSH_USERNAME_LENGTH" ng-required="!wizardStepCredentialsCtrl.model.attributes.sameSshCredentialsAsController" ng-pattern="wizardStepCredentialsCtrl.patterns.sshUsername" type="text"><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.sshU.$error.maxlength" translate="VALIDATION_HINT_MAX_LENGTH" translate-values="{ max: wizardStepCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_SSH_USERNAME_LENGTH }"></div><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.sshU.$error.pattern" translate="VALIDATION_HINT_ADMIN_NAME"></div></div></div><div class="row" ng-show="!wizardStepCredentialsCtrl.model.attributes.sameSshCredentialsAsController"><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_CREDENTIALS_SSH_PASSWORD"></label><input class="width-full" name="sshP" ng-class="{\'is-empty\': wizardStepCredentialsCtrl.form.sshP.$untouched}" ng-minlength="4" ng-model="wizardStepCredentialsCtrl.model.attributes.sshPassword" ng-maxlength="wizardStepCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_SSH_PASSWORD_LENGTH" ng-required="!wizardStepCredentialsCtrl.model.attributes.sameSshCredentialsAsController" type="password" unifi-blacklist="ubnt"><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.sshPassword.$error.minlength" translate="CREDENTIALS_SSH_PASSWORD_TOO_SHORT_ERROR"></div><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.sshPassword.$error.blacklist" translate="CREDENTIALS_SSH_PASSWORD_DEFAULT_ERROR"></div><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.sshPassword.$error.maxlength" translate="VALIDATION_HINT_MAX_LENGTH" translate-values="{ max: wizardStepCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_SSH_PASSWORD_LENGTH }"></div></div><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_CREDENTIALS_SSH_CONFIRM_PASSWORD"></label><input class="width-full" name="sshConfirmP" ng-class="{\'is-empty\': wizardStepCredentialsCtrl.form.sshConfirmP.$untouched}" ng-minlength="4" ng-model="wizardStepCredentialsCtrl.model.attributes.sshConfirmPassword" passwordcontrol-validate-confirm="wizardStepCredentialsCtrl.model.attributes.sshPassword" ng-required="!wizardStepCredentialsCtrl.model.attributes.sameSshCredentialsAsController" type="password"><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.sshPassword.$valid && wizardStepCredentialsCtrl.form.sshConfirmPassword.$error.passwordConfirm" translate="CREDENTIALS_SSH_PASSWORD_NO_MATCH_ERROR"></div></div></div></div><div class="container container--horizontal-cozy container--vertical-comfy container--flush"><div class="row"><div class="col"><label class="mb-0 mr-1" translate="WIZARD_CREDENTIALS_DEVICE_AUTH"></label><unifi-tooltip unifi-tooltip-class="\'ubntTooltip--small\'"><content translate="WIZARD_CREDENTIALS_DEVICE_AUTH_MESSAGE"></content></unifi-tooltip></div></div><div class="row"><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_CREDENTIALS_DEVICE_ADMIN_NAME"></label><input class="width-full" name="deviceAdminName" ng-class="{\'is-empty\': wizardStepCredentialsCtrl.form.deviceAdminName.$untouched}" ng-model="wizardStepCredentialsCtrl.model.attributes.deviceAdminName" ng-pattern="wizardStepCredentialsCtrl.patterns.name" ng-maxlength="wizardStepCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_SSH_USERNAME_LENGTH"'+i("required",!0,!0,!0)+' type="text"><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.deviceAdminName.$error.pattern" translate="VALIDATION_HINT_ADMIN_NAME"></div><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.deviceAdminName.$error.maxlength" translate="VALIDATION_HINT_MAX_LENGTH" translate-values="{ max: wizardStepCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_SSH_USERNAME_LENGTH }"></div></div><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_CREDENTIALS_DEVICE_PASSWORD"></label><unifi-password-reveal class="width-full"><input class="width-full" type="password" name="deviceP" ng-class="{\'is-empty\': wizardStepCredentialsCtrl.form.devicePassword.$untouched}" ng-minlength="4" ng-model="wizardStepCredentialsCtrl.model.attributes.devicePassword" ng-maxlength="wizardStepCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_SSH_PASSWORD_LENGTH"'+i("required",!0,!0,!0)+' unifi-validate-password-duplicate="wizardStepCredentialsCtrl.model.attributes.password"></unifi-password-reveal><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.devicePassword.$error.maxlength" translate="VALIDATION_HINT_MAX_LENGTH" translate-values="{ max: wizardStepCredentialsCtrl.CREDENTIALS_SETTINGS.MAX_SSH_PASSWORD_LENGTH }"></div><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepCredentialsCtrl.form.devicePassword.$error.passwordDuplicate" translate="WIZARD_CREDENTIALS_DEVICE_AUTH_MESSAGE"></div></div></div></div><div class="container container--horizontal-cozy container--vertical-comfy container--flush mt-4" ng-if="\'enableOptimizeNetwork\' | featureFlagEnable"><div class="row"><div class="col"><label class="mb-0 mr-1" translate="WIZARD_CREDENTIALS_HEADER_OPTIMIZE_NETWORK"></label><unifi-tooltip><content translate="WIZARD_CREDENTIALS_TOOLTIP_OPTIMIZE_NETWORK"></content></unifi-tooltip></div></div><div class="row"><div class="col-6 flex-centered-vertically"><label class="ubntLabel ubntLabel--primary" for="optimizeNetworkEnable" translate="WIZARD_CREDENTIALS_LABEL_OPTIMIZE_NETWORK"></label></div><div class="col-6"><div class="ubntToggle"><input type="checkbox" name="optimizeNetworkEnable" id="optimizeNetworkEnable" ng-model="wizardStepCredentialsCtrl.model.attributes.optimizeNetworkEnable"><label for="optimizeNetworkEnable"></label></div></div></div></div></div></unifi-wizard-step>'};var r=/["&<>]/},{"pug-runtime":19}],56:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var s=Object.getPrototypeOf(t);return null===s?void 0:e(s,n,i)}if("value"in r)return r.value;var o=r.get;return void 0!==o?o.call(i):void 0};angular.module("app-unifi-wizard").controller("WizardStepDiscoverController",["$interval","$q","$scope","$translate","BasePaginatedListController","wizard","deviceActionUtils","deviceDiscoveryUtils","devices","deviceStateUtils","devicesComparator","CollectionView","frame","preferences","PendingAdoptionDeviceFilter","APP_PREFERENCES",function(e,t,n,s,o,a,u,c,l,d,p,f,h,v,g,_){return new(function(f){function v(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,v);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));t.model=a.model,t.comparator=p,t.filter=new g,t.getDeviceModelName=d.getDeviceModelName.bind(d),t.defaultSortBy="uptime",t.defaultSortDesc=!0,t.rowsPerPage=_.ROWS_PER_PAGE,t.selectedDevices={},t.selectAllDevices=!1,t.initializeSelectedDevices(),c.findDevicesIsVisible()&&t.findDevices(),t.findDevicesIsVisible=c.findDevicesIsVisible.bind(c),t.findDevicesIsAvailable=c.findDevicesIsAvailable.bind(c);var i=e(t.refetch.bind(t),3e4);return n.$on("$destroy",function(){e.cancel(i)}),r(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"$onInit",t).call(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(v,o),i(v,[{key:"getCollection",value:function(){return l.repository.collection}},{key:"initializeSelectedDevices",value:function(){var e=this;this.model.get("selectedDevices").forEach(function(t){e.selectedDevices[t.get("mac")]=!0})}},{key:"handleAllDevicesSelection",value:function(){var e=this;this.selectedDevices={},this.selectAllDevices&&this.view.getModels().forEach(function(t){e.selectedDevices[t.get("mac")]=!0})}},{key:"submit",value:function(){var e=this,n=l.repository.collection.filter(function(t){return e.selectedDevices[t.get("mac")]});return t.when(this.confirmAdoptAndUpgrade(n)).then(function(){e.model.set("selectedDevices",n)})}},{key:"confirmAdoptAndUpgrade",value:function(e){return e.some(function(e){return d.isDeviceAdoptableWhenUpgraded(e)})?h.show("confirm",{title:function(){return s.instant("WIZARD_DISCOVER_ADOPT_AND_UPGRADE_CONFIRM_TITLE")},message:function(){return s.instant("WIZARD_DISCOVER_ADOPT_AND_UPGRADE_CONFIRM_MESSAGE")},options:function(){return{size:"small"}}}):t.when()}},{key:"refetch",value:function(){var e=this;this.isRefreshing=!0,l.repository.fetch({forceFetch:!0}).finally(function(){e.isRefreshing=!1})}},{key:"findDevices",value:function(){return c.findDevices()}},{key:"isFindingDevices",value:function(){return c.isFindingDevices()}},{key:"isAdoptApplicable",value:function(e){return u.isAdoptApplicable(e)}}]),v}())}])},{}],57:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t=t+'<unifi-wizard-step on-next="wizardStepDiscoverCtrl.submit()"><div class="ubntForm" ng-form="wizardStepDiscoverCtrl.form"><p class="justified" translate="WIZARD_DISCOVER_MESSAGE"></p><div class="ubntHeader justify-end mb-2" ng-if="wizardStepDiscoverCtrl.findDevicesIsVisible()"><div class="appActionBarFilters"><div class="appActionBarFilter"><div class="ubntTooltipContainer ubntTooltipContainer--hoverable"><button class="ubntButton ubntButton--primary" ng-class="{ \'is-button-notifying\': wizardStepDiscoverCtrl.isFindingDevices() }" ng-click="wizardStepDiscoverCtrl.findDevices()" ng-disabled="!wizardStepDiscoverCtrl.findDevicesIsAvailable()">{{ wizardStepDiscoverCtrl.isFindingDevices() ? \'DEVICE_ACTIONS_FINDING_DEVICES\' : \'DEVICE_ACTIONS_FIND_DEVICES\' | translate}}</button><div class="ubntTooltip ubntTooltip--bottomLeft" ng-if="!wizardStepDiscoverCtrl.findDevicesIsAvailable()">{{ \'DEVICE_ACTIONS_FIND_DEVICES_INCOMPATIBLE_BROWSER_WARNING\' | translate }}</div></div></div></div></div><table class="ubntTable ubntTable--secondary ubntTable--flush" collection-view-sort="wizardStepDiscoverCtrl.view"><thead><tr><th class="ubntTableCell--smash"><input'+(n="autofocus",r=!0,s=!0,o=!0,!1!==r&&null!=r&&(r||"class"!==n&&"style"!==n)?!0===r?" "+(o?n:n+'="'+n+'"'):("function"==typeof r.toJSON&&(r=r.toJSON()),"string"==typeof r||(r=JSON.stringify(r),s||-1===r.indexOf('"'))?(s&&(r=function(e){var t=""+e,n=i.exec(t);if(!n)return e;var r,s,o,a="";for(r=n.index,s=0;r<t.length;r++){switch(t.charCodeAt(r)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==r&&(a+=t.substring(s,r)),s=r+1,a+=o}return s!==r?a+t.substring(s,r):a}(r))," "+n+'="'+r+'"'):" "+n+"='"+r.replace(/'/g,"'")+"'"):"")+' type="checkbox" ng-model="wizardStepDiscoverCtrl.selectAllDevices" ng-change="wizardStepDiscoverCtrl.handleAllDevicesSelection()"></th><th collection-view-sort-by="name"><span>{{::\'DEVICE_TABLE_HEADER_NAME\' | translate }}</span></th><th collection-view-sort-by="status"><span>{{::\'DEVICE_TABLE_HEADER_STATUS\' | translate }}</span></th><th collection-view-sort-by="model"><span>{{::\'DEVICE_TABLE_HEADER_MODEL\' | translate }}</span></th><th class="visible--smUp" collection-view-sort-by="ip"><span>{{::\'DEVICE_TABLE_HEADER_IP\' | translate }}</span></th><th class="visible--smUp" collection-view-sort-by="uptime"><span>{{::\'DEVICE_TABLE_HEADER_UPTIME\' | translate }}</span></th></tr></thead><tbody><tr ng-repeat=" device in wizardStepDiscoverCtrl.view.getModels().slice( (wizardStepDiscoverCtrl.currentPage - 1) * wizardStepDiscoverCtrl.rowsPerPage, ((wizardStepDiscoverCtrl.currentPage - 1) * wizardStepDiscoverCtrl.rowsPerPage) + wizardStepDiscoverCtrl.rowsPerPage ) " ng-click="wizardStepDiscoverCtrl.selectedDevices[device.get(\'mac\')] = !wizardStepDiscoverCtrl.selectedDevices[device.get(\'mac\')]"><td class="ubntTableCell--smash"><input type="checkbox" ng-model="wizardStepDiscoverCtrl.selectedDevices[device.get(\'mac\')]" ng-if="wizardStepDiscoverCtrl.isAdoptApplicable(device)"></td><td><span>{{device.getDisplayName()}}</span></td><td><span>{{wizardStepDiscoverCtrl.getDeviceModelName(device)}}</span></td><td class="deviceState"><span unifi-device-status-badge="device"></span></td><td class="visible--smUp"><span>{{device.get(\'adopt_ip\')}}</span></td><td class="visible--smUp"><span>{{device.get(\'uptime\') | seconds}}</span></td></tr></tbody><tfoot ng-if="wizardStepDiscoverCtrl.view.getModels().length"><tr><td colspan="5"><unifi-aura-pagination unifi-aura-pagination-current-page="wizardStepDiscoverCtrl.currentPage" unifi-aura-pagination-rows-per-page="wizardStepDiscoverCtrl.rowsPerPage" unifi-aura-pagination-total-rows="wizardStepDiscoverCtrl.view.getModels().length"></unifi-aura-pagination></td></tr></tfoot></table><div class="ubntIconText ubntIconText--withTextRight ubntIconText--multiline ubntIconText--currentColor mt-2 mb-4" ng-if="!wizardStepDiscoverCtrl.view.getModels().length"><unifi-aura-icon unifi-aura-icon="\'info\'" unifi-aura-icon-class="[\'ubntIconText__icon\', \'color-primary\']"></unifi-aura-icon><div class="ubntIconText__text"><div class="type-ubnt-title" translate="DEVICE_TABLE_EMPTY_HEADER"></div><div class="mt-2" translate="DEVICE_TABLE_EMPTY_NO_DEVICES"></div></div></div></div></unifi-wizard-step>';var n,r,s,o};var i=/["&<>]/},{"pug-runtime":19}],58:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("app-unifi-wizard").controller("WizardStepFinishController",["countries","system","timezones","wizard",function(e,t,n,r){return new(function(){function s(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),this.countries=e,this.timezones=n,this.system=t,this.wizard=r,this.model=r.model}return i(s,[{key:"submit",value:function(){return this.wizard.save()}},{key:"getCountryName",value:function(){return e.repository.collection.get(parseInt(this.model.get("selectedCountry"))).get("name")}}]),s}())}])},{}],59:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<unifi-wizard-step class="mt-2" on-finish="wizardStepFinishCtrl.submit()"><div class="container container--horizontal-cozy container--vertical-comfy container--flush"><div class="row"><div class="col--sm12"><p class="justified" translate="WIZARD_FINISH_MESSAGE"></p></div></div><div class="row"><div class="col-4 type-right"><div class="bold" translate="WIZARD_FINISH_LABEL_COUNTRY"></div></div><div class="col-8"><label>{{wizardStepFinishCtrl.getCountryName()}}</label></div></div><div class="row"><div class="col-4 type-right"><div class="bold" translate="WIZARD_FINISH_LABEL_TIMEZONE"></div></div><div class="col-8"><label>{{wizardStepFinishCtrl.model.get(\'selectedTimezone\')}}</label></div></div><div class="row"><div class="col-4 type-right"><div class="bold" translate="WIZARD_FINISH_LABEL_WIFI_SECURE_SSID"></div></div><div class="col-8" ng-if="wizardStepFinishCtrl.model.get(\'secureSSID\')"><label>{{wizardStepFinishCtrl.model.get(\'secureSSID\')}}</label></div><div class="col-8" ng-if="!wizardStepFinishCtrl.model.get(\'secureSSID\')"><label translate="WIZARD_FINISH_LABEL_SKIPPED"></label></div></div><div class="row"><div class="col-4 type-right"><div class="bold" translate="WIZARD_FINISH_LABEL_WIFI_GUEST_SSID"></div></div><div class="col-8" ng-if="wizardStepFinishCtrl.model.get(\'guestSSID\')"><label>{{wizardStepFinishCtrl.model.get(\'guestSSID\')}}</label></div><div class="col-8" ng-if="!wizardStepFinishCtrl.model.get(\'guestSSID\')"><label translate="WIZARD_FINISH_LABEL_SKIPPED"></label></div></div><div class="row"><div class="col-4 type-right"><div class="bold" translate="WIZARD_FINISH_LABEL_ADMIN_NAME"></div></div><div class="col-8"><label>{{wizardStepFinishCtrl.model.get(\'adminName\')}}</label></div></div><div class="row"><div class="col-4 type-right"><div class="bold" translate="WIZARD_FINISH_LABEL_DEVICE_ADMIN_NAME"></div></div><div class="col-8"><label>{{wizardStepFinishCtrl.model.get(\'deviceAdminName\')}}</label></div></div><div class="row" ng-if="wizardStepFinishCtrl.model.get(\'ssoCredentials\') && !wizardStepFinishCtrl.system.isUnifiGo()"><div class="col-4 type-right"><div class="bold" translate="WIZARD_FINISH_LABEL_CLOUD_ACCESS"></div></div><div class="col-8"><label>{{wizardStepFinishCtrl.model.get(\'ssoCredentials\').username}}</label></div></div></div></unifi-wizard-step>'}},{"pug-runtime":19}],60:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("app-unifi-wizard").controller("WizardStepInitController",["$filter","$q","$translate","backup","countries","credentialsResolver","frame","status","system","systemBackupUtils","wizard","LANGUAGES",function(e,t,n,r,s,o,a,u,c,l,d,p){return new(function(){function f(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),this.backup=r,this.system=c,this.model=d.model,this.supportedLanguages=Object.keys(p.supportedLanguagesMapping).map(function(e){return{value:e,translation:n.instant("LANGUAGE_"+e.toUpperCase())}}),this.selectedLanguage=this.supportedLanguages.find(function(e){return"en_US"===e.value});var e=this.model.get("selectedCountry"),t=s.repository.collection.find(function(t){return e?t.get("code")===e:"US"===t.get("key")})||s.repository.collection.first();this.selectedCountry=t.get("code"),this.autobackupEnabled=!0}return i(f,[{key:"submit",value:function(){this.model.set("autobackupEnabled",this.autobackupEnabled),this.model.set("selectedCountry",this.selectedCountry),this.model.set("selectedTimezone",this.selectedTimezone.timezone)}},{key:"getCountries",value:function(){return s.repository.collection.models}},{key:"onFileSelect",value:function(t){var i=this;t.length>0&&(this.isRestoringFromBackup=!0,this.restoreProgress={},l.uploadBackupFile(t[0],this.restoreProgress).then(function(t){a.show("confirm",{title:function(){return n.instant("SETTINGS_MAINTENANCE_RESTORE_FROM_BACKUP_CONFIRM_TITLE")},message:function(){return n.instant("SETTINGS_MAINTENANCE_RESTORE_FROM_BACKUP_CONFIRM_MESSAGE",{file:t.filename,version:t.version,date:e("moment")(parseInt(t.timestamp),"format","datetime")})},options:function(){return{allowHtml:!0}}}).then(function(){return i.changeSshCredentials()}).then(function(){a.show("alert",{title:function(){return n.instant("COMMON_NOTICE_WAITING_TITLE")},message:function(){return n.instant("SETTINGS_MAINTENANCE_RESTORE_FROM_BACKUP_WORKING")}}),l.restoreFromBackup(t.backup_id).then(function(){u.waitForRestart()})}).catch(function(){l.cancelRestoreFromBackup(t.backup_id)})}).catch(function(e){a.show("alert",{title:function(){return n.instant("WIZARD_BACKUP_RESTORE_ERROR")},message:function(){return e}})}).finally(function(){i.isRestoringFromBackup=!1,i.restoreProgress=void 0}))}},{key:"changeSshCredentials",value:function(){var e=this;return o.resolve().then(function(){return e.model.get("defaultSshCredentials")&&c.isCloudKey()?a.show("sshCredentials").then(function(e){return d.changeSshCredentials(e)}):t.when()})}}]),f}())}])},{}],61:[function(e,t,n){e("pug-runtime");function i(e,t,n,i){return!1!==t&&null!=t&&(t||"class"!==e&&"style"!==e)?!0===t?" "+(i?e:e+'="'+e+'"'):("function"==typeof t.toJSON&&(t=t.toJSON()),"string"==typeof t||(t=JSON.stringify(t),n||-1===t.indexOf('"'))?(n&&(t=function(e){var t=""+e,n=r.exec(t);if(!n)return e;var i,s,o,a="";for(i=n.index,s=0;i<t.length;i++){switch(t.charCodeAt(i)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==i&&(a+=t.substring(s,i)),s=i+1,a+=o}return s!==i?a+t.substring(s,i):a}(t))," "+e+'="'+t+'"'):" "+e+"='"+t.replace(/'/g,"'")+"'"):""}t.exports=function(e){var t="";return t=t+'<unifi-wizard-step on-next="wizardStepInitCtrl.submit()"><div class="ubntForm" ng-form="wizardStepInitCtrl.form"><div class="container container--horizontal-cozy container--vertical-comfy container--flush"><div class="row"><div class="col"><p class="justified" translate="WIZARD_WELCOME_MESSAGE"></p></div></div><div class="row"><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_WELCOME_SELECT_COUNTRY"></label><select class="width-full"'+i("autofocus",!0,!0,!0)+' name="selectedCountry" ng-model="wizardStepInitCtrl.selectedCountry" ng-options="country.get(\'code\') as country.get(\'name\') for country in wizardStepInitCtrl.getCountries()"'+i("required",!0,!0,!0)+'></select></div><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_WELCOME_SELECT_TIMEZONE"></label><timezone-select class="width-full" selected-timezone="wizardStepInitCtrl.selectedTimezone"></timezone-select></div></div><div class="row" ng-if="!wizardStepInitCtrl.system.isUnifiGo()"><div class="col-5 flex-centered-vertically"><label class="ubntLabel ubntLabel--primary" for="autoBackupEnable" translate="WIZARD_WELCOME_AUTOBACKUP_ENABLE"></label></div><div class="col-7"><div class="ubntToggle"><input type="checkbox" name="autoBackupEnable" id="autoBackupEnable" ng-model="wizardStepInitCtrl.autobackupEnabled"><label for="autoBackupEnable"></label></div></div></div><div class="row" ng-if="!wizardStepInitCtrl.system.isUnifiGo()"><div class="col"><p class="justified">{{\'WIZARD_WELCOME_ALTERNATIVE\' | translate}}<a class="ubntLink"'+i("ngf-select",!0,!0,!0)+' ngf-change="wizardStepInitCtrl.onFileSelect($files)" ng-disabled="wizardStepInitCtrl.isRestoringFromBackup" ng-class="{\'is-link-disabled\': wizardStepInitCtrl.isRestoringFromBackup}">{{\'WIZARD_WELCOME_ALTERNATIVE_RESTORE\' | translate}}</a><span ng-show="wizardStepInitCtrl.backup.repository.collection.models.length === 0">.</span><span ng-show="wizardStepInitCtrl.backup.repository.collection.models.length > 0"> {{\'WIZARD_WELCOME_ALTERNATIVE_AUTOBACKUP\' | translate}}</span></p><div class="ubntStatusBar ubntStatusBar--large ubntStatusBar--rounded ubntStatusBar--legacy ubntStatusBar--success mb-8" ng-if="wizardStepInitCtrl.restoreProgress && wizardStepInitCtrl.restoreProgress.hasOwnProperty(\'percent\')"><div class="ubntStatusBar__status" style="width: {{wizardStepInitCtrl.restoreProgress.percent || 0}}%;"></div></div></div></div><div class="row" ng-show="wizardStepInitCtrl.backup.repository.collection.models.length > 0" ng-if="!wizardStepInitCtrl.system.isUnifiGo()"><div class="col"><div class="appSubHeading appSubHeading--comfy appSubHeading--standalone" translate="WIZARD_WELCOME_ALTERNATIVE_AVAILABLE_FILES"></div><unifi-backup-list unifi-backup-list-is-dark="false" unifi-backup-list-is-download-available="false" unifi-backup-list-is-delete-available="false"></unifi-backup-list></div></div></div></div></unifi-wizard-step>'};var r=/["&<>]/},{"pug-runtime":19}],62:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("app-unifi-wizard").controller("WizardStepUpdateController",["$state","$window","heyToasts","system","versionParser",function(e,t,n,r,s){return new(function(){function o(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.system=r,this.isUpgrading=!1,r.repository.model.get("cloudkey_update_available")?(this.updateVersion=s.parseFirmwareVersion(r.repository.model.get("cloudkey_update_version")).version,r.isFirmwareUpdating()&&this.checkUpgradeProgress()):this.skipUpgrade()}return i(o,[{key:"skipUpgrade",value:function(){e.go(e.params.skipTo)}},{key:"upgrade",value:function(){var e=this;this.isUpgrading=!0,r.updateCloudKeyFirmware().then(function(t){return n.pushSuccess(t),e.checkUpgradeProgress()}).catch(function(t){n.pushError(t),e.isUpgrading=!1})}},{key:"checkUpgradeProgress",value:function(){return this.isUpgrading=!0,r.waitForUpdateFinish().then(function(){t.location.reload(!0)})}},{key:"onSkip",value:function(){return e.params.skipTo}}]),o}())}])},{}],63:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<unifi-wizard-step ng-if="!wizardStepUpdateCtrl.isUpgrading" on-skip="wizardStepUpdateCtrl.onSkip()"><div class="ubntForm" ng-form="wizardStepUpdateCtrl.form"><div class="appInfoBox appInfoBox--success appInfoBox--noBorder px-0"><div class="appInfoBox__icon icon ubnt-icon--check-circle ubnt-icon--firmware-update"></div><div class="appInfoBox__content"><div class="appInfoBox__header verticalRhythm--cozy" translate="WIZARD_UPDATE_FIRMWARE_HEADER"></div><div class="appInfoBox__body"><div class="justified verticalRhythm--cozy" ng-if="!wizardStepUpdateCtrl.isUpgrading" translate="WIZARD_UPDATE_FIRMWARE_MESSAGE" translate-values="{version: wizardStepUpdateCtrl.updateVersion}"></div><div class="verticalRhythm--cozy" ng-if="wizardStepUpdateCtrl.isUpgrading"><span class="appBadge appBadge--success" translate="SETTINGS_MAINTENANCE_LABEL_UPDATE_STATUS_{{wizardStepUpdateCtrl.system.getFirmwareUpdateStatus()}}"></span></div><div class="ubntStatusBar ubntStatusBar--large ubntStatusBar--rounded ubntStatusBar--legacy ubntStatusBar--success clear" ng-class="{\'is-status-bar-muted\': !wizardStepUpdateCtrl.isUpgrading}"><div class="ubntStatusBar__status" ng-style="{\'width\': (wizardStepUpdateCtrl.system.getFirmwareDownloadProgress() || 0) + \'%\'}"></div></div></div></div></div><div class="d-flex justify-center my-2"><button class="ubntButton ubntButton--primary" ng-click="wizardStepUpdateCtrl.upgrade()" busy-toggle="wizardStepUpdateCtrl.isUpgrading" busy-toggle-spinner-classes="[\'appSpinner appSpinner--light appSpinner--centered appSpinner--small\']"><span class="button__icon icon ubnt-icon--firmware-update"></span><span>{{::\'COMMON_ACTIONS_UPGRADE\' | translate}}</span></button></div></div></unifi-wizard-step>'}},{"pug-runtime":19}],64:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("app-unifi-wizard").controller("WizardStepWifiController",["wizard","REGEX_PATTERNS","WLAN_SETTINGS",function(e,t,n){return new(function(){function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.model=e.model,this.WLAN_SETTINGS=n,this.patterns={ssid:t.NAME,security:t.PASSWORD}}return i(r,[{key:"canProceed",value:function(){return Boolean(this.form&&this.form.$valid)}}]),r}())}])},{}],65:[function(e,t,n){e("pug-runtime");function i(e,t,n,i){return!1!==t&&null!=t&&(t||"class"!==e&&"style"!==e)?!0===t?" "+(i?e:e+'="'+e+'"'):("function"==typeof t.toJSON&&(t=t.toJSON()),"string"==typeof t||(t=JSON.stringify(t),n||-1===t.indexOf('"'))?(n&&(t=function(e){var t=""+e,n=r.exec(t);if(!n)return e;var i,s,o,a="";for(i=n.index,s=0;i<t.length;i++){switch(t.charCodeAt(i)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==i&&(a+=t.substring(s,i)),s=i+1,a+=o}return s!==i?a+t.substring(s,i):a}(t))," "+e+'="'+t+'"'):" "+e+"='"+t.replace(/'/g,"'")+"'"):""}t.exports=function(e){var t="";return t=t+'<unifi-wizard-step class="mt-2" can-proceed="wizardStepWifiCtrl.canProceed()"><div class="ubntForm is-form-validation-visible" ng-form="wizardStepWifiCtrl.form"><div class="container container--horizontal-cozy container--vertical-comfy container--flush"><div class="row"><div class="col"><p class="justified" translate="WIZARD_WIFI_MESSAGE_SKIP"></p></div></div><div class="row"><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_WIFI_SECURE_SSID"></label><input class="width-full"'+i("autofocus",!0,!0,!0)+' type="text" name="secureSSID" ng-class="{\'is-empty\': wizardStepWifiCtrl.form.secureSSID.$pristine}" ng-model="wizardStepWifiCtrl.model.attributes.secureSSID" ng-pattern="wizardStepWifiCtrl.patterns.ssid" ng-maxlength="wizardStepWifiCtrl.WLAN_SETTINGS.SSID.MAX_LENGTH"'+i("required",!0,!0,!0)+'><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepWifiCtrl.form.secureSSID.$error.pattern" translate="WIZARD_WIFI_SSID_NOT_VALID"></div><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepWifiCtrl.form.secureSSID.$error.maxlength" translate="WIZARD_WIFI_SSID_VALIDATOR_MAX_LENGTH"></div></div><div class="col-6 ubntFormGroup"><label class="ubntLabel" translate="WIZARD_WIFI_SECURITY_KEY"></label><input class="width-full" type="password" name="securityKey" ng-class="{\'is-empty\': wizardStepWifiCtrl.form.securityKey.$pristine}" ng-model="wizardStepWifiCtrl.model.attributes.securityKey" ng-pattern="wizardStepWifiCtrl.patterns.security"'+i("required",!0,!0,!0)+'><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepWifiCtrl.form.securityKey.$error.pattern" translate="WIZARD_WIFI_SECURITY_KEY_NOT_VALID"></div></div></div><div class="row"><div class="col"><p class="justified mb-0 mt-2" translate="WIZARD_WIFI_MESSAGE_ENABLE_GUEST_ACCESS"></p></div></div><div class="row"><div class="col-5 flex-centered-vertically"><label class="ubntLabel ubntLabel--primary" for="guestSSIDEnabled" translate="WIZARD_WIFI_ENABLE_GUEST_ACCESS"></label></div><div class="col-7"><div class="ubntToggle"><input type="checkbox" id="guestSSIDEnabled" name="guestSSIDEnabled" ng-model="wizardStepWifiCtrl.model.attributes.guestSSIDEnabled"><label for="guestSSIDEnabled"></label></div></div></div><div class="row"><div class="col-6 ubntFormGroup" ng-if="wizardStepWifiCtrl.model.attributes.guestSSIDEnabled"><label class="ubntLabel" translate="WIZARD_WIFI_GUEST_SSID"></label><input class="width-full" type="text" name="guestSSID" ng-class="{\'is-empty\': wizardStepWifiCtrl.form.guestSSID.$pristine}" ng-model="wizardStepWifiCtrl.model.attributes.guestSSID" ng-pattern="wizardStepWifiCtrl.patterns.ssid" ng-maxlength="wizardStepWifiCtrl.WLAN_SETTINGS.SSID.MAX_LENGTH"'+i("required",!0,!0,!0)+'><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepWifiCtrl.form.secureSSID.$error.pattern" translate="WIZARD_WIFI_SSID_NOT_VALID"></div><div class="appInputFeedback appInputFeedback--danger" ng-show="wizardStepWifiCtrl.form.secureSSID.$error.maxlength" translate="WIZARD_WIFI_SSID_VALIDATOR_MAX_LENGTH"></div></div></div></div></div></unifi-wizard-step>'};var r=/["&<>]/},{"pug-runtime":19}],66:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<div class="appContainer--centered unifiWizard"><div class="unifiWizard__step"><unifi-wizard-header></unifi-wizard-header><ui-view></ui-view><unifi-browser-warning></unifi-browser-warning></div></div>'}},{"pug-runtime":19}],67:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+="<ui-view></ui-view><unifi-browser-warning></unifi-browser-warning>"}},{"pug-runtime":19}],68:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("base-unifi-device").controller("DeviceButtonAdoptController",["$q","BaseButtonController","$translate","deviceActionUtils","deviceAdoptStrategy","deviceStateUtils","deviceUtils","devices","DEVICE_STATES","frame","heyToasts","account","buttonHasSitePermissionControllerMixin","preferences",function(e,t,n,r,s,o,a,u,c,l,d,p,f,h){return new(function(v){function g(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return f(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(g,t),i(g,[{key:"onModelChange",value:function(){this.isApplicable=r.isAdoptApplicable(this.model),this.isAdoptableWhenUpgraded=o.isDeviceAdoptableWhenUpgraded(this.model);var e=o.getDeviceState(this.model);this.isPending=e===c.ADOPTING}},{key:"updateCollection",value:function(e){this.collection=e}},{key:"showButton",value:function(){return this.isButtonVisible=this.isApplicable&&(!this.model.isGateway()||this.showForNonAdoptableGateway||a.isGatewayAdoptable(this.model,this.collection))&&(p.isSuperAdmin()||p.isAdmin()||p.hasPermission("API_DEVICE_ADOPT")),this.isButtonVisible}},{key:"isNonAdoptableGateway",value:function(){return this.model&&this.collection&&this.model.isGateway()&&!a.isGatewayAdoptable(this.model,this.collection)}},{key:"submit",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.isPending=!0,this.confirmAdoptAndUpgrade().then(function(){var e=t.model.get("elite");return e&&e.replacement_for_mac?t.replace(e.replacement_for_mac):t.adopt()})}},{key:"confirmAdoptAndUpgrade",value:function(){var t=this;return this.isAdoptableWhenUpgraded&&!0!==h.model.get("bypassConfirmAdoptAndUpgrade")?l.show("confirm",{title:function(){return n.instant("DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_TITLE",{deviceName:t.model.getName()}).trim()},message:function(){return t.model.get("upgrade_to_firmware")?n.instant("DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_VERSION_MESSAGE",{fromVersion:t.model.get("version"),toVersion:t.model.get("upgrade_to_firmware")}):n.instant("DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_MESSAGE")},options:function(){return{bypassFlag:"bypassConfirmAdoptAndUpgrade",size:"small"}}}).catch(function(n){return t.isPending=!1,e.reject(n)}):e.when()}},{key:"replace",value:function(e){var t=this,i=u.repository.collection.get(e);return l.show("confirm",{title:function(){return n.instant("DEVICE_APPLY_CONFIGURATION_HEADER",{deviceName:i.getDisplayName()})},message:function(){return n.instant("DEVICE_APPLY_CONFIGURATION_MESSAGE",{deviceName:i.getDisplayName()})},options:angular.noop}).then(function(){return t.replaceDevice()}).catch(function(){return t.adopt()})}},{key:"adopt",value:function(){var e=this;return s.adoptDevice(this.model,this.getSiteModel()).then(function(t){return e.onSuccess&&e.onSuccess(),d.pushSuccess(t),!0}).catch(function(t){return t&&d.pushError(t),e.isPending=!1,!1})}},{key:"replaceDevice",value:function(){var e=this;return a.replaceDevice(this.model,this.getSiteModel()).then(function(t){var n=e.model.get("elite").replacement_for_mac;return e.collection.remove(n),e.onSuccess&&e.onSuccess(),d.pushSuccess(t),!0}).catch(function(t){return d.pushError(t),e.isPending=!1,!1})}}]),g}())}])},{}],69:[function(e,t,n){"use strict";angular.module("base-unifi-device").directive("unifiDeviceButtonAdopt",["updateModelDirectiveMixin",function(t){return{bindToController:{isButtonVisible:"=?unifiDeviceButtonAdoptIsVisible"},scope:{model:"=unifiDeviceButtonAdopt",collection:"=unifiDeviceButtonAdoptCollection",isLabeled:"=unifiDeviceButtonAdoptIsLabeled",isResponsive:"=unifiDeviceButtonAdoptIsResponsive",noIcon:"=unifiDeviceButtonAdoptNoIcon",withSite:"=unifiDeviceButtonAdoptWithSite",onSuccess:"&?unifiDeviceButtonAdoptOnSuccess",showForNonAdoptableGateway:"=unifiDeviceButtonAdoptShowForNonAdoptableGateway"},controller:"DeviceButtonAdoptController",controllerAs:"deviceButtonAdoptCtrl",replace:!0,template:e("./deviceButtonAdopt.pug")(),link:function(e,n,i,r){r.showForNonAdoptableGateway=!!e.showForNonAdoptableGateway,r.siteName=e.withSite,r.onSuccess=e.onSuccess;var s=e.$watch("collection",function(t){r.updateCollection(t),e.isOneTimeBinding&&s()});t.init(e,n,i,r,!0)}}}])},{"./deviceButtonAdopt.pug":70}],70:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<button ng-show="deviceButtonAdoptCtrl.showButton()" ng-click="deviceButtonAdoptCtrl.submit($event)" ng-class="{\'is-responsive\': isResponsive}" ng-disabled="deviceButtonAdoptCtrl.isPending || deviceButtonAdoptCtrl.isNonAdoptableGateway()" title="{{!deviceButtonAdoptCtrl.isNonAdoptableGateway() ? (\'DEVICE_ACTIONS_ADOPT\' | translate) : \'\'}}"><span class="button__icon icon" ng-if=":: !noIcon" ng-class="deviceButtonAdoptCtrl.isPending && isLabeled ? \'ubnt-icon--clock-2\' : \'ubnt-icon--plus-circle\'"></span><span class="button__label" ng-if=":: isLabeled" translate="{{deviceButtonAdoptCtrl.isAdoptableWhenUpgraded ? \'DEVICE_ACTIONS_ADOPT_AND_UPGRADE\' : \'DEVICE_ACTIONS_ADOPT\'}}"></span></button>'}},{"pug-runtime":19}],71:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("base-unifi-device").controller("DeviceButtonLinkController",["deviceUplinkUtils","deviceChannelUtils","heyToasts","frame","account",function(e,t,n,r,s){return new(function(){function o(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o)}return i(o,[{key:"showButton",value:function(){return s.isAdmin()}},{key:"submit",value:function(e){return e.preventDefault(),e.stopPropagation(),this.isUplinkDfs()?this.displayWarningFrame():this.link()}},{key:"isUplinkDfs",value:function(){return this.uplink&&this.uplink.get("na-channel")&&t.isChannelDfs(this.uplink.get("na-channel"))}},{key:"displayWarningFrame",value:function(){var e=this;return r.show("wirelessUplinkDfsWarning",{uplink:function(){return e.uplink}}).then(function(){return e.link()})}},{key:"link",value:function(){var t=this;return this.isPending=!0,e.linkDevices(this.uplink,this.downlink).then(function(e){return n.pushSuccess(e),!0}).catch(function(e){return n.pushError(e),!1}).finally(function(){t.isPending=!1})}}]),o}())}])},{}],72:[function(e,t,n){"use strict";angular.module("base-unifi-device").directive("unifiDeviceButtonLink",[function(){return{scope:{uplink:"=unifiDeviceButtonLinkUplink",downlink:"=unifiDeviceButtonLinkDownlink",isLabeled:"=unifiDeviceButtonLinkIsLabeled",isResponsive:"=unifiDeviceButtonLinkIsResponsive"},controller:"DeviceButtonLinkController",controllerAs:"deviceButtonLinkCtrl",bindToController:!0,replace:!0,template:e("./deviceButtonLink.pug")()}}])},{"./deviceButtonLink.pug":73}],73:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<button ng-show="deviceButtonLinkCtrl.showButton()" ng-click="deviceButtonLinkCtrl.submit($event)" ng-class="{\'is-responsive\': isResponsive}" ng-disabled="deviceButtonLinkCtrl.isPending" title="{{\'DEVICE_ACTIONS_LINK\' | translate}}"><span class="button__icon icon" ng-class="deviceButtonLinkCtrl.isPending && isLabeled ? \'ubnt-icon--clock-2\' : \'ubnt-icon--link\'"></span><span class="button__label" ng-if="deviceButtonLinkCtrl.isLabeled" translate="DEVICE_ACTIONS_LINK"></span></button>'}},{"pug-runtime":19}],74:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("base-unifi-device").controller("DeviceButtonLocateController",["BaseButtonController","$injector","deviceActionUtils","deviceUtils","deviceStateUtils","DEVICE_STATES","heyToasts","buttonHasSitePermissionControllerMixin",function(e,t,n,r,s,o,a,u){return new(function(s){function o(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return u(e),e.isLocating=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,e),i(o,[{key:"onModelChange",value:function(){this.isApplicable=n.isLocateApplicable(this.model),this.isLocating=this.model.get("locating")}},{key:"toggle",value:function(e){var n=this;return e.preventDefault(),e.stopPropagation(),this.isPending=!0,r.locateDevice(this.model,void 0,this.getSiteModel()).then(function(e){n.model.get("locating")&&n.locateOnMap&&t.get("mapUtils").locateDevice(n.model);return a.pushSuccess(e),!0}).catch(function(e){return a.pushError(e),!1}).finally(function(){n.isPending=!1})}}]),o}())}])},{}],75:[function(e,t,n){"use strict";angular.module("base-unifi-device").directive("unifiDeviceButtonLocate",["updateModelDirectiveMixin",function(t){return{bindToController:{isButtonVisible:"=?unifiDeviceButtonLocateIsVisible"},scope:{model:"=unifiDeviceButtonLocate",isLabeled:"=unifiDeviceButtonLocateIsLabeled",isResponsive:"=unifiDeviceButtonLocateIsResponsive",withSite:"=unifiDeviceButtonLocateWithSite",withMap:"=unifiDeviceButtonLocateWithMap"},controller:"DeviceButtonLocateController",controllerAs:"deviceButtonLocateCtrl",replace:!0,template:e("./deviceButtonLocate.pug")(),link:function(e,n,i,r){r.siteName=e.withSite,r.locateOnMap=e.withMap,e.$on("$destroy",function(){r.removeEventHandlers()}),t.init(e,n,i,r,!0)}}}])},{"./deviceButtonLocate.pug":76}],76:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<button ng-show="deviceButtonLocateCtrl.showButton()" ng-click="deviceButtonLocateCtrl.toggle($event)" ng-class="{ \'is-button-notifying\': deviceButtonLocateCtrl.isLocating || deviceButtonLocateCtrl.isPending, \'is-responsive\': isResponsive }" title="{{\'DEVICE_ACTIONS_LOCATE\' | translate}}"><span class="button__icon icon" ng-class="deviceButtonLocateCtrl.isLocating && isLabeled ? \'ubnt-icon--check-2\' : \'ubnt-icon--location-2\'"></span><span class="button__label" ng-if="::isLabeled" translate="DEVICE_ACTIONS_LOCATE"></span></button>'}},{"pug-runtime":19}],77:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("base-unifi-device").controller("DeviceButtonRestartController",["BaseButtonController","$q","deviceActionUtils","deviceUtils","deviceBatchUtils","deviceStateUtils","DEVICE_STATES","frame","heyToasts","preferences","buttonHasSitePermissionControllerMixin",function(e,t,n,r,s,o,a,u,c,l,d){return new(function(p){function f(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return d(e,"API_DEVICE_RESTART"),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(f,e),i(f,[{key:"onModelChange",value:function(){if(this.isBatch)this.isApplicable=!0,this.isPending=!1;else{var e=o.getDeviceState(this.model);this.isApplicable=n.isRestartApplicable(this.model),this.isPending=e===a.RESTARTING}}},{key:"restart",value:function(e){var n,i=this;e.preventDefault(),e.stopPropagation();var o=this.isBatch||this.withHardReboot||this.model.isGateway();return(!0!==l.model.get("bypassConfirmRestart")||o?u.show("confirmRestart",{model:function(){return i.model},isBatch:function(){return i.isBatch},withHardReboot:function(){return i.withHardReboot},bypassFlag:function(){return o?void 0:"bypassConfirmRestart"}}).then(function(e){n=e}):t.when()).then(function(){return i.isPending=!0,(i.isBatch?s.restartDevices(i.model,n,i.getSiteModel()):r.restartDevice(i.model,n,i.getSiteModel())).then(function(e){return i.onSuccess&&i.onSuccess(),c.pushSuccess(e),!0}).catch(function(e){return c.pushError(e),i.isPending=!1,!1})})}}]),f}())}])},{}],78:[function(e,t,n){"use strict";angular.module("base-unifi-device").directive("unifiDeviceButtonRestart",["updateModelDirectiveMixin",function(t){return{bindToController:{isButtonVisible:"=?unifiDeviceButtonRestartIsVisible"},scope:{model:"=unifiDeviceButtonRestart",isBatch:"=unifiDeviceButtonRestartIsBatch",isLabeled:"=unifiDeviceButtonRestartIsLabeled",isResponsive:"=unifiDeviceButtonRestartIsResponsive",withSite:"=unifiDeviceButtonRestartWithSite",withHardReboot:"=unifiDeviceButtonRestartWithHardReboot",onSuccess:"&?unifiDeviceButtonRestartOnSuccess"},controller:"DeviceButtonRestartController",controllerAs:"deviceButtonRestartCtrl",replace:!0,template:e("./deviceButtonRestart.pug")(),link:function(e,n,i,r){r.isBatch=e.isBatch,r.siteName=e.withSite,r.withHardReboot=e.withHardReboot,r.onSuccess=e.onSuccess,t.init(e,n,i,r,!0)}}}])},{"./deviceButtonRestart.pug":79}],79:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<button ng-show="deviceButtonRestartCtrl.showButton()" ng-click="deviceButtonRestartCtrl.restart($event)" ng-class="{\'is-responsive\': isResponsive}" ng-disabled="deviceButtonRestartCtrl.isPending" title="{{\'DEVICE_ACTIONS_RESTART\' | translate}}"><span class="button__icon icon" ng-class="deviceButtonRestartCtrl.isPending && isLabeled ? \'ubnt-icon--clock-2\' : \'ubnt-icon--restart\'"></span><span class="button__label" ng-if="::isLabeled" translate="DEVICE_ACTIONS_RESTART"></span></button>'}},{"pug-runtime":19}],80:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("base-unifi-device").controller("DeviceButtonUnlinkController",["deviceUplinkUtils","heyToasts","account",function(e,t,n){return new(function(){function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r)}return i(r,[{key:"showButton",value:function(){return n.isAdmin()}},{key:"unlink",value:function(n){var i=this;return n.preventDefault(),n.stopPropagation(),this.isPending=!0,e.unlinkDevices(this.uplink,this.downlink).then(function(e){return t.pushSuccess(e),!0}).catch(function(e){return t.pushError(e),!1}).finally(function(){i.isPending=!1})}}]),r}())}])},{}],81:[function(e,t,n){"use strict";angular.module("base-unifi-device").directive("unifiDeviceButtonUnlink",[function(){return{scope:{uplink:"=unifiDeviceButtonUnlinkUplink",downlink:"=unifiDeviceButtonUnlinkDownlink",isLabeled:"=unifiDeviceButtonUnlinkIsLabeled",isResponsive:"=unifiDeviceButtonUnlinkIsResponsive"},controller:"DeviceButtonUnlinkController",controllerAs:"deviceButtonUnlinkCtrl",bindToController:!0,replace:!0,template:e("./deviceButtonUnlink.pug")()}}])},{"./deviceButtonUnlink.pug":82}],82:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<button ng-show="deviceButtonUnlinkCtrl.showButton()" ng-click="deviceButtonUnlinkCtrl.unlink($event)" ng-class="{\'is-responsive\': isResponsive}" ng-disabled="deviceButtonUnlinkCtrl.isPending" title="{{\'DEVICE_ACTIONS_UNLINK\' | translate}}"><span class="button__icon icon" ng-class="deviceButtonUnlinkCtrl.isPending && isLabeled ? \'ubnt-icon--clock-2\' : \'ubnt-icon--trashcan\'"></span><span class="button__label" ng-if="deviceButtonUnlinkCtrl.isLabeled" translate="DEVICE_ACTIONS_UNLINK"></span></button>'}},{"pug-runtime":19}],83:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("base-unifi-device").controller("DeviceButtonUpgradeController",["BaseButtonController","$q","$translate","deviceUtils","deviceStateUtils","DEVICE_STATES","frame","heyToasts","account","preferences","semanticVersion","buttonHasSitePermissionControllerMixin",function(e,t,n,r,s,o,a,u,c,l,d,p){return new(function(c){function f(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return p(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(f,e),i(f,[{key:"onModelChange",value:function(){var e=s.getRawDeviceState(this.model);this.isApplicable=e===o.UPGRADING,this.isDowngradable=this.isDowngradeAvailable(),!0===this.model.get("upgradable")&&(e===o.CONNECTED&&(this.isApplicable=!0),e===o.PENDING&&"wireless"!==this.model.getNested("uplink.type")&&(this.isApplicable=!0)),this.isPending=e===o.UPGRADING}},{key:"isDowngradeAvailable",value:function(){return this.model&&this.model.get("upgrade_to_firmware")&&d.satisfies(this.model.get("version"),">"+this.model.get("upgrade_to_firmware"))}},{key:"upgrade",value:function(e){var i=this;e.preventDefault(),e.stopPropagation();return(!0!==l.model.get("bypassConfirmUpgrade")?a.show("confirm",{title:function(){return n.instant(i.isDowngradable?"DEVICE_ACTIONS_DOWNGRADE_CONFIRM_TITLE":"DEVICE_ACTIONS_UPGRADE_CONFIRM_TITLE",{deviceName:i.model.getDisplayName()})},message:function(){return i.model.get("upgrade_to_firmware")?n.instant(i.isDowngradable?"DEVICE_ACTIONS_DOWNGRADE_CONFIRM_VERSION_MESSAGE":"DEVICE_ACTIONS_UPGRADE_CONFIRM_VERSION_MESSAGE",{deviceName:i.model.getDisplayName(),fromVersion:i.model.get("version"),toVersion:i.model.get("upgrade_to_firmware")}):n.instant("DEVICE_ACTIONS_UPGRADE_CONFIRM_MESSAGE",{deviceName:i.model.getDisplayName()})},options:function(){return{bypassFlag:"bypassConfirmUpgrade"}}}):t.when()).then(function(){return i.isPending=!0,r.upgradeDevice(i.model,void 0,i.getSiteModel()).then(function(e){return i.onSuccess&&i.onSuccess(),u.pushSuccess(e),!0}).catch(function(e){return u.pushError(e),i.isPending=!1,!1})})}}]),f}())}])},{}],84:[function(e,t,n){"use strict";angular.module("base-unifi-device").directive("unifiDeviceButtonUpgrade",["updateModelDirectiveMixin",function(t){return{bindToController:{isButtonVisible:"=?unifiDeviceButtonUpgradeIsVisible"},scope:{model:"=unifiDeviceButtonUpgrade",isLabeled:"=unifiDeviceButtonUpgradeIsLabeled",isResponsive:"=unifiDeviceButtonUpgradeIsResponsive",withSite:"=unifiDeviceButtonUpgradeWithSite",onSuccess:"&?unifiDeviceButtonUpgradeOnSuccess"},controller:"DeviceButtonUpgradeController",controllerAs:"deviceButtonUpgradeCtrl",replace:!0,template:e("./deviceButtonUpgrade.pug")(),link:function(e,n,i,r){r.siteName=e.withSite,r.onSuccess=e.onSuccess,t.init(e,n,i,r,!0)}}}])},{"./deviceButtonUpgrade.pug":85}],85:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<button ng-show="deviceButtonUpgradeCtrl.showButton()" ng-click="deviceButtonUpgradeCtrl.upgrade($event)" ng-class="{\'is-responsive\': isResponsive}" ng-disabled="deviceButtonUpgradeCtrl.isPending" ng-attr-title="{{deviceButtonUpgradeCtrl.isDowngradable ? \'DEVICE_ACTIONS_DOWNGRADE\' : \'DEVICE_ACTIONS_UPGRADE\' | translate}}"><span class="button__icon icon" ng-class="deviceButtonUpgradeCtrl.isPending && isLabeled ? \'ubnt-icon--clock-2\' : \'ubnt-icon--firmware-update\'"></span><span class="button__label" ng-if="!deviceButtonUpgradeCtrl.isPending && isLabeled" translate="{{deviceButtonUpgradeCtrl.isDowngradable ? \'DEVICE_ACTIONS_DOWNGRADE\' : \'DEVICE_ACTIONS_UPGRADE\' }}"></span><span class="button__label" ng-if="deviceButtonUpgradeCtrl.isPending && isLabeled" translate="DEVICE_ACTIONS_UPDATE_FIRMWARE"></span></button>'}},{"pug-runtime":19}],86:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("base-unifi-device").controller("DeviceListButtonRollingUpgradeController",["$translate","BaseCollectionButtonController","deviceUtils","heyToasts","frame","buttonHasSitePermissionControllerMixin",function(e,t,n,r,s,o){return new(function(a){function u(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this));return e.collectionChangeEvent="add remove reset change:upgradable change:rollupgrade",o(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(u,t),i(u,[{key:"onCollectionChange",value:function(){this.collection?(this.isRunning=!!this.collection.findWhere({type:"uap",rollupgrade:!0}),this.isPending=this.isRunning&&this.isCancelled||!this.isRunning&&this.isStarted||!1,this.isApplicable=this.isRunning||this.isPending||!!this.collection.findWhere({type:"uap",upgradable:!0})):(this.isApplicable=!1,this.isPending=!1,this.isRunning=!1)}},{key:"toggle",value:function(e){return this.isRunning?this.cancel(e):this.upgrade(e)}},{key:"upgrade",value:function(t){var i=this;return t.preventDefault(),t.stopPropagation(),s.show("confirm",{title:function(){return e.instant("DEVICE_LIST_ACTIONS_ROLLING_UPGRADE_START_CONFIRM_TITLE")},message:function(){return e.instant("DEVICE_LIST_ACTIONS_ROLLING_UPGRADE_START_CONFIRM_MESSAGE")},options:angular.noop}).then(function(){return i.isStarted=!0,i.isCancelled=!1,n.startRollingUpgrade(i.getSiteModel()).then(function(e){return r.pushSuccess(e),i.isPending=!0,!0}).catch(function(e){return r.pushError(e),i.isStarted=!1,!1})})}},{key:"cancel",value:function(t){var i=this;return t.preventDefault(),t.stopPropagation(),s.show("confirm",{title:function(){return e.instant("DEVICE_LIST_ACTIONS_ROLLING_UPGRADE_STOP_CONFIRM_TITLE")},message:function(){return e.instant("DEVICE_LIST_ACTIONS_ROLLING_UPGRADE_STOP_CONFIRM_MESSAGE")},options:angular.noop}).then(function(){return i.isCancelled=!0,i.isStarted=!1,n.stopRollingUpgrade(i.getSiteModel()).then(function(e){return r.pushSuccess(e),i.isPending=!0,!0}).catch(function(e){return r.pushError(e),i.isCancelled=!1,!1})})}},{key:"$onChanges",value:function(e){e.collection&&this.updateCollection(this.collection)}},{key:"$onDestroy",value:function(){this.removeEventHandlers()}}]),u}())}])},{}],87:[function(e,t,n){"use strict";angular.module("base-unifi-device").component("unifiDeviceListButtonRollingUpgrade",{bindings:{collection:"<unifiDeviceListButtonRollingUpgradeCollection",isLabeled:"<unifiDeviceListButtonRollingUpgradeIsLabeled",isResponsive:"<unifiDeviceListButtonRollingUpgradeIsResponsive",siteName:"<unifiDeviceListButtonRollingUpgradeWithSite"},controller:"DeviceListButtonRollingUpgradeController",controllerAs:"deviceListButtonRollingUpgradeCtrl",template:e("./deviceListButtonRollingUpgrade.pug")()})},{"./deviceListButtonRollingUpgrade.pug":88}],88:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t=t+'<button class="ubntButton ubntButton--primary ubntButton--noWrap" ng-show="deviceListButtonRollingUpgradeCtrl.showButton()" ng-click="deviceListButtonRollingUpgradeCtrl.toggle($event)" ng-class="{\'is-responsive\': deviceListButtonRollingUpgradeCtrl.isResponsive}" ng-disabled="deviceListButtonRollingUpgradeCtrl.isPending" title="{{deviceListButtonRollingUpgradeCtrl.isRunning ? \'DEVICE_LIST_ACTIONS_ROLLING_UPGRADE_STOP\' : \'DEVICE_LIST_ACTIONS_ROLLING_UPGRADE_START\' | translate}}"><span class="button__icon icon" ng-class="{ \'ubnt-icon--firmware-update\': !deviceListButtonRollingUpgradeCtrl.isPending && !deviceListButtonRollingUpgradeCtrl.isRunning, \'ubnt-icon--minus-circle\': !deviceListButtonRollingUpgradeCtrl.isPending && deviceListButtonRollingUpgradeCtrl.isRunning, \'ubnt-icon--clock-2\': deviceListButtonRollingUpgradeCtrl.isPending }"></span><span class="button__label" ng-if="::deviceListButtonRollingUpgradeCtrl.isLabeled"'+(n="translate",r=!0,s=!0,o=!0,!1!==r&&null!=r&&(r||"class"!==n&&"style"!==n)?!0===r?" "+(o?n:n+'="'+n+'"'):("function"==typeof r.toJSON&&(r=r.toJSON()),"string"==typeof r||(r=JSON.stringify(r),s||-1===r.indexOf('"'))?(s&&(r=function(e){var t=""+e,n=i.exec(t);if(!n)return e;var r,s,o,a="";for(r=n.index,s=0;r<t.length;r++){switch(t.charCodeAt(r)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==r&&(a+=t.substring(s,r)),s=r+1,a+=o}return s!==r?a+t.substring(s,r):a}(r))," "+n+'="'+r+'"'):" "+n+"='"+r.replace(/'/g,"'")+"'"):"")+">{{deviceListButtonRollingUpgradeCtrl.isRunning ? 'DEVICE_LIST_ACTIONS_ROLLING_UPGRADE_STOP' : 'DEVICE_LIST_ACTIONS_ROLLING_UPGRADE_START'}}</span></button>";var n,r,s,o};var i=/["&<>]/},{"pug-runtime":19}],89:[function(e,t,n){"use strict";angular.module("base-unifi-device").config(["frameProvider",function(t){t.when("confirmRestart",{controller:"ConfirmRestartController",controllerAs:"confirmRestartCtrl",layout:"confirmLayout",template:e("../views/frames/confirmRestart.pug")()}).when("wirelessUplinkDfsWarning",{controller:"WirelessUplinkDfsWarningController",controllerAs:"wirelessUplinkDfsWarningCtrl",layout:"wirelessUplinkDfsWarningLayout",template:e("../views/frames/wirelessUplinkDfsWarning.pug")()})}])},{"../views/frames/confirmRestart.pug":190,"../views/frames/wirelessUplinkDfsWarning.pug":191}],90:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("COUNTRY_CODES_WITH_FCC_DFS",["AS","CA","GU","MP","PR","US","VI"])},{}],91:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("DEFAULT_HT",{na:"40",ng:"20"})},{}],92:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("DEVICE_ADOPT_L3",{CHECK_DEVICE_AFTER_SETTING_INFORM_FREQUENCY:1e3,CHECK_DEVICE_AFTER_SETTING_INFORM_MAX_ATTEMPTS:10})},{}],93:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("DEVICE_CATEGORIES",{ADOPTING:"DEVICE_CATEGORY_ADOPTING",INACTIVE:"DEVICE_CATEGORY_INACTIVE",LAN:"DEVICE_CATEGORY_LAN",MANAGED_BY_OTHER:"DEVICE_CATEGORY_MANAGED_BY_OTHER_SHORT",PENDING:"DEVICE_CATEGORY_PENDING_SHORT",WLAN:"DEVICE_CATEGORY_WLAN",WAN:"DEVICE_CATEGORY_WAN"})},{}],94:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("DEVICE_INFORM",{DEFAULT_PORT:"8080",DEFAULT_HOST:"unifi.yourdomain.com",ENDPOINT:"/inform",PROTOCOL:"http://"})},{}],95:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("DEVICE_LICENSE_STATES",{REGISTERED:"registered",REGISTRATION_FAILED:"registration_failed",GRACE_PERIOD:"grace_period",HOST_DOWN:"host_is_down",UNKNOWN:"unknown"})},{}],96:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("DEVICE_STATES",{CONNECTED:"DEVICE_STATE_CONNECTED",PENDING:"DEVICE_STATE_PENDING",FIRMWARE_MISMATCH:"DEVICE_STATE_FIRMWARE_MISMATCH",UPGRADING:"DEVICE_STATE_UPGRADING",PROVISIONING:"DEVICE_STATE_PROVISIONING",HEARTBEAT_MISSED:"DEVICE_STATE_HEARTBEAT_MISSED",ADOPTING:"DEVICE_STATE_ADOPTING",DELETING:"DEVICE_STATE_DELETING",DISCONNECTED:"DEVICE_STATE_DISCONNECTED",RESTARTING:"DEVICE_STATE_RESTARTING",INFORM_ERROR:"DEVICE_STATE_INFORM_ERROR",ADOPTION_REQUIRED:"DEVICE_STATE_ADOPTION_REQUIRED",ADOPTION_FAILED:"DEVICE_STATE_ADOPTION_FAILED",ISOLATED:"DEVICE_STATE_ISOLATED",RFSCANNING:"DEVICE_STATE_RFSCANNING",MANAGED_BY_OTHER:"DEVICE_STATE_MANAGED_BY_OTHER",UNKNOWN:"DEVICE_STATE_UNKNOWN"})},{}],97:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("DEVICE_STATE_FLAGS",{ELITE:"DEVICE_STATE_FLAG_ELITE",ISOLATED:"DEVICE_STATE_FLAG_ISOLATED",LOCALLY_DISCOVERED:"DEVICE_STATE_FLAG_LOCALLY_DISCOVERED",MODEL_EOL_PENDING:"DEVICE_STATE_FLAG_MODEL_EOL_PENDING",WIRELESS:"DEVICE_STATE_FLAG_WIRELESS",WIRED_FULL_DUPLEX:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",WIRED_HALF_DUPLEX:"DEVICE_STATE_FLAG_WIRED_HALF_DUPLEX",LICENSE_GRACE_PERIOD:"DEVICE_STATE_FLAG_LICENSE_GRACE_PERIOD",LICENSE_REGISTRATION_FAILED:"DEVICE_STATE_FLAG_LICENSE_REGISTRATION_FAILED",DISABLED:"DEVICE_STATE_FLAG_DISABLED",MIGRATING:"DEVICE_STATE_FLAG_MIGRATING",UPGRADE_PREPARING_REBOOT:"DEVICE_STATE_FLAG_UPGRADE_PREPARING_REBOOT",FIRMWARE_DOWNLOADING:"DEVICE_STATE_FLAG_FIRMWARE_DOWNLOADING",UPGRADE_FAILED_REBOOT:"DEVICE_STATE_FLAG_UPGRADE_FAILED_REBOOT",DEVICE_FIRMWARE_READY:"DEVICE_STATE_FLAG_DEVICE_FIRMWARE_READY",DEVICE_FIRMWARE_WRITING:"DEVICE_STATE_FLAG_DEVICE_FIRMWARE_WRITING",UNSUPPORTED:"DEVICE_STATE_FLAG_UNSUPPORTED",UPDATE_REQUIRED:"DEVICE_STATE_FLAG_UPDATE_REQUIRED"})},{}],98:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("DEVICE_STATE_IDS",{DISCONNECTED:0,CONNECTED:1,PENDING:2,FIRMWARE_MISMATCH:3,UPGRADING:4,PROVISIONING:5,HEARTBEAT_MISSED:6,ADOPTING:7,DELETING:8,INFORM_ERROR:9,ADOPTION_FAILED:10,ISOLATED:11})},{}],99:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("DEVICE_TYPES",{AP:"uap",GATEWAY:"ugw",SWITCH:"usw"})},{}],100:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("DEVICE_UNSUPPORTED_REASONS",{1:"EOL",2:"INCOMPATIBLE_FIRMWARE"})},{}],101:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("DHCP_USER_OPTION",{MIN_CODE:7,MAX_CODE:254,MIN_USER_CODE:224,MAX_USER_CODE:254,DISALLOWED_CODES:[15,42,43,44,51,66,67,252],DHCP_USER_OPTION_PREFIX:"dhcpd_user_option_",SIGNED_EXTENTS:{8:{min:Math.pow(2,8)/-2,max:Math.pow(2,8)/2-1},16:{min:Math.pow(2,16)/-2,max:Math.pow(2,16)/2-1},32:{min:Math.pow(2,32)/-2,max:Math.pow(2,32)/2-1}},UNSIGNED_EXTENTS:{8:{min:0,max:Math.pow(2,8)-1},16:{min:0,max:Math.pow(2,16)-1},32:{min:0,max:Math.pow(2,32)-1}}})},{}],102:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("DISCOVERED_DEVICE",{LAST_SEEN_TIMEOUT:300})},{}],103:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("ELITE_ASSIGNMENT_STATES",{ASSIGNED:"ASSIGNED",RMA_IN_PROGRESS:"RMA_IN_PROGRESS",REPLACING:"REPLACING",REPLACED:"REPLACED",REVOKED:"REVOKED"})},{}],104:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("EXTERNAL_ANTENNA",{CUSTOM:{GAIN:6,ID:-1},UMAD:{ID:3}})},{}],105:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("FIRMWARE_CAPS",{SSH:1,STA_STAT:2,UTERM:4,DNSMASQ:8,QCASWITCH:16,FWUPDATE:32,DPI:64,LAG:128,OWRTSWITCH:256,SNMP:8192,SNMPV3:16384,ELITE_DEVICE:131072})},{}],106:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("HARDWARE_CAPS",{SCREEN:1,LEDBAR:2})},{}],107:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("NETWORK_DEFAULTS",{DEFAULT_NETWORK_INTERFACES:2,LAN2_NUM:2,WAN2_NUM:2,MAX_DHCP_LEASES:5e5,MAX_DHCPV6_LEASES:2e3})},{}],108:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("POE_CAPS",{"8023AF":1,"8023AT":2,PASV24:4,PASSTHROUGHABLE:8,PASSTHROUGH:16,"8023BT":32})},{}],109:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("POE_MAX_POWER",{"8023AF":15.4,"8023AT":30,"8023BT":60,PASV24:0,PASSTHROUGHABLE:0,PASSTHROUGH:0})},{}],110:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("POE_VOLTAGE",{PASV24:"24.00",POE_PLUS:"48.00"})},{}],111:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("RADIO_CAPS",{RADIO_CAP_FIXED_CCODE:1,RADIO_CAP_SUPER:2,RADIO_CAP_11N_DRIVER:4,RADIO_CAP_11N_CHAIN1x1:8,RADIO_CAP_11N_CHAIN2x2:16,RADIO_CAP_11N_CHAIN3x3:32,RADIO_CAP_11N_RXCHAIN1:64,RADIO_CAP_11N_RXCHAIN2:128,RADIO_CAP_11N_TXCHAIN1:256,RADIO_CAP_11N_TXCHAIN2:512,RADIO_CAP_11N_NO_HT40:1024,RADIO_CAP_AIRMAX_ONLY:2048,RADIO_CAP_LOW_TXPOWER_MODE:4096,RADIO_CAP_FAST_CLOCK:8192,RADIO_CAP_INDOOR:16384,RADIO_CAP_HSR:32768,RADIO_CAP_RESTRICTED_RANGE:65536,RADIO_CAP_STRICT_MODE_MINRSSI:131072,RADIO_CAP_DFS:16777216,RADIO_CAP_FCC_DFS:33554432,RADIO_CAP_11N_CHAIN4x4:67108864,RADIO_CAP_VHT160:134217728,RADIO_CAP_AIRTIME:268435456,RADIO_CAP_AIRVIEW:536870912})},{}],112:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("RADIO_STATES",{DFS_WAIT:"DFS_WAIT",INIT:"INIT",RUN:"RUN"})},{}],113:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("RADIO_TYPES",{NA:{type:"na",frequency:"5 GHz"},NG:{type:"ng",frequency:"2.4 GHz"}})},{}],114:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("SPEED_CAPS",{PORTSPEED_HALF_10:1,PORTSPEED_FULL_10:2,PORTSPEED_HALF_100:4,PORTSPEED_FULL_100:8,PORTSPEED_HALF_1000:16,PORTSPEED_FULL_1000:32,PORTSPEED_FULL_2P5G:64,PORTSPEED_FULL_5G:128,PORTSPEED_FULL_10G:256,PORTSPEED_FULL_20G:4096,PORTSPEED_FULL_25G:8192,PORTSPEED_FULL_40G:16384,PORTSPEED_FULL_50G:32768,PORTSPEED_FULL_100G:65536,PORTSPEED_AUTO_NEG:1048576})},{}],115:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("SPEED_COLOR_MAP",{amber:"warning",green:"success",white:"white",disconnected:"disconnected",empty:"empty"})},{}],116:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("SPEED_SETTINGS",{PORTSPEED_HALF_10:{translationKey:"DEVICE_STATE_FLAG_WIRED_HALF_DUPLEX",autoneg:!1,speed:10,full_duplex:!1},PORTSPEED_FULL_10:{translationKey:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:10,full_duplex:!0},PORTSPEED_HALF_100:{translationKey:"DEVICE_STATE_FLAG_WIRED_HALF_DUPLEX",autoneg:!1,speed:100,full_duplex:!1},PORTSPEED_FULL_100:{translationKey:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:100,full_duplex:!0},PORTSPEED_HALF_1000:{translationKey:"DEVICE_STATE_FLAG_WIRED_HALF_DUPLEX",autoneg:!1,speed:1e3,full_duplex:!1},PORTSPEED_FULL_1000:{translationKey:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:1e3,full_duplex:!0},PORTSPEED_FULL_2P5G:{translationKey:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:2500,full_duplex:!0},PORTSPEED_FULL_5G:{translationKey:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:5e3,full_duplex:!0},PORTSPEED_FULL_10G:{translationKey:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:1e4,full_duplex:!0},PORTSPEED_FULL_20G:{translationKey:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:2e4,full_duplex:!0},PORTSPEED_FULL_25G:{translationKey:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:25e3,full_duplex:!0},PORTSPEED_FULL_40G:{translationKey:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:4e4,full_duplex:!0},PORTSPEED_FULL_50G:{translationKey:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:5e4,full_duplex:!0},PORTSPEED_FULL_100G:{translationKey:"DEVICE_STATE_FLAG_WIRED_FULL_DUPLEX",autoneg:!1,speed:1e5,full_duplex:!0},PORTSPEED_AUTO_NEG:{translationKey:"DEVICE_PROPERTIES_GATEWAY_LINK_NEGOTIATION_AUTO",autoneg:!0,speed:void 0,full_duplex:void 0}})},{}],117:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("TRAFFIC",{UNIT:{BYTES:"B",BPS:"bps",PACKETS:"pkts"},TYPE:{ALL:"all",MULTICAST:"multicast",BROADCAST:"broadcast"},DIRECTION:{TOTAL:"total",TX:"tx",RX:"rx"},CONNECTION:{ALL:"all",WIRED:"wired",WIRELESS:"wireless"}})},{}],118:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("USG_CAPS",{UNIFI_USG_CAP_DPI:1,UNIFI_USG_CAP_PORTA:2,UNIFI_USG_CAP_DEFAULT_ROUTE_DISTANCE:4,UNIFI_USG_CAP_SSH_DISABLE:8,UNIFI_USG_CAP_RADIUS:16,UNIFI_USG_CAP_FIREWALL_CONTIGUOUS_OPTION:32,UNIFI_USG_CAP_GEO_IP_FILTERING:64,UNIFI_USG_CAP_IPS:128,UNIFI_USG_CAP_DDNS_EXTENDED:256,UNIFI_USG_CAP_WAN_EVENT_REPORT:512,UNIFI_USG_CAP_PORT_REASSIGNMENT:2048})},{}],119:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("WIFI_BANDS",{UNII_1:"unii1",UNII_2:"unii2",UNII_2_EXT:"unii2ext",UNII_3:"unii3",ISM:"ism5g"})},{}],120:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("WIFI_CAPS",{VWIRE:1,ZERO_HANDOFF:2,BANDSTEER:4,BANDSTEER_PER_VAP:8,RF_SCAN:16,AIRTIME_CONFIG:32,BGA_FILTER:64,MESH:128,MIN_RSSI_STRICT_MODE:256,MULTIPLE_ACL_LIST:1024,MESHV3:2048,UNIFI_WIFI_CAP_RADIUS_MAC_AUTH:4096})},{}],121:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("WIFI_CHANNELS",{ng:{20:{1:{lowerFrequency:2401,centerFrequency:2412,upperFrequency:2423,subChannels:[1]},2:{lowerFrequency:2406,centerFrequency:2417,upperFrequency:2428,subChannels:[2]},3:{lowerFrequency:2411,centerFrequency:2422,upperFrequency:2433,subChannels:[3]},4:{lowerFrequency:2416,centerFrequency:2427,upperFrequency:2438,subChannels:[4]},5:{lowerFrequency:2421,centerFrequency:2432,upperFrequency:2443,subChannels:[5]},6:{lowerFrequency:2426,centerFrequency:2437,upperFrequency:2448,subChannels:[6]},7:{lowerFrequency:2431,centerFrequency:2442,upperFrequency:2453,subChannels:[7]},8:{lowerFrequency:2436,centerFrequency:2447,upperFrequency:2458,subChannels:[8]},9:{lowerFrequency:2441,centerFrequency:2452,upperFrequency:2463,subChannels:[9]},10:{lowerFrequency:2446,centerFrequency:2457,upperFrequency:2468,subChannels:[10]},11:{lowerFrequency:2451,centerFrequency:2462,upperFrequency:2473,subChannels:[11]},12:{lowerFrequency:2456,centerFrequency:2467,upperFrequency:2478,subChannels:[12]},13:{lowerFrequency:2461,centerFrequency:2472,upperFrequency:2483,subChannels:[13]},14:{lowerFrequency:2473,centerFrequency:2484,upperFrequency:2495,subChannels:[14]}},40:{3:{lowerFrequency:2401,centerFrequency:2422,upperFrequency:2443,subChannels:[1,5]},4:{lowerFrequency:2406,centerFrequency:2427,upperFrequency:2448,subChannels:[2,6]},5:{lowerFrequency:2411,centerFrequency:2432,upperFrequency:2453,subChannels:[3,7]},6:{lowerFrequency:2416,centerFrequency:2437,upperFrequency:2458,subChannels:[4,8]},7:{lowerFrequency:2421,centerFrequency:2442,upperFrequency:2463,subChannels:[5,9]},8:{lowerFrequency:2426,centerFrequency:2447,upperFrequency:2468,subChannels:[6,10]},9:{lowerFrequency:2431,centerFrequency:2452,upperFrequency:2473,subChannels:[7,11]},10:{lowerFrequency:2436,centerFrequency:2457,upperFrequency:2478,subChannels:[8,12]},11:{lowerFrequency:2441,centerFrequency:2462,upperFrequency:2483,subChannels:[9,13]}}},na:{20:{7:{lowerFrequency:5030,centerFrequency:5035,upperFrequency:5040,subChannels:[7]},8:{lowerFrequency:5030,centerFrequency:5040,upperFrequency:5050,subChannels:[8]},9:{lowerFrequency:5040,centerFrequency:5045,upperFrequency:5050,subChannels:[9]},11:{lowerFrequency:5050,centerFrequency:5055,upperFrequency:5060,subChannels:[11]},12:{lowerFrequency:5050,centerFrequency:5060,upperFrequency:5070,subChannels:[12]},16:{lowerFrequency:5070,centerFrequency:5080,upperFrequency:5090,subChannels:[16]},36:{lowerFrequency:5170,centerFrequency:5180,upperFrequency:5190,subChannels:[36],band:"unii1"},40:{lowerFrequency:5190,centerFrequency:5200,upperFrequency:5210,subChannels:[40],band:"unii1"},44:{lowerFrequency:5210,centerFrequency:5220,upperFrequency:5230,subChannels:[44],band:"unii1"},48:{lowerFrequency:5230,centerFrequency:5240,upperFrequency:5250,subChannels:[48],band:"unii1"},52:{lowerFrequency:5250,centerFrequency:5260,upperFrequency:5270,subChannels:[52],band:"unii2"},56:{lowerFrequency:5270,centerFrequency:5280,upperFrequency:5290,subChannels:[56],band:"unii2"},60:{lowerFrequency:5290,centerFrequency:5300,upperFrequency:5310,subChannels:[60],band:"unii2"},64:{lowerFrequency:5310,centerFrequency:5320,upperFrequency:5330,subChannels:[64],band:"unii2"},100:{lowerFrequency:5490,centerFrequency:5500,upperFrequency:5510,subChannels:[100],band:"unii2ext"},104:{lowerFrequency:5510,centerFrequency:5520,upperFrequency:5530,subChannels:[104],band:"unii2ext"},108:{lowerFrequency:5530,centerFrequency:5540,upperFrequency:5550,subChannels:[108],band:"unii2ext"},112:{lowerFrequency:5550,centerFrequency:5560,upperFrequency:5570,subChannels:[112],band:"unii2ext"},116:{lowerFrequency:5570,centerFrequency:5580,upperFrequency:5590,subChannels:[116],band:"unii2ext"},120:{lowerFrequency:5590,centerFrequency:5600,upperFrequency:5610,subChannels:[120],band:"unii2ext"},124:{lowerFrequency:5610,centerFrequency:5620,upperFrequency:5630,subChannels:[124],band:"unii2ext"},128:{lowerFrequency:5630,centerFrequency:5640,upperFrequency:5650,subChannels:[128],band:"unii2ext"},132:{lowerFrequency:5650,centerFrequency:5660,upperFrequency:5670,subChannels:[132],band:"unii2ext"},136:{lowerFrequency:5670,centerFrequency:5680,upperFrequency:5690,subChannels:[136],band:"unii2ext"},140:{lowerFrequency:5690,centerFrequency:5700,upperFrequency:5710,subChannels:[140],band:"unii2ext"},144:{lowerFrequency:5710,centerFrequency:5720,upperFrequency:5730,subChannels:[144],band:"unii2ext"},149:{lowerFrequency:5735,centerFrequency:5745,upperFrequency:5755,subChannels:[149],band:"unii3"},153:{lowerFrequency:5755,centerFrequency:5765,upperFrequency:5775,subChannels:[153],band:"unii3"},157:{lowerFrequency:5775,centerFrequency:5785,upperFrequency:5795,subChannels:[157],band:"unii3"},161:{lowerFrequency:5795,centerFrequency:5805,upperFrequency:5815,subChannels:[161],band:"unii3"},165:{lowerFrequency:5815,centerFrequency:5825,upperFrequency:5835,subChannels:[165],band:"ism5g"},183:{lowerFrequency:4910,centerFrequency:4915,upperFrequency:4920,subChannels:[183]},184:{lowerFrequency:4910,centerFrequency:4920,upperFrequency:4930,subChannels:[184]},185:{lowerFrequency:4920,centerFrequency:4925,upperFrequency:4930,subChannels:[185]},187:{lowerFrequency:4930,centerFrequency:4935,upperFrequency:4940,subChannels:[187]},188:{lowerFrequency:4930,centerFrequency:4940,upperFrequency:4950,subChannels:[188]},189:{lowerFrequency:4940,centerFrequency:4945,upperFrequency:4950,subChannels:[189]},192:{lowerFrequency:4950,centerFrequency:4960,upperFrequency:4970,subChannels:[192]},196:{lowerFrequency:4970,centerFrequency:4980,upperFrequency:4990,subChannels:[196]}},40:{38:{lowerFrequency:5170,centerFrequency:5190,upperFrequency:5210,subChannels:[36,40],band:"unii1"},46:{lowerFrequency:5210,centerFrequency:5230,upperFrequency:5250,subChannels:[44,48],band:"unii1"},54:{lowerFrequency:5250,centerFrequency:5270,upperFrequency:5290,subChannels:[52,56],band:"unii2"},62:{lowerFrequency:5290,centerFrequency:5310,upperFrequency:5330,subChannels:[60,64],band:"unii2"},102:{lowerFrequency:5490,centerFrequency:5510,upperFrequency:5530,subChannels:[100,104],band:"unii2ext"},110:{lowerFrequency:5530,centerFrequency:5550,upperFrequency:5570,subChannels:[108,112],band:"unii2ext"},118:{lowerFrequency:5570,centerFrequency:5590,upperFrequency:5610,subChannels:[116,120],band:"unii2ext"},126:{lowerFrequency:5610,centerFrequency:5630,upperFrequency:5650,subChannels:[124,128],band:"unii2ext"},134:{lowerFrequency:5650,centerFrequency:5670,upperFrequency:5690,subChannels:[132,136],band:"unii2ext"},142:{lowerFrequency:5690,centerFrequency:5710,upperFrequency:5730,subChannels:[140,144],band:"unii2ext"},151:{lowerFrequency:5735,centerFrequency:5755,upperFrequency:5775,subChannels:[149,153],band:"unii3"},159:{lowerFrequency:5775,centerFrequency:5795,upperFrequency:5815,subChannels:[157,161],band:"unii3"}},80:{42:{lowerFrequency:5170,centerFrequency:5190,upperFrequency:5250,subChannels:[36,40,44,48],band:"unii1"},58:{lowerFrequency:5250,centerFrequency:5270,upperFrequency:5330,subChannels:[52,56,60,64],band:"unii2"},106:{lowerFrequency:5490,centerFrequency:5510,upperFrequency:5570,subChannels:[100,104,108,112],band:"unii2ext"},122:{lowerFrequency:5570,centerFrequency:5590,upperFrequency:5650,subChannels:[116,120,124,128],band:"unii2ext"},138:{lowerFrequency:5650,centerFrequency:5670,upperFrequency:5730,subChannels:[132,136,140,144],band:"unii2ext"},155:{lowerFrequency:5735,centerFrequency:5755,upperFrequency:5815,subChannels:[149,153,157,161],band:"unii3"}},160:{50:{lowerFrequency:5170,centerFrequency:5250,upperFrequency:5330,subChannels:[36,40,44,48,52,56,60,64],band:"unii1"},114:{lowerFrequency:5490,centerFrequency:5570,upperFrequency:5650,subChannels:[100,104,108,112,116,120,124,128],band:"unii2ext"}}}})},{}],122:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.label=t,this.range=n,this.state=i}return i(e,[{key:"isInRange",value:function(e){var t=angular.isNumber(e)&&e>=this.range.lo&&e<=this.range.hi;return this.range.within?t:!t}}]),e}();angular.module("base-unifi-device").constant("WIFI_EXPERIENCE",{UNKNOWN:new r("UNKNOWN",{lo:0,hi:100,within:!1},""),POOR:new r("POOR",{lo:0,hi:24,within:!0},"danger"),FAIR:new r("FAIR",{lo:25,hi:49,within:!0},"warning"),GOOD:new r("GOOD",{lo:50,hi:94,within:!0},"success"),EXCELLENT:new r("EXCELLENT",{lo:95,hi:100,within:!0},"success")})},{}],123:[function(e,t,n){"use strict";angular.module("base-unifi-device").constant("WLAN_SECURITY_TYPES",{OPEN:"open",WEP:"wep",WPA_PERSONAL:"wpapsk",WPA_ENTERPRISE:"wpaeap"})},{}],124:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("base-unifi-device").controller("ConfirmRestartController",["BaseConfirmController","model","isBatch","withHardReboot","bypassFlag",function(e,t,n,r,s){return new(function(o){function a(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,{bypassFlag:s}));return e.model=t,e.isBatch=n,e.withHardReboot=r,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(a,e),i(a,[{key:"resolve",value:function(){var e=this.hardReboot?{rebootType:"hard"}:{};return function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var s=Object.getPrototypeOf(t);return null===s?void 0:e(s,n,i)}if("value"in r)return r.value;var o=r.get;return void 0!==o?o.call(i):void 0}(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"resolve",this).call(this,e)}}]),a}())}])},{}],125:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("base-unifi-device").controller("WirelessUplinkDfsWarningController",["$rootScope","aura","frame","uplink","KEY_EVENTS",function(e,t,n,r,s){return new(function(){function o(){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.aura=t,this.uplink=r;var i=e.$on("$frameClose:wirelessUplinkDfsWarning",function(){n.removeEventHandlers(),i()});this.addEventHandlers()}return i(o,[{key:"addEventHandlers",value:function(){var t=this;this.removeEventHandlers(),this.events=[e.$on(s.keyup.ENTER.broadcastEvent,function(){t.resolve()})]}},{key:"removeEventHandlers",value:function(){this.events&&angular.forEach(this.events,function(e){e()})}},{key:"resolve",value:function(){return n.getLayout("wirelessUplinkDfsWarningLayout").resolve()}},{key:"reject",value:function(){return n.getLayout("wirelessUplinkDfsWarningLayout").reject()}}]),o}())}])},{}],126:[function(e,t,n){"use strict";angular.module("base-unifi-device").filter("canConfigureDevice",["deviceActionUtils",function(e){function t(t){return e.canConfigureDevice(t)}return t.$stateful=!0,t}])},{}],127:[function(e,t,n){"use strict";angular.module("base-unifi-device").filter("isDeviceSupported",["deviceStateUtils",function(e){function t(t){return e.isDeviceSupported(t)}return t.$stateful=!0,t}])},{}],128:[function(e,t,n){"use strict";angular.module("base-unifi-device").filter("isDeviceUnsupported",["deviceStateUtils",function(e){function t(t){return e.isDeviceUnsupported(t)}return t.$stateful=!0,t}])},{}],129:[function(e,t,n){"use strict";angular.module("base-unifi-device").filter("loadAvg",["$translate",function(e){return function(t,n){if(!(t&&t.loadavg_1||n))return e.instant("COMMON_NOT_AVAILABLE");var i=function(t){return t?parseFloat(Math.round(100*t)/100).toFixed(2):e.instant("COMMON_VALUE_UNDEFINED")};return[i((t=t||{}).loadavg_1),i(t.loadavg_5),i(t.loadavg_15)].join(" / ")}}])},{}],130:[function(e,t,n){"use strict";angular.module("base-unifi-device").filter("radio",["$translate","RADIO_TYPES",function(e,t){return function(n,i){var r=[];if(i=i||{},n){switch(n.get("radio")){case t.NA.type:r.push(e.instant("COMMON_LABEL_RADIO_NA"));break;case t.NG.type:r.push(e.instant("COMMON_LABEL_RADIO_NG"))}i.showInterface&&r.push("("+n.get("name")+")")}return r.join(" ")}}])},{}],131:[function(e,t,n){"use strict";e("../shared-unifi-device/main"),e("../shared-unifi-discovery/main"),angular.module("base-unifi-device",["base-unifi","shared-unifi-device","shared-unifi-discovery"]),e("./components/deviceButtonAdopt/DeviceButtonAdoptController.js"),e("./components/deviceButtonAdopt/deviceButtonAdopt.js"),e("./components/deviceButtonLink/DeviceButtonLinkController.js"),e("./components/deviceButtonLink/deviceButtonLink.js"),e("./components/deviceButtonLocate/DeviceButtonLocateController.js"),e("./components/deviceButtonLocate/deviceButtonLocate.js"),e("./components/deviceButtonRestart/DeviceButtonRestartController.js"),e("./components/deviceButtonRestart/deviceButtonRestart.js"),e("./components/deviceButtonUnlink/DeviceButtonUnlinkController.js"),e("./components/deviceButtonUnlink/deviceButtonUnlink.js"),e("./components/deviceButtonUpgrade/DeviceButtonUpgradeController.js"),e("./components/deviceButtonUpgrade/deviceButtonUpgrade.js"),e("./components/deviceListButtonRollingUpgrade/DeviceListButtonRollingUpgradeController.js"),e("./components/deviceListButtonRollingUpgrade/deviceListButtonRollingUpgrade.js"),e("./config/frames.js"),e("./constants/COUNTRY_CODES_WITH_FCC_DFS.js"),e("./constants/DEFAULT_HT.js"),e("./constants/DEVICE_ADOPT_L3.js"),e("./constants/DEVICE_CATEGORIES.js"),e("./constants/DEVICE_INFORM.js"),e("./constants/DEVICE_LICENSE_STATES.js"),e("./constants/DEVICE_STATES.js"),e("./constants/DEVICE_STATE_FLAGS.js"),e("./constants/DEVICE_STATE_IDS.js"),e("./constants/DEVICE_TYPES.js"),e("./constants/DEVICE_UNSUPPORTED_REASONS.js"),e("./constants/DHCP_USER_OPTION.js"),e("./constants/DISCOVERED_DEVICE.js"),e("./constants/ELITE_ASSIGNMENT_STATES.js"),e("./constants/EXTERNAL_ANTENNA.js"),e("./constants/FIRMWARE_CAPS.js"),e("./constants/HARDWARE_CAPS.js"),e("./constants/NETWORK_DEFAULTS.js"),e("./constants/POE_CAPS.js"),e("./constants/POE_MAX_POWER.js"),e("./constants/POE_VOLTAGE.js"),e("./constants/RADIO_CAPS.js"),e("./constants/RADIO_STATES.js"),e("./constants/RADIO_TYPES.js"),e("./constants/SPEED_CAPS.js"),e("./constants/SPEED_COLOR_MAP.js"),e("./constants/SPEED_SETTINGS.js"),e("./constants/TRAFFIC.js"),e("./constants/USG_CAPS.js"),e("./constants/WIFI_BANDS.js"),e("./constants/WIFI_CAPS.js"),e("./constants/WIFI_CHANNELS.js"),e("./constants/WIFI_EXPERIENCE.js"),e("./constants/WLAN_SECURITY_TYPES.js"),e("./controllers/ConfirmRestartController.js"),e("./controllers/WirelessUplinkDfsWarningController.js"),e("./filters/canConfigureDevice.js"),e("./filters/isDeviceSupported.js"),e("./filters/isDeviceUnsupported.js"),e("./filters/loadAvg.js"),e("./filters/radio.js"),e("./services/Address6.js"),e("./services/BigInteger.js"),e("./services/collections/DeviceCollection.js"),e("./services/collections/DiscoveredDeviceCollection.js"),e("./services/collections/NetworkCollection.js"),e("./services/collections/TagCollection.js"),e("./services/collections/UserDpiCollection.js"),e("./services/collections/WirelessNetworkCollection.js"),e("./services/collections/WirelessNetworkGroupCollection.js"),e("./services/comparators/devicesComparator.js"),e("./services/controllerMixins/buttonHasSitePermissionControllerMixin.js"),e("./services/countryChannels.js"),e("./services/countryUtils.js"),e("./services/deviceActionUtils.js"),e("./services/deviceAdoptL3Utils.js"),e("./services/deviceAdoptStrategy.js"),e("./services/deviceBatchUtils.js"),e("./services/deviceCategoryUtils.js"),e("./services/deviceChannelUtils.js"),e("./services/deviceDiscoveryUtils.js"),e("./services/deviceElite.js"),e("./services/deviceEliteDetails.js"),e("./services/deviceEliteUtils.js"),e("./services/deviceFeatureUtils.js"),e("./services/deviceInformUtils.js"),e("./services/deviceModelUtils.js"),e("./services/deviceRadioUtils.js"),e("./services/deviceStateUtils.js"),e("./services/deviceUplinkUtils.js"),e("./services/deviceUtils.js"),e("./services/deviceWlanGroupUtils.js"),e("./services/devices.js"),e("./services/discoveredDeviceUtils.js"),e("./services/discoveredDevices.js"),e("./services/eliteStateUtils.js"),e("./services/filters/PendingAdoptionDeviceFilter.js"),e("./services/filters/WirelessNetworkFilter.js"),e("./services/ipMatchUtils.js"),e("./services/ipv6Utils.js"),e("./services/models/BatchDeviceModel.js"),e("./services/models/ControllerStatsModel.js"),e("./services/models/CountryChannelsModel.js"),e("./services/models/DeviceEliteDetailsModel.js"),e("./services/models/DeviceEliteMgrModel.js"),e("./services/models/DeviceModel.js"),e("./services/models/DpiUsageModel.js"),e("./services/models/NetworkModel.js"),e("./services/models/SpectrumScanModel.js"),e("./services/models/TagModel.js"),e("./services/models/UserDpiModel.js"),e("./services/models/WirelessNetworkGroupModel.js"),e("./services/models/WirelessNetworkModel.js"),e("./services/portFeatureUtils.js"),e("./services/tags.js"),e("./services/validators/deviceModelFeatureValidator.js"),e("./services/wifiExperience.js"),e("./services/wirelessNetworkGroups.js"),e("./services/wirelessNetworks.js")},{"../shared-unifi-device/main":218,"../shared-unifi-discovery/main":237,"./components/deviceButtonAdopt/DeviceButtonAdoptController.js":68,"./components/deviceButtonAdopt/deviceButtonAdopt.js":69,"./components/deviceButtonLink/DeviceButtonLinkController.js":71,"./components/deviceButtonLink/deviceButtonLink.js":72,"./components/deviceButtonLocate/DeviceButtonLocateController.js":74,"./components/deviceButtonLocate/deviceButtonLocate.js":75,"./components/deviceButtonRestart/DeviceButtonRestartController.js":77,"./components/deviceButtonRestart/deviceButtonRestart.js":78,"./components/deviceButtonUnlink/DeviceButtonUnlinkController.js":80,"./components/deviceButtonUnlink/deviceButtonUnlink.js":81,"./components/deviceButtonUpgrade/DeviceButtonUpgradeController.js":83,"./components/deviceButtonUpgrade/deviceButtonUpgrade.js":84,"./components/deviceListButtonRollingUpgrade/DeviceListButtonRollingUpgradeController.js":86,"./components/deviceListButtonRollingUpgrade/deviceListButtonRollingUpgrade.js":87,"./config/frames.js":89,"./constants/COUNTRY_CODES_WITH_FCC_DFS.js":90,"./constants/DEFAULT_HT.js":91,"./constants/DEVICE_ADOPT_L3.js":92,"./constants/DEVICE_CATEGORIES.js":93,"./constants/DEVICE_INFORM.js":94,"./constants/DEVICE_LICENSE_STATES.js":95,"./constants/DEVICE_STATES.js":96,"./constants/DEVICE_STATE_FLAGS.js":97,"./constants/DEVICE_STATE_IDS.js":98,"./constants/DEVICE_TYPES.js":99,"./constants/DEVICE_UNSUPPORTED_REASONS.js":100,"./constants/DHCP_USER_OPTION.js":101,"./constants/DISCOVERED_DEVICE.js":102,"./constants/ELITE_ASSIGNMENT_STATES.js":103,"./constants/EXTERNAL_ANTENNA.js":104,"./constants/FIRMWARE_CAPS.js":105,"./constants/HARDWARE_CAPS.js":106,"./constants/NETWORK_DEFAULTS.js":107,"./constants/POE_CAPS.js":108,"./constants/POE_MAX_POWER.js":109,"./constants/POE_VOLTAGE.js":110,"./constants/RADIO_CAPS.js":111,"./constants/RADIO_STATES.js":112,"./constants/RADIO_TYPES.js":113,"./constants/SPEED_CAPS.js":114,"./constants/SPEED_COLOR_MAP.js":115,"./constants/SPEED_SETTINGS.js":116,"./constants/TRAFFIC.js":117,"./constants/USG_CAPS.js":118,"./constants/WIFI_BANDS.js":119,"./constants/WIFI_CAPS.js":120,"./constants/WIFI_CHANNELS.js":121,"./constants/WIFI_EXPERIENCE.js":122,"./constants/WLAN_SECURITY_TYPES.js":123,"./controllers/ConfirmRestartController.js":124,"./controllers/WirelessUplinkDfsWarningController.js":125,"./filters/canConfigureDevice.js":126,"./filters/isDeviceSupported.js":127,"./filters/isDeviceUnsupported.js":128,"./filters/loadAvg.js":129,"./filters/radio.js":130,"./services/Address6.js":132,"./services/BigInteger.js":133,"./services/collections/DeviceCollection.js":134,"./services/collections/DiscoveredDeviceCollection.js":135,"./services/collections/NetworkCollection.js":136,"./services/collections/TagCollection.js":137,"./services/collections/UserDpiCollection.js":138,"./services/collections/WirelessNetworkCollection.js":139,"./services/collections/WirelessNetworkGroupCollection.js":140,"./services/comparators/devicesComparator.js":141,"./services/controllerMixins/buttonHasSitePermissionControllerMixin.js":142,"./services/countryChannels.js":143,"./services/countryUtils.js":144,"./services/deviceActionUtils.js":145,"./services/deviceAdoptL3Utils.js":146,"./services/deviceAdoptStrategy.js":147,"./services/deviceBatchUtils.js":148,"./services/deviceCategoryUtils.js":149,"./services/deviceChannelUtils.js":150,"./services/deviceDiscoveryUtils.js":151,"./services/deviceElite.js":152,"./services/deviceEliteDetails.js":153,"./services/deviceEliteUtils.js":154,"./services/deviceFeatureUtils.js":155,"./services/deviceInformUtils.js":156,"./services/deviceModelUtils.js":157,"./services/deviceRadioUtils.js":158,"./services/deviceStateUtils.js":159,"./services/deviceUplinkUtils.js":160,"./services/deviceUtils.js":161,"./services/deviceWlanGroupUtils.js":162,"./services/devices.js":163,"./services/discoveredDeviceUtils.js":164,"./services/discoveredDevices.js":165,"./services/eliteStateUtils.js":166,"./services/filters/PendingAdoptionDeviceFilter.js":167,"./services/filters/WirelessNetworkFilter.js":168,"./services/ipMatchUtils.js":169,"./services/ipv6Utils.js":170,"./services/models/BatchDeviceModel.js":171,"./services/models/ControllerStatsModel.js":172,"./services/models/CountryChannelsModel.js":173,"./services/models/DeviceEliteDetailsModel.js":174,"./services/models/DeviceEliteMgrModel.js":175,"./services/models/DeviceModel.js":176,"./services/models/DpiUsageModel.js":177,"./services/models/NetworkModel.js":178,"./services/models/SpectrumScanModel.js":179,"./services/models/TagModel.js":180,"./services/models/UserDpiModel.js":181,"./services/models/WirelessNetworkGroupModel.js":182,"./services/models/WirelessNetworkModel.js":183,"./services/portFeatureUtils.js":184,"./services/tags.js":185,"./services/validators/deviceModelFeatureValidator.js":186,"./services/wifiExperience.js":187,"./services/wirelessNetworkGroups.js":188,"./services/wirelessNetworks.js":189}],132:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("Address6",[function(){return e("ip-address").Address6}])},{"ip-address":3}],133:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("BigInteger",[function(){return e("jsbn").BigInteger}])},{jsbn:13}],134:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("DeviceCollection",["CORSCollection","DeviceModel","fetchBatchMixin","chunkedFetchMixin","siteUrlMixin","statsMixin","structureMixin","resolveMixin","webrtcMixin",function(e,t,n,i,r,s,o,a,u){return e.extend(n).extend(i).extend(r).extend(s).extend(o).extend(a).extend(u).extend({_isActiveSiteOptional:!0,model:t,siteUrl:"stat/device",chunksIndexUrl:"stat/device-basic",chunkAttrName:"macs",chunkSize:200,isFirstFetchChunked:!0})}])},{}],135:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("DiscoveredDeviceCollection",["CORSCollection","DeviceModel","siteUrlMixin","statsMixin","structureMixin","resolveMixin","webrtcMixin",function(e,t,n,i,r,s,o){return e.extend(n).extend(i).extend(r).extend(s).extend(o).extend({_isActiveSiteOptional:!0,model:t,siteUrl:"stat/device"})}])},{}],136:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("NetworkCollection",["CORSCollection","NetworkModel","siteUrlMixin","structureMixin","resolveMixin","webrtcMixin",function(e,t,n,i,r,s){return e.extend(n).extend(i).extend(r).extend(s).extend({model:t,siteUrl:"rest/networkconf"})}])},{}],137:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("TagCollection",["CORSCollection","TagModel","deepCopyMixin","siteUrlMixin","structureMixin","resolveMixin","webrtcMixin",function(e,t,n,i,r,s,o){return e.extend(n).extend(i).extend(r).extend(s).extend(o).extend({model:t,siteUrl:"rest/tag"})}])},{}],138:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("UserDpiCollection",["CORSCollection","UserDpiModel","resolveMixin","siteUrlMixin","structureMixin","webrtcMixin",function(e,t,n,i,r,s){return e.extend(n).extend(i).extend(r).extend(s).extend({constructor:function(t){if(e.apply(this),!t)throw new Error("Cannot instantiate without a type.");this.type=t},model:t,siteUrl:"stat/stadpi",setPayloadAttrs:function(e){this.payloadAttrs=e},getPayloadAttrs:function(){return this.payloadAttrs},sync:function(t,n,i){if(i=i||{},"read"===t){i.type="POST";var r={type:this.type};angular.extend(r,this.payloadAttrs),i.data=JSON.stringify(r)}return e.prototype.sync.call(this,t,n,i)}})}])},{}],139:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("WirelessNetworkCollection",["CORSCollection","WirelessNetworkModel","siteUrlMixin","structureMixin","resolveMixin","webrtcMixin",function(e,t,n,i,r,s){return e.extend(n).extend(i).extend(r).extend(s).extend({model:t,siteUrl:"rest/wlanconf"})}])},{}],140:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("WirelessNetworkGroupCollection",["CORSCollection","WirelessNetworkGroupModel","siteUrlMixin","structureMixin","resolveMixin","webrtcMixin",function(e,t,n,i,r,s){return e.extend(n).extend(i).extend(r).extend(s).extend({_isActiveSiteOptional:!0,model:t,siteUrl:"rest/wlangroup",getDefault:function(){return this.findWhere({attr_no_delete:!0,attr_hidden:void 0})}})}])},{}],141:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("devicesComparator",["collectionViewComparator","deviceStateUtils","deviceWlanGroupUtils","deviceRadioUtils","deviceChannelUtils","ipUtils","tags","DEVICE_STATES","RADIO_TYPES",function(e,t,n,i,r,s,o,a,u){var c={};c[a.CONNECTED]=1,c[a.UPGRADING]=2,c[a.PROVISIONING]=2,c[a.RFSCANNING]=3,c[a.ADOPTING]=3,c[a.RESTARTING]=3,c[a.PENDING]=4,c[a.ISOLATED]=5,c[a.DELETING]=5,c[a.ADOPTION_FAILED]=6,c[a.HEARTBEAT_MISSED]=6,c[a.FIRMWARE_MISMATCH]=6,c[a.ADOPTION_REQUIRED]=6,c[a.DISCONNECTED]=7,c[a.INFORM_ERROR]=7,c[a.MANAGED_BY_OTHER]=8,c[a.UNKNOWN]=9;var l={true:1,false:2},d={ugw:1,usw:2,uap:3},p=function(n,i){var r=c[t.getDeviceState(n)],s=c[t.getDeviceState(i)];if(r===s){if(n.get("adopted")===i.get("adopted")){if(n.get("type")!==i.get("type"))return function(n,i){var r=n.get("type"),s=i.get("type");return r===s?e(t.getDeviceModelName(n),t.getDeviceModelName(i)):e(d[r],d[s])}(n,i);var o=n.get("name"),a=i.get("name");return o&&a?e(o,a):o?-1:a?1:e(n.getDisplayName(),i.getDisplayName())}return e(l[n.get("adopted")],l[i.get("adopted")])}return e(r,s)},f=function(t,n,r){var s=i.getFirstRadioByType(t,r),o=i.getFirstRadioByType(n,r);if(s)var a=i.getRadioStatsByName(t,s.get("name"));if(o)var u=i.getRadioStatsByName(n,o.get("name"));if(s&&o&&a&&u){var c,l=function(t,n){return t&&n?e(t,n):(t?-1:n&&1)||0};return(c=l(parseInt(s.channel,10)?1:0,parseInt(o.channel,10)?1:0))?c:(c=l(i.getRadioStatsBindedChannel(t,a)||parseInt(s.channel,10)||0,i.getRadioStatsBindedChannel(n,u)||parseInt(o.channel,10)||0))?c:(c=l(parseInt(i.getRadioHt(t,s),10),parseInt(i.getRadioHt(n,o),10)))?c:(c=l(i.getRadioStatsPrimaryChannel(a)||parseInt(s.channel,10)||0,i.getRadioStatsPrimaryChannel(u)||parseInt(s.channel,10)||0))?c:(c=l(i.getRadioStatsTransmitPower(a),i.getRadioStatsTransmitPower(u)))?c:0}return s?-1:o?1:0},h=function(e,t){return i.getRadioStatsByType(e,t).reduce(function(e,t){return e+(parseInt(t.get("ast_be_xmit"),10)||0)+(parseInt(t.get("tx_packets"),10)||0)},0)},v=function(e,t){return i.getRadioStatsByType(e,t).reduce(function(e,t){return e+t.get("num_sta")||0},0)},g=function(e,t){return i.getRadioStatsByType(e,t).reduce(function(e,t){return e+t.get("cu_total")||0},0)},_=function(e,t,n){var i=e.getNested(t);return void 0===i?n:i},E={ip:function(t,n){var i=s.ip2long(t.get("ip"))||0,r=s.ip2long(n.get("ip"))||0;return e(i,r)},name:function(t,n){var i=t.getDisplayName(),r=n.getDisplayName();return e(i,r)},state:function(e,t){return p(e,t)},modelName:function(n,i){return e(t.getDeviceModelName(n),t.getDeviceModelName(i))},stateString:function(n,i){var r=c[t.getDeviceState(n)],s=c[t.getDeviceState(i)];return r===s?e(t.getDeviceStateString(n),t.getDeviceStateString(i)):e(r,s)},uptime:function(t,n){var i=t.get("uptime")||0,r=n.get("uptime")||0;return e(i,r)},memory:function(t,n){var i=t.getMemoryUsage()||0,r=n.getMemoryUsage()||0;return e(i,r)},cpu:function(t,n){var i=parseFloat(t.getNested("system-stats.cpu")||0),r=parseFloat(n.getNested("system-stats.cpu")||0);return e(i,r)},loadAvg:function(t,n){var i=parseFloat(_(t,"sys_stats.loadavg_1",-1)),r=parseFloat(_(n,"sys_stats.loadavg_1",-1));return e(i,r)},clients:function(t,n){var i=t.get("num_sta")||0,r=n.get("num_sta")||0;return e(i,r)},wlan2g:function(t,i){var r=n.getWlanGroupNamesByType(t,u.NG.type),s=n.getWlanGroupNamesByType(i,u.NG.type);return e(r,s)},wlan5g:function(t,i){var r=n.getWlanGroupNamesByType(t,u.NA.type),s=n.getWlanGroupNamesByType(i,u.NA.type);return e(r,s)},radio2g:function(e,t){return f(e,t,u.NG.type)},radio5g:function(e,t){return f(e,t,u.NA.type)},clients2g:function(t,n){var i=v(t,u.NG.type),r=v(n,u.NG.type);return e(i,r)},clients5g:function(t,n){var i=v(t,u.NA.type),r=v(n,u.NA.type);return e(i,r)},tx:function(t,n){var i=t.get("tx_bytes-d")||0,r=n.get("tx_bytes-d")||0;return e(i,r)},rx:function(t,n){var i=t.get("rx_bytes-d")||0,r=n.get("rx_bytes-d")||0;return e(i,r)},tx2g:function(t,n){var i=h(t,u.NG.type),r=h(n,u.NG.type);return e(i,r)},tx5g:function(t,n){var i=h(t,u.NA.type),r=h(n,u.NA.type);return e(i,r)},channel:function(t,n){var i=r.getChannelValue(t),s=r.getChannelValue(n);return e(i,s)},chutil2g:function(t,n){var i=g(t,u.NG.type),r=g(n,u.NG.type);return e(i,r)},chutil5g:function(t,n){var i=g(t,u.NA.type),r=g(n,u.NA.type);return e(i,r)},tags:function(t,n){var i=o.getTagsByMac(t.id).map(function(e){return e.get("name")}),r=o.getTagsByMac(n.id).map(function(e){return e.get("name")});return e(i,r)}},m=function(e,t){var n=e.get("vap_table")?e.get("vap_table").where({radio:t}).map(function(e){return e.get("satisfaction")}):[];return n.length?n.reduce(function(e,t){return e+t},0)/n.length:-1},S=function(t){return function(n,i){return e(m(n,t),m(i,t))}};return E.satisfaction2g=S("ng"),E.satisfaction5g=S("na"),E}])},{}],142:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("buttonHasSitePermissionControllerMixin",["account","sites",function(e,t){return function(n,i){angular.extend(n,{getSiteModel:function(){return this.siteName&&t.repository.collection.findWhere({name:this.siteName})},hasPermission:function(){return e.isAdmin(this.siteName)||i&&e.hasPermission(i)}})}}])},{}],143:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("countryChannels",["BaseModelRepository","CountryChannelsModel","COUNTRY_CODES_WITH_FCC_DFS",function(e,t,n){this.repository=new e(new t),this.isUnderFcc=function(){var e=this.repository.model.get("key");return-1!==n.indexOf(e)},this.getCurrentCountryCode=function(){return this.repository.model.get("code")},this.getDfsChannels=function(){return this.repository.model.get("channels_na_dfs")||[]}}])},{}],144:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("countryUtils",["countryChannels","DEFAULT_HT",function(e,t){this.getCurrentCountryKey=function(){return e.repository.model.get("key")},this.isOutdoorDfsRestrictedCountry=function(){return(e.repository.model.get("channels_na_indoor")||[]).length>0},this.isCustomAntennaGainAllowed=function(){return-1===["US"].indexOf(this.getCurrentCountryKey())},this.isStoreAllowed=function(){return-1!==["US"].indexOf(this.getCurrentCountryKey())},this.getDefaultHt=function(e){var n=t[e];return this.isChannelWidthSupported(e,n)?n:"20"},this.isChannelWidthSupported=function(t,n){return(e.repository.model.get("channels_"+t+"_"+n)||[]).length>0}}])},{}],145:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceActionUtils",["account","deviceStateUtils","DEVICE_STATES",function(e,t,n){this.canConfigureDevice=function(n){return e.isAdmin()&&t.isDeviceSupported(n)},this.isAdoptApplicable=function(e){var i=t.getDeviceState(e),r=[n.PENDING,n.ADOPTION_REQUIRED,n.ADOPTING].includes(i),s=t.isDeviceSupported(e)||t.isDeviceAdoptableWhenUpgraded(e);return r&&s},this.isAdvancedAdoptApplicable=function(e){var i=t.getDeviceState(e),r=[n.ADOPTION_FAILED,n.MANAGED_BY_OTHER].includes(i),s=t.isDeviceSupported(e)||t.isDeviceAdoptableWhenUpgraded(e);return r&&s},this.isLocateApplicable=function(e){return t.getRawDeviceState(e)===n.CONNECTED&&t.isDeviceSupported(e)},this.isRestartApplicable=function(e){var i=t.getDeviceState(e);return[n.CONNECTED,n.RESTARTING].includes(i)&&t.isDeviceSupported(e)}}])},{}],146:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceAdoptL3Utils",["$interval","$q","$translate","devices","deviceUtils","discoveredDevices","discoveryTool","DEVICE_ADOPT_L3","DEVICE_STATE_IDS",function(e,t,n,i,r,s,o,a,u){this.adoptL3Device=function(c,l,d){var p=c.get("state");c.set("state",u.ADOPTING);var f={inform_url:d.url,ip:d.ip||c.get("ip"),model:c.get("model"),password:d.password,port:d.port,username:d.username};return o.setInform(f).catch(function(){return t.reject(n.instant("DEVICE_ACTIONS_SET_INFORM_ERROR",{deviceName:c.get("mac")}))}).then(function(){return t(function(t,i){var r=e(function(){return c.fetch().then(function(){e.cancel(r)})},a.CHECK_DEVICE_AFTER_SETTING_INFORM_FREQUENCY,a.CHECK_DEVICE_AFTER_SETTING_INFORM_MAX_ATTEMPTS);r.then(function(){i(n.instant("DEVICE_ACTIONS_SET_INFORM_ERROR",{deviceName:c.get("mac")}))}).catch(t)})}).then(function(){return r.adoptDevice(c,l)}).then(function(){return o.setInform(f).catch(function(){return t.reject(n.instant("DEVICE_ACTIONS_SET_INFORM_CONFIRM_ERROR",{deviceName:c.get("mac")}))})}).then(function(){return i.repository.collection.get(c.get("mac")).fetch(),s.repository.collection.remove(c),n.instant("DEVICE_ACTIONS_ADOPT_NOTICE",{deviceName:c.get("mac")})}).catch(function(e){return c.set("state",p),t.reject(e)})}}])},{}],147:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceAdoptStrategy",["$q","deviceAdoptL3Utils","deviceInformUtils","deviceUtils","deviceBatchUtils","system","MANAGE_DEVICE_DEFAULTS",function(e,t,n,i,r,s,o){this.adoptDevice=function(e,t){return e.isLocallyDiscovered()?this.adoptL3Device(e,t):i.adoptDevice(e,t)},this.adoptL3Device=function(e,i){var r=angular.extend({},o,{url:n.getInformUrl(e,s.repository.model),ip:e.get("ip"),model:e.get("model")});return t.adoptL3Device(e,i,r)},this.advancedAdoptDevice=function(e,t){return i.advancedAdoptDevice(e,t)},this.adoptDevices=function(e,t){var n=e.filter(function(e){return e.isLocallyDiscovered()}),i=e.filter(function(e){return!e.isLocallyDiscovered()});return r.adoptDevices(i).then(function(){return this.adoptL3Devices(n,t)}.bind(this))},this.adoptL3Devices=function(t,n){return t.reduce(function(e,t){return e.then(function(){return this.adoptL3Device(t,n)}.bind(this))}.bind(this),e.when())}}])},{}],148:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceBatchUtils",["$q","$translate","DeviceMgrModel","SiteMgrModel","apiResults","repositoryUtils","DEVICE_STATE_IDS",function(e,t,n,i,r,s,o){this._executeDeviceCommand=function(e,t,i){var r=new n;return i&&(r._forceSite=i.get("name")),(t=t||{}).cmd=e,r.save(t)},this._executeSiteCommand=function(e,t){var n=new i;return(t=t||{}).cmd=e,n.save(t)},this.saveDevices=function(n,i,o){var a={id:n.get("destination").pluck("_id"),data:i};return n.savePartial(a,o).then(function(){return s.getRepository("devices").refresh(),n.get("source").clear(),(n.get("success")||[]).length?(n.get("error")||[]).length?e.when(t.instant("DEVICE_PROPERTIES_CHANGES_BATCH_APPLY_MIXED")):e.when(t.instant("DEVICE_PROPERTIES_CHANGES_BATCH_APPLY_SUCCESS")):e.when(t.instant("DEVICE_PROPERTIES_CHANGES_BATCH_APPLY_NONE"))}).catch(function(n){return e.reject(r.appendErrorMsg(t.instant("DEVICE_PROPERTIES_CHANGES_BATCH_APPLY_ERROR"),n))})},this.filterRadioNames=function(e){return e.radio_table&&(e.radio_table=e.radio_table.map(function(e){return delete e.name,e})),e.wlan_overrides&&(e.wlan_overrides=e.wlan_overrides.map(function(e){return delete e.radio_name,e})),e},this.savePendingChanges=function(n,i){var o={id:n.get("destination").pluck("_id"),data:this.filterRadioNames(n.get("source").getPendingAttributes())};return n.savePartial(o,i).then(function(){return s.getRepository("devices").refresh(),n.get("source").clearPendingChanges(),(n.get("success")||[]).length?(n.get("error")||[]).length?e.when(t.instant("DEVICE_PROPERTIES_PENDING_CHANGES_BATCH_APPLY_MIXED")):e.when(t.instant("DEVICE_PROPERTIES_PENDING_CHANGES_BATCH_APPLY_SUCCESS")):e.when(t.instant("DEVICE_PROPERTIES_PENDING_CHANGES_BATCH_APPLY_NONE"))}).catch(function(n){return e.reject(r.appendErrorMsg(t.instant("DEVICE_PROPERTIES_PENDING_CHANGES_BATCH_APPLY_ERROR"),n))})},this.provisionDevices=function(n,i,a){i=i||{};var u={macs:n.get("destination").pluck("mac")};return this._executeDeviceCommand("force-provision",u,a).then(function(){return n.get("destination").each(function(e){e.set({state:o.PROVISIONING})}),e.when(t.instant("DEVICE_ACTIONS_BATCH_PROVISION_NOTICE",{count:u.macs.length},"messageformat"))}).catch(function(n){return s.getRepository("devices").refresh(),e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_BATCH_PROVISION_ERROR"),n))})},this.restartDevices=function(n,i,a){i=i||{};var u={macs:n.get("destination").pluck("mac"),reboot_type:i.rebootType||"soft"};return this._executeDeviceCommand("restart",u,a).then(function(){return n.get("destination").each(function(e){e.set({state:o.DISCONNECTED,restarting:!0})}),e.when(t.instant("DEVICE_ACTIONS_BATCH_RESTART_NOTICE",{count:u.macs.length},"messageformat"))}).catch(function(n){return s.getRepository("devices").refresh(),e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_BATCH_RESTART_ERROR"),n))})},this.upgradeDevices=function(n,i){var a={macs:n.get("destination").pluck("mac")};return i&&(a.url=i),this._executeDeviceCommand(i?"upgrade-external":"upgrade",a).then(function(){return n.get("destination").each(function(e){e.set({state:o.UPGRADING})}),e.when(t.instant("DEVICE_ACTIONS_BATCH_UPGRADE_NOTICE",{count:a.macs.length},"messageformat"))}).catch(function(n){return s.getRepository("devices").refresh(),e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_BATCH_UPGRADE_ERROR"),n))})},this.forgetDevices=function(n){var i={macs:n.get("destination").pluck("mac")};return this._executeSiteCommand("delete-device",i).then(function(){return s.getRepository("devices").collection.remove(n.get("destination").models),e.when(t.instant("DEVICE_ACTIONS_BATCH_FORGET_SUCCESS",{count:i.macs.length},"messageformat"))}).catch(function(n){return s.getRepository("devices").refresh(),e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_BATCH_FORGET_ERROR"),n))})},this.adoptDevices=function(t,n){var i={macs:t.map(function(e){return e.get("mac")})};return i.macs.length?this._executeDeviceCommand("adopt",i,n):e.when()},this.migrateDevices=function(n,i){var s={macs:n.map(function(e){return e.get("mac")}),inform_url:i};return s.macs.length?this._executeDeviceCommand("migrate",s).then(function(){return n.forEach(function(e){e.set("migrate_inform_url",i)}),e.when(t.instant("DEVICE_ACTIONS_MIGRATE_DEVICES_NOTICE"))}).catch(function(n){return e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_MIGRATE_DEVICES_ERROR"),n))}):e.when()},this.cancelMigrateDevices=function(n){var i={macs:n.get("destination").pluck("mac")};return this._executeDeviceCommand("cancel-migrate",i).then(function(){return n.get("destination").each(function(e){e.unset("migrate_inform_url")}),e.when(t.instant("DEVICE_ACTIONS_BATCH_CANCEL_MIGRATE_SUCCESS",{count:i.macs.length},"messageformat"))}).catch(function(n){return s.getRepository("devices").refresh(),e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_BATCH_CANCEL_MIGRATE_ERROR"),n))})}}])},{}],149:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceCategoryUtils",["deviceStateUtils","DEVICE_CATEGORIES","DEVICE_STATES","DEVICE_TYPES",function(e,t,n,i){this.extractCategory=function(i){switch(e.getDeviceState(i)){case n.CONNECTED:case n.UPGRADING:case n.PROVISIONING:return this.extractType(i);case n.MANAGED_BY_OTHER:return t.MANAGED_BY_OTHER;case n.PENDING:return t.PENDING;case n.ADOPTING:return t.ADOPTING;default:return t.INACTIVE}}.bind(this),this.extractType=function(e){switch(e.get("type")){case i.GATEWAY:return t.WAN;case i.SWITCH:return t.LAN;case i.AP:return t.WLAN;default:return}}}])},{}],150:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceChannelUtils",["countryChannels","deviceRadioUtils","lambda","RADIO_TYPES","WIFI_CHANNELS",function(e,t,n,i,r){this.getChannel=function(e){if(!e.get("vap_table"))return"";var n=[];return e.get("vap_table").each(function(r){var s=r.get("channel");if(0!==s&&"RUN"===(r.get("state")||"RUN")){var o=r.get("radio");o===i.NA.type&&t.isAcRadio(e,r.get("radio_name"))&&(o="ac");var a=s+" ("+o+")";-1===n.indexOf(a)&&(r.get("radio")===i.NG.type?n.unshift(a):n.push(a))}}),n.join(", ")},this.getChannelValue=function(e){if(!e.get("vap_table"))return-1;var t=0;return e.get("vap_table").each(function(e){var n=e.get("channel");if(0!==n&&"RUN"===(e.get("state")||"RUN")){var r=e.get("radio");r===i.NA.type?t+=1e3*(parseInt(n,10)||0):r===i.NG.type&&(t+=parseInt(n,10)||0)}}),t},this.getCurrentChannelDescription=function(e,n){var i=t.getFirstRadioByType(e,n),r=t.getRadioStatsByName(e,i.get("name")),s=t.getRadioStatsPrimaryChannel(r),o=t.getRadioHt(e,i);if(s&&o){var a=t.getRadioStatsExtChannelIndicator(r)||0,u=this.getChannelsDescriptions(e,n,o);return u&&u.filter(function(e){return-1!==e.subChannels.indexOf(s)}).find(function(e){return 0===a?e.subChannels[0]===s:a>0?-1!==e.subChannels.slice(0,e.subChannels.length-1).indexOf(s):-1!==e.subChannels.slice(1).indexOf(s)})}},this.getChannelsDescriptions=function(e,i,s){var o=t.getSupportedChannels(e,i,s),a=r[i][s];return o&&a&&n.objectToEntries(a).map(function(e){return angular.extend({channel:Number(e.key)},e.value)}).filter(function(e){return e.subChannels.every(function(e){return-1!==o.indexOf(e)})})},this.getSpectrumScans=function(e,t){return(e.get("scans")||[]).filter(function(e){return e.radio===t})},this.isChannelDfs=function(t){var n=e.getDfsChannels();return n.length&&-1!==n.indexOf(Number.parseInt(t,10))}}])},{}],151:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceDiscoveryUtils",["$q","$translate","account","bowser","discoveryToolUtils","featureFlag","system",function(e,t,n,i,r,s,o){this.findDevicesIsVisible=function(){return o.isUnifiGo()&&(n.isSuperAdmin()||n.hasPermission("API_STAT_DEVICE_ACCESS_SUPER_SITE_PENDING"))},this.findDevicesIsAvailable=function(){return this.findDevicesIsVisible()&&i.chrome&&!i.mobile},this.findDevices=function(e){return r.checkInstallation(e&&"bypassAutoFindDevices").then(function(){return r.startScanForDevices()})},this.isFindingDevices=function(){return r.isFindingDevices()}}])},{}],152:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceElite",["$q","$translate","apiResults","DeviceEliteMgrModel","deviceEliteDetails","devices","ELITE_ASSIGNMENT_STATES",function(e,t,n,i,r,s,o){this.checkLicenses=function(){return(new i).save({cmd:"refresh-elite"}).then(function(){s.repository.fetch(),r.repository.fetch({forceFetch:!0})}).catch(angular.noop)},this.acceptTos=function(){return(new i).save({cmd:"accept-tos"}).then(this.checkLicenses.bind(this)).catch(angular.noop)},this.instantRma=function(r,s){return(new i).save({cmd:"instant-rma",mac:r.get("mac"),contact_info:s.contactInfo,autoreplace:s.autoreplace,reason:s.reason}).then(function(e){return r.get("elite").state=o.RMA_IN_PROGRESS,r.get("elite").rma_id=e.data.data[0].rma_id,t.instant("DEVICE_ELITE_INSTANT_RMA_SUCCESS",{mac:r.get("mac")})}).catch(function(i){return e.reject(n.appendErrorMsg(t.instant("DEVICE_ELITE_INSTANT_RMA_ERROR",{mac:r.get("mac")}),i))})}}])},{}],153:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceEliteDetails",["BaseModelRepository","DeviceEliteDetailsModel",function(e,t){this.repository=new e(new t),this.getDescription=function(){return this.repository.model.get("description")||[]},this.getSupport=function(){return this.repository.model.get("support")||[]},this.getManage=function(){return this.repository.model.get("manage")||{}},this.getLimitations=function(){return this.repository.model.get("limitations")||{}},this.getSupportedCountries=function(){return this.getLimitations().supported_countries||[]}}])},{}],154:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceEliteUtils",["countryChannels","deviceEliteDetails","DeviceEliteMgrModel","deviceFeatureUtils","eliteStateUtils","interpolateUtils",function(e,t,n,i,r,s){this.isDeviceVerified=function(e){return e.isElite()&&!!e.get("elite").verified},this.isDeviceWithEliteDeviceWarning=function(e){return e.isElite()&&!this.isDeviceFirmwareSupported(e)},this.isDeviceFirmwareSupported=function(e){return i.isEliteDeviceSupported(e)},this.isServiceWithEliteDeviceWarning=function(){return!this.isUserAcceptedTos()||!this.isCurrentCountrySupported()},this.isCurrentCountrySupported=function(){return(t.getSupportedCountries()||[]).includes(e.getCurrentCountryCode())},this.isUserAcceptedTos=function(){return!!t.getManage().tos_accepted},this.getTosLink=function(){return t.getManage().tos_link},this.isExtendSubscriptionAvailable=function(e){return e.isElite()&&this.isDeviceVerified(e)&&this.isDeviceFirmwareSupported(e)&&!!e.get("elite").extend_available},this.getExtendSubscriptionLink=function(e){var n=t.getManage(),i=n&&n.extend_link_pattern||"";return s.interpolateAttributes(i,e)},this.isInstantRmaAvailable=function(e){return r.isDeviceVerified(e)&&this.isCurrentCountrySupported()}}])},{}],155:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceFeatureUtils",["deviceModelUtils","deviceRadioUtils","DEVICE_MODELS","FIRMWARE_CAPS","HARDWARE_CAPS","RADIO_CAPS","USG_CAPS","WIFI_CAPS",function(e,t,n,i,r,s,o,a){this.getHybridCapability=function(e,t){return(n[e]||{}).hybrid||t},this.hasWifiCapability=function(e,t){return!!e&&((e.get("wifi_caps")||0)&t)>0},this.hasHardwareCapability=function(e,t){return!!e&&((e.get("hw_caps")||0)&t)>0},this.hasFirmwareCapability=function(e,t){return!!e&&((e.get("fw_caps")||0)&t)===t},this.hasUsgCapability=function(e,t){return!!e&&((e.get("usg_caps")||0)&t)===t},this.isBandSteeringSupported=function(n){return!!(n&&t.hasRadioType(n,"na")&&t.hasRadioType(n,"ng"))&&(this.hasWifiCapability(n,a.BANDSTEER)||!0===e.getModelFeature(n,"bandsteer"))},this.isZeroHandoffSupported=function(t){return this.hasWifiCapability(t,a.ZERO_HANDOFF)||!0===e.getModelFeature(t,"zh")},this.isAirtimeFairnessConfigSupported=function(e){return this.hasWifiCapability(e,a.AIRTIME_CONFIG)},this.isMeshV3Supported=function(e){return this.hasWifiCapability(e,a.MESHV3)},this.isRfScanSupported=function(e){return this.hasWifiCapability(e,a.RF_SCAN)},this.isVwireSupported=function(e){return this.hasWifiCapability(e,a.VWIRE)},this.isDpiSupported=function(e){return this.hasFirmwareCapability(e,i.DPI)},this.isTerminalSupported=function(e){return this.hasFirmwareCapability(e,i.UTERM)},this.isLinkAggregationGroupSupported=function(e){return this.hasFirmwareCapability(e,i.LAG)},this.isLinkAggregationGroupNative=function(e){return!!e&&(e.get("ethernet_table")||[]).some(function(e){return!!e.native_bond})},this.isBareSipSupported=function(e){return e&&"U7EDU"===e.get("model")},this.isLedBarSupported=function(e){return this.hasHardwareCapability(e,r.LEDBAR)},this.isGen2=function(t){return 2===e.getModelFeature(t,"gen")},this.isAtfEnabled=function(e){var t=void 0!==e.get("atf_enabled")&&e.get("atf_enabled");return this.isAirtimeFairnessConfigSupported(e)?t:!this.isGen2(e)},this.isQcaSwitch=function(e){return this.hasFirmwareCapability(e,i.QCASWITCH)},this.isOwrtSwitch=function(e){return this.hasFirmwareCapability(e,i.OWRTSWITCH)},this.isSimpleFan=function(t){return"simple"===e.getModelFeature(t,"fan")},this.isSnmpV1_2Supported=function(e){return this.hasFirmwareCapability(e,i.SNMP)},this.isSnmpV3Supported=function(e){return this.hasFirmwareCapability(e,i.SNMPV3)},this.getFanOnLevel=function(t){return"alwayson"===e.getModelFeature(t,"fan")?0:1},this.areFirmwareCapsMet=function(e,t){return t.every(function(t){return i[t]&&this.hasFirmwareCapability(e,i[t])}.bind(this))},this.isGatewayPortReassignmentSupported=function(e){return this.hasUsgCapability(e,o.UNIFI_USG_CAP_PORT_REASSIGNMENT)},this.areWifiCapsMet=function(e,t){return t.every(function(t){switch(t){case"BANDSTEER":return this.isBandSteeringSupported(e);case"ZERO_HANDOFF":return this.isZeroHandoffSupported(e);case"AIRTIME_CONFIG":return this.isAirtimeFairnessConfigSupported(e);default:return a[t]&&this.hasWifiCapability(e,a[t])}}.bind(this))},this.isVapTableAvailable=function(e){var t=e.get("vap_table");return!!t&&t.length>0},this.isAirTimeSupported=function(e){return!!t.getAllRadios(e).find(function(e){return t.isAirTimeSupported(e)})},this.isAirViewSupported=function(e){return!!t.getAllRadios(e).find(function(e){return t.isAirViewSupported(e)})},this.isEliteDeviceSupported=function(e){return this.hasFirmwareCapability(e,i.ELITE_DEVICE)}}])},{}],156:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceInformUtils",["ipMatchUtils","DEVICE_INFORM",function(e,t){this.getInformUrl=function(n,i){var r=i.get("override_inform_host")?i.get("hostname")||i.get("name"):e.findBestMatch(n.get("ip"),i.get("ip_addrs"))||t.DEFAULT_HOST,s=i.get("inform_port")||t.DEFAULT_PORT;return[t.PROTOCOL,r,":",s,t.ENDPOINT].join("")}}])},{}],157:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceModelUtils",["semanticVersion","system","DEVICE_MODELS",function(e,t,n){this.getModelFeature=function(e,t){var i=e?(n[e.get("model")]||{}).features:void 0;return i&&i[t]},this.isBeta=function(i){var r=(n[i.get("model")]||{}).beta;return!!r&&e.satisfies(t.getControllerVersion(),r)}}])},{}],158:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceRadioUtils",["_","$translate","$filter","account","collectionViewComparator","countryChannels","countryUtils","deviceModelUtils","system","wifiExperience","DEFAULT_HT","EXTERNAL_ANTENNA","RADIO_STATES","RADIO_TYPES","TRAFFIC","WIFI_CHANNELS","RADIO_CAPS",function(e,t,n,i,r,s,o,a,u,c,l,d,p,f,h,v,g){this.hasRadioCapability=function(e,t){return!!e&&((e.get("radio_caps")||0)&t)===t},this.isMinRssiStrictModeSupported=function(e){return this.hasRadioCapability(e,g.RADIO_CAP_STRICT_MODE_MINRSSI)},this.isAirTimeSupported=function(e){return this.hasRadioCapability(e,g.RADIO_CAP_AIRTIME)},this.isAirViewSupported=function(e){return this.hasRadioCapability(e,g.RADIO_CAP_AIRVIEW)},this.getAllRadios=function(e,t){var n=this.getRadios(e,t),i=this.getScanRadios(e,t);return n.concat(i)},this.getRadios=function(e,t){var n=this.getRadioTable(e,t);return n&&n.models||[]},this.getScanRadios=function(e,t){var n=this.getScanRadioTable(e,t);return n?n.models:[]},this.getRadioTable=function(e,t){return!!e&&e.get("radio_table",t)},this.getScanRadioTable=function(e,t){return!!e&&e.get("scan_radio_table",t)},this.getFirstRadioByType=function(e,t,n){return this.getRadios(e,n).find(function(e){return e.get("radio")===t})},this.getRadiosByType=function(e,t,n){return this.getRadios(e,n).filter(function(e){return!t||e.get("radio")===t})},this.getRadioByName=function(e,t,n){return this.getRadios(e,n).find(function(e){return e.get("name")===t})},this.hasRadioType=function(e,t){return this.getRadios(e).some(function(e){return e.get("radio")===t})},this.getRadioHt=function(e,t){var n=t.get("radio");return(t.get("ht")||l[n]).toString()},this.getRadioHtName=function(e,t){return("na"===t.get("radio")&&this.isAcRadio(e,t.get("name"))?"VHT":"HT")+this.getRadioHt(e,t)},this.getRadioStatsPrimaryChannel=function(e){return e.get("channel")},this.getRadioStatsBindedChannel=function(e,t){var n,i=this.getRadioStatsPrimaryChannel(t)||0,r=this.getRadioStatsExtChannelIndicator(t)||0,s=t.get("radio");if("ng"===s)n=i&&i+2*r;else{var o=this.getRadioByName(e,t.get("name")),a=this.getRadioHt(e,o),u=v[s][a];n=Object.keys(u).find(function(e){return-1!==u[e].subChannels.indexOf(i)})}return n?n.toString():void 0},this.getRadioStatsExtChannelIndicator=function(e){return e.get("extchannel")},this.getRadioStats=function(e,t){var n=this.getRadioTableStats(e,t);return n?n.models:[]},this.getRadioTableStats=function(e,t){return!!e&&e.get("radio_table_stats",t)},this.getRadioStatsByName=function(e,t,n){return this.getRadioStats(e,n).find(function(e){return e.get("name")===t})},this.getRadioStatsByType=function(e,t,n){return this.getRadioStats(e,n).filter(function(e){return!t||e.get("radio")===t})},this.getLowestChannelRadioStatsByType=function(e,t,n){var i=this.getRadioStatsByType(e,t,n);return i.sort(function(e,t){return e.get("channel")-t.get("channel")}),!!i.length&&i[0]},this.getChannelStateDataByName=function(e,t){var n=this.getRadioStatsByName(e,t),i=this.getRadioByName(e,t);return n?{state:n.get("state")||p.INIT,primaryChannel:this.getRadioStatsPrimaryChannel(n),extChannel:this.getRadioStatsExtChannelIndicator(n)||0,bindedName:this.getRadioStatsBindedChannel(e,n),htName:this.getRadioHtName(e,i)}:{state:p.INIT}},this.getRadioStatsTransmitFrequency=function(e){var t=this.getRadioStatsTransmitPower(e),n=this.getRadioStatsPrimaryChannel(e),i=v[e.get("radio")],r=i&&i[20][n],s=r&&r.centerFrequency;return angular.isDefined(t)&&s?s:void 0},this.getRadioStatsTransmitPower=function(e,t){if((e&&e.get("state")||p.INIT)!==p.INIT){var n=Math.min(e.get("tx_power"),30),i=e.get("gain")||0;return parseInt(n,10)+(t?0:i)}},this.getTransmitPowerString=function(e,t){return this.getRadiosByType(e,t).map(function(t){return this.getRadioStatsTransmitPowerString(e,t)}.bind(this)).join(", ")},this.getRadioStatsTransmitPowerString=function(e,n){var i=this.getRadioStatsByName(e,n.get("name"));if(!i)return"";var r=this.getRadioStatsTransmitPower(i),s=this.getRadioStatsTransmitPower(i,!0);return r?s+" "+t.instant("DEVICE_RADIO_TRANSMIT_POWER_DBM")+" / "+r+" "+t.instant("DEVICE_RADIO_TRANSMIT_POWER_DBM")+" ("+t.instant("DEVICE_RADIO_TRANSMIT_POWER_EIRP")+")":""},this.getTransmitPowerMode=function(e,n){return this.getRadiosByType(e,n).map(function(e){return"auto"===e.get("tx_power_mode")?t.instant("COMMON_VALUE_AUTO"):""}).join(", ")},this.getPacketsPerBytes=function(e,t,i){var r=e.get("stat")||{},s=t.get("name"),o=t.get("radio"),a=parseInt(r[s+"-"+i+"_packets"]||r[o+"-"+i+"_packets"],10)||0,u=parseInt(r[s+"-"+i+"_bytes"]||r[o+"-"+i+"_bytes"],10)||0;return n("numberToString")(a)+" / "+n("bytes")(u)},this.getRetryDroppedPercentage=function(e,t,n){return this.getRetryPercentage(e,t,n)+"% / "+this.getDroppedPercentage(e,t,n)+"%"},this.getRetryPercentage=function(e,t,n){var i=e.get("stat")||{},r=t.get("name"),s=t.get("radio"),o=parseInt(i[r+"-"+n+"_retries"]||i[s+"-"+n+"_retries"],10)||0,a=(parseInt(i[r+"-"+n+"_packets"]||i[s+"-"+n+"_packets"],10)||0)+(parseInt(i[r+"-"+n+"_dropped"]||i[s+"-"+n+"_dropped"],10)||0);return(0===a?0:o/a*100).toFixed(1)},this.getDroppedPercentage=function(e,t,n){var i=e.get("stat")||{},r=t.get("name"),s=t.get("radio"),o=parseInt(i[r+"-"+n+"_packets"]||i[s+"-"+n+"_packets"],10)||0,a=parseInt(i[r+"-"+n+"_dropped"]||i[s+"-"+n+"_dropped"],10)||0,u=o+a;return(0===u?0:a/u*100).toFixed(1)},this.extractChannelUtilizationsValue=function(e,t,n){return this.getRadiosByType(e,t).map(function(t){var i=this.getRadioChannelUtilization(e,t);return i&&i[n]}.bind(this)).join(", ")},this.getRadioStatsChannelUtilizationPerRadio=function(e,t){return this.getRadiosByType(e,t).map(function(t){return this.getRadioChannelUtilization(e,t)}.bind(this)).filter(function(e){return!!e})},this.getRadioChannelUtilization=function(e,t){var n=this.getRadioStatsByName(e,t.get("name"));return this.getRadioStatsChannelUtilization(n)},this.getRadioStatsChannelUtilization=function(e){if(e){var t=parseInt(e.get("cu_total"),10),n=parseInt(e.get("cu_self_rx"),10),i=parseInt(e.get("cu_self_tx"),10);return isNaN(t)||isNaN(n)||isNaN(i)?void 0:{total:t,selfRx:n,selfTx:i,interference:Math.max(0,t-n-i),radio:e.get("radio"),name:e.get("name")}}},this.getMinRssiString=function(e,n){var i=[];return this.getRadiosByType(e,n).forEach(function(e){if(e.get("min_rssi_enabled")){var n=e.get("min_rssi");i.push(n+" "+t.instant("DEVICE_RADIO_TRANSMIT_POWER_DBM"))}}),i.join(", ")},this.getSupportedChannels=function(e,t,n,i,r,o){n=parseInt(n,10);var a="channels_"+t+(i||o||20===n?"":"_"+n);return i?a+="_dfs":o?a+="_indoor":(r||e&&this.isBrcmModel(e))&&(a+="_bcm"),s.repository.model.get(a)},this.getChannelOptions=function(e,n,i,r,s){s=s||{};var o=this.getSupportedChannels(e,n,r),a=this.getSupportedChannels(e,n,r,!0),u=this.getSupportedChannels(e,n,r,!1,!1,!0),c=" ("+t.instant("DEVICE_RADIO_CHANNEL_DFS")+")",l=this.isDfsSupported(e,i),d=this.isOutdoorModeEnabled(e,s.isOutdoorModeEnabled),p=this.isRestrictedChannelsEnabled(e,i),f=[];return o&&angular.forEach(o,function(t){var r=a&&-1!==a.indexOf(t),s=u&&-1!==u.indexOf(t);if((!p||!(t<this.getRestrictedChannelLow(e,n,i)||t>this.getRestrictedChannelHigh(e,n,i)))&&this.isChannelAllowedByFcc(e,n,i,t,r)){if(d&&s)return;!l&&r||f.push({channel:parseInt(t,10),label:t+(r?c:"")})}}.bind(this)),f},this.getUnfilteredChannelOptions=function(e,n,i){i=i||{};var r=this.getSupportedChannels(void 0,e,n)||[],s=this.getSupportedChannels(void 0,e,n,!1,!0)||[],o=this.getSupportedChannels(void 0,e,n,!0),a=this.getSupportedChannels(void 0,e,n,!1,!1,!0),u=" ("+t.instant("DEVICE_RADIO_CHANNEL_DFS")+")",c=[],l=Array.from(new Set(r.concat(s).sort(function(e,t){return e-t})));return l&&angular.forEach(l,function(e){var t=o&&-1!==o.indexOf(e),n=a&&-1!==a.indexOf(e);i.isOutdoorModeEnabled&&n||c.push({channel:parseInt(e,10),label:e+(t?u:"")})}),c},this.getBandByChannel=function(e){return e<52?1:e<149?2:3},this.isAcModel=function(e){var t=this.getFirstRadioByType(e,"na");return t&&!0===t.get("is_11ac")||!0===a.getModelFeature(e,"ac")},this.isAcRadio=function(e,t){var n=this.getRadioByName(e,t);return n&&!0===n.get("is_11ac")||!0===a.getModelFeature(e,"ac")},this.isBrcmModel=function(e){return!0===a.getModelFeature(e,"brcm")},this.isHt40Supported=function(e,t){var n=this.getSupportedChannels(e,t,40);return!!(n&&n.length>0)},this.isHt80Supported=function(e){var t=this.isAcModel(e)?this.getSupportedChannels(e,"na",80):void 0;return!!(t&&t.length>0)},this.isHt160Supported=function(e,t){var n=this.getRadioByName(e,t),i=n&&!0===n.get("has_ht160")&&this.isAcRadio(e,t)?this.getChannelOptions(e,"na",t,160):void 0;return!!(i&&i.length>0)},this.isHt160SupportedByDevice=function(e){return!!this.getAllRadios(e).find(function(t){return this.isHt160Supported(e,t.get("name"))}.bind(this))},this.isDfsSupported=function(e,t){var n=this.getRadioByName(e,t);return n&&!0===n.get("has_dfs")||!0===a.getModelFeature(e,"dfs")},this.isRestrictedChannelsEnabled=function(e,t){var n=this.getRadioByName(e,t);return n&&!0===n.get("has_restricted_channels")},this.getRestrictedChannel=function(t,n,i,r){var s=this.getRadioByName(t,i).get(r);return e.find(v[n][20],function(e){return e.centerFrequency===s}).subChannels||[]},this.getRestrictedChannelHigh=function(e,t,n){return this.getRestrictedChannel(e,t,n,"max_chan_cntr_frq")||[]},this.getRestrictedChannelLow=function(e,t,n){return this.getRestrictedChannel(e,t,n,"min_chan_cntr_frq")||[]},this.isOutdoorModeEnabled=function(e,t){var n=e.get("outdoor_mode_override")||"default";return"on"===n||"default"===n&&t},this.isFccDfsSupported=function(e,t){var n=this.getRadioByName(e,t);return n&&!0===n.get("has_fccdfs")||!1},this.isChannelAllowedByFcc=function(e,t,n,i,r){if("na"===t&&s.isUnderFcc()){if(r&&!this.isFccDfsSupported(e,n))return!1;if(this.isUapOutdoor5GOnFirstBand(e,i))return!1}return!0},this.isUapOutdoor5GOnFirstBand=function(e,t){var n=e.get("model"),i=this.getBandByChannel(t);return"U5O"===n&&1===i},this.getRadioPower=function(e,n){var i,r=this.getRadioStatsByName(e,n.get("name")),s=r&&this.getRadioStatsTransmitPower(r);return"custom"===n.get("tx_power_mode")?(i=s||parseInt(n.get("tx_power"),10)+(!0===n.get("builtin_antenna")?parseInt(n.get("builtin_ant_gain"),10):parseInt(n.get("antenna_gain"),10)),i+=" "+t.instant("DEVICE_RADIO_TRANSMIT_POWER_DBM")):(i=n.get("tx_power_mode")?t.instant("DEVICE_PROPERTIES_AP_RADIO_POWER_OPTION_"+n.get("tx_power_mode").toUpperCase()):t.instant("COMMON_VALUE_AUTO"),s&&(i+=" ("+s+" "+t.instant("DEVICE_RADIO_TRANSMIT_POWER_DBM")+")"))," / "+i},this.extractRadioStatsFieldValueByType=function(e,t,n){return this.getRadiosByType(e,t,{}).map(function(t){var i=this.getRadioStatsByName(e,t.get("name"));return i&&i.get(n)}.bind(this)).join("\n")},this.isChannelUtilizationDiagramAvailable=function(e){return!(!this.getRadioStatsChannelUtilizationPerRadio(e,f.NA.type).length&&!this.getRadioStatsChannelUtilizationPerRadio(e,f.NG.type).length)},this.isDeviceWithOneRadioPerType=function(e){var t=this.getRadiosByType(e,f.NG.type).length,n=this.getRadiosByType(e,f.NA.type).length;return t<=1&&n<=1},this.getAntennas=function(e){var t=this.getAntennaTable(e);return t?t.models:[]},this.getAntennasForRadio=function(e,t){return this.getAntennas(e).filter(function(e){return this.isAntennaApplicableForRadio(e,t)}.bind(this))},this.getSelectedAntennaForRadioType=function(e,t){var n=this.getRadiosByType(e,t);if(n.length){var i=n[0].get("antenna_id");return this.getAntennas(e).find(function(e){return e.id===i}.bind(this))}},this.isAntennaApplicableForRadio=function(e,t){if(t&&e){var n=t.get("name"),i=e.get(n+"_gain");return angular.isDefined(i)}return!1},this.getAntennaTable=function(e){return e.get("antenna_table")},this.getAntennaById=function(e,t){var n=this.getAntennaTable(e);return n?n.get(t):void 0},this.getAntennaGainForRadioName=function(e,t){return e.get(t+"_gain")},this.getAntennaOptionsForRadio=function(e,t){var n=this.getAntennasForRadio(e,t).map(this.getAntennaOption.bind(this));return n.length&&this.hasExternalAntenna(t)&&this.isCustomAntennaGainAllowed(e)&&n.push(this.getCustomAntennaOption(e)),n},this.hasExternalAntenna=function(e){return!1===e.get("builtin_antenna")},this.getAntennaOption=function(e){return e&&{id:e.get("id"),name:e.get("name")}},this.getCustomAntennaOption=function(){return{id:d.CUSTOM.ID,name:t.instant("DEVICE_PROPERTIES_AP_RADIO_ANTENNA_GAIN_OPTION_CUSTOM")}},this.isCustomAntennaGainAllowed=function(e){return!this.getAntennas(e).length||o.isCustomAntennaGainAllowed()||i.isProfessionalInstaller()},this.getSatisfaction=function(e,t){var n={averageSatisfaction:-1};if(e&&e.get("vap_table")){n.satisfactions=(t?e.get("vap_table").where({radio:t}):e.get("vap_table")).filter(function(e){return void 0!==e.get("satisfaction")}).map(function(e){return{satisfaction:e.get("satisfaction"),essid:e.get("essid"),radio:e.get("radio")}});var i=n.satisfactions.map(function(e){return e.satisfaction}).filter(function(e){return c.isExperienceKnown(e)});n.averageSatisfaction=i.length?i.reduce(function(e,t){return e+t},0)/i.length:-1}return n}}])},{}],159:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceStateUtils",["$translate","countryChannels","deviceEliteUtils","DEVICE_LICENSE_STATES","DEVICE_MODELS","DEVICE_STATES","DEVICE_STATE_IDS","DEVICE_STATE_FLAGS","DEVICE_UNSUPPORTED_REASONS",function(e,t,n,i,r,s,o,a,u){var c;this.deviceStateIdMap=(c={},Object.keys(o).forEach(function(e){c[o[e]]=s[e]}),c),this.deviceUpgradeStateIdMap={1:a.UPGRADE_PREPARING_REBOOT,2:a.UPGRADE_FAILED_REBOOT,3:a.FIRMWARE_DOWNLOADING,4:a.DEVICE_FIRMWARE_READY,5:a.DEVICE_FIRMWARE_WRITING},this.getDeviceModelName=function(e){if(e.isPartial)return"";var t=e.get("model");return r[t]?r[t].name:"UniFi "+t},this.getDeviceModelShort=function(e){return this.getDeviceModelName(e).replace("UniFi Security Gateway","USG").replace("UniFi ","").replace("AP","UAP")},this.getRawDeviceState=function(e){var t=parseInt(e.get("state"),10);return this.deviceStateIdMap[t]||s.UNKNOWN},this.getDeviceState=function(e){var t=this.getRawDeviceState(e);return t===s.DISCONNECTED?e.isRestarting()&&(t=s.RESTARTING):t===s.PENDING?e.get("default")||(t=s.MANAGED_BY_OTHER):t===s.INFORM_ERROR?e.get("default")&&(t=s.ADOPTION_REQUIRED):t===s.CONNECTED?e.get("spectrum_scanning")&&(t=s.RFSCANNING):t===s.UNKNOWN&&e.isLocallyDiscovered()&&(t=s.PENDING,e.get("default")||(t=s.MANAGED_BY_OTHER)),t},this.getDeviceStateFlags=function(e){var t=this.getRawDeviceState(e),n=[];if(this.isDeviceUnsupported(e)&&("INCOMPATIBLE_FIRMWARE"===this.getDeviceUnsupportedReason(e)?t!==s.UPGRADING&&n.push(a.UPDATE_REQUIRED):n.push(a.UNSUPPORTED)),t===s.CONNECTED){if("wire"===e.getNested("uplink.type")&&!e.isGateway()){var i=e.get("uplink");i.max_speed===i.speed&&i.full_duplex||n.push(i.full_duplex?a.WIRED_FULL_DUPLEX:a.WIRED_HALF_DUPLEX)}e.get("isolated")?n.push(a.ISOLATED):"wireless"===e.getNested("uplink.type")&&n.push(a.WIRELESS)}else t===s.UPGRADING?e.get("upgrade_state")&&n.push(this.deviceUpgradeStateIdMap[e.get("upgrade_state")]):t===s.PENDING?"scan"===e.get("discovered_via")&&n.push(a.WIRELESS):t===s.ADOPTING&&"wireless"===e.getNested("uplink.type")&&n.push(a.WIRELESS);return e.isElite()&&n.push(a.ELITE),e.isLocallyDiscovered()&&n.push(a.LOCALLY_DISCOVERED),this.isDeviceWithModelEolPendingWarning(e)&&n.push(a.MODEL_EOL_PENDING),this.isDeviceDisabled(e)&&n.push(a.DISABLED),this.isLicenseWithWarning(e)&&n.push("DEVICE_STATE_FLAG_LICENSE_"+e.get("license_state").toUpperCase()),e.get("migrate_inform_url")&&n.push(a.MIGRATING),n},this.getDeviceStateString=function(t){var n=this.getDeviceState(t),i=e.instant(n),r=this.getDeviceStateFlags(t);return r.length&&(i+=" (",i+=r.map(function(n){var i;return n!==a.WIRED_FULL_DUPLEX&&n!==a.WIRED_HALF_DUPLEX||(i={speed:t.getNested("uplink.speed")}),e.instant(n,i)}).join(", "),i+=")"),i},this.getDeviceStatus=function(e){var t;switch(this.getDeviceState(e)){case s.MANAGED_BY_OTHER:t="static";break;case s.CONNECTED:case s.PROVISIONING:case s.RFSCANNING:t="success";break;case s.UPGRADING:t=e.get("adopted")?"success":"warning";break;case s.PENDING:case s.ADOPTING:case s.RESTARTING:t="warning";break;default:t="danger"}return"success"===t&&this.isLicenseWithWarning(e)&&(t="warning"),"success"===t&&this.isDeviceUnsupported(e)&&(t="warning"),t},this.isDeviceConnected=function(e){switch(this.getDeviceState(e)){case s.CONNECTED:case s.UPGRADING:case s.PROVISIONING:case s.RFSCANNING:return!0;default:return!1}},this.isDeviceDisabled=function(e){return!!e.get("disabled")},this.isDeviceUnsupported=function(e){return!!e&&!!e.get("unsupported")},this.isDeviceAdoptableWhenUpgraded=function(e){return!!e&&!!e.get("adoptable_when_upgraded")},this.getDeviceUnsupportedReason=function(e){return this.isDeviceUnsupported(e)?u[e.get("unsupported_reason")]:null},this.isDeviceSupported=function(e){return!!e&&!this.isDeviceUnsupported(e)},this.isDeviceBusy=function(e){switch(this.getDeviceState(e)){case s.UPGRADING:case s.PROVISIONING:case s.ADOPTING:case s.DELETING:case s.RESTARTING:case s.RFSCANNING:return!0;default:return!1}},this.isDeviceMigratable=function(e){if(!e.get("adopted"))return!1;switch(this.getDeviceState(e)){case s.CONNECTED:case s.PROVISIONING:case s.RFSCANNING:return!0;default:return!1}},this.getIconClassName=function(e){if(e){var t=e.get("type"),n=e.get("model"),i=this.getDeviceStatus(e);return this.getIconClassNameByModelAndType(t,n,i)}return""},this.getIconClassNameByModelAndType=function(e,t,n){var i=[];return e&&i.push("unifiDeviceIcon--"+e),t&&i.push("unifiDeviceIcon--"+t),-1!==["success","warning","danger","static"].indexOf(n)&&i.push("is-"+n),i.join(" ")},this.isLicenseWithWarning=function(e){return-1!==[i.REGISTRATION_FAILED,i.GRACE_PERIOD,i.HOST_DOWN,i.UNKNOWN].indexOf(e.get("license_state"))},this.isMigrated=function(e){return!!e.get("migrate_inform_url")},this.isDeviceWithStunWarning=function(e){return!(e.isPartial||!this.isDeviceConnected(e)||this.isDeviceBusy(e)||this.isDeviceUnsupported(e))&&(!e.get("connect_request_port")||!e.get("connect_request_ip"))},this.isDeviceWithModelEolPendingWarning=function(e){return!e.get("model_incompatible")&&e.get("model_eol_pending")},this.isDeviceWithCountryLockedWarning=function(e){var n=e&&e.get("countrycode_table"),i=!(!n||!n.length),r=t.getCurrentCountryCode();return i&&!n.includes(parseInt(r))},this.isDeviceWithEliteDeviceWarning=function(e){return e.isElite()&&n.isDeviceWithEliteDeviceWarning(e)},this.isDeviceWithUnsupportedWarning=function(e){return this.isDeviceUnsupported(e)},this.hasWarnings=function(e){return this.getWarningsCount(e)>0},this.getWarningsCount=function(e){return[this.isDeviceWithStunWarning(e),this.isDeviceWithCountryLockedWarning(e),this.isDeviceWithEliteDeviceWarning(e),this.isDeviceWithModelEolPendingWarning(e),this.isDeviceWithUnsupportedWarning(e)].reduce(function(e,t){return e+=t?1:0},0)}}])},{}],160:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceUplinkUtils",["$q","$translate","DeviceMgrModel","apiResults","devices","deviceStateUtils",function(e,t,n,i,r,s){this._executeDeviceCommand=function(e,t){var i=new n;return(t=t||{}).cmd=e,i.save(t)},this.linkDevices=function(n,r){var s={mac:r.get("mac"),uplink:n.get("mac")};return this._executeDeviceCommand("set-vwire-uplink",s).then(function(){return e.when(t.instant("DEVICE_ACTIONS_LINK_NOTICE",{downlinkDeviceName:r.getDisplayName(),uplinkDeviceName:n.getDisplayName()}))}).catch(function(s){return e.reject(i.appendErrorMsg(t.instant("DEVICE_ACTIONS_LINK_ERROR",{downlinkDeviceName:r.getDisplayName(),uplinkDeviceName:n.getDisplayName()}),s))})},this.unlinkDevices=function(n,r){var s={mac:r.get("mac"),uplink:n.get("mac")};return this._executeDeviceCommand("unset-vwire-uplink",s).then(function(){return e.when(t.instant("DEVICE_ACTIONS_UNLINK_NOTICE",{downlinkDeviceName:r.getDisplayName(),uplinkDeviceName:n.getDisplayName()}))}).catch(function(s){return e.reject(i.appendErrorMsg(t.instant("DEVICE_ACTIONS_UNLINK_ERROR",{downlinkDeviceName:r.getDisplayName(),uplinkDeviceName:n.getDisplayName()}),s))})},this.setPriorityUplink=function(n,r,s){var o={mac:n.get("mac"),prefer1:r?r.get("mac"):void 0,prefer2:s?s.get("mac"):void 0};return this._executeDeviceCommand("set-priority-uplink",o).then(function(){return n.set({mesh_uplink_1:o.prefer1,mesh_uplink_2:o.prefer2}),e.when(t.instant("DEVICE_ACTIONS_SET_PRIORITY_UPLINK_NOTICE",{deviceName:n.getDisplayName()}))}).catch(function(r){return e.reject(i.appendErrorMsg(t.instant("DEVICE_ACTIONS_SET_PRIORITY_UPLINK_ERROR",{deviceName:n.getDisplayName()}),r))})},this.unsetPriorityUplink=function(n){var r={mac:n.get("mac")};return this._executeDeviceCommand("unset-priority-uplink",r).then(function(){return n.unset("mesh_uplink_1"),n.unset("mesh_uplink_2"),e.when(t.instant("DEVICE_ACTIONS_UNSET_PRIORITY_UPLINK_NOTICE",{deviceName:n.getDisplayName()}))}).catch(function(r){return e.reject(i.appendErrorMsg(t.instant("DEVICE_ACTIONS_UNSET_PRIORITY_UPLINK_ERROR",{deviceName:n.getDisplayName()}),r))})},this.getUplinkAttrs=function(e,t){var n=t||"uplink";return s.isDeviceConnected(e)?e.get(n):e.get("last_"+n)||e.get(n)},this.getUplink=function(e,t){var n=this.getUplinkAttrs(e,t);if(n){if(n.hasOwnProperty("uplink_mac"))return r.repository.collection.get(n.uplink_mac);if(n.hasOwnProperty("ap_mac")&&"wireless"===n.type)return r.repository.collection.get(n.ap_mac)}},this.getUplinkDisplayName=function(e,t){var n=this.getUplink(e,t),i=this.getUplinkAttrs(e);return n?n.getDisplayName()+(i.uplink_remote_port?" #"+i.uplink_remote_port:""):""},this.isWirelessUplinkAvailable=function(e){return!!e.get("vwireEnabled")&&(!s.isDeviceConnected(e)||"wireless"===e.getNested("uplink.type")||e.get("uplink_table").where({configured:!0}).length>0)},this.getDevicesWithUplink=function(e){return r.repository.collection.filter(function(t){return t.getNested("uplink.type")===e})},this.isUplinkAggregated=function(e){var t=this.getUplinkAttrs(e);if(t){var n=t.port_idx,i=e.get("port_table");if(i&&n){var r=i.findWhere({port_idx:n});return!!r&&(void 0!==r.get("aggregate_num_ports")||!1!==r.get("aggregated_by"))}}return!1}}])},{}],161:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceUtils",["$q","$translate","DeviceMgrModel","SiteMgrModel","apiResults","semanticVersion","siteUtils","fileUtils","heyToasts","system","UnifiFileBasePath","DEVICE_TYPES","DEVICE_STATE_IDS",function(e,t,n,i,r,s,o,a,u,c,l,d,p){this._executeDeviceCommand=function(e,t,i){var r=new n;return i&&(r._forceSite=i.get("name")),(t=t||{}).cmd=e,r.save(t)},this._executeSiteCommand=function(e,t){var n=new i;return(t=t||{}).cmd=e,n.save(t)},this.saveDevice=function(e,t,n){return e.savePartial(t,n)},this.savePendingChanges=function(n,i){return n.savePendingChanges(i).then(function(){return e.when(t.instant("DEVICE_PROPERTIES_PENDING_CHANGES_APPLY_SUCCESS",{deviceName:n.getDisplayName()}))}).catch(function(i){return e.reject(r.appendErrorMsg(t.instant("DEVICE_PROPERTIES_PENDING_CHANGES_APPLY_ERROR",{deviceName:n.getDisplayName()}),i))})},this.adoptDevice=function(n,i,s){var o=this;return s=angular.extend({mac:n.get("mac")},s||{}),this._executeDeviceCommand("adopt",s,i).then(function(){return n.set({state:p.ADOPTING}),e.when(t.instant("DEVICE_ACTIONS_ADOPT_NOTICE",{deviceName:n.getDisplayName()}))}).catch(function(a){var c=r.appendErrorMsg(t.instant("DEVICE_ACTIONS_ADOPT_ERROR",{deviceName:n.getDisplayName()}),a);if("api.err.AdoptedDevicesLimitReached"===r.getRawErrorMsg(a)){var l=!1,d={text:c,primary:{label:t.instant("DEVICE_ACTIONS_FORCE_ADOPT"),callback:function(){l=!0}}};return u.pushPrimary(d,0).then(function(){return l?(s=angular.extend(s,{ignore_device_limit:!0}),o.adoptDevice(n,i,s)):e.reject()})}return e.reject(c)})},this.replaceDevice=function(n,i){var s={mac:n.get("mac")};return this._executeDeviceCommand("replace",s,i).then(function(){return n.set({state:p.ADOPTING}),e.when(t.instant("DEVICE_ACTIONS_ADOPT_NOTICE",{deviceName:n.getDisplayName()}))}).catch(function(i){return e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_ADOPT_ERROR",{deviceName:n.getDisplayName()}),i))})},this.advancedAdoptDevice=function(n,i){var s=this,o={mac:n.get("mac"),ip:i.ip,port:i.port,username:i.username,password:i.password,url:i.url,sshKeyVerify:i.sshKeyVerify};return this._executeDeviceCommand("adv-adopt",o).then(function(){return n.set({state:p.ADOPTING}),e.when(t.instant("DEVICE_ACTIONS_ADOPT_NOTICE",{deviceName:n.getDisplayName()}))}).catch(function(o){var a=r.appendErrorMsg(t.instant("DEVICE_ACTIONS_ADOPT_ERROR",{deviceName:n.getDisplayName()}),o);if("api.err.AdoptedDevicesLimitReached"===r.getRawErrorMsg(o)){var c=!1,l={text:a,primary:{label:t.instant("DEVICE_ACTIONS_FORCE_ADOPT"),callback:function(){c=!0}}};return u.pushPrimary(l).then(function(){return c?(i.ignore_device_limit=!0,s.advancedAdoptDevice(n,i)):e.reject()})}return e.reject(a)})},this.locateDevice=function(n,i,s){!0!==i&&!1!==i&&(i=!n.get("locating"));var o={mac:n.get("mac")};return this._executeDeviceCommand(!0===i?"set-locate":"unset-locate",o,s).then(function(){return n.set({locating:i}),e.when(t.instant(n.get("locating")?"DEVICE_ACTIONS_LOCATE_NOTICE":"DEVICE_ACTIONS_LOCATE_OFF_NOTICE",{deviceName:n.getDisplayName()}))}).catch(function(i){return e.reject(r.appendErrorMsg(t.instant(n.get("locating")?"DEVICE_ACTIONS_LOCATE_OFF_ERROR":"DEVICE_ACTIONS_LOCATE_ERROR",{deviceName:n.getDisplayName()}),i))})},this.provisionDevice=function(n,i,s){i=i||{};var o={mac:n.get("mac")};return this._executeDeviceCommand("force-provision",o,s).then(function(){return n.set({state:p.PROVISIONING}),e.when(t.instant("DEVICE_ACTIONS_PROVISION_NOTICE",{deviceName:n.getDisplayName()}))}).catch(function(i){return e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_PROVISION_ERROR",{deviceName:n.getDisplayName()}),i))})},this.restartDevice=function(n,i,s){i=i||{};var o={mac:n.get("mac"),reboot_type:i.rebootType||"soft"};return this._executeDeviceCommand("restart",o,s).then(function(){return n.set({state:p.DISCONNECTED,restarting:!0}),e.when(t.instant("DEVICE_ACTIONS_RESTART_NOTICE",{deviceName:n.getDisplayName()}))}).catch(function(i){return e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_RESTART_ERROR",{deviceName:n.getDisplayName()}),i))})},this.upgradeDevice=function(n,i,o){var a={mac:n.get("mac")};i?a.url=i:c.isUnifiGo()||(a.upgrade_to_firmware=n.get("upgrade_to_firmware"));var u=n.get("upgrade_to_firmware")&&s.satisfies(n.get("version"),">"+n.get("upgrade_to_firmware"));return this._executeDeviceCommand(i?"upgrade-external":"upgrade",a,o).then(function(){return n.set({state:p.UPGRADING}),e.when(t.instant(u?"DEVICE_ACTIONS_DOWNGRADE_NOTICE":"DEVICE_ACTIONS_UPGRADE_NOTICE",{deviceName:n.getDisplayName()}))}).catch(function(i){return e.reject(r.appendErrorMsg(t.instant(u?"DEVICE_ACTIONS_DOWNGRADE_ERROR":"DEVICE_ACTIONS_UPGRADE_ERROR",{deviceName:n.getDisplayName()}),i))})},this.startRollingUpgrade=function(n){return this._executeDeviceCommand("set-rollupgrade",void 0,n).then(function(){return e.when(t.instant("DEVICE_LIST_ACTIONS_ROLLING_UPGRADE_START_NOTICE"))}).catch(function(n){return e.reject(r.appendErrorMsg(t.instant("DEVICE_LIST_ACTIONS_ROLLING_UPGRADE_START_ERROR"),n))})},this.stopRollingUpgrade=function(n){return this._executeDeviceCommand("unset-rollupgrade",void 0,n).then(function(){return e.when(t.instant("DEVICE_LIST_ACTIONS_ROLLING_UPGRADE_STOP_NOTICE"))}).catch(function(n){return e.reject(r.appendErrorMsg(t.instant("DEVICE_LIST_ACTIONS_ROLLING_UPGRADE_STOP_ERROR"),n))})},this.copyConfig=function(n,i){var s={mac:n.get("mac"),origin:i.get("mac")};return this._executeDeviceCommand("clone-config",s).then(function(){return n.collection&&n.collection.remove(n),e.when(t.instant("DEVICE_ACTIONS_COPY_SUCCESS",{sourceName:i.getDisplayName(),targetName:n.getDisplayName()}))}).catch(function(s){return e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_COPY_ERROR",{sourceName:i.getDisplayName(),targetName:n.getDisplayName()}),s))})},this.moveDevice=function(n,i){var s={mac:n.get("mac"),site:i.id};return this._executeSiteCommand("move-device",s).then(function(){return n.collection&&n.collection.remove(n),e.when(t.instant("DEVICE_ACTIONS_MOVE_SUCCESS",{deviceName:n.getDisplayName(),siteDesc:i.get("desc")}))}).catch(function(s){return e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_MOVE_ERROR",{deviceName:n.getDisplayName(),siteDesc:i.get("desc")}),s))})},this.forgetDevice=function(n){var i={mac:n.get("mac")};return this._executeSiteCommand("delete-device",i).then(function(){return n.collection&&n.collection.remove(n),e.when(t.instant("DEVICE_ACTIONS_FORGET_SUCCESS",{deviceName:n.getDisplayName()}))}).catch(function(i){return e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_FORGET_ERROR",{deviceName:n.getDisplayName()}),i))})},this.cancelMigrateDevice=function(n){var i={mac:n.get("mac")};return this._executeDeviceCommand("cancel-migrate",i).then(function(){return n.unset("migrate_inform_url"),e.when(t.instant("DEVICE_ACTIONS_CANCEL_MIGRATE_SUCCESS",{deviceName:n.getDisplayName()}))}).catch(function(i){return e.reject(r.appendErrorMsg(t.instant("DEVICE_ACTIONS_CANCEL_MIGRATE_ERROR",{deviceName:n.getDisplayName()}),i))})},this.getInformIp=function(e){var t=e.find(function(e){return e.get("adopted")&&e.get("state")===p.CONNECTED&&e.get("inform_ip")});return t?t.get("inform_ip"):void 0},this.isGatewayAdoptable=function(e,t){return t&&!t.filter(function(t){return t.isGateway()&&t.isAdopted()&&t.get("mac")!==e.get("mac")}).length},this.downloadDeviceInfo=function(n){var i=o.getActiveSite();return a.download(l+"/diag/s/"+i.get("name")+"/device/"+n.get("mac"),n.get("mac").replace(/:/g,"-")+".json").then(function(){return e.when(t.instant("DEVICE_ACTIONS_CACHE_DOWNLOAD_SUCCESS",{deviceName:n.getDisplayName()}))}).catch(function(){return e.reject(t.instant("DEVICE_ACTIONS_CACHE_DOWNLOAD_ERROR",{deviceName:n.getDisplayName()}))})}}])},{}],162:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceWlanGroupUtils",["$translate","deviceRadioUtils","wirelessNetworkGroups",function(e,t,n){this.getWlanGroup=function(e){return n.repository.collection.get(e)||n.repository.collection.getDefault()},this.getWlanGroupNamesByType=function(e,n){if(!e.get("adopted"))return"";var i=[];return t.getRadiosByType(e,n).forEach(function(t){var n=t.get("name"),r=e.get("wlan_overrides"),s=this.getWlanGroup(t.get("wlangroup_id")),o=s?s.get("name"):void 0;s&&function(e,t){return!!t&&t.where({radio_name:e}).length>0}(n,r)&&(o+=" (*)"),i.push(o)}.bind(this)),i.join("\n")},this.isWlanGroupOff=function(e){if(e){var t=this.getWlanGroup(e.get("wlangroup_id"));return t&&"Off"===t.get("attr_hidden_id")}return!1}}])},{}],163:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("devices",["BaseCollectionRepository","DeviceCollection",function(e,t){this.repository=new e(new t)}])},{}],164:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("discoveredDeviceUtils",["discoveryTool","DeviceMgrModel","macAddressFormatter","now","DEVICE_MODELS","DISCOVERY",function(e,t,n,i,r,s){this.isUniFiDevice=function(e){return e.discovered_by===s.PROTOCOL_V2_ID&&"UniFi"===e.family&&!0!==e.is_cloudkey},this.mapToDeviceAttributes=function(e){return{_id:n.toCanonical(e.mac),adopt_ip:e.ip,default:e.is_default,discovered_by:e.discovered_by,ip:e.ip,last_seen:i(),mac:n.toCanonical(e.mac),model:e.model,type:(r[e.model]||{}).type,uptime:e.uptime,version:e.short_ver}}}])},{}],165:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("discoveredDevices",["$q","$rootScope","account","BaseCollectionRepository","DiscoveredDeviceCollection","discoveredDeviceUtils","now","DISCOVERED_DEVICE","DISCOVERY_TOOL_EVENTS",function(e,t,n,i,r,s,o,a,u){this.repository=new i(new r),t.$on(u.DEVICE_DISCOVERED,function(e,t){if(s.isUniFiDevice(t)&&(n.hasPermission("API_STAT_DEVICE_ACCESS_SUPER_SITE_PENDING")||n.isSuperAdmin())){var i=s.mapToDeviceAttributes(t);angular.equals((this.repository.collection.get(i.mac)||{}).attributes,i)||this.repository.collection.add(i,{merge:!0})}}.bind(this)),this.repository.collection.fetch=function(){return e.when(this)},this.repository.fetch=function(){return this.collection.models.forEach(function(e){e.get("last_seen")+1e3*a.LAST_SEEN_TIMEOUT<o()&&this.collection.remove(e)}.bind(this)),i.prototype.fetch.call(this,arguments)},this.mergeToDevicesCollection=function(e){var t=this.repository.collection.models.map(function(e){return e.deepCopy()});e.add(t,{merge:!0})}}])},{}],166:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("eliteStateUtils",["$translate","deviceFeatureUtils","ELITE_ASSIGNMENT_STATES",function(e,t,n){var i="DEVICE_PROPERTIES_ELITE_VALUE_STATUS_REPLACED",r="DEVICE_PROPERTIES_ELITE_VALUE_STATUS_REPLACING",s="DEVICE_PROPERTIES_ELITE_VALUE_STATUS_REVOKED",o="DEVICE_PROPERTIES_ELITE_VALUE_STATUS_RMA_IN_PROGRESS",a="DEVICE_PROPERTIES_ELITE_VALUE_STATUS_VERIFIED",u="DEVICE_PROPERTIES_ELITE_VALUE_STATUS_UNVERIFIED",c="DEVICE_PROPERTIES_ELITE_VALUE_STATUS_UNKNOWN";this.getEliteBadgeInfo=function(t){var n=this.getEliteState(t);return{status:this.getEliteStatus(n),stateString:e.instant(n)}},this.getEliteState=function(e){if(e.isElite())switch(e.get("elite").state){case n.RMA_IN_PROGRESS:return o;case n.REPLACING:return r;case n.REVOKED:return s;case n.REPLACED:return i;case n.ASSIGNED:return t.isEliteDeviceSupported(e)&&e.get("elite").verified?a:u;default:return c}return c},this.getEliteStatus=function(e){switch(e){case a:return"success";case u:case o:case r:return"warning";case i:return"static";case s:default:return"danger"}},this.isDeviceVerified=function(e){return this.getEliteState(e)===a}}])},{}],167:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("PendingAdoptionDeviceFilter",["deviceStateUtils","DEVICE_STATES",function(e,t){var n=function(){};return n.prototype.test=function(n){return e.getDeviceState(n)===t.PENDING&&n.get("default")},n.prototype.getTest=function(){return this.test},n}])},{}],168:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("WirelessNetworkFilter",["BaseSearchableModelFilter",function(e){var t=function(){e.call(this),this.wlanGroupIdFilter=null,this.searchableAttributes=["name"]};return(t.prototype=Object.create(e.prototype)).constructor=t,t.prototype.test=function(t){return(!this.hasWlanGroupIdFilter()||this.wlanGroupIdFilter===t.get("wlangroup_id"))&&e.prototype.test.call(this,t)},t.prototype.isFiltered=function(){return this.hasWlanGroupIdFilter()||this.searchQuery.length>0},t.prototype.getWlanGroupIdFilter=function(){return this.wlanGroupIdFilter},t.prototype.hasWlanGroupIdFilter=function(){return!!this.wlanGroupIdFilter},t.prototype.setWlanGroupIdFilter=function(e){this.wlanGroupIdFilter=e},t.prototype.clearWlanGroupIdFilter=function(){this.wlanGroupIdFilter=void 0},t}])},{}],169:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("ipMatchUtils",["ipUtils",function(e){this.findBestMatch=function(t,n){return(n||[]).sort(function(n,i){return Math.abs(e.ip2long(t)-e.ip2long(n))-Math.abs(e.ip2long(t)-e.ip2long(i))})[0]}}])},{}],170:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("ipv6Utils",["Address6","BigInteger","REGEX_PATTERNS",function(e,t,n){var i=new t("0"),r=new t("1");this.recommendSubnet=function(n,s,o){if((n=new e(n)).isValid()){var a;a=!1===s?i:isNaN(s)||s<=0?r:new t(String(s));var u=n.startAddress().bigInteger().add(a).add(r),c=n.endAddress().bigInteger().subtract(r);if(o>0)var l=u.add(new t(String(o))).subtract(r).min(c);return{dhcpStartIp:e.fromBigInteger(u).correctForm(),dhcpStopIp:e.fromBigInteger(l||c).correctForm(),isLimited:l&&l.compareTo(c)<0||!1}}},this.subnetToNetwork=function(t){if((t=new e(t)).isValid()){var n=t.startAddress(),i=t.endAddress(),s=n.bigInteger().add(r),o=i.bigInteger().subtract(r);return{gatewayIp:t.correctForm(),networkIp:n.correctForm(),broadcastIp:i.correctForm(),ipCount:o.subtract(s).add(r).toString(),ipRangeMin:e.fromBigInteger(s).correctForm(),ipRangeMax:e.fromBigInteger(o).correctForm()}}},this.subnetHasIp=function(t,n){return t=new e(t),(n=new e(n)).isInSubnet(t)&&!t.startAddress().isInSubnet(n)&&!t.endAddress().isInSubnet(n)},this.removeLeadingZeros=function(t){return t?new e(t).correctForm():void 0},this.isValidNetworkAddress=function(t){var n=new e(t);return!!n.isValid()&&(!!n.parsedSubnet&&n.canonicalForm()===n.startAddress().addressMinusSuffix)},this.isIPv6Address=function(e){return n.IPV6_ADDRESS.test(e)}}])},{}],171:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("BatchDeviceModel",["$translate","BatchModel",function(e,t){return t.extend({siteUrl:"group/device",_getResponseByModel:function(e,t){return e[t.get("_id")]},getDisplayName:function(){return e.instant(function(e){switch(e){case"batch:uap":return"DEVICE_PROPERTIES_AP_BATCH_PROPERTY_PANEL_TITLE";case"batch:usw":return"DEVICE_PROPERTIES_SWITCH_BATCH_PROPERTY_PANEL_TITLE";default:return"DEVICE_PROPERTIES_DEFAULT_BATCH_PROPERTY_PANEL_TITLE"}}(this.modelType))},getDestinationAttrValues:function(e,t){var n=this.get("destination");return n?t?n.pluck(e):Array.from(new Set(n.pluck(e))):[]},hasDestinationAttrValue:function(e,t,n){return this.getDestinationAttrValues(e).some(angular.isFunction(t)?t:function(e){return!(!n||void 0!==e)||t===e})},countDestinationAttrValue:function(e,t,n){return this.getDestinationAttrValues(e,!0).filter(angular.isFunction(t)?t:function(e){return!(!n||void 0!==e)||t===e}).length}})}])},{}],172:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("ControllerStatsModel",["CORSModel","resolveMixin","siteUrlMixin","structureMixin","webrtcMixin",function(e,t,n,i,r){return e.extend(t).extend(n).extend(i).extend(r).extend({siteUrl:"stat/widget/os-stats"})}])},{}],173:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("CountryChannelsModel",["CORSModel","siteUrlMixin","structureMixin","resolveMixin","webrtcMixin",function(e,t,n,i,r){return e.extend(t).extend(n).extend(i).extend(r).extend({siteUrl:"stat/current-channel"})}])},{}],174:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("DeviceEliteDetailsModel",["CORSModel","siteUrlMixin","structureMixin","resolveMixin","webrtcMixin",function(e,t,n,i,r){return e.extend(t).extend(n).extend(i).extend(r).extend({siteUrl:"stat/elite-support"})}])},{}],175:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("DeviceEliteMgrModel",["CORSModel","siteUrlMixin","structureMixin","webrtcMixin",function(e,t,n,i){return e.extend(t).extend(n).extend(i).extend({siteUrl:"cmd/elite"})}])},{}],176:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("DeviceModel",["AssociatedModel","Backbone","BaseCollection","collectionViewComparator","CORSAssociatedModel","deepCopyMixin","deviceFeatureUtils","getNestedMixin","modelDelegateMixin","pendingMixin","relationChangeMixin","resolveMixin","savePartialMixin","siteUrlMixin","structureMixin","webrtcMixin","DEVICE_STATE_IDS","DEVICE_TYPES","DISCOVERY",function(e,t,n,i,r,s,o,a,u,c,l,d,p,f,h,v,g,_,E){function m(e){return["radio_na","radio_ng"].forEach(function(t){e[t]&&e[t].ht&&(e[t].ht=String(e[t].ht))}),e.radio_table&&e.radio_table.forEach(function(e){e.ht&&(e.ht=String(e.ht))}),e}return r.extend(f).extend(h).extend(s).extend(p).extend(a).extend(d).extend(v).extend(l).extend(u).extend(c).extend({_isActiveSiteOptional:!0,idAttribute:"mac",modelType:"device",siteUrl:"rest/device",_delegateFallbackCache:{get:r.prototype,set:r.prototype,has:r.prototype},relations:[{type:t.Many,key:"antenna_table",collectionType:n,relatedModel:e.extend({idAttribute:"id"})},{type:t.Many,key:"downlink_table",collectionType:n,relatedModel:e.extend({idAttribute:"port_idx"})},{type:t.Many,key:"uplink_table",collectionType:n,relatedModel:e.extend({idAttribute:"mac"})},{type:t.Many,key:"port_table",collectionType:n,relatedModel:e.extend(s).extend({idAttribute:"port_idx"})},{type:t.Many,key:"port_overrides",collectionType:n.extend(s).extend({model:e.extend({idAttribute:"port_idx"})})},{type:t.Many,key:"ethernet_overrides",collectionType:n.extend(s).extend({model:e.extend({idAttribute:"ifname"})})},{type:t.Many,key:"psu_table",collectionType:n,relatedModel:e.extend(s).extend({idAttribute:"psu_idx"})},{type:t.Many,key:"network_table",collectionType:n,relatedModel:e.extend({idAttribute:"_id"})},{type:t.Many,key:"radio_table",collectionType:n.extend(a).extend({comparator:function(e,t){return e.get("radio")===t.get("radio")?e.get("min_chan_cntr_frq")&&t.get("min_chan_cntr_frq")?i(e.get("min_chan_cntr_frq"),t.get("min_chan_cntr_frq")):i(e.get("name"),t.get("name")):-i(e.get("radio"),t.get("radio"))}}),relatedModel:e.extend({idAttribute:"name"})},{type:t.Many,key:"radio_table_stats",collectionType:n,relatedModel:e.extend({idAttribute:"name"})},{type:t.Many,key:"scan_radio_table",collectionType:n,relatedModel:e.extend({idAttribute:"radio"})},{type:t.Many,key:"wlan_overrides",collectionType:n.extend(s).extend({model:e.extend(s).extend({idAttribute:"_id"})})},{type:t.Many,key:"vap_table",collectionType:n,relatedModel:e.extend({idAttribute:"bssid"})}],initialize:function(){this.on("change:state",function(e,t){this.isRestarting()&&t!==g.DISCONNECTED&&this.previous("state")===g.DISCONNECTED&&this.set({restarting:!1})},this),this.initializeRelationChangeMixin()},parse:function(e){if(e=h.parse.call(this,e))switch(o.getHybridCapability(e.model,e.type)){case"uap":e.wlan_overrides=e.wlan_overrides||[],e=m(e);break;case"usw":e.port_overrides=e.port_overrides||[],e.psu_table=e.psu_table||[];break;case"uap+usw":e.wlan_overrides=e.wlan_overrides||[],e.port_overrides=e.port_overrides||[],e=m(e);break;case"ugw":e.ethernet_overrides=e.ethernet_overrides||[],e.port_table=e.port_table||[]}return e.discovered_by=E.CONTROLLER,e},getName:function(){return this.get("name")||""},getDisplayName:function(){return this.getName()||this.get("mac")},getCoords:function(){return[this.get("x"),this.get("y")]},getMemoryUsage:function(){return void 0!==this.getNested("system-stats.mem")?parseFloat(this.getNested("system-stats.mem")):void 0!==this.getNested("sys_stats.mem_used")&&void 0!==this.getNested("sys_stats.mem_total")?100*this.getNested("sys_stats.mem_used")/this.getNested("sys_stats.mem_total"):void 0},isAdopted:function(){return!0===this.get("adopted")},isRestarting:function(){return!!this.get("restarting")},isLocallyDiscovered:function(){return this.get("discovered_by")===E.PROTOCOL_V2_ID},isAp:function(){return this.get("type")===_.AP},isSwitch:function(){return this.get("type")===_.SWITCH},isGateway:function(){return this.get("type")===_.GATEWAY},isVirtual:function(){return!1},isElite:function(){return!!(this.get("elite")||{}).valid},url:function(){return this.buildUrl({id:this.get("_id")})},sync:function(e,t,n){return n=n||{},"read"===e&&(n.url=this.buildUrl({siteUrl:"stat/device"})),n.cfg&&(n.url+="?cfg=1"),r.prototype.sync.call(this,e,t,n)}})}])},{}],177:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("DpiUsageModel",["BaseModel","dpi",function(e,t){return e.extend({getTotalBytes:function(){return parseInt(this.get("tx_bytes"))+parseInt(this.get("rx_bytes"))},getTotalPackets:function(){return parseInt(this.get("tx_packets"))+parseInt(this.get("rx_packets"))},getCompoundId:function(){return(parseInt(this.get("cat"))<<16)+parseInt(this.get("app"))},getCategoryName:function(){return this.has("category_name")||this.set("category_name",t.getCategoryName(this.get("cat"))),this.get("category_name")},getApplicationName:function(){return this.has("application_name")||this.set("application_name",t.getAppName(this.getCompoundId())),this.get("application_name")}})}])},{}],178:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("NetworkModel",["CORSModel","siteUrlMixin","structureMixin","savePartialMixin","deepCopyMixin","webrtcMixin","DHCP_USER_OPTION",function(e,t,n,i,r,s,o){return e.extend(t).extend(n).extend(i).extend(r).extend(s).extend({modelType:"networks",idAttribute:"_id",siteUrl:"rest/networkconf",parse:function(e){return e=n.parse.call(this,e),Object.keys(this.attributes).filter(function(e){return e.startsWith(o.DHCP_USER_OPTION_PREFIX)}).forEach(function(t){t in e||delete this.attributes[t]}.bind(this)),e},getNetworkGroup:function(){return this.get("networkgroup")||this.get("wan_networkgroup")}})}])},{}],179:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("SpectrumScanModel",["CORSModel","deepCopyMixin","resolveMixin","siteUrlMixin","structureMixin","webrtcMixin",function(e,t,n,i,r,s){return e.extend(t).extend(n).extend(i).extend(r).extend(s).extend({idAttribute:"mac",siteUrl:"stat/spectrum-scan"})}])},{}],180:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("TagModel",["CORSModel","siteUrlMixin","structureMixin","savePartialMixin","webrtcMixin",function(e,t,n,i,r){return e.extend(t).extend(n).extend(i).extend(r).extend({idAttribute:"_id",siteUrl:"rest/tag"})}])},{}],181:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("UserDpiModel",["Backbone","BaseCollection","CORSAssociatedModel","DpiUsageModel","resolveMixin","siteUrlMixin","structureMixin","webrtcMixin",function(e,t,n,i,r,s,o,a){return n.extend(r).extend(s).extend(o).extend(a).extend({idAttribute:"mac",relations:[{type:e.Many,key:"by_app",collectionType:t,relatedModel:i}]})}])},{}],182:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("WirelessNetworkGroupModel",["CORSModel","siteUrlMixin","structureMixin","deepCopyMixin","webrtcMixin",function(e,t,n,i,r){return e.extend(t).extend(n).extend(i).extend(r).extend({idAttribute:"_id",siteUrl:"rest/wlangroup"})}])},{}],183:[function(e,t,n){"use strict";angular.module("base-unifi-device").factory("WirelessNetworkModel",["CORSModel","deepCopyMixin","siteUrlMixin","structureMixin","webrtcMixin","WLAN_SECURITY_TYPES",function(e,t,n,i,r,s){return e.extend(n).extend(i).extend(t).extend(r).extend({_isActiveSiteOptional:!0,idAttribute:"_id",siteUrl:"rest/wlanconf",isRadiusConfigured:function(){var e=this.get("security"),t=this.get("radiusprofile_id");return e===s.WPA_ENTERPRISE?!!t:!!this.get("radius_mac_auth_enabled")&&!!t}})}])},{}],184:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("portFeatureUtils",["POE_CAPS","POE_MAX_POWER","SPEED_CAPS","SPEED_SETTINGS",function(e,t,n,i){var r=this;this.hasPoeCapability=function(e,t){return!!e&&((e.get("poe_caps")||0)&t)===t},this.hasSpeedCapability=function(e,t){return!!e&&((e.get("speed_caps")||0)&t)===t},this.isPoeOffSupported=function(t){return t&&t.has("poe_caps")?!r.hasPoeCapability(t,e.PASSTHROUGH):r.useLegacyPoeCaps(t)},this.isPoePassthroughSupported=function(t){return r.hasPoeCapability(t,e.PASSTHROUGH)||r.hasPoeCapability(t,e.PASSTHROUGHABLE)},this.isPoePassive24Supported=function(t){return r.hasPoeCapability(t,e.PASV24)||r.useLegacyPoeCaps(t)},this.isPoeAutoSupported=function(t){return r.hasPoeCapability(t,e["8023AF"])||r.hasPoeCapability(t,e["8023AT"])||r.hasPoeCapability(t,e["8023BT"])||r.useLegacyPoeCaps(t)},this.isPoePlusSupported=function(t){return r.hasPoeCapability(t,e["8023AT"])||r.useLegacyPoeCaps(t)},this.isPoePlusPlusSupported=function(t){return r.hasPoeCapability(t,e["8023BT"])},this.useLegacyPoeCaps=function(e){return e&&!e.has("poe_caps")&&e.get("port_poe")},this.getCurrentPower=function(e){return parseFloat(e.get("poe_power")||0,10)},this.getMaximumPower=function(n){return r.hasPoeCapability(n,e["8023BT"])?t["8023BT"]:r.hasPoeCapability(n,e["8023AT"])?t["8023AT"]:r.hasPoeCapability(n,e["8023AF"])?t["8023AF"]:void 0},this.getSupportedSpeeds=function(e){return Object.keys(n).filter(function(t){return r.hasSpeedCapability(e,n[t])}).map(function(e){return i[e]}).sort(function(e,t){return t.autoneg-e.autoneg||t.speed-e.speed||t.full_duplex-e.full_duplex})},this.getAllSpeeds=function(){return Object.keys(i).map(function(e){return i[e]}).sort(function(e,t){return t.autoneg-e.autoneg||t.speed-e.speed||t.full_duplex-e.full_duplex})}}])},{}],185:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("tags",["$q","$translate","apiResults","BaseCollectionRepository","TagCollection",function(e,t,n,i,r){this.repository=new i(new r),this.getTagModelByValue=function(e){return e&&this.repository.collection.filter(function(t){return t.get("name").toLowerCase()===e.trim().toLowerCase()})[0]},this.getTagsByMac=function(e){return this.repository.collection.filter(function(t){return-1!==(t.get("member_table")||[]).indexOf(e)}).sort(function(e,t){return e.get("name")<t.get("name")?-1:e.get("name")>t.get("name")?1:0})},this.getUnanimousTagsByMacs=function(e){return this.repository.collection.filter(function(t){return e.every(function(e){return-1!==(t.get("member_table")||[]).indexOf(e)})})},this.removeTagByMacs=function(i,r,s){var o=angular.copy(r.get("member_table")||[]);return(angular.isArray(i)?i:[i]).forEach(function(e){o.splice(o.indexOf(e),1)}),(o.length?r.savePartial({member_table:o},s):r.destroy(s)).then(function(){return e.when(t.instant("DEVICE_PROPERTIES_REMOVE_TAG_SUCCESS",{tag:r.get("name")}))}).catch(function(i){return e.reject(n.appendErrorMsg(t.instant("DEVICE_PROPERTIES_REMOVE_TAG_ERROR",{tag:r.get("name")}),i))})},this.addExistingTagByMacs=function(i,r,s){var o=angular.copy(r.get("member_table")||[]);return o=Array.from(new Set(o.concat(angular.isArray(i)?i:[i]))),r.savePartial({member_table:o},s).then(function(){return e.when(t.instant("DEVICE_PROPERTIES_ADD_TAG_SUCCESS",{tag:r.get("name")}))}).catch(function(i){return e.reject(n.appendErrorMsg(t.instant("DEVICE_PROPERTIES_ADD_TAG_ERROR",{tag:r.get("name")}),i))})},this.addNewTagByMacs=function(i,r,s){var o=this.getTagModelByValue(r);if(o)return this.addExistingTagByMacs(i,o,s);o=new this.repository.collection.model;var a={member_table:angular.isArray(i)?i:[i],name:r};return o.save(a,s).then(function(){return this.repository.collection.add(o),e.when(t.instant("DEVICE_PROPERTIES_ADD_TAG_SUCCESS",{tag:o.get("name")}))}.bind(this)).catch(function(i){return e.reject(n.appendErrorMsg(t.instant("DEVICE_PROPERTIES_ADD_TAG_ERROR",{tag:o.get("name")}),i))})}}])},{}],186:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("deviceModelFeatureValidator",["$filter","deviceFeatureUtils","deviceRadioUtils","RADIO_TYPES",function(e,t,n,i){this.validate=function(e,t,n){var r=[],s={isValid:!0};return this._isSupportedBandSteering(e,t,r),this._isSupportedAirtmeFairness(e,t,r),Object.keys(i).forEach(function(s){this._isSupportedRadio(i[s].type,e,t,r,n)}.bind(this)),r.length&&(s.isValid=!1,s.invalid=r),s},this._isSupportedBandSteering=function(e,n,i){"equal"!==n.bandsteering_mode||t.isGen2(e)||i.push({attr:"bandsteering_mode",translationKey:"DEVICE_PROPERTIES_UNSUPPORTED_FEATURE_BAND_STEERING"})},this._isSupportedAirtmeFairness=function(e,n,i){void 0===n.atf_enabled||t.isAirtimeFairnessConfigSupported(e)||n.atf_enabled===t.isAtfEnabled(e)||i.push({attr:"atf_enabled",translationKey:"DEVICE_PROPERTIES_UNSUPPORTED_FEATURE_AIRTIME_FAIRNESS"})},this._isSupportedRadio=function(t,i,r,s,o){if(r.radio_table)for(var a=0,u=r.radio_table.length;a<u;a++){var c=r.radio_table[a];if(c.radio===t&&this._getChangedRadioAttrs(c).length){if(!n.hasRadioType(i,t))return void s.push({attr:"radio_table",translationKey:e("toTranslationKey")("DEVICE_PROPERTIES_UNSUPPORTED_FEATURE_RADIO_"+t)});this._isSupportedRadioHt(i,c,s),this._isSupportedRadioChannel(i,c,s,o),this._isSupportedRadioTxPower(i,c,s),this._isSupportedRadioMinRssiStrictMode(i,c,s)}}},this._isSupportedRadioHt=function(t,i,r){var s=i.ht&&parseInt(i.ht,10);if(s){if(40===s&&!n.isHt40Supported(t,i.radio))return void r.push({attr:"radio_table",translationKey:e("toTranslationKey")("DEVICE_PROPERTIES_UNSUPPORTED_FEATURE_RADIO_HT_"+i.radio)});if(80===s&&!n.isHt80Supported(t))return void r.push({attr:"radio_table",translationKey:e("toTranslationKey")("DEVICE_PROPERTIES_UNSUPPORTED_FEATURE_RADIO_HT_"+i.radio)});if(160===s&&!n.isHt160Supported(t,i.name))return void r.push({attr:"radio_table",translationKey:e("toTranslationKey")("DEVICE_PROPERTIES_UNSUPPORTED_FEATURE_RADIO_HT_"+i.radio)})}},this._isSupportedRadioChannel=function(t,i,r,s){i.channel&&"auto"!==i.channel&&(n.getChannelOptions(t,i.radio,i.name,i.ht,s).some(function(e){return e.channel===i.channel})||r.push({attr:"radio_table",translationKey:e("toTranslationKey")("DEVICE_PROPERTIES_UNSUPPORTED_FEATURE_RADIO_CHANNEL_"+i.radio)}))},this._isSupportedRadioTxPower=function(t,i,r){"custom"===i.tx_power_mode&&n.getRadiosByType(t,i.radio).forEach(function(t){var n=t.get("min_txpower"),s=t.get("max_txpower");(!isNaN(n)&&i.tx_power<n||!isNaN(s)&&i.tx_power>s)&&r.push({attr:"radio_table",translationKey:e("toTranslationKey")("DEVICE_PROPERTIES_UNSUPPORTED_FEATURE_RADIO_TX_POWER_"+i.radio)})});i.hard_noise_floor_enabled&&!n.isMinRssiStrictModeSupported(t,i.radio)&&r.push({attr:"radio_table",translationKey:e("toTranslationKey")("DEVICE_PROPERTIES_UNSUPPORTED_FEATURE_RADIO_STRICT_MODE_"+i.radio)})},this._isSupportedRadioMinRssiStrictMode=function(t,i,r){i.hard_noise_floor_enabled&&!n.isMinRssiStrictModeSupported(t,i.radio)&&r.push({attr:"radio_table",translationKey:e("toTranslationKey")("DEVICE_PROPERTIES_UNSUPPORTED_FEATURE_RADIO_STRICT_MODE_"+i.radio)})},this._getChangedRadioAttrs=function(e){return Object.keys(e).filter(function(t){return"radio"!==t&&void 0!==e[t]&&null!==e[t]})}}])},{}],187:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("wifiExperience",["WIFI_EXPERIENCE",function(e){this.isExperienceUnknown=function(t){return e.UNKNOWN.isInRange(t)},this.isExperienceKnown=function(e){return!this.isExperienceUnknown(e)},this.isExperienceGoodOrExcellent=function(t){return this.isExperienceKnown(t)&&e.GOOD.isInRange(t)&&e.EXCELLENT.isInRange(t)},this.isExperienceLowerThanGood=function(t){return this.isExperienceKnown(t)&&!e.GOOD.isInRange(t)&&!e.EXCELLENT.isInRange(t)},this.getExperience=function(t){var n=Object.keys(e).find(function(n){return e[n].isInRange(t)});return n?e[n]:e.UNKNOWN},this.getExperienceState=function(e){return this.getExperience(e).state}}])},{}],188:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("wirelessNetworkGroups",["BaseCollectionRepository","WirelessNetworkGroupCollection",function(e,t){this.repository=new e(new t)}])},{}],189:[function(e,t,n){"use strict";angular.module("base-unifi-device").service("wirelessNetworks",["BaseCollectionRepository","WirelessNetworkCollection",function(e,t){this.repository=new e(new t),this.getWlanCountByGroup=function(){return this.repository.collection.reduce(function(e,t){return e[t.get("wlangroup_id")]=e[t.get("wlangroup_id")]||0,e[t.get("wlangroup_id")]++,e},{})},this.getWlansByWlanGroupId=function(e){return this.repository.collection.where({wlangroup_id:e})}}])},{}],190:[function(e,t,n){e("pug-runtime");function i(e,t,n,i){return!1!==t&&null!=t&&(t||"class"!==e&&"style"!==e)?!0===t?" "+(i?e:e+'="'+e+'"'):("function"==typeof t.toJSON&&(t=t.toJSON()),"string"==typeof t||(t=JSON.stringify(t),n||-1===t.indexOf('"'))?(n&&(t=function(e){var t=""+e,n=r.exec(t);if(!n)return e;var i,s,o,a="";for(i=n.index,s=0;i<t.length;i++){switch(t.charCodeAt(i)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==i&&(a+=t.substring(s,i)),s=i+1,a+=o}return s!==i?a+t.substring(s,i):a}(t))," "+e+'="'+t+'"'):" "+e+"='"+t.replace(/'/g,"'")+"'"):""}t.exports=function(e){var t="";return t=t+'<div class="ubntModal ubntModal--small unifiAddSite"><form class="ubntForm"'+i("novalidate",!0,!0,!0)+' autocomplete="off" name="confirmRestartCtrl.form"><div class="ubntModal__header pb-0"><div class="ubntHeader ubntHeader--centered"><div class="ubntHeader__title" ng-switch="confirmRestartCtrl.isBatch"><span ng-switch-when="true" translate="DEVICE_ACTIONS_BATCH_RESTART_CONFIRM_TITLE" translate-values="{count: confirmRestartCtrl.model.get(\'destination\').length}" translate-interpolation="messageformat"></span><span'+i("ng-switch-default",!0,!0,!0)+' translate="DEVICE_ACTIONS_RESTART_CONFIRM_TITLE" translate-values="{deviceName: confirmRestartCtrl.model.getDisplayName()}"></span></div><div class="ubntHeader__actions"><div class="ubntIconGroup"><unifi-aura-icon unifi-aura-icon="::\'close\'" unifi-aura-icon-class="::[\'ubntIcon\', \'ubntIcon--actionable\']" frame-close="confirmRestart"></unifi-aura-icon></div></div></div></div><div class="ubntModal__main"><div class="ubntModalContent pb-0" ng-switch="confirmRestartCtrl.isBatch"><div ng-switch-when="true" translate="DEVICE_ACTIONS_BATCH_RESTART_CONFIRM_MESSAGE" translate-values="{count: confirmRestartCtrl.model.get(\'destination\').length}" translate-interpolation="messageformat"></div><div'+i("ng-switch-default",!0,!0,!0)+' translate="DEVICE_ACTIONS_RESTART_CONFIRM_MESSAGE" translate-values="{deviceName: confirmRestartCtrl.model.getDisplayName()}"></div><div class="ubntFormGroup mt-2" ng-if="confirmRestartCtrl.withHardReboot"><input type="checkbox" name="hardReboot" id="hardReboot" ng-model="confirmRestartCtrl.hardReboot"><label class="ubntLabel ubntLabel--secondary" for="hardReboot" translate="DEVICE_ACTIONS_RESTART_CONFIRM_CYCLE_POE_POWER"></label></div></div></div><div class="ubntModal__footer"><div class="ubntFooter"><div unifi-bypass-confirm="confirmRestartCtrl.bypassFlag"></div><div class="ubntFooter__buttons"><div class="ubntButtonGroup ubntButtonGroup--cozy"><button class="ubntButton ubntButton--secondary cancel" ng-click="confirmRestartCtrl.reject()" translate="COMMON_ACTIONS_CANCEL"></button><button class="ubntButton ubntButton--primary confirm" ng-click="confirmRestartCtrl.resolve()" translate="COMMON_ACTIONS_CONFIRM"></button></div></div></div></div></form></div>'};var r=/["&<>]/},{"pug-runtime":19}],191:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<div class="ubntModal ubntModal--medium"><div class="ubntModal__header"><div class="ubntHeader ubntHeader--centered"><div class="ubntHeader__title">{{\'DEVICE_ACTIONS_LINK_DFS_WARNING_HEADER\' | translate}}</div><div class="ubntHeader__actions"><div class="ubntIconGroup"><unifi-aura-icon unifi-aura-icon="::\'close\'" unifi-aura-icon-class="[\'ubntIcon\', \'ubntIcon--actionable\']" ng-click="wirelessUplinkDfsWarningCtrl.reject()"></unifi-aura-icon></div></div></div></div><div class="ubntModal__main"><div class="ubntModalContent"><p>{{\'DEVICE_ACTIONS_LINK_DFS_WARNING_MESSAGE\' | translate:\'{channel: "\' + wirelessUplinkDfsWarningCtrl.uplink.get(\'na-channel\') + \'"}\'}}</p><div class="appInfoBoxContainer"><div class="appInfoBox appInfoBox--cozy appInfoBox--warning appInfoBox--noBorder appInfoBox--dark"><div class="appInfoBox__icon icon ubnt-icon--alert"></div><div class="appInfoBox__content"><div class="appInfoBox__body"><p class="noMarginBottom"><span translate="DEVICE_ACTIONS_LINK_DFS_WARNING_5GHZ_UNAVAILABLE"></span></p></div></div></div><div class="appInfoBox appInfoBox--cozy appInfoBox--noBorder appInfoBox--dark"><div class="appInfoBox__icon icon ubnt-icon--info"></div><div class="appInfoBox__content"><div class="appInfoBox__body"><p class="noMarginBottom" translate="DEVICE_ACTIONS_LINK_DFS_WARNING_2GHZ_AVAILABLE"></p></div></div></div><div class="appInfoBox appInfoBox--cozy appInfoBox--noBorder" ng-class="{\'appInfoBox--dark\': wirelessUplinkDfsWarningCtrl.aura.isSettingsDark()}"><div class="appInfoBox__icon icon ubnt-icon--info"></div><div class="appInfoBox__content"><div class="appInfoBox__body"><p class="noMarginBottom" translate="DEVICE_ACTIONS_LINK_DFS_WARNING_5GHZ_USAGE_BEYOND"></p></div></div></div></div></div><div class="ubntModalContent"><p>{{\'DEVICE_ACTIONS_LINK_DFS_WARNING_CONFIRM_MESSAGE\' | translate}}</p></div></div><div class="ubntModal__footer"><div class="ubntButtonGroup ubntButtonGroup--cozy"><button class="ubntButton" ng-click="wirelessUplinkDfsWarningCtrl.reject()">{{\'COMMON_ACTIONS_CANCEL\' | translate}}</button><button class="ubntButton ubntButton--primary" ng-click="wirelessUplinkDfsWarningCtrl.resolve()">{{\'COMMON_ACTIONS_CONFIRM\' | translate}}</button></div></div></div>'}},{"pug-runtime":19}],192:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("base-unifi-maintenance").controller("BackupListController",["BasePaginatedListController","backup","backupUtils","frame","heyToasts","preferences","$translate",function(e,t,n,r,s,o,a){return new(function(u){function c(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this));return e.defaultSortBy="datetime",e.defaultSortDesc=!1,e.rowsPerPage=o.model.getRowsPerPropertyPanel(),e.isDownloading=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(c,e),i(c,[{key:"$onInit",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var s=Object.getPrototypeOf(t);return null===s?void 0:e(s,n,i)}if("value"in r)return r.value;var o=r.get;return void 0!==o?o.call(i):void 0})(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"$onInit",this).call(this),o.model.on("change:use24HourTime change:dateFormat change:timeFormat",this.triggerChange)}},{key:"$onDestroy",value:function(){o.model.off("change:use24HourTime change:dateFormat change:timeFormat",this.triggerChange)}},{key:"triggerChange",value:function(){t.repository.collection.trigger("update")}},{key:"getCollection",value:function(){return t.repository.collection}},{key:"removeBackup",value:function(e){return r.show("confirm",{title:function(){return a.instant("SETTINGS_MAINTENANCE_DELETE_AUTOBACKUP_CONFIRM_TITLE")},message:function(){return a.instant("SETTINGS_MAINTENANCE_DELETE_AUTOBACKUP_CONFIRM_MESSAGE",{file:e.get("filename")})},options:function(){return{allowHtml:!0}}}).then(function(){return n.removeBackup(e).then(function(e){return s.pushSuccess(e),!0}).catch(function(e){return s.pushError(e),!1})})}},{key:"downloadBackup",value:function(e){var t=this;return this.isDownloading=!0,n.downloadBackup(e).catch(function(e){return s.pushError(e),!1}).finally(function(){t.isDownloading=!1})}},{key:"restoreBackup",value:function(e){return r.show("confirm",{title:function(){return a.instant("SETTINGS_MAINTENANCE_RESTORE_FROM_AUTOBACKUP_CONFIRM_TITLE")},message:function(){return a.instant("SETTINGS_MAINTENANCE_RESTORE_FROM_AUTOBACKUP_CONFIRM_MESSAGE",{file:e.get("filename")})},options:function(){return{allowHtml:!0}}}).then(function(){return n.restoreBackup(e).catch(function(e){return s.pushError(e),!1})})}}]),c}())}])},{}],193:[function(e,t,n){"use strict";angular.module("base-unifi-maintenance").directive("unifiBackupList",["PaginatedListDirective",function(t){return new t("backup",e("./backupList.pug")(),{isDark:"=unifiBackupListIsDark",isDownloadAvailable:"=unifiBackupListIsDownloadAvailable",isDeleteAvailable:"=unifiBackupListIsDeleteAvailable"})}])},{"./backupList.pug":194}],194:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<div><table class="appTable appTable--condensed appTable--noWrap appTable--hoverable appTable--flexible appTable--striped" id="backupFiles" collection-view-sort="backupListCtrl.view" ng-class="{ \'appTable--dark\': backupListCtrl.isDark }"><thead><th collection-view-sort-by="filename"><span translate="SETTINGS_BACKUP_TABLE_HEADER_FILENAME"></span></th><th collection-view-sort-by="datetime"><span translate="SETTINGS_BACKUP_TABLE_HEADER_DATE"></span></th><th collection-view-sort-by="size"><span translate="SETTINGS_BACKUP_TABLE_HEADER_SIZE"></span></th><th><span translate="SETTINGS_BACKUP_TABLE_HEADER_ACTIONS"></span></th></thead><tfoot ng-if="backupListCtrl.view.getModels().length"><tr><td colspan="4"><unifi-micro-pagination unifi-micro-pagination-current-page="backupListCtrl.currentPage" unifi-micro-pagination-rows-per-page="backupListCtrl.rowsPerPage" unifi-micro-pagination-total-rows="backupListCtrl.view.getModels().length"></unifi-micro-pagination></td></tr></tfoot><tbody><tr collection-view-repeat="model in backupListCtrl.view.getModels(), startFrom (backupListCtrl.currentPage - 1) * backupListCtrl.rowsPerPage, limitTo backupListCtrl.rowsPerPage" data-id="{{::model.id}}"><td>{{ model.get(\'filename\') }}</td><td>{{ model.get(\'datetime\') | moment: \'format\': \'datetime\'}}</td><td>{{ model.get(\'size\') | bytes}}</td><td class="appTableCell--actions"><button class="appMainButton appMainButton--tertiary appMainButton--condensed is-responsive" type="button" ng-click="backupListCtrl.restoreBackup(model)" title="{{\'SETTINGS_BACKUP_ACTIONS_RESTORE\' | translate}}"><span class="button__icon icon ubnt-icon--refresh-2"></span><span class="button__label" translate="SETTINGS_BACKUP_ACTIONS_RESTORE"></span></button><button class="appMainButton appMainButton--tertiary appMainButton--condensed is-responsive" type="button" ng-click="backupListCtrl.downloadBackup(model)" title="{{\'SETTINGS_BACKUP_ACTIONS_DOWNLOAD\' | translate}}" ng-if="backupListCtrl.isDownloadAvailable" ng-disabled="backupListCtrl.isDownloading"><span class="button__icon icon ubnt-icon--download-2"></span><span class="button__label" translate="SETTINGS_BACKUP_ACTIONS_DOWNLOAD"></span></button><button class="appMainButton appMainButton--tertiary appMainButton--condensed is-responsive" type="button" ng-click="backupListCtrl.removeBackup(model)" title="{{\'COMMON_ACTIONS_DELETE\' | translate}}" ng-if="backupListCtrl.isDeleteAvailable"><span class="button__icon icon ubnt-icon--trashcan"></span><span class="button__label" translate="COMMON_ACTIONS_DELETE"></span></button></td></tr></tbody></table></div>'}},{"pug-runtime":19}],195:[function(e,t,n){"use strict";angular.module("base-unifi-maintenance").config(["frameProvider",function(t){t.when("working",{controller:"WorkingController",controllerAs:"workingCtrl",layout:"workingLayout",template:e("../views/frames/working.pug")()})}])},{"../views/frames/working.pug":202}],196:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("base-unifi-maintenance").controller("WorkingController",["frame","message","title",function(e,t,n){return new(function(){function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.message=t,this.title=n}return i(r,[{key:"resolve",value:function(){return e.getLayout("workingLayout").resolve()}},{key:"reject",value:function(){return e.getLayout("workingLayout").reject()}}]),r}())}])},{}],197:[function(e,t,n){"use strict";angular.module("base-unifi-maintenance",["base-unifi"]),e("./components/backupList/BackupListController.js"),e("./components/backupList/backupList.js"),e("./config/frames.js"),e("./controllers/WorkingController.js"),e("./services/backup.js"),e("./services/backupUtils.js"),e("./services/collections/BackupCollection.js"),e("./services/models/BackupModel.js")},{"./components/backupList/BackupListController.js":192,"./components/backupList/backupList.js":193,"./config/frames.js":195,"./controllers/WorkingController.js":196,"./services/backup.js":198,"./services/backupUtils.js":199,"./services/collections/BackupCollection.js":200,"./services/models/BackupModel.js":201}],198:[function(e,t,n){"use strict";angular.module("base-unifi-maintenance").service("backup",["BackupCollection","BaseCollectionRepository",function(e,t){this.repository=new t(new e)}])},{}],199:[function(e,t,n){"use strict";angular.module("base-unifi-maintenance").service("backupUtils",["apiResults","backup","BackupMgrModel","fileUtils","frame","heyToasts","status","systemBackupUtils","UnifiFileBasePath","$translate","$q",function(e,t,n,i,r,s,o,a,u,c,l){this.downloadBackup=function(e){return i.download(u+"/dl/autobackup/"+e.get("filename"),e.get("filename")).catch(function(){return l.reject(c.instant("SETTINGS_BACKUP_DOWNLOAD_FILE_ERROR"))})},this.removeBackup=function(i){var r=i.get("filename");return(new n).save({cmd:"delete-backup",filename:r}).then(function(){return t.repository.collection.remove(i),l.when(c.instant("SETTINGS_BACKUP_REMOVE_FILE_SUCCESS",{filename:r}))}).catch(function(t){return l.reject(e.appendErrorMsg(c.instant("SETTINGS_BACKUP_REMOVE_FILE_ERROR"),t))})},this.restoreBackup=function(t){var i=new n;return i.save({cmd:"choose-backup",filename:t.get("filename")}).then(function(){return this.restoreAndRestart(i.get("backup_id"))}.bind(this)).catch(function(t){return l.reject(e.appendErrorMsg(c.instant("SETTINGS_MAINTENANCE_RESTORE_FROM_BACKUP_ERROR"),t))})},this.restoreAndRestart=function(e){return r.show("working",{title:function(){return c.instant("COMMON_NOTICE_WAITING_TITLE")},message:function(){return c.instant("SETTINGS_MAINTENANCE_RESTORE_FROM_BACKUP_WORKING")}}),a.restoreFromBackup(e).then(function(e){return r.show("working",{title:function(){return c.instant("COMMON_NOTICE_WAITING_TITLE")},message:function(){return e}}),o.waitForRestart(),!0}).catch(function(t){return r.close("working"),s.pushError(t),a.cancelRestoreFromBackup(e),!1})}}])},{}],200:[function(e,t,n){"use strict";angular.module("base-unifi-maintenance").factory("BackupCollection",["CORSCollection","BackupModel","siteUrlMixin","structureMixin","resolveMixin","webrtcMixin",function(e,t,n,i,r,s){return e.extend(n).extend(i).extend(r).extend(s).extend({model:t,siteUrl:"cmd/backup",_isActiveSiteOptional:!0,sync:function(t,n,i){return i=i||{},"read"===t&&(i.type="POST",i.data=JSON.stringify({cmd:"list-backups"})),e.prototype.sync.call(this,t,n,i)}})}])},{}],201:[function(e,t,n){"use strict";angular.module("base-unifi-maintenance").factory("BackupModel",["CORSModel","siteUrlMixin","structureMixin","deepCopyMixin","webrtcMixin",function(e,t,n,i,r){return e.extend(t).extend(n).extend(i).extend(r).extend({idAttribute:"filename",siteUrl:"cmd/backup",_isActiveSiteOptional:!0,defaults:{role:"readonly"},sync:function(){throw new Error("Not implemented")}})}])},{}],202:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<div class="ubntModal ubntModal--small unifiWorking"><div class="ubntModal__header"><div class="ubntHeader ubntHeader--centered"><div class="ubntHeader__title">{{workingCtrl.title}}</div></div></div><div class="ubntModal__main"><div class="ubntModalContent"><p>{{workingCtrl.message}}</p></div></div></div>'}},{"pug-runtime":19}],203:[function(e,t,n){"use strict";t.exports=function(e,t){var n=e.get("$q"),i=e.get("account"),r=e.get("$state"),s=e.get("ENV");if(i.isSuperAdmin()||i.isAdmin()&&!t)return n.when();r.go(s.FATAL_STATE,{error:403})}},{}],204:[function(e,t,n){"use strict";t.exports=function(e){var t=e.get("$window"),n=e.get("$q"),i=e.get("account"),r=e.get("site"),s=e.get("editAccount"),o=e.get("appUrl"),a=e.get("ENV");return i.repository.fetch().then(function(){var e=r.getActiveSite()||i.repository.model.get("last_site_name");return"hotspot"===i.repository.model.get("site_role")&&"app-unifi-hotspot"!==a.APP?n.reject().finally(function(){t.location.href=o.buildUrl(["hotspot","site",e])}):(e&&!r.getActiveSite()&&"app-unifi-overview"!==a.APP&&r.setActiveSite(e),i.isPasswordChangeRequired()&&s.editAccount(),n.when())})}},{}],205:[function(e,t,n){"use strict";t.exports=function(e,t,n,i,r,s){return r.resolve("account").then(function(){return e.ssoLogin({sso_token:n.sso_token,ubic_uuid:n.ubic_uuid})}).then(function(){return i.setActiveSite(n.site_id,!0)}).then(function(){return e.repository.fetch()}).then(function(){t.go(s.HOME_STATE)})}},{}],206:[function(e,t,n){e("pug-runtime");function i(e,t,n,i){return!1!==t&&null!=t&&(t||"class"!==e&&"style"!==e)?!0===t?" "+(i?e:e+'="'+e+'"'):("function"==typeof t.toJSON&&(t=t.toJSON()),"string"==typeof t||(t=JSON.stringify(t),n||-1===t.indexOf('"'))?(n&&(t=function(e){var t=""+e,n=r.exec(t);if(!n)return e;var i,s,o,a="";for(i=n.index,s=0;i<t.length;i++){switch(t.charCodeAt(i)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==i&&(a+=t.substring(s,i)),s=i+1,a+=o}return s!==i?a+t.substring(s,i):a}(t))," "+e+'="'+t+'"'):" "+e+"='"+t.replace(/'/g,"'")+"'"):""}t.exports=function(e){var t="";return t=t+'<div class="appContainer appContainer--responsive appContainer--centered"><div class="appRow--comfy"><div class="col--xs12"><div class="appInfoBox appInfoBox--danger appInfoBox--responsive verticalRhythmTop"><div class="appInfoBox__icon icon ubnt-icon--alert"></div><div class="appInfoBox__content"><div class="appInfoBox__header" ng-if="fatalCtrl.errorCode">{{fatalCtrl.errorCode}}: {{\'HTTP_STATUS_CODE_\' + fatalCtrl.errorCode | translate}}</div><div class="appInfoBox__header" ng-if="!fatalCtrl.errorCode" translate="FATAL_ERROR_GENERIC_ERROR"></div><div class="appInfoBox__body" ng-if="fatalCtrl.homeState"><p class="appLinkContainer noMarginBottom"'+i("unifi-translate-link",!0,!0,!0)+' unifi-translate-link-translate="FATAL_ERROR_LINK_TO_HOME" unifi-translate-link-state="fatalCtrl.homeState"></p></div><div class="appInfoBox__body" ng-if="fatalCtrl.loginState"><p class="appLinkContainer noMarginBottom"'+i("unifi-translate-link",!0,!0,!0)+' unifi-translate-link-translate="FATAL_ERROR_LINK_TO_LOGIN" unifi-translate-link-state="fatalCtrl.loginState"></p></div></div></div></div></div></div>'};var r=/["&<>]/},{"pug-runtime":19}],207:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<div class="appContainer appContainer--responsive appContainer--centered verticalRhythmTop"><div class="appRow--comfy"><div class="col--xs12"><div class="appInfoBox appInfoBox--responsive"><div class="appInfoBox__icon icon ubnt-icon--info"></div><div class="appInfoBox__content"><div class="appInfoBox__header">{{ \'ACCOUNT_NOTICE_SSO_LOGIN\' | translate }}</div></div></div></div></div></div>'}},{"pug-runtime":19}],208:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("shared-unifi-device").controller("DeviceIconController",["BaseModelController","deviceStateUtils",function(e,t){return new(function(n){function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return e.reset(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,e),i(r,[{key:"onModelChange",value:function(){this.reset(),this.model&&(this.attrs={status:t.getDeviceStatus(this.model),type:this.model.get("type"),model:this.model.get("model")})}},{key:"reset",value:function(){this.attrs={}}},{key:"getClassName",value:function(){return t.getIconClassName(this.model)+(this.isLarge?" is-large":"")+(this.isGrid?" is-grid":"")}}]),r}())}])},{}],209:[function(e,t,n){"use strict";angular.module("shared-unifi-device").directive("unifiDeviceIcon",["updateModelDirectiveMixin",function(t){return{scope:{model:"=unifiDeviceIcon"},bindToController:{isLarge:"=unifiDeviceIconIsLarge",isGrid:"=unifiDeviceIconIsGrid"},controller:"DeviceIconController",controllerAs:"deviceIconCtrl",replace:!0,restrict:"A",template:e("./deviceIcon.pug")(),link:function(e,n,i,r){t.init(e,n,i,r,!1)}}}])},{"./deviceIcon.pug":210}],210:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<span class="unifiDeviceIcon {{deviceIconCtrl.getClassName()}}"><div class="unifiDeviceBadgeIcon unifiDeviceBadgeIcon--circle" ng-if="deviceIconCtrl.model.isElite()"><div class="icon ubnt-icon--unifi-elite2 icon--gold eliteIcon"></div></div></span>'}},{"pug-runtime":19}],211:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("shared-unifi-device").controller("DeviceStatusController",["BaseModelController","deviceStateUtils",function(e,t){return new(function(n){function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return e.statusType="status-ball",e.flags=["isSuccess","isWarning","isDanger","isStatic","isBusy","showAlertIcon","statusType"],e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,e),i(r,[{key:"updateLabel",value:function(e){this.label=e}},{key:"onModelChange",value:function(){if(this.reset(),this.model){switch(t.getDeviceStatus(this.model)){case"success":this.isSuccess=!0;break;case"warning":this.isWarning=!0;break;case"danger":this.isDanger=!0,this.showAlertIcon=!0;break;case"static":this.isStatic=!0}this.isBusy=t.isDeviceBusy(this.model)}this.statusType=this.withIcons&&this.showAlertIcon?"status-icon":"status-ball"}},{key:"reset",value:function(){var e=this;angular.forEach(this.flags,function(t){e[t]=!1})}}]),r}())}])},{}],212:[function(e,t,n){"use strict";angular.module("shared-unifi-device").directive("unifiDeviceStatus",["updateModelDirectiveMixin",function(t){return{scope:{model:"=unifiDeviceStatus",label:"&?unifiDeviceStatusLabel"},bindToController:{withIcons:"=?unifiDeviceStatusWithIcons",isCozy:"=?unifiDeviceStatusIsCozy",isCondensed:"=?unifiDeviceStatusIsCondensed",isSmash:"=?unifiDeviceStatusIsSmash",isTruncated:"=?unifiDeviceStatusIsTruncated"},controller:"DeviceStatusController",controllerAs:"deviceStatusCtrl",replace:!0,restrict:"A",template:e("./deviceStatus.pug")(),link:function(e,n,i,r){e.$watch("label()",function(e){r.updateLabel(e)}),t.init(e,n,i,r,!0)}}}])},{"./deviceStatus.pug":213}],213:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+="<div class=\"unifiDeviceStatus\" ng-class=\"{ 'unifiDeviceStatus--cozy': deviceStatusCtrl.isCozy, 'unifiDeviceStatus--condensed': deviceStatusCtrl.isCondensed }\"><div class=\"unifiDeviceStatus__indicator\" ng-switch=\"deviceStatusCtrl.statusType\"><div class=\"unifiDeviceStatus__ball statusBall appStatusBall\" ng-switch-when=\"status-ball\" ng-class=\"{ 'appStatusBall--positive': deviceStatusCtrl.isSuccess, 'appStatusBall--warning': deviceStatusCtrl.isWarning, 'appStatusBall--danger': deviceStatusCtrl.isDanger, 'appStatusBall--static': deviceStatusCtrl.isStatic, 'appStatusBall--cozy': deviceStatusCtrl.isCozy, 'appStatusBall--condensed': deviceStatusCtrl.isCondensed, 'appStatusBall--smash': deviceStatusCtrl.isSmash, 'is-status-ball-busy': deviceStatusCtrl.isBusy }\"></div><div class=\"unifiDeviceStatus__icon icon appStatusIcon\" ng-switch-when=\"status-icon\" ng-class=\"{ 'ubnt-icon--alert-fill': deviceStatusCtrl.showAlertIcon, 'appStatusIcon--positive': deviceStatusCtrl.isSuccess, 'appStatusIcon--warning': deviceStatusCtrl.isWarning, 'appStatusIcon--danger': deviceStatusCtrl.isDanger, 'appStatusIcon--static': deviceStatusCtrl.isStatic, 'is-status-icon-busy': deviceStatusCtrl.isBusy }\"></div></div><div class=\"appStatusBallLabel\" ng-if=\"deviceStatusCtrl.label\" ng-class=\"{'appStatusBallLabel--truncated': deviceStatusCtrl.isTruncated}\">{{deviceStatusCtrl.label}}</div></div>"}},{"pug-runtime":19}],214:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("shared-unifi-device").controller("DeviceStatusBadgeController",["BaseModelController","deviceStateUtils",function(e,t){return new(function(n){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,e),i(r,[{key:"onModelChange",value:function(){this.reset(),this.model&&(this.status=t.getDeviceStatus(this.model),this.stateString=t.getDeviceStateString(this.model),this.hasWarnings=t.hasWarnings(this.model),this.warningsCount=t.getWarningsCount(this.model))}},{key:"reset",value:function(){this.status=null,this.stateString=null}}]),r}())}])},{}],215:[function(e,t,n){"use strict";angular.module("shared-unifi-device").directive("unifiDeviceStatusBadge",["updateModelDirectiveMixin",function(t){return{scope:{model:"<unifiDeviceStatusBadge"},controller:"DeviceStatusBadgeController",controllerAs:"deviceStatusBadgeCtrl",replace:!0,restrict:"A",template:e("./deviceStatusBadge.pug")(),link:function(e,n,i,r){t.init(e,n,i,r,!0)}}}])},{"./deviceStatusBadge.pug":216}],216:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<div class="deviceStatusBadge flexRow flexRow--alignCenter"><div class="inlineBlock appBadge appBadge--noMove" ng-class="{ \'appBadge--success\': deviceStatusBadgeCtrl.status === \'success\', \'appBadge--warning\': deviceStatusBadgeCtrl.status === \'warning\', \'appBadge--danger\': deviceStatusBadgeCtrl.status === \'danger\', \'appBadge--static\': deviceStatusBadgeCtrl.status === \'static\' }">{{deviceStatusBadgeCtrl.stateString}}</div><div class="appAlertIcon appAlertIcon--warning appAlertIcon--scaled appAlertIcon--baseline noVerticalPadding" ng-if="deviceStatusBadgeCtrl.hasWarnings"><div class="icon ubnt-icon--alert"></div></div><div class="inlineBlock"><div class="count count--round appCount appCount--cozy" ng-if="deviceStatusBadgeCtrl.warningsCount > 1"><div class="count__value">{{deviceStatusBadgeCtrl.warningsCount}}</div></div></div></div>'}},{"pug-runtime":19}],217:[function(e,t,n){"use strict";angular.module("shared-unifi-device").constant("DEVICE_MODELS",e("constant-unifi/src/json/deviceModels.json"))},{"constant-unifi/src/json/deviceModels.json":2}],218:[function(e,t,n){"use strict";angular.module("shared-unifi-device",["shared-unifi"]),e("./components/deviceIcon/DeviceIconController.js"),e("./components/deviceIcon/deviceIcon.js"),e("./components/deviceStatus/DeviceStatusController.js"),e("./components/deviceStatus/deviceStatus.js"),e("./components/deviceStatusBadge/DeviceStatusBadgeController.js"),e("./components/deviceStatusBadge/deviceStatusBadge.js"),e("./constants/DEVICE_MODELS.js"),e("./services/deviceStateUtils.js"),e("./services/ipCommonUtils.js"),e("./services/ipUtils.js"),e("./services/models/DeviceMgrModel.js")},{"./components/deviceIcon/DeviceIconController.js":208,"./components/deviceIcon/deviceIcon.js":209,"./components/deviceStatus/DeviceStatusController.js":211,"./components/deviceStatus/deviceStatus.js":212,"./components/deviceStatusBadge/DeviceStatusBadgeController.js":214,"./components/deviceStatusBadge/deviceStatusBadge.js":215,"./constants/DEVICE_MODELS.js":217,"./services/deviceStateUtils.js":219,"./services/ipCommonUtils.js":220,"./services/ipUtils.js":221,"./services/models/DeviceMgrModel.js":222}],219:[function(e,t,n){"use strict";angular.module("shared-unifi-device").service("deviceStateUtils",[function(){this.getDeviceStatus=function(){},this.getDeviceStateString=function(){},this.hasWarnings=function(){},this.getIconClassName=function(){},this.isDeviceBusy=function(){}}])},{}],220:[function(e,t,n){"use strict";angular.module("shared-unifi-device").service("ipCommonUtils",["ipUtils","ipv6Utils","REGEX_PATTERNS",function(e,t,n){this.getIpUtilsFromIpWithSubnet=function(i){return n.IPV4_SUBNET.test(i)?e:t}}])},{}],221:[function(e,t,n){"use strict";angular.module("shared-unifi-device").service("ipUtils",["REGEX_PATTERNS",function(e){this.ip2long=function(e){if(e&&e.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)){var t=e.split(".");return 16777216*t[0]+65536*t[1]+256*t[2]+1*t[3]}},this.long2ip=function(e){return[e>>>24,e>>>16&255,e>>>8&255,255&e].join(".")},this.bits2netmask=function(e){for(var t=4294967295,n=1,i=e;i<32;i++)t^=n,n<<=1;return t},this.netmask2bits=function(e){return e?this.ip2long(e).toString(2).match(/1/g).length:""},this.getSubnet=function(e,t){if(!e||!t)return"";var n=this.ip2long(e)&this.ip2long(t);return this.long2ip(n)+"/"+this.netmask2bits(t)},this.recommendSubnet=function(e,t,n){var i=this.subnetToNetwork(e,n);return!1===t?t=0:(isNaN(t)||t<=0)&&(t=i.bits<25?5*(25-i.bits):1),{ip:i.ip,isIpValid:this.subnetHasIp(e,i.ip),isMaskValid:i.bits<31&&i.bits>0,subnet:this.long2ip(i.ipLongMin)+"/"+i.bits,dhcpStartIp:this.long2ip(i.ipLongMin+t),dhcpStopIp:this.long2ip(i.ipLongMax),isLimited:i.isLimited}},this.subnetToNetwork=function(e,t){var n=e.split("/")[0],i=parseInt(e.split("/")[1],10),r=this.bits2netmask(i),s=(this.ip2long(n)&r)>>>0,o=(this.ip2long(n)|~r)>>>0,a=(o-=1)-(s+=1)+1,u=0;return t&&(a-=u=Math.max(0,a-t),o-=u),{ip:n,ipLong:this.ip2long(n)>>>0,bits:i,netmask:r,ipLongMin:s,ipLongMax:o,numIps:a,isLimited:u>0}},this.subnetHasIp=function(e,t){var n=this.ip2long(t),i=this.subnetToNetwork(e);return n>=i.ipLongMin&&n<=i.ipLongMax},this.isNetworkIp=function(e,t){return!(this.ip2long(e)&~this.ip2long(t))},this.isBroadcastIp=function(e,t){return!~(this.ip2long(e)|this.ip2long(t))},this.isUsableIp=function(e,t){var n=this.isNetworkIp(e,t),i=this.isBroadcastIp(e,t);return!n&&!i},this.isMask31=function(e){return"255.255.255.254"===e},this.isPrivateAddress=function(e){var t=this;return!!["192.168.0.0/16","172.16.0.0/12","10.0.0.0/8"].find(function(n){return t.subnetHasIp(n,e)})},this.isValidNetworkAddress=function(e){var t=this.ip2long(e.split("/")[0]),n=parseInt(e.split("/")[1],10);return t===(t&this.bits2netmask(n))>>>0},this.isIPv4Address=function(t){return e.IPV4_ADDRESS.test(t)}}])},{}],222:[function(e,t,n){"use strict";angular.module("shared-unifi-device").factory("DeviceMgrModel",["CORSModel","siteUrlMixin","webrtcMixin","webSocketMixin",function(e,t,n,i){return e.extend(t).extend(n).extend(i).extend({_isActiveSiteOptional:!0,siteUrl:"cmd/devmgr"})}])},{}],223:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").run(["$rootScope","discoveryToolUtils","DISCOVERY_TOOL_EVENTS","VISIBILITY_CHANGE",function(e,t,n,i){e.$on(i.EVENT,t.handleVisibilityChangeEvent.bind(t)),e.$on(n.DISCONNECTED,t.handleDisconnected.bind(t))}])},{}],224:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").config(["frameProvider",function(t){t.when("discoveryToolChromeRequired",{controller:"DiscoveryToolChromeRequiredController",controllerAs:"discoveryToolChromeRequiredCtrl",layout:"discoveryToolChromeRequiredLayout",template:e("../frames/discoveryToolChromeRequired/discoveryToolChromeRequired.pug")()}).when("discoveryToolInstall",{controller:"DiscoveryToolInstallController",controllerAs:"discoveryToolInstallCtrl",layout:"discoveryToolInstallLayout",template:e("../frames/discoveryToolInstall/discoveryToolInstall.pug")()}).when("discoveryToolPortAlreadyInUse",{controller:"DiscoveryToolPortAlreadyInUseController",controllerAs:"discoveryToolPortAlreadyInUseCtrl",layout:"discoveryToolPortAlreadyInUseLayout",template:e("../frames/discoveryToolPortAlreadyInUse/discoveryToolPortAlreadyInUse.pug")()})}])},{"../frames/discoveryToolChromeRequired/discoveryToolChromeRequired.pug":232,"../frames/discoveryToolInstall/discoveryToolInstall.pug":234,"../frames/discoveryToolPortAlreadyInUse/discoveryToolPortAlreadyInUse.pug":236}],225:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").constant("CHROME_EXTENSION_URL","https://chrome.google.com/webstore/detail/")},{}],226:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").constant("DISCOVERY_TOOL",{CHECK_CREDENTIALS_TIMEOUT:1e4,FIND_CLOUD_KEY_TIMEOUT:15e3,FIND_DEVICES_TIMEOUT:15e3,INITIALIZATION_TIMEOUT:200})},{}],227:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").constant("DISCOVERY_TOOL_ERRORS",{252:"DISCOVERY_TOOL_ERROR_UCK_ALREADY_CONFIGURED",255:"DISCOVERY_TOOL_ERROR_WRONG_SSH_CREDENTIALS"})},{}],228:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").constant("DISCOVERY_TOOL_ERROR_CODES",{UCK_ALREADY_CONFIGURED:252,WRONG_SSH_CREDENTIALS:255})},{}],229:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").constant("DISCOVERY_TOOL_EVENTS",{ACTION_ADOPT_CLOUD_KEY:"discovery-tool-action-adopt-cloud-key",ACTION_CHECK_DEFAULT_CREDENTIALS:"discovery-tool-action-check-default-credentials",ACTION_CUSTOM_SSH_COMMAND:"discovery-tool-action-custom-ssh-command",ACTION_REBOOT:"discovery-tool-action-reboot",ACTION_RESTORE_TO_FACTORY_DEFAULTS:"discovery-tool-action-restore-to-factory-defaults",ACTION_SCAN_FOR_CLOUD_KEY:"discovery-tool-action-scan-for-cloud-key",ACTION_SCAN_FOR_DEVICES:"discovery-tool-action-scan-for-devices",ACTION_SCAN_FOR_LOCATE_FOR_30SECONDS:"discovery-tool-action-locate-for-30-seconds",ACTION_SET_INFORM:"discovery-tool-action-set-inform",ACTION_UPGRADE:"discovery-tool-action-upgrade",CLOUD_KEY_DISCOVERED:"discovery-tool-cloud-key-discovered",CONNECTED:"discovery-tool-connected",DEVICE_DISCOVERED:"discovery-tool-device-discovered",DISCONNECTED:"discovery-tool-disconnected"})},{}],230:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").constant("MANAGE_DEVICE_DEFAULTS",Object.freeze({username:"ubnt",password:"ubnt",port:22}))},{}],231:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("shared-unifi-discovery").controller("DiscoveryToolChromeRequiredController",["bypassFlag","discoveryTool","frame",function(e,t,n){return new(function(){function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.bypassFlag=e,this.discoveryTool=t}return i(r,[{key:"skip",value:function(){n.getLayout("discoveryToolChromeRequiredLayout").reject()}}]),r}())}])},{}],232:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<div class="ubntModal ubntModal--medium"><div class="ubntModal__header pb-0"><div class="ubntHeader ubntHeader--centered"><div class="ubntHeader__title"> </div><div class="ubntHeader__actions"><div class="ubntIconGroup"><unifi-aura-icon unifi-aura-icon="::\'close\'" unifi-aura-icon-class="::[\'ubntIcon\', \'ubntIcon--actionable\']" ng-click="discoveryToolChromeRequiredCtrl.skip()"></unifi-aura-icon></div></div></div></div><div class="ubntModal__main"><div class="ubntModalContent"><div class="container container--horizontal-cozy container--vertical-comfy container--flush"><div class="row"><div class="col type-center"><img src="./images/install-discovery.png"></div></div><div class="row"><div class="col"><p class="appLinkContainer mb-0" ng-bind-html="\'DISCOVERY_TOOL_INSTALL_CHROME_REQUIRED\' | translate:{url: discoveryToolChromeRequiredCtrl.discoveryTool.getChromeRequiredUrl()}"></p></div></div></div></div></div><div class="ubntModal__footer"><div class="ubntFooter"><div ng-if="discoveryToolChromeRequiredCtrl.bypassFlag" unifi-bypass-confirm="discoveryToolChromeRequiredCtrl.bypassFlag"></div><div class="ubntFooter__buttons"><div class="ubntButtonGroup ubntButtonGroup--cozy"><button class="ubntButton ubntButton--primary" ng-click="discoveryToolChromeRequiredCtrl.skip()">{{ \'COMMON_ACTIONS_SKIP\' | translate }}</button></div></div></div></div></div>'}},{"pug-runtime":19}],233:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("shared-unifi-discovery").controller("DiscoveryToolInstallController",["$translate","bypassFlag","discoveryTool","heyToasts","frame",function(e,t,n,r,s){return new(function(){function o(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.bypassFlag=t,this.discoveryTool=n}return i(o,[{key:"install",value:function(){var t=this;this.isInstalling=!0,this.discoveryTool.install().then(function(){s.getLayout("discoveryToolInstallLayout").resolve()}).catch(function(){r.pushError(e.instant("DISCOVERY_TOOL_INSTALL_FAILED"))}).finally(function(){t.isInstalling=!1})}},{key:"skip",value:function(){s.getLayout("discoveryToolInstallLayout").reject()}}]),o}())}])},{}],234:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<div class="ubntModal ubntModal--medium"><div class="ubntModal__header pb-0"><div class="ubntHeader ubntHeader--centered"><div class="ubntHeader__title"> </div><div class="ubntHeader__actions"><div class="ubntIconGroup"><unifi-aura-icon unifi-aura-icon="::\'close\'" unifi-aura-icon-class="::[\'ubntIcon\', \'ubntIcon--actionable\']" ng-click="discoveryToolInstallCtrl.skip()"></unifi-aura-icon></div></div></div></div><div class="ubntModal__main"><div class="ubntModalContent"><div class="container container--horizontal-cozy container--vertical-comfy"><div class="row"><div class="col type-center"><img src="./images/install-discovery.png"></div></div><div class="row"><div class="col"><p class="appLinkContainer mb-0" ng-bind-html="\'DISCOVERY_TOOL_INSTALL_LINK\' | translate:{url: discoveryToolInstallCtrl.discoveryTool.getInstallUrl()}"></p></div></div></div></div></div><div class="ubntModal__footer"><div class="ubntFooter"><div ng-if="discoveryToolInstallCtrl.bypassFlag" unifi-bypass-confirm="discoveryToolInstallCtrl.bypassFlag"></div><div class="ubntFooter__buttons"><div class="ubntButtonGroup ubntButtonGroup--cozy"><button class="ubntButton ubntButton--secondary" type="button" ng-click="discoveryToolInstallCtrl.skip()">{{ \'COMMON_ACTIONS_SKIP\' | translate}}</button><button class="ubntButton ubntButton--primary" analytics-on="click" analytics-event="install_discovery_tool" analytics-category="find_cloud_key" analytics-properties="{ label: \'install Ubiquiti Device Discovery Tool\' }" busy-toggle="discoveryToolInstallCtrl.isInstalling" busy-toggle-spinner-classes="[\'appSpinner appSpinner--light appSpinner--centered centered\']" ng-click="discoveryToolInstallCtrl.install()" ng-disabled="discoveryToolInstallCtrl.isInstalling">{{ \'COMMON_ACTIONS_INSTALL\' | translate }}</button></div></div></div></div></div>'}},{"pug-runtime":19}],235:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();angular.module("shared-unifi-discovery").controller("DiscoveryToolPortAlreadyInUseController",["frame","retryAction",function(e,t){return new(function(){function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n)}return i(n,[{key:"retry",value:function(){var n=this;return this.isRetrying=!0,t().then(function(){return e.getLayout("discoveryToolPortAlreadyInUseLayout").resolve()}).finally(function(){n.isRetrying=!1})}},{key:"cancel",value:function(){e.getLayout("discoveryToolPortAlreadyInUseLayout").reject()}}]),n}())}])},{}],236:[function(e,t,n){e("pug-runtime");t.exports=function(e){var t="";return t+='<div class="ubntModal ubntModal--medium"><div class="ubntModal__header pb-0"><div class="ubntHeader ubntHeader--centered"><div class="ubntHeader__title"><div class="ubntIconText ubntIconText--withTextRight ubntIconText--currentColor ubntIconText--largerText ubntIconText--largeIcon justify-center"><div class="iconText__icon icon ubnt-icon--alert danger"></div><div class="ubntIconText__text">{{\'DISCOVERY_TOOL_PORT_ALREADY_IN_USE_TITLE\' | translate}}</div></div></div><div class="ubntHeader__actions"><div class="ubntIconGroup"><unifi-aura-icon unifi-aura-icon="::\'close\'" unifi-aura-icon-class="::[\'ubntIcon\', \'ubntIcon--actionable\']" ng-click="discoveryToolPortAlreadyInUseCtrl.cancel()"></unifi-aura-icon></div></div></div></div><div class="ubntModal__main"><div class="ubntModalContent"><div class="container container--horizontal-cozy container--vertical-comfy"><div class="row"><div class="col-12"><p class="mb-0" translate="DISCOVERY_TOOL_PORT_ALREADY_IN_USE"></p></div></div></div></div></div><div class="ubntModal__footer"><div class="ubntButtonGroup ubntButtonGroup--cozy"><button class="ubntButton" type="button" ng-click="discoveryToolPortAlreadyInUseCtrl.cancel()">{{ \'COMMON_ACTIONS_CANCEL\' | translate}}</button><button class="ubntButton ubntButton--primary" busy-toggle="discoveryToolPortAlreadyInUseCtrl.isRetrying" busy-toggle-spinner-classes="[\'appSpinner appSpinner--light appSpinner--centered centered\']" ng-click="discoveryToolPortAlreadyInUseCtrl.retry()">{{ \'COMMON_ACTIONS_RETRY\' | translate}}</button></div></div></div>'}},{"pug-runtime":19}],237:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery",["frame","hey","shared-unifi"]),e("./config/discoveryTool.js"),e("./config/frames.js"),e("./constants/CHROME_EXTENSION_URL.js"),e("./constants/DISCOVERY_TOOL.js"),e("./constants/DISCOVERY_TOOL_ERRORS.js"),e("./constants/DISCOVERY_TOOL_ERROR_CODES.js"),e("./constants/DISCOVERY_TOOL_EVENTS.js"),e("./constants/MANAGE_DEVICE_DEFAULTS.js"),e("./frames/discoveryToolChromeRequired/DiscoveryToolChromeRequiredController.js"),e("./frames/discoveryToolInstall/DiscoveryToolInstallController.js"),e("./frames/discoveryToolPortAlreadyInUse/DiscoveryToolPortAlreadyInUseController.js"),e("./services/chromeApi.js"),e("./services/discoveryTool.js"),e("./services/discoveryToolUtils.js"),e("./services/factories/DiscoveryToolBindingPortQueue.js"),e("./services/factories/DiscoveryToolCheckDefaultCredentialsQueue.js"),e("./services/factories/DiscoveryToolCustomSshCommandQueue.js"),e("./services/factories/DiscoveryToolSshCommandQueue.js"),e("./services/factories/DiscoveryToolUnifiCommandQueue.js"),e("./services/factories/PortMessageQueue.js"),e("./services/factories/TaskScheduler.js")},{"./config/discoveryTool.js":223,"./config/frames.js":224,"./constants/CHROME_EXTENSION_URL.js":225,"./constants/DISCOVERY_TOOL.js":226,"./constants/DISCOVERY_TOOL_ERRORS.js":227,"./constants/DISCOVERY_TOOL_ERROR_CODES.js":228,"./constants/DISCOVERY_TOOL_EVENTS.js":229,"./constants/MANAGE_DEVICE_DEFAULTS.js":230,"./frames/discoveryToolChromeRequired/DiscoveryToolChromeRequiredController.js":231,"./frames/discoveryToolInstall/DiscoveryToolInstallController.js":233,"./frames/discoveryToolPortAlreadyInUse/DiscoveryToolPortAlreadyInUseController.js":235,"./services/chromeApi.js":238,"./services/discoveryTool.js":239,"./services/discoveryToolUtils.js":240,"./services/factories/DiscoveryToolBindingPortQueue.js":241,"./services/factories/DiscoveryToolCheckDefaultCredentialsQueue.js":242,"./services/factories/DiscoveryToolCustomSshCommandQueue.js":243,"./services/factories/DiscoveryToolSshCommandQueue.js":244,"./services/factories/DiscoveryToolUnifiCommandQueue.js":245,"./services/factories/PortMessageQueue.js":246,"./services/factories/TaskScheduler.js":247}],238:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").service("chromeApi",[function(){return{isAvailable:Boolean(window.chrome),chrome:window.chrome}}])},{}],239:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").service("discoveryTool",["$q","$rootScope","$timeout","bowser","chromeApi","DiscoveryToolBindingPortQueue","DiscoveryToolCheckDefaultCredentialsQueue","DiscoveryToolCustomSshCommandQueue","DiscoveryToolSshCommandQueue","DiscoveryToolUnifiCommandQueue","semanticVersion","DISCOVERY","DISCOVERY_TOOL","DISCOVERY_TOOL_EVENTS","DISCOVERY_TOOL_KEY","CHROME_EXTENSION_URL",function(e,t,n,i,r,s,o,a,u,c,l,d,p,f,h,v){this.init=function(){this.discoveryToolBindingPortQueue=null,this.discoveryToolCheckDefaultCredentialsQueue=null,this.discoveryToolCustomSshCommandQueue=null,this.discoveryToolSshCommandQueue=null,this.discoveryToolUnifiCommandQueue=null,this.extensionIsInstalled=!1,this.extensionVersion=null,this.extensionSupports={},this.isBusyLatch=0,this.isBusyLatchTimeouts=[],this.isFindingDevices=!1,this.isFindingCloudKeys=!1,this.port=null},this.checkDependencies=function(){return i.chrome&&!i.mobile&&r.isAvailable},this.checkInstalled=function(){return e(function(e,t){this.port?e():this.checkDependencies()?r.chrome.runtime.sendMessage(h,"isInstalled",function(n){this.extensionIsInstalled=!(!n||!n.isInstalled),this.extensionVersion=n&&n.version,this.extensionSupports=n&&n.supports||{},this.extensionIsInstalled?e():t()}.bind(this)):t()}.bind(this))},this.getInstallUrl=function(){return v+h},this.isConnected=function(){return!!this.port},this.install=function(){var t=this.getInstallUrl();return e(function(e,n){r.chrome.webstore.install(t,e,function(e){n({reason:e,url:t})})})},this.initializePort=function(){return this.port?e.when():(this.isBusyLatch+=1,this.port=r.chrome.runtime.connect(h),this.port.onMessage.addListener(g),this.port.onDisconnect.addListener(_),this.discoveryToolBindingPortQueue=new s(this.port,this.extensionSupports.concurrentMessages),this.discoveryToolCheckDefaultCredentialsQueue=new o(this.port,this.extensionSupports.concurrentMessages),this.discoveryToolCustomSshCommandQueue=new a(this.port,this.extensionSupports.concurrentMessages),this.discoveryToolSshCommandQueue=new u(this.port,this.extensionSupports.concurrentMessages),this.discoveryToolUnifiCommandQueue=new c(this.port,this.extensionSupports.concurrentMessages),e(function(e){n(function(){e(),console.info(f.CONNECTED),t.$broadcast(f.CONNECTED)},p.INITIALIZATION_TIMEOUT)}).finally(function(){this.isBusyLatch-=1}.bind(this)))},this.onDeviceDiscovered=function(e){"DEVICE_DISCOVERED"===e.action&&(!0===e.device.is_cloudkey?n(function(){console.debug(f.CLOUD_KEY_DISCOVERED,e.device),t.$broadcast(f.CLOUD_KEY_DISCOVERED,e.device)},0):"UniFi"===e.device.family&&e.device.discovered_by===d.PROTOCOL_V2_ID&&n(function(){console.debug(f.DEVICE_DISCOVERED,e.device),t.$broadcast(f.DEVICE_DISCOVERED,e.device)},0))},this.scanForDevices=function(){return this.checkInstalled().then(this.initializePort.bind(this)).then(function(){return this.isFindingDevices=!0,console.info(f.ACTION_SCAN_FOR_DEVICES),this.isBusyLatch+=1,this.isBusyLatchTimeouts.push(n(function(){this.isBusyLatch-=1}.bind(this),p.FIND_DEVICES_TIMEOUT)),this.discoveryToolBindingPortQueue.postMessage()}.bind(this)).then(function(){this.port.postMessage({action:"SCAN"})}.bind(this)).catch(function(t){return console.error(f.ACTION_SCAN_FOR_DEVICES,t),this.disconnect(),e.reject(t)}.bind(this))},this.scanForCloudKey=function(){return this.checkInstalled().then(this.initializePort.bind(this)).then(function(){this.isFindingCloudKeys=!0,console.info(f.ACTION_SCAN_FOR_CLOUD_KEY),this.isBusyLatch+=1,this.isBusyLatchTimeouts.push(n(function(){this.isBusyLatch-=1}.bind(this),p.FIND_CLOUD_KEY_TIMEOUT)),this.port.postMessage({action:"SCANv2"})}.bind(this)).catch(function(t){return console.error(f.ACTION_SCAN_FOR_CLOUD_KEY,t),this.disconnect(),e.reject(t)}.bind(this))},this.locateFor30Seconds=function(t){return this.isBusyLatch+=1,this.checkInstalled().then(this.initializePort.bind(this)).then(function(){return console.info(f.ACTION_SCAN_FOR_LOCATE_FOR_30SECONDS,t),this.discoveryToolUnifiCommandQueue.postMessage(angular.extend({cmd:"locate"},t))}.bind(this)).catch(function(t){return console.error(f.ACTION_SCAN_FOR_LOCATE_FOR_30SECONDS,t),e.reject(t)}).finally(function(){this.isBusyLatch-=1}.bind(this))},this.reboot=function(t){return this.isBusyLatch+=1,this.checkInstalled().then(this.initializePort.bind(this)).then(function(){return console.info(f.ACTION_REBOOT,t),this.discoveryToolUnifiCommandQueue.postMessage(angular.extend({cmd:"reboot"},t))}.bind(this)).catch(function(t){return console.error(f.ACTION_REBOOT,t),e.reject(t)}).finally(function(){this.isBusyLatch-=1}.bind(this))},this.upgrade=function(t){return this.isBusyLatch+=1,this.checkInstalled().then(this.initializePort.bind(this)).then(function(){return console.info(f.ACTION_UPGRADE,t),this.discoveryToolUnifiCommandQueue.postMessage(angular.extend({cmd:"upgrade"},t))}.bind(this)).catch(function(t){return console.error(f.ACTION_UPGRADE,t),e.reject(t)}).finally(function(){this.isBusyLatch-=1}.bind(this))},this.restoreToFactoryDefaults=function(t){return this.isBusyLatch+=1,this.checkInstalled().then(this.initializePort.bind(this)).then(function(){return console.info(f.ACTION_RESTORE_TO_FACTORY_DEFAULTS,t),this.discoveryToolUnifiCommandQueue.postMessage(angular.extend({cmd:"reset"},t))}.bind(this)).catch(function(t){return console.error(f.ACTION_RESTORE_TO_FACTORY_DEFAULTS,t),e.reject(t)}).finally(function(){this.isBusyLatch-=1}.bind(this))},this.setInform=function(t){return this.isBusyLatch+=1,this.checkInstalled().then(this.initializePort.bind(this)).then(function(){return console.info(f.ACTION_SET_INFORM,t),this.discoveryToolUnifiCommandQueue.postMessage(angular.extend({cmd:"set-inform"},t))}.bind(this)).catch(function(t){return console.error(f.ACTION_SET_INFORM,t),e.reject(t)}).finally(function(){this.isBusyLatch-=1}.bind(this))},this.adoptCloudKey=function(t){return this.isBusyLatch+=1,this.checkInstalled().then(this.initializePort.bind(this)).then(function(){return console.info(f.ACTION_ADOPT_CLOUD_KEY,t),this.discoveryToolSshCommandQueue.postMessage(t)}.bind(this)).catch(function(t){return console.error(f.ACTION_ADOPT_CLOUD_KEY,t),e.reject(t)}).finally(function(){this.isBusyLatch-=1}.bind(this))},this.customSshCommand=function(t){return this.isBusyLatch+=1,this.checkInstalled().then(this.initializePort.bind(this)).then(function(){return console.info(f.ACTION_CUSTOM_SSH_COMMAND,t),this.discoveryToolCustomSshCommandQueue.postMessage(t)}.bind(this)).catch(function(t){return console.error(f.ACTION_CUSTOM_SSH_COMMAND,t),e.reject(t)}).finally(function(){this.isBusyLatch-=1}.bind(this))},this.checkDefaultCredentials=function(t){return this.isBusyLatch+=1,e(function(e,i){var r=n(function(){i()},p.CHECK_CREDENTIALS_TIMEOUT);return this.checkInstalled().then(this.initializePort.bind(this)).then(function(){console.info(f.ACTION_CHECK_DEFAULT_CREDENTIALS,t),this.discoveryToolCheckDefaultCredentialsQueue.postMessage(t).then(e).catch(i).finally(function(){n.cancel(r)})}.bind(this))}.bind(this)).catch(function(t){return console.error(f.ACTION_CHECK_DEFAULT_CREDENTIALS,t),e.reject(t)}).finally(function(){this.isBusyLatch-=1}.bind(this))},this.disconnect=function(){this.port&&(this.port.onMessage.removeListener(g),this.port.onDisconnect.removeListener(_),this.port.disconnect(),console.info(f.DISCONNECTED),t.$broadcast(f.DISCONNECTED)),this.isBusyLatchTimeouts.forEach(function(e){n.cancel(e)}),this.init()},this.tryDisconnect=function(){return this.isBusyLatch<=0&&(this.disconnect(),!0)},this.isVersionHigherOrEqualThan=function(e){return l.satisfies(this.extensionVersion,">="+e)};var g=this.onDeviceDiscovered.bind(this),_=this.disconnect.bind(this);this.init()}])},{}],240:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").service("discoveryToolUtils",["$q","$rootScope","$translate","discoveryTool","frame","heyToasts","VISIBILITY_CHANGE",function(e,t,n,i,r,s,o){this.checkInstallation=function(t){var n=t?{bypassFlag:function(){return t}}:{bypassFlag:angular.noop};return(i.checkDependencies()?e.when():e.reject()).catch(function(){return r.show("discoveryToolChromeRequired",n)}).then(function(){return i.checkInstalled().catch(function(){return r.show("discoveryToolInstall",n)})})},this.startScanForDevices=function(){return i.scanForDevices().catch(function(){return r.show("discoveryToolPortAlreadyInUse",{retryAction:function(){return i.scanForDevices.bind(i)}})})},this.isFindingDevices=function(){return i.isFindingDevices},this.startScanForCloudKeys=function(){return i.scanForCloudKey().catch(function(){return r.show("discoveryToolPortAlreadyInUse",{retryAction:function(){return i.scanForCloudKey.bind(i)}})})},this.isFindingCloudKeys=function(){return i.isFindingCloudKeys},this.handleVisibilityChangeEvent=function(e,n){n===o.STATE.HIDDEN&&i.tryDisconnect()&&t.$applyAsync()},this.handleDisconnected=function(){s.pushWarning(n.instant("DISCOVERY_TOOL_WARNING_DISCONNECTED"))}}])},{}],241:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").factory("DiscoveryToolBindingPortQueue",["PortMessageQueue","TaskScheduler",function(e,t){function n(n){this.portMessageQueue=new e(n,new t,!1)}return n.prototype.postMessage=function(e){return this.portMessageQueue.postMessage("V2_SOCKET_STATE",e,function(e,t,n){return"BINDING_V2_PORT_SUCCESS"===e.action?(t(),!0):"BINDING_V2_PORT_FAILED"===e.action&&(n(),!0)})},n}])},{}],242:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").factory("DiscoveryToolCheckDefaultCredentialsQueue",["PortMessageQueue","TaskScheduler",function(e,t){function n(n,i){this.portMessageQueue=new e(n,new t,i)}return n.prototype.postMessage=function(e){return this.portMessageQueue.postMessage("CHECK_SSH",e,function(e,t,n){if("CREDENTIALS_CHECK_COMPLETED"===e.action)return e.code?n(e.code):t(!!e.isDefaultCredentials),!0})},n}])},{}],243:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").factory("DiscoveryToolCustomSshCommandQueue",["PortMessageQueue","TaskScheduler",function(e,t){function n(n,i){this.portMessageQueue=new e(n,new t,i)}return n.prototype.postMessage=function(e){return this.portMessageQueue.postMessage("CUSTOM_SSH",e,function(e,t,n){if("CUSTOM_SSH_COMMAND_COMPLETED"===e.action)return e.code?n(e.code):t(e.output),!0})},n}])},{}],244:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").factory("DiscoveryToolSshCommandQueue",["PortMessageQueue","TaskScheduler",function(e,t){function n(n,i){this.portMessageQueue=new e(n,new t,i)}return n.prototype.postMessage=function(e){return this.portMessageQueue.postMessage("SSH",e,function(e,t,n){if("SSH_COMMAND_COMPLETED"===e.action)return e.code?n(e.code):t(e.code),!0})},n}])},{}],245:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").factory("DiscoveryToolUnifiCommandQueue",["PortMessageQueue","TaskScheduler",function(e,t){function n(n,i){this.portMessageQueue=new e(n,new t,i)}return n.prototype.postMessage=function(e){return this.portMessageQueue.postMessage("UniFi_Command",e,function(e,t,n){if("UNIFI_COMMAND_COMPLETED"===e.action)return e.code?n(e.code):t(e.code),!0})},n}])},{}],246:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").factory("PortMessageQueue",["$q","uuid",function(e,t){function n(e,t,n){this.port=e,this.taskScheduler=t,this.supportsConcurrentMessages=n}return n.prototype.postMessage=function(n,i,r){i=angular.extend({},i,{id:t.v4()});var s=function(e,t){var s=function(n){this.matchId(i,n)&&r(n,e,t)&&this.port.onMessage.removeListener(s)}.bind(this);this.port.onMessage.addListener(s),this.port.postMessage({action:n,params:i})}.bind(this);return this.supportsConcurrentMessages?e(s):this.taskScheduler.schedule(s)},n.prototype.matchId=function(e,t){return!this.supportsConcurrentMessages||e.id===t.id},n}])},{}],247:[function(e,t,n){"use strict";angular.module("shared-unifi-discovery").factory("TaskScheduler",["$q",function(e){function t(){this.promiseQueue=[]}return t.prototype.schedule=function(t){var n=this.promiseQueue[this.promiseQueue.length-1],i=e(function(i,r){e.when(n).finally(t.bind(t,i,r))});return i.then(function(){this.promiseQueue.shift()}.bind(this)),this.promiseQueue.push(i),i},t.prototype.isBusy=function(){return!!this.promiseQueue.length},t}])},{}]},{},[43]);
Simpan