webtonative 1.0.45 → 1.0.46
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/index.js +2 -2
- package/package.json +1 -1
- package/webtonative.min.js +1 -1
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isIosApp=exports.isDeviceGPSEnabled=exports.isAndroidApp=exports.hideSplashScreen=exports.enablePullToRefresh=exports.deviceInfo=exports["default"]=void 0,Object.defineProperty(exports,"isNativeApp",{enumerable:!0,get:function get(){return _utills.isNativeApp}}),exports.openUrlInBrowser=void 0,Object.defineProperty(exports,"platform",{enumerable:!0,get:function get(){return _utills.platform}}),exports.statusBar=exports.showInAppReview=exports.shareLink=void 0;var _utills=require("./utills"),isAndroidApp="ANDROID_APP"===_utills.platform;exports.isAndroidApp=isAndroidApp;var isIosApp="IOS_APP"===_utills.platform;/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isIosApp=exports.isDeviceGPSEnabled=exports.isAndroidApp=exports.hideSplashScreen=exports.enablePullToRefresh=exports.deviceInfo=exports["default"]=void 0,Object.defineProperty(exports,"isNativeApp",{enumerable:!0,get:function get(){return _utills.isNativeApp}}),exports.openUrlInBrowser=void 0,Object.defineProperty(exports,"platform",{enumerable:!0,get:function get(){return _utills.platform}}),exports.statusBar=exports.showInAppReview=exports.shareLink=exports.shareFile=void 0;var _utills=require("./utills"),isAndroidApp="ANDROID_APP"===_utills.platform;exports.isAndroidApp=isAndroidApp;var isIosApp="IOS_APP"===_utills.platform;/**
|
|
2
2
|
* This function hides splash screen
|
|
3
3
|
* @example wtn.hideSplashScreen()
|
|
4
|
-
*/exports.isIosApp=isIosApp;var hideSplashScreen=function(){_utills.isNativeApp&&_utills.webToNative.hideSplashScreen()};exports.hideSplashScreen=hideSplashScreen;var statusBar=function(a){_utills.isNativeApp&&(isAndroidApp?_utills.webToNative.statusBar(JSON.stringify(a)):isIosApp&&_utills.webToNativeIos.postMessage({action:"statusBar",color:a.color,style:a.style}))};exports.statusBar=statusBar;var deviceInfo=function(){return new Promise(function(a,b){(0,_utills.registerCb)(function(c){c?a(c):b({err:"Error getting device info"})},{key:"deviceInfo"}),"ANDROID_APP"===_utills.platform?_utills.webToNative.getDeviceInfo():"IOS_APP"===_utills.platform?_utills.webToNativeIos.postMessage({action:"deviceInfo"}):b("This function will work in Native App Powered By WebToNative")})};exports.deviceInfo=deviceInfo;var showInAppReview=function(){_utills.isNativeApp&&_utills.webToNative.showInAppReview()};exports.showInAppReview=showInAppReview;var isDeviceGPSEnabled=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"isDeviceGPSEnabled"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.isLocationServiceEnabled())};exports.isDeviceGPSEnabled=isDeviceGPSEnabled;var shareLink=function(a){var b=a.url,c=void 0===b?"":b;if(c)isAndroidApp&&_utills.webToNative.openShareIntent(c),isIosApp&&_utills.webToNativeIos.postMessage({action:"share",url:c});else throw"url is mandatory"};exports.shareLink=shareLink;var openUrlInBrowser=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";if(a)isAndroidApp&&_utills.webToNative.openUrlInBrowser(a);else throw"url is mandatory"};exports.openUrlInBrowser=openUrlInBrowser;var enablePullToRefresh=function(a){isAndroidApp&&_utills.webToNative.enableSwipeRefresh(a)};exports.enablePullToRefresh=enablePullToRefresh;var _default={isAndroidApp:isAndroidApp,isIosApp:isIosApp,hideSplashScreen:hideSplashScreen,statusBar:statusBar,deviceInfo:deviceInfo,showInAppReview:showInAppReview,shareLink:shareLink,platform:_utills.platform,isNativeApp:_utills.isNativeApp,isDeviceGPSEnabled:isDeviceGPSEnabled,openUrlInBrowser:openUrlInBrowser,enablePullToRefresh:enablePullToRefresh};exports["default"]=_default;
|
|
4
|
+
*/exports.isIosApp=isIosApp;var hideSplashScreen=function(){_utills.isNativeApp&&_utills.webToNative.hideSplashScreen()};exports.hideSplashScreen=hideSplashScreen;var statusBar=function(a){_utills.isNativeApp&&(isAndroidApp?_utills.webToNative.statusBar(JSON.stringify(a)):isIosApp&&_utills.webToNativeIos.postMessage({action:"statusBar",color:a.color,style:a.style}))};exports.statusBar=statusBar;var deviceInfo=function(){return new Promise(function(a,b){(0,_utills.registerCb)(function(c){c?a(c):b({err:"Error getting device info"})},{key:"deviceInfo"}),"ANDROID_APP"===_utills.platform?_utills.webToNative.getDeviceInfo():"IOS_APP"===_utills.platform?_utills.webToNativeIos.postMessage({action:"deviceInfo"}):b("This function will work in Native App Powered By WebToNative")})};exports.deviceInfo=deviceInfo;var showInAppReview=function(){_utills.isNativeApp&&_utills.webToNative.showInAppReview()};exports.showInAppReview=showInAppReview;var isDeviceGPSEnabled=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"isDeviceGPSEnabled"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.isLocationServiceEnabled())};exports.isDeviceGPSEnabled=isDeviceGPSEnabled;var shareLink=function(a){var b=a.url,c=void 0===b?"":b;if(c)isAndroidApp&&_utills.webToNative.openShareIntent(c),isIosApp&&_utills.webToNativeIos.postMessage({action:"share",url:c});else throw"url is mandatory"};exports.shareLink=shareLink;var openUrlInBrowser=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";if(a)isAndroidApp&&_utills.webToNative.openUrlInBrowser(a);else throw"url is mandatory"};exports.openUrlInBrowser=openUrlInBrowser;var enablePullToRefresh=function(a){isAndroidApp&&_utills.webToNative.enableSwipeRefresh(a)};exports.enablePullToRefresh=enablePullToRefresh;var shareFile=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;isAndroidApp&&_utills.webToNative.shareFile(a,b)};exports.shareFile=shareFile;var _default={isAndroidApp:isAndroidApp,isIosApp:isIosApp,hideSplashScreen:hideSplashScreen,statusBar:statusBar,deviceInfo:deviceInfo,showInAppReview:showInAppReview,shareLink:shareLink,platform:_utills.platform,isNativeApp:_utills.isNativeApp,isDeviceGPSEnabled:isDeviceGPSEnabled,openUrlInBrowser:openUrlInBrowser,enablePullToRefresh:enablePullToRefresh,shareFile:shareFile};exports["default"]=_default;
|
package/package.json
CHANGED
package/webtonative.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var e={d:function(n,t){for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:function(){return V},deviceInfo:function(){return C},enablePullToRefresh:function(){return J},hideSplashScreen:function(){return E},isAndroidApp:function(){return k},isDeviceGPSEnabled:function(){return W},isIosApp:function(){return M},isNativeApp:function(){return R},openUrlInBrowser:function(){return L},platform:function(){return N},shareLink:function(){return U},showInAppReview:function(){return B},statusBar:function(){return F}});var t={};e.r(t),e.d(t,{addTrigger:function(){return K},addTriggers:function(){return j},getPlayerId:function(){return H},getTriggerValue:function(){return Q},getTriggers:function(){return Z},logoutEmail:function(){return ee},logoutSMSNumber:function(){return ne},removeExternalUserId:function(){return q},removeTrigger:function(){return X},removeTriggers:function(){return z},setEmail:function(){return Y},setExternalUserId:function(){return x},setSMSNumber:function(){return $},setTags:function(){return G}});var o={};e.r(o),e.d(o,{BarcodeScan:function(){return ae},Format:function(){return ie},Types:function(){return re}});var i={};e.r(i),e.d(i,{bannerAd:function(){return Pe},fullScreenAd:function(){return ue},rewardsAd:function(){return Ae}});var r={};e.r(r),e.d(r,{logEvent:function(){return fe},setCustomerUserId:function(){return de}});var a={};e.r(a),e.d(a,{send:function(){return Ie},sendPurchase:function(){return Oe}});var s={};e.r(s),e.d(s,{hide:function(){return ge},show:function(){return De}});var c={};e.r(c),e.d(c,{getAll:function(){return _e},getPermissionStatus:function(){return pe}});var P={};e.r(P),e.d(P,{start:function(){return Se},stop:function(){return ve}});var u={};e.r(u),e.d(u,{keepScreenNormal:function(){return Re},keepScreenOn:function(){return Ne}});var A={};e.r(A),e.d(A,{get:function(){return we},set:function(){return Te}});var l={};e.r(l),e.d(l,{prompt:function(){return ye}});var d={};e.r(d),e.d(d,{checkStatus:function(){return be},deleteSecret:function(){return me},saveSecret:function(){return he},show:function(){return ke}});var f={};e.r(f),e.d(f,{request:function(){return Me},status:function(){return Ee}});var I={};e.r(I),e.d(I,{logEvent:function(){return Ue},logScreen:function(){return Le},setCollection:function(){return Fe},setDefaultEventParameters:function(){return We},setUserId:function(){return Ce},setUserProperty:function(){return Be}});var O={};e.r(O),e.d(O,{events:function(){return I}});var g={};e.r(g),e.d(g,{getFCMToken:function(){return He},subscribe:function(){return Je},unsubscribe:function(){return Ve}});var D={};e.r(D),e.d(D,{Analytics:function(){return I},Messaging:function(){return g}});var p={};e.r(p),e.d(p,{trigger:function(){return xe}});var _="undefined"!=typeof window,S=_&&window.WebToNativeInterface||{},v=_&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,N=S.getAndroidVersion?"ANDROID_APP":v?"IOS_APP":"WEBSITE",R=_&&"WEBSITE"!==N,w={},T=1,y=null;R&&(S.androidCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in n.type,w){var o=w[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete w[t]):(i(n),a||delete w[t])}},window.iOSAdMobCBHook=S.androidAdMobCBHook=function(e){var n=JSON.parse(e);y&&y(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in w){var o=w[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete w[t]):(i(n),a||delete w[t])}});var b=function(e,n){"function"==typeof e&&(n&&n.key?w[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(w[T]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},T+=1))},h=function(e){"function"==typeof e&&(y=e)},m=function(){y&&(y=null)},k="ANDROID_APP"===N,M="IOS_APP"===N,E=function(){R&&S.hideSplashScreen()},F=function(e){R&&(k?S.statusBar(JSON.stringify(e)):M&&v.postMessage({action:"statusBar",color:e.color,style:e.style}))},C=function(){return new Promise((function(e,n){b((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===N?S.getDeviceInfo():"IOS_APP"===N?v.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},B=function(){R&&S.showInAppReview()},W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"isDeviceGPSEnabled"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.isLocationServiceEnabled())},U=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";k&&S.openShareIntent(t),M&&v.postMessage({action:"share",url:t})},L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!e)throw"url is mandatory";k&&S.openUrlInBrowser(e)},J=function(e){k&&S.enableSwipeRefresh(e)},V={isAndroidApp:k,isIosApp:M,hideSplashScreen:E,statusBar:F,deviceInfo:C,showInAppReview:B,shareLink:U,platform:N,isNativeApp:R,isDeviceGPSEnabled:W,openUrlInBrowser:L,enablePullToRefresh:J},H=function(){return new Promise((function(e,n){b((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===N?S.getOneSignalId():"IOS_APP"===N?v.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},x=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===N)return R&&S.setExternalUserId(e);"IOS_APP"===N&&v.postMessage({action:"setExternalUserId",userId:e})},q=function(){if("ANDROID_APP"===N)return R&&S.removeExternalUserId();"IOS_APP"===N&&v.postMessage({action:"removeExternalUserId"})},G=function(e){var n=e.tags;if(n){if("ANDROID_APP"===N)return R&&S.setUserTags(JSON.stringify(n));"IOS_APP"===N&&v.postMessage({action:"setUserTags",tags:n})}},K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key,t=e.value;"ANDROID_APP"===N?S.addTrigger(JSON.stringify({key:n,value:t})):"IOS_APP"===N&&v.postMessage({action:"addTrigger",key:n,value:t})},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.triggers;"ANDROID_APP"===N?S.addTriggers(JSON.stringify({triggers:n})):"IOS_APP"===N&&v.postMessage({action:"addTriggers",triggers:n})},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;"ANDROID_APP"===N?S.removeTriggerForKey(n):"IOS_APP"===N&&v.postMessage({action:"removeTrigger",key:n})},z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.keys;"ANDROID_APP"===N?S.removeTriggersForKeys(JSON.stringify({keys:n})):"IOS_APP"===N&&v.postMessage({action:"removeTriggers",keys:n})},Q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key,t=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"getTriggerValue"===e.type&&t&&t(e)})),"ANDROID_APP"===N?S.getTriggerValueForKey(n):"IOS_APP"===N&&v.postMessage({action:"getTriggerValue",key:n}))},Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"getTriggers"===e.type&&n&&n(e)})),"ANDROID_APP"===N?S.getTriggers():"IOS_APP"===N&&v.postMessage({action:"getTriggers"}))},Y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.emailId;["ANDROID_APP","IOS_APP"].includes(N)&&"ANDROID_APP"===N&&S.setEmail(n)},$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.smsNumber;["ANDROID_APP","IOS_APP"].includes(N)&&"ANDROID_APP"===N&&S.setSMSNumber(n)},ee=function(){["ANDROID_APP","IOS_APP"].includes(N)&&"ANDROID_APP"===N&&S.logoutEmail()},ne=function(){["ANDROID_APP","IOS_APP"].includes(N)&&"ANDROID_APP"===N&&S.logoutSMSNumber()},te=void 0,oe=null,ie={UNKNOWN:-1,ALL_FORMATS:0,CODE_128:1,CODE_39:2,CODE_93:4,CODABAR:8,DATA_MATRIX:16,EAN_13:32,EAN_8:64,ITF:128,QR_CODE:256,UPC_A:512,UPC_E:1024,PDF417:2048,AZTEC:4096},re={UNKNOWN:0,CONTACT_INFO:1,EMAIL:2,ISBN:3,PHONE:4,PRODUCT:5,SMS:6,TEXT:7,URL:8,WIFI:9,GEO:10,CALENDAR_EVENT:11,DRIVER_LICENSE:12},ae=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.onBarcodeSearch,t=e.format;b((function(e){var t=e.type,o=e.value;"BARCODE_SCAN"===t&&n&&n(o)})),"ANDROID_APP"===N&&S.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===N&&v.postMessage({action:"barcodeScan",barcodeFormat:String(t||ie.ALL_FORMATS)})}},se=void 0,ce=null,Pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N))return"IOS_APP"===N&&v.postMessage({action:"showBannerAd",adId:e.adId||""}),"ANDROID_APP"===N&&S.showBannerAd(JSON.stringify(e)),se},ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.fullScreenAdCallback;return h((function(e){var n=e.status;ce&&ce(e),"adDismissed"===n&&(ce=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&m()})),"IOS_APP"===N&&v.postMessage({action:"showFullScreenAd",adId:e.adId||""}),"ANDROID_APP"===N&&S.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(ce=n),se}},Ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.rewardsAdCallback;return h((function(e){var n=e.status;ce&&ce(e),"adDismissed"===n&&(ce=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&m()})),"IOS_APP"===N&&v.postMessage({action:"showRewardAd",adId:e.adId||""}),"ANDROID_APP"===N&&S.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(ce=n),se}},le={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.loginWithFacebook(),"IOS_APP"===N&&v.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.logoutWithFacebook(),"IOS_APP"===N&&v.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.signInWithGoogle(),"IOS_APP"===N&&v.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.signOutWithGoogle(),"IOS_APP"===N&&v.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"appleSignIn",scope:t})}}}},de=function(e){["ANDROID_APP","IOS_APP"].includes(N)&&("ANDROID_APP"===N&&S.setAppsFlyerUserId(e),"IOS_APP"===N&&v.postMessage({action:"setAppsFlyerUserId",userId:e}))},fe=function(e,n){["ANDROID_APP","IOS_APP"].includes(N)&&("ANDROID_APP"===N&&S.addEventToAppsFlyer(e,JSON.stringify(n)),"IOS_APP"===N&&v.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},Ie=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.event,t=e.valueToSum,o=e.parameters;"ANDROID_APP"===N&&S.addFbEvents(n,o),"IOS_APP"===N&&v.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:o})}},Oe=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.amount,t=e.currency,o=e.parameters;"ANDROID_APP"===N&&S.addFbPurchaseEvent(n,t,o),"IOS_APP"===N&&v.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:o})}},ge=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("ANDROID_APP"===N&&S.showHideStickyFooter(!1),"IOS_APP"===N&&v.postMessage({action:"showHideStickyFooter",show:!1}))},De=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;["ANDROID_APP","IOS_APP"].includes(N)&&("ANDROID_APP"===N&&S.showHideStickyFooter(!0),"IOS_APP"===N&&v.postMessage({action:"showHideStickyFooter",show:!0,key:n}))},pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){console.log(e),"contactPermissionStatus"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"askUserForContactPermission"}))},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){var t=e.type;console.log(e),"contactDetails"===t&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"getUserContactDetails"}))},Se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.data,t=e.callback,o=e.backgroundIndicator,i=void 0!==o&&o,r=e.pauseAutomatically,a=void 0===r||r,s=e.distanceFilter,c=void 0===s?0:s,P=e.desiredAccuracy,u=void 0===P?"best":P,A=e.activityType,l=void 0===A?"other":A,d=e.apiUrl,f=e.timeout;b((function(e){"LOCATION_UPDATE"===e.type&&t&&t(e)}),{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===N&&v.postMessage({action:"startLocation",data:n,backgroundIndicator:i,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:u,activityType:l,apiUrl:d,timeout:f}),"ANDROID_APP"===N&&S.startTrackingLocation(JSON.stringify({action:"startLocation",data:n,interval:f,callback:t,apiUrl:d,displacement:c}))}},ve=function(){["ANDROID_APP","IOS_APP"].includes(N)&&(delete w["LOCATION_UPDATE"],"IOS_APP"===N&&v.postMessage({action:"stopLocation"}),"ANDROID_APP"===N&&S.stopTrackingLocation())},Ne=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&v.postMessage({action:"keepScreenOn",flag:!0}),"ANDROID_APP"===N&&S.keepScreenOn())},Re=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&v.postMessage({action:"keepScreenOn",flag:!1}),"ANDROID_APP"===N&&S.keepScreenNormal())},we=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"getClipBoardData"}),"ANDROID_APP"===N&&S.getText())},Te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&v.postMessage({action:"setClipBoardData",text:e.data||""}),"ANDROID_APP"===N&&S.setText(e.data||""))},ye=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&v.postMessage({action:"showAppRating"}),"ANDROID_APP"===N&&S.showInAppReview())},be=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"checkBiometricStatus"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.checkBiometricStatus(),"IOS_APP"===N&&v.postMessage({action:"checkBiometricStatus"}))},he=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback,t=e.secret;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"saveBiometricSecret"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.saveSecret(t),"IOS_APP"===N&&v.postMessage({action:"saveBiometricSecret",secret:t}))},me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"deleteBiometricSecret"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.deleteSecret(),"IOS_APP"===N&&v.postMessage({action:"deleteBiometricSecret"}))},ke=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback,t=e.prompt;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"showBiometric"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.callBiometric(t||"Authenticate to continue!"),"IOS_APP"===N&&v.postMessage({action:"showBiometric",prompt:t||""}))},Me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(N)&&(b((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"requestTrackingAuthorization"}))},Ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(N)&&(b((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"trackingConsentStatus"}))},Fe=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.enabled;"IOS_APP"===N&&v.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n}),"ANDROID_APP"===N&&S.setFirebaseAnalyticsCollection(n)}},Ce=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.userId;"IOS_APP"===N&&v.postMessage({action:"setFirebaseUserId",userId:n}),"ANDROID_APP"===N&&S.setFirebaseUserId(n)}},Be=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.key,t=e.value;"IOS_APP"===N&&v.postMessage({action:"setFirebaseUserProp",key:n,value:t}),"ANDROID_APP"===N&&S.setFirebaseUserProp(n,t)}},We=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.parameters;"IOS_APP"===N&&v.postMessage({action:"setFirebaseDefaultParam",parameters:n}),"ANDROID_APP"===N&&S.setFirebaseDefaultParam(n)}},Ue=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.eventName,t=e.parameters;"IOS_APP"===N&&v.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t}),"ANDROID_APP"===N&&S.logFirebaseEvent(n,t)}},Le=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.screenName,t=e.screenClass;"IOS_APP"===N&&v.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t}),"ANDROID_APP"===N&&S.logFirebaseScreenView(n,t)}},Je=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.toTopic;"IOS_APP"===N&&v.postMessage({action:"firebaseSubscribeToTopic",topic:n}),"ANDROID_APP"===N&&S.subscribeToTopic(n)}},Ve=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.fromTopic;"IOS_APP"===N&&v.postMessage({action:"firebaseUnsubscribeFromTopic",topic:n}),"ANDROID_APP"===N&&S.unsubscribeFromTopic(n)}},He=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback;b((function(e){"getFCMToken"===e.type&&("ANDROID_APP"===N&&(e.token=e.fcm_registration_token),n&&n(e))})),"IOS_APP"===N&&v.postMessage({action:"getFCMToken"}),"ANDROID_APP"===N&&S.getRegistrationToken()}},xe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(N)&&"IOS_APP"===N&&v.postMessage({action:"haptikEffect",effect:e.effect})};window.WTN=n,window.WTN.OneSignal=t,window.WTN.VoiceSearch=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onVoiceSearch;return b((function(e){var n=e.type,t=e.results;"VOICE_SEARCH_RESULT"===n&&(oe&&oe(t),oe=null)})),R&&S.openVoiceSearch(),"function"==typeof n&&(oe=n),te},window.WTN.Barcode=o,window.WTN.AdMob=i,window.WTN.socialLogin=le,window.WTN.inAppPurchase=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.productId,o=e.productType,i=e.isConsumable,r=void 0!==i&&i;b((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"inAppPurchase",productId:t}),"ANDROID_APP"===N&&S.inAppPurchase(JSON.stringify({action:"inAppPurchase",productId:t,productType:o,isConsumable:r}))}},window.WTN.getAllPurchases=function(e){if(["ANDROID_APP"].includes(N)){var n=e.callback;b((function(e){"purchaseList"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.getAllPurchases({action:"purchaseList"})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=u,window.WTN.backgroundLocation=P,window.WTN.clipboard=A,window.WTN.appReview=l,window.WTN.Biometric=d,window.WTN.ATTConsent=f,window.WTN.facebook={events:a},window.WTN.firebaseAnalytics=O,window.WTN.haptics=p,window.WTN.Firebase=D,window&&window.WebToNativeInterface&&window.WebToNativeInterface.getAndroidVersion?window.navigator.share=function(e){return new Promise((function(n,t){window.WebToNativeInterface.openShareIntent(e.url),n()}))}:WTN.isIosApp&&(window.navigator.share=function(e){return new Promise((function(n,t){v.postMessage({action:"share",url:e.url}),n()}))})}();
|
|
1
|
+
!function(){"use strict";var e={d:function(n,t){for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:function(){return H},deviceInfo:function(){return C},enablePullToRefresh:function(){return J},hideSplashScreen:function(){return E},isAndroidApp:function(){return k},isDeviceGPSEnabled:function(){return W},isIosApp:function(){return M},isNativeApp:function(){return R},openUrlInBrowser:function(){return L},platform:function(){return N},shareFile:function(){return V},shareLink:function(){return U},showInAppReview:function(){return B},statusBar:function(){return F}});var t={};e.r(t),e.d(t,{addTrigger:function(){return j},addTriggers:function(){return X},getPlayerId:function(){return x},getTriggerValue:function(){return Z},getTriggers:function(){return Y},logoutEmail:function(){return ne},logoutSMSNumber:function(){return te},removeExternalUserId:function(){return G},removeTrigger:function(){return z},removeTriggers:function(){return Q},setEmail:function(){return $},setExternalUserId:function(){return q},setSMSNumber:function(){return ee},setTags:function(){return K}});var o={};e.r(o),e.d(o,{BarcodeScan:function(){return se},Format:function(){return re},Types:function(){return ae}});var i={};e.r(i),e.d(i,{bannerAd:function(){return ue},fullScreenAd:function(){return Ae},rewardsAd:function(){return le}});var r={};e.r(r),e.d(r,{logEvent:function(){return Ie},setCustomerUserId:function(){return fe}});var a={};e.r(a),e.d(a,{send:function(){return Oe},sendPurchase:function(){return ge}});var s={};e.r(s),e.d(s,{hide:function(){return De},show:function(){return pe}});var c={};e.r(c),e.d(c,{getAll:function(){return Se},getPermissionStatus:function(){return _e}});var P={};e.r(P),e.d(P,{start:function(){return ve},stop:function(){return Ne}});var u={};e.r(u),e.d(u,{keepScreenNormal:function(){return we},keepScreenOn:function(){return Re}});var A={};e.r(A),e.d(A,{get:function(){return Te},set:function(){return ye}});var l={};e.r(l),e.d(l,{prompt:function(){return be}});var d={};e.r(d),e.d(d,{checkStatus:function(){return he},deleteSecret:function(){return ke},saveSecret:function(){return me},show:function(){return Me}});var f={};e.r(f),e.d(f,{request:function(){return Ee},status:function(){return Fe}});var I={};e.r(I),e.d(I,{logEvent:function(){return Le},logScreen:function(){return Je},setCollection:function(){return Ce},setDefaultEventParameters:function(){return Ue},setUserId:function(){return Be},setUserProperty:function(){return We}});var O={};e.r(O),e.d(O,{events:function(){return I}});var g={};e.r(g),e.d(g,{getFCMToken:function(){return xe},subscribe:function(){return Ve},unsubscribe:function(){return He}});var D={};e.r(D),e.d(D,{Analytics:function(){return I},Messaging:function(){return g}});var p={};e.r(p),e.d(p,{trigger:function(){return qe}});var _="undefined"!=typeof window,S=_&&window.WebToNativeInterface||{},v=_&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,N=S.getAndroidVersion?"ANDROID_APP":v?"IOS_APP":"WEBSITE",R=_&&"WEBSITE"!==N,w={},T=1,y=null;R&&(S.androidCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in n.type,w){var o=w[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete w[t]):(i(n),a||delete w[t])}},window.iOSAdMobCBHook=S.androidAdMobCBHook=function(e){var n=JSON.parse(e);y&&y(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in w){var o=w[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete w[t]):(i(n),a||delete w[t])}});var b=function(e,n){"function"==typeof e&&(n&&n.key?w[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(w[T]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},T+=1))},h=function(e){"function"==typeof e&&(y=e)},m=function(){y&&(y=null)},k="ANDROID_APP"===N,M="IOS_APP"===N,E=function(){R&&S.hideSplashScreen()},F=function(e){R&&(k?S.statusBar(JSON.stringify(e)):M&&v.postMessage({action:"statusBar",color:e.color,style:e.style}))},C=function(){return new Promise((function(e,n){b((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===N?S.getDeviceInfo():"IOS_APP"===N?v.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},B=function(){R&&S.showInAppReview()},W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"isDeviceGPSEnabled"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.isLocationServiceEnabled())},U=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";k&&S.openShareIntent(t),M&&v.postMessage({action:"share",url:t})},L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!e)throw"url is mandatory";k&&S.openUrlInBrowser(e)},J=function(e){k&&S.enableSwipeRefresh(e)},V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;k&&S.shareFile(e,n)},H={isAndroidApp:k,isIosApp:M,hideSplashScreen:E,statusBar:F,deviceInfo:C,showInAppReview:B,shareLink:U,platform:N,isNativeApp:R,isDeviceGPSEnabled:W,openUrlInBrowser:L,enablePullToRefresh:J,shareFile:V},x=function(){return new Promise((function(e,n){b((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===N?S.getOneSignalId():"IOS_APP"===N?v.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},q=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===N)return R&&S.setExternalUserId(e);"IOS_APP"===N&&v.postMessage({action:"setExternalUserId",userId:e})},G=function(){if("ANDROID_APP"===N)return R&&S.removeExternalUserId();"IOS_APP"===N&&v.postMessage({action:"removeExternalUserId"})},K=function(e){var n=e.tags;if(n){if("ANDROID_APP"===N)return R&&S.setUserTags(JSON.stringify(n));"IOS_APP"===N&&v.postMessage({action:"setUserTags",tags:n})}},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key,t=e.value;"ANDROID_APP"===N?S.addTrigger(JSON.stringify({key:n,value:t})):"IOS_APP"===N&&v.postMessage({action:"addTrigger",key:n,value:t})},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.triggers;"ANDROID_APP"===N?S.addTriggers(JSON.stringify({triggers:n})):"IOS_APP"===N&&v.postMessage({action:"addTriggers",triggers:n})},z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;"ANDROID_APP"===N?S.removeTriggerForKey(n):"IOS_APP"===N&&v.postMessage({action:"removeTrigger",key:n})},Q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.keys;"ANDROID_APP"===N?S.removeTriggersForKeys(JSON.stringify({keys:n})):"IOS_APP"===N&&v.postMessage({action:"removeTriggers",keys:n})},Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key,t=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"getTriggerValue"===e.type&&t&&t(e)})),"ANDROID_APP"===N?S.getTriggerValueForKey(n):"IOS_APP"===N&&v.postMessage({action:"getTriggerValue",key:n}))},Y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"getTriggers"===e.type&&n&&n(e)})),"ANDROID_APP"===N?S.getTriggers():"IOS_APP"===N&&v.postMessage({action:"getTriggers"}))},$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.emailId;["ANDROID_APP","IOS_APP"].includes(N)&&"ANDROID_APP"===N&&S.setEmail(n)},ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.smsNumber;["ANDROID_APP","IOS_APP"].includes(N)&&"ANDROID_APP"===N&&S.setSMSNumber(n)},ne=function(){["ANDROID_APP","IOS_APP"].includes(N)&&"ANDROID_APP"===N&&S.logoutEmail()},te=function(){["ANDROID_APP","IOS_APP"].includes(N)&&"ANDROID_APP"===N&&S.logoutSMSNumber()},oe=void 0,ie=null,re={UNKNOWN:-1,ALL_FORMATS:0,CODE_128:1,CODE_39:2,CODE_93:4,CODABAR:8,DATA_MATRIX:16,EAN_13:32,EAN_8:64,ITF:128,QR_CODE:256,UPC_A:512,UPC_E:1024,PDF417:2048,AZTEC:4096},ae={UNKNOWN:0,CONTACT_INFO:1,EMAIL:2,ISBN:3,PHONE:4,PRODUCT:5,SMS:6,TEXT:7,URL:8,WIFI:9,GEO:10,CALENDAR_EVENT:11,DRIVER_LICENSE:12},se=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.onBarcodeSearch,t=e.format;b((function(e){var t=e.type,o=e.value;"BARCODE_SCAN"===t&&n&&n(o)})),"ANDROID_APP"===N&&S.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===N&&v.postMessage({action:"barcodeScan",barcodeFormat:String(t||re.ALL_FORMATS)})}},ce=void 0,Pe=null,ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N))return"IOS_APP"===N&&v.postMessage({action:"showBannerAd",adId:e.adId||""}),"ANDROID_APP"===N&&S.showBannerAd(JSON.stringify(e)),ce},Ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.fullScreenAdCallback;return h((function(e){var n=e.status;Pe&&Pe(e),"adDismissed"===n&&(Pe=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&m()})),"IOS_APP"===N&&v.postMessage({action:"showFullScreenAd",adId:e.adId||""}),"ANDROID_APP"===N&&S.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(Pe=n),ce}},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.rewardsAdCallback;return h((function(e){var n=e.status;Pe&&Pe(e),"adDismissed"===n&&(Pe=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&m()})),"IOS_APP"===N&&v.postMessage({action:"showRewardAd",adId:e.adId||""}),"ANDROID_APP"===N&&S.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(Pe=n),ce}},de={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.loginWithFacebook(),"IOS_APP"===N&&v.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.logoutWithFacebook(),"IOS_APP"===N&&v.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.signInWithGoogle(),"IOS_APP"===N&&v.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.signOutWithGoogle(),"IOS_APP"===N&&v.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"appleSignIn",scope:t})}}}},fe=function(e){["ANDROID_APP","IOS_APP"].includes(N)&&("ANDROID_APP"===N&&S.setAppsFlyerUserId(e),"IOS_APP"===N&&v.postMessage({action:"setAppsFlyerUserId",userId:e}))},Ie=function(e,n){["ANDROID_APP","IOS_APP"].includes(N)&&("ANDROID_APP"===N&&S.addEventToAppsFlyer(e,JSON.stringify(n)),"IOS_APP"===N&&v.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},Oe=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.event,t=e.valueToSum,o=e.parameters;"ANDROID_APP"===N&&S.addFbEvents(n,o),"IOS_APP"===N&&v.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:o})}},ge=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.amount,t=e.currency,o=e.parameters;"ANDROID_APP"===N&&S.addFbPurchaseEvent(n,t,o),"IOS_APP"===N&&v.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:o})}},De=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("ANDROID_APP"===N&&S.showHideStickyFooter(!1),"IOS_APP"===N&&v.postMessage({action:"showHideStickyFooter",show:!1}))},pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;["ANDROID_APP","IOS_APP"].includes(N)&&("ANDROID_APP"===N&&S.showHideStickyFooter(!0),"IOS_APP"===N&&v.postMessage({action:"showHideStickyFooter",show:!0,key:n}))},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){console.log(e),"contactPermissionStatus"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"askUserForContactPermission"}))},Se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){var t=e.type;console.log(e),"contactDetails"===t&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"getUserContactDetails"}))},ve=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.data,t=e.callback,o=e.backgroundIndicator,i=void 0!==o&&o,r=e.pauseAutomatically,a=void 0===r||r,s=e.distanceFilter,c=void 0===s?0:s,P=e.desiredAccuracy,u=void 0===P?"best":P,A=e.activityType,l=void 0===A?"other":A,d=e.apiUrl,f=e.timeout;b((function(e){"LOCATION_UPDATE"===e.type&&t&&t(e)}),{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===N&&v.postMessage({action:"startLocation",data:n,backgroundIndicator:i,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:u,activityType:l,apiUrl:d,timeout:f}),"ANDROID_APP"===N&&S.startTrackingLocation(JSON.stringify({action:"startLocation",data:n,interval:f,callback:t,apiUrl:d,displacement:c}))}},Ne=function(){["ANDROID_APP","IOS_APP"].includes(N)&&(delete w["LOCATION_UPDATE"],"IOS_APP"===N&&v.postMessage({action:"stopLocation"}),"ANDROID_APP"===N&&S.stopTrackingLocation())},Re=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&v.postMessage({action:"keepScreenOn",flag:!0}),"ANDROID_APP"===N&&S.keepScreenOn())},we=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&v.postMessage({action:"keepScreenOn",flag:!1}),"ANDROID_APP"===N&&S.keepScreenNormal())},Te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"getClipBoardData"}),"ANDROID_APP"===N&&S.getText())},ye=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&v.postMessage({action:"setClipBoardData",text:e.data||""}),"ANDROID_APP"===N&&S.setText(e.data||""))},be=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&v.postMessage({action:"showAppRating"}),"ANDROID_APP"===N&&S.showInAppReview())},he=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"checkBiometricStatus"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.checkBiometricStatus(),"IOS_APP"===N&&v.postMessage({action:"checkBiometricStatus"}))},me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback,t=e.secret;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"saveBiometricSecret"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.saveSecret(t),"IOS_APP"===N&&v.postMessage({action:"saveBiometricSecret",secret:t}))},ke=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"deleteBiometricSecret"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.deleteSecret(),"IOS_APP"===N&&v.postMessage({action:"deleteBiometricSecret"}))},Me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback,t=e.prompt;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"showBiometric"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.callBiometric(t||"Authenticate to continue!"),"IOS_APP"===N&&v.postMessage({action:"showBiometric",prompt:t||""}))},Ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(N)&&(b((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"requestTrackingAuthorization"}))},Fe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(N)&&(b((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"trackingConsentStatus"}))},Ce=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.enabled;"IOS_APP"===N&&v.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n}),"ANDROID_APP"===N&&S.setFirebaseAnalyticsCollection(n)}},Be=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.userId;"IOS_APP"===N&&v.postMessage({action:"setFirebaseUserId",userId:n}),"ANDROID_APP"===N&&S.setFirebaseUserId(n)}},We=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.key,t=e.value;"IOS_APP"===N&&v.postMessage({action:"setFirebaseUserProp",key:n,value:t}),"ANDROID_APP"===N&&S.setFirebaseUserProp(n,t)}},Ue=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.parameters;"IOS_APP"===N&&v.postMessage({action:"setFirebaseDefaultParam",parameters:n}),"ANDROID_APP"===N&&S.setFirebaseDefaultParam(n)}},Le=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.eventName,t=e.parameters;"IOS_APP"===N&&v.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t}),"ANDROID_APP"===N&&S.logFirebaseEvent(n,t)}},Je=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.screenName,t=e.screenClass;"IOS_APP"===N&&v.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t}),"ANDROID_APP"===N&&S.logFirebaseScreenView(n,t)}},Ve=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.toTopic;"IOS_APP"===N&&v.postMessage({action:"firebaseSubscribeToTopic",topic:n}),"ANDROID_APP"===N&&S.subscribeToTopic(n)}},He=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.fromTopic;"IOS_APP"===N&&v.postMessage({action:"firebaseUnsubscribeFromTopic",topic:n}),"ANDROID_APP"===N&&S.unsubscribeFromTopic(n)}},xe=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback;b((function(e){"getFCMToken"===e.type&&("ANDROID_APP"===N&&(e.token=e.fcm_registration_token),n&&n(e))})),"IOS_APP"===N&&v.postMessage({action:"getFCMToken"}),"ANDROID_APP"===N&&S.getRegistrationToken()}},qe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(N)&&"IOS_APP"===N&&v.postMessage({action:"haptikEffect",effect:e.effect})};window.WTN=n,window.WTN.OneSignal=t,window.WTN.VoiceSearch=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onVoiceSearch;return b((function(e){var n=e.type,t=e.results;"VOICE_SEARCH_RESULT"===n&&(ie&&ie(t),ie=null)})),R&&S.openVoiceSearch(),"function"==typeof n&&(ie=n),oe},window.WTN.Barcode=o,window.WTN.AdMob=i,window.WTN.socialLogin=de,window.WTN.inAppPurchase=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.productId,o=e.productType,i=e.isConsumable,r=void 0!==i&&i;b((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"inAppPurchase",productId:t}),"ANDROID_APP"===N&&S.inAppPurchase(JSON.stringify({action:"inAppPurchase",productId:t,productType:o,isConsumable:r}))}},window.WTN.getAllPurchases=function(e){if(["ANDROID_APP"].includes(N)){var n=e.callback;b((function(e){"purchaseList"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.getAllPurchases({action:"purchaseList"})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=u,window.WTN.backgroundLocation=P,window.WTN.clipboard=A,window.WTN.appReview=l,window.WTN.Biometric=d,window.WTN.ATTConsent=f,window.WTN.facebook={events:a},window.WTN.firebaseAnalytics=O,window.WTN.haptics=p,window.WTN.Firebase=D,window&&window.WebToNativeInterface&&window.WebToNativeInterface.getAndroidVersion?window.navigator.share=function(e){return new Promise((function(n,t){window.WebToNativeInterface.openShareIntent(e.url),n()}))}:WTN.isIosApp&&(window.navigator.share=function(e){return new Promise((function(n,t){v.postMessage({action:"share",url:e.url}),n()}))})}();
|