-
Notifications
You must be signed in to change notification settings - Fork 0
/
detector.min.js
6 lines (6 loc) · 9.8 KB
/
detector.min.js
1
2
3
4
5
6
/**
* angular-detector v1.2.26 - 2014-11-09
* @link https://github.com/angularifyjs/angular-detector
* @license MIT - Copyright (c) 2014 Angularfiy.org & HenryTao.
*/
!function(i,e){"use strict";var s="0.7.2",o="",r="?",n="function",t="undefined",a="object",w="major",d="model",l="name",c="type",p="vendor",u="version",m="architecture",f="console",g="mobile",h="tablet",b="smarttv",v="wearable",x="embedded",k={extend:function(i,e){for(var s in e)-1!=="browser cpu device engine os".indexOf(s)&&e[s].length%2===0&&(i[s]=e[s].concat(i[s]));return i},has:function(i,e){return"string"==typeof i?-1!==e.toLowerCase().indexOf(i.toLowerCase()):void 0},lowerize:function(i){return i.toLowerCase()}},y={rgx:function(){for(var i,s,o,r,w,d,l,c=0,p=arguments;c<p.length&&!d;){var u=p[c],m=p[c+1];if(typeof i===t){i={};for(r in m)w=m[r],typeof w===a?i[w[0]]=e:i[w]=e}for(s=o=0;s<u.length&&!d;)if(d=u[s++].exec(this.getUA()))for(r=0;r<m.length;r++)l=d[++o],w=m[r],typeof w===a&&w.length>0?2==w.length?i[w[0]]=typeof w[1]==n?w[1].call(this,l):w[1]:3==w.length?i[w[0]]=typeof w[1]!==n||w[1].exec&&w[1].test?l?l.replace(w[1],w[2]):e:l?w[1].call(this,l,w[2]):e:4==w.length&&(i[w[0]]=l?w[3].call(this,l.replace(w[1],w[2])):e):i[w]=l?l:e;c+=2}return i},str:function(i,s){for(var o in s)if(typeof s[o]===a&&s[o].length>0){for(var n=0;n<s[o].length;n++)if(k.has(s[o][n],i))return o===r?e:o}else if(k.has(s[o],i))return o===r?e:o;return i}},A={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:"NT 6.4",RT:"ARM"}}}},E={browser:[[/(opera\smini)\/((\d+)?[\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,/(opera).+version\/((\d+)?[\w\.]+)/i,/(opera)[\/\s]+((\d+)?[\w\.]+)/i],[l,u,w],[/\s(opr)\/((\d+)?[\w\.]+)/i],[[l,"Opera"],u,w],[/(kindle)\/((\d+)?[\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,/(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,/(rekonq)((?:\/)[\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i],[l,u,w],[/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],[[l,"IE"],u,w],[/(yabrowser)\/((\d+)?[\w\.]+)/i],[[l,"Yandex"],u,w],[/(comodo_dragon)\/((\d+)?[\w\.]+)/i],[[l,/_/g," "],u,w],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i],[l,u,w],[/(dolfin)\/((\d+)?[\w\.]+)/i],[[l,"Dolphin"],u,w],[/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],[[l,"Chrome"],u,w],[/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],[u,w,[l,"Mobile Safari"]],[/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],[u,w,l],[/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],[l,[w,y.str,A.browser.oldsafari.major],[u,y.str,A.browser.oldsafari.version]],[/(konqueror)\/((\d+)?[\w\.]+)/i,/(webkit|khtml)\/((\d+)?[\w\.]+)/i],[l,u,w],[/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],[[l,"Netscape"],u,w],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?((\d+)?[\w\.]+)/i,/(links)\s\(((\d+)?[\w\.]+)/i,/(gobrowser)\/?((\d+)?[\w\.]+)*/i,/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,/(mosaic)[\/\s]((\d+)?[\w\.]+)/i],[l,u,w]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,k.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[m,/ower/,"",k.lowerize]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[m,k.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[d,p,[c,h]],[/applecoremedia\/[\w\.]+ \((ipad)/],[d,[p,"Apple"],[c,h]],[/(apple\s{0,1}tv)/i],[[d,"Apple TV"],[p,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[p,d,[c,h]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],[d,[p,"Amazon"],[c,h]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[[d,y.str,A.device.amazon.model],[p,"Amazon"],[c,g]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[d,p,[c,g]],[/\((ip[honed|\s\w*]+);/i],[d,[p,"Apple"],[c,g]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[p,d,[c,g]],[/\(bb10;\s(\w+)/i],[d,[p,"BlackBerry"],[c,g]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i],[d,[p,"Asus"],[c,h]],[/(sony)\s(tablet\s[ps])/i],[p,d,[c,h]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[p,d,[c,f]],[/android.+;\s(shield)\sbuild/i],[d,[p,"Nvidia"],[c,f]],[/(playstation\s[3portablevi]+)/i],[d,[p,"Sony"],[c,f]],[/(sprint\s(\w+))/i],[[p,y.str,A.device.sprint.vendor],[d,y.str,A.device.sprint.model],[c,g]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[p,d,[c,h]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],[p,[d,/_/g," "],[c,g]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[d,[p,"Microsoft"],[c,f]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[p,"Microsoft"],[c,g]],[/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i,/(mot)[\s-]?(\w+)*/i],[[p,"Motorola"],d,[c,g]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[d,[p,"Motorola"],[c,h]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[p,"Samsung"],d,[c,h]],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-n900))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[p,"Samsung"],d,[c,g]],[/(samsung);smarttv/i],[p,d,[c,b]],[/\(dtv[\);].+(aquos)/i],[d,[p,"Sharp"],[c,b]],[/sie-(\w+)*/i],[d,[p,"Siemens"],[c,g]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[p,"Nokia"],d,[c,g]],[/android\s3\.[\s\w-;]{10}(a\d{3})/i],[d,[p,"Acer"],[c,h]],[/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],[[p,"LG"],d,[c,h]],[/(lg) netcast\.tv/i],[p,d,[c,b]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],[d,[p,"LG"],[c,g]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[d,[p,"Lenovo"],[c,h]],[/linux;.+((jolla));/i],[p,d,[c,g]],[/((pebble))app\/[\d\.]+\s/i],[p,d,[c,v]],[/android.+;\s(glass)\s\d/i],[d,[p,"Google"],[c,v]],[/(mobile|tablet);.+rv\:.+gecko\//i],[[c,k.lowerize],p,d]],engine:[[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[l,u],[/rv\:([\w\.]+).*(gecko)/i],[u,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,u],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[u,y.str,A.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[u,y.str,A.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],u],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[l,u],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[l,"Symbian"],u],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],u],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[l,u],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],u],[/(sunos)\s?([\w\.]+\d)*/i],[[l,"Solaris"],u],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[l,u],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[l,"iOS"],[u,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],[l,[u,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[l,u]]},S=function(e,s){if(!(this instanceof S))return new S(e,s).getResult();var r=e||(i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:o),n=s?k.extend(E,s):E;this.getBrowser=function(){return y.rgx.apply(this,n.browser)},this.getCPU=function(){return y.rgx.apply(this,n.cpu)},this.getDevice=function(){return y.rgx.apply(this,n.device)},this.getEngine=function(){return y.rgx.apply(this,n.engine)},this.getOS=function(){return y.rgx.apply(this,n.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(i){return r=i,this},this.setUA(r)};if(S.VERSION=s,S.BROWSER={NAME:l,MAJOR:w,VERSION:u},S.CPU={ARCHITECTURE:m},S.DEVICE={MODEL:d,VENDOR:p,TYPE:c,CONSOLE:f,MOBILE:g,SMARTTV:b,TABLET:h,WEARABLE:v,EMBEDDED:x},S.ENGINE={NAME:l,VERSION:u},S.OS={NAME:l,VERSION:u},typeof exports!==t)typeof module!==t&&module.exports&&(exports=module.exports=S),exports.UAParser=S;else{i.UAParser=S,typeof define===n&&define.amd&&define(function(){return S});var N=i.jQuery||i.Zepto;if(typeof N!==t){var T=new S;N.ua=T.getResult(),N.ua.get=function(){return T.getUA()},N.ua.set=function(i){T.setUA(i);var e=T.getResult();for(var s in e)N.ua[s]=e[s]}}}}(this),angular.module("angular-detector",[]).provider("Detector",function(){var i=new UAParser;return i.newInstance=function(i,e){return new UAParser(i,e)},i.$get=function(){return i},i});