import{e as ue,r,j as e,u as ie,n as U,D as he,v as fe,w as xe,p as V,O as pe,M as ge,y as we,S as be,z as je,g as ye,m as ve}from"./vendor-BXQAQzXu.js";import{s as ee}from"./tailwind-C9rHxv7E.js";import{F as Ne}from"./Select-Buv94kiS.js";import{t as te}from"./transformUtm-9lP4nPuV.js";import{u as Le,N as Se}from"./Global-CKpXTxwr.js";import{F as se}from"./SelectResponsive-CVR3hdt1.js";import"./ui-CbCB892d.js";const ae="/assets/fonts-D0g1fkRJ.css";function ke(){const t=ue(),[s,a]=r.useState(0);return r.useEffect(()=>{if(t.state==="loading"){const l=setInterval(()=>{a(n=>n<90?n+10:(clearInterval(l),n))},200)}else t.state==="idle"&&s!==0&&(a(100),setTimeout(()=>a(0),300))},[t.state,s]),s===0&&setTimeout(()=>null,300),e.jsx("div",{className:"h-[4px] fixed top-0 w-full bg-sundanceGold-base z-50",style:{height:"4px",width:`${s}%`,transition:"width 0.3s ease"}})}const $e=({adult:t,setAdult:s,child:a,setChild:l,fromValue:n,toValue:o,setFromValue:c,setToValue:m,activeIndex:p,setActiveIndex:b,selectedIndex:g,setSelectedIndex:N,options:y,optionsID:L,bookingLink:S="https://booking.dijiwasanctuaries.com/",maxAdult:k=7,maxChild:$=1})=>{const{utm:I}=ie(),d=new Date,D=new Date(d.getFullYear(),d.getMonth(),d.getDate()),B=i=>{t>=0&&t{t>0&&s(t-i)},W=i=>{a>=0&&a<$&&l(a+i)},R=i=>{a>0&&l(a-i)},T=i=>fe(i,d)&&!xe(i),[h,C]=r.useState(),[j,A]=r.useState(!1),[F,w]=r.useState(!1),q=()=>{w(!F)},_=i=>{C(i),i!=null&&i.from?c(V(i.from,"y-MM-dd")):c(""),i!=null&&i.to?m(V(i.to,"y-MM-dd")):m("")};let z=e.jsx("p",{});h!=null&&h.from&&h.to&&h.to&&(z=e.jsx("p",{}));const M=U().pathname.startsWith("/at"),[O,J]=r.useState("");r.useEffect(()=>{J(M?`&checkin=${n}&checkout=${o}&adults=${t}&children=${a}`:`destination?city=${L[y[g]]}&checkin=${n}&checkout=${o}&adults=${t}&children=${a}`)},[n,o,t,a,g]);const f=r.useCallback(i=>{let x="";const P=typeof window<"u"&&sessionStorage.getItem("utmData");return P?x=te(i,JSON.parse(P)):x=te(i,I),x},[I]);return e.jsxs("div",{className:"h-full bg-whiteBase mx-auto flex flex-col max-w-1120 items-center justify-between p-6 px-8 gap-3",children:[!M&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("label",{className:"technicaltext",children:"Destinations"}),e.jsx(Ne,{placeholder:"Select Destination",options:y,isOpen:j,setIsOpen:A,activeIndex:p,setActiveIndex:b,selectedIndex:g,setSelectedIndex:N})]})}),e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("label",{className:"technicaltext",children:"Check-in & Check-out"}),e.jsxs("button",{style:{fontFamily:"Helvetica Neue, sans-serif",textTransform:"capitalize",paddingLeft:"1rem",paddingRight:"1rem"},onClick:q,className:"flex justify-between h-10 items-center heading4-subheadline bg-grayscale-4 hover:border hover:border-grayscale-3 focus:outline-none focus:ring-0",children:[n||o?`${n} - ${o}`:"Select Date",e.jsx("img",{src:"/icon/chevron-down.png",alt:"chevron-down",className:"h-4 w-4",width:16,height:16})]}),e.jsx("div",{className:`fixed h-[425px] inset-x-0 bottom-0 transform transition-transform duration-300 ease-in-out z-20 ${F?"translate-y-0":"translate-y-full"}`,children:F&&e.jsxs("div",{className:"bottom-popup-fixed bg-whiteBase",children:[e.jsxs("div",{className:"header bg-whiteBase flex justify-between items-center p-2 border-b border-b-sundanceGold-base",children:[e.jsx("p",{children:"CHECK IN & CHECKOUT"}),o===""?e.jsx("div",{className:"bg-grayscale-3 p-[6px] cursor-pointer",onClick:q,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M16 2.65165L13.3483 0L8.00002 5.34833L2.65165 0L0 2.65165L5.34836 7.99998L0 13.3483L2.65165 16L8.00002 10.6517L13.3483 16L16 13.3483L10.6516 7.99998L16 2.65165Z",fill:"#312E28"})})}):e.jsx("div",{className:"button-primary",onClick:q,children:"Select Date"})]}),e.jsx("div",{className:"bodycontent grid grid-cols-1 justify-center items-center max-h-[424px] overflow-y-auto",children:e.jsx("div",{className:"bg-whiteBase flex justify-center",children:e.jsx(he,{id:"bookingDate",mode:"range",selected:h,onSelect:_,defaultMonth:D,footer:z,numberOfMonths:1,disabled:{before:d},modifiers:{disabled:T}})})})]})})]}),e.jsxs("div",{className:"flex justify-between w-full gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx("label",{className:"technicaltext",children:"Adults"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("button",{className:"button-subs h-10 min-w-10",onClick:()=>u(1),children:"-"}),e.jsx("input",{type:"text",className:"w-full text-center heading4-subheadline bg-grayscale-4 h-[40px] focus:outline-none focus:ring-0",value:t,readOnly:!0}),e.jsx("button",{className:"button-add h-10 min-w-10",onClick:()=>B(1),children:"+"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx("label",{className:"technicaltext",children:"Children"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("button",{className:"button-subs h-10 min-w-10",onClick:()=>R(1),children:"-"}),e.jsx("input",{type:"text",className:"w-full text-center heading4-subheadline bg-grayscale-4 h-[40px] focus:outline-none focus:ring-0",value:a,readOnly:!0}),e.jsx("button",{className:"button-add h-10 min-w-10",onClick:()=>W(1),children:"+"})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx("label",{className:"technicaltext",children:" "}),e.jsx("div",{className:"flex items-center",children:e.jsx("a",{href:f(`${S}${O}`),className:"button-primary w-full h-[40px]",children:"Check Availability"})})]}),e.jsx("div",{children:e.jsx("p",{className:"text-xs",children:"As you proceed to the final stages of your booking, all prices will be converted in IDR, and any payments will be made in IDR. Prices displayed in other currencies are for illustrative purposes only and are based on the current exchange rate."})})]})},Ie=({options:t,optionsID:s,properties:a,env:l})=>{const[n,o]=r.useState(!1),[c,m]=r.useState(1),[p,b]=r.useState(0),[g,N]=r.useState(""),[y,L]=r.useState(""),[S,k]=r.useState(null),[$,I]=r.useState(),d={name:[],wa:[]};a.forEach(x=>{x.attributes.propertyWhatsappUrl!="#"&&x.attributes.propertyWhatsappUrl!=null&&x.attributes.propertyWhatsappUrl!=""&&(d.name.push(x.attributes.propertyDisplayName),d.wa.push(x.attributes.propertyWhatsappUrl))});const[D,B]=r.useState(!1),[u,W]=r.useState(null),[R,T]=r.useState(null),[h,C]=r.useState(!1),[j,A]=r.useState(!1);r.useEffect(()=>(n?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[n]);const{imageUrlSecondary:F,urlWA:w,floatingBookLink:q,isComingSoon:_,propertiesGlobal:z,maxAdult:Q,maxChild:M,waPopup:O}=Le(),f=U().pathname.startsWith("/at"),i=async x=>{x.preventDefault();const P=x.target,E=new FormData(P),re=`${l.API_ENDPOINT||""}whats-app-forms`,oe=l.JWT_POSTCONTACT,ce=E.get("name"),de=E.get("waNumber"),G=E.get("message")??"",X=E.get("hotelWA"),me=E.get("hotelName");if(E.get("waNumber"))try{const v=new Headers;if(v.set("Content-Type","application/json"),v.set("Authorization",`Bearer ${oe}`),(await fetch(re,{method:"POST",headers:v,body:JSON.stringify({data:{name:ce,phoneNumber:de,hotel:me,message:G}})})).ok){const Y=`${X}?text=${encodeURIComponent(G)}`;window.location.href=Y}else{const Y=`${X}?text=${encodeURIComponent(G)}`;console.error("Failed to submit form data",X),window.location.href=Y}}catch(v){console.error("Error submitting form:",v)}else{const v=`${X}?text=${encodeURIComponent(G)}`;window.location.href=v}};return e.jsx(e.Fragment,{children:!_&&e.jsxs(e.Fragment,{children:[(n||h||j)&&e.jsx("div",{className:"absolute w-full h-full bg-[rgba(0,0,0,0.5)] top-0 left-0 z-30",onClick:()=>{o(!1),C(!1),A(!1)}}),e.jsxs("div",{className:"flex fixed bottom-0 h-10 w-full bg-midnightBlue-base z-10 md:hidden",children:[f&&e.jsx(e.Fragment,{children:w!="#"&&w&&O&&e.jsx("button",{onClick:()=>A(!j),className:"w-[20%]",children:e.jsx("div",{className:"w-full flex items-center justify-center bg-sundanceGold-base",children:e.jsx("img",{src:"/icon/whatsapp.svg",className:"w-12 h-12 pb-[4px]",alt:"whatsapp icon"})})})}),!f&&e.jsx("button",{onClick:()=>A(!j),className:"w-[20%]",children:e.jsx("div",{className:"w-full flex items-center justify-center bg-sundanceGold-base",children:e.jsx("img",{src:"/icon/whatsapp.svg",className:"w-12 h-12 pb-[4px]",alt:"whatsapp icon"})})}),e.jsx("div",{className:`${f&&w!="#"&&w&&O?"w-[80%]":"w-full"} flex items-center justify-center`,children:e.jsx("button",{className:"w-full h-full text-whiteBase text-[16px] leading-[19.2px] tracking-[-0.48px] font-bold text-center",onClick:()=>o(!n),children:"Select Dates"})})]}),e.jsx("div",{className:`fixed ${f?"max-h-[350px]":"max-h-[425px]"} h-full inset-x-0 bottom-0 transform transition-transform duration-300 ease-in-out z-30 ${n?"translate-y-0":"translate-y-full"}`,children:n&&e.jsxs("div",{className:"bottom-popup-fixed !h-[80vh] !overflow-y-auto scrollbar-hidden",children:[e.jsxs("div",{className:"header flex justify-between items-center py-6 px-8 bg-whiteBase",children:[e.jsx("img",{className:"h-8 w-auto",src:F,alt:"Dijiwa Sanctuaries"}),e.jsx("button",{className:"bg-grayscale-3 p-[6px]",onClick:()=>o(!n),children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M16 2.65165L13.3483 0L8.00002 5.34833L2.65165 0L0 2.65165L5.34836 7.99998L0 13.3483L2.65165 16L8.00002 10.6517L13.3483 16L16 13.3483L10.6516 7.99998L16 2.65165Z",fill:"#312E28"})})})]}),e.jsx("hr",{className:"border-b-[1px] border-sundanceGold-2 mx-8"}),e.jsx("div",{className:"bg-grayscale-3 bodycontent justify-center items-center h-[450px] border-0",children:e.jsx($e,{maxAdult:Q,maxChild:M,bookingLink:q,adult:c,child:p,setAdult:m,setChild:b,fromValue:g,toValue:y,setFromValue:N,setToValue:L,activeIndex:S,setActiveIndex:k,selectedIndex:$,setSelectedIndex:I,options:t,optionsID:s})})]})}),e.jsx("div",{className:`fixed h-full inset-x-0 bottom-0 transform transition-transform duration-300 ease-in-out z-30 ${j?"translate-y-0":"translate-y-full"}`,children:j&&e.jsxs("div",{className:"bottom-popup-fixed max-h-[95vh] border border-sundanceGold-2 rounded-t-4xl",children:[e.jsxs("div",{className:"flex justify-between items-center py-4 px-8 bg-grayscale-4 border-b-grayscale-3 rounded-t-4xl",children:[e.jsx("p",{className:"heading-4-subheadline capitalize",children:"Contact us on WhatsApp"}),e.jsx("button",{className:"bg-grayscale-3 p-[6px]",onClick:()=>A(!j),children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M16 2.65165L13.3483 0L8.00002 5.34833L2.65165 0L0 2.65165L5.34836 7.99998L0 13.3483L2.65165 16L8.00002 10.6517L13.3483 16L16 13.3483L10.6516 7.99998L16 2.65165Z",fill:"#312E28"})})})]}),e.jsxs("div",{className:"bg-grayscale-4 bodycontent justify-center items-center h-[85%] border-0 overflow-y-auto scrollbar-hidden",children:[e.jsxs("div",{className:"relative overflow-hidden h-[325px]",children:[e.jsx("img",{src:"/img/whatsapp-form-img.webp",alt:"wa-bg",className:"w-full h-auto object-cover brightness-75"}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-4",children:e.jsx("p",{className:"text-lg font-medium text-whiteBase leading-6",children:"We’re happy to assist! Share your details and message, and we’ll handle the rest. Your privacy is always a priority."})})]}),e.jsx("div",{className:"flex flex-col wa-form mb-6 bg-grayscale-4 p-8 gap-6",children:e.jsx("form",{className:"min-w-[320px]",onSubmit:i,children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("label",{className:"capitalize",htmlFor:"name",children:"Name"}),e.jsx("div",{className:"flex items-center",children:e.jsx("input",{type:"text",name:"name",className:"w-full px-2 bodytext2-leadingtrim md:bodytext1-leadingtrim bg-grayscale-4 h-[40px] border border-grayscale-3 focus:outline-none focus:ring-0",required:!0})})]}),e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("label",{className:"capitalize",htmlFor:"waNumber",children:"WhatsApp Number"}),e.jsx("div",{className:"flex items-center",children:e.jsx("input",{type:"text",name:"waNumber",className:"w-full px-2 bodytext2-leadingtrim md:bodytext1-leadingtrim bg-grayscale-4 h-[40px] border border-grayscale-3 focus:outline-none focus:ring-0"})})]}),f?e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"hidden",name:"hotelName",value:`${z}`}),e.jsx("input",{type:"hidden",name:"hotelWA",value:`${w}`})]}):e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"hidden",name:"hotelWA",value:`${d.wa[u||0]}`}),e.jsx("input",{type:"hidden",name:"hotelName",value:`${d.name[u||0]}`}),e.jsx("div",{className:"flex gap-6 text-left w-full max-w-[736px] justify-center items-center mx-auto",children:e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("label",{className:"capitalize",children:"Hotel & Resorts"}),e.jsx("div",{className:"flex items-center",children:e.jsx(se,{placeholder:"Select Properties",options:d.name,isOpen:D,setIsOpen:B,activeIndex:R,setActiveIndex:T,selectedIndex:u,setSelectedIndex:W,bordered:!0})})]})})]}),e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("label",{className:"capitalize",htmlFor:"message",children:"Messages"}),e.jsx("div",{className:"flex items-center",children:e.jsx("textarea",{name:"message",rows:2,className:"w-full h-full px-2 py-2 bodytext2-leadingtrim md:bodytext1-leadingtrim bg-grayscale-4 border border-grayscale-3 focus:outline-none focus:ring-0",required:!0})})]}),e.jsx("div",{className:"flex flex-col justify-center items-center",children:f?e.jsx("button",{className:"button-primary w-full",children:"Send"}):e.jsx("button",{className:`button-primary w-full ${u!=null?"":"opacity-30 cursor-not-allowed"}`,disabled:u==null,children:"Send"})})]})})})]})]})}),e.jsx("div",{className:"",children:e.jsxs("section",{className:"fixed bottom-10 right-14 z-30",children:[h&&e.jsxs("div",{className:"flex mb-6 rounded-4xl border border-sundanceGold-2 max-h-[75vh]",children:[e.jsxs("div",{className:"relative rounded-tl-4xl rounded-bl-4xl overflow-hidden w-[420px]",children:[e.jsx("img",{src:"/img/whatsapp-form-img.webp",alt:"wa-bg",className:"w-full h-auto object-cover brightness-75"}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-4",children:e.jsx("p",{className:"text-lg font-medium text-whiteBase leading-6",children:"We’re happy to assist! Share your details and message, and we’ll handle the rest. Your privacy is always a priority."})})]}),e.jsxs("div",{className:"flex flex-col wa-form bg-grayscale-4 px-6 py-4 gap-4 rounded-tr-4xl rounded-br-4xl overflow-y-auto scrollbar-hidden",children:[e.jsxs("div",{className:"flex justify-between border-b border-b-grayscale-3 pb-4",children:[e.jsx("p",{className:"heading-4-subheadline capitalize",children:"Contact us on WhatsApp"}),e.jsx("button",{className:"bg-grayscale-3 p-[6px]",onClick:()=>C(!h),children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M16 2.65165L13.3483 0L8.00002 5.34833L2.65165 0L0 2.65165L5.34836 7.99998L0 13.3483L2.65165 16L8.00002 10.6517L13.3483 16L16 13.3483L10.6516 7.99998L16 2.65165Z",fill:"#312E28"})})})]}),e.jsx("form",{className:"min-w-[320px]",onSubmit:i,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("label",{className:"capitalize",htmlFor:"name",children:"Name"}),e.jsx("div",{className:"flex items-center",children:e.jsx("input",{type:"text",name:"name",className:"w-full px-2 bodytext2-leadingtrim md:bodytext1-leadingtrim bg-grayscale-4 h-[40px] border border-grayscale-3 focus:outline-none focus:ring-0",required:!0})})]}),e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("label",{className:"capitalize",htmlFor:"waNumber",children:"WhatsApp Number"}),e.jsx("div",{className:"flex items-center",children:e.jsx("input",{type:"text",name:"waNumber",className:"w-full px-2 bodytext2-leadingtrim md:bodytext1-leadingtrim bg-grayscale-4 h-[40px] border border-grayscale-3 focus:outline-none focus:ring-0"})})]}),f?e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"hidden",name:"hotelWA",value:`${w}`}),e.jsx("input",{type:"hidden",name:"hotelName",value:`${z}`})]}):e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"hidden",name:"hotelWA",value:`${d.wa[u||0]}`}),e.jsx("input",{type:"hidden",name:"hotelName",value:`${d.name[u||0]}`}),e.jsx("div",{className:"flex gap-6 text-left w-full max-w-[736px] justify-center items-center mx-auto",children:e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("label",{className:"capitalize",children:"Hotel & Resorts"}),e.jsx("div",{className:"flex items-center",children:e.jsx(se,{placeholder:"Select Properties",options:d.name,isOpen:D,setIsOpen:B,activeIndex:R,setActiveIndex:T,selectedIndex:u,setSelectedIndex:W,bordered:!0})})]})})]}),e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("label",{className:"capitalize",htmlFor:"message",children:"Messages"}),e.jsx("div",{className:"flex items-center",children:e.jsx("textarea",{name:"message",rows:2,className:"w-full h-full px-2 py-2 bodytext2-leadingtrim md:bodytext1-leadingtrim bg-grayscale-4 border border-grayscale-3 focus:outline-none focus:ring-0",required:!0})})]}),e.jsx("div",{className:"flex flex-col justify-center items-center",children:f?e.jsx("button",{className:"button-primary w-full",children:"Send"}):e.jsx("button",{className:`button-primary w-full ${u!=null?"":"opacity-30 cursor-not-allowed"}`,disabled:u==null,children:"Send"})})]})})]})]}),f&&e.jsx(e.Fragment,{children:w!="#"&&w&&O&&e.jsx("div",{className:"hidden md:flex justify-end ",children:e.jsxs("button",{"aria-label":"WhatsApp Form",className:"cursor-pointer",onClick:()=>C(!h),children:[e.jsx("span",{className:"sr-only",children:"WA Button"}),e.jsx("img",{src:"/icon/whatsapp.svg",alt:"whatsapp",className:"h-10 w-10 rounded-full"})]})})}),!f&&e.jsx("div",{className:"hidden md:flex justify-end",children:e.jsxs("button",{"aria-label":"WhatsApp Form",className:"cursor-pointer",onClick:()=>C(!h),children:[e.jsx("span",{className:"sr-only",children:"WA Button"}),e.jsx("img",{src:"/icon/whatsapp.svg",alt:"whatsapp",className:"h-10 w-10 rounded-full"})]})})]})})]})})},Ce=()=>{const t=U();return r.useEffect(()=>{t.hash||window.scrollTo(0,0)},[t]),null};function K(t,s={}){return new Promise((a,l)=>{if(document.querySelector(`script[src="${t}"]`)){a();return}const n=document.createElement("script");n.src=t,n.async=!0,n.defer=!0,Object.entries(s).forEach(([o,c])=>{n.setAttribute(o,c)}),n.onload=()=>a(),n.onerror=()=>l(new Error(`Failed to load script: ${t}`)),document.head.appendChild(n)})}let ne=!1;function H(){ne||(ne=!0,Ae(),requestIdleCallback(()=>{Ee(),Fe()}))}function Ae(){const t="GTM-5QBJK8S";if(window.dataLayer=window.dataLayer||[],window.dataLayer.push({"gtm.start":new Date().getTime(),event:"gtm.js"}),K(`https://www.googletagmanager.com/gtm.js?id=${t}&l=dataLayer`).catch(console.warn),!document.querySelector("noscript[data-gtm]")){const s=document.createElement("noscript");s.setAttribute("data-gtm","true"),s.innerHTML=` `,document.body.appendChild(s)}}function Ee(){window.fbq||(window.fbq=function(...t){window.fbq.callMethod?window.fbq.callMethod.apply(window.fbq,t):(window.fbq.queue=window.fbq.queue||[],window.fbq.queue.push(t))},window.fbq.push=window.fbq,window.fbq.loaded=!0,window.fbq.version="2.0",window.fbq.queue=[],K("https://connect.facebook.net/en_US/fbevents.js").then(()=>{window.fbq("init","YOUR_PIXEL_ID"),window.fbq("track","PageView")}).catch(console.warn))}function Fe(){const t="G-XXXXXXXXXX";K(`https://www.googletagmanager.com/gtag/js?id=${t}`).then(()=>{window.dataLayer=window.dataLayer||[],window.gtag=function(...s){window.dataLayer.push(s)},window.gtag("js",new Date),window.gtag("config",t,{send_page_view:!1,anonymize_ip:!0,cookie_flags:"secure;samesite=strict"})}).catch(console.warn)}const le=["click","scroll","keydown","touchstart"];function Z(){if(document.readyState==="complete"){setTimeout(H,100);return}const t=new IntersectionObserver(l=>{l.forEach(n=>{n.isIntersecting&&(H(),t.disconnect())})}),s=document.querySelector("main, body > div:first-child, section:first-child");s&&t.observe(s);const a=()=>{H(),le.forEach(l=>{document.removeEventListener(l,a)})};le.forEach(l=>{document.addEventListener(l,a,{passive:!0,once:!0})}),setTimeout(H,3e3)}function qe(t){typeof window>"u"||(window.dataLayer&&window.dataLayer.push({event:"page_view",page_location:window.location.href,page_path:t}),window.gtag&&window.gtag("config","G-XXXXXXXXXX",{page_path:t}),window.fbq&&window.fbq("track","PageView"))}typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Z):Z());function ze(){const t=U();r.useEffect(()=>{qe(t.pathname+t.search)},[t.pathname,t.search])}function Oe(t){r.useEffect(()=>{if(typeof window>"u"||!t.length)return;const s=[];return t.forEach(({src:a,sizes:l,assetUrl:n=""})=>{const o=a.startsWith("http")?a:`${n}${a}`,c=document.createElement("link");if(c.rel="preload",c.as="image",c.href=o,l&&c.setAttribute("imagesizes",l),n&&o.includes(n)){const p=[{width:640,quality:75},{width:1280,quality:90},{width:1920,quality:95}].map(({width:b,quality:g})=>`${o}?width=${b}&quality=${g}&format=webp ${b}w`).join(", ");c.setAttribute("imagesrcset",p)}document.head.appendChild(c),s.push(c)}),()=>{s.forEach(a=>{try{a.parentNode&&document.head.removeChild(a)}catch{}})}},[t])}function De(t,s=""){var l,n,o,c,m,p,b,g,N,y,L,S,k,$;const a=[];try{(o=(n=(l=t.homeHero)==null?void 0:l.data)==null?void 0:n.attributes)!=null&&o.url&&a.push({src:t.homeHero.data.attributes.url,assetUrl:s,sizes:"100vw"}),(p=(m=(c=t.heroImage)==null?void 0:c.data)==null?void 0:m.attributes)!=null&&p.url&&a.push({src:t.heroImage.data.attributes.url,assetUrl:s,sizes:"100vw"}),(y=(N=(g=(b=t.sliderImages)==null?void 0:b.data)==null?void 0:g[0])==null?void 0:N.attributes)!=null&&y.url&&a.push({src:t.sliderImages.data[0].attributes.url,assetUrl:s,sizes:"100vw"}),($=(k=(S=(L=t.propertyGallery)==null?void 0:L.data)==null?void 0:S[0])==null?void 0:k.attributes)!=null&&$.url&&a.push({src:t.propertyGallery.data[0].attributes.url,assetUrl:s,sizes:"100vw"}),["/mathis/bleu-mathis.webp","/img/destination.jpg","/img/journey.jpg"].forEach(d=>{a.push({src:d,sizes:"100vw"})})}catch{}return a.slice(0,3)}const Je=()=>[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"}],Ye=()=>[{rel:"preload",href:ae,as:"style"},{rel:"preload",href:ee,as:"style"},{rel:"stylesheet",href:ae},{rel:"stylesheet",href:ee},{rel:"preconnect",href:"https://www.googletagmanager.com"},{rel:"preconnect",href:"https://www.google-analytics.com"},{rel:"preconnect",href:"https://connect.facebook.net"},{rel:"dns-prefetch",href:"https://www.googletagmanager.com"},{rel:"dns-prefetch",href:"https://www.google-analytics.com"},{rel:"dns-prefetch",href:"https://connect.facebook.net"},{rel:"preconnect",href:"https://placehold.co"},{rel:"dns-prefetch",href:"https://placehold.co"}],Be=t=>{r.useEffect(()=>{if(!t||typeof window>"u")return;const s=document.querySelector(`link[rel="preconnect"][href="${t}"]`),a=document.querySelector(`link[rel="dns-prefetch"][href="${t}"]`);if(!s){const l=document.createElement("link");l.rel="preconnect",l.href=t,document.head.appendChild(l)}if(!a){const l=document.createElement("link");l.rel="dns-prefetch",l.href=t,document.head.appendChild(l)}},[t])},We=()=>{r.useEffect(()=>{typeof window<"u"&&Z()},[])};function Ze({children:t}){const s=ie();let a=[],l={};s&&({allProperties:a,env:l}=s);const n=[{value:"5266",destination:"Ubud"},{value:"5265",destination:"Seminyak"},{value:"5267",destination:"Canggu"},{value:"5269",destination:"Umalas"},{value:"5271",destination:"Amed"},{value:"368",destination:"Gili Asahan"}],o=n.map(m=>m.destination),c=n.reduce((m,p)=>(m[p.destination]=p.value,m),{});return We(),ze(),Be(s==null?void 0:s.assetUrl),Oe(De(s,s==null?void 0:s.assetUrl)),e.jsxs("html",{lang:"en",children:[e.jsxs("head",{children:[e.jsx(ge,{}),e.jsx(we,{})]}),e.jsxs("body",{className:"font-helvetica-neue relative bg-whiteBase",suppressHydrationWarning:!0,children:[e.jsx(ke,{}),e.jsxs(Se,{children:[t,e.jsx(Ie,{options:o,optionsID:c,properties:a,env:l})]}),e.jsx(be,{}),e.jsx(je,{})]})]})}function Ke(){return e.jsxs(e.Fragment,{children:[e.jsx(Ce,{}),e.jsx(pe,{})]})}function Qe(){const t=ye();return ve(t)?e.jsx("section",{className:"bg-whiteBase flex flex-col py-0 md:py-12 justify-center align-middle gap-6 px-[24px]",children:e.jsxs("div",{className:"flex flex-col justify-center items-center gap-6",children:[e.jsx("h2",{className:"heading4-subheadline capitalize",children:"It's Seems You Are Lost Root"}),e.jsxs("p",{className:"bodytext2-leadingtrim",children:["Return to"," ",e.jsx("a",{className:"hover:text-sundanceGold-base",href:"/",children:"Homepage"})]})]})}):t instanceof Error?e.jsx("section",{className:"bg-whiteBase flex flex-col py-0 md:py-12 justify-center align-middle gap-6 px-[24px]",children:e.jsxs("div",{className:"flex flex-col justify-center items-center gap-6",children:[e.jsx("h2",{className:"heading4-subheadline capitalize",children:"Something went wrong"}),e.jsxs("p",{className:"bodytext2-leadingtrim",children:["If this issues persist, you can directly sent email to"," ",e.jsx("a",{className:"hover:text-sundanceGold-base",href:"mailto:info@dijiwasanctuaries.com",children:"info@dijiwasanctuaries.com"})]}),e.jsxs("p",{className:"bodytext2-leadingtrim",children:["Return to"," ",e.jsx("a",{className:"hover:text-sundanceGold-base",href:"/",children:"Homepage"})]})]})}):e.jsx("section",{className:"bg-whiteBase flex flex-col py-0 md:py-12 justify-center align-middle gap-6 px-[24px]",children:e.jsxs("div",{className:"flex flex-col justify-center items-center gap-6",children:[e.jsx("h2",{className:"heading4-subheadline capitalize",children:"Unknown Error"}),e.jsxs("p",{className:"bodytext2-leadingtrim",children:["If this issues persist, you can directly sent email to"," ",e.jsx("a",{className:"hover:text-sundanceGold-base",href:"mailto:info@dijiwasanctuaries.com",children:"info@dijiwasanctuaries.com"})]}),e.jsxs("p",{className:"bodytext2-leadingtrim",children:["Return to"," ",e.jsx("a",{className:"hover:text-sundanceGold-base",href:"/",children:"Homepage"})]})]})})}export{Qe as ErrorBoundary,Ze as Layout,Ke as default,Ye as links,Je as meta};