1import{j as s,R as G,r as l,k as w,a as K}from"./main-aA_EcOIv.js";import{D as Q}from"./DataContainer-DrXYfX7k-chunk.js";import{I as V}from"./ImageX-mmFSw32D-chunk.js";import{I as W}from"./ImageArrowLeft-BcwSnCFc-chunk.js";import{D as Y}from"./Dropdown-V6PlTSQT-chunk.js";import{C as Z}from"./Checkbox-CKaWupMF-chunk.js";import{S as tt}from"./ScrollbarText-C6Q9lKcK-chunk.js";import{g as et}from"./getDecodedHtml-wzi1zZCi-chunk.js";import{s as u}from"./sanitizeHtml-B5Pv7teQ-chunk.js";import{D as st}from"./DDXModal-hUh5Cwhd-chunk.js";import"./pdfmake-BRJ3kdkn-chunk.js";import"./ImageArrow-CabRbub--chunk.js";import"./index-Z84vgtwv-chunk.js";import"./dom-DY8ID2eX-chunk.js";import"./purify.es-BElT3piG-chunk.js";const D=({color:t,onClick:o,content:r,className:b,disabled:c=!1})=>(c&&(t="gray"),s.jsx("button",{className:`interstitial-button text-label-xs-bold interstitial-button-color-${t||"default"} ${b??""}`,onClick:c?void 0:o,"aria-label":"interstitial button",disabled:c,dangerouslySetInnerHTML:{__html:et(r)}})),nt=({data:t})=>{const o=t.countryList?t.countryList.map(e=>(e.key=e.country,e.caption=e.country,e)):null,r=G.useRef(null),[b,c]=l.useState(""),[S,B]=l.useState(""),[p,k]=l.useState(t.countryList?null:t.acceptLabel?t.acceptLabel:null),[d,I]=l.useState(t.countryList?null:t.terms?t.terms:null),[C,T]=l.useState(t.countryList?null:t.termsLabel?t.termsLabel:null),[g,v]=l.useState(1),[f,_]=l.useState(!1),[E,A]=l.useState(!0),[x,M]=l.useState(!1),[h,i]=l.useState(!1),[m,N]=l.useState(!t.scrollToBottom),[H,R]=l.useState(t.countryList?null:t.termsLabel?t.termsLabel:null),$=()=>{A(!1)},z=e=>{e&&!h&&(R(e),c(e.key),B(e.abbreviation),i(!0),I(null),T(null),k(null),N(!t.scrollToBottom),M(!1),w(`${t.termsUrl}?modalId=${t.modalId}&country=${e.abbreviation}`).then(n=>n.json()).then(n=>{I(n.terms),k(n.acceptLabel),T(n.termsLabel),i(!1)}).catch(()=>{i(!1)}))},O=()=>{v(e=>e+1)},U=e=>{e.preventDefault(),v(n=>n-1)},X=()=>{if(!h){i(!0);const e={modalId:t.modalId,countryId:""};S&&(e.countryId=S),w(t.acceptUrl,{credentials:"same-origin",method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(n=>n.json()).then(n=>{n.redirectLink&&(window.location.href=n.redirectLink),i(!1)}).catch(()=>{i(!1)})}},F=({scrollHeight:e,clientHeight:n,scrollTop:P})=>{if(t.scrollToBottom){const q=e-n-20;!m&&P>=q&&N(!0)}},J=()=>{r.current&&x!==r.current.checked&&M(r.current.checked)};let a=null,L=null,y=null,j=null;if(o&&o.length>0&&(a=s.jsx(Y,{label:t.countryLabel,items:o,currentItem:H,onClose:z})),C&&(y=s.jsx(tt,{label:C,isMobile:f,content:d,onUpdateScroll:F})),p&&(j=s.jsxs("div",{className:"checkbox-container interstitial-checkbox",children:[s.jsx(Z,{id:"accept-terms",checked:x,onChange:J,ref:r,disabled:!!(o&&!m||d&&!m)}),s.jsx("label",{htmlFor:"accept-terms",className:"no-select",dangerouslySetInnerHTML:{__html:u(p)}})]})),f)switch(g){case 1:a&&(y=null,j=null,L=null);break;case 2:L=s.jsxs("button",{onClick:U,className:"interstitial-prev text-body-xs text-color-teal-600","aria-label":"back",children:[s.jsx(W,{}),s.jsx("span",{dangerouslySetInnerHTML:{__html:u(t.backToLabel)}})]}),a=null;break}return l.useEffect(()=>{const e=()=>{_(K())};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),s.jsx(st,{className:"interstitial-modal",handleCloseModal:()=>{},showModal:E,forceInlineModal:!0,children:s.jsxs("div",{className:"interstitial-modal-content",children:[s.jsxs("div",{className:"interstitial-header",children:[s.jsx("p",{className:"interstitial-header-title text-label-sm-bold text-color-white-0",dangerouslySetInnerHTML:{__html:u(t.title)}}),s.jsx("button",{className:"interstitial-header-close",onClick:$,"aria-label":"close",children:s.jsx(V,{})})]}),s.jsxs("div",{className:"interstitial-content",children:[s.jsx("p",{className:"interstitial-instruction text-body-sm",dangerouslySetInnerHTML:{__html:u(t.instruction)}}),a,L,y,j,s.jsx("div",{className:"interstitial-button-container",children:f&&a&&g===1?s.jsx(D,{onClick:O,content:t.mobileNextButton,color:"teal",disabled:!d}):s.jsx(D,{onClick:X,content:t.confirmButton,color:"teal",disabled:o&&!m||p&&!x||o&&!b||h})})]})]})})};class yt extends l.Component{render(){return s.jsx(Q,{data:"interstitialData",children:s.jsx(nt,{})})}}export{yt as default}; 2//# sourceMappingURL=Interstitial-BV8vgWKF-chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.