import generateWaterMarkV2 from"./packages/h5-watermark/generateWaterMarkV2";import getWaterMarkConfig from"./utils/getWaterMarkConfig";import getWaterMarkConfigV2 from"./getWaterMarkConfigV2";import{generateWatermark}from"./packages/h5-watermark/watermark";import getVersion from"./version";import compareVersion from"./utils/compareVersion";export default function getWaterMarkV2(r){return new Promise((function(e,t){getVersion().then((function(a){var n=a.version;-1!==compareVersion(n,"2.8.0")?getWaterMarkConfigV2({pageInfo:r}).then((function(a){try{var n=generateWaterMarkV2(a,r);e(n)}catch(r){t(r)}})):getWaterMarkConfig({pageInfo:r}).then((function(a){try{var n=generateWatermark(a,r);e(n)}catch(r){t(r)}}))})).catch((function(){getWaterMarkConfig({pageInfo:r}).then((function(a){try{var n=generateWatermark(a,r);e(n)}catch(r){t(r)}}))}))}))}