@flarehr/promoted-benefits-ui 1.0.1003 → 1.0.1004

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(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a,o,s,c={},l=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function f(e,t){for(var n in t)e[n]=t[n];return e}function p(e){var t=e.parentNode;t&&t.removeChild(e)}function m(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return h(t,s,i,a,null)}function h(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function g(e){return e.children}function _(e,t){this.props=e,this.context=t}function v(e,t){if(t==null)return e.__?v(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`?v(e):null}function y(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 y(e)}}function b(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!x.__r++||i!==t.debounceRendering)&&((i=t.debounceRendering)||a)(x)}function x(){var e,n,i,a,s,c,l,u,d;for(r.sort(o);e=r.shift();)e.__d&&(n=r.length,a=void 0,c=(s=(i=e).__v).__e,u=[],d=[],(l=i.__P)&&((a=f({},s)).__v=s.__v+1,t.vnode&&t.vnode(a),k(l,a,s,i.__n,l.ownerSVGElement!==void 0,32&s.__u?[c]:null,u,c??v(s),!!(32&s.__u),d),a.__v=s.__v,a.__.__k[a.__i]=a,A(u,a,d),a.__e!=c&&y(a)),r.length>n&&r.sort(o));x.__r=0}function ee(e,t,n,r,i,a,o,s,u,d,f){var p,m,h,g,_,y=r&&r.__k||l,b=t.length;for(n.__d=u,S(n,t,y),u=n.__d,p=0;p<b;p++)(h=n.__k[p])!=null&&typeof h!=`boolean`&&typeof h!=`function`&&(m=h.__i===-1?c:y[h.__i]||c,h.__i=p,k(e,h,m,i,a,o,s,u,d,f),g=h.__e,h.ref&&m.ref!=h.ref&&(m.ref&&ne(m.ref,null,h),f.push(h.ref,h.__c||g,h)),_==null&&g!=null&&(_=g),65536&h.__u||m.__k===h.__k?(g||m.__e!=u||(u=v(m)),u=C(h,u,e)):typeof h.type==`function`&&h.__d!==void 0?u=h.__d:g&&(u=g.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=u,n.__e=_}function S(e,t,n){var r,i,a,o,s,c=t.length,l=n.length,u=l,f=0;for(e.__k=[],r=0;r<c;r++)o=r+f,(i=e.__k[r]=(i=t[r])==null||typeof i==`boolean`||typeof i==`function`?null:typeof i==`string`||typeof i==`number`||typeof i==`bigint`||i.constructor==String?h(null,i,null,null,null):d(i)?h(g,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?h(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)==null?(a=n[o])&&a.key==null&&a.__e&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=v(a)),re(a,a,!1),n[o]=null,u--):(i.__=e,i.__b=e.__b+1,s=w(i,n,o,u),i.__i=s,a=null,s!==-1&&(u--,(a=n[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&f--,typeof i.type!=`function`&&(i.__u|=65536)):s!==o&&(s===o+1?f++:s>o?u>c-o?f+=s-o:f--:s<o?s==o-1&&(f=s-o):f=0,s!==r+f&&(i.__u|=65536)));if(u)for(r=0;r<l;r++)(a=n[r])!=null&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=v(a)),re(a,a))}function C(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=C(r[i],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType===8);return t}function w(e,t,n,r){var i=e.key,a=e.type,o=n-1,s=n+1,c=t[n];if(c===null||c&&i==c.key&&a===c.type&&!(131072&c.__u))return n;if(r>+(c!=null&&!(131072&c.__u)))for(;o>=0||s<t.length;){if(o>=0){if((c=t[o])&&!(131072&c.__u)&&i==c.key&&a===c.type)return o;o--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&i==c.key&&a===c.type)return s;s++}}return-1}function T(e,t,n){t[0]===`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||u.test(t)?n:n+`px`}function E(e,t,n,r,i){var a;n: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||T(e.style,t,``);if(n)for(t in n)r&&n[t]===r[t]||T(e.style,t,n[t])}else if(t[0]===`o`&&t[1]===`n`)a=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[t+a]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,a?O:D,a)):e.removeEventListener(t,a?O:D,a);else{if(i)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 n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!==`-`?e.removeAttribute(t):e.setAttribute(t,n))}}function D(e){if(this.l){var n=this.l[e.type+!1];if(e.t){if(e.t<=n.u)return}else e.t=Date.now();return n(t.event?t.event(e):e)}}function O(e){if(this.l)return this.l[e.type+!0](t.event?t.event(e):e)}function k(e,n,r,i,a,o,s,c,l,u){var p,m,h,v,y,b,x,S,C,w,T,E,D,O,k,A=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(p=t.__b)&&p(n);n:if(typeof A==`function`)try{if(S=n.props,C=(p=A.contextType)&&i[p.__c],w=p?C?C.props.value:p.__:i,r.__c?x=(m=n.__c=r.__c).__=m.__E:(`prototype`in A&&A.prototype.render?n.__c=m=new A(S,w):(n.__c=m=new _(S,w),m.constructor=A,m.render=ie),C&&C.sub(m),m.props=S,m.state||={},m.context=w,m.__n=i,h=m.__d=!0,m.__h=[],m._sb=[]),m.__s??=m.state,A.getDerivedStateFromProps!=null&&(m.__s==m.state&&(m.__s=f({},m.__s)),f(m.__s,A.getDerivedStateFromProps(S,m.__s))),v=m.props,y=m.state,m.__v=n,h)A.getDerivedStateFromProps==null&&m.componentWillMount!=null&&m.componentWillMount(),m.componentDidMount!=null&&m.__h.push(m.componentDidMount);else{if(A.getDerivedStateFromProps==null&&S!==v&&m.componentWillReceiveProps!=null&&m.componentWillReceiveProps(S,w),!m.__e&&(m.shouldComponentUpdate!=null&&!1===m.shouldComponentUpdate(S,m.__s,w)||n.__v===r.__v)){for(n.__v!==r.__v&&(m.props=S,m.state=m.__s,m.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.forEach(function(e){e&&(e.__=n)}),T=0;T<m._sb.length;T++)m.__h.push(m._sb[T]);m._sb=[],m.__h.length&&s.push(m);break n}m.componentWillUpdate!=null&&m.componentWillUpdate(S,m.__s,w),m.componentDidUpdate!=null&&m.__h.push(function(){m.componentDidUpdate(v,y,b)})}if(m.context=w,m.props=S,m.__P=e,m.__e=!1,E=t.__r,D=0,`prototype`in A&&A.prototype.render){for(m.state=m.__s,m.__d=!1,E&&E(n),p=m.render(m.props,m.state,m.context),O=0;O<m._sb.length;O++)m.__h.push(m._sb[O]);m._sb=[]}else do m.__d=!1,E&&E(n),p=m.render(m.props,m.state,m.context),m.state=m.__s;while(m.__d&&++D<25);m.state=m.__s,m.getChildContext!=null&&(i=f(f({},i),m.getChildContext())),h||m.getSnapshotBeforeUpdate==null||(b=m.getSnapshotBeforeUpdate(v,y)),ee(e,d(k=p!=null&&p.type===g&&p.key==null?p.props.children:p)?k:[k],n,r,i,a,o,s,c,l,u),m.base=n.__e,n.__u&=-161,m.__h.length&&s.push(m),x&&(m.__E=m.__=null)}catch(e){n.__v=null,l||o!=null?(n.__e=c,n.__u|=l?160:32,o[o.indexOf(c)]=null):(n.__e=r.__e,n.__k=r.__k),t.__e(e,n,r)}else o==null&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=te(r.__e,n,r,i,a,o,s,l,u);(p=t.diffed)&&p(n)}function A(e,n,r){n.__d=void 0;for(var i=0;i<r.length;i++)ne(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function te(t,n,r,i,a,o,s,l,u){var f,m,h,g,_,y,b,x=r.props,S=n.props,C=n.type;if(C===`svg`&&(a=!0),o!=null){for(f=0;f<o.length;f++)if((_=o[f])&&`setAttribute`in _==!!C&&(C?_.localName===C:_.nodeType===3)){t=_,o[f]=null;break}}if(t==null){if(C===null)return document.createTextNode(S);t=a?document.createElementNS(`http://www.w3.org/2000/svg`,C):document.createElement(C,S.is&&S),o=null,l=!1}if(C===null)x===S||l&&t.data===S||(t.data=S);else{if(o&&=e.call(t.childNodes),x=r.props||c,!l&&o!=null)for(x={},f=0;f<t.attributes.length;f++)x[(_=t.attributes[f]).name]=_.value;for(f in x)_=x[f],f==`children`||(f==`dangerouslySetInnerHTML`?h=_:f===`key`||f in S||E(t,f,null,_,a));for(f in S)_=S[f],f==`children`?g=_:f==`dangerouslySetInnerHTML`?m=_:f==`value`?y=_:f==`checked`?b=_:f===`key`||l&&typeof _!=`function`||x[f]===_||E(t,f,_,x[f],a);if(m)l||h&&(m.__html===h.__html||m.__html===t.innerHTML)||(t.innerHTML=m.__html),n.__k=[];else if(h&&(t.innerHTML=``),ee(t,d(g)?g:[g],n,r,i,a&&C!==`foreignObject`,o,s,o?o[0]:r.__k&&v(r,0),l,u),o!=null)for(f=o.length;f--;)o[f]!=null&&p(o[f]);l||(f=`value`,y!==void 0&&(y!==t[f]||C===`progress`&&!y||C===`option`&&y!==x[f])&&E(t,f,y,x[f],!1),f=`checked`,b!==void 0&&b!==t[f]&&E(t,f,b,x[f],!1))}return t}function ne(e,n,r){try{typeof e==`function`?e(n):e.current=n}catch(e){t.__e(e,r)}}function re(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||ne(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&re(i[a],n,r||typeof e.type!=`function`);r||e.__e==null||p(e.__e),e.__=e.__e=e.__d=void 0}function ie(e,t,n){return this.constructor(e,n)}function ae(n,r,i){var a,o,s,l;t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],l=[],k(r,n=(!a&&i||r).__k=m(g,null,[n]),o||c,c,r.ownerSVGElement!==void 0,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,l),A(s,n,l)}function j(e,t){var n={__c:t=`__cC`+ s++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(function(e){e.__e=!0,b(e)})},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}e=l.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,_.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=f({},this.state);typeof e==`function`&&(e=e(f({},n),this.props)),e&&f(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),b(this))},_.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),b(this))},_.prototype.render=g,r=[],a=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=function(e,t){return e.__v.__b-t.__v.__b},x.__r=0,s=0;var M,N,oe,se,ce=0,le=[],P=[],F=t,ue=F.__b,de=F.__r,fe=F.diffed,pe=F.__c,me=F.unmount,he=F.__;function ge(e,t){F.__h&&F.__h(N,e,ce||t),ce=0;var n=N.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({__V:P}),n.__[e]}function I(e){return ce=1,_e(we,e)}function _e(e,t,n){var r=ge(M++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):we(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=N,!N.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=!1;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),!(!o&&r.__c.props===e)&&(!a||a.call(this,e,t,n))};N.u=!0;var a=N.shouldComponentUpdate,o=N.componentWillUpdate;N.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},N.shouldComponentUpdate=i}return r.__N||r.__}function L(e,t){var n=ge(M++,3);!F.__s&&Ce(n.__H,t)&&(n.__=e,n.i=t,N.__H.__h.push(n))}function ve(e){var t=N.context[e.__c],n=ge(M++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(N)),t.props.value):e.__}function ye(){for(var e;e=le.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(R),e.__H.__h.forEach(Se),e.__H.__h=[]}catch(t){e.__H.__h=[],F.__e(t,e.__v)}}F.__b=function(e){N=null,ue&&ue(e)},F.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),he&&he(e,t)},F.__r=function(e){de&&de(e),M=0;var t=(N=e.__c).__H;t&&(oe===N?(t.__h=[],N.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=P,e.__N=e.i=void 0})):(t.__h.forEach(R),t.__h.forEach(Se),t.__h=[],M=0)),oe=N},F.diffed=function(e){fe&&fe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(le.push(t)!==1&&se===F.requestAnimationFrame||((se=F.requestAnimationFrame)||xe)(ye)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==P&&(e.__=e.__V),e.i=void 0,e.__V=P})),oe=N=null},F.__c=function(e,t){t.some(function(e){try{e.__h.forEach(R),e.__h=e.__h.filter(function(e){return!e.__||Se(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],F.__e(n,e.__v)}}),pe&&pe(e,t)},F.unmount=function(e){me&&me(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{R(e)}catch(e){t=e}}),n.__H=void 0,t&&F.__e(t,n.__v))};var be=typeof requestAnimationFrame==`function`;function xe(e){var t,n=function(){clearTimeout(r),be&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);be&&(t=requestAnimationFrame(n))}function R(e){var t=N,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),N=t}function Se(e){var t=N;e.__c=e.__(),N=t}function Ce(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function we(e,t){return typeof t==`function`?t(e):t}var Te=j({}),Ee=e=>Te=j({...e}),De=()=>ve(Te),Oe=()=>{Ee({})},ke=async(e,t,n,r)=>{let i=new Headers;i.append(`Content-Type`,`application/x-www-form-urlencoded`);let a,o=new URLSearchParams;o.append(`grant_type`,`authorization_code`),o.append(`code`,t),o.append(`client_id`,n),o.append(`redirect_uri`,r);let s=await fetch(`${e}/connect/token`,{method:`POST`,headers:i,body:o});return s.ok&&(a=await s.json()),a},Ae=(e,t)=>{if(e)return{accessToken:e.access_token,promotionId:t,isLoggedIn:!!e.access_token,expiresIn:e.expires_in}},je=e=>new URLSearchParams(window.location.search).get(e)??void 0,Me=async e=>{let t=je(`code`),n=je(`state`),r=`${window.location.origin}/promoted-benefits/app/v1.0/`;if(!(!e.identityUrl||!e.clientId||!t))return Ae(await ke(e.identityUrl,t,e.clientId,r),n)},Ne=j({}),Pe=e=>Ne=j({...e}),Fe=()=>ve(Ne),Ie=async()=>{let e,t=await fetch(`${window.location.origin}/promoted-benefits/app/v1.0/config.json`);return t.ok&&(e=await t.json()),e},Le=0;Array.isArray;function z(e,n,r,i,a,o){var s,c,l={};for(c in n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Le,__i:-1,__u:0,__source:a,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return t.vnode&&t.vnode(u),u}for(var Re=({path:e,children:t,className:n,onClick:r})=>e?z(`a`,{href:e,className:n,onClick:r,target:`_blank`,rel:`noreferrer`,children:t}):z(`button`,{type:`button`,className:n,onClick:r,children:t}),ze=({banner:e,path:t,onClick:n})=>z(`div`,{"data-testid":`banner`,children:z(Re,{className:`font-['Inter'] bg-white grid grid-cols-12 overflow-hidden text-left card:hidden`,path:t,onClick:n,children:[z(`div`,{className:`col-span-8 xl:col-span-10 lg:col-span-8 grid gap-1 my-auto items-start p-4`,children:[z(`h1`,{className:`text-[#20303C] text-xs md:text-sm font-bold leading-4`,children:e.title}),z(`p`,{className:`text-[#4D5963] text-[0.6875rem] leading-4 md:text-xs font-medium md:leading-5`,children:[e.description,z(`span`,{className:`sm:block sm:pl-0 sm:pt-1 pl-1 pt-0 font-bold text-[#116DFF] whitespace-nowrap `,children:[z(`span`,{className:`underline underline-offset-2`,children:e.buttonText}),z(`span`,{className:`no-underline`,children:` -->`})]})]})]}),z(`div`,{className:`p-0 col-span-4 xl:col-span-2 lg:col-span-4 grid h-full auto-cols-max ml-auto justify-self-start overflow-hidden`,children:z(`img`,{className:`w-52 h-full max-h-44 object-cover`,src:e.imageUrl})})]})}),Be=`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`,Ve=({card:e,path:t,onClick:n})=>z(`div`,{"data-testid":`card`,className:`px-8 pt-6 pb-4 bg-white rounded-lg flex-col justify-start items-center gap-5 hidden card:inline-flex`,children:[z(`div`,{children:z(`img`,{className:`relative bg-white block max-h-[15.5625rem] max-w-[100%] h-auto`,src:e.imageUrl})}),z(`div`,{className:`flex-col justify-start items-center gap-7 flex`,children:[z(`div`,{className:`flex-col justify-start items-start gap-4 flex`,children:z(`div`,{className:`self-stretch flex-col justify-start items-start gap-2 flex`,children:[z(`div`,{className:`self-stretch text-[#143057] text-2xl font-bold font-['Inter'] leading-7`,children:e.title}),z(`div`,{className:`self-stretch text-gray-900 text-base font-normal font-['Inter'] leading-normal`,children:e.description})]})}),z(Re,{className:`self-stretch p-4 justify-center items-center bg-[#2e66f7] hover:bg-[#286090] rounded-md text-white text-base font-semibold font-['Inter'] leading-normal flex gap-2`,path:t,onClick:n,children:[e.buttonText,z(`img`,{className:`self-center`,src:Be,alt:``})]})]})]}),B={id:`fallback-econnex-energy`,banner:{title:`Paying too much for energy?`,description:`Compare plans in just a few minutes with Flare Benefits & Econnex, and you could save when you switch to a better deal.`,buttonText:`Learn more`,imageUrl:`./images/flare-energy-banner.png`},card:{title:`Paying too much for energy?`,description:`Compare plans in just a few minutes with Flare Benefits & Econnex, and you could save when you switch to a better deal.`,buttonText:`Learn more`,imageUrl:`./images/flare-energy-card.png`},action:{type:`Public`,path:`https://econnex.com.au/?rc=862160&utm_source=promoted_benefits&utm_medium=fallback&utm_campaign=energy_alwayson&utm_content=energy_intialoffer`}},He=async(e,t,n)=>{if(!e||!t)return V();let r;switch(n){case`fallback`:return V();case void 0:r=`${e}/promoted-benefits/backend/v1.0/promotion`;break;default:r=`${e}/promoted-benefits/backend/v1.0/promotion/${n}`;break}let i=await fetch(`${r}`,{headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":`1.0.1003`}});if(i.status===204)return V();let a;if(i.ok)try{a=await i.json()}catch(e){return console.error(`Error parsing promotion response: ${e}`),V()}return!a||Object.keys(a).length===0?V():a},V=()=>({action:B.action,banner:B.banner,card:B.card,id:B.id}),Ue=e=>{let t=sessionStorage.getItem(e);return t?JSON.parse(t):void 0},We=(e,t)=>{sessionStorage.setItem(e,JSON.stringify(t))},H=[],Ge=0;Ge<256;++Ge)H.push((Ge+256).toString(16).slice(1));function Ke(e,t=0){return(H[e[t+0]]+H[e[t+1]]+H[e[t+2]]+H[e[t+3]]+`-`+H[e[t+4]]+H[e[t+5]]+`-`+H[e[t+6]]+H[e[t+7]]+`-`+H[e[t+8]]+H[e[t+9]]+`-`+H[e[t+10]]+H[e[t+11]]+H[e[t+12]]+H[e[t+13]]+H[e[t+14]]+H[e[t+15]]).toLowerCase()}var U,qe=new Uint8Array(16);function Je(){if(!U&&(U=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!U))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return U(qe)}var Ye={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Xe(e,t,n){if(Ye.randomUUID&&!t&&!e)return Ye.randomUUID();e||={};var r=e.random||(e.rng||Je)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n||=0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return Ke(r)}var Ze=()=>{let e=Ue(`distinctId`);if(!e){let e=Xe();return We(`distinctId`,e),e}return e},W=()=>({sourceUrl:document.referrer,clientAppVersion:`1.0.1003`}),Qe=async e=>{e&&tt(e,{eventName:`appLoaded`,distinctId:Ze(),session:W()})},$e=async(e,t,n)=>{if(!e)return;if(!t)return tt(e,{eventName:`promotionViewed`,promotionId:n,distinctId:Ze(),session:W()});let r=`${e}/promoted-benefits/backend`;await fetch(`${r}/v1.0/promotion/${n}/view`,{method:`POST`,body:JSON.stringify({session:W()}),headers:{Authorization:`Bearer ${t}`}})},et=async(e,t,n)=>{if(!e)return;if(!t)return tt(e,{eventName:`promotionActioned`,promotionId:n?.id,actionUrl:n?.action?.path,distinctId:Ze(),session:W()});let r=`${e}/promoted-benefits/backend`;await fetch(`${r}/v1.0/promotion/${n?.id}/action`,{method:`POST`,body:JSON.stringify({...n?.action,session:W()}),headers:{Authorization:`Bearer ${t}`}})},tt=async(e,t)=>{let n=`${e}/promoted-benefits/public`;await fetch(`${n}/v1.0/track`,{method:`POST`,body:JSON.stringify({...t,session:W()})})},nt=async(e,t)=>{let n,r=await fetch(e,{method:`GET`,headers:{Authorization:`Bearer ${t}`,"Content-Type":`application/json`}});return r.ok&&(n=await r.json()),n},rt=(e,t,n,r)=>`${e}/app/?token=${t}&redirectPath=${n}&referrer=${document.referrer}&promotionId=${r}`,it=async(e,t,n,r)=>{let i=`${e?.apolloBaseUrl}/benefits`;if(!i||!n||!t||!r)return;let a=await nt(`${i}/backend/v1.0/current/token`,t);if(!(!a||!a.token))return rt(i,a.token,n,r)},at=async(e,t,n)=>{let r;switch(e.action.type.toLowerCase()){case`benefits`:return r=await it(t,n.accessToken,e.action.path,e.id),{path:void 0,onClick:()=>{let e=window.open();e&&r&&(e.location=r)}};case`public`:return{path:e.action.path,onClick:void 0};default:return}},ot=()=>{let e=De(),t=Fe(),[n,r]=I(),[i,a]=I();L(()=>{(async()=>{let n=await He(t?.apolloBaseUrl,e?.accessToken,e?.promotionId);r(n),$e(t.apolloBaseUrl,e.accessToken,n?.id)})()},[t.apolloBaseUrl,e.accessToken]),L(()=>{if(e&&e.expiresIn){let t=1e3*e.expiresIn,n=setTimeout(()=>{r(V()),Oe()},t);return()=>clearTimeout(n)}},[n,e]),L(()=>{(async()=>{n&&a(await at(n,t,e))})()},[t,e,n]);let o=()=>{i?.onClick&&i?.onClick(),et(t.apolloBaseUrl,e.accessToken,n)};return n?z(g,{children:[z(ze,{banner:n.banner,path:i?.path,onClick:o}),z(Ve,{card:n.card,path:i?.path,onClick:o})]}):z(g,{})},G=[],st=function(){return G.some(function(e){return e.activeTargets.length>0})},ct=function(){return G.some(function(e){return e.skippedTargets.length>0})},lt=`ResizeObserver loop completed with undelivered notifications.`,ut=function(){var e;typeof ErrorEvent==`function`?e=new ErrorEvent(`error`,{message:lt}):(e=document.createEvent(`Event`),e.initEvent(`error`,!1,!1),e.message=lt),window.dispatchEvent(e)},K;(function(e){e.BORDER_BOX=`border-box`,e.CONTENT_BOX=`content-box`,e.DEVICE_PIXEL_CONTENT_BOX=`device-pixel-content-box`})(K||={});var q=function(e){return Object.freeze(e)},dt=function(){function e(e,t){this.inlineSize=e,this.blockSize=t,q(this)}return e}(),ft=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,q(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),pt=function(e){return e instanceof SVGElement&&`getBBox`in e},mt=function(e){if(pt(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,a=i.offsetWidth,o=i.offsetHeight;return!(a||o||e.getClientRects().length)},ht=function(e){if(e instanceof Element)return!0;var t=e?.ownerDocument?.defaultView;return!!(t&&e instanceof t.Element)},gt=function(e){switch(e.tagName){case`INPUT`:if(e.type!==`image`)break;case`VIDEO`:case`AUDIO`:case`EMBED`:case`OBJECT`:case`CANVAS`:case`IFRAME`:case`IMG`:return!0}return!1},J=typeof window<`u`?window:{},Y=new WeakMap,_t=/auto|scroll/,vt=/^tb|vertical/,yt=/msie|trident/i.test(J.navigator&&J.navigator.userAgent),X=function(e){return parseFloat(e||`0`)},Z=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new dt((n?t:e)||0,(n?e:t)||0)},bt=q({devicePixelContentBoxSize:Z(),borderBoxSize:Z(),contentBoxSize:Z(),contentRect:new ft(0,0,0,0)}),xt=function(e,t){if(t===void 0&&(t=!1),Y.has(e)&&!t)return Y.get(e);if(mt(e))return Y.set(e,bt),bt;var n=getComputedStyle(e),r=pt(e)&&e.ownerSVGElement&&e.getBBox(),i=!yt&&n.boxSizing===`border-box`,a=vt.test(n.writingMode||``),o=!r&&_t.test(n.overflowY||``),s=!r&&_t.test(n.overflowX||``),c=r?0:X(n.paddingTop),l=r?0:X(n.paddingRight),u=r?0:X(n.paddingBottom),d=r?0:X(n.paddingLeft),f=r?0:X(n.borderTopWidth),p=r?0:X(n.borderRightWidth),m=r?0:X(n.borderBottomWidth),h=r?0:X(n.borderLeftWidth),g=d+l,_=c+u,v=h+p,y=f+m,b=s?e.offsetHeight-y-e.clientHeight:0,x=o?e.offsetWidth-v-e.clientWidth:0,ee=i?g+v:0,S=i?_+y:0,C=r?r.width:X(n.width)-ee-x,w=r?r.height:X(n.height)-S-b,T=C+g+x+v,E=w+_+b+y,D=q({devicePixelContentBoxSize:Z(Math.round(C*devicePixelRatio),Math.round(w*devicePixelRatio),a),borderBoxSize:Z(T,E,a),contentBoxSize:Z(C,w,a),contentRect:new ft(d,c,C,w)});return Y.set(e,D),D},St=function(e,t,n){var r=xt(e,n),i=r.borderBoxSize,a=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(t){case K.DEVICE_PIXEL_CONTENT_BOX:return o;case K.BORDER_BOX:return i;default:return a}},Ct=function(){function e(e){var t=xt(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=q([t.borderBoxSize]),this.contentBoxSize=q([t.contentBoxSize]),this.devicePixelContentBoxSize=q([t.devicePixelContentBoxSize])}return e}(),wt=function(e){if(mt(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Tt=function(){var e=1/0,t=[];G.forEach(function(n){if(n.activeTargets.length!==0){var r=[];n.activeTargets.forEach(function(t){var n=new Ct(t.target),i=wt(t.target);r.push(n),t.lastReportedSize=St(t.target,t.observedBox),i<e&&(e=i)}),t.push(function(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var i=r[n];i()}return e},Et=function(e){G.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(wt(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},Dt=function(){var e=0;for(Et(e);st();)e=Tt(),Et(e);return ct()&&ut(),e>0},Ot,kt=[],At=function(){return kt.splice(0).forEach(function(e){return e()})},jt=function(e){if(!Ot){var t=0,n=document.createTextNode(``);new MutationObserver(function(){return At()}).observe(n,{characterData:!0}),Ot=function(){n.textContent=`${t?t--:t++}`}}kt.push(e),Ot()},Mt=function(e){jt(function(){requestAnimationFrame(e)})},Q=0,Nt=function(){return!!Q},Pt=250,Ft={attributes:!0,characterData:!0,childList:!0,subtree:!0},It=[`resize`,`load`,`transitionend`,`animationend`,`animationstart`,`animationiteration`,`keyup`,`keydown`,`mouseup`,`mousedown`,`mouseover`,`mouseout`,`blur`,`focus`],Lt=function(e){return e===void 0&&(e=0),Date.now()+e},Rt=!1,zt=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(e===void 0&&(e=Pt),!Rt){Rt=!0;var n=Lt(e);Mt(function(){var r=!1;try{r=Dt()}finally{if(Rt=!1,e=n-Lt(),!Nt())return;r?t.run(1e3):e>0?t.run(e):t.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Ft)};document.body?t():J.addEventListener(`DOMContentLoaded`,t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),It.forEach(function(t){return J.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||=(this.observer&&this.observer.disconnect(),It.forEach(function(t){return J.removeEventListener(t,e.listener,!0)}),!0)},e}()),Bt=function(e){!Q&&e>0&&zt.start(),Q+=e,!Q&&zt.stop()},Vt=function(e){return!pt(e)&&!gt(e)&&getComputedStyle(e).display===`inline`},Ht=function(){function e(e,t){this.target=e,this.observedBox=t||K.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=St(this.target,this.observedBox,!0);return Vt(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),Ut=function(){function e(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}return e}(),$=new WeakMap,Wt=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Gt=function(){function e(){}return e.connect=function(e,t){var n=new Ut(e,t);$.set(e,n)},e.observe=function(e,t,n){var r=$.get(e),i=r.observationTargets.length===0;Wt(r.observationTargets,t)<0&&(i&&G.push(r),r.observationTargets.push(new Ht(t,n&&n.box)),Bt(1),zt.schedule())},e.unobserve=function(e,t){var n=$.get(e),r=Wt(n.observationTargets,t),i=n.observationTargets.length===1;r>=0&&(i&&G.splice(G.indexOf(n),1),n.observationTargets.splice(r,1),Bt(-1))},e.disconnect=function(e){var t=this,n=$.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),Kt=function(){function e(e){if(arguments.length===0)throw TypeError(`Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.`);if(typeof e!=`function`)throw TypeError(`Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.`);Gt.connect(this,e)}return e.prototype.observe=function(e,t){if(arguments.length===0)throw TypeError(`Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.`);if(!ht(e))throw TypeError(`Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element`);Gt.observe(this,e,t)},e.prototype.unobserve=function(e){if(arguments.length===0)throw TypeError(`Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.`);if(!ht(e))throw TypeError(`Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element`);Gt.unobserve(this,e)},e.prototype.disconnect=function(){Gt.disconnect(this)},e.toString=function(){return`function ResizeObserver () { [polyfill code] }`},e}(),qt=e=>{if(e){let t=1e3*e,n={sender:`flare`,type:`promotionsSessionExpired`};setTimeout(()=>{window.parent.postMessage(n,`*`)},t)}},Jt=(e,t)=>{if(e&&t){let n=1e3*e,r={expiry:t,sender:`flare`,type:`promotionsSessionExpiring`};setTimeout(()=>{window.parent.postMessage(r,`*`)},n-3e5)}},Yt=()=>{let e={height:Math.min(document.body.offsetHeight,220),sender:`flare`,type:`contentResized`};window.parent.postMessage(e,`*`)},Xt=()=>{new Kt(()=>{Yt()}).observe(document.body)},Zt=e=>{try{let t=e.split(`.`)[1].replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t);return JSON.parse(n)}catch{return}};ae(z(()=>{let[e,t]=I({}),[n,r]=I(),[i,a]=I(!1);return Ee(e),L(()=>{(async()=>{let e=await Ie();e&&(Pe(e),r(e))})()},[]),L(()=>{(async()=>{if(!i&&n){Qe(n.apolloBaseUrl);let e=await Me(n);e&&t(e),a(!0)}})()},[n,i]),L(()=>{if(e.expiresIn&&e.accessToken){let t=Zt(e.accessToken);qt(e.expiresIn),Jt(e.expiresIn,t?.exp)}},[e]),L(()=>{Xt()},[]),i?z(`div`,{className:`flex items-center justify-center min-h-[100px]`,children:z(ot,{})}):z(g,{})},{}),document.body);
1
+ (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a,o,s,c={},l=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function f(e,t){for(var n in t)e[n]=t[n];return e}function p(e){var t=e.parentNode;t&&t.removeChild(e)}function m(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return h(t,s,i,a,null)}function h(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function g(e){return e.children}function _(e,t){this.props=e,this.context=t}function v(e,t){if(t==null)return e.__?v(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`?v(e):null}function y(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 y(e)}}function b(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!x.__r++||i!==t.debounceRendering)&&((i=t.debounceRendering)||a)(x)}function x(){var e,n,i,a,s,c,l,u,d;for(r.sort(o);e=r.shift();)e.__d&&(n=r.length,a=void 0,c=(s=(i=e).__v).__e,u=[],d=[],(l=i.__P)&&((a=f({},s)).__v=s.__v+1,t.vnode&&t.vnode(a),k(l,a,s,i.__n,l.ownerSVGElement!==void 0,32&s.__u?[c]:null,u,c??v(s),!!(32&s.__u),d),a.__v=s.__v,a.__.__k[a.__i]=a,A(u,a,d),a.__e!=c&&y(a)),r.length>n&&r.sort(o));x.__r=0}function ee(e,t,n,r,i,a,o,s,u,d,f){var p,m,h,g,_,y=r&&r.__k||l,b=t.length;for(n.__d=u,S(n,t,y),u=n.__d,p=0;p<b;p++)(h=n.__k[p])!=null&&typeof h!=`boolean`&&typeof h!=`function`&&(m=h.__i===-1?c:y[h.__i]||c,h.__i=p,k(e,h,m,i,a,o,s,u,d,f),g=h.__e,h.ref&&m.ref!=h.ref&&(m.ref&&ne(m.ref,null,h),f.push(h.ref,h.__c||g,h)),_==null&&g!=null&&(_=g),65536&h.__u||m.__k===h.__k?(g||m.__e!=u||(u=v(m)),u=C(h,u,e)):typeof h.type==`function`&&h.__d!==void 0?u=h.__d:g&&(u=g.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=u,n.__e=_}function S(e,t,n){var r,i,a,o,s,c=t.length,l=n.length,u=l,f=0;for(e.__k=[],r=0;r<c;r++)o=r+f,(i=e.__k[r]=(i=t[r])==null||typeof i==`boolean`||typeof i==`function`?null:typeof i==`string`||typeof i==`number`||typeof i==`bigint`||i.constructor==String?h(null,i,null,null,null):d(i)?h(g,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?h(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)==null?(a=n[o])&&a.key==null&&a.__e&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=v(a)),re(a,a,!1),n[o]=null,u--):(i.__=e,i.__b=e.__b+1,s=w(i,n,o,u),i.__i=s,a=null,s!==-1&&(u--,(a=n[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&f--,typeof i.type!=`function`&&(i.__u|=65536)):s!==o&&(s===o+1?f++:s>o?u>c-o?f+=s-o:f--:s<o?s==o-1&&(f=s-o):f=0,s!==r+f&&(i.__u|=65536)));if(u)for(r=0;r<l;r++)(a=n[r])!=null&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=v(a)),re(a,a))}function C(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=C(r[i],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType===8);return t}function w(e,t,n,r){var i=e.key,a=e.type,o=n-1,s=n+1,c=t[n];if(c===null||c&&i==c.key&&a===c.type&&!(131072&c.__u))return n;if(r>+(c!=null&&!(131072&c.__u)))for(;o>=0||s<t.length;){if(o>=0){if((c=t[o])&&!(131072&c.__u)&&i==c.key&&a===c.type)return o;o--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&i==c.key&&a===c.type)return s;s++}}return-1}function T(e,t,n){t[0]===`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||u.test(t)?n:n+`px`}function E(e,t,n,r,i){var a;n: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||T(e.style,t,``);if(n)for(t in n)r&&n[t]===r[t]||T(e.style,t,n[t])}else if(t[0]===`o`&&t[1]===`n`)a=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[t+a]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,a?O:D,a)):e.removeEventListener(t,a?O:D,a);else{if(i)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 n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!==`-`?e.removeAttribute(t):e.setAttribute(t,n))}}function D(e){if(this.l){var n=this.l[e.type+!1];if(e.t){if(e.t<=n.u)return}else e.t=Date.now();return n(t.event?t.event(e):e)}}function O(e){if(this.l)return this.l[e.type+!0](t.event?t.event(e):e)}function k(e,n,r,i,a,o,s,c,l,u){var p,m,h,v,y,b,x,S,C,w,T,E,D,O,k,A=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(p=t.__b)&&p(n);n:if(typeof A==`function`)try{if(S=n.props,C=(p=A.contextType)&&i[p.__c],w=p?C?C.props.value:p.__:i,r.__c?x=(m=n.__c=r.__c).__=m.__E:(`prototype`in A&&A.prototype.render?n.__c=m=new A(S,w):(n.__c=m=new _(S,w),m.constructor=A,m.render=ie),C&&C.sub(m),m.props=S,m.state||={},m.context=w,m.__n=i,h=m.__d=!0,m.__h=[],m._sb=[]),m.__s??=m.state,A.getDerivedStateFromProps!=null&&(m.__s==m.state&&(m.__s=f({},m.__s)),f(m.__s,A.getDerivedStateFromProps(S,m.__s))),v=m.props,y=m.state,m.__v=n,h)A.getDerivedStateFromProps==null&&m.componentWillMount!=null&&m.componentWillMount(),m.componentDidMount!=null&&m.__h.push(m.componentDidMount);else{if(A.getDerivedStateFromProps==null&&S!==v&&m.componentWillReceiveProps!=null&&m.componentWillReceiveProps(S,w),!m.__e&&(m.shouldComponentUpdate!=null&&!1===m.shouldComponentUpdate(S,m.__s,w)||n.__v===r.__v)){for(n.__v!==r.__v&&(m.props=S,m.state=m.__s,m.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.forEach(function(e){e&&(e.__=n)}),T=0;T<m._sb.length;T++)m.__h.push(m._sb[T]);m._sb=[],m.__h.length&&s.push(m);break n}m.componentWillUpdate!=null&&m.componentWillUpdate(S,m.__s,w),m.componentDidUpdate!=null&&m.__h.push(function(){m.componentDidUpdate(v,y,b)})}if(m.context=w,m.props=S,m.__P=e,m.__e=!1,E=t.__r,D=0,`prototype`in A&&A.prototype.render){for(m.state=m.__s,m.__d=!1,E&&E(n),p=m.render(m.props,m.state,m.context),O=0;O<m._sb.length;O++)m.__h.push(m._sb[O]);m._sb=[]}else do m.__d=!1,E&&E(n),p=m.render(m.props,m.state,m.context),m.state=m.__s;while(m.__d&&++D<25);m.state=m.__s,m.getChildContext!=null&&(i=f(f({},i),m.getChildContext())),h||m.getSnapshotBeforeUpdate==null||(b=m.getSnapshotBeforeUpdate(v,y)),ee(e,d(k=p!=null&&p.type===g&&p.key==null?p.props.children:p)?k:[k],n,r,i,a,o,s,c,l,u),m.base=n.__e,n.__u&=-161,m.__h.length&&s.push(m),x&&(m.__E=m.__=null)}catch(e){n.__v=null,l||o!=null?(n.__e=c,n.__u|=l?160:32,o[o.indexOf(c)]=null):(n.__e=r.__e,n.__k=r.__k),t.__e(e,n,r)}else o==null&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=te(r.__e,n,r,i,a,o,s,l,u);(p=t.diffed)&&p(n)}function A(e,n,r){n.__d=void 0;for(var i=0;i<r.length;i++)ne(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function te(t,n,r,i,a,o,s,l,u){var f,m,h,g,_,y,b,x=r.props,S=n.props,C=n.type;if(C===`svg`&&(a=!0),o!=null){for(f=0;f<o.length;f++)if((_=o[f])&&`setAttribute`in _==!!C&&(C?_.localName===C:_.nodeType===3)){t=_,o[f]=null;break}}if(t==null){if(C===null)return document.createTextNode(S);t=a?document.createElementNS(`http://www.w3.org/2000/svg`,C):document.createElement(C,S.is&&S),o=null,l=!1}if(C===null)x===S||l&&t.data===S||(t.data=S);else{if(o&&=e.call(t.childNodes),x=r.props||c,!l&&o!=null)for(x={},f=0;f<t.attributes.length;f++)x[(_=t.attributes[f]).name]=_.value;for(f in x)_=x[f],f==`children`||(f==`dangerouslySetInnerHTML`?h=_:f===`key`||f in S||E(t,f,null,_,a));for(f in S)_=S[f],f==`children`?g=_:f==`dangerouslySetInnerHTML`?m=_:f==`value`?y=_:f==`checked`?b=_:f===`key`||l&&typeof _!=`function`||x[f]===_||E(t,f,_,x[f],a);if(m)l||h&&(m.__html===h.__html||m.__html===t.innerHTML)||(t.innerHTML=m.__html),n.__k=[];else if(h&&(t.innerHTML=``),ee(t,d(g)?g:[g],n,r,i,a&&C!==`foreignObject`,o,s,o?o[0]:r.__k&&v(r,0),l,u),o!=null)for(f=o.length;f--;)o[f]!=null&&p(o[f]);l||(f=`value`,y!==void 0&&(y!==t[f]||C===`progress`&&!y||C===`option`&&y!==x[f])&&E(t,f,y,x[f],!1),f=`checked`,b!==void 0&&b!==t[f]&&E(t,f,b,x[f],!1))}return t}function ne(e,n,r){try{typeof e==`function`?e(n):e.current=n}catch(e){t.__e(e,r)}}function re(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||ne(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&re(i[a],n,r||typeof e.type!=`function`);r||e.__e==null||p(e.__e),e.__=e.__e=e.__d=void 0}function ie(e,t,n){return this.constructor(e,n)}function ae(n,r,i){var a,o,s,l;t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],l=[],k(r,n=(!a&&i||r).__k=m(g,null,[n]),o||c,c,r.ownerSVGElement!==void 0,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,l),A(s,n,l)}function j(e,t){var n={__c:t=`__cC`+ s++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(function(e){e.__e=!0,b(e)})},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}e=l.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,_.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=f({},this.state);typeof e==`function`&&(e=e(f({},n),this.props)),e&&f(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),b(this))},_.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),b(this))},_.prototype.render=g,r=[],a=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=function(e,t){return e.__v.__b-t.__v.__b},x.__r=0,s=0;var M,N,oe,se,ce=0,le=[],P=[],F=t,ue=F.__b,de=F.__r,fe=F.diffed,pe=F.__c,me=F.unmount,he=F.__;function ge(e,t){F.__h&&F.__h(N,e,ce||t),ce=0;var n=N.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({__V:P}),n.__[e]}function I(e){return ce=1,_e(we,e)}function _e(e,t,n){var r=ge(M++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):we(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=N,!N.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=!1;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),!(!o&&r.__c.props===e)&&(!a||a.call(this,e,t,n))};N.u=!0;var a=N.shouldComponentUpdate,o=N.componentWillUpdate;N.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},N.shouldComponentUpdate=i}return r.__N||r.__}function L(e,t){var n=ge(M++,3);!F.__s&&Ce(n.__H,t)&&(n.__=e,n.i=t,N.__H.__h.push(n))}function ve(e){var t=N.context[e.__c],n=ge(M++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(N)),t.props.value):e.__}function ye(){for(var e;e=le.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(R),e.__H.__h.forEach(Se),e.__H.__h=[]}catch(t){e.__H.__h=[],F.__e(t,e.__v)}}F.__b=function(e){N=null,ue&&ue(e)},F.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),he&&he(e,t)},F.__r=function(e){de&&de(e),M=0;var t=(N=e.__c).__H;t&&(oe===N?(t.__h=[],N.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=P,e.__N=e.i=void 0})):(t.__h.forEach(R),t.__h.forEach(Se),t.__h=[],M=0)),oe=N},F.diffed=function(e){fe&&fe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(le.push(t)!==1&&se===F.requestAnimationFrame||((se=F.requestAnimationFrame)||xe)(ye)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==P&&(e.__=e.__V),e.i=void 0,e.__V=P})),oe=N=null},F.__c=function(e,t){t.some(function(e){try{e.__h.forEach(R),e.__h=e.__h.filter(function(e){return!e.__||Se(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],F.__e(n,e.__v)}}),pe&&pe(e,t)},F.unmount=function(e){me&&me(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{R(e)}catch(e){t=e}}),n.__H=void 0,t&&F.__e(t,n.__v))};var be=typeof requestAnimationFrame==`function`;function xe(e){var t,n=function(){clearTimeout(r),be&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);be&&(t=requestAnimationFrame(n))}function R(e){var t=N,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),N=t}function Se(e){var t=N;e.__c=e.__(),N=t}function Ce(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function we(e,t){return typeof t==`function`?t(e):t}var Te=j({}),Ee=e=>Te=j({...e}),De=()=>ve(Te),Oe=()=>{Ee({})},ke=async(e,t,n,r)=>{let i=new Headers;i.append(`Content-Type`,`application/x-www-form-urlencoded`);let a,o=new URLSearchParams;o.append(`grant_type`,`authorization_code`),o.append(`code`,t),o.append(`client_id`,n),o.append(`redirect_uri`,r);let s=await fetch(`${e}/connect/token`,{method:`POST`,headers:i,body:o});return s.ok&&(a=await s.json()),a},Ae=(e,t)=>{if(e)return{accessToken:e.access_token,promotionId:t,isLoggedIn:!!e.access_token,expiresIn:e.expires_in}},je=e=>new URLSearchParams(window.location.search).get(e)??void 0,Me=async e=>{let t=je(`code`),n=je(`state`),r=`${window.location.origin}/promoted-benefits/app/v1.0/`;if(!(!e.identityUrl||!e.clientId||!t))return Ae(await ke(e.identityUrl,t,e.clientId,r),n)},Ne=j({}),Pe=e=>Ne=j({...e}),Fe=()=>ve(Ne),Ie=async()=>{let e,t=await fetch(`${window.location.origin}/promoted-benefits/app/v1.0/config.json`);return t.ok&&(e=await t.json()),e},Le=0;Array.isArray;function z(e,n,r,i,a,o){var s,c,l={};for(c in n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Le,__i:-1,__u:0,__source:a,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return t.vnode&&t.vnode(u),u}for(var Re=({path:e,children:t,className:n,onClick:r})=>e?z(`a`,{href:e,className:n,onClick:r,target:`_blank`,rel:`noreferrer`,children:t}):z(`button`,{type:`button`,className:n,onClick:r,children:t}),ze=({banner:e,path:t,onClick:n})=>z(`div`,{"data-testid":`banner`,children:z(Re,{className:`font-['Inter'] bg-white grid grid-cols-12 overflow-hidden text-left card:hidden`,path:t,onClick:n,children:[z(`div`,{className:`col-span-8 xl:col-span-10 lg:col-span-8 grid gap-1 my-auto items-start p-4`,children:[z(`h1`,{className:`text-[#20303C] text-xs md:text-sm font-bold leading-4`,children:e.title}),z(`p`,{className:`text-[#4D5963] text-[0.6875rem] leading-4 md:text-xs font-medium md:leading-5`,children:[e.description,z(`span`,{className:`sm:block sm:pl-0 sm:pt-1 pl-1 pt-0 font-bold text-[#116DFF] whitespace-nowrap `,children:[z(`span`,{className:`underline underline-offset-2`,children:e.buttonText}),z(`span`,{className:`no-underline`,children:` -->`})]})]})]}),z(`div`,{className:`p-0 col-span-4 xl:col-span-2 lg:col-span-4 grid h-full auto-cols-max ml-auto justify-self-start overflow-hidden`,children:z(`img`,{className:`w-52 h-full max-h-44 object-cover`,src:e.imageUrl})})]})}),Be=`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`,Ve=({card:e,path:t,onClick:n})=>z(`div`,{"data-testid":`card`,className:`px-8 pt-6 pb-4 bg-white rounded-lg flex-col justify-start items-center gap-5 hidden card:inline-flex`,children:[z(`div`,{children:z(`img`,{className:`relative bg-white block max-h-[15.5625rem] max-w-[100%] h-auto`,src:e.imageUrl})}),z(`div`,{className:`flex-col justify-start items-center gap-7 flex`,children:[z(`div`,{className:`flex-col justify-start items-start gap-4 flex`,children:z(`div`,{className:`self-stretch flex-col justify-start items-start gap-2 flex`,children:[z(`div`,{className:`self-stretch text-[#143057] text-2xl font-bold font-['Inter'] leading-7`,children:e.title}),z(`div`,{className:`self-stretch text-gray-900 text-base font-normal font-['Inter'] leading-normal`,children:e.description})]})}),z(Re,{className:`self-stretch p-4 justify-center items-center bg-[#2e66f7] hover:bg-[#286090] rounded-md text-white text-base font-semibold font-['Inter'] leading-normal flex gap-2`,path:t,onClick:n,children:[e.buttonText,z(`img`,{className:`self-center`,src:Be,alt:``})]})]})]}),B={id:`fallback-econnex-energy`,banner:{title:`Paying too much for energy?`,description:`Compare plans in just a few minutes with Flare Benefits & Econnex, and you could save when you switch to a better deal.`,buttonText:`Learn more`,imageUrl:`./images/flare-energy-banner.png`},card:{title:`Paying too much for energy?`,description:`Compare plans in just a few minutes with Flare Benefits & Econnex, and you could save when you switch to a better deal.`,buttonText:`Learn more`,imageUrl:`./images/flare-energy-card.png`},action:{type:`Public`,path:`https://econnex.com.au/?rc=862160&utm_source=promoted_benefits&utm_medium=fallback&utm_campaign=energy_alwayson&utm_content=energy_intialoffer`}},He=async(e,t,n)=>{if(!e||!t)return V();let r;switch(n){case`fallback`:return V();case void 0:r=`${e}/promoted-benefits/backend/v1.0/promotion`;break;default:r=`${e}/promoted-benefits/backend/v1.0/promotion/${n}`;break}let i=await fetch(`${r}`,{headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":`1.0.1004`}});if(i.status===204)return V();let a;if(i.ok)try{a=await i.json()}catch(e){return console.error(`Error parsing promotion response: ${e}`),V()}return!a||Object.keys(a).length===0?V():a},V=()=>({action:B.action,banner:B.banner,card:B.card,id:B.id}),Ue=e=>{let t=sessionStorage.getItem(e);return t?JSON.parse(t):void 0},We=(e,t)=>{sessionStorage.setItem(e,JSON.stringify(t))},H=[],Ge=0;Ge<256;++Ge)H.push((Ge+256).toString(16).slice(1));function Ke(e,t=0){return(H[e[t+0]]+H[e[t+1]]+H[e[t+2]]+H[e[t+3]]+`-`+H[e[t+4]]+H[e[t+5]]+`-`+H[e[t+6]]+H[e[t+7]]+`-`+H[e[t+8]]+H[e[t+9]]+`-`+H[e[t+10]]+H[e[t+11]]+H[e[t+12]]+H[e[t+13]]+H[e[t+14]]+H[e[t+15]]).toLowerCase()}var U,qe=new Uint8Array(16);function Je(){if(!U&&(U=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!U))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return U(qe)}var Ye={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Xe(e,t,n){if(Ye.randomUUID&&!t&&!e)return Ye.randomUUID();e||={};var r=e.random||(e.rng||Je)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n||=0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return Ke(r)}var Ze=()=>{let e=Ue(`distinctId`);if(!e){let e=Xe();return We(`distinctId`,e),e}return e},W=()=>({sourceUrl:document.referrer,clientAppVersion:`1.0.1004`}),Qe=async e=>{e&&tt(e,{eventName:`appLoaded`,distinctId:Ze(),session:W()})},$e=async(e,t,n)=>{if(!e)return;if(!t)return tt(e,{eventName:`promotionViewed`,promotionId:n,distinctId:Ze(),session:W()});let r=`${e}/promoted-benefits/backend`;await fetch(`${r}/v1.0/promotion/${n}/view`,{method:`POST`,body:JSON.stringify({session:W()}),headers:{Authorization:`Bearer ${t}`}})},et=async(e,t,n)=>{if(!e)return;if(!t)return tt(e,{eventName:`promotionActioned`,promotionId:n?.id,actionUrl:n?.action?.path,distinctId:Ze(),session:W()});let r=`${e}/promoted-benefits/backend`;await fetch(`${r}/v1.0/promotion/${n?.id}/action`,{method:`POST`,body:JSON.stringify({...n?.action,session:W()}),headers:{Authorization:`Bearer ${t}`}})},tt=async(e,t)=>{let n=`${e}/promoted-benefits/public`;await fetch(`${n}/v1.0/track`,{method:`POST`,body:JSON.stringify({...t,session:W()})})},nt=async(e,t)=>{let n,r=await fetch(e,{method:`GET`,headers:{Authorization:`Bearer ${t}`,"Content-Type":`application/json`}});return r.ok&&(n=await r.json()),n},rt=(e,t,n,r)=>`${e}/app/?token=${t}&redirectPath=${n}&referrer=${document.referrer}&promotionId=${r}`,it=async(e,t,n,r)=>{let i=`${e?.apolloBaseUrl}/benefits`;if(!i||!n||!t||!r)return;let a=await nt(`${i}/backend/v1.0/current/token`,t);if(!(!a||!a.token))return rt(i,a.token,n,r)},at=async(e,t,n)=>{let r;switch(e.action.type.toLowerCase()){case`benefits`:return r=await it(t,n.accessToken,e.action.path,e.id),{path:void 0,onClick:()=>{let e=window.open();e&&r&&(e.location=r)}};case`public`:return{path:e.action.path,onClick:void 0};default:return}},ot=()=>{let e=De(),t=Fe(),[n,r]=I(),[i,a]=I();L(()=>{(async()=>{let n=await He(t?.apolloBaseUrl,e?.accessToken,e?.promotionId);r(n),$e(t.apolloBaseUrl,e.accessToken,n?.id)})()},[t.apolloBaseUrl,e.accessToken]),L(()=>{if(e&&e.expiresIn){let t=1e3*e.expiresIn,n=setTimeout(()=>{r(V()),Oe()},t);return()=>clearTimeout(n)}},[n,e]),L(()=>{(async()=>{n&&a(await at(n,t,e))})()},[t,e,n]);let o=()=>{i?.onClick&&i?.onClick(),et(t.apolloBaseUrl,e.accessToken,n)};return n?z(g,{children:[z(ze,{banner:n.banner,path:i?.path,onClick:o}),z(Ve,{card:n.card,path:i?.path,onClick:o})]}):z(g,{})},G=[],st=function(){return G.some(function(e){return e.activeTargets.length>0})},ct=function(){return G.some(function(e){return e.skippedTargets.length>0})},lt=`ResizeObserver loop completed with undelivered notifications.`,ut=function(){var e;typeof ErrorEvent==`function`?e=new ErrorEvent(`error`,{message:lt}):(e=document.createEvent(`Event`),e.initEvent(`error`,!1,!1),e.message=lt),window.dispatchEvent(e)},K;(function(e){e.BORDER_BOX=`border-box`,e.CONTENT_BOX=`content-box`,e.DEVICE_PIXEL_CONTENT_BOX=`device-pixel-content-box`})(K||={});var q=function(e){return Object.freeze(e)},dt=function(){function e(e,t){this.inlineSize=e,this.blockSize=t,q(this)}return e}(),ft=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,q(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),pt=function(e){return e instanceof SVGElement&&`getBBox`in e},mt=function(e){if(pt(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,a=i.offsetWidth,o=i.offsetHeight;return!(a||o||e.getClientRects().length)},ht=function(e){if(e instanceof Element)return!0;var t=e?.ownerDocument?.defaultView;return!!(t&&e instanceof t.Element)},gt=function(e){switch(e.tagName){case`INPUT`:if(e.type!==`image`)break;case`VIDEO`:case`AUDIO`:case`EMBED`:case`OBJECT`:case`CANVAS`:case`IFRAME`:case`IMG`:return!0}return!1},J=typeof window<`u`?window:{},Y=new WeakMap,_t=/auto|scroll/,vt=/^tb|vertical/,yt=/msie|trident/i.test(J.navigator&&J.navigator.userAgent),X=function(e){return parseFloat(e||`0`)},Z=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new dt((n?t:e)||0,(n?e:t)||0)},bt=q({devicePixelContentBoxSize:Z(),borderBoxSize:Z(),contentBoxSize:Z(),contentRect:new ft(0,0,0,0)}),xt=function(e,t){if(t===void 0&&(t=!1),Y.has(e)&&!t)return Y.get(e);if(mt(e))return Y.set(e,bt),bt;var n=getComputedStyle(e),r=pt(e)&&e.ownerSVGElement&&e.getBBox(),i=!yt&&n.boxSizing===`border-box`,a=vt.test(n.writingMode||``),o=!r&&_t.test(n.overflowY||``),s=!r&&_t.test(n.overflowX||``),c=r?0:X(n.paddingTop),l=r?0:X(n.paddingRight),u=r?0:X(n.paddingBottom),d=r?0:X(n.paddingLeft),f=r?0:X(n.borderTopWidth),p=r?0:X(n.borderRightWidth),m=r?0:X(n.borderBottomWidth),h=r?0:X(n.borderLeftWidth),g=d+l,_=c+u,v=h+p,y=f+m,b=s?e.offsetHeight-y-e.clientHeight:0,x=o?e.offsetWidth-v-e.clientWidth:0,ee=i?g+v:0,S=i?_+y:0,C=r?r.width:X(n.width)-ee-x,w=r?r.height:X(n.height)-S-b,T=C+g+x+v,E=w+_+b+y,D=q({devicePixelContentBoxSize:Z(Math.round(C*devicePixelRatio),Math.round(w*devicePixelRatio),a),borderBoxSize:Z(T,E,a),contentBoxSize:Z(C,w,a),contentRect:new ft(d,c,C,w)});return Y.set(e,D),D},St=function(e,t,n){var r=xt(e,n),i=r.borderBoxSize,a=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(t){case K.DEVICE_PIXEL_CONTENT_BOX:return o;case K.BORDER_BOX:return i;default:return a}},Ct=function(){function e(e){var t=xt(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=q([t.borderBoxSize]),this.contentBoxSize=q([t.contentBoxSize]),this.devicePixelContentBoxSize=q([t.devicePixelContentBoxSize])}return e}(),wt=function(e){if(mt(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Tt=function(){var e=1/0,t=[];G.forEach(function(n){if(n.activeTargets.length!==0){var r=[];n.activeTargets.forEach(function(t){var n=new Ct(t.target),i=wt(t.target);r.push(n),t.lastReportedSize=St(t.target,t.observedBox),i<e&&(e=i)}),t.push(function(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var i=r[n];i()}return e},Et=function(e){G.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(wt(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},Dt=function(){var e=0;for(Et(e);st();)e=Tt(),Et(e);return ct()&&ut(),e>0},Ot,kt=[],At=function(){return kt.splice(0).forEach(function(e){return e()})},jt=function(e){if(!Ot){var t=0,n=document.createTextNode(``);new MutationObserver(function(){return At()}).observe(n,{characterData:!0}),Ot=function(){n.textContent=`${t?t--:t++}`}}kt.push(e),Ot()},Mt=function(e){jt(function(){requestAnimationFrame(e)})},Q=0,Nt=function(){return!!Q},Pt=250,Ft={attributes:!0,characterData:!0,childList:!0,subtree:!0},It=[`resize`,`load`,`transitionend`,`animationend`,`animationstart`,`animationiteration`,`keyup`,`keydown`,`mouseup`,`mousedown`,`mouseover`,`mouseout`,`blur`,`focus`],Lt=function(e){return e===void 0&&(e=0),Date.now()+e},Rt=!1,zt=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(e===void 0&&(e=Pt),!Rt){Rt=!0;var n=Lt(e);Mt(function(){var r=!1;try{r=Dt()}finally{if(Rt=!1,e=n-Lt(),!Nt())return;r?t.run(1e3):e>0?t.run(e):t.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Ft)};document.body?t():J.addEventListener(`DOMContentLoaded`,t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),It.forEach(function(t){return J.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||=(this.observer&&this.observer.disconnect(),It.forEach(function(t){return J.removeEventListener(t,e.listener,!0)}),!0)},e}()),Bt=function(e){!Q&&e>0&&zt.start(),Q+=e,!Q&&zt.stop()},Vt=function(e){return!pt(e)&&!gt(e)&&getComputedStyle(e).display===`inline`},Ht=function(){function e(e,t){this.target=e,this.observedBox=t||K.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=St(this.target,this.observedBox,!0);return Vt(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),Ut=function(){function e(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}return e}(),$=new WeakMap,Wt=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Gt=function(){function e(){}return e.connect=function(e,t){var n=new Ut(e,t);$.set(e,n)},e.observe=function(e,t,n){var r=$.get(e),i=r.observationTargets.length===0;Wt(r.observationTargets,t)<0&&(i&&G.push(r),r.observationTargets.push(new Ht(t,n&&n.box)),Bt(1),zt.schedule())},e.unobserve=function(e,t){var n=$.get(e),r=Wt(n.observationTargets,t),i=n.observationTargets.length===1;r>=0&&(i&&G.splice(G.indexOf(n),1),n.observationTargets.splice(r,1),Bt(-1))},e.disconnect=function(e){var t=this,n=$.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),Kt=function(){function e(e){if(arguments.length===0)throw TypeError(`Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.`);if(typeof e!=`function`)throw TypeError(`Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.`);Gt.connect(this,e)}return e.prototype.observe=function(e,t){if(arguments.length===0)throw TypeError(`Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.`);if(!ht(e))throw TypeError(`Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element`);Gt.observe(this,e,t)},e.prototype.unobserve=function(e){if(arguments.length===0)throw TypeError(`Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.`);if(!ht(e))throw TypeError(`Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element`);Gt.unobserve(this,e)},e.prototype.disconnect=function(){Gt.disconnect(this)},e.toString=function(){return`function ResizeObserver () { [polyfill code] }`},e}(),qt=e=>{if(e){let t=1e3*e,n={sender:`flare`,type:`promotionsSessionExpired`};setTimeout(()=>{window.parent.postMessage(n,`*`)},t)}},Jt=(e,t)=>{if(e&&t){let n=1e3*e,r={expiry:t,sender:`flare`,type:`promotionsSessionExpiring`};setTimeout(()=>{window.parent.postMessage(r,`*`)},n-3e5)}},Yt=()=>{let e={height:Math.min(document.body.offsetHeight,220),sender:`flare`,type:`contentResized`};window.parent.postMessage(e,`*`)},Xt=()=>{new Kt(()=>{Yt()}).observe(document.body)},Zt=e=>{try{let t=e.split(`.`)[1].replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t);return JSON.parse(n)}catch{return}};ae(z(()=>{let[e,t]=I({}),[n,r]=I(),[i,a]=I(!1);return Ee(e),L(()=>{(async()=>{let e=await Ie();e&&(Pe(e),r(e))})()},[]),L(()=>{(async()=>{if(!i&&n){Qe(n.apolloBaseUrl);let e=await Me(n);e&&t(e),a(!0)}})()},[n,i]),L(()=>{if(e.expiresIn&&e.accessToken){let t=Zt(e.accessToken);qt(e.expiresIn),Jt(e.expiresIn,t?.exp)}},[e]),L(()=>{Xt()},[]),i?z(`div`,{className:`flex items-center justify-center min-h-[100px]`,children:z(ot,{})}):z(g,{})},{}),document.body);
package/dist/index.html CHANGED
@@ -9,12 +9,12 @@
9
9
  margin: 0;
10
10
  }
11
11
  </style>
12
- <script type="module" crossorigin src="/promoted-benefits/app/v1.0/assets/index-BqTK7FvB.js"></script>
12
+ <script type="module" crossorigin src="/promoted-benefits/app/v1.0/assets/index-CNB-V4tc.js"></script>
13
13
  <link rel="stylesheet" crossorigin href="/promoted-benefits/app/v1.0/assets/index-BKQX8kED.css">
14
14
  </head>
15
15
  <body>
16
16
  <script>
17
- const appVersion = "1.0.1003";
17
+ const appVersion = "1.0.1004";
18
18
  const getSanitizedEnv = () => window.location.hostname.toLocaleLowerCase().replace(/[^.a-z]/, '');
19
19
  const getAppVersion = () => appVersion.toLocaleLowerCase().replace(/[^0-9a-z.]/, '');
20
20
  (function(h,o,u,n,d) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flarehr/promoted-benefits-ui",
3
- "version": "1.0.1003",
3
+ "version": "1.0.1004",
4
4
  "description": "Flare Promoted Benefits",
5
5
  "license": "MIT",
6
6
  "files": [