webtonative 1.0.28 → 1.0.29

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