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