1var e=document.querySelector(`#booking-cat-link`),t=document.querySelector(`#form_calculator`),n=document.querySelector(`#occ`),r=document.querySelector(`#meta`),i=document.querySelector(`.currency__links`),a=document.querySelector(`.currency-text`),o=document.querySelector(`meta[name="csrf-token"]`)?.content||``,s={euros:document.querySelectorAll(`.euros`),dollars:document.querySelectorAll(`.dollars`),bpounds:document.querySelectorAll(`.bpounds`),cdollars:document.querySelectorAll(`.cdollars`)},c={euro:document.querySelector(`.fee-euro`),usd:document.querySelector(`.fee-usd`),gbp:document.querySelector(`.fee-gbp`),cad:document.querySelector(`.fee-cad`)},l={"Content-Type":`application/json;charset=utf-8`},u=async(e,t,n={})=>{let r=await fetch(e,{method:`POST`,headers:{...l,...n},body:JSON.stringify(t)});if(!r.ok)throw Error(`Request failed: ${r.status}`);return r.json()},d=(e,t,n,r)=>n.includes(`FA`)?`/booknow/`:encodeURI(`https://${e}.sixthman.net/cron/booking/cat/${n}/occ/${r}/page/${t}`),f=()=>parseInt(r?.dataset.firstAvailable??1)===0,p={".bpud":{show:`bpounds`,fee:`gbp`,showText:!0},".ero":{show:`euros`,fee:null,showText:!0},".dols":{show:`dollars`,fee:`usd`,showText:!1},".cdol":{show:`cdollars`,fee:`cad`,showText:!0}},m=(e,t)=>{Object.entries(s).forEach(([e,n])=>{n.forEach(n=>{n.style.display=e===t.show?`block`:`none`})}),c.euro&&Object.entries(c).forEach(([e,n])=>{n&&(n.style.display=e===t.fee?`inline-block`:`none`)}),i?.querySelector(`.active`)?.classList.remove(`active`),e?.classList.add(`active`),a&&(a.style.display=t.showText?`block`:`none`)};Object.entries(p).forEach(([e,t])=>{document.querySelector(e)?.addEventListener(`click`,e=>{e.preventDefault(),m(e.currentTarget,t)})});var h=new Set([`#payment`,`#prices`,`#calculator`]),g=document.querySelectorAll(`.tablink-prices`);if(g.length){g.forEach(e=>{e.addEventListener(`click`,t=>{t.preventDefault(),window.history.pushState(null,null,e.dataset.url)})});let{hash:e}=window.location;if(e&&!h.has(e)){let t=document.querySelector(`.nav-tabs [data-bs-target="${e}"]`);t&&(g.forEach(e=>{e.classList.remove(`active`),e.setAttribute(`aria-selected`,`false`)}),document.querySelectorAll(`.tab-pane`).forEach(e=>e.classList.remove(`active`)),t.classList.add(`active`),t.setAttribute(`aria-selected`,`true`),t.style.display=`block`,document.querySelector(e)?.classList.add(`active`),document.querySelector(`#prices-tabs`)?.scrollIntoView({behavior:`smooth`,block:`start`}))}}if(e&&f()){let{env:t,url:n}=e.dataset;document.querySelectorAll(`.cat-link`).forEach(e=>{e.addEventListener(`click`,r=>{r.preventDefault(),window.open(d(t,n,e.dataset.type,e.dataset.occ),`_self`)})})}n?.addEventListener(`change`,async e=>{e.preventDefault();let t=n.value,r=document.querySelector(`#code`).value;try{let e=await u(`/prices/calc-occ/`,{occ:t,code:r,csrf_token:o}),n=document.querySelector(`#code`);n.innerHTML=[`<option value="">Select</option>`,...e.map(e=>`<option ${e.code===r?`selected`:``} value="${e.code}">${e.description} - ${e.deck}</option>`)].join(``)}catch(e){console.error(`Occupancy fetch failed:`,e)}}),t?.addEventListener(`submit`,async e=>{e.preventDefault();let r=t.querySelector(`#submit`),i=document.querySelector(`#bookit`),a=document.querySelector(`#code`),s=document.querySelector(`#calculator`),c=n.value,l=a.value,p=a.options[a.selectedIndex].text,m=s.dataset.disclaimer;i.style.display=`none`,r.disabled=!0,r.textContent=`Calculating...`;try{let e=await u(`/prices/calc-payment/`,{occ:parseInt(c),code:l,description:p,csrf_token:o});document.querySelectorAll(`.total_pp`).forEach(t=>t.innerHTML=e.totalPerPerson),document.querySelectorAll(`.total_pif`).forEach(t=>t.innerHTML=e.totalPerPersonPIF),document.querySelector(`#total_pif_discount`).innerHTML=e.cabinDisc;let t=new Date,n=e.schedule.pmtschedule.reduce((n,r)=>{let i=n;if(parseInt(r.deposit)===1)i+=`<div><span class="pmt-highlight">${e.deposit_due_now}</span>`,parseInt(c)!==1&&(i+=` <span class="smallz">(${e.deposit_due_now_pp} per person)</span>`),i+=` due at booking</div><br>`;else if(parseInt(r.final_pmt)===1){if(!parseInt(e.pastFinalPayment)){let e=r.amt.toString().replace(`$`,``);parseInt(e)>0&&(i+=`<div><strong>${r.amt}</strong>
2 <span class="arb-not-single smallz">(${r.amt_pp} per person)</span> 3 is due on <strong>${r.full_date}</strong></div>`)}}else!parseInt(e.pastFinalPayment)&&t<=new Date(r.full_date)&&(r.amt.includes(`-`)||(i+=`<div><strong>${r.amt}</strong> 4 <span class="arb-not-single smallz">(${r.amt_pp} per person)</span> 5 is due on <strong>${r.full_date}</strong></div>`));return i},``);document.querySelector(`#payment_schedule`).innerHTML=n;let a=document.querySelector(`.prices__calculator-arb`);a.style.display=e.arbstatus?`block`:`none`;let s=t.toISOString().slice(0,10),h=new Date(e.pifExpiration).toISOString().slice(0,10);document.querySelector(`.prices__calculator-pif`).style.display=s<=h?`block`:`none`;let g={"#arb-deposit":e.arbdeposit,"#arb-deposit-pp":e.arbdeposit_pp,"#arb-total-months":e.arbmonthdif,"#arb-start-date":e.nextMonthText,"#arb-end-date":e.arbfinalMonthText,"#arb-monthly-payment":e.arbmonthlypayment,"#arb-monthly-payment-pp":e.arbmonthlypayment_pp};Object.entries(g).forEach(([e,t])=>{document.querySelector(e).innerHTML=t});let _=parseInt(c)===1?`only 1 guest`:`${c} guests`,v=m.replace(`{guestText}`,_);document.querySelector(`.prices__calculator-disclaimer`).innerHTML=v,document.querySelector(`#showme`).style.display=`block`;let y=parseInt(c)===1;document.querySelectorAll(`.arb-not-single`).forEach(e=>{e.style.display=y?`none`:`inline-block`}),r.disabled=!1,r.textContent=`Calculate`;let b=document.querySelector(`#show-book-it-btn`);if(b&&(i.innerHTML=`<a class="btn cat-link-btn cat-calc-btn" data-occ="${c}" data-type="${l}" href="/booknow/">Book This</a>`,i.style.display=`block`,f())){let{env:e,url:t}=b.dataset;document.querySelector(`.cat-calc-btn`)?.addEventListener(`click`,n=>{n.preventDefault(),window.open(d(e,t,l,c),`_self`)})}}catch(e){console.error(`Calculator submission failed:`,e),r.disabled=!1,r.textContent=`Calculate`}});
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.