@flarehr/promoted-benefits-ui 1.0.166 → 1.0.168

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const _ of document.querySelectorAll('link[rel="modulepreload"]'))r(_);new MutationObserver(_=>{for(const o of _)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(_){const o={};return _.integrity&&(o.integrity=_.integrity),_.referrerPolicy&&(o.referrerPolicy=_.referrerPolicy),_.crossOrigin==="use-credentials"?o.credentials="include":_.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(_){if(_.ep)return;_.ep=!0;const o=n(_);fetch(_.href,o)}})();var O,h,me,N,re,ye,G,ge,S={},be=[],Ee=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Y=Array.isArray;function $(e,t){for(var n in t)e[n]=t[n];return e}function xe(e){var t=e.parentNode;t&&t.removeChild(e)}function Le(e,t,n){var r,_,o,c={};for(o in t)o=="key"?r=t[o]:o=="ref"?_=t[o]:c[o]=t[o];if(arguments.length>2&&(c.children=arguments.length>3?O.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)c[o]===void 0&&(c[o]=e.defaultProps[o]);return j(e,c,r,_,null)}function j(e,t,n,r,_){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:_??++me,__i:-1,__u:0};return _==null&&h.vnode!=null&&h.vnode(o),o}function P(e){return e.children}function D(e,t){this.props=e,this.context=t}function H(e,t){if(t==null)return e.__?H(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?H(e):null}function we(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return we(e)}}function Z(e){(!e.__d&&(e.__d=!0)&&N.push(e)&&!M.__r++||re!==h.debounceRendering)&&((re=h.debounceRendering)||ye)(M)}function M(){var e,t,n,r,_,o,c,s,a;for(N.sort(G);e=N.shift();)e.__d&&(t=N.length,r=void 0,o=(_=(n=e).__v).__e,s=[],a=[],(c=n.__P)&&((r=$({},_)).__v=_.__v+1,h.vnode&&h.vnode(r),ee(c,r,_,n.__n,c.ownerSVGElement!==void 0,32&_.__u?[o]:null,s,o??H(_),!!(32&_.__u),a),r.__v=_.__v,r.__.__k[r.__i]=r,$e(s,r,a),r.__e!=o&&we(r)),N.length>t&&N.sort(G));M.__r=0}function ke(e,t,n,r,_,o,c,s,a,l,f){var i,p,u,g,k,b=r&&r.__k||be,v=t.length;for(n.__d=a,Ae(n,t,b),a=n.__d,i=0;i<v;i++)(u=n.__k[i])!=null&&typeof u!="boolean"&&typeof u!="function"&&(p=u.__i===-1?S:b[u.__i]||S,u.__i=i,ee(e,u,p,_,o,c,s,a,l,f),g=u.__e,u.ref&&p.ref!=u.ref&&(p.ref&&te(p.ref,null,u),f.push(u.ref,u.__c||g,u)),k==null&&g!=null&&(k=g),65536&u.__u||p.__k===u.__k?(g||p.__e!=a||(a=H(p)),a=Ce(u,a,e)):typeof u.type=="function"&&u.__d!==void 0?a=u.__d:g&&(a=g.nextSibling),u.__d=void 0,u.__u&=-196609);n.__d=a,n.__e=k}function Ae(e,t,n){var r,_,o,c,s,a=t.length,l=n.length,f=l,i=0;for(e.__k=[],r=0;r<a;r++)c=r+i,(_=e.__k[r]=(_=t[r])==null||typeof _=="boolean"||typeof _=="function"?null:typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?j(null,_,null,null,null):Y(_)?j(P,{children:_},null,null,null):_.constructor===void 0&&_.__b>0?j(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_)!=null?(_.__=e,_.__b=e.__b+1,s=Fe(_,n,c,f),_.__i=s,o=null,s!==-1&&(f--,(o=n[s])&&(o.__u|=131072)),o==null||o.__v===null?(s==-1&&i--,typeof _.type!="function"&&(_.__u|=65536)):s!==c&&(s===c+1?i++:s>c?f>a-c?i+=s-c:i--:s<c?s==c-1&&(i=s-c):i=0,s!==r+i&&(_.__u|=65536))):(o=n[c])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=H(o)),K(o,o,!1),n[c]=null,f--);if(f)for(r=0;r<l;r++)(o=n[r])!=null&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=H(o)),K(o,o))}function Ce(e,t,n){var r,_;if(typeof e.type=="function"){for(r=e.__k,_=0;r&&_<r.length;_++)r[_]&&(r[_].__=e,t=Ce(r[_],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Fe(e,t,n,r){var _=e.key,o=e.type,c=n-1,s=n+1,a=t[n];if(a===null||a&&_==a.key&&o===a.type&&!(131072&a.__u))return n;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;c>=0||s<t.length;){if(c>=0){if((a=t[c])&&!(131072&a.__u)&&_==a.key&&o===a.type)return c;c--}if(s<t.length){if((a=t[s])&&!(131072&a.__u)&&_==a.key&&o===a.type)return s;s++}}return-1}function oe(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ee.test(t)?n:n+"px"}function F(e,t,n,r,_){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||oe(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||oe(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?ce:ie,o)):e.removeEventListener(t,o?ce:ie,o);else{if(_)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function ie(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(h.event?h.event(e):e)}}function ce(e){if(this.l)return this.l[e.type+!0](h.event?h.event(e):e)}function ee(e,t,n,r,_,o,c,s,a,l){var f,i,p,u,g,k,b,v,x,C,E,U,_e,L,z,w=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),o=[s=t.__e=n.__e]),(f=h.__b)&&f(t);e:if(typeof w=="function")try{if(v=t.props,x=(f=w.contextType)&&r[f.__c],C=f?x?x.props.value:f.__:r,n.__c?b=(i=t.__c=n.__c).__=i.__E:("prototype"in w&&w.prototype.render?t.__c=i=new w(v,C):(t.__c=i=new D(v,C),i.constructor=w,i.render=je),x&&x.sub(i),i.props=v,i.state||(i.state={}),i.context=C,i.__n=r,p=i.__d=!0,i.__h=[],i._sb=[]),i.__s==null&&(i.__s=i.state),w.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,w.getDerivedStateFromProps(v,i.__s))),u=i.props,g=i.state,i.__v=t,p)w.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(w.getDerivedStateFromProps==null&&v!==u&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(v,C),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(v,i.__s,C)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(i.props=v,i.state=i.__s,i.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(A){A&&(A.__=t)}),E=0;E<i._sb.length;E++)i.__h.push(i._sb[E]);i._sb=[],i.__h.length&&c.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(v,i.__s,C),i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(u,g,k)})}if(i.context=C,i.props=v,i.__P=e,i.__e=!1,U=h.__r,_e=0,"prototype"in w&&w.prototype.render){for(i.state=i.__s,i.__d=!1,U&&U(t),f=i.render(i.props,i.state,i.context),L=0;L<i._sb.length;L++)i.__h.push(i._sb[L]);i._sb=[]}else do i.__d=!1,U&&U(t),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++_e<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),p||i.getSnapshotBeforeUpdate==null||(k=i.getSnapshotBeforeUpdate(u,g)),ke(e,Y(z=f!=null&&f.type===P&&f.key==null?f.props.children:f)?z:[z],t,n,r,_,o,c,s,a,l),i.base=t.__e,t.__u&=-161,i.__h.length&&c.push(i),b&&(i.__E=i.__=null)}catch(A){t.__v=null,a||o!=null?(t.__e=s,t.__u|=a?160:32,o[o.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),h.__e(A,t,n)}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Ie(n.__e,t,n,r,_,o,c,a,l);(f=h.diffed)&&f(t)}function $e(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)te(n[r],n[++r],n[++r]);h.__c&&h.__c(t,e),e.some(function(_){try{e=_.__h,_.__h=[],e.some(function(o){o.call(_)})}catch(o){h.__e(o,_.__v)}})}function Ie(e,t,n,r,_,o,c,s,a){var l,f,i,p,u,g,k,b=n.props,v=t.props,x=t.type;if(x==="svg"&&(_=!0),o!=null){for(l=0;l<o.length;l++)if((u=o[l])&&"setAttribute"in u==!!x&&(x?u.localName===x:u.nodeType===3)){e=u,o[l]=null;break}}if(e==null){if(x===null)return document.createTextNode(v);e=_?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,v.is&&v),o=null,s=!1}if(x===null)b===v||s&&e.data===v||(e.data=v);else{if(o=o&&O.call(e.childNodes),b=n.props||S,!s&&o!=null)for(b={},l=0;l<e.attributes.length;l++)b[(u=e.attributes[l]).name]=u.value;for(l in b)u=b[l],l=="children"||(l=="dangerouslySetInnerHTML"?i=u:l==="key"||l in v||F(e,l,null,u,_));for(l in v)u=v[l],l=="children"?p=u:l=="dangerouslySetInnerHTML"?f=u:l=="value"?g=u:l=="checked"?k=u:l==="key"||s&&typeof u!="function"||b[l]===u||F(e,l,u,b[l],_);if(f)s||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(i&&(e.innerHTML=""),ke(e,Y(p)?p:[p],t,n,r,_&&x!=="foreignObject",o,c,o?o[0]:n.__k&&H(n,0),s,a),o!=null)for(l=o.length;l--;)o[l]!=null&&xe(o[l]);s||(l="value",g!==void 0&&(g!==e[l]||x==="progress"&&!g||x==="option"&&g!==b[l])&&F(e,l,g,b[l],!1),l="checked",k!==void 0&&k!==e[l]&&F(e,l,k,b[l],!1))}return e}function te(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){h.__e(r,n)}}function K(e,t,n){var r,_;if(h.unmount&&h.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||te(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){h.__e(o,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(_=0;_<r.length;_++)r[_]&&K(r[_],t,n||typeof e.type!="function");n||e.__e==null||xe(e.__e),e.__=e.__e=e.__d=void 0}function je(e,t,n){return this.constructor(e,n)}function De(e,t,n){var r,_,o,c;h.__&&h.__(e,t),_=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],c=[],ee(t,e=(!r&&n||t).__k=Le(P,null,[e]),_||S,S,t.ownerSVGElement!==void 0,!r&&n?[n]:_?null:t.firstChild?O.call(t.childNodes):null,o,!r&&n?n:_?_.__e:t.firstChild,r,c),$e(o,e,c)}function R(e,t){var n={__c:t="__cC"+ge++,__:e,Consumer:function(r,_){return r.children(_)},Provider:function(r){var _,o;return this.getChildContext||(_=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(c){this.props.value!==c.value&&_.some(function(s){s.__e=!0,Z(s)})},this.sub=function(c){_.push(c);var s=c.componentWillUnmount;c.componentWillUnmount=function(){_.splice(_.indexOf(c),1),s&&s.call(c)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}O=be.slice,h={__e:function(e,t,n,r){for(var _,o,c;t=t.__;)if((_=t.__c)&&!_.__)try{if((o=_.constructor)&&o.getDerivedStateFromError!=null&&(_.setState(o.getDerivedStateFromError(e)),c=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(e,r||{}),c=_.__d),c)return _.__E=_}catch(s){e=s}throw e}},me=0,D.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=$({},this.state),typeof e=="function"&&(e=e($({},n),this.props)),e&&$(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Z(this))},D.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Z(this))},D.prototype.render=P,N=[],ye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,G=function(e,t){return e.__v.__b-t.__v.__b},M.__r=0,ge=0;var Be=0;function d(e,t,n,r,_,o){var c,s,a={};for(s in t)s=="ref"?c=t[s]:a[s]=t[s];var l={type:e,props:a,key:n,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Be,__i:-1,__u:0,__source:_,__self:o};if(typeof e=="function"&&(c=e.defaultProps))for(s in c)a[s]===void 0&&(a[s]=c[s]);return h.vnode&&h.vnode(l),l}var T,m,q,se,Q=0,Ne=[],B=[],y=h,le=y.__b,ae=y.__r,ue=y.diffed,fe=y.__c,de=y.unmount,pe=y.__;function ne(e,t){y.__h&&y.__h(m,e,Q||t),Q=0;var n=m.__H||(m.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:B}),n.__[e]}function W(e){return Q=1,We(He,e)}function We(e,t,n){var r=ne(T++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):He(void 0,t),function(s){var a=r.__N?r.__N[0]:r.__[0],l=r.t(a,s);a!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=m,!m.u)){var _=function(s,a,l){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(p){return!!p.__c});if(f.every(function(p){return!p.__N}))return!o||o.call(this,s,a,l);var i=!1;return f.forEach(function(p){if(p.__N){var u=p.__[0];p.__=p.__N,p.__N=void 0,u!==p.__[0]&&(i=!0)}}),!(!i&&r.__c.props===s)&&(!o||o.call(this,s,a,l))};m.u=!0;var o=m.shouldComponentUpdate,c=m.componentWillUpdate;m.componentWillUpdate=function(s,a,l){if(this.__e){var f=o;o=void 0,_(s,a,l),o=f}c&&c.call(this,s,a,l)},m.shouldComponentUpdate=_}return r.__N||r.__}function X(e,t){var n=ne(T++,3);!y.__s&&Oe(n.__H,t)&&(n.__=e,n.i=t,m.__H.__h.push(n))}function Pe(e){var t=m.context[e.__c],n=ne(T++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(m)),t.props.value):e.__}function Ve(){for(var e;e=Ne.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(V),e.__H.__h.forEach(J),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){m=null,le&&le(e)},y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),pe&&pe(e,t)},y.__r=function(e){ae&&ae(e),T=0;var t=(m=e.__c).__H;t&&(q===m?(t.__h=[],m.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=B,n.__N=n.i=void 0})):(t.__h.forEach(V),t.__h.forEach(J),t.__h=[],T=0)),q=m},y.diffed=function(e){ue&&ue(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ne.push(t)!==1&&se===y.requestAnimationFrame||((se=y.requestAnimationFrame)||Me)(Ve)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==B&&(n.__=n.__V),n.i=void 0,n.__V=B})),q=m=null},y.__c=function(e,t){t.some(function(n){try{n.__h.forEach(V),n.__h=n.__h.filter(function(r){return!r.__||J(r)})}catch(r){t.some(function(_){_.__h&&(_.__h=[])}),t=[],y.__e(r,n.__v)}}),fe&&fe(e,t)},y.unmount=function(e){de&&de(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{V(r)}catch(_){t=_}}),n.__H=void 0,t&&y.__e(t,n.__v))};var he=typeof requestAnimationFrame=="function";function Me(e){var t,n=function(){clearTimeout(r),he&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);he&&(t=requestAnimationFrame(n))}function V(e){var t=m,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),m=t}function J(e){var t=m;e.__c=e.__(),m=t}function Oe(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function He(e,t){return typeof t=="function"?t(e):t}let Ue=R({});const Re=e=>Ue=R({...e}),ze=()=>Pe(Ue),qe=async(e,t,n,r)=>{const _=new Headers;_.append("Content-Type","application/x-www-form-urlencoded");let o;const c=new URLSearchParams;c.append("grant_type","authorization_code"),c.append("code",t),c.append("client_id",n),c.append("redirect_uri",r);const s=await fetch(`${e}/connect/token`,{method:"POST",headers:_,body:c});return s.ok&&(o=await s.json()),o},Ge=e=>{if(e)return{accessToken:e.access_token,isLoggedIn:!!e.access_token,expiresIn:e.expires_in}},Ze=async(e,t)=>{let n;const r=await fetch(e,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});return r.ok&&(n=await r.json()),n},Ke=(e,t,n,r)=>{const _=document.referrer;return`${e}/app/?token=${t}&redirectPath=${n}&referrer=${_}&promotionId=${r}`},Qe=async(e,t,n,r)=>{const _=`${e==null?void 0:e.apolloBaseUrl}/benefits`;if(!_||!n||!t||!r)return;const o=await Ze(`${_}/backend/v1.0/current/token`,t);if(!(!o||!o.token))return Ke(_,o.token,n,r)},Xe=e=>new URLSearchParams(window.location.search).get(e)??void 0,Je=async(e,t,n)=>{let r;switch(e==null?void 0:e.action.type){case"Benefits":r=await Qe(t,n.accessToken,e==null?void 0:e.action.url,e==null?void 0:e.id);break;case"Public":r=e==null?void 0:e.action.url;break;default:r=void 0;break}return r},Ye=async e=>{const t=Xe("code"),n=`${window.location.origin}/promoted-benefits/app/v1.0/`;if(!(!e.identityUrl||!e.clientId||!t))return Ge(await qe(e.identityUrl,t,e.clientId,n))};let Se=R({});const et=e=>Se=R({...e}),tt=()=>Pe(Se),nt=async()=>{let e;const t=await fetch(`${window.location.origin}/promoted-benefits/app/v1.0/config.json`);return t.ok&&(e=await t.json()),e},Te="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11%203C10.4477%203%2010%203.44772%2010%204C10%204.55228%2010.4477%205%2011%205H13.5858L7.29289%2011.2929C6.90237%2011.6834%206.90237%2012.3166%207.29289%2012.7071C7.68342%2013.0976%208.31658%2013.0976%208.70711%2012.7071L15%206.41421V9C15%209.55228%2015.4477%2010%2016%2010C16.5523%2010%2017%209.55228%2017%209V4C17%203.44772%2016.5523%203%2016%203H11Z'%20fill='white'/%3e%3cpath%20d='M5%205C3.89543%205%203%205.89543%203%207V15C3%2016.1046%203.89543%2017%205%2017H13C14.1046%2017%2015%2016.1046%2015%2015V12C15%2011.4477%2014.5523%2011%2014%2011C13.4477%2011%2013%2011.4477%2013%2012V15H5V7L8%207C8.55228%207%209%206.55228%209%206C9%205.44772%208.55228%205%208%205H5Z'%20fill='white'/%3e%3c/svg%3e",_t=({banner:e,onClick:t})=>d("div",{className:"font-['Inter'] p-4 bg-white flex rounded-lg gap-2 card:hidden",children:[d("div",{className:"flex-col justify-between flex flex-1",children:[d("div",{className:"flex-col gap-4 flex pb-2",children:d("div",{className:"self-stretch flex-col justify-start items-start gap-2 flex",children:[d("h1",{className:"text-blue-950 font-bold leading-7",children:e.title}),d("p",{className:"text-gray-900 text-xs leading-normal",children:e.description})]})}),d("div",{className:"justify-end",children:d("button",{className:"px-2 py-1 bg-blue-600 rounded-lg justify-center items-center gap-2 inline-flex text-white text-xs font-semibold leading-normal",onClick:t,children:[e.buttonText,d("img",{className:"self-center",src:Te,alt:""})]})})]}),d("div",{className:"self-center",children:d("img",{className:"w-20 h-20",src:e.imageUrl})})]}),rt=({card:e,onClick:t})=>d("div",{className:"p-6 bg-white rounded-lg flex-col justify-start items-center gap-5 hidden card:inline-flex",children:[d("div",{children:d("img",{className:"relative bg-white block",src:e.imageUrl})}),d("div",{className:"flex-col justify-start items-center gap-5 flex",children:[d("div",{className:"flex-col justify-start items-start gap-4 flex",children:d("div",{className:"self-stretch flex-col justify-start items-start gap-2 flex",children:[d("div",{className:"self-stretch text-blue-950 text-2xl font-bold font-['Inter'] leading-7",children:e.title}),d("div",{className:"self-stretch text-gray-900 text-base font-medium font-['Inter'] leading-normal",children:e.description})]})}),d("div",{className:"self-stretch p-4 bg-blue-600 rounded-md justify-center items-center gap-2 inline-flex",children:d("button",{className:"text-white text-base font-semibold font-['Inter'] leading-normal flex gap-2",onClick:t,children:[e.buttonText,d("img",{className:"self-center",src:Te,alt:""})]})})]})]}),ot="fallback-cars-promotion",it={title:"Benefit with Flare Cars and save",description:"In the market for a new car? We’ve got a benefit for that. Find out if you're eligible, and you could save, on average, $10,000 every year on your next car.",buttonText:"Learn more",imageUrl:"./images/flare-cars-banner.png"},ct={title:"Benefit with Flare Cars and save",description:"In the market for a new car? We’ve got a benefit for that. Find out if you're eligible, and you could save, on average, $10,000 every year on your next car.",buttonText:"Learn more",imageUrl:"./images/flare-cars-card.png"},st={type:"Benefits",url:"/categories/cars"},I={id:ot,banner:it,card:ct,action:st},lt=async(e,t)=>{let n;if(!e||!t)return ve();const r=`${e}/promoted-benefits/backend`,_=await fetch(`${r}/v1.0/promotion`,{headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.166"}});if(_.ok)n=await _.json();else return ve();return n},ve=()=>({action:I.action,banner:I.banner,card:I.card,id:I.id}),at=()=>{const e=ze(),t=tt(),[n,r]=W();X(()=>{(async()=>{const o=await lt(t==null?void 0:t.apolloBaseUrl,e==null?void 0:e.accessToken);r(o)})()},[]);const _=async()=>{if(n){const o=await Je(n,t,e);if(o){const c=window.open();c&&(c.location=`${o}`)}}};return n?d(P,{children:[d(_t,{banner:n.banner,onClick:_}),d(rt,{card:n.card,onClick:_})]}):d(P,{})},ut=()=>{const[e,t]=W({}),[n,r]=W(),[_,o]=W(!1);return Re(e),X(()=>{(async()=>{const c=await nt();c&&(et(c),r(c))})()},[]),X(()=>{(async()=>{if(!_&&n){const c=await Ye(n);c&&t(c),o(!0)}})()},[n,_]),_?d(at,{}):d(P,{})};De(d(ut,{}),document.body);
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const _ of document.querySelectorAll('link[rel="modulepreload"]'))r(_);new MutationObserver(_=>{for(const o of _)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(_){const o={};return _.integrity&&(o.integrity=_.integrity),_.referrerPolicy&&(o.referrerPolicy=_.referrerPolicy),_.crossOrigin==="use-credentials"?o.credentials="include":_.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(_){if(_.ep)return;_.ep=!0;const o=n(_);fetch(_.href,o)}})();var O,h,me,N,re,ye,G,ge,S={},be=[],Ee=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Y=Array.isArray;function $(e,t){for(var n in t)e[n]=t[n];return e}function xe(e){var t=e.parentNode;t&&t.removeChild(e)}function Le(e,t,n){var r,_,o,c={};for(o in t)o=="key"?r=t[o]:o=="ref"?_=t[o]:c[o]=t[o];if(arguments.length>2&&(c.children=arguments.length>3?O.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)c[o]===void 0&&(c[o]=e.defaultProps[o]);return j(e,c,r,_,null)}function j(e,t,n,r,_){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:_??++me,__i:-1,__u:0};return _==null&&h.vnode!=null&&h.vnode(o),o}function P(e){return e.children}function D(e,t){this.props=e,this.context=t}function H(e,t){if(t==null)return e.__?H(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?H(e):null}function we(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return we(e)}}function Z(e){(!e.__d&&(e.__d=!0)&&N.push(e)&&!M.__r++||re!==h.debounceRendering)&&((re=h.debounceRendering)||ye)(M)}function M(){var e,t,n,r,_,o,c,s,a;for(N.sort(G);e=N.shift();)e.__d&&(t=N.length,r=void 0,o=(_=(n=e).__v).__e,s=[],a=[],(c=n.__P)&&((r=$({},_)).__v=_.__v+1,h.vnode&&h.vnode(r),ee(c,r,_,n.__n,c.ownerSVGElement!==void 0,32&_.__u?[o]:null,s,o??H(_),!!(32&_.__u),a),r.__v=_.__v,r.__.__k[r.__i]=r,$e(s,r,a),r.__e!=o&&we(r)),N.length>t&&N.sort(G));M.__r=0}function ke(e,t,n,r,_,o,c,s,a,l,f){var i,p,u,g,k,b=r&&r.__k||be,v=t.length;for(n.__d=a,Ae(n,t,b),a=n.__d,i=0;i<v;i++)(u=n.__k[i])!=null&&typeof u!="boolean"&&typeof u!="function"&&(p=u.__i===-1?S:b[u.__i]||S,u.__i=i,ee(e,u,p,_,o,c,s,a,l,f),g=u.__e,u.ref&&p.ref!=u.ref&&(p.ref&&te(p.ref,null,u),f.push(u.ref,u.__c||g,u)),k==null&&g!=null&&(k=g),65536&u.__u||p.__k===u.__k?(g||p.__e!=a||(a=H(p)),a=Ce(u,a,e)):typeof u.type=="function"&&u.__d!==void 0?a=u.__d:g&&(a=g.nextSibling),u.__d=void 0,u.__u&=-196609);n.__d=a,n.__e=k}function Ae(e,t,n){var r,_,o,c,s,a=t.length,l=n.length,f=l,i=0;for(e.__k=[],r=0;r<a;r++)c=r+i,(_=e.__k[r]=(_=t[r])==null||typeof _=="boolean"||typeof _=="function"?null:typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?j(null,_,null,null,null):Y(_)?j(P,{children:_},null,null,null):_.constructor===void 0&&_.__b>0?j(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_)!=null?(_.__=e,_.__b=e.__b+1,s=Fe(_,n,c,f),_.__i=s,o=null,s!==-1&&(f--,(o=n[s])&&(o.__u|=131072)),o==null||o.__v===null?(s==-1&&i--,typeof _.type!="function"&&(_.__u|=65536)):s!==c&&(s===c+1?i++:s>c?f>a-c?i+=s-c:i--:s<c?s==c-1&&(i=s-c):i=0,s!==r+i&&(_.__u|=65536))):(o=n[c])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=H(o)),K(o,o,!1),n[c]=null,f--);if(f)for(r=0;r<l;r++)(o=n[r])!=null&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=H(o)),K(o,o))}function Ce(e,t,n){var r,_;if(typeof e.type=="function"){for(r=e.__k,_=0;r&&_<r.length;_++)r[_]&&(r[_].__=e,t=Ce(r[_],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Fe(e,t,n,r){var _=e.key,o=e.type,c=n-1,s=n+1,a=t[n];if(a===null||a&&_==a.key&&o===a.type&&!(131072&a.__u))return n;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;c>=0||s<t.length;){if(c>=0){if((a=t[c])&&!(131072&a.__u)&&_==a.key&&o===a.type)return c;c--}if(s<t.length){if((a=t[s])&&!(131072&a.__u)&&_==a.key&&o===a.type)return s;s++}}return-1}function oe(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ee.test(t)?n:n+"px"}function F(e,t,n,r,_){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||oe(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||oe(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?ce:ie,o)):e.removeEventListener(t,o?ce:ie,o);else{if(_)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function ie(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(h.event?h.event(e):e)}}function ce(e){if(this.l)return this.l[e.type+!0](h.event?h.event(e):e)}function ee(e,t,n,r,_,o,c,s,a,l){var f,i,p,u,g,k,b,v,x,C,E,U,_e,L,z,w=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),o=[s=t.__e=n.__e]),(f=h.__b)&&f(t);e:if(typeof w=="function")try{if(v=t.props,x=(f=w.contextType)&&r[f.__c],C=f?x?x.props.value:f.__:r,n.__c?b=(i=t.__c=n.__c).__=i.__E:("prototype"in w&&w.prototype.render?t.__c=i=new w(v,C):(t.__c=i=new D(v,C),i.constructor=w,i.render=je),x&&x.sub(i),i.props=v,i.state||(i.state={}),i.context=C,i.__n=r,p=i.__d=!0,i.__h=[],i._sb=[]),i.__s==null&&(i.__s=i.state),w.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,w.getDerivedStateFromProps(v,i.__s))),u=i.props,g=i.state,i.__v=t,p)w.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(w.getDerivedStateFromProps==null&&v!==u&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(v,C),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(v,i.__s,C)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(i.props=v,i.state=i.__s,i.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(A){A&&(A.__=t)}),E=0;E<i._sb.length;E++)i.__h.push(i._sb[E]);i._sb=[],i.__h.length&&c.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(v,i.__s,C),i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(u,g,k)})}if(i.context=C,i.props=v,i.__P=e,i.__e=!1,U=h.__r,_e=0,"prototype"in w&&w.prototype.render){for(i.state=i.__s,i.__d=!1,U&&U(t),f=i.render(i.props,i.state,i.context),L=0;L<i._sb.length;L++)i.__h.push(i._sb[L]);i._sb=[]}else do i.__d=!1,U&&U(t),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++_e<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),p||i.getSnapshotBeforeUpdate==null||(k=i.getSnapshotBeforeUpdate(u,g)),ke(e,Y(z=f!=null&&f.type===P&&f.key==null?f.props.children:f)?z:[z],t,n,r,_,o,c,s,a,l),i.base=t.__e,t.__u&=-161,i.__h.length&&c.push(i),b&&(i.__E=i.__=null)}catch(A){t.__v=null,a||o!=null?(t.__e=s,t.__u|=a?160:32,o[o.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),h.__e(A,t,n)}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Ie(n.__e,t,n,r,_,o,c,a,l);(f=h.diffed)&&f(t)}function $e(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)te(n[r],n[++r],n[++r]);h.__c&&h.__c(t,e),e.some(function(_){try{e=_.__h,_.__h=[],e.some(function(o){o.call(_)})}catch(o){h.__e(o,_.__v)}})}function Ie(e,t,n,r,_,o,c,s,a){var l,f,i,p,u,g,k,b=n.props,v=t.props,x=t.type;if(x==="svg"&&(_=!0),o!=null){for(l=0;l<o.length;l++)if((u=o[l])&&"setAttribute"in u==!!x&&(x?u.localName===x:u.nodeType===3)){e=u,o[l]=null;break}}if(e==null){if(x===null)return document.createTextNode(v);e=_?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,v.is&&v),o=null,s=!1}if(x===null)b===v||s&&e.data===v||(e.data=v);else{if(o=o&&O.call(e.childNodes),b=n.props||S,!s&&o!=null)for(b={},l=0;l<e.attributes.length;l++)b[(u=e.attributes[l]).name]=u.value;for(l in b)u=b[l],l=="children"||(l=="dangerouslySetInnerHTML"?i=u:l==="key"||l in v||F(e,l,null,u,_));for(l in v)u=v[l],l=="children"?p=u:l=="dangerouslySetInnerHTML"?f=u:l=="value"?g=u:l=="checked"?k=u:l==="key"||s&&typeof u!="function"||b[l]===u||F(e,l,u,b[l],_);if(f)s||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(i&&(e.innerHTML=""),ke(e,Y(p)?p:[p],t,n,r,_&&x!=="foreignObject",o,c,o?o[0]:n.__k&&H(n,0),s,a),o!=null)for(l=o.length;l--;)o[l]!=null&&xe(o[l]);s||(l="value",g!==void 0&&(g!==e[l]||x==="progress"&&!g||x==="option"&&g!==b[l])&&F(e,l,g,b[l],!1),l="checked",k!==void 0&&k!==e[l]&&F(e,l,k,b[l],!1))}return e}function te(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){h.__e(r,n)}}function K(e,t,n){var r,_;if(h.unmount&&h.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||te(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){h.__e(o,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(_=0;_<r.length;_++)r[_]&&K(r[_],t,n||typeof e.type!="function");n||e.__e==null||xe(e.__e),e.__=e.__e=e.__d=void 0}function je(e,t,n){return this.constructor(e,n)}function De(e,t,n){var r,_,o,c;h.__&&h.__(e,t),_=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],c=[],ee(t,e=(!r&&n||t).__k=Le(P,null,[e]),_||S,S,t.ownerSVGElement!==void 0,!r&&n?[n]:_?null:t.firstChild?O.call(t.childNodes):null,o,!r&&n?n:_?_.__e:t.firstChild,r,c),$e(o,e,c)}function R(e,t){var n={__c:t="__cC"+ge++,__:e,Consumer:function(r,_){return r.children(_)},Provider:function(r){var _,o;return this.getChildContext||(_=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(c){this.props.value!==c.value&&_.some(function(s){s.__e=!0,Z(s)})},this.sub=function(c){_.push(c);var s=c.componentWillUnmount;c.componentWillUnmount=function(){_.splice(_.indexOf(c),1),s&&s.call(c)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}O=be.slice,h={__e:function(e,t,n,r){for(var _,o,c;t=t.__;)if((_=t.__c)&&!_.__)try{if((o=_.constructor)&&o.getDerivedStateFromError!=null&&(_.setState(o.getDerivedStateFromError(e)),c=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(e,r||{}),c=_.__d),c)return _.__E=_}catch(s){e=s}throw e}},me=0,D.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=$({},this.state),typeof e=="function"&&(e=e($({},n),this.props)),e&&$(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Z(this))},D.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Z(this))},D.prototype.render=P,N=[],ye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,G=function(e,t){return e.__v.__b-t.__v.__b},M.__r=0,ge=0;var Be=0;function d(e,t,n,r,_,o){var c,s,a={};for(s in t)s=="ref"?c=t[s]:a[s]=t[s];var l={type:e,props:a,key:n,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Be,__i:-1,__u:0,__source:_,__self:o};if(typeof e=="function"&&(c=e.defaultProps))for(s in c)a[s]===void 0&&(a[s]=c[s]);return h.vnode&&h.vnode(l),l}var T,m,q,se,Q=0,Ne=[],B=[],y=h,le=y.__b,ae=y.__r,ue=y.diffed,fe=y.__c,de=y.unmount,pe=y.__;function ne(e,t){y.__h&&y.__h(m,e,Q||t),Q=0;var n=m.__H||(m.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:B}),n.__[e]}function W(e){return Q=1,We(He,e)}function We(e,t,n){var r=ne(T++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):He(void 0,t),function(s){var a=r.__N?r.__N[0]:r.__[0],l=r.t(a,s);a!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=m,!m.u)){var _=function(s,a,l){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(p){return!!p.__c});if(f.every(function(p){return!p.__N}))return!o||o.call(this,s,a,l);var i=!1;return f.forEach(function(p){if(p.__N){var u=p.__[0];p.__=p.__N,p.__N=void 0,u!==p.__[0]&&(i=!0)}}),!(!i&&r.__c.props===s)&&(!o||o.call(this,s,a,l))};m.u=!0;var o=m.shouldComponentUpdate,c=m.componentWillUpdate;m.componentWillUpdate=function(s,a,l){if(this.__e){var f=o;o=void 0,_(s,a,l),o=f}c&&c.call(this,s,a,l)},m.shouldComponentUpdate=_}return r.__N||r.__}function X(e,t){var n=ne(T++,3);!y.__s&&Oe(n.__H,t)&&(n.__=e,n.i=t,m.__H.__h.push(n))}function Pe(e){var t=m.context[e.__c],n=ne(T++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(m)),t.props.value):e.__}function Ve(){for(var e;e=Ne.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(V),e.__H.__h.forEach(J),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){m=null,le&&le(e)},y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),pe&&pe(e,t)},y.__r=function(e){ae&&ae(e),T=0;var t=(m=e.__c).__H;t&&(q===m?(t.__h=[],m.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=B,n.__N=n.i=void 0})):(t.__h.forEach(V),t.__h.forEach(J),t.__h=[],T=0)),q=m},y.diffed=function(e){ue&&ue(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ne.push(t)!==1&&se===y.requestAnimationFrame||((se=y.requestAnimationFrame)||Me)(Ve)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==B&&(n.__=n.__V),n.i=void 0,n.__V=B})),q=m=null},y.__c=function(e,t){t.some(function(n){try{n.__h.forEach(V),n.__h=n.__h.filter(function(r){return!r.__||J(r)})}catch(r){t.some(function(_){_.__h&&(_.__h=[])}),t=[],y.__e(r,n.__v)}}),fe&&fe(e,t)},y.unmount=function(e){de&&de(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{V(r)}catch(_){t=_}}),n.__H=void 0,t&&y.__e(t,n.__v))};var he=typeof requestAnimationFrame=="function";function Me(e){var t,n=function(){clearTimeout(r),he&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);he&&(t=requestAnimationFrame(n))}function V(e){var t=m,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),m=t}function J(e){var t=m;e.__c=e.__(),m=t}function Oe(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function He(e,t){return typeof t=="function"?t(e):t}let Ue=R({});const Re=e=>Ue=R({...e}),ze=()=>Pe(Ue),qe=async(e,t,n,r)=>{const _=new Headers;_.append("Content-Type","application/x-www-form-urlencoded");let o;const c=new URLSearchParams;c.append("grant_type","authorization_code"),c.append("code",t),c.append("client_id",n),c.append("redirect_uri",r);const s=await fetch(`${e}/connect/token`,{method:"POST",headers:_,body:c});return s.ok&&(o=await s.json()),o},Ge=e=>{if(e)return{accessToken:e.access_token,isLoggedIn:!!e.access_token,expiresIn:e.expires_in}},Ze=async(e,t)=>{let n;const r=await fetch(e,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});return r.ok&&(n=await r.json()),n},Ke=(e,t,n,r)=>{const _=document.referrer;return`${e}/app/?token=${t}&redirectPath=${n}&referrer=${_}&promotionId=${r}`},Qe=async(e,t,n,r)=>{const _=`${e==null?void 0:e.apolloBaseUrl}/benefits`;if(!_||!n||!t||!r)return;const o=await Ze(`${_}/backend/v1.0/current/token`,t);if(!(!o||!o.token))return Ke(_,o.token,n,r)},Xe=e=>new URLSearchParams(window.location.search).get(e)??void 0,Je=async(e,t,n)=>{let r;switch(e==null?void 0:e.action.type){case"Benefits":r=await Qe(t,n.accessToken,e==null?void 0:e.action.url,e==null?void 0:e.id);break;case"Public":r=e==null?void 0:e.action.url;break;default:r=void 0;break}return r},Ye=async e=>{const t=Xe("code"),n=`${window.location.origin}/promoted-benefits/app/v1.0/`;if(!(!e.identityUrl||!e.clientId||!t))return Ge(await qe(e.identityUrl,t,e.clientId,n))};let Se=R({});const et=e=>Se=R({...e}),tt=()=>Pe(Se),nt=async()=>{let e;const t=await fetch(`${window.location.origin}/promoted-benefits/app/v1.0/config.json`);return t.ok&&(e=await t.json()),e},Te="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11%203C10.4477%203%2010%203.44772%2010%204C10%204.55228%2010.4477%205%2011%205H13.5858L7.29289%2011.2929C6.90237%2011.6834%206.90237%2012.3166%207.29289%2012.7071C7.68342%2013.0976%208.31658%2013.0976%208.70711%2012.7071L15%206.41421V9C15%209.55228%2015.4477%2010%2016%2010C16.5523%2010%2017%209.55228%2017%209V4C17%203.44772%2016.5523%203%2016%203H11Z'%20fill='white'/%3e%3cpath%20d='M5%205C3.89543%205%203%205.89543%203%207V15C3%2016.1046%203.89543%2017%205%2017H13C14.1046%2017%2015%2016.1046%2015%2015V12C15%2011.4477%2014.5523%2011%2014%2011C13.4477%2011%2013%2011.4477%2013%2012V15H5V7L8%207C8.55228%207%209%206.55228%209%206C9%205.44772%208.55228%205%208%205H5Z'%20fill='white'/%3e%3c/svg%3e",_t=({banner:e,onClick:t})=>d("div",{className:"font-['Inter'] p-4 bg-white flex rounded-lg gap-2 card:hidden",children:[d("div",{className:"flex-col justify-between flex flex-1",children:[d("div",{className:"flex-col gap-4 flex pb-2",children:d("div",{className:"self-stretch flex-col justify-start items-start gap-2 flex",children:[d("h1",{className:"text-blue-950 font-bold leading-7",children:e.title}),d("p",{className:"text-gray-900 text-xs leading-normal",children:e.description})]})}),d("div",{className:"justify-end",children:d("button",{className:"px-2 py-1 bg-blue-600 rounded-lg justify-center items-center gap-2 inline-flex text-white text-xs font-semibold leading-normal",onClick:t,children:[e.buttonText,d("img",{className:"self-center",src:Te,alt:""})]})})]}),d("div",{className:"self-center",children:d("img",{className:"w-20 h-20",src:e.imageUrl})})]}),rt=({card:e,onClick:t})=>d("div",{className:"p-6 bg-white rounded-lg flex-col justify-start items-center gap-5 hidden card:inline-flex",children:[d("div",{children:d("img",{className:"relative bg-white block",src:e.imageUrl})}),d("div",{className:"flex-col justify-start items-center gap-5 flex",children:[d("div",{className:"flex-col justify-start items-start gap-4 flex",children:d("div",{className:"self-stretch flex-col justify-start items-start gap-2 flex",children:[d("div",{className:"self-stretch text-blue-950 text-2xl font-bold font-['Inter'] leading-7",children:e.title}),d("div",{className:"self-stretch text-gray-900 text-base font-medium font-['Inter'] leading-normal",children:e.description})]})}),d("div",{className:"self-stretch p-4 bg-blue-600 rounded-md justify-center items-center gap-2 inline-flex",children:d("button",{className:"text-white text-base font-semibold font-['Inter'] leading-normal flex gap-2",onClick:t,children:[e.buttonText,d("img",{className:"self-center",src:Te,alt:""})]})})]})]}),ot="fallback-cars-promotion",it={title:"Benefit with Flare Cars and save",description:"In the market for a new car? We’ve got a benefit for that. Find out if you're eligible, and you could save, on average, $10,000 every year on your next car.",buttonText:"Learn more",imageUrl:"./images/flare-cars-banner.png"},ct={title:"Benefit with Flare Cars and save",description:"In the market for a new car? We’ve got a benefit for that. Find out if you're eligible, and you could save, on average, $10,000 every year on your next car.",buttonText:"Learn more",imageUrl:"./images/flare-cars-card.png"},st={type:"Benefits",url:"/categories/cars"},I={id:ot,banner:it,card:ct,action:st},lt=async(e,t)=>{let n;if(!e||!t)return ve();const r=`${e}/promoted-benefits/backend`,_=await fetch(`${r}/v1.0/promotion`,{headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.168"}});if(_.ok)n=await _.json();else return ve();return n},ve=()=>({action:I.action,banner:I.banner,card:I.card,id:I.id}),at=()=>{const e=ze(),t=tt(),[n,r]=W();X(()=>{(async()=>{const o=await lt(t==null?void 0:t.apolloBaseUrl,e==null?void 0:e.accessToken);r(o)})()},[]);const _=async()=>{if(n){const o=await Je(n,t,e);if(o){const c=window.open();c&&(c.location=`${o}`)}}};return n?d(P,{children:[d(_t,{banner:n.banner,onClick:_}),d(rt,{card:n.card,onClick:_})]}):d(P,{})},ut=()=>{const[e,t]=W({}),[n,r]=W(),[_,o]=W(!1);return Re(e),X(()=>{(async()=>{const c=await nt();c&&(et(c),r(c))})()},[]),X(()=>{(async()=>{if(!_&&n){const c=await Ye(n);c&&t(c),o(!0)}})()},[n,_]),_?d(at,{}):d(P,{})};De(d(ut,{}),document.body);
package/dist/index.html CHANGED
@@ -9,7 +9,7 @@
9
9
  margin: 0;
10
10
  }
11
11
  </style>
12
- <script type="module" crossorigin src="/promoted-benefits/app/v1.0/assets/index-Bo8vf0rw.js"></script>
12
+ <script type="module" crossorigin src="/promoted-benefits/app/v1.0/assets/index-HL4u5a7B.js"></script>
13
13
  <link rel="stylesheet" crossorigin href="/promoted-benefits/app/v1.0/assets/index-B0j1l6Xy.css">
14
14
  </head>
15
15
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flarehr/promoted-benefits-ui",
3
- "version": "1.0.166",
3
+ "version": "1.0.168",
4
4
  "description": "Flare Promoted Benefits",
5
5
  "license": "MIT",
6
6
  "files": [