├── .browserslistrc
├── .eslintrc.js
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── babel.config.js
├── dist
├── demo.html
├── vue-browser-detect-plugin.common.js
├── vue-browser-detect-plugin.common.js.map
├── vue-browser-detect-plugin.umd.js
├── vue-browser-detect-plugin.umd.js.map
├── vue-browser-detect-plugin.umd.min.js
└── vue-browser-detect-plugin.umd.min.js.map
├── index.d.ts
├── nuxt
├── index.js
└── plugin.js
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
└── demo.html
├── src
└── main.js
└── yarn.lock
/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not ie <= 8
4 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true,
5 | },
6 | extends: ["plugin:vue/essential", "eslint:recommended"],
7 | parserOptions: {
8 | parser: "babel-eslint",
9 | },
10 |
11 | rules: {
12 | "vue/experimental-script-setup-vars": "off",
13 |
14 | "vue/valid-v-slot": "off",
15 | "no-console": process.env.NODE_ENV === "production" ? "off" : "off",
16 | "no-debugger": process.env.NODE_ENV === "production" ? "off" : "off",
17 |
18 | },
19 | plugins: [],
20 | overrides: [
21 | {
22 | files: [
23 | "**/__tests__/*.{j,t}s?(x)",
24 | "**/tests/unit/**/*.spec.{j,t}s?(x)",
25 | ],
26 | env: {
27 | jest: true,
28 | },
29 | },
30 | ],
31 | };
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 |
4 | # local env files
5 | .env.local
6 | .env.*.local
7 |
8 | # Log files
9 | npm-debug.log*
10 | yarn-debug.log*
11 | yarn-error.log*
12 |
13 | # Editor directories and files
14 | .idea
15 | .vscode
16 | *.suo
17 | *.ntvs*
18 | *.njsproj
19 | *.sln
20 | *.sw*
21 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ### Changelog
2 |
3 | All notable changes to this project will be documented in this file. Dates are displayed in UTC.
4 |
5 | Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6 |
7 | #### [0.1.12](https://github.com/ICJIA/vue-browser-detect-plugin/compare/0.1.10...0.1.12)
8 |
9 | > 14 May 2020
10 |
11 | - fix: dependencies [`#15`](https://github.com/ICJIA/vue-browser-detect-plugin/pull/15)
12 | - chore: update deps / add changelog / MIT license [`7c50544`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/7c50544fc833fa40f6810c51371aa98cbdf1646c)
13 |
14 | #### [0.1.10](https://github.com/ICJIA/vue-browser-detect-plugin/compare/0.1.8...0.1.10)
15 |
16 | > 14 May 2020
17 |
18 | - feat: add nuxt module [`#14`](https://github.com/ICJIA/vue-browser-detect-plugin/pull/14)
19 | - add index.d.ts for typescript support [`#13`](https://github.com/ICJIA/vue-browser-detect-plugin/pull/13)
20 | - chore: bump release [`412489c`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/412489c7624439660f7d806c0c2bb0367efb80c4)
21 |
22 | #### [0.1.8](https://github.com/ICJIA/vue-browser-detect-plugin/compare/0.1.6...0.1.8)
23 |
24 | > 6 February 2020
25 |
26 | - chore: fix README [`80d0a40`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/80d0a4016dc98061301ee0c519b8b66c09c4ff07)
27 | - fix: changed casing for iOS key [`435b011`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/435b011bb9da14b5e714b13a990a1109a72388a8)
28 |
29 | #### [0.1.6](https://github.com/ICJIA/vue-browser-detect-plugin/compare/0.1.5...0.1.6)
30 |
31 | > 6 February 2020
32 |
33 | - chore: README fix [`08bcb4c`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/08bcb4c1e351d0d1f78dba3078daec1d8fa17a7f)
34 | - chore: edit README with demo [`a2ebf5e`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/a2ebf5e28a97d32d762e6b3f3e91d7beb0047751)
35 | - chore: README edit [`872e76c`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/872e76c886ecd6342e55899f2844f91dd636d157)
36 | - feat: detect iOS [`dc617b0`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/dc617b094245bbf2cd798d6c00e17a70fc3bc33a)
37 |
38 | #### [0.1.5](https://github.com/ICJIA/vue-browser-detect-plugin/compare/0.1.4...0.1.5)
39 |
40 | > 14 May 2020
41 |
42 | #### 0.1.4
43 |
44 | > 26 July 2019
45 |
46 | - feat: initial commit [`a66a097`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/a66a097d0b11f3f5306821427e1dd18fb476ad63)
47 | - feat: create README with basic info [`41b5bbd`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/41b5bbd15ea68c7ee2c2039b746711e82f226820)
48 | - fix: update package.json [`2367d5b`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/2367d5b2b02f935a1e8454905b8eb989dda6aabf)
49 | - fix: update demo.html [`c36cf79`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/c36cf795a446b6ddb1509ebd0ecce9302e3c9ae6)
50 | - fix: update README and build [`d772be1`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/d772be1666f1a0950def645f37a5ec4c8c460914)
51 | - chore: update version [`00b00e2`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/00b00e2a4b3878ed620b61ed7d9903b1b0af8fdd)
52 | - fix: check for chrome [`8a8247f`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/8a8247fcc24ac5c2e9d897e6a354db5503f55688)
53 | - fix: chrome check [`f71dc44`](https://github.com/ICJIA/vue-browser-detect-plugin/commit/f71dc4462adf14d78213c4fb8f54f5f21c3f86c7)
54 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Illinois Criminal Justice Information Authority
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Vue Browser Detect Plugin
2 |
3 | [](https://opensource.org/licenses/MIT)
4 |
5 | > Simple plugin for Vue that detects browser name, version, and user-agent.
6 |
7 | ## Installation
8 |
9 | ```bash
10 | npm install vue-browser-detect-plugin
11 | ```
12 |
13 | In your `main.js:`
14 |
15 | ```bash
16 | import browserDetect from "vue-browser-detect-plugin";
17 | Vue.use(browserDetect);
18 | ```
19 |
20 | ## Usage
21 |
22 | ### Browser info:
23 |
24 | - **vm.\$browserDetect.isIE** `boolean`
25 |
26 | - **vm.\$browserDetect.isChrome** `boolean`
27 |
28 | - Note: This is Chrome desktop.
29 |
30 | - **vm.\$browserDetect.isFirefox** `boolean`
31 |
32 | - **vm.\$browserDetect.isOpera** `boolean`
33 |
34 | - **vm.\$browserDetect.isSafari** `boolean`
35 |
36 | - **vm.\$browserDetect.isEdge** `boolean`
37 |
38 | - **vm.\$browserDetect.isChromeIOS** `boolean`
39 |
40 | - **vm.\$browserDetect.isIOS** `boolean`
41 |
42 | ### Additional meta info:
43 |
44 | - **vm.\$browserDetect.meta.name** `Chrome, IE, Edge, etc.`
45 |
46 | - **vm.\$browserDetect.meta.version** `Version`
47 |
48 | - **vm.\$browserDetect.meta.ua** `user-agent`
49 |
50 | ## Demo
51 |
52 | https://vue-browser-detect.netlify.com/
53 |
54 | ## Nuxt.js
55 |
56 | Add `vue-browser-detect-plugin/nuxt` to the `buildModules` section of `nuxt.config.js`
57 |
58 | ```js
59 | export default {
60 | buildModules: [
61 | 'vue-browser-detect-plugin/nuxt'
62 | ]
63 | }
64 | ```
65 |
66 | :warning: If you are using Nuxt **< v2.9** you have to install the module as a `dependency` (No `--dev` or `--save-dev` flags) and use `modules` section in `nuxt.config.js` instead of `buildModules`.
67 |
68 | ## CHANGLOG
69 |
70 | [See CHANGELOG.md](https://github.com/ICJIA/vue-browser-detect-plugin/blob/master/CHANGELOG.md)
71 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ["@vue/cli-plugin-babel/preset"]
3 | };
4 |
--------------------------------------------------------------------------------
/dist/demo.html:
--------------------------------------------------------------------------------
1 |
vue-tour demo
2 |
3 |
4 |
5 |
6 |
{{ msg }}
7 |
{{ $browserDetect }}
8 |
9 |
10 |
19 |
--------------------------------------------------------------------------------
/dist/vue-browser-detect-plugin.common.js:
--------------------------------------------------------------------------------
1 | module.exports =
2 | /******/ (function(modules) { // webpackBootstrap
3 | /******/ // The module cache
4 | /******/ var installedModules = {};
5 | /******/
6 | /******/ // The require function
7 | /******/ function __webpack_require__(moduleId) {
8 | /******/
9 | /******/ // Check if module is in cache
10 | /******/ if(installedModules[moduleId]) {
11 | /******/ return installedModules[moduleId].exports;
12 | /******/ }
13 | /******/ // Create a new module (and put it into the cache)
14 | /******/ var module = installedModules[moduleId] = {
15 | /******/ i: moduleId,
16 | /******/ l: false,
17 | /******/ exports: {}
18 | /******/ };
19 | /******/
20 | /******/ // Execute the module function
21 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22 | /******/
23 | /******/ // Flag the module as loaded
24 | /******/ module.l = true;
25 | /******/
26 | /******/ // Return the exports of the module
27 | /******/ return module.exports;
28 | /******/ }
29 | /******/
30 | /******/
31 | /******/ // expose the modules object (__webpack_modules__)
32 | /******/ __webpack_require__.m = modules;
33 | /******/
34 | /******/ // expose the module cache
35 | /******/ __webpack_require__.c = installedModules;
36 | /******/
37 | /******/ // define getter function for harmony exports
38 | /******/ __webpack_require__.d = function(exports, name, getter) {
39 | /******/ if(!__webpack_require__.o(exports, name)) {
40 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41 | /******/ }
42 | /******/ };
43 | /******/
44 | /******/ // define __esModule on exports
45 | /******/ __webpack_require__.r = function(exports) {
46 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48 | /******/ }
49 | /******/ Object.defineProperty(exports, '__esModule', { value: true });
50 | /******/ };
51 | /******/
52 | /******/ // create a fake namespace object
53 | /******/ // mode & 1: value is a module id, require it
54 | /******/ // mode & 2: merge all properties of value into the ns
55 | /******/ // mode & 4: return value when already ns object
56 | /******/ // mode & 8|1: behave like require
57 | /******/ __webpack_require__.t = function(value, mode) {
58 | /******/ if(mode & 1) value = __webpack_require__(value);
59 | /******/ if(mode & 8) return value;
60 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61 | /******/ var ns = Object.create(null);
62 | /******/ __webpack_require__.r(ns);
63 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65 | /******/ return ns;
66 | /******/ };
67 | /******/
68 | /******/ // getDefaultExport function for compatibility with non-harmony modules
69 | /******/ __webpack_require__.n = function(module) {
70 | /******/ var getter = module && module.__esModule ?
71 | /******/ function getDefault() { return module['default']; } :
72 | /******/ function getModuleExports() { return module; };
73 | /******/ __webpack_require__.d(getter, 'a', getter);
74 | /******/ return getter;
75 | /******/ };
76 | /******/
77 | /******/ // Object.prototype.hasOwnProperty.call
78 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79 | /******/
80 | /******/ // __webpack_public_path__
81 | /******/ __webpack_require__.p = "";
82 | /******/
83 | /******/
84 | /******/ // Load entry module and return exports
85 | /******/ return __webpack_require__(__webpack_require__.s = "fb15");
86 | /******/ })
87 | /************************************************************************/
88 | /******/ ({
89 |
90 | /***/ "00ee":
91 | /***/ (function(module, exports, __webpack_require__) {
92 |
93 | var wellKnownSymbol = __webpack_require__("b622");
94 |
95 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
96 | var test = {};
97 |
98 | test[TO_STRING_TAG] = 'z';
99 |
100 | module.exports = String(test) === '[object z]';
101 |
102 |
103 | /***/ }),
104 |
105 | /***/ "06cf":
106 | /***/ (function(module, exports, __webpack_require__) {
107 |
108 | var DESCRIPTORS = __webpack_require__("83ab");
109 | var propertyIsEnumerableModule = __webpack_require__("d1e7");
110 | var createPropertyDescriptor = __webpack_require__("5c6c");
111 | var toIndexedObject = __webpack_require__("fc6a");
112 | var toPropertyKey = __webpack_require__("a04b");
113 | var has = __webpack_require__("5135");
114 | var IE8_DOM_DEFINE = __webpack_require__("0cfb");
115 |
116 | // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
117 | var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
118 |
119 | // `Object.getOwnPropertyDescriptor` method
120 | // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
121 | exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
122 | O = toIndexedObject(O);
123 | P = toPropertyKey(P);
124 | if (IE8_DOM_DEFINE) try {
125 | return $getOwnPropertyDescriptor(O, P);
126 | } catch (error) { /* empty */ }
127 | if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
128 | };
129 |
130 |
131 | /***/ }),
132 |
133 | /***/ "0b42":
134 | /***/ (function(module, exports, __webpack_require__) {
135 |
136 | var isObject = __webpack_require__("861d");
137 | var isArray = __webpack_require__("e8b5");
138 | var wellKnownSymbol = __webpack_require__("b622");
139 |
140 | var SPECIES = wellKnownSymbol('species');
141 |
142 | // a part of `ArraySpeciesCreate` abstract operation
143 | // https://tc39.es/ecma262/#sec-arrayspeciescreate
144 | module.exports = function (originalArray) {
145 | var C;
146 | if (isArray(originalArray)) {
147 | C = originalArray.constructor;
148 | // cross-realm fallback
149 | if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
150 | else if (isObject(C)) {
151 | C = C[SPECIES];
152 | if (C === null) C = undefined;
153 | }
154 | } return C === undefined ? Array : C;
155 | };
156 |
157 |
158 | /***/ }),
159 |
160 | /***/ "0cb2":
161 | /***/ (function(module, exports, __webpack_require__) {
162 |
163 | var toObject = __webpack_require__("7b0b");
164 |
165 | var floor = Math.floor;
166 | var replace = ''.replace;
167 | var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
168 | var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
169 |
170 | // `GetSubstitution` abstract operation
171 | // https://tc39.es/ecma262/#sec-getsubstitution
172 | module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
173 | var tailPos = position + matched.length;
174 | var m = captures.length;
175 | var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
176 | if (namedCaptures !== undefined) {
177 | namedCaptures = toObject(namedCaptures);
178 | symbols = SUBSTITUTION_SYMBOLS;
179 | }
180 | return replace.call(replacement, symbols, function (match, ch) {
181 | var capture;
182 | switch (ch.charAt(0)) {
183 | case '$': return '$';
184 | case '&': return matched;
185 | case '`': return str.slice(0, position);
186 | case "'": return str.slice(tailPos);
187 | case '<':
188 | capture = namedCaptures[ch.slice(1, -1)];
189 | break;
190 | default: // \d\d?
191 | var n = +ch;
192 | if (n === 0) return match;
193 | if (n > m) {
194 | var f = floor(n / 10);
195 | if (f === 0) return match;
196 | if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
197 | return match;
198 | }
199 | capture = captures[n - 1];
200 | }
201 | return capture === undefined ? '' : capture;
202 | });
203 | };
204 |
205 |
206 | /***/ }),
207 |
208 | /***/ "0cfb":
209 | /***/ (function(module, exports, __webpack_require__) {
210 |
211 | var DESCRIPTORS = __webpack_require__("83ab");
212 | var fails = __webpack_require__("d039");
213 | var createElement = __webpack_require__("cc12");
214 |
215 | // Thank's IE8 for his funny defineProperty
216 | module.exports = !DESCRIPTORS && !fails(function () {
217 | // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
218 | return Object.defineProperty(createElement('div'), 'a', {
219 | get: function () { return 7; }
220 | }).a != 7;
221 | });
222 |
223 |
224 | /***/ }),
225 |
226 | /***/ "107c":
227 | /***/ (function(module, exports, __webpack_require__) {
228 |
229 | var fails = __webpack_require__("d039");
230 | var global = __webpack_require__("da84");
231 |
232 | // babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError
233 | var $RegExp = global.RegExp;
234 |
235 | module.exports = fails(function () {
236 | var re = $RegExp('(?b)', 'g');
237 | return re.exec('b').groups.a !== 'b' ||
238 | 'b'.replace(re, '$c') !== 'bc';
239 | });
240 |
241 |
242 | /***/ }),
243 |
244 | /***/ "14c3":
245 | /***/ (function(module, exports, __webpack_require__) {
246 |
247 | var classof = __webpack_require__("c6b6");
248 | var regexpExec = __webpack_require__("9263");
249 |
250 | // `RegExpExec` abstract operation
251 | // https://tc39.es/ecma262/#sec-regexpexec
252 | module.exports = function (R, S) {
253 | var exec = R.exec;
254 | if (typeof exec === 'function') {
255 | var result = exec.call(R, S);
256 | if (typeof result !== 'object') {
257 | throw TypeError('RegExp exec method returned something other than an Object or null');
258 | }
259 | return result;
260 | }
261 |
262 | if (classof(R) !== 'RegExp') {
263 | throw TypeError('RegExp#exec called on incompatible receiver');
264 | }
265 |
266 | return regexpExec.call(R, S);
267 | };
268 |
269 |
270 |
271 | /***/ }),
272 |
273 | /***/ "1be4":
274 | /***/ (function(module, exports, __webpack_require__) {
275 |
276 | var getBuiltIn = __webpack_require__("d066");
277 |
278 | module.exports = getBuiltIn('document', 'documentElement');
279 |
280 |
281 | /***/ }),
282 |
283 | /***/ "1d80":
284 | /***/ (function(module, exports) {
285 |
286 | // `RequireObjectCoercible` abstract operation
287 | // https://tc39.es/ecma262/#sec-requireobjectcoercible
288 | module.exports = function (it) {
289 | if (it == undefined) throw TypeError("Can't call method on " + it);
290 | return it;
291 | };
292 |
293 |
294 | /***/ }),
295 |
296 | /***/ "1dde":
297 | /***/ (function(module, exports, __webpack_require__) {
298 |
299 | var fails = __webpack_require__("d039");
300 | var wellKnownSymbol = __webpack_require__("b622");
301 | var V8_VERSION = __webpack_require__("2d00");
302 |
303 | var SPECIES = wellKnownSymbol('species');
304 |
305 | module.exports = function (METHOD_NAME) {
306 | // We can't use this feature detection in V8 since it causes
307 | // deoptimization and serious performance degradation
308 | // https://github.com/zloirock/core-js/issues/677
309 | return V8_VERSION >= 51 || !fails(function () {
310 | var array = [];
311 | var constructor = array.constructor = {};
312 | constructor[SPECIES] = function () {
313 | return { foo: 1 };
314 | };
315 | return array[METHOD_NAME](Boolean).foo !== 1;
316 | });
317 | };
318 |
319 |
320 | /***/ }),
321 |
322 | /***/ "23cb":
323 | /***/ (function(module, exports, __webpack_require__) {
324 |
325 | var toInteger = __webpack_require__("a691");
326 |
327 | var max = Math.max;
328 | var min = Math.min;
329 |
330 | // Helper for a popular repeating case of the spec:
331 | // Let integer be ? ToInteger(index).
332 | // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
333 | module.exports = function (index, length) {
334 | var integer = toInteger(index);
335 | return integer < 0 ? max(integer + length, 0) : min(integer, length);
336 | };
337 |
338 |
339 | /***/ }),
340 |
341 | /***/ "23e7":
342 | /***/ (function(module, exports, __webpack_require__) {
343 |
344 | var global = __webpack_require__("da84");
345 | var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
346 | var createNonEnumerableProperty = __webpack_require__("9112");
347 | var redefine = __webpack_require__("6eeb");
348 | var setGlobal = __webpack_require__("ce4e");
349 | var copyConstructorProperties = __webpack_require__("e893");
350 | var isForced = __webpack_require__("94ca");
351 |
352 | /*
353 | options.target - name of the target object
354 | options.global - target is the global object
355 | options.stat - export as static methods of target
356 | options.proto - export as prototype methods of target
357 | options.real - real prototype method for the `pure` version
358 | options.forced - export even if the native feature is available
359 | options.bind - bind methods to the target, required for the `pure` version
360 | options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
361 | options.unsafe - use the simple assignment of property instead of delete + defineProperty
362 | options.sham - add a flag to not completely full polyfills
363 | options.enumerable - export as enumerable property
364 | options.noTargetGet - prevent calling a getter on target
365 | */
366 | module.exports = function (options, source) {
367 | var TARGET = options.target;
368 | var GLOBAL = options.global;
369 | var STATIC = options.stat;
370 | var FORCED, target, key, targetProperty, sourceProperty, descriptor;
371 | if (GLOBAL) {
372 | target = global;
373 | } else if (STATIC) {
374 | target = global[TARGET] || setGlobal(TARGET, {});
375 | } else {
376 | target = (global[TARGET] || {}).prototype;
377 | }
378 | if (target) for (key in source) {
379 | sourceProperty = source[key];
380 | if (options.noTargetGet) {
381 | descriptor = getOwnPropertyDescriptor(target, key);
382 | targetProperty = descriptor && descriptor.value;
383 | } else targetProperty = target[key];
384 | FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
385 | // contained in target
386 | if (!FORCED && targetProperty !== undefined) {
387 | if (typeof sourceProperty === typeof targetProperty) continue;
388 | copyConstructorProperties(sourceProperty, targetProperty);
389 | }
390 | // add a flag to not completely full polyfills
391 | if (options.sham || (targetProperty && targetProperty.sham)) {
392 | createNonEnumerableProperty(sourceProperty, 'sham', true);
393 | }
394 | // extend global
395 | redefine(target, key, sourceProperty, options);
396 | }
397 | };
398 |
399 |
400 | /***/ }),
401 |
402 | /***/ "241c":
403 | /***/ (function(module, exports, __webpack_require__) {
404 |
405 | var internalObjectKeys = __webpack_require__("ca84");
406 | var enumBugKeys = __webpack_require__("7839");
407 |
408 | var hiddenKeys = enumBugKeys.concat('length', 'prototype');
409 |
410 | // `Object.getOwnPropertyNames` method
411 | // https://tc39.es/ecma262/#sec-object.getownpropertynames
412 | // eslint-disable-next-line es/no-object-getownpropertynames -- safe
413 | exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
414 | return internalObjectKeys(O, hiddenKeys);
415 | };
416 |
417 |
418 | /***/ }),
419 |
420 | /***/ "25f0":
421 | /***/ (function(module, exports, __webpack_require__) {
422 |
423 | "use strict";
424 |
425 | var redefine = __webpack_require__("6eeb");
426 | var anObject = __webpack_require__("825a");
427 | var $toString = __webpack_require__("577e");
428 | var fails = __webpack_require__("d039");
429 | var flags = __webpack_require__("ad6d");
430 |
431 | var TO_STRING = 'toString';
432 | var RegExpPrototype = RegExp.prototype;
433 | var nativeToString = RegExpPrototype[TO_STRING];
434 |
435 | var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
436 | // FF44- RegExp#toString has a wrong name
437 | var INCORRECT_NAME = nativeToString.name != TO_STRING;
438 |
439 | // `RegExp.prototype.toString` method
440 | // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
441 | if (NOT_GENERIC || INCORRECT_NAME) {
442 | redefine(RegExp.prototype, TO_STRING, function toString() {
443 | var R = anObject(this);
444 | var p = $toString(R.source);
445 | var rf = R.flags;
446 | var f = $toString(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
447 | return '/' + p + '/' + f;
448 | }, { unsafe: true });
449 | }
450 |
451 |
452 | /***/ }),
453 |
454 | /***/ "2d00":
455 | /***/ (function(module, exports, __webpack_require__) {
456 |
457 | var global = __webpack_require__("da84");
458 | var userAgent = __webpack_require__("342f");
459 |
460 | var process = global.process;
461 | var Deno = global.Deno;
462 | var versions = process && process.versions || Deno && Deno.version;
463 | var v8 = versions && versions.v8;
464 | var match, version;
465 |
466 | if (v8) {
467 | match = v8.split('.');
468 | version = match[0] < 4 ? 1 : match[0] + match[1];
469 | } else if (userAgent) {
470 | match = userAgent.match(/Edge\/(\d+)/);
471 | if (!match || match[1] >= 74) {
472 | match = userAgent.match(/Chrome\/(\d+)/);
473 | if (match) version = match[1];
474 | }
475 | }
476 |
477 | module.exports = version && +version;
478 |
479 |
480 | /***/ }),
481 |
482 | /***/ "342f":
483 | /***/ (function(module, exports, __webpack_require__) {
484 |
485 | var getBuiltIn = __webpack_require__("d066");
486 |
487 | module.exports = getBuiltIn('navigator', 'userAgent') || '';
488 |
489 |
490 | /***/ }),
491 |
492 | /***/ "37e8":
493 | /***/ (function(module, exports, __webpack_require__) {
494 |
495 | var DESCRIPTORS = __webpack_require__("83ab");
496 | var definePropertyModule = __webpack_require__("9bf2");
497 | var anObject = __webpack_require__("825a");
498 | var objectKeys = __webpack_require__("df75");
499 |
500 | // `Object.defineProperties` method
501 | // https://tc39.es/ecma262/#sec-object.defineproperties
502 | // eslint-disable-next-line es/no-object-defineproperties -- safe
503 | module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
504 | anObject(O);
505 | var keys = objectKeys(Properties);
506 | var length = keys.length;
507 | var index = 0;
508 | var key;
509 | while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
510 | return O;
511 | };
512 |
513 |
514 | /***/ }),
515 |
516 | /***/ "44ad":
517 | /***/ (function(module, exports, __webpack_require__) {
518 |
519 | var fails = __webpack_require__("d039");
520 | var classof = __webpack_require__("c6b6");
521 |
522 | var split = ''.split;
523 |
524 | // fallback for non-array-like ES3 and non-enumerable old V8 strings
525 | module.exports = fails(function () {
526 | // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
527 | // eslint-disable-next-line no-prototype-builtins -- safe
528 | return !Object('z').propertyIsEnumerable(0);
529 | }) ? function (it) {
530 | return classof(it) == 'String' ? split.call(it, '') : Object(it);
531 | } : Object;
532 |
533 |
534 | /***/ }),
535 |
536 | /***/ "466d":
537 | /***/ (function(module, exports, __webpack_require__) {
538 |
539 | "use strict";
540 |
541 | var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
542 | var anObject = __webpack_require__("825a");
543 | var toLength = __webpack_require__("50c4");
544 | var toString = __webpack_require__("577e");
545 | var requireObjectCoercible = __webpack_require__("1d80");
546 | var advanceStringIndex = __webpack_require__("8aa5");
547 | var regExpExec = __webpack_require__("14c3");
548 |
549 | // @@match logic
550 | fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
551 | return [
552 | // `String.prototype.match` method
553 | // https://tc39.es/ecma262/#sec-string.prototype.match
554 | function match(regexp) {
555 | var O = requireObjectCoercible(this);
556 | var matcher = regexp == undefined ? undefined : regexp[MATCH];
557 | return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](toString(O));
558 | },
559 | // `RegExp.prototype[@@match]` method
560 | // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
561 | function (string) {
562 | var rx = anObject(this);
563 | var S = toString(string);
564 | var res = maybeCallNative(nativeMatch, rx, S);
565 |
566 | if (res.done) return res.value;
567 |
568 | if (!rx.global) return regExpExec(rx, S);
569 |
570 | var fullUnicode = rx.unicode;
571 | rx.lastIndex = 0;
572 | var A = [];
573 | var n = 0;
574 | var result;
575 | while ((result = regExpExec(rx, S)) !== null) {
576 | var matchStr = toString(result[0]);
577 | A[n] = matchStr;
578 | if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
579 | n++;
580 | }
581 | return n === 0 ? null : A;
582 | }
583 | ];
584 | });
585 |
586 |
587 | /***/ }),
588 |
589 | /***/ "485a":
590 | /***/ (function(module, exports, __webpack_require__) {
591 |
592 | var isObject = __webpack_require__("861d");
593 |
594 | // `OrdinaryToPrimitive` abstract operation
595 | // https://tc39.es/ecma262/#sec-ordinarytoprimitive
596 | module.exports = function (input, pref) {
597 | var fn, val;
598 | if (pref === 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
599 | if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
600 | if (pref !== 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
601 | throw TypeError("Can't convert object to primitive value");
602 | };
603 |
604 |
605 | /***/ }),
606 |
607 | /***/ "4930":
608 | /***/ (function(module, exports, __webpack_require__) {
609 |
610 | /* eslint-disable es/no-symbol -- required for testing */
611 | var V8_VERSION = __webpack_require__("2d00");
612 | var fails = __webpack_require__("d039");
613 |
614 | // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
615 | module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
616 | var symbol = Symbol();
617 | // Chrome 38 Symbol has incorrect toString conversion
618 | // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
619 | return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
620 | // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
621 | !Symbol.sham && V8_VERSION && V8_VERSION < 41;
622 | });
623 |
624 |
625 | /***/ }),
626 |
627 | /***/ "4d64":
628 | /***/ (function(module, exports, __webpack_require__) {
629 |
630 | var toIndexedObject = __webpack_require__("fc6a");
631 | var toLength = __webpack_require__("50c4");
632 | var toAbsoluteIndex = __webpack_require__("23cb");
633 |
634 | // `Array.prototype.{ indexOf, includes }` methods implementation
635 | var createMethod = function (IS_INCLUDES) {
636 | return function ($this, el, fromIndex) {
637 | var O = toIndexedObject($this);
638 | var length = toLength(O.length);
639 | var index = toAbsoluteIndex(fromIndex, length);
640 | var value;
641 | // Array#includes uses SameValueZero equality algorithm
642 | // eslint-disable-next-line no-self-compare -- NaN check
643 | if (IS_INCLUDES && el != el) while (length > index) {
644 | value = O[index++];
645 | // eslint-disable-next-line no-self-compare -- NaN check
646 | if (value != value) return true;
647 | // Array#indexOf ignores holes, Array#includes - not
648 | } else for (;length > index; index++) {
649 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
650 | } return !IS_INCLUDES && -1;
651 | };
652 | };
653 |
654 | module.exports = {
655 | // `Array.prototype.includes` method
656 | // https://tc39.es/ecma262/#sec-array.prototype.includes
657 | includes: createMethod(true),
658 | // `Array.prototype.indexOf` method
659 | // https://tc39.es/ecma262/#sec-array.prototype.indexof
660 | indexOf: createMethod(false)
661 | };
662 |
663 |
664 | /***/ }),
665 |
666 | /***/ "50c4":
667 | /***/ (function(module, exports, __webpack_require__) {
668 |
669 | var toInteger = __webpack_require__("a691");
670 |
671 | var min = Math.min;
672 |
673 | // `ToLength` abstract operation
674 | // https://tc39.es/ecma262/#sec-tolength
675 | module.exports = function (argument) {
676 | return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
677 | };
678 |
679 |
680 | /***/ }),
681 |
682 | /***/ "5135":
683 | /***/ (function(module, exports, __webpack_require__) {
684 |
685 | var toObject = __webpack_require__("7b0b");
686 |
687 | var hasOwnProperty = {}.hasOwnProperty;
688 |
689 | module.exports = Object.hasOwn || function hasOwn(it, key) {
690 | return hasOwnProperty.call(toObject(it), key);
691 | };
692 |
693 |
694 | /***/ }),
695 |
696 | /***/ "5319":
697 | /***/ (function(module, exports, __webpack_require__) {
698 |
699 | "use strict";
700 |
701 | var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
702 | var fails = __webpack_require__("d039");
703 | var anObject = __webpack_require__("825a");
704 | var toInteger = __webpack_require__("a691");
705 | var toLength = __webpack_require__("50c4");
706 | var toString = __webpack_require__("577e");
707 | var requireObjectCoercible = __webpack_require__("1d80");
708 | var advanceStringIndex = __webpack_require__("8aa5");
709 | var getSubstitution = __webpack_require__("0cb2");
710 | var regExpExec = __webpack_require__("14c3");
711 | var wellKnownSymbol = __webpack_require__("b622");
712 |
713 | var REPLACE = wellKnownSymbol('replace');
714 | var max = Math.max;
715 | var min = Math.min;
716 |
717 | var maybeToString = function (it) {
718 | return it === undefined ? it : String(it);
719 | };
720 |
721 | // IE <= 11 replaces $0 with the whole match, as if it was $&
722 | // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
723 | var REPLACE_KEEPS_$0 = (function () {
724 | // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
725 | return 'a'.replace(/./, '$0') === '$0';
726 | })();
727 |
728 | // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
729 | var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
730 | if (/./[REPLACE]) {
731 | return /./[REPLACE]('a', '$0') === '';
732 | }
733 | return false;
734 | })();
735 |
736 | var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
737 | var re = /./;
738 | re.exec = function () {
739 | var result = [];
740 | result.groups = { a: '7' };
741 | return result;
742 | };
743 | // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
744 | return ''.replace(re, '$') !== '7';
745 | });
746 |
747 | // @@replace logic
748 | fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
749 | var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
750 |
751 | return [
752 | // `String.prototype.replace` method
753 | // https://tc39.es/ecma262/#sec-string.prototype.replace
754 | function replace(searchValue, replaceValue) {
755 | var O = requireObjectCoercible(this);
756 | var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
757 | return replacer !== undefined
758 | ? replacer.call(searchValue, O, replaceValue)
759 | : nativeReplace.call(toString(O), searchValue, replaceValue);
760 | },
761 | // `RegExp.prototype[@@replace]` method
762 | // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
763 | function (string, replaceValue) {
764 | var rx = anObject(this);
765 | var S = toString(string);
766 |
767 | if (
768 | typeof replaceValue === 'string' &&
769 | replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1 &&
770 | replaceValue.indexOf('$<') === -1
771 | ) {
772 | var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
773 | if (res.done) return res.value;
774 | }
775 |
776 | var functionalReplace = typeof replaceValue === 'function';
777 | if (!functionalReplace) replaceValue = toString(replaceValue);
778 |
779 | var global = rx.global;
780 | if (global) {
781 | var fullUnicode = rx.unicode;
782 | rx.lastIndex = 0;
783 | }
784 | var results = [];
785 | while (true) {
786 | var result = regExpExec(rx, S);
787 | if (result === null) break;
788 |
789 | results.push(result);
790 | if (!global) break;
791 |
792 | var matchStr = toString(result[0]);
793 | if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
794 | }
795 |
796 | var accumulatedResult = '';
797 | var nextSourcePosition = 0;
798 | for (var i = 0; i < results.length; i++) {
799 | result = results[i];
800 |
801 | var matched = toString(result[0]);
802 | var position = max(min(toInteger(result.index), S.length), 0);
803 | var captures = [];
804 | // NOTE: This is equivalent to
805 | // captures = result.slice(1).map(maybeToString)
806 | // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
807 | // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
808 | // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
809 | for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
810 | var namedCaptures = result.groups;
811 | if (functionalReplace) {
812 | var replacerArgs = [matched].concat(captures, position, S);
813 | if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
814 | var replacement = toString(replaceValue.apply(undefined, replacerArgs));
815 | } else {
816 | replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
817 | }
818 | if (position >= nextSourcePosition) {
819 | accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
820 | nextSourcePosition = position + matched.length;
821 | }
822 | }
823 | return accumulatedResult + S.slice(nextSourcePosition);
824 | }
825 | ];
826 | }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
827 |
828 |
829 | /***/ }),
830 |
831 | /***/ "5692":
832 | /***/ (function(module, exports, __webpack_require__) {
833 |
834 | var IS_PURE = __webpack_require__("c430");
835 | var store = __webpack_require__("c6cd");
836 |
837 | (module.exports = function (key, value) {
838 | return store[key] || (store[key] = value !== undefined ? value : {});
839 | })('versions', []).push({
840 | version: '3.17.2',
841 | mode: IS_PURE ? 'pure' : 'global',
842 | copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
843 | });
844 |
845 |
846 | /***/ }),
847 |
848 | /***/ "56ef":
849 | /***/ (function(module, exports, __webpack_require__) {
850 |
851 | var getBuiltIn = __webpack_require__("d066");
852 | var getOwnPropertyNamesModule = __webpack_require__("241c");
853 | var getOwnPropertySymbolsModule = __webpack_require__("7418");
854 | var anObject = __webpack_require__("825a");
855 |
856 | // all object keys, includes non-enumerable and symbols
857 | module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
858 | var keys = getOwnPropertyNamesModule.f(anObject(it));
859 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
860 | return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
861 | };
862 |
863 |
864 | /***/ }),
865 |
866 | /***/ "577e":
867 | /***/ (function(module, exports, __webpack_require__) {
868 |
869 | var isSymbol = __webpack_require__("d9b5");
870 |
871 | module.exports = function (argument) {
872 | if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a string');
873 | return String(argument);
874 | };
875 |
876 |
877 | /***/ }),
878 |
879 | /***/ "5c6c":
880 | /***/ (function(module, exports) {
881 |
882 | module.exports = function (bitmap, value) {
883 | return {
884 | enumerable: !(bitmap & 1),
885 | configurable: !(bitmap & 2),
886 | writable: !(bitmap & 4),
887 | value: value
888 | };
889 | };
890 |
891 |
892 | /***/ }),
893 |
894 | /***/ "6547":
895 | /***/ (function(module, exports, __webpack_require__) {
896 |
897 | var toInteger = __webpack_require__("a691");
898 | var toString = __webpack_require__("577e");
899 | var requireObjectCoercible = __webpack_require__("1d80");
900 |
901 | // `String.prototype.codePointAt` methods implementation
902 | var createMethod = function (CONVERT_TO_STRING) {
903 | return function ($this, pos) {
904 | var S = toString(requireObjectCoercible($this));
905 | var position = toInteger(pos);
906 | var size = S.length;
907 | var first, second;
908 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
909 | first = S.charCodeAt(position);
910 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
911 | || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
912 | ? CONVERT_TO_STRING ? S.charAt(position) : first
913 | : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
914 | };
915 | };
916 |
917 | module.exports = {
918 | // `String.prototype.codePointAt` method
919 | // https://tc39.es/ecma262/#sec-string.prototype.codepointat
920 | codeAt: createMethod(false),
921 | // `String.prototype.at` method
922 | // https://github.com/mathiasbynens/String.prototype.at
923 | charAt: createMethod(true)
924 | };
925 |
926 |
927 | /***/ }),
928 |
929 | /***/ "65f0":
930 | /***/ (function(module, exports, __webpack_require__) {
931 |
932 | var arraySpeciesConstructor = __webpack_require__("0b42");
933 |
934 | // `ArraySpeciesCreate` abstract operation
935 | // https://tc39.es/ecma262/#sec-arrayspeciescreate
936 | module.exports = function (originalArray, length) {
937 | return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
938 | };
939 |
940 |
941 | /***/ }),
942 |
943 | /***/ "69f3":
944 | /***/ (function(module, exports, __webpack_require__) {
945 |
946 | var NATIVE_WEAK_MAP = __webpack_require__("7f9a");
947 | var global = __webpack_require__("da84");
948 | var isObject = __webpack_require__("861d");
949 | var createNonEnumerableProperty = __webpack_require__("9112");
950 | var objectHas = __webpack_require__("5135");
951 | var shared = __webpack_require__("c6cd");
952 | var sharedKey = __webpack_require__("f772");
953 | var hiddenKeys = __webpack_require__("d012");
954 |
955 | var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
956 | var WeakMap = global.WeakMap;
957 | var set, get, has;
958 |
959 | var enforce = function (it) {
960 | return has(it) ? get(it) : set(it, {});
961 | };
962 |
963 | var getterFor = function (TYPE) {
964 | return function (it) {
965 | var state;
966 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
967 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
968 | } return state;
969 | };
970 | };
971 |
972 | if (NATIVE_WEAK_MAP || shared.state) {
973 | var store = shared.state || (shared.state = new WeakMap());
974 | var wmget = store.get;
975 | var wmhas = store.has;
976 | var wmset = store.set;
977 | set = function (it, metadata) {
978 | if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
979 | metadata.facade = it;
980 | wmset.call(store, it, metadata);
981 | return metadata;
982 | };
983 | get = function (it) {
984 | return wmget.call(store, it) || {};
985 | };
986 | has = function (it) {
987 | return wmhas.call(store, it);
988 | };
989 | } else {
990 | var STATE = sharedKey('state');
991 | hiddenKeys[STATE] = true;
992 | set = function (it, metadata) {
993 | if (objectHas(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
994 | metadata.facade = it;
995 | createNonEnumerableProperty(it, STATE, metadata);
996 | return metadata;
997 | };
998 | get = function (it) {
999 | return objectHas(it, STATE) ? it[STATE] : {};
1000 | };
1001 | has = function (it) {
1002 | return objectHas(it, STATE);
1003 | };
1004 | }
1005 |
1006 | module.exports = {
1007 | set: set,
1008 | get: get,
1009 | has: has,
1010 | enforce: enforce,
1011 | getterFor: getterFor
1012 | };
1013 |
1014 |
1015 | /***/ }),
1016 |
1017 | /***/ "6eeb":
1018 | /***/ (function(module, exports, __webpack_require__) {
1019 |
1020 | var global = __webpack_require__("da84");
1021 | var createNonEnumerableProperty = __webpack_require__("9112");
1022 | var has = __webpack_require__("5135");
1023 | var setGlobal = __webpack_require__("ce4e");
1024 | var inspectSource = __webpack_require__("8925");
1025 | var InternalStateModule = __webpack_require__("69f3");
1026 |
1027 | var getInternalState = InternalStateModule.get;
1028 | var enforceInternalState = InternalStateModule.enforce;
1029 | var TEMPLATE = String(String).split('String');
1030 |
1031 | (module.exports = function (O, key, value, options) {
1032 | var unsafe = options ? !!options.unsafe : false;
1033 | var simple = options ? !!options.enumerable : false;
1034 | var noTargetGet = options ? !!options.noTargetGet : false;
1035 | var state;
1036 | if (typeof value == 'function') {
1037 | if (typeof key == 'string' && !has(value, 'name')) {
1038 | createNonEnumerableProperty(value, 'name', key);
1039 | }
1040 | state = enforceInternalState(value);
1041 | if (!state.source) {
1042 | state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
1043 | }
1044 | }
1045 | if (O === global) {
1046 | if (simple) O[key] = value;
1047 | else setGlobal(key, value);
1048 | return;
1049 | } else if (!unsafe) {
1050 | delete O[key];
1051 | } else if (!noTargetGet && O[key]) {
1052 | simple = true;
1053 | }
1054 | if (simple) O[key] = value;
1055 | else createNonEnumerableProperty(O, key, value);
1056 | // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
1057 | })(Function.prototype, 'toString', function toString() {
1058 | return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
1059 | });
1060 |
1061 |
1062 | /***/ }),
1063 |
1064 | /***/ "7418":
1065 | /***/ (function(module, exports) {
1066 |
1067 | // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
1068 | exports.f = Object.getOwnPropertySymbols;
1069 |
1070 |
1071 | /***/ }),
1072 |
1073 | /***/ "7839":
1074 | /***/ (function(module, exports) {
1075 |
1076 | // IE8- don't enum bug keys
1077 | module.exports = [
1078 | 'constructor',
1079 | 'hasOwnProperty',
1080 | 'isPrototypeOf',
1081 | 'propertyIsEnumerable',
1082 | 'toLocaleString',
1083 | 'toString',
1084 | 'valueOf'
1085 | ];
1086 |
1087 |
1088 | /***/ }),
1089 |
1090 | /***/ "7b0b":
1091 | /***/ (function(module, exports, __webpack_require__) {
1092 |
1093 | var requireObjectCoercible = __webpack_require__("1d80");
1094 |
1095 | // `ToObject` abstract operation
1096 | // https://tc39.es/ecma262/#sec-toobject
1097 | module.exports = function (argument) {
1098 | return Object(requireObjectCoercible(argument));
1099 | };
1100 |
1101 |
1102 | /***/ }),
1103 |
1104 | /***/ "7c73":
1105 | /***/ (function(module, exports, __webpack_require__) {
1106 |
1107 | /* global ActiveXObject -- old IE, WSH */
1108 | var anObject = __webpack_require__("825a");
1109 | var defineProperties = __webpack_require__("37e8");
1110 | var enumBugKeys = __webpack_require__("7839");
1111 | var hiddenKeys = __webpack_require__("d012");
1112 | var html = __webpack_require__("1be4");
1113 | var documentCreateElement = __webpack_require__("cc12");
1114 | var sharedKey = __webpack_require__("f772");
1115 |
1116 | var GT = '>';
1117 | var LT = '<';
1118 | var PROTOTYPE = 'prototype';
1119 | var SCRIPT = 'script';
1120 | var IE_PROTO = sharedKey('IE_PROTO');
1121 |
1122 | var EmptyConstructor = function () { /* empty */ };
1123 |
1124 | var scriptTag = function (content) {
1125 | return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1126 | };
1127 |
1128 | // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1129 | var NullProtoObjectViaActiveX = function (activeXDocument) {
1130 | activeXDocument.write(scriptTag(''));
1131 | activeXDocument.close();
1132 | var temp = activeXDocument.parentWindow.Object;
1133 | activeXDocument = null; // avoid memory leak
1134 | return temp;
1135 | };
1136 |
1137 | // Create object with fake `null` prototype: use iframe Object with cleared prototype
1138 | var NullProtoObjectViaIFrame = function () {
1139 | // Thrash, waste and sodomy: IE GC bug
1140 | var iframe = documentCreateElement('iframe');
1141 | var JS = 'java' + SCRIPT + ':';
1142 | var iframeDocument;
1143 | iframe.style.display = 'none';
1144 | html.appendChild(iframe);
1145 | // https://github.com/zloirock/core-js/issues/475
1146 | iframe.src = String(JS);
1147 | iframeDocument = iframe.contentWindow.document;
1148 | iframeDocument.open();
1149 | iframeDocument.write(scriptTag('document.F=Object'));
1150 | iframeDocument.close();
1151 | return iframeDocument.F;
1152 | };
1153 |
1154 | // Check for document.domain and active x support
1155 | // No need to use active x approach when document.domain is not set
1156 | // see https://github.com/es-shims/es5-shim/issues/150
1157 | // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1158 | // avoid IE GC bug
1159 | var activeXDocument;
1160 | var NullProtoObject = function () {
1161 | try {
1162 | activeXDocument = new ActiveXObject('htmlfile');
1163 | } catch (error) { /* ignore */ }
1164 | NullProtoObject = typeof document != 'undefined'
1165 | ? document.domain && activeXDocument
1166 | ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1167 | : NullProtoObjectViaIFrame()
1168 | : NullProtoObjectViaActiveX(activeXDocument); // WSH
1169 | var length = enumBugKeys.length;
1170 | while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1171 | return NullProtoObject();
1172 | };
1173 |
1174 | hiddenKeys[IE_PROTO] = true;
1175 |
1176 | // `Object.create` method
1177 | // https://tc39.es/ecma262/#sec-object.create
1178 | module.exports = Object.create || function create(O, Properties) {
1179 | var result;
1180 | if (O !== null) {
1181 | EmptyConstructor[PROTOTYPE] = anObject(O);
1182 | result = new EmptyConstructor();
1183 | EmptyConstructor[PROTOTYPE] = null;
1184 | // add "__proto__" for Object.getPrototypeOf polyfill
1185 | result[IE_PROTO] = O;
1186 | } else result = NullProtoObject();
1187 | return Properties === undefined ? result : defineProperties(result, Properties);
1188 | };
1189 |
1190 |
1191 | /***/ }),
1192 |
1193 | /***/ "7f9a":
1194 | /***/ (function(module, exports, __webpack_require__) {
1195 |
1196 | var global = __webpack_require__("da84");
1197 | var inspectSource = __webpack_require__("8925");
1198 |
1199 | var WeakMap = global.WeakMap;
1200 |
1201 | module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
1202 |
1203 |
1204 | /***/ }),
1205 |
1206 | /***/ "825a":
1207 | /***/ (function(module, exports, __webpack_require__) {
1208 |
1209 | var isObject = __webpack_require__("861d");
1210 |
1211 | module.exports = function (it) {
1212 | if (!isObject(it)) {
1213 | throw TypeError(String(it) + ' is not an object');
1214 | } return it;
1215 | };
1216 |
1217 |
1218 | /***/ }),
1219 |
1220 | /***/ "83ab":
1221 | /***/ (function(module, exports, __webpack_require__) {
1222 |
1223 | var fails = __webpack_require__("d039");
1224 |
1225 | // Detect IE8's incomplete defineProperty implementation
1226 | module.exports = !fails(function () {
1227 | // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1228 | return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
1229 | });
1230 |
1231 |
1232 | /***/ }),
1233 |
1234 | /***/ "8418":
1235 | /***/ (function(module, exports, __webpack_require__) {
1236 |
1237 | "use strict";
1238 |
1239 | var toPropertyKey = __webpack_require__("a04b");
1240 | var definePropertyModule = __webpack_require__("9bf2");
1241 | var createPropertyDescriptor = __webpack_require__("5c6c");
1242 |
1243 | module.exports = function (object, key, value) {
1244 | var propertyKey = toPropertyKey(key);
1245 | if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
1246 | else object[propertyKey] = value;
1247 | };
1248 |
1249 |
1250 | /***/ }),
1251 |
1252 | /***/ "861d":
1253 | /***/ (function(module, exports) {
1254 |
1255 | module.exports = function (it) {
1256 | return typeof it === 'object' ? it !== null : typeof it === 'function';
1257 | };
1258 |
1259 |
1260 | /***/ }),
1261 |
1262 | /***/ "8875":
1263 | /***/ (function(module, exports, __webpack_require__) {
1264 |
1265 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller
1266 | // MIT license
1267 | // source: https://github.com/amiller-gh/currentScript-polyfill
1268 |
1269 | // added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505
1270 |
1271 | (function (root, factory) {
1272 | if (true) {
1273 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
1274 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
1275 | (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
1276 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
1277 | } else {}
1278 | }(typeof self !== 'undefined' ? self : this, function () {
1279 | function getCurrentScript () {
1280 | if (document.currentScript) {
1281 | return document.currentScript
1282 | }
1283 |
1284 | // IE 8-10 support script readyState
1285 | // IE 11+ & Firefox support stack trace
1286 | try {
1287 | throw new Error();
1288 | }
1289 | catch (err) {
1290 | // Find the second match for the "at" string to get file src url from stack.
1291 | var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig,
1292 | ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig,
1293 | stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),
1294 | scriptLocation = (stackDetails && stackDetails[1]) || false,
1295 | line = (stackDetails && stackDetails[2]) || false,
1296 | currentLocation = document.location.href.replace(document.location.hash, ''),
1297 | pageSource,
1298 | inlineScriptSourceRegExp,
1299 | inlineScriptSource,
1300 | scripts = document.getElementsByTagName('script'); // Live NodeList collection
1301 |
1302 | if (scriptLocation === currentLocation) {
1303 | pageSource = document.documentElement.outerHTML;
1304 | inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]*
3 |
4 |
5 |
6 |
{{ msg }}
7 |
{{ $browserDetect }}
8 |
9 |
10 |
19 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | const VueBrowserDetect = {
2 | install: Vue => {
3 | let ua = window.navigator.userAgent;
4 | let browserObj = {};
5 |
6 | // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
7 | browserObj.isOpera =
8 | !!window.opera || navigator.userAgent.indexOf(" OPR/") >= 0;
9 | // Firefox 1.0+
10 | browserObj.isEdge = /Edg/.test(navigator.userAgent);
11 | browserObj.isFirefox = /Firefox/.test(navigator.userAgent);
12 | // Safari 3.0+
13 | /*eslint-disable */
14 | browserObj.isSafari =
15 | /constructor/i.test(window.HTMLElement) ||
16 | (function(p) {
17 | return p.toString() === "[object SafariRemoteNotification]";
18 | })(!window["safari"] || safari.pushNotification);
19 | /*eslint-ensable */
20 | // Internet Explorer 6-11
21 | browserObj.isIE = /*@cc_on!@*/ false || !!document.documentMode;
22 | // Edge 20+
23 |
24 | browserObj.isChrome = /Google Inc/.test(navigator.vendor) && !browserObj.isEdge;
25 | browserObj.isChromeIOS = /CriOS/.test(navigator.userAgent);
26 | browserObj.isIOS =
27 | /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
28 |
29 | browserObj.isBrave = (typeof navigator.brave !== "undefined");
30 |
31 | browserObj.meta = browserSpecs();
32 | browserObj.meta.ua = ua;
33 |
34 | function browserSpecs() {
35 | /**
36 | * https://stackoverflow.com/questions/5916900/how-can-you-detect-the-version-of-a-browser
37 | */
38 | var tem,
39 | M =
40 | ua.match(
41 | /(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i
42 | ) || [];
43 | if (/trident/i.test(M[1])) {
44 | tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
45 | return { name: "IE", version: tem[1] || "" };
46 | }
47 | if (M[1] === "Chrome") {
48 | tem = ua.match(/\b(OPR|Edge)\/(\d+)/);
49 | if (tem != null)
50 | return { name: tem[1].replace("OPR", "Opera"), version: tem[2] };
51 | }
52 | M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, "-?"];
53 | if ((tem = ua.match(/version\/(\d+)/i)) != null) M.splice(1, 1, tem[1]);
54 | return { name: M[0], version: M[1] };
55 | }
56 |
57 | Vue.prototype.$browserDetect = browserObj;
58 | }
59 | };
60 |
61 | export default VueBrowserDetect;
62 |
63 | if (typeof window !== "undefined" && window.Vue) {
64 | window.Vue.use(VueBrowserDetect);
65 | }
66 |
--------------------------------------------------------------------------------