native-fn 1.0.47 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/native.cjs +150 -70
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +150 -70
- package/dist/native.umd.js +150 -70
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +170 -69
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +170 -69
- package/dist/plugin/app/index.umd.js +170 -69
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/types/platform.d.ts +3 -1
- package/dist/plugin/camera/index.cjs +149 -69
- package/dist/plugin/camera/index.min.cjs +1 -1
- package/dist/plugin/camera/index.min.mjs +1 -1
- package/dist/plugin/camera/index.mjs +149 -69
- package/dist/plugin/camera/index.umd.js +149 -69
- package/dist/plugin/camera/index.umd.min.js +1 -1
- package/dist/plugin/camera/src/types/platform.d.ts +3 -1
- package/dist/plugin/clipboard/src/types/platform.d.ts +3 -1
- package/dist/plugin/fullscreen/index.cjs +149 -69
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +149 -69
- package/dist/plugin/fullscreen/index.umd.js +149 -69
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/types/platform.d.ts +3 -1
- package/dist/plugin/theme/index.cjs +149 -69
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +149 -69
- package/dist/plugin/theme/index.umd.js +149 -69
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/types/platform.d.ts +3 -1
- package/dist/src/types/platform.d.ts +3 -1
- package/package.json +1 -1
|
@@ -37,6 +37,7 @@ var Browsers;
|
|
|
37
37
|
Browsers["IE"] = "IE";
|
|
38
38
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
39
39
|
})(Browsers || (Browsers = {}));
|
|
40
|
+
var userAgent = typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' ? navigator.userAgent : '';
|
|
40
41
|
var Platform = {
|
|
41
42
|
device: Devices.Unknown,
|
|
42
43
|
os: OS.Unknown,
|
|
@@ -46,12 +47,14 @@ var Platform = {
|
|
|
46
47
|
browser: Browsers.Unknown,
|
|
47
48
|
browserVersion: '',
|
|
48
49
|
renderer: getRenderer(),
|
|
49
|
-
userAgent:
|
|
50
|
-
isWebview: false,
|
|
50
|
+
userAgent: userAgent,
|
|
51
51
|
isMobile: false,
|
|
52
52
|
isDesktop: false,
|
|
53
53
|
isStandalone: false,
|
|
54
|
-
|
|
54
|
+
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(userAgent),
|
|
55
|
+
isNodeJS: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
|
|
56
|
+
isElectron: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined,
|
|
57
|
+
isReactNative: typeof navigator !== 'undefined' && navigator.product === 'ReactNative'
|
|
55
58
|
};
|
|
56
59
|
var OS_RESOLVER_MAP = [
|
|
57
60
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -138,6 +141,137 @@ function resolveUnderscoreVersion(string) {
|
|
|
138
141
|
return '';
|
|
139
142
|
return string.replace(/_/g, '.');
|
|
140
143
|
}
|
|
144
|
+
function resolveSemanticWindowsVersion(version, defaultValue) {
|
|
145
|
+
if (version.major === 10 && version.minor === 0 && version.build >= 22000)
|
|
146
|
+
return '11';
|
|
147
|
+
if (version.major === 10 && version.minor === 0 && version.build < 22000)
|
|
148
|
+
return '10';
|
|
149
|
+
if (version.major === 6 && version.minor === 3)
|
|
150
|
+
return '8.1';
|
|
151
|
+
if (version.major === 6 && version.minor === 2)
|
|
152
|
+
return '8';
|
|
153
|
+
if (version.major === 6 && version.minor === 1)
|
|
154
|
+
return '7';
|
|
155
|
+
if (version.major === 6 && version.minor === 0)
|
|
156
|
+
return 'Vista';
|
|
157
|
+
if (version.major === 5 && version.minor === 1)
|
|
158
|
+
return 'XP';
|
|
159
|
+
if (version.major === 5 && version.minor === 2)
|
|
160
|
+
return 'XP';
|
|
161
|
+
if (version.major === 5 && version.minor === 0)
|
|
162
|
+
return '2000';
|
|
163
|
+
if (version.major === 4 && version.minor === 90)
|
|
164
|
+
return 'ME';
|
|
165
|
+
if (version.major === 4 && version.minor === 0)
|
|
166
|
+
return 'NT 4.0';
|
|
167
|
+
if (version.major === 3 && version.minor === 51)
|
|
168
|
+
return 'NT 3.11';
|
|
169
|
+
return defaultValue;
|
|
170
|
+
}
|
|
171
|
+
function resolveSemanticDarwinVersion(version, defaultValue) {
|
|
172
|
+
if (version.major >= 24)
|
|
173
|
+
return '' + (version.major - 9) + '.' + version.minor + '.' + version.build;
|
|
174
|
+
if (version.major === 23)
|
|
175
|
+
return '14.' + version.minor + '.' + version.build;
|
|
176
|
+
if (version.major === 22)
|
|
177
|
+
return '13.' + version.minor + '.' + version.build;
|
|
178
|
+
if (version.major === 21)
|
|
179
|
+
return '12.' + version.minor + '.' + version.build;
|
|
180
|
+
if (version.major === 20)
|
|
181
|
+
return '11.' + version.minor + '.' + version.build;
|
|
182
|
+
if (version.major === 19)
|
|
183
|
+
return '10.15.' + version.minor;
|
|
184
|
+
if (version.major === 18)
|
|
185
|
+
return '10.14.' + version.minor;
|
|
186
|
+
if (version.major === 17)
|
|
187
|
+
return '10.13.' + version.minor;
|
|
188
|
+
if (version.major === 16)
|
|
189
|
+
return '10.12.' + version.minor;
|
|
190
|
+
if (version.major === 15)
|
|
191
|
+
return '10.11.' + version.minor;
|
|
192
|
+
if (version.major === 14)
|
|
193
|
+
return '10.10.' + version.minor;
|
|
194
|
+
if (version.major === 13)
|
|
195
|
+
return '10.9.' + version.minor;
|
|
196
|
+
if (version.major >= 5 && version.major <= 12)
|
|
197
|
+
return '10.' + (version.major - 4) + '.' + version.minor;
|
|
198
|
+
return defaultValue;
|
|
199
|
+
}
|
|
200
|
+
function resolveSemanticAndroidVersion(version, defaultValue) {
|
|
201
|
+
if (version.major >= 36)
|
|
202
|
+
return '16';
|
|
203
|
+
if (version.major === 35)
|
|
204
|
+
return '15';
|
|
205
|
+
if (version.major === 34)
|
|
206
|
+
return '14';
|
|
207
|
+
if (version.major === 33)
|
|
208
|
+
return '13';
|
|
209
|
+
if (version.major === 32)
|
|
210
|
+
return '12.1';
|
|
211
|
+
if (version.major === 31)
|
|
212
|
+
return '12';
|
|
213
|
+
if (version.major === 30)
|
|
214
|
+
return '11';
|
|
215
|
+
if (version.major === 29)
|
|
216
|
+
return '10';
|
|
217
|
+
if (version.major === 28)
|
|
218
|
+
return '9';
|
|
219
|
+
if (version.major === 27)
|
|
220
|
+
return '8.1';
|
|
221
|
+
if (version.major === 26)
|
|
222
|
+
return '8.0';
|
|
223
|
+
if (version.major === 25)
|
|
224
|
+
return '7.1';
|
|
225
|
+
if (version.major === 24)
|
|
226
|
+
return '7.0';
|
|
227
|
+
if (version.major === 23)
|
|
228
|
+
return '6.0';
|
|
229
|
+
if (version.major === 22)
|
|
230
|
+
return '5.1';
|
|
231
|
+
if (version.major === 21)
|
|
232
|
+
return '5.0';
|
|
233
|
+
if (version.major === 20)
|
|
234
|
+
return '4.4W';
|
|
235
|
+
if (version.major === 19)
|
|
236
|
+
return '4.4';
|
|
237
|
+
if (version.major === 18)
|
|
238
|
+
return '4.3';
|
|
239
|
+
if (version.major === 17)
|
|
240
|
+
return '4.2';
|
|
241
|
+
if (version.major === 16)
|
|
242
|
+
return '4.1';
|
|
243
|
+
if (version.major === 15)
|
|
244
|
+
return '4.0.3';
|
|
245
|
+
if (version.major === 14)
|
|
246
|
+
return '4.0';
|
|
247
|
+
if (version.major === 13)
|
|
248
|
+
return '3.2';
|
|
249
|
+
if (version.major === 12)
|
|
250
|
+
return '3.1';
|
|
251
|
+
if (version.major === 11)
|
|
252
|
+
return '3.0';
|
|
253
|
+
if (version.major === 10)
|
|
254
|
+
return '2.3.3';
|
|
255
|
+
if (version.major === 9)
|
|
256
|
+
return '2.3';
|
|
257
|
+
if (version.major === 8)
|
|
258
|
+
return '2.2';
|
|
259
|
+
if (version.major === 7)
|
|
260
|
+
return '2.1';
|
|
261
|
+
if (version.major === 6)
|
|
262
|
+
return '2.0.1';
|
|
263
|
+
if (version.major === 5)
|
|
264
|
+
return '2.0';
|
|
265
|
+
if (version.major === 4)
|
|
266
|
+
return '1.6';
|
|
267
|
+
if (version.major === 3)
|
|
268
|
+
return '1.5';
|
|
269
|
+
if (version.major === 2)
|
|
270
|
+
return '1.1';
|
|
271
|
+
if (version.major === 1)
|
|
272
|
+
return '1.0';
|
|
273
|
+
return defaultValue;
|
|
274
|
+
}
|
|
141
275
|
function resolveVersion(string, resolver) {
|
|
142
276
|
if (typeof resolver === 'function')
|
|
143
277
|
return resolver(string);
|
|
@@ -154,11 +288,6 @@ function normalizeBrand(entry) {
|
|
|
154
288
|
return { brand: entry, version: '' };
|
|
155
289
|
return { brand: entry.brand, version: entry.version };
|
|
156
290
|
}
|
|
157
|
-
function getUserAgent() {
|
|
158
|
-
if (typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string')
|
|
159
|
-
return navigator.userAgent;
|
|
160
|
-
return '';
|
|
161
|
-
}
|
|
162
291
|
function getRenderer() {
|
|
163
292
|
if (typeof globalThis.document === 'undefined')
|
|
164
293
|
return '';
|
|
@@ -189,10 +318,7 @@ function getIsStandalone(os) {
|
|
|
189
318
|
function getIsWebview() {
|
|
190
319
|
return /; ?wv|applewebkit(?!.*safari)/i.test(Platform.userAgent);
|
|
191
320
|
}
|
|
192
|
-
function
|
|
193
|
-
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
194
|
-
}
|
|
195
|
-
function getNodeOSVersion(string) {
|
|
321
|
+
function getSemanticVersion(string) {
|
|
196
322
|
var parts = string.split('.');
|
|
197
323
|
return {
|
|
198
324
|
major: parseInt(parts[0] || '0'),
|
|
@@ -240,95 +366,49 @@ for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
|
240
366
|
break;
|
|
241
367
|
}
|
|
242
368
|
}
|
|
243
|
-
if (
|
|
369
|
+
if (Platform.isReactNative) {
|
|
244
370
|
try {
|
|
245
371
|
var reactNative = require('react-native');
|
|
246
372
|
var platform = reactNative.Platform;
|
|
247
373
|
var os = platform.OS;
|
|
374
|
+
var release = '' + platform.Version;
|
|
375
|
+
var version = getSemanticVersion(release);
|
|
248
376
|
switch (os) {
|
|
249
377
|
case 'android':
|
|
250
378
|
Platform.os = OS.Android;
|
|
379
|
+
Platform.osVersion = resolveSemanticAndroidVersion(version, release);
|
|
251
380
|
break;
|
|
252
381
|
case 'ios':
|
|
253
382
|
Platform.os = OS.iOS;
|
|
383
|
+
Platform.osVersion = release;
|
|
254
384
|
break;
|
|
255
385
|
case 'windows':
|
|
256
386
|
Platform.os = OS.Windows;
|
|
387
|
+
Platform.osVersion = resolveSemanticWindowsVersion(version, release);
|
|
257
388
|
break;
|
|
258
389
|
case 'macos':
|
|
259
390
|
Platform.os = OS.MacOS;
|
|
391
|
+
Platform.osVersion = release;
|
|
260
392
|
break;
|
|
261
393
|
}
|
|
262
394
|
}
|
|
263
395
|
catch (_) {
|
|
264
396
|
}
|
|
265
397
|
}
|
|
266
|
-
|
|
398
|
+
if (Platform.isNodeJS) {
|
|
267
399
|
try {
|
|
268
400
|
var os = require('os');
|
|
269
401
|
var platform = os.platform();
|
|
270
402
|
var release = os.release();
|
|
271
|
-
var version =
|
|
403
|
+
var version = getSemanticVersion(release);
|
|
272
404
|
switch (platform) {
|
|
273
405
|
case 'win32':
|
|
274
406
|
Platform.os = OS.Windows;
|
|
275
|
-
|
|
276
|
-
Platform.osVersion = '11';
|
|
277
|
-
else if (version.major === 10 && version.minor === 0 && version.build < 22000)
|
|
278
|
-
Platform.osVersion = '10';
|
|
279
|
-
else if (version.major === 6 && version.minor === 3)
|
|
280
|
-
Platform.osVersion = '8.1';
|
|
281
|
-
else if (version.major === 6 && version.minor === 2)
|
|
282
|
-
Platform.osVersion = '8';
|
|
283
|
-
else if (version.major === 6 && version.minor === 1)
|
|
284
|
-
Platform.osVersion = '7';
|
|
285
|
-
else if (version.major === 6 && version.minor === 0)
|
|
286
|
-
Platform.osVersion = 'Vista';
|
|
287
|
-
else if (version.major === 5 && version.minor === 1)
|
|
288
|
-
Platform.osVersion = 'XP';
|
|
289
|
-
else if (version.major === 5 && version.minor === 2)
|
|
290
|
-
Platform.osVersion = 'XP';
|
|
291
|
-
else if (version.major === 5 && version.minor === 0)
|
|
292
|
-
Platform.osVersion = '2000';
|
|
293
|
-
else if (version.major === 4 && version.minor === 90)
|
|
294
|
-
Platform.osVersion = 'ME';
|
|
295
|
-
else if (version.major === 4 && version.minor === 0)
|
|
296
|
-
Platform.osVersion = 'NT 4.0';
|
|
297
|
-
else if (version.major === 3 && version.minor === 51)
|
|
298
|
-
Platform.osVersion = 'NT 3.11';
|
|
299
|
-
else
|
|
300
|
-
Platform.osVersion = release;
|
|
407
|
+
Platform.osVersion = resolveSemanticWindowsVersion(version, release);
|
|
301
408
|
break;
|
|
302
409
|
case 'darwin':
|
|
303
410
|
Platform.os = OS.MacOS;
|
|
304
|
-
|
|
305
|
-
Platform.osVersion = '' + (version.major - 9) + '.' + version.minor + '.' + version.build;
|
|
306
|
-
else if (version.major === 23)
|
|
307
|
-
Platform.osVersion = '14.' + version.minor + '.' + version.build;
|
|
308
|
-
else if (version.major === 22)
|
|
309
|
-
Platform.osVersion = '13.' + version.minor + '.' + version.build;
|
|
310
|
-
else if (version.major === 21)
|
|
311
|
-
Platform.osVersion = '12.' + version.minor + '.' + version.build;
|
|
312
|
-
else if (version.major === 20)
|
|
313
|
-
Platform.osVersion = '11.' + version.minor + '.' + version.build;
|
|
314
|
-
else if (version.major === 19)
|
|
315
|
-
Platform.osVersion = '10.15.' + version.minor;
|
|
316
|
-
else if (version.major === 18)
|
|
317
|
-
Platform.osVersion = '10.14.' + version.minor;
|
|
318
|
-
else if (version.major === 17)
|
|
319
|
-
Platform.osVersion = '10.13.' + version.minor;
|
|
320
|
-
else if (version.major === 16)
|
|
321
|
-
Platform.osVersion = '10.12.' + version.minor;
|
|
322
|
-
else if (version.major === 15)
|
|
323
|
-
Platform.osVersion = '10.11.' + version.minor;
|
|
324
|
-
else if (version.major === 14)
|
|
325
|
-
Platform.osVersion = '10.10.' + version.minor;
|
|
326
|
-
else if (version.major === 13)
|
|
327
|
-
Platform.osVersion = '10.9.' + version.minor;
|
|
328
|
-
else if (version.major >= 5 && version.major <= 12)
|
|
329
|
-
Platform.osVersion = '10.' + (version.major - 4) + '.' + version.minor;
|
|
330
|
-
else
|
|
331
|
-
Platform.osVersion = release;
|
|
411
|
+
Platform.osVersion = resolveSemanticDarwinVersion(version, release);
|
|
332
412
|
break;
|
|
333
413
|
case 'android':
|
|
334
414
|
Platform.os = OS.Android;
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
Browsers["IE"] = "IE";
|
|
44
44
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
45
45
|
})(Browsers || (Browsers = {}));
|
|
46
|
+
var userAgent = typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' ? navigator.userAgent : '';
|
|
46
47
|
var Platform = {
|
|
47
48
|
device: Devices.Unknown,
|
|
48
49
|
os: OS.Unknown,
|
|
@@ -52,12 +53,14 @@
|
|
|
52
53
|
browser: Browsers.Unknown,
|
|
53
54
|
browserVersion: '',
|
|
54
55
|
renderer: getRenderer(),
|
|
55
|
-
userAgent:
|
|
56
|
-
isWebview: false,
|
|
56
|
+
userAgent: userAgent,
|
|
57
57
|
isMobile: false,
|
|
58
58
|
isDesktop: false,
|
|
59
59
|
isStandalone: false,
|
|
60
|
-
|
|
60
|
+
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(userAgent),
|
|
61
|
+
isNodeJS: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
|
|
62
|
+
isElectron: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined,
|
|
63
|
+
isReactNative: typeof navigator !== 'undefined' && navigator.product === 'ReactNative'
|
|
61
64
|
};
|
|
62
65
|
var OS_RESOLVER_MAP = [
|
|
63
66
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -144,6 +147,137 @@
|
|
|
144
147
|
return '';
|
|
145
148
|
return string.replace(/_/g, '.');
|
|
146
149
|
}
|
|
150
|
+
function resolveSemanticWindowsVersion(version, defaultValue) {
|
|
151
|
+
if (version.major === 10 && version.minor === 0 && version.build >= 22000)
|
|
152
|
+
return '11';
|
|
153
|
+
if (version.major === 10 && version.minor === 0 && version.build < 22000)
|
|
154
|
+
return '10';
|
|
155
|
+
if (version.major === 6 && version.minor === 3)
|
|
156
|
+
return '8.1';
|
|
157
|
+
if (version.major === 6 && version.minor === 2)
|
|
158
|
+
return '8';
|
|
159
|
+
if (version.major === 6 && version.minor === 1)
|
|
160
|
+
return '7';
|
|
161
|
+
if (version.major === 6 && version.minor === 0)
|
|
162
|
+
return 'Vista';
|
|
163
|
+
if (version.major === 5 && version.minor === 1)
|
|
164
|
+
return 'XP';
|
|
165
|
+
if (version.major === 5 && version.minor === 2)
|
|
166
|
+
return 'XP';
|
|
167
|
+
if (version.major === 5 && version.minor === 0)
|
|
168
|
+
return '2000';
|
|
169
|
+
if (version.major === 4 && version.minor === 90)
|
|
170
|
+
return 'ME';
|
|
171
|
+
if (version.major === 4 && version.minor === 0)
|
|
172
|
+
return 'NT 4.0';
|
|
173
|
+
if (version.major === 3 && version.minor === 51)
|
|
174
|
+
return 'NT 3.11';
|
|
175
|
+
return defaultValue;
|
|
176
|
+
}
|
|
177
|
+
function resolveSemanticDarwinVersion(version, defaultValue) {
|
|
178
|
+
if (version.major >= 24)
|
|
179
|
+
return '' + (version.major - 9) + '.' + version.minor + '.' + version.build;
|
|
180
|
+
if (version.major === 23)
|
|
181
|
+
return '14.' + version.minor + '.' + version.build;
|
|
182
|
+
if (version.major === 22)
|
|
183
|
+
return '13.' + version.minor + '.' + version.build;
|
|
184
|
+
if (version.major === 21)
|
|
185
|
+
return '12.' + version.minor + '.' + version.build;
|
|
186
|
+
if (version.major === 20)
|
|
187
|
+
return '11.' + version.minor + '.' + version.build;
|
|
188
|
+
if (version.major === 19)
|
|
189
|
+
return '10.15.' + version.minor;
|
|
190
|
+
if (version.major === 18)
|
|
191
|
+
return '10.14.' + version.minor;
|
|
192
|
+
if (version.major === 17)
|
|
193
|
+
return '10.13.' + version.minor;
|
|
194
|
+
if (version.major === 16)
|
|
195
|
+
return '10.12.' + version.minor;
|
|
196
|
+
if (version.major === 15)
|
|
197
|
+
return '10.11.' + version.minor;
|
|
198
|
+
if (version.major === 14)
|
|
199
|
+
return '10.10.' + version.minor;
|
|
200
|
+
if (version.major === 13)
|
|
201
|
+
return '10.9.' + version.minor;
|
|
202
|
+
if (version.major >= 5 && version.major <= 12)
|
|
203
|
+
return '10.' + (version.major - 4) + '.' + version.minor;
|
|
204
|
+
return defaultValue;
|
|
205
|
+
}
|
|
206
|
+
function resolveSemanticAndroidVersion(version, defaultValue) {
|
|
207
|
+
if (version.major >= 36)
|
|
208
|
+
return '16';
|
|
209
|
+
if (version.major === 35)
|
|
210
|
+
return '15';
|
|
211
|
+
if (version.major === 34)
|
|
212
|
+
return '14';
|
|
213
|
+
if (version.major === 33)
|
|
214
|
+
return '13';
|
|
215
|
+
if (version.major === 32)
|
|
216
|
+
return '12.1';
|
|
217
|
+
if (version.major === 31)
|
|
218
|
+
return '12';
|
|
219
|
+
if (version.major === 30)
|
|
220
|
+
return '11';
|
|
221
|
+
if (version.major === 29)
|
|
222
|
+
return '10';
|
|
223
|
+
if (version.major === 28)
|
|
224
|
+
return '9';
|
|
225
|
+
if (version.major === 27)
|
|
226
|
+
return '8.1';
|
|
227
|
+
if (version.major === 26)
|
|
228
|
+
return '8.0';
|
|
229
|
+
if (version.major === 25)
|
|
230
|
+
return '7.1';
|
|
231
|
+
if (version.major === 24)
|
|
232
|
+
return '7.0';
|
|
233
|
+
if (version.major === 23)
|
|
234
|
+
return '6.0';
|
|
235
|
+
if (version.major === 22)
|
|
236
|
+
return '5.1';
|
|
237
|
+
if (version.major === 21)
|
|
238
|
+
return '5.0';
|
|
239
|
+
if (version.major === 20)
|
|
240
|
+
return '4.4W';
|
|
241
|
+
if (version.major === 19)
|
|
242
|
+
return '4.4';
|
|
243
|
+
if (version.major === 18)
|
|
244
|
+
return '4.3';
|
|
245
|
+
if (version.major === 17)
|
|
246
|
+
return '4.2';
|
|
247
|
+
if (version.major === 16)
|
|
248
|
+
return '4.1';
|
|
249
|
+
if (version.major === 15)
|
|
250
|
+
return '4.0.3';
|
|
251
|
+
if (version.major === 14)
|
|
252
|
+
return '4.0';
|
|
253
|
+
if (version.major === 13)
|
|
254
|
+
return '3.2';
|
|
255
|
+
if (version.major === 12)
|
|
256
|
+
return '3.1';
|
|
257
|
+
if (version.major === 11)
|
|
258
|
+
return '3.0';
|
|
259
|
+
if (version.major === 10)
|
|
260
|
+
return '2.3.3';
|
|
261
|
+
if (version.major === 9)
|
|
262
|
+
return '2.3';
|
|
263
|
+
if (version.major === 8)
|
|
264
|
+
return '2.2';
|
|
265
|
+
if (version.major === 7)
|
|
266
|
+
return '2.1';
|
|
267
|
+
if (version.major === 6)
|
|
268
|
+
return '2.0.1';
|
|
269
|
+
if (version.major === 5)
|
|
270
|
+
return '2.0';
|
|
271
|
+
if (version.major === 4)
|
|
272
|
+
return '1.6';
|
|
273
|
+
if (version.major === 3)
|
|
274
|
+
return '1.5';
|
|
275
|
+
if (version.major === 2)
|
|
276
|
+
return '1.1';
|
|
277
|
+
if (version.major === 1)
|
|
278
|
+
return '1.0';
|
|
279
|
+
return defaultValue;
|
|
280
|
+
}
|
|
147
281
|
function resolveVersion(string, resolver) {
|
|
148
282
|
if (typeof resolver === 'function')
|
|
149
283
|
return resolver(string);
|
|
@@ -160,11 +294,6 @@
|
|
|
160
294
|
return { brand: entry, version: '' };
|
|
161
295
|
return { brand: entry.brand, version: entry.version };
|
|
162
296
|
}
|
|
163
|
-
function getUserAgent() {
|
|
164
|
-
if (typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string')
|
|
165
|
-
return navigator.userAgent;
|
|
166
|
-
return '';
|
|
167
|
-
}
|
|
168
297
|
function getRenderer() {
|
|
169
298
|
if (typeof globalThis.document === 'undefined')
|
|
170
299
|
return '';
|
|
@@ -195,10 +324,7 @@
|
|
|
195
324
|
function getIsWebview() {
|
|
196
325
|
return /; ?wv|applewebkit(?!.*safari)/i.test(Platform.userAgent);
|
|
197
326
|
}
|
|
198
|
-
function
|
|
199
|
-
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
200
|
-
}
|
|
201
|
-
function getNodeOSVersion(string) {
|
|
327
|
+
function getSemanticVersion(string) {
|
|
202
328
|
var parts = string.split('.');
|
|
203
329
|
return {
|
|
204
330
|
major: parseInt(parts[0] || '0'),
|
|
@@ -246,95 +372,49 @@
|
|
|
246
372
|
break;
|
|
247
373
|
}
|
|
248
374
|
}
|
|
249
|
-
if (
|
|
375
|
+
if (Platform.isReactNative) {
|
|
250
376
|
try {
|
|
251
377
|
var reactNative = require('react-native');
|
|
252
378
|
var platform = reactNative.Platform;
|
|
253
379
|
var os = platform.OS;
|
|
380
|
+
var release = '' + platform.Version;
|
|
381
|
+
var version = getSemanticVersion(release);
|
|
254
382
|
switch (os) {
|
|
255
383
|
case 'android':
|
|
256
384
|
Platform.os = OS.Android;
|
|
385
|
+
Platform.osVersion = resolveSemanticAndroidVersion(version, release);
|
|
257
386
|
break;
|
|
258
387
|
case 'ios':
|
|
259
388
|
Platform.os = OS.iOS;
|
|
389
|
+
Platform.osVersion = release;
|
|
260
390
|
break;
|
|
261
391
|
case 'windows':
|
|
262
392
|
Platform.os = OS.Windows;
|
|
393
|
+
Platform.osVersion = resolveSemanticWindowsVersion(version, release);
|
|
263
394
|
break;
|
|
264
395
|
case 'macos':
|
|
265
396
|
Platform.os = OS.MacOS;
|
|
397
|
+
Platform.osVersion = release;
|
|
266
398
|
break;
|
|
267
399
|
}
|
|
268
400
|
}
|
|
269
401
|
catch (_) {
|
|
270
402
|
}
|
|
271
403
|
}
|
|
272
|
-
|
|
404
|
+
if (Platform.isNodeJS) {
|
|
273
405
|
try {
|
|
274
406
|
var os = require('os');
|
|
275
407
|
var platform = os.platform();
|
|
276
408
|
var release = os.release();
|
|
277
|
-
var version =
|
|
409
|
+
var version = getSemanticVersion(release);
|
|
278
410
|
switch (platform) {
|
|
279
411
|
case 'win32':
|
|
280
412
|
Platform.os = OS.Windows;
|
|
281
|
-
|
|
282
|
-
Platform.osVersion = '11';
|
|
283
|
-
else if (version.major === 10 && version.minor === 0 && version.build < 22000)
|
|
284
|
-
Platform.osVersion = '10';
|
|
285
|
-
else if (version.major === 6 && version.minor === 3)
|
|
286
|
-
Platform.osVersion = '8.1';
|
|
287
|
-
else if (version.major === 6 && version.minor === 2)
|
|
288
|
-
Platform.osVersion = '8';
|
|
289
|
-
else if (version.major === 6 && version.minor === 1)
|
|
290
|
-
Platform.osVersion = '7';
|
|
291
|
-
else if (version.major === 6 && version.minor === 0)
|
|
292
|
-
Platform.osVersion = 'Vista';
|
|
293
|
-
else if (version.major === 5 && version.minor === 1)
|
|
294
|
-
Platform.osVersion = 'XP';
|
|
295
|
-
else if (version.major === 5 && version.minor === 2)
|
|
296
|
-
Platform.osVersion = 'XP';
|
|
297
|
-
else if (version.major === 5 && version.minor === 0)
|
|
298
|
-
Platform.osVersion = '2000';
|
|
299
|
-
else if (version.major === 4 && version.minor === 90)
|
|
300
|
-
Platform.osVersion = 'ME';
|
|
301
|
-
else if (version.major === 4 && version.minor === 0)
|
|
302
|
-
Platform.osVersion = 'NT 4.0';
|
|
303
|
-
else if (version.major === 3 && version.minor === 51)
|
|
304
|
-
Platform.osVersion = 'NT 3.11';
|
|
305
|
-
else
|
|
306
|
-
Platform.osVersion = release;
|
|
413
|
+
Platform.osVersion = resolveSemanticWindowsVersion(version, release);
|
|
307
414
|
break;
|
|
308
415
|
case 'darwin':
|
|
309
416
|
Platform.os = OS.MacOS;
|
|
310
|
-
|
|
311
|
-
Platform.osVersion = '' + (version.major - 9) + '.' + version.minor + '.' + version.build;
|
|
312
|
-
else if (version.major === 23)
|
|
313
|
-
Platform.osVersion = '14.' + version.minor + '.' + version.build;
|
|
314
|
-
else if (version.major === 22)
|
|
315
|
-
Platform.osVersion = '13.' + version.minor + '.' + version.build;
|
|
316
|
-
else if (version.major === 21)
|
|
317
|
-
Platform.osVersion = '12.' + version.minor + '.' + version.build;
|
|
318
|
-
else if (version.major === 20)
|
|
319
|
-
Platform.osVersion = '11.' + version.minor + '.' + version.build;
|
|
320
|
-
else if (version.major === 19)
|
|
321
|
-
Platform.osVersion = '10.15.' + version.minor;
|
|
322
|
-
else if (version.major === 18)
|
|
323
|
-
Platform.osVersion = '10.14.' + version.minor;
|
|
324
|
-
else if (version.major === 17)
|
|
325
|
-
Platform.osVersion = '10.13.' + version.minor;
|
|
326
|
-
else if (version.major === 16)
|
|
327
|
-
Platform.osVersion = '10.12.' + version.minor;
|
|
328
|
-
else if (version.major === 15)
|
|
329
|
-
Platform.osVersion = '10.11.' + version.minor;
|
|
330
|
-
else if (version.major === 14)
|
|
331
|
-
Platform.osVersion = '10.10.' + version.minor;
|
|
332
|
-
else if (version.major === 13)
|
|
333
|
-
Platform.osVersion = '10.9.' + version.minor;
|
|
334
|
-
else if (version.major >= 5 && version.major <= 12)
|
|
335
|
-
Platform.osVersion = '10.' + (version.major - 4) + '.' + version.minor;
|
|
336
|
-
else
|
|
337
|
-
Platform.osVersion = release;
|
|
417
|
+
Platform.osVersion = resolveSemanticDarwinVersion(version, release);
|
|
338
418
|
break;
|
|
339
419
|
case 'android':
|
|
340
420
|
Platform.os = OS.Android;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(e="undefined"!=typeof globalThis?globalThis:e||self).Camera=i()}(this,(function(){"use strict";var e,i,o,n;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(i||(i={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(o||(o={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(n||(n={}));var r,t={device:i.Unknown,os:e.Unknown,osVersion:"",engine:o.Unknown,engineVersion:"",browser:n.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var i=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===i)return"";if(i instanceof WebGLRenderingContext||"getParameter"in i&&"function"==typeof i.getParameter){var o=i.getExtension("WEBGL_debug_renderer_info");return null===o?i.getParameter(i.RENDERER):i.getParameter(o.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",isWebview:!1,isMobile:!1,isDesktop:!1,isStandalone:!1,isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node},a=[[/windows nt (6\.[23]); arm/i,e.Windows,l],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,l],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,l],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,l],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,l],[/windows ce\/?([\d.]*)/i,e.Windows,l],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,m],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,m],[/cfnetwork\/.+darwin/i,e.iOS,m],[/mac os x ?([\w. ]*)/i,e.MacOS,m],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,m],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],s=[[/windows.+ edge\/([\w.]+)/i,o.EdgeHTML],[/arkweb\/([\w.]+)/i,o.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,o.Blink],[/presto\/([\w.]+)/i,o.Presto],[/webkit\/([\w.]+)/i,o.WebKit],[/trident\/([\w.]+)/i,o.Trident],[/netfront\/([\w.]+)/i,o.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,o.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,o.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,o.Gecko]],d=[[/\b(?:crmo|crios)\/([\w.]+)/i,n.Chrome],[/webview.+edge\/([\w.]+)/i,n.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,n.Edge],[/opera mini\/([-\w.]+)/i,n.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,n.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,n.Opera],[/opios[\/ ]+([\w.]+)/i,n.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,n.Opera],[/\bopr\/([\w.]+)/i,n.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,n.IE],[/(?:ms|\()ie ([\w.]+)/i,n.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,n.IE],[/\bfocus\/([\w.]+)/i,n.Firefox],[/\bopt\/([\w.]+)/i,n.Opera],[/coast\/([\w.]+)/i,n.Opera],[/fxios\/([\w.-]+)/i,n.Firefox],[/samsungbrowser\/([\w.]+)/i,n.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,n.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,n.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,n.Chrome],[/chrome\/([\w.]+) mobile/i,n.Chrome],[/chrome\/v?([\w.]+)/i,n.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,n.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,n.Safari],[/version\/([\w.,]+) .*safari/i,n.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,n.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,n.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,n.Firefox],[/firefox\/([\w.]+)/i,n.Firefox]];function l(e){if(void 0===e)return"";var i={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==i?i:e}function m(e){return void 0===e?"":e.replace(/_/g,".")}function c(e,i){return"function"==typeof i?i(e):"string"==typeof i?i:void 0===e?"":e}for(var w=0;w<a.length;w++){var u=(g=a[w])[0],b=g[1],p=g[2];if(null!==(v=t.userAgent.match(u))){t.os=b,t.osVersion=c(v[1],p),b===e.iOS||b===e.Android?t.device=i.Mobile:b!==e.Windows&&b!==e.MacOS||(t.device=i.Desktop);break}}for(w=0;w<s.length;w++){u=(g=s[w])[0];var f=g[1];p=g[2];if(null!==(v=t.userAgent.match(u))){t.engine=f,t.engineVersion=c(v[1],p);break}}for(w=0;w<d.length;w++){u=(g=d[w])[0];var g,v,h=g[1];p=g[2];if(null!==(v=t.userAgent.match(u))){t.browser=h,t.browserVersion=c(v[1],p);break}}if("undefined"!=typeof navigator&&"ReactNative"===navigator.product)try{switch(b=(k=require("react-native").Platform).OS){case"android":t.os=e.Android;break;case"ios":t.os=e.iOS;break;case"windows":t.os=e.Windows;break;case"macos":t.os=e.MacOS}}catch(e){}else if(t.isNodeJS)try{var k=(b=require("os")).platform(),y=b.release(),T=(r=y.split("."),{major:parseInt(r[0]||"0"),minor:parseInt(r[1]||"0"),build:parseInt(r[2]||"0")});switch(k){case"win32":t.os=e.Windows,t.osVersion=10===T.major&&0===T.minor&&T.build>=22e3?"11":10===T.major&&0===T.minor&&T.build<22e3?"10":6===T.major&&3===T.minor?"8.1":6===T.major&&2===T.minor?"8":6===T.major&&1===T.minor?"7":6===T.major&&0===T.minor?"Vista":5===T.major&&1===T.minor||5===T.major&&2===T.minor?"XP":5===T.major&&0===T.minor?"2000":4===T.major&&90===T.minor?"ME":4===T.major&&0===T.minor?"NT 4.0":3===T.major&&51===T.minor?"NT 3.11":y;break;case"darwin":t.os=e.MacOS,t.osVersion=T.major>=24?T.major-9+"."+T.minor+"."+T.build:23===T.major?"14."+T.minor+"."+T.build:22===T.major?"13."+T.minor+"."+T.build:21===T.major?"12."+T.minor+"."+T.build:20===T.major?"11."+T.minor+"."+T.build:19===T.major?"10.15."+T.minor:18===T.major?"10.14."+T.minor:17===T.major?"10.13."+T.minor:16===T.major?"10.12."+T.minor:15===T.major?"10.11."+T.minor:14===T.major?"10.10."+T.minor:13===T.major?"10.9."+T.minor:T.major>=5&&T.major<=12?"10."+(T.major-4)+"."+T.minor:y;break;case"android":t.os=e.Android,t.osVersion=y;break;case"linux":/android/i.test(y)&&(t.os=e.Android,t.osVersion=y)}}catch(e){}function x(i){var o,n=function(){try{if(globalThis.top&&globalThis.top!==window)return globalThis.top.location.href,globalThis.top}catch(e){}return window}(),r=n.document;try{if(void 0===(o=function(e,i){if(void 0===i&&(i=!0),void 0!==globalThis.document){var o=globalThis.document.createElement(e);return"width"in o&&(o.width="0"),"height"in o&&(o.height="0"),"border"in o&&(o.border="0"),"frameBorder"in o&&(o.frameBorder="0"),"scrolling"in o&&(o.scrolling="no"),"cellPadding"in o&&(o.cellPadding="0"),"cellSpacing"in o&&(o.cellSpacing="0"),"frame"in o&&(o.frame="void"),"rules"in o&&(o.rules="none"),"noWrap"in o&&(o.noWrap=!0),o.tabIndex=-1,o.setAttribute("role","presentation"),i?(o.style.width="1px",o.style.height="1px"):(o.setAttribute("aria-hidden","true"),o.style.width="0",o.style.height="0",o.style.zIndex="-9999",o.style.display="none",o.style.visibility="hidden",o.style.pointerEvents="none"),o.style.position="absolute",o.style.top="0",o.style.left="0",o.style.padding="0",o.style.margin="0",o.style.border="none",o.style.outline="none",o.style.clip="rect(1px, 1px, 1px, 1px)",o.style.clipPath="inset(50%)",o.style.overflow="hidden",o.style.whiteSpace="nowrap",o}}("input")))return;if(o.type="file",o.tabIndex=-1,o.accept=i+"/*","capture"in HTMLInputElement.prototype)o.capture="user";else if(t.os===e.Android){var a="";"image"===i?a="camera":"video"===i&&(a="camcorder"),o.accept=i+"/*;capture="+a}r.body.appendChild(o),function(e,i){var o;void 0===i&&(i=window);try{o=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:i})}catch(e){(o=globalThis.document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,i,0,0,0,0,0,!1,!1,!1,!1,0,null)}e.dispatchEvent(o)}(o,n)}catch(e){}}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(i){for(var o,n=i.fullVersionList||i.brands||[],r=i.platformVersion,a=0;a<n.length;a++){var s=null==(o=n[a])?{brand:"",version:""}:"string"==typeof o?{brand:o,version:""}:{brand:o.brand,version:o.version},d=s.brand,l=s.version;/not.a.brand/i.test(d)||"Chromium"===d&&(t.engineVersion=l)}"string"==typeof r&&(t.os===e.Windows&&parseInt(r.replace(/[^\d.]/g,"").split(".")[0],10)>=13?t.osVersion="11":t.osVersion=r)})),t.isMobile=t.device===i.Mobile,t.isDesktop=t.device===i.Desktop,t.isWebview=/; ?wv|applewebkit(?!.*safari)/i.test(t.userAgent),t.isStandalone=function(i){return"matchMedia"in globalThis&&(i===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(t.os);var E,S={open:function(i){switch(t.os){case e.Android:x(i);break;case e.iOS:(function(e,i){for(var o=e.split("."),n=i.split("."),r=Math.max(o.length,n.length),t=0;t<r;t++){var a=void 0,s=void 0;if((a=t<o.length?parseInt(o[t],10):0)>(s=t<n.length?parseInt(n[t],10):0))return 1;if(a<s)return-1}return 0})(t.osVersion,"10.3")>=0?x(i):alert(t.osVersion);case e.Windows:case e.MacOS:}}};return function(e){e.Image="image",e.Video="video"}(E||(E={})),{installed:!1,name:"Camera",module:S,Constants:{CameraType:E},Errors:{}}}));
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).Camera=o()}(this,(function(){"use strict";var e,o,i,r;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(o||(o={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(i||(i={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(r||(r={}));var n="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",a={device:o.Unknown,os:e.Unknown,osVersion:"",engine:i.Unknown,engineVersion:"",browser:r.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var o=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===o)return"";if(o instanceof WebGLRenderingContext||"getParameter"in o&&"function"==typeof o.getParameter){var i=o.getExtension("WEBGL_debug_renderer_info");return null===i?o.getParameter(o.RENDERER):o.getParameter(i.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:n,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(n),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron,isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},t=[[/windows nt (6\.[23]); arm/i,e.Windows,l],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,l],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,l],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,l],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,l],[/windows ce\/?([\d.]*)/i,e.Windows,l],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,m],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,m],[/cfnetwork\/.+darwin/i,e.iOS,m],[/mac os x ?([\w. ]*)/i,e.MacOS,m],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,m],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],s=[[/windows.+ edge\/([\w.]+)/i,i.EdgeHTML],[/arkweb\/([\w.]+)/i,i.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,i.Blink],[/presto\/([\w.]+)/i,i.Presto],[/webkit\/([\w.]+)/i,i.WebKit],[/trident\/([\w.]+)/i,i.Trident],[/netfront\/([\w.]+)/i,i.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,i.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,i.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,i.Gecko]],d=[[/\b(?:crmo|crios)\/([\w.]+)/i,r.Chrome],[/webview.+edge\/([\w.]+)/i,r.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,r.Edge],[/opera mini\/([-\w.]+)/i,r.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,r.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,r.Opera],[/opios[\/ ]+([\w.]+)/i,r.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,r.Opera],[/\bopr\/([\w.]+)/i,r.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,r.IE],[/(?:ms|\()ie ([\w.]+)/i,r.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,r.IE],[/\bfocus\/([\w.]+)/i,r.Firefox],[/\bopt\/([\w.]+)/i,r.Opera],[/coast\/([\w.]+)/i,r.Opera],[/fxios\/([\w.-]+)/i,r.Firefox],[/samsungbrowser\/([\w.]+)/i,r.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,r.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,r.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,r.Chrome],[/chrome\/([\w.]+) mobile/i,r.Chrome],[/chrome\/v?([\w.]+)/i,r.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,r.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,r.Safari],[/version\/([\w.,]+) .*safari/i,r.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,r.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,r.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,r.Firefox],[/firefox\/([\w.]+)/i,r.Firefox]];function l(e){if(void 0===e)return"";var o={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==o?o:e}function m(e){return void 0===e?"":e.replace(/_/g,".")}function c(e,o){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":o}function w(e,o){return"function"==typeof o?o(e):"string"==typeof o?o:void 0===e?"":e}function u(e){var o=e.split(".");return{major:parseInt(o[0]||"0"),minor:parseInt(o[1]||"0"),build:parseInt(o[2]||"0")}}for(var p=0;p<t.length;p++){var b=(h=t[p])[0],f=h[1],g=h[2];if(null!==(j=a.userAgent.match(b))){a.os=f,a.osVersion=w(j[1],g),f===e.iOS||f===e.Android?a.device=o.Mobile:f!==e.Windows&&f!==e.MacOS||(a.device=o.Desktop);break}}for(p=0;p<s.length;p++){b=(h=s[p])[0];var v=h[1];g=h[2];if(null!==(j=a.userAgent.match(b))){a.engine=v,a.engineVersion=w(j[1],g);break}}for(p=0;p<d.length;p++){b=(h=d[p])[0];var h,j,k=h[1];g=h[2];if(null!==(j=a.userAgent.match(b))){a.browser=k,a.browserVersion=w(j[1],g);break}}if(a.isReactNative)try{f=(x=require("react-native").Platform).OS;var T=u(y=""+x.Version);switch(f){case"android":a.os=e.Android,a.osVersion=function(e,o){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major?"4.4W":19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":o}(T,y);break;case"ios":a.os=e.iOS,a.osVersion=y;break;case"windows":a.os=e.Windows,a.osVersion=c(T,y);break;case"macos":a.os=e.MacOS,a.osVersion=y}}catch(e){}if(a.isNodeJS)try{var y,x=(f=require("os")).platform();T=u(y=f.release());switch(x){case"win32":a.os=e.Windows,a.osVersion=c(T,y);break;case"darwin":a.os=e.MacOS,a.osVersion=function(e,o){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:o}(T,y);break;case"android":a.os=e.Android,a.osVersion=y;break;case"linux":/android/i.test(y)&&(a.os=e.Android,a.osVersion=y)}}catch(e){}function E(o){var i,r=function(){try{if(globalThis.top&&globalThis.top!==window)return globalThis.top.location.href,globalThis.top}catch(e){}return window}(),n=r.document;try{if(void 0===(i=function(e,o){if(void 0===o&&(o=!0),void 0!==globalThis.document){var i=globalThis.document.createElement(e);return"width"in i&&(i.width="0"),"height"in i&&(i.height="0"),"border"in i&&(i.border="0"),"frameBorder"in i&&(i.frameBorder="0"),"scrolling"in i&&(i.scrolling="no"),"cellPadding"in i&&(i.cellPadding="0"),"cellSpacing"in i&&(i.cellSpacing="0"),"frame"in i&&(i.frame="void"),"rules"in i&&(i.rules="none"),"noWrap"in i&&(i.noWrap=!0),i.tabIndex=-1,i.setAttribute("role","presentation"),o?(i.style.width="1px",i.style.height="1px"):(i.setAttribute("aria-hidden","true"),i.style.width="0",i.style.height="0",i.style.zIndex="-9999",i.style.display="none",i.style.visibility="hidden",i.style.pointerEvents="none"),i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.padding="0",i.style.margin="0",i.style.border="none",i.style.outline="none",i.style.clip="rect(1px, 1px, 1px, 1px)",i.style.clipPath="inset(50%)",i.style.overflow="hidden",i.style.whiteSpace="nowrap",i}}("input")))return;if(i.type="file",i.tabIndex=-1,i.accept=o+"/*","capture"in HTMLInputElement.prototype)i.capture="user";else if(a.os===e.Android){var t="";"image"===o?t="camera":"video"===o&&(t="camcorder"),i.accept=o+"/*;capture="+t}n.body.appendChild(i),function(e,o){var i;void 0===o&&(o=window);try{i=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:o})}catch(e){(i=globalThis.document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,o,0,0,0,0,0,!1,!1,!1,!1,0,null)}e.dispatchEvent(i)}(i,r)}catch(e){}}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(o){for(var i,r=o.fullVersionList||o.brands||[],n=o.platformVersion,t=0;t<r.length;t++){var s=null==(i=r[t])?{brand:"",version:""}:"string"==typeof i?{brand:i,version:""}:{brand:i.brand,version:i.version},d=s.brand,l=s.version;/not.a.brand/i.test(d)||"Chromium"===d&&(a.engineVersion=l)}"string"==typeof n&&(a.os===e.Windows&&parseInt(n.replace(/[^\d.]/g,"").split(".")[0],10)>=13?a.osVersion="11":a.osVersion=n)})),a.isMobile=a.device===o.Mobile,a.isDesktop=a.device===o.Desktop,a.isWebview=/; ?wv|applewebkit(?!.*safari)/i.test(a.userAgent),a.isStandalone=function(o){return"matchMedia"in globalThis&&(o===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(a.os);var S,M={open:function(o){switch(a.os){case e.Android:E(o);break;case e.iOS:(function(e,o){for(var i=e.split("."),r=o.split("."),n=Math.max(i.length,r.length),a=0;a<n;a++){var t=void 0,s=void 0;if((t=a<i.length?parseInt(i[a],10):0)>(s=a<r.length?parseInt(r[a],10):0))return 1;if(t<s)return-1}return 0})(a.osVersion,"10.3")>=0?E(o):alert(a.osVersion);case e.Windows:case e.MacOS:}}};return function(e){e.Image="image",e.Video="video"}(S||(S={})),{installed:!1,name:"Camera",module:M,Constants:{CameraType:S},Errors:{}}}));
|
|
@@ -9,9 +9,11 @@ export declare interface PlatformInstance {
|
|
|
9
9
|
browserVersion: string;
|
|
10
10
|
renderer: string;
|
|
11
11
|
userAgent: string;
|
|
12
|
-
isWebview: boolean;
|
|
13
12
|
isStandalone: boolean;
|
|
14
13
|
isMobile: boolean;
|
|
15
14
|
isDesktop: boolean;
|
|
15
|
+
isWebview: boolean;
|
|
16
16
|
isNodeJS: boolean;
|
|
17
|
+
isElectron: boolean;
|
|
18
|
+
isReactNative: boolean;
|
|
17
19
|
}
|