native-fn 1.0.31 → 1.0.32

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 (109) hide show
  1. package/dist/index.d.ts +11 -11
  2. package/dist/native.cjs +5 -5
  3. package/dist/native.min.cjs +1 -1
  4. package/dist/native.min.mjs +1 -1
  5. package/dist/native.mjs +5 -5
  6. package/dist/native.umd.js +5 -5
  7. package/dist/native.umd.min.js +1 -1
  8. package/dist/plugin/app/index.cjs +4 -4
  9. package/dist/plugin/app/index.d.ts +9 -7
  10. package/dist/plugin/app/index.min.cjs +1 -1
  11. package/dist/plugin/app/index.min.mjs +1 -1
  12. package/dist/plugin/app/index.mjs +4 -4
  13. package/dist/plugin/app/index.umd.js +4 -4
  14. package/dist/plugin/app/index.umd.min.js +1 -1
  15. package/dist/plugin/app/src/plugin/app/cores/app.d.ts +2 -2
  16. package/dist/plugin/app/src/plugin/app/index.d.ts +3 -3
  17. package/dist/plugin/app/src/plugin/app/types/app.d.ts +1 -1
  18. package/dist/plugin/app/src/plugin/app/types/appModule.d.ts +1 -1
  19. package/dist/plugin/app/src/plugin/app/types/index.d.ts +1 -1
  20. package/dist/plugin/app/src/plugin/app/utils/event-listener-utils.d.ts +1 -1
  21. package/dist/plugin/app/src/plugin/platform/cores/platform.d.ts +2 -2
  22. package/dist/plugin/app/src/plugin/platform/index.d.ts +3 -3
  23. package/dist/plugin/app/src/plugin/platform/types/index.d.ts +1 -1
  24. package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +1 -1
  25. package/dist/plugin/app/src/plugin/platform/types/platformModule.d.ts +1 -1
  26. package/dist/plugin/app/src/plugin/theme/constants/theme.d.ts +1 -1
  27. package/dist/plugin/app/src/plugin/theme/cores/theme.d.ts +2 -2
  28. package/dist/plugin/app/src/plugin/theme/index.d.ts +3 -3
  29. package/dist/plugin/app/src/plugin/theme/types/index.d.ts +1 -1
  30. package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +8 -9
  31. package/dist/plugin/app/src/plugin/theme/types/themeModule.d.ts +1 -1
  32. package/dist/plugin/app/src/plugin/theme/utils/parse-color.d.ts +1 -1
  33. package/dist/plugin/app/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
  34. package/dist/plugin/app/src/types/native.d.ts +8 -8
  35. package/dist/plugin/platform/index.cjs +4 -4
  36. package/dist/plugin/platform/index.d.ts +9 -7
  37. package/dist/plugin/platform/index.min.cjs +1 -1
  38. package/dist/plugin/platform/index.min.mjs +1 -1
  39. package/dist/plugin/platform/index.mjs +4 -4
  40. package/dist/plugin/platform/index.umd.js +4 -4
  41. package/dist/plugin/platform/index.umd.min.js +1 -1
  42. package/dist/plugin/platform/src/plugin/app/cores/app.d.ts +2 -2
  43. package/dist/plugin/platform/src/plugin/app/index.d.ts +3 -3
  44. package/dist/plugin/platform/src/plugin/app/types/app.d.ts +1 -1
  45. package/dist/plugin/platform/src/plugin/app/types/appModule.d.ts +1 -1
  46. package/dist/plugin/platform/src/plugin/app/types/index.d.ts +1 -1
  47. package/dist/plugin/platform/src/plugin/app/utils/event-listener-utils.d.ts +1 -1
  48. package/dist/plugin/platform/src/plugin/platform/cores/platform.d.ts +2 -2
  49. package/dist/plugin/platform/src/plugin/platform/index.d.ts +3 -3
  50. package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +1 -1
  51. package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +1 -1
  52. package/dist/plugin/platform/src/plugin/platform/types/platformModule.d.ts +1 -1
  53. package/dist/plugin/platform/src/plugin/theme/constants/theme.d.ts +1 -1
  54. package/dist/plugin/platform/src/plugin/theme/cores/theme.d.ts +2 -2
  55. package/dist/plugin/platform/src/plugin/theme/index.d.ts +3 -3
  56. package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +1 -1
  57. package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +8 -9
  58. package/dist/plugin/platform/src/plugin/theme/types/themeModule.d.ts +1 -1
  59. package/dist/plugin/platform/src/plugin/theme/utils/parse-color.d.ts +1 -1
  60. package/dist/plugin/platform/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
  61. package/dist/plugin/platform/src/types/native.d.ts +8 -8
  62. package/dist/plugin/theme/index.cjs +4 -4
  63. package/dist/plugin/theme/index.d.ts +9 -7
  64. package/dist/plugin/theme/index.min.cjs +1 -1
  65. package/dist/plugin/theme/index.min.mjs +1 -1
  66. package/dist/plugin/theme/index.mjs +4 -4
  67. package/dist/plugin/theme/index.umd.js +4 -4
  68. package/dist/plugin/theme/index.umd.min.js +1 -1
  69. package/dist/plugin/theme/src/plugin/app/cores/app.d.ts +2 -2
  70. package/dist/plugin/theme/src/plugin/app/index.d.ts +3 -3
  71. package/dist/plugin/theme/src/plugin/app/types/app.d.ts +1 -1
  72. package/dist/plugin/theme/src/plugin/app/types/appModule.d.ts +1 -1
  73. package/dist/plugin/theme/src/plugin/app/types/index.d.ts +1 -1
  74. package/dist/plugin/theme/src/plugin/app/utils/event-listener-utils.d.ts +1 -1
  75. package/dist/plugin/theme/src/plugin/platform/cores/platform.d.ts +2 -2
  76. package/dist/plugin/theme/src/plugin/platform/index.d.ts +3 -3
  77. package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +1 -1
  78. package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +1 -1
  79. package/dist/plugin/theme/src/plugin/platform/types/platformModule.d.ts +1 -1
  80. package/dist/plugin/theme/src/plugin/theme/constants/theme.d.ts +1 -1
  81. package/dist/plugin/theme/src/plugin/theme/cores/theme.d.ts +2 -2
  82. package/dist/plugin/theme/src/plugin/theme/index.d.ts +3 -3
  83. package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +1 -1
  84. package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +8 -9
  85. package/dist/plugin/theme/src/plugin/theme/types/themeModule.d.ts +1 -1
  86. package/dist/plugin/theme/src/plugin/theme/utils/parse-color.d.ts +1 -1
  87. package/dist/plugin/theme/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
  88. package/dist/plugin/theme/src/types/native.d.ts +8 -8
  89. package/dist/src/plugin/app/cores/app.d.ts +2 -2
  90. package/dist/src/plugin/app/index.d.ts +3 -3
  91. package/dist/src/plugin/app/types/app.d.ts +1 -1
  92. package/dist/src/plugin/app/types/appModule.d.ts +1 -1
  93. package/dist/src/plugin/app/types/index.d.ts +1 -1
  94. package/dist/src/plugin/app/utils/event-listener-utils.d.ts +1 -1
  95. package/dist/src/plugin/platform/cores/platform.d.ts +2 -2
  96. package/dist/src/plugin/platform/index.d.ts +3 -3
  97. package/dist/src/plugin/platform/types/index.d.ts +1 -1
  98. package/dist/src/plugin/platform/types/platform.d.ts +1 -1
  99. package/dist/src/plugin/platform/types/platformModule.d.ts +1 -1
  100. package/dist/src/plugin/theme/constants/theme.d.ts +1 -1
  101. package/dist/src/plugin/theme/cores/theme.d.ts +2 -2
  102. package/dist/src/plugin/theme/index.d.ts +3 -3
  103. package/dist/src/plugin/theme/types/index.d.ts +1 -1
  104. package/dist/src/plugin/theme/types/theme.d.ts +8 -9
  105. package/dist/src/plugin/theme/types/themeModule.d.ts +1 -1
  106. package/dist/src/plugin/theme/utils/parse-color.d.ts +1 -1
  107. package/dist/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
  108. package/dist/src/types/native.d.ts +8 -8
  109. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
- import type { ThemeModule } from '../types/themeModule';
2
- declare const Theme: ThemeModule;
1
+ import type { ThemeInstance } from '../types';
2
+ declare const Theme: ThemeInstance;
3
3
  export default Theme;
@@ -1,5 +1,5 @@
1
1
  import type { NativePlugin } from '../../types';
2
- import type { ThemeModule } from "./types";
2
+ import type { ThemeInstance } from "./types";
3
3
  export * from './types';
4
- declare const ThemePlugin: NativePlugin<ThemeModule>;
5
- export default ThemePlugin;
4
+ declare const NativeThemePlugin: NativePlugin<ThemeInstance>;
5
+ export default NativeThemePlugin;
@@ -1,3 +1,3 @@
1
1
  export * from './color';
2
2
  export * from './easing-syntax';
3
- export * from './themeModule';
3
+ export * from './theme';
@@ -1,19 +1,11 @@
1
1
  import { Appearances } from '../constants/theme';
2
- import type { EasingKeyword, EasingSyntax } from '../types/easing-syntax';
3
- import type { Color } from '../types/color';
2
+ import type { EasingKeyword, EasingSyntax, Color } from '../types';
4
3
  export declare interface ListenerEntry {
5
4
  fn: (appearance: Appearances) => any;
6
5
  capture: boolean;
7
6
  once: boolean;
8
7
  signal?: AbortSignal;
9
8
  }
10
- export declare interface Theme {
11
- setThemeColor: (color: Color, options?: SetThemeColorOptions) => Promise<string | undefined>;
12
- getThemeColor: () => Color | undefined;
13
- removeThemeColor: (appearance?: ThemeColorMetaAppearanceKeys) => void;
14
- detectAppearance: () => Promise<Appearances>;
15
- onAppearanceChange: (listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions) => () => void;
16
- }
17
9
  export declare type ThemeColorMetaAppearanceKeys = 'default' | 'dark' | 'light';
18
10
  export declare type ThemeColorMetaGroup = Partial<Record<ThemeColorMetaAppearanceKeys, HTMLMetaElement>>;
19
11
  export declare interface SetThemeColorOptions {
@@ -22,3 +14,10 @@ export declare interface SetThemeColorOptions {
22
14
  easingFunction?: EasingSyntax | EasingKeyword;
23
15
  defaultColor?: string;
24
16
  }
17
+ export declare interface ThemeInstance {
18
+ setThemeColor: (color: Color, options?: SetThemeColorOptions) => Promise<string | undefined>;
19
+ getThemeColor: () => Color | undefined;
20
+ removeThemeColor: (appearance?: ThemeColorMetaAppearanceKeys) => void;
21
+ detectAppearance: () => Promise<Appearances>;
22
+ onAppearanceChange: (listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions) => () => void;
23
+ }
@@ -15,7 +15,7 @@ export declare interface SetThemeColorOptions {
15
15
  easingFunction?: EasingSyntax | EasingKeyword;
16
16
  defaultColor?: string;
17
17
  }
18
- export declare interface ThemeModule {
18
+ export declare interface ThemeInstance {
19
19
  setThemeColor: (color: Color, options?: SetThemeColorOptions) => Promise<string | undefined>;
20
20
  getThemeColor: () => Color | undefined;
21
21
  removeThemeColor: (appearance?: ThemeColorMetaAppearanceKeys) => void;
@@ -1,2 +1,2 @@
1
- import type { RGBA } from '../types/color';
1
+ import type { RGBA } from '../types';
2
2
  export default function parseColor(color: string): RGBA;
@@ -1,2 +1,2 @@
1
- import type { EasingFunction, EasingKeyword, EasingSyntax } from '../types/easing-syntax';
1
+ import type { EasingFunction, EasingKeyword, EasingSyntax } from '../types';
2
2
  export default function parseEasingFunction(easingFunction: EasingSyntax | EasingKeyword): EasingFunction;
@@ -1,14 +1,14 @@
1
- export declare interface NativePlugin<T> {
1
+ export declare interface ModuleBase {
2
+ Constants: Record<string, any>;
3
+ Errors: Record<string, ErrorConstructor>;
4
+ }
5
+ export declare interface NativePlugin<T> extends ModuleBase {
2
6
  installed: boolean;
3
7
  name: string;
4
8
  module: T;
5
- constants: Record<string, any>;
6
- errors: Record<string, ErrorConstructor>;
7
9
  }
8
- export declare interface NativeBase {
10
+ export declare interface NativeBase extends ModuleBase {
9
11
  Version: string;
10
- Constants: Record<string, any>;
11
- Errors: Record<string, ErrorConstructor>;
12
- extends: <T>(plugin: NativePlugin<T>) => Native;
12
+ extends: <T>(plugin: NativePlugin<T>) => NativeInstance;
13
13
  }
14
- export declare type Native = NativeBase & Record<Exclude<string, keyof NativeBase>, any>;
14
+ export declare type NativeInstance = NativeBase & Record<Exclude<string, keyof NativeBase>, any>;
@@ -160,12 +160,12 @@ var Platform = {
160
160
  isStandalone: IS_STANDALONE,
161
161
  };
162
162
 
163
- var PlatformPlugin = {
163
+ var NativePlatformPlugin = {
164
164
  installed: false,
165
165
  name: 'Platform',
166
166
  module: Platform,
167
- constants: {},
168
- errors: {}
167
+ Constants: {},
168
+ Errors: {}
169
169
  };
170
170
 
171
- module.exports = PlatformPlugin;
171
+ module.exports = NativePlatformPlugin;
@@ -1,9 +1,11 @@
1
- declare interface NativePlugin<T> {
1
+ declare interface ModuleBase {
2
+ Constants: Record<string, any>;
3
+ Errors: Record<string, ErrorConstructor>;
4
+ }
5
+ declare interface NativePlugin<T> extends ModuleBase {
2
6
  installed: boolean;
3
7
  name: string;
4
8
  module: T;
5
- constants: Record<string, any>;
6
- errors: Record<string, ErrorConstructor>;
7
9
  }
8
10
 
9
11
  declare enum OS {
@@ -32,7 +34,7 @@ declare enum Engines {
32
34
  Gecko = "Gecko"
33
35
  }
34
36
 
35
- declare interface PlatformModule {
37
+ declare interface PlatformInstance {
36
38
  os: OS;
37
39
  device: Devices;
38
40
  engine: Engines;
@@ -45,7 +47,7 @@ declare interface PlatformModule {
45
47
  isDesktop: boolean;
46
48
  }
47
49
 
48
- declare const PlatformPlugin: NativePlugin<PlatformModule>;
50
+ declare const NativePlatformPlugin: NativePlugin<PlatformInstance>;
49
51
 
50
- export { PlatformPlugin as default };
51
- export type { PlatformModule };
52
+ export { NativePlatformPlugin as default };
53
+ export type { PlatformInstance };
@@ -1 +1 @@
1
- "use strict";var e,n,i,o=navigator.userAgent;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),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"}(i||(i={}));for(var t=function(){function i(e){return void 0===e?"":e.replace(/_/g,".")}function o(e){if(void 0===e)return"";var n={"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!==n?n:e}function t(e){return void 0===e?"":e}return[[/android\w*[-\/.; ]?([\d.]*)/i,e.Android,n.Mobile,t],[/microsoft windows (vista|xp)/i,e.Windows,n.Desktop,t],[/windows (?:phone(?: os)?|mobile|iot)[\/ ]?([.\w ]*)/i,e.Windows,n.Desktop,o],[/windows nt 6\.2; (arm)/i,e.Windows,n.Desktop,o],[/windows[\/ ]([ntce\d. ]+\w)(?!.+xbox)/i,e.Windows,n.Desktop,o],[/(?:win(?=[39n])|win 9x )([nt\d.]+)/i,e.Windows,n.Desktop,o],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,n.Mobile,i],[/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d.]+)/i,e.iOS,n.Mobile,i],[/cfnetwork\/.+darwin/i,e.iOS,n.Mobile,t],[/mac os x ?([\w. ]*)/i,e.MacOS,n.Desktop,i],[/(?:macintosh|mac_powerpc\b)(?!.+haiku)/i,e.MacOS,n.Desktop,i]]}(),r=[[/windows.+ edge\/([\w.]+)/i,i.EdgeHTML],[/arkweb\/([\w.]+)/i,i.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,i.Blink],[/presto\/([\w.]+)/i,i.Presto],[/webkit\/([\w.]+)/i,i.WebKit],[/trident\/([\w.]+)/i,i.Trident],[/netfront\/([\w.]+)/i,i.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,i.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,i.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,i.Gecko]],a=e.Unknown,s="",w=n.Unknown,d=i.Unknown,l="",k=0;k<t.length;k++){var c=(f=t[k])[0],b=f[1],m=f[2],u=f[3];if(null!==(g=o.match(c))){a=b,s=u(g[1]),w=m;break}}for(k=0;k<r.length;k++){c=(f=r[k])[0];var f,g,p=f[1];if(null!==(g=o.match(c))){d=p,l=g[1];break}}var T=function(){var e=document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var i=n.getExtension("WEBGL_debug_renderer_info");return null===i?n.getParameter(n.RENDERER):n.getParameter(i.UNMASKED_RENDERER_WEBGL)}return""}(),v=w===n.Mobile,M=w===n.Desktop,N=a===e.iOS?"standalone"in navigator&&navigator.standalone:window.matchMedia("(display-mode: standalone)").matches,W=/; ?wv|applewebkit(?!.*safari)/i.test(o),E={installed:!1,name:"Platform",module:{os:a,device:w,engine:d,osVersion:s,engineVersion:l,renderer:T,isWebview:W,isMobile:v,isDesktop:M,isStandalone:N},constants:{},errors:{}};module.exports=E;
1
+ "use strict";var e,n,i,o=navigator.userAgent;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),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"}(i||(i={}));for(var t=function(){function i(e){return void 0===e?"":e.replace(/_/g,".")}function o(e){if(void 0===e)return"";var n={"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!==n?n:e}function t(e){return void 0===e?"":e}return[[/android\w*[-\/.; ]?([\d.]*)/i,e.Android,n.Mobile,t],[/microsoft windows (vista|xp)/i,e.Windows,n.Desktop,t],[/windows (?:phone(?: os)?|mobile|iot)[\/ ]?([.\w ]*)/i,e.Windows,n.Desktop,o],[/windows nt 6\.2; (arm)/i,e.Windows,n.Desktop,o],[/windows[\/ ]([ntce\d. ]+\w)(?!.+xbox)/i,e.Windows,n.Desktop,o],[/(?:win(?=[39n])|win 9x )([nt\d.]+)/i,e.Windows,n.Desktop,o],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,n.Mobile,i],[/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d.]+)/i,e.iOS,n.Mobile,i],[/cfnetwork\/.+darwin/i,e.iOS,n.Mobile,t],[/mac os x ?([\w. ]*)/i,e.MacOS,n.Desktop,i],[/(?:macintosh|mac_powerpc\b)(?!.+haiku)/i,e.MacOS,n.Desktop,i]]}(),r=[[/windows.+ edge\/([\w.]+)/i,i.EdgeHTML],[/arkweb\/([\w.]+)/i,i.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,i.Blink],[/presto\/([\w.]+)/i,i.Presto],[/webkit\/([\w.]+)/i,i.WebKit],[/trident\/([\w.]+)/i,i.Trident],[/netfront\/([\w.]+)/i,i.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,i.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,i.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,i.Gecko]],a=e.Unknown,s="",w=n.Unknown,d=i.Unknown,l="",k=0;k<t.length;k++){var c=(f=t[k])[0],b=f[1],m=f[2],u=f[3];if(null!==(g=o.match(c))){a=b,s=u(g[1]),w=m;break}}for(k=0;k<r.length;k++){c=(f=r[k])[0];var f,g,p=f[1];if(null!==(g=o.match(c))){d=p,l=g[1];break}}var T=function(){var e=document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var i=n.getExtension("WEBGL_debug_renderer_info");return null===i?n.getParameter(n.RENDERER):n.getParameter(i.UNMASKED_RENDERER_WEBGL)}return""}(),v=w===n.Mobile,M=w===n.Desktop,N=a===e.iOS?"standalone"in navigator&&navigator.standalone:window.matchMedia("(display-mode: standalone)").matches,W=/; ?wv|applewebkit(?!.*safari)/i.test(o),E={installed:!1,name:"Platform",module:{os:a,device:w,engine:d,osVersion:s,engineVersion:l,renderer:T,isWebview:W,isMobile:v,isDesktop:M,isStandalone:N},Constants:{},Errors:{}};module.exports=E;
@@ -1 +1 @@
1
- var e,n,i,o=navigator.userAgent;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),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"}(i||(i={}));for(var t=function(){function i(e){return void 0===e?"":e.replace(/_/g,".")}function o(e){if(void 0===e)return"";var n={"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!==n?n:e}function t(e){return void 0===e?"":e}return[[/android\w*[-\/.; ]?([\d.]*)/i,e.Android,n.Mobile,t],[/microsoft windows (vista|xp)/i,e.Windows,n.Desktop,t],[/windows (?:phone(?: os)?|mobile|iot)[\/ ]?([.\w ]*)/i,e.Windows,n.Desktop,o],[/windows nt 6\.2; (arm)/i,e.Windows,n.Desktop,o],[/windows[\/ ]([ntce\d. ]+\w)(?!.+xbox)/i,e.Windows,n.Desktop,o],[/(?:win(?=[39n])|win 9x )([nt\d.]+)/i,e.Windows,n.Desktop,o],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,n.Mobile,i],[/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d.]+)/i,e.iOS,n.Mobile,i],[/cfnetwork\/.+darwin/i,e.iOS,n.Mobile,t],[/mac os x ?([\w. ]*)/i,e.MacOS,n.Desktop,i],[/(?:macintosh|mac_powerpc\b)(?!.+haiku)/i,e.MacOS,n.Desktop,i]]}(),r=[[/windows.+ edge\/([\w.]+)/i,i.EdgeHTML],[/arkweb\/([\w.]+)/i,i.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,i.Blink],[/presto\/([\w.]+)/i,i.Presto],[/webkit\/([\w.]+)/i,i.WebKit],[/trident\/([\w.]+)/i,i.Trident],[/netfront\/([\w.]+)/i,i.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,i.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,i.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,i.Gecko]],a=e.Unknown,s="",w=n.Unknown,d=i.Unknown,l="",k=0;k<t.length;k++){var c=(u=t[k])[0],b=u[1],f=u[2],m=u[3];if(null!==(g=o.match(c))){a=b,s=m(g[1]),w=f;break}}for(k=0;k<r.length;k++){c=(u=r[k])[0];var u,g,p=u[1];if(null!==(g=o.match(c))){d=p,l=g[1];break}}var T=function(){var e=document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var i=n.getExtension("WEBGL_debug_renderer_info");return null===i?n.getParameter(n.RENDERER):n.getParameter(i.UNMASKED_RENDERER_WEBGL)}return""}(),v=w===n.Mobile,M=w===n.Desktop,N=a===e.iOS?"standalone"in navigator&&navigator.standalone:window.matchMedia("(display-mode: standalone)").matches,W=/; ?wv|applewebkit(?!.*safari)/i.test(o),E={installed:!1,name:"Platform",module:{os:a,device:w,engine:d,osVersion:s,engineVersion:l,renderer:T,isWebview:W,isMobile:v,isDesktop:M,isStandalone:N},constants:{},errors:{}};export{E as default};
1
+ var n,e,i,o=navigator.userAgent;!function(n){n.Unknown="Unknown",n.Android="Android",n.iOS="iOS",n.Windows="Windows",n.MacOS="MacOS"}(n||(n={})),function(n){n.Unknown="Unknown",n.Mobile="Mobile",n.Desktop="Desktop"}(e||(e={})),function(n){n.Unknown="Unknown",n.EdgeHTML="EdgeHTML",n.ArkWeb="ArkWeb",n.Blink="Blink",n.Presto="Presto",n.WebKit="WebKit",n.Trident="Trident",n.NetFront="NetFront",n.KHTML="KHTML",n.Tasman="Tasman",n.Gecko="Gecko"}(i||(i={}));for(var t=function(){function i(n){return void 0===n?"":n.replace(/_/g,".")}function o(n){if(void 0===n)return"";var e={"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"}[n];return void 0!==e?e:n}function t(n){return void 0===n?"":n}return[[/android\w*[-\/.; ]?([\d.]*)/i,n.Android,e.Mobile,t],[/microsoft windows (vista|xp)/i,n.Windows,e.Desktop,t],[/windows (?:phone(?: os)?|mobile|iot)[\/ ]?([.\w ]*)/i,n.Windows,e.Desktop,o],[/windows nt 6\.2; (arm)/i,n.Windows,e.Desktop,o],[/windows[\/ ]([ntce\d. ]+\w)(?!.+xbox)/i,n.Windows,e.Desktop,o],[/(?:win(?=[39n])|win 9x )([nt\d.]+)/i,n.Windows,e.Desktop,o],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,n.iOS,e.Mobile,i],[/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d.]+)/i,n.iOS,e.Mobile,i],[/cfnetwork\/.+darwin/i,n.iOS,e.Mobile,t],[/mac os x ?([\w. ]*)/i,n.MacOS,e.Desktop,i],[/(?:macintosh|mac_powerpc\b)(?!.+haiku)/i,n.MacOS,e.Desktop,i]]}(),r=[[/windows.+ edge\/([\w.]+)/i,i.EdgeHTML],[/arkweb\/([\w.]+)/i,i.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,i.Blink],[/presto\/([\w.]+)/i,i.Presto],[/webkit\/([\w.]+)/i,i.WebKit],[/trident\/([\w.]+)/i,i.Trident],[/netfront\/([\w.]+)/i,i.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,i.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,i.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,i.Gecko]],a=n.Unknown,s="",w=e.Unknown,d=i.Unknown,l="",k=0;k<t.length;k++){var c=(u=t[k])[0],b=u[1],f=u[2],m=u[3];if(null!==(g=o.match(c))){a=b,s=m(g[1]),w=f;break}}for(k=0;k<r.length;k++){c=(u=r[k])[0];var u,g,p=u[1];if(null!==(g=o.match(c))){d=p,l=g[1];break}}var T=function(){var n=document.createElement("canvas");if("function"!=typeof n.getContext)return"";var e=n.getContext("webgl2")||n.getContext("experimental-webgl")||n.getContext("webgl");if(null===e)return"";if(e instanceof WebGLRenderingContext||"getParameter"in e&&"function"==typeof e.getParameter){var i=e.getExtension("WEBGL_debug_renderer_info");return null===i?e.getParameter(e.RENDERER):e.getParameter(i.UNMASKED_RENDERER_WEBGL)}return""}(),v=w===e.Mobile,M=w===e.Desktop,N=a===n.iOS?"standalone"in navigator&&navigator.standalone:window.matchMedia("(display-mode: standalone)").matches,W=/; ?wv|applewebkit(?!.*safari)/i.test(o),E={installed:!1,name:"Platform",module:{os:a,device:w,engine:d,osVersion:s,engineVersion:l,renderer:T,isWebview:W,isMobile:v,isDesktop:M,isStandalone:N},Constants:{},Errors:{}};export{E as default};
@@ -158,12 +158,12 @@ var Platform = {
158
158
  isStandalone: IS_STANDALONE,
159
159
  };
160
160
 
161
- var PlatformPlugin = {
161
+ var NativePlatformPlugin = {
162
162
  installed: false,
163
163
  name: 'Platform',
164
164
  module: Platform,
165
- constants: {},
166
- errors: {}
165
+ Constants: {},
166
+ Errors: {}
167
167
  };
168
168
 
169
- export { PlatformPlugin as default };
169
+ export { NativePlatformPlugin as default };
@@ -164,14 +164,14 @@
164
164
  isStandalone: IS_STANDALONE,
165
165
  };
166
166
 
167
- var PlatformPlugin = {
167
+ var NativePlatformPlugin = {
168
168
  installed: false,
169
169
  name: 'Platform',
170
170
  module: Platform,
171
- constants: {},
172
- errors: {}
171
+ Constants: {},
172
+ Errors: {}
173
173
  };
174
174
 
175
- return PlatformPlugin;
175
+ return NativePlatformPlugin;
176
176
 
177
177
  }));
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Platform=n()}(this,(function(){"use strict";var e,n,i,o=navigator.userAgent;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),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"}(i||(i={}));for(var t=function(){function i(e){return void 0===e?"":e.replace(/_/g,".")}function o(e){if(void 0===e)return"";var n={"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!==n?n:e}function t(e){return void 0===e?"":e}return[[/android\w*[-\/.; ]?([\d.]*)/i,e.Android,n.Mobile,t],[/microsoft windows (vista|xp)/i,e.Windows,n.Desktop,t],[/windows (?:phone(?: os)?|mobile|iot)[\/ ]?([.\w ]*)/i,e.Windows,n.Desktop,o],[/windows nt 6\.2; (arm)/i,e.Windows,n.Desktop,o],[/windows[\/ ]([ntce\d. ]+\w)(?!.+xbox)/i,e.Windows,n.Desktop,o],[/(?:win(?=[39n])|win 9x )([nt\d.]+)/i,e.Windows,n.Desktop,o],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,n.Mobile,i],[/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d.]+)/i,e.iOS,n.Mobile,i],[/cfnetwork\/.+darwin/i,e.iOS,n.Mobile,t],[/mac os x ?([\w. ]*)/i,e.MacOS,n.Desktop,i],[/(?:macintosh|mac_powerpc\b)(?!.+haiku)/i,e.MacOS,n.Desktop,i]]}(),r=[[/windows.+ edge\/([\w.]+)/i,i.EdgeHTML],[/arkweb\/([\w.]+)/i,i.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,i.Blink],[/presto\/([\w.]+)/i,i.Presto],[/webkit\/([\w.]+)/i,i.WebKit],[/trident\/([\w.]+)/i,i.Trident],[/netfront\/([\w.]+)/i,i.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,i.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,i.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,i.Gecko]],a=e.Unknown,s="",d=n.Unknown,w=i.Unknown,l="",c=0;c<t.length;c++){var f=(m=t[c])[0],k=m[1],u=m[2],b=m[3];if(null!==(p=o.match(f))){a=k,s=b(p[1]),d=u;break}}for(c=0;c<r.length;c++){f=(m=r[c])[0];var m,p,g=m[1];if(null!==(p=o.match(f))){w=g,l=p[1];break}}var T=function(){var e=document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var i=n.getExtension("WEBGL_debug_renderer_info");return null===i?n.getParameter(n.RENDERER):n.getParameter(i.UNMASKED_RENDERER_WEBGL)}return""}(),v=d===n.Mobile,M=d===n.Desktop,N=a===e.iOS?"standalone"in navigator&&navigator.standalone:window.matchMedia("(display-mode: standalone)").matches,W=/; ?wv|applewebkit(?!.*safari)/i.test(o);return{installed:!1,name:"Platform",module:{os:a,device:d,engine:w,osVersion:s,engineVersion:l,renderer:T,isWebview:W,isMobile:v,isDesktop:M,isStandalone:N},constants:{},errors:{}}}));
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Platform=n()}(this,(function(){"use strict";var e,n,i,o=navigator.userAgent;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),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"}(i||(i={}));for(var t=function(){function i(e){return void 0===e?"":e.replace(/_/g,".")}function o(e){if(void 0===e)return"";var n={"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!==n?n:e}function t(e){return void 0===e?"":e}return[[/android\w*[-\/.; ]?([\d.]*)/i,e.Android,n.Mobile,t],[/microsoft windows (vista|xp)/i,e.Windows,n.Desktop,t],[/windows (?:phone(?: os)?|mobile|iot)[\/ ]?([.\w ]*)/i,e.Windows,n.Desktop,o],[/windows nt 6\.2; (arm)/i,e.Windows,n.Desktop,o],[/windows[\/ ]([ntce\d. ]+\w)(?!.+xbox)/i,e.Windows,n.Desktop,o],[/(?:win(?=[39n])|win 9x )([nt\d.]+)/i,e.Windows,n.Desktop,o],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,n.Mobile,i],[/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d.]+)/i,e.iOS,n.Mobile,i],[/cfnetwork\/.+darwin/i,e.iOS,n.Mobile,t],[/mac os x ?([\w. ]*)/i,e.MacOS,n.Desktop,i],[/(?:macintosh|mac_powerpc\b)(?!.+haiku)/i,e.MacOS,n.Desktop,i]]}(),r=[[/windows.+ edge\/([\w.]+)/i,i.EdgeHTML],[/arkweb\/([\w.]+)/i,i.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,i.Blink],[/presto\/([\w.]+)/i,i.Presto],[/webkit\/([\w.]+)/i,i.WebKit],[/trident\/([\w.]+)/i,i.Trident],[/netfront\/([\w.]+)/i,i.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,i.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,i.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,i.Gecko]],a=e.Unknown,s="",d=n.Unknown,w=i.Unknown,l="",c=0;c<t.length;c++){var f=(m=t[c])[0],k=m[1],u=m[2],b=m[3];if(null!==(p=o.match(f))){a=k,s=b(p[1]),d=u;break}}for(c=0;c<r.length;c++){f=(m=r[c])[0];var m,p,g=m[1];if(null!==(p=o.match(f))){w=g,l=p[1];break}}var T=function(){var e=document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var i=n.getExtension("WEBGL_debug_renderer_info");return null===i?n.getParameter(n.RENDERER):n.getParameter(i.UNMASKED_RENDERER_WEBGL)}return""}(),v=d===n.Mobile,M=d===n.Desktop,N=a===e.iOS?"standalone"in navigator&&navigator.standalone:window.matchMedia("(display-mode: standalone)").matches,W=/; ?wv|applewebkit(?!.*safari)/i.test(o);return{installed:!1,name:"Platform",module:{os:a,device:d,engine:w,osVersion:s,engineVersion:l,renderer:T,isWebview:W,isMobile:v,isDesktop:M,isStandalone:N},Constants:{},Errors:{}}}));
@@ -1,3 +1,3 @@
1
- import type { AppModule } from '../types/appModule';
2
- declare const App: AppModule;
1
+ import type { AppInstance } from '../types';
2
+ declare const App: AppInstance;
3
3
  export default App;
@@ -1,5 +1,5 @@
1
1
  import type { NativePlugin } from '../../types';
2
- import type { AppModule } from "./types";
2
+ import type { AppInstance } from "./types";
3
3
  export * from './types';
4
- declare const AppPlugin: NativePlugin<AppModule>;
5
- export default AppPlugin;
4
+ declare const NativeAppPlugin: NativePlugin<AppInstance>;
5
+ export default NativeAppPlugin;
@@ -48,7 +48,7 @@ export declare type MessengerOpenOptions = {
48
48
  body?: Stringifiable;
49
49
  } | HTMLFormElement | FormData;
50
50
  export declare type Messenger = Record<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
51
- export declare interface App {
51
+ export declare interface AppInstance {
52
52
  open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
53
53
  messenger: Messenger;
54
54
  }
@@ -48,7 +48,7 @@ export declare type MessengerOpenOptions = {
48
48
  body?: Stringifiable;
49
49
  } | HTMLFormElement | FormData;
50
50
  export declare type Messenger = Record<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
51
- export declare interface AppModule {
51
+ export declare interface AppInstance {
52
52
  open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
53
53
  messenger: Messenger;
54
54
  }
@@ -1 +1 @@
1
- export * from './appModule';
1
+ export * from './app';
@@ -1,3 +1,3 @@
1
- import type { EventListenerUtil } from '../types/appModule';
1
+ import type { EventListenerUtil } from '../types';
2
2
  declare const EventListenerUtils: EventListenerUtil;
3
3
  export default EventListenerUtils;
@@ -1,3 +1,3 @@
1
- import type { PlatformModule } from '../types/platformModule';
2
- declare const Platform: PlatformModule;
1
+ import type { PlatformInstance } from '../types';
2
+ declare const Platform: PlatformInstance;
3
3
  export default Platform;
@@ -1,5 +1,5 @@
1
1
  import type { NativePlugin } from '../../types';
2
- import type { PlatformModule } from "./types";
2
+ import type { PlatformInstance } from "./types";
3
3
  export * from './types';
4
- declare const PlatformPlugin: NativePlugin<PlatformModule>;
5
- export default PlatformPlugin;
4
+ declare const NativePlatformPlugin: NativePlugin<PlatformInstance>;
5
+ export default NativePlatformPlugin;
@@ -1 +1 @@
1
- export * from './platformModule';
1
+ export * from './platform';
@@ -1,5 +1,5 @@
1
1
  import { Devices, Engines, OS } from '../../../constants/platform';
2
- export declare interface Platform {
2
+ export declare interface PlatformInstance {
3
3
  os: OS;
4
4
  device: Devices;
5
5
  engine: Engines;
@@ -1,5 +1,5 @@
1
1
  import { Devices, Engines, OS } from '../../../constants/platform';
2
- export declare interface PlatformModule {
2
+ export declare interface PlatformInstance {
3
3
  os: OS;
4
4
  device: Devices;
5
5
  engine: Engines;
@@ -1,4 +1,4 @@
1
- import type { ListenerEntry } from '../types/themeModule';
1
+ import type { ListenerEntry } from '../types';
2
2
  export declare enum Appearances {
3
3
  Unknown = "unknown",
4
4
  Light = "light",
@@ -1,3 +1,3 @@
1
- import type { ThemeModule } from '../types/themeModule';
2
- declare const Theme: ThemeModule;
1
+ import type { ThemeInstance } from '../types';
2
+ declare const Theme: ThemeInstance;
3
3
  export default Theme;
@@ -1,5 +1,5 @@
1
1
  import type { NativePlugin } from '../../types';
2
- import type { ThemeModule } from "./types";
2
+ import type { ThemeInstance } from "./types";
3
3
  export * from './types';
4
- declare const ThemePlugin: NativePlugin<ThemeModule>;
5
- export default ThemePlugin;
4
+ declare const NativeThemePlugin: NativePlugin<ThemeInstance>;
5
+ export default NativeThemePlugin;
@@ -1,3 +1,3 @@
1
1
  export * from './color';
2
2
  export * from './easing-syntax';
3
- export * from './themeModule';
3
+ export * from './theme';
@@ -1,19 +1,11 @@
1
1
  import { Appearances } from '../constants/theme';
2
- import type { EasingKeyword, EasingSyntax } from '../types/easing-syntax';
3
- import type { Color } from '../types/color';
2
+ import type { EasingKeyword, EasingSyntax, Color } from '../types';
4
3
  export declare interface ListenerEntry {
5
4
  fn: (appearance: Appearances) => any;
6
5
  capture: boolean;
7
6
  once: boolean;
8
7
  signal?: AbortSignal;
9
8
  }
10
- export declare interface Theme {
11
- setThemeColor: (color: Color, options?: SetThemeColorOptions) => Promise<string | undefined>;
12
- getThemeColor: () => Color | undefined;
13
- removeThemeColor: (appearance?: ThemeColorMetaAppearanceKeys) => void;
14
- detectAppearance: () => Promise<Appearances>;
15
- onAppearanceChange: (listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions) => () => void;
16
- }
17
9
  export declare type ThemeColorMetaAppearanceKeys = 'default' | 'dark' | 'light';
18
10
  export declare type ThemeColorMetaGroup = Partial<Record<ThemeColorMetaAppearanceKeys, HTMLMetaElement>>;
19
11
  export declare interface SetThemeColorOptions {
@@ -22,3 +14,10 @@ export declare interface SetThemeColorOptions {
22
14
  easingFunction?: EasingSyntax | EasingKeyword;
23
15
  defaultColor?: string;
24
16
  }
17
+ export declare interface ThemeInstance {
18
+ setThemeColor: (color: Color, options?: SetThemeColorOptions) => Promise<string | undefined>;
19
+ getThemeColor: () => Color | undefined;
20
+ removeThemeColor: (appearance?: ThemeColorMetaAppearanceKeys) => void;
21
+ detectAppearance: () => Promise<Appearances>;
22
+ onAppearanceChange: (listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions) => () => void;
23
+ }
@@ -15,7 +15,7 @@ export declare interface SetThemeColorOptions {
15
15
  easingFunction?: EasingSyntax | EasingKeyword;
16
16
  defaultColor?: string;
17
17
  }
18
- export declare interface ThemeModule {
18
+ export declare interface ThemeInstance {
19
19
  setThemeColor: (color: Color, options?: SetThemeColorOptions) => Promise<string | undefined>;
20
20
  getThemeColor: () => Color | undefined;
21
21
  removeThemeColor: (appearance?: ThemeColorMetaAppearanceKeys) => void;
@@ -1,2 +1,2 @@
1
- import type { RGBA } from '../types/color';
1
+ import type { RGBA } from '../types';
2
2
  export default function parseColor(color: string): RGBA;
@@ -1,2 +1,2 @@
1
- import type { EasingFunction, EasingKeyword, EasingSyntax } from '../types/easing-syntax';
1
+ import type { EasingFunction, EasingKeyword, EasingSyntax } from '../types';
2
2
  export default function parseEasingFunction(easingFunction: EasingSyntax | EasingKeyword): EasingFunction;
@@ -1,14 +1,14 @@
1
- export declare interface NativePlugin<T> {
1
+ export declare interface ModuleBase {
2
+ Constants: Record<string, any>;
3
+ Errors: Record<string, ErrorConstructor>;
4
+ }
5
+ export declare interface NativePlugin<T> extends ModuleBase {
2
6
  installed: boolean;
3
7
  name: string;
4
8
  module: T;
5
- constants: Record<string, any>;
6
- errors: Record<string, ErrorConstructor>;
7
9
  }
8
- export declare interface NativeBase {
10
+ export declare interface NativeBase extends ModuleBase {
9
11
  Version: string;
10
- Constants: Record<string, any>;
11
- Errors: Record<string, ErrorConstructor>;
12
- extends: <T>(plugin: NativePlugin<T>) => Native;
12
+ extends: <T>(plugin: NativePlugin<T>) => NativeInstance;
13
13
  }
14
- export declare type Native = NativeBase & Record<Exclude<string, keyof NativeBase>, any>;
14
+ export declare type NativeInstance = NativeBase & Record<Exclude<string, keyof NativeBase>, any>;
@@ -790,14 +790,14 @@ function onAppearanceChange(listener, options) {
790
790
  };
791
791
  }
792
792
 
793
- var ThemePlugin = {
793
+ var NativeThemePlugin = {
794
794
  installed: false,
795
795
  name: 'Theme',
796
796
  module: Theme,
797
- constants: {
797
+ Constants: {
798
798
  Appearances: Appearances
799
799
  },
800
- errors: {
800
+ Errors: {
801
801
  EasingError: EasingError,
802
802
  UnsupportedEasingFunctionError: UnsupportedEasingFunctionError,
803
803
  StepSyntaxError: StepSyntaxError,
@@ -807,4 +807,4 @@ var ThemePlugin = {
807
807
  }
808
808
  };
809
809
 
810
- module.exports = ThemePlugin;
810
+ module.exports = NativeThemePlugin;
@@ -1,9 +1,11 @@
1
- declare interface NativePlugin<T> {
1
+ declare interface ModuleBase {
2
+ Constants: Record<string, any>;
3
+ Errors: Record<string, ErrorConstructor>;
4
+ }
5
+ declare interface NativePlugin<T> extends ModuleBase {
2
6
  installed: boolean;
3
7
  name: string;
4
8
  module: T;
5
- constants: Record<string, any>;
6
- errors: Record<string, ErrorConstructor>;
7
9
  }
8
10
 
9
11
  type SystemColor = 'ActiveBorder' | 'ActiveCaption' | 'AppWorkspace' | 'Background' | 'ButtonHighlight' | 'ButtonShadow' | 'CaptionText' | 'InactiveBorder' | 'InactiveCaption' | 'InactiveCaptionText' | 'InfoBackground' | 'InfoText' | 'Menu' | 'MenuText' | 'Scrollbar' | 'ThreeDDarkShadow' | 'ThreeDFace' | 'ThreeDHighlight' | 'ThreeDLightShadow' | 'ThreeDShadow' | 'Window' | 'WindowFrame' | 'WindowText';
@@ -61,7 +63,7 @@ declare interface SetThemeColorOptions {
61
63
  easingFunction?: EasingSyntax | EasingKeyword;
62
64
  defaultColor?: string;
63
65
  }
64
- declare interface ThemeModule {
66
+ declare interface ThemeInstance {
65
67
  setThemeColor: (color: Color, options?: SetThemeColorOptions) => Promise<string | undefined>;
66
68
  getThemeColor: () => Color | undefined;
67
69
  removeThemeColor: (appearance?: ThemeColorMetaAppearanceKeys) => void;
@@ -69,7 +71,7 @@ declare interface ThemeModule {
69
71
  onAppearanceChange: (listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions) => () => void;
70
72
  }
71
73
 
72
- declare const ThemePlugin: NativePlugin<ThemeModule>;
74
+ declare const NativeThemePlugin: NativePlugin<ThemeInstance>;
73
75
 
74
- export { ThemePlugin as default };
75
- export type { Color, CubicBezierParams, CubicBezierSyntax, DeprecatedSystemColor, EasingFunction, EasingKeyword, EasingSyntax, HEXColor, HSLAColor, HSLColor, LinearPoint, LinearSyntax, ListenerEntry, NamedColor, RGB, RGBA, RGBAColor, RGBColor, SetThemeColorOptions, StepSyntax, SystemColor, ThemeColorMetaAppearanceKeys, ThemeColorMetaGroup, ThemeModule };
76
+ export { NativeThemePlugin as default };
77
+ export type { Color, CubicBezierParams, CubicBezierSyntax, DeprecatedSystemColor, EasingFunction, EasingKeyword, EasingSyntax, HEXColor, HSLAColor, HSLColor, LinearPoint, LinearSyntax, ListenerEntry, NamedColor, RGB, RGBA, RGBAColor, RGBColor, SetThemeColorOptions, StepSyntax, SystemColor, ThemeColorMetaAppearanceKeys, ThemeColorMetaGroup, ThemeInstance };
@@ -1 +1 @@
1
- "use strict";var e,t=navigator.userAgent;!function(e){e.Unknown="unknown",e.Light="light",e.Dark="dark"}(e||(e={}));var r=function(){var e=t.match(/chrome\/([\w.]+) mobile/i);if(null===e)return NaN;var r=parseInt(e[1]);return isNaN(r)?NaN:r}(),n=window.matchMedia("(prefers-color-scheme: dark)"),a="not all"!==n.media,o=isNaN(r)||r>=92,i=document.createElement("canvas").getContext("2d",{willReadFrequently:!0}),u=/Samsung/i.test(t),l=/iemobile/i.test(t),s=/windows phone/i.test(t),c=[];function f(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(e,t){function r(n){if(!(this instanceof r))return new r(n);var a=new t(n||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(a,r.prototype):a.__proto__=r.prototype,a.name=e,void 0!==n&&(a.message=n),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(a,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(a,r);else if(t.captureStackTrace&&"function"==typeof t.captureStackTrace)t.captureStackTrace(a,r);else try{var o=new t;o.stack&&(a.stack=o.stack)}catch(e){}return a}void 0===t&&(t=Error),r.prototype=Object.create(t.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(r.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0})}catch(t){try{r.prototype.name=e}catch(e){}}try{Object.defineProperty(r,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}return r}"function"==typeof SuppressedError&&SuppressedError;var p=d("EasingError"),v=d("CubicBezierSyntaxError",p),m=d("LinearSyntaxError",p),h=d("StepSyntaxError",p),b=d("UnsupportedEasingFunctionError",p),g={linear:"linear(0, 1)",ease:"cubic-bezier(0.25, 0.1, 0.25, 1)","ease-in":"cubic-bezier(0.42, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.58, 1)","ease-in-out":"cubic-bezier(0.42, 0, 0.58, 1)","step-start":"steps(1, jump-start)","step-end":"steps(1, jump-end)"};function y(e,t,r){return e<t?t:e>r?r:e}function w(e){var t=function(e){var t=e.match(/cubic-bezier\((.*)\)/);if(null===t)throw new v("Invalid cubic-bezier syntax");var r=t[1].trim().split(","),n=[];if(4!==r.length)throw new v("Cubic-bezier must have exactly 4 numeric values");for(var a=0;a<4;a++){var o=parseFloat(r[a]);if(isNaN(o))throw new v("Cubic-bezier must have exactly 4 numeric values");if(a%2==0&&(o<0||o>1))throw new v("x1 and x2 must be between 0 and 1");n.push(o)}return{x1:n[0],y1:n[1],x2:n[2],y2:n[3]}}(e),r=t.x1,n=t.x2,a=t.y1,o=t.y2;return function(e){if(0===(e=y(e,0,1))||1===e)return e;var t=function(e,t,a){if(void 0===t&&(t=1e-6),void 0===a&&(a=50),e<=0)return 0;if(e>=1)return 1;for(var o=e,i=0;i<a;i++){var u=3*(1-o)*(1-o)*o*r+3*(1-o)*o*o*n+o*o*o,l=3*(1-o)*(1-o)*r+6*(1-o)*o*(n-r)+3*o*o*(1-n);if(Math.abs(l)<t)break;var s=o-(u-e)/l;if(Math.abs(s-o)<t){o=s;break}o=Math.max(0,Math.min(1,s))}return o}(e);return 3*(1-t)*(1-t)*t*a+3*(1-t)*t*t*o+t*t*t}}function S(e){var t=function(e){var t,r,n=e.match(/linear\((.*)\)/);if(null===n)throw new m("Invalid linear syntax");var a=n[1].trim();if(""===a)throw new m("Linear function must have at least one point");for(var o=a.split(","),i=[],u=0;u<o.length;u++){var l=o[u].trim(),s=l.match(/^([+-]?\d*\.?\d+)((?:\s+[+-]?\d*\.?\d+%){2,})$/);if(null===s){var c=l.match(/^([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)%$/);if(null===c){var d=l.match(/^([+-]?\d*\.?\d+)$/);if(null===d)throw new m('Invalid linear point format: "'+l+'"');i.push({position:1===o.length?0:u/(o.length-1),value:parseFloat(d[1])})}else i.push({position:parseFloat(c[2])/100,value:parseFloat(c[1])})}else{var p=parseFloat(s[1]),v=s[2].trim().split(/\s+/);try{for(var h=(t=void 0,f(v)),b=h.next();!b.done;b=h.next()){var g=b.value;i.push({value:p,position:parseFloat(g)/100})}}catch(e){t={error:e}}finally{try{b&&!b.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}}}if(0===i.length)throw new m("No valid points found in linear function");return i.sort((function(e,t){return e.position-t.position})),i[0].position>0&&i.unshift({position:0,value:0}),i[i.length-1].position<1&&i.push({position:1,value:1}),i}(e);return function(e){if((e=y(e,0,1))<=t[0].position)return t[0].value;if(e>=t[t.length-1].position)return t[t.length-1].value;for(var r=0;r<t.length-1;r++){var n=t[r],a=t[r+1];if(e>=n.position&&e<=a.position){if(n.position===a.position)return a.value;var o=(e-n.position)/(a.position-n.position);return n.value+(a.value-n.value)*o}}return t[t.length-1].value}}function x(e){if(function(e){return!/(linear|cubic-bezier|steps)\((.*)\)/.test(e)}(e)&&(e=g[e]),function(e){return/cubic-bezier\(/.test(e)}(e))return w(e);if(function(e){return/linear\(/.test(e)}(e))return S(e);if(function(e){return/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/.test(e)}(e))return function(e){var t=e.match(/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/);if(null===t)throw new h("Invalid steps syntax");var r=parseInt(t[1],10),n=t[2];if(r<=0)throw new h("Steps count must be a positive integer");if("jump-none"===n&&r<2)throw new h("jump-none requires at least 2 steps");return function(e){switch(e=y(e,0,1),n){case"start":case"jump-start":return 0===e?1/r:1===e?1:Math.ceil(e*r)/r;case void 0:case"end":case"jump-end":return 1===e?1:Math.floor(e*r)/r;case"jump-both":return 0===e?0:1===e?1:Math.round(e*(r+1))/(r+1);case"jump-none":return 0===e?0:1===e?1:Math.floor(e*(r-1))/(r-1);default:throw new h('Unsupported step position: "'+n+'"')}}}(e);throw new b('Unsupported easing function: "'+e+'"')}var E=d("UnsupportedColorError");function k(e){if("undefined"!=typeof CSS&&CSS.supports&&!CSS.supports("color",e))throw new E('Unsupported color: "'+e+'".');if(null!==i)try{i.clearRect(0,0,1,1),i.fillStyle=e,i.fillRect(0,0,1,1);var t=i.getImageData(0,0,1,1).data;return{red:t[0],green:t[1],blue:t[2],alpha:parseFloat((t[3]/255).toFixed(2))}}catch(e){}var r=document.createElement("div");r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",r.style.width="1px",r.style.height="1px",r.style.color=e,document.body.appendChild(r);try{var n=window.getComputedStyle(r).color,a=n.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/),o=n.match(/rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:\/\s*([\d.]+%?))?\s*\)/),u=a||o;if(null===u)throw new E('Unsupported color: "'+e+'".');var l=parseInt(u[1],10),s=parseInt(u[2],10),c=parseInt(u[3],10),f=1;if(void 0!==u[4]){var d=u[4];f="%"===d.charAt(d.length-1)?parseFloat((parseFloat(d)/100).toFixed(2)):parseFloat(parseFloat(d).toFixed(2))}if(isNaN(l)||isNaN(s)||isNaN(c)||isNaN(f))throw new E('Failed to parse color values from: "'+e+'".');return{red:l,green:s,blue:c,alpha:f}}finally{document.body.removeChild(r)}}var j,C={},L=null,I=null,F=null,M=null,N={setThemeColor:function(t,r){void 0===r&&(r={duration:0,easingFunction:"linear",appearance:"default"});var n=r.duration,i=x(r.easingFunction),u=r.appearance;null!==L&&(window.cancelAnimationFrame(L),L=null,null!==I&&(I(R()),I=null));var c=R();void 0===c&&(c=void 0!==r.defaultColor?r.defaultColor:P()===e.Dark?"#181818ff":"#dcdcdcff");var f=k(c),d=k(t);return new Promise((function(e){I=e;var t=null;L=window.requestAnimationFrame((function r(c){null===t&&(t=c);var p,v=c-t;p=0===n?1:Math.min(v/n,1);var m=i(p),h={red:Math.round(f.red+(d.red-f.red)*m),green:Math.round(f.green+(d.green-f.green)*m),blue:Math.round(f.blue+(d.blue-f.blue)*m),alpha:+(f.alpha+(d.alpha-f.alpha)*m).toFixed(2)};(function(e){void 0===e&&(e="default");var t;t=!o||!a||l||s?"default":e;var r=C[t];if(void 0!==r)return r;r=document.createElement("meta"),l?r.setAttribute("name","msapplication-navbutton-color"):s?r.setAttribute("name","msapplication-TileColor"):r.setAttribute("name","theme-color");"default"!==e&&r.setAttribute("media","(prefers-color-scheme: "+t+")");return document.head.prepend(r),C[e]=r})(u).setAttribute("content",T(h)),p<1?L=window.requestAnimationFrame(r):(L=null,null!==I&&(e(R()),L=null))}))}))},getThemeColor:R,removeThemeColor:function(e){void 0===e&&(e="default");var t=C[e];void 0!==t&&t.remove();C[e]=void 0},detectAppearance:function(){return u?z():Promise.resolve(P())},onAppearanceChange:function(e,t){void 0===t&&(t=!1);var r={fn:e,capture:!1,once:!1};"boolean"==typeof t&&(t={capture:t});void 0!==t.capture&&(r.capture=t.capture);void 0!==t.once&&(r.once=t.once);void 0!==t.signal&&(r.signal=t.signal);var a=q(r);-1===a?(c.push(r),1===c.length&&(u?(z().then((function(e){F=e})),M=window.setInterval((function(){z().then((function(e){e!==F&&(F=e,U(e))}))}),2e3)):(o=r.capture,F=P(),"function"==typeof n.addEventListener?n.addEventListener("change",D,o):"function"==typeof n.addListener&&n.addListener(D))),this.detectAppearance().then(U)):c[a].once&&!r.once&&(c[a].once=!1);var o;void 0!==r.signal&&(r.signal.aborted?O(r):r.signal.addEventListener("abort",(function e(){void 0!==r.signal&&r.signal.removeEventListener("abort",e),O(r)})));return function(){O(r)}}};function A(e){var t=e.toString(16);switch(t.length){case 0:return"00";case 1:return"0"+t;default:return t}}function T(e){return"#"+A(e.red)+A(e.green)+A(e.blue)+A(Math.round(255*e.alpha))}function z(){return new Promise((function(t){var r=new Image;r.onload=function(){if(null===i)return t(e.Light);i.drawImage(r,0,0);var n=i.getImageData(0,0,1,1).data;(n[0]&n[1]&n[2])<255?t(e.Dark):t(e.Light)},r.onerror=function(){t(e.Unknown)},r.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IndoaXRlIi8+PC9zdmc+"}))}function P(){return a?n.matches?e.Dark:e.Light:e.Unknown}function D(t){var r;(r=t.matches?e.Dark:e.Light)!==F&&U(F=r)}function U(e){for(var t=0;t<c.length;t++){var r=c[t];r.fn(e),r.once&&O(r)}}function O(e){var t,r=q(e);-1!==r&&c.splice(r,1),0===c.length&&(u?(F=null,null!==M&&(clearInterval(M),M=null)):(t=e.capture,F=null,"function"==typeof n.removeEventListener?n.removeEventListener("change",D,t):"function"==typeof n.removeListener&&n.removeListener(D)))}function q(e){for(var t=0;t<c.length;t++)if(c[t].fn===e.fn&&c[t].capture===e.capture)return t;return-1}function H(){var e;C={},e=l?'meta[name="msapplication-navbutton-color"]':s?'meta[name="msapplication-TileColor"]':'meta[name="theme-color"]';var t=document.querySelectorAll(e);if(o&&a&&!l&&!s)for(var r=0;r<t.length;r++){var n=t.item(r),i=n.getAttribute("media");if("(prefers-color-scheme: dark)"===i&&void 0===C.dark?C.dark=n:"(prefers-color-scheme: light)"===i&&void 0===C.light?C.light=n:null===i&&void 0===C.default&&(C.default=n),void 0!==C.dark&&void 0!==C.light&&void 0!==C.default)return}else C.default=t[0]}function R(){var r=function(){if(l)return document.querySelector('meta[name="msapplication-navbutton-color"]');if(s)return document.querySelector('meta[name="msapplication-TileColor"]');if(!o||!a)return document.querySelector('meta[name="theme-color"]');var t,r=document.querySelectorAll('meta[name="theme-color"]');t=P()===e.Dark?"(prefers-color-scheme: dark)":"(prefers-color-scheme: light)";for(var n=0;n<r.length;n++){var i=r.item(n);if(i.hasAttribute("content")){var u=i.getAttribute("media");if(null===u||u===t)return i}}return null}();return null!==r?r.getAttribute("content"):/version\/[\w.,]+ .*safari/i.test(t)?navigator.standalone?P()===e.Dark?"#ffffffff":"#000000ff":T(k(window.getComputedStyle(document.body).backgroundColor)):/\b(?:crmo|crios)\/[\w.]+/i.test(t)||/chrome\/[\w.]+ mobile/i.test(t)?P()===e.Dark?"#28292cff":"#ffffffff":void 0}j=new MutationObserver((function(e){for(var t=0;t<e.length;t++){for(var r=e[t],n=r.addedNodes,a=r.removedNodes,o=0;o<n.length;o++)if(n[o]instanceof HTMLMetaElement)return H();for(o=0;o<a.length;o++)if(a[o]instanceof HTMLMetaElement)return H()}})),"function"==typeof n.addEventListener?n.addEventListener("change",H):"function"==typeof n.addListener&&n.addListener(H),j.observe(document.head,{childList:!0}),H();var Z={installed:!1,name:"Theme",module:N,constants:{Appearances:e},errors:{EasingError:p,UnsupportedEasingFunctionError:b,StepSyntaxError:h,LinearSyntaxError:m,CubicBezierSyntaxError:v,UnsupportedColorError:E}};module.exports=Z;
1
+ "use strict";var e,t=navigator.userAgent;!function(e){e.Unknown="unknown",e.Light="light",e.Dark="dark"}(e||(e={}));var r=function(){var e=t.match(/chrome\/([\w.]+) mobile/i);if(null===e)return NaN;var r=parseInt(e[1]);return isNaN(r)?NaN:r}(),n=window.matchMedia("(prefers-color-scheme: dark)"),a="not all"!==n.media,o=isNaN(r)||r>=92,i=document.createElement("canvas").getContext("2d",{willReadFrequently:!0}),u=/Samsung/i.test(t),l=/iemobile/i.test(t),s=/windows phone/i.test(t),c=[];function f(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(e,t){function r(n){if(!(this instanceof r))return new r(n);var a=new t(n||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(a,r.prototype):a.__proto__=r.prototype,a.name=e,void 0!==n&&(a.message=n),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(a,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(a,r);else if(t.captureStackTrace&&"function"==typeof t.captureStackTrace)t.captureStackTrace(a,r);else try{var o=new t;o.stack&&(a.stack=o.stack)}catch(e){}return a}void 0===t&&(t=Error),r.prototype=Object.create(t.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(r.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0})}catch(t){try{r.prototype.name=e}catch(e){}}try{Object.defineProperty(r,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}return r}"function"==typeof SuppressedError&&SuppressedError;var p=d("EasingError"),v=d("CubicBezierSyntaxError",p),m=d("LinearSyntaxError",p),h=d("StepSyntaxError",p),b=d("UnsupportedEasingFunctionError",p),g={linear:"linear(0, 1)",ease:"cubic-bezier(0.25, 0.1, 0.25, 1)","ease-in":"cubic-bezier(0.42, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.58, 1)","ease-in-out":"cubic-bezier(0.42, 0, 0.58, 1)","step-start":"steps(1, jump-start)","step-end":"steps(1, jump-end)"};function y(e,t,r){return e<t?t:e>r?r:e}function w(e){var t=function(e){var t=e.match(/cubic-bezier\((.*)\)/);if(null===t)throw new v("Invalid cubic-bezier syntax");var r=t[1].trim().split(","),n=[];if(4!==r.length)throw new v("Cubic-bezier must have exactly 4 numeric values");for(var a=0;a<4;a++){var o=parseFloat(r[a]);if(isNaN(o))throw new v("Cubic-bezier must have exactly 4 numeric values");if(a%2==0&&(o<0||o>1))throw new v("x1 and x2 must be between 0 and 1");n.push(o)}return{x1:n[0],y1:n[1],x2:n[2],y2:n[3]}}(e),r=t.x1,n=t.x2,a=t.y1,o=t.y2;return function(e){if(0===(e=y(e,0,1))||1===e)return e;var t=function(e,t,a){if(void 0===t&&(t=1e-6),void 0===a&&(a=50),e<=0)return 0;if(e>=1)return 1;for(var o=e,i=0;i<a;i++){var u=3*(1-o)*(1-o)*o*r+3*(1-o)*o*o*n+o*o*o,l=3*(1-o)*(1-o)*r+6*(1-o)*o*(n-r)+3*o*o*(1-n);if(Math.abs(l)<t)break;var s=o-(u-e)/l;if(Math.abs(s-o)<t){o=s;break}o=Math.max(0,Math.min(1,s))}return o}(e);return 3*(1-t)*(1-t)*t*a+3*(1-t)*t*t*o+t*t*t}}function S(e){var t=function(e){var t,r,n=e.match(/linear\((.*)\)/);if(null===n)throw new m("Invalid linear syntax");var a=n[1].trim();if(""===a)throw new m("Linear function must have at least one point");for(var o=a.split(","),i=[],u=0;u<o.length;u++){var l=o[u].trim(),s=l.match(/^([+-]?\d*\.?\d+)((?:\s+[+-]?\d*\.?\d+%){2,})$/);if(null===s){var c=l.match(/^([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)%$/);if(null===c){var d=l.match(/^([+-]?\d*\.?\d+)$/);if(null===d)throw new m('Invalid linear point format: "'+l+'"');i.push({position:1===o.length?0:u/(o.length-1),value:parseFloat(d[1])})}else i.push({position:parseFloat(c[2])/100,value:parseFloat(c[1])})}else{var p=parseFloat(s[1]),v=s[2].trim().split(/\s+/);try{for(var h=(t=void 0,f(v)),b=h.next();!b.done;b=h.next()){var g=b.value;i.push({value:p,position:parseFloat(g)/100})}}catch(e){t={error:e}}finally{try{b&&!b.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}}}if(0===i.length)throw new m("No valid points found in linear function");return i.sort((function(e,t){return e.position-t.position})),i[0].position>0&&i.unshift({position:0,value:0}),i[i.length-1].position<1&&i.push({position:1,value:1}),i}(e);return function(e){if((e=y(e,0,1))<=t[0].position)return t[0].value;if(e>=t[t.length-1].position)return t[t.length-1].value;for(var r=0;r<t.length-1;r++){var n=t[r],a=t[r+1];if(e>=n.position&&e<=a.position){if(n.position===a.position)return a.value;var o=(e-n.position)/(a.position-n.position);return n.value+(a.value-n.value)*o}}return t[t.length-1].value}}function E(e){if(function(e){return!/(linear|cubic-bezier|steps)\((.*)\)/.test(e)}(e)&&(e=g[e]),function(e){return/cubic-bezier\(/.test(e)}(e))return w(e);if(function(e){return/linear\(/.test(e)}(e))return S(e);if(function(e){return/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/.test(e)}(e))return function(e){var t=e.match(/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/);if(null===t)throw new h("Invalid steps syntax");var r=parseInt(t[1],10),n=t[2];if(r<=0)throw new h("Steps count must be a positive integer");if("jump-none"===n&&r<2)throw new h("jump-none requires at least 2 steps");return function(e){switch(e=y(e,0,1),n){case"start":case"jump-start":return 0===e?1/r:1===e?1:Math.ceil(e*r)/r;case void 0:case"end":case"jump-end":return 1===e?1:Math.floor(e*r)/r;case"jump-both":return 0===e?0:1===e?1:Math.round(e*(r+1))/(r+1);case"jump-none":return 0===e?0:1===e?1:Math.floor(e*(r-1))/(r-1);default:throw new h('Unsupported step position: "'+n+'"')}}}(e);throw new b('Unsupported easing function: "'+e+'"')}var x=d("UnsupportedColorError");function k(e){if("undefined"!=typeof CSS&&CSS.supports&&!CSS.supports("color",e))throw new x('Unsupported color: "'+e+'".');if(null!==i)try{i.clearRect(0,0,1,1),i.fillStyle=e,i.fillRect(0,0,1,1);var t=i.getImageData(0,0,1,1).data;return{red:t[0],green:t[1],blue:t[2],alpha:parseFloat((t[3]/255).toFixed(2))}}catch(e){}var r=document.createElement("div");r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",r.style.width="1px",r.style.height="1px",r.style.color=e,document.body.appendChild(r);try{var n=window.getComputedStyle(r).color,a=n.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/),o=n.match(/rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:\/\s*([\d.]+%?))?\s*\)/),u=a||o;if(null===u)throw new x('Unsupported color: "'+e+'".');var l=parseInt(u[1],10),s=parseInt(u[2],10),c=parseInt(u[3],10),f=1;if(void 0!==u[4]){var d=u[4];f="%"===d.charAt(d.length-1)?parseFloat((parseFloat(d)/100).toFixed(2)):parseFloat(parseFloat(d).toFixed(2))}if(isNaN(l)||isNaN(s)||isNaN(c)||isNaN(f))throw new x('Failed to parse color values from: "'+e+'".');return{red:l,green:s,blue:c,alpha:f}}finally{document.body.removeChild(r)}}var C,j={},L=null,I=null,F=null,M=null,N={setThemeColor:function(t,r){void 0===r&&(r={duration:0,easingFunction:"linear",appearance:"default"});var n=r.duration,i=E(r.easingFunction),u=r.appearance;null!==L&&(window.cancelAnimationFrame(L),L=null,null!==I&&(I(R()),I=null));var c=R();void 0===c&&(c=void 0!==r.defaultColor?r.defaultColor:P()===e.Dark?"#181818ff":"#dcdcdcff");var f=k(c),d=k(t);return new Promise((function(e){I=e;var t=null;L=window.requestAnimationFrame((function r(c){null===t&&(t=c);var p,v=c-t;p=0===n?1:Math.min(v/n,1);var m=i(p),h={red:Math.round(f.red+(d.red-f.red)*m),green:Math.round(f.green+(d.green-f.green)*m),blue:Math.round(f.blue+(d.blue-f.blue)*m),alpha:+(f.alpha+(d.alpha-f.alpha)*m).toFixed(2)};(function(e){void 0===e&&(e="default");var t;t=!o||!a||l||s?"default":e;var r=j[t];if(void 0!==r)return r;r=document.createElement("meta"),l?r.setAttribute("name","msapplication-navbutton-color"):s?r.setAttribute("name","msapplication-TileColor"):r.setAttribute("name","theme-color");"default"!==e&&r.setAttribute("media","(prefers-color-scheme: "+t+")");return document.head.prepend(r),j[e]=r})(u).setAttribute("content",T(h)),p<1?L=window.requestAnimationFrame(r):(L=null,null!==I&&(e(R()),L=null))}))}))},getThemeColor:R,removeThemeColor:function(e){void 0===e&&(e="default");var t=j[e];void 0!==t&&t.remove();j[e]=void 0},detectAppearance:function(){return u?z():Promise.resolve(P())},onAppearanceChange:function(e,t){void 0===t&&(t=!1);var r={fn:e,capture:!1,once:!1};"boolean"==typeof t&&(t={capture:t});void 0!==t.capture&&(r.capture=t.capture);void 0!==t.once&&(r.once=t.once);void 0!==t.signal&&(r.signal=t.signal);var a=q(r);-1===a?(c.push(r),1===c.length&&(u?(z().then((function(e){F=e})),M=window.setInterval((function(){z().then((function(e){e!==F&&(F=e,U(e))}))}),2e3)):(o=r.capture,F=P(),"function"==typeof n.addEventListener?n.addEventListener("change",D,o):"function"==typeof n.addListener&&n.addListener(D))),this.detectAppearance().then(U)):c[a].once&&!r.once&&(c[a].once=!1);var o;void 0!==r.signal&&(r.signal.aborted?O(r):r.signal.addEventListener("abort",(function e(){void 0!==r.signal&&r.signal.removeEventListener("abort",e),O(r)})));return function(){O(r)}}};function A(e){var t=e.toString(16);switch(t.length){case 0:return"00";case 1:return"0"+t;default:return t}}function T(e){return"#"+A(e.red)+A(e.green)+A(e.blue)+A(Math.round(255*e.alpha))}function z(){return new Promise((function(t){var r=new Image;r.onload=function(){if(null===i)return t(e.Light);i.drawImage(r,0,0);var n=i.getImageData(0,0,1,1).data;(n[0]&n[1]&n[2])<255?t(e.Dark):t(e.Light)},r.onerror=function(){t(e.Unknown)},r.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IndoaXRlIi8+PC9zdmc+"}))}function P(){return a?n.matches?e.Dark:e.Light:e.Unknown}function D(t){var r;(r=t.matches?e.Dark:e.Light)!==F&&U(F=r)}function U(e){for(var t=0;t<c.length;t++){var r=c[t];r.fn(e),r.once&&O(r)}}function O(e){var t,r=q(e);-1!==r&&c.splice(r,1),0===c.length&&(u?(F=null,null!==M&&(clearInterval(M),M=null)):(t=e.capture,F=null,"function"==typeof n.removeEventListener?n.removeEventListener("change",D,t):"function"==typeof n.removeListener&&n.removeListener(D)))}function q(e){for(var t=0;t<c.length;t++)if(c[t].fn===e.fn&&c[t].capture===e.capture)return t;return-1}function H(){var e;j={},e=l?'meta[name="msapplication-navbutton-color"]':s?'meta[name="msapplication-TileColor"]':'meta[name="theme-color"]';var t=document.querySelectorAll(e);if(o&&a&&!l&&!s)for(var r=0;r<t.length;r++){var n=t.item(r),i=n.getAttribute("media");if("(prefers-color-scheme: dark)"===i&&void 0===j.dark?j.dark=n:"(prefers-color-scheme: light)"===i&&void 0===j.light?j.light=n:null===i&&void 0===j.default&&(j.default=n),void 0!==j.dark&&void 0!==j.light&&void 0!==j.default)return}else j.default=t[0]}function R(){var r=function(){if(l)return document.querySelector('meta[name="msapplication-navbutton-color"]');if(s)return document.querySelector('meta[name="msapplication-TileColor"]');if(!o||!a)return document.querySelector('meta[name="theme-color"]');var t,r=document.querySelectorAll('meta[name="theme-color"]');t=P()===e.Dark?"(prefers-color-scheme: dark)":"(prefers-color-scheme: light)";for(var n=0;n<r.length;n++){var i=r.item(n);if(i.hasAttribute("content")){var u=i.getAttribute("media");if(null===u||u===t)return i}}return null}();return null!==r?r.getAttribute("content"):/version\/[\w.,]+ .*safari/i.test(t)?navigator.standalone?P()===e.Dark?"#ffffffff":"#000000ff":T(k(window.getComputedStyle(document.body).backgroundColor)):/\b(?:crmo|crios)\/[\w.]+/i.test(t)||/chrome\/[\w.]+ mobile/i.test(t)?P()===e.Dark?"#28292cff":"#ffffffff":void 0}C=new MutationObserver((function(e){for(var t=0;t<e.length;t++){for(var r=e[t],n=r.addedNodes,a=r.removedNodes,o=0;o<n.length;o++)if(n[o]instanceof HTMLMetaElement)return H();for(o=0;o<a.length;o++)if(a[o]instanceof HTMLMetaElement)return H()}})),"function"==typeof n.addEventListener?n.addEventListener("change",H):"function"==typeof n.addListener&&n.addListener(H),C.observe(document.head,{childList:!0}),H();var Z={installed:!1,name:"Theme",module:N,Constants:{Appearances:e},Errors:{EasingError:p,UnsupportedEasingFunctionError:b,StepSyntaxError:h,LinearSyntaxError:m,CubicBezierSyntaxError:v,UnsupportedColorError:x}};module.exports=Z;