webtonative 1.0.24 → 1.0.25
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/Haptics/index.js +1 -0
- package/package.json +1 -1
- package/webtonative.min.js +1 -1
package/Haptics/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.trigger=void 0;var _utills=require("../utills"),trigger=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"haptikEffect",effect:a.effect})};exports.trigger=trigger;
|
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 C},deviceInfo:function(){return k},hideSplashScreen:function(){return h},isAndroidApp:function(){return b},isIosApp:function(){return R},isNativeApp:function(){return _},platform:function(){return v},shareLink:function(){return M},showInAppReview:function(){return E},statusBar:function(){return m}});var t={};e.r(t),e.d(t,{getPlayerId:function(){return W},removeExternalUserId:function(){return U},setExternalUserId:function(){return F},setTags:function(){return L}});var o={};e.r(o),e.d(o,{BarcodeScan:function(){return q},Format:function(){return x},Types:function(){return H}});var i={};e.r(i),e.d(i,{bannerAd:function(){return G},fullScreenAd:function(){return K},rewardsAd:function(){return X}});var r={};e.r(r),e.d(r,{logEvent:function(){return Z},setCustomerUserId:function(){return Q}});var a={};e.r(a),e.d(a,{send:function(){return Y},sendPurchase:function(){return $}});var s={};e.r(s),e.d(s,{hide:function(){return ee},show:function(){return ne}});var c={};e.r(c),e.d(c,{getAll:function(){return oe},getPermissionStatus:function(){return te}});var u={};e.r(u),e.d(u,{start:function(){return ie},stop:function(){return re}});var P={};e.r(P),e.d(P,{keepScreenNormal:function(){return se},keepScreenOn:function(){return ae}});var d={};e.r(d),e.d(d,{get:function(){return ce},set:function(){return ue}});var A={};e.r(A),e.d(A,{prompt:function(){return Pe}});var l={};e.r(l),e.d(l,{request:function(){return de},status:function(){return Ae}});var f={};e.r(f),e.d(f,{logEvent:function(){return Oe},logScreen:function(){return ge},setCollection:function(){return le},setDefaultEventParameters:function(){return pe},setUserId:function(){return fe},setUserProperty:function(){return Ie}});var I={};e.r(I),e.d(I,{events:function(){return f}});var p="undefined"!=typeof window,O=p&&window.WebToNativeInterface||{},g=p&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,v=O.getAndroidVersion?"ANDROID_APP":g?"IOS_APP":"WEBSITE",_=p&&"WEBSITE"!==v,S={},D=1,N=null;_&&(O.androidCBHook=function(e){var n=JSON.parse(e);for(var t in n.type,S)n&&n.reqType?t==n.reqType&&(S[t].cb(n),delete S[t]):(S[t].cb(n),delete S[t])},O.androidAdMobCBHook=function(e){var n=JSON.parse(e);N&&N(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in S){var o=S[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete S[t]):(i(n),a||delete S[t])}});var w=function(e,n){"function"==typeof e&&(n&&n.key?S[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(S[D]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},D+=1))},y=function(e){"function"==typeof e&&(N=e)},T=function(){N&&(N=null)},b="ANDROID_APP"===v,R="IOS_APP"===v,h=function(){_&&O.hideSplashScreen()},m=function(e){_&&(b?O.statusBar(JSON.stringify(e)):R&&g.postMessage({action:"statusBar",color:e.color,style:e.style}))},k=function(){return new Promise((function(e,n){w((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===v?O.getDeviceInfo():"IOS_APP"===v?g.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},E=function(){_&&O.showInAppReview()},M=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";b&&O.openShareIntent(t),R&&g.postMessage({action:"share",url:t})},C={isAndroidApp:b,isIosApp:R,hideSplashScreen:h,statusBar:m,deviceInfo:k,showInAppReview:E,shareLink:M,platform:v,isNativeApp:_},W=function(){return new Promise((function(e,n){w((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===v?O.getOneSignalId():"IOS_APP"===v?g.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},F=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===v)return _&&O.setExternalUserId(e);"IOS_APP"===v&&g.postMessage({action:"setExternalUserId",userId:e})},U=function(){if("ANDROID_APP"===v)return _&&O.removeExternalUserId();"IOS_APP"===v&&g.postMessage({action:"removeExternalUserId"})},L=function(e){var n=e.tags;if("ANDROID_APP"===v)return _&&O.setUserTags(n);"IOS_APP"===v&&g.postMessage({action:"setUserTags",tags:n})},B=void 0,V=null,x={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},H={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},q=function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.onBarcodeSearch,t=e.format;w((function(e){var t=e.type,o=e.value;"BARCODE_SCAN"===t&&n&&n(o)})),"ANDROID_APP"===v&&O.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===v&&g.postMessage({action:"barcodeScan",barcodeFormat:String(t||x.ALL_FORMATS)})}},J=void 0,j=null,G=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _&&O.showBannerAd(JSON.stringify(e)),J},K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==v){var n=e.fullScreenAdCallback;return y((function(e){var n=e.status;j&&j(e),"adDismissed"===n&&(j=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&T()})),_&&O.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(j=n),J}},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==v){var n=e.rewardsAdCallback;return y((function(e){var n=e.status;j&&j(e),"adDismissed"===n&&(j=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&T()})),_&&O.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(j=n),J}},z={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.callback,t=e.scope;w((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===v&&O.loginWithFacebook(),"IOS_APP"===v&&g.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.callback,t=e.scope;w((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===v&&O.logoutWithFacebook(),"IOS_APP"===v&&g.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.callback,t=e.scope;w((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===v&&O.signInWithGoogle(),"IOS_APP"===v&&g.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.callback,t=e.scope;w((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===v&&O.signOutWithGoogle(),"IOS_APP"===v&&g.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.callback,t=e.scope;w((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===v&&g.postMessage({action:"appleSignIn",scope:t})}}}},Q=function(e){["ANDROID_APP","IOS_APP"].includes(v)&&("ANDROID_APP"===v&&O.setAppsFlyerUserId(e),"IOS_APP"===v&&g.postMessage({action:"setAppsFlyerUserId",userId:e}))},Z=function(e,n){["ANDROID_APP","IOS_APP"].includes(v)&&("ANDROID_APP"===v&&O.addEventToAppsFlyer(e,n),"IOS_APP"===v&&g.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},Y=function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.event,t=e.valueToSum,o=e.parameters;"ANDROID_APP"===v&&O.addFbEvents(n,o),"IOS_APP"===v&&g.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:o})}},$=function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.amount,t=e.currency,o=e.parameters;"ANDROID_APP"===v&&O.addFbPurchaseEvent(n,t,o),"IOS_APP"===v&&g.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:o})}},ee=function(){["ANDROID_APP","IOS_APP"].includes(v)&&"IOS_APP"===v&&g.postMessage({action:"showHideStickyFooter",show:!1})},ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;["ANDROID_APP","IOS_APP"].includes(v)&&"IOS_APP"===v&&g.postMessage({action:"showHideStickyFooter",show:!0,key:n})},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(v)&&(w((function(e){console.log(e),"contactPermissionStatus"===e.type&&n&&n(e)})),"IOS_APP"===v&&g.postMessage({action:"askUserForContactPermission"}))},oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(v)&&(w((function(e){var t=e.type;console.log(e),"contactDetails"===t&&n&&n(e)})),"IOS_APP"===v&&g.postMessage({action:"getUserContactDetails"}))},ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(v)){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,u=e.desiredAccuracy,P=void 0===u?"best":u,d=e.activityType,A=void 0===d?"other":d,l=e.apiUrl,f=e.timeout;w((function(e){"LOCATION_UPDATE"===e.type&&t&&t(e)}),{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===v&&g.postMessage({action:"startLocation",data:n,backgroundIndicator:i,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:P,activityType:A,apiUrl:l,timeout:f})}},re=function(){["ANDROID_APP","IOS_APP"].includes(v)&&(delete S["LOCATION_UPDATE"],"IOS_APP"===v&&g.postMessage({action:"stopLocation"}))},ae=function(){["ANDROID_APP","IOS_APP"].includes(v)&&"IOS_APP"===v&&g.postMessage({action:"keepScreenOn",flag:!0})},se=function(){["ANDROID_APP","IOS_APP"].includes(v)&&"IOS_APP"===v&&g.postMessage({action:"keepScreenOn",flag:!1})},ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(v)&&(w((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===v&&g.postMessage({action:"getClipBoardData"}))},ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(v)&&"IOS_APP"===v&&g.postMessage({action:"setClipBoardData",text:e.data||""})},Pe=function(){["ANDROID_APP","IOS_APP"].includes(v)&&"IOS_APP"===v&&g.postMessage({action:"showAppRating"})},de=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(v)&&(w((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===v&&g.postMessage({action:"requestTrackingAuthorization"}))},Ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(v)&&(w((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===v&&g.postMessage({action:"trackingConsentStatus"}))},le=function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.enabled;"IOS_APP"===v&&g.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n})}},fe=function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.userId;"IOS_APP"===v&&g.postMessage({action:"setFirebaseUserId",userId:n})}},Ie=function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.key,t=e.value;"IOS_APP"===v&&g.postMessage({action:"setFirebaseUserProp",key:n,value:t})}},pe=function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.parameters;"IOS_APP"===v&&g.postMessage({action:"setFirebaseDefaultParam",parameters:n})}},Oe=function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.eventName,t=e.parameters;"IOS_APP"===v&&g.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t})}},ge=function(e){if(["ANDROID_APP","IOS_APP"].includes(v)){var n=e.screenName,t=e.screenClass;"IOS_APP"===v&&g.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t})}};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 w((function(e){var n=e.type,t=e.results;"VOICE_SEARCH_RESULT"===n&&(V&&V(t),V=null)})),_&&O.openVoiceSearch(),"function"==typeof n&&(V=n),B},window.WTN.Barcode=o,window.WTN.AdMob=i,window.WTN.socialLogin=z,window.WTN.inAppPurchase=function(e){if(["IOS_APP"].includes(v)){var n=e.callback,t=e.productId;w((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===v&&g.postMessage({action:"inAppPurchase",productId:t})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=P,window.WTN.backgroundLocation=u,window.WTN.clipboard=d,window.WTN.appReview=A,window.WTN.ATTConsent=l,window.WTN.facebook={events:a},window.WTN.firebaseAnalytics=I,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){g.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 W},deviceInfo:function(){return E},hideSplashScreen:function(){return k},isAndroidApp:function(){return R},isIosApp:function(){return h},isNativeApp:function(){return S},platform:function(){return _},shareLink:function(){return C},showInAppReview:function(){return M},statusBar:function(){return m}});var t={};e.r(t),e.d(t,{getPlayerId:function(){return F},removeExternalUserId:function(){return L},setExternalUserId:function(){return U},setTags:function(){return B}});var o={};e.r(o),e.d(o,{BarcodeScan:function(){return J},Format:function(){return H},Types:function(){return q}});var i={};e.r(i),e.d(i,{bannerAd:function(){return K},fullScreenAd:function(){return X},rewardsAd:function(){return z}});var r={};e.r(r),e.d(r,{logEvent:function(){return Y},setCustomerUserId:function(){return Z}});var a={};e.r(a),e.d(a,{send:function(){return $},sendPurchase:function(){return ee}});var s={};e.r(s),e.d(s,{hide:function(){return ne},show:function(){return te}});var c={};e.r(c),e.d(c,{getAll:function(){return ie},getPermissionStatus:function(){return oe}});var u={};e.r(u),e.d(u,{start:function(){return re},stop:function(){return ae}});var P={};e.r(P),e.d(P,{keepScreenNormal:function(){return ce},keepScreenOn:function(){return se}});var d={};e.r(d),e.d(d,{get:function(){return ue},set:function(){return Pe}});var A={};e.r(A),e.d(A,{prompt:function(){return de}});var l={};e.r(l),e.d(l,{request:function(){return Ae},status:function(){return le}});var f={};e.r(f),e.d(f,{logEvent:function(){return ge},logScreen:function(){return ve},setCollection:function(){return fe},setDefaultEventParameters:function(){return Oe},setUserId:function(){return Ie},setUserProperty:function(){return pe}});var I={};e.r(I),e.d(I,{events:function(){return f}});var p={};e.r(p),e.d(p,{trigger:function(){return _e}});var O="undefined"!=typeof window,g=O&&window.WebToNativeInterface||{},v=O&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,_=g.getAndroidVersion?"ANDROID_APP":v?"IOS_APP":"WEBSITE",S=O&&"WEBSITE"!==_,D={},N=1,w=null;S&&(g.androidCBHook=function(e){var n=JSON.parse(e);for(var t in n.type,D)n&&n.reqType?t==n.reqType&&(D[t].cb(n),delete D[t]):(D[t].cb(n),delete D[t])},g.androidAdMobCBHook=function(e){var n=JSON.parse(e);w&&w(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in D){var o=D[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete D[t]):(i(n),a||delete D[t])}});var y=function(e,n){"function"==typeof e&&(n&&n.key?D[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(D[N]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},N+=1))},T=function(e){"function"==typeof e&&(w=e)},b=function(){w&&(w=null)},R="ANDROID_APP"===_,h="IOS_APP"===_,k=function(){S&&g.hideSplashScreen()},m=function(e){S&&(R?g.statusBar(JSON.stringify(e)):h&&v.postMessage({action:"statusBar",color:e.color,style:e.style}))},E=function(){return new Promise((function(e,n){y((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===_?g.getDeviceInfo():"IOS_APP"===_?v.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},M=function(){S&&g.showInAppReview()},C=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";R&&g.openShareIntent(t),h&&v.postMessage({action:"share",url:t})},W={isAndroidApp:R,isIosApp:h,hideSplashScreen:k,statusBar:m,deviceInfo:E,showInAppReview:M,shareLink:C,platform:_,isNativeApp:S},F=function(){return new Promise((function(e,n){y((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===_?g.getOneSignalId():"IOS_APP"===_?v.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},U=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===_)return S&&g.setExternalUserId(e);"IOS_APP"===_&&v.postMessage({action:"setExternalUserId",userId:e})},L=function(){if("ANDROID_APP"===_)return S&&g.removeExternalUserId();"IOS_APP"===_&&v.postMessage({action:"removeExternalUserId"})},B=function(e){var n=e.tags;if("ANDROID_APP"===_)return S&&g.setUserTags(n);"IOS_APP"===_&&v.postMessage({action:"setUserTags",tags:n})},V=void 0,x=null,H={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},q={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},J=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.onBarcodeSearch,t=e.format;y((function(e){var t=e.type,o=e.value;"BARCODE_SCAN"===t&&n&&n(o)})),"ANDROID_APP"===_&&g.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===_&&v.postMessage({action:"barcodeScan",barcodeFormat:String(t||H.ALL_FORMATS)})}},j=void 0,G=null,K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return S&&g.showBannerAd(JSON.stringify(e)),j},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==_){var n=e.fullScreenAdCallback;return T((function(e){var n=e.status;G&&G(e),"adDismissed"===n&&(G=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&b()})),S&&g.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(G=n),j}},z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==_){var n=e.rewardsAdCallback;return T((function(e){var n=e.status;G&&G(e),"adDismissed"===n&&(G=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&b()})),S&&g.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(G=n),j}},Q={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.loginWithFacebook(),"IOS_APP"===_&&v.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.logoutWithFacebook(),"IOS_APP"===_&&v.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.signInWithGoogle(),"IOS_APP"===_&&v.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.signOutWithGoogle(),"IOS_APP"===_&&v.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"appleSignIn",scope:t})}}}},Z=function(e){["ANDROID_APP","IOS_APP"].includes(_)&&("ANDROID_APP"===_&&g.setAppsFlyerUserId(e),"IOS_APP"===_&&v.postMessage({action:"setAppsFlyerUserId",userId:e}))},Y=function(e,n){["ANDROID_APP","IOS_APP"].includes(_)&&("ANDROID_APP"===_&&g.addEventToAppsFlyer(e,n),"IOS_APP"===_&&v.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},$=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.event,t=e.valueToSum,o=e.parameters;"ANDROID_APP"===_&&g.addFbEvents(n,o),"IOS_APP"===_&&v.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:o})}},ee=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.amount,t=e.currency,o=e.parameters;"ANDROID_APP"===_&&g.addFbPurchaseEvent(n,t,o),"IOS_APP"===_&&v.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:o})}},ne=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.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(_)&&"IOS_APP"===_&&v.postMessage({action:"showHideStickyFooter",show:!0,key:n})},oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){console.log(e),"contactPermissionStatus"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"askUserForContactPermission"}))},ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){var t=e.type;console.log(e),"contactDetails"===t&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"getUserContactDetails"}))},re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(_)){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,u=e.desiredAccuracy,P=void 0===u?"best":u,d=e.activityType,A=void 0===d?"other":d,l=e.apiUrl,f=e.timeout;y((function(e){"LOCATION_UPDATE"===e.type&&t&&t(e)}),{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===_&&v.postMessage({action:"startLocation",data:n,backgroundIndicator:i,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:P,activityType:A,apiUrl:l,timeout:f})}},ae=function(){["ANDROID_APP","IOS_APP"].includes(_)&&(delete D["LOCATION_UPDATE"],"IOS_APP"===_&&v.postMessage({action:"stopLocation"}))},se=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"keepScreenOn",flag:!0})},ce=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"keepScreenOn",flag:!1})},ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"getClipBoardData"}))},Pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"setClipBoardData",text:e.data||""})},de=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"showAppRating"})},Ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(_)&&(y((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"requestTrackingAuthorization"}))},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(_)&&(y((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"trackingConsentStatus"}))},fe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.enabled;"IOS_APP"===_&&v.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n})}},Ie=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.userId;"IOS_APP"===_&&v.postMessage({action:"setFirebaseUserId",userId:n})}},pe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.key,t=e.value;"IOS_APP"===_&&v.postMessage({action:"setFirebaseUserProp",key:n,value:t})}},Oe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.parameters;"IOS_APP"===_&&v.postMessage({action:"setFirebaseDefaultParam",parameters:n})}},ge=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.eventName,t=e.parameters;"IOS_APP"===_&&v.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t})}},ve=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.screenName,t=e.screenClass;"IOS_APP"===_&&v.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t})}},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&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 y((function(e){var n=e.type,t=e.results;"VOICE_SEARCH_RESULT"===n&&(x&&x(t),x=null)})),S&&g.openVoiceSearch(),"function"==typeof n&&(x=n),V},window.WTN.Barcode=o,window.WTN.AdMob=i,window.WTN.socialLogin=Q,window.WTN.inAppPurchase=function(e){if(["IOS_APP"].includes(_)){var n=e.callback,t=e.productId;y((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"inAppPurchase",productId:t})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=P,window.WTN.backgroundLocation=u,window.WTN.clipboard=d,window.WTN.appReview=A,window.WTN.ATTConsent=l,window.WTN.facebook={events:a},window.WTN.firebaseAnalytics=I,window.WTN.haptics=p,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()}))})}();
|