PageSourceSearch

https://anislandapart.com/assets/RentalSlideshowDialog-v0nVLjen.js

js anislandapart.com collected 2026-10-10 02:35:09 UTC 11,104 bytes, 2 lines download raw bytes

1import{a as e,t}from"./react-B7JSOICP.js";import{n,t as r}from"./Heading-BuuAx7EG.js";import{t as i}from"./useTranslation-oxh4BgCl.js";import{i as a,t as o}from"./RentalPhoto-DWudN896.js";import{c as s}from"./dist-Bl02FJwk.js";import{t as c}from"./jsx-runtime-By3aTQtn.js";import{c as l,i as u,n as d,o as f,s as p,t as m}from"./createLucideIcon-Xc70zii_.js";import{n as h}from"./LoadingButton-DknCVLa1.js";import{p as g}from"./Combination-CIGYqNbr.js";import{m as _}from"./NavbarActions-CfKP1_uq.js";import{t as v}from"./Grid-sUaDVThh.js";import{t as y}from"./chevron-left-C1J3VRO9.js";import{t as b}from"./chevron-right-Ch4AaJxz.js";import{t as x}from"./Separator-CpnQk8ji.js";import{a as S,c as C,i as w,n as T,s as E,t as D}from"./Dialog-CAfxWsno.js";import{t as O}from"./embla-carousel-react.esm-B70r7xPJ.js";import{n as k,t as A}from"./scrollIntoView-CwEHBvGs.js";import{n as j,r as M,t as N}from"./index.modern-DeAQho87.js";var P={name:`map-pin-house`,size:24,node:[[`path`,{d:`M15 22a1 1 0 0 1-1-1v-4a1 1 0 0 1 .445-.832l3-2a1 1 0 0 1 1.11 0l3 2A1 1 0 0 1 22 17v4a1 1 0 0 1-1 1z`,key:`1p1rcz`}],[`path`,{d:`M18 10a8 8 0 0 0-16 0c0 4.993 5.539 10.193 7.399 11.799a1 1 0 0 0 .601.2`,key:`mcbcs9`}],[`path`,{d:`M18 22v-3`,key:`1t1ugv`}],[`circle`,{cx:`10`,cy:`10`,r:`3`,key:`1ns7v1`}]]};
1P.node;var ee=m(P),F=c();function I({children:e}){return(0,F.jsx)(n,{size:`sm`,className:`md:text-base`,children:e})}function L(){return(0,F.jsx)(x,{asChild:!0,decorative:!0,orientation:`vertical`,children:(0,F.jsx)(k,{className:`size-4`})})}var R=f({variants:{align:{center:`justify-center`}}});function z({rental:e,align:t}){let{t:o}=i(`content`);return(0,F.jsxs)(u,{gap:3,justifyContent:`center`,className:`w-full md:w-fit`,children:[(0,F.jsx)(r,{balance:!0,size:`h2`,align:`center`,className:`w-full md:hidden`,children:(0,F.jsx)(a,{text:e.headline})}),(0,F.jsxs)(u,{gap:1,className:t===`center`?`items-center`:``,children:[(0,F.jsxs)(n,{align:`center`,color:`gray`,size:`sm`,className:`md:text-foreground md:text-lg md:text-start md:font-semibold md:w-fit`,children:[s(e.rentalType),` in `,e.city]}),(0,F.jsxs)(u,{direction:`row`,gap:0,justifyContent:`center`,className:l(R({align:t}),`flex-wrap md:justify-start`),children:[(0,F.jsx)(I,{children:o(`rentalDetails.guestsCount`,{count:e.sleepsMax})}),(0,F.jsx)(L,{}),(0,F.jsxs)(I,{children:[o(`rentalDetails.bedroomsCount`,{count:e.bedroomsCount}),`,`,` `,o(`rentalDetails.bedsCount`,{count:e.totalBedsCount})]}),(0,F.jsx)(L,{}),(0,F.jsx)(I,{children:o(`rentalDetails.bathroomsCount`,{count:e.bathroomsCount})}),e.surface&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(L,{}),(0,F.jsxs)(I,{children:[e.surface,` m²`]})]})]})]})]})}var B=f({base:p(`p-0 size-full relative hover:bg-transparent after:content-[""]`,`after:absolute after:inset-0 hover:after:bg-gray-700/20 after:transition`,`after:rounded-none rounded-none`),variants:{tile:{left:`rounded-l-lg after:rounded-l-lg`,topRight:`rounded-tr-lg after:rounded-tr-lg`,bottomRight:`rounded-br-lg after:rounded-br-lg`},rounded:{sm:`rounded-xs`},aspectSquare:{true:`aspect-square`}}});function V({className:e,onClick:t,rounded:n,aspectSquare:r=!1,tile:i,...a}){return(0,F.jsx)(d,{fill:`ghost`,onClick:t,noAnimation:!0,className:B({tile:i,rounded:n,aspectSquare:r,className:e}),style:{background:`rgba(224,230,229,1)`},...a})}var H=e(t(),1);function U(){let[e,t]=(0,H.useState)(!1),n=(0,H.useCallback)(()=>{setTimeout(()=>t(!0),100)},[]);return{loaded:e,refCallback:(0,H.useCallback)(e=>{e?.complete&&n()},[n]),onLoad:n}}function W({className:e,position:t,apiKey:n}){let{lat:r,lng:i}=t;return r==null||i==null?(0,F.jsx)(`div`,{className:e,children:`Map not available`}):(0,F.jsx)(N,{apiKey:n,children:(0,F.jsx)(M,{className:e,defaultCenter:{lat:r,lng:i},defaultZoom:16,disableDefaultUI:!0,mapTypeId:`roadmap`,mapId:`2957330f86e84ecf8cf97586`,clickableIcons:!1,children:(0,F.jsx)(j,{position:{lat:r,lng:i},children:(0,F.jsx)(u,{className:`bg-primary-600 p-2 rounded-full shadow-sm`,children:(0,F.jsx)(ee,{size:28,strokeWidth:1.5,className:`text-white`})})})})})}var G=6;function K(e){return!!e&&e.ratio<1}function q(e){return!!e&&!K(e)}function J(...e){return e.every(q)}function Y(e){return e.slots.reduce((e,t)=>t.type===`single`?e+t.cols:t.type===`stacked-group`?G:e,0)}function X(e){return Y(e)>=G}function Z(e){return e.slots.length===0}function Q(e){return e.slots.every(e=>e.type===`single`)}function te({currentRow:e,rows:t}){if(!X(e))return e;let n={row:e.row+1,slots:[]};return t.push(n),n}function ne({photo:e,nextPhoto:t,nextNextPhoto:n,row:r}){return Z(r)&&K(e)&&q(t)&&q(n)}function re({photo:e,nextPhoto:t,nextNextPhoto:n,previousRow:r,row:i}){let a=Y(i),o=K(e)&&K(t),s=q(e)&&q(t)&&r?.slots.length===1,c=Q(i)&&i.slots.length===1&&a===3,l=q(e)&&q(t)&&K(n),u=Z(i)&&q(e)&&q(t)&&!n||!t&&a===3&&Q(i);return c||u||Z(i)&&(o||s||l)}function ie({photo:e,previousPhoto:t,row:n}){return Y(n)===2&&K(t)&&q(e)}function ae({photo:e,nextPhoto:t,nextNextPhoto:n,previousRow:r,remainingPhotosCount:i,row:a}){let o=Y(a),s=J(e,t,n),c=J(e,t),l=Z(a)&&r?.slots.length===2&&s&&!!t,u=o===2&&c,d=o===4&&q(e),f=Z(a)&&K(e)&&q(t)&&K(n),p=!r&&(s&&Z(a)||c&&o===2||q(e)&&o===4),m=Z(a)&&s&&i<=3;return l||u||d||p||m||f}function oe(e){let t=[{row:1,slots:[]}],n=t[0],r=new Set;for(let i=0;i<e.length;i++)r.has(i)||(se({index:i,photo:e[i],nextPhoto:e[i+1],nextNextPhoto:e[i+2],row:n,previousRow:t[t.length-2],placedPhotoIndexes:r,remainingPhotosCount:e.length-r.size,previousPhoto:e[i-1]}),n=te({currentRow:n,rows:t}));return t}function $({photo:e,nextPhoto:t,nextNextPhoto:n,previousRow:r,remainingPhotosCount:i,row:a,previousPhoto:o}){return ae({row:a,previousRow:r,photo:e,nextPhoto:t,nextNextPhoto:n,remainingPhotosCount:i})?2:ie({row:a,photo:e,previousPhoto:o})?4:re({row:a,previousRow:r,photo:e,nextPhoto:t,nextNextPhoto:n})?3:6}function se({photo:e,index:t,row:n,placedPhotoIndexes:r,previousRow:i,nextPhoto:a,nextNextPhoto:o,remainingPhotosCount:s,previousPhoto:c}){if(ne({row:n,photo:e,nextPhoto:a,nextNextPhoto:o})){n.slots.push({type:`stacked-group`,vertical:{photo:e,originalIndex:t},stacked:[{photo:a,originalIndex:t+1},{photo:o,originalIndex:t+2}]}),r.add(t),r.add(t+1),r.add(t+2);return}let l=$({row:n,previousRow:i,photo:e,nextPhoto:a,nextNextPhoto:o,remainingPhotosCount:s,previousPhoto:c});n.slots.push({type:`single`,photo:e,originalIndex:t,cols:l,span:`md:col-span-${l}`}),r.add(t)}function ce({photos:e,onPhotoClick:t}){let n=(0,H.useCallback)(e=>oe(e),[])(e);return(0,F.jsx)(v,{gap:4,cols:2,className:`m-auto md:max-w-4-5xl md:grid-cols-6`,children:n.map(e=>e.slots.map(e=>e.type===`single`?(0,F.jsx)(`div`,{className:p(`px-0 col-span-2`,e.span),children:(0,F.jsx)(V,{onClick:()=>t(e.originalIndex),rounded:`sm`,className:`size-full overflow-hidden`,children:(0,F.jsx)(o,{id:`rental-photo-wall-${e.originalIndex}`,layout:`fixed`,photo:e.photo,rounded:`sm`,size:`grande`})})},e.photo.id):(0,F.jsxs)(`div`,{className:`px-0 col-span-2 md:col-span-6 grid grid-cols-2 gap-4`,children:[(0,F.jsx)(V,{onClick:()=>t(e.vertical.originalIndex),rounded:`sm`,className:`size-full overflow-hidden`,children:(0,F.jsx)(o,{id:`rental-photo-wall-${e.vertical.originalIndex}`,layout:`fixed`,photo:e.vertical.photo,rounded:`sm`,size:`grande`})}),(0,F.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.stacked.map(({photo:e,originalIndex:n})=>(0,F.jsx)(V,{onClick:()=>t(n),rounded:`sm`,className:`size-full overflow-hidden flex-1`,children:(0,F.jsx)(o,{id:`rental-photo-wall-${n}`,layout:`fixed`,photo:e,rounded:`sm`,size:`grande`})},e.id))})]},e.vertical.photo.id)))})}function le({photos:e,rental:t,open:n,onOpenChange:r,onPhotoClick:i,defaultIndex:a,actionButtons:o}){let s=[...e].sort((e,t)=>
1e.position-t.position);return(0,H.useEffect)(()=>{setTimeout(()=>a&&A(`rental-photo-wall-${a}`),100)},[a]),(0,F.jsx)(D,{open:n,onOpenChange:r,children:(0,F.jsxs)(w,{fullScreen:!0,children:[o,(0,F.jsxs)(u,{gap:8,className:`h-full pt-2`,children:[(0,F.jsxs)(E,{className:`pt-12 items-center`,children:[(0,F.jsx)(C,{size:`h2`,align:`center`,className:`hidden md:block`,children:t.name}),(0,F.jsx)(S,{className:`hidden`,"aria-hidden":!0,children:`Rental photos`}),(0,F.jsx)(z,{rental:t,align:`center`})]}),(0,F.jsx)(T,{className:`md:max-h-dvh max-h-dvh pb-12`,children:(0,F.jsx)(ce,{photos:s,onPhotoClick:i})})]})]})})}function ue({photo:e,className:t,containerClassName:n,...r}){let{loaded:i,refCallback:a,onLoad:s}=U();return(0,F.jsxs)(u,{alignItems:`center`,justifyContent:`center`,className:p(`relative`,n),children:[!i&&(0,F.jsx)(u,{alignItems:`center`,justifyContent:`center`,className:`absolute inset-0 w-full opacity-20`,children:(0,F.jsx)(h,{size:`xl`})}),(0,F.jsx)(o,{ref:a,onLoad:s,photo:e,"data-loaded":i,className:t,...r})]})}function de({defaultIndex:e,photos:t}){let[n,r]=O(),[i,a]=(0,H.useState)(e),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(!0);return(0,H.useEffect)(()=>{if(!r)return;let e=e=>{e.key===`ArrowLeft`||e.key===`h`?r.scrollPrev():(e.key===`ArrowRight`||e.key===`l`)&&r.scrollNext()};return document.addEventListener(`keyup`,e),()=>{document.removeEventListener(`keyup`,e)}},[r]),(0,H.useEffect)(()=>{r&&(r.on(`select`,e=>{a(e.selectedScrollSnap()),s(!e.canScrollNext()),l(!e.canScrollPrev())}),r.on(`reInit`,()=>a(e)),r.on(`init`,t=>t.scrollTo(e,!0)))},[r,e]),(0,F.jsxs)(_,{direction:`column`,size:`full`,gap:8,className:`py-16 h-full`,children:[(0,F.jsxs)(v,{cols:12,className:`items-center h-full`,children:[(0,F.jsx)(u,{justifyContent:`center`,alignItems:`center`,className:`hidden md:flex`,children:(0,F.jsx)(g,{disabled:c,textColor:`inherit`,className:`outline-white/45`,onClick:()=>r?.scrollPrev(),children:(0,F.jsx)(y,{strokeWidth:1,size:30})})}),(0,F.jsx)(`div`,{className:`col-span-12 md:col-span-10 overflow-hidden relative h-full`,ref:n,children:(0,F.jsx)(u,{direction:`row`,className:`h-full`,children:t.map(e=>(0,F.jsx)(`div`,{className:`min-w-0 grow-0 shrink-0 basis-full touch-pan-y h-full`,children:(0,F.jsx)(ue,{layout:`fixed`,photo:e,size:`giant`,rounded:`none`,containerClassName:`h-full`,className:`w-full h-full object-contain!`})},e.id))})}),(0,F.jsx)(u,{justifyContent:`center`,alignItems:`center`,className:`hidden md:flex`,children:(0,F.jsx)(g,{disabled:o,textColor:`inherit`,className:`outline-white/45`,onClick:()=>r?.scrollNext(),children:(0,F.jsx)(b,{strokeWidth:1,size:30})})})]}),(0,F.jsxs)(u,{gap:1,direction:`row`,justifyContent:`center`,alignItems:`center`,className:`text-lg`,children:[(0,F.jsx)(`span`,{children:i+1}),(0,F.jsx)(`span`,{className:`opacity-60`,children:`/`}),(0,F.jsx)(`span`,{children:t.length})]})]})}function fe({onOpenChange:e,photos:t,open:n=!1,defaultIndex:r=0,actionButtons:i}){let a=(0,H.useMemo)(()=>[...t].sort((e,t)=>Number(e.position)-Number(t.position)),[t]);return(0,F.jsx)(D,{open:n,onOpenChange:e,children:(0,F.jsxs)(w,{inverted:!0,fullScreen:!0,animation:`slideFromRight`,"aria-describedby":void 0,children:[(0,F.jsx)(C,{hidden:!0,"aria-hidden":!0,children:`Rental photos`}),i,(0,F.jsx)(de,{photos:a,defaultIndex:r})]})})}export{V as a,U as i,le as n,z as o,W as r,fe as t};
2//# sourceMappingURL=RentalSlideshowDialog-v0nVLjen.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.