1import{$t as e,At as t,B as n,Bt as r,Ct as i,Dt as a,E as o,Et as s,Jt as c,Mt as l,Nt as u,Ot as d,Pt as f,Sn as p,T as m,Tn as h,Vt as g,Zt as _,an as v,bt as y,in as ee,kt as b,l as te,mn as x,on as S,v as ne,wn as C,xn as w}from"./index-CPU57F_q.js";import{n as re}from"./vue-i18n.runtime.node-BHwqBpEi.js";import{_ as T,a as E,i as ie,p as ae}from"./module-loader-DlPl8aPw.js";import{r as D,t as oe}from"./BaseModule-lJnEzcpv.js";import{c as se,r as O}from"./radiusProps-CntKmniA.js";import{t as ce}from"./QTooltip-C1sM7qL4.js";import{t as k}from"./QIcon-BBBEZAsa.js";import{t as le}from"./QImg-ClcOAqxm.js";import{t as ue}from"./QBtn-B8vdP6eL.js";import{t as de}from"./QCard-CCx8Hq6w.js";import{t as fe}from"./QDialog-CQi2XBAb.js";import{t as A}from"./formatCurrency-DMNnJ2EA.js";import{t as pe}from"./getRandomizedArray-undJfdRX.js";import{t as j}from"./gtm-C9tCBQFD.js";import{t as M}from"./letsbook-D4o22Woz.js";import{t as N}from"./EditorLink-CHc-4Sxw.js";import{t as P}from"./ModuleEmptyState-DUcKZxuG.js";import{t as F}from"./ModuleLoader-DiMGGHXm.js";import{n as I,t as L}from"./highlightProps-Ch1Wl8LN.js";var R={key:0,class:`base-title-fontsize`},z={key:0,class:`tit tit-g`},B={key:1,class:`sub`},me={key:3,class:`slider-rooms swiper`},he=[`data-room-index`],ge={key:0,class:`discount-tag`},_e={key:1,class:`highlight-tag`},ve={key:2,class:`slider-images swiper`},ye=[`data-codigo`,`onClick`],be={class:`ls-navigation`},xe=[`id`],Se=[`id`],Ce={class:`room-wrapper__content`},we={class:`room-wrapper__name`},Te={key:0,class:`price-wrapper`},Ee={key:0,class:`price`},De={class:`price__label small-info`},Oe={key:0,class:`price-promo`},ke=[`innerHTML`],Ae={class:`half-content info-tooltip`},je={key:1},Me={class:`room-capacity`},Ne={class:`half-content room-capacity__label small-info`},Pe={class:`half-content room-capacity__info small-info`},Fe={key:0},Ie=[`id`],Le=[`onClick`],Re={key:0,class:`more`},ze={key:1,class:`less`},Be={class:`ls-navigation`},Ve=[`id`],He=[`id`],Ue={class:`accommodation-dialog__header`},We={key:0,class:`room-name`},Ge={class:`accommodation-dialog__content`},Ke={class:`accommodation-dialog__amenities`},qe={key:0,class:`list-amenities`},Je={class:`accommodation-dialog__photos`},Ye={key:0,class:`list-photos`},V=n(f({__name:`Accommodations`,props:{...D,...O,...I,hotel:{type:Number,default:null},showValor:{type:Boolean,default:!0},sortingType:{type:String,default:`highest-price`}},setup(n){let{t:f}=re(),D=M(),O=ie(),I=n,V=s(()=>({centerInsufficientSlides:!0,slidesPerView:1.1,slidesPerGroup:1,spaceBetween:20,followFinger:!1,touchStartPreventDefault:!1,breakpointsBase:`container`,breakpoints:{640:{slidesPerView:2,slidesPerGroup:1},768:{slidesPerView:3,slidesPerGroup:3},1024:{slidesPerView:4,slidesPerGroup:4},1400:{slidesPerView:5,slidesPerGroup:5}},navigation:{nextEl:`#btn-next-${I.instanceId}`,prevEl:`#btn-prev-${I.instanceId}`}}));function Xe(e){return{slidesPerView:1,slidesPerGroup:1,loop:e.imagens.urlImagem.length>1,followFinger:!1,navigation:{nextEl:`#btn-next-${I.instanceId}-${e.codigo}`,prevEl:`#btn-prev-${I.instanceId}-${e.codigo}`}}}let H=x(!0),U=x();async function Ze(e){U.value=await D.getHotel(e)}let W=x([]);async function Qe(){$e(await D.getAccommodations(I.hotel))}function $e(e){W.value=e.map(e=>{let{imagemPrincipal:t,urlImagem:n}=e.imagens,r=t&&!n.includes(t)?[t,...n]:[...n];return{...e,imagens:{...e.imagens,urlImagem:r},seeMoreEnabled:!1,seeMore:!1}})}async function et(){await g(),W.value.forEach(e=>{let t=document.getElementById(`description-text-${e.codigo}`);t&&t.offsetHeight>72&&(e.seeMoreEnabled=!0)})}c(()=>{ee(()=>I.hotel,async e=>{e&&(H.value=!0,await Promise.all([Ze(e),Qe()]),H.value=!1,await g(),I.isEditing||st())},{immediate:!0})});let G=s(()=>{let e=[],t=[];return W.value.forEach(n=>{let r=I.highlightItems.findIndex(({itemId:e})=>e===n.codigo);if(r>=0){n.isHighlight=!0,n.position=r,e.push(n);return}n.isHighlight=!1,t.push(n)}),[...e.sort((e,t)=>e.position-t.position),...K(tt(t,I.sortingType))]});function tt(e,t){switch(t){case`lowest-price`:return e.toSorted((e,t)=>(e.menorTarifa?.valor??1/0)-(t.menorTarifa?.valor??1/0));case`highest-price`:return e.toSorted((e,t)=>{let n=e.menorTarifa?.valor??-1/0;return(t.menorTarifa?.valor??-1/0)-n});case`highest-discount`:return e.toSorted((e,t)=>{let n=q(e)?e.menorTarifa?.percentualDesconto??0:0;return(q(t)?t.menorTarifa?.percentualDesconto??0:0)-n});case`random`:return pe(e);default:return e}}function K(e){return e.toSorted((e,t)=>{let n=e.menorTarifa&&e.menorTarifa.valor?1:0;return(t.menorTarifa&&t.menorTarifa.valor?1:0)-n})}function q(e){return e.menorTarifa?e.menorTarifa.exibirDesconto&&e.menorTarifa.percentualDesconto>0:!1}function nt(e){return e.replace(/(\D*)(\d{1,3}(?:[.,\s]\d{3})*)((?:[.,\s]\d{2})?\D*)/,`$1<span class="integer">$2</span>$3`)}function J(e){let t=e.menorTarifa&&e.menorTarifa.numeroAdultos,n=e.menorTarifa&&e.menorTarifa.numeroNoites;return t&&n?f(`disclaimer`,{nights:f(`night`,{count:n}),adults:f(`adult`,{count:t})}):``}function rt(e){return e||`https://${E().letsbookDomain}/reserva/busca/`}function it(e){return ae(O.pageSettings),q(e)?O.pageSettings.promotionColor||`#ff7a00`:O.pageSettings.primaryColor||void 0}function at(e){e.seeMore=!e.seeMore}function ot(e){return T(e)&&e!==`../content/images/padrao.jpg`}function Y(e,t,n){U.value&&(j({ecommerce:null}),j({event:e,ecommerce:{items:[{hotel_id:String(U.value.codigo),item_list_id:t.codigo,item_list_name:U.value.destino.cidade,item_name:t.nome,item_id:`Q${t.codigo}`,item_category:`Quarto`,item_category2:null,item_category3:U.value.nome,price:t.menorTarifa&&t.menorTarifa.valor>0?t.menorTarifa.valor:null,index:n+1}]}}))}let X=x();function st(){if(!X.value)return;let e=new IntersectionObserver(ct,{root:null,rootMargin:`0px -25% -25% 0px`,threshold:0});Object.values(X.value).forEach(t=>{e.observe(t)})}
1function ct(e,t){e.forEach(e=>{if(e.isIntersecting){let{roomIndex:n}=e.target.dataset;if(n){let e=G.value[Number(n)];Y(`view_item_list`,e,Number(n))}t.unobserve(e.target)}})}let Z=x(null),Q=x(!1);function lt(e){Z.value=e,Q.value=!0}function $(){Z.value=null,Q.value=!1}return(s,c)=>(_(),d(oe,r(I,{class:`accommodations-module`,"data-module":`accommodations`,style:{"--card-radius":w(se)(s.cardRadius),"--highlight-color":s.highlightColor||void 0,"--highlight-txt-color":w(L)(s.highlightColor)}}),{default:v(()=>[a(`div`,null,[s.title||s.subtitle?(_(),t(`header`,R,[s.title?(_(),t(`h2`,z,h(s.title),1)):b(``,!0),s.subtitle?(_(),t(`p`,B,h(s.subtitle),1)):b(``,!0)])):b(``,!0),H.value?(_(),d(F,{key:1})):G.value.length?(_(),t(`div`,me,[a(`swiper-container`,r(V.value,{class:`swiper-wrapper`,onSwiperinit:et}),[(_(!0),t(i,null,e(G.value,(c,g)=>(_(),t(`swiper-slide`,{ref_for:!0,ref_key:`roomRefs`,ref:X,key:c.codigo,"data-room-index":g,class:p([`room-wrapper swiper-slide`,{"highlight-item":c.isHighlight&&(s.highlightStyle===`border-tag`||s.highlightStyle===`border`)}])},[c.menorTarifa&&q(c)?(_(),t(`span`,ge,h(w(f)(`discount`,{count:c.menorTarifa.percentualDesconto})),1)):b(``,!0),c.isHighlight&&(s.highlightStyle===`border-tag`||s.highlightStyle===`tag`)?(_(),t(`span`,_e,h(w(f)(`featured`)),1)):b(``,!0),c.imagens.urlImagem.length?(_(),t(`div`,ve,[a(`swiper-container`,r({ref_for:!0},Xe(c),{class:`swiper-wrapper`}),[(_(!0),t(i,null,e(c.imagens.urlImagem,(e,n)=>(_(),t(`swiper-slide`,{key:n,class:`swiper-slide`},[ot(e)?(_(),d(le,{key:0,src:e,alt:`Imagem ${n}`,height:`100%`},null,8,[`src`,`alt`])):(_(),d(k,{key:1,name:w(m),color:`gray-600`,size:`xl`},null,8,[`name`])),a(`button`,{class:`btn-show-dialog`,"data-codigo":c.codigo,onClick:e=>lt(c)},[u(k,{name:w(o),class:`text-white`,size:`md`},null,8,[`name`])],8,ye)]))),128))],16),S(a(`div`,be,[a(`div`,{id:`btn-prev-${s.instanceId}-${c.codigo}`,class:`swiper-button-prev`},null,8,xe),a(`div`,{id:`btn-next-${s.instanceId}-${c.codigo}`,class:`swiper-button-next`},null,8,Se)],512),[[y,c.imagens.urlImagem.length>1]])])):(_(),d(k,{key:3,name:w(m),class:`no-img`,size:`xl`},null,8,[`name`])),a(`div`,Ce,[a(`h3`,we,h(c.nome),1),a(`div`,{class:p([`room-wrapper__info`,{"room-wrapper__info--no-price":!n.showValor,"room-wrapper__info--read-more":c.seeMore}])},[n.showValor?(_(),t(`div`,Te,[c.menorTarifa&&c.menorTarifa.valor?(_(),t(`div`,Ee,[a(`div`,De,[l(h(w(f)(`dailyRate`))+` `,1),q(c)?(_(),t(`span`,Oe,h(w(A)(c.menorTarifa.valorSemDesconto)),1)):b(``,!0)]),a(`div`,{class:`half-content price__info`,style:C({color:it(c)}),innerHTML:nt(w(A)(c.menorTarifa.valor))},null,12,ke),a(`div`,Ae,[J(c)?(_(),d(k,{key:0,name:w(ne),size:`sm`,color:`gray-600`},{default:v(()=>[u(ce,null,{default:v(()=>[l(h(J(c)),1)]),_:2},1024)]),_:2},1032,[`name`])):b(``,!0)])])):(_(),t(`div`,je,h(w(f)(`noPrice`)),1))])):b(``,!0),a(`div`,Me,[a(`div`,Ne,h(w(f)(`max`)),1),a(`div`,Pe,[l(h(w(f)(`adult`,{count:c.maximoAdultos}))+` `,1),c.maximoCriancas?(_(),t(`span`,Fe,h(w(f)(`and`))+` `+h(w(f)(`child`,{count:c.maximoCriancas})),1)):b(``,!0)])]),a(`div`,{class:p([`description`,{"description--empty":!w(T)(c.descricao)}])},[a(`p`,{id:`description-text-${c.codigo}`,class:`description__text`},h(c.descricao),9,Ie)],2),w(T)(c.descricao)?(_(),t(`button`,{key:1,class:p([`toggle-see-more`,{"toggle-see-more--hidden":!c.seeMoreEnabled}]),type:`button`,onClick:e=>at(c)},[c.seeMore?(_(),t(`span`,ze,h(w(f)(`readLess`)),1)):(_(),t(`span`,Re,h(w(f)(`readMore`)),1))],10,Le)):b(``,!0)],2),u(N,{model:rt(c.menorTarifa?.linkPublico),class:`cta`,onClick:e=>Y(`select_item`,c,g)},{default:v(()=>[l(h(w(f)(`book`)),1)]),_:1},8,[`model`,`onClick`])])],10,he))),128))],16),S(a(`div`,Be,[a(`div`,{id:`btn-prev-${s.instanceId}`,class:`swiper-button-prev`},null,8,Ve),a(`div`,{id:`btn-next-${s.instanceId}`,class:`swiper-button-next`},null,8,He)],512),[[y,G.value.length>1]])])):(_(),d(P,{key:2,title:w(f)(`notAvailableAccommodationsTitle`),subtitle:w(f)(`notAvailableAccommodationsSubtitle`),img:`/modules/empty-accommodations.png`},null,8,[`title`,`subtitle`]))])]),modal:v(()=>[u(fe,{id:`accommodation-dialog`,class:`accommodation-dialog site-dialog`,"model-value":Q.value,maximized:``,onEscapeKey:$},{default:v(()=>[u(de,null,{default:v(()=>[a(`div`,Ue,[Z.value?(_(),t(`h3`,We,h(Z.value.nome),1)):b(``,!0),u(ue,{icon:w(te),size:`lg`,flat:``,round:``,class:`close-btn`,onClick:$},null,8,[`icon`])]),a(`div`,Ge,[a(`div`,Ke,[Z.value?(_(),t(`ul`,qe,[(_(!0),t(i,null,e(Z.value.amenidades,(e,n)=>(_(),t(`li`,{key:n,class:`list-amenities__item`},h(e),1))),128))])):b(``,!0)]),a(`div`,Je,[Z.value?(_(),t(`ul`,Ye,[(_(!0),t(i,null,e(Z.value.imagens.urlImagem,(e,n)=>(_(),t(`li`,{key:n,class:`list-photos__item`,style:C({backgroundImage:`url('${e}')`})},null,4))),128))])):b(``,!0)])])]),_:1})]),_:1},8,[`model-value`])]),_:1},16,[`style`]))}}),[[`__scopeId`,`data-v-a24dfeec`]]);export{V as default};
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.