PageSourceSearch

https://hotelsunstargroup.com/assets/TestimonialSection-CcdYmjvG.js

js hotelsunstargroup.com collected 2026-10-09 17:19:45 UTC 4,568 bytes, 1 lines download raw bytes

1import{r as i,j as s}from"./index-Dqjr8Yhf.js";import{C as v}from"./CommonSlider-DOfoDWf-.js";import{m as y}from"./proxy-CZ1SbDk5.js";import{u as j}from"./useTestimonialHook-D1jfCYWl.js";const N=(e="")=>{const l=String(e).trim();if(!l)return{city:"",country:""};const a=l.indexOf(",");return a===-1?{city:"",country:l}:{city:l.slice(0,a).trim(),country:l.slice(a+1).trim()}},S=({item:e,className:l=""})=>{const a=Math.max(1,Math.min(5,Number(e==null?void 0:e.starCount)||5)),t=String((e==null?void 0:e.name)||"").trim(),n=String((e==null?void 0:e.heading)||"").trim(),o=String((e==null?void 0:e.description)||"").trim(),{city:d,country:x}=N(e==null?void 0:e.location),[r,f]=i.useState(!1),[w,b]=i.useState(!1),m=i.useRef(null),g=t&&d?`${t}, ${d}`:t||d||"Guest";return i.useEffect(()=>{f(!1)},[e==null?void 0:e._id,e==null?void 0:e.id,o]),i.useEffect(()=>{const c=m.current;if(!c||r)return;const u=()=>{b(c.scrollHeight>c.clientHeight+1)};return u(),window.addEventListener("resize",u,{passive:!0}),()=>window.removeEventListener("resize",u)},[o,n,r]),s.jsxs(y.div,{className:`testimonial-card box-border flex h-full min-h-[280px] w-full max-w-full flex-col overflow-hidden rounded-2xl border border-primary-yellow/70 bg-white px-5 py-5 text-center sm:px-6 ${l}`,initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},transition:{duration:.45,ease:"easeOut"},viewport:{once:!0,amount:.4},children:[s.jsx("div",{className:"mb-3 flex shrink-0 justify-center gap-0.5",children:Array.from({length:a}).map((c,u)=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-[18px] w-[18px] text-primary-yellow","aria-hidden":"true",children:s.jsx("path",{fillRule:"evenodd",d:"M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z",clipRule:"evenodd"})},u))}),n?s.jsx("h3",{className:"mb-2 line-clamp-2 shrink-0 text-base font-bold leading-snug text-primary-dark-green",children:n}):null,s.jsxs("div",{className:"flex min-h-0 w-full flex-1 flex-col",children:[s.jsx("p",{ref:m,className:`min-h-0 w-full break-words text-[15px] leading-6 text-gray-800 ${r?"max-h-28 overflow-y-auto pr-1":"overflow-hidden line-clamp-4"}`,children:o||"No review text available."}),(w||r)&&s.jsx("button",{type:"button",onClick:()=>f(c=>!c),className:"mt-2 shrink-0 self-center text-sm font-semibold text-primary-green hover:underline",children:r?"Less":"More"})]}),s.jsxs("div",{className:"mt-4 w-full shrink-0 border-t border-gray-200 pt-3",children:[s.jsx("p",{className:"line-clamp-2 text-base font-bold leading-snug text-primary-dark-green",children:g}),x?s.jsx("p",{className:"mt-1 line-clamp-1 text-sm font-normal leading-snug text-sky-700/80",children:x}):null]})]})},p={0:{slidesPerView:1,spaceBetween:16},768:{slidesPerView:2,spaceBetween:20},1024:{slidesPerView:3,spaceBetween:24}},h="box-border h-auto min-w-0 testi-slide",k=({backgroundImage:e,page:l="",head:a="Testimonials"})=>{const{data:t}=j({page:l}),n=Array.isArray(t)?t:(t==null?void 0:t.testimonials)||(t==null?void 0:t.data)||[],[o,d]=i.useState(!1);i.useEffect(()=>{const r=()=>d(window.innerWidth<768);return r(),window.addEventListener("resize",r,{passive:!0}),()=>window.removeEventListener("resize",r)},[]);const x=r=>s.jsx(S,{item:r});return s.jsxs("div",{className:"w-full relative pt-10 pb-5 md:py-12",children:[e&&s.jsx("div",{className:"absolute inset-0 -z-10",children:s.jsx("img",{src:e,alt:"Guest testimonials background",title:"Guest testimonials background",className:"w-full h-full object-cover"})}),s.jsxs("div",{className:"content flex flex-col relative pt-2 md:pt-3",children:[s.jsx("h2",{className:"text-mobile/h3 md:text-desktop/h3 font-bold leading-tight text-gray-900 text-start",children:a}),s.jsx("div",{className:"mt-3 mb-6 md:mb-8 border-b border-gray-300"}),s.jsx(v,{items:n,renderItem:x,spaceBetween:16,loop:!o&&n.length>3,centeredSlides:!1,enableAutoplay:!1,slidesPerView:1,slidesPerViewDesktop:3,slidesPerViewTablet:2,breakpoints:p,showPagination:o||n.length>3,className:"relative z-10 testiM mySwiper w-full max-w-full overflow-hidden",slideClassName:h,arrow:n.length>3?"pt-4":"",disableNavigation:n.length<=3})]})]})},C=Object.freeze(Object.defineProperty({__proto__:null,TESTIMONIAL_BREAKPOINTS:p,TESTIMONIAL_SLIDE_CLASS:h,default:k},Symbol.toStringTag,{value:"Module"}));
1export{k as T,p as a,h as b,S as c,C as d};

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.