Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

react-onesignal

Package Overview
Dependencies
Maintainers
7
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-onesignal - npm Package Compare versions

Comparing version
3.5.1
to
3.5.2
+14
-18
package.json
{
"name": "react-onesignal",
"version": "3.5.1",
"version": "3.5.2",
"description": "React OneSignal Module: Make it easy to integrate OneSignal with your React App!",

@@ -33,23 +33,18 @@ "contributors": [

"engines": {
"node": ">=14",
"npm": ">=6"
"node": ">=18"
},
"scripts": {
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"build": "tsc --noEmit && vite build",
"test": "vitest run",
"prepare": "npm run lint && npm run test && npm run build"
"lint": "vp lint",
"test": "vp test",
"build": "vp pack"
},
"overrides": {
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.21",
"vitest": "npm:@voidzero-dev/vite-plus-test@0.1.21"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^8.28.0",
"@typescript-eslint/parser": "^8.28.0",
"eslint": "^8.57.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "7.37.4",
"@vitest/coverage-v8": "^4.1.6",
"jsdom": "^26.0.0",
"typescript": "^5.8.2",
"vite": "^6.2.1",
"vite-plugin-dts": "^4.5.3",
"vitest": "^3.0.9"
"typescript": "^6.0.3",
"vite-plus": "0.1.21"
},

@@ -65,3 +60,4 @@ "files": [

"react"
]
],
"packageManager": "bun@1.3.13"
}
"use strict";const d="onesignal-sdk",l="https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.page.js";let u=!1,s=!1;typeof window<"u"&&(window.OneSignalDeferred=window.OneSignalDeferred||[]);function c(){s=!0}function f(i){if(document.getElementById(d))return;const e=document.createElement("script");e.id=d,e.defer=!0,e.src=i||l,e.onerror=()=>{c()},document.head.appendChild(e)}function w(){return g()||S()}function p(){return window.top!==window&&navigator.vendor==="Apple Computer, Inc."&&navigator.platform==="MacIntel"}function S(){return window.safari&&typeof window.safari.pushNotification<"u"||p()}function g(){return typeof PushSubscriptionOptions<"u"&&PushSubscriptionOptions.prototype.hasOwnProperty("applicationServerKey")}const m=()=>w(),h=i=>{var e;return u?Promise.reject("OneSignal is already initialized."):!i||!i.appId?Promise.reject("You need to provide your OneSignal appId."):document?(((e=i.welcomeNotification)==null?void 0:e.disabled)!==void 0&&(i.welcomeNotification.disable=i.welcomeNotification.disabled),f(i.scriptSrc),new Promise((n,r)=>{var t;(t=window.OneSignalDeferred)==null||t.push(o=>{o.init(i).then(()=>{u=!0,n()}).catch(r)})})):Promise.reject("Document is not defined.")};function O(i,e){return new Promise((n,r)=>{var t;if(s){r(new Error("OneSignal script failed to load."));return}(t=window.OneSignalDeferred)==null||t.push(o=>{o.login(i,e).then(()=>n()).catch(a=>r(a))})})}function v(){return new Promise((i,e)=>{var n;if(s){e(new Error("OneSignal script failed to load."));return}(n=window.OneSignalDeferred)==null||n.push(r=>{r.logout().then(()=>i()).catch(t=>e(t))})})}function E(i){return new Promise((e,n)=>{var r;if(s){n(new Error("OneSignal script failed to load."));return}(r=window.OneSignalDeferred)==null||r.push(t=>{t.setConsentGiven(i).then(()=>e()).catch(o=>n(o))})})}function D(i){return new Promise((e,n)=>{var r;if(s){n(new Error("OneSignal script failed to load."));return}(r=window.OneSignalDeferred)==null||r.push(t=>{t.setConsentRequired(i).then(()=>e()).catch(o=>n(o))})})}function P(i){return new Promise((e,n)=>{var r;if(s){n(new Error("OneSignal script failed to load."));return}(r=window.OneSignalDeferred)==null||r.push(t=>{t.Slidedown.promptPush(i).then(()=>e()).catch(o=>n(o))})})}function L(i){return new Promise((e,n)=>{var r;if(s){n(new Error("OneSignal script failed to load."));return}(r=window.OneSignalDeferred)==null||r.push(t=>{t.Slidedown.promptPushCategories(i).then(()=>e()).catch(o=>n(o))})})}function U(i){return new Promise((e,n)=>{var r;if(s){n(new Error("OneSignal script failed to load."));return}(r=window.OneSignalDeferred)==null||r.push(t=>{t.Slidedown.promptSms(i).then(()=>e()).catch(o=>n(o))})})}function A(i){return new Promise((e,n)=>{var r;if(s){n(new Error("OneSignal script failed to load."));return}(r=window.OneSignalDeferred)==null||r.push(t=>{t.Slidedown.promptEmail(i).then(()=>e()).catch(o=>n(o))})})}function N(i){return new Promise((e,n)=>{var r;if(s){n(new Error("OneSignal script failed to load."));return}(r=window.OneSignalDeferred)==null||r.push(t=>{t.Slidedown.promptSmsAndEmail(i).then(()=>e()).catch(o=>n(o))})})}function b(i,e){var n;(n=window.OneSignalDeferred)==null||n.push(r=>{r.Slidedown.addEventListener(i,e)})}function T(i,e){var n;(n=window.OneSignalDeferred)==null||n.push(r=>{r.Slidedown.removeEventListener(i,e)})}function I(i){return new Promise((e,n)=>{var r;if(s){n(new Error("OneSignal script failed to load."));return}(r=window.OneSignalDeferred)==null||r.push(t=>{t.Notifications.setDefaultUrl(i).then(()=>e()).catch(o=>n(o))})})}function R(i){return new Promise((e,n)=>{var r;if(s){n(new Error("OneSignal script failed to load."));return}(r=window.OneSignalDeferred)==null||r.push(t=>{t.Notifications.setDefaultTitle(i).then(()=>e()).catch(o=>n(o))})})}function C(){return new Promise((i,e)=>{var n;if(s){e(new Error("OneSignal script failed to load."));return}(n=window.OneSignalDeferred)==null||n.push(r=>{r.Notifications.requestPermission().then(t=>i(t)).catch(t=>e(t))})})}function y(i,e){var n;(n=window.OneSignalDeferred)==null||n.push(r=>{r.Notifications.addEventListener(i,e)})}function q(i,e){var n;(n=window.OneSignalDeferred)==null||n.push(r=>{r.Notifications.removeEventListener(i,e)})}function k(i,e){return new Promise((n,r)=>{var t;if(s){r(new Error("OneSignal script failed to load."));return}(t=window.OneSignalDeferred)==null||t.push(o=>{o.Session.sendOutcome(i,e).then(()=>n()).catch(a=>r(a))})})}function G(i){return new Promise((e,n)=>{var r;if(s){n(new Error("OneSignal script failed to load."));return}(r=window.OneSignalDeferred)==null||r.push(t=>{t.Session.sendUniqueOutcome(i).then(()=>e()).catch(o=>n(o))})})}function K(i,e){var n;(n=window.OneSignalDeferred)==null||n.push(r=>{r.User.addAlias(i,e)})}function _(i){var e;(e=window.OneSignalDeferred)==null||e.push(n=>{n.User.addAliases(i)})}function x(i){var e;(e=window.OneSignalDeferred)==null||e.push(n=>{n.User.removeAlias(i)})}function V(i){var e;(e=window.OneSignalDeferred)==null||e.push(n=>{n.User.removeAliases(i)})}function z(i){var e;(e=window.OneSignalDeferred)==null||e.push(n=>{n.User.addEmail(i)})}function F(i){var e;(e=window.OneSignalDeferred)==null||e.push(n=>{n.User.removeEmail(i)})}function M(i){var e;(e=window.OneSignalDeferred)==null||e.push(n=>{n.User.addSms(i)})}function B(i){var e;(e=window.OneSignalDeferred)==null||e.push(n=>{n.User.removeSms(i)})}function Y(i,e){var n;(n=window.OneSignalDeferred)==null||n.push(r=>{r.User.addTag(i,e)})}function H(i){var e;(e=window.OneSignalDeferred)==null||e.push(n=>{n.User.addTags(i)})}function J(i){var e;(e=window.OneSignalDeferred)==null||e.push(n=>{n.User.removeTag(i)})}function Q(i){var e;(e=window.OneSignalDeferred)==null||e.push(n=>{n.User.removeTags(i)})}async function W(){var e;let i;return await((e=window.OneSignalDeferred)==null?void 0:e.push(n=>{i=n.User.getTags()})),i}function X(i,e){var n;(n=window.OneSignalDeferred)==null||n.push(r=>{r.User.addEventListener(i,e)})}function Z(i,e){var n;(n=window.OneSignalDeferred)==null||n.push(r=>{r.User.removeEventListener(i,e)})}function $(i){var e;(e=window.OneSignalDeferred)==null||e.push(n=>{n.User.setLanguage(i)})}async function j(){var e;let i;return await((e=window.OneSignalDeferred)==null?void 0:e.push(n=>{i=n.User.getLanguage()})),i}function ee(i,e){var n;(n=window.OneSignalDeferred)==null||n.push(r=>{r.User.trackEvent(i,e)})}function ne(){return new Promise((i,e)=>{var n;if(s){e(new Error("OneSignal script failed to load."));return}(n=window.OneSignalDeferred)==null||n.push(r=>{r.User.PushSubscription.optIn().then(()=>i()).catch(t=>e(t))})})}function ie(){return new Promise((i,e)=>{var n;if(s){e(new Error("OneSignal script failed to load."));return}(n=window.OneSignalDeferred)==null||n.push(r=>{r.User.PushSubscription.optOut().then(()=>i()).catch(t=>e(t))})})}function re(i,e){var n;(n=window.OneSignalDeferred)==null||n.push(r=>{r.User.PushSubscription.addEventListener(i,e)})}function te(i,e){var n;(n=window.OneSignalDeferred)==null||n.push(r=>{r.User.PushSubscription.removeEventListener(i,e)})}function oe(i){var e;(e=window.OneSignalDeferred)==null||e.push(n=>{n.Debug.setLogLevel(i)})}const se={get id(){var i,e,n;return(n=(e=(i=window.OneSignal)==null?void 0:i.User)==null?void 0:e.PushSubscription)==null?void 0:n.id},get token(){var i,e,n;return(n=(e=(i=window.OneSignal)==null?void 0:i.User)==null?void 0:e.PushSubscription)==null?void 0:n.token},get optedIn(){var i,e,n;return(n=(e=(i=window.OneSignal)==null?void 0:i.User)==null?void 0:e.PushSubscription)==null?void 0:n.optedIn},optIn:ne,optOut:ie,addEventListener:re,removeEventListener:te},ae={get onesignalId(){var i,e;return(e=(i=window.OneSignal)==null?void 0:i.User)==null?void 0:e.onesignalId},get externalId(){var i,e;return(e=(i=window.OneSignal)==null?void 0:i.User)==null?void 0:e.externalId},addAlias:K,addAliases:_,removeAlias:x,removeAliases:V,addEmail:z,removeEmail:F,addSms:M,removeSms:B,addTag:Y,addTags:H,removeTag:J,removeTags:Q,getTags:W,addEventListener:X,removeEventListener:Z,setLanguage:$,getLanguage:j,trackEvent:ee,PushSubscription:se},de={sendOutcome:k,sendUniqueOutcome:G},ue={setLogLevel:oe},le={promptPush:P,promptPushCategories:L,promptSms:U,promptEmail:A,promptSmsAndEmail:N,addEventListener:b,removeEventListener:T},ce={get permissionNative(){var i,e;return((e=(i=window.OneSignal)==null?void 0:i.Notifications)==null?void 0:e.permissionNative)??"default"},get permission(){var i,e;return((e=(i=window.OneSignal)==null?void 0:i.Notifications)==null?void 0:e.permission)??!1},setDefaultUrl:I,setDefaultTitle:R,isPushSupported:m,requestPermission:C,addEventListener:y,removeEventListener:q},fe={login:O,logout:v,init:h,setConsentGiven:E,setConsentRequired:D,Slidedown:le,Notifications:ce,Session:de,User:ae,Debug:ue},we=fe;module.exports=we;
//# sourceMappingURL=index.cjs.map
{"version":3,"file":"index.cjs","sources":["../index.ts"],"sourcesContent":["const ONESIGNAL_SDK_ID = 'onesignal-sdk';\nconst DEFAULT_SCRIPT_SRC =\n 'https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.page.js';\n\nlet isOneSignalInitialized = false;\nlet isOneSignalScriptFailed = false;\n\nif (typeof window !== 'undefined') {\n window.OneSignalDeferred = window.OneSignalDeferred || [];\n}\n\ndeclare global {\n interface Window {\n OneSignalDeferred?: OneSignalDeferredLoadedCallback[];\n OneSignal?: IOneSignalOneSignal;\n safari?: {\n pushNotification: any;\n };\n }\n}\n\n/* H E L P E R S */\n\nfunction handleOnError() {\n isOneSignalScriptFailed = true;\n}\n\nfunction addSDKScript(scriptSrc?: string) {\n if (document.getElementById(ONESIGNAL_SDK_ID)) {\n return;\n }\n\n const script = document.createElement('script');\n script.id = ONESIGNAL_SDK_ID;\n script.defer = true;\n script.src = scriptSrc || DEFAULT_SCRIPT_SRC;\n\n // Always resolve whether or not the script is successfully initialized.\n // This is important for users who may block cdn.onesignal.com w/ adblock.\n script.onerror = () => {\n handleOnError();\n };\n\n document.head.appendChild(script);\n}\n\n/**\n * The following code is copied directly from the native SDK source file BrowserSupportsPush.ts\n * S T A R T\n */\n\n// Checks if the browser supports push notifications by checking if specific\n// classes and properties on them exist\nfunction isPushNotificationsSupported() {\n return supportsVapidPush() || supportsSafariPush();\n}\n\nfunction isMacOSSafariInIframe(): boolean {\n // Fallback detection for Safari on macOS in an iframe context\n return (\n window.top !== window && // isContextIframe\n navigator.vendor === 'Apple Computer, Inc.' && // isSafari\n navigator.platform === 'MacIntel'\n ); // isMacOS\n}\n\nfunction supportsSafariPush(): boolean {\n return (\n (window.safari && typeof window.safari.pushNotification !== 'undefined') ||\n isMacOSSafariInIframe()\n );\n}\n\n// Does the browser support the standard Push API\nfunction supportsVapidPush(): boolean {\n return (\n typeof PushSubscriptionOptions !== 'undefined' &&\n PushSubscriptionOptions.prototype.hasOwnProperty('applicationServerKey')\n );\n}\n/* E N D */\n\n/**\n * This is a SPECIAL FUNCTION\n * It is a hardcoded implementation copied from the upstream/native WebSDK since we want to return a boolean immediately\n * Natively, this is done via the shimloading mechanism (i.e. if the SDK loads, push is supported)\n * @PublicApi\n */\nconst isPushSupported = (): boolean => {\n return isPushNotificationsSupported();\n};\n\n/**\n * @PublicApi\n */\nconst init = (options: IInitObject): Promise<void> => {\n if (isOneSignalInitialized) {\n return Promise.reject(`OneSignal is already initialized.`);\n }\n\n if (!options || !options.appId) {\n return Promise.reject('You need to provide your OneSignal appId.');\n }\n\n if (!document) {\n return Promise.reject(`Document is not defined.`);\n }\n\n // Handle both disabled and disable keys for welcome notification\n if (options.welcomeNotification?.disabled !== undefined) {\n options.welcomeNotification.disable = options.welcomeNotification.disabled;\n }\n\n addSDKScript(options.scriptSrc);\n\n return new Promise<void>((resolve, reject) => {\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.init(options)\n .then(() => {\n isOneSignalInitialized = true;\n resolve();\n })\n .catch(reject);\n });\n });\n};\n\nexport interface AutoPromptOptions { force?: boolean; forceSlidedownOverNative?: boolean; slidedownPromptOptions?: IOneSignalAutoPromptOptions; }\nexport interface IOneSignalAutoPromptOptions { force?: boolean; forceSlidedownOverNative?: boolean; isInUpdateMode?: boolean; categoryOptions?: IOneSignalCategories; }\nexport interface IOneSignalCategories { positiveUpdateButton: string; negativeUpdateButton: string; savingButtonText: string; errorButtonText: string; updateMessage: string; tags: IOneSignalTagCategory[]; }\nexport interface IOneSignalTagCategory { tag: string; label: string; checked?: boolean; }\nexport type PushSubscriptionNamespaceProperties = { id: string | null | undefined; token: string | null | undefined; optedIn: boolean; };\nexport type SubscriptionChangeEvent = { previous: PushSubscriptionNamespaceProperties; current: PushSubscriptionNamespaceProperties; };\nexport type NotificationEventName = 'click' | 'foregroundWillDisplay' | 'dismiss' | 'permissionChange' | 'permissionPromptDisplay';\nexport type SlidedownEventName = 'slidedownAllowClick' | 'slidedownCancelClick' | 'slidedownClosed' | 'slidedownQueued' | 'slidedownShown';\nexport type OneSignalDeferredLoadedCallback = (onesignal: IOneSignalOneSignal) => void;\nexport interface IOSNotification {\n /**\n * The OneSignal notification id;\n * - Primary id on OneSignal's REST API and dashboard\n */\n readonly notificationId: string;\n\n /**\n * Visible title text on the notification\n */\n readonly title?: string;\n\n /**\n * Visible body text on the notification\n */\n readonly body: string;\n\n /**\n * Visible icon the notification; URL format\n */\n readonly icon?: string;\n\n /**\n * Visible small badgeIcon that displays on some devices; URL format\n * Example: On Android's status bar\n */\n readonly badgeIcon?: string;\n\n /**\n * Visible image on the notification; URL format\n */\n readonly image?: string;\n\n /**\n * Visible buttons on the notification\n */\n readonly actionButtons?: IOSNotificationActionButton[];\n\n /**\n * If this value is the same as existing notification, it will replace it\n * Can be set when creating the notification with \"Web Push Topic\" on the dashboard\n * or web_push_topic from the REST API.\n */\n readonly topic?: string;\n\n /**\n * Custom object that was sent with the notification;\n * definable when creating the notification from the OneSignal REST API or dashboard\n */\n readonly additionalData?: object;\n\n /**\n * URL to open when clicking or tapping on the notification\n */\n readonly launchURL?: string;\n\n /**\n * Confirm the push was received by reporting back to OneSignal\n */\n readonly confirmDelivery: boolean;\n}\n\nexport interface IOSNotificationActionButton {\n /**\n * Any unique identifier to represent which button was clicked. This is typically passed back to the service worker\n * and host page through events to identify which button was clicked.\n * e.g. 'like-button'\n */\n readonly actionId: string;\n /**\n * The notification action button's text.\n */\n readonly text: string;\n /**\n * A valid publicly reachable HTTPS URL to an image.\n */\n readonly icon?: string;\n /**\n * The URL to open the web browser to when this action button is clicked.\n */\n readonly launchURL?: string;\n}\n\nexport interface IDisplayableOSNotification extends IOSNotification {\n display(): void;\n}\n\nexport interface NotificationClickResult {\n readonly actionId?: string;\n readonly url?: string;\n}\n\nexport type NotificationEventTypeMap = {\n 'click': NotificationClickEvent;\n 'foregroundWillDisplay': NotificationForegroundWillDisplayEvent;\n 'dismiss': NotificationDismissEvent;\n 'permissionChange': boolean;\n 'permissionPromptDisplay': void;\n};\n\nexport interface NotificationForegroundWillDisplayEvent {\n readonly notification: IDisplayableOSNotification;\n preventDefault(): void;\n}\n\nexport interface NotificationDismissEvent {\n notification: IOSNotification;\n}\n\nexport interface NotificationClickEvent {\n readonly notification: IOSNotification;\n readonly result: NotificationClickResult;\n}\n\nexport type UserChangeEvent = {\n current: UserNamespaceProperties;\n};\nexport type UserNamespaceProperties = {\n onesignalId: string | undefined;\n externalId: string | undefined;\n};\n\nexport interface IInitObject {\n appId: string;\n requiresUserPrivacyConsent?: boolean;\n safari_web_id?: string;\n subdomainName?: string;\n promptOptions?: {\n slidedown: {\n prompts: {\n /**\n * Whether to automatically display the prompt.\n * `true` will display the prompt based on the delay options.\n * `false` will prevent the prompt from displaying until the Slidedowns methods are used.\n */\n autoPrompt: boolean;\n\n /**\n * Only available for type: category. Up to 10 categories.\n * @example\n * categories: [{ tag: 'local_news', label: 'Local News' }] // The user will be tagged with local_news but will see \"Local News\" in the prompt.\n */\n categories?: {\n /** Should identify the action. */\n tag: string;\n\n /** What the user will see. */\n label: string;\n }[];\n\n /**\n * The delay options for the prompt.\n * @example delay: { pageViews: 3, timeDelay: 20 } // The user will not be shown the prompt until 20 seconds after the 3rd page view.\n */\n delay: {\n /** The number of pages a user needs to visit before the prompt is displayed. */\n pageViews?: number;\n\n /** The number of seconds a user needs to wait before the prompt is displayed.Both options must be satisfied for the prompt to display */\n timeDelay?: number;\n };\n\n /**\n * The text to display in the prompt.\n */\n text?: {\n /** The callout asking the user to opt-in. Up to 90 characters. */\n actionMessage?: string;\n\n /** Triggers the opt-in. Up to 15 characters. */\n acceptButton?: string;\n\n /** Cancels opt-in. Up to 15 characters. */\n cancelButton?: string;\n\n /** The message of the confirmation prompt displayed after the email and/or phone number is provided. Up to 90 characters. */\n confirmMessage?: string;\n\n /** Identifies the email text field. Up to 15 characters. */\n emailLabel?: string;\n\n /** Cancels the category update. Up to 15 characters. */\n negativeUpdateButton?: string;\n\n /** Saves the updated category tags. Up to 15 characters. */\n positiveUpdateButton?: string;\n\n /** Identifies the phone number text field. Up to 15 characters. */\n smsLabel?: string;\n\n /** A different message shown to subscribers presented the prompt again to update categories. Up to 90 characters. */\n updateMessage?: string;\n };\n\n /**\n * The type of prompt to display.\n * `push` which is the Slide Prompt without categories.\n * `category` which is the Slide Prompt with categories.\n * `sms` only asks for phone number.\n * `email` only asks for email address.\n * `smsAndEmail` asks for both phone number and email address.\n */\n type: 'push' | 'category' | 'sms' | 'email' | 'smsAndEmail';\n }[];\n };\n };\n welcomeNotification?: {\n /**\n * Disables sending a welcome notification to new site visitors. If you want to disable welcome notifications, this is the only option you need.\n * @deprecated Use 'disable' instead. This will be removed in a future version.\n */\n disabled?: boolean;\n\n /**\n * Disables sending a welcome notification to new site visitors. If you want to disable welcome notifications, this is the only option you need.\n */\n disable?: boolean;\n\n /**\n * The welcome notification's message. You can localize this to your own language.\n * If left blank or set to blank, the default of 'Thanks for subscribing!' will be used.\n */\n message: string;\n\n /**\n * The welcome notification's title. You can localize this to your own language. If not set, or left blank, the site's title will be used.\n * Set to one space ' ' to clear the title, although this is not recommended.\n */\n title?: string;\n\n /**\n * By default, clicking the welcome notification does not open any link.\n * This is recommended because the user has just visited your site and subscribed.\n */\n url?: string;\n };\n\n /**\n * Will enable customization of the notify/subscription bell button.\n */\n notifyButton?: {\n /**\n * A function you define that returns true to show the Subscription Bell, or false to hide it.\n * Typically used the hide the Subscription Bell after the user is subscribed.\n * This function is not re-evaluated on every state change; this function is only evaluated once when the Subscription Bell begins to show.\n */\n displayPredicate?: () => boolean | Promise<boolean>;\n\n /**\n * Enable the Subscription Bell. The Subscription Bell is otherwise disabled by default.\n */\n enable?: boolean;\n\n /** Specify CSS-valid pixel offsets using bottom, left, and right. */\n offset?: { bottom: string; left: string; right: string };\n\n /**\n * If `true`, the Subscription Bell will display an icon that there is 1 unread message.\n * When hovering over the Subscription Bell, the user will see custom text set by message.prenotify.\n */\n prenotify: boolean;\n\n /** Either `bottom-left` or `bottom-right`. The Subscription Bell will be fixed at this location on your page. */\n position?: 'bottom-left' | 'bottom-right';\n\n /** Set `false` to hide the 'Powered by OneSignal' text in the Subscription Bell dialog popup. */\n showCredit: boolean;\n\n /**\n * The Subscription Bell will initially appear at one of these sizes, and then shrink down to size `small` after the user subscribes.\n */\n size?: 'small' | 'medium' | 'large';\n\n /** Customize the Subscription Bell text. */\n text: {\n 'dialog.blocked.message': string;\n 'dialog.blocked.title': string;\n 'dialog.main.button.subscribe': string;\n 'dialog.main.button.unsubscribe': string;\n 'dialog.main.title': string;\n 'message.action.resubscribed': string;\n 'message.action.subscribed': string;\n 'message.action.subscribing': string;\n 'message.action.unsubscribed': string;\n 'message.prenotify': string;\n 'tip.state.blocked': string;\n 'tip.state.subscribed': string;\n 'tip.state.unsubscribed': string;\n };\n };\n\n persistNotification?: boolean;\n webhooks?: {\n /**\n * Enable this setting only if your server has CORS enabled and supports non-simple CORS requests.\n * If this setting is disabled, your webhook will not need CORS to receive data, but it will not receive the custom headers.\n * The simplest option is to leave it disabled.\n * @default false\n */\n cors: boolean;\n\n /**\n * This event occurs after a notification is clicked.\n * @example https://site.com/hook\n */\n 'notification.clicked'?: string;\n\n /**\n * This event occurs after a notification is intentionally dismissed by the user (clicking the notification body or one of the notification action buttons does not trigger the dismissed webhook),\n * after a group of notifications are all dismissed (with this notification as part of that group), or after a notification expires on its own time and disappears. This event is supported on Chrome only.\n * @example https://site.com/hook\n */\n 'notification.dismissed'?: string;\n\n /**\n * This event occurs after a notification is displayed.\n * @example https://site.com/hook\n */\n 'notification.willDisplay'?: string;\n };\n autoResubscribe?: boolean;\n autoRegister?: boolean;\n notificationClickHandlerMatch?: 'exact' | 'origin';\n notificationClickHandlerAction?: 'navigate' | 'focus';\n path?: string;\n serviceWorkerParam?: { scope: string };\n serviceWorkerPath?: string;\n serviceWorkerOverrideForTypical?: boolean;\n /**\n * Overrides the default OneSignal SDK script URL.\n * Use this to self-host the SDK script on your own domain, e.g. to comply\n * with strict Cross-Origin-Embedder-Policy (COEP) or Content-Security-Policy (CSP) headers.\n * @default 'https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.page.js'\n */\n scriptSrc?: string;\n [key: string]: unknown;\n}\n\nexport interface IOneSignalOneSignal {\n\tSlidedown: IOneSignalSlidedown;\n\tNotifications: IOneSignalNotifications;\n\tSession: IOneSignalSession;\n\tUser: IOneSignalUser;\n\tDebug: IOneSignalDebug;\n\tlogin(externalId: string, jwtToken?: string): Promise<void>;\n\tlogout(): Promise<void>;\n\tinit(options: IInitObject): Promise<void>;\n\tsetConsentGiven(consent: boolean): Promise<void>;\n\tsetConsentRequired(requiresConsent: boolean): Promise<void>;\n}\nexport interface IOneSignalNotifications {\n\tpermissionNative: NotificationPermission;\n\tpermission: boolean;\n\tsetDefaultUrl(url: string): Promise<void>;\n\tsetDefaultTitle(title: string): Promise<void>;\n\tisPushSupported(): boolean;\n\trequestPermission(): Promise<boolean>;\n\taddEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void;\n\tremoveEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void;\n}\nexport interface IOneSignalSlidedown {\n\tpromptPush(options?: AutoPromptOptions): Promise<void>;\n\tpromptPushCategories(options?: AutoPromptOptions): Promise<void>;\n\tpromptSms(options?: AutoPromptOptions): Promise<void>;\n\tpromptEmail(options?: AutoPromptOptions): Promise<void>;\n\tpromptSmsAndEmail(options?: AutoPromptOptions): Promise<void>;\n\taddEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void;\n\tremoveEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void;\n}\nexport interface IOneSignalDebug {\n\tsetLogLevel(logLevel: 'trace' | 'debug' | 'info' | 'warn' | 'error'): void;\n}\nexport interface IOneSignalSession {\n\tsendOutcome(outcomeName: string, outcomeWeight?: number): Promise<void>;\n\tsendUniqueOutcome(outcomeName: string): Promise<void>;\n}\nexport interface IOneSignalUser {\n\tonesignalId: string | undefined;\n\texternalId: string | undefined;\n\tPushSubscription: IOneSignalPushSubscription;\n\taddAlias(label: string, id: string): void;\n\taddAliases(aliases: { [key: string]: string }): void;\n\tremoveAlias(label: string): void;\n\tremoveAliases(labels: string[]): void;\n\taddEmail(email: string): void;\n\tremoveEmail(email: string): void;\n\taddSms(smsNumber: string): void;\n\tremoveSms(smsNumber: string): void;\n\taddTag(key: string, value: string): void;\n\taddTags(tags: { [key: string]: string }): void;\n\tremoveTag(key: string): void;\n\tremoveTags(keys: string[]): void;\n\tgetTags(): { [key: string]: string };\n\taddEventListener(event: 'change', listener: (change: UserChangeEvent) => void): void;\n\tremoveEventListener(event: 'change', listener: (change: UserChangeEvent) => void): void;\n\tsetLanguage(language: string): void;\n\tgetLanguage(): string;\n\ttrackEvent(name: string, properties?: Record<string, unknown>): void;\n}\nexport interface IOneSignalPushSubscription {\n\tid: string | null | undefined;\n\ttoken: string | null | undefined;\n\toptedIn: boolean | undefined;\n\toptIn(): Promise<void>;\n\toptOut(): Promise<void>;\n\taddEventListener(event: 'change', listener: (change: SubscriptionChangeEvent) => void): void;\n\tremoveEventListener(event: 'change', listener: (change: SubscriptionChangeEvent) => void): void;\n}\nfunction oneSignalLogin(externalId: string, jwtToken?: string): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.login(externalId, jwtToken)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction oneSignalLogout(): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.logout()\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction oneSignalSetConsentGiven(consent: boolean): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.setConsentGiven(consent)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction oneSignalSetConsentRequired(requiresConsent: boolean): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.setConsentRequired(requiresConsent)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction slidedownPromptPush(options?: AutoPromptOptions): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.promptPush(options)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction slidedownPromptPushCategories(options?: AutoPromptOptions): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.promptPushCategories(options)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction slidedownPromptSms(options?: AutoPromptOptions): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.promptSms(options)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction slidedownPromptEmail(options?: AutoPromptOptions): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.promptEmail(options)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction slidedownPromptSmsAndEmail(options?: AutoPromptOptions): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.promptSmsAndEmail(options)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction slidedownAddEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.addEventListener(event, listener);\n });\n \n}\nfunction slidedownRemoveEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.removeEventListener(event, listener);\n });\n \n}\nfunction notificationsSetDefaultUrl(url: string): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Notifications.setDefaultUrl(url)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction notificationsSetDefaultTitle(title: string): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Notifications.setDefaultTitle(title)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction notificationsRequestPermission(): Promise<boolean> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Notifications.requestPermission()\n .then(result => resolve(result))\n .catch(error => reject(error));\n });\n });\n}\nfunction notificationsAddEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Notifications.addEventListener(event, listener);\n });\n \n}\nfunction notificationsRemoveEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Notifications.removeEventListener(event, listener);\n });\n \n}\nfunction sessionSendOutcome(outcomeName: string, outcomeWeight?: number): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Session.sendOutcome(outcomeName, outcomeWeight)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction sessionSendUniqueOutcome(outcomeName: string): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Session.sendUniqueOutcome(outcomeName)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction userAddAlias(label: string, id: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addAlias(label, id);\n });\n \n}\nfunction userAddAliases(aliases: { [key: string]: string }): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addAliases(aliases);\n });\n \n}\nfunction userRemoveAlias(label: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeAlias(label);\n });\n \n}\nfunction userRemoveAliases(labels: string[]): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeAliases(labels);\n });\n \n}\nfunction userAddEmail(email: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addEmail(email);\n });\n \n}\nfunction userRemoveEmail(email: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeEmail(email);\n });\n \n}\nfunction userAddSms(smsNumber: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addSms(smsNumber);\n });\n \n}\nfunction userRemoveSms(smsNumber: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeSms(smsNumber);\n });\n \n}\nfunction userAddTag(key: string, value: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addTag(key, value);\n });\n \n}\nfunction userAddTags(tags: { [key: string]: string }): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addTags(tags);\n });\n \n}\nfunction userRemoveTag(key: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeTag(key);\n });\n \n}\nfunction userRemoveTags(keys: string[]): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeTags(keys);\n });\n \n}\n// @ts-expect-error - return non-Promise type despite needing to await OneSignalDeferred\nasync function userGetTags(): { [key: string]: string } {\n let retVal: { [key: string]: string };\n await window.OneSignalDeferred?.push((OneSignal) => {\n retVal = OneSignal.User.getTags();\n });\n return retVal;\n}\nfunction userAddEventListener(event: 'change', listener: (change: UserChangeEvent) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addEventListener(event, listener);\n });\n \n}\nfunction userRemoveEventListener(event: 'change', listener: (change: UserChangeEvent) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeEventListener(event, listener);\n });\n \n}\nfunction userSetLanguage(language: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.setLanguage(language);\n });\n \n}\n// @ts-expect-error - return non-Promise type despite needing to await OneSignalDeferred\nasync function userGetLanguage(): string {\n let retVal: string;\n await window.OneSignalDeferred?.push((OneSignal) => {\n retVal = OneSignal.User.getLanguage();\n });\n return retVal;\n}\nfunction userTrackEvent(name: string, properties?: Record<string, unknown>): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.trackEvent(name, properties);\n });\n \n}\nfunction pushSubscriptionOptIn(): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.PushSubscription.optIn()\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction pushSubscriptionOptOut(): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.PushSubscription.optOut()\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction pushSubscriptionAddEventListener(event: 'change', listener: (change: SubscriptionChangeEvent) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.PushSubscription.addEventListener(event, listener);\n });\n \n}\nfunction pushSubscriptionRemoveEventListener(event: 'change', listener: (change: SubscriptionChangeEvent) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.PushSubscription.removeEventListener(event, listener);\n });\n \n}\nfunction debugSetLogLevel(logLevel: 'trace' | 'debug' | 'info' | 'warn' | 'error'): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Debug.setLogLevel(logLevel);\n });\n \n}\nconst PushSubscriptionNamespace: IOneSignalPushSubscription = {\n\tget id(): string | null | undefined { return window.OneSignal?.User?.PushSubscription?.id; },\n\tget token(): string | null | undefined { return window.OneSignal?.User?.PushSubscription?.token; },\n\tget optedIn(): boolean | undefined { return window.OneSignal?.User?.PushSubscription?.optedIn; },\n\toptIn: pushSubscriptionOptIn,\n\toptOut: pushSubscriptionOptOut,\n\taddEventListener: pushSubscriptionAddEventListener,\n\tremoveEventListener: pushSubscriptionRemoveEventListener,\n};\n\nconst UserNamespace: IOneSignalUser = {\n\tget onesignalId(): string | undefined { return window.OneSignal?.User?.onesignalId; },\n\tget externalId(): string | undefined { return window.OneSignal?.User?.externalId; },\n\taddAlias: userAddAlias,\n\taddAliases: userAddAliases,\n\tremoveAlias: userRemoveAlias,\n\tremoveAliases: userRemoveAliases,\n\taddEmail: userAddEmail,\n\tremoveEmail: userRemoveEmail,\n\taddSms: userAddSms,\n\tremoveSms: userRemoveSms,\n\taddTag: userAddTag,\n\taddTags: userAddTags,\n\tremoveTag: userRemoveTag,\n\tremoveTags: userRemoveTags,\n\tgetTags: userGetTags,\n\taddEventListener: userAddEventListener,\n\tremoveEventListener: userRemoveEventListener,\n\tsetLanguage: userSetLanguage,\n\tgetLanguage: userGetLanguage,\n\ttrackEvent: userTrackEvent,\n\tPushSubscription: PushSubscriptionNamespace,\n};\n\nconst SessionNamespace: IOneSignalSession = {\n\tsendOutcome: sessionSendOutcome,\n\tsendUniqueOutcome: sessionSendUniqueOutcome,\n};\n\nconst DebugNamespace: IOneSignalDebug = {\n\tsetLogLevel: debugSetLogLevel,\n};\n\nconst SlidedownNamespace: IOneSignalSlidedown = {\n\tpromptPush: slidedownPromptPush,\n\tpromptPushCategories: slidedownPromptPushCategories,\n\tpromptSms: slidedownPromptSms,\n\tpromptEmail: slidedownPromptEmail,\n\tpromptSmsAndEmail: slidedownPromptSmsAndEmail,\n\taddEventListener: slidedownAddEventListener,\n\tremoveEventListener: slidedownRemoveEventListener,\n};\n\nconst NotificationsNamespace: IOneSignalNotifications = {\n\tget permissionNative(): NotificationPermission { return window.OneSignal?.Notifications?.permissionNative ?? 'default'; },\n\tget permission(): boolean { return window.OneSignal?.Notifications?.permission ?? false; },\n\tsetDefaultUrl: notificationsSetDefaultUrl,\n\tsetDefaultTitle: notificationsSetDefaultTitle,\n\tisPushSupported,\n\trequestPermission: notificationsRequestPermission,\n\taddEventListener: notificationsAddEventListener,\n\tremoveEventListener: notificationsRemoveEventListener,\n};\n\nconst OneSignalNamespace: IOneSignalOneSignal = {\n\tlogin: oneSignalLogin,\n\tlogout: oneSignalLogout,\n\tinit,\n\tsetConsentGiven: oneSignalSetConsentGiven,\n\tsetConsentRequired: oneSignalSetConsentRequired,\n\tSlidedown: SlidedownNamespace,\n\tNotifications: NotificationsNamespace,\n\tSession: SessionNamespace,\n\tUser: UserNamespace,\n\tDebug: DebugNamespace,\n};\n\nconst OneSignal = OneSignalNamespace;\nexport default OneSignal;\n"],"names":["ONESIGNAL_SDK_ID","DEFAULT_SCRIPT_SRC","isOneSignalInitialized","isOneSignalScriptFailed","handleOnError","addSDKScript","scriptSrc","script","isPushNotificationsSupported","supportsVapidPush","supportsSafariPush","isMacOSSafariInIframe","isPushSupported","init","options","_a","resolve","reject","OneSignal","oneSignalLogin","externalId","jwtToken","error","oneSignalLogout","oneSignalSetConsentGiven","consent","oneSignalSetConsentRequired","requiresConsent","slidedownPromptPush","slidedownPromptPushCategories","slidedownPromptSms","slidedownPromptEmail","slidedownPromptSmsAndEmail","slidedownAddEventListener","event","listener","slidedownRemoveEventListener","notificationsSetDefaultUrl","url","notificationsSetDefaultTitle","title","notificationsRequestPermission","result","notificationsAddEventListener","notificationsRemoveEventListener","sessionSendOutcome","outcomeName","outcomeWeight","sessionSendUniqueOutcome","userAddAlias","label","id","userAddAliases","aliases","userRemoveAlias","userRemoveAliases","labels","userAddEmail","email","userRemoveEmail","userAddSms","smsNumber","userRemoveSms","userAddTag","key","value","userAddTags","tags","userRemoveTag","userRemoveTags","keys","userGetTags","retVal","userAddEventListener","userRemoveEventListener","userSetLanguage","language","userGetLanguage","userTrackEvent","name","properties","pushSubscriptionOptIn","pushSubscriptionOptOut","pushSubscriptionAddEventListener","pushSubscriptionRemoveEventListener","debugSetLogLevel","logLevel","PushSubscriptionNamespace","_c","_b","UserNamespace","SessionNamespace","DebugNamespace","SlidedownNamespace","NotificationsNamespace","OneSignalNamespace"],"mappings":"aAAA,MAAMA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EAClB,oBAAqBG,CACtB,EAEM0D,GAAkD,CACvD,IAAI,kBAA2C,SAAS,QAAAL,GAAA1E,EAAA,OAAO,YAAP,YAAAA,EAAkB,gBAAlB,YAAA0E,EAAiC,mBAAoB,SAAW,EACxH,IAAI,YAAsB,SAAS,QAAAA,GAAA1E,EAAA,OAAO,YAAP,YAAAA,EAAkB,gBAAlB,YAAA0E,EAAiC,aAAc,EAAO,EACzF,cAAepD,EACf,gBAAiBE,EACjB,gBAAA3B,EACA,kBAAmB6B,EACnB,iBAAkBE,EAClB,oBAAqBC,CACtB,EAEMmD,GAA0C,CAC/C,MAAO5E,EACP,OAAQI,EACR,KAAAV,EACA,gBAAiBW,EACjB,mBAAoBE,EACpB,UAAWmE,GACX,cAAeC,GACf,QAASH,GACT,KAAMD,GACN,MAAOE,EACR,EAEM1E,GAAY6E"}
declare global {
interface Window {
OneSignalDeferred?: OneSignalDeferredLoadedCallback[];
OneSignal?: IOneSignalOneSignal;
safari?: {
pushNotification: any;
};
}
}
export interface AutoPromptOptions {
force?: boolean;
forceSlidedownOverNative?: boolean;
slidedownPromptOptions?: IOneSignalAutoPromptOptions;
}
export interface IOneSignalAutoPromptOptions {
force?: boolean;
forceSlidedownOverNative?: boolean;
isInUpdateMode?: boolean;
categoryOptions?: IOneSignalCategories;
}
export interface IOneSignalCategories {
positiveUpdateButton: string;
negativeUpdateButton: string;
savingButtonText: string;
errorButtonText: string;
updateMessage: string;
tags: IOneSignalTagCategory[];
}
export interface IOneSignalTagCategory {
tag: string;
label: string;
checked?: boolean;
}
export type PushSubscriptionNamespaceProperties = {
id: string | null | undefined;
token: string | null | undefined;
optedIn: boolean;
};
export type SubscriptionChangeEvent = {
previous: PushSubscriptionNamespaceProperties;
current: PushSubscriptionNamespaceProperties;
};
export type NotificationEventName = 'click' | 'foregroundWillDisplay' | 'dismiss' | 'permissionChange' | 'permissionPromptDisplay';
export type SlidedownEventName = 'slidedownAllowClick' | 'slidedownCancelClick' | 'slidedownClosed' | 'slidedownQueued' | 'slidedownShown';
export type OneSignalDeferredLoadedCallback = (onesignal: IOneSignalOneSignal) => void;
export interface IOSNotification {
/**
* The OneSignal notification id;
* - Primary id on OneSignal's REST API and dashboard
*/
readonly notificationId: string;
/**
* Visible title text on the notification
*/
readonly title?: string;
/**
* Visible body text on the notification
*/
readonly body: string;
/**
* Visible icon the notification; URL format
*/
readonly icon?: string;
/**
* Visible small badgeIcon that displays on some devices; URL format
* Example: On Android's status bar
*/
readonly badgeIcon?: string;
/**
* Visible image on the notification; URL format
*/
readonly image?: string;
/**
* Visible buttons on the notification
*/
readonly actionButtons?: IOSNotificationActionButton[];
/**
* If this value is the same as existing notification, it will replace it
* Can be set when creating the notification with "Web Push Topic" on the dashboard
* or web_push_topic from the REST API.
*/
readonly topic?: string;
/**
* Custom object that was sent with the notification;
* definable when creating the notification from the OneSignal REST API or dashboard
*/
readonly additionalData?: object;
/**
* URL to open when clicking or tapping on the notification
*/
readonly launchURL?: string;
/**
* Confirm the push was received by reporting back to OneSignal
*/
readonly confirmDelivery: boolean;
}
export interface IOSNotificationActionButton {
/**
* Any unique identifier to represent which button was clicked. This is typically passed back to the service worker
* and host page through events to identify which button was clicked.
* e.g. 'like-button'
*/
readonly actionId: string;
/**
* The notification action button's text.
*/
readonly text: string;
/**
* A valid publicly reachable HTTPS URL to an image.
*/
readonly icon?: string;
/**
* The URL to open the web browser to when this action button is clicked.
*/
readonly launchURL?: string;
}
export interface IDisplayableOSNotification extends IOSNotification {
display(): void;
}
export interface NotificationClickResult {
readonly actionId?: string;
readonly url?: string;
}
export type NotificationEventTypeMap = {
'click': NotificationClickEvent;
'foregroundWillDisplay': NotificationForegroundWillDisplayEvent;
'dismiss': NotificationDismissEvent;
'permissionChange': boolean;
'permissionPromptDisplay': void;
};
export interface NotificationForegroundWillDisplayEvent {
readonly notification: IDisplayableOSNotification;
preventDefault(): void;
}
export interface NotificationDismissEvent {
notification: IOSNotification;
}
export interface NotificationClickEvent {
readonly notification: IOSNotification;
readonly result: NotificationClickResult;
}
export type UserChangeEvent = {
current: UserNamespaceProperties;
};
export type UserNamespaceProperties = {
onesignalId: string | undefined;
externalId: string | undefined;
};
export interface IInitObject {
appId: string;
requiresUserPrivacyConsent?: boolean;
safari_web_id?: string;
subdomainName?: string;
promptOptions?: {
slidedown: {
prompts: {
/**
* Whether to automatically display the prompt.
* `true` will display the prompt based on the delay options.
* `false` will prevent the prompt from displaying until the Slidedowns methods are used.
*/
autoPrompt: boolean;
/**
* Only available for type: category. Up to 10 categories.
* @example
* categories: [{ tag: 'local_news', label: 'Local News' }] // The user will be tagged with local_news but will see "Local News" in the prompt.
*/
categories?: {
/** Should identify the action. */
tag: string;
/** What the user will see. */
label: string;
}[];
/**
* The delay options for the prompt.
* @example delay: { pageViews: 3, timeDelay: 20 } // The user will not be shown the prompt until 20 seconds after the 3rd page view.
*/
delay: {
/** The number of pages a user needs to visit before the prompt is displayed. */
pageViews?: number;
/** The number of seconds a user needs to wait before the prompt is displayed.Both options must be satisfied for the prompt to display */
timeDelay?: number;
};
/**
* The text to display in the prompt.
*/
text?: {
/** The callout asking the user to opt-in. Up to 90 characters. */
actionMessage?: string;
/** Triggers the opt-in. Up to 15 characters. */
acceptButton?: string;
/** Cancels opt-in. Up to 15 characters. */
cancelButton?: string;
/** The message of the confirmation prompt displayed after the email and/or phone number is provided. Up to 90 characters. */
confirmMessage?: string;
/** Identifies the email text field. Up to 15 characters. */
emailLabel?: string;
/** Cancels the category update. Up to 15 characters. */
negativeUpdateButton?: string;
/** Saves the updated category tags. Up to 15 characters. */
positiveUpdateButton?: string;
/** Identifies the phone number text field. Up to 15 characters. */
smsLabel?: string;
/** A different message shown to subscribers presented the prompt again to update categories. Up to 90 characters. */
updateMessage?: string;
};
/**
* The type of prompt to display.
* `push` which is the Slide Prompt without categories.
* `category` which is the Slide Prompt with categories.
* `sms` only asks for phone number.
* `email` only asks for email address.
* `smsAndEmail` asks for both phone number and email address.
*/
type: 'push' | 'category' | 'sms' | 'email' | 'smsAndEmail';
}[];
};
};
welcomeNotification?: {
/**
* Disables sending a welcome notification to new site visitors. If you want to disable welcome notifications, this is the only option you need.
* @deprecated Use 'disable' instead. This will be removed in a future version.
*/
disabled?: boolean;
/**
* Disables sending a welcome notification to new site visitors. If you want to disable welcome notifications, this is the only option you need.
*/
disable?: boolean;
/**
* The welcome notification's message. You can localize this to your own language.
* If left blank or set to blank, the default of 'Thanks for subscribing!' will be used.
*/
message: string;
/**
* The welcome notification's title. You can localize this to your own language. If not set, or left blank, the site's title will be used.
* Set to one space ' ' to clear the title, although this is not recommended.
*/
title?: string;
/**
* By default, clicking the welcome notification does not open any link.
* This is recommended because the user has just visited your site and subscribed.
*/
url?: string;
};
/**
* Will enable customization of the notify/subscription bell button.
*/
notifyButton?: {
/**
* A function you define that returns true to show the Subscription Bell, or false to hide it.
* Typically used the hide the Subscription Bell after the user is subscribed.
* This function is not re-evaluated on every state change; this function is only evaluated once when the Subscription Bell begins to show.
*/
displayPredicate?: () => boolean | Promise<boolean>;
/**
* Enable the Subscription Bell. The Subscription Bell is otherwise disabled by default.
*/
enable?: boolean;
/** Specify CSS-valid pixel offsets using bottom, left, and right. */
offset?: {
bottom: string;
left: string;
right: string;
};
/**
* If `true`, the Subscription Bell will display an icon that there is 1 unread message.
* When hovering over the Subscription Bell, the user will see custom text set by message.prenotify.
*/
prenotify: boolean;
/** Either `bottom-left` or `bottom-right`. The Subscription Bell will be fixed at this location on your page. */
position?: 'bottom-left' | 'bottom-right';
/** Set `false` to hide the 'Powered by OneSignal' text in the Subscription Bell dialog popup. */
showCredit: boolean;
/**
* The Subscription Bell will initially appear at one of these sizes, and then shrink down to size `small` after the user subscribes.
*/
size?: 'small' | 'medium' | 'large';
/** Customize the Subscription Bell text. */
text: {
'dialog.blocked.message': string;
'dialog.blocked.title': string;
'dialog.main.button.subscribe': string;
'dialog.main.button.unsubscribe': string;
'dialog.main.title': string;
'message.action.resubscribed': string;
'message.action.subscribed': string;
'message.action.subscribing': string;
'message.action.unsubscribed': string;
'message.prenotify': string;
'tip.state.blocked': string;
'tip.state.subscribed': string;
'tip.state.unsubscribed': string;
};
};
persistNotification?: boolean;
webhooks?: {
/**
* Enable this setting only if your server has CORS enabled and supports non-simple CORS requests.
* If this setting is disabled, your webhook will not need CORS to receive data, but it will not receive the custom headers.
* The simplest option is to leave it disabled.
* @default false
*/
cors: boolean;
/**
* This event occurs after a notification is clicked.
* @example https://site.com/hook
*/
'notification.clicked'?: string;
/**
* This event occurs after a notification is intentionally dismissed by the user (clicking the notification body or one of the notification action buttons does not trigger the dismissed webhook),
* after a group of notifications are all dismissed (with this notification as part of that group), or after a notification expires on its own time and disappears. This event is supported on Chrome only.
* @example https://site.com/hook
*/
'notification.dismissed'?: string;
/**
* This event occurs after a notification is displayed.
* @example https://site.com/hook
*/
'notification.willDisplay'?: string;
};
autoResubscribe?: boolean;
autoRegister?: boolean;
notificationClickHandlerMatch?: 'exact' | 'origin';
notificationClickHandlerAction?: 'navigate' | 'focus';
path?: string;
serviceWorkerParam?: {
scope: string;
};
serviceWorkerPath?: string;
serviceWorkerOverrideForTypical?: boolean;
/**
* Overrides the default OneSignal SDK script URL.
* Use this to self-host the SDK script on your own domain, e.g. to comply
* with strict Cross-Origin-Embedder-Policy (COEP) or Content-Security-Policy (CSP) headers.
* @default 'https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.page.js'
*/
scriptSrc?: string;
[key: string]: unknown;
}
export interface IOneSignalOneSignal {
Slidedown: IOneSignalSlidedown;
Notifications: IOneSignalNotifications;
Session: IOneSignalSession;
User: IOneSignalUser;
Debug: IOneSignalDebug;
login(externalId: string, jwtToken?: string): Promise<void>;
logout(): Promise<void>;
init(options: IInitObject): Promise<void>;
setConsentGiven(consent: boolean): Promise<void>;
setConsentRequired(requiresConsent: boolean): Promise<void>;
}
export interface IOneSignalNotifications {
permissionNative: NotificationPermission;
permission: boolean;
setDefaultUrl(url: string): Promise<void>;
setDefaultTitle(title: string): Promise<void>;
isPushSupported(): boolean;
requestPermission(): Promise<boolean>;
addEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void;
removeEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void;
}
export interface IOneSignalSlidedown {
promptPush(options?: AutoPromptOptions): Promise<void>;
promptPushCategories(options?: AutoPromptOptions): Promise<void>;
promptSms(options?: AutoPromptOptions): Promise<void>;
promptEmail(options?: AutoPromptOptions): Promise<void>;
promptSmsAndEmail(options?: AutoPromptOptions): Promise<void>;
addEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void;
removeEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void;
}
export interface IOneSignalDebug {
setLogLevel(logLevel: 'trace' | 'debug' | 'info' | 'warn' | 'error'): void;
}
export interface IOneSignalSession {
sendOutcome(outcomeName: string, outcomeWeight?: number): Promise<void>;
sendUniqueOutcome(outcomeName: string): Promise<void>;
}
export interface IOneSignalUser {
onesignalId: string | undefined;
externalId: string | undefined;
PushSubscription: IOneSignalPushSubscription;
addAlias(label: string, id: string): void;
addAliases(aliases: {
[key: string]: string;
}): void;
removeAlias(label: string): void;
removeAliases(labels: string[]): void;
addEmail(email: string): void;
removeEmail(email: string): void;
addSms(smsNumber: string): void;
removeSms(smsNumber: string): void;
addTag(key: string, value: string): void;
addTags(tags: {
[key: string]: string;
}): void;
removeTag(key: string): void;
removeTags(keys: string[]): void;
getTags(): {
[key: string]: string;
};
addEventListener(event: 'change', listener: (change: UserChangeEvent) => void): void;
removeEventListener(event: 'change', listener: (change: UserChangeEvent) => void): void;
setLanguage(language: string): void;
getLanguage(): string;
trackEvent(name: string, properties?: Record<string, unknown>): void;
}
export interface IOneSignalPushSubscription {
id: string | null | undefined;
token: string | null | undefined;
optedIn: boolean | undefined;
optIn(): Promise<void>;
optOut(): Promise<void>;
addEventListener(event: 'change', listener: (change: SubscriptionChangeEvent) => void): void;
removeEventListener(event: 'change', listener: (change: SubscriptionChangeEvent) => void): void;
}
declare const OneSignal: IOneSignalOneSignal;
export default OneSignal;
const d = "onesignal-sdk", l = "https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.page.js";
let u = !1, s = !1;
typeof window < "u" && (window.OneSignalDeferred = window.OneSignalDeferred || []);
function f() {
s = !0;
}
function c(i) {
if (document.getElementById(d))
return;
const e = document.createElement("script");
e.id = d, e.defer = !0, e.src = i || l, e.onerror = () => {
f();
}, document.head.appendChild(e);
}
function w() {
return g() || S();
}
function p() {
return window.top !== window && // isContextIframe
navigator.vendor === "Apple Computer, Inc." && // isSafari
navigator.platform === "MacIntel";
}
function S() {
return window.safari && typeof window.safari.pushNotification < "u" || p();
}
function g() {
return typeof PushSubscriptionOptions < "u" && PushSubscriptionOptions.prototype.hasOwnProperty("applicationServerKey");
}
const m = () => w(), h = (i) => {
var e;
return u ? Promise.reject("OneSignal is already initialized.") : !i || !i.appId ? Promise.reject("You need to provide your OneSignal appId.") : document ? (((e = i.welcomeNotification) == null ? void 0 : e.disabled) !== void 0 && (i.welcomeNotification.disable = i.welcomeNotification.disabled), c(i.scriptSrc), new Promise((n, r) => {
var t;
(t = window.OneSignalDeferred) == null || t.push((o) => {
o.init(i).then(() => {
u = !0, n();
}).catch(r);
});
})) : Promise.reject("Document is not defined.");
};
function O(i, e) {
return new Promise((n, r) => {
var t;
if (s) {
r(new Error("OneSignal script failed to load."));
return;
}
(t = window.OneSignalDeferred) == null || t.push((o) => {
o.login(i, e).then(() => n()).catch((a) => r(a));
});
});
}
function v() {
return new Promise((i, e) => {
var n;
if (s) {
e(new Error("OneSignal script failed to load."));
return;
}
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.logout().then(() => i()).catch((t) => e(t));
});
});
}
function E(i) {
return new Promise((e, n) => {
var r;
if (s) {
n(new Error("OneSignal script failed to load."));
return;
}
(r = window.OneSignalDeferred) == null || r.push((t) => {
t.setConsentGiven(i).then(() => e()).catch((o) => n(o));
});
});
}
function D(i) {
return new Promise((e, n) => {
var r;
if (s) {
n(new Error("OneSignal script failed to load."));
return;
}
(r = window.OneSignalDeferred) == null || r.push((t) => {
t.setConsentRequired(i).then(() => e()).catch((o) => n(o));
});
});
}
function P(i) {
return new Promise((e, n) => {
var r;
if (s) {
n(new Error("OneSignal script failed to load."));
return;
}
(r = window.OneSignalDeferred) == null || r.push((t) => {
t.Slidedown.promptPush(i).then(() => e()).catch((o) => n(o));
});
});
}
function L(i) {
return new Promise((e, n) => {
var r;
if (s) {
n(new Error("OneSignal script failed to load."));
return;
}
(r = window.OneSignalDeferred) == null || r.push((t) => {
t.Slidedown.promptPushCategories(i).then(() => e()).catch((o) => n(o));
});
});
}
function U(i) {
return new Promise((e, n) => {
var r;
if (s) {
n(new Error("OneSignal script failed to load."));
return;
}
(r = window.OneSignalDeferred) == null || r.push((t) => {
t.Slidedown.promptSms(i).then(() => e()).catch((o) => n(o));
});
});
}
function A(i) {
return new Promise((e, n) => {
var r;
if (s) {
n(new Error("OneSignal script failed to load."));
return;
}
(r = window.OneSignalDeferred) == null || r.push((t) => {
t.Slidedown.promptEmail(i).then(() => e()).catch((o) => n(o));
});
});
}
function N(i) {
return new Promise((e, n) => {
var r;
if (s) {
n(new Error("OneSignal script failed to load."));
return;
}
(r = window.OneSignalDeferred) == null || r.push((t) => {
t.Slidedown.promptSmsAndEmail(i).then(() => e()).catch((o) => n(o));
});
});
}
function b(i, e) {
var n;
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.Slidedown.addEventListener(i, e);
});
}
function T(i, e) {
var n;
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.Slidedown.removeEventListener(i, e);
});
}
function I(i) {
return new Promise((e, n) => {
var r;
if (s) {
n(new Error("OneSignal script failed to load."));
return;
}
(r = window.OneSignalDeferred) == null || r.push((t) => {
t.Notifications.setDefaultUrl(i).then(() => e()).catch((o) => n(o));
});
});
}
function R(i) {
return new Promise((e, n) => {
var r;
if (s) {
n(new Error("OneSignal script failed to load."));
return;
}
(r = window.OneSignalDeferred) == null || r.push((t) => {
t.Notifications.setDefaultTitle(i).then(() => e()).catch((o) => n(o));
});
});
}
function C() {
return new Promise((i, e) => {
var n;
if (s) {
e(new Error("OneSignal script failed to load."));
return;
}
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.Notifications.requestPermission().then((t) => i(t)).catch((t) => e(t));
});
});
}
function y(i, e) {
var n;
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.Notifications.addEventListener(i, e);
});
}
function q(i, e) {
var n;
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.Notifications.removeEventListener(i, e);
});
}
function k(i, e) {
return new Promise((n, r) => {
var t;
if (s) {
r(new Error("OneSignal script failed to load."));
return;
}
(t = window.OneSignalDeferred) == null || t.push((o) => {
o.Session.sendOutcome(i, e).then(() => n()).catch((a) => r(a));
});
});
}
function G(i) {
return new Promise((e, n) => {
var r;
if (s) {
n(new Error("OneSignal script failed to load."));
return;
}
(r = window.OneSignalDeferred) == null || r.push((t) => {
t.Session.sendUniqueOutcome(i).then(() => e()).catch((o) => n(o));
});
});
}
function K(i, e) {
var n;
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.User.addAlias(i, e);
});
}
function _(i) {
var e;
(e = window.OneSignalDeferred) == null || e.push((n) => {
n.User.addAliases(i);
});
}
function x(i) {
var e;
(e = window.OneSignalDeferred) == null || e.push((n) => {
n.User.removeAlias(i);
});
}
function V(i) {
var e;
(e = window.OneSignalDeferred) == null || e.push((n) => {
n.User.removeAliases(i);
});
}
function z(i) {
var e;
(e = window.OneSignalDeferred) == null || e.push((n) => {
n.User.addEmail(i);
});
}
function F(i) {
var e;
(e = window.OneSignalDeferred) == null || e.push((n) => {
n.User.removeEmail(i);
});
}
function M(i) {
var e;
(e = window.OneSignalDeferred) == null || e.push((n) => {
n.User.addSms(i);
});
}
function B(i) {
var e;
(e = window.OneSignalDeferred) == null || e.push((n) => {
n.User.removeSms(i);
});
}
function Y(i, e) {
var n;
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.User.addTag(i, e);
});
}
function H(i) {
var e;
(e = window.OneSignalDeferred) == null || e.push((n) => {
n.User.addTags(i);
});
}
function J(i) {
var e;
(e = window.OneSignalDeferred) == null || e.push((n) => {
n.User.removeTag(i);
});
}
function Q(i) {
var e;
(e = window.OneSignalDeferred) == null || e.push((n) => {
n.User.removeTags(i);
});
}
async function W() {
var e;
let i;
return await ((e = window.OneSignalDeferred) == null ? void 0 : e.push((n) => {
i = n.User.getTags();
})), i;
}
function X(i, e) {
var n;
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.User.addEventListener(i, e);
});
}
function Z(i, e) {
var n;
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.User.removeEventListener(i, e);
});
}
function $(i) {
var e;
(e = window.OneSignalDeferred) == null || e.push((n) => {
n.User.setLanguage(i);
});
}
async function j() {
var e;
let i;
return await ((e = window.OneSignalDeferred) == null ? void 0 : e.push((n) => {
i = n.User.getLanguage();
})), i;
}
function ee(i, e) {
var n;
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.User.trackEvent(i, e);
});
}
function ne() {
return new Promise((i, e) => {
var n;
if (s) {
e(new Error("OneSignal script failed to load."));
return;
}
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.User.PushSubscription.optIn().then(() => i()).catch((t) => e(t));
});
});
}
function ie() {
return new Promise((i, e) => {
var n;
if (s) {
e(new Error("OneSignal script failed to load."));
return;
}
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.User.PushSubscription.optOut().then(() => i()).catch((t) => e(t));
});
});
}
function re(i, e) {
var n;
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.User.PushSubscription.addEventListener(i, e);
});
}
function te(i, e) {
var n;
(n = window.OneSignalDeferred) == null || n.push((r) => {
r.User.PushSubscription.removeEventListener(i, e);
});
}
function oe(i) {
var e;
(e = window.OneSignalDeferred) == null || e.push((n) => {
n.Debug.setLogLevel(i);
});
}
const se = {
get id() {
var i, e, n;
return (n = (e = (i = window.OneSignal) == null ? void 0 : i.User) == null ? void 0 : e.PushSubscription) == null ? void 0 : n.id;
},
get token() {
var i, e, n;
return (n = (e = (i = window.OneSignal) == null ? void 0 : i.User) == null ? void 0 : e.PushSubscription) == null ? void 0 : n.token;
},
get optedIn() {
var i, e, n;
return (n = (e = (i = window.OneSignal) == null ? void 0 : i.User) == null ? void 0 : e.PushSubscription) == null ? void 0 : n.optedIn;
},
optIn: ne,
optOut: ie,
addEventListener: re,
removeEventListener: te
}, ae = {
get onesignalId() {
var i, e;
return (e = (i = window.OneSignal) == null ? void 0 : i.User) == null ? void 0 : e.onesignalId;
},
get externalId() {
var i, e;
return (e = (i = window.OneSignal) == null ? void 0 : i.User) == null ? void 0 : e.externalId;
},
addAlias: K,
addAliases: _,
removeAlias: x,
removeAliases: V,
addEmail: z,
removeEmail: F,
addSms: M,
removeSms: B,
addTag: Y,
addTags: H,
removeTag: J,
removeTags: Q,
getTags: W,
addEventListener: X,
removeEventListener: Z,
setLanguage: $,
getLanguage: j,
trackEvent: ee,
PushSubscription: se
}, de = {
sendOutcome: k,
sendUniqueOutcome: G
}, ue = {
setLogLevel: oe
}, le = {
promptPush: P,
promptPushCategories: L,
promptSms: U,
promptEmail: A,
promptSmsAndEmail: N,
addEventListener: b,
removeEventListener: T
}, fe = {
get permissionNative() {
var i, e;
return ((e = (i = window.OneSignal) == null ? void 0 : i.Notifications) == null ? void 0 : e.permissionNative) ?? "default";
},
get permission() {
var i, e;
return ((e = (i = window.OneSignal) == null ? void 0 : i.Notifications) == null ? void 0 : e.permission) ?? !1;
},
setDefaultUrl: I,
setDefaultTitle: R,
isPushSupported: m,
requestPermission: C,
addEventListener: y,
removeEventListener: q
}, ce = {
login: O,
logout: v,
init: h,
setConsentGiven: E,
setConsentRequired: D,
Slidedown: le,
Notifications: fe,
Session: de,
User: ae,
Debug: ue
}, we = ce;
export {
we as default
};
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../index.ts"],"sourcesContent":["const ONESIGNAL_SDK_ID = 'onesignal-sdk';\nconst DEFAULT_SCRIPT_SRC =\n 'https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.page.js';\n\nlet isOneSignalInitialized = false;\nlet isOneSignalScriptFailed = false;\n\nif (typeof window !== 'undefined') {\n window.OneSignalDeferred = window.OneSignalDeferred || [];\n}\n\ndeclare global {\n interface Window {\n OneSignalDeferred?: OneSignalDeferredLoadedCallback[];\n OneSignal?: IOneSignalOneSignal;\n safari?: {\n pushNotification: any;\n };\n }\n}\n\n/* H E L P E R S */\n\nfunction handleOnError() {\n isOneSignalScriptFailed = true;\n}\n\nfunction addSDKScript(scriptSrc?: string) {\n if (document.getElementById(ONESIGNAL_SDK_ID)) {\n return;\n }\n\n const script = document.createElement('script');\n script.id = ONESIGNAL_SDK_ID;\n script.defer = true;\n script.src = scriptSrc || DEFAULT_SCRIPT_SRC;\n\n // Always resolve whether or not the script is successfully initialized.\n // This is important for users who may block cdn.onesignal.com w/ adblock.\n script.onerror = () => {\n handleOnError();\n };\n\n document.head.appendChild(script);\n}\n\n/**\n * The following code is copied directly from the native SDK source file BrowserSupportsPush.ts\n * S T A R T\n */\n\n// Checks if the browser supports push notifications by checking if specific\n// classes and properties on them exist\nfunction isPushNotificationsSupported() {\n return supportsVapidPush() || supportsSafariPush();\n}\n\nfunction isMacOSSafariInIframe(): boolean {\n // Fallback detection for Safari on macOS in an iframe context\n return (\n window.top !== window && // isContextIframe\n navigator.vendor === 'Apple Computer, Inc.' && // isSafari\n navigator.platform === 'MacIntel'\n ); // isMacOS\n}\n\nfunction supportsSafariPush(): boolean {\n return (\n (window.safari && typeof window.safari.pushNotification !== 'undefined') ||\n isMacOSSafariInIframe()\n );\n}\n\n// Does the browser support the standard Push API\nfunction supportsVapidPush(): boolean {\n return (\n typeof PushSubscriptionOptions !== 'undefined' &&\n PushSubscriptionOptions.prototype.hasOwnProperty('applicationServerKey')\n );\n}\n/* E N D */\n\n/**\n * This is a SPECIAL FUNCTION\n * It is a hardcoded implementation copied from the upstream/native WebSDK since we want to return a boolean immediately\n * Natively, this is done via the shimloading mechanism (i.e. if the SDK loads, push is supported)\n * @PublicApi\n */\nconst isPushSupported = (): boolean => {\n return isPushNotificationsSupported();\n};\n\n/**\n * @PublicApi\n */\nconst init = (options: IInitObject): Promise<void> => {\n if (isOneSignalInitialized) {\n return Promise.reject(`OneSignal is already initialized.`);\n }\n\n if (!options || !options.appId) {\n return Promise.reject('You need to provide your OneSignal appId.');\n }\n\n if (!document) {\n return Promise.reject(`Document is not defined.`);\n }\n\n // Handle both disabled and disable keys for welcome notification\n if (options.welcomeNotification?.disabled !== undefined) {\n options.welcomeNotification.disable = options.welcomeNotification.disabled;\n }\n\n addSDKScript(options.scriptSrc);\n\n return new Promise<void>((resolve, reject) => {\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.init(options)\n .then(() => {\n isOneSignalInitialized = true;\n resolve();\n })\n .catch(reject);\n });\n });\n};\n\nexport interface AutoPromptOptions { force?: boolean; forceSlidedownOverNative?: boolean; slidedownPromptOptions?: IOneSignalAutoPromptOptions; }\nexport interface IOneSignalAutoPromptOptions { force?: boolean; forceSlidedownOverNative?: boolean; isInUpdateMode?: boolean; categoryOptions?: IOneSignalCategories; }\nexport interface IOneSignalCategories { positiveUpdateButton: string; negativeUpdateButton: string; savingButtonText: string; errorButtonText: string; updateMessage: string; tags: IOneSignalTagCategory[]; }\nexport interface IOneSignalTagCategory { tag: string; label: string; checked?: boolean; }\nexport type PushSubscriptionNamespaceProperties = { id: string | null | undefined; token: string | null | undefined; optedIn: boolean; };\nexport type SubscriptionChangeEvent = { previous: PushSubscriptionNamespaceProperties; current: PushSubscriptionNamespaceProperties; };\nexport type NotificationEventName = 'click' | 'foregroundWillDisplay' | 'dismiss' | 'permissionChange' | 'permissionPromptDisplay';\nexport type SlidedownEventName = 'slidedownAllowClick' | 'slidedownCancelClick' | 'slidedownClosed' | 'slidedownQueued' | 'slidedownShown';\nexport type OneSignalDeferredLoadedCallback = (onesignal: IOneSignalOneSignal) => void;\nexport interface IOSNotification {\n /**\n * The OneSignal notification id;\n * - Primary id on OneSignal's REST API and dashboard\n */\n readonly notificationId: string;\n\n /**\n * Visible title text on the notification\n */\n readonly title?: string;\n\n /**\n * Visible body text on the notification\n */\n readonly body: string;\n\n /**\n * Visible icon the notification; URL format\n */\n readonly icon?: string;\n\n /**\n * Visible small badgeIcon that displays on some devices; URL format\n * Example: On Android's status bar\n */\n readonly badgeIcon?: string;\n\n /**\n * Visible image on the notification; URL format\n */\n readonly image?: string;\n\n /**\n * Visible buttons on the notification\n */\n readonly actionButtons?: IOSNotificationActionButton[];\n\n /**\n * If this value is the same as existing notification, it will replace it\n * Can be set when creating the notification with \"Web Push Topic\" on the dashboard\n * or web_push_topic from the REST API.\n */\n readonly topic?: string;\n\n /**\n * Custom object that was sent with the notification;\n * definable when creating the notification from the OneSignal REST API or dashboard\n */\n readonly additionalData?: object;\n\n /**\n * URL to open when clicking or tapping on the notification\n */\n readonly launchURL?: string;\n\n /**\n * Confirm the push was received by reporting back to OneSignal\n */\n readonly confirmDelivery: boolean;\n}\n\nexport interface IOSNotificationActionButton {\n /**\n * Any unique identifier to represent which button was clicked. This is typically passed back to the service worker\n * and host page through events to identify which button was clicked.\n * e.g. 'like-button'\n */\n readonly actionId: string;\n /**\n * The notification action button's text.\n */\n readonly text: string;\n /**\n * A valid publicly reachable HTTPS URL to an image.\n */\n readonly icon?: string;\n /**\n * The URL to open the web browser to when this action button is clicked.\n */\n readonly launchURL?: string;\n}\n\nexport interface IDisplayableOSNotification extends IOSNotification {\n display(): void;\n}\n\nexport interface NotificationClickResult {\n readonly actionId?: string;\n readonly url?: string;\n}\n\nexport type NotificationEventTypeMap = {\n 'click': NotificationClickEvent;\n 'foregroundWillDisplay': NotificationForegroundWillDisplayEvent;\n 'dismiss': NotificationDismissEvent;\n 'permissionChange': boolean;\n 'permissionPromptDisplay': void;\n};\n\nexport interface NotificationForegroundWillDisplayEvent {\n readonly notification: IDisplayableOSNotification;\n preventDefault(): void;\n}\n\nexport interface NotificationDismissEvent {\n notification: IOSNotification;\n}\n\nexport interface NotificationClickEvent {\n readonly notification: IOSNotification;\n readonly result: NotificationClickResult;\n}\n\nexport type UserChangeEvent = {\n current: UserNamespaceProperties;\n};\nexport type UserNamespaceProperties = {\n onesignalId: string | undefined;\n externalId: string | undefined;\n};\n\nexport interface IInitObject {\n appId: string;\n requiresUserPrivacyConsent?: boolean;\n safari_web_id?: string;\n subdomainName?: string;\n promptOptions?: {\n slidedown: {\n prompts: {\n /**\n * Whether to automatically display the prompt.\n * `true` will display the prompt based on the delay options.\n * `false` will prevent the prompt from displaying until the Slidedowns methods are used.\n */\n autoPrompt: boolean;\n\n /**\n * Only available for type: category. Up to 10 categories.\n * @example\n * categories: [{ tag: 'local_news', label: 'Local News' }] // The user will be tagged with local_news but will see \"Local News\" in the prompt.\n */\n categories?: {\n /** Should identify the action. */\n tag: string;\n\n /** What the user will see. */\n label: string;\n }[];\n\n /**\n * The delay options for the prompt.\n * @example delay: { pageViews: 3, timeDelay: 20 } // The user will not be shown the prompt until 20 seconds after the 3rd page view.\n */\n delay: {\n /** The number of pages a user needs to visit before the prompt is displayed. */\n pageViews?: number;\n\n /** The number of seconds a user needs to wait before the prompt is displayed.Both options must be satisfied for the prompt to display */\n timeDelay?: number;\n };\n\n /**\n * The text to display in the prompt.\n */\n text?: {\n /** The callout asking the user to opt-in. Up to 90 characters. */\n actionMessage?: string;\n\n /** Triggers the opt-in. Up to 15 characters. */\n acceptButton?: string;\n\n /** Cancels opt-in. Up to 15 characters. */\n cancelButton?: string;\n\n /** The message of the confirmation prompt displayed after the email and/or phone number is provided. Up to 90 characters. */\n confirmMessage?: string;\n\n /** Identifies the email text field. Up to 15 characters. */\n emailLabel?: string;\n\n /** Cancels the category update. Up to 15 characters. */\n negativeUpdateButton?: string;\n\n /** Saves the updated category tags. Up to 15 characters. */\n positiveUpdateButton?: string;\n\n /** Identifies the phone number text field. Up to 15 characters. */\n smsLabel?: string;\n\n /** A different message shown to subscribers presented the prompt again to update categories. Up to 90 characters. */\n updateMessage?: string;\n };\n\n /**\n * The type of prompt to display.\n * `push` which is the Slide Prompt without categories.\n * `category` which is the Slide Prompt with categories.\n * `sms` only asks for phone number.\n * `email` only asks for email address.\n * `smsAndEmail` asks for both phone number and email address.\n */\n type: 'push' | 'category' | 'sms' | 'email' | 'smsAndEmail';\n }[];\n };\n };\n welcomeNotification?: {\n /**\n * Disables sending a welcome notification to new site visitors. If you want to disable welcome notifications, this is the only option you need.\n * @deprecated Use 'disable' instead. This will be removed in a future version.\n */\n disabled?: boolean;\n\n /**\n * Disables sending a welcome notification to new site visitors. If you want to disable welcome notifications, this is the only option you need.\n */\n disable?: boolean;\n\n /**\n * The welcome notification's message. You can localize this to your own language.\n * If left blank or set to blank, the default of 'Thanks for subscribing!' will be used.\n */\n message: string;\n\n /**\n * The welcome notification's title. You can localize this to your own language. If not set, or left blank, the site's title will be used.\n * Set to one space ' ' to clear the title, although this is not recommended.\n */\n title?: string;\n\n /**\n * By default, clicking the welcome notification does not open any link.\n * This is recommended because the user has just visited your site and subscribed.\n */\n url?: string;\n };\n\n /**\n * Will enable customization of the notify/subscription bell button.\n */\n notifyButton?: {\n /**\n * A function you define that returns true to show the Subscription Bell, or false to hide it.\n * Typically used the hide the Subscription Bell after the user is subscribed.\n * This function is not re-evaluated on every state change; this function is only evaluated once when the Subscription Bell begins to show.\n */\n displayPredicate?: () => boolean | Promise<boolean>;\n\n /**\n * Enable the Subscription Bell. The Subscription Bell is otherwise disabled by default.\n */\n enable?: boolean;\n\n /** Specify CSS-valid pixel offsets using bottom, left, and right. */\n offset?: { bottom: string; left: string; right: string };\n\n /**\n * If `true`, the Subscription Bell will display an icon that there is 1 unread message.\n * When hovering over the Subscription Bell, the user will see custom text set by message.prenotify.\n */\n prenotify: boolean;\n\n /** Either `bottom-left` or `bottom-right`. The Subscription Bell will be fixed at this location on your page. */\n position?: 'bottom-left' | 'bottom-right';\n\n /** Set `false` to hide the 'Powered by OneSignal' text in the Subscription Bell dialog popup. */\n showCredit: boolean;\n\n /**\n * The Subscription Bell will initially appear at one of these sizes, and then shrink down to size `small` after the user subscribes.\n */\n size?: 'small' | 'medium' | 'large';\n\n /** Customize the Subscription Bell text. */\n text: {\n 'dialog.blocked.message': string;\n 'dialog.blocked.title': string;\n 'dialog.main.button.subscribe': string;\n 'dialog.main.button.unsubscribe': string;\n 'dialog.main.title': string;\n 'message.action.resubscribed': string;\n 'message.action.subscribed': string;\n 'message.action.subscribing': string;\n 'message.action.unsubscribed': string;\n 'message.prenotify': string;\n 'tip.state.blocked': string;\n 'tip.state.subscribed': string;\n 'tip.state.unsubscribed': string;\n };\n };\n\n persistNotification?: boolean;\n webhooks?: {\n /**\n * Enable this setting only if your server has CORS enabled and supports non-simple CORS requests.\n * If this setting is disabled, your webhook will not need CORS to receive data, but it will not receive the custom headers.\n * The simplest option is to leave it disabled.\n * @default false\n */\n cors: boolean;\n\n /**\n * This event occurs after a notification is clicked.\n * @example https://site.com/hook\n */\n 'notification.clicked'?: string;\n\n /**\n * This event occurs after a notification is intentionally dismissed by the user (clicking the notification body or one of the notification action buttons does not trigger the dismissed webhook),\n * after a group of notifications are all dismissed (with this notification as part of that group), or after a notification expires on its own time and disappears. This event is supported on Chrome only.\n * @example https://site.com/hook\n */\n 'notification.dismissed'?: string;\n\n /**\n * This event occurs after a notification is displayed.\n * @example https://site.com/hook\n */\n 'notification.willDisplay'?: string;\n };\n autoResubscribe?: boolean;\n autoRegister?: boolean;\n notificationClickHandlerMatch?: 'exact' | 'origin';\n notificationClickHandlerAction?: 'navigate' | 'focus';\n path?: string;\n serviceWorkerParam?: { scope: string };\n serviceWorkerPath?: string;\n serviceWorkerOverrideForTypical?: boolean;\n /**\n * Overrides the default OneSignal SDK script URL.\n * Use this to self-host the SDK script on your own domain, e.g. to comply\n * with strict Cross-Origin-Embedder-Policy (COEP) or Content-Security-Policy (CSP) headers.\n * @default 'https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.page.js'\n */\n scriptSrc?: string;\n [key: string]: unknown;\n}\n\nexport interface IOneSignalOneSignal {\n\tSlidedown: IOneSignalSlidedown;\n\tNotifications: IOneSignalNotifications;\n\tSession: IOneSignalSession;\n\tUser: IOneSignalUser;\n\tDebug: IOneSignalDebug;\n\tlogin(externalId: string, jwtToken?: string): Promise<void>;\n\tlogout(): Promise<void>;\n\tinit(options: IInitObject): Promise<void>;\n\tsetConsentGiven(consent: boolean): Promise<void>;\n\tsetConsentRequired(requiresConsent: boolean): Promise<void>;\n}\nexport interface IOneSignalNotifications {\n\tpermissionNative: NotificationPermission;\n\tpermission: boolean;\n\tsetDefaultUrl(url: string): Promise<void>;\n\tsetDefaultTitle(title: string): Promise<void>;\n\tisPushSupported(): boolean;\n\trequestPermission(): Promise<boolean>;\n\taddEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void;\n\tremoveEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void;\n}\nexport interface IOneSignalSlidedown {\n\tpromptPush(options?: AutoPromptOptions): Promise<void>;\n\tpromptPushCategories(options?: AutoPromptOptions): Promise<void>;\n\tpromptSms(options?: AutoPromptOptions): Promise<void>;\n\tpromptEmail(options?: AutoPromptOptions): Promise<void>;\n\tpromptSmsAndEmail(options?: AutoPromptOptions): Promise<void>;\n\taddEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void;\n\tremoveEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void;\n}\nexport interface IOneSignalDebug {\n\tsetLogLevel(logLevel: 'trace' | 'debug' | 'info' | 'warn' | 'error'): void;\n}\nexport interface IOneSignalSession {\n\tsendOutcome(outcomeName: string, outcomeWeight?: number): Promise<void>;\n\tsendUniqueOutcome(outcomeName: string): Promise<void>;\n}\nexport interface IOneSignalUser {\n\tonesignalId: string | undefined;\n\texternalId: string | undefined;\n\tPushSubscription: IOneSignalPushSubscription;\n\taddAlias(label: string, id: string): void;\n\taddAliases(aliases: { [key: string]: string }): void;\n\tremoveAlias(label: string): void;\n\tremoveAliases(labels: string[]): void;\n\taddEmail(email: string): void;\n\tremoveEmail(email: string): void;\n\taddSms(smsNumber: string): void;\n\tremoveSms(smsNumber: string): void;\n\taddTag(key: string, value: string): void;\n\taddTags(tags: { [key: string]: string }): void;\n\tremoveTag(key: string): void;\n\tremoveTags(keys: string[]): void;\n\tgetTags(): { [key: string]: string };\n\taddEventListener(event: 'change', listener: (change: UserChangeEvent) => void): void;\n\tremoveEventListener(event: 'change', listener: (change: UserChangeEvent) => void): void;\n\tsetLanguage(language: string): void;\n\tgetLanguage(): string;\n\ttrackEvent(name: string, properties?: Record<string, unknown>): void;\n}\nexport interface IOneSignalPushSubscription {\n\tid: string | null | undefined;\n\ttoken: string | null | undefined;\n\toptedIn: boolean | undefined;\n\toptIn(): Promise<void>;\n\toptOut(): Promise<void>;\n\taddEventListener(event: 'change', listener: (change: SubscriptionChangeEvent) => void): void;\n\tremoveEventListener(event: 'change', listener: (change: SubscriptionChangeEvent) => void): void;\n}\nfunction oneSignalLogin(externalId: string, jwtToken?: string): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.login(externalId, jwtToken)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction oneSignalLogout(): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.logout()\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction oneSignalSetConsentGiven(consent: boolean): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.setConsentGiven(consent)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction oneSignalSetConsentRequired(requiresConsent: boolean): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.setConsentRequired(requiresConsent)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction slidedownPromptPush(options?: AutoPromptOptions): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.promptPush(options)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction slidedownPromptPushCategories(options?: AutoPromptOptions): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.promptPushCategories(options)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction slidedownPromptSms(options?: AutoPromptOptions): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.promptSms(options)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction slidedownPromptEmail(options?: AutoPromptOptions): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.promptEmail(options)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction slidedownPromptSmsAndEmail(options?: AutoPromptOptions): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.promptSmsAndEmail(options)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction slidedownAddEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.addEventListener(event, listener);\n });\n \n}\nfunction slidedownRemoveEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Slidedown.removeEventListener(event, listener);\n });\n \n}\nfunction notificationsSetDefaultUrl(url: string): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Notifications.setDefaultUrl(url)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction notificationsSetDefaultTitle(title: string): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Notifications.setDefaultTitle(title)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction notificationsRequestPermission(): Promise<boolean> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Notifications.requestPermission()\n .then(result => resolve(result))\n .catch(error => reject(error));\n });\n });\n}\nfunction notificationsAddEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Notifications.addEventListener(event, listener);\n });\n \n}\nfunction notificationsRemoveEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Notifications.removeEventListener(event, listener);\n });\n \n}\nfunction sessionSendOutcome(outcomeName: string, outcomeWeight?: number): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Session.sendOutcome(outcomeName, outcomeWeight)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction sessionSendUniqueOutcome(outcomeName: string): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Session.sendUniqueOutcome(outcomeName)\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction userAddAlias(label: string, id: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addAlias(label, id);\n });\n \n}\nfunction userAddAliases(aliases: { [key: string]: string }): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addAliases(aliases);\n });\n \n}\nfunction userRemoveAlias(label: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeAlias(label);\n });\n \n}\nfunction userRemoveAliases(labels: string[]): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeAliases(labels);\n });\n \n}\nfunction userAddEmail(email: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addEmail(email);\n });\n \n}\nfunction userRemoveEmail(email: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeEmail(email);\n });\n \n}\nfunction userAddSms(smsNumber: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addSms(smsNumber);\n });\n \n}\nfunction userRemoveSms(smsNumber: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeSms(smsNumber);\n });\n \n}\nfunction userAddTag(key: string, value: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addTag(key, value);\n });\n \n}\nfunction userAddTags(tags: { [key: string]: string }): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addTags(tags);\n });\n \n}\nfunction userRemoveTag(key: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeTag(key);\n });\n \n}\nfunction userRemoveTags(keys: string[]): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeTags(keys);\n });\n \n}\n// @ts-expect-error - return non-Promise type despite needing to await OneSignalDeferred\nasync function userGetTags(): { [key: string]: string } {\n let retVal: { [key: string]: string };\n await window.OneSignalDeferred?.push((OneSignal) => {\n retVal = OneSignal.User.getTags();\n });\n return retVal;\n}\nfunction userAddEventListener(event: 'change', listener: (change: UserChangeEvent) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.addEventListener(event, listener);\n });\n \n}\nfunction userRemoveEventListener(event: 'change', listener: (change: UserChangeEvent) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.removeEventListener(event, listener);\n });\n \n}\nfunction userSetLanguage(language: string): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.setLanguage(language);\n });\n \n}\n// @ts-expect-error - return non-Promise type despite needing to await OneSignalDeferred\nasync function userGetLanguage(): string {\n let retVal: string;\n await window.OneSignalDeferred?.push((OneSignal) => {\n retVal = OneSignal.User.getLanguage();\n });\n return retVal;\n}\nfunction userTrackEvent(name: string, properties?: Record<string, unknown>): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.trackEvent(name, properties);\n });\n \n}\nfunction pushSubscriptionOptIn(): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.PushSubscription.optIn()\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction pushSubscriptionOptOut(): Promise<void> {\n return new Promise((resolve, reject) => {\n if (isOneSignalScriptFailed) {\n reject(new Error('OneSignal script failed to load.'));\n return;\n }\n\n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.PushSubscription.optOut()\n .then(() => resolve())\n .catch(error => reject(error));\n });\n });\n}\nfunction pushSubscriptionAddEventListener(event: 'change', listener: (change: SubscriptionChangeEvent) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.PushSubscription.addEventListener(event, listener);\n });\n \n}\nfunction pushSubscriptionRemoveEventListener(event: 'change', listener: (change: SubscriptionChangeEvent) => void): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.User.PushSubscription.removeEventListener(event, listener);\n });\n \n}\nfunction debugSetLogLevel(logLevel: 'trace' | 'debug' | 'info' | 'warn' | 'error'): void {\n \n window.OneSignalDeferred?.push((OneSignal) => {\n OneSignal.Debug.setLogLevel(logLevel);\n });\n \n}\nconst PushSubscriptionNamespace: IOneSignalPushSubscription = {\n\tget id(): string | null | undefined { return window.OneSignal?.User?.PushSubscription?.id; },\n\tget token(): string | null | undefined { return window.OneSignal?.User?.PushSubscription?.token; },\n\tget optedIn(): boolean | undefined { return window.OneSignal?.User?.PushSubscription?.optedIn; },\n\toptIn: pushSubscriptionOptIn,\n\toptOut: pushSubscriptionOptOut,\n\taddEventListener: pushSubscriptionAddEventListener,\n\tremoveEventListener: pushSubscriptionRemoveEventListener,\n};\n\nconst UserNamespace: IOneSignalUser = {\n\tget onesignalId(): string | undefined { return window.OneSignal?.User?.onesignalId; },\n\tget externalId(): string | undefined { return window.OneSignal?.User?.externalId; },\n\taddAlias: userAddAlias,\n\taddAliases: userAddAliases,\n\tremoveAlias: userRemoveAlias,\n\tremoveAliases: userRemoveAliases,\n\taddEmail: userAddEmail,\n\tremoveEmail: userRemoveEmail,\n\taddSms: userAddSms,\n\tremoveSms: userRemoveSms,\n\taddTag: userAddTag,\n\taddTags: userAddTags,\n\tremoveTag: userRemoveTag,\n\tremoveTags: userRemoveTags,\n\tgetTags: userGetTags,\n\taddEventListener: userAddEventListener,\n\tremoveEventListener: userRemoveEventListener,\n\tsetLanguage: userSetLanguage,\n\tgetLanguage: userGetLanguage,\n\ttrackEvent: userTrackEvent,\n\tPushSubscription: PushSubscriptionNamespace,\n};\n\nconst SessionNamespace: IOneSignalSession = {\n\tsendOutcome: sessionSendOutcome,\n\tsendUniqueOutcome: sessionSendUniqueOutcome,\n};\n\nconst DebugNamespace: IOneSignalDebug = {\n\tsetLogLevel: debugSetLogLevel,\n};\n\nconst SlidedownNamespace: IOneSignalSlidedown = {\n\tpromptPush: slidedownPromptPush,\n\tpromptPushCategories: slidedownPromptPushCategories,\n\tpromptSms: slidedownPromptSms,\n\tpromptEmail: slidedownPromptEmail,\n\tpromptSmsAndEmail: slidedownPromptSmsAndEmail,\n\taddEventListener: slidedownAddEventListener,\n\tremoveEventListener: slidedownRemoveEventListener,\n};\n\nconst NotificationsNamespace: IOneSignalNotifications = {\n\tget permissionNative(): NotificationPermission { return window.OneSignal?.Notifications?.permissionNative ?? 'default'; },\n\tget permission(): boolean { return window.OneSignal?.Notifications?.permission ?? false; },\n\tsetDefaultUrl: notificationsSetDefaultUrl,\n\tsetDefaultTitle: notificationsSetDefaultTitle,\n\tisPushSupported,\n\trequestPermission: notificationsRequestPermission,\n\taddEventListener: notificationsAddEventListener,\n\tremoveEventListener: notificationsRemoveEventListener,\n};\n\nconst OneSignalNamespace: IOneSignalOneSignal = {\n\tlogin: oneSignalLogin,\n\tlogout: oneSignalLogout,\n\tinit,\n\tsetConsentGiven: oneSignalSetConsentGiven,\n\tsetConsentRequired: oneSignalSetConsentRequired,\n\tSlidedown: SlidedownNamespace,\n\tNotifications: NotificationsNamespace,\n\tSession: SessionNamespace,\n\tUser: UserNamespace,\n\tDebug: DebugNamespace,\n};\n\nconst OneSignal = OneSignalNamespace;\nexport default OneSignal;\n"],"names":["ONESIGNAL_SDK_ID","DEFAULT_SCRIPT_SRC","isOneSignalInitialized","isOneSignalScriptFailed","handleOnError","addSDKScript","scriptSrc","script","isPushNotificationsSupported","supportsVapidPush","supportsSafariPush","isMacOSSafariInIframe","isPushSupported","init","options","_a","resolve","reject","OneSignal","oneSignalLogin","externalId","jwtToken","error","oneSignalLogout","oneSignalSetConsentGiven","consent","oneSignalSetConsentRequired","requiresConsent","slidedownPromptPush","slidedownPromptPushCategories","slidedownPromptSms","slidedownPromptEmail","slidedownPromptSmsAndEmail","slidedownAddEventListener","event","listener","slidedownRemoveEventListener","notificationsSetDefaultUrl","url","notificationsSetDefaultTitle","title","notificationsRequestPermission","result","notificationsAddEventListener","notificationsRemoveEventListener","sessionSendOutcome","outcomeName","outcomeWeight","sessionSendUniqueOutcome","userAddAlias","label","id","userAddAliases","aliases","userRemoveAlias","userRemoveAliases","labels","userAddEmail","email","userRemoveEmail","userAddSms","smsNumber","userRemoveSms","userAddTag","key","value","userAddTags","tags","userRemoveTag","userRemoveTags","keys","userGetTags","retVal","userAddEventListener","userRemoveEventListener","userSetLanguage","language","userGetLanguage","userTrackEvent","name","properties","pushSubscriptionOptIn","pushSubscriptionOptOut","pushSubscriptionAddEventListener","pushSubscriptionRemoveEventListener","debugSetLogLevel","logLevel","PushSubscriptionNamespace","_b","_c","UserNamespace","SessionNamespace","DebugNamespace","SlidedownNamespace","NotificationsNamespace","OneSignalNamespace"],"mappings":"AAAA,MAAMA,IAAmB,iBACnBC,IACJ;AAEF,IAAIC,IAAyB,IACzBC,IAA0B;AAE1B,OAAO,SAAW,QACb,OAAA,oBAAoB,OAAO,qBAAqB,CAAC;AAe1D,SAASC,IAAgB;AACG,EAAAD,IAAA;AAC5B;AAEA,SAASE,EAAaC,GAAoB;AACpC,MAAA,SAAS,eAAeN,CAAgB;AAC1C;AAGI,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