1import{a as v}from"/build/_shared/chunk-BM3QBHZU.js";import{c,d as m,e as B}from"/build/_shared/chunk-JSPWYSGG.js";import{a as A}from"/build/_shared/chunk-RZAQFZQG.js";import{T as D,U as T}from"/build/_shared/chunk-TQS5E2SK.js";import{v as I,w as x}from"/build/_shared/chunk-RBFCHJWR.js";import{a as k}from"/build/_shared/chunk-JUM7J4TY.js";import{a as M}from"/build/_shared/chunk-RW7BUM27.js";import{e as g}from"/build/_shared/chunk-ADMCF34Z.js";var l=g(k());var t=g(M()),E=({bonuses:n=[]})=>{let[p,s]=(0,l.useState)(!1),[i,r]=(0,l.useState)(!1),[e,o]=(0,l.useState)(void 0),u=x(),{isFtdJourneyEnabled:O}=I("root"),f=a=>{s(!0)},y=a=>{r(!0)},d=a=>{r(!1)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex flex-col",children:n.map((a,S)=>(0,t.jsx)(T,{bonus:a,openSvgSource:"/images/icon-collapse-plus.svg",closeSvgSource:"/images/icon-collapse-minus.svg",modalCloseSvgSource:"/images/close-icon.svg",className:"my-2",onTCClick:C=>{o(a),f(C)},onOptOutClick:C=>{o(a),y(C)},optOutText:"Opt Out"},S))}),(0,t.jsx)(D,{title:"Ts&Cs",isModalOpen:p,setIsModalOpen:s,closeSvgSource:"/images/close-icon.svg",modalClassName:"max-w-[480px]",children:e&&(0,t.jsx)("div",{children:e==null?void 0:e.termsAndConditions})}),!O||!(e!=null&&e.offerId)?(0,t.jsx)(v,{promoCode:e==null?void 0:e.promoCode,bonusId:e==null?void 0:e.bonusId,isOptOutModalVisible:i,setOptOutVisible:r,optOutClose:d,optOutHeader:"Confirmation",optOutText:"Are you sure you would like to opt out ?",optOutDeclineText:"No",optOutAcceptText:"Yes"}):(0,t.jsx)(A,{addConfirmaton:!0,optOutModalHeader:"Confirmation",optOutModalMainText:"Are you sure you would like to opt out ?",setIsModalOpen:r,isModalOpen:i,declineText:"No",acceptText:"Yes",fnAccept:()=>{u.submit({...e},{action:"/actions/ftd/optOutOffer",method:"DELETE"}),r(!1)}})]})},P=E;function L(n,p){let s=new Date(n.expiry.date),i=new Date(p.expiry.date);return s-i}var w=(n,p)=>{let s=p.map(e=>{var d,a;let o=!e.expiryDate||new Date(e.expiryDate)<new Date||e.status==="OptedOut"?"N/A":B(e.expiryDate),u=c(e==null?void 0:e.expiryDate),O=m(e==null?void 0:e.expiryDate),f=c(e.startDate),y=m(e.startDate);return{title:e.displayName,type:e.bonusType,status:e.status,ends:o,wageringRequirementsTarget:(d=e==null?void 0:e.wageringRequirementsTarget)==null?void 0:d.toString(),currentAccumulation:e.currentAccumulation,bonusAmount:e.targetWalletType=="FreeSpins"?"0":(a=e==null?void 0:e.bonusAmount)==null?void 0:a.toString(),activation:{date:c(e.activedDate),time:m(e.activedDate)},expiry:{date:u,time:O},start:{date:f,time:y},termsAndConditions:e.termsAndConditions,bonusId:e.bonusId,promoCode:e.promoCode,offerId:e.offerId,isLegacy:e.isLegacy}}),i={};[...n,...s].forEach(e=>{var o;i[(o=e==null?void 0:e.bonusId)!=null?o:0]=e});let r=Object.entries(i).map(([e,o])=>o);return r.sort(L),r},V=w;export{P as a,V as b};
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.