/*!
* Genesys Predictive Engagement v2.1483.0
* Copyright (c) 2014-2024 Genesys Cloud Services, Inc. All rights reserved.
*
* https://developer.genesys.cloud/commdigital/digital/webmessaging/messengersdk/
*/(()=>{var e={306:e=>{e.exports='
\n \n \n
\n'}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e;!function(e){e.Command="command",e.RegisterPlugin="registerPlugin"}(e||(e={}));var t,i,o,r,s,a=n(306),l=n.n(a);class c{static parse(e){if(!c.isDomParserSupported())return null;return(new DOMParser).parseFromString(e,"text/html").body.firstChild}static isDomParserSupported(){if(!window.DOMParser)return!1;const e=new DOMParser;try{e.parseFromString("x","text/html")}catch(e){return!1}return!0}}function d(){const e=window.document.getElementsByTagName("link"),t=[];for(let n=0;n"print"!==e.media.mediaText)).map((t=>{try{return Array.from(t.cssRules).filter((e=>/^\s*@font-face/.test(e.cssText))).map((e=>function(e,t){let n;return n=t?t.substring(0,t.lastIndexOf("/")+1):window.location.href.endsWith("/")?window.location.href:window.location.href.substring(0,window.location.href.lastIndexOf("/")+1),e.replace(/url\(['"]*(.*?)['"]*\)/gm,((e,t)=>t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//")?e:0===t.indexOf("/")?`url("${window.location.origin}${t}")`:`url("${n}${t}")`))}(e.cssText,t.href||""))).join(" ")}catch(n){return n instanceof DOMException&&t.href&&e.push(t.href),""}})).filter((e=>!!e));return{externalStyleSheets:e,fontFaceCssRules:t}}!function(e){e.Overlay="Overlay",e.Modal="Modal",e.Toast="Toast"}(t||(t={})),function(e){e.TextOnly="TextOnly",e.ImageOnly="ImageOnly",e.LeftText="LeftText",e.RightText="RightText",e.TopText="TopText",e.BottomText="BottomText"}(i||(i={})),function(e){e.Blank="Blank",e.Self="Self"}(o||(o={})),function(e){e.Top="top",e.Bottom="bottom",e.Left="left",e.Right="right"}(r||(r={})),function(e){e.Percent="%",e.Pixel="px"}(s||(s={}));t.Modal,t.Overlay;function u(){return e=navigator.userAgent,(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.substr(0,4))||/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e))&&function(){const e=document.getElementById("small-screen-indicator");if(window.getComputedStyle&&e)return"block"===window.getComputedStyle(e).display;return!0}();var e}var m,h,p=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class g{constructor(e,t,n,i){this.log=e,this.offers=t,this.cxData=n,this.cxCommandName="open",this.IFRAME_LOADED="iFrameLoaded",this.OFFER_IFRAME_ID="genesys-co-frame",this.MESSENGER_IFRAME_ID="genesys-mxg-frame",this.DEFAULT_OFFER_STYLING={body:{color:"#fdfdfd",font:"inherit",fontSize:"8pt",textAlign:"Center"},headline:{color:"#fdfdfd",font:"inherit",fontSize:"14pt",textAlign:"Center"},title:{color:"#fdfdfd",font:"inherit",fontSize:"18pt",textAlign:"Center"},ctaButton:{color:"#fdfdfd",font:"inherit",fontSize:"12pt",textAlign:"Center",backgroundColor:"#5081e1"},closeButton:{color:"#8c8c8c",opacity:1},offer:{backgroundColor:"#33383d",padding:"0px"},position:{}},this.iFrameLoaded=!1,this.offersReady=!1,this.iFrameHtml=l().replace("{url}",`${i}/journey/messenger-plugins/offers.html`),this.cxData(this.IFRAME_LOADED,!1)}process({data:e,resolve:n,reject:i}){var o,r;return p(this,void 0,void 0,(function*(){this.log("process()",e);try{if(!this.iFrameLoaded){const e=c.parse(this.iFrameHtml);e&&(document.body.appendChild(e),this.iFrameLoaded=!0,this.cxData(this.IFRAME_LOADED,!0))}this.offersReady||(yield this.offers.ready(),this.offersReady=!0,yield this.initOffers());const i=this.parse(e);yield this.openOffer(i),(null===(o=e.contentOfferProperties)||void 0===o?void 0:o.displayMode)===t.Modal&&(null===(r=document.getElementById(this.OFFER_IFRAME_ID))||void 0===r||r.focus()),n&&n()}catch(e){i?i(`Error in OffersHelperOpen command: ${e}.`):this.log.error({error:e})}}))}parse(e){const{contentOfferProperties:t,journeyContext:n}=e;if(!t||!n)throw new Error('OffersHelper Open command requires "contentOfferProperties" and "journeyContext" to be set correctly.');const{errors:i,validContentOfferProperties:o}=this.validateContentOfferProperties(t);if(i.length)throw new Error(`Invalid "contentOfferProperties": ${i.join(", ")}.`);return{contentOfferProperties:o,journeyContext:n}}validateContentOfferProperties(e){const n=[];Object.values(i).includes(e.layoutMode)||n.push(`invalid "layoutMode" value (allowed values: ${Object.values(i).join(", ")})`),Object.values(t).includes(e.displayMode)||n.push('invalid "displayMode" value (allowed values: Modal, Overlay)'),e.callToAction?(e.callToAction.url||n.push('required property "callToAction.url" missing'),Object.values(o).includes(e.callToAction.target)||n.push(`invalid "callToAction.target" value (allowed values: ${Object.values(o).join(", ")})`)):n.push('required property "callToAction" missing');return{errors:n,validContentOfferProperties:{layoutMode:e.layoutMode,displayMode:e.displayMode,callToAction:e.callToAction,style:e.style||this.DEFAULT_OFFER_STYLING,body:e.body,headline:e.headline,title:e.title,imageUrl:e.imageUrl}}}initOffers(){return p(this,void 0,void 0,(function*(){yield this.offers.init(Object.assign({bodyFont:window.getComputedStyle(window.document.body).fontFamily,fontResourceLinks:d()},f()))}))}openOffer(e){var n;return p(this,void 0,void 0,(function*(){try{const i=yield this.offers.open(e);this.setPosition(i),(null===(n=e.contentOfferProperties)||void 0===n?void 0:n.displayMode)!==t.Overlay||u()||this.reposition(i)}catch(e){this.log.error("error retrieving position data")}}))}setPosition(e){const{overlay:t={},frame:n={}}=e,i=document.getElementById(this.OFFER_IFRAME_ID);if(i&&i.parentElement){const e=i.parentElement;Object.values(C).forEach((o=>{t[o]&&Object.assign(e.style,{[o]:t[o]}),void 0!==n[o]&&Object.assign(i.style,{[o]:n[o]})}))}}detectMessengerBubble(){const e=document.getElementById(this.MESSENGER_IFRAME_ID);if(!e)return{};const{x:t,width:n,height:i}=e.getBoundingClientRect();return 0===n||0===i?{}:t<110?{left:110}:{right:110}}reposition(e){var t;const n=null===(t=document.getElementById(this.OFFER_IFRAME_ID))||void 0===t?void 0:t.parentElement,{top:i,bottom:o,left:r,right:s}=e.overlay;if((!i||"unset"===i)&&n&&o&&"unset"!==o){const e=this.detectMessengerBubble();if(s&&"unset"!==s){const t=parseInt(s,10);n.style.right=`${Math.max(t,e.right||0)}px`}else if(r&&"unset"!==r){const t=parseInt(r,10);n.style.left=`${Math.max(t,e.left||0)}px`}}}}class y{constructor(e){this.plugin=e}}!function(e){e.Init="Offers.init",e.Open="Offers.open"}(m||(m={})),function(e){e.Ready="Offers.ready"}(h||(h={}));class v extends y{init(e){return this.plugin.command(m.Init,e)}open(e){return this.plugin.command(m.Open,e)}ready(){return new Promise((e=>this.plugin.subscribe(h.Ready,(()=>e(!0)))))}}var w=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class b{constructor(e){this.log=e,this.cxCommandName="close"}process({resolve:e,reject:t}){return w(this,void 0,void 0,(function*(){this.log(this.cxCommandName,"process()");try{const t=document.getElementById("genesys-co-frame");if(t){const e=t.parentElement;e&&(Object.values(C).forEach((n=>{Object.assign(e.style,{[n]:"unset"}),Object.assign(t.style,{[n]:"unset"})})),e.style.width="0",e.style.height="0"),t.style.width="0",t.style.height="0"}e&&e()}catch(e){t?t(`Error in OffersHelperClose command: ${e}.`):this.log.error({error:e})}}))}}Error;var O;!function(e){e.WebMessagingOffer="webMessagingOffer",e.ContentOffer="contentOffer",e.OpenAction="openAction"}(O||(O={}));var x;!function(e){e.Qualified="qualified",e.Offered="offered",e.Accepted="accepted",e.Rejected="rejected",e.Errored="errored",e.Ignored="ignored",e.Started="started",e.Engaged="engaged",e.Completed="completed",e.QualifiedOutsideSchedule="qualifiedOutsideSchedule",e.OfferedOutsideSchedule="offeredOutsideSchedule",e.FrequencyCapReached="frequencyCapReached",e.Timeout="timeout",e.Abandoned="abandoned"}(x||(x={}));var C,E,P=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};!function(e){e.Width="width",e.Height="height",e.Top="top",e.Bottom="bottom",e.Left="left",e.Right="right",e.Position="position",e.BackgroundColor="backgroundColor",e.ZIndex="zIndex",e.Transform="transform"}(C||(C={})),function(e){e.Qualified="qualified",e.Offered="offered",e.Accepted="accepted",e.Rejected="rejected",e.Errored="engaged",e.Ignored="ignored"}(E||(E={}));class A{constructor(e){this.cxPlugin=e,this.staticAssetsUrl="",this.logger=function(e,t){const n=(...n)=>t.log(`${e}:`,...n);return n.info=(...n)=>t.log.info(`${e}:`,...n),n.warn=(...n)=>t.log.warn(`${e}:`,...n),n.error=(...n)=>t.log.error(`${e}:`,...n),n}("offers-helper-plugin",this.cxPlugin),this.deploymentConfig=this.cxPlugin.data("GenesysJS.deploymentConfig"),this.offers=new v(e)}initialize(){return P(this,void 0,void 0,(function*(){const e=!!this.deploymentConfig.headlessMode&&this.deploymentConfig.headlessMode.enabled;yield this.setStaticAssetsUrl(),e||(this.registerOpenCommand(),this.registerCloseCommand(),this.initializeEventHandler(),this.publishReady())}))}setStaticAssetsUrl(){return P(this,void 0,void 0,(function*(){var e,t,n;yield(e="ServiceDiscovery",t=this.cxPlugin,n=()=>{this.staticAssetsUrl=`${this.cxPlugin.data("ServiceDiscovery.uris.staticAssets")}`},new Promise((i=>{t.subscribe(`${e}.ready`,(()=>{n&&"function"==typeof n&&n(),i(e)}))})))}))}getOpenCommand(){return this.openCommand||(this.openCommand=new g(this.logger,this.offers,this.cxPlugin.data,this.staticAssetsUrl)),this.openCommand}registerCommand(e,t){this.cxPlugin.registerCommand(e,(({data:e})=>t({data:e})))}registerOpenCommand(){const e=this.getOpenCommand();this.registerCommand(e.cxCommandName,e.process.bind(e))}registerCloseCommand(){const e=new b(this.logger);this.registerCommand(e.cxCommandName,e.process.bind(e))}initializeEventHandler(){this.cxPlugin.subscribe("Journey.qualifiedContentOffer",(({data:e})=>P(this,void 0,void 0,(function*(){yield this.getOpenCommand().process({data:e})}))))}publishReady(){this.cxPlugin.ready()}}Genesys("registerPlugin","OffersHelper",(e=>{new A(e).initialize()}))})()})();