native-fn 1.0.70 → 1.0.72

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 (195) hide show
  1. package/dist/native.cjs +2 -507
  2. package/dist/native.min.cjs +1 -1
  3. package/dist/native.min.mjs +1 -1
  4. package/dist/native.mjs +2 -507
  5. package/dist/native.umd.js +2 -507
  6. package/dist/native.umd.min.js +1 -1
  7. package/dist/plugin/app/index.cjs +434 -429
  8. package/dist/plugin/app/index.d.ts +8 -33
  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 +434 -429
  12. package/dist/plugin/app/index.umd.js +434 -429
  13. package/dist/plugin/app/index.umd.min.js +1 -1
  14. package/dist/plugin/app/src/plugin/app/cores/index.d.ts +0 -4
  15. package/dist/plugin/app/src/plugin/app/types/app.d.ts +1 -1
  16. package/dist/plugin/app/src/plugin/camera/cores/index.d.ts +2 -2
  17. package/dist/plugin/app/src/plugin/clipboard/cores/index.d.ts +2 -2
  18. package/dist/plugin/app/src/plugin/fullscreen/cores/index.d.ts +2 -2
  19. package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
  20. package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +42 -0
  21. package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +28 -0
  22. package/dist/plugin/app/src/plugin/platform/index.d.ts +2 -2
  23. package/dist/plugin/app/src/plugin/platform/types/index.d.ts +5 -1
  24. package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +5 -2
  25. package/dist/plugin/app/src/plugin/theme/constants/index.d.ts +0 -12
  26. package/dist/plugin/app/src/plugin/theme/cores/index.d.ts +2 -2
  27. package/dist/plugin/app/src/plugin/theme/index.d.ts +1 -13
  28. package/dist/plugin/app/src/plugin/theme/types/index.d.ts +0 -12
  29. package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +2 -22
  30. package/dist/plugin/appearance/index.cjs +30 -16
  31. package/dist/plugin/appearance/index.min.cjs +1 -1
  32. package/dist/plugin/appearance/index.min.mjs +1 -1
  33. package/dist/plugin/appearance/index.mjs +30 -16
  34. package/dist/plugin/appearance/index.umd.js +30 -16
  35. package/dist/plugin/appearance/index.umd.min.js +1 -1
  36. package/dist/plugin/appearance/src/plugin/app/cores/index.d.ts +0 -4
  37. package/dist/plugin/appearance/src/plugin/app/types/app.d.ts +1 -1
  38. package/dist/plugin/appearance/src/plugin/camera/cores/index.d.ts +2 -2
  39. package/dist/plugin/appearance/src/plugin/clipboard/cores/index.d.ts +2 -2
  40. package/dist/plugin/appearance/src/plugin/fullscreen/cores/index.d.ts +2 -2
  41. package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
  42. package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +42 -0
  43. package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +28 -0
  44. package/dist/plugin/appearance/src/plugin/platform/index.d.ts +11 -0
  45. package/dist/plugin/appearance/src/plugin/platform/types/index.d.ts +11 -0
  46. package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +18 -0
  47. package/dist/plugin/appearance/src/plugin/theme/constants/index.d.ts +0 -12
  48. package/dist/plugin/appearance/src/plugin/theme/cores/index.d.ts +2 -2
  49. package/dist/plugin/appearance/src/plugin/theme/index.d.ts +1 -13
  50. package/dist/plugin/appearance/src/plugin/theme/types/index.d.ts +0 -12
  51. package/dist/plugin/appearance/src/plugin/theme/types/theme.d.ts +2 -22
  52. package/dist/plugin/camera/index.cjs +118 -109
  53. package/dist/plugin/camera/index.min.cjs +1 -1
  54. package/dist/plugin/camera/index.min.mjs +1 -1
  55. package/dist/plugin/camera/index.mjs +118 -109
  56. package/dist/plugin/camera/index.umd.js +118 -109
  57. package/dist/plugin/camera/index.umd.min.js +1 -1
  58. package/dist/plugin/camera/src/plugin/app/cores/index.d.ts +0 -4
  59. package/dist/plugin/camera/src/plugin/app/types/app.d.ts +1 -1
  60. package/dist/plugin/camera/src/plugin/camera/cores/index.d.ts +2 -2
  61. package/dist/plugin/camera/src/plugin/clipboard/cores/index.d.ts +2 -2
  62. package/dist/plugin/camera/src/plugin/fullscreen/cores/index.d.ts +2 -2
  63. package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
  64. package/dist/plugin/camera/src/plugin/platform/constants/index.d.ts +42 -0
  65. package/dist/plugin/camera/src/plugin/platform/cores/index.d.ts +28 -0
  66. package/dist/plugin/camera/src/plugin/platform/index.d.ts +2 -2
  67. package/dist/plugin/camera/src/plugin/platform/types/index.d.ts +5 -1
  68. package/dist/plugin/camera/src/plugin/platform/types/platform.d.ts +5 -2
  69. package/dist/plugin/camera/src/plugin/theme/constants/index.d.ts +0 -12
  70. package/dist/plugin/camera/src/plugin/theme/cores/index.d.ts +2 -2
  71. package/dist/plugin/camera/src/plugin/theme/index.d.ts +1 -13
  72. package/dist/plugin/camera/src/plugin/theme/types/index.d.ts +0 -12
  73. package/dist/plugin/camera/src/plugin/theme/types/theme.d.ts +2 -22
  74. package/dist/plugin/clipboard/index.cjs +226 -212
  75. package/dist/plugin/clipboard/index.min.cjs +1 -1
  76. package/dist/plugin/clipboard/index.min.mjs +1 -1
  77. package/dist/plugin/clipboard/index.mjs +226 -212
  78. package/dist/plugin/clipboard/index.umd.js +226 -212
  79. package/dist/plugin/clipboard/index.umd.min.js +1 -1
  80. package/dist/plugin/clipboard/src/plugin/app/cores/index.d.ts +0 -4
  81. package/dist/plugin/clipboard/src/plugin/app/types/app.d.ts +1 -1
  82. package/dist/plugin/clipboard/src/plugin/camera/cores/index.d.ts +2 -2
  83. package/dist/plugin/clipboard/src/plugin/clipboard/cores/index.d.ts +2 -2
  84. package/dist/plugin/clipboard/src/plugin/fullscreen/cores/index.d.ts +2 -2
  85. package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
  86. package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +42 -0
  87. package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +28 -0
  88. package/dist/plugin/clipboard/src/plugin/platform/index.d.ts +2 -2
  89. package/dist/plugin/clipboard/src/plugin/platform/types/index.d.ts +5 -1
  90. package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +5 -2
  91. package/dist/plugin/clipboard/src/plugin/theme/constants/index.d.ts +0 -12
  92. package/dist/plugin/clipboard/src/plugin/theme/cores/index.d.ts +2 -2
  93. package/dist/plugin/clipboard/src/plugin/theme/index.d.ts +1 -13
  94. package/dist/plugin/clipboard/src/plugin/theme/types/index.d.ts +0 -12
  95. package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +2 -22
  96. package/dist/plugin/fullscreen/index.cjs +34 -20
  97. package/dist/plugin/fullscreen/index.d.ts +4 -13
  98. package/dist/plugin/fullscreen/index.min.cjs +1 -1
  99. package/dist/plugin/fullscreen/index.min.mjs +1 -1
  100. package/dist/plugin/fullscreen/index.mjs +34 -20
  101. package/dist/plugin/fullscreen/index.umd.js +34 -20
  102. package/dist/plugin/fullscreen/index.umd.min.js +1 -1
  103. package/dist/plugin/fullscreen/src/plugin/app/cores/index.d.ts +0 -4
  104. package/dist/plugin/fullscreen/src/plugin/app/types/app.d.ts +1 -1
  105. package/dist/plugin/fullscreen/src/plugin/camera/cores/index.d.ts +2 -2
  106. package/dist/plugin/fullscreen/src/plugin/clipboard/cores/index.d.ts +2 -2
  107. package/dist/plugin/fullscreen/src/plugin/fullscreen/cores/index.d.ts +2 -2
  108. package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
  109. package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +42 -0
  110. package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +28 -0
  111. package/dist/plugin/fullscreen/src/plugin/platform/index.d.ts +2 -2
  112. package/dist/plugin/fullscreen/src/plugin/platform/types/index.d.ts +5 -1
  113. package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +5 -2
  114. package/dist/plugin/fullscreen/src/plugin/theme/constants/index.d.ts +0 -12
  115. package/dist/plugin/fullscreen/src/plugin/theme/cores/index.d.ts +2 -2
  116. package/dist/plugin/fullscreen/src/plugin/theme/index.d.ts +1 -13
  117. package/dist/plugin/fullscreen/src/plugin/theme/types/index.d.ts +0 -12
  118. package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +2 -22
  119. package/dist/plugin/platform/index.cjs +355 -109
  120. package/dist/plugin/platform/index.d.ts +15 -20
  121. package/dist/plugin/platform/index.min.cjs +1 -1
  122. package/dist/plugin/platform/index.min.mjs +1 -1
  123. package/dist/plugin/platform/index.mjs +355 -109
  124. package/dist/plugin/platform/index.umd.js +355 -109
  125. package/dist/plugin/platform/index.umd.min.js +1 -1
  126. package/dist/plugin/platform/src/plugin/app/constants/index.d.ts +12 -0
  127. package/dist/plugin/platform/src/plugin/app/cores/index.d.ts +13 -0
  128. package/dist/plugin/platform/src/plugin/app/index.d.ts +1 -1
  129. package/dist/plugin/platform/src/plugin/app/types/app.d.ts +11 -2
  130. package/dist/plugin/platform/src/plugin/app/types/index.d.ts +2 -2
  131. package/dist/plugin/platform/src/plugin/appearance/constants/index.d.ts +11 -0
  132. package/dist/plugin/platform/src/plugin/appearance/cores/index.d.ts +3 -0
  133. package/dist/plugin/platform/src/plugin/appearance/index.d.ts +8 -0
  134. package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +12 -0
  135. package/dist/plugin/platform/src/plugin/appearance/types/index.d.ts +13 -0
  136. package/dist/plugin/platform/src/plugin/camera/constants/inedx.d.ts +4 -0
  137. package/dist/plugin/platform/src/plugin/camera/cores/index.d.ts +3 -0
  138. package/dist/plugin/platform/src/plugin/camera/index.d.ts +1 -1
  139. package/dist/plugin/platform/src/plugin/camera/types/camera.d.ts +1 -1
  140. package/dist/plugin/platform/src/plugin/camera/types/index.d.ts +1 -1
  141. package/dist/plugin/platform/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  142. package/dist/plugin/platform/src/plugin/clipboard/cores/index.d.ts +3 -0
  143. package/dist/plugin/platform/src/plugin/fullscreen/cores/index.d.ts +35 -0
  144. package/dist/plugin/platform/src/plugin/fullscreen/types/fullscreen.d.ts +5 -5
  145. package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +42 -0
  146. package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +28 -0
  147. package/dist/plugin/platform/src/plugin/platform/index.d.ts +2 -2
  148. package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +5 -1
  149. package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +5 -2
  150. package/dist/plugin/platform/src/plugin/theme/constants/index.d.ts +2 -0
  151. package/dist/plugin/platform/src/plugin/theme/cores/index.d.ts +3 -0
  152. package/dist/plugin/platform/src/plugin/theme/index.d.ts +1 -13
  153. package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +0 -12
  154. package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +2 -21
  155. package/dist/plugin/platform/src/utils/create-hidden-element.d.ts +1 -1
  156. package/dist/plugin/theme/index.cjs +63 -906
  157. package/dist/plugin/theme/index.d.ts +4 -87
  158. package/dist/plugin/theme/index.min.cjs +1 -1
  159. package/dist/plugin/theme/index.min.mjs +1 -1
  160. package/dist/plugin/theme/index.mjs +63 -906
  161. package/dist/plugin/theme/index.umd.js +63 -906
  162. package/dist/plugin/theme/index.umd.min.js +1 -1
  163. package/dist/plugin/theme/src/plugin/app/cores/index.d.ts +0 -4
  164. package/dist/plugin/theme/src/plugin/app/types/app.d.ts +1 -1
  165. package/dist/plugin/theme/src/plugin/camera/cores/index.d.ts +2 -2
  166. package/dist/plugin/theme/src/plugin/clipboard/cores/index.d.ts +2 -2
  167. package/dist/plugin/theme/src/plugin/fullscreen/cores/index.d.ts +2 -2
  168. package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
  169. package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +42 -0
  170. package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +28 -0
  171. package/dist/plugin/theme/src/plugin/platform/index.d.ts +2 -2
  172. package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +5 -1
  173. package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +5 -2
  174. package/dist/plugin/theme/src/plugin/theme/constants/index.d.ts +0 -12
  175. package/dist/plugin/theme/src/plugin/theme/cores/index.d.ts +2 -2
  176. package/dist/plugin/theme/src/plugin/theme/index.d.ts +1 -13
  177. package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +0 -12
  178. package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +2 -22
  179. package/dist/src/plugin/app/cores/index.d.ts +0 -4
  180. package/dist/src/plugin/app/types/app.d.ts +1 -1
  181. package/dist/src/plugin/camera/cores/index.d.ts +2 -2
  182. package/dist/src/plugin/clipboard/cores/index.d.ts +2 -2
  183. package/dist/src/plugin/fullscreen/cores/index.d.ts +2 -2
  184. package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
  185. package/dist/src/plugin/platform/constants/index.d.ts +42 -0
  186. package/dist/src/plugin/platform/cores/index.d.ts +28 -0
  187. package/dist/src/plugin/platform/index.d.ts +2 -2
  188. package/dist/src/plugin/platform/types/index.d.ts +5 -1
  189. package/dist/src/plugin/platform/types/platform.d.ts +5 -2
  190. package/dist/src/plugin/theme/constants/index.d.ts +0 -12
  191. package/dist/src/plugin/theme/cores/index.d.ts +2 -2
  192. package/dist/src/plugin/theme/index.d.ts +1 -13
  193. package/dist/src/plugin/theme/types/index.d.ts +0 -12
  194. package/dist/src/plugin/theme/types/theme.d.ts +2 -22
  195. package/package.json +1 -1
@@ -19,6 +19,86 @@
19
19
  MessengerType["Mail"] = "mail";
20
20
  })(MessengerType || (MessengerType = {}));
21
21
 
22
+ function createCustomError(name, Base) {
23
+ if (Base === void 0) { Base = Error; }
24
+ function CustomError(message) {
25
+ if (!(this instanceof CustomError))
26
+ return new CustomError(message);
27
+ var error = new Base(message || '');
28
+ if (typeof Object.setPrototypeOf === 'function')
29
+ Object.setPrototypeOf(error, CustomError.prototype);
30
+ else
31
+ error.__proto__ = CustomError.prototype;
32
+ error.name = name;
33
+ if (message !== undefined)
34
+ error.message = message;
35
+ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
36
+ try {
37
+ Object.defineProperty(error, Symbol.toStringTag, {
38
+ value: name,
39
+ writable: false,
40
+ enumerable: false,
41
+ configurable: true
42
+ });
43
+ }
44
+ catch (_) {
45
+ }
46
+ }
47
+ if (typeof Error.captureStackTrace === 'function') {
48
+ Error.captureStackTrace(error, CustomError);
49
+ }
50
+ else if (Base.captureStackTrace && typeof Base.captureStackTrace === 'function') {
51
+ Base.captureStackTrace(error, CustomError);
52
+ }
53
+ else {
54
+ try {
55
+ var tempError = new Base();
56
+ if (tempError.stack)
57
+ error.stack = tempError.stack;
58
+ }
59
+ catch (_) {
60
+ }
61
+ }
62
+ return error;
63
+ }
64
+ CustomError.prototype = Object.create(Base.prototype, {
65
+ constructor: {
66
+ value: CustomError,
67
+ writable: true,
68
+ enumerable: false,
69
+ configurable: true
70
+ }
71
+ });
72
+ try {
73
+ Object.defineProperty(CustomError.prototype, 'name', {
74
+ value: name,
75
+ writable: true,
76
+ enumerable: false,
77
+ configurable: true
78
+ });
79
+ }
80
+ catch (_) {
81
+ try {
82
+ CustomError.prototype.name = name;
83
+ }
84
+ catch (_) {
85
+ }
86
+ }
87
+ try {
88
+ Object.defineProperty(CustomError, 'name', {
89
+ value: name,
90
+ writable: false,
91
+ enumerable: false,
92
+ configurable: true
93
+ });
94
+ }
95
+ catch (_) {
96
+ }
97
+ return CustomError;
98
+ }
99
+
100
+ var URLOpenError = createCustomError('URLOpenError');
101
+
22
102
  function compareVersion(lhs, rhs) {
23
103
  var pa = lhs.split('.');
24
104
  var pb = rhs.split('.');
@@ -39,8 +119,235 @@
39
119
  if (a < b)
40
120
  return -1;
41
121
  }
42
- return 0;
43
- }
122
+ return 0;
123
+ }
124
+
125
+ function getTopmostWindow() {
126
+ try {
127
+ if (globalThis.top && globalThis.top !== window) {
128
+ void globalThis.top.location.href;
129
+ return globalThis.top;
130
+ }
131
+ }
132
+ catch (_) {
133
+ }
134
+ return window;
135
+ }
136
+
137
+ function createHiddenElement(tagName, focusable) {
138
+ if (focusable === void 0) { focusable = true; }
139
+ if (typeof globalThis.document === 'undefined')
140
+ return undefined;
141
+ var element = globalThis.document.createElement(tagName);
142
+ if ('width' in element)
143
+ element.width = '0';
144
+ if ('height' in element)
145
+ element.height = '0';
146
+ if ('border' in element)
147
+ element.border = '0';
148
+ if ('frameBorder' in element)
149
+ element.frameBorder = '0';
150
+ if ('scrolling' in element)
151
+ element.scrolling = 'no';
152
+ if ('cellPadding' in element)
153
+ element.cellPadding = '0';
154
+ if ('cellSpacing' in element)
155
+ element.cellSpacing = '0';
156
+ if ('frame' in element)
157
+ element.frame = 'void';
158
+ if ('rules' in element)
159
+ element.rules = 'none';
160
+ if ('noWrap' in element)
161
+ element.noWrap = true;
162
+ element.tabIndex = -1;
163
+ element.setAttribute('role', 'presentation');
164
+ if (focusable) {
165
+ element.style.width = '1px';
166
+ element.style.height = '1px';
167
+ }
168
+ else {
169
+ element.setAttribute('aria-hidden', 'true');
170
+ element.style.width = '0';
171
+ element.style.height = '0';
172
+ element.style.zIndex = '-9999';
173
+ element.style.display = 'none';
174
+ element.style.visibility = 'hidden';
175
+ element.style.pointerEvents = 'none';
176
+ }
177
+ element.style.position = 'absolute';
178
+ element.style.top = '0';
179
+ element.style.left = '0';
180
+ element.style.padding = '0';
181
+ element.style.margin = '0';
182
+ element.style.border = 'none';
183
+ element.style.outline = 'none';
184
+ element.style.clip = 'rect(1px, 1px, 1px, 1px)';
185
+ element.style.clipPath = 'inset(50%)';
186
+ element.style.overflow = 'hidden';
187
+ element.style.whiteSpace = 'nowrap';
188
+ return element;
189
+ }
190
+
191
+ function dispatchClickEvent(element, view) {
192
+ if (view === void 0) { view = window; }
193
+ var fake;
194
+ try {
195
+ fake = new MouseEvent('click', {
196
+ bubbles: true,
197
+ cancelable: true,
198
+ view: view
199
+ });
200
+ }
201
+ catch (_) {
202
+ fake = globalThis.document.createEvent('MouseEvents');
203
+ fake.initMouseEvent('click', true, true, view, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
204
+ }
205
+ element.dispatchEvent(fake);
206
+ }
207
+
208
+ function capitalize(_) {
209
+ var groups = [];
210
+ for (var _i = 1; _i < arguments.length; _i++) {
211
+ groups[_i - 1] = arguments[_i];
212
+ }
213
+ var result = '';
214
+ for (var i = 0; i < groups.length - 2; i++) {
215
+ var arg = groups[i];
216
+ if (arg !== undefined)
217
+ result = result + arg.charAt(0).toUpperCase() + arg.slice(1);
218
+ }
219
+ return result;
220
+ }
221
+ function preventDefaultPolyfill() {
222
+ this.returnValue = false;
223
+ }
224
+ function stopPropagationPolyfill() {
225
+ this.cancelBubble = true;
226
+ }
227
+ var EVENT_TYPE_REGEXP = /(animation)(start|iteration|end|cancel)|(transition)(start|run|end|cancel)|(fullscreen)(change|error)|(lost|got)(pointer)(capture)|(pointer)(lock)(change|error)|(pointer)(cancel|down|enter|leave|move|out|over|up)/i;
228
+ var VENDORS = ['', 'webkit', 'moz', 'ms', 'MS', 'o', 'O'];
229
+ var LEGACY_TYPE_MAP = {
230
+ 'wheel': ['wheel', 'mousewheel', 'DOMMouseScroll'],
231
+ 'focus': ['focus', 'focusin'],
232
+ 'blur': ['blur', 'focusout'],
233
+ 'beforeinput': ['beforeinput', 'textInput'],
234
+ };
235
+ var EventListenerUtils = {
236
+ useStd: typeof globalThis.document !== 'undefined' && typeof globalThis.document.addEventListener === 'function',
237
+ add: function (target, eventListenerOptions) {
238
+ if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
239
+ var callback = eventListenerOptions.callback;
240
+ if (target === undefined || callback === null)
241
+ return;
242
+ var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
243
+ var options = eventListenerOptions.options;
244
+ if (typeof target.addEventListener === 'function') {
245
+ try {
246
+ return target.addEventListener(type, callback, options);
247
+ }
248
+ catch (_) {
249
+ }
250
+ }
251
+ if (typeof target.addListener === 'function') {
252
+ if (typeof target.matches === 'boolean') {
253
+ try {
254
+ return target.addListener(callback);
255
+ }
256
+ catch (_) {
257
+ }
258
+ }
259
+ else {
260
+ try {
261
+ return target.addListener(type, callback);
262
+ }
263
+ catch (_) {
264
+ }
265
+ }
266
+ }
267
+ function wrapper(event) {
268
+ if (event === undefined)
269
+ event = globalThis.event;
270
+ if (event === undefined)
271
+ return;
272
+ event.currentTarget = target;
273
+ if (typeof event.preventDefault !== 'function')
274
+ event.preventDefault = preventDefaultPolyfill;
275
+ if (typeof event.stopPropagation !== 'function')
276
+ event.stopPropagation = stopPropagationPolyfill;
277
+ if (typeof callback === 'function')
278
+ callback.call(target, event);
279
+ else if (callback && typeof callback.handleEvent === 'function')
280
+ callback.handleEvent.call(target, event);
281
+ }
282
+ if (typeof target.attachEvent === 'function') {
283
+ if (callback.__ieWrapper)
284
+ return target.attachEvent('on' + type, callback.__ieWrapper);
285
+ return target.attachEvent('on' + type, callback.__ieWrapper = wrapper);
286
+ }
287
+ },
288
+ remove: function (target, eventListenerOptions) {
289
+ if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
290
+ var callback = eventListenerOptions.callback;
291
+ if (target === undefined || callback === null)
292
+ return;
293
+ var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
294
+ var options = eventListenerOptions.options;
295
+ if (typeof target.removeEventListener === 'function') {
296
+ try {
297
+ return target.removeEventListener(type, callback, options);
298
+ }
299
+ catch (_) {
300
+ }
301
+ }
302
+ if (typeof target.removeListener === 'function') {
303
+ if (typeof target.matches === 'boolean') {
304
+ try {
305
+ return target.removeListener(callback);
306
+ }
307
+ catch (_) {
308
+ }
309
+ }
310
+ else {
311
+ try {
312
+ return target.removeListener(type, callback);
313
+ }
314
+ catch (_) {
315
+ }
316
+ }
317
+ }
318
+ if (typeof target.detachEvent === 'function') {
319
+ var wrapper = callback.__ieWrapper;
320
+ if (wrapper !== undefined) {
321
+ target.detachEvent('on' + type, wrapper);
322
+ delete callback.__ieWrapper;
323
+ }
324
+ return;
325
+ }
326
+ },
327
+ withVender: function (target, type) {
328
+ if (type === undefined)
329
+ return '';
330
+ if (target === globalThis.document && ['deviceready', 'pause', 'resume', 'backbutton', 'menubutton', 'searchbutton', 'startcallbutton', 'endcallbutton', 'volumedownbutton', 'volumeupbutton', 'activated', 'cordovacallbackerror'].indexOf(type) > -1)
331
+ return type;
332
+ if (typeof target.webkitEnterFullscreen !== 'undefined' && ['webkitbeginfullscreen', 'webkitendfullscreen', 'webkitpresentationmodechanged'].indexOf(type) > -1)
333
+ return type;
334
+ var types;
335
+ if (type in LEGACY_TYPE_MAP)
336
+ types = LEGACY_TYPE_MAP[type];
337
+ else if (EVENT_TYPE_REGEXP.test(type))
338
+ types = [type, type.replace(EVENT_TYPE_REGEXP, capitalize)];
339
+ else
340
+ types = [type];
341
+ for (var i = 0; i < VENDORS.length; i++) {
342
+ for (var j = 0; j < types.length; j++) {
343
+ var name_1 = VENDORS[i] + types[j];
344
+ if (typeof target['on' + name_1] !== 'undefined')
345
+ return name_1;
346
+ }
347
+ }
348
+ return '';
349
+ }
350
+ };
44
351
 
45
352
  var OS;
46
353
  (function (OS) {
@@ -81,25 +388,31 @@
81
388
  Browsers["IE"] = "IE";
82
389
  Browsers["SamsungInternet"] = "SamsungInternet";
83
390
  })(Browsers || (Browsers = {}));
84
- var userAgent = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
85
- var IS_NODE_JS = typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
86
- var IS_ELECTRON = (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent));
87
- var IS_REACT_NATIVE = typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative';
88
- var IS_CORDOVA = typeof globalThis.cordova !== 'undefined';
391
+ var CrossPlatformFramework;
392
+ (function (CrossPlatformFramework) {
393
+ CrossPlatformFramework["NotACrossPlatformFramework"] = "NotACrossPlatformFramework";
394
+ CrossPlatformFramework["ReactNative"] = "ReactNative";
395
+ CrossPlatformFramework["Electron"] = "Electron";
396
+ CrossPlatformFramework["Cordova"] = "Cordova";
397
+ })(CrossPlatformFramework || (CrossPlatformFramework = {}));
398
+ var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
399
+
89
400
  var Platform = {
90
401
  device: Devices.Unknown,
91
402
  os: OS.Unknown,
92
- osVersion: '',
93
403
  engine: Engines.Unknown,
94
- engineVersion: '',
95
404
  browser: Browsers.Unknown,
405
+ crossPlatformFramework: CrossPlatformFramework.NotACrossPlatformFramework,
406
+ osVersion: '',
407
+ engineVersion: '',
96
408
  browserVersion: '',
97
409
  renderer: getRenderer(),
98
- userAgent: userAgent,
410
+ userAgent: USER_AGENT,
411
+ isNode: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
99
412
  isMobile: false,
100
413
  isDesktop: false,
101
414
  isStandalone: false,
102
- isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(userAgent),
415
+ isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(USER_AGENT),
103
416
  };
104
417
  var OS_RESOLVER_MAP = [
105
418
  [/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
@@ -368,6 +681,12 @@
368
681
  build: parseInt(parts[2] || '0')
369
682
  };
370
683
  }
684
+ if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT))) {
685
+ Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
686
+ }
687
+ if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative') {
688
+ Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
689
+ }
371
690
  for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
372
691
  var map = OS_RESOLVER_MAP[i];
373
692
  var regexp = map[0];
@@ -404,421 +723,114 @@
404
723
  var resolver = map[2];
405
724
  var matched = Platform.userAgent.match(regexp);
406
725
  if (matched !== null) {
407
- Platform.browser = browser;
408
- Platform.browserVersion = resolveVersion(matched[1], resolver);
409
- break;
410
- }
411
- }
412
- if (IS_REACT_NATIVE) {
413
- try {
414
- var reactNative = require('react-native');
415
- var platform = reactNative.Platform;
416
- var os = platform.OS;
417
- var release = '' + platform.Version;
418
- var version = getSemanticVersion(release);
419
- switch (os) {
420
- case 'android':
421
- Platform.os = OS.Android;
422
- Platform.osVersion = resolveSemanticAndroidVersion(version, release);
423
- break;
424
- case 'ios':
425
- Platform.os = OS.iOS;
426
- Platform.osVersion = release;
427
- break;
428
- case 'windows':
429
- Platform.os = OS.Windows;
430
- Platform.osVersion = resolveSemanticWindowsVersion(version, release);
431
- break;
432
- case 'macos':
433
- Platform.os = OS.MacOS;
434
- Platform.osVersion = release;
435
- break;
436
- }
437
- }
438
- catch (_) {
439
- }
440
- }
441
- if (IS_NODE_JS) {
442
- try {
443
- var os = require('os');
444
- var platform = os.platform();
445
- var release = os.release();
446
- var version = getSemanticVersion(release);
447
- switch (platform) {
448
- case 'win32':
449
- Platform.os = OS.Windows;
450
- Platform.osVersion = resolveSemanticWindowsVersion(version, release);
451
- break;
452
- case 'darwin':
453
- Platform.os = OS.MacOS;
454
- Platform.osVersion = resolveSemanticDarwinVersion(version, release);
455
- break;
456
- case 'android':
457
- Platform.os = OS.Android;
458
- Platform.osVersion = release;
459
- break;
460
- case 'linux':
461
- if (/android/i.test(release)) {
462
- Platform.os = OS.Android;
463
- Platform.osVersion = release;
464
- }
465
- break;
466
- }
467
- }
468
- catch (_) {
469
- }
470
- }
471
- if (typeof globalThis.document !== 'undefined') {
472
- globalThis.document.addEventListener("deviceready", function () {
473
- IS_CORDOVA = true;
474
- if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
475
- switch (globalThis.device.platform) {
476
- case 'Android':
477
- Platform.os = OS.Android;
478
- break;
479
- case 'iOS':
480
- Platform.os = OS.iOS;
481
- break;
482
- }
483
- Platform.osVersion = globalThis.device.version;
484
- }
485
- }, false);
486
- }
487
- if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
488
- navigator
489
- .userAgentData
490
- .getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
491
- .then(function (result) {
492
- var brands = result.fullVersionList || result.brands || [];
493
- var platformVersion = result.platformVersion;
494
- for (var i = 0; i < brands.length; i++) {
495
- var brand = normalizeBrand(brands[i]);
496
- var brandName = brand.brand;
497
- var brandVersion = brand.version;
498
- if (/not.a.brand/i.test(brandName))
499
- continue;
500
- if (brandName === "Chromium")
501
- Platform.engineVersion = brandVersion;
502
- }
503
- if (typeof platformVersion === 'string') {
504
- if (Platform.os === OS.Windows && parseInt(platformVersion.replace(/[^\d.]/g, '').split('.')[0], 10) >= 13)
505
- Platform.osVersion = '11';
506
- else
507
- Platform.osVersion = platformVersion;
508
- }
509
- });
510
- }
511
- Platform.device = Platform.os === OS.iOS || Platform.os === OS.Android ? Devices.Mobile : Platform.os === OS.Windows || Platform.os === OS.MacOS ? Devices.Desktop : Devices.Unknown;
512
- Platform.isMobile = Platform.device === Devices.Mobile;
513
- Platform.isDesktop = Platform.device === Devices.Desktop;
514
- Platform.isStandalone = getIsStandalone(Platform.os);
515
-
516
- function createCustomError(name, Base) {
517
- if (Base === void 0) { Base = Error; }
518
- function CustomError(message) {
519
- if (!(this instanceof CustomError))
520
- return new CustomError(message);
521
- var error = new Base(message || '');
522
- if (typeof Object.setPrototypeOf === 'function')
523
- Object.setPrototypeOf(error, CustomError.prototype);
524
- else
525
- error.__proto__ = CustomError.prototype;
526
- error.name = name;
527
- if (message !== undefined)
528
- error.message = message;
529
- if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
530
- try {
531
- Object.defineProperty(error, Symbol.toStringTag, {
532
- value: name,
533
- writable: false,
534
- enumerable: false,
535
- configurable: true
536
- });
537
- }
538
- catch (_) {
539
- }
540
- }
541
- if (typeof Error.captureStackTrace === 'function') {
542
- Error.captureStackTrace(error, CustomError);
543
- }
544
- else if (Base.captureStackTrace && typeof Base.captureStackTrace === 'function') {
545
- Base.captureStackTrace(error, CustomError);
546
- }
547
- else {
548
- try {
549
- var tempError = new Base();
550
- if (tempError.stack)
551
- error.stack = tempError.stack;
552
- }
553
- catch (_) {
554
- }
555
- }
556
- return error;
557
- }
558
- CustomError.prototype = Object.create(Base.prototype, {
559
- constructor: {
560
- value: CustomError,
561
- writable: true,
562
- enumerable: false,
563
- configurable: true
564
- }
565
- });
566
- try {
567
- Object.defineProperty(CustomError.prototype, 'name', {
568
- value: name,
569
- writable: true,
570
- enumerable: false,
571
- configurable: true
572
- });
573
- }
574
- catch (_) {
575
- try {
576
- CustomError.prototype.name = name;
577
- }
578
- catch (_) {
579
- }
580
- }
581
- try {
582
- Object.defineProperty(CustomError, 'name', {
583
- value: name,
584
- writable: false,
585
- enumerable: false,
586
- configurable: true
587
- });
588
- }
589
- catch (_) {
590
- }
591
- return CustomError;
592
- }
593
-
594
- var URLOpenError = createCustomError('URLOpenError');
595
-
596
- function getTopmostWindow() {
597
- try {
598
- if (globalThis.top && globalThis.top !== window) {
599
- void globalThis.top.location.href;
600
- return globalThis.top;
601
- }
602
- }
603
- catch (_) {
604
- }
605
- return window;
606
- }
607
-
608
- function createHiddenElement(tagName, focusable) {
609
- if (focusable === void 0) { focusable = true; }
610
- if (typeof globalThis.document === 'undefined')
611
- return undefined;
612
- var element = globalThis.document.createElement(tagName);
613
- if ('width' in element)
614
- element.width = '0';
615
- if ('height' in element)
616
- element.height = '0';
617
- if ('border' in element)
618
- element.border = '0';
619
- if ('frameBorder' in element)
620
- element.frameBorder = '0';
621
- if ('scrolling' in element)
622
- element.scrolling = 'no';
623
- if ('cellPadding' in element)
624
- element.cellPadding = '0';
625
- if ('cellSpacing' in element)
626
- element.cellSpacing = '0';
627
- if ('frame' in element)
628
- element.frame = 'void';
629
- if ('rules' in element)
630
- element.rules = 'none';
631
- if ('noWrap' in element)
632
- element.noWrap = true;
633
- element.tabIndex = -1;
634
- element.setAttribute('role', 'presentation');
635
- if (focusable) {
636
- element.style.width = '1px';
637
- element.style.height = '1px';
638
- }
639
- else {
640
- element.setAttribute('aria-hidden', 'true');
641
- element.style.width = '0';
642
- element.style.height = '0';
643
- element.style.zIndex = '-9999';
644
- element.style.display = 'none';
645
- element.style.visibility = 'hidden';
646
- element.style.pointerEvents = 'none';
726
+ Platform.browser = browser;
727
+ Platform.browserVersion = resolveVersion(matched[1], resolver);
728
+ break;
647
729
  }
648
- element.style.position = 'absolute';
649
- element.style.top = '0';
650
- element.style.left = '0';
651
- element.style.padding = '0';
652
- element.style.margin = '0';
653
- element.style.border = 'none';
654
- element.style.outline = 'none';
655
- element.style.clip = 'rect(1px, 1px, 1px, 1px)';
656
- element.style.clipPath = 'inset(50%)';
657
- element.style.overflow = 'hidden';
658
- element.style.whiteSpace = 'nowrap';
659
- return element;
660
730
  }
661
-
662
- function dispatchClickEvent(element, view) {
663
- if (view === void 0) { view = window; }
664
- var fake;
731
+ if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
665
732
  try {
666
- fake = new MouseEvent('click', {
667
- bubbles: true,
668
- cancelable: true,
669
- view: view
670
- });
733
+ var reactNative = require('react-native');
734
+ var platform = reactNative.Platform;
735
+ var os = platform.OS;
736
+ var release = '' + platform.Version;
737
+ var version = getSemanticVersion(release);
738
+ switch (os) {
739
+ case 'android':
740
+ Platform.os = OS.Android;
741
+ Platform.osVersion = resolveSemanticAndroidVersion(version, release);
742
+ break;
743
+ case 'ios':
744
+ Platform.os = OS.iOS;
745
+ Platform.osVersion = release;
746
+ break;
747
+ case 'windows':
748
+ Platform.os = OS.Windows;
749
+ Platform.osVersion = resolveSemanticWindowsVersion(version, release);
750
+ break;
751
+ case 'macos':
752
+ Platform.os = OS.MacOS;
753
+ Platform.osVersion = release;
754
+ break;
755
+ }
671
756
  }
672
757
  catch (_) {
673
- fake = globalThis.document.createEvent('MouseEvents');
674
- fake.initMouseEvent('click', true, true, view, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
675
758
  }
676
- element.dispatchEvent(fake);
677
759
  }
678
-
679
- function capitalize(_) {
680
- var groups = [];
681
- for (var _i = 1; _i < arguments.length; _i++) {
682
- groups[_i - 1] = arguments[_i];
760
+ if (Platform.isNode) {
761
+ try {
762
+ var os = require('os');
763
+ var platform = os.platform();
764
+ var release = os.release();
765
+ var version = getSemanticVersion(release);
766
+ switch (platform) {
767
+ case 'win32':
768
+ Platform.os = OS.Windows;
769
+ Platform.osVersion = resolveSemanticWindowsVersion(version, release);
770
+ break;
771
+ case 'darwin':
772
+ Platform.os = OS.MacOS;
773
+ Platform.osVersion = resolveSemanticDarwinVersion(version, release);
774
+ break;
775
+ case 'android':
776
+ Platform.os = OS.Android;
777
+ Platform.osVersion = release;
778
+ break;
779
+ case 'linux':
780
+ if (/android/i.test(release)) {
781
+ Platform.os = OS.Android;
782
+ Platform.osVersion = release;
783
+ }
784
+ break;
785
+ }
683
786
  }
684
- var result = '';
685
- for (var i = 0; i < groups.length - 2; i++) {
686
- var arg = groups[i];
687
- if (arg !== undefined)
688
- result = result + arg.charAt(0).toUpperCase() + arg.slice(1);
787
+ catch (_) {
689
788
  }
690
- return result;
691
- }
692
- function preventDefaultPolyfill() {
693
- this.returnValue = false;
694
- }
695
- function stopPropagationPolyfill() {
696
- this.cancelBubble = true;
697
789
  }
698
- var EVENT_TYPE_REGEXP = /(animation)(start|iteration|end|cancel)|(transition)(start|run|end|cancel)|(fullscreen)(change|error)|(lost|got)(pointer)(capture)|(pointer)(lock)(change|error)|(pointer)(cancel|down|enter|leave|move|out|over|up)/i;
699
- var VENDORS = ['', 'webkit', 'moz', 'ms', 'MS', 'o', 'O'];
700
- var LEGACY_TYPE_MAP = {
701
- 'wheel': ['wheel', 'mousewheel', 'DOMMouseScroll'],
702
- 'focus': ['focus', 'focusin'],
703
- 'blur': ['blur', 'focusout'],
704
- 'beforeinput': ['beforeinput', 'textInput'],
705
- };
706
- var EventListenerUtils = {
707
- useStd: typeof globalThis.document !== 'undefined' && typeof globalThis.document.addEventListener === 'function',
708
- add: function (target, eventListenerOptions) {
709
- if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
710
- var callback = eventListenerOptions.callback;
711
- if (target === undefined || callback === null)
712
- return;
713
- var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
714
- var options = eventListenerOptions.options;
715
- if (typeof target.addEventListener === 'function') {
716
- try {
717
- return target.addEventListener(type, callback, options);
718
- }
719
- catch (_) {
720
- }
721
- }
722
- if (typeof target.addListener === 'function') {
723
- if (typeof target.matches === 'boolean') {
724
- try {
725
- return target.addListener(callback);
726
- }
727
- catch (_) {
728
- }
729
- }
730
- else {
731
- try {
732
- return target.addListener(type, callback);
733
- }
734
- catch (_) {
735
- }
736
- }
737
- }
738
- function wrapper(event) {
739
- if (event === undefined)
740
- event = globalThis.event;
741
- if (event === undefined)
742
- return;
743
- event.currentTarget = target;
744
- if (typeof event.preventDefault !== 'function')
745
- event.preventDefault = preventDefaultPolyfill;
746
- if (typeof event.stopPropagation !== 'function')
747
- event.stopPropagation = stopPropagationPolyfill;
748
- if (typeof callback === 'function')
749
- callback.call(target, event);
750
- else if (callback && typeof callback.handleEvent === 'function')
751
- callback.handleEvent.call(target, event);
752
- }
753
- if (typeof target.attachEvent === 'function') {
754
- if (callback.__ieWrapper)
755
- return target.attachEvent('on' + type, callback.__ieWrapper);
756
- return target.attachEvent('on' + type, callback.__ieWrapper = wrapper);
757
- }
758
- },
759
- remove: function (target, eventListenerOptions) {
760
- if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
761
- var callback = eventListenerOptions.callback;
762
- if (target === undefined || callback === null)
763
- return;
764
- var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
765
- var options = eventListenerOptions.options;
766
- if (typeof target.removeEventListener === 'function') {
767
- try {
768
- return target.removeEventListener(type, callback, options);
769
- }
770
- catch (_) {
771
- }
772
- }
773
- if (typeof target.removeListener === 'function') {
774
- if (typeof target.matches === 'boolean') {
775
- try {
776
- return target.removeListener(callback);
777
- }
778
- catch (_) {
779
- }
780
- }
781
- else {
782
- try {
783
- return target.removeListener(type, callback);
784
- }
785
- catch (_) {
786
- }
790
+ if (typeof globalThis.document !== 'undefined') {
791
+ globalThis.document.addEventListener("deviceready", function () {
792
+ Platform.crossPlatformFramework = CrossPlatformFramework.Cordova;
793
+ if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
794
+ switch (globalThis.device.platform) {
795
+ case 'Android':
796
+ Platform.os = OS.Android;
797
+ break;
798
+ case 'iOS':
799
+ Platform.os = OS.iOS;
800
+ break;
787
801
  }
802
+ Platform.osVersion = globalThis.device.version;
788
803
  }
789
- if (typeof target.detachEvent === 'function') {
790
- var wrapper = callback.__ieWrapper;
791
- if (wrapper !== undefined) {
792
- target.detachEvent('on' + type, wrapper);
793
- delete callback.__ieWrapper;
794
- }
795
- return;
804
+ }, false);
805
+ }
806
+ if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
807
+ navigator
808
+ .userAgentData
809
+ .getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
810
+ .then(function (result) {
811
+ var brands = result.fullVersionList || result.brands || [];
812
+ var platformVersion = result.platformVersion;
813
+ for (var i = 0; i < brands.length; i++) {
814
+ var brand = normalizeBrand(brands[i]);
815
+ var brandName = brand.brand;
816
+ var brandVersion = brand.version;
817
+ if (/not.a.brand/i.test(brandName))
818
+ continue;
819
+ if (brandName === "Chromium")
820
+ Platform.engineVersion = brandVersion;
796
821
  }
797
- },
798
- withVender: function (target, type) {
799
- if (type === undefined)
800
- return '';
801
- if (target === globalThis.document && ['deviceready', 'pause', 'resume', 'backbutton', 'menubutton', 'searchbutton', 'startcallbutton', 'endcallbutton', 'volumedownbutton', 'volumeupbutton', 'activated', 'cordovacallbackerror'].indexOf(type) > -1)
802
- return type;
803
- if (typeof target.webkitEnterFullscreen !== 'undefined' && ['webkitbeginfullscreen', 'webkitendfullscreen', 'webkitpresentationmodechanged'].indexOf(type) > -1)
804
- return type;
805
- var types;
806
- if (type in LEGACY_TYPE_MAP)
807
- types = LEGACY_TYPE_MAP[type];
808
- else if (EVENT_TYPE_REGEXP.test(type))
809
- types = [type, type.replace(EVENT_TYPE_REGEXP, capitalize)];
810
- else
811
- types = [type];
812
- for (var i = 0; i < VENDORS.length; i++) {
813
- for (var j = 0; j < types.length; j++) {
814
- var name_1 = VENDORS[i] + types[j];
815
- if (typeof target['on' + name_1] !== 'undefined')
816
- return name_1;
817
- }
822
+ if (typeof platformVersion === 'string') {
823
+ if (Platform.os === OS.Windows && parseInt(platformVersion.replace(/[^\d.]/g, '').split('.')[0], 10) >= 13)
824
+ Platform.osVersion = '11';
825
+ else
826
+ Platform.osVersion = platformVersion;
818
827
  }
819
- return '';
820
- }
821
- };
828
+ });
829
+ }
830
+ Platform.device = Platform.os === OS.iOS || Platform.os === OS.Android ? Devices.Mobile : Platform.os === OS.Windows || Platform.os === OS.MacOS ? Devices.Desktop : Devices.Unknown;
831
+ Platform.isMobile = Platform.device === Devices.Mobile;
832
+ Platform.isDesktop = Platform.device === Devices.Desktop;
833
+ Platform.isStandalone = getIsStandalone(Platform.os);
822
834
 
823
835
  var _a;
824
836
  var App = {
@@ -1133,16 +1145,9 @@
1133
1145
  }
1134
1146
  function tryOpenURLViaElectron(url) {
1135
1147
  try {
1136
- var shell_1;
1137
- if (typeof globalThis.electronBridge !== 'undefined') {
1138
- shell_1 = globalThis.electronBridge;
1139
- }
1140
- else {
1141
- var electron = require('electron');
1142
- shell_1 = electron.shell;
1143
- }
1148
+ var electron_1 = require('electron');
1144
1149
  return new Promise(function (resolve, reject) {
1145
- shell_1
1150
+ electron_1.shell
1146
1151
  .openExternal(url)
1147
1152
  .then(resolve)
1148
1153
  .catch(reject);
@@ -1153,15 +1158,15 @@
1153
1158
  }
1154
1159
  }
1155
1160
  function tryOpenURL(url, index, timeout) {
1156
- if (IS_REACT_NATIVE)
1161
+ if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative)
1157
1162
  return tryOpenURLViaReactNative(url);
1158
- if (IS_ELECTRON)
1163
+ if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron)
1159
1164
  return tryOpenURLViaElectron(url);
1160
1165
  var top = getTopmostWindow();
1161
1166
  var topDocument = top.document;
1162
1167
  var eventType = { focus: undefined, blur: undefined, visibilitychange: undefined };
1163
1168
  var eventTarget = { focus: undefined, blur: undefined, visibilitychange: undefined };
1164
- if (IS_CORDOVA) {
1169
+ if (Platform.crossPlatformFramework === CrossPlatformFramework.Cordova) {
1165
1170
  eventTarget = { focus: topDocument, blur: topDocument };
1166
1171
  eventType = { focus: 'resume', blur: 'pause' };
1167
1172
  }
@@ -1255,7 +1260,7 @@
1255
1260
  if (!hasFocus(topDocument))
1256
1261
  restoreFocus();
1257
1262
  try {
1258
- if (IS_CORDOVA) {
1263
+ if (Platform.crossPlatformFramework === CrossPlatformFramework.Cordova) {
1259
1264
  globalThis.open(url, '_system');
1260
1265
  }
1261
1266
  else {
@@ -1274,7 +1279,7 @@
1274
1279
  var tried = [];
1275
1280
  var infos = {};
1276
1281
  var timeout;
1277
- if (os === OS.Android) {
1282
+ if (Platform.os === OS.Android) {
1278
1283
  var option = options[OS.Android] || options['android'];
1279
1284
  if (option === undefined)
1280
1285
  return Promise.reject(getURLOpenError(tried));
@@ -1299,7 +1304,7 @@
1299
1304
  if (infos.scheme !== undefined && infos.intent === undefined)
1300
1305
  infos.intent = createIntentURL(infos.scheme, infos.packageName, infos.fallback);
1301
1306
  }
1302
- else if (os === OS.iOS) {
1307
+ else if (Platform.os === OS.iOS) {
1303
1308
  var option = options[OS.iOS] || options['ios'];
1304
1309
  if (option === undefined)
1305
1310
  return Promise.reject(getURLOpenError(tried));
@@ -1316,7 +1321,7 @@
1316
1321
  if (infos.bundleId !== undefined && infos.trackId === undefined)
1317
1322
  infos.trackId = getTrackId(infos.bundleId);
1318
1323
  }
1319
- else if (os === OS.Windows) {
1324
+ else if (Platform.os === OS.Windows) {
1320
1325
  var option = options[OS.Windows] || options['windows'];
1321
1326
  if (option === undefined)
1322
1327
  return Promise.reject(getURLOpenError(tried));
@@ -1329,7 +1334,7 @@
1329
1334
  infos.allowAppStore = option.allowAppStore;
1330
1335
  infos.allowWebStore = option.allowWebStore;
1331
1336
  }
1332
- else if (os === OS.MacOS) {
1337
+ else if (Platform.os === OS.MacOS) {
1333
1338
  var option = options[OS.MacOS] || options['mac'];
1334
1339
  if (option === undefined)
1335
1340
  return Promise.reject(getURLOpenError(tried));