vue-device-detector
Version:
A tiny device detector plugin of vue for mobile
2 lines • 16.1 kB
JavaScript
(function(t,n){"object"===typeof exports&&"object"===typeof module?module.exports=n(require("vue")):"function"===typeof define&&define.amd?define([],n):"object"===typeof exports?exports["vue-device-detector"]=n(require("vue")):t["vue-device-detector"]=n(t["Vue"])})("undefined"!==typeof self?self:this,(function(t){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s="fb15")}({"0366":function(t,n,e){var r=e("1c0b");t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 0:return function(){return t.call(n)};case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}},"06cf":function(t,n,e){var r=e("83ab"),o=e("d1e7"),i=e("5c6c"),c=e("fc6a"),u=e("c04e"),f=e("5135"),a=e("0cfb"),s=Object.getOwnPropertyDescriptor;n.f=r?s:function(t,n){if(t=c(t),n=u(n,!0),a)try{return s(t,n)}catch(e){}if(f(t,n))return i(!o.f.call(t,n),t[n])}},"0cfb":function(t,n,e){var r=e("83ab"),o=e("d039"),i=e("cc12");t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},"1be4":function(t,n,e){var r=e("d066");t.exports=r("document","documentElement")},"1c0b":function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},"1d80":function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"23cb":function(t,n,e){var r=e("a691"),o=Math.max,i=Math.min;t.exports=function(t,n){var e=r(t);return e<0?o(e+n,0):i(e,n)}},"23e7":function(t,n,e){var r=e("da84"),o=e("06cf").f,i=e("9112"),c=e("6eeb"),u=e("ce4e"),f=e("e893"),a=e("94ca");t.exports=function(t,n){var e,s,p,d,l,v,h=t.target,b=t.global,y=t.stat;if(s=b?r:y?r[h]||u(h,{}):(r[h]||{}).prototype,s)for(p in n){if(l=n[p],t.noTargetGet?(v=o(s,p),d=v&&v.value):d=s[p],e=a(b?p:h+(y?".":"#")+p,t.forced),!e&&void 0!==d){if(typeof l===typeof d)continue;f(l,d)}(t.sham||d&&d.sham)&&i(l,"sham",!0),c(s,p,l,t)}}},"241c":function(t,n,e){var r=e("ca84"),o=e("7839"),i=o.concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},"37e8":function(t,n,e){var r=e("83ab"),o=e("9bf2"),i=e("825a"),c=e("df75");t.exports=r?Object.defineProperties:function(t,n){i(t);var e,r=c(n),u=r.length,f=0;while(u>f)o.f(t,e=r[f++],n[e]);return t}},"428f":function(t,n,e){var r=e("da84");t.exports=r},"44ad":function(t,n,e){var r=e("d039"),o=e("c6b6"),i="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},"44d2":function(t,n,e){var r=e("b622"),o=e("7c73"),i=e("9bf2"),c=r("unscopables"),u=Array.prototype;void 0==u[c]&&i.f(u,c,{configurable:!0,value:o(null)}),t.exports=function(t){u[c][t]=!0}},4930:function(t,n,e){var r=e("d039");t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},"4d64":function(t,n,e){var r=e("fc6a"),o=e("50c4"),i=e("23cb"),c=function(t){return function(n,e,c){var u,f=r(n),a=o(f.length),s=i(c,a);if(t&&e!=e){while(a>s)if(u=f[s++],u!=u)return!0}else for(;a>s;s++)if((t||s in f)&&f[s]===e)return t||s||0;return!t&&-1}};t.exports={includes:c(!0),indexOf:c(!1)}},"50c4":function(t,n,e){var r=e("a691"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},5135:function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},5692:function(t,n,e){var r=e("c430"),o=e("c6cd");(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.6.5",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,n,e){var r=e("d066"),o=e("241c"),i=e("7418"),c=e("825a");t.exports=r("Reflect","ownKeys")||function(t){var n=o.f(c(t)),e=i.f;return e?n.concat(e(t)):n}},"5c6c":function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},"65f0":function(t,n,e){var r=e("861d"),o=e("e8b5"),i=e("b622"),c=i("species");t.exports=function(t,n){var e;return o(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!o(e.prototype)?r(e)&&(e=e[c],null===e&&(e=void 0)):e=void 0),new(void 0===e?Array:e)(0===n?0:n)}},"69f3":function(t,n,e){var r,o,i,c=e("7f9a"),u=e("da84"),f=e("861d"),a=e("9112"),s=e("5135"),p=e("f772"),d=e("d012"),l=u.WeakMap,v=function(t){return i(t)?o(t):r(t,{})},h=function(t){return function(n){var e;if(!f(n)||(e=o(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return e}};if(c){var b=new l,y=b.get,w=b.has,g=b.set;r=function(t,n){return g.call(b,t,n),n},o=function(t){return y.call(b,t)||{}},i=function(t){return w.call(b,t)}}else{var m=p("state");d[m]=!0,r=function(t,n){return a(t,m,n),n},o=function(t){return s(t,m)?t[m]:{}},i=function(t){return s(t,m)}}t.exports={set:r,get:o,has:i,enforce:v,getterFor:h}},"6eeb":function(t,n,e){var r=e("da84"),o=e("9112"),i=e("5135"),c=e("ce4e"),u=e("8925"),f=e("69f3"),a=f.get,s=f.enforce,p=String(String).split("String");(t.exports=function(t,n,e,u){var f=!!u&&!!u.unsafe,a=!!u&&!!u.enumerable,d=!!u&&!!u.noTargetGet;"function"==typeof e&&("string"!=typeof n||i(e,"name")||o(e,"name",n),s(e).source=p.join("string"==typeof n?n:"")),t!==r?(f?!d&&t[n]&&(a=!0):delete t[n],a?t[n]=e:o(t,n,e)):a?t[n]=e:c(n,e)})(Function.prototype,"toString",(function(){return"function"==typeof this&&a(this).source||u(this)}))},7418:function(t,n){n.f=Object.getOwnPropertySymbols},7839:function(t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(t,n,e){var r=e("1d80");t.exports=function(t){return Object(r(t))}},"7c73":function(t,n,e){var r,o=e("825a"),i=e("37e8"),c=e("7839"),u=e("d012"),f=e("1be4"),a=e("cc12"),s=e("f772"),p=">",d="<",l="prototype",v="script",h=s("IE_PROTO"),b=function(){},y=function(t){return d+v+p+t+d+"/"+v+p},w=function(t){t.write(y("")),t.close();var n=t.parentWindow.Object;return t=null,n},g=function(){var t,n=a("iframe"),e="java"+v+":";return n.style.display="none",f.appendChild(n),n.src=String(e),t=n.contentWindow.document,t.open(),t.write(y("document.F=Object")),t.close(),t.F},m=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(n){}m=r?w(r):g();var t=c.length;while(t--)delete m[l][c[t]];return m()};u[h]=!0,t.exports=Object.create||function(t,n){var e;return null!==t?(b[l]=o(t),e=new b,b[l]=null,e[h]=t):e=m(),void 0===n?e:i(e,n)}},"7db0":function(t,n,e){"use strict";var r=e("23e7"),o=e("b727").find,i=e("44d2"),c=e("ae40"),u="find",f=!0,a=c(u);u in[]&&Array(1)[u]((function(){f=!1})),r({target:"Array",proto:!0,forced:f||!a},{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i(u)},"7f9a":function(t,n,e){var r=e("da84"),o=e("8925"),i=r.WeakMap;t.exports="function"===typeof i&&/native code/.test(o(i))},"825a":function(t,n,e){var r=e("861d");t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},"83ab":function(t,n,e){var r=e("d039");t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"861d":function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},8875:function(t,n,e){var r,o,i;(function(e,c){o=[],r=c,i="function"===typeof r?r.apply(n,o):r,void 0===i||(t.exports=i)})("undefined"!==typeof self&&self,(function(){function t(){var n=Object.getOwnPropertyDescriptor(document,"currentScript");if(!n&&"currentScript"in document&&document.currentScript)return document.currentScript;if(n&&n.get!==t&&document.currentScript)return document.currentScript;try{throw new Error}catch(l){var e,r,o,i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,c=/@([^@]*):(\d+):(\d+)\s*$/gi,u=i.exec(l.stack)||c.exec(l.stack),f=u&&u[1]||!1,a=u&&u[2]||!1,s=document.location.href.replace(document.location.hash,""),p=document.getElementsByTagName("script");f===s&&(e=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=e.replace(r,"$1").trim());for(var d=0;d<p.length;d++){if("interactive"===p[d].readyState)return p[d];if(p[d].src===f)return p[d];if(f===s&&p[d].innerHTML&&p[d].innerHTML.trim()===o)return p[d]}return null}}return t}))},8925:function(t,n,e){var r=e("c6cd"),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return o.call(t)}),t.exports=r.inspectSource},"8bbf":function(n,e){n.exports=t},"90e3":function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++e+r).toString(36)}},9112:function(t,n,e){var r=e("83ab"),o=e("9bf2"),i=e("5c6c");t.exports=r?function(t,n,e){return o.f(t,n,i(1,e))}:function(t,n,e){return t[n]=e,t}},"94ca":function(t,n,e){var r=e("d039"),o=/#|\.prototype\./,i=function(t,n){var e=u[c(t)];return e==a||e!=f&&("function"==typeof n?r(n):!!n)},c=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=i.data={},f=i.NATIVE="N",a=i.POLYFILL="P";t.exports=i},"9bf2":function(t,n,e){var r=e("83ab"),o=e("0cfb"),i=e("825a"),c=e("c04e"),u=Object.defineProperty;n.f=r?u:function(t,n,e){if(i(t),n=c(n,!0),i(e),o)try{return u(t,n,e)}catch(r){}if("get"in e||"set"in e)throw TypeError("Accessors not supported");return"value"in e&&(t[n]=e.value),t}},a640:function(t,n,e){"use strict";var r=e("d039");t.exports=function(t,n){var e=[][t];return!!e&&r((function(){e.call(null,n||function(){throw 1},1)}))}},a691:function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},ae40:function(t,n,e){var r=e("83ab"),o=e("d039"),i=e("5135"),c=Object.defineProperty,u={},f=function(t){throw t};t.exports=function(t,n){if(i(u,t))return u[t];n||(n={});var e=[][t],a=!!i(n,"ACCESSORS")&&n.ACCESSORS,s=i(n,0)?n[0]:f,p=i(n,1)?n[1]:void 0;return u[t]=!!e&&!o((function(){if(a&&!r)return!0;var t={length:-1};a?c(t,1,{enumerable:!0,get:f}):t[1]=1,e.call(t,s,p)}))}},b622:function(t,n,e){var r=e("da84"),o=e("5692"),i=e("5135"),c=e("90e3"),u=e("4930"),f=e("fdbf"),a=o("wks"),s=r.Symbol,p=f?s:s&&s.withoutSetter||c;t.exports=function(t){return i(a,t)||(u&&i(s,t)?a[t]=s[t]:a[t]=p("Symbol."+t)),a[t]}},b727:function(t,n,e){var r=e("0366"),o=e("44ad"),i=e("7b0b"),c=e("50c4"),u=e("65f0"),f=[].push,a=function(t){var n=1==t,e=2==t,a=3==t,s=4==t,p=6==t,d=5==t||p;return function(l,v,h,b){for(var y,w,g=i(l),m=o(g),x=r(v,h,3),O=c(m.length),S=0,j=b||u,P=n?j(l,O):e?j(l,0):void 0;O>S;S++)if((d||S in m)&&(y=m[S],w=x(y,S,g),t))if(n)P[S]=w;else if(w)switch(t){case 3:return!0;case 5:return y;case 6:return S;case 2:f.call(P,y)}else if(s)return!1;return p?-1:a||s?s:P}};t.exports={forEach:a(0),map:a(1),filter:a(2),some:a(3),every:a(4),find:a(5),findIndex:a(6)}},c04e:function(t,n,e){var r=e("861d");t.exports=function(t,n){if(!r(t))return t;var e,o;if(n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!r(o=e.call(t)))return o;if(!n&&"function"==typeof(e=t.toString)&&!r(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},c430:function(t,n){t.exports=!1},c6b6:function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},c6cd:function(t,n,e){var r=e("da84"),o=e("ce4e"),i="__core-js_shared__",c=r[i]||o(i,{});t.exports=c},c8ba:function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(r){"object"===typeof window&&(e=window)}t.exports=e},c975:function(t,n,e){"use strict";var r=e("23e7"),o=e("4d64").indexOf,i=e("a640"),c=e("ae40"),u=[].indexOf,f=!!u&&1/[1].indexOf(1,-0)<0,a=i("indexOf"),s=c("indexOf",{ACCESSORS:!0,1:0});r({target:"Array",proto:!0,forced:f||!a||!s},{indexOf:function(t){return f?u.apply(this,arguments)||0:o(this,t,arguments.length>1?arguments[1]:void 0)}})},ca84:function(t,n,e){var r=e("5135"),o=e("fc6a"),i=e("4d64").indexOf,c=e("d012");t.exports=function(t,n){var e,u=o(t),f=0,a=[];for(e in u)!r(c,e)&&r(u,e)&&a.push(e);while(n.length>f)r(u,e=n[f++])&&(~i(a,e)||a.push(e));return a}},cc12:function(t,n,e){var r=e("da84"),o=e("861d"),i=r.document,c=o(i)&&o(i.createElement);t.exports=function(t){return c?i.createElement(t):{}}},ce4e:function(t,n,e){var r=e("da84"),o=e("9112");t.exports=function(t,n){try{o(r,t,n)}catch(e){r[t]=n}return n}},d012:function(t,n){t.exports={}},d039:function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},d066:function(t,n,e){var r=e("428f"),o=e("da84"),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,n){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][n]||o[t]&&o[t][n]}},d1e7:function(t,n,e){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);n.f=i?function(t){var n=o(this,t);return!!n&&n.enumerable}:r},da84:function(t,n,e){(function(n){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof n&&n)||Function("return this")()}).call(this,e("c8ba"))},df75:function(t,n,e){var r=e("ca84"),o=e("7839");t.exports=Object.keys||function(t){return r(t,o)}},e893:function(t,n,e){var r=e("5135"),o=e("56ef"),i=e("06cf"),c=e("9bf2");t.exports=function(t,n){for(var e=o(n),u=c.f,f=i.f,a=0;a<e.length;a++){var s=e[a];r(t,s)||u(t,s,f(n,s))}}},e8b5:function(t,n,e){var r=e("c6b6");t.exports=Array.isArray||function(t){return"Array"==r(t)}},f772:function(t,n,e){var r=e("5692"),o=e("90e3"),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},fb15:function(t,n,e){"use strict";if(e.r(n),"undefined"!==typeof window){var r=window.document.currentScript,o=e("8875");r=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var i=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(e.p=i[1])}e("7db0"),e("c975");var c=e("8bbf"),u=e.n(c),f=window.navigator.userAgent.toLowerCase(),a=window.devicePixelRatio||1,s="MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1,p=function(){function t(){this.windows=this.find("windows"),this.ipod=this.find("ipod"),this.ipad=this.find("ipad")||s,this.dingding=this.find("dingtalk"),this.wechat=this.find("micromessenger"),this.wechatMiniApp=this.find("miniprogram"),this.iphone=!this.windows&&this.find("iphone"),this.iphoneX=this.iphone&&3===a&&375===window.screen.width&&812===window.screen.height,this.iPhoneXR=this.iphone&&2===a&&414===window.screen.width&&896===window.screen.height,this.iPhoneXSMax=this.iphone&&3===a&&414===window.screen.width&&896===window.screen.height,this.ios=this.iphone||this.ipod||this.ipad,this.android=!this.windows&&this.find("android"),this.androidPhone=this.android&&this.find("mobile"),this.mobile=this.androidPhone||this.iphone||this.ipod}return t.prototype.find=function(t){return-1!==f.indexOf(t)},t}(),d={install:function(t,n){var e="$device",r=new p;t.prototype[e]=r,Object.defineProperty(u.a,""+e,{get:function(){return r}})}},l=d;n["default"]=l},fc6a:function(t,n,e){var r=e("44ad"),o=e("1d80");t.exports=function(t){return r(o(t))}},fdbf:function(t,n,e){var r=e("4930");t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}})}));
//# sourceMappingURL=vue-device-detector.umd.min.js.map