@flarehr/promoted-benefits-ui 1.0.185 → 1.0.186
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const _ of o)if(_.type==="childList")for(const s of _.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const _={};return o.integrity&&(_.integrity=o.integrity),o.referrerPolicy&&(_.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?_.credentials="include":o.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function r(o){if(o.ep)return;o.ep=!0;const _=n(o);fetch(o.href,_)}})();var R,h,ve,P,re,ye,J,ge,E={},be=[],Ae=/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 Ie(e,t,n){var r,o,_,s={};for(_ in t)_=="key"?r=t[_]:_=="ref"?o=t[_]:s[_]=t[_];if(arguments.length>2&&(s.children=arguments.length>3?R.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(_ in e.defaultProps)s[_]===void 0&&(s[_]=e.defaultProps[_]);return O(e,s,r,o,null)}function O(e,t,n,r,o){var _={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++ve,__i:-1,__u:0};return o==null&&h.vnode!=null&&h.vnode(_),_}function N(e){return e.children}function j(e,t){this.props=e,this.context=t}function S(e,t){if(t==null)return e.__?S(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"?S(e):null}function ke(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 ke(e)}}function X(e){(!e.__d&&(e.__d=!0)&&P.push(e)&&!W.__r++||re!==h.debounceRendering)&&((re=h.debounceRendering)||ye)(W)}function W(){var e,t,n,r,o,_,s,c,l;for(P.sort(J);e=P.shift();)e.__d&&(t=P.length,r=void 0,_=(o=(n=e).__v).__e,c=[],l=[],(s=n.__P)&&((r=$({},o)).__v=o.__v+1,h.vnode&&h.vnode(r),ee(s,r,o,n.__n,s.ownerSVGElement!==void 0,32&o.__u?[_]:null,c,_??S(o),!!(32&o.__u),l),r.__v=o.__v,r.__.__k[r.__i]=r,$e(c,r,l),r.__e!=_&&ke(r)),P.length>t&&P.sort(J));W.__r=0}function we(e,t,n,r,o,_,s,c,l,a,f){var i,p,u,g,w,b=r&&r.__k||be,m=t.length;for(n.__d=l,Le(n,t,b),l=n.__d,i=0;i<m;i++)(u=n.__k[i])!=null&&typeof u!="boolean"&&typeof u!="function"&&(p=u.__i===-1?E:b[u.__i]||E,u.__i=i,ee(e,u,p,o,_,s,c,l,a,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)),w==null&&g!=null&&(w=g),65536&u.__u||p.__k===u.__k?(g||p.__e!=l||(l=S(p)),l=Ce(u,l,e)):typeof u.type=="function"&&u.__d!==void 0?l=u.__d:g&&(l=g.nextSibling),u.__d=void 0,u.__u&=-196609);n.__d=l,n.__e=w}function Le(e,t,n){var r,o,_,s,c,l=t.length,a=n.length,f=a,i=0;for(e.__k=[],r=0;r<l;r++)s=r+i,(o=e.__k[r]=(o=t[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?O(null,o,null,null,null):Y(o)?O(N,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?O(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,c=Fe(o,n,s,f),o.__i=c,_=null,c!==-1&&(f--,(_=n[c])&&(_.__u|=131072)),_==null||_.__v===null?(c==-1&&i--,typeof o.type!="function"&&(o.__u|=65536)):c!==s&&(c===s+1?i++:c>s?f>l-s?i+=c-s:i--:c<s?c==s-1&&(i=c-s):i=0,c!==r+i&&(o.__u|=65536))):(_=n[s])&&_.key==null&&_.__e&&!(131072&_.__u)&&(_.__e==e.__d&&(e.__d=S(_)),Z(_,_,!1),n[s]=null,f--);if(f)for(r=0;r<a;r++)(_=n[r])!=null&&!(131072&_.__u)&&(_.__e==e.__d&&(e.__d=S(_)),Z(_,_))}function Ce(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Ce(r[o],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 o=e.key,_=e.type,s=n-1,c=n+1,l=t[n];if(l===null||l&&o==l.key&&_===l.type&&!(131072&l.__u))return n;if(r>(l!=null&&!(131072&l.__u)?1:0))for(;s>=0||c<t.length;){if(s>=0){if((l=t[s])&&!(131072&l.__u)&&o==l.key&&_===l.type)return s;s--}if(c<t.length){if((l=t[c])&&!(131072&l.__u)&&o==l.key&&_===l.type)return c;c++}}return-1}function _e(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ae.test(t)?n:n+"px"}function B(e,t,n,r,o){var _;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||_e(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||_e(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")_=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+_]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,_?se:ie,_)):e.removeEventListener(t,_?se:ie,_);else{if(o)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 se(e){if(this.l)return this.l[e.type+!0](h.event?h.event(e):e)}function ee(e,t,n,r,o,_,s,c,l,a){var f,i,p,u,g,w,b,m,x,C,I,U,oe,L,q,k=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),_=[c=t.__e=n.__e]),(f=h.__b)&&f(t);e:if(typeof k=="function")try{if(m=t.props,x=(f=k.contextType)&&r[f.__c],C=f?x?x.props.value:f.__:r,n.__c?b=(i=t.__c=n.__c).__=i.__E:("prototype"in k&&k.prototype.render?t.__c=i=new k(m,C):(t.__c=i=new j(m,C),i.constructor=k,i.render=Me),x&&x.sub(i),i.props=m,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),k.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,k.getDerivedStateFromProps(m,i.__s))),u=i.props,g=i.state,i.__v=t,p)k.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(k.getDerivedStateFromProps==null&&m!==u&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(m,C),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(m,i.__s,C)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(i.props=m,i.state=i.__s,i.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(F){F&&(F.__=t)}),I=0;I<i._sb.length;I++)i.__h.push(i._sb[I]);i._sb=[],i.__h.length&&s.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(m,i.__s,C),i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(u,g,w)})}if(i.context=C,i.props=m,i.__P=e,i.__e=!1,U=h.__r,oe=0,"prototype"in k&&k.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&&++oe<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),p||i.getSnapshotBeforeUpdate==null||(w=i.getSnapshotBeforeUpdate(u,g)),we(e,Y(q=f!=null&&f.type===N&&f.key==null?f.props.children:f)?q:[q],t,n,r,o,_,s,c,l,a),i.base=t.__e,t.__u&=-161,i.__h.length&&s.push(i),b&&(i.__E=i.__=null)}catch(F){t.__v=null,l||_!=null?(t.__e=c,t.__u|=l?160:32,_[_.indexOf(c)]=null):(t.__e=n.__e,t.__k=n.__k),h.__e(F,t,n)}else _==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Be(n.__e,t,n,r,o,_,s,l,a);(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(o){try{e=o.__h,o.__h=[],e.some(function(_){_.call(o)})}catch(_){h.__e(_,o.__v)}})}function Be(e,t,n,r,o,_,s,c,l){var a,f,i,p,u,g,w,b=n.props,m=t.props,x=t.type;if(x==="svg"&&(o=!0),_!=null){for(a=0;a<_.length;a++)if((u=_[a])&&"setAttribute"in u==!!x&&(x?u.localName===x:u.nodeType===3)){e=u,_[a]=null;break}}if(e==null){if(x===null)return document.createTextNode(m);e=o?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,m.is&&m),_=null,c=!1}if(x===null)b===m||c&&e.data===m||(e.data=m);else{if(_=_&&R.call(e.childNodes),b=n.props||E,!c&&_!=null)for(b={},a=0;a<e.attributes.length;a++)b[(u=e.attributes[a]).name]=u.value;for(a in b)u=b[a],a=="children"||(a=="dangerouslySetInnerHTML"?i=u:a==="key"||a in m||B(e,a,null,u,o));for(a in m)u=m[a],a=="children"?p=u:a=="dangerouslySetInnerHTML"?f=u:a=="value"?g=u:a=="checked"?w=u:a==="key"||c&&typeof u!="function"||b[a]===u||B(e,a,u,b[a],o);if(f)c||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(i&&(e.innerHTML=""),we(e,Y(p)?p:[p],t,n,r,o&&x!=="foreignObject",_,s,_?_[0]:n.__k&&S(n,0),c,l),_!=null)for(a=_.length;a--;)_[a]!=null&&xe(_[a]);c||(a="value",g!==void 0&&(g!==e[a]||x==="progress"&&!g||x==="option"&&g!==b[a])&&B(e,a,g,b[a],!1),a="checked",w!==void 0&&w!==e[a]&&B(e,a,w,b[a],!1))}return e}function te(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){h.__e(r,n)}}function Z(e,t,n){var r,o;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(_){h.__e(_,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Z(r[o],t,n||typeof e.type!="function");n||e.__e==null||xe(e.__e),e.__=e.__e=e.__d=void 0}function Me(e,t,n){return this.constructor(e,n)}function Oe(e,t,n){var r,o,_,s;h.__&&h.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,_=[],s=[],ee(t,e=(!r&&n||t).__k=Ie(N,null,[e]),o||E,E,t.ownerSVGElement!==void 0,!r&&n?[n]:o?null:t.firstChild?R.call(t.childNodes):null,_,!r&&n?n:o?o.__e:t.firstChild,r,s),$e(_,e,s)}function z(e,t){var n={__c:t="__cC"+ge++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,_;return this.getChildContext||(o=[],(_={})[t]=this,this.getChildContext=function(){return _},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&o.some(function(c){c.__e=!0,X(c)})},this.sub=function(s){o.push(s);var c=s.componentWillUnmount;s.componentWillUnmount=function(){o.splice(o.indexOf(s),1),c&&c.call(s)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}R=be.slice,h={__e:function(e,t,n,r){for(var o,_,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((_=o.constructor)&&_.getDerivedStateFromError!=null&&(o.setState(_.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(c){e=c}throw e}},ve=0,j.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),X(this))},j.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),X(this))},j.prototype.render=N,P=[],ye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,J=function(e,t){return e.__v.__b-t.__v.__b},W.__r=0,ge=0;var je=0;function d(e,t,n,r,o,_){var s,c,l={};for(c in t)c=="ref"?s=t[c]:l[c]=t[c];var a={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--je,__i:-1,__u:0,__source:o,__self:_};if(typeof e=="function"&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return h.vnode&&h.vnode(a),a}var A,v,G,ce,K=0,Pe=[],D=[],y=h,ae=y.__b,le=y.__r,ue=y.diffed,fe=y.__c,de=y.unmount,pe=y.__;function ne(e,t){y.__h&&y.__h(v,e,K||t),K=0;var n=v.__H||(v.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:D}),n.__[e]}function T(e){return K=1,De(Se,e)}function De(e,t,n){var r=ne(A++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Se(void 0,t),function(c){var l=r.__N?r.__N[0]:r.__[0],a=r.t(l,c);l!==a&&(r.__N=[a,r.__[1]],r.__c.setState({}))}],r.__c=v,!v.u)){var o=function(c,l,a){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!_||_.call(this,c,l,a);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===c)&&(!_||_.call(this,c,l,a))};v.u=!0;var _=v.shouldComponentUpdate,s=v.componentWillUpdate;v.componentWillUpdate=function(c,l,a){if(this.__e){var f=_;_=void 0,o(c,l,a),_=f}s&&s.call(this,c,l,a)},v.shouldComponentUpdate=o}return r.__N||r.__}function H(e,t){var n=ne(A++,3);!y.__s&&Re(n.__H,t)&&(n.__=e,n.i=t,v.__H.__h.push(n))}function Ne(e){var t=v.context[e.__c],n=ne(A++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(v)),t.props.value):e.__}function Ve(){for(var e;e=Pe.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(V),e.__H.__h.forEach(Q),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){v=null,ae&&ae(e)},y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),pe&&pe(e,t)},y.__r=function(e){le&&le(e),A=0;var t=(v=e.__c).__H;t&&(G===v?(t.__h=[],v.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=D,n.__N=n.i=void 0})):(t.__h.forEach(V),t.__h.forEach(Q),t.__h=[],A=0)),G=v},y.diffed=function(e){ue&&ue(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Pe.push(t)!==1&&ce===y.requestAnimationFrame||((ce=y.requestAnimationFrame)||We)(Ve)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==D&&(n.__=n.__V),n.i=void 0,n.__V=D})),G=v=null},y.__c=function(e,t){t.some(function(n){try{n.__h.forEach(V),n.__h=n.__h.filter(function(r){return!r.__||Q(r)})}catch(r){t.some(function(o){o.__h&&(o.__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(o){t=o}}),n.__H=void 0,t&&y.__e(t,n.__v))};var he=typeof requestAnimationFrame=="function";function We(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=v,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),v=t}function Q(e){var t=v;e.__c=e.__(),v=t}function Re(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Se(e,t){return typeof t=="function"?t(e):t}let Ue=z({});const ze=e=>Ue=z({...e}),qe=()=>Ne(Ue),Ge=async(e,t,n,r)=>{const o=new Headers;o.append("Content-Type","application/x-www-form-urlencoded");let _;const s=new URLSearchParams;s.append("grant_type","authorization_code"),s.append("code",t),s.append("client_id",n),s.append("redirect_uri",r);const c=await fetch(`${e}/connect/token`,{method:"POST",headers:o,body:s});return c.ok&&(_=await c.json()),_},Je=e=>{if(e)return{accessToken:e.access_token,isLoggedIn:!!e.access_token,expiresIn:e.expires_in}},Xe=e=>new URLSearchParams(window.location.search).get(e)??void 0,Ze=async e=>{const t=Xe("code"),n=`${window.location.origin}/promoted-benefits/app/v1.0/`;if(!(!e.identityUrl||!e.clientId||!t))return Je(await Ge(e.identityUrl,t,e.clientId,n))};let Te=z({});const Ke=e=>Te=z({...e}),Qe=()=>Ne(Te),Ye=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},He="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",Ee=({path:e,children:t,className:n,onClick:r})=>e?d("a",{type:"button",href:e,className:n,onClick:r,target:"_blank",rel:"noreferrer",children:t}):d("button",{type:"button",className:n,onClick:r,children:t}),et=({banner:e,path:t,onClick:n})=>d("div",{"data-testid":"banner",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(Ee,{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",path:t,onClick:n,children:[e.buttonText,d("img",{className:"self-center",src:He,alt:""})]})})]}),d("div",{className:"self-center",children:d("img",{className:"w-20 h-20",src:e.imageUrl})})]}),tt=({card:e,path:t,onClick:n})=>d("div",{"data-testid":"card",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(Ee,{className:"text-white text-base font-semibold font-['Inter'] leading-normal flex gap-2",path:t,onClick:n,children:[e.buttonText,d("img",{className:"self-center",src:He,alt:""})]})})]})]}),nt="fallback-cars-promotion",ot={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"},rt={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"},_t={type:"Benefits",path:"/categories/cars"},M={id:nt,banner:ot,card:rt,action:_t},it=async(e,t)=>{let n;if(!e||!t)return me();const r=`${e}/promoted-benefits/backend`,o=await fetch(`${r}/v1.0/promotion`,{headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.186"}});if(o.ok)n=await o.json();else return me();return n},me=()=>({action:M.action,banner:M.banner,card:M.card,id:M.id}),st=async(e,t,n)=>{if(!t||!e)return;const r=`${e}/promoted-benefits/backend`;await fetch(`${r}/v1.0/promotion/${n}/view`,{method:"POST",headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.186"}})},ct=async(e,t,n)=>{if(!t||!e)return;const r=`${e}/promoted-benefits/backend`;await fetch(`${r}/v1.0/promotion/${n==null?void 0:n.id}/action`,{method:"POST",body:JSON.stringify(n==null?void 0:n.action),headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.186"}})},at=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},lt=(e,t,n,r)=>{const o=document.referrer;return`${e}/app/?token=${t}&redirectPath=${n}&referrer=${o}&promotionId=${r}`},ut=async(e,t,n,r)=>{const o=`${e==null?void 0:e.apolloBaseUrl}/benefits`;if(!o||!n||!t||!r)return;const _=await at(`${o}/backend/v1.0/current/token`,t);if(!(!_||!_.token))return lt(o,_.token,n,r)},ft=async(e,t,n)=>{let r;switch(e.action.type.toLowerCase()){case"benefits":return r=await ut(t,n.accessToken,e.action.path,e.id),{path:void 0,onClick:()=>{const _=window.open();_&&r&&(_.location=r)}};case"public":return{path:e.action.path,onClick:void 0};default:return}},dt=()=>{const e=qe(),t=Qe(),[n,r]=T(),[o,_]=T();H(()=>{(async()=>{const c=await it(t==null?void 0:t.apolloBaseUrl,e==null?void 0:e.accessToken);r(c),st(t.apolloBaseUrl,e.accessToken,c==null?void 0:c.id)})()},[t.apolloBaseUrl,e.accessToken]),H(()=>{(async()=>n&&_(await ft(n,t,e)))()},[t,e,n]);const s=()=>{o!=null&&o.onClick&&(o==null||o.onClick()),ct(t.apolloBaseUrl,e.accessToken,n)};return n?d(N,{children:[d(et,{banner:n.banner,path:o==null?void 0:o.path,onClick:s}),d(tt,{card:n.card,path:o==null?void 0:o.path,onClick:s})]}):d(N,{})},pt=e=>{if(e){const t=1e3*e,n={sender:"flare",type:"promotionsSessionExpired"};setTimeout(()=>{window.parent.postMessage(n,"*")},t)}},ht=(e,t)=>{if(e&&t){const n=1e3*e,r=1e3*60*5,o={expiry:t,sender:"flare",type:"promotionsSessionExpiring"};setTimeout(()=>{window.parent.postMessage(o,"*")},n-r)}},mt=e=>{try{const n=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=atob(n);return JSON.parse(r)}catch{return}},vt=()=>{const[e,t]=T({}),[n,r]=T(),[o,_]=T(!1);return ze(e),H(()=>{(async()=>{const s=await Ye();s&&(Ke(s),r(s))})()},[]),H(()=>{(async()=>{if(!o&&n){const s=await Ze(n);s&&t(s),_(!0)}})()},[n,o]),H(()=>{if(e.expiresIn&&e.accessToken){const s=mt(e.accessToken);pt(e.expiresIn),ht(e.expiresIn,s==null?void 0:s.exp)}},[e]),o?d(dt,{}):d(N,{})};Oe(d(vt,{}),document.body);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Inter:wght@100%3B200%3B300%3B400%3B500%3B600%3B700%3B800%3B900&display=fallback";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.relative{position:relative}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-20{height:5rem}.w-20{width:5rem}.flex-1{flex:1 1 0%}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.self-center{align-self:center}.self-stretch{align-self:stretch}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.font-\[\'Inter\'\]{font-family:Inter}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-7{line-height:1.75rem}.leading-normal{line-height:1.5}.text-blue-950{--tw-text-opacity: 1;color:rgb(23 37 84 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}@media (min-height: 450px){.card\:inline-flex{display:inline-flex}.card\:hidden{display:none}}
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Inter:wght@100%3B200%3B300%3B400%3B500%3B600%3B700%3B800%3B900&display=fallback";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.relative{position:relative}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-20{height:5rem}.w-20{width:5rem}.flex-1{flex:1 1 0%}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.self-center{align-self:center}.self-stretch{align-self:stretch}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.font-\[\'Inter\'\]{font-family:Inter}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-7{line-height:1.75rem}.leading-normal{line-height:1.5}.text-blue-950{--tw-text-opacity: 1;color:rgb(23 37 84 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}@media (min-height: 450px){.card\:inline-flex{display:inline-flex}.card\:hidden{display:none}}
|
package/dist/index.html
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
margin: 0;
|
|
10
10
|
}
|
|
11
11
|
</style>
|
|
12
|
-
<script type="module" crossorigin src="/promoted-benefits/app/v1.0/assets/index-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/promoted-benefits/app/v1.0/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/promoted-benefits/app/v1.0/assets/index-9ELtCbFa.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/promoted-benefits/app/v1.0/assets/index-CJ3Z12XG.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
</body>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))_(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const c of r.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&_(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function _(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();var R,h,ve,N,_e,ye,X,ge,A={},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 ke(e){var t=e.parentNode;t&&t.removeChild(e)}function Le(e,t,n){var _,o,r,c={};for(r in t)r=="key"?_=t[r]:r=="ref"?o=t[r]:c[r]=t[r];if(arguments.length>2&&(c.children=arguments.length>3?R.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)c[r]===void 0&&(c[r]=e.defaultProps[r]);return j(e,c,_,o,null)}function j(e,t,n,_,o){var r={type:e,props:t,key:n,ref:_,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++ve,__i:-1,__u:0};return o==null&&h.vnode!=null&&h.vnode(r),r}function P(e){return e.children}function O(e,t){this.props=e,this.context=t}function U(e,t){if(t==null)return e.__?U(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"?U(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)&&!W.__r++||_e!==h.debounceRendering)&&((_e=h.debounceRendering)||ye)(W)}function W(){var e,t,n,_,o,r,c,s,l;for(N.sort(X);e=N.shift();)e.__d&&(t=N.length,_=void 0,r=(o=(n=e).__v).__e,s=[],l=[],(c=n.__P)&&((_=$({},o)).__v=o.__v+1,h.vnode&&h.vnode(_),ee(c,_,o,n.__n,c.ownerSVGElement!==void 0,32&o.__u?[r]:null,s,r??U(o),!!(32&o.__u),l),_.__v=o.__v,_.__.__k[_.__i]=_,$e(s,_,l),_.__e!=r&&we(_)),N.length>t&&N.sort(X));W.__r=0}function xe(e,t,n,_,o,r,c,s,l,a,f){var i,p,u,g,x,b=_&&_.__k||be,m=t.length;for(n.__d=l,Ie(n,t,b),l=n.__d,i=0;i<m;i++)(u=n.__k[i])!=null&&typeof u!="boolean"&&typeof u!="function"&&(p=u.__i===-1?A:b[u.__i]||A,u.__i=i,ee(e,u,p,o,r,c,s,l,a,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)),x==null&&g!=null&&(x=g),65536&u.__u||p.__k===u.__k?(g||p.__e!=l||(l=U(p)),l=Ce(u,l,e)):typeof u.type=="function"&&u.__d!==void 0?l=u.__d:g&&(l=g.nextSibling),u.__d=void 0,u.__u&=-196609);n.__d=l,n.__e=x}function Ie(e,t,n){var _,o,r,c,s,l=t.length,a=n.length,f=a,i=0;for(e.__k=[],_=0;_<l;_++)c=_+i,(o=e.__k[_]=(o=t[_])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?j(null,o,null,null,null):Y(o)?j(P,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?j(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,s=Fe(o,n,c,f),o.__i=s,r=null,s!==-1&&(f--,(r=n[s])&&(r.__u|=131072)),r==null||r.__v===null?(s==-1&&i--,typeof o.type!="function"&&(o.__u|=65536)):s!==c&&(s===c+1?i++:s>c?f>l-c?i+=s-c:i--:s<c?s==c-1&&(i=s-c):i=0,s!==_+i&&(o.__u|=65536))):(r=n[c])&&r.key==null&&r.__e&&!(131072&r.__u)&&(r.__e==e.__d&&(e.__d=U(r)),J(r,r,!1),n[c]=null,f--);if(f)for(_=0;_<a;_++)(r=n[_])!=null&&!(131072&r.__u)&&(r.__e==e.__d&&(e.__d=U(r)),J(r,r))}function Ce(e,t,n){var _,o;if(typeof e.type=="function"){for(_=e.__k,o=0;_&&o<_.length;o++)_[o]&&(_[o].__=e,t=Ce(_[o],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,_){var o=e.key,r=e.type,c=n-1,s=n+1,l=t[n];if(l===null||l&&o==l.key&&r===l.type&&!(131072&l.__u))return n;if(_>(l!=null&&!(131072&l.__u)?1:0))for(;c>=0||s<t.length;){if(c>=0){if((l=t[c])&&!(131072&l.__u)&&o==l.key&&r===l.type)return c;c--}if(s<t.length){if((l=t[s])&&!(131072&l.__u)&&o==l.key&&r===l.type)return s;s++}}return-1}function re(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,_,o){var r;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof _=="string"&&(e.style.cssText=_=""),_)for(t in _)n&&t in n||re(e.style,t,"");if(n)for(t in n)_&&n[t]===_[t]||re(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")r=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+r]=n,n?_?n.u=_.u:(n.u=Date.now(),e.addEventListener(t,r?ce:ie,r)):e.removeEventListener(t,r?ce:ie,r);else{if(o)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,_,o,r,c,s,l,a){var f,i,p,u,g,x,b,m,k,C,E,H,oe,L,q,w=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),r=[s=t.__e=n.__e]),(f=h.__b)&&f(t);e:if(typeof w=="function")try{if(m=t.props,k=(f=w.contextType)&&_[f.__c],C=f?k?k.props.value:f.__:_,n.__c?b=(i=t.__c=n.__c).__=i.__E:("prototype"in w&&w.prototype.render?t.__c=i=new w(m,C):(t.__c=i=new O(m,C),i.constructor=w,i.render=je),k&&k.sub(i),i.props=m,i.state||(i.state={}),i.context=C,i.__n=_,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(m,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&&m!==u&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(m,C),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(m,i.__s,C)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(i.props=m,i.state=i.__s,i.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(I){I&&(I.__=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(m,i.__s,C),i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(u,g,x)})}if(i.context=C,i.props=m,i.__P=e,i.__e=!1,H=h.__r,oe=0,"prototype"in w&&w.prototype.render){for(i.state=i.__s,i.__d=!1,H&&H(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,H&&H(t),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++oe<25);i.state=i.__s,i.getChildContext!=null&&(_=$($({},_),i.getChildContext())),p||i.getSnapshotBeforeUpdate==null||(x=i.getSnapshotBeforeUpdate(u,g)),xe(e,Y(q=f!=null&&f.type===P&&f.key==null?f.props.children:f)?q:[q],t,n,_,o,r,c,s,l,a),i.base=t.__e,t.__u&=-161,i.__h.length&&c.push(i),b&&(i.__E=i.__=null)}catch(I){t.__v=null,l||r!=null?(t.__e=s,t.__u|=l?160:32,r[r.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),h.__e(I,t,n)}else r==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Be(n.__e,t,n,_,o,r,c,l,a);(f=h.diffed)&&f(t)}function $e(e,t,n){t.__d=void 0;for(var _=0;_<n.length;_++)te(n[_],n[++_],n[++_]);h.__c&&h.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(r){r.call(o)})}catch(r){h.__e(r,o.__v)}})}function Be(e,t,n,_,o,r,c,s,l){var a,f,i,p,u,g,x,b=n.props,m=t.props,k=t.type;if(k==="svg"&&(o=!0),r!=null){for(a=0;a<r.length;a++)if((u=r[a])&&"setAttribute"in u==!!k&&(k?u.localName===k:u.nodeType===3)){e=u,r[a]=null;break}}if(e==null){if(k===null)return document.createTextNode(m);e=o?document.createElementNS("http://www.w3.org/2000/svg",k):document.createElement(k,m.is&&m),r=null,s=!1}if(k===null)b===m||s&&e.data===m||(e.data=m);else{if(r=r&&R.call(e.childNodes),b=n.props||A,!s&&r!=null)for(b={},a=0;a<e.attributes.length;a++)b[(u=e.attributes[a]).name]=u.value;for(a in b)u=b[a],a=="children"||(a=="dangerouslySetInnerHTML"?i=u:a==="key"||a in m||F(e,a,null,u,o));for(a in m)u=m[a],a=="children"?p=u:a=="dangerouslySetInnerHTML"?f=u:a=="value"?g=u:a=="checked"?x=u:a==="key"||s&&typeof u!="function"||b[a]===u||F(e,a,u,b[a],o);if(f)s||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(i&&(e.innerHTML=""),xe(e,Y(p)?p:[p],t,n,_,o&&k!=="foreignObject",r,c,r?r[0]:n.__k&&U(n,0),s,l),r!=null)for(a=r.length;a--;)r[a]!=null&&ke(r[a]);s||(a="value",g!==void 0&&(g!==e[a]||k==="progress"&&!g||k==="option"&&g!==b[a])&&F(e,a,g,b[a],!1),a="checked",x!==void 0&&x!==e[a]&&F(e,a,x,b[a],!1))}return e}function te(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(_){h.__e(_,n)}}function J(e,t,n){var _,o;if(h.unmount&&h.unmount(e),(_=e.ref)&&(_.current&&_.current!==e.__e||te(_,null,t)),(_=e.__c)!=null){if(_.componentWillUnmount)try{_.componentWillUnmount()}catch(r){h.__e(r,t)}_.base=_.__P=null,e.__c=void 0}if(_=e.__k)for(o=0;o<_.length;o++)_[o]&&J(_[o],t,n||typeof e.type!="function");n||e.__e==null||ke(e.__e),e.__=e.__e=e.__d=void 0}function je(e,t,n){return this.constructor(e,n)}function Oe(e,t,n){var _,o,r,c;h.__&&h.__(e,t),o=(_=typeof n=="function")?null:n&&n.__k||t.__k,r=[],c=[],ee(t,e=(!_&&n||t).__k=Le(P,null,[e]),o||A,A,t.ownerSVGElement!==void 0,!_&&n?[n]:o?null:t.firstChild?R.call(t.childNodes):null,r,!_&&n?n:o?o.__e:t.firstChild,_,c),$e(r,e,c)}function z(e,t){var n={__c:t="__cC"+ge++,__:e,Consumer:function(_,o){return _.children(o)},Provider:function(_){var o,r;return this.getChildContext||(o=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(c){this.props.value!==c.value&&o.some(function(s){s.__e=!0,Z(s)})},this.sub=function(c){o.push(c);var s=c.componentWillUnmount;c.componentWillUnmount=function(){o.splice(o.indexOf(c),1),s&&s.call(c)}}),_.children}};return n.Provider.__=n.Consumer.contextType=n}R=be.slice,h={__e:function(e,t,n,_){for(var o,r,c;t=t.__;)if((o=t.__c)&&!o.__)try{if((r=o.constructor)&&r.getDerivedStateFromError!=null&&(o.setState(r.getDerivedStateFromError(e)),c=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,_||{}),c=o.__d),c)return o.__E=o}catch(s){e=s}throw e}},ve=0,O.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))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Z(this))},O.prototype.render=P,N=[],ye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,X=function(e,t){return e.__v.__b-t.__v.__b},W.__r=0,ge=0;var De=0;function d(e,t,n,_,o,r){var c,s,l={};for(s in t)s=="ref"?c=t[s]:l[s]=t[s];var a={type:e,props:l,key:n,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--De,__i:-1,__u:0,__source:o,__self:r};if(typeof e=="function"&&(c=e.defaultProps))for(s in c)l[s]===void 0&&(l[s]=c[s]);return h.vnode&&h.vnode(a),a}var T,v,G,se,K=0,Ne=[],D=[],y=h,ae=y.__b,le=y.__r,ue=y.diffed,fe=y.__c,de=y.unmount,pe=y.__;function ne(e,t){y.__h&&y.__h(v,e,K||t),K=0;var n=v.__H||(v.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:D}),n.__[e]}function S(e){return K=1,Ve(Ue,e)}function Ve(e,t,n){var _=ne(T++,2);if(_.t=e,!_.__c&&(_.__=[n?n(t):Ue(void 0,t),function(s){var l=_.__N?_.__N[0]:_.__[0],a=_.t(l,s);l!==a&&(_.__N=[a,_.__[1]],_.__c.setState({}))}],_.__c=v,!v.u)){var o=function(s,l,a){if(!_.__c.__H)return!0;var f=_.__c.__H.__.filter(function(p){return!!p.__c});if(f.every(function(p){return!p.__N}))return!r||r.call(this,s,l,a);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&&_.__c.props===s)&&(!r||r.call(this,s,l,a))};v.u=!0;var r=v.shouldComponentUpdate,c=v.componentWillUpdate;v.componentWillUpdate=function(s,l,a){if(this.__e){var f=r;r=void 0,o(s,l,a),r=f}c&&c.call(this,s,l,a)},v.shouldComponentUpdate=o}return _.__N||_.__}function M(e,t){var n=ne(T++,3);!y.__s&&Re(n.__H,t)&&(n.__=e,n.i=t,v.__H.__h.push(n))}function Pe(e){var t=v.context[e.__c],n=ne(T++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(v)),t.props.value):e.__}function We(){for(var e;e=Ne.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(V),e.__H.__h.forEach(Q),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){v=null,ae&&ae(e)},y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),pe&&pe(e,t)},y.__r=function(e){le&&le(e),T=0;var t=(v=e.__c).__H;t&&(G===v?(t.__h=[],v.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=D,n.__N=n.i=void 0})):(t.__h.forEach(V),t.__h.forEach(Q),t.__h=[],T=0)),G=v},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)(We)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==D&&(n.__=n.__V),n.i=void 0,n.__V=D})),G=v=null},y.__c=function(e,t){t.some(function(n){try{n.__h.forEach(V),n.__h=n.__h.filter(function(_){return!_.__||Q(_)})}catch(_){t.some(function(o){o.__h&&(o.__h=[])}),t=[],y.__e(_,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(_){try{V(_)}catch(o){t=o}}),n.__H=void 0,t&&y.__e(t,n.__v))};var he=typeof requestAnimationFrame=="function";function Me(e){var t,n=function(){clearTimeout(_),he&&cancelAnimationFrame(t),setTimeout(e)},_=setTimeout(n,100);he&&(t=requestAnimationFrame(n))}function V(e){var t=v,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),v=t}function Q(e){var t=v;e.__c=e.__(),v=t}function Re(e,t){return!e||e.length!==t.length||t.some(function(n,_){return n!==e[_]})}function Ue(e,t){return typeof t=="function"?t(e):t}let He=z({});const ze=e=>He=z({...e}),qe=()=>Pe(He),Ge=async(e,t,n,_)=>{const o=new Headers;o.append("Content-Type","application/x-www-form-urlencoded");let r;const c=new URLSearchParams;c.append("grant_type","authorization_code"),c.append("code",t),c.append("client_id",n),c.append("redirect_uri",_);const s=await fetch(`${e}/connect/token`,{method:"POST",headers:o,body:c});return s.ok&&(r=await s.json()),r},Xe=e=>{if(e)return{accessToken:e.access_token,isLoggedIn:!!e.access_token,expiresIn:e.expires_in}},Ze=e=>new URLSearchParams(window.location.search).get(e)??void 0,Je=async e=>{const t=Ze("code"),n=`${window.location.origin}/promoted-benefits/app/v1.0/`;if(!(!e.identityUrl||!e.clientId||!t))return Xe(await Ge(e.identityUrl,t,e.clientId,n))};let Se=z({});const Ke=e=>Se=z({...e}),Qe=()=>Pe(Se),Ye=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},Ae="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",Te=({path:e,children:t,className:n,onClick:_})=>e?d("a",{href:e,className:n,onClick:_,target:"_blank",rel:"noreferrer","data-testid":"actionAnchor",children:t}):d("button",{"data-testid":"actionButton",type:"button",className:n,onClick:_,children:t}),et=({banner:e,path:t,onClick:n})=>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(Te,{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",path:t,onClick:n,children:[e.buttonText,d("img",{className:"self-center",src:Ae,alt:""})]})})]}),d("div",{className:"self-center",children:d("img",{className:"w-20 h-20",src:e.imageUrl})})]}),tt=({card:e,path:t,onClick:n})=>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(Te,{className:"text-white text-base font-semibold font-['Inter'] leading-normal flex gap-2",path:t,onClick:n,children:[e.buttonText,d("img",{className:"self-center",src:Ae,alt:""})]})})]})]}),nt="fallback-cars-promotion",ot={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"},_t={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"},rt={type:"Benefits",path:"/categories/cars"},B={id:nt,banner:ot,card:_t,action:rt},it=async(e,t)=>{let n;if(!e||!t)return me();const _=`${e}/promoted-benefits/backend`,o=await fetch(`${_}/v1.0/promotion`,{headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.185"}});if(o.ok)n=await o.json();else return me();return n},me=()=>({action:B.action,banner:B.banner,card:B.card,id:B.id}),ct=async(e,t,n)=>{if(!t||!e)return;const _=`${e}/promoted-benefits/backend`;await fetch(`${_}/v1.0/promotion/${n}/view`,{method:"POST",headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.185"}})},st=async(e,t,n)=>{if(!t||!e)return;const _=`${e}/promoted-benefits/backend`;await fetch(`${_}/v1.0/promotion/${n==null?void 0:n.id}/action`,{method:"POST",body:JSON.stringify(n==null?void 0:n.action),headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.185"}})},at=async(e,t)=>{let n;const _=await fetch(e,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});return _.ok&&(n=await _.json()),n},lt=(e,t,n,_)=>{const o=document.referrer;return`${e}/app/?token=${t}&redirectPath=${n}&referrer=${o}&promotionId=${_}`},ut=async(e,t,n,_)=>{const o=`${e==null?void 0:e.apolloBaseUrl}/benefits`;if(!o||!n||!t||!_)return;const r=await at(`${o}/backend/v1.0/current/token`,t);if(!(!r||!r.token))return lt(o,r.token,n,_)},ft=async(e,t,n)=>{let _;switch(e.action.type.toLowerCase()){case"benefits":return _=await ut(t,n.accessToken,e.action.path,e.id),{path:void 0,onClick:()=>{const r=window.open();r&&_&&(r.location=_)}};case"public":return{path:e.action.path,onClick:void 0};default:return}},dt=()=>{const e=qe(),t=Qe(),[n,_]=S(),[o,r]=S();M(()=>{(async()=>{const s=await it(t==null?void 0:t.apolloBaseUrl,e==null?void 0:e.accessToken);_(s),ct(t.apolloBaseUrl,e.accessToken,s==null?void 0:s.id)})()},[t.apolloBaseUrl,e.accessToken]),M(()=>{(async()=>n&&r(await ft(n,t,e)))()},[t,e,n]);const c=()=>{o!=null&&o.onClick&&(o==null||o.onClick()),st(t.apolloBaseUrl,e.accessToken,n)};return n?d(P,{children:[d(et,{banner:n.banner,path:o==null?void 0:o.path,onClick:c}),d(tt,{card:n.card,path:o==null?void 0:o.path,onClick:c})]}):d(P,{})},pt=()=>{const[e,t]=S({}),[n,_]=S(),[o,r]=S(!1);return ze(e),M(()=>{(async()=>{const c=await Ye();c&&(Ke(c),_(c))})()},[]),M(()=>{(async()=>{if(!o&&n){const c=await Je(n);c&&t(c),r(!0)}})()},[n,o]),o?d(dt,{}):d(P,{})};Oe(d(pt,{}),document.body);
|