native-fn 1.0.82 → 1.0.83

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.
Files changed (141) hide show
  1. package/dist/index.d.ts +8 -1
  2. package/dist/native.cjs +4 -10
  3. package/dist/native.min.cjs +1 -1
  4. package/dist/native.min.mjs +1 -1
  5. package/dist/native.mjs +4 -10
  6. package/dist/native.umd.js +4 -10
  7. package/dist/native.umd.min.js +1 -1
  8. package/dist/plugin/app/index.cjs +102 -255
  9. package/dist/plugin/app/index.min.cjs +1 -1
  10. package/dist/plugin/app/index.min.mjs +1 -1
  11. package/dist/plugin/app/index.mjs +102 -255
  12. package/dist/plugin/app/index.umd.js +102 -255
  13. package/dist/plugin/app/index.umd.min.js +1 -1
  14. package/dist/plugin/app/src/plugin/appearance/constants/index.d.ts +2 -2
  15. package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +0 -6
  16. package/dist/plugin/app/src/plugin/dimension/constants/index.d.ts +3 -0
  17. package/dist/plugin/app/src/plugin/dimension/types/dimension.d.ts +9 -6
  18. package/dist/plugin/app/src/plugin/dimension/types/dimensions.d.ts +11 -0
  19. package/dist/plugin/app/src/plugin/dimension/types/index.d.ts +2 -2
  20. package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +1 -0
  21. package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +0 -10
  22. package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +3 -19
  23. package/dist/plugin/app/src/types/listener-entry.d.ts +6 -0
  24. package/dist/plugin/app/src/utils/request.d.ts +1 -0
  25. package/dist/plugin/appearance/index.cjs +55 -208
  26. package/dist/plugin/appearance/index.d.ts +1 -7
  27. package/dist/plugin/appearance/index.min.cjs +1 -1
  28. package/dist/plugin/appearance/index.min.mjs +1 -1
  29. package/dist/plugin/appearance/index.mjs +55 -208
  30. package/dist/plugin/appearance/index.umd.js +55 -208
  31. package/dist/plugin/appearance/index.umd.min.js +1 -1
  32. package/dist/plugin/appearance/src/plugin/appearance/constants/index.d.ts +2 -2
  33. package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +0 -6
  34. package/dist/plugin/appearance/src/plugin/dimension/constants/index.d.ts +3 -0
  35. package/dist/plugin/appearance/src/plugin/dimension/types/dimension.d.ts +9 -6
  36. package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +11 -0
  37. package/dist/plugin/appearance/src/plugin/dimension/types/index.d.ts +2 -2
  38. package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +1 -0
  39. package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +0 -10
  40. package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +3 -19
  41. package/dist/plugin/appearance/src/types/listener-entry.d.ts +6 -0
  42. package/dist/plugin/appearance/src/utils/request.d.ts +1 -0
  43. package/dist/plugin/clipboard/index.cjs +61 -214
  44. package/dist/plugin/clipboard/index.min.cjs +1 -1
  45. package/dist/plugin/clipboard/index.min.mjs +1 -1
  46. package/dist/plugin/clipboard/index.mjs +61 -214
  47. package/dist/plugin/clipboard/index.umd.js +61 -214
  48. package/dist/plugin/clipboard/index.umd.min.js +1 -1
  49. package/dist/plugin/clipboard/src/plugin/appearance/constants/index.d.ts +2 -2
  50. package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +0 -6
  51. package/dist/plugin/clipboard/src/plugin/dimension/constants/index.d.ts +3 -0
  52. package/dist/plugin/clipboard/src/plugin/dimension/types/dimension.d.ts +9 -6
  53. package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +11 -0
  54. package/dist/plugin/clipboard/src/plugin/dimension/types/index.d.ts +2 -2
  55. package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +1 -0
  56. package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +0 -10
  57. package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +3 -19
  58. package/dist/plugin/clipboard/src/types/listener-entry.d.ts +6 -0
  59. package/dist/plugin/clipboard/src/utils/request.d.ts +1 -0
  60. package/dist/plugin/dimension/index.cjs +935 -1
  61. package/dist/plugin/dimension/index.d.ts +9 -0
  62. package/dist/plugin/dimension/index.min.cjs +1 -1
  63. package/dist/plugin/dimension/index.min.mjs +1 -1
  64. package/dist/plugin/dimension/index.mjs +935 -1
  65. package/dist/plugin/dimension/index.umd.js +935 -1
  66. package/dist/plugin/dimension/index.umd.min.js +1 -1
  67. package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +2 -2
  68. package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +0 -6
  69. package/dist/plugin/dimension/src/plugin/dimension/constants/index.d.ts +3 -0
  70. package/dist/plugin/dimension/src/plugin/dimension/types/dimension.d.ts +9 -6
  71. package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +11 -0
  72. package/dist/plugin/dimension/src/plugin/dimension/types/index.d.ts +2 -2
  73. package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +1 -0
  74. package/dist/plugin/dimension/src/plugin/platform/cores/index.d.ts +0 -10
  75. package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +3 -19
  76. package/dist/plugin/dimension/src/types/listener-entry.d.ts +6 -0
  77. package/dist/plugin/dimension/src/utils/request.d.ts +1 -0
  78. package/dist/plugin/fullscreen/index.cjs +54 -207
  79. package/dist/plugin/fullscreen/index.min.cjs +1 -1
  80. package/dist/plugin/fullscreen/index.min.mjs +1 -1
  81. package/dist/plugin/fullscreen/index.mjs +54 -207
  82. package/dist/plugin/fullscreen/index.umd.js +54 -207
  83. package/dist/plugin/fullscreen/index.umd.min.js +1 -1
  84. package/dist/plugin/fullscreen/src/plugin/appearance/constants/index.d.ts +2 -2
  85. package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +0 -6
  86. package/dist/plugin/fullscreen/src/plugin/dimension/constants/index.d.ts +3 -0
  87. package/dist/plugin/fullscreen/src/plugin/dimension/types/dimension.d.ts +9 -6
  88. package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +11 -0
  89. package/dist/plugin/fullscreen/src/plugin/dimension/types/index.d.ts +2 -2
  90. package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +1 -0
  91. package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +0 -10
  92. package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +3 -19
  93. package/dist/plugin/fullscreen/src/types/listener-entry.d.ts +6 -0
  94. package/dist/plugin/fullscreen/src/utils/request.d.ts +1 -0
  95. package/dist/plugin/platform/index.cjs +50 -203
  96. package/dist/plugin/platform/index.d.ts +4 -20
  97. package/dist/plugin/platform/index.min.cjs +1 -1
  98. package/dist/plugin/platform/index.min.mjs +1 -1
  99. package/dist/plugin/platform/index.mjs +50 -203
  100. package/dist/plugin/platform/index.umd.js +50 -203
  101. package/dist/plugin/platform/index.umd.min.js +1 -1
  102. package/dist/plugin/platform/src/plugin/appearance/constants/index.d.ts +2 -2
  103. package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +0 -6
  104. package/dist/plugin/platform/src/plugin/dimension/constants/index.d.ts +3 -0
  105. package/dist/plugin/platform/src/plugin/dimension/types/dimension.d.ts +9 -6
  106. package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +11 -0
  107. package/dist/plugin/platform/src/plugin/dimension/types/index.d.ts +2 -2
  108. package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +1 -0
  109. package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +0 -10
  110. package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +3 -19
  111. package/dist/plugin/platform/src/types/listener-entry.d.ts +6 -0
  112. package/dist/plugin/platform/src/utils/request.d.ts +1 -0
  113. package/dist/plugin/theme/index.cjs +51 -204
  114. package/dist/plugin/theme/index.min.cjs +1 -1
  115. package/dist/plugin/theme/index.min.mjs +1 -1
  116. package/dist/plugin/theme/index.mjs +51 -204
  117. package/dist/plugin/theme/index.umd.js +51 -204
  118. package/dist/plugin/theme/index.umd.min.js +1 -1
  119. package/dist/plugin/theme/src/plugin/appearance/constants/index.d.ts +2 -2
  120. package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +0 -6
  121. package/dist/plugin/theme/src/plugin/dimension/constants/index.d.ts +3 -0
  122. package/dist/plugin/theme/src/plugin/dimension/types/dimension.d.ts +9 -6
  123. package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +11 -0
  124. package/dist/plugin/theme/src/plugin/dimension/types/index.d.ts +2 -2
  125. package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +1 -0
  126. package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +0 -10
  127. package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +3 -19
  128. package/dist/plugin/theme/src/types/listener-entry.d.ts +6 -0
  129. package/dist/plugin/theme/src/utils/request.d.ts +1 -0
  130. package/dist/src/plugin/appearance/constants/index.d.ts +2 -2
  131. package/dist/src/plugin/appearance/types/appearance.d.ts +0 -6
  132. package/dist/src/plugin/dimension/constants/index.d.ts +3 -0
  133. package/dist/src/plugin/dimension/types/dimension.d.ts +9 -6
  134. package/dist/src/plugin/dimension/types/dimensions.d.ts +11 -0
  135. package/dist/src/plugin/dimension/types/index.d.ts +2 -2
  136. package/dist/src/plugin/platform/constants/index.d.ts +1 -0
  137. package/dist/src/plugin/platform/cores/index.d.ts +0 -10
  138. package/dist/src/plugin/platform/types/platform.d.ts +3 -19
  139. package/dist/src/types/listener-entry.d.ts +6 -0
  140. package/dist/src/utils/request.d.ts +1 -0
  141. package/package.json +1 -1
@@ -26,7 +26,7 @@ function createCustomError(name, Base) {
26
26
  else
27
27
  error.__proto__ = CustomError.prototype;
28
28
  error.name = name;
29
- if (message !== undefined)
29
+ if (typeof message !== 'undefined')
30
30
  error.message = message;
31
31
  if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
32
32
  try {
@@ -209,7 +209,7 @@ function capitalize(_) {
209
209
  var result = '';
210
210
  for (var i = 0; i < groups.length - 2; i++) {
211
211
  var arg = groups[i];
212
- if (arg !== undefined)
212
+ if (typeof arg !== 'undefined')
213
213
  result = result + arg.charAt(0).toUpperCase() + arg.slice(1);
214
214
  }
215
215
  return result;
@@ -233,7 +233,7 @@ var EventListenerUtils = {
233
233
  add: function (target, eventListenerOptions) {
234
234
  if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
235
235
  var callback = eventListenerOptions.callback;
236
- if (target === undefined || callback === null)
236
+ if (typeof target === 'undefined' || callback === null)
237
237
  return;
238
238
  var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
239
239
  var options = eventListenerOptions.options;
@@ -261,9 +261,9 @@ var EventListenerUtils = {
261
261
  }
262
262
  }
263
263
  function wrapper(event) {
264
- if (event === undefined)
264
+ if (typeof event === 'undefined')
265
265
  event = globalThis.event;
266
- if (event === undefined)
266
+ if (typeof event === 'undefined')
267
267
  return;
268
268
  event.currentTarget = target;
269
269
  if (typeof event.preventDefault !== 'function')
@@ -284,7 +284,7 @@ var EventListenerUtils = {
284
284
  remove: function (target, eventListenerOptions) {
285
285
  if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
286
286
  var callback = eventListenerOptions.callback;
287
- if (target === undefined || callback === null)
287
+ if (typeof target === 'undefined' || callback === null)
288
288
  return;
289
289
  var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
290
290
  var options = eventListenerOptions.options;
@@ -313,7 +313,7 @@ var EventListenerUtils = {
313
313
  }
314
314
  if (typeof target.detachEvent === 'function') {
315
315
  var wrapper = callback.__ieWrapper;
316
- if (wrapper !== undefined) {
316
+ if (typeof wrapper !== 'undefined') {
317
317
  target.detachEvent('on' + type, wrapper);
318
318
  delete callback.__ieWrapper;
319
319
  }
@@ -321,7 +321,7 @@ var EventListenerUtils = {
321
321
  }
322
322
  },
323
323
  withVender: function (target, type) {
324
- if (type === undefined)
324
+ if (typeof type === 'undefined')
325
325
  return '';
326
326
  if (target === globalThis.document && ['deviceready', 'pause', 'resume', 'backbutton', 'menubutton', 'searchbutton', 'startcallbutton', 'endcallbutton', 'volumedownbutton', 'volumeupbutton', 'activated', 'cordovacallbackerror'].indexOf(type) > -1)
327
327
  return type;
@@ -392,6 +392,14 @@ var CrossPlatformFramework;
392
392
  CrossPlatformFramework["Cordova"] = "Cordova";
393
393
  })(CrossPlatformFramework || (CrossPlatformFramework = {}));
394
394
  var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
395
+ var HIGH_ENTROPY_BRAND_NAME_MAP = {
396
+ 'Google Chrome': 'Chrome',
397
+ 'Microsoft Edge': 'Edge',
398
+ 'Microsoft Edge WebView2': 'Edge WebView2',
399
+ 'Android WebView': 'Chrome WebView',
400
+ 'HeadlessChrome': 'Chrome Headless',
401
+ 'OperaMobile': 'Opera Mobi',
402
+ };
395
403
 
396
404
  var readyState = 'loading';
397
405
  var readyCallback = [];
@@ -405,15 +413,9 @@ var Platform = {
405
413
  get readyState() {
406
414
  return readyState;
407
415
  },
408
- get network() {
409
- return getNetwork();
410
- },
411
416
  get locale() {
412
417
  return getLocale();
413
418
  },
414
- get dimension() {
415
- return getDimension();
416
- },
417
419
  get device() {
418
420
  if (this.os.name === OS.iOS || this.os.name === OS.Android)
419
421
  return Devices.Mobile;
@@ -428,7 +430,7 @@ var Platform = {
428
430
  return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
429
431
  },
430
432
  get isNode() {
431
- return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
433
+ return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.node !== 'undefined';
432
434
  },
433
435
  get isStandalone() {
434
436
  if (this.os.name === OS.iOS)
@@ -450,6 +452,33 @@ var Platform = {
450
452
  }
451
453
  }
452
454
  };
455
+ function resolveWindowsVersion(string) {
456
+ if (typeof string === 'undefined')
457
+ return '';
458
+ var mapped = {
459
+ '4.90': 'ME',
460
+ 'NT3.51': 'NT 3.11',
461
+ 'NT4.0': 'NT 4.0',
462
+ 'NT 5.0': '2000',
463
+ 'NT 5.1': 'XP',
464
+ 'NT 5.2': 'XP',
465
+ 'NT 6.0': 'Vista',
466
+ 'NT 6.1': '7',
467
+ 'NT 6.2': '8',
468
+ 'NT 6.3': '8.1',
469
+ 'NT 6.4': '10',
470
+ 'NT 10.0': '10',
471
+ 'ARM': 'RT'
472
+ }[string];
473
+ if (typeof mapped !== 'undefined')
474
+ return mapped;
475
+ return string;
476
+ }
477
+ function resolveUnderscoreVersion(string) {
478
+ if (typeof string === 'undefined')
479
+ return '';
480
+ return string.replace(/_/g, '.');
481
+ }
453
482
  var OS_RESOLVER_MAP = [
454
483
  [/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
455
484
  [/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
@@ -508,14 +537,6 @@ var BROWSER_RESOLVER_MAP = [
508
537
  [/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
509
538
  [/firefox\/([\w.]+)/i, Browsers.Firefox],
510
539
  ];
511
- var HIGH_ENTROPY_BRAND_NAME_MAP = {
512
- 'Google Chrome': 'Chrome',
513
- 'Microsoft Edge': 'Edge',
514
- 'Microsoft Edge WebView2': 'Edge WebView2',
515
- 'Android WebView': 'Chrome WebView',
516
- 'HeadlessChrome': 'Chrome Headless',
517
- 'OperaMobile': 'Opera Mobi',
518
- };
519
540
  function incrementPendingTasks() {
520
541
  pendingTasks++;
521
542
  }
@@ -536,33 +557,6 @@ function checkReady() {
536
557
  readyCallback.length = 0;
537
558
  }
538
559
  }
539
- function resolveWindowsVersion(string) {
540
- if (string === undefined)
541
- return '';
542
- var mapped = {
543
- '4.90': 'ME',
544
- 'NT3.51': 'NT 3.11',
545
- 'NT4.0': 'NT 4.0',
546
- 'NT 5.0': '2000',
547
- 'NT 5.1': 'XP',
548
- 'NT 5.2': 'XP',
549
- 'NT 6.0': 'Vista',
550
- 'NT 6.1': '7',
551
- 'NT 6.2': '8',
552
- 'NT 6.3': '8.1',
553
- 'NT 6.4': '10',
554
- 'NT 10.0': '10',
555
- 'ARM': 'RT'
556
- }[string];
557
- if (mapped !== undefined)
558
- return mapped;
559
- return string;
560
- }
561
- function resolveUnderscoreVersion(string) {
562
- if (string === undefined)
563
- return '';
564
- return string.replace(/_/g, '.');
565
- }
566
560
  function resolveSemanticWindowsVersion(version, defaultValue) {
567
561
  if (version.major === 10 && version.minor === 0 && version.build >= 22000)
568
562
  return '11';
@@ -699,12 +693,12 @@ function resolveVersion(string, resolver) {
699
693
  return resolver(string);
700
694
  if (typeof resolver === 'string')
701
695
  return resolver;
702
- if (string === undefined)
696
+ if (typeof string === 'undefined')
703
697
  return '';
704
698
  return string;
705
699
  }
706
700
  function normalizeBrand(entry) {
707
- if (entry === null || entry === undefined)
701
+ if (entry === null || typeof entry === 'undefined')
708
702
  return { brand: '', version: '' };
709
703
  if (typeof entry === 'string')
710
704
  return { brand: entry, version: '' };
@@ -758,102 +752,13 @@ function getRenderer() {
758
752
  return '';
759
753
  }
760
754
  }
761
- function getNetwork() {
762
- var network = {
763
- isOnline: null,
764
- effectiveType: null,
765
- type: null,
766
- downlink: null,
767
- rtt: null,
768
- saveData: null,
769
- };
770
- if (typeof globalThis.navigator !== 'undefined') {
771
- if (typeof globalThis.navigator.onLine !== 'undefined')
772
- network.isOnline = globalThis.navigator.onLine;
773
- var connection = globalThis.navigator.connection || globalThis.navigator.mozConnection || globalThis.navigator.webkitConnection;
774
- if (typeof connection !== 'undefined') {
775
- if (typeof connection.effectiveType !== 'undefined')
776
- network.effectiveType = connection.effectiveType;
777
- if (typeof connection.type !== 'undefined')
778
- network.type = connection.type;
779
- if (typeof connection.downlink !== 'undefined')
780
- network.downlink = connection.downlink;
781
- if (typeof connection.rtt !== 'undefined')
782
- network.rtt = connection.rtt;
783
- if (typeof connection.saveData !== 'undefined')
784
- network.saveData = connection.saveData;
785
- return network;
786
- }
787
- }
788
- if (Platform.isNode) {
789
- try {
790
- var os = require('os');
791
- var networkInterfaces = os.networkInterfaces();
792
- var networkInterfaceNames = Object.keys(networkInterfaces);
793
- for (var i = 0; i < networkInterfaceNames.length; i++) {
794
- var name_1 = networkInterfaceNames[i];
795
- var networkInterface = networkInterfaces[name_1];
796
- for (var j = 0; j < networkInterface.length; j++) {
797
- var address = networkInterface[j];
798
- if (!address.internal && address.family === 'IPv4')
799
- network.isOnline = true;
800
- }
801
- if (network.isOnline)
802
- break;
803
- }
804
- }
805
- catch (_) {
806
- }
807
- try {
808
- var childProcess = require('child_process');
809
- if (Platform.os.name === OS.Windows) {
810
- try {
811
- var output = childProcess.execSync('netsh wlan show interfaces', { encoding: 'utf8', timeout: 5000 });
812
- if (output.includes('State') && output.includes('connected'))
813
- network.type = 'wifi';
814
- }
815
- catch (_) {
816
- }
817
- if (network.type === null) {
818
- try {
819
- var output = childProcess.execSync('ipconfig', { encoding: 'utf8', timeout: 5000 });
820
- if (output.includes('Ethernet adapter'))
821
- network.type = 'ethernet';
822
- }
823
- catch (_) {
824
- }
825
- }
826
- if (network.type === null)
827
- network.type = 'other';
828
- }
829
- else if (Platform.os.name === OS.MacOS) {
830
- try {
831
- var output = childProcess.execSync('networksetup -listallhardwareports', { encoding: 'utf8', timeout: 5000 });
832
- var activeInterface = childProcess.execSync('route -n get default | grep interface', { encoding: 'utf8', timeout: 5000 });
833
- if (activeInterface.includes('en0') && output.includes('Wi-Fi'))
834
- network.type = 'wifi';
835
- else if (activeInterface.includes('en') || output.includes('Ethernet'))
836
- network.type = 'ethernet';
837
- else
838
- network.type = 'other';
839
- }
840
- catch (_) {
841
- network.type = 'other';
842
- }
843
- }
844
- }
845
- catch (_) {
846
- }
847
- }
848
- return network;
849
- }
850
755
  function normalizeLocale(locale) {
851
- if (locale === null || locale === undefined)
756
+ if (locale === null || typeof locale === 'undefined')
852
757
  return locale;
853
758
  if (locale.length === 0)
854
759
  return null;
855
760
  locale = locale.replace(/_/g, '-');
856
- if (locale === 'C' || locale === 'posix' || locale === 'POSIX')
761
+ if (locale === 'C' || locale.toLowerCase() === 'posix')
857
762
  return 'en-US';
858
763
  if (locale.indexOf('.') !== -1)
859
764
  return normalizeLocale(locale.split('.')[0]);
@@ -871,9 +776,9 @@ function normalizeLocale(locale) {
871
776
  }
872
777
  function getLocale() {
873
778
  var locale = {
874
- language: '',
779
+ language: null,
875
780
  languages: [],
876
- timezone: '',
781
+ timezone: null,
877
782
  timezoneOffset: 0,
878
783
  };
879
784
  function addLanguages(language) {
@@ -883,7 +788,7 @@ function getLocale() {
883
788
  function addLanguage(language) {
884
789
  language = normalizeLocale(language);
885
790
  if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
886
- if (locale.language.length === 0)
791
+ if (locale.language === null)
887
792
  locale.language = language;
888
793
  locale.languages.push(language);
889
794
  }
@@ -941,6 +846,11 @@ function getLocale() {
941
846
  }
942
847
  catch (_) {
943
848
  }
849
+ try {
850
+ locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
851
+ }
852
+ catch (_) {
853
+ }
944
854
  }
945
855
  if (typeof globalThis.navigator !== 'undefined') {
946
856
  if (typeof globalThis.navigator.languages !== 'undefined')
@@ -954,13 +864,6 @@ function getLocale() {
954
864
  if (typeof globalThis.navigator.systemLanguage !== 'undefined')
955
865
  addLanguage(globalThis.navigator.systemLanguage);
956
866
  }
957
- try {
958
- if (typeof Intl !== 'undefined') {
959
- locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
960
- }
961
- }
962
- catch (_) {
963
- }
964
867
  try {
965
868
  locale.timezoneOffset = new Date().getTimezoneOffset();
966
869
  }
@@ -968,63 +871,8 @@ function getLocale() {
968
871
  }
969
872
  return locale;
970
873
  }
971
- function getDimension() {
972
- var dimension = {
973
- innerWidth: -1,
974
- innerHeight: -1,
975
- outerWidth: -1,
976
- outerHeight: -1,
977
- scale: 1,
978
- };
979
- if (typeof globalThis.innerWidth !== 'undefined') {
980
- dimension.innerWidth = globalThis.innerWidth;
981
- dimension.innerHeight = globalThis.innerHeight;
982
- dimension.outerWidth = globalThis.outerWidth;
983
- dimension.outerHeight = globalThis.outerHeight;
984
- dimension.scale = globalThis.devicePixelRatio || 1;
985
- return dimension;
986
- }
987
- if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
988
- try {
989
- var reactNative = require('react-native');
990
- var dimensions = reactNative.Dimensions;
991
- var pixelRatio = reactNative.PixelRatio;
992
- var screenDimensions = dimensions.get('screen');
993
- var windowDimensions = dimensions.get('window');
994
- dimension.innerWidth = screenDimensions.width;
995
- dimension.innerHeight = screenDimensions.height;
996
- dimension.outerWidth = windowDimensions.width;
997
- dimension.outerHeight = windowDimensions.height;
998
- dimension.scale = pixelRatio.get();
999
- return dimension;
1000
- }
1001
- catch (_) {
1002
- }
1003
- }
1004
- if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
1005
- try {
1006
- var electron = require('electron');
1007
- var screen_1 = electron.screen;
1008
- var browserWindow = electron.BrowserWindow;
1009
- var focusedWindow = browserWindow.getFocusedWindow() || browserWindow.getAllWindows()[0];
1010
- if (focusedWindow !== undefined) {
1011
- var contentSize = focusedWindow.getContentSize();
1012
- var size = focusedWindow.getSize();
1013
- dimension.innerWidth = contentSize[0];
1014
- dimension.innerHeight = contentSize[1];
1015
- dimension.outerWidth = size[0];
1016
- dimension.outerHeight = size[1];
1017
- dimension.scale = screen_1.getDisplayMatching(focusedWindow.getBounds()).scaleFactor;
1018
- }
1019
- return dimension;
1020
- }
1021
- catch (_) {
1022
- }
1023
- }
1024
- return dimension;
1025
- }
1026
874
  function init() {
1027
- if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT)))
875
+ if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.electron !== 'undefined') || (/ electron\//i.test(USER_AGENT)))
1028
876
  Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
1029
877
  if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative')
1030
878
  Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
@@ -1220,8 +1068,7 @@ function init() {
1220
1068
  finally {
1221
1069
  decrementPendingTasks();
1222
1070
  }
1223
- })
1224
- .catch(decrementPendingTasks);
1071
+ });
1225
1072
  }
1226
1073
  checkReady();
1227
1074
  }
@@ -1244,15 +1091,15 @@ function getTrackId(bundle) {
1244
1091
  if (xhr.status === 200) {
1245
1092
  try {
1246
1093
  var response = JSON.parse(xhr.response);
1247
- if (response.results === undefined)
1094
+ if (typeof response.results === 'undefined')
1248
1095
  return undefined;
1249
1096
  var results = response.results;
1250
- if (!Array.isArray(results) || results.length === 0)
1097
+ if (results.length === 0)
1251
1098
  return undefined;
1252
1099
  var result = results[0];
1253
- if (result === undefined)
1100
+ if (typeof result === 'undefined')
1254
1101
  return undefined;
1255
- return result.trackId;
1102
+ return "" + result.trackId;
1256
1103
  }
1257
1104
  catch (_) {
1258
1105
  return undefined;
@@ -1269,17 +1116,17 @@ function createIntentURL(scheme, packageName, fallback) {
1269
1116
  var prefix = split[0];
1270
1117
  var suffix = split[1];
1271
1118
  var intent = 'intent://';
1272
- if (suffix !== undefined)
1119
+ if (typeof suffix !== 'undefined')
1273
1120
  intent = intent + suffix;
1274
1121
  intent = intent + '#Intent;'
1275
1122
  + 'scheme=' + prefix + ';'
1276
1123
  + 'action=android.intent.action.VIEW;'
1277
1124
  + 'category=android.intent.category.BROWSABLE;';
1278
- if (packageName !== undefined)
1125
+ if (typeof packageName !== 'undefined')
1279
1126
  intent = intent + 'package=' + packageName + ';';
1280
- if (fallback !== undefined && typeof fallback === 'string')
1127
+ if (typeof fallback !== 'undefined' && typeof fallback === 'string')
1281
1128
  intent = intent + 'S.browser_fallback_url=' + fallback + ';';
1282
- else if (packageName !== undefined)
1129
+ else if (typeof packageName !== 'undefined')
1283
1130
  intent = intent + 'S.browser_fallback_url=' + createAppStoreURL(packageName, OS.Android) + ';';
1284
1131
  return intent + 'end';
1285
1132
  }
@@ -1297,16 +1144,16 @@ function parseIntentURL(intent) {
1297
1144
  if (index !== -1)
1298
1145
  extras[part.substring(0, index)] = part.substring(index + 1);
1299
1146
  }
1300
- if (extras['scheme'] !== undefined)
1147
+ if (typeof extras['scheme'] !== 'undefined')
1301
1148
  parsed.scheme = (extras['scheme'] + '://' + host);
1302
- if (extras['package'] !== undefined)
1149
+ if (typeof extras['package'] !== 'undefined')
1303
1150
  parsed.packageName = extras['package'];
1304
- if (extras['S.browser_fallback_url'] !== undefined)
1151
+ if (typeof extras['S.browser_fallback_url'] !== 'undefined')
1305
1152
  parsed.fallback = extras['S.browser_fallback_url'];
1306
1153
  return parsed;
1307
1154
  }
1308
1155
  function createAppStoreURL(packageName, os) {
1309
- if (packageName === undefined)
1156
+ if (typeof packageName === 'undefined')
1310
1157
  return undefined;
1311
1158
  switch (os) {
1312
1159
  case OS.Android:
@@ -1322,7 +1169,7 @@ function createAppStoreURL(packageName, os) {
1322
1169
  }
1323
1170
  }
1324
1171
  function createWebStoreURL(packageName, os) {
1325
- if (packageName === undefined)
1172
+ if (typeof packageName === 'undefined')
1326
1173
  return undefined;
1327
1174
  switch (os) {
1328
1175
  case OS.Android:
@@ -1387,7 +1234,7 @@ function openURLViaHref(url, index) {
1387
1234
  return;
1388
1235
  }
1389
1236
  a = createHiddenElement('a');
1390
- if (a === undefined)
1237
+ if (typeof a === 'undefined')
1391
1238
  return;
1392
1239
  a.href = url;
1393
1240
  topDocument.body.appendChild(a);
@@ -1397,7 +1244,7 @@ function openURLViaHref(url, index) {
1397
1244
  catch (_) {
1398
1245
  }
1399
1246
  finally {
1400
- if (a !== undefined) {
1247
+ if (typeof a !== 'undefined') {
1401
1248
  try {
1402
1249
  topDocument.body.removeChild(a);
1403
1250
  }
@@ -1412,12 +1259,12 @@ function openURLViaIframe(url) {
1412
1259
  var iframe = undefined;
1413
1260
  try {
1414
1261
  iframe = createHiddenElement('iframe');
1415
- if (iframe === undefined)
1262
+ if (typeof iframe === 'undefined')
1416
1263
  return;
1417
1264
  iframe.src = url;
1418
1265
  topDocument.body.appendChild(iframe);
1419
1266
  globalThis.setTimeout(function () {
1420
- if (iframe !== undefined) {
1267
+ if (typeof iframe !== 'undefined') {
1421
1268
  try {
1422
1269
  topDocument.body.removeChild(iframe);
1423
1270
  }
@@ -1441,13 +1288,13 @@ function isDocumentHidden() {
1441
1288
  return true;
1442
1289
  if (topDocument.msVisibilityState === 'hidden')
1443
1290
  return true;
1444
- if (topDocument.hidden !== undefined)
1291
+ if (typeof topDocument.hidden !== 'undefined')
1445
1292
  return topDocument.hidden;
1446
- if (topDocument.webkitHidden !== undefined)
1293
+ if (typeof topDocument.webkitHidden !== 'undefined')
1447
1294
  return topDocument.webkitHidden;
1448
- if (topDocument.mozHidden !== undefined)
1295
+ if (typeof topDocument.mozHidden !== 'undefined')
1449
1296
  return topDocument.mozHidden;
1450
- if (topDocument.msHidden !== undefined)
1297
+ if (typeof topDocument.msHidden !== 'undefined')
1451
1298
  return topDocument.msHidden;
1452
1299
  if (typeof topDocument.hasFocus === 'function')
1453
1300
  return !topDocument.hasFocus();
@@ -1484,7 +1331,7 @@ function restoreFocus() {
1484
1331
  var input = undefined;
1485
1332
  try {
1486
1333
  input = createHiddenElement('input');
1487
- if (input === undefined)
1334
+ if (typeof input === 'undefined')
1488
1335
  return false;
1489
1336
  input.type = 'text';
1490
1337
  input.readOnly = true;
@@ -1501,7 +1348,7 @@ function restoreFocus() {
1501
1348
  catch (_) {
1502
1349
  }
1503
1350
  finally {
1504
- if (input !== undefined) {
1351
+ if (typeof input !== 'undefined') {
1505
1352
  try {
1506
1353
  input.blur();
1507
1354
  }
@@ -1591,7 +1438,7 @@ function tryOpenURL(url, index, timeout) {
1591
1438
  var timeoutId;
1592
1439
  var resolved = false;
1593
1440
  function cleanup() {
1594
- if (timeoutId !== undefined) {
1441
+ if (typeof timeoutId !== 'undefined') {
1595
1442
  clearTimeout(timeoutId);
1596
1443
  timeoutId = undefined;
1597
1444
  }
@@ -1602,14 +1449,14 @@ function tryOpenURL(url, index, timeout) {
1602
1449
  }
1603
1450
  catch (_) {
1604
1451
  }
1605
- if (a !== undefined) {
1452
+ if (typeof a !== 'undefined') {
1606
1453
  try {
1607
1454
  topDocument.body.removeChild(a);
1608
1455
  }
1609
1456
  catch (_) {
1610
1457
  }
1611
1458
  }
1612
- if (iframe !== undefined) {
1459
+ if (typeof iframe !== 'undefined') {
1613
1460
  try {
1614
1461
  topDocument.body.removeChild(iframe);
1615
1462
  }
@@ -1633,7 +1480,7 @@ function tryOpenURL(url, index, timeout) {
1633
1480
  }
1634
1481
  }
1635
1482
  function onBlur() {
1636
- if (timeoutId !== undefined) {
1483
+ if (typeof timeoutId !== 'undefined') {
1637
1484
  clearTimeout(timeoutId);
1638
1485
  timeoutId = undefined;
1639
1486
  }
@@ -1676,7 +1523,7 @@ function open(options) {
1676
1523
  var timeout;
1677
1524
  if (Platform.os.name === OS.Android) {
1678
1525
  var option = options[OS.Android] || options['android'];
1679
- if (option === undefined)
1526
+ if (typeof option === 'undefined')
1680
1527
  return Promise.reject(getURLOpenError(tried));
1681
1528
  timeout = option.timeout;
1682
1529
  infos.scheme = urlToString(option.scheme);
@@ -1687,21 +1534,21 @@ function open(options) {
1687
1534
  infos.webStore = createWebStoreURL(infos.packageName, OS.Android);
1688
1535
  infos.allowAppStore = option.allowAppStore;
1689
1536
  infos.allowWebStore = option.allowWebStore;
1690
- if (infos.intent !== undefined && (infos.scheme === undefined || infos.packageName === undefined || infos.fallback === undefined)) {
1537
+ if (typeof infos.intent !== 'undefined' && (typeof infos.scheme === 'undefined' || typeof infos.packageName === 'undefined' || typeof infos.fallback === 'undefined')) {
1691
1538
  var parsed = parseIntentURL(infos.intent);
1692
- if (parsed.scheme !== undefined && infos.scheme === undefined)
1539
+ if (typeof parsed.scheme !== 'undefined' && typeof infos.scheme === 'undefined')
1693
1540
  infos.scheme = parsed.scheme;
1694
- if (parsed.packageName !== undefined && infos.packageName === undefined)
1541
+ if (typeof parsed.packageName !== 'undefined' && typeof infos.packageName === 'undefined')
1695
1542
  infos.packageName = parsed.packageName;
1696
- if (parsed.fallback !== undefined && infos.fallback === undefined)
1543
+ if (typeof parsed.fallback !== 'undefined' && typeof infos.fallback === 'undefined')
1697
1544
  infos.fallback = parsed.fallback;
1698
1545
  }
1699
- if (infos.scheme !== undefined && infos.intent === undefined)
1546
+ if (typeof infos.scheme !== 'undefined' && typeof infos.intent === 'undefined')
1700
1547
  infos.intent = createIntentURL(infos.scheme, infos.packageName, infos.fallback);
1701
1548
  }
1702
1549
  else if (Platform.os.name === OS.iOS) {
1703
1550
  var option = options[OS.iOS] || options['ios'];
1704
- if (option === undefined)
1551
+ if (typeof option === 'undefined')
1705
1552
  return Promise.reject(getURLOpenError(tried));
1706
1553
  timeout = option.timeout;
1707
1554
  infos.scheme = urlToString(option.scheme);
@@ -1713,12 +1560,12 @@ function open(options) {
1713
1560
  infos.webStore = createWebStoreURL(infos.trackId, OS.iOS);
1714
1561
  infos.allowAppStore = option.allowAppStore;
1715
1562
  infos.allowWebStore = option.allowWebStore;
1716
- if (infos.bundleId !== undefined && infos.trackId === undefined)
1563
+ if (typeof infos.bundleId !== 'undefined' && typeof infos.trackId === 'undefined')
1717
1564
  infos.trackId = getTrackId(infos.bundleId);
1718
1565
  }
1719
1566
  else if (Platform.os.name === OS.Windows) {
1720
1567
  var option = options[OS.Windows] || options['windows'];
1721
- if (option === undefined)
1568
+ if (typeof option === 'undefined')
1722
1569
  return Promise.reject(getURLOpenError(tried));
1723
1570
  timeout = option.timeout;
1724
1571
  infos.scheme = urlToString(option.scheme);
@@ -1731,7 +1578,7 @@ function open(options) {
1731
1578
  }
1732
1579
  else if (Platform.os.name === OS.MacOS) {
1733
1580
  var option = options[OS.MacOS] || options['mac'];
1734
- if (option === undefined)
1581
+ if (typeof option === 'undefined')
1735
1582
  return Promise.reject(getURLOpenError(tried));
1736
1583
  timeout = option.timeout;
1737
1584
  infos.scheme = urlToString(option.scheme);
@@ -1742,7 +1589,7 @@ function open(options) {
1742
1589
  infos.webStore = createWebStoreURL(infos.trackId, OS.MacOS);
1743
1590
  infos.allowAppStore = option.allowAppStore;
1744
1591
  infos.allowWebStore = option.allowWebStore;
1745
- if (infos.bundleId !== undefined && infos.trackId === undefined)
1592
+ if (typeof infos.bundleId !== 'undefined' && typeof infos.trackId === 'undefined')
1746
1593
  infos.trackId = getTrackId(infos.bundleId);
1747
1594
  }
1748
1595
  pushURL(urls, infos.intent, AppOpenState.Intent, canOpenIntentURL());
@@ -1751,7 +1598,7 @@ function open(options) {
1751
1598
  pushURL(urls, infos.fallback, AppOpenState.Fallback);
1752
1599
  pushURL(urls, infos.appStore, AppOpenState.Store, infos.allowAppStore);
1753
1600
  pushURL(urls, infos.webStore, AppOpenState.Store, infos.allowWebStore);
1754
- if (timeout === undefined)
1601
+ if (typeof timeout === 'undefined')
1755
1602
  timeout = getDefaultTimeoutByOS(os);
1756
1603
  return new Promise(function (resolve, reject) {
1757
1604
  function openURLSequential(index) {
@@ -1892,15 +1739,15 @@ function normalize(value) {
1892
1739
  var key = keys[i];
1893
1740
  result[key] = stringifiableToString(value[key]);
1894
1741
  }
1895
- if (result.to === undefined)
1742
+ if (typeof result.to === 'undefined')
1896
1743
  result.to = '';
1897
- if (result.cc === undefined)
1744
+ if (typeof result.cc === 'undefined')
1898
1745
  result.cc = '';
1899
- if (result.bcc === undefined)
1746
+ if (typeof result.bcc === 'undefined')
1900
1747
  result.bcc = '';
1901
- if (result.subject === undefined)
1748
+ if (typeof result.subject === 'undefined')
1902
1749
  result.subject = '';
1903
- if (result.body === undefined)
1750
+ if (typeof result.body === 'undefined')
1904
1751
  result.body = '';
1905
1752
  return result;
1906
1753
  }