1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6561],{51138:function(i,e,n){n.d(e,{a:function(){return s}});var l=n(51490),o=n(88767);let t=async(i,e,n)=>await e({url:"".concat(null==i?void 0:i.entityType,"/costing/").concat(null==i?void 0:i.itineraryId,"/pickup-time-options"),method:"GET",signal:n}),s=i=>{let e=(0,l.wh)(),{mutate:n,mutateAsync:s,...r}=(0,o.useMutation)(i=>t(i,e,void 0),i);return{UseGetActivityTimings:n,UseGetActivityTimingsAsync:s,...r}}},81042:function(i,e,n){n.d(e,{X:function(){return s}});var l=n(51490),o=n(88767);let t=async(i,e,n)=>await e({url:"offline/".concat(i.itineraryId,"/activity/").concat(i.configKey,"/").concat(i.slotIdentifier),method:"DELETE",signal:n}),s=i=>{let e=(0,l.wh)(),{mutate:n,mutateAsync:s,...r}=(0,o.useMutation)(i=>t(i,e,void 0),i);return{removeActivityCard:n,removeActivityCardAsync:s,...r}}},63729:function(i,e,n){n.d(e,{J:function(){return s}});var l=n(51490),o=n(88767);let t=async(i,e,n)=>await e({url:"itinerary/visa/modify",method:"POST",body:i,signal:n}),s=i=>{let e=(0,l.wh)(),{mutate:n,mutateAsync:s,...r}=(0,o.useMutation)(i=>t(i,e,void 0),i);return{getVisaData:n,getVisaAsync:s,...r}}},46574:function(i,e,n){var l=n(85893),o=n(5335),t=n(10206),s=n(39396),r=n(70024),d=n(25675),a=n.n(d),c=n(11163),u=n(67294),g=n(73935),h=n(44950),p=n(76907),x=n(68991),v=n(89155);let m=(0,o.zo)("div",{position:"fixed",top:0,right:0,bottom:0,left:0,backgroundColor:"rgba(0, 0, 0)",opacity:.7,zIndex:"99"}),f=i=>{let{passengerList:e,isBooked:n}=i,o=(0,c.useRouter)(),[d,f]=(0,u.useState)({top:0,left:0,width:0,height:0}),[y,$]=(0,u.useState)(!1),j=(0,u.useRef)(null),b=(0,r.Dv)(h.s1),C=()=>{var i;let e=null===(i=o.asPath)||void 0===i?void 0:i.split("?")[0].replace("inclusions","");o.push("/".concat(e,"/group-planning"))},k=()=>{let i={itineraryId:o.query.itineraryId,userId:null==b?void 0:b.userId,booked:n};(0,p.L9W)(p.zlA,i,b||void 0),e.length?$(i=>!i):C()};return(0,u.useEffect)(()=>(y?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[y]),(0,u.useEffect)(()=>{if(j.current){let i=j.current.getBoundingClientRect();f({top:i.top+window.scrollY,left:i.left+window.scrollX,width:i.width,height:i.height})}},[y]),(0,l.jsxs)(u.Fragment,{children:[y&&(0,g.createPortal)((0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m,{})," ",(0,l.jsx)(s.X2,{css:{zIndex:"$max",position:"absolute",pointerEvents:"auto",top:"".concat(d.top,"px"),left:"".concat(d.left,"px")},children:(0,l.jsx)(a(),{src:(0,x.Z)("https://oceanjar-new.s3.ap-south-1.amazonaws.com/images/web_app/group-planning-banner.svg"),alt:"Group planning banner",width:d.width,height:d.height})})]}),document.body),(0,l.jsxs)(t.J2.fC,{open:y,children:[(0,l.jsx)(t.J2.xz,{asChild:!0,children:(0,l.jsx)(s.X2,{ref:j,css:{cursor:"pointer",zIndex:"999999",position:"relative",pointerEvents:"auto"},onClick:k,children:(0,l.jsx)(a(),{src:(0,x.Z)("https://oceanjar-new.s3.ap-south-1.amazonaws.com/images/web_app/group-planning-banner.svg"),alt:"Group planning banner",width:100,height:80,style:{width:"100%",height:"100%"}})})}),(0,l.jsxs)(t.J2.VY,{onPointerDownOutside:i=>i.preventDefault(),hideArrow:!0,side:"left",align:"end",sideOffset:32,css:{width:"420px",position:"relative",minHeight:"260px",maxHeight:"500px",borderRadius:"$4",padding:0,zIndex:"$max","& > button":{display:"none"},"&:focus":{boxShadow:"none"}},children:[(0,l.jsx)(s.xu,{css:{position:"absolute",bottom:"11%",right:"-22px"},children:(0,l.jsx)(a(),{src:(0,x.Z)("https://oceanjar-new.s3.ap-south-1.amazonaws.com/images/curved-arrow.png"),width:22,height:43,alt:"curve-arrow"})}),(0,l.jsx)(v.Z,{passengerList:e,closeModal:()=>$(!1)})]})]})]})};e.Z=f},23294:function(i,e,n){n.d(e,{x:function(){return x}});var l=n(85893),o=n(5335),t=n(68315),s=n(39864),r=n(39396),d=n(25675),a=n.n(d),c=n(67294),u=n(99304),g=n(2261),h=n(68991);let p=(0,o.zo)(r.xu,{display:"flex","& .swiper-nav-elements":{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"$round",backgroundColor:"#FFF",width:"24px",height:"24px",color:"$black",fontWeight:"$extraBold",textAlign:"center",marginTop:0,cursor:"pointer","&:after":{fontSize:"14px"}},".swiper-nav-elements.swiper-button-disabled":{pointerEvents:"none",opacity:.4},"@hover":{"&:hover":{"& .swiper-nav-elements":{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"$round",backgroundColor:"#FFF",width:"24px",height:"24px",color:"$black",fontWeight:"$extraBold",textAlign:"center",marginTop:0,cursor:"pointer","&:after":{fontSize:"14px"}}}},"& .swiper-pagination-bullet":{backgroundColor:"$white",height:8,width:10,opacity:.8,borderRadius:"$pill"},"& .swiper-pagination-bullet-active":{width:20,height:8,opacity:2,borderRadius:"$pill",backgroundColor:"$white"},"& .swiper-slide > span":{width:"100% !important",height:"100% !important"},"& .mySwiper > .swiper-wrapper > .swiper-slide":{height:88,width:"144px !important",opacity:.8,borderRadius:"$3",overflow:"hidden"},"& .mySwiper > .swiper-wrapper > .swiper-slide-thumb-active":{opacity:1,border:"4px solid #FFC933",borderRadius:"$3",height:"96px"}}),x=i=>{let{imageList:e,showThumbs:n=!1,alt:o="string",borderleftradius:d=0,borderTopRightRadius:x=0,borderTopLeftRadius:v=0,borderBottomRightRadius:m=0,id:f="",showPagination:y=!0,loopMode:$=!0}=i,j=(0,c.useMemo)(()=>f.replace(/[^a-zA-Z-]/g,""),[f]);return n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(p,{children:(0,l.jsx)(r.X2,{css:{width:"100%",height:355,overflow:"hidden","@lg":{borderRadius:"$3"},"@smMax":{width:"calc(100% - 24px)",height:"260px",justifyContent:"center",alignItems:"center",margin:"auto"}},children:(0,l.jsx)(g.tq,{navigation:!0,loop:$,modules:[u.W_,u.Rv,...y?[u.tl]:[]],children:e.map((i,e)=>(0,l.jsx)(g.o5,{children:(0,l.jsx)(a(),{src:(0,h.Z)(i,"w=256&fit=crop")||"https://images.pickyourtrail.com/images/costing_screen/placeholder/desktop/hotels.png",alt:o,height:220,fill:!0})},e))})})}),(0,l.jsx)(p,{css:{width:"100%",marginTop:84},children:(0,l.jsx)(r.X2,{css:{width:"100%",height:96,borderRadius:"$3",overflow:"hidden"},align:"center",children:(0,l.jsx)(g.tq,{modules:[u.W_,u.Rv,...y?[u.tl]:[]],loop:$,navigation:!0,spaceBetween:24,slidesPerView:"auto",freeMode:!0,watchSlidesProgress:!0,className:"mySwiper",children:null==e?void 0:e.map((i,e)=>(0,l.jsx)(g.o5,{children:(0,l.jsx)(a(),{src:(0,h.Z)(i,"w=120&fit=crop")||"https://images.pickyourtrail.com/images/costing_screen/placeholder/desktop/hotels.png",alt:o,width:120,height:88})},e))})})})]}):(0,l.jsxs)(p,{css:{height:"100%",width:"100%",position:"relative"},children:[(0,l.jsx)(g.tq,{navigation:{prevEl:".swiper-nav-prev-".concat(j),nextEl:".swiper-nav-next-".concat(j),disabledClass:"swiper-button-disabled"},loop:$,pagination:{clickable:!0,dynamicBullets:!0},modules:[u.W_,u.Rv,...y?[u.tl]:[]],style:{width:"100%"},children:null==e?void 0:e.map((i,e)=>(0,l.jsx)(g.o5,{children:(0,l.jsx)(r.xu,{css:{position:"relative",overflow:"hidden",
1width:"100vw",height:"100%",borderTopLeftRadius:v,borderTopRightRadius:x,borderBottomLeftRadius:d,borderBottomRightRadius:m,zIndex:1,"@lg":{width:"auto"}},children:(0,l.jsx)(a(),{fill:!0,src:i,alt:o,style:{objectFit:"cover"}})})},e))}),(null==e?void 0:e.length)>1?(0,l.jsx)(r.xu,{className:"nav-arrow-wrapper",css:{width:"100%",position:"absolute",top:"50%",zIndex:2,justifyContent:"space-between",transform:"translateY(-50%)","@smMax":{display:"none"}},children:(0,l.jsxs)(r.xu,{css:{gap:"$4i",display:"flex",width:"100%",justifyContent:"space-between"},children:[(0,l.jsx)(r.xu,{className:"swiper-nav-elements swiper-nav-prev-".concat(j),onClick:i=>{i.stopPropagation()},css:{marginLeft:"16px","@lg":{marginLeft:"32px"}},children:(0,l.jsx)(t.Z,{height:16,width:16,display:"inline-block"})}),(0,l.jsx)(r.xu,{className:"swiper-nav-elements swiper-nav-next-".concat(j),onClick:i=>{i.stopPropagation()},css:{marginRight:"16px","@lg":{marginRight:"32px"}},children:(0,l.jsx)(s.Z,{height:16,width:16,display:"inline-block"})})]})}):null]})}},65717:function(i,e,n){var l=n(85893),o=n(4327),t=n(10206),s=n(39396),r=n(25675),d=n.n(r),a=n(67294),c=n(90083),u=n(47624),g=n(22623);let h=i=>{var e,n,r;let{title:h,description:p,amount:x,showCancel:v,cancelCtaText:m,onCTACancelClick:f,showConfirm:y,onClickConfirm:$,confirmCTA:j,entityType:b,data:C,roomsInHotel:k=[]}=i,[w,S]=(0,a.useState)(!1),I="ACTIVITY"===b,T=a.useMemo(()=>{var i;return(null==C?void 0:null===(i=C.entityCosting)||void 0===i?void 0:i.inclusions)?C.entityCosting.inclusions.split("</li><li>").reduce((i,e)=>{let n={text:e.replaceAll(/<\/?[^>]+(>|$)/gi,""),icon:"included"};return[...i,n]},[]):[]},[null==C?void 0:null===(e=C.entityCosting)||void 0===e?void 0:e.inclusions]),D=a.useMemo(()=>{var i;return(null==C?void 0:null===(i=C.entityCosting)||void 0===i?void 0:i.exclusions)?C.entityCosting.exclusions.split("</li><li>").reduce((i,e)=>{let n={text:e.replaceAll(/<\/?[^>]+(>|$)/gi,""),icon:"excluded"};return[...i,n]},[]):[]},[null==C?void 0:null===(n=C.entityCosting)||void 0===n?void 0:n.exclusions]),R=i=>(0,l.jsx)(g.Z,{items:i,listItemCSS:{marginBottom:"$5i",alignItems:"flex-start","&:last-child":{marginBottom:0}},textCSS:{paddingLeft:"$6i",fontSize:"$7i",lineHeight:"$12i",color:"$grey10",fontWeight:"$semiBold",fontFamily:"$manrope"}});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(s.sg,{css:{width:"100%",borderRadius:"$2",border:"1px solid $custom18",minHeight:"240px","&:hover":{borderColor:"$primary04"}},children:[(0,l.jsxs)(s.X2,{justify:"between",align:"center",css:{minHeight:"$40i",padding:"$6i $8i",backgroundColor:"$custom51",borderTopLeftRadius:"$2",borderTopRightRadius:"$2"},children:[(0,l.jsx)(s.xv,{as:"h4",css:{fontSize:"$9i",color:"$grey11",fontWeight:"$bolder",maxWidth:I?"70%":"80%",lineHeight:"$12i"},children:h}),(0,l.jsxs)(s.sg,{css:{gap:"$2i"},children:[x?(0,l.jsx)(s.xv,{as:"span",css:{color:"$custom20",fontSize:"$9i",fontWeight:"$bolder",textAlign:"end"},children:(0,l.jsx)(c.Z,{value:x})}):null,(0,l.jsxs)(s.X2,{align:"center",css:{gap:"$6i",paddingTop:"$4i"},children:[v?(0,l.jsx)(s.zx,{danger:!0,outlined:!0,onClick:f,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(s.xv,{css:{fontWeight:"$bold"},children:m})}):null,y?(0,l.jsx)(s.zx,{outlined:!0,secondary:!0,css:{backgroundColor:"$white"},onClick:$,children:j}):null,I&&(null==T?void 0:T.length)&&(null==D?void 0:D.length)?(0,l.jsx)(s.zx,{onClick:()=>S(!0),children:"View Details"}):null]})]})]}),(0,l.jsxs)(s.X2,{css:{backgroundColor:"$white",minHeight:"160px",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2"},children:[(0,l.jsx)(d(),{src:(0,u.Z)("https://d3lf10b5gahyby.cloudfront.net/modals/custom_block.png?dpr=2&auto=format,compress,enhance&q=20?w=250&h=180&fit=crop&auto=format,compress,enhance&q=20"),width:240,height:150,alt:"ab-card-image",style:{objectFit:"contain"}}),(0,l.jsx)(s.sg,{css:{paddingBottom:"$5i",width:"100%"},children:k.length?(0,l.jsx)(l.Fragment,{children:null==k?void 0:k.map((i,e)=>{var n,o,t;let r=(null==i?void 0:i.name)||"",d=(null==i?void 0:null===(n=i.extraInclusions)||void 0===n?void 0:null===(o=n[0])||void 0===o?void 0:null===(t=o.text)||void 0===t?void 0:t[0])||"";return(0,l.jsxs)(s.sg,{css:{padding:"$5i 0"},children:[r&&(0,l.jsx)(s.xv,{css:{fontSize:"15px",color:"$grey700",fontWeight:"$bold",paddingRight:"10px",wordBreak:"break-word",paddingBottom:"$2i"},dangerouslySetInnerHTML:{__html:r}}
1),d&&(0,l.jsx)(s.xv,{css:{fontSize:"15px",color:"$grey05",paddingRight:"10px",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:d}})]},"room-".concat(e))})}):(0,l.jsx)(s.xv,{css:{fontSize:"15px",color:"$grey09",padding:"10px 0",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:p}})})]})]}),w&&(0,l.jsx)(t.Vq.fC,{open:w,onOpenChange:S,children:(0,l.jsxs)(t.Vq.VY,{overlayZindex:"$max",css:{maxWidth:"500px",maxHeight:"60vh",overflow:"auto",padding:"$12i",borderRadius:"$4",zIndex:"$max","& > button":{display:"none"}},children:[(0,l.jsxs)(s.X2,{align:"center",justify:"between",css:{paddingBottom:"$8i",borderBottom:"1px solid $grey02"},children:[(0,l.jsx)(s.xv,{as:"h3",css:{fontSize:"$8i",fontWeight:"$bolder",color:"$custom34",fontFamily:"$manrope"},children:"Activity Details"}),(0,l.jsx)(o.Z,{css:{cursor:"pointer",color:"$grey12",height:"16px",width:"16px"},onClick:()=>S(!1)})]}),(0,l.jsxs)(s.sg,{css:{gap:"$8i",paddingTop:"$8i"},children:[(0,l.jsxs)(s.X2,{css:{gap:"$2i"},align:"center",children:[(0,l.jsx)(s.xv,{css:{fontSize:"$7i",color:"$grey950",fontWeight:"$bolder",fontFamily:"$manrope"},children:"Title:"}),(0,l.jsx)(s.xv,{css:{fontSize:"$7i",color:"$grey950",fontWeight:"$semiBold",fontFamily:"$manrope"},children:h})]}),(null==C?void 0:null===(r=C.entityCosting)||void 0===r?void 0:r.startTime)&&(0,l.jsxs)(s.X2,{css:{gap:"$2i"},align:"center",children:[(0,l.jsx)(s.xv,{css:{fontSize:"$7i",color:"$grey950",fontWeight:"$bolder",fontFamily:"$manrope"},children:"Activity Time:"}),(0,l.jsx)(s.xv,{css:{fontSize:"$7i",color:"$grey950",fontWeight:"$semiBold",fontFamily:"$manrope"},children:(i=>{if(!i)return"Not specified";if(i.includes(":"))return i;if(4===i.length){let e=parseInt(i.substring(0,2)),n=i.substring(2);return"".concat(e%12||12,":").concat(n," ").concat(e>=12?"PM":"AM")}return i})(C.entityCosting.startTime)})]}),p&&(0,l.jsx)(s.xv,{css:{fontSize:"$7i",color:"$grey950",lineHeight:"$10i",fontWeight:"$semiBold"},dangerouslySetInnerHTML:{__html:p}}),(T.length>0||D.length>0)&&(0,l.jsx)(s.sg,{css:{gap:"$4i"},children:(0,l.jsxs)(s.xu,{css:{display:"flex",flexDirection:"column",gap:"$12i","@lg":{gap:"0",flexDirection:"row",justifyContent:"space-between"}},children:[(null==T?void 0:T.length)>0?(0,l.jsxs)(s.xu,{css:{flexBasis:"100%","@lg":{flexBasis:"48%"}},children:[(0,l.jsx)(s.xv,{css:{fontSize:"$7i",fontWeight:"$bolder",color:"$grey950",paddingBottom:"$6i",lineHeight:"$12i",fontFamily:"$manrope"},children:"Inclusions"}),(0,l.jsx)(s.xu,{css:{padding:"$10i",background:"$green00",borderRadius:"$3"},children:(null==T?void 0:T.length)>0&&R(T)})]}):null,(null==D?void 0:D.length)>0?(0,l.jsxs)(s.xu,{css:{flexBasis:"100%","@lg":{flexBasis:"48%"}},children:[(0,l.jsx)(s.xv,{css:{fontSize:"$7i",fontWeight:"$bolder",color:"$grey950",paddingBottom:"$6i",lineHeight:"$12i",fontFamily:"$manrope"},children:"Exclusions"}),(0,l.jsx)(s.xu,{css:{padding:"$10i",background:"$red00",borderRadius:"$3"},children:(null==D?void 0:D.length)>0&&R(D)})]}):null]})})]})]})})]})};e.Z=h},16129:function(i,e,n){var l=n(85893),o=n(29038),t=n(5599),s=n(89353),r=n(38451),d=n(25574),a=n(65367),c=n(67969),u=n(91838),g=n(44341),h=n(96961),p=n(10206),x=n(39396),v=n(70024),m=n(51633),f=n.n(m),y=n(84872),$=n.n(y),j=n(7495),b=n.n(j),C=n(11163),k=n(67294),w=n(86501),S=n(51138),I=n(37880),T=n(81042),D=n(16977),R=n(90083),z=n(34929),W=n(74734),Z=n(22623),A=n(35591),P=n(49823),B=n(25077),M=n(6478),E=n(16124),L=n(44950),O=n(76907),H=n(83359),F=n(39502),K=n(54806),Y=n(76622),_=n(44938),q=n(11301),N=n(65732),V=n(93290),U=n(27627),X=n(32459),G=n(67405),J=n(47564),Q=n(20487),ii=n(76522);let ie=(i,e)=>{let n=[],l=i.replace(/<li>/g,"").replace(/<\/li>/g,"\n").replace(/<[^>]*>/g,"").split("\n").filter(Boolean).map(i=>i.trim());return l.forEach(i=>{i&&n.push({icon:e?"included":"excluded",text:i})}),n},il=(i,e,n)=>{let o=[];return o.push({icon:i?(0,l.jsx)(g.Z,{css:{fill:"$green500"}}):(0,l.jsx)(c.Z,{css:{fill:"$red05"}}),text:i?"Refundable":"Non-Refundable"}),e&&o.push({icon:(0,l.jsx)(r.Z,{css:{fill:"$grey600"}}),text:e}),o.push({icon:(0,l.jsx)(h.Z,{css:{fill:"$grey600"}}),text:"".concat("NOTRANSFER"===n?"No Transfer":f()(n)," activity")}),o},io=i=>{var e,n,r,d,a,c,u,g;let{slot:h,costingInfo:p,alerts:m,isBooked:f,showCancelButton:y,subLineitemAddonData:$}=i,j=(0,K.Z)(),b=(0,v.Dv)(L.s1),C=(0,E.Z)(),w=(0,k.useMemo)(()=>!!(b&&(null==b?void 0:b.loggedIn)&&(0,N.P)({key:U.Dp,permissions:null==b?void 0:b.permissions})),[b]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x.xu,{as:"div",css:{background:"$white",width:"100%",opacity:p.status===M.MR||(null==p?void 0:p.status)===M.RY&&y?"100%":"25%"},children:(0,l.jsxs)(x.sg,{css:{padding:"$8i",width:"100%",gap:"$4i","@lg":{}},children:[!f&&p.upgradesCount?(0,l.jsx)(P.Z,{upgradeCount:null==p?void 0:p.upgradesCount}):null,(0,l.jsx)(x.xu,{children:(0,l.jsx)(Z.Z,{items:il(null==h?void 0:null===(e=h.costingInfo)||void 0===e?void 0:e.refund
1able,null===(n=h.selectedTourGrade)||void 0===n?void 0:n.duration,null===(r=h.selectedTourGrade)||void 0===r?void 0:r.transferType),type:"horizontal",listCSS:{order:3,"@lg":{order:0}},textCSS:{color:"$grey700",fontSize:"$7i",lineHeight:"$10i",fontWeight:500}})}),(0,l.jsx)(x.kC,{css:{width:"100%",justifyContent:"end"},children:w&&(null==p?void 0:p.discountApplied)?(0,l.jsx)(A.Z,{text:"Admin Price",bgColor:"#de6138"}):null}),(0,l.jsx)(x.iz,{css:{backgroundColor:"$m_custom48",display:"none","@lg":{display:"block"}}}),(0,l.jsxs)(x.xu,{css:{alignItems:"flex-start","@lg":{display:"flex"}},children:[(0,l.jsxs)(x.xu,{css:{"@lg":{flexBasis:"60%",display:"block"}},children:[(null==h?void 0:null===(d=h.selectedTourGrade)||void 0===d?void 0:null===(a=d.inclusion)||void 0===a?void 0:a.length)!=0?(0,l.jsx)(x.xv,{css:{fontSize:"11px",marginBottom:"$2i",color:"$grey600",fontWeight:"$bolder",lineHeight:"$8i",textTransform:"uppercase",letterSpacing:"0.4px","@lg":{fontSize:"11px"}},children:"INCLUSIONS"}):null,(0,l.jsx)(Z.Z,{items:ie((null==h?void 0:null===(c=h.selectedTourGrade)||void 0===c?void 0:c.inclusion)||"",!0),listItemCSS:{marginRight:"$6i",alignItems:"flex-start"},listCSS:{flexBasis:"100%",marginBottom:"$5i","@lg":{marginBottom:0,flexBasis:"auto"}}})]}),(0,l.jsx)(x.xu,{css:{flexBasis:"auto",display:"flex",alignItems:"center",marginBottom:"$8i",width:"100%","@lg":{display:"block",flexBasis:"60%",paddingLeft:"$10i",flexDirection:"column",marginBottom:0}},children:(0,l.jsxs)(x.xu,{css:{"@lg":{flexBasis:"60%",display:"block"}},children:[(null===(u=h.selectedTourGrade)||void 0===u?void 0:u.exclusion.length)!=0?(0,l.jsx)(x.xv,{css:{fontSize:"11px",marginBottom:"$2i",color:"$grey600",fontWeight:"$bolder",lineHeight:"$8i",textTransform:"uppercase",letterSpacing:"0.4px","@lg":{fontSize:"11px"}},children:"EXCLUSIONS"}):null,(0,l.jsx)(Z.Z,{items:ie((null===(g=h.selectedTourGrade)||void 0===g?void 0:g.exclusion)||"",!1),listItemCSS:{marginRight:"$6i",alignItems:"flex-start"},listCSS:{flexBasis:"100%",marginBottom:"$5i","@lg":{marginBottom:0,flexBasis:"auto"}},textCSS:{fontSize:"$7i",fontWeight:500,color:"$grey950"}})]})})]}),(0,l.jsxs)(x.X2,{css:{flexWrap:"wrap",gap:"$4i"},children:[(0,N.P)({key:U.Gw,permissions:null==b?void 0:b.permissions})?(0,l.jsxs)(k.Fragment,{children:[(0,l.jsx)(z.Z,{text:p.sourceProvider,icon:(0,l.jsx)(o.Z,{css:{fill:"$grey09"}}),wrapperCSS:{borderRadius:"$radii$1",width:"fit-content"}}),(null==p?void 0:p.lastDataUpdatedMillis)?(0,l.jsx)(x.xu,{css:{textAlign:"right"},children:(0,l.jsx)(A.Z,{text:"Last updated ".concat(j.getDaysDiffWithYears(p.lastDataUpdatedMillis)," ago")})}):null]}):null,h.free?(0,l.jsx)(z.Z,{text:"Self Exploration",icon:(0,l.jsx)(t.Z,{css:{fill:"$m_custom47"}}),wrapperCSS:{background:"$black",borderRadius:"$radii$1",marginBottom:"$8i !important",width:"fit-content","@lg":{marginBottom:"0 !important"}},textCSS:{color:"$white"}}):null,(null==p?void 0:p.inSwissPass)?(0,l.jsx)(z.Z,{text:"Included in Swiss Pass!",icon:(0,l.jsx)(s.Z,{css:{fill:"$m_custom47"}}),wrapperCSS:{background:"$custom34",borderRadius:"$radii$1",marginBottom:"$8i !important",padding:"$3i $4i",width:"fit-content","@lg":{marginBottom:"0 !important",width:"fit-content"}},textCSS:{color:"$white",fontWeight:"$bolder",fontSize:"$7i"}}):null]}),(null==h?void 0:h.free)?(0,l.jsx)(x.xv,{css:{fontSize:"$7i",lineHeight:1.4,marginTop:"$4i",display:"none","@lg":{display:"block"}},children:"Transfers and fees for self exploration activities are to be borne by you. We'd be happy to share details on request."}):null]})}),m.length>0&&C?(0,l.jsx)(X.Z,{content:m}):null,(0,N.P)({permissions:null==b?void 0:b.permissions,key:U.Gz})&&C?(0,l.jsx)(ii.Z,{entity:p.entityType,configKey:p.configKey,costingId:p.costingId}):null,(null==$?void 0:$.length)?(0,l.jsx)(x.xu,{css:{backgroundColor:"$white",gap:"$8i",padding:"$8i"},children:null==$?void 0:$.map((i,e)=>{var n;return(0,l.jsx)(x.xu,{children:(0,l.jsx)(D.Z,{image:(null==i?void 0:null===(n=i.images)||void 0===n?void 0:n[0])||"https://images.pickyourtrail.com/image_placeholder_2eca9cbf61.png",title:null==i?void 0:i.title,subtitle:null==i?void 0:i.description,price:null==i?void 0:i.ourCost,tag:"Addon",costingId:null==i?void 0:i._id,status:null==i?void 0:i.status,entityType:"".concat(null==i?void 0:i.customCardEntity)})},e)})}):null]})},it=i=>{var e,n;let{activityCostings:o,activityRefs:t,activityById:s,alerts:c,itineraryInfo:g,campaignItinerary:h,openGcmAction:m,onClickAddonLineItem:f}=i,y=(0,C.useRouter)(),j=(0,v.Dv)(L.s1),{removeActivityCardAsync:D}=(0,T.X)(),{lineItemDiscardAsync:z}=(0,I.h)(),Z=(0,v.b9)(L.w4),[A,P]=(0,k.useState)(!1),{UseGetActivityTimingsAsync:K}=(0,S.a)(),X=(0,v.b9)(L.OO),ii=(0,k.useMemo)(()=>(0,_.Z)(y),[y]),ie=i=>{let e=g.iterSlotByKey;sessionStorage.setItem("scrollPosition",window.scrollY.toString());let n=$()(e,function(e){var n;return(null==e?void 0:null===(n=e.activitySlotDetail)||void 0===n?void 0:n.activityId)===i}),l=b()(e,n);y.push("".concat(ii,"/activity-details/").concat((0,Y.Z)(l)))},il=(0,k.useMemo)(()=>{var i;return null==g?void 0:null===(i=g.itinerary)||void 0===i?void 0:i.landPackageBooked},[g]),it=(0,k.useMemo)(()=>(null==j?void 0:j.loggedIn)&&il&&(0,N.P)({permissions:null==j?void 0:j.permissions,key:U.yj})||!1,[il,null==j?void 0:j.loggedIn,null==j?void 0:j.permissions]),is=(i,e)=>{var n;let l={itineraryId:null==g?void 0:null===(n=g.itinerary)||void 0===n?void 0:n.itineraryId,leadSource:(0,H.L1)({router:y,lastLocation:{pathname:y.asPath}}),from:e||""};(0,O.L9W)(O.PPK,l);let o=g.iterSlotByKey,t=$()(o,function(e){var n;return(null==e?void 0:null===(n=e.activitySlotDetail)||void 0===n?void 0:n.activityId)===i}),s=b()(o,t);sessionStorage.setItem("scrollPosition",window.scrollY.toString()),(0,V.Z)("".concat(ii,"/alternate-activities/").concat((0,Y.Z)(s)))},ir=(i,e)=>{e?P(!0):i()},id=o.costingById,ia=(0,k.useCallback)(i=>{var e;return(null==c?void 0:null===(e=c[i])||void 0===e?void 0:e.filter(i=>{var e;return(!i.inventory||(null===(e=i.inventory)||void 0===e?void 0:e.includes("LINE_ITEM_CARD")))&&i.message}).map(i=>i.message))||[]},[c]),ic=(0,k.useCallback)(i=>{var e,n;return(null===(e=null==c?void 0:null===(n=c[i])||void 0===n?void 0:n.filter(i=>{var e;return(!i.inventory||(null===(e=i.inventory)||void 0===e?void 0:e.includes("LINE_ITEM_CARD")))&&i}))||void 0===e?void 0:e.filter(i=>!i.hasOwnProperty("privateAlert")||(null==i?void 0:i.privateAlert)===!1).map(i=>i))||[]},[c]),iu=(0,N.P)({key:U.Vi,permissions:null==j?void 0:j.permissions})&&il||!1,ig=(0,N.P)({key:U.Gw,permissions:null==j?void 0:j.permissions}),ih=(0,N.P)({key:U.d5,permissions:null==j?void 0:j.permissions}),ip=(0,N.P)({key:U.iI,permissions:null==j?void 0:j.permissions}),ix=(0,k.useMemo)(()=>{var i;return!!(null==g?void 0:null===(i=g.itinerary)||void 0===i?void 0:i.booking)},[g]),iv=(0,k.useCallback)(()=>
1{if(h)m&&m();else{var i,e;(0,V.Z)("/customize/".concat(null==g?void 0:null===(i=g.itinerary)||void 0===i?void 0:i.regionCode,"/inclusions/block-card/custom/").concat(null==g?void 0:null===(e=g.itinerary)||void 0===e?void 0:e.itineraryId))}},[h,null==g?void 0:null===(e=g.itinerary)||void 0===e?void 0:e.itineraryId,null==g?void 0:null===(n=g.itinerary)||void 0===n?void 0:n.regionCode,m]),im=(0,k.useCallback)((i,e,n)=>{y.query.m!==i&&y.push({pathname:y.asPath,query:{m:i,configkey:e,dayTs:"".concat(n)}},void 0,{shallow:!0})},[y]),iy=(0,k.useMemo)(()=>(null==j?void 0:j.loggedIn)&&(0,N.P)({key:U.TX,permissions:null==j?void 0:j.permissions}),[null==j?void 0:j.loggedIn,null==j?void 0:j.permissions]),i$=i=>{var e;let{configKey:n,dayTs:o,planningToolId:t,costingInfo:s,hasSubLineitemAddon:d,transferType:c}=i,v=(0,C.useRouter)(),y=(0,k.useCallback)(async()=>{try{var i;let e=g.iterSlotByKey,l=$()(e,function(i){var e;return(null==i?void 0:null===(e=i.activitySlotDetail)||void 0===e?void 0:e.activityId)===t}),o=b()(e,l),s=await D({itineraryId:null==v?void 0:null===(i=v.query)||void 0===i?void 0:i.itineraryId,configKey:n,slotIdentifier:(0,Y.Z)(o)});"SUCCESS"===s.status&&(Z(s),w.ZP.success("Activity block card removed successfully"))}catch(r){}},[n,t,null==v?void 0:null===(e=v.query)||void 0===e?void 0:e.itineraryId]);return(0,l.jsxs)(l.Fragment,{children:[(it||iy||iu)&&(null==s?void 0:s.status)===M.MR?(0,l.jsxs)(p.Lt.fC,{modal:!1,children:[(0,l.jsx)(p.Lt.xz,{asChild:!0,children:(0,l.jsx)(x.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold",cursor:"pointer"},onClick:i=>{i.preventDefault(),i.stopPropagation()},children:(0,l.jsx)(a.Z,{})})}),(0,l.jsxs)(p.Lt.VY,{css:{minWidth:"fit-content",padding:"$6i",zIndex:"$max",gap:"$6i",display:"flex",flexDirection:"column"},children:[iy?(0,l.jsxs)(x.X2,{onClick:i=>{i.preventDefault(),i.stopPropagation(),null==f||f("activity",null==s?void 0:s.configKey)},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(u.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsx)(x.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:"Add Add-on"})]}):null,iu&&"PRIVATE"===c?(0,l.jsxs)(x.X2,{onClick:i=>{i.preventDefault(),i.stopPropagation(),iC(null==s?void 0:s.configKey,null==s?void 0:s.costingId)},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(r.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsx)(x.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:"Update Pickup time"})]}):null]})]}):null,(0,l.jsx)(x.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),h)m&&m();else{let e=()=>im("activity-block-card",n,o);ir(e,d)}},disabled:ix||il,secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(x.xv,{css:{fontWeight:"$bold"},children:"Edit"})}),(0,l.jsx)(x.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),h)m&&m();else{let e=()=>y();ir(e,d)}},disabled:ix||il,danger:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(x.xv,{css:{fontWeight:"$bold"},children:"Remove"})})]})},ij=(0,E.Z)(),ib=(0,k.useCallback)(async(i,e)=>{try{var n;let l=await z({configKey:i,entityType:e,itineraryId:null==g?void 0:null===(n=g.itinerary)||void 0===n?void 0:n.itineraryId});(null==l?void 0:l.status)==="SUCCESS"&&(null==l?void 0:l.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),Z(l))}catch(o){console.error({error:o})}},[g,z,Z]),iC=(0,k.useCallback)(async(i,e)=>{try{var n,l,o,t;let s=await K({itineraryId:e,entityType:"activity"});"SUCCESS"===s.status&&(null==s?void 0:null===(n=s.data)||void 0===n?void 0:null===(l=n.pickupAndStartTimings)||void 0===l?void 0:l.length)>0?(X((null===(o=s.data)||void 0===o?void 0:o.pickupAndStartTimings)||[]),sessionStorage.setItem("scrollPosition",window.scrollY.toString()),y.replace({pathname:null===(t=y.asPath)||void 0===t?void 0:t.split("?")[0],query:{m:"one-pager-edit",configKey:i,entity:"activity"}})):w.ZP.error("No pickup times available for this activity")}catch(r){console.error({error:r})}},[K,y,X]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(w.x7,{position:"top-center",reverseOrder:!1,gutter:8,containerClassName:"",toastOptions:{className:"",duration:5e3,style:{backgroundColor:"#363636",color:"#fff"}}}),k.Children.toArray(Object.values(t||{}).map(i=>{var e,n,o,t,c,v,$;let b=s[i.split("_")[0]],C=id[i],k=null==g?void 0:null===(e=g.customCostings)||void 0===e?void 0:e.filter(i=>"ACTIVITIES"===i.customCardEntity&&"CUSTOM"===i.entityType),w=(null==j?void 0:j.loggedIn)?(0,q.Z)({publishedCost:null==C?void 0:C.publishedCost,ourCost:null==C?void 0:C.ourCost,userDetails:j}):0,S=null==b?void 0:null===(n=b.selectedTourGrade)||void 0===n?void 0:n.gradeTitle,I=null==k?void 0:k.filter(i=>
1(null==i?void 0:i.parentCostingId)===C.costingId),T=I&&(null==I?void 0:I.filter(i=>i.status===M.MR).length)>0||!1;return C.status===M.ew?(0,l.jsx)(J.Z,{type:F.WK.ACTIVITIES,title:"".concat(null==C?void 0:C.text).concat(S?" - ".concat(S):""),startDate:C?C.dayOfWeek+", "+C.day+C.mon:"",entity:null==C?void 0:C.entityType}):(0,l.jsxs)(x.xu,{as:"section",css:{marginTop:"$8i","@lg":{marginTop:0}},onClick:i=>{null==i||i.preventDefault(),null==i||i.stopPropagation(),h?m&&m():C.status===M.MR&&ie(b.planningToolId)},children:[(0,l.jsxs)(x.xu,{css:{display:"flex",flexDirection:"column",color:"$grey950",background:"$white",overflow:"hidden",borderRadius:"$4",cursor:(il||"SOLD_OUT"!==C.status)&&"UNAVAILABLE"!==C.status?"pointer":"not-allowed","@lg":{borderRadius:"$4",border:(null==C?void 0:C.status)===M.RY&&it?"1px dashed $pyellow800":C.status===M.MR?"1px solid $grey100":"1px solid red",borderStyle:(null==C?void 0:C.status)===M.RY&&it?"dashed":"solid",boxShadow:"none",padding:0,"&:hover":{borderColor:(null==C?void 0:C.status)===M.RY&&it?"$pyellow800":"$primary04"},"&:hover .alert-message":{backgroundColor:"$yellow00"}}},children:[(0,l.jsx)(W.Z,{src:null==b?void 0:b.mainPhoto,width:"100%",height:260,mobHeight:225}),(0,l.jsx)(x.kC,{css:{minHeight:"$16i",backgroundColor:"$white",borderRadius:"$2i $2i 0 0",paddingTop:"$8i","@lg":{padding:"$8i 0",minHeight:"$36i",backgroundColor:(null==C?void 0:C.status)===M.RY&&it?"$pyellow100":"$custom82",borderBottom:"1px solid $blue100"}},children:(0,l.jsxs)(x.kC,{css:{justifyContent:"space-between",flexGrow:1,padding:"0 0 $4i 0",borderBottom:"1px solid $blue100","@lg":{padding:"0 $8i 0 0",alignItems:"center",borderBottom:"none"}},children:[(0,l.jsx)(x.xu,{css:{width:"100%","@lg":{flex:"1 0 0"}},children:(0,l.jsx)(G.Z,{type:F.WK.ACTIVITIES,title:"".concat(null==C?void 0:C.text).concat(S?" - ".concat(S):""),startDate:C?C.dayOfWeek+", "+C.day+C.mon:""})}),(0,l.jsxs)(x.xu,{css:{display:"none","@lg":{display:"flex",alignItems:"end",rowGap:"$4i",flexDirection:"column"}},children:[(0,l.jsxs)(x.X2,{align:"center",css:{gap:"$3i"},children:[ig&&(null==C?void 0:C.ourCostInContractCurrency)&&(null==C?void 0:C.contractCurrency)&&(null==C?void 0:C.contractCurrency)!==""&&(null==C?void 0:C.contractCurrency)!=="INR"&&(null==C?void 0:C.contractCurrency)!==void 0?(0,l.jsx)(x.xv,{children:(0,l.jsx)(R.Z,{value:null==C?void 0:C.ourCostInContractCurrency,defaultValue:"0",displayCurrency:null==C?void 0:C.contractCurrency})}):null,w?(0,l.jsxs)(x.X2,{align:"center",css:{gap:"$3i"},children:[(0,l.jsx)(x.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)(R.Z,{value:w})}),((null==C?void 0:C.status)!==M.RY||!it)&&(ih&&C.offline||ix||!ih||(null==C?void 0:C.isBundled))?null:(0,l.jsx)(x.xu,{css:{cursor:"pointer",paddingTop:"$2i"},onClick:i=>{if(i.preventDefault(),i.stopPropagation(),h)m&&m();else{var e,n;let l="/customize/".concat(null==y?void 0:null===(e=y.query)||void 0===e?void 0:e.regionCode,"/inclusions/rate-match/total-cost/TOTAL_COST/").concat(null==y?void 0:null===(n=y.query)||void 0===n?void 0:n.itineraryId);(0,V.Z)(l)}},children:(0,l.jsx)(d.Z,{})})]}):null]}),(0,l.jsx)(x.X2,{align:"center",justify:"center",css:{gap:"$2i"},children:it&&(null==C?void 0:C.status)==="SOLD_OUT"?(0,l.jsx)(x.zx,{onClick:()=>ib(null==C?void 0:C.configKey,null==C?void 0:C.entityType),secondary:!0,outlined:!0,css:{backgroundColor:"$white",border:"1px solid $red400",boxShadow:"none",color:"$black","&:hover":{boxShadow:"none"}},children:"Discard"}):ip&&C.offline?(0,l.jsx)(i$,{configKey:null==b?void 0:null===(o=b.costingInfo)||void 0===o?void 0:o.configKey,dayTs:C.dateMillis,planningToolId:null==b?void 0:b.planningToolId,costingInfo:C,hasSubLineitemAddon:T,transferType:null==b?void 0:null===(t=b.selectedTourGrade)||void 0===t?void 0:t.transferType}):(0,l.jsxs)(l.Fragment,{children:[(it||iy||iu)&&(null==C?void 0:C.status)===M.MR?(0,l.jsxs)(p.Lt.fC,{modal:!1,children:[(0,l.jsx)(p.Lt.xz,{asChild:!0,children:(0,l.jsx)(x.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold",cursor:"pointer"},onClick:i=>{i.preventDefault(),i.stopPropagation()},children:(0,l.jsx)(a.Z,{})})}),(0,l.jsxs)(p.Lt.VY,{css:{minWidth:"fit-content",padding:"$6i",zIndex:"$max",gap:"$6i",display:"flex",flexDirection:"column"},children:[iy?(0,l.jsxs)(x.X2,{onClick:i=>{i.preventDefault(),i.stopPropagation(),null==f||f("activity",null==C?void 0:C.configKey)},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(u.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsx)(x.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:"Add Add-on"})]}):null,(null==b?void 0:null===(c=b.selectedTourGrade)||void 0===c?void 0:c.transferType)==="PRIVATE"&&iu?(0,l.jsxs)(x.X2,{onClick:i=>{i.preventDefault(),i.stopPropagation(),iC(null==C?void 0:C.configKey,null==C?void 0:C.costingId)},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(r.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsx)(x.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:"Update Pickup time"})]}):null]})]}):null,C.status===M.MR?(0,l.jsx)(p.u,{content:"View Details",children:(0,l.jsx)(x.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"transparent",fontWeight:"$bold",cursor:C.status==M.MR?"pointer":"not-allowed"},children:(0,l.jsx)(x.xv,{css:{fontWeight:"$bold",fontSize:"$7i",color:"$grey950",lineHeight:"$10i"},children:"View Details"})})}):null,(null==C?void 0:C.isBundled)||C.status!==M.MR&&C.status!==M.js&&(null==C?void 0:C.status)!==M.RY&&(null==C?void 0:C.status)!=="SOLD_OUT"?null:(0,l.jsx)(x.zx,{onClick:i=>
1{if(i.preventDefault(),i.stopPropagation(),h)m&&m();else{let e=()=>is(b.planningToolId,null==b?void 0:b.title);ir(e,T)}},disabled:((null==C?void 0:C.status)!==M.RY||!it)&&((null==C?void 0:C.status)===M.MR&&!!it&&!!il||!it&&il),primary:!0,outlined:!0,css:{backgroundColor:"transparent",fontWeight:"$bold"},children:(0,l.jsx)(x.xv,{css:{fontWeight:"$bold"},children:"Change Activity"})})]})})]})]})}),C.status===M.MR||"SOLD_OUT"===C.status||"UNAVAILABLE"===C.status||(null==C?void 0:C.status)===M.RY&&it?(0,l.jsxs)(l.Fragment,{children:["SOLD_OUT"===C.status?(0,l.jsxs)(x.xu,{css:{maxWidth:"100%",display:"grid",justifyContent:"center"},children:[" ",(0,l.jsx)(x.xv,{css:{transform:"rotate(-15deg)",color:"red",fontSize:"$10i",letterSpacing:"-.25px",fontWeight:"$bolder",textTransform:"uppercase",textAlign:"center",display:"inline-block",borderTop:"$sizes$i solid red",borderBottom:"$sizes$i solid red",padding:"$2i 0",maxWidth:100},children:"SOLD OUT"})]}):null,"UNAVAILABLE"===C.status?(0,l.jsxs)(x.xu,{css:{maxWidth:"100%",display:"grid",justifyContent:"center"},children:[" ",(0,l.jsx)(x.xv,{css:{transform:"rotate(-15deg)",color:"red",fontSize:"$10i",letterSpacing:"-.25px",fontWeight:"$bolder",textTransform:"uppercase",textAlign:"center",display:"inline-block",borderTop:"$sizes$i solid red",borderBottom:"$sizes$i solid red",padding:"$2i 0",maxWidth:150},children:"UNAVAILABLE"})]}):null,(0,l.jsx)(io,{slot:{...b},costingInfo:id[i],alerts:ia(i),isBooked:ix,showCancelButton:it||!1,subLineitemAddonData:I||[]}),(0,l.jsxs)(x.X2,{css:{padding:"0 $8i $8i $8i",justifyContent:"space-between",alignItems:"center","@lg":{display:"none"}},children:[w?(0,l.jsx)(x.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)(R.Z,{value:w})}):null,(0,l.jsx)(x.X2,{align:"center",justify:"center",css:{gap:"$2i",width:"100%"},children:ip&&C.offline?(0,l.jsx)(i$,{configKey:null==b?void 0:null===(v=b.costingInfo)||void 0===v?void 0:v.configKey,dayTs:C.dateMillis,planningToolId:null==b?void 0:b.planningToolId,hasSubLineitemAddon:T,transferType:null==b?void 0:null===($=b.selectedTourGrade)||void 0===$?void 0:$.transferType}):(0,l.jsxs)(l.Fragment,{children:[C.status===M.MR?(0,l.jsx)(x.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white",flex:1},children:(0,l.jsx)(x.xv,{css:{fontWeight:"$bold",fontSize:"$7i",color:"$grey950",lineHeight:"$10i"},children:"View Details"})}):null,ix||(null==C?void 0:C.isBundled)?null:(0,l.jsx)(x.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),h)m&&m();else{let e=()=>is(b.planningToolId);ir(e,T)}},primary:!0,outlined:!0,css:{backgroundColor:"$white",flex:1},children:(0,l.jsx)(x.xv,{css:{fontWeight:"$bold"},children:"Change Activity"})})]})})]})]}):(0,l.jsx)(Q.Z,{failedFor:"Activity",type:F.WK.ACTIVITIES,status:null==C?void 0:C.status,isAdmin:ig,onClick:iv})]}),ij?null:(0,l.jsx)(B.Z,{alertData:ic(i),isBooked:ix,title:null==C?void 0:C.text,configKey:i})]})})),(0,l.jsx)(p.Vq.fC,{open:A,onOpenChange:()=>{P(!1)},children:(0,l.jsx)(p.Vq.VY,{overlayZindex:"$2",css:{maxWidth:"400px",padding:"$8i",borderRadius:"$3",zIndex:"$max"},children:(0,l.jsxs)(x.xu,{css:{display:"flex",flexDirection:"column",gap:"$6i"},children:[(0,l.jsx)(x.xu,{css:{fontSize:"$9i",fontWeight:"$bold",color:"$grey900",marginBottom:"$6i",display:"flex",alignItems:"center",gap:"$3i"},children:"Alert: Cannot be cancelled"}),(0,l.jsx)(x.xu,{css:{fontSize:"$6i",color:"$grey900",marginBottom:"$6i",lineHeight:"$10i",fontFamily:"$manrope",fontWeight:"$semiBold"},children:"This activity has an add-on attached to it, please cancel the add-on first and then proceed with activity cancellation/change."}),(0,l.jsx)(x.X2,{css:{gap:"$3i",justifyContent:"flex-end"},children:(0,l.jsx)(x.zx,{onClick:()=>{P(!1)},css:{backgroundColor:"$primary05",color:"$white"},children:"Ok"})})]})})})]})};e.Z=it},94756:function(i,e,n){n.d(e,{Z:function(){return Y}});var l=n(85893),o=n(38451),t=n(25574),s=n(65367),r=n(67969),d=n(91838),a=n(44341),c=n(93802),u=n(10206),g=n(39396),h=n(70024),p=n(11163),x=n(67294),v=n(37880),m=n(51490),f=n(88767);let y=async(i,e,n)=>await e({url:"ferry/".concat(i.itineraryId,"/").concat(i.configKey),method:i.method,body:i.data,signal:n}),$=i=>{let e=(0,m.wh)(),{mutate:n,mutateAsync:l,...o}=(0,f.useMutation)(i=>y(i,e,void 0),i);return{createModifyFerry:n,createModiyFerryAsync:l,...o}};var j=n(16977),b=n(90083),C=n(74734),k=n(22623),w=n(35591),S=n(6478),I=n(16124),T=n(75291),D=n(44950),R=n(39502),z=n(54806),W=n(11301),Z=n(65732),A=n(93290),P=n(27627),B=n(67405),M=n(47564),E=n(20487),L=n(76522);let O=(i,e,n)=>{let t=[];return t.push({icon:i?(0,l.jsx)(a.Z,{css:{fill:"$grey09"}}):(0,l.jsx)(r.Z,{css:{fill:"$custom44"}}),text:i?"Refundable":"Non Refundable"}),t.push({icon:(0,l.jsx)(o.Z,{css:{fill:"$grey09"}}),text:e}),t.push({icon:(0,l.jsx)(c.Z,{css:{fill:"$grey09"}}),text:n}),t},H=(i,e)=>{let n=[],l=i.replace(/<li>/g,"").replace(/<\/li>/g,"\n").replace(/<[^>]*>
1/g,"").split("\n").filter(Boolean).map(i=>i.trim());return l.forEach(i=>{i&&n.push({icon:e?"included":"excluded",text:i})}),n},F=i=>{let{slot:e,isBali:n,isThailand:o}=i,t=(0,z.Z)(),s=(0,h.Dv)(D.s1),r=(0,x.useMemo)(()=>!!(s&&(null==s?void 0:s.loggedIn)&&(0,Z.P)({key:P.Dp,permissions:null==s?void 0:s.permissions})),[s]);return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(g.xu,{as:"div",css:{background:"$white",width:"100%"},children:(0,l.jsxs)(g.xu,{css:{display:"flex",flexDirection:"column","@lg":{flexDirection:"row"}},children:[(0,l.jsx)(C.Z,{src:n?"https://images.pickyourtrail.com/images/golden.jpg":o?"https://d3lf10b5gahyby.cloudfront.net/25cadedf-becb-4968-b53b-f45f51d104ac_white_ferry.png":"https://images.pickyourtrail.com/images/misc/ferry.jpg?dpr=2&w=250&h=180&fit=crop&auto=format,compress,enhance&q=20",mobHeight:188}),(0,l.jsxs)(g.xu,{css:{padding:"$8i",width:"100%",display:"flex",flexDirection:"column","@lg":{display:"block"}},children:[(0,Z.P)({permissions:null==s?void 0:s.permissions,key:P.Dp})&&(null==e?void 0:e.lastDataUpdatedMillis)&&(null==e?void 0:e.lastDataUpdatedMillis)>0?(0,l.jsx)(g.kC,{css:{width:"100%",justifyContent:"flex-end",marginBottom:"$4i"},children:(0,l.jsx)(w.Z,{text:"Last updated ".concat(t.getDaysDiffWithYears(e.lastDataUpdatedMillis)," ago")})}):null,(0,l.jsx)(k.Z,{items:O(e.refundable,e.duration,e.ferryClass),type:"horizontal",listCSS:{order:3,"@lg":{order:0,marginTop:"$8i"}}}),(0,l.jsxs)(g.X2,{justify:"between",css:{paddingTop:"$8i","@lg":{width:"calc(100% - 16px)"},"@smMax":{paddingBottom:"$8i"}},children:[(0,l.jsxs)(g.sg,{css:{gap:"$3i"},children:[(0,l.jsxs)(g.X2,{css:{gap:"$3i",alignItems:"baseline"},children:[(0,l.jsx)(g.xv,{css:{fontSize:"$9i",color:"$grey12",fontWeight:"$bold"},children:e.departureTime}),(0,l.jsxs)(g.xv,{css:{fontSize:"13px",color:"$grey05"},children:[e.day," ",e.mon]})]}),(0,l.jsx)(g.xv,{css:{fontSize:"13px",color:"$grey05"},children:e.pickup})]}),(0,l.jsxs)(g.Kq,{css:{width:"50%",alignItems:"center",gap:"0px !important","@smMax":{flexDirection:"row"}},seperator:(0,l.jsx)(g.X2,{css:{flex:1,height:"1px",backgroundColor:"$grey08"}}),children:[(0,l.jsx)(g.xu,{css:{width:"$6i",height:"$6i",borderRadius:"$round",border:"1px solid $grey08"}}),(0,l.jsx)(g.X2,{css:{padding:"$2i $6i",borderRadius:"36px",backgroundColor:"$grey01","@lg":{minWidth:"$36i"}},children:(0,l.jsxs)(g.xv,{css:{fontSize:"10px",color:"$grey11",whiteSpace:"nowrap",letterSpacing:"-0.25px","@lg":{fontSize:"13px"}},children:[e.duration,", Direct"]})}),(0,l.jsx)(c.Z,{css:{fill:"$grey08"}})]}),(0,l.jsxs)(g.sg,{css:{gap:"$3i"},children:[(0,l.jsxs)(g.X2,{css:{gap:"$3i",alignItems:"baseline"},children:[(0,l.jsx)(g.xv,{css:{fontSize:"$9i",color:"$grey12",fontWeight:"$bold"},children:e.arrivalTime}),(0,l.jsxs)(g.xv,{css:{fontSize:"13px",color:"$grey05"},children:[e.day," ",e.mon]})]}),(0,l.jsx)(g.xv,{css:{fontSize:"13px",color:"$grey05"},children:e.drop})]})]}),(0,l.jsxs)(g.kC,{css:{marginTop:"$5i",flexDirection:"column","@lg":{flexDirection:"row"}},children:[(0,l.jsxs)(g.xu,{css:{"@lg":{width:"50%",display:"block"}},children:[(null==e?void 0:e.inclusions)?(0,l.jsx)(g.xv,{as:"h5",css:{fontSize:"$7i",textTransform:"uppercase",color:"$grey06",fontWeight:"$bold",lineHeight:1.84},children:"INCLUSIONS"}):null,(0,l.jsx)(k.Z,{items:H((null==e?void 0:e.inclusions)||"",!0),listItemCSS:{marginRight:"$6i",alignItems:"flex-start"},listCSS:{flexBasis:"100%",marginBottom:"$5i","@lg":{marginBottom:0,flexBasis:"auto"}}})]}),(0,l.jsx)(g.xu,{css:{flexBasis:"auto",alignItems:"center",marginBottom:"$8i",width:"100%","@lg":{display:"block",flexBasis:"60%",flexDirection:"column",marginBottom:0,width:"50%"}},children:(0,l.jsxs)(g.xu,{css:{"@lg":{display:"block"}},children:[(null==e?void 0:e.exclusions)?(0,l.jsx)(g.xv,{as:"h5",css:{fontSize:"$7i",textTransform:"uppercase",color:"$grey06",fontWeight:"$bold",lineHeight:1.84},children:"EXCLUSIONS"}):null,(0,l.jsx)(k.Z,{items:H((null==e?void 0:e.exclusions)||"",!1),listItemCSS:{marginRight:"$6i",alignItems:"flex-start"},listCSS:{flexBasis:"100%",marginBottom:"$5i","@lg":{marginBottom:0,flexBasis:"auto"}}}),(0,l.jsx)(g.X2,{css:{justifyContent:"flex-end",marginTop:"$20i"},children:r&&(null==e?void 0:e.discountApplied)?(0,l.jsx)(w.Z,{text:"Admin Price",bgColor:"#de6138"}):null})]})})]})]})]})})})},K=i=>{var e,n,o,r;let{ferryRefs:a,costingById:c,isBooked:m,campaignItinerary:f,openGcmAction:y,islandBooked:C,onClickAddonLineItem:k}=i,w=(0,p.useRouter)(),z=(0,h.Dv)(D.s1),O=(0,h.b9)(D.w4),{createModiyFerryAsync:H}=$(),{lineItemDiscardAsync:K}=(0,v.h)(),Y=(0,T.Z)(),_=(0,I.Z)(),[q,N]=(0,x.useState)(!1),V=(i,e)=>{e?N(!0):i()},U=(0,x.useMemo)(()=>(null==z?void 0:z.loggedIn)&&C&&(0,Z.P)({permissions:null==z?void 0:z.permissions,key:P.yj}),[C,null==z?void 0:z.loggedIn,null==z?void 0:z.permissions]),X=(0,x.useMemo)(()=>(null==z?void 0:z.loggedIn)&&(C||m)?(0,Z.P)({permissions:null==z?void 0:z.permissions,key:P.yj}):(0,Z.P)({key:P.TX,permissions:null==z?void 0:z.permissions}),[null==z?void 0:z.loggedIn,null==z?void 0:z.permissions,C,m]),G=(0,x.useCallback)(async(i,e,n)=>{var l,o,t;if(null===(l=w.query)||void 0===l?void 0:l.itineraryId){let s={configKey:e,itineraryId:null===(o=w.query)||void 0===o?void 0:o.itineraryId,method:"DELETE",data:{configKey:e,itineraryId:null===(t=w.query)||void 0===t?void 0:t.itineraryId,isRemove:!1,transfer:n}};i===S.js?(s.data.isRemove=!1,s.method="PUT"):(s.data.isRemove=!0,s.method="DELETE");let r=await H(s);(null==r?void 0:r.status)==="SUCCESS"&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),O(r))}},[H,null===(e=w.query)||void 0===e?void 0:e.itineraryId,O]),J=(0,x.useMemo)(()=>!!(z&&(null==z?void 0:z.loggedIn)&&(0,Z.P)({key:P.Dp,permissions:null==z?void 0:z.permissions})),[z]),Q=(null==w?void 0:null===(n=w.query)||void 0===n?void 0:n.regionCode)==="idn",ii=(null==w?void 0:null===(o=w.query)||void 0===o?void 0:o.regionCode)==="tha",ie=(0,x.useCallback)(async(i,e)=>{try{var n;let l=await K({configKey:i,entityType:e,itineraryId:"".concat(null===(n=w.query)||void 0===n?void 0:n.itineraryId)});(null==l?void 0:l.status)==="SUCCESS"&&(null==l?void 0:l.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),O(l))}catch(o){console.error({error:o})}}
1,[K,null==w?void 0:null===(r=w.query)||void 0===r?void 0:r.itineraryId,O]);return(0,l.jsxs)(l.Fragment,{children:[x.Children.toArray(null==a?void 0:a.map(i=>{var e,n;let o=(null==c?void 0:c[i||""])||void 0,r=(null==o?void 0:o.status)===S.js?"Add":"Remove",a=(null==z?void 0:z.loggedIn)?(0,W.Z)({publishedCost:null==o?void 0:o.publishedCost,ourCost:null==o?void 0:o.ourCost,userDetails:z}):0,h=null==Y?void 0:null===(e=Y.customCostings)||void 0===e?void 0:e.filter(i=>"FERRY"===i.customCardEntity&&"CUSTOM"===i.entityType),p=null==h?void 0:h.filter(i=>(null==i?void 0:i.parentCostingId)===(null==o?void 0:o.costingId)),x=p&&(null===(n=null==p?void 0:p.filter(i=>i.status===S.MR))||void 0===n?void 0:n.length)>0||!1;return(0,l.jsx)(g.xu,{as:"section",css:{marginTop:"$8i","@lg":{marginTop:0}},children:(null==o?void 0:o.status)===S.ew?(0,l.jsx)(M.Z,{type:R.WK.FERRY,title:o.text,startDate:o?o.dayOfWeek+", "+o.day+o.mon:"",departureCity:o.fromCity,drop:o.drop,arrivalCity:o.toCity,isBali:Q,entity:o.entityType}):(0,l.jsxs)(g.xu,{css:{display:"flex",flexDirection:"column",color:"$grey09",background:"$white",overflow:"hidden",boxShadow:"0 $fontSizes$i $fontSizes$3i 0 $colors$grey02",padding:"$8i 0","@lg":{borderRadius:"$3",border:"1px solid $custom18",boxShadow:"none",padding:0,"&:hover .alert-message":{backgroundColor:"$yellow00"}}},children:[(0,l.jsx)(g.kC,{css:{minHeight:"$16i",backgroundColor:"$white",borderRadius:"$2i $2i 0 0",paddingBottom:"$6i","@lg":{padding:"$8i 0",minHeight:"$36i",backgroundColor:"$pblue100"}},children:(0,l.jsxs)(g.kC,{css:{justifyContent:"space-between",flexGrow:1,padding:"0 $8i 0 0","@lg":{alignItems:"center"}},children:[(0,l.jsx)(B.Z,{type:R.WK.FERRY,title:o.text,startDate:o?o.dayOfWeek+", "+o.day+o.mon:"",departureCity:o.fromCity,drop:o.drop,arrivalCity:o.toCity,isBali:Q}),(0,l.jsxs)(g.sg,{css:{display:"none","@lg":{display:"block"}},children:[J&&a?(0,l.jsxs)(g.X2,{align:"center",justify:"end",css:{gap:"$3i"},children:[(0,l.jsx)(g.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)(b.Z,{value:a})}),((null==o?void 0:o.status)!==S.RY||!U)&&(m||(null==o?void 0:o.isBundled))?null:(0,l.jsx)(g.xu,{css:{cursor:"pointer",paddingTop:"$2i"},onClick:i=>{if(null==i||i.preventDefault(),null==i||i.stopPropagation(),f)y&&y();else{var e,n;let l="/customize/".concat(null==w?void 0:null===(e=w.query)||void 0===e?void 0:e.regionCode,"/inclusions/rate-match/total-cost/TOTAL_COST/").concat(null==w?void 0:null===(n=w.query)||void 0===n?void 0:n.itineraryId);(0,A.Z)(l)}},children:(0,l.jsx)(t.Z,{})})]}):null,(0,l.jsxs)(g.X2,{align:"center",justify:"center",css:{gap:"$2i"},children:[(U||X)&&(null==o?void 0:o.status)===S.MR?(0,l.jsxs)(u.Lt.fC,{modal:!1,children:[(0,l.jsx)(u.Lt.xz,{asChild:!0,children:(0,l.jsx)(g.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold",cursor:"pointer"},children:(0,l.jsx)(s.Z,{})})}),(0,l.jsx)(u.Lt.VY,{css:{minWidth:"fit-content",padding:"$6i",zIndex:"$max",gap:"$6i",display:"flex",flexDirection:"column"},children:X&&(0,l.jsxs)(g.X2,{onClick:i=>{i.preventDefault(),i.stopPropagation(),null==k||k("ferry",null==o?void 0:o.configKey)},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(d.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsx)(g.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:"Add Add-on"})]})})]}):null,U&&(null==o?void 0:o.status)==="SOLD_OUT"?(0,l.jsx)(g.zx,{onClick:()=>ie(null==o?void 0:o.configKey,null==o?void 0:o.entityType),secondary:!0,outlined:!0,css:{backgroundColor:"$white",border:"1px solid $red400",boxShadow:"none",color:"$black","&:hover":{boxShadow:"none"}},children:"Discard"}):(null==o?void 0:o.status)!==S.MR&&(null==o?void 0:o.status)!==S.UT&&(null==o?void 0:o.status)!==S.nZ||o.isBundled?null:(0,l.jsx)(g.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation(),f?y&&y():V(()=>w.push("".concat(w.asPath,"/alternate-ferry/").concat(null==o?void 0:o.configKey)),x)},primary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(g.xv,{css:{fontWeight:"$bold"},children:"Change Ferry"})}),(0,Z.P)({permissions:null==z?void 0:z.permissions,key:P.EQ})&&!o.isBundled&&(null==o?void 0:o.status)!==S.nZ?(0,l.jsx)(g.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation(),f?y&&y():V(()=>{var i;return G(null==o?void 0:o.status,null==o?void 0:o.configKey,null==o?void 0:null===(i=o.entityType)||void 0===i?void 0:i.toLowerCase())},!!(null==p?void 0:p.length))},..."Remove"===r?{danger:!0}:{primary:!0},outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(g.xv,{css:{fontWeight:"$bold"},children:r})}):null]})]})]})}),o.status===S.MR?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(F,{slot:o,isBali:Q,isThailand:ii}),(0,l.jsx)(g.xu,{css:{display:"block",padding:"$8i $8i 0 0","@lg":{display:"none"}}
1,children:(0,l.jsxs)(g.X2,{align:"center",justify:"end",css:{gap:"$2i"},children:[o.isBundled?null:(0,l.jsx)(g.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation(),f?y&&y():V(()=>w.push("".concat(w.asPath,"/alternate-ferry/").concat(null==o?void 0:o.configKey)),!!(null==p?void 0:p.length))},primary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(g.xv,{css:{fontWeight:"$bold"},children:"Change Ferry"})}),(0,Z.P)({permissions:null==z?void 0:z.permissions,key:P.EQ})&&!o.isBundled?(0,l.jsx)(g.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),f)y&&y();else{let e=()=>{var i;return G(null==o?void 0:o.status,null==o?void 0:o.configKey,null==o?void 0:null===(i=o.entityType)||void 0===i?void 0:i.toLowerCase())};V(e,x)}},secondary:!0,outlined:!0,css:{backgroundColor:"$white"},children:(0,l.jsx)(g.xv,{css:{fontWeight:"$bold"},children:r})}):null]})}),(null==p?void 0:p.length)?(0,l.jsx)(g.sg,{css:{gap:"$8i",padding:"$8i"},children:null==p?void 0:p.map((i,e)=>{var n;return(0,l.jsx)(g.xu,{children:(0,l.jsx)(j.Z,{image:(null==i?void 0:null===(n=i.images)||void 0===n?void 0:n[0])||"https://images.pickyourtrail.com/image_placeholder_2eca9cbf61.png",title:null==i?void 0:i.title,subtitle:null==i?void 0:i.description,price:null==i?void 0:i.ourCost,tag:"Addon",costingId:null==i?void 0:i._id,status:null==i?void 0:i.status,entityType:"".concat(null==i?void 0:i.customCardEntity)})},e)})}):null]}):(0,l.jsxs)(g.xu,{children:[(0,l.jsx)(E.Z,{failedFor:"Ferry",type:R.WK.FERRY,status:null==o?void 0:o.status}),(0,l.jsx)(g.xu,{css:{display:"flex",justifyContent:"flex-end",paddingRight:"$8i","@lg":{display:"none"}},children:o.isBundled?null:(0,l.jsx)(g.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation(),sessionStorage.setItem("scrollPosition",window.scrollY.toString()),f?y&&y():V(()=>{var i;return G(null==o?void 0:o.status,null==o?void 0:o.configKey,null==o?void 0:null===(i=o.entityType)||void 0===i?void 0:i.toLowerCase())},!!(null==p?void 0:p.length))},secondary:!0,outlined:!0,css:{backgroundColor:"$white"},children:(0,l.jsx)(g.xv,{css:{fontWeight:"$bold"},children:r})})})]}),(0,Z.P)({permissions:null==z?void 0:z.permissions,key:P.Gz})&&o.status===S.MR&&_?(0,l.jsx)(L.Z,{entity:o.entityType,configKey:o.configKey,costingId:o.costingId}):null]})})})),(0,l.jsx)(u.Vq.fC,{open:q,onOpenChange:()=>{N(!1)},children:(0,l.jsxs)(u.Vq.VY,{overlayZindex:"$2",css:{maxWidth:"400px",padding:"$8i",borderRadius:"$3",zIndex:"$max"},children:[(0,l.jsx)(g.xu,{css:{fontSize:"$9i",fontWeight:"$bold",color:"$grey900",marginBottom:"$6i",display:"flex",alignItems:"center",gap:"$3i"},children:"Alert: Cannot be cancelled"}),(0,l.jsx)(g.xu,{css:{fontSize:"$6i",color:"$grey900",marginBottom:"$6i",lineHeight:"$10i",fontFamily:"$manrope",fontWeight:"$semiBold"},children:"This ferry has an add-on attached to it, please cancel the add-on first and then proceed with ferry cancellation/change."}),(0,l.jsx)(g.X2,{css:{gap:"$3i",justifyContent:"flex-end"},children:(0,l.jsx)(g.zx,{onClick:()=>{N(!1)},css:{backgroundColor:"$primary05",color:"$white"},children:"Ok"})})]})})]})};var Y=K},59390:function(i,e,n){n.d(e,{Z:function(){return is}});var l=n(85893),o=n(640),t=n(77727),s=n(65367),r=n(91838),d=n(75454),a=n(10206),c=n(39396),u=n(70024),g=n(11163),h=n(67294),p=n(51490),x=n(88767);let v=async(i,e,n)=>await e({url:"hotel/split/modify",method:"POST",body:i,signal:n}),m=i=>{let e=(0,p.wh)(),{mutate:n,mutateAsync:l,...o}=(0,x.useMutation)(i=>v(i,e,void 0),i);return{manageSplitStay:n,manageSplitStayAsync:l,...o}},f=async(i,e,n)=>await e({url:"hotel/".concat((null==i?void 0:i.delayCheckOutFlag)?"delay-checkout":"early-checkin","/").concat(null==i?void 0:i.itineraryId),method:"POST",body:i.data,signal:n}),y=i=>{let e=(0,p.wh)(),{mutate:n,mutateAsync:l,...o}=(0,x.useMutation)(i=>f(i,e,void 0),i);return{earlyCheckIn:n,earlyCheckInAsync:l,...o}},$=async(i,e,n)=>await e({url:"hotel/extend-stay/".concat(null==i?void 0:i.itineraryId),method:"POST",body:i.data,signal:n}),j=i=>{let e=(0,p.wh)(),{mutate:n,mutateAsync:l,...o}=(0,x.useMutation)(i=>$(i,e,void 0),i);return{usefetchExtendStay:n,fetchExtendStayAsync:l,...o}};var b=n(37880),C=n(5335),k=n(27484),w=n.n(k),S=n(10285),I=n.n(S),T=n(90083),D=n(96053),R=n(17451);w().extend(I());let z=(0,C.F4)({from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}),W=i=>{let{hotelName:e,data:n,cityName:o,open:t=!0,onCloseModal:s,earlyCheckIn:r,buttonClickAction:d,isLoading:u}=i,p=(0,g.useRouter)(),x=Math.round(Math.abs((null==n?void 0:n.currentCost)-(null==n?void 0:n.previousCost))),v=(0,h.useMemo)(()=>"".concat(p.query.configKey),[p]),m=i=>{let e=-1!==i.indexOf("/");return w()(i,e?"DD/MMM/YYYY":"YYYY-MM-DD").format("DD MMM, YYYY")};return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(c.xu,{css:{backgroundColor:"blue"},children:(0,l.jsx)(a.Vq.fC,{open:t,onOpenChange:s,children:(0,l.jsx)(a.Vq.VY,{overlayZindex:10,css:{"@lg":{width:656,borderRadius:"$4",padding:"0px",zIndex:999}},children:(0,l.jsxs)(c.sg,{children:[o?(0,l.jsxs)(c.xv,{css:{fontSize:"$14i",lineHeight:"$16i",fontWeight:"$bold",letterSpacing:"-0.02em",color:"$black",padding:"$6i $12i"},children:["Your stay at ",o]}):null,e?(0,l.jsx)(c.xv,{css:{backgroundColor:"rgb(243, 244, 251)",paddingBottom:"$5i",paddingTop:"$5i",paddingLeft:"$16i",paddingRight:"$16i"},children:e}):null,(0,l.jsxs)(c.sg,{css:{padding:"$12i $16i"},children:[(0,l.jsxs)(c.X2,{css:{width:"100%",border:"1px solid rgb(232, 234, 248)",borderRadius:"$2"},children:[(0,l.jsxs)(c.sg,{css:{width:"50%",borderRight:"1px solid rgb(232, 234, 248)",padding:"$12i $10i",gap:"$2i"},children:[(0,l.jsx)(c.xv,{css:{textTransform:"uppercase",color:"$black",fontSize:"$7i"},children:"CHECK IN DATE"}),(null==n?void 0:n.checkInDate)?(0,l.jsx)(c.xv,{css:{lineHeight:"$14i",fontSize:"$8i",fontWeight:"$bold"},children:m(null==n?void 0:n.checkInDate)}):null]}),(0,l.jsxs)(c.sg,{css:{width:"50%",borderRightWidth:"1px",borderRightColor:"rgb(232, 234, 248)",padding:"$12i $10i",marginLeft:"$4i",gap:"$2i"},children:[(0,l.jsx)(c.xv,{css:{textTransform:"uppercase",color:"$black",fontSize:"$7i"},children:"CHECK OUT DATE"}),(null==n?void 0:n.checkOutDate)?(0,l.jsx)(c.xv,{css:{lineHeight:"$14i",fontSize:"$8i",fontWeight:"$bold"},children:m(null==n?void 0:n.checkOutDate)}):null]})]}),(0,l.jsxs)(c.sg,{css:{gap:"$4i",paddingTop:"$12i"},children:[(0,l.jsxs)(c.X2,{css:{justifyContent:"space-between"},children:[(0,l.jsx)(c.xv,{css:{fontSize:"$7i",color:"$black"},children:"Total Number of nights"}),(null==n?void 0:n.numberOfNights)?(0,l.jsxs)(c.xv,{css:{fontSize:"$7i",fontWeight:"$bolder",lineHeight:"$10i"},children:[null==n?void 0:n.numberOfNights," ",(0,D.Z)({count:null==n?void 0:n.numberOfNights,keyword:"Night"})]}):null]}),(0,l.jsxs)(c.X2,{css:{justifyContent:"space-between"},children:[(0,l.jsx)(c.xv,{css:{fontSize:"$7i",color:"$black"},children:"Hotel Cost"}),(null==n?void 0:n.currentCost)?(0,l.jsx)(c.xv,{css:{fontSize:"$7i",fontWeight:"$bolder",lineHeight:"$10i"},children:(0,l.jsx)(T.Z,{value:null==n?void 0:n.currentCost,defaultValue:"0"})}):null]}),(0,l.jsxs)(c.X2,{css:{justifyContent:"space-between"},children:[(0,l.jsx)(c.xv,{css:{fontSize:"$7i",color:"$black"},children:"Change in total cost"}),x?(0,l.jsxs)(c.X2,{children:[(0,l.jsxs)(c.xv,{css:{fontSize:"$7i",fontWeight:"$bolder",lineHeight:"$10i",color:"Late"===r||"Add"===r?"#F3205F":"#09B367"},children:["Late"===r||"Add"===r?"+":"-"," "]}),(0,l.jsx)(c.xv,{css:{fontSize:"$7i",fontWeight:"$bolder",lineHeight:"$10i",color:"Late"===r||"Add"===r?"#F3205F":"#09B367"},children:(0,l.jsx)(T.Z,{value:x,defaultValue:"0"})})]}):null]})]})]}),(0,l.jsxs)(c.X2,{css:{padding:"$6i $12i",backgroundColor:"$white",boxShadow:" 0px -2px 10px rgba(0,0,0,0.1)",gap:"$4i",width:"100%",justifyContent:"flex-end",borderRadius:"0 0 8px 8px"},children:[(0,l.jsx)(c.zx,{onClick:()=>{s(!1)},css:{padding:"$6i $8i",color:"#1895b3",backgroundColor:"transparent",borderColor:"
11px solid transparent",letterSpacing:"-0.4px",fontWeight:"$bold",fontSize:"$8i",cursor:"pointer",boxShadow:"none","&:hover":{boxShadow:"none",color:"rgb(20, 128, 153)"}},children:"Cancel"}),(0,l.jsxs)(c.zx,{onClick:()=>{d((0,R.Z)(v))},css:{color:"$white",cursor:"pointer",borderRadius:"$3",fontSize:"$8i",letterSpacing:"-0.4px",fontWeight:"$bold",lineHeight:"1.41",backgroundColor:"#1cad45",borderColor:"1px solid #1cad45",padding:"$4i $8i","&:hover":{color:"rgb(255, 255, 255)",borderColor:"rgba(28, 173, 69, 0.9)",backgroundColor:"rgba(28, 173, 69, 0.9)"}},children:["Confirm Changes"," ",u&&(0,l.jsx)(c.xu,{css:{border:"3px solid #f3f3f3",borderTop:"3px solid #3498db",borderRadius:"50%",width:"16px",height:"16px",animation:"".concat(z," 1s linear infinite"),marginLeft:"$2i"}})]})]})]})})})})})};var Z=n(39855);function A(){return(0,l.jsxs)(c.X2,{css:{display:"none","@lg":{width:"fit-content",display:"flex",overflow:"auto",alignItems:"center",justifyContent:"center",backgroundColor:"rgb(0, 55, 61)",borderRightTopRadius:"$2",borderBottomRightRadius:"$2"}},children:[(0,l.jsx)(c.kC,{css:{height:"24px",backgroundColor:"rgb(152, 255, 83)",paddingLeft:"$i",paddingRight:"$i",width:"24px",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"$1",borderBottomLeftRadius:"$1"},children:(0,l.jsx)(Z.Z,{})}),(0,l.jsx)(c.xv,{css:{height:"24px",verticalAlign:"top",fontWeight:"$bold",fontSize:"$6i",lineHeight:"$12i",letterSpacing:"-0.25px",padding:"0 $2i",backgroundColor:"$black",color:"rgb(152, 255, 83)",borderTopRightRadius:"$1",borderBottomRightRadius:"$1"},children:"Top Recommended"})]})}var P=n(23294),B=n(25077),M=n(6478),E=n(16124),L=n(75291),O=n(44950),H=n(76907),F=n(83359),K=n(39502),Y=n(17459),_=n(44938),q=n(11301),N=n(65732),V=n(93290),U=n(35946),X=n(27627),G=n(98574);let J=i=>{let{open:e=!1,setOpen:n,data:o}=i,t=(0,g.useRouter)(),[s,r]=(0,h.useState)(null==o?void 0:o.numberOfNights),[d,u]=(0,h.useState)("END"),[p,x]=(0,h.useState)(""),[v,m]=(0,h.useState)(""),f=(0,h.useMemo)(()=>(0,_.Z)(t),[t]),y=(0,h.useMemo)(()=>{var i;return null==t?void 0:null===(i=t.pathname)||void 0===i?void 0:i.includes("inclusions")},[t]);(0,h.useEffect)(()=>{(null==o?void 0:o.numberOfNights)&&r(o.numberOfNights)},[o]);let $=i=>{r(+i.target.value)},j=i=>{u(i.target.value)};return(0,h.useEffect)(()=>{let i=w()(null==o?void 0:o.checkInDate,"DD/MMM/YYYY"),e=w()(null==o?void 0:o.checkOutDate,"DD/MMM/YYYY");if("END"===d){let n=e.subtract(s,"day").format("MMMM D, YYYY");x(n),m(e.format("MMMM D, YYYY"))}else if("START"===d){let l=i.add(s,"day").format("MMMM D, YYYY");m(l),x(i.format("MMMM D, YYYY"))}},[null==o?void 0:o.checkInDate,null==o?void 0:o.checkOutDate,s,d]),(0,l.jsx)(a.Vq.fC,{open:e,onOpenChange:n,children:(0,l.jsx)(a.Vq.VY,{css:{overflow:"auto",zIndex:10,width:"100%",padding:"$10i",height:"100vh","@lg":{width:656,height:350,borderRadius:"$4",padding:"$20i"}},children:(0,l.jsxs)(c.sg,{children:[(0,l.jsxs)(c.xv,{css:{fontSize:"$14i",lineHeight:"$16i",marginBottom:"$12i",fontFamily:"$manrope",fontWeight:"$bold"},children:["Your stay at ",null==o?void 0:o.cityName]}),(0,l.jsxs)(c.xv,{css:{fontSize:"$8i",lineHeight:"$11i",marginBottom:"$8i",color:"$grey12",fontFamily:"$manrope","@lg":{fontSize:"$8i"}},children:["Currently planned at"," ",(0,l.jsxs)(c.xu,{as:"span",css:{fontWeight:"$bolder",fontFamily:"$manrope"},children:["\xa0",null==o?void 0:o.hotelName,"\xa0"]}),"from ",w()(null==o?void 0:o.checkInDate).format("MMMM D, YYYY")," to"," ",w()(null==o?void 0:o.checkOutDate).format("MMMM D, YYYY")]}),(0,l.jsxs)(c.kC,{css:{alignItems:"center",flexWrap:"wrap",gap:"$2i"},children:[(0,l.jsxs)(c.xv,{css:{fontSize:"$8i",lineHeight:"$10i",color:"$grey10",fontFamily:"$manrope"},children:[" ","Find another hotel"]}),(0,l.jsxs)(c.Ph,{value:d,onChange:j,css:{minWidth:180,fontWeight:"$bold",boxShadow:"none",cursor:"pointer",background:"",borderRadius:"$sizes$13i",backgroundColor:"rgba(38, 119, 240, 0.2)",color:"rgb(38, 119, 240)",fontSize:"$8i",lineHeight:"$16i",display:"flex",alignItems:"center",justifyContent:"flex-end",margin:"0 $4i",height:"$16i",padding:"0px $6i 0px $6i",fontFamily:"$manrope","&:focus-within":{border:"none",boxShadow:"none"},"> svg":{margin:0,marginLeft:"$4i",fill:"rgb(38, 119, 240)"}},children:[(0,l.jsx)("option",{value:"START",children:"at the beginning"}),(0,l.jsx)("option",{value:"END",selected:!0,children:"at the end"})]}),(0,l.jsxs)(c.xv,{css:{fontSize:"$8i",lineHeight:"$10i",color:"$grey10",fontFamily:"$manrope"},children:[" ","of the stay at ",null==o?void 0:o.cityName," for"]}),(0,l.jsxs)(c.Ph,{value:s,onChange:$,css:{minWidth:100,cursor:"pointer",fontWeight:"$bold",boxShadow:"none",background:"",borderRadius:"$sizes$13i",backgroundColor:"rgba(38, 119, 240, 0.2)",color:"rgb(38, 119, 240)",fontSize:"$8i",lineHeight:"$16i",display:"flex",alignItems:"center",justifyContent:"flex-end",margin:"0 $4i",height:"$16i",padding:"0px $6i 0px $6i",marginTop:"$4i","&:focus-within":{border:"none",boxShadow:"none"},"> svg":{margin:0,marginLeft:"$4i",fill:"rgb(38, 119, 240)"}},children:[(0,l.jsx)("option",{value:"",children:"Choose duration"}),Array.from({length:(null==o?void 0:o.numberOfNights)-1},(i,e)=>
1(0,l.jsxs)("option",{value:e+1,children:[e+1," ",e+1===1?"night":"nights"]},e+1))]})]}),(0,l.jsxs)(c.kC,{css:{alignItems:"center",gap:"$8i",padding:"$4i $8i",boxShadow:"rgb(0 0 0 / 10%) 0px -2px 10px",backgroundColor:"$white",position:"fixed",bottom:0,width:"100%",left:0,justifyContent:"flex-end","@lg":{position:"static",flexDirection:"column",justifyContent:"initial",alignItems:"flex-start",marginTop:"$8i",boxShadow:"none",padding:0,gap:0}},children:[(null==o?void 0:o.numberOfNights)===s?null:(0,l.jsxs)(c.xv,{css:{color:"rgb(146, 99, 175)",textAlign:"right",fontFamily:"$manrope","@lg":{fontSize:"$8i",marginBottom:"$8i",textAlign:"left"}},children:["Split stay for ",s," ",(0,D.Z)({count:s,keyword:"night"})," ","from ",p," to ",v]}),(0,l.jsx)(c.kC,{css:{gap:"$8i"},children:(0,l.jsx)(c.zx,{disabled:(null==o?void 0:o.numberOfNights)===s,css:{order:2,"@lg":{order:1}},onClick:()=>{t.push({pathname:"".concat(f).concat(y?"/inclusions":"","/alternate-hotels/").concat((0,Y.Z)(null==o?void 0:o.configKey)),query:{splitMode:!0,nights:s,position:d}})},children:"Find hotels"})})]})]})})})};var Q=n(50144),ii=n(67405),ie=n(74734),il=n(47564),io=n(76522);let it=i=>{let{alerts:e,costings:n,costingRefs:p,isBooked:x,islandBooked:v,regionCode:f,campaignItinerary:$,openGcmAction:C,onClickAddonLineItem:k}=i,w=(0,g.useRouter)(),S=(0,u.Dv)(O.s1),I=(0,u.b9)(O.w4),[D,z]=(0,h.useState)({}),[Z,it]=(0,h.useState)(!1),[is,ir]=(0,h.useState)({type:"",show:!1,hotelName:"",cityName:"",delayCheckOutFlag:!1}),[id,ia]=(0,h.useState)(!1),ic=(i,e)=>{e?ia(!0):i()},{earlyCheckInAsync:iu}=y(),{fetchExtendStayAsync:ig}=j(),{manageSplitStayAsync:ih}=m(),{lineItemDiscardAsync:ip}=(0,b.h)(),ix=(0,L.Z)(),iv=(0,h.useMemo)(()=>"".concat(w.query.itineraryId),[w]),im=(0,h.useMemo)(()=>(0,_.Z)(w),[w]),iy=i=>{sessionStorage.setItem("scrollPosition",window.scrollY.toString()),w.push("".concat(im,"/hotel-details/").concat((0,Y.Z)(i)))},i$=(i,e,n)=>{let l={itineraryId:Array.isArray(w.query.itineraryId)?w.query.itineraryId[0]:w.query.itineraryId||"",leadSource:(0,F.L1)({router:w,lastLocation:{pathname:w.asPath}}),from:n||""};(0,H.L9W)(H.KXD,l);let o=(0,Y.Z)(i);if(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),e){let t="".concat(im,"/block-card/hotel/").concat(o,"?isEdit=true");(0,V.Z)(t)}else w.push("".concat(im,"/alternate-hotels/").concat(o))},ij=(0,h.useMemo)(()=>(0,N.P)({permissions:null==S?void 0:S.permissions,key:K.PN})||!1,[null==S?void 0:S.permissions]),ib=async(i,e)=>{if(iv){let n=await iu({itineraryId:iv,delayCheckOutFlag:!1,data:{hotelConfigKey:i,earlyCheckIn:"Remove"!=e}});n.data&&z(n.data)}},iC=async(i,e)=>{if(iv){let n=await iu({itineraryId:iv,delayCheckOutFlag:!0,data:{hotelConfigKey:i,delayCheckOut:"Late"===e}});n.data&&z(n.data)}},ik=async i=>{if(iv){it(!0);let e={itineraryId:iv,data:{hotelConfigKey:i,action:(null==is?void 0:is.delayCheckOutFlag)?"DelayCheckOut":"EarlyCheckIn"}},n=await ig(e);"SUCCESS"===n.status&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),I(n),ir({...is,show:!1}),w.push({pathname:w.asPath.split("?")[0],query:{}},void 0,{shallow:!0})),it(!1)}},iw=(0,h.useCallback)(i=>{var n;return(null==e?void 0:null===(n=e[i])||void 0===n?void 0:n.filter(i=>{var e;return(!i.inventory||(null===(e=i.inventory)||void 0===e?void 0:e.includes("LINE_ITEM_CARD")))&&i.message}).map(i=>i.message))||[]},[e]),iS=(0,h.useCallback)(i=>{var n,l;return(null===(n=null==e?void 0:null===(l=e[i])||void 0===l?void 0:l.filter(i=>{var e;return(!i.inventory||(null===(e=i.inventory)||void 0===e?void 0:e.includes("LINE_ITEM_CARD")))&&i}))||void 0===n?void 0:n.filter(i=>!i.hasOwnProperty("privateAlert")||(null==i?void 0:i.privateAlert)===!1).map(i=>i))||[]},[e]),iI=i=>{let e=(null==n?void 0:n[null==i?void 0:i.configKey].status)==="UNAVAILABLE"||"ERROR"===n[null==i?void 0:i.configKey].status||"USER_REMOVED"===n[null==i?void 0:i.configKey].status;return e},[iT,iD]=(0,h.useState)({open:!1,cityName:"",hotelName:"",checkInDate:"",checkOutDate:"",numberOfNights:0,configKey:""}),iR=(i,e)=>{if(!e){let n={itineraryId:iv,leadSource:(0,F.L1)({router:w,lastLocation:{pathname:w.asPath}}),from:iv};(0,H.L9W)(H.aoV,n)}iD({open:!0,cityName:null==i?void 0:i.cityName,hotelName:null==i?void 0:i.text,checkInDate:null==i?void 0:i.checkInDate,checkOutDate:null==i?void 0:i.checkOutDate,numberOfNights:null==i?void 0:i.numberOfNights,configKey:null==i?void 0:i.configKey})},iz=async i=>{var e;let n=await ih({itineraryId:"".concat(null==w?void 0:null===(e=w.query)||void 0===e?void 0:e.itineraryId),configKey:null==i?void 0:i.configKey,opr:"DELETE"});"SUCCESS"===n.status&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),I(n))},iW=(0,N.P)({key:X.Gw,permissions:null==S?void 0:S.permissions}),iZ=(0,N.P)({key:X.d5,permissions:null==S?void 0:S.permissions}),iA=(0,E.Z)(),iP=(0,h.useMemo)(()=>(null==S?void 0:S.loggedIn)&&v&&(0,N.P)({permissions:null==S?void 0:S.permissions,key:X.yj}),[v,null==S?void 0:S.loggedIn,null==S?void 0:S.permissions]),iB=(0,h.useMemo)(()=>(null==S?void 0:S.loggedIn)&&(v||x)?(0,N.P)({permissions:null==S?void 0:S.permissions,key:X.yj}):(0,N.P)({key:X.TX,permissions:null==S?void 0:S.permissions}),[null==S?void 0:S.loggedIn,null==S?void 0:S.permissions,v,x]),iM=(0,h.useCallback)(async(i,e)=>{try{let n=await ip({configKey:i,entityType:e,itineraryId:iv});(null==n?void 0:n.status)==="SUCCESS"&&(null==n?void 0:n.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),I(n))}catch(l){console.error({error:l})}},[iv,ip,I]),iE=i=>{var e,n,l,o,t,s,r,d;let a=[];return(null==i?void 0:null===(e=i.roomsInHotel)||void 0===e?void 0:null===(n=e[0])||void 0===n?void 0:n.roomImages)&&(null==i?void 0:null===(l=i.roomsInHotel)||void 0===l?void 0:null===(o=l[0])||void 0===o?void 0:null===(t=o.roomImages)||void 0===t?void 0:t.length)>1?a.push(...null==i?void 0:null===(r=i.roomsInHotel)||void 0===r?void 0:null===(d=r[0])||void 0===d?void 0:d.roomImages):(null==i?void 0:i.otherImages)&&(null==i?void 0:null===(s=i.otherImages)||void 0===s?void 0:s.length)>1&&a.push(...null==i?void 0:i.otherImages),a};return(0,l.jsxs)(l.Fragment,{children:[p&&p.map(i=>{let e=(null==n?void 0:n[i||""])||void 0,u=null==e||!e.isBundled||!!e.allowExtraHotels;if(!e)return(0,l.jsx)(h.Fragment,{},i);{var g,p,m,y,j,b;let I={},D=e.offline&&iW,z=e.splitEnabled&&!e.allowedToSplit;(null==e?void 0:null===(g=e.roomsInHotel)||void 0===g?void 0:g.length)&&(null==e||e.roomsInHotel.reduce((i,e)=>{I={price:i+Math.round(null==e?void 0:e.ourCostInContractCurrency),type:null==e?void 0:e.contractCurrency}},0));let W=(null==S?void 0:S.loggedIn)&&!iI(e)?(0,q.Z)({publishedCost:null==e?void 0:e.publishedCost,ourCost:null==e?void 0:e.ourCost,userDetails:S}):0,Z=iE(e),E=null==ix?void 0:null===(p=ix.customCostings)||void 0===p?void 0:p.filter(i=>"HOTELS"===i.customCardEntity&&"CUSTOM"===i.entityType),L=null==E?void 0:E.filter(i=>(null==i?void 0:i.parentCostingId)===e.costingId),O=L&&(null===(m=L.filter(i=>i.status===M.MR))||void 0===m?void 0:m.length)>0;return(0,l.jsxs)(c.xu,{as:"section",children:[(null==e?void 0:e.status)===M.ew?(0,l.jsx)(il.Z,{title:"".concat(e.numberOfNights,"N in ").concat(e.cityName," ").concat(e.name?"@ ".concat(null==e?void 0:e.name,"\n "):""),type:K.WK.STAY,startDate:"".concat(e.checkInDayOfWeek,", ").concat(e.checkInDateDisplay," ").concat(e.checkInMonthDisplay),endDate:"".concat(e.checkOutDayOfWeek,", ").concat(e.checkOutDateDisplay," ").concat(e.checkOutMonthDisplay),showSplitOption:!1,entity:null==e?void 0:e.entityType}):(0,l.jsxs)(c.xu,{css:{display:"flex",flexDirection:"column",color:"$grey09",background:"$white",cursor:iI(e)?"not-allowed":"pointer",overflow:"hidden",boxShadow:"0 $fontSizes$i $fontSizes$3i 0 $colors$grey02",padding:"$8i 0","@lg":{borderRadius:"$3",border:"1px solid $custom18",boxShadow:"none",padding:0,borderStyle:(null==e?void 0:e.status)===M.RY&&iP?"dashed":"solid","&:hover":{borderColor:(null==e?void 0:e.status)===M.RY&&iP?"$pyellow800":iI(e)?"$custom18":"$primary04"},"&:hover .alert-message":{backgroundColor:"$yellow00"}}},children:[Z&&(null==Z?void 0:Z.length)>1?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.xu,{onClick:i=>{i.preventDefault(),i.stopPropagation()},css:{width:"100%",height:"225px",position:"relative","@lg":{width:"100%",height:"260px"}},children:(0,l.jsx)(P.x,{imageList:Z,id:"".concat((0,U.l)(null==e?void 0:null===(y=e.name)||void 0===y?void 0:y.replace(/ /g,"-"),"card"))})}),(0,l.jsx)(c.xu,{css:{position:"absolute",zIndex:"1",width:"fit-content",marginTop:"12px"},children:(null==e?void 0:e.pytRecommended)?(0,l.jsx)(A,{}):null})]}):(0,l.jsx)(ie.Z,{src:e.imageURL,width:"100%",height:260,mobHeight:225}),(0,l.jsx)(c.kC,{css:{minHeight:"$16i",backgroundColor:"$white",borderRadius:"$2i $2i 0 0","@lg":{padding:"$8i 0",minHeight:"$36i",backgroundColor:(null==e?void 0:e.status)===M.RY&&iP?"$pyellow100":"$pblue100"}},children:(0,l.jsxs)(c.kC,{css:{justifyContent:"space-between",flexGrow:1,padding:"0 $8i 0 0","@lg":{alignItems:"center"}},children:[(0,l.jsx)(c.xu,{onClick:i=>{null==i||i.preventDefault(),null==i||i.stopPropagation(),$?C&&C():iI(e)||iy(e.configKey)},css:{"@lg":{width:"45%"}},children:(0,l.jsx)(ii.Z,{title:"".concat(e.numberOfNights,"N in ").concat(e.cityName," ").concat(e.name?"@ ".concat(null==e?void 0:e.name,"\n "):""),startDate:"".concat(e.checkInDayOfWeek,", ").concat(e.checkInDateDisplay," ").concat(e.checkInMonthDisplay),endDate:"".concat(e.checkOutDayOfWeek,", ").concat(e.checkOutDateDisplay," ").concat(e.checkOutMonthDisplay),type:K.WK.STAY,showSplitOption:!(v||x)&&(null==e?void 0:e.splitEnabled)&&(null==e?void 0:e.allowedToSplit)&&!(null==e?void 0:e.offline)&&!iI(e),splitStayText:z?"Edit split stay":"Add split stay",onSplitStayClick:()=>$?C&&C():O?ic(()=>iR(e,z),O):iR(e,z)})}),(0,l.jsxs)(c.sg,{css:{gap:"$7i"},children:[(0,l.jsxs)(c.xu,{css:{display:"none","@lg":{display:"flex",alignItems:"center",rowGap:"$4i",gap:"$3i",justifyContent:"end"}},children:[z&&u?(0,l.jsxs)(c.X2,{css:{backgroundColor:"#D2DDF4",borderRadius:"$pill",overflow:"hidden",justifyContent:"center",alignItems:"center",opacity:(null==e?void 0:e.status)===M.RY&&iP?1:v||x?.5:1,cursor:(null==e?void 0:e.status)===M.RY&&iP?"pointer":v||x?"not-allowed":"pointer"},children:[(0,l.jsx)(c.xv,{css:{fontSize:"$7i",fontWeight:"$bold",color:"#3E75E8",padding:"0 $2i"},children:"Split stay"}),(0,l.jsx)(c.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),$)C&&C();else{let n=()=>iz(e);O?ic(n,O):n()}},css:{padding:"$2i",backgroundColor:"#3E75E8",boxShadow:"none",borderRadius:"unset","&:hover":{boxShadow:"none"}},disabled:((null==e?void 0:e.status)!==M.RY||!iP)&&(v||x),children:(0,l.jsx)(G.Z,{css:{fill:"white",width:"$10i",height:"$10i"}})})]}):null,(null==e?void 0:e.status)===M.RY&&iP||!(v||x)&&(null==e?void 0:e.splitEnabled)&&(null==e?void 0:e.allowedToSplit)&&!(null==e?void 0:e.offline)&&!iI(e)&&u?(0,l.jsxs)(c.xu,{onClick:i=>{if(null==i||i.stopPropagation(),$)C&&C();else{let n=()=>iR&&iR(e,z);O?ic(n,O):n()}},css:{backgroundColor:"$custom92",padding:"5px 10px",fontSize:"$7i",fontWeight:"$bold",color:"$custom93",borderRadius:"$pill",width:"112px"},children:["+"," ",z?"Edit split stay":"Add split stay"]}):null,iW&&I&&(null==I?void 0:I.price)&&(null==I?void 0:I.type)!==""&&(null==I?void 0:I.type)!=="INR"&&(null==I?void 0:I.type)!==void 0?(0,l.jsx)(c.xv,{css:{fontWeight:"$bolder",fontSize:"$7i",fontFamily:"$manrope"},children:(0,l.jsx)(T.Z,{value:null==I?void 0:I.price,defaultValue:"0",displayCurrency:null==I?void 0:I.type})}):null,W?(0,l.jsxs)(c.X2,{align:"center",css:{gap:"$2i",padding:"$i $3i",backgroundColor:"$grey100",borderRadius:"$2"},children:[(0,l.jsx)(c.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)(T.Z,{value:W})}),((null==e?void 0:e.status)===M.RY&&iP||!x)&&iZ?(0,l.jsx)(c.xu,{css:{curs
1or:u?iI(e)?"not-allowed":"pointer":"not-allowed",paddingTop:"$2i",pointerEvents:(null==e?void 0:e.status)===M.RY&&iP?"auto":u?"auto":"none"},onClick:i=>{if(null==i||i.preventDefault(),$)C&&C();else{var e,n;let l="/customize/".concat(null==w?void 0:null===(e=w.query)||void 0===e?void 0:e.regionCode,"/inclusions/rate-match/total-cost/TOTAL_COST/").concat(null==w?void 0:null===(n=w.query)||void 0===n?void 0:n.itineraryId);(0,V.Z)(l)}},children:(0,l.jsx)(d.Z,{})}):null]}):null]}),(0,l.jsxs)(c.X2,{align:"center",justify:"end",css:{gap:"$2i",display:"none","@lg":{display:"flex"}},children:[!ij||(null==e?void 0:e.offline)||iI(e)?null:(0,l.jsxs)(a.Lt.fC,{modal:!1,children:[(0,l.jsx)(a.Lt.xz,{asChild:!0,children:(0,l.jsxs)(c.X2,{css:{justifyContent:"center",alignItems:"center",borderRadius:"$2",border:v?"1px solid $grey300":"1px solid $grey500",backgroundColor:v?"$grey100":"$white",opacity:v?.7:1,overflow:"hidden",height:"34px",cursor:v?"not-allowed":"pointer"},children:[(0,l.jsx)(c.xu,{onClick:i=>{i.preventDefault()},css:{fontWeight:"$bold",fontSize:"$6ii",padding:"0 $2i"},children:(null==e?void 0:e.delayCheckOut)&&!(null==e?void 0:e.earlycheckIn)?"Late check-out":(null==e?void 0:e.earlycheckIn)&&!(null==e?void 0:e.delayCheckOut)?"Early check-in":(null==e?void 0:e.earlycheckIn)&&(null==e?void 0:e.delayCheckOut)?"Early check-in & Late ...":"Change dates"}),!v&&((null==e?void 0:e.earlycheckIn)||(null==e?void 0:e.delayCheckOut))?(0,l.jsx)(c.xu,{css:{padding:"$4i",backgroundColor:"$grey100",height:"100%"},children:(0,l.jsx)(d.Z,{})}):null]})}),!v&&(0,l.jsx)(a.Lt.VY,{css:{padding:"5px 0px",maxWidth:"160px",margin:"2px 0 0"},children:(0,l.jsxs)(c.sg,{children:[(0,l.jsx)(a.Lt.ck,{onClick:i=>{if(null==i||i.preventDefault(),null==i||i.stopPropagation(),$)C&&C();else{let n=()=>{var i;let n=(0,R.Z)(null==e?void 0:e.configKey);(null===(i=w.query)||void 0===i?void 0:i.configKey)||w.push({pathname:w.asPath,query:{configKey:(0,Y.Z)(e.configKey)}},void 0,{shallow:!0}),ib(n,(null==e?void 0:e.earlycheckIn)?"Remove":"Add"),ir({type:(null==e?void 0:e.earlycheckIn)?"Remove":"Add",show:!0,hotelName:null==e?void 0:e.name,cityName:null==e?void 0:e.cityName,delayCheckOutFlag:!1})};O?ic(n,O):n()}},children:(0,l.jsx)(c.xv,{children:(null==e?void 0:e.earlycheckIn)?"Remove early check in":"Add early check in"})}),(0,l.jsx)(a.Lt.ck,{onClick:i=>{if(null==i||i.preventDefault(),null==i||i.stopPropagation(),$)C&&C();else{let n=()=>{var i;let n=(0,R.Z)(null==e?void 0:e.configKey);iC(n,(null==e?void 0:e.delayCheckOut)?"Remove":"Late"),ir({type:(null==e?void 0:e.delayCheckOut)?"Remove":"Late",show:!0,hotelName:null==e?void 0:e.name,cityName:null==e?void 0:e.cityName,delayCheckOutFlag:!0}),(null===(i=w.query)||void 0===i?void 0:i.configKey)||w.push({pathname:w.asPath,query:{configKey:(0,Y.Z)(e.configKey)}},void 0,{shallow:!0})};O?ic(n,O):n()}},children:(0,l.jsx)(c.xv,{children:(null==e?void 0:e.delayCheckOut)?"Remove late check out":"Add late check out"})})]})})]}),(null==e?void 0:e.status)===M.MR&&(iP||iB)?(0,l.jsxs)(a.Lt.fC,{modal:!1,children:[(0,l.jsx)(a.Lt.xz,{asChild:!0,children:(0,l.jsx)(c.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold",cursor:"pointer"},children:(0,l.jsx)(s.Z,{})})}),(0,l.jsx)(a.Lt.VY,{css:{minWidth:"fit-content",padding:"$6i",zIndex:"$max",gap:"$6i",display:"flex",flexDirection:"column"},children:iB&&(null==e?void 0:null===(j=e.roomsInHotel)||void 0===j?void 0:j.length)>1?(0,l.jsx)(l.Fragment,{children:null==e?void 0:null===(b=e.roomsInHotel)||void 0===b?void 0:b.map((i,n)=>(0,l.jsxs)(c.X2,{onClick:n=>{n.preventDefault(),n.stopPropagation(),null==k||k("hotel",null==e?void 0:e.configKey,void 0,null==i?void 0:i.identifier)},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(r.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsxs)(c.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:["Add Add-on - Room-",n+1]})]},n))}):iB?(0,l.jsxs)(c.X2,{onClick:i=>{var n;i.preventDefault(),i.stopPropagation(),null==k||k("hotel",null==e?void 0:e.configKey,void 0,null===(n=null==e?void 0:e.roomsInHotel[0])||void 0===n?void 0:n.identifier)},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(r.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsx)(c.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:"Add Add-on"})]}):null})]}):null,iI(e)?null:(0,l.jsx)(a.u,{content:"View Details",children:(0,l.jsx)(c.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold",cursor:"SOLD_OUT"===e.status?"not-allowed":"auto"},onClick:i=>{$?C&&C():"SOLD_OUT"!==e.status&&(null==i||i.preventDefault(),null==i||i.stopPropagation(),iI(e)||iy(e.configKey))},children:(0,l.jsx)(t.Z,{})})}),iP&&(null==e?void 0:e.status)==="SOLD_OUT"?(0,l.jsx)(c.zx,{onClick:()=>{let i=()=>iM(null==e?void 0:e.configKey,null==e?void 0:e.entityType);O?ic(i,O):i()},secondary:!0,outlined:!0,css:{backgroundColor:"$white",border:"1px solid $red400",boxShadow:"none",color:"$black","&:hover":{boxShadow:"none"}},children:"Discard"}):u?(0,l.jsx)(c.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),$)C&&C();else{let n=()=>i$(e.configKey,D,e.text);O?ic(n,O):n()}},secondary:D,outlined:!0,disabled:!!D&&!!v||e.status===M.MR&&!!v||((null==e?void 0:e.status)!==M.RY||!iP)&&!iP&&(x||v),css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(c.xv,{css:{fontWeight:"$bold"},children:D?"Edit Card":e.status===M.MR||(null==e?void 0:e.status)===M.RY&&iP?"Change Hotel":"Add Hotel"})}):null]})]})]})}),e.status===M.MR||(null==e?void 0:e.status)===M.RY&&iP?(0,l.jsxs)(c.xu,{children:[(0,l.jsx)(Q.ZP,{hotel:e,alerts:iw(i),room:null==e?void 0:e.roomsInHotel[0],onClick:i=>{null==i||i.preventDefault(),null==i||i.stopPropagation(),$?C&&C():iI(e)||iy(e.configKey)},regionCode:f,isBooked:x,subLineitemAddon:L}),(0,l.jsxs)(c.X2,{css:{padding:"$8i $8i 0 $8i",justifyContent:W?"space-between":"flex-end",alignItems:"center","@lg":{display:"none"}},children:[W?(0,l.jsx)(c.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)(T.Z,{value:W})}):null,(0,l.jsxs)(c.X2,{align:"center",justify:"end",css:{gap:"$2i"},children:[(0,l.jsx)(c.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white"},onClick:i=>{null==i||i.preventDefault(),null==i||i.stopPropagation(),$?C&&C():iI(e)||iy(e.configKey)},children:(0,l.jsx)(c.xv,{css:{fontWeight:"$bold"},children:"View Details"})}),u?(0,l.jsx)(c.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),$)C&&C();else{let n=()=>i$(e.configKey);O?ic(n,O):n()}},secondary:D,outlined:!0,css:{backgroundColor:"$white"},children:(0,l.jsx)(c.xv,{css:{fontWeight:"$bold"},children:D?"Edit Card":e.status===M.MR?"Change Hotel":"Add Hotel"})}):null]})]})]}):(0,l.jsxs)(c.kC,{css:{justifyContent:"space-between",flexDirection:"column",padding:"$12i $8i 0 $8i",gap:"$12i","@lg":{padding:"$12i $8i",flexDirection:"row"}},children:[(0,l.jsxs)(c.kC,{css:{alignItems:"center","@lg":{width:"50%"}},children:[(0,l.jsx)(o.Z,{css:{fill:"$custom43",marginRight:"$2i",height:"$8i",width:"$8i","@lg":{height:"$12i",width:"$12i"}}}),(0,l.jsx)(c.xv,{css:{display:"block",fontSize:"$7ii",lineHeight:"$9i",color:"$grey09"},children:"Hotel is unavailable. Try again"})]}),(0,l.jsxs)(c.X2,{align:"center",justify:"end",css:{gap:"$2i"},children:[iW&&!(v||x)?(0,l.jsx)(c.zx,{secondary:!0,outlined:!0,disabled:iP&&(null==e?void 0:e.status)===M.js||!1,css:{backgroundColor:"$white"},onClick:()=>
1{if($)C&&C();else{var i;let n=(0,Y.Z)(null==e?void 0:e.configKey),l="/customize/".concat(null==w?void 0:null===(i=w.query)||void 0===i?void 0:i.regionCode,"/view/").concat(w.query.itineraryId,"/block-card/hotel/").concat(n);(0,V.Z)(l)}},children:(0,l.jsx)(c.xv,{css:{fontWeight:"$bold"},children:"Add Custom Item"})}):null,iP||u?(0,l.jsx)(c.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),$)C&&C();else{let n=()=>i$(e.configKey);O?ic(n,O):n()}},secondary:!0,outlined:!0,css:{backgroundColor:"$white","@lg":{display:"none"}},children:(0,l.jsx)(c.xv,{css:{fontWeight:"$bold"},children:"Add Hotel"})}):null]})]}),e.status===M.MR&&(0,N.P)({permissions:null==S?void 0:S.permissions,key:X.Gz})&&iA?(0,l.jsx)(io.Z,{entity:e.entityType,configKey:e.configKey,costingId:e.costingId}):null]}),iA?null:(0,l.jsx)(B.Z,{alertData:iS(i),isBooked:x,islandBooked:v,title:null==e?void 0:e.text,configKey:null==e?void 0:e.configKey,hasSubLineitemAddon:O})]},i)}}),is.show?(0,l.jsx)(W,{open:is.show,buttonClickAction:ik,itinerayId:"",earlyCheckIn:is.type,delayCheckOut:"Late"==is.type,cityName:is.cityName,hotelName:is.hotelName,data:D,onCloseModal:i=>{ir({...is,show:i}),w.push({pathname:w.asPath.split("?")[0],query:{}},void 0,{shallow:!0})},isLoading:Z}):null,iT&&(0,l.jsx)(J,{open:null==iT?void 0:iT.open,setOpen:()=>iD(i=>({...i,open:!i.open})),data:iT}),(0,l.jsx)(a.Vq.fC,{open:id,onOpenChange:()=>{ia(!1)},children:(0,l.jsxs)(a.Vq.VY,{overlayZindex:"$2",css:{maxWidth:"400px",padding:"$8i",borderRadius:"$3",zIndex:"$max"},children:[(0,l.jsx)(c.xu,{css:{fontSize:"$9i",fontWeight:"$bold",color:"$grey900",marginBottom:"$6i",display:"flex",alignItems:"center",gap:"$3i"},children:"Alert: Cannot be cancelled"}),(0,l.jsx)(c.xu,{css:{fontSize:"$6i",color:"$grey900",marginBottom:"$6i",lineHeight:"$10i",fontFamily:"$manrope",fontWeight:"$semiBold"},children:"This hotel has an add-on attached to it, please cancel the add-on first and then proceed with hotel cancellation/change."}),(0,l.jsx)(c.X2,{css:{gap:"$3i",justifyContent:"flex-end"},children:(0,l.jsx)(c.zx,{onClick:()=>{ia(!1)},css:{backgroundColor:"$primary05",color:"$white"},children:"Ok"})})]})})]})};var is=it},74734:function(i,e,n){var l=n(85893),o=n(39396),t=n(25675),s=n.n(t);n(67294);var r=n(25171);let d=i=>{let{src:e,width:n=300,height:t=232,mobWidth:d=200,mobHeight:a=144}=i;return(0,l.jsxs)(o.xu,{css:{position:"relative",width:"auto",height:"auto",minWidth:d,overflow:"hidden","@lg":{minWidth:n}},children:[(0,l.jsx)(s(),{src:e,alt:"Hotel backdrop",fill:!0,style:{objectFit:"cover",filter:"blur(5px) brightness(0.9)"}}),(0,l.jsx)(o.xu,{css:{position:"absolute",inset:0,pointerEvents:"none",background:"linear-gradient(0deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0.5) 100%)"}}),(0,l.jsx)(o.xu,{css:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:(0,l.jsx)(o.xu,{css:{position:"relative",width:d,height:a,"@lg":{width:n,height:t}},children:(0,l.jsx)(r.Z,{src:e,alt:"inclusion-image",className:"image",fill:!0,style:{objectFit:"cover"}})})})]})};e.Z=d},27723:function(i,e,n){n.d(e,{Z:function(){return E}});var l=n(85893),o=n(13400),t=n(4327),s=n(65367),r=n(10206),d=n(39396),a=n(70024),c=n(11163),u=n(67294),g=n(51490),h=n(88767);let p=async(i,e,n)=>await e({url:"insurance/".concat(i.itineraryId,"/").concat(i.key),method:"POST",body:i,signal:n}),x=i=>{let e=(0,g.wh)(),{mutate:n,mutateAsync:l,...o}=(0,h.useMutation)(i=>p(i,e,void 0),i);return{addInsurance:n,addInsuranceAsync:l,...o}},v=async(i,e,n)=>await e({url:"insurance/".concat(i.itineraryId,"/").concat(i.key),method:"DELETE",body:i,signal:n}),m=i=>{let e=(0,g.wh)(),{mutate:n,mutateAsync:l,...o}=(0,h.useMutation)(i=>v(i,e,void 0),i);return{deleteCustomerInsurance:n,deleteCustomerInsuranceAsync:l,...o}};var f=n(37880),y=n(16977),$=n(90083),j=n(25077),b=n(6478),C=n(16124),k=n(44950),w=n(39502),S=n(54806),I=n(68991),T=n(11301),D=n(65732),R=n(27627),z=n(67405),W=n(74734),Z=n(47564);let A=i=>{let{content:e}=i;return(0,l.jsx)(d.X2,{css:{backgroundColor:"$yellow50",padding:"$6i",transition:"all .2s ease-in-out",flex:1},children:(0,l.jsxs)(d.xv,{css:{fontSize:"$7i",lineHeight:"$10i",color:"$grey700",fontWeight:500},children:[(0,l.jsx)("span",{style:{color:"#704900",fontWeight:700},children:"Note: "}),e]})})};var P=n(35591),B=n(76522);let M=i=>{var e;let{costing:n,alerts:g,itineraryInfo:h,campaignItinerary:p,openGcmAction:v,islandBooked:M}=i,[E,L]=(0,u.useState)(!1),{lineItemDiscardAsync:O}=(0,f.h)(),H=(0,a.Dv)(k.s1),F=(0,C.Z)(),K=(0,S.Z)(),Y=(0,c.useRouter)(),[_,q]=(0,u.useState)(!1),N=(i,e)=>{e?q(!0):i()},V=(0,u.useMemo)(()=>Y.query.itineraryId||"",[Y.query]),U=(0,a.b9)(k.w4),X=(0,u.useMemo)(()=>{var i;return!!(null==h?void 0:null===(i=h.itinerary)||void 0===i?void 0:i.booking)},[h]),G=(0,u.useMemo)(()=>{var i;return null==h?void 0:null===(i=h.itinerary)||void 0===i?void 0:i.landPackageBooked},[h]),J=(0,u.useMemo)(()=>{var i;return(null==h?void 0:null===(i=h.insuranceCosting)||void 0===i?void 0:i.costingById)||""},[h]),Q=(0,u.useMemo)(()=>{var i,e;return(null==h?void 0:null===(i=h.costingConfiguration)||void 0===i?void 0:null===(e=i.hotelGuestRoomConfigurations)||void 0===e?void 0:e.reduce((i,e)=>i+(e.adultCount||0),0))||0},[h]),ii=(0,u.useMemo)(()=>(null==H?void 0:H.loggedIn)&&(M||X)?(0,D.P)({permissions:null==H?void 0:H.permissions,key:R.yj}):(0,D.P)({key:R.TX,permissions:null==H?void 0:H.permissions}),[null==H?void 0:H.loggedIn,null==H?void 0:H.permissions,M,X]),ie=(0,u.useMemo)(()=>{var i,e;return(null==h?void 0:null===(i=h.costingConfiguration)||void 0===i?void 0:null===(e=i.hotelGuestRoomConfigurations)||void 0===e?void 0:e.reduce((i,e)=>{var n;return i+((null===(n=e.childAges)||void 0===n?void 0:n.length)||0)},0))||0},[h]),il=(0,u.useMemo)(()=>(null==H?void 0:H.loggedIn)&&G&&(0,D.P)({permissions:null==H?void 0:H.permissions,key:R.yj}),[G,null==H?void 0:H.loggedIn,null==H?void 0:H.permissions]),io=Q+ie,it=(0,u.useMemo)(()=>{var i,e;return(null===(i=Object.values(J))||void 0===i?void 0:null===(e=i[0])||void 0===e?void 0:e.configKey)||""},[J]),is=(0,D.P)({key:R.XW,permissions:null==H?void 0:H.permissions}),{addInsuranceAsync:ir}=x(),id=async()=>{try{let i=await ir({key:null!=it?it:"",include:!0,itineraryId:V.toString(),method:"post"});(null==i?void 0:i.status)==="SUCCESS"&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),U(i))}catch(e){console.error({error:e}),(null==e?void 0:e.code)==403&&o.ZP.error("Don't have permission to add insurance")}},ia=(0,u.useCallback)(i=>{var e,n;return(null===(e=null==g?void 0:null===(n=g[i])||void 0===n?void 0:n.filter(i=>{var e;return(!i.inventory||(null===(e=i.inventory)||void 0===e?void 0:e.includes("LINE_ITEM_CARD")))&&i}))||void 0===e?void 0:e.filter(i=>!i.hasOwnProperty("privateAlert")||(null==i?void 0:i.privateAlert)===!1).map(i=>i))||[]},[g]),{deleteCustomerInsuranceAsync:ic}=m(),iu=(0,u.useCallback)(async()=>{try{let i=await ic({key:null!=it?it:"",include:!1,itineraryId:V.toString(),method:"delete"});(null==i?void 0:i.status)==="SUCCESS"&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),U(i))}catch(e){}},[ic,it,V,U]),ig=(0,u.useCallback)(async(i,e)=>{try{var n;let l=await O({configKey:i,entityType:e,itineraryId:"".concat(null===(n=Y.query)||void 0===n?void 0:n.itineraryId)});(null==l?void 0:l.status)==="SUCCESS"&&(null==l?void 0:l.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),U(l))}catch(o){console.error({error:o})}},[O,null==Y?void 0:null===(e=Y.query)||void 0===e?void 0:e.itineraryId,U]),ih=(0,u.useCallback)(i=>{Y.query.m!==i&&Y.push({pathname:Y.asPath,query:{m:i}},void 0,{shallow:!0})},[Y]);return(0,l.jsxs)(u.Fragment,{children:[u.Children.toArray(Object.keys(n).map(i=>{var e,o,t,a,c,u,x,m;let f=n[i],C=null!==(m=null==f?void 0:null===(e=f.plansList)||void 0===e?void 0:e.some(i=>(null==i?void 0:i.bookedInsurance)||(null==i?void 0:i.bookingStatus)==="Booked"))&&void 0!==m&&m,k=null==h?void 0:null===(o=h.customCostings)||void 0===o?void 0:o.filter(i=>"INSURANCE"===i.customCardEntity&&"CUSTOM"===i.entityType),S=(null==k?void 0:k.filter(i=>(null==i?void 0:i.parentCostingId)===f.costingId))||[],E=(null==H?void 0:H.loggedIn)?(0,T.Z)({publishedCost:null==f?void 0:f.publishedCost,ourCost:null==f?void 0:f.ourCost,userDetails:H}):0,O=[];null==g||null===(t=g[i])||void 0===t||t.map(i=>{O.push(i.message)});let _=S&&(null===(a=null==S?void 0:S.filter(i=>i.status===b.MR))||void 0===a?void 0:a.length)>0||!1;return(null==f?void 0:f.status)===b.ew?(0,l.jsx)(Z.Z,{title:"Travel insurance for ".concat(null==f?void 0:null===(c=f.countries)||void 0===c?void 0:c.join(", ")," "),type:w.WK.INSURANCE,entity:null==f?void 0:f.entityType}):(0,l.jsxs)(d.xu,{as:"section",css:{maxWidth:722,marginTop:"$8i","@lg":{marginTop:0}},children:[(0,l.jsx)(d.xu,{onClick:i=>{null==i||i.preventDefault()},as:"section",children:(0,l.jsxs)(d.xu,{css:{display:"flex",flexDirection:"column",color:"$grey09",background:"$white",overflow:"hidden",borderRadius:"$4","@lg":{borderRadius:"$4",border:(null==f?void 0:f.status)===b.RY&&il?"1px dashed $pyellow800":"1px solid $grey100",boxShadow:"none",padding:0,"&:hover .alert-message":{backgroundColor:"$yellow00"}}},children:[(0,l.jsx)(d.xu,{as:"div",css:{background:"$white",width:"100%"},children:(0,l.jsxs)(d.xu,{css:{display:"flex",flexDirection:"column","@lg":{flexDirection:"row"}},children:[(0,l.jsx)(d.xu,{css:{"@lg":{display:"block",height:"auto","&>div":{height:"100%"}}},children:(0,l.jsx)(W.Z,{src:(0,I.Z)("https://images.pickyourtrail.com/images/costing_screen/placeholder/desktop/insurance.png","w=250&h=180&fit=crop&auto=format,compress,enhance&q=20")})}),(0,l.jsxs)(d.xu,{css:{padding:"0 $8i $8i",width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start","@lg":{display:"block"}},children:[(0,l.jsx)(d.kC,{css:{backgroundColor:"$white",borderRadius:"$2i $2i 0 0","@lg":{padding:"$8i 0 $8i 0",backgroundColor:(null==f?void 0:f.status)===b.RY&&il?"$pyellow100":"$white"}},children:(0,l.jsxs)(d.kC,{css:{justifyContent:"space-between",flexGrow:1,paddingTop:"$8i","@lg":{alignItems:"center",padding:0}},children:[(0,l.jsx)(d.xu,{css:{width:"65%",display:"none","@lg":{display:"block",marginLeft:"-8px"}},children:(0,l.jsx)(z.Z,{title:"Travel insurance for ".concat(null==f?void 0:null===(u=f.countries)||void 0===u?void 0:u.join(", ")," "),type:w.WK.INSURANCE})}),(0,l.jsxs)(d.xu,{css:{display:"none","@lg":{display:"flex",alignItems:"end",rowGap:"$4i",flexDirection:"column"}},children:[E?(0,l.jsx)(d.X2,{align:"center",css:{gap:"$3i"},children:(0,l.jsx)(d.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)($.Z,{value:E})})}):null,(0,l.jsxs)(d.X2,{align:"center",justify:"center",css:{gap:"$2i"},children:[(il||ii)&&(null==f?void 0:f.status)===b.MR?(0,l.jsxs)(r.Lt.fC,{modal:!1,children:[(0,l.jsx)(r.Lt.xz,{asChild:!0,children:(0,l.jsx)(d.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold",cursor:"pointer"},children:(0,l.jsx)(s.Z,{})})}),(0,l.jsx)(r.Lt.VY,{css:{minWidth:"fit-content",padding:"$6i",zIndex:"$max",gap:"$6i",display:"flex",flexDirection:"column"}})]}):null,(null==f?void 0:f.required)?(0,l.jsx)(d.zx,{disabled:(X||G)&&(null==f?void 0:f.status)===b.MR,onClick:()=>
1{if(p)v&&v();else{let i=()=>iu();N(i,_)}},danger:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(d.xv,{css:{fontWeight:"$bold"},children:"Remove"})}):null,il&&(null==f?void 0:f.status)==="SOLD_OUT"?(0,l.jsx)(d.zx,{onClick:()=>ig(null==f?void 0:f.configKey,null==f?void 0:f.entityType),secondary:!0,outlined:!0,css:{backgroundColor:"$white",border:"1px solid $red400",boxShadow:"none",color:"$black","&:hover":{boxShadow:"none"}},children:"Discard"}):(null==f?void 0:f.required)?(0,l.jsx)(d.zx,{disabled:C||(G||X)&&!il,onClick:i=>{if(i.preventDefault(),i.stopPropagation(),p)v&&v();else{let e=()=>{Y.push({pathname:Y.asPath,query:{m:"change-insurance"}},void 0,{shallow:!0})};N(e,_)}},primary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(d.xv,{css:{fontWeight:"$bold"},children:"Change"})}):(0,l.jsx)(d.zx,{disabled:!ii&&(X||G),onClick:i=>{if(i.preventDefault(),i.stopPropagation(),p)v&&v();else if(G)L(!0);else{let e=()=>id();N(e,_)}},secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(d.xv,{css:{fontWeight:"$bold"},children:"Add"})})]})]})]})}),(0,l.jsx)(d.iz,{css:{backgroundColor:"$m_custom48",display:"none","@lg":{display:"block"}}}),(0,l.jsx)(d.xu,{css:{textAlign:"right",marginTop:"$3i",marginBottom:"$5i",display:"none","@lg":{display:"block"}},children:(0,D.P)({key:R.Gw,permissions:null==H?void 0:H.permissions})&&(null==f?void 0:f.lastDataUpdatedMillis)?(0,l.jsx)(P.Z,{text:"Last updated ".concat(K.getDaysDiffWithYears(f.lastDataUpdatedMillis)," ago")}):null}),(0,l.jsxs)(d.xu,{children:[n[i].status===b.MR?(0,l.jsx)(d.xv,{css:{fontSize:"$9i",marginBottom:"$6i",lineHeight:1.33,color:"$grey11",fontWeight:"$bolder",display:"none","@lg":{color:"$grey09",fontWeight:"$normal"}},children:f.plan}):null,(0,l.jsx)(d.xu,{css:{display:"block",marginLeft:"-8px","@lg":{display:"none"}},children:(0,l.jsx)(z.Z,{type:w.WK.INSURANCE,title:"Travel insurance for ".concat(null==f?void 0:null===(x=f.countries)||void 0===x?void 0:x.join(", ")," ")})}),(0,l.jsx)(d.xv,{css:{lineHeight:"$10i",paddingBottom:"$2i",color:"$grey950",fontWeight:600,fontSize:"$7i","@lg":{fontSize:"$7i",lineHeight:"$10i",color:"$grey950",fontWeight:600,marginBottom:"$2i"}},children:f&&f.plansList&&f.plansList.length>0&&(0,l.jsx)(d.xu,{children:"".concat(f.plansList[0].insuranceName," for ").concat(io," ").concat(io>1?"people":"person")})}),(0,l.jsx)(d.xv,{css:{marginBottom:"$6i",fontSize:"$7i",lineHeight:"$10i",fontWeight:500,color:"$800"},children:f.required?"This is the average cost. Depending on the actual age of the travellers, the final cost will vary. We will update you when it does — rest assured.":"Add Insurance to save on un-planned emergencies like lost passport, medical emergency, lost baggage etc. On an average it costs less than 20 Euros per person. Make a smart choice now."})]})]})]})}),f.required?(0,l.jsx)(A,{content:"Insurance prices are purely based on the age band you fall under. Prices might change once you input your age details in the next screen."}):null,f.required&&(0,D.P)({permissions:null==H?void 0:H.permissions,key:R.Gz})&&F?(0,l.jsx)(B.Z,{entity:f.entityType,configKey:f.configKey,costingId:f.costingId,isBooked:X,isLandBooked:G,isAdmin:is,isSuccess:(null==f?void 0:f.status)===b.MR}):(0,l.jsx)(l.Fragment,{children:f.required&&(null==f?void 0:f.status)===b.MR&&(0,D.P)({permissions:null==H?void 0:H.permissions,key:R.Gz})&&is&&(G||X)?(0,l.jsx)(d.kC,{css:{display:"none",padding:"0 $6i","@lg":{backgroundColor:"$pblue100",justifyContent:"flex-end",alignItems:"center",minHeight:"$28i",padding:"$8i $6i",display:"flex",borderRadius:"0 0 $2 $2",width:"100%"}},onClick:i=>{i.stopPropagation(),i.preventDefault()},children:(0,l.jsx)(d.zx,{onClick:()=>{ih("edit-hod")},css:{borderRadius:6,background:"$green05",padding:"6px 15px",height:"$18i"},children:"Book Insurance"})}):null}),(null==S?void 0:S.length)?(0,l.jsx)(d.sg,{css:{gap:"$8i",padding:"$8i"},children:null==S?void 0:S.map((i,e)=>{var n;return(0,l.jsx)(d.xu,{children:(0,l.jsx)(y.Z,{image:(null==i?void 0:null===(n=i.images)||void 0===n?void 0:n[0])||"https://images.pickyourtrail.com/image_placeholder_2eca9cbf61.png",title:null==i?void 0:i.title,subtitle:null==i?void 0:i.description,price:null==i?void 0:i.ourCost,tag:"Addon",costingId:null==i?void 0:i._id,status:null==i?void 0:i.status,entityType:"".concat(null==i?void 0:i.customCardEntity)})},e)})}):null,(0,l.jsxs)(d.X2,{css:{padding:"$8i",justifyContent:E?"space-between":"flex-end",alignItems:"center","@lg":{display:"none"}},children:[E?(0,l.jsx)(d.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)($.Z,{value:E})}):null,(0,l.jsxs)(d.X2,{align:"center",justify:"end",css:{gap:"$2i"},children:[f.required?(0,l.jsx)(d.zx,{disabled:X||G,onClick:()=>
1{if(p)v&&v();else{let i=()=>iu();N(i,_)}},danger:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(d.xv,{css:{fontWeight:"$bold"},children:"Remove"})}):null,f.required?(0,l.jsx)(d.zx,{disabled:C||(G||X)&&!il,onClick:i=>{if(i.preventDefault(),i.stopPropagation(),p)v&&v();else{let e=()=>{Y.push({pathname:Y.asPath,query:{m:"change-insurance"}},void 0,{shallow:!0})};N(e,_)}},primary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(d.xv,{css:{fontWeight:"$bold"},children:"Change"})}):(0,l.jsx)(d.zx,{disabled:X||G,onClick:i=>{if(i.preventDefault(),i.stopPropagation(),p)v&&v();else{let e=()=>id();N(e,_)}},secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(d.xv,{css:{fontWeight:"$bold"},children:"Add"})})]})]})]})}),!F&&(0,l.jsx)(j.Z,{alertData:ia(f.configKey),isBooked:X,islandBooked:M,configKey:f.configKey})]})})),E?(0,l.jsx)(r.Vq.fC,{open:E,onOpenChange:()=>null,children:(0,l.jsx)(r.Vq.VY,{css:{minWidth:"280px",display:"inline-flex",backgroundColor:"white",borderRadius:"$4",padding:"$12i","& > button":{display:"none"}},children:(0,l.jsxs)(d.sg,{css:{flex:1,display:"flex"},children:[(0,l.jsxs)(d.X2,{justify:"between",children:[(0,l.jsx)(d.xv,{css:{fontSize:"$9i",color:"$grey12",fontWeight:"$bold",fontFamily:"$manrope",lineHeight:"$10i"},children:"Alert"}),(0,l.jsx)(t.Z,{cursor:"pointer",css:{"@lg":{width:"$8i",height:"$8i"}},onClick:()=>{L(!1)}})]}),(0,l.jsx)(d.kC,{align:"center",css:{padding:"$16i 0"},children:(0,l.jsx)(d.xv,{css:{fontSize:"$7i",color:"$grey12",fontWeight:"$normal",lineHeight:"$10i",fontFamily:"$manrope"},children:"Are you sure you want to add ?"})}),(0,l.jsx)(d.X2,{justify:"end",children:(0,l.jsx)(d.zx,{onClick:()=>{L(!1),id()},css:{fontSize:"$7i",color:"$white",fontWeight:"$bold"},children:"Proceed"})})]})})}):null,(0,l.jsx)(r.Vq.fC,{open:_,onOpenChange:()=>{q(!1)},children:(0,l.jsxs)(r.Vq.VY,{overlayZindex:"$2",css:{maxWidth:"400px",padding:"$8i",borderRadius:"$3",zIndex:"$max"},children:[(0,l.jsx)(d.xu,{css:{fontSize:"$9i",fontWeight:"$bold",color:"$grey900",marginBottom:"$6i",display:"flex",alignItems:"center",gap:"$3i"},children:"Alert: Cannot be cancelled"}),(0,l.jsx)(d.xu,{css:{fontSize:"$6i",color:"$grey900",marginBottom:"$6i",lineHeight:"$10i",fontFamily:"$manrope",fontWeight:"$semiBold"},children:"This insurance has an add-on attached to it, please cancel the add-on first and then proceed with insurance cancellation/change."}),(0,l.jsx)(d.X2,{css:{gap:"$3i",justifyContent:"flex-end"},children:(0,l.jsx)(d.zx,{onClick:()=>{q(!1)},css:{backgroundColor:"$primary05",color:"$white"},children:"Ok"})})]})})]})};var E=M},61976:function(i,e,n){var l=n(85893),o=n(56512),t=n(62736),s=n(45479),r=n(65367),d=n(71256),a=n(91838),c=n(51969),u=n(10206),g=n(39396),h=n(70024),p=n(11163),x=n(67294),v=n(37880),m=n(16977),f=n(90083),y=n(25077),$=n(6478),j=n(16124),b=n(75291),C=n(44950),k=n(39502),w=n(54806),S=n(76622),I=n(68991),T=n(11301),D=n(65732),R=n(96053),z=n(93290),W=n(27627),Z=n(32459),A=n(67405),P=n(74734),B=n(47564),M=n(22623),E=n(20487),L=n(35591);let O=(i,e,n,l)=>{let o=[],t=new Date(n),s=new Date(l);return o.push({icon:"included",text:"Pickup from "+i+" @"+t.getHours()+":"+t.getMinutes()}),o.push({icon:"included",text:"Drop at "+e+" @"+s.getHours()+":"+s.getMinutes()}),o},H=(i,e,n,t,s,r)=>{let a=[];return a.push({icon:(0,l.jsx)(o.Z,{css:{fill:"$grey09"}}),text:t?s:"SUV"}),r||a.push({icon:(0,l.jsx)(c.Z,{css:{fill:"$grey09"}}),text:"".concat(n," Transmission")}),t||a.push({icon:(0,l.jsx)(d.Z,{css:{fill:"$grey09"}}),text:"".concat(i," passengers in ").concat(e," vehicle")}),a},F=i=>{var e;let{rentalCarRefs:n,costingById:o,alerts:d,isBooked:c,islandBooked:F,campaignItinerary:K,openGcmAction:Y,onClickAddonLineItem:_}=i,q=(0,w.Z)(),N=[],V=(0,p.useRouter)(),U=(0,h.Dv)(C.s1),X=(0,h.b9)(C.w4),G=(0,b.Z)(),{lineItemDiscardAsync:J}=(0,v.h)(),Q=(0,j.Z)(),[ii,ie]=(0,x.useState)(!1),il=(i,e)=>{e?ie(!0):i()},io=(0,D.P)({key:W.d5,permissions:null==U?void 0:U.permissions}),it=(0,x.useMemo)(()=>!!(U&&(null==U?void 0:U.loggedIn)&&(0,D.P)({key:W.Dp,permissions:null==U?void 0:U.permissions})),[U]),is=(0,x.useMemo)(()=>(null==U?void 0:U.loggedIn)&&F&&(0,D.P)({permissions:null==U?void 0:U.permissions,key:W.yj}),[F,null==U?void 0:U.loggedIn,null==U?void 0:U.permissions]),ir=(0,x.useCallback)(i=>{var e,n;return(null===(e=null==d?void 0:null===(n=d[i])||void 0===n?void 0:n.filter(i=>{var e;return(!i.inventory||(null===(e=i.inventory)||void 0===e?void 0:e.includes("LINE_ITEM_CARD")))&&i}))||void 0===e?void 0:e.filter(i=>!i.hasOwnProperty("privateAlert")||(null==i?void 0:i.privateAlert)===!1).map(i=>i))||[]},[d]),id=(0,x.useCallback)(async(i,e)=>{try{var n;let l=await J({configKey:i,entityType:e,itineraryId:"".concat(null===(n=V.query)||void 0===n?void 0:n.itineraryId)});(null==l?void 0:l.status)==="SUCCESS"&&(null==l?void 0:l.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),X(l))}catch(o){console.error({error:o})}},[J,null==V?void 0:null===(e=V.query)||void 0===e?void 0:e.itineraryId,X]),ia=(0,x.useMemo)(()=>(null==U?void 0:U.loggedIn)&&(F||c)?(0,D.P)({permissions:null==U?void 0:U.permissions,key:W.yj}):(0,D.P)({key:W.TX,permissions:null==U?void 0:U.permissions}),[null==U?void 0:U.loggedIn,null==U?void 0:U.permissions,F,c]);return(0,l.jsxs)(l.Fragment,{children:[x.Children.toArray(Object.values(n).map(i=>{var e,n,h;let p=o[i],x=null==G?void 0:null===(e=G.customCostings)||void 0===e?void 0:e.filter(i=>"RENTALCAR"===i.customCardEntity&&"CUSTOM"===i.entityType),v=null==x?void 0:x.filter(i=>(null==i?void 0:i.parentCostingId)===p.costingId),j=v&&(null===(n=null==v?void 0:v.filter(i=>i.status===$.MR))||void 0===n?void 0:n.length)>0||!1,b=(null==U?void 0:U.loggedIn)?(0,T.Z)({publishedCost:null==p?void 0:p.publishedCost,ourCost:null==p?void 0:p.ourCost,userDetails:U}):0,C=p.chauffeur,w=parseInt("".concat(null==p?void 0:p.duration),10);return(0,l.jsxs)(g.xu,{as:"section",css:{marginTop:"$8i","@lg":{marginTop:0}},children:[(null==p?void 0:p.status)===$.ew?(0,l.jsx)(B.Z,{type:k.WK.RENT_CAR,title:C&&w?"Car with Chauffeur for ".concat(w," ").concat((0,R.Z)({count:w,keyword:"day"})):"Rental car from ".concat(null==p?void 0:p.pickup," ").concat(w?"for ".concat(w," ").concat((0,R.Z)({count:w,keyword:"day"})):""),startDate:p?p.pickupDayOfWeek+", "+p.pickupMonth+" "+p.pickupDate:"",endDate:(null==p?void 0:p.dropDayOfWeek)&&(null==p?void 0:p.dropMonth)&&(null==p?void 0:p.dropDate)?(null==p?void 0:p.dropDayOfWeek)+", "+(null==p?void 0:p.dropMonth)+" "+(null==p?void 0:p.dropDate):"",entity:null==p?void 0:p.entityType}):(0,l.jsxs)(g.xu,{css:{display:"flex",flexDirection:"column",color:"$grey09",background:"$white",overflow:"hidden",boxShadow:"0 $fontSizes$i $fontSizes$3i 0 $colors$grey02",padding:"$8i 0",cursor:"pointer","@lg":{borderRadius:"$3",border:(null==p?void 0:p.status)===$.RY&&is?"1px dashed $pyellow800":"1px solid $custom18",boxShadow:"none",padding:0,"&:hover":{borderColor:(null==p?void 0:p.status)===$.RY&&is?"$pyellow800":"$primary04"},"&:hover .alert-message":{backgroundColor:"$yellow00"}}},children:[(0,l.jsx)(g.kC,{css:{minHeight:"$16i",backgroundColor:"$white",borderRadius:"$2i $2i 0 0","@lg":{padding:"$8i 0",minHeight:"$36i",backgroundColor:(null==p?void 0:p.status)===$.RY&&is?"$pyellow100":"$pblue100"}},children:(0,l.jsxs)(g.kC,{css:{justifyContent:"space-between",flexGrow:1,padding:"0 0 $4i 0","@lg":{padding:"0 $8i 0 0",alignItems:"center"}},children:[(0,l.jsx)(A.Z,{type:k.WK.RENT_CAR,title:C&&w?"Car with Chauffeur for ".concat(w," ").concat((0,R.Z)({count:w,keyword:"day"})):"Rental car from ".concat(null==p?void 0:p.pickup," ").concat(w?"for ".concat(w," ").concat((0,R.Z)({count:w,keyword:"day"})):""),startDate:p?p.pickupDayOfWeek+", "+p.pickupMonth+" "+p.pickupDate:"",endDate:(null==p?void 0:p.dropDayOfWeek)&&(null==p?void 0:p.dropMonth)&&(null==p?void 0:p.dropDate)?(null==p?void 0:p.dropDayOfWeek)+", "+(null==p?void 0:p.dropMonth)+" "+(null==p?void 0:p.dropDate):""}),(0,l.jsxs)(g.xu,{css:{display:"none","@lg":{display:"flex",alignItems:"end",rowGap:"$4i",flexDirection:"column"}}
1,children:[b?(0,l.jsxs)(g.X2,{align:"center",css:{gap:"$3i"},children:[(0,l.jsx)(g.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)(f.Z,{value:b})}),((null==p?void 0:p.status)!==$.RY||!is)&&(c||!io||(null==p?void 0:p.isBundled))?null:(0,l.jsx)(g.xu,{css:{cursor:"pointer",paddingTop:"$2i"},onClick:()=>{if(K)Y&&Y();else{var i,e;let n="/customize/".concat(null==V?void 0:null===(i=V.query)||void 0===i?void 0:i.regionCode,"/inclusions/rate-match/total-cost/TOTAL_COST/").concat(null==V?void 0:null===(e=V.query)||void 0===e?void 0:e.itineraryId);(0,z.Z)(n)}},children:(0,l.jsx)(s.Z,{})})]}):null,(0,l.jsxs)(g.X2,{children:[(0,l.jsxs)(g.X2,{align:"center",justify:"center",css:{gap:"$2i"},children:[(is||ia)&&(null==p?void 0:p.status)===$.MR?(0,l.jsxs)(u.Lt.fC,{modal:!1,children:[(0,l.jsx)(u.Lt.xz,{asChild:!0,children:(0,l.jsx)(g.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold",cursor:"pointer"},children:(0,l.jsx)(r.Z,{})})}),(0,l.jsx)(u.Lt.VY,{css:{minWidth:"fit-content",padding:"$6i",zIndex:"$max",gap:"$6i",display:"flex",flexDirection:"column"},children:ia&&(0,l.jsxs)(g.X2,{onClick:i=>{i.preventDefault(),i.stopPropagation();let e=()=>null==_?void 0:_("rental-car",null==p?void 0:p.configKey);il(e,j)},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(a.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsx)(g.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:"Add Add-on"})]})})]}):null,is&&(null==p?void 0:p.status)==="SOLD_OUT"?(0,l.jsx)(g.zx,{onClick:()=>id(null==p?void 0:p.configKey,null==p?void 0:p.entityType),secondary:!0,outlined:!0,css:{backgroundColor:"$white",border:"1px solid $red400",boxShadow:"none",color:"$black","&:hover":{boxShadow:"none"}},children:"Discard"}):null]}),(0,l.jsx)(g.X2,{align:"center",justify:"center",css:{gap:"$2i"},children:p.isBundled?null:(0,l.jsx)(g.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation();let e=()=>{K?Y&&Y():(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),V.push("".concat(V.asPath,"/alternate-rental-cars/").concat((0,S.Z)(null==p?void 0:p.configKey))))};il(e,((null==v?void 0:v.length)||0)>0)},primary:!0,outlined:!0,disabled:c||F,css:{backgroundColor:"$white",fontWeight:"$bold",marginLeft:"$2i"},children:(0,l.jsx)(g.xv,{css:{fontWeight:"$bold"},children:"Change Car"})})})]})]})]})}),p.status===$.MR||(null==p?void 0:p.status)===$.RY?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.xu,{as:"div",css:{background:"$white",width:"100%"},children:(0,l.jsxs)(g.xu,{css:{display:"flex",flexDirection:"column",".image":{width:"100%",height:144,objectFit:"cover",transform:"scaleX(-1)",marginBottom:"$8i"},"@lg":{flexDirection:"row",".image":{width:241,height:186,minWidth:241,display:"block"}}},children:[(0,l.jsx)(g.xu,{css:{display:"block",padding:"$4i $8i","@lg":{flexBasis:"60%",display:"none"}},children:(0,l.jsx)(M.Z,{items:O(p.pickup,p.drop,p.pdateMillis,p.ddateMillis),type:"horizontal",listItemCSS:{marginRight:"$6i",alignItems:"flex-start"},listCSS:{flexBasis:"100%",marginBottom:"$5i","@lg":{marginBottom:0,flexBasis:"auto"}}})}),(0,l.jsx)(P.Z,{src:(0,I.Z)("https://images.pickyourtrail.com/images/web_app/itinerary/rental_car_suv.png","w=250&h=220&fit=fill&fill=solid&auto=format,compress,enhance&q=20")}),(0,l.jsxs)(g.xu,{children:[(0,l.jsx)(g.xu,{css:{padding:"0 $8i",marginTop:"$4i",marginBottom:"$4i",display:"none","@lg":{display:"block"}},children:(0,l.jsx)(M.Z,{items:H(p.passengerCount,p.vehicleCount,p.gearType,!1,p.carType,C),type:"horizontal",listItemCSS:{marginRight:"$6i"},listCSS:{flexBasis:"100%","@lg":{marginBottom:"$5i",flexBasis:"auto"}}})}),(0,l.jsxs)(g.xu,{css:{padding:"0 $8i",width:"100%",display:"flex",flexDirection:"column","@lg":{padding:"0 $8i $8i",display:"block"}},children:[(0,D.P)({key:W.Gw,permissions:null==U?void 0:U.permissions})&&(null==p?void 0:p.lastDataUpdatedMillis)&&(null==p?void 0:p.lastDataUpdatedMillis)>0?(0,l.jsx)(g.kC,{css:{width:"100%",justifyContent:"flex-end",marginBottom:"$4i",display:"none","@lg":{display:"flex"}},children:(0,l.jsx)(L.Z,{text:"Last updated ".concat(q.getDaysDiffWithYears(p.lastDataUpdatedMillis)," ago")})}):null,(0,l.jsx)(g.xv,{css:{marginBottom:"$4i",fontSize:"$6ii",lineHeight:"$8i",fontWeight:"$bold",display:"block","@lg":{marginBottom:"$8i",fontSize:"$8i",lineHeight:"$12i"}},children:C?"Chauffeur":p.carTitle+" - "+p.sourceProvider}),(0,l.jsxs)(g.xu,{css:{display:"flex",alignItems:"flex-start",flexDirection:"column","@lg":{flexDirection:"row"}},children:[(0,l.jsx)(g.xu,{css:{display:"none","@lg":{flexBasis:"60%",display:"block"}},children:(0,l.jsx)(M.Z,{items:O(p.pickup,p.drop,p.pdateMillis,p.ddateMillis),type:"horizontal",listItemCSS:{marginRight:"$6i",alignItems:"flex-start"},listCSS:{flexBasis:"100%",marginBottom:"$5i","@lg":{marginBottom:0,flexBasis:"auto"}}})}),C?null:(0,l.jsxs)(g.xu,{css:{flexBasis:"auto",display:"flex",alignItems:"center",marginBottom:"$4i",width:"100%","@lg":{display:"block",flexBasis:"60%",paddingLeft:"$10i",flexDirection:"column",marginBottom:0}},children:[p.showInsuranceData?(0,l.jsxs)(g.xu,{css:{flexBasis:"50%",display:"flex",alignItems:"center"},children:[(0,l.jsx)(t.Z,{css:{fill:"$primary04"}}
1),(0,l.jsx)(g.xv,{css:{display:"inline-block",marginLeft:"$i",fontSize:"$6ii","@lg":{fontSize:"$7ii"}},children:"Insurance"})]}):null,p.gpsIncluded?(0,l.jsxs)(g.xu,{css:{flexBasis:"50%","@lg":{marginTop:"$5i",marginLeft:0,display:"flex",alignItems:"center"}},children:[(0,l.jsx)(t.Z,{css:{fill:"$primary04"}}),(0,l.jsx)(g.xv,{css:{display:"inline-block",marginLeft:"$i",fontSize:"$6ii","@lg":{fontSize:"$7ii"}},children:"GPS"})]}):null,(0,l.jsx)(g.X2,{css:{justifyContent:"flex-end",marginTop:"$20i"},children:it&&(null==p?void 0:p.discountApplied)?(0,l.jsx)(L.Z,{text:"Admin Price",bgColor:"#de6138"}):null})]}),(0,l.jsx)(g.xu,{css:{marginTop:"$4i",marginBottom:"$4i",display:"block","@lg":{display:"none"}},children:(0,l.jsx)(M.Z,{items:H(p.passengerCount,p.vehicleCount,p.gearType,!0,p.carType,C),type:"horizontal",listItemCSS:{marginRight:"$6i"},listCSS:{flexBasis:"100%","@lg":{marginBottom:"$5i",flexBasis:"auto"}}})})]})]})]})]})}),null==d?void 0:null===(h=d[i])||void 0===h?void 0:h.map(i=>{N.push(i.message)}),N.length>0&&Q?(0,l.jsx)(Z.Z,{content:N}):null,(null==v?void 0:v.length)?(0,l.jsx)(g.sg,{css:{gap:"$8i",padding:"$8i"},children:null==v?void 0:v.map((i,e)=>{var n;return(0,l.jsx)(g.xu,{children:(0,l.jsx)(m.Z,{image:(null==i?void 0:null===(n=i.images)||void 0===n?void 0:n[0])||"https://images.pickyourtrail.com/image_placeholder_2eca9cbf61.png",title:null==i?void 0:i.title,subtitle:null==i?void 0:i.description,price:null==i?void 0:i.ourCost,tag:"Addon",costingId:null==i?void 0:i._id,status:null==i?void 0:i.status,entityType:"".concat(null==i?void 0:i.customCardEntity)})},e)})}):null]}):(0,l.jsx)(E.Z,{failedFor:"Rental Cars",type:k.WK.TRANSFER,status:null==p?void 0:p.status})]}),(0,l.jsx)(y.Z,{alertData:ir(o),isBooked:c,islandBooked:F,title:null==p?void 0:p.text,configKey:p.configKey})]})})),(0,l.jsx)(u.Vq.fC,{open:ii,onOpenChange:()=>{ie(!1)},children:(0,l.jsxs)(u.Vq.VY,{overlayZindex:"$2",css:{maxWidth:"400px",padding:"$8i",borderRadius:"$3",zIndex:"$max"},children:[(0,l.jsx)(g.xu,{css:{fontSize:"$9i",fontWeight:"$bold",color:"$grey900",marginBottom:"$6i",display:"flex",alignItems:"center",gap:"$3i"},children:"Alert: Cannot be cancelled"}),(0,l.jsx)(g.xu,{css:{fontSize:"$6i",color:"$grey900",marginBottom:"$6i",lineHeight:"$10i",fontFamily:"$manrope",fontWeight:"$semiBold"},children:"This rental car has an add-on attached to it, please cancel the add-on first and then proceed with rental car cancellation/change."}),(0,l.jsx)(g.X2,{css:{gap:"$3i",justifyContent:"flex-end"},children:(0,l.jsx)(g.zx,{onClick:()=>{ie(!1)},css:{backgroundColor:"$primary05",color:"$white"},children:"Ok"})})]})})]})};e.Z=F},66881:function(i,e,n){n.d(e,{Z:function(){return P}});var l=n(85893),o=n(25574),t=n(65367),s=n(91838),r=n(10206),d=n(39396),a=n(27484),c=n.n(a),u=n(70024),g=n(11163),h=n(67294),p=n(37880),x=n(51490),v=n(88767);let m=async(i,e,n)=>await e({url:"combo/".concat(null==i?void 0:i.id,"?include=").concat(null==i?void 0:i.includes),method:"PUT",signal:n}),f=i=>{let e=(0,x.wh)(),{mutate:n,mutateAsync:l,...o}=(0,v.useMutation)(i=>m(i,e,void 0),i);return{getSwissPass:n,getSwissPassAsync:l,...o}};var y=n(16977),$=n(90083),j=n(74734),b=n(22623),C=n(6478),k=n(16124),w=n(44950),S=n(39502),I=n(11301),T=n(65732),D=n(93290),R=n(27627),z=n(67405),W=n(76522);let Z=(i,e)=>{let n=[];return n.push({text:i}),null==e||e.map(i=>{n.push({text:i})}),n},A=i=>{var e;let{costing:n,isBooked:a,isLandBooked:x,campaignItinerary:v,openGcmAction:m,itineraryInfo:A,onClickAddonLineItem:P}=i,B=(0,u.Dv)(w.s1),{getSwissPassAsync:M}=f(),E=(0,g.useRouter)(),L=(0,u.b9)(w.w4),{lineItemDiscardAsync:O}=(0,p.h)(),[H,F]=(0,h.useState)(!1),K=(i,e)=>{e?F(!0):i()},Y=(0,h.useMemo)(()=>!!(B&&(null==B?void 0:B.loggedIn)&&(0,T.P)({key:R.Dp,permissions:null==B?void 0:B.permissions})),[B]),_=(0,h.useMemo)(()=>{var i;return null==A?void 0:null===(i=A.itinerary)||void 0===i?void 0:i.landPackageBooked},[A]),q=(0,h.useMemo)(()=>(null==B?void 0:B.loggedIn)&&_&&(0,T.P)({permissions:null==B?void 0:B.permissions,key:R.yj}),[_,null==B?void 0:B.loggedIn,null==B?void 0:B.permissions]),N=(0,T.P)({key:R.d5,permissions:null==B?void 0:B.permissions}),V=(0,h.useMemo)(()=>(null==B?void 0:B.loggedIn)&&(x||a)?(0,T.P)({permissions:null==B?void 0:B.permissions,key:R.yj}):(0,T.P)({key:R.TX,permissions:null==B?void 0:B.permissions}),[null==B?void 0:B.loggedIn,null==B?void 0:B.permissions,x,a]),U=i=>{var e;let{pass:n}=i,o=(0,k.Z)();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.xu,{as:"div",css:{background:"$white",width:"100%"},children:(0,l.jsxs)(d.xu,{css:{display:"flex",flexDirection:"column","@lg":{flexDirection:"row"}},children:[(0,l.jsx)(d.xu,{css:{display:"none","@lg":{display:"block",height:"auto","&>div":{height:"100%"}}},children:(0,l.jsx)(j.Z,{src:"".concat((null==n?void 0:n.image)?null==n?void 0:n.image:"https://pix8.agoda.net/hotelImages/299/299940/299940_16051804550042424149.jpg?ca=6&ce=1&s=1024x")})}),(0,l.jsx)(d.xu,{css:{padding:"$8i",width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start","@lg":{display:"block"}},children:(0,l.jsx)(b.Z,{items:Z(null==n?void 0:n.description,null==n?void 0:null===(e=n.inclusions)||void 0===e?void 0:e.otherInclusions),listItemCSS:{marginBottom:"$4i",alignItems:"flex-start","&:before":{position:"absolute",left:0,top:"$3i",width:"$3i",height:"$3i",border:"1px solid $grey09",background:"$grey09",borderRadius:"$radii$pill"},"@lg":{position:"relative",paddingLeft:"$8i","&:before":{content:""}}},listCSS:{flexBasis:"100%",marginBottom:"$5i","@lg":{marginBottom:0,flexBasis:"auto"}}})})]})}),(0,T.P)({permissions:null==B?void 0:B.permissions,key:R.Gz})&&o?(0,l.jsx)(W.Z,{entity:n.entityType,configKey:n.configKey,costingId:n.costingId}):null]})},X=async i=>{var e;let n=await M({id:null==E?void 0:null===(e=E.query)||void 0===e?void 0:e.itineraryId,includes:i});(null==n?void 0:n.status)==="SUCCESS"&&(null==n?void 0:n.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),L(n))},G=(0,h.useCallback)(async(i,e)=>{try{var n;let l=await O({configKey:i,entityType:e,itineraryId:"".concat(null===(n=E.query)||void 0===n?void 0:n.itineraryId)});(null==l?void 0:l.status)==="SUCCESS"&&(null==l?void 0:l.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),L(l))}catch(o){console.error({error:o})}},[O,null==E?void 0:null===(e=E.query)||void 0===e?void 0:e.itineraryId,L]);return(0,l.jsxs)(l.Fragment,{children:[h.Children.toArray(Object.keys(n).map(i=>{var e,u;let g=n[i],h=g.start.split("/"),p=new Date(h[2]+"-"+h[1]+"-"+h[0]),f=null==g?void 0:g.required,j=null==A?void 0:null===(e=A.customCostings)||void 0===e?void 0:e.filter(i=>"PASS"===i.customCardEntity&&"CUSTOM"===i.entityType),b=(null==B?void 0:B.loggedIn)?(0,I.Z)({publishedCost:null==g?void 0:g.publishedCost,ourCost:null==g?void 0:g.ourCost,userDetails:B}):0,k=null==j?void 0:j.filter(i=>(null==i?void 0:i.parentCostingId)===g.costingId),w=k&&(null===(u=null==k?void 0:k.filter(i=>i.status===C.MR))||void 0===u?void 0:u.length)>0||!1;return(0,l.jsx)(d.xu,{as:"section",css:{marginTop:"$8i","@lg":{marginTop:0}},children:(0,l.jsxs)(d.xu,{css:{display:"flex",flexDirection:"column",color:"$grey09",background:"$white",overflow:"hidden",boxShadow:"0 $fontSizes$i $fontSizes$3i 0 $colors$grey02",padding:"$8i 0","@lg":{borderRadius:"$3",border:"1px solid $custom18",boxShadow:"none",padding:0,"&:hover .alert-message":{backgroundColor:"$yellow00"}}},children:[(0,l.jsx)(d.kC,{css:{minHeight:"$16i",backgroundColor:"$white",borderRadius:"$2i $2i 0 0","@lg":{padding:"$8i 0",minHeight:"$36i",backgroundColor:"$pblue100"}},children:(0,l.jsxs)(d.kC,{css:{justifyContent:"space-between",flexGrow:1,padding:"0 $8i 0 0","@lg":{alignItems:"center"}},children:[(0,l.jsx)(z.Z,{type:S.WK.PASS,title:g.name,startDate:c()(p).format("ddd")+", "+c()(p).format("DD")+" "+h[1]}),(0,l.jsxs)(d.xu,{css:{display:"none","@lg":{display:"flex",alignItems:"end",rowGap:"$4i",flexDirection:"column"}},children:[b?(0,l.jsxs)(d.X2,{align:"center",css:{gap:"$3i"},children:[(0,l.jsx)(d.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)($.Z,{value:b})}
1),!a&&N?(0,l.jsx)(d.xu,{css:{cursor:"pointer",paddingTop:"$2i"},onClick:()=>{if(v)m&&m();else{var i,e;let n="/customize/".concat(null==E?void 0:null===(i=E.query)||void 0===i?void 0:i.regionCode,"/inclusions/rate-match/total-cost/TOTAL_COST/").concat(null==E?void 0:null===(e=E.query)||void 0===e?void 0:e.itineraryId);(0,D.Z)(n)}},children:(0,l.jsx)(o.Z,{})}):null]}):null,Y?(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(d.X2,{align:"center",justify:"center",css:{gap:"$2i"},children:[g&&(q||V)?(0,l.jsxs)(r.Lt.fC,{children:[(0,l.jsx)(r.Lt.xz,{asChild:!0,children:(0,l.jsx)(d.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold",cursor:"pointer"},children:(0,l.jsx)(t.Z,{})})}),(0,l.jsx)(r.Lt.VY,{css:{minWidth:"fit-content",padding:"$6i",zIndex:"$max",gap:"$6i",display:"flex",flexDirection:"column"},children:V?(0,l.jsxs)(d.X2,{onClick:i=>{i.preventDefault(),i.stopPropagation(),null==P||P("pass",null==g?void 0:g.configKey)},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(s.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsx)(d.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:"Add Add-on"})]}):null})]}):null,f?(0,l.jsx)(d.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation();let e=()=>{v?m&&m():X(!1)};K(e,w)},secondary:!0,outlined:!0,disabled:x||a,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(d.xv,{css:{fontWeight:"$bold"},children:"Remove"})}):null,q&&(null==g?void 0:g.status)==="SOLD_OUT"?(0,l.jsx)(d.zx,{onClick:()=>G(null==g?void 0:g.configKey,null==g?void 0:g.entityType),secondary:!0,outlined:!0,css:{backgroundColor:"$white",border:"1px solid $red400",boxShadow:"none",color:"$black","&:hover":{boxShadow:"none"}},children:"Discard"}):(0,l.jsx)(d.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation();let e=()=>{if(v)m&&m();else if(f){var i,e;let n="/customize/".concat(null==E?void 0:null===(i=E.query)||void 0===i?void 0:i.regionCode,"/inclusions/edit-swiss-pass/").concat(null==E?void 0:null===(e=E.query)||void 0===e?void 0:e.itineraryId);(0,D.Z)(n)}else X(!0)};K(e,w)},secondary:!0,outlined:!0,disabled:(!q||!x)&&(x||a),css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(d.xv,{css:{fontWeight:"$bold"},children:f?"Customize":"Add"})})]})}):null]})]})}),(0,l.jsx)(U,{pass:g}),(null==k?void 0:k.length)?(0,l.jsx)(d.sg,{css:{gap:"$8i",padding:"$8i"},children:null==k?void 0:k.map((i,e)=>{var n;return(0,l.jsx)(d.xu,{children:(0,l.jsx)(y.Z,{image:(null==i?void 0:null===(n=i.images)||void 0===n?void 0:n[0])||"https://images.pickyourtrail.com/image_placeholder_2eca9cbf61.png",title:null==i?void 0:i.title,subtitle:null==i?void 0:i.description,price:null==i?void 0:i.ourCost,tag:"Addon",costingId:null==i?void 0:i._id,status:null==i?void 0:i.status,entityType:"".concat(null==i?void 0:i.customCardEntity)})},e)})}):null]})})})),(0,l.jsx)(r.Vq.fC,{open:H,onOpenChange:()=>{F(!1)},children:(0,l.jsxs)(r.Vq.VY,{overlayZindex:"$2",css:{maxWidth:"400px",padding:"$8i",borderRadius:"$3",zIndex:"$max"},children:[(0,l.jsx)(d.xu,{css:{fontSize:"$9i",fontWeight:"$bold",color:"$grey900",marginBottom:"$6i",display:"flex",alignItems:"center",gap:"$3i"},children:"Alert: Cannot be cancelled"}),(0,l.jsx)(d.xu,{css:{fontSize:"$6i",color:"$grey900",marginBottom:"$6i",lineHeight:"$10i",fontFamily:"$manrope",fontWeight:"$semiBold"},children:"This Swiss Pass has an add-on attached to it, please cancel the add-on first and then proceed with Swiss Pass cancellation/change."}),(0,l.jsx)(d.X2,{css:{gap:"$3i",justifyContent:"flex-end"},children:(0,l.jsx)(d.zx,{onClick:()=>{F(!1)},css:{backgroundColor:"$primary05",color:"$white"},children:"Ok"})})]})})]})};var P=A},7498:function(i,e,n){n.d(e,{ZP:function(){return ie},MO:function(){return X}});var l=n(85893),o=n(89353),t=n(25574),s=n(86920),r=n(41460),d=n(65367),a=n(67969),c=n(91838),u=n(44341),g=n(51969),h=n(69841),p=n(10206),x=n(39396),v=n(70024),m=n(11163),f=n(67294),y=n(37880),$=n(51490),j=n(88767);let b=async(i,e,n)=>await e({url:"train/".concat(i.itineraryId,"/").concat(i.configKey),method:"DELETE",signal:n}),C=i=>{let e=(0,$.wh)(),{mutate:n,mutateAsync:l,...o}=(0,j.useMutation)(i=>b(i,e,void 0),i);return{removeTrain:n,removeTrainAsync:l,...o}};var k=n(16977),w=n(90083),S=n(34929),I=n(22623),T=n(35591),D=n(25077),R=n(6478),z=n(16124),W=n(75291),Z=n(44950),A=n(76907),P=n(39502),B=n(54806),M=n(17459),E=n(68991),L=n(44938),O=n(11301),H=n(65732),F=n(93290),K=n(27627),Y=n(32459),_=n(67405),q=n(47564),N=n(20487),V=n(76522),U=n(4646);let X=(i,e)=>(0,l.jsx)(S.Z,{text:"Included in Swiss Pass!",icon:(0,l.jsx)(o.Z,{css:{fill:"$white"}}),wrapperCSS:{background:"$red600",borderRadius:e?"$2":"$radii$1",borderTopLeftRadius:e?"$2":"0",borderTopRightRadius:e?"$2":"0",width:e?"auto":"100%",marginBottom:i?"$4i !important":"$0i !important",marginTop:i?"$4i":"0",padding:e?"$2
1i $4i":"$3i $4i",display:"flex",justifyContent:"center",position:e?"absolute":"static",bottom:e?"$4i":"auto",left:e?"$4i":"auto",right:e?"$4i":"auto",zIndex:e?10:"auto","@lg":{marginBottom:0,display:"flex",width:"100%",justifyContent:"center",position:"static",bottom:"auto",left:"auto",right:"auto"}},textCSS:{color:"$white",fontWeight:"$bolder",fontSize:i?"$6i":e?"$6i":"$7i",textAlign:"center"}}),G=(i,e,n)=>{let{ticketType:o,category:t,refundable:r,stopNames:d}=i,c=[];return e||(r?c.push({icon:(0,l.jsx)(u.Z,{css:{fill:"$green05"}}),text:"Refundable"}):c.push({icon:(0,l.jsx)(a.Z,{css:{fill:"$custom44"}}),text:"Non Refundable"})),!n&&(null==d?void 0:d.length)>0&&(e?c.push({text:d.length>1?d.length+" stops( "+d.join(", ")+")":d.length+" stop( "+d.join(", ")+")"}):c.push({icon:(0,l.jsx)(h.Z,{css:{fill:"$grey09"}}),text:d.length>1?d.length+" stops( "+d.join(", ")+")":d.length+" stop( "+d.join(", ")+")"})),"E-Ticket"!==o||e||c.push({icon:(0,l.jsx)(s.Z,{css:{fill:"$grey09"}}),text:"E-Ticket"}),"STANDARD"!==t||e||c.push({icon:(0,l.jsx)(g.Z,{css:{fill:"$grey09"}}),text:"STANDARD"}),c},J=i=>{let{costing:e,enableRemove:n,isBooked:o,islandBooked:t,costForDisplay:s,onRemoveClick:d,onChangeClick:a,campaignItinerary:c,openGcmAction:u,onClickCard:g}=i,h=(0,B.Z)(),p=(0,v.Dv)(Z.s1),m=(0,H.P)({key:K.Gw,permissions:null==p?void 0:p.permissions}),y=(0,f.useMemo)(()=>(null==e?void 0:e.status)=="USER_REMOVED",[e]),$=(0,f.useMemo)(()=>(null==e?void 0:e.isBundled)||!1,[null==e?void 0:e.isBundled]);return(0,l.jsx)(l.Fragment,{children:e.status===R.MR||(null==e?void 0:e.status)===R.RY?(0,l.jsxs)(x.xu,{onClick:(null==e?void 0:e.status)===R.MR?()=>{g(null==e?void 0:e.configKey)}:void 0,children:[(0,l.jsx)(x.xu,{as:"div",css:{background:"$white",width:"100%"},children:(0,l.jsx)(x.xu,{css:{display:"flex",flexDirection:"column","@lg":{flexDirection:"row"}},children:(0,l.jsxs)(x.xu,{css:{width:"100%",display:"block",flexDirection:"column",alignItems:"flex-start","@lg":{display:"block",padding:"$8i $8i 0"}},children:[(0,l.jsxs)(x.kC,{css:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",padding:"$4i","@lg":{marginBottom:"$8i",display:"none"}},children:[(0,l.jsx)(x.xu,{css:{flexGrow:1},children:(0,l.jsx)(_.Z,{type:P.WK.TRAIN,title:e.text,startDate:e?e.dayOfWeek+", "+e.day+e.mon:""})}),(0,l.jsx)(x.xu,{css:{display:"none","@lg":{display:"flex",alignItems:"center",gap:"$2i",flexShrink:0}}})]}),(0,l.jsx)(x.sg,{css:{paddingRight:"$8i",paddingLeft:"$8i",marginBottom:"$8i","@lg":{padding:0,marginBottom:"$8i"}},children:(0,l.jsx)(x.iz,{css:{backgroundColor:"$grey100"}})}),(0,l.jsxs)(x.xu,{css:{alignItems:"center",display:"flex",marginTop:"$2i",paddingLeft:"$8i",order:1,"@lg":{order:0,marginBottom:"$6i",display:"none",paddingLeft:"0"}},children:[(0,l.jsx)(I.Z,{items:G(e,!0),type:"horizontal",listCSS:{marginBottom:0},textCSS:{fontSize:"$6ii",lineHeight:"$8i",color:"$grey05"}}),m?(0,l.jsx)(S.Z,{text:e.sourceProvider,textCSS:{textTransform:"uppercase"}}):null,m&&(null==e?void 0:e.discountApplied)?(0,l.jsx)(T.Z,{text:"Admin Price",bgColor:"#de6138"}):null]}),(0,l.jsx)(x.X2,{css:{alignItems:"center",order:1,"@lg":{order:0,marginBottom:"$6i",justifyContent:"space-between"}},children:(0,l.jsxs)(x.X2,{css:{gap:"$i",alignItems:"center"},children:[m?(0,l.jsx)(S.Z,{text:e.sourceProvider,textCSS:{textTransform:"uppercase"},icon:(0,l.jsx)(r.Z,{css:{fill:"$flash_icon_color"}}),wrapperCSS:{display:"none","@lg":{display:"flex"}}}):null,m&&(null==e?void 0:e.discountApplied)?(0,l.jsx)(T.Z,{text:"Admin Price",bgColor:"#de6138"}):null]})}),(0,l.jsx)(x.xu,{css:{textAlign:"right",marginTop:"$3i",marginBottom:"$5i",display:"none","@lg":{display:"block"}},children:(0,H.P)({key:K.Gw,permissions:null==p?void 0:p.permissions})&&(null==e?void 0:e.lastDataUpdatedMillis)?(0,l.jsx)(T.Z,{text:"Last updated ".concat(h.getDaysDiffWithYears(e.lastDataUpdatedMillis)," ago")}):null}),(0,l.jsxs)(x.kC,{css:{alignItems:"flex-start",display:"flex",padding:"$8i","@lg":{padding:"0",justifyContent:"space-between",alignItems:"center"}},children:[(0,l.jsxs)(x.sg,{children:[(0,l.jsx)(x.kC,{css:{alignItems:"baseline"},children:(0,l.jsx)(x.xv,{css:{marginRight:"$2i",fontSize:"$8i",lineHeight:"$12i",fontWeight:"$extraBold",color:"$grey950",fontFamily:"$manrope"},children:e.departureTime})}),(0,l.jsx)(x.xv,{css:{marginLeft:"$2i",fontSize:"$6ii",color:"$grey600",lineHeight:"$10i",fontFamily:"$manrope",dis
1play:"none","@lg":{display:"block"}},children:e.day+" "+e.mon}),(0,l.jsx)(x.xv,{css:{fontSize:"$6ii",lineHeight:"$10i",color:"$grey600",fontFamily:"$manrope",fontWeight:"$bold"},children:e.pickup})]}),(0,l.jsx)(U.Z,{travelDuration:e.duration,isSearchPage:!1,isCountRequired:!1,type:"Train",width:200,travelStops:e.stops}),(0,l.jsxs)(x.sg,{children:[(0,l.jsx)(x.kC,{css:{alignItems:"baseline"},children:(0,l.jsx)(x.xv,{css:{marginRight:"$2i",fontSize:"$8i",lineHeight:"$12i",fontWeight:"$extraBold",color:"$grey950",fontFamily:"$manrope"},children:e.arrivalTime})}),(0,l.jsx)(x.xv,{css:{marginLeft:"$2i",fontSize:"$6ii",color:"$grey600",lineHeight:"$10i",fontFamily:"$manrope",display:"none","@lg":{display:"block"}},children:e.arrivalDay+" "+e.arrivalMon}),(0,l.jsx)(x.xv,{css:{fontSize:"$6ii",lineHeight:"$10i",color:"$grey600",fontFamily:"$manrope"},children:e.drop})]})]}),(0,l.jsx)(x.xu,{children:(0,l.jsx)(I.Z,{items:G(e,!1),type:"horizontal",listCSS:{order:3,paddingLeft:"$8i","@lg":{paddingLeft:0,order:0,marginBottom:"$8i",marginTop:"$8i"}}})})]})})}),(0,l.jsxs)(x.xu,{css:{padding:"$8i $8i $8i $8i",justifyContent:"space-between",alignItems:"center",display:"flex",width:"100%","@lg":{display:"none"}},children:[m?(0,l.jsx)(x.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)(w.Z,{value:s})}):null,(0,l.jsxs)(x.X2,{css:{gap:"$2i",backgroundColor:"$red100"},children:[n&&!e.isBundled?(0,l.jsx)(x.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation(),c?u&&u():d(null==e?void 0:e.configKey)},danger:!0,outlined:!0,disabled:o||t,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(x.xv,{css:{fontWeight:"$bold"},children:"Remove"})}):null,"SUCCESS"!==e.status||$?null:(0,l.jsx)(x.X2,{css:{width:"100%"},children:(0,l.jsx)(x.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation(),c?u&&u():a(null==e?void 0:e.configKey,null==e?void 0:e.fromCity,null==e?void 0:e.toCity)},disabled:o||t,primary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold",width:"100%",padding:"$8i","@lg":{padding:0}},children:(0,l.jsx)(x.xv,{css:{fontWeight:"$bolder",fontFamily:"$manrope",fontSize:"$7i",lineHeight:"$10i"},children:y?"Add Train":"Change Train"})})})]})]})]}):(0,l.jsxs)(x.X2,{css:{width:"100%"},children:[(0,l.jsx)(N.Z,{failedFor:"Train",type:P.WK.TRAIN,status:null==e?void 0:e.status}),(0,l.jsx)(x.xu,{css:{display:"block",padding:"$8i $8i 0 0","@lg":{display:"none"}},children:m&&(0,l.jsx)(x.X2,{align:"center",justify:"end",css:{gap:"$2i"},children:(0,l.jsx)(x.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation(),c?u&&u():a(null==e?void 0:e.configKey,null==e?void 0:e.fromCity,null==e?void 0:e.toCity)},disabled:o||t,secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(x.xv,{css:{fontWeight:"$bold"},children:"Add Train"})})})})]})})},Q=i=>{let{alerts:e,alertKey:n,userDetails:o,costing:t}=i,s=(0,z.Z)(),r=(0,f.useMemo)(()=>{var i;let l=[];return null==e||null===(i=e[n])||void 0===i||i.map(i=>{l.push(i.message)}),l},[e,n]);return(0,l.jsxs)(x.sg,{children:[r.length>0&&s?(0,l.jsx)(Y.Z,{content:r}):null,(0,H.P)({permissions:null==o?void 0:o.permissions,key:K.Gz})&&s?(0,l.jsx)(V.Z,{entity:t.entityType,configKey:t.configKey,costingId:t.costingId}):null]})},ii=i=>{var e,n,o;let{trains:s,alerts:r,islandBooked:a,isBooked:u,campaignItinerary:g,openGcmAction:h,onClickAddonLineItem:$}=i,[j,b]=(0,f.useState)(!1),S=(i,e)=>{e?b(!0):i()},I=(0,v.Dv)(Z.s1),T=(0,m.useRouter)(),{removeTrainAsync:z}=C(),B=(0,v.b9)(Z.w4),{lineItemDiscardAsync:Y}=(0,y.h)(),N=(0,W.Z)(),V=null===(e=s.trainCostings)||void 0===e?void 0:e.costingById,U=(0,H.P)({key:K.d5,permissions:null==I?void 0:I.permissions}),G=(0,f.useMemo)(()=>(0,L.Z)(T),[T]),ii=(0,f.useMemo)(()=>(null==I?void 0:I.loggedIn)&&a&&(0,H.P)({permissions:null==I?void 0:I.permissions,key:K.yj}),[a,null==I?void 0:I.loggedIn,null==I?void 0:I.permissions]),ie=(0,f.useMemo)(()=>(null==I?void 0:I.loggedIn)&&(a||u)?(0,H.P)({permissions:null==I?void 0:I.permissions,key:K.yj}):(0,H.P)({key:K.TX,permissions:null==I?void 0:I.permissions}),[null==I?void 0:I.loggedIn,null==I?void 0:I.permissions,a,u]),il=(i,e,n,l)=>{let o=(0,M.Z)(i);
1(0,A.L9W)(A.BRd,{category:"train",button_clicked:"Inclusions - Train Card",from:e,to:n}),sessionStorage.setItem("scrollPosition",window.scrollY.toString());let t=()=>{T.push("".concat(G,"/alternate-trains/").concat(o))};S(t,l)},io=(0,f.useCallback)(i=>{var e,n;return(null===(e=null==r?void 0:null===(n=r[i])||void 0===n?void 0:n.filter(i=>{var e;return(!i.inventory||(null===(e=i.inventory)||void 0===e?void 0:e.includes("LINE_ITEM_CARD")))&&i}))||void 0===e?void 0:e.filter(i=>!i.hasOwnProperty("privateAlert")||(null==i?void 0:i.privateAlert)===!1).map(i=>i))||[]},[r]),it=(0,f.useCallback)(async(i,e)=>{var n;if((null==T?void 0:null===(n=T.query)||void 0===n?void 0:n.itineraryId)&&i){let l=async()=>{var e;let n=await z({configKey:i,itineraryId:null==T?void 0:null===(e=T.query)||void 0===e?void 0:e.itineraryId});(null==n?void 0:n.status)==="SUCCESS"&&(null==n?void 0:n.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),B(n))};S(l,e)}},[z,null==T?void 0:null===(n=T.query)||void 0===n?void 0:n.itineraryId,B]),is=(0,f.useCallback)(async(i,e)=>{try{var n;let l=await Y({configKey:i,entityType:e,itineraryId:"".concat(null===(n=T.query)||void 0===n?void 0:n.itineraryId)});(null==l?void 0:l.status)==="SUCCESS"&&(null==l?void 0:l.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),B(l))}catch(o){console.error({error:o})}},[Y,null==T?void 0:null===(o=T.query)||void 0===o?void 0:o.itineraryId,B]),ir=(0,f.useCallback)(i=>{var e,n;T.push("/customize/".concat(null==T?void 0:null===(e=T.query)||void 0===e?void 0:e.regionCode,"/view/").concat(null==T?void 0:null===(n=T.query)||void 0===n?void 0:n.itineraryId,"/train-details/").concat(i))},[T]),id=(0,f.useMemo)(()=>!!(I&&(null==I?void 0:I.loggedIn)&&(0,H.P)({key:K.Dp,permissions:null==I?void 0:I.permissions})),[I]);return(0,l.jsxs)(l.Fragment,{children:[f.Children.toArray(Object.values(s.allTrainCostingRefs).map(i=>{var e,n;let o=null==V?void 0:V[i];if(!o)return null;let s=(0,H.P)({permissions:null==I?void 0:I.permissions,key:K.lO})&&("SUCCESS"===o.status||"SOLD_OUT"===o.status),v=(null==I?void 0:I.loggedIn)?(0,O.Z)({publishedCost:null==o?void 0:o.publishedCost,ourCost:null==o?void 0:o.ourCost,userDetails:I}):0,m=null==N?void 0:null===(e=N.customCostings)||void 0===e?void 0:e.filter(i=>"TRAINS"===i.customCardEntity&&"CUSTOM"===i.entityType),f=null==m?void 0:m.filter(i=>(null==i?void 0:i.parentCostingId)===(null==o?void 0:o.costingId)),y=f&&(null===(n=null==f?void 0:f.filter(i=>i.status===R.MR))||void 0===n?void 0:n.length)>0||!1;return(0,l.jsx)(x.xu,{as:"section",children:(null==o?void 0:o.status)===R.ew?(0,l.jsx)(q.Z,{type:P.WK.TRAIN,title:o.text,startDate:o?o.dayOfWeek+", "+o.day+o.mon:"",entity:null==o?void 0:o.entityType}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(x.xu,{css:{display:"flex",flexDirection:"column",color:"$grey09",background:"$white",overflow:"hidden",boxShadow:"0 $fontSizes$i $fontSizes$3i 0 $colors$grey02",cursor:"pointer",borderRadius:"$5",margin:"$6i","@lg":{display:"none"}},children:[o.status===R.MR||o.status===R.RY?(0,l.jsx)(x.xu,{css:{background:"url(".concat((0,E.Z)("https://images.pickyourtrail.com/images/web_app/itinerary/train-generic.jpg","w=400&h=200&fit=crop&auto=format,compress,enhance&q=20"),")"),backgroundSize:"cover",backgroundPosition:"center",width:"100%",height:"200px",position:"relative",borderRadius:"$5 $5 0 0"},children:(null==o?void 0:o.inSwissPass)?X(!1,!0):null}):null,(0,l.jsx)(J,{costing:o,alertKey:i,alerts:r,enableRemove:s||!1,isBooked:u,islandBooked:a,onChangeClick:(i,e,n)=>il(i,e,n,y),onRemoveClick:i=>it(i,y),costForDisplay:v,onClickCard:ir})]}),(0,l.jsxs)(x.xu,{css:{display:"none","@lg":{display:"flex",flexDirection:"column",color:"$grey09",background:"$white",overflow:"hidden",cursor:"pointer",border:(null==o?void 0:o.status)===R.RY&&ii?"1px dashed $pyellow800":"1px solid $grey100",boxShadow:"none",padding:0,borderRadius:"$4","&:hover .alert-message":{backgroundColor:"$yellow00"}}},children:[(0,l.jsxs)(x.X2,{css:{width:"100%"},children:[o.status===R.MR||o.status===R.RY?(0,l.jsx)(x.sg,{css:{background:"url(".concat((0,E.Z)("https://images.pickyourtrail.com/images/web_app/itinerary/train-generic.jpg","w=250&h=180&fit=crop&auto=format,compress,enhance&q=20"),")"),backgroundSize:"280px 300px",backgroundPosition:"center",objectFit:"cover",width:"38%",height:"300px",backgroundRepeat:"no-repeat",justifyContent:"flex-end",display:"flex",position:"relative"},children:(null==o?void 0:o.inSwissPass)?X():null}):null,(0,l.jsxs)(x.sg,{css:{width:"SUCCESS"===o.status?"60%":"100%",paddingRight:"$8i"},children:[(0,l.jsxs)(x.X2,{css:{backgroundColor:"$white",borderRadius:"$2i $2i 0 0",display:"block",gap:"$4i",width:"100%"},children:[(0,l.jsxs)(x.xu,{css:{display:"none","@lg":{display:"flex",alignItems:"center",gap:"$4i",flexDirection:"row",width:"100%",marginBottom:"$3i",marginTop:"$3i"}},children:[(0,l.jsx)(x.xu,{css:{flexGrow:1},children:(0,l.jsx)(_.Z,{type:P.WK.TRAIN,title:o.text,startDate:o?o.dayOfWeek+", "+o.day+o.mon:""})}),id&&o.contractCurrency&&""!==o.contractCurrency&&"INR"!==o.contractCurrency&&void 0!==o.contractCurrency?(0,l.jsx)(x.xv,{css:{fontWeight:"$bolder",fontSize:"$7i",fontFamily:"$manrope"},children:(0,l.jsx)(w.Z,{value:o.ourCostInContractCurrency,defaultValue:"0",displayCurrency:o.contractCurrency})}):null,v?(0,l.jsxs)(x.X2,{align:"center",css:{gap:"$3i"},children:[(0,l.jsx)(x.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)(w.Z,{value:v})}),((null==o?void 0:o.status)!==R.RY||!ii)&&(u||!U||(null==o?void 0:o.isBundled))?null:(0,l.jsx)(x.xu,{css:{curs
1or:"pointer",paddingTop:"$2i"},onClick:()=>{if(g)h&&h();else{var i,e;let n="/customize/".concat(null==T?void 0:null===(i=T.query)||void 0===i?void 0:i.regionCode,"/inclusions/rate-match/total-cost/TOTAL_COST/").concat(null==T?void 0:null===(e=T.query)||void 0===e?void 0:e.itineraryId);(0,F.Z)(n)}},children:(0,l.jsx)(t.Z,{})})]}):null]}),(0,l.jsxs)(x.X2,{css:{gap:"$2i",justifyContent:"flex-end",width:"100%"},children:[(ii||ie)&&(null==o?void 0:o.status)===R.MR?(0,l.jsxs)(p.Lt.fC,{modal:!1,children:[(0,l.jsx)(p.Lt.xz,{asChild:!0,children:(0,l.jsx)(x.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold",cursor:"pointer"},children:(0,l.jsx)(d.Z,{})})}),(0,l.jsx)(p.Lt.VY,{css:{minWidth:"fit-content",padding:"$6i",zIndex:"$max",gap:"$6i",display:"flex",flexDirection:"column"},children:ie&&(0,l.jsxs)(x.X2,{onClick:i=>{i.preventDefault(),i.stopPropagation(),null==$||$("train",null==o?void 0:o.configKey)},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(c.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsx)(x.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:"Add Add-on"})]})})]}):null,s&&!o.isBundled?(0,l.jsx)(x.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),g)h&&h();else{let e=()=>{it(null==o?void 0:o.configKey,y)};S(e,y)}},danger:!0,outlined:!0,disabled:u||a,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(x.xv,{css:{fontWeight:"$bold"},children:"Remove"})}):null,ii&&(null==o?void 0:o.status)==="SOLD_OUT"?(0,l.jsx)(x.zx,{onClick:()=>is(null==o?void 0:o.configKey,null==o?void 0:o.entityType),secondary:!0,outlined:!0,css:{backgroundColor:"$white",border:"1px solid $red400",boxShadow:"none",color:"$black","&:hover":{boxShadow:"none"}},children:"Discard"}):("SUCCESS"===o.status||"USER_REMOVED"===o.status||"SOLD_OUT"===o.status)&&!o.isBundled&&id?(0,l.jsx)(x.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),g)h&&h();else{let e=()=>{il(null==o?void 0:o.configKey,null==o?void 0:o.fromCity,null==o?void 0:o.toCity,y)};S(e,y)}},disabled:u||a,primary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(x.xv,{css:{fontWeight:"$bold"},children:"USER_REMOVED"===o.status?"Add Train":"Change Train"})}):null]})]}),(0,l.jsx)(J,{costing:o,alertKey:i,alerts:r,enableRemove:s||!1,isBooked:u,islandBooked:a,onChangeClick:(i,e,n)=>il(i,e,n,y),onRemoveClick:i=>it(i,y),costForDisplay:v,onClickCard:ir})]})]}),(0,l.jsxs)(x.sg,{children:[(null==I?void 0:I.loggedIn)&&(0,l.jsx)(Q,{alertKey:i,alerts:r,userDetails:I,costing:o}),(null==f?void 0:f.length)?(0,l.jsx)(x.sg,{css:{gap:"$8i",padding:"$8i"},children:null==f?void 0:f.map((i,e)=>{var n;return(0,l.jsx)(x.xu,{children:(0,l.jsx)(k.Z,{image:(null==i?void 0:null===(n=i.images)||void 0===n?void 0:n[0])||"https://images.pickyourtrail.com/image_placeholder_2eca9cbf61.png",title:null==i?void 0:i.title,subtitle:null==i?void 0:i.description,price:null==i?void 0:i.ourCost,tag:"Addon",costingId:null==i?void 0:i._id,status:null==i?void 0:i.status,entityType:"".concat(null==i?void 0:i.customCardEntity)})},e)})}):null]})]}),(0,l.jsx)(D.Z,{alertData:io(i),isBooked:u,islandBooked:a,title:o.text,configKey:o.configKey})]})})})),(0,l.jsx)(p.Vq.fC,{open:j,onOpenChange:()=>{b(!1)},children:(0,l.jsx)(p.Vq.VY,{overlayZindex:"$2",css:{maxWidth:"400px",padding:"$8i",borderRadius:"$3",zIndex:"$max"},children:(0,l.jsxs)(x.xu,{css:{display:"flex",flexDirection:"column",gap:"$6i"},children:[(0,l.jsx)(x.xu,{css:{fontSize:"$9i",fontWeight:"$bold",color:"$grey900",marginBottom:"$6i",display:"flex",alignItems:"center",gap:"$3i"},children:"Alert: Cannot be cancelled"}),(0,l.jsx)(x.xu,{css:{fontSize:"$6i",color:"$grey900",marginBottom:"$6i",lineHeight:"$10i",fontFamily:"$manrope",fontWeight:"$semiBold"},children:"This train has an add-on attached to it, please cancel the add-on first and then proceed with train cancellation/change."}),(0,l.jsx)(x.X2,{css:{gap:"$3i",justifyContent:"flex-end"},children:(0,l.jsx)(x.zx,{onClick:()=>{b(!1)},css:{backgroundColor:"$primary05",color:"$white"},children:"Continue"})})]})})})]})};var ie=ii},20811:function(i,e,n){n.d(e,{Iz:function(){return ip},ZP:function(){return iv},R2:function(){return ig}});var l=n(85893),o=n(38451),t=n(86920),s=n(41460),r=n(74146),d=n(67969),a=n(71256),c=n(51969),u=n(69841),g=n(10206),h=n(39396),p=n(70024),x=n(30381),v=n.n(x),m=n(11163),f=n(67294),y=n(86501),$=n(51138),j=n(37880),b=n(5149
10),C=n(88767);let k=async(i,e,n)=>await e({url:"itinerary/changetransfer",method:"POST",body:i,signal:n}),w=i=>{let e=(0,b.wh)(),{mutate:n,mutateAsync:l,...o}=(0,C.useMutation)(i=>k(i,e,void 0),i);return{alternateSelectedTransfer:n,alternateSelectedTransferAsync:l,...o}},S=async(i,e,n)=>{var l;return await e({url:i.url,method:(null==i?void 0:null===(l=i.data)||void 0===l?void 0:l.isRemove)?"DELETE":"PUT",body:i.data,signal:n})},I=i=>{let e=(0,b.wh)(),{mutate:n,mutateAsync:l,...o}=(0,C.useMutation)(i=>S(i,e,void 0),i);return{applyTrnafers:n,applyTrnafersAsync:l,...o}};var T=n(16977),D=n(90083),R=n(74734),z=n(22623),W=n(35591),Z=n(25077),A=n(6478),P=n(16124),B=n(75291),M=n(44950),E=n(76907),L=n(83359),O=n(78449),H=n(39502),F=n(54806),K=n(17459),Y=n(68991),_=n(11301),q=n(65732),N=n(27627),V=n(34929),U=n(32459),X=n(47564),G=n(20487),J=n(76522),Q=n(7498),ii=n(4646);let ie=i=>{let{slot:e}=i,n=(0,p.Dv)(M.s1),o=(0,F.Z)();return(0,l.jsxs)(h.xu,{css:{padding:"0 $8i",width:"100%",display:"block",flexDirection:"column",alignItems:"flex-start","@lg":{display:"block",padding:"$8i $8i 0"}},children:[(0,l.jsxs)(h.xu,{css:{alignItems:"center",display:"flex",marginTop:"$2i",order:1,"@lg":{order:0,marginBottom:"$6i",display:"none"}},children:[(0,l.jsx)(z.Z,{items:ig(e,!0),type:"horizontal",listCSS:{marginBottom:0},textCSS:{fontSize:"$6ii",lineHeight:"$8i",color:"$grey05"}}),(0,l.jsx)(V.Z,{text:e.sourceProvider,textCSS:{textTransform:"uppercase"}})]}),(null==e?void 0:e.inSwissPass)?(0,Q.MO)(!0):null,(0,l.jsxs)(h.xu,{css:{display:"flex",alignItems:"center",order:1,"@lg":{order:0,marginBottom:"$6i"}},children:[(0,l.jsx)(z.Z,{items:ig(e,!1),type:"horizontal",listCSS:{order:3,"@lg":{order:0}}}),(0,l.jsx)(V.Z,{text:e.sourceProvider,textCSS:{textTransform:"uppercase"},icon:(0,l.jsx)(s.Z,{css:{fill:"$flash_icon_color"}}),wrapperCSS:{display:"none","@lg":{display:"flex",width:"fit-content"}}})]}),(0,l.jsx)(h.xu,{css:{textAlign:"right",marginTop:"$3i",marginBottom:"$5i",display:"none","@lg":{display:"block"}},children:(0,q.P)({key:N.Gw,permissions:null==n?void 0:n.permissions})&&(null==e?void 0:e.lastDataUpdatedMillis)&&(null==e?void 0:e.lastDataUpdatedMillis)>0?(0,l.jsx)(W.Z,{text:"Last updated ".concat(o.getDaysDiffWithYears(e.lastDataUpdatedMillis)," ago")}):null}),(0,l.jsxs)(h.kC,{css:{alignItems:"flex-start",display:"none","@lg":{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"$8i 0 $8i"}},children:[(0,l.jsxs)(h.sg,{children:[(0,l.jsxs)(h.kC,{css:{alignItems:"baseline"},children:[(0,l.jsx)(h.xv,{css:{marginRight:"$2i",fontSize:"$9i",lineHeight:"$12i",fontWeight:"$bold",color:"$grey12"},children:null==e?void 0:e.departureTime}),(0,l.jsx)(h.xv,{css:{marginLeft:"$2i",fontSize:"$6ii",color:"$grey05"},children:e.day+" "+e.mon})]}),(0,l.jsx)(h.xv,{css:{fontSize:"$6ii",lineHeight:"$8i",color:"$grey08"},children:e.pickup})]}),(0,l.jsx)(ii.Z,{travelDuration:e.duration,isSearchPage:!1,isCountRequired:!1,type:"Train",width:200}),(0,l.jsxs)(h.sg,{children:[(0,l.jsxs)(h.kC,{css:{alignItems:"baseline"},children:[(0,l.jsx)(h.xv,{css:{marginRight:"$2i",fontSize:"$9i",lineHeight:"$12i",fontWeight:"$bold",color:"$grey12"},children:null==e?void 0:e.arrivalTime}),(0,l.jsx)(h.xv,{css:{marginLeft:"$2i",fontSize:"$6ii",color:"$grey05"},children:e.day+" "+e.mon})]}),(0,l.jsx)(h.xv,{css:{fontSize:"$6ii",lineHeight:"$8i",color:"$grey08"},children:e.drop})]})]}),(null==e?void 0:e.inSwissPass)?(0,Q.MO)():null]})};var il=n(25574),io=n(65367),it=n(91838),is=n(93290),ir=n(67405);let id=i=>{var e;let{costForDisplay:n,isAdmin:t,slot:s,isBooked:r,enablePostBooking:d,canEditPrice:a,campaignItinerary:c,openGcmAction:u,showSubLineItemAddon:x,isAOAdmin:v,onClickUpdatePickupTime:f,onClickAddonLineItem:y,handleActionWithAddonWarning:$,hasSubLineitemAddon:j,onDiscard:b,addButtonText:C,islandBooked:k,enableRemove:w,handleHeaderClick:S,transferText:I,handleTransferChnage:T,canModifyTransfer:R,departureDateMillis:z}=i,W=(0,p.Dv)(M.s1),Z=(0,m.useRouter)();return(0,l.jsxs)(h.kC,{css:{justifyContent:"space-between",flexGrow:1,padding:"0 $8i 0 0","@lg":{flexDirection:"column",paddingTop:"$4i"}},children:[(0,l.jsxs)(h.X2,{css:{paddingLeft:"$9i",justifyContent:"space-between",width:"100%",marginBottom:"$4i"},children:[(0,l.jsx)(h.X2,{children:(0,l.jsx)(ir.Z,{type:H.WK.TRANSFER,title:void 0!==s.carName?s.text+" - "+s.carName:s.text,startDate:s?s.dayOfWeek+", "+s.day+s.mon:""})}),(0,l.jsx)(h.X2,{children:n?(0,l.jsxs)(h.X2,{css:{gap:"$3i",justifyContent:"flex-end",width:"100%"},children:[t&&(null==W?void 0:W.loggedIn)&&(0,l.jsx)(h.xv,{css:{fontWeight:"$bold",fontFamily:"$manrope",fontSize:"$9i",lineHeight:"$10i",color:"$grey950"},children:(0,l.jsx)(D.Z,{value:n})}),((null==s?void 0:s.status)!==A.RY||!d)&&(r||!a||(null==s?void 0:s.isBundled))?null:(0,l.jsx)(h.xu,{css:{curs
1or:"pointer",paddingTop:"$2i",alignItems:"center"},onClick:()=>{if(c)u&&u();else{var i,e;let n="/customize/".concat(null==Z?void 0:null===(i=Z.query)||void 0===i?void 0:i.regionCode,"/inclusions/rate-match/total-cost/TOTAL_COST/").concat(null==Z?void 0:null===(e=Z.query)||void 0===e?void 0:e.itineraryId);(0,is.Z)(n)}},children:(0,l.jsx)(il.Z,{})})]}):null})]}),(0,l.jsx)(h.xu,{css:{display:"none","@lg":{display:"flex",alignItems:"end",rowGap:"$4i",flexDirection:"column",minWidth:"fit-content",flexShrink:0}},children:(0,l.jsxs)(h.X2,{css:{gap:"$4i",flexWrap:"wrap",justifyContent:"flex-end"},children:[(d||x||v)&&(null==s?void 0:s.status)===A.MR?(0,l.jsxs)(g.Lt.fC,{modal:!1,children:[(0,l.jsx)(g.Lt.xz,{asChild:!0,children:(0,l.jsx)(h.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold",cursor:"pointer"},children:(0,l.jsx)(io.Z,{})})}),(0,l.jsxs)(g.Lt.VY,{css:{minWidth:"fit-content",padding:"$6i",zIndex:"$max",gap:"$6i",display:"flex",flexDirection:"column"},children:[x&&(0,l.jsxs)(h.X2,{onClick:i=>{i.preventDefault(),i.stopPropagation(),null==y||y("transfer",null==s?void 0:s.configKey,(null==s?void 0:s.mode)==="TRAIN"?"train":(null==s?void 0:s.mode)==="BUS"?"bus":(null==s?void 0:s.mode)==="FERRY"?"ferry":"transfer")},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(it.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsx)(h.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:"Add Add-on"})]}),(null==s?void 0:s.type)==="PRIVATE"&&v?(0,l.jsxs)(h.X2,{onClick:i=>{i.preventDefault(),i.stopPropagation(),f(null==s?void 0:s.configKey,null==s?void 0:s.costingId)},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(o.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsx)(h.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:"Update Pickup time"})]}):null]})]}):null,d&&(null==s?void 0:s.status)==="SOLD_OUT"?(0,l.jsx)(h.zx,{onClick:()=>b(null==s?void 0:s.configKey,null==s?void 0:s.entityType),secondary:!0,outlined:!0,css:{backgroundColor:"$white",border:"1px solid $red400",boxShadow:"none",color:"$black","&:hover":{boxShadow:"none"}},children:"Discard"}):!C||s.isBundled||(null==s?void 0:s.status)!==A.js&&k?!w||s.isBundled||k?null:(0,l.jsxs)(l.Fragment,{children:[(null==s?void 0:s.mode)=="BUS"&&(null==s?void 0:s.alternateAvailable)&&(0,l.jsx)(h.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation(),c?u&&u():Z.push("".concat(Z.asPath,"/alternate-buses/").concat(null==s?void 0:s.configKey))},primary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(h.xv,{css:{fontWeight:"$bold"},children:"Change Bus"})}),(0,l.jsx)(h.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation(),c?u&&u():S(!C&&w,null==s?void 0:s.configKey,null==s?void 0:s.text)},...C?{secondary:!0}:{danger:!0},outlined:!0,disabled:!d&&k,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(h.xv,{css:{fontWeight:"$bold"},children:"Remove"})})]}):(0,l.jsx)(h.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),c)u&&u();else{let e=()=>S(!C&&w,null==s?void 0:s.configKey,null==s?void 0:s.text);$(e,j)}},...C?{secondary:!0}:{danger:!0},outlined:!0,disabled:!d&&k,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(h.xv,{css:{fontWeight:"$bold"},children:"Add"})}),null!==I&&s.alternateAvailable&&!s.isBundled?(0,l.jsx)(h.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),c)u&&u();else{let e=()=>T(null==s?void 0:s.configKey,null==s?void 0:s.type);$(e,j)}},outlined:!0,disabled:(!d||(null==s?void 0:s.status)!==A.RY)&&k,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(h.xv,{css:{fontWeight:"$bold"},children:I})}):null,R&&(null==s?void 0:s.status)===A.MR&&"DATABASE"!==s.sourceProvider&&!"cancelled".includes(null==s?void 0:null===(e=s.bookingStatus)||void 0===e?void 0:e.toLowerCase())?(0,l.jsx)(ip,{slot:s,departureDateMillis:z}):null]})})]})},ia=function(i,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=(i||"").toUpperCase();switch(o){case"BOAT":return"https://images.pickyourtrail.com/images/misc/venice_speed_boat.
1jpg";case"FERRY":return"https://images.pickyourtrail.com/images/misc/ferry.jpg";case"TRAIN":return"https://images.pickyourtrail.com/images/misc/transfers-train.jpg";case"BUS":return"https://images.pickyourtrail.com/images/misc/transfers-bus.jpg";case"SHUTTLE":return"https://images.pickyourtrail.com/images/misc/transfers-shuttle.jpg";case"CAR":if("PRIVATE"===e)return n+l>2?"https://images.pickyourtrail.com/images/web_app/itinerary/rental_car_suv.png":"https://images.pickyourtrail.com/images/web_app/itinerary/rental_car_sedan.png";return"https://images.pickyourtrail.com/images/misc/transfers-shuttle.jpg";case"MINIVAN":return"https://images.pickyourtrail.com/images/activity/SharedTransfer-PDF.png";default:return"https://images.pickyourtrail.com/images/web_app/itinerary/rental-generic.jpg"}},ic=(i,e,n,o,t,s)=>{let d=[];return d.push({icon:(0,l.jsx)(c.Z,{css:{fill:"$grey09"}}),text:(0,O.Z)(e)+" transfer"}),d.push({icon:(0,l.jsx)(a.Z,{css:{fill:"$grey09"}}),text:"".concat(i," passengers in 1 vehicle")}),s&&"DATABASE"!==s&&d.push({icon:(0,l.jsx)(r.Z,{css:{fill:"$grey09"}}),text:"".concat(t||0," Luggages")}),d.push({icon:"included",text:"Pickup from ".concat(n)}),d.push({icon:"included",text:"Drop to ".concat(o)}),d},iu=i=>{let{slot:e,alerts:n,isBooked:o}=i,t=(0,F.Z)(),r=(0,p.Dv)(M.s1),d=(0,P.Z)(),a=(0,f.useMemo)(()=>!!(r&&(null==r?void 0:r.loggedIn)&&(0,q.P)({key:N.Dp,permissions:null==r?void 0:r.permissions})),[r]),c=(0,f.useMemo)(()=>!!(r&&(null==r?void 0:r.loggedIn)&&(0,q.P)({key:N.BN,permissions:null==r?void 0:r.permissions}))&&!!o&&null!=e&&!!e.bookingStatus,[o,null==e?void 0:e.bookingStatus,r]),u=(0,f.useCallback)(i=>{let e=i.toLowerCase(),n=["Cancelled"].map(i=>i.toLowerCase()),l=["Confirmed","Trip Completed"].map(i=>i.toLowerCase());return n.includes(e)?"$red300":l.includes(e)?"$green200":"$yellow200"},[]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(h.xu,{as:"div",css:{background:"$white",width:"100%"},children:(0,l.jsx)(h.xu,{css:{display:"flex",flexDirection:"row","@lg":{flexDirection:"row"}},children:(0,l.jsxs)(h.xu,{css:{padding:"$8i",width:"100%",display:"flex",flexDirection:"column","@lg":{display:"block"}},children:[(0,l.jsxs)(h.X2,{css:{justifyContent:o?"space-between":"flex-end",alignItems:"start"},children:[a?(0,l.jsx)(V.Z,{text:e.sourceProvider,textCSS:{textTransform:"uppercase"},icon:(0,l.jsx)(s.Z,{css:{fill:"$flash_icon_color"}}),wrapperCSS:{display:"none","@lg":{display:"flex",width:"fit-content"}}}):null,c?(0,l.jsx)(h.xu,{css:{padding:"6px 8px",backgroundColor:u((null==e?void 0:e.bookingStatus)||""),borderRadius:"5px"},children:(0,l.jsx)(h.xv,{css:{fontSize:"$6i",fontWeight:"$bold",color:"$grey14"},children:null==e?void 0:e.bookingStatus})}):null,(0,l.jsxs)(h.X2,{css:{justifyContent:"flex-end"},children:[a&&(null==e?void 0:e.discountApplied)?(0,l.jsx)(W.Z,{text:"Admin Price",bgColor:"#de6138"}):null,a&&(null==e?void 0:e.lastDataUpdatedMillis)&&(null==e?void 0:e.lastDataUpdatedMillis)>0?(0,l.jsx)(h.kC,{css:{justifyContent:"flex-end",marginBottom:"$4i"},children:(0,l.jsx)(W.Z,{text:"Last updated ".concat(t.getDaysDiffWithYears(e.lastDataUpdatedMillis)," ago")})}):null]})]}),(0,l.jsx)(h.X2,{children:(0,l.jsx)(z.Z,{items:ic(e.passengers,e.type,e.pickup,e.drop,e.luggageCapacity,e.sourceProvider),type:"horizontal",listCSS:{width:"50%","@lg":{order:0,width:"100%",marginTop:"$8i"}}})})]})})}),n.length>0&&d?(0,l.jsx)(U.Z,{content:n}):null]})},ig=(i,e,n)=>{let{duration:s,ticketType:r,category:a,stopNames:g,refundable:h}=i,p=[];return h||e||p.push({icon:(0,l.jsx)(d.Z,{css:{fill:"$custom44"}}),text:"Non Refundable"}),!n&&s&&(e?p.push({text:s}):p.push({icon:(0,l.jsx)(o.Z,{css:{fill:"$grey09"}}),text:s})),!n&&g&&(null==g?void 0:g.length)>0&&(e?p.push({text:g.length>1?g.length+" stops( "+g.join(", ")+")":g.length+" stop( "+g.join(", ")+")"}):p.push({icon:(0,l.jsx)(u.Z,{css:{fill:"$grey09"}}),text:g.length>1?g.length+" stops( "+g.join(", ")+")":g.length+" stop( "+g.join(", ")+")"})),"E-Ticket"!==r||e||p.push({icon:(0,l.jsx)(t.Z,{css:{fill:"$grey09"}}),text:"E-Ticket"}),"STANDARD"!==a||e||p.push({icon:(0,l.jsx)(c.Z,{css:{fill:"$grey09"}}),text:"STANDARD"}),p},ih=i=>{let{alertKey:e,alerts:n,subLineitemAddonData:o}=i,t=(0,P.Z)(),s=(0,f.useMemo)(()=>{var i;let l=[];return null==n||null===(i=n[e])||void 0===i||i.map(i=>{l.push(i.message)}),l},[n,e]);return(0,l.jsxs)(h.xu,{onClick:()=>{},css:{width:"100%"},children:[(null==o?void 0:o.length)?(0,l.jsx)(h.sg,{css:{gap:"$8i",padding:"$8i"},children:null==o?void 0:o.map((i,e)=>{var n;return(0,l.jsx)(h.xu,{children:(0,l.jsx)(T.Z,{image:(null==i?void 0:null===(n=i.images)||void 0===n?void 0:n[0])||"https://images.pickyourtrail.com/image_placeholder_2eca9cbf61.png",title:null==i?void 0:i.title,subtitle:null==i?void 0:i.description,price:null==i?void 0:i.ourCost,tag:"Addon",costingId:null==i?void 0:i._id,status:null==i?void 0:i.status,entityType:"".concat(null==i?void 0:i.customCardEntity)})},e)})}
1):null,s.length>0&&t?(0,l.jsx)(U.Z,{content:s}):null]})},ip=i=>{let{slot:e,departureDateMillis:n,campaignItinerary:o,openGcmAction:t}=i,s=(0,m.useRouter)(),r=(0,f.useCallback)(i=>{s.query.m!==i&&s.push({pathname:s.asPath,query:{m:i,configKey:null==e?void 0:e.configKey}},void 0,{shallow:!0})},[s,null==e?void 0:e.configKey]),d=(0,f.useMemo)(()=>{let i=v()(n),e=v()(),l=i.clone().subtract(1,"day"),o=e.isBefore(l,"day");return!o},[n]),a=i=>{let{children:e}=i;return d?(0,l.jsx)(g.u,{content:"Please contact cx support",children:e}):e};return(0,l.jsxs)(h.X2,{align:"center",justify:"center",css:{gap:"$4i"},children:[(0,l.jsx)(a,{children:(0,l.jsx)(h.zx,{danger:!0,outlined:!0,onClick:i=>{i.preventDefault(),i.stopPropagation(),o?t&&t():r("transfer-cancellation")},css:{backgroundColor:"$white",fontWeight:"$bold","&:disabled":{pointerEvents:"all"},"&:hover":{boxShadow:d?"none":""}},disabled:d,children:(0,l.jsx)(h.xv,{css:{fontWeight:"$bold"},children:"Cancel"})})}),(0,l.jsx)(a,{children:(0,l.jsx)(h.zx,{outlined:!0,secondary:!0,onClick:i=>{i.preventDefault(),i.stopPropagation(),o?t&&t():r("transfer-modification")},css:{backgroundColor:"$white",fontWeight:"$bold","&:disabled":{pointerEvents:"all"},"&:hover":{boxShadow:d?"none":""}},disabled:d,children:(0,l.jsx)(h.xv,{css:{fontWeight:"$bold"},children:"Modify"})})})]})},ix=i=>{let{transfersRefs:e,costingById:n,alerts:o,islandBooked:t,isBooked:s,itineraryId:r,departureDateMillis:d,campaignItinerary:a,openGcmAction:c,onClickAddonLineItem:u}=i,{lineItemDiscardAsync:x}=(0,j.h)(),v=(0,p.Dv)(M.s1),b=(0,m.useRouter)(),C=(0,B.Z)(),k=(0,p.b9)(M.OO),S=(0,p.b9)(M.w4),[z,W]=(0,f.useState)(!1),{applyTrnafersAsync:O}=I(),{alternateSelectedTransferAsync:F}=w(),{UseGetActivityTimingsAsync:V}=(0,$.a)(),U=(0,f.useMemo)(()=>!!(v&&(null==v?void 0:v.loggedIn)&&(0,q.P)({key:N.Dp,permissions:null==v?void 0:v.permissions})),[v]),Q=(0,f.useMemo)(()=>(0,q.P)({key:N.Vi,permissions:null==v?void 0:v.permissions})&&t||!1,[t,null==v?void 0:v.permissions]),ii=(0,q.P)({key:N.d5,permissions:null==v?void 0:v.permissions}),il=(0,f.useMemo)(()=>!!(v&&(null==v?void 0:v.loggedIn)&&(0,q.P)({key:N.BN,permissions:null==v?void 0:v.permissions}))&&!!t,[t,v]),io=(0,f.useMemo)(()=>(null==v?void 0:v.loggedIn)&&t&&(0,q.P)({permissions:null==v?void 0:v.permissions,key:N.yj}),[t,null==v?void 0:v.loggedIn,null==v?void 0:v.permissions]),it=(0,f.useCallback)(i=>{var e;return(null==o?void 0:null===(e=o[i])||void 0===e?void 0:e.filter(i=>{var e;return(!i.inventory||(null===(e=i.inventory)||void 0===e?void 0:e.includes("LINE_ITEM_CARD")))&&i.message}).map(i=>i.message))||[]},[o]),is=(0,f.useMemo)(()=>(null==v?void 0:v.loggedIn)&&(t||s)?(0,q.P)({permissions:null==v?void 0:v.permissions,key:N.yj}):(0,q.P)({key:N.TX,permissions:null==v?void 0:v.permissions}),[null==v?void 0:v.loggedIn,null==v?void 0:v.permissions,t,s]),ir=(0,f.useCallback)(i=>{var e,n;return(null===(e=null==o?void 0:null===(n=o[i])||void 0===n?void 0:n.filter(i=>{var e;return(!i.inventory||(null===(e=i.inventory)||void 0===e?void 0:e.includes("LINE_ITEM_CARD")))&&i}))||void 0===e?void 0:e.filter(i=>!i.hasOwnProperty("privateAlert")||(null==i?void 0:i.privateAlert)===!1).map(i=>i))||[]},[o]),ic=(0,f.useCallback)(async(i,e,n)=>{(0,E.L9W)(E.IJz,{type:i?"Remove":"Add",itineraryId:r,leadSource:(0,L.L1)({router:b,lastLocation:{pathname:b.asPath}}),from:n});let l="";l="transfer/".concat(r,"/").concat((0,K.Z)(e));let o=await O({url:l,data:{configKey:(0,K.Z)(e),isRemove:i,itineraryId:r,transfer:"transfer"}});(null==o?void 0:o.status)==="SUCCESS"&&(null==o?void 0:o.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),S(o))},[O,r,b,S]),ig=(0,f.useCallback)(async(i,e)=>{if(r&&i){let n=await F({configKey:i,itineraryId:r});(null==n?void 0:n.status)==="SUCCESS"&&(null==n?void 0:n.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),S(n))}let l={itineraryId:r,leadSource:(0,L.L1)({router:b,lastLocation:{pathname:b.asPath}}),from:"PRIVATE"===e?"Shared":"Private"};(0,E.L9W)(E.AVo,l)},[F,r,b,S]),ip=(i,e)=>{e?W(!0):i()},ix=(0,P.Z)(),iv=(0,f.useCallback)(async(i,e)=>{if(i&&e)try{let n=await x({configKey:i,entityType:e,itineraryId:r});(null==n?void 0:n.status)==="SUCCESS"&&(null==n?void 0:n.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),S(n))}catch(l){console.error({error:l})}},[r,x,S]),im=(0,f.useCallback)(async(i,e)=>{if(i&&e)try{let n=await V({itineraryId:e,entityType:"transfer"}),l=n.data||[];if("SUCCESS"===n.status&&(null==l?void 0:l.length)>0){var o;k(l),sessionStorage.setItem("scrollPosition",window.scrollY.toString()),b.replace({pathname:null===(o=b.asPath)||void 0===o?void 0:o.split("?")[0],query:{m:"one-pager-edit",configKey:i,entity:"transfer"}})}else y.ZP.error("No pickup times available for this transfer")}catch(t){console.error({error:t})}},[V,b,k]);return(0,l.jsxs)(l.Fragment,{children:[f.Children.toArray(null==e?void 0:e.map(i=>{var e,r;let g=(null==n?void 0:n[i||""])||void 0,p=!!(0,q.P)({permissions:null==v?void 0:v.permissions,key:N.X0})&&(null==g?void 0:g.status)!=="UNAVAILABLE",x=(null==v?void 0:v.loggedIn)?Number((0,_.Z)({publishedCost:null==g?void 0:g.publishedCost,ourCost:null==g?void 0:g.ourCost,userDetails:v})):0,m=v&&(null==v?void 0:v.loggedIn)&&(0,q.P)({permissions:null==v?void 0:v.permissions,key:N.X0})&&(null==g?void 0:g.status)==="USER_REMOVED"?"Add":null,f=g&&g.type?g&&(null==g?void 0:g.type)==="PRIVATE"?"Change to shared":"Change to private":null,y=null==C?void 0:null===(e=C.customCostings)||void 0===e?void 0:e.filter(i=>"TRANSFERS"===i.customCardEntity&&"CUSTOM"===i.entityType),$=null==y?void 0:y.filter(i=>(null==i?void 0:i.parentCostingId)===(null==g?void 0:g.costingId)),j=$&&(null===(r=null==$?void 0:$.filter(i=>i.status===A.MR))||void 0===r?void 0:r.length)>0||!1,b=()=>{let i=g?((null==g?void 0:g.images)||[]).filter(i=>"string"==typeof i&&i.trim()):[];return i.length?(0,Y.Z)(i[0]):"".concat(ia(null==g?void 0:g.vehicle,null==g?void 0:g.type),"?dpr=2&w=250&h=220&fit=fill&fill=solid&auto=format,compress,enhance&q=20")},k=i=>{if(!i)return null;let e=i.replace(/<p>\s*<\/p>/g,"").replace(/<ul>|<\/ul>|<ol>|<\/ol>/g,"").replace(/^<li>|<\/li>$/g,""),n=e.split(/<\/li>\s*<li>/).map(i=>i.trim()).filter(i=>i&&"<p></p>"!==i&&"<p> </p>"!==i&&""!==i.replace(/<[^>]*>/g,"").trim());return n.length>0?n:null},w=k(null==g?void 0:g.specialNotes),S=k(null==g?void 0:g.notes);return(0,l.jsxs)(h.xu,{as:"section",css:{marginTop:"$8i","@lg":{marginTop:0}},children:[(null==g?void 0:g.status)===A.ew?(0,l.jsx)(X.Z,{type:H.WK.TRANSFER,title:g.text,startDate:g?g.dayOfWeek+", "+g.day+g.mon:"",entity:null==g?void 0:g.entityType}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(h.xu,{css:{display:"flex",flexDirection:"column",background:"$white",borderRadius:"$5",overflow:"hidden",boxShadow:"0 $fontSizes$i $fontSizes$3i 0 $colors$grey02",margin:"$6i","@lg":{display:"none"}},children:[(g.status===A.MR||g.status===A.RY)&&(0,l.jsx)(h.xu,{css:{background:"url(".concat(b(),")"),backgroundSize:"cover",backgroundPosition:"center",width:"100%",height:"200px"}}),(0,l.jsxs)(h.xu,{css:{padding:"$6i"},children:[(0,l.jsxs)(h.sg,{css:{marginBottom:"$4i",gap:"$2i"},children:[(0,l.jsx)(h.xv,{css:{fontSize:"$8i",fontWeight:"$bold",color:"$grey950",marginBottom:"$1i",fontFamily:"$manrope"},children:g.text}),(0,l.jsx)(h.xv,{css:{fontSize:"$6i",color:"$blue600",fontWeight:"$semiBold",fontFamily:"$manrope"},children:g.dayOfWeek+", "+g.day+" "+g.mon})]}),(g.status===A.MR||g.status===A.RY)&&(0,l.jsx)(iu,{slot:g,alerts:it(i),isBooked:s,subLineitemAddonData:$||[]}),U&&x>0&&(null==v?void 0:v.loggedIn)&&(0,l.jsx)(h.xv,{css:{fontWeight:"$bold",fontFamily:"$manrope",fontSize:"$9i",lineHeight:"$10i",color:"$grey950"},children:(0,l.jsx)(D.Z,{value:x})}),("USER_REMOVED"===g.status||(null==g?void 0:g.status)==="UNAVAILABLE")&&(0,l.jsx)(G.Z,{failedFor:"Transfer",type:H.WK.TRANSFER,status:null==g?void 0:g.status,specialNotes:w}),(g.status===A.MR||g.status===A.RY)&&null!==f&&g.alternateAvailable&&!g.isBundled&&(0,l.jsx)(h.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation(),a?c&&c():ig(null==g?void 0:g.configKey,null==g?void 0:g.type)},disabled:s||t,css:{width:"50%",backgroundColor:"transparent",border:"1px solid $green600",borderRadius:"$3",padding:"$4i",color:"$green600",fontWeight:"$bold",fontSize:"$7i",fontFamily:"$manrope","&:hover":{backgroundColor:"$green50"}},children:f})]}),S&&S.length>0?(0,l.jsxs)(h.sg,{css:{borderTop:"1px solid $custom18",padding:"$10i $10i $4i $5i",gap:"$2i"},children:[(0,l.jsx)(h.xv,{css:{fontSize:"$8i",fontWeight:"$bold",color:"$grey950",fontFamily:"$manrope"},children:"Notes"}),(0,l.jsx)(h.xv,{css:{fontSize:"$7i",color:"$grey900",fontFamily:"$manrope",padding:"$2i 0px $2i $12i",lineHeight:"$11i"},dangerouslySetInnerHTML:{__html:S.map(i=>"<li>".concat(i,"</li>")).join("")}})]}):null,w&&w.length>0?(0,l.jsxs)(h.sg,{css:{borderTop:"1px solid $custom18",padding:"$10i $10i $4i $5i",gap:"$2i"},children:[(0,l.jsx)(h.xv,{css:{fontSize:"$8i",fontWeight:"$bold",color:"$grey950",fontFamily:"$manrope"},children:"Special Notes"}),(0,l.jsx)(h.xv,{css:{fontSize:"$7i",color:"$grey900",fontFamily:"$manrope",padding:"$2i 0px $2i $12i",lineHeight:"$11i"},dangerouslySetInnerHTML:{__html:null==w?void 0:w.map(i=>"<li>".concat(i,"</li>")).join("")}})]}):null]}),(0,l.jsxs)(h.xu,{css:{display:"none","@lg":{display:"flex",flexDirection:"column",color:"$grey09",background:"$white",overflow:"hidden",borderRadius:"$3",border:(null==g?void 0:g.status)===A.RY&&io?"1px dashed $pyellow800":"1px solid $custom18",boxShadow:"none",padding:0,"&:hover .alert-message":{backgroundColor:"$yellow00"}}},children:[g.status===A.MR||(null==g?void 0:g.status)===A.RY?(0,l.jsxs)(h.sg,{children:[(0,l.jsxs)(h.X2,{css:{gap:"10px"},children:[(null==g?void 0:g.mode)==="TRAIN"||(null==g?void 0:g.mode)==="BUS"||(null==g?void 0:g.mode)==="FERRY"?(0,l.jsxs)(h.X2,{children:[(0,l.jsx)(h.X2,{css:{display:"none","@lg":{display:"block",width:"40%",height:"100%"}},children:(0,l.jsx)(R.Z,{src:"".concat(ia(g.vehicle,g.type),"?dpr=2&w=250&h=220&fit=fill&fill=solid&auto=format,compress,enhance&q=20")})}),(0,l.jsxs)(h.sg,{css:{width:"60%"},children:[(0,l.jsx)(id,{slot:g,isBooked:s,canEditPrice:null!=ii&&ii,isAdmin:U,canModifyTransfer:il,enablePostBooking:null!=io&&io,departureDateMillis:d,campaignItinerary:null!=a&&a,openGcmAction:c,showSubLineItemAddon:is,isAOAdmin:Q,onClickUpdatePickupTime:im,onClickAddonLineItem:u,handleActionWithAddonWarning:ip,hasSubLineitemAddon:j,onDiscard:iv,addButtonText:m,islandBooked:t,enableRemove:p,handleHeaderClick:ic,transferText:f,handleTransferChnage:ig,costForDisplay:x}),(0,l.jsx)(h.iz,{css:{backgroundColor:"$m_custom48",display:"none","@lg":{display:"block",marginTop:"$8i"}}}),(0,l.jsx)(ie,{slot:g}),(0,l.jsx)(ih,{slot:g,alertKey:i,alerts:o,subLineitemAddonData:$||[]})]})]}):(0,l.jsxs)(h.sg,{children:[(0,l.jsxs)(h.X2,{css:{width:"100%"},children:[(0,l.jsx)(h.X2,{css:{alignItems:"center"},children:(0,l.jsx)(R.Z,{src:b(),mobHeight:188})}),(0,l.jsxs)(h.sg,{children:[(0,l.jsx)(id,{slot:g,isBooked:s,canEditPrice:null!=ii&&ii,isAdmin:U,canModifyTransfer:il,enablePostBooking:null!=io&&io,departureDateMillis:d,campaignItinerary:null!=a&&a,openGcmAction:c,showSubLineItemAddon:is,isAOAdmin:Q,onClickUpdatePickupTime:im,onClickAddonLineItem:u,handleActionWithAddonWarning:ip,hasSubLineitemAddon:j,onDiscard:iv,addButtonText:m,islandBooked:t,enableRemove:p,handleHeaderClick:ic,transferText:f,handleTransferChnage:ig,costForDisplay:x}),(0,l.jsx)(h.iz,{css:{backgroundColor:"$m_custom48",display:"none","@lg":{display:"block",marginTop:"$8i"}}}),(0,l.jsx)(iu,{slot:g,alerts:it(i),isBooked:s,subLineitemAddonData:$||[]})]})]}),(null==$?void 0:$.length)?(0,l.jsx)(h.sg,{css:{gap:"$8i",padding:"$8i"},children:null==$?void 0:$.map((i,e)=>{var n;return(0,l.jsx)(h.xu,{children:(0,l.jsx)(T.Z,{image:(null==i?void 0:null===(n=i.images)||void 0===n?void 0:n[0])||"https://images.pickyourtrail.com/image_placeholder_2eca9cbf61.png",title:null==i?void 0:i.title,subtitle:null==i?void 0:i.description,price:null==i?void 0:i.ourCost,tag:"Addon",costingId:null==i?void 0:i._id,status:null==i?void 0:i.status,entityType:"".concat(null==i?void 0:i.customCardEntity)})},e)})}):null]}),(0,l.jsxs)(h.X2,{css:{padding:"$8i $8i 0 $8i",justifyContent:x?"space-between":"flex-end",alignItems:"center","@lg":{display:"none"}},children:[U&&(null==v?void 0:v.loggedIn)?(0,l.jsx)(h.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)(D.Z,{value:x})}):null,(0,l.jsxs)(h.X2,{align:"center",justify:"end",css:{gap:"$2i"},children:[(m||p)&&!g.isBundled?(0,l.jsx)(h.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),a)c&&c();else{let e=()=>ic(!m&&p,null==g?void 0:g.configKey);ip(e,j)}},...m?{secondary:!0}:{danger:!0},outlined:!0,disabled:s||t,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(h.xv,{css:{fontWeight:"$bold"},children:m?"Add":p&&"Remove"})}):null,null!==f&&g.alternateAvailable&&!g.isBundled?(0,l.jsx)(h.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),a)c&&c();else{let e=()=>ig(null==g?void 0:g.configKey,null==g?void 0:g.type);ip(e,j)}},outlined:!0,disabled:s||t,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(h.xv,{css:{fontWeight:"$bold"},children:f})}):null]})]})]}),S&&(null==S?void 0:S.length)>0&&(0,l.jsxs)(h.sg,{css:{borderTop:"1px solid $m_custom48",padding:"$9i",gap:"$2i"},children:[(0,l.jsx)(h.xv,{css:{fontSize:"$9i",color:"$grey11",fontWeight:"$bolder"},children:"Notes"}),(0,l.jsx)(h.xv,{css:{color:"$grey900",padding:"$2i 0px $2i $12i",lineHeight:"$11i"},dangerouslySetInnerHTML:{__html:S.map(i=>"<li>".concat(i,"</li>")).join("")}})]}),w&&(null==w?void 0:w.length)>0&&(0,l.jsxs)(h.sg,{css:{borderTop:"1px solid $m_custom48",padding:"$9i",gap:"$2i"},children:[(0,l.jsx)(h.xv,{css:{fontSize:"$9i",color:"$grey11",fontWeight:"$bolder"},children:"Special Notes"}),(0,l.jsx)(h.xv,{css:{color:"$grey900",padding:"$2i 0px $2i $12i",lineHeight:"$11i"},dangerouslySetInnerHTML:{__html:w.map(i=>"<li>".concat(i,"</li>")).join("")}})]})]}):"USER_REMOVED"===g.status||(null==g?void 0:g.status)==="UNAVAILABLE"||"SOLD_OUT"===g.status?(0,l.jsxs)(h.xu,{children:[(0,l.jsx)(id,{slot:g,isBooked:s,canEditPrice:null!=ii&&ii,isAdmin:U,canModifyTransfer:il,enablePostBooking:null!=io&&io,departureDateMillis:d,campaignItinerary:null!=a&&a,openGcmAction:c,showSubLineItemAddon:is,isAOAdmin:Q,onClickUpdatePickupTime:im,onClickAddonLineItem:u,handleActionWithAddonWarning:ip,hasSubLineitemAddon:j,onDiscard:iv,addButtonText:m,islandBooked:t,enableRemove:p,handleHeaderClick:ic,transferText:f,handleTransferChnage:ig,costForDisplay:x}),(0,l.jsx)(G.Z,{failedFor:"Transfer",type:H.WK.TRANSFER,status:null==g?void 0:g.status,specialNotes:w}),(0,l.jsx)(h.xu,{css:{display:"block",padding:"$8i $8i 0 0","@lg":{display:"none"}},children:(0,l.jsx)(h.X2,{align:"center",justify:"end",css:{gap:"$2i"},children:(m||p)&&!g.isBundled?(0,l.jsx)(h.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),a)c&&c();else{let e=()=>ic(!m&&p,null==g?void 0:g.configKey);ip(e,j)}},secondary:!0,outlined:!0,disabled:!io&&(s||t),css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(h.xv,{css:{fontWeight:"$bold"},children:m?"Add":p&&"Remove"})}):null})})]}):(0,l.jsx)(G.Z,{failedFor:"Transfer",type:H.WK.TRANSFER,status:null==g?void 0:g.status,specialNotes:w}),(0,q.P)({permissions:null==v?void 0:v.permissions,key:N.Gz})&&(null==g?void 0:g.status)!=="UNAVAILABLE"&&(null==g?void 0:g.status)==="SUCCESS"&&ix?(0,l.jsx)(J.Z,{entity:g.entityType,configKey:g.configKey,costingId:g.costingId}):null]})]}),ix?null:(0,l.jsx)(Z.Z,{alertData:ir(i),isBooked:s,islandBooked:t,title:null==g?void 0:g.text,configKey:g.configKey})]})})),(0,l.jsx)(g.Vq.fC,{open:z,onOpenChange:()=>{W(!1)},children:(0,l.jsx)(g.Vq.VY,{overlayZindex:"$2",css:{maxWidth:"400px",padding:"$8i",borderRadius:"$3",zIndex:"$max"},children:(0,l.jsxs)(h.xu,{css:{display:"flex",flexDirection:"column",gap:"$6i"},children:[(0,l.jsx)(h.xu,{css:{fontSize:"$9i",fontWeight:"$bold",color:"$grey900",marginBottom:"$6i",display:"flex",alignItems:"center",gap:"$3i"},children:"Alert: Cannot be cancelled"}),(0,l.jsx)(h.xu,{css:{fontSize:"$6i",color:"$grey900",marginBottom:"$6i",lineHeight:"$10i",fontFamily:"$manrope",fontWeight:"$semiBold"},children:"This transfer has an add-on attached to it, please canc
1el the add-on first and then proceed with transfer cancellation/change."}),(0,l.jsx)(h.X2,{css:{gap:"$3i",justifyContent:"flex-end"},children:(0,l.jsx)(h.zx,{onClick:()=>{W(!1)},css:{backgroundColor:"$primary05",color:"$white"},children:"Continue"})})]})})})]})};var iv=ix},73828:function(i,e,n){n.d(e,{Z:function(){return O}});var l=n(85893),o=n(5335),t=n(25574),s=n(65367),r=n(91838),d=n(10206),a=n(39396),c=n(70024),u=n(11163),g=n(67294),h=n(37880),p=n(63729),x=n(16977),v=n(90083),m=n(74734),f=n(35591),y=n(25077),$=n(6478),j=n(16124),b=n(75291),C=n(44950),k=n(39502),w=n(17459),S=n(68991),I=n(11301);let T={year:31104e6,month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4},D=i=>{let e=Date.now()-i,n=Math.floor(e/T.year),l=Math.floor(e/T.month),o=Math.floor(e/T.day),t=Math.floor(e/T.hour),s=Math.floor(e/T.minute),r="Just now";return e>T.year?r=Math.floor(e/T.year)+"y":e>T.day?r=Math.floor(e/T.day)+"d":e>T.hour?r=Math.floor(e/T.hour)+"h":e>T.minute&&(r=Math.floor(e/T.minute)+"m"),{year:n,month:l,days:o,hour:t,minute:s,text:r}};var R=n(65732),z=n(93290),W=n(27627),Z=n(32459),A=n(67405),P=n(47564),B=n(20487),M=n(76522);let E=(0,o.zo)("a",{"&:hover":{fontWeight:"$bold"}}),L=i=>{var e,n;let{costing:o,alerts:T,isBooked:L,islandBooked:O,campaignItinerary:H,openGcmAction:F,locale:K,onClickAddonLineItem:Y}=i,_=(0,u.useRouter)(),{lineItemDiscardAsync:q}=(0,h.h)(),N=(0,b.Z)(),[V,U]=(0,g.useState)({show:!1,key:null,required:null}),[X,G]=(0,g.useState)(!1),J=[],Q=(0,c.b9)(C.w4),{getVisaAsync:ii}=(0,p.J)(),ie=(0,c.Dv)(C.s1),il=(0,R.P)({key:W.d5,permissions:null==ie?void 0:ie.permissions}),io=(0,g.useMemo)(()=>(null==ie?void 0:ie.loggedIn)&&O&&(0,R.P)({permissions:null==ie?void 0:ie.permissions,key:W.yj}),[O,null==ie?void 0:ie.loggedIn,null==ie?void 0:ie.permissions]),it=(0,g.useMemo)(()=>(null==ie?void 0:ie.loggedIn)&&(0,R.P)({key:W.TX,permissions:null==ie?void 0:ie.permissions}),[null==ie?void 0:ie.loggedIn,null==ie?void 0:ie.permissions]),is=(0,g.useCallback)(async(i,e)=>{var n;let l=(0,w.Z)(i),o=await ii({visaKey:l,include:e,itineraryId:"".concat(null==_?void 0:null===(n=_.query)||void 0===n?void 0:n.itineraryId),visaClass:null});(null==o?void 0:o.status)==="SUCCESS"&&(null==o?void 0:o.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),Q(o))},[ii,null==_?void 0:null===(e=_.query)||void 0===e?void 0:e.itineraryId,Q]),ir=(i,e)=>{e?G(!0):i()},id=(0,g.useCallback)(i=>{var e,n;return(null===(e=null==T?void 0:null===(n=T[i])||void 0===n?void 0:n.filter(i=>{var e;return(!i.inventory||(null===(e=i.inventory)||void 0===e?void 0:e.includes("LINE_ITEM_CARD")))&&i}))||void 0===e?void 0:e.filter(i=>!i.hasOwnProperty("privateAlert")||(null==i?void 0:i.privateAlert)===!1).map(i=>i))||[]},[T]),ia=(0,j.Z)(),ic=(0,g.useCallback)(async(i,e)=>{try{var n;let l=await q({configKey:i,entityType:e,itineraryId:"".concat(null===(n=_.query)||void 0===n?void 0:n.itineraryId)});(null==l?void 0:l.status)==="SUCCESS"&&(null==l?void 0:l.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),Q(l))}catch(o){console.error({error:o})}},[q,null==_?void 0:null===(n=_.query)||void 0===n?void 0:n.itineraryId,Q]),iu=i=>{if(!i)return[];let e=document.createElement("div");return e.innerHTML=i,Array.from(e.querySelectorAll("li")).map(i=>{var e;return(null===(e=i.textContent)||void 0===e?void 0:e.trim())||""})};return(0,l.jsxs)(l.Fragment,{children:[g.Children.toArray(Object.keys(o).map(i=>{var e,n,c,u;let g=o[i],h=null==N?void 0:null===(e=N.customCostings)||void 0===e?void 0:e.filter(i=>"VISA"===i.customCardEntity&&"CUSTOM"===i.entityType),p=null==h?void 0:h.filter(i=>(null==i?void 0:i.parentCostingId)===g.costingId),j=p&&(null===(n=null==p?void 0:p.filter(i=>i.status===$.MR))||void 0===n?void 0:n.length)>0||!1,b=(null==ie?void 0:ie.loggedIn)?(0,I.Z)({publishedCost:null==g?void 0:g.publishedCost,ourCost:null==g?void 0:g.ourCost,userDetails:ie}):0,C=null==g?void 0:g.onArrival,w=null==g?void 0:g.schengen,q=w?"Visa Guidance fees for ".concat(null==g?void 0:g.country):"Visa ".concat(C?"on arrival":"fees"," for ").concat(null==g?void 0:g.country),{text:V}=D(null==g?void 0:g.lastDataUpdatedMillis),X=iu(w?"Visa assistance is to enable the entire visa process however visa f
1illing and other requirement to be completed by customer.":null==g?void 0:null===(c=g.notes)||void 0===c?void 0:c.toString());return(null==g?void 0:g.status)===$.ew?(0,l.jsx)(P.Z,{type:k.WK.VISA,title:q,entity:null==g?void 0:g.entityType}):(0,l.jsxs)(a.sg,{as:"section",css:{marginTop:"$8i",gap:"$8i","@lg":{marginTop:0}},children:[(0,l.jsxs)(a.xu,{css:{display:"flex",flexDirection:"column",color:"$grey09",background:"$white",overflow:"hidden",borderRadius:"$5","@lg":{borderRadius:"$5",border:(null==g?void 0:g.status)===$.RY&&io?"1px dashed $pyellow800":"1px solid $grey100",borderStyle:(null==g?void 0:g.status)===$.RY&&io?"dashed":"solid",boxShadow:"none",padding:0,"&:hover .alert-message":{backgroundColor:"$yellow00"}}},children:[(0,l.jsx)(a.xu,{as:"div",css:{background:"$white",width:"100%"},children:(0,l.jsx)(a.xu,{css:{display:"flex",flexDirection:"column","@lg":{flexDirection:"row"}},children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.xu,{css:{"@lg":{display:"block",height:"auto","&>div":{height:"100%"}}},children:(0,l.jsx)(m.Z,{src:(0,S.Z)("https://images.pickyourtrail.com/images/costing_screen/placeholder/desktop/visa.png","w=250&h=180&fit=crop&auto=format,compress,enhance&q=20")})}),(0,l.jsxs)(a.xu,{css:{width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start","@lg":{display:"block"}},children:[(0,l.jsx)(a.kC,{css:{backgroundColor:"$white",borderRadius:"$2i $2i 0 0",padding:"$8i","@lg":{backgroundColor:(null==g?void 0:g.status)===$.RY&&io?"$pyellow100":"$white"}},children:(0,l.jsxs)(a.kC,{css:{justifyContent:"space-between",flexGrow:1,paddingTop:"$8i","@lg":{alignItems:"center",padding:0}},children:[(0,l.jsx)(A.Z,{type:k.WK.VISA,title:q}),(0,l.jsxs)(a.xu,{css:{display:"none","@lg":{display:"flex",alignItems:"end",rowGap:"$4i",flexDirection:"column"}},children:[b?(0,l.jsxs)(a.X2,{align:"center",css:{gap:"$3i"},children:[(0,l.jsx)(a.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)(v.Z,{value:b})}),!O&&il?(0,l.jsx)(a.xu,{css:{cursor:"pointer",paddingTop:"$2i"},onClick:()=>{if(H)F&&F();else{var i,e;let n="/customize/".concat(null==_?void 0:null===(i=_.query)||void 0===i?void 0:i.regionCode,"/inclusions/rate-match/total-cost/TOTAL_COST/").concat(null==_?void 0:null===(e=_.query)||void 0===e?void 0:e.itineraryId);(0,z.Z)(n)}},children:(0,l.jsx)(t.Z,{})}):null]}):null,(0,l.jsxs)(a.X2,{align:"center",justify:"center",css:{gap:"$2i"},children:[(null==g?void 0:g.status)===$.MR&&(it||io)?(0,l.jsxs)(d.Lt.fC,{modal:!1,children:[(0,l.jsx)(d.Lt.xz,{asChild:!0,children:(0,l.jsx)(a.zx,{secondary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold",cursor:"pointer"},children:(0,l.jsx)(s.Z,{})})}),(0,l.jsx)(d.Lt.VY,{css:{minWidth:"fit-content",padding:"$6i",zIndex:"$max",gap:"$6i",display:"flex",flexDirection:"column"},children:it&&(0,l.jsxs)(a.X2,{onClick:i=>{i.preventDefault(),i.stopPropagation(),null==Y||Y("visa",null==g?void 0:g.configKey)},css:{gap:"$6i",cursor:"pointer"},align:"center",children:[(0,l.jsx)(r.Z,{fill:"#17181C",height:"20px",width:"20px"}),(0,l.jsx)(a.xv,{css:{fontSize:"$7i",fontWeight:"$bold",lineHeight:"$10i",fontFamily:"$manrope",color:"$grey950"},children:"Add Add-on"})]})})]}):null,io&&(null==g?void 0:g.status)==="SOLD_OUT"?(0,l.jsx)(a.zx,{onClick:()=>ic(null==g?void 0:g.configKey,null==g?void 0:g.entityType),secondary:!0,outlined:!0,css:{backgroundColor:"$white",border:"1px solid $red400",boxShadow:"none",color:"$black","&:hover":{boxShadow:"none"}},children:"Discard"}):(0,l.jsx)(a.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),H)F&&F();else if((null==g?void 0:g.required)||"in"===K){let e=()=>is(null==g?void 0:g.configKey,!(null==g?void 0:g.required));ir(e,j)}else{let n=()=>U({show:!0,key:null==g?void 0:g.configKey,required:null==g?void 0:g.required});ir(n,j)}},...(null==g?void 0:g.required)?{danger:!0}:{secondary:!0},outlined:!0,disabled:("in"===K||!!O)&&((null==g?void 0:g.status)!=="USER_REMOVED"||!io)&&(O||L),css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(a.xv,{css:{fontWeight:"$bold"},children:(null==g?void 0:g.required)?"Remove":"Add"})}),(null==g?void 0:g.alternatesAvailable)&&((null==g?void 0:g.status)===$.MR&&!O||(null==g?void 0:g.status)=="TRANSIENT")?(0,l.jsx)(a.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation();let e=()=>{var i;return _.push({pathname:null===(i=_.asPath)||void 0===i?void 0:i.split("?")[0],query:{m:"change-visa",configKey:null==g?void 0:g.configKey}},void 0,{shallow:!0})};ir(e,j)},primary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(a.xv,{css:{fontWeight:"$bold"},children:"Change"})}):null]})]})]})}),(0,l.jsx)(a.iz,{css:{backgroundColor:"$m_custom48",display:"none","@lg":{display:"block"}}}),(null==g?void 0:g.status)===$.MR||(null==g?void 0:g.status)===$.RY?(0,l.jsx)(a.xu,{css:{textAlign:"right",marginTop:"$3i",marginBottom:"$5i",display:"none","@lg":{display:"block"}},children:(0,R.P)({key:W.Gw,permissions:null==ie?void 0:ie.permissions})&&(null==g?void 0:g.lastDataUpdatedMillis)?(0,l.jsx)(f.Z,{text:"Last updated ".concat(V," ago")}):null}):null,(null==g?void 0:g.status)===$.MR||(null==g?void 0:g.status)===$.RY?(0,l.jsxs)(a.xu,{css:{paddingTop:"$4i",padding:"0 $8i $8i"},children:[(0,l.jsxs)(a.xv,{css:{fontSize:"$7i",marginBottom:"$6i",lineHeight:"$10i",color:"$grey950",fontWeight:500,"@lg":{fontSize:"$7i",lineHeight:"$10i"}},children:[X.length>0&&(0,l.jsx)("ul",{style:{paddingLeft:"16px",margin:0},children:X.map((i,e)=>(0,l.jsx)("li",{style:{marginBottom:"6px"},children:i},e))}),w||C?null:(0,l.jsx)(E,{as:"a",href:"/visa",target:"_blank",children:(0,l.jsx)(l.Fragment,{children:"Know more about Visa requirements"})})]}),(0,l.jsxs)(a.kC,{css:{flexDirection:"column","@lg":{flexDirection:"row"}},children:[C?null:(0,l.jsxs)(a.xu,{css:{paddingTop:"$3i",flex:"1 0 0"},children:[(0,l.jsx)(a.xv,{css:{fontSize:"11px",marginBottom:"$2i",color:"$grey600",fontWeight:"$bolder",lineHeight:"$8i",textTransform:"uppercase",letterSpacing:"0.4px","@lg":{fontSize:"11px"}},children:"Includes:"}),(0,l.jsx)(a.xv,{css:{fontSize:"$7i",lineHeight:"$10i",color:"$grey950",fontWeight:500},children:"vietnam"===g.country?"E-Visa cost & Assistance":"Visa and related services"})]}),(null==g?void 0:g.visaClass)?(0,l.jsxs)(a.xu,{css:{paddingTop:"$3i",flex:"1 0 0"},children:[(0,l.jsx)(a.xv,{css:{fontSize:"11px",marginBottom:"$2i",color:"$grey600",fontWeight:"$bolder",lineHeight:"$8i",textTransform:"uppercase",letterSpacing:"0.4px","@lg":{fontSize:"11px"}},children:"Visa Type:"}),(0,l.jsx)(a.xv,{css:{fontSize:"$7i",lineHeight:"$10i",color:"$grey950",fontWeight:500},children:null==g?void 0:g.visaClass})]}):null]})]}):(null==g?void 0:g.status)==="USER_REMOVED"?(0,l.jsx)(B.Z,{failedFor:"Visa",type:k.WK.TRANSFER,status:null==g?void 0:g.status}):null]})]})})}),(0,l.jsx)(l.Fragment,{children:null==T?void 0:null===(u=T[i])||void 0===u?void 0:u.map(i=>{J.push(i.message)})}),J.length>0&&ia?(0,l.jsx)(Z.Z,{content:J}):null,(0,R.P)({permissions:null==ie?void 0:ie.permissions,key:W.Gz})&&"NOT_COSTED"!==g.status&&ia?(0,l.jsx)(M.Z,{entity:g.entityType,configKey:g.configKey,costingId:g.costingId}):null,(0,l.jsxs)(a.X2,{css:{padding:"$8i",justifyContent:b?"space-between":"flex-end",alignItems:"center","@lg":{display:"none"}},children:[b?(0,l.jsx)(a.xv,{css:{fontWeight:"$bolder",fontSize:"$9i",fontFamily:"$manrope"},children:(0,l.jsx)(v.Z,{value:b})}):null,(0,l.jsxs)(a.X2,{css:{gap:"$3i"},children:[(0,l.jsx)(a.zx,{onClick:i=>{if(i.preventDefault(),i.stopPropagation(),H)F&&F();else{let e=()=>is(null==g?void 0:g.configKey,!(null==g?void 0:g.required));ir(e,j)}},...(null==g?void 0:g.required)?{danger:!0}:{secondary:!0},outlined:!0,disabled:("in"===K||!!O)&&((null==g?void 0:g.status)!=="USER_REMOVED"||!io)&&(O||L),css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(a.xv,{css:{fontWeight:"$bold"},children:(null==g?void 0:g.required)?"Remove":"Add"})}),(null==g?void 0:g.alternatesAvailable)&&((null==g?void 0:g.status)===$.MR&&!O||(null==g?void 0:g.status)=="TRANSIENT")?(0,l.jsx)(a.zx,{onClick:i=>{i.preventDefault(),i.stopPropagation();let e=()=>{var i;return _.push({pathname:null===(i=_.asPath)||void 0===i?void 0:i.split("?")[0],query:{m:"change-visa",configKey:null==g?void 0:g.configKey}},void 0,{shallow:!0})};ir(e,j)},primary:!0,outlined:!0,css:{backgroundColor:"$white",fontWeight:"$bold"},children:(0,l.jsx)(a.xv,{css:{fontWeight:"$bold"},children:"Change"})}):null]})]}),(null==p?void 0:p.length)?(0,l.jsx)(a.sg,{css:{gap:"$8i",padding:"$8i"},children:null==p?void 0:p.map((i,e)=>{var n;return(0,l.jsx)(a.xu,{children:(0,l.jsx)(x.Z,{image:(null==i?void 0:null===(n=i.images)||void 0===n?void 0:n[0])||"https://images.pickyourtrail.com/image_placeholder_2eca9cbf61.png",title:null==i?void 0:i.title,subtitle:null==i?void 0:i.description,price:null==i?void 0:i.ourCost,tag:"Addon",costingId:null==i?void 0:i._id,status:null==i?void 0:i.status,entityType:"".concat(null==i?void 0:i.customCardEntity)})},e)})}):null]}),ia?null:(0,l.jsx)(y.Z,{alertData:id(g.costingId),isBooked:L,islandBooked:O,title:q,configKey:g.configKey})]})})),(0,l.jsx)(d.aR.fC,{open:null==V?void 0:V.show,children:(0,l.jsxs)(d.aR.VY,{overlayZindex:9,css:{zIndex:10,paddingTop:"$12i",paddingBottom:"$12i",width:"90%","@lg":{width:"448px"}},children:[(0,l.jsx)(d.aR.Dx,{asChild:!0,children:(0,l.jsx)(a.xv,{css:{fontSize:"$12i",fontWeight:"$bold",color:"$red500",paddingBottom:"$3i",margin:"$12i",textAlign:"center"},children:"Visa alert"})}),(0,l.jsx)(d.aR.dk,{asChild:!0,children:(0,l.jsx)(a.xv,{css:{marginTop:"$5i",lineHeight:"normal",color:"$m_custom56",fontSize:"$8i",fontWeight:300},children:"Are you sure ? Visa cost will be added for Indian passengers ONLY"})}),(0,l.jsxs)(a.kC,{css:{justifyContent:"flex-end",gap:"$6i",marginTop:"$8i"},children:[(0,l.jsx)(d.aR.$j,{asChild:!0,children:(0,l.jsx)(a.zx,{outlined:!0,secondary:!0,onClick:()=>{U({show:!1,key:null,required:null})},children:"Cancel"})}),(0,l.jsx)(d.aR.aU,{asChild:!0,children:(0,l.jsx)(a.zx,{primary:!0,onClick:()=>{U({show:!1,key:null,required:null}),is(null==V?void 0:V.key,!0)},children:"Ok, Got it"})})]})]})}),(0,l.jsx)(d.Vq.fC,{open:X,onOpenChange:()=>{G(!1)},children:(0,l.jsx)(d.Vq.VY,{overlayZindex:"$2",css:{maxWidth:"400px",padding:"$8i",borderRadius:"$3",zIndex:"$max"},children:(0,l.jsxs)(a.xu,{css:{display:"flex",flexDirection:"column",gap:"$6i"},children:[(0,l.jsx)(a.xu,{css:{fontSize:"$9i",fontWeight:"$bold",color:"$grey900",marginBottom:"$6i",display:"flex",alignItems:"center",gap:"$3i"},children:"Alert: Cannot be cancelled"}),(0,l.jsx)(a.xu,{css:{fontSize:"$6i",color:"$grey900",marginBottom:"$6i",lineHeight:"$10i",fontFamily:"$manrope",fontWeight:"$semiBold"},children:"This visa has an add-on attached to it, please cancel the add-on first and then proceed with visa cancellation/change."}),(0,l.jsxs)(a.X2,{css:{gap:"$3i",justifyContent:"flex-end"},children:[(0,l.jsx)(a.zx,{onClick:()=>{G(!1)},secondary:!0,outlined:!0,css:{backgroundColor:"$white"},children:"Cancel"}),(0,l.jsx)(a.zx,{onClick:()=>{G(!1)},css:{backgroundColor:"$primary05",color:"$white"},children:"Continue"})]})]})})})]})};var O=L},20487:function(i,e,n){var l=n(85893),o=n(640),t=n(39396),s=n(70024),r=n(67294),d=n(44950),a=n(39502),c=n(65732),u=n(27627);let g=(i,e,n,o,s)=>{switch(e){case a.WK.ACTIVITIES:case a.WK.STAY:if("USER_REMOVED"===n)return"You have removed this from itinerary!";if("SOLD_OUT"===n)return"The selected ".concat(i," was sold out. Please choose another ").concat(i,".");return"We aren't able to fetch your ".concat(i," details at the moment.Please refresh after a while..");case a.WK.TRANSFER:if(o){if("USER_REMOVED"===n)return"You have removed this from itinerary!";if("SOLD_OUT"===n)return"The selected ".concat(i," was sold out. Please choose another ").concat(i,".");return s&&s.length>0?(0,l.jsxs)(t.sg,{css:{padding:"$2i $10i $2i $10i",gap:"$2i"},children:[(0,l.jsx)(t.xv,{css:{fontSize:"17px",fontWeight:"$bolder",color:"$grey950"},children:"Special Notes"}),(0,l.jsx)(t.xv,{css:{fontSize:"15px",color:"$grey900",padding:"$2i 0px $2i $12i",lineHeight:"$11i"},dangerouslySetInnerHTML:{__html:null==s?void 0:s.map(i=>"<li>".concat(i,"</li>")).join("")}})]}):(0,l.jsxs)(l.Fragment,{children:["We aren't able to fetch your ",i," details at the moment.",(0,l.jsx)(t.xv,{css:{color:"red",fontWeight:"$bold",display:"inline"},children:"Please raise a ticket to CMS team."})]})}if("USER_REMOVED"===n)return"You have removed this from itinerary!";if("SOLD_OUT"===n)return"The selected ".concat(i," was sold out. Please choose another train.");return s&&s.length>0?(0,l.jsxs)(t.sg,{css:{padding:"0px $10i $2i $10i",gap:"$2i"},children:[(0,l.jsx)(t.xv,{css:{fontSize:"17px",fontWeight:"$bolder",color:"$grey950"},children:"Special Notes"}),(0,l.jsx)(t.xv,{css:{fontSize:"15px",color:"$grey900",padding:"$2i 0px $2i $12i",lineHeight:"$11i",fontWeight:"$semiBold"},dangerouslySetInnerHTML:{__html:null==s?void 0:s.map(i=>"<li>".concat(i,"</li>")).join("")}})]}):"We aren't able to fetch your ".concat(i," details at the moment. Please refresh after a while..");case a.WK.FLIGHT:if("USER_REMOVED"===n)return"You have removed this flight from itinerary!";return"We aren't able to fetch your ".concat(i," details at the moment. Please refresh after a while.");case a.WK.TRAIN:case a.WK.VISA:if("USER_REMOVED"===n)return"You have removed this Transfer from itinerary!";return"".concat(i," is unavailable. Try a different date");default:return"We aren't able to fetch your ".concat(i," details at the moment. Please refresh after a while.")}},h=i=>{let{failedFor:e,type:n="",status:a,onClick:h,isAdmin:p=!1,specialNotes:x}=i,v=(0,s.Dv)(d.s1),m=(0,r.useMemo)(()=>(0,c.P)({key:u.Dp,permissions:null==v?void 0:v.permissions}),[null==v?void 0:v.permissions]);return(0,l.jsxs)(t.kC,{css:{justifyContent:"space-between",flexDirection:"column",marginTop:"$6i",borderTop:"1px solid $m_custom48",padding:"$12i $6i","@lg":{padding:"$12i $6i",flexDirection:"row",width:"100%"}},children:[(0,l.jsxs)(t.kC,{css:{alignItems:"center","@lg":{width:"65%"}},children:[!x&&(0,l.jsx)(o.Z,{css:{fill:"$custom43",marginRight:"$2i",height:"$8i",width:"$8i","@lg":{height:"$12i",width:"$12i"}}}),(0,l.jsx)(t.xv,{css:{display:"none",fontSize:"$7ii",lineHeight:"$9i",color:"$grey09","@lg":{display:"block"}},children:g(e,n,a,m,x)}),!x&&(0,l.jsx)(t.xv,{css:{display:"block",fontSize:"$7i",lineHeight:"$9i",color:"$grey09","@lg":{display:"none"}},children:"".concat(e," is unavailable. Try a different date")})]}),p?(0,l.jsxs)(t.kC,{css:{width:"100%",marginTop:"$8i","@lg":{width:"auto",marginTop:0}},children:[(0,l.jsx)(t.xu,{css:{padding:"$2i $6i",borderRadius:"$sizes$2i 0 0 $sizes$2i",border:"1px solid $custom34",opacity:.6,height:"$16i",display:"block",borderRight:"none",width:"100%",textAlign:"center","@lg":{display:"none"}},children:(0,l.jsx)(t.xv,{css:{fontSize:"$8i",lineHeight:"$11i",color:"$custom34"},children:"Add"})}),h?(0,l.jsx)(t.xu,{onClick:i=>{null==i||i.preventDefault(),h&&h()},css:{padding:"$2i $6i",border:"1px solid $custom34",opacity:.6,height:"$16i",width:"100%",borderRadius:" 0 $sizes$2i $sizes$2i 0",textAlign:"center","@lg":{borderRadius:4,width:"auto"}},children:(0,l.jsx)(t.xv,{css:{fontSize:"$8i",lineHeight:"$11i",color:"$custom34"},children:"Add Custom Item"})}):null]}):null]})};e.Z=h}
1,70029:function(i,e,n){var l=n(85893),o=n(29038),t=n(24890),s=n(98061),r=n(36853),d=n(39396),a=n(70024),c=n(25675),u=n.n(c),g=n(41664),h=n.n(g);n(67294);var p=n(22623),x=n(16124),v=n(44950),m=n(65732),f=n(27627),y=n(76522);let $=i=>{var e,n;let{summary:c}=i,g=(0,a.Dv)(v.s1),$=(0,x.Z)(),j=i=>(0,l.jsx)(d.xv,{css:{fontSize:"$13",marginBottom:"0",lineHeight:"$12i",color:"$grey600",fontWeight:"$bolder",paddingBottom:"$4i",textTransform:"uppercase",letterSpacing:"0.4px","@lg":{paddingBottom:"$4i",fontSize:"$15",letterSpacing:"0.6px"}},children:i});return(0,l.jsxs)(d.xu,{css:{"@lg":{background:"$white",borderRadius:"$4"}},children:[(0,l.jsx)(d.xu,{as:"section",css:{backgroundColor:"$white",padding:"$8i $6i",maxWidth:"724px",borderRadius:"$4","@lg":{padding:"$8i",borderRadius:"$4"}},children:(0,l.jsxs)(d.xu,{css:{display:"flex",flexDirection:"column",width:"100%","@lg":{flexDirection:"row"}},children:[(0,l.jsx)(d.xu,{css:{flexBasis:"100%","@lg":{flexBasis:"50%"}},children:(0,l.jsxs)(l.Fragment,{children:[j("Inclusions"),(0,l.jsx)(p.Z,{items:null==c?void 0:null===(e=c.inclusions)||void 0===e?void 0:e.map(i=>({text:i,icon:"included"})),listItemCSS:{marginBottom:"$6i",color:"$grey950"},textCSS:{paddingLeft:"$5i"}})]})}),(0,l.jsx)(d.xu,{css:{flexBasis:"100%","@lg":{flexBasis:"50%",paddingLeft:"$8i"}},children:(0,l.jsxs)(l.Fragment,{children:[j("Exclusions"),(0,l.jsx)(p.Z,{items:null==c?void 0:null===(n=c.exclusions)||void 0===n?void 0:n.map(i=>({text:i,icon:"excluded"})),listItemCSS:{marginBottom:"$6i",color:"$grey950"},textCSS:{paddingLeft:"$5i"}}),(0,l.jsx)(d.iz,{css:{margin:"$8i 0",backgroundColor:"$m_custom48"}}),(0,l.jsxs)(d.xu,{css:{display:"flex",alignItems:"center",marginBottom:"$4i"},children:[(0,l.jsx)(d.xu,{as:"span",css:{display:"inline-block",verticalAlign:"text-bottom",width:"$12i",height:"$12i",fontStyle:"normal",background:"url(https://images.pickyourtrail.com/images/web_app/itinerary/itin_bg_v3.png) no-repeat",backgroundSize:"$sizes$12i $sizes$36i",backgroundPosition:"0 0",marginRight:"$i"}}),(0,l.jsx)(d.xv,{css:{fontSize:"$7i",marginBottom:"0",lineHeight:"$10i",color:"$custom06",fontWeight:800},children:"Pickyourtrail Mobile App"})]}),(0,l.jsx)(d.xv,{css:{fontSize:"$7i",lineHeight:"$10i",marginBottom:"$8i",display:"none",color:"$grey950","@lg":{display:"block"}},children:"Stay updated wherever you are & travel hassle-free with Pickyourtrail's mobile app."}),(0,l.jsxs)(d.xu,{css:{display:"flex"},children:[(0,l.jsx)(d.xu,{css:{flexBasis:"50%"},children:(0,l.jsx)(p.Z,{items:[{icon:(0,l.jsx)(r.Z,{css:{fill:"$grey600"}}),text:"Concierge chat"},{icon:(0,l.jsx)(t.Z,{css:{fill:"$grey600"}}),text:"Travel tools"}],textCSS:{paddingLeft:"$5i",color:"$grey700"},listItemCSS:{marginBottom:"$6i"}})}),(0,l.jsx)(d.xu,{css:{flexBasis:"50%"},children:(0,l.jsx)(p.Z,{items:[{icon:(0,l.jsx)(o.Z,{css:{fill:"$grey600"}}),text:"Voucher Manager"},{icon:(0,l.jsx)(s.Z,{css:{fill:"$grey600"}}),text:"Destination guide"}],textCSS:{paddingLeft:"$5i",color:"$grey700"},listItemCSS:{marginBottom:"$6i"}})})]}),(0,l.jsxs)(d.xu,{children:[(0,l.jsx)(d.xv,{css:{fontSize:"$7i",lineHeight:1.4,marginTop:"$5i",marginBottom:"$4i",color:"$grey700","@lg":{marginTop:"$10i"}},children:"Available on both"}),(0,l.jsxs)(d.xu,{css:{display:"flex"},children:[(0,l.jsx)(h(),{href:"https://play.google.com/store/apps/details?id=com.pickyourtrail&hl=en_IN",target:"_blank",rel:"noopener noreferrer",style:{marginRight:"12px"},children:(0,l.jsx)(u(),{src:"/images/web_app/itinerary/android.png",alt:"Android App",width:120,height:35})}),(0,l.jsx)(h(),{href:"https://apps.apple.com/in/app/pickyourtrail-travel-planner/id1400253672",target:"_blank",rel:"noopener noreferrer",children:(0,l.jsx)(u(),{src:"/images/web_app/itinerary/ios.png",alt:"ios App",width:120,height:35})})]})]})]})})]})}),(0,m.P)({permissions:null==g?void 0:g.permissions,key:f.Gz})&&$?(0,l.jsx)(y.Z,{entity:"SUMMARY",configKey:null,costingId:null}):null]})};e.Z=$},36428:function(i,e,n){n.d(e,{K2:function(){return R}});var l=n(85893),o=n(5335),t=n(10206),s=n(39396),r=n(70024),d=n(67294),a=n(44950);let c={container:{minWidth:"420px",borderRadius:16,zIndex:"$max",padding:"0 $12i",pointerEvents:"auto !important",overflow:"visible"},header:{padding:"$9i 0",borderRadius:"$3 $3 0 0",borderBottom:"1px solid $blue100"},body:{paddingTop:"$14i",gap:"$4i"},pillsContainer:{gap:"$6i",justifyContent:"flex-start"},pill:{padding:"$3i $6i",borderRadius:"$pill",fontSize:"$7i",fontWeight:"$bold",fontFamily:"$manrope"},title:{fontSize:"$10i",color:"$grey900",fontWeight:"$bolder",fontFamily:"$manrope",lineHeight:"$14i"},timeSection:{gap:"$6i",paddingTop:"$10i"},timeLabel:{fontSize:"$8i",color:"$grey700",fontWeight:"$bold",fontFamily:"$manrope"},summaryBox:{backgroundColor:"$grey50",borderRadius:"$3",padding:"$8i",border:"1px solid $grey200",marginTop:"$10i"},summaryColumn:{alignItems:"center",flex:1,borderRight:"1px solid $grey300",paddingRight:"$8i"},summaryColumnLast:{alignItems:"center",flex:1},summaryLabel:{fontSize:"$7i",color:"$grey600",fontWeight:"$normal",fontFamily:"$manrope",marginBottom:"$2i"},summaryValue:{fontSize:"$8i",color:"$grey900",fontWeight:"$bold",fontFamily:"$manrope"},actionsContainer:{display:"flex",justifyContent:"flex-end",gap:"$6i",padding:"$8i 0",borderTop:"1px solid $blue100",marginTop:"$14i"},button:{padding:"$4i $12i",borderRadius:"$3",fontSize:"$8i",fontWeight:"$bold",fontFamily:"$manrope",cursor:"pointer",height:"auto",width:"auto"},timePicker:{position:"relative"},timePickerInput:{"&:focus":{outline:"none",borderColor:"$blue500",boxShadow:"0 0 0 2px $blue100"},"&:focus-visible":{outline:"none",borderColor:"$green200",boxShadow:"0 0 0 2px $green100"}}},u=i=>{let{entityType:e,date:n}=i;return(0,l.jsxs)(s.X2,{css:c.pillsContainer,children:[(0,l.jsx)(s.xu,{css:{...c.pill,backgroundColor:"$green100",border:"1px solid $green200"},children:(0,l.jsx)(s.xv,{css:{...c.pill,color:"$green800"},children:"activity"===e?"Activity":"Transfer"})}),(0,l.jsx)(s.xu,{css:{...c.pill,backgroundColor:"$purple01",border:"1px solid $purple02"},children:(0,l.jsx)(s.xv,{css:{...c.pill,color:"$purple07"},children:n})})]})};var g=n(4327);let h=i=>{let{onClose:e,entityType:n}=i;return(0,l.jsxs)(s.X2,{css:{...c.header,justifyContent:"space-between"},children:[(0,l.jsxs)(s.xv,{css:{...c.title,fontSize:"$9i",lineHeight:"$12i"},children:["Update ","activity"===n?"Activity":"Transfer"," timings"]}),(0,l.jsx)(g.Z,{cursor:"pointer",css:{fill:"$black",height:"18px",width:"18px"},onClick:e})]})};
1var p=n(27484),x=n.n(p),v=n(11163),m=n(51138),f=n(51490),y=n(88767);let $=async(i,e,n)=>await e({url:"".concat(i.entityType,"/costing/").concat(i.costingId,"/pickup-time"),method:"PUT",body:"transfer"===i.entityType?{departureTimeInHHmm:i.pickupTimeIHHmm}:{pickupTimeInHHmm:i.pickupTimeIHHmm,startTimeInHHmm:i.startTimeIHHmm},signal:n}),j=i=>{let e=(0,f.wh)(),{mutate:n,mutateAsync:l,...o}=(0,y.useMutation)(i=>$(i,e,void 0),i);return{UseUpdatePickupTime:n,UseUpdatePickupTimeAsync:l,...o}};var b=n(75291);let C=()=>{let i=(0,v.useRouter)(),e=(0,b.Z)(),{UseGetActivityTimingsAsync:n}=(0,m.a)(),{UseUpdatePickupTimeAsync:l}=j(),[o,t]=(0,r.KO)(a.OO),[s,c]=(0,d.useState)({isLoading:!1,error:null,timingData:null,isTimePickerOpen:!1}),u=(0,d.useMemo)(()=>i.query.configKey,[i.query]),g=(0,d.useMemo)(()=>i.query.entity,[i.query]),h=(0,d.useMemo)(()=>{var i,n;if("activity"===g){let l=null==e?void 0:null===(i=e.activityCostings)||void 0===i?void 0:i.costingById["".concat(u)];return l}if("transfer"===g){let o=null==e?void 0:null===(n=e.transferCostings)||void 0===n?void 0:n.costingById["".concat(u)];return o}return null},[u,g,e]),p=(0,d.useMemo)(()=>"activity"===g?(null==h?void 0:h.activityName)||"":"transfer"===g&&(null==h?void 0:h.carName)||"",[g,h]),f=(0,d.useCallback)(async()=>{if(null==h?void 0:h.costingId){c(i=>({...i,isLoading:!0,error:null}));try{let i=await n({itineraryId:h.costingId,entityType:g});if("SUCCESS"===i.status){c(i=>({...i}));let e=i.data||[];if("transfer"===g)t(e);else{var l;t((null===(l=i.data)||void 0===l?void 0:l.pickupAndStartTimings)||[])}}else c(i=>({...i,error:"Failed to fetch activity timings"}))}catch(o){c(i=>({...i,error:"An error occurred while fetching timings"}))}finally{c(i=>({...i,isLoading:!1}))}}},[n,null==h?void 0:h.costingId,g,t]),y=(0,d.useCallback)(()=>{let i;if(h){if("activity"===g){var n;let l=null==e?void 0:e.activityById[null==h?void 0:h.activityId];i={pickupTime:(null==h?void 0:h.pickupTime)||"",startTime:(null==h?void 0:h.startTime)||(null==h?void 0:h.pickupTime)||"",duration:(null==l?void 0:null===(n=l.selectedTourGrade)||void 0===n?void 0:n.duration)||"",date:x()(null==h?void 0:h.dateMillis).format("MMM DD, YYYY")}}else i="transfer"===g?{pickupTime:"09:00",startTime:"09:00",duration:(null==h?void 0:h.duration)||"",date:x()(null==h?void 0:h.dateMillis).format("MMM DD, YYYY")}:{pickupTime:"",startTime:"",duration:"",date:x()().format("MMM DD, YYYY")};c(e=>({...e,timingData:i}))}},[h,g,e]),$=(0,d.useCallback)(i=>{c(e=>({...e,timingData:e.timingData?{...e.timingData,...i}:null}))},[]),C=(0,d.useCallback)(async(i,e)=>{if(!(null==h?void 0:h.costingId)||!g)throw c(i=>({...i,error:"Missing required data for saving"})),Error("Missing required data for saving");c(i=>({...i,isLoading:!0,error:null}));try{let n=await l({entityType:g,costingId:h.costingId,pickupTimeIHHmm:i,startTimeIHHmm:e});return c(i=>({...i,isLoading:!1})),n}catch(o){throw c(i=>({...i,isLoading:!1,error:"An error occurred while updating pickup time"})),o}},[null==h?void 0:h.costingId,g,l]),k=(0,d.useCallback)(()=>{if(!o||!Array.isArray(o))return[];let i=null==o?void 0:o.map(i=>{let e=Object.keys(i);return e.length>0?e[0]:null}).filter(Boolean);return i},[o]),w=(0,d.useCallback)(i=>{c(e=>({...e,isTimePickerOpen:i}))},[]),S=(0,d.useCallback)(()=>{t([]),c({isLoading:!1,error:null,timingData:null,isTimePickerOpen:!1}),i.push({pathname:i.asPath.split("?")[0],query:{}},void 0,{shallow:!0})},[i,t]);return(0,d.useEffect)(()=>{(null==h?void 0:h.costingId)&&(!o||0===o.length)&&s.timingData&&f()},[o,null==h?void 0:h.costingId,f,s.timingData]),(0,d.useEffect)(()=>{h&&y()},[h,y]),{state:s,title:p,currentCosting:h,fetchActivityTimings:f,updateTimingData:$,savePickupTime:C,getAvailablePickupTimes:k,toggleTimePicker:w,closeModal:S,entityType:g,availableTimes:o}},k=(i,e)=>{if(e.length>0&&"string"==typeof e[0])return{pickupTime:i,startTime:i};let n=[];e.forEach(i=>{let e=Object.keys(i);if(e.length>0){let l=e[0],o=i[l];n.push({key:l,value:o})}});let l=n.find(e=>e.key===i||e.value===i);return{pickupTime:(null==l?void 0:l.key)||null,startTime:(null==l?void 0:l.value)||null}},w=i=>
1{let{value:e,onChange:n,onFocus:o,onBlur:t,isOpen:r,placeholder:a="Select time",disabled:u=!1,availableTimes:g=[]}=i,h=(0,d.useRef)(null),[p,x]=(0,d.useState)(!1),{getAvailablePickupTimes:v}=C();(0,d.useEffect)(()=>{x(r)},[r]);let m=(0,d.useMemo)(()=>(g&&g.length>0&&"string"==typeof g[0]?g:v()).map(i=>({pickupTime:i,startTime:i})),[g,v]),f=i=>{if(i){let e=i;if(g&&g.length>0&&"string"!=typeof g[0]){let l=k(i,g);e=(null==l?void 0:l.startTime)||i}n(i,e),x(!1),setTimeout(()=>{t()},100)}},y=()=>{u||(x(!p),o())},$=()=>{u||o()};return(0,d.useEffect)(()=>{let i=i=>{h.current&&!h.current.contains(i.target)&&x(!1)};if(p)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[p]),(0,l.jsxs)(s.xu,{ref:h,css:{...c.timePicker,position:"relative"},children:[(0,l.jsxs)(s.xu,{css:{...c.timePickerInput,border:"1px solid $green500",borderRadius:"$3",padding:"$2i $4i",backgroundColor:"$white",cursor:u?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"48px",width:"20%","&:focus-within":{borderColor:"$green600",boxShadow:"0 0 0 2px rgba(34, 197, 94, 0.1)"},"&:hover":{borderColor:u?"$green500":"$green600"}},onClick:y,onFocus:$,tabIndex:u?-1:0,children:[(0,l.jsx)(s.xv,{css:{fontSize:"$8i",fontFamily:"$manrope",fontWeight:"$medium",color:e?"$grey900":"$grey500",flex:1},children:e||a}),(0,l.jsx)(s.xu,{css:{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",color:"$green500",transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"},children:(0,l.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"m6 8 4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),p&&(0,l.jsxs)(s.xu,{css:{position:"absolute",top:"100%",left:0,width:"20%",backgroundColor:"$white",border:"1px solid $green500",borderRadius:"$3",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",zIndex:"$max",maxHeight:"200px",overflowY:"auto",marginTop:"$4i"},children:[(0,l.jsx)(s.xu,{css:{padding:"$3i $4i",borderBottom:"1px solid $grey200",backgroundColor:"$grey50"},children:(0,l.jsx)(s.xv,{css:{fontSize:"$7i",fontFamily:"$manrope",fontWeight:"$medium",color:"$grey600"},children:"Select time"})}),m.map(i=>(0,l.jsxs)(s.xu,{css:{padding:"$3i $4i",cursor:"pointer",borderBottom:"1px solid $grey100",display:"flex",alignItems:"center",justifyContent:"space-between","&:hover":{backgroundColor:"$green50"},"&:last-child":{borderBottom:"none"},...e===i.pickupTime&&{backgroundColor:"$green500",color:"$white","&:hover":{backgroundColor:"$green600"}}},onClick:()=>f(i.pickupTime),children:[(0,l.jsx)(s.xv,{css:{fontSize:"$8i",fontFamily:"$manrope",fontWeight:"$medium"},children:i.pickupTime}),e===i.pickupTime&&(0,l.jsx)(s.xu,{css:{width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,l.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M16.6667 5L7.50004 14.1667L3.33337 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},i.pickupTime))]})]})},S=i=>{let{pickupTime:e,startTime:n,duration:o}=i;return e?(0,l.jsx)(s.xu,{css:c.summaryBox,children:(0,l.jsxs)(s.X2,{css:{justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsxs)(s.sg,{css:c.summaryColumn,children:[(0,l.jsx)(s.xv,{css:c.summaryLabel,children:"Pickup time:"}),(0,l.jsx)(s.xv,{css:c.summaryValue,children:e})]}),(0,l.jsxs)(s.sg,{css:c.summaryColumn,children:[(0,l.jsx)(s.xv,{css:c.summaryLabel,children:"Start time:"}),(0,l.jsx)(s.xv,{css:c.summaryValue,children:n})]}),(0,l.jsxs)(s.sg,{css:c.summaryColumnLast,children:[(0,l.jsx)(s.xv,{css:c.summaryLabel,children:"Duration:"}),(0,l.jsx)(s.xv,{css:c.summaryValue,children:o})]})]})}):null},I=i=>{var e;if(!i||""===i.trim())return{hours:0,minutes:0};let n=i.trim().match(/^(\d{1,2}):?(\d{0,2})\s*(AM|PM|am|pm)?$/i);if(!n)return{hours:0,minutes:0};let l=parseInt(n[1],10),o=parseInt(n[2]||"0",10),t=null===(e=n[3])||void 0===e?void 0:e.toUpperCase();return l<0||l>23||o<0||o>59?{hours:0,minutes:0}:(t&&("AM"===t?12===l&&(l=0):"PM"===t&&12!==l&&(l+=12)),{hours:l,minutes:o})},T=function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,[e,n]=(0,d.useState)(i||""),[l,o]=(0,d.useState)(!1),t=(0,d.useRef)(null);(0,d.useEffect)(()=>{null!=i&&""!==i&&n(i)},[i]),(0,d.useEffect)(()=>{o(!1)},[]);let s=(0,d.useCallback)(()=>
1{if(!e||""===e)return null;let i=e.match(/^(\d{2}):(\d{2})$/);if(i){let n=parseInt(i[1],10),l=parseInt(i[2],10),o=new Date;return o.setHours(n,l,0,0),o}let t=I(e);if(!t)return null;let s=new Date;return s.setHours(t.hours,t.minutes,0,0),s},[e]),r=(0,d.useCallback)(i=>{if(i){let e=i.getHours().toString().padStart(2,"0"),l=i.getMinutes().toString().padStart(2,"0"),t="".concat(e,":").concat(l);n(t)}o(!1)},[]),a=(0,d.useCallback)(()=>{o(!0)},[]),c=(0,d.useCallback)(()=>{setTimeout(()=>o(!1),150)},[]),u=(0,d.useCallback)(i=>{o(i)},[]);return(0,d.useEffect)(()=>{if(!l)return;let i=i=>{t.current&&!t.current.contains(i.target)&&o(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[l]),{selectedTime:e,isOpen:l,datePickerRef:t,getSelectedDate:s,handleTimeChange:r,handleClick:a,handleBlur:c,toggleOpen:u,setSelectedTime:n}},D=(0,o.zo)("span",{}),R=i=>{var e,n,o,g,p,x;let{showModal:v,setShowModal:m}=i,f=(0,r.b9)(a.w4),{state:y,title:$,updateTimingData:j,savePickupTime:b,closeModal:k,entityType:I,availableTimes:R}=C(),{selectedTime:z,isOpen:W,datePickerRef:Z,handleClick:A,handleBlur:P,toggleOpen:B,setSelectedTime:M}=T((null===(e=y.timingData)||void 0===e?void 0:e.pickupTime)||(null===(n=y.timingData)||void 0===n?void 0:n.startTime)||"");(0,d.useEffect)(()=>{if(v){var i,e;B(!1);let n=(null===(i=y.timingData)||void 0===i?void 0:i.pickupTime)||(null===(e=y.timingData)||void 0===e?void 0:e.startTime)||"";n!==z&&M(n)}},[v,B,y.timingData,z,M]);let E=(0,d.useCallback)(()=>{k(),setTimeout(()=>{m(!1);let i=sessionStorage.getItem("scrollPosition");i&&(window.scrollTo({top:Number(i)}),sessionStorage.removeItem("scrollPosition"))},200)},[k,m]),L=(0,d.useCallback)(async()=>{var i,e;if((null===(i=y.timingData)||void 0===i?void 0:i.pickupTime)&&(null===(e=y.timingData)||void 0===e?void 0:e.startTime))try{let n=await b(y.timingData.pickupTime,y.timingData.startTime);(null==n?void 0:n.status)==="SUCCESS"&&(f(n),E())}catch(l){console.error("Error updating pickup time:",l)}},[y.timingData,b,E,f]),O=(0,d.useCallback)((i,e)=>{M(i),j({pickupTime:i,startTime:e})},[M,j]),H=(0,d.useCallback)(()=>{E()},[E]);return(0,l.jsx)(t.Vq.fC,{open:v,children:(0,l.jsxs)(t.Vq.VY,{overlayZindex:"$max",css:{...c.container,flexDirection:"column",maxWidth:"520px","& > button":{display:"none"},"& .react-datepicker-popper":{zIndex:"9999 !important"}},children:[(0,l.jsx)(h,{title:$,onClose:E,entityType:I}),(0,l.jsxs)(s.sg,{css:c.body,children:[(0,l.jsx)(u,{entityType:I,date:(null===(o=y.timingData)||void 0===o?void 0:o.date)||""}),(0,l.jsx)(s.xv,{css:c.title,children:$}),(0,l.jsxs)(s.sg,{css:c.timeSection,children:[(0,l.jsx)(s.xv,{css:c.timeLabel,children:"Select Pickup time"}),(0,l.jsx)(s.xu,{ref:Z,children:(0,l.jsx)(w,{value:z,onChange:O,onFocus:A,onBlur:P,isOpen:W,placeholder:"Select time",availableTimes:R})})]}),(0,l.jsx)(s.X2,{css:{width:"80%"},children:(0,l.jsxs)(s.xv,{css:{fontSize:"$7i",fontFamily:"$manrope",lineHeight:"$10i",color:"$grey600",fontWeight:"$semiBold"},children:[(0,l.jsx)(D,{css:{color:"$red600",fontWeight:"$semiBold",fontSize:"$7i",fontFamily:"$manrope",lineHeight:"$10i"},children:"Note:"})," ","Some time slots are disabled to prevent overlapping with other activities."]})}),y.error&&(0,l.jsx)(s.xu,{css:{backgroundColor:"$red50",border:"1px solid $red200",borderRadius:"$3",padding:"$4i $6i",marginTop:"$4i"},children:(0,l.jsx)(s.xv,{css:{fontSize:"$7i",color:"$red700",fontFamily:"$manrope"},children:y.error})}),"activity"===I?(0,l.jsx)(S,{pickupTime:(null===(g=y.timingData)||void 0===g?void 0:g.pickupTime)||null,startTime:(null===(p=y.timingData)||void 0===p?void 0:p.startTime)||null,duration:(null===(x=y.timingData)||void 0===x?void 0:x.duration)||null}):null,(0,l.jsxs)(s.xu,{css:c.actionsContainer,children:[(0,l.jsx)(s.zx,{onClick:H,css:{...c.button,backgroundColor:"$white",border:"1px solid $grey300",color:"$grey700","&:hover":{backgroundColor:"$grey50"}},children:"Cancel"}),(0,l.jsx)(s.zx,{onClick:L,disabled:y.isLoading,css:{...c.button,backgroundColor:"$green500",border:"1px solid $green500",color:"$white","&:hover":{backgroundColor:"$green600"},"&:disabled":{backgroundColor:"$grey300",borderColor:"$grey300",cursor:"not-allowed"}},children:y.isLoading?"Saving...":"Save New Time"})]})]})]})})}},31382:function(i,e,n){var l=n(85893),o=n(4327),t=n(10206),s=n(39396),r=n(78449);let d=i=>{let{open:e=!0,onCloseModal:n,logsData:d}=i;return(0,l.jsx)(t.Vq.fC,{open:e,onOpenChange:i=>n(i),children:(0,l.jsx)(t.Vq.VY,{overlayZindex:"$max",css:{"@lg":{"& > button":{display:"none"},width:"fit-content",backgroundColor:"white",borderRadius:"$4",padding:"$24i",overflow:"scroll",zIndex:"$max",maxHeight:"70%"}},children:(0,l.jsxs)(s.sg,{css:{overflow:"scroll"},children:[(0,l.jsxs)(s.X2,{justify:"between",align:"center",children:[(0,l.jsx)(s.xv,{css:{fontSize:"$12i",lineHeight:"$10i",fontWeight:"$bolder",color:"$black"},children:"Post Booking Logs"}),(0,l.jsx)(o.Z,{height:16,width:16,onClick:()=>
1n(!1),css:{cursor:"pointer"}})]}),(0,l.jsxs)(s.X2,{align:"center",css:{marginTop:"$8i"},children:[(0,l.jsx)(s.sg,{css:{width:"145px"},children:(0,l.jsx)(s.xv,{css:{fontWeight:"$bolder",width:"145px",fontSize:"$7i",textAlign:"center",lineHeight:"1.41",color:"#2c2f42",padding:"$6i $12i",borderRight:"1px solid white",backgroundColor:"rgb(240, 240, 240)",height:"60px",display:"flex",justifyContent:"center",alignItems:"center"},children:"Entity"})}),(0,l.jsx)(s.sg,{css:{width:"145px"},children:(0,l.jsx)(s.xv,{css:{fontWeight:"$bolder",width:"145px",fontSize:"$7i",textAlign:"center",lineHeight:"1.41",color:"#2c2f42",padding:"$6i $12i",borderRight:"1px solid white",backgroundColor:"rgb(240, 240, 240)",height:"60px",display:"flex",justifyContent:"center",alignItems:"center"},children:"Action Type"})}),(0,l.jsx)(s.sg,{css:{width:"145px"},children:(0,l.jsx)(s.xv,{css:{fontWeight:"$bolder",width:"145px",fontSize:"$7i",textAlign:"center",lineHeight:"1.41",color:"#2c2f42",padding:"$6i $12i",borderRight:"1px solid white",backgroundColor:"rgb(240, 240, 240)",height:"60px",display:"flex",justifyContent:"center",alignItems:"center"},children:"Updated By"})}),(0,l.jsx)(s.sg,{css:{width:"145px"},children:(0,l.jsx)(s.xv,{css:{fontWeight:"$bolder",width:"145px",fontSize:"$7i",textAlign:"center",lineHeight:"1.41",color:"#2c2f42",padding:"$6i $12i",borderRight:"1px solid white",backgroundColor:"rgb(240, 240, 240)",height:"60px",display:"flex",justifyContent:"center",alignItems:"center"},children:"Updated At"})})]}),null==d?void 0:d.map((i,e)=>(0,l.jsxs)(s.X2,{css:{borderBottom:(null==d?void 0:d.length)==e+1?"none":"1px solid $grey02"},children:[(0,l.jsx)(s.sg,{css:{width:"145px"},children:(null==i?void 0:i.entityType)?(0,l.jsx)(s.xv,{css:{fontSize:"$8i",padding:"$6i",borderRight:"1px solid white",width:"145px",backgroundColor:"rgb(247, 247, 247)",height:"70px",display:"flex",justifyContent:"center",alignItems:"center"},children:(0,r.Z)(null==i?void 0:i.entityType)}):null}),(0,l.jsx)(s.sg,{css:{width:"145px"},children:(0,l.jsx)(s.xv,{css:{fontSize:"$8i",padding:"$6i",borderRight:"1px solid white",width:"145px",backgroundColor:"rgb(247, 247, 247)",height:"70px",display:"flex",justifyContent:"center",alignItems:"center"},children:(0,r.Z)(null==i?void 0:i.type)})}),(0,l.jsx)(s.sg,{css:{width:"145px"},children:(null==i?void 0:i.updatedBy)?(0,l.jsx)(s.xv,{css:{fontSize:"$8i",padding:"$6i",borderRight:"1px solid white",width:"145px",backgroundColor:"rgb(247, 247, 247)",height:"70px",display:"flex",justifyContent:"center",alignItems:"center"},children:null==i?void 0:i.updatedBy}):null}),(0,l.jsx)(s.sg,{css:{width:"145px"},children:(0,l.jsx)(s.xv,{css:{fontSize:"$8i",padding:"$6i",borderRight:"1px solid white",width:"145px",backgroundColor:"rgb(247, 247, 247)",height:"70px",display:"flex",justifyContent:"center",alignItems:"center"},children:null==i?void 0:i.dateTime})})]},e))]})})})};e.Z=d},72365:function(i,e,n){n.d(e,{Z:function(){return C}});var l=n(85893),o=n(5335),t=n(4327),s=n(16068),r=n(10206),d=n(39396),a=n(70024),c=n(11163),u=n(67294),g=n(63729),h=n(51490),p=n(88767);let x=async(i,e,n)=>await e({url:"visa/".concat(null==i?void 0:i.itineraryId,"/").concat(null==i?void 0:i.visaKey),method:"GET",signal:n}),v=i=>{let e=(0,h.wh)(),{mutate:n,mutateAsync:l,...o}=(0,p.useMutation)(i=>x(i,e,void 0),i);return{VisaAlternates:n,VisaAlternatesAsync:l,...o}};var m=n(75291),f=n(44950),y=n(11301),$=n(90083);let j=(0,o.zo)("a",{"&:hover":{fontWeight:"$bold"}}),b=()=>{var i,e;let n=(0,c.useRouter)(),[o,h]=(0,u.useState)(!1),[p,x]=(0,u.useState)([]),[b,C]=(0,u.useState)(null),k=(0,a.b9)(f.w4),w=(0,a.Dv)(f.s1),{VisaAlternatesAsync:S}=v(),{getVisaAsync:I}=(0,g.J)(),T=(0,m.Z)(),D=(0,u.useMemo)(()=>n.query.m,[n]),R=(0,u.useCallback)(async()=>{try{var i,e;let l=await S({itineraryId:null==T?void 0:null===(i=T.itinerary)||void 0===i?void 0:i.itineraryId,visaKey:"".concat(null==n?void 0:null===(e=n.query)||void 0===e?void 0:e.configKey)});(null==l?void 0:l.status)==="SUCCESS"&&(null==l?void 0:l.data)&&x(null==l?void 0:l.data)}catch(o){console.error("Error fetching visa alternates:",o)}},[S,null==T?void 0:null===(i=T.itinerary)||void 0===i?void 0:i.itineraryId,null==n?void 0:null===(e=n.query)||void 0===e?void 0:e.configKey]);(0,u.useEffect)(()=>{"change-visa"===D?h(!0):h(!1)},[D]),(0,u.useEffect)(()=>{o&&!(null==p?void 0:p.length)&&(null==n?void 0:n.isReady)&&R()},[null==p?void 0:p.length,R,D,null==n?void 0:n.isReady,o]);let z=(0,u.useCallback)(()=>{var i;h(!1),C(null),x([]),n.replace({pathname:null===(i=n.asPath)||void 0===i?void 0:i.split("?")[0],query:{}},void 0,{shallow:!0})},[n]),W=(0,u.useCallback)(async()=>{var i,e;let l=await I({visaKey:"".concat(null==n?void 0:null===(i=n.query)||void 0===i?void 0:i.configKey),include:(null==b?void 0:b.required)||!1,itineraryId:null==T?void 0:null===(e=T.itinerary)||void 0===e?void 0:e.itineraryId,visaClass:null==b?void 0:b.visaClass});(null==l?void 0:l.status)==="SUCCESS"&&(null==l?void 0:l.data)&&(sessionStorage.setItem("scrollPosition",window.scrollY.toString()),k(l),z())},[I,T,n,b,k,z]);return(0,l.jsx)(r.Vq.fC,{open:o,onOpenChange:h,children:(0,l.jsx)(r.Vq.VY,{overlayZindex:10,css:{width:"100%",height:"100vh",padding:"0",borderRadius:"0",zIndex:"999 !important",top:"0px",left:"0px",transform:"none",maxHeight:"100%",marginTop:"0px",willChange:"transform","& > button":{display:"none"},"@lg":{width:"688px",display:"block",borderRadius:8,top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxHeight:"624px"}},closeIcon:(0,l.jsx)(l.Fragment,{}),children:(0,l.jsxs)(d.sg,{children:[(0,l.jsxs)(d.X2,{justify:"between",css:{backgroundColor:"$grey14",padding:"$12i $9i","@lg":{padding:"$12i $16i",borderRadius:"8px 8px 0px 0px"}},children:[(0,l.jsx)(d.xv,{css:{fontFamily:"$manrope",fontStyle:"normal",fontWeight:"$bolder",fontSize:"$8i",color:"$white","@lg":{fontSize:"$9i"}},children:"Visa Alternates"}),(0,l.jsx)(t.Z,{cursor:"pointer",css:{width:"$8i",height:"$8i",fill:"$white"},onClick:z})]}),(0,l.jsx)(d.sg,{css:{overflow:"auto",height:"80vh","@lg":{height:"52vh"}},children:(0,l.jsxs)(d.sg,{css:{padding:"$12i $6i",gap:"$14i","@lg":{padding:"$12i"}},children:[null==p?void 0:p.map((i,e)=>{var n;let o=null==i?void 0:i.schengen,t=null==i?void 0:i.onArrival,r=o?"Visa Guid
1ance fees for ".concat(null==i?void 0:i.country):"Visa ".concat(t?"on arrival":"fees"," for ").concat(null==i?void 0:i.country),a=(null==b?void 0:b.visaClass)==(null==i?void 0:i.visaClass),c=(null==w?void 0:w.loggedIn)?(0,y.Z)({publishedCost:null==i?void 0:i.publishedCost,ourCost:null==i?void 0:i.ourCost,userDetails:w}):0;return(0,l.jsxs)(d.xu,{onClick:()=>C(i),css:{display:"flex",flexDirection:"column",color:"$grey09",background:"$white",overflow:"hidden",boxShadow:"0 $fontSizes$i $fontSizes$3i 0 $colors$grey02",cursor:"pointer",border:"1px solid ".concat(a?"$green500":"$custom18"),borderRadius:"$3","@lg":{boxShadow:"none","&:hover":{borderColor:"$green500"}}},children:[(0,l.jsxs)(d.X2,{justify:"between",align:"center",css:{padding:"$12i $4i",backgroundColor:"$pblue100"},children:[(0,l.jsxs)(d.xv,{css:{fontSize:"$6i",lineHeight:"$8i",fontWeight:"$bolder",color:"$grey11",textTransform:"none",wordBreak:"break-word",display:"flex",fontFamily:"$manrope","@lg":{fontSize:"$7i",lineHeight:"$10i"}},children:[r," ",(null==i?void 0:i.visaClass)?" - (".concat(null==i?void 0:i.visaClass,")"):""]}),(0,l.jsxs)(d.X2,{align:"center",css:{gap:"$6i"},children:[c?(0,l.jsx)($.Z,{value:c}):null,a?(0,l.jsx)(s.Z,{fill:"$green500",fontSize:20}):null]})]}),(0,l.jsxs)(d.xu,{css:{padding:"$4i"},children:[(0,l.jsxs)(d.xv,{css:{fontSize:"$7i",lineHeight:1.6,color:"$grey07","@lg":{fontSize:"$8i",lineHeight:"$12i"}},children:[o?"Visa assistance is to enable the entire visa process however visa filling and other requirement to be completed by customer.":null==i?void 0:null===(n=i.notes)||void 0===n?void 0:n.toString(),o||t?null:(0,l.jsx)(j,{as:"a",href:"/visa",target:"_blank",children:(0,l.jsx)(l.Fragment,{children:"Know more about Visa requirements"})})]}),t?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.xv,{css:{fontSize:"$7i",marginBottom:"$2i",lineHeight:1.2,color:"$grey09",fontWeight:"$bolder",paddingTop:"$2i","@lg":{fontSize:"$8i",lineHeight:"$9i"}},children:"Includes:"}),(0,l.jsx)(d.xv,{css:{fontSize:"$7i",lineHeight:1.2,color:"$grey09","@lg":{fontSize:"$8i",lineHeight:"$9i"}},children:"vietnam"===i.country?"E-Visa cost & Assistance":"Visa and related services"})]}),(null==i?void 0:i.visaClass)?(0,l.jsxs)(d.xu,{css:{paddingTop:"$3i"},children:[(0,l.jsx)(d.xv,{css:{fontSize:"$7i",marginBottom:"$2i",color:"$grey09",fontWeight:"$bolder",lineHeight:"$9i","@lg":{fontSize:"$8i"}},children:"Visa Type:"}),(0,l.jsx)(d.xv,{css:{fontSize:"$7i",marginBottom:"$2i",color:"$grey09","@lg":{fontSize:"$8i",lineHeight:"$9i"}},children:null==i?void 0:i.visaClass})]}):null]})]},e)}),(0,l.jsx)(d.xu,{css:{height:92}})]})}),(0,l.jsx)(d.xu,{css:{boxShadow:"0 $fontSizes$i $fontSizes$3i 0 $colors$grey02",background:"$white",position:"absolute",bottom:0,width:"100%",padding:"$12i $6i","@lg":{padding:"$12i"}},children:(0,l.jsx)(d.X2,{justify:"end",children:(0,l.jsx)(d.zx,{onClick:W,disabled:0===Object.keys(b||{}).length,primary:!0,css:{width:"157px",height:"44px"},children:(0,l.jsx)(d.xv,{css:{fontFamily:"$manrope",fontStyle:"normal",fontWeight:"$bolder",fontSize:"$7i",color:"$white",textAlign:"center"},children:"Change Visa"})})})})]})})})};var C=b},76622:function(i,e,n){n.d(e,{Z:function(){return l}});function l(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return i.replace(/#/g,"-")}}}]);
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.