native-fn 1.0.26 → 1.0.28

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 (161) hide show
  1. package/README.md +22 -192
  2. package/dist/index.d.ts +18 -27
  3. package/dist/native.cjs +27 -1400
  4. package/dist/native.min.cjs +1 -0
  5. package/dist/native.min.mjs +1 -0
  6. package/dist/native.mjs +27 -1400
  7. package/dist/native.umd.js +27 -1400
  8. package/dist/native.umd.min.js +1 -0
  9. package/dist/plugin/app/index.cjs +1025 -0
  10. package/dist/plugin/app/index.d.ts +86 -0
  11. package/dist/plugin/app/index.min.cjs +1 -0
  12. package/dist/plugin/app/index.min.mjs +1 -0
  13. package/dist/plugin/app/index.mjs +1023 -0
  14. package/dist/plugin/app/index.umd.js +1031 -0
  15. package/dist/plugin/app/index.umd.min.js +1 -0
  16. package/dist/plugin/app/src/constants/platform.d.ts +35 -0
  17. package/dist/plugin/app/src/constants/user-agent.d.ts +1 -0
  18. package/dist/plugin/app/src/plugin/app/cores/app.d.ts +3 -0
  19. package/dist/plugin/app/src/plugin/app/index.d.ts +5 -0
  20. package/dist/plugin/app/src/plugin/app/types/app.d.ts +54 -0
  21. package/dist/plugin/app/src/plugin/app/types/appModule.d.ts +54 -0
  22. package/dist/plugin/app/src/plugin/app/types/index.d.ts +1 -0
  23. package/dist/plugin/app/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
  24. package/dist/plugin/app/src/plugin/platform/cores/platform.d.ts +3 -0
  25. package/dist/plugin/app/src/plugin/platform/index.d.ts +5 -0
  26. package/dist/plugin/app/src/plugin/platform/types/index.d.ts +1 -0
  27. package/dist/{src → plugin/app/src/plugin/platform}/types/platform.d.ts +1 -1
  28. package/dist/plugin/app/src/plugin/platform/types/platformModule.d.ts +13 -0
  29. package/dist/{src → plugin/app/src/plugin/theme}/constants/theme.d.ts +1 -1
  30. package/dist/plugin/app/src/plugin/theme/cores/theme.d.ts +3 -0
  31. package/dist/plugin/app/src/plugin/theme/index.d.ts +5 -0
  32. package/dist/plugin/app/src/plugin/theme/types/color.d.ts +17 -0
  33. package/dist/{src → plugin/app/src/plugin/theme}/types/easing-syntax.d.ts +1 -1
  34. package/dist/plugin/app/src/plugin/theme/types/index.d.ts +3 -0
  35. package/dist/{src → plugin/app/src/plugin/theme}/types/theme.d.ts +4 -4
  36. package/dist/plugin/app/src/plugin/theme/types/themeModule.d.ts +24 -0
  37. package/dist/{src → plugin/app/src/plugin/theme}/utils/parse-color.d.ts +1 -1
  38. package/dist/{src → plugin/app/src/plugin/theme}/utils/parse-easing-function.d.ts +1 -1
  39. package/dist/plugin/app/src/types/index.d.ts +1 -0
  40. package/dist/plugin/app/src/types/native.d.ts +14 -0
  41. package/dist/plugin/app/src/utils/assign.d.ts +1 -0
  42. package/dist/plugin/app/src/utils/create-custom-error.d.ts +1 -0
  43. package/dist/plugin/platform/index.cjs +171 -0
  44. package/dist/plugin/platform/index.d.ts +51 -0
  45. package/dist/plugin/platform/index.min.cjs +1 -0
  46. package/dist/plugin/platform/index.min.mjs +1 -0
  47. package/dist/plugin/platform/index.mjs +169 -0
  48. package/dist/plugin/platform/index.umd.js +177 -0
  49. package/dist/plugin/platform/index.umd.min.js +1 -0
  50. package/dist/plugin/platform/src/constants/platform.d.ts +35 -0
  51. package/dist/plugin/platform/src/constants/user-agent.d.ts +1 -0
  52. package/dist/plugin/platform/src/plugin/app/constants/app.d.ts +13 -0
  53. package/dist/plugin/platform/src/plugin/app/cores/app.d.ts +3 -0
  54. package/dist/plugin/platform/src/plugin/app/errors/url-open-error.d.ts +2 -0
  55. package/dist/plugin/platform/src/plugin/app/index.d.ts +5 -0
  56. package/dist/plugin/platform/src/plugin/app/types/app.d.ts +54 -0
  57. package/dist/plugin/platform/src/plugin/app/types/appModule.d.ts +54 -0
  58. package/dist/plugin/platform/src/plugin/app/types/index.d.ts +1 -0
  59. package/dist/plugin/platform/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
  60. package/dist/plugin/platform/src/plugin/app/utils/try-open-url.d.ts +1 -0
  61. package/dist/plugin/platform/src/plugin/platform/cores/platform.d.ts +3 -0
  62. package/dist/plugin/platform/src/plugin/platform/index.d.ts +5 -0
  63. package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +1 -0
  64. package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +13 -0
  65. package/dist/plugin/platform/src/plugin/platform/types/platformModule.d.ts +13 -0
  66. package/dist/plugin/platform/src/plugin/theme/constants/theme.d.ts +16 -0
  67. package/dist/plugin/platform/src/plugin/theme/cores/theme.d.ts +3 -0
  68. package/dist/plugin/platform/src/plugin/theme/errors/easing-error.d.ts +6 -0
  69. package/dist/plugin/platform/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
  70. package/dist/plugin/platform/src/plugin/theme/index.d.ts +5 -0
  71. package/dist/plugin/platform/src/plugin/theme/types/color.d.ts +17 -0
  72. package/dist/plugin/platform/src/plugin/theme/types/easing-syntax.d.ts +16 -0
  73. package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +3 -0
  74. package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +24 -0
  75. package/dist/plugin/platform/src/plugin/theme/types/themeModule.d.ts +24 -0
  76. package/dist/plugin/platform/src/plugin/theme/utils/parse-color.d.ts +2 -0
  77. package/dist/plugin/platform/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
  78. package/dist/plugin/platform/src/types/index.d.ts +1 -0
  79. package/dist/plugin/platform/src/types/native.d.ts +14 -0
  80. package/dist/plugin/platform/src/utils/assign.d.ts +1 -0
  81. package/dist/plugin/platform/src/utils/create-custom-error.d.ts +1 -0
  82. package/dist/plugin/theme/index.cjs +810 -0
  83. package/dist/plugin/theme/index.d.ts +75 -0
  84. package/dist/plugin/theme/index.min.cjs +1 -0
  85. package/dist/plugin/theme/index.min.mjs +1 -0
  86. package/dist/plugin/theme/index.mjs +808 -0
  87. package/dist/plugin/theme/index.umd.js +816 -0
  88. package/dist/plugin/theme/index.umd.min.js +1 -0
  89. package/dist/plugin/theme/src/constants/platform.d.ts +35 -0
  90. package/dist/plugin/theme/src/constants/user-agent.d.ts +1 -0
  91. package/dist/plugin/theme/src/plugin/app/constants/app.d.ts +13 -0
  92. package/dist/plugin/theme/src/plugin/app/cores/app.d.ts +3 -0
  93. package/dist/plugin/theme/src/plugin/app/errors/url-open-error.d.ts +2 -0
  94. package/dist/plugin/theme/src/plugin/app/index.d.ts +5 -0
  95. package/dist/plugin/theme/src/plugin/app/types/app.d.ts +54 -0
  96. package/dist/plugin/theme/src/plugin/app/types/appModule.d.ts +54 -0
  97. package/dist/plugin/theme/src/plugin/app/types/index.d.ts +1 -0
  98. package/dist/plugin/theme/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
  99. package/dist/plugin/theme/src/plugin/app/utils/try-open-url.d.ts +1 -0
  100. package/dist/plugin/theme/src/plugin/platform/cores/platform.d.ts +3 -0
  101. package/dist/plugin/theme/src/plugin/platform/index.d.ts +5 -0
  102. package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +1 -0
  103. package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +13 -0
  104. package/dist/plugin/theme/src/plugin/platform/types/platformModule.d.ts +13 -0
  105. package/dist/plugin/theme/src/plugin/theme/constants/theme.d.ts +16 -0
  106. package/dist/plugin/theme/src/plugin/theme/cores/theme.d.ts +3 -0
  107. package/dist/plugin/theme/src/plugin/theme/errors/easing-error.d.ts +6 -0
  108. package/dist/plugin/theme/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
  109. package/dist/plugin/theme/src/plugin/theme/index.d.ts +5 -0
  110. package/dist/plugin/theme/src/plugin/theme/types/color.d.ts +17 -0
  111. package/dist/plugin/theme/src/plugin/theme/types/easing-syntax.d.ts +16 -0
  112. package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +3 -0
  113. package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +24 -0
  114. package/dist/plugin/theme/src/plugin/theme/types/themeModule.d.ts +24 -0
  115. package/dist/plugin/theme/src/plugin/theme/utils/parse-color.d.ts +2 -0
  116. package/dist/plugin/theme/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
  117. package/dist/plugin/theme/src/types/index.d.ts +1 -0
  118. package/dist/plugin/theme/src/types/native.d.ts +14 -0
  119. package/dist/plugin/theme/src/utils/assign.d.ts +1 -0
  120. package/dist/plugin/theme/src/utils/create-custom-error.d.ts +1 -0
  121. package/dist/src/plugin/app/constants/app.d.ts +13 -0
  122. package/dist/src/plugin/app/cores/app.d.ts +3 -0
  123. package/dist/src/plugin/app/errors/url-open-error.d.ts +2 -0
  124. package/dist/src/plugin/app/index.d.ts +5 -0
  125. package/dist/src/plugin/app/types/app.d.ts +54 -0
  126. package/dist/src/plugin/app/types/appModule.d.ts +54 -0
  127. package/dist/src/plugin/app/types/index.d.ts +1 -0
  128. package/dist/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
  129. package/dist/src/plugin/app/utils/try-open-url.d.ts +1 -0
  130. package/dist/src/plugin/platform/cores/platform.d.ts +3 -0
  131. package/dist/src/plugin/platform/index.d.ts +5 -0
  132. package/dist/src/plugin/platform/types/index.d.ts +1 -0
  133. package/dist/src/plugin/platform/types/platform.d.ts +13 -0
  134. package/dist/src/plugin/platform/types/platformModule.d.ts +13 -0
  135. package/dist/src/plugin/theme/constants/theme.d.ts +16 -0
  136. package/dist/src/plugin/theme/cores/theme.d.ts +3 -0
  137. package/dist/src/plugin/theme/errors/easing-error.d.ts +6 -0
  138. package/dist/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
  139. package/dist/src/plugin/theme/index.d.ts +5 -0
  140. package/dist/src/plugin/theme/types/color.d.ts +17 -0
  141. package/dist/src/plugin/theme/types/easing-syntax.d.ts +16 -0
  142. package/dist/src/plugin/theme/types/index.d.ts +3 -0
  143. package/dist/src/plugin/theme/types/theme.d.ts +24 -0
  144. package/dist/src/plugin/theme/types/themeModule.d.ts +24 -0
  145. package/dist/src/plugin/theme/utils/parse-color.d.ts +2 -0
  146. package/dist/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
  147. package/dist/src/types/index.d.ts +1 -5
  148. package/dist/src/types/native.d.ts +14 -0
  149. package/dist/src/utils/assign.d.ts +1 -0
  150. package/package.json +8 -5
  151. package/dist/src/cores/app.d.ts +0 -3
  152. package/dist/src/cores/platform.d.ts +0 -3
  153. package/dist/src/cores/theme.d.ts +0 -3
  154. package/dist/src/types/app.d.ts +0 -44
  155. package/dist/src/types/color.d.ts +0 -17
  156. package/dist/src/utils/freeze-deep.d.ts +0 -1
  157. /package/dist/{src → plugin/app/src/plugin/app}/constants/app.d.ts +0 -0
  158. /package/dist/{src → plugin/app/src/plugin/app}/errors/url-open-error.d.ts +0 -0
  159. /package/dist/{src → plugin/app/src/plugin/app}/utils/try-open-url.d.ts +0 -0
  160. /package/dist/{src → plugin/app/src/plugin/theme}/errors/easing-error.d.ts +0 -0
  161. /package/dist/{src → plugin/app/src/plugin/theme}/errors/unsupported-color-error.d.ts +0 -0
@@ -0,0 +1,86 @@
1
+ declare interface NativePlugin<T> {
2
+ installed: boolean;
3
+ name: string;
4
+ module: T;
5
+ constants: Record<string, any>;
6
+ errors: Record<string, ErrorConstructor>;
7
+ }
8
+
9
+ declare enum OS {
10
+ Unknown = "Unknown",
11
+ Android = "Android",
12
+ iOS = "iOS",
13
+ Windows = "Windows",
14
+ MacOS = "MacOS"
15
+ }
16
+
17
+ declare enum AppOpenState {
18
+ Scheme = 0,
19
+ Universal = 1,
20
+ Intent = 2,
21
+ Fallback = 3,
22
+ Store = 4
23
+ }
24
+ declare enum Messengers {
25
+ Telephone = "telephone",
26
+ Message = "message",
27
+ Mail = "mail"
28
+ }
29
+
30
+ declare interface EventListenerUtil {
31
+ useStd: boolean;
32
+ add: (target: any, eventListenerOptions: EventListenerOptions) => void;
33
+ remove: (target: any, eventListenerOptions: EventListenerOptions) => void;
34
+ withVender: (target: any, type?: string) => string;
35
+ }
36
+ declare interface EventListenerOptions {
37
+ type?: string;
38
+ callback: EventListenerOrEventListenerObject | null;
39
+ options?: AddEventListenerOptions | boolean;
40
+ }
41
+ declare interface AppInfo {
42
+ scheme?: URLCandidate;
43
+ fallback?: URLCandidate | (() => any);
44
+ timeout?: number;
45
+ allowWebStore?: boolean;
46
+ }
47
+ declare interface AndroidAppInfo extends AppInfo {
48
+ packageName?: string;
49
+ intent?: URLCandidate;
50
+ }
51
+ declare interface IOSAppInfo extends MacOSAppInfo {
52
+ universal?: URLCandidate;
53
+ }
54
+ declare interface WindowsAppInfo extends AppInfo {
55
+ productId?: string;
56
+ }
57
+ declare interface MacOSAppInfo extends AppInfo {
58
+ bundleId?: string;
59
+ trackId?: string;
60
+ }
61
+ declare interface AppOpenOptions {
62
+ [OS.Android]?: AndroidAppInfo;
63
+ [OS.iOS]?: IOSAppInfo;
64
+ [OS.Windows]?: WindowsAppInfo;
65
+ [OS.MacOS]?: MacOSAppInfo;
66
+ }
67
+ declare type URLCandidate = URL | string;
68
+ declare type Stringifiable = string | number | boolean | HTMLElement | null | undefined;
69
+ declare type StringifiableSequence = Stringifiable[] | NodeList | NodeListOf<Node> | HTMLCollectionBase;
70
+ declare type MessengerOpenOptions = {
71
+ to?: Stringifiable | StringifiableSequence;
72
+ cc?: Stringifiable | StringifiableSequence;
73
+ bcc?: Stringifiable | StringifiableSequence;
74
+ subject?: Stringifiable;
75
+ body?: Stringifiable;
76
+ } | HTMLFormElement | FormData;
77
+ declare type Messenger = Record<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
78
+ declare interface AppModule {
79
+ open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
80
+ messenger: Messenger;
81
+ }
82
+
83
+ declare const AppPlugin: NativePlugin<AppModule>;
84
+
85
+ export { AppPlugin as default };
86
+ export type { AndroidAppInfo, AppInfo, AppModule, AppOpenOptions, EventListenerOptions, EventListenerUtil, IOSAppInfo, MacOSAppInfo, Messenger, MessengerOpenOptions, Stringifiable, StringifiableSequence, URLCandidate, WindowsAppInfo };
@@ -0,0 +1 @@
1
+ "use strict";var e,t,n=navigator.userAgent;!function(e){e[e.Scheme=0]="Scheme",e[e.Universal=1]="Universal",e[e.Intent=2]="Intent",e[e.Fallback=3]="Fallback",e[e.Store=4]="Store"}(e||(e={})),function(e){e.Telephone="telephone",e.Message="message",e.Mail="mail"}(t||(t={}));var i,o,r,a=!/firefox|opr/i.test(n);!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(i||(i={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(o||(o={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={}));var c=function(){function e(e){return void 0===e?"":e.replace(/_/g,".")}function t(e){if(void 0===e)return"";var t={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==t?t:e}function n(e){return void 0===e?"":e}return[[/android\w*[-\/.; ]?([\d.]*)/i,i.Android,o.Mobile,n],[/microsoft windows (vista|xp)/i,i.Windows,o.Desktop,n],[/windows (?:phone(?: os)?|mobile|iot)[\/ ]?([.\w ]*)/i,i.Windows,o.Desktop,t],[/windows nt 6\.2; (arm)/i,i.Windows,o.Desktop,t],[/windows[\/ ]([ntce\d. ]+\w)(?!.+xbox)/i,i.Windows,o.Desktop,t],[/(?:win(?=[39n])|win 9x )([nt\d.]+)/i,i.Windows,o.Desktop,t],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,i.iOS,o.Mobile,e],[/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d.]+)/i,i.iOS,o.Mobile,e],[/cfnetwork\/.+darwin/i,i.iOS,o.Mobile,n],[/mac os x ?([\w. ]*)/i,i.MacOS,o.Desktop,e],[/(?:macintosh|mac_powerpc\b)(?!.+haiku)/i,i.MacOS,o.Desktop,e]]}(),u=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],s=i.Unknown,d="";o.Unknown;r.Unknown;for(var l=0;l<c.length;l++){var f=(b=c[l])[0],p=b[1],v=b[2],h=b[3];if(null!==(m=n.match(f))){s=p,d=h(m[1]);break}}for(l=0;l<u.length;l++){var b,m;f=(b=u[l])[0];if(b[1],null!==(m=n.match(f))){m[1];break}}function y(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i="",o=0;o<t.length-2;o++){var r=t[o];void 0!==r&&(i=i+r.charAt(0).toUpperCase()+r.slice(1))}return i}function w(){this.returnValue=!1}function g(){this.cancelBubble=!0}!function(){var e=document.createElement("canvas");if("function"!=typeof e.getContext)return"";var t=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===t)return"";if(t instanceof WebGLRenderingContext||"getParameter"in t&&"function"==typeof t.getParameter){var n=t.getExtension("WEBGL_debug_renderer_info");return null===n?t.getParameter(t.RENDERER):t.getParameter(n.UNMASKED_RENDERER_WEBGL)}}(),o.Mobile,o.Desktop,s===i.iOS?"standalone"in navigator&&navigator.standalone:window.matchMedia("(display-mode: standalone)").matches;var k={useStd:"undefined"!=typeof document&&"function"==typeof document.addEventListener,add:function(e,t){void 0===t&&(t={callback:null,options:!1});var n=t.callback;if(void 0!==e&&null!==n){var i=this.withVender(e,t.type),o=t.options;if("function"==typeof e.addEventListener)try{return e.addEventListener(i,n,o)}catch(e){}if("function"==typeof e.addListener)if("boolean"==typeof e.matches)try{return e.addListener(n)}catch(e){}else try{return e.addListener(i,n)}catch(e){}return"function"==typeof e.attachEvent?n.__ieWrapper?e.attachEvent("on"+i,n.__ieWrapper):e.attachEvent("on"+i,n.__ieWrapper=function(t){void 0===t&&(t=window.event),void 0!==t&&(t.currentTarget=e,"function"!=typeof t.preventDefault&&(t.preventDefault=w),"function"!=typeof t.stopPropagation&&(t.stopPropagation=g),"function"==typeof n?n.call(e,t):n&&"function"==typeof n.handleEvent&&n.handleEvent.call(e,t))}):void 0}},remove:function(e,t){void 0===t&&(t={callback:null,options:!1});var n=t.callback;if(void 0!==e&&null!==n){var i=this.withVender(e,t.type),o=t.options;if("function"==typeof e.removeEventListener)try{return e.removeEventListener(i,n,o)}catch(e){}if("function"==typeof e.removeListener)if("boolean"==typeof e.matches)try{return e.removeListener(n)}catch(e){}else try{return e.removeListener(i,n)}catch(e){}if("function"!=typeof e.detachEvent);else{var r=n.__ieWrapper;void 0!==r&&(e.detachEvent("on"+i,r),delete n.__ieWrapper)}}},withVender:function(e,t){if(void 0===t)return"";var n,i=/(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,o=["","webkit","moz","ms","MS","o","O"];n="wheel"===t?["wheel","mousewheel","DOMMouseScroll"]:"focus"===t?["focus","focusin"]:"blur"===t?["blur","focusout"]:i.test(t)?[t,t.replace(i,y)]:[t];for(var r=0;r<o.length;r++)for(var a=0;a<n.length;a++){var c=o[r]+n[a];if(void 0!==e["on"+c])return c}return""}};function S(){try{if(window.top&&window.top!==window)return window.top.location.href,window.top}catch(e){}return window}function E(e){var t=S(),n=void 0;try{(n=document.createElement("iframe")).src=e,n.width=n.height=n.frameBorder="0",n.setAttribute("aria-hidden","true"),n.style.display="none",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",t.document.body.appendChild(n),window.setTimeout((function(){if(void 0!==n)try{t.document.body.removeChild(n)}catch(e){}}),500)}catch(e){}}function T(e){return"function"==typeof e.hasFocus&&e.hasFocus()}function O(e){try{e.focus({preventScroll:!0})}catch(t){try{e.focus()}catch(e){}}}function M(e,t,n){var o=S(),r=o.document,a={focus:void 0,blur:void 0,visibilitychange:void 0},c={focus:void 0,blur:void 0,visibilitychange:void 0};return s===i.iOS?parseInt(d)>=8?(c={visibilitychange:r},a={visibilitychange:"visibilitychange"}):(c={focus:o,blur:o},a={focus:"pageshow",blur:"pagehide"}):k.useStd?(c={focus:o,blur:o,visibilitychange:r},a={focus:"focus",blur:"blur",visibilitychange:"visibilitychange"}):(c={focus:r,blur:r,visibilitychange:r},a={focus:"focus",blur:"blur",visibilitychange:"visibilitychange"}),new Promise((function(i,o){var u,s=!1;function d(e){if(!s){s=!0;try{!function(){void 0!==u&&(clearTimeout(u),u=void 0);try{k.remove(c.blur,{type:a.blur,callback:l}),k.remove(c.focus,{type:a.focus,callback:f}),k.remove(c.visibilitychange,{type:a.visibilitychange,callback:p})}catch(e){}}(),e?i():o()}catch(e){i()}}}function l(){void 0!==u&&(clearTimeout(u),u=void 0),k.remove(c.blur,{type:a.blur,callback:l}),k.add(c.focus,{type:a.focus,callback:f})}function f(){d(!0)}function p(){(function(){var e=S().document;return"hidden"===e.visibilityState||"hidden"===e.webkitVisibilityState||"hidden"===e.mozVisibilityState||"hidden"===e.msVisibilityState||(void 0!==e.hidden?e.hidden:void 0!==e.webkitHidden?e.webkitHidden:void 0!==e.mozHidden?e.mozHidden:void 0!==e.msHidden?e.msHidden:"function"!=typeof e.hasFocus||!e.hasFocus())})()&&d(!0)}u=window.setTimeout((function(){d(!1)}),n),k.add(c.blur,{type:a.blur,callback:l}),k.add(c.visibilitychange,{type:a.visibilitychange,callback:p}),T(r)||function(){var e=S(),t=e.document;if(O(e),T(t))return!0;if(t.body.tabIndex<0&&(t.body.tabIndex=-1),O(t.body),T(t))return!0;var n=void 0;try{(n=t.createElement("input")).type="text",n.readOnly=!0,n.tabIndex=-1,n.setAttribute("aria-hidden","true"),n.style.position="fixed",n.style.width=n.style.height="1px",n.style.top=n.style.left="0",n.style.opacity="0",n.style.zIndex="-1",t.body.appendChild(n),O(n);try{n.select()}catch(e){}if(T(t))return!0}catch(e){}finally{if(void 0!==n){try{n.blur()}catch(e){}try{t.body.removeChild(n)}catch(e){}}}T(t)}();try{!function(e,t){var n=S(),i=void 0;try{if(0===t)return void(n.location.href=e);(i=n.document.createElement("a")).href=e,i.setAttribute("aria-hidden","true"),i.style.display="none",n.document.body.appendChild(i);var o=void 0;try{o=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:n})}catch(e){(o=n.document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,n,0,0,0,0,0,!1,!1,!1,!1,0,null)}i.dispatchEvent(o)}catch(e){}finally{if(void 0!==i)try{n.document.body.removeChild(i)}catch(e){}}}(e,t),E(e)}catch(e){d(!1)}}))}var W,L=function(e,t){function n(i){if(!(this instanceof n))return new n(i);var o=new t(i||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(o,n.prototype):o.__proto__=n.prototype,o.name=e,void 0!==i&&(o.message=i),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(o,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(o,n);else if(t.captureStackTrace&&"function"==typeof t.captureStackTrace)t.captureStackTrace(o,n);else try{var r=new t;r.stack&&(o.stack=r.stack)}catch(e){}return o}void 0===t&&(t=Error),n.prototype=Object.create(t.prototype,{constructor:{value:n,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(n.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0})}catch(t){try{n.prototype.name=e}catch(e){}}try{Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}return n}("URLOpenError"),A={open:function(t){var n,o=s,r=[],c=[];function u(){for(var e="",t=0;t<r.length;t++)e+="\n"+(t+1)+": "+c[t];return e.length>0&&(e="\n"+e+"\n"),new L("Failed to open any of the provided URLs: "+e)}if(o===i.Android){if(void 0===(g=t[i.Android]))return Promise.reject(u());n=g.timeout;var l=D(g.scheme),f=D(g.intent),p=g.packageName,v=D(g.fallback),h=g.allowWebStore;if(void 0!==f&&(void 0===l||void 0===p||void 0===v)){var b=function(e){for(var t={},n=e.split("#Intent;"),i=n[0].substring(9),o=n[1],r=o.substring(0,o.length-4).split(";"),a={},c=0;c<r.length;c++){var u=r[c],s=u.indexOf("=");-1!==s&&(a[u.substring(0,s)]=u.substring(s+1))}void 0!==a.scheme&&(t.scheme=a.scheme+"://"+i);void 0!==a.package&&(t.packageName=a.package);void 0!==a["S.browser_fallback_url"]&&(t.fallback=a["S.browser_fallback_url"]);return t}(f);void 0!==b.scheme&&void 0===l&&(l=b.scheme),void 0!==b.packageName&&void 0===p&&(p=b.packageName),void 0!==b.fallback&&void 0===v&&(v=b.fallback)}void 0!==l&&void 0===f&&(f=function(e,t,n){var o=e.split("://"),r=o[0],a=o[1],c="intent://";void 0!==a&&(c+=a);c=c+"#Intent;scheme="+r+";action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;",void 0!==t&&(c=c+"package="+t+";");void 0!==n&&"string"==typeof n?c=c+"S.browser_fallback_url="+n+";":void 0!==t&&(c=c+"S.browser_fallback_url="+x(t,i.Android)+";");return c+"end"}(l,p,v)),void 0!==f&&a&&r.push([f,e.Intent]),void 0!==l&&r.push([l,e.Scheme]),void 0!==v&&r.push([v,e.Fallback]),void 0!==p&&r.push([x(p,i.Android),e.Store]),void 0!==p&&!0===h&&r.push([N(p,i.Android),e.Store])}else if(o===i.iOS){if(void 0===(g=t[i.iOS]))return Promise.reject(u());n=g.timeout;l=D(g.scheme),p=g.bundleId;var m=g.trackId,y=D(g.universal);v=D(g.fallback),h=g.allowWebStore;void 0!==p&&void 0===m&&(m=_(p)),void 0!==y&&parseInt(d)>=9&&r.push([y,e.Universal]),void 0!==l&&r.push([l,e.Scheme]),void 0!==v&&r.push([v,e.Fallback]),void 0!==m&&r.push([x(m,i.iOS),e.Store]),void 0!==m&&!0===h&&r.push([N(m,i.iOS),e.Store])}else if(o===i.Windows){if(void 0===(g=t[i.Windows]))return Promise.reject(u());n=g.timeout;l=D(g.scheme);var w=g.productId;v=D(g.fallback),h=g.allowWebStore;void 0!==l&&r.push([l,e.Scheme]),void 0!==v&&r.push([v,e.Fallback]),void 0!==w&&r.push([x(w,i.Windows),e.Store]),void 0!==w&&!0===h&&r.push([N(w,i.Windows),e.Store])}else if(o===i.MacOS){var g;if(void 0===(g=t[i.MacOS]))return Promise.reject(u());n=g.timeout;l=D(g.scheme),p=g.bundleId,m=g.trackId,v=D(g.fallback),h=g.allowWebStore;void 0!==p&&void 0===m&&(m=_(p)),void 0!==l&&r.push([l,e.Scheme]),void 0!==v&&r.push([v,e.Fallback]),void 0!==m&&r.push([x(m,i.MacOS),e.Store]),void 0!==m&&!0===h&&r.push([N(m,i.MacOS),e.Store])}void 0===n&&(n=P(o));return new Promise((function(e,t){return function i(o){if(void 0===o&&(o=0),o>=r.length)return t(u());var a=r[o],s=a[0];if("string"==typeof s)return c[o]=s,M(s,o,n).then((function(){e(a[1])})).catch((function(){i(o+1)}));c[o]="[function fallback]",s(),e(a[1])}()}))},messenger:(W={},W[t.Telephone]=function(e){return j(e,"tel")},W[t.Message]=function(e){return j(e,"sms")},W[t.Mail]=function(e){return j(e,"mailto")},W)};function _(e){try{var t=new XMLHttpRequest;if(t.open("GET","https://itunes.apple.com/lookup?bundleId="+e,!1),t.send(),200===t.status)try{var n=JSON.parse(t.response);if(void 0===n.results)return;var i=n.results;if(!Array.isArray(i)||0===i.length)return;var o=i[0];if(void 0===o)return;return o.trackId}catch(e){return}return}catch(e){return}}function x(e,t){switch(t){case i.Android:return"market://details?id="+e;case i.iOS:return"itms-apps://itunes.apple.com/app/id"+e+"?mt=8";case i.Windows:return"ms-windows-store://pdp/?ProductId="+e;case i.MacOS:return"macappstore://itunes.apple.com/app/id"+e+"?mt=12";default:throw new L('Unsupported OS: "'+n+'"')}}function N(e,t){switch(t){case i.Android:return"https://play.google.com/store/apps/details?id="+e;case i.iOS:return"https://itunes.apple.com/app/id"+e+"?mt=8";case i.Windows:return"https://apps.microsoft.com/detail/"+e;case i.MacOS:return"https://apps.apple.com/app/id"+e+"?mt=12";default:throw new L('Unsupported OS: "'+n+'"')}}function P(e){switch(e){case i.iOS:return 2e3;case i.Android:return 1e3;default:return 750}}function I(e,t,n){void 0===n&&(n=",");for(var i=e.length,o="",r=0;r<i;r++)o+=t(e[r]),r!==i-1&&(o+=n);return o}function U(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)}))}function D(e){return e instanceof URL?e.toString():e}function F(e){if("string"==typeof e)return U(e);if("number"==typeof e||"boolean"==typeof e)return U(String(e));if(null==e)return"";if(function(e){if(null==e||"string"==typeof e)return!1;var t=e.length;return"number"==typeof t&&t>=0&&!(t%1)}(e))return I(e,(function(e){return F(e)}));if(e instanceof HTMLInputElement){var t=e.type;if("checkbox"===t)return U(e.checked.toString());if("radio"===t)return e.checked?U(e.value):"";if("file"===t){var n=e.files;return null===n?"":I(n,(function(e){return U(e.name)}))}return U(e.value)}return e instanceof HTMLSelectElement?e.multiple?I(e.selectedOptions,(function(e){return U(e.value)})):U(e.value):e instanceof HTMLTextAreaElement?U(e.value):e instanceof HTMLElement?U(e.innerText):e instanceof Node?F(e.textContent):U(e.toString())}function H(e){if(e instanceof HTMLFormElement)return H(new FormData(e));if(e instanceof FormData){var t={};return e.forEach((function(e,n){var i;if(i=e instanceof File?e.name:e,Object.prototype.hasOwnProperty.call(t,n)){var o=t[n];Array.isArray(o)?o.push(i):t[n]=[o,i]}else t[n]=i})),H(t)}for(var n={},i=Object.keys(e),o=0;o<i.length;o++){var r=i[o];n[r]=F(e[r])}return void 0===n.to&&(n.to=""),void 0===n.cc&&(n.cc=""),void 0===n.bcc&&(n.bcc=""),void 0===n.subject&&(n.subject=""),void 0===n.body&&(n.body=""),n}function j(e,t){return M(t+":"+(e=H(e)).to+"?cc="+e.cc+"&bcc="+e.bcc+"&subject="+e.subject+"&body="+e.body,0,P(s))}var R={installed:!1,name:"App",module:A,constants:{AppOpenState:e,Messengers:t},errors:{URLOpenError:L}};module.exports=R;
@@ -0,0 +1 @@
1
+ var e,t,n=navigator.userAgent;!function(e){e[e.Scheme=0]="Scheme",e[e.Universal=1]="Universal",e[e.Intent=2]="Intent",e[e.Fallback=3]="Fallback",e[e.Store=4]="Store"}(e||(e={})),function(e){e.Telephone="telephone",e.Message="message",e.Mail="mail"}(t||(t={}));var i,o,r,a=!/firefox|opr/i.test(n);!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(i||(i={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(o||(o={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={}));var c=function(){function e(e){return void 0===e?"":e.replace(/_/g,".")}function t(e){if(void 0===e)return"";var t={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==t?t:e}function n(e){return void 0===e?"":e}return[[/android\w*[-\/.; ]?([\d.]*)/i,i.Android,o.Mobile,n],[/microsoft windows (vista|xp)/i,i.Windows,o.Desktop,n],[/windows (?:phone(?: os)?|mobile|iot)[\/ ]?([.\w ]*)/i,i.Windows,o.Desktop,t],[/windows nt 6\.2; (arm)/i,i.Windows,o.Desktop,t],[/windows[\/ ]([ntce\d. ]+\w)(?!.+xbox)/i,i.Windows,o.Desktop,t],[/(?:win(?=[39n])|win 9x )([nt\d.]+)/i,i.Windows,o.Desktop,t],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,i.iOS,o.Mobile,e],[/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d.]+)/i,i.iOS,o.Mobile,e],[/cfnetwork\/.+darwin/i,i.iOS,o.Mobile,n],[/mac os x ?([\w. ]*)/i,i.MacOS,o.Desktop,e],[/(?:macintosh|mac_powerpc\b)(?!.+haiku)/i,i.MacOS,o.Desktop,e]]}(),u=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],s=i.Unknown,d="";o.Unknown;r.Unknown;for(var l=0;l<c.length;l++){var f=(b=c[l])[0],p=b[1],v=b[2],h=b[3];if(null!==(m=n.match(f))){s=p,d=h(m[1]);break}}for(l=0;l<u.length;l++){var b,m;f=(b=u[l])[0];if(b[1],null!==(m=n.match(f))){m[1];break}}function y(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i="",o=0;o<t.length-2;o++){var r=t[o];void 0!==r&&(i=i+r.charAt(0).toUpperCase()+r.slice(1))}return i}function w(){this.returnValue=!1}function g(){this.cancelBubble=!0}!function(){var e=document.createElement("canvas");if("function"!=typeof e.getContext)return"";var t=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===t)return"";if(t instanceof WebGLRenderingContext||"getParameter"in t&&"function"==typeof t.getParameter){var n=t.getExtension("WEBGL_debug_renderer_info");return null===n?t.getParameter(t.RENDERER):t.getParameter(n.UNMASKED_RENDERER_WEBGL)}}(),o.Mobile,o.Desktop,s===i.iOS?"standalone"in navigator&&navigator.standalone:window.matchMedia("(display-mode: standalone)").matches;var k={useStd:"undefined"!=typeof document&&"function"==typeof document.addEventListener,add:function(e,t){void 0===t&&(t={callback:null,options:!1});var n=t.callback;if(void 0!==e&&null!==n){var i=this.withVender(e,t.type),o=t.options;if("function"==typeof e.addEventListener)try{return e.addEventListener(i,n,o)}catch(e){}if("function"==typeof e.addListener)if("boolean"==typeof e.matches)try{return e.addListener(n)}catch(e){}else try{return e.addListener(i,n)}catch(e){}return"function"==typeof e.attachEvent?n.__ieWrapper?e.attachEvent("on"+i,n.__ieWrapper):e.attachEvent("on"+i,n.__ieWrapper=function(t){void 0===t&&(t=window.event),void 0!==t&&(t.currentTarget=e,"function"!=typeof t.preventDefault&&(t.preventDefault=w),"function"!=typeof t.stopPropagation&&(t.stopPropagation=g),"function"==typeof n?n.call(e,t):n&&"function"==typeof n.handleEvent&&n.handleEvent.call(e,t))}):void 0}},remove:function(e,t){void 0===t&&(t={callback:null,options:!1});var n=t.callback;if(void 0!==e&&null!==n){var i=this.withVender(e,t.type),o=t.options;if("function"==typeof e.removeEventListener)try{return e.removeEventListener(i,n,o)}catch(e){}if("function"==typeof e.removeListener)if("boolean"==typeof e.matches)try{return e.removeListener(n)}catch(e){}else try{return e.removeListener(i,n)}catch(e){}if("function"!=typeof e.detachEvent);else{var r=n.__ieWrapper;void 0!==r&&(e.detachEvent("on"+i,r),delete n.__ieWrapper)}}},withVender:function(e,t){if(void 0===t)return"";var n,i=/(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,o=["","webkit","moz","ms","MS","o","O"];n="wheel"===t?["wheel","mousewheel","DOMMouseScroll"]:"focus"===t?["focus","focusin"]:"blur"===t?["blur","focusout"]:i.test(t)?[t,t.replace(i,y)]:[t];for(var r=0;r<o.length;r++)for(var a=0;a<n.length;a++){var c=o[r]+n[a];if(void 0!==e["on"+c])return c}return""}};function S(){try{if(window.top&&window.top!==window)return window.top.location.href,window.top}catch(e){}return window}function E(e){var t=S(),n=void 0;try{(n=document.createElement("iframe")).src=e,n.width=n.height=n.frameBorder="0",n.setAttribute("aria-hidden","true"),n.style.display="none",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",t.document.body.appendChild(n),window.setTimeout((function(){if(void 0!==n)try{t.document.body.removeChild(n)}catch(e){}}),500)}catch(e){}}function T(e){return"function"==typeof e.hasFocus&&e.hasFocus()}function O(e){try{e.focus({preventScroll:!0})}catch(t){try{e.focus()}catch(e){}}}function M(e,t,n){var o=S(),r=o.document,a={focus:void 0,blur:void 0,visibilitychange:void 0},c={focus:void 0,blur:void 0,visibilitychange:void 0};return s===i.iOS?parseInt(d)>=8?(c={visibilitychange:r},a={visibilitychange:"visibilitychange"}):(c={focus:o,blur:o},a={focus:"pageshow",blur:"pagehide"}):k.useStd?(c={focus:o,blur:o,visibilitychange:r},a={focus:"focus",blur:"blur",visibilitychange:"visibilitychange"}):(c={focus:r,blur:r,visibilitychange:r},a={focus:"focus",blur:"blur",visibilitychange:"visibilitychange"}),new Promise((function(i,o){var u,s=!1;function d(e){if(!s){s=!0;try{!function(){void 0!==u&&(clearTimeout(u),u=void 0);try{k.remove(c.blur,{type:a.blur,callback:l}),k.remove(c.focus,{type:a.focus,callback:f}),k.remove(c.visibilitychange,{type:a.visibilitychange,callback:p})}catch(e){}}(),e?i():o()}catch(e){i()}}}function l(){void 0!==u&&(clearTimeout(u),u=void 0),k.remove(c.blur,{type:a.blur,callback:l}),k.add(c.focus,{type:a.focus,callback:f})}function f(){d(!0)}function p(){(function(){var e=S().document;return"hidden"===e.visibilityState||"hidden"===e.webkitVisibilityState||"hidden"===e.mozVisibilityState||"hidden"===e.msVisibilityState||(void 0!==e.hidden?e.hidden:void 0!==e.webkitHidden?e.webkitHidden:void 0!==e.mozHidden?e.mozHidden:void 0!==e.msHidden?e.msHidden:"function"!=typeof e.hasFocus||!e.hasFocus())})()&&d(!0)}u=window.setTimeout((function(){d(!1)}),n),k.add(c.blur,{type:a.blur,callback:l}),k.add(c.visibilitychange,{type:a.visibilitychange,callback:p}),T(r)||function(){var e=S(),t=e.document;if(O(e),T(t))return!0;if(t.body.tabIndex<0&&(t.body.tabIndex=-1),O(t.body),T(t))return!0;var n=void 0;try{(n=t.createElement("input")).type="text",n.readOnly=!0,n.tabIndex=-1,n.setAttribute("aria-hidden","true"),n.style.position="fixed",n.style.width=n.style.height="1px",n.style.top=n.style.left="0",n.style.opacity="0",n.style.zIndex="-1",t.body.appendChild(n),O(n);try{n.select()}catch(e){}if(T(t))return!0}catch(e){}finally{if(void 0!==n){try{n.blur()}catch(e){}try{t.body.removeChild(n)}catch(e){}}}T(t)}();try{!function(e,t){var n=S(),i=void 0;try{if(0===t)return void(n.location.href=e);(i=n.document.createElement("a")).href=e,i.setAttribute("aria-hidden","true"),i.style.display="none",n.document.body.appendChild(i);var o=void 0;try{o=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:n})}catch(e){(o=n.document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,n,0,0,0,0,0,!1,!1,!1,!1,0,null)}i.dispatchEvent(o)}catch(e){}finally{if(void 0!==i)try{n.document.body.removeChild(i)}catch(e){}}}(e,t),E(e)}catch(e){d(!1)}}))}var W,L=function(e,t){function n(i){if(!(this instanceof n))return new n(i);var o=new t(i||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(o,n.prototype):o.__proto__=n.prototype,o.name=e,void 0!==i&&(o.message=i),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(o,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(o,n);else if(t.captureStackTrace&&"function"==typeof t.captureStackTrace)t.captureStackTrace(o,n);else try{var r=new t;r.stack&&(o.stack=r.stack)}catch(e){}return o}void 0===t&&(t=Error),n.prototype=Object.create(t.prototype,{constructor:{value:n,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(n.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0})}catch(t){try{n.prototype.name=e}catch(e){}}try{Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}return n}("URLOpenError"),A={open:function(t){var n,o=s,r=[],c=[];function u(){for(var e="",t=0;t<r.length;t++)e+="\n"+(t+1)+": "+c[t];return e.length>0&&(e="\n"+e+"\n"),new L("Failed to open any of the provided URLs: "+e)}if(o===i.Android){if(void 0===(g=t[i.Android]))return Promise.reject(u());n=g.timeout;var l=D(g.scheme),f=D(g.intent),p=g.packageName,v=D(g.fallback),h=g.allowWebStore;if(void 0!==f&&(void 0===l||void 0===p||void 0===v)){var b=function(e){for(var t={},n=e.split("#Intent;"),i=n[0].substring(9),o=n[1],r=o.substring(0,o.length-4).split(";"),a={},c=0;c<r.length;c++){var u=r[c],s=u.indexOf("=");-1!==s&&(a[u.substring(0,s)]=u.substring(s+1))}void 0!==a.scheme&&(t.scheme=a.scheme+"://"+i);void 0!==a.package&&(t.packageName=a.package);void 0!==a["S.browser_fallback_url"]&&(t.fallback=a["S.browser_fallback_url"]);return t}(f);void 0!==b.scheme&&void 0===l&&(l=b.scheme),void 0!==b.packageName&&void 0===p&&(p=b.packageName),void 0!==b.fallback&&void 0===v&&(v=b.fallback)}void 0!==l&&void 0===f&&(f=function(e,t,n){var o=e.split("://"),r=o[0],a=o[1],c="intent://";void 0!==a&&(c+=a);c=c+"#Intent;scheme="+r+";action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;",void 0!==t&&(c=c+"package="+t+";");void 0!==n&&"string"==typeof n?c=c+"S.browser_fallback_url="+n+";":void 0!==t&&(c=c+"S.browser_fallback_url="+x(t,i.Android)+";");return c+"end"}(l,p,v)),void 0!==f&&a&&r.push([f,e.Intent]),void 0!==l&&r.push([l,e.Scheme]),void 0!==v&&r.push([v,e.Fallback]),void 0!==p&&r.push([x(p,i.Android),e.Store]),void 0!==p&&!0===h&&r.push([N(p,i.Android),e.Store])}else if(o===i.iOS){if(void 0===(g=t[i.iOS]))return Promise.reject(u());n=g.timeout;l=D(g.scheme),p=g.bundleId;var m=g.trackId,y=D(g.universal);v=D(g.fallback),h=g.allowWebStore;void 0!==p&&void 0===m&&(m=_(p)),void 0!==y&&parseInt(d)>=9&&r.push([y,e.Universal]),void 0!==l&&r.push([l,e.Scheme]),void 0!==v&&r.push([v,e.Fallback]),void 0!==m&&r.push([x(m,i.iOS),e.Store]),void 0!==m&&!0===h&&r.push([N(m,i.iOS),e.Store])}else if(o===i.Windows){if(void 0===(g=t[i.Windows]))return Promise.reject(u());n=g.timeout;l=D(g.scheme);var w=g.productId;v=D(g.fallback),h=g.allowWebStore;void 0!==l&&r.push([l,e.Scheme]),void 0!==v&&r.push([v,e.Fallback]),void 0!==w&&r.push([x(w,i.Windows),e.Store]),void 0!==w&&!0===h&&r.push([N(w,i.Windows),e.Store])}else if(o===i.MacOS){var g;if(void 0===(g=t[i.MacOS]))return Promise.reject(u());n=g.timeout;l=D(g.scheme),p=g.bundleId,m=g.trackId,v=D(g.fallback),h=g.allowWebStore;void 0!==p&&void 0===m&&(m=_(p)),void 0!==l&&r.push([l,e.Scheme]),void 0!==v&&r.push([v,e.Fallback]),void 0!==m&&r.push([x(m,i.MacOS),e.Store]),void 0!==m&&!0===h&&r.push([N(m,i.MacOS),e.Store])}void 0===n&&(n=P(o));return new Promise((function(e,t){return function i(o){if(void 0===o&&(o=0),o>=r.length)return t(u());var a=r[o],s=a[0];if("string"==typeof s)return c[o]=s,M(s,o,n).then((function(){e(a[1])})).catch((function(){i(o+1)}));c[o]="[function fallback]",s(),e(a[1])}()}))},messenger:(W={},W[t.Telephone]=function(e){return j(e,"tel")},W[t.Message]=function(e){return j(e,"sms")},W[t.Mail]=function(e){return j(e,"mailto")},W)};function _(e){try{var t=new XMLHttpRequest;if(t.open("GET","https://itunes.apple.com/lookup?bundleId="+e,!1),t.send(),200===t.status)try{var n=JSON.parse(t.response);if(void 0===n.results)return;var i=n.results;if(!Array.isArray(i)||0===i.length)return;var o=i[0];if(void 0===o)return;return o.trackId}catch(e){return}return}catch(e){return}}function x(e,t){switch(t){case i.Android:return"market://details?id="+e;case i.iOS:return"itms-apps://itunes.apple.com/app/id"+e+"?mt=8";case i.Windows:return"ms-windows-store://pdp/?ProductId="+e;case i.MacOS:return"macappstore://itunes.apple.com/app/id"+e+"?mt=12";default:throw new L('Unsupported OS: "'+n+'"')}}function N(e,t){switch(t){case i.Android:return"https://play.google.com/store/apps/details?id="+e;case i.iOS:return"https://itunes.apple.com/app/id"+e+"?mt=8";case i.Windows:return"https://apps.microsoft.com/detail/"+e;case i.MacOS:return"https://apps.apple.com/app/id"+e+"?mt=12";default:throw new L('Unsupported OS: "'+n+'"')}}function P(e){switch(e){case i.iOS:return 2e3;case i.Android:return 1e3;default:return 750}}function I(e,t,n){void 0===n&&(n=",");for(var i=e.length,o="",r=0;r<i;r++)o+=t(e[r]),r!==i-1&&(o+=n);return o}function U(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)}))}function D(e){return e instanceof URL?e.toString():e}function F(e){if("string"==typeof e)return U(e);if("number"==typeof e||"boolean"==typeof e)return U(String(e));if(null==e)return"";if(function(e){if(null==e||"string"==typeof e)return!1;var t=e.length;return"number"==typeof t&&t>=0&&!(t%1)}(e))return I(e,(function(e){return F(e)}));if(e instanceof HTMLInputElement){var t=e.type;if("checkbox"===t)return U(e.checked.toString());if("radio"===t)return e.checked?U(e.value):"";if("file"===t){var n=e.files;return null===n?"":I(n,(function(e){return U(e.name)}))}return U(e.value)}return e instanceof HTMLSelectElement?e.multiple?I(e.selectedOptions,(function(e){return U(e.value)})):U(e.value):e instanceof HTMLTextAreaElement?U(e.value):e instanceof HTMLElement?U(e.innerText):e instanceof Node?F(e.textContent):U(e.toString())}function H(e){if(e instanceof HTMLFormElement)return H(new FormData(e));if(e instanceof FormData){var t={};return e.forEach((function(e,n){var i;if(i=e instanceof File?e.name:e,Object.prototype.hasOwnProperty.call(t,n)){var o=t[n];Array.isArray(o)?o.push(i):t[n]=[o,i]}else t[n]=i})),H(t)}for(var n={},i=Object.keys(e),o=0;o<i.length;o++){var r=i[o];n[r]=F(e[r])}return void 0===n.to&&(n.to=""),void 0===n.cc&&(n.cc=""),void 0===n.bcc&&(n.bcc=""),void 0===n.subject&&(n.subject=""),void 0===n.body&&(n.body=""),n}function j(e,t){return M(t+":"+(e=H(e)).to+"?cc="+e.cc+"&bcc="+e.bcc+"&subject="+e.subject+"&body="+e.body,0,P(s))}var R={installed:!1,name:"App",module:A,constants:{AppOpenState:e,Messengers:t},errors:{URLOpenError:L}};export{R as default};