{"version":3,"file":"TestimonialsSlider.CfX4ATMN.mjs","names":["React.useState"],"sources":["https:/framer.com/m/SanityFetcher-lEKU.js@M7gfiviiQSCMKzqjdAIV","https:/framerusercontent.com/modules/4INSfYm2N6WI4f54IHKQ/c9zIBYytp3qELTaklkOb/TestimonialsSlider.js"],"sourcesContent":["const PROJECT_ID=\"yuyzewaj\";const DATASET=\"production\";const API_VERSION=\"2023-10-10\";const TOKEN=\"skOenIqbbpFx7v9WoXIH89y3yICikl5Ew9e6qua8e3MZnpgOUMGcimUoizgNUp3yhwuD6UoL0pKaPGBahSsShZ2k92GKD5Gg3o2bftWwBYivLRjDjXf4WQttSb9XkGZAFF65iJTFzjqqIZpUtT77Nd5IVvQCDb0E31zudTEfAwAwBqDsBZeQ\";const QUERY={podcastItems:`*[_type == \"podcastItems\"]{ _id, title, order, button, videoUrl, description, podcastDescription }`,pageVideos:`*[_type == \"pageVideos\"]{ page, videoBlock, \"videoUrl\": uploadVideo.asset->url }`,therapist:`*[_type == \"therapist\"]{ name, group, filterGroup, \"imageUrl\": imageUrl.asset->url, pronouns, type }`,videoTherapistCarousel:`*[_type == \"videoTherapistCarousel\"]{ name, title, \"videoUrl\": video.asset->url }`,patientReflection:`*[_type == \"patientReflection\"]{ name, reflection, \"imageUrl\": image.asset->url }`,successStories:`*[_type == \"successStories\"]{ name, reflection, \"imageUrl\": image.asset->url }`,impactOfSource:`*[_type == \"impactOfSource\"]{ name, reflection, \"imageUrl\": image.asset->url }`,carouselImages:`*[_type == \"carouselImages\"]{ title, altText, description, collection, \"imageUrl\": image.asset->url }`,clientSlider:`*[_type == \"clientSlider\"]{ name, title, \"videoUrl\": video.asset->url }`,therapistSlider:`*[_type == \"therapistSlider\"]{ name, title, \"videoUrl\": video.asset->url }`};export async function getSanityData(type){const queryString=QUERY[type];const SANITY_URL=`https://${PROJECT_ID}.apicdn.sanity.io/v${API_VERSION}/data/query/${DATASET}?query=${encodeURIComponent(queryString)}`;const response=await fetch(SANITY_URL,{headers:{Authorization:`Bearer ${TOKEN}`,\"Content-Type\":\"application/json\"}});if(!response.ok){throw new Error(`Failed to fetch data: ${response.status} ${response.statusText}`);}return response.json();}export const pages=[{title:\"Home\",value:\"/home\"},{title:\"About\",value:\"/about\"},{title:\"Therapists\",value:\"/therapists\"},{title:\"Client\",value:\"/client\"},{title:\"Podcast\",value:\"/podcast\"},{title:\"Child Podcast\",value:\"/child-podcast\"},{title:\"Terms of Use\",value:\"/terms-of-use\"},{title:\"Cancellation Policy\",value:\"/cancellation-policy\"},{title:\"Refund Policy\",value:\"/refund-policy\"},{title:\"Privacy Policy\",value:\"/privacy-policy\"}];\nexport const __FramerMetadata__ = {\"exports\":{\"pages\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getSanityData\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SanityFetcher.map","// Get Started: https://www.framer.com/developers\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import*as React from\"react\";import{LeftArrow,RightArrow}from\"https://framer.com/m/Arrows-U18l.js@QH6KiXL8hOr1LYROwCm8\";import{getSanityData}from\"https://framer.com/m/SanityFetcher-lEKU.js@M7gfiviiQSCMKzqjdAIV\";function getVisibleCount(){if(typeof window===\"undefined\")return 4;if(window.innerWidth<440)return 1;if(window.innerWidth<1024)return 2;return 4;}export default function TestimonialsSlider(props){const{tint,type=\"patientReflection\"}=props;const[start,setStart]=React.useState(0);const[visibleCount,setVisibleCount]=React.useState(getVisibleCount());const[items,setItems]=React.useState([]);React.useEffect(()=>{getSanityData(type).then(data=>setItems(data?.result||[])).catch(error=>{console.log(\"error: \",error);});},[]);React.useEffect(()=>{// Prevent issues in Framer Canvas/SSR\nif(typeof window===\"undefined\")return;function handleResize(){setVisibleCount(getVisibleCount());setStart(0);}window.addEventListener(\"resize\",handleResize);return()=>window.removeEventListener(\"resize\",handleResize);},[]);const maxStart=Math.max(0,items.length-visibleCount);const handlePrev=()=>setStart(prev=>Math.max(0,prev-1));const handleNext=()=>setStart(prev=>Math.min(maxStart,prev+1));return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",overflow:\"hidden\",position:\"relative\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\"},children:[/*#__PURE__*/_jsx(\"button\",{onClick:handlePrev,disabled:start===0,\"aria-label\":\"Previous\",style:{background:\"none\",border:\"none\",fontSize:32,cursor:start===0?\"not-allowed\":\"pointer\",opacity:start===0?.3:1,marginRight:12,color:tint,fontFamily:'\"Circular Std Book\", \"Circular Std Book Placeholder\", sans-serif'},children:/*#__PURE__*/_jsx(LeftArrow,{})}),/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:23,flex:1,justifyContent:\"center\",minHeight:250},children:items.length>0?items.slice(start,start+visibleCount).map((item,idx)=>/*#__PURE__*/_jsxs(\"div\",{style:{background:\"none\",borderRadius:20,boxShadow:\"0 2px 8px rgba(0,0,0,0.04)\",minWidth:220,maxWidth:280,flex:\"1 0 0\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\"},children:[/*#__PURE__*/_jsx(\"img\",{src:item.imageUrl,alt:item.name,style:{width:224,height:230,borderRadius:20,objectFit:\"cover\",marginBottom:18}}),/*#__PURE__*/_jsx(\"div\",{style:{fontWeight:600,fontSize:18,marginBottom:8,textAlign:\"center\",fontFamily:'\"Circular Std Book\", \"Circular Std Book Placeholder\", sans-serif'},children:item.name}),/*#__PURE__*/_jsx(\"div\",{style:{color:\"#222\",fontSize:15,textAlign:\"center\",fontFamily:'\"Circular Std Book\", \"Circular Std Book Placeholder\", sans-serif'},children:item.reflection})]},item.name+idx)):/*#__PURE__*/_jsx(\"div\",{style:{textAlign:\"center\",width:\"100%\"},children:\"No testimonials available.\"})}),/*#__PURE__*/_jsx(\"button\",{onClick:handleNext,disabled:start>=maxStart,\"aria-label\":\"Next\",style:{background:\"none\",border:\"none\",fontSize:32,cursor:start>=maxStart?\"not-allowed\":\"pointer\",opacity:start>=maxStart?.3:1,marginLeft:12,color:tint},children:/*#__PURE__*/_jsx(RightArrow,{})})]})});}addPropertyControls(TestimonialsSlider,{tint:{title:\"Tint\",type:ControlType.Color,defaultValue:\"#09F\"},type:{title:\"Type\",type:ControlType.String}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TestimonialsSlider\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TestimonialsSlider.map"],"mappings":"uZAAoyC,eAAsB,EAAc,EAAK,CAAC,IAAM,EAAY,EAAM,GAAY,EAAW,WAAW,EAAW,qBAAqB,EAAY,cAAc,EAAQ,SAAS,mBAAmB,EAAY,GAAS,EAAS,MAAM,MAAM,EAAW,CAAC,QAAQ,CAAC,cAAc,UAAU,IAAQ,eAAe,mBAAmB,CAAC,CAAC,CAAC,GAAG,CAAC,EAAS,GAAI,MAAU,MAAM,yBAAyB,EAAS,OAAO,GAAG,EAAS,aAAa,CAAE,OAAO,EAAS,MAAM,yBAA/tD,EAAW,WAAiB,EAAQ,aAAmB,EAAY,aAAmB,EAAM,uLAA6L,EAAM,CAAC,aAAa,qGAAqG,WAAW,mFAAmF,UAAU,uGAAuG,uBAAuB,oFAAoF,kBAAkB,oFAAoF,eAAe,iFAAiF,eAAe,iFAAiF,eAAe,wGAAwG,aAAa,0EAA0E,gBAAgB,6EAA6E,ICCp+B,SAAS,GAAiB,CAA8G,OAAnG,IAAS,OAAmB,EAAK,EAAO,WAAW,IAAW,EAAK,EAAO,WAAW,KAAY,EAAS,EAAG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,qBAAqB,EAAW,CAAC,EAAM,GAAUA,EAAe,EAAE,CAAM,CAAC,EAAa,GAAiBA,EAAe,GAAiB,CAAC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