native-fn 1.0.89 → 1.0.90
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.
- package/dist/index.d.ts +4 -33
- package/dist/native.cjs +2742 -47
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +2742 -47
- package/dist/native.umd.js +2742 -47
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +637 -663
- package/dist/plugin/app/index.d.ts +4 -114
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +637 -663
- package/dist/plugin/app/index.umd.js +637 -663
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/app/constants/index.d.ts +13 -0
- package/dist/plugin/app/src/plugin/app/cores/index.d.ts +3 -2
- package/dist/plugin/app/src/plugin/app/index.d.ts +2 -11
- package/dist/plugin/app/src/plugin/app/types/app.d.ts +13 -3
- package/dist/plugin/app/src/plugin/app/types/index.d.ts +0 -15
- package/dist/plugin/app/src/plugin/appearance/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/appearance/index.d.ts +2 -7
- package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +6 -3
- package/dist/plugin/app/src/plugin/appearance/types/index.d.ts +0 -12
- package/dist/plugin/app/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/clipboard/index.d.ts +2 -4
- package/dist/plugin/app/src/plugin/clipboard/types/clipboard.d.ts +3 -1
- package/dist/plugin/app/src/plugin/clipboard/types/index.d.ts +0 -10
- package/dist/plugin/app/src/plugin/dimension/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/dimension/index.d.ts +3 -4
- package/dist/plugin/app/src/plugin/dimension/types/dimensions.d.ts +4 -2
- package/dist/plugin/app/src/plugin/dimension/types/index.d.ts +0 -12
- package/dist/plugin/app/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/fullscreen/index.d.ts +2 -4
- package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen.d.ts +6 -4
- package/dist/plugin/app/src/plugin/fullscreen/types/index.d.ts +0 -10
- package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +6 -6
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +24 -6
- package/dist/plugin/app/src/plugin/platform/index.d.ts +2 -11
- package/dist/plugin/app/src/plugin/platform/types/index.d.ts +0 -10
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +22 -14
- package/dist/plugin/app/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/theme/index.d.ts +2 -4
- package/dist/plugin/app/src/plugin/theme/types/index.d.ts +0 -10
- package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +3 -1
- package/dist/plugin/app/src/types/native.d.ts +16 -26
- package/dist/plugin/appearance/index.cjs +392 -585
- package/dist/plugin/appearance/index.d.ts +4 -37
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +392 -585
- package/dist/plugin/appearance/index.umd.js +392 -585
- package/dist/plugin/appearance/index.umd.min.js +1 -1
- package/dist/plugin/appearance/src/plugin/app/constants/index.d.ts +13 -0
- package/dist/plugin/appearance/src/plugin/app/cores/index.d.ts +3 -2
- package/dist/plugin/appearance/src/plugin/app/index.d.ts +2 -11
- package/dist/plugin/appearance/src/plugin/app/types/app.d.ts +13 -3
- package/dist/plugin/appearance/src/plugin/app/types/index.d.ts +0 -15
- package/dist/plugin/appearance/src/plugin/appearance/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/appearance/index.d.ts +2 -7
- package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +6 -3
- package/dist/plugin/appearance/src/plugin/appearance/types/index.d.ts +0 -12
- package/dist/plugin/appearance/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/clipboard/index.d.ts +2 -4
- package/dist/plugin/appearance/src/plugin/clipboard/types/clipboard.d.ts +3 -1
- package/dist/plugin/appearance/src/plugin/clipboard/types/index.d.ts +0 -10
- package/dist/plugin/appearance/src/plugin/dimension/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/dimension/index.d.ts +3 -4
- package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +4 -2
- package/dist/plugin/appearance/src/plugin/dimension/types/index.d.ts +0 -12
- package/dist/plugin/appearance/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/fullscreen/index.d.ts +2 -4
- package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +6 -4
- package/dist/plugin/appearance/src/plugin/fullscreen/types/index.d.ts +0 -10
- package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +6 -6
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +24 -6
- package/dist/plugin/appearance/src/plugin/platform/index.d.ts +2 -11
- package/dist/plugin/appearance/src/plugin/platform/types/index.d.ts +0 -10
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +22 -14
- package/dist/plugin/appearance/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/theme/index.d.ts +2 -4
- package/dist/plugin/appearance/src/plugin/theme/types/index.d.ts +0 -10
- package/dist/plugin/appearance/src/plugin/theme/types/theme.d.ts +3 -1
- package/dist/plugin/appearance/src/types/native.d.ts +16 -26
- package/dist/plugin/clipboard/index.cjs +48 -822
- package/dist/plugin/clipboard/index.d.ts +4 -27
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +48 -822
- package/dist/plugin/clipboard/index.umd.js +48 -822
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/app/constants/index.d.ts +13 -0
- package/dist/plugin/clipboard/src/plugin/app/cores/index.d.ts +3 -2
- package/dist/plugin/clipboard/src/plugin/app/index.d.ts +2 -11
- package/dist/plugin/clipboard/src/plugin/app/types/app.d.ts +13 -3
- package/dist/plugin/clipboard/src/plugin/app/types/index.d.ts +0 -15
- package/dist/plugin/clipboard/src/plugin/appearance/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/appearance/index.d.ts +2 -7
- package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +6 -3
- package/dist/plugin/clipboard/src/plugin/appearance/types/index.d.ts +0 -12
- package/dist/plugin/clipboard/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/clipboard/index.d.ts +2 -4
- package/dist/plugin/clipboard/src/plugin/clipboard/types/clipboard.d.ts +3 -1
- package/dist/plugin/clipboard/src/plugin/clipboard/types/index.d.ts +0 -10
- package/dist/plugin/clipboard/src/plugin/dimension/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/dimension/index.d.ts +3 -4
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +4 -2
- package/dist/plugin/clipboard/src/plugin/dimension/types/index.d.ts +0 -12
- package/dist/plugin/clipboard/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/fullscreen/index.d.ts +2 -4
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +6 -4
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/index.d.ts +0 -10
- package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +6 -6
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +24 -6
- package/dist/plugin/clipboard/src/plugin/platform/index.d.ts +2 -11
- package/dist/plugin/clipboard/src/plugin/platform/types/index.d.ts +0 -10
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +22 -14
- package/dist/plugin/clipboard/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/theme/index.d.ts +2 -4
- package/dist/plugin/clipboard/src/plugin/theme/types/index.d.ts +0 -10
- package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +3 -1
- package/dist/plugin/clipboard/src/types/native.d.ts +16 -26
- package/dist/plugin/dimension/index.cjs +3 -883
- package/dist/plugin/dimension/index.d.ts +4 -36
- package/dist/plugin/dimension/index.min.cjs +1 -1
- package/dist/plugin/dimension/index.min.mjs +1 -1
- package/dist/plugin/dimension/index.mjs +3 -883
- package/dist/plugin/dimension/index.umd.js +3 -883
- package/dist/plugin/dimension/index.umd.min.js +1 -1
- package/dist/plugin/dimension/src/plugin/app/constants/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/app/cores/index.d.ts +3 -2
- package/dist/plugin/dimension/src/plugin/app/index.d.ts +2 -11
- package/dist/plugin/dimension/src/plugin/app/types/app.d.ts +13 -3
- package/dist/plugin/dimension/src/plugin/app/types/index.d.ts +0 -15
- package/dist/plugin/dimension/src/plugin/appearance/cores/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/appearance/index.d.ts +2 -7
- package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +6 -3
- package/dist/plugin/dimension/src/plugin/appearance/types/index.d.ts +0 -12
- package/dist/plugin/dimension/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/clipboard/index.d.ts +2 -4
- package/dist/plugin/dimension/src/plugin/clipboard/types/clipboard.d.ts +3 -1
- package/dist/plugin/dimension/src/plugin/clipboard/types/index.d.ts +0 -10
- package/dist/plugin/dimension/src/plugin/dimension/cores/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/dimension/index.d.ts +3 -4
- package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +4 -2
- package/dist/plugin/dimension/src/plugin/dimension/types/index.d.ts +0 -12
- package/dist/plugin/dimension/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/fullscreen/index.d.ts +2 -4
- package/dist/plugin/dimension/src/plugin/fullscreen/types/fullscreen.d.ts +6 -4
- package/dist/plugin/dimension/src/plugin/fullscreen/types/index.d.ts +0 -10
- package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +6 -6
- package/dist/plugin/dimension/src/plugin/platform/cores/index.d.ts +24 -6
- package/dist/plugin/dimension/src/plugin/platform/index.d.ts +2 -11
- package/dist/plugin/dimension/src/plugin/platform/types/index.d.ts +0 -10
- package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +22 -14
- package/dist/plugin/dimension/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/theme/index.d.ts +2 -4
- package/dist/plugin/dimension/src/plugin/theme/types/index.d.ts +0 -10
- package/dist/plugin/dimension/src/plugin/theme/types/theme.d.ts +3 -1
- package/dist/plugin/dimension/src/types/native.d.ts +16 -26
- package/dist/plugin/fullscreen/index.cjs +391 -588
- package/dist/plugin/fullscreen/index.d.ts +4 -33
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +391 -588
- package/dist/plugin/fullscreen/index.umd.js +391 -588
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/app/constants/index.d.ts +13 -0
- package/dist/plugin/fullscreen/src/plugin/app/cores/index.d.ts +3 -2
- package/dist/plugin/fullscreen/src/plugin/app/index.d.ts +2 -11
- package/dist/plugin/fullscreen/src/plugin/app/types/app.d.ts +13 -3
- package/dist/plugin/fullscreen/src/plugin/app/types/index.d.ts +0 -15
- package/dist/plugin/fullscreen/src/plugin/appearance/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/appearance/index.d.ts +2 -7
- package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +6 -3
- package/dist/plugin/fullscreen/src/plugin/appearance/types/index.d.ts +0 -12
- package/dist/plugin/fullscreen/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/clipboard/index.d.ts +2 -4
- package/dist/plugin/fullscreen/src/plugin/clipboard/types/clipboard.d.ts +3 -1
- package/dist/plugin/fullscreen/src/plugin/clipboard/types/index.d.ts +0 -10
- package/dist/plugin/fullscreen/src/plugin/dimension/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/dimension/index.d.ts +3 -4
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +4 -2
- package/dist/plugin/fullscreen/src/plugin/dimension/types/index.d.ts +0 -12
- package/dist/plugin/fullscreen/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/fullscreen/index.d.ts +2 -4
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +6 -4
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/index.d.ts +0 -10
- package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +6 -6
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +24 -6
- package/dist/plugin/fullscreen/src/plugin/platform/index.d.ts +2 -11
- package/dist/plugin/fullscreen/src/plugin/platform/types/index.d.ts +0 -10
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +22 -14
- package/dist/plugin/fullscreen/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/theme/index.d.ts +2 -4
- package/dist/plugin/fullscreen/src/plugin/theme/types/index.d.ts +0 -10
- package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +3 -1
- package/dist/plugin/fullscreen/src/types/native.d.ts +16 -26
- package/dist/plugin/platform/index.cjs +409 -488
- package/dist/plugin/platform/index.d.ts +4 -96
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +409 -488
- package/dist/plugin/platform/index.umd.js +409 -488
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/plugin/app/constants/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/app/cores/index.d.ts +3 -2
- package/dist/plugin/platform/src/plugin/app/index.d.ts +2 -11
- package/dist/plugin/platform/src/plugin/app/types/app.d.ts +13 -3
- package/dist/plugin/platform/src/plugin/app/types/index.d.ts +0 -15
- package/dist/plugin/platform/src/plugin/appearance/cores/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/appearance/index.d.ts +2 -7
- package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +6 -3
- package/dist/plugin/platform/src/plugin/appearance/types/index.d.ts +0 -12
- package/dist/plugin/platform/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/clipboard/index.d.ts +2 -4
- package/dist/plugin/platform/src/plugin/clipboard/types/clipboard.d.ts +3 -1
- package/dist/plugin/platform/src/plugin/clipboard/types/index.d.ts +0 -10
- package/dist/plugin/platform/src/plugin/dimension/cores/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/dimension/index.d.ts +3 -4
- package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +4 -2
- package/dist/plugin/platform/src/plugin/dimension/types/index.d.ts +0 -12
- package/dist/plugin/platform/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/fullscreen/index.d.ts +2 -4
- package/dist/plugin/platform/src/plugin/fullscreen/types/fullscreen.d.ts +6 -4
- package/dist/plugin/platform/src/plugin/fullscreen/types/index.d.ts +0 -10
- package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +6 -6
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +24 -6
- package/dist/plugin/platform/src/plugin/platform/index.d.ts +2 -11
- package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +0 -10
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +22 -14
- package/dist/plugin/platform/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/theme/index.d.ts +2 -4
- package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +0 -10
- package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +3 -1
- package/dist/plugin/platform/src/types/native.d.ts +16 -26
- package/dist/plugin/theme/index.cjs +390 -461
- package/dist/plugin/theme/index.d.ts +4 -27
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +390 -461
- package/dist/plugin/theme/index.umd.js +390 -461
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/app/constants/index.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/app/cores/index.d.ts +3 -2
- package/dist/plugin/theme/src/plugin/app/index.d.ts +2 -11
- package/dist/plugin/theme/src/plugin/app/types/app.d.ts +13 -3
- package/dist/plugin/theme/src/plugin/app/types/index.d.ts +0 -15
- package/dist/plugin/theme/src/plugin/appearance/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/appearance/index.d.ts +2 -7
- package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +6 -3
- package/dist/plugin/theme/src/plugin/appearance/types/index.d.ts +0 -12
- package/dist/plugin/theme/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/clipboard/index.d.ts +2 -4
- package/dist/plugin/theme/src/plugin/clipboard/types/clipboard.d.ts +3 -1
- package/dist/plugin/theme/src/plugin/clipboard/types/index.d.ts +0 -10
- package/dist/plugin/theme/src/plugin/dimension/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/dimension/index.d.ts +3 -4
- package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +4 -2
- package/dist/plugin/theme/src/plugin/dimension/types/index.d.ts +0 -12
- package/dist/plugin/theme/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/fullscreen/index.d.ts +2 -4
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +6 -4
- package/dist/plugin/theme/src/plugin/fullscreen/types/index.d.ts +0 -10
- package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +6 -6
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +24 -6
- package/dist/plugin/theme/src/plugin/platform/index.d.ts +2 -11
- package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +0 -10
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +22 -14
- package/dist/plugin/theme/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/theme/index.d.ts +2 -4
- package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +0 -10
- package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +3 -1
- package/dist/plugin/theme/src/types/native.d.ts +16 -26
- package/dist/src/plugin/Display/constants/index.d.ts +4 -0
- package/dist/src/plugin/Display/cores/index.d.ts +3 -0
- package/dist/src/plugin/Display/index.d.ts +3 -0
- package/dist/src/plugin/Display/types/display.d.ts +13 -0
- package/dist/src/plugin/Display/types/index.d.ts +1 -0
- package/dist/src/plugin/app/constants/index.d.ts +13 -0
- package/dist/src/plugin/app/cores/index.d.ts +11 -2
- package/dist/src/plugin/app/index.d.ts +2 -11
- package/dist/src/plugin/app/types/app.d.ts +25 -3
- package/dist/src/plugin/app/types/index.d.ts +0 -15
- package/dist/src/plugin/appearance/cores/index.d.ts +2 -2
- package/dist/src/plugin/appearance/index.d.ts +2 -7
- package/dist/src/plugin/appearance/types/appearance.d.ts +6 -3
- package/dist/src/plugin/appearance/types/index.d.ts +0 -12
- package/dist/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/src/plugin/clipboard/index.d.ts +2 -4
- package/dist/src/plugin/clipboard/types/clipboard.d.ts +3 -1
- package/dist/src/plugin/clipboard/types/index.d.ts +0 -10
- package/dist/src/plugin/dimension/cores/index.d.ts +2 -2
- package/dist/src/plugin/dimension/index.d.ts +3 -4
- package/dist/src/plugin/dimension/types/dimensions.d.ts +4 -2
- package/dist/src/plugin/dimension/types/index.d.ts +0 -12
- package/dist/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/src/plugin/fullscreen/index.d.ts +2 -4
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +6 -4
- package/dist/src/plugin/fullscreen/types/index.d.ts +0 -10
- package/dist/src/plugin/network/cores/index.d.ts +15 -0
- package/dist/src/plugin/network/index.d.ts +3 -0
- package/dist/src/plugin/network/types/index.d.ts +1 -0
- package/dist/src/plugin/network/types/network.d.ts +4 -0
- package/dist/src/plugin/platform/constants/index.d.ts +6 -6
- package/dist/src/plugin/platform/cores/index.d.ts +24 -6
- package/dist/src/plugin/platform/index.d.ts +2 -11
- package/dist/src/plugin/platform/types/index.d.ts +0 -10
- package/dist/src/plugin/platform/types/platform.d.ts +23 -15
- package/dist/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/src/plugin/theme/index.d.ts +2 -4
- package/dist/src/plugin/theme/types/index.d.ts +0 -10
- package/dist/src/plugin/theme/types/theme.d.ts +3 -1
- package/dist/src/types/native.d.ts +16 -26
- package/package.json +1 -1
package/dist/native.cjs
CHANGED
|
@@ -1,27 +1,402 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var version = "1.0.
|
|
3
|
+
var version = "1.0.90";
|
|
4
4
|
var packageJSON = {
|
|
5
5
|
version: version};
|
|
6
6
|
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
function resolveWindowsVersion(string) {
|
|
8
|
+
if (typeof string === 'undefined')
|
|
9
|
+
return '';
|
|
10
|
+
var mapped = {
|
|
11
|
+
'4.90': 'ME',
|
|
12
|
+
'NT3.51': 'NT 3.11',
|
|
13
|
+
'NT4.0': 'NT 4.0',
|
|
14
|
+
'NT 5.0': '2000',
|
|
15
|
+
'NT 5.1': 'XP',
|
|
16
|
+
'NT 5.2': 'XP',
|
|
17
|
+
'NT 6.0': 'Vista',
|
|
18
|
+
'NT 6.1': '7',
|
|
19
|
+
'NT 6.2': '8',
|
|
20
|
+
'NT 6.3': '8.1',
|
|
21
|
+
'NT 6.4': '10',
|
|
22
|
+
'NT 10.0': '10',
|
|
23
|
+
'ARM': 'RT'
|
|
24
|
+
}[string];
|
|
25
|
+
if (typeof mapped !== 'undefined')
|
|
26
|
+
return mapped;
|
|
27
|
+
return string;
|
|
28
|
+
}
|
|
29
|
+
function resolveUnderscoreVersion(string) {
|
|
30
|
+
if (typeof string === 'undefined')
|
|
31
|
+
return '';
|
|
32
|
+
return string.replace(/_/g, '.');
|
|
24
33
|
}
|
|
34
|
+
var OS;
|
|
35
|
+
(function (OS) {
|
|
36
|
+
OS["Unknown"] = "Unknown";
|
|
37
|
+
OS["Android"] = "Android";
|
|
38
|
+
OS["iOS"] = "iOS";
|
|
39
|
+
OS["Windows"] = "Windows";
|
|
40
|
+
OS["MacOS"] = "MacOS";
|
|
41
|
+
})(OS || (OS = {}));
|
|
42
|
+
var Devices;
|
|
43
|
+
(function (Devices) {
|
|
44
|
+
Devices["Unknown"] = "Unknown";
|
|
45
|
+
Devices["Mobile"] = "Mobile";
|
|
46
|
+
Devices["Desktop"] = "Desktop";
|
|
47
|
+
})(Devices || (Devices = {}));
|
|
48
|
+
var Engines;
|
|
49
|
+
(function (Engines) {
|
|
50
|
+
Engines["Unknown"] = "Unknown";
|
|
51
|
+
Engines["EdgeHTML"] = "EdgeHTML";
|
|
52
|
+
Engines["ArkWeb"] = "ArkWeb";
|
|
53
|
+
Engines["Blink"] = "Blink";
|
|
54
|
+
Engines["Presto"] = "Presto";
|
|
55
|
+
Engines["WebKit"] = "WebKit";
|
|
56
|
+
Engines["Trident"] = "Trident";
|
|
57
|
+
Engines["NetFront"] = "NetFront";
|
|
58
|
+
Engines["KHTML"] = "KHTML";
|
|
59
|
+
Engines["Tasman"] = "Tasman";
|
|
60
|
+
Engines["Gecko"] = "Gecko";
|
|
61
|
+
})(Engines || (Engines = {}));
|
|
62
|
+
var Browsers;
|
|
63
|
+
(function (Browsers) {
|
|
64
|
+
Browsers["Unknown"] = "Unknown";
|
|
65
|
+
Browsers["Chrome"] = "Chrome";
|
|
66
|
+
Browsers["Safari"] = "Safari";
|
|
67
|
+
Browsers["Edge"] = "Edge";
|
|
68
|
+
Browsers["Firefox"] = "Firefox";
|
|
69
|
+
Browsers["Opera"] = "Opera";
|
|
70
|
+
Browsers["IE"] = "IE";
|
|
71
|
+
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
72
|
+
})(Browsers || (Browsers = {}));
|
|
73
|
+
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
74
|
+
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
75
|
+
'Google Chrome': 'Chrome',
|
|
76
|
+
'Microsoft Edge': 'Edge',
|
|
77
|
+
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
78
|
+
'Android WebView': 'Chrome WebView',
|
|
79
|
+
'HeadlessChrome': 'Chrome Headless',
|
|
80
|
+
'OperaMobile': 'Opera Mobi',
|
|
81
|
+
};
|
|
82
|
+
var RTL_LANGUAGES = ['ae', 'ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk', 'he', 'iw', 'ku', 'mzn', 'nqo', 'pnb', 'ps', 'sd', 'ug', 'ur', 'yi'];
|
|
83
|
+
var OS_RESOLVER_MAP = [
|
|
84
|
+
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
85
|
+
[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
|
|
86
|
+
[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i, OS.Windows, resolveWindowsVersion],
|
|
87
|
+
[/windows nt ?([\d.)]*)(?!.+xbox)/i, OS.Windows, resolveWindowsVersion],
|
|
88
|
+
[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i, OS.Windows, resolveWindowsVersion],
|
|
89
|
+
[/windows ce\/?([\d.]*)/i, OS.Windows, resolveWindowsVersion],
|
|
90
|
+
[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i, OS.iOS, resolveUnderscoreVersion],
|
|
91
|
+
[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i, OS.iOS, resolveUnderscoreVersion],
|
|
92
|
+
[/cfnetwork\/.+darwin/i, OS.iOS, resolveUnderscoreVersion],
|
|
93
|
+
[/mac os x ?([\w. ]*)/i, OS.MacOS, resolveUnderscoreVersion],
|
|
94
|
+
[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i, OS.MacOS, resolveUnderscoreVersion],
|
|
95
|
+
[/droid ([\w.]+)\b.+(android[- ]x86)/i, OS.Android],
|
|
96
|
+
[/android\w*[-\/.; ]?([\d.]*)/i, OS.Android],
|
|
97
|
+
];
|
|
98
|
+
var ENGINE_RESOLVER_MAP = [
|
|
99
|
+
[/windows.+ edge\/([\w.]+)/i, Engines.EdgeHTML],
|
|
100
|
+
[/arkweb\/([\w.]+)/i, Engines.ArkWeb],
|
|
101
|
+
[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i, Engines.Blink],
|
|
102
|
+
[/presto\/([\w.]+)/i, Engines.Presto],
|
|
103
|
+
[/webkit\/([\w.]+)/i, Engines.WebKit],
|
|
104
|
+
[/trident\/([\w.]+)/i, Engines.Trident],
|
|
105
|
+
[/netfront\/([\w.]+)/i, Engines.NetFront],
|
|
106
|
+
[/khtml[\/ ]\(?([\w.]+)/i, Engines.KHTML],
|
|
107
|
+
[/tasman[\/ ]\(?([\w.]+)/i, Engines.Tasman],
|
|
108
|
+
[/rv:([\w.]{1,9})\b.+gecko/i, Engines.Gecko]
|
|
109
|
+
];
|
|
110
|
+
var BROWSER_RESOLVER_MAP = [
|
|
111
|
+
[/\b(?:crmo|crios)\/([\w.]+)/i, Browsers.Chrome],
|
|
112
|
+
[/webview.+edge\/([\w.]+)/i, Browsers.Edge],
|
|
113
|
+
[/edg(?:e|ios|a)?\/([\w.]+)/i, Browsers.Edge],
|
|
114
|
+
[/opera mini\/([-\w.]+)/i, Browsers.Opera],
|
|
115
|
+
[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i, Browsers.Opera],
|
|
116
|
+
[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i, Browsers.Opera],
|
|
117
|
+
[/opios[\/ ]+([\w.]+)/i, Browsers.Opera],
|
|
118
|
+
[/\bop(?:rg)?x\/([\w.]+)/i, Browsers.Opera],
|
|
119
|
+
[/\bopr\/([\w.]+)/i, Browsers.Opera],
|
|
120
|
+
[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i, Browsers.IE],
|
|
121
|
+
[/(?:ms|\()ie ([\w.]+)/i, Browsers.IE],
|
|
122
|
+
[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i, Browsers.IE],
|
|
123
|
+
[/\bfocus\/([\w.]+)/i, Browsers.Firefox],
|
|
124
|
+
[/\bopt\/([\w.]+)/i, Browsers.Opera],
|
|
125
|
+
[/coast\/([\w.]+)/i, Browsers.Opera],
|
|
126
|
+
[/fxios\/([\w.-]+)/i, Browsers.Firefox],
|
|
127
|
+
[/samsungbrowser\/([\w.]+)/i, Browsers.SamsungInternet],
|
|
128
|
+
[/headlesschrome(?:\/([\w.]+)| )/i, Browsers.Chrome],
|
|
129
|
+
[/wv\).+chrome\/([\w.]+).+edgw\//i, Browsers.Edge],
|
|
130
|
+
[/ wv\).+(chrome)\/([\w.]+)/i, Browsers.Chrome],
|
|
131
|
+
[/chrome\/([\w.]+) mobile/i, Browsers.Chrome],
|
|
132
|
+
[/chrome\/v?([\w.]+)/i, Browsers.Chrome],
|
|
133
|
+
[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i, Browsers.Safari],
|
|
134
|
+
[/iphone .*mobile(?:\/\w+ | ?)safari/i, Browsers.Safari],
|
|
135
|
+
[/version\/([\w.,]+) .*safari/i, Browsers.Safari],
|
|
136
|
+
[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i, Browsers.Safari, '1'],
|
|
137
|
+
[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i, Browsers.Firefox],
|
|
138
|
+
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
139
|
+
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
140
|
+
];
|
|
141
|
+
var BOT_REGEXP = [
|
|
142
|
+
/ daum[ /]/i,
|
|
143
|
+
/ deusu\//i,
|
|
144
|
+
/(?:^|[^g])news(?!sapphire)/i,
|
|
145
|
+
/(?<! (?:channel\/|google\/))google(?!(app|\/google| pixel))/i,
|
|
146
|
+
/(?<! cu)bots?(?:\b|_)/i,
|
|
147
|
+
/(?<!lib)http/i,
|
|
148
|
+
/(?<![hg]m)score/i,
|
|
149
|
+
/(?<!cam)scan/i,
|
|
150
|
+
/24x7/i,
|
|
151
|
+
/@[a-z][\w-]+\./i,
|
|
152
|
+
/\(\)/i,
|
|
153
|
+
/\.com\b/i,
|
|
154
|
+
/\b\w+\.ai/i,
|
|
155
|
+
/\bmanus-user\//i,
|
|
156
|
+
/\bort\//i,
|
|
157
|
+
/\bperl\b/i,
|
|
158
|
+
/\bsecurityheaders\b/i,
|
|
159
|
+
/\btime\//i,
|
|
160
|
+
/\|/i,
|
|
161
|
+
/^[\w .\-(?:)%]+(?:\/v?\d+(?:\.\d+)?(?:\.\d{1,10})*?)?(?:,|$)/i,
|
|
162
|
+
/^[^ ]{50,}$/i,
|
|
163
|
+
/^\d+\b/i,
|
|
164
|
+
/^\W/i,
|
|
165
|
+
/^\w*search\b/i,
|
|
166
|
+
/^\w+\/[\w()]*$/i,
|
|
167
|
+
/^\w+\/\d\.\d\s\([\w@]+\)$/i,
|
|
168
|
+
/^active/i,
|
|
169
|
+
/^ad muncher/i,
|
|
170
|
+
/^amaya/i,
|
|
171
|
+
/^apache\//i,
|
|
172
|
+
/^avsdevicesdk\//i,
|
|
173
|
+
/^azure/i,
|
|
174
|
+
/^biglotron/i,
|
|
175
|
+
/^bot/i,
|
|
176
|
+
/^bw\//i,
|
|
177
|
+
/^clamav[ /]/i,
|
|
178
|
+
/^client\//i,
|
|
179
|
+
/^cobweb\//i,
|
|
180
|
+
/^custom/i,
|
|
181
|
+
/^ddg[_-]android/i,
|
|
182
|
+
/^discourse/i,
|
|
183
|
+
/^dispatch\/\d/i,
|
|
184
|
+
/^downcast\//i,
|
|
185
|
+
/^duckduckgo/i,
|
|
186
|
+
/^email/i,
|
|
187
|
+
/^facebook/i,
|
|
188
|
+
/^getright\//i,
|
|
189
|
+
/^gozilla\//i,
|
|
190
|
+
/^hobbit/i,
|
|
191
|
+
/^hotzonu/i,
|
|
192
|
+
/^hwcdn\//i,
|
|
193
|
+
/^igetter\//i,
|
|
194
|
+
/^jeode\//i,
|
|
195
|
+
/^jetty\//i,
|
|
196
|
+
/^jigsaw/i,
|
|
197
|
+
/^microsoft bits/i,
|
|
198
|
+
/^movabletype/i,
|
|
199
|
+
/^mozilla\/\d\.\d\s[\w.-]+$/i,
|
|
200
|
+
/^mozilla\/\d\.\d\s\(compatible;?(?:\s[\w-.]+\/\d+\.\d+)?\)$/i,
|
|
201
|
+
/^navermailapp/i,
|
|
202
|
+
/^netsurf/i,
|
|
203
|
+
/^offline/i,
|
|
204
|
+
/^openai\//i,
|
|
205
|
+
/^owler/i,
|
|
206
|
+
/^php/i,
|
|
207
|
+
/^postman/i,
|
|
208
|
+
/^python/i,
|
|
209
|
+
/^rank/i,
|
|
210
|
+
/^read/i,
|
|
211
|
+
/^reed/i,
|
|
212
|
+
/^rest/i,
|
|
213
|
+
/^rss/i,
|
|
214
|
+
/^snapchat/i,
|
|
215
|
+
/^space bison/i,
|
|
216
|
+
/^svn/i,
|
|
217
|
+
/^swcd /i,
|
|
218
|
+
/^taringa/i,
|
|
219
|
+
/^thumbor\//i,
|
|
220
|
+
/^track/i,
|
|
221
|
+
/^w3c/i,
|
|
222
|
+
/^webbandit\//i,
|
|
223
|
+
/^webcopier/i,
|
|
224
|
+
/^wget/i,
|
|
225
|
+
/^whatsapp/i,
|
|
226
|
+
/^wordpress/i,
|
|
227
|
+
/^xenu link sleuth/i,
|
|
228
|
+
/^yahoo/i,
|
|
229
|
+
/^yandex/i,
|
|
230
|
+
/^zdm\/\d/i,
|
|
231
|
+
/^zoom marketplace\//i,
|
|
232
|
+
/advisor/i,
|
|
233
|
+
/agent\b/i,
|
|
234
|
+
/analyzer/i,
|
|
235
|
+
/archive/i,
|
|
236
|
+
/ask jeeves\/teoma/i,
|
|
237
|
+
/audit/i,
|
|
238
|
+
/bit\.ly\//i,
|
|
239
|
+
/bluecoat drtr/i,
|
|
240
|
+
/browsex/i,
|
|
241
|
+
/burpcollaborator/i,
|
|
242
|
+
/capture/i,
|
|
243
|
+
/catch/i,
|
|
244
|
+
/check\b/i,
|
|
245
|
+
/checker/i,
|
|
246
|
+
/chrome-lighthouse/i,
|
|
247
|
+
/chromeframe/i,
|
|
248
|
+
/classifier/i,
|
|
249
|
+
/cloudflare/i,
|
|
250
|
+
/convertify/i,
|
|
251
|
+
/crawl/i,
|
|
252
|
+
/cypress\//i,
|
|
253
|
+
/dareboost/i,
|
|
254
|
+
/datanyze/i,
|
|
255
|
+
/dejaclick/i,
|
|
256
|
+
/detect/i,
|
|
257
|
+
/dmbrowser/i,
|
|
258
|
+
/download/i,
|
|
259
|
+
/exaleadcloudview/i,
|
|
260
|
+
/feed/i,
|
|
261
|
+
/fetcher/i,
|
|
262
|
+
/firephp/i,
|
|
263
|
+
/functionize/i,
|
|
264
|
+
/grab/i,
|
|
265
|
+
/headless/i,
|
|
266
|
+
/httrack/i,
|
|
267
|
+
/hubspot marketing grader/i,
|
|
268
|
+
/ibisbrowser/i,
|
|
269
|
+
/infrawatch/i,
|
|
270
|
+
/insight/i,
|
|
271
|
+
/inspect/i,
|
|
272
|
+
/iplabel/i,
|
|
273
|
+
/java(?!;)/i,
|
|
274
|
+
/library/i,
|
|
275
|
+
/linkcheck/i,
|
|
276
|
+
/mail\.ru\//i,
|
|
277
|
+
/manager/i,
|
|
278
|
+
/measure/i,
|
|
279
|
+
/neustar wpm/i,
|
|
280
|
+
/node\b/i,
|
|
281
|
+
/nutch/i,
|
|
282
|
+
/offbyone/i,
|
|
283
|
+
/onetrust/i,
|
|
284
|
+
/optimize/i,
|
|
285
|
+
/pageburst/i,
|
|
286
|
+
/pagespeed/i,
|
|
287
|
+
/parser/i,
|
|
288
|
+
/phantomjs/i,
|
|
289
|
+
/pingdom/i,
|
|
290
|
+
/powermarks/i,
|
|
291
|
+
/preview/i,
|
|
292
|
+
/proxy/i,
|
|
293
|
+
/ptst[ /]\d/i,
|
|
294
|
+
/retriever/i,
|
|
295
|
+
/rexx;/i,
|
|
296
|
+
/rigor/i,
|
|
297
|
+
/rss\b/i,
|
|
298
|
+
/scrape/i,
|
|
299
|
+
/server/i,
|
|
300
|
+
/sogou/i,
|
|
301
|
+
/sparkler\//i,
|
|
302
|
+
/speedcurve/i,
|
|
303
|
+
/spider/i,
|
|
304
|
+
/splash/i,
|
|
305
|
+
/statuscake/i,
|
|
306
|
+
/supercleaner/i,
|
|
307
|
+
/synapse/i,
|
|
308
|
+
/synthetic/i,
|
|
309
|
+
/tools/i,
|
|
310
|
+
/torrent/i,
|
|
311
|
+
/transcoder/i,
|
|
312
|
+
/url/i,
|
|
313
|
+
/validator/i,
|
|
314
|
+
/virtuoso/i,
|
|
315
|
+
/wappalyzer/i,
|
|
316
|
+
/webglance/i,
|
|
317
|
+
/webkit2png/i,
|
|
318
|
+
/whatcms\//i,
|
|
319
|
+
/xtate\//i
|
|
320
|
+
];
|
|
321
|
+
|
|
322
|
+
var _a$1, _b, _c, _d, _e;
|
|
323
|
+
var AppOpenState;
|
|
324
|
+
(function (AppOpenState) {
|
|
325
|
+
AppOpenState[AppOpenState["Scheme"] = 0] = "Scheme";
|
|
326
|
+
AppOpenState[AppOpenState["Universal"] = 1] = "Universal";
|
|
327
|
+
AppOpenState[AppOpenState["Intent"] = 2] = "Intent";
|
|
328
|
+
AppOpenState[AppOpenState["Fallback"] = 3] = "Fallback";
|
|
329
|
+
AppOpenState[AppOpenState["Store"] = 4] = "Store";
|
|
330
|
+
})(AppOpenState || (AppOpenState = {}));
|
|
331
|
+
var MessengerType;
|
|
332
|
+
(function (MessengerType) {
|
|
333
|
+
MessengerType["Telephone"] = "telephone";
|
|
334
|
+
MessengerType["Message"] = "message";
|
|
335
|
+
MessengerType["Mail"] = "mail";
|
|
336
|
+
})(MessengerType || (MessengerType = {}));
|
|
337
|
+
var SettingType;
|
|
338
|
+
(function (SettingType) {
|
|
339
|
+
SettingType["General"] = "general";
|
|
340
|
+
SettingType["Network"] = "network";
|
|
341
|
+
SettingType["Display"] = "display";
|
|
342
|
+
SettingType["Appearance"] = "appearance";
|
|
343
|
+
SettingType["Accessibility"] = "accessibility";
|
|
344
|
+
SettingType["Battery"] = "battery";
|
|
345
|
+
SettingType["Datetime"] = "datetime";
|
|
346
|
+
SettingType["Language"] = "language";
|
|
347
|
+
SettingType["Accounts"] = "accounts";
|
|
348
|
+
SettingType["Storage"] = "storage";
|
|
349
|
+
})(SettingType || (SettingType = {}));
|
|
350
|
+
var SETTING_URL = (_a$1 = {},
|
|
351
|
+
_a$1[OS.Android] = (_b = {},
|
|
352
|
+
_b[SettingType.General] = 'intent:#Intent;action=android.settings.SETTINGS;end',
|
|
353
|
+
_b[SettingType.Network] = 'intent:#Intent;action=android.settings.WIFI_SETTINGS;end',
|
|
354
|
+
_b[SettingType.Display] = 'intent:#Intent;action=android.settings.DISPLAY_SETTINGS;end',
|
|
355
|
+
_b[SettingType.Appearance] = 'intent:#Intent;action=android.settings.DISPLAY_SETTINGS;end',
|
|
356
|
+
_b[SettingType.Accessibility] = 'intent:#Intent;action=android.settings.ACCESSIBILITY_SETTINGS;end',
|
|
357
|
+
_b[SettingType.Battery] = 'intent:#Intent;action=android.settings.BATTERY_SAVER_SETTINGS;end',
|
|
358
|
+
_b[SettingType.Datetime] = 'intent:#Intent;action=android.settings.DATE_SETTINGS;end',
|
|
359
|
+
_b[SettingType.Language] = 'intent:#Intent;action=android.settings.LOCALE_SETTINGS;end',
|
|
360
|
+
_b[SettingType.Accounts] = 'intent:#Intent;action=android.settings.SYNC_SETTINGS;end',
|
|
361
|
+
_b[SettingType.Storage] = 'intent:#Intent;action=android.settings.INTERNAL_STORAGE_SETTINGS;end',
|
|
362
|
+
_b),
|
|
363
|
+
_a$1[OS.Windows] = (_c = {},
|
|
364
|
+
_c[SettingType.General] = 'ms-settings:system',
|
|
365
|
+
_c[SettingType.Network] = 'ms-settings:network',
|
|
366
|
+
_c[SettingType.Display] = 'ms-settings:display',
|
|
367
|
+
_c[SettingType.Appearance] = 'ms-settings:colors',
|
|
368
|
+
_c[SettingType.Accessibility] = 'ms-settings:easeofaccess',
|
|
369
|
+
_c[SettingType.Battery] = 'ms-settings:batterysaver',
|
|
370
|
+
_c[SettingType.Datetime] = 'ms-settings:dateandtime',
|
|
371
|
+
_c[SettingType.Language] = 'ms-settings:regionlanguage',
|
|
372
|
+
_c[SettingType.Accounts] = 'ms-settings:emailandaccounts',
|
|
373
|
+
_c[SettingType.Storage] = 'ms-settings:storagesense',
|
|
374
|
+
_c),
|
|
375
|
+
_a$1[OS.MacOS] = (_d = {},
|
|
376
|
+
_d[SettingType.General] = 'x-apple.systempreferences:',
|
|
377
|
+
_d[SettingType.Network] = 'x-apple.systempreferences:com.apple.preference.network',
|
|
378
|
+
_d[SettingType.Display] = 'x-apple.systempreferences:com.apple.preference.displays',
|
|
379
|
+
_d[SettingType.Appearance] = 'x-apple.systempreferences:com.apple.preference.general',
|
|
380
|
+
_d[SettingType.Accessibility] = 'x-apple.systempreferences:com.apple.preference.universalaccess',
|
|
381
|
+
_d[SettingType.Battery] = 'x-apple.systempreferences:com.apple.preference.energysaver',
|
|
382
|
+
_d[SettingType.Datetime] = 'x-apple.systempreferences:com.apple.preference.datetime',
|
|
383
|
+
_d[SettingType.Language] = 'x-apple.systempreferences:com.apple.Localization',
|
|
384
|
+
_d[SettingType.Accounts] = 'x-apple.systempreferences:com.apple.preferences.internetaccounts',
|
|
385
|
+
_d[SettingType.Storage] = 'x-apple.systempreferences:',
|
|
386
|
+
_d),
|
|
387
|
+
_a$1['MacOS13+'] = (_e = {},
|
|
388
|
+
_e[SettingType.General] = 'x-apple.systempreferences:com.apple.General-Settings.extension',
|
|
389
|
+
_e[SettingType.Network] = 'x-apple.systempreferences:com.apple.Network-Settings.extension',
|
|
390
|
+
_e[SettingType.Display] = 'x-apple.systempreferences:com.apple.Displays-Settings.extension',
|
|
391
|
+
_e[SettingType.Appearance] = 'x-apple.systempreferences:com.apple.Appearance-Settings.extension',
|
|
392
|
+
_e[SettingType.Accessibility] = 'x-apple.systempreferences:com.apple.Accessibility-Settings.extension',
|
|
393
|
+
_e[SettingType.Battery] = 'x-apple.systempreferences:com.apple.Battery-Settings.extension',
|
|
394
|
+
_e[SettingType.Datetime] = 'x-apple.systempreferences:com.apple.Date-Time-Settings.extension',
|
|
395
|
+
_e[SettingType.Language] = 'x-apple.systempreferences:com.apple.Localization-Settings.extension',
|
|
396
|
+
_e[SettingType.Accounts] = 'x-apple.systempreferences:com.apple.Internet-Accounts-Settings.extension',
|
|
397
|
+
_e[SettingType.Storage] = 'x-apple.systempreferences:com.apple.settings.Storage',
|
|
398
|
+
_e),
|
|
399
|
+
_a$1);
|
|
25
400
|
|
|
26
401
|
function createCustomError(name, Base) {
|
|
27
402
|
if (Base === void 0) { Base = Error; }
|
|
@@ -101,42 +476,2362 @@ function createCustomError(name, Base) {
|
|
|
101
476
|
return CustomError;
|
|
102
477
|
}
|
|
103
478
|
|
|
104
|
-
var
|
|
479
|
+
var URLOpenError = createCustomError('URLOpenError');
|
|
105
480
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
481
|
+
function compareVersion(lhs, rhs) {
|
|
482
|
+
var pa = lhs.split('.');
|
|
483
|
+
var pb = rhs.split('.');
|
|
484
|
+
var length = Math.max(pa.length, pb.length);
|
|
485
|
+
for (var i = 0; i < length; i++) {
|
|
486
|
+
var a = void 0;
|
|
487
|
+
var b = void 0;
|
|
488
|
+
if (i < pa.length)
|
|
489
|
+
a = parseInt(pa[i], 10);
|
|
490
|
+
else
|
|
491
|
+
a = 0;
|
|
492
|
+
if (i < pb.length)
|
|
493
|
+
b = parseInt(pb[i], 10);
|
|
494
|
+
else
|
|
495
|
+
b = 0;
|
|
496
|
+
if (a > b)
|
|
497
|
+
return 1;
|
|
498
|
+
if (a < b)
|
|
499
|
+
return -1;
|
|
500
|
+
}
|
|
501
|
+
return 0;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
function getTopmostWindow() {
|
|
113
505
|
try {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
506
|
+
if (globalThis.top && globalThis.top !== window) {
|
|
507
|
+
void globalThis.top.location.href;
|
|
508
|
+
return globalThis.top;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
catch (_) {
|
|
512
|
+
}
|
|
513
|
+
return window;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
function createHiddenElement(tagName, focusable) {
|
|
517
|
+
if (focusable === void 0) { focusable = true; }
|
|
518
|
+
if (typeof globalThis.document === 'undefined')
|
|
519
|
+
return undefined;
|
|
520
|
+
var element = globalThis.document.createElement(tagName);
|
|
521
|
+
if ('width' in element)
|
|
522
|
+
element.width = '0';
|
|
523
|
+
if ('height' in element)
|
|
524
|
+
element.height = '0';
|
|
525
|
+
if ('border' in element)
|
|
526
|
+
element.border = '0';
|
|
527
|
+
if ('frameBorder' in element)
|
|
528
|
+
element.frameBorder = '0';
|
|
529
|
+
if ('scrolling' in element)
|
|
530
|
+
element.scrolling = 'no';
|
|
531
|
+
if ('cellPadding' in element)
|
|
532
|
+
element.cellPadding = '0';
|
|
533
|
+
if ('cellSpacing' in element)
|
|
534
|
+
element.cellSpacing = '0';
|
|
535
|
+
if ('frame' in element)
|
|
536
|
+
element.frame = 'void';
|
|
537
|
+
if ('rules' in element)
|
|
538
|
+
element.rules = 'none';
|
|
539
|
+
if ('noWrap' in element)
|
|
540
|
+
element.noWrap = true;
|
|
541
|
+
element.tabIndex = -1;
|
|
542
|
+
element.setAttribute('role', 'presentation');
|
|
543
|
+
if (focusable) {
|
|
544
|
+
element.style.width = '1px';
|
|
545
|
+
element.style.height = '1px';
|
|
546
|
+
}
|
|
547
|
+
else {
|
|
548
|
+
element.setAttribute('aria-hidden', 'true');
|
|
549
|
+
element.style.width = '0';
|
|
550
|
+
element.style.height = '0';
|
|
551
|
+
element.style.zIndex = '-9999';
|
|
552
|
+
element.style.display = 'none';
|
|
553
|
+
element.style.visibility = 'hidden';
|
|
554
|
+
element.style.pointerEvents = 'none';
|
|
555
|
+
}
|
|
556
|
+
element.style.position = 'absolute';
|
|
557
|
+
element.style.top = '0';
|
|
558
|
+
element.style.left = '0';
|
|
559
|
+
element.style.padding = '0';
|
|
560
|
+
element.style.margin = '0';
|
|
561
|
+
element.style.border = 'none';
|
|
562
|
+
element.style.outline = 'none';
|
|
563
|
+
element.style.clip = 'rect(1px, 1px, 1px, 1px)';
|
|
564
|
+
element.style.clipPath = 'inset(50%)';
|
|
565
|
+
element.style.overflow = 'hidden';
|
|
566
|
+
element.style.whiteSpace = 'nowrap';
|
|
567
|
+
return element;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
function dispatchClickEvent(element, view) {
|
|
571
|
+
if (view === void 0) { view = window; }
|
|
572
|
+
var fake;
|
|
573
|
+
try {
|
|
574
|
+
fake = new MouseEvent('click', {
|
|
575
|
+
bubbles: true,
|
|
576
|
+
cancelable: true,
|
|
577
|
+
view: view
|
|
119
578
|
});
|
|
120
579
|
}
|
|
121
|
-
|
|
122
|
-
|
|
580
|
+
catch (_) {
|
|
581
|
+
fake = globalThis.document.createEvent('MouseEvents');
|
|
582
|
+
fake.initMouseEvent('click', true, true, view, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
123
583
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
584
|
+
element.dispatchEvent(fake);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
function capitalize(_) {
|
|
588
|
+
var groups = [];
|
|
589
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
590
|
+
groups[_i - 1] = arguments[_i];
|
|
591
|
+
}
|
|
592
|
+
var result = '';
|
|
593
|
+
for (var i = 0; i < groups.length - 2; i++) {
|
|
594
|
+
var arg = groups[i];
|
|
595
|
+
if (typeof arg !== 'undefined')
|
|
596
|
+
result = result + arg.charAt(0).toUpperCase() + arg.slice(1);
|
|
597
|
+
}
|
|
598
|
+
return result;
|
|
599
|
+
}
|
|
600
|
+
function preventDefaultPolyfill() {
|
|
601
|
+
this.returnValue = false;
|
|
602
|
+
}
|
|
603
|
+
function stopPropagationPolyfill() {
|
|
604
|
+
this.cancelBubble = true;
|
|
605
|
+
}
|
|
606
|
+
var EVENT_TYPE_REGEXP = /(animation)(start|iteration|end|cancel)|(transition)(start|run|end|cancel)|(fullscreen)(change|error)|(lost|got)(pointer)(capture)|(pointer)(lock)(change|error)|(pointer)(cancel|down|enter|leave|move|out|over|up)/i;
|
|
607
|
+
var VENDORS = ['', 'webkit', 'moz', 'ms', 'MS', 'o', 'O'];
|
|
608
|
+
var LEGACY_TYPE_MAP = {
|
|
609
|
+
'wheel': ['wheel', 'mousewheel', 'DOMMouseScroll'],
|
|
610
|
+
'focus': ['focus', 'focusin'],
|
|
611
|
+
'blur': ['blur', 'focusout'],
|
|
612
|
+
'beforeinput': ['beforeinput', 'textInput'],
|
|
613
|
+
};
|
|
614
|
+
var EventListenerUtils = {
|
|
615
|
+
useStd: typeof globalThis.document !== 'undefined' && typeof globalThis.document.addEventListener === 'function',
|
|
616
|
+
add: function (target, eventListenerOptions) {
|
|
617
|
+
if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
|
|
618
|
+
var callback = eventListenerOptions.callback;
|
|
619
|
+
if (typeof target === 'undefined' || callback === null)
|
|
620
|
+
return;
|
|
621
|
+
var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
|
|
622
|
+
var options = eventListenerOptions.options;
|
|
623
|
+
if (typeof target.addEventListener === 'function') {
|
|
624
|
+
try {
|
|
625
|
+
return target.addEventListener(type, callback, options);
|
|
626
|
+
}
|
|
627
|
+
catch (_) {
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
if (typeof target.addListener === 'function') {
|
|
631
|
+
if (typeof target.matches === 'boolean') {
|
|
632
|
+
try {
|
|
633
|
+
return target.addListener(callback);
|
|
634
|
+
}
|
|
635
|
+
catch (_) {
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
try {
|
|
640
|
+
return target.addListener(type, callback);
|
|
641
|
+
}
|
|
642
|
+
catch (_) {
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
function wrapper(event) {
|
|
647
|
+
if (typeof event === 'undefined')
|
|
648
|
+
event = globalThis.event;
|
|
649
|
+
if (typeof event === 'undefined')
|
|
650
|
+
return;
|
|
651
|
+
event.currentTarget = target;
|
|
652
|
+
if (typeof event.preventDefault !== 'function')
|
|
653
|
+
event.preventDefault = preventDefaultPolyfill;
|
|
654
|
+
if (typeof event.stopPropagation !== 'function')
|
|
655
|
+
event.stopPropagation = stopPropagationPolyfill;
|
|
656
|
+
if (typeof callback === 'function')
|
|
657
|
+
callback.call(target, event);
|
|
658
|
+
else if (callback && typeof callback.handleEvent === 'function')
|
|
659
|
+
callback.handleEvent.call(target, event);
|
|
660
|
+
}
|
|
661
|
+
if (typeof target.attachEvent === 'function') {
|
|
662
|
+
if (callback.__ieWrapper)
|
|
663
|
+
return target.attachEvent('on' + type, callback.__ieWrapper);
|
|
664
|
+
return target.attachEvent('on' + type, callback.__ieWrapper = wrapper);
|
|
665
|
+
}
|
|
130
666
|
},
|
|
131
|
-
|
|
132
|
-
if (
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
667
|
+
remove: function (target, eventListenerOptions) {
|
|
668
|
+
if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
|
|
669
|
+
var callback = eventListenerOptions.callback;
|
|
670
|
+
if (typeof target === 'undefined' || callback === null)
|
|
671
|
+
return;
|
|
672
|
+
var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
|
|
673
|
+
var options = eventListenerOptions.options;
|
|
674
|
+
if (typeof target.removeEventListener === 'function') {
|
|
675
|
+
try {
|
|
676
|
+
return target.removeEventListener(type, callback, options);
|
|
677
|
+
}
|
|
678
|
+
catch (_) {
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
if (typeof target.removeListener === 'function') {
|
|
682
|
+
if (typeof target.matches === 'boolean') {
|
|
683
|
+
try {
|
|
684
|
+
return target.removeListener(callback);
|
|
685
|
+
}
|
|
686
|
+
catch (_) {
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
else {
|
|
690
|
+
try {
|
|
691
|
+
return target.removeListener(type, callback);
|
|
692
|
+
}
|
|
693
|
+
catch (_) {
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
if (typeof target.detachEvent === 'function') {
|
|
698
|
+
var wrapper = callback.__ieWrapper;
|
|
699
|
+
if (typeof wrapper !== 'undefined') {
|
|
700
|
+
target.detachEvent('on' + type, wrapper);
|
|
701
|
+
delete callback.__ieWrapper;
|
|
702
|
+
}
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
withVender: function (target, type) {
|
|
707
|
+
if (typeof type === 'undefined')
|
|
708
|
+
return '';
|
|
709
|
+
if (target === globalThis.document && ['deviceready', 'pause', 'resume', 'backbutton', 'menubutton', 'searchbutton', 'startcallbutton', 'endcallbutton', 'volumedownbutton', 'volumeupbutton', 'activated', 'cordovacallbackerror'].indexOf(type) > -1)
|
|
710
|
+
return type;
|
|
711
|
+
if (typeof target.webkitEnterFullscreen !== 'undefined' && ['webkitbeginfullscreen', 'webkitendfullscreen', 'webkitpresentationmodechanged'].indexOf(type) > -1)
|
|
712
|
+
return type;
|
|
713
|
+
var types;
|
|
714
|
+
if (type in LEGACY_TYPE_MAP)
|
|
715
|
+
types = LEGACY_TYPE_MAP[type];
|
|
716
|
+
else if (EVENT_TYPE_REGEXP.test(type))
|
|
717
|
+
types = [type, type.replace(EVENT_TYPE_REGEXP, capitalize)];
|
|
718
|
+
else
|
|
719
|
+
types = [type];
|
|
720
|
+
for (var i = 0; i < VENDORS.length; i++) {
|
|
721
|
+
for (var j = 0; j < types.length; j++) {
|
|
722
|
+
var name_1 = VENDORS[i] + types[j];
|
|
723
|
+
if (typeof target['on' + name_1] !== 'undefined')
|
|
724
|
+
return name_1;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return '';
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
var userAgent = USER_AGENT;
|
|
732
|
+
var Platform = {
|
|
733
|
+
get os() {
|
|
734
|
+
return getOS();
|
|
735
|
+
},
|
|
736
|
+
get engine() {
|
|
737
|
+
return getEngine();
|
|
738
|
+
},
|
|
739
|
+
get browser() {
|
|
740
|
+
return getBrowser();
|
|
741
|
+
},
|
|
742
|
+
get userAgent() {
|
|
743
|
+
return userAgent;
|
|
744
|
+
},
|
|
745
|
+
set userAgent(value) {
|
|
746
|
+
userAgent = value;
|
|
747
|
+
},
|
|
748
|
+
get locale() {
|
|
749
|
+
return getLocale();
|
|
750
|
+
},
|
|
751
|
+
get device() {
|
|
752
|
+
return getDevice();
|
|
753
|
+
},
|
|
754
|
+
get renderer() {
|
|
755
|
+
return getRenderer();
|
|
756
|
+
},
|
|
757
|
+
get isWebview() {
|
|
758
|
+
return getIsWebview();
|
|
759
|
+
},
|
|
760
|
+
get isNode() {
|
|
761
|
+
return getIsNode();
|
|
762
|
+
},
|
|
763
|
+
get isStandalone() {
|
|
764
|
+
return getIsStandalone();
|
|
765
|
+
},
|
|
766
|
+
get isBot() {
|
|
767
|
+
return getIsBot();
|
|
768
|
+
},
|
|
769
|
+
Constants: {
|
|
770
|
+
OS: OS,
|
|
771
|
+
Engines: Engines,
|
|
772
|
+
Browsers: Browsers,
|
|
773
|
+
Devices: Devices,
|
|
774
|
+
},
|
|
775
|
+
Errors: {},
|
|
776
|
+
};
|
|
777
|
+
var parsedFromHighEntropyValuesOS = {};
|
|
778
|
+
var parsedFromHighEntropyValuesBrowser = {};
|
|
779
|
+
var parsedFromHighEntropyValuesEngine = {};
|
|
780
|
+
var parsedFromHighEntropyValuesDevice = null;
|
|
781
|
+
function resolveVersion(string, resolver) {
|
|
782
|
+
if (typeof resolver === 'function')
|
|
783
|
+
return resolver(string);
|
|
784
|
+
if (typeof resolver === 'string')
|
|
785
|
+
return resolver;
|
|
786
|
+
if (typeof string === 'undefined')
|
|
787
|
+
return '';
|
|
788
|
+
return string;
|
|
789
|
+
}
|
|
790
|
+
function normalizeBrand(entry) {
|
|
791
|
+
if (entry === null || typeof entry === 'undefined')
|
|
792
|
+
return { brand: '', version: '' };
|
|
793
|
+
if (typeof entry === 'string')
|
|
794
|
+
return { brand: entry, version: '' };
|
|
795
|
+
return { brand: entry.brand, version: entry.version };
|
|
796
|
+
}
|
|
797
|
+
function normalizeLocale(locale) {
|
|
798
|
+
if (locale === null || typeof locale === 'undefined')
|
|
799
|
+
return locale;
|
|
800
|
+
if (locale.length === 0)
|
|
801
|
+
return null;
|
|
802
|
+
locale = locale.replace(/_/g, '-');
|
|
803
|
+
if (locale === 'C' || locale.toLowerCase() === 'posix')
|
|
804
|
+
return 'en-US';
|
|
805
|
+
if (locale.indexOf('.') !== -1)
|
|
806
|
+
return normalizeLocale(locale.split('.')[0]);
|
|
807
|
+
if (locale.indexOf('@') !== -1)
|
|
808
|
+
return normalizeLocale(locale.split('@')[0]);
|
|
809
|
+
var parts = locale.split('-');
|
|
810
|
+
if (parts.length === 0)
|
|
811
|
+
return null;
|
|
812
|
+
parts[0] = parts[0].toLowerCase();
|
|
813
|
+
if (parts.length > 1 && parts[1].length === 2)
|
|
814
|
+
parts[1] = parts[1].toUpperCase();
|
|
815
|
+
if (parts.length > 2 && parts[1].length === 4)
|
|
816
|
+
parts[1] = parts[1].charAt(0).toUpperCase() + parts[1].slice(1).toLowerCase();
|
|
817
|
+
return parts.join('-');
|
|
818
|
+
}
|
|
819
|
+
function getRenderer() {
|
|
820
|
+
if (typeof globalThis.document === 'undefined')
|
|
821
|
+
return '';
|
|
822
|
+
var canvas = globalThis.document.createElement('canvas');
|
|
823
|
+
if (typeof canvas.getContext !== 'function')
|
|
824
|
+
return '';
|
|
825
|
+
var context = canvas.getContext('webgl2') || canvas.getContext('experimental-webgl') || canvas.getContext('webgl');
|
|
826
|
+
if (context === null)
|
|
827
|
+
return '';
|
|
828
|
+
if (context instanceof WebGLRenderingContext || 'getParameter' in context && typeof context.getParameter === 'function') {
|
|
829
|
+
var extension = context.getExtension('WEBGL_debug_renderer_info');
|
|
830
|
+
if (extension === null)
|
|
831
|
+
return context.getParameter(context.RENDERER);
|
|
832
|
+
else
|
|
833
|
+
return context.getParameter(extension.UNMASKED_RENDERER_WEBGL);
|
|
834
|
+
}
|
|
835
|
+
else {
|
|
836
|
+
return '';
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
function getLocale() {
|
|
840
|
+
var locale = {
|
|
841
|
+
language: null,
|
|
842
|
+
languages: [],
|
|
843
|
+
timezone: null,
|
|
844
|
+
offset: 0,
|
|
845
|
+
isRTL: false,
|
|
846
|
+
};
|
|
847
|
+
var isRTL = null;
|
|
848
|
+
function addLanguages(language) {
|
|
849
|
+
for (var i = 0; i < language.length; i++)
|
|
850
|
+
addLanguage(language[i]);
|
|
851
|
+
}
|
|
852
|
+
function addLanguage(language) {
|
|
853
|
+
language = normalizeLocale(language);
|
|
854
|
+
if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
|
|
855
|
+
if (locale.language === null)
|
|
856
|
+
locale.language = language;
|
|
857
|
+
locale.languages.push(language);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
if (typeof Intl !== 'undefined') {
|
|
861
|
+
try {
|
|
862
|
+
addLanguage(Intl.DateTimeFormat().resolvedOptions().locale);
|
|
863
|
+
}
|
|
864
|
+
catch (_) {
|
|
865
|
+
}
|
|
866
|
+
try {
|
|
867
|
+
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
868
|
+
}
|
|
869
|
+
catch (_) {
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
if (typeof globalThis.navigator !== 'undefined') {
|
|
873
|
+
if (typeof globalThis.navigator.languages !== 'undefined')
|
|
874
|
+
addLanguages(globalThis.navigator.languages);
|
|
875
|
+
if (typeof globalThis.navigator.language !== 'undefined')
|
|
876
|
+
addLanguage(globalThis.navigator.language);
|
|
877
|
+
if (typeof globalThis.navigator.userLanguage !== 'undefined')
|
|
878
|
+
addLanguage(globalThis.navigator.userLanguage);
|
|
879
|
+
if (typeof globalThis.navigator.browserLanguage !== 'undefined')
|
|
880
|
+
addLanguage(globalThis.navigator.browserLanguage);
|
|
881
|
+
if (typeof globalThis.navigator.systemLanguage !== 'undefined')
|
|
882
|
+
addLanguage(globalThis.navigator.systemLanguage);
|
|
883
|
+
}
|
|
884
|
+
try {
|
|
885
|
+
locale.offset = new Date().getTimezoneOffset() * -1;
|
|
886
|
+
}
|
|
887
|
+
catch (_) {
|
|
888
|
+
}
|
|
889
|
+
if (typeof locale.language === 'string') {
|
|
890
|
+
if (typeof Intl !== 'undefined' && typeof Intl.Locale !== 'undefined') {
|
|
891
|
+
try {
|
|
892
|
+
var intlLocale = new Intl.Locale(locale.language);
|
|
893
|
+
if (typeof intlLocale.getTextInfo === 'function')
|
|
894
|
+
isRTL = intlLocale.getTextInfo().direction === 'rtl';
|
|
895
|
+
else if (typeof intlLocale.textInfo !== 'undefined')
|
|
896
|
+
isRTL = intlLocale.textInfo.direction === 'rtl';
|
|
897
|
+
}
|
|
898
|
+
catch (_) {
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
if (typeof isRTL !== 'boolean') {
|
|
902
|
+
var matched = /^([A-Za-z]{1,8})(?:[-_][A-Za-z0-9]{1,8})*$/.exec(locale.language);
|
|
903
|
+
if (matched !== null) {
|
|
904
|
+
var language = matched[1].toLowerCase();
|
|
905
|
+
for (var i = 0; i < RTL_LANGUAGES.length; i++) {
|
|
906
|
+
if (RTL_LANGUAGES[i] === language) {
|
|
907
|
+
isRTL = true;
|
|
908
|
+
break;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
if (typeof isRTL === 'boolean')
|
|
915
|
+
locale.isRTL = isRTL;
|
|
916
|
+
return locale;
|
|
917
|
+
}
|
|
918
|
+
function getOS() {
|
|
919
|
+
var result = { name: OS.Unknown, version: '' };
|
|
920
|
+
for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
|
|
921
|
+
var map = OS_RESOLVER_MAP[i];
|
|
922
|
+
var regexp = map[0];
|
|
923
|
+
var os = map[1];
|
|
924
|
+
var resolver = map[2];
|
|
925
|
+
var matched = Platform.userAgent.match(regexp);
|
|
926
|
+
if (matched !== null) {
|
|
927
|
+
result.name = os;
|
|
928
|
+
result.version = resolveVersion(matched[1], resolver);
|
|
929
|
+
break;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
if (result.name === OS.iOS && compareVersion(result.version, '18.6') === 0) {
|
|
933
|
+
var version = /\) Version\/([\d.]+)/.exec(Platform.userAgent);
|
|
934
|
+
if (version !== null && parseInt(version[1].substring(0, 2), 10) >= 26)
|
|
935
|
+
result.version = version[1];
|
|
936
|
+
}
|
|
937
|
+
if (Platform.userAgent === USER_AGENT) {
|
|
938
|
+
if (typeof parsedFromHighEntropyValuesOS.name !== 'undefined')
|
|
939
|
+
result.name = parsedFromHighEntropyValuesOS.name;
|
|
940
|
+
if (typeof parsedFromHighEntropyValuesOS.version !== 'undefined')
|
|
941
|
+
result.version = parsedFromHighEntropyValuesOS.version;
|
|
942
|
+
}
|
|
943
|
+
return result;
|
|
944
|
+
}
|
|
945
|
+
function getEngine() {
|
|
946
|
+
var result = { name: Engines.Unknown, version: '' };
|
|
947
|
+
for (var i = 0; i < ENGINE_RESOLVER_MAP.length; i++) {
|
|
948
|
+
var map = ENGINE_RESOLVER_MAP[i];
|
|
949
|
+
var regexp = map[0];
|
|
950
|
+
var engine = map[1];
|
|
951
|
+
var resolver = map[2];
|
|
952
|
+
var matched = Platform.userAgent.match(regexp);
|
|
953
|
+
if (matched !== null) {
|
|
954
|
+
result.name = engine;
|
|
955
|
+
result.version = resolveVersion(matched[1], resolver);
|
|
956
|
+
break;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
if (Platform.userAgent === USER_AGENT) {
|
|
960
|
+
if (typeof parsedFromHighEntropyValuesEngine.name !== 'undefined')
|
|
961
|
+
result.name = parsedFromHighEntropyValuesEngine.name;
|
|
962
|
+
if (typeof parsedFromHighEntropyValuesEngine.version !== 'undefined')
|
|
963
|
+
result.version = parsedFromHighEntropyValuesEngine.version;
|
|
964
|
+
}
|
|
965
|
+
return result;
|
|
966
|
+
}
|
|
967
|
+
function getBrowser() {
|
|
968
|
+
var result = { name: Browsers.Unknown, version: '' };
|
|
969
|
+
for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
970
|
+
var map = BROWSER_RESOLVER_MAP[i];
|
|
971
|
+
var regexp = map[0];
|
|
972
|
+
var browser = map[1];
|
|
973
|
+
var resolver = map[2];
|
|
974
|
+
var matched = Platform.userAgent.match(regexp);
|
|
975
|
+
if (matched !== null) {
|
|
976
|
+
result.name = browser;
|
|
977
|
+
result.version = resolveVersion(matched[1], resolver);
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
if (Platform.userAgent === USER_AGENT) {
|
|
982
|
+
if (typeof parsedFromHighEntropyValuesBrowser.name !== 'undefined')
|
|
983
|
+
result.name = parsedFromHighEntropyValuesBrowser.name;
|
|
984
|
+
if (typeof parsedFromHighEntropyValuesBrowser.version !== 'undefined')
|
|
985
|
+
result.version = parsedFromHighEntropyValuesBrowser.version;
|
|
986
|
+
}
|
|
987
|
+
return result;
|
|
988
|
+
}
|
|
989
|
+
function getDevice() {
|
|
990
|
+
if (Platform.userAgent === USER_AGENT && parsedFromHighEntropyValuesDevice !== null)
|
|
991
|
+
return parsedFromHighEntropyValuesDevice;
|
|
992
|
+
if (Platform.os.name === OS.iOS || Platform.os.name === OS.Android)
|
|
993
|
+
return Devices.Mobile;
|
|
994
|
+
if (Platform.os.name === OS.Windows || Platform.os.name === OS.MacOS)
|
|
995
|
+
return Devices.Desktop;
|
|
996
|
+
return Devices.Unknown;
|
|
997
|
+
}
|
|
998
|
+
function getIsWebview() {
|
|
999
|
+
return /; ?wv|applewebkit(?!.*safari)/i.test(Platform.userAgent);
|
|
1000
|
+
}
|
|
1001
|
+
function getIsNode() {
|
|
1002
|
+
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.node !== 'undefined';
|
|
1003
|
+
}
|
|
1004
|
+
function getIsStandalone() {
|
|
1005
|
+
if (Platform.os.name === OS.iOS)
|
|
1006
|
+
return 'standalone' in globalThis.navigator && !!globalThis.navigator.standalone;
|
|
1007
|
+
if (!('matchMedia' in globalThis))
|
|
1008
|
+
return false;
|
|
1009
|
+
return globalThis.matchMedia('(display-mode: standalone)').matches;
|
|
1010
|
+
}
|
|
1011
|
+
function getIsBot() {
|
|
1012
|
+
for (var i = 0; i < BOT_REGEXP.length; i++)
|
|
1013
|
+
if (BOT_REGEXP[i].test(Platform.userAgent))
|
|
1014
|
+
return true;
|
|
1015
|
+
return false;
|
|
1016
|
+
}
|
|
1017
|
+
function parseFromHighEntropyValues() {
|
|
1018
|
+
if (typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgentData !== 'undefined' && typeof globalThis.navigator.userAgentData.getHighEntropyValues !== 'undefined') {
|
|
1019
|
+
globalThis.navigator.userAgentData.getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
|
|
1020
|
+
.then(function (result) {
|
|
1021
|
+
try {
|
|
1022
|
+
var brands = result.fullVersionList || result.brands || [];
|
|
1023
|
+
var platformVersion = result.platformVersion;
|
|
1024
|
+
var platform = result.platform;
|
|
1025
|
+
var browserName = Platform.browser.name;
|
|
1026
|
+
var prevBrandName = null;
|
|
1027
|
+
for (var i = 0; i < brands.length; i++) {
|
|
1028
|
+
var brand = normalizeBrand(brands[i]);
|
|
1029
|
+
var brandVersion = brand.version;
|
|
1030
|
+
var brandName = brand.brand;
|
|
1031
|
+
if (/not.a.brand/i.test(brandName))
|
|
1032
|
+
continue;
|
|
1033
|
+
if (prevBrandName === null || (/Chrom/.test(prevBrandName) && brandName !== 'Chromium') || (prevBrandName === 'Edge' && /WebView2/.test(brandName))) {
|
|
1034
|
+
brandName = HIGH_ENTROPY_BRAND_NAME_MAP[brandName] || brandName;
|
|
1035
|
+
prevBrandName = browserName;
|
|
1036
|
+
if (prevBrandName === null || /Chrom/.test(prevBrandName) || !/Chrom/.test(brandName)) {
|
|
1037
|
+
browserName = brandName;
|
|
1038
|
+
if (browserName === 'Chrome' || browserName === 'Chrome WebView' || browserName === 'Chrome Headless')
|
|
1039
|
+
parsedFromHighEntropyValuesBrowser.name = Browsers.Chrome;
|
|
1040
|
+
else if (browserName === 'Edge' || browserName === 'Edge WebView2')
|
|
1041
|
+
parsedFromHighEntropyValuesBrowser.name = Browsers.Edge;
|
|
1042
|
+
else if (browserName === 'Opera Mobi')
|
|
1043
|
+
parsedFromHighEntropyValuesBrowser.name = Browsers.Opera;
|
|
1044
|
+
parsedFromHighEntropyValuesBrowser.version = brandVersion;
|
|
1045
|
+
}
|
|
1046
|
+
prevBrandName = brandName;
|
|
1047
|
+
}
|
|
1048
|
+
if (brandName === 'Chromium')
|
|
1049
|
+
parsedFromHighEntropyValuesEngine.version = brandVersion;
|
|
1050
|
+
}
|
|
1051
|
+
if (typeof platformVersion === 'string') {
|
|
1052
|
+
if (Platform.os.name === OS.Windows)
|
|
1053
|
+
parsedFromHighEntropyValuesOS.version = parseInt(platformVersion.split('.')[0], 10) >= 13 ? '11' : '10';
|
|
1054
|
+
else
|
|
1055
|
+
parsedFromHighEntropyValuesOS.version = platformVersion;
|
|
1056
|
+
}
|
|
1057
|
+
if (typeof platform === 'string') {
|
|
1058
|
+
if (/android/i.test(platform))
|
|
1059
|
+
parsedFromHighEntropyValuesOS.name = OS.Android;
|
|
1060
|
+
else if (/ios|iphone|ipad/i.test(platform))
|
|
1061
|
+
parsedFromHighEntropyValuesOS.name = OS.iOS;
|
|
1062
|
+
else if (/windows|win32/i.test(platform))
|
|
1063
|
+
parsedFromHighEntropyValuesOS.name = OS.Windows;
|
|
1064
|
+
else if (/macos|macintel/i.test(platform))
|
|
1065
|
+
parsedFromHighEntropyValuesOS.name = OS.MacOS;
|
|
1066
|
+
}
|
|
1067
|
+
if (result.mobile === true)
|
|
1068
|
+
parsedFromHighEntropyValuesDevice = Devices.Mobile;
|
|
1069
|
+
}
|
|
1070
|
+
catch (_) {
|
|
1071
|
+
}
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
parseFromHighEntropyValues();
|
|
1076
|
+
|
|
1077
|
+
var _a;
|
|
1078
|
+
var App = {
|
|
1079
|
+
open: open,
|
|
1080
|
+
messenger: (_a = {},
|
|
1081
|
+
_a[MessengerType.Telephone] = openMessengerTelephone,
|
|
1082
|
+
_a[MessengerType.Message] = openMessengerMessage,
|
|
1083
|
+
_a[MessengerType.Mail] = openMessengerMail,
|
|
1084
|
+
_a),
|
|
1085
|
+
setting: setting,
|
|
1086
|
+
file: file,
|
|
1087
|
+
contact: contact,
|
|
1088
|
+
Constants: {
|
|
1089
|
+
AppOpenState: AppOpenState,
|
|
1090
|
+
MessengerType: MessengerType,
|
|
1091
|
+
SettingType: SettingType
|
|
1092
|
+
},
|
|
1093
|
+
Errors: {
|
|
1094
|
+
URLOpenError: URLOpenError,
|
|
1095
|
+
}
|
|
1096
|
+
};
|
|
1097
|
+
function getTrackId(bundle) {
|
|
1098
|
+
try {
|
|
1099
|
+
var xhr = new XMLHttpRequest();
|
|
1100
|
+
xhr.open('GET', 'https://itunes.apple.com/lookup?bundleId=' + bundle, false);
|
|
1101
|
+
xhr.send();
|
|
1102
|
+
if (xhr.status === 200) {
|
|
1103
|
+
try {
|
|
1104
|
+
return parseLookupBundleIdResponse(JSON.parse(xhr.response));
|
|
1105
|
+
}
|
|
1106
|
+
catch (_) {
|
|
1107
|
+
return undefined;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
return undefined;
|
|
1111
|
+
}
|
|
1112
|
+
catch (_) {
|
|
1113
|
+
return undefined;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
function parseLookupBundleIdResponse(response) {
|
|
1117
|
+
if (typeof response.results === 'undefined')
|
|
1118
|
+
return undefined;
|
|
1119
|
+
var results = response.results;
|
|
1120
|
+
if (results.length === 0)
|
|
1121
|
+
return undefined;
|
|
1122
|
+
var result = results[0];
|
|
1123
|
+
if (typeof result === 'undefined')
|
|
1124
|
+
return undefined;
|
|
1125
|
+
return "" + result.trackId;
|
|
1126
|
+
}
|
|
1127
|
+
function createIntentURL(scheme, packageName, fallback) {
|
|
1128
|
+
var split = scheme.split('://');
|
|
1129
|
+
var prefix = split[0];
|
|
1130
|
+
var suffix = split[1];
|
|
1131
|
+
var intent = 'intent://';
|
|
1132
|
+
if (typeof suffix !== 'undefined')
|
|
1133
|
+
intent = intent + suffix;
|
|
1134
|
+
intent = intent + '#Intent;'
|
|
1135
|
+
+ 'scheme=' + prefix + ';'
|
|
1136
|
+
+ 'action=android.intent.action.VIEW;'
|
|
1137
|
+
+ 'category=android.intent.category.BROWSABLE;';
|
|
1138
|
+
if (typeof packageName !== 'undefined')
|
|
1139
|
+
intent = intent + 'package=' + packageName + ';';
|
|
1140
|
+
if (typeof fallback !== 'undefined' && typeof fallback === 'string')
|
|
1141
|
+
intent = intent + 'S.browser_fallback_url=' + encodeURIComponent(fallback) + ';';
|
|
1142
|
+
else if (typeof packageName !== 'undefined')
|
|
1143
|
+
intent = intent + 'S.browser_fallback_url=' + encodeURIComponent(createAppStoreURL(packageName, OS.Android)) + ';';
|
|
1144
|
+
return intent + 'end';
|
|
1145
|
+
}
|
|
1146
|
+
function parseIntentURL(intent) {
|
|
1147
|
+
var parsed = {};
|
|
1148
|
+
var split = intent.split('#Intent;');
|
|
1149
|
+
var host = split[0].substring(9);
|
|
1150
|
+
var suffix = split[1];
|
|
1151
|
+
var parameterString = suffix.substring(0, suffix.length - 4);
|
|
1152
|
+
var parameters = parameterString.split(';');
|
|
1153
|
+
var extras = {};
|
|
1154
|
+
for (var i = 0; i < parameters.length; i++) {
|
|
1155
|
+
var part = parameters[i];
|
|
1156
|
+
var index = part.indexOf('=');
|
|
1157
|
+
if (index !== -1)
|
|
1158
|
+
extras[part.substring(0, index)] = part.substring(index + 1);
|
|
1159
|
+
}
|
|
1160
|
+
if (typeof extras['scheme'] !== 'undefined')
|
|
1161
|
+
parsed.scheme = (extras['scheme'] + '://' + host);
|
|
1162
|
+
if (typeof extras['package'] !== 'undefined')
|
|
1163
|
+
parsed.packageName = extras['package'];
|
|
1164
|
+
if (typeof extras['S.browser_fallback_url'] !== 'undefined')
|
|
1165
|
+
parsed.fallback = extras['S.browser_fallback_url'];
|
|
1166
|
+
return parsed;
|
|
1167
|
+
}
|
|
1168
|
+
function createAppStoreURL(packageName, os) {
|
|
1169
|
+
if (typeof packageName === 'undefined')
|
|
1170
|
+
return undefined;
|
|
1171
|
+
switch (os) {
|
|
1172
|
+
case OS.Android:
|
|
1173
|
+
return 'market://details?id=' + packageName;
|
|
1174
|
+
case OS.iOS:
|
|
1175
|
+
return 'itms-apps://itunes.apple.com/app/id' + packageName + '?mt=8';
|
|
1176
|
+
case OS.Windows:
|
|
1177
|
+
return 'ms-windows-store://pdp/?ProductId=' + packageName;
|
|
1178
|
+
case OS.MacOS:
|
|
1179
|
+
return 'macappstore://itunes.apple.com/app/id' + packageName + '?mt=12';
|
|
1180
|
+
default:
|
|
1181
|
+
throw new URLOpenError('Unsupported OS: \"' + Platform.userAgent + '\"');
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
function createWebStoreURL(packageName, os) {
|
|
1185
|
+
if (typeof packageName === 'undefined')
|
|
1186
|
+
return undefined;
|
|
1187
|
+
switch (os) {
|
|
1188
|
+
case OS.Android:
|
|
1189
|
+
return 'https://play.google.com/store/apps/details?id=' + packageName;
|
|
1190
|
+
case OS.iOS:
|
|
1191
|
+
return 'https://itunes.apple.com/app/id' + packageName + '?mt=8';
|
|
1192
|
+
case OS.Windows:
|
|
1193
|
+
return 'https://apps.microsoft.com/detail/' + packageName;
|
|
1194
|
+
case OS.MacOS:
|
|
1195
|
+
return 'https://apps.apple.com/app/id' + packageName + '?mt=12';
|
|
1196
|
+
default:
|
|
1197
|
+
throw new URLOpenError('Unsupported OS: \"' + Platform.userAgent + '\"');
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
function getDefaultTimeoutByOS(os) {
|
|
1201
|
+
switch (os) {
|
|
1202
|
+
case OS.iOS:
|
|
1203
|
+
return 2000;
|
|
1204
|
+
case OS.Android:
|
|
1205
|
+
return 1000;
|
|
1206
|
+
default:
|
|
1207
|
+
return 750;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
function canOpenIntentURL() {
|
|
1211
|
+
if (Platform.os.name !== OS.Android)
|
|
1212
|
+
return false;
|
|
1213
|
+
var version = Platform.browser.version;
|
|
1214
|
+
if (Platform.browser.name === Browsers.SamsungInternet && compareVersion(version, '17.0.1.69') >= 0 && compareVersion(version, '17.0.7.34') < 0)
|
|
1215
|
+
return false;
|
|
1216
|
+
if (Platform.browser.name === Browsers.Firefox && compareVersion(version, '41.0') < 0)
|
|
1217
|
+
return false;
|
|
1218
|
+
if (Platform.browser.name === Browsers.Firefox && compareVersion(version, '58.0') >= 0 && compareVersion(version, '68.11.0') < 0)
|
|
1219
|
+
return false;
|
|
1220
|
+
if (Platform.browser.name === Browsers.Firefox && compareVersion(version, '79.0') >= 0 && compareVersion(version, '81.2.0') < 0)
|
|
1221
|
+
return false;
|
|
1222
|
+
if (Platform.browser.name === Browsers.Firefox && compareVersion(version, '96.0') >= 0 && compareVersion(version, '107.0') < 0)
|
|
1223
|
+
return false;
|
|
1224
|
+
if (Platform.browser.name === Browsers.Opera && compareVersion(version, '14.0') < 0)
|
|
1225
|
+
return false;
|
|
1226
|
+
return !(/(?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/[\w.]+;/i.test(Platform.userAgent) || /instagram[\/ ][-\w.]+/i.test(Platform.userAgent) || /micromessenger\/([\w.]+)/i.test(Platform.userAgent) || /musical_ly(?:.+app_?version\/|_)[\w.]+/i.test(Platform.userAgent) || /ultralite app_version\/[\w.]+/i.test(Platform.userAgent));
|
|
1227
|
+
}
|
|
1228
|
+
function canOpenUniversalURL() {
|
|
1229
|
+
return Platform.os.name === OS.iOS && compareVersion(Platform.os.version, '9.0') >= 0;
|
|
1230
|
+
}
|
|
1231
|
+
function getURLOpenError(tried) {
|
|
1232
|
+
var triedURLString = '';
|
|
1233
|
+
for (var i = 0; i < tried.length; i++)
|
|
1234
|
+
triedURLString += '\n' + (i + 1) + ': ' + tried[i];
|
|
1235
|
+
if (triedURLString.length > 0)
|
|
1236
|
+
triedURLString = '\n' + triedURLString + '\n';
|
|
1237
|
+
return new URLOpenError('Failed to open any of the provided URLs: ' + triedURLString);
|
|
1238
|
+
}
|
|
1239
|
+
function openURLViaHref(url, index) {
|
|
1240
|
+
var top = getTopmostWindow();
|
|
1241
|
+
var topDocument = top.document;
|
|
1242
|
+
var a = undefined;
|
|
1243
|
+
try {
|
|
1244
|
+
if (index === 0) {
|
|
1245
|
+
top.location.href = url;
|
|
1246
|
+
return;
|
|
1247
|
+
}
|
|
1248
|
+
a = createHiddenElement('a');
|
|
1249
|
+
if (typeof a === 'undefined')
|
|
1250
|
+
return;
|
|
1251
|
+
a.href = url;
|
|
1252
|
+
topDocument.body.appendChild(a);
|
|
1253
|
+
dispatchClickEvent(a, top);
|
|
1254
|
+
return a;
|
|
1255
|
+
}
|
|
1256
|
+
catch (_) {
|
|
1257
|
+
}
|
|
1258
|
+
finally {
|
|
1259
|
+
if (typeof a !== 'undefined') {
|
|
1260
|
+
try {
|
|
1261
|
+
topDocument.body.removeChild(a);
|
|
1262
|
+
}
|
|
1263
|
+
catch (_) {
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
function openURLViaIframe(url) {
|
|
1269
|
+
var top = getTopmostWindow();
|
|
1270
|
+
var topDocument = top.document;
|
|
1271
|
+
var iframe = undefined;
|
|
1272
|
+
try {
|
|
1273
|
+
iframe = createHiddenElement('iframe');
|
|
1274
|
+
if (typeof iframe === 'undefined')
|
|
1275
|
+
return;
|
|
1276
|
+
iframe.src = url;
|
|
1277
|
+
topDocument.body.appendChild(iframe);
|
|
1278
|
+
globalThis.setTimeout(function () {
|
|
1279
|
+
if (typeof iframe !== 'undefined') {
|
|
1280
|
+
try {
|
|
1281
|
+
topDocument.body.removeChild(iframe);
|
|
1282
|
+
}
|
|
1283
|
+
catch (_) {
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
}, 500);
|
|
139
1287
|
}
|
|
1288
|
+
catch (_) {
|
|
1289
|
+
}
|
|
1290
|
+
return iframe;
|
|
1291
|
+
}
|
|
1292
|
+
function isDocumentHidden() {
|
|
1293
|
+
var top = getTopmostWindow();
|
|
1294
|
+
var topDocument = top.document;
|
|
1295
|
+
if (topDocument.visibilityState === 'hidden')
|
|
1296
|
+
return true;
|
|
1297
|
+
if (topDocument.webkitVisibilityState === 'hidden')
|
|
1298
|
+
return true;
|
|
1299
|
+
if (topDocument.mozVisibilityState === 'hidden')
|
|
1300
|
+
return true;
|
|
1301
|
+
if (topDocument.msVisibilityState === 'hidden')
|
|
1302
|
+
return true;
|
|
1303
|
+
if (typeof topDocument.hidden !== 'undefined')
|
|
1304
|
+
return topDocument.hidden;
|
|
1305
|
+
if (typeof topDocument.webkitHidden !== 'undefined')
|
|
1306
|
+
return topDocument.webkitHidden;
|
|
1307
|
+
if (typeof topDocument.mozHidden !== 'undefined')
|
|
1308
|
+
return topDocument.mozHidden;
|
|
1309
|
+
if (typeof topDocument.msHidden !== 'undefined')
|
|
1310
|
+
return topDocument.msHidden;
|
|
1311
|
+
if (typeof topDocument.hasFocus === 'function')
|
|
1312
|
+
return !topDocument.hasFocus();
|
|
1313
|
+
return true;
|
|
1314
|
+
}
|
|
1315
|
+
function hasFocus(document) {
|
|
1316
|
+
if (typeof document.hasFocus === 'function')
|
|
1317
|
+
return document.hasFocus();
|
|
1318
|
+
return false;
|
|
1319
|
+
}
|
|
1320
|
+
function focus(target) {
|
|
1321
|
+
try {
|
|
1322
|
+
target.focus({ preventScroll: true });
|
|
1323
|
+
}
|
|
1324
|
+
catch (_) {
|
|
1325
|
+
try {
|
|
1326
|
+
target.focus();
|
|
1327
|
+
}
|
|
1328
|
+
catch (_) {
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
function restoreFocus() {
|
|
1333
|
+
var top = getTopmostWindow();
|
|
1334
|
+
var topDocument = top.document;
|
|
1335
|
+
focus(top);
|
|
1336
|
+
if (hasFocus(topDocument))
|
|
1337
|
+
return true;
|
|
1338
|
+
if (topDocument.body.tabIndex < 0)
|
|
1339
|
+
topDocument.body.tabIndex = -1;
|
|
1340
|
+
focus(topDocument.body);
|
|
1341
|
+
if (hasFocus(topDocument))
|
|
1342
|
+
return true;
|
|
1343
|
+
var input = undefined;
|
|
1344
|
+
try {
|
|
1345
|
+
input = createHiddenElement('input');
|
|
1346
|
+
if (typeof input === 'undefined')
|
|
1347
|
+
return false;
|
|
1348
|
+
input.type = 'text';
|
|
1349
|
+
input.readOnly = true;
|
|
1350
|
+
topDocument.body.appendChild(input);
|
|
1351
|
+
focus(input);
|
|
1352
|
+
try {
|
|
1353
|
+
input.select();
|
|
1354
|
+
}
|
|
1355
|
+
catch (_) {
|
|
1356
|
+
}
|
|
1357
|
+
if (hasFocus(topDocument))
|
|
1358
|
+
return true;
|
|
1359
|
+
}
|
|
1360
|
+
catch (_) {
|
|
1361
|
+
}
|
|
1362
|
+
finally {
|
|
1363
|
+
if (typeof input !== 'undefined' && input !== null) {
|
|
1364
|
+
try {
|
|
1365
|
+
input.blur();
|
|
1366
|
+
}
|
|
1367
|
+
catch (_) {
|
|
1368
|
+
}
|
|
1369
|
+
try {
|
|
1370
|
+
topDocument.body.removeChild(input);
|
|
1371
|
+
}
|
|
1372
|
+
catch (_) {
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
return hasFocus(topDocument);
|
|
1377
|
+
}
|
|
1378
|
+
function tryOpenURL(url, index, timeout) {
|
|
1379
|
+
var top = getTopmostWindow();
|
|
1380
|
+
var topDocument = top.document;
|
|
1381
|
+
var eventType = { focus: undefined, blur: undefined, visibilitychange: undefined };
|
|
1382
|
+
var eventTarget = { focus: undefined, blur: undefined, visibilitychange: undefined };
|
|
1383
|
+
if (typeof globalThis.cordova !== 'undefined') {
|
|
1384
|
+
eventTarget = { focus: topDocument, blur: topDocument };
|
|
1385
|
+
eventType = { focus: 'resume', blur: 'pause' };
|
|
1386
|
+
}
|
|
1387
|
+
else if (Platform.os.name === OS.iOS) {
|
|
1388
|
+
if (compareVersion(Platform.os.version, '8.0') >= 0) {
|
|
1389
|
+
eventTarget = { visibilitychange: topDocument };
|
|
1390
|
+
eventType = { visibilitychange: 'visibilitychange' };
|
|
1391
|
+
}
|
|
1392
|
+
else {
|
|
1393
|
+
eventTarget = { focus: top, blur: top };
|
|
1394
|
+
eventType = { focus: 'pageshow', blur: 'pagehide' };
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
else {
|
|
1398
|
+
if (EventListenerUtils.useStd) {
|
|
1399
|
+
eventTarget = { focus: top, blur: top, visibilitychange: topDocument };
|
|
1400
|
+
eventType = { focus: 'focus', blur: 'blur', visibilitychange: 'visibilitychange' };
|
|
1401
|
+
}
|
|
1402
|
+
else {
|
|
1403
|
+
eventTarget = { focus: topDocument, blur: topDocument, visibilitychange: topDocument };
|
|
1404
|
+
eventType = { focus: 'focus', blur: 'blur', visibilitychange: 'visibilitychange' };
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
var a = undefined;
|
|
1408
|
+
var iframe = undefined;
|
|
1409
|
+
return new Promise(function (resolve, reject) {
|
|
1410
|
+
var timeoutId;
|
|
1411
|
+
var resolved = false;
|
|
1412
|
+
function cleanup() {
|
|
1413
|
+
if (typeof timeoutId !== 'undefined') {
|
|
1414
|
+
clearTimeout(timeoutId);
|
|
1415
|
+
timeoutId = undefined;
|
|
1416
|
+
}
|
|
1417
|
+
try {
|
|
1418
|
+
EventListenerUtils.remove(eventTarget.blur, { type: eventType.blur, callback: onBlur });
|
|
1419
|
+
EventListenerUtils.remove(eventTarget.focus, { type: eventType.focus, callback: onFocus });
|
|
1420
|
+
EventListenerUtils.remove(eventTarget.visibilitychange, { type: eventType.visibilitychange, callback: onVisibilityChange });
|
|
1421
|
+
}
|
|
1422
|
+
catch (_) {
|
|
1423
|
+
}
|
|
1424
|
+
if (typeof a !== 'undefined') {
|
|
1425
|
+
try {
|
|
1426
|
+
topDocument.body.removeChild(a);
|
|
1427
|
+
}
|
|
1428
|
+
catch (_) {
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
if (typeof iframe !== 'undefined') {
|
|
1432
|
+
try {
|
|
1433
|
+
topDocument.body.removeChild(iframe);
|
|
1434
|
+
}
|
|
1435
|
+
catch (_) {
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
function done(success) {
|
|
1440
|
+
if (resolved)
|
|
1441
|
+
return;
|
|
1442
|
+
resolved = true;
|
|
1443
|
+
try {
|
|
1444
|
+
cleanup();
|
|
1445
|
+
if (success)
|
|
1446
|
+
resolve();
|
|
1447
|
+
else
|
|
1448
|
+
reject();
|
|
1449
|
+
}
|
|
1450
|
+
catch (_) {
|
|
1451
|
+
resolve();
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
function onBlur() {
|
|
1455
|
+
if (typeof timeoutId !== 'undefined') {
|
|
1456
|
+
clearTimeout(timeoutId);
|
|
1457
|
+
timeoutId = undefined;
|
|
1458
|
+
}
|
|
1459
|
+
EventListenerUtils.remove(eventTarget.blur, { type: eventType.blur, callback: onBlur });
|
|
1460
|
+
EventListenerUtils.add(eventTarget.focus, { type: eventType.focus, callback: onFocus });
|
|
1461
|
+
}
|
|
1462
|
+
function onFocus() {
|
|
1463
|
+
done(true);
|
|
1464
|
+
}
|
|
1465
|
+
function onVisibilityChange() {
|
|
1466
|
+
if (isDocumentHidden())
|
|
1467
|
+
done(true);
|
|
1468
|
+
}
|
|
1469
|
+
timeoutId = globalThis.setTimeout(function () {
|
|
1470
|
+
done(false);
|
|
1471
|
+
}, timeout);
|
|
1472
|
+
EventListenerUtils.add(eventTarget.blur, { type: eventType.blur, callback: onBlur });
|
|
1473
|
+
EventListenerUtils.add(eventTarget.visibilitychange, { type: eventType.visibilitychange, callback: onVisibilityChange });
|
|
1474
|
+
if (!hasFocus(topDocument))
|
|
1475
|
+
restoreFocus();
|
|
1476
|
+
try {
|
|
1477
|
+
if (typeof globalThis.cordova !== 'undefined') {
|
|
1478
|
+
globalThis.open(url, '_system');
|
|
1479
|
+
}
|
|
1480
|
+
else {
|
|
1481
|
+
a = openURLViaHref(url, index);
|
|
1482
|
+
iframe = openURLViaIframe(url);
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
catch (_) {
|
|
1486
|
+
done(false);
|
|
1487
|
+
}
|
|
1488
|
+
});
|
|
1489
|
+
}
|
|
1490
|
+
function open(options) {
|
|
1491
|
+
var os = Platform.os.name;
|
|
1492
|
+
var urls = [];
|
|
1493
|
+
var tried = [];
|
|
1494
|
+
var infos = {};
|
|
1495
|
+
var timeout;
|
|
1496
|
+
if (os === OS.Android) {
|
|
1497
|
+
var option = options[OS.Android] || options['android'];
|
|
1498
|
+
if (typeof option === 'undefined')
|
|
1499
|
+
return Promise.reject(getURLOpenError(tried));
|
|
1500
|
+
timeout = option.timeout;
|
|
1501
|
+
infos.scheme = urlToString(option.scheme);
|
|
1502
|
+
infos.intent = urlToString(option.intent);
|
|
1503
|
+
infos.packageName = option.packageName;
|
|
1504
|
+
infos.fallback = urlToString(option.fallback);
|
|
1505
|
+
infos.appStore = createAppStoreURL(infos.packageName, OS.Android);
|
|
1506
|
+
infos.webStore = createWebStoreURL(infos.packageName, OS.Android);
|
|
1507
|
+
infos.allowAppStore = option.allowAppStore;
|
|
1508
|
+
infos.allowWebStore = option.allowWebStore;
|
|
1509
|
+
if (typeof infos.intent !== 'undefined' && (typeof infos.scheme === 'undefined' || typeof infos.packageName === 'undefined' || typeof infos.fallback === 'undefined')) {
|
|
1510
|
+
var parsed = parseIntentURL(infos.intent);
|
|
1511
|
+
if (typeof parsed.scheme !== 'undefined' && typeof infos.scheme === 'undefined')
|
|
1512
|
+
infos.scheme = parsed.scheme;
|
|
1513
|
+
if (typeof parsed.packageName !== 'undefined' && typeof infos.packageName === 'undefined')
|
|
1514
|
+
infos.packageName = parsed.packageName;
|
|
1515
|
+
if (typeof parsed.fallback !== 'undefined' && typeof infos.fallback === 'undefined')
|
|
1516
|
+
infos.fallback = parsed.fallback;
|
|
1517
|
+
}
|
|
1518
|
+
if (typeof infos.scheme !== 'undefined' && typeof infos.intent === 'undefined')
|
|
1519
|
+
infos.intent = createIntentURL(infos.scheme, infos.packageName, infos.fallback);
|
|
1520
|
+
}
|
|
1521
|
+
else if (os === OS.iOS) {
|
|
1522
|
+
var option = options[OS.iOS] || options['ios'];
|
|
1523
|
+
if (typeof option === 'undefined')
|
|
1524
|
+
return Promise.reject(getURLOpenError(tried));
|
|
1525
|
+
timeout = option.timeout;
|
|
1526
|
+
infos.scheme = urlToString(option.scheme);
|
|
1527
|
+
infos.bundleId = option.bundleId;
|
|
1528
|
+
infos.trackId = option.trackId;
|
|
1529
|
+
infos.universal = urlToString(option.universal);
|
|
1530
|
+
infos.fallback = urlToString(option.fallback);
|
|
1531
|
+
infos.appStore = createAppStoreURL(infos.trackId, OS.iOS);
|
|
1532
|
+
infos.webStore = createWebStoreURL(infos.trackId, OS.iOS);
|
|
1533
|
+
infos.allowAppStore = option.allowAppStore;
|
|
1534
|
+
infos.allowWebStore = option.allowWebStore;
|
|
1535
|
+
if (typeof infos.bundleId !== 'undefined' && typeof infos.trackId === 'undefined')
|
|
1536
|
+
infos.trackId = getTrackId(infos.bundleId);
|
|
1537
|
+
}
|
|
1538
|
+
else if (os === OS.Windows) {
|
|
1539
|
+
var option = options[OS.Windows] || options['windows'];
|
|
1540
|
+
if (typeof option === 'undefined')
|
|
1541
|
+
return Promise.reject(getURLOpenError(tried));
|
|
1542
|
+
timeout = option.timeout;
|
|
1543
|
+
infos.scheme = urlToString(option.scheme);
|
|
1544
|
+
infos.productId = option.productId;
|
|
1545
|
+
infos.fallback = urlToString(option.fallback);
|
|
1546
|
+
infos.appStore = createAppStoreURL(infos.productId, OS.Windows);
|
|
1547
|
+
infos.webStore = createWebStoreURL(infos.productId, OS.Windows);
|
|
1548
|
+
infos.allowAppStore = option.allowAppStore;
|
|
1549
|
+
infos.allowWebStore = option.allowWebStore;
|
|
1550
|
+
}
|
|
1551
|
+
else if (os === OS.MacOS) {
|
|
1552
|
+
var option = options[OS.MacOS] || options['macos'];
|
|
1553
|
+
if (typeof option === 'undefined')
|
|
1554
|
+
return Promise.reject(getURLOpenError(tried));
|
|
1555
|
+
timeout = option.timeout;
|
|
1556
|
+
infos.scheme = urlToString(option.scheme);
|
|
1557
|
+
infos.bundleId = option.bundleId;
|
|
1558
|
+
infos.trackId = option.trackId;
|
|
1559
|
+
infos.fallback = urlToString(option.fallback);
|
|
1560
|
+
infos.appStore = createAppStoreURL(infos.trackId, OS.MacOS);
|
|
1561
|
+
infos.webStore = createWebStoreURL(infos.trackId, OS.MacOS);
|
|
1562
|
+
infos.allowAppStore = option.allowAppStore;
|
|
1563
|
+
infos.allowWebStore = option.allowWebStore;
|
|
1564
|
+
if (typeof infos.bundleId !== 'undefined' && typeof infos.trackId === 'undefined')
|
|
1565
|
+
infos.trackId = getTrackId(infos.bundleId);
|
|
1566
|
+
}
|
|
1567
|
+
pushURL(urls, infos.intent, AppOpenState.Intent, canOpenIntentURL());
|
|
1568
|
+
pushURL(urls, infos.universal, AppOpenState.Universal, canOpenUniversalURL());
|
|
1569
|
+
pushURL(urls, infos.scheme, AppOpenState.Scheme, true);
|
|
1570
|
+
pushURL(urls, infos.fallback, AppOpenState.Fallback, true);
|
|
1571
|
+
pushURL(urls, infos.appStore, AppOpenState.Store, infos.allowAppStore);
|
|
1572
|
+
pushURL(urls, infos.webStore, AppOpenState.Store, infos.allowWebStore);
|
|
1573
|
+
if (typeof timeout === 'undefined')
|
|
1574
|
+
timeout = getDefaultTimeoutByOS(os);
|
|
1575
|
+
return new Promise(function (resolve, reject) {
|
|
1576
|
+
function openURLSequential(index) {
|
|
1577
|
+
if (index === void 0) { index = 0; }
|
|
1578
|
+
if (index >= urls.length)
|
|
1579
|
+
return reject(getURLOpenError(tried));
|
|
1580
|
+
var entry = urls[index];
|
|
1581
|
+
var state = entry[0];
|
|
1582
|
+
var url = entry[1];
|
|
1583
|
+
if (typeof url === 'string') {
|
|
1584
|
+
tried[index] = url;
|
|
1585
|
+
return tryOpenURL(url, index, timeout)
|
|
1586
|
+
.then(function () {
|
|
1587
|
+
resolve(state);
|
|
1588
|
+
})
|
|
1589
|
+
.catch(function () {
|
|
1590
|
+
openURLSequential(index + 1);
|
|
1591
|
+
});
|
|
1592
|
+
}
|
|
1593
|
+
else {
|
|
1594
|
+
tried[index] = '[function fallback]';
|
|
1595
|
+
url();
|
|
1596
|
+
resolve(state);
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
return openURLSequential();
|
|
1600
|
+
});
|
|
1601
|
+
}
|
|
1602
|
+
function pushURL(urls, url, state, condition) {
|
|
1603
|
+
if (condition === void 0) { condition = false; }
|
|
1604
|
+
if ((typeof url === 'function' || typeof url === 'string') && condition)
|
|
1605
|
+
urls.push([state, url]);
|
|
1606
|
+
}
|
|
1607
|
+
function isArrayLike(value) {
|
|
1608
|
+
if (value == null || typeof value === 'string')
|
|
1609
|
+
return false;
|
|
1610
|
+
var length = value.length;
|
|
1611
|
+
return typeof length === 'number' && length >= 0 && !(length % 1);
|
|
1612
|
+
}
|
|
1613
|
+
function joining(values, mapfn, separator) {
|
|
1614
|
+
if (separator === void 0) { separator = ','; }
|
|
1615
|
+
var length = values.length;
|
|
1616
|
+
var result = '';
|
|
1617
|
+
for (var i = 0; i < length; i++) {
|
|
1618
|
+
result = result + mapfn(values[i]);
|
|
1619
|
+
if (i !== length - 1)
|
|
1620
|
+
result = result + separator;
|
|
1621
|
+
}
|
|
1622
|
+
return result;
|
|
1623
|
+
}
|
|
1624
|
+
function encode(value) {
|
|
1625
|
+
return encodeURIComponent(value)
|
|
1626
|
+
.replace(/[!'()*]/g, function (c) {
|
|
1627
|
+
return '%' + c.charCodeAt(0).toString(16);
|
|
1628
|
+
});
|
|
1629
|
+
}
|
|
1630
|
+
function urlToString(value) {
|
|
1631
|
+
if (value instanceof URL)
|
|
1632
|
+
return value.toString();
|
|
1633
|
+
return value;
|
|
1634
|
+
}
|
|
1635
|
+
function stringifiableToString(value) {
|
|
1636
|
+
if (typeof value === 'string')
|
|
1637
|
+
return encode(value);
|
|
1638
|
+
if (typeof value === 'number' || typeof value === 'boolean')
|
|
1639
|
+
return encode(String(value));
|
|
1640
|
+
if (value == null)
|
|
1641
|
+
return '';
|
|
1642
|
+
if (isArrayLike(value))
|
|
1643
|
+
return joining(value, function (v) {
|
|
1644
|
+
return stringifiableToString(v);
|
|
1645
|
+
});
|
|
1646
|
+
if (value instanceof HTMLInputElement) {
|
|
1647
|
+
var type = value.type;
|
|
1648
|
+
if (type === 'checkbox') {
|
|
1649
|
+
return encode(value.checked.toString());
|
|
1650
|
+
}
|
|
1651
|
+
else if (type === 'radio') {
|
|
1652
|
+
if (value.checked)
|
|
1653
|
+
return encode(value.value);
|
|
1654
|
+
else
|
|
1655
|
+
return '';
|
|
1656
|
+
}
|
|
1657
|
+
else if (type === 'file') {
|
|
1658
|
+
var files = value.files;
|
|
1659
|
+
if (files === null)
|
|
1660
|
+
return '';
|
|
1661
|
+
return joining(files, function (file) {
|
|
1662
|
+
return encode(file.name);
|
|
1663
|
+
});
|
|
1664
|
+
}
|
|
1665
|
+
else {
|
|
1666
|
+
return encode(value.value);
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
if (value instanceof HTMLSelectElement) {
|
|
1670
|
+
if (value.multiple)
|
|
1671
|
+
return joining(value.selectedOptions, function (option) {
|
|
1672
|
+
return encode(option.value);
|
|
1673
|
+
});
|
|
1674
|
+
return encode(value.value);
|
|
1675
|
+
}
|
|
1676
|
+
if (value instanceof HTMLTextAreaElement)
|
|
1677
|
+
return encode(value.value);
|
|
1678
|
+
if (value instanceof HTMLElement)
|
|
1679
|
+
return encode(value.innerText);
|
|
1680
|
+
if (value instanceof Node)
|
|
1681
|
+
return stringifiableToString(value.textContent);
|
|
1682
|
+
return encode(value.toString());
|
|
1683
|
+
}
|
|
1684
|
+
function normalize(value) {
|
|
1685
|
+
if (value instanceof HTMLFormElement)
|
|
1686
|
+
return normalize(new FormData(value));
|
|
1687
|
+
if (value instanceof FormData) {
|
|
1688
|
+
var result_1 = {};
|
|
1689
|
+
value.forEach(function (value, key) {
|
|
1690
|
+
var name;
|
|
1691
|
+
if (value instanceof File)
|
|
1692
|
+
name = value.name;
|
|
1693
|
+
else
|
|
1694
|
+
name = value;
|
|
1695
|
+
if (Object.prototype.hasOwnProperty.call(result_1, key)) {
|
|
1696
|
+
var prev = result_1[key];
|
|
1697
|
+
if (Array.isArray(prev))
|
|
1698
|
+
prev.push(name);
|
|
1699
|
+
else
|
|
1700
|
+
result_1[key] = [prev, name];
|
|
1701
|
+
}
|
|
1702
|
+
else {
|
|
1703
|
+
result_1[key] = name;
|
|
1704
|
+
}
|
|
1705
|
+
});
|
|
1706
|
+
return normalize(result_1);
|
|
1707
|
+
}
|
|
1708
|
+
var result = {};
|
|
1709
|
+
var keys = Object.keys(value);
|
|
1710
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1711
|
+
var key = keys[i];
|
|
1712
|
+
result[key] = stringifiableToString(value[key]);
|
|
1713
|
+
}
|
|
1714
|
+
if (typeof result.to === 'undefined')
|
|
1715
|
+
result.to = '';
|
|
1716
|
+
if (typeof result.cc === 'undefined')
|
|
1717
|
+
result.cc = '';
|
|
1718
|
+
if (typeof result.bcc === 'undefined')
|
|
1719
|
+
result.bcc = '';
|
|
1720
|
+
if (typeof result.subject === 'undefined')
|
|
1721
|
+
result.subject = '';
|
|
1722
|
+
if (typeof result.body === 'undefined')
|
|
1723
|
+
result.body = '';
|
|
1724
|
+
return result;
|
|
1725
|
+
}
|
|
1726
|
+
function openMessenger(options, type) {
|
|
1727
|
+
options = normalize(options);
|
|
1728
|
+
return tryOpenURL(type
|
|
1729
|
+
+ ':' + options.to
|
|
1730
|
+
+ '?cc=' + options.cc
|
|
1731
|
+
+ '&bcc=' + options.bcc
|
|
1732
|
+
+ '&subject=' + options.subject
|
|
1733
|
+
+ '&body=' + options.body, 0, getDefaultTimeoutByOS(Platform.os.name));
|
|
1734
|
+
}
|
|
1735
|
+
function openMessengerTelephone(options) {
|
|
1736
|
+
return openMessenger(options, 'tel');
|
|
1737
|
+
}
|
|
1738
|
+
function openMessengerMessage(options) {
|
|
1739
|
+
return openMessenger(options, 'sms');
|
|
1740
|
+
}
|
|
1741
|
+
function openMessengerMail(options) {
|
|
1742
|
+
return openMessenger(options, 'mailto');
|
|
1743
|
+
}
|
|
1744
|
+
function setting(type) {
|
|
1745
|
+
var os = Platform.os.name;
|
|
1746
|
+
var version = Platform.os.version;
|
|
1747
|
+
if (os === OS.Unknown)
|
|
1748
|
+
return Promise.reject(getURLOpenError([]));
|
|
1749
|
+
if (os === OS.Android && !canOpenIntentURL())
|
|
1750
|
+
return Promise.reject(getURLOpenError([]));
|
|
1751
|
+
if (os === OS.iOS)
|
|
1752
|
+
return Promise.reject(getURLOpenError([]));
|
|
1753
|
+
if (os === OS.Windows && (version === 'Vista' || version === 'XP' || version === '2000' || version === 'NT 4.0' || version === 'NT 3.11' || version === 'ME' || compareVersion(version, '10') < 0))
|
|
1754
|
+
return Promise.reject(getURLOpenError([]));
|
|
1755
|
+
if (os === OS.MacOS && compareVersion(version, '10.10') < 0)
|
|
1756
|
+
return Promise.reject(getURLOpenError([]));
|
|
1757
|
+
var urls = [];
|
|
1758
|
+
switch (os) {
|
|
1759
|
+
case OS.Android:
|
|
1760
|
+
if (type !== SettingType.General) {
|
|
1761
|
+
if (type === SettingType.Accessibility && compareVersion(version, '1.6') >= 0)
|
|
1762
|
+
urls.push(SETTING_URL['Android'][SettingType.Accessibility]);
|
|
1763
|
+
else if (type === SettingType.Battery && compareVersion(version, '5.1') >= 0)
|
|
1764
|
+
urls.push(SETTING_URL['Android'][SettingType.Battery]);
|
|
1765
|
+
else if (type === SettingType.Accounts && compareVersion(version, '1.5') >= 0)
|
|
1766
|
+
urls.push(SETTING_URL['Android'][SettingType.Accounts]);
|
|
1767
|
+
else if (type === SettingType.Storage && compareVersion(version, '3.0') >= 0)
|
|
1768
|
+
urls.push(SETTING_URL['Android'][SettingType.Storage]);
|
|
1769
|
+
else
|
|
1770
|
+
urls.push(SETTING_URL['Android'][type]);
|
|
1771
|
+
}
|
|
1772
|
+
urls.push(SETTING_URL['Android'][SettingType.General]);
|
|
1773
|
+
break;
|
|
1774
|
+
case OS.Windows:
|
|
1775
|
+
urls.push(SETTING_URL['Windows'][type]);
|
|
1776
|
+
break;
|
|
1777
|
+
case OS.MacOS:
|
|
1778
|
+
if (type === SettingType.Appearance && compareVersion(version, '10.14') < 0) {
|
|
1779
|
+
urls.push(SETTING_URL['MacOS'][SettingType.General]);
|
|
1780
|
+
break;
|
|
1781
|
+
}
|
|
1782
|
+
if (compareVersion(version, '13.0') < 0)
|
|
1783
|
+
urls.push(SETTING_URL['MacOS'][type]);
|
|
1784
|
+
else
|
|
1785
|
+
urls.push(SETTING_URL['MacOS13+'][type]);
|
|
1786
|
+
break;
|
|
1787
|
+
}
|
|
1788
|
+
return new Promise(function (resolve, reject) {
|
|
1789
|
+
function openURLSequential(index) {
|
|
1790
|
+
if (index === void 0) { index = 0; }
|
|
1791
|
+
if (index >= urls.length)
|
|
1792
|
+
return reject(getURLOpenError([]));
|
|
1793
|
+
var url = urls[index];
|
|
1794
|
+
return tryOpenURL(url, index, 750)
|
|
1795
|
+
.then(function () {
|
|
1796
|
+
resolve();
|
|
1797
|
+
})
|
|
1798
|
+
.catch(function () {
|
|
1799
|
+
openURLSequential(index + 1);
|
|
1800
|
+
});
|
|
1801
|
+
}
|
|
1802
|
+
return openURLSequential();
|
|
1803
|
+
});
|
|
1804
|
+
}
|
|
1805
|
+
function file() {
|
|
1806
|
+
return new Promise(function (resolve, reject) {
|
|
1807
|
+
var input = createHiddenElement('input');
|
|
1808
|
+
if (typeof input !== 'undefined') {
|
|
1809
|
+
input.type = 'file';
|
|
1810
|
+
input.multiple = true;
|
|
1811
|
+
input.onchange = function () {
|
|
1812
|
+
var fileList = input.files;
|
|
1813
|
+
var files = [];
|
|
1814
|
+
if (fileList === null)
|
|
1815
|
+
return resolve(files);
|
|
1816
|
+
for (var i = 0; i < fileList.length; i++)
|
|
1817
|
+
files.push(fileList[i]);
|
|
1818
|
+
resolve(files);
|
|
1819
|
+
};
|
|
1820
|
+
dispatchClickEvent(input);
|
|
1821
|
+
}
|
|
1822
|
+
reject(new Error());
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
function contact(options) {
|
|
1826
|
+
return new Promise(function (resolve, reject) {
|
|
1827
|
+
if (typeof navigator.contacts === 'undefined' || typeof globalThis.ContactsManager === 'undefined')
|
|
1828
|
+
return reject(new Error());
|
|
1829
|
+
var multiple = false;
|
|
1830
|
+
var contactManager = navigator.contacts;
|
|
1831
|
+
if (typeof options !== 'undefined')
|
|
1832
|
+
multiple = options.multiple;
|
|
1833
|
+
contactManager.getProperties().then(function (properties) {
|
|
1834
|
+
contactManager.select(properties, { multiple: multiple }).then(function (contacts) {
|
|
1835
|
+
resolve(contacts);
|
|
1836
|
+
});
|
|
1837
|
+
});
|
|
1838
|
+
});
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
var Appearances;
|
|
1842
|
+
(function (Appearances) {
|
|
1843
|
+
Appearances["Unknown"] = "unknown";
|
|
1844
|
+
Appearances["Light"] = "light";
|
|
1845
|
+
Appearances["Dark"] = "dark";
|
|
1846
|
+
})(Appearances || (Appearances = {}));
|
|
1847
|
+
var FALLBACK_MEDIA_QUERY_LIST = {
|
|
1848
|
+
matches: false,
|
|
1849
|
+
media: 'not all',
|
|
1850
|
+
onchange: null,
|
|
1851
|
+
addListener: function () {
|
|
1852
|
+
},
|
|
1853
|
+
removeListener: function () {
|
|
1854
|
+
},
|
|
1855
|
+
addEventListener: function () {
|
|
1856
|
+
},
|
|
1857
|
+
removeEventListener: function () {
|
|
1858
|
+
},
|
|
1859
|
+
dispatchEvent: function () {
|
|
1860
|
+
return false;
|
|
1861
|
+
},
|
|
1862
|
+
};
|
|
1863
|
+
var MEDIA_QUERY_LIST = typeof globalThis.matchMedia !== 'undefined' ? globalThis.matchMedia('(prefers-color-scheme: dark)') : FALLBACK_MEDIA_QUERY_LIST;
|
|
1864
|
+
var SUPPORT_PREFERS_COLOR_SCHEME = MEDIA_QUERY_LIST.media !== 'not all';
|
|
1865
|
+
var CONTEXT = 'document' in globalThis ? globalThis.document.createElement('canvas').getContext('2d', { willReadFrequently: true }) : null;
|
|
1866
|
+
var SVG_PIXEL_DATA_URL = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0wIDBoMXYxSDB6Ii8+PC9zdmc+';
|
|
1867
|
+
var ENTRIES$1 = [];
|
|
1868
|
+
|
|
1869
|
+
var currentAppearance = null;
|
|
1870
|
+
var appearanceIntervalId = null;
|
|
1871
|
+
var Appearance = {
|
|
1872
|
+
get value() {
|
|
1873
|
+
return getAppearance();
|
|
1874
|
+
},
|
|
1875
|
+
onchange: onchange$2,
|
|
1876
|
+
Constants: {
|
|
1877
|
+
Appearances: Appearances
|
|
1878
|
+
},
|
|
1879
|
+
Errors: {}
|
|
1880
|
+
};
|
|
1881
|
+
function getAppearanceFromEngine() {
|
|
1882
|
+
var img = new Image();
|
|
1883
|
+
img.src = SVG_PIXEL_DATA_URL;
|
|
1884
|
+
if (CONTEXT === null)
|
|
1885
|
+
return Appearances.Light;
|
|
1886
|
+
CONTEXT.drawImage(img, 0, 0);
|
|
1887
|
+
var data = CONTEXT.getImageData(0, 0, 1, 1).data;
|
|
1888
|
+
if ((data[0] & data[1] & data[2]) < 255)
|
|
1889
|
+
return Appearances.Dark;
|
|
1890
|
+
else
|
|
1891
|
+
return Appearances.Light;
|
|
1892
|
+
}
|
|
1893
|
+
function getAppearanceFromMediaQuery() {
|
|
1894
|
+
if (!SUPPORT_PREFERS_COLOR_SCHEME)
|
|
1895
|
+
return Appearances.Unknown;
|
|
1896
|
+
if (MEDIA_QUERY_LIST.matches)
|
|
1897
|
+
return Appearances.Dark;
|
|
1898
|
+
return Appearances.Light;
|
|
1899
|
+
}
|
|
1900
|
+
function getAppearance() {
|
|
1901
|
+
if (Platform.browser.name === Browsers.SamsungInternet)
|
|
1902
|
+
return getAppearanceFromEngine();
|
|
1903
|
+
return getAppearanceFromMediaQuery();
|
|
1904
|
+
}
|
|
1905
|
+
function startPolling() {
|
|
1906
|
+
currentAppearance = getAppearanceFromEngine();
|
|
1907
|
+
appearanceIntervalId = globalThis.setInterval(function () {
|
|
1908
|
+
var appearance = getAppearanceFromEngine();
|
|
1909
|
+
if (appearance !== currentAppearance) {
|
|
1910
|
+
currentAppearance = appearance;
|
|
1911
|
+
notify$1(appearance);
|
|
1912
|
+
}
|
|
1913
|
+
}, 2000);
|
|
1914
|
+
}
|
|
1915
|
+
function stopPolling() {
|
|
1916
|
+
currentAppearance = null;
|
|
1917
|
+
if (appearanceIntervalId !== null) {
|
|
1918
|
+
clearInterval(appearanceIntervalId);
|
|
1919
|
+
appearanceIntervalId = null;
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
function addListener$1(capture) {
|
|
1923
|
+
currentAppearance = getAppearanceFromMediaQuery();
|
|
1924
|
+
if (typeof MEDIA_QUERY_LIST.addEventListener === 'function')
|
|
1925
|
+
MEDIA_QUERY_LIST.addEventListener('change', onMediaChange, capture);
|
|
1926
|
+
else if (typeof MEDIA_QUERY_LIST.addListener === 'function')
|
|
1927
|
+
MEDIA_QUERY_LIST.addListener(onMediaChange);
|
|
1928
|
+
}
|
|
1929
|
+
function removeListener$1(capture) {
|
|
1930
|
+
currentAppearance = null;
|
|
1931
|
+
if (typeof MEDIA_QUERY_LIST.removeEventListener === 'function')
|
|
1932
|
+
MEDIA_QUERY_LIST.removeEventListener('change', onMediaChange, capture);
|
|
1933
|
+
else if (typeof MEDIA_QUERY_LIST.removeListener === 'function')
|
|
1934
|
+
MEDIA_QUERY_LIST.removeListener(onMediaChange);
|
|
1935
|
+
}
|
|
1936
|
+
function onMediaChange(ev) {
|
|
1937
|
+
var appearance;
|
|
1938
|
+
if (ev.matches)
|
|
1939
|
+
appearance = Appearances.Dark;
|
|
1940
|
+
else
|
|
1941
|
+
appearance = Appearances.Light;
|
|
1942
|
+
if (appearance !== currentAppearance)
|
|
1943
|
+
notify$1(currentAppearance = appearance);
|
|
1944
|
+
}
|
|
1945
|
+
function notify$1(appearance) {
|
|
1946
|
+
for (var i = 0; i < ENTRIES$1.length; i++) {
|
|
1947
|
+
var entry = ENTRIES$1[i];
|
|
1948
|
+
entry.fn(appearance);
|
|
1949
|
+
if (entry.once)
|
|
1950
|
+
removeEntry$1(entry);
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
function removeEntry$1(entry) {
|
|
1954
|
+
var index = indexOfEntry$1(entry);
|
|
1955
|
+
if (index !== -1)
|
|
1956
|
+
ENTRIES$1.splice(index, 1);
|
|
1957
|
+
if (ENTRIES$1.length === 0) {
|
|
1958
|
+
if (Platform.browser.name === Browsers.SamsungInternet)
|
|
1959
|
+
stopPolling();
|
|
1960
|
+
else
|
|
1961
|
+
removeListener$1(entry.capture);
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
function indexOfEntry$1(entry) {
|
|
1965
|
+
for (var i = 0; i < ENTRIES$1.length; i++)
|
|
1966
|
+
if (ENTRIES$1[i].fn === entry.fn && ENTRIES$1[i].capture === entry.capture)
|
|
1967
|
+
return i;
|
|
1968
|
+
return -1;
|
|
1969
|
+
}
|
|
1970
|
+
function onchange$2(listener, options) {
|
|
1971
|
+
if (options === void 0) { options = false; }
|
|
1972
|
+
var entry = { fn: listener, capture: false, once: false };
|
|
1973
|
+
if (typeof options === 'boolean')
|
|
1974
|
+
options = { capture: options };
|
|
1975
|
+
if (typeof options.capture !== 'undefined')
|
|
1976
|
+
entry.capture = options.capture;
|
|
1977
|
+
if (typeof options.once !== 'undefined')
|
|
1978
|
+
entry.once = options.once;
|
|
1979
|
+
if (typeof options.signal !== 'undefined')
|
|
1980
|
+
entry.signal = options.signal;
|
|
1981
|
+
var index = indexOfEntry$1(entry);
|
|
1982
|
+
if (index === -1) {
|
|
1983
|
+
ENTRIES$1.push(entry);
|
|
1984
|
+
if (ENTRIES$1.length === 1) {
|
|
1985
|
+
if (Platform.browser.name === Browsers.SamsungInternet)
|
|
1986
|
+
startPolling();
|
|
1987
|
+
else
|
|
1988
|
+
addListener$1(entry.capture);
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
else if (ENTRIES$1[index].once && !entry.once) {
|
|
1992
|
+
ENTRIES$1[index].once = false;
|
|
1993
|
+
}
|
|
1994
|
+
if (typeof entry.signal !== 'undefined') {
|
|
1995
|
+
if (entry.signal.aborted) {
|
|
1996
|
+
removeEntry$1(entry);
|
|
1997
|
+
}
|
|
1998
|
+
else {
|
|
1999
|
+
entry.signal.addEventListener('abort', function onAbort() {
|
|
2000
|
+
if (typeof entry.signal !== 'undefined')
|
|
2001
|
+
entry.signal.removeEventListener('abort', onAbort);
|
|
2002
|
+
removeEntry$1(entry);
|
|
2003
|
+
});
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
return function () {
|
|
2007
|
+
removeEntry$1(entry);
|
|
2008
|
+
};
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
function isSecureContext() {
|
|
2012
|
+
if (typeof globalThis.isSecureContext !== 'undefined')
|
|
2013
|
+
return globalThis.isSecureContext;
|
|
2014
|
+
var protocol = location.protocol;
|
|
2015
|
+
var hostname = location.hostname;
|
|
2016
|
+
return protocol === 'https:' ||
|
|
2017
|
+
hostname === 'localhost' ||
|
|
2018
|
+
hostname === '127.0.0.1' ||
|
|
2019
|
+
hostname === '[::1]';
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
var Clipboard = {
|
|
2023
|
+
copy: copy,
|
|
2024
|
+
paste: paste,
|
|
2025
|
+
Constants: {},
|
|
2026
|
+
Errors: {},
|
|
2027
|
+
};
|
|
2028
|
+
function isObject(item) {
|
|
2029
|
+
return item !== null && typeof item === 'object';
|
|
2030
|
+
}
|
|
2031
|
+
function isArray(item) {
|
|
2032
|
+
return Array.isArray(item);
|
|
2033
|
+
}
|
|
2034
|
+
function isSerializable(item) {
|
|
2035
|
+
return isObject(item) || isArray(item);
|
|
2036
|
+
}
|
|
2037
|
+
function isElement(item) {
|
|
2038
|
+
return isObject(item) && typeof item.innerText !== 'undefined';
|
|
2039
|
+
}
|
|
2040
|
+
function isSelection(item) {
|
|
2041
|
+
return Object.prototype.toString.call(item) === '[object Selection]';
|
|
2042
|
+
}
|
|
2043
|
+
function convertToString(item) {
|
|
2044
|
+
if (isElement(item)) {
|
|
2045
|
+
if ('value' in item && typeof item.value === 'string')
|
|
2046
|
+
return item.value;
|
|
2047
|
+
return item.textContent;
|
|
2048
|
+
}
|
|
2049
|
+
if (isSelection(item))
|
|
2050
|
+
return item.toString();
|
|
2051
|
+
if (isSerializable(item)) {
|
|
2052
|
+
try {
|
|
2053
|
+
return JSON.stringify(item);
|
|
2054
|
+
}
|
|
2055
|
+
catch (_) {
|
|
2056
|
+
return '' + item;
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
else if (typeof item !== 'string') {
|
|
2060
|
+
return '' + item;
|
|
2061
|
+
}
|
|
2062
|
+
return item;
|
|
2063
|
+
}
|
|
2064
|
+
function convertToHTML(item) {
|
|
2065
|
+
var html = null;
|
|
2066
|
+
if (isElement(item))
|
|
2067
|
+
html = item.outerHTML;
|
|
2068
|
+
if (isSelection(item) && item.rangeCount > 0) {
|
|
2069
|
+
var div = globalThis.document.createElement('div');
|
|
2070
|
+
for (var i = 0; i < item.rangeCount; i++)
|
|
2071
|
+
div.appendChild(item.getRangeAt(i).cloneContents());
|
|
2072
|
+
html = div.innerHTML;
|
|
2073
|
+
}
|
|
2074
|
+
if (html === null)
|
|
2075
|
+
return;
|
|
2076
|
+
return html;
|
|
2077
|
+
}
|
|
2078
|
+
function supportsClipboardAPI() {
|
|
2079
|
+
return (isSecureContext() && typeof navigator !== 'undefined' && 'clipboard' in navigator);
|
|
2080
|
+
}
|
|
2081
|
+
function supportsClipboardWriteAPI() {
|
|
2082
|
+
return supportsClipboardAPI() && ('write' in navigator.clipboard || 'writeText' in navigator.clipboard);
|
|
2083
|
+
}
|
|
2084
|
+
function supportsClipboardReadAPI() {
|
|
2085
|
+
return supportsClipboardAPI() && ('read' in navigator.clipboard || 'readText' in navigator.clipboard);
|
|
2086
|
+
}
|
|
2087
|
+
function copy(item) {
|
|
2088
|
+
var text = convertToString(item);
|
|
2089
|
+
var html = convertToHTML(item);
|
|
2090
|
+
if (supportsClipboardWriteAPI()) {
|
|
2091
|
+
return copyViaClipboardAPI(text, html)
|
|
2092
|
+
.then(function (success) {
|
|
2093
|
+
if (success)
|
|
2094
|
+
return true;
|
|
2095
|
+
return copyViaLegacy(text, html);
|
|
2096
|
+
})
|
|
2097
|
+
.catch(function () {
|
|
2098
|
+
return copyViaLegacy(text, html);
|
|
2099
|
+
});
|
|
2100
|
+
}
|
|
2101
|
+
return Promise.resolve(copyViaLegacy(text, html));
|
|
2102
|
+
}
|
|
2103
|
+
function copyViaClipboardAPI(text, html) {
|
|
2104
|
+
try {
|
|
2105
|
+
if ('ClipboardItem' in window && 'write' in navigator.clipboard) {
|
|
2106
|
+
var items = {};
|
|
2107
|
+
if (typeof html !== 'undefined')
|
|
2108
|
+
items['text/html'] = new Blob([html], { type: 'text/html' });
|
|
2109
|
+
items['text/plain'] = new Blob([text], { type: 'text/plain' });
|
|
2110
|
+
return navigator.clipboard.write([new ClipboardItem(items)])
|
|
2111
|
+
.then(function () {
|
|
2112
|
+
return true;
|
|
2113
|
+
})
|
|
2114
|
+
.catch(function () {
|
|
2115
|
+
return false;
|
|
2116
|
+
});
|
|
2117
|
+
}
|
|
2118
|
+
else if ('writeText' in navigator.clipboard) {
|
|
2119
|
+
return navigator.clipboard.writeText(text)
|
|
2120
|
+
.then(function () {
|
|
2121
|
+
return true;
|
|
2122
|
+
})
|
|
2123
|
+
.catch(function () {
|
|
2124
|
+
return false;
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
catch (_) {
|
|
2129
|
+
return Promise.resolve(false);
|
|
2130
|
+
}
|
|
2131
|
+
return Promise.resolve(false);
|
|
2132
|
+
}
|
|
2133
|
+
function copyViaSelection(text, html) {
|
|
2134
|
+
if (!globalThis.getSelection || !globalThis.document.createRange)
|
|
2135
|
+
return false;
|
|
2136
|
+
var div = createHiddenElement('div');
|
|
2137
|
+
if (typeof div === 'undefined')
|
|
2138
|
+
return false;
|
|
2139
|
+
div.contentEditable = 'true';
|
|
2140
|
+
div.innerHTML = text;
|
|
2141
|
+
div.style.whiteSpace = 'pre';
|
|
2142
|
+
div.style.userSelect = 'text';
|
|
2143
|
+
div.style.setProperty('-webkit-user-select', 'text');
|
|
2144
|
+
div.style.setProperty('-moz-user-select', 'text');
|
|
2145
|
+
div.style.setProperty('-ms-user-select', 'text');
|
|
2146
|
+
globalThis.document.body.appendChild(div);
|
|
2147
|
+
var selection = globalThis.getSelection();
|
|
2148
|
+
var range = globalThis.document.createRange();
|
|
2149
|
+
var onCopy = function (event) {
|
|
2150
|
+
try {
|
|
2151
|
+
if (event.clipboardData !== null && typeof event.clipboardData.setData === 'function') {
|
|
2152
|
+
event.preventDefault();
|
|
2153
|
+
if (typeof html !== 'undefined')
|
|
2154
|
+
event.clipboardData.setData('text/html', html);
|
|
2155
|
+
event.clipboardData.setData('text/plain', text);
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
catch (_) {
|
|
2159
|
+
}
|
|
2160
|
+
};
|
|
2161
|
+
EventListenerUtils.add(globalThis.document, { type: 'copy', callback: onCopy, options: { once: true, capture: true } });
|
|
2162
|
+
try {
|
|
2163
|
+
if (selection === null) {
|
|
2164
|
+
cleanupSelection(div, selection, onCopy);
|
|
2165
|
+
return false;
|
|
2166
|
+
}
|
|
2167
|
+
selection.removeAllRanges();
|
|
2168
|
+
range.selectNodeContents(div);
|
|
2169
|
+
selection.addRange(range);
|
|
2170
|
+
var success = globalThis.document.execCommand('copy');
|
|
2171
|
+
cleanupSelection(div, selection, onCopy);
|
|
2172
|
+
return success;
|
|
2173
|
+
}
|
|
2174
|
+
catch (_) {
|
|
2175
|
+
cleanupSelection(div, selection, onCopy);
|
|
2176
|
+
return false;
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
function copyViaClipboardData(text, html) {
|
|
2180
|
+
var windowWithClipboardData = window;
|
|
2181
|
+
var clipboardData = windowWithClipboardData.clipboardData;
|
|
2182
|
+
if (typeof clipboardData !== 'undefined' && typeof clipboardData.setData === 'function') {
|
|
2183
|
+
try {
|
|
2184
|
+
if (typeof html !== 'undefined')
|
|
2185
|
+
clipboardData.setData('HTML', html);
|
|
2186
|
+
return clipboardData.setData('Text', text);
|
|
2187
|
+
}
|
|
2188
|
+
catch (_) {
|
|
2189
|
+
return false;
|
|
2190
|
+
}
|
|
2191
|
+
}
|
|
2192
|
+
return false;
|
|
2193
|
+
}
|
|
2194
|
+
function copyViaLegacy(text, html) {
|
|
2195
|
+
return copyViaSelection(text, html) || copyViaClipboardData(text, html);
|
|
2196
|
+
}
|
|
2197
|
+
function paste() {
|
|
2198
|
+
if (supportsClipboardReadAPI()) {
|
|
2199
|
+
return pasteViaClipboardAPI()
|
|
2200
|
+
.then(function (text) {
|
|
2201
|
+
if (text !== null)
|
|
2202
|
+
return text;
|
|
2203
|
+
return pasteViaLegacy();
|
|
2204
|
+
})
|
|
2205
|
+
.catch(function () {
|
|
2206
|
+
return pasteViaLegacy();
|
|
2207
|
+
});
|
|
2208
|
+
}
|
|
2209
|
+
return Promise.resolve(pasteViaLegacy());
|
|
2210
|
+
}
|
|
2211
|
+
function pasteViaClipboardAPI() {
|
|
2212
|
+
try {
|
|
2213
|
+
if ('ClipboardItem' in window && 'read' in navigator.clipboard) {
|
|
2214
|
+
return navigator.clipboard.read()
|
|
2215
|
+
.then(function (items) {
|
|
2216
|
+
if (items.length === 0)
|
|
2217
|
+
return Promise.resolve(null);
|
|
2218
|
+
var item = items[0];
|
|
2219
|
+
var types = item.types;
|
|
2220
|
+
for (var i = 0; i < types.length; i++) {
|
|
2221
|
+
if (types[i] === 'text/html') {
|
|
2222
|
+
return item.getType('text/html')
|
|
2223
|
+
.then(function (blob) {
|
|
2224
|
+
return blob.text();
|
|
2225
|
+
})
|
|
2226
|
+
.catch(function () {
|
|
2227
|
+
return null;
|
|
2228
|
+
});
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
for (var i = 0; i < types.length; i++) {
|
|
2232
|
+
if (types[i] === 'text/plain') {
|
|
2233
|
+
return item.getType('text/plain')
|
|
2234
|
+
.then(function (blob) {
|
|
2235
|
+
return blob.text();
|
|
2236
|
+
})
|
|
2237
|
+
.catch(function () {
|
|
2238
|
+
return null;
|
|
2239
|
+
});
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
return Promise.resolve(null);
|
|
2243
|
+
})
|
|
2244
|
+
.catch(function () {
|
|
2245
|
+
return null;
|
|
2246
|
+
});
|
|
2247
|
+
}
|
|
2248
|
+
else if ('readText' in navigator.clipboard) {
|
|
2249
|
+
return navigator.clipboard.readText()
|
|
2250
|
+
.then(function (text) {
|
|
2251
|
+
return text;
|
|
2252
|
+
})
|
|
2253
|
+
.catch(function () {
|
|
2254
|
+
return null;
|
|
2255
|
+
});
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
catch (_) {
|
|
2259
|
+
return Promise.resolve(null);
|
|
2260
|
+
}
|
|
2261
|
+
return Promise.resolve(null);
|
|
2262
|
+
}
|
|
2263
|
+
function pasteViaSelection() {
|
|
2264
|
+
var div = createHiddenElement('div');
|
|
2265
|
+
if (typeof div === 'undefined')
|
|
2266
|
+
return null;
|
|
2267
|
+
div.contentEditable = 'true';
|
|
2268
|
+
globalThis.document.body.appendChild(div);
|
|
2269
|
+
div.focus();
|
|
2270
|
+
var pastedText = null;
|
|
2271
|
+
var onPaste = function (event) {
|
|
2272
|
+
try {
|
|
2273
|
+
if (event.clipboardData !== null && typeof event.clipboardData.getData === 'function') {
|
|
2274
|
+
event.preventDefault();
|
|
2275
|
+
pastedText = event.clipboardData.getData('text/html') || event.clipboardData.getData('text/plain') || null;
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
catch (_) {
|
|
2279
|
+
}
|
|
2280
|
+
};
|
|
2281
|
+
EventListenerUtils.add(globalThis.document, { type: 'paste', callback: onPaste, options: { once: true, capture: true } });
|
|
2282
|
+
try {
|
|
2283
|
+
var success = globalThis.document.execCommand('paste');
|
|
2284
|
+
if (!success && !pastedText) {
|
|
2285
|
+
pastedText = div.innerHTML || div.textContent || null;
|
|
2286
|
+
}
|
|
2287
|
+
cleanupPaste(div, onPaste);
|
|
2288
|
+
return pastedText;
|
|
2289
|
+
}
|
|
2290
|
+
catch (_) {
|
|
2291
|
+
cleanupPaste(div, onPaste);
|
|
2292
|
+
return null;
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
function pasteViaClipboardData() {
|
|
2296
|
+
var windowWithClipboardData = window;
|
|
2297
|
+
var clipboardData = windowWithClipboardData.clipboardData;
|
|
2298
|
+
if (typeof clipboardData !== 'undefined' && typeof clipboardData.getData === 'function') {
|
|
2299
|
+
try {
|
|
2300
|
+
return clipboardData.getData('Text') || null;
|
|
2301
|
+
}
|
|
2302
|
+
catch (_) {
|
|
2303
|
+
return null;
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
return null;
|
|
2307
|
+
}
|
|
2308
|
+
function pasteViaLegacy() {
|
|
2309
|
+
return pasteViaSelection() || pasteViaClipboardData() || '';
|
|
2310
|
+
}
|
|
2311
|
+
function cleanupSelection(span, selection, onCopy) {
|
|
2312
|
+
if (selection !== null)
|
|
2313
|
+
selection.removeAllRanges();
|
|
2314
|
+
globalThis.document.body.removeChild(span);
|
|
2315
|
+
EventListenerUtils.remove(globalThis.document, { type: 'copy', callback: onCopy });
|
|
2316
|
+
}
|
|
2317
|
+
function cleanupPaste(div, onPaste) {
|
|
2318
|
+
globalThis.document.body.removeChild(div);
|
|
2319
|
+
EventListenerUtils.remove(globalThis.document, { type: 'paste', callback: onPaste });
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
var ENTRIES = [];
|
|
2323
|
+
var FALLBACK_DIMENSION = {
|
|
2324
|
+
innerWidth: -1,
|
|
2325
|
+
innerHeight: -1,
|
|
2326
|
+
outerWidth: -1,
|
|
2327
|
+
outerHeight: -1,
|
|
2328
|
+
scale: 1,
|
|
2329
|
+
};
|
|
2330
|
+
|
|
2331
|
+
var currentDimension = null;
|
|
2332
|
+
var Dimension = {
|
|
2333
|
+
get value() {
|
|
2334
|
+
return getDimension();
|
|
2335
|
+
},
|
|
2336
|
+
onchange: onchange$1,
|
|
2337
|
+
Constants: {},
|
|
2338
|
+
Errors: {},
|
|
2339
|
+
};
|
|
2340
|
+
function getDimensionFromWindow() {
|
|
2341
|
+
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
2342
|
+
return {
|
|
2343
|
+
innerWidth: globalThis.innerWidth,
|
|
2344
|
+
innerHeight: globalThis.innerHeight,
|
|
2345
|
+
outerWidth: globalThis.outerWidth,
|
|
2346
|
+
outerHeight: globalThis.outerHeight,
|
|
2347
|
+
scale: globalThis.devicePixelRatio || 1
|
|
2348
|
+
};
|
|
2349
|
+
}
|
|
2350
|
+
return FALLBACK_DIMENSION;
|
|
2351
|
+
}
|
|
2352
|
+
function getDimension() {
|
|
2353
|
+
return getDimensionFromWindow();
|
|
2354
|
+
}
|
|
2355
|
+
function addListener(capture) {
|
|
2356
|
+
currentDimension = getDimension();
|
|
2357
|
+
if (typeof globalThis.addEventListener === 'function')
|
|
2358
|
+
globalThis.addEventListener('resize', onResize, capture);
|
|
2359
|
+
}
|
|
2360
|
+
function removeListener(capture) {
|
|
2361
|
+
currentDimension = null;
|
|
2362
|
+
if (typeof globalThis.removeEventListener === 'function')
|
|
2363
|
+
globalThis.removeEventListener('resize', onResize, capture);
|
|
2364
|
+
}
|
|
2365
|
+
function onResize() {
|
|
2366
|
+
var dimension = getDimension();
|
|
2367
|
+
if (currentDimension === null || dimension.innerWidth !== currentDimension.innerWidth || dimension.innerHeight !== currentDimension.innerHeight || dimension.outerWidth !== currentDimension.outerWidth || dimension.outerHeight !== currentDimension.outerHeight || dimension.scale !== currentDimension.scale) {
|
|
2368
|
+
currentDimension = dimension;
|
|
2369
|
+
notify(dimension);
|
|
2370
|
+
}
|
|
2371
|
+
}
|
|
2372
|
+
function notify(dimension) {
|
|
2373
|
+
for (var i = 0; i < ENTRIES.length; i++) {
|
|
2374
|
+
var entry = ENTRIES[i];
|
|
2375
|
+
entry.fn(dimension);
|
|
2376
|
+
if (entry.once)
|
|
2377
|
+
removeEntry(entry);
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
function removeEntry(entry) {
|
|
2381
|
+
var index = indexOfEntry(entry);
|
|
2382
|
+
if (index !== -1)
|
|
2383
|
+
ENTRIES.splice(index, 1);
|
|
2384
|
+
if (ENTRIES.length === 0)
|
|
2385
|
+
removeListener(entry.capture);
|
|
2386
|
+
}
|
|
2387
|
+
function indexOfEntry(entry) {
|
|
2388
|
+
for (var i = 0; i < ENTRIES.length; i++)
|
|
2389
|
+
if (ENTRIES[i].fn === entry.fn && ENTRIES[i].capture === entry.capture)
|
|
2390
|
+
return i;
|
|
2391
|
+
return -1;
|
|
2392
|
+
}
|
|
2393
|
+
function onchange$1(listener, options) {
|
|
2394
|
+
if (options === void 0) { options = false; }
|
|
2395
|
+
var entry = { fn: listener, capture: false, once: false };
|
|
2396
|
+
if (typeof options === 'boolean')
|
|
2397
|
+
options = { capture: options };
|
|
2398
|
+
if (typeof options.capture !== 'undefined')
|
|
2399
|
+
entry.capture = options.capture;
|
|
2400
|
+
if (typeof options.once !== 'undefined')
|
|
2401
|
+
entry.once = options.once;
|
|
2402
|
+
if (typeof options.signal !== 'undefined')
|
|
2403
|
+
entry.signal = options.signal;
|
|
2404
|
+
var index = indexOfEntry(entry);
|
|
2405
|
+
if (index === -1) {
|
|
2406
|
+
ENTRIES.push(entry);
|
|
2407
|
+
if (ENTRIES.length === 1)
|
|
2408
|
+
addListener(entry.capture);
|
|
2409
|
+
}
|
|
2410
|
+
else if (ENTRIES[index].once && !entry.once) {
|
|
2411
|
+
ENTRIES[index].once = false;
|
|
2412
|
+
}
|
|
2413
|
+
var cleanup = function () {
|
|
2414
|
+
if (typeof entry.signal !== 'undefined')
|
|
2415
|
+
entry.signal.removeEventListener('abort', cleanup);
|
|
2416
|
+
removeEntry(entry);
|
|
2417
|
+
};
|
|
2418
|
+
if (typeof entry.signal !== 'undefined') {
|
|
2419
|
+
if (entry.signal.aborted)
|
|
2420
|
+
removeEntry(entry);
|
|
2421
|
+
else
|
|
2422
|
+
entry.signal.addEventListener('abort', cleanup);
|
|
2423
|
+
}
|
|
2424
|
+
return function () {
|
|
2425
|
+
removeEntry(entry);
|
|
2426
|
+
};
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
var Fullscreen = {
|
|
2430
|
+
get enabled() {
|
|
2431
|
+
return getEnabled();
|
|
2432
|
+
},
|
|
2433
|
+
get element() {
|
|
2434
|
+
return getElement();
|
|
2435
|
+
},
|
|
2436
|
+
get isFullscreen() {
|
|
2437
|
+
return getIsFullscreen();
|
|
2438
|
+
},
|
|
2439
|
+
request: request,
|
|
2440
|
+
exit: exit,
|
|
2441
|
+
toggle: toggle,
|
|
2442
|
+
onchange: onchange,
|
|
2443
|
+
onerror: onerror,
|
|
2444
|
+
Constants: {},
|
|
2445
|
+
Errors: {},
|
|
2446
|
+
};
|
|
2447
|
+
var lastIOSVideo = null;
|
|
2448
|
+
var eventsBridged = false;
|
|
2449
|
+
var API_VARIANTS = {
|
|
2450
|
+
standard: {
|
|
2451
|
+
enabled: 'fullscreenEnabled',
|
|
2452
|
+
element: 'fullscreenElement',
|
|
2453
|
+
request: 'requestFullscreen',
|
|
2454
|
+
exit: 'exitFullscreen',
|
|
2455
|
+
events: { change: 'fullscreenchange', error: 'fullscreenerror' },
|
|
2456
|
+
},
|
|
2457
|
+
webkit: {
|
|
2458
|
+
enabled: 'webkitFullscreenEnabled',
|
|
2459
|
+
element: 'webkitFullscreenElement',
|
|
2460
|
+
request: 'webkitRequestFullscreen',
|
|
2461
|
+
exit: 'webkitExitFullscreen',
|
|
2462
|
+
events: { change: 'webkitfullscreenchange', error: 'webkitfullscreenerror' },
|
|
2463
|
+
},
|
|
2464
|
+
moz: {
|
|
2465
|
+
enabled: 'mozFullScreenEnabled',
|
|
2466
|
+
element: 'mozFullScreenElement',
|
|
2467
|
+
request: 'mozRequestFullScreen',
|
|
2468
|
+
exit: 'mozCancelFullScreen',
|
|
2469
|
+
events: { change: 'mozfullscreenchange', error: 'mozfullscreenerror' },
|
|
2470
|
+
},
|
|
2471
|
+
ms: {
|
|
2472
|
+
enabled: 'msFullscreenEnabled',
|
|
2473
|
+
element: 'msFullscreenElement',
|
|
2474
|
+
request: 'msRequestFullscreen',
|
|
2475
|
+
exit: 'msExitFullscreen',
|
|
2476
|
+
events: { change: 'MSFullscreenChange', error: 'MSFullscreenError' },
|
|
2477
|
+
},
|
|
2478
|
+
};
|
|
2479
|
+
var api = detectApi();
|
|
2480
|
+
function detectApi() {
|
|
2481
|
+
var element = globalThis.document.documentElement;
|
|
2482
|
+
if ('fullscreenEnabled' in globalThis.document || 'exitFullscreen' in globalThis.document) {
|
|
2483
|
+
return API_VARIANTS.standard;
|
|
2484
|
+
}
|
|
2485
|
+
var keys = ['webkit', 'moz', 'ms'];
|
|
2486
|
+
for (var i = 0; i < keys.length; i++) {
|
|
2487
|
+
var key = keys[i];
|
|
2488
|
+
var api_1 = API_VARIANTS[key];
|
|
2489
|
+
if (api_1.enabled in globalThis.document || api_1.element in globalThis.document || api_1.exit in globalThis.document) {
|
|
2490
|
+
if (key === 'webkit' && 'webkitRequestFullScreen' in element)
|
|
2491
|
+
api_1.request = 'webkitRequestFullScreen';
|
|
2492
|
+
return api_1;
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
if ('webkitCurrentFullScreenElement' in globalThis.document) {
|
|
2496
|
+
var api_2 = {
|
|
2497
|
+
enabled: 'webkitFullscreenEnabled',
|
|
2498
|
+
element: 'webkitCurrentFullScreenElement',
|
|
2499
|
+
request: 'webkitRequestFullscreen',
|
|
2500
|
+
exit: 'webkitExitFullscreen',
|
|
2501
|
+
events: API_VARIANTS.webkit.events,
|
|
2502
|
+
};
|
|
2503
|
+
if ('webkitRequestFullScreen' in element)
|
|
2504
|
+
api_2.request = 'webkitRequestFullScreen';
|
|
2505
|
+
return api_2;
|
|
2506
|
+
}
|
|
2507
|
+
return null;
|
|
2508
|
+
}
|
|
2509
|
+
function getDefaultTarget() {
|
|
2510
|
+
if (Platform.os.name === OS.iOS) {
|
|
2511
|
+
var video = globalThis.document.querySelector('video');
|
|
2512
|
+
if (video === null)
|
|
2513
|
+
throw new Error();
|
|
2514
|
+
return video;
|
|
2515
|
+
}
|
|
2516
|
+
return globalThis.document.documentElement;
|
|
2517
|
+
}
|
|
2518
|
+
function bridgeEvents() {
|
|
2519
|
+
if (eventsBridged)
|
|
2520
|
+
return;
|
|
2521
|
+
eventsBridged = true;
|
|
2522
|
+
var dispatching = false;
|
|
2523
|
+
function emit(type) {
|
|
2524
|
+
if (dispatching)
|
|
2525
|
+
return;
|
|
2526
|
+
dispatching = true;
|
|
2527
|
+
if (typeof globalThis.document !== 'undefined')
|
|
2528
|
+
globalThis.document.dispatchEvent(new Event(type, { bubbles: true, cancelable: false }));
|
|
2529
|
+
Promise.resolve().then(function () {
|
|
2530
|
+
dispatching = false;
|
|
2531
|
+
});
|
|
2532
|
+
}
|
|
2533
|
+
function emitChange() {
|
|
2534
|
+
emit('fullscreenchange');
|
|
2535
|
+
}
|
|
2536
|
+
function emitError() {
|
|
2537
|
+
emit('fullscreenerror');
|
|
2538
|
+
}
|
|
2539
|
+
var changeEvents = ['webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'];
|
|
2540
|
+
var errorEvents = ['webkitfullscreenerror', 'mozfullscreenerror', 'MSFullscreenError'];
|
|
2541
|
+
for (var i = 0; i < changeEvents.length; i++) {
|
|
2542
|
+
if (typeof globalThis.document !== 'undefined')
|
|
2543
|
+
globalThis.document.addEventListener(changeEvents[i], emitChange, false);
|
|
2544
|
+
}
|
|
2545
|
+
for (var i = 0; i < errorEvents.length; i++) {
|
|
2546
|
+
if (typeof globalThis.document !== 'undefined')
|
|
2547
|
+
globalThis.document.addEventListener(errorEvents[i], emitError, false);
|
|
2548
|
+
}
|
|
2549
|
+
if (Platform.os.name === OS.iOS) {
|
|
2550
|
+
bridgeIOSVideoEvents();
|
|
2551
|
+
if (typeof globalThis.MutationObserver !== 'undefined') {
|
|
2552
|
+
var observer = new MutationObserver(function () {
|
|
2553
|
+
bridgeIOSVideoEvents();
|
|
2554
|
+
});
|
|
2555
|
+
observer.observe(globalThis.document.documentElement, { childList: true, subtree: true });
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
function bridgeIOSVideoEvents() {
|
|
2560
|
+
if (typeof globalThis.document !== 'undefined') {
|
|
2561
|
+
var videos = globalThis.document.querySelectorAll('video');
|
|
2562
|
+
videos.forEach(function (video) {
|
|
2563
|
+
if (video.__fsBridged__ || !('webkitEnterFullscreen' in video || 'onwebkitbeginfullscreen' in video))
|
|
2564
|
+
return;
|
|
2565
|
+
function emitChange() {
|
|
2566
|
+
globalThis.document.dispatchEvent(new Event('fullscreenchange'));
|
|
2567
|
+
}
|
|
2568
|
+
video.addEventListener('webkitbeginfullscreen', emitChange, false);
|
|
2569
|
+
video.addEventListener('webkitendfullscreen', emitChange, false);
|
|
2570
|
+
video.__fsBridged__ = true;
|
|
2571
|
+
});
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
function getEnabled() {
|
|
2575
|
+
if (api === null) {
|
|
2576
|
+
if (Platform.os.name !== OS.iOS)
|
|
2577
|
+
return false;
|
|
2578
|
+
var videos = globalThis.document.querySelectorAll('video');
|
|
2579
|
+
for (var i = 0; i < videos.length; i++) {
|
|
2580
|
+
var video = videos[i];
|
|
2581
|
+
if (video.webkitSupportsFullscreen || 'webkitEnterFullscreen' in video)
|
|
2582
|
+
return true;
|
|
2583
|
+
}
|
|
2584
|
+
return false;
|
|
2585
|
+
}
|
|
2586
|
+
var enabledValue = globalThis.document[api.enabled];
|
|
2587
|
+
if (typeof enabledValue === 'boolean')
|
|
2588
|
+
return enabledValue;
|
|
2589
|
+
return typeof globalThis.document[api.element] !== 'undefined';
|
|
2590
|
+
}
|
|
2591
|
+
function getElement() {
|
|
2592
|
+
if (api === null) {
|
|
2593
|
+
if (lastIOSVideo && lastIOSVideo.webkitDisplayingFullscreen)
|
|
2594
|
+
return lastIOSVideo;
|
|
2595
|
+
return null;
|
|
2596
|
+
}
|
|
2597
|
+
var currentElement = globalThis.document[api.element];
|
|
2598
|
+
if (currentElement !== null && typeof currentElement !== 'undefined')
|
|
2599
|
+
return currentElement;
|
|
2600
|
+
return null;
|
|
2601
|
+
}
|
|
2602
|
+
function getIsFullscreen() {
|
|
2603
|
+
return getElement() !== null;
|
|
2604
|
+
}
|
|
2605
|
+
function request(target, options) {
|
|
2606
|
+
if (target === void 0) { target = getDefaultTarget(); }
|
|
2607
|
+
return new Promise(function (resolve, reject) {
|
|
2608
|
+
if (api !== null) {
|
|
2609
|
+
var method = target[api.request];
|
|
2610
|
+
if (typeof method === 'function') {
|
|
2611
|
+
try {
|
|
2612
|
+
var result = method.call(target, options);
|
|
2613
|
+
if (typeof result !== 'undefined' && typeof result.then === 'function') {
|
|
2614
|
+
result
|
|
2615
|
+
.then(function () {
|
|
2616
|
+
resolve();
|
|
2617
|
+
})
|
|
2618
|
+
.catch(function () {
|
|
2619
|
+
if (Platform.os.name !== OS.iOS) {
|
|
2620
|
+
reject();
|
|
2621
|
+
return;
|
|
2622
|
+
}
|
|
2623
|
+
fallbackToIOSVideo();
|
|
2624
|
+
});
|
|
2625
|
+
return;
|
|
2626
|
+
}
|
|
2627
|
+
else {
|
|
2628
|
+
resolve();
|
|
2629
|
+
return;
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
catch (error) {
|
|
2633
|
+
if (Platform.os.name !== OS.iOS) {
|
|
2634
|
+
reject();
|
|
2635
|
+
return;
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
function fallbackToIOSVideo() {
|
|
2641
|
+
if (Platform.os.name === OS.iOS && target.tagName.toUpperCase() === 'VIDEO') {
|
|
2642
|
+
var video = target;
|
|
2643
|
+
if (video.webkitSupportsFullscreen && typeof video.webkitEnterFullscreen === 'function') {
|
|
2644
|
+
lastIOSVideo = video;
|
|
2645
|
+
bridgeIOSVideoEvents();
|
|
2646
|
+
video.webkitEnterFullscreen();
|
|
2647
|
+
resolve();
|
|
2648
|
+
return;
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
reject();
|
|
2652
|
+
}
|
|
2653
|
+
fallbackToIOSVideo();
|
|
2654
|
+
});
|
|
2655
|
+
}
|
|
2656
|
+
function exit() {
|
|
2657
|
+
return new Promise(function (resolve, reject) {
|
|
2658
|
+
if (api !== null) {
|
|
2659
|
+
var method = globalThis.document[api.exit];
|
|
2660
|
+
if (typeof method === 'function') {
|
|
2661
|
+
var result = method.call(globalThis.document);
|
|
2662
|
+
if (typeof result !== 'undefined' && typeof result.then === 'function') {
|
|
2663
|
+
result
|
|
2664
|
+
.then(function () {
|
|
2665
|
+
resolve();
|
|
2666
|
+
})
|
|
2667
|
+
.catch(function () {
|
|
2668
|
+
reject();
|
|
2669
|
+
});
|
|
2670
|
+
return;
|
|
2671
|
+
}
|
|
2672
|
+
else {
|
|
2673
|
+
resolve();
|
|
2674
|
+
return;
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
if (Platform.os.name === OS.iOS && lastIOSVideo !== null) {
|
|
2679
|
+
if (typeof lastIOSVideo.webkitExitFullscreen === 'function' && lastIOSVideo.webkitDisplayingFullscreen === true) {
|
|
2680
|
+
lastIOSVideo.webkitExitFullscreen();
|
|
2681
|
+
lastIOSVideo = null;
|
|
2682
|
+
resolve();
|
|
2683
|
+
return;
|
|
2684
|
+
}
|
|
2685
|
+
var videos = globalThis.document.querySelectorAll('video');
|
|
2686
|
+
for (var i = 0; i < videos.length; i++) {
|
|
2687
|
+
var video = videos[i];
|
|
2688
|
+
if (typeof video.webkitExitFullscreen === 'function' && video.webkitDisplayingFullscreen === true) {
|
|
2689
|
+
video.webkitExitFullscreen();
|
|
2690
|
+
resolve();
|
|
2691
|
+
return;
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
if (!getElement()) {
|
|
2696
|
+
resolve();
|
|
2697
|
+
return;
|
|
2698
|
+
}
|
|
2699
|
+
reject();
|
|
2700
|
+
});
|
|
2701
|
+
}
|
|
2702
|
+
function toggle(target, options) {
|
|
2703
|
+
if (getIsFullscreen())
|
|
2704
|
+
return exit();
|
|
2705
|
+
else
|
|
2706
|
+
return request(target, options);
|
|
2707
|
+
}
|
|
2708
|
+
function onchange(handler) {
|
|
2709
|
+
var listeners = [];
|
|
2710
|
+
function listen(eventType) {
|
|
2711
|
+
function wrapper(event) {
|
|
2712
|
+
handler(event);
|
|
2713
|
+
}
|
|
2714
|
+
if (typeof globalThis.document === 'undefined')
|
|
2715
|
+
return;
|
|
2716
|
+
globalThis.document.addEventListener(eventType, wrapper, false);
|
|
2717
|
+
listeners.push(function () {
|
|
2718
|
+
globalThis.document.removeEventListener(eventType, wrapper, false);
|
|
2719
|
+
});
|
|
2720
|
+
}
|
|
2721
|
+
listen('fullscreenchange');
|
|
2722
|
+
return function () {
|
|
2723
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
2724
|
+
listeners[i]();
|
|
2725
|
+
}
|
|
2726
|
+
};
|
|
2727
|
+
}
|
|
2728
|
+
function onerror(handler) {
|
|
2729
|
+
var listeners = [];
|
|
2730
|
+
function listen(eventType) {
|
|
2731
|
+
function wrapper(event) {
|
|
2732
|
+
handler(event);
|
|
2733
|
+
}
|
|
2734
|
+
if (typeof globalThis.document === 'undefined')
|
|
2735
|
+
return;
|
|
2736
|
+
globalThis.document.addEventListener(eventType, wrapper, false);
|
|
2737
|
+
listeners.push(function () {
|
|
2738
|
+
globalThis.document.removeEventListener(eventType, wrapper, false);
|
|
2739
|
+
});
|
|
2740
|
+
}
|
|
2741
|
+
listen('fullscreenerror');
|
|
2742
|
+
return function () {
|
|
2743
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
2744
|
+
listeners[i]();
|
|
2745
|
+
}
|
|
2746
|
+
};
|
|
2747
|
+
}
|
|
2748
|
+
bridgeEvents();
|
|
2749
|
+
|
|
2750
|
+
var IS_IE_MOBILE = /iemobile/i.test(Platform.userAgent);
|
|
2751
|
+
var IS_WINDOWS_PHONE = /windows phone/i.test(Platform.userAgent);
|
|
2752
|
+
|
|
2753
|
+
var metaElement = null;
|
|
2754
|
+
var Theme = {
|
|
2755
|
+
get value() {
|
|
2756
|
+
return getThemeColor();
|
|
2757
|
+
},
|
|
2758
|
+
set value(color) {
|
|
2759
|
+
if (typeof color === 'undefined')
|
|
2760
|
+
removeThemeColor();
|
|
2761
|
+
else
|
|
2762
|
+
setThemeColor(color);
|
|
2763
|
+
},
|
|
2764
|
+
Constants: {},
|
|
2765
|
+
Errors: {},
|
|
2766
|
+
};
|
|
2767
|
+
function getMetaName() {
|
|
2768
|
+
if (IS_IE_MOBILE)
|
|
2769
|
+
return 'msapplication-navbutton-color';
|
|
2770
|
+
if (IS_WINDOWS_PHONE)
|
|
2771
|
+
return 'msapplication-TileColor';
|
|
2772
|
+
return 'theme-color';
|
|
2773
|
+
}
|
|
2774
|
+
function getMeta() {
|
|
2775
|
+
if (metaElement !== null && metaElement.isConnected)
|
|
2776
|
+
return metaElement;
|
|
2777
|
+
return metaElement = globalThis.document.querySelector("meta[name=\"" + getMetaName() + "\"]");
|
|
2778
|
+
}
|
|
2779
|
+
function createMeta() {
|
|
2780
|
+
var meta = globalThis.document.createElement('meta');
|
|
2781
|
+
meta.setAttribute('name', getMetaName());
|
|
2782
|
+
globalThis.document.head.prepend(meta);
|
|
2783
|
+
return metaElement = meta;
|
|
2784
|
+
}
|
|
2785
|
+
function setThemeColor(color) {
|
|
2786
|
+
var meta = getMeta();
|
|
2787
|
+
if (meta === null)
|
|
2788
|
+
meta = createMeta();
|
|
2789
|
+
meta.setAttribute('content', color);
|
|
2790
|
+
}
|
|
2791
|
+
function getThemeColor() {
|
|
2792
|
+
var meta = getMeta();
|
|
2793
|
+
if (!meta)
|
|
2794
|
+
return undefined;
|
|
2795
|
+
return meta.getAttribute('content') || undefined;
|
|
2796
|
+
}
|
|
2797
|
+
function removeThemeColor() {
|
|
2798
|
+
var meta = getMeta();
|
|
2799
|
+
if (meta) {
|
|
2800
|
+
meta.remove();
|
|
2801
|
+
metaElement = null;
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
(function () {
|
|
2806
|
+
if (typeof globalThis === 'object')
|
|
2807
|
+
return;
|
|
2808
|
+
Object.defineProperty(Object.prototype, '__getGlobalThis__', {
|
|
2809
|
+
get: function () {
|
|
2810
|
+
return this;
|
|
2811
|
+
},
|
|
2812
|
+
configurable: true
|
|
2813
|
+
});
|
|
2814
|
+
try {
|
|
2815
|
+
var global = __getGlobalThis__;
|
|
2816
|
+
Object.defineProperty(global, 'globalThis', {
|
|
2817
|
+
value: global,
|
|
2818
|
+
writable: true,
|
|
2819
|
+
configurable: true
|
|
2820
|
+
});
|
|
2821
|
+
}
|
|
2822
|
+
finally {
|
|
2823
|
+
delete Object.prototype.__getGlobalThis__;
|
|
2824
|
+
}
|
|
2825
|
+
}());
|
|
2826
|
+
var Native = {
|
|
2827
|
+
Version: packageJSON.version,
|
|
2828
|
+
App: App,
|
|
2829
|
+
Appearance: Appearance,
|
|
2830
|
+
Clipboard: Clipboard,
|
|
2831
|
+
Dimension: Dimension,
|
|
2832
|
+
Fullscreen: Fullscreen,
|
|
2833
|
+
Platform: Platform,
|
|
2834
|
+
Theme: Theme,
|
|
140
2835
|
};
|
|
141
2836
|
|
|
142
2837
|
module.exports = Native;
|