PageSourceSearch

https://www.indianabeach.com/slice---src-slices-modules-calendar-index-tsx-7c15ac360cda58c1be81.js

js indianabeach.com collected 2026-10-03 19:11:58 UTC 37,079 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkgazella_project=self.webpackChunkgazella_project||[]).push([[8158],{17011:function(e,t,n){n.r(t),n.d(t,{default:function(){return R}});var r=n(96540),a=n(52709),i=n(35915),o=n(92901),s=n(77387),l=n(45458),c=n(85018),d=n(1308),u=n(34213);let p=function(e){function t(){return e.apply(this,arguments)||this}(0,s.A)(t,e);var n=t.prototype;return n.normalizeDate=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t},n.closedTranslation=function(e){return"es-ES"===e?"CERRADO":"de-DE"===e||"de-AT"===e?"GESCHLOSSEN":"it-IT"===e?"CHIUSO":"fr-FR"===e?"FERMÉ":"nb-NO"===e||"no-NO"===e?"STENGT":"CLOSED"},n.openTranslation=function(e){return"es-ES"===e?"ABIERTO":"de-DE"===e||"de-AT"===e?"OFFEN":"it-IT"===e?"APRIRE":"fr-FR"===e?"OUVRIR":"nb-NO"===e||"no-NO"===e?"ÅPEN":"OPEN"},n.isClosed=function(){const e=this.getShortestOpeningHour();if(!e)return!0;const{open_monday:t,open_tuesday:n,open_wednesday:r,open_thursday:a,open_friday:i,open_saturday:o,open_sunday:s,status:l}=e,c=t||n||r||a||i||o||s;return"closed"===l||!(this.isDayOpen()||!c)},n.isDayOpen=function(){const e=this.getShortestOpeningHour();if(!e)return!1;const{selectedDay:t}=this.props,{open_friday:n,open_monday:r,open_saturday:a,open_sunday:i,open_thursday:o,open_tuesday:s,open_wednesday:l}=e,c=t.getDay();return 0===c?i:1===c?r:2===c?s:3===c?l:4===c?o:5===c?n:6===c&&a},n.renderRanges=function(){const e=this.getShortestOpeningHour();if(!e)return this.renderClosed();const{open_monday:t,open_tuesday:n,open_wednesday:r,open_thursday:a,open_friday:i,open_saturday:o,open_sunday:s,status:l,monday_ranges:c,tuesday_ranges:d,wednesday_ranges:u,thursday_ranges:p,friday_ranges:h,saturday_ranges:m,sunday_ranges:g}=e,f="open"!==l||(t||n||r||a||i||o||s)?this.renderClosed():this.renderOpen(),{selectedDay:y}=this.props,v=y.getDay();return 0===v?s&&null!=g&&g.length?this.renderHours(g):f:1===v?t&&null!=c&&c.length?this.renderHours(c):f:2===v?n&&null!=d&&d.length?this.renderHours(d):f:3===v?r&&null!=u&&u.length?this.renderHours(u):f:4===v?a&&null!=p&&p.length?this.renderHours(p):f:5===v?i&&null!=h&&h.length?this.renderHours(h):f:6===v?o&&null!=m&&m.length?this.renderHours(m):f:null},n.toDate=function(e){if(e instanceof Date)return this.normalizeDate(e);if(/^\d{4}-\d{2}-\d{2}$/.test(e)){const t=e.split("-");return this.normalizeDate(new Date(parseInt(t[0]),parseInt(t[1])-1,parseInt(t[2]),0,0,0))}return this.normalizeDate(new Date(e))},n.getOpeningHourInRange=function(e){const{selectedDay:t}=this.props;return e.filter((e=>{if(!e)return!1;const n=this.toDate(t).getTime(),r=this.toDate(e.end_date).getTime();return n>=this.toDate(e.start_date).getTime()&&n<=r}))},n.getShortestOpeningHour=function(){const{openingHours:e=[]}=this.props,t=this.getOpeningHourInRange(e);if(!t||!t.length)return null;const n=(e,t)=>t.getTime()-e.getTime();return(0,l.A)(t).sort(((e,t)=>{const{start_date:r,end_date:a}=e,{start_date:i,end_date:o}=t,s=n(this.toDate(r||""),this.toDate(a||"")),l=n(this.toDate(i||""),this.toDate(o||""));return s<l?-1:s>l?1:0}))[0]},n.shouldItemBeDisplayed=function(){const{mode:e}=this.props;return"agenda"===e&&this.isClosed()?null:this.renderItem()},n.getWrapper=function(e){const{link:t}=this.props,n="w-full max-w-[415px]";return t?r.createElement(u.A,{href:t,className:`flex ${n}`},e):r.createElement("div",{className:`flex ${n}`},e)},n.renderClosed=function(){const{mode:e}=this.props;return"agenda"===e?null:r.createElement("div",{className:"flex gap-2"},r.createElement(c.A,{icon:"ClosedStatusV2",className:"w-6 h-6 min-h-[24px] min-w-[24px]"}),this.closedTranslation(this.props.language))},n.renderOpen=function(){return"agenda"===this.props.mode?null:r.createElement("div",{className:"flex gap-2"},r.createElement(c.A,{icon:"OpenStatusV2",className:"w-6 h-6 min-h-[24px] min-w-[24px]"}),this.openTranslation(this.props.language))},n.renderHours=function(e){if(e&&e.length)return r.createElement("div",{className:"flex gap-2"},"agenda"!==this.props.mode?r.createElement(c.A,{icon:"OpenStatusV2",className:"w-6 h-6 min-h-[24px] min-w-[24px]"}):null,r.createElement("div",{className:"flex flex-col"},e.map(((e,t)=>{let{end_hour:n,start_hour:a}=e;return r.createElement("div",{key:`hours-${t}`},`${a} - ${n}`)}))))},n.renderItem=function(){const{name:e,description:t,icon:n,iconType:a}=this.props;return this.getWrapper(r.createElement("div",{className:"w-full min-h-[109px] flex border border-[color:var(--item-cell-color)] rounded-lg overflow-hidden",style:this.colorStyle},r.createElement("span",{className:"flex items-center justify-center bg-[color:var(--item-cell-color)] text-[color:var(--item-cell-text-color)] border-r border-[color:var(--item-cell-color)] min-w-[65px]"},"material"===a?n&&r.createElement(c.Z,{icon:n,className:"w-6"}):n&&r.createElement(d.A,{src:n,alt:"",asSvgIcon:!0,className:"w-6 h-6"})),r.createElement("div",{className:"flex flex-col py-2 overflow-hidden pl-4 pr-2 gap-2 bg-white w-full"},r.createElement("div",{className:"flex flex-col"},e?r.createElement("div",{className:"line-clamp-1 generalTextBold pt-1"},e):null,t?r.createElement("div",{className:"line-clamp-2 text-zinc-500 text-sm"},t):null),r.createElement("div",{className:"line-clamp-1 headlineGeneralText flex gap-1 mt-auto"},this.renderRanges()))))},n.render=function(){const{name:e,description:t}=this.props;return e||t?this.shouldItemBeDisplayed():null}
1,(0,o.A)(t,[{key:"colorStyle",get:function(){return this.props.color?{"--item-cell-color":this.props.color,"--item-cell-text-color":this.props.textColor}:{}}}])}(r.Component);p.defaultProps={name:"Lorem ipsum",description:"Lorem ipsum dolor sit amet, consectetur adipiscing",openingHours:[]};var h=n(3562),m=n(24868),g=n(36146);function f(e,t,n){return(0,m.Yw)(e,t,n)}function y(e,t,n){const{label:r,color:a,text_color:i,translations:o,id:s,icon_type:l,icon:c,material_icon:d}=e,u="custom"===l?null==c?void 0:c.imageFile:d;return{active:!1,color:null==a?void 0:a.value,text_color:null==i?void 0:i.value,icon_type:l,icon:u,label:(0,h.b)(o,t,"singular")||r,type:"entry_type",id:s,position:n}}function v(e,t,n){const{color:r,text_color:a,custom_icon:i,material_icon:o,name:s,icon_type:l,id:c,translations:d}=e,u="custom"===l?null==i?void 0:i.imageFile:o;return{active:!1,text_color:null==a?void 0:a.value,color:null==r?void 0:r.value,icon:u,label:(0,h.b)(d,t,"singular")||s,type:"supplier_category",icon_type:l,id:c,position:n}}let D=function(e){function t(){return e.apply(this,arguments)||this}return(0,s.A)(t,e),t.prototype.render=function(){const{filter:e,onClick:t}=this.props,{color:n,text_color:a,icon_type:i,label:o,icon:s,active:l}=e;return s||o?r.createElement(r.Fragment,null,r.createElement("button",{className:"flex gap-2 rounded-full py-2 px-4 items-center hover:opacity-80 "+(l?"":"!bg-[#F4F4FA] !text-[#A6A6AE]"),style:{background:n,color:a},onClick:t},"material"===i?s&&r.createElement(c.Z,{icon:s,className:"w-4"}):s&&r.createElement(d.A,{src:s,asSvgIcon:!0,alt:"",className:"w-4 h-4 min-w-[16px] min-h-[16px]"}),o)):null},t}(r.Component);var _=n(23856),C=n(96190),x=n(74310),w=n(84514),b=n(17031),k=n(50932),E=n(54575),S=n(18586),N=n(25246),T=n(79524);let B=function(e){function t(){return e.apply(this,arguments)||this}return(0,s.A)(t,e),t.prototype.render=function(){const{onClick:e,dayLabel:t,dayNumber:n}=this.props;return r.createElement("button",{onClick:e,className:`flex flex-col items-center gap-2 w-14 min-w-[56px] max-w-[56px] py-2 ${this.colors} ${this.rounded}`,style:this.styles},r.createElement("span",null,t),r.createElement("span",null,n))}
1,(0,o.A)(t,[{key:"colors",get:function(){const{type:e}=this.props;return"active"===e?"text-[color:var(--activeColor)] bg-[color:var(--activeBgColor)] lg:hover:bg-[color:var(--activeHoverBgColor)] lg:hover:text-[color:var(--activeHoverColor)]":"inactive"===e?"text-[color:var(--inactiveColor)] bg-[color:var(--inactiveBgColor)] lg:hover:bg-[color:var(--inactiveHoverBgColor)] lg:hover:text-[color:var(--inactiveHoverColor)]":"disabled"===e?"text-[color:var(--disabledColor)] bg-[color:var(--disabledBgColor)] pointer-events-none":""}},{key:"rounded",get:function(){const{dayMarkerStyle:e}=this.props;return"full_rounded"===e?"rounded-full":"rounded"===e?"rounded-lg":""}},{key:"styles",get:function(){const{activeBackgroundColor:e,activeColor:t,activeHoverBackgroundColor:n,activeHoverColor:r,disabledBackgroundColor:a,disabledColor:i,inactiveBackgroundColor:o,inactiveHoverBackgroundColor:s,inactiveColor:l,inactiveHoverColor:c}=this.props;return{"--activeBgColor":e,"--activeColor":t,"--activeHoverBgColor":n,"--activeHoverColor":r,"--disabledBgColor":a,"--disabledColor":i,"--inactiveColor":l,"--inactiveBgColor":o,"--inactiveHoverBgColor":s,"--inactiveHoverColor":c}}}])}(r.Component);var I=n(40546);let A=function(e){function t(){for(var t,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return(t=e.call.apply(e,[this].concat(a))||this).slider=r.createRef(),t}(0,s.A)(t,e);var n=t.prototype;return n.getDayOfWeek=function(e){try{return Intl.DateTimeFormat(this.language,{weekday:"short"}).format(e)}catch(t){return Intl.DateTimeFormat("en-US",{weekday:"short"}).format(e)}},n.getDayNumber=function(e){try{return Intl.DateTimeFormat(this.language,{day:"2-digit"}).format(e)}catch(t){return Intl.DateTimeFormat("en-US",{day:"2-digit"}).format(e)}},n.slideTo=function(e){var t;const n=this.days.findIndex((t=>this.isSameDay(t,e)))||0;null===(t=this.slider.current)||void 0===t||t.slideTo(n)},n.onChange=function(e){this.props.onDateChange&&this.props.onDateChange(e)},n.isSameDay=function(e,t){return e instanceof Date&&t instanceof Date&&!isNaN(e.getTime())&&!isNaN(t.getTime())&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},n.getInitialSlide=function(){const e=this.days.findIndex((e=>this.isSameDay(e,this.props.selectedDate)));return-1!==e?e:0},n.render=function(){const{activeBackgroundColor:e,activeTextColor:t,activeHoverBackgroundColor:n,activeHoverTextColor:a,disabledBackgroundColor:i,id:o,disabledColor:s,inactiveBackgroundColor:l,inactiveTextColor:c,inactiveHoverBackgroundColor:d,inactiveHoverTextColor:u,dayMarkerStyle:p,className:h}=this.props;return r.createElement("div",{className:`w-full max-w-[280px] sm:max-w-[562px] lg:max-w-[800px] ${h}`},r.createElement(I.A,{ref:this.slider,id:o,slidesPerView:9,initialSlide:this.getInitialSlide(),pagination:!1,autoplay:!1,navigation:!0,virtual:!0,breakpoints:{320:{slidesPerView:5,spaceBetween:0,slidesPerGroup:this.props.groupScroll?5:1},640:{slidesPerView:7,spaceBetween:21.25,slidesPerGroup:this.props.groupScroll?7:1},1024:{slidesPerView:9,spaceBetween:29.6,slidesPerGroup:this.props.groupScroll?9:1}}},this.days.map(((o,h)=>{const m=this.getDayOfWeek(o),g=this.getDayNumber(o),f=this.isSameDay(o,this.props.selectedDate)?"active":"inactive";return r.createElement(B,{key:`day-${h}`,activeBackgroundColor:e,activeColor:t,activeHoverBackgroundColor:n,activeHoverColor:a,dayLabel:m,dayNumber:g,disabledBackgroundColor:i,disabledColor:s,inactiveBackgroundColor:l,inactiveColor:c,inactiveHoverBackgroundColor:d,inactiveHoverColor:u,dayMarkerStyle:p,type:f,onClick:()=>this.onChange(o)})}))))},(0,o.A)(t,[{key:"minDate",get:function(){return new Date(new Date(this.props.minDateRendered).setHours(0,0,0,0))}},{key:"maxDate",get:function(){return new Date(new Date(this.props.maxDateRendered).setHours(0,0,0,0))}},{key:"language",get:function(){return this.props.language?this.props.language:"en-US"}},{key:"days",get:function(){const e=this.maxDate.getTime()/864e5-this.minDate.getTime()/864e5+1;return Array.from({length:e}).map(((e,t)=>{const n=new Date(this.minDate);return new Date(n.setDate(n.getDate()+t))}))}}])}(r.Component);A.defaultProps={className:"",minDateRendered:new Date,maxDateRendered:new Date((new Date).setDate((new Date).getDate()+365)),language:"en-US",groupScroll:!1,onDateChange:()=>null};var H=n(2963),O=n(10310);let F=function(e){function t(){for(var t,n,a,i,o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return(i=e.call.apply(e,[this].concat(s))||this).state={search:"",date:void 0,filters:i.getFilters(),items:i.getItems(),updateDateQueryString:!1},i.moduleData={title:(0,h.b)(i.props.data.item.translations,i.props.data.selectedLanguage,"title"),subtitle:(0,h.b)(i.props.data.item.translations,i.props.data.selectedLanguage,"subtitle"),body:(0,h.b)(i.props.data.item.translations,i.props.data.selectedLanguage,"body",!0,!0),type:i.props.data.item.type,source:"",anchor:(0,h.b)(i.props.data.item.translations,i.props.data.selectedLanguage,"anchor"),name:i.props.data.item.name,paddings:{bottom:i.props.data.item.padding_bottom,top:i.props.data.item.padding_top},hasSearch:i.props.data.item.show_search,hasFilters:i.props.data.item.show_tag_filters},i.colors={background:null===(t=i.props.data.item.background_color)||void 0===t?void 0:t.value,title:null===(n=i.props.data.item.title_color)||void 0===n?void 0:n.value,body:null===(a=i.props.data.item.body_color)||void 0===a?void 0:a.value},i.slideRef=r.createRef(),i}(0,s.A)(t,e);var n=t.prototype;return n.getItems=function(){const{item:e,entries:t=[],suppliers:n=[],defaultLanguage:r,selectedLanguage:a}=this.props.data,{source:i,order_by:o}=e,s=[];"entries"!==i&&"entries-and-suppliers"!==i||t.forEach((e=>s.push(function(e,t,n){const{opening_hours:r=[],position:a,date:i}=e,{color:o,id:s,icon_type:l,icon:c,material_icon:d,text_color:u}=e.entry_type,p="custom"===l?null==c?void 0:c.imageFile:d,m=[];return r.map((async e=>{const{openingHoursItem_id:t}=e;m.push(t)})),{id:e.id,filter:s,type:"entry",title:(0,h.b)(e.translations,t,"title"),description:(0,h.b)(e.translations,t,"description"),color:null==o?void 0:o.value,text_color:null==u?void 0:u.value,icon:p,icon_type:l,opening_hours:m,link:f(e,t,n),position:a,date:i}}(e,a,r)))),"suppliers"!==i&&"entries-and-suppliers"!==i||n.forEac
1h((e=>{const t=function(e,t){const{translations:n,supplier_category:r,opening_hours:a=[],position:i}=e;if(!r)return;const{color:o,custom_icon:s,icon_type:l,material_icon:c,id:d,text_color:u}=r,p="custom"===l?null==s?void 0:s.imageFile:c,m=[];return a.map((async e=>{const{openingHoursItem_id:t}=e;m.push(t)})),{id:e.uuid,filter:d,type:"supplier",title:(0,h.b)(n,t,"name"),description:(0,h.b)(n,t,"description",!0,!0),color:null==o?void 0:o.value,text_color:null==u?void 0:u.value,icon:p,icon_type:l,opening_hours:m,link:null,position:i,date:new Date}}(e,a);t&&s.push(t)}));const l=function(e,t,n,r){const a=(0,g._h)(t,void 0,r);return function(t,n){var r,i;const o=(null===(r=e.find((e=>e.id==t.filter)))||void 0===r?void 0:r.position)||0,s=(null===(i=e.find((e=>e.id==n.filter)))||void 0===i?void 0:i.position)||0;return o===s?a(t,n):o-s}}(this.getFilters(),o,0,a);return s.sort(l)},n.getFilters=function(){const{item:e,selectedLanguage:t}=this.props.data,{source:n,displayed_entries_types:r,displayed_entries_types_and_supplier_categories:a,displayed_supplier_categories:i}=e,o=[];return"entries"===n&&r.forEach((e=>o.push(y(e.entry_types_id,t,e.position)))),"suppliers"===n&&i.forEach((e=>v(e.supplier_category_id,t,e.position))),"entries-and-suppliers"===n&&a.forEach((e=>{"entry_types"===e.collection&&o.push(y(e.item,t,e.position)),"supplier_category"===e.collection&&o.push(v(e.item,t,e.position))})),o},n.normalizeDate=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t},n.dateFromISODateString=function(e){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),0,0,0,0):new Date(e)},n.getDateKey=function(e){const t=e instanceof Date?e:this.dateFromISODateString(e);return(0,T.Cn)(this.normalizeDate(t))},n.openingHourWeekdayKey=function(e){return["open_sunday","open_monday","open_tuesday","open_wednesday","open_thursday","open_friday","open_saturday"][e.getDay()]},n.isDateWithinOpeningHour=function(e,t){const n=this.normalizeDate(t).getTime(),r=this.normalizeDate(this.dateFromISODateString(String(e.start_date))).getTime(),a=this.normalizeDate(this.dateFromISODateString(String(e.end_date))).getTime();return n>=r&&n<=a},n.isDateAvailableInOpeningHour=function(e,t){if(!this.isDateWithinOpeningHour(e,t))return!1;if("closed"===e.status)return!1;if(!Boolean(e.open_monday||e.open_tuesday||e.open_wednesday||e.open_thursday||e.open_friday||e.open_saturday||e.open_sunday))return!0;const n=this.openingHourWeekdayKey(t);return Boolean(e[n])},n.isItemAvailableOnDate=function(e,t){var n;return null!==(n=e.opening_hours)&&void 0!==n&&n.length?e.opening_hours.some((e=>this.isDateAvailableInOpeningHour(e,t))):!!e.date&&this.getDateKey(e.date)===this.getDateKey(t)},n.getIndicatorColors=function(e){const t=[];return this.indicatorItems.forEach((n=>{if(!this.isItemAvailableOnDate(n,e))return;const r=n.color||this.colorByFilter.get(n.filter);r&&!t.includes(r)&&t.push(r)})),t},n.isPastDate=function(e){return this.normalizeDate(e).getTime()<this.fallbackToday.getTime()},n.isUnavailableDate=function(e){return 0===this.getIndicatorColors(e).length},n.isCalendarDayBlocked=function(e){return!(!this.isPastDate(e)||this.allowPastDays)||this.isUnavailableDate(e)},n.canUseDate=function(e){return!(this.isPastDate(e)&&!this.allowPastDays)},n.findNearestEventDate=function(e){if(!this.state.date)return null;const t="next"===e?1:-1,n=this.normalizeDate(this.minimumDate()),r=this.normalizeDate(this.maximumDate()),a=this.normalizeDate(this.state.date),i=new Date(a);for(i.setDate(i.getDate()+t);i.getTime()>=n.getTime()&&i.getTime()<=r.getTime();){const e=this.normalizeDate(i);if(this.canUseDate(e)&&!this.isUnavailableDate(e))return e;i.setDate(i.getDate()+t)}return null},n.setSelectedDate=function(e){var t;this.setState({date:e,updateDateQueryString:!0}),"stripe"===this.props.data.item.type&&(null===(t=this.slideRef.current)||void 0===t||t.slideTo(e))},n.goToNearestEventDate=function(e){const t=this.findNearestEventDate(e);t&&this.setSelectedDate(t)},n.renderDateNavigation=function(){const e=this.findNearestEventDate("previous"),t=this.findNearestEventDate("next"),n=this.colors.title;return r.createElement("div",{className:"w-full pt-3 flex items-stretch sm:items-center justify-between gap-2 sm:gap-4"},r.createElement(k.A,{useButton:!0,type:"soft",text:"The day before",before:r.createElement(c.A,{icon:"ArrowLeft",className:"w-4 h-4 min-w-[16px] min-h-[16px] mr-2"}),icon:r.createElement(r.Fragment,null),color:n,className:"w-full sm:w-auto !justify-start",onClick:()=>this.goToNearestEventDate("previous"),disabled:!e}),r.createElement(k.A,{useButton:!0,type:"soft",text:"The next day",after:r.createElement(c.A,{icon:"ArrowRight",className:"w-4 h-4 min-w-[16px] min-h-[16px] ml-2"}),icon:r.createElement(r.Fragment,null),color:n,className:"w-full sm:w-auto !justify-end",onClick:()=>this.goToNearestEventDate("next"),disabled:!t}))},n.calendarDayClassName=function(e){const t=[],n=this.isPastDate(e),r=this.isUnavailableDate(e);return n&&!this.allowPastDays?t.push("calendar-day-past"):r&&t.push("calendar-day-unavailable"),this.showStatusIndicators&&this.getIndicatorColors(e).length>0&&t.push("calendar-day-with-indicators"),t.join(" ")},n.renderCalendarDayContents=function(e,t){const n=this.getIndicatorColors(t),a=this.showStatusIndicators&&n.length>0,i=n.length>=5,o=n.slice(0,3),s=Math.max(n.length-3,0);return r.createElement("div",{className:"calendar-day-content"},r.createElement("span",{className:"calendar-day-number"},e),a?i?r.createElement("span",{className:"calendar-day-overflow-indicator"},o.map(((e,n)=>r.createElement("span",{key:`calendar-overflow-dot-${this.getDateKey(t)}-${n}`,className:"calendar-day-indicator",style:{backgroundColor:e}}))),r.createElement("span",{className:"calendar-day-overflow-count"},"+",s)):r.createElement("span",{className:"calendar-day-indicators"},n.slice(0,4).map(((e,n)=>r.createElement("span",{key:`calendar-dot-${this.getDateKey(t)}-${n}`,className:"calendar-day-indicator",style:{backgroundColor:e}})))):null)},n.minimumDate=function(){const e=new Date;let t=E.A.fromJSDate(e).startOf("day").toJSDate();return this.allowPastDays&&(t=E.A.fromJSDate(e).startOf("day").minus({year:1}).startOf("day").toJSDate()),t},n.maximumDate=function(){const e=new Date;return E.A.fromJSDate(e).startOf("day").plus({year:2}).startOf("day").toJSDate()},n.searchChange=function(e){this.setState({search:e})},n.renderSearch=function(){if(!this.moduleData.hasSearch)return null;const{item:e,selectedLanguage:t}=this.props.data,{translations:n}=e,a=(0,h.b)(n,t,"add_filter_placeholder");return r.createElement(b.IW,{value:this.state.search,onChange:e=>this.searchChange(e),language:t,placeholder:a})},n.toggleFilter=function(e){const t=JSON.parse(JSON.stringify(this.state.filters)),n=t.find((t=>t.id===e.id));n&&(n.active=!n.active,t.every((e=>e.active))&&t.forEach((e=>e.active=!1)),this.setState({filters:t}))},n.renderFilters=function(){if(!this.moduleData.hasFilters)return null;if(!this.state.filters.length)return null;const e=this.state.filters.some((e=>e.active));return r.createElement("div",{className:"flex gap-2 flex-wrap justify-center "+(this.isGrid?"lg:justify-start":"")},this.state.filters.map(((t,n)=>{const a={...t};return e||(a.active=!0),r.createElement(D,{key:`filter${n}`,filter:a,onClick:()=>this.toggleFilter(t)})})))},n.queryStringFilters=function(e){const t=(0,N.$Z)(),{search:n="",types:r="",date:a=""}=t,i=!!a,o=r.split(","),s=e.map((e=>{const t={...e};return o.find((t=>
1t.toLowerCase()===e.label.replaceAll(" ","").toLowerCase()))&&(t.active=!0),t})),l=s.every((e=>e.active));let c=this.initialDate;if(a){const e=this.normalizeDate(this.dateFromISODateString(a));!Number.isNaN(e.getTime())&&e.getTime()>=this.minimumDate().getTime()&&(c=e)}return{search:decodeURIComponent(n),date:c,filters:l?e:s,updateDateQueryString:i}},n.renderCalendarItems=function(e,t){return void 0===t&&(t=0),r.createElement("div",{className:this.suppliersWrapperClassname,key:`group-${t}`},e.map(((e,t)=>{let{title:n,description:a,icon_type:i,opening_hours:o,color:s,icon:l,link:c,text_color:d}=e;return r.createElement(p,{mode:this.mode,language:this.props.data.selectedLanguage,key:`item-cell-${t}`,color:s,textColor:d,openingHours:o,name:n,description:a,selectedDay:this.state.date,iconType:i,icon:l,link:c})})))},n.renderSupplierList=function(){if(0===this.filteredItems.length)return r.createElement("div",{className:"generalText col-span-full flex justify-center lg:justify-start"},"There's no result with your search.");if(this.cluster){const e=this.filteredItemsPerFilter;return r.createElement("div",{className:`flex flex-col gap-4 w-full ${this.itemsAlignment} pt-4`},e.map(((e,t)=>{let{items:n}=e;return this.renderCalendarItems(n,t)})))}return this.renderCalendarItems(this.filteredItems)},n.renderSelectedDate=function(){try{const e=Intl.DateTimeFormat(this.props.data.selectedLanguage,{weekday:"long",day:"2-digit",month:"long",year:"numeric"}).format(this.state.date);return r.createElement("div",{className:"generalText2Bold",style:this.colors.title?{color:this.colors.title}:void 0},e)}catch(e){return console.error("Error formatting date:",e),null}},n.renderStripeCalendar=function(){var e;return r.createElement("div",{className:"flex items-center flex-col gap-2 w-full justify-center"},r.createElement("div",{id:`${this.props.data.id}-calendar`,className:"flex justify-between w-full max-w-[328px] sm:max-w-[600px] lg:max-w-[848px]"},r.createElement("span",{className:"invisible"}),this.renderSelectedDate(),r.createElement("button",{onClick:()=>{var e;this.setState({date:new Date}),null===(e=this.slideRef.current)||void 0===e||e.slideTo(new Date)}},r.createElement(c.A,{icon:"Calendar",className:"w-6 h-6"}))),this.context.ready?r.createElement(A,{ref:this.slideRef,language:this.props.data.selectedLanguage,groupScroll:!1,id:`${this.props.data.item.id}`,activeBackgroundColor:this.selectedDayBgColor,activeHoverTextColor:this.selectedDayColor,activeHoverBackgroundColor:this.hoverDayBgColor,inactiveHoverTextColor:this.hoverDayColor,inactiveHoverBackgroundColor:this.hoverDayBgColor,dayMarkerStyle:null===(e=this.props.data.item)||void 0===e?void 0:e.marker_style,maxDateRendered:this.maximumDate(),minDateRendered:this.minimumDate(),selectedDate:this.state.date,onDateChange:e=>this.onDateChange(e)}):r.createElement("div",{className:"w-full h-[80px] rounded"}))},n.renderDatePicker=function(){const{type:e}=this.props.data.item;return this.context.ready?"stripe"===e?this.renderStripeCalendar():r.createElement(x.N5,{inline:!0,isRange:!1,value:this.state.date,startDate:this.state.date,openToDate:this.state.date,onChange:e=>this.onDateChange(e),includeDateIntervals:[{start:this.minimumDate(),end:this.maximumDate()}],isDayBlocked:e=>!this.isCalendarDayBlocked(e),customDayClassName:e=>this.calendarDayClassName(e),renderDayContents:(e,t)=>this.renderCalendarDayContents(e,t),cursorPosition:this.cursorPosition,hoverDayBgColor:this.hoverDayBgColor,hoverDayColor:this.hoverDayColor,selectedDayBgColor:this.selectedDayBgColor,selectedDayColor:this.selectedDayColor,calendarChevronColor:this.colors.title,calendarHeaderColor:this.colors.title,markerStyle:this.markerStyle,keyboardDisabled:!0,lineBetweenDays:this.lineBetweenDays,daySize:"40px",dayMargin:"1.5px",dayOfWeekMargin:"0px",monthMargin:"0px",removeBorder:!0,removeClearSelection:!0}
1):r.createElement("div",{className:"w-full bg-slate-50 h-[345px] rounded"})},n.onDateChange=function(e){this.setState({date:e,updateDateQueryString:!0})},n.scrollToCalendar=function(){var e,t,n;if(!(0,O.t)())return;const r=this.isGrid?"list":"calendar",a=null===(e=document.getElementById(`${this.props.data.id}-${r}`))||void 0===e?void 0:e.getBoundingClientRect(),i=(null===(t=document.getElementById("toolbar"))||void 0===t?void 0:t.getBoundingClientRect().height)||0,o=(null===(n=document.getElementById("topbar"))||void 0===n?void 0:n.getBoundingClientRect().height)||0;if(a){const e=a.top-i-o+window.scrollY-16;(0,H.VG)({behavior:"smooth",top:e})}},n.componentDidMount=function(){const{date:e,filters:t,search:n,updateDateQueryString:a}=this.queryStringFilters(this.state.filters);(e||t||n)&&r.startTransition((()=>this.setState({date:e,filters:t,search:n,updateDateQueryString:a})))},n.componentDidUpdate=function(e,t,n){if(!(0,O.t)())return;const r=JSON.parse(JSON.stringify(t,null,2)),a=new URL(window.location.href),i=a.searchParams;this.state.updateDateQueryString&&this.state.date!==r.date&&(this.scrollToCalendar(),i.set("date",(0,T.Cn)(new Date(this.state.date||new Date))),this.setState({updateDateQueryString:!1})),this.state.filters.filter((e=>e.active)).length!==r.filters.filter((e=>e.active)).length&&i.set("types",this.queryParamsTypes),this.state.search!==r.search&&i.set("search",encodeURIComponent(this.state.search)),window.history.replaceState(null,"",a)},n.render=function(){return r.createElement(w.A,{backgroundColor:this.colors.background},r.createElement(_.O,{backgroundColor:void 0,anchor:this.moduleData.anchor,
1name:this.moduleData.name,paddings:this.moduleData.paddings,roundedCorners:!1,className:`max-w-7xl mx-auto flex flex-col gap-2 ${this.wrapperAlignment} ${this.innerPaddings}`},r.createElement(C.D,{title:this.moduleData.title,subtitle:this.moduleData.subtitle,description:this.moduleData.body,color_title:this.colors.title,color_description:this.colors.body,alignment:this.headerAlignment,remove_margin:!0}),r.createElement("div",{className:`flex flex-col gap-2 ${this.alignment} w-full`},r.createElement("div",{className:"flex flex-col gap-8 items-center lg:items-start w-full "+(this.isGrid?"lg:max-w-[302px]":"lg:items-center")},this.renderDatePicker(),this.renderSearch(),this.renderFilters()),r.createElement("div",{className:"w-full flex flex-col gap-6",id:`${this.props.data.id}-list`},this.renderDateNavigation(),this.renderSupplierList()))))},(0,o.A)(t,[{key:"innerPaddings",get:function(){return"px-4 sm:px-6 lg:px-10 xl:px-0"}},{key:"isGrid",get:function(){return"grid"===this.moduleData.type}},{key:"alignment",get:function(){return this.isGrid?"lg:flex-row justify-center":"items-center"}},{key:"headerAlignment",get:function(){const{alignment:e}=this.props.data.item;return"center"===e?"text-center":"left"===e?"text-left":"text-right"}},{key:"wrapperAlignment",get:function(){return this.isGrid?"":"justify-center items-center"}},{key:"allowPastDays",get:function(){const{allow_select_past_days:e}=this.props.data.item;return e}},{key:"cursorPosition",get:function(){return this.props.data.item.cursors_positions}},{key:"selectedDayBgColor",get:function(){var e;return null===(e=this.props.data.item.active_day_background_color)||void 0===e?void 0:e.value}},{key:"selectedDayColor",get:function(){var e;return null===(e=this.props.data.item.active_day_text_color)||void 0===e?void 0:e.value}},{key:"hoverDayBgColor",get:function(){var e;return null===(e=this.props.data.item.hover_day_background_color)||void 0===e?void 0:e.value}},{key:"hoverDayColor",get:function(){var e;return null===(e=this.props.data.item.hover_day_text_color)||void 0===e?void 0:e.value}},{key:"markerStyle",get:function(){const{marker_style:e}=this.props.data.item;return"rounded"===e?"8px":"full_rounded"===e?"9999px":"0px"}},{key:"lineBetweenDays",get:function(){return this.props.data.item.display_line_between_days?"1px solid #DBDBDD":""}},{key:"queryParamsTypes",get:function(){return this.state.filters.filter((e=>e.active)).map((e=>e.label.toLowerCase().replaceAll(" ",""))).join(",")}},{key:"mode",get:function(){return this.props.data.item.mode}},{key:"itemsAlignment",get:function(){const{alignment:e}=this.props.data.item;return"center"===e?"justify-center":"right"===e?"justify-end":"justify-start"}},{key:"cluster",get:function(){return this.props.data.item.cluster}},{key:"showStatusIndicators",get:function(){var e;return null===(e=this.props.data.item.show_status_indicators)||void 0===e||e}},{key:"fallbackToday",get:function(){return this.normalizeDate(new Date)}},{key:"defaultCalendarDate",get:function(){const e=this.props.data.item.default_calendar_date;if(!e)return;const t=this.dateFromISODateString(e);if(Number.isNaN(t.getTime()))return;const n=this.normalizeDate(t);return n.getTime()<this.fallbackToday.getTime()?this.fallbackToday:n}},{key:"initialDate",get:function(){return this.defaultCalendarDate||this.fallbackToday}},{key:"activeFilterIds",get:function(){const e=this.state.filters.filter((e=>e.active));return 0===e.length?new Set(this.state.filters.map((e=>e.id))):new Set(e.map((e=>e.id)))}},{key:"indicatorItems",get:function(){const e=this.activeFilterIds;return this.state.items.filter((t=>e.has(t.filter)))}},{key:"colorByFilter",get:function(){return new Map(this.state.filters.map((e=>[e.id,e.color])).filter((e=>{let[,t]=e;return Boolean(t)})))}},{key:"filteredItems",get:function(){const e=this.state.filters.filter((e=>e.active)),t=0===e.length,n=this.state.search;if(t&&!n)return this.state.items;if(e.length===this.state.filters.length&&!n)return this.state.items;const r=[];for(const a of this.state.items){const i=!!t||e.find((e=>e.id===a.filter)),o=!n||a.title.toLowerCase().includes(this.state.search.toLowerCase());i&&o&&r.push(a)}return r}},{key:"suppliersWrapperClassname",get:function(){return this.isGrid?"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4 h-fit w-full":`flex ${this.itemsAlignment} flex-wrap gap-4 h-fit w-full`}},{key:"filteredItemsPerFilter",get:function(){const e=[],t=this.getFilters();for(const n of this.filteredItems){const r=e.find((e=>e.id===n.filter)),a=t.find((e=>e.id===n.filter));r?r.items.push(n):e.push({id:n.filter,items:[n],position:(null==a?void 0:a.position)||99})}return e.sort(((e,t)=>e.position-t.position))}}])}(r.Component);F.contextType=S.gD;var R=e=>{const{sliceContext:t}=e;return r.createElement(r.Fragment,null,r.createElement(i.A,{fallback:null},r.createElement(F,{data:{id:t.id,defaultLanguage:a.defaultLanguage,selectedLanguage:t.language,item:t.item,
1suppliers:t.suppliers,entries:t.entries}})))}},74310:function(e,t,n){n.d(t,{N5:function(){return r}});const r=n(96540).lazy((()=>Promise.all([n.e(1869),n.e(1460),n.e(2096),n.e(1815)]).then(n.bind(n,12076))))},96190:function(e,t,n){n.d(t,{D:function(){return o}});var r=n(92901),a=n(77387),i=n(96540);let o=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).displayName="ModuleHeadV2",t}return(0,a.A)(t,e),t.prototype.render=function(){return this.title||this.subtitle||this.description?i.createElement("div",{className:`module-head ${this.alignment} ${this.margin} ${this.props.remove_margin?"":"mb-6 sm:mb-8"} ${this.props.className}`},this.subtitle,this.title,this.description):null},(0,r.A)(t,[{key:"margin",get:function(){let e="";return"text-right"===this.props.alignment&&(e="m-auto mr-0"),"text-center"===this.props.alignment&&(e="m-auto"),e}},{key:"alignment",get:function(){return"text-center"===this.props.alignment&&this.props.align_lists?`${this.props.alignment} [&_ul]:flex [&_ul]:items-center [&_ul]:flex-col [&_ol]:flex [&_ol]:items-center [&_ol]:flex-col`:"text-right"===this.props.alignment&&this.props.align_lists?`${this.props.alignment} [&_ul]:flex [&_ul]:items-end [&_ul]:flex-col [&_ol]:flex [&_ol]:items-end [&_ol]:flex-col`:this.props.alignment}},{key:"subtitle",get:function(){return this.props.subtitle&&""!==this.props.subtitle?i.createElement("div",{className:"tracking-wide highlighted mb-1",style:{color:this.props.color_subtitle}},this.props.subtitle):null}},{key:"title",get:function(){if(this.props.title&&""!==this.props.title){let e="headline3";return this.props.is_hero&&(e="headline1"),i.createElement("h2",{className:`tracking-tight  mb-2 ${e}`,style:{color:this.props.color_title}},this.props.title)}return null}},{key:"description",get:function(){return this.props.description&&""!==this.props.description?i.createElement("div",{className:"generalText2",style:{color:this.props.color_description}},this.props.description):null}}])}(i.Component);o.defaultProps={alignment:"text-left",color_title:"#333",color_subtitle:"#333",color_description:"#333",align_lists:!1,remove_margin:!1,className:""}},17031:function(e,t,n){n.d(t,{IW:function(){return o}});var r=n(77387),a=n(96540);var i={en:{search:"Search",found:"Found",results:"results"},de:{search:"Suche",found:"Gefunden",results:"Ergebnisse"},fr:{search:"Recherche",found:"Trouvé",results:"résultats"},it:{search:"Ricerca",found:"Trovato",results:"risultati"},es:{search:"Buscar",found:"Encontrados",results:"resultados"}};let o=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.A)(t,e),t.prototype.render=function(){const e=(this.props.language||"en").split("-")[0],t=i[e]||i.en,n=this.props.placeholder||t.search+"...";return a.createElement("form",{className:"w-full max-w-md"},a.createElement("label",{htmlFor:this.props.id,className:"mb-2 text-gray-900 sr-only"},t.search),a.createElement("div",{className:"relative"},a.createElement("div",{className:"absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none"},a.createElement("svg",{className:"w-4 h-4 text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},a.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"}))),a.createElement("input",{type:"search",id:this.props.id,className:"block w-full h-[44px] p-2 ps-10 generalText text-gray-900 border border-[color:#D1D5DB] rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500",placeholder:n,value:this.props.value,onChange:e=>this.props.onChange(e.target.value),required:!0})))},t}(a.Component);a.Component},36146:function(e,t,n){n.d(t,{_h:function(){return d}});var r=n(3562);function a(e,t){const n=new Date(e.date).getTime(),r=new Date(t.date).getTime();return n>r?-1:n<r?1:0}function i(e,t){const n=new Date(e.date_created).getTime(),r=new Date(t.date_created).getTime();return n>r?-1:n<r?1:0}function o(e,t){const n=new Date(e.date_updated).getTime(),r=new Date(t.date_updated).getTime();return n>r?-1:n<r?1:0}function s(e,t){const n=e.position||99999999,r=t.position||99999999;return n>r?-1:n<r?1:0}function l(e){return function(t,n){if(!t.translations&&t.title)return t.title.localeCompare(n.title);const a=(0,r.b)(t.translations,e,"list_title"),i=(0,r.b)(n.translations,e,"list_title");if(a&&i)return a.localeCompare(i);const o=(0,r.b)(t.translations,e,"title")||"",s=(0,r.b)(n.translations,e,"title")||"";return o.localeCompare(s)}}function c(e){return function(t,n){return e(n,t)}}function d(e,t,n){void 0===e&&(e="date-desc");const r=t||(-1!==e.indexOf("-desc")?"DESC":"ASC"),d=e.replace("-desc","").replace("-asc","");return"date"===d&&"ASC"===r?c(a):"date"===d&&"DESC"===r?a:"date_created"===d&&"ASC"===r?c(i):"date_created"===d&&"DESC"===r?i:"date_updated"===d&&"ASC"===r?c(o):"date_updated"===d&&"DESC"===r?o:"position"===d&&"ASC"===r?c(s):"position"===d&&"DESC"===r?s:"title"===d&&"ASC"===r?l(n):"title"===d&&"DESC"===r?c(l(n)):a}}}]);
2//# sourceMappingURL=slice---src-slices-modules-calendar-index-tsx-7c15ac360cda58c1be81.js.map

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.