@flarehr/apollo-benefits 2.89.56619 → 2.90.56957
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{datadog-c27a43eb.js → datadog-eeb687f6.js} +1 -1
- package/dist/assets/{date-fns-20ad091e.js → date-fns-1aaef347.js} +1 -1
- package/dist/assets/{framer-motion-04a96014.js → framer-motion-7d482d44.js} +1 -1
- package/dist/assets/{index-9ce2ee20.js → index-5d2a90a4.js} +9 -9
- package/dist/assets/index-81650659.js +32 -0
- package/dist/assets/{vendor-1c5ad091.js → vendor-fefcaaa7.js} +23 -23
- package/dist/config.json +1 -2
- package/dist/index.html +5 -6
- package/package.json +1 -2
- package/dist/assets/@splitsoftware-dc67820b.js +0 -18
- package/dist/assets/index-a3cf435b.js +0 -32
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var Xn=Object.defineProperty;var Jn=(e,n,a)=>n in e?Xn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a;var b=(e,n,a)=>(Jn(e,typeof n!="symbol"?n+"":n,a),a);import{Q as Ke,m as Zn,s as ea,E as ta,n as na,t as Zt,o as Ie,r as aa,u as t,S as ht,v as C,x as Te,z as Se,A as We,B as Xe,C as en,D as he,H as sa,I as ft,J as $,K as U,L as j,O as se,M as ra,l as f,p as h,w as ye,N as ia,q as ee,F as H,T as Y,P as y,R as at,X as tn,U as la,W as ve,Y as ue,Z as ca,j as oa,$ as da,a0 as ma,a1 as ua,h as _,a2 as ha,a3 as fa,a4 as M,a5 as we,a6 as Je,a7 as pa,a8 as ga,a9 as ba,aa as ya,ab as wa,ac as It,ad as va,ae as ka,af as xa,ag as Ae,ah as nn,ai as Tt,aj as an,ak as Me,al as Ue,am as St,an as Lt,ao as Na,ap as sn,aq as Aa,ar as Ca,as as Pa,at as Ia,au as Ta,av as Sa,aw as pt,ax as gt,ay as F,k as La,az as Ea,aA as rn,aB as Et,aC as Oa,aD as Ba,aE as $a,aF as _a,aG as Ra,aH as Ma,aI as Ua,aJ as Va,aK as Da}from"./vendor-fefcaaa7.js";import{O as Be}from"./oidc-client-6f6e47c2.js";import{f as me,p as Fa,a as Ot}from"./date-fns-1aaef347.js";import{m as Bt}from"./framer-motion-7d482d44.js";import{i as ja}from"./datadog-eeb687f6.js";import"./lodash-5d893f8c.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function a(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=a(i);fetch(i.href,r)}})();Ke.prototype.selectCached=function(e,n=a=>null){return this.selectHasCache().pipe(Zn(0),ea(a=>a?ta:na(e()).pipe(Zt(n))))};class V{static setParameters(n,a){this._apiBaseUrl=n,this._jwt=a}static get instance(){return Ie(this._apiBaseUrl).headers({Authorization:`Bearer ${this._jwt}`,"X-APP-VERSION":"2.90.56957"}).addon(aa)}}b(V,"_apiBaseUrl"),b(V,"_jwt");class Wa extends V{}class re extends V{}class Ne{static setParameters(n,a,s){this._apiBaseUrl=n,this._jwt=a,this._profileId=s}static get instance(){return Ie(this._apiBaseUrl).headers({Authorization:`Bearer ${this._jwt}`,"X-PROFILE-ID":this._profileId,"X-APP-VERSION":"2.90.56957"})}}b(Ne,"_apiBaseUrl"),b(Ne,"_jwt"),b(Ne,"_profileId");const Le=({size:e})=>t("svg",{className:`animate-spin h-${e??5} w-${e??5}`,viewBox:"0 0 24 24",fill:"none",children:[t("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),t("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),Ze=()=>t("div",{className:"flex justify-center items-center h-screen text-primary",children:[t(Le,{size:5}),t("div",{className:"pl-3 text-xl font-light text-primary",children:"Loading..."})]}),ln="/benefits/app/assets/logo-a34e9b4b.png",Ha=()=>t("div",{className:"flex flex-col justify-center items-center h-screen text-grey-900",children:[t("img",{className:"block h-8 w-auto",src:ln,alt:"Flare Benefits"}),t("h1",{className:"mt-8",children:"You have been successfully logged out of Flare Benefits"})]});var $t,_t;const He=["money","mind","body","work","life"];var ze=(e=>(e.WellbeingHub="wellbeing",e.FlareApp="flareMobileApp",e.SalaryPackagingCars="salaryPackagingCars",e.Allowance="allowance",e.ApolloBenefitsConsent="apollo-benefits-consent",e.ApolloBenefitsCustomerRegistration="apollo-benefits-customer-registration",e))(ze||{});const za=["default","pba"];function qa(){return{user:C,config:C,navTab:"benefits",appView:"employee",redirectPath:C,deepLink:C,referrer:C,promotionId:C,mode:"default",isWelcomeModalOpen:!1}}let Ga=($t=Te({name:"benefits-app",resettable:!0,producerFn:Se}),$t(_t=class extends ht{constructor(){super(qa())}})||_t);const P=new Ga;class Qa extends Ke{constructor(a){super(a);b(this,"signedInUser$",this.select(a=>a.user));b(this,"appConfig$",this.select(a=>a.config));b(this,"navPage$",this.select(a=>a.navTab));b(this,"appView$",this.select(a=>a.appView));b(this,"signedInUserRole$",this.select(a=>We.pipe(a.user,Xe(()=>"user",s=>s.benefitsProfile.role))));this.store=a}}const K=new Qa(P);function T(e,n){return en(e,sa(()=>n))}function bt(e){return T(e,null)}function Ce(e,n="Option value is none."){if(he(e))throw new Error(n);return e.value}function Rt(e,n){return en(e,Xe(()=>n===null,a=>a===n))}const Ya=()=>{const e=async()=>{const s=await Ie(`${window.location.origin}/benefits/app/config.json`).get().json();P.update({config:ft(s)})},n=()=>Ce(K.getValue().config);return{fetchConfigAsync:e,getConfig:n,getPublicBackendUrl:()=>n().apiBaseUrl.replace("backend","public")}},D=Ya();function pe(e,n){const a=new URLSearchParams(n);return $(a.get(e))}function st(e,n){const a=new URLSearchParams(n.replace(/^#+/,""));return $(a.get(e))}const dt=e=>{const n=D.getConfig().apiGatewayBaseUrl+"/benefits/app/#";if(e!=null&&e.startsWith(n)||e!=null&&e.startsWith("#"))return e.split("#")[1]};function Ka(e,n){return this.replace(e,n||e)}String.prototype.replaceIf=Ka;const Xa=(e,n)=>e==null?void 0:e.replaceIf("${profileId}",n==null?void 0:n.basicProfile.profileId).replaceIf("${accountId}",n==null?void 0:n.basicProfile.accountId).replaceIf("${partnerId}",n==null?void 0:n.basicProfile.partnerId).replaceIf("${customerId}",n==null?void 0:n.basicProfile.customerId);class Ja{updateIsWelcomeModalOpen(n){P.update({isWelcomeModalOpen:n})}getIsWelcomeModalOpen(){return P.getValue().isWelcomeModalOpen}getReferrer(){const n=P.getValue().referrer;return U(n)?n.value:void 0}getPromotionId(){const n=P.getValue().promotionId;return U(n)?n.value:void 0}setReferrer(n){P.update({referrer:n})}setPromotionId(n){P.update({promotionId:n})}}const ge=new Ja,Za=()=>{const e="redirectPath",n="mode",a=r=>{P.update({redirectPath:r})},s=r=>{P.update({deepLink:r})},i=r=>{P.update({mode:r})};return{extractRedirectPath:()=>{const r=pe(e,window.location.search);U(r)&&(a(r),s(r))},extractMode(){const r=pe(n,window.location.search);U(r)&&za.includes(r.value)&&i(r.value)},extractTrackingParameters:()=>{const r=pe("referrer",window.location.search),l=pe("promotionId",window.location.search);U(r)&&ge.setReferrer(r),U(l)&&ge.setPromotionId(l)},redirectToPathIfExists(){const r=K.getValue().redirectPath;U(r)&&(a(C),j(r.value))}}},Ve=Za();let cn=class{constructor(n){b(this,"_value",C);this.factory=n}get value(){if(U(this._value))return this._value.value;const n=this.factory();return this._value=ft(n),n}};var Mt,Ut,q=(e=>(e[e.Unauthorized=0]="Unauthorized",e[e.SignInPending=1]="SignInPending",e[e.Authenticated=2]="Authenticated",e[e.SignOutPending=3]="SignOutPending",e[e.Error=4]="Error",e))(q||{});function es(){return{authStatus:0,jwt:C}}let ts=(Mt=Te({name:"authentication",resettable:!0,producerFn:Se}),Mt(Ut=class extends ht{constructor(){super(es())}})||Ut);const oe=new ts;var De=(e=>(e.SignIn="callback",e.SignOut="logout",e.SilentRefresh="silent-refresh",e))(De||{});class ns{constructor(){b(this,"userManager");b(this,"tokenQueryParameter","token");b(this,"b2cJwtQueryParameter","b2cJwt");b(this,"profileIdQueryParameter","profileId");b(this,"getHostOidcUrl",()=>`${window.location.origin}/benefits/app/#/oidc`);this.userManager=new cn(()=>{const n=new Be.UserManager(this.userManagerSettings());return n.events.addAccessTokenExpired(()=>this.signOutRedirectAsync()),n.events.addUserLoaded(this.sessionUpdatedHandler),this.configureLogging(),n})}async refreshIfExpired(){const n=await this.userManager.value.getUser();n!=null&&n.expired&&this.userManager.value.signinSilent()}tokenExists(n){const a=pe(this.tokenQueryParameter,n);return se.isSome(a)}b2cJwtExists(n){const a=st(this.b2cJwtQueryParameter,n);return se.isSome(a)}isOidcRoute(n){return n.includes("callback")||n.includes("logout")||n.includes("silent-refresh")}async initFromB2cJwt(n,a){const s=Ce(st(this.b2cJwtQueryParameter,a),`"${this.b2cJwtQueryParameter}" fragment is required`),i=Ce(st(this.profileIdQueryParameter,a),`"${this.profileIdQueryParameter}" fragment is required`);Ne.setParameters(D.getConfig().workplaceBackendUrl,s,i);const r=await Ne.instance.url("token").get().json();window.location.href=n+"?token="+r.token}async initFromToken(n,a){if(this.isOidcRoute(n))return;const s=pe(this.tokenQueryParameter,a);if(se.isNone(s))throw oe.update({authStatus:q.Error}),Error(`"${this.tokenQueryParameter}" URL query parameter is required`);await this.signInRedirectAsync(s)}signOutRedirectAsync(){return oe.update({authStatus:q.SignOutPending}),this.userManager.value.signoutRedirect()}async signInRedirectCallbackAsync(){await this.userManager.value.signinRedirectCallback(window.location.href.replace("/oidc/callback?","")),oe.update({authStatus:q.Authenticated})}async signOutRedirectCallbackAsync(){await this.userManager.value.signoutRedirectCallback(),ra()}async silentRefreshCallbackAsync(){await this.userManager.value.signinSilentCallback()}async signOut(){return oe.update({authStatus:q.Unauthorized,jwt:se.none})}async signInRedirectAsync(n){oe.update({authStatus:q.SignInPending}),await this.userManager.value.signinRedirect({extraQueryParams:{irt:n.value}})}sessionUpdatedHandler(n){oe.update({jwt:se.fromNullable(n.access_token)})}userManagerSettings(){return{authority:D.getConfig().oidcAuthority,client_id:"apollo-benefits-ui",redirect_uri:`${this.getHostOidcUrl()}/callback?`,response_type:"id_token token",scope:"openid",post_logout_redirect_uri:`${this.getHostOidcUrl()}/logout?`,silent_redirect_uri:`${this.getHostOidcUrl()}/silent-refresh?`,automaticSilentRenew:!0,accessTokenExpiringNotificationTime:10,filterProtocolClaims:!0,loadUserInfo:!0,clockSkew:2592e3}}configureLogging(){Be.Log.logger=console,Be.Log.level=Be.Log.DEBUG}}const G=new ns,as=({mode:e})=>{const[n,a]=f(!1);return h(()=>{(async()=>{switch(e){case De.SignIn:await G.signInRedirectCallbackAsync(),window.location.hash="#",j("/"),Ve.redirectToPathIfExists();break;case De.SignOut:await G.signOutRedirectCallbackAsync(),a(!0);break;case De.SilentRefresh:await G.silentRefreshCallbackAsync();break}})()},[]),n?t(Ha,{}):t(Ze,{})},ss=({fragment:e})=>(h(()=>{(async()=>await G.initFromB2cJwt(window.location.pathname,e))()},[]),t(Ze,{}));class rs extends Ke{constructor(a){super(a);b(this,"authState$",this.select());this.store=a}get isUnauthorized(){return this.getValue().authStatus===q.Unauthorized||this.getValue().authStatus===q.Error}get isAuthorized(){return this.getValue().authStatus===q.Authenticated}get jwt(){const a=this.getValue().jwt;return U(a)?a.value:""}}const on=new rs(oe);class is{constructor(){b(this,"_isLocked");b(this,"queue");b(this,"lock",n=>{this._isLocked=!0,setTimeout(this.unlockAndFlushQueue,n)});b(this,"unlockAndFlushQueue",async()=>{this._isLocked=!1,await Promise.all(this.queue.map(n=>V.instance.url("benefits/track-event").post(n).res())),this.queue=[]});this._isLocked=!1,this.queue=[]}async postTrackEventAsync(n){return this.isLocked?(this.queue.push(n),Promise.resolve()):V.instance.url("benefits/track-event").post(n).res()}get isLocked(){return this._isLocked}}const qe=new is,ls="/customer-profile/backend/v1.0/workplace-link/config";class cs{async getConfigAsync(){return re.instance.url(ls).get().json()}}const os=new cs,ds=e=>({isEstablished:e==null?void 0:e.isEstablished}),ms="/flare-app-identity/backend/v1.0/auth/token";class us{async getTokenAsync(){return re.instance.url(ms).get().json()}}const hs=new us;class fs{async getUserProfile(){return await V.instance.url("users/self").get().json()}async getBasicProfileByEmail(n){const a=await V.instance.url(`users?email=${n}`).get().notFound(()=>null).json();return $(a)}saveConsent(){V.instance.url("users/consent").post()}}const rt=new fs;class Vt{constructor(){b(this,"basicProfile");b(this,"benefitsProfile");b(this,"featureFlags");b(this,"account")}static toDomain(n){return{basicProfile:n.basicProfile,benefitsProfile:n.benefitsProfile,featureFlags:n.featureFlags,accountName:n.account?n.account.name+(n.account.legalEntityName?" - "+n.account.legalEntityName:""):void 0}}}const de=class de{static get profileId(){if(he(this._profileId))throw Error("ProfileId is missing.");return this._profileId.value}static set profileId(n){this._profileId=$(n)}static set accountId(n){this._accountId=$(n)}static get profileIdOrDefault(){return T(this._profileId,"")}static get accountIdOrDefault(){return T(this._accountId,"")}static get partnerIdOrDefault(){return T(this._partnerId,"")}extractProfileId(n){const a=$(ia(n).sub);if(he(a))throw Error("profileId property is missing.");de.profileId=a.value}async loadSignedInUserProfileAsync(){const n=Vt.toDomain(await rt.getUserProfile());de.accountId=n.basicProfile.accountId,P.update(a=>{a.user=$(n)})}saveUserConsent(){return rt.saveConsent(),P.update(n=>{const a=T(n.user,void 0);a&&(n.user=$({...a,benefitsProfile:{...a.benefitsProfile,hasConsent:!0}}))}),Promise.resolve()}async setWorkplaceLinkConfig(){const n=ds(await os.getConfigAsync()),a=n.isEstablished?await this.fetchWorkplaceBackendTokenAsync():void 0;P.update(s=>{const i=T(s.user,void 0);i&&(s.user=$({...i,workplaceLinkConfig:{...n,workplaceBackendToken:a}}))})}setIsEstablished(){P.update(n=>{const a=T(n.user,void 0);a&&(n.user=$({...a,workplaceLinkConfig:{...a.workplaceLinkConfig,isEstablished:!0}}))})}setAllowanceCompleted(){P.update(n=>{const a=T(n.user,void 0);a&&(n.user=$({...a,featureFlags:{...a.featureFlags,allowance:!1}}))})}async updateCustomerIdAsync(n){const a=Vt.toDomain(await rt.getUserProfile()),s=a.basicProfile.customerId?await this.fetchWorkplaceBackendTokenAsync():void 0;P.update(i=>{const r=T(i.user,void 0);r&&(i.user=$({...r,workplaceLinkConfig:{...r.workplaceLinkConfig,workplaceBackendToken:s},basicProfile:{...r.basicProfile,customerId:a.basicProfile.customerId}})),n&&n()})}async fetchWorkplaceBackendTokenAsync(){try{return(await hs.getTokenAsync()).token}catch{return}}};b(de,"_profileId",C),b(de,"_accountId",C),b(de,"_partnerId",C);let mt=de;const z=ye.createContext(C),dn=ye.createContext(!1),ne=new mt,mn=()=>{const e=ee(z),n=H(()=>bt(e),[e]),a=Y(i=>{if(!n)return!1;const{featureFlags:r}=n;return r[i]},[n]),s=Y(()=>n?n.featureFlags:{},[n]);return{getTreatment:a,getAllTreatments:s}},Dt=e=>{switch(e){case"cars-calculator-gated":case"cars-calculator-ungated":return"cars-calculator";case"typeform":return"typeform";case"external-link":case"activity-advertisement":return"advertisement";case void 0:return"unknown";default:return e}};class un{constructor(n){b(this,"trackEventAsync");this.trackEventAsync=n}async trackAppLoadedAsync(){return this.trackEventAsync("appLoaded")}async trackBenefitsOpenedAsync(){return this.trackEventAsync("benefitsOpened")}async trackAppOfferViewedAsync(){return this.trackEventAsync("appOfferViewed")}async trackAppOfferAcceptedAsync(){return this.trackEventAsync("appOfferAccepted")}async trackWellbeingOpenedAsync(){return this.trackEventAsync("wellbeingOpened")}async trackAdminOpenedAsync(){return this.trackEventAsync("adminOpened")}async trackConsentStartedAsync(){return this.trackEventAsync("consentStarted")}async trackConsentCompletedAsync(){return this.trackEventAsync("consentCompleted")}async trackRegistrationStartedAsync(){return this.trackEventAsync("registrationStarted")}async trackRegistrationSubmittedAsync(){return this.trackEventAsync("registrationSubmitted")}async trackRegistrationResentAsync(){return this.trackEventAsync("registrationResent")}async trackRegistrationVerifiedAsync(){return this.trackEventAsync("registrationVerified")}async trackRegistrationFailedAsync(n){return this.trackEventAsync({registrationFailed:{reason:n}})}async trackRegistrationCompletedAsync(){return this.trackEventAsync("registrationCompleted")}async trackRegistrationErrorViewedAsync(n){return this.trackEventAsync({registrationErrorViewed:{reason:n}})}async trackRegistrationErrorDismissedAsync(){return this.trackEventAsync("registrationErrorDismissed")}async trackMarketplaceOfferViewedAsync(n,a,s){const i={offer:n,experiment:a,treatment:s};return this.trackEventAsync({marketplaceOfferViewed:i})}async trackMarketplaceOfferAcceptedAsync(n,a,s){const i={offer:n,experiment:a,treatment:s};return this.trackEventAsync({marketplaceOfferAccepted:i})}async trackPerksListViewedAsync(n){const a={pillar:n};return this.trackEventAsync({perksListViewed:a})}async trackEntriesListViewedAsync(n){const a={pillar:n};return this.trackEventAsync({entriesListViewed:a})}async trackFeaturePerkViewedAsync({benefitId:n,benefit:a}){const s={perkId:n,perkPillar:a.category,perkTitle:a.title,placement:"feature"};return this.trackEventAsync({perkViewed:s})}async trackExplorePerkViewedAsync({benefitId:n,benefit:a}){const s={perkId:n,perkPillar:a.category,perkTitle:a.title,placement:"explore"};return this.trackEventAsync({perkViewed:s})}async trackDocumentClickedAsync({benefitId:n,benefit:a}){const s={perkId:n,perkPillar:a.category,perkTitle:a.title,type:"document"};return this.trackEventAsync({attachmentOpened:s})}async trackPerkVisitedAsync({benefitId:n,benefit:a}){const s={perkId:n,perkPillar:a.category,perkTitle:a.title};return this.trackEventAsync({perkVisited:s})}async trackPerksListSearched(n){const a={query:n};return this.trackEventAsync({perksListSearched:a})}async trackRoleAssignedAsync(n){return this.trackEventAsync({roleAssigned:n})}async trackEntryViewed(n){return this.trackEventAsync({entryViewed:n})}async trackEntriesListSearchedAsync(n){const a={query:n};return this.trackEventAsync({entriesListSearched:a})}async trackCategoryOpenedAsync(n,a){const s={categoryId:n,categoryName:a};return this.trackEventAsync({categoryOpened:s})}async trackCategoryClosedAsync(n,a,s){const i={categoryId:n,categoryName:a,screen:s};return this.trackEventAsync({categoryClosed:i})}async trackDiscountsOpenedAsync(n,a){const s={categoryId:n,categoryName:a};return this.trackEventAsync({discountsOpened:s})}async trackActivityActionedAsync(n,a,s,i){i==="external-link"?this.trackActivityCompletedAsync(n,a,s,i):this.trackActivityStartedAsync(n,a,s,i)}async trackActivityStartedAsync(n,a,s,i){const r={categoryId:n,id:a,name:s,type:Dt(i)};return this.trackEventAsync({activityStarted:r})}async trackActivityCompletedAsync(n,a,s,i){const r={categoryId:n,id:a,name:s,type:Dt(i)};return this.trackEventAsync({activityCompleted:r})}async trackBenefitsPlanViewedAsync(n){const a={categories:n};return this.trackEventAsync({benefitsPlanViewed:a})}async trackDeepLinkOpenedAsync(n){const a={link:n};return this.trackEventAsync({deepLinkOpened:a})}async trackPromotionViewedAsync(n,a,s,i){return this.trackEventAsync({promotionViewed:{promotionId:n,location:a,categoryId:s,categoryName:i}})}async trackPromotionSelectedAsync(n,a,s,i,r){return this.trackEventAsync({promotionSelected:{promotionId:n,location:a,categoryId:s,categoryName:i,targetUrl:r}})}}const ps=async e=>{try{await qe.postTrackEventAsync({event:e,treatments:[]})}catch{return}},ut=new un(ps),O=()=>{const{getAllTreatments:e}=mn(),[n,a]=f(ut),s=Y(async i=>{try{await qe.postTrackEventAsync({event:i,treatments:Object.entries(e()).map(([r,l])=>({featureFlag:r,treatment:l.toString()}))||[],referrer:ge.getReferrer(),promotionId:ge.getPromotionId(),path:window.location.hash})}catch{return}},[]);return h(()=>{a(new un(s))},[s]),{service:n}};const gs="/benefits/app/assets/external_link-599a0aec.svg";function X(...e){return e.filter(Boolean).join(" ")}const bs=e=>`${e[0].toUpperCase()}${e.slice(1)}`,ys="/customer-storecards/workplace-backend/v1.0/shopify-url",ws=async(e,n)=>(await Ie(D.getConfig().apolloBaseUrl).url(ys).headers({Authorization:`Bearer ${e}`,"X-PROFILE-ID":n}).get().json()).redirectUrl,hn=async(e,n)=>{let a=null;try{a=window.open("","_blank");const s=await ws(e,n);a&&(a.location.href=s)}catch{a&&(a==null||a.close())}},Ft=({user:{featureFlags:e,basicProfile:n,workplaceLinkConfig:a}})=>{const[s,i]=f(C),{service:r}=O(),l=!!(a!=null&&a.workplaceBackendToken),c=H(()=>{const o=new Map([["benefits","/"]]);return e.wellbeing&&o.set("wellbeing","/wellbeing-hub"),Array.from(o)},[]);h(()=>{const o=[K.navPage$.subscribe(p=>{i($(p))})];return()=>{o.map(p=>p.unsubscribe())}},[]);const d=async()=>{r.trackDiscountsOpenedAsync("discounts","Discounts"),await hn(a.workplaceBackendToken,n.profileId)};return t("nav",{className:"-mb-px flex","aria-label":"Tabs",children:[c.map(([o,p])=>t("div",{onClick:async()=>{i($(o)),j(p)},className:X(Rt(s,o)?"border-primary text-primary":"border-transparent text-gray-500","cursor-pointer hover:text-gray-700 hover:border-gray-300 px-4 md:ml-4 flex-grow md:flex-grow-0","py-4 text-center border-b-4 text-base leading-6 font-semibold cursor-pointer capitalize"),"aria-current":Rt(s,o)?"page":void 0,children:t("span",{children:o})},o)),t("div",{className:`border-transparent text-gray-500 cursor-pointer hover:text-gray-700 hover:border-gray-300 px-4 md:ml-4
|
|
2
|
+
flex-grow md:flex-grow-0 py-4 text-center border-b-4 text-base
|
|
3
|
+
leading-6 font-semibold capitalize ${l?"":"hidden"}`,children:t("button",{className:"inline-flex",onClick:()=>{d()},children:[t("span",{children:"Discounts"}),t("img",{className:"ml-2",src:gs})]})})]})},vs=()=>{const[e,n]=f("employee");return h(()=>{const a=[K.appView$.subscribe(n)];return()=>{a.map(s=>s.unsubscribe())}},[]),t("span",{className:"relative z-0 inline-flex shadow-sm rounded-md",children:[t("button",{type:"button",className:X(e==="admin"?"text-primary bg-white cursor-default":"text-gray-700 bg-gray-50","relative inline-flex items-center px-4 py-1 rounded-l-md border border-gray-300 text-sm font-medium hover:bg-white focus:z-10 focus:outline-none"),onClick:()=>{e!=="admin"&&j("/admin")},children:"Admin view"}),t("button",{type:"button",className:X(e==="employee"?"text-primary bg-white cursor-default":"text-gray-700 bg-gray-50","-ml-px relative inline-flex items-center px-4 py-1 rounded-r-md border border-gray-300 text-sm font-medium hover:bg-white focus:z-10 focus:outline-none"),onClick:()=>{e!=="employee"&&j("/")},children:"Employee view"})]})},ks=[{name:"Admin view",href:"#/admin"},{name:"Employee view",href:"#/"}],fn=()=>t("span",{className:"inline-block h-8 w-8 rounded-full overflow-hidden bg-white border",children:t("svg",{className:"h-full w-full text-gray-300",fill:"currentColor",viewBox:"0 0 24 24",children:t("path",{d:"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z"})})}),xs=({user:e})=>t(y,{children:t(ve,{as:"div","data-dd-action-name":"User menu",className:"z-30 relative inline-block text-left",children:({open:n})=>t(y,{children:[t("div",{children:t(ve.Button,{className:`max-w-xs bg-white flex items-center text-sm rounded-full hover:outline-none hover:ring-2 hover:ring-offset-2 hover:ring-primary ${n?"outline-none ring-2 ring-offset-2 ring-primary":""} `,children:t(fn,{})})}),t(ue,{enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:t(ve.Items,{className:"absolute right-0 mt-2 w-56 divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:t("div",{className:"px-1 py-1 ",children:[t(ve.Item,{children:()=>t("div",{className:"mx-3 py-2",children:[t("div",{className:"text-base font-medium text-gray-800 dd-privacy-mask",children:e.basicProfile.firstName}),t("div",{className:"text-sm font-medium text-gray-500 dd-privacy-mask",children:e.basicProfile.email})]})}),t("div",{className:"border-t border-grey-900",children:t(ve.Item,{children:({active:a})=>t("button",{onClick:()=>G.signOutRedirectAsync(),className:`${a?"bg-secondary text-primary rounded-md":"text-gray-900 "} group flex w-full items-center mt-2 mb-1 px-3 py-2 text-sm font-medium`,children:"Logout"})})})]})})})]})})}),yt=e=>{const n=e.user;if(he(n))return t(y,{});const[a,s]=f(!1),i=n.value.benefitsProfile.role!=="user";return h(()=>{const r=[K.appView$.subscribe(l=>{s(l==="employee")})];return()=>{r.map(l=>l.unsubscribe())}},[]),t(y,{children:t(at,{as:"nav",className:"bg-gray-50 border-0 md:border-b md:border-gray-200",children:({open:r})=>t(y,{children:[t("div",{className:`mx-auto px-4 sm:px-6 lg:px-8 border-b border-gray-200 md:border-none ${i&&!a?"":"max-w-[90rem]"}`,children:t("div",{className:"flex justify-between h-16",children:[t("div",{className:"flex",children:t("a",{href:"#",onClick:()=>j("/"),className:"flex-shrink-0 flex items-center",children:t("img",{className:"block h-8 w-auto",src:ln,alt:"Flare Benefits"})})}),t("div",{className:"ml-10 flex flex-wrap flex-grow content-end",children:t("div",{className:"hidden sm:block",children:a&&t(Ft,{user:n.value})})}),t("div",{className:"flex flex-wrap content-center",children:t("div",{className:"hidden md:block",children:i&&t(vs,{})})}),t("div",{className:"hidden md:ml-6 md:flex md:items-center",children:t(xs,{user:n.value})}),t("div",{className:"-mr-2 flex items-center md:hidden",children:t(at.Button,{className:"bg-white inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary",children:[t("span",{className:"sr-only",children:"Open main menu"}),r?t(tn,{className:"block h-6 w-6","aria-hidden":"true"}):t(la,{className:"block h-6 w-6","aria-hidden":"true"})]})})]})}),t(at.Panel,{className:"md:hidden",children:t("div",{className:"pt-4 pb-3 border-b border-gray-200",children:[t("div",{className:"flex items-center px-4",children:[t("div",{className:"flex-shrink-0",children:t(fn,{})}),t("div",{className:"ml-3",children:[t("div",{className:"text-base font-medium text-gray-800 dd-privacy-mask",children:n.value.basicProfile.firstName}),t("div",{className:"text-sm font-medium text-gray-500 dd-privacy-mask",children:n.value.basicProfile.email})]})]}),t("div",{className:"mt-3 space-y-1",children:[i&&t(y,{children:ks.map(l=>t("a",{href:l.href,className:"block px-4 py-2 text-base font-medium text-gray-500 hover:text-primary hover:bg-secondary",children:l.name},l.name))}),t("a",{onClick:()=>G.signOutRedirectAsync(),className:"block cursor-pointer px-4 py-2 text-base font-medium text-gray-500 hover:text-primary hover:bg-secondary",children:"Logout"})]})]})}),a&&t("div",{className:"sm:hidden bg-white border-b border-gray-200",children:t(Ft,{user:n.value})})]})})})},Fe=()=>{const e=ee(z),{service:n}=O();return h(()=>{n.trackAppOfferAcceptedAsync()},[]),t(y,{children:[t(yt,{user:e}),t("div",{className:"p-4",children:t("workplace-link",{"access-token":on.jwt,"backend-url":D.getConfig().apiGatewayBaseUrl,source:"WebBenefits",channel:"web"})})]})},pn=()=>{const e=ca(),n=e.startsWith("state")||e.startsWith("code")||e.startsWith("error");return t(y,{children:n?t(Fe,{}):t("div",{className:"notfound",children:[t("h1",{children:"Error 404"}),t("p",{children:"That page doesn't exist."}),t("a",{href:"#/",children:t("h4",{children:"Back to Home"})})]})})};function ke(e){return ye.useContext(dn)?oa(e.component,e):t(Ze,{})}const wt=e=>({listen:n=>e.listen(({location:a})=>n(a)),location:e.location,push:e.push,replace:e.replace}),Ns="/benefits-plan/backend/v1.0/categories",As=(e,n)=>`/benefits-plan/backend/v1.0/categories/${e}/products/${n}`;class Cs{constructor(){b(this,"_backendClientWithCacheEnabled")}get backendClientWithCacheEnabled(){return this._backendClientWithCacheEnabled||(this._backendClientWithCacheEnabled=re.instance.middlewares([da(),ma({throttle:1e4})])),this._backendClientWithCacheEnabled}async getCategoriesAsync(){return this.backendClientWithCacheEnabled.url(Ns).get().json()}async getProductActivitesAsync(n,a){const s=As(n,a);return re.instance.url(s).get().json()}}const vt=new Cs,Ps=(e,n)=>e.map((a,s)=>({title:a,completed:s<=n})),gn=(e,n)=>Ie(D.getConfig().apolloBaseUrl).headers({Authorization:`Bearer ${e}`,"X-PROFILE-ID":n}),kt=async(e,n)=>{const[a]=await Promise.all([e,new Promise(s=>window.setTimeout(s,n))]);return a},$e=e=>new Promise(n=>setTimeout(n,e));class Is{constructor(){b(this,"client",new cn(()=>{const n=D.getConfig();return ua({space:n.contentfulSpace,environment:n.contentfulEnvironment,accessToken:n.contentfulApiKey})}))}async loadCollectionsAsync(){return(await this.client.value.getEntries({content_type:"benefitsCollection"})).items.map(a=>{var i,r,l,c,d;const{fields:s}=a;return{id:a.sys.id,title:s.title,description:s.description,coverPhotoUrl:((l=(r=(i=s.coverPhoto)==null?void 0:i.fields)==null?void 0:r.file)==null?void 0:l.url)??"",pillar:((c=s.pillar)==null?void 0:c.toLowerCase())??"money",articles:((d=s.contentLibrary)==null?void 0:d.map(o=>({id:o.sys.id,title:o.fields.title,subtitle:o.fields.subtitle,coverPhotoUrl:o.fields.coverPhoto.fields.file.url,pillar:o.fields.pillar.toLowerCase(),primaryContentType:o.fields.primaryContentType.toLowerCase(),slug:"",externalLink:""})))??[],state:"visible"}})}async loadAvailableEntryPreviewsAsync(){return(await this.client.value.getEntries({"sys.contentType.sys.id[in]":"benefitsWellbeingArticle,benefitsExternalLink",select:"sys.id,fields"})).items.map(a=>{const{fields:s}=a;return{id:a.sys.id,title:s.title,subtitle:s.subtitle,coverPhotoUrl:s.coverPhoto.fields.file.url,pillar:s.pillar.toLowerCase(),primaryContentType:s.primaryContentType.toLowerCase(),slug:s.slug,externalLink:s.externalLink}})}async loadArticleAsync(n){const a=await this.client.value.getEntries({content_type:"benefitsWellbeingArticle",limit:1,include:10,"fields.slug":n});if(a.items.length===0)throw Error("Couldn't find this article");return a.items[0].fields}async loadBenefitsPlanCategoryAsync(){return(await this.client.value.getEntries({content_type:"benefitsWebCategoryTile"})).items.map(a=>a.fields)}async loadBenefitsLandingModalAsync(n){const a=await this.client.value.getEntries({content_type:"benefitsWebLandingModal",limit:1,"fields.slug":n});if(a.items.length!==0)return a.items[0].fields}async loadBenefitsPlanWebHomeAsync(){const n=await this.client.value.getEntries({content_type:"benefitsBenefitsPlanWeb",limit:1,"fields.slug":"home"});if(n.items.length===0)throw Error("Couldn't find benefits plan home.");return n.items[0].fields}async tryLoadActivityAdvertisementAsync(n){var a;try{return(a=(await this.client.value.getEntry(n)).fields.webBenefitsLandingModal)==null?void 0:a.fields}catch{return}}async loadFeaturedOffersAsync(){var s;const n=await this.client.value.getEntries({content_type:"benefitsProductOfferCategory"}),a=((s=n.includes)==null?void 0:s.Entry)??[];return n.items.map(({fields:{category:i,offers:r}})=>({category:i,offers:r.map(l=>{var o;if(typeof l!="object")return;const{sys:{id:c,type:d}}=l;return d==="Entry"?l.fields:d==="Link"?(o=a.find(p=>p.sys.id===c))==null?void 0:o.fields:void 0}).filter(l=>l)}))}async loadAllowanceContentAsync(n){return await this.client.value.getEntries({content_type:"benefitsMarketplaceContent","fields.contentId":n})}async loadBenefitsMarketplaceOfferAsync(){const n=await this.client.value.getEntries({content_type:"benefitsMarketplaceOffer",limit:1});if(n.items.length===0)throw Error("Couldn't find benefits marketplace offer.");return n.items[0].fields}}const te=new Is,bn=["Start","Get Estimate","View","Ineligible"],Ts=async()=>kt(te.loadBenefitsPlanCategoryAsync(),700),Ss=async()=>kt(te.loadBenefitsPlanWebHomeAsync(),700),yn=e=>{switch(e.action){case"activity-assessment":return"activity-assessment";case"cars-calculator-ungated":return"cars-calculator-ungated";case"cars-calculator-gated":return"cars-calculator-gated";case"typeform":return e.typeformId?"typeform":"none";case"shopify":return"shopify";case"external-link":return e.link?"external-link":"none";case"activity-advertisement":return"activity-advertisement";default:return"none"}},Ls=async e=>{const n=e.products.length>0?await vt.getProductActivitesAsync(e.id,e.products[0].id):{activities:[]};return(await Promise.all(n.activities.filter(s=>s.activityType==="Advertisement").map(async s=>{const i=await te.tryLoadActivityAdvertisementAsync(s.articleId);return i?{...i,id:s.id,title:s.title}:void 0}))).filter(s=>!!s)},wn=(e,n)=>{var a;return{id:e.slug,modalBody:e.body,disclaimer:e.disclaimer,heroImageDesktop:e.heroImageDesktop,heroImageMobile:e.heroImageMobile,buttonText:e.actionButtonText,component:yn(e),typeformId:e.typeformId,order:e.order||100,externalUrl:((a=e.link)==null?void 0:a.replace(/\s+/g,""))||void 0,categoryTitle:e.categoryTitle,assessmentId:e.assessmentId,selectionTile:e.tileDisplayTitle&&e.tileSubtitle&&e.tileImage?{activityId:e.id||"unknown",activityName:e.title||"unknown",displayTitle:e.tileDisplayTitle,subtitle:e.tileSubtitle,tileImage:e.tileImage,buttonText:(n==null?void 0:n.landingModal.fields.actionButtonText)||"Learn More",order:e.order||100}:void 0}},jt=(e,n,a)=>{const s=a.map(i=>wn(i,n));return{id:e.id,title:n.categoryTitle,displayTitle:n.displayTitle,subtitle:n.subtitle,iconUrl:e.iconUrl,order:n.order,landings:s.filter(i=>i.component!=="none").sort((i,r)=>i.order-r.order)}},Es=async e=>{try{const n=await te.loadBenefitsLandingModalAsync(e);if(n&&(n==null?void 0:n.action)!=="activity-advertisement")return[wn(n)]}catch{return[]}return[]},Os=async()=>{try{const e=await vt.getCategoriesAsync(),n=await Ts();return(await Promise.all(e.categories.filter(s=>n.find(r=>r.categoryTitle.toLowerCase()===s.title.toLowerCase())&&bn.includes(s.status)).map(async s=>{try{const i=n.find(r=>r.categoryTitle.toLowerCase()===s.title.toLowerCase());switch(yn(i.landingModal.fields)){case"activity-advertisement":{const r=await Ls(s);return r.length>0?jt(s,i,r):void 0}default:return jt(s,i,[i.landingModal.fields])}}catch{return}}))).filter(s=>!!s&&s.landings.length>0).sort((s,i)=>s.order-i.order)}catch{return[]}},Bs=async(e,n)=>{try{const a=await vt.getCategoriesAsync(),s=await te.loadFeaturedOffersAsync(),i=a.categories.filter(r=>bn.includes(r.status));return s.flatMap(r=>{const l=i.find(c=>c.title.toLocaleLowerCase()===r.category.toLocaleLowerCase());return l?r.offers.filter(c=>c.displayLocations.includes(e)&&(!c.expiryDate||new Date(c.expiryDate).getTime()>Date.now())&&(!c.accounts||c.accounts.length===0||c.accounts.includes(n))).map(c=>({...c,categoryName:l.title,categoryId:l.id})):[]}).map(r=>{try{return{title:r.title,subtitle:r.subtitle,categoryId:r.categoryId,categoryName:r.categoryName,slug:r.slug,location:e,coverPhotoMobileUrl:r.coverPhoto.fields.file.url,coverPhotoDesktopUrl:r.webBannerImage.fields.file.url,linkButtonText:r.linkButtonLabel,linkUrl:r.linkUrl,order:r.displayPriority??0}}catch{return}}).filter(r=>r).sort((r,l)=>l.order-r.order)}catch{return[]}},vn=async()=>{var i;const e=P.getValue().benefitsPlanOffers;if(e)return e;const n=bt(P.getValue().user);if(!((i=n==null?void 0:n.workplaceLinkConfig)!=null&&i.workplaceBackendToken))return[];const s=(await gn(n.workplaceLinkConfig.workplaceBackendToken,n.basicProfile.profileId).url("/benefits-plan/workplace-backend/v1.0/offers").get().json()).offers.filter(r=>r.isEnabled&&r.isEligible);return P.update(r=>{r.benefitsPlanOffers=s}),s},$s=()=>{const e=()=>K.getValue().mode;return{isDefault:()=>e()==="default",isPba:()=>e()==="pba"}},kn=$s(),_s=({children:e,onSwipedLeft:n,onSwipedRight:a,onSwipedUp:s,onSwipedDown:i,...r})=>{const[c,d]=f(0),[o,p]=f(0),[g,w]=f(0),[N,k]=f(0);return t("div",{onTouchStart:u=>{p(0),d(u.targetTouches[0].clientX),k(0),w(u.targetTouches[0].clientY)},onTouchMove:u=>{p(u.targetTouches[0].clientX),k(u.targetTouches[0].clientY)},onTouchEnd:()=>{if(!c||!o||!g||!N)return;const S=c-o>50,R=g-N>50;Math.abs(c-o)>Math.abs(g-N)?S?n==null||n():a==null||a():R?s==null||s():i==null||i()},...r,children:e})},Rs=({autoplay:e,slidesContainerClassName:n,onSlideChange:a,children:s})=>{const[i,r]=f(0),l=_(),c=(e==null?void 0:e.enabled)&&s.length>1;if(!s)return t(y,{});const d=()=>{c&&(l.current=setInterval(g,e.interval))},o=()=>clearInterval(l.current),p=()=>{o(),d()},g=()=>{r(k=>k===s.length-1?0:k+1),p()},w=()=>{r(k=>k===0?s.length-1:k-1),p()},N=k=>{r(k),p()};return h(()=>(d(),o),[]),h(()=>{a==null||a(i)},[i]),t(_s,{onSwipedLeft:w,onSwipedRight:g,children:[t("div",{className:"relative",children:[s.length>1&&t(Ms,{className:"hidden md:flex absolute top-0 left-4",onClick:w}),t("div",{className:`${n??""} flex flex-row overflow-hidden`,children:s.map((k,v)=>t(Vs,{index:v,activeIndex:i,children:k},v))}),s.length>1&&t(Us,{className:"hidden md:flex absolute top-0 right-4",onClick:g})]}),s.length>1&&t(Ds,{itemsCount:s.length,activeIndex:i,onClick:N})]})},Ms=({className:e,onClick:n})=>t("div",{className:`flex h-full items-center z-10 ${e??""}`,children:t(ha,{className:"w-7 h-7 p-1 rounded-full bg-white shadow cursor-pointer hover:bg-gray-200/50",onClick:n})}),Us=({className:e,onClick:n})=>t("div",{className:`flex h-full items-center z-10 ${e??""}`,children:t(fa,{className:"w-7 h-7 p-1 rounded-full bg-white shadow cursor-pointer hover:bg-gray-200/50",onClick:n})}),Vs=({index:e,activeIndex:n,children:a})=>{let s;return e<n&&(s=`-${(e+1)*100}%`),e===n&&(s=`-${e*100}%`),e>n&&(s=`-${(e-1)*100}%`),t("div",{className:"w-full flex-none transition duration-500",style:{transform:`translate( ${s}, 0)`},children:a})},Ds=({itemsCount:e,activeIndex:n,onClick:a})=>t("div",{className:"mt-2 flex justify-center gap-2",children:Array(e).fill(null).map((s,i)=>t("span",{className:`inline-block w-2 h-2 cursor-pointer outline outline-4 rounded-full ${i===n?"bg-primary outline-primary/25":"bg-gray-300 outline-transparent"}`,onClick:()=>a(i)},i))}),be=e=>{const n=dt(e.href),[a,s]=f();h(()=>{const r=[K.signedInUser$.subscribe(l=>{U(l)?s(l.value):s(void 0)})];return()=>{r.map(l=>l.unsubscribe())}},[]);const i=r=>{r.preventDefault(),n&&j(n),e.onClick&&e.onClick()};return t(y,{children:n?t("a",{className:e.className,target:"_self",onClick:i,children:e.children}):t("a",{href:Xa(e.href,a),className:e.className,onClick:e.onClick,target:"_blank",rel:"noopener noreferrer",children:e.children})})},x=({height:e,width:n,className:a})=>t("div",{className:a,children:t("div",{className:"flex animate-pulse flex-row h-full",children:t("div",{style:{width:`${n?`${n}rem`:"100%"}`,height:`${e}rem`},className:"bg-gray-300 rounded"})})}),Fs=()=>t(y,{children:t("div",{className:"w-full bg-gray-50 border-grey-100 border rounded-lg flex",children:t("div",{className:"w-full grid grid-cols-1 md:grid-cols-2 place-items-center md:h-72 p-4 md:p-9",children:[t("div",{className:"w-full flex flex-col gap-4 md:gap-8",children:[t(x,{className:"w-1/5",height:1.5}),t(x,{className:"w-2/5",height:1.5}),t(x,{className:"w-4/5",height:1.5})]}),t(x,{className:"hidden md:block w-full",width:20,height:10})]})})}),js=({offers:e})=>{const n=_({}),{service:a}=O(),s=Y(r=>{if(!(e!=null&&e.length)||n.current[r])return;const l=e.find((c,d)=>d===r);l.isAppOffer?a.trackAppOfferViewedAsync():a.trackPromotionViewedAsync(l.slug,l.location,l.categoryId,l.categoryName),n.current[r]=!0},[e,a,n]),i=Y(r=>{a.trackPromotionSelectedAsync(r.slug,r.location,r.categoryId,r.categoryName,r.linkUrl)},[a]);return e?t(Rs,{autoplay:{enabled:!0,interval:5e3},slidesContainerClassName:"bg-white border-grey-100 border rounded",onSlideChange:s,children:e.map(r=>t(be,{className:"cursor-pointer",onClick:()=>i(r),href:r.linkUrl,children:t("div",{className:"md:h-[22.5rem] w-full flex flex-col md:flex-row text-gray-900",children:[t("div",{className:"md:hidden overflow-hidden w-full",children:t("img",{src:r.coverPhotoMobileUrl})}),t("div",{className:"flex flex-1 flex-col flex-grow justify-center py-4 px-4 md:py-0 md:pl-16 md:pr-0",children:[t("div",{className:"text-2xl leading-8 lg:text-3xl xl:text-4xl lg:leading-10 font-extrabold pt-4",children:r.title}),t("div",{className:"text-md md:text-lg leading-6 mt-2 font-medium max-w-lg",children:r.subtitle}),t("div",{className:"pt-5",children:t("span",{className:"block w-full mx-auto md:w-auto text-center md:inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm leading-6 font-semibold rounded-md text-white bg-primary",children:t("span",{children:r.linkButtonText})})})]}),t("div",{className:"hidden md:block overflow-hidden",children:t("img",{src:r.coverPhotoDesktopUrl,className:"object-scale-down h-full"})})]})}))}):t(Fs,{})};const Ws=({children:e,className:n})=>t("div",{className:"gradient-tile "+n,children:e}),Hs=({title:e,subtitle:n,externalUrl:a,icon:s,onClick:i})=>t("a",{className:"w-full cursor-pointer",href:a,target:a&&"_blank"||void 0,onClick:i,children:t(Ws,{className:"pl-6 pr-4 py-4 md:w-48 md:h-48 md:px-4 md:py-6 bg-white bg-opacity-50 hover:bg-opacity-100 shadow hover:shadow-lg border-2 rounded-md flex md:flex-col md:justify-items-center md:items-center",children:[t("div",{className:"flex justify-start item-center self-center",children:s}),t("div",{className:"ml-6 md:ml-0 md:text-center md:mt-auto",children:[t("div",{className:"text-blue-600 text-l md:text-xl font-bold leading-7",children:e}),t("div",{className:"text-gray-900 text-base font-medium leading-normal",children:n})]})]})}),zs={renderText:e=>e.split(`
|
|
4
|
+
`).flatMap((n,a)=>[a>0&&t("br",{}),n]),renderNode:{[M.BLOCKS.PARAGRAPH]:(e,n)=>t("p",{className:"relative text-gray-500 text-sm font-normal leading-5",children:n}),[M.INLINES.HYPERLINK]:(e,n)=>t("a",{className:"text-blue-600 underline",href:e.data.uri,target:"_blank",rel:"noopener noreferrer",children:n})}},qs=({body:e})=>t(y,{children:we.documentToReactComponents(e,zs)}),Gs=()=>t(y,{children:[t(x,{className:"mb-1 md:mb-2",width:20,height:4}),t(x,{className:"mb-5 md:mb-10",width:40,height:2}),t("div",{className:"flex flex-col md:flex-row gap-3 md:gap-8 flex-wrap",children:[t(x,{className:"hidden md:block",width:12,height:12}),t(x,{className:"md:hidden block",height:6}),t(x,{className:"hidden md:block",width:12,height:12}),t(x,{className:"md:hidden block",height:6}),t(x,{className:"hidden md:block",width:12,height:12}),t(x,{className:"md:hidden block",height:6}),t(x,{className:"hidden md:block",width:12,height:12}),t(x,{className:"md:hidden block",height:6}),t(x,{className:"hidden md:block",width:12,height:12}),t(x,{className:"md:hidden block",height:6}),t(x,{className:"hidden md:block",width:12,height:12}),t(x,{className:"md:hidden block",height:6})]})]}),Qs=({categories:e,content:n})=>{const{service:a}=O(),[s,i]=f(!0),r=ge.getIsWelcomeModalOpen();return h(()=>{if(!s&&!r){const l=e?e.map(c=>c.title):[];a.trackBenefitsPlanViewedAsync(l)}},[s,r]),h(()=>{e&&(n!=null&&n.title)?i(!1):i(!0)},[e,n==null?void 0:n.title]),t("div",{className:"relative",children:[t("div",{className:"bg-[linear-gradient(0deg,_#2E66F7_0%,_#0005D2_100%)] absolute w-full h-full blur-[250px] opacity-10"}),e&&(n!=null&&n.title)?t(y,{children:[t("div",{className:"text-gray-700 text-2xl md:text-4xl font-bold md:font-extrabold leading-loose md:leading-10 mb-1 md:mb-2",children:n.title}),n.subtitle&&t("div",{className:"text-black text-base md:text-2xl font-normal leading-normal md:leading-loose mb-5 md:mb-10",children:n.subtitle}),t("div",{className:"flex flex-col md:flex-row gap-3 md:gap-8 flex-wrap mb-6",children:e==null?void 0:e.map(l=>t("div",{className:"category-container flex md:flex-col",children:t(Hs,{title:l.displayTitle||l.title,subtitle:l.subtitle,icon:t("img",{src:l.iconUrl,className:"w-10 h-10 md:w-16 md:h-16"}),onClick:()=>j("/categories/"+l.title.toLocaleLowerCase())},l.id)}))}),n.disclaimer&&t(qs,{body:n.disclaimer})]}):t(Gs,{})]})},Ys="/benefits/app/assets/all_tab_color-548783b9.svg",Ks="/benefits/app/assets/all_tab_gray-a5051313.svg",xn={money:"text-blue-400",mind:"text-green-400",body:"text-red-400",work:"text-orange-400",life:"text-yellow-400"},Wt=["all",...He],Xs=({children:e})=>t("nav",{className:"flex p-2 space-x-8 bg-gray-50","aria-label":"Tabs",children:e}),Js=e=>{const{children:n,onClick:a,className:s,selected:i}=e;return t("div",{onClick:a,className:X(s??"",i?"bg-white shadow-md text-gray-800":"text-gray-600 hover:bg-gray-100","w-full py-2 capitalize text-base leading-6 font-semibold rounded-lg focus:outline-none","cursor-pointer flex items-center justify-center"),"aria-current":i?"page":void 0,children:n})},Zs=({currentTab:e,tabNameList:n,onTabClicked:a})=>t(y,{children:[t("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),t("select",{id:"tabs",name:"tabs",className:"block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-primary focus:border-primary sm:text-sm rounded-md",value:e,onChange:s=>{const i=s.currentTarget.value;a(i)},children:n.map(s=>t("option",{value:s,children:bs(s)}))})]}),er={money:pa.faUsdSquare,mind:ga.faSpa,body:ba.faHeartbeat,work:ya.faBriefcase,life:wa.faUmbrellaBeach},Nn=(e,n)=>t(Je,{size:n??"lg",icon:er[e]}),An=({currentTab:e,onTabClicked:n})=>{const a=l=>Nn(l,"1x"),s=l=>t("div",{className:xn[l],children:a(l)}),i={all:t("img",{className:"h-3.5 w-3.5",src:Ks,alt:""}),...Object.fromEntries(He.map(l=>[l,a(l)]))},r={all:t("img",{className:"h-3.5 w-3.5",src:Ys,alt:""}),...Object.fromEntries(He.map(l=>[l,s(l)]))};return t(y,{children:[t("div",{className:"sm:hidden",children:t(Zs,{currentTab:e,onTabClicked:l=>n(l),tabNameList:[...Wt]})}),t("div",{className:"hidden sm:block",children:t(Xs,{children:Wt.map(l=>t(Js,{onClick:()=>{n(l)},selected:e===l,className:"uiid-explore-perks-tabs",children:[e===l?r[l]:i[l],t("span",{className:"uiid-explore-tab-name ml-3",children:l})]},l))})})]})},Cn=({onSearchEvent:e})=>{const n=_(null),a=_(null),[s,i]=f(!1);return h(()=>{const r=[n.current&&It(n.current,"input").pipe(va("target","value"),Zt(l=>{i(!!l)}),ka(500)).subscribe(async l=>{e(l)}),a.current&&It(a.current,"click").subscribe(()=>{n.current.value="",i(!1),e("")})];return()=>{r.map(l=>l==null?void 0:l.unsubscribe())}},[]),t("div",{className:"flex relative rounded-md shadow-sm",children:[t("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none","aria-hidden":"true",children:t(xa,{className:"mr-3 h-4 w-4 text-gray-400","aria-hidden":"true"})}),t("input",{type:"text",name:"search",id:"search",ref:n,placeholder:"Search perks",className:"uiid-search-bar-input block w-full pl-9 rounded-none rounded-md sm:text-sm border-gray-300"}),t("div",{className:X(s?"":"hidden","absolute inset-y-0 right-0 pr-3 flex items-center z-10 cursor-pointer"),ref:a,children:t(Ae,{className:"h-5 w-5 text-gray-400 ","aria-hidden":"true"})})]})};var Ht,zt;const tr=()=>({all:[],money:[],mind:[],body:[],work:[],life:[]}),nr=()=>({perksTab:"all",searchString:""});let ar=(Ht=Te({name:"explore-perks",cache:{ttl:"3600000"},idKey:"benefitId",resettable:!0,producerFn:Se}),Ht(zt=class extends nn{constructor(){super(nr())}})||zt);const Pe=new ar,sr=()=>({setTab:e=>{Pe.update(n=>{n.perksTab=e})},searchPerks:e=>{Pe.update(n=>{n.searchString=e,n.perksTab="all"})}}),it=sr(),Pn=({children:e,className:n})=>t("div",{className:X(n??"","grid items-stretch sm:grid-cols-2 lg:grid-cols-3 gap-8"),children:e}),In=({children:e})=>t("div",{className:"uiid-preview-empty flex items-center justify-center sm:col-span-2 lg:col-span-3 justify-items-center content-center bg-gray-100 rounded-lg overflow-hidden h-72",children:t("div",{className:"text-xl font-medium text-gray-400 text-center",children:e})});class rr{async getBenefitsAsync(){return V.instance.url("benefits").get().json()}async postDocumentAsync(n){return V.instance.url("document").addon(Tt).formData(n).post().badRequest(a=>{throw new Error(a.message)}).json()}async postImageAsync(n){return V.instance.url("image").addon(Tt).formData(n).post().badRequest(a=>{throw new Error(a.message)}).json()}commandAsync(n,a){return V.instance.url("benefits/track-event").query(a||{}).post(n).badRequest(s=>{throw new Error(s.message)}).res()}}const ie=new rr,ir="/benefits/app/assets/workplace_link_banner_mobile-6ebaa24b.png",lr="/benefits/app/assets/workplace_link_banner_v2-c81ed849.png",cr="/workplace-link";class ae extends an{constructor(a){super(a);b(this,"perksTab$",this.select(a=>a.perksTab));b(this,"all$",Me([this.selectAll()]).pipe(Ue(([a])=>ae.filterPerks(a,"","all"))));b(this,"classifiedPerks$",Me([this.selectAll(),this.select(a=>a.searchString)]).pipe(Ue(([a,s])=>{const i=s?ae.searchPerks(a,s):a;return ae.classifyPerks(i)})));b(this,"perksOnStage$",Me([this.selectAll(),this.select(a=>a.searchString),this.select(a=>a.perksTab)]).pipe(Ue(([a,s,i])=>this.getHasCache()?se.fromNullable(ae.filterPerks(a,s,i)):C)));this.store=a}static filterPerks(a,s,i){const r=ae.searchPerks(a,s).filter(l=>i==="all"||l.benefit.category===i);return ae.excludeLocalPerk(r,cr)}static searchPerks(a,s){return a.filter(i=>i.benefit.title.toLowerCase().includes(s.toLowerCase())||i.benefit.subtitle.toLowerCase().includes(s.toLowerCase()))}static classifyPerks(a){const s=tr();return a.forEach(i=>{const r=i.benefit.category;s[r].push(i)}),s.all=a,s}static findLocalPerk(a,s){const i=a.filter(r=>{var l;return(l=dt(r.benefit.url))==null?void 0:l.startsWith(s)});return i.length===0?void 0:i[0]}static excludeLocalPerk(a,s){return a.filter(r=>{var l;return!((l=dt(r.benefit.url))!=null&&l.startsWith(s))})}}const Ge=new ae(Pe);var qt,Gt;function or(){return{loading:!1,featuredPerks:C,featuredProductOffers:void 0,viewPerk:{isOpen:!1,perk:C},viewLanding:{isOpen:!1,landingSelection:[]},categories:void 0,benefitsPlanHome:void 0}}let dr=(qt=Te({name:"home-page",resettable:!0,producerFn:Se}),qt(Gt=class extends ht{constructor(){super(or())}})||Gt);const J=new dr;class mr extends Ke{constructor(a){super(a);b(this,"homePageState$",this.select(a=>a.featuredPerks));b(this,"viewPerkState$",this.select(a=>a.viewPerk));b(this,"viewLandingState$",this.select(a=>a.viewLanding));b(this,"categoryState$",this.select(a=>a.categories));b(this,"benefitsPlanHomeState$",this.select(a=>a.benefitsPlanHome));b(this,"bannerItems$",this.select(a=>a.featuredProductOffers));this.store=a}}const Z=new mr(J),ur=()=>({getViewPageState:()=>{const e=n=>{J.update(a=>{a.featuredPerks=$(n)}),Pe.set(n.availableBenefits)};return Ge.selectCached(()=>ie.getBenefitsAsync(),e)},getMarketplaceCategoryState:()=>{const e=n=>{J.update(a=>{a.categories=n})};return Z.selectCached(()=>Os(),e)},getBenefitsPlanHome:()=>{const e=n=>{J.update(a=>{a.benefitsPlanHome=n})};return Z.selectCached(()=>Ss(),e)},getBannerItems:e=>{const n=s=>{J.update(i=>{i.featuredProductOffers=s})},a=()=>Bs("webBanner",e.basicProfile.accountId).then(s=>e.featureFlags[ze.FlareApp]?s.concat([{isAppOffer:!0,title:"Workplace benefits in your pocket!",subtitle:"Download the Flare app for easy access to your workplace benefits and much more.",categoryId:"",categoryName:"",slug:"",location:"webBanner",coverPhotoMobileUrl:ir,coverPhotoDesktopUrl:lr,linkButtonText:"Get Flare App",linkUrl:"#/workplace-link"}]):s);return Z.selectCached(()=>a(),n)},reloadViewPageState:()=>{Pe.setHasCache(!1)},openPerk:e=>{J.update(n=>{n.viewLanding={isOpen:!1,landingSelection:[],category:void 0},n.viewPerk={isOpen:!0,perk:ft(e)}})},closePerk:()=>{J.update(e=>{e.viewPerk.isOpen=!1})},openLanding:(e,n)=>{J.update(a=>{a.viewPerk.isOpen=!1,a.viewLanding={isOpen:!0,landingSelection:e,category:n}})},closeLanding:()=>{J.update(e=>{e.viewLanding={isOpen:!1,landingSelection:[],category:void 0}})}}),B=ur(),Tn="/benefits/app/assets/default_backdrop-fdd955b8.png",xt=e=>{const n=t(y,{children:[t("div",{className:"flex-shrink-0",children:t("img",{className:X(e.imageClassName??"h-48 w-full object-cover"),src:e.imageUrl,alt:""})}),t("div",{className:"flex-1 bg-white p-4 flex flex-col justify-between",children:e.children})]});return t("div",{onClick:e.onClick,className:X(e.className??"",e.onClick?"cursor-pointer":"","flex flex-col rounded-lg shadow-lg overflow-hidden"),children:e.externalLink?t("a",{href:e.externalLink,target:"_blank",rel:"noopener noreferrer",children:n}):n})},hr=e=>St.match(e.toLowerCase()).with("body",()=>"bg-pink-100 text-pink-800").with("life",()=>"bg-yellow-100 text-yellow-800").with("mind",()=>"bg-green-100 text-green-800").with("money",()=>"bg-blue-100 text-blue-800").with("work",()=>"bg-orange-100 text-orange-800").with(St.__,()=>"bg-gray-100 text-gray-800").exhaustive(),Nt=e=>{const n=hr(e.name),a=e.size==="xs"?"text-xs":"text-sm";return t("div",{className:X(e.className??"","capitalize inline-flex items-center px-2 py-0.5 rounded font-medium",n,a),children:e.name})},Sn=({perk:e,onClick:n,className:a})=>{var s;return t(xt,{className:a,imageUrl:((s=e.backdrop)==null?void 0:s.downloadUrl)??Tn,onClick:n,children:t("div",{className:"flex-1 pt-2 pb-7 px-2",children:[t(Nt,{className:"uiid-perk-tag",name:e.category}),t("div",{className:"block mt-2",children:[t("p",{className:"uiid-perk-item-title text-xl font-semibold text-gray-900",children:e.title}),t("p",{className:"uiid-perk-item-subtitle mt-1 text-sm text-gray-500",children:e.subtitle})]})]})})},Ln=()=>t("div",{className:"flex flex-col animate-pulse shadow-lg rounded-lg overflow-hidden",children:[t("div",{className:"flex-shrink-0",children:t("div",{className:"h-48 bg-gray-300"})}),t("div",{className:"flex-1 bg-white p-6 pb-9 flex flex-col justify-between",children:t("div",{className:"flex-1",children:[t("div",{className:"h-6 bg-gray-300 rounded w-12"}),t("div",{className:"block mt-2",children:[t("div",{className:"h-4 mt-4 bg-gray-300 rounded w-1/2"}),t("div",{className:"h-4 mt-2 bg-gray-300 rounded w-3/4"})]})]})})]}),En=()=>t(y,{children:[...Array(3).keys()].map((e,n)=>t(Ln,{},n))}),fr=()=>{const[e,n]=f(C),{service:a}=O();h(()=>{const r=[Ge.perksOnStage$.subscribe(n)];return()=>{r.map(l=>l.unsubscribe())}},[]);const s=async r=>{B.openPerk(r),await a.trackExplorePerkViewedAsync(r)},i=T(e,[]).length>0?T(e,[]).map(r=>{const{benefit:l,benefitId:c}=r;return t(Sn,{className:"uiid-explore-perk",perk:l,onClick:()=>s(r)},c)}):t(In,{children:[t("p",{children:"Sorry, no entries were found matching your search request."}),t("p",{children:"Please try another search."})]});return t(Pn,{className:"uiid-perks-grid",children:he(e)?t(En,{}):i})},pr=()=>{const[e,n]=f(0),[a,s]=f("all"),{service:i}=O();h(()=>{(async()=>i.trackPerksListViewedAsync(a))();const l=[Ge.all$.subscribe(c=>{n(c.length)}),Ge.perksTab$.subscribe(s)];return()=>{l.map(c=>c.unsubscribe())}},[]),h(()=>()=>{it.searchPerks("")},[]);const r=async l=>{it.setTab(l),await i.trackPerksListViewedAsync(l)};return t("div",{className:"flex flex-col",style:{minHeight:window.innerHeight},children:[t("div",{className:"sm:flex sm:items-center sm:justify-between",children:[t("div",{className:"flex",children:[t("div",{className:"text-2xl md:text-4xl font-bold md:font-extrabold leading-loose md:leading-10 text-gray-700",children:"Explore other perks"}),t("div",{className:"text-2xl md:text-4xl font-bold md:font-extrabold leading-loose md:leading-10 text-gray-500 ml-2",children:["(",e,")"]})]}),t("div",{className:"mt-4 sm:mt-0",children:t(Cn,{onSearchEvent:async l=>{it.searchPerks(l),l&&await i.trackPerksListSearched(l)}})})]}),t("div",{className:"mt-4",children:t(An,{currentTab:a,onTabClicked:r})}),t("div",{className:"mt-6",children:t(fr,{})})]})},gr=e=>{const{perks:n}=e,[a,s]=f(!0),{service:i}=O();h(()=>{s(he(n))},[n]);const r=c=>{B.openPerk(c),i.trackFeaturePerkViewedAsync(c)},l=T(n,[]).map(c=>{const{benefit:d,benefitId:o}=c;return t(Sn,{className:"uiid-featured-perk",perk:d,onClick:()=>r(c)},o)});return t("div",{className:"flex flex-col",children:[t("div",{className:"text-2xl md:text-4xl font-bold md:font-extrabold leading-loose md:leading-10 text-gray-700",children:"Featured Perks"}),t("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-8 pt-6",children:a?t(En,{}):l})]})},et=({isOpen:e,fullWidthMobile:n,onClose:a,children:s})=>t(ue.Root,{show:e,as:y,children:t(Lt,{as:"div",static:!0,className:"modal fixed z-40 inset-0 overflow-y-auto",open:e,onClose:a,children:t("div",{className:`flex items-center justify-center min-h-screen md:max-h-screen mt-auto text-center ${n?"w-screen md:w-auto md:p-4":"p-4"}`,children:[t(ue.Child,{as:y,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:t(Lt.Overlay,{className:"fixed inset-0 bg-black bg-opacity-75 transition-opacity"})}),t("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),t(ue.Child,{as:y,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:t("div",{className:`inline-block align-bottom transition-all md:align-middle bg-white text-left shadow-xl transform ${n?"mt-auto md:mb-auto md:rounded-lg overflow-visible":"rounded-lg overflow-hidden"}`,children:s})})]})})}),br=e=>n=>!!n&&e(n),Qe=e=>br(e.test.bind(e)),At=/^\+?(614|6104|04)([0-9]{2})([0-9]{3})([0-9]{3})$/,yr=/^(\+601){1}(1\d{8}|5\d{8}|(0|2|3|4|6|7|8|9)\d{7})$/,wr=/^[0-9]{6}$/,vr=/^[0-9]*$/,On=e=>{if(!e)return;const n=e.replace(/\s/g,""),a=n.match(At);return a==null?n:`04${a[2]} ${a[3]} ${a[4]}`},kr=e=>{const n=e.replace(/\s/g,""),a=n.match(At);return a==null?n:`+614${a[2]}${a[3]}${a[4]}`},Bn=e=>Qe(At)(e)||Qe(yr)(e),$n=Qe(wr),xr=Qe(vr),Nr=({formId:e,profile:n,categoryId:a,categoryName:s})=>{const{service:i}=O(),r=()=>{i.trackActivityCompletedAsync(a,a,s,"typeform")};let l={};return n&&(l={email:n.email,first_name:n.firstName,last_name:n.lastName,mobile:On(n.mobilePhone),profile_id:n.profileId,account_id:n.accountId,partner_id:n.partnerId,customer_id:n.customerId,campaign_class:"Platform",campaign_source:"Flare",campaign_medium:"Web Benefits",campaign_name:"Benefits Assessment",skip_welcome:"true"}),t(Na.Widget,{id:e,className:"mx-auto w-screen h-screen md:h-[40rem] md:w-[95vw] md:max-w-[70rem]",hidden:l,inlineOnMobile:!0,onSubmit:r})},Ar=(e,n,a)=>{var d,o,p,g,w,N,k,v,L,m,u,S;const s=ee(z),i=T(s,void 0),r=i==null?void 0:i.basicProfile,l=i==null?void 0:i.accountName;let c={};switch(r&&(c={email:r.email,"first-name":r.firstName,"last-name":r.lastName,mobile:r.mobilePhone,"employer-name":l,"profile-id":r.profileId,"account-id":r.accountId,"partner-id":r.partnerId,"customer-id":r==null?void 0:r.customerId,"sf-class":"Platform","sf-source":"Flare","sf-medium":"Web Benefits","sf-name":"Benefits Assessment"}),a.component){case"activity-assessment":return t("div",{className:"p-10 overflow-x-hidden overflow-y-auto bg-white md:bg-transparent w-screen md:w-auto",children:((d=i==null?void 0:i.workplaceLinkConfig)==null?void 0:d.workplaceBackendToken)&&t("benefits-plan-assessment",{"base-url":e,"profile-id":r.profileId,"access-token":(o=i.workplaceLinkConfig)==null?void 0:o.workplaceBackendToken,"image-url":`${a.heroImageDesktop.fields.file.url}?fm=jpg&q=90&w=640&h=480`,"assessment-title":(k=(N=(w=(g=(p=a.modalBody)==null?void 0:p.content)==null?void 0:g.find(I=>I.nodeType==="heading-1"))==null?void 0:w.content)==null?void 0:N.find(I=>I.nodeType==="text"))==null?void 0:k.value,description:(S=(u=(m=(L=(v=a.modalBody)==null?void 0:v.content)==null?void 0:L.find((I,R)=>R===1))==null?void 0:m.content)==null?void 0:u.find(I=>I.nodeType==="text"))==null?void 0:S.value,"assessment-id":a.assessmentId,"track-client":"webBenefits","track-source":"WebBenefits","track-channel":"web","vertical-alignment":"items-center","skip-intro":"true"})});case"cars-calculator-ungated":return t("div",{className:"md:p-1",children:t("cars-calculator",{"datadog-disabled":!0,...c,"backend-url":e,"hide-employer-name":!0})});case"cars-calculator-gated":return t("div",{className:"md:p-1",children:t("cars-calculator",{"datadog-disabled":!0,...c,"backend-url":e,"is-gated":!0,"hide-employer-name":!0})});case"typeform":return a.typeformId?t(Nr,{formId:a.typeformId,profile:r,categoryId:n.id||"",categoryName:n.title||""}):t(y,{});default:return t(y,{})}},Cr=({category:e,landing:n,apolloBaseUrl:a})=>Ar(a,e,n),ce=({url:e,children:n,className:a,type:s,disabled:i,onClick:r})=>{const l=`block w-full mx-auto md:w-auto md:ml-0 text-center px-4 py-2 border border-transparent shadow-sm
|
|
5
|
+
text-sm leading-6 font-semibold rounded-md text-white bg-primary disabled:bg-gray-100 disabled:border-gray-300 disabled:text-gray-400 ${a}`;return e?t(be,{className:l,href:e,onClick:r,children:n}):t("button",{type:s||"button",className:l,disabled:i,onClick:r,children:n})},Pr={renderText:e=>e.split(`
|
|
6
|
+
`).flatMap((n,a)=>[a>0&&t("br",{}),n]),renderNode:{[M.BLOCKS.PARAGRAPH]:(e,n)=>t("p",{className:"text-xs leading-4 font-normal text-gray-600",children:n}),[M.INLINES.HYPERLINK]:(e,n)=>t(be,{className:"text-blue-600",href:e.data.uri,children:n}),[M.BLOCKS.LIST_ITEM]:(e,n)=>we.documentToReactComponents(e,{renderNode:{[M.BLOCKS.PARAGRAPH]:(a,s)=>t("p",{className:"text-gray-600 leading-5 text-sm ",children:s}),[M.BLOCKS.LIST_ITEM]:(a,s)=>t("li",{className:"flex gap-2",children:[t(Je,{className:"text-primary w-3 h-5",icon:sn}),s]})}})}},Ir=({body:e})=>t(y,{children:we.documentToReactComponents(e,Pr)}),Tr={renderText:e=>e.split(`
|
|
7
|
+
`).flatMap((n,a)=>[a>0&&t("br",{}),n]),renderNode:{[M.BLOCKS.HEADING_1]:(e,n)=>t("h1",{className:"text-2xl leading-8 font-bold pb-2",children:n}),[M.BLOCKS.PARAGRAPH]:(e,n)=>t("p",{className:"text-base leading-6 font-normal text-gray-600 pb-4",children:n}),[M.BLOCKS.UL_LIST]:(e,n)=>t("ul",{className:"py-4 px-3 md:px-8 rounded-lg border-gray-200 border-2 shadow-sm flex flex-col space-y-2 mb-4",children:n}),[M.BLOCKS.LIST_ITEM]:(e,n)=>we.documentToReactComponents(e,{renderNode:{[M.BLOCKS.PARAGRAPH]:(a,s)=>t("p",{className:"text-gray-600 leading-5 text-sm ",children:s}),[M.BLOCKS.LIST_ITEM]:(a,s)=>t("li",{className:"flex gap-2",children:[t(Je,{className:"text-primary w-3 h-5",icon:sn}),s]})}})}},Sr=({body:e})=>t(y,{children:we.documentToReactComponents(e,Tr)}),Lr=()=>{const[e,n]=f();h(()=>{(async()=>{try{const i=await te.loadBenefitsMarketplaceOfferAsync();n(i)}catch{}})()},[]);const[a,s]=f(!1);return e?t(y,{children:[t("div",{className:"flex mt-6",children:[t(Je,{className:"text-cyan-500 w-4 h-4",icon:Aa}),t("span",{className:"cursor-pointer text-xs text-primary ml-1",onClick:()=>s(!0),children:e.complianceContent.title})]}),t(et,{isOpen:a,fullWidthMobile:!0,onClose:()=>{},children:[t("div",{className:`${a?"block":"hidden"} absolute top-0 right-0 pt-4 pr-4 z-30`,children:t("button",{type:"button",className:"uiid-perk-details-close-button focus:outline-none bg-white rounded-md text-gray-500",onClick:()=>s(!1),children:[t("span",{className:"sr-only",children:"Close"}),t(Ae,{className:"h-6 w-6 border-0","aria-hidden":"true"})]})}),t("div",{className:"p-8",children:[t("h3",{className:"text-base font-semibold text-gray-900 mb-4",children:e.complianceContent.title}),t("div",{className:"prose-a:text-blue-500 prose-a:underline text-sm text-gray-600",dangerouslySetInnerHTML:{__html:e.complianceContent.subtitle}})]})]})]}):null},Er=({data:e,onClick:n,onClose:a,onPrevious:s,phiia:i})=>{var g,w;let r;const l=ee(z),c=T(l,void 0),d=(e==null?void 0:e.component)==="activity-assessment"&&!((g=c==null?void 0:c.workplaceLinkConfig)!=null&&g.workplaceBackendToken),o=(e==null?void 0:e.component)==="shopify"&&!((w=c==null?void 0:c.workplaceLinkConfig)!=null&&w.workplaceBackendToken);((e==null?void 0:e.component)==="external-link"||d)&&(e!=null&&e.externalUrl)&&(r=e==null?void 0:e.externalUrl);const p=async()=>{(e==null?void 0:e.component)==="shopify"&&await hn(c.workplaceLinkConfig.workplaceBackendToken,c.basicProfile.profileId),n()};return e?t("div",{className:s?"absolute md:relative bg-white rounded-lg":"rounded-lg",children:t("div",{className:"relative",children:[a&&t("div",{className:"absolute top-0 right-0 pt-2 md:pt-4 pr-4 z-30",children:t("button",{type:"button",className:"uiid-perk-details-close-button focus:outline-none bg-white rounded-md text-gray-500",onClick:a,children:[t("span",{className:"sr-only",children:"Close"}),t(Ae,{className:"h-6 w-6 border-0","aria-hidden":"true"})]})}),s&&t("div",{className:"absolute top-0 left-0 pl-4 pt-4 md:pl-4 md:pt-5 lg:pl-16 lg:pt-8 xl:pl-20 xl:pt-12 z-30",children:t("button",{type:"button",className:"uiid-perk-details-close-button focus:outline-none bg-white rounded-md text-gray-500",onClick:s,children:t("span",{className:"inline-flex text-sm leading-5 font-medium text-gray-600",children:[t(Ca,{className:"h-5 w-5 border-0 mr-2","aria-hidden":"true"}),"Back"]})})}),t("div",{className:"w-full grid grid-cols-1 md:grid-cols-2 md:gap-10 lg:gap-14 xl:gap-16 p-0 md:p-10 lg:p-16 xl:p-20 md:relative",children:[e.heroImageDesktop&&t("img",{src:`${e.heroImageDesktop.fields.file.url}?fm=jpg&q=90&w=640&h=480`,className:"mx-auto w-full order-2 self-start hidden md:block"}),e.heroImageMobile&&t("img",{src:`${e.heroImageMobile.fields.file.url}?fm=jpg&q=90&w=640&h=480`,className:"mx-auto mt-10 w-full self-start block md:hidden"}),t("div",{className:"flex flex-col self-start p-4 md:p-0 md: mt-4",children:[t(Sr,{body:e.modalBody}),t(ce,{className:"mb-6",onClick:p,url:r,disabled:o,children:e.buttonText}),e.disclaimer&&t(Ir,{body:e.disclaimer}),i?t(Lr,{}):null]})]})]})}):t(y,{})},Or=({items:e,onClick:n})=>t("div",{className:"mx-auto w-screen md:h-auto md:w-[95vw] md:max-w-[70rem] lg:px-16 px-6 py-6 md:py-16",children:[t("h1",{className:"text-2xl leading-8 font-bold text-gray-600 text-center",children:"Offers available"}),t("div",{className:"w-full mx-auto flex flex-wrap items-stretch justify-center gap-8 gap-y-8 md:gap-x-24 py-10",children:e.map((a,s)=>t(xt,{imageUrl:a.imageUrl,className:"md:w-80 w-full",imageClassName:"md:h-32 w-full object-cover",children:[t("div",{children:[t("h2",{className:"text-lg font-bold text-gray-900 pb-0",children:a.title}),t("h3",{className:"text-sm text-gray-600 pb-2",children:a.subtitle}),t("div",{className:"flex pb-4",children:t("div",{className:"w-auto px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800",children:a.type})})]}),t(ce,{className:"md:w-full mx-0 mb-1",onClick:()=>n(a.id),children:a.buttonText})]},a.id))})]}),Br=()=>t("div",{className:"w-full grid grid-cols-1 md:grid-cols-2 md:gap-10 lg:gap-14 xl:gap-16 p-5 md:p-10 lg:p-16 xl:p-20 md:relative",children:[t(x,{className:"mx-auto w-full order-2 self-start hidden md:block",height:25}),t(x,{className:"ml-auto my-10 w-full self-start block md:hidden",height:12}),t("div",{className:"flex-col gap-3 md:gap-6 flex-wrap hidden md:flex",children:[t(x,{width:18,height:2}),t(x,{width:18,height:4}),t(x,{width:20,height:10}),t(x,{width:10,height:2}),t(x,{width:20,height:6})]}),t("div",{className:"flex flex-col md:flex-row gap-3 md:gap-6 flex-wrap md:hidden",children:[t(x,{height:2}),t(x,{height:4}),t(x,{height:2}),t(x,{height:6})]})]}),$r=()=>{const[e,n]=f(!1),[a,s]=f(),[i,r]=f([]),[l,c]=f(),[d,o]=f("LOADING"),p=_(null),g=_(null),w=_(null),{service:N}=O(),k=()=>{var A;return(A=p.current)==null?void 0:A.scrollIntoView({behavior:"smooth",block:"start"})},v=()=>{var A;return(A=g.current)==null?void 0:A.scrollIntoView({behavior:"smooth",block:"start"})},L=()=>{var A;return(A=w.current)==null?void 0:A.scrollIntoView({behavior:"smooth",block:"start"})},m=()=>d==="LOADING",u=()=>d==="SELECTION",S=()=>d==="LANDING",I=()=>d==="ACTION",R=ee(z),tt=T(R,void 0),Gn=()=>{var A,E,fe;I()?v():(l==null?void 0:l.component)!=="shopify"&&(l==null?void 0:l.component)!=="external-link"&&((l==null?void 0:l.component)!=="activity-assessment"||(A=tt==null?void 0:tt.workplaceLinkConfig)!=null&&A.workplaceBackendToken)&&o("ACTION"),l&&a&&N.trackActivityActionedAsync(a.id,((E=l.selectionTile)==null?void 0:E.activityId)||l.id,((fe=l.selectionTile)==null?void 0:fe.activityName)||a.title,l.component)},Ee=()=>{a&&N.trackCategoryClosedAsync(a.id,a.title,d),j("/")},Qn=A=>{const E=i.filter(fe=>fe.id===A)[0];A===(l==null?void 0:l.id)?o("LANDING"):c(E),E&&a&&N.trackActivityStartedAsync(a.id,E.selectionTile.activityId,E.selectionTile.activityName,E.component)},Yn=()=>{o("SELECTION")};h(()=>{I()&&v(),S()&&L(),u()&&k()},[d,l]),h(()=>{l&&d!=="LANDING"&&setTimeout(()=>o("LANDING"),100)},[l]),h(()=>{e&&a&&N.trackCategoryOpenedAsync(a.id,a.title)},[a,e]),h(()=>{const A=[Z.viewLandingState$.subscribe(({isOpen:E,category:fe,landingSelection:Oe})=>{n(E),E&&(s(fe),r(Oe),Oe.filter(Kn=>Kn.selectionTile).length>1?(o("SELECTION"),c(void 0)):Oe.length>0?(c(Oe[0]),o("LANDING")):(c(void 0),o("LOADING")))})];return()=>{A.map(E=>E.unsubscribe())}},[]);const Pt=i.filter(A=>A.selectionTile).map(A=>{var E;return{title:A.selectionTile.displayTitle,id:A.id,subtitle:A.selectionTile.subtitle,buttonText:A.selectionTile.buttonText||"Learn more",type:"Advertisement",imageUrl:`${(E=A.selectionTile.tileImage)==null?void 0:E.fields.file.url}?fm=jpg&q=90&w=640&h=480`}})||[],nt=Pt.length>1;return t(et,{isOpen:e,fullWidthMobile:!0,onClose:Ee,children:t("div",{className:"w-screen md:w-auto md:max-w-[70rem] md:rounded-lg",children:[t("div",{className:`${e?"block":"hidden"} absolute top-0 right-0 pt-4 pr-4 z-30`,children:t("button",{type:"button",className:"uiid-perk-details-close-button focus:outline-none bg-white rounded-md text-gray-500",onClick:Ee,children:[t("span",{className:"sr-only",children:"Close"}),t(Ae,{className:"h-6 w-6 border-0","aria-hidden":"true"})]})}),t("div",{className:m()?"md:grid":"hidden",children:t(Br,{})}),nt&&t("div",{ref:p,className:u()?"md:grid":"md:hidden",children:t(Or,{items:Pt,onClick:Qn})}),t("div",{ref:w,className:S()?"md:grid":"hidden",children:t(Er,{data:l,onClick:Gn,onClose:nt&&Ee||void 0,onPrevious:nt&&Yn||void 0,phiia:!!(a!=null&&a.title.toLowerCase().includes("health"))})}),t("div",{ref:g,className:`${I()?"block":"hidden"} h-screen md:h-auto absolute md:relative md:rounded-lg bg-white`,children:t("div",{className:"m-auto relative",children:[t("div",{className:"md:hidden absolute top-0 right-0 pt-4 pr-4 z-30",children:t("button",{type:"button",className:"uiid-perk-details-close-button focus:outline-none bg-white rounded-md text-gray-500",onClick:Ee,children:[t("span",{className:"sr-only",children:"Close"}),t(Ae,{className:"h-6 w-6 border-0","aria-hidden":"true"})]})}),a&&l&&t(Cr,{apolloBaseUrl:D.getConfig().apolloBaseUrl,category:a,landing:l})]})})]})})},_n="dd/MM/yyyy",Rn="hh:mm a",lt="ccc d MMM",_r="p",Rr=(e,n,a)=>{if(e.data.dateRange){const s=Q(a,!1),i=Q(new Date(e.data.dateRange.end),e.data.dateRange.allDay);switch(n){case"Upcoming":return e.type==="customEvent"&&s<=i;case"Past":return e.type==="customEvent"&&s>i;case"Library":return e.type==="eventTemplate"}}else switch(n){case"Library":return e.type==="eventTemplate"}return!1},il=(e,n)=>e.filter(a=>Rr(a,n,new Date)),Q=(e,n)=>n?new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0,0):new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0),ll=(e,n)=>{const a=new Date,s=Fa(`${e} ${n||"12:00 AM"}`,`${_n} ${Rn}`,a);return n?Ot(s):(a.setUTCFullYear(s.getFullYear()),a.setUTCMonth(s.getMonth()),a.setUTCDate(s.getDate()),a.setUTCHours(0,0,0,0),Ot(a))},cl=(e,n)=>({date:me(Q(e,n),_n),time:n?void 0:me(e,Rn)}),ol=(e,n,a)=>{if(!e.data.dateRange)return 1;if(!n.data.dateRange)return-1;if(e.data.dateRange&&n.data.dateRange){const s=Q(new Date(e.data.dateRange.start),e.data.dateRange.allDay),i=Q(new Date(n.data.dateRange.start),n.data.dateRange.allDay),r=s<i?-1:1;return a.filter==="Past"?r*-1:r}else return 0},Mr=(e,n,a)=>{const s=Q(new Date(e),a),i=Q(new Date(n),a),r=s.getTime()===i.getTime()?me(s,lt):`${me(s,lt)} - ${me(i,lt)}`,l=a?"":`, ${me(new Date(e),_r)}`;return`${r}${l}`},dl=(e,n)=>n?e?e.getMonth()!==n.getMonth()?Qt(e):void 0:"More":e?Qt(e):void 0,ml=(e,n)=>e&&n?e.getFullYear()!==n.getFullYear()?e.getFullYear().toString():void 0:e==null?void 0:e.getFullYear().toString(),ul=(e,n,a)=>{const s=e[n],i=e[n-1];if(n===0){if(s.data.dateRange){const r=Q(new Date(s.data.dateRange.start),s.data.dateRange.allDay);return a(r,void 0)}}else if(i.data.dateRange){const r=Q(new Date(i.data.dateRange.start),i.data.dateRange.allDay);if(s.data.dateRange){const l=Q(new Date(s.data.dateRange.start),s.data.dateRange.allDay);return a(l,r)}else return a(void 0,r)}},Qt=e=>e.toLocaleString("default",{month:"long"})+" "+(e==null?void 0:e.getFullYear().toString()),Ur=({actionButton:e,item:n,itemId:a,onClose:s})=>{var l,c;const i=((l=n.backdrop)==null?void 0:l.downloadUrl)??Tn,r=(c=n.icon)==null?void 0:c.downloadUrl;return t("div",{className:"uiid-perk-details md:w-160 first-letter:overflow-hidden",children:[t("div",{className:"absolute top-0 right-0 pt-4 pr-4 z-30",children:t("button",{type:"button",className:"uiid-perk-details-close-button focus:outline-none bg-white rounded-md text-gray-500",onClick:s,children:[t("span",{className:"sr-only",children:"Close"}),t(tn,{className:"h-6 w-6 border-0","aria-hidden":"true"})]})}),e&&t("div",{className:"absolute top-0 left-0 pt-4 pl-4 z-30",children:e}),t("div",{className:"relative bg-cover bg-center",style:`background-image: url(${i})`,children:[t("div",{className:"absolute inset-0 bg-gradient-to-t from-black opacity-90"}),t("div",{className:"relative flex items-end py-4 px-8 h-64",children:t("div",{className:"flex items-center",children:[!n.dateRange&&t("div",{className:"h-24 w-24 flex-shrink-0",children:t("div",{className:"bg-gray-200 rounded-lg",children:r?t("img",{className:"h-24 w-24 object-contain rounded-lg",src:r,alt:""}):t("div",{className:"h-24 w-24 rounded-lg text-gray-800 grid",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-12 place-self-center",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7"})})})})}),t("div",{className:`text-white ${n.dateRange?"":"pl-4"}`,children:[t("div",{className:"uiid-perk-details-title text-xl leading-6 md:text-3xl md:leading-9 font-extrabold",children:n.title}),t("div",{className:"relative text-sm leading-4 md:text-base md:leading-6 font-medium",children:[n.dateRange?Mr(n.dateRange.start,n.dateRange.end,n.dateRange.allDay):n.subtitle,n.dateRange&&n.location&&t(y,{children:[t("span",{className:"pipe pipe-white pipe-medium mx-3"}),t("span",{children:n.location})]})]}),t(Nt,{className:"uiid-perk-details-tag",name:n.category,size:"xs"})]})]})})]}),t("div",{className:"flex flex-col p-8",children:[t("div",{className:"flex-grow",children:[n.dateRange&&t("p",{className:"text-lg leading-8 font-semibold mb-4",children:n.subtitle}),t("p",{className:"whitespace-pre-wrap",children:n.description}),n.linkLabel&&n.url&&t(be,{href:n.url,onClick:()=>a&&ut.trackPerkVisitedAsync({benefit:n,benefitId:a}),className:"w-auto mt-6 inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 text-sm leading-5 font-medium",children:n.linkLabel})]}),n.attachments&&n.attachments.length>0&&t("div",{className:"border border-gray-200 rounded-md mt-8",children:t("div",{className:"pl-3 pr-4 py-3 flex items-center justify-between text-sm",children:[t("div",{className:"w-0 flex-1 flex items-center",children:[t(Pa,{className:"flex-shrink-0 h-5 w-5 text-gray-400","aria-hidden":"true"}),t("span",{className:"ml-2 flex-1 w-0 truncate",children:n.attachments[0].title})]}),t("div",{className:"ml-4 flex-shrink-0",children:t("a",{href:n.attachments[0].downloadUrl,target:"_blank",className:"font-medium text-primary",onClick:()=>a&&ut.trackDocumentClickedAsync({benefit:n,benefitId:a}),children:"View"})})]})})]})]})},Vr=()=>{const[e,n]=f(!1),[a,s]=f(C);h(()=>{const r=[Z.viewPerkState$.subscribe(({isOpen:l,perk:c})=>{n(l),s(c)})];return()=>{r.map(l=>l.unsubscribe())}},[]);const i=bt(a);return i?t(et,{isOpen:e,onClose:B.closePerk,children:t(Ur,{item:i.benefit,itemId:i.benefitId,onClose:B.closePerk})}):t("div",{})},_e=({category:e,slug:n})=>{const a=ye.useContext(z),[s,i]=f(C),[r,l]=f(),[c,d]=f(),[o,p]=f(),[g,w]=f(),{service:N}=O();h(()=>{N.trackBenefitsOpenedAsync()},[]),h(()=>{n&&(!g||g.length>0&&g[0].id!=n)&&(async()=>w(await Es(n)))()},[n,g]),h(()=>{const m=Z.categoryState$.subscribe(u=>{var S;if((S=Ce(a).workplaceLinkConfig)!=null&&S.workplaceBackendToken)l(u);else{const I=u==null?void 0:u.filter(R=>R.title!=="Everyday");l(I)}});return()=>m.unsubscribe()},[a]),h(()=>{const m=[Z.homePageState$.subscribe(u=>{i(u)}),Z.benefitsPlanHomeState$.subscribe(u=>{d(u)}),Z.bannerItems$.subscribe(u=>{p(u)}),B.getViewPageState().subscribe(),B.getMarketplaceCategoryState().subscribe(),B.getBenefitsPlanHome().subscribe(),B.getBannerItems(Ce(a)).subscribe()];return()=>{m.map(u=>u.unsubscribe())}},[]),h(()=>{if(e&&!r&&B.openLanding([]),e&&r){const m=r==null?void 0:r.find(u=>u.title.toLocaleLowerCase()===e.toLocaleLowerCase());m?B.openLanding(m.landings,m):(B.closeLanding(),j("/"))}},[r,e]),h(()=>{!n&&!e&&(w(void 0),B.closeLanding())},[n,e]),h(()=>{if(n&&!g&&B.openLanding([]),n&&r&&g)if(g.length>0){const m=r==null?void 0:r.find(u=>{var S;return u.title.toLocaleLowerCase()===((S=g[0].categoryTitle)==null?void 0:S.toLocaleLowerCase())});B.openLanding(g,m)}else B.closeLanding(),j("/")},[n,g,r]);const k=We.pipe(s,Ia(m=>m.promotedBenefits)),v=We.pipe(k,Xe(()=>!1,m=>m.length>0)),L=kn.isPba();return t(y,{children:[!L&&t(yt,{user:a}),t("div",{className:"max-w-[90rem] min-w-5xl mx-auto py-8 px-4 sm:px-6 lg:px-8",children:[t("div",{className:"md:mb-16 mb-5",children:t(js,{offers:o})}),(!r||r.length>0&&c)&&t("div",{className:"md:mb-16 mb-5",children:t(Qs,{categories:r,content:c})}),v&&t("div",{className:"md:mb-16 mb-5",children:t(gr,{perks:k})}),t("div",{children:t(pr,{})})]}),t(Vr,{}),t($r,{})]})};var Yt,Kt;const Dr=()=>({all:[],money:[],mind:[],body:[],work:[],life:[]}),Fr=()=>({currentTab:"all",searchString:""});let jr=(Yt=Te({name:"explore-wellbeing",cache:{ttl:"3600000"},resettable:!0,producerFn:Se}),Yt(Kt=class extends nn{constructor(){super(Fr())}})||Kt);const je=new jr;class Ye extends an{constructor(a){super(a);b(this,"currentTab$",this.select(a=>a.currentTab));b(this,"previewsOnStage$",Me([this.selectAll(),this.select(a=>a.searchString),this.select(a=>a.currentTab)]).pipe(Ue(([a,s,i])=>this.getHasCache()?se.fromNullable(Ye.filterPreviews(a,s,i)):C)));this.store=a}get isPreviewsLoaded(){var a;return(((a=this.getValue().ids)==null?void 0:a.length)??0)>0}static filterPreviews(a,s,i){return Ye.searchPreviews(a,s).filter(r=>i==="all"||r.pillar===i)}static searchPreviews(a,s){return a.filter(i=>i.title.toLowerCase().includes(s.toLowerCase())||i.subtitle.toLowerCase().includes(s.toLowerCase()))}static classifyPreviews(a){const s=Dr();return a.forEach(i=>{const r=i.pillar;s[r].push(i)}),s.all=a,s}}const Ct=new Ye(je),Wr=()=>({setTab:e=>{je.update(n=>{n.currentTab=e})},searchPreviews:e=>{je.update(n=>{n.searchString=e,n.currentTab="all"})},loadEntryPreviews:()=>Ct.selectCached(()=>te.loadAvailableEntryPreviewsAsync(),e=>je.set(e))}),xe=Wr(),Hr=()=>t(y,{children:[...Array(3).keys()].map((e,n)=>t(Ln,{},n))}),zr=()=>{const[e,n]=f(C),{service:a}=O();h(()=>{const r=[Ct.previewsOnStage$.subscribe(n)];return()=>{r.map(l=>l.unsubscribe())}},[]);const s=async r=>{r.externalLink||j(`/wellbeing-hub/articles/${r.slug}`),a.trackEntryViewed({contentId:r.id,contentTitle:r.slug,contentType:r.primaryContentType,contentPillar:r.pillar})},i=T(e,[]).length>0?T(e,[]).map(r=>t(xt,{className:"uiid-preview-item",imageUrl:`${r.coverPhotoUrl}?fm=jpg&q=50&w=640&h=480`,externalLink:r.externalLink,onClick:()=>s(r),children:t("div",{className:"flex-1 pb-7 pt-2 px-2",children:[t("div",{className:"flex items-center",children:[t(Nt,{className:"uiid-preview-tag",name:r.pillar}),t("div",{className:"text-sm leading-5 font-normal px-2 text-gray-300",children:"|"}),t("div",{className:"text-xs leading-4 font-semibold tracking-wider uppercase text-gray-400",children:r.primaryContentType}),t("div",{className:"flex-grow"}),r.externalLink&&t(Ta,{className:"h-5 w-5 text-gray-400 border-0"})]}),t("div",{className:"block mt-2",children:[t("p",{className:"uiid-preview-item-title text-xl font-semibold text-gray-900",children:r.title}),t("p",{className:"uiid-preview-item-subtitle mt-1 text-sm text-gray-500",children:r.subtitle})]})]})},r.id)):t(In,{children:[t("p",{children:"Sorry, no entries were found matching your search request."}),t("p",{children:"Please try another search."})]});return t(Pn,{className:"uiid-preview-grid",children:he(e)?t(Hr,{}):i})},qr=()=>{const[e,n]=f("all"),{service:a}=O();h(()=>{const r=[Ct.currentTab$.subscribe(n),xe.loadEntryPreviews().subscribe()];return()=>{r.map(l=>l.unsubscribe())}},[]),h(()=>()=>{xe.searchPreviews("")},[]);const s=async r=>{xe.setTab(r),j(`/wellbeing-hub/${r}`),a.trackEntriesListViewedAsync(r)},i=async r=>{xe.searchPreviews(r),a.trackEntriesListSearchedAsync(r)};return t("div",{className:"flex flex-col",style:{minHeight:window.innerHeight},children:[t("div",{className:"sm:flex sm:items-center sm:justify-between",children:[t("div",{className:"flex",children:t("div",{className:"text-3xl leading-9 font-semibold text-gray-700",children:"Explore the 5 pillars of wellness"})}),t("div",{className:"mt-4 sm:mt-0",children:t(Cn,{onSearchEvent:i})})]}),t("div",{className:"mt-4",children:t(An,{currentTab:e,onTabClicked:s})}),t("div",{className:"mt-6",children:t(zr,{})})]})},Gr="/benefits/app/assets/wellbeing_banner-6903d615.png",Qr=({bgImageUrl:e,className:n,children:a,excludeGradient:s})=>{const i=e?{backgroundImage:`url(${e})`}:{};return t("div",{className:X("relative w-full rounded-lg bg-cover bg-center",n??""),style:i,children:[!s&&t(y,{children:[t("div",{className:"absolute inset-0 rounded-lg bg-black bg-opacity-10"}),t("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-r from-black opacity-80"})]}),t("div",{className:"relative h-full rounded-lg overflow-hidden",children:a})]})},Yr=({children:e})=>t("div",{className:"relative filter inline-flex items-center w-12 h-12 rounded-lg text-md font-medium bg-black bg-opacity-40 text-gray-800",children:[t("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-b from-black bg-opacity-50"}),t("div",{className:"relative h-full w-full flex flex-wrap content-center justify-center",children:e})]}),Kr=()=>t("div",{className:"flex gap-4",children:He.map(e=>t(Yr,{children:t("div",{className:xn[e],children:Nn(e)})}))}),Xr=()=>t(Qr,{className:"h-full",bgImageUrl:Gr,children:t("div",{className:"px-4 py-10 md:px-8 md:py-24 text-white",children:[t("div",{className:"text-2xl leading-8 font-bold",children:"Wellbeing Hub"}),t("div",{className:"max-w-sm text-md md:text-lg leading-6 mt-1 font-medium hidden md:block",children:"Providing education, support and tools to help you live a healthier and happier life!"}),t("div",{className:"pt-4 hidden md:block",children:t(Kr,{})})]})}),Xt=({pillarFilter:e})=>{const n=_(null),{service:a}=O();return h(()=>{a.trackWellbeingOpenedAsync()},[]),h(()=>{var s;xe.setTab(e??"all"),a.trackEntriesListViewedAsync(e??"all"),e&&((s=n.current)==null||s.scrollIntoView({behavior:"smooth"}))},[e,n]),t("div",{className:"max-w-7xl min-w-5xl mx-auto px-4 py-8 sm:px-6 lg:px-8 mb-20",children:[t("div",{className:"flex flex-col md:flex-row",children:t("div",{className:"w-full",children:t(Xr,{})})}),t("div",{className:"mt-8 pt-4",ref:n,children:t(qr,{})})]})},Jr=({pages:e,homePageUrl:n})=>t("nav",{className:"bg-white border-b border-gray-200 flex","aria-label":"Breadcrumb",children:t("ol",{role:"list",className:"max-w-screen-xl w-full mx-auto px-4 flex space-x-4 sm:px-6 lg:px-8",children:[t("li",{className:"flex",children:t("div",{className:"flex items-center",children:t("a",{href:n??"#",className:"text-gray-400 hover:text-gray-500",children:[t(Sa,{className:"flex-shrink-0 h-5 w-5","aria-hidden":"true"}),t("span",{className:"sr-only",children:"Home"})]})})}),e.map((a,s)=>t("li",{className:"flex",children:t("div",{className:"flex items-center",children:[t("svg",{className:"flex-shrink-0 w-6 h-full text-gray-200",viewBox:"0 0 24 44",preserveAspectRatio:"none",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t("path",{d:"M.293 0l22 22-22 22h1.414l22-22-22-22H.293z"})}),t("a",{href:a.href,className:"ml-4 text-sm font-medium text-gray-500 hover:text-gray-700","aria-current":e.length===s+1?"page":void 0,children:a.name})]})},a.name))]})}),Zr=(e,n,a)=>{h(()=>{let s=!0;return e(()=>s),()=>{s=!1,We.pipe(n,Xe(()=>{},i=>i()))}},a)},ei=(e,n)=>{h(()=>{window.scrollTo(e)},n)},ti=(e,n)=>{ei({top:0,...e},n)},ni={renderNode:{[M.BLOCKS.EMBEDDED_ASSET]:e=>{const{title:n,description:a,file:s}=e.data.target.fields;return t("figure",{children:[t("img",{src:`${s.url}?fm=jpg&q=90&w=640&h=480`,alt:n}),t("figcaption",{children:a})]})}}},ai=({body:e})=>t("article",{className:"prose prose-lg prose-indigo",children:we.documentToReactComponents(e,ni)}),si=()=>t("div",{className:"max-w-3xl mx-auto py-6 px-4 sm:py-10 sm:px-6 lg:px-8 animate-pulse",children:[t("div",{class:"h-8 bg-gray-200 rounded w-2/3"}),t("div",{className:"flex space-x-3 mt-4",children:[t("div",{className:"flex-shrink-0",children:t("div",{class:"rounded-full bg-gray-200 h-10 w-10 mr-1"})}),t("div",{className:"min-w-0 flex flex-col justify-between flex-1",children:[t("div",{class:"h-4 bg-gray-200 rounded w-1/3"}),t("div",{class:"h-4 bg-gray-200 rounded w-1/4"})]})]}),t("div",{className:"mt-8",children:t("div",{class:"flex-1 space-y-8 py-1",children:[t("div",{class:"h-8 bg-gray-200 rounded w-3/4"}),t("div",{class:"h-48 bg-gray-200 rounded w-full"}),t("div",{class:"h-24 bg-gray-200 rounded w-3/4"}),t("div",{class:"h-36 bg-gray-200 rounded w-full"}),t("div",{class:"h-12 bg-gray-200 rounded w-1/4"})]})})]}),ri=({articleSlug:e})=>{const[n,a]=f();if(Zr(async i=>{const r=await kt(te.loadArticleAsync(e),700);i()&&a(r)},se.none,[e]),ti(),!n)return t(Bt.div,{initial:{opacity:0},animate:{opacity:1},children:t(si,{})},"loading");const s=[{name:n==null?void 0:n.pillar,href:`#/wellbeing-hub/${n==null?void 0:n.pillar.toLowerCase()}`}];return t(y,{children:[t(Jr,{pages:s,homePageUrl:"#/wellbeing-hub"}),t(Bt.div,{initial:{opacity:0},animate:{opacity:1},children:t("div",{className:"max-w-3xl mx-auto py-6 px-4 sm:py-10 sm:px-6 lg:px-8",children:[t("h2",{className:"text-4xl leading-10 font-extrabold tracking-tight",children:n.title}),t("div",{className:"flex space-x-3 mt-4",children:[t("div",{className:"flex-shrink-0",children:t("img",{className:"h-10 w-10 rounded-full",src:`${n.author.fields.avatar.fields.file.url}?fm=jpg&q=90&w=640&h=480`,alt:""})}),t("div",{className:"min-w-0 flex-1",children:[t("p",{className:"text-sm font-medium text-gray-900",children:n.author.fields.name}),t("p",{className:"text-sm text-gray-500",children:me(new Date(n.originalPublicationDate),"dd MMM yyyy")})]})]}),t("div",{className:"mt-8",children:t(ai,{body:n.articleBody})})]})},"article")]})},ii=()=>{const e=ye.useContext(z),n=kn.isPba();return t(y,{children:[!n&&t(yt,{user:e}),t(pt,{history:wt(gt()),children:[t(F,{path:"/wellbeing-hub",component:Xt}),t(F,{path:"/wellbeing-hub/:pillarFilter",component:Xt}),t(F,{path:"/wellbeing-hub/articles/:articleSlug",component:ri})]})]})};var Mn=(e=>(e.Auth_AccountDisabled="Sorry, your account has been deactivated. Please contact Flare if there are any issues.",e.Auth_AccountLocked="Sorry, your account is currently locked due to too many attempts. Please try again later.",e.Auth_Unregistered="Sorry, we are currently experiencing some issues. Please try again later.",e.Auth_InvalidVerificationCode="Your one time passcode doesn't look right. Please try again.",e.Auth_SessionExpired="Sorry, looks like your session has expired. Please try again.",e.Validation_InvalidPhoneNumber="Please enter a valid Australian mobile number beginning with 04.",e))(Mn||{});const Un="Sorry, we are currently experiencing some issues. Please try again later.",li=e=>e&&Mn[e]||Un,ci="/benefits-onboarding/backend/auth/signup",oi="/benefits-onboarding/backend/auth/verify",di="/benefits-onboarding/backend/auth/resend",ct={source:"WebBenefits",channel:"web"},W=e=>{const n=e.json;throw new Error(li(n==null?void 0:n.code))};class mi{signUpAsync(n){return re.instance.url(ci).query(ct).post(n).internalError(W).badRequest(W).unauthorized(W).fetchError(W).res()}verifyAsync(n){return re.instance.url(oi).query(ct).post(n).internalError(W).badRequest(W).unauthorized(W).fetchError(W).res()}resendAsync(){return re.instance.url(di).query(ct).post().internalError(W).badRequest(W).unauthorized(W).fetchError(W).res()}}const ot=new mi,ui="/benefits/app/assets/check-57fe1dcb.svg",hi=e=>t("div",{className:"h-96 grid",children:[t("div",{className:"grid place-self-center",children:[t("div",{className:"bg-[#EAF0FE] w-16 h-16 rounded-lg flex items-center justify-center mx-auto mb-10",children:t("img",{className:"w-10",src:ui})}),t("h1",{className:"text-3xl leading-9 font-bold text-gray-900 font-sans mb-3",children:"You’re all set!"}),t("p",{className:"px-8 text-base leading-6 font-normal text-gray-500",children:"Your benefits plan and exclusive offers are waiting for you."})]}),t(ce,{className:"md:w-full md:text-base py-3 place-self-end",onClick:e.onComplete,children:"Start exploring your benefits"})]}),fi="/benefits/app/assets/warning-a7f1af23.svg",pi=e=>t("div",{className:"h-96 grid",children:[t("div",{className:"grid place-self-center",children:[t("div",{className:"bg-[#FEE2E2] w-16 h-16 rounded-lg flex items-center justify-center mx-auto mb-10",children:t("img",{className:"w-10",src:fi})}),t("h1",{className:"text-3xl leading-9 font-bold text-gray-900 font-sans mb-3",children:"Something went wrong"}),t("p",{className:"px-8 text-base leading-6 font-normal text-gray-500",children:"We’re having some technical difficulties at the moment. Click the button below to proceed to your benefits."})]}),t(ce,{className:"md:w-full md:text-base py-3 place-self-end",onClick:e.onError,children:"Dismiss"})]}),gi="/benefits/app/assets/suitcase-6471ad05.svg",bi=La(({label:e,id:n,type:a,placeholder:s,setPlaceholderOnFocus:i,value:r,className:l,onChange:c,onBlur:d,error:o},p)=>{const g=k=>{k.target instanceof HTMLInputElement&&c(k.target.value.trim())},w=k=>{k.target instanceof HTMLInputElement&&d&&d(k.target.value.trim())},N=()=>{s&&i&&!(r!=null&&r.trim())&&c(s)};return t("div",{className:l,children:[t("label",{htmlFor:n,className:"block text-sm font-medium leading-5 text-gray-900 text-left",children:e}),t("div",{className:"mt-1",children:t("input",{className:"block min-h-[2.25rem] w-full rounded-md border-0 py-1.5 pr-20 text-gray-900 ring-1 ring-inset placeholder:text-gray-400 focus:ring-2 focus:ring-inset text-base sm:text-sm sm:leading-6 ring-gray-300 focus:ring-primary-600",type:a,value:r,name:n,id:n,placeholder:s,onChange:g,onBlur:w,onFocus:N,ref:p})}),o&&t("p",{className:"my-2 text-sm text-red-600 text-left",children:o})]})}),yi=e=>{const n=a=>{a.preventDefault(),e.onSubmit()};return t(y,{children:[t("div",{className:"bg-[#EAF0FE] w-16 h-16 rounded-lg flex items-center justify-center mx-auto mb-10",children:t("img",{className:"w-10",src:gi})}),t("h1",{className:"text-3xl leading-9 font-bold text-gray-900 font-sans mb-3",children:"Confirm your employment"}),t("p",{className:"text-base leading-6 font-normal text-gray-500 mb-6",children:"Your employer has partnered with Flare to provide you access to exclusive benefits. Add your personal mobile number to verify your identity."}),t("form",{onSubmit:n,children:[t(bi,{type:"text",value:e.mobileNumber,label:"Australian Mobile Number",id:"mobile",placeholder:"04",setPlaceholderOnFocus:!0,onChange:e.onChange,error:e.errorMessage}),t(ce,{className:"md:w-full md:text-base py-3 mt-10",type:"submit",disabled:!Bn(e.mobileNumber.replace(/\s/g,"")),children:"Continue"})]})]})},wi="/benefits/app/assets/padlock-8c081120.svg",vi=e=>{const[n,a]=f(e),s=_(),i=Y(()=>{s.current&&clearInterval(s.current)},[]);h(()=>i,[i]);const r=Y(()=>{let l=e;s.current&&clearInterval(s.current),s.current=setInterval(()=>{if(l<0){s.current&&clearInterval(s.current);return}a(l--)},1e3)},[e]);return{countdown:n,restart:r}},ki=({value:e="",numInputs:n=6,onChange:a})=>{const[s,i]=f(0),r=_([]),l=()=>e?e.toString().split(""):[];h(()=>{r.current=r.current.slice(0,n)},[n]),h(()=>{var m;(m=r.current[0])==null||m.focus()},[]);const c=m=>m===""||!isNaN(Number(m)),d=m=>{const u=m.join("");a(u)},o=m=>{const u=l();u[s]=m[0]||"",d(u)},p=m=>{var S,I;const u=Math.max(Math.min(n-1,m),0);r.current[u]&&((S=r.current[u])==null||S.focus(),(I=r.current[u])==null||I.select(),i(u))},g=m=>{const{value:u}=m.target;c(u)&&(o(u),p(s+1))},w=m=>{const{value:u}=m.target;c(u)||u.length===n&&(u.split("").some(I=>!c(I))||(d(u.split("")),p(n-1)))},N=m=>u=>{i(u),m.target.select()},k=()=>{i(s-1)},v=m=>{const u=l();[m.code,m.key].includes("Backspace")?(m.preventDefault(),o(""),p(s-1)):m.code==="Delete"?(m.preventDefault(),o("")):m.code==="ArrowLeft"?(m.preventDefault(),p(s-1)):m.code==="ArrowRight"||m.key===u[s]?(m.preventDefault(),p(s+1)):(m.code==="Spacebar"||m.code==="Space"||m.code==="ArrowUp"||m.code==="ArrowDown")&&m.preventDefault()},L=m=>{m.preventDefault();const u=l();let S=s;const I=m.clipboardData.getData("text/plain").slice(0,n-s).split("");if(!I.some(R=>isNaN(Number(R)))){for(let R=0;R<n;++R)R>=s&&I.length>0&&(u[R]=I.shift()??"",S++);p(S),d(u)}};return t("div",{className:"inline-flex gap-2",children:Array.from({length:n},(m,u)=>u).map(m=>t(y,{children:t("input",{className:"border-gray-300 caret-transparent selection:bg-transparent rounded-lg col-span-1 text-center w-10 h-12 text-xl leading-7 font-normal",value:l()[m]??"",ref:u=>r.current[m]=u,onChange:g,onFocus:u=>N(u)(m),onBlur:k,onKeyDown:v,onPaste:L,autoComplete:"off",type:"text",inputMode:"numeric",onInput:w,"aria-label":"One Time Password"})},m))})},xi=e=>{const{countdown:n,restart:a}=vi(60);h(a,[a]);const s=l=>{l.preventDefault(),e.onSubmit()},i=()=>{a(),e.onResend()},r=On(e.mobileNumber);return t(y,{children:[t("div",{className:"bg-[#EAF0FE] w-16 h-16 rounded-lg flex items-center justify-center mx-auto mb-7",children:t("img",{className:"w-10",src:wi})}),t("h1",{className:"text-3xl leading-9 font-bold text-gray-900 font-sans mb-3",children:"Verify your mobile number"}),r&&t("p",{className:"px-14 text-base leading-6 font-normal text-gray-500 mb-6",children:["An SMS verification code has been sent to the number"," ",t("span",{className:"whitespace-nowrap",children:r})]}),t("form",{onSubmit:s,children:[t(ki,{value:e.otp,numInputs:6,onChange:e.onChange}),t("p",{className:"mt-2 text-center text-xs text-gray-600 disabled:opacity-75 ",children:["Didn't get the code?",t("button",{type:"button",disabled:n!==0,className:"underline mx-2 text-primary disabled:text-gray-600 disabled:hover:bg-transparent disabled:cursor-text disabled:px-0",onClick:i,children:"Resend SMS"}),n!==0&&t(y,{children:["in ",n," secs"]})]}),t("p",{className:"my-2 text-sm text-red-600 text-center",children:e.errorMessage||""}),t(ce,{className:"md:w-full md:text-base py-3 mt-7",type:"submit",disabled:!$n(e.otp),children:"Continue"}),t(ce,{className:"inline md:w-full md:text-base py-3 mt-4 bg-white !border-gray-300 !text-gray-600",onClick:e.onBack,children:[t(Ea,{className:"inline-flex h-4 w-4 mr-2"}),"Back"]})]})]})},Ni=e=>{const[n,a]=f("Loading"),[s,i]=f(),[r,l]=f(),[c,d]=f(),{service:o}=O();h(()=>{var v;if(!e.config){a("Error"),o.trackRegistrationErrorViewedAsync("InitialConfigError");return}(v=e.config)!=null&&v.isEstablished?a("Complete"):(a("Signup"),o.trackRegistrationStartedAsync())},[]);const p=async()=>{if(i(""),r&&Bn(r.replace(/\s/g,"")))try{a("Loading"),d(void 0),await ot.signUpAsync({mobileNumber:kr(r)}),a("Verify"),o.trackRegistrationSubmittedAsync()}catch{a("Error"),o.trackRegistrationErrorViewedAsync("SignupError")}},g=async()=>{if(i(""),c&&$n(c))try{a("Loading"),await ot.verifyAsync({otp:c}),a("Complete"),o.trackRegistrationVerifiedAsync()}catch(v){a("Verify"),v instanceof Error&&v.message&&v.message!==Un?(i(v.message),o.trackRegistrationFailedAsync(v.message)):(a("Error"),o.trackRegistrationFailedAsync("InternalError"),o.trackRegistrationErrorViewedAsync("VerificationError"))}},w=async()=>{i("");try{d(void 0),o.trackRegistrationResentAsync(),await ot.resendAsync()}catch{a("Error"),o.trackRegistrationErrorViewedAsync("ResendError")}},N=()=>{e.onComplete(),o.trackRegistrationCompletedAsync()},k=()=>{e.onError(),o.trackRegistrationErrorDismissedAsync()};return t("div",{className:"min-h-[25rem]",children:[n==="Loading"&&t("div",{className:"flex items-center justify-center h-96 text-primary",children:[t("span",{className:"sr-only",children:"Loading"}),t(Le,{size:10})]}),n==="Signup"&&t(yi,{onSubmit:p,onChange:v=>{l(v),i("")},mobileNumber:r||"",errorMessage:s}),n==="Verify"&&t(xi,{onSubmit:g,onBack:()=>a("Signup"),onResend:w,onChange:v=>{(!v||xr(v))&&d(v),i("")},mobileNumber:r,otp:c,errorMessage:s}),n==="Complete"&&t(hi,{onComplete:N}),n==="Error"&&t(pi,{onError:k})]})},Ai=e=>t("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:e.size==="lg"?"h-10 w-10":"h-5 w-5",children:[t("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM1.99743 8C1.99743 11.3151 4.68487 14.0026 8 14.0026C11.3151 14.0026 14.0026 11.3151 14.0026 8C14.0026 4.68487 11.3151 1.99743 8 1.99743C4.68487 1.99743 1.99743 4.68487 1.99743 8Z",class:e.theme==="light"?"fill-white":"fill-gray-200","fill-opacity":e.theme==="light"?"0.3":"1"}),t("path",{d:"M8 1C8 0.447715 8.44943 -0.00643769 8.99741 0.0624193C9.70527 0.151368 10.3996 0.334798 11.0615 0.608964C12.0321 1.011 12.914 1.60028 13.6569 2.34315C14.3997 3.08602 14.989 3.96793 15.391 4.93853C15.6652 5.60043 15.8486 6.29473 15.9376 7.0026C16.0064 7.55057 15.5523 8 15 8C14.4477 8 14.0085 7.54925 13.9169 7.00462C13.842 6.55939 13.7169 6.12298 13.5433 5.7039C13.2417 4.97595 12.7998 4.31451 12.2426 3.75736C11.6855 3.20021 11.0241 2.75825 10.2961 2.45672C9.87702 2.28313 9.44061 2.15804 8.99538 2.08314C8.45075 1.99152 8 1.55228 8 1Z",class:e.theme==="light"?"fill-white":"fill-primary-base"})]}),Vn=e=>{const[n,a]=f(!1);return t("button",{"data-testid":e.testId,type:"button",class:`${e.class} inline-flex items-center justify-center px-10 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white disabled:text-gray-300 bg-primary hover:bg-primary-hover disabled:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-focus w-full md:w-auto`,disabled:e.disabled,onClick:async()=>{if(e.onClickPromise&&!n){a(!0);try{await e.onClickPromise()}catch{}a(!1)}},children:[t("div",{class:`${n?"invisible":""}`,children:e.children}),n&&t("div",{class:"absolute animate-spin",children:t(Ai,{theme:"light"})})]})},Dn=({className:e,children:n})=>t("h1",{className:`text-2xl md:text-3xl font-bold ${e??""}`,children:n}),Fn=({className:e,children:n})=>t("h3",{class:`text-base md:text-lg text-gray-600 ${e??""}`,children:n}),le=({children:e})=>{const n=ye.Children.toArray(e),a=n.find(i=>i.type===jn),s=n.find(i=>i.type===Wn);return t(ue,{appear:!0,show:!0,enter:"transition duration-700 ease-out",enterFrom:"opacity-0",enterTo:"opacity-100",children:t("div",{class:"flex flex-col text-center items-center max-w-[40rem] mx-auto",children:[t(ue,{appear:!0,show:!0,enter:"transition duration-700 ease-out md:transition-none",enterFrom:"-translate-y-6",enterTo:"translate-y-0",children:a&&t("div",{class:"flex items-center h-full",children:a})}),t(ue,{appear:!0,show:!0,enter:"transition delay-300 duration-[600ms] ease-out",enterFrom:"opacity-0 -translate-y-6",enterTo:"opacity-100 translate-y-0",children:s&&t("div",{class:"flex items-center h-full",children:s})})]})})},jn=({children:e})=>t(y,{children:e}),Wn=({children:e})=>t(y,{children:e});le.Top=jn;le.Bottom=Wn;const Ci="allowance",Pi=({navigate:e,onComplete:n})=>{const[a,s]=f(void 0),[i,r]=f(0),[l,c]=f([]);h(()=>{(async()=>{await $e(5e3);const v=(await vn()).map(L=>({name:L.content.productName,url:L.content.iconUrl}));if(v.length===0){n();return}c(v),r(1);for(let L=0;L<v.length;L++)s(L),await $e(1e3);await $e(1e3),r(2),await $e(1e3),r(3)})()},[]);const d=H(()=>{switch(i){case 0:case 1:case 2:return"Personalising your benefits plan";case 3:return"Your Benefits Plan"}},[i]),o=H(()=>{switch(i){case 0:return"Finding benefits...";case 1:case 2:return a===0?"1 benefit found that matches your profile":`${a+1} benefits found that match your profile`;case 3:return"Based on your profile, your are eligible to enrol in these benefits"}},[i,a]),p=H(()=>i===0,[i]),g=H(()=>i!==2,[i]),w=H(()=>i===2||i===3,[i]),N=H(()=>i===3,[i]),k=H(()=>i===3,[i]);return t(le,{children:[t(le.Top,{children:t("div",{className:"flex flex-col gap-4",children:[t("div",{className:`flex justify-center text-primary transition-opacity duration-700 ease-in-out ${p?"opacity-100":"opacity-0"}`,children:t(Le,{size:10})}),t(Dn,{className:`transition-opacity duration-700 ease-in-out ${g?"opacity-100":"opacity-0"}`,children:d}),t(Fn,{className:`transition-opacity duration-700 ease-in-out ${g?"opacity-100":"opacity-0"}`,children:o})]})}),t(le.Bottom,{children:t("div",{class:"flex flex-col items-center gap-4",children:[t(Ii,{scaleUp:w,showName:N,icons:l}),t(Vn,{testId:"set_up_benefits_button_next_screen",class:`mt-4 w-full md:w-[240px] transition-opacity duration-700 ease-in-out ${k?"opacity-100":"hidden opacity-0"}`,onClickPromise:async()=>{await ie.commandAsync({eventType:"Started"},{treatment:Ci}),e("/allowance/offers")},children:"Set up your benefits"})]})})]})},Ii=({scaleUp:e,showName:n,icons:a})=>t("div",{children:[t("style",{children:`
|
|
8
|
+
.bg-lighter-than-text{
|
|
9
|
+
background-color: hsl(from currentColor h s l / 0.08);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.animate-slide-from-right {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
transform: translateX(400px);
|
|
15
|
+
animation: slide-from-right 1s ease-out forwards;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@keyframes slide-from-right {
|
|
19
|
+
from {
|
|
20
|
+
transform: translateX(400px);
|
|
21
|
+
opacity: 0;
|
|
22
|
+
}
|
|
23
|
+
to {
|
|
24
|
+
transform: translateX(0);
|
|
25
|
+
opacity: 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`}),t("div",{className:`flex gap-4 transition-scale transition-margin duration-700 ease-in-out ${e?"scale-150 m-4":"scale-100"}`,children:a.map((s,i)=>t("div",{className:"mt-4 flex flex-col gap-1 items-center text-primary text-[0.5rem] w-12 max-w-12 min-w-12 animate-slide-from-right",style:{animationDelay:`${1e3*i}ms`},children:[t(rn,{src:s.url,wrapper:"svg",className:"w-10 h-10 max-h-10 max-w-10 min-h-10 min-w-10 p-2.5 rounded-lg bg-lighter-than-text",beforeInjection:r=>{var l;r.removeAttribute("width"),r.removeAttribute("height"),(l=r.querySelector("path"))==null||l.removeAttribute("fill"),r.setAttribute("fill","currentColor")}}),t("p",{className:`transition-opacity duration-700 ease-in-out ${n?"opacity-100":"opacity-0"}`,children:s.name})]},s.name))})]}),Ti=({visible:e,children:n})=>{const a=_(e);return e&&!a.current&&(a.current=!0),a.current?t("div",{hidden:!e,children:n}):null},Si=({iconUrl:e})=>t(rn,{src:e,wrapper:"svg",className:"w-10 h-10 max-h-10 max-w-10 min-h-10 min-w-10 p-2.5 rounded-lg bg-lighter-than-text",beforeInjection:n=>{var a;n.removeAttribute("width"),n.removeAttribute("height"),(a=n.querySelector("path"))==null||a.removeAttribute("fill"),n.setAttribute("fill","currentColor")}}),Hn=({label:e,icon:n})=>t("div",{className:"flex flex-col gap-1 items-center w-12 max-w-12 min-w-12",children:[n,t("p",{className:"max-h-10 max-w-20 break-words text-ellipsis overflow-hidden line-clamp-2",children:e})]}),zn=({children:e})=>t(y,{children:e}),Li=({selectedIndex:e,onChange:n,children:a})=>{const s=H(()=>Et.toArray(a).filter(r=>r.type===Hn),[a]),i=H(()=>Et.toArray(a).filter(r=>r.type===zn),[a]);return h(()=>{i.length>0&&(n==null||n(0))},[]),t("div",{children:[t("div",{className:"flex items-baseline gap-8 md:mb-4",children:[t("style",{children:`
|
|
29
|
+
.bg-lighter-than-text{
|
|
30
|
+
background-color: hsl(from currentColor h s l / 0.08);
|
|
31
|
+
}
|
|
32
|
+
`}),s.map((r,l)=>t("div",{onClick:()=>n==null?void 0:n(l),className:Oa("text-sm font-medium cursor-auto h-full relative","flex items-center justify-center",l===e?"text-primary":"text-gray-400",i.length>0?"hover:before:cursor-pointer":"hover:before:cursor-default","hover:before:w-16 hover:before:h-16 hover:before:absolute"),children:r},r.key))]}),i.map((r,l)=>t(Ti,{visible:l===e,children:r},r.key))]})},Ei=e=>{var i,r,l,c,d;const n=ee(z),a=T(n,void 0),s=_(null);return h(()=>{ie.commandAsync({eventType:"OfferViewed",offerName:e.marketPlaceOffer.name,data:e.marketPlaceOffer.metadata},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName}),s.current&&(s.current.terms=e.marketPlaceOffer.content.terms,s.current.details=e.marketPlaceOffer.content.details,s.current["on-accept"]=()=>{ie.commandAsync({eventType:"OfferProgressed",offerName:e.marketPlaceOffer.name,data:{...e.marketPlaceOffer.metadata,template:e.marketPlaceOffer.content.template,assessmentId:e.marketPlaceOffer.content.assessmentId,accepted:!0}},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName})},s.current["on-decline"]=()=>{ie.commandAsync({eventType:"OfferProgressed",offerName:e.marketPlaceOffer.name,data:{...e.marketPlaceOffer.metadata,template:e.marketPlaceOffer.content.template,assessmentId:e.marketPlaceOffer.content.assessmentId,accepted:!1}},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName}),e.onStepComplete(!1)},s.current["on-complete"]=()=>e.onStepComplete(!0),s.current["on-skip"]=e.marketPlaceOffer.content.skipButtonHidden?void 0:()=>e.onStepComplete(!1))},[]),(i=a==null?void 0:a.workplaceLinkConfig)!=null&&i.workplaceBackendToken?t("benefits-plan-assessment",{"base-url":D.getConfig().apolloBaseUrl,"profile-id":a==null?void 0:a.basicProfile.profileId,"skip-more-details":!0,"access-token":(r=a==null?void 0:a.workplaceLinkConfig)==null?void 0:r.workplaceBackendToken,"image-url":e.marketPlaceOffer.content.imageUrl,"assessment-id":e.marketPlaceOffer.content.assessmentId,"assessment-instructions":e.marketPlaceOffer.content.assessmentInstructions,"track-experiment":e.marketPlaceOffer.metadata.featureName,"track-treatment":e.marketPlaceOffer.metadata.treatmentName,"track-client":"webBenefits","track-source":"WebBenefits","track-channel":"web","marketplace-offer-name":e.marketPlaceOffer.name,"assessment-title":e.marketPlaceOffer.content.title,description:e.marketPlaceOffer.content.description,"accept-button":e.marketPlaceOffer.content.acceptButton,"decline-button":e.marketPlaceOffer.content.declineButton,"special-banner-title":(l=e.marketPlaceOffer.content.specialBanner)==null?void 0:l.title,"special-banner-subtitle":(c=e.marketPlaceOffer.content.specialBanner)==null?void 0:c.subtitle,"special-banner-type":(d=e.marketPlaceOffer.content.specialBanner)==null?void 0:d.type,"vertical-alignment":"items-center",ref:s}):null},Oi=({navigate:e})=>{const[n,a]=f(0),[s,i]=f(!1),[r,l]=f([]);h(()=>{vn().then(l)},[]);const c=Y(o=>{if(o&&i(!0),n===r.length-1){const g=r.some(w=>w.name==="Perks");e(`/allowance/summary/${s||o?"true":"false"}/${g?"true":"false"}`)}else a(n+1)},[n,s]),d=Y(o=>{a(o);const p=r[o];p&&ie.commandAsync({eventType:"OfferSelected",offerName:p.name,data:p.metadata},{experiment:p.metadata.featureName,treatment:p.metadata.treatmentName})},[]);return t("div",{className:"max-w-[59.5rem] mx-auto",children:t(Li,{selectedIndex:n,onChange:d,children:[r.map(o=>t(Hn,{label:o.content.productName,icon:t(Si,{iconUrl:o.content.iconUrl})},o.name)),r.map(o=>t(zn,{children:o.content.template==="Assessment"&&t(Ei,{onStepComplete:c,marketPlaceOffer:o},o.name)},o.name))]})})},Bi=e=>{var i;const n=ee(z),a=_(null),s=T(n,void 0);return h(()=>{a.current&&(a.current["on-complete"]=()=>e.navigate("/allowance/intro"))},[]),t("div",{className:"flex justify-center",children:t("benefits-plan-assessment",{"base-url":D.getConfig().apolloBaseUrl,"profile-id":s==null?void 0:s.basicProfile.profileId,"skip-intro":!0,"skip-more-details":!0,"skip-summary":!0,"access-token":(i=s==null?void 0:s.workplaceLinkConfig)==null?void 0:i.workplaceBackendToken,"assessment-id":"benefits-personalisation-assessment","track-client":"webBenefits","track-source":"WebBenefits","track-channel":"web","assessment-title":"Tell us a bit about yourself",description:"Answer a few questions to help us set up a personalised benefits plan for you:","vertical-alignment":"items-center",ref:a})})},$i=({title:e,className:n,children:a,...s})=>{var d;const[i,r]=f(!1),l=_(null),c=Y(()=>{r(!i)},[i]);return t("div",{className:`border border-2 border-gray-300 p-2 rounded-md overflow-hidden w-full ${n??""}`,...s,children:[t("div",{className:"mx-2 flex justify-between cursor-pointer",onClick:c,children:[t("span",{className:"text-base text-left font-semibold text-primary",children:e}),t("span",{className:"text-base text-left font-semibold text-gray-500",children:i?"-":"+"})]}),t("div",{ref:l,className:"flex justify-center transition-all ease-in-out duration-1000",style:{height:i?`${((d=l==null?void 0:l.current)==null?void 0:d.scrollHeight)??0}px`:"0px",opacity:i?1:0},children:a})]})},_i="/benefits/app/assets/check-c15931a5.svg",Ri=({title:e,steps:n,...a})=>{const s=n.length,i=n.filter(r=>r.completed).length;return t("div",{...a,children:[e&&t("h1",{className:"text-lg font-semibold mb-4",children:e}),t("ol",{children:n.map((r,l)=>{const c=i===l;return t("li",{className:`relative flex-1 pb-6 ${l!==s-1?`after:content-[''] after:w-0.5 after:h-[calc(100%-theme(height.8))] ${r.completed?"after:bg-primary":"after:bg-gray-300"} after:inline-block after:absolute after:top-8 after:left-4`:""}`,children:t("div",{className:"flex font-medium w-full",children:[t("span",{className:`w-8 h-8 flex-shrink-0 ${r.completed?"bg-primary":"bg-white"} border-2 ${r.completed||c?"border-primary":"border-gray-300"} rounded-full flex justify-center items-center mr-3 text-sm ${c?"text-primary":"text-gray-500"}`,children:r.completed?t("img",{className:"w-4 h-4",src:_i}):l+1}),t("div",{children:[t("h4",{className:`text-sm text-left font-semibold ${r.completed||c?"text-primary":"text-gray-600"}`,children:r.title}),t("p",{className:"text-sm text-left font-normal",children:r.description})]})]})},l)})})]})},Jt="allowance",Mi=({hasCompletedAnyOffers:e,isAppEnabled:n,onComplete:a})=>{h(()=>{const c=Ui({isAppEnabled:n,hasCompletedAnyOffers:e});ie.commandAsync({eventType:"SummaryViewed",summaryVariant:c},{treatment:Jt})},[n,e]);const[s,i]=f();h(()=>{(async()=>{const c=await te.loadAllowanceContentAsync(e?"benefits-setup-summary-allowance":"benefits-setup-summary-allowance-no-selection");i(c.items[0].fields)})()},[]);const r=ee(z),l=T(r,void 0);return s?t(le,{children:[t(le.Top,{children:t("div",{className:"flex flex-col gap-4",children:[t(Dn,{children:s.title}),t(Fn,{children:s.description})]})}),t(le.Bottom,{children:t("div",{className:"mt-5 flex flex-col items-center gap-5 text-center",children:[s.specialContent?t($i,{className:"lg:w-3/4",title:s.specialContent.title,children:t(Ri,{steps:Ps(s.specialContent.content,1),className:"mt-2 rounded-md px-6 py-4"})}):null,t(Vn,{testId:"allowance_set_up_benefits_button_next_screen",class:"mt-5 w-full md:w-[240px]",onClickPromise:async()=>{var o;const c=(o=l==null?void 0:l.workplaceLinkConfig)==null?void 0:o.workplaceBackendToken,d=l==null?void 0:l.basicProfile.profileId;await Promise.all([ie.commandAsync({eventType:"Completed"},{treatment:Jt}),c&&d?gn(c,d).url("/benefits-plan/workplace-backend/v1.0/allowance/complete").post():void 0]),a()},children:s.primaryAction})]})})]}):t("div",{className:"text-primary",children:t(Le,{size:6})})},Ui=({isAppEnabled:e,hasCompletedAnyOffers:n})=>{switch(!0){case(e&&n):return"allowance-accepted-app";case(e&&!n):return"allowance-declined-app";case(!e&&n):return"allowance-accepted-noapp";default:return"allowance-declined-noapp"}},Vi=({onComplete:e})=>{const n=ee(z),a=T(n,void 0),[s,i]=f("/allowance"),r=l=>i(l);return t("div",{className:"flex items-center",children:(()=>{var l;if(!((l=a==null?void 0:a.workplaceLinkConfig)!=null&&l.workplaceBackendToken))return t("div",{className:"text-primary",children:t(Le,{size:10})});if(s==="/allowance/intro")return t(Pi,{navigate:r,onComplete:e});if(s==="/allowance/offers")return t(Oi,{navigate:r});if(s.startsWith("/allowance/summary/")){const c=s.replace("/allowance/summary/","").split("/");return t(Mi,{isAppEnabled:c[1]==="true",hasCompletedAnyOffers:c[0]==="true",onComplete:e})}return t(Bi,{navigate:r})})()})},Di="/benefits/app/assets/welcome_image_mobile-dbde6c80.png",Fi="/benefits/app/assets/welcome_image_v2-869c59e4.png",ji=({hasNextStep:e,onClick:n})=>{const{service:a}=O();h(()=>{a.trackConsentStartedAsync()},[]);const s=()=>{a.trackConsentCompletedAsync(),n()},i=e?"Get started":"Start exploring your benefits";return t("div",{children:[t("div",{className:"min-h-[12rem] items-center hidden md:flex",children:t("img",{className:"mx-auto align-middle w-[30rem]",src:Fi})}),t("div",{className:"min-h-[8rem] flex items-center md:hidden",children:t("img",{className:"mx-auto align-middle w-[30rem]",src:Di})}),t("h1",{className:"text-3xl leading-9 font-bold text-gray-900 font-sans mb-3 mt-4",children:[t("span",{className:"w-full block",children:"Welcome to your"}),t("span",{className:"w-full block",children:"workplace benefits"})]}),t("p",{className:"text-base leading-6 font-normal text-gray-500 mb-6",children:"Get access to savings and perks from Australia’s most-loved brands, plus special offers to help you save on bigger expenses like household utilities, health insurance and more."}),t(ce,{className:"md:w-full md:text-base py-3 mb-6 focus:outline-none",onClick:s,children:i}),t("p",{className:"text-xs leading-4 font-normal text-gray-500 mb-0",children:["By clicking “",i,"” you accept the"," ",t(be,{className:"text-primary underline",href:"https://www.flarehr.com/flare-app-terms-and-conditions",children:"Terms & Conditions"})," ","and acknowledge and consent to your data being processed in accordance with Flare's"," ",t(be,{className:"text-primary underline",href:"https://www.flarehr.com/privacy-policy",children:"Privacy Policy"}),"."]})]})},Wi=({userProfile:e,isCategoryOpen:n})=>{const{getTreatment:a}=mn();h(()=>{(async()=>await ne.setWorkplaceLinkConfig())()},[]);const s=H(()=>[{stepType:"Consent",isRequired:()=>a(ze.ApolloBenefitsConsent)==="on"&&(e==null?void 0:e.benefitsProfile.hasConsent)===!1},{stepType:"WorkplaceLink",isRequired:()=>{var N;return a(ze.ApolloBenefitsCustomerRegistration)==="on"&&((N=e==null?void 0:e.workplaceLinkConfig)==null?void 0:N.isEstablished)===!1}},{stepType:"Allowance",isRequired:()=>{var w;return((w=e==null?void 0:e.featureFlags)==null?void 0:w.allowance)===!0}}].filter(w=>w.isRequired()),[e]),i=_();h(()=>{s.length>0&&(i.current=s[0])},[s]);const[r,l]=f(!1);h(()=>{l(s.length>0&&!n)},[s.length,n]),h(()=>{ge.updateIsWelcomeModalOpen(r)},[r]);const c=()=>{var w;(w=e==null?void 0:e.benefitsProfile)!=null&&w.hasConsent||ne.saveUserConsent()},d=()=>{qe.lock(5e3),ne.updateCustomerIdAsync(qe.unlockAndFlushQueue),ne.setIsEstablished()},o=()=>{ne.setIsEstablished()},p=()=>{ne.setAllowanceCompleted()},g=s[0]||i.current;return t(et,{isOpen:r,fullWidthMobile:!0,onClose:()=>{},children:t("div",{className:`${(g==null?void 0:g.stepType)==="Allowance"?"md:max-w-[68rem] md:min-h-[30rem] flex justify-center overflow-y-auto":"text-center md:w-[35rem]"} p-8 md:p-16 w-screen`,children:[(g==null?void 0:g.stepType)==="Consent"&&t(ji,{onClick:c,hasNextStep:s.length>1}),(g==null?void 0:g.stepType)==="WorkplaceLink"&&t(Ni,{onComplete:d,onError:o,config:e==null?void 0:e.workplaceLinkConfig}),(g==null?void 0:g.stepType)==="Allowance"&&t(Vi,{onComplete:p})]})})},Re=({category:e})=>{const[n,a]=f();return h(()=>{const s=[K.signedInUser$.subscribe(i=>{U(i)?a(i.value):a(void 0)})];return()=>{s.map(i=>i.unsubscribe())}},[]),t(y,{children:[t(pt,{history:wt(gt()),children:[t(F,{path:"/",component:_e}),t(F,{path:"/categories/:category",component:_e}),t(F,{path:"/landing/:slug",component:_e}),t(F,{path:"/wellbeing-hub/:subroute*",component:ii}),t(F,{default:!0,component:_e})]}),t(Wi,{userProfile:n,isCategoryOpen:!!e})]})},qn=e=>{analytics.identify(e.basicProfile.profileId,{profile:e.basicProfile.profileId,account:e.basicProfile.accountId,partner:e.basicProfile.partnerId,benefitsRole:e.benefitsProfile.role})},Hi=e=>{const n=`${e.eventName} ${e.eventAction}`,a={...e};delete a.eventName,delete a.eventAction,analytics.track(n,a)},zi=e=>()=>{},fl={identifyUser:qn,trackEvent:Hi,handleTrackingOnClick:zi},qi=Ba(()=>$a(()=>import("./index-5d2a90a4.js"),["assets/index-5d2a90a4.js","assets/vendor-fefcaaa7.js","assets/lodash-5d893f8c.js","assets/framer-motion-7d482d44.js","assets/date-fns-1aaef347.js","assets/oidc-client-6f6e47c2.js","assets/datadog-eeb687f6.js"])),Gi=()=>{const[e,n]=f({user:C}),[a,s]=f(!1),[i,r]=f(!1),{service:l}=O();if(typeof window<"u"&&window.location.pathname.replace("/benefits/app","")!=="/")return window.location.pathname="/benefits/app/",null;h(()=>{(async()=>{if(await D.fetchConfigAsync(),Ve.extractRedirectPath(),Ve.extractMode(),Ve.extractTrackingParameters(),G.tokenExists(window.location.search)){await G.signOut(),await G.initFromToken(window.location.pathname,window.location.search);return}r(!0)})();const d=[K.signedInUser$.subscribe(o=>{n({user:o}),U(o)&&qn(o.value)}),on.authState$.subscribe(async({authStatus:o,jwt:p})=>{U(p)&&o===q.Authenticated?(await G.refreshIfExpired(),V.setParameters(D.getConfig().apiBaseUrl,p.value),re.setParameters(D.getConfig().apolloBaseUrl,p.value),Wa.setParameters(D.getConfig().apiV2BaseUrl,p.value),ne.extractProfileId(p.value),await ne.loadSignedInUserProfileAsync(),s(o===q.Authenticated)):s(!1)})];return()=>{d.map(o=>o.unsubscribe())}},[]);const c=d=>{switch(d.url.replace(/^\/+/,"").split("/")[0]){case"":P.update({appView:"employee",navTab:"benefits"});break;case"admin":P.update({appView:"admin",navTab:"benefits"});break;case"wellbeing-hub":P.update({appView:"employee",navTab:"wellbeing"});break}};return h(()=>{if(i&&a){l.trackAppLoadedAsync();const d=K.getValue().deepLink;U(d)&&(l.trackDeepLinkOpenedAsync(d.value),P.update({deepLink:C}))}},[i,a]),i?t("div",{id:"preact_root",className:"min-h-screen",children:t(dn.Provider,{value:a,children:t(z.Provider,{value:e.user,children:t(pt,{history:wt(gt()),onChange:c,children:[t(ke,{path:"/",component:Re}),t(ke,{path:"/categories/:category",component:Re}),t(ke,{path:"/landing/:slug",component:Re}),t(ke,{path:"/wellbeing-hub/:subroute*",component:Re}),t(ke,{path:"/admin/:subroute*",component:qi}),t(F,{path:"/oidc/:mode*",component:as}),t(F,{path:"/b2c/:fragment",component:ss}),t(F,{path:"/workplace-link",component:Fe}),t(F,{path:"state=:fragment*",component:Fe}),t(F,{path:"/code*",component:Fe}),t(pn,{default:!0})]})})})}):t(Ze,{})};typeof window<"u"&&(_a({storage:window.sessionStorage,key:"benefits-client-v2"}),Ra(),Ma.polyfill(),ja());Ua(t(Da,{children:t(Va,{fallback:pn,children:t(Gi,{})})}),document.body);export{wt as A,V as B,Tn as D,yt as H,Ur as I,Le as L,et as M,Nt as P,Vt as U,O as a,Ce as b,X as c,z as d,Wa as e,te as f,bt as g,bs as h,He as i,Q as j,Mr as k,ul as l,fl as m,ml as n,dl as o,ll as p,Rr as q,ol as r,cl as s,il as t,rt as u,B as v,kt as w,ie as x,mn as y,ln as z};
|