median-js-bridge 2.16.0 → 2.17.0
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/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/median.min.js +1 -1
- package/dist/plugins/customerio.d.ts +26 -0
- package/dist/plugins/customerio.d.ts.map +1 -0
- package/dist/plugins/customerio.js +60 -0
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +1 -0
- package/dist/types/customerio.d.ts +32 -0
- package/dist/types/customerio.d.ts.map +1 -0
- package/dist/types/customerio.js +1 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/plugins/customerio.ts +63 -0
- package/src/plugins/index.ts +1 -0
- package/src/types/customerio.ts +38 -0
package/dist/index.d.ts
CHANGED
|
@@ -842,6 +842,29 @@ declare namespace Median {
|
|
|
842
842
|
permissionStatus: (params: import("./types/index.js").CallbackParams<import("./types/index.js").PermissionStatusData>) => Promise<import("./types/index.js").PermissionStatusData>;
|
|
843
843
|
requestPermission: (params: import("./types/index.js").CallbackParams<import("./types/index.js").PermissionStatusData>) => Promise<import("./types/index.js").PermissionStatusData>;
|
|
844
844
|
};
|
|
845
|
+
const customerio: {
|
|
846
|
+
identify: (params: import("./types/customerio.js").CustomerIo.IdentifyParams) => Promise<import("./types/customerio.js").CustomerIo.Result>;
|
|
847
|
+
reset: () => Promise<import("./types/customerio.js").CustomerIo.Result>;
|
|
848
|
+
getUserId: () => Promise<string | null>;
|
|
849
|
+
setProfileAttributes: (attributes: import("./types/customerio.js").CustomerIo.Attributes) => Promise<import("./types/customerio.js").CustomerIo.Result>;
|
|
850
|
+
setDeviceAttributes: (attributes: import("./types/customerio.js").CustomerIo.Attributes) => Promise<import("./types/customerio.js").CustomerIo.Result>;
|
|
851
|
+
deleteDeviceToken: () => Promise<import("./types/customerio.js").CustomerIo.Result>;
|
|
852
|
+
push: {
|
|
853
|
+
getPermissionStatus: () => Promise<import("./types/customerio.js").CustomerIo.PermissionResult>;
|
|
854
|
+
requestPermission: () => Promise<import("./types/customerio.js").CustomerIo.PermissionResult>;
|
|
855
|
+
opened: {
|
|
856
|
+
addListener: (callback: (data: import("./types/customerio.js").CustomerIo.PushPayload) => void) => Promise<any>;
|
|
857
|
+
removeListener: (listenerId: string) => void;
|
|
858
|
+
};
|
|
859
|
+
received: {
|
|
860
|
+
addListener: (callback: (data: import("./types/customerio.js").CustomerIo.PushPayload) => void) => Promise<any>;
|
|
861
|
+
removeListener: (listenerId: string) => void;
|
|
862
|
+
};
|
|
863
|
+
};
|
|
864
|
+
track: (params: import("./types/customerio.js").CustomerIo.EventParams) => Promise<import("./types/customerio.js").CustomerIo.Result>;
|
|
865
|
+
screen: (params: import("./types/customerio.js").CustomerIo.EventParams) => Promise<import("./types/customerio.js").CustomerIo.Result>;
|
|
866
|
+
setLogLevel: (level: import("./types/customerio.js").CustomerIo.LogLevel) => Promise<import("./types/customerio.js").CustomerIo.Result>;
|
|
867
|
+
};
|
|
845
868
|
const documentScanner: {
|
|
846
869
|
scanPage: (params: import("./types/index.js").CallbackParams<{
|
|
847
870
|
image: string;
|
|
@@ -1998,6 +2021,7 @@ declare namespace Median {
|
|
|
1998
2021
|
export default Median;
|
|
1999
2022
|
export { AppsFlyer } from './types/appsflyer.js';
|
|
2000
2023
|
export { Clerk } from './types/clerk.js';
|
|
2024
|
+
export { CustomerIo } from './types/customerio.js';
|
|
2001
2025
|
export { HealthBridge } from './types/healthBridge.js';
|
|
2002
2026
|
export { JWPlayer } from './types/jwplayer.js';
|
|
2003
2027
|
export { MasterLock } from './types/masterlock.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AA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EG;IACI,MAAM,iBAAiB;;;KAA4E,CAAC;IAC3G;;OAEG;IACI,MAAM,iBAAiB;;;KAAsE,CAAC;IACrG;;OAEG;IACI,MAAM,YAAY;;;KAAmE,CAAC;IAC7F;;OAEG;IACI,MAAM,YAAY;;;KAA+D,CAAC;IACzF;;OAEG;IACI,MAAM,mBAAmB;;;KAAuE,CAAC;IACxG;;OAEG;IACI,MAAM,UAAU;;;KAAyD,CAAC;CAClF;AAED,eAAe,MAAM,CAAC;AAKtB,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -52,6 +52,7 @@ var Median;
|
|
|
52
52
|
Median.clerk = plugins.clerk;
|
|
53
53
|
Median.contacts = plugins.contacts;
|
|
54
54
|
Median.cordial = plugins.cordial;
|
|
55
|
+
Median.customerio = plugins.customerio;
|
|
55
56
|
Median.documentScanner = plugins.documentScanner;
|
|
56
57
|
Median.downloads = plugins.downloads;
|
|
57
58
|
Median.esmiley = plugins.esmiley;
|
package/dist/median.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Median=function(){"use strict";function e(e="_median_temp_"){return e+Math.random().toString(36).slice(2)}function n(n,t){if("string"==typeof n)return n;const i=e();return window[i]=function(...e){n(...e),t||delete window[i]},i}function t(e,t,i){let a=e;t&&(a={},t.callback&&"function"==typeof t.callback&&(t.callback=n(t.callback,i)),t.callbackFunction&&"function"==typeof t.callbackFunction&&(t.callbackFunction=n(t.callbackFunction,i)),t.statuscallback&&"function"==typeof t.statuscallback&&(t.statuscallback=n(t.statuscallback,i)),a.medianCommand=e,a.data=t),window?.JSBridge?.postMessage&&window.JSBridge.postMessage("string"==typeof a?a:JSON.stringify(a)),window?.webkit?.messageHandlers?.JSBridge?.postMessage&&window.webkit.messageHandlers.JSBridge.postMessage(a)}function i(n,i,a){if(i?.callback||i?.callbackFunction||i?.statuscallback)return t(n,i,a);{const a=e();return i||(i={}),i.callback=a,new Promise((function(e,o){window[a]=function(n){n&&"object"==typeof n&&"error"in n?o(n):e(n),delete window[a]},t(n,i)}))}}const a={geoLocation:{promptLocationServices:function(){t("median://geoLocation/promptLocationServices")}},screen:{fullscreen:function(){t("median://screen/fullscreen")},normal:function(){t("median://screen/normal")},keepScreenOn:function(){t("median://screen/keepScreenOn")},keepScreenNormal:function(){t("median://screen/keepScreenNormal")}},audio:{requestFocus:function(e){t("median://audio/requestFocus",{enabled:e})}}},o={};function r(e,n){window[e]=function(...e){Object.keys(n).forEach((t=>{const i=n[t];"function"==typeof i&&i(...e)}))}}function s(e,n){return t(n?"median://events/subscribe":"median://events/unsubscribe",{eventName:e})}const c=n=>({addListener:t=>((n,t)=>{const i=e(n);return"function"!=typeof t||(o[n]=o[n]||{},o[n][i]=t,r(n,o[n]),s(n,!0)),i})(n,t),removeListener:e=>((e,n)=>{e&&n&&(o[e]=o[e]||{},delete o[e][n],r(e,o[e]),0===Object.keys(o[e]).length&&s(e,!1))})(n,e)}),u={camera:{setCaptureQuality:function(e){t("median://camera/setCaptureQuality",{quality:e})},saveToGallery:function(e){t("median://camera/saveToGallery",{saveToGallery:e})}},clipboard:{set:function(e){t("median://clipboard/set",e)},get:function(e){return i("median://clipboard/get",e)}},config:{set:function(e){t("median://config/set",e)}},connectivity:{get:function(e){return i("median://connectivity/get",e)},subscribe:function(e){return i("median://connectivity/subscribe",e,!0)},unsubscribe:function(){t("median://connectivity/unsubscribe")}},contextMenu:{setEnabled:function(e){t("median://contextMenu/setEnabled",{enabled:e})},setLinkActions:function(e){t("median://contextMenu/setLinkActions",{actions:e})}},deviceInfo:function(e){return i("median://run/median_device_info",e,!0)},internalExternal:{set:function(e){t("median://internalExternal/set",e)}},jsNavigation:{url:c("_median_url_changed")},keyboard:{info:function(e){return i("median://keyboard/info",e)},listen:function(e){t("median://keyboard/listen",{callback:e})},showAccessoryView:function(e){t("median://keyboard/showAccessoryView",{visible:e})}},nativebridge:{custom:function(e){return i("median://nativebridge/custom",e)},multi:function(e){t("median://nativebridge/multi",e)}},navigationLevels:{set:function(e){t("median://navigationLevels/set",{persist:e.persist,data:e})},setCurrent:function(e){t("median://navigationLevels/set",e)},revert:function(){t("median://navigationLevels/set?persist=true")}},navigationMaxWindows:{set:function(e,n){t("median://navigationMaxWindows/set",{data:e,autoClose:n,persist:!0})},setCurrent:function(e,n){t("median://navigationMaxWindows/set",{data:e,autoClose:n})}},navigationTitles:{set:function(e){t("median://navigationTitles/set",{persist:e.persist,data:e})},setCurrent:function(e){t("median://navigationTitles/setCurrent",e)},revert:function(){t("median://navigationTitles/set?persist=true")}},open:{appSettings:function(){t("median://open/app-settings")}},registration:{send:function(e){t("median://registration/send",{customData:e})}},run:{deviceInfo:function(){t("median://run/median_device_info")}},screen:{setBrightness:function(e){t("median://screen/setBrightness",["number","string"].includes(typeof e)?{brightness:e}:e)},setMode:function(e){t("median://screen/setMode",e)},keepScreenOn:function(e){t("median://screen/keepScreenOn",e)},keepScreenNormal:function(){t("median://screen/keepScreenNormal")}},share:{sharePage:function(e){t("median://share/sharePage",e)},downloadFile:function(e){t("median://share/downloadFile",e)},downloadImage:function(e){t("median://share/downloadImage",e)}},sidebar:{setItems:function(e){t("median://sidebar/setItems",e)},getItems:function(e){return i("median://sidebar/getItems",e)}},statusbar:{set:function(e){t("median://statusbar/set",e)},matchBodyBackgroundColor:function(e){t("median://statusbar/matchBodyBackgroundColor",e)}},tabNavigation:{selectTab:function(e){t("median://tabs/select/"+e)},deselect:function(){t("median://tabs/deselect")},setTabs:function(e){t("median://tabs/setTabs",{tabs:e})}},webview:{clearCache:function(){t("median://webview/clearCache")},clearCookies:function(){t("median://webview/clearCookies")},reload:function(){t("median://webview/reload")}},window:{open:function(e,n="blank"){t("median://window/open",{url:e,mode:n})},close:function(){t("median://window/close")}}},d={window:{open:function(e,n="blank"){t("median://window/open",{url:e,mode:n})},setWindowOpenHideNavbar:function(e){t("median://window/setWindowOpenHideNavbar",{windowOpenHideNavbar:e})}},geoLocation:{requestLocation:function(){t("median://geolocationShim/requestLocation")},startWatchingLocation:function(){t("median://geolocationShim/startWatchingLocation")},stopWatchingLocation:function(){t("median://geolocationShim/stopWatchingLocation")}},attconsent:{request:function(e){return i("median://ios/attconsent/request",e)},status:function(e){return i("median://ios/attconsent/status",e)}},backgroundAudio:{start:function(){t("median://backgroundAudio/start")},end:function(){t("median://backgroundAudio/end")}},contextualNavToolbar:{set:function(e){t("median://ios/contextualNavToolbar/set",e)}}},l={initialize:function(e){t("median://adjust/initialize",e)},trackEvent:function(e){t("median://adjust/trackEvent",{token:e.token,revenue:e.revenue,currency:e.currency})},attributionInfo:function(){return i("median://adjust/attributionInfo")},updateSkanConversionValue:function(e){return i("median://adjust/updateSkanConversionValue",e)}},m={showInterstitialIfReady:function(){t("median://admob/showInterstitialIfReady")},showInterstitialOnNextPageLoadIfReady:function(){t("median://admob/showInterstitialOnNextPageLoadIfReady")},banner:{enable:function(){t("median://admob/banner/enable")},disable:function(){t("median://admob/banner/disable")}},request:{tracking:function(e){return i("median://admob/request/tracking",e)}}},f={getAgeSignals:function(e,i,a){const o={...e};i&&(o.successCallback=n(i)),a&&(o.errorCallback=n(a)),t("median://ageSafety/getAgeSignals",o)},requireMinimumAge:function(e,i,a){const o={age:e};i&&(o.successCallback=n(i)),a&&(o.errorCallback=n(a)),t("median://ageSafety/requireMinimumAge",o)}},g={prompt:function(e){if(e)return i("median://appReview/prompt",e);t("median://appReview/prompt")}},p={logEvent:function(e,n){return i("median://appsflyer/logEvent",{eventName:e,eventValues:n})},setCustomerUserId:function(e){return i("median://appsflyer/setCustomerUserId",{userId:e})},conversionData:c("_median_appsflyer_cd"),deeplinkResult:c("_median_appsflyer_deeplink_result"),sdkStart:c("_median_appsflyer_sdk_start")},b={status:function(e){return i("median://auth/status",e)},save:function(e){return"string"!=typeof e.secret&&(e.secret=JSON.stringify(e.secret)),i("median://auth/save",e)},get:function(e){return i("median://auth/get",e)},delete:function(e){return i("median://auth/delete",e)}},v={login:function(e){return i("median://auth0/login",e)},logout:function(e){return i("median://auth0/logout",e)},status:function(e){return i("median://auth0/status",e)},profile:function(e){return i("median://auth0/profile",e)},getCredentials:function(e){return i("median://auth0/getCredentials",e)},renew:function(e){return i("median://auth0/renew",{refreshToken:e})}},h={set:function(e){t("median://autorefresh/set",e)}},y={start:function(e){t("median://backgroundLocation/start",e,!0)},stop:function(){t("median://backgroundLocation/stop")}},k={playTrack:function(e){return"number"==typeof e&&(e={time:e}),i("median://backgroundMedia/playTrack",{...e})},streamPlaylist:function(e){return i("median://backgroundMedia/streamPlaylist",{...e})},pause:function(){t("median://backgroundMedia/pause")},stop:function(){t("median://backgroundMedia/stop")},play:function(){t("median://backgroundMedia/play")},resume:function(){t("median://backgroundMedia/resume")},getPlayerStatus:function(e){return i("median://backgroundMedia/getPlayerStatus",e)}},w={scan:function(e){return i("median://barcode/scan",e)},setPrompt:function(e){return t("median://barcode/setPrompt",{prompt:e})}},S={scan:function(e){t("median://beacon/scan",e)}},I={getFirstParams:function(e){return i("median://branch/getFirstParams",e)},getLatestParams:function(e){return i("median://branch/getLatestParams",e)},isInitialized:function(e){return i("median://branch/isInitialized",e)},initialized:c("_median_branch_initialized")},C={changeUser:function(e){return i("median://braze/changeUser",e,!0)},notificationEnabled:function(e){return i("median://braze/notificationEnabled",e,!0)},promptNotification:function(e){return i("median://braze/promptNotification",e,!0)},logCustomEvent:function(e,n){t("median://braze/logCustomEvent",{eventName:e,data:n})}},_={download:function(e){t("gonative://calendar/download",e)}},A={scanCard:function(e){return i("median://card.io/scanCard",e)}},P={initialize:function(e){return i("median://clerk/initialize",e)},presentSignIn:function(){return i("median://clerk/presentSignIn")},signOut:function(){return i("median://clerk/signOut")},getAuthStatus:function(){return i("median://clerk/getAuthStatus")}},L={getAll:function(e){return i("median://contacts/getAll",e)},getPermissionStatus:function(e){return i("median://contacts/getPermissionStatus",e)},pickContact:function(e){return i("median://contacts/pickContact",e)}},T={setContact:function(e){return i("median://cordial/setContact",e)},unsetContact:function(e){return i("median://cordial/unsetContact",e)},permissionStatus:function(e){return i("median://cordial/permissionStatus",e,!0)},requestPermission:function(e){return i("median://cordial/requestPermission",e,!0)}},N={scanPage:function(e){if(e?.callback)return i("median://documentScanner/scanPage",e);t("median://documentScanner/scanPage",e)},init:function(e){t("median://documentScanner/scanPage",e)}},E={init:function(e){return i("median://downloads/init",e)},downloadFile:function(e){t("median://downloads/downloadFile",e)},showUI:function(){t("median://downloads/showUI")}},U={scan:function(e){return i("median://esmiley/scan",{timeout:e})},connect:function(e){return i("median://esmiley/connect",{deviceId:e})},disconnect:function(){t("median://esmiley/disconnect")},send:function(e){return i("median://esmiley/send",{object:e})}},D={events:{send:function(e){t("median://facebook/events/send",e)},sendPurchase:function(e){t("median://facebook/events/sendPurchase",e)}},setAutoLogging:function(e){t("median://facebook/setAutoLogging",{enabled:e})}};var M;!function(e){e.ANALYTICS_STORAGE="analyticsStorage",e.AD_STORAGE="adStorage",e.AD_USER_DATA="adUserData",e.AD_PERSONALIZATION="adPersonalization"}(M||(M={}));const x={event:{collection:function(e){t("median://firebaseAnalytics/event/collection?enabled="+e)},setUser:function(e){t("median://firebaseAnalytics/event/setUser",e)},setUserProperty:function(e){t("median://firebaseAnalytics/event/setUserProperty",e)},defaultEventParameters:function(e){t("median://firebaseAnalytics/event/defaultEventParameters",e)},logEvent:function(e){t("median://firebaseAnalytics/event/logEvent",e)},logScreen:function(e){t("median://firebaseAnalytics/event/logScreen",e)},viewItem:function(e){t("median://firebaseAnalytics/event/viewItem",e)},addToWishlist:function(e){t("median://firebaseAnalytics/event/addToWishlist",e)},addToCart:function(e){t("median://firebaseAnalytics/event/addToCart",e)},removeFromCart:function(e){t("median://firebaseAnalytics/event/removeFromCart",e)}},setConsent:function(e){t("median://firebaseAnalytics/setConsent",e)}},F={enable:function(e){t("gonative://firebaseCrashlytics/enable",{enable:e})},webErrorLogsEnabled:function(e){t("gonative://firebaseCrashlytics/enableWebErrorLogs",{enable:e})},toastErrorLogsEnabled:function(e){t("gonative://firebaseCrashlytics/enableToastErrorLogs",{enable:e})},setUserId:function(e){t("gonative://firebaseCrashlytics/setUserId",{userId:e})},unsetUserId:function(){t("gonative://firebaseCrashlytics/unsetUserId")}},O={permissions:{request:function(){return i("median://grow/permissions/request")},getStatus:async function(){return i("median://grow/permissions/getStatus")}},user:{setIdentifier:function(e){return i("median://grow/user/setIdentifier",{userId:e})},getIdentifier:async function(){return(await i("median://grow/user/getIdentifier")).userId}},device:{getIdentifier:async function(){return(await i("median://grow/device/getIdentifier")).deviceId}},analytics:{getState:function(){return i("median://grow/analytics/getState")},setState:function(e){return i("median://grow/analytics/setState",{enabled:e})}},events:{log:function(e,n){return i("median://grow/events/log",{eventName:e,parameters:n})},logLocation:function(e){return i("median://grow/events/logLocation",{location:e})}},attributes:{set:function(e,n){return i("median://grow/attributes/set",{key:e,value:n})},remove:function(e){return i("median://grow/attributes/remove",{key:e})}},privacy:{collectData:function(){return i("median://grow/privacy/collectData")},eraseData:function(){return i("median://grow/privacy/eraseData")},removeAccount:function(){return i("median://grow/privacy/removeAccount")},setTrackingAllowed:function(e){return i("median://grow/privacy/setTrackingAllowed",{allowed:e})}},campaigns:{pause:function(){return i("median://grow/campaigns/pause")},resume:function(){return i("median://grow/campaigns/resume")}}},q={trigger:function(e){t("median://haptics/trigger",e)}},R={requestPermissions:function(e){return i("median://healthBridge/requestPermissions",{dataTypes:e})},getData:function(e){return i("median://healthBridge/getData",e)}},B={purchase:function(e){const n=e.productID;return e.productID=null,i("median://purchase/"+n,e)},purchases:function(e){return i("median://iap/purchases",e)},manageSubscription:function(e){t("median://iap/manageSubscription",e)},manageAllSubscriptions:function(){t("median://iap/manageAllSubscriptions")},restorePurchases:function(){t("median://iap/restorePurchases")},info:function(){return i("median://iap/info")},refresh:function(){t("median://iap/refresh")},infoReady:c("_median_info_ready"),purchaseResult:c("_median_iap_purchases")};var j;!function(e){e.ACCEPTED_TRIGGER="acceptedTrigger",e.NOTIFICATION_CLICK="notificationClick",e.CONVERSION="conversion"}(j||(j={}));const z={microSegments:{setInteger:function(e,n){t("median://intentedge/microSegments/setInteger",{segmentName:e,value:n})},setFloat:function(e,n){t("median://intentedge/microSegments/setFloat",{segmentName:e,value:n})},setString:function(e,n){t("median://intentedge/microSegments/setString",{segmentName:e,value:n})},setBoolean:function(e,n){t("median://intentedge/microSegments/setBoolean",{segmentName:e,value:n})},getInteger:function(e){return i("median://intentedge/microSegments/getInteger",{segmentName:e})},getFloat:function(e){return i("median://intentedge/microSegments/getFloat",{segmentName:e})},getString:function(e){return i("median://intentedge/microSegments/getString",{segmentName:e})},getBoolean:function(e){return i("median://intentedge/microSegments/getBoolean",{segmentName:e})}},pageTracker:{enterPage:function(e){t("median://intentedge/pageTracker/enterPage",{pageName:e})}},onboarding:{start:function(){t("median://intentedge/onboarding/start")},complete:function(){t("median://intentedge/onboarding/complete")}},events:{fireMicromoment:function(e,n){t("median://intentedge/events/fireMicromoment",{eventName:e,parameters:n})},sendUserInteraction:function(e,n){t("median://intentedge/events/sendUserInteraction",{campaignId:e,interactionType:n})}},campaigns:{setCampaignTriggerHandler:function(e){t("median://intentedge/campaigns/setCampaignTriggerHandler",{callback:e},!0)},setCampaignClickHandler:function(e){t("median://intentedge/campaigns/setCampaignClickHandler",{callback:e},!0)}},dataEnrichment:{exportData:function(e){return i("median://intentedge/dataEnrichment/exportData",{requestedMetrics:e})}},start:function(){t("median://intentedge/start")},stop:function(e){t("median://intentedge/stop",{purge:e})},launchDebugScreen:function(){t("median://intentedge/launchDebugScreen")},exportLogs:async function(){const e=await i("median://intentedge/exportLogs");if(e.base64){const n=await async function(e,n){const t=atob(e),i=new Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);const a=new Uint8Array(i);return new Blob([a],{type:n})}(e.base64,e.mimeType);return delete e.base64,{...e,logBlob:n}}return e}};const W={registerPush:function(e){return i("median://intercom/registerPush",e)},updateUser:function(e){t("median://intercom/updateUser",e)},logEvent:function(e){t("median://intercom/logEvent",e)},logout:function(){t("median://intercom/logout")},presentCarousel:function(e){t("median://intercom/presentCarousel",e)},permissionStatus:function(e){return i("median://intercom/permissionStatus",e,!0)},requestPermission:function(e){return i("median://intercom/registerPush",e,!0)}},H={initialize:function(e){return i("gonative://iterable/initialize",e)},setEmail:function(e){return i("gonative://iterable/setEmail",e)},setUserId:function(e){return i("gonative://iterable/setUserId",e)},registerPush:function(e){return i("gonative://iterable/registerPush",e)},requestPermission:function(e){return i("gonative://iterable/requestPermission",e)},permissionStatus:function(e){return i("gonative://iterable/permissionStatus",e)}},G={initialize:function(e){return i("median://jwplayer/initialize",e)},play:function(e){return i("median://jwplayer/play",e)}},J={play:function(e){t("median://kaltura/play",e)}},K={set:function(e){return i("gonative://keychainSwift/set",e)},get:function(e){return i("gonative://keychainSwift/get",e)},delete:function(e){return i("gonative://keychainSwift/delete",e)},deleteAll:function(e){return i("gonative://keychainSwift/deleteAll",e)}},V={promptNotification:function(){return i("median://klaviyo/promptNotification")},notificationEnabled:function(){return i("median://klaviyo/notificationEnabled")},setProfile:function(e){return i("median://klaviyo/setProfile",e)},getProfile:function(){return i("median://klaviyo/getProfile")},resetProfile:function(){return i("median://klaviyo/resetProfile")}},Q={nonpersistent:{set:function(e){t("median://localpreferences/nonpersistent/set",e)},get:function(e){return i("median://localpreferences/nonpersistent/get",e)},delete:function(e){t("median://localpreferences/nonpersistent/delete",e)},deleteAll:function(e){t("median://localpreferences/nonpersistent/deleteAll",e)}},persistent:{set:function(e){t("median://localpreferences/persistent/set",e)},get:function(e){return i("median://localpreferences/persistent/get",e)},delete:function(e){t("median://localpreferences/persistent/delete",e)},deleteAll:function(e){t("median://localpreferences/persistent/deleteAll",e)}},filesystem:{save:function(e){t("median://localpreferences/filesystem/save",e)},read:function(e){return i("median://localpreferences/filesystem/read",e)},delete:function(e){t("median://localpreferences/filesystem/delete",e)}},keychain:{set:function(e){return i("median://localpreferences/keychain/set",e)},get:function(e){return i("median://localpreferences/keychain/get",e)},delete:function(e){return i("median://localpreferences/keychain/delete",e)},deleteAll:function(e){return i("median://localpreferences/keychain/deleteAll",e)}}},Y={initialize:function(e){return i("median://masterlock/initialize",e)},scan:function(e){const i={};e?.onScanStart&&(i.onScanStart=n(e?.onScanStart,!0)),e?.onScanStop&&(i.onScanStop=n(e?.onScanStop,!0)),e?.onDeviceDiscover&&(i.onDeviceDiscover=n(e?.onDeviceDiscover,!0)),t("median://masterlock/scan",i)},unlock:function(e){return i("median://masterlock/unlock",e)},permissionGranted:function(){return i("median://masterlock/permissionGranted")},updateFirmware:function(e){return i("median://masterlock/updateFirmware",e)},firmwareUpdate:{addListener:async function(e){const t=n(e,!0),a=await i("median://masterlock/firmwareUpdate/addListener",{listenerIdCallback:t});if(a&&a.listenerId)return a.listenerId;throw"Invalid listenerId response"},removeListener:function(e){t("median://masterlock/firmwareUpdate/removeListener",{listenerId:e})}},lockReset:function(e){return i("median://masterlock/lockReset",e)},getDeadboltHandedness:function(e){return i("median://masterlock/getDeadboltHandedness",e)},setDeadboltHandedness:function(e){return i("median://masterlock/setDeadboltHandedness",e)},relock:function(e){return i("median://masterlock/relock",e)}},Z={launch:function(e){return i("median://modal/launch",e)}},X={notificationEnabled:function(e){return i("median://moengage/notificationEnabled",e,!0)},promptNotification:function(e){return i("median://moengage/promptNotification",e,!0)},setUniqueID:function(e){return i("median://moengage/setUniqueID",{uniqueId:e},!0)},resetUser:function(){return i("median://moengage/resetUser")},setAlias:function(e){return i("median://moengage/setAlias",{alias:e},!0)},trackEvent:function(e,n){return i("median://moengage/trackEvent",{eventName:e,eventData:n},!0)},launchInbox:function(){return i("median://moengage/launchInbox")}},$={login:function(e){return i("median://moxo/login",e,!0)},registerNotifications:function(e){return i("median://moxo/registerNotifications",e,!0)},requestPermission:function(e){return i("median://moxo/registerNotifications",e,!0)},permissionStatus:function(e){return i("median://moxo/permissionStatus",e,!0)},isLinked:function(e){return i("median://moxo/isLinked",e,!0)},unlink:function(e){return i("median://moxo/unlink",e,!0)},localUnlink:function(e){return i("median://moxo/localUnlink",e,!0)},showDashboard:function(){t("median://moxo/showDashboard")},openLiveChatWithCompletion:function(){t("median://moxo/openLiveChatWithCompletion")},openLiveChatWithChannelId:function(e){t("median://moxo/openLiveChatWithChannelId",e)},openChat:function(e){t("median://moxo/openChat",e)},getUnreadMessageCount:function(e){return i("median://moxo/getUnreadMessageCount",e)}},ee={areNotificationsEnabled:function(e){return i("median://msdynamics/areNotificationsEnabled",e,!0)},promptNotificationPermission:function(e){return i("median://msdynamics/promptNotificationPermission",e,!0)},registrationInfo:function(e){return i("median://msdynamics/registrationInfo",e,!0)},registerDevice:function(e){return i("median://msdynamics/registerDevice",e,!0)}},ne={status:function(e){return i("gonative://nfc/status",e)},readTag:function(e){return i("gonative://nfc/readTag",e)}},te={run:{onesignalInfo:function(){t("median://onesignal/info",{callback:"median_onesignal_info"})}},onesignalInfo:function(e){return i("median://onesignal/info",e,!0)},info:function(e){return i("median://onesignal/info",e,!0)},register:function(e){return i("median://onesignal/register",e,!0)},userPrivacyConsent:{grant:function(){t("median://onesignal/userPrivacyConsent/grant")},revoke:function(){t("median://onesignal/userPrivacyConsent/revoke")}},tags:{getTags:function(e){return i("median://onesignal/tags/get",e)},setTags:function(e){return i("median://onesignal/tags/set",e)},deleteTags:function(e){return i("median://onesignal/tags/delete",e)}},showTagsUI:function(){t("median://onesignal/showTagsUI")},promptLocation:function(){t("median://onesignal/promptLocation")},iam:{addTrigger:function(e){t("median://onesignal/iam/addTrigger",e)},addTriggers:function(e){t("median://onesignal/iam/addTriggers",e)},removeTriggerForKey:function(e){t("median://onesignal/iam/removeTriggerForKey",{key:e})},getTriggerValueForKey:function(e){t("median://onesignal/iam/getTriggerValueForKey",{key:e})},pauseInAppMessages:function(){t("median://onesignal/iam/pauseInAppMessages?pause=true")},resumeInAppMessages:function(){t("median://onesignal/iam/pauseInAppMessages?pause=false")},setInAppMessageClickHandler:function(e){t("median://onesignal/iam/setInAppMessageClickHandler",{handler:n(e,!0)})}},externalUserId:{set:function(e){return i("median://onesignal/externalUserId/set",e)},remove:function(e){return i("median://onesignal/externalUserId/remove",e)}},enableForegroundNotifications:function(e){t("median://onesignal/enableForegroundNotifications",{enabled:e})},badge:{set:function(e){t("median://onesignal/badge/set",{count:e})}},login:function(e,n={}){return i("median://onesignal/login",{externalId:e,...n})},logout:function(e){return i("median://onesignal/logout",e)},pushOpened:c("_median_onesignal_push_opened")},ie={video:{join:function(e){return i("median://opentok/video/join",e)}}},ae={requestPhoneCallMgmt:function(e){if(e?.callback)return i("median://permissions/requestPhoneCallMgmt",e);t("median://permissions/requestPhoneCallMgmt",e)},status:function(e){return i("median://permissions/status",{permissions:e})}},oe={linkBank:function(e){return i("median://plaid/linkBank",e)},verifyIdentity:function(e){return i("median://plaid/verifyIdentity",e)}},re={configure:function(e){return i("gonative://revenueCat/configure",e)},getOfferings:function(e){return i("gonative://revenueCat/getOfferings",e)},purchase:function(e){return i("gonative://revenueCat/purchase",e)},restorePurchases:function(e){return i("gonative://revenueCat/restorePurchases",e)}},se={promptNotification:function(){return i("median://salesforceCloud/promptNotification")},notificationEnabled:function(){return i("median://salesforceCloud/notificationEnabled")},getInfo:function(){return i("median://salesforceCloud/getInfo")},contactKey:{set:function(e){return i("median://salesforceCloud/contactKey/set",e)},get:function(){return i("median://salesforceCloud/contactKey/get")}},attributes:{set:function(e){return i("median://salesforceCloud/attributes/set",e)},get:function(){return i("median://salesforceCloud/attributes/get")}},tags:{set:function(e){return i("median://salesforceCloud/tags/set",e)},get:function(){return i("median://salesforceCloud/tags/get")}}},ce={shareResult:c("_median_share_to_app")},ue={facebook:{login:function(e){if(e?.callback)return i("median://socialLogin/facebook/login",e);t("median://socialLogin/facebook/login",e)},logout:function(e){if(e?.callback)return i("median://socialLogin/facebook/logout",e);t("median://socialLogin/facebook/logout",e)}},google:{login:function(e){if(e?.callback)return i("median://socialLogin/google/login",e);t("median://socialLogin/google/login",e)},logout:function(e){if(e?.callback)return i("median://socialLogin/google/logout",e);t("median://socialLogin/google/logout",e)}},apple:{login:function(e){if(e?.callback)return i("median://socialLogin/apple/login",e);t("median://socialLogin/apple/login",e)}}};function de(e,n){function t(e){return new Promise(((n,t)=>{const i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>t(i.error),i.readAsDataURL(e)}))}const i=[t(e)];return n&&"object"==typeof n&&n.attachment instanceof Blob&&i.push(t(n.attachment)),Promise.all(i)}const le={snapchat:{isInstalled:function(e){return i("median://socialShare/snapchat/isInstalled",e)},share:function(e,n){de(e,n).then((([e,i])=>{let a={dataUrl:e};n&&"object"==typeof n&&(a={...n,dataUrl:e,attachment:i}),t("median://socialShare/snapchat/share",a)}))}},instagram:{isInstalled:function(e){return i("median://socialShare/instagram/isInstalled",e)},shareToFeed:function(e){de(e).then((([e])=>{t("median://socialShare/instagram/shareToFeed",{dataUrl:e})}))},shareToStory:function(e,n){de(e,n).then((([e,i])=>{let a={dataUrl:e};n&&"object"==typeof n&&(a={...n,dataUrl:e,attachment:i}),t("median://socialShare/instagram/shareToStory",a)}))}}},me={video:{join:function(e){return i("median://twilio/video/join",e)}}},fe={shareScreen:function(e){t("median://webScreenshot/shareScreen",e)},shareElement:function(e,n){window.html2canvas&&window.html2canvas(e,{useCORS:!0,scale:1.25}).then((e=>{t("median://webScreenshot/shareElement",{dataUrl:e.toDataURL(),...n})}))},captureScreen:async function(){const e=await i("median://webScreenshot/captureScreen"),n=atob(e.data),t=n.length,a=new Uint8Array(t);for(let e=0;e<t;e++)a[e]=n.charCodeAt(e);return new Blob([a],{type:"image/png"})},captureElement:async function(e){if(!window.html2canvas)return;const n=await window.html2canvas(e,{useCORS:!0,scale:1.25});return new Promise(((e,t)=>{n.toBlob((n=>{n?e(n):t(new Error("Failed to convert to blob."))}))}))}},ge={video:{join:function(e){return i("median://zoom/join",e)}}};var pe;return function(e){e.ios=d,e.android=a,e.camera=u.camera,e.clipboard=u.clipboard,e.config=u.config,e.connectivity=u.connectivity,e.deviceInfo=u.deviceInfo,e.internalExternal=u.internalExternal,e.jsNavigation=u.jsNavigation,e.keyboard=u.keyboard,e.nativebridge=u.nativebridge,e.navigationLevels=u.navigationLevels,e.navigationMaxWindows=u.navigationMaxWindows,e.navigationTitles=u.navigationTitles,e.open=u.open,e.registration=u.registration,e.run=u.run,e.screen=u.screen,e.share=u.share,e.sidebar=u.sidebar,e.statusbar=u.statusbar,e.tabNavigation=u.tabNavigation,e.webview=u.webview,e.window=u.window,e.adjust=l,e.admob=m,e.ageSafety=f,e.appreview=g,e.appsflyer=p,e.auth=b,e.auth0=v,e.autorefresh=h,e.backgroundLocation=y,e.backgroundMedia=k,e.barcode=w,e.beacon=S,e.braze=C,e.branch=I,e.calendar=_,e.card_io=A,e.clerk=P,e.contacts=L,e.cordial=T,e.documentScanner=N,e.downloads=E,e.esmiley=U,e.facebook=D,e.firebaseAnalytics=x,e.firebaseCrashlytics=F,e.grow=O,e.haptics=q,e.healthBridge=R,e.iap=B,e.intentedge=z,e.intercom=W,e.iterable=H,e.jwplayer=G,e.kaltura=J,e.keychainSwift=K,e.klaviyo=V,e.localpreferences=Q,e.masterlock=Y,e.modal=Z,e.moengage=X,e.moxo=$,e.msdynamics=ee,e.nfc=ne,e.onesignal=te,e.opentok=ie,e.permissions=ae,e.plaid=oe,e.revenueCat=re,e.salesforceCloud=se,e.shareIntoApp=ce,e.socialLogin=ue,e.socialShare=le,e.storage={app:Q.nonpersistent,cloud:Q.persistent,filesystem:Q.filesystem},e.twilio=me,e.webScreenshot=fe,e.zoom=ge,e.isNativeApp=()=>{const e=globalThis.window;return!!e?.webkit?.messageHandlers?.JSBridge||!!e?.JSBridge},e.getPlatform=async()=>{if(!e.isNativeApp())return"web";const n=await u.deviceInfo();return n?.platform},e.onReady=n=>{if("function"!=typeof n)return;let t=n,i=0;const a=setInterval((()=>{e.isNativeApp()&&t&&(t(),t=null),i++,(i>=20||!t)&&clearInterval(a)}),500)},e.appResumed=c("_median_app_resumed"),e.deviceShake=c("_median_device_shake"),e.appsFlyerConversionData=c("_median_appsflyer_cd"),e.appsFlyerDeeplinkResult=c("_median_appsflyer_deeplink_result"),e.appsFlyerSdkStart=c("_median_appsflyer_sdk_start"),e.branchInitialized=c("_median_branch_initialized"),e.iapInfoReady=c("_median_info_ready"),e.iapPurchases=c("_median_iap_purchases"),e.oneSignalPushOpened=c("_median_onesignal_push_opened"),e.shareToApp=c("_median_share_to_app")}(pe||(pe={})),pe}();
|
|
1
|
+
var Median=function(){"use strict";function e(e="_median_temp_"){return e+Math.random().toString(36).slice(2)}function n(n,t){if("string"==typeof n)return n;const i=e();return window[i]=function(...e){n(...e),t||delete window[i]},i}function t(e,t,i){let a=e;t&&(a={},t.callback&&"function"==typeof t.callback&&(t.callback=n(t.callback,i)),t.callbackFunction&&"function"==typeof t.callbackFunction&&(t.callbackFunction=n(t.callbackFunction,i)),t.statuscallback&&"function"==typeof t.statuscallback&&(t.statuscallback=n(t.statuscallback,i)),a.medianCommand=e,a.data=t),window?.JSBridge?.postMessage&&window.JSBridge.postMessage("string"==typeof a?a:JSON.stringify(a)),window?.webkit?.messageHandlers?.JSBridge?.postMessage&&window.webkit.messageHandlers.JSBridge.postMessage(a)}function i(n,i,a){if(i?.callback||i?.callbackFunction||i?.statuscallback)return t(n,i,a);{const a=e();return i||(i={}),i.callback=a,new Promise((function(e,o){window[a]=function(n){n&&"object"==typeof n&&"error"in n?o(n):e(n),delete window[a]},t(n,i)}))}}const a={geoLocation:{promptLocationServices:function(){t("median://geoLocation/promptLocationServices")}},screen:{fullscreen:function(){t("median://screen/fullscreen")},normal:function(){t("median://screen/normal")},keepScreenOn:function(){t("median://screen/keepScreenOn")},keepScreenNormal:function(){t("median://screen/keepScreenNormal")}},audio:{requestFocus:function(e){t("median://audio/requestFocus",{enabled:e})}}},o={};function r(e,n){window[e]=function(...e){Object.keys(n).forEach((t=>{const i=n[t];"function"==typeof i&&i(...e)}))}}function s(e,n){return t(n?"median://events/subscribe":"median://events/unsubscribe",{eventName:e})}const c=n=>({addListener:t=>((n,t)=>{const i=e(n);return"function"!=typeof t||(o[n]=o[n]||{},o[n][i]=t,r(n,o[n]),s(n,!0)),i})(n,t),removeListener:e=>((e,n)=>{e&&n&&(o[e]=o[e]||{},delete o[e][n],r(e,o[e]),0===Object.keys(o[e]).length&&s(e,!1))})(n,e)}),u={camera:{setCaptureQuality:function(e){t("median://camera/setCaptureQuality",{quality:e})},saveToGallery:function(e){t("median://camera/saveToGallery",{saveToGallery:e})}},clipboard:{set:function(e){t("median://clipboard/set",e)},get:function(e){return i("median://clipboard/get",e)}},config:{set:function(e){t("median://config/set",e)}},connectivity:{get:function(e){return i("median://connectivity/get",e)},subscribe:function(e){return i("median://connectivity/subscribe",e,!0)},unsubscribe:function(){t("median://connectivity/unsubscribe")}},contextMenu:{setEnabled:function(e){t("median://contextMenu/setEnabled",{enabled:e})},setLinkActions:function(e){t("median://contextMenu/setLinkActions",{actions:e})}},deviceInfo:function(e){return i("median://run/median_device_info",e,!0)},internalExternal:{set:function(e){t("median://internalExternal/set",e)}},jsNavigation:{url:c("_median_url_changed")},keyboard:{info:function(e){return i("median://keyboard/info",e)},listen:function(e){t("median://keyboard/listen",{callback:e})},showAccessoryView:function(e){t("median://keyboard/showAccessoryView",{visible:e})}},nativebridge:{custom:function(e){return i("median://nativebridge/custom",e)},multi:function(e){t("median://nativebridge/multi",e)}},navigationLevels:{set:function(e){t("median://navigationLevels/set",{persist:e.persist,data:e})},setCurrent:function(e){t("median://navigationLevels/set",e)},revert:function(){t("median://navigationLevels/set?persist=true")}},navigationMaxWindows:{set:function(e,n){t("median://navigationMaxWindows/set",{data:e,autoClose:n,persist:!0})},setCurrent:function(e,n){t("median://navigationMaxWindows/set",{data:e,autoClose:n})}},navigationTitles:{set:function(e){t("median://navigationTitles/set",{persist:e.persist,data:e})},setCurrent:function(e){t("median://navigationTitles/setCurrent",e)},revert:function(){t("median://navigationTitles/set?persist=true")}},open:{appSettings:function(){t("median://open/app-settings")}},registration:{send:function(e){t("median://registration/send",{customData:e})}},run:{deviceInfo:function(){t("median://run/median_device_info")}},screen:{setBrightness:function(e){t("median://screen/setBrightness",["number","string"].includes(typeof e)?{brightness:e}:e)},setMode:function(e){t("median://screen/setMode",e)},keepScreenOn:function(e){t("median://screen/keepScreenOn",e)},keepScreenNormal:function(){t("median://screen/keepScreenNormal")}},share:{sharePage:function(e){t("median://share/sharePage",e)},downloadFile:function(e){t("median://share/downloadFile",e)},downloadImage:function(e){t("median://share/downloadImage",e)}},sidebar:{setItems:function(e){t("median://sidebar/setItems",e)},getItems:function(e){return i("median://sidebar/getItems",e)}},statusbar:{set:function(e){t("median://statusbar/set",e)},matchBodyBackgroundColor:function(e){t("median://statusbar/matchBodyBackgroundColor",e)}},tabNavigation:{selectTab:function(e){t("median://tabs/select/"+e)},deselect:function(){t("median://tabs/deselect")},setTabs:function(e){t("median://tabs/setTabs",{tabs:e})}},webview:{clearCache:function(){t("median://webview/clearCache")},clearCookies:function(){t("median://webview/clearCookies")},reload:function(){t("median://webview/reload")}},window:{open:function(e,n="blank"){t("median://window/open",{url:e,mode:n})},close:function(){t("median://window/close")}}},d={window:{open:function(e,n="blank"){t("median://window/open",{url:e,mode:n})},setWindowOpenHideNavbar:function(e){t("median://window/setWindowOpenHideNavbar",{windowOpenHideNavbar:e})}},geoLocation:{requestLocation:function(){t("median://geolocationShim/requestLocation")},startWatchingLocation:function(){t("median://geolocationShim/startWatchingLocation")},stopWatchingLocation:function(){t("median://geolocationShim/stopWatchingLocation")}},attconsent:{request:function(e){return i("median://ios/attconsent/request",e)},status:function(e){return i("median://ios/attconsent/status",e)}},backgroundAudio:{start:function(){t("median://backgroundAudio/start")},end:function(){t("median://backgroundAudio/end")}},contextualNavToolbar:{set:function(e){t("median://ios/contextualNavToolbar/set",e)}}},l={initialize:function(e){t("median://adjust/initialize",e)},trackEvent:function(e){t("median://adjust/trackEvent",{token:e.token,revenue:e.revenue,currency:e.currency})},attributionInfo:function(){return i("median://adjust/attributionInfo")},updateSkanConversionValue:function(e){return i("median://adjust/updateSkanConversionValue",e)}},m={showInterstitialIfReady:function(){t("median://admob/showInterstitialIfReady")},showInterstitialOnNextPageLoadIfReady:function(){t("median://admob/showInterstitialOnNextPageLoadIfReady")},banner:{enable:function(){t("median://admob/banner/enable")},disable:function(){t("median://admob/banner/disable")}},request:{tracking:function(e){return i("median://admob/request/tracking",e)}}},f={getAgeSignals:function(e,i,a){const o={...e};i&&(o.successCallback=n(i)),a&&(o.errorCallback=n(a)),t("median://ageSafety/getAgeSignals",o)},requireMinimumAge:function(e,i,a){const o={age:e};i&&(o.successCallback=n(i)),a&&(o.errorCallback=n(a)),t("median://ageSafety/requireMinimumAge",o)}},g={prompt:function(e){if(e)return i("median://appReview/prompt",e);t("median://appReview/prompt")}},p={logEvent:function(e,n){return i("median://appsflyer/logEvent",{eventName:e,eventValues:n})},setCustomerUserId:function(e){return i("median://appsflyer/setCustomerUserId",{userId:e})},conversionData:c("_median_appsflyer_cd"),deeplinkResult:c("_median_appsflyer_deeplink_result"),sdkStart:c("_median_appsflyer_sdk_start")},b={status:function(e){return i("median://auth/status",e)},save:function(e){return"string"!=typeof e.secret&&(e.secret=JSON.stringify(e.secret)),i("median://auth/save",e)},get:function(e){return i("median://auth/get",e)},delete:function(e){return i("median://auth/delete",e)}},v={login:function(e){return i("median://auth0/login",e)},logout:function(e){return i("median://auth0/logout",e)},status:function(e){return i("median://auth0/status",e)},profile:function(e){return i("median://auth0/profile",e)},getCredentials:function(e){return i("median://auth0/getCredentials",e)},renew:function(e){return i("median://auth0/renew",{refreshToken:e})}},h={set:function(e){t("median://autorefresh/set",e)}},y={start:function(e){t("median://backgroundLocation/start",e,!0)},stop:function(){t("median://backgroundLocation/stop")}},k={playTrack:function(e){return"number"==typeof e&&(e={time:e}),i("median://backgroundMedia/playTrack",{...e})},streamPlaylist:function(e){return i("median://backgroundMedia/streamPlaylist",{...e})},pause:function(){t("median://backgroundMedia/pause")},stop:function(){t("median://backgroundMedia/stop")},play:function(){t("median://backgroundMedia/play")},resume:function(){t("median://backgroundMedia/resume")},getPlayerStatus:function(e){return i("median://backgroundMedia/getPlayerStatus",e)}},w={scan:function(e){return i("median://barcode/scan",e)},setPrompt:function(e){return t("median://barcode/setPrompt",{prompt:e})}},S={scan:function(e){t("median://beacon/scan",e)}},I={getFirstParams:function(e){return i("median://branch/getFirstParams",e)},getLatestParams:function(e){return i("median://branch/getLatestParams",e)},isInitialized:function(e){return i("median://branch/isInitialized",e)},initialized:c("_median_branch_initialized")},C={changeUser:function(e){return i("median://braze/changeUser",e,!0)},notificationEnabled:function(e){return i("median://braze/notificationEnabled",e,!0)},promptNotification:function(e){return i("median://braze/promptNotification",e,!0)},logCustomEvent:function(e,n){t("median://braze/logCustomEvent",{eventName:e,data:n})}},_={download:function(e){t("gonative://calendar/download",e)}},A={scanCard:function(e){return i("median://card.io/scanCard",e)}},L={initialize:function(e){return i("median://clerk/initialize",e)},presentSignIn:function(){return i("median://clerk/presentSignIn")},signOut:function(){return i("median://clerk/signOut")},getAuthStatus:function(){return i("median://clerk/getAuthStatus")}},P={getAll:function(e){return i("median://contacts/getAll",e)},getPermissionStatus:function(e){return i("median://contacts/getPermissionStatus",e)},pickContact:function(e){return i("median://contacts/pickContact",e)}},T={setContact:function(e){return i("median://cordial/setContact",e)},unsetContact:function(e){return i("median://cordial/unsetContact",e)},permissionStatus:function(e){return i("median://cordial/permissionStatus",e,!0)},requestPermission:function(e){return i("median://cordial/requestPermission",e,!0)}},N={identify:function(e){return i("median://customerio/identify",e)},reset:function(){return i("median://customerio/reset")},getUserId:async function(){return(await i("median://customerio/getUserId")).userId||null},setProfileAttributes:function(e){return i("median://customerio/setProfileAttributes",{attributes:e})},setDeviceAttributes:function(e){return i("median://customerio/setDeviceAttributes",{attributes:e})},deleteDeviceToken:function(){return i("median://customerio/deleteDeviceToken")},push:{getPermissionStatus:function(){return i("median://customerio/push/getPermissionStatus")},requestPermission:function(){return i("median://customerio/push/requestPermission")},opened:{addListener:async function(e){const t=n(e,!0);return(await i("median://customerio/push/opened/addListener",{listenerCallback:t})).listenerId||null},removeListener:function(e){t("median://customerio/push/opened/removeListener",{listenerId:e})}},received:{addListener:async function(e){const t=n(e,!0);return(await i("median://customerio/push/received/addListener",{listenerCallback:t})).listenerId||null},removeListener:function(e){t("median://customerio/push/received/removeListener",{listenerId:e})}}},track:function(e){return i("median://customerio/track",e)},screen:function(e){return i("median://customerio/screen",e)},setLogLevel:function(e){return i("median://customerio/setLogLevel",{level:e})}},E={scanPage:function(e){if(e?.callback)return i("median://documentScanner/scanPage",e);t("median://documentScanner/scanPage",e)},init:function(e){t("median://documentScanner/scanPage",e)}},U={init:function(e){return i("median://downloads/init",e)},downloadFile:function(e){t("median://downloads/downloadFile",e)},showUI:function(){t("median://downloads/showUI")}},D={scan:function(e){return i("median://esmiley/scan",{timeout:e})},connect:function(e){return i("median://esmiley/connect",{deviceId:e})},disconnect:function(){t("median://esmiley/disconnect")},send:function(e){return i("median://esmiley/send",{object:e})}},M={events:{send:function(e){t("median://facebook/events/send",e)},sendPurchase:function(e){t("median://facebook/events/sendPurchase",e)}},setAutoLogging:function(e){t("median://facebook/setAutoLogging",{enabled:e})}};var x;!function(e){e.ANALYTICS_STORAGE="analyticsStorage",e.AD_STORAGE="adStorage",e.AD_USER_DATA="adUserData",e.AD_PERSONALIZATION="adPersonalization"}(x||(x={}));const F={event:{collection:function(e){t("median://firebaseAnalytics/event/collection?enabled="+e)},setUser:function(e){t("median://firebaseAnalytics/event/setUser",e)},setUserProperty:function(e){t("median://firebaseAnalytics/event/setUserProperty",e)},defaultEventParameters:function(e){t("median://firebaseAnalytics/event/defaultEventParameters",e)},logEvent:function(e){t("median://firebaseAnalytics/event/logEvent",e)},logScreen:function(e){t("median://firebaseAnalytics/event/logScreen",e)},viewItem:function(e){t("median://firebaseAnalytics/event/viewItem",e)},addToWishlist:function(e){t("median://firebaseAnalytics/event/addToWishlist",e)},addToCart:function(e){t("median://firebaseAnalytics/event/addToCart",e)},removeFromCart:function(e){t("median://firebaseAnalytics/event/removeFromCart",e)}},setConsent:function(e){t("median://firebaseAnalytics/setConsent",e)}},q={enable:function(e){t("gonative://firebaseCrashlytics/enable",{enable:e})},webErrorLogsEnabled:function(e){t("gonative://firebaseCrashlytics/enableWebErrorLogs",{enable:e})},toastErrorLogsEnabled:function(e){t("gonative://firebaseCrashlytics/enableToastErrorLogs",{enable:e})},setUserId:function(e){t("gonative://firebaseCrashlytics/setUserId",{userId:e})},unsetUserId:function(){t("gonative://firebaseCrashlytics/unsetUserId")}},O={permissions:{request:function(){return i("median://grow/permissions/request")},getStatus:async function(){return i("median://grow/permissions/getStatus")}},user:{setIdentifier:function(e){return i("median://grow/user/setIdentifier",{userId:e})},getIdentifier:async function(){return(await i("median://grow/user/getIdentifier")).userId}},device:{getIdentifier:async function(){return(await i("median://grow/device/getIdentifier")).deviceId}},analytics:{getState:function(){return i("median://grow/analytics/getState")},setState:function(e){return i("median://grow/analytics/setState",{enabled:e})}},events:{log:function(e,n){return i("median://grow/events/log",{eventName:e,parameters:n})},logLocation:function(e){return i("median://grow/events/logLocation",{location:e})}},attributes:{set:function(e,n){return i("median://grow/attributes/set",{key:e,value:n})},remove:function(e){return i("median://grow/attributes/remove",{key:e})}},privacy:{collectData:function(){return i("median://grow/privacy/collectData")},eraseData:function(){return i("median://grow/privacy/eraseData")},removeAccount:function(){return i("median://grow/privacy/removeAccount")},setTrackingAllowed:function(e){return i("median://grow/privacy/setTrackingAllowed",{allowed:e})}},campaigns:{pause:function(){return i("median://grow/campaigns/pause")},resume:function(){return i("median://grow/campaigns/resume")}}},R={trigger:function(e){t("median://haptics/trigger",e)}},B={requestPermissions:function(e){return i("median://healthBridge/requestPermissions",{dataTypes:e})},getData:function(e){return i("median://healthBridge/getData",e)}},j={purchase:function(e){const n=e.productID;return e.productID=null,i("median://purchase/"+n,e)},purchases:function(e){return i("median://iap/purchases",e)},manageSubscription:function(e){t("median://iap/manageSubscription",e)},manageAllSubscriptions:function(){t("median://iap/manageAllSubscriptions")},restorePurchases:function(){t("median://iap/restorePurchases")},info:function(){return i("median://iap/info")},refresh:function(){t("median://iap/refresh")},infoReady:c("_median_info_ready"),purchaseResult:c("_median_iap_purchases")};var z;!function(e){e.ACCEPTED_TRIGGER="acceptedTrigger",e.NOTIFICATION_CLICK="notificationClick",e.CONVERSION="conversion"}(z||(z={}));const W={microSegments:{setInteger:function(e,n){t("median://intentedge/microSegments/setInteger",{segmentName:e,value:n})},setFloat:function(e,n){t("median://intentedge/microSegments/setFloat",{segmentName:e,value:n})},setString:function(e,n){t("median://intentedge/microSegments/setString",{segmentName:e,value:n})},setBoolean:function(e,n){t("median://intentedge/microSegments/setBoolean",{segmentName:e,value:n})},getInteger:function(e){return i("median://intentedge/microSegments/getInteger",{segmentName:e})},getFloat:function(e){return i("median://intentedge/microSegments/getFloat",{segmentName:e})},getString:function(e){return i("median://intentedge/microSegments/getString",{segmentName:e})},getBoolean:function(e){return i("median://intentedge/microSegments/getBoolean",{segmentName:e})}},pageTracker:{enterPage:function(e){t("median://intentedge/pageTracker/enterPage",{pageName:e})}},onboarding:{start:function(){t("median://intentedge/onboarding/start")},complete:function(){t("median://intentedge/onboarding/complete")}},events:{fireMicromoment:function(e,n){t("median://intentedge/events/fireMicromoment",{eventName:e,parameters:n})},sendUserInteraction:function(e,n){t("median://intentedge/events/sendUserInteraction",{campaignId:e,interactionType:n})}},campaigns:{setCampaignTriggerHandler:function(e){t("median://intentedge/campaigns/setCampaignTriggerHandler",{callback:e},!0)},setCampaignClickHandler:function(e){t("median://intentedge/campaigns/setCampaignClickHandler",{callback:e},!0)}},dataEnrichment:{exportData:function(e){return i("median://intentedge/dataEnrichment/exportData",{requestedMetrics:e})}},start:function(){t("median://intentedge/start")},stop:function(e){t("median://intentedge/stop",{purge:e})},launchDebugScreen:function(){t("median://intentedge/launchDebugScreen")},exportLogs:async function(){const e=await i("median://intentedge/exportLogs");if(e.base64){const n=await async function(e,n){const t=atob(e),i=new Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);const a=new Uint8Array(i);return new Blob([a],{type:n})}(e.base64,e.mimeType);return delete e.base64,{...e,logBlob:n}}return e}};const H={registerPush:function(e){return i("median://intercom/registerPush",e)},updateUser:function(e){t("median://intercom/updateUser",e)},logEvent:function(e){t("median://intercom/logEvent",e)},logout:function(){t("median://intercom/logout")},presentCarousel:function(e){t("median://intercom/presentCarousel",e)},permissionStatus:function(e){return i("median://intercom/permissionStatus",e,!0)},requestPermission:function(e){return i("median://intercom/registerPush",e,!0)}},G={initialize:function(e){return i("gonative://iterable/initialize",e)},setEmail:function(e){return i("gonative://iterable/setEmail",e)},setUserId:function(e){return i("gonative://iterable/setUserId",e)},registerPush:function(e){return i("gonative://iterable/registerPush",e)},requestPermission:function(e){return i("gonative://iterable/requestPermission",e)},permissionStatus:function(e){return i("gonative://iterable/permissionStatus",e)}},J={initialize:function(e){return i("median://jwplayer/initialize",e)},play:function(e){return i("median://jwplayer/play",e)}},K={play:function(e){t("median://kaltura/play",e)}},V={set:function(e){return i("gonative://keychainSwift/set",e)},get:function(e){return i("gonative://keychainSwift/get",e)},delete:function(e){return i("gonative://keychainSwift/delete",e)},deleteAll:function(e){return i("gonative://keychainSwift/deleteAll",e)}},Q={promptNotification:function(){return i("median://klaviyo/promptNotification")},notificationEnabled:function(){return i("median://klaviyo/notificationEnabled")},setProfile:function(e){return i("median://klaviyo/setProfile",e)},getProfile:function(){return i("median://klaviyo/getProfile")},resetProfile:function(){return i("median://klaviyo/resetProfile")}},Y={nonpersistent:{set:function(e){t("median://localpreferences/nonpersistent/set",e)},get:function(e){return i("median://localpreferences/nonpersistent/get",e)},delete:function(e){t("median://localpreferences/nonpersistent/delete",e)},deleteAll:function(e){t("median://localpreferences/nonpersistent/deleteAll",e)}},persistent:{set:function(e){t("median://localpreferences/persistent/set",e)},get:function(e){return i("median://localpreferences/persistent/get",e)},delete:function(e){t("median://localpreferences/persistent/delete",e)},deleteAll:function(e){t("median://localpreferences/persistent/deleteAll",e)}},filesystem:{save:function(e){t("median://localpreferences/filesystem/save",e)},read:function(e){return i("median://localpreferences/filesystem/read",e)},delete:function(e){t("median://localpreferences/filesystem/delete",e)}},keychain:{set:function(e){return i("median://localpreferences/keychain/set",e)},get:function(e){return i("median://localpreferences/keychain/get",e)},delete:function(e){return i("median://localpreferences/keychain/delete",e)},deleteAll:function(e){return i("median://localpreferences/keychain/deleteAll",e)}}},Z={initialize:function(e){return i("median://masterlock/initialize",e)},scan:function(e){const i={};e?.onScanStart&&(i.onScanStart=n(e?.onScanStart,!0)),e?.onScanStop&&(i.onScanStop=n(e?.onScanStop,!0)),e?.onDeviceDiscover&&(i.onDeviceDiscover=n(e?.onDeviceDiscover,!0)),t("median://masterlock/scan",i)},unlock:function(e){return i("median://masterlock/unlock",e)},permissionGranted:function(){return i("median://masterlock/permissionGranted")},updateFirmware:function(e){return i("median://masterlock/updateFirmware",e)},firmwareUpdate:{addListener:async function(e){const t=n(e,!0),a=await i("median://masterlock/firmwareUpdate/addListener",{listenerIdCallback:t});if(a&&a.listenerId)return a.listenerId;throw"Invalid listenerId response"},removeListener:function(e){t("median://masterlock/firmwareUpdate/removeListener",{listenerId:e})}},lockReset:function(e){return i("median://masterlock/lockReset",e)},getDeadboltHandedness:function(e){return i("median://masterlock/getDeadboltHandedness",e)},setDeadboltHandedness:function(e){return i("median://masterlock/setDeadboltHandedness",e)},relock:function(e){return i("median://masterlock/relock",e)}},X={launch:function(e){return i("median://modal/launch",e)}},$={notificationEnabled:function(e){return i("median://moengage/notificationEnabled",e,!0)},promptNotification:function(e){return i("median://moengage/promptNotification",e,!0)},setUniqueID:function(e){return i("median://moengage/setUniqueID",{uniqueId:e},!0)},resetUser:function(){return i("median://moengage/resetUser")},setAlias:function(e){return i("median://moengage/setAlias",{alias:e},!0)},trackEvent:function(e,n){return i("median://moengage/trackEvent",{eventName:e,eventData:n},!0)},launchInbox:function(){return i("median://moengage/launchInbox")}},ee={login:function(e){return i("median://moxo/login",e,!0)},registerNotifications:function(e){return i("median://moxo/registerNotifications",e,!0)},requestPermission:function(e){return i("median://moxo/registerNotifications",e,!0)},permissionStatus:function(e){return i("median://moxo/permissionStatus",e,!0)},isLinked:function(e){return i("median://moxo/isLinked",e,!0)},unlink:function(e){return i("median://moxo/unlink",e,!0)},localUnlink:function(e){return i("median://moxo/localUnlink",e,!0)},showDashboard:function(){t("median://moxo/showDashboard")},openLiveChatWithCompletion:function(){t("median://moxo/openLiveChatWithCompletion")},openLiveChatWithChannelId:function(e){t("median://moxo/openLiveChatWithChannelId",e)},openChat:function(e){t("median://moxo/openChat",e)},getUnreadMessageCount:function(e){return i("median://moxo/getUnreadMessageCount",e)}},ne={areNotificationsEnabled:function(e){return i("median://msdynamics/areNotificationsEnabled",e,!0)},promptNotificationPermission:function(e){return i("median://msdynamics/promptNotificationPermission",e,!0)},registrationInfo:function(e){return i("median://msdynamics/registrationInfo",e,!0)},registerDevice:function(e){return i("median://msdynamics/registerDevice",e,!0)}},te={status:function(e){return i("gonative://nfc/status",e)},readTag:function(e){return i("gonative://nfc/readTag",e)}},ie={run:{onesignalInfo:function(){t("median://onesignal/info",{callback:"median_onesignal_info"})}},onesignalInfo:function(e){return i("median://onesignal/info",e,!0)},info:function(e){return i("median://onesignal/info",e,!0)},register:function(e){return i("median://onesignal/register",e,!0)},userPrivacyConsent:{grant:function(){t("median://onesignal/userPrivacyConsent/grant")},revoke:function(){t("median://onesignal/userPrivacyConsent/revoke")}},tags:{getTags:function(e){return i("median://onesignal/tags/get",e)},setTags:function(e){return i("median://onesignal/tags/set",e)},deleteTags:function(e){return i("median://onesignal/tags/delete",e)}},showTagsUI:function(){t("median://onesignal/showTagsUI")},promptLocation:function(){t("median://onesignal/promptLocation")},iam:{addTrigger:function(e){t("median://onesignal/iam/addTrigger",e)},addTriggers:function(e){t("median://onesignal/iam/addTriggers",e)},removeTriggerForKey:function(e){t("median://onesignal/iam/removeTriggerForKey",{key:e})},getTriggerValueForKey:function(e){t("median://onesignal/iam/getTriggerValueForKey",{key:e})},pauseInAppMessages:function(){t("median://onesignal/iam/pauseInAppMessages?pause=true")},resumeInAppMessages:function(){t("median://onesignal/iam/pauseInAppMessages?pause=false")},setInAppMessageClickHandler:function(e){t("median://onesignal/iam/setInAppMessageClickHandler",{handler:n(e,!0)})}},externalUserId:{set:function(e){return i("median://onesignal/externalUserId/set",e)},remove:function(e){return i("median://onesignal/externalUserId/remove",e)}},enableForegroundNotifications:function(e){t("median://onesignal/enableForegroundNotifications",{enabled:e})},badge:{set:function(e){t("median://onesignal/badge/set",{count:e})}},login:function(e,n={}){return i("median://onesignal/login",{externalId:e,...n})},logout:function(e){return i("median://onesignal/logout",e)},pushOpened:c("_median_onesignal_push_opened")},ae={video:{join:function(e){return i("median://opentok/video/join",e)}}},oe={requestPhoneCallMgmt:function(e){if(e?.callback)return i("median://permissions/requestPhoneCallMgmt",e);t("median://permissions/requestPhoneCallMgmt",e)},status:function(e){return i("median://permissions/status",{permissions:e})}},re={linkBank:function(e){return i("median://plaid/linkBank",e)},verifyIdentity:function(e){return i("median://plaid/verifyIdentity",e)}},se={configure:function(e){return i("gonative://revenueCat/configure",e)},getOfferings:function(e){return i("gonative://revenueCat/getOfferings",e)},purchase:function(e){return i("gonative://revenueCat/purchase",e)},restorePurchases:function(e){return i("gonative://revenueCat/restorePurchases",e)}},ce={promptNotification:function(){return i("median://salesforceCloud/promptNotification")},notificationEnabled:function(){return i("median://salesforceCloud/notificationEnabled")},getInfo:function(){return i("median://salesforceCloud/getInfo")},contactKey:{set:function(e){return i("median://salesforceCloud/contactKey/set",e)},get:function(){return i("median://salesforceCloud/contactKey/get")}},attributes:{set:function(e){return i("median://salesforceCloud/attributes/set",e)},get:function(){return i("median://salesforceCloud/attributes/get")}},tags:{set:function(e){return i("median://salesforceCloud/tags/set",e)},get:function(){return i("median://salesforceCloud/tags/get")}}},ue={shareResult:c("_median_share_to_app")},de={facebook:{login:function(e){if(e?.callback)return i("median://socialLogin/facebook/login",e);t("median://socialLogin/facebook/login",e)},logout:function(e){if(e?.callback)return i("median://socialLogin/facebook/logout",e);t("median://socialLogin/facebook/logout",e)}},google:{login:function(e){if(e?.callback)return i("median://socialLogin/google/login",e);t("median://socialLogin/google/login",e)},logout:function(e){if(e?.callback)return i("median://socialLogin/google/logout",e);t("median://socialLogin/google/logout",e)}},apple:{login:function(e){if(e?.callback)return i("median://socialLogin/apple/login",e);t("median://socialLogin/apple/login",e)}}};function le(e,n){function t(e){return new Promise(((n,t)=>{const i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>t(i.error),i.readAsDataURL(e)}))}const i=[t(e)];return n&&"object"==typeof n&&n.attachment instanceof Blob&&i.push(t(n.attachment)),Promise.all(i)}const me={snapchat:{isInstalled:function(e){return i("median://socialShare/snapchat/isInstalled",e)},share:function(e,n){le(e,n).then((([e,i])=>{let a={dataUrl:e};n&&"object"==typeof n&&(a={...n,dataUrl:e,attachment:i}),t("median://socialShare/snapchat/share",a)}))}},instagram:{isInstalled:function(e){return i("median://socialShare/instagram/isInstalled",e)},shareToFeed:function(e){le(e).then((([e])=>{t("median://socialShare/instagram/shareToFeed",{dataUrl:e})}))},shareToStory:function(e,n){le(e,n).then((([e,i])=>{let a={dataUrl:e};n&&"object"==typeof n&&(a={...n,dataUrl:e,attachment:i}),t("median://socialShare/instagram/shareToStory",a)}))}}},fe={video:{join:function(e){return i("median://twilio/video/join",e)}}},ge={shareScreen:function(e){t("median://webScreenshot/shareScreen",e)},shareElement:function(e,n){window.html2canvas&&window.html2canvas(e,{useCORS:!0,scale:1.25}).then((e=>{t("median://webScreenshot/shareElement",{dataUrl:e.toDataURL(),...n})}))},captureScreen:async function(){const e=await i("median://webScreenshot/captureScreen"),n=atob(e.data),t=n.length,a=new Uint8Array(t);for(let e=0;e<t;e++)a[e]=n.charCodeAt(e);return new Blob([a],{type:"image/png"})},captureElement:async function(e){if(!window.html2canvas)return;const n=await window.html2canvas(e,{useCORS:!0,scale:1.25});return new Promise(((e,t)=>{n.toBlob((n=>{n?e(n):t(new Error("Failed to convert to blob."))}))}))}},pe={video:{join:function(e){return i("median://zoom/join",e)}}};var be;return function(e){e.ios=d,e.android=a,e.camera=u.camera,e.clipboard=u.clipboard,e.config=u.config,e.connectivity=u.connectivity,e.deviceInfo=u.deviceInfo,e.internalExternal=u.internalExternal,e.jsNavigation=u.jsNavigation,e.keyboard=u.keyboard,e.nativebridge=u.nativebridge,e.navigationLevels=u.navigationLevels,e.navigationMaxWindows=u.navigationMaxWindows,e.navigationTitles=u.navigationTitles,e.open=u.open,e.registration=u.registration,e.run=u.run,e.screen=u.screen,e.share=u.share,e.sidebar=u.sidebar,e.statusbar=u.statusbar,e.tabNavigation=u.tabNavigation,e.webview=u.webview,e.window=u.window,e.adjust=l,e.admob=m,e.ageSafety=f,e.appreview=g,e.appsflyer=p,e.auth=b,e.auth0=v,e.autorefresh=h,e.backgroundLocation=y,e.backgroundMedia=k,e.barcode=w,e.beacon=S,e.braze=C,e.branch=I,e.calendar=_,e.card_io=A,e.clerk=L,e.contacts=P,e.cordial=T,e.customerio=N,e.documentScanner=E,e.downloads=U,e.esmiley=D,e.facebook=M,e.firebaseAnalytics=F,e.firebaseCrashlytics=q,e.grow=O,e.haptics=R,e.healthBridge=B,e.iap=j,e.intentedge=W,e.intercom=H,e.iterable=G,e.jwplayer=J,e.kaltura=K,e.keychainSwift=V,e.klaviyo=Q,e.localpreferences=Y,e.masterlock=Z,e.modal=X,e.moengage=$,e.moxo=ee,e.msdynamics=ne,e.nfc=te,e.onesignal=ie,e.opentok=ae,e.permissions=oe,e.plaid=re,e.revenueCat=se,e.salesforceCloud=ce,e.shareIntoApp=ue,e.socialLogin=de,e.socialShare=me,e.storage={app:Y.nonpersistent,cloud:Y.persistent,filesystem:Y.filesystem},e.twilio=fe,e.webScreenshot=ge,e.zoom=pe,e.isNativeApp=()=>{const e=globalThis.window;return!!e?.webkit?.messageHandlers?.JSBridge||!!e?.JSBridge},e.getPlatform=async()=>{if(!e.isNativeApp())return"web";const n=await u.deviceInfo();return n?.platform},e.onReady=n=>{if("function"!=typeof n)return;let t=n,i=0;const a=setInterval((()=>{e.isNativeApp()&&t&&(t(),t=null),i++,(i>=20||!t)&&clearInterval(a)}),500)},e.appResumed=c("_median_app_resumed"),e.deviceShake=c("_median_device_shake"),e.appsFlyerConversionData=c("_median_appsflyer_cd"),e.appsFlyerDeeplinkResult=c("_median_appsflyer_deeplink_result"),e.appsFlyerSdkStart=c("_median_appsflyer_sdk_start"),e.branchInitialized=c("_median_branch_initialized"),e.iapInfoReady=c("_median_info_ready"),e.iapPurchases=c("_median_iap_purchases"),e.oneSignalPushOpened=c("_median_onesignal_push_opened"),e.shareToApp=c("_median_share_to_app")}(be||(be={})),be}();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CustomerIo } from '../types/customerio.js';
|
|
2
|
+
declare const customerio: {
|
|
3
|
+
identify: (params: CustomerIo.IdentifyParams) => Promise<CustomerIo.Result>;
|
|
4
|
+
reset: () => Promise<CustomerIo.Result>;
|
|
5
|
+
getUserId: () => Promise<string | null>;
|
|
6
|
+
setProfileAttributes: (attributes: CustomerIo.Attributes) => Promise<CustomerIo.Result>;
|
|
7
|
+
setDeviceAttributes: (attributes: CustomerIo.Attributes) => Promise<CustomerIo.Result>;
|
|
8
|
+
deleteDeviceToken: () => Promise<CustomerIo.Result>;
|
|
9
|
+
push: {
|
|
10
|
+
getPermissionStatus: () => Promise<CustomerIo.PermissionResult>;
|
|
11
|
+
requestPermission: () => Promise<CustomerIo.PermissionResult>;
|
|
12
|
+
opened: {
|
|
13
|
+
addListener: (callback: (data: CustomerIo.PushPayload) => void) => Promise<any>;
|
|
14
|
+
removeListener: (listenerId: string) => void;
|
|
15
|
+
};
|
|
16
|
+
received: {
|
|
17
|
+
addListener: (callback: (data: CustomerIo.PushPayload) => void) => Promise<any>;
|
|
18
|
+
removeListener: (listenerId: string) => void;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
track: (params: CustomerIo.EventParams) => Promise<CustomerIo.Result>;
|
|
22
|
+
screen: (params: CustomerIo.EventParams) => Promise<CustomerIo.Result>;
|
|
23
|
+
setLogLevel: (level: CustomerIo.LogLevel) => Promise<CustomerIo.Result>;
|
|
24
|
+
};
|
|
25
|
+
export default customerio;
|
|
26
|
+
//# sourceMappingURL=customerio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customerio.d.ts","sourceRoot":"","sources":["../../src/plugins/customerio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,QAAA,MAAM,UAAU;uBACc,WAAW,cAAc;;;uCAUT,WAAW,UAAU;sCAGtB,WAAW,UAAU;;;;;;2CAcd,WAAW,WAAW,KAAK,IAAI;yCAKvC,MAAM;;;2CAKE,WAAW,WAAW,KAAK,IAAI;yCAKvC,MAAM;;;oBAKvB,WAAW,WAAW;qBAGrB,WAAW,WAAW;yBAGlB,WAAW,QAAQ;CAGlD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { addCallbackFunction, addCommand, addCommandCallback } from '../utils/index.js';
|
|
2
|
+
const customerio = {
|
|
3
|
+
identify: function (params) {
|
|
4
|
+
return addCommandCallback('median://customerio/identify', params);
|
|
5
|
+
},
|
|
6
|
+
reset: function () {
|
|
7
|
+
return addCommandCallback('median://customerio/reset');
|
|
8
|
+
},
|
|
9
|
+
getUserId: async function () {
|
|
10
|
+
const result = await addCommandCallback('median://customerio/getUserId');
|
|
11
|
+
return result.userId || null;
|
|
12
|
+
},
|
|
13
|
+
setProfileAttributes: function (attributes) {
|
|
14
|
+
return addCommandCallback('median://customerio/setProfileAttributes', { attributes });
|
|
15
|
+
},
|
|
16
|
+
setDeviceAttributes: function (attributes) {
|
|
17
|
+
return addCommandCallback('median://customerio/setDeviceAttributes', { attributes });
|
|
18
|
+
},
|
|
19
|
+
deleteDeviceToken: function () {
|
|
20
|
+
return addCommandCallback('median://customerio/deleteDeviceToken');
|
|
21
|
+
},
|
|
22
|
+
push: {
|
|
23
|
+
getPermissionStatus: function () {
|
|
24
|
+
return addCommandCallback('median://customerio/push/getPermissionStatus');
|
|
25
|
+
},
|
|
26
|
+
requestPermission: function () {
|
|
27
|
+
return addCommandCallback('median://customerio/push/requestPermission');
|
|
28
|
+
},
|
|
29
|
+
opened: {
|
|
30
|
+
addListener: async function (callback) {
|
|
31
|
+
const listenerCallback = addCallbackFunction(callback, true);
|
|
32
|
+
const result = await addCommandCallback('median://customerio/push/opened/addListener', { listenerCallback });
|
|
33
|
+
return result.listenerId || null;
|
|
34
|
+
},
|
|
35
|
+
removeListener: function (listenerId) {
|
|
36
|
+
addCommand('median://customerio/push/opened/removeListener', { listenerId });
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
received: {
|
|
40
|
+
addListener: async function (callback) {
|
|
41
|
+
const listenerCallback = addCallbackFunction(callback, true);
|
|
42
|
+
const result = await addCommandCallback('median://customerio/push/received/addListener', { listenerCallback });
|
|
43
|
+
return result.listenerId || null;
|
|
44
|
+
},
|
|
45
|
+
removeListener: function (listenerId) {
|
|
46
|
+
addCommand('median://customerio/push/received/removeListener', { listenerId });
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
track: function (params) {
|
|
51
|
+
return addCommandCallback('median://customerio/track', params);
|
|
52
|
+
},
|
|
53
|
+
screen: function (params) {
|
|
54
|
+
return addCommandCallback('median://customerio/screen', params);
|
|
55
|
+
},
|
|
56
|
+
setLogLevel: function (level) {
|
|
57
|
+
return addCommandCallback('median://customerio/setLogLevel', { level });
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
export default customerio;
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { default as card_io } from './card_io.js';
|
|
|
17
17
|
export { default as clerk } from './clerk.js';
|
|
18
18
|
export { default as contacts } from './contacts.js';
|
|
19
19
|
export { default as cordial } from './cordial.js';
|
|
20
|
+
export { default as customerio } from './customerio.js';
|
|
20
21
|
export { default as documentScanner } from './documentScanner.js';
|
|
21
22
|
export { default as downloads } from './downloads.js';
|
|
22
23
|
export { default as esmiley } from './esmiley.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAA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,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/plugins/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export { default as card_io } from './card_io.js';
|
|
|
17
17
|
export { default as clerk } from './clerk.js';
|
|
18
18
|
export { default as contacts } from './contacts.js';
|
|
19
19
|
export { default as cordial } from './cordial.js';
|
|
20
|
+
export { default as customerio } from './customerio.js';
|
|
20
21
|
export { default as documentScanner } from './documentScanner.js';
|
|
21
22
|
export { default as downloads } from './downloads.js';
|
|
22
23
|
export { default as esmiley } from './esmiley.js';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare namespace CustomerIo {
|
|
2
|
+
type Attributes = Record<string, string | number | boolean | null>;
|
|
3
|
+
type Result = {
|
|
4
|
+
error?: string;
|
|
5
|
+
success: boolean;
|
|
6
|
+
};
|
|
7
|
+
type IdentifyParams = {
|
|
8
|
+
userId: string;
|
|
9
|
+
traits?: Attributes;
|
|
10
|
+
};
|
|
11
|
+
type GetUserIdResponse = {
|
|
12
|
+
userId: string | null;
|
|
13
|
+
};
|
|
14
|
+
type PermissionResult = {
|
|
15
|
+
granted: boolean;
|
|
16
|
+
status: 'granted' | 'denied' | 'not-determined';
|
|
17
|
+
};
|
|
18
|
+
type PushPayload = {
|
|
19
|
+
notificationId?: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
body?: string;
|
|
22
|
+
imageUrl?: string;
|
|
23
|
+
deepLink?: string;
|
|
24
|
+
data?: Record<string, string | number | boolean | null>;
|
|
25
|
+
};
|
|
26
|
+
type EventParams = {
|
|
27
|
+
name: string;
|
|
28
|
+
properties?: Attributes;
|
|
29
|
+
};
|
|
30
|
+
type LogLevel = 'none' | 'error' | 'info' | 'debug';
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=customerio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customerio.d.ts","sourceRoot":"","sources":["../../src/types/customerio.ts"],"names":[],"mappings":"AAAA,yBAAiB,UAAU,CAAC;IAC1B,KAAY,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;IAE1E,KAAY,MAAM,GAAG;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IAEF,KAAY,cAAc,GAAG;QAC3B,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,UAAU,CAAC;KACrB,CAAC;IAEF,KAAY,iBAAiB,GAAG;QAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;KACvB,CAAC;IAEF,KAAY,gBAAgB,GAAG;QAC7B,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,gBAAgB,CAAC;KACjD,CAAC;IAEF,KAAY,WAAW,GAAG;QACxB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;KACzD,CAAC;IAEF,KAAY,WAAW,GAAG;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,UAAU,CAAC;KACzB,CAAC;IAEF,KAAY,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;CAC5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -57,6 +57,7 @@ namespace Median {
|
|
|
57
57
|
export const clerk = plugins.clerk;
|
|
58
58
|
export const contacts = plugins.contacts;
|
|
59
59
|
export const cordial = plugins.cordial;
|
|
60
|
+
export const customerio = plugins.customerio;
|
|
60
61
|
export const documentScanner = plugins.documentScanner;
|
|
61
62
|
export const downloads = plugins.downloads;
|
|
62
63
|
export const esmiley = plugins.esmiley;
|
|
@@ -179,6 +180,7 @@ export default Median;
|
|
|
179
180
|
///////////////////////////////
|
|
180
181
|
export { AppsFlyer } from './types/appsflyer.js';
|
|
181
182
|
export { Clerk } from './types/clerk.js';
|
|
183
|
+
export { CustomerIo } from './types/customerio.js';
|
|
182
184
|
export { HealthBridge } from './types/healthBridge.js';
|
|
183
185
|
export { JWPlayer } from './types/jwplayer.js';
|
|
184
186
|
export { MasterLock } from './types/masterlock.js';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { CustomerIo } from '../types/customerio.js';
|
|
2
|
+
import { addCallbackFunction, addCommand, addCommandCallback } from '../utils/index.js';
|
|
3
|
+
|
|
4
|
+
const customerio = {
|
|
5
|
+
identify: function (params: CustomerIo.IdentifyParams) {
|
|
6
|
+
return addCommandCallback<CustomerIo.Result>('median://customerio/identify', params);
|
|
7
|
+
},
|
|
8
|
+
reset: function () {
|
|
9
|
+
return addCommandCallback<CustomerIo.Result>('median://customerio/reset');
|
|
10
|
+
},
|
|
11
|
+
getUserId: async function () {
|
|
12
|
+
const result = await addCommandCallback<CustomerIo.GetUserIdResponse>('median://customerio/getUserId');
|
|
13
|
+
return result.userId || null;
|
|
14
|
+
},
|
|
15
|
+
setProfileAttributes: function (attributes: CustomerIo.Attributes) {
|
|
16
|
+
return addCommandCallback<CustomerIo.Result>('median://customerio/setProfileAttributes', { attributes });
|
|
17
|
+
},
|
|
18
|
+
setDeviceAttributes: function (attributes: CustomerIo.Attributes) {
|
|
19
|
+
return addCommandCallback<CustomerIo.Result>('median://customerio/setDeviceAttributes', { attributes });
|
|
20
|
+
},
|
|
21
|
+
deleteDeviceToken: function () {
|
|
22
|
+
return addCommandCallback<CustomerIo.Result>('median://customerio/deleteDeviceToken');
|
|
23
|
+
},
|
|
24
|
+
push: {
|
|
25
|
+
getPermissionStatus: function () {
|
|
26
|
+
return addCommandCallback<CustomerIo.PermissionResult>('median://customerio/push/getPermissionStatus');
|
|
27
|
+
},
|
|
28
|
+
requestPermission: function () {
|
|
29
|
+
return addCommandCallback<CustomerIo.PermissionResult>('median://customerio/push/requestPermission');
|
|
30
|
+
},
|
|
31
|
+
opened: {
|
|
32
|
+
addListener: async function (callback: (data: CustomerIo.PushPayload) => void) {
|
|
33
|
+
const listenerCallback = addCallbackFunction(callback, true);
|
|
34
|
+
const result = await addCommandCallback('median://customerio/push/opened/addListener', { listenerCallback });
|
|
35
|
+
return result.listenerId || null;
|
|
36
|
+
},
|
|
37
|
+
removeListener: function (listenerId: string) {
|
|
38
|
+
addCommand('median://customerio/push/opened/removeListener', { listenerId });
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
received: {
|
|
42
|
+
addListener: async function (callback: (data: CustomerIo.PushPayload) => void) {
|
|
43
|
+
const listenerCallback = addCallbackFunction(callback, true);
|
|
44
|
+
const result = await addCommandCallback('median://customerio/push/received/addListener', { listenerCallback });
|
|
45
|
+
return result.listenerId || null;
|
|
46
|
+
},
|
|
47
|
+
removeListener: function (listenerId: string) {
|
|
48
|
+
addCommand('median://customerio/push/received/removeListener', { listenerId });
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
track: function (params: CustomerIo.EventParams) {
|
|
53
|
+
return addCommandCallback<CustomerIo.Result>('median://customerio/track', params);
|
|
54
|
+
},
|
|
55
|
+
screen: function (params: CustomerIo.EventParams) {
|
|
56
|
+
return addCommandCallback<CustomerIo.Result>('median://customerio/screen', params);
|
|
57
|
+
},
|
|
58
|
+
setLogLevel: function (level: CustomerIo.LogLevel) {
|
|
59
|
+
return addCommandCallback<CustomerIo.Result>('median://customerio/setLogLevel', { level });
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default customerio;
|
package/src/plugins/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { default as card_io } from './card_io.js';
|
|
|
17
17
|
export { default as clerk } from './clerk.js';
|
|
18
18
|
export { default as contacts } from './contacts.js';
|
|
19
19
|
export { default as cordial } from './cordial.js';
|
|
20
|
+
export { default as customerio } from './customerio.js';
|
|
20
21
|
export { default as documentScanner } from './documentScanner.js';
|
|
21
22
|
export { default as downloads } from './downloads.js';
|
|
22
23
|
export { default as esmiley } from './esmiley.js';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export namespace CustomerIo {
|
|
2
|
+
export type Attributes = Record<string, string | number | boolean | null>;
|
|
3
|
+
|
|
4
|
+
export type Result = {
|
|
5
|
+
error?: string;
|
|
6
|
+
success: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type IdentifyParams = {
|
|
10
|
+
userId: string;
|
|
11
|
+
traits?: Attributes;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type GetUserIdResponse = {
|
|
15
|
+
userId: string | null;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type PermissionResult = {
|
|
19
|
+
granted: boolean;
|
|
20
|
+
status: 'granted' | 'denied' | 'not-determined';
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type PushPayload = {
|
|
24
|
+
notificationId?: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
body?: string;
|
|
27
|
+
imageUrl?: string;
|
|
28
|
+
deepLink?: string;
|
|
29
|
+
data?: Record<string, string | number | boolean | null>;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type EventParams = {
|
|
33
|
+
name: string;
|
|
34
|
+
properties?: Attributes;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type LogLevel = 'none' | 'error' | 'info' | 'debug';
|
|
38
|
+
}
|