@flarehr/promoted-benefits-ui 1.0.789 → 1.0.791

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