webtonative 1.0.52 → 1.0.53
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.downloadFile=exports.deviceInfo=exports["default"]=exports.closeApp=exports.clearAppCache=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.showDateTimePicker=exports.shareLink=exports.shareFile=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.downloadFile=exports.deviceInfo=exports["default"]=exports.closeApp=exports.clearAppCache=exports.addToSiri=void 0,Object.defineProperty(exports,"isNativeApp",{enumerable:!0,get:function get(){return _utills.isNativeApp}}),exports.openUrlInBrowser=exports.loadOfferCard=void 0,Object.defineProperty(exports,"platform",{enumerable:!0,get:function get(){return _utills.platform}}),exports.statusBar=exports.showInAppReview=exports.showDateTimePicker=exports.shareLink=exports.shareFile=exports.printFunction=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 downloadFile=function(a){_utills.isNativeApp&&(isAndroidApp||isIosApp&&_utills.webToNativeIos.postMessage({action:"downloadFile",downloadUrl:a}))};exports.downloadFile=downloadFile;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 clearAppCache=function(a){isAndroidApp&&_utills.webToNative.clearWebViewCache(JSON.stringify({reload:a}))};exports.clearAppCache=clearAppCache;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 closeApp=function(){isAndroidApp&&_utills.webToNative.closeApp()};exports.closeApp=closeApp;var showDateTimePicker=function(a){if(["ANDROID_APP"].includes(_utills.platform)){var b=a.callback,c=a.showDate,d=a.showTime;(0,_utills.registerCb)(function(a){var c=a.type;"DATE_TIME_PICKER"===c&&b&&b(a)}),isAndroidApp&&_utills.webToNative.pickDateTime(JSON.stringify({showDate:c,showTime:d}))}};exports.showDateTimePicker=showDateTimePicker;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,clearAppCache:clearAppCache,closeApp:closeApp,showDateTimePicker:showDateTimePicker};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 downloadFile=function(a){_utills.isNativeApp&&(isAndroidApp||isIosApp&&_utills.webToNativeIos.postMessage({action:"downloadFile",downloadUrl:a}))};exports.downloadFile=downloadFile;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 clearAppCache=function(a){isAndroidApp&&_utills.webToNative.clearWebViewCache(JSON.stringify({reload:a}))};exports.clearAppCache=clearAppCache;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 closeApp=function(){isAndroidApp&&_utills.webToNative.closeApp()};exports.closeApp=closeApp;var showDateTimePicker=function(a){if(["ANDROID_APP"].includes(_utills.platform)){var b=a.callback,c=a.showDate,d=a.showTime;(0,_utills.registerCb)(function(a){var c=a.type;"DATE_TIME_PICKER"===c&&b&&b(a)}),isAndroidApp&&_utills.webToNative.pickDateTime(JSON.stringify({showDate:c,showTime:d}))}};exports.showDateTimePicker=showDateTimePicker;var printFunction=function(a){if(["ANDROID_APP"].includes(_utills.platform)){var b=a.type,c=void 0===b?"url":b,d=a.url,e=void 0===d?"":d;isAndroidApp&&_utills.webToNative.print(JSON.stringify({type:c,url:e}))}};exports.printFunction=printFunction;var loadOfferCard=function(a){["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&(isAndroidApp&&_utills.webToNative.showOfferCard(JSON.stringify(a)),a.data&&(a.data=JSON.stringify(a.data)),isIosApp&&_utills.webToNativeIos.postMessage(a))};exports.loadOfferCard=loadOfferCard;var addToSiri=function(a){["IOS_APP"].includes(_utills.platform)&&(a.data&&(a.data=JSON.stringify(a.data)),isIosApp&&_utills.webToNativeIos.postMessage(a))};exports.addToSiri=addToSiri;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,clearAppCache:clearAppCache,closeApp:closeApp,showDateTimePicker:showDateTimePicker,printFunction:printFunction,loadOfferCard:loadOfferCard,addToSiri:addToSiri};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 i in t)e.o(t,i)&&!e.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:t[i]})},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,{clearAppCache:function(){return x},closeApp:function(){return G},default:function(){return j},deviceInfo:function(){return U},downloadFile:function(){return B},enablePullToRefresh:function(){return H},hideSplashScreen:function(){return F},isAndroidApp:function(){return M},isDeviceGPSEnabled:function(){return L},isIosApp:function(){return E},isNativeApp:function(){return w},openUrlInBrowser:function(){return V},platform:function(){return R},shareFile:function(){return q},shareLink:function(){return J},showDateTimePicker:function(){return K},showInAppReview:function(){return W},statusBar:function(){return C}});var t={};e.r(t),e.d(t,{addTrigger:function(){return Y},addTriggers:function(){return $},getPlayerId:function(){return X},getTriggerValue:function(){return te},getTriggers:function(){return ie},logoutEmail:function(){return ae},logoutSMSNumber:function(){return se},removeExternalUserId:function(){return Q},removeTrigger:function(){return ee},removeTriggers:function(){return ne},setEmail:function(){return oe},setExternalUserId:function(){return z},setSMSNumber:function(){return re},setTags:function(){return Z}});var i={};e.r(i),e.d(i,{BarcodeScan:function(){return le},Format:function(){return ue},Types:function(){return Ae}});var o={};e.r(o),e.d(o,{bannerAd:function(){return Ie},fullScreenAd:function(){return Oe},rewardsAd:function(){return ge}});var r={};e.r(r),e.d(r,{logEvent:function(){return _e},setCustomerUserId:function(){return pe}});var a={};e.r(a),e.d(a,{send:function(){return Se},sendPurchase:function(){return ve}});var s={};e.r(s),e.d(s,{hide:function(){return Ne},show:function(){return Re}});var c={};e.r(c),e.d(c,{getAll:function(){return ye},getPermissionStatus:function(){return we}});var P={};e.r(P),e.d(P,{start:function(){return Te},stop:function(){return he}});var u={};e.r(u),e.d(u,{keepScreenNormal:function(){return me},keepScreenOn:function(){return be}});var A={};e.r(A),e.d(A,{get:function(){return ke},set:function(){return Me}});var l={};e.r(l),e.d(l,{prompt:function(){return Ee}});var d={};e.r(d),e.d(d,{checkStatus:function(){return Fe},deleteSecret:function(){return Be},saveSecret:function(){return Ce},show:function(){return Ue}});var f={};e.r(f),e.d(f,{request:function(){return We},status:function(){return Le}});var I={};e.r(I),e.d(I,{logEvent:function(){return qe},logScreen:function(){return Ge},setCollection:function(){return Je},setDefaultEventParameters:function(){return xe},setUserId:function(){return Ve},setUserProperty:function(){return He}});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 Ke},unsubscribe:function(){return je}});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 ze}});var _={};e.r(_),e.d(_,{pauseMedia:function(){return Ze},playMedia:function(){return Qe},stopMedia:function(){return Ye}});var S="undefined"!=typeof window,v=S&&window.WebToNativeInterface||{},N=S&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,R=v.getAndroidVersion?"ANDROID_APP":N?"IOS_APP":"WEBSITE",w=S&&"WEBSITE"!==R,y={},T=1,h=null;w&&(v.androidCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in n.type,y){var i=y[t],o=i.cb,r=i.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(o(n),a||delete y[t]):(o(n),a||delete y[t])}},window.iOSAdMobCBHook=v.androidAdMobCBHook=function(e){var n=JSON.parse(e);h&&h(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in y){var i=y[t],o=i.cb,r=i.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(o(n),a||delete y[t]):(o(n),a||delete y[t])}});var b=function(e,n){"function"==typeof e&&(n&&n.key?y[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(y[T]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},T+=1))},m=function(e){"function"==typeof e&&(h=e)},k=function(){h&&(h=null)},M="ANDROID_APP"===R,E="IOS_APP"===R,F=function(){w&&v.hideSplashScreen()},C=function(e){w&&(M?v.statusBar(JSON.stringify(e)):E&&N.postMessage({action:"statusBar",color:e.color,style:e.style}))},B=function(e){w&&(M||E&&N.postMessage({action:"downloadFile",downloadUrl:e}))},U=function(){return new Promise((function(e,n){b((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===R?v.getDeviceInfo():"IOS_APP"===R?N.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},W=function(){w&&v.showInAppReview()},L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"isDeviceGPSEnabled"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.isLocationServiceEnabled())},J=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";M&&v.openShareIntent(t),E&&N.postMessage({action:"share",url:t})},V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!e)throw"url is mandatory";M&&v.openUrlInBrowser(e)},H=function(e){M&&v.enableSwipeRefresh(e)},x=function(e){M&&v.clearWebViewCache(JSON.stringify({reload:e}))},q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;M&&v.shareFile(e,n)},G=function(){M&&v.closeApp()},K=function(e){if(["ANDROID_APP"].includes(R)){var n=e.callback,t=e.showDate,i=e.showTime;b((function(e){"DATE_TIME_PICKER"===e.type&&n&&n(e)})),M&&v.pickDateTime(JSON.stringify({showDate:t,showTime:i}))}},j={isAndroidApp:M,isIosApp:E,hideSplashScreen:F,statusBar:C,deviceInfo:U,showInAppReview:W,shareLink:J,platform:R,isNativeApp:w,isDeviceGPSEnabled:L,openUrlInBrowser:V,enablePullToRefresh:H,shareFile:q,clearAppCache:x,closeApp:G,showDateTimePicker:K},X=function(){return new Promise((function(e,n){b((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===R?v.getOneSignalId():"IOS_APP"===R?N.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},z=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===R)return w&&v.setExternalUserId(e);"IOS_APP"===R&&N.postMessage({action:"setExternalUserId",userId:e})},Q=function(){if("ANDROID_APP"===R)return w&&v.removeExternalUserId();"IOS_APP"===R&&N.postMessage({action:"removeExternalUserId"})},Z=function(e){var n=e.tags;if(n){if("ANDROID_APP"===R)return w&&v.setUserTags(JSON.stringify(n));"IOS_APP"===R&&N.postMessage({action:"setUserTags",tags:n})}},Y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key,t=e.value;"ANDROID_APP"===R?v.addTrigger(JSON.stringify({key:n,value:t})):"IOS_APP"===R&&N.postMessage({action:"addTrigger",key:n,value:t})},$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.triggers;"ANDROID_APP"===R?v.addTriggers(JSON.stringify({triggers:n})):"IOS_APP"===R&&N.postMessage({action:"addTriggers",triggers:n})},ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;"ANDROID_APP"===R?v.removeTriggerForKey(n):"IOS_APP"===R&&N.postMessage({action:"removeTrigger",key:n})},ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.keys;"ANDROID_APP"===R?v.removeTriggersForKeys(JSON.stringify({keys:n})):"IOS_APP"===R&&N.postMessage({action:"removeTriggers",keys:n})},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key,t=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"getTriggerValue"===e.type&&t&&t(e)})),"ANDROID_APP"===R?v.getTriggerValueForKey(n):"IOS_APP"===R&&N.postMessage({action:"getTriggerValue",key:n}))},ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"getTriggers"===e.type&&n&&n(e)})),"ANDROID_APP"===R?v.getTriggers():"IOS_APP"===R&&N.postMessage({action:"getTriggers"}))},oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.emailId;["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.setEmail(n)},re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.smsNumber;["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.setSMSNumber(n)},ae=function(){["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.logoutEmail()},se=function(){["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.logoutSMSNumber()},ce=void 0,Pe=null,ue={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},le=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.onBarcodeSearch,t=e.format;b((function(e){var t=e.type,i=e.value;"BARCODE_SCAN"===t&&n&&n(i)})),"ANDROID_APP"===R&&v.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===R&&N.postMessage({action:"barcodeScan",barcodeFormat:String(t||ue.ALL_FORMATS)})}},de=void 0,fe=null,Ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(R))return"IOS_APP"===R&&N.postMessage({action:"showBannerAd",adId:e.adId||""}),"ANDROID_APP"===R&&v.showBannerAd(JSON.stringify(e)),de},Oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.fullScreenAdCallback;return m((function(e){var n=e.status;fe&&fe(e),"adDismissed"===n&&(fe=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&k()})),"IOS_APP"===R&&N.postMessage({action:"showFullScreenAd",adId:e.adId||""}),"ANDROID_APP"===R&&v.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(fe=n),de}},ge=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.rewardsAdCallback;return m((function(e){var n=e.status;fe&&fe(e),"adDismissed"===n&&(fe=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&k()})),"IOS_APP"===R&&N.postMessage({action:"showRewardAd",adId:e.adId||""}),"ANDROID_APP"===R&&v.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(fe=n),de}},De={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback,t=e.scope;b((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.loginWithFacebook(),"IOS_APP"===R&&N.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback,t=e.scope;b((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.logoutWithFacebook(),"IOS_APP"===R&&N.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback,t=e.scope;b((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.signInWithGoogle(),"IOS_APP"===R&&N.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback,t=e.scope;b((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.signOutWithGoogle(),"IOS_APP"===R&&N.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback,t=e.scope;b((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===R&&N.postMessage({action:"appleSignIn",scope:t})}}}},pe=function(e){["ANDROID_APP","IOS_APP"].includes(R)&&("ANDROID_APP"===R&&v.setAppsFlyerUserId(e),"IOS_APP"===R&&N.postMessage({action:"setAppsFlyerUserId",userId:e}))},_e=function(e,n){["ANDROID_APP","IOS_APP"].includes(R)&&("ANDROID_APP"===R&&v.addEventToAppsFlyer(e,JSON.stringify(n)),"IOS_APP"===R&&N.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},Se=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.event,t=e.valueToSum,i=e.parameters;"ANDROID_APP"===R&&v.addFbEvents(n,i),"IOS_APP"===R&&N.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:i})}},ve=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.amount,t=e.currency,i=e.parameters;"ANDROID_APP"===R&&v.addFbPurchaseEvent(n,t,i),"IOS_APP"===R&&N.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:i})}},Ne=function(){["ANDROID_APP","IOS_APP"].includes(R)&&("ANDROID_APP"===R&&v.showHideStickyFooter(!1),"IOS_APP"===R&&N.postMessage({action:"showHideStickyFooter",show:!1}))},Re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;["ANDROID_APP","IOS_APP"].includes(R)&&("ANDROID_APP"===R&&v.showHideStickyFooter(!0),"IOS_APP"===R&&N.postMessage({action:"showHideStickyFooter",show:!0,key:n}))},we=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"contactPermissionStatus"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.getPermissionStatus(),"IOS_APP"===R&&N.postMessage({action:"askUserForContactPermission"}))},ye=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"contactDetails"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.getAll(),"IOS_APP"===R&&N.postMessage({action:"getUserContactDetails"}))},Te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.data,t=e.callback,i=e.backgroundIndicator,o=void 0!==i&&i,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"===R&&N.postMessage({action:"startLocation",data:n,backgroundIndicator:o,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:u,activityType:l,apiUrl:d,timeout:f}),"ANDROID_APP"===R&&v.startTrackingLocation(JSON.stringify({action:"startLocation",data:n,interval:f,callback:t,apiUrl:d,displacement:c}))}},he=function(){["ANDROID_APP","IOS_APP"].includes(R)&&(delete y["LOCATION_UPDATE"],"IOS_APP"===R&&N.postMessage({action:"stopLocation"}),"ANDROID_APP"===R&&v.stopTrackingLocation())},be=function(){["ANDROID_APP","IOS_APP"].includes(R)&&("IOS_APP"===R&&N.postMessage({action:"keepScreenOn",flag:!0}),"ANDROID_APP"===R&&v.keepScreenOn())},me=function(){["ANDROID_APP","IOS_APP"].includes(R)&&("IOS_APP"===R&&N.postMessage({action:"keepScreenOn",flag:!1}),"ANDROID_APP"===R&&v.keepScreenNormal())},ke=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===R&&N.postMessage({action:"getClipBoardData"}),"ANDROID_APP"===R&&v.getText())},Me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(R)&&("IOS_APP"===R&&N.postMessage({action:"setClipBoardData",text:e.data||""}),"ANDROID_APP"===R&&v.setText(e.data||""))},Ee=function(){["ANDROID_APP","IOS_APP"].includes(R)&&("IOS_APP"===R&&N.postMessage({action:"showAppRating"}),"ANDROID_APP"===R&&v.showInAppReview())},Fe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"checkBiometricStatus"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.checkBiometricStatus(),"IOS_APP"===R&&N.postMessage({action:"checkBiometricStatus"}))},Ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback,t=e.secret;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"saveBiometricSecret"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.saveSecret(t),"IOS_APP"===R&&N.postMessage({action:"saveBiometricSecret",secret:t}))},Be=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"deleteBiometricSecret"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.deleteSecret(),"IOS_APP"===R&&N.postMessage({action:"deleteBiometricSecret"}))},Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback,t=e.prompt;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"showBiometric"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.callBiometric(t||"Authenticate to continue!"),"IOS_APP"===R&&N.postMessage({action:"showBiometric",prompt:t||""}))},We=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(R)&&(b((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===R&&N.postMessage({action:"requestTrackingAuthorization"}))},Le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(R)&&(b((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===R&&N.postMessage({action:"trackingConsentStatus"}))},Je=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.enabled;"IOS_APP"===R&&N.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n}),"ANDROID_APP"===R&&v.setFirebaseAnalyticsCollection(n)}},Ve=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.userId;"IOS_APP"===R&&N.postMessage({action:"setFirebaseUserId",userId:n}),"ANDROID_APP"===R&&v.setFirebaseUserId(n)}},He=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.key,t=e.value;"IOS_APP"===R&&N.postMessage({action:"setFirebaseUserProp",key:n,value:t}),"ANDROID_APP"===R&&v.setFirebaseUserProp(n,t)}},xe=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.parameters;"IOS_APP"===R&&N.postMessage({action:"setFirebaseDefaultParam",parameters:n}),"ANDROID_APP"===R&&v.setFirebaseDefaultParam(n)}},qe=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.eventName,t=e.parameters;"IOS_APP"===R&&N.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t}),"ANDROID_APP"===R&&v.logFirebaseEvent(n,t)}},Ge=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.screenName,t=e.screenClass;"IOS_APP"===R&&N.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t}),"ANDROID_APP"===R&&v.logFirebaseScreenView(n,t)}},Ke=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.toTopic;"IOS_APP"===R&&N.postMessage({action:"firebaseSubscribeToTopic",topic:n}),"ANDROID_APP"===R&&v.subscribeToTopic(n)}},je=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.fromTopic;"IOS_APP"===R&&N.postMessage({action:"firebaseUnsubscribeFromTopic",topic:n}),"ANDROID_APP"===R&&v.unsubscribeFromTopic(n)}},Xe=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback;b((function(e){"getFCMToken"===e.type&&("ANDROID_APP"===R&&(e.token=e.fcm_registration_token),n&&n(e))})),"IOS_APP"===R&&N.postMessage({action:"getFCMToken"}),"ANDROID_APP"===R&&v.getRegistrationToken()}},ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(R)&&"IOS_APP"===R&&N.postMessage({action:"haptikEffect",effect:e.effect})},Qe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url,t=e.imageUrl,i=void 0===t?"https://images.freeimages.com/images/large-previews/3b2/prague-conference-center-1056491.jpg":t;["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.playMedia(JSON.stringify({url:n,imageUrl:i}))},Ze=function(){["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.pausePlaying()},Ye=function(){["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.stopPlaying()};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&&(Pe&&Pe(t),Pe=null)})),w&&v.openVoiceSearch(),"function"==typeof n&&(Pe=n),ce},window.WTN.Barcode=i,window.WTN.AdMob=o,window.WTN.socialLogin=De,window.WTN.inAppPurchase=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback,t=e.productId,i=e.productType,o=e.isConsumable,r=void 0!==o&&o;b((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===R&&N.postMessage({action:"inAppPurchase",productId:t}),"ANDROID_APP"===R&&v.inAppPurchase(JSON.stringify({action:"inAppPurchase",productId:t,productType:i,isConsumable:r}))}},window.WTN.getAllPurchases=function(e){if(["ANDROID_APP"].includes(R)){var n=e.callback;b((function(e){"purchaseList"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.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.WTN.MediaPlayer=_,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){N.postMessage({action:"share",url:e.url}),n()}))})}();
|
|
1
|
+
!function(){"use strict";var e={d:function(n,t){for(var i in t)e.o(t,i)&&!e.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:t[i]})},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,{addToSiri:function(){return z},clearAppCache:function(){return x},closeApp:function(){return G},default:function(){return Q},deviceInfo:function(){return U},downloadFile:function(){return B},enablePullToRefresh:function(){return H},hideSplashScreen:function(){return F},isAndroidApp:function(){return M},isDeviceGPSEnabled:function(){return L},isIosApp:function(){return E},isNativeApp:function(){return w},loadOfferCard:function(){return X},openUrlInBrowser:function(){return V},platform:function(){return R},printFunction:function(){return j},shareFile:function(){return q},shareLink:function(){return J},showDateTimePicker:function(){return K},showInAppReview:function(){return W},statusBar:function(){return C}});var t={};e.r(t),e.d(t,{addTrigger:function(){return ne},addTriggers:function(){return te},getPlayerId:function(){return Z},getTriggerValue:function(){return re},getTriggers:function(){return ae},logoutEmail:function(){return ue},logoutSMSNumber:function(){return Pe},removeExternalUserId:function(){return $},removeTrigger:function(){return ie},removeTriggers:function(){return oe},setEmail:function(){return se},setExternalUserId:function(){return Y},setSMSNumber:function(){return ce},setTags:function(){return ee}});var i={};e.r(i),e.d(i,{BarcodeScan:function(){return Ie},Format:function(){return de},Types:function(){return fe}});var o={};e.r(o),e.d(o,{bannerAd:function(){return De},fullScreenAd:function(){return pe},rewardsAd:function(){return _e}});var r={};e.r(r),e.d(r,{logEvent:function(){return Ne},setCustomerUserId:function(){return ve}});var a={};e.r(a),e.d(a,{send:function(){return Re},sendPurchase:function(){return we}});var s={};e.r(s),e.d(s,{hide:function(){return ye},show:function(){return Te}});var c={};e.r(c),e.d(c,{getAll:function(){return be},getPermissionStatus:function(){return he}});var u={};e.r(u),e.d(u,{start:function(){return me},stop:function(){return ke}});var P={};e.r(P),e.d(P,{keepScreenNormal:function(){return Ee},keepScreenOn:function(){return Me}});var A={};e.r(A),e.d(A,{get:function(){return Fe},set:function(){return Ce}});var l={};e.r(l),e.d(l,{prompt:function(){return Be}});var d={};e.r(d),e.d(d,{checkStatus:function(){return Ue},deleteSecret:function(){return Le},saveSecret:function(){return We},show:function(){return Je}});var f={};e.r(f),e.d(f,{request:function(){return Ve},status:function(){return He}});var I={};e.r(I),e.d(I,{logEvent:function(){return je},logScreen:function(){return Xe},setCollection:function(){return xe},setDefaultEventParameters:function(){return Ke},setUserId:function(){return qe},setUserProperty:function(){return Ge}});var O={};e.r(O),e.d(O,{events:function(){return I}});var g={};e.r(g),e.d(g,{getFCMToken:function(){return Ze},subscribe:function(){return ze},unsubscribe:function(){return Qe}});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 Ye}});var _={};e.r(_),e.d(_,{pauseMedia:function(){return en},playMedia:function(){return $e},stopMedia:function(){return nn}});var S="undefined"!=typeof window,v=S&&window.WebToNativeInterface||{},N=S&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,R=v.getAndroidVersion?"ANDROID_APP":N?"IOS_APP":"WEBSITE",w=S&&"WEBSITE"!==R,y={},T=1,h=null;w&&(v.androidCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in n.type,y){var i=y[t],o=i.cb,r=i.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(o(n),a||delete y[t]):(o(n),a||delete y[t])}},window.iOSAdMobCBHook=v.androidAdMobCBHook=function(e){var n=JSON.parse(e);h&&h(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in y){var i=y[t],o=i.cb,r=i.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(o(n),a||delete y[t]):(o(n),a||delete y[t])}});var b=function(e,n){"function"==typeof e&&(n&&n.key?y[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(y[T]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},T+=1))},m=function(e){"function"==typeof e&&(h=e)},k=function(){h&&(h=null)},M="ANDROID_APP"===R,E="IOS_APP"===R,F=function(){w&&v.hideSplashScreen()},C=function(e){w&&(M?v.statusBar(JSON.stringify(e)):E&&N.postMessage({action:"statusBar",color:e.color,style:e.style}))},B=function(e){w&&(M||E&&N.postMessage({action:"downloadFile",downloadUrl:e}))},U=function(){return new Promise((function(e,n){b((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===R?v.getDeviceInfo():"IOS_APP"===R?N.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},W=function(){w&&v.showInAppReview()},L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"isDeviceGPSEnabled"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.isLocationServiceEnabled())},J=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";M&&v.openShareIntent(t),E&&N.postMessage({action:"share",url:t})},V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!e)throw"url is mandatory";M&&v.openUrlInBrowser(e)},H=function(e){M&&v.enableSwipeRefresh(e)},x=function(e){M&&v.clearWebViewCache(JSON.stringify({reload:e}))},q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;M&&v.shareFile(e,n)},G=function(){M&&v.closeApp()},K=function(e){if(["ANDROID_APP"].includes(R)){var n=e.callback,t=e.showDate,i=e.showTime;b((function(e){"DATE_TIME_PICKER"===e.type&&n&&n(e)})),M&&v.pickDateTime(JSON.stringify({showDate:t,showTime:i}))}},j=function(e){if(["ANDROID_APP"].includes(R)){var n=e.type,t=void 0===n?"url":n,i=e.url,o=void 0===i?"":i;M&&v.print(JSON.stringify({type:t,url:o}))}},X=function(e){["ANDROID_APP","IOS_APP"].includes(R)&&(M&&v.showOfferCard(JSON.stringify(e)),e.data&&(e.data=JSON.stringify(e.data)),E&&N.postMessage(e))},z=function(e){["IOS_APP"].includes(R)&&(e.data&&(e.data=JSON.stringify(e.data)),E&&N.postMessage(e))},Q={isAndroidApp:M,isIosApp:E,hideSplashScreen:F,statusBar:C,deviceInfo:U,showInAppReview:W,shareLink:J,platform:R,isNativeApp:w,isDeviceGPSEnabled:L,openUrlInBrowser:V,enablePullToRefresh:H,shareFile:q,clearAppCache:x,closeApp:G,showDateTimePicker:K,printFunction:j,loadOfferCard:X,addToSiri:z},Z=function(){return new Promise((function(e,n){b((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===R?v.getOneSignalId():"IOS_APP"===R?N.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},Y=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===R)return w&&v.setExternalUserId(e);"IOS_APP"===R&&N.postMessage({action:"setExternalUserId",userId:e})},$=function(){if("ANDROID_APP"===R)return w&&v.removeExternalUserId();"IOS_APP"===R&&N.postMessage({action:"removeExternalUserId"})},ee=function(e){var n=e.tags;if(n){if("ANDROID_APP"===R)return w&&v.setUserTags(JSON.stringify(n));"IOS_APP"===R&&N.postMessage({action:"setUserTags",tags:n})}},ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key,t=e.value;"ANDROID_APP"===R?v.addTrigger(JSON.stringify({key:n,value:t})):"IOS_APP"===R&&N.postMessage({action:"addTrigger",key:n,value:t})},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.triggers;"ANDROID_APP"===R?v.addTriggers(JSON.stringify({triggers:n})):"IOS_APP"===R&&N.postMessage({action:"addTriggers",triggers:n})},ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;"ANDROID_APP"===R?v.removeTriggerForKey(n):"IOS_APP"===R&&N.postMessage({action:"removeTrigger",key:n})},oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.keys;"ANDROID_APP"===R?v.removeTriggersForKeys(JSON.stringify({keys:n})):"IOS_APP"===R&&N.postMessage({action:"removeTriggers",keys:n})},re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key,t=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"getTriggerValue"===e.type&&t&&t(e)})),"ANDROID_APP"===R?v.getTriggerValueForKey(n):"IOS_APP"===R&&N.postMessage({action:"getTriggerValue",key:n}))},ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"getTriggers"===e.type&&n&&n(e)})),"ANDROID_APP"===R?v.getTriggers():"IOS_APP"===R&&N.postMessage({action:"getTriggers"}))},se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.emailId;["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.setEmail(n)},ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.smsNumber;["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.setSMSNumber(n)},ue=function(){["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.logoutEmail()},Pe=function(){["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.logoutSMSNumber()},Ae=void 0,le=null,de={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},fe={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},Ie=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.onBarcodeSearch,t=e.format;b((function(e){var t=e.type,i=e.value;"BARCODE_SCAN"===t&&n&&n(i)})),"ANDROID_APP"===R&&v.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===R&&N.postMessage({action:"barcodeScan",barcodeFormat:String(t||de.ALL_FORMATS)})}},Oe=void 0,ge=null,De=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(R))return"IOS_APP"===R&&N.postMessage({action:"showBannerAd",adId:e.adId||""}),"ANDROID_APP"===R&&v.showBannerAd(JSON.stringify(e)),Oe},pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.fullScreenAdCallback;return m((function(e){var n=e.status;ge&&ge(e),"adDismissed"===n&&(ge=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&k()})),"IOS_APP"===R&&N.postMessage({action:"showFullScreenAd",adId:e.adId||""}),"ANDROID_APP"===R&&v.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(ge=n),Oe}},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.rewardsAdCallback;return m((function(e){var n=e.status;ge&&ge(e),"adDismissed"===n&&(ge=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&k()})),"IOS_APP"===R&&N.postMessage({action:"showRewardAd",adId:e.adId||""}),"ANDROID_APP"===R&&v.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(ge=n),Oe}},Se={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback,t=e.scope;b((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.loginWithFacebook(),"IOS_APP"===R&&N.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback,t=e.scope;b((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.logoutWithFacebook(),"IOS_APP"===R&&N.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback,t=e.scope;b((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.signInWithGoogle(),"IOS_APP"===R&&N.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback,t=e.scope;b((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.signOutWithGoogle(),"IOS_APP"===R&&N.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback,t=e.scope;b((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===R&&N.postMessage({action:"appleSignIn",scope:t})}}}},ve=function(e){["ANDROID_APP","IOS_APP"].includes(R)&&("ANDROID_APP"===R&&v.setAppsFlyerUserId(e),"IOS_APP"===R&&N.postMessage({action:"setAppsFlyerUserId",userId:e}))},Ne=function(e,n){["ANDROID_APP","IOS_APP"].includes(R)&&("ANDROID_APP"===R&&v.addEventToAppsFlyer(e,JSON.stringify(n)),"IOS_APP"===R&&N.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},Re=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.event,t=e.valueToSum,i=e.parameters;"ANDROID_APP"===R&&v.addFbEvents(n,i),"IOS_APP"===R&&N.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:i})}},we=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.amount,t=e.currency,i=e.parameters;"ANDROID_APP"===R&&v.addFbPurchaseEvent(n,t,i),"IOS_APP"===R&&N.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:i})}},ye=function(){["ANDROID_APP","IOS_APP"].includes(R)&&("ANDROID_APP"===R&&v.showHideStickyFooter(!1),"IOS_APP"===R&&N.postMessage({action:"showHideStickyFooter",show:!1}))},Te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;["ANDROID_APP","IOS_APP"].includes(R)&&("ANDROID_APP"===R&&v.showHideStickyFooter(!0),"IOS_APP"===R&&N.postMessage({action:"showHideStickyFooter",show:!0,key:n}))},he=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"contactPermissionStatus"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.getPermissionStatus(),"IOS_APP"===R&&N.postMessage({action:"askUserForContactPermission"}))},be=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"contactDetails"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.getAll(),"IOS_APP"===R&&N.postMessage({action:"getUserContactDetails"}))},me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.data,t=e.callback,i=e.backgroundIndicator,o=void 0!==i&&i,r=e.pauseAutomatically,a=void 0===r||r,s=e.distanceFilter,c=void 0===s?0:s,u=e.desiredAccuracy,P=void 0===u?"best":u,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"===R&&N.postMessage({action:"startLocation",data:n,backgroundIndicator:o,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:P,activityType:l,apiUrl:d,timeout:f}),"ANDROID_APP"===R&&v.startTrackingLocation(JSON.stringify({action:"startLocation",data:n,interval:f,callback:t,apiUrl:d,displacement:c}))}},ke=function(){["ANDROID_APP","IOS_APP"].includes(R)&&(delete y["LOCATION_UPDATE"],"IOS_APP"===R&&N.postMessage({action:"stopLocation"}),"ANDROID_APP"===R&&v.stopTrackingLocation())},Me=function(){["ANDROID_APP","IOS_APP"].includes(R)&&("IOS_APP"===R&&N.postMessage({action:"keepScreenOn",flag:!0}),"ANDROID_APP"===R&&v.keepScreenOn())},Ee=function(){["ANDROID_APP","IOS_APP"].includes(R)&&("IOS_APP"===R&&N.postMessage({action:"keepScreenOn",flag:!1}),"ANDROID_APP"===R&&v.keepScreenNormal())},Fe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===R&&N.postMessage({action:"getClipBoardData"}),"ANDROID_APP"===R&&v.getText())},Ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(R)&&("IOS_APP"===R&&N.postMessage({action:"setClipBoardData",text:e.data||""}),"ANDROID_APP"===R&&v.setText(e.data||""))},Be=function(){["ANDROID_APP","IOS_APP"].includes(R)&&("IOS_APP"===R&&N.postMessage({action:"showAppRating"}),"ANDROID_APP"===R&&v.showInAppReview())},Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"checkBiometricStatus"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.checkBiometricStatus(),"IOS_APP"===R&&N.postMessage({action:"checkBiometricStatus"}))},We=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback,t=e.secret;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"saveBiometricSecret"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.saveSecret(t),"IOS_APP"===R&&N.postMessage({action:"saveBiometricSecret",secret:t}))},Le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"deleteBiometricSecret"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.deleteSecret(),"IOS_APP"===R&&N.postMessage({action:"deleteBiometricSecret"}))},Je=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback,t=e.prompt;["ANDROID_APP","IOS_APP"].includes(R)&&(b((function(e){"showBiometric"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.callBiometric(t||"Authenticate to continue!"),"IOS_APP"===R&&N.postMessage({action:"showBiometric",prompt:t||""}))},Ve=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(R)&&(b((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===R&&N.postMessage({action:"requestTrackingAuthorization"}))},He=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(R)&&(b((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===R&&N.postMessage({action:"trackingConsentStatus"}))},xe=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.enabled;"IOS_APP"===R&&N.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n}),"ANDROID_APP"===R&&v.setFirebaseAnalyticsCollection(n)}},qe=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.userId;"IOS_APP"===R&&N.postMessage({action:"setFirebaseUserId",userId:n}),"ANDROID_APP"===R&&v.setFirebaseUserId(n)}},Ge=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.key,t=e.value;"IOS_APP"===R&&N.postMessage({action:"setFirebaseUserProp",key:n,value:t}),"ANDROID_APP"===R&&v.setFirebaseUserProp(n,t)}},Ke=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.parameters;"IOS_APP"===R&&N.postMessage({action:"setFirebaseDefaultParam",parameters:n}),"ANDROID_APP"===R&&v.setFirebaseDefaultParam(n)}},je=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.eventName,t=e.parameters;"IOS_APP"===R&&N.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t}),"ANDROID_APP"===R&&v.logFirebaseEvent(n,t)}},Xe=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.screenName,t=e.screenClass;"IOS_APP"===R&&N.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t}),"ANDROID_APP"===R&&v.logFirebaseScreenView(n,t)}},ze=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.toTopic;"IOS_APP"===R&&N.postMessage({action:"firebaseSubscribeToTopic",topic:n}),"ANDROID_APP"===R&&v.subscribeToTopic(n)}},Qe=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.fromTopic;"IOS_APP"===R&&N.postMessage({action:"firebaseUnsubscribeFromTopic",topic:n}),"ANDROID_APP"===R&&v.unsubscribeFromTopic(n)}},Ze=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback;b((function(e){"getFCMToken"===e.type&&("ANDROID_APP"===R&&(e.token=e.fcm_registration_token),n&&n(e))})),"IOS_APP"===R&&N.postMessage({action:"getFCMToken"}),"ANDROID_APP"===R&&v.getRegistrationToken()}},Ye=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(R)&&"IOS_APP"===R&&N.postMessage({action:"haptikEffect",effect:e.effect})},$e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url,t=e.imageUrl,i=void 0===t?"https://images.freeimages.com/images/large-previews/3b2/prague-conference-center-1056491.jpg":t;["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.playMedia(JSON.stringify({url:n,imageUrl:i}))},en=function(){["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.pausePlaying()},nn=function(){["ANDROID_APP","IOS_APP"].includes(R)&&"ANDROID_APP"===R&&v.stopPlaying()};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&&(le&&le(t),le=null)})),w&&v.openVoiceSearch(),"function"==typeof n&&(le=n),Ae},window.WTN.Barcode=i,window.WTN.AdMob=o,window.WTN.socialLogin=Se,window.WTN.inAppPurchase=function(e){if(["ANDROID_APP","IOS_APP"].includes(R)){var n=e.callback,t=e.productId,i=e.productType,o=e.isConsumable,r=void 0!==o&&o;b((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===R&&N.postMessage({action:"inAppPurchase",productId:t}),"ANDROID_APP"===R&&v.inAppPurchase(JSON.stringify({action:"inAppPurchase",productId:t,productType:i,isConsumable:r}))}},window.WTN.getAllPurchases=function(e){if(["ANDROID_APP"].includes(R)){var n=e.callback;b((function(e){"purchaseList"===e.type&&n&&n(e)})),"ANDROID_APP"===R&&v.getAllPurchases({action:"purchaseList"})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=P,window.WTN.backgroundLocation=u,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.WTN.MediaPlayer=_,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){N.postMessage({action:"share",url:e.url}),n()}))})}();
|