1import{e as $r,r as f,as as Nr,j as r,I as Z,t as Ke,n as Co,R as Ee,ar as Nn,g as Eo,ao as Cc,b as At,a4 as Ec,aa as $c,ac as Zo,ad as er,a as Nc,aH as Tc,L as $t,k as $o,m as Pc,p as Ic,W as Rc}from"./mkt-entry-6742fae4.js";import{z as Mc,E as Oc,F as De,G as Tr,H as tr,J as Ac,K as Tn,L as An,N as Pr,O as No,P as Bc,Q as Lc,S as Dc,U as gn,i as vn,V as Ir,W as To,X as Fc,Y as Hc,Z as bn,_ as Po,$ as qc,a0 as Ks,a1 as Rr,a2 as Vc,a as rt,n as tn,a3 as nr,a4 as fo,a5 as zc,a6 as Wc,a7 as Io,a8 as Uc,a9 as Gc,b as Qt,aa as Yc,ab as Kc,ac as Xc,ad as Qc,ae as Jc,af as Zc,f as Mr,ag as po,ah as Xs,ai as Qs,aj as Js,ak as el,al as tl,am as or,an as Or,ao as nl,ap as Ar,aq as ol,ar as rl,as as al,at as sl,au as il,av as Zs,aw as ei,u as ti,ax as cl,ay as ll,az as dl,aA as _l,aB as ul,aC as Ea,aD as ni,aE as fl,aF as $a,M as _n,aG as pl,aH as rr,aI as ho,k as Ct,aJ as mo,aK as go,aL as oi,aM as Na,aN as hl,aO as ml,aP as Mt,aQ as ri,aR as ai,aS as gl,aT as vl,C as bl,aU as Ta,aV as yl,aW as Wn,aX as wl,aY as xl,aZ as kl,a_ as Pa,a$ as Sl,b0 as si,b1 as Ia,b2 as ii,b3 as jl,b4 as Cl,b5 as El,b6 as $l,b7 as Nl,b8 as Lo,b9 as Tl,ba as Ra,bb as Pl,bc as Il,bd as Rl}from"./mkt-9723916c.js";import{j as lt,h as Ce,M as Pn,J as kt,s as yn,_ as Tt,a1 as Ma}from"./mkt-ffd710f0.js";import{P as ci,j as Bt,V as Ml,m as In,q as Lt,d as vo,u as Et,o as Ol,B as Br,p as un,E as Al,k as Bl}from"./mkt-15fd7c4a.js";import{l as ct,s as Ll,E as Ut}from"./mkt-72efcf43.js";import{useDispatch as Vt,useSelector as Dl}from"./mkt-39bccf5a.js";import{M as Lr}from"./mkt-19d02a93.js";import{T as ar,C as Dr}from"./mkt-c3f96628.js";import{R as Bn}from"./mkt-9309312f.js";import{a as Fl}from"./mkt-d452c0b0.js";import{useSnackbar as Jt}from"./mkt-c827a10a.js";import{P as Hl}from"./mkt-4dcde2dc.js";import"./mkt-0445d994.js";import"./mkt-6a0b4b66.js";import"./mkt-58f68ba0.js";import"./mkt-43f80bb3.js";import"./mkt-33871b5e.js";import"./mkt-561ac149.js";import"./mkt-bed850ba.js";import"./mkt-a10033db.js";import"./mkt-654bcad8.js";const ql=({isOpen:e,onClose:t,dest:n,trip:o,location:s})=>{const{user:i}=lt();Mc();const a=$r(),c=Vt(),{getUrl:l}=Oc(n==null?void 0:n.city,n==null?void 0:n.country,n==null?void 0:n.startDate,n==null?void 0:n.endDate);if(f.useEffect(()=>{const x=P=>{P.key==="Escape"&&t()};return e&&document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[e,t]),!e||!n)return null;const d=n.cityEnglish||n.city||n.normalised_city||"Unknown",u=(x,P)=>{if(!x&&!P)return"";const I=L=>L.getDate().toString(),R=L=>L.toLocaleDateString("en-GB",{month:"short"});if(x&&P){const L=new Date(x),D=new Date(P);return L.getMonth()===D.getMonth()&&L.getFullYear()===D.getFullYear()?`${I(L)}â${I(D)} ${R(L)}`:`${I(L)} ${R(L)}â${I(D)} ${R(D)}`}if(x){const L=new Date(x);return`${I(L)} ${R(L)}`}return""},p=x=>{if(!x.startDate||!x.endDate)return x.duration||0;const P=Ac(new Date(x.endDate),new Date(x.startDate));return P>0?P:x.duration||0},h=u(n.startDate,n.endDate),g=p(n),m=`${g} night${g!==1?"s":""} ⢠${h} ⢠2 guests`,v=`${d} ⢠${h}`,j=()=>{if(c(Tn(n)),o!=null&&o.name&&(n!=null&&n.slug)){t(),a.push(`/trip/${encodeURIComponent(o.name)}/${encodeURIComponent(n.slug)}/accommodations`);return}const x=n.latitude||0,P=n.longitude||0,I=n.startDate?new Date(n.startDate).toISOString().split("T")[0]:"",R=n.endDate?new Date(n.endDate).toISOString().split("T")[0]:"",L=btoa(JSON.stringify([{adults:2,children:[]}])),D=`https://stippl.nuitee.link/hotels?placeId=${encodeURIComponent(`${x},${P}`)}&name=${encodeURIComponent(d)}&checkin=${I}&checkout=${R}&rooms=1&adults=2&occupancies=${encodeURIComponent(L)}&sorting=1&language=en¤cy=EUR`;window.open(D,"_blank","noopener,noreferrer"),t()},S=/\/accommodations(?:\/|$)/.test(a.location.pathname),_=()=>{if(t(),!o)return;const x=n?{destId:n._id,city:d,dateRange:h}:void 0;if(S){window.dispatchEvent(new CustomEvent("hotel-add-custom-stay",{detail:x}));return}a.push(Bt(o),{openTripBoard:"ideas",addToDestination:x})},M=["Booking.com","Expedia","Hostelworld","Airbnb","Agoda","Trip.com"].map(x=>ci.find(P=>
1P.name===x)).filter(Boolean);return Nr.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De.overlay,onClick:t}),r.jsxs("div",{className:De.modal,children:[r.jsxs("div",{className:De.header,children:[r.jsxs("div",{className:De.headerText,children:[r.jsxs("h2",{className:De.title,children:["Add Stay to ",d]}),r.jsx("span",{className:De.subtitle,children:m})]}),r.jsx("button",{className:De.closeBtn,onClick:t,type:"button",children:r.jsx(Z,{name:"close",size:12,fill:"currentColor"})})]}),r.jsxs("div",{className:De.body,children:[r.jsxs("button",{className:De.searchStipplBtn,type:"button",onClick:j,children:[r.jsx("div",{className:De.iconWrap,children:r.jsx(Z,{name:"search",size:16,fill:"currentColor"})}),r.jsxs("div",{className:De.btnContent,children:[r.jsx("span",{className:De.btnTitle,children:"Search on Stippl"}),r.jsxs("span",{className:De.btnSub,children:["Browse hotels in ",d]})]}),r.jsx(Z,{name:"chevron-right",size:8,fill:"#c3cfd2",classname:De.chevron})]}),r.jsxs("button",{className:De.customStayBtn,type:"button",onClick:_,children:[r.jsx("div",{className:De.iconWrap,children:r.jsx(Z,{name:"edit-pencil",size:16,stroke:"currentColor"})}),r.jsxs("div",{className:De.btnContent,children:[r.jsx("span",{className:De.btnTitle,children:"Add custom stay"}),r.jsx("span",{className:De.btnSub,children:"Enter details in your trip"})]}),r.jsx(Z,{name:"chevron-right",size:8,fill:"currentColor",classname:De.chevron})]}),r.jsxs("div",{className:De.partnersSection,children:[r.jsxs("div",{className:De.partnersHeader,children:[r.jsx("span",{className:De.partnersTitle,children:"Find hotels at partners"}),r.jsx("span",{className:De.partnersSubtitle,children:"VIA PARTNERS"})]}),r.jsx("div",{className:De.partnersList,children:M.map((x,P)=>{const{url:I,source:R}=l(x.name,i==null?void 0:i.username),L=Tr(x.name);return r.jsxs("a",{href:I,target:"_blank",rel:"noopener noreferrer",className:De.partnerRow,onClick:()=>Ke("affiliate_clicked",{provider:L,provider_raw:L?void 0:x.name,category:tr(L)??"accommodation",url_source:R,placement:"modal_cta",position:P},s),children:[r.jsxs("div",{className:De.partnerLeft,children:[r.jsx("img",{src:x.logo,alt:x.name,className:De.partnerLogo}),r.jsx("span",{className:De.partnerName,children:x.name}),x.popular&&r.jsx("span",{className:De.popularBadge,children:"POPULAR"})]}),r.jsxs("div",{className:De.partnerRight,children:[r.jsx("span",{className:De.partnerPill,children:v}
1),r.jsx(Z,{name:"chevron-right",fill:"currentColor",size:8})]})]},x.name)})})]}),r.jsxs("div",{className:De.prefilledNotice,children:[r.jsx(Z,{name:"check",size:14,fill:"var(--color-primary)"}),r.jsx("span",{children:"Your dates & destination are pre-filled"})]})]}),r.jsx("div",{className:De.footer,children:"Prices and availability shown on partner sites may differ."})]})]}),document.body)},Vl=()=>{const{isBusinessMode:e}=Co();return!e};const zl=({item:e,currentDestination:t,itemsInPlan:n=[],isPlanned:o=!1,onAdd:s,onAddStart:i,onAddSuccess:a,onAddError:c,onRemove:l,openForPlace:d,onPlaceCardClick:u,onSaveToList:p,days:h})=>{var q,z,V,W,te,E,B,G,N,K,ee,se,je,be,ge;const g=An(),m=Pr(),{isBookmarked:v,bookmark:j,ensurePlace:S}=No("activity"),{user:_}=lt(),$=v(e),M=async re=>{if(re.stopPropagation(),$){p(e);return}try{await j(e)}catch(U){console.error("Bookmark failed",U)}},x=!!(e!=null&&e.attraction)&&!(e!=null&&e.fsq_id)&&!(e!=null&&e.productCode),P=(e==null?void 0:e.name)||(e==null?void 0:e.title);let I=null;if(Array.isArray(e==null?void 0:e.images)&&e.images.length){const re=e.images[0];typeof re=="string"?I=re.startsWith("place_")?`https://media.stippl.io/${re}`:re:(z=(q=re==null?void 0:re.variants)==null?void 0:q[0])!=null&&z.url?I=((V=re.variants.find(U=>U.width>=200))==null?void 0:V.url)??re.variants[0].url:re!=null&&re.url&&(I=re.url)}else(W=e==null?void 0:e.photos)!=null&&W[0]&&(I=`${e.photos[0].prefix}original${e.photos[0].suffix}`);const R=(e==null?void 0:e.rating)||((te=e==null?void 0:e.reviews)==null?void 0:te.combinedAverageRating),L=(e==null?void 0:e.address)||((E=e==null?void 0:e.location)==null?void 0:E.formatted_address)||((B=e==null?void 0:e.location)==null?void 0:B.address),D=(e==null?void 0:e._id)||(e==null?void 0:e.externalId)||(e==null?void 0:e.fsq_id)||(e==null?void 0:e.productCode)||(e==null?void 0:e.tour_id)||(e==null?void 0:e.id)||(e==null?void 0:e.googlePlaceId),H=((G=e==null?void 0:e.price)==null?void 0:G.currency)||((N=e==null?void 0:e.fromPrice)==null?void 0:N.currency)||((K=e==null?void 0:e.lowestPrice)==null?void 0:K.currency)||((ee=e==null?void 0:e.retailPrice)==null?void 0:ee.currency)||(e==null?void 0:e.currency)||null,b=(()=>{var re,U,we,Se,$e,Ae,Fe;return typeof(e==null?void 0:e.price)=="number"?e.price:typeof((re=e==null?void 0:e.price)==null?void 0:re.amount)=="number"?e.price.amount:typeof((U=e==null?void 0:e.fromPrice)==null?void 0:U.amount)=="number"?e.fromPrice.amount:typeof((we=e==null?void 0:e.lowestPrice)==null?void 0:we.amount)=="number"?e.lowestPrice.amount:typeof((Se=e==null?void 0:e.retailPrice)==null?void 0:Se.amount)=="number"?e.retailPrice.amount:typeof(($e=e==null?void 0:e.price)==null?void 0:$e.value)=="number"?e.price.value:typeof((Fe=(Ae=e==null?void 0:e.pricing)==null?void 0:Ae.summary)==null?void 0:Fe.fromPrice)=="number"?e.pricing.summary.fromPrice:null})(),y=()=>{const re=(e==null?void 0:e.productUrl)||(e==null?void 0:e.url);re&&window.open(Lt(re,_==null?void 0:_.username),"_blank")},k=(()=>e!=null&&e.__typename.includes("Viator")?Ml:e!=null&&e.__typename.includes("Tripadvisor")?Bc:Lc)(),T=o||Array.isArray(n)&&n.some(re=>{var U,we;return re?!!([D,e==null?void 0:e.googlePlaceId,e==null?void 0:e.hotel_id,e==null?void 0:e.link].includes(re)||e!=null&&e.externalId&&e.externalId===re||(U=e==null?void 0:e.metadata)!=null&&U.id&&e.metadata.id===re||Array.isArray((we=e==null?void 0:e.metadata)==null?void 0:we.sourceIds)&&e.metadata.sourceIds.includes(re)):!1}),O=f.useMemo(()=>{if(!T||!Array.isArray(h)||!h.length)return null;const re=ce=>{var xe,Ve,Ye,_e,ve;const Pe=((Ve=(xe=ce==null?void 0:ce.place)==null?void 0:xe.metadata)==null?void 0:Ve.id)||((Ye=ce==null?void 0:ce.place)==null?void 0:Ye._id)||(ce==null?void 0:ce.placeId)||(ce==null?void 0:ce.place)||(ce==null?void 0:ce.id);return Pe?[D,e==null?void 0:e.googlePlaceId,e==null?void 0:e.hotel_id,e==null?void 0:e.link].includes(Pe)||(e==null?void 0:e.externalId)&&e.externalId===Pe||((_e=e==null?void 0:e.metadata)==null?void 0:_e.id)&&e.metadata.id===Pe||Array.isArray((ve=e==null?void 0:e.metadata)==null?void 0:ve.sourceIds)&&e.metadata.sourceIds.includes(Pe):!1},U=[];for(const ce of h)if(Array.isArray(ce==null?void 0:ce.items))for(const Pe of ce.items)re(Pe)&&U.push({day:ce,it:Pe});if(!U.length)return null;const we=(t==null?void 0:t._id)&&U.find(({it:ce})=>String(ce==null?void 0:ce.destinationId)===String(t._id))||U[0],{day:Se,it:$e}=we,Ae=(t==null?void 0:t.city)||(t==null?void 0:t.cityEnglish)||(Se==null?void 0:Se.city)||"",Fe=Se!=null&&Se.date?In(Se.date).format("Do MMMM"):"";return{bookingStatus:($e==null?void 0:$e.bookingStatus)||"Booked",startTime:$e==null?void 0:$e.startTime,endTime:$e==null?void 0:$e.endTime,date:`${Ae}${Ae&&Fe?", ":""}${Fe}`}},[h,D,e,T,t]);return r.jsxs("div",{className:`acco-list-card ${T&&O?"in-trip":""}`,style:{cursor:T?"pointer":"default"},onClick:()=>{T&&(u==null||u())},children:[r.jsx("div",{className:"image",children:x?r.jsx("div",{className:"place-image-wrapper",children:r.jsx(Dc,{src:I||"",attraction:(e==null?void 0:e.attraction)||"activity",icon:(e==null?void 0:e.icon)||"star--outlined"})}):r.jsx(gn,{src:I,type:"activity",articleType:"activity",color:"primary3",label:(je=(se=e==null?void 0:e.categories)==null?void 0:se[0])==null?void 0:je.name})}),r.jsxs("div",{className:"content",children:[r.jsxs("div",{className:"top__activity",children:[r.jsx(Z,{name:(e==null?void 0:e.icon)||"star--outlined",size:14}),r.jsx("h3",{className:"title",children:P}),R?r.jsxs("div",{className:"rating",children:[r.jsx(Z,{name:"star--filled",size:14}),r.jsx("span",{children:Math.round(R*10)/10}),(be=e==null?void 0:e.reviews)!=null&&be.totalReviews?r.jsx("span",{children:`(${(ge=e==null?void 0:e.reviews)==null?void 0:ge.totalReviews})`}):null]}):null]}),L?r.jsx("div",{className:"address",children:L}):null,e!=null&&e.description?r.jsx("p",{className:"description",children:e.description}):null,r.jsxs("div",{className:`bottom ${T?"in-trip":""}`,children:[!g&&r.jsx("div",{className:"cta",onClick:y,children:b!==null?r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"price",children:[r.jsx("img",{src:k,alt:"tour-logo",className:"tour-logo"}),r.jsx(vn,{value:b,baseCurrency:H,decimals:0})]}),r.jsx("span",{className:"price-subtext",children:"per ticket"}),r.jsx(Z,{name:"externalLink",size:14})]}):null}),t?r.jsxs("div",{className:"actions",children:[r.jsx("div",{onClick:M,className:`actions__button--activity ${$?"bookmarked":""}`,children:r.jsx(Z,{name:$?"bookmark":"bookmark-outline"})}),r.jsx("div",{onClick:async re=>{if(re.stopPropagation(),T)l==null||l(e);else if(d){i==null||i(e);try{const U=await S(e);if(!U){c==null||c(e);return}a==null||a(U,e),d({...e,_id:U},{isAccommodation:(e==null?void 0:e.type)==="accommodation"||(e==null?void 0:e.attraction)==="accommodation"})}catch{c==null||c(e)}}else s==null||s()},className:`actions__button--activity ${T?"in-trip":""}`,children:r.jsx(Z,{name:T?"tick":"plus",size:14})})]}):null]}),O&&r.jsxs(r.Fragment,{children:[r.jsx("hr",{className:"intrip-separator"}),r.jsxs("div",{className:"intrip-info",children:[O.bookingStatus==="confirmed"&&r.jsxs("div",{className:"intrip-info__label--activity",children:[r.jsx(Z,{name:"tick",size:14}),r.jsx("span",{children:"Booked"})]}),!m&&(O.startTime||O.endTime)&&r.jsxs("div",{className:"intrip-info__label--activity",children:[r.jsx(Z,{name:"clock",size:14}),r.jsx("span",{children:O.startTime&&O.endTime?`${O.startTime} - ${O.endTime}`:O.startTime||O.endTime})]}),!m&&O.date&&r.jsxs("div",{className:"intrip-info__label--activity",children:[r.jsx(Z,{name:"calendar",size:14}),r.jsx("span",{children:O.date})]})]})]})]})]})},Oa=f.memo(zl);var Kt=[],Wl=function(){return Kt.some(function(e){return e.activeTargets.length>0})},Ul=function(){return Kt.some(function(e){return e.skippedTargets.length>0})},Aa="ResizeObserver loop completed with undelivered notifications.",Gl=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:Aa}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=Aa),window.dispatchEvent(e)},Rn;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Rn||(Rn={}));var Xt=function(e){return Object.freeze(e)},Yl=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,Xt(this)}return e}(),li=function(){function e(t,n,o,s){return this.x=t,this.y=n,this.width=o,this.height=s,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Xt(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,o=t.y,s=t.top,i=t.right,a=t.bottom,c=t.left,l=t.width,d=t.height;
vendor: 4,172 bytes, line 1
1return{x:n,y:o,top:s,right:i,bottom:a,left:c,width:l,height:d}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Fr=function(e){return e instanceof SVGElement&&"getBBox"in e},di=function(e){if(Fr(e)){var t=e.getBBox(),n=t.width,o=t.height;return!n&&!o}var s=e,i=s.offsetWidth,a=s.offsetHeight;return!(i||a||e.getClientRects().length)},Ba=function(e){var t;if(e instanceof Element)return!0;var n=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Kl=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Cn=typeof window<"u"?window:{},Un=new WeakMap,La=/auto|scroll/,Xl=/^tb|vertical/,Ql=/msie|trident/i.test(Cn.navigator&&Cn.navigator.userAgent),yt=function(e){return parseFloat(e||"0")},sn=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new Yl((n?t:e)||0,(n?e:t)||0)},Da=Xt({devicePixelContentBoxSize:sn(),borderBoxSize:sn(),contentBoxSize:sn(),contentRect:new li(0,0,0,0)}),_i=function(e,t){if(t===void 0&&(t=!1),Un.has(e)&&!t)return Un.get(e);if(di(e))return Un.set(e,Da),Da;var n=getComputedStyle(e),o=Fr(e)&&e.ownerSVGElement&&e.getBBox(),s=!Ql&&n.boxSizing==="border-box",i=Xl.test(n.writingMode||""),a=!o&&La.test(n.overflowY||""),c=!o&&La.test(n.overflowX||""),l=o?0:yt(n.paddingTop),d=o?0:yt(n.paddingRight),u=o?0:yt(n.paddingBottom),p=o?0:yt(n.paddingLeft),h=o?0:yt(n.borderTopWidth),g=o?0:yt(n.borderRightWidth),m=o?0:yt(n.borderBottomWidth),v=o?0:yt(n.borderLeftWidth),j=p+d,S=l+u,_=v+g,$=h+m,M=c?e.offsetHeight-$-e.clientHeight:0,x=a?e.offsetWidth-_-e.clientWidth:0,P=s?j+_:0,I=s?S+$:0,R=o?o.width:yt(n.width)-P-x,L=o?o.height:yt(n.height)-I-M,D=R+j+x+_,H=L+S+M+$,b=Xt({devicePixelContentBoxSize:sn(Math.round(R*devicePixelRatio),Math.round(L*devicePixelRatio),i),borderBoxSize:sn(D,H,i),contentBoxSize:sn(R,L,i),contentRect:new li(p,l,R,L)});return Un.set(e,b),b},ui=function(e,t,n){var o=_i(e,n),s=o.borderBoxSize,i=o.contentBoxSize,a=o.devicePixelContentBoxSize;switch(t){case Rn.DEVICE_PIXEL_CONTENT_BOX:return a;case Rn.BORDER_BOX:return s;default:return i}},Jl=function(){function e(t){var n=_i(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=Xt([n.borderBoxSize]),this.contentBoxSize=Xt([n.contentBoxSize]),this.devicePixelContentBoxSize=Xt([n.devicePixelContentBoxSize])}return e}(),fi=function(e){if(di(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Zl=function(){var e=1/0,t=[];Kt.forEach(function(a){if(a.activeTargets.length!==0){var c=[];a.activeTargets.forEach(function(d){var u=new Jl(d.target),p=fi(d.target);c.push(u),d.lastReportedSize=ui(d.target,d.observedBox),p<e&&(e=p)}),t.push(function(){a.callback.call(a.observer,c,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,o=t;n<o.length;n++){var s=o[n];s()}return e},Fa=function(e){Kt.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(fi(s.target)>e?n.activeTargets.push(s):n.skippedTargets.push(s))})})},ed=function(){var e=0;for(Fa(e);Wl();)e=Zl(),Fa(e);return Ul()&&Gl(),e>0},Do,pi=[],td=function(){return pi.splice(0).forEach(function(e){return e()})},nd=function(e){if(!Do){var t=0,n=document.createTextNode(""),o={characterData:!0};new MutationObserver(function(){return td()}).observe(n,o),Do=function(){n.textContent="".concat(t?t--:t++)}}pi.push(e),Do()},od=function(e){nd(function(){requestAnimationFrame(e)})},co=0,rd=function(){return!!co},ad=250,sd={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ha=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],qa=function(e){return e===void 0&&(e=0),Date.now()+e},Fo=!1,id=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=ad),!Fo){Fo=!0;var o=qa(t);od(function(){var s=!1;
1try{s=ed()}finally{if(Fo=!1,t=o-qa(),!rd())return;s?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,sd)};document.body?n():Cn.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ha.forEach(function(n){return Cn.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ha.forEach(function(n){return Cn.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),sr=new id,Va=function(e){!co&&e>0&&sr.start(),co+=e,!co&&sr.stop()},cd=function(e){return!Fr(e)&&!Kl(e)&&getComputedStyle(e).display==="inline"},ld=function(){function e(t,n){this.target=t,this.observedBox=n||Rn.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=ui(this.target,this.observedBox,!0);return cd(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),dd=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),Gn=new WeakMap,za=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Yn=function(){function e(){}return e.connect=function(t,n){var o=new dd(t,n);Gn.set(t,o)},e.observe=function(t,n,o){var s=Gn.get(t),i=s.observationTargets.length===0;za(s.observationTargets,n)<0&&(i&&Kt.push(s),s.observationTargets.push(new ld(n,o&&o.box)),Va(1),sr.schedule())},e.unobserve=function(t,n){var o=Gn.get(t),s=za(o.observationTargets,n),i=o.observationTargets.length===1;s>=0&&(i&&Kt.splice(Kt.indexOf(o),1),o.observationTargets.splice(s,1),Va(-1))},e.disconnect=function(t){var n=this,o=Gn.get(t);o.observationTargets.slice().forEach(function(s){return n.unobserve(t,s.target)}),o.activeTargets.splice(0,o.activeTargets.length)},e}(),_d=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Yn.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ba(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Yn.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ba(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Yn.unobserve(this,t)},e.prototype.disconnect=function(){Yn.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();const ud=Ee[typeof document<"u"&&document.createElement!==void 0?"useLayoutEffect":"useEffect"],fd=ud,pd=e=>{const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),t},hd=pd,md=typeof window<"u"&&"ResizeObserver"in window?window.ResizeObserver:_d;function gd(){}function vd(e,t){const n=yd(),o=hd(t);return fd(()=>{let s=!1;const i=e&&"current"in e?e.current:e;if(!i)return gd;function a(c,l){s||o.current(c,l)}return n.subscribe(i,a),()=>{s=!0,n.unsubscribe(i,a)}},[e,n,o]),n.observer}function bd(){let e=!1,t=[];const n=new Map,o=new md((s,i)=>{t=t.concat(s);function a(){const c=new Set;for(let l=0;l<t.length;l++){if(c.has(t[l].target))continue;c.add(t[l].target);const d=n.get(t[l].target);d==null||d.forEach(u=>u(t[l],i))}t=[],e=!1}e||window.requestAnimationFrame(a),e=!0});return{observer:o,subscribe(s,i){var a;o.observe(s);const c=(a=n.get(s))!==null&&a!==void 0?a:[];c.push(i),n.set(s,c)},unsubscribe(s,i){var a;const c=(a=n.get(s))!==null&&a!==void 0?a:[];if(c.length===1){o.unobserve(s),n.delete(s);return}const l=c.indexOf(i);l!==-1&&c.splice(l,1),n.set(s,c)}}}let Ho;const yd=()=>Ho||(Ho=bd());const wd=({title:e,text:t,icon:n})=>r.jsxs("div",{className:"empty-page-placeholder",children:[r.jsx("div",{className:"icon-rounded",children:r.jsx(Z,{name:n})}),r.jsx("h2",{children:e}),r.jsx("p",{children:t})]}),xd=({contentFilter:e,setContentFilter:t,items:n,scrolled:o,scrollToContent:s,type:i="regular"})=>{var v,j;const a=f.useRef(),[c,l]=f.useState(0),[d,u]=f.useState(!1);let p=n;const h=S=>{a.current.scrollLeft+=S,l(c+S),Math.floor(a.current.scrollWidth-a.current.scrollLeft)<=a.current.offsetWidth?u(!0):u(!1)},g=()=>{l(a.current.scrollLeft),Math.floor(a.current.scrollWidth-a.current.scrollLeft)<=a.current.offsetWidth?u(!0):u(!1)};f.useEffect(()=>{var S,_;return a.current&&((S=a==null?void 0:a.current)==null?void 0:S.scrollWidth)===((_=a==null?void 0:a.current)==null?void 0:_.offsetWidth)?u(!0):u(!1),()=>{}},[(v=a==null?void 0:a.current)==null?void 0:v.scrollWidth,(j=a==null?void 0:a.current)==null?void 0:j.offsetWidth,o,n,u]);const m=()=>{var S;return r.jsxs("nav",{className:`filter-nav ${o&&"fixed"}`,children:[r.jsx("div",{className:"scroll",ref:a,onScroll:g,children:i==="regular"?r.jsxs(r.Fragment,{children:[r.jsx("div",{onClick:()=>{t("all")},className:`filter-item ${e==="all"&&"active"}`,children:"All"}),n==null?void 0:n.map(_=>r.jsx("div",{onClick:()=>{t((_==null?void 0:_._id)||(_==null?void 0:_.id))},className:`filter-item ${e===(_==null?void 0:_._id)||e===(_==null?void 0:_.id)?"active":""}`,children:_==null?void 0:_.name},_==null?void 0:_._id))]}):i==="continent"||i==="profile"?r.jsxs(r.Fragment,{children:[i==="profile"?r.jsx("div",{onClick:()=>{t("all")},className:`filter-item ${e==="all"&&"active"}`,children:"All"}):null,p==null?void 0:p.map((_,$)=>r.jsx("div",{className:`filter-item ${e===(_==null?void 0:_.value)?"active":null}`,onClick:()=>{t(_==null?void 0:_.value),s&&s()},children:_==null?void 0:_.name},$))]}):i==="trips"?r.jsxs(r.Fragment,{children:[r.jsx("div",{onClick:()=>{t("all")},className:`filter-item ${e==="all"&&"active"}`,children:"All"}),(S=ct.uniqBy(n,"name"))==null?void 0:S.map(_=>r.jsx("div",{onClick:()=>{t(_==null?void 0:_.name)},className:`filter-item ${e===(_==null?void 0:_.name)&&"active"}`,children:_==null?void 0:_.name},_==null?void 0:_.name))]}):null}),Ce?null:r.jsxs("div",{className:`arrow-controls ${c===0&&d?"hidden":null} `,children:[r.jsx("div",{className:`arrow prev ${c===0&&"disabled"}`,onClick:()=>c!==0&&h(-250),children:r.jsx(Z,{name:"triangleArrow"})}),r.jsx("div",{className:`arrow next ${d&&"disabled"}`,onClick:()=>!d&&h(250),children:r.jsx(Z,{name:"triangleArrow"})})]})]})};return r.jsx(r.Fragment,{children:m()})};const on=({items:e,loading:t=!1,disableScroll:n=!1,placeholder:o={title:"Nothing found",icon:"article"},filterItems:s,activeFilter:i,setActiveFilter:a,gridSize:c="normal",columns:l})=>{var j;const d=f.useRef(),p=(j=(S=>{const[_,$]=f.useState();return f.useLayoutEffect(()=>{var M;S&&$((M=S==null?void 0:S.current)==null?void 0:M.getBoundingClientRect())},[S]),vd(S,M=>$(M.contentRect)),_})(d))==null?void 0:j.width,h=c==="normal"?1440:c==="small"?1200:1800,g=c==="normal"?1e3:c==="small"?800:1440,m=c==="normal"||c==="small"?620:740,v=()=>l||(p>h?"col-4":p>g?"col-3":p>m||Ce||Ce?"col-2":"col-1");return r.jsxs("div",{className:`content-grid-container ${n||t?"no-scroll":""} ${s?"content-grid-filters":""}`,ref:d,children:[s?r.jsx(xd,{items:s,contentFilter:i,setContentFilter:a}):null,t?r.jsx("div",{style:{height:150,marginBottom:50},children:r.jsx(Ir,{text:"Loading"})}):(e==null?void 0:e.length)>0?r.jsx("div",{className:`content-grid ${v()}`,children:e}):r.jsx(wd,{title:o==null?void 0:o.title,text:o==null?void 0:o.text,icon:o==null?void 0:o.icon})]})}
1,kd=(e,t)=>{if(!(e!=null&&e.checkIn&&(e!=null&&e.checkOut))&&!(!(t!=null&&t.startDate)||!(t!=null&&t.endDate)))return{checkIn:t.startDate,checkOut:t.endDate}},Sd="___react_component_tooltip_1lt1d_259",jd="_show_1lt1d_279",Cd="_tags__attribute_1lt1d_283",Ed="_marker_1lt1d_308",$d="_SingleDatePickerInput__withBorder_1lt1d_330",Nd="_DateInput_1lt1d_330",Td="_DateInput_fang_1lt1d_330",Pd="_DateRangePickerInput_1lt1d_331",Id="_SingleDatePicker_picker_1lt1d_335",Rd="_DateInput_fangShape_1lt1d_340",Md="_DateInput_fangStroke_1lt1d_344",Od="_DateRangePicker_picker_1lt1d_348",Ad="_active_1lt1d_425",Bd="_scrolled_1lt1d_484",Ld="_logo_1lt1d_489",Dd="_inversed_1lt1d_515",Fd="_editor_1lt1d_526",Hd="_spin_1lt1d_2085",qd="_small_1lt1d_638",Vd="_count_1lt1d_659",zd="_error_1lt1d_674",Wd="_success_1lt1d_683",Ud="_label_1lt1d_767",Gd="_actions_1lt1d_832",Yd="_flag_1lt1d_836",Kd="_chip_1lt1d_900",Xd="_remove_1lt1d_936",Qd="_trip_1lt1d_1053",Jd="_sleep_1lt1d_1056",Zd="_todo_1lt1d_1059",e_="_cuisine_1lt1d_1062",t_="_arrow_1lt1d_1069",n_="_checkmark_1lt1d_1118",o_="_notice_1lt1d_1169",r_="_warning_1lt1d_1180",a_="_BrainhubCarousel__container_1lt1d_1206",s_="_BrainhubCarouselItem_1lt1d_1209",i_="_BrainhubCarousel__customArrows_1lt1d_1222",c_="_save_1lt1d_1372",l_="_add_1lt1d_1375",d_="_distance_1lt1d_1408",__="_placeholder_1lt1d_1557",u_="_content_1lt1d_1628",f_="_help_1lt1d_1712",p_="_help__button_1lt1d_1726",h_="_help__menu_1lt1d_1754",m_="_hidden_1lt1d_1798",g_="_meta_1lt1d_1954",v_="_dates_1lt1d_1962",b_="_destination_1lt1d_1853",y_="_articles_1lt1d_1985",w_="_acco_1lt1d_1991",x_="_days_1lt1d_1994",k_="_destinations_1lt1d_1853",S_="_spinner_1lt1d_2085",j_="_icon_1lt1d_707",C_="_grid_1lt1d_2230",E_="_tags_1lt1d_283",$_="_green_1lt1d_2365",N_="_orange_1lt1d_2368",T_="_transparent_1lt1d_2371",P_="_title_1lt1d_2417",I_="_flow_1lt1d_2421",R_="_fadeInTop_1lt1d_1",M_={"hotel-booking-flow":"_hotel-booking-flow_1lt1d_20","ai-chat-open":"_ai-chat-open_1lt1d_24","scroll-lock":"_scroll-lock_1lt1d_119","sub-text":"_sub-text_1lt1d_172","base-color1":"_base-color1_1lt1d_177","base-primary-1":"_base-primary-1_1lt1d_178","base-color2":"_base-color2_1lt1d_186","base-primary-2":"_base-primary-2_1lt1d_187","base-color3":"_base-color3_1lt1d_195","base-primary-3":"_base-primary-3_1lt1d_196","base-color4":"_base-color4_1lt1d_204","base-primary-4":"_base-primary-4_1lt1d_205","base-grey":"_base-grey_1lt1d_213","base-bg1":"_base-bg1_1lt1d_220","col-50":"_col-50_1lt1d_224","react-confirm-alert":"_react-confirm-alert_1lt1d_233","react-confirm-alert-overlay":"_react-confirm-alert-overlay_1lt1d_233","react-confirm-alert-body":"_react-confirm-alert-body_1lt1d_237","react-confirm-alert-button-group":"_react-confirm-alert-button-group_1lt1d_251",__react_component_tooltip:Sd,"type-error":"_type-error_1lt1d_269",show:jd,tags__attribute:Cd,marker:Ed,"open-up":"_open-up_1lt1d_330",SingleDatePickerInput__withBorder:$d,DateInput:Nd,DateInput_fang:Td,DateRangePickerInput:Pd,SingleDatePicker_picker:Id,DateInput_fangShape:Rd,DateInput_fangStroke:Md,DateRangePicker_picker:Od,"profile-settings-menu":"_profile-settings-menu_1lt1d_355","dropdown-toggle":"_dropdown-toggle_1lt1d_363","user-menu":"_user-menu_1lt1d_406",active:Ad,"link-account":"_link-account_1lt1d_453","mobile-bar":"_mobile-bar_1lt1d_474",scrolled:Bd,logo:Ld,"menu-icon":"_menu-icon_1lt1d_492","page-title":"_page-title_1lt1d_498",inversed:Dd,editor:Fd,"editor-toolbar":"_editor-toolbar_1lt1d_532","rdw-option-wrapper":"_rdw-option-wrapper_1lt1d_543","rdw-option-active":"_rdw-option-active_1lt1d_549","rdw-dropdown-wrapper":"_rdw-dropdown-wrapper_1lt1d_563","rdw-link-modal":"_rdw-link-modal_1lt1d_566","rdw-link-modal-target-option":"_rdw-link-modal-target-option_1lt1d_577","rdw-link-modal-buttonsection":"_rdw-link-modal-buttonsection_1lt1d_585","editor-textarea":"_editor-textarea_1lt1d_592","public-DraftEditorPlaceholder-root":"_public-DraftEditorPlaceholder-root_1lt1d_605","rdw-link-decorator-wrapper":"_rdw-link-decorator-wrapper_1lt1d_609","submit-row":"_submit-row_1lt1d_614",spin:Hd,"total-planned":"_total-planned_1lt1d_628","circle-progressbar":"_circle-progressbar_1lt1d_634",small:qd,"CircularProgressbar-background":"_CircularProgressbar-background_1lt1d_644","CircularProgressbar-path":"_CircularProgressbar-path_1lt1d_650","CircularProgressbar-trail":"_CircularProgressbar-trail_1lt1d_653",count:Vd,error:zd,success:Wd,"error-in-plan":"_error-in-plan_1lt1d_689","icon-rounded":"_icon-rounded_1lt1d_707","img-placeholder":"_img-placeholder_1lt1d_724","custom-tooltip":"_custom-tooltip_1lt1d_762",label:Ud,"nothing-there":"_nothing-there_1lt1d_803",actions:Gd,flag:Yd,"quick-menu__horizontal":"_quick-menu__horizontal_1lt1d_851","icon-circle":"_icon-circle_1lt1d_867","delete-research":"_delete-research_1lt1d_890",delete:"_delete_1lt1d_890",chip:Kd,remove:Xd,"multi-action-btn":"_multi-action-btn_1lt1d_959","hover-btn":"_hover-btn_1lt1d_963","bottom-align":"_bottom-align_1lt1d_968","right-align":"_right-align_1lt1d_1010",trip:Qd,sleep:Jd,todo:Zd,cuisine:e_,arrow:t_,"select-box":"_select-box_1lt1d_1078",checkmark:n_,"react-read-more-read-less":"_react-read-more-read-less_1lt1d_1153",notice:o_,warning:r_,"notice-callout":"_notice-callout_1lt1d_1184",BrainhubCarousel__container:a_,BrainhubCarouselItem:s_,BrainhubCarousel__customArrows:i_,"BrainhubCarousel__custom-arrowLeft":"_BrainhubCarousel__custom-arrowLeft_1lt1d_1226","BrainhubCarousel__arrow--disable":"_BrainhubCarousel__arrow--disable_1lt1d_1281","carousel-card":"_carousel-card_1lt1d_1285","carousel-card__image":"_carousel-card__image_1lt1d_1293","carousel-card__badge":"_carousel-card__badge_1lt1d_1298","--label":"_--label_1lt1d_1314","carousel-card__background":"_carousel-card__background_1lt1d_1334","carousel-card__actions":"_carousel-card__actions_1lt1d_1347",save:c_,add:l_,"in-research":"_in-research_1lt1d_1394","carousel-card__title":"_carousel-card__title_1lt1d_1400",distance:d_,"in-plan":"_in-plan_1lt1d_1429","in-plan--inspire":"_in-plan--inspire_1lt1d_1456","carousel-card__metadata":"_carousel-card__metadata_1lt1d_1477","carousel-card--article":"_carousel-card--article_1lt1d_1500","carousel-card--tour":"_carousel-card--tour_1lt1d_1503","carousel-card--destination":"_carousel-card--destination_1lt1d_1506","carousel-card--itinerary":"_carousel-card--itinerary_1lt1d_1509",placeholder:__,"react-router-modal__modal":"_react-router-modal__modal_1lt1d_1568","rounded-modal":"_roun
1ded-modal_1lt1d_1568","img-wrapper":"_img-wrapper_1lt1d_1574","image-placeholder":"_image-placeholder_1lt1d_1583","cta-signup":"_cta-signup_1lt1d_1613",content:u_,"btn-rounded":"_btn-rounded_1lt1d_1670","mobile-banner":"_mobile-banner_1lt1d_1675","typeform-sidetab-button":"_typeform-sidetab-button_1lt1d_1698","tf-v1-sidetab-button":"_tf-v1-sidetab-button_1lt1d_1699","typeform-sidetab-button-text":"_typeform-sidetab-button-text_1lt1d_1703","tf-v1-sidetab-button-text":"_tf-v1-sidetab-button-text_1lt1d_1704",help:f_,help__button:p_,help__menu:h_,"create-ticket":"_create-ticket_1lt1d_1754","text-link":"_text-link_1lt1d_1795",hidden:m_,"partner-action-btn":"_partner-action-btn_1lt1d_1802","destinations-table":"_destinations-table_1lt1d_1853","destinations-table__wrapper":"_destinations-table__wrapper_1lt1d_1856","destinations-table__wrapper--collapsed":"_destinations-table__wrapper--collapsed_1lt1d_1861","destinations-table__fade-overlay":"_destinations-table__fade-overlay_1lt1d_1872","destinations-table__expand-section":"_destinations-table__expand-section_1lt1d_1882",meta:g_,dates:v_,destination:b_,articles:y_,acco:w_,days:x_,"day-label":"_day-label_1lt1d_2009","day-number":"_day-number_1lt1d_2012","day-separator":"_day-separator_1lt1d_2017","day-city":"_day-city_1lt1d_2020","travel-day":"_travel-day_1lt1d_2032",destinations:k_,"info-tooltip":"_info-tooltip_1lt1d_2062","carousel-section":"_carousel-section_1lt1d_2076","spinner-wrapper":"_spinner-wrapper_1lt1d_2085",spinner:S_,"carousel-section__title":"_carousel-section__title_1lt1d_2113",icon:j_,"carousel-section__list":"_carousel-section__list_1lt1d_2190","--trips":"_--trips_1lt1d_2208","--continent-section":"_--continent-section_1lt1d_2221","discover-section__list":"_discover-section__list_1lt1d_2221","more-card":"_more-card_1lt1d_2221",grid:C_,"col-2":"_col-2_1lt1d_2235","col-3":"_col-3_1lt1d_2238","col-4":"_col-4_1lt1d_2246",tags:E_,"ReactModal__Body--open":"_ReactModal__Body--open_1lt1d_2283","simple-modal":"_simple-modal_1lt1d_2291","bottom-modal":"_bottom-modal_1lt1d_2296","ReactModal__Overlay--after-open":"_ReactModal__Overlay--after-open_1lt1d_2312","ReactModal__Overlay--before-close":"_ReactModal__Overlay--before-close_1lt1d_2315","popup-modal":"_popup-modal_1lt1d_2318","ReactModal__Content--after-open":"_ReactModal__Content--after-open_1lt1d_2330","ReactModal__Content--before-close":"_ReactModal__Content--before-close_1lt1d_2333",green:$_,orange:N_,transparent:T_,"transport-options__placeholder":"_transport-options__placeholder_1lt1d_2375","text-button":"_text-button_1lt1d_2411",title:P_,flow:I_,"beacon-green":"_beacon-green_1lt1d_1","beacon-orange":"_beacon-orange_1lt1d_1","beacon-purple":"_beacon-purple_1lt1d_1","beacon-magenta":"_beacon-magenta_1lt1d_1",fadeInTop:R_};function O_(e,t,n){if(t){const o=n.find(s=>String(s.bookingId)===String(t));if(o)return o}return n.find(o=>String(o.placeId)===String(e._id))||null}function A_(e,t){var s,i,a;const n=Fc(e);if(n)return n;const o=Number((s=t.metadata)==null?void 0:s.bookedRoomPriceTotal);return((i=t.metadata)==null?void 0:i.bookedRoomPriceTotal)!=null&&!Number.isNaN(o)?{amount:o,currency:((a=t.metadata)==null?void 0:a.bookedRoomCurrency)||Hc(t)||"EUR"}:null}function B_(e,t){const n=e!=null&&e.checkin&&(e!=null&&e.checkout)?vo(e.checkout).diff(vo(e.checkin),"day"):t;return Math.max(1,n)}function L_(e,t,n,o){var i;const s=new Map;for(const a of e||[]){const c=To(a,t);if((c==null?void 0:c.bookingStatus)!=="confirmed"||(c==null?void 0:c.bookingProvider)!=="nuitee")continue;const l=O_(a,c.confirmationNumber,n||[]),d=A_(l,a);if(!d)continue;const u=B_(l,o),p={gross_price:String(d.amount),price_per_night:String(Math.round(d.amount/u)),currency:d.currency};for(const h of[(i=a.metadata)==null?void 0:i.id,a.hotel_id,a._id])h&&s.set(String(h),p)}return s}function Zt(e){"@babel/helpers - typeof";return Zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zt(e)}function D_(e,t){if(Zt(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(Zt(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hi(e){var t=D_(e,"string");return Zt(t)==="symbol"?t:String(t)}function qe(e,t,n){return t=hi(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function We(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
1t%2?Wa(Object(n),!0).forEach(function(o){qe(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wa(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Ln(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ua(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,hi(o.key),o)}}function Dn(e,t,n){return t&&Ua(e.prototype,t),n&&Ua(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ir(e,t){return ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,s){return o.__proto__=s,o},ir(e,t)}function Fn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ir(e,t)}function Dt(e){return Dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Dt(e)}function F_(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function H_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q_(e,t){if(t&&(Zt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return H_(e)}function Hn(e){var t=F_();return function(){var o=Dt(e),s;if(t){var i=Dt(this).constructor;s=Reflect.construct(o,arguments,i)}else s=o.apply(this,arguments);return q_(this,s)}}var cr={},V_=function(t){};function z_(e,t){}function W_(e,t){}function U_(){cr={}}function mi(e,t,n){!t&&!cr[n]&&(e(!1,n),cr[n]=!0)}function Ht(e,t){mi(z_,e,t)}function G_(e,t){mi(W_,e,t)}Ht.preMessage=V_;Ht.resetWarned=U_;Ht.noteOnce=G_;var gi=function(t){var n,o,s=t.className,i=t.included,a=t.vertical,c=t.style,l=t.length,d=t.offset,u=t.reverse;l<0&&(u=!u,l=Math.abs(l),d=100-d);var p=a?(n={},qe(n,u?"top":"bottom","".concat(d,"%")),qe(n,u?"bottom":"top","auto"),qe(n,"height","".concat(l,"%")),n):(o={},qe(o,u?"right":"left","".concat(d,"%")),qe(o,u?"left":"right","auto"),qe(o,"width","".concat(l,"%")),o),h=We(We({},c),p);return i?Ee.createElement("div",{className:s,style:h}):null};function Ft(){return Ft=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ft.apply(this,arguments)}function Y_(e,t){if(e==null)return{};var n={},o=Object.keys(e),s,i;for(i=0;i<o.length;i++)s=o[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function bo(e,t){if(e==null)return{};var n=Y_(e,t),o,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)o=i[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function lr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function K_(e){if(Array.isArray(e))return lr(e)}function X_(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Q_(e,t){if(e){if(typeof e=="string")return lr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lr(e,t)}}function J_(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function It(e){return K_(e)||X_(e)||Q_(e)||J_()}function Z_(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Dt(e),e!==null););return e}function cn(){return typeof Reflect<"u"&&Reflect.get?cn=Reflect.get.bind():cn=function(t,n,o){var s=Z_(t,n);if(s){var i=Object.getOwnPropertyDescriptor(s,n);return i.get?i.get.call(arguments.length<3?t:o):i.value}},cn.apply(this,arguments)}function St(e,t,n,o){var s=Nn.unstable_batchedUpdates?function(a){Nn.unstable_batchedUpdates(n,a)}:n;return e!=null&&e.addEventListener&&e.addEventListener(t,s,o),{remove:function(){e!=null&&e.removeEventListener&&e.removeEventListener(t,s,o)}}}
2var vi={exports:{}};/*! 3 Copyright (c) 2018 Jed Watson. 4 Licensed under the MIT License (MIT), see 5 http://jedwatson.github.io/classnames 6*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o=[],s=0;s<arguments.length;s++){var i=arguments[s];if(i){var a=typeof i;if(a==="string"||a==="number")o.push(i);else if(Array.isArray(i)){if(i.length){var c=n.apply(null,i);c&&o.push(c)}}else if(a==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){o.push(i.toString());continue}for(var l in i)t.call(i,l)&&i[l]&&o.push(l)}}}return o.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(vi);var eu=vi.exports;const fn=Eo(eu);var tu=function(t,n,o,s,i,a){Ht(o?s>0:!0,"`Slider[step]` should be a positive number in order to make Slider[dots] work.");var c=Object.keys(n).map(parseFloat).sort(function(d,u){return d-u});if(o&&s)for(var l=i;l<=a;l+=s)c.indexOf(l)===-1&&c.push(l);return c},nu=function(t){var n=t.prefixCls,o=t.vertical,s=t.reverse,i=t.marks,a=t.dots,c=t.step,l=t.included,d=t.lowerBound,u=t.upperBound,p=t.max,h=t.min,g=t.dotStyle,m=t.activeDotStyle,v=p-h,j=tu(o,i,a,c,h,p).map(function(S){var _,$="".concat(Math.abs(S-h)/v*100,"%"),M=!l&&S===u||l&&S<=u&&S>=d,x=o?We(We({},g),{},qe({},s?"top":"bottom",$)):We(We({},g),{},qe({},s?"right":"left",$));M&&(x=We(We({},x),m));var P=fn((_={},qe(_,"".concat(n,"-dot"),!0),qe(_,"".concat(n,"-dot-active"),M),qe(_,"".concat(n,"-dot-reverse"),s),_));return Ee.createElement("span",{className:P,style:x,key:S})});return Ee.createElement("div",{className:"".concat(n,"-step")},j)},ou=function(t){var n=t.className,o=t.vertical,s=t.reverse,i=t.marks,a=t.included,c=t.upperBound,l=t.lowerBound,d=t.max,u=t.min,p=t.onClickLabel,h=Object.keys(i),g=d-u,m=h.map(parseFloat).sort(function(v,j){return v-j}).map(function(v){var j,S=i[v],_=Zt(S)==="object"&&!Ee.isValidElement(S),$=_?S.label:S;if(!$&&$!==0)return null;var M=!a&&v===c||a&&v<=c&&v>=l,x=fn((j={},qe(j,"".concat(n,"-text"),!0),qe(j,"".concat(n,"-text-active"),M),j)),P=qe({marginBottom:"-50%"},s?"top":"bottom","".concat((v-u)/g*100,"%")),I=qe({transform:"translateX(".concat(s?"50%":"-50%",")"),msTransform:"translateX(".concat(s?"50%":"-50%",")")},s?"right":"left","".concat((v-u)/g*100,"%")),R=o?P:I,L=_?We(We({},R),S.style):R;return Ee.createElement("span",{className:x,style:L,key:v,onMouseDown:function(H){return p(H,v)},onTouchStart:function(H){return p(H,v)}},$)});return Ee.createElement("div",{className:n},m)},Hr=function(e){Fn(n,e);var t=Hn(n);function n(){var o;return Ln(this,n),o=t.apply(this,arguments),o.state={clickFocused:!1},o.setHandleRef=function(s){o.handle=s},o.handleMouseUp=function(){document.activeElement===o.handle&&o.setClickFocus(!0)},o.handleMouseDown=function(s){s.preventDefault(),o.focus()},o.handleBlur=function(){o.setClickFocus(!1)},o.handleKeyDown=function(){o.setClickFocus(!1)},o}return Dn(n,[{key:"componentDidMount",value:function(){this.onMouseUpListener=St(document,"mouseup",this.handleMouseUp)}},{key:"componentWillUnmount",value:function(){this.onMouseUpListener&&this.onMouseUpListener.remove()}},{key:"setClickFocus",value:function(s){this.setState({clickFocused:s})}},{key:"clickFocus",value:function(){this.setClickFocus(!0),this.focus()}},{key:"focus",value:function(){this.handle.focus()}},{key:"blur",value:function(){this.handle.blur()}},{key:"render",value:function(){var s,i,a=this.props,c=a.prefixCls,l=a.vertical,d=a.reverse,u=a.offset,p=a.style,h=a.disabled,g=a.min,m=a.max,v=a.value,j=a.tabIndex,S=a.ariaLabel,_=a.ariaLabelledBy,$=a.ariaValueTextFormatter,M=bo(a,["prefixCls","vertical","reverse","offset","style","disabled","min","max","value","tabIndex","ariaLabel","ariaLabelledBy","ariaValueTextFormatter"]),x=fn(this.props.className,qe({},"".concat(c,"-handle-click-focused"),this.state.clickFocused)),P=l?(s={},qe(s,d?"top":"bottom","".concat(u,"%")),qe(s,d?"bottom":"top","auto"),qe(s,"transform",d?null:"translateY(+50%)"),s):(i={},qe(i,d?"right":"left","".concat(u,"%")),qe(i,d?"left":"right","auto"),qe(i,"transform","translateX(".concat(d?"+":"-","50%)")),i),I=We(We({},p),P),R=j||0;(h||j===null)&&(R=null);var L;return $&&(L=$(v)),Ee.createElement("div",Ft({ref:this.setHandleRef,tabIndex:R},M,{className:x,style:I,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,role:"slider","aria-valuemin":g,"aria-valuemax":m,"aria-valuenow":v,"aria-disabled":!!h,"aria-label":S,"aria-labelledby":_,"aria-valuetext":L}))}}]),n}(Ee.Component),pe={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_
vendor: 4,460 bytes, line 6
6SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){var n=t.keyCode;if(t.altKey&&!t.ctrlKey||t.metaKey||n>=pe.F1&&n<=pe.F12)return!1;switch(n){case pe.ALT:case pe.CAPS_LOCK:case pe.CONTEXT_MENU:case pe.CTRL:case pe.DOWN:case pe.END:case pe.ESC:case pe.HOME:case pe.INSERT:case pe.LEFT:case pe.MAC_FF_META:case pe.META:case pe.NUMLOCK:case pe.NUM_CENTER:case pe.PAGE_DOWN:case pe.PAGE_UP:case pe.PAUSE:case pe.PRINT_SCREEN:case pe.RIGHT:case pe.SHIFT:case pe.UP:case pe.WIN_KEY:case pe.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=pe.ZERO&&t<=pe.NINE||t>=pe.NUM_ZERO&&t<=pe.NUM_MULTIPLY||t>=pe.A&&t<=pe.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&t===0)return!0;switch(t){case pe.SPACE:case pe.QUESTION_MARK:case pe.NUM_PLUS:case pe.NUM_MINUS:case pe.NUM_PERIOD:case pe.NUM_DIVISION:case pe.SEMICOLON:case pe.DASH:case pe.EQUALS:case pe.COMMA:case pe.PERIOD:case pe.SLASH:case pe.APOSTROPHE:case pe.SINGLE_QUOTE:case pe.OPEN_SQUARE_BRACKET:case pe.BACKSLASH:case pe.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};function qo(e,t){try{return Object.keys(t).some(function(n){return e.target===Nr.findDOMNode(t[n])})}catch{return!1}}function bi(e,t){var n=t.min,o=t.max;return e<n||e>o}function Ga(e){return e.touches.length>1||e.type.toLowerCase()==="touchend"&&e.touches.length>0}function Ya(e,t){var n=t.marks,o=t.step,s=t.min,i=t.max,a=Object.keys(n).map(parseFloat);if(o!==null){var c=Math.pow(10,yi(o)),l=Math.floor((i*c-s*c)/(o*c)),d=Math.min((e-s)/o,l),u=Math.round(d)*o+s;a.push(u)}var p=a.map(function(h){return Math.abs(e-h)});return a[p.indexOf(Math.min.apply(Math,It(p)))]}function yi(e){var t=e.toString(),n=0;return t.indexOf(".")>=0&&(n=t.length-t.indexOf(".")-1),n}function Ka(e,t){return e?t.clientY:t.pageX}function Xa(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function Qa(e,t){var n=t.getBoundingClientRect();return e?n.top+n.height*.5:window.pageXOffset+n.left+n.width*.5}function qr(e,t){var n=t.max,o=t.min;return e<=o?o:e>=n?n:e}function wi(e,t){var n=t.step,o=isFinite(Ya(e,t))?Ya(e,t):0;return n===null?o:parseFloat(o.toFixed(yi(n)))}function pn(e){e.stopPropagation(),e.preventDefault()}function ru(e,t,n){var o={increase:function(c,l){return c+l},decrease:function(c,l){return c-l}},s=o[e](Object.keys(n.marks).indexOf(JSON.stringify(t)),1),i=Object.keys(n.marks)[s];return n.step?o[e](t,n.step):Object.keys(n.marks).length&&n.marks[i]?n.marks[i]:t}function xi(e,t,n){var o="increase",s="decrease",i=o;switch(e.keyCode){case pe.UP:i=t&&n?s:o;break;case pe.RIGHT:i=!t&&n?s:o;break;case pe.DOWN:i=t&&n?o:s;break;case pe.LEFT:i=!t&&n?o:s;break;case pe.END:return function(a,c){return c.max};case pe.HOME:return function(a,c){return c.min};case pe.PAGE_UP:return function(a,c){return a+c.step*2};case pe.PAGE_DOWN:return function(a,c){return a-c.step*2};default:return}return function(a,c){return ru(i,a,c)}}function wt(){}function ki(e){var t;return t=function(n){Fn(s,n);var o=Hn(s);function s(i){var a;Ln(this,s),a=o.call(this,i),a.onDown=function(p,h){var g=h,m=a.props,v=m.draggableTrack,j=m.vertical,S=a.state.bounds,_=v&&a.positionGetValue?a.positionGetValue(g)||[]:[],$=qo(p,a.handlesRefs);if(a.dragTrack=v&&S.length>=2&&!$&&!_.map(function(x,P){var I=P?!0:x>=S[P];return P===_.length-1?x<=S[P]:I}).some(function(x){return!x}),a.dragTrack)a.dragOffset=g,a.startBounds=It(S);else{if(!$)a.dragOffset=0;else{var M=Qa(j,p.target);a.dragOffset=g-M,g=M}a.onStart(g)}},a.onMouseDown=function(p){if(p.button===0){a.removeDocumentEvents();var h=a.props.vertical,g=Ka(h,p);a.onDown(p,g),a.addDocumentMouseEvents()}},a.onTouchStart=function(p){if(!Ga(p)){var h=a.props.vertical,g=Xa(h,p);a.onDown(p,g),a.addDocumentTouchEvents(),pn(p)}},a.onFocus=function(p){var h=a.props,g=h.onFocus,m=h.vertical;if(qo(p,a.handlesRefs)&&!a.dragTrack){var v=Qa(m,p.target);a.dragOffset=0,a.onStart(v),pn(p),g&&g(p)}},a.onBlur=function(p){var h=a.props.onBlur;a.dragTrack||a.onEnd(),h&&h(p)},a.onMouseUp=function(){a.handlesRefs[a.prevMovedHandleIndex]&&a.handlesRefs[a.prevMovedHandleIndex].click
vendor: 14,117 bytes, line 6
6Focus()},a.onMouseMove=function(p){if(!a.sliderRef){a.onEnd();return}var h=Ka(a.props.vertical,p);a.onMove(p,h-a.dragOffset,a.dragTrack,a.startBounds)},a.onTouchMove=function(p){if(Ga(p)||!a.sliderRef){a.onEnd();return}var h=Xa(a.props.vertical,p);a.onMove(p,h-a.dragOffset,a.dragTrack,a.startBounds)},a.onKeyDown=function(p){a.sliderRef&&qo(p,a.handlesRefs)&&a.onKeyboard(p)},a.onClickMarkLabel=function(p,h){p.stopPropagation(),a.onChange({value:h}),a.setState({value:h},function(){return a.onEnd(!0)})},a.saveSlider=function(p){a.sliderRef=p};var c=i.step,l=i.max,d=i.min,u=isFinite(l-d)?(l-d)%c===0:!0;return Ht(c&&Math.floor(c)===c?u:!0,"Slider[max] - Slider[min] (".concat(l-d,") should be a multiple of Slider[step] (").concat(c,")")),a.handlesRefs={},a}return Dn(s,[{key:"componentDidMount",value:function(){this.document=this.sliderRef&&this.sliderRef.ownerDocument;var a=this.props,c=a.autoFocus,l=a.disabled;c&&!l&&this.focus()}},{key:"componentWillUnmount",value:function(){cn(Dt(s.prototype),"componentWillUnmount",this)&&cn(Dt(s.prototype),"componentWillUnmount",this).call(this),this.removeDocumentEvents()}},{key:"getSliderStart",value:function(){var a=this.sliderRef,c=this.props,l=c.vertical,d=c.reverse,u=a.getBoundingClientRect();return l?d?u.bottom:u.top:window.pageXOffset+(d?u.right:u.left)}},{key:"getSliderLength",value:function(){var a=this.sliderRef;if(!a)return 0;var c=a.getBoundingClientRect();return this.props.vertical?c.height:c.width}},{key:"addDocumentTouchEvents",value:function(){this.onTouchMoveListener=St(this.document,"touchmove",this.onTouchMove),this.onTouchUpListener=St(this.document,"touchend",this.onEnd)}},{key:"addDocumentMouseEvents",value:function(){this.onMouseMoveListener=St(this.document,"mousemove",this.onMouseMove),this.onMouseUpListener=St(this.document,"mouseup",this.onEnd)}},{key:"removeDocumentEvents",value:function(){this.onTouchMoveListener&&this.onTouchMoveListener.remove(),this.onTouchUpListener&&this.onTouchUpListener.remove(),this.onMouseMoveListener&&this.onMouseMoveListener.remove(),this.onMouseUpListener&&this.onMouseUpListener.remove()}},{key:"focus",value:function(){var a;this.props.disabled||(a=this.handlesRefs[0])===null||a===void 0||a.focus()}},{key:"blur",value:function(){var a=this;this.props.disabled||Object.keys(this.handlesRefs).forEach(function(c){var l,d;(l=a.handlesRefs[c])===null||l===void 0||(d=l.blur)===null||d===void 0||d.call(l)})}},{key:"calcValue",value:function(a){var c=this.props,l=c.vertical,d=c.min,u=c.max,p=Math.abs(Math.max(a,0)/this.getSliderLength()),h=l?(1-p)*(u-d)+d:p*(u-d)+d;return h}},{key:"calcValueByPos",value:function(a){var c=this.props.reverse?-1:1,l=c*(a-this.getSliderStart()),d=this.trimAlignValue(this.calcValue(l));return d}},{key:"calcOffset",value:function(a){var c=this.props,l=c.min,d=c.max,u=(a-l)/(d-l);return Math.max(0,u*100)}},{key:"saveHandle",value:function(a,c){this.handlesRefs[a]=c}},{key:"render",value:function(){var a,c=this.props,l=c.prefixCls,d=c.className,u=c.marks,p=c.dots,h=c.step,g=c.included,m=c.disabled,v=c.vertical,j=c.reverse,S=c.min,_=c.max,$=c.children,M=c.maximumTrackStyle,x=c.style,P=c.railStyle,I=c.dotStyle,R=c.activeDotStyle,L=cn(Dt(s.prototype),"render",this).call(this),D=L.tracks,H=L.handles,b=fn(l,(a={},qe(a,"".concat(l,"-with-marks"),Object.keys(u).length),qe(a,"".concat(l,"-disabled"),m),qe(a,"".concat(l,"-vertical"),v),qe(a,d,d),a));return Ee.createElement("div",{ref:this.saveSlider,className:b,onTouchStart:m?wt:this.onTouchStart,onMouseDown:m?wt:this.onMouseDown,onMouseUp:m?wt:this.onMouseUp,onKeyDown:m?wt:this.onKeyDown,onFocus:m?wt:this.onFocus,onBlur:m?wt:this.onBlur,style:x},Ee.createElement("div",{className:"".concat(l,"-rail"),style:We(We({},M),P)}),D,Ee.createElement(nu,{prefixCls:l,vertical:v,reverse:j,marks:u,dots:p,step:h,included:g,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:_,min:S,dotStyle:I,activeDotStyle:R}),H,Ee.createElement(ou,{className:"".concat(l,"-mark"),onClickLabel:m?wt:this.onClickMarkLabel,vertical:v,marks:u,included:g,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:_,min:S,reverse:j}),$)}}]),s}(e),t.displayName="ComponentEnhancer(".concat(e.displayName,")"),t.defaultProps=We(We({},e.defaultProps),{},{prefixCls:"rc-slider",className:"",min:0,max:100,step:1,marks:{},handle:function(o){var s=o.index,i=bo(o,["index"]);return delete i.dragging,i.value===null?null:Ee.createElement(Hr,Ft({},i,{key:s}))},onBeforeChange:wt,onChange:wt,onAfterChange:wt,included:!0,disabled:!1,dots:!1,vertical:!1,reverse:!1,trackStyle:[{}],handleStyle:[{}],railStyle:{},dotStyle:{},activeDotStyle:{}}),t}var au=function(e){Fn(n,e);var t=Hn(n);function n(o){var s;Ln(this,n),s=t.call(this,o),s.positionGetValue=function(c){return[]},s.onEnd=function(c){var l=s.state.dragging;s.removeDocumentEvents(),(l||c)&&s.props.onAfterChange(s.getValue()),s.setState({dragging:!1})};var i=o.defaultValue!==void 0?o.defaultValue:o.min,a=o.value!==void 0?o.value:i;return s.state={value:s.trimAlignValue(a),dragging:!1},Ht(!("minimumTrackStyle"in o),"minimumTrackStyle will be deprecated, please use trackStyle instead."),Ht(!("maximumTrackStyle"in o),"maximumTrackStyle will be deprecated, please use railStyle instead."),s}return Dn(n,[{key:"calcValueByPos",value:function(s){return 0}},{key:"calcOffset",value:function(s){return 0}},{key:"saveHandle",value:function(s,i){}},{key:"removeDocumentEvents",value:function(){}},{key:"componentDidUpdate",value:function(s,i){var a=this.props,c=a.min,l=a.max,d=a.value,u=a.onChange;if("min"in this.props||"max"in this.props){var p=d!==void 0?d:i.value,h=this.trimAlignValue(p,this.props);h!==i.value&&(this.setState({value:h}),!(c===s.min&&l===s.max)&&bi(p,this.props)&&u(h))}}},{key:"onChange",value:function(s){var i=this.props,a=!("value"in i),c=s.value>this.props.max?We(We({},s),{},{value:this.props.max}):s;a&&this.setState(c);var l=c.value;i.onChange(l)}},{key:"onStart",value:function(s){this.setState({dragging:!0});var i=this.props,a=this.getValue();i.onBeforeChange(a);var c=this.calcValueByPos(s);this.startValue=c,this.startPosition=s,c!==a&&(this.prevMovedHandleIndex=0,this.onChange({value:c}))}},{key:"onMove",value:function(s,i){pn(s);var a=this.state.value,c=this.calcValueByPos(i);c!==a&&this.onChange({value:c})}},{key:"onKeyboard",value:function(s){var i=this.props,a=i.reverse,c=i.vertical,l=xi(s,c,a);if(l){pn(s);var d=this.state,u=d.value,p=l(u,this.props),h=this.trimAlignValue(p);if(h===u)return;this.onChange({value:h}),this.props.onAfterChange(h),this.onEnd()}}},{key:"getValue",value:function(){return this.state.value}},{key:"getLowerBound",value:function(){var s=this.props.startPoint||this.props.min;return this.state.value>s?s:this.state.value}},{key:"getUpperBound",value:function(){return this.state.value<this.props.startPoint?this.props.startPoint:this.state.value}},{key:"trimAlignValue",value:function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s===null)return null;var a=We(We({},this.props),i),c=qr(s,a);return wi(c,a)}},{key:"render",value:function(){var s=this,i=this.props,a=i.prefixCls,c=i.vertical,l=i.included,d=i.disabled,u=i.minimumTrackStyle,p=i.trackStyle,h=i.handleStyle,g=i.tabIndex,m=i.ariaLabelForHandle,v=i.ariaLabelledByForHandle,j=i.ariaValueTextFormatterForHandle,S=i.min,_=i.max,$=i.startPoint,M=i.reverse,x=i.handle,P=this.state,I=P.value,R=P.dragging,L=this.calcOffset(I),D=x({className:"".concat(a,"-handle"),prefixCls:a,vertical:c,offset:L,value:I,dragging:R,disabled:d,min:S,max:_,reverse:M,index:0,tabIndex:g,ariaLabel:m,ariaLabelledBy:v,ariaValueTextFormatter:j,style:h[0]||h,ref:function(T){return s.saveHandle(0,T)}}),H=$!==void 0?this.calcOffset($):0,b=p[0]||p,y=Ee.createElement(gi,{className:"".concat(a,"-track"),vertical:c,included:l,offset:H,reverse:M,length:L-H,style:We(We({},u),b)});return{tracks:y,handles:D}}}]),n}(Ee.Component);const su=ki(au);var xn=function(t){var n=t.value,o=t.handle,s=t.bounds,i=t.props,a=i.allowCross,c=i.pushable,l=Number(c),d=qr(n,i),u=d;return!a&&o!=null&&s!==void 0&&(o>0&&d<=s[o-1]+l&&(u=s[o-1]+l),o<s.length-1&&d>=s[o+1]-l&&(u=s[o+1]-l)),wi(u,i)},Vr=function(e){Fn(n,e);var t=Hn(n);function n(o){var s;Ln(this,n),s=t.call(this,o),s.positionGetValue=function(g){var m=s.getValue(),v=s.calcValueByPos(g),j=s.getClosestBound(v),S=s.getBoundNeedMoving(v,j),_=m[S];if(v===_)return null;var $=It(m);return $[S]=v,$},s.onEnd=function(g){var m=s.state.handle;s.removeDocumentEvents(),m||(s.dragTrack=!1),(m!==null||g)&&s.props.onAfterChange(s.getValue()),s.setState({handle:null})};var i=o.count,a=o.min,c=o.max,l=Array.apply(void 0,It(Array(i+1))).map(function(){return a}),d="defaultValue"in o?o.defaultValue:l,u=o.value!==void 0?o.value:d,p=u.map(function(g,m){return xn({value:g,handle:m,props:o})}),h=p[0]===c?0:p.length-1;return s.state={handle:null,recent:h,bounds:p},s}return Dn(n,[{key:"calcValueByPos",value:function(s){return 0}},{key:"getSliderLength",value:function(){return 0}},{key:"calcOffset",value:function(s){return 0}},{key:"saveHandle",value:function(s,i){}},{key:"removeDocumentEvents",value:function(){}},{key:"componentDidUpdate",value:function(s,i){var a=this,c=this.props,l=c.onChange,d=c.value,u=c.min,p=c.max;if(("min"in this.props||"max"in this.props)&&!(u===s.min&&p===s.max)){var h=d||i.bounds;if(h.some(function(m){return bi(m,a.props)})){var g=h.map(function(m){return qr(m,a.props)});l(g)}}}},{key:"onChange",value:function(s){var i=this.props,a=!("value"in i);if(a)this.setState(s);else{var c={};["handle","recent"].forEach(function(u){s[u]!==void 0&&(c[u]=s[u])}),Object.keys(c).length&&this.setState(c)}var l=We(We({},this.state),s),d=l.bounds;i.onChange(d)}},{key:"onStart",value:function(s){var i=this.props,a=this.state,c=this.getValue();i.onBeforeChange(c);var l=this.calcValueByPos(s);this.startValue=l,this.startPosition=s;var d=this.getClosestBound(l);this.prevMovedHandleIndex=this.getBoundNeedMoving(l,d),this.setState({handle:this.prevMovedHandleIndex,recent:this.prevMovedHandleIndex});var u=c[this.prevMovedHandleIndex];if(l!==u){var p=It(a.bounds);p[this.prevMovedHandleIndex]=l,this.onChange({bounds:p})}}},{key:"onMove",value:function(s,i,a,c){pn(s);var l=this.state,d=this.props,u=d.max||100,p=d.min||0;if(a){var h=d.vertical?-i:i;h=d.reverse?-h:h;var g=u-Math.max.apply(Math,It(c)),m=p-Math.min.apply(Math,It(c)),v=Math.min(Math.max(h/(this.getSliderLength()/(u-p)),m),g),j=c.map(function($){return Math.floor(Math.max(Math.min($+v,u),p))});l.bounds.map(function($,M){return $===j[M]}).some(function($){return!$})&&this.onChange({bounds:j});return}var S=this.calcValueByPos(i),_=l.bounds[l.handle];S!==_&&this.moveTo(S)}},{key:"onKeyboard",value:function(s){var i=this.props,a=i.reverse,c=i.vertical,l=xi(s,c,a);if(l){pn(s);var d=this.state,u=this.props,p=d.bounds,h=d.handle,g=p[h===null?d.recent:h],m=l(g,u),v=xn({value:m,handle:h,bounds:d.bounds,props:u});if(v===g)return;var j=!0;this.moveTo(v,j)}}},{key:"getValue",value:function(){return this.state.bounds}},{key:"getClosestBound",value:function(s){for(var i=this.state.bounds,a=0,c=1;c<i.length-1;c+=1)s>=i[c]&&(a=c);return Math.abs(i[a+1]-s)<Math.abs(i[a]-s)&&(a+=1),a}},{key:"getBoundNeedMoving",value:function(s,i){var a=this.state,c=a.bounds,l=a.recent,d=i,u=c[i+1]===c[i];return u&&c[l]===c[i]&&(d=l),u&&s!==c[i+1]&&(d=s<c[i+1]?i:i+1),d}},{key:"getLowerBound",value:function(){return this.state.bounds[0]}},{key:"getUpperBound",value:function(){var s=this.state.bounds;return s[s.length-1]}},{key:"getPoints",value:function(){var s=this.props,i=s.marks,a=s.step,c=s.min,l=s.max,d=this.internalPointsCache;if(!d||d.marks!==i||d.step!==a){var u=We({},i);if(a!==null)for(var p=c;p<=l;p+=a)u[p]=p;var h=Object.keys(u).map(parseFloat);h.sort(function(g,m){return g-m}),this.internalPointsCache={marks:i,step:a,points:h}}return this.internalPointsCache.points}},{key:"moveTo",value:function(s,i){var a=this,c=this.state,l=this.props,d=It(c.bounds),u=c.handle===null?c.recent:c.handle;d[u]=s;var p=u;l.pushable!==!1?this.pushSurroundingHandles(d,p):l.allowCross&&(d.sort(function(h,g){return h-g}),p=d.indexOf(s)),this.onChange({recent:p,handle:p,bounds:d}),i&&(this.props.onAfterChange(d),this.setState({},function(){a.handlesRefs[p].focus()}),this.onEnd())}},{key:"pushSurroundingHandles",value:function(s,i){var a=s[i],c=this.props.pushable,l=Number(c),d=0;if(s[i+1]-a<l&&(d=1),a-s[i-1]<l&&(d=-1),d!==0){var u=i+d,p=d*(s[u]-a);this.pushHandle(s,u,d,l-p)||(s[i]=s[u]-d*l)}}},{key:"pushHandle",value:function(s,i,a,c){for(var l=s[i],d=s[i];a*(d-l)<c;){if(!this.pushHandleOnePoint(s,i,a))return s[i]=l,!1;d=s[i]}return!0}},{key:"pushHandleOnePoint",value:function(s,i,a){var c=this.getPoints(),l=c.indexOf(s[i]),d=l+a;if(d>=c.length||d<0)return!1;var u=i+a,p=c[d],h=this.props.pushable,g=Number(h),m=a*(s[u]-p);return this.pushHandle(s,u,a,g-m)?(s[i]=p,!0):!1}},{key:"trimAlignValue",value:function(s){var i=this.state,a=i.handle,c=i.bounds;return xn({value:s,handle:a,bounds:c,props:this.props})}},{key:"render",value:function(){var s=this,i=this.state,a=i.handle,c=i.bounds,l=this.props,d=l.prefixCls,u=l.vertical,p=l.included,h=l.disabled,g=l.min,m=l.max,v=l.reverse,j=l.handle,S=l.trackStyle,_=l.handleStyle,$=l.tabIndex,M=l.ariaLabelGroupForHandles,x=l.ariaLabelledByGroupForHandles,P=l.ariaValueTextFormatterGroupForHandles,I=c.map(function(H){return s.calcOffset(H)}),R="".concat(d,"-handle"),L=c.map(function(H,b){var y,k=$[b]||0;(h||$[b]===null)&&(k=null);var T=a===b;return j({className:fn((y={},qe(y,R,!0),qe(y,"".concat(R,"-").concat(b+1),!0),qe(y,"".concat(R,"-dragging"),T),y)),prefixCls:d,vertical:u,dragging:T,offset:I[b],value:H,index:b,tabIndex:k,min:g,max:m,reverse:v,disabled:h,style:_[b],ref:function(q){return s.saveHandle(b,q)},ariaLabel:M[b],ariaLabelledBy:x[b],ariaValueTextFormatter:P[b]})}),D=c.slice(0,-1).map(function(H,b){var y,k=b+1,T=fn((y={},qe(y,"".concat(d,"-track"),!0),qe(y,"".concat(d,"-track-").concat(k),!0),y));return Ee.createElement(gi,{className:T,vertical:u,reverse:v,included:p,offset:I[k-1],length:I[k]-I[k-1],style:S[b],key:k})});return{tracks:D,handles:L}}}
6],[{key:"getDerivedStateFromProps",value:function(s,i){if(!("value"in s||"min"in s||"max"in s))return null;var a=s.value||i.bounds,c=a.map(function(l,d){return xn({value:l,handle:d,bounds:i.bounds,props:s})});if(i.bounds.length===c.length){if(c.every(function(l,d){return l===i.bounds[d]}))return null}else c=a.map(function(l,d){return xn({value:l,handle:d,props:s})});return We(We({},i),{},{bounds:c})}}]),n}(Ee.Component);Vr.displayName="Range";Vr.defaultProps={count:1,allowCross:!0,pushable:!1,draggableTrack:!1,tabIndex:[],ariaLabelGroupForHandles:[],ariaLabelledByGroupForHandles:[],ariaValueTextFormatterGroupForHandles:[]};const Si=ki(Vr);function dr(){return dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},dr.apply(this,arguments)}function hn(e){"@babel/helpers - typeof";return hn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hn(e)}function iu(e,t){if(hn(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(hn(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cu(e){var t=iu(e,"string");return hn(t)==="symbol"?t:String(t)}function lu(e,t,n){return t=cu(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ja(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function du(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ja(Object(n),!0).forEach(function(o){lu(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ja(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function _u(e,t){if(e==null)return{};var n={},o=Object.keys(e),s,i;for(i=0;i<o.length;i++)s=o[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function uu(e,t){if(e==null)return{};var n=_u(e,t),o,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)o=i[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function en(e){"@babel/helpers - typeof";return en=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},en(e)}function fu(e,t){if(en(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(en(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ji(e){var t=fu(e,"string");return en(t)==="symbol"?t:String(t)}function Oe(e,t,n){return t=ji(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Za(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function _t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Za(Object(n),!0).forEach(function(o){Oe(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Za(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function qt(){return qt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},qt.apply(this,arguments)}function pu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function es(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,ji(o.key),o)}}
6function hu(e,t,n){return t&&es(e.prototype,t),n&&es(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Le(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _r(e,t){return _r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,s){return o.__proto__=s,o},_r(e,t)}function mu(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_r(e,t)}function yo(e){return yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},yo(e)}function gu(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vu(e,t){if(t&&(en(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Le(e)}function bu(e){var t=gu();return function(){var o=yo(e),s;if(t){var i=yo(this).constructor;s=Reflect.construct(o,arguments,i)}else s=o.apply(this,arguments);return vu(this,s)}}var Ci=function(t){return+setTimeout(t,16)},Ei=function(t){return clearTimeout(t)};typeof window<"u"&&"requestAnimationFrame"in window&&(Ci=function(t){return window.requestAnimationFrame(t)},Ei=function(t){return window.cancelAnimationFrame(t)});var ts=0,zr=new Map;function $i(e){zr.delete(e)}var bt=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;ts+=1;var o=ts;function s(i){if(i===0)$i(o),t();else{var a=Ci(function(){s(i-1)});zr.set(o,a)}}return s(n),o};bt.cancel=function(e){var t=zr.get(e);return $i(t),Ei(t)};function lo(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}function yu(e){return e instanceof HTMLElement||e instanceof SVGElement}function Ni(e){return yu(e)?e:e instanceof Ee.Component?Nn.findDOMNode(e):null}function Mn(e){"@babel/helpers - typeof";return Mn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mn(e)}function Ti(e,t){typeof e=="function"?e(t):Mn(e)==="object"&&e&&"current"in e&&(e.current=t)}function Wr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t.filter(function(s){return s});return o.length<=1?o[0]:function(s){t.forEach(function(i){Ti(i,s)})}}function Pi(e){var t,n,o=Cc.isMemo(e)?e.type.type:e.type;return!(typeof o=="function"&&!((t=o.prototype)!==null&&t!==void 0&&t.render)||typeof e=="function"&&!((n=e.prototype)!==null&&n!==void 0&&n.render))}function qn(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var wu=f.forwardRef(function(e,t){var n=e.didUpdate,o=e.getContainer,s=e.children,i=f.useRef(),a=f.useRef();f.useImperativeHandle(t,function(){return{}});var c=f.useRef(!1);return!c.current&&qn()&&(a.current=o(),i.current=a.current.parentNode,c.current=!0),f.useEffect(function(){n==null||n(e)}),f.useEffect(function(){return a.current.parentNode===null&&i.current!==null&&i.current.appendChild(a.current),function(){var l,d;(l=a.current)===null||l===void 0||(d=l.parentNode)===null||d===void 0||d.removeChild(a.current)}},[]),a.current?Nn.createPortal(s,a.current):null}),Ii={exports:{}};/*! 7 Copyright (c) 2018 Jed Watson. 8 Licensed under the MIT License (MIT), see 9 http://jedwatson.github.io/classnames 10*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o=[],s=0;s<arguments.length;s++){var i=arguments[s];if(i){var a=typeof i;if(a==="string"||a==="number")o.push(i);else if(Array.isArray(i)){if(i.length){var c=n.apply(null,i);c&&o.push(c)}}else if(a==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){o.push(i.toString());continue}for(var l in i)t.call(i,l)&&i[l]&&o.push(l)}}}return o.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}
10)()})(Ii);var xu=Ii.exports;const Ro=Eo(xu);function ku(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function Su(e,t,n){var o=e[t]||{};return _t(_t({},o),n)}function ju(e,t,n,o){for(var s=n.points,i=Object.keys(e),a=0;a<i.length;a+=1){var c=i[a];if(ku(e[c].points,s,o))return"".concat(t,"-placement-").concat(c)}return""}function Cu(e){if(Array.isArray(e))return e}function Eu(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,s,i,a,c=[],l=!0,d=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=i.call(n)).done)&&(c.push(o.value),c.length!==t);l=!0);}catch(u){d=!0,s=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw s}}return c}}function ns(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function $u(e,t){if(e){if(typeof e=="string")return ns(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ns(e,t)}}function Nu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 11In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ot(e,t){return Cu(e)||Eu(e,t)||$u(e,t)||Nu()}function Tu(e,t){if(e==null)return{};var n={},o=Object.keys(e),s,i;for(i=0;i<o.length;i++)s=o[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Pu(e,t){if(e==null)return{};var n=Tu(e,t),o,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)o=i[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}const Iu=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e==null?void 0:e.substr(0,4))};function Nt(e){"@babel/helpers - typeof";return Nt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(e)}function Ru(e,t){if(Nt(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(Nt(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ri(e){var t=Ru(e,"string");return Nt(t)==="symbol"?t:String(t)}function it(e,t,n){return t=Ri(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function os(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function Ze(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
11t%2?os(Object(n),!0).forEach(function(o){it(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):os(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Mu(e){if(Array.isArray(e))return e}function Ou(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,s,i,a,c=[],l=!0,d=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=i.call(n)).done)&&(c.push(o.value),c.length!==t);l=!0);}catch(u){d=!0,s=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw s}}return c}}function rs(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Au(e,t){if(e){if(typeof e=="string")return rs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rs(e,t)}}function Bu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 12In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rt(e,t){return Mu(e)||Ou(e,t)||Au(e,t)||Bu()}var Mi={exports:{}};/*! 13 Copyright (c) 2018 Jed Watson. 14 Licensed under the MIT License (MIT), see 15 http://jedwatson.github.io/classnames 16*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o=[],s=0;s<arguments.length;s++){var i=arguments[s];if(i){var a=typeof i;if(a==="string"||a==="number")o.push(i);else if(Array.isArray(i)){if(i.length){var c=n.apply(null,i);c&&o.push(c)}}else if(a==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){o.push(i.toString());continue}for(var l in i)t.call(i,l)&&i[l]&&o.push(l)}}}return o.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Mi);var Lu=Mi.exports;const Du=Eo(Lu);function Fu(e,t){if(e==null)return{};var n={},o=Object.keys(e),s,i;for(i=0;i<o.length;i++)s=o[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function as(e,t){if(e==null)return{};var n=Fu(e,t),o,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)o=i[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var Hu=f.createContext({});function Oi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ss(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Ri(o.key),o)}}function Ai(e,t,n){return t&&ss(e.prototype,t),n&&ss(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ur(e,t){return ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,s){return o.__proto__=s,o},ur(e,t)}function Bi(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ur(e,t)}function wo(e){return wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},wo(e)}function qu(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vu(e,t){if(t&&(Nt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fr(e)}function Li(e){var t=qu();return function(){var o=wo(e),s;if(t){var i=wo(this).constructor;s=Reflect.construct(o,arguments,i)}else s=o.apply(this,arguments);return Vu(this,s)}}var zu=function(e){Bi(n,e);var t=Li(n);function n(){return Oi(this,n),t.apply(this,arguments)}return Ai(n,[{key:"render",value:function(){return this.props.children}}]),n}(f.Component);function Wu(e){if(Array.isArray(e))return e}function Uu(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,s,i,a,c=[],l=!0,d=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;
16!(l=(o=i.call(n)).done)&&(c.push(o.value),c.length!==t);l=!0);}catch(u){d=!0,s=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw s}}return c}}function is(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Gu(e,t){if(e){if(typeof e=="string")return is(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return is(e,t)}}function Yu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 17In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ku(e,t){return Wu(e)||Uu(e,t)||Gu(e,t)||Yu()}function En(e){var t=f.useRef(!1),n=f.useState(e),o=Ku(n,2),s=o[0],i=o[1];f.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]);function a(c,l){l&&t.current||i(c)}return[s,a]}var Yt="none",Kn="appear",Xn="enter",Qn="leave",cs="none",vt="prepare",rn="start",an="active",Ur="end",Di="prepared";function ls(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function Xu(e,t){var n={animationend:ls("Animation","AnimationEnd"),transitionend:ls("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var Qu=Xu(qn(),typeof window<"u"?window:{}),Fi={};if(qn()){var Ju=document.createElement("div");Fi=Ju.style}var Jn={};function Hi(e){if(Jn[e])return Jn[e];var t=Qu[e];if(t)for(var n=Object.keys(t),o=n.length,s=0;s<o;s+=1){var i=n[s];if(Object.prototype.hasOwnProperty.call(t,i)&&i in Fi)return Jn[e]=t[i],Jn[e]}return""}var qi=Hi("animationend"),Vi=Hi("transitionend"),zi=!!(qi&&Vi),ds=qi||"animationend",_s=Vi||"transitionend";function us(e,t){if(!e)return null;if(Nt(e)==="object"){var n=t.replace(/-\w/g,function(o){return o[1].toUpperCase()});return e[n]}return"".concat(e,"-").concat(t)}const Zu=function(e){var t=f.useRef(),n=f.useRef(e);n.current=e;var o=f.useCallback(function(a){n.current(a)},[]);function s(a){a&&(a.removeEventListener(_s,o),a.removeEventListener(ds,o))}function i(a){t.current&&t.current!==a&&s(t.current),a&&a!==t.current&&(a.addEventListener(_s,o),a.addEventListener(ds,o),t.current=a)}return f.useEffect(function(){return function(){s(t.current)}},[]),[i,s]};var Wi=qn()?f.useLayoutEffect:f.useEffect;const ef=function(){var e=f.useRef(null);function t(){bt.cancel(e.current)}function n(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var i=bt(function(){s<=1?o({isCanceled:function(){return i!==e.current}}):n(o,s-1)});e.current=i}return f.useEffect(function(){return function(){t()}},[]),[n,t]};var tf=[vt,rn,an,Ur],nf=[vt,Di],Ui=!1,of=!0;function Gi(e){return e===an||e===Ur}const rf=function(e,t,n){var o=En(cs),s=Rt(o,2),i=s[0],a=s[1],c=ef(),l=Rt(c,2),d=l[0],u=l[1];function p(){a(vt,!0)}var h=t?nf:tf;return Wi(function(){if(i!==cs&&i!==Ur){var g=h.indexOf(i),m=h[g+1],v=n(i);v===Ui?a(m,!0):m&&d(function(j){function S(){j.isCanceled()||a(m,!0)}v===!0?S():Promise.resolve(v).then(S)})}},[e,i]),f.useEffect(function(){return function(){u()}},[]),[p,i]};function af(e,t,n,o){var s=o.motionEnter,i=s===void 0?!0:s,a=o.motionAppear,c=a===void 0?!0:a,l=o.motionLeave,d=l===void 0?!0:l,u=o.motionDeadline,p=o.motionLeaveImmediately,h=o.onAppearPrepare,g=o.onEnterPrepare,m=o.onLeavePrepare,v=o.onAppearStart,j=o.onEnterStart,S=o.onLeaveStart,_=o.onAppearActive,$=o.onEnterActive,M=o.onLeaveActive,x=o.onAppearEnd,P=o.onEnterEnd,I=o.onLeaveEnd,R=o.onVisibleChanged,L=En(),D=Rt(L,2),H=D[0],b=D[1],y=En(Yt),k=Rt(y,2),T=k[0],O=k[1],q=En(null),z=Rt(q,2),V=z[0],W=z[1],te=f.useRef(!1),E=f.useRef(null);function B(){return n()}var G=f.useRef(!1);function N(){O(Yt,!0),W(null,!0)}function K(ce){var Pe=B();if(!(ce&&!ce.deadline&&ce.target!==Pe)){var xe=G.current,Ve;T===Kn&&xe?Ve=x==null?void 0:x(Pe,ce):T===Xn&&xe?Ve=P==null?void 0:P(Pe,ce):T===Qn&&xe&&(Ve=I==null?void 0:I(Pe,ce)),T!==Yt&&xe&&Ve!==!1&&N()}}var ee=Zu(K),se=Rt(ee,1),je=se[0],be=function(Pe){var xe,Ve,Ye;switch(Pe){case Kn:return xe={},it(xe,vt,h),it(xe,rn,v),it(xe,an,_),xe;case Xn:return Ve={}
17,it(Ve,vt,g),it(Ve,rn,j),it(Ve,an,$),Ve;case Qn:return Ye={},it(Ye,vt,m),it(Ye,rn,S),it(Ye,an,M),Ye;default:return{}}},ge=f.useMemo(function(){return be(T)},[T]),re=rf(T,!e,function(ce){if(ce===vt){var Pe=ge[vt];return Pe?Pe(B()):Ui}if(Se in ge){var xe;W(((xe=ge[Se])===null||xe===void 0?void 0:xe.call(ge,B(),null))||null)}return Se===an&&(je(B()),u>0&&(clearTimeout(E.current),E.current=setTimeout(function(){K({deadline:!0})},u))),Se===Di&&N(),of}),U=Rt(re,2),we=U[0],Se=U[1],$e=Gi(Se);G.current=$e,Wi(function(){b(t);var ce=te.current;te.current=!0;var Pe;!ce&&t&&c&&(Pe=Kn),ce&&t&&i&&(Pe=Xn),(ce&&!t&&d||!ce&&p&&!t&&d)&&(Pe=Qn);var xe=be(Pe);Pe&&(e||xe[vt])?(O(Pe),we()):O(Yt)},[t]),f.useEffect(function(){(T===Kn&&!c||T===Xn&&!i||T===Qn&&!d)&&O(Yt)},[c,i,d]),f.useEffect(function(){return function(){te.current=!1,clearTimeout(E.current)}},[]);var Ae=f.useRef(!1);f.useEffect(function(){H&&(Ae.current=!0),H!==void 0&&T===Yt&&((Ae.current||H)&&(R==null||R(H)),Ae.current=!0)},[H,T]);var Fe=V;return ge[vt]&&Se===rn&&(Fe=Ze({transition:"none"},Fe)),[T,Se,Fe,H??t]}function sf(e){var t=e;Nt(e)==="object"&&(t=e.transitionSupport);function n(s,i){return!!(s.motionName&&t&&i!==!1)}var o=f.forwardRef(function(s,i){var a=s.visible,c=a===void 0?!0:a,l=s.removeOnLeave,d=l===void 0?!0:l,u=s.forceRender,p=s.children,h=s.motionName,g=s.leavedClassName,m=s.eventProps,v=f.useContext(Hu),j=v.motion,S=n(s,j),_=f.useRef(),$=f.useRef();function M(){try{return _.current instanceof HTMLElement?_.current:Ni($.current)}catch{return null}}var x=af(S,c,M,s),P=Rt(x,4),I=P[0],R=P[1],L=P[2],D=P[3],H=f.useRef(D);D&&(H.current=!0);var b=f.useCallback(function(W){_.current=W,Ti(i,W)},[i]),y,k=Ze(Ze({},m),{},{visible:c});if(!p)y=null;else if(I===Yt)D?y=p(Ze({},k),b):!d&&H.current&&g?y=p(Ze(Ze({},k),{},{className:g}),b):u||!d&&!g?y=p(Ze(Ze({},k),{},{style:{display:"none"}}),b):y=null;else{var T,O;R===vt?O="prepare":Gi(R)?O="active":R===rn&&(O="start");var q=us(h,"".concat(I,"-").concat(O));y=p(Ze(Ze({},k),{},{className:Du(us(h,I),(T={},it(T,q,q&&O),it(T,h,typeof h=="string"),T)),style:L}),b)}if(f.isValidElement(y)&&Pi(y)){var z=y,V=z.ref;V||(y=f.cloneElement(y,{ref:b}))}return f.createElement(zu,{ref:$},y)});return o.displayName="CSSMotion",o}const Mo=sf(zi);function pr(){return pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},pr.apply(this,arguments)}var hr="add",mr="keep",gr="remove",Vo="removed";function cf(e){var t;return e&&Nt(e)==="object"&&"key"in e?t=e:t={key:e},Ze(Ze({},t),{},{key:String(t.key)})}function vr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(cf)}function lf(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],o=0,s=t.length,i=vr(e),a=vr(t);i.forEach(function(d){for(var u=!1,p=o;p<s;p+=1){var h=a[p];if(h.key===d.key){o<p&&(n=n.concat(a.slice(o,p).map(function(g){return Ze(Ze({},g),{},{status:hr})})),o=p),n.push(Ze(Ze({},h),{},{status:mr})),o+=1,u=!0;break}}u||n.push(Ze(Ze({},d),{},{status:gr}))}),o<s&&(n=n.concat(a.slice(o).map(function(d){return Ze(Ze({},d),{},{status:hr})})));var c={};n.forEach(function(d){var u=d.key;c[u]=(c[u]||0)+1});var l=Object.keys(c).filter(function(d){return c[d]>1});return l.forEach(function(d){n=n.filter(function(u){var p=u.key,h=u.status;return p!==d||h!==gr}),n.forEach(function(u){u.key===d&&(u.status=mr)})}),n}var df=["component","children","onVisibleChanged","onAllRemoved"],_f=["status"],uf=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function ff(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mo,n=function(o){Bi(i,o);var s=Li(i);function i(){var a;Oi(this,i);for(var c=arguments.length,l=new Array(c),d=0;d<c;d++)l[d]=arguments[d];return a=s.call.apply(s,[this].concat(l)),it(fr(a),"state",{keyEntities:[]}),it(fr(a),"removeKey",function(u){var p=a.state.keyEntities,h=p.map(function(g){return g.key!==u?g:Ze(Ze({},g),{},{status:Vo})});return a.setState({keyEntities:h}),h.filter(function(g){var m=g.status;return m!==Vo}).length}),a}return Ai(i,[{key:"render",value:function(){var c=this,l=this.state.keyEntities,d=this.props,u=d.component,p=d.children,h=d.onVisibleChanged,g=d.onAllRemoved,m=as(d,df),v=u||f.Fragment,j={};return uf.forEach(function(S){j[S]=m[S],delete m[S]}),delete m.keys,f.createElement(v,m,l.map(function(S){var _=S.status,$=as(S,_f),M=_===hr||_===mr;return f.createElement(t,pr({},j,{key:$.key,visible:M,eventProps:$,onVisibleChanged:function(P){if(h==null||h(P,{key:$.key}),!P){var I=c.removeKey($.key);I===0&&g&&g()}}}),p)}))}}],[{key:"getDerivedStateFromProps",value:function(c,l){var d=c.keys,u=l.keyEntities,p=vr(d),h=lf(u,p);return{keyEntities:h.filter(function(g){var m=u.find(function(v){var j=v.key;return g.key===j});return!(m&&m.status===Vo&&g.status===gr)})}}}]),i}(f.Component);return it(n,"defaultProps",{component:"div"}),n}ff(zi);function Yi(e){var t=e.prefixCls,n=e.motion,o=e.animation,s=e.transitionName;return n||(o?{motionName:"".concat(t,"-").concat(o)}:s?{motionName:s}:null)}function pf(e){var t=e.prefixCls,n=e.visible,o=e.zIndex,s=e.mask,i=e.maskMotion,a=e.maskAnimation,c=e.maskTransitionName;if(!s)return null;var l={};return(i||c||a)&&(l=_t({motionAppear:!0},Yi({motion:i,prefixCls:t,transitionName:c,animation:a}))),f.createElement(Mo,qt({},l,{visible:n,removeOnLeave:!0}),function(d){var u=d.className;return f.createElement("div",{style:{zIndex:o},className:Ro("".concat(t,"-mask"),u)})})}function hf(e){if(Array.isArray(e))return e}function mf(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,s,i,a,c=[],l=!0,d=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;
vendor: 13,715 bytes, lines 17-18
17!(l=(o=i.call(n)).done)&&(c.push(o.value),c.length!==t);l=!0);}catch(u){d=!0,s=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw s}}return c}}function fs(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function gf(e,t){if(e){if(typeof e=="string")return fs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fs(e,t)}}function vf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 18In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _o(e,t){return hf(e)||mf(e,t)||gf(e,t)||vf()}function br(e){"@babel/helpers - typeof";return br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},br(e)}function ps(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function hs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ps(Object(n),!0).forEach(function(o){bf(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ps(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function yr(e){"@babel/helpers - typeof";return yr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yr(e)}function bf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kn,yf={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function xo(){if(kn!==void 0)return kn;kn="";var e=document.createElement("p").style,t="Transform";for(var n in yf)n+t in e&&(kn=n);return kn}function Ki(){return xo()?"".concat(xo(),"TransitionProperty"):"transitionProperty"}function Oo(){return xo()?"".concat(xo(),"Transform"):"transform"}function ms(e,t){var n=Ki();n&&(e.style[n]=t,n!=="transitionProperty"&&(e.style.transitionProperty=t))}function zo(e,t){var n=Oo();n&&(e.style[n]=t,n!=="transform"&&(e.style.transform=t))}function wf(e){return e.style.transitionProperty||e.style[Ki()]}function xf(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue(Oo());if(n&&n!=="none"){var o=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(o[12]||o[4],0),y:parseFloat(o[13]||o[5],0)}}return{x:0,y:0}}var kf=/matrix\((.*)\)/,Sf=/matrix3d\((.*)\)/;function jf(e,t){var n=window.getComputedStyle(e,null),o=n.getPropertyValue("transform")||n.getPropertyValue(Oo());if(o&&o!=="none"){var s,i=o.match(kf);if(i)i=i[1],s=i.split(",").map(function(c){return parseFloat(c,10)}),s[4]=t.x,s[5]=t.y,zo(e,"matrix(".concat(s.join(","),")"));else{var a=o.match(Sf)[1];s=a.split(",").map(function(c){return parseFloat(c,10)}),s[12]=t.x,s[13]=t.y,zo(e,"matrix3d(".concat(s.join(","),")"))}}else zo(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}var Cf=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,Vn;function gs(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function ln(e,t,n){var o=n;if(yr(t)==="object"){for(var s in t)t.hasOwnProperty(s)&&ln(e,s,t[s]);return}if(typeof o<"u"){typeof o=="number"&&(o="".concat(o,"px")),e.style[t]=o;return}return Vn(e,t)}function Ef(e){var t,n,o,s=e.ownerDocument,i=s.body,a=s&&s.documentElement;return t=e.getBoundingClientRect(),n=Math.floor(t.left),o=Math.floor(t.top),n-=a.clientLeft||i.clientLeft||0,o-=a.clientTop||i.clientTop||0,{left:n,top:o}}function Xi(e,t){var n=e["page".concat(t?"Y":"X","Offset")],o="scroll".concat(t?"Top":"Left");if(typeof n!="number"){var s=e.document;n=s.documentElement[o],typeof n!="number"&&(n=s.body[o])}return n}function Qi(e){return Xi(e)}function Ji(e){return Xi(e,!0)}function On(e){var t=Ef(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=Qi(o),t.top+=Ji(o),t}function Gr(e){return e!=null&&e==e.window}function Zi(e){return Gr(e)?e.document:e.nodeType===9?e:e.ownerDocument}function $f(e,t,n){var o=n,s="",i=Zi(e);return o=o||i.defaultView.getComputedStyle(e,null),o&&(s=o.getPropertyValue(t)||o[t]),s}var Nf=new RegExp("^(".concat(Cf,")(?!px)[a-z%]+$"),"i"),Tf=/^(top|right|bottom|left)$/,Wo="currentStyle",Uo="runtimeStyle",Gt="left",Pf="px";function If(e,t){var n=e[Wo]&&e[Wo][t];if(Nf.test(n)&&!Tf.test(t)){var o=e.style,s=o[Gt],i=e[Uo][Gt];e[Uo][Gt]=e[Wo][Gt],o[Gt]=t==="fontSize"?"1em":n||0,n=o.pixelLeft+Pf,o[Gt]=s,e[Uo][Gt]=i}return n===""?"auto":n}typeof window<"u"&&(Vn=window.getComputedStyle?$f:If);function Zn(e,t){return e==="left"?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function vs(e){if(e==="left")return"right";if(e==="right")return"left";if(e==="top")return"bottom";if(e==="bottom")return"top"}function bs(e,t,n){ln(e,"position")==="static"&&(e.style.position="relative");var o=-999,s=-999,i=Zn("left",n),a=Zn("top",n),c=vs(i),l=vs(a);i!=="left"&&(o=999),a!=="top"&&(s=999);var d="",u=On(e);("left"in t||"top"in t)&&(d=wf(e)||"",ms(e,"none")),"left"in t&&(e.style[c]="",e.style[i]="".concat(o,"px")),"top"in t&&(e.style[l]="",e.style[a]="".concat(s,"px")),gs(e);var p=On(e),h={};for(var g in t)if(t.hasOwnProperty(g)){var m=Zn(g,n),v=g==="left"?o:s,j=u[g]-p[g];m===g?h[m]=v+j:h[m]=v-j}ln(e,h),gs(e),("left"in t||"top"in t)&&ms(e,d);var S={};for(var _ in t)if(t.hasOwnProperty(_)){var $=Zn(_,n),M=t[_]-u[_];_===$?S[$]=h[$]+M:S[$]=h[$]-M}ln(e,S)}function Rf(e,t){var n=On(e),o=xf(e),s={x:o.x,y:o.y};"left"in t&&(s.x=o.x+t.left-n.left),"top"in t&&(s.y=o.y+t.top-n.top),jf(e,s)}function Mf(e,t,n){if(n.ignoreShake){var o=On(e),s=o.left.toFixed(0),i=o.top.toFixed(0),a=t.left.toFixed(0),c=t.top.toFixed(0);if(s===a&&i===c)return}n.useCssRight||n.useCssBottom?bs(e,t,n):n.useCssTransform&&Oo()in document.body.style?Rf(e,t):bs(e,t,n)}function Yr(e,t){for(var n=0;n<e.length;n++)t(e[n])}function ec(e){return Vn(e,"boxSizing")==="border-box"}var Of=["margin","border","padding"],wr=-1,Af=2,xr=1,Bf=0;function Lf(e,t,n){var o={},s=e.style,i;for(i in t)t.hasOwnProperty(i)&&(o[i]=s[i],s[i]=t[i]);n.call(e);for(i in t)t.hasOwnProperty(i)&&(s[i]=o[i])}function jn(e,t,n){var o=0,s,i,a;for(i=0;i<t.length;i++)if(s=t[i],s)for(a=0;a<n.length;a++){var c=void 0;s==="border"?c="".concat(s).concat(n[a],"Width"):c=s+n[a],o+=parseFloat(Vn(e,c))||0}return o}var jt={getParent:function(t){var n=t;do n.nodeType===11&&n.host?n=n.host:n=n.parentNode;while(n&&n.nodeType!==1&&n.nodeType!==9);return n}};Yr(["Width","Height"],function(e){jt["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],jt["viewport".concat(e)](n))},jt["viewport".concat(e)]=function(t){var n="client".concat(e),o=t.document,s=o.body,i=o.documentElement,a=i[n];return o.compatMode==="CSS1Compat"&&a||s&&s[n]||a}});function ys(e,t,n){var o=n;if(Gr(e))return t==="width"?jt.viewportWidth(e):jt.viewportHeight(e);if(e.nodeType===9)return t==="width"?jt.docWidth(e):jt.docHeight(e);var s=t==="width"?["Left","Right"]:["Top","Bottom"],i=Math.floor(t==="width"?e.getBoundingClientRect().width:e.getBoundingClientRect().height),a=ec(e),c=0;(i==null||i<=0)&&(i=void 0,c=Vn(e,t),(c==null||Number(c)<0)&&(c=e.style[t]||0),c=Math.floor(parseFloat(c))||0),o===void 0&&(o=a?xr:wr);var l=i!==void 0||a,d=i||c;return o===wr?l?d-jn(e,["border","padding"],s):c:l?o===xr?d:d+(o===Af?-jn(e,["border"],s):jn(e,["margin"],s)):c+jn(e,Of.slice(o),s)}var Df={position:"absolute",visibility:"hidden",display:"block"};function ws(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o,s=t[0];return s.offsetWidth!==0?o=ys.apply(void 0,t):Lf(s,Df,function(){o=ys.apply(void 0,t)}),o}Yr(["width","height"],function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);jt["outer".concat(t)]=function(o,s){return o&&ws(o,e,s?Bf:xr)};var n=e==="width"?["Left","Right"]:["Top","Bottom"];jt[e]=function(o,s){var i=s;if(i!==void 0){if(o){var a=ec(o);return a&&(i+=jn(o,["padding","border"],n)),ln(o,e,i)}return}return o&&ws(o,e,wr)}});function tc(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var Te={getWindow:function(t){if(t&&t.document&&t.setTimeout)return t;var n=t.ownerDocument||t;return n.defaultView||n.parentWindow},getDocument:Zi,offset:function(t,n,o){if(typeof n<"u")Mf(t,n,o||{});else return On(t)},isWindow:Gr,each:Yr,css:ln,clone:function(t){var n,o={};for(n in t)t.hasOwnProperty(n)&&(o[n]=t[n]);var s=t.overflow;if(s)for(n in t)t.hasOwnProperty(n)&&(o.overflow[n]=t.overflow[n]);return o},mix:tc,getWindowScrollLeft:function(t){return Qi(t)},getWindowScrollTop:function(t){return Ji(t)},merge:function(){for(var t={},n=0;n<arguments.length;n++)Te.mix(t,n<0||arguments.length<=n?void 0:arguments[n]);return t},viewportWidth:0,viewportHeight:0};tc(Te,jt);var Go=Te.getParent;function kr(e){if(Te.isWindow(e)||e.nodeType===9)return null;var t=Te.getDocument(e),n=t.body,o,s=Te.css(e,"position"),i=s==="fixed"||s==="absolute";if(!i)return e.nodeName.toLowerCase()==="html"?null:Go(e);for(o=Go(e);o&&o!==n&&o.nodeType!==9;o=Go(o))if(s=Te.css(o,"position"),s!=="static")return o;return null}var xs=Te.getParent;function Ff(e){if(Te.isWindow(e)||e.nodeType===9)return!1;var t=Te.getDocument(e),n=t.body,o=null;for(o=xs(e);o&&o!==n&&o!==t;o=xs(o)){var s=Te.css(o,"position");if(s==="fixed")return!0}return!1}function Kr(e,t){for(var n={left:0,right:1/0,top:0,bottom:1/0},o=kr(e),s=Te.getDocument(e),i=s.defaultView||s.parentWindow,a=s.body,c=s.documentElement;o;){if((navigator.userAgent.indexOf("MSIE")===-1||o.clientWidth!==0)&&o!==a&&o!==c&&Te.css(o,"overflow")!=="visible"){var l=Te.offset(o);l.left+=o.clientLeft,l.top+=o.clientTop,n.top=Math.max(n.top,l.top),n.right=Math.min(n.right,l.left+o.clientWidth),n.bottom=Math.min(n.bottom,l.top+o.clientHeight),n.left=Math.max(n.left,l.left)}else if(o===a||o===c)break;o=kr(o)}var d=null;if(!Te.isWindow(e)&&e.nodeType!==9){d=e.style.position;var u=Te.css(e,"position");u==="absolute"&&(e.style.position="fixed")}var p=Te.getWindowScrollLeft(i),h=Te.getWindowScrollTop(i),g=Te.viewportWidth(i),m=Te.viewportHeight(i),v=c.scrollWidth,j=c.scrollHeight,S=window.getComputedStyle(a);if(S.overflowX==="hidden"&&(v=i.innerWidth),S.overflowY==="hidden"&&(j=i.innerHeight),e.style&&(e.style.position=d),t||Ff(e))n.left=Math.max(n.left,p),n.top=Math.max(n.top,h),n.right=Math.min(n.right,p+g),n.bottom=Math.min(n.bottom,h+m);else{var _=Math.max(v,p+g);n.right=Math.min(n.right,_);var $=Math.max(j,h+m);n.bottom=Math.min(n.bottom,$)}return n.top>=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Hf(e,t,n,o){var s=Te.clone(e),i={width:t.width,height:t.height};return o.adjustX&&s.left<n.left&&(s.left=n.left),o.resizeWidth&&s.left>=n.left&&s.left+i.width>n.right&&(i.width-=s.left+i.width-n.right),o.adjustX&&s.left+i.width>n.right&&(s.left=Math.max(n.right-i.width,n.left)),o.adjustY&&s.top<n.top&&(s.top=n.top),o.resizeHeight&&s.top>=n.top&&s.top+i.height>n.bottom&&(i.height-=s.top+i.height-n.bottom),o.adjustY&&s.top+i.height>n.bottom&&(s.top=Math.max(n.bottom-i.height,n.top)),Te.mix(s,i)}function Xr(e){var t,n,o;if(!Te.isWindow(e)&&e.nodeType!==9)t=Te.offset(e),n=Te.outerWidth(e),o=Te.outerHeight(e);else{var s=Te.getWindow(e);t={left:Te.getWindowScrollLeft(s),top:Te.getWindowScrollTop(s)},n=Te.viewportWidth(s),o=Te.viewportHeight(s)}return t.width=n,t.height=o,t}function ks(e,t){var n=t.charAt(0),o=t.charAt(1),s=e.width,i=e.height,a=e.left,c=e.top;return n==="c"?c+=i/2:n==="b"&&(c+=i),o==="c"?a+=s/2:o==="r"&&(a+=s),{left:a,top:c}}function eo(e,t,n,o,s){var i=ks(t,n[1]),a=ks(e,n[0]),c=[a.left-i.left,a.top-i.top];return{left:Math.round(e.left-c[0]+o[0]-s[0]),top:Math.round(e.top-c[1]+o[1]-s[1])}}function Ss(e,t,n){return e.left<n.left||e.left+t.width>n.right}function js(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function qf(e,t,n){return e.left>n.right||e.left+t.width<n.left}function Vf(e,t,n){return e.top>n.bottom||e.top+t.height<n.top}function to(e,t,n){var o=[];return Te.each(e,function(s){o.push(s.replace(t,function(i){return n[i]}))}),o}function no(e,t){return e[t]=-e[t],e}function Cs(e,t){var n;return/%$/.test(e)?n=parseInt(e.substring(0,e.length-1),10)/100*t:n=parseInt(e,10),n||0}function Es(e,t){e[0]=Cs(e[0],t.width),e[1]=Cs(e[1],t.height)}function nc(e,t,n,o){var s=n.points,i=n.offset||[0,0],a=n.targetOffset||[0,0],c=n.overflow,l=n.source||e;i=[].concat(i),a=[].concat(a),c=c||{};var d={},u=0,p=!!(c&&c.alwaysByViewport),h=Kr(l,p),g=Xr(l);Es(i,g),Es(a,t);var m=eo(g,t,s,i,a),v=Te.merge(g,m);if(h&&(c.adjustX||c.adjustY)&&o){if(c.adjustX&&Ss(m,g,h)){var j=to(s,/[lr]/gi,{l:"r",r:"l"}),S=no(i,0),_=no(a,0),$=eo(g,t,j,S,_);qf($,g,h)||(u=1,s=j,i=S,a=_)}if(c.adjustY&&js(m,g,h)){var M=to(s,/[tb]/gi,{t:"b",b:"t"}),x=no(i,1),P=no(a,1),I=eo(g,t,M,x,P);Vf(I,g,h)||(u=1,s=M,i=x,a=P)}u&&(m=eo(g,t,s,i,a),Te.mix(v,m));var R=Ss(m,g,h),L=js(m,g,h);if(R||L){var D=s;R&&(D=to(s,/[lr]/gi,{l:"r",r:"l"})),L&&(D=to(s,/[tb]/gi,{t:"b",b:"t"})),s=D,i=n.offset||[0,0],a=n.targetOffset||[0,0]}d.adjustX=c.adjustX&&R,d.adjustY=c.adjustY&&L,(d.adjustX||d.adjustY)&&(v=Hf(m,g,h,d))}return v.width!==g.width&&Te.css(l,"width",Te.width(l)+v.width-g.width),v.height!==g.height&&Te.css(l,"height",Te.height(l)+v.height-g.height),Te.offset(l,{left
18:v.left,top:v.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:s,offset:i,targetOffset:a,overflow:d}}function zf(e,t){var n=Kr(e,t),o=Xr(e);return!n||o.left+o.width<=n.left||o.top+o.height<=n.top||o.left>=n.right||o.top>=n.bottom}function Qr(e,t,n){var o=n.target||t,s=Xr(o),i=!zf(o,n.overflow&&n.overflow.alwaysByViewport);return nc(e,s,n,i)}Qr.__getOffsetParent=kr;Qr.__getVisibleRectForElement=Kr;function Wf(e,t,n){var o,s,i=Te.getDocument(e),a=i.defaultView||i.parentWindow,c=Te.getWindowScrollLeft(a),l=Te.getWindowScrollTop(a),d=Te.viewportWidth(a),u=Te.viewportHeight(a);"pageX"in t?o=t.pageX:o=c+t.clientX,"pageY"in t?s=t.pageY:s=l+t.clientY;var p={left:o,top:s,width:0,height:0},h=o>=0&&o<=c+d&&s>=0&&s<=l+u,g=[n.points[0],"cc"];return nc(e,p,hs(hs({},n),{},{points:g}),h)}function Uf(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=new Set;function s(i,a){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=o.has(i);if(Ht(!l,"Warning: There may be circular references"),l)return!1;if(i===a)return!0;if(n&&c>1)return!1;o.add(i);var d=c+1;if(Array.isArray(i)){if(!Array.isArray(a)||i.length!==a.length)return!1;for(var u=0;u<i.length;u++)if(!s(i[u],a[u],d))return!1;return!0}if(i&&a&&Mn(i)==="object"&&Mn(a)==="object"){var p=Object.keys(i);return p.length!==Object.keys(a).length?!1:p.every(function(h){return s(i[h],a[h],d)})}return!1}return s(e,t)}const Gf=function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,o=t.height;if(n||o)return!0}if(e.getBoundingClientRect){var s=e.getBoundingClientRect(),i=s.width,a=s.height;if(i||a)return!0}}return!1};var $s=qn()?f.useLayoutEffect:f.useEffect,Sr=function(t,n){var o=f.useRef(!0);$s(function(){return t(o.current)},n),$s(function(){return o.current=!1,function(){o.current=!0}},[])};const Yf=function(e,t){var n=Ee.useRef(!1),o=Ee.useRef(null);function s(){window.clearTimeout(o.current)}function i(a){if(s(),!n.current||a===!0){if(e(a)===!1)return;n.current=!0,o.current=window.setTimeout(function(){n.current=!1},t)}else o.current=window.setTimeout(function(){n.current=!1,i()},t)}return[i,function(){n.current=!1,s()}]};var oc=function(){if(typeof Map<"u")return Map;function e(t,n){var o=-1;return t.some(function(s,i){return s[0]===n?(o=i,!0):!1}),o}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var o=e(this.__entries__,n),s=this.__entries__[o];return s&&s[1]},t.prototype.set=function(n,o){var s=e(this.__entries__,n);~s?this.__entries__[s][1]=o:this.__entries__.push([n,o])},t.prototype.delete=function(n){var o=this.__entries__,s=e(o,n);~s&&o.splice(s,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,o){o===void 0&&(o=null);for(var s=0,i=this.__entries__;s<i.length;s++){var a=i[s];n.call(o,a[1],a[0])}},t}()}(),jr=typeof window<"u"&&typeof document<"u"&&window.document===document,ko=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Kf=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ko):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Xf=2;function Qf(e,t){var n=!1,o=!1,s=0;function i(){n&&(n=!1,e()),o&&c()}function a(){Kf(i)}function c(){var l=Date.now();if(n){if(l-s<Xf)return;o=!0}else n=!0,o=!1,setTimeout(a,t);s=l}return c}var Jf=20,Zf=["top","right","bottom","left","width","height","size","weight"],ep=typeof MutationObserver<"u",tp=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Qf(this.refresh.bind(this),Jf)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,o=n.indexOf(t);~o&&n.splice(o,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!jr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ep?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!jr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,o=n===void 0?"":n,s=Zf.some(function(i){return!!~o.indexOf(i)});s&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=ne
18w e),this.instance_},e.instance_=null,e}(),rc=function(e,t){for(var n=0,o=Object.keys(t);n<o.length;n++){var s=o[n];Object.defineProperty(e,s,{value:t[s],enumerable:!1,writable:!1,configurable:!0})}return e},mn=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||ko},ac=Ao(0,0,0,0);function So(e){return parseFloat(e)||0}function Ns(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(o,s){var i=e["border-"+s+"-width"];return o+So(i)},0)}function np(e){for(var t=["top","right","bottom","left"],n={},o=0,s=t;o<s.length;o++){var i=s[o],a=e["padding-"+i];n[i]=So(a)}return n}function op(e){var t=e.getBBox();return Ao(0,0,t.width,t.height)}function rp(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return ac;var o=mn(e).getComputedStyle(e),s=np(o),i=s.left+s.right,a=s.top+s.bottom,c=So(o.width),l=So(o.height);if(o.boxSizing==="border-box"&&(Math.round(c+i)!==t&&(c-=Ns(o,"left","right")+i),Math.round(l+a)!==n&&(l-=Ns(o,"top","bottom")+a)),!sp(e)){var d=Math.round(c+i)-t,u=Math.round(l+a)-n;Math.abs(d)!==1&&(c-=d),Math.abs(u)!==1&&(l-=u)}return Ao(s.left,s.top,c,l)}var ap=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof mn(e).SVGGraphicsElement}:function(e){return e instanceof mn(e).SVGElement&&typeof e.getBBox=="function"}}();function sp(e){return e===mn(e).document.documentElement}function ip(e){return jr?ap(e)?op(e):rp(e):ac}function cp(e){var t=e.x,n=e.y,o=e.width,s=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(i.prototype);return rc(a,{x:t,y:n,width:o,height:s,top:n,right:t+o,bottom:s+n,left:t}),a}function Ao(e,t,n,o){return{x:e,y:t,width:n,height:o}}var lp=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ao(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=ip(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),dp=function(){function e(t,n){var o=cp(n);rc(this,{target:t,contentRect:o})}return e}(),_p=function(){function e(t,n,o){if(this.activeObservations_=[],this.observations_=new oc,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=o}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof mn(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new lp(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof mn(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(o){return new dp(o.target,o.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),sc=typeof WeakMap<"u"?new WeakMap:new oc,ic=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=tp.getInstance(),o=new _p(t,n,this);sc.set(this,o)}return e}();["observe","unobserve","disconnect"].forEach(function(e){ic.prototype[e]=function(){var t;return(t=sc.get(this))[e].apply(t,arguments)}});var up=function(){return typeof ko.ResizeObserver<"u"?ko.ResizeObserver:ic}();function fp(e,t){return e===t?!0:!e||!t?!1:"pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t?e.clientX===t.clientX&&e.clientY===t.clientY:!1}function pp(e,t){e!==document.activeElement&&lo(t,e)&&typeof e.focus=="function"&&e.focus()}function Ts(e,t){var n=null,o=null;function s(a){var c=_o(a,1),l=c[0].target;if(document.documentElement.contains(l)){var d=l.getBoundingClientRect(),u=d.width,p=d.height,h=Math.floor(u),g=Math.floor(p);(n!==h||o!==g)&&Promise.resolve().then(function(){t({width:h,height:g})}),n=h,o=g}}var i=new up(s);return e&&i.observe(e),function(){i.disconnect()}}function Ps(e){return typeof e!="function"?null:e()}function Is(e){return br(e)!=="object"||!e?null:e}var hp=function(t,n){var o=t.children,s=t.disabled,i=t.target,a=t.align,c=t.onAlign,l=t.monitorWindowResize,d=t.monitorBufferTime,u=d===void 0?0:d,p=Ee.useRef({}),h=Ee.useRef(),g=Ee.Children.only(o),m=Ee.useRef({});m.current.disabled=s,m.current.target=i,m.current.align=a,m.current.onAlign=c;var v=Yf(function(){var H=m.current,b=H.disabled,y=H.target,k=H.align,T=H.onAlign,O
18=h.current;if(!b&&y&&O){var q,z=Ps(y),V=Is(y);p.current.element=z,p.current.point=V,p.current.align=k;var W=document,te=W.activeElement;return z&&Gf(z)?q=Qr(O,z,k):V&&(q=Wf(O,V,k)),pp(te,O),T&&q&&T(O,q),!0}return!1},u),j=_o(v,2),S=j[0],_=j[1],$=Ee.useState(),M=_o($,2),x=M[0],P=M[1],I=Ee.useState(),R=_o(I,2),L=R[0],D=R[1];return Sr(function(){P(Ps(i)),D(Is(i))}),Ee.useEffect(function(){(p.current.element!==x||!fp(p.current.point,L)||!Uf(p.current.align,a))&&S()}),Ee.useEffect(function(){var H=Ts(h.current,S);return H},[h.current]),Ee.useEffect(function(){var H=Ts(x,S);return H},[x]),Ee.useEffect(function(){s?_():S()},[s]),Ee.useEffect(function(){if(l){var H=St(window,"resize",S);return H.remove}},[l]),Ee.useEffect(function(){return function(){_()}},[]),Ee.useImperativeHandle(n,function(){return{forceAlign:function(){return S(!0)}}}),Ee.isValidElement(g)&&(g=Ee.cloneElement(g,{ref:Wr(g.ref,h)})),g},cc=Ee.forwardRef(hp);cc.displayName="Align";function Cr(){Cr=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(b,y,k){b[y]=k.value},s=typeof Symbol=="function"?Symbol:{},i=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function l(b,y,k){return Object.defineProperty(b,y,{value:k,enumerable:!0,configurable:!0,writable:!0}),b[y]}try{l({},"")}catch{l=function(k,T,O){return k[T]=O}}function d(b,y,k,T){var O=y&&y.prototype instanceof h?y:h,q=Object.create(O.prototype),z=new L(T||[]);return o(q,"_invoke",{value:x(b,k,z)}),q}function u(b,y,k){try{return{type:"normal",arg:b.call(y,k)}}catch(T){return{type:"throw",arg:T}}}e.wrap=d;var p={};function h(){}function g(){}function m(){}var v={};l(v,i,function(){return this});var j=Object.getPrototypeOf,S=j&&j(j(D([])));S&&S!==t&&n.call(S,i)&&(v=S);var _=m.prototype=h.prototype=Object.create(v);function $(b){["next","throw","return"].forEach(function(y){l(b,y,function(k){return this._invoke(y,k)})})}function M(b,y){function k(O,q,z,V){var W=u(b[O],b,q);if(W.type!=="throw"){var te=W.arg,E=te.value;return E&&en(E)=="object"&&n.call(E,"__await")?y.resolve(E.__await).then(function(B){k("next",B,z,V)},function(B){k("throw",B,z,V)}):y.resolve(E).then(function(B){te.value=B,z(te)},function(B){return k("throw",B,z,V)})}V(W.arg)}var T;o(this,"_invoke",{value:function(q,z){function V(){return new y(function(W,te){k(q,z,W,te)})}return T=T?T.then(V,V):V()}})}function x(b,y,k){var T="suspendedStart";return function(O,q){if(T==="executing")throw new Error("Generator is already running");if(T==="completed"){if(O==="throw")throw q;return H()}for(k.method=O,k.arg=q;;){var z=k.delegate;if(z){var V=P(z,k);if(V){if(V===p)continue;return V}}if(k.method==="next")k.sent=k._sent=k.arg;else if(k.method==="throw"){if(T==="suspendedStart")throw T="completed",k.arg;k.dispatchException(k.arg)}else k.method==="return"&&k.abrupt("return",k.arg);T="executing";var W=u(b,y,k);if(W.type==="normal"){if(T=k.done?"completed":"suspendedYield",W.arg===p)continue;return{value:W.arg,done:k.done}}W.type==="throw"&&(T="completed",k.method="throw",k.arg=W.arg)}}}function P(b,y){var k=y.method,T=b.iterator[k];if(T===void 0)return y.delegate=null,k==="throw"&&b.iterator.return&&(y.method="return",y.arg=void 0,P(b,y),y.method==="throw")||k!=="return"&&(y.method="throw",y.arg=new TypeError("The iterator does not provide a '"+k+"' method")),p;var O=u(T,b.iterator,y.arg);if(O.type==="throw")return y.method="throw",y.arg=O.arg,y.delegate=null,p;var q=O.arg;return q?q.done?(y[b.resultName]=q.value,y.next=b.nextLoc,y.method!=="return"&&(y.method="next",y.arg=void 0),y.delegate=null,p):q:(y.method="throw",y.arg=new TypeError("iterator result is not an object"),y.delegate=null,p)}function I(b){var y={tryLoc:b[0]};1 in b&&(y.catchLoc=b[1]),2 in b&&(y.finallyLoc=b[2],y.afterLoc=b[3]),this.tryEntries.push(y)}function R(b){var y=b.completion||{};y.type="normal",delete y.arg,b.completion=y}function L(b){this.tryEntries=[{tryLoc:"root"}],b.forEach(I,this),this.reset(!0)}function D(b){if(b){var y=b[i];if(y)return y.call(b);if(typeof b.next=="function")return b;if(!isNaN(b.length)){var k=-1,T=function O(){for(;++k<b.length;)if(n.call(b,k))return O.value=b[k],O.done=!1,O;return O.value=void 0,O.done=!0,O};return T.next=T}}return{next:H}}function H(){return{value:void 0,done:!0}}return g.prototype=m,o(_,"constructor",{value:m,configurable:!0}),o(m,"constructor",{value:g,configurable:!0}),g.displayName=l(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(b){var y=typeof b=="function"&&b.constructor;return!!y&&(y===g||(y.displayName||y.name)==="GeneratorFunction")},e.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,m):(b.__proto__=m,l(b,c,"GeneratorFunction")),b.prototype=Object.create(_),b},e.awrap=function(b){return{__await:b}},$(M.prototype),l(M.prototype,a,function(){return this}),e.AsyncIterator=M,e.async=function(b,y,k,T,O){O===void 0&&(O=Promise);var q=new M(d(b,y,k,T),O);return e.isGeneratorFunction(y)?q:q.next().then(function(z){return z.done?z.value:q.next()})},$(_),l(_,c,"Generator"),l(_,i,function(){return this}),l(_,"toString",function(){return"[object Generator]"}),e.keys=function(b){var y=Object(b),k=[];for(var T in y)k.push(T);return k.reverse(),function O(){for(;k.length;){var q=k.pop();if(q in y)return O.value=q,O.done=!1,O}return O.done=!0,O}},e.values=D,L.prototype={constructor:L,reset:function(y){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEac
18h(R),!y)for(var k in this)k.charAt(0)==="t"&&n.call(this,k)&&!isNaN(+k.slice(1))&&(this[k]=void 0)},stop:function(){this.done=!0;var y=this.tryEntries[0].completion;if(y.type==="throw")throw y.arg;return this.rval},dispatchException:function(y){if(this.done)throw y;var k=this;function T(te,E){return z.type="throw",z.arg=y,k.next=te,E&&(k.method="next",k.arg=void 0),!!E}for(var O=this.tryEntries.length-1;O>=0;--O){var q=this.tryEntries[O],z=q.completion;if(q.tryLoc==="root")return T("end");if(q.tryLoc<=this.prev){var V=n.call(q,"catchLoc"),W=n.call(q,"finallyLoc");if(V&&W){if(this.prev<q.catchLoc)return T(q.catchLoc,!0);if(this.prev<q.finallyLoc)return T(q.finallyLoc)}else if(V){if(this.prev<q.catchLoc)return T(q.catchLoc,!0)}else{if(!W)throw new Error("try statement without catch or finally");if(this.prev<q.finallyLoc)return T(q.finallyLoc)}}}},abrupt:function(y,k){for(var T=this.tryEntries.length-1;T>=0;--T){var O=this.tryEntries[T];if(O.tryLoc<=this.prev&&n.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var q=O;break}}q&&(y==="break"||y==="continue")&&q.tryLoc<=k&&k<=q.finallyLoc&&(q=null);var z=q?q.completion:{};return z.type=y,z.arg=k,q?(this.method="next",this.next=q.finallyLoc,p):this.complete(z)},complete:function(y,k){if(y.type==="throw")throw y.arg;return y.type==="break"||y.type==="continue"?this.next=y.arg:y.type==="return"?(this.rval=this.arg=y.arg,this.method="return",this.next="end"):y.type==="normal"&&k&&(this.next=k),p},finish:function(y){for(var k=this.tryEntries.length-1;k>=0;--k){var T=this.tryEntries[k];if(T.finallyLoc===y)return this.complete(T.completion,T.afterLoc),R(T),p}},catch:function(y){for(var k=this.tryEntries.length-1;k>=0;--k){var T=this.tryEntries[k];if(T.tryLoc===y){var O=T.completion;if(O.type==="throw"){var q=O.arg;R(T)}return q}}throw new Error("illegal catch attempt")},delegateYield:function(y,k,T){return this.delegate={iterator:D(y),resultName:k,nextLoc:T},this.method==="next"&&(this.arg=void 0),p}},e}function Rs(e,t,n,o,s,i,a){try{var c=e[i](a),l=c.value}catch(d){n(d);return}c.done?t(l):Promise.resolve(l).then(o,s)}function mp(e){return function(){var t=this,n=arguments;return new Promise(function(o,s){var i=e.apply(t,n);function a(l){Rs(i,o,s,a,c,"next",l)}function c(l){Rs(i,o,s,a,c,"throw",l)}a(void 0)})}}var Ms=["measure","alignPre","align",null,"motion"];const gp=function(e,t){var n=En(null),o=Ot(n,2),s=o[0],i=o[1],a=f.useRef();function c(u){i(u,!0)}function l(){bt.cancel(a.current)}function d(u){l(),a.current=bt(function(){c(function(p){switch(s){case"align":return"motion";case"motion":return"stable"}return p}),u==null||u()})}return f.useEffect(function(){c("measure")},[e]),f.useEffect(function(){switch(s){case"measure":t();break}s&&(a.current=bt(mp(Cr().mark(function u(){var p,h;return Cr().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:p=Ms.indexOf(s),h=Ms[p+1],h&&p!==-1&&c(h);case 3:case"end":return m.stop()}},u)}))))},[s]),f.useEffect(function(){return function(){l()}},[]),[s,d]},vp=function(e){var t=f.useState({width:0,height:0}),n=Ot(t,2),o=n[0],s=n[1];function i(c){var l=c.offsetWidth,d=c.offsetHeight,u=c.getBoundingClientRect(),p=u.width,h=u.height;Math.abs(l-p)<1&&Math.abs(d-h)<1&&(l=p,d=h),s({width:l,height:d})}var a=f.useMemo(function(){var c={};if(e){var l=o.width,d=o.height;e.indexOf("height")!==-1&&d?c.height=d:e.indexOf("minHeight")!==-1&&d&&(c.minHeight=d),e.indexOf("width")!==-1&&l?c.width=l:e.indexOf("minWidth")!==-1&&l&&(c.minWidth=l)}return c},[e,o]);return[a,i]};var lc=f.forwardRef(function(e,t){var n=e.visible,o=e.prefixCls,s=e.className,i=e.style,a=e.children,c=e.zIndex,l=e.stretch,d=e.destroyPopupOnHide,u=e.forceRender,p=e.align,h=e.point,g=e.getRootDomNode,m=e.getClassNameFromAlign,v=e.onAlign,j=e.onMouseEnter,S=e.onMouseLeave,_=e.onMouseDown,$=e.onTouchStart,M=e.onClick,x=f.useRef(),P=f.useRef(),I=f.useState(),R=Ot(I,2),L=R[0],D=R[1],H=vp(l),b=Ot(H,2),y=b[0],k=b[1];function T(){l&&k(g())}var O=gp(n,T),q=Ot(O,2),z=q[0],V=q[1],W=f.useState(0),te=Ot(W,2),E=te[0],B=te[1],G=f.useRef();Sr(function(){z==="alignPre"&&B(0)},[z]);function N(){return h||g}function K(){var U;(U=x.current)===null||U===void 0||U.forceAlign()}function ee(U,we){var Se=m(we);L!==Se&&D(Se),B(function($e){return $e+1}),z==="align"&&(v==null||v(U,we))}
vendor: 9,376 bytes, line 18
18Sr(function(){z==="align"&&(E<3?K():V(function(){var U;(U=G.current)===null||U===void 0||U.call(G)}))},[E]);var se=_t({},Yi(e));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(U){var we=se[U];se[U]=function(Se,$e){return V(),we==null?void 0:we(Se,$e)}});function je(){return new Promise(function(U){G.current=U})}f.useEffect(function(){!se.motionName&&z==="motion"&&V()},[se.motionName,z]),f.useImperativeHandle(t,function(){return{forceAlign:K,getElement:function(){return P.current}}});var be=_t(_t({},y),{},{zIndex:c,opacity:z==="motion"||z==="stable"||!n?void 0:0,pointerEvents:!n&&z!=="stable"?"none":void 0},i),ge=!0;p!=null&&p.points&&(z==="align"||z==="stable")&&(ge=!1);var re=a;return f.Children.count(a)>1&&(re=f.createElement("div",{className:"".concat(o,"-content")},a)),f.createElement(Mo,qt({visible:n,ref:P,leavedClassName:"".concat(o,"-hidden")},se,{onAppearPrepare:je,onEnterPrepare:je,removeOnLeave:d,forceRender:u}),function(U,we){var Se=U.className,$e=U.style,Ae=Ro(o,s,L,Se);return f.createElement(cc,{target:N(),key:"popup",ref:x,monitorWindowResize:!0,disabled:ge,align:p,onAlign:ee},f.createElement("div",{ref:we,className:Ae,onMouseEnter:j,onMouseLeave:S,onMouseDownCapture:_,onTouchStartCapture:$,onClick:M,style:_t(_t({},$e),be)},re))})});lc.displayName="PopupInner";var dc=f.forwardRef(function(e,t){var n=e.prefixCls,o=e.visible,s=e.zIndex,i=e.children,a=e.mobile;a=a===void 0?{}:a;var c=a.popupClassName,l=a.popupStyle,d=a.popupMotion,u=d===void 0?{}:d,p=a.popupRender,h=e.onClick,g=f.useRef();f.useImperativeHandle(t,function(){return{forceAlign:function(){},getElement:function(){return g.current}}});var m=_t({zIndex:s},l),v=i;return f.Children.count(i)>1&&(v=f.createElement("div",{className:"".concat(n,"-content")},i)),p&&(v=p(v)),f.createElement(Mo,qt({visible:o,ref:g,removeOnLeave:!0},u),function(j,S){var _=j.className,$=j.style,M=Ro(n,c,_);return f.createElement("div",{ref:S,className:M,onClick:h,style:_t(_t({},$),m)},v)})});dc.displayName="MobilePopupInner";var bp=["visible","mobile"],_c=f.forwardRef(function(e,t){var n=e.visible,o=e.mobile,s=Pu(e,bp),i=f.useState(n),a=Ot(i,2),c=a[0],l=a[1],d=f.useState(!1),u=Ot(d,2),p=u[0],h=u[1],g=_t(_t({},s),{},{visible:c});f.useEffect(function(){l(n),n&&o&&h(Iu())},[n,o]);var m=p?f.createElement(dc,qt({},g,{mobile:o,ref:t})):f.createElement(lc,qt({},g,{ref:t}));return f.createElement("div",null,f.createElement(pf,g),m)});_c.displayName="Popup";var Os=f.createContext(null);function Yo(){}function yp(){return""}function wp(e){return e?e.ownerDocument:window.document}var xp=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function kp(e){var t=function(n){mu(s,n);var o=bu(s);function s(i){var a;pu(this,s),a=o.call(this,i),Oe(Le(a),"popupRef",f.createRef()),Oe(Le(a),"triggerRef",f.createRef()),Oe(Le(a),"portalContainer",void 0),Oe(Le(a),"attachId",void 0),Oe(Le(a),"clickOutsideHandler",void 0),Oe(Le(a),"touchOutsideHandler",void 0),Oe(Le(a),"contextMenuOutsideHandler1",void 0),Oe(Le(a),"contextMenuOutsideHandler2",void 0),Oe(Le(a),"mouseDownTimeout",void 0),Oe(Le(a),"focusTime",void 0),Oe(Le(a),"preClickTime",void 0),Oe(Le(a),"preTouchTime",void 0),Oe(Le(a),"delayTimer",void 0),Oe(Le(a),"hasPopupMouseDown",void 0),Oe(Le(a),"onMouseEnter",function(l){var d=a.props.mouseEnterDelay;a.fireEvents("onMouseEnter",l),a.delaySetPopupVisible(!0,d,d?null:l)}),Oe(Le(a),"onMouseMove",function(l){a.fireEvents("onMouseMove",l),a.setPoint(l)}),Oe(Le(a),"onMouseLeave",function(l){a.fireEvents("onMouseLeave",l),a.delaySetPopupVisible(!1,a.props.mouseLeaveDelay)}),Oe(Le(a),"onPopupMouseEnter",function(){a.clearDelayTimer()}),Oe(Le(a),"onPopupMouseLeave",function(l){var d;l.relatedTarget&&!l.relatedTarget.setTimeout&&lo((d=a.popupRef.current)===null||d===void 0?void 0:d.getElement(),l.relatedTarget)||a.delaySetPopupVisible(!1,a.props.mouseLeaveDelay)}),Oe(Le(a),"onFocus",function(l){a.fireEvents("onFocus",l),a.clearDelayTimer(),a.isFocusToShow()&&(a.focusTime=Date.now(),a.delaySetPopupVisible(!0,a.props.focusDelay))}),Oe(Le(a),"onMouseDown",function(l){a.fireEvents("onMouseDown",l),a.preClickTime=Date.now()}),Oe(Le(a),"onTouchStart",function(l){a.fireEvents("onTouchStart",l),a.preTouchTime=Date.now()}),Oe(Le(a),"onBlur",function(l){a.fireEvents("onBlur",l),a.clearDelayTimer(),a.isBlurToHide()&&a.delaySetPopupVisible(!1,a.props.blurDelay)}),Oe(Le(a),"onContextMenu",function(l){l.preventDefault(),a.fireEvents("onContextMenu",l),a.setPopupVisible(!0,l)}),Oe(Le(a),"onContextMenuClose",function(){a.isContextMenuToShow()&&a.close()}),Oe(Le(a),"onClick",function(l){if(a.fireEvents("onClick",l),a.focusTime){var d;if(a.preClickTime&&a.preTouchTime?d=Math.min(a.preClickTime,a.preTouchTime):a.preClickTime?d=a.preClickTime:a.preTouchTime&&(d=a.preTouchTime),Math.abs(d-a.focusTime)<20)return;a.focusTime=0}a.preClickTime=0,a.preTouchTime=0,a.isClickToShow()&&(a.isClickToHide()||a.isBlurToHide())&&l&&l.preventDefault&&l.preventDefault();var u=!a.state.popupVisible;(a.isClickToHide()&&!u||u&&a.isClickToShow())&&a.setPopupVisible(!a.state.popupVisible,l)}),Oe(Le(a),"onPopupMouseDown",function(){if(a.hasPopupMouseDown=!0,clearTimeout(a.mouseDownTimeout),a.mouseDownTimeout=window.setTimeout(function(){a.hasPopupMouseDown=!1},0),a.context){var l;(l=a.context).onPopupMouseDown.apply(l,arguments)}}),Oe(Le(a),"onDocumentClick",function(l){if(!(a.props.mask&&!a.props.maskClosable)){var d=l.target,u=a.getRootDomNode(),p=a.getPopupDomNode();(!lo(u,d)||a.isContextMenuOnly())&&!lo(p,d)&&!a.hasPopupMouseDown&&a.close()}}),Oe(Le(a),"getRootDomNode",function(){var l=a.props.getTriggerDOMNode;if(l)return l(a.triggerRef.current);try{var d=Ni(a.triggerRef.current);if(d)return d}catch{}return Nn.findDOMNode(Le(a))}),Oe(Le(a),"getPopupClassNameFromAlign",function(l){var d=[],u=a.props,p=u.popupPlacement,h=u.builtinPlacements,g=u.prefixCls,m=u.alignPoint,v=u.getPopupClassNameFromAlign;return p&&h&&d.push(ju(h,g,l,m)),v&&d.push(v(l)),d.join(" ")}),Oe(Le(a),"getComponent",function(){var l=a.props,d=l.prefixCls,u=l.destroyPopupOnHide,p=l.popupClassName,h=l.onPopupAlign,g=l.popupMotion,m=l.popupAnimation,v=l.popupTransitionName,j=l.popupStyle,S=l.mask,_=l.maskAnimation,$=l.maskTransitionName,M=l.maskMotion,x=l.zIndex,P=l.popup,I=l.stretch,R=l.alignPoint,L=l.mobile,D=l.forceRender,H=l.onPopupClick,b=a.state,y=b.popupVisible,k=b.point,T=a.getPopupAlign(),O={};return a.isMouseEnterToShow()&&(O.onMouseEnter=a.onPopupMouseEnter),a.isMouseLeaveToHide()&&(O.onMouseLeave=a.onPopupMouseLeave),O.onMouseDown=a.onPopupMouseDown,O.onTouchStart=a.onPopupMouseDown,f.createElement(_c,qt({prefixCls:d,destroyPopupOnHide:u,visible:y,point:R&&k,className:p,align:T,onAlign:h,animation:m,getClassNameFromAlign:a.getPopupClassNameFromAlign},O,{stretch:I,getRootDomNode:a.getRootDomNode,style:j,mask:S,zIndex:x,transitionName:v,maskAnimation:_,maskTransitionName:$,maskMotion:M,ref:a.popupRef,motion:g,mobile:L,forceRender:D,onClick:H}),typeof P=="function"?P():P)}),Oe(Le(a),"attachParent",function(l){bt.cancel(a.attachId);var d=a.props,u=d.getPopupContainer,p=d.getDocument,h=a.getRootDomNode(),g;u?(h||u.length===0)&&(g=u(h)):g=p(a.getRootDomNode()).body,g?g.appendChild(l):a.attachId=bt(function(){a.attachParent(l)})}),Oe(Le(a),"getContainer",function(){if(!a.portalContainer){var l=a.props.getDocument,d=l(a.getRootDomNode()).createElement("div");d.style.position="absolute",d.style.top="0",d.style.left="0",d.style.width="100%",a.portalContainer=d}return a.attachParent(a.portalContainer),a.portalContainer}),Oe(Le(a),"setPoint",function(l){var d=a.props.alignPoint;!d||!l||a.setState({point:{pageX:l.pageX,pageY:l.pageY}})}),Oe(Le(a),"handlePortalUpdate",function(){a.state.prevPopupVisible!==a.state.popupVisible&&a.props.afterPopupVisibleChange(a.state.popupVisible)}),Oe(Le(a),"triggerContextValue",{onPopupMouseDown:a.onPopupMouseDown});var c;return"popupVisible"in i?c=!!i.popupVisible:c=!!i.defaultPopupVisible,a.state={prevPopupVisible:c,popupVisible:c},xp.forEach(function(l){a["fire".concat(l)]=function(d){a.fireEvents(l,d)}}),a}return hu(s,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var a=this.props,c=this.state;if(c.popupVisible){var l;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(l=a.getDocument(this.getRootDomNode()),this.clickOutsideHandler=St(l,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(l=l||a.getDocument(this.getRootDomNode()),this.touchOutsideHandler=St(l,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(l=l||a.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=St(l,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=St(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),bt.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var a;return((a=this.popupRef.current)===null||a===void 0?void 0:a.getElement())||null}},{key:"getPopupAlign",value:function(){var a=this.props,c=a.popupPlacement,l=a.popupAlign,d=a.builtinPlacements;return c&&d?Su(d,c,l):l}}
vendor: 4,518 bytes, line 18
18,{key:"setPopupVisible",value:function(a,c){var l=this.props.alignPoint,d=this.state.popupVisible;this.clearDelayTimer(),d!==a&&("popupVisible"in this.props||this.setState({popupVisible:a,prevPopupVisible:d}),this.props.onPopupVisibleChange(a)),l&&c&&a&&this.setPoint(c)}},{key:"delaySetPopupVisible",value:function(a,c,l){var d=this,u=c*1e3;if(this.clearDelayTimer(),u){var p=l?{pageX:l.pageX,pageY:l.pageY}:null;this.delayTimer=window.setTimeout(function(){d.setPopupVisible(a,p),d.clearDelayTimer()},u)}else this.setPopupVisible(a,l)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(a){var c=this.props.children.props,l=this.props;return c[a]&&l[a]?this["fire".concat(a)]:c[a]||l[a]}},{key:"isClickToShow",value:function(){var a=this.props,c=a.action,l=a.showAction;return c.indexOf("click")!==-1||l.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var a=this.props.action;return a==="contextMenu"||a.length===1&&a[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var a=this.props,c=a.action,l=a.showAction;return c.indexOf("contextMenu")!==-1||l.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var a=this.props,c=a.action,l=a.hideAction;return c.indexOf("click")!==-1||l.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var a=this.props,c=a.action,l=a.showAction;return c.indexOf("hover")!==-1||l.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var a=this.props,c=a.action,l=a.hideAction;return c.indexOf("hover")!==-1||l.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var a=this.props,c=a.action,l=a.showAction;return c.indexOf("focus")!==-1||l.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var a=this.props,c=a.action,l=a.hideAction;return c.indexOf("focus")!==-1||l.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var a;(a=this.popupRef.current)===null||a===void 0||a.forceAlign()}}},{key:"fireEvents",value:function(a,c){var l=this.props.children.props[a];l&&l(c);var d=this.props[a];d&&d(c)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var a=this.state.popupVisible,c=this.props,l=c.children,d=c.forceRender,u=c.alignPoint,p=c.className,h=c.autoDestroy,g=f.Children.only(l),m={key:"trigger"};this.isContextMenuToShow()?m.onContextMenu=this.onContextMenu:m.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(m.onClick=this.onClick,m.onMouseDown=this.onMouseDown,m.onTouchStart=this.onTouchStart):(m.onClick=this.createTwoChains("onClick"),m.onMouseDown=this.createTwoChains("onMouseDown"),m.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(m.onMouseEnter=this.onMouseEnter,u&&(m.onMouseMove=this.onMouseMove)):m.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?m.onMouseLeave=this.onMouseLeave:m.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(m.onFocus=this.onFocus,m.onBlur=this.onBlur):(m.onFocus=this.createTwoChains("onFocus"),m.onBlur=this.createTwoChains("onBlur"));var v=Ro(g&&g.props&&g.props.className,p);v&&(m.className=v);var j=_t({},m);Pi(g)&&(j.ref=Wr(this.triggerRef,g.ref));var S=f.cloneElement(g,j),_;return(a||this.popupRef.current||d)&&(_=f.createElement(e,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!a&&h&&(_=null),f.createElement(Os.Provider,{value:this.triggerContextValue},S,_)}}],[{key:"getDerivedStateFromProps",value:function(a,c){var l=a.popupVisible,d={};return l!==void 0&&c.popupVisible!==l&&(d.popupVisible=l,d.prevPopupVisible=c.popupVisible),d}}]),s}(f.Component);return Oe(t,"contextType",Os),Oe(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:yp,getDocument:wp,onPopupVisibleChange:Yo,afterPopupVisibleChange:Yo,onPopupAlign:Yo,popupClassName:"",mouseEnterDelay:0,mou
18seLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),t}const Sp=kp(wu);var ft={adjustX:1,adjustY:1},pt=[0,0],jp={left:{points:["cr","cl"],overflow:ft,offset:[-4,0],targetOffset:pt},right:{points:["cl","cr"],overflow:ft,offset:[4,0],targetOffset:pt},top:{points:["bc","tc"],overflow:ft,offset:[0,-4],targetOffset:pt},bottom:{points:["tc","bc"],overflow:ft,offset:[0,4],targetOffset:pt},topLeft:{points:["bl","tl"],overflow:ft,offset:[0,-4],targetOffset:pt},leftTop:{points:["tr","tl"],overflow:ft,offset:[-4,0],targetOffset:pt},topRight:{points:["br","tr"],overflow:ft,offset:[0,-4],targetOffset:pt},rightTop:{points:["tl","tr"],overflow:ft,offset:[4,0],targetOffset:pt},bottomRight:{points:["tr","br"],overflow:ft,offset:[0,4],targetOffset:pt},rightBottom:{points:["bl","br"],overflow:ft,offset:[4,0],targetOffset:pt},bottomLeft:{points:["tl","bl"],overflow:ft,offset:[0,4],targetOffset:pt},leftBottom:{points:["br","bl"],overflow:ft,offset:[-4,0],targetOffset:pt}},uc={exports:{}};/*! 19 Copyright (c) 2018 Jed Watson. 20 Licensed under the MIT License (MIT), see 21 http://jedwatson.github.io/classnames 22*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o=[],s=0;s<arguments.length;s++){var i=arguments[s];if(i){var a=typeof i;if(a==="string"||a==="number")o.push(i);else if(Array.isArray(i)){if(i.length){var c=n.apply(null,i);c&&o.push(c)}}else if(a==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){o.push(i.toString());continue}for(var l in i)t.call(i,l)&&i[l]&&o.push(l)}}}return o.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(uc);var Cp=uc.exports;const Ep=Eo(Cp);function $p(e){var t=e.showArrow,n=e.arrowContent,o=e.children,s=e.prefixCls,i=e.id,a=e.overlayInnerStyle,c=e.className,l=e.style;return f.createElement("div",{className:Ep("".concat(s,"-content"),c),style:l},t!==!1&&f.createElement("div",{className:"".concat(s,"-arrow"),key:"arrow"},n),f.createElement("div",{className:"".concat(s,"-inner"),id:i,role:"tooltip",style:a},typeof o=="function"?o():o))}var Np=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],Tp=function(t,n){var o=t.overlayClassName,s=t.trigger,i=s===void 0?["hover"]:s,a=t.mouseEnterDelay,c=a===void 0?0:a,l=t.mouseLeaveDelay,d=l===void 0?.1:l,u=t.overlayStyle,p=t.prefixCls,h=p===void 0?"rc-tooltip":p,g=t.children,m=t.onVisibleChange,v=t.afterVisibleChange,j=t.transitionName,S=t.animation,_=t.motion,$=t.placement,M=$===void 0?"right":$,x=t.align,P=x===void 0?{}:x,I=t.destroyTooltipOnHide,R=I===void 0?!1:I,L=t.defaultVisible,D=t.getTooltipContainer,H=t.overlayInnerStyle,b=t.arrowContent,y=t.overlay,k=t.id,T=t.showArrow,O=T===void 0?!0:T,q=uu(t,Np),z=f.useRef(null);f.useImperativeHandle(n,function(){return z.current});var V=du({},q);"visible"in t&&(V.popupVisible=t.visible);var W=function(){return f.createElement($p,{showArrow:O,arrowContent:b,key:"content",prefixCls:h,id:k,overlayInnerStyle:H},y)},te=!1,E=!1;if(typeof R=="boolean")te=R;else if(R&&hn(R)==="object"){var B=R.keepParent;te=B===!0,E=B===!1}return f.createElement(Sp,dr({popupClassName:o,prefixCls:h,popup:W,action:i,builtinPlacements:jp,popupPlacement:M,ref:z,popupAlign:P,getPopupContainer:D,onPopupVisibleChange:m,afterPopupVisibleChange:v,popupTransitionName:j,popupAnimation:S,popupMotion:_,defaultPopupVisible:L,destroyPopupOnHide:te,autoDestroy:E,mouseLeaveDelay:d,popupStyle:u,mouseEnterDelay:c},V),g)};const Pp=f.forwardRef(Tp);var Ip=f.forwardRef(function(e,t){var n=e.visible,o=e.overlay,s=f.useRef(null),i=Wr(t,s),a=f.useRef(null);function c(){bt.cancel(a.current)}function l(){a.current=bt(function(){var d;(d=s.current)===null||d===void 0||d.forcePopupAlign()})}return f.useEffect(function(){return n?l():c(),c},[n,o]),f.createElement(Pp,Ft({ref:i},e))});function Rp(e){var t;return t=function(n){Fn(s,n);var o=Hn(s);function s(){var i;return Ln(this,s),i=o.apply(this,arguments),i.state={visibles:{}},i.handleTooltipVisibleChange=function(a,c){i.setState(function(l){return{visibles:We(We({},l.visibles),{},qe({},a,c))}})},i.handleWithTooltip=function(a){var c=a.value,l=a.dragging,d=a.index,u=a.disabled,p=bo(a,["value","dragging","index","disabled"]),h=i.props,g=h.tipFormatter,m=h.tipProps,v=h.handleStyle,j=h.getTooltipContainer,S=m.prefixCls,_=S===void 0?"rc-slider-tooltip":S,$=m.overlay,M=$===void 0?g(c):$,x=m.placement,P=x===void 0?"top":x,I=m.visible,R=I===void 0?!1:I,L=bo(m,["prefixCls","overlay","placement","visible"]),D;return Array.isArray(v)?D=v[d]||v[0]:D=v,Ee.createElement(Ip,Ft({},L,{getTooltipContainer:j,prefixCls:_,overlay:M,placement:P,visible:!u&&(i.state.visibles[d]||l)||R,key:d}),Ee.createElement(Hr,Ft({},p,{style:We({},D),value:c,onMouseEnter:function(){return i.handleTooltipVisibleChange(d,!0)},onMouseLeave:function(){return i.handleTooltipVisibleChange(d,!1)}})))},i}return Dn(s,[{key:"render",value:function(){return Ee.createElement(e,Ft({},this.props,{handle:this.handleWithTooltip}))}}]),s}(Ee.Component),t.defaultProps={tipFormatter:function(o){return o},handleStyle:[{}],tipProps:{},getTooltipContainer:function(o){return o.parentNode}},t}
22var Jr=su;Jr.Range=Si;Jr.Handle=Hr;Jr.createSliderWithTooltip=Rp;const Mp="___react_component_tooltip_1fthn_259",Op="_show_1fthn_279",Ap="_tags__attribute_1fthn_283",Bp="_marker_1fthn_308",Lp="_SingleDatePickerInput__withBorder_1fthn_330",Dp="_DateInput_1fthn_330",Fp="_DateInput_fang_1fthn_330",Hp="_DateRangePickerInput_1fthn_331",qp="_SingleDatePicker_picker_1fthn_335",Vp="_DateInput_fangShape_1fthn_340",zp="_DateInput_fangStroke_1fthn_344",Wp="_DateRangePicker_picker_1fthn_348",Up="_active_1fthn_425",Gp="_scrolled_1fthn_484",Yp="_logo_1fthn_489",Kp="_inversed_1fthn_515",Xp="_editor_1fthn_526",Qp="_spin_1fthn_2085",Jp="_small_1fthn_638",Zp="_count_1fthn_659",eh="_error_1fthn_674",th="_success_1fthn_683",nh="_label_1fthn_767",oh="_actions_1fthn_832",rh="_flag_1fthn_836",ah="_chip_1fthn_900",sh="_remove_1fthn_936",ih="_trip_1fthn_1053",ch="_sleep_1fthn_1056",lh="_todo_1fthn_1059",dh="_cuisine_1fthn_1062",_h="_arrow_1fthn_1069",uh="_checkmark_1fthn_1118",fh="_notice_1fthn_1169",ph="_warning_1fthn_1180",hh="_BrainhubCarousel__container_1fthn_1206",mh="_BrainhubCarouselItem_1fthn_1209",gh="_BrainhubCarousel__customArrows_1fthn_1222",vh="_save_1fthn_1372",bh="_add_1fthn_1375",yh="_distance_1fthn_1408",wh="_placeholder_1fthn_1557",xh="_content_1fthn_1628",kh="_help_1fthn_1712",Sh="_help__button_1fthn_1726",jh="_help__menu_1fthn_1754",Ch="_hidden_1fthn_1798",Eh="_meta_1fthn_1954",$h="_dates_1fthn_1962",Nh="_destination_1fthn_1853",Th="_articles_1fthn_1985",Ph="_acco_1fthn_1991",Ih="_days_1fthn_1994",Rh="_destinations_1fthn_1853",Mh="_spinner_1fthn_2085",Oh="_icon_1fthn_707",Ah="_grid_1fthn_2230",Bh="_tags_1fthn_283",Lh="_green_1fthn_2365",Dh="_orange_1fthn_2368",Fh="_transparent_1fthn_2371",Hh="_title_1fthn_2417",qh="_sidebar_1fthn_2421",Vh="_header_1fthn_2431",zh="_badge_1fthn_2450",Wh="_clearBtn_1fthn_2464",Uh="_section_1fthn_2477",Gh="_showMoreBtn_1fthn_2486",Yh="_sectionTitle_1fthn_2502",Kh="_priceRange_1fthn_2510",Xh="_histogram_1fthn_2516",Qh="_histogramBar_1fthn_2524",Jh="_priceValues_1fthn_2567",Zh="_checkboxGroup_1fthn_2577",em="_checkboxLabel_1fthn_2583",tm="_checkbox_1fthn_2577",nm="_checkboxText_1fthn_2627",om="_listIcon_1fthn_2632",rm="_facetCount_1fthn_2638",am="_fadeInTop_1fthn_1",de={"hotel-booking-flow":"_hotel-booking-flow_1fthn_20","ai-chat-open":"_ai-chat-open_1fthn_24","scroll-lock":"_scroll-lock_1fthn_119","sub-text":"_sub-text_1fthn_172","base-color1":"_base-color1_1fthn_177","base-primary-1":"_base-primary-1_1fthn_178","base-color2":"_base-color2_1fthn_186","base-primary-2":"_base-primary-2_1fthn_187","base-color3":"_base-color3_1fthn_195","base-primary-3":"_base-primary-3_1fthn_196","base-color4":"_base-color4_1fthn_204","base-primary-4":"_base-primary-4_1fthn_205","base-grey":"_base-grey_1fthn_213","base-bg1":"_base-bg1_1fthn_220","col-50":"_col-50_1fthn_224","react-confirm-alert":"_react-confirm-alert_1fthn_233","react-confirm-alert-overlay":"_react-confirm-alert-overlay_1fthn_233","react-confirm-alert-body":"_react-confirm-alert-body_1fthn_237","react-confirm-alert-button-group":"_react-confirm-alert-button-group_1fthn_251",__react_component_tooltip:Mp,"type-error":"_type-error_1fthn_269",show:Op,tags__attribute:Ap,marker:Bp,"open-up":"_open-up_1fthn_330",SingleDatePickerInput__withBorder:Lp,DateInput:Dp,DateInput_fang:Fp,DateRangePickerInput:Hp,SingleDatePicker_picker:qp,DateInput_fangShape:Vp,DateInput_fangStroke:zp,DateRangePicker_picker:Wp,"profile-settings-menu":"_profile-settings-menu_1fthn_355","dropdown-toggle":"_dropdown-toggle_1fthn_363","user-menu":"_user-menu_1fthn_406",active:Up,"link-account":"_link-account_1fthn_453","mobile-bar":"_mobile-bar_1fthn_474",scrolled:Gp,logo:Yp,"menu-icon":"_menu-icon_1fthn_492","page-title":"_page-title_1fthn_498",inversed:Kp,editor:Xp,"editor-toolbar":"_editor-toolbar_1fthn_532","rdw-option-wrapper":"_rdw-option-wrapper_1fthn_543","rdw-option-active":"_rdw-option-active_1fthn_549","rdw-dropdown-wrapper":"_rdw-dropdown-wrapper_1fthn_563","rdw-link-modal":"_rdw-link-modal_1fthn_566","rdw-link-modal-target-option":"_rdw-link-modal-target-option_1fthn_577","rdw-link-modal-buttonsection":"_rdw-link-modal-buttonsection_1fthn_585","editor-textarea":"_editor-textarea_1fthn_592","public-DraftEditorPlaceholder-root":"_public-DraftEditorPlaceholder-root_1fthn_605","rdw-link-decorator-wrapper":"_rdw-link-decorator-wrapper_1fthn_609","submit-row":"_submit-row_1fthn_614",spin:Qp,"total-planned":"_total-planned_1fthn_628","circle-progressbar":"_circle-progressbar_1fthn_634",small:Jp,"CircularProgressbar-background":"_CircularProgressbar-background_1fthn_644","CircularProgressbar-path":"_CircularProgressbar-path_1fthn_650","CircularProgressbar-trail":"_CircularProgressbar-trail_1fthn_653",count:Zp,error:eh,success:th,"error-in-plan":"_error-in-plan_1fthn_689","icon-rounded":"_icon-rounded_1fthn_707","img-placeholder":"_img-placeholder_1fthn_724","custom-tooltip":"_custom-tooltip_1fthn_762",label:nh,"nothing-there":"_nothing-there_1fthn_803",actions:oh,flag:rh,"quick-menu__horizontal":"_quick-menu__horizontal_1fthn_851","icon-circle":"_icon-circle_1fthn_867","delete-research":"_delete-research_1fthn_890",delete:"_delete_1fthn_890",chip:ah,remove:sh,"multi-action-btn":"_multi-action-btn_1fthn_959","hover-btn":"_hover-btn_1fthn_963","bottom-align":"_bottom-align_1fthn_968","right-align":"_right-align_1fthn_1010",trip:ih,sleep:ch,todo:lh,cuisine:dh,arrow:_h,"select-box":"_select-box_1fthn_1078",checkmark:uh,"react-read-more-read-less":"_react-read-more-read-less_1fthn_1153",notice:fh,warning:ph,"notice-callout":"_notice-callout_1fthn_1184",BrainhubCarousel__container:hh,BrainhubCarouselItem:mh,BrainhubCarousel__customArrows:gh,"BrainhubCarousel__custom-arrowLeft":"_BrainhubCarousel__custom-arrowLeft_1fthn_1226","BrainhubCarousel__arrow--disable":"_BrainhubCarousel__arrow--disable_1fthn_1281","carousel-card":"_carousel-card_1fthn_1285","carousel-card__image":"_carousel-card__image_1fthn_1293","carousel-card__badge":"_carousel-card__badge_1fthn_1298","--label":"_--label_1fthn_1314","carousel-card__background":"_carousel-card__background_1fthn_1334","carousel-card__actions":"_carousel-card__actions_1fthn_1347",save:vh,add:bh,"in-research":"_in-research_1fthn_1394","carousel-card__title":"_carousel-card__title_1fthn_1400",distance:yh,"in-plan":"_in-plan_1fthn_1429","in-plan--inspire":"_in-plan--inspire_1fthn_1456","carousel-card__metadata":"_carousel-card__metadata_1fthn_1477","carousel-card--article":"_carousel-card--article_1fthn_1500","carousel-card--tour":"_carousel-card--tour_1fthn_1503","carousel-card--destination":"_carousel-card--destination_1fthn_1506","carousel-card--itinerary":"_carousel-card--itinerary_1fthn_1509",placeholder:wh,"react-router-modal__modal":"_react-router-modal__modal_1fthn_1568","rounded-modal":"_roun
22ded-modal_1fthn_1568","img-wrapper":"_img-wrapper_1fthn_1574","image-placeholder":"_image-placeholder_1fthn_1583","cta-signup":"_cta-signup_1fthn_1613",content:xh,"btn-rounded":"_btn-rounded_1fthn_1670","mobile-banner":"_mobile-banner_1fthn_1675","typeform-sidetab-button":"_typeform-sidetab-button_1fthn_1698","tf-v1-sidetab-button":"_tf-v1-sidetab-button_1fthn_1699","typeform-sidetab-button-text":"_typeform-sidetab-button-text_1fthn_1703","tf-v1-sidetab-button-text":"_tf-v1-sidetab-button-text_1fthn_1704",help:kh,help__button:Sh,help__menu:jh,"create-ticket":"_create-ticket_1fthn_1754","text-link":"_text-link_1fthn_1795",hidden:Ch,"partner-action-btn":"_partner-action-btn_1fthn_1802","destinations-table":"_destinations-table_1fthn_1853","destinations-table__wrapper":"_destinations-table__wrapper_1fthn_1856","destinations-table__wrapper--collapsed":"_destinations-table__wrapper--collapsed_1fthn_1861","destinations-table__fade-overlay":"_destinations-table__fade-overlay_1fthn_1872","destinations-table__expand-section":"_destinations-table__expand-section_1fthn_1882",meta:Eh,dates:$h,destination:Nh,articles:Th,acco:Ph,days:Ih,"day-label":"_day-label_1fthn_2009","day-number":"_day-number_1fthn_2012","day-separator":"_day-separator_1fthn_2017","day-city":"_day-city_1fthn_2020","travel-day":"_travel-day_1fthn_2032",destinations:Rh,"info-tooltip":"_info-tooltip_1fthn_2062","carousel-section":"_carousel-section_1fthn_2076","spinner-wrapper":"_spinner-wrapper_1fthn_2085",spinner:Mh,"carousel-section__title":"_carousel-section__title_1fthn_2113",icon:Oh,"carousel-section__list":"_carousel-section__list_1fthn_2190","--trips":"_--trips_1fthn_2208","--continent-section":"_--continent-section_1fthn_2221","discover-section__list":"_discover-section__list_1fthn_2221","more-card":"_more-card_1fthn_2221",grid:Ah,"col-2":"_col-2_1fthn_2235","col-3":"_col-3_1fthn_2238","col-4":"_col-4_1fthn_2246",tags:Bh,"ReactModal__Body--open":"_ReactModal__Body--open_1fthn_2283","simple-modal":"_simple-modal_1fthn_2291","bottom-modal":"_bottom-modal_1fthn_2296","ReactModal__Overlay--after-open":"_ReactModal__Overlay--after-open_1fthn_2312","ReactModal__Overlay--before-close":"_ReactModal__Overlay--before-close_1fthn_2315","popup-modal":"_popup-modal_1fthn_2318","ReactModal__Content--after-open":"_ReactModal__Content--after-open_1fthn_2330","ReactModal__Content--before-close":"_ReactModal__Content--before-close_1fthn_2333",green:Lh,orange:Dh,transparent:Fh,"transport-options__placeholder":"_transport-options__placeholder_1fthn_2375","text-button":"_text-button_1fthn_2411",title:Hh,sidebar:qh,header:Vh,badge:zh,clearBtn:Wh,section:Uh,showMoreBtn:Gh,sectionTitle:Yh,priceRange:Kh,histogram:Xh,histogramBar:Qh,priceValues:Jh,checkboxGroup:Zh,checkboxLabel:em,checkbox:tm,checkboxText:nm,listIcon:om,facetCount:rm,"beacon-green":"_beacon-green_1fthn_1","beacon-orange":"_beacon-orange_1fthn_1","beacon-purple":"_beacon-purple_1fthn_1","beacon-magenta":"_beacon-magenta_1fthn_1",fadeInTop:am};function ht(e){const t=document.startViewTransition;if(typeof t!="function"){e();return}t.call(document,()=>Nr.flushSync(e))}const sm=[5,4,3,2,1],Ko=19,oo=10,ro=35,im=[/\b(swimming|indoor|outdoor|rooftop|heated|infinity|plunge)\b.*\bpool\b|^pool with view$|^kids' pool$/i,/\bparking\b/i,/^spa\b|\bspa$/i,/\bfitness\b|\bgym\b/i,/\bpets? (allowed|friendly)\b|^pet-friendly$/i,/\bbreakfast\b/i,/\bairport shuttle\b/i,/\belectric vehicle\b|\bev charging\b/i,/\bbeach(front| access)?\b/i,/\bair conditioning\b/i,/\bkitchen\b/i,/\bwash(er|ing machine)\b/i],As=e=>im.some(t=>t.test(e)),cm=(e,t)=>{const n=(i,a)=>(t[a]||0)-(t[i]||0),o=e.filter(As).sort(n),s=e.filter(i=>!As(i)).sort(n);return[...o,...s]};function lm(e,t){var i,a;const n=new Array(Ko).fill(0);if(!e.length)return n;const o=t/Ko;for(const c of e){const l=Number(((i=c.price)==null?void 0:i.price_per_night)??((a=c.price)==null?void 0:a.gross_price));if(!l||isNaN(l))continue;const d=Math.min(Math.floor(l/o),Ko-1);n[d]++}const s=Math.max(...n,1);return n.map(c=>Math.round(c/s*100))}const dm=({searchResults:e=[]})=>{var W,te;const{state:t,dispatch:n}=bn(),{filters:o}=t,{lists:s}=Po(),{data:i,error:a}=At(qc);a&&console.warn("[HotelFilterSidebar] filterOptions query error:",a.message);const c=i==null?void 0:i.hotelFilterOptions,l=new Set(["not available","unknown","other","n/a",""]),d=E=>
22[...new Set(E.filter(B=>B&&!l.has(B.toLowerCase().trim())))],{accommodationTypeOptions:u,accommodationTypeCounts:p}=f.useMemo(()=>{const E={};let B=0;for(const N of e){const K=N.hotelType;K?E[K]=(E[K]||0)+1:B++}let G=Object.keys(E).sort((N,K)=>E[K]-E[N]);return G.length===0&&(G=d(((c==null?void 0:c.accommodationTypes)||[]).map(N=>N.name)).slice(0,5)),B>0&&(E.Other=B,G.push("Other")),{accommodationTypeOptions:G,accommodationTypeCounts:E}},[e,c]),{facilityOptions:h,facilityCounts:g}=f.useMemo(()=>{const E={};for(const B of e)for(const G of B.facilities||[])G&&(E[G]=(E[G]||0)+1);return{facilityOptions:cm(d(Object.keys(E)),E),facilityCounts:E}},[e]),{roomAmenityOptions:m,roomAmenityCounts:v}=f.useMemo(()=>{const E={};for(const B of e)for(const G of B.roomTypes||[])for(const N of G.amenities||[])N&&(E[N]=(E[N]||0)+1);return{roomAmenityOptions:d(Object.keys(E).sort((B,G)=>E[G]-E[B])),roomAmenityCounts:E}},[e]),j=f.useMemo(()=>{if(!e.length)return 500;const E=e.map(B=>{var G,N;return Number(((G=B.price)==null?void 0:G.price_per_night)??((N=B.price)==null?void 0:N.gross_price))}).filter(B=>B>0&&!isNaN(B));return E.length?Math.ceil(Math.max(...E)/50)*50:500},[e]),S=f.useMemo(()=>lm(e,j),[e,j]),_=f.useMemo(()=>{const E={1:0,2:0,3:0,4:0,5:0};for(const B of e){const G=Math.round(Number(B.hotel_class)||0);G>=1&&G<=5&&E[G]++}return E},[e]),$=f.useMemo(()=>{const E={6:0,7:0,8:0,9:0};for(const B of e){const G=Number(B.review_score)||0;G>=9&&E[9]++,G>=8&&E[8]++,G>=7&&E[7]++,G>=6&&E[6]++}return E},[e]),M=t.searchParams.currency||((te=(W=e[0])==null?void 0:W.price)==null?void 0:te.currency)||"EUR",x=Ll(M)||M,[P,I]=f.useState(o.priceMin),[R,L]=f.useState(o.priceMax),[D,H]=f.useState(!1),[b,y]=f.useState(!1);f.useEffect(()=>{e.length&&(isFinite(o.priceMax)?o.priceMax>=j&&(L(j),n({type:"SET_FILTERS",filters:{priceMax:1/0},source:"programmatic"})):L(j))},[j,e.length]),f.useEffect(()=>{o.priceMin===0&&P!==0&&I(0),!isFinite(o.priceMax)&&R!==j&&L(j)},[o.priceMin,o.priceMax]);const k=(o.priceMin>0||isFinite(o.priceMax)&&o.priceMax<j?1:0)+o.savedLists.length+o.accommodationTypes.length+o.facilities.length+o.starRatings.length+(o.freeCancellation?1:0)+(o.breakfastIncluded?1:0)+o.roomAmenities.length+(o.minReviewScore>0?1:0),T=(E,B)=>{const G=o[E],N=G.includes(B)?G.filter(K=>K!==B):[...G,B];ht(()=>n({type:"SET_FILTERS",filters:{[E]:N}}))},O=E=>{const B=o.starRatings,G=B.includes(E)?B.filter(N=>N!==E):[...B,E];ht(()=>n({type:"SET_FILTERS",filters:{starRatings:G}}))},q=E=>{const B=o.roomAmenities,G=B.includes(E)?B.filter(N=>N!==E):[...B,E];ht(()=>n({type:"SET_FILTERS",filters:{roomAmenities:G}}))},z=E=>{const B=o.savedLists,G=B.includes(E)?B.filter(N=>N!==E):[...B,E];ht(()=>n({type:"SET_FILTERS",filters:{savedLists:G}}))},V=f.useRef(null);return f.useEffect(()=>{const E=()=>{var B;return(B=V.current)==null?void 0:B.scrollIntoView({behavior:"smooth",block:"start"})};return window.addEventListener("hotel-open-all-filters",E),()=>window.removeEventListener("hotel-open-all-filters",E)},[]),r.jsxs("aside",{className:de.sidebar,ref:V,children:[r.jsxs("div",{className:de.header,children:[r.jsx("span",{className:de.title,children:"Filters"}),r.jsx("span",{className:de.badge,style:{visibility:k>0?"visible":"hidden"},children:k||0}),r.jsx("button",{className:de.clearBtn,onClick:()=>ht(()=>n({type:"RESET_FILTERS"})),type:"button",style:{visibility:k>0?"visible":"hidden"},children:"Clear"})]}),r.jsxs("section",{className:de.section,children:[r.jsx("h4",{className:de.sectionTitle,children:"Price per night"}),r.jsxs("div",{className:de.priceRange,children:[r.jsx("div",{className:de.histogram,children:S.map((E,B)=>r.jsx("div",{className:de.histogramBar,style:{height:`${Math.max(E,2)}%`}},B))}),r.jsx(Si,{min:0,max:j,step:10,value:[P,R],onChange:E=>{I(E[0]),L(E[1])},onAfterChange:E=>{const B=E[1]>=j?1/0:E[1];ht(()=>n({type:"SET_FILTERS",filters:{priceMin:E[0],priceMax:B}}))},trackStyle:[{backgroundColor:"var(--main1)",height:2}],railStyle:{backgroundColor:"#dde9ed",height:2},handleStyle:[{backgroundColor:"var(--main1)",borderColor:"var(--main1)",width:10,height:10,marginTop:-4,opacity:1,boxShadow:"none"},{backgroundColor:"var(--main1)",borderColor:"var(--main1)",width:10,height:10,marginTop:-4,opacity:1,boxShadow:"none"}]}),r.jsxs("div",{className:de.priceValues,children:[r.jsxs("span",{children:[x,P]}),r.jsxs("span",{children:[x,R>=j?`${j}+`:R]})]})]})]}),(()=>{const E=new Set(e.flatMap(G=>
22[G.hotel_id,G.key].filter(Boolean).map(String))),B=(s||[]).filter(G=>{var N;return(N=G.items)==null?void 0:N.some(K=>[K._id,K.externalId,K.googlePlaceId].filter(Boolean).map(String).some(se=>E.has(se)))});return B.length>0?r.jsxs("section",{className:de.section,children:[r.jsx("h4",{className:de.sectionTitle,children:"Saved in list"}),r.jsx("div",{className:de.checkboxGroup,children:B.slice(0,8).map(G=>r.jsxs("label",{className:de.checkboxLabel,children:[r.jsx("input",{type:"checkbox",className:de.checkbox,checked:o.savedLists.includes(G._id),onChange:()=>z(G._id)}),G.icon&&r.jsx("span",{className:de.listIcon,children:G.icon}),r.jsx("span",{className:de.checkboxText,children:G.name})]},G._id))})]}):null})(),r.jsxs("section",{className:de.section,children:[r.jsx("h4",{className:de.sectionTitle,children:"Accommodation type"}),r.jsx("div",{className:de.checkboxGroup,children:u.map(E=>{const B=p[E]||0;return r.jsxs("label",{className:de.checkboxLabel,children:[r.jsx("input",{type:"checkbox",className:de.checkbox,checked:o.accommodationTypes.includes(E),onChange:()=>T("accommodationTypes",E)}),r.jsx("span",{className:de.checkboxText,children:E}),B>0&&r.jsx("span",{className:de.facetCount,children:B})]},E)})})]}),h.length>0&&r.jsxs("section",{className:de.section,children:[r.jsx("h4",{className:de.sectionTitle,children:"Facilities"}),r.jsx("div",{className:de.checkboxGroup,children:(D?h.slice(0,ro):h.slice(0,oo)).map(E=>{const B=g[E]||0;return r.jsxs("label",{className:de.checkboxLabel,children:[r.jsx("input",{type:"checkbox",className:de.checkbox,checked:o.facilities.includes(E),onChange:()=>T("facilities",E)}),r.jsx("span",{className:de.checkboxText,children:E}),B>0&&r.jsx("span",{className:de.facetCount,children:B})]},E)})}),h.length>oo&&r.jsx("button",{type:"button",className:de.showMoreBtn,onClick:()=>ht(()=>H(E=>!E)),children:D?"Show less":`Show all (${Math.min(h.length,ro)})`})]}),r.jsxs("section",{className:de.section,children:[r.jsx("h4",{className:de.sectionTitle,children:"Star rating"}),r.jsx("div",{className:de.checkboxGroup,children:sm.map(E=>{const B=_[E]||0;return r.jsxs("label",{className:de.checkboxLabel,children:[r.jsx("input",{type:"checkbox",className:de.checkbox,checked:o.starRatings.includes(E),onChange:()=>O(E)}),Array.from({length:5}).map((G,N)=>r.jsx(Z,{size:12,name:"star",fill:N<E?"#F5A623":"#37373733"})),B>0&&r.jsx("span",{className:de.facetCount,children:B})]},E)})})]}),m.length>0&&r.jsxs("section",{className:de.section,children:[r.jsx("h4",{className:de.sectionTitle,children:"Room amenities"}),r.jsx("div",{className:de.checkboxGroup,children:(b?m.slice(0,ro):m.slice(0,oo)).map(E=>{const B=v[E]||0;return r.jsxs("label",{className:de.checkboxLabel,children:[r.jsx("input",{type:"checkbox",className:de.checkbox,checked:o.roomAmenities.includes(E),onChange:()=>q(E)}),r.jsx("span",{className:de.checkboxText,children:E}),B>0&&r.jsx("span",{className:de.facetCount,children:B})]},E)})}),m.length>oo&&r.jsx("button",{type:"button",className:de.showMoreBtn,onClick:()=>ht(()=>y(E=>!E)),children:b?"Show less":`Show all (${Math.min(m.length,ro)})`})]}),r.jsxs("section",{className:de.section,children:[r.jsx("h4",{className:de.sectionTitle,children:"Guest review"}),r.jsx("div",{className:de.checkboxGroup,children:[9,8,7,6].map(E=>{const B=$[E]||0;return r.jsxs("label",{className:de.checkboxLabel,children:[r.jsx("input",{type:"checkbox",className:de.checkbox,checked:o.minReviewScore===E,onChange:()=>ht(()=>n({type:"SET_FILTERS",filters:{minReviewScore:o.minReviewScore===E?0:E}}))}),r.jsxs("span",{className:de.checkboxText,children:[E,"+ ",E===9?"Wonderful":E===8?"Very good":E===7?"Good":"Pleasant"]}),B>0&&r.jsx("span",{className:de.facetCount,children:B})]},E)})})]}),r.jsxs("section",{className:de.section,children:[r.jsx("h4",{className:de.sectionTitle,children:"Policy"}),r.jsxs("div",{className:de.checkboxGroup,children:[r.jsxs("label",{className:de.checkboxLabel,children:[r.jsx("input",{type:"checkbox",className:de.checkbox,checked:o.freeCancellation,onChange:()=>ht(()=>n({type:"SET_FILTERS",filters:{freeCancellation:!o.freeCancellation}}))}
22),r.jsx("span",{className:de.checkboxText,children:"Free cancellation"})]}),r.jsxs("label",{className:de.checkboxLabel,children:[r.jsx("input",{type:"checkbox",className:de.checkbox,checked:o.breakfastIncluded,onChange:()=>ht(()=>n({type:"SET_FILTERS",filters:{breakfastIncluded:!o.breakfastIncluded}}))}),r.jsx("span",{className:de.checkboxText,children:"Breakfast included"})]})]})]})]})};/*! ***************************************************************************** 23Copyright (c) Microsoft Corporation. All rights reserved. 24Licensed under the Apache License, Version 2.0 (the "License"); you may not use 25this file except in compliance with the License. You may obtain a copy of the 26License at http://www.apache.org/licenses/LICENSE-2.0 27 28THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 29KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 30WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 31MERCHANTABLITY OR NON-INFRINGEMENT. 32 33See the Apache Version 2.0 License for specific language governing permissions 34and limitations under the License. 35***************************************************************************** */var Er=function(e,t){return Er=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])},Er(e,t)};function _m(e,t){Er(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var $n=function(){return $n=Object.assign||function(t){for(var n,o=1,s=arguments.length;o<s;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},$n.apply(this,arguments)};function um(e,t,n,o){var s,i=!1,a=0;function c(){s&&clearTimeout(s)}function l(){c(),i=!0}typeof t!="boolean"&&(o=n,n=t,t=void 0);function d(){var u=this,p=Date.now()-a,h=arguments;if(i)return;function g(){a=Date.now(),n.apply(u,h)}function m(){s=void 0}o&&!s&&g(),c(),o===void 0&&p>e?g():t!==!0&&(s=setTimeout(o?m:g,o===void 0?e-p:e))}return d.cancel=l,d}var dn={Pixel:"Pixel",Percent:"Percent"},Bs={unit:dn.Percent,value:.8};function Ls(e){return typeof e=="number"?{unit:dn.Percent,value:e*100}:typeof e=="string"?e.match(/^(\d*(\.\d+)?)px$/)?{unit:dn.Pixel,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:dn.Percent,value:parseFloat(e)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),Bs):(console.warn("scrollThreshold should be string or number"),Bs)}var fc=function(e){_m(t,e);function t(n){var o=e.call(this,n)||this;return o.lastScrollTop=0,o.actionTriggered=!1,o.startY=0,o.currentY=0,o.dragging=!1,o.maxPullDownDistance=0,o.getScrollableTarget=function(){return o.props.scrollableTarget instanceof HTMLElement?o.props.scrollableTarget:typeof o.props.scrollableTarget=="string"?document.getElementById(o.props.scrollableTarget):(o.props.scrollableTarget===null&&console.warn(`You are trying to pass scrollableTarget but it is null. This might 36 happen because the element may not have been added to DOM yet. 37 See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info. 38 `),null)},o.onStart=function(s){o.lastScrollTop||(o.dragging=!0,s instanceof MouseEvent?o.startY=s.pageY:s instanceof TouchEvent&&(o.startY=s.touches[0].pageY),o.currentY=o.startY,o._infScroll&&(o._infScroll.style.willChange="transform",o._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},o.onMove=function(s){o.dragging&&(s instanceof MouseEvent?o.currentY=s.pageY:s instanceof TouchEvent&&(o.currentY=s.touches[0].pageY),!(o.currentY<o.startY)&&(o.currentY-o.startY>=Number(o.props.pullDownToRefreshThreshold)&&o.setState({pullToRefreshThresholdBreached:!0}),!(o.currentY-o.startY>o.maxPullDownDistance*1.5)&&o._infScroll&&(o._infScroll.style.overflow="visible",o._infScroll.style.transform="translate3d(0px, "+(o.currentY-o.startY)+"px, 0px)")))},o.onEnd=function(){o.startY=0,o.currentY=0,o.dragging=!1,o.state.pullToRefreshThresholdBreached&&(o.props.refreshFunction&&o.props.refreshFunction(),o.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){o._infScroll&&(o._infScroll.
38style.overflow="auto",o._infScroll.style.transform="none",o._infScroll.style.willChange="unset")})},o.onScrollListener=function(s){typeof o.props.onScroll=="function"&&setTimeout(function(){return o.props.onScroll&&o.props.onScroll(s)},0);var i=o.props.height||o._scrollableNode?s.target:document.documentElement.scrollTop?document.documentElement:document.body;if(!o.actionTriggered){var a=o.props.inverse?o.isElementAtTop(i,o.props.scrollThreshold):o.isElementAtBottom(i,o.props.scrollThreshold);a&&o.props.hasMore&&(o.actionTriggered=!0,o.setState({showLoader:!0}),o.props.next&&o.props.next()),o.lastScrollTop=i.scrollTop}},o.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:n.dataLength},o.throttledOnScrollListener=um(150,o.onScrollListener).bind(o),o.onStart=o.onStart.bind(o),o.onMove=o.onMove.bind(o),o.onEnd=o.onEnd.bind(o),o}return t.prototype.componentDidMount=function(){if(typeof this.props.dataLength>"u")throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),typeof this.props.initialScrollY=="number"&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),typeof this.props.refreshFunction!="function"))throw new Error(`Mandatory prop "refreshFunction" missing. 39 Pull Down To Refresh functionality will not work 40 as expected. Check README.md for usage'`)},t.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},t.prototype.componentDidUpdate=function(n){this.props.dataLength!==n.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(n,o){var s=n.dataLength!==o.prevDataLength;return s?$n($n({},o),{prevDataLength:n.dataLength}):null},t.prototype.isElementAtTop=function(n,o){o===void 0&&(o=.8);var s=n===document.body||n===document.documentElement?window.screen.availHeight:n.clientHeight,i=Ls(o);return i.unit===dn.Pixel?n.scrollTop<=i.value+s-n.scrollHeight+1:n.scrollTop<=i.value/100+s-n.scrollHeight+1},t.prototype.isElementAtBottom=function(n,o){o===void 0&&(o=.8);var s=n===document.body||n===document.documentElement?window.screen.availHeight:n.clientHeight,i=Ls(o);return i.unit===dn.Pixel?n.scrollTop+s>=n.scrollHeight-i.value:n.scrollTop+s>=i.value/100*n.scrollHeight},t.prototype.render=function(){var n=this,o=$n({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),s=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),i=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return Ee.createElement("div",{style:i,className:"infinite-scroll-component__outerdiv"},Ee.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(a){return n._infScroll=a},style:o},this.props.pullDownToRefresh&&Ee.createElement("div",{style:{position:"relative"},ref:function(a){return n._pullDown=a}},Ee.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!s&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(f.Component);const fm=.5,pm=500;function hm(e){const{hotelId:t,position:n,sortContext:o,priceShownCents:s,currency:i,location:a}=e,c=f.useRef(null),l=f.useRef(!1),d=f.useRef(null);return f.useEffect(()=>{if(!t)return;const u=c.current;if(!u||typeof IntersectionObserver>"u")return;const p={hotel_id:t,provider:"nuitee",...n!==void 0&&{position:n},...o!==void 0&&{sort_context:o},...s!==void 0&&{price_shown_cents:s},...i!==void 0&&{currency:i}},h=()=>
40{if(!l.current&&!(typeof document<"u"&&document.visibilityState!=="visible")){l.current=!0;try{Ke("hotel_card_impression",p,a)}catch{}}},g=new IntersectionObserver(m=>{const v=m[0];v&&(v.isIntersecting?!l.current&&d.current===null&&(d.current=setTimeout(()=>{d.current=null,h()},pm)):d.current!==null&&(clearTimeout(d.current),d.current=null))},{threshold:fm});return g.observe(u),()=>{g.disconnect(),d.current!==null&&(clearTimeout(d.current),d.current=null)}},[t]),c}const mm="___react_component_tooltip_qcddc_259",gm="_show_qcddc_279",vm="_tags__attribute_qcddc_283",bm="_marker_qcddc_308",ym="_SingleDatePickerInput__withBorder_qcddc_330",wm="_DateInput_qcddc_330",xm="_DateInput_fang_qcddc_330",km="_DateRangePickerInput_qcddc_331",Sm="_SingleDatePicker_picker_qcddc_335",jm="_DateInput_fangShape_qcddc_340",Cm="_DateInput_fangStroke_qcddc_344",Em="_DateRangePicker_picker_qcddc_348",$m="_active_qcddc_425",Nm="_scrolled_qcddc_484",Tm="_logo_qcddc_489",Pm="_inversed_qcddc_515",Im="_editor_qcddc_526",Rm="_spin_qcddc_2085",Mm="_small_qcddc_638",Om="_count_qcddc_659",Am="_error_qcddc_674",Bm="_success_qcddc_683",Lm="_label_qcddc_767",Dm="_actions_qcddc_832",Fm="_flag_qcddc_836",Hm="_chip_qcddc_900",qm="_remove_qcddc_936",Vm="_trip_qcddc_1053",zm="_sleep_qcddc_1056",Wm="_todo_qcddc_1059",Um="_cuisine_qcddc_1062",Gm="_arrow_qcddc_1069",Ym="_checkmark_qcddc_1118",Km="_notice_qcddc_1169",Xm="_warning_qcddc_1180",Qm="_BrainhubCarousel__container_qcddc_1206",Jm="_BrainhubCarouselItem_qcddc_1209",Zm="_BrainhubCarousel__customArrows_qcddc_1222",eg="_save_qcddc_1372",tg="_add_qcddc_1375",ng="_distance_qcddc_1408",og="_placeholder_qcddc_1557",rg="_content_qcddc_1628",ag="_help_qcddc_1712",sg="_help__button_qcddc_1726",ig="_help__menu_qcddc_1754",cg="_hidden_qcddc_1798",lg="_meta_qcddc_1954",dg="_dates_qcddc_1962",_g="_destination_qcddc_1853",ug="_articles_qcddc_1985",fg="_acco_qcddc_1991",pg="_days_qcddc_1994",hg="_destinations_qcddc_1853",mg="_spinner_qcddc_2085",gg="_icon_qcddc_707",vg="_grid_qcddc_2230",bg="_tags_qcddc_283",yg="_green_qcddc_2365",wg="_orange_qcddc_2368",xg="_transparent_qcddc_2371",kg="_title_qcddc_2417",Sg="_card_qcddc_2421",jg="_photo_qcddc_2436",Cg="_bookmarkBtn_qcddc_2454",Eg="_bookmarked_qcddc_2473",$g="_destinationBadge_qcddc_2478",Ng="_savedBadge_qcddc_2506",Tg="_titleRow_qcddc_2520",Pg="_name_qcddc_2526",Ig="_starWrap_qcddc_2540",Rg="_addBtn_qcddc_2547",Mg="_menuWrapper_qcddc_2571",Og="_menuBtn_qcddc_2576",Ag="_menu_qcddc_492",Bg="_menuItem_qcddc_2609",Lg="_menuItemDanger_qcddc_2626",Dg="_address_qcddc_2636",Fg="_infoRow_qcddc_2655",Hg="_roomInfo_qcddc_2663",qg="_roomInfoItem_qcddc_2669",Vg="_refundable_qcddc_2692",zg="_bottomRow_qcddc_2698",Wg="_reviewBadge_qcddc_2707",Ug="_reviewScore_qcddc_2714",Gg="_reviewLabel_qcddc_2729",Yg="_reviewCount_qcddc_2736",Kg="_priceStack_qcddc_2741",Xg="_priceLabel_qcddc_2750",Qg="_price_qcddc_2741",Jg="_proBadge_qcddc_2765",Zg="_proPriceRow_qcddc_2783",ev="_priceStrike_qcddc_2792",tv="_proPrice_qcddc_2783",nv="_proSavingBadge_qcddc_2806",ov="_upgradeBanner_qcddc_2818",rv="_upgradeBannerText_qcddc_2832",av="_upgradeBannerCta_qcddc_2840",sv="_ctaStack_qcddc_2858",iv="_selectBtn_qcddc_2865",cv="_compareBtn_qcddc_2889",lv="_compareLogo_qcddc_2906",dv="_compareBrand_qcddc_2913",_v="_compareFrom_qcddc_2920",uv="_compareValue_qcddc_2926",fv="_fadeInTop_qcddc_1",ke={"hotel-booking-flow":"_hotel-booking-flow_qcddc_20","ai-chat-open":"_ai-chat-open_qcddc_24","scroll-lock":"_scroll-lock_qcddc_119","sub-text":"_sub-text_qcddc_172","base-color1":"_base-color1_qcddc_177","base-primary-1":"_base-primary-1_qcddc_178","base-color2":"_base-color2_qcddc_186","base-primary-2":"_base-primary-2_qcddc_187","base-color3":"_base-color3_qcddc_195","base-primary-3":"_base-primary-3_qcddc_196","base-color4":"_base-color4_qcddc_204","base-primary-4":"_base-primary-4_qcddc_205","base-grey":"_base-grey_qcddc_213","base-bg1":"_base-bg1_qcddc_220","col-50":"_col-50_qcddc_224","react-confirm-alert":"_react-confirm-alert_qcddc_233","react-confirm-alert-overlay":"_react-confirm-alert-overlay_qcddc_233","react-confirm-alert-body":"_react-confirm-alert-body_qcddc_237","react-confirm-alert-button-group":"_react-confirm-alert-button-group_qcddc_251",__react_component_tooltip:mm,"type-error":"_type-error_qcddc_269",show:gm,tags__attribute:vm,marker:bm,"open-up":"_open-up_qcddc_330",SingleDatePickerInput__withBorder:ym,DateInput:wm,DateInput_fang:xm,DateRangePickerInput:km,SingleDatePicker_picker:Sm,DateInput_fangShape:jm,DateInput_fangStroke:Cm,DateRangePicker_picker:Em,"profile-settings-menu":"_profile-settings-menu_qcddc_355","dropdown-toggle":"_dropdown-toggle_qcddc_363","user-menu":"_user-menu_qcddc_406",active:$m,"link-account":"_link-account_qcddc_453","mobile-bar":"_mobile-bar_qcddc_474",scrolled:Nm,logo:Tm,"menu-icon":"_menu-icon_qcddc_492","page-title":"_page-title_qcddc_498",inversed:Pm,editor:Im,"editor-toolbar":"_editor-toolbar_qcddc_532","rdw-option-wrapper":"_rdw-option-wrapper_qcddc_543","rdw-option-active":"_rdw-option-active_qcddc_549","rdw-dropdown-wrapper":"_rdw-dropdown-wrapper_qcddc_563","rdw-link-modal":"_rdw-link-modal_qcddc_566","rdw-link-modal-target-option":"_rdw-link-modal-target-option_qcddc_577","rdw-link-modal-buttonsection":"_rdw-link-modal-buttonsection_qcddc_585","editor-textarea":"_editor-textarea_qcddc_592","public-DraftEditorPlaceholder-root":"_public-DraftEditorPlaceholder-root_qcddc_605","rdw-link-decorator-wrapper":"_rdw-link-decorator-wrapper_qcddc_609","submit-row":"_submit-row_qcddc_614",spin:Rm,"total-planned":"_total-planned_qcddc_628","circle-progressbar":"_circle-progressbar_qcddc_634",small:Mm,"CircularProgressbar-background":"_CircularProgressbar-background_qcddc_644","CircularProgressbar-path":"_CircularProgressbar-path_qcddc_650","CircularProgressbar-trail":"_CircularProgressbar-trail_qcddc_653",count:Om,error:Am,success:Bm,"error-in-plan":"_error-in-plan_qcddc_689","icon-rounded":"_icon-rounded_qcddc_707","img-placeholder":"_img-placeholder_qcddc_724","custom-tooltip":"_custom-tooltip_qcddc_762",label:Lm,"nothing-there":"_nothing-there_qcddc_803",actions:Dm,flag:Fm,"quick-menu__horizontal":"_quick-menu__horizontal_qcddc_851","icon-circle":"_icon-circle_qcddc_867","delete-research":"_delete-research_qcddc_890",delete:"_delete_qcddc_890",chip:Hm,remove:qm,"multi-action-btn":"_multi-action-btn_qcddc_959","hover-btn":"_hover-btn_qcddc_963","bottom-align":"_bottom-align_qcddc_968","right-align":"_right-align_qcddc_1010",trip:Vm,sleep:zm,todo:Wm,cuisine:Um,arrow:Gm,"select-box":"_select-box_qcddc_1078",checkmark:Ym,"react-read-more-read-less":"_react-read-more-read-less_qcddc_1153",notice:Km,warning:Xm,"notice-callout":"_notice-callout_qcddc_1184",BrainhubCarousel__container:Qm,BrainhubCarouselItem:Jm,BrainhubCarousel__customArrows:Zm,"BrainhubCarousel__custom-arrowLeft":"_BrainhubCarousel__custom-arrowLeft_qcddc_1226","BrainhubCarousel__arrow--disable":"_BrainhubCarousel__arrow--disable_qcddc_1281","carousel-card":"_carousel-card_qcddc_1285","carousel-card__image":"_carousel-card__image_qcddc_1293","carousel-card__badge":"_carousel-card__badge_qcddc_1298","--label":"_--label_qcddc_1314","carousel-card__background":"_carousel-card__background_qcddc_1334","carousel-card__actions":"_carousel-card__actions_qcddc_1347",save:eg,add:tg,"in-research":"_in-research_qcddc_1394","carousel-card__title":"_carousel-card__title_qcddc_1400",distance:ng,"in-plan":"_in-plan_qcddc_1429","in-plan--inspire":"_in-plan--inspire_qcddc_1456","carousel-card__metadata":"_carousel-card__metadata_qcddc_1477","carousel-card--article":"_carousel-card--article_qcddc_1500","carousel-card--tour":"_carousel-card--tour_qcddc_1503","carousel-card--destination":"_carousel-card--destination_qcddc_1506","carousel-card--itinerary":"_carousel-card--itinerary_qcddc_1509",placeholder:og,"react-router-modal__modal":"_react-router-modal__modal_qcddc_1568","rounded-modal":"_roun
40ded-modal_qcddc_1568","img-wrapper":"_img-wrapper_qcddc_1574","image-placeholder":"_image-placeholder_qcddc_1583","cta-signup":"_cta-signup_qcddc_1613",content:rg,"btn-rounded":"_btn-rounded_qcddc_1670","mobile-banner":"_mobile-banner_qcddc_1675","typeform-sidetab-button":"_typeform-sidetab-button_qcddc_1698","tf-v1-sidetab-button":"_tf-v1-sidetab-button_qcddc_1699","typeform-sidetab-button-text":"_typeform-sidetab-button-text_qcddc_1703","tf-v1-sidetab-button-text":"_tf-v1-sidetab-button-text_qcddc_1704",help:ag,help__button:sg,help__menu:ig,"create-ticket":"_create-ticket_qcddc_1754","text-link":"_text-link_qcddc_1795",hidden:cg,"partner-action-btn":"_partner-action-btn_qcddc_1802","destinations-table":"_destinations-table_qcddc_1853","destinations-table__wrapper":"_destinations-table__wrapper_qcddc_1856","destinations-table__wrapper--collapsed":"_destinations-table__wrapper--collapsed_qcddc_1861","destinations-table__fade-overlay":"_destinations-table__fade-overlay_qcddc_1872","destinations-table__expand-section":"_destinations-table__expand-section_qcddc_1882",meta:lg,dates:dg,destination:_g,articles:ug,acco:fg,days:pg,"day-label":"_day-label_qcddc_2009","day-number":"_day-number_qcddc_2012","day-separator":"_day-separator_q
40cddc_2017","day-city":"_day-city_qcddc_2020","travel-day":"_travel-day_qcddc_2032",destinations:hg,"info-tooltip":"_info-tooltip_qcddc_2062","carousel-section":"_carousel-section_qcddc_2076","spinner-wrapper":"_spinner-wrapper_qcddc_2085",spinner:mg,"carousel-section__title":"_carousel-section__title_qcddc_2113",icon:gg,"carousel-section__list":"_carousel-section__list_qcddc_2190","--trips":"_--trips_qcddc_2208","--continent-section":"_--continent-section_qcddc_2221","discover-section__list":"_discover-section__list_qcddc_2221","more-card":"_more-card_qcddc_2221",grid:vg,"col-2":"_col-2_qcddc_2235","col-3":"_col-3_qcddc_2238","col-4":"_col-4_qcddc_2246",tags:bg,"ReactModal__Body--open":"_ReactModal__Body--open_qcddc_2283","simple-modal":"_simple-modal_qcddc_2291","bottom-modal":"_bottom-modal_qcddc_2296","ReactModal__Overlay--after-open":"_ReactModal__Overlay--after-open_qcddc_2312","ReactModal__Overlay--before-close":"_ReactModal__Overlay--before-close_qcddc_2315","popup-modal":"_popup-modal_qcddc_2318","ReactModal__Content--after-open":"_ReactModal__Content--after-open_qcddc_2330","ReactModal__Content--before-close":"_ReactModal__Content--before-close_qcddc_2333",green:yg,orange:wg,transparent:xg,"transport-options__placeholder":"_transport-options__placeholder_qcddc_2375","text-button":"_text-button_qcddc_2411",title:kg,card:Sg,photo:jg,bookmarkBtn:Cg,bookmarked:Eg,destinationBadge:$g,savedBadge:Ng,titleRow:Tg,name:Pg,starWrap:Ig,addBtn:Rg,menuWrapper:Mg,menuBtn:Og,menu:Ag,menuItem:Bg,menuItemDanger:Lg,address:Dg,infoRow:Fg,roomInfo:Hg,roomInfoItem:qg,refundable:Vg,bottomRow:zg,reviewBadge:Wg,reviewScore:Ug,reviewLabel:Gg,reviewCount:Yg,priceStack:Kg,priceLabel:Xg,price:Qg,proBadge:Jg,proPriceRow:Zg,priceStrike:ev,proPrice:tv,proSavingBadge:nv,upgradeBanner:ov,upgradeBannerText:rv,upgradeBannerCta:av,ctaStack:sv,selectBtn:iv,compareBtn:cv,compareLogo:lv,compareBrand:dv,compareFrom:_v,compareValue:uv,"beacon-green":"_beacon-green_qcddc_1","beacon-orange":"_beacon-orange_qcddc_1","beacon-purple":"_beacon-purple_qcddc_1","beacon-magenta":"_beacon-magenta_qcddc_1",fadeInTop:fv},pv=e=>e>=9?"Wonderful":e>=8?"Very Good":e>=7?"Good":e>=6?"Pleasant":"Okay",Ds=({hotel:e,isInTrip:t,isGuestDestination:n,nights:o,guests:s,position:i,sortBy:a,onSelectRooms:c,onAdd:l,onRemove:d,onChangeAssignment:u,onBookmark:p,isBookmarked:h,destinationName:g,isB2B:m,checkIn:v,checkOut:j,tripCurrency:S,convertPrice:_,plannedAccommodationPlaces:$,currentTrip:M,destinationId:x})=>{var ce,Pe,xe,Ve,Ye;const[P,I]=f.useState(!1),R=f.useRef(null),{user:L}=lt(),{isBusinessMode:D}=Co(),{t:H}=Et("dashboard"),b=f.useMemo(()=>($||[]).find(_e=>{var A;const ve=((A=_e==null?void 0:_e.metadata)==null?void 0:A.id)||(_e==null?void 0:_e.hotel_id)||(_e==null?void 0:_e._id);return ve===e.hotel_id||ve===e.key}),[$,e.hotel_id,e.key]),y=f.useMemo(()=>To(b,M),[b,M]),k=(y==null?void 0:y.bookingStatus)==="confirmed"&&(y==null?void 0:y.bookingProvider)==="nuitee",T=Array.isArray(M==null?void 0:M.days)&&!!b,O=Array.isArray(y==null?void 0:y.dayIdsWithThisAccommodation)&&y.dayIdsWithThisAccommodation.length>0,q=t&&T&&!O,z=e.photo,V=((ce=e.price)==null?void 0:ce.currency)??S??"EUR",W=S||V,te=_e=>_e==null?null:(_==null?void 0:_(_e,V,W))??_e,E=te(Ks(e)),B=te(((Pe=e.price)==null?void 0:Pe.ssp)??null),G=B!=null&&E!=null&&B>E,N=((xe=e.price)==null?void 0:xe.showPro)===!0,K=!!(L!=null&&L.hasSubscription),ee=te(((Ve=e.price)==null?void 0:Ve.pro)??null),se=E!=null&&ee!=null?Math.round(E)-Math.round(ee):null,je=e.latitude!=null&&e.longitude!=null,be=G&&je?Ol({hotelId:e.hotel_id,name:e.name,city:e.city_name_en??"",latitude:e.latitude,longitude:e.longitude,checkIn:v,checkOut:j}):"",ge=Number(e.review_score)||0,re=Number(e.review_nr)||0,U=(Ye=e.roomTypes)==null?void 0:Ye[0],we=e.distance_to_cc!=null?`${(Number(e.distance_to_cc)/1e3).toFixed(1)}km from centre`:null,Se=hm({hotelId:e.hotel_id,position:i,sortContext:a,priceShownCents:E??void 0,currency:W,location:"hotel_search"}),$e=_e=>{var ve;(ve=R.current)!=null&&ve.contains(_e.relatedTarget)||I(!1)},Ae=String(e.hotel_id??e.key??"").replace(/[^a-zA-Z0-9_-]/g,"_"),Fe
40=Ae?`hotel-card-${Ae}`:void 0;return r.jsxs("div",{ref:Se,className:ke.card,style:Fe?{viewTransitionName:Fe}:void 0,onClick:c,role:n?void 0:"button",tabIndex:n?void 0:0,onKeyDown:n?void 0:_e=>_e.key==="Enter"&&c(),onMouseEnter:()=>window.dispatchEvent(new CustomEvent("hotel-card-hover",{detail:{hotelId:e.hotel_id}})),onMouseLeave:()=>window.dispatchEvent(new CustomEvent("hotel-card-hover",{detail:{hotelId:null}})),children:[r.jsxs("div",{className:ke.photo,children:[r.jsx(gn,{src:z,type:"accommodation",color:"green"}),p&&!n&&r.jsx("button",{className:`${ke.bookmarkBtn} ${h?ke.bookmarked:""}`,onClick:_e=>{_e.stopPropagation(),p()},type:"button","aria-label":"Bookmark hotel",children:r.jsx(Z,{name:h?"bookmark":"bookmark-outline",size:16})}),t&&g&&(q?r.jsx("span",{className:`${ke.destinationBadge} ${ke.savedBadge}`,children:r.jsx("span",{children:H("hotelSearch.notScheduled")})}):r.jsxs("span",{className:ke.destinationBadge,children:[r.jsx(Z,{name:"check",size:12,fill:"currentColor"}),r.jsxs("span",{children:[g," ",o>0?` · ${o}n`:""]})]}))]}),r.jsxs("div",{className:ke.content,children:[r.jsxs("div",{className:ke.titleRow,children:[r.jsxs("div",{className:"w-full",children:[r.jsx("h3",{className:ke.name,children:e.name}),!!e.hotel_class&&r.jsx("div",{className:ke.starWrap,children:Array.from({length:5}).map((_e,ve)=>r.jsx(Z,{size:9,name:"star",fill:ve<e.hotel_class?"#F5A623":"#37373733"}))})]}),n?null:t?k?null:r.jsxs("div",{className:ke.menuWrapper,ref:R,onBlur:$e,tabIndex:-1,children:[r.jsx("button",{className:ke.menuBtn,onClick:_e=>{_e.stopPropagation(),I(ve=>!ve)},type:"button","aria-label":"Hotel options",children:r.jsx(Z,{name:"verticalmore"})}),P&&r.jsxs("div",{className:ke.menu,children:[r.jsxs("button",{className:ke.menuItem,onClick:_e=>{_e.stopPropagation(),I(!1),u==null||u()},type:"button",children:[r.jsx(Z,{name:"doubleArrow",size:14}),"Change assignment"]}),r.jsxs("button",{className:`${ke.menuItem} ${ke.menuItemDanger}`,onClick:_e=>{_e.stopPropagation(),I(!1),d==null||d()},type:"button",children:[r.jsx(Z,{name:"trash",size:14}),"Remove from trip"]})]})]}):r.jsx("button",{className:ke.addBtn,onClick:_e=>{_e.stopPropagation(),l()},type:"button","aria-label":"Add to trip",children:r.jsx(Z,{name:"plus",size:12})})]}),r.jsxs("p",{className:ke.address,children:[e.address,e.city_name_en&&`, ${e.city_name_en}`,we&&r.jsxs(r.Fragment,{children:[r.jsx("span",{children:"·"}),r.jsxs("span",{className:ke.distance,children:[r.jsx(Z,{name:"marker--outlined",size:10,fill:"#8db2bb"}),we]})]})]}),r.jsxs("div",{className:ke.infoRow,children:[U&&r.jsxs("div",{className:ke.roomInfo,children:[r.jsxs("span",{className:ke.roomInfoItem,children:[r.jsx(Z,{name:"bed--outlined",size:12,fill:"currentColor"}),r.jsx("span",{children:String(U.name).toLowerCase().replace(/\b\w/g,_e=>_e.toUpperCase())})]}),U.boardName&&r.jsxs("span",{className:ke.roomInfoItem,children:[r.jsx(Z,{name:"dinner--stroke",size:12,fill:"none",stroke:"#8db2bb"}),r.jsx("span",{children:U.boardName??"full board"})]}),r.jsx("span",{className:`${ke.roomInfoItem} ${U.refundable?ke.refundable:""}`,children:U.refundable?r.jsxs(r.Fragment,{children:[r.jsx(Z,{name:"checkMark",size:10,fill:"#13a86e"}),"Free cancellation"]}):r.jsxs(r.Fragment,{children:[r.jsx(Z,{name:"lock",size:12,fill:"#8db2bb",stroke:"#8db2bb"}),r.jsx("span",{children:"No Refunds"})]})})]}),E!=null&&r.jsxs("div",{className:ke.priceStack,children:[r.jsxs("span",{className:ke.priceLabel,children:[o," ",o===1?"night":"nights",", ",s," ",s===1?"adult":"adults"]}),N&&K&&ee!=null?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:ke.proBadge,children:[r.jsx(Z,{name:"lightning-solid",size:9,fill:"#6840cc"}),r.jsx("span",{children:"PRO price"})]}),r.jsxs("div",{className:ke.proPriceRow,children:[r.jsx("span",{className:ke.priceStrike,children:Ut(E,W)}),r.jsx("span",{className:ke.proPrice,children:Ut(ee,W)})]}),se!=null&&se>0&&r.jsxs("span",{className:ke.proSavingBadge,children:["â",Ut(se,W)]})]}):r.jsx("span",{className:ke.price,children:Ut(E,W)})]})]}),r.jsxs("div",{className:ke.bottomRow,children:[ge>0?r.jsxs("div",{className:ke.reviewBadge,children:[r.jsx("span",{className:ke.reviewScore,children:ge.toFixed(1)}),r.jsxs("div",{className:"flex flex-col",children:[r.jsx("span",{className:ke.reviewLabel,children:pv(ge)}),re>0&&r.jsxs("span",{className:ke.reviewCount,children:[re.toLocaleStr
40ing()," reviews"]})]})]}):r.jsx("div",{}),E!=null&&r.jsxs("div",{className:ke.ctaStack,children:[r.jsxs("button",{className:ke.selectBtn,onClick:_e=>{_e.stopPropagation();try{Ke("stay_search_channel_selected",{hotel_id:e.hotel_id,channel:"native",position:i},"hotel_search")}catch(ve){console.error("[HotelBooking] Failed to track stay_search_channel_selected:",{hotelId:e.hotel_id,channel:"native",error:(ve==null?void 0:ve.message)||ve})}c()},type:"button",children:[n?"Book on Stippl":"Select rooms"," ",r.jsx(Z,{name:"chevron-right",size:8})]}),G&&be&&!D&&r.jsxs("a",{className:ke.compareBtn,href:be,target:"_blank",rel:"noopener noreferrer",onClick:_e=>{_e.stopPropagation();try{Ke("stay_search_channel_selected",{hotel_id:e.hotel_id,channel:"booking_com",position:i},"hotel_search")}catch(ve){console.error("[HotelBooking] Failed to track stay_search_channel_selected:",{hotelId:e.hotel_id,channel:"booking_com",error:(ve==null?void 0:ve.message)||ve})}try{Ke("affiliate_clicked",{provider:"booking_com",category:"accommodation",placement:"compare_bar",position:i,price_shown_cents:B??void 0,currency:W,url_source:"direct_affiliate"},"hotel_search"),Rr({provider:"booking_com",category:"accommodation",tripId:M==null?void 0:M._id,destinationId:x,surface:"hotel_search",placement:"compare_bar",position:i,urlSource:"direct_affiliate",targetUrl:be})}catch(ve){console.error("[HotelBooking] Failed to track Booking.com clickout:",{hotelId:e.hotel_id,error:(ve==null?void 0:ve.message)||ve})}},children:[r.jsx("img",{src:Br,alt:"Booking.com",className:ke.compareLogo}),r.jsx("span",{className:ke.compareBrand,children:"Booking.com"}),r.jsx("span",{className:ke.compareFrom,children:"from"}),r.jsx("span",{className:ke.compareValue,children:Ut(B,W)}),r.jsx(Z,{name:"external-link",size:8})]})]})]}),N&&!K&&ee!=null&&se!=null&&se>0&&r.jsxs("div",{className:ke.upgradeBanner,children:[r.jsx(Z,{name:"lightning-solid",size:13,fill:"#6840cc"}),r.jsxs("span",{className:ke.upgradeBannerText,children:["Upgrade to PRO â save ",Ut(se,W)," on this hotel"]}),r.jsx("div",{style:{display:"contents"},onClickCapture:()=>{try{Ke("hotel_price_engaged",{hotel_id:e.hotel_id,element:"card_upgrade"},"hotel_search")}catch(_e){console.error("[HotelBooking] Failed to track hotel_price_engaged:",{hotelId:e.hotel_id,error:(_e==null?void 0:_e.message)||_e})}},children:r.jsx(Vc,{focus:"hotelPricing",buttonText:`Save ${Ut(se,W)}`,className:ke.upgradeBannerCta})})]})]})]})},hv="___react_component_tooltip_4y6wg_259",mv="_show_4y6wg_279",gv="_tags__attribute_4y6wg_283",vv="_marker_4y6wg_308",bv="_SingleDatePickerInput__withBorder_4y6wg_330",yv="_DateInput_4y6wg_330",wv="_DateInput_fang_4y6wg_330",xv="_DateRangePickerInput_4y6wg_331",kv="_SingleDatePicker_picker_4y6wg_335",Sv="_DateInput_fangShape_4y6wg_340",jv="_DateInput_fangStroke_4y6wg_344",Cv="_DateRangePicker_picker_4y6wg_348",Ev="_active_4y6wg_425",$v="_scrolled_4y6wg_484",Nv="_logo_4y6wg_489",Tv="_inversed_4y6wg_515",Pv="_editor_4y6wg_526",Iv="_spin_4y6wg_2085",Rv="_small_4y6wg_638",Mv="_count_4y6wg_659",Ov="_error_4y6wg_674",Av="_success_4y6wg_683",Bv="_label_4y6wg_767",Lv="_actions_4y6wg_832",Dv="_flag_4y6wg_836",Fv="_chip_4y6wg_900",Hv="_remove_4y6wg_936",qv="_trip_4y6wg_1053",Vv="_sleep_4y6wg_1056",zv="_todo_4y6wg_1059",Wv="_cuisine_4y6wg_1062",Uv="_arrow_4y6wg_1069",Gv="_checkmark_4y6wg_1118",Yv="_notice_4y6wg_1169",Kv="_warning_4y6wg_1180",Xv="_BrainhubCarousel__container_4y6wg_1206",Qv="_BrainhubCarouselItem_4y6wg_1209",Jv="_BrainhubCarousel__customArrows_4y6wg_1222",Zv="_save_4y6wg_1372",eb="_add_4y6wg_1375",tb="_distance_4y6wg_1408",nb="_placeholder_4y6wg_1557",ob="_content_4y6wg_1628",rb="_help_4y6wg_1712",ab="_help__button_4y6wg_1726",sb="_help__menu_4y6wg_1754",ib="_hidden_4y6wg_1798",cb="_meta_4y6wg_1954",lb="_dates_4y6wg_1962",db="_destination_4y6wg_1853",_b="_articles_4y6wg_1985",ub="_acco_4y6wg_1991",fb="_days_4y6wg_1994",pb="_destinations_4y6wg_1853",hb="_spinner_4y6wg_2085",mb="_icon_4y6wg_707",gb="_grid_4y6wg_2230",vb="_tags_4y6wg_283",bb="_green_4y6wg_2365",yb="_orange_4y6wg_2368",wb="_transparent_4y6wg_2371",xb="_title_4y6wg_2417",kb="_card_4y6wg_2456",Sb="_photo_4y6wg_2465",jb="_shimmer_4y6wg_1",Cb="_line_4y6wg_2482",Eb="_address_4y6wg_2494",$b="_roomInfo_4y6wg_2499",Nb="_spacer_4y6wg_2504",Tb="_bottomRow_4y6wg_2508",Pb="_badge_4y6wg_2515",Ib="_priceArea_4y6wg_2521",Rb="_price_4y6wg_2521",Mb="_button_4y6wg_2533",Ob="_fadeInTop_4y6wg_1",ot={"hotel-booking-flow":"_hotel-booking-flow_4y6wg_20","ai-chat-open":"_ai-chat-open_4y6wg_24","scroll-lock":"_scroll-lock_4y6wg_119","sub-text":"_sub-text_4y6wg_172","base-color1":"_base-color1_4y6wg_177","base-primary-1":"_base-primary-1_4y6wg_178","base-color2":"_base-color2_4y6wg_186","base-primary-2":"_base-primary-2_4y6wg_187","base-color3":"_base-color3_4y6wg_195","base-primary-3":"_base-primary-3_4y6wg_196","base-color4":"_base-color4_4y6wg_204","base-primary-4":"_base-primary-4_4y6wg_205","base-grey":"_base-grey_4y6wg_213","base-bg1":"_base-bg1_4y6wg_220","col-50":"_col-50_4y6wg_224","react-confirm-alert":"_react-confirm-alert_4y6wg_233","react-confirm-alert-overlay":"_react-confirm-alert-overlay_4y6wg_233","react-confirm-alert-body":"_react-confirm-alert-body_4y6wg_237","react-confirm-alert-button-group":"_react-confirm-alert-button-group_4y6wg_251",__react_component_tooltip:hv,"type-error":"_type-error_4y6wg_269",show:mv,tags__attribute:gv,marker:vv,"open-up":"_open-up_4y6wg_330",SingleDatePickerInput__withBorder:bv,DateInput:yv,DateInput_fang:wv,DateRangePickerInput:xv,
40SingleDatePicker_picker:kv,DateInput_fangShape:Sv,DateInput_fangStroke:jv,DateRangePicker_picker:Cv,"profile-settings-menu":"_profile-settings-menu_4y6wg_355","dropdown-toggle":"_dropdown-toggle_4y6wg_363","user-menu":"_user-menu_4y6wg_406",active:Ev,"link-account":"_link-account_4y6wg_453","mobile-bar":"_mobile-bar_4y6wg_474",scrolled:$v,logo:Nv,"menu-icon":"_menu-icon_4y6wg_492","page-title":"_page-title_4y6wg_498",inversed:Tv,editor:Pv,"editor-toolbar":"_editor-toolbar_4y6wg_532","rdw-option-wrapper":"_rdw-option-wrapper_4y6wg_543","rdw-option-active":"_rdw-option-active_4y6wg_549","rdw-dropdown-wrapper":"_rdw-dropdown-wrapper_4y6wg_563","rdw-link-modal":"_rdw-link-modal_4y6wg_566","rdw-link-modal-target-option":"_rdw-link-modal-target-option_4y6wg_577","rdw-link-modal-buttonsection":"_rdw-link-modal-buttonsection_4y6wg_585","editor-textarea":"_editor-textarea_4y6wg_592","public-DraftEditorPlaceholder-root":"_public-DraftEditorPlaceholder-root_4y6wg_605","rdw-link-decorator-wrapper":"_rdw-link-decorator-wrapper_4y6wg_609","submit-row":"_submit-row_4y6wg_614",spin:Iv,"total-planned":"_total-planned_4y6wg_628","circle-progressbar":"_circle-progressbar_4y6wg_634",small:Rv,"CircularProgressbar-background":"_CircularProgressbar-background_4y6wg_644","CircularProgressbar-path":"_CircularProgressbar-path_4y6wg_650","CircularProgressbar-trail":"_CircularProgressbar-trail_4y6wg_653",count:Mv,error:Ov,success:Av,"error-in-plan":"_error-in-plan_4y6wg_689","icon-rounded":"_icon-rounded_4y6wg_707","img-placeholder":"_img-placeholder_4y6wg_724","custom-tooltip":"_custom-tooltip_4y6wg_762",label:Bv,"nothing-there":"_nothing-there_4y6wg_803",actions:Lv,flag:Dv,"quick-menu__horizontal":"_quick-menu__horizontal_4y6wg_851","icon-circle":"_icon-circle_4y6wg_867","delete-research":"_delete-research_4y6wg_890",delete:"_delete_4y6wg_890",chip:Fv,remove:Hv,"multi-action-btn":"_multi-action-btn_4y6wg_959","hover-btn":"_hover-btn_4y6wg_963","bottom-align":"_bottom-align_4y6wg_968","right-align":"_right-align_4y6wg_1010",trip:qv,sleep:Vv,todo:zv,cuisine:Wv,arrow:Uv,"select-box":"_select-box_4y6wg_1078",checkmark:Gv,"react-read-more-read-less":"_react-read-more-read-less_4y6wg_1153",notice:Yv,warning:Kv,"notice-callout":"_notice-callout_4y6wg_1184",BrainhubCarousel__container:Xv,BrainhubCarouselItem:Qv,BrainhubCarousel__customArrows:Jv,"BrainhubCarousel__custom-arrowLeft":"_BrainhubCarousel__custom-arrowLeft_4y6wg_1226","BrainhubCarousel__arrow--disable":"_BrainhubCarousel__arrow--disable_4y6wg_1281","carousel-card":"_carousel-card_4y6wg_1285","carousel-card__image":"_carousel-card__image_4y6wg_1293","carousel-card__badge":"_carousel-card__badge_4y6wg_1298","--label":"_--label_4y6wg_1314","carousel-card__background":"_carousel-card__background_4y6wg_1334","carousel-card__actions":"_carousel-card__actions_4y6wg_1347",save:Zv,add:eb,"in-research":"_in-research_4y6wg_1394","carousel-card__title":"_carousel-card__title_4y6wg_1400",distance:tb,"in-plan":"_in-plan_4y6wg_1429","in-plan--inspire":"_in-plan--inspire_4y6wg_1456","carousel-card__metadata":"_carousel-card__metadata_4y6wg_1477","carousel-card--article":"_carousel-card--article_4y6wg_1500","carousel-card--tour":"_carousel-card--tour_4y6wg_1503","carousel-card--destination":"_carousel-card--destination_4y6wg_1506","carousel-card--itinerary":"_carousel-card--itinerary_4y6wg_1509",placeholder:nb,"react-router-modal__modal":"_react-router-modal__modal_4y6wg_1568","rounded-modal":"_rounded-modal_4y6wg_1568","img-wrapper":"_img-wrapper_4y6wg_1574","image-placeholder":"_image-placeholder_4y6wg_1583","cta-signup":"_cta-signup_4y6wg_1613",content:ob,"btn-rounded":"_btn-rounded_4y6wg_1670","mobile-banner":"_mobile-banner_4y6wg_1675","typeform-sidetab-button":"_typeform-sidetab-button_4y6wg_1698","tf-v1-sidetab-button":"_tf-v1-sidetab-button_4y6wg_1699","typeform-sidetab-button-text":"_typeform-sidetab-button-text_4y6wg_1703","tf-v1-sidetab-button-text":"_tf-v1-sidetab-button-text_4y6wg_1704",help:rb,help__button:ab,help__menu:sb,"create-ticket":"_create-ticket_4y6wg_1754","text-link":"_text-link_4y6wg_1795",hidden:ib,"partner-action-btn":"_partner-action-btn_4y6wg_1802","destinations-table":"_destinations-table_4y6wg_1853","destinations-table__wrapper":"_destinations-table__wrapper_4y6wg_1856","destinations-table__wrapper--collapsed":"_destinations-table__wrapper--collapsed_4y6wg_1861","destinations-table__fade-overlay":"_destinations-table__fade-overlay_4y6wg_1872","destinations-table__expand-section":"_destinations-table__expand-section_4y6wg_1882",meta:cb,dates:lb,destination:db,articles:_b,acco:ub,days:fb,"day-label":"_day-label_4y6wg_2009","day-number":"_day-number_4y6wg_2012","day-separator":"_day-separator_4y6wg_2017","day-city":"_day-city_4y6wg_2020","travel-day":"_travel-day_4y6wg_2032",destinations:pb,"info-tooltip":"_info-tooltip_4y6wg_2062","carousel-section":"_carousel-section_4y6wg_2076","spinner-wrapper":"_spinner-wrapper_4y6wg_2085",spinner:hb,"carousel-section__title":"_carousel-section__title_4y6wg_2113",icon:mb,"carousel-section__list":"_carousel-section__list_4y6wg_2190","--trips":"_--trips_4y6wg_2208","--continent-section":"_--continent-section_4y6wg_2221","discover-section__list":"_discover-section__list_4y6wg_2221","more-card":"_more-card_4y6wg_2221",grid:gb,"col-2":"_col-2_4y6wg_2235","col-3":"_col-3_4y6wg_2238","col-4":"_col-4_4y6wg_2246",tags:vb,"ReactModal__Body--open":"_ReactModal__Body--open_4y6wg_2283","simple-modal":"_simple-modal_4y6wg_2291","bottom-modal":"_bottom-modal_4y6wg_2296","ReactModal__Overlay--after-open":"_ReactModal__Overlay--after-open_4y6wg_2312","ReactModal__Overlay--before-close":"_ReactModal__Overlay--before-close_4y6wg_2315","popup-modal":"_popup-modal_4y6wg_2318","ReactModal__Content--after-open":"_ReactModal__Content--after-open_4y6wg_2330","ReactModal__Content--before-close":"_ReactModal__Content--before-close_4y6wg_2333",green:bb,orange:yb,transparent:wb,"transport-options__placeholder":"_transport-options__placeholder_4y6wg_2375","text-button":"_text-button_4y6wg_2411",title:xb,card:kb,photo:Sb,shimmer:jb,line:Cb,address:Eb,roomInfo:$b,spacer:Nb,bottomRow:Tb,badge:Pb,priceArea:Ib,price:Rb,button:Mb,"beacon-green":"_beacon-green_4y6wg_1","beacon-orange":"_beacon-orange_4y6wg_1","beacon-purple":"_beacon-purple_4y6wg_1","beacon-magenta":"_beacon-magenta_4y6wg_1",fadeInTop:Ob},ao=()=>r.jsxs("div",{className:ot.card,children:[r.jsx("div",{className:ot.photo}),r.jsxs("div",{className:ot.content,children:[r.jsx("div",{className:`${ot.line} ${ot.title}`}),r.jsx("div",{className:`${ot.line} ${ot.address}`}),r.jsx("div",{className:`${ot.line} ${ot.roomInfo}`}),r.jsx("div",{className:ot.spacer}),r.jsxs("div",{className:ot.bottomRow,children:[r.jsx("div",{className:`${ot.line} ${ot.badge}`}),r.jsxs("div",{className:ot.priceArea,children:[r.jsx("div",{className:`${ot.line} ${ot.price}`}),r.jsx("div",{className:`${ot.line} ${ot.button}`})]})]})]})]}),Ab="___react_component_tooltip_cemf5_259",Bb="_show_cemf5_279",Lb="_tags__attribute_cemf5_283",Db="_marker_cemf5_308",Fb="_SingleDatePickerInput__withBorder_cemf5_330",Hb="_DateInput_cemf5_330",qb="_DateInput_fang_cemf5_330",Vb="_DateRangePickerInput_cemf5_331",zb="_SingleDatePicker_picker_cemf5_335",Wb="_DateInput_fangShape_cemf5_340",Ub="_DateInput_fangStroke_cemf5_344",Gb="_DateRangePicker_picker_cemf5_348",Yb="_active_cemf5_425",Kb="_scrolled_cemf5_484",Xb="_logo_cemf5_489",Qb="_inversed_cemf5_515",Jb="_editor_cemf5_526",Zb="_spin_cemf5_2085",ey="_small_cemf5_638",ty="_count_cemf5_659",ny="_error_cemf5_674",oy="_success_cemf5_683",ry="_label_cemf5_767",ay="_actions_cemf5_832",sy="_flag_cemf5_836",iy="_chip_cemf5_900",cy="_remove_cemf5_936",ly="_trip_cemf5_1053",dy="_sleep_cemf5_1056",_y="_todo_cemf5_1059",uy="_cuisine_cemf5_1062",fy="_arrow_cemf5_1069",py="_checkmark_cemf5_1118",hy="_notice_cemf5_1169",my="_warning_cemf5_1180",gy="_BrainhubCarousel__container_
40cemf5_1206",vy="_BrainhubCarouselItem_cemf5_1209",by="_BrainhubCarousel__customArrows_cemf5_1222",yy="_save_cemf5_1372",wy="_add_cemf5_1375",xy="_distance_cemf5_1408",ky="_placeholder_cemf5_1557",Sy="_content_cemf5_1628",jy="_help_cemf5_1712",Cy="_help__button_cemf5_1726",Ey="_help__menu_cemf5_1754",$y="_hidden_cemf5_1798",Ny="_meta_cemf5_1954",Ty="_dates_cemf5_1962",Py="_destination_cemf5_1853",Iy="_articles_cemf5_1985",Ry="_acco_cemf5_1991",My="_days_cemf5_1994",Oy="_destinations_cemf5_1853",Ay="_spinner_cemf5_2085",By="_icon_cemf5_707",Ly="_grid_cemf5_2230",Dy="_tags_cemf5_283",Fy="_green_cemf5_2365",Hy="_orange_cemf5_2368",qy="_transparent_cemf5_2371",Vy="_title_cemf5_2417",zy="_panel_cemf5_2421",Wy="_tabBar_cemf5_2439",Uy="_tabs_cemf5_2448",Gy="_tab_cemf5_2439",Yy="_tabActive_cemf5_2475",Ky="_tabCount_cemf5_2482",Xy="_filterShow_cemf5_2490",Qy="_filterItem_cemf5_2500",Jy="_clearAll_cemf5_2529",Zy="_mapCropBanner_cemf5_2540",e1="_mapCropBannerAction_cemf5_2556",t1="_scrollContainer_cemf5_2572",n1="_cardList_cemf5_2578",o1="_loaderWrap_cemf5_2588",r1="_inlineLoader_cemf5_2595",a1="_endMessage_cemf5_2599",s1="_emptyState_cemf5_2607",i1="_emptyIcon_cemf5_2615",c1="_emptyTitle_cemf5_2629",l1="_emptySubtitle_cemf5_2637",d1="_emptyActions_cemf5_2646",_1="_emptyActionBtn_cemf5_2653",u1="_emptyDivider_cemf5_2676",f1="_emptyDividerLine_cemf5_2684",p1="_emptyDividerText_cemf5_2690",h1="_emptyPrefill_cemf5_2699",m1="_partnerList_cemf5_2716",g1="_partnerBtn_cemf5_2725",v1="_intripEmpty_cemf5_2752",b1="_intripEmptyIcon_cemf5_2761",y1="_intripEmptyTitle_cemf5_2775",w1="_intripEmptyText_cemf5_2783",x1="_browseBtn_cemf5_2790",k1="_fadeInTop_cemf5_1",Me={"hotel-booking-flow":"_hotel-booking-flow_cemf5_20","ai-chat-open":"_ai-chat-open_cemf5_24","scroll-lock":"_scroll-lock_cemf5_119","sub-text":"_sub-text_cemf5_172","base-color1":"_base-color1_cemf5_177","base-primary-1":"_base-primary-1_cemf5_178","base-color2":"_base-color2_cemf5_186","base-primary-2":"_base-primary-2_cemf5_187","base-color3":"_base-color3_cemf5_195","base-primary-3":"_base-primary-3_cemf5_196","base-color4":"_base-color4_cemf5_204","base-primary-4":"_base-primary-4_cemf5_205","base-grey":"_base-grey_cemf5_213","base-bg1":"_base-bg1_cemf5_220","col-50":"_col-50_cemf5_224","react-confirm-alert":"_react-confirm-alert_cemf5_233","react-confirm-alert-overlay":"_react-confirm-alert-overlay_cemf5_233","react-confirm-alert-body":"_react-confirm-alert-body_cemf5_237","react-confirm-alert-button-group":"_react-confirm-alert-button-group_cemf5_251",__react_component_tooltip:Ab,"type-error":"_type-error_cemf5_269",show:Bb,tags__attribute:Lb,marker:Db,"open-up":"_open-up_cemf5_330",SingleDatePickerInput__withBorder:Fb,DateInput:Hb,DateInput_fang:qb,DateRangePickerInput:Vb,SingleDatePicker_picker:zb,DateInput_fangShape:Wb,DateInput_fangStroke:Ub,DateRangePicker_picker:Gb,"profile-settings-menu":"_profile-settings-menu_cemf5_355","dropdown-toggle":"_dropdown-toggle_cemf5_363","user-menu":"_user-menu_cemf5_406",active:Yb,"link-account":"_link-account_cemf5_453","mobile-bar":"_mobile-bar_cemf5_474",scrolled:Kb,logo:Xb,"menu-icon":"_menu-icon_cemf5_492","page-title":"_page-title_cemf5_498",inversed:Qb,editor:Jb,"editor-toolbar":"_editor-toolbar_cemf5_532","rdw-option-wrapper":"_rdw-option-wrapper_cemf5_543","rdw-option-active":"_rdw-option-active_cemf5_549","rdw-dropdown-wrapper":"_rdw-dropdown-wrapper_cemf5_563","rdw-link-modal":"_rdw-link-modal_cemf5_566","rdw-link-modal-target-option":"_rdw-link-modal-target-option_cemf5_577","rdw-link-modal-buttonsection":"_rdw-link-modal-buttonsection_cemf5_585","editor-textarea":"_editor-textarea_cemf5_592","public-DraftEditorPlaceholder-root":"_public-DraftEditorPlaceholder-root_cemf5_605","rdw-link-decorator-wrapper":"_rdw-link-decorator-wrapper_cemf5_609","submit-row":"_submit-row_cemf5_614",spin:Zb,"total-planned":"_total-planned_cemf5_628","circle-progressbar":"_circle-progressbar_cemf5_634",small:ey,"CircularProgressbar-background":"_CircularProgressbar-background_cemf5_644","CircularProgressbar-path":"_CircularProgressbar-path_cemf5_650","CircularProgressbar-trail":"_CircularProgressbar-trail_cemf5_653",count:ty,error:ny,success:oy,"error-in-plan":"_error-in-plan_cemf5_689","icon-rounded":"_icon-rounded_cemf5_707","img-placeholder":"_img-placeholder_cemf5_724","custom-tooltip":"_custom-tooltip_cemf5_762",label:ry,"n
40othing-there":"_nothing-there_cemf5_803",actions:ay,flag:sy,"quick-menu__horizontal":"_quick-menu__horizontal_cemf5_851","icon-circle":"_icon-circle_cemf5_867","delete-research":"_delete-research_cemf5_890",delete:"_delete_cemf5_890",chip:iy,remove:cy,"multi-action-btn":"_multi-action-btn_cemf5_959","hover-btn":"_hover-btn_cemf5_963","bottom-align":"_bottom-align_cemf5_968","right-align":"_right-align_cemf5_1010",trip:ly,sleep:dy,todo:_y,cuisine:uy,arrow:fy,"select-box":"_select-box_cemf5_1078",checkmark:py,"react-read-more-read-less":"_react-read-more-read-less_cemf5_1153",notice:hy,warning:my,"notice-callout":"_notice-callout_cemf5_1184",BrainhubCarousel__container:gy,BrainhubCarouselItem:vy,BrainhubCarousel__customArrows:by,"BrainhubCarousel__custom-arrowLeft":"_BrainhubCarousel__custom-arrowLeft_cemf5_1226","BrainhubCarousel__arrow--disable":"_BrainhubCarousel__arrow--disable_cemf5_1281","carousel-card":"_carousel-card_cemf5_1285","carousel-card__image":"_carousel-card__image_cemf5_1293","carousel-card__badge":"_carousel-card__badge_cemf5_1298","--label":"_--label_cemf5_1314","carousel-card__background":"_carousel-card__background_cemf5_1334","carousel-card__actions":"_carousel-card__actions_cemf5_1347",save:yy,add:wy,"in-research":"_in-research_cemf5_1394","carousel-card__title":"_carousel-card__title_cemf5_1400",distance:xy,"in-plan":"_in-plan_cemf5_1429","in-plan--inspire":"_in-plan--inspire_cemf5_1456","carousel-card__metadata":"_carousel-card__metadata_cemf5_1477","carousel-card--article":"_carousel-card--article_cemf5_1500","carousel-card--tour":"_carousel-card--tour_cemf5_1503","carousel-card--destination":"_carousel-card--destination_cemf5_1506","carousel-card--itinerary":"_carousel-card--itinerary_cemf5_1509",placeholder:ky,"react-router-modal__modal":"_react-router-modal__modal_cemf5_1568","rounded-modal":"_rounded-modal_cemf5_1568","img-wrapper":"_img-wrapper_cemf5_1574","image-placeholder":"_image-placeholder_cemf5_1583","cta-signup":"_cta-signup_cemf5_1613",content:Sy,"btn-rounded":"_btn-rounded_cemf5_1670","mobile-banner":"_mobile-banner_cemf5_1675","typeform-sidetab-button":"_typeform-sidetab-button_cemf5_1698","tf-v1-sidetab-button":"_tf-v1-sidetab-button_cemf5_1699","typeform-sidetab-button-text":"_typeform-sidetab-button-text_cemf5_1703","tf-v1-sidetab-button-text":"_tf-v1-sidetab-button-text_cemf5_1704",help:jy,help__button:Cy,help__menu:Ey,"create-ticket":"_create-ticket_cemf5_1754","text-link":"_text-link_cemf5_1795",hidden:$y,"partner-action-btn":"_partner-action-btn_cemf5_1802","destinations-table":"_destinations-table_cemf5_1853","destinations-table__wrapper":"_destinations-table__wrapper_cemf5_1856","destinations-table__wrapper--collapsed":"_destinations-table__wrapper--collapsed_cemf5_1861","destinations-table__fade-overlay":"_destinations-table__fade-overlay_cemf5_1872","destinations-table__expand-section":"_destinations-table__expand-section_cemf5_1882",meta:Ny,dates:Ty,destination:Py,articles:Iy,acco:Ry,days:My,"day-label":"_day-label_cemf5_2009","day-number":"_day-number_cemf5_2012","day-separator":"_day-separator_cemf5_2017","day-city":"_day-city_cemf5_2020","travel-day":"_travel-day_cemf5_2032",destinations:Oy,"info-tooltip":"_info-tooltip_cemf5_2062","carousel-section":"_carousel-section_cemf5_2076","spinner-wrapper":"_spinner-wrapper_cemf5_2085",spinner:Ay,"carousel-section__title":"_carousel-section__title_cemf5_2113",icon:By,"carousel-section__list":"_carousel-section__list_cemf5_2190","--trips":"_--trips_cemf5_2208","--continent-section":"_--continent-section_cemf5_2221","discover-section__list":"_discover-section__list_cemf5_2221","more-card":"_more-card_cemf5_2221",grid:Ly,"col-2":"_col-2_cemf5_2235","col-3":"_col-3_cemf5_2238","col-4":"_col-4_cemf5_2246",tags:Dy,"ReactModal__Body--open":"_ReactModal__Body--open_cemf5_2283","simple-modal":"_simple-modal_cemf5_2291","bottom-modal":"_bottom-modal_cemf5_2296","ReactModal__Overlay--after-open":"_ReactModal__Overlay--after-open_cemf5_2312","ReactModal__Overlay--before-close":"_ReactModal__Overlay--before-close_cemf5_2315","popup-modal":"_popup-modal_
40cemf5_2318","ReactModal__Content--after-open":"_ReactModal__Content--after-open_cemf5_2330","ReactModal__Content--before-close":"_ReactModal__Content--before-close_cemf5_2333",green:Fy,orange:Hy,transparent:qy,"transport-options__placeholder":"_transport-options__placeholder_cemf5_2375","text-button":"_text-button_cemf5_2411",title:Vy,panel:zy,tabBar:Wy,tabs:Uy,tab:Gy,tabActive:Yy,tabCount:Ky,filterShow:Xy,filterItem:Qy,clearAll:Jy,mapCropBanner:Zy,mapCropBannerAction:e1,scrollContainer:t1,cardList:n1,loaderWrap:o1,inlineLoader:r1,endMessage:a1,emptyState:s1,emptyIcon:i1,emptyTitle:c1,emptySubtitle:l1,emptyActions:d1,emptyActionBtn:_1,emptyDivider:u1,emptyDividerLine:f1,emptyDividerText:p1,emptyPrefill:h1,partnerList:m1,partnerBtn:g1,intripEmpty:v1,intripEmptyIcon:b1,intripEmptyTitle:y1,intripEmptyText:w1,browseBtn:x1,"beacon-green":"_beacon-green_cemf5_1","beacon-orange":"_beacon-orange_cemf5_1","beacon-purple":"_beacon-purple_cemf5_1","beacon-magenta":"_beacon-magenta_cemf5_1",fadeInTop:k1},S1="___react_component_tooltip_wslb2_259",j1="_show_wslb2_279",C1="_tags__attribute_wslb2_283",E1="_marker_wslb2_308",$1="_SingleDatePickerInput__withBorder_wslb2_330",N1="_DateInput_wslb2_330",T1="_DateInput_fang_wslb2_330",P1="_DateRangePickerInput_wslb2_331",I1="_SingleDatePicker_picker_wslb2_335",R1="_DateInput_fangShape_wslb2_340",M1="_DateInput_fangStroke_wslb2_344",O1="_DateRangePicker_picker_wslb2_348",A1="_active_wslb2_425",B1="_scrolled_wslb2_484",L1="_logo_wslb2_489",D1="_inversed_wslb2_515",F1="_editor_wslb2_526",H1="_spin_wslb2_2085",q1="_small_wslb2_638",V1="_count_wslb2_659",z1="_error_wslb2_674",W1="_success_wslb2_683",U1="_label_wslb2_767",G1="_actions_wslb2_832",Y1="_flag_wslb2_836",K1="_chip_wslb2_900",X1="_remove_wslb2_936",Q1="_trip_wslb2_1053",J1="_sleep_wslb2_1056",Z1="_todo_wslb2_1059",ew="_cuisine_wslb2_1062",tw="_arrow_wslb2_1069",nw="_checkmark_wslb2_1118",ow="_notice_wslb2_1169",rw="_warning_wslb2_1180",aw="_BrainhubCarousel__container_wslb2_1206",sw="_BrainhubCarouselItem_wslb2_1209",iw="_BrainhubCarousel__customArrows_wslb2_1222",cw="_save_wslb2_1372",lw="_add_wslb2_1375",dw="_distance_wslb2_1408",_w="_placeholder_wslb2_1557",uw="_content_wslb2_1628",fw="_help_wslb2_1712",pw="_help__button_wslb2_1726",hw="_help__menu_wslb2_1754",mw="_hidden_wslb2_1798",gw="_meta_wslb2_1954",vw="_dates_wslb2_1962",bw="_destination_wslb2_1853",yw="_articles_wslb2_1985",ww="_acco_wslb2_1991",xw="_days_wslb2_1994",kw="_destinations_wslb2_1853",Sw="_spinner_wslb2_2085",jw="_icon_wslb2_707",Cw="_grid_wslb2_2230",Ew="_tags_wslb2_283",$w="_green_wslb2_2365",Nw="_orange_wslb2_2368",Tw="_transparent_wslb2_2371",Pw="_title_wslb2_2417",Iw="_sortDropdown_wslb2_2421",Rw="_trigger_wslb2_2426",Mw="_sortIcon_wslb2_2454",Ow="_menu_wslb2_492",Aw="_option_wslb2_2475",Bw="_selected_wslb2_2492",Lw="_fadeInTop_wslb2_1",Pt={"hotel-booking-flow":"_hotel-booking-flow_wslb2_20","ai-chat-open":"_ai-chat-open_wslb2_24","scroll-lock":"_scroll-lock_wslb2_119","sub-text":"_sub-text_wslb2_172","base-color1":"_base-color1_wslb2_177","base-primary-1":"_base-primary-1_wslb2_178","base-color2":"_base-color2_wslb2_186","base-primary-2":"_base-primary-2_wslb2_187","base-color3":"_base-color3_wslb2_195","base-primary-3":"_base-primary-3_wslb2_196","base-color4":"_base-color4_wslb2_204","base-primary-4":"_base-primary-4_wslb2_205","base-grey":"_base-grey_wslb2_213","base-bg1":"_base-bg1_wslb2_220","col-50":"_col-50_wslb2_224","react-confirm-alert":"_react-confirm-alert_wslb2_233","react-confirm-alert-overlay":"_react-confirm-alert-overlay_wslb2_233","react-confirm-alert-body":"_react-confirm-alert-body_wslb2_237","react-confirm-alert-button-group":"_react-confirm-alert-button-group_wslb2_251",__react_component_tooltip:S1,"type-error":"_type-error_wslb2_269",show:j1,tags__attribute:C1,marker:E1,"open-up":"_open-up_wslb2_330",SingleDatePickerInput__withBorder:$1,DateInput:N1,DateInput_fang:T1,DateRangePickerInput:P1,SingleDatePicker_picker:I1,DateInput_fangShape:R1,DateInput_fangStroke:M1,DateRangePicker_picker:O1,"profile-settings-menu":"_profile-settings-menu_wslb2_355","dropdown-toggle":"_dropdown-toggle_wslb2_363","user-menu":"_user-menu_wslb2_406",active:A1,"link-account":"_link-account_wslb2_453","mobile-bar":"_mobile-bar_wslb2_474",scrolled:B1,logo:L1,"menu-icon":"_menu-icon_
40wslb2_492","page-title":"_page-title_wslb2_498",inversed:D1,editor:F1,"editor-toolbar":"_editor-toolbar_wslb2_532","rdw-option-wrapper":"_rdw-option-wrapper_wslb2_543","rdw-option-active":"_rdw-option-active_wslb2_549","rdw-dropdown-wrapper":"_rdw-dropdown-wrapper_wslb2_563","rdw-link-modal":"_rdw-link-modal_wslb2_566","rdw-link-modal-target-option":"_rdw-link-modal-target-option_wslb2_577","rdw-link-modal-buttonsection":"_rdw-link-modal-buttonsection_wslb2_585","editor-textarea":"_editor-textarea_wslb2_592","public-DraftEditorPlaceholder-root":"_public-DraftEditorPlaceholder-root_wslb2_605","rdw-link-decorator-wrapper":"_rdw-link-decorator-wrapper_wslb2_609","submit-row":"_submit-row_wslb2_614",spin:H1,"total-planned":"_total-planned_wslb2_628","circle-progressbar":"_circle-progressbar_wslb2_634",small:q1,"CircularProgressbar-background":"_CircularProgressbar-background_wslb2_644","CircularProgressbar-path":"_CircularProgressbar-path_wslb2_650","CircularProgressbar-trail":"_CircularProgressbar-trail_wslb2_653",count:V1,error:z1,success:W1,"error-in-plan":"_error-in-plan_wslb2_689","icon-rounded":"_icon-rounded_wslb2_707","img-placeholder":"_img-placeholder_wslb2_724","custom-tooltip":"_custom-tooltip_wslb2_762",label:U1,"nothing-there":"_nothing-there_wslb2_803",actions:G1,flag:Y1,"quick-menu__horizontal":"_quick-menu__horizontal_wslb2_851","icon-circle":"_icon-circle_wslb2_867","delete-research":"_delete-research_wslb2_890",delete:"_delete_wslb2_890",chip:K1,remove:X1,"multi-action-btn":"_multi-action-btn_wslb2_959","hover-btn":"_hover-btn_wslb2_963","bottom-align":"_bottom-align_wslb2_968","right-align":"_right-align_wslb2_1010",trip:Q1,sleep:J1,todo:Z1,cuisine:ew,arrow:tw,"select-box":"_select-box_wslb2_1078",checkmark:nw,"react-read-more-read-less":"_react-read-more-read-less_wslb2_1153",notice:ow,warning:rw,"notice-callout":"_notice-callout_wslb2_1184",BrainhubCarousel__container:aw,BrainhubCarouselItem:sw,BrainhubCarousel__customArrows:iw,"BrainhubCarousel__custom-arrowLeft":"_BrainhubCarousel__custom-arrowLeft_wslb2_1226","BrainhubCarousel__arrow--disable":"_BrainhubCarousel__arrow--disable_wslb2_1281","carousel-card":"_carousel-card_wslb2_1285","carousel-card__image":"_carousel-card__image_wslb2_1293","carousel-card__badge":"_carousel-card__badge_wslb2_1298","--label":"_--label_wslb2_1314","carousel-card__background":"_carousel-card__background_wslb2_1334","carousel-card__actions":"_carousel-card__actions_wslb2_1347",save:cw,add:lw,"in-research":"_in-research_wslb2_1394","carousel-card__title":"_carousel-card__title_wslb2_1400",distance:dw,"in-plan":"_in-plan_wslb2_1429","in-plan--inspire":"_in-plan--inspire_wslb2_1456","carousel-card__metadata":"_carousel-card__metadata_wslb2_1477","carousel-card--article":"_carousel-card--article_wslb2_1500","carousel-card--tour":"_carousel-card--tour_wslb2_1503","carousel-card--destination":"_carousel-card--destination_wslb2_1506","carousel-card--itinerary":"_carousel-card--itinerary_wslb2_1509",placeholder:_w,"react-router-modal__modal":"_react-router-modal__modal_wslb2_1568","rounded-modal":"_rounded-modal_wslb2_1568","img-wrapper":"_img-wrapper_wslb2_1574","image-placeholder":"_image-placeholder_wslb2_1583","cta-signup":"_cta-signup_wslb2_1613",content:uw,"btn-rounded":"_btn-rounded_wslb2_1670","mobile-banner":"_mobile-banner_wslb2_1675","typeform-sidetab-button":"_typeform-sidetab-button_wslb2_1698","tf-v1-sidetab-button":"_tf-v1-sidetab-button_wslb2_1699","typeform-sidetab-button-text":"_typeform-sidetab-button-text_wslb2_1703","tf-v1-sidetab-button-text":"_tf-v1-sidetab-button-text_wslb2_1704",help:fw,help__button:pw,help__menu:hw,"create-ticket":"_create-ticket_wslb2_1754","text-link":"_text-link_wslb2_1795",hidden:mw,"partner-action-btn":"_partner-action-btn_wslb2_1802","destinations-table":"_destinations-table_wslb2_1853","destinations-table__wrapper":"_destinations-table__wrapper_wslb2_1856","destinations-table__wrapper--collapsed":"_destinations-table__wrapper--collapsed_wslb2_1861","destinations-table__fade-overlay":"_destinations-table__fade-overlay_wslb2_1872","destinations-table__expand-section":"_destinations-table__expand-section_wslb2_1882",meta:gw,dates:vw,destination:bw,articles:yw,acco:ww,days:xw,"day-label":"_day-label_wslb2_2009","day-number":"_day-number_wslb2_2012","day-separator":"_day-separator_wslb2_2017","day-city":"_day-city_wslb2_2020","travel-day":"_travel-day_wslb2_2032",destinations:kw,"info-tooltip":"_info-tooltip_wslb2_2062","carousel-section":"_carousel-section_wslb2_2076","spinner-wrapper":"_spinner-wrapper_wslb2_2085",spinner:Sw,"carousel-section__title":"_carousel-section__title_wslb2_2113",icon:jw,"carousel-section__list":"_carousel-section__list_wslb2_2190","--trips":"_--trips_wslb2_2208","--continent-section":"_--continent-section_wslb2_2221","discover-section__list":"_discover-section__list_wslb2_2221","more-card":"_more-card_wslb2_2221",grid:Cw,"col
40-2":"_col-2_wslb2_2235","col-3":"_col-3_wslb2_2238","col-4":"_col-4_wslb2_2246",tags:Ew,"ReactModal__Body--open":"_ReactModal__Body--open_wslb2_2283","simple-modal":"_simple-modal_wslb2_2291","bottom-modal":"_bottom-modal_wslb2_2296","ReactModal__Overlay--after-open":"_ReactModal__Overlay--after-open_wslb2_2312","ReactModal__Overlay--before-close":"_ReactModal__Overlay--before-close_wslb2_2315","popup-modal":"_popup-modal_wslb2_2318","ReactModal__Content--after-open":"_ReactModal__Content--after-open_wslb2_2330","ReactModal__Content--before-close":"_ReactModal__Content--before-close_wslb2_2333",green:$w,orange:Nw,transparent:Tw,"transport-options__placeholder":"_transport-options__placeholder_wslb2_2375","text-button":"_text-button_wslb2_2411",title:Pw,sortDropdown:Iw,trigger:Rw,sortIcon:Mw,menu:Ow,option:Aw,selected:Bw,"beacon-green":"_beacon-green_wslb2_1","beacon-orange":"_beacon-orange_wslb2_1","beacon-purple":"_beacon-purple_wslb2_1","beacon-magenta":"_beacon-magenta_wslb2_1",fadeInTop:Lw},Fs=[{value:"TOP_PICKS",label:"Our Top Picks"},{value:"PRICE_LOW_TO_HIGH",label:"Price: Low to High"},{value:"PRICE_HIGH_TO_LOW",label:"Price: High to Low"},{value:"REVIEW_SCORE",label:"Review Score"},{value:"STAR_RATING",label:"Star Rating"},{value:"BEST_DISCOUNT",label:"Best Discount"}],Dw=()=>{var l;const{state:e,dispatch:t}=bn(),[n,o]=f.useState(!1),s=f.useRef(null),i=((l=Fs.find(d=>d.value===e.sortBy))==null?void 0:l.label)??"Our Top Picks",a=d=>{o(!1),ht(()=>t({type:"SET_SORT",sortBy:d}))},c=d=>{var u;(u=s.current)!=null&&u.contains(d.relatedTarget)||o(!1)};return r.jsxs("div",{className:Pt.sortDropdown,ref:s,onBlur:c,tabIndex:-1,children:[r.jsxs("button",{className:Pt.trigger,onClick:()=>o(d=>!d),type:"button",children:[r.jsx("svg",{className:Pt.sortIcon,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M2 4h12M4 8h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),r.jsx("span",{className:Pt.label,children:"Sort:"}),r.jsx("span",{className:Pt.value,children:i}),r.jsx(Z,{name:"chevron-down",size:8})]}),n&&r.jsx("div",{className:Pt.menu,children:Fs.map(d=>r.jsxs("button",{className:`${Pt.option} ${e.sortBy===d.value?Pt.selected:""}`,onClick:()=>a(d.value),type:"button",children:[d.label,e.sortBy===d.value&&r.jsx(Z,{name:"tick",size:12})]},d.value))})]})};function Fw(e,t,n){return e?0:Math.max(0,t-n)}function Hw(e){return`${e} more ${e===1?"stay is":"stays are"} outside the map area`}function qw(e,t){return t>0?`You've seen all ${e} ${e===1?"stay":"stays"} in this map area`:`You've seen all ${e} results`}function Vw(e){const{latitude:t,longitude:n}=e;return t==null||n==null||t===""||n===""?!1:Number.isFinite(Number(t))&&Number.isFinite(Number(n))}function zw(e,t){const{west:n,south:o,east:s,north:i}=t;return e.filter(a=>{if(!Vw(a))return!0;const c=Number(a.latitude),l=Number(a.longitude);return c>=o&&c<=i&&l>=n&&l<=s})}const Hs="hotel-results-scroll",Xo=["Booking.com","Hostelworld","Expedia","Airbnb","Agoda","Trip.com"],Ww=ci.filter(e=>Xo.includes(e.name)).sort((e,t)=>Xo.indexOf(e.name)-Xo.indexOf(t.name));function Uw(e,t){if(!e||!t)return null;try{const n=new Date(e),o=new Date(t),s=n.toLocaleString("en",{month:"short"}),i=o.toLocaleString("en",{month:"short"});return s===i?`${n.getDate()}â${o.getDate()} ${s}`:`${n.getDate()} ${s} â ${o.getDate()} ${i}`}catch{return null}}const Gw=({results:e,totalCount:t,hiddenByMapCount:n=0,onShowAllOutsideMap:o,hasMore:s,loading:i,plannedAccommodationPlaces:a,bookedResultPrices:c,currentDestination:l,isGuestDestination:d,onSelectRooms:u,onAdd:p,onChangeAssignment:h,onRemove:g,onFetchMore:m,isB2B:v,onAddCustomStay:j,onSaveToList:S})=>{const{state:_,dispatch:$}=bn(),{searchTab:M,searchParams:x,sortBy:P}=_,{lists:I}=Po(),{isBookmarked:R}=No("accommodation"),{tripCurrency:L,currentTrip:D}=rt(),{convertPrice:H}=tn(),{user:b}=lt(),y=f.useMemo(()=>{const N=x.checkIn||(l==null?void 0:l.startDate),K=x.checkOut||(l==null?void 0:l.endDate);if(!N||!K)return 1;try{const ee=(new Date(K).getTime()-new Date(N).getTime())/864e5;return Math.max(1,Math.round(ee))}catch{return 1}},[x.checkIn,x.checkOut,l]),k=f.useMemo(()=>new Set((a||[]).map(N=>{var K;return((K=N==null?void 0:N.metadata)==null?void 0:K.id)||(N==null?void 0:N.hotel_id)||(N==null?void 0:N._id)}
40).filter(Boolean)),[a]),T=N=>k.has(N.hotel_id)||k.has(N.key),O=(l==null?void 0:l.city)??"",q=x.checkIn||(l==null?void 0:l.startDate),z=x.checkOut||(l==null?void 0:l.endDate),V=Uw(q,z),W=nr({city:O}).canRender,te=["savedLists","accommodationTypes","facilities","roomAmenities","starRatings"],E={9:"9+ Wonderful",8:"8+ Very good",7:"7+ Good",6:"6+ Pleasant"},B=f.useMemo(()=>{const N=te.flatMap(ee=>_.filters[ee].map(se=>{var ge;const je=ee==="savedLists",be=je?((ge=I.find(re=>re._id===se))==null?void 0:ge.name)||se:null;return je?{key:ee,label:be||se}:{key:ee,label:se}})),K=[];return _.filters.minReviewScore>0&&K.push({key:"minReviewScore",label:E[_.filters.minReviewScore]||`${_.filters.minReviewScore}+`}),_.filters.freeCancellation&&K.push({key:"freeCancellation",label:"Free cancellation"}),_.filters.breakfastIncluded&&K.push({key:"breakfastIncluded",label:"Breakfast included"}),[...N,...K]},[_.filters,I]),G=(N,K)=>{if(N==="minReviewScore"){$({type:"SET_FILTERS",filters:{..._.filters,minReviewScore:0}});return}if(N==="freeCancellation"||N==="breakfastIncluded"){$({type:"SET_FILTERS",filters:{..._.filters,[N]:!1}});return}$({type:"SET_FILTERS",filters:{..._.filters,[N]:_.filters[N].filter(ee=>ee!==K)}})};return r.jsxs("div",{className:`hotel-panel ${Me.panel}`,children:[r.jsxs("div",{className:Me.tabBar,children:[r.jsxs("div",{className:Me.tabs,children:[r.jsxs("button",{className:`${Me.tab} ${M==="all"?Me.tabActive:""}`,onClick:()=>$({type:"SET_SEARCH_TAB",tab:"all"}),type:"button",children:["All stays",e!=null&&e.length&&t>0?r.jsx("span",{className:Me.tabCount,children:t}):null]}),!d&&r.jsxs("button",{className:`${Me.tab} ${M==="intrip"?Me.tabActive:""}`,onClick:()=>$({type:"SET_SEARCH_TAB",tab:"intrip"}),type:"button",children:["In trip",a.length>0?r.jsx("span",{className:Me.tabCount,children:a.length}):null]})]}),r.jsx(Dw,{})]}),r.jsxs("div",{className:Me.filterShow,children:[B.map((N,K)=>r.jsxs("div",{className:Me.filterItem,children:[r.jsx("span",{children:N.label}),r.jsx("button",{type:"button",onClick:()=>G(N.key,N.label),children:r.jsx(Z,{name:"close",size:8})})]},K)),B.length>0&&r.jsx("button",{className:`${Me.clearAll}`,type:"button",onClick:()=>$({type:"RESET_FILTERS"}),children:"Clear all"})]}),M==="all"?r.jsxs(r.Fragment,{children:[n>0&&r.jsxs("div",{className:Me.mapCropBanner,children:[r.jsx("span",{children:Hw(n)}),r.jsx("button",{type:"button",className:Me.mapCropBannerAction,onClick:o,children:"Show all"})]}
40),r.jsx("div",{className:Me.scrollContainer,id:Hs,children:i&&e.length===0?r.jsxs("div",{className:Me.cardList,children:[r.jsx(ao,{}),r.jsx(ao,{}),r.jsx(ao,{}),r.jsx(ao,{})]}):r.jsxs(fc,{dataLength:e.length,next:m,hasMore:s,scrollableTarget:Hs,loader:r.jsx(Ir,{text:"Loading more",className:Me.inlineLoader}),endMessage:!s&&e.length>0?r.jsx("p",{className:Me.endMessage,children:qw(e.length,n)}):null,children:[r.jsx("div",{className:Me.cardList,children:e.map((N,K)=>r.jsx(Ds,{hotel:N,isInTrip:T(N),isGuestDestination:d,nights:y,guests:x.guests,position:K,sortBy:P,onSelectRooms:()=>u(N),onAdd:()=>p(N),onChangeAssignment:()=>h(N),onRemove:()=>g(N),onBookmark:()=>S(N),isBookmarked:R(N),destinationName:O,isB2B:v,checkIn:q,checkOut:z,tripCurrency:L,convertPrice:H,plannedAccommodationPlaces:a,currentTrip:D,destinationId:l==null?void 0:l._id},N.hotel_id||N.key))}),e.length===0&&!i&&r.jsxs("div",{className:Me.emptyState,children:[r.jsx("div",{className:Me.emptyIcon,children:r.jsx(Z,{name:"search",size:24})}),r.jsx("h3",{className:Me.emptyTitle,children:"No stays match your filters"}),r.jsx("p",{className:Me.emptySubtitle,children:"Try adjusting your filters, or search directly on a partner site."}),r.jsxs("div",{className:Me.emptyActions,children:[!!B.length&&r.jsxs("button",{type:"button",className:Me.emptyActionBtn,onClick:()=>$({type:"RESET_FILTERS"}),children:[r.jsx(Z,{name:"close",size:10}),r.jsx("span",{children:"Clear filters"})]}),!d&&r.jsxs("button",{type:"button",className:Me.emptyActionBtn,onClick:j,children:[r.jsx(Z,{name:"plus",size:10}),r.jsx("span",{children:"Add custom stay"})]})]}),W&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:Me.emptyDivider,children:[r.jsx("span",{className:Me.emptyDividerLine}),r.jsx("span",{className:Me.emptyDividerText,children:"or search on"}),r.jsx("span",{className:Me.emptyDividerLine})]}),(O||V)&&r.jsxs("div",{className:Me.emptyPrefill,children:[r.jsx(Z,{name:"info",size:11}),r.jsxs("span",{children:["Pre-filled with",O?r.jsxs(r.Fragment,{children:[" ",r.jsx("strong",{children:O})]}):null,V?r.jsxs(r.Fragment,{children:[" · ",V]}):null]})]}),r.jsx("div",{className:Me.partnerList,children:Ww.map(N=>r.jsxs("a",{href:nr({partner:N.name,city:O,startDate:q,endDate:z,username:b==null?void 0:b.username}).href,target:"_blank",rel:"noopener noreferrer",className:Me.partnerBtn,children:[r.jsx("img",{src:N.logo,alt:N.name,width:18,height:18}),r.jsx("span",{children:N.name}),r.jsx(Z,{name:"external-link",size:9})]},N.name))})]})]})]})})]}
40):r.jsx("div",{className:Me.scrollContainer,children:a.length===0?r.jsxs("div",{className:Me.intripEmpty,children:[r.jsx("div",{className:Me.intripEmptyIcon,children:r.jsx(Z,{name:"checkMark",size:24})}),r.jsx("h3",{className:Me.intripEmptyTitle,children:"No stays added yet"}),r.jsx("p",{className:Me.intripEmptyText,children:"Browse available stays and click the + button to add them to your trip."}),r.jsx("button",{className:Me.browseBtn,onClick:()=>$({type:"SET_SEARCH_TAB",tab:"all"}),type:"button",children:"Browse stays"})]}):r.jsx("div",{className:Me.cardList,children:a.map((N,K)=>{var se,je,be,ge,re,U;const ee={key:N._id,hotel_id:((se=N==null?void 0:N.metadata)==null?void 0:se.id)||(N==null?void 0:N._id),name:(N==null?void 0:N.name)||(N==null?void 0:N.title),address:(N==null?void 0:N.address)||"",city_name_en:(N==null?void 0:N.city)||"",latitude:Number((N==null?void 0:N.latitude)||0),longitude:Number((N==null?void 0:N.longitude)||0),hotel_class:0,review_score:((je=N==null?void 0:N.metadata)==null?void 0:je.rating)||(N==null?void 0:N.review_score)||0,review_nr:((be=N==null?void 0:N.metadata)==null?void 0:be.ratingAmount)||(N==null?void 0:N.review_nr)||0,photo:Array.isArray(N==null?void 0:N.images)?N.images[0]:(N==null?void 0:N.photo)||"",price:(c==null?void 0:c.get(String(N._id)))??(c==null?void 0:c.get(String((ge=N==null?void 0:N.metadata)==null?void 0:ge.id)))??{gross_price:String(Ks(N)||""),currency:((re=N==null?void 0:N.metadata)==null?void 0:re.currency)||"EUR"},free_cancellation:!1,provider:((U=N==null?void 0:N.metadata)==null?void 0:U.provider)||"booking",offerId:"",roomTypes:[]};return r.jsx(Ds,{hotel:ee,isInTrip:!0,nights:y,guests:x.guests,position:K,sortBy:P,onSelectRooms:()=>u(ee),onAdd:()=>{},onBookmark:()=>S(ee),isBookmarked:R(ee),onChangeAssignment:()=>h(ee),onRemove:()=>g(ee),destinationName:O,isB2B:v,checkIn:q,checkOut:z,tripCurrency:L,convertPrice:H,plannedAccommodationPlaces:a,currentTrip:D,destinationId:l==null?void 0:l._id},N._id)})})})]})},Yw="___react_component_tooltip_69sgo_259",Kw="_show_69sgo_279",Xw="_tags__attribute_69sgo_283",Qw="_marker_69sgo_308",Jw="_SingleDatePickerInput__withBorder_69sgo_330",Zw="_DateInput_69sgo_330",ex="_DateInput_fang_69sgo_330",tx="_DateRangePickerInput_69sgo_331",nx="_SingleDatePicker_picker_69sgo_335",ox="_DateInput_fangShape_69sgo_340",rx="_DateInput_fangStroke_69sgo_344",ax="_DateRangePicker_picker_69sgo_348",sx="_active_69sgo_425",ix="_scrolled_69sgo_484",cx="_logo_69sgo_489",lx="_inversed_69sgo_515",dx="_editor_69sgo_526",_x="_spin_69sgo_2085",ux="_small_69sgo_638",fx="_count_69sgo_659",px="_error_69sgo_674",hx="_success_69sgo_683",mx="_label_69sgo_767",gx="_actions_69sgo_832",vx="_flag_69sgo_836",bx="_chip_69sgo_900",yx="_remove_69sgo_936",wx="_trip_69sgo_1053",xx="_sleep_69sgo_1056",kx="_todo_69sgo_1059",Sx="_cuisine_69sgo_1062",jx="_arrow_69sgo_1069",Cx="_checkmark_69sgo_1118",Ex="_notice_69sgo_1169",$x="_warning_69sgo_1180",Nx="_BrainhubCarousel__container_69sgo_1206",Tx="_BrainhubCarouselItem_69sgo_1209",Px="_BrainhubCarousel__customArrows_69sgo_1222",Ix="_save_69sgo_1372",Rx="_add_69sgo_1375",Mx="_distance_69sgo_1408",Ox="_placeholder_69sgo_1557",Ax="_content_69sgo_1628",Bx="_help_69sgo_1712",Lx="_help__button_69sgo_1726",Dx="_help__menu_69sgo_1754",Fx="_hidden_69sgo_1798",Hx="_meta_69sgo_1954",qx="_dates_69sgo_1962",Vx="_destination_69sgo_1853",zx="_articles_69sgo_1985",Wx="_acco_69sgo_1991",Ux="_days_69sgo_1994",Gx="_destinations_69sgo_1853",Yx="_spinner_69sgo_2085",Kx="_icon_69sgo_707",Xx="_grid_69sgo_2230",Qx="_tags_69sgo_283",Jx="_green_69sgo_2365",Zx="_orange_69sgo_2368",ek="_transparent_69sgo_2371",tk="_title_69sgo_2417",nk="_searchView_69sgo_2421",ok="_rateChangedBanner_69sgo_2430",rk="_body_69sgo_2450",ak="_fadeInTop_69sgo_1",Qo={"hotel-booking-flow":"_hotel-booking-flow_69sgo_20","ai-chat-open":"_ai-chat-open_69sgo_24","scroll-lock":"_scroll-lock_69sgo_119","sub-text":"_sub-text_69sgo_172","base-color1":"_base-color1_69sgo_177","base-primary-1":"_base-primary-1_69sgo_178","base-color2":"_base-color2_69sgo_186","base-primary-2":"_base-primary-2_69sgo_187","base-color3":"_base-color3_69sgo_195","base-primary-3":"_base-primary-3_69sgo_196","base-color4":"_base-color4_69sgo_204","base-primary-4":"_base-primary-4_69sgo_205","base-grey":"_base-grey_69sgo_213","base-bg1":"_base-bg1_69sgo_220","col-50":"_col-50_69sgo_224","react-confirm-alert":"_react-confirm-alert_69sgo_233","react-confirm-alert-overlay":"_react-confirm-alert-overlay_69sgo_233","react-confirm-alert-body":"_react-confirm-alert-body_69sgo_237","react-confirm-alert-button-group":"_react-confirm-alert-button-group_69sgo_251",__react_component_tooltip:Yw,"type-error":"_type-error_69sgo_269",show:Kw,tags__attribute:Xw,marker:Qw,"open-up":"_open-up_69sgo_330",SingleDatePickerInput__withBorder:Jw,DateInput:Zw,DateInput_fang:ex,DateRangePickerInput:tx,SingleDatePicker_picker:nx,DateInput_fangShape:ox,DateInput_fangStroke:rx,DateRangePicker_picker:ax,"profile-settings-menu":"_profile-settings-menu_69sgo_355","dropdown-toggle":"_dropdown-toggle_69sgo_363","user-menu":"_user-menu_69sgo_406",active:sx,"link-account":"_link-account_69sgo_453","mobile-bar":"_mobile-bar_69sgo_474",scrolled:ix,logo:cx,"menu-icon":"_menu-icon_69sgo_492","page-title":"_page-title_69sgo_498",inversed:lx,editor:dx,"editor-toolbar":"_editor-toolbar_69sgo_532","rdw-option-wrapper":"_rdw-option-wrapper_69sgo_543","rdw-option-active":"_rdw-option-active_69sgo_549","rdw-dropdown-wrapper":"_rdw-dropdown-wrapper_69sgo_563","rdw-link-modal":"_rdw-link-modal_69sgo_566","rdw-link-modal-target-option":"_rdw-link-modal-target-option_69sgo_577","rdw-link-modal-buttonsection":"_rdw-link-modal-buttonsection_69sgo_585","editor-textarea":"_editor-textarea_69sgo_592","public-DraftEditorPlaceholder-root":"_public-DraftEditorPlaceholder-root_69sgo_605","rdw-link-decorator-wrapper":"_rdw-link-decorator-wrapper_69sgo_609","submit-row":"_submit-row_69sgo_614",spin:_x,"total-planned":"_total-planned_69
40sgo_628","circle-progressbar":"_circle-progressbar_69sgo_634",small:ux,"CircularProgressbar-background":"_CircularProgressbar-background_69sgo_644","CircularProgressbar-path":"_CircularProgressbar-path_69sgo_650","CircularProgressbar-trail":"_CircularProgressbar-trail_69sgo_653",count:fx,error:px,success:hx,"error-in-plan":"_error-in-plan_69sgo_689","icon-rounded":"_icon-rounded_69sgo_707","img-placeholder":"_img-placeholder_69sgo_724","custom-tooltip":"_custom-tooltip_69sgo_762",label:mx,"nothing-there":"_nothing-there_69sgo_803",actions:gx,flag:vx,"quick-menu__horizontal":"_quick-menu__horizontal_69sgo_851","icon-circle":"_icon-circle_69sgo_867","delete-research":"_delete-research_69sgo_890",delete:"_delete_69sgo_890",chip:bx,remove:yx,"multi-action-btn":"_multi-action-btn_69sgo_959","hover-btn":"_hover-btn_69sgo_963","bottom-align":"_bottom-align_69sgo_968","right-align":"_right-align_69sgo_1010",trip:wx,sleep:xx,todo:kx,cuisine:Sx,arrow:jx,"select-box":"_select-box_69sgo_1078",checkmark:Cx,"react-read-more-read-less":"_react-read-more-read-less_69sgo_1153",notice:Ex,warning:$x,"notice-callout":"_notice-callout_69sgo_1184",BrainhubCarousel__container:Nx,BrainhubCarouselItem:Tx,BrainhubCarousel__customArrows:Px,"BrainhubCarousel__custom-arrowLeft":"_BrainhubCarousel__custom-arrowLeft_69sgo_1226","BrainhubCarousel__arrow--disable":"_BrainhubCarousel__arrow--disable_69sgo_1281","carousel-card":"_carousel-card_69sgo_1285","carousel-card__image":"_carousel-card__image_69sgo_1293","carousel-card__badge":"_carousel-card__badge_69sgo_1298","--label":"_--label_69sgo_1314","carousel-card__background":"_carousel-card__background_69sgo_1334","carousel-card__actions":"_carousel-card__actions_69sgo_1347",save:Ix,add:Rx,"in-research":"_in-research_69sgo_1394","carousel-card__title":"_carousel-card__title_69sgo_1400",distance:Mx,"in-plan":"_in-plan_69sgo_1429","in-plan--inspire":"_in-plan--inspire_69sgo_1456","carousel-card__metadata":"_carousel-card__metadata_69sgo_1477","carousel-card--article":"_carousel-card--article_69sgo_1500","carousel-card--tour":"_carousel-card--tour_69sgo_1503","carousel-card--destination":"_carousel-card--destination_69sgo_1506","carousel-card--itinerary":"_carousel-card--itinerary_69sgo_1509",placeholder:Ox,"react-router-modal__modal":"_react-router-modal__modal_69sgo_1568","rounded-modal":"_rounded-modal_69sgo_1568","img-wrapper":"_img-wrapper_69sgo_1574","image-placeholder":"_image-placeholder_69sgo_1583","cta-signup":"_cta-signup_69sgo_1613",content:Ax,"btn-rounded":"_btn-rounded_69sgo_1670","mobile-banner":"_mobile-banner_69sgo_1675","typeform-sidetab-button":"_typeform-sidetab-button_69sgo_1698","tf-v1-sidetab-button":"_tf-v1-sidetab-button_69sgo_1699","typeform-sidetab-button-text":"_typeform-sidetab-button-text_69sgo_1703","tf-v1-sidetab-button-text":"_tf-v1-sidetab-button-text_69sgo_1704",help:Bx,help__button:Lx,help__menu:Dx,"create-ticket":"_create-ticket_69sgo_1754","text-link":"_text-link_69sgo_1795",hidden:Fx,"partner-action-btn":"_partner-action-btn_69sgo_1802","destinations-table":"_destinations-table_69sgo_1853","destinations-table__wrapper":"_destinations-table__wrapper_69sgo_1856","destinations-table__wrapper--collapsed":"_destinations-table__wrapper--collapsed_69sgo_1861","destinations-table__fade-overlay":"_destinations-table__fade-overlay_69sgo_1872","destinations-table__expand-section":"_destinations-table__expand-section_69sgo_1882",meta:Hx,dates:qx,destination:Vx,articles:zx,acco:Wx,days:Ux,"day-label":"_day-label_69sgo_2009","day-number":"_day-number_69sgo_2012","day-separator":"_day-separator_69sgo_2017","day-city":"_day-city_69sgo_2020","travel-day":"_travel-day_69sgo_2032",destinations:Gx,"info-tooltip":"_info-tooltip_69sgo_2062","carousel-section":"_carousel-section_69sgo_2076","spinner-wrapper":"_spinner-wrapper_69sgo_2085",spinner:Yx,"carousel-section__title":"_carousel-section__title_69sgo_2113",icon:Kx,"carousel-section__list":"_carousel-section__list_69sgo_2190","--trips":"_--trips_69sgo_2208","--continent-section":"_--continent-section_69sgo_2221","discover-section__list":"_discover-section__list_69sgo_2221","more-card":"_more-card_69sgo_2221",grid:Xx,"col-2":"_col-2_69sgo_2235","col-3":"_col-3_69sgo_2238","col-4":"_col-4_69sgo_2246",tags:Qx,"ReactModal__Body--open":"_ReactModal__Body--open_69sgo_2283","simple-modal":"_simple-modal_69sgo_2291","bottom-modal":"_bottom-modal_69sgo_2296","ReactModal__Overlay--after-open":"_ReactModal__Overlay--after-open_69sgo_2312","ReactModal__Overlay--before-close":"_ReactModal__Overlay--before-close_69sgo_2315","popup-modal":"_popup-modal_69sgo_2318","ReactModal__Content--after-open":"_ReactModal__Content--after-open_69sgo_2330","ReactModal__Content--before-close":"_ReactModal__Content--before-close_69sgo_2333",green:Jx,orange:Zx,transparent:ek,"transport-options__placeholder":"_transport-options__placeholder_69sgo_2375","text-button":"_text-button_69
40sgo_2411",title:tk,searchView:nk,rateChangedBanner:ok,body:rk,"beacon-green":"_beacon-green_69sgo_1","beacon-orange":"_beacon-orange_69sgo_1","beacon-purple":"_beacon-purple_69sgo_1","beacon-magenta":"_beacon-magenta_69sgo_1",fadeInTop:ak};function sk(e,t){return e?String(e.gross_price)!==String(t.gross_price)||String(e.price_per_night??"")!==String(t.price_per_night??"")||(e.currency??"")!==(t.currency??"")||String(e.ssp??"")!==String(t.ssp??"")||String(e.pro??"")!==String(t.pro??""):!0}function qs(e,t,n,o){if(!t||!n)return e;const s=e.findIndex(c=>String(c.hotel_id)===String(t));if(s===-1)return e;const i=e[s];if(!sk(i.price,n))return e;const a=[...e];return a[s]={...i,price:n,...o&&o.length>0?{roomTypes:o}:{}},a}const Vs=2;function ik(e,t){const n=e.pickRank??Vs,o=t.pickRank??Vs;return n-o}const uo=25,ck=["TOP_PICKS","PRICE_LOW_TO_HIGH","PRICE_HIGH_TO_LOW","REVIEW_SCORE","STAR_RATING","BEST_DISCOUNT"],so=e=>e?e.split(",").filter(Boolean):[],lk=e=>(e?e.split(","):[]).map(t=>Number(t)).filter(t=>Number.isFinite(t)),Sn=e=>{if(e==null)return null;const t=Number(e);return Number.isFinite(t)?t:null},pc=e=>{const t=new URLSearchParams(e),n={};let o=!1;const s=t.get("p");if(s){const[M,x]=s.split("-"),P=Number(M),I=x==="Infinity"?1/0:Number(x);Number.isFinite(P)&&(n.priceMin=P,o=!0),(I===1/0||Number.isFinite(I))&&(n.priceMax=I,o=!0)}const i=so(t.get("at"));i.length&&(n.accommodationTypes=i,o=!0);const a=so(t.get("f"));a.length&&(n.facilities=a,o=!0);const c=so(t.get("ra"));c.length&&(n.roomAmenities=c,o=!0);const l=so(t.get("sl"));l.length&&(n.savedLists=l,o=!0);const d=lk(t.get("sr"));d.length&&(n.starRatings=d,o=!0),t.get("fc")==="1"&&(n.freeCancellation=!0,o=!0),t.get("bi")==="1"&&(n.breakfastIncluded=!0,o=!0);const u=Sn(t.get("mrs"));u!=null&&u>0&&(n.minReviewScore=u,o=!0);const p=t.get("s");let h;p&&ck.includes(p)&&(h=p,o=!0);const g=Sn(t.get("o")),m=g!=null&&g>0?Math.floor(g):void 0;m&&(o=!0);const v=Sn(t.get("lat")),j=Sn(t.get("lng")),S=Sn(t.get("z"));let _,$;return v!=null&&j!=null&&S!=null&&(_=[j,v],$=S,o=!0),{filters:n,sortBy:h,offset:m,mapCenter:_,mapZoom:$,hasAny:o}},dk=()=>{if(typeof window>"u")return uo;const{offset:e}=pc(window.location.search);return e&&e>uo?e:uo},_k=({displayCount:e,setDisplayCount:t,currentDestinationId:n})=>{const{state:o,dispatch:s}=bn(),{filters:i,sortBy:a,searchTab:c}=o,l=$r(),d=Ec(),u=f.useRef({filters:i,sortBy:a,displayCount:e,searchTab:c});u.current={filters:i,sortBy:a,displayCount:e,searchTab:c};const p=f.useRef(null),h=f.useRef(!1),g=f.useRef(null),m=f.useRef(l);m.current=l;const v=()=>{if(!h.current)return;const{filters:_,sortBy:$,displayCount:M,searchTab:x}=u.current,P=new URLSearchParams;if(_.priceMin!==fo.priceMin||_.priceMax!==fo.priceMax){const H=_.priceMax===1/0?"Infinity":String(_.priceMax);P.set("p",`${_.priceMin}-${H}`)}if($&&$!=="TOP_PICKS"&&P.set("s",$),_.accommodationTypes.length&&P.set("at",_.accommodationTypes.join(",")),_.facilities.length&&P.set("f",_.facilities.join(",")),_.starRatings.length&&P.set("sr",_.starRatings.join(",")),_.roomAmenities.length&&P.set("ra",_.roomAmenities.join(",")),_.savedLists.length&&P.set("sl",_.savedLists.join(",")),_.freeCancellation&&P.set("fc","1"),_.breakfastIncluded&&P.set("bi","1"),_.minReviewScore>0&&P.set("mrs",String(_.minReviewScore)),M>uo&&P.set("o",String(M)),p.current){const{center:H,zoom:b}=p.current;P.set("lat",H[1].toFixed(5)),P.set("lng",H[0].toFixed(5)),P.set("z",b.toFixed(2))}const I=P.toString(),R=x==="intrip"?"#intrip":"",L=window.location.search.replace(/^\?/,""),D=window.location.hash;I===L&&R===D||m.current.replace({pathname:window.location.pathname,search:I?`?${I}`:"",hash:R,state:m.current.location.state})},j=()=>{g.current&&clearTimeout(g.current),g.current=setTimeout(v,250)};f.useEffect(()=>{if(h.current)return;h.current=!0;const _=pc(window.location.search),$=window.location.hash==="#intrip";!_.hasAny&&!$||((Object.keys(_.filters).length>0||_.sortBy)&&s({type:"RESTORE_FROM_URL",filters:_.filters,sortBy:_.sortBy}),$&&s({type:"SET_SEARCH_TAB",tab:"intrip"}),_.offset&&_.offset>e&&t(_.offset),_.mapCenter&&typeof _.mapZoom=="number"&&(p.current={center:_.mapCenter,zoom:_.mapZoom},window.dispatchEvent(new CustomEvent("map-restore-viewport",{detail:{center:_.mapCenter,zoom:_.mapZoom}}))))},[]),f.useEffect(()=>{const _=$=>{const M=$.detail;M!=null&&M.center&&typeof M.zoom=="number"&&(p.current={center:M.center,zoom:M.zoom},j())};return window.addEventListener("map-bounds-change",_),()=>window.removeEventListener("map-bounds-change",_)},[]);const S=f.useRef(n);f.useEffect(()=>{S.current&&S.current!==n&&(p.current=null,l.replace({pathname:d.pathname,search:"",hash:d.hash})),S.current=n},[n]),f.useEffect(()=>(j(),()=>{g.current&&clearTimeout(g.current)}),[i.priceMin,i.priceMax,i.freeCancellation,i.breakfastIncluded,i.minReviewScore,a,c,e,i.accommodationTypes.join(","),i.facilities.join(","),i.starRatings.join(","),i.roomAmenities.join(","),i.savedLists.join(",")])},uk=e=>{var o;const t=(o=e==null?void 0:e.price)==null?void 0:o.gross_price;if(typeof t!="string"||!t)return null;const n=parseFloat(t);return Number.isFinite(n)?n:null},fk=e=>{var n;const t=(n=e==null?void 0:e.price)==null?void 0:n.proSaving;return typeof t=="number"&&Number.isFinite(t)?t:null},io=e=>(t,n)=>{const o=e(t),s=e(n);return o==null&&s==null?0:o==null?1:s==null?-1:s-o},pk={PRICE_HIGH_TO_LOW:io(uk),REVIEW_SCORE:io(e=>typeof(e==null?void 0:e.review_score)=="number"?e.review_score:null),STAR_RATING:io(e=>typeof(e==null?void 0:e.hotel_class)=="number"?e.hotel_class:null),BEST_DISCOUNT:io(fk)},hk=1,mk=.5,gk=e=>{const t=e==null?void 0:e.distanceFromCentreKm;return typeof t=="number"&&Number.isFinite(t)?t:null},zs=e=>{const t=e==null?void 0:e.arrivalIndex;return typeof t=="number"&&Number.isFinite(t)?t:Number.POSITIVE_INFINITY},vk=(e,t={popularity:hk,distance:mk})=>{const n=e.map((u,p)=>({hotel:u,index:p,distance:gk(u)})).filter(u=>u.distance!=null);if(n.length<2)return e;const o=[...n].sort((u,p)=>zs(u.hotel)-zs(p.hotel)),s=new Map;o.forEach((u,p)=>s.set(u.index,p));const i=[...n].sort((u,p)=>u.distance-p.distance),a=new Map;
40i.forEach((u,p)=>a.set(u.index,p));const c=n.map(u=>{const p=s.get(u.index)??0,h=a.get(u.index)??0;return{hotel:u.hotel,popularityRank:p,score:t.popularity*p+t.distance*h}}).sort((u,p)=>u.score-p.score||u.popularityRank-p.popularityRank),l=new Set(n.map(u=>u.index));let d=0;return e.map((u,p)=>l.has(p)?c[d++].hotel:u)},jo=(e,t)=>{if(!Array.isArray(e)||e.length<2)return e;if(t==="TOP_PICKS")return vk(e);const n=t?pk[t]:void 0;return n?[...e].sort(n):e},bk=5*60*1e3,Ws=new Map;function Us(e){const t=[],n=e.split(` 41 42`),o=n.pop()||"";for(const s of n){if(!s.trim())continue;let i,a="";for(const c of s.split(` 43`))c.startsWith("event: ")?i=c.slice(7).trim():c.startsWith("data: ")?a+=c.slice(6):c.startsWith("data:")&&(a+=c.slice(5));a&&t.push({event:i,data:a})}return{events:t,remaining:o}}function yk(e,t){const[n,o]=f.useState([]),[s,i]=f.useState(!1),[a,c]=f.useState(null),[l,d]=f.useState(0),u=f.useRef(null),p=e?JSON.stringify(e):"",h=f.useCallback(async(g,m,v)=>{var _,$,M;const j=Ws.get(v);if(j&&Date.now()-j.ts<bk){o(j.results),c(j.facets),d(j.totalCount),i(!1),console.log(`[HotelStream] Cache hit for ${v.slice(0,60)}â¦`);return}const S=performance.now();o([]),c(null),d(0),i(!0);try{const x=await(($=(_=$c)==null?void 0:_.currentUser)==null?void 0:$.getIdToken());if(!x){console.warn("[HotelStream] No auth token available"),i(!1);return}const P=performance.now(),I=await fetch("/api/hotels/search-stream",{method:"POST",headers:{"Content-Type":"application/json",Authorization:x},body:JSON.stringify(g),signal:m}),R=performance.now();if(!I.ok){const k=await I.text().catch(()=>"");console.error("[HotelStream] Search failed:",I.status,k),i(!1);return}const L=(M=I.body)==null?void 0:M.getReader();if(!L){console.error("[HotelStream] No response body"),i(!1);return}const D=new TextDecoder;let H="",b=0,y=[];for(;;){const{done:k,value:T}=await L.read();if(k)break;H+=D.decode(T,{stream:!0});const{events:O,remaining:q}=Us(H);H=q;for(const z of O)if(z.event==="hotels")try{const W=JSON.parse(z.data).hotels||[];W.length>0&&(b||(b=performance.now(),console.log(`[HotelStream] FRONTEND auth=${Math.round(P-S)}ms connect=${Math.round(R-P)}ms first_results=${Math.round(b-S)}ms`)),y=jo([...y,...W],g.sort),o(y))}catch(V){console.warn("[HotelStream] Failed to parse hotels event:",V)}else if(z.event==="hotels-update")try{const W=JSON.parse(z.data).hotels||[];W.length>0&&(y=jo(W,g.sort),o(y))}catch(V){console.warn("[HotelStream] Failed to parse hotels-update event:",V)}else if(z.event==="done")try{const V=JSON.parse(z.data),W=V.facets||null,te=V.totalCount||0;c(W),d(te),console.log(`[HotelStream] FRONTEND total=${Math.round(performance.now()-S)}ms`),y.length>0&&Ws.set(v,{results:y,facets:W,totalCount:te,ts:Date.now()})}catch(V){console.warn("[HotelStream] Failed to parse done event:",V)}else if(z.event==="error")try{const V=JSON.parse(z.data);console.error("[HotelStream] Server error:",V.error)}catch{console.error("[HotelStream] Server error (unparseable)")}}if(H.trim()){const{events:k}=Us(H+` 44 45`);for(const T of k)if(T.event==="done")try{const O=JSON.parse(T.data);c(O.facets||null),d(O.totalCount||0)}catch{}}}catch(x){if((x==null?void 0:x.name)==="AbortError")return;console.error("[HotelStream] Unexpected error:",(x==null?void 0:x.message)||x)}finally{m.aborted||i(!1)}},[]);return f.useEffect(()=>{var m;if(t||!e){o([]),i(!1);return}(m=u.current)==null||m.abort();const g=new AbortController;return u.current=g,h(e,g.signal,p),()=>{g.abort()}},[p,t,h]),{results:n,loading:s,facets:a,totalCount:l}}const wk=({match:e,currentDestination:t,onSelectRooms:n,onAdd:o,onChangeAssignment:s,onRemove:i,isB2B:a,searchTrigger:c,onAddCustomStay:l,onSaveToList:d})=>{var He;const{state:u,dispatch:p,entryLocation:h}=bn(),g=Vt(),{filters:m,sortBy:v,searchParams:j,searchTab:S,searchVersion:_,rateChangedMessage:$,lastFilterEvent:M}=u,{lists:x}=Po({tripId:(He=e==null?void 0:e.params)==null?void 0:He.id}),{currentTrip:P,tripBookingGuard:I}=rt();f.useEffect(()=>{zc()},[]);const[R,L]=f.useState(null),[D,H]=f.useState(null);f.useEffect(()=>{const J=ne=>L(ne.detail);return window.addEventListener("hotel-search-area",J),()=>window.removeEventListener("hotel-search-area",J)},[]),f.useEffect(()=>{L(null),H(null)},[t==null?void 0:t._id]);const[b,y]=f.useState({startDate:j.checkIn||(t==null?void 0:t.startDate),endDate:j.checkOut||(t==null?void 0:t.endDate),guests:j.guests||2,rooms:j.rooms||1,currency:j.currency}),k=f.useCallback(J=>{y(ne=>{const ie=typeof J=="function"?J(ne):J;return p({type:"SET_COMMITTED_PARAMS",params:ie}),ie})},[p]);f.useEffect(()=>{k({startDate:j.checkIn||(t==null?void 0:t.startDate),endDate:j.checkOut||(t==null?void 0:t.endDate),guests:j.guests||2,rooms:j.rooms||1,currency:j.currency}),L(null)},[c]);const T=f.useRef(!1);f.useEffect(()=>{if(T.current)return;const J=j.checkIn||(t==null?void 0:t.startDate),ne=j.checkOut||(t==null?void 0:t.endDate);!J||!ne||(T.current=!0,k(ie=>({...ie,startDate:J,endDate:ne,guests:ie.guests||j.guests||2,rooms:ie.rooms||j.rooms||1,currency:ie.currency||j.currency})))},[j.checkIn,j.checkOut,j.guests,j.rooms,j.currency,t==null?void 0:t.startDate,t==null?void 0:t.endDate]),f.useEffect(()=>{j.currency&&j.currency!==b.currency&&k(J=>({...J,currency:j.currency}))},[j.currency]);const O=f.useRef(b.currency);f.useEffect(()=>{const J=O.current,ne=b.currency;O.current=ne,J&&ne&&J!==ne&&p({type:"SET_FILTERS",filters:{priceMin:fo.priceMin,priceMax:fo.priceMax},source:"programmatic"})},[b.currency,p]);const q=b.startDate&&b.endDate&&b.startDate!==b.endDate,z=!!t&&!t._id,V=!!(t!=null&&t._id)||z&&t.latitude!=null&&t.longitude!=null,W=String(j.query||"").trim(),te=f.useRef(!0),E=f.useRef(void 0),B=f.useRef(!0),G=f.useRef("search"),N=f.useRef(!1);f.useEffect(()=>{if(te.current){te.current=!1;return}if(!V||!q)return;const J=R?"map_area":"search";G.current=J,E.current=Date.now(),B.current=!1;try{Ke("hotel_search_performed",{sort_context:v,filters:m,trigger:J,city:t==null?void 0:t.city,entry_location:h},"hotel_search")}catch(ne){console.error("[HotelBooking] Failed to track hotel_search_performed:",{error:(ne==null?void 0:ne.message)||ne})}},[c,R,W]);const K=f.useMemo(()=>
45{if(!V||!q)return null;const J={};if(D){const he=D.accommodationTypes.filter(me=>me!=="Other");he.length>0&&(J.accommodationTypes=he),D.facilities.length>0&&(J.facilities=D.facilities),D.starRatings.length>0&&(J.starRatings=D.starRatings)}const ne=String(j.query||"").trim(),ie=!!ne&&ne.toLowerCase()!==((t==null?void 0:t.city)||"").trim().toLowerCase();return{...t!=null&&t._id?{destinationId:t._id}:{},startDate:b.startDate,endDate:b.endDate,guests:b.guests,rooms:b.rooms,...b.currency&&{currency:b.currency},...Object.keys(J).length>0&&{filters:J},...ie&&{query:ne},...R&&!ie?{latitude:R.latitude,longitude:R.longitude,radius:R.radius}:z?{latitude:t.latitude,longitude:t.longitude,city:t.city}:{},_version:_}},[t==null?void 0:t._id,t==null?void 0:t.city,t==null?void 0:t.latitude,t==null?void 0:t.longitude,z,V,b,j.query,_,R,D]),{results:ee,loading:se,facets:je,totalCount:be}=yk(K,!V||!q);f.useEffect(()=>{const J=N.current;if(N.current=se,!V||!q||B.current||!J||se)return;B.current=!0;const ne=E.current!=null?Date.now()-E.current:0;try{Ke("hotel_search_completed",Wc({resultCount:ee.length,trigger:G.current,city:t==null?void 0:t.city,sortContext:v,durationMs:ne}),"hotel_search")}catch(ie){console.error("[HotelBooking] Failed to track hotel_search_completed:",{error:(ie==null?void 0:ie.message)||ie})}},[se]);const[ge,re]=f.useState({});f.useEffect(()=>{re({})},[K]),f.useEffect(()=>{const J=ne=>{const{hotelId:ie,price:he,roomTypes:me}=ne.detail||{};!ie||!he||re(F=>({...F,[String(ie)]:{price:he,roomTypes:me}}))};return window.addEventListener("hotel-rates-refreshed",J),()=>window.removeEventListener("hotel-rates-refreshed",J)},[]);const U=f.useMemo(()=>Io((t==null?void 0:t.places)||[],"accommodation"),[t==null?void 0:t.places]),we=b.startDate&&b.endDate?vo(b.endDate).diff(vo(b.startDate),"day"):1,Se=f.useRef(U);Se.current=U;const $e=f.useMemo(()=>L_(U,P,I.activeBookings,we),[U,P,I.activeBookings,we]),Ae=f.useMemo(()=>{const J=Object.keys(ge),ne=Array.from($e.keys());if(J.length===0&&ne.length===0)return ee;let ie=J.reduce((he,me)=>qs(he,me,ge[me].price,ge[me].roomTypes),ee);return ie=ne.reduce((he,me)=>qs(he,me,$e.get(me)),ie),ie},[ee,ge,$e]);f.useEffect(()=>{p({type:"SET_SEARCH_RESULTS",results:Ae,totalCount:be,hasMore:!1})},[Ae,be,p]);const Fe=f.useMemo(()=>{if(!m.savedLists.length||!(x!=null&&x.length))return null;const J=new Set;for(const ne of x)if(m.savedLists.includes(ne._id))for(const ie of ne.items||[])ie._id&&J.add(String(ie._id)),ie.externalId&&J.add(String(ie.externalId)),ie.googlePlaceId&&J.add(String(ie.googlePlaceId));return J.size>0?J:null},[m.savedLists,x]),ce=f.useMemo(()=>{let J=Ae;if(Fe&&(J=J.filter(ne=>[ne.hotel_id,ne.key].filter(Boolean).map(String).some(he=>Fe.has(he)))),(m.priceMin>0||m.priceMax<1/0)&&(J=J.filter(ne=>{var he,me;const ie=Number(((he=ne.price)==null?void 0:he.price_per_night)??((me=ne.price)==null?void 0:me.gross_price))||null;return ie==null?!0:ie>=m.priceMin&&ie<=m.priceMax})),m.freeCancellation&&(J=J.filter(ne=>ne.free_cancellation===!0)),m.breakfastIncluded){const ne=new Set(["BB","BI","CB","HB","FB","AI"]),ie=he=>{if(!he)return!1;const me=he.toUpperCase();if(ne.has(me))return!0;const F=he.toLowerCase();return F.includes("breakfast")||F.includes("half board")||F.includes("full board")||F.includes("all inclusive")};J=J.filter(he=>{var me;return(me=he.roomTypes)==null?void 0:me.some(F=>{var oe;return ie(F.boardType)||ie(F.boardName)||((oe=F.rates)==null?void 0:oe.some(le=>ie(le.boardType)||ie(le.boardName)))})})}if(m.facilities.length>0&&(J=J.filter(ne=>m.facilities.every(ie=>{var he;return(he=ne.facilities)==null?void 0:he.some(me=>me.toLowerCase()===ie.toLowerCase())}))),m.accommodationTypes.length>0){const ne=m.accommodationTypes.includes("Other"),ie=new Set(m.accommodationTypes.filter(he=>he!=="Other").map(he=>he.toLowerCase()));J=J.filter(he=>he.hotelType?ie.has(he.hotelType.toLowerCase()):ne)}return m.roomAmenities.length>0&&(J=J.filter(ne=>m.roomAmenities.every(ie=>{var he;return(he=ne.roomTypes)==null?void 0:he.some(me=>{var F;return(F=me.amenities)==null?void 0:F.some(oe=>oe.toLowerCase()===ie.toLowerCase())})}))),m.minReviewScore>0&&(J=J.filter(ne=>(ne.review_score||0)>=m.minReviewScore)),m.starRatings.length>0&&(J=J.filter(ne=>m.starRatings.includes(ne.hotel_class||0))),v==="PRICE_LOW_TO_HIGH"?J=[...J].sort((ne,ie)=>{var he,me;return(Number((he=ne.price)==null?void 0:he.gross_price)||0)-(Number((me=ie.price)==null?void 0:me.gross_price)||0)}):v==="TOP_PICKS"?J=[...jo(J,v)].sort(ik):J=jo(J,v),J},[Ae,m.priceMin,m.priceMax,m.freeCancellation,m.breakfastIncluded,m.accommodationTypes.join(","),m.facilities.join(","),m.roomAmenities.join(","),m.minReviewScore,m.starRatings.join(","),v,Fe]),Pe=f.useRef(M);f.useEffect(()=>{if(M!==Pe.current&&(Pe.current=M,!!Uc(M)))try{Ke("hotel_search_refined",Gc({change:M.change,sortContext:v,filters:m,resultCount:ce.length}),"hotel_search")}catch(J){console.error("[HotelBooking] Failed to track hotel_search_refined:",{error:(J==null?void 0:J.message)||J})}},[M]);const[xe,Ve]=f.useState(null),[Ye,_e]=f.useState(!1);f.useEffect(()=>{_e(!1)},[c,R,W]),f.useEffect(()=>{const J=ne=>Ve(ne.detail);return window.addEventListener("map-bounds-change",J),()=>window.removeEventListener("map-bounds-change",J)},[]);const ve=f.useMemo(()=>Ye||!xe||S==="intrip"?ce:zw(ce,xe),[ce,xe,S,Ye]),A=Fw(Ye,ce.length,ve.length),w=25,[X,Q]=f.useState(()=>dk());_k({displayCount:X,setDisplayCount:Q,currentDestinationId:t==null?void 0:t._id});const ue=`${m.priceMin}-${m.priceMax}-${v}-${m.accommodationTypes.join(",")}-${m.facilities.join(",")}-${m.starRatings.join(",")}-${m.freeCancellation}-${m.breakfastIncluded}-${m.roomAmenities.join(",")}-${m.minReviewScore}-${xe==null?void 0:xe.west}-${xe==null?void 0:xe.south}-${xe==null?void 0:xe.east}-${xe==null?void 0:xe.north}`,Y=f.useRef(ue),fe=f.useRef(!0);ue!==Y.current&&(Y.current=ue,fe.current?fe.current=!1:X!==w&&Q(w));const ye=f.useMemo(()=>ve.slice(0,X),[ve,X]),Ue=X<ve.length,Be=f.useMemo(()=>
45{if(!(m.accommodationTypes.length+m.facilities.length+m.starRatings.length>0)||Ae.length===0)return!1;const ne=he=>he?[[...he.accommodationTypes].sort().join(","),[...he.facilities].sort().join(","),[...he.starRatings].sort((me,F)=>me-F).join(",")].join("|"):"";return ne({accommodationTypes:m.accommodationTypes,facilities:m.facilities,starRatings:m.starRatings})!==ne(D)},[m.accommodationTypes,m.facilities,m.starRatings,Ae.length,D]),C=f.useCallback(()=>{X<ve.length&&Q(J=>Math.min(J+w,ve.length))},[X,ve.length]),ae=f.useRef(ee);f.useEffect(()=>{const J=ne=>{const ie=ne.latitude||ne.lat,he=ne.longitude||ne.lng;return ie&&he&&!isNaN(Number(ie))&&!isNaN(Number(he))&&Math.abs(Number(ie))<=90&&Math.abs(Number(he))<=180};if(S==="intrip"){const ne=(Se.current||[]).filter(J);g(Qt(ne))}else{const ne=ae.current===ee;ae.current=ee,(R||ne&&ee.length>0)&&window.dispatchEvent(new CustomEvent("skip-next-fit-bounds"));const me=(!ne&&!R?ce.slice(0,X):ye).filter(J).map(F=>({...F,_searchNights:we||1,_searchGuests:b.guests||2}));g(Qt(me))}},[Ae,ee,ye,ce,X,S,g,we,b.guests,R]);const Ne=R?R.latitude:t==null?void 0:t.latitude,Xe=R?R.longitude:t==null?void 0:t.longitude;f.useEffect(()=>{const J=S!=="intrip";return window.dispatchEvent(new CustomEvent("hotel-search-mode-change",{detail:{active:J,anchorLat:Ne,anchorLng:Xe}})),()=>{window.dispatchEvent(new CustomEvent("hotel-search-mode-change",{detail:{active:!1}}))}},[S,Ne,Xe]),f.useEffect(()=>{if(!$)return;const J=setTimeout(()=>p({type:"CLEAR_RATE_CHANGED_MESSAGE"}),6e3);return()=>clearTimeout(J)},[$,p]);const[at,st]=f.useState(!1);return f.useEffect(()=>{const J=ne=>{var ie;return st(!!((ie=ne.detail)!=null&&ie.expanded))};return window.addEventListener("hotel-search-toggle-expand",J),()=>window.removeEventListener("hotel-search-toggle-expand",J)},[]),f.useEffect(()=>{const J=document.querySelector(".left-panel"),ne=document.querySelector(".side_modal_large");if(!(!J||!ne))return J.classList.toggle("w-sidebar",at),ne.classList.toggle("w-sidebar",at),()=>{J.classList.remove("w-sidebar"),ne.classList.remove("w-sidebar")}},[at]),r.jsxs("div",{className:Qo.searchView,children:[$&&r.jsxs("div",{className:Qo.rateChangedBanner,children:[r.jsx("span",{children:$}),r.jsx("button",{type:"button",onClick:()=>p({type:"CLEAR_RATE_CHANGED_MESSAGE"}),children:"â"})]}),r.jsxs("div",{className:Qo.body,children:[r.jsx(dm,{searchResults:Ae,facets:je}),!at&&r.jsx(Gw,{results:ye,totalCount:be,hiddenByMapCount:A,onShowAllOutsideMap:()=>_e(!0),hasMore:Ue,loading:se,plannedAccommodationPlaces:U,bookedResultPrices:$e,currentDestination:t,isGuestDestination:z,onSelectRooms:n,onAdd:o,onChangeAssignment:s,onRemove:i,onFetchMore:C,isB2B:a,canSearchMore:Be,onSearchMore:()=>H({accommodationTypes:[...m.accommodationTypes],facilities:[...m.facilities],starRatings:[...m.starRatings]}),onAddCustomStay:l,onSaveToList:d})]})]})};const xk=({match:e,setModalIsOpen:t,setSelectedPlace:n,onSaveToList:o,isB2B:s,guestDestination:i,initialGuests:a})=>{var J,ne,ie,he,me;const c=Vt(),l=$r(),{state:d,dispatch:u}=bn(),{currentDestination:p,currentTrip:h,addOrRemoveDestinationPlace:g,isPlaceInCurrentTrip:m,travelParty:v,tripCurrency:j}=rt(),S=Pr(),_=i||p,$=!!i,{data:M}=At(Kc,{fetchPolicy:"cache-first"}),x=(M==null?void 0:M.listsWithItems)||[],[P,I]=f.useState([]);f.useEffect(()=>{new URLSearchParams(window.location.search).get("redirect_status")==="succeeded"&&sessionStorage.getItem("hotel_payment_checkout")&&u({type:"SET_VIEW",view:"checkout"})},[u]);const R=f.useRef((J=l.location.state)==null?void 0:J.autoSelectSearchParams),L=_==null?void 0:_.city,D=_==null?void 0:_.startDate,H=_==null?void 0:_.endDate;f.useEffect(()=>{if(D&&H){const F=kd(R.current,{startDate:D,endDate:H});if(F){const{formattedDate:oe}=un(F.checkIn),{formattedDate:le}=un(F.checkOut);if(oe&&le){u({type:"SET_SEARCH_PARAMS",params:{checkIn:oe,checkOut:le,destination:L??""}});return}}u({type:"SET_SEARCH_PARAMS",params:{destination:L??""}})}},[L,D,H]),f.useEffect(()=>{const F=oe=>{const{guests:le,rooms:Re}=oe.detail;u({type:"SET_SEARCH_PARAMS",params:{guests:le,rooms:Re}})};return window.addEventListener("hotel-guest-room-change",F),()=>window.removeEventListener("hotel-guest-room-change",F)},[u]),f.useEffect(()=>{window.dispatchEvent(new CustomEvent("hotel-guest-room-change",{detail:{guests:d.searchParams.guests,rooms:d.searchParams.rooms}}))},[d.searchParams.guests,d.searchParams.rooms]);const{user:b}=lt(),y=S&&((ne=h==null?void 0:h.pricing)==null?void 0:ne.currency)||(b==null?void 0:b.currency);f.useEffect(()=>{y&&u({type:"SET_SEARCH_PARAMS",params:{currency:y}})},[y,u]);const{labels:k}=Xc(),{createExpense:T,updateExpense:O,convertPrice:q,expenses:z}=tn(),{attachBookingToTrip:V}=Qc(),[W]=Pn(Jc),[te,E]=f.useState({loading:!1,error:null,outsideTripDates:!1}),B=f.useRef(void 0),G=$||!(h!=null&&h._id);f.useEffect(()=>{$&&(h!=null&&h._id)&&!B.current&&(B.current=h._id)},[$,h==null?void 0:h._id]);const N=async(F=!1)=>{var le,Re,Ie;const oe=(le=d.bookingResult)==null?void 0:le.bookingId;if(!(!oe||te.loading)){E({loading:!0,error:null,outsideTripDates:!1});try{const{data:Ge}=await W({variables:{bookingId:oe}}),Je=(Ge==null?void 0:Ge.hotelBooking)||{bookingId:oe,status:"CONFIRMED",hotelId:(Re=d.selectedHotel)==null?void 0:Re.hotel_id,hotelName:(Ie=d.selectedHotel)==null?void 0:Ie.name,checkin:d.searchParams.checkIn,checkout:d.searchParams.checkOut},dt=await V(Je,{tripId:B.current,confirmOutsideTripDates:F});l.push((h==null?void 0:h._id)===dt.tripId?Bt(h,"bookings"):`/trip/${dt.tripId}`)}catch(Ge){if(Ge instanceof sl){Ge.tripId&&(B.current=Ge.tripId),E({loading:!1,error:Ge.message,outsideTripDates:!0});return}Ge instanceof il&&Ge.tripId&&(B.current=Ge.tripId),E({loading:!1,error:(Ge==null?void 0:Ge.message)||"Could not create the trip. Please try again.",outsideTripDates:!1});return}E({loading:!1,error:null,outsideTripDates:!1})}},K=f.useRef(!1);f.useEffect(()=>{var F;!$||!(h!=null&&h._id)||d.view!=="confirmation"||!((F=d.bookingResult)!=null&&F.bookingId)||K.current||(K.current=!0,N())},[$,h==null?void 0:h._id,d.view,(ie=d.bookingResult)==null?void 0:ie.bookingId]);const ee=!$&&(h!=null&&h._id)?Zc(h):a||null,se=f.useRef(!1);se.current=$;const je=f.useRef(!1),be=()=>{se.current&&je.current&&U(F=>F+1)};f.useEffect(()=>{ee&&(u({type:"SET_SEARCH_PARAMS",params:{guests:ee}}),be(),je.current=!0)},[ee,u]);const ge=f.useRef(!1);f.useEffect(()=>{!$&&ee&&(h!=null&&h._id)&&!ge.current&&(ge.current=!0,U(F=>F+1))},[$,ee,h==null?void 0:h._id]),f.useEffect(()=>{const F=oe=>{const{checkIn:le,checkOut:Re}=oe.detail;u({type:"SET_SEARCH_PARAMS",params:{checkIn:le,checkOut:Re}}),be()};return window.addEventListener("hotel-date-change",F),()=>window.removeEventListener("hotel-date-change",F)},[u]),f.useEffect(()=>{const F=oe=>{const{query:le}=oe.detail;u({type:"SET_SEARCH_PARAMS",params:{query:le}})};return window.addEventListener("hotel-query-change",F),()=>window.removeEventListener("hotel-query-change",F)},[u]);const[re,U]=f.useState(0);f.useEffect(()=>{const F=()=>U(oe=>oe+1);return window.addEventListener("hotel-search-trigger",F),()=>window.removeEventListener("hotel-search-trigger",F)},[]),f.useEffect(()=>{const F=()=>u({type:"SET_SEARCH_TAB",tab:"intrip"});return window.addEventListener("hotel-select-intrip-tab",F),()=>window.removeEventListener("hotel-select-intrip-tab",F)},[u]),f.useEffect(()=>(window.activeModal="accommodation",()=>{delete window.activeModal}),[]);const we=(_==null?void 0:_.places)||[],Se=f.useMemo(()=>Io(we,"accommodation"),[we]);f.useEffect(()=>()=>{c(Qt(Mr(h)))},[]),f.useEffect(()=>{_&&c(Tn(_))},[_,c]),f.useEffect(()=>()=>{c(Tn(null))},[]);const $e=f.useMemo(()=>{const{allIdentifierPool:F}=po(Se);return F.map(oe=>
45oe&&String(oe)).filter(Boolean)},[Se]),Ae=f.useMemo(()=>Array.from(new Set([...$e,...P])),[$e,P]),Fe=$e.join(",");f.useEffect(()=>{I(F=>{if(!F.length)return F;const oe=F.filter(le=>!$e.includes(le));return oe.length===F.length?F:oe})},[Fe]);const[ce]=kt(Xs,{onError:F=>console.error("Add place to destination failed",F),refetchQueries:["Trip","PublicTrip"],awaitRefetchQueries:!0}),[Pe]=kt(Qs,{onError:F=>console.error("Update place metadata failed",F)}),[xe]=kt(Js,{refetchQueries:["Trip","PublicTrip"],awaitRefetchQueries:!0}),[Ve]=kt(el,{refetchQueries:["TripHotelBookings"]}),{updateDestinationPlaces:Ye}=tl({update:(F,{data:oe})=>{var Re;if(!((Re=oe==null?void 0:oe.updateDestinationPlaces)!=null&&Re.days))return;const le=oe.updateDestinationPlaces;F.modify({id:F.identify({__typename:"Trip",_id:le._id}),fields:{days(){return le.days}}})}}),_e=f.useCallback((F,oe,le)=>{var Ie,Ge;const Re=[le,F==null?void 0:F._id,F==null?void 0:F.externalId,F==null?void 0:F.hotel_id,F==null?void 0:F.hotelId,F==null?void 0:F.key,oe==null?void 0:oe.externalId,(Ie=oe==null?void 0:oe.metadata)==null?void 0:Ie.id,...Array.isArray((Ge=oe==null?void 0:oe.metadata)==null?void 0:Ge.sourceIds)?oe.metadata.sourceIds:[]];return Array.from(new Set(Re.filter(Boolean).map(Je=>String(Je))))},[]),ve=f.useCallback(async F=>{var Re,Ie,Ge,Je,dt,Qe;if(!(_!=null&&_._id))return;const oe=await or(F,"accommodation"),le=_e(F,oe);if(!le.some(ut=>Ae.includes(ut))){I(ut=>Array.from(new Set([...ut,...le])));try{const ut=await ce({variables:{destinationId:_._id,input:{...oe,icon:"bed--outlined"}}}),zt=(Qe=(dt=(Je=(Ge=(Ie=(Re=ut==null?void 0:ut.data)==null?void 0:Re.addPlaceToDestination)==null?void 0:Ie.destinations)==null?void 0:Ge.find(mt=>(mt==null?void 0:mt._id)===_._id))==null?void 0:Je.places)==null?void 0:dt.find(mt=>_e(mt,mt).some(zn=>le.includes(zn))))==null?void 0:Qe._id;zt&&I(mt=>Array.from(new Set([...mt,String(zt)])))}catch{I(ut=>ut.filter(zt=>!le.includes(zt)))}}},[_==null?void 0:_._id,Ae,ce,_e]),{openForPlace:A,modalProps:w}=Or({trip:h,currentDestinationId:_==null?void 0:_._id,addOrRemoveDestination:(F,oe,le)=>g(F,oe,le),addOrRemoveDay:async()=>Promise.resolve(),onDestinationChange:({destinationId:F,placeId:oe,remove:le})=>{!(_!=null&&_._id)||F!==_._id||!oe||I(Re=>{const Ie=String(oe);return le?Re.filter(Ge=>Ge!==Ie):Re.includes(Ie)||$e.includes(Ie)?Re:[...Re,Ie]})}}),X=f.useCallback(F=>{const oe=m(void 0,F);if(oe)return oe;const le=nl(x,F);if(le)return le},[x,m]),Q=f.useMemo(()=>d.selectedHotel?X(d.selectedHotel):null,[d.selectedHotel,x,m]),ue=To(Q,h),Y=(he=h==null?void 0:h.destinations)==null?void 0:he.find(F=>F._id===(ue==null?void 0:ue.destinationId)),fe=f.useCallback(()=>{const F=Q!=null&&Q._id?{openBookingPlaceId:Q._id,openBookingDestId:Y==null?void 0:Y._id}:void 0;if($){l.push("/bookings",F);return}if(h!=null&&h.name){l.push(Bt(h,"bookings"),F);return}l.goBack()},[Q==null?void 0:Q._id,Y==null?void 0:Y._id,$,h==null?void 0:h.name,l]),ye=f.useCallback((F,oe)=>{if(!(_!=null&&_._id))return;const le=X(F);le&&A(le,{isAccommodation:!0},oe)},[_==null?void 0:_._id,A,X]),Ue=f.useCallback(async F=>{if(!(_!=null&&_._id))return;const oe=X(F);if(oe!=null&&oe._id)try{await Ye({variables:{destinationId:_._id,placeId:oe._id,remove:!0}},h)}catch(le){console.error("[HotelBooking] Failed to remove accommodation from trip:",{placeId:oe._id,destinationId:_._id,error:(le==null?void 0:le.message)||le})}},[_==null?void 0:_._id,Ye,X,h]),Be=f.useCallback(F=>{u({type:"SELECT_HOTEL",hotel:F})},[u]),C=f.useCallback(()=>{if(!(h!=null&&h._id))return;const F=(_==null?void 0:_.city)||"";let oe="";if(_!=null&&_.startDate&&(_!=null&&_.endDate)){const le=new Date(_.startDate),Re=new Date(_.endDate),Ie=Je=>Je.getDate().toString(),Ge=Je=>Je.toLocaleDateString("en-GB",{month:"short"});le.getMonth()===Re.getMonth()&&le.getFullYear()===Re.getFullYear()?oe=`${Ie(le)}â${Ie(Re)} ${Ge(le)}`:oe=`${Ie(le)} ${Ge(le)}â${Ie(Re)} ${Ge(Re)}`}window.dispatchEvent(new CustomEvent("hotel-add-custom-stay",{detail:_?{destId:_._id,city:F,dateRange:oe}:void 0}))},[h,_]);f.useEffect(()=>{const F=oe=>{const le=oe.detail;le&&u({type:"SELECT_HOTEL",hotel:le})};return window.addEventListener("hotel-marker-click",F),()=>window.removeEventListener("hotel-marker-click",F)},[u]),f.useEffect(()=>{const F=l.location.state,oe=F==null?void 0:F.autoSelectHotel,le=F==null?void 0:F.autoSelectBookRate,Re=F==null?void 0:F.autoSelectSearchParams,Ie=(F==null?void 0:F.searchQuery)??(oe&&!oe.hotel_id?oe.name:void 0);oe!=null&&oe.hotel_id&&(u({type:"SELECT_HOTEL",hotel:oe}),le!=null&&le.room&&(le!=null&&le.rate)&&(u({type:"SELECT_ROOM",room:le.room}),u({type:"SELECT_RATE",rate:le.rate}),u({type:"SET_VIEW",view:"checkout"}))),Ie&&u({type:"SET_SEARCH_PARAMS",params:{query:Ie}}),Re&&(u({type:"SET_SEARCH_PARAMS",params:Re}),u({type:"SET_COMMITTED_PARAMS",params:{startDate:Re.checkIn??(_==null?void 0:_.startDate),endDate:Re.checkOut??(_==null?void 0:_.endDate),guests:Re.guests??2,rooms:Re.rooms??1,currency:Re.currency??y}})),(F!=null&&F.autoSelectHotel||F!=null&&F.searchQuery||F!=null&&F.autoSelectSearchParams)&&l.replace({...l.location,state:void 0})},[]);const ae=f.useRef(d.hotelDetail);ae.current=d.hotelDetail;const Ne=f.useRef(h);Ne.current=h;const Xe=f.useRef(_);Xe.current=_;const[at,st]=f.useState(!0),He=f.useRef(!1);return f.useEffect(()=>{var oe;if(d.view!=="confirmation"||!((oe=d.bookingResult)!=null&&oe.bookingId)||!d.selectedHotel||He.current)return;He.current=!0,(async()=>{var ut,zt,mt,zn,ta,na,oa,ra,aa,sa,ia,ca,la,da,_a,ua,fa,pa,ha,ma,ga,va,ba,ya,wa,xa;const le=d.selectedHotel,Re=d.bookingResult;let Ie=Q;const Ge=Re.status==="CONFIRMED"?"confirmed":Re.status,Je=ae.current;console.log("[HotelBooking] hotelDetail checkin/out:",Je==null?void 0:Je.checkinTime,Je==null?void 0:Je.checkoutTime);const dt=Xe.current;if(Ne.current,!Ie&&(dt!=null&&dt._id)){const Wt=await or(le,"accommodation"),wn=_e(le,Wt);I(gt=>Array.from(new Set([...gt,...wn])));
45try{const gt=await ce({variables:{destinationId:dt._id,input:{...Wt,icon:"bed--outlined"}}});Ie=(ta=(zn=(mt=(zt=(ut=gt==null?void 0:gt.data)==null?void 0:ut.addPlaceToDestination)==null?void 0:zt.destinations)==null?void 0:mt.find(tt=>(tt==null?void 0:tt._id)===dt._id))==null?void 0:zn.places)==null?void 0:ta.find(tt=>_e(tt,tt).some(et=>wn.includes(et)))}catch(gt){console.error("Failed to add hotel to trip after booking",gt)}}const Qe=Ne.current;if(Ie!=null&&Ie._id&&(Qe!=null&&Qe._id)&&(Qe!=null&&Qe.days)){const Wt=dt==null?void 0:dt._id,wn=Qe.days.findIndex(et=>{var nn;return(nn=et.destinationIds)==null?void 0:nn.includes(Wt)}),gt=wn>=0?`${Qe._id}-day-${wn}`:(na=Qe.days[0])==null?void 0:na._id;if(gt)try{await xe({variables:{dayId:gt,placeId:Ie._id,bookingStatus:Ge,confirmationNumber:Re.bookingId,bookingProvider:"nuitee",...Je!=null&&Je.checkinTime?{startTime:Je.checkinTime,hasTime:!0}:{},...Je!=null&&Je.checkoutTime?{endTime:Je.checkoutTime}:{}}})}catch(et){console.error("Failed to save booking data to trip day item",et)}if(Re.bookingId&&(Qe!=null&&Qe._id))try{await Ve({variables:{bookingId:Re.bookingId,tripId:Qe._id,destinationId:Wt,placeId:Ie._id}})}catch(et){console.error("[HotelBooking] Failed to link booking to destination/place:",{bookingId:Re.bookingId,tripId:Qe._id,destinationId:Wt,placeId:Ie._id,error:(et==null?void 0:et.message)||et})}try{const et=((oa=d.prebookResult)==null?void 0:oa.price)??((ra=d.selectedRate)==null?void 0:ra.price),nn=((aa=d.prebookResult)==null?void 0:aa.currency)??((sa=d.selectedRate)==null?void 0:sa.currency);if(et!=null&&nn){const ze=z.find(nt=>nt.itemId===Ie._id),ka=q(et,nn,j),yc=ka??et,wc=ka!=null?j:nn,xc=(ca=(ia=k==null?void 0:k.accommodation)==null?void 0:ia[0])==null?void 0:ca._id,kc=!!(k&&Object.keys(k).includes("accommodation")),Bo=(la=Qe==null?void 0:Qe.days)==null?void 0:la.find(nt=>nt._id===gt),Sc=(ze==null?void 0:ze.date)||(Bo==null?void 0:Bo.date)||new Date,Sa=new Date(Sc),jc=(Number.isNaN(Sa.getTime())?new Date:Sa).toISOString(),ja={paidBy:((da=ze==null?void 0:ze.paidBy)==null?void 0:da.map(nt=>nt==null?void 0:nt._id))||[b==null?void 0:b._id],paidFor:((_a=ze==null?void 0:ze.paidFor)==null?void 0:_a.map(nt=>{var Ca;return{user:(Ca=nt==null?void 0:nt.user)==null?void 0:Ca._id,ratio:nt==null?void 0:nt.ratio}}))||(v==null?void 0:v.map(nt=>({user:nt._id,ratio:(b==null?void 0:b._id)===(nt==null?void 0:nt._id)?1:0})))||[],description:(ze==null?void 0:ze.description)||(Ie==null?void 0:Ie.name)||"",category:((ua=ze==null?void 0:ze.category)==null?void 0:ua._id)||xc,labelType:(ze==null?void 0:ze.labelType)||(kc?"labels":"customCategory"),date:jc,destination:((fa=ze==null?void 0:ze.destination)==null?void 0:fa._id)||Wt||((ha=(pa=Qe==null?void 0:Qe.destinations)==null?void 0:pa[0])==null?void 0:ha._id),amount:yc,currency:wc,pending:(ze==null?void 0:ze.pending)||!1,itemId:(ze==null?void 0:ze.itemId)||Ie._id};ze!=null&&ze._id?await O(ze._id,ja):await T(ja)}}catch(et){console.error("[HotelBooking] Failed to sync expense to paid total:",{placeId:Ie==null?void 0:Ie._id,tripId:Qe==null?void 0:Qe._id,error:(et==null?void 0:et.message)||et})}const tt=d.selectedRoom;if(console.log("[HotelBooking] Saving room metadata. selectedRoom:",tt==null?void 0:tt.name,"photos:",(ma=tt==null?void 0:tt.photos)==null?void 0:ma.length,"placeId:",Ie._id),tt)try{await Pe({variables:{placeId:Ie._id,input
45:{metadata:{...Ie.metadata||{},bookedRoomName:tt.name||null,bookedRoomPhoto:((ga=tt.photos)==null?void 0:ga[0])||null,bookedRoomBed:tt.bedType||null,bookedRoomSize:tt.roomSize||null,bookedRoomAmenities:((va=tt.amenities)==null?void 0:va.slice(0,8))||[],bookedRoomPriceTotal:((ba=d.prebookResult)==null?void 0:ba.price)??((ya=d.selectedRate)==null?void 0:ya.price)??null,bookedRoomCurrency:((wa=d.prebookResult)==null?void 0:wa.currency)??((xa=d.selectedRate)==null?void 0:xa.currency)??null}}}}),console.log("[HotelBooking] Room metadata saved successfully")}catch(et){console.error("[HotelBooking] Failed to save room info to place metadata",et)}}})().finally(()=>st(!1))},[d.view,(me=d.bookingResult)==null?void 0:me.bookingId,Q]),r.jsxs("div",{className:`${M_.flow} hotel-booking-flow`,children:[r.jsx(Ar,{...w}),r.jsx("div",{style:{display:d.view==="search"||d.view==="detail"?"flex":"none",flexDirection:"column",flex:1,overflow:"hidden"},children:r.jsx(wk,{match:e,currentDestination:_,onSelectRooms:Be,onAdd:ve,onChangeAssignment:ye,onRemove:Ue,isB2B:s,searchTrigger:re,onAddCustomStay:C,onSaveToList:o})}),d.view==="detail"&&r.jsx(ol,{onAdd:ve,onChangeAssignment:()=>ye(d.selectedHotel,".hotel-detail-view"),onSaveToList:o,isInTrip:!!m(void 0,d.selectedHotel),isGuestDestination:$,guestDestination:i,foundPlace:Q,placeInfo:ue,tripId:h==null?void 0:h._id}),d.view==="checkout"&&r.jsx(rl,{trip:h,destinationId:_==null?void 0:_._id}),d.view==="confirmation"&&r.jsx(al,{onViewBooking:fe,viewBookingLoading:at,onBackToBookings:()=>
45{if(G){l.push("/bookings");return}l.push(Bt(h,"bookings"))},isTripless:G,onCreateTrip:()=>N(),createTripLoading:te.loading,createTripError:te.error,attachTripName:$?h==null?void 0:h.name:void 0,createTripOutsideTripDates:te.outsideTripDates,onConfirmCreateTripOutsideTripDates:()=>N(!0)})]})},kk=e=>{const{currentDestination:t,tripCurrency:n}=rt(),o=e.guestDestination||t;return r.jsx(Yc,{isB2B:e.isB2B,initialCurrency:n,initialDestination:{city:(o==null?void 0:o.city)??"",startDate:o==null?void 0:o.startDate,endDate:o==null?void 0:o.endDate},entryLocation:e.entryLocation,children:r.jsx(xk,{...e})})},Sk=({label:e,type:t,buttonType:n="button",color:o="green",currentDestination:s})=>{const[i,a]=f.useState(!1);return r.jsxs(r.Fragment,{children:[n==="icon"?r.jsx("div",{className:`icon-btn ${o}`,onClick:()=>{a(!0)},children:r.jsx(Z,{name:"plus"})}):r.jsxs("button",{className:"btn-rounded solid big with-icon",onClick:()=>a(!0),children:[r.jsx(Z,{name:"addCircle"})," ",e]}),r.jsx(Zs,{modalIsOpen:i,setModalIsOpen:a,type:t,currentDestinationId:s==null?void 0:s._id})]})},jk=({filteredSuggestions:e,activeSuggestionIndex:t,onClick:n})=>e.length?r.jsx("ul",{className:"suggestions",children:e.map((o,s)=>{let i;s===t&&(i="suggestion-active");const{alpha2:a}=ct.find(Zo,c=>c.country===o)??{};return r.jsx("li",{className:i,onClick:c=>n(c,s),children:o!=null&&o.normalised_city?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"icon",children:r.jsx(Z,{name:"marker--outlined"})}),r.jsx("div",{className:"suggestion-content",children:o==null?void 0:o.normalised_city})]}):o!=null&&o.username?r.jsxs(r.Fragment,{children:[r.jsx(yn,{image:o==null?void 0:o.picture}),r.jsxs("div",{className:"suggestion-content",children:[r.jsx("span",{className:"suggestion-content__title",children:o==null?void 0:o.displayName}),r.jsxs("span",{className:"suggestion-content__sub",children:["@",o==null?void 0:o.username]})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"flag",children:r.jsx(er,{svg:!0,countryCode:a})}),r.jsx("div",{className:"suggestion-content",children:o})]})},s)})}):r.jsx("ul",{className:"suggestions",children:r.jsx("li",{className:"disabled",children:"Nothing found"})});const hc=({label:e,active:t,setActive:n,note:o="",icon:s="",switchLabel:i=""})=>r.jsxs("div",{className:"switch-row-container",children:[r.jsxs("div",{className:"switch-row",children:[r.jsxs("div",{className:"content",children:[s?r.jsx(Z,{name:s}):null,r.jsx("label",{children:e})]}),r.jsxs("div",{className:"value",children:[i?r.jsx("div",{className:`switch-label ${t?"active":""}`,children:i}):null,r.jsx(ei,{name:`${e}-booked`,checked:t,color:"green",handleChange:a=>{n(!t)}})]})]}),o?r.jsx("p",{className:"row-note",children:o}):null]}),Ck=({modalIsOpen:e,setModalIsOpen:t})=>{const{Close:n}=ti(),{user:o,refetch:s}=lt(),[i,a]=f.useState(!0);f.useEffect(()=>{a((o==null?void 0:o.emailMarketing)!==!1)},[o==null?void 0:o.emailMarketing]);const c=async()=>{var d;const l=!i;a(l);try{await Nc.post("/api/utils/email-marketing",{enabled:l},{headers:{Authorization:Tc}}),await(s==null?void 0:s())}catch(u){console.error("[EmailPreferences] Failed to update marketing preference:",((d=u==null?void 0:u.response)==null?void 0:d.data)||(u==null?void 0:u.message)),a(!l)}};return r.jsxs(Lr,{ariaHideApp:!1,isOpen:e,onRequestClose:()=>t(!1),overlayClassName:"simple-modal",className:"rounded-modal profile-settings",children:[r.jsxs("header",{children:[r.jsx("h2",{children:"Email settings"}),r.jsx(n,{onClick:()=>t(!1)})]}),r.jsx("div",{className:"modal-container",children:r.jsx(hc,{label:"Marketing emails",active:i,setActive:c,note:"Account and trip emails (password resets, booking confirmations, trip invites and exports you request) are always sent."})}),r.jsx("footer",{children:r.jsx("button",{onClick:()=>t(!1),className:"btn btn-rounded big solid","data-testid":"user-currency-submit",children:"Save settings"})})]})},Ek=({stipplUser:e})=>{const t=cl(),n=f.useRef(),[o,s]=f.useState(!1),[i,a]=f.useState(!1),[c,l]=f.useState(!1),[d,u]=f.useState(!1);f.useEffect(()=>(document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}),[]);const p=g=>{var m;(m=n.current)!=null&&m.contains(g.target)||s(!1)},h=g=>{g.preventDefault(),t()};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"profile-settings-menu",ref:n,children:[r.jsx("div",{className:"dropdown-toggle",onClick:()=>s(!o),children:r.jsx(Z,{name:"settings--outlined"})}),r.jsxs("ul",{className:`user-menu ${o&&"active"}`,children:[e!=null&&e.isCreator?r.jsx("li",{onClick:()=>l(!0),children:"Profile settings"}):null,r.jsx("li",{onClick:()=>u(!0),children:"Email settings"}),r.jsx("li",{onClick:()=>a(!0),children:"Change password"}),r.jsx("li",{onClick:h,"data-testid":"user-logout-button",children:"Log out"})]})]}),r.jsx(ll,{passwordModalIsOpen:i,setPasswordModalIsOpen:a}),r.jsx(dl,{profileModalIsOpen:c,setProfileModalIsOpen:l}),r.jsx(Ck,{modalIsOpen:d,setModalIsOpen:u})]})};const $k=({match:e,trackLocation:t,baseUrl:n,type:o="small",placeholder:s="Search...",cities:i,stipplUser:a,isOwner:c})=>{var Ve,Ye,_e,ve,A,w,X,Q,ue,Y,fe,ye,Ue,Be;const{history:l}=Tt(),d=f.useRef(),u=f.useRef(null),p=f.useRef(null),h=f.useRef(null),g=f.useRef([]),{user:m}=lt(),v=l.location.pathname.includes("discover"),[j,S]=f.useState([]),[_,$]=f.useState([]),[M,x]=f.useState([]),[P,I]=f.useState(0),[R,L]=f.useState(!1),[D,H]=f.useState(!1),[b,y]=f.useState(!1),[k,T]=f.useState(((Ve=e==null?void 0:e.params)==null?void 0:Ve.city)||((Ye=e==null?void 0:e.params)==null?void 0:Ye.country)||""),[O]=Pn(_l),[q]=Pn(ul),[z,V]=f.useState(k),{data:W}=At(Ea,{variables:{user:v?null:(a==null?void 0:a.username)||(m==null?void 0:m.username)}}),{data:te}=At(Ea,{variables:{user:v?null:(a==null?void 0:a.username)||(m==null?void 0:m.username),searchValue:z},skip:!z}),E=((_e=W==null?void 0:W.discover)==null?void 0:_e.countries)||[],B=((A=(ve=W==null?void 0:W.discover)==null?void 0:ve.creators)==null?void 0:A.map(C=>({username:C})))||[];f.useEffect(()=>{var C;$(((C=te==null?void 0:te.discover)==null?void 0:C.users)||[])},[(w=te==null?void 0:te.discover)==null?void 0:w.users]),f.useEffect(()=>{x(ct.compact([...j,..._]))},[j,_]),f.useEffect(()=>{g.current=M},[M]),f.useEffect(()=>{const C=setTimeout(()=>{V(k)},500);return()=>{clearTimeout(C)}},[k]);const{params:{country:G,city:N}}=e,K=!G&&!N,ee=G&&!N,se=G&&N,je=E==null?void 0:E.map(C=>C.country),be=ct.uniqBy((X=E==null?void 0:E.map(C=>{var ae;return(ae=C==null?void 0:C.cities)==null?void 0:ae.map(({city:Ne})=>({normalised_city:Ne,country:C.country}))}))==null?void 0:X.flat(),C=>{var ae,Ne,Xe,at,st;return((Ne=(ae=C==null?void 0:C.normalised_city)==null?void 0:ae.toLowerCase)==null?void 0:Ne.call(ae))||((at=(Xe=C==null?void 0:C.city)==null?void 0:Xe.toLowerCase)==null?void 0:at.call(Xe))||((st=C==null?void 0:C.toLowerCase)==null?void 0:st.call(C))}),ge=ct.uniq([...je,...be,...B]);f.useEffect(()=>(document.addEventListener("mousedown",re),()=>{document.removeEventListener("mousedown",re)}),[]);const re=C=>{var ae;(ae=d==null?void 0:d.current)!=null&&ae.contains(C.target)||(y(!1),H(!1),L(!1))};f.useEffect(()=>{var C,ae;T(((C=e==null?void 0:e.params)==null?void 0:C.city)||((ae=e==null?void 0:e.params)==null?void 0:ae.country)||"")},[(Q=e==null?void 0:e.params)==null?void 0:Q.city,(ue=e==null?void 0:e.params)==null?void 0:ue.country,(Y=e==null?void 0:e.params)==null?void 0:Y.username]);const U=C=>{var ae,Ne,Xe,at,st,He;Se(),y(!1),L(!1),C!=null&&C.normalised_city||C!=null&&C.city?l.push(`${n}/${((Ne=(ae=C==null?void 0:C.researches)==null?void 0:ae.articles[0])==null?void 0:Ne.country)||((at=(Xe=C==null?void 0:C.researches)==null?void 0:Xe.activities[0])==null?void 0:at.country)||((He=(st=C==null?void 0:C.researches)==null?void 0:st.accommodations[0])==null?void 0:He.country)||(C==null?void 0:C.country)}/${(C==null?void 0:C.normalised_city)||(C==null?void 0:C.city)}`):C!=null&&C.username?l.push(`/${C==null?void 0:C.username}`):C&&l.push(`${n}/${(C==null?void 0:C.name)||C}`)},we=C=>{if(p.current&&clearTimeout(p.current),h.current=null,!C||C.trim().length<2)return;const ae=()=>{h.current=null;try{const Ne=g.current.length;Ke("search_discover",{query:C.trim().toLowerCase(),results:Ne,has_results:Ne>0},t)}catch{}};h.current=ae,p.current=setTimeout(ae,700)},Se=()=>{clearTimeout(p.current),p.current=null;const C=h.current;h.current=null,C==null||C()},$e=()=>{clearTimeout(p.current),p.current=null,h.current=null};f.useEffect(()=>()=>Se(),[]);const Ae=(C,ae)=>{if(C&&!(typeof C!="string"&&(C!=null&&C.username)&&!(C!=null&&C.city)&&!(C!=null&&C.normalised_city)))try{Ke("search_destination_discover",{city:typeof C=="string"?void 0:(C==null?void 0:C.normalised_city)||(C==null?void 0:C.city),country:typeof C=="string"?C:C==null?void 0:C.country,position:ae,query:String(k||"").trim().toLowerCase()},t)}catch{}},Fe=C=>{var st;const ae=C.target.value;if(!ae){$e(),S([]),T(C.target.innerText),I(0),H(!1),y(!1),L(!1),$([]);return}const Ne=ge.filter(He=>{var J,ne,ie,he,me,F,oe;return((J=He==null?void 0:He.normalised_city)==null?void 0:J.toLowerCase().indexOf(ae.toLowerCase()))>
45-1||((ne=He==null?void 0:He.city)==null?void 0:ne.toLowerCase().indexOf(ae.toLowerCase()))>-1||((he=(ie=He==null?void 0:He.username)==null?void 0:ie.toLowerCase)==null?void 0:he.call(ie).indexOf(ae.toLowerCase()))>-1||((F=(me=He==null?void 0:He.name)==null?void 0:me.toLowerCase)==null?void 0:F.call(me).indexOf(ae.toLowerCase()))>-1||((oe=He==null?void 0:He.toLowerCase)==null?void 0:oe.call(He).indexOf(ae.toLowerCase()))>-1}),Xe=Ne.filter(He=>typeof He=="string").slice(0,1),at=Ne.filter(He=>typeof He!="string").slice(0,1);(st=Xe.concat(at))==null||st.map(xe),we(ae),T(C.target.value),S(Ne),I(0),y(!1),H(!0)},ce=(C,ae)=>{S([]),Ae(M[ae],ae+1),T(C.target.innerText),U(M[ae]),I(0),H(!1),y(!1),L(!1)},Pe=C=>{var ae,Ne;C.keyCode===13?(T(M[P]||((ae=M[P])==null?void 0:ae.normalised_city)||((Ne=M[P])==null?void 0:Ne.city)),Ae(M[P],P+1),U(M[P]),H(!1),y(!1),L(!1)):C.keyCode===38?I(P-1):C.keyCode===40&&I(P+1)},xe=C=>{typeof C=="string"?O({variables:{country:C}}):q({variables:{country:C==null?void 0:C.country,city:(C==null?void 0:C.normalised_city)||(C==null?void 0:C.city)}})};return r.jsxs("div",{className:`autocomplete-wrapper ${o}`,ref:d,children:[r.jsx("div",{className:"left-action",children:K?r.jsx("div",{className:"icon",children:r.jsx(Z,{name:"search"})}):ee?r.jsx($t,{to:`${n}`,className:"back-arrow",children:r.jsx(Z,{name:"chevron-left"})}):se?r.jsx($t,{to:`${n}/${G}`,className:"back-arrow",children:r.jsx(Z,{name:"chevron-left"})}):null}),r.jsx("input",{className:"autocomplete-input",type:"text",ref:u,onChange:Fe,onKeyDown:Pe,value:k,placeholder:s,onClick:()=>y(!0),onFocus:()=>{T(""),L(!0)}}),e.url.includes("research")?null:r.jsx("div",{className:"right-action",children:Ce?R&&k.length>0?r.jsx("div",{className:"clear-input",onClick:()=>{var C;T(""),(C=u==null?void 0:u.current)==null||C.focus()},children:r.jsx(Z,{name:"close"})}):R&&k.length===0?r.jsx("div",{className:"clear-input",onClick:()=>{var C;y(!1),L(!1),(C=u==null?void 0:u.current)==null||C.blur()},children:r.jsx(Z,{name:"close"})}):c&&K&&!R&&!v?r.jsx(Ek,{stipplUser:a}):!R&&!K&&!v?r.jsxs($t,{to:`/${(fe=e==null?void 0:e.params)==null?void 0:fe.username}`,className:"user-icon",children:[K?null:r.jsxs("span",{children:["@",(ye=e==null?void 0:e.params)==null?void 0:ye.username]}),r.jsx(yn,{image:(a==null?void 0:a.picture)||(a==null?void 0:a.avatar)})]}):null:r.jsx("div",{className:"chevron-down",onClick:()=>y(!0),children:r.jsx(Z,{name:"arrowDown"})})}),D&&k&&r.jsx(jk,{filteredSuggestions:M,activeSuggestionIndex:P,onClick:ce}),b&&r.jsx("ul",{className:"suggestions",children:(Ue=e.params)!=null&&Ue.city||(Be=e.params)!=null&&Be.country?r.jsxs(r.Fragment,{children:[i==null?void 0:i.map(C=>r.jsxs("li",{onClick:()=>U(C),children:[r.jsx(Z,{name:"marker--outlined"}),(C==null?void 0:C.normalised_city)||(C==null?void 0:C.city)]})),je==null?void 0:je.map(C=>{const{alpha2:ae}=ct.find(Zo,Ne=>Ne.country===C)??{};return r.jsxs("li",{onClick:()=>U(C),children:[r.jsx("div",{className:"flag",children:r.jsx(er,{svg:!0,countryCode:ae})}),C]})})]}):ge==null?void 0:ge.map(C=>{const{alpha2:ae}=ct.find(Zo,Ne=>Ne.country===C)??{};return r.jsx("li",{onClick:()=>U(C),children:C!=null&&C.normalised_city||C!=null&&C.city||C!=null&&C.username?r.jsxs(r.Fragment,{children:[r.jsx(Z,{name:"marker--outlined"}),(C==null?void 0:C.normalised_city)||(C==null?void 0:C.city)||(C==null?void 0:C.username)]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"flag",children:r.jsx(er,{svg:!0,countryCode:ae})}),C]})})})})]})},Nk=["Booking.com","Expedia","Agoda","Hotels.com","Vio.com","Trip.com","Hostelworld","Airbnb"],Gs=({variant:e,menuItem:t,mode:n="default"})=>{var R,L;const o=An(),{t:s}=Et(["dashboard"]),{currentDestination:i,vioLocationLinksData:a,fetchVioLocationLinks:c}=rt(),l=f.useMemo(()=>{if(!i)return 0;const D=(i==null?void 0:i.places)||[];return e==="sleep"?Io(D,"accommodation").length:D.filter(H=>((H==null?void 0:H.attraction)||(H==null?void 0:H.type))!=="accommodation").length},[(R=i==null?void 0:i.places)==null?void 0:R.length,e]),{startDate:d,endDate:u,city:p,country:h}=i||{},[g,m]=f.useState(t==="#intrip"),[v,j]=f.useState(!1),{user:{username:S}}=lt(),{lists:_}
45=Po({tripId:(i==null?void 0:i.tripId)||((L=i==null?void 0:i.trip)==null?void 0:L._id)}),$=f.useMemo(()=>v?_:_==null?void 0:_.slice(0,5),[_,v]);f.useEffect(()=>{m(t==="#intrip")},[t]),f.useEffect(()=>{e==="sleep"&&(i!=null&&i.city)&&(i!=null&&i.country)&&(i!=null&&i.startDate)&&(i!=null&&i.endDate)&&c({variables:{city:i.city,country:i.country,checkIn:i.startDate,checkOut:i.endDate}})},[e,i==null?void 0:i.city,i==null?void 0:i.country,i==null?void 0:i.startDate,i==null?void 0:i.endDate]);const M={country:h,normalised_city:p,start_date:d,end_date:u};function x(){var z;const D=(Array.isArray((z=a==null?void 0:a.vioLocationLinks)==null?void 0:z.links)?a.vioLocationLinks.links:[]).reduce((V,W)=>(W.name&&W.url&&(V[W.name]=W),V),{}),{year:H,month:b,day:y}=un(d),{year:k,month:T,day:O}=un(u),q=V=>{switch(V){case"Booking.com":{const{href:W,canRender:te}=nr({partner:"Booking.com",city:p,startDate:d,endDate:u,username:S});return te?W:""}case"Expedia":return`https://prf.hn/click/camref:1100lwgQV/destination:${encodeURIComponent(`https://www.expedia.com/Hotel-Search?adults=2&destination=${p},${h}&endDate=${k}-${T}-${O}&semdtl=&sort=RECOMMENDED&startDate=${H}-${b}-${y}`)}`;case"Hostelworld":return Al(p);case"Airbnb":return`https://www.airbnb.com/s/${p}--${h}/homes?date_picker_type=calendar&checkin=${H}-${b}-${y}&checkout=${k}-${T}-${O}`;case"Vio.com":return`https://www.vio.com/Hotel/Search?city=${p}&country=${h}&checkIn=${H}-${b}-${y}&checkOut=${k}-${T}-${O}`;case"Hotels.com":return`https://www.hotels.com/search.do?destination=${p},${h}&check-in=${H}-${b}-${y}&check-out=${k}-${T}-${O}`;case"Trip.com":return`https://www.trip.com/hotels/list?city=${p}&country=${h}&checkin=${H}-${b}-${y}&checkout=${k}-${T}-${O}`;case"Agoda":return`https://www.agoda.com/search?city=${p}&country=${h}&checkIn=${H}-${b}-${y}&checkOut=${k}-${T}-${O}`;default:return""}};return Nk.map(V=>{var W;return{name:V,url:!fl(V)&&((W=D[V])==null?void 0:W.url)||q(V)}}).filter(V=>!!V.url)}function P(){var b,y;const D=(b=In(d))==null?void 0:b.format("YYYY-MM-DD"),H=(y=In(u))==null?void 0:y.format("YYYY-MM-DD");return[{name:"Get your guide",key:"getyourguide",partnerImage:"gyg",url:`https://www.getyourguide.com/s?q=${p},${h}&date_from=${D}&date_to=${H}&partner_id=Y1LJHJX&utm_medium=platforms_and_communities&placement=sidebar-left`},{name:"Viator",key:"viator",partnerImage:"viator",url:`https://www.viator.com/searchResults/all?text=${p}%2C${h}&pid=P00050359&mcid=42383&medium=linkcampaign=discovermodalsidebar`},{name:"Tripadvisor",key:"tripadvisor",partnerImage:"tripadvisor",url:`https://www.tkqlhce.com/click-100631804-11552042?url=https%3A%2F%2Fwww.tripadvisor.com%2FSearch%3F%26q%3D${p}%252C%2520${h}%26ssrc%3DA`}]}const I=e==="sleep"?x():P();return r.jsxs("div",{className:"sidebar-navigation__menu",children:[Ce?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{children:r.jsx(hc,{label:l>0?s("discover.inYourTripCount",{count:l}):s("discover.inYourTrip"),active:g,setActive:()=>{const D=!g;m(D);const H=D?"#intrip":e==="sleep"?"#sleep":"#overview";window.location.hash=H;const b=e==="sleep"?"accommodationModalActiveTab":"activityModalActiveTab",y=D?"intrip":e==="sleep"?"sleep":"overview";sessionStorage.setItem(b,`#${y}`)}})}),r.jsx("div",{className:"menu-separator"})]}),!Ce&&n==="lists"&&($!=null&&$.length)?r.jsxs(r.Fragment,{children:[r.jsxs("ul",{children:[r.jsx("li",{className:"sleep-item",children:r.jsx("div",{className:"title",style:{fontWeight:500,color:ar.black},children:s("discover.savedInList")})}),$.map(D=>{var H;return r.jsx("li",{children:r.jsxs("a",{href:`#/list/${D._id}`,children:[r.jsxs("div",{className:"title",children:[r.jsx("span",{style:{marginRight:"0.5rem"},children:D.icon}),D.name]}),r.jsx("div",{className:"count",children:((H=D.items)==null?void 0:H.length)||0})]})},D._id)}),(_==null?void 0:_.length)>5?r.jsx("li",{children:r.jsx("a",{className:"show-more-link",onClick:D=>{D.preventDefault(),j(!v)},children:r.jsx("div",{className:"title",children:s(v?"discover.showLess":"discover.showMore")})})}):null]}),r.jsx("div",{className:"menu-separator"})]}):null,!Ce&&n==="default"&&!o?r.jsx("ul",{children:I.map((D,H)=>{const b=(D.name||D.key||"").toLowerCase().replace(".com",""),y=`clickout_${b.replace(/\s/g,"")}_button`;return r.jsx("li",{children:r.jsxs("a",{href:D.url,target:"_blank",onClick:()=>{Bn.event({category:"Affiliates",action:y}),Ke(y,M,"sidebar")},rel:"noreferrer",children:[r.jsxs("div",{className:"title",children:[r.jsx(ni,{name:D.partnerImage||b}),D.name]}),r.jsx("div",{className:"count",children:r.jsx(Z,{name:"externalLink"})})]})},D.url+H)})}):null]})},Tk=({menuItem:e,countriesInTripAmount:t,countryAmount:n})=>r.jsx("div",{className:"sidebar-navigation__menu",children:r.jsxs("ul",{children:[t>0?r.jsx("li",{className:e==="#countriesintrip"&&"active",children:r.jsxs($a,{to:"#countriesintrip",children:[r.jsxs("div",{className:"title",children:[r.jsx(Z,{name:"flag"})," Countries in trip"]}),r.jsx("div",{className:"count",children:t})]})}):null,r.jsx("li",{className:` ${e==="#allcountries"&&"active"}`,children:r.jsxs($a,{to:"#allcountries",children:[r.jsxs("div",{className:"title",children:[r.jsx(Z,{name:"planet"})," All countries"]}),r.jsx("div",{className:"count",children:n})]})})]})}),mc=({searchItems:e,searchTrackLocation:t,match:n,menuItem:o,cities:s,tripAmount:i=0,articleAmount:a=0,cityAmount:c=0,sleepAmount:l=0,todoAmount:d=0,cuisineAmount:u=0,countriesInTripAmount:p=0,countryAmount:h=0,amounts:g,currentDestination:m,variant:v="profile",setModalIsOpen:j,stipplUser:S,hideHeaderInPanel:_=!1,mode:$="default"})=>{var V,W,te,E,B;const{history:M}=Tt(),{t:x}=Et(["dashboard"]),{currentTrip:P}=rt(),[I,R]=f.useState(!1),L=v==="profile"?`/${S==null?void 0:S.username}`:v==="collectionInTrip"?`/trip/${(V=n==null?void 0:n.params)==null?void 0:V.name}/research`:v==="discoverInTrip"?`/trip/${(W=n==null?void 0:n.params)==null?void 0:W.name}/inspire`:v==="collection"?"/mycollection":v==="discoverModal"||v==="accommodationModal"?`/trip/${n.params.name}${Ce?`/${m==null?void 0:m.slug}`:""}${(te=n==null?void 0:n.path)!=null&&te.includes("details")?"/detail
45s":""}`:"/discover",[D,H]=f.useState(!0),b=document.querySelector(".infinite-scroll-component"),y=document.querySelector(".discover-view > .content-grid-container"),k=document.querySelector(".discover-view > .overview-page"),T=v==="accommodationModal"?b:y;let O=0;const q=()=>{if(Ce){const G=(T==null?void 0:T.scrollTop)||(k==null?void 0:k.scrollTop);G>O?H(!1):H(!0),O=G<=0?0:G}};f.useEffect(()=>{if(Ce){const G=ct.throttle(q,250);return T==null||T.addEventListener("scroll",G),k==null||k.addEventListener("scroll",G),()=>{T==null||T.removeEventListener("scroll",G),k==null||k.removeEventListener("scroll",G)}}else return()=>{}},[T]);const z=()=>v==="discoverModal"||v==="accommodationModal"?_&&(v==="accommodationModal"||v==="discoverModal")&&!Ce?null:r.jsxs("header",{children:[Ce?r.jsx("div",{className:"breadcrumb",onClick:()=>{j(!1),M.push(n.url)},children:r.jsx(Z,{name:"lineArrowLeft"})}):r.jsxs($t,{to:`${L}`,className:"breadcrumb",children:[r.jsx(Z,{name:"arrowCircled"}),x("discover.backToPlan")]}),r.jsxs("div",{className:"modal-title",children:[r.jsxs("h1",{className:v==="accommodationModal"?"green":"orange",children:[v==="accommodationModal"?x("discover.nightsInPrefix",{count:(m==null?void 0:m.duration)||0}):x("discover.discoverPrefix"),r.jsx("strong",{children:m==null?void 0:m.city})]}),r.jsxs("div",{className:"dates",children:[r.jsx("span",{className:"start-date",children:r.jsx(_n,{format:"ddd DD MMM",children:m.startDate})})," ","-"," ",r.jsx("span",{className:"end-date",children:r.jsx(_n,{format:"ddd DD MMM",children:m.endDate})})]})]}),r.jsx(r.Fragment,{children:v==="accommodationModal"?r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn-rounded solid big with-icon",onClick:()=>R(!0),children:[r.jsx(Z,{name:"addCircle"})," ",x("discover.addCustom")]}),r.jsx(ql,{isOpen:I,onClose:()=>R(!1),dest:m,trip:P,location:"sidebar"})]}):Ce?r.jsx(Sk,{label:x("discover.addCustom"),type:"activity",buttonType:"icon",currentDestination:m,color:"orange"}):Ce?null:r.jsx(pl,{label:x("discover.addCustom"),size:"big",icon:"addCircle",type:Ce?"plus":"button",menuItems:{activities:!0,articles:!0,cuisine:!0},currentDestination:m})})]}):null;return r.jsxs("div",{className:`sidebar-navigation ${Ce?"mobile-header":""} ${D?"mobile-header-active":"mobile-header-hidden"}`,children:[!((E=n==null?void 0:n.params)!=null&&E.username)&&Ce?z():null,r.jsxs("div",{className:"navigation",children:[Ce?null:r.jsxs(r.Fragment,{children:[z(),(B=n==null?void 0:n.params)!=null&&B.username?r.jsxs($t,{to:`${L}`,className:"user-profile-info",children:[r.jsx(yn,{image:(S==null?void 0:S.picture)||(S==null?void 0:S.avatar)}),r.jsx("h2",{children:S==null?void 0:S.displayName}),r.jsxs("h4",{children:["@",S==null?void 0:S.username]})]}):null]}),e&&(!Ce||v==="collectionInTrip")?r.jsx($k,{match:n,cities:s,baseUrl:L,trackLocation:t}):null]}),v==="collection"||v==="collectionInTrip"?r.jsx(Tk,{menuItem:o,countriesInTripAmount:p,countryAmount:h}):null,v==="discoverModal"?r.jsx(Gs,{variant:"activity",menuItem:o}):v==="accommodationModal"?r.jsx(Gs,{variant:"sleep",menuItem:o,mode:$}):null]})},Pk=$o` 46 query Tour($destinationId: ID!) { 47 tour(destinationId: $destinationId) { 48 description 49 duration { 50 fixedDurationInMinutes 51 } 52 flags 53 images { 54 caption 55 imageSource 56 isCover 57 variants { 58 height 59 url 60 width 61 } 62 } 63 pricing { 64 currency 65 summary { 66 fromPrice 67 FromPriceBeforeDiscount 68 } 69 } 70 productCode 71 productUrl 72 reviews { 73 combinedAverageRating 74 sources { 75 averageRating 76 provider 77 totalCount 78 } 79 totalReviews 80 } 81 tags 82 title 83 } 84 gyg(destinationId: $destinationId) { 85 tour_id 86 tour_code 87 cond_language 88 title 89 abstract 90 bestseller 91 certified 92 has_pick_up 93 overall_rating 94 number_of_ratings 95 pictures 96 coordinates 97 price 98 # categories 99 locations 100 url 101 } 102 } 103`,Ik=$o` 104 query Activities($destinationId: ID!) { 105 activities(destinationId: $destinationId) { 106 pois { 107 categories { 108 id 109 name 110 icon { 111 id 112 created_at 113 height 114 width 115 prefix 116 suffix 117 } 118 } 119 chains 120 description 121 distance 122 fsq_id 123 images 124 geocodes { 125 main { 126 latitude 127 longitude 128 } 129 roof { 130 latitude 131 longitude 132 } 133 } 134 location { 135 address 136 admin_region 137 country 138 cross_street 139 formatted_address 140 locality 141 postcode 142 region 143 } 144 name 145 photos { 146 id 147 created_at 148 height 149 width 150 prefix 151 suffix 152 } 153 rating 154 social_media 155 tastes 156 timezone 157 tips 158 website 159 } 160 restaurants { 161 categories { 162 id 163 name 164 icon { 165 id 166 created_at 167 height 168 width 169 prefix 170 suffix 171 } 172 } 173 chains 174 description 175 distance 176 fsq_id 177 images 178 geocodes { 179 main { 180 latitude 181 longitude 182 } 183 roof { 184 latitude 185 longitude 186 } 187 } 188 location { 189 address 190 admin_region 191 country 192 cross_street 193 formatted_address 194 locality 195 postcode 196 region 197 } 198 name 199 photos { 200 id 201 created_at 202 height 203 width 204 prefix 205 suffix 206 } 207 rating 208 social_media 209 tastes 210 timezone 211 tips 212 website 213 } 214 } 215 } 216`;$o` 217 query SearchActivities($destinationId: ID!, $activityName: String!, $lat: Float, $lng: Float) { 218 searchActivities(destinationId: $destinationId, activityName: $activityName, lat: $lat, lng: $lng) { 219 categories { 220 id 221 name 222 icon { 223 id 224 created_at 225 height 226 width 227 prefix 228 suffix 229 } 230 } 231 chains 232 description 233 distance 234 fsq_id 235 geocodes { 236 main { 237 latitude 238 longitude 239 } 240 roof { 241 latitude 242 longitude 243 } 244 } 245 location { 246 address 247 admin_region 248 country 249 cross_street 250 formatted_address 251 locality 252 postcode 253 region 254 } 255 name 256 photos { 257 id 258 created_at 259 height 260 width 261 prefix 262 suffix 263 } 264 rating 265 social_media 266 tastes 267 timezone 268 tips 269 website 270 } 271 } 272`;const gc=({startDate:e,endDate:t,guests:n,rooms:o})=>{const{t:s}=Et(["dashboard"]),{currentTrip:i}=rt(),a=Pr(),c=f.useCallback(u=>{if(!a||!u||!(i!=null&&i.startDate))return null;const p=In.utc(i.startDate).startOf("day");return In.utc(u).startOf("day").diff(p,"days")+1}
272,[i==null?void 0:i.startDate,a]),l=c(e),d=c(t);return r.jsxs("div",{className:"date-pill",children:[r.jsxs("div",{className:"date-range",children:[r.jsx("span",{className:"date-start",children:a&&l?r.jsx(r.Fragment,{children:s("discover.dayLabel",{n:l})}):r.jsx(_n,{format:"DD MMM",children:e})}),r.jsx("span",{className:"dash",children:"â"}),r.jsx("span",{className:"date-end",children:a&&d?r.jsx(r.Fragment,{children:s("discover.dayLabel",{n:d})}):r.jsx(_n,{format:"DD MMM",children:t})})]}),(n||o)&&r.jsxs("div",{className:"meta",children:[n!=null&&r.jsxs("span",{className:"meta-item",children:[n," guest",n!==1?"s":""]}),o!=null&&r.jsxs("span",{className:"meta-item",children:[o," room",o!==1?"s":""]})]})]})},Rk=({currentDestination:e,match:t,variant:n})=>{const o=Vt(),{t:s}=Et(["dashboard"]),{currentTrip:i}=rt(),{history:a}=Tt(),c=()=>{const u=(e==null?void 0:e.cityEnglish)||(e==null?void 0:e.city)||"",p=m=>m.getDate().toString(),h=m=>m.toLocaleDateString("en-GB",{month:"short"});let g="";if(e!=null&&e.startDate&&(e!=null&&e.endDate)){const m=new Date(e.startDate),v=new Date(e.endDate);g=m.getMonth()===v.getMonth()?`${p(m)}â${p(v)} ${h(m)}`:`${p(m)} ${h(m)}â${p(v)} ${h(v)}`}a.push(Bt(i),{openTripBoard:"ideas",addToDestination:e?{destId:e._id,city:u,dateRange:g}:void 0})};if(!e||Ce)return null;const l={sleep:s("discover.headingIn.sleep"),activity:s("discover.headingIn.activity"),tour:s("discover.headingIn.tour")},d={sleep:{label:s("discover.addCustom"),type:"accommodation",subTitle:s("discover.addCustomSubtitle.sleep"),color:"green"},activity:{label:s("discover.addCustom"),type:"activity",subTitle:s("discover.addCustomSubtitle.activity"),color:"orange"},tour:{label:s("discover.addCustom"),type:"tour",subTitle:s("discover.addCustomSubtitle.tour"),color:"green"}}[n];return r.jsxs("div",{className:"discover-modal__header",children:[r.jsxs("div",{className:"left",children:[r.jsx("div",{className:"breadcrumb",children:r.jsxs($t,{to:Bt(i),onClick:()=>o(Tn(null)),children:[r.jsx(Z,{name:"arrowCircled"}),s("discover.backToPlan")]})}),r.jsxs("h1",{children:[l[n]," ",r.jsx("span",{className:"discover-modal__destination",children:e==null?void 0:e.city})]})]}),r.jsxs("div",{className:"right",children:[r.jsxs("button",{type:"button",className:"btn-rounded solid big with-icon",onClick:c,children:[r.jsx(Z,{name:"addCircle"})," ",d.label]}),r.jsx("div",{className:"pills",children:r.jsx(gc,{startDate:e==null?void 0:e.startDate,endDate:e==null?void 0:e.endDate,guests:e==null?void 0:e.guests,rooms:e==null?void 0:e.rooms})})]})]})},Mk=e=>{try{const t=e!=null&&e.startDate?new Date(e.startDate):null,n=e!=null&&e.endDate?new Date(e.endDate):null;if(!t||!n||isNaN(t.getTime())||isNaN(n.getTime()))return 1;const o=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),s=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()),i=Math.round((s-o)/(1e3*60*60*24));return Math.max(1,i)}catch{return 1}},Ok=({item:e,currentDestination:t,days:n,itemsInPlan:o=[],isPlanned:s=!1,onAdd:i,onRemove:a,onPlaceCardClick:c,onSaveToList:l})=>{var W,te,E,B,G,N,K;const d=An(),{t:u}=Et(["dashboard"]),{getExpense:p}=tn(),{user:h}=lt(),[g,m]=f.useState(null),{isBookmarked:v,bookmark:j}=No("accommodation"),S=v(e),_=async ee=>{if(ee.stopPropagation(),S){l==null||l(e);return}try{await j(e)}catch(se){console.error("Bookmark failed",se)}},$=ee=>{if(ee.stopPropagation(),!(e!=null&&e.url))return;const se=Tr(rr(e.url));Ke("affiliate_clicked",{hotel_id:e==null?void 0:e.hotel_id,name:x,city:t==null?void 0:t.city,country:t==null?void 0:t.country,provider:se,provider_raw:se?void 0:rr(e.url),category:tr(se)??"accommodation",url_source:ho(e.url),placement:"list_card",destination_id:t==null?void 0:t._id,place_id:e==null?void 0:e._id},"trip_detail"),Rr({provider:se,category:tr(se)??"accommodation",destinationId:t==null?void 0:t._id,placeId:e==null?void 0:e._id,surface:"trip_detail",placement:"list_card",urlSource:ho(e.url),targetUrl:e.url}),window.open(Lt(e.url,h==null?void 0:h.username),"_blank")},M=!!(e!=null&&e.attraction)||!!(e!=null&&e.type)&&!(e!=null&&e.hotel_id)&&!((W=e==null?void 0:e.price)!=null&&W.gross_price),x=(e==null?void 0:e.title)||(e==null?void 0:e.name),P=(Array.isArray(e==null?void 0:e.images)?e.images[0]:null)||(e==null?void 0:e.photo),I=P!=null&&P.includes("w=250&h=140")?P.replace("w=250&h=140","375x210"):P,R=(e==null?void 0:e.review_score)||(e==null?void 0:e.rating),L=(e==null?void 0:e.review_nr)||(e==null?void 0:e.ratingAmount),D=M?((B=e==null?void 0:e.metadata)==null?void 0:B.price)||null:((te=p(e==null?void 0:e.hotel_id))==null?void 0:te.amount)||((E=e==null?void 0:e.price)==null?void 0:E.gross_price)||(e==null?void 0:e.price),H=M?((K=e==null?void 0:e.metadata)==null?void 0:K.currency)||null:(G=p(e==null?void 0:e.hotel_id))!=null&&G.currency?null:((N=e==null?void 0:e.price)==null?void 0:N.currency)||(e==null?void 0:e.currency),b=Mk(t),y=D?Number(D)/Math.max(1,b):null,k=f.useMemo(()=>e!=null&&e.address||e!=null&&e.city_name_en?[e==null?void 0:e.address,e==null?void 0:e.zip,e==null?void 0:e.city_name_en].filter(
272Boolean).join(", "):(e==null?void 0:e.location)||(e==null?void 0:e.neighbourhood)||"",[e]),T=(e==null?void 0:e._id)||(e==null?void 0:e.externalId)||(e==null?void 0:e.hotel_id)||(e==null?void 0:e.googlePlaceId)||(e==null?void 0:e.link),O=s||Array.isArray(o)&&o.some(ee=>{var se,je;return ee?!!([T,e==null?void 0:e._id,e==null?void 0:e.hotel_id,e==null?void 0:e.googlePlaceId,e==null?void 0:e.link].includes(ee)||e!=null&&e.externalId&&e.externalId===ee||(se=e==null?void 0:e.metadata)!=null&&se.id&&e.metadata.id===ee||Array.isArray((je=e==null?void 0:e.metadata)==null?void 0:je.sourceIds)&&e.metadata.sourceIds.includes(ee)):!1});f.useEffect(()=>{g&&!(g!=null&&g._id)&&(e!=null&&e._id)&&c&&(c==null||c(e),m(null))},[g,e==null?void 0:e._id]);const q=f.useMemo(()=>{var ee,se,je,be,ge;if(!O)return null;if(Array.isArray(n)&&n.length){for(const re of n)if(Array.isArray(re==null?void 0:re.items))for(const U of re.items){const we=((se=(ee=U==null?void 0:U.place)==null?void 0:ee.metadata)==null?void 0:se.id)||((je=U==null?void 0:U.place)==null?void 0:je._id)||(U==null?void 0:U.placeId)||(U==null?void 0:U.place)||(U==null?void 0:U.id);if(!we)continue;if(T.includes(we)||(e==null?void 0:e.externalId)&&e.externalId===we||((be=e==null?void 0:e.metadata)==null?void 0:be.id)&&e.metadata.id===we||Array.isArray((ge=e==null?void 0:e.metadata)==null?void 0:ge.sourceIds)&&e.metadata.sourceIds.includes(we))return{bookingStatus:(U==null?void 0:U.bookingStatus)||"Booked",checkinTime:U==null?void 0:U.startTime,checkoutTime:U==null?void 0:U.endTime}}}return null},[n,T,e,O]),z=O&&!q,V=()=>{O&&(c==null||c(e),c&&m(e))};return r.jsxs("div",{className:`acco-list-card ${O&&q?"in-trip":""} ${z?"saved-unscheduled":""}`,style:{cursor:O?"pointer":"default"},onClick:V,children:[r.jsx("div",{className:"image",children:r.jsx(gn,{src:I,type:"accommodation",articleType:"accommodation",color:"green",label:u(M?"accommodationCard.plannedLabel":"accommodationCard.bookingLabel")})}),r.jsxs("div",{className:"content",children:[r.jsxs("div",{className:"top__acco",children:[r.jsx(Z,{name:"hotel",size:14}),r.jsx("h3",{className:"title",children:x}),R?r.jsxs("div",{className:"rating",children:[r.jsx(Z,{name:"star--filled",size:14}),r.jsx("span",{children:Math.round(R*10)/10}),L?r.jsxs("span",{className:"count",children:["(",L,")"]}):null]}):null]}),k?r.jsx("div",{className:"address",children:k}):null,e!=null&&e.description?r.jsx("p",{className:"description",children:e.description}):null,r.jsxs("div",{className:"bottom",children:[!d&&r.jsxs("div",{className:"cta",onClick:$,children:[r.jsx("span",{className:"partner",children:r.jsx("img",{src:Br,alt:"Booking"})}),D?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"price",children:r.jsx(vn,{value:y||0,baseCurrency:H,decimals:0})}),r.jsx("span",{className:"per",children:u("accommodationCard.perNight")}),r.jsx(Z,{name:"externalLink",size:14,fill:ar.black})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{children:u("accommodationCard.viewOnBooking")}),r.jsx(Z,{name:"externalLink",size:14,fill:ar.black})]})]}),t?r.jsxs("div",{className:"actions",children:[r.jsx("div",{onClick:_,className:`actions__button--acco ${S?"bookmarked":""}`,children:r.jsx(Z,{name:S?"bookmark":"bookmark-outline"})}),r.jsx("div",{onClick:ee=>{ee.stopPropagation(),ee.preventDefault(),O?a==null||a(e):i==null||i()},className:`actions__button--acco ${O?"in-trip":""}`,children:r.jsx(Z,{name:O?"tick":"plus",size:14})})]}):null]}),z&&r.jsxs(r.Fragment,{children:[r.jsx("hr",{className:"intrip-separator"}),r.jsx("div",{className:"intrip-info",children:r.jsxs("div",{className:"intrip-info__label--saved",children:[r.jsx(Z,{name:"calendar",size:14}),r.jsx("span",{children:u("accommodationCard.savedNotScheduled")})]})})]}),q&&r.jsxs(r.Fragment,{children:[r.jsx("hr",{className:"intrip-separator"}),r.jsxs("div",{className:"intrip-info",children:[q.bookingStatus==="confirmed"&&r.jsxs("div",{className:"intrip-info__label--acco",children:[r.jsx(Z,{name:"tick",size:14}),r.jsx("span",{children:u("accommodationCard.booked")})]}),q.checkinTime&&r.jsxs("div",{className:"intrip-info__label--acco",children:[r.jsx(Z,{name:"checkin-clock",size:14}),r.jsx("span",{children:u("accommodationCard.checkIn",{time:q.checkinTime})})]}),q.checkoutTime&&r.jsxs("div",{className:"intrip-info__label--acco",children:[r.jsx(Z,{name:"checkout-clock",size:14}),r.jsx("span",{children:u("accommodationCard.checkOut",{time:q.checkoutTime})})]})]})]})]})]})},Ak=f.memo(Ok),Bk=(e="")=>{const{paths:t,optionPaths:n,nonBookedPaths:o,focus:s,mapItems:i,highlight:a,highlightSource:c,countryHighlights:l,mapFocus:d,fullMap:u,dismissedFocusIds:p,dismissedFocusContentKeys:h}=Dl(g=>g==null?void 0:g.map)??{};return{paths:t,optionPaths:n,nonBookedPaths:o,focus:s,mapItems:i,highlight:a,highlightSource:c,countryHighlights:l,mapFocus:d,fullMap:u,dismissedFocusIds:p,dismissedFocusContentKeys:h}},Lk=2e3;function Dk(e){const{isAffiliate:t,category:n,surface:o,provider:s,position:i,card_instance_id:a,destination_id:c,trip_id:l,world_regi
272on:d,location:u}=e,p=f.useRef(null),h=f.useRef(!1),g=f.useRef(!1),m=f.useRef(null);return f.useEffect(()=>{if(!t)return;const v=p.current;if(!v||typeof IntersectionObserver>"u")return;const j={...s!==void 0&&{provider:s},...n!==void 0&&{category:n},...o!==void 0&&{surface:o},...i!==void 0&&{position:i},...a!==void 0&&{card_instance_id:a},...c!==void 0&&{destination_id:c},...l!==void 0&&{trip_id:l},...d!==void 0&&{world_region:d}},S=()=>{if(!h.current&&!(typeof document<"u"&&document.visibilityState!=="visible")){h.current=!0;try{Ke("affiliate_card_impression",j,u)}catch{}}},_=()=>{if(!g.current){g.current=!0;try{Ke("affiliate_card_engaged",j,u)}catch{}}},$=new IntersectionObserver(M=>{const x=M[0];x&&(x.isIntersecting?(S(),!g.current&&m.current===null&&(m.current=setTimeout(()=>{m.current=null,_()},Lk))):m.current!==null&&(clearTimeout(m.current),m.current=null))},{threshold:.3});return $.observe(v),()=>{$.disconnect(),m.current!==null&&(clearTimeout(m.current),m.current=null)}},[t]),p}const Zr=({text:e,tooltip:t})=>e?r.jsxs("div",{className:"hashtag","data-tip":t,children:["#",e]}):null,Fk=({price:e,currency:t,label:n="from"})=>r.jsxs("div",{className:"card-tag price-tag",children:[n," ",r.jsx(vn,{value:e,baseCurrency:t})]});const xt=({text:e,icon:t,color:n="black",flag:o=!1,tooltip:s})=>e?r.jsxs("div",{className:`card-tag ${n} ${o?"flag":""}`,"data-tip":s,children:[t?r.jsx("div",{className:"icon",children:r.jsx(Z,{name:t})}):null,e]}):null,Hk=({acco:e,price:t,currency:n,photo:o,inList:s,currentDestination:i,type:a="icon",label:c="Add",isOwner:l=!0,setModalIsOpen:d})=>{const[u]=Jt(),{createAccommodationExpense:p,getExpenseId:h,deleteExpense:g}=tn(),{addAccommodationToDestination:m,removeAccommodationFromDestination:v}=rt(),j={city:i==null?void 0:i.normalised_city,country:i==null?void 0:i.country,source_type:"booking_api"},S=async x=>{x.preventDefault(),x.stopPropagation();const P={photo:o,price:t,currency:n,...e};s||(m(P),p(e,P),u("Accommodation added to plan! ð",Ce?2e3:4e3),Ke("add_to_trip_sleep",j,"search_result"),Bn.event({category:"add_to_trip",action:"add_to_trip_sleep",label:e==null?void 0:e.name})),Ct.hide()},_=async x=>{var P;x.stopPropagation(),x.preventDefault(),Ct.hide(),(P=i.property)!=null&&P[0]?mo({title:"Update accommodation",message:"Are you sure you want to replace this accommodation?",buttons:[{label:"Yes",onClick:()=>{var I,R,L;v((R=(I=i.property)==null?void 0:I[0])==null?void 0:R._id),g(h((L=i.property)==null?void 0:L[0].hotel_id)),setTimeout(()=>S(x),1e3)}},{label:"No",onClick:()=>""}]}):S(x)},$=x=>{x.preventDefault(),x.stopPropagation(),Ct.hide(),d("is-closing"),mo({title:"Remove accommodation",message:"Are you sure you want to remove this accommodation from your plan?",buttons:[{label:"Yes",onClick:()=>{var P,I,R;v((I=(P=i.property)==null?void 0:P[0])==null?void 0:I._id,i==null?void 0:i._id),g(h((R=i.property)==null?void 0:R[0].hotel_id)),u("Accommodation removed from plan",Ce?2e3:4e3),Ke("delete_from_trip_sleep",j,"destination_page")}},{label:"No",onClick:()=>""}]})},M=()=>a==="icon"?"btn-text black green-hover":a==="list"?"list-btn":`btn-rounded ${s?"remove":""} with-icon solid big`;return s&&l?r.jsxs("div",{className:`${M()}`,onClick:$,"data-tip":a==="icon"?"Remove from trip":"",children:[r.jsx(Z,{name:"trash"})," ",a!=="icon"?r.jsx("span",{children:c}):null]}):l?r.jsxs("div",{className:`${M()}`,onClick:_,"data-tip":a==="icon"?"Add to trip":"",children:[r.jsx(Z,{name:"addCircle"})," ",a!=="icon"?r.jsx("span",{children:c}):null]}):null},qk=({inList:e,activity:t,type:n="icon",label:o="Add",isOwner:s=!0,currentDestination:i,setModalIsOpen:a})=>{var _;const{match:c}=Tt(),[l]=Jt({style:{backgroundColor:Dr.main3}}),{createActivityExpense:d,getExpenseId:u,deleteExpense:p}=tn(),{addActivityToDestination:h,removeActivityFromDestination:g}=rt(),m={city:(_=c==null?void 0:c.params)==null?void 0:_.destination,source_type:"foursquare_api"},v=async $=>{$.preventDefault(),$.stopPropagation(),e||(h(t),d(t),l("Activity added to plan",Ce?2e3:4e3),Bn.event({category:"add_to_trip",action:"add_to_trip_see_do",label:t==null?void 0:t.name}),Ke("add_to_trip_see_do",m,"search_result")),Ct.hide()},j=$=>{$.preventDefault(),$.stopPropagation(),a("is-closing"),g(t.name,i._id),p(u(t.fsq_id)),l("Activity removed from plan",Ce?2e3:4e3),Ke("delete_from_trip_see_do",m,"destination_page"),Ct.hide()},S=()=>n==="icon"?"btn-text black orange-hover":n==="list"?"list-btn":`btn-rounded ${e?"remove":"btn-rounded-3"} with-icon solid big`;return e&&s?r.jsxs("div",{className:`${S()} remove`,onClick:j,"data-tip":n==="icon"?"Remove from trip":"",children:[r.jsx(Z,{name:"trash"})," ",n!=="icon"?o:null]}):s?r.jsxs("div",{className:S(),onClick:v,"data-tip":n==="icon"?"Add to trip":"",children:[r.jsx(Z,{name:"addCircle"})," ",n!=="icon"?r.jsx("span",{children:o}):null]}):null},Vk=({inList:e,tour:t,type:n="icon",label:o="Add",isOwner:s=!0,setModalIsOpen:i})=>{var N;const{match:a}=Tt(),{title:c,description:l,pricing:d,productUrl:u,reviews:p,images:h,productC
272ode:g,flags:m,tags:v,name:j,tour_id:S,tour_code:_,cond_language:$,abstract:M,bestseller:x,certified:P,has_pick_up:I,overall_rating:R,number_of_ratings:L,pictures:D,coordinates:H,price:b,locations:y,url:k}=t,[T]=Jt({style:{backgroundColor:Dr.main3}}),{createTourExpense:O,getExpenseId:q,deleteExpense:z}=tn(),{addActivityToDestination:V,removeActivityFromDestination:W}=rt(),te={city:(N=a==null?void 0:a.params)==null?void 0:N.destination,source_type:"viator_api"},E=async K=>{var se;K.preventDefault(),K.stopPropagation(),Bn.event({category:"add_to_trip",action:"add_to_trip_tour",label:c});const ee={images:h,description:l,name:c||j,title:c,notes:"",price:((se=d==null?void 0:d.summary)==null?void 0:se.fromPrice)||b,pricing:d,url:u||k,reviews:p,productCode:g,flags:m,tags:v,tour_id:S,tour_code:_,cond_language:$,abstract:M,bestseller:x,certified:P,has_pick_up:I,overall_rating:R,number_of_ratings:L,pictures:D,coordinates:H,locations:y};e||(V(ee),O(ee),T("Tour added to plan! ð",Ce?2e3:4e3),Ke("add_to_trip_tour",te,"search_result")),Ct.hide()},B=K=>{K.preventDefault(),i("is-closing"),W(c||t.name),z(q(t.productCode)),T("Tour removed from plan",Ce?2e3:4e3),Ke("delete_from_trip_tour",te,"destination_page"),Ct.hide()},G=()=>n==="icon"?"btn-text black orange-hover":n==="list"?"list-btn":`btn-rounded ${e?"remove":"btn-rounded-3"} with-icon solid big`;return e&&s?r.jsxs("div",{className:`${G()}`,onClick:B,"data-tip":n==="icon"?"Remove from trip":"",children:[r.jsx(Z,{name:"trash"})," ",n!=="icon"?r.jsx("span",{children:o}):null]}):s?r.jsxs("div",{className:G(),onClick:E,"data-tip":n==="icon"?"Add to trip":"",children:[r.jsx(Z,{name:"addCircle"}),n!=="icon"?r.jsx("span",{children:o}):null]}):null},zk=({article:e,inList:t,buttonType:n="icon",label:o="view",color:s="black",setModalIsOpen:i})=>{const{_id:a,link:c,type:l,city:d,normalised_city:u,cityEnglish:p,country:h,latitude:g,longitude:m}=e,v=l==="country",{Close:j,Moment:S}=ti(),{currentTrip:_,currentDestination:$,addDestinationToTrip:M}=rt(),{createResearchExpense:x}=tn(),[P]=Jt(),[I,R]=f.useState(!1),[L,D]=f.useState({}),{addResearchToTrip:H,removeResearchFromTrip:b}=go(),y=()=>{var te,E,B,G,N;const z="destination_page",V=e!=null&&e.bookingData?"custom_booking_api":e!=null&&e.googleUrl?"custom_google_api":"custom_url",W={content_owner_type:e!=null&&e.author?oi((E=(te=e==null?void 0:e.author)==null?void 0:te[0])==null?void 0:E.isCreator):"creator",content_owner_username:(G=(B=e==null?void 0:e.author)==null?void 0:B[0])==null?void 0:G.username,category:(N=e==null?void 0:e.tags)==null?void 0:N.map(K=>K==null?void 0:K.name),city:e==null?void 0:e.city,country:e==null?void 0:e.country,source_type:V,url:c||e.website};Ke(`add_to_profile_${Na(l)}`,W,z),Ke(`add_to_trip_${Na(l)}`,W,z)},k=(z,V,W,te,E,B,G,N,K="")=>{var se,je;Ct.hide();let ee=V?_._id:K.length>0?K:(se=_==null?void 0:_.destinations)==null?void 0:se.filter(be=>be.normalised_city===E||be.cityEnglish===E);if(Array.isArray(ee))if(ee.length>1){i(!0),R(!0),D({id:z,destinationId:ee,type:W});return}else ee.length===1?ee=((je=ee[0])==null?void 0:je._id)||ee[0]:mo({title:"You don't have this destination in your plan yet.",message:"Do you want to add it?",buttons:[{label:"Yes",onClick:()=>{M({latitude:parseFloat(G),longitude:parseFloat(N),city:te,duration:1,country:B,cityEnglish:p||E||te},null,be=>{var ge,re,U,we;return H({type:W,link:c,destinationId:(we=(ge=be==null?void 0:be.trip)==null?void 0:ge.destinations)==null?void 0:we[((U=(re=be==null?void 0:be.trip)==null?void 0:re.destinations)==null?void 0:U.length)-1]._id,tripId:_._id})}),P("Destination and research added to plan")}},{label:"No",onClick:()=>console.log("Not adding")}]});H({type:W,link:c,destinationId:ee,tripId:_._id}),y(),W==="accommodation"&&x(e,e==null?void 0:e.tags)},T=()=>{const z={_id:a,isCountry:v,city:d,country:h,link:c,destinationId:$._id,type:l==="activity"?"Activities":l==="accommodation"?"Accommodations":l==="cuisine"?"cuisine":"Articles"};i("is-closing"),b(_._id,z),P("Research removed from plan"),Ct.hide()},O=()=>{var te;const{id:z,destinationId:V,type:W}=L;return r.jsxs(Lr,{ariaHideApp:!1,isOpen:I,onRequestClose:()=>R(!1),overlayClassName:"simple-modal",className:"rounded-modal add-research-modal ",children:[r.jsx(j,{onClick:()=>R(!1)}),r.jsxs("header",{className:"green",children:[r.jsx("div",{className:"icon-rounded",children:r.jsx(Z,{name:"bed"})}),r.jsxs("h2",{children:["You are visiting ",r.jsx("strong",{children:(te=V==null?void 0:V[0])==null?void 0:te.city})," more than once."]})]}
272),r.jsx("p",{children:"To which destination would you like to add the research?"}),V==null?void 0:V.map(({_id:E,normalised_city:B,city:G,duration:N,startDate:K,endDate:ee,latitude:se,longitude:je})=>r.jsxs("div",{className:"destination-option",onClick:()=>{k(z,v,W,G,B,h,se,je,E),R(!1),D({}),P("Research added to plan",Ce?2e3:4e3)},children:[r.jsxs("h3",{children:[G," - ",r.jsx(S,{format:"long",children:K})," - ",r.jsx(S,{format:"long",children:ee})]}),r.jsx("small",{children:`${N} night${N>1?"s":""} `})]}))]})},q=()=>n==="icon"?"btn-text black green-hover":n==="list"?"list-btn":`btn-rounded ${t?"remove":`btn-rounded-${s}`} ${l!=="activity"&&l!=="accommodation"?"outlined":""} with-icon solid big`;return r.jsxs("div",{children:[t?r.jsxs("div",{className:`${q()} `,"data-tip":n==="icon"?"Remove from trip":"",onClick:z=>{z.preventDefault(),z.stopPropagation(),T()},children:[r.jsx(Z,{name:"trash"})," ",n!=="icon"?"Remove":null]},a):r.jsxs("div",{className:`${q()}`,"data-tip":n==="icon"?"Add to trip":"",onClick:z=>{z.stopPropagation(),z.preventDefault(),k(a,v,l,d,u,h,g,m)},children:[r.jsx(Z,{name:"addCircle"})," ",n!=="icon"?o:null]},a),O()]},a)},vc=({article:e,state:t="outline",isInsideTrip:n,buttonType:o="icon",color:s="1"})=>{const{link:i,type:a,city:c,country:l}=e,[d,u]=f.useState(!1),[p]=Pc(Ic.auth),[h]=Jt(),{addResearch:g,deleteResearch:m,allResearch:v,addResearchLoading:j,deleteResearchLoading:S}=go(!0),_=v==null?void 0:v.map(R=>(R==null?void 0:R.link)||(R==null?void 0:R.googlePlaceId)),$=j||S,M=(R,L)=>{R.preventDefault(),L.original_author||(L.original_author=L.addedBy),delete L._id,delete L.addedBy,g({...L},"global"),h("Article added to research!",Ce?2e3:4e3),Ke("research_saved",{type:a,destination:c||l},"destination_page"),Ct.hide()},x=R=>{mo({title:"Are you sure you want to delete this item?",message:"This will remove it from all your trips and pages.",buttons:[{label:"Yes",onClick:()=>{m(R,()=>{h("Research removed")})}},{label:"No",onClick:()=>console.log("Not deleting")}]})},P=_==null?void 0:_.includes(e==null?void 0:e.link),I=()=>o==="icon"?"btn-text black green-hover":o==="button"?`btn-rounded ${P?"remove":`btn-rounded-${s}`} ${a!=="activity"&&a!=="accommodation"?"outlined":""} with-icon solid big`:"list-btn";return r.jsxs(r.Fragment,{children:[$?r.jsx(hl,{}):p?r.jsx("div",{className:`${I()} `,"data-tip":_!=null&&_.includes(e==null?void 0:e.link)?"Remove from collection":"Save to collection",onClick:R=>{R.stopPropagation(),R.preventDefault(),_!=null&&_.includes(e==null?void 0:e.link)?x({link:i,type:a,city:c,country:l}):M(R,{...e,state:"wishlist"})},children:_!=null&&_.includes(e==null?void 0:e.link)&&!n?r.jsxs(r.Fragment,{children:[r.jsx(Z,{name:"trash"})," ",o!=="icon"?"Remove":null]}):r.jsxs("div",{className:`bookmark-icon ${e!=null&&e.link&&_!=null&&_.includes(e==null?void 0:e.link)?"active":t}`,children:[r.jsx(Z,{name:"bookmark"})," ",o!=="icon"?`${_!=null&&_.includes(e==null?void 0:e.link)?"Remove":"Save"}`:null]})}):r.jsxs("div",{className:`${I()} `,"data-tip":"Save to collection",onClick:R=>{R.stopPropagation(),R.preventDefault(),u(!0)},children:[r.jsx("div",{className:"bookmark-icon outline",children:r.jsx(Z,{name:"bookmark"})}),o!=="icon"?"Save":null]}),r.jsx(ml,{loginModalIsOpen:d,setLoginModalIsOpen:u,onLogin:()=>{u(!1)},LoginTitle:"Login to bookmark this link",RegisterTitle:"Signup to bookmark this link"})]})},ea=({item:e,currentDestination:t,type:n,articleType:o,inList:s,isOwner:i,general:a,pricing:c,buttonType:l,setModalIsOpen:d,isInsideTrip:u})=>n==="activity"?r.jsx(qk,{inList:s,activity:e,currentDestination:t,type:l,label:s?"Remove":"Add to trip",isOwner:i,setModalIsOpen:d},e.fsq_id||e.id):n==="tour"?r.jsx(Vk,{inList:s,tour:e,type:l,label:s?"Remove from trip":"Add to trip",isOwner:i,setModalIsOpen:d},e._id):n==="accommodation"?r.jsx(Hk,{inList:s,photo:a.image,price:c.price,currency:c.currency,currentDestination:t,acco:e,type:l,label:s?"Remove from trip":"Add to trip",isOwner:i,setModalIsOpen:d},e._id):n==="article"&&u?r.jsx(zk,{article:{...e,latitude:e.lat,longitude:e.lng},inList:s,buttonType:l,label:s?"Remove":"Add to trip",color:o==="accommodation"?"1":o==="activity"?"3":o==="cuisine"?"4":"black",setModalIsOpen:d},e._id):n==="article"&&!u?r.jsx(vc,{article:e,isInsideTrip:u,buttonType:l,color:o==="accommodation"?"1":o==="activity"?"3":o==="cuisine"?"4":"black"}):null;const Wk=({notes:e})=>{const[t,n]=f.useState(""),[o,s]=f.useState(Mt.EditorState.createWithContent(Mt.ContentState.createFromText("")));return f.useEffect(()=>{e!==""&&e!==void 0&&s(e&&typeof e=="string"&&e!==""?ri(e):Mt.EditorState.createWithContent(Mt.ContentState.createFromText("")))},[e]),f.useEffect(()=>{n(ai(o.getCurrentContent()))}
272,[o]),e&&t!=="<p><br></p>"?r.jsx("div",{className:"notes-section",children:r.jsx(gl,{value:e})}):null};const Uk=({title:e,items:t})=>(t==null?void 0:t.length)>0?r.jsxs("div",{className:"detail-section",children:[r.jsx("h4",{children:e}),t==null?void 0:t.map((n,o)=>r.jsxs("div",{className:"tip",children:[r.jsx("span",{children:r.jsx(vl,{format:"fullShort",children:n==null?void 0:n.created_at})}),r.jsx("p",{children:n==null?void 0:n.text})]},o))]}):null;const Gk=({affiliate:e,link:t,handleTracking:n})=>r.jsxs("a",{className:`affiliate-button ${e}`,href:t,target:"_blank",onClick:n,children:[r.jsx(ni,{name:e}),"View on ",r.jsx("span",{children:e})]});const Yk=({item:e,type:t,destinationId:n,isOwner:o})=>{var M;const{t:s}=Et(["dashboard"]),[i]=Jt(),[a]=Jt({style:{backgroundColor:Dr.main3}}),{bookActivity:c,currentTrip:l}=rt(),[d]=kt(Js,{refetchQueries:["Trip","PublicTrip"],awaitRefetchQueries:!0}),u=t==="accommodation",p=u&&(e!=null&&e._id)?To({_id:e._id,attraction:"accommodation",type:"accommodation"},l):null,h=!!(p!=null&&p.assignedDayId),g=(p==null?void 0:p.bookingStatus)==="confirmed",m=u?g:e.booked||!1,v=u&&!h,j=e.name||((M=e==null?void 0:e.metadata)==null?void 0:M.title),S=x=>{Bn.event({category:"Booked",action:"change_booked",label:t}),Ke("set_booked",{type:t,name:j,booked:x},"destination_page")},_=async()=>{var P;if(!((P=p==null?void 0:p.dayIdsWithThisAccommodation)!=null&&P.length)||!(e!=null&&e._id))return;const x=g?"none":"confirmed";S(g);try{await Promise.all(p.dayIdsWithThisAccommodation.map(I=>d({variables:{dayId:I,placeId:e._id,bookingStatus:x}}))),x==="confirmed"?i(`${j} booked!`,Ce?2e3:4e3):i(`${j} unbooked`,Ce?2e3:4e3)}catch(I){console.error("[SetBooked] Failed to update booking status:",(I==null?void 0:I.message)||I)}},$=x=>{if(x.stopPropagation(),x.preventDefault(),!v){if(u){_();return}t==="activity"&&(S(e.booked||!1),c(n,(e==null?void 0:e.productCode)||(e==null?void 0:e.fsq_id)||(e==null?void 0:e.id)||(e==null?void 0:e._id)||(e==null?void 0:e.tour_id)||(e==null?void 0:e.tour_code),()=>{e.booked?a(`${j} unbooked`,Ce?2e3:4e3):a(`${j} booked!`,Ce?2e3:4e3)}))}};return o?r.jsxs("div",{className:"card-detail-row__row booked-row",style:v?{opacity:.4,cursor:"default"}:void 0,title:v?s("inTripSection.status.notAssignedHint","This hotel isn't assigned to any trip nights yet"):void 0,onClick:$,children:[r.jsx("h4",{children:"Booked"}),r.jsx(ei,{name:`${j}-booked`,checked:m,color:t==="accommodation"?"green":t==="activity"?"orange":"magenta",handleChange:$})]}):null};const Kk=({label:e,onClick:t,icon:n})=>r.jsxs("div",{className:"action-button",onClick:t,children:[n?r.jsx("div",{className:"icon",children:r.jsx(Z,{name:n})}):null,r.jsx("div",{className:"title",children:e})]});const bc=({picture:e,name:t,status:n,onEdit:o,withEdit:s=!0})=>{const i=n==="wishlist"?"bookmark-outline":n==="positive"?"heart":n==="negative"?"heart-broken":"check",a=n==="positive"?"primary-1":n==="negative"?"primary-2":"grey-light",c=n==="positive"?"Recommended":n==="negative"?"Not recommended":n==="visited"?"Visited":"Wishlist",{user:l}=lt();return r.jsxs("div",{className:"main-card-detail-header",children:[r.jsxs($t,{to:`/${t||(l==null?void 0:l.username)}`,className:"main-card-detail-header__user",children:[r.jsx(yn,{image:e}),r.jsxs("div",{className:"title",children:[r.jsx("h4",{children:t}),r.jsxs("div",{className:`status ${a}`,children:[r.jsx(Z,{name:i}),r.jsx("span",{children:c})]})]})]}),s?r.jsx("div",{className:"action",children:r.jsx(Kk,{label:"Edit",icon:"editOutlined",onClick:o})}):null]})},Xk=({address:e})=>{const t=e?`https://www.google.com/maps/search/?api=1&query=${e}`:null;return e?r.jsxs("div",{className:"card-detail-row__row",children:[r.jsx("h4",{children:"Address"}),r.jsx("a",{href:t,target:"_blank",children:e})]}):null},Qk=({link:e,label:t})=>e?r.jsxs("div",{className:"card-detail-row__row",children:[r.jsx("h4",{children:t}),r.jsx("a",{href:e,target:"_blank",children:e})]}):null;const Jo=({children:e})=>r.jsx("div",{className:"card-detail-row__container",children:e}),Jk=({text:e,label:t})=>r.jsxs("div",{className:"card-detail-row__row",children:[r.jsx("h4",{children:t}),r.jsx("p",{children:e})]}),Zk=({type:e,articleType:t,general:n,rating:o,pricing:s,business:i,meta:a,currentDestinationId:c,currentDestination:l,inList:d=!1,isOpen:u,isInsideTrip:p,handleModalIsOpen:h,animation:g,setModalAnimation:m,containerRef:v,isFullscreen:j=!1,isOwner:S=!0,color:_,item:$,handleTracking:M})=>{var E,B,G,N;const{history:x}=Tt(),{publicUser:P,user:I}=lt(),{currentDestination:R}=rt(),L=An(),[D,H]=f.useState(!1),b=l||R,y=(E=[...(b==null?void 0:b.allActivities)||[],...(b==null?void 0:b.allAccommodations)||[]].filter(K=>
272!!K.productCode&&K.productCode===$.productCode||!!K.fsq_id&&K.fsq_id===$.fsq_id||!!K._id&&K._id===$._id))==null?void 0:E[0],k={...$,...y},T=((B=k==null?void 0:k.author)==null?void 0:B[0])||(k==null?void 0:k.author)||P.user,O=(T==null?void 0:T.picture)||(T==null?void 0:T.image)||(T==null?void 0:T.avatar),q=x.location.pathname.includes("todo")||x.location.pathname.includes("accommodations")?"large-offset":"",z=["booking","hostelworld","airbnb","tripadvisor","viator"],V=z==null?void 0:z.filter(K=>{var ee;return(ee=n==null?void 0:n.url)==null?void 0:ee.includes(K)}),W=n.url?Lt(n.url,I==null?void 0:I.username):n.url,te=i!=null&&i.website?Lt(i.website,I==null?void 0:I.username):i==null?void 0:i.website;return r.jsx(Lr,{ariaHideApp:!1,isOpen:u,onRequestClose:()=>m("is-closing"),overlayClassName:`card-detail-modal-wrapper ${g} ${j||Ma?"fullscreen-mode":""}`,className:"card-detail-modal-wrapper-content",shouldCloseOnOverlayClick:!1,closeTimeoutMS:200,children:r.jsxs("div",{className:`card-detail-modal ${q} ${u?"open":"closed"} ${j||Ma?"fullscreen-mode":""} ${g} ${S?"":"public-view"} ${e}`,ref:v,onAnimationEnd:h,children:[r.jsxs("header",{className:"card-detail-modal__header",children:[r.jsx(bl,{onClick:()=>m("is-closing")}),r.jsx("div",{className:"background",children:r.jsx(gn,{src:n.image,type:e,articleType:t,color:_})})]}),r.jsxs("div",{className:"card-detail-modal__cta ",children:[r.jsxs("div",{className:"title",children:[p?null:r.jsx(bc,{name:T==null?void 0:T.username,picture:O,status:k==null?void 0:k.state,withEdit:S&&!Ce,onEdit:()=>{H(!0)}}),r.jsx("h2",{children:n.title}),o?r.jsxs("div",{className:"right rating",children:[r.jsxs("div",{className:"title",children:[r.jsx("div",{className:"icon",children:r.jsx(Z,{name:"star"})}),r.jsx("span",{children:`${Math.round((o==null?void 0:o.score)*10)/10}/${o==null?void 0:o.maxScore}`})]}),o!=null&&o.amount?r.jsxs("p",{children:[o==null?void 0:o.amount," reviews"]}):null]}):null,r.jsx("div",{className:"badge-container",children:e==="article"?r.jsxs(r.Fragment,{children:[(G=n.categories)==null?void 0:G.map(K=>r.jsx(xt,{text:K==null?void 0:K.name,color:Ta(t||e)},K==null?void 0:K._id)),(N=k==null?void 0:k.hashtags)==null?void 0:N.map(K=>r.jsx(Zr,{text:K==null?void 0:K.value},K==null?void 0:K._id))]}):r.jsx(xt,{text:n.categories||(a==null?void 0:a.flags),color:Ta(t||e)})})]}),r.jsxs("div",{className:`cta-box__wrapper ${_}`,children:[(b!=null&&b.startDate||!L&&(s!=null&&s.price))&&e!=="activity"?r.jsxs("header",{className:"cta-box__header",children:[b!=null&&b.startDate?r.jsxs("div",{className:"dates",children:[r.jsx("div",{className:"icon",children:r.jsx(Z,{name:"calendar"})}),r.jsxs("span",{className:"date",children:[r.jsx(_n,{format:"ddd DD MMM",children:b==null?void 0:b.startDate})," -"," ",r.jsx(_n,{format:"ddd DD MMM",children:b==null?void 0:b.endDate})]})]}):null,!L&&s.price?r.jsxs("div",{className:"pricing",children:[s.price!==void 0?r.jsx("span",{className:"pre",children:"from"}):null,r.jsx("div",{className:"price",children:s.price!==void 0?r.jsx(vn,{value:s.price}):null})]}):null]}):null,r.jsxs("div",{className:`primary-actions ${e==="article"&&t==="article"?"reverse":""}`,children:[p?r.jsx(ea,{item:$,currentDestination:b,type:e,articleType:t,inList:d,isOwner:S,general:n,pricing:s,buttonType:"button",setModalIsOpen:m,isInsideTrip:p}):null,n.url||i!=null&&i.website?!L&&(V==null?void 0:V.length)>0?r.jsx(Gk,{affiliate:V==null?void 0:V[0],link:W,handleTracking:M}):r.jsx(Hl,{label:e==="accommodation"||e==="tour"||t==="accommodation"?`View on ${n.publisher}`:"Visit website",color:"grey",type:"outlined",url:n.url,icon:"planet",size:"large",onClick:M}):null]})]})]}),r.jsxs("div",{className:"content",children:[r.jsx(Wk,{notes:k==null?void 0:k.notes}),d&&p?r.jsx(Jo,{children:r.jsx(Yk,{item:k,destinationId:c,type:e==="tour"||e==="activity"?"activity":e==="article"?t:e,isOwner:S})}):null,n!=null&&n.description?r.jsx(Jo,{children:r.jsx(Jk,{text:n==null?void 0:n.description,label:"Description"})}):null,i!=null&&i.address||i!=null&&i.website?r.jsxs(Jo,{children:[r.jsx(Xk,{address:i==null?void 0:i.address}),r.jsx(Qk,{link:te,label:"Website"})]}):null,r.jsx(Uk,{title:"Foursquare reviews",items:o==null?void 0:o.reviews})]}),r.jsx(Zs,{modalIsOpen:D,setModalIsOpen:H,type:k==null?void 0:k.type,currentDestinationId:b==null?void 0:b._id,editId:k==null?void 0:k._id})]})})},e0=({notes:e})=>{const[t,n]=f.useState(""),[o,s]=f.useState(Mt.EditorState.createWithContent(Mt.ContentState.createFromText("")));return f.useEffect(()=>{e!==""&&e!==void 0&&s(e&&typeof e=="string"&&e!==""?ri(e):Mt.EditorState.createWithContent(Mt.ContentState.createFromText("")))},[e]),f.useEffect(()=>{n(ai(o.getCurrentContent()))}
272,[o]),t!=="<p><br></p>"&&r.jsx("span",{className:"view-notes",dangerouslySetInnerHTML:{__html:t}})};const t0=({type:e,categories:t})=>{var n,o;return r.jsx("div",{className:`card-category ${yl(e)}`,children:(t==null?void 0:t.length)>0?r.jsxs(r.Fragment,{children:[r.jsx(Z,{name:t!=null&&t[0]?(n=t==null?void 0:t[0])==null?void 0:n._id:"article"}),r.jsx("span",{children:((o=t==null?void 0:t[0])==null?void 0:o.name)||t}),(t==null?void 0:t.length)>1&&e==="article"?r.jsx("div",{children:r.jsxs("span",{children:["+",(t==null?void 0:t.length)-1]})}):null]}):null})};const n0=({username:e,picture:t,status:n})=>{const o=n==="positive"?"primary-1":n==="negative"?"primary-2":n==="visited"?"grey-dark":"black",s=n==="positive"?"heart":n==="negative"?"heart-broken":n==="visited"?"check":"bookmark-outline",i=n==="positive"?"Recommended":n==="negative"?"Not recommended":n==="visited"?"Visited":"Wishlist";return r.jsxs("div",{className:"card-state",children:[r.jsx(yn,{image:t}),r.jsxs("div",{className:"state",children:[r.jsx("div",{className:`icon ${o}`,children:r.jsx(Z,{name:s})}),r.jsxs("span",{children:[r.jsx("strong",{children:i})," by ",e]})]})]})};const Ys=({item:e,type:t,articleType:n,color:o,general:s,pricing:i,inList:a,isOwner:c,setModalAnimation:l,isInsideTrip:d,currentDestination:u})=>{var p,h,g,m,v,j;return r.jsxs("div",{className:"main-card-mobile__inner",children:[r.jsxs("div",{className:"main-card-mobile__header",children:[r.jsx("div",{className:"main-card-mobile__image",children:r.jsx(gn,{src:s.image,type:t,articleType:n,color:o,label:t==="article"?(h=(p=s.categories)==null?void 0:p[0])==null?void 0:h.name:t==="accommodation"?"accommodation":s.publisher})}),r.jsxs("div",{className:"main-card-mobile__titles",children:[r.jsx("div",{className:"main-card-mobile__cat",children:r.jsx(t0,{categories:s.categories,type:n||t})}),r.jsx("div",{className:"main-card-mobile__title",children:r.jsx("h2",{children:s==null?void 0:s.title})}),i!=null&&i.price&&(i==null?void 0:i.price)>0&&(t==="accommodation"||t==="tour")?r.jsxs("div",{className:"main-card-mobile__price",children:["From ",r.jsx(vn,{value:i==null?void 0:i.price,baseCurrency:i==null?void 0:i.currency})," "]}):null,((g=e==null?void 0:e.hashtags)==null?void 0:g.length)>0?r.jsx("div",{className:"main-card-mobile__tags",children:(m=e==null?void 0:e.hashtags)==null?void 0:m.map(S=>r.jsx(Zr,{text:`${S.value}`}))}):null]}),r.jsx("div",{className:"main-card-mobile__action",children:r.jsx(ea,{item:e,currentDestination:u,type:t,articleType:n,inList:a,isOwner:c,general:s,pricing:i,buttonType:"icon",setModalIsOpen:l,isInsideTrip:d},(e==null?void 0:e._id)||(e==null?void 0:e.id)||(e==null?void 0:e.productCode))})]}),t==="article"&&(e!=null&&e.author)?r.jsx("div",{className:"main-card-mobile__meta",children:r.jsx(n0,{status:e==null?void 0:e.state,picture:(v=e==null?void 0:e.author)==null?void 0:v.picture,username:(j=e==null?void 0:e.author)==null?void 0:j.username})}):null,r.jsx("div",{className:"main-card-mobile__description",children:r.jsx("p",{children:s.description})})]})},o0=({type:e,articleType:t,addedBy:n,general:o,rating:s,pricing:i,business:a,meta:c,display:l="normal",currentDestinationId:d,currentDestination:u,isInsideTrip:p=!0,inList:h=!1,hideDescription:g=!1,withDetail:m=!1,isFullscreen:v=!1,itineraryView:j,isOwner:S,item:_,setMapPreview:$})=>{var w,X,Q,ue,Y,fe,ye,Ue;const M=Vt(),{match:x,history:P}=Tt(),{user:I,publicUser:R}=lt(),L=((w=x==null?void 0:x.params)==null?void 0:w.username)===(I==null?void 0:I.username),[D,H]=f.useState(!1),[b,y]=f.useState(""),{highlight:k}=Bk(),{isPresentationMode:T}=Co(),O=f.useRef(),q=((X=_==null?void 0:_.author)==null?void 0:X[0])||(_==null?void 0:_.author)||R.user,z=(q==null?void 0:q.picture)||(q==null?void 0:q.image)||(q==null?void 0:q.avatar);f.useEffect(()=>(document.addEventListener("mousedown",je),()=>{document.removeEventListener("mousedown",je)}),[]);const V=!!_&&(e==="accommodation"||e==="tour"||((Q=o==null?void 0:o.url)==null?void 0:Q.includes("booking.com"))||((ue=o==null?void 0:o.url)==null?void 0:ue.includes("hostelworld.com"))||((Y=o==null?void 0:o.url)==null?void 0:Y.includes("viator.com"))||((fe=o==null?void 0:o.url)==null?void 0:fe.includes("getyourguide.com"))),W=e==="accommodation"||t==="accommodation"?"sleep":e==="activity"||t==="activity"?"see_do":e==="tour"?"tour":t==="cuisine"?"eat_drink":"article",te=(()=>{var C,ae,Ne,Xe;return((C=x==null?void 0:x.params)==null?void 0:C.username)===(((ae=R==null?void 0:R.user)==null?void 0:ae.username)??void 0)&&!((Ne=x==null?void 0:x.params)!=null&&Ne.tripname)?"self_profile":x.path==="/:username"||x.path==="/:username/:country"||x.path==="/:username/:country/:city"?"profile":x.path.includes("/discover")&&!p?"discover":p&&x.path.includes("trip/:name/:destination")&&P.location.hash==="#collection"?"in_trip_destination_collection":p&&x.path.includes("trip/:name/:destination")&&P.location.hash==="#intrip"?"in_trip_destination_plan":p&&x.path.includes("trip/:name/:destination")?"in_trip_destination_discover":p&&x.path.includes("trip/:name/research")?"in_trip_collection":p&&x.path.includes("trip/:name/inspire")?"in_trip_discover":x.path.includes("/:name/details")||(Xe=x==null?void 0:x.params)!=null&&Xe.tripname&&x.params.username?"storyview":""})(),E=Tr(rr(o.url)),B=wl(W,e),G=xl(te),N=d||(u==null?void 0:u._id),K=kl({destination_id:N,provider:E}
272),ee=u==null?void 0:u.world_region,se=Dk({isAffiliate:V,provider:E,category:B,surface:G,destination_id:N,card_instance_id:K,world_region:ee,location:Pa(te)});if(!_)return null;const je=Be=>{var Ne;const C=document.querySelector(".simple-modal"),ae=document.querySelector(".add-places-modal");(Ne=O==null?void 0:O.current)!=null&&Ne.contains(Be.target)||C!=null&&C.contains(Be.target)||ae!=null&&ae.contains(Be.target)||Ce||y("is-closing")},be=()=>{D?y("is-closing"):(H(!0),y("is-opening"))},ge=()=>{b==="is-opening"?(H(!0),y("")):(H(!1),y(""))},re=(_==null?void 0:_.notes)!==""&&(_==null?void 0:_.notes)!==void 0&&!((ye=_==null?void 0:_.notes)!=null&&ye.includes('"text":""')),U=e==="activity"||e==="tour"||t==="activity"?"orange":e==="accommodation"||t==="accommodation"?"green":t==="cuisine"?"purple":"black",we=e==="accommodation"||t==="accommodation"?"bed--outlined":e==="activity"||t==="activity"?"todo--outlined":e==="tour"?"tour--outlined":"article",Se=e==="accommodation"||t==="accommodation"?"Sleep":e==="activity"||t==="activity"?"To do":e==="tour"?"Tour":"Article",$e=()=>{var Be,C,ae,Ne,Xe,at,st,He,J,ne,ie,he;return r.jsxs(r.Fragment,{children:[(!p||!Ce)&&l!=="carousel"?r.jsxs("header",{children:[r.jsx("div",{className:"author",children:e==="activity"?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"icon",children:r.jsx("img",{src:o.icon,alt:"marker"})}),r.jsx("div",{className:"publisher",children:r.jsx("span",{children:o.publisher})})]}):e==="article"&&t!=="article"?r.jsx(bc,{name:q==null?void 0:q.username,picture:z,status:_==null?void 0:_.state,withEdit:!1}):r.jsxs(r.Fragment,{children:[r.jsx(yn,{image:o.icon||z}),r.jsxs("div",{className:"publisher",children:[r.jsx("span",{children:o.publisher}),n?r.jsxs($t,{to:`/${n.username}`,className:"addedby",children:["by @",n.username]}):null]})]})}),r.jsxs("div",{className:"actions",children:[e==="article"&&!Ce&&!p&&!T?r.jsx(vc,{article:_,isInsideTrip:p}):null,h&&!Ce&&t!=="article"?r.jsx("div",{className:"btn-text black",children:"View"}):p&&!Ce&&!T?r.jsx(ea,{item:_,currentDestination:u,type:e,articleType:t,inList:h,isOwner:S,general:o,pricing:i,buttonType:"icon",setModalIsOpen:y,isInsideTrip:p},(_==null?void 0:_._id)||(_==null?void 0:_.id)||(_==null?void 0:_.productCode)):null]})]}):null,r.jsxs("div",{className:`main-card__image ${h&&!j?"in-list":null}`,children:[o.image?r.jsx("div",{className:"badge-container",children:l==="carousel"&&e==="article"?r.jsx(xt,{icon:(C=(Be=o==null?void 0:o.categories)==null?void 0:Be[0])==null?void 0:C._id,text:(Ne=(ae=o==null?void 0:o.categories)==null?void 0:ae[0])==null?void 0:Ne.name,color:U}):l==="carousel"?r.jsx(xt,{icon:we,text:Se,color:U}):e==="tour"||e==="accommodation"?r.jsxs(r.Fragment,{children:[s.score?r.jsx(xt,{icon:"star",text:`${Math.round((s==null?void 0:s.score)*10)/10}/${s==null?void 0:s.maxScore}`,color:"green"}):null,S&&i.price?r.jsx(Fk,{price:i.price,currency:i.currency}):null]}):e==="article"?r.jsxs(r.Fragment,{children:[(Xe=o.categories)==null?void 0:Xe.map((me,F)=>F<2?r.jsx(xt,{text:me==null?void 0:me.name},me==null?void 0:me._id):null),((at=o.categories)==null?void 0:at.length)>2&&!Ce?r.jsx(xt,{text:`+ ${((st=o.categories)==null?void 0:st.length)-2}`,tooltip:(He=o.categories)==null?void 0:He.map(me=>me==null?void 0:me.name)}):null]}):e==="activity"?r.jsxs(r.Fragment,{children:[r.jsx(xt,{text:(J=c==null?void 0:c.tags)==null?void 0:J[0],color:"green"}),s!=null&&s.score?r.jsx(xt,{icon:"star",text:`${Math.round((s==null?void 0:s.score)*10)/10}/${s==null?void 0:s.maxScore}`,color:"green"}):null]}):null}):null,r.jsx(gn,{src:o.image,type:e,articleType:t,color:U,label:e==="article"?(ie=(ne=o.categories)==null?void 0:ne[0])==null?void 0:ie.name:e==="accommodation"?"accommodation":o.publisher}),h&&!j?r.jsx("div",{className:"bottom-tag",children:r.jsx(xt,{icon:"check",text:"In your trip",color:U})}):null]}),r.jsxs("div",{className:"main-card__title",children:[r.jsx("h3",{children:o.title}),l!=="carousel"?r.jsx("div",{className:"hashtag-container",children:(he=_==null?void 0:_.hashtags)==null?void 0:he.map(me=>r.jsx(Zr,{text:me==null?void 0:me.value},me==null?void 0:me._id))}):null,!g&&l!=="carousel"&&t==="article"?re?r.jsx("p",{children:r.jsx(e0,{notes:_==null?void 0:_.notes})}):o!=null&&o.description?r.jsx("p",{children:o.description}):null:null]})]})},Ae=()=>{var Be,C;return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"map-marker-icon ",onClick:()=>{$?$(_==null?void 0:_._id):be()},ref:O,children:e==="activity"?r.jsx("img",{src:o.icon,alt:"to do"}):e==="accommodation"&&!h?r.jsx(vn,{value:i.price,baseCurrency:i.currency}):r.jsx(Z,{name:`${e==="article"?(C=(Be=o==null?void 0:o.categories)==null?void 0:Be[0])==null?void 0:C._id:e==="accommodation"?"bed--outlined":"todo-outlined"}`})}),Ce?null:r.jsx("div",{className:"map-hoverbox",children:r.jsx("div",{className:"map-hoverbox__container",children:r.jsx("div",{className:`main-card ${D?"active":""}`,onClick:()=>be(),children:$e()})})})]})},Fe=(_==null?void 0:_.fsq_id)||(_==null?void 0:_.hotel_id)||(_==null?void 0:_.id)||(_==null?void 0:_._id),ce=Pa(te),Pe=V,xe=W,Ve=()=>e==="accommodation"?"booking_api":e==="activity"?"foursquare_api":e==="tour"?"viator_api":_!=null&&_.bookingData?"custom_booking_api":_!=null&&_.googleUrl?"custom_google_api":"custom_url",Ye={content_owner_type:e==="article"?q?oi(q==null?void 0:q.isCreator):L?"self":"author unknown":void 0,content_owner_username:e==="article"?(q==null?void 0:q.username)||(L?I.username:"author unknown"):void 0,category:Array!=null&&Array.isArray(o.categories)?(Ue=o==null?void 0:o.categories)==null?void 0:Ue.map(Be=>Be==null?void 0:Be.name):o.categories,source_type:Ve(),city_name:_==null?void 0:_.normalised_city,country_name:_==null?void 0:_.country,affiliate:Pe,url:o.url},_e={...E!==void 0&&{provider:E},...B!==void 0&&{category:B},...G!==void 0&&{surface:G},...N!==void 0&&{destination_id:N},...(_==null?void 0:_._id)!==void 0&&{place_id:_==null?void 0:_._id},...K!==void 0&&{card_instance_id:K}
272,...ee&&{world_region:ee},url_source:ho(o.url)},ve=()=>{if(Ke(`clickout_${xe}`,Ye,ce),Pe){try{Ke("affiliate_clicked",_e,ce)}catch{}Rr({provider:E,category:B,destinationId:N,placeId:_==null?void 0:_._id,surface:G,urlSource:ho(o.url),targetUrl:Lt(o.url,I==null?void 0:I.username)})}},A=typeof o.lat=="number"&&!isNaN(o.lat)&&typeof o.lng=="number"&&!isNaN(o.lng);return l==="marker"&&!A?null:r.jsxs(r.Fragment,{children:[l==="marker"?r.jsx(Fl,{latitude:o.lat,longitude:o.lng,style:{zIndex:k===Fe?120:105},children:r.jsx("div",{className:`item-marker ${h?"isPlanned":""} ${U} ${e} ${k===Fe?"hovered":""}`,children:m?Ae():r.jsx("a",{href:Lt(o.url,I==null?void 0:I.username),target:"_blank",rel:"noreferrer",children:Ae()})})}):r.jsx("div",{ref:se,style:{display:"contents"},children:m?r.jsx("div",{className:`main-card ${l} ${Ce?"main-card-mobile":""} ${D?"active":""} ${k===Fe?"hovered":""}`,onClick:()=>be(),ref:O,onMouseEnter:()=>{M(Wn(Fe))},onMouseLeave:()=>M(Wn(null)),children:Ce?r.jsx(Ys,{general:o,item:_,pricing:i,color:U,type:e,articleType:t,inList:h,isOwner:S,isInsideTrip:p,currentDestination:u,setModalAnimation:y}):$e()}):r.jsx("a",{className:`main-card ${l} ${Ce?"main-card-mobile":""} ${k===Fe?" hovered":""}`,href:Lt(o.url,I==null?void 0:I.username),target:"_blank",onMouseEnter:()=>{M(Wn(Fe))},onMouseLeave:()=>M(Wn(null)),onClick:ve,rel:"noreferrer",children:Ce?r.jsx(Ys,{general:o,item:_,pricing:i,color:U,type:e,articleType:t}):$e()})}),D&&m?r.jsx(Zk,{type:e,articleType:t,general:o,rating:s,pricing:i,business:a,meta:c,currentDestinationId:d,currentDestination:u,isOpen:D,inList:h,handleModalIsOpen:ge,animation:b,setModalAnimation:y,containerRef:O,item:_,isFullscreen:v,isOwner:S,color:U,isInsideTrip:p,handleTracking:ve}):null]})},r0=(e,t)=>{if(!e)return e??"";if(!t)return e;const n=t.replace(/^\?/,"");try{const o=new URL(e);return new URLSearchParams(n).forEach((s,i)=>o.searchParams.set(i,s)),o.toString()}catch{return`${e}${e.includes("?")?"&":"?"}${n}`}},a0=({item:e,articleType:t="article",currentDestinationId:n,itemsInPlan:o,isPlanned:s,isFullscreen:i=!1,isInsideTrip:a=!0,hideDescription:c=!1,isOnProfile:l=!1,display:d="normal",setMapPreview:u})=>{var $,M,x,P,I,R,L,D,H;const{user:p}=lt(),{match:h}=Tt(),{researchIdsInPlan:g}=rt(h),m=($=e==null?void 0:e.link)!=null&&$.includes("booking.com")?"Booking":((M=e==null?void 0:e.metadata)==null?void 0:M.publisher)||(e==null?void 0:e.publisher),v=(x=e==null?void 0:e.link)!=null&&x.includes("booking.com")?Br:((P=e==null?void 0:e.metadata)==null?void 0:P.logo)||(e==null?void 0:e.logo),j=t==="article"?r0(e==null?void 0:e.link,Bl("creatorArticles","",h)):e==null?void 0:e.link,S=Lt(j,p==null?void 0:p.username),_=(e==null?void 0:e.type)==="activity"?"activity":(e==null?void 0:e.type)==="cuisine"?"cuisine":(e==null?void 0:e.type)==="accommodation"?"accommodation":"article";return e?r.jsx(o0,{type:"article",articleType:_,addedBy:l?null:(I=e==null?void 0:e.author)==null?void 0:I[0],general:{title:((R=e==null?void 0:e.metadata)==null?void 0:R.title)||(e==null?void 0:e.title),description:((L=e==null?void 0:e.metadata)==null?void 0:L.description)||(e==null?void 0:e.description),image:((D=e==null?void 0:e.metadata)==null?void 0:D.image)||(e==null?void 0:e.image),publisher:m,icon:v,categories:e==null?void 0:e.tags,url:S,lat:parseFloat(e==null?void 0:e.lat)||parseFloat(e==null?void 0:e.latitude),lng:parseFloat(e==null?void 0:e.lng)||parseFloat(e==null?void 0:e.longitude),author:e==null?void 0:e.author},pricing:{price:e==null?void 0:e.price},business:{address:e==null?void 0:e.address,website:S},withDetail:Ce||_!=="article",inList:s||(g==null?void 0:g.includes(e==null?void 0:e.link))||((H=ct.compact(o))==null?void 0:H.includes(e==null?void 0:e.link)),currentDestinationId:n,isFullscreen:i,itineraryView:s,isOwner:(e==null?void 0:e.addedBy)===(p==null?void 0:p.firebaseId),item:e,hideDescription:c,display:d,isInsideTrip:a,setMapPreview:u},(e==null?void 0:e._id)||(e==null?void 0:e.id)||(e==null?void 0:e.productCode)):null},s0=({currentDestination:e,match:t})=>{const n=Vt(),{t:o}=Et(["dashboard"]),{currentTrip:s}=rt(),{history:i}=Tt(),a=()=>{const c=(e==null?void 0:e.cityEnglish)||(e==null?void 0:e.city)||"",l=p=>p.getDate().toString(),d=p=>p.toLocaleDateString("en-GB",{month:"short"});let u="";if(e!=null&&e.startDate&&(e!=null&&e.endDate)){const p=new Date(e.startDate),h=new Date(e.endDate);u=p.getMonth()===h.getMonth()?`${l(p)}â${l(h)}
272 ${d(p)}`:`${l(p)} ${d(p)}â${l(h)} ${d(h)}`}i.push(Bt(s),{openTripBoard:"ideas",addToDestination:e?{destId:e._id,city:c,dateRange:u}:void 0})};return!e||Ce?null:r.jsxs("div",{className:"discover-modal__header",children:[r.jsxs("div",{className:"left",children:[r.jsx("div",{className:"breadcrumb",children:r.jsxs($t,{to:Bt(s),onClick:()=>n(Tn(null)),children:[r.jsx(Z,{name:"arrowCircled"}),o("discover.backToPlan")]})}),r.jsxs("h1",{children:[o("discover.sleepIn")," ",r.jsx("span",{className:"discover-modal__destination",children:e==null?void 0:e.city})]})]}),r.jsxs("div",{className:"right",children:[r.jsxs("button",{type:"button",className:"btn-rounded solid big with-icon",onClick:a,children:[r.jsx(Z,{name:"addCircle"})," ",o("discover.addCustom")]}),r.jsx("div",{className:"pills",children:r.jsx(gc,{startDate:e==null?void 0:e.startDate,endDate:e==null?void 0:e.endDate,guests:e==null?void 0:e.guests,rooms:e==null?void 0:e.rooms})})]})]})},i0=({match:e,setModalIsOpen:t,setSelectedPlace:n,onSaveToList:o})=>{const s=Vt(),{t:i}=Et(["dashboard"]),a=An(),{currentDestination:c,currentTrip:l,fetchVioLocationLinks:d,addOrRemoveDestinationPlace:u}=rt(e),{user:p}=lt(),{startDate:h,endDate:g,city:m}=c||{},[v,j]=f.useState(()=>{if(window.location.hash)return window.location.hash;const A=sessionStorage.getItem("accommodationModalActiveTab");return A||"#sleep"});f.useEffect(()=>{const A=()=>{const w=window.location.hash||"#sleep";j(w)};return window.addEventListener("hashchange",A),()=>window.removeEventListener("hashchange",A)},[]),f.useEffect(()=>{sessionStorage.setItem("accommodationModalActiveTab",v)}
272,[v]);const[S]=f.useState(!1),[_,$]=f.useState([]),[M,x]=f.useState(1),[P,I]=f.useState(0),[R,L]=f.useState(!0),[D,H]=f.useState([]),[b,y]=f.useState([]),k=f.useRef(null),{accommodations:T,articles:O}=go(),{accommodations:q=[],articles:z=[]}=go(!0),V=q.concat(z),W=O==null?void 0:O.filter(A=>{var w;return(w=A==null?void 0:A.tags)==null?void 0:w.flatMap(X=>X.name).includes("Accommodation")}),{formattedDate:te}=un(h),{formattedDate:E}=un(g),{loading:B,fetchMore:G}=At(Sl,{variables:{destinationId:c==null?void 0:c._id,startDate:te,endDate:E},skip:!(c!=null&&c._id),onCompleted:A=>{ee(A)}}),[N,{data:K}]=Pn(si,{fetchPolicy:"network-only"}),ee=A=>{var ye;const{totalCount:w,hasMore:X,data:Q}=A.accommodation;I(w),L(X);const ue=ct.uniqBy(Q,Ue=>Ue._id||Ue.hotel_id),Y=ct.compact((ye=c==null?void 0:c.property)==null?void 0:ye.filter(Ue=>!!Ue.hotel_id)),fe=ue==null?void 0:ue.map(Ue=>(Y==null?void 0:Y.find(Be=>Be.hotel_id===Ue.hotel_id))||Ue);$(Ue=>ct.uniqBy([...Ue,...fe],Be=>Be.hotel_id||Be._id))},se=(c==null?void 0:c.places)||[],je=f.useMemo(()=>Io(se,"accommodation"),[se]),{allIdentifierPool:be}=po(je),ge=f.useMemo(()=>be.map(A=>A&&String(A)).filter(Boolean),[be]),re=f.useMemo(()=>Array.from(new Set([...ge,...b])),[ge,b]);f.useEffect(()=>{y(A=>{if(!A.length)return A;const w=A.filter(X=>!ge.includes(X));return w.length===A.length?A:w})},[ge]);const U=async A=>{A&&(k.current=A,N({variables:{input:{bbox:A},user:(p==null?void 0:p.username)||""}}))};f.useEffect(()=>{if(K!=null&&K.placesInBboxByUser){const A=K.placesInBboxByUser.filter(w=>w.attraction==="accommodation");H(A)}},[K]),f.useEffect(()=>{const A=(se||[]).filter(Q=>Q.latitude&&Q.longitude&&!isNaN(Number(Q.latitude))&&!isNaN(Number(Q.longitude))&&Number(Q.latitude)>=-90&&Number(Q.latitude)<=90&&Number(Q.longitude)>=-180&&Number(Q.longitude)<=180),w=(_||[]).filter(Q=>{var C,ae;const ue=Q.latitude||Q.lat||((C=Q.coordinates)==null?void 0:C.lat),Y=Q.longitude||Q.lng||Q.lon||((ae=Q.coordinates)==null?void 0:ae.lng),fe=ue&&Y,ye=!isNaN(Number(ue))&&Number(ue)>=-90&&Number(ue)<=90,Ue=!isNaN(Number(Y))&&Number(Y)>=-180&&Number(Y)<=180;return fe&&ye&&Ue}),X=ct.uniqBy([...A,...w],Q=>Q._id||Q.hotel_id||Q.link||Q.googlePlaceId);return s(Qt(X)),()=>{s(Qt(Mr(l)))}},[_,se==null?void 0:se.length]),f.useEffect(()=>{if(D.length>0){const A=D.filter(w=>w.latitude&&w.longitude&&!isNaN(Number(w.latitude))&&!isNaN(Number(w.longitude))&&Number(w.latitude)>=-90&&Number(w.latitude)<=90&&Number(w.longitude)>=-180&&Number(w.longitude)<=180);s(Ia(A))}else s(Ia([]))},[D]),f.useEffect(()=>(window.onMapMoveEnd=U,window.activeModal="sleep",()=>{delete window.onMapMoveEnd,delete window.activeModal}),[U]);const[we]=kt(Xs,{onError:A=>console.error("Add place to destination failed",A),refetchQueries:["Trip","PublicTrip"],awaitRefetchQueries:!0});l!=null&&l._id&&(ii,l._id),kt(Cl,{...jl(l==null?void 0:l._id),onError:A=>console.error("[SleepDiscoverModal] Add idea to trip failed",A)});const Se=(A,w,X)=>{var ue,Y,fe,ye;const Q=[X,A==null?void 0:A._id,A==null?void 0:A.externalId,A==null?void 0:A.fsq_id,A==null?void 0:A.hotel_id,A==null?void 0:A.hotelId,A==null?void 0:A.googlePlaceId,A==null?void 0:A.link,A==null?void 0:A.id,(ue=A==null?void 0:A.metadata)==null?void 0:ue.id,...Array.isArray((Y=A==null?void 0:A.metadata)==null?void 0:Y.sourceIds)?A.metadata.sourceIds:[],w==null?void 0:w.externalId,w==null?void 0:w.googlePlaceId,(fe=w==null?void 0:w.metadata)==null?void 0:fe.id,...Array.isArray((ye=w==null?void 0:w.metadata)==null?void 0:ye.sourceIds)?w.metadata.sourceIds:[]];return Array.from(new Set(Q.filter(Boolean).map(Ue=>String(Ue))))},$e=f.useCallback(async A=>{var Q,ue,Y,fe,ye,Ue;if(!(c!=null&&c._id))return;const w=await or(A,"accommodation"),X=Se(A,w);if(!X.some(Be=>re.includes(Be))){y(Be=>{const C=new Set(Be);return X.forEach(ae=>C.add(ae)),Array.from(C)});try{const Be=await we({variables:{destinationId:c._id,input:{...w,icon:"bed--outlined"}}}),C=(Ue=(ye=(fe=(Y=(ue=(Q=Be==null?void 0:Be.data)==null?void 0:Q.addPlaceToDestination)==null?void 0:ue.destinations)==null?void 0:Y.find(ae=>(ae==null?void 0:ae._id)===c._id))==null?void 0:fe.places)==null?void 0:ye.find(ae=>Se(ae,ae).some(Xe=>X.includes(Xe))))==null?void 0:Ue._id;C&&y(ae=>{const Ne=new Set(ae);return Ne.add(String(C)),Array.from(Ne)})}catch{y(C=>C.filter(ae=>!X.includes(ae)))}}},[c==null?void 0:c._id,re,we]),Ae=f.useCallback(A=>{n==null||n(A)},[n]),Fe=f.useCallback(A=>{if(!(c!=null&&c.places)||!Array.isArray(c.places))return null;const w=[A==null?void 0:A._id,A==null?void 0:A.externalId,A==null?void 0:A.fsq_id,A==null?void 0:A.hotel_id,A==null?void 0:A.hotelId,A==null?void 0:A.googlePlaceId,A==null?void 0:A.link,A==null?void 0:A.id].filter(
272Boolean).map(String);return c.places.find(X=>{var ue;return[(ue=X==null?void 0:X.metadata)==null?void 0:ue.id,X==null?void 0:X._id,X==null?void 0:X.id].filter(Boolean).map(String).some(Y=>w.includes(Y))})},[c==null?void 0:c.places]),{openForPlace:ce,modalProps:Pe}=Or({trip:l,currentDestinationId:c==null?void 0:c._id,addOrRemoveDestination:u,addOrRemoveDay:async()=>Promise.resolve(),onDestinationChange:({destinationId:A,placeId:w,remove:X})=>{!(c!=null&&c._id)||A!==c._id||!w||y(Q=>{const ue=String(w);if(X){const Y=Q.filter(fe=>fe!==ue);return Y.length===Q.length?Q:Y}return Q.includes(ue)||ge.includes(ue)?Q:[...Q,ue]})}}),xe=f.useMemo(()=>(A,w)=>{var fe;const Q=Se(A).some(ye=>re.includes(ye)),ue=Q?(fe=Fe(A))==null?void 0:fe._id:null,Y={...A,_id:ue};return r.jsx(Ak,{item:Y,currentDestination:c,days:l.days,itemsInPlan:re,isPlanned:w||Q,onAdd:()=>$e(Y),onRemove:()=>ce(Y,{isAccommodation:!0}),onPlaceCardClick:()=>{const ye=Fe(Y);Ae(ye||Y)},onSaveToList:o},Y.hotel_id||Y.link)},[re,c,ce,l.days,$e,Ae,o,Fe]),Ve=f.useMemo(()=>(A,w,X)=>r.jsx(a0,{item:A,currentDestinationId:c==null?void 0:c._id,isPlanned:w||re.includes(String(A._id||A.link||"")),isFullscreen:S,articleType:X},A._id||A.link),[c==null?void 0:c._id,re,S]),Ye=B&&_.length===0,_e=f.useMemo(()=>T==null?void 0:T.map(A=>Ve(A,!1,"accommodation")),[T==null?void 0:T.length]),ve=f.useMemo(()=>V==null?void 0:V.map(A=>Ve(A,!1,"accommodation")),[V==null?void 0:V.length]);return f.useEffect(()=>{c!=null&&c.city&&(c!=null&&c.country)&&(c!=null&&c.startDate)&&(c!=null&&c.endDate)&&d({variables:{city:c.city,country:c.country,checkIn:c.startDate,checkOut:c.endDate}})},[c==null?void 0:c.city,c==null?void 0:c.country,c==null?void 0:c.startDate,c==null?void 0:c.endDate]),r.jsxs("div",{className:`discover-modal ${S&&"full-width"}`,children:[r.jsx(Ar,{...Pe}),r.jsx(s0,{currentDestination:c,match:e}),r.jsxs("div",{className:"discover-modal__body",children:[r.jsx(mc,{match:e,menuItem:v,mode:"default",variant:"accommodationModal",searchTrackLocation:"hotel_search",amounts:{sleep:P,curated:T==null?void 0:T.length,articles:W==null?void 0:W.length,inPlan:je.length,collection:V==null?void 0:V.length},currentDestination:c,setModalIsOpen:t,hideHeaderInPanel:!0}),r.jsx("div",{className:"discover-modal__content",children:r.jsx("div",{className:"discover-view",children:v==="#sleep"?r.jsx(r.Fragment,{children:r.jsxs(fc,{dataLength:_.length,next:()=>{G({variables:{page:M+1}}).then(A=>ee(A.data)),x(A=>A+1)},height:_!=null&&_.length?Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)-140:"auto",hasMore:R,loader:(_==null?void 0:_.length)>0?r.jsx(Ir,{text:i("discover.loadingMore"),className:"infinit-loader"}):null,endMessage:r.jsxs("div",{className:"end-results",children:[!B&&!a?r.jsx(El,{city:m,startDate:h,endDate:g}):null,!R&&!B&&(_==null?void 0:_.length)>0?r.jsx("span",{children:i("discover.youveSeenItAll")}):null]}),children:[r.jsx("div",{className:"results-count",children:(P||(_==null?void 0:_.length))>0?i("discover.accommodationsFound",{count:P||(_==null?void 0:_.length)}):""}),r.jsx(on,{items:_.map(A=>{const X=Se(A).some(Q=>re.includes(Q));return xe(A,X)}),disableScroll:!0,columns:"col-1",loading:Ye,placeholder:{title:i("discover.placeholder.noSleepFound.title"),text:i("discover.placeholder.noSleepFound.text"),icon:"bed--outlined"}})]})}):v==="#curated"?r.jsx(on,{items:_e,placeholder:{title:i("discover.placeholder.noArticlesFound.title"),text:i("discover.placeholder.noSleepArticlesFound.text"),icon:"bed--outlined"}}):v==="#articles"?r.jsx(on,{items:W==null?void 0:W.map(A=>Ve(A,!1,"article")),placeholder:{title:i("discover.placeholder.noArticlesFound.title"),text:i("discover.placeholder.noSleepArticlesFound.text"),icon:"bed--outlined"}}):v==="#intrip"?r.jsx(on,{items:je.map(A=>{const X=Se(A).some(Q=>re.includes(Q));return xe(A,X)}),placeholder:{title:i("discover.placeholder.nothingPlanned.title"),text:i("discover.placeholder.nothingPlanned.text"),icon:"bed--outlined"}}):v==="#collection"?r.jsx(on,{items:ve,placeholder:{title:i("discover.placeholder.noArticlesFound.title"),text:i("discover.placeholder.noSleepArticlesFound.text"),icon:"bed--outlined"}}):null})})]})]})},N0=({match:e,setModalIsOpen:t,variant:n,setSelectedPlace:o})=>{const s=Vt(),{t:i}=Et(["dashboard"]),a=Vl(),{isBusinessMode:c}=Co(),{currentDestination:l,currentTrip:d,addOrRemoveDestinationPlace:u}=rt(e),p=Rc(),{user:h}=lt(),{getBookmarkedItem:g,bookmark:m}=No("accommodation"),{lists:v}=$l({excludeProtectedLists:!0}),[j,S]=f.useState([]),[_,$]=f.useState([]),[M,x]=f.useState(!1),[P,I]=f.useState(null),R=f.useRef(null),L=f.useRef(null),[D,H]=f.useState(()=>{const w=sessionStorage.getItem("activityModalActiveTab");return w||window.location.hash||"#overview"});f.useEffect(()=>{const w=()=>{n==="activity"&&H(window.location.hash||"#overview")};return window.addEventListener("hashchange",w),()=>window.removeEventListener("hashchange",w)},[]),f.useEffect(()=>{sessionStorage.setItem("activityModalActiveTab",D)},[D]);const b=l==null?void 0:l._id,{data:y,loading:k}=At(Ik,{variables:{destinationId:b},skip:!b}),{data:T,loading:O}=At(Pk,{variables:{destinationId:b},skip:!b}),[q,{data:z}]=Pn(si,{fetchPolicy:"network-only"}),[V]=kt(Qs,{refetchQueries:["Lists","CompanyLists"],awaitRefetchQueries:!0}),W=f.useMemo(()=>{var Y,fe;const w=((Y=y==null?void 0:y.activities)==null?void 0:Y.pois)||[],X=((fe=y==null?void 0:y.activities)==null?void 0:fe.restaurants)||[],Q=(T==null?void 0:T.tour)||[],ue=[...w,...X,...Q];return ct.uniqBy(ue,ye=>(ye==null?void 0:ye.fsq_id)||(ye==null?void 0:ye.id)||(ye==null?void 0:ye.productC
272ode)||(ye==null?void 0:ye.tour_id)||(ye==null?void 0:ye._id))},[y,T]),te=(l==null?void 0:l.places)||[],{data:E}=At(ii,{variables:{tripId:d==null?void 0:d._id},skip:!(d!=null&&d._id),fetchPolicy:"cache-first"}),B=(E==null?void 0:E.tripIdeas)||[],G=f.useMemo(()=>(te||[]).filter(w=>!["accommodation"].includes((w==null?void 0:w.attraction)||(w==null?void 0:w.type))),[te]),{allIdentifierPool:N}=po(G),{allIdentifierPool:K}=po(B),ee=f.useMemo(()=>N.map(w=>w&&String(w)).filter(Boolean),[N]),se=f.useMemo(()=>K.map(w=>w&&String(w)).filter(Boolean),[K]),je=f.useMemo(()=>Array.from(new Set([...ee,...se,..._])),[ee,se,_]);f.useEffect(()=>{$(w=>{if(!w.length)return w;const X=w.filter(Q=>!ee.includes(Q));return X.length===w.length?w:X})},[ee]);const be=f.useCallback((w,X)=>{var ue,Y;const Q=[X,w==null?void 0:w._id,w==null?void 0:w.externalId,w==null?void 0:w.fsq_id,w==null?void 0:w.attraction_id,w==null?void 0:w.googlePlaceId,w==null?void 0:w.productCode,w==null?void 0:w.productUrl,w==null?void 0:w.product_code,w==null?void 0:w.tour_id,w==null?void 0:w.id,(ue=w==null?void 0:w.metadata)==null?void 0:ue.id,...Array.isArray((Y=w==null?void 0:w.metadata)==null?void 0:Y.sourceIds)?w.metadata.sourceIds:[]];return Array.from(new Set(Q.filter(Boolean).map(fe=>String(fe))))},[]),ge=f.useCallback(async w=>{!P||w.length===0||(await V({variables:{placeId:P._id,input:{lists:w}}}),x(!1),I(null))},[P,V,v]),re=f.useCallback(async w=>{if(!(w!=null&&w._id)||!Nl(w._id)){const X=g(w);if(X){I(X),x(!0);return}try{await m(w)}catch(Q){console.error("[Dashboard] Bookmark failed:",{placeData:w.name||(w==null?void 0:w.key),error:(Q==null?void 0:Q.message)||Q})}return}I(w),x(!0)},[g,m]),U=f.useCallback((w,X)=>{if(!X)return;const Q=be(X,w);Q.length&&$(ue=>{const Y=new Set(ue);return Q.forEach(fe=>{ee.includes(fe)||Y.add(fe)}),Array.from(Y)})},[be,ee]),we=f.useCallback((w,X)=>{const Q=be(w,X);Q.length&&$(ue=>{if(!ue.length)return ue;const Y=ue.filter(fe=>!Q.includes(fe));return Y.length===ue.length?ue:Y})},[be]),Se=async w=>{w&&(R.current=w,q({variables:{input:{bbox:w},user:(h==null?void 0:h.username)||""}}))};f.useEffect(()=>{if(z!=null&&z.placesInBboxByUser){const w=z.placesInBboxByUser.filter(X=>(X.attraction||X.type)!=="accommodation");S(w)}},[z]),f.useEffect(()=>{const w=(te||[]).filter(Y=>Y.latitude&&Y.longitude&&!isNaN(Number(Y.latitude))&&!isNaN(Number(Y.longitude))&&Number(Y.latitude)>=-90&&Number(Y.latitude)<=90&&Number(Y.longitude)>=-180&&Number(Y.longitude)<=180),X=(W||[]).filter(Y=>{var Ne,Xe;const fe=Y.latitude||Y.lat||((Ne=Y.coordinates)==null?void 0:Ne.lat),ye=Y.longitude||Y.lng||Y.lon||((Xe=Y.coordinates)==null?void 0:Xe.lng),Ue=fe&&ye,Be=!isNaN(Number(fe))&&Number(fe)>=-90&&Number(fe)<=90,C=!isNaN(Number(ye))&&Number(ye)>=-180&&Number(ye)<=180,ae=Ue&&Be&&C;return ae&&(Y.latitude=Number(fe),Y.longitude=Number(ye)),ae}),Q=(j||[]).filter(Y=>Y.latitude&&Y.longitude&&!isNaN(Number(Y.latitude))&&!isNaN(Number(Y.longitude))&&Number(Y.latitude)>=-90&&Number(Y.latitude)<=90&&Number(Y.longitude)>=-180&&Number(Y.longitude)<=180),ue=ct.uniqBy([...w,...X,...Q],Y=>Y._id||Y.fsq_id||Y.googlePlaceId||Y.productCode||Y.tour_id);return n!=="sleep"&&s(Qt(ue)),()=>{n!=="sleep"&&s(Qt(Mr(d)))}},[W,te==null?void 0:te.length,j,n]),f.useEffect(()=>(window.onMapMoveEnd=Se,window.activeModal="activity",()=>{delete window.onMapMoveEnd,delete window.activeModal}),[Se]);const[$e]=kt(Tl,{onError:w=>console.error("Remove idea from trip failed",w)}),Ae=async w=>{if(!b)return;const X=Ra(w,te)||Ra(w,B);if(!X)return;const ue=!te.some(fe=>(fe==null?void 0:fe._id)===X)&&B.some(fe=>(fe==null?void 0:fe._id)===X);we(w,X);const Y=ue&&(d!=null&&d._id)?B.find(fe=>(fe==null?void 0:fe._id)===X)||{_id:X}:null;Y&&s(Pl(Y));try{ue&&(d!=null&&d._id)?await $e({variables:{tripId:d._id,placeId:X},...Il(p.cache,d._id,X)}):await u(b,X,!0)}catch(fe){throw U(X,w),Y&&s(Rl(Y)),fe}},Fe=$o` 273 mutation UpdateTripDay($dayId: ID!, $placeId: ID!, $remove: Boolean, $destinationId: ID) { 274 updateTripDay(dayId: $dayId, placeId: $placeId, remove: $remove, destinationId: $destinationId) { 275 _id 276 items { 277 _id 278 assignedDayId 279 type 280 destinationId 281 transportId 282 fixed 283 bookingStatus 284 lockedToDestination 285 startTime 286 endTime 287 hasTime 288 isAllDay 289 place { 290 _id 291 name 292 type 293 attraction 294 } 295 } 296 } 297 } 298 `,[ce]=kt(Fe,{refetchQueries:["Trip","PublicTrip"],awaitRefetchQueries:!0}),{openForPlace:Pe,modalProps:xe}=Or({trip:d,addOrRemoveDestination:u,addOrRemoveDay:(w,X,Q,ue)=>ce({variables:{dayId:w,placeId:X,remove:Q,destinationId:ue}}),onDestinationChange:({destinationId:w,placeId:X,remove:Q})=>{!X||w!==b||(Q?we(void 0,X):U(X))}}),Ve=f.useCallback(w=>{o(w)},[o]),Ye=w=>{if(!(l!=null&&l.places)||!Array.isArray(l.places))return null;const X=(w==null?void 0:w._id)||(w==null?void 0:w.externalId)||(w==null?void 0:w.fsq_id)||(w==null?void 0:w.productC
298ode)||(w==null?void 0:w.tour_id)||(w==null?void 0:w.id)||(w==null?void 0:w.googlePlaceId);return l.places.find(Q=>{var Y;return(((Y=Q==null?void 0:Q.metadata)==null?void 0:Y.id)||(Q==null?void 0:Q._id)||(Q==null?void 0:Q.id))===X})},_e=f.useMemo(()=>!P||!Array.isArray(v)?[]:v.filter(w=>Array.isArray(w==null?void 0:w.items)&&w.items.some(X=>(X==null?void 0:X._id)===P._id||(X==null?void 0:X.externalId)===P.hotel_id)).map(w=>w._id),[v,P]);if(n==="sleep")return a?r.jsxs(r.Fragment,{children:[r.jsx(kk,{match:e,setModalIsOpen:t,setSelectedPlace:o,onSaveToList:re,isB2B:c,entryLocation:"hotel_search"}),r.jsx(Lo,{isOpen:M,onClose:()=>{x(!1),I(null)},lists:v,selectedListIds:_e,onConfirm:ge,confirmLabel:i("discover.save"),title:i("discover.addToLists")})]}):r.jsxs(r.Fragment,{children:[r.jsx(i0,{match:e,setModalIsOpen:t,setSelectedPlace:o,onSaveToList:re}),r.jsx(Lo,{isOpen:M,onClose:()=>{x(!1),I(null)},lists:v,selectedListIds:_e,onConfirm:ge,confirmLabel:i("discover.save"),title:i("discover.addToLists")})]});const ve=D==="#intrip",A=ve?G.map(w=>r.jsx(Oa,{item:w,currentDestination:l,days:(d==null?void 0:d.days)||[],itemsInPlan:je,isPlanned:!0,onPlaceCardClick:()=>Ve(w),onSaveToList:re,onRemove:()=>Pe(w,{isAccommodation:(w==null?void 0:w.type)==="accommodation"||(w==null?void 0:w.attraction)==="accommodation"})},w._id)):W.map(w=>{const X=be(w),Q=X.some(Y=>
298je.includes(Y)),ue=X[0]||w._id||w.productCode||JSON.stringify(w);return r.jsx(Oa,{item:w,currentDestination:l,days:(d==null?void 0:d.days)||[],itemsInPlan:je,isPlanned:Q,onPlaceCardClick:()=>{const Y=Ye(w);Y&&Ve(Y)},onSaveToList:re,onAddStart:Y=>U(void 0,Y),onAddSuccess:(Y,fe)=>U(Y,fe),onAddError:Y=>we(Y),openForPlace:Pe,onRemove:()=>Ae(w)},ue)});return r.jsxs("div",{className:"discover-modal",ref:L,children:[r.jsx(Ar,{...xe}),r.jsx(Lo,{isOpen:M,onClose:()=>{x(!1),I(null)},lists:v,selectedListIds:_e,onConfirm:ge,confirmLabel:"Save",title:"Add to Lists"}),r.jsx(Rk,{currentDestination:l,match:e,variant:"activity"}),r.jsxs("div",{className:"discover-modal__body",children:[r.jsx(mc,{match:e,menuItem:D,variant:"discoverModal",searchTrackLocation:"trip_detail",currentDestination:l,setModalIsOpen:t,hideHeaderInPanel:!0}),r.jsx("div",{className:"discover-modal__content",children:r.jsx("div",{className:"discover-view",children:r.jsxs("div",{className:"activity-search-list",children:[r.jsx("div",{className:"results-count",children:!ve&&i("discover.activitiesFound",{count:W.length})}),r.jsx(on,{columns:"col-1",items:A,loading:!ve&&(k||O)&&W.length===0,placeholder:{title:i(ve?"discover.placeholder.nothingPlanned.title":"discover.placeholder.noPlacesFound.title"),text:i(ve?"discover.placeholder.nothingPlanned.text":"discover.placeholder.noPlacesFound.text"),icon:"todo--outlined"}})]})})})]})]})};export{N0 as default}; 299//# sourceMappingURL=mkt-651c22ac.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.