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
@@ -24,7 +24,7 @@ function createCustomError(name, Base) {
24
24
  else
25
25
  error.__proto__ = CustomError.prototype;
26
26
  error.name = name;
27
- if (message !== undefined)
27
+ if (typeof message !== 'undefined')
28
28
  error.message = message;
29
29
  if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
30
30
  try {
@@ -207,7 +207,7 @@ function capitalize(_) {
207
207
  var result = '';
208
208
  for (var i = 0; i < groups.length - 2; i++) {
209
209
  var arg = groups[i];
210
- if (arg !== undefined)
210
+ if (typeof arg !== 'undefined')
211
211
  result = result + arg.charAt(0).toUpperCase() + arg.slice(1);
212
212
  }
213
213
  return result;
@@ -231,7 +231,7 @@ var EventListenerUtils = {
231
231
  add: function (target, eventListenerOptions) {
232
232
  if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
233
233
  var callback = eventListenerOptions.callback;
234
- if (target === undefined || callback === null)
234
+ if (typeof target === 'undefined' || callback === null)
235
235
  return;
236
236
  var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
237
237
  var options = eventListenerOptions.options;
@@ -259,9 +259,9 @@ var EventListenerUtils = {
259
259
  }
260
260
  }
261
261
  function wrapper(event) {
262
- if (event === undefined)
262
+ if (typeof event === 'undefined')
263
263
  event = globalThis.event;
264
- if (event === undefined)
264
+ if (typeof event === 'undefined')
265
265
  return;
266
266
  event.currentTarget = target;
267
267
  if (typeof event.preventDefault !== 'function')
@@ -282,7 +282,7 @@ var EventListenerUtils = {
282
282
  remove: function (target, eventListenerOptions) {
283
283
  if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
284
284
  var callback = eventListenerOptions.callback;
285
- if (target === undefined || callback === null)
285
+ if (typeof target === 'undefined' || callback === null)
286
286
  return;
287
287
  var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
288
288
  var options = eventListenerOptions.options;
@@ -311,7 +311,7 @@ var EventListenerUtils = {
311
311
  }
312
312
  if (typeof target.detachEvent === 'function') {
313
313
  var wrapper = callback.__ieWrapper;
314
- if (wrapper !== undefined) {
314
+ if (typeof wrapper !== 'undefined') {
315
315
  target.detachEvent('on' + type, wrapper);
316
316
  delete callback.__ieWrapper;
317
317
  }
@@ -319,7 +319,7 @@ var EventListenerUtils = {
319
319
  }
320
320
  },
321
321
  withVender: function (target, type) {
322
- if (type === undefined)
322
+ if (typeof type === 'undefined')
323
323
  return '';
324
324
  if (target === globalThis.document && ['deviceready', 'pause', 'resume', 'backbutton', 'menubutton', 'searchbutton', 'startcallbutton', 'endcallbutton', 'volumedownbutton', 'volumeupbutton', 'activated', 'cordovacallbackerror'].indexOf(type) > -1)
325
325
  return type;
@@ -390,6 +390,14 @@ var CrossPlatformFramework;
390
390
  CrossPlatformFramework["Cordova"] = "Cordova";
391
391
  })(CrossPlatformFramework || (CrossPlatformFramework = {}));
392
392
  var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
393
+ var HIGH_ENTROPY_BRAND_NAME_MAP = {
394
+ 'Google Chrome': 'Chrome',
395
+ 'Microsoft Edge': 'Edge',
396
+ 'Microsoft Edge WebView2': 'Edge WebView2',
397
+ 'Android WebView': 'Chrome WebView',
398
+ 'HeadlessChrome': 'Chrome Headless',
399
+ 'OperaMobile': 'Opera Mobi',
400
+ };
393
401
 
394
402
  var readyState = 'loading';
395
403
  var readyCallback = [];
@@ -403,15 +411,9 @@ var Platform = {
403
411
  get readyState() {
404
412
  return readyState;
405
413
  },
406
- get network() {
407
- return getNetwork();
408
- },
409
414
  get locale() {
410
415
  return getLocale();
411
416
  },
412
- get dimension() {
413
- return getDimension();
414
- },
415
417
  get device() {
416
418
  if (this.os.name === OS.iOS || this.os.name === OS.Android)
417
419
  return Devices.Mobile;
@@ -426,7 +428,7 @@ var Platform = {
426
428
  return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
427
429
  },
428
430
  get isNode() {
429
- return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
431
+ return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.node !== 'undefined';
430
432
  },
431
433
  get isStandalone() {
432
434
  if (this.os.name === OS.iOS)
@@ -448,6 +450,33 @@ var Platform = {
448
450
  }
449
451
  }
450
452
  };
453
+ function resolveWindowsVersion(string) {
454
+ if (typeof string === 'undefined')
455
+ return '';
456
+ var mapped = {
457
+ '4.90': 'ME',
458
+ 'NT3.51': 'NT 3.11',
459
+ 'NT4.0': 'NT 4.0',
460
+ 'NT 5.0': '2000',
461
+ 'NT 5.1': 'XP',
462
+ 'NT 5.2': 'XP',
463
+ 'NT 6.0': 'Vista',
464
+ 'NT 6.1': '7',
465
+ 'NT 6.2': '8',
466
+ 'NT 6.3': '8.1',
467
+ 'NT 6.4': '10',
468
+ 'NT 10.0': '10',
469
+ 'ARM': 'RT'
470
+ }[string];
471
+ if (typeof mapped !== 'undefined')
472
+ return mapped;
473
+ return string;
474
+ }
475
+ function resolveUnderscoreVersion(string) {
476
+ if (typeof string === 'undefined')
477
+ return '';
478
+ return string.replace(/_/g, '.');
479
+ }
451
480
  var OS_RESOLVER_MAP = [
452
481
  [/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
453
482
  [/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
@@ -506,14 +535,6 @@ var BROWSER_RESOLVER_MAP = [
506
535
  [/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
507
536
  [/firefox\/([\w.]+)/i, Browsers.Firefox],
508
537
  ];
509
- var HIGH_ENTROPY_BRAND_NAME_MAP = {
510
- 'Google Chrome': 'Chrome',
511
- 'Microsoft Edge': 'Edge',
512
- 'Microsoft Edge WebView2': 'Edge WebView2',
513
- 'Android WebView': 'Chrome WebView',
514
- 'HeadlessChrome': 'Chrome Headless',
515
- 'OperaMobile': 'Opera Mobi',
516
- };
517
538
  function incrementPendingTasks() {
518
539
  pendingTasks++;
519
540
  }
@@ -534,33 +555,6 @@ function checkReady() {
534
555
  readyCallback.length = 0;
535
556
  }
536
557
  }
537
- function resolveWindowsVersion(string) {
538
- if (string === undefined)
539
- return '';
540
- var mapped = {
541
- '4.90': 'ME',
542
- 'NT3.51': 'NT 3.11',
543
- 'NT4.0': 'NT 4.0',
544
- 'NT 5.0': '2000',
545
- 'NT 5.1': 'XP',
546
- 'NT 5.2': 'XP',
547
- 'NT 6.0': 'Vista',
548
- 'NT 6.1': '7',
549
- 'NT 6.2': '8',
550
- 'NT 6.3': '8.1',
551
- 'NT 6.4': '10',
552
- 'NT 10.0': '10',
553
- 'ARM': 'RT'
554
- }[string];
555
- if (mapped !== undefined)
556
- return mapped;
557
- return string;
558
- }
559
- function resolveUnderscoreVersion(string) {
560
- if (string === undefined)
561
- return '';
562
- return string.replace(/_/g, '.');
563
- }
564
558
  function resolveSemanticWindowsVersion(version, defaultValue) {
565
559
  if (version.major === 10 && version.minor === 0 && version.build >= 22000)
566
560
  return '11';
@@ -697,12 +691,12 @@ function resolveVersion(string, resolver) {
697
691
  return resolver(string);
698
692
  if (typeof resolver === 'string')
699
693
  return resolver;
700
- if (string === undefined)
694
+ if (typeof string === 'undefined')
701
695
  return '';
702
696
  return string;
703
697
  }
704
698
  function normalizeBrand(entry) {
705
- if (entry === null || entry === undefined)
699
+ if (entry === null || typeof entry === 'undefined')
706
700
  return { brand: '', version: '' };
707
701
  if (typeof entry === 'string')
708
702
  return { brand: entry, version: '' };
@@ -756,102 +750,13 @@ function getRenderer() {
756
750
  return '';
757
751
  }
758
752
  }
759
- function getNetwork() {
760
- var network = {
761
- isOnline: null,
762
- effectiveType: null,
763
- type: null,
764
- downlink: null,
765
- rtt: null,
766
- saveData: null,
767
- };
768
- if (typeof globalThis.navigator !== 'undefined') {
769
- if (typeof globalThis.navigator.onLine !== 'undefined')
770
- network.isOnline = globalThis.navigator.onLine;
771
- var connection = globalThis.navigator.connection || globalThis.navigator.mozConnection || globalThis.navigator.webkitConnection;
772
- if (typeof connection !== 'undefined') {
773
- if (typeof connection.effectiveType !== 'undefined')
774
- network.effectiveType = connection.effectiveType;
775
- if (typeof connection.type !== 'undefined')
776
- network.type = connection.type;
777
- if (typeof connection.downlink !== 'undefined')
778
- network.downlink = connection.downlink;
779
- if (typeof connection.rtt !== 'undefined')
780
- network.rtt = connection.rtt;
781
- if (typeof connection.saveData !== 'undefined')
782
- network.saveData = connection.saveData;
783
- return network;
784
- }
785
- }
786
- if (Platform.isNode) {
787
- try {
788
- var os = require('os');
789
- var networkInterfaces = os.networkInterfaces();
790
- var networkInterfaceNames = Object.keys(networkInterfaces);
791
- for (var i = 0; i < networkInterfaceNames.length; i++) {
792
- var name_1 = networkInterfaceNames[i];
793
- var networkInterface = networkInterfaces[name_1];
794
- for (var j = 0; j < networkInterface.length; j++) {
795
- var address = networkInterface[j];
796
- if (!address.internal && address.family === 'IPv4')
797
- network.isOnline = true;
798
- }
799
- if (network.isOnline)
800
- break;
801
- }
802
- }
803
- catch (_) {
804
- }
805
- try {
806
- var childProcess = require('child_process');
807
- if (Platform.os.name === OS.Windows) {
808
- try {
809
- var output = childProcess.execSync('netsh wlan show interfaces', { encoding: 'utf8', timeout: 5000 });
810
- if (output.includes('State') && output.includes('connected'))
811
- network.type = 'wifi';
812
- }
813
- catch (_) {
814
- }
815
- if (network.type === null) {
816
- try {
817
- var output = childProcess.execSync('ipconfig', { encoding: 'utf8', timeout: 5000 });
818
- if (output.includes('Ethernet adapter'))
819
- network.type = 'ethernet';
820
- }
821
- catch (_) {
822
- }
823
- }
824
- if (network.type === null)
825
- network.type = 'other';
826
- }
827
- else if (Platform.os.name === OS.MacOS) {
828
- try {
829
- var output = childProcess.execSync('networksetup -listallhardwareports', { encoding: 'utf8', timeout: 5000 });
830
- var activeInterface = childProcess.execSync('route -n get default | grep interface', { encoding: 'utf8', timeout: 5000 });
831
- if (activeInterface.includes('en0') && output.includes('Wi-Fi'))
832
- network.type = 'wifi';
833
- else if (activeInterface.includes('en') || output.includes('Ethernet'))
834
- network.type = 'ethernet';
835
- else
836
- network.type = 'other';
837
- }
838
- catch (_) {
839
- network.type = 'other';
840
- }
841
- }
842
- }
843
- catch (_) {
844
- }
845
- }
846
- return network;
847
- }
848
753
  function normalizeLocale(locale) {
849
- if (locale === null || locale === undefined)
754
+ if (locale === null || typeof locale === 'undefined')
850
755
  return locale;
851
756
  if (locale.length === 0)
852
757
  return null;
853
758
  locale = locale.replace(/_/g, '-');
854
- if (locale === 'C' || locale === 'posix' || locale === 'POSIX')
759
+ if (locale === 'C' || locale.toLowerCase() === 'posix')
855
760
  return 'en-US';
856
761
  if (locale.indexOf('.') !== -1)
857
762
  return normalizeLocale(locale.split('.')[0]);
@@ -869,9 +774,9 @@ function normalizeLocale(locale) {
869
774
  }
870
775
  function getLocale() {
871
776
  var locale = {
872
- language: '',
777
+ language: null,
873
778
  languages: [],
874
- timezone: '',
779
+ timezone: null,
875
780
  timezoneOffset: 0,
876
781
  };
877
782
  function addLanguages(language) {
@@ -881,7 +786,7 @@ function getLocale() {
881
786
  function addLanguage(language) {
882
787
  language = normalizeLocale(language);
883
788
  if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
884
- if (locale.language.length === 0)
789
+ if (locale.language === null)
885
790
  locale.language = language;
886
791
  locale.languages.push(language);
887
792
  }
@@ -939,6 +844,11 @@ function getLocale() {
939
844
  }
940
845
  catch (_) {
941
846
  }
847
+ try {
848
+ locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
849
+ }
850
+ catch (_) {
851
+ }
942
852
  }
943
853
  if (typeof globalThis.navigator !== 'undefined') {
944
854
  if (typeof globalThis.navigator.languages !== 'undefined')
@@ -952,13 +862,6 @@ function getLocale() {
952
862
  if (typeof globalThis.navigator.systemLanguage !== 'undefined')
953
863
  addLanguage(globalThis.navigator.systemLanguage);
954
864
  }
955
- try {
956
- if (typeof Intl !== 'undefined') {
957
- locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
958
- }
959
- }
960
- catch (_) {
961
- }
962
865
  try {
963
866
  locale.timezoneOffset = new Date().getTimezoneOffset();
964
867
  }
@@ -966,63 +869,8 @@ function getLocale() {
966
869
  }
967
870
  return locale;
968
871
  }
969
- function getDimension() {
970
- var dimension = {
971
- innerWidth: -1,
972
- innerHeight: -1,
973
- outerWidth: -1,
974
- outerHeight: -1,
975
- scale: 1,
976
- };
977
- if (typeof globalThis.innerWidth !== 'undefined') {
978
- dimension.innerWidth = globalThis.innerWidth;
979
- dimension.innerHeight = globalThis.innerHeight;
980
- dimension.outerWidth = globalThis.outerWidth;
981
- dimension.outerHeight = globalThis.outerHeight;
982
- dimension.scale = globalThis.devicePixelRatio || 1;
983
- return dimension;
984
- }
985
- if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
986
- try {
987
- var reactNative = require('react-native');
988
- var dimensions = reactNative.Dimensions;
989
- var pixelRatio = reactNative.PixelRatio;
990
- var screenDimensions = dimensions.get('screen');
991
- var windowDimensions = dimensions.get('window');
992
- dimension.innerWidth = screenDimensions.width;
993
- dimension.innerHeight = screenDimensions.height;
994
- dimension.outerWidth = windowDimensions.width;
995
- dimension.outerHeight = windowDimensions.height;
996
- dimension.scale = pixelRatio.get();
997
- return dimension;
998
- }
999
- catch (_) {
1000
- }
1001
- }
1002
- if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
1003
- try {
1004
- var electron = require('electron');
1005
- var screen_1 = electron.screen;
1006
- var browserWindow = electron.BrowserWindow;
1007
- var focusedWindow = browserWindow.getFocusedWindow() || browserWindow.getAllWindows()[0];
1008
- if (focusedWindow !== undefined) {
1009
- var contentSize = focusedWindow.getContentSize();
1010
- var size = focusedWindow.getSize();
1011
- dimension.innerWidth = contentSize[0];
1012
- dimension.innerHeight = contentSize[1];
1013
- dimension.outerWidth = size[0];
1014
- dimension.outerHeight = size[1];
1015
- dimension.scale = screen_1.getDisplayMatching(focusedWindow.getBounds()).scaleFactor;
1016
- }
1017
- return dimension;
1018
- }
1019
- catch (_) {
1020
- }
1021
- }
1022
- return dimension;
1023
- }
1024
872
  function init() {
1025
- if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT)))
873
+ if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.electron !== 'undefined') || (/ electron\//i.test(USER_AGENT)))
1026
874
  Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
1027
875
  if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative')
1028
876
  Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
@@ -1218,8 +1066,7 @@ function init() {
1218
1066
  finally {
1219
1067
  decrementPendingTasks();
1220
1068
  }
1221
- })
1222
- .catch(decrementPendingTasks);
1069
+ });
1223
1070
  }
1224
1071
  checkReady();
1225
1072
  }
@@ -1242,15 +1089,15 @@ function getTrackId(bundle) {
1242
1089
  if (xhr.status === 200) {
1243
1090
  try {
1244
1091
  var response = JSON.parse(xhr.response);
1245
- if (response.results === undefined)
1092
+ if (typeof response.results === 'undefined')
1246
1093
  return undefined;
1247
1094
  var results = response.results;
1248
- if (!Array.isArray(results) || results.length === 0)
1095
+ if (results.length === 0)
1249
1096
  return undefined;
1250
1097
  var result = results[0];
1251
- if (result === undefined)
1098
+ if (typeof result === 'undefined')
1252
1099
  return undefined;
1253
- return result.trackId;
1100
+ return "" + result.trackId;
1254
1101
  }
1255
1102
  catch (_) {
1256
1103
  return undefined;
@@ -1267,17 +1114,17 @@ function createIntentURL(scheme, packageName, fallback) {
1267
1114
  var prefix = split[0];
1268
1115
  var suffix = split[1];
1269
1116
  var intent = 'intent://';
1270
- if (suffix !== undefined)
1117
+ if (typeof suffix !== 'undefined')
1271
1118
  intent = intent + suffix;
1272
1119
  intent = intent + '#Intent;'
1273
1120
  + 'scheme=' + prefix + ';'
1274
1121
  + 'action=android.intent.action.VIEW;'
1275
1122
  + 'category=android.intent.category.BROWSABLE;';
1276
- if (packageName !== undefined)
1123
+ if (typeof packageName !== 'undefined')
1277
1124
  intent = intent + 'package=' + packageName + ';';
1278
- if (fallback !== undefined && typeof fallback === 'string')
1125
+ if (typeof fallback !== 'undefined' && typeof fallback === 'string')
1279
1126
  intent = intent + 'S.browser_fallback_url=' + fallback + ';';
1280
- else if (packageName !== undefined)
1127
+ else if (typeof packageName !== 'undefined')
1281
1128
  intent = intent + 'S.browser_fallback_url=' + createAppStoreURL(packageName, OS.Android) + ';';
1282
1129
  return intent + 'end';
1283
1130
  }
@@ -1295,16 +1142,16 @@ function parseIntentURL(intent) {
1295
1142
  if (index !== -1)
1296
1143
  extras[part.substring(0, index)] = part.substring(index + 1);
1297
1144
  }
1298
- if (extras['scheme'] !== undefined)
1145
+ if (typeof extras['scheme'] !== 'undefined')
1299
1146
  parsed.scheme = (extras['scheme'] + '://' + host);
1300
- if (extras['package'] !== undefined)
1147
+ if (typeof extras['package'] !== 'undefined')
1301
1148
  parsed.packageName = extras['package'];
1302
- if (extras['S.browser_fallback_url'] !== undefined)
1149
+ if (typeof extras['S.browser_fallback_url'] !== 'undefined')
1303
1150
  parsed.fallback = extras['S.browser_fallback_url'];
1304
1151
  return parsed;
1305
1152
  }
1306
1153
  function createAppStoreURL(packageName, os) {
1307
- if (packageName === undefined)
1154
+ if (typeof packageName === 'undefined')
1308
1155
  return undefined;
1309
1156
  switch (os) {
1310
1157
  case OS.Android:
@@ -1320,7 +1167,7 @@ function createAppStoreURL(packageName, os) {
1320
1167
  }
1321
1168
  }
1322
1169
  function createWebStoreURL(packageName, os) {
1323
- if (packageName === undefined)
1170
+ if (typeof packageName === 'undefined')
1324
1171
  return undefined;
1325
1172
  switch (os) {
1326
1173
  case OS.Android:
@@ -1385,7 +1232,7 @@ function openURLViaHref(url, index) {
1385
1232
  return;
1386
1233
  }
1387
1234
  a = createHiddenElement('a');
1388
- if (a === undefined)
1235
+ if (typeof a === 'undefined')
1389
1236
  return;
1390
1237
  a.href = url;
1391
1238
  topDocument.body.appendChild(a);
@@ -1395,7 +1242,7 @@ function openURLViaHref(url, index) {
1395
1242
  catch (_) {
1396
1243
  }
1397
1244
  finally {
1398
- if (a !== undefined) {
1245
+ if (typeof a !== 'undefined') {
1399
1246
  try {
1400
1247
  topDocument.body.removeChild(a);
1401
1248
  }
@@ -1410,12 +1257,12 @@ function openURLViaIframe(url) {
1410
1257
  var iframe = undefined;
1411
1258
  try {
1412
1259
  iframe = createHiddenElement('iframe');
1413
- if (iframe === undefined)
1260
+ if (typeof iframe === 'undefined')
1414
1261
  return;
1415
1262
  iframe.src = url;
1416
1263
  topDocument.body.appendChild(iframe);
1417
1264
  globalThis.setTimeout(function () {
1418
- if (iframe !== undefined) {
1265
+ if (typeof iframe !== 'undefined') {
1419
1266
  try {
1420
1267
  topDocument.body.removeChild(iframe);
1421
1268
  }
@@ -1439,13 +1286,13 @@ function isDocumentHidden() {
1439
1286
  return true;
1440
1287
  if (topDocument.msVisibilityState === 'hidden')
1441
1288
  return true;
1442
- if (topDocument.hidden !== undefined)
1289
+ if (typeof topDocument.hidden !== 'undefined')
1443
1290
  return topDocument.hidden;
1444
- if (topDocument.webkitHidden !== undefined)
1291
+ if (typeof topDocument.webkitHidden !== 'undefined')
1445
1292
  return topDocument.webkitHidden;
1446
- if (topDocument.mozHidden !== undefined)
1293
+ if (typeof topDocument.mozHidden !== 'undefined')
1447
1294
  return topDocument.mozHidden;
1448
- if (topDocument.msHidden !== undefined)
1295
+ if (typeof topDocument.msHidden !== 'undefined')
1449
1296
  return topDocument.msHidden;
1450
1297
  if (typeof topDocument.hasFocus === 'function')
1451
1298
  return !topDocument.hasFocus();
@@ -1482,7 +1329,7 @@ function restoreFocus() {
1482
1329
  var input = undefined;
1483
1330
  try {
1484
1331
  input = createHiddenElement('input');
1485
- if (input === undefined)
1332
+ if (typeof input === 'undefined')
1486
1333
  return false;
1487
1334
  input.type = 'text';
1488
1335
  input.readOnly = true;
@@ -1499,7 +1346,7 @@ function restoreFocus() {
1499
1346
  catch (_) {
1500
1347
  }
1501
1348
  finally {
1502
- if (input !== undefined) {
1349
+ if (typeof input !== 'undefined') {
1503
1350
  try {
1504
1351
  input.blur();
1505
1352
  }
@@ -1589,7 +1436,7 @@ function tryOpenURL(url, index, timeout) {
1589
1436
  var timeoutId;
1590
1437
  var resolved = false;
1591
1438
  function cleanup() {
1592
- if (timeoutId !== undefined) {
1439
+ if (typeof timeoutId !== 'undefined') {
1593
1440
  clearTimeout(timeoutId);
1594
1441
  timeoutId = undefined;
1595
1442
  }
@@ -1600,14 +1447,14 @@ function tryOpenURL(url, index, timeout) {
1600
1447
  }
1601
1448
  catch (_) {
1602
1449
  }
1603
- if (a !== undefined) {
1450
+ if (typeof a !== 'undefined') {
1604
1451
  try {
1605
1452
  topDocument.body.removeChild(a);
1606
1453
  }
1607
1454
  catch (_) {
1608
1455
  }
1609
1456
  }
1610
- if (iframe !== undefined) {
1457
+ if (typeof iframe !== 'undefined') {
1611
1458
  try {
1612
1459
  topDocument.body.removeChild(iframe);
1613
1460
  }
@@ -1631,7 +1478,7 @@ function tryOpenURL(url, index, timeout) {
1631
1478
  }
1632
1479
  }
1633
1480
  function onBlur() {
1634
- if (timeoutId !== undefined) {
1481
+ if (typeof timeoutId !== 'undefined') {
1635
1482
  clearTimeout(timeoutId);
1636
1483
  timeoutId = undefined;
1637
1484
  }
@@ -1674,7 +1521,7 @@ function open(options) {
1674
1521
  var timeout;
1675
1522
  if (Platform.os.name === OS.Android) {
1676
1523
  var option = options[OS.Android] || options['android'];
1677
- if (option === undefined)
1524
+ if (typeof option === 'undefined')
1678
1525
  return Promise.reject(getURLOpenError(tried));
1679
1526
  timeout = option.timeout;
1680
1527
  infos.scheme = urlToString(option.scheme);
@@ -1685,21 +1532,21 @@ function open(options) {
1685
1532
  infos.webStore = createWebStoreURL(infos.packageName, OS.Android);
1686
1533
  infos.allowAppStore = option.allowAppStore;
1687
1534
  infos.allowWebStore = option.allowWebStore;
1688
- if (infos.intent !== undefined && (infos.scheme === undefined || infos.packageName === undefined || infos.fallback === undefined)) {
1535
+ if (typeof infos.intent !== 'undefined' && (typeof infos.scheme === 'undefined' || typeof infos.packageName === 'undefined' || typeof infos.fallback === 'undefined')) {
1689
1536
  var parsed = parseIntentURL(infos.intent);
1690
- if (parsed.scheme !== undefined && infos.scheme === undefined)
1537
+ if (typeof parsed.scheme !== 'undefined' && typeof infos.scheme === 'undefined')
1691
1538
  infos.scheme = parsed.scheme;
1692
- if (parsed.packageName !== undefined && infos.packageName === undefined)
1539
+ if (typeof parsed.packageName !== 'undefined' && typeof infos.packageName === 'undefined')
1693
1540
  infos.packageName = parsed.packageName;
1694
- if (parsed.fallback !== undefined && infos.fallback === undefined)
1541
+ if (typeof parsed.fallback !== 'undefined' && typeof infos.fallback === 'undefined')
1695
1542
  infos.fallback = parsed.fallback;
1696
1543
  }
1697
- if (infos.scheme !== undefined && infos.intent === undefined)
1544
+ if (typeof infos.scheme !== 'undefined' && typeof infos.intent === 'undefined')
1698
1545
  infos.intent = createIntentURL(infos.scheme, infos.packageName, infos.fallback);
1699
1546
  }
1700
1547
  else if (Platform.os.name === OS.iOS) {
1701
1548
  var option = options[OS.iOS] || options['ios'];
1702
- if (option === undefined)
1549
+ if (typeof option === 'undefined')
1703
1550
  return Promise.reject(getURLOpenError(tried));
1704
1551
  timeout = option.timeout;
1705
1552
  infos.scheme = urlToString(option.scheme);
@@ -1711,12 +1558,12 @@ function open(options) {
1711
1558
  infos.webStore = createWebStoreURL(infos.trackId, OS.iOS);
1712
1559
  infos.allowAppStore = option.allowAppStore;
1713
1560
  infos.allowWebStore = option.allowWebStore;
1714
- if (infos.bundleId !== undefined && infos.trackId === undefined)
1561
+ if (typeof infos.bundleId !== 'undefined' && typeof infos.trackId === 'undefined')
1715
1562
  infos.trackId = getTrackId(infos.bundleId);
1716
1563
  }
1717
1564
  else if (Platform.os.name === OS.Windows) {
1718
1565
  var option = options[OS.Windows] || options['windows'];
1719
- if (option === undefined)
1566
+ if (typeof option === 'undefined')
1720
1567
  return Promise.reject(getURLOpenError(tried));
1721
1568
  timeout = option.timeout;
1722
1569
  infos.scheme = urlToString(option.scheme);
@@ -1729,7 +1576,7 @@ function open(options) {
1729
1576
  }
1730
1577
  else if (Platform.os.name === OS.MacOS) {
1731
1578
  var option = options[OS.MacOS] || options['mac'];
1732
- if (option === undefined)
1579
+ if (typeof option === 'undefined')
1733
1580
  return Promise.reject(getURLOpenError(tried));
1734
1581
  timeout = option.timeout;
1735
1582
  infos.scheme = urlToString(option.scheme);
@@ -1740,7 +1587,7 @@ function open(options) {
1740
1587
  infos.webStore = createWebStoreURL(infos.trackId, OS.MacOS);
1741
1588
  infos.allowAppStore = option.allowAppStore;
1742
1589
  infos.allowWebStore = option.allowWebStore;
1743
- if (infos.bundleId !== undefined && infos.trackId === undefined)
1590
+ if (typeof infos.bundleId !== 'undefined' && typeof infos.trackId === 'undefined')
1744
1591
  infos.trackId = getTrackId(infos.bundleId);
1745
1592
  }
1746
1593
  pushURL(urls, infos.intent, AppOpenState.Intent, canOpenIntentURL());
@@ -1749,7 +1596,7 @@ function open(options) {
1749
1596
  pushURL(urls, infos.fallback, AppOpenState.Fallback);
1750
1597
  pushURL(urls, infos.appStore, AppOpenState.Store, infos.allowAppStore);
1751
1598
  pushURL(urls, infos.webStore, AppOpenState.Store, infos.allowWebStore);
1752
- if (timeout === undefined)
1599
+ if (typeof timeout === 'undefined')
1753
1600
  timeout = getDefaultTimeoutByOS(os);
1754
1601
  return new Promise(function (resolve, reject) {
1755
1602
  function openURLSequential(index) {
@@ -1890,15 +1737,15 @@ function normalize(value) {
1890
1737
  var key = keys[i];
1891
1738
  result[key] = stringifiableToString(value[key]);
1892
1739
  }
1893
- if (result.to === undefined)
1740
+ if (typeof result.to === 'undefined')
1894
1741
  result.to = '';
1895
- if (result.cc === undefined)
1742
+ if (typeof result.cc === 'undefined')
1896
1743
  result.cc = '';
1897
- if (result.bcc === undefined)
1744
+ if (typeof result.bcc === 'undefined')
1898
1745
  result.bcc = '';
1899
- if (result.subject === undefined)
1746
+ if (typeof result.subject === 'undefined')
1900
1747
  result.subject = '';
1901
- if (result.body === undefined)
1748
+ if (typeof result.body === 'undefined')
1902
1749
  result.body = '';
1903
1750
  return result;
1904
1751
  }