1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3338],{13338:function(e,t,a){a.r(t),a.d(t,{default:function(){return PromosBlock}});var l=a(85893),i=a(67294),s=a(5121),r=a(25675),d=a.n(r),n=a(41664),o=a.n(n);function PromosBlock(e){let{block:t}=e,[a,r]=(0,i.useState)([]),[n,c]=(0,i.useState)(!0),{category:x,title:m}=t.main;return(0,i.useEffect)(()=>{let getOffers=async()=>{c(!0);try{let e=await s.Z.get("https://discoveryhospitality.haspcms.net"+"/api/contents/offers/entries?page[size]=3&includes=blueprintData,mediaHandler&filter[taxonomies][offers-category]=".concat(x.id));r(e.data.data),200===e.status&&c(!1)}catch(e){c(!1)}};getOffers()},[x.id]),(0,l.jsx)("section",{className:"bg-[#F1F1F1] py-[20px]",children:(0,l.jsxs)("div",{className:"container",children:[(0,l.jsx)("h2",{className:"text-center uppercase text-[25px] text-primary mb-[20px]",children:m}),n?(0,l.jsx)(l.Fragment,{children:Array.from({length:2},(e,t)=>(0,l.jsxs)("div",{className:"mb-[30px] flex flex-wrap",children:[(0,l.jsx)("div",{className:"h-[300px] md:max-w-[50%] w-full bg-gray-300 animate-pulse "}),(0,l.jsxs)("div",{className:"bg-white p-[30px] md:max-w-[60%] w-full relative",children:[(0,l.jsx)("div",{className:"h-[15px] bg-gray-300 animate-pulse mb-[50px] max-w-[200px]"}),(0,l.jsx)("div",{className:"h-[50px] bg-gray-300 animate-pulse w-full max-w-[calc(200px-30px)] absolute bottom-0 right-0"})]})]},t))}):(0,l.jsx)(l.Fragment,{children:a.length>0?(0,l.jsx)(l.Fragment,{children:a.map((e,t)=>{var a,i,s,r,n,c,m,p,u,v,h,f,b,g;return(0,l.jsxs)("div",{className:"mb-[30px] flex flex-wrap md:flex-nowrap",children:[(0,l.jsx)("div",{className:"w-full md:max-w-[50%]",children:(0,l.jsx)(o(),{href:"/offers?category=".concat(x.id),children:(0,l.jsx)(d(),{src:null==e?void 0:null===(s=e.attributes)||void 0===s?void 0:null===(i=s.data)||void 0===i?void 0:null===(a=i.main)||void 0===a?void 0:a.featured_image,width:400,height:200,className:"h-full object-cover w-full bg-[#f5f5f5]",alt:null==e?void 0:null===(r=e.attributes)||void 0===r?void 0:r.title})})}),(0,l.jsxs)("div",{className:"bg-white pt-[30px] px-[30px] pb-[60px] relative md:max-w-[60%] w-full",children:[(0,l.jsx)("h3",{className:"text-[20px] text-primary mb-[10px]",children:null==e?void 0:null===(n=e.attributes)||void 0===n?void 0:n.title}),(null==e?void 0:null===(p=e.attributes)||void 0===p?void 0:null===(m=p.data)||void 0===m?void 0:null===(c=m.main)||void 0===c?void 0:c.description)&&(0,l.jsx)("div",{className:"text-[14px] mb-[30px]",dangerouslySetInnerHTML:{__html:null==e?void 0:null===(b=e.attributes)||void 0===b?void 0:null===(f=b.data)||void 0===f?void 0:null===(h=f.main)||void 0===h?void 0:null===(v=h.description)||void 0===v?void 0:null===(u=v.match(/<p>(.*?)<\/p>/))||void 0===u?void 0:u[1]}}),(0,l.jsx)(o(),{href:null==e?void 0:null===(g=e.attributes)||void 0===g?void 0:g.route_url,className:"text-white bg-primary hover:bg-secondary3 px-[30px] py-[15px] w-full text-center md:max-w-[200px] absolute bottom-0 right-0 text-[14px]",children:"View Offer"})]})]},t)})}):(0,l.jsx)(l.Fragment,{children:"No offers to show"})}),(0,l.jsx)("div",{className:"text-center mt-[30px]",children:(0,l.jsx)(o(),{href:"/offers?category=".concat(x.id),className:"inline-block uppercase border border-primary text-primary md:text-white md:bg-primary hover:bg-secondary3 px-[30px] py-[15px]",children:"View All ".concat(m.toLowerCase().replace("promos","Offers"))})})]})})}}}]);
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.