!function(){var t=Object.create,e=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=((o,r,c)=>(c=null!=o?t(s(o)):{},((t,s,o,r)=>{if(s&&"object"==typeof s||"function"==typeof s)for(var c,l=n(s),u=0,d=l.length;us[t]).bind(null,c),enumerable:!(r=i(s,c))||r.enumerable});return t})(e(c,"default",{value:o,enumerable:!0}),o)))(((t,e)=>()=>(e||(t((e={exports:{}}).exports,e,e.exports),t=null),e.exports))((t,e)=>{e.exports=function(t,e,s){"function"==typeof e&&(s=e,e={}),e||(e={});var a,o,r=e.prefix||"__jp",c=e.name||r+i++,l=e.param||"callback",u=null!=e.timeout?e.timeout:6e4,d=encodeURIComponent,h=document.getElementsByTagName("script")[0]||document.head;function g(){a.parentNode&&a.parentNode.removeChild(a),window[c]=n,o&&clearTimeout(o)}return u&&(o=setTimeout(function(){g(),s&&s(new Error("Timeout"))},u)),window[c]=function(t){g(),s&&s(null,t)},t=(t+=(~t.indexOf("?")?"&":"?")+l+"="+d(c)).replace("?&","?"),(a=document.createElement("script")).src=t,h.parentNode.insertBefore(a,h),function(){window[c]&&g()}};var i=0;function n(){}})()),r="Push",c="ChromePush",l="Email",u="SMS",d="SafariPush",h="SafariLegacyPush",g="FirefoxPush",p="chrome",f="edge",w="safari",m="firefox",_=[{t:"Opera",i:/(?:opera|opr|opios)/i,o:/(?:opera|opr|opios)[ /](\d+(?:\.\d+)?)/i},{t:"Facebook",i:/FBAN\//i,o:/FBAV\/(\d+(?:\.\d+)?)/i},{t:"Samsung Browser",i:/samsungbrowser/i,o:/samsungbrowser[ /](\d+(?:\.\d+)?)/i},{t:"Yandex Browser",i:/yabrowser/i,o:/yabrowser[ /](\d+(?:\.\d+)?)/i},{t:"Vivaldi",i:/vivaldi/i,o:/vivaldi[ /](\d+(?:\.\d+)?)/i},{t:"UC Browser",i:/ucbrowser/i,o:/ucbrowser[ /](\d+(?:\.\d+)?)/i},{t:"Microsoft Edge",i:/edg/i,o:/edg[ /](\d+(?:\.\d+)?)/i},{t:"Firefox",i:/firefox|iceweasel|fxios/i,o:/(?:firefox|iceweasel|fxios)[ /](\d+(?:\.\d+)?)/i},{t:"Chromium",i:/chromium/i,o:/chromium[ /](\d+(?:\.\d+)?)/i},{t:"Chrome",i:/chrome|crios|crmo/i,o:/(?:chrome|crios|crmo)[ /](\d+(?:\.\d+)?)/i},{t:"Safari",i:/safari|applewebkit/i,o:/version[ /](\d+(?:\.\d+)?)/i}];function b(t){for(const e of _)if(e.i.test(t)){const i=t.match(e.o)?.[1]??"";return{name:e.t,version:i}}return{name:"Unknown",version:""}}var y=t=>!/like android/i.test(t)&&/android/i.test(t),S=t=>t.match(/(iphone|ipod|ipad)/i)?.[1]?.toLowerCase()||"";function v(t=navigator.userAgent){const e=S(t);return/tablet/i.test(t)&&!/tablet pc/i.test(t)||"ipad"===e||y(t)&&!/[^-]mobi/i.test(t)||!/nexus\s*[0-6]\s*/i.test(t)&&/nexus\s*\d+/i.test(t)}function O(t=navigator.userAgent){if(v(t))return!1;const e=S(t);return/[^-]mobi/i.test(t)||"iphone"===e||"ipod"===e||y(t)}var I={Chrome:p,Chromium:p,Firefox:m,"Microsoft Edge":f,Safari:w};function k(){return I[b(navigator.userAgent).name]||"other"}var x=()=>{const t=b(navigator.userAgent).version;if(!t)return-1;const[e,i="0"]=t.split(".");return+`${e}.${i}`};function C(){const t=k(),e=x();return t===m&&e>=72||t===w&&e>=12.1}var E="160801",P=()=>"undefined"!=typeof window,$=()=>P()&&void 0!==window.safari,T=()=>"undefined"!=typeof navigator&&"serviceWorker"in navigator,A="Browser",N=()=>{if(!P()||null==window.safari?.pushNotification)return!1;const t=OneSignal?.config?.safariWebId;if(!t)return!1;if("undefined"==typeof PushSubscriptionOptions||!PushSubscriptionOptions.prototype.hasOwnProperty("applicationServerKey"))return!0;const{permission:e,deviceToken:i}=window.safari.pushNotification.permission(t);return"granted"===e&&null!=i},M="undefined"!=typeof PushSubscriptionOptions&&PushSubscriptionOptions.prototype.hasOwnProperty("applicationServerKey"),U=({action:t,legacy:e=!1}={})=>new URL(e?"https://onesignal.com/api/v1/":"https://api.onesignal.com/"),D=()=>k()===m?g:k()===w&&M&&!N()?d:N()?h:c;function L(){return String(x())}function F(){return navigator.platform}var R="set-alias",W="delete-alias",B="set-property",j="refresh-user",z="login-user",K="create-subscription",V="update-subscription",q="delete-subscription",H="transfer-subscription",J="custom-event",G="external_id",Y="onesignal_id",Q=class extends Error{status;statusText;constructor(t,e){super("Registration of a Service Worker failed."),this.status=t,this.statusText=e}},Z=class extends Error{reason;constructor(t){let e;switch(t){case 1:e="Invalid email";break;case 0:e="Invalid sms";break;case 2:e="Invalid email & sms"}super(e),this.reason=t}},X=new Error("Missing app ID"),tt=new Error("Retry limit reached"),et=new Error("Permission blocked"),it=new Error("AppID doesn't match existing apps"),nt=new Error("Safari web platform must be enabled"),st=t=>new Error(`Channel '${t}' already exists`),at=t=>new Error(`"${t}" is empty`),ot=t=>new Error(`"${t}" is malformed`),rt=t=>new Error(`"${t}" is the wrong type`);function ct(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function lt(t,e){if(e&&e.allowNull&&null===t)return!0;if(e&&e.allowEmpty&&null==t)return!0;try{const i=new URL(t);return!e||!e.requireHttps||"https:"===i.protocol}catch{return!1}}function ut(t){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(t)}function dt(t){return new Promise(e=>setTimeout(e,t))}function ht(){return location.origin}var gt=()=>{const t=(navigator.language||"en").toLowerCase().replace(/-[a-z0-9]-.*/,"").split("-");return"zh"==t[0]?t.includes("hans")?"zh-Hans":t.includes("hant")||t.includes("hk")||t.includes("mo")||t.includes("tw")?"zh-Hant":"zh-Hans":t[0].substring(0,2)},pt=class t{static l(){try{return"trace"===window.localStorage.getItem("loglevel")?.toLowerCase()}catch{return!1}}static u(t){try{window.localStorage.setItem("loglevel",t)}catch(e){console.error(e)}}static h(t){return(...e)=>{(this.l()||"error"===t)&&console[t](...e)}}static p=t.h("debug");static m=t.h("info");static _=t.h("warn");static S=t.h("error")};function ft(t){return encodeURIComponent(t).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function wt(t,e,i){return yt("GET",t,e,i)}function mt(t,e,i){return yt("POST",t,e,i)}function _t(t,e,i){return yt("DELETE",t,e,i)}function bt(t,e,i){return yt("PATCH",t,e,i)}function yt(t,e,i,n){if(a=i,!((s=e).startsWith("apps/")||s.startsWith("sync/")?ut(s.split("/")[1]):a&&"string"==typeof a.app_id&&ut(a.app_id)))return Promise.reject(X);var s,a;const o=new Headers;if(o.append("Origin",window.location.origin),o.append("SDK-Version",`onesignal/web/${E}`),o.append("Content-Type","application/json;charset=UTF-8"),o.append("Accept","application/vnd.onesignal.v1+json"),n)for(const l of Object.keys(n))o.append(l,n[l]);const r={method:t||"NO_METHOD_SPECIFIED",headers:o,cache:"no-cache"};i&&(r.body=JSON.stringify(i));const c=e.split("/").map(ft).join("/");return St(`${U({action:e}).toString()}${c}`,r)}async function St(t,e,i=5){if(0===i)return Promise.reject(tt);try{const i=await fetch(t,e),{status:n,headers:s}=i,a=await i.json(),o=s?.get("Retry-After");return{ok:i.ok,result:a,status:n,retryAfterSeconds:o?parseInt(o):void 0}}catch(n){if(n instanceof Error&&"TypeError"===n.name)return await dt(i>3?1e4*(6-i):3e4),pt.S(`Fetch timeout ${t}, retrying...`),St(t,e,i-1);throw new Error(`Failed to execute HTTP call: ${String(n)}`)}}async function vt(t,e,i){const{appId:n,subscriptionId:s}=t;if(!ut(n))throw it;const a=s?{"OneSignal-Subscription-Id":s}:void 0;let o={};return a&&(o={...o,...a}),t.jwtHeader&&(o={...o,...t.jwtHeader}),bt(`apps/${n}/users/by/${e.label}/${e.id}`,i,o)}function Ot(t){let e="";const i=Object.keys(t);for(const n of i){const i=t[n];e+=`${encodeURIComponent(n)}=${encodeURIComponent(i)}`}return e}async function It(t){pt.m("Outcome payload:",t);try{await mt("outcomes/measure",t)}catch(e){pt.S("sendOutcome",e)}}async function kt(t){return await new Promise((e,i)=>{var n,s;n=`${U().toString()}sync/${t}/web`,s=(t,n)=>{t?i(t):n.success?e(n):i(n)},(0,o.default)(n,{prefix:"__jp",name:void 0,param:"callback",timeout:6e4},s)})}var xt={scope:"/"},Ct="OneSignalSDKWorker.js",Et="native",Pt="push",$t="category",Tt="sms",At="email",Nt="smsAndEmail",Mt={pageViews:1,timeDelay:0},Ut="We'd like to show you notifications for the latest news and updates.",Dt="Allow",Lt="Cancel",Ft="Try Again",Rt="Update your push notification subscription preferences.",Wt="Save Preferences",Bt="Cancel",jt={type:Pt,text:{actionMessage:Ut,acceptButton:Dt,cancelButton:Lt},autoPrompt:!1,delay:Mt},zt="custom";function Kt(t){const e=t.config.staticPrompts,i=e.native?{enabled:e.native.enabled,autoPrompt:e.native.enabled&&!1!==e.native.autoPrompt,pageViews:e.native.pageViews??Mt.pageViews,timeDelay:e.native.timeDelay??Mt.timeDelay}:{enabled:!1,autoPrompt:!1,pageViews:Mt.pageViews,timeDelay:Mt.timeDelay},{prompts:n}=e.slidedown;return{autoPrompt:i.autoPrompt||Vt(n),native:i,slidedown:{prompts:n},fullscreen:{enabled:e.fullscreen.enabled,actionMessage:e.fullscreen.actionMessage,acceptButton:e.fullscreen.acceptButton,cancelButton:e.fullscreen.cancelButton,title:e.fullscreen.title,message:e.fullscreen.message,caption:e.fullscreen.caption,autoAcceptTitle:e.fullscreen.autoAcceptTitle},customlink:qt(t)}}function Vt(t){if(!t)return!1;for(let e=0;e{if(t.type=t.type??Pt,t.type===$t&&(t.text={...t.text,positiveUpdateButton:t.text?.positiveUpdateButton??Wt,negativeUpdateButton:t.text?.negativeUpdateButton??Bt,updateMessage:t.text?.updateMessage??Rt}),t.text={...t.text,actionMessage:t.text?.actionMessage??Ut,acceptButton:t.text?.acceptButton??Dt,cancelButton:t.text?.cancelButton??Lt,confirmMessage:t.text?.confirmMessage??"Thank You!"},t.autoPrompt=t.autoPrompt??!0,t.delay={pageViews:t.delay?.pageViews??Mt.pageViews,timeDelay:t.delay?.timeDelay??Mt.timeDelay},t.categories){const{categories:e}=t;t.categories=structuredClone(e).slice(0,10)}return t}):(a.slidedown={prompts:[]},a.slidedown.prompts=[jt]),a.native){const t=Object.prototype.hasOwnProperty.call(a.native,"autoPrompt");a.native.autoPrompt=t?!!a.native.enabled&&!!a.native.autoPrompt:!!a.native.enabled,a.native.enabled=!!a.native.enabled,a.native.pageViews=a.native.pageViews??Mt.pageViews,a.native.timeDelay=a.native.timeDelay??Mt.timeDelay}else a.native={enabled:!1,autoPrompt:!1,pageViews:Mt.pageViews,timeDelay:Mt.timeDelay};return!0===i.autoRegister&&(a.native.enabled=!0,a.native.autoPrompt=!0),a.autoPrompt=a.native.autoPrompt||Vt(a.slidedown.prompts),a}async function Gt(t){return async function(t,e){try{if(!t||!t.appId||!ut(t.appId))throw it;const i=await e(t.appId);!function(t){var e;(e=t.promptOptions)&&["acceptButtonText","cancelButtonText","actionMessage"].some(t=>Object.prototype.hasOwnProperty.call(e,t))&&(t.promptOptions=function(t){t.slidedown||(t.slidedown={});const{slidedown:e}=t;return e.acceptButtonText=e.acceptButtonText??t.acceptButtonText??t.acceptButton,e.cancelButtonText=e.cancelButtonText??t.cancelButtonText??t.cancelButton,e.actionMessage=e.actionMessage??t.actionMessage,t}(t.promptOptions)),function(t){return!!t&&["enabled","autoPrompt","pageViews","timeDelay","acceptButton","acceptButtonText","cancelButton","cancelButtonText","actionMessage","customizeTextEnabled","categories"].some(e=>Object.prototype.hasOwnProperty.call(t,e))}(t.promptOptions?.slidedown)&&t.promptOptions?.slidedown&&(t.promptOptions.slidedown=function(t){const e=(a=t,(a?.categories?.tags?.length||0)>0),i=e?$t:Pt,{categories:n,prompts:s=[]}=t;var a;return{prompts:[...s,{type:i,autoPrompt:t.autoPrompt,text:{actionMessage:t.actionMessage,acceptButton:t.acceptButton??t.acceptButtonText,cancelButton:t.cancelButton??t.cancelButtonText,...e&&{positiveUpdateButton:n?.positiveUpdateButton,negativeUpdateButton:n?.negativeUpdateButton,updateMessage:n?.updateMessage}},delay:{pageViews:t.pageViews,timeDelay:t.timeDelay},categories:n?.tags}]}}(t.promptOptions?.slidedown))}(t);const n=function(t,e){const i=function(t){return t.config.integration?.kind??zt}(e),n=function(t,e,i){switch(Ht(t).configuration){case 0:return i.config.siteInfo.proxyOriginEnabled;case 1:return!!e.subdomainName}}(i,t,e),s=function(t,e,i){switch(Ht(t).configuration){case 0:{const{path:t,serviceWorkerPath:n,serviceWorkerParam:s}=function(t,e){const{serviceWorker:i}=e.config,n=t.serviceWorkerOverrideForTypical;return{path:n?t.path??i.path:i.path,serviceWorkerParam:n?t.serviceWorkerParam??{scope:i.registrationScope}:{scope:i.registrationScope},serviceWorkerPath:n?t.serviceWorkerPath??i.workerName:i.workerName}}(e,i);return{appId:i.app_id,autoRegister:!1,autoResubscribe:i.config.autoResubscribe,path:t,serviceWorkerPath:n,serviceWorkerParam:s,subdomainName:i.config.siteInfo.proxyOrigin,promptOptions:Kt(i),welcomeNotification:{disable:!i.config.welcomeNotification.enable,title:i.config.welcomeNotification.title,message:i.config.welcomeNotification.message,url:i.config.welcomeNotification.url},notifyButton:{enable:i.config.staticPrompts.bell.enabled,displayPredicate:i.config.staticPrompts.bell.hideWhenSubscribed?()=>!OneSignal.User.PushSubscription.optedIn:null,size:i.config.staticPrompts.bell.size,position:i.config.staticPrompts.bell.location,showCredit:!1,offset:{bottom:`${i.config.staticPrompts.bell.offset.bottom}px`,left:`${i.config.staticPrompts.bell.offset.left}px`,right:`${i.config.staticPrompts.bell.offset.right}px`},colors:{"circle.background":i.config.staticPrompts.bell.color.main,"circle.foreground":i.config.staticPrompts.bell.color.accent,"badge.background":"black","badge.foreground":"white","badge.bordercolor":"black","pulse.color":i.config.staticPrompts.bell.color.accent,"dialog.button.background.hovering":i.config.staticPrompts.bell.color.main,"dialog.button.background.active":i.config.staticPrompts.bell.color.main,"dialog.button.background":i.config.staticPrompts.bell.color.main,"dialog.button.foreground":"white"},text:{"tip.state.unsubscribed":i.config.staticPrompts.bell.tooltip.unsubscribed,"tip.state.subscribed":i.config.staticPrompts.bell.tooltip.subscribed,"tip.state.blocked":i.config.staticPrompts.bell.tooltip.blocked,"message.prenotify":i.config.staticPrompts.bell.tooltip.unsubscribed,"message.action.subscribing":i.config.staticPrompts.bell.message.subscribing,"message.action.subscribed":i.config.staticPrompts.bell.message.subscribing,"message.action.resubscribed":i.config.staticPrompts.bell.message.subscribing,"message.action.unsubscribed":i.config.staticPrompts.bell.message.unsubscribing,"dialog.main.title":i.config.staticPrompts.bell.dialog.main.title,"dialog.main.button.subscribe":i.config.staticPrompts.bell.dialog.main.subscribeButton,"dialog.main.button.unsubscribe":i.config.staticPrompts.bell.dialog.main.unsubscribeButton,"dialog.blocked.title":i.config.staticPrompts.bell.dialog.blocked.title,"dialog.blocked.message":i.config.staticPrompts.bell.dialog.blocked.message}},persistNotification:i.config.notificationBehavior?i.config.notificationBehavior.display.persist:void 0,webhooks:{cors:i.config.webhooks.corsEnable,"notification.willDisplay":i.config.webhooks.notificationDisplayedHook,"notification.clicked":i.config.webhooks.notificationClickedHook,"notification.dismissed":i.config.webhooks.notificationDismissedHook},notificationClickHandlerMatch:i.config.notificationBehavior?i.config.notificationBehavior.click.match:void 0,notificationClickHandlerAction:i.config.notificationBehavior?i.config.notificationBehavior.click.action:void 0,outcomes:{direct:i.config.outcomes.direct,indirect:{enabled:i.config.outcomes.indirect.enabled,influencedTimePeriodMin:i.config.outcomes.indirect.notification_attribution.minutes_since_displayed,influencedNotificationsLimit:i.config.outcomes.indirect.notification_attribution.limit},unattributed:i.config.outcomes.unattributed}}}case 1:{const t={...e,promptOptions:Jt(e.promptOptions,i.config.staticPrompts,e),serviceWorkerParam:e.serviceWorkerParam?e.serviceWorkerParam:xt,serviceWorkerPath:e.serviceWorkerPath?e.serviceWorkerPath:Ct,path:e.path?e.path:"/",outcomes:{direct:i.config.outcomes.direct,indirect:{enabled:i.config.outcomes.indirect.enabled,influencedTimePeriodMin:i.config.outcomes.indirect.notification_attribution.minutes_since_displayed,influencedNotificationsLimit:i.config.outcomes.indirect.notification_attribution.limit},unattributed:i.config.outcomes.unattributed}};return Object.prototype.hasOwnProperty.call(e,"autoResubscribe")?t.autoResubscribe=!!e.autoResubscribe:Object.prototype.hasOwnProperty.call(e,"autoRegister")?t.autoResubscribe=!!e.autoRegister:t.autoResubscribe=!!i.config.autoResubscribe,t}}}(i,t,e);return{appId:e.app_id,hasUnsupportedSubdomain:n,siteName:e.config.siteInfo.name,defaultIconUrl:e.config.siteInfo.defaultIconUrl,origin:e.config.origin,restrictedOriginEnabled:e.features.restrict_origin&&e.features.restrict_origin.enable,safariWebId:e.config.safari_web_id,vapidPublicKey:e.config.vapid_public_key,onesignalVapidPublicKey:e.config.onesignal_vapid_public_key,userConfig:s,enableOnSession:e.features.enable_on_session??false,sessionThreshold:e.features.session_threshold??30,enableSessionDuration:e.features.web_on_focus_enabled??true}}(t,i);return function(t){const e=!self.isSecureContext;if(t.hasUnsupportedSubdomain||e)throw e?new Error("OneSignalSDK: HTTP sites are no longer supported starting with version 16 (User Model), your public site must start with https://."):new Error('OneSignalSDK: The "My site is not fully HTTPS" option is no longer supported starting with version 16 (User Model) of the OneSignal SDK.')}(n),function(t){if(t.restrictedOriginEnabled&&!function(t){try{return location.origin===new URL(t).origin}catch{return!1}}(t.origin))throw new Error(`Can only be used on: ${new URL(t.origin).origin}`)}(n),n}catch(i){if(i instanceof Object&&"code"in i){if(1===i.code)throw it;if(2===i.code)throw new Error("App not configured for web push")}throw i}}(t,kt)}function Yt(t){return new Promise((e,i)=>{t.onsuccess=()=>e(t.result),t.onerror=()=>i(t.error)})}var Qt=!1,Zt=async(t=7)=>{const e=await function(t,e,i){return new Promise((t,n)=>{const s=indexedDB.open("ONE_SIGNAL_SDK_DB",e);s.onupgradeneeded=t=>i?.upgrade?.(s.result,t.oldVersion,t.newVersion,s.transaction),s.onsuccess=()=>{i?.terminated&&(s.result.onclose=i.terminated),t(s.result)},s.onerror=()=>n(s.error),s.onblocked=()=>i?.blocked?.()})}(0,t,{upgrade(e,i,n,s){const a=n||t;a>=1&&i<1&&(e.createObjectStore("Ids",{keyPath:"type"}),e.createObjectStore("NotificationOpened",{keyPath:"url"}),e.createObjectStore("Options",{keyPath:"key"})),a>=2&&i<2&&(e.createObjectStore("Sessions",{keyPath:"sessionKey"}),e.createObjectStore("NotificationReceived",{keyPath:"notificationId"}),e.createObjectStore("NotificationClicked",{keyPath:"notificationId"})),a>=3&&i<3&&e.createObjectStore("SentUniqueOutcome",{keyPath:"outcomeName"}),a>=4&&i<4&&(e.createObjectStore("identity",{keyPath:"modelId"}),e.createObjectStore("properties",{keyPath:"modelId"}),e.createObjectStore("pushSubscriptions",{keyPath:"modelId"}),e.createObjectStore("smsSubscriptions",{keyPath:"modelId"}),e.createObjectStore("emailSubscriptions",{keyPath:"modelId"})),a>=5&&i<5&&(async function(t,e){const i="NotificationClicked",n="Outcomes.NotificationClicked";t.createObjectStore(n,{keyPath:"notificationId"});const s=await Yt(e.objectStore(i).getAll()),a=e.objectStore(n);for(const o of s)a.put({notificationId:o.notificationId||o.notification.id,appId:o.appId,timestamp:o.timestamp});t.deleteObjectStore(i)}(e,s),async function(t,e){const i="NotificationReceived",n="Outcomes.NotificationReceived";t.createObjectStore(n,{keyPath:"notificationId"});const s=await Yt(e.objectStore(i).getAll()),a=e.objectStore(n);for(const o of s)a.put(o);t.deleteObjectStore(i)}(e,s)),a>=6&&i<6&&async function(t,e){const i="subscriptions";let n;t.createObjectStore(i,{keyPath:"modelId"});const s=await Yt(e.objectStore("identity").getAll());s.length>0&&(n=s[0].externalId);for(const a of["emailSubscriptions","pushSubscriptions","smsSubscriptions"]){const s=await Yt(e.objectStore(a).getAll()),o=e.objectStore(i);for(const t of s)o.put({...t,modelName:"subscriptions",externalId:n});t.deleteObjectStore(a)}}(e,s),a>=7&&i<7&&e.createObjectStore("operations",{keyPath:"modelId"}),Qt=!1,"undefined"!=typeof OneSignal&&(OneSignal.v=!0)},blocked(){pt.p("IndexedDB: Blocked event")},terminated(){Qt||(Qt=!0,te())}});return function(t){const e=(e,i)=>t.transaction(e,i).objectStore(e);return{get:async(t,i)=>Yt(e(t).get(i)),getAll:async t=>Yt(e(t).getAll()),put:async(t,i)=>Yt(e(t,"readwrite").put(i)),delete:async(t,i)=>Yt(e(t,"readwrite").delete(i)),clear:async t=>Yt(e(t,"readwrite").clear()),close:()=>t.close(),get objectStoreNames(){return t.objectStoreNames}}}(e)},Xt=Zt(),te=(t=7)=>Xt=Zt(t),ee=!1,ie=()=>ee;function ne(t,e,i){if(ee)return Promise.resolve(i);let n;const s=new Promise(e=>{n=setTimeout(()=>{ee=!0,pt._(`db.${t} timed out`),e(i)},1500)});return Promise.race([e(),s]).finally(()=>clearTimeout(n))}var se={async get(t,e){const i=await Xt;return ne(`get(${t})`,()=>i.get(t,e),void 0)},async getAll(t){const e=await Xt;return ne(`getAll(${t})`,()=>e.getAll(t),[])},async put(t,e){const i=await Xt;return ne(`put(${t})`,()=>i.put(t,e),void 0)},async delete(t,e){const i=await Xt;return ne(`delete(${t}/${e})`,()=>i.delete(t,e),void 0)}},ae=async t=>{const e=await se.get("Options",t);return e&&"value"in e?e.value:null},oe=async t=>{const e=await se.get("Ids",t);return e&&"id"in e?e.id:null},re=async()=>await se.get("Sessions","oneSignalSession")??null,ce="os_feature_flags",le="os_optedOut",ue="os_pageViews",de="requiresPrivacyConsent",he="userConsent";function ge(){const t=OneSignal.config?.userConfig.requiresUserPrivacyConsent??!1;return"true"===localStorage.getItem(de)||t}function pe(t){localStorage.setItem(he,t.toString())}function fe(t){localStorage.setItem(le,t.toString())}function we(){return Number(localStorage.getItem(ue))}var me=async()=>{const t=await ae("defaultUrl"),e=await ae("defaultTitle"),i=await ae("isPushEnabled"),n=await ae("lastOptedIn");return{defaultNotificationUrl:t,defaultNotificationTitle:e,lastKnownPushEnabled:i,lastKnownPushId:await ae("lastPushId")??void 0,lastKnownPushToken:await ae("lastPushToken")??void 0,lastKnownOptedIn:n}},_e=async t=>{t.defaultNotificationUrl&&await se.put("Options",{key:"defaultUrl",value:t.defaultNotificationUrl}),(t.defaultNotificationTitle||""===t.defaultNotificationTitle)&&await se.put("Options",{key:"defaultTitle",value:t.defaultNotificationTitle}),null!=t.lastKnownPushEnabled&&await se.put("Options",{key:"isPushEnabled",value:t.lastKnownPushEnabled}),null!=t.lastKnownPushId&&await se.put("Options",{key:"lastPushId",value:t.lastKnownPushId}),null!=t.lastKnownPushToken&&await se.put("Options",{key:"lastPushToken",value:t.lastKnownPushToken}),null!=t.lastKnownOptedIn&&await se.put("Options",{key:"lastOptedIn",value:t.lastKnownOptedIn})},be=()=>{const t=ge(),e=OneSignal.O,i=t&&!e;return i&&pt._("Consent required but not given"),i},ye=class t{deviceId;subscriptionToken;optedOut;createdAt;expirationTime;I(){return{deviceId:this.deviceId,subscriptionToken:this.subscriptionToken,optedOut:this.optedOut,createdAt:this.createdAt,expirationTime:this.expirationTime}}static k(e){const i=new t;return i.deviceId=e.deviceId,i.subscriptionToken=e.subscriptionToken,i.optedOut=e.optedOut,i.createdAt=e.createdAt,i.expirationTime=e.expirationTime,i}},Se=async()=>{const t=function(){const t=localStorage.getItem(le);return null===t?null:"true"===t}();if(null!==t)return t;const e=await(async()=>{const t=await ae("optedOut");if(null!=t)return t;const e=await ae("subscription");return null!=e&&!e})();return ie()?void 0:(fe(e),await se.delete("Options","optedOut"),await se.delete("Options","subscription"),e)},ve=async()=>{const t=new ye;t.deviceId=(await se.get("Ids","userId"))?.id,t.subscriptionToken=(await se.get("Ids","registrationId"))?.id,t.optedOut=await Se();const e=await ae("subscriptionCreatedAt"),i=await ae("subscriptionExpirationTime");return t.createdAt=e??null,t.expirationTime=i??null,t},Oe=async t=>{t.deviceId&&await se.put("Ids",{type:"userId",id:t.deviceId}),void 0!==t.subscriptionToken&&await se.put("Ids",{type:"registrationId",id:t.subscriptionToken}),null!=t.optedOut&&fe(t.optedOut),null!=t.createdAt&&await se.put("Options",{key:"subscriptionCreatedAt",value:t.createdAt}),null!=t.expirationTime?await se.put("Options",{key:"subscriptionExpirationTime",value:t.expirationTime}):await se.delete("Options","subscriptionExpirationTime")};async function Ie(t){try{const e=(localStorage.getItem("os_feature_overrides")??"").split(",").map(t=>t.trim()).filter(Boolean);e.length&&console.warn("OneSignal: feature flag overrides are active:",e);const i=await wt(`apps/${t}/sdk/features/web/${E}`).catch(()=>{}),n=i?.ok&&i.result?.features,s=Array.isArray(n)?n.filter(t=>"string"==typeof t):function(t){try{const e=JSON.parse(t||"[]");return Array.isArray(e)?e:[]}catch{return[]}}(localStorage.getItem(ce));void 0!==await se.put("Options",{key:"featureFlags",value:JSON.stringify([...e,...s])})&&function(t){localStorage.setItem(ce,JSON.stringify(t))}(s)}catch{}}function ke(t){if("string"==typeof t){const e=document.querySelector(t);if(!e)throw new Error(`Cannot find element with selector "${t}"`);return e}return t}function xe(t,e,i){ke(t).insertAdjacentHTML(e,i)}function Ce(t){for(const e of document.querySelectorAll(t))e.remove()}function Ee(t){return document.querySelector(t)??document.createElement("div")}function Pe(t,e){ke(t).classList.add(e)}function $e(t,e){ke(t).classList.remove(e)}function Te(t){return"undefined"==typeof DOMParser?t:(new DOMParser).parseFromString(t,"text/html").documentElement.textContent||""}function Ae(){try{return"undefined"!=typeof localStorage&&(localStorage.getItem("test"),!0)}catch{return!1}}function Ne(t){if(!Ae())return null;const e=localStorage.getItem(t);let i;try{i=JSON.parse(e)}catch{return null}if(null===i)return null;if(i.timestamp&&(new Date).getTime()>=i.timestamp)return localStorage.removeItem(t),null;let n=i.value;try{n=JSON.parse(i.value)}catch{return n}return n}var Me=0,Ue=1,De="onesignal-notification-prompt",Le="onesignal-non-push-prompt",Fe={[Me]:"promptDismissCount",[Ue]:"nonPushPromptsDismissCount"},Re={[Me]:De,[Ue]:Le};async function We(t){const e=Fe[t],i=Re[t];let n=await ae(e);n||(n=0),n+=1;let s=3;return 2==n?s=7:n>2&&(s=30),pt.p(`Prompt dismissed (${t}), reprompt in ${s}d`),await se.put("Options",{key:e,value:n}),function(t,e,i){if(!Ae())return;const n=void 0!==i?60*i*1e3:0,s={value:JSON.stringify("dismissed"),timestamp:void 0!==i?(new Date).getTime()+n:void 0};localStorage.setItem(t,JSON.stringify(s))}(i,0,24*s*60)}function Be(t){switch(t){case 0:return"dismissed"===Ne(De);case 1:return"dismissed"===Ne(Le)}return!1}async function je(){return new Promise(t=>{OneSignal.C?t():OneSignal.P.once(OneSignal.EVENTS.SDK_INITIALIZED,t)})}function ze(t,...e){return pt.p(`${t}(${e.map(t=>JSON.stringify(t)).join(", ")})`)}function Ke(t,e,i,n=!1){if(e||pt.S("on() missing event:",e),i||pt.S("on() missing task:",i),"string"==typeof t){const n=document.querySelectorAll(t);if(n.length>0)for(let t=0;t{let t;return t="https://onesignal.com",new URL("https://onesignal.com/sdks/web/v16")})();return this.D(0,new URL(`${t}/OneSignalSDK.page.styles.css?v=${E}`))}async D(e,i){return this.N[i.toString()]||(this.N[i.toString()]=t.L(e,i)),this.N[i.toString()]}static async L(t,e){try{let i;return await new Promise((n,s)=>{switch(t){case 1:i=document.createElement("script"),i.setAttribute("type","text/javascript"),i.setAttribute("async","async"),i.setAttribute("src",e.toString());break;case 0:i=document.createElement("link"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",e.toString())}i.onerror=s,i.onload=n,document.querySelector("head")?.appendChild(i)}),0}catch{return 1}}},Qe=class{F=".onesignal-bell-launcher-badge";get R(){return document.querySelector(this.F)}get W(){return this.R?.textContent??""}set W(t){const e=this.R;e&&(e.textContent=t)}get B(){return this.R?.classList.contains("onesignal-bell-launcher-badge-opened")??!1}j(){const t=this.R;t&&!this.B&&t.classList.add("onesignal-bell-launcher-badge-opened")}K(){const t=this.R;t&&this.B&&t.classList.remove("onesignal-bell-launcher-badge-opened")}V(t){const e=(Number(this.W)||0)+t;this.W=e>0?e.toString():""}q(){this.V(1)}H(){this.V(-1)}},Ze={};function Xe(t,e){return void 0===Ze[t]&&(Ze[t]=[null,null]),Ze[t].push(e),3===Ze[t].length&&Ze[t].shift(),Ze[t]}var ti=0,ei=1,ii=2,ni=3,si="message",ai=2500,oi=class{J;F=".onesignal-bell-launcher-button";constructor(t){this.J=t,this.R?.addEventListener("click",()=>this.G())}get R(){return document.querySelector(this.F)}G(){const t=this.R;t&&(t.classList.remove("pulsing"),t.offsetWidth,t.classList.add("pulsing"));const e=function(t){return void 0===Ze[t]&&(Ze[t]=[null,null]),Ze[t]}("subscription.optedOut")[1];this.J.Y&&!e&&(Vn(),this.J.Z=!0,OneSignal.P.once(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,async()=>{this.J.X=!0,await this.J.et.tt(si,this.J.it.text["message.action.subscribed"],ai),this.J.Z=!1,this.J.X=!1}))}},ri="subscribe-button",ci="unsubscribe-button",li={[p]:"/bell/chrome-unblock.jpg",[m]:"/bell/firefox-unblock.jpg",[w]:"/bell/safari-unblock.jpg",[f]:"/bell/edge-unblock.png"},ui=class{J;nt=null;F=".onesignal-bell-launcher-dialog";constructor(t){this.J=t}get R(){return document.querySelector(this.F)}get B(){return this.R?.matches(":popover-open")??!1}get st(){return this.R?.querySelector(`#${ri}`)??null}get ot(){return this.R?.querySelector(`#${ci}`)??null}K(){const t=this.R;t&&this.B&&t.hidePopover()}async rt(){const t=await OneSignal.A.lt.ct(),e=function(){const t=ke(".onesignal-bell-launcher-dialog-body");return t.replaceChildren(),t}(),i=this.J.it.text,n=this.J.ut;1===n&&t||2===n&&!t?this.dt(e,i):3===n&&this.ht(e,i),this.J.it.showCredit&&xe(e,"beforeend",'
Powered by OneSignal
'),this.st?.addEventListener("click",()=>{OneSignal.gt=!1,this.J.ft()}),this.ot?.addEventListener("click",()=>this.J.wt())}dt(t,e){const i=qe(this.nt),n="default-icon"!==i?'
':'
',s=1===this.J.ut,a=s?ci:ri,o=s?e["dialog.main.button.unsubscribe"]:e["dialog.main.button.subscribe"];xe(t,"beforeend",`

${n}
`),t.querySelector("h1").textContent=Te(e["dialog.main.title"]),t.querySelector(`#${a}`).textContent=Te(o),"default-icon"!==i&&t.querySelector(".push-notification-icon img").setAttribute("src",i)}ht(t,e){const i=k();let n="";if((O()||v())&&i===p)n="
  1. Access Settings by tapping the three menu dots ⋮
  2. Click Site settings under Advanced.
  3. Click Notifications.
  4. Find and click this entry for this website.
  5. Click Notifications and set it to Allow.
";else{const t=li[i];if(t){const e="https://media.onesignal.com/web-sdk"+t;n=`Unblock notifications`}}xe(t,"beforeend",`

${n}
`),t.querySelector("h1").textContent=Te(e["dialog.blocked.title"]),t.querySelector(".instructions p").textContent=Te(e["dialog.blocked.message"])}},di={small:32,medium:48,large:64},hi=class{J;F=".onesignal-bell-launcher";constructor(t){this.J=t}get R(){return document.querySelector(this.F)}get B(){return this.R?.classList.contains("onesignal-bell-launcher-active")??!1}j(){const t=this.R;t&&!this.B&&t.classList.add("onesignal-bell-launcher-active")}K(){const t=this.R;t&&this.B&&(this.J._t.K(),t.classList.remove("onesignal-bell-launcher-active"))}bt(t){const e=this.R;if(!e)throw new Error("Missing DOM element");const i=di[t];if(!i)throw new Error("Invalid OneSignal bell size "+t);e.style.setProperty("--bell-size",`${i}px`),e.style.setProperty("--bell-resting-scale",""+32/i),e.style.setProperty("--badge-font-size",i<=32?"8px":"12px")}},gi={[ii]:"tip.state.unsubscribed",[ei]:"tip.state.subscribed",[ni]:"tip.state.blocked",[ti]:""},pi=class{J;yt="";F=".onesignal-bell-launcher-message";constructor(t){this.J=t}get R(){return document.querySelector(this.F)}get W(){return this.R?.querySelector(".onesignal-bell-launcher-message-body")?.textContent??""}set W(t){const e=this.R?.querySelector(".onesignal-bell-launcher-message-body");e&&(e.textContent=t)}get B(){return this.R?.classList.contains("onesignal-bell-launcher-message-opened")??!1}j(){const t=this.R;t&&!this.B&&t.classList.add("onesignal-bell-launcher-message-opened")}K(){const t=this.R;t&&this.B&&t.classList.remove("onesignal-bell-launcher-message-opened")}async tt(t,e,i=0){pt.p("display:",t,e,i),this.B&&this.K(),this.W=Te(e),this.yt=t,this.j(),await dt(i),this.K(),this.W=this.St(),this.yt="tip"}St(){const t=gi[this.J.ut];return t?this.J.it.text[t]??"":""}},fi="medium",wi=["small","medium","large"],mi=["bottom-left","bottom-right"],_i=["default","inverse"],bi="Manage notifications",yi={"launcher.button.aria-label":bi,"tip.state.unsubscribed":"Subscribe to notifications","tip.state.subscribed":"You're subscribed to notifications","tip.state.blocked":"You've blocked notifications","message.prenotify":"Click to subscribe to notifications","message.action.subscribed":"Thanks for subscribing!","message.action.resubscribed":"You're subscribed to notifications","message.action.subscribing":"Click {{prompt.native.grant}} to receive notifications","message.action.unsubscribed":"You won't receive notifications again","dialog.main.title":"Manage Site Notifications","dialog.main.button.subscribe":"SUBSCRIBE","dialog.main.button.unsubscribe":"UNSUBSCRIBE","dialog.blocked.title":"Unblock Notifications","dialog.blocked.message":"Follow these instructions to allow notifications:"},Si=class{it;ut=0;Z=!1;X=!1;C=!1;vt;Ot;It;kt;xt;constructor(t,e){this.it={enable:t.enable||!1,size:t.size||fi,position:t.position||"bottom-right",theme:t.theme||"default",showLauncherAfter:t.showLauncherAfter||10,showBadgeAfter:t.showBadgeAfter||300,text:{...yi,...t.text},prenotify:t.prenotify,showCredit:t.showCredit,colors:t.colors,offset:t.offset},e&&(this.vt=e),this.it.enable&&(this.Ct(this.it),this.Et())}Ct(t){const e=(t,e,i)=>{if(!t||!e.includes(t))throw new Error(`Invalid ${i} '${t}'. Choose: ${e.join(", ")}`)},i=(t,e)=>{if(!t||t<0)throw new Error(`Invalid ${e}. Must be above 0.`)};e(t.size,wi,"size"),e(t.position,mi,"position"),e(t.theme,_i,"theme"),i(t.showLauncherAfter,"showLauncherAfter"),i(t.showBadgeAfter,"showBadgeAfter")}Et(){OneSignal.P.on(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,async t=>{t.current.optedIn&&(this.Pt.B&&this.it.prenotify&&this.Pt.K(),null===this._t.nt&&(this._t.nt=await He()),this.X||this._t.K());const e=await OneSignal.A.Tt.$t(),i=t.current.optedIn?1:"denied"===e?3:2;this.At(i,this.Z)}),OneSignal.P.on(OneSignal.EVENTS.NOTIFICATION_PERMISSION_CHANGED_AS_STRING,()=>this.Nt())}async ft(){const t=this._t.st;t&&(t.disabled=!0),this.Z=!0,this.X=!0,await OneSignal.User.PushSubscription.optIn(),t&&(t.disabled=!1),this._t.K(),await this.et.tt(si,this.it.text["message.action.resubscribed"],ai),this.Z=!1,this.X=!1,this.Nt()}async wt(){const t=this._t.ot;t&&(t.disabled=!0),this.X=!0,await OneSignal.User.PushSubscription.optOut(),t&&(t.disabled=!1),this._t.K(),await this.et.tt(si,this.it.text["message.action.unsubscribed"],ai),this.X=!1,this.Nt()}Mt(){const{position:t,theme:e}=this.it,i=this.Ut;i&&Pe(i,`onesignal-bell-container-${t}`),Pe(this.Dt.F,`onesignal-bell-launcher-${t}`),Pe(this.Dt.F,`onesignal-bell-launcher-theme-${e}`)}async Lt(){if(!this.it.enable)return;if(!CSS.supports("anchor-name: --a"))return void pt.S("Bell requires CSS Anchor Positioning");if(0!==await OneSignal.A.Ft.U())return void pt.p("Bell styles failed to load");this.Ut&&Ce("#onesignal-bell-container"),xe("body","beforeend",'
'),this.Ut&&xe(this.Ut,"beforeend",'
'),xe(this.Dt.F,"beforeend",''),this.Rt.R?.setAttribute("aria-label",this.it.text["launcher.button.aria-label"]||bi),xe(this.Dt.F,"beforeend",'
'),xe(this.Dt.F,"beforeend",'
'),xe(this.et.F,"beforeend",'
'),xe(this.Dt.F,"beforeend",'
'),xe(this._t.F,"beforeend",'
'),xe(this.Rt.F,"beforeend",''),this.Dt.R?.addEventListener("mouseleave",()=>{this.Rt.R?.blur()});const t=this._t.R;t&&(t.addEventListener("toggle",t=>{"open"===t.newState&&(this._t.rt(),this.et.K())}),t.addEventListener("beforetoggle",t=>{"open"===t.newState&&this.et.B&&this.et.yt===si&&t.preventDefault()}));const e=await OneSignal.A.lt.ct();Be(0),this.Dt.bt(this.it.size||fi),this.Mt(),this.Wt(),this.Bt(),pt.m("Showing bell"),e&&null===this._t.nt&&(this._t.nt=await He()),await dt(this.it.showLauncherAfter||0),this.Dt.j(),await this.Nt(),await dt(this.it.showBadgeAfter||0),this.it.prenotify&&!e&&!this.jt&&OneSignal.v&&(this.et.W=Te(this.it.text["message.prenotify"]),this.Pt.q(),this.Pt.j()),this.C=!0}Wt(){const t=this.it.offset;if(!t)return;const e=this.Dt.R;if(!e)return void pt.S("Bell element not found");t.bottom&&(e.style.bottom=t.bottom);const i="bottom-right"===this.it.position?t.right:t.left;i&&(e.style["bottom-right"===this.it.position?"right":"left"]=i)}Bt(){const t=this.it.colors;if(!t)return;const e=this.Dt.R;if(!e)return;const i=(t,i)=>{i&&e.style.setProperty(t,i)};i("--bell-bg",t["circle.background"]),i("--bell-fg",t["circle.foreground"]),i("--badge-bg",t["badge.background"]),i("--badge-border",t["badge.bordercolor"]),i("--badge-fg",t["badge.foreground"]),i("--btn-bg",t["dialog.button.background"]),i("--btn-fg",t["dialog.button.foreground"]),i("--btn-hover-bg",t["dialog.button.background.hovering"]),i("--btn-active-bg",t["dialog.button.background.active"]),i("--pulse-color",t["pulse.color"])}async Nt(){try{const[t,e]=await Promise.all([OneSignal.A.lt.ct(),OneSignal.A.Tt.$t()]),i="denied"===e?3:t?1:2;this.At(i)}catch(t){pt.S(t)}}At(t,e=!1){const i=this.ut;this.ut=t,i===t||e||this.Dt.R&&(this.et.W=Te(this.et.St()))}get Ut(){return document.querySelector("#onesignal-bell-container")}get Dt(){return this.vt||(this.vt=new hi(this)),this.vt}get Rt(){return this.Ot||(this.Ot=new oi(this)),this.Ot}get Pt(){return this.It||(this.It=new Qe),this.It}get et(){return this.kt||(this.kt=new pi(this)),this.kt}get _t(){return this.xt||(this.xt=new ui(this)),this.xt}get zt(){return 1===this.ut}get Y(){return 2===this.ut}get jt(){return 3===this.ut}},vi="onesignal-button-indicator-holder",Oi="onesignal-slidedown-container",Ii="onesignal-slidedown-dialog",ki="onesignal-reset",xi="onesignal-saving-state-button",Ci="slide-up",Ei="slide-down",Pi="close-slidedown",$i="default-icon",Ti="clearfix",Ai="onesignal-slidedown-allow-button",Ni="slidedown-body",Mi="onesignal-button-indicator-holder",Ui="onesignal-slidedown-cancel-button",Di="onesignal-slidedown-container",Li="onesignal-slidedown-dialog",Fi="slidedown-footer",Ri="onesignal-loading-container",Wi="align-right",Bi="slidedown-button",ji="tagging-container",zi="tagging-container-col",Ki="channel-capture-container",Vi="onesignal-error-input",qi="onesignal-validation-element-hidden",Hi="sms-input-with-validation-element",Ji="email-input-with-validation-element",Gi="iti-onesignal-sms-input",Yi="onesignal-email-input",Qi="onesignal-sms-validation-element",Zi="onesignal-email-validation-element",Xi="onesignal-customlink-subscribe",tn="onesignal-customlink-explanation",en="onesignal-reset",nn="state-subscribed",sn="state-unsubscribed",an={Kt:".onesignal-customlink-container",Vt:`.${Xi}`,qt:`.${tn}`},on=class{Ht;constructor(t){this.Ht=t}async Jt(){if(!this.Ht?.enabled)return;if(!(await this.Gt()))return;pt.m("Initializing customlink");const t=await OneSignal.A.lt.ct();if(this.Ht?.unsubscribeEnabled||!t)for(let e=0;e{pt.m("CustomLink: clicked"),await this.ne(e)}),e.setAttribute("type","button"),t.appendChild(e)}}else pt.S("CustomLink: missing 'text' config")}async Gt(){return 0===await OneSignal.A.Ft.U()||(pt.p("CustomLink: styles failed to load"),!1)}se(t){Pe(t,"hide")}Zt(){this.Yt.forEach(t=>{this.se(t)})}async ne(t){if(!OneSignal.User.PushSubscription.optedIn)return await OneSignal.User.PushSubscription.optIn(),void(this.Ht?.unsubscribeEnabled||this.Zt());await OneSignal.User.PushSubscription.optOut(),await this.ie(t)}async ie(t){this.Ht?.text?.subscribe&&(await OneSignal.A.lt.ct()||(t.textContent=this.Ht.text.subscribe)),this.Ht?.text?.unsubscribe&&await OneSignal.A.lt.ct()&&(t.textContent=this.Ht.text.unsubscribe)}ee(t){this.Ht?.color&&this.Ht.color.text&&("button"===this.Ht?.style&&this.Ht?.color.button?(t.style.backgroundColor=this.Ht?.color.button,t.style.color=this.Ht?.color.text):"link"===this.Ht?.style&&(t.style.color=this.Ht?.color.text))}get Yt(){const t=document.querySelectorAll(an.Kt);return Array.prototype.slice.call(t)}},rn={ae:0,oe:1},cn=class{static re(t,e,i){if(e||!1===e?pt.p(`(${A}) » ${t}:`,e):pt.p(`(${A}) » ${t}`),t===OneSignal.EVENTS.SDK_INITIALIZED){if(OneSignal.C)return;OneSignal.C=!0}i?i.ce(t,e):OneSignal.P.ce(t,e)}},ln="onesignal-pageview-count",un=!1;function dn(){try{const t=sessionStorage.getItem(ln),e=t?parseInt(t):0;return isNaN(e)?0:e}catch{return 0}}function hn(){if(un)return;const t=dn()+1,e=we()+1;var i;!function(t){try{sessionStorage.setItem(ln,t.toString())}catch{}}(t),i=e,localStorage.setItem(ue,i.toString()),un=!0,pt.p(`Page views: tab=${t}, total=${e}`)}function gn(){return 1===dn()}var pn=class{},fn=class{le;constructor(){this.le={}}on(t,e){return this.le[t]=this.le[t]||[],this.le[t].push(e),this}once(t,e){const i=this;function n(...s){i.off(t,n),e.apply(this,s)}return n.listener=e,this.on(t,n),this}off(t,e){const i=this.le[t];if(void 0!==i){for(let t=0;t{mn(t)&&(this.fe=t.id)}).catch(t=>{pt.S(t)}),OneSignal.P.on(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,t=>{this.fe=t?.current.id,this.we=t?.current.token}),OneSignal.P.on(OneSignal.EVENTS.NOTIFICATION_PERMISSION_CHANGED_AS_STRING,t=>{this._e=t})):pt._(`PushSubscriptionNamespace: skipping initialization. One or more required params are falsy: initialize: ${t}, subscription: ${JSON.stringify(e)}`)}get id(){return wn.pe(this.fe)?void 0:this.fe}get token(){return this.we}get optedIn(){return!!this.me&&"granted"===this._e}async optIn(){ze("optIn"),await je(),this.me=!0,"granted"===await OneSignal.A.Tt.$t()?await this.Se(!0):await OneSignal.Notifications.requestPermission()}async optOut(){ze("optOut"),await je(),this.me=!1,await this.Se(!1)}addEventListener(t,e){OneSignal.P.on(t,e)}removeEventListener(t,e){OneSignal.P.off(t,e)}async Se(t){await je();const e=await ve();if(!Je())throw X;if("boolean"!=typeof t)throw ot("enabled");e.optedOut=!t,await Oe(e),Xe("subscription.optedOut",e.optedOut),Ln().catch(t=>{pt.S(t)})}},bn=class{ve=[];get Oe(){return this.ve.length>0}Ie(t){this.ve.push(t)}ke(t){const e=this.ve.indexOf(t);-1!==e&&this.ve.splice(e,1)}xe(t){for(const e of this.ve)t(e)}},yn=class{Ce;Ee=new Map;Pe=new bn;constructor(){this.Ce=Math.random().toString(36).substring(2)}$e(t){const{modelId:e,modelName:i,...n}=t;this.Ee.clear(),this.Ee=new Map(Object.entries(n)),e&&(this.Ce=e)}Te(t,e){const i=new Map;e.Ee.forEach((t,e)=>{i.set(e,t)}),null!==t&&(this.Ce=t),this.Ee.clear(),this.Ee=i}Ae(t,e,i=0,n=!1){const s=this.Ee.get(t);(s!==e||n)&&(void 0!==e?this.Ee.set(t,e):this.Ee.has(t)&&this.Ee.delete(t),this.Ne(t,i,s,e))}Me(t){return this.Ee.has(t)}Ue(t,e){return this.Ee.get(t)??e}Ne(t,e,i,n){const s={model:this,property:t,oldValue:i,newValue:n};this.Pe.xe(t=>t.De(s,e))}toJSON(){return Object.fromEntries(this.Ee.entries())}Ie(t){return this.Pe.Ie(t)}ke(t){this.Pe.ke(t)}get Oe(){return this.Pe.Oe}Le(t){for(const[e,i]of Object.entries(t))this.Ee.set(e,i)}},Sn=class extends yn{constructor(){super(),this.sdk=E,this.device_model=F(),this.device_os=L()}get Fe(){return this.Ue("onesignalId")}set Fe(t){this.Ae("onesignalId",t)}get id(){return this.Ue("id")}set id(t){this.Ae("id",t)}get enabled(){return this.Ue("enabled")}set enabled(t){this.Ae("enabled",t)}get type(){return this.Ue("type")}set type(t){this.Ae("type",t)}get token(){return this.Ue("token")}set token(t){this.Ae("token",t)}get Re(){return this.Ue("notification_types")}set Re(t){this.Ae("notification_types",t)}get sdk(){return this.Ue("sdk")}set sdk(t){this.Ae("sdk",t)}get device_model(){return this.Ue("device_model")}set device_model(t){this.Ae("device_model",t)}get device_os(){return this.Ue("device_os")}set device_os(t){this.Ae("device_os",t)}get web_auth(){return this.Ue("web_auth")}set web_auth(t){this.Ae("web_auth",t)}get web_p256(){return this.Ue("web_p256")}set web_p256(t){this.Ae("web_p256",t)}},vn=0,On=class extends yn{constructor(t,e,i){super(),this.Ce="{"+(vn=Math.max(1e3*Date.now(),vn+1)).toString(36).padStart(11,"0")+Math.random().toString(36).substring(2,8),this.t=t,e&&(this.We=e),i&&(this.Fe=i)}get t(){return this.Ue("name")}set t(t){this.Ae("name",t)}get We(){return this.Ue("appId")}set We(t){this.Ae("appId",t)}get Fe(){return this.Ue("onesignalId")}set Fe(t){this.Ae("onesignalId",t)}get Be(){return this.Fe}get je(){return""}get ze(){return 1}get Ke(){return!wn.pe(this.Fe)}Ve(t){t[this.Fe]&&(this.Fe=t[this.Fe])}},In=class extends On{constructor(t,e,i,n){super(z,t,e),i&&(this.qe=i),n&&(this.He=n)}get qe(){return this.Ue("externalId")}set qe(t){this.Ae("externalId",t)}get He(){return this.Ue("existingOnesignalId")}set He(t){this.Ae("existingOnesignalId",t)}get je(){return`${this.We}.User.${this.Fe}`}get Je(){return""}get ze(){return 0}get Ke(){return!this.He||!wn.pe(this.He)}get Be(){return this.He??this.Fe}Ve(t){this.He&&t[this.He]&&(this.He=t[this.He])}};function kn(t,e){return"string"==typeof t&&t?!!t.includes("\0")&&(pt.S(`${e} contains a null byte`),!0):(pt.S(`${e} is required`),!0)}var xn=class t{static Ge;static Ye(){if(!t.Ge){t.Ge=new t;const e=OneSignal.ye.Qe(),i=OneSignal.ye.Ze(),n=e.Fe??wn.ge();e.Fe||e.Ae(Y,n,1),i.Fe||i.Ae("onesignalId",n,1)}return t.Ge}Xe(t){const e=OneSignal.ye.Qe();Object.keys(t).forEach(i=>{e.Ae(i,t[i])})}get onesignalId(){const t=OneSignal.ye.Qe().Fe;return wn.pe(t)?void 0:t}get externalId(){return OneSignal.ye.Qe()?.qe}addAlias(t,e){ze("addAlias",{label:t,id:e}),be()||An(t,"label","addAlias: label",!0)&&An(e,"id","addAlias: id")&&this.Xe({[t]:e})}addAliases(t){if(ze("addAliases",{aliases:t}),!be()){!function(t,e){if(!ct(t))throw rt(e);if(!t||0===Object.keys(t).length)throw at(e)}(t,"aliases");for(const e in t){const i=`key: ${e}`;if(!An(t[e],i,"addAliases: value")||!An(e,i,"addAliases: key",!0))return}this.Xe(t)}}removeAlias(t){ze("removeAlias",{label:t}),be()||this.removeAliases([t])}removeAliases(t){if(ze("removeAliases",{aliases:t}),be())return;$n(t,"aliases","label");for(const i of t)if(!An(i,"label","removeAliases: label",!0))return;const e=Object.fromEntries(t.map(t=>[t,void 0]));this.Xe(e)}addEmail(t){if(ze("addEmail",{email:t}),!be()&&(Pn(t,"email"),!kn(t,"addEmail: email"))){if(!function(t){return!!t&&!!t.match(/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/)}(t))throw ot("email");En({type:l,token:t})}}addSms(t){ze("addSms",{sms:t}),be()||(Pn(t,"sms"),kn(t,"addSms: sms")||En({type:u,token:t}))}removeEmail(t){ze("removeEmail",{email:t}),be()||(Pn(t,"email"),kn(t,"removeEmail: email")||OneSignal.ye.ti().forEach(e=>{e.token===t&&OneSignal.ye.ei(e.Ce)}))}removeSms(t){ze("removeSms",{smsNumber:t}),be()||(Pn(t,"smsNumber"),kn(t,"removeSms: smsNumber")||OneSignal.ye.ii().forEach(e=>{e.token===t&&OneSignal.ye.ei(e.Ce)}))}addTag(t,e){ze("addTag",{key:t,value:e}),be()||(Pn(t,"key"),Pn(e,"value"),this.addTags({[t]:e}))}addTags(t){if(be())return;if(function(t,e,i=!1){return ct(t)?Object.entries(t).some(([t,n])=>!!kn(t,`${e}: key`)||(i?null==n&&kn(n,`${e}: value`):kn(n,`${e}: value`))):(pt.S(`${e}: argument must be an object`),!0)}(t,"addTags",!0))return;const e=OneSignal.ye.Ze();e.ni={...e.ni,...t}}removeTag(t){ze("removeTag",{tagKey:t}),be()||this.removeTags([t])}removeTags(t){if(ze("removeTags",{tagKeys:t}),be())return;if($n(t,"tagKeys","tagKey"),e=t,i="removeTags",Array.isArray(e)?e.some(t=>kn(t,`${i}: key`)):(pt.S(`${i}: keys must be an array of strings`),1))return;var e,i;const n=OneSignal.ye.Ze(),s={...n.ni};t.forEach(t=>{s[t]=""}),n.ni=s}getTags(){return ze("getTags"),OneSignal.ye.Ze().ni}setLanguage(t){ze("setLanguage",{language:t}),be()||(Pn(t,"language"),t&&kn(t,"setLanguage: language")||(OneSignal.ye.Ze().si=t||gt()))}getLanguage(){return ze("getLanguage"),OneSignal.ye.Ze().si}trackEvent(t,e={}){if(be())return;if(Pn(t,"name"),kn(t,"trackEvent: name"))return;const i=OneSignal.ye.Qe().Fe;!wn.pe(i)||Cn(i)?function(t){if(!ct(t))return!1;try{return JSON.stringify(t),!0}catch{return!1}}(e)?(ze("trackEvent",{name:t,properties:e}),OneSignal.ye.oi.ai({name:t,properties:e})):pt.S("Properties not serializable"):pt.S("User not logged in")}};function Cn(t){const{ri:e,ci:i}=OneSignal.ye.li;return[...e,...i].some(e=>e.operation instanceof In&&e.operation.Fe===t)}function En({type:t,token:e}){if(OneSignal.ye.di.ui().find(i=>i.token===e&&i.type===t))return;const i=OneSignal.ye.Qe(),n=i.Fe;if(wn.pe(n)){const t=Je();Cn(n)||OneSignal.ye.li.hi(new In(t,n,i.qe))}const s={id:wn.ge(),enabled:!0,notification_types:1,onesignalId:n,token:e,type:t},a=new Sn;a.Le(s),OneSignal.ye.gi(a)}function Pn(t,e){if("string"!=typeof t)throw rt(e)}function $n(t,e,i){if(!Array.isArray(t))throw rt(e);if(0===t.length)throw at(e);for(const n of t)Pn(n,i)}var Tn=/[/?#&=\s\x00-\x1F\x7F]|\.\./;function An(t,e,i,n=!1){if(Pn(t,e),kn(t,i))return!1;if(t.length>128||Tn.test(t))throw ot(e);if(n&&("external_id"===t||"onesignal_id"===t))throw new Error(`"${t}" is reserved`);return!0}var Nn=class t extends pn{pi;PushSubscription=new _n(!1);static P=new fn;constructor(t,e,i){super(),t&&(this.pi=xn.Ye(),this.PushSubscription=new _n(!0,e,i))}get onesignalId(){return this.pi?.onesignalId}get externalId(){return this.pi?.externalId}addAlias(t,e){this.pi?.addAlias(t,e)}addAliases(t){this.pi?.addAliases(t)}removeAlias(t){this.pi?.removeAlias(t)}removeAliases(t){this.pi?.removeAliases(t)}addEmail(t){this.pi?.addEmail(t)}removeEmail(t){this.pi?.removeEmail(t)}addSms(t){this.pi?.addSms(t)}removeSms(t){this.pi?.removeSms(t)}addTag(t,e){this.pi?.addTag(t,e)}addTags(t){this.pi?.addTags(t)}removeTag(t){this.pi?.removeTag(t)}removeTags(t){this.pi?.removeTags(t)}getTags(){return this.pi?.getTags()||{}}setLanguage(t){this.pi?.setLanguage(t)}getLanguage(){return this.pi?.getLanguage()||""}trackEvent(t,e){return this.pi?.trackEvent(t,e)}addEventListener(e,i){t.P.on(e,i)}removeEventListener(e,i){t.P.off(e,i)}},Mn=class{previousOneSignalId;previousExternalId};function Un(t,e){return t?t.filter(t=>t.type===e)[0]:void 0}function Dn(t){return t===Pt||t===$t}async function Ln(){ze("checkAndTriggerSubscriptionChanged");const t=OneSignal.A,e=await OneSignal.A.lt.ct(),i=await OneSignal.A.lt.fi(),n=await me(),{lastKnownPushEnabled:s,lastKnownPushId:a,lastKnownPushToken:o,lastKnownOptedIn:r}=n,c=await Ge(),l=(await OneSignal.ye.be())?.id;if(e===s&&c===o&&l===a)return;await t.lt.wi(),n.lastKnownPushEnabled=e,n.lastKnownPushToken=c,n.lastKnownPushId=l,n.lastKnownOptedIn=i,await _e(n);const u={previous:{id:a,token:o,optedIn:r??!0},current:{id:l,token:c,optedIn:i}};pt.m("Push sub changed:",u),function(t){cn.re(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,t)}(u)}function Fn(t){!function(t,e){if(OneSignal.gt)return void pt.p("Skipping welcome notif: already subscribed");const i=OneSignal.config?.userConfig.welcomeNotification;if(void 0!==i&&!0===i.disable)return;if(!0!==t)return;if(!e)return;let n=void 0!==i&&void 0!==i.title&&null!==i.title?i.title:"",s=void 0!==i&&void 0!==i.message&&null!==i.message&&i.message.length>0?i.message:"Thanks for subscribing!";const a=new URL(location.href).origin+"?_osp=do_not_open",o=i&&i.url&&i.url.length>0?i.url:a;n=Te(n),s=Te(s),pt.p("Sending welcome notif"),async function(t,e,i,n,s,a){if(ze("MainHelper:showLocalNotification: ",t,e,i,n,s,a),!(await(async()=>{const t={};return t.appId=await oe("appId"),t.vapidPublicKey=await ae("vapidPublicKey"),t})()).appId)throw X;if(!OneSignal.Notifications.permission)throw new Error("User is not subscribed");if(!lt(i))throw ot("url");if(!lt(n,{allowEmpty:!0,requireHttps:!0}))throw ot("icon");if(!n){const t=await He();n=qe(t)}const o=t=>{const e=[];for(let i=0;i{if(!i)return void pt.S("SW registration unavailable");const s={body:e,data:r,icon:n,actions:a?o(a):[]};await i.showNotification(t,s)})}(n,s,o,void 0,{mi:!0},void 0),cn.re(OneSignal.EVENTS.WELCOME_NOTIFICATION_SENT,{title:n,message:s,url:o})}(t?.current?.optedIn,t?.current?.id),function(t){if(!0!==t)return;const e=OneSignal.A._i.userConfig.promptOptions?.slidedown?.prompts;(function(t){if(!t)return!1;const e=Un(t,$t);return!!e&&!!e.categories&&e.categories.length>0})(e)&&OneSignal.A.yi.bi()}(t?.current?.optedIn),function(){if(!OneSignal.config?.userConfig.notifyButton)return;const t=OneSignal.config.userConfig.notifyButton.displayPredicate;t&&"function"==typeof t&&OneSignal.Si&&(!1!==t()?(pt.p("Showing notify button: predicate true"),OneSignal.Si.Dt.j()):(pt.p("Hiding notify button: predicate false"),OneSignal.Si.Dt.K()))}(),OneSignal.config?.userConfig.promptOptions&&new on(OneSignal.config?.userConfig.promptOptions.customlink).Jt()}var Rn=Promise.resolve(),Wn=(t=!1)=>{const e=Rn.then(()=>Bn(t));return Rn=e.catch(()=>{}),e},Bn=async t=>{const e=await OneSignal.A.Tt.$t(),i=e!==await ae("notificationPermission");(t||i||e!==OneSignal.Notifications.permissionNative)&&(i&&await se.put("Options",{key:"notificationPermission",value:e}),cn.re(OneSignal.EVENTS.NOTIFICATION_PERMISSION_CHANGED_AS_STRING,e),cn.re(OneSignal.EVENTS.NOTIFICATION_PERMISSION_CHANGED_AS_BOOLEAN,"granted"===e),(t||i)&&await Ln().catch(pt.S))};async function jn(){const t=OneSignal.A;let e=null;try{const i=await t.lt.Ie(rn.ae);e=await t.lt.Oi(i),hn(),await Wn(),await Ln()}catch(i){pt.S(i)}return e}function zn(t){switch(t){case c:case d:case h:case g:return!0;default:return!1}}async function Kn(){if(pt.p("sessionInit()"),OneSignal.Ii)return void pt.p("sessionInit already running");OneSignal.Ii=!0;try{await async function(){const t=[];t.push(async function(){const t=await OneSignal.A.lt.ct(),e=await OneSignal.A.Tt.$t();Xe("subscription.optedOut",await OneSignal.A.lt.ki()),await se.put("Options",{key:"isPushEnabled",value:t}),await se.put("Options",{key:"notificationPermission",value:e})}()),t.push(async function(){try{navigator.permissions&&((await navigator.permissions.query({name:"notifications"})).onchange=function(){Wn()})}catch(t){pt._(`Permission change hook failed: ${String(t)}`)}}()),t.push(("granted"===OneSignal.A.Tt.xi(OneSignal.A._i.safariWebId)&&(OneSignal.gt=!0),Promise.resolve())),t.push(function(){if(navigator.serviceWorker&&window.isSecureContext)try{OneSignal.A.T.Ci()}catch(t){pt.S(t)}return Promise.resolve()}()),function(){if(!OneSignal.Si){OneSignal.config.userConfig.notifyButton=OneSignal.config.userConfig.notifyButton||{},OneSignal.config.userConfig.bell&&(OneSignal.config.userConfig.bell={...OneSignal.config.userConfig.bell,...OneSignal.config.userConfig.notifyButton},OneSignal.config.userConfig.notifyButton={...OneSignal.config.userConfig.notifyButton,...OneSignal.config.userConfig.bell});const t=OneSignal.config.userConfig.notifyButton.displayPredicate;t&&"function"==typeof t?OneSignal.P.once(OneSignal.EVENTS.SDK_INITIALIZED,async()=>{!1!==await Promise.resolve(OneSignal.config.userConfig.notifyButton.displayPredicate?.())?(OneSignal.Si=new Si(OneSignal.config.userConfig.notifyButton),OneSignal.Si.Lt()):pt.p("Notify button predicate returned false")}):(OneSignal.Si=new Si(OneSignal.config.userConfig.notifyButton),OneSignal.Si.Lt())}}(),t.push(async function(){const t=OneSignal.config;t.userConfig.promptOptions&&await new on(t.userConfig.promptOptions.customlink).Jt()}());try{await Promise.all(t)}catch(e){throw pt.S(e),new Error("Unknown init error")}}()}catch(s){if(s instanceof Error)return;throw s}const t=await OneSignal.A.lt.ki(),e=t??!1,i=await ve();i.optedOut=t,await Oe(i),await async function(t){pt.m("handleAutoResubscribe",{autoResubscribe:OneSignal.config?.userConfig.autoResubscribe,isOptedOut:t}),OneSignal.config?.userConfig.autoResubscribe&&!1===t&&"granted"==OneSignal.A.Tt.xi(OneSignal.A._i.safariWebId)&&await jn()}(t);const n=await OneSignal.A.lt.ct();await se.put("Options",{key:"isPushEnabled",value:!!n}),OneSignal.config?.userConfig.promptOptions?.autoPrompt&&!e&&OneSignal.A.Pi.Ei(),OneSignal.Ii=!1,cn.re(OneSignal.EVENTS.SDK_INITIALIZED)}async function Vn(){return!!(await jn())}async function qn(){const t=await async function(){const t=OneSignal.A;if(pt.p("Checking sub expiration"),!(await t.lt.$i()))return pt.p("Sub not expired"),!1;pt.p("Sub expiring");const e=await t.lt.Ie(rn.oe);return await t.lt.Oi(e),!0}();await OneSignal.A.lt.Ti()?(OneSignal.A.Ni.Ai(),t||await OneSignal.A.Ui.Mi()):OneSignal.config?.userConfig.promptOptions?.autoPrompt||OneSignal.config?.userConfig.autoResubscribe||await OneSignal.A.Ui.Mi(),cn.re(OneSignal.EVENTS.SDK_INITIALIZED_PUBLIC)}var Hn=class extends On{constructor(t){super(J,t?.appId,t?.onesignalId),t?.externalId&&(this.qe=t.externalId),t?.timestamp&&(this.Di=t.timestamp),t?.event&&(this.Li=t.event)}get qe(){return this.Ue("externalId")}set qe(t){this.Ae("externalId",t)}get Di(){return this.Ue("timestamp")}set Di(t){this.Ae("timestamp",t)}get Li(){return this.Ue("event")}set Li(t){this.Ae("event",t)}get key(){return`${this.We}.User.${this.Fe}.CustomEvent.${this.Li.name}`}get je(){return this.key}get Je(){return this.key}get ze(){return 2}get Ke(){return!wn.pe(this.Fe)}get Be(){return this.Fe}Ve(t){t[this.Fe]&&(this.Fe=t[this.Fe])}},Jn=class{Fi;Ri;constructor(t,e){this.Fi=t,this.Ri=e}ai(t){const e=Je(),i=this.Fi.Wi,n=new Hn({appId:e,onesignalId:i.Fe,externalId:i.qe,timestamp:(new Date).toISOString(),event:t});this.Ri.hi(n)}};function Gn(t){switch(t){case 400:case 402:return 0;case 401:case 403:return 2;case 404:case 410:return 3;case 409:return 4;default:return 1}}var Yn=class{get Bi(){return[J]}get ji(){return{sdk:E,device_model:F(),device_os:L(),type:D()}}async zi(t){pt.p(`CustomEventOpExec(${JSON.stringify(t)})`);const e=t[0];if(!(e instanceof Hn))throw new Error(`Unrecognized operation! Expected TrackEventOperation, got: ${e.constructor.name}`);const{ok:i,status:n}=await async function(t,e){const{appId:i}=t;return mt(`apps/${i}/custom_events`,{events:[e]},t.jwtHeader)}({appId:e.We},{name:e.Li.name,onesignal_id:e.Fe,external_id:e.qe,timestamp:e.Di,payload:{...e.Li.properties,os_sdk:this.ji}}),s=Gn(n);return i?{Ki:0}:1===s?{Ki:2}:{Ki:3}}},Qn=class extends On{constructor(t,e,i,n){super(t,e,i),n&&(this.label=n)}get label(){return this.Ue("label")}set label(t){this.Ae("label",t)}},Zn=class extends Qn{constructor(t,e,i){super(W,t,e,i)}get Je(){return`${this.We}.User.${this.Fe}.Alias.${this.label}`}get ze(){return 2}},Xn=class extends Qn{constructor(t,e,i,n){super(R,t,e,i),n&&(this.value=n)}get value(){return this.Ue("value")}set value(t){this.Ae("value",t)}get Je(){return`${this.We}.User.${this.Fe}.Identity.${this.label}`}},ts=class{Fi;Vi;qi;constructor(t,e,i){this.Fi=t,this.Vi=e,this.qi=i}get Bi(){return[R,W]}async zi(t){if(pt.p(`IdentityOpExec(${JSON.stringify(t)})`),t.filter(t=>!(t instanceof Xn||t instanceof Zn)).length>0)throw new Error(`Unrecognized operation(s)! Attempted operations:\n${JSON.stringify(t)}`);const e=t.some(t=>t instanceof Xn),i=t.some(t=>t instanceof Zn);if(e&&i)throw new Error("Can't process SetAliasOperation and DeleteAliasOperation at the same time.");const n=t[t.length-1],s=n instanceof Xn,{ok:a,status:o,retryAfterSeconds:r}=await(s?async function(t,e,i){const{appId:n}=t;return bt(`apps/${n}/users/by/${e.label}/${e.id}/identity`,{identity:i},t.jwtHeader)}({appId:n.We},{label:Y,id:n.Fe},{[n.label]:n.value}):async function(t,e,i){const{appId:n}=t;return _t(`apps/${n}/users/by/${e.label}/${e.id}/identity/${i}`,t.jwtHeader)}({appId:n.We},{label:Y,id:n.Fe},n.label));if(a)return this.Fi.Wi.Fe===n.Fe&&this.Fi.Wi.Ae(n.label,s?n.value:void 0,2),{Ki:0};switch(Gn(o)){case 1:return{Ki:2,Hi:r};case 0:return{Ki:3};case 4:return s?{Ki:5,Hi:r}:{Ki:0};case 2:return{Ki:4,Hi:r};case 3:if(404===o&&this.qi.Ji(n.Fe))return{Ki:2,Hi:r};if(s){const t=await this.Vi.Gi(n.We,n.Fe);return null==t?{Ki:3}:{Ki:2,Hi:r,Bi:t}}return{Ki:0}}}},es=class extends On{constructor(t,e,i,n){super(t,e,i),n&&(this.Yi=n)}get Yi(){return this.Ue("subscriptionId")}set Yi(t){this.Ae("subscriptionId",t)}get je(){return`${this.We}.User.${this.Fe}`}get Je(){return`${this.We}.User.${this.Fe}.Subscription.${this.Yi}`}get Ke(){return!wn.pe(this.Fe)&&!wn.pe(this.Yi)}get Be(){return this.Yi}Ve(t){super.Ve(t),t[this.Yi]&&(this.Yi=t[this.Yi])}},is=class extends es{constructor(t,e,i,n){super(t,e,i),n&&(this.sdk=E,this.device_model=F(),this.device_os=L(),this.enabled=n.enabled,this.notification_types=n.notification_types,this.Yi=n.subscriptionId,this.token=n.token,this.type=n.type,this.web_auth=n.web_auth,this.web_p256=n.web_p256)}get type(){return this.Ue("type")}set type(t){this.Ae("type",t)}get token(){return this.Ue("token")}set token(t){this.Ae("token",t)}get enabled(){return this.Ue("enabled")}set enabled(t){this.Ae("enabled",t)}get notification_types(){return this.Ue("notification_types")}set notification_types(t){this.Ae("notification_types",t)}get sdk(){return this.Ue("sdk")}set sdk(t){this.Ae("sdk",t)}get device_model(){return this.Ue("device_model")}set device_model(t){this.Ae("device_model",t)}get device_os(){return this.Ue("device_os")}set device_os(t){this.Ae("device_os",t)}get web_auth(){return this.Ue("web_auth")}set web_auth(t){this.Ae("web_auth",t)}get web_p256(){return this.Ue("web_p256")}set web_p256(t){this.Ae("web_p256",t)}},ns=class extends is{constructor(t){super(K,t?.appId,t?.onesignalId,t)}get Ke(){return!wn.pe(this.Fe)}get Be(){return this.Fe}Ve(t){t[this.Fe]&&(this.Fe=t[this.Fe])}},ss=class extends es{constructor(t,e,i){super(q,t,e),i&&(this.Yi=i)}get ze(){return 2}},as=class extends On{constructor(t,e){super(j,t,e)}get je(){return`${this.We}.User.${this.Fe}.Refresh`}get Je(){return`${this.We}.User.${this.Fe}.Refresh`}get ze(){return 0}},os=class extends es{constructor(t,e,i){super(H,t,e),i&&(this.Yi=i)}get ze(){return 2}get Je(){return`${this.We}.Subscription.${this.Yi}.Transfer`}},rs=class extends is{constructor(t){super(V,t?.appId,t?.onesignalId,t)}},cs=class{Qi;Fi;Zi;Xi;constructor(t,e,i,n){this.Qi=t,this.Fi=e,this.Zi=i,this.Xi=n}get Bi(){return[z]}async zi(t){pt.p(`LoginUserOpExec(${JSON.stringify(t)})`);const e=t[0];if(e instanceof In)return this.tn(e,t.slice(1));throw new Error(`Unrecognized operation: ${e.t}`)}async tn(t,e){if(!t.He||!t.qe)return this.en(t,e);const i=await this.Qi.zi([new Xn(t.We,t.He,G,t.qe)]);switch(i.Ki){case 0:{const e=t.He,i=t.Fe;return this.Fi.Wi.Fe===i&&this.Fi.Wi.Ae(Y,e,2),this.Zi.Wi.Fe===i&&this.Zi.Wi.Ae("onesignalId",e,2),{Ki:1,nn:{[t.Fe]:e}}}case 5:return pt.p(`409 conflict: ${t.qe}`),this.en(t,e);case 3:return pt.S(`SetAlias failed: ${t.qe}`),this.en(t,e);default:return{Ki:i.Ki}}}async en(t,e){const i={};let n={};const s={timezone_id:ls(),language:gt()};t.qe&&(i[G]=t.qe);for(const l of e){if(!(l instanceof ns||l instanceof os||l instanceof rs||l instanceof ss))throw new Error(`Unrecognized operation: ${l.t}`);n=this.sn(l,n)}const a=Object.entries(n);if(0===Object.keys(i).length&&0===a.length)return pt.p("CreateUser: skipped, no identity and no subscriptions"),{Ki:3};const o=await async function(t,e){const{appId:i,subscriptionId:n}=t,s=n?{"OneSignal-Subscription-Id":n}:void 0;let a={};return s&&(a={...a,...s}),t.jwtHeader&&(a={...a,...t.jwtHeader}),e.refresh_device_metadata=!0,mt(`apps/${i}/users`,e,a)}({appId:t.We},{identity:i,subscriptions:a.map(([,t])=>t),properties:s});if(o.ok){const e=o.result.identity.onesignal_id,n=t.Fe,s={[t.Fe]:e},r=this.Fi.Wi.Fe===n;if(r){this.Fi.Wi.Ae(Y,e,2),this.Zi.Wi.Ae("onesignalId",e,2);const t=o.result.properties;if(t)for(const[e,i]of Object.entries(t))this.Zi.Wi.Ae(e,i,2)}const c=function(t,e){const i=e.filter(t=>!!t.id),n=new Map,s=e=>t.forEach(([t,s])=>{if(n.has(t))return;const a=e(t,s);a&&(n.set(t,a),i.splice(i.indexOf(a),1))});return s(t=>i.find(e=>e.id===t)),s((t,e)=>{if(!e.token)return;const n=t=>e.type===l?t?.toLowerCase():t;return i.find(t=>n(t.token)===n(e.token))}),s((t,e)=>{if(e.type===l||e.type===u)return;const n=i.filter(t=>t.type===e.type&&!t.token);return 1===n.length?n[0]:void 0}),n}(a,o.result.subscriptions??[]);a.forEach(([t])=>{const i=c.get(t);if(!i)return;if(s[t]=i.id,!r)return;const n=this.Xi.an(t);n?.Ae("id",i.id,2),n?.Ae("onesignalId",e,2)}),async function(){ze("checkAndTriggerUserChanged");const t=await(async()=>{const t=new Mn;return t.previousOneSignalId="",t.previousExternalId="",t.previousOneSignalId=await ae("previousOneSignalId"),t.previousExternalId=await ae("previousExternalId"),t})(),{previousOneSignalId:e,previousExternalId:i}=t,n=OneSignal.ye.Qe(),s=n?.Fe,a=n?.qe;if(s===e&&a===i)return;t.previousOneSignalId=s,t.previousExternalId=a,await(async t=>{await se.put("Options",{key:"previousOneSignalId",value:t.previousOneSignalId}),await se.put("Options",{key:"previousExternalId",value:t.previousExternalId})})(t);const o={current:{onesignalId:s,externalId:a}};pt.m("User changed:",o),function(t){cn.re(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,t,Nn.P)}(o)}();return{Ki:0,Bi:Object.keys(i).length>0?[new as(t.We,e)]:void 0,nn:s}}const{status:r,retryAfterSeconds:c}=o;switch(Gn(r)){case 1:return{Ki:2,Hi:c};case 2:return{Ki:4,Hi:c};default:return{Ki:6}}}sn(t,e){switch(!0){case t instanceof ns:{const i=t.Yi;return{...e,[i]:{enabled:t.enabled,device_model:t.device_model,device_os:t.device_os,notification_types:t.notification_types,sdk:t.sdk,token:t.token,type:t.type,web_auth:t.web_auth,web_p256:t.web_p256}}}case t instanceof rs:{const i=t.Yi;return e[i]?{...e,[i]:{...e[i],enabled:t.enabled,notification_types:t.notification_types,token:t.token}}:e}case t instanceof os:{const i=t.Yi;if(wn.pe(i)){if(e[i])return e;const t=this.Xi.an(i);return t?.token?{...e,[i]:{enabled:t.enabled,device_model:t.device_model,device_os:t.device_os,notification_types:t.Re,sdk:t.sdk,token:t.token,type:t.type,web_auth:t.web_auth,web_p256:t.web_p256}}:e}return{...e,[i]:{...e[i],id:i}}}case t instanceof ss:{const i={...e};return delete i[t.Yi],i}default:return e}}},ls=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,us=class extends yn{get Fe(){return this.Ue(Y)}set Fe(t){this.Ae(Y,t)}get qe(){return this.Ue(G)}set qe(t){this.Ae(G,t)}},ds=class extends yn{constructor(){super()}get Fe(){return this.Ue("onesignalId")}set Fe(t){this.Ae("onesignalId",t)}get rn(){return this.Ue("ip")}set rn(t){this.Ae("ip",t)}get cn(){return this.Ue("country")}set cn(t){this.Ae("country",t)}get si(){return this.Ue("language")}set si(t){this.Ae("language",t)}get ln(){return this.Ue("timezone_id")}set ln(t){this.Ae("timezone_id",t)}get ni(){return this.Ue("tags")??{}}set ni(t){this.Ae("tags",t)}},hs=class{Fi;Zi;Xi;Vi;qi;constructor(t,e,i,n,s){this.Fi=t,this.Zi=e,this.Xi=i,this.Vi=n,this.qi=s}get Bi(){return[j]}async zi(t){if(pt.p(`RefreshUserOpExec(${JSON.stringify(t)})`),t.some(t=>!(t instanceof as)))throw new Error(`Unrecognized operation(s)! Attempted operations:\n${JSON.stringify(t)}`);const e=t[0];return this.un(e)}async un(t){const{ok:e,result:i,retryAfterSeconds:n,status:s}=await async function(t,e){const{appId:i}=t;return wt(`apps/${i}/users/by/${e.label}/${e.id}`,t.jwtHeader)}({appId:t.We},{label:Y,id:t.Fe});if(e){if(t.Fe!==this.Fi.Wi.Fe)return{Ki:0};const e=new us;for(const[t,c]of Object.entries(i.identity))e.Ae(t,c);const n=new ds;n.Fe=t.Fe;const{properties:s={},subscriptions:a=[]}=i;Object.entries(s).forEach(([t,e])=>{n.Ae(t,e)});const o=[];for(const i of a){const e=new Sn;e.id=i.id,e.token=i.token??"",e.Re=i.notification_types??1,e.type=i.type,e.enabled=-2!==e.Re,e.sdk=i.sdk,e.device_os=i.device_os,e.device_model=i.device_model,e.Fe=t.Fe,zn(e.type)||o.push(e)}const r=await OneSignal.ye.be();return r&&(r.Fe=t.Fe,o.push(r)),this.Fi.dn(e,2),this.Zi.dn(n,2),this.Xi.hn(o,2),{Ki:0}}switch(Gn(s)){case 1:return{Ki:2,Hi:n};case 2:return{Ki:4,Hi:n};case 3:{if(404===s&&this.qi.Ji(t.Fe))return{Ki:2,Hi:n};const e=await this.Vi.Gi(t.We,t.Fe);return e?{Ki:2,Hi:n,Bi:e}:{Ki:3}}default:return{Ki:3}}}},gs=class{di;Vi;qi;constructor(t,e,i){this.di=t,this.Vi=e,this.qi=i}get Bi(){return[K,V,q,H]}async zi(t){pt.p(`SubOpExec(${JSON.stringify(t)})`);const e=t[0];if(e instanceof ns)return this.gn(e,t);if(t.some(t=>t instanceof ss)){if(t.length>1)throw new Error(`Only supports one operation! Attempted operations:\n${JSON.stringify(t)}`);return this.pn(t[0])}if(e instanceof rs)return this.fn(t);if(e instanceof os){if(t.length>1)throw new Error(`TransferSubscriptionOperation only supports one operation! Attempted operations:\n${JSON.stringify(t)}`);return this.wn(e)}throw new Error(`Unrecognized operation: ${JSON.stringify(e)}`)}async gn(t,e){if(e.some(t=>t instanceof ss))return{Ki:0};const i=[...e].reverse().find(t=>t instanceof rs),n=i?.enabled??t.enabled,s=i?.token??t.token,a=i?.notification_types??t.notification_types,o={sdk:t.sdk,type:t.type,enabled:n,token:s,notification_types:a},r=await async function(t,e,i){const{appId:n}=t;return mt(`apps/${n}/users/by/${e.label}/${e.id}/subscriptions`,i,t.jwtHeader)}({appId:t.We},{label:Y,id:t.Fe},{subscription:o});if(r.ok){const{subscription:e}=r.result,i=this.di.an(t.Yi),n=e?.id;return n&&(i?.Ae("id",n,2),i?.Ae("onesignalId",t.Fe,2)),{Ki:0,Bi:n?void 0:[new as(t.We,t.Fe)],nn:n?{[t.Yi]:n}:void 0}}const{retryAfterSeconds:c,status:l}=r;switch(Gn(l)){case 1:return{Ki:2,Hi:c};case 2:return{Ki:4,Hi:c};case 4:case 0:return{Ki:3};case 3:{if(404===l&&this.qi.Ji(t.Fe))return{Ki:2,Hi:c};const e=await this.Vi.Gi(t.We,t.Fe);return e?{Ki:2,Hi:c,Bi:e}:{Ki:3}}}}async fn(t){const e=t[t.length-1],i={type:e.type,enabled:e.enabled,token:e.token,notification_types:e.notification_types,web_auth:e.web_auth,web_p256:e.web_p256},n=await async function(t,e,i){const{appId:n}=t;return bt(`apps/${n}/subscriptions/${e}`,{subscription:i})}({appId:e.We},e.Yi,i);if(n.ok)return{Ki:0};const{retryAfterSeconds:s,status:a}=n;switch(Gn(a)){case 1:return{Ki:2,Hi:s};case 3:return 404===a&&[e.Fe,e.Yi].some(t=>this.qi.Ji(t))?{Ki:2,Hi:s}:{Ki:3,Bi:[new ns({appId:e.We,enabled:e.enabled,notification_types:e.notification_types,onesignalId:e.Fe,subscriptionId:e.Yi,token:e.token,type:e.type})]};default:return{Ki:3}}}async wn(t){const e=await async function(t,e,i){const{appId:n}=t;return bt(`apps/${n}/subscriptions/${e}/owner`,{identity:{...i}},t.jwtHeader)}({appId:t.We},t.Yi,{onesignal_id:t.Fe});if(e.ok)return{Ki:0};const{retryAfterSeconds:i,status:n}=e;return 1===Gn(n)?{Ki:2,Hi:i}:{Ki:3}}async pn(t){const e=await async function(t,e){const{appId:i}=t;return _t(`apps/${i}/subscriptions/${e}`)}({appId:t.We},t.Yi);if(e.ok)return this.di.mn(t.Yi,2),{Ki:0};const{retryAfterSeconds:i,status:n}=e;switch(Gn(n)){case 3:return[t.Fe,t.Yi].some(t=>this.qi.Ji(t))?{Ki:2,Hi:i}:{Ki:0};case 1:return{Ki:2,Hi:i};default:return{Ki:3}}}},ps=class extends On{constructor(t,e,i,n){super(B,t,e),i&&n&&(this._n=i,this.value=n)}get _n(){return this.Ue("property")}set _n(t){this.Ae("property",t)}get value(){return this.Ue("value")}set value(t){this.Ae("value",t)}get Je(){return`${this.We}.User.${this.Fe}`}},fs=class{Fi;Zi;Vi;qi;constructor(t,e,i,n){this.Fi=t,this.Zi=e,this.Vi=i,this.qi=n}get Bi(){return[B]}bn(t){let e=null,i=null,n={};for(const s of t){if(!(s instanceof ps))throw new Error(`Unrecognized operation: ${JSON.stringify(s)}`);e||(e=s.We,i=s.Fe),n=ws(s,n)}return{appId:e,onesignalId:i,propertiesObject:n,refreshDeviceMetadata:!1}}async zi(t){pt.p(`UpdateUserOpExec(${JSON.stringify(t)})`);const{appId:e,onesignalId:i,propertiesObject:n,refreshDeviceMetadata:s}=this.bn(t);if(!e||!i)return{Ki:0};const{ok:a,retryAfterSeconds:o,status:r}=await vt({appId:e},{label:Y,id:i},{properties:n,refresh_device_metadata:s}),c=t=>"tags"===t._n;if(a){if(this.Fi.Wi.Fe===i)for(const e of t)if(e instanceof ps){let t=e.value;if(c(e)){t={...e.value};for(const e in t)""===t[e]&&delete t[e]}this.Zi.Wi.Ae(e._n,t,2)}return{Ki:0}}switch(Gn(r)){case 1:return{Ki:2,Hi:o};case 2:return{Ki:4,Hi:o};case 3:{if(404===r&&this.qi.Ji(i))return{Ki:2,Hi:o};const t=await this.Vi.Gi(e,i);return t?{Ki:2,Hi:o,Bi:t}:{Ki:3}}default:return{Ki:3}}}};function ws(t,e){if(t instanceof ps){const i=t._n;return["ip","tags","language","timezone_id","country"].includes(i)?{...e,[i]:t.value}:{...e}}throw new Error(`Unsupported operation type: ${t.t}`)}var ms=class{yn;Ri;constructor(t,e){this.yn=t,this.Ri=e,this.yn.Ie(this)}Sn(t,e){if(0!==e)return;const i=this.vn(t);null!=i&&this.Ri.hi(i)}On(t,e){if(0!==e)return;const i=this.In(t.model,t.property,t.oldValue,t.newValue);null!=i&&this.Ri.hi(i)}},_s=class extends ms{constructor(t,e){super(t,e)}vn(t){return null}In(t,e,i,n){const s=Je();return null!=n&&"string"==typeof n?new Xn(s,t.Fe,e,n):new Zn(s,t.Fe,e)}},bs=class extends ms{constructor(t,e){super(t,e)}vn(t){return null}In(t,e,i,n){const s=Je();return new ps(s,t.Fe,e,n)}},ys=class{yn;Ri;constructor(t,e){this.yn=t,this.Ri=e,this.yn.Ie(this)}kn(){this.yn.ke(this)}xn(t,e){if(0!==e)return;const i=this.Cn(t);null!=i&&this.Ri.hi(i)}On(t,e){if(0!==e)return;const i=this.In(t.model,t.property,t.oldValue,t.newValue);null!=i&&this.Ri.hi(i)}En(t,e){if(0!==e)return;const i=this.Pn(t);null!=i&&this.Ri.hi(i)}},Ss=class t extends ys{Fi;constructor(t,e,i){super(t,e),this.Fi=i}Cn(e){const{enabled:i,notification_types:n}=t.$n(e),s=Je();return new ns({appId:s,onesignalId:this.Fi.Wi.Fe,subscriptionId:e.id,type:e.type,enabled:i,token:e.token,notification_types:n})}Pn(t){const e=Je();return new ss(e,this.Fi.Wi.Fe,t.id)}In(e){const{enabled:i,notification_types:n}=t.$n(e),s=Je();return new rs({appId:s,onesignalId:this.Fi.Wi.Fe,subscriptionId:e.id,type:e.type,enabled:i,token:e.token,notification_types:n,web_auth:e.web_auth,web_p256:e.web_p256})}static $n(t){let e,i;return t.enabled&&1===t.Re&&t.token?(e=!0,i=1):(e=!1,i=t.enabled?t.Re:-2),{enabled:e,notification_types:i}}},vs=class{Tn;An=new bn;Nn=[];Mn=!1;constructor(t){this.Tn=t}Un(t,e=0){const i=this.Nn.find(e=>e.Ce===t.Ce);i&&this.Dn(i,e),this.Ln(t,e)}Fn(t,e,i=0){const n=this.Nn.find(t=>t.Ce===e.Ce);n&&this.Dn(n,i),this.Ln(e,i,t)}ui(){return this.Nn}Rn(t){return this.Nn.find(e=>e.Ce===t)}mn(t,e=0){const i=this.Nn.find(e=>e.Ce===t);i&&this.Dn(i,e)}De(t,e){this.Wn(),this.An.xe(i=>i.On(t,e))}hn(t,e=0){this.Bn(e);for(const i of t)this.Un(i,e)}Bn(t=0){for(const e of this.Nn)e.ke(this),this.An.xe(i=>i.En(e,t)),se.delete(this.Tn,e.Ce);this.Nn=[]}Ln(t,e,i){void 0!==i?this.Nn.splice(i,0,t):this.Nn.push(t),t.Ie(this),this.Wn(),this.An.xe(i=>i.xn(t,e))}async Dn(t,e){const i=this.Nn.findIndex(e=>e.Ce===t.Ce);-1!==i&&this.Nn.splice(i,1),t.ke(this),await se.delete(this.Tn,t.Ce),this.Wn(),this.An.xe(i=>i.En(t,e))}async L(){if(!this.Tn)return;const t=await se.getAll(this.Tn),e=this.Nn.length>0;for(let i=t.length-1;i>=0;i--){const e=this.Lt(t[i]);e&&(this.Nn.unshift(e),e.Ie(this))}this.Mn=!0,e&&this.Wn()}async Wn(){if(this.Tn&&this.Mn)for(const t of this.Nn)await se.put(this.Tn,{modelId:t.Ce,modelName:this.Tn,...t.toJSON()})}Ie(t){this.An.Ie(t)}ke(t){this.An.ke(t)}get Oe(){return this.An.Oe}},Os=class extends vs{constructor(){super("operations")}async jn(){return this.L()}Lt(t){if(null===t)return pt.S("null jsonObject in OpModelStore.create"),null;if(!this.zn(t))return null;const e=t.name;let i;switch(e){case R:i=new Xn;break;case W:i=new Zn;break;case K:i=new ns;break;case V:i=new rs;break;case q:i=new ss;break;case H:i=new os;break;case z:i=new In;break;case j:i=new as;break;case B:i=new ps;break;case J:i=new Hn;break;default:throw new Error(`Unrecognized operation: ${e}`)}return i.$e(t),i}zn(t){const e=t?.name;if(!e)return pt.S("Missing 'name' attribute"),!1;const i=new Set([z]);return!(!t.onesignalId&&!i.has(e)&&(pt.S(`${e} jsonObject must have 'onesignalId' attribute`),1))}},Is=class{Fi;Zi;Xi;constructor(t,e,i){this.Fi=t,this.Zi=e,this.Xi=i}async Gi(t,e){const i=new us;i.Te(null,this.Fi.Wi),(new ds).Te(null,this.Zi.Wi);const n=[];for(const o of this.Xi.ui()){const t=new Sn;t.Te(null,o),n.push(t)}if(i.Fe!==e)return null;const s=[];s.push(new In(t,e,i.qe));const a=await OneSignal.ye.be();return a&&s.push(new ns({appId:t,onesignalId:e,subscriptionId:a.id,type:a.type,enabled:a.enabled,token:a.token,notification_types:a.Re})),s.push(new as(t,e)),s}},ks=class extends vs{Kn;constructor(t,e){super(e),this.Kn=t,this.L()}Lt(t){const e=this.Kn();return null!=t&&e.$e(t),e}},xs=class{store;changeSubscription=new bn;constructor(t){this.store=t,t.Ie(this)}get Wi(){const t=this.store.ui()[0];if(t)return t;const e=this.store.Lt();if(!e)throw new Error(`Unable to initialize model from store ${this.store.Tn}`);return this.store.Un(e),e}dn(t,e){const i=this.Wi;i.Te(i.Ce,t),this.store.Wn(),this.changeSubscription.xe(t=>t.Sn(i,e))}Ie(t){this.changeSubscription.Ie(t)}ke(t){this.changeSubscription.ke(t)}get Oe(){return this.changeSubscription.Oe}xn(){}On(t,e){this.changeSubscription.xe(i=>i.On(t,e))}En(){}},Cs=class extends xs{constructor(){super(new ks(()=>new us,"identity"))}},Es=class extends xs{constructor(){super(new ks(()=>new ds,"properties"))}},Ps=class extends ks{constructor(){super(()=>new Sn,"subscriptions")}an(t){return super.ui().find(e=>e.id===t)}hn(t,e){if(2!==e)return super.hn(t,e);for(const i of t)if(zn(i.type)){const t=this.Rn(i.Ce);t&&(i.sdk=t.sdk,i.device_os=t.device_os);break}super.hn(t,e)}},$s=class{Vn=new Map;get qn(){return this.Vn}Un(t){this.Vn.set(t,Date.now())}Hn(t){if(!t)return!0;const e=this.Vn.get(t);return!e||Date.now()-e>=500}Ji(t){const e=this.Vn.get(t);return!!e&&Date.now()-e<=15e3}},Ts=t=>{se.delete("operations",t.Ce)},As=class{Jn;ri=[];ci=[];Gn=void 0;Yn=0;Qn;qi;constructor(t,e,i){this.Qn=e,this.qi=i,this.Jn=new Map;for(const n of t)for(const t of n.Bi)this.Jn.set(t,n)}Bn(){this.ri=[]}get qn(){return this.qi.qn}get Zn(){return 0===this.Yn?0:this.Yn-1}Xn(t){return this.ri.some(e=>e.operation instanceof t)}async ts(){await this.es(),this.ns()}ss(){clearInterval(this.Gn),this.Gn=void 0,pt.p("OpRepo: Paused")}hi(t){pt.p(`OpRepo.enqueue: ${JSON.stringify(t)}`),this.rs({operation:t,bucket:this.Yn,retries:0},!0)}async cs(t){pt.p(`OpRepo.enqueueAndWait: ${JSON.stringify(t)}`),await new Promise((e,i)=>{this.rs({operation:t,bucket:this.Yn,retries:0,resolver:t=>t?e():i()},!0)})}rs(t,e,i){this.ri.some(e=>e.operation.Ce===t.operation.Ce)?pt.p(`OpRepo: duplicate modelId: ${t.operation.Ce}`):(void 0!==i?this.ri.splice(i,0,t):this.ri.push(t),e&&this.Qn.Un(t.operation))}ns(){this.Yn++;let t=!1;this.Gn=setInterval(async()=>{if(t)return pt.p("Ops in progress");const e=this.ls(this.Zn);e?(t=!0,await this.us(e),t=!1):this.Yn++},500)}async us(t){try{const e=t[0],i=this.Jn.get(e.operation.t);if(!i)throw new Error(`Could not find executor for operation ${e.operation.t}`);const n=t.map(t=>t.operation);this.ci=t;const s=await i.zi(n).finally(()=>this.ci=[]),a=s.nn;pt.p(`OpRepo: result = ${s.Ki}`),a&&(t.forEach(t=>t.operation.Ve(a)),this.ri.forEach(t=>t.operation.Ve(a)),Object.values(a).forEach(t=>this.qi.Un(t)));let o=0;switch(s.Ki){case 0:t.forEach(t=>{this.Qn.mn(t.operation.Ce)}),t.forEach(t=>t.resolver?.(!0));break;case 4:case 3:case 5:pt.S(`Op failed (no retry): ${JSON.stringify(n)}`),t.forEach(t=>{this.Qn.mn(t.operation.Ce)}),t.forEach(t=>t.resolver?.(!1));break;case 1:this.Qn.mn(e.operation.Ce),e.resolver?.(!0),t.filter(t=>t!==e).reverse().forEach(t=>this.ri.unshift(t));break;case 2:pt.S(`Op failed, retrying: ${JSON.stringify(n)}`),[...t].reverse().forEach(t=>{Ts(t.operation),t.retries++,t.retries>o&&(o=t.retries),this.ri.unshift(t)});break;case 6:pt.S(`Op failed, pausing: ${JSON.stringify(n)}`),this.ss(),t.forEach(t=>t.resolver?.(!1)),[...t].reverse().forEach(t=>{Ts(t.operation),this.ri.unshift(t)})}if(s.Bi)for(const t of[...s.Bi].reverse()){const e={operation:t,bucket:0,retries:0};this.ri.unshift(e),this.Qn.Fn(0,e.operation)}await this.ds(o,s.Hi),s.nn&&await dt(500)}catch(e){if(e===tt&&!navigator.onLine)return[...t].reverse().forEach(t=>{t.retries++,this.ri.unshift(t)}),this.ds(t[0].retries);if(pt.S(`Op execute error: ${JSON.stringify(t)}`,e),e===tt)return t.forEach(t=>t.resolver?.(!1)),[...t].reverse().forEach(t=>{t.retries++,t.resolver=void 0,this.ri.unshift(t)}),this.ds(t[0].retries);t.forEach(t=>{this.Qn.mn(t.operation.Ce)}),t.forEach(t=>t.resolver?.(!1))}}async ds(t,e){pt.p(`retryAfterSeconds: ${e}`);const i=1e3*(e||0),n=1e3*t,s=Math.max(n,i);s<1||(pt.S(`Ops delayed: ${s}ms`),await dt(s))}ls(t){if(!navigator.onLine)return null;const e=this.ri.findIndex(e=>e.operation.Ke&&this.qi.Hn(e.operation.Be)&&e.bucket<=t);if(-1!==e){const t=this.ri[e];return this.ri.splice(e,1),this.hs(t)}return null}hs(t){const e=[t];if(2===t.operation.ze)return e;const i=0===t.operation.ze?t.operation.je:t.operation.Je,n=[...this.ri];for(const s of n){const n=0===t.operation.ze?s.operation.je:s.operation.Je;if(""===n&&""===i)throw new Error("Both comparison keys cannot be blank!");if(this.qi.Hn(s.operation.Be)&&n===i){const t=this.ri.indexOf(s);-1!==t&&(this.ri.splice(t,1),e.push(s))}}return e}async es(){await this.Qn.jn();const t=[...this.Qn.ui()].reverse();for(const e of t)this.rs({operation:e,bucket:this.Yn,retries:0},!1,0)}},Ns=class{Qn;li;gs;di;Fi;Zi;oi;ps;fs;ws;constructor(){this.gs=new $s,this.Qn=new Os,this.Fi=new Cs,this.Zi=new Es,this.di=new Ps,this.fs=new Is(this.Fi,this.Zi,this.di),this.ws=this._s(),this.li=new As(this.ws,this.Qn,this.gs),this.oi=new Jn(this.Fi,this.li),this.bs(),this.ps=this.li.ts()}async ys(){return ze("CoreModule.init"),this.ps}bs(){return this.li?[new _s(this.Fi,this.li),new bs(this.Zi,this.li),new Ss(this.di,this.li,this.Fi)]:[]}_s(){const t=new ts(this.Fi,this.fs,this.gs);return[t,new cs(t,this.Fi,this.Zi,this.di),new hs(this.Fi,this.Zi,this.di,this.fs,this.gs),new gs(this.di,this.fs,this.gs),new fs(this.Fi,this.Zi,this.fs,this.gs),new Yn]}},Ms=class{type;token;enabled;notificationTypes;sdk;deviceModel;deviceOs;webAuth;webp256;constructor(t){this.token=this.Ss(t),this.type=D(),this.enabled=!0,this.notificationTypes=1,this.sdk=E,this.deviceModel=F(),this.deviceOs=L(),this.webAuth=t.w3cAuth,this.webp256=t.w3cP256dh}Ss(t){return t.w3cEndpoint?t.w3cEndpoint.toString():t.safariDeviceToken}I(){return{type:this.type,token:this.token,enabled:this.enabled,notification_types:this.notificationTypes,sdk:this.sdk,device_model:this.deviceModel,device_os:this.deviceOs,web_auth:this.webAuth,web_p256:this.webp256}}},Us=class{vs;constructor(t){this.vs=t}get li(){return this.vs.li}get Fi(){return this.vs.Fi}get Zi(){return this.vs.Zi}get di(){return this.vs.di}get gs(){return this.vs.gs}get oi(){return this.vs.oi}Os(t){ze("CoreModuleDirector.generatePushSubscriptionModel",{rawPushSubscription:t});const e=new Sn;return e.$e(new Ms(t).I()),e.id=wn.ge(),this.vs.di.Un(e,2),e}gi(t){this.vs.di.Un(t)}ei(t){this.vs.di.mn(t)}ti(){return ze("CoreModuleDirector.getEmailSubscriptionModels"),this.vs.di.ui().filter(t=>t.type===l)}Is(){const t=this.ti();return Object.keys(t).length>0}ii(){return ze("CoreModuleDirector.getSmsSubscriptionModels"),this.vs.di.ui().filter(t=>t.type===u)}ks(){const t=this.ii();return Object.keys(t).length>0}xs(){return ze("CoreModuleDirector.getAllPushSubscriptionModels"),this.vs.di.ui().filter(t=>zn(t.type))}async Cs(){ze("CoreModuleDirector.getPushSubscriptionModelByCurrentToken");const t=await Ge();if(t)return this.Es(r,t)}async Ps(){ze("CoreModuleDirector.getPushSubscriptionModelByLastKnownToken");const t=await(async()=>await ae("lastPushToken"))()??"";if(null!==t)return this.Es(r,t)}async be(){ze("CoreModuleDirector.getPushSubscriptionModel");const t=await this.Ps();return await this.Cs()||t}Qe(){return ze("CoreModuleDirector.getIdentityModel"),this.vs.Fi.Wi}Ze(){return ze("CoreModuleDirector.getPropertiesModel"),this.vs.Zi.Wi}async $s(){ze("CoreModuleDirector.getAllSubscriptionsModels");const t=this.ti(),e=this.ii(),i=await this.be();return[...t,...e,...i?[i]:[]]}Es(t,e){let i;switch(ze("CoreModuleDirector.getSubscriptionOfTypeWithToken",{type:t,token:e}),t){case"Email":i=this.ti();break;case"SMS":i=this.ii();break;case r:i=this.xs();break;default:return}return i.find(t=>t.token===e)}},Ds=class t{static Ts=Promise.resolve();static async login(e,i){await(this.Ts=t.As(e,i))}static async As(e,i){i&&se.put("Ids",{id:i,type:"jwtToken"});const n=OneSignal.ye.Qe(),s=wn.pe(n.Fe)?void 0:n.Fe,a=n.qe;if(a===e)return void pt.p("Login: externalId already set");const o=t.Ns();o.Ae(G,e,2),await t.Ms(o.Fe,e,a?void 0:s,!0)}static async logout(){await(this.Ts=t.Us())}static async Us(){if(!OneSignal.ye.Qe().qe)return pt.p("Logout: not logged in");const e=t.Ns();await t.Ms(e.Fe)}static Ns(){const t=new us,e=new ds,i=wn.ge();return t.Fe=i,e.Fe=i,OneSignal.ye.Fi.dn(t),OneSignal.ye.Zi.dn(e),OneSignal.ye.Qe()}static async Ms(t,e,i,n=!1){const s=Je();await Promise.all([OneSignal.ye.be().then(e=>{if(e)OneSignal.ye.li.hi(new os(s,t,e.id));else if(n){const e=new Sn;e.Le({enabled:!0,id:wn.ge(),onesignalId:t,type:D(),token:""}),OneSignal.ye.di.Un(e)}}),OneSignal.ye.li.cs(new In(s,t,e,i))])}};function Ls(t){const e=t.active||t.installing||t.waiting;return e||pt._("No available SW instance"),e}var Fs=class{Ds;constructor(){this.Ds={}}Ls(t,e,i){const n={callback:e,onceListenerOnly:i},s=this.Ds[t.toString()];s?s.push(n):this.Ds[t.toString()]=[n]}Fs(t){return this.Ds[t.toString()]||[]}Rs(t){this.Ds[t.toString()]=null}Ws(){this.Ds={}}Bs(t,e){const i=this.Ds[t.toString()];if(null!=i)for(let n=i.length-1;n>=0;n--)i[n]===e&&i.splice(n,1)}},Rs=class{A;Ds;constructor(t,e=new Fs){this.A=t,this.Ds=e}js(t,e){this.Ds.Ls(t,e,!1)}zs(t,e){this.Ds.Ls(t,e,!0)}Ks(t){t?this.Ds.Rs(t):this.Ds.Ws()}},Ws=class extends Rs{Vs(){T()&&this.qs()}qs(){navigator.serviceWorker.addEventListener("message",this.Hs.bind(this)),pt.p(`[WM] Page listening (${location.origin})`)}Hs(t){const e=t.data;if(!e||!e.command)return;const i=this.Ds.Fs(e.command),n=[],s=[];pt.p("[WM] Page received:",t.data);for(const a of i)a.onceListenerOnly&&n.push(a),s.push(a);for(let a=n.length-1;a>=0;a--){const t=n[a];this.Ds.Bs(e.command,t)}for(const a of s)a.callback.apply(null,[e.payload])}Js(t,e){pt.p(`[WM] Page->SW unicast '${t}'`),this.Gs(t,e)}async Gs(t,e){pt.p(`[WM] Page->SW direct '${t}'`);const i=await(this.A?.T.Ys());if(!i)return void pt.S("[WM] No SW registration for postMessage");const n=Ls(i);n?n.postMessage({command:t,payload:e}):pt.S("[WM] No SW for postMessage")}},Bs=class{Qs;Ht;We;Zs;constructor(t,e,i,n){this.Qs=i,this.Ht=e,this.We=t,this.Zs=n}async Xs(){return await async function(t){if(t.direct&&t.direct.enabled){const t=await(async()=>(await se.getAll("Outcomes.NotificationClicked")).map(t=>{return{appId:(e=t).appId,notificationId:e.notificationId,timestamp:e.timestamp};var e}))();if(t.length>0)return{type:1,notificationIds:[t[0].notificationId]}}if(t.indirect&&t.indirect.enabled){const e=60*t.indirect.influencedTimePeriodMin*1e3,i=new Date((new Date).getTime()-e).getTime(),n=await(async()=>(await se.getAll("Outcomes.NotificationReceived")).map(t=>{return{appId:(e=t).appId,notificationId:e.notificationId,timestamp:e.timestamp};var e}))();if(pt.p(`${n.length} received notifs found`),n.length>0){const e=t.indirect.influencedNotificationsLimit,s=n.slice().sort((t,e)=>e.timestamp-t.timestamp),a=s.filter(t=>t.timestamp>=i).slice(0,e).map(t=>t.notificationId);pt.p(`${a.length} notifs in reporting window`);const o=s.filter(t=>-1===a.indexOf(t.notificationId)).map(t=>t.notificationId);if(o.forEach(t=>se.delete("Outcomes.NotificationReceived",t)),pt.p(`${o.length} notifs to delete`),a.length>0)return{type:2,notificationIds:a}}}return t.unattributed&&t.unattributed.enabled?{type:3,notificationIds:[]}:{type:4,notificationIds:[]}}(this.Ht)}async ta(){return ze(this.Zs?"sendUniqueOutcome":"sendOutcome",this.Qs),this.Ht?this.Qs?(await je(),!!(await OneSignal.A.lt.ct())||(pt._("Outcomes require subscription"),!1)):(pt.S("Outcome name is required"),!1):(pt.p("Outcomes not supported yet"),!1)}async ea(){return(await se.getAll("SentUniqueOutcome")).filter(t=>t.outcomeName===this.Qs).reduce((t,e)=>[...t,...e.notificationIds||[]],[])}async ia(t){const e=await this.ea();return t.filter(t=>-1===e.indexOf(t))}na(t,e){return 3===t.type||e.length>0}async sa(t){const e=this.Qs,i=await se.get("SentUniqueOutcome",e),n=await re(),s=[...i?i.notificationIds:[],...t],a=n?n.startTimestamp:null;await se.put("SentUniqueOutcome",{outcomeName:e,notificationIds:s,sentDuringSession:a})}async aa(){const t=await se.get("SentUniqueOutcome",this.Qs);if(!t)return!1;const e=await re(),i=e&&t.sentDuringSession===e.startTimestamp,n=!e&&!!t.sentDuringSession;return i||n}async oa(t){const{type:e,notificationIds:i,weight:n}=t;switch(e){case 1:return this.Zs&&await this.sa(i),void(await OneSignal.A.Ui.ra(this.We,i,this.Qs,n));case 2:return this.Zs&&await this.sa(i),void(await OneSignal.A.Ui.ca(this.We,i,this.Qs,n));case 3:if(this.Zs){if(await this.aa())return void pt._("Unattributed unique outcome already sent this session");await this.sa([])}return void(await OneSignal.A.Ui.la(this.We,this.Qs,n));default:return void pt._("Upgrade required for this functionality")}}};function js(t,e,i){return function(t,e,i){return`${new URL(t,ht()).href}?${Ot({appId:e})}&${Ot({sdkVersion:i})}`}(t.workerPath.ua(),e,i)}var zs="OneSignal Worker",Ks="3rd Party",Vs="None",qs="GetWorkerVersion",Hs="os.session.deactivate",Js=class{da;constructor(t){if(!t)throw at("path");this.da=t.trim()}ha(){return this.da.split("?")[0]}ga(){return this.ha().split("\\").pop()?.split("/").pop()}ua(){return this.da}},Gs=class t{A;Ht;constructor(t,e){this.A=t,this.Ht=e}async $(){return async function(t){try{const e=location.origin+t;return await navigator.serviceWorker.getRegistration(e)}catch(e){return void pt._("SW registration check error",t,e)}}(this.Ht.registrationOptions.scope)}async Ys(){if(await this.pa()===zs)return this.$()}async pa(){const e=await this.$();if(!e)return Vs;const i=t.fa(e);return this.wa(i)}static fa(t){const e=Ls(t);if(!e)return null;const i=new URL(e.scriptURL).pathname,n=new Js(i).ga();if("akam-sw.js"==n){const t=new URLSearchParams(new URL(e.scriptURL).search).get("othersw");if(t)return pt.p("Found SW under akam-sw.js?othersw=",t),new Js(new URL(t).pathname).ga()}return n}wa(t){return t?t==this.Ht.workerPath.ga()?zs:Ks:Vs}async ma(){return new Promise(t=>{this.A._a.zs(qs,e=>{t(e)}),this.A._a.Js(qs)})}async ba(){if(!T())return!1;if(!OneSignal.config)return!1;const t=await this.pa();if(pt.p("shouldInstallWorker state:",t),t===Vs||t===Ks){const t="granted"===OneSignal.A.Tt.xi(OneSignal.config.safariWebId);return t&&pt.m("Permissions enabled, installing SW"),t}return!!(await this.ya())||this.Sa()}async ya(){const t=await this.$();if(!t)return pt.m("SW registration not found at scope",this.Ht.registrationOptions.scope),!0;const e=new URL(t.scope).pathname,i=this.Ht.registrationOptions.scope;if(e!=i)return pt.m("SW scope changing",{a_old:e,b_new:i}),!0;const n=Ls(t),s=js(this.Ht,this.A._i.appId,E);return!n?.scriptURL||s!==n.scriptURL&&(pt.m("SW href changing:",{a_old:n?.scriptURL,b_new:s}),!0)}async Sa(){let t;pt.m("Checking SW version...");try{t=await function(t){const e=new Promise((t,e)=>{setTimeout(()=>{e(new Error("Async operation timed out"))},2e3)});return Promise.race([t,e])}(this.ma())}catch{return pt.m("SW did not reply to version query, updating"),!0}return"160801"!==t?(pt.m(`Updating SW ${t} -> ${E}`),!0):(pt.m(`SW version current: ${t}`),!1)}Ci(){pt.p("establishSWChannel");const t=this.A._a;t.Ks(),t.js("notification.willDisplay",e=>{pt.p(location.origin,"Notif display event from SW");let i=!1;const n=e.notification.notificationId,s={notification:{...e.notification,display:()=>{pt.p(`display() called: ${n}`),t.Js("notification.display",{notification:e.notification})}},preventDefault:function(){pt.p(`preventDefault() called: ${n}`),i=!0}};cn.re(OneSignal.EVENTS.NOTIFICATION_WILL_DISPLAY,s),pt.p(`preventDefault response: ${i} for: ${n}`),t.Js("notification.willDisplay.response",{notificationId:n,preventDefault:i})}),t.js("notification.clicked",t=>{0===OneSignal.P.he(OneSignal.EVENTS.NOTIFICATION_CLICKED)?pt.p("Click event with no listeners, storing for later"):function(t){const e={notification:t.notification,result:t.result};cn.re(OneSignal.EVENTS.NOTIFICATION_CLICKED,e)}(t)}),t.js("notification.dismissed",t=>{cn.re(OneSignal.EVENTS.NOTIFICATION_DISMISSED,t)});const e=$();t.js("os.page_focused_request",async i=>{if(e){const e={timestamp:i.timestamp,focused:document.hasFocus()};await t.Gs("os.page_focused_response",e)}})}async va(){if(!(await this.ba()))return this.Ys();pt.m("Installing worker..."),await this.pa()===Ks&&pt.m("3rd party SW detected");const t=js(this.Ht,this.A._i.appId,E),e=`${ht()}${this.Ht.registrationOptions.scope}`;pt.m(`Installing SW ${t} ${e}`);const i=await navigator.serviceWorker.register(t,{scope:e,type:void 0});return pt.p("SW installed, waiting for activation"),await function(t){return new Promise(e=>{const i=t.installing||t.waiting;i&&i.addEventListener("statechange",()=>{pt.p("SW state:",i.state),t.active&&e()}),t.active&&e()})}(i),pt.p("SW active"),this.Ci(),i}},Ys=class t{w3cEndpoint;w3cP256dh;w3cAuth;safariDeviceToken;static Oa(e){const i=new t;if(e&&(i.w3cEndpoint=new URL(e.endpoint),e.getKey)){let t=null;try{t=e.getKey("p256dh")}catch{}let n=null;try{n=e.getKey("auth")}catch{}t&&(i.w3cP256dh=btoa(String.fromCharCode(...new Uint8Array(t)))),n&&(i.w3cAuth=btoa(String.fromCharCode(...new Uint8Array(n))))}return i}Ia(t){t&&(this.safariDeviceToken=t)}I(){return{w3cEndpoint:this.w3cEndpoint?this.w3cEndpoint.toString():null,w3cP256dh:this.w3cP256dh,w3cAuth:this.w3cAuth,safariDeviceToken:this.safariDeviceToken}}static k(e){const i=new t;if(!e)return i;try{i.w3cEndpoint=new URL(e.w3cEndpoint)}catch{}return i.w3cP256dh=e.w3cP256dh,i.w3cAuth=e.w3cAuth,i.safariDeviceToken=e.safariDeviceToken,i}},Qs=class t{A;Ht;constructor(t,e){this.A=t,this.Ht=e}async Oi(t,e){t&&(t=Ys.k(t)),await this.Ti()?"Ui"in this.A&&await this.A.Ui.ka():"Ni"in this.A&&this.A.Ni.xa(1);const i=await ve();return i.deviceId="99999999-9999-9999-9999-999999999999",i.optedOut=!1,t?N()?i.subscriptionToken=t.safariDeviceToken:i.subscriptionToken=t.w3cEndpoint?t.w3cEndpoint.toString():null:i.subscriptionToken=null,await Oe(i),cn.re(OneSignal.EVENTS.REGISTERED),"undefined"!=typeof OneSignal&&(OneSignal.Ii=!1),i}async Ti(){const{deviceId:t}=await ve();return!!t}async Ca(e,i){const n=await e.getSubscription();switch(i){case rn.ae:if(!n)break;n.options?pt.p("Existing push sub options present"):(pt.p("Existing push sub options null, unsubscribing first"),await t.Ea(n));break;case rn.oe:n&&await t.Ea(n)}const[s,a]=await t.Pa(e,this.$a());return await t.Ta(a,s.expirationTime),Ys.Oa(s)}$a(){let t;return t=k()===m?this.Ht.onesignalVapidPublicKey:this.Ht.vapidPublicKey,t?function(t){const e=(t+"=".repeat((4-t.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),i=atob(e),n=new Uint8Array(i.length);for(let s=0;s{await Ds.Ts;let e=await OneSignal.ye.be();if(!e)return e=OneSignal.ye.Os(t),Xs(e);if(wn.pe(e.id))return Xs(e);const i=new Ms(t).I();for(const n in i){const t=n;e.Ae(t,i[t])}},ea=class t extends Qs{Aa=!1;async ct(){const t=await this.Na();return t.subscribed&&!t.optedOut}async wi(){const t=await this.Ma();await this.Ua(t)}async Ua(t){const e=await OneSignal.ye.be();e?(e.Re=t,e.enabled=1===t):pt.m("No push sub to update notification_types")}async Ma(){const{optedOut:t}=await ve();return t?-2:"granted"===await OneSignal.A.Tt.$t()?1:0}async fi(){const t=await this.Na();return"granted"===await OneSignal.A.Tt.$t()&&!t.optedOut}async ki(t){ze("isOptedOut",t);const{optedOut:e}=await ve();return function(t,...e){t&&t.apply(null,e)}(t,e),e}ke(t){throw Zs}async Na(){const{optedOut:t,subscriptionToken:e}=await ve(),i=mn(await OneSignal.ye.be());if(N()){const n=window.safari?.pushNotification?.permission(this.Ht.safariWebId);return{subscribed:!!(i&&e&&"granted"===n?.permission&&n?.deviceToken),optedOut:!!t}}const n=await this.A.T.Ys(),s=this.A.Tt.xi(this.A._i.safariWebId);return n?{subscribed:!(!i||!e||"granted"!==s),optedOut:!!t}:{subscribed:!1,optedOut:!!t}}async Ie(t){let e;if("denied"===await OneSignal.A.Tt.$t())throw et;if(N()){e=await this.Da(),await ta(e),pt.m("Installing SW on Safari");try{await this.A.T.va(),pt.m("Safari SW installed")}catch{pt.S("Safari SW install failed")}}else e=await this.La(t),await ta(e);return e}async Da(){const t=new Ys;if(!this.Ht.safariWebId)throw nt;const{deviceToken:e}=window.safari?.pushNotification?.permission(this.Ht.safariWebId)||{};if(e)return t.Ia(e.toLowerCase()),t;cn.re(OneSignal.EVENTS.PERMISSION_PROMPT_DISPLAYED);const i=await this.Fa();if(Wn(),!i)throw this.Aa=!0,new Error("Safari url/icon/certificate invalid or in private mode");return t.Ia(i),t}async Fa(){const t=t=>new Promise(e=>{window.safari?.pushNotification?.requestPermission(t,this.Ht.safariWebId,{app_id:this.Ht.appId},t=>{t&&t.deviceToken?e(t.deviceToken.toLowerCase()):e(null)})});return this.Aa?t(`${U({legacy:!0}).toString()}safari`):t(`${U({legacy:!0}).toString()}safari/apps/${this.Ht.appId}`)}async La(e){if("default"===Notification.permission){cn.re(OneSignal.EVENTS.PERMISSION_PROMPT_DISPLAYED);const e=await t.Ra();switch(await Wn("default"===e),e){case"default":throw pt.p("Permission dismissed, exiting subscription"),OneSignal.Ii=!1,new Error("Permission dismissed");case"denied":throw pt.p("Permission blocked, exiting subscription"),OneSignal.Ii=!1,et}}let i;try{i=await this.A.T.va()}catch(n){throw n instanceof Q&&(403===n.status?this.A.lt.Wa(-23):404===n.status&&this.A.lt.Wa(-24)),n}if(!i)throw new Error("OneSignal service worker not found!");return pt.p("SW ready, continuing subscription"),await this.Ca(i.pushManager,e)}Wa(t){gn()&&(this.A.lt.Oi(new Ys,t),hn())}static async Ra(){return await t.Ba()}static async Ba(){return await window.Notification.requestPermission()}async $i(){if(await this.A.T.pa()!==zs)return!1;const t=await this.A.T.Ys();if(!t)return!1;if(!t.pushManager)return!1;const e=await t.pushManager.getSubscription();if(!e)return!1;if(!e.expirationTime)return!1;let{createdAt:i}=await ve();i||(i=(new Date).getTime()+31536e6);const n=i+(e.expirationTime-i)/2;return!!e.expirationTime&&((new Date).getTime()>=e.expirationTime||(new Date).getTime()>=n)}},ia=class t{$t(){return OneSignal.A?Promise.resolve(OneSignal.A.Tt.xi(OneSignal.config.safariWebId)):Promise.reject(new Error("OneSignal.context is undefined. Call init first"))}xi(e){return N()?t.ja(e):this.za()}static ja(t){if(t)return window.safari?.pushNotification?.permission(t).permission;throw at("safariWebId")}za(){return Notification.permission}},na=class{A;Ka=!1;constructor(t){this.A=t}Va(t,e,i){const n={onesignalId:t,subscriptionId:e,appId:this.A._i.appId,sessionThreshold:this.A._i.sessionThreshold||0,enableSessionDuration:!!this.A._i.enableSessionDuration,sessionOrigin:i,isSafari:$(),outcomesConfig:this.A._i.userConfig.outcomes};return T()?(pt.p("SW upsert session"),this.A._a.Js("os.session.upsert",n)):pt.p("Upsert: no-op"),Promise.resolve()}qa(t,e,i){const n={appId:this.A._i.appId,subscriptionId:e,onesignalId:t,sessionThreshold:this.A._i.sessionThreshold,enableSessionDuration:this.A._i.enableSessionDuration,sessionOrigin:i,isSafari:$(),outcomesConfig:this.A._i.userConfig.outcomes};return T()?(pt.p("SW deactivate session"),this.A._a.Js(Hs,n)):pt.p("Deactivate: no-op"),Promise.resolve()}async Ha(){const t=OneSignal.ye.Qe(),e=await OneSignal.ye.be();if(!t||!t.Fe)throw new Error("No identity");if(!e||!mn(e))throw new Error("No subscription");const{Fe:i}=t,{id:n}=e;return{onesignalId:i,subscriptionId:n}}async Ja(){if(await Ds.Ts,xn.Ge?.onesignalId)try{const t=document.visibilityState,{onesignalId:e,subscriptionId:i}=await this.Ha();if("visible"===t)return this.Ga(),pt.p("handleVisibilityChange","visible",`hasFocus: ${document.hasFocus()}`),void(document.hasFocus()&&await this.Va(e,i,3));if("hidden"===t)return pt.p("handleVisibilityChange","hidden"),OneSignal.N.focusHandler&&OneSignal.N.isFocusEventSetup&&(window.removeEventListener("focus",OneSignal.N.focusHandler,!0),OneSignal.N.isFocusEventSetup=!1),OneSignal.N.blurHandler&&OneSignal.N.isBlurEventSetup&&(window.removeEventListener("blur",OneSignal.N.blurHandler,!0),OneSignal.N.isBlurEventSetup=!1),void(await this.qa(e,i,4));pt._("Unhandled visibility state",t)}catch(t){pt.S("Visibility change error:",t)}}async Ya(){if(await Ds.Ts,xn.Ge?.onesignalId)try{const{onesignalId:t,subscriptionId:e}=await this.Ha(),i={appId:this.A._i.appId,onesignalId:t,subscriptionId:e,sessionThreshold:this.A._i.sessionThreshold,enableSessionDuration:this.A._i.enableSessionDuration,sessionOrigin:5,isSafari:$(),outcomesConfig:this.A._i.userConfig.outcomes};pt.p("SW deactivate (beforeunload)"),this.A._a.Gs(Hs,i)}catch(t){pt.S("beforeunload error:",t)}}async Qa(t){if(await Ds.Ts,pt.p("handleOnFocus",t),xn.Ge?.onesignalId)try{if(t.target!==window)return;const{onesignalId:e,subscriptionId:i}=await this.Ha();await this.Va(e,i,7)}catch(t){pt.S("Focus error:",t)}}async Za(t){if(await Ds.Ts,pt.p("handleOnBlur",t),xn.Ge?.onesignalId)try{if(t.target!==window)return;const{onesignalId:e,subscriptionId:i}=await this.Ha();await this.qa(e,i,8)}catch(t){pt.S("Blur error:",t)}}async xa(t){if(await Ds.Ts,xn.Ge?.onesignalId){const{onesignalId:e,subscriptionId:i}=await this.Ha();await this.Va(e,i,t)}T()?this.Ai():OneSignal.P.ce(OneSignal.EVENTS.SESSION_STARTED)}Ai(){T()?(this.Ga(),OneSignal.N.isVisibilityChangeEventSetup||(document.addEventListener("visibilitychange",this.Ja.bind(this),!0),OneSignal.N.isVisibilityChangeEventSetup=!0),OneSignal.N.isBeforeUnloadEventSetup||(window.addEventListener("beforeunload",t=>{this.Ya(),delete t.returnValue},!0),OneSignal.N.isBeforeUnloadEventSetup=!0)):pt.p("No SW support, skipping session listeners")}Ga(){pt.p("setupOnFocusAndOnBlurForSession"),OneSignal.N.focusHandler||(OneSignal.N.focusHandler=this.Qa.bind(this)),OneSignal.N.isFocusEventSetup||(window.addEventListener("focus",OneSignal.N.focusHandler,!0),OneSignal.N.isFocusEventSetup=!0),OneSignal.N.blurHandler||(OneSignal.N.blurHandler=this.Za.bind(this)),OneSignal.N.isBlurEventSetup||(window.addEventListener("blur",OneSignal.N.blurHandler,!0),OneSignal.N.isBlurEventSetup=!0)}async Xa(){if(this.Ka||!gn())return;const t=OneSignal.ye.Qe().Fe;if(!t)return void pt.p("No onesignal id, skipping on_session");const e=await OneSignal.ye.be();if(1!==e?.Re&&!0!==OneSignal.config?.enableOnSession)return;let i;mn(e)&&(i=e?.id);try{const e={label:Y,id:t},s={refresh_device_metadata:!0,deltas:{session_count:1}},a=Je();(function(t){if(!t)throw new Error("App id cannot be empty")})(a),function(t){if(!t.label)throw new Error("Alias label cannot be empty");if(!t.id)throw new Error("Alias id cannot be empty")}(e);try{await vt({appId:a,subscriptionId:i},e,s),this.Ka=!0}catch(n){pt.p("Session update error:",n)}}catch(n){n instanceof Error&&pt.S(`Session update failed: "${n.message}" ${n.stack}`)}}},sa=class{A;Ka;constructor(t){this.A=t,this.Ka=dn()>1}async ka(){xn.Ge?.onesignalId?this.Ka||await this.Mi():pt.p("Update skipped: no onesignal_id")}async Mi(){if(!this.Ka&&gn())if(await this.A.lt.Ti()){if(1===(await OneSignal.ye.be())?.Re||!0===OneSignal.config?.enableOnSession)try{this.A.Ni.xa(2),this.Ka=!0}catch(t){t instanceof Error&&pt.S(`Session update failed: ${t.message}`,t.stack)}}else pt.p("On session skipped: no device id")}async ra(t,e,i,n){ze("sendOutcomeDirect");const s=await OneSignal.ye.be();if(s&&mn(s)){const a={id:i,app_id:t,notification_ids:e,direct:!0,subscription:{id:s.id,type:D()}};return void 0!==n&&(a.weight=n),void(await It(a))}pt._("Outcome aborted: no push sub model")}async ca(t,e,i,n){ze("sendOutcomeInfluenced");const s=await OneSignal.ye.be();if(s&&mn(s)){const a={id:i,app_id:t,notification_ids:e,direct:!1,subscription:{id:s.id,type:D()}};return void 0!==n&&(a.weight=n),void(await It(a))}pt._("Outcome aborted: no push sub model")}async la(t,e,i){ze("sendOutcomeUnattributed");const n=await OneSignal.ye.be();if(n&&mn(n)){const s={id:e,app_id:t,subscription:{id:n.id,type:D()}};return void 0!==i&&(s.weight=i),void(await It(s))}pt._("Outcome aborted: no push sub model")}},aa=class t{eo=!0;io=!0;no;so;constructor(t){this.no=t}ao(){const t=document.createElement("div");let e,i,n;switch(Pe(t,Ki),t.id=Ki,this.no.type){case Tt:e=this.no.text.smsLabel||"Phone Number",i=this.oo(Tt,e),t.appendChild(i);break;case At:e=this.no.text.emailLabel||"Email",n=this.oo(At,e),t.appendChild(n);break;case Nt:e=this.no.text.emailLabel||"Email",n=this.oo(At,e),t.appendChild(n),e=this.no.text.smsLabel||"Phone Number",i=this.oo(Tt,e),t.appendChild(i)}return t}ro(t){const e=document.createElement("div"),i=document.createElement("img"),n=document.createElement("p");return n.innerText=t,i.setAttribute("src","data:image/svg+xml;charset=UTF-8,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.98775 -0.00114406C5.85015 0.0338508 3.81219 0.908665 2.31442 2.43419C1.565 3.18031 0.973715 4.06987 0.575897 5.04969C0.17808 6.02952 -0.0180997 7.07949 -0.000914196 8.13686C-0.00214385 9.17005 0.200528 10.1933 0.595487 11.148C0.990446 12.1028 1.56993 12.9702 2.30072 13.7005C3.03151 14.4309 3.89925 15.0098 4.85421 15.4042C5.80916 15.7986 6.83256 16.0007 7.86575 15.9989H8.00842C10.1467 15.9769 12.1889 15.1075 13.6869 13.5816C15.185 12.0557 16.0165 9.99781 15.9991 7.85952C16.0015 6.8138 15.7949 5.77814 15.3913 4.81345C14.9876 3.84876 14.3952 2.97451 13.6488 2.24213C12.9023 1.50974 12.017 0.933994 11.0448 0.548751C10.0726 0.163508 9.03324 -0.0234551 7.98775 -0.00114406ZM6.99909 11.0269C6.99428 10.8961 7.01558 10.7658 7.06175 10.6434C7.10792 10.521 7.17803 10.4091 7.26797 10.3141C7.35792 10.2191 7.4659 10.143 7.58559 10.0903C7.70529 10.0375 7.8343 10.0092 7.96509 10.0069H7.98309C8.24616 10.0074 8.49882 10.1097 8.6881 10.2924C8.87739 10.4751 8.9886 10.724 8.99842 10.9869C9.00331 11.1176 8.98207 11.248 8.93594 11.3704C8.8898 11.4928 8.8197 11.6048 8.72974 11.6998C8.63978 11.7948 8.53176 11.8709 8.41202 11.9236C8.29229 11.9763 8.16323 12.0046 8.03242 12.0069H8.01442C7.75145 12.006 7.49897 11.9036 7.30976 11.721C7.12054 11.5383 7.00923 11.2896 6.99909 11.0269ZM7.33242 8.33219V4.33219C7.33242 4.15538 7.40266 3.98581 7.52768 3.86079C7.65271 3.73576 7.82227 3.66552 7.99909 3.66552C8.1759 3.66552 8.34547 3.73576 8.47049 3.86079C8.59551 3.98581 8.66575 4.15538 8.66575 4.33219V8.33219C8.66575 8.509 8.59551 8.67857 8.47049 8.80359C8.34547 8.92862 8.1759 8.99886 7.99909 8.99886C7.82227 8.99886 7.65271 8.92862 7.52768 8.80359C7.40266 8.67857 7.33242 8.509 7.33242 8.33219Z' fill='%23E54B4D'/%3e%3c/svg%3e"),e.appendChild(i),e.appendChild(n),e}oo(t,e){const i=this.co(t),n=document.createElement("label"),s=document.createElement("input"),a=document.createElement("div"),o=document.createElement("div"),r=this.ro(i.message),c=document.createElement("div");return a.setAttribute("style","clear:both"),o.setAttribute("style","clear:both"),Pe(r,qi),Pe(r,"onesignal-validation-element"),r.id=i.validationElementId,n.title=e,n.innerText=e,n.htmlFor=i.inputElementId,s.type=i.domElementType,s.id=i.inputElementId,s.tabIndex=i.tabIndex,Pe(s,i.inputClass),Pe(c,"input-with-validation-element"),c.id=i.wrappingDivId,c.appendChild(n),c.appendChild(a),c.appendChild(s),c.appendChild(o),c.appendChild(r),c}co(t){if(t===At)return{message:"Please enter a valid email",domElementType:"email",validationElementId:Zi,inputElementId:Yi,inputClass:"onesignal-email-input",wrappingDivId:Ji,tabIndex:1};if(t===Tt)return{message:"Please enter a valid phone number",domElementType:"tel",validationElementId:Qi,inputElementId:Gi,inputClass:"iti-onesignal-sms-input",wrappingDivId:Hi,tabIndex:2};throw new Error("invalid channel type for input validation")}lo(){const t=Ee(`#${Gi}`);t&&window.intlTelInput?this.so=window.intlTelInput(t,{autoPlaceholder:"off",separateDialCode:!0}):pt.S("Failed to init phone input library")}uo(){const t=Ee(`#${Gi}`);t.addEventListener("keyup",e=>{this.eo=this.so?.isValidNumber()||""===t?.value,"Enter"===e.key&&document.getElementById(Ai)?.click(),this.do()}),t.addEventListener("blur",()=>{this.eo=this.so?.isValidNumber()||""===t?.value,this.do()})}ho(){const e=Ee(`#${Yi}`);e.addEventListener("keyup",i=>{const n=e?.value;this.io=t.po(n),"Enter"===i.key&&document.getElementById(Ai)?.click(),this.fo()})}do(){const t=Ee(`#${Hi}`),e=Ee(`#${Qi}`);$e(t,Vi),Pe(e,qi)}fo(){const t=Ee(`#${Ji}`),e=Ee(`#${Zi}`);$e(t,Vi),Pe(e,qi)}async wo(){if(OneSignal.mo)return;const t=document.createElement("script"),e=document.createElement("script"),i=document.createElement("link");t.src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.12/js/intlTelInput.min.js",e.src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.12/js/utils.js",i.href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.12/css/intlTelInput.min.css",i.rel="stylesheet",t.integrity="sha512-OnkjbJ4TwPpgSmjXACCb5J4cJwi880VRe+vWpPDlr8M38/L3slN5uUAeOeWU2jN+4vN0gImCXFGdJmc0wO4Mig==",e.integrity="sha512-bUcJxlqkiGA3cmoYPuZaLRsyc5ChG9APG4ajom2AXKSlBtOmx4kLV3c8uv/6uSz43FMjI4Q2QI21+D223rT76w==",i.integrity="sha512-yye/u0ehQsrVrfSd6biT17t39Rg9kNc+vENcCXZuMz2a+LWFGvXUnYuWUW6pbfYj1jcBb/C39UZw2ciQvwDDvg==",t.crossOrigin="anonymous",e.crossOrigin="anonymous",i.crossOrigin="anonymous",document.head.appendChild(t),document.head.appendChild(e),document.head.appendChild(i);const n=new Promise(e=>{t.onload=()=>{e()}}),s=new Promise(t=>{e.onload=()=>{t()}});await Promise.all([n,s]),OneSignal.mo=!0}async _o(){const e=t.bo(this.no.type),i=t.yo(this.no.type);e&&await this.wo();const n=this.ao();Ee(`#${Ni}`).appendChild(n),e&&(this.lo(),this.uo()),i&&this.ho()}So(){return""===this.vo()}Oo(){return""===this.Io()}vo(){return Ee(`#${Yi}`)?.value||""}Io(){return this.so?.getNumber(window.intlTelInputUtils?.numberFormat.E164)||""}static ko(t){const e=document.querySelector(`#${Qi}`),i=document.querySelector(`#${Hi}`);e&&i?t?(e.classList.remove(qi),i.classList.add(Vi)):(e.classList.add(qi),i.classList.remove(Vi)):pt.S("Missing validation element")}static xo(t){const e=document.querySelector(`#${Zi}`),i=document.querySelector(`#${Ji}`);e&&i?t?(e.classList.remove(qi),i.classList.add(Vi)):(e.classList.add(qi),i.classList.remove(Vi)):pt.S("Missing validation element")}static Co(e){switch(e){case Tt:t.ko(!1);break;case At:t.xo(!1);break;case Nt:t.ko(!1),t.xo(!1)}}static po(t){return/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(t||"")||""===t}static bo(t){return t===Tt||t===Nt}static yo(t){return t===At||t===Nt}};function oa(t){return` `}var ra=class t{it;nt;Eo;Po;$o;To="Saving...";Ao=Ft;No;Mo;Uo;constructor(t){switch(this.it=t,this.it.text.actionMessage=t.text.actionMessage.substring(0,90),this.it.text.acceptButton=t.text.acceptButton.substring(0,16),this.it.text.cancelButton=t.text.cancelButton.substring(0,16),this.nt=null,this.Eo=null,this.Po=!1,t.type){case $t:this.Uo=this.it.text.negativeUpdateButton?.substring(0,16),this.Mo=this.it.text.positiveUpdateButton?.substring(0,16),this.No=this.it.text.updateMessage?.substring(0,90),this.$o=t.categories,this.Ao=this.it.text.positiveUpdateButton??Ft;break;case Tt:case At:case Nt:this.Ao=this.it.text.acceptButton??Ft}}async Lt(t){if(null===this.nt){const e=await He();this.nt=e,this.Ut.className.includes(Oi)&&Ce(`#${Di}`);const i=t&&this.$o?this.Mo:this.it.text.acceptButton,n=t&&this.$o?this.Uo:this.it.text.cancelButton,s=function(t){const{icon:e,iconAlt:i,messageText:n,positiveButtonText:s,negativeButtonText:a}=t,o=e===$i?"data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M33.232 28.434a2.5 2.5 0 001.768.733 1.667 1.667 0 010 3.333H5a1.667 1.667 0 110-3.333 2.5 2.5 0 002.5-2.5v-8.104A13.262 13.262 0 0118.333 5.122V1.667a1.666 1.666 0 113.334 0v3.455A13.262 13.262 0 0132.5 18.563v8.104a2.5 2.5 0 00.732 1.767zM16.273 35h7.454a.413.413 0 01.413.37 4.167 4.167 0 11-8.28 0 .417.417 0 01.413-.37z' fill='%23BDC4CB'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Cpath fill='%23fff' d='M0 0h40v40H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E":e,r=e===$i?$i:"",c=document.createElement("div"),l=document.createElement("div"),u=document.createElement("div"),d=document.createElement("div"),h=document.createElement("div"),g=document.createElement("div"),p=document.createElement("button"),f=document.createElement("button"),w=document.createElement("div"),m=document.createElement("div"),_=document.createElement("img");return Pe(l,"slidedown-body"),Pe(d,"slidedown-body-icon"),Pe(u,"slidedown-body-message"),Pe(g,"slidedown-footer"),Pe(w,Ti),Pe(m,Ti),Pe(p,Wi),Pe(p,"primary"),Pe(p,Bi),Pe(f,Wi),Pe(f,"secondary"),Pe(f,Bi),c.id="normal-slidedown",l.id=Ni,h.id=Ri,p.id=Ai,f.id=Ui,g.id=Fi,r&&Pe(_,r),_.setAttribute("alt",i??"notification icon"),_.setAttribute("src",o||""),u.innerText=n||"",p.innerText=s||"",f.innerText=a||"",d.appendChild(_),l.appendChild(d),l.appendChild(u),l.appendChild(w),l.appendChild(h),g.appendChild(p),g.appendChild(f),g.appendChild(m),c.appendChild(l),c.appendChild(g),c}({messageText:t&&this.$o?this.No:this.it.text.actionMessage,icon:this.it.icon||this.Do(),iconAlt:this.it.text.iconAlt,positiveButtonText:i,negativeButtonText:n}),a=document.createElement("div"),o=document.createElement("div");a.id=Di,Pe(a,Oi),Pe(a,ki),Ee("body").appendChild(a),o.id=Li,Pe(o,Ii),o.appendChild(s),this.Ut.appendChild(o),Pe(this.Ut,O()?Ci:Ei),this.Lo.addEventListener("click",this.Fo.bind(this)),this.Ro.addEventListener("click",this.Wo.bind(this))}}static Bo(t){cn.re(t)}Fo(e){t.Bo(t.EVENTS.ALLOW_CLICK)}Wo(e){t.Bo(t.EVENTS.CANCEL_CLICK),this.kn(),t.Bo(t.EVENTS.CLOSED)}kn(){Pe(this.Ut,Pi),Ke(this._t,"animationend",(t,e)=>{t.target!==this._t||"slideDownExit"!==t.animationName&&"slideUpExit"!==t.animationName||(Ce(`#${Di}`),e())},!0)}jo(){this.Lo.disabled=!0,this.Lo.textContent=null,this.Lo.insertAdjacentElement("beforeend",this.zo(this.To)),this.Lo.insertAdjacentElement("beforeend",this.Ko()),xe(this.Vo,"beforeend",oa("#FFFFFF")),Pe(this.Lo,"disabled"),Pe(this.Lo,xi)}qo(){this.Lo.textContent=this.Mo??"",Ce(`#${vi}`),this.Lo.disabled=!1,$e(this.Lo,"disabled"),$e(this.Lo,xi)}Ho(){this.Lo.textContent=null,this.Lo.insertAdjacentElement("beforeend",this.zo(this.Ao)),this.it.type===$t&&(this.Lo.insertAdjacentElement("beforeend",this.Ko()),xe(this.Vo,"beforeend",function(t="#FFFFFF"){return``}()),Pe(this.Lo,"onesignal-error-state-button")),this.Po=!0}Jo(t){switch(t){case 0:aa.ko(!0);break;case 1:aa.xo(!0);break;case 2:aa.ko(!0),aa.xo(!0)}}Go(){Ce("#onesignal-button-indicator-holder"),$e(this.Lo,"onesignal-error-state-button"),Dn(this.it.type)||aa.Co(this.it.type),this.Po=!1}Do(){return qe(this.nt)}Ko(){const t=document.createElement("div");return t.id=Mi,Pe(t,vi),t}zo(t){const e=document.createElement("span");return e.textContent=t,e}get Ut(){return Ee(`#${Di}`)}get _t(){return Ee(`#${Li}`)}get Lo(){return Ee(`#${Ai}`)}get Ro(){return Ee(`#${Ui}`)}get Vo(){return Ee(`#${Mi}`)}get Yo(){return Ee(`#${Fi}`)}static get EVENTS(){return{ALLOW_CLICK:"slidedownAllowClick",CANCEL_CLICK:"slidedownCancelClick",SHOWN:"slidedownShown",CLOSED:"slidedownClosed",QUEUED:"slidedownQueued"}}},ca=class{Qo;A;Zo;constructor(t){this.Qo=!1,this.A=t,this.Zo=!1}Xo(){const t=x();return k()===p&&t>=63&&(v()||O())||C()}Ei(){const t=OneSignal.config?.userConfig.promptOptions,e=this.Xo(),i=this.tr(t,Et),n=this.er(i),s=i.enabled&&n,a=e&&s;if(s&&!a)return void this.ir(Et,i.timeDelay||0);const o=!!Un(t?.slidedown?.prompts,Pt);a&&!o&&this.ir(Pt,i.timeDelay||0);const r=t?.slidedown?.prompts;if(r&&r?.length>0)for(let c=0;c0&&await dt(1e3*e),t){case Et:await this.nr();break;case Pt:await this.sr(i);break;case $t:await this.ar(i);break;case Tt:await this.rr(i);break;case At:await this.cr(i);break;case Nt:await this.lr(i);break;default:pt.S("Invalid Delayed Prompt type")}else pt.S("timeDelay not a number")}async nr(){if(ze("internalShowNativePrompt"),this.Qo)return pt.p("Autoprompt already showing"),!1;this.Qo=!0;const t=await Vn();return this.Qo=!1,We(0),t}async sr(t={force:!1}){ze("internalShowSlidedownPrompt"),t.slidedownPromptOptions||(t.slidedownPromptOptions=jt),0===await this.A.Ft.U()?(this.Zo||this.ur(),await this.A.hr.dr(t)):pt.p("Slidedown styles failed to load")}async ar(t){ze("internalShowCategorySlidedown"),await this.gr($t,t)}async rr(t){ze("internalShowSmsSlidedown"),await this.gr(Tt,t)}async cr(t){ze("internalShowEmailSlidedown"),await this.gr(At,t)}async lr(t){ze("internalShowSmsAndEmailSlidedown"),await this.gr(Nt,t)}async gr(t,e){const i=this.A._i.userConfig.promptOptions?.slidedown?.prompts,n=e?.slidedownPromptOptions||Un(i,t);if(!n){if(t!==Pt)return void pt.S(`Slidedown type '${t}' not configured`);pt._("Push slidedown shown with default text")}await this.sr({...e,slidedownPromptOptions:n})}ur(){this.Zo=!0,OneSignal.P.on(ra.EVENTS.SHOWN,()=>{this.A.hr.pr(!0)}),OneSignal.P.on(ra.EVENTS.CLOSED,()=>{this.A.hr.pr(!1),this.A.hr.wr()}),OneSignal.P.on(ra.EVENTS.ALLOW_CLICK,async()=>{await this.A.hr.mr(),cn.re(OneSignal.EVENTS.TEST_FINISHED_ALLOW_CLICK_HANDLING)}),OneSignal.P.on(ra.EVENTS.CANCEL_CLICK,()=>{if(this.A.hr._r)switch(this.A.hr._r?.it.type){case Pt:case $t:pt.p("Marking slidedown dismissed"),We(0);break;default:pt.p("Marking slidedown dismissed"),We(1)}})}er(t){return!(!t||void 0===t.pageViews)&&!(!t.autoPrompt||!t.enabled)&&we()>=t.pageViews}tr(t,e){const i={enabled:!1,autoPrompt:!1,timeDelay:Mt.timeDelay,pageViews:Mt.pageViews};if(!t||!t.native||!t.slidedown)return i;switch(e){case Et:{const e=t.native;return{enabled:e?.enabled,autoPrompt:e?.autoPrompt,timeDelay:e?.timeDelay,pageViews:e?.pageViews}}case Pt:case $t:case At:case Tt:case Nt:{const{userConfig:t}=this.A._i,i=Un(t.promptOptions?.slidedown?.prompts||[],e);return{enabled:!!i,autoPrompt:!!i?.autoPrompt,timeDelay:i?.delay?.timeDelay,pageViews:i?.delay?.pageViews}}default:return i}}};function la(t,e){t.forEach(t=>{t.checked=e})}function ua(t){return 0===Object.keys(t).length}var da=class t{et;constructor(t){this.et=t}j(){const e=document.createElement("div"),i=document.createElement("p");i.innerText=this.et,e.appendChild(i);const n=document.createElement("div"),s=document.createElement("div");n.id=Di,e.id="onesignal-toast-text",Pe(e,"onesignal-toast-text"),Pe(n,Oi),Pe(n,ki),Ee("body").appendChild(n),s.id=Li,Pe(s,Ii),s.appendChild(e),this.Ut.appendChild(s),Pe(this.Ut,O()?Ci:Ei),t.Bo(t.EVENTS.SHOWN)}static Bo(t){cn.re(t)}kn(){Pe(this.Ut,Pi),Ke(this._t,"animationend",(t,e)=>{t.target!==this._t||"slideDownExit"!==t.animationName&&"slideUpExit"!==t.animationName||(Ce(`#${Di}`),e())},!0)}get Ut(){return Ee(`#${Di}`)}get _t(){return Ee(`#${Li}`)}static get EVENTS(){return{SHOWN:"toastShown",CLOSED:"toastClosed"}}},ha=class{_o(t,e){const i=this.ao(t,e);Ee(`#${Ni}`).appendChild(i),this.br&&this.br.addEventListener("change",this.yr.bind(this));const n=Ee(`#${Ai}`);n.disabled=!1,$e(n,"disabled"),Ce(`#${Ri}`)}L(){const t=Ee(`#${Ri}`),e=Ee(`#${Ai}`),i=document.createElement("div");Pe(t,"onesignal-loading-container"),Pe(i,"onesignal-loading-message"),Pe(e,"disabled"),xe(t,"beforeend",oa("#95A1AC")),i.innerText="Fetching your preferences",t.appendChild(i),e.disabled=!0}ao(t,e){const i=function(t,e){if(!e)return t;if(ua(e)){const e=structuredClone(t);return la(e,!0),e}return structuredClone(t).map(t=>{const i=e[t.tag];var n;return t.checked=void 0===(n=i)||n,t})}(t,e),n=i.filter(t=>i.indexOf(t)%2==0),s=i.filter(t=>i.indexOf(t)%2),a=document.createElement("div"),o=document.createElement("div"),r=document.createElement("div");return Pe(a,zi),Pe(o,zi),Pe(r,ji),r.id="tagging-container",n.forEach(t=>{a.appendChild(this.Sr(t))}),s.forEach(t=>{o.appendChild(this.Sr(t))}),r.appendChild(a),r.appendChild(o),r}Sr(t){const{label:e}=t,i=document.createElement("label"),n=document.createElement("span"),s=document.createElement("input"),a=document.createElement("span"),o=document.createElement("div"),r=document.createElement("div");return Pe(i,"onesignal-category-label"),Pe(n,"onesignal-category-label-text"),Pe(s,"onesignal-category-label-input"),Pe(a,"onesignal-checkmark"),i.title=e,n.innerText=e,s.type="checkbox",s.value=t.tag,s.checked=!!t.checked,i.appendChild(n),i.appendChild(s),i.appendChild(a),o.setAttribute("style","clear:both"),r.appendChild(i),r.appendChild(o),r}get br(){return Ee(`#${Ni} > div.${ji}`)}yr(t){const e=t.target;if(e&&"checkbox"===e.getAttribute("type")){const t=e.checked;e.setAttribute("checked",t.toString())}}static vr(){const t=`#${Ni} > div.${ji}> div > div > label > input[type=checkbox]`,e=document.querySelectorAll(t),i={};return e.forEach(t=>{i[t.value]=t.checked}),i}},ga=class{A;Or;Ir;_r;constructor(t){this.A=t,this.Or=[],this.Ir=!1}async kr(t){const e="denied"===await OneSignal.A.Tt.$t();let i;const{subscribed:n,optedOut:s}=await OneSignal.A.lt.Na(),a=t.slidedownPromptOptions?.type;let o=!1;if(a&&(o=Dn(a)),o){if(n)return!!t.isInUpdateMode||(pt.m(new Error("Already subscribed")),!1);if(i=Be(0),s)throw new Error("User is opted out");if(e)return pt.m(et),!1}else{if(!t.force){const t=OneSignal.ye.ks(),e=OneSignal.ye.Is(),i=t&&e;if(t&&a===Tt)return pt.m(st(Tt)),!1;if(e&&a===At)return pt.m(st(At)),!1;if(i&&a===Nt)return pt.m(st(Nt)),!1}i=Be(1)}return!(i&&!t.force&&!t.isInUpdateMode&&(pt.m(new Error(`${a||"unknown"} previously dismissed`)),1))}Cr(){if(!this._r)throw pa;const t=ha.vr();this.A.yi.Er(t),Vn(),this.A.yi.bi(!0)}Pr(){if(!this._r)throw pa;const t=this._r.Eo?.io,e=this._r.Eo?.So();if(!t||e)throw new Z(1);const i=this._r.Eo?.vo();this.$r(i)}Tr(){if(!this._r)throw pa;const t=this._r.Eo?.eo,e=this._r.Eo?.Oo();if(!t||e)throw new Z(0);const i=this._r.Eo?.Io();this.Ar(i)}Nr(){if(!this._r)throw pa;const t=this._r.Eo?.eo,e=this._r.Eo?.io,i=this._r.Eo?.So(),n=this._r.Eo?.Oo();if(!t&&!e||i&&n)throw new Z(2);const s=this._r.Eo?.vo(),a=this._r.Eo?.Io();if(!e)throw new Z(1);if(i||this.$r(s),!t)throw new Z(0);n||this.Ar(a)}$r(t){t&&OneSignal.User.addEmail(t)}Ar(t){t&&OneSignal.User.addSms(t)}async Mr(){if(!this._r)throw pa;const t=this._r.it.text.confirmMessage;if(!t)return;await dt(1e3);const e=new da(t);e.j(),await dt(5e3),e.kn(),da.Bo(da.EVENTS.CLOSED)}Ur(t){switch(t.slidedownPromptOptions?.type){case $t:this.Dr(t);break;case At:case Tt:case Nt:this.Lr(t)}}Dr(t){ze("mountTaggingContainer");try{let e={};const i=new ha,n=t.slidedownPromptOptions?.categories;if(!n)throw new Error("Categories not defined");const s=OneSignal.ye.Ze().ni;t.isInUpdateMode&&s?(this.A.yi.Fr(s),e=function(t){const e={};return Object.keys(t).forEach(i=>{e[i]="1"===t[i]}),e}(s)):la(n,!0),i._o(n,e)}catch(e){pt.S("Failed to create tagging container",e)}}Lr(t){ze("mountChannelCaptureContainer");try{if(t.slidedownPromptOptions){const e=new aa(t.slidedownPromptOptions);e._o(),this._r&&(this._r.Eo=e)}}catch(e){pt.S("Failed to create channel capture container",e)}}async mr(){if(!this._r)throw pa;const t=this._r.it.type;this._r.Po&&this._r.Go();try{switch(t){case Pt:Vn();break;case $t:this.Cr();break;case At:this.Pr();break;case Tt:this.Tr();break;case Nt:this.Nr()}}catch(e){return pt._("Slidedown failed to update:",e),this._r.qo(),this._r.Ho(),void(e instanceof Z&&this._r.Jo(e.reason))}switch(this._r&&(this._r.kn(),Dn(t)||await this.Mr(),await dt(1e3),ra.Bo(ra.EVENTS.CLOSED)),t){case Pt:case $t:pt.p("Marking slidedown dismissed"),We(0);break;default:pt.p("Marking slidedown dismissed"),We(1)}}pr(t){this.Ir=t}async wr(){if(this.Or.length>0){const t=this.Rr();t&&await this.dr(t)}}hi(t){this.Or.push(t),ra.Bo(ra.EVENTS.QUEUED)}Rr(){return this.Or.shift()}async dr(t){if(ze("createSlidedown"),!be()){try{if(!(await this.kr(t)))return}catch(e){return void pt._("Slidedown check error",e)}if(function(){const t=OneSignal.Si;t?.it?.enable&&(t.Dt.K(),OneSignal.P.once(ra.EVENTS.CLOSED,()=>{t.Dt.j()}))}(),this.Ir)this.hi(t);else try{this.pr(!0);const e=t.slidedownPromptOptions||jt;this._r=new ra(e),await this._r.Lt(t.isInUpdateMode),this.Ur(t),pt.p("Showing Slidedown"),ra.Bo(ra.EVENTS.SHOWN)}catch(e){pt.S("Error showing Slidedown:",e),this.pr(!1),this._r?.kn()}}}},pa=new Error("Slidedown is missing"),fa=class{Wr={};A;Br={};constructor(t){this.A=t}bi(){pt.m("Local tags:",this.Wr);const t=function(t,e){const i={};return Object.keys(t).forEach(n=>{e[n]!==t[n]&&(i[n]=t[n])}),i}(function(t){const e={};return Object.keys(t).forEach(i=>{e[i]=!0===t[i]?"1":"0"}),e}(this.Wr),this.Br);return ua(t)?(pt._("No tag change detected"),t):(OneSignal.User.addTags(t),t)}Er(t){this.Wr=t}Fr(t){this.A.yi.Br=t}},wa=class{_i;Ft;lt;T;_a;Tt;Ui;Pi;Ni;yi;hr;constructor(t){var e;this._i=t,this.lt=new ea(this,{safariWebId:(e=this._i).safariWebId,appId:e.appId,vapidPublicKey:e.vapidPublicKey,onesignalVapidPublicKey:e.onesignalVapidPublicKey}),this.T=function(t){const e=t._i,i={workerPath:new Js(Ct),registrationOptions:xt};if(e.userConfig){if(e.userConfig.path){const t=e.userConfig.path.replace(/\/+$/,""),n=(e.userConfig.serviceWorkerPath??"").replace(/^\/+/,"");i.workerPath=new Js(`${t}/${n}`)}e.userConfig.serviceWorkerParam&&(i.registrationOptions=e.userConfig.serviceWorkerParam)}return new Gs(t,i)}(this),this.Tt=new ia,this._a=new Ws(this),this.Ui=new sa(this),this.Ni=new na(this),this.yi=new fa(this),this.hr=new ga(this),this.Pi=new ca(this),this.Ft=new Ye}},ma=class{setLogLevel(t){pt.u(t)}},_a=class extends pn{_e;jr;constructor(t){super(),this.jr=t,this._e="granted"===t,"undefined"!=typeof OneSignal&&OneSignal.P.on(OneSignal.EVENTS.NOTIFICATION_PERMISSION_CHANGED_AS_STRING,t=>{this.jr=t,this._e="granted"===t})}get permissionNative(){return this.jr}get permission(){return this._e}async setDefaultUrl(t){if(ze("setDefaultUrl",t),void 0===t)throw at("url");if("string"!=typeof t)throw rt("url");if(!lt(t,{allowNull:!0}))throw ot("url");await je(),ze("setDefaultNotificationUrl",t);const e=await me();e.defaultNotificationUrl=t,await _e(e)}async setDefaultTitle(t){if(ze("setDefaultTitle",t),void 0===t)throw at("title");if("string"!=typeof t)throw rt("title");await je();const e=await me();e.defaultNotificationTitle=t,await _e(e)}isPushSupported(){return ze("isPushNotificationsSupported"),!0}async requestPermission(){return!be()&&(await je(),await OneSignal.A.Pi.nr())}addEventListener(t,e){OneSignal.P.on(t,e)}removeEventListener(t,e){OneSignal.P.off(t,e)}},ba={NOTIFICATION_PERMISSION_CHANGED_AS_STRING:"permissionChangeAsString",NOTIFICATION_PERMISSION_CHANGED_AS_BOOLEAN:"permissionChange",SUBSCRIPTION_CHANGED:"change",WELCOME_NOTIFICATION_SENT:"sendWelcomeNotification",NOTIFICATION_WILL_DISPLAY:"foregroundWillDisplay",NOTIFICATION_DISMISSED:"dismiss",NOTIFICATION_CLICKED:"click",SDK_INITIALIZED:"initializeInternal",SDK_INITIALIZED_PUBLIC:"initialize",REGISTERED:"register",PERMISSION_PROMPT_DISPLAYED:"permissionPromptDisplay",TEST_FINISHED_ALLOW_CLICK_HANDLING:"testFinishedAllowClickHandling",SESSION_STARTED:"os.sessionStarted"},ya=class{async sendOutcome(t,e){const i=OneSignal.config?.userConfig.outcomes;if(!i)return void pt.S(`No outcomes config for ${t}`);const n=new Bs(OneSignal.config.appId,i,t,!1);if(void 0!==e&&"number"!=typeof e)return void pt.S("Outcome weight must be a number");if(!(await n.ta()))return;const s=await n.Xs();await n.oa({type:s.type,notificationIds:s.notificationIds,weight:e})}async sendUniqueOutcome(t){const e=OneSignal.config?.userConfig.outcomes;if(!e)return void pt.S(`No outcomes config for ${t}`);const i=new Bs(OneSignal.config.appId,e,t,!0);if(!(await i.ta()))return;const n=await i.Xs();if(4===n.type)return void pt._("Upgrade required for this feature");const{notificationIds:s}=n,a=await i.ia(s);i.na(n,a)?await i.oa({type:n.type,notificationIds:a}):pt._(`'${t}' already reported`)}},Sa=class extends pn{constructor(){super()}async promptPush(t){be()||(await je(),await OneSignal.A.Pi.gr(Pt,t))}async promptPushCategories(t){if(be())return;await je();const e=await OneSignal.A.lt.ct();await OneSignal.A.Pi.ar({...t,isInUpdateMode:e})}async promptSms(t){be()||(await je(),await OneSignal.A.Pi.rr({...t}))}async promptEmail(t){be()||(await je(),await OneSignal.A.Pi.cr({...t}))}async promptSmsAndEmail(t){be()||(await je(),await OneSignal.A.Pi.lr({...t}))}addEventListener(t,e){OneSignal.P.on(t,e)}removeEventListener(t,e){OneSignal.P.off(t,e)}},va=class t{static EVENTS=ba;static O=!1;static async zr(){const e=new Ns;await e.ys(),t.ye=new Us(e);const i=await ve(),n=await t.A.Tt.$t();t.User=new Nn(!0,i,n),this.Notifications=new _a(n)}static async Kr(e){const i=await Gt(e);pt.p("Final web app config:",i),t.config=i,t.A=new wa(i),t.config=t.A._i}static async login(t,e){if(ze("login",{externalId:t,jwtToken:e}),!be()){if(void 0===t)throw at("externalId");if("string"!=typeof t)throw rt("externalId");if(void 0!==e&&"string"!=typeof e)throw rt("jwtToken");kn(t,"login: externalId")||await Ds.login(t,e)}}static async logout(){ze("logout"),be()||await Ds.logout()}static async init(e){if(ze("init"),pt.p(`Browser Environment: ${k()} ${x()}`),localStorage.removeItem("isOptedOut"),localStorage.removeItem("isPushNotificationsEnabled"),function(){if(OneSignal.Vr)throw new Error("SDK already initialized");OneSignal.Vr=!0}(),await t.Kr(e),!t.config)throw new Error("OneSignal config not initialized!");k()!==w||t.config.safariWebId?await Xt.catch(t=>{pt.S("IndexedDB unavailable, close & reopen the page to retry init",t)})&&(await t.zr(),Ie(t.config.appId),t.O=await(async()=>{const t=function(){const t=localStorage.getItem(he);return null===t?null:"true"===t}();if(null!==t)return t;const e=await ae("userConsent")??!1;return pe(e),e})(),!ge()||t.O?await t.qr():t.Hr=!0):pt._(nt)}static async qr(){async function e(){t.Jr||(t.Jr=!0,t.P.on(t.EVENTS.SUBSCRIPTION_CHANGED,Fn),t.P.on(t.EVENTS.SDK_INITIALIZED,qn),window.addEventListener("focus",()=>{Wn()}),await async function(){const t=Je(),e=OneSignal.config,i=await oe("appId");if(i&&i!==t){if(pt.m(`App ID changed ${i} -> ${t}, clearing state`),await se.put("Options",{key:"isPushEnabled",value:null}),await se.put("Options",{key:"lastPushId",value:null}),await se.put("Options",{key:"lastPushToken",value:null}),await se.put("Options",{key:"lastOptedIn",value:null}),ie())return;await se.put("Ids",{type:"registrationId",id:null}),await se.put("Ids",{type:"userId",id:null}),OneSignal.ye.di.Bn(2)}await se.put("Ids",{type:"appId",id:t});const n=e.siteName||document.title||"Notification";await se.put("Options",{key:"pageTitle",value:n}),pt.m(`Set pageTitle to be '${n}'.`),await se.put("Options",{key:"defaultIcon",value:e.defaultIconUrl??null})}(),await async function(){const t=[],e=OneSignal.config?.userConfig.persistNotification;t.push(se.put("Options",{key:"persistNotification",value:null==e||e}));const i=OneSignal.config?.userConfig.webhooks;return["notification.willDisplay","notification.clicked","notification.dismissed"].forEach(e=>{i&&i[e]?t.push(se.put("Options",{key:`webhooks.${e}`,value:i[e]})):t.push(se.put("Options",{key:`webhooks.${e}`,value:!1}))}),i&&i.cors?t.push(se.put("Options",{key:"webhooks.cors",value:!0})):t.push(se.put("Options",{key:"webhooks.cors",value:!1})),OneSignal.config?.userConfig.notificationClickHandlerMatch?t.push(se.put("Options",{key:"notificationClickHandlerMatch",value:OneSignal.config.userConfig.notificationClickHandlerMatch})):t.push(se.put("Options",{key:"notificationClickHandlerMatch",value:"exact"})),OneSignal.config?.userConfig.notificationClickHandlerAction?t.push(se.put("Options",{key:"notificationClickHandlerAction",value:OneSignal.config.userConfig.notificationClickHandlerAction})):t.push(se.put("Options",{key:"notificationClickHandlerAction",value:"navigate"})),Promise.all(t)}(),await async function(){pt.p("internalInit()"),await OneSignal.A.T.va();const t=OneSignal.A.Ni;OneSignal.P.on(OneSignal.EVENTS.SESSION_STARTED,t.Xa.bind(t)),hn(),"visible"===document.visibilityState?await Kn():Ke(document,"visibilitychange",(t,e)=>{"visible"===document.visibilityState&&(e(),Kn())},!0)}())}t.Hr=!1,t.A._a.Vs(),"complete"===document.readyState||"interactive"===document.readyState?await e():(window.addEventListener("DOMContentLoaded",()=>{e()}),document.onreadystatechange=()=>{"complete"!==document.readyState&&"interactive"!==document.readyState||e()})}static async setConsentGiven(e){if(ze("setConsentGiven",{consent:e}),void 0===e)throw at("consent");if("boolean"!=typeof e)throw rt("consent");t.O=e,pe(e),e&&t.Hr&&await t.qr()}static async setConsentRequired(t){if(ze("setConsentRequired",{requiresConsent:t}),void 0===t)throw at("requiresConsent");if("boolean"!=typeof t)throw rt("requiresConsent");var e;e=t,localStorage.setItem(de,e.toString())}static push(e){return function(t,e){if("function"==typeof e)return e(t);throw new Error("Callback is not a function")}(t,e)}static gt;static config=null;static Ii=!1;static v=!1;static C=!1;static mo=!1;static Si=null;static Hr=!0;static P=new fn;static N={};static Vr=!1;static Jr=!1;static A;static ye;static Notifications=new _a;static Slidedown=new Sa;static Session=new ya;static User=new Nn(!1);static Debug=new ma};pt.m(`Web SDK loaded (version ${E}, ${A} environment).`),pt.p(`Current Page URL: ${"undefined"==typeof location?"NodeJS":location.href}`),function(){if(window.__oneSignalSdkLoadCount=Ve()+1,Ve()>1)return pt._("SDK included more than once"),void pt.p(`Skipping duplicate init (${Ve()})`);window.OneSignal=va,window.OneSignalDeferred=window.OneSignalDeferred??[];const t=async function(t){for(const i of t)try{await va.push(i)}catch(e){pt.S(e)}}(window.OneSignalDeferred);Object.defineProperty(window.OneSignalDeferred,"push",{value:async function(e){return await t,va.push(e)}})}()}(); //# sourceMappingURL=OneSignalSDK.page.es6.js.map