"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1440],{31440:function(e,l,n){n.r(l),n.d(l,{default:function(){return _}});var t=n(27573),s=n(67754),a=n(76184),i=n(48687),c=n(7653),o=n(68055),r=n(52958),d=n(93268),u=n(34690),h=n(35797),m=n(96504),x=n(42872),v=n(81090),p=n(98590),g=n.n(p);let f=e=>{let l=[];for(let n of("string"==typeof e&&(e=[e]),e)){let[e,t]=n.split("-"),s=parseInt(e),a=(t?t.split(","):[]).map(e=>({id:g().generate(),age:e?parseInt(e):void 0})),i={id:g().generate(),adults:s,children:a};l.push(i)}return l},j=(e,l)=>{let n=e.get("currency"),t=e.get("coupon");if(!e.get("checkin")||!e.get("checkout")){let e=(0,x.zO)((0,x.iT)());return{checkin:new v.oz(e.year,e.month,e.day),checkout:new v.oz(e.add({days:1}).year,e.add({days:1}).month,e.add({days:1}).day),rooms:[{id:"0",adults:2}],currency:n,coupon:t}}let[s,a,i]=e.get("checkin").split("-"),[c,o,r]=e.get("checkout").split("-");return{checkin:new v.oz(parseInt(s),parseInt(a),parseInt(i)),checkout:new v.oz(parseInt(c),parseInt(o),parseInt(r)),rooms:f(l),currency:n,coupon:t}},y=(0,c.createContext)(null),w=()=>(0,c.useContext)(y),k=e=>{let{children:l,occupancy:n}=e,{checkin:a,checkout:i,rooms:o,currency:r,coupon:d}=j((0,s.useSearchParams)(),n),[u,h]=c.useState(d||""),[m,x]=c.useState(()=>a),[v,p]=c.useState(()=>i),[g,f]=c.useState(()=>o);return(0,c.useEffect)(()=>{g.length!==o.length&&f(o)},[n]),(0,t.jsx)(y.Provider,{value:{currency:r,checkin:m,setCheckin:x,checkout:v,setCheckout:p,rooms:g,setRooms:f,addRoom:()=>{8!==g.length&&f(e=>[...e,{id:"".concat(e.length),adults:1}])},addAdult:e=>{f(l=>l.map(l=>l.id===e?{...l,adults:l.adults+1}:l))},removeAdult:e=>{f(l=>l.map(l=>l.id===e?{...l,adults:1===l.adults?1:l.adults-1}:l))},addChild:e=>{f(l=>l.map(l=>{if(l.id===e){var n;return{...l,children:[...l.children||[],{id:"".concat((null===(n=l.children)||void 0===n?void 0:n.length)||0),age:void 0}]}}return l}))},removeChild:(e,l)=>{f(n=>n.map(n=>{if(n.id===e){var t,s;return{...n,children:(null===(t=n.children)||void 0===t?void 0:t.length)===1?[]:null===(s=n.children)||void 0===s?void 0:s.filter(e=>e.id!==l)}}return n}))},setAgeChild:(e,l,n)=>{f(t=>t.map(t=>{if(t.id===e){var s;return{...t,children:null===(s=t.children)||void 0===s?void 0:s.map(e=>e.id===l?{...e,age:n}:e)}}return t}))},removeRoom:e=>{f(l=>l.filter(l=>l.id!==e))},isChildsValid:()=>g.every(e=>!e.children||e.children.every(e=>void 0!==e.age)),coupon:u,setCoupon:h},children:l})};var N=n(96874);function b(e){let{website:l}=e,n=(0,o.eR)("blocks.search.coupon"),a=(0,s.useRouter)(),i=(0,s.usePathname)(),x=w(),v=(0,s.useSearchParams)(),p=(0,s.useParams)(),g=new URLSearchParams(v.toString()),f=decodeURIComponent(v.get("coupon")||""),j=v.get("currency")||"MXN",y=v.get("checkin")||"",k=v.get("checkout")||"",b=v.has("coupon"),[C,z]=(0,c.useState)(null),[S,E]=(0,c.useState)(null),[I,R]=(0,c.useState)(null==x?void 0:x.coupon),[Z,O]=(0,c.useState)(!1),[D,P]=(0,c.useState)(!1);(0,c.useEffect)(()=>{f||(R(void 0),z(null),O(!1))},[f]);let T=(0,c.useCallback)((e,l)=>(g.set(e,l),g.toString()),[v]);async function F(e){var n,t,s,c;e.preventDefault(),O(!0),(null==l?void 0:null===(n=l.property)||void 0===n?void 0:n.type)==="zavia"?await (0,h.Z)("promotions/validate-coupon",{lang:null==p?void 0:p.locale,hotel_id:"gzav-".concat(null==l?void 0:null===(s=l.property)||void 0===s?void 0:s.zavia_id),currency:"MXN"!==j?"USD":"MXN",arrival:y,departure:k,coupon:encodeURIComponent(I||"")}).then(async e=>{e.success?(E(null),O(!1),z(!0),a.push(i+"?"+T("coupon",encodeURIComponent((null==x?void 0:x.coupon)||""))),await new Promise(e=>setTimeout(e,2e3)),P(!1)):(E(e.message),O(!1),z(!1))}):(null==l?void 0:null===(t=l.property)||void 0===t?void 0:t.type)==="engine"?await (0,N.Z)("availability/promotions",{lang:null==p?void 0:p.locale,property_id:null==l?void 0:null===(c=l.property)||void 0===c?void 0:c.id,checkin:y,checkout:k,coupon:I?encodeURIComponent(I):void 0}).then(async e=>{e.success?(E(null),O(!1),z(!0),a.push(i+"?"+T("coupon",encodeURIComponent((null==x?void 0:x.coupon)||""))),await new Promise(e=>setTimeout(e,2e3)),P(!1)):(E(e.errors.map(e=>e.message).join(", ")),O(!1),z(!1))}):(E(null),O(!1),z(!0),a.push(i+"?"+T("coupon",encodeURIComponent((null==x?void 0:x.coupon)||""))),await new Promise(e=>setTimeout(e,2e3)),P(!1))}return(0,t.jsx)("div",{children:(0,t.jsxs)(m.VqE,{open:D,onOpenChange:P,children:[(0,t.jsx)(m.hgM,{asChild:!0,children:(0,t.jsx)("div",{className:"w-full flex justify-center",children:(0,t.jsx)(m.zxk,{className:"text-center text-xs gap-2 items-center rounded-full bg-background text-primary hover:bg-background hover:text-primary",size:"sm",children:b?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Z,{size:14,className:"text-lime-500"})," ",n("applied",{coupon:f})]}):n("label")})})}),(0,t.jsxs)(m.cZJ,{onOpenAutoFocus:e=>e.preventDefault(),className:"border-border shadow-none",children:[(0,t.jsx)(m.fKu,{children:(0,t.jsx)(m.$N8,{children:n("label")})}),(0,t.jsxs)("div",{className:"flex gap-2 flex-col w-full",children:[(0,t.jsxs)("div",{className:"w-full flex gap-2 items-center",children:[(0,t.jsx)(m.IIB,{className:(0,m.cn)("w-full bg-transparent border-border"),onChange:e=>{null==x||x.setCoupon(e.target.value),R(e.target.value)},defaultValue:I,autoFocus:!1}),f&&(0,t.jsx)(m.zxk,{type:"button",onClick:async e=>{e.preventDefault(),null==x||x.setCoupon(""),R(""),z(null),g.delete("coupon"),a.push(i+"?"+g.toString()),await new Promise(e=>setTimeout(e,3e3)),P(!1)},variant:"destructive",children:(0,t.jsx)(d.Z,{size:16})})]}),!f&&(0,t.jsx)(m.zxk,{type:"button",disabled:C||0===Number(null==I?void 0:I.length)||Z,onClick:e=>{F(e)},className:"w-full gap-2 bg-primary text-primary-foreground",children:Z?(0,t.jsx)(u.Z,{size:16,className:"animate-spin"}):C?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Z,{size:16})," ",n("validating")]}):n("apply")})]}),S&&(0,t.jsx)(m.bZj,{variant:"destructive",className:"text-sm text-center text-red-800 py-2",children:S})]})]})})}var C=n(38880),z=n(7220),S=n(57466),E=n(61581),I=n(1871),R=n(30649);let Z=(e,l,n)=>{let t=l.day<10?"0".concat(l.day):l.day,s=l.month<10?"0".concat(l.month):l.month,a=l.year,i=n.day<10?"0".concat(n.day):n.day,c=n.month<10?"0".concat(n.month):n.month,o=n.year,r=[["checkin","".concat(a,"-").concat(s,"-").concat(t)],["checkout","".concat(o,"-").concat(c,"-").concat(i)]];return e.reduce((e,l)=>{var n;let t=l.children&&l.children.length>0?"-".concat(null===(n=l.children)||void 0===n?void 0:n.map(e=>e.age).join(",")):"",s=["occupancy","".concat(l.adults).concat(t)];return e.push(s),e},r)};var O=n(55671),D=n(31124),P=n(22034),T=n(39135);function F(e){let{searchOptions:l}=e,n=(0,o.eR)("blocks.search"),s=w(),a=null==s?void 0:s.rooms.reduce((e,l)=>{var n;let t=(null===(n=l.children)||void 0===n?void 0:n.length)||0;return e+l.adults+t},0),i=null==s?void 0:s.isChildsValid(),c=null==l?void 0:l.acceptChildren,r=null==l?void 0:l.childrenMinAge,d=null==l?void 0:l.childrenMaxAge;return(0,t.jsx)("div",{className:"flex flex-col gap-2",children:(0,t.jsx)(m.xrM,{className:"h-full",children:(0,t.jsxs)("div",{className:"flex max-h-[60vh] flex-col gap-2 md:max-h-[300px]",children:[i&&20!==a?null:(0,t.jsxs)("div",{className:"sticky top-0 z-50 flex flex-col gap-2",children:[i?null:(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-sm bg-yellow-200 text-yellow-800 px-4 py-2",children:[(0,t.jsx)(O.Z,{size:18}),(0,t.jsx)("p",{className:"text-sm",children:n("searchEngine.ageChildrenAlert",{startLimit:r||0,endLimit:d||17})})]}),20===a?(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-sm bg-red-200 px-4 py-2",children:[(0,t.jsx)(O.Z,{size:18}),(0,t.jsx)("p",{className:"text-sm",children:n("searchEngine.guestLimit")})]}):null]}),(0,t.jsx)("div",{className:"grid max-h-[60vh] gap-2 md:max-h-[300px] md:grid-cols-2",children:null==s?void 0:s.rooms.map((e,l)=>{var i,o,u,h;return(0,t.jsxs)(m.Zbd,{className:"relative flex w-full flex-col gap-2 rounded-md border",children:[(0,t.jsx)(m.Ol2,{className:"pb-2",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[" ",(0,t.jsx)(m.llK,{className:"text-lg",children:n("searchEngine.roomNumber",{roomNumber:l+1})}),l>0&&(0,t.jsx)(m.zxk,{onClick:()=>null==s?void 0:s.removeRoom(e.id),variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full border-red-700 text-red-700 hover:bg-red-100 hover:text-red-950",children:(0,t.jsx)(D.Z,{size:18})})]})}),(0,t.jsxs)(m.aYP,{className:(0,m.cn)("space-y-1",!!(null===(i=e.children)||void 0===i?void 0:i.length)&&"pb-2"),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("p",{className:"text-sm",children:n("searchEngine.adults")}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(m.zxk,{size:"icon",variant:"outline",className:"h-8 w-8 rounded-full",disabled:1===e.adults,onClick:()=>null==s?void 0:s.removeAdult(e.id),children:(0,t.jsx)(P.Z,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"w-10 text-center",children:e.adults}),(0,t.jsx)(m.zxk,{variant:"outline",size:"icon",className:"h-8 w-8 rounded-full",disabled:14===e.adults||20===a,onClick:()=>null==s?void 0:s.addAdult(e.id),children:(0,t.jsx)(T.Z,{className:"h-3 w-3"})})]})]}),c&&(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm",children:n("searchEngine.children")}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:n("searchEngine.ageChildren",{startLimit:r||0,endLimit:d||17})})]}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(m.zxk,{size:"icon",variant:"outline",className:"h-8 w-8 rounded-full",disabled:!e.children||0===e.children.length,onClick:()=>{if(e.children&&e.children.length>0){let l=e.children.length-1;null==s||s.removeChild(e.id,e.children[l].id)}},children:(0,t.jsx)(P.Z,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"w-10 text-center",children:(null===(o=e.children)||void 0===o?void 0:o.length)||0}),(0,t.jsx)(m.zxk,{variant:"outline",size:"icon",className:"h-8 w-8 rounded-full",disabled:(null===(u=e.children)||void 0===u?void 0:u.length)===6||20===a,onClick:()=>null==s?void 0:s.addChild(e.id),children:(0,t.jsx)(T.Z,{className:"h-3 w-3"})})]})]})]}),c&&(null===(h=e.children)||void 0===h?void 0:h.length)?(0,t.jsxs)(m.eWM,{className:"flex flex-col items-start justify-start gap-2",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:n("searchEngine.ageOfChildren")}),(0,t.jsx)("div",{className:"grid w-full grid-cols-3 gap-2",children:e.children.map((l,a)=>{var i;let c=void 0!==l.age,o=null===(i=l.age)||void 0===i?void 0:i.toString();return(0,t.jsxs)(m.PhF,{value:o,onValueChange:n=>{null==s||s.setAgeChild(e.id,l.id,parseInt(n,10))},children:[(0,t.jsxs)(m.i4d,{className:(0,m.cn)("relative w-full text-xs",!c&&"border-2 border-yellow-500"),children:[c?null:(0,t.jsxs)("span",{className:"absolute -right-1 -top-1.5 flex h-3 w-3",children:[(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-yellow-500 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex h-3 w-3 rounded-full bg-yellow-500"})]}),(0,t.jsx)(m.kik,{placeholder:"#".concat(a+1)})]}),(0,t.jsx)(m.Bwz,{position:"item-aligned",sideOffset:10,children:(0,t.jsx)(m.DIV,{children:[...Array(18).keys()].slice(r||0,d+1||18).map((e,l)=>(0,t.jsx)(m.QlF,{value:e.toString(),children:0===e?n("searchEngine.ageChildrenUnderOne"):e},"".concat(e,"-").concat(l)))})})]},l.id)})})]}):null]},l)})})]})})})}var A=n(4750);function U(e){let{setOpen:l,property:n,calendarId:a}=e,i=(0,o.eR)("blocks.search"),r=(0,s.useParams)(),d=w(),u=(0,s.usePathname)(),{push:h,replace:v}=(0,s.useRouter)(),[p,g]=(0,c.useState)(!1),[f,j]=(0,c.useTransition)(),y=null==d?void 0:d.rooms.length,k=null==d?void 0:d.rooms.reduce((e,l)=>{var n;let t=(null===(n=l.children)||void 0===n?void 0:n.length)||0;return e+l.adults+t},0),N=(0,A.r)(),[b,C]=(0,c.useState)(),[z,O]=(0,c.useState)(),D=Intl.DateTimeFormat().resolvedOptions().timeZone;(0,c.useEffect)(()=>{let e=new Intl.DateTimeFormat(r.locale,{dateStyle:"medium",timeZone:D});(null==d?void 0:d.checkin)&&(null==d?void 0:d.checkout)&&(C(e.format(d.checkin.toDate(D))),O(e.format(d.checkout.toDate(D))))},[null==d?void 0:d.checkin,null==d?void 0:d.checkout,r.locale,D]);let P=()=>{if(!d)return;let e=Z(d.rooms,d.checkin,d.checkout),l=d.rooms.map(e=>{let{adults:l,children:n}=e,t=null==n?void 0:n.map(e=>e.age).join(",");return"".concat(l).concat(t?"-".concat(t):"")}),t=(0,x.zO)((0,x.iT)()),s=t.hour,a=t.minute,i=t.second,c=d.checkin.set({hour:s,minute:a,second:i}),o=d.checkout.set({hour:s,minute:a,second:i});N({eventName:"Select dates",eventData:{hotel:n,arrival:c.toDate((0,x.iT)()).toISOString(),departure:o.toDate((0,x.iT)()).toISOString(),occupancy:l,currency:d.currency,nights:o.subtract({days:c.day}).day,rooms:d.rooms.length,lang:r.locale}});let m=new URLSearchParams(e),f=u.match(/\/[0-9a-f-]{36}/),y="/".concat(r.locale,"/availability?").concat(decodeURIComponent(m.toString()));f&&(y="".concat(f[0]).concat(y)),j(()=>((null==u?void 0:u.includes("availability"))?v("".concat(u,"?").concat(decodeURIComponent(m.toString()))):h(y),g(!p)))};(0,c.useEffect)(()=>{let e=document.getElementById("rooms-container");p&&e&&(e.scrollIntoView(),g(!1))},[p]);let T=null==d?void 0:d.rooms.every(e=>!e.children||e.children.every(e=>void 0!==e.age));return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(m.zxk,{id:a,size:"lg",variant:"ghost",onClick:()=>l(e=>({status:!e.status,content:e.status?void 0:"calendar"})),className:"gap-4 text-md whitespace-nowrap w-full my-1 hover:bg-black/5 hover:text-foreground",children:[(0,t.jsx)(S.Z,{size:18,className:"opacity-60"}),b||(0,t.jsx)(m.OdW,{className:"h-4 w-20 bg-foreground/10"}),(0,t.jsx)(E.Z,{size:18,className:"opacity-60"}),z||(0,t.jsx)(m.OdW,{className:"h-4 w-20 bg-foreground/10"})]}),(0,t.jsxs)(m.zxk,{id:"selector-guests",size:"lg",variant:"ghost",onClick:()=>l(e=>({status:!e.status,content:e.status?void 0:"guests"})),className:"gap-4 text-md whitespace-nowrap w-full my-1 hover:bg-black/5 hover:text-foreground",children:[T?null:(0,t.jsxs)("span",{className:"absolute -right-1 -top-1.5 flex h-3 w-3",children:[(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-yellow-500 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex h-3 w-3 rounded-full bg-yellow-500"})]}),(0,t.jsx)(I.Z,{size:18,className:"opacity-60"}),i("searchEngine.guests",{count:k})," - ",i("searchEngine.rooms",{count:y})]}),(0,t.jsx)(m.zxk,{id:"eventButtonSearchAvailability",disabled:f,size:"lg",onClick:e=>{if(T)e.preventDefault(),l({status:!1,content:void 0}),P();else{l({status:!0,content:"guests"});return}},className:"gap-4 text-md whitespace-nowrap w-full my-1",children:f?(0,t.jsx)(R.Z,{size:18,className:"animate-spin opacity-60"}):i("searchEngine.search")})]})}function V(e){let{mode:l,open:n,handleSetValue:a,searchOptions:i}=e,c=w(),o=(0,s.useParams)(),r=z.Z.get(C.Xm)||"en-US";return(0,t.jsx)(t.Fragment,{children:"calendar"===n.content?(0,t.jsx)(m.Vv,{mode:l,locale:r,localeFromParams:o.locale,minValue:(0,x.Lg)((0,x.iT)()),defaultValue:{start:null==c?void 0:c.checkin,end:null==c?void 0:c.checkout},value:{start:null==c?void 0:c.checkin,end:null==c?void 0:c.checkout},onChange:e=>e&&a(e)}):(0,t.jsx)(F,{searchOptions:i})})}function L(e){let{property:l,searchOptions:n}=e,s=(0,o.eR)("blocks.search"),a=w(),[i,r]=(0,c.useState)({status:!1,content:void 0}),d=null==a?void 0:a.rooms.length,u=null==a?void 0:a.rooms.reduce((e,l)=>{var n;let t=(null===(n=l.children)||void 0===n?void 0:n.length)||0;return e+l.adults+t},0),h=(0,c.useCallback)(e=>{let l=e.start,n=e.end;n.toString()===l.toString()&&(n=n.add({days:1})),null==a||a.setCheckin(l),null==a||a.setCheckout(n),r(e=>({status:e.status,content:"guests"}))},[a]),[x,v]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let e=()=>{v(window.innerHeight<=650)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,t.jsxs)(m.J2e,{open:i.status,children:[(0,t.jsx)(m.xol,{asChild:!0,children:(0,t.jsx)("div",{role:"button",className:"w-full items-center flex gap-2 flex-col md:flex-row",children:(0,t.jsx)(U,{setOpen:r,property:l,calendarId:"selector-dates"})})}),(0,t.jsxs)(m.yky,{className:"flex w-[var(--radix-popover-content-available-width)] flex-col gap-4 p-8 md:w-[var(--radix-popover-trigger-width)]",onInteractOutside:e=>{e.target instanceof HTMLButtonElement||r(e=>({status:!1,content:e.content}))},side:"bottom",align:"start",style:x?{position:"absolute"}:void 0,children:["guests"===i.content?(0,t.jsxs)("div",{className:"flex flex-col space-y-1.5 text-left",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:s("searchEngine.setupGuestTitle")}),(0,t.jsx)("p",{className:"text-sm opacity-60",children:s("searchEngine.setupGuestDescription")})]}):null,(0,t.jsx)(V,{mode:"double",open:i,handleSetValue:h,searchOptions:n}),"guests"===i.content?(0,t.jsx)("div",{className:"flex justify-end w-full",children:(0,t.jsx)(m.zxk,{size:"sm",variant:"outline",disabled:8===d||20===u,onClick:()=>null==a?void 0:a.addRoom(),children:s("searchEngine.addAnotherRoom")})}):null]})]})}function M(e){let{property:l,searchOptions:n}=e,s=(0,o.eR)("blocks.search"),a=w(),i=(0,c.useCallback)(e=>{let l=e.start,n=e.end;n.toString()===l.toString()&&(n=n.add({days:1})),null==a||a.setCheckin(l),null==a||a.setCheckout(n)},[a]),[r,d]=(0,c.useState)({status:!1,content:void 0}),u=null==a?void 0:a.checkout.subtract({years:null==a?void 0:a.checkin.year,months:null==a?void 0:a.checkin.month,days:null==a?void 0:a.checkin.day}),h=null==a?void 0:a.rooms.reduce((e,l)=>{var n;let t=(null===(n=l.children)||void 0===n?void 0:n.length)||0;return e+l.adults+t},0),x=null==a?void 0:a.rooms.length,v=null==a?void 0:a.isChildsValid();return(0,t.jsxs)(m.yoO,{open:r.status,children:[(0,t.jsx)(m.aM_,{className:"w-full",asChild:!0,children:(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(U,{setOpen:d,property:l,calendarId:"selector-dates-mobile"})})}),(0,t.jsxs)(m.uei,{onCloseIcon:()=>d(()=>({status:!1,content:void 0})),onEscapeKeyDown:()=>d(()=>({status:!1,content:void 0})),className:"flex w-full flex-col gap-10 p-6 md:w-1/2 md:max-w-2xl",children:[(0,t.jsx)(m.Tuv,{className:"text-left",children:"calendar"===r.content?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.bCQ,{children:s("searchEngine.setupCalendarTitle")}),(0,t.jsx)(m.Eig,{children:s("searchEngine.setupCalendarDescription")})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.bCQ,{children:s("searchEngine.setupGuestTitle")}),(0,t.jsx)(m.Eig,{children:s("searchEngine.setupGuestDescription")})]})}),(0,t.jsx)(V,{mode:"infinite",open:r,handleSetValue:i,searchOptions:n}),(0,t.jsx)(m.FFO,{className:"fixed bottom-0 left-0 w-full p-6 border-t",children:"calendar"===r.content?(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)("p",{className:"text-center",children:s("searchEngine.nights",{count:null==u?void 0:u.day})}),(0,t.jsx)(m.swg,{asChild:!0,children:(0,t.jsx)(m.zxk,{className:"text-base",onClick:()=>{d(()=>({status:!1,content:void 0}))},children:s("searchEngine.confirm")})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.zxk,{variant:"outline",className:"w-full",disabled:8===x||20===h,onClick:()=>null==a?void 0:a.addRoom(),children:s("searchEngine.addAnotherRoom")}),(0,t.jsx)(m.swg,{asChild:!0,children:(0,t.jsx)(m.zxk,{className:"w-full",disabled:!v,onClick:e=>{if(!v){e.preventDefault();return}d(()=>({status:!1,content:void 0}))},children:s("searchEngine.confirm")})})]})})]})]})}function _(e){var l;let{website:n,component:c,searchOptions:o}=e,r=(0,s.usePathname)(),d=(0,a.Z)(c);return(0,t.jsx)(k,{occupancy:null===(l=n.providerConstants)||void 0===l?void 0:l.occupancy,children:(0,t.jsx)("section",{className:"w-full bg-background relative z-[1]",style:d,children:(0,t.jsxs)(i.Z,{className:"flex flex-col max-w-4xl md:px-0",children:[(0,t.jsxs)("div",{className:"w-full bg-secondary border py-1 px-2 text-foreground rounded-md",children:[(0,t.jsx)("div",{className:"hidden md:block",children:(0,t.jsx)(L,{searchOptions:o,property:null==n?void 0:n.name})}),(0,t.jsx)("div",{className:"block md:hidden",children:(0,t.jsx)(M,{searchOptions:o,property:null==n?void 0:n.name})})]}),(null==o?void 0:o.acceptCoupon)&&r.includes("availability")&&(0,t.jsx)(b,{website:n})]})})})}}}]);