@everymatrix/blog-articles-grid 1.98.30 → 1.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{p as e,b as t}from"./index-4af8e775.js";export{s as setNonce}from"./index-4af8e775.js";import{g as n}from"./app-globals-0f993ce5.js";(()=>{const t=import.meta.url,n={};return""!==t&&(n.resourcesUrl=new URL(".",t).href),e(n)})().then((async e=>(await n(),t([["blog-articles-grid_2",[[1,"blog-articles-grid",{cmsEndpoint:[513,"cms-endpoint"],language:[513],translationUrl:[513,"translation-url"],userRoles:[513,"user-roles"],cmsEnv:[513,"cms-env"],mbSource:[1,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],showPublishingDate:[516,"show-publishing-date"],showImage:[516,"show-image"],showTitle:[516,"show-title"],showPageTitle:[516,"show-page-title"],showBreadcrumb:[516,"show-breadcrumb"],showContent:[516,"show-content"],showButton:[516,"show-button"],hideError:[516,"hide-error"],usePostmessage:[516,"use-postmessage"],postMessageEvent:[513,"post-message-event"],blogsLimit:[513,"blogs-limit"],paginationActive:[516,"pagination-active"],arrowsActive:[516,"arrows-active"],secondaryArrowsActive:[516,"secondary-arrows-active"],numberedNavActive:[516,"numbered-nav-active"],intlDateTimeFormat:[513,"intl-date-time-format"],page:[513],pageQueryParam:[1,"page-query-param"],eventId:[513,"event-id"],paginationBlogList:[32],currentPage:[32],hasErrors:[32],isLoading:[32],bannerMatrixReady:[32],nextPage:[32],previousPage:[32],device:[32],displayedBlogResponse:[32],paginationBlogResponse:[32],allBlogResponse:[32],totalBlogs:[32],customTranslations:[32]},[[8,"BannerMatrixReady","handleBannerReady"],[0,"hpPageChange","hpPageChange"]],{page:["watchEndpoint"],hasErrors:["watchEndpoint"],cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"],cmsEnv:["watchEndpoint"],userRoles:["watchEndpoint"],blogsLimit:["watchEndpoint"],eventId:["watchEndpoint"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],translationUrl:["loadTranslations"]}],[1,"helper-pagination",{nextPage:[1537,"next-page"],prevPage:[1537,"prev-page"],offset:[1538],limit:[1538],total:[1538],language:[1537],mbSource:[1,"mb-source"],clientStyling:[1537,"client-styling"],clientStylingUrl:[1537,"client-styling-url"],arrowsActive:[1540,"arrows-active"],secondaryArrowsActive:[1540,"secondary-arrows-active"],numberedNavActive:[1540,"numbered-nav-active"],pageQueryParam:[1,"page-query-param"],page:[2],offsetInt:[32],lastPage:[32],previousPage:[32],limitInt:[32],totalInt:[32],pagesArray:[32],endInt:[32]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}]]]],e))));
1
+ import{p as e,b as t}from"./index-4af8e775.js";export{s as setNonce}from"./index-4af8e775.js";import{g as a}from"./app-globals-0f993ce5.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((async e=>(await a(),t([["blog-articles-grid_2",[[1,"blog-articles-grid",{cmsEndpoint:[513,"cms-endpoint"],language:[513],translationUrl:[513,"translation-url"],userRoles:[513,"user-roles"],cmsEnv:[513,"cms-env"],mbSource:[1,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],showPublishingDate:[516,"show-publishing-date"],showBlogSubcategories:[516,"show-blog-subcategories"],showImage:[516,"show-image"],showTitle:[516,"show-title"],showPageTitle:[516,"show-page-title"],showBreadcrumb:[516,"show-breadcrumb"],showContent:[516,"show-content"],showButton:[516,"show-button"],hideError:[516,"hide-error"],usePostmessage:[516,"use-postmessage"],postMessageEvent:[513,"post-message-event"],blogsLimit:[513,"blogs-limit"],paginationActive:[516,"pagination-active"],arrowsActive:[516,"arrows-active"],secondaryArrowsActive:[516,"secondary-arrows-active"],numberedNavActive:[516,"numbered-nav-active"],intlDateTimeFormat:[513,"intl-date-time-format"],page:[513],pageQueryParam:[1,"page-query-param"],eventId:[513,"event-id"],paginationBlogList:[32],currentPage:[32],hasErrors:[32],isLoading:[32],bannerMatrixReady:[32],nextPage:[32],previousPage:[32],device:[32],displayedBlogResponse:[32],paginationBlogResponse:[32],allBlogResponse:[32],totalBlogs:[32],customTranslations:[32],selectedCategory:[32],categories:[32]},[[8,"BannerMatrixReady","handleBannerReady"],[0,"hpPageChange","hpPageChange"]],{page:["watchEndpoint"],hasErrors:["watchEndpoint"],cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"],cmsEnv:["watchEndpoint"],userRoles:["watchEndpoint"],blogsLimit:["watchEndpoint"],eventId:["watchEndpoint"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],translationUrl:["loadTranslations"]}],[1,"helper-pagination",{nextPage:[1537,"next-page"],prevPage:[1537,"prev-page"],offset:[1538],limit:[1538],total:[1538],language:[1537],mbSource:[1,"mb-source"],clientStyling:[1537,"client-styling"],clientStylingUrl:[1537,"client-styling-url"],arrowsActive:[1540,"arrows-active"],secondaryArrowsActive:[1540,"secondary-arrows-active"],numberedNavActive:[1540,"numbered-nav-active"],pageQueryParam:[1,"page-query-param"],page:[2],offsetInt:[32],lastPage:[32],previousPage:[32],limitInt:[32],totalInt:[32],pagesArray:[32],endInt:[32]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}]]]],e))));
@@ -1 +1 @@
1
- import{r as i,c as t,h as n}from"./index-4af8e775.js";const e={en:{error:"Error",readmore:"Read more",home:"Home",blog:"Blog",blogPageTitle:"Blog"},ro:{error:"Eroare",readmore:"Read more",home:"Acasă",blog:"Blog",blogPageTitle:"Blog"},fr:{error:"Error",readmore:"Read more",home:"Accueil",blog:"Blog",blogPageTitle:"Blog"},ar:{error:"خطأ",readmore:"Read more",home:"الرئيسية",blog:"المدونة",blogPageTitle:"المدونة"},hu:{error:"خطأ",readmore:"Tovább olvasom",home:"Kezdőlap",blog:"Blog",blogPageTitle:"Blog"},hr:{error:"Greška",readmore:"Pročitaj više",home:"Početna",blog:"Blog",blogPageTitle:"Blog"},"pt-br":{error:"Erro",readmore:"Ler mais",home:"Início",blog:"Blog",blogPageTitle:"Blog"},"es-mx":{error:"Error",readmore:"Leer más",home:"Inicio",blog:"Blog",blogPageTitle:"Blog"}},s=(i,t,n)=>{var s;const o=null!=t?t:"en",a=null===(s=null==n?void 0:n[o])||void 0===s?void 0:s[i];return"string"==typeof a?a:e[o in e?o:"en"][i]},o="__WIDGET_GLOBAL_STYLE_CACHE__";function a(i,t){if(i){const n=document.createElement("style");n.innerHTML=t,i.appendChild(n)}}function r(i,t){if(!i||!t)return;const n=new URL(t);fetch(n.href).then((i=>i.text())).then((t=>{const n=document.createElement("style");n.innerHTML=t,i&&i.appendChild(n)})).catch((i=>{console.error("There was an error while trying to load client styling from URL",i)}))}function h(i,t,n,e=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!e)return n=function(i,t){const n=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{i&&(n.innerHTML=t,i.appendChild(n))}))}(i,t),n;window[o]||(window[o]={}),n=function(i,t){return window.emMessageBus.subscribe(t,(n=>{if(!i)return;const e=i.getRootNode(),s=window[o];let a=s[t]&&s[t].sheet;a?s[t].refCount=s[t].refCount+1:(a=new CSSStyleSheet,a.replaceSync(n),s[t]={sheet:a,refCount:1});const r=e.adoptedStyleSheets||[];r.includes(a)||(e.adoptedStyleSheets=[...r,a])}))}(i,t);const s=n.unsubscribe.bind(n);return n.unsubscribe=()=>{if(window[o][t]){const i=window[o][t];i.refCount>1?i.refCount=i.refCount-1:delete window[o][t]}s()},n}function l(i){return i.includes("android")}const d=class{constructor(e){i(this,e),this.articleActionButton=t(this,"articleActionButton",7),this.lastPage=1,this.isInitialized=!1,this.paginationDefaultStyling="\n nav#PaginationContainer {\n justify-content: right;\n }\n .LeftItems a .NavigationButton {\n display: none;\n }\n .LeftItems a:after, .RightItems a:after {\n padding: 7px 12px;\n font-size: 18px;\n font-weight: 700;\n line-height: 46px;\n }\n .LeftItems a:after {\n content: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1.2em' viewBox='0 0 320 512'%3E%3C!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --%3E%3Cpath d='M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z'/%3E%3C/svg%3E\");\n }\n .RightItems a:after {\n content: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1.2em' viewBox='0 0 320 512'%3E%3C!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --%3E%3Cpath d='M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z'/%3E%3C/svg%3E\");\n display: block;\n height: 38px;\n }\n div.LeftItems a, div.RightItems a {\n width: unset;\n height: 40px;\n background-color: #fff;\n color: #000;\n border: 1px solid #000;\n overflow: hidden;\n &[aria-disabled=\"true\"] {\n background-color: #989898;\n }\n }\n div.LeftItems a {\n min-width: 60px;\n border-radius: 20px 0 0 20px;\n border-right: 0;\n }\n div.RightItems a {\n display: flex;\n min-width: 100px;\n justify-content: space-evenly;\n align-items: center;\n border-radius: 0 20px 20px 0;\n text-transform: none;\n }\n .RightItems a .NavigationButton {\n padding: 12px 0 12px 12px;\n font-weight: 700;\n }",this.renderContentConditionally=i=>i&&(!i.includes("<bannermatrix-banner")||this.bannerMatrixReady)?n("p",{class:"BlogContent",innerHTML:i}):null,this.cmsEndpoint=void 0,this.language="en",this.translationUrl="",this.userRoles="everyone",this.cmsEnv="stage",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.showPublishingDate=!0,this.showImage=!0,this.showTitle=!0,this.showPageTitle=!1,this.showBreadcrumb=!1,this.showContent=!0,this.showButton=!0,this.hideError=!1,this.usePostmessage=void 0,this.postMessageEvent="",this.blogsLimit="0",this.paginationActive=void 0,this.arrowsActive=!0,this.secondaryArrowsActive=!1,this.numberedNavActive=!1,this.intlDateTimeFormat="",this.page="1",this.pageQueryParam=void 0,this.eventId=void 0,this.paginationBlogList={offset:0},this.currentPage=0,this.hasErrors=!1,this.isLoading=!0,this.bannerMatrixReady=!1,this.nextPage="",this.previousPage="",this.device="mobile",this.displayedBlogResponse=void 0,this.paginationBlogResponse=void 0,this.allBlogResponse=void 0,this.totalBlogs=0,this.customTranslations={}}getArticleId(i,t){var n;if(0!==i.button||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;const e={postId:t.postID.toString(),slug:t.slug,customPath:t.customPath};this.usePostmessage?(i.preventDefault(),window.postMessage(Object.assign({type:this.postMessageEvent},e))):null===(n=this.articleActionButton)||void 0===n||n.emit(e)}handleBannerReady(){this.bannerMatrixReady=!0}watchEndpoint(i,t){this.isInitialized&&(this.currentPage=parseInt(this.page)-1,(i||""===i)&&i!=t&&this.cmsEndpoint&&this.language&&this.getBlogArticleGrid())}handleClientStylingChange(i,t){i!==t&&a(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(i,t){i!==t&&this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)}async loadTranslations(){if(this.translationUrl)try{const i=await fetch(this.translationUrl);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);this.customTranslations=await i.json()}catch(i){console.error("Failed to fetch or parse translations from URL:",i)}else this.customTranslations={}}hpPageChange(i){var t,n;this.paginationBlogList=i.detail,this.currentPage=Math.floor((null===(t=this.paginationBlogList)||void 0===t?void 0:t.offset)/(null===(n=this.paginationBlogList)||void 0===n?void 0:n.limit)),this.page&&(this.currentPage=this.currentPage+ +this.page-1),this.currentPage+1>this.lastPage?this.nextPage=null:this.currentPage<0?this.previousPage=null:(window.postMessage({type:"BlogArticlesGridActivePagination",currentPage:this.currentPage},window.location.href),this.getBlogArticleGrid(!0))}sortArticlesByDate(i){return i.sort(((i,t)=>i.publishingDate>t.publishingDate?-1:i.publishingDate<t.publishingDate?1:0)),i}findLatestFeatured(i){let t=i.filter((i=>i.isFeaturedPost));return 0===t.length?null:(t=this.sortArticlesByDate(t),t[0])}moveLatestFeatureToStart(i,t){if(!t)return i;const n=i.indexOf(t);return-1!==n&&(i.splice(n,1),i.unshift(t)),i}async fetchBlogPosts(i,t=!1){const n=new URL(`${this.cmsEndpoint}/${this.language}/blog-posts`);return n.searchParams.append("per_page",t?"300":this.blogsLimit),n.searchParams.append("page",`${i||this.currentPage+1}`),n.searchParams.append("env",this.cmsEnv),n.searchParams.append("userRoles",this.userRoles),n.searchParams.append("device",(()=>{const i=(()=>{let i=window.navigator.userAgent;return i.toLowerCase().match(/android/i)?"Android":i.toLowerCase().match(/iphone/i)?"iPhone":i.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(i){if("PC"===i)return"dk";if("iPad"===i||"iPhone"===i)return"mtWeb"}return"mtWeb"})()),fetch(n.href).then((i=>{if(i.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return i.json()})).then((i=>{let n=i.items;const e=this.findLatestFeatured(n);return n=this.sortArticlesByDate(n),n=this.moveLatestFeatureToStart(n,e),i=Object.assign(Object.assign({},i),{items:n}),t?this.allBlogResponse=i:this.paginationBlogResponse=i,i})).catch((i=>(this.hasErrors=!0,console.log("Error",i),{})))}async getBlogArticleGrid(i=!1,t){var n,e,s,o,a,r,h;this.isLoading=!0;try{let l;if(this.eventId&&this.eventId.length>0){const o=(null===(n=this.allBlogResponse)||void 0===n?void 0:n.items)?this.allBlogResponse:await this.fetchBlogPosts(1,!0),a=o.items.filter((({eventIds:i})=>{var t;return i.includes(null!==(t=this.eventId)&&void 0!==t?t:"-")}));a.length?(l=Object.assign(Object.assign({},o),{items:a,total:Math.min(parseInt(this.blogsLimit),a.length)}),window.postMessage({type:"OP:blogReady",payload:{hasBlog:!0}},"*")):(window.postMessage({type:"OP:blogReady",payload:{hasBlog:!1}},"*"),l=(null===(s=null===(e=this.paginationBlogResponse)||void 0===e?void 0:e.items)||void 0===s?void 0:s.length)&&!i?this.paginationBlogResponse:await this.fetchBlogPosts(t))}else l=(null===(a=null===(o=this.paginationBlogResponse)||void 0===o?void 0:o.items)||void 0===a?void 0:a.length)&&!i?this.paginationBlogResponse:await this.fetchBlogPosts(t);this.displayedBlogResponse=l,this.totalBlogs=l.total,this.lastPage=+((null===(h=null===(r=l.pages.last)||void 0===r?void 0:r.match(/&page=(\d+)/))||void 0===h?void 0:h[1])||1),this.nextPage=l.pages.next,this.previousPage=l.pages.previous,this.isLoading=!1,this.hasErrors=!1}catch(i){this.hasErrors=!0,console.log("Error",i)}}componentWillLoad(){return this.cmsEndpoint&&this.language&&this.blogsLimit&&(this.page?(this.currentPage=this.currentPage+ +this.page-1,this.getBlogArticleGrid(!1,+this.page)):this.getBlogArticleGrid()),this.loadTranslations()}handleClientStyling(){void 0===window.emMessageBus?(this.clientStyling&&a(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)):this.stylingSubscription=h(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription,!0)}componentDidLoad(){this.handleClientStyling(),this.isInitialized=!0,window.postMessage({type:"BlogArticlesGridLoaded"},window.location.href),this.device=((i=!1)=>{if("undefined"==typeof window||"undefined"==typeof navigator)return"desktop";const t=navigator.userAgent.toLowerCase(),n=window.innerWidth;if(function(i){return!!i.includes("ipad")||i.includes("macintosh")&&navigator.maxTouchPoints>0}(t))return"tablet";if(function(i){return i.includes("iphone")||i.includes("ipod")}(t))return"mobile";if(function(i,t){return l(i)&&(i.includes("mobile")||i.includes("mobi")||t<=599)}(t,n))return"mobile";if(function(i,t){return l(i)&&!i.includes("mobile")&&!i.includes("mobi")&&t>599}(t,n))return"tablet";if(i){if(n<=599)return"mobile";if(n<=1099)return"tablet"}return"desktop"})()}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}setImage(i){var t,n;return(null===(n=null===(t=i.sources)||void 0===t?void 0:t["mobile"===this.device?0:"tablet"===this.device?1:2])||void 0===n?void 0:n.pictureSource)||i.src}parseDate(i){const t=new Date(i);if(t instanceof Date&&!Number.isNaN(t.getTime()))return t;const[n,e,s]=i.trim().split("/").map(Number);return new Date(s,e-1,n)}formatDate(i){const t=this.parseDate(i);return new Intl.DateTimeFormat(this.intlDateTimeFormat).format(t)}render(){if(this.hasErrors)return n("div",{class:"BlogsContainer"},!this.hideError&&n("div",{class:"ErrorMessage"},s("error",this.language,this.customTranslations)));const i=[];for(let t=0;t<parseInt(this.blogsLimit);t++)i.push(n("div",{class:"GridContainer FeaturedPost Skeleton"},n("div",{class:"GridWrapper"},n("div",{class:"GridSector"},n("div",{class:"VisualContent LoadingImage"})),n("div",{class:"GridSector"},n("div",{class:"BlogTitle LoadingStripe LoadingSmallStripe"}),n("div",{class:"BlogDetails LoadingStripe LoadingMediumStripe"}),n("div",{class:"BlogLink LoadingStripe LoadingLongStripe"})))));const t=Boolean(this.paginationActive)&&this.totalBlogs>+this.blogsLimit,e=this.mbSource?void 0:this.clientStyling||this.paginationDefaultStyling;return n("div",{ref:i=>this.stylingContainer=i},this.showBreadcrumb&&n("nav",{class:"breadcrumb","aria-label":"Breadcrumb"},n("a",{href:`/${encodeURIComponent(this.language)}`},s("home",this.language,this.customTranslations)),n("span",{"aria-hidden":"true"},"›"),n("span",{"aria-current":"page"},s("blog",this.language,this.customTranslations))),this.showPageTitle&&n("h1",{class:"BlogPageTitle"},s("blogPageTitle",this.language,this.customTranslations)),n("div",{class:"BlogPageContainer"},n("div",{class:"BlogGridPaginationWrapper"},t&&n("helper-pagination",{"next-page":this.nextPage,"prev-page":this.previousPage,offset:this.paginationBlogList.offset,limit:parseInt(this.blogsLimit,10),total:this.totalBlogs,language:this.language,"mb-source":this.mbSource,"client-styling":e,"client-styling-url":this.clientStylingUrl,"arrows-active":this.arrowsActive,"secondary-arrows-active":this.secondaryArrowsActive,"numbered-nav-active":this.numberedNavActive,"page-query-param":this.pageQueryParam,page:+this.page||1})),!this.isLoading&&n("div",{class:`GridContainerWrapper BlogPage-${this.currentPage} ${this.device}`},this.displayedBlogResponse&&this.displayedBlogResponse.items.map((i=>{var t,e;return n("div",{key:i.postID,class:i.isFeaturedPost?"GridContainer FeaturedPost":"GridContainer"},n("div",{class:"GridWrapper"},n("div",{class:"GridSector"},this.showPublishingDate&&n("div",{class:"BlogDate"},n("time",{dateTime:i.publishingDate},this.formatDate(i.publishingDate))),this.showImage&&(null===(t=i.image)||void 0===t?void 0:t.src)?n("img",{class:"VisualContent",src:this.setImage(i.image),alt:i.image.alt||i.title,width:"400",height:"225",loading:"lazy"}):(null===(e=i.video)||void 0===e?void 0:e.sources[this.device])?n("video",{class:"VisualContent",src:i.video.sources[this.device]}):n("span",{class:"VisualContent",style:{color:"#fff"}},"No Image")),n("div",{class:"GridSector"},this.showTitle&&n("h2",{class:"BlogTitle"},n("a",{class:"BlogCardLink",href:`/${encodeURIComponent(this.language)}/blog/${encodeURIComponent(i.customPath||i.slug)}`,onClick:t=>this.getArticleId(t,i)},i.title)),this.showContent&&this.renderContentConditionally(i.descriptionPreview),this.showButton&&n("span",{class:"BlogLink"},s("readmore",this.language,this.customTranslations)))))}))),this.isLoading&&n("div",{class:"GridContainerWrapper LoadingGrid"},i)))}static get watchers(){return{page:["watchEndpoint"],hasErrors:["watchEndpoint"],cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"],cmsEnv:["watchEndpoint"],userRoles:["watchEndpoint"],blogsLimit:["watchEndpoint"],eventId:["watchEndpoint"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],translationUrl:["loadTranslations"]}}};d.style=':host {\n display: block;\n}\n\n.breadcrumb {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n max-width: 1300px;\n padding: 0 20px;\n margin: 40px auto 20px;\n color: var(--emw--color-white, #FFFFFF);\n}\n.breadcrumb a {\n color: inherit;\n}\n\n.BlogPageTitle {\n max-width: 1300px;\n padding: 0 20px;\n margin: 0 auto;\n color: var(--emw--color-primary);\n font-size: 22px;\n font-weight: 600;\n line-height: 1.2;\n}\n\n.BlogPageContainer {\n background: #0A0A17;\n padding: 20px;\n}\n\n.GridContainerWrapper {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 20px;\n}\n\n.BlogPage-0 .GridContainer.FeaturedPost:first-child {\n width: 100%;\n flex-basis: auto;\n}\n\n.GridContainer {\n position: relative;\n container-type: inline-size;\n container-name: article;\n border-radius: 15px;\n color: #000;\n overflow: hidden;\n}\n.GridContainer.FeaturedPost:first-child {\n grid-column: 1/-1;\n width: 100%;\n}\n.GridContainer .GridWrapper {\n display: flex;\n flex-direction: row;\n height: 280px;\n background: var(--emw--color-white, #FFFFFF);\n}\n.GridContainer .GridSector {\n flex-basis: 50%;\n position: relative;\n}\n.GridContainer .GridSector:first-of-type {\n height: 280px;\n display: flex;\n}\n.GridContainer .GridSector:last-of-type {\n position: static;\n padding: 20px 40px;\n display: flex;\n flex-direction: column;\n}\n.GridContainer .VisualContent {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n.GridContainer .BlogDate {\n position: absolute;\n bottom: 0px;\n left: 30px;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: var(--emw--color-white, #FFFFFF);\n background-color: #CD0B5E;\n z-index: 1;\n pointer-events: none;\n}\n.GridContainer .BlogTitle {\n margin: 0;\n font-size: 24px;\n font-weight: 400;\n color: #000;\n padding-bottom: 10px;\n}\n.GridContainer .BlogTitle .BlogCardLink {\n display: block;\n color: inherit;\n text-decoration: none;\n cursor: pointer;\n}\n.GridContainer .BlogTitle .BlogCardLink::after {\n content: "";\n position: absolute;\n inset: 0;\n z-index: 2;\n}\n.GridContainer .BlogContent {\n margin: 0;\n display: -webkit-box;\n font-size: 14px;\n line-height: 1.2em;\n -webkit-line-clamp: 6;\n color: #000;\n -webkit-box-orient: vertical;\n box-sizing: border-box;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.GridContainer .BlogLink {\n color: #22B04E;\n font-size: 14px;\n position: absolute;\n bottom: 16px;\n padding-top: 2.5px;\n}\n\n@container article (max-width: 550px) {\n .GridContainer .GridWrapper {\n height: 380px;\n flex-direction: column;\n }\n .GridContainer .GridWrapper .GridSector:first-of-type {\n height: 120px;\n flex-shrink: 0;\n flex-basis: 150px;\n }\n .GridContainer .GridWrapper .GridSector:last-of-type {\n padding: 20px 20px 40px;\n }\n}\n.LoadingImage {\n width: 100%;\n height: 100%;\n background-color: var(--emw--color-gray-100, #E6E6E6);\n}\n\n.LoadingStripe {\n border: 1px solid var(--emw--color-white, #FFFFFF);\n height: 20%;\n background-color: var(--emw--color-gray-100, #E6E6E6);\n margin-bottom: 5px;\n}\n\n.LoadingSmallStripe {\n width: 40%;\n}\n\n.LoadingMediumStripe {\n width: 70%;\n}\n\n.BlogLink.LoadingLongStripe {\n position: static;\n width: 100%;\n}\n\n.GridContainerWrapper.LoadingGrid .GridSector {\n justify-content: space-around;\n}\n\n.GridContainerWrapper.LoadingGrid .LoadingImage, .GridContainerWrapper.LoadingGrid .LoadingStripe {\n animation: pulsatingLoader 2s ease-in-out 0s infinite reverse;\n -webkit-animation: pulsatingLoader 2s ease-in-out 0s infinite reverse;\n}\n\n@keyframes pulsatingLoader {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n@-webkit-keyframes pulsatingLoader {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}';const c=i=>!!(i.toLowerCase().match(/android/i)||i.toLowerCase().match(/blackberry|bb/i)||i.toLowerCase().match(/iphone|ipad|ipod/i)||i.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),g={en:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ro:{firstPage:"Prima",previousPage:"Anterior",nextPage:"Urmatoarea",lastPage:"Ultima"},fr:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ar:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},hu:{firstPage:"First",previousPage:"Previous",nextPage:"Következő",lastPage:"Last"},hr:{firstPage:"Prva",previousPage:"Prethodna",nextPage:"Slijedeća",lastPage:"Zadnja"}},p=(i,t)=>g[void 0!==t&&t in g?t:"en"][i],u=class{constructor(n){i(this,n),this.hpPageChange=t(this,"hpPageChange",7),this.userAgent=window.navigator.userAgent,this.currentPage=1,this.navigateTo=i=>{var t;switch(i){case"firstPage":this.offsetInt=0;break;case"lastPage":this.offsetInt=this.endInt*this.limitInt;break;case"previousPage":this.offsetInt-=this.limitInt;break;case"nextPage":this.offsetInt+=this.limitInt;break;case"fivePagesBack":this.offsetInt-=5*this.limitInt,this.offsetInt=this.offsetInt<=0?0:this.offsetInt;break;case"fivePagesForward":this.offsetInt+=5*this.limitInt,this.offsetInt=this.offsetInt/this.limitInt>=this.endInt?this.endInt*this.limitInt:this.offsetInt}this.previousPage=!!this.offsetInt,null===(t=this.hpPageChange)||void 0===t||t.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt})},this.paginationNavigation=(i,t)=>{var n;this.previousPage=!0,isNaN(i)?0===t&&this.currentPage<=4?this.navigateTo("firstPage"):0===t&&this.currentPage>4?this.navigateTo("fivePagesBack"):4===t&&this.endInt-this.currentPage>=2&&this.navigateTo("fivePagesForward"):1===i?(this.offsetInt=i-1,this.previousPage=!1):this.offsetInt=(i-1)*this.limitInt,null===(n=this.hpPageChange)||void 0===n||n.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt})},this.nextPage="",this.prevPage="",this.offset=0,this.limit=1,this.total=1,this.language="en",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.arrowsActive=!0,this.secondaryArrowsActive=!1,this.numberedNavActive=!1,this.pageQueryParam=void 0,this.page=1,this.offsetInt=0,this.lastPage=!1,this.previousPage=!1,this.limitInt=0,this.totalInt=0,this.pagesArray=[],this.endInt=0}handleClientStylingChange(i,t){i!==t&&a(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(i,t){i!==t&&this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)}componentWillRender(){this.offsetInt=this.offset,this.limitInt=this.limit,this.currentPage=this.offsetInt/this.limitInt+1,this.limitInt=this.limit,this.totalInt=this.total,this.endInt=Math.ceil(this.totalInt/this.limitInt)-1,this.lastPage=!(this.offsetInt>=this.endInt*this.limitInt),1==this.currentPage||2==this.currentPage?(this.pagesArray=Array.from({length:4},((i,t)=>t+1)),this.pagesArray.push("...")):this.currentPage>=3&&this.endInt-this.currentPage>=2?(this.pagesArray=Array.from({length:3},((i,t)=>this.currentPage+t-1)),this.pagesArray.push("..."),this.pagesArray.unshift("...")):this.endInt-this.currentPage<3&&(this.pagesArray=Array.from({length:4},((i,t)=>this.endInt-2+t)),this.pagesArray.unshift("..."))}handleClientStyling(){void 0===window.emMessageBus?(this.clientStyling&&a(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)):this.stylingSubscription=h(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription,!0)}componentDidLoad(){this.handleClientStyling()}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}pageHref(i){if(!this.pageQueryParam)return"#";const t=new URL(window.location.href);return t.searchParams.set(this.pageQueryParam,String(i+this.page-1)),`${t.search}${t.hash}`}render(){let i=n("ul",{class:"PaginationArea"},this.pagesArray.map(((i,t)=>{const e="number"==typeof i?i:0===t?Math.max(1,this.currentPage-5):Math.min(this.endInt+1,this.currentPage+5);return n("li",{class:"PaginationItem"+(i===this.currentPage?" ActiveItem":" ")+" "+(c(this.userAgent)?"MobileButtons":"")},n("a",{href:this.pageHref(e),"aria-current":i===this.currentPage?"page":void 0,"aria-disabled":i===this.currentPage?"true":void 0,tabIndex:i===this.currentPage?-1:void 0,onClick:n=>{n.preventDefault(),i!==this.currentPage&&this.paginationNavigation(i,t)}},n("span",null,i)))}))),t=n("a",{href:this.prevPage?this.pageHref(1):"#","aria-disabled":this.prevPage?void 0:"true",tabIndex:this.prevPage?void 0:-1,onClick:i=>{i.preventDefault(),this.prevPage&&this.navigateTo("firstPage")}},n("span",{class:"NavigationButton"},p("firstPage",this.language)),n("span",{class:"NavigationIcon"})),e=n("div",{class:"LeftItems"},this.secondaryArrowsActive&&t,n("a",{href:this.prevPage?this.pageHref(this.currentPage-1):"#",rel:"prev","aria-label":p("previousPage",this.language),"aria-disabled":this.prevPage?void 0:"true",tabIndex:this.prevPage?void 0:-1,onClick:i=>{i.preventDefault(),this.prevPage&&this.navigateTo("previousPage")}},n("span",{class:"NavigationButton"},p("previousPage",this.language)),n("span",{class:"NavigationIcon"})));c(this.userAgent)&&(e=n("div",{class:"LeftItems"},n("a",{href:this.prevPage?this.pageHref(this.currentPage-1):"#",rel:"prev","aria-label":p("previousPage",this.language),"aria-disabled":this.prevPage?void 0:"true",tabIndex:this.prevPage?void 0:-1,onClick:i=>{i.preventDefault(),this.prevPage&&this.navigateTo("previousPage")}},n("span",{class:"NavigationButton"},p("previousPage",this.language)),n("span",{class:"NavigationIcon"}))));let s=n("a",{href:this.nextPage?this.pageHref(this.endInt+1):"#","aria-disabled":this.nextPage?void 0:"true",tabIndex:this.nextPage?void 0:-1,onClick:i=>{i.preventDefault(),this.nextPage&&this.navigateTo("lastPage")}},n("span",{class:"NavigationButton"},p("lastPage",this.language)),n("span",{class:"NavigationIcon"})),o=n("div",{class:"RightItems"},n("a",{href:this.nextPage?this.pageHref(this.currentPage+1):"#",rel:"next","aria-label":p("nextPage",this.language),"aria-disabled":this.nextPage?void 0:"true",tabIndex:this.nextPage?void 0:-1,onClick:i=>{i.preventDefault(),this.nextPage&&this.navigateTo("nextPage")}},n("span",{class:"NavigationButton"},p("nextPage",this.language)),n("span",{class:"NavigationIcon"})),this.secondaryArrowsActive&&s);return c(this.userAgent)&&(o=n("div",{class:"RightItems"},n("a",{href:this.nextPage?this.pageHref(this.currentPage+1):"#",rel:"next","aria-label":p("nextPage",this.language),"aria-disabled":this.nextPage?void 0:"true",tabIndex:this.nextPage?void 0:-1,onClick:i=>{i.preventDefault(),this.nextPage&&this.navigateTo("nextPage")}},n("span",{class:"NavigationButton"},p("nextPage",this.language)),n("span",{class:"NavigationIcon"})))),n("nav",{id:"PaginationContainer",class:"PaginationContainer","aria-label":"Blog pagination",ref:i=>this.stylingContainer=i},this.arrowsActive&&e,this.numberedNavActive&&i,this.arrowsActive&&o)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}}};u.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}#PaginationContainer{width:100%;margin:20px 0;display:inline-flex;justify-content:space-between;align-items:center}.LeftItems a:not(:first-child),.RightItems a:not(:last-child){margin:0 10px}.LeftItems a,.RightItems a{padding:0;background-color:#009993;border-color:#009993}.PaginationArea{display:inline-flex;gap:10px;list-style:none}.PaginationArea li{margin:0;padding:0}.PaginationArea li a{width:24px;height:24px;display:flex;border:0;padding:0;justify-content:center;align-items:center;background-color:transparent;color:#000;cursor:pointer;pointer-events:all}.PaginationItem.ActiveItem a{background:#009993;border-color:#009993;color:#fff}.PaginationItem.ActiveItem a[aria-disabled=true]{pointer-events:none;cursor:not-allowed}.PaginationItem a:hover,.PaginationItem a:active{background:#009993;border-color:#009993;color:#fff;opacity:0.8}a{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;text-decoration:none;width:100px;height:32px;border:1px solid #524e52;border-radius:5px;background:#524e52;color:#fff;font-size:14px;font:inherit;cursor:pointer;transition:all 0.1s linear;text-transform:uppercase;text-align:center;letter-spacing:0}a:hover,a:active{background:#004D4A;border-color:#004D4A}a[aria-disabled=true]{background-color:#ccc;border-color:#ccc;color:#fff;cursor:not-allowed}@media screen and (max-width: 720px){a{width:90px;font-size:14px}}@media screen and (max-width: 480px){a{width:70px;font-size:14px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){a{width:58px;font-size:12px}.paginationArea{padding:5px;gap:5px}}@media (hover: none){.paginationItem a:hover{background:inherit;border-color:inherit;color:inherit;opacity:1}.paginationItem.activeItem a:hover{background:#009993;border-color:#009993;color:#fff}}';export{d as blog_articles_grid,u as helper_pagination}
1
+ import{r as i,c as t,h as n}from"./index-4af8e775.js";const e={en:{error:"Error",readmore:"Read more",home:"Home",blog:"Blog",blogPageTitle:"Blog"},ro:{error:"Eroare",readmore:"Read more",home:"Acasă",blog:"Blog",blogPageTitle:"Blog"},fr:{error:"Error",readmore:"Read more",home:"Accueil",blog:"Blog",blogPageTitle:"Blog"},ar:{error:"خطأ",readmore:"Read more",home:"الرئيسية",blog:"المدونة",blogPageTitle:"المدونة"},hu:{error:"خطأ",readmore:"Tovább olvasom",home:"Kezdőlap",blog:"Blog",blogPageTitle:"Blog"},hr:{error:"Greška",readmore:"Pročitaj više",home:"Početna",blog:"Blog",blogPageTitle:"Blog"},"pt-br":{error:"Erro",readmore:"Ler mais",home:"Início",blog:"Blog",blogPageTitle:"Blog"},"es-mx":{error:"Error",readmore:"Leer más",home:"Inicio",blog:"Blog",blogPageTitle:"Blog"}},s=(i,t,n)=>{var s;const o=null!=t?t:"en",a=null===(s=null==n?void 0:n[o])||void 0===s?void 0:s[i];return"string"==typeof a?a:e[o in e?o:"en"][i]},o="__WIDGET_GLOBAL_STYLE_CACHE__";function a(i,t){if(i){const n=document.createElement("style");n.innerHTML=t,i.appendChild(n)}}function r(i,t){if(!i||!t)return;const n=new URL(t);fetch(n.href).then((i=>i.text())).then((t=>{const n=document.createElement("style");n.innerHTML=t,i&&i.appendChild(n)})).catch((i=>{console.error("There was an error while trying to load client styling from URL",i)}))}function h(i,t,n,e=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!e)return n=function(i,t){const n=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{i&&(n.innerHTML=t,i.appendChild(n))}))}(i,t),n;window[o]||(window[o]={}),n=function(i,t){return window.emMessageBus.subscribe(t,(n=>{if(!i)return;const e=i.getRootNode(),s=window[o];let a=s[t]&&s[t].sheet;a?s[t].refCount=s[t].refCount+1:(a=new CSSStyleSheet,a.replaceSync(n),s[t]={sheet:a,refCount:1});const r=e.adoptedStyleSheets||[];r.includes(a)||(e.adoptedStyleSheets=[...r,a])}))}(i,t);const s=n.unsubscribe.bind(n);return n.unsubscribe=()=>{if(window[o][t]){const i=window[o][t];i.refCount>1?i.refCount=i.refCount-1:delete window[o][t]}s()},n}function l(i){return i.includes("android")}const d=class{constructor(e){i(this,e),this.articleActionButton=t(this,"articleActionButton",7),this.lastPage=1,this.isInitialized=!1,this.paginationDefaultStyling="\n nav#PaginationContainer {\n justify-content: right;\n }\n .LeftItems a .NavigationButton {\n display: none;\n }\n .LeftItems a:after, .RightItems a:after {\n padding: 7px 12px;\n font-size: 18px;\n font-weight: 700;\n line-height: 46px;\n }\n .LeftItems a:after {\n content: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1.2em' viewBox='0 0 320 512'%3E%3C!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --%3E%3Cpath d='M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z'/%3E%3C/svg%3E\");\n }\n .RightItems a:after {\n content: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1.2em' viewBox='0 0 320 512'%3E%3C!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --%3E%3Cpath d='M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z'/%3E%3C/svg%3E\");\n display: block;\n height: 38px;\n }\n div.LeftItems a, div.RightItems a {\n width: unset;\n height: 40px;\n background-color: #fff;\n color: #000;\n border: 1px solid #000;\n overflow: hidden;\n &[aria-disabled=\"true\"] {\n background-color: #989898;\n }\n }\n div.LeftItems a {\n min-width: 60px;\n border-radius: 20px 0 0 20px;\n border-right: 0;\n }\n div.RightItems a {\n display: flex;\n min-width: 100px;\n justify-content: space-evenly;\n align-items: center;\n border-radius: 0 20px 20px 0;\n text-transform: none;\n }\n .RightItems a .NavigationButton {\n padding: 12px 0 12px 12px;\n font-weight: 700;\n }",this.renderContentConditionally=i=>i&&(!i.includes("<bannermatrix-banner")||this.bannerMatrixReady)?n("p",{class:"BlogContent",innerHTML:i}):null,this.cmsEndpoint=void 0,this.language="en",this.translationUrl="",this.userRoles="everyone",this.cmsEnv="stage",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.showPublishingDate=!0,this.showBlogSubcategories=!1,this.showImage=!0,this.showTitle=!0,this.showPageTitle=!1,this.showBreadcrumb=!1,this.showContent=!0,this.showButton=!0,this.hideError=!1,this.usePostmessage=void 0,this.postMessageEvent="",this.blogsLimit="0",this.paginationActive=void 0,this.arrowsActive=!0,this.secondaryArrowsActive=!1,this.numberedNavActive=!1,this.intlDateTimeFormat="",this.page="1",this.pageQueryParam=void 0,this.eventId=void 0,this.paginationBlogList={offset:0},this.currentPage=0,this.hasErrors=!1,this.isLoading=!0,this.bannerMatrixReady=!1,this.nextPage="",this.previousPage="",this.device="mobile",this.displayedBlogResponse=void 0,this.paginationBlogResponse=void 0,this.allBlogResponse=void 0,this.totalBlogs=0,this.customTranslations={},this.selectedCategory="all",this.categories=[]}getArticleId(i,t){var n;if(0!==i.button||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;const e={postId:t.postID.toString(),slug:t.slug,customPath:t.customPath};this.usePostmessage?(i.preventDefault(),window.postMessage(Object.assign({type:this.postMessageEvent},e))):null===(n=this.articleActionButton)||void 0===n||n.emit(e)}handleBannerReady(){this.bannerMatrixReady=!0}watchEndpoint(i,t){this.isInitialized&&(this.currentPage=parseInt(this.page)-1,(i||""===i)&&i!=t&&this.cmsEndpoint&&this.language&&this.getBlogArticleGrid())}handleClientStylingChange(i,t){i!==t&&a(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(i,t){i!==t&&this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)}async loadTranslations(){if(this.translationUrl)try{const i=await fetch(this.translationUrl);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);this.customTranslations=await i.json()}catch(i){console.error("Failed to fetch or parse translations from URL:",i)}else this.customTranslations={}}hpPageChange(i){var t,n;this.paginationBlogList=i.detail,this.currentPage=Math.floor((null===(t=this.paginationBlogList)||void 0===t?void 0:t.offset)/(null===(n=this.paginationBlogList)||void 0===n?void 0:n.limit)),this.page&&(this.currentPage=this.currentPage+ +this.page-1),this.currentPage+1>this.lastPage?this.nextPage=null:this.currentPage<0?this.previousPage=null:(window.postMessage({type:"BlogArticlesGridActivePagination",currentPage:this.currentPage},window.location.href),this.getBlogArticleGrid(!0))}sortArticlesByDate(i){return i.sort(((i,t)=>i.publishingDate>t.publishingDate?-1:i.publishingDate<t.publishingDate?1:0)),i}findLatestFeatured(i){let t=i.filter((i=>i.isFeaturedPost));return 0===t.length?null:(t=this.sortArticlesByDate(t),t[0])}moveLatestFeatureToStart(i,t){if(!t)return i;const n=i.indexOf(t);return-1!==n&&(i.splice(n,1),i.unshift(t)),i}async fetchBlogPosts(i,t=!1){const n=new URL(`${this.cmsEndpoint}/${this.language}/blog-posts`);if(this.showBlogSubcategories&&this.selectedCategory&&"all"!==this.selectedCategory){const i=this.categories.find((i=>i.id==this.selectedCategory));i&&n.searchParams.append("category",i.name)}return n.searchParams.append("per_page",t?"300":this.blogsLimit),n.searchParams.append("page",`${i||this.currentPage+1}`),n.searchParams.append("env",this.cmsEnv),n.searchParams.append("userRoles",this.userRoles),n.searchParams.append("device",(()=>{const i=(()=>{let i=window.navigator.userAgent;return i.toLowerCase().match(/android/i)?"Android":i.toLowerCase().match(/iphone/i)?"iPhone":i.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(i){if("PC"===i)return"dk";if("iPad"===i||"iPhone"===i)return"mtWeb"}return"mtWeb"})()),fetch(n.href).then((i=>{if(i.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return i.json()})).then((i=>{let n=i.items;const e=this.findLatestFeatured(n);return n=this.sortArticlesByDate(n),n=this.moveLatestFeatureToStart(n,e),i=Object.assign(Object.assign({},i),{items:n}),t?this.allBlogResponse=i:this.paginationBlogResponse=i,i})).catch((i=>(this.hasErrors=!0,console.log("Error",i),{})))}async fetchCategories(){try{const i=new URL(`${this.cmsEndpoint}/${this.language}/blog-posts/category`),t=await fetch(i.href);if(!t.ok)throw new Error("Failed to fetch categories");const n=await t.json();this.categories=[{id:"all",name:"All"},...n]}catch(i){console.error("Error fetching categories",i)}}async getBlogArticleGrid(i=!1,t){var n,e,s,o,a,r,h;this.isLoading=!0;try{let l;if(this.eventId&&this.eventId.length>0){const o=(null===(n=this.allBlogResponse)||void 0===n?void 0:n.items)?this.allBlogResponse:await this.fetchBlogPosts(1,!0),a=o.items.filter((({eventIds:i})=>{var t;return i.includes(null!==(t=this.eventId)&&void 0!==t?t:"-")}));a.length?(l=Object.assign(Object.assign({},o),{items:a,total:Math.min(parseInt(this.blogsLimit),a.length)}),window.postMessage({type:"OP:blogReady",payload:{hasBlog:!0}},"*")):(window.postMessage({type:"OP:blogReady",payload:{hasBlog:!1}},"*"),l=(null===(s=null===(e=this.paginationBlogResponse)||void 0===e?void 0:e.items)||void 0===s?void 0:s.length)&&!i?this.paginationBlogResponse:await this.fetchBlogPosts(t))}else l=(null===(a=null===(o=this.paginationBlogResponse)||void 0===o?void 0:o.items)||void 0===a?void 0:a.length)&&!i?this.paginationBlogResponse:await this.fetchBlogPosts(t);this.displayedBlogResponse=l,this.totalBlogs=l.total,this.lastPage=+((null===(h=null===(r=l.pages.last)||void 0===r?void 0:r.match(/&page=(\d+)/))||void 0===h?void 0:h[1])||1),this.nextPage=l.pages.next,this.previousPage=l.pages.previous,this.isLoading=!1,this.hasErrors=!1}catch(i){this.hasErrors=!0,console.log("Error",i)}}async componentWillLoad(){return this.showBlogSubcategories&&await this.fetchCategories(),this.cmsEndpoint&&this.language&&this.blogsLimit&&(this.page?(this.currentPage=this.currentPage+ +this.page-1,this.getBlogArticleGrid(!1,+this.page)):this.getBlogArticleGrid()),this.loadTranslations()}async handleCategoryChange(i){this.selectedCategory=i,this.currentPage=0,this.paginationBlogList=Object.assign(Object.assign({},this.paginationBlogList),{offset:0}),await this.getBlogArticleGrid(!0,1)}handleClientStyling(){void 0===window.emMessageBus?(this.clientStyling&&a(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)):this.stylingSubscription=h(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription,!0)}componentDidLoad(){this.handleClientStyling(),this.isInitialized=!0,window.postMessage({type:"BlogArticlesGridLoaded"},window.location.href),this.device=((i=!1)=>{if("undefined"==typeof window||"undefined"==typeof navigator)return"desktop";const t=navigator.userAgent.toLowerCase(),n=window.innerWidth;if(function(i){return!!i.includes("ipad")||i.includes("macintosh")&&navigator.maxTouchPoints>0}(t))return"tablet";if(function(i){return i.includes("iphone")||i.includes("ipod")}(t))return"mobile";if(function(i,t){return l(i)&&(i.includes("mobile")||i.includes("mobi")||t<=599)}(t,n))return"mobile";if(function(i,t){return l(i)&&!i.includes("mobile")&&!i.includes("mobi")&&t>599}(t,n))return"tablet";if(i){if(n<=599)return"mobile";if(n<=1099)return"tablet"}return"desktop"})()}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}setImage(i){var t,n;return(null===(n=null===(t=i.sources)||void 0===t?void 0:t["mobile"===this.device?0:"tablet"===this.device?1:2])||void 0===n?void 0:n.pictureSource)||i.src}parseDate(i){const t=new Date(i);if(t instanceof Date&&!Number.isNaN(t.getTime()))return t;const[n,e,s]=i.trim().split("/").map(Number);return new Date(s,e-1,n)}formatDate(i){const t=this.parseDate(i);return new Intl.DateTimeFormat(this.intlDateTimeFormat).format(t)}render(){if(this.hasErrors)return n("div",{class:"BlogsContainer"},!this.hideError&&n("div",{class:"ErrorMessage"},s("error",this.language,this.customTranslations)));const i=[];for(let t=0;t<parseInt(this.blogsLimit);t++)i.push(n("div",{class:"GridContainer FeaturedPost Skeleton"},n("div",{class:"GridWrapper"},n("div",{class:"GridSector"},n("div",{class:"VisualContent LoadingImage"})),n("div",{class:"GridSector"},n("div",{class:"BlogTitle LoadingStripe LoadingSmallStripe"}),n("div",{class:"BlogDetails LoadingStripe LoadingMediumStripe"}),n("div",{class:"BlogLink LoadingStripe LoadingLongStripe"})))));const t=Boolean(this.paginationActive)&&this.totalBlogs>+this.blogsLimit,e=this.mbSource?void 0:this.clientStyling||this.paginationDefaultStyling;return n("div",{ref:i=>this.stylingContainer=i},this.showBreadcrumb&&n("nav",{class:"breadcrumb","aria-label":"Breadcrumb"},n("a",{href:`/${encodeURIComponent(this.language)}`},s("home",this.language,this.customTranslations)),n("span",{"aria-hidden":"true"},"›"),n("span",{"aria-current":"page"},s("blog",this.language,this.customTranslations))),this.showPageTitle&&n("h1",{class:"BlogPageTitle"},s("blogPageTitle",this.language,this.customTranslations)),n("div",{class:"BlogPageContainer"},this.showBlogSubcategories&&n("div",{class:"BlogCategoriesSliderWrapper"},n("div",{class:"CarouselWrapper"},n("div",{class:"CarouselContainer"},n("div",{class:"BlogCategoriesWrapper"},n("div",{class:"CategoryButtons"},this.categories.map((i=>n("button",{key:i.id,class:{CategoryButton:!0,active:this.selectedCategory===i.id},onClick:()=>{this.handleCategoryChange(i.id)}},i.name)))))))),n("div",{class:"BlogGridPaginationWrapper"},t&&n("helper-pagination",{"next-page":this.nextPage,"prev-page":this.previousPage,offset:this.paginationBlogList.offset,limit:parseInt(this.blogsLimit,10),total:this.totalBlogs,language:this.language,"mb-source":this.mbSource,"client-styling":e,"client-styling-url":this.clientStylingUrl,"arrows-active":this.arrowsActive,"secondary-arrows-active":this.secondaryArrowsActive,"numbered-nav-active":this.numberedNavActive,"page-query-param":this.pageQueryParam,page:+this.page||1})),!this.isLoading&&n("div",{class:`GridContainerWrapper BlogPage-${this.currentPage} ${this.device}`},this.displayedBlogResponse&&this.displayedBlogResponse.items.map((i=>{var t,e;return n("div",{key:i.postID,class:i.isFeaturedPost?"GridContainer FeaturedPost":"GridContainer"},n("div",{class:"GridWrapper"},n("div",{class:"GridSector"},this.showPublishingDate&&n("div",{class:"BlogDate"},n("time",{dateTime:i.publishingDate},this.formatDate(i.publishingDate))),this.showImage&&(null===(t=i.image)||void 0===t?void 0:t.src)?n("img",{class:"VisualContent",src:this.setImage(i.image),alt:i.image.alt||i.title,width:"400",height:"225",loading:"lazy"}):(null===(e=i.video)||void 0===e?void 0:e.sources[this.device])?n("video",{class:"VisualContent",src:i.video.sources[this.device]}):n("span",{class:"VisualContent",style:{color:"#fff"}},"No Image")),n("div",{class:"GridSector"},this.showTitle&&n("h2",{class:"BlogTitle"},n("a",{class:"BlogCardLink",href:`/${encodeURIComponent(this.language)}/blog/${encodeURIComponent(i.customPath||i.slug)}`,onClick:t=>this.getArticleId(t,i)},i.title)),this.showContent&&this.renderContentConditionally(i.descriptionPreview),this.showButton&&n("span",{class:"BlogLink"},s("readmore",this.language,this.customTranslations)))))}))),this.isLoading&&n("div",{class:"GridContainerWrapper LoadingGrid"},i)))}static get watchers(){return{page:["watchEndpoint"],hasErrors:["watchEndpoint"],cmsEndpoint:["watchEndpoint"],language:["watchEndpoint"],cmsEnv:["watchEndpoint"],userRoles:["watchEndpoint"],blogsLimit:["watchEndpoint"],eventId:["watchEndpoint"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"],translationUrl:["loadTranslations"]}}};d.style=':host {\n display: block;\n}\n\n.breadcrumb {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n max-width: 1300px;\n padding: 0 20px;\n margin: 40px auto 20px;\n color: var(--emw--color-white, #FFFFFF);\n}\n.breadcrumb a {\n color: inherit;\n}\n\n.BlogPageTitle {\n max-width: 1300px;\n padding: 0 20px;\n margin: 0 auto;\n color: var(--emw--color-primary);\n font-size: 22px;\n font-weight: 600;\n line-height: 1.2;\n}\n\n.BlogPageContainer {\n background: #0A0A17;\n padding: 20px;\n}\n\n.GridContainerWrapper {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 20px;\n}\n\n.BlogPage-0 .GridContainer.FeaturedPost:first-child {\n width: 100%;\n flex-basis: auto;\n}\n\n.GridContainer {\n position: relative;\n container-type: inline-size;\n container-name: article;\n border-radius: 15px;\n color: #000;\n overflow: hidden;\n}\n.GridContainer.FeaturedPost:first-child {\n grid-column: 1/-1;\n width: 100%;\n}\n.GridContainer .GridWrapper {\n display: flex;\n flex-direction: row;\n height: 280px;\n background: var(--emw--color-white, #FFFFFF);\n}\n.GridContainer .GridSector {\n flex-basis: 50%;\n position: relative;\n}\n.GridContainer .GridSector:first-of-type {\n height: 280px;\n display: flex;\n}\n.GridContainer .GridSector:last-of-type {\n position: static;\n padding: 20px 40px;\n display: flex;\n flex-direction: column;\n}\n.GridContainer .VisualContent {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n.GridContainer .BlogDate {\n position: absolute;\n bottom: 0px;\n left: 30px;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: var(--emw--color-white, #FFFFFF);\n background-color: #CD0B5E;\n z-index: 1;\n pointer-events: none;\n}\n.GridContainer .BlogTitle {\n margin: 0;\n font-size: 24px;\n font-weight: 400;\n color: #000;\n padding-bottom: 10px;\n}\n.GridContainer .BlogTitle .BlogCardLink {\n display: block;\n color: inherit;\n text-decoration: none;\n cursor: pointer;\n}\n.GridContainer .BlogTitle .BlogCardLink::after {\n content: "";\n position: absolute;\n inset: 0;\n z-index: 2;\n}\n.GridContainer .BlogContent {\n margin: 0;\n display: -webkit-box;\n font-size: 14px;\n line-height: 1.2em;\n -webkit-line-clamp: 6;\n color: #000;\n -webkit-box-orient: vertical;\n box-sizing: border-box;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.GridContainer .BlogLink {\n color: #22B04E;\n font-size: 14px;\n position: absolute;\n bottom: 16px;\n padding-top: 2.5px;\n}\n\n@container article (max-width: 550px) {\n .GridContainer .GridWrapper {\n height: 380px;\n flex-direction: column;\n }\n .GridContainer .GridWrapper .GridSector:first-of-type {\n height: 120px;\n flex-shrink: 0;\n flex-basis: 150px;\n }\n .GridContainer .GridWrapper .GridSector:last-of-type {\n padding: 20px 20px 40px;\n }\n}\n.LoadingImage {\n width: 100%;\n height: 100%;\n background-color: var(--emw--color-gray-100, #E6E6E6);\n}\n\n.LoadingStripe {\n border: 1px solid var(--emw--color-white, #FFFFFF);\n height: 20%;\n background-color: var(--emw--color-gray-100, #E6E6E6);\n margin-bottom: 5px;\n}\n\n.LoadingSmallStripe {\n width: 40%;\n}\n\n.LoadingMediumStripe {\n width: 70%;\n}\n\n.BlogLink.LoadingLongStripe {\n position: static;\n width: 100%;\n}\n\n.GridContainerWrapper.LoadingGrid .GridSector {\n justify-content: space-around;\n}\n\n.GridContainerWrapper.LoadingGrid .LoadingImage, .GridContainerWrapper.LoadingGrid .LoadingStripe {\n animation: pulsatingLoader 2s ease-in-out 0s infinite reverse;\n -webkit-animation: pulsatingLoader 2s ease-in-out 0s infinite reverse;\n}\n\n@keyframes pulsatingLoader {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n@-webkit-keyframes pulsatingLoader {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n.BlogCategoriesWrapper {\n margin-bottom: 24px;\n}\n\n.FilterLabel {\n margin-bottom: 12px;\n color: var(--emw--color-white, #fff);\n font-weight: 600;\n}\n\n.CategoryButtons {\n display: flex;\n flex-wrap: wrap;\n gap: 12px;\n}\n\n.CategoryButton {\n padding: 10px 20px;\n border-radius: 999px;\n border: 1px solid currentColor;\n background: transparent;\n color: var(--emw--color-white, #fff);\n cursor: pointer;\n transition: all 0.2s ease;\n}\n\n.CategoryButton.active {\n background: var(--emw--casino-color-primary, var(--emw--color-primary, #22B04E));\n color: var(--emw--color-background, #fff);\n}';const c=i=>!!(i.toLowerCase().match(/android/i)||i.toLowerCase().match(/blackberry|bb/i)||i.toLowerCase().match(/iphone|ipad|ipod/i)||i.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),g={en:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ro:{firstPage:"Prima",previousPage:"Anterior",nextPage:"Urmatoarea",lastPage:"Ultima"},fr:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},ar:{firstPage:"First",previousPage:"Previous",nextPage:"Next",lastPage:"Last"},hu:{firstPage:"First",previousPage:"Previous",nextPage:"Következő",lastPage:"Last"},hr:{firstPage:"Prva",previousPage:"Prethodna",nextPage:"Slijedeća",lastPage:"Zadnja"}},p=(i,t)=>g[void 0!==t&&t in g?t:"en"][i],u=class{constructor(n){i(this,n),this.hpPageChange=t(this,"hpPageChange",7),this.userAgent=window.navigator.userAgent,this.currentPage=1,this.navigateTo=i=>{var t;switch(i){case"firstPage":this.offsetInt=0;break;case"lastPage":this.offsetInt=this.endInt*this.limitInt;break;case"previousPage":this.offsetInt-=this.limitInt;break;case"nextPage":this.offsetInt+=this.limitInt;break;case"fivePagesBack":this.offsetInt-=5*this.limitInt,this.offsetInt=this.offsetInt<=0?0:this.offsetInt;break;case"fivePagesForward":this.offsetInt+=5*this.limitInt,this.offsetInt=this.offsetInt/this.limitInt>=this.endInt?this.endInt*this.limitInt:this.offsetInt}this.previousPage=!!this.offsetInt,null===(t=this.hpPageChange)||void 0===t||t.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt})},this.paginationNavigation=(i,t)=>{var n;this.previousPage=!0,isNaN(i)?0===t&&this.currentPage<=4?this.navigateTo("firstPage"):0===t&&this.currentPage>4?this.navigateTo("fivePagesBack"):4===t&&this.endInt-this.currentPage>=2&&this.navigateTo("fivePagesForward"):1===i?(this.offsetInt=i-1,this.previousPage=!1):this.offsetInt=(i-1)*this.limitInt,null===(n=this.hpPageChange)||void 0===n||n.emit({offset:this.offsetInt,limit:this.limitInt,total:this.totalInt})},this.nextPage="",this.prevPage="",this.offset=0,this.limit=1,this.total=1,this.language="en",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.arrowsActive=!0,this.secondaryArrowsActive=!1,this.numberedNavActive=!1,this.pageQueryParam=void 0,this.page=1,this.offsetInt=0,this.lastPage=!1,this.previousPage=!1,this.limitInt=0,this.totalInt=0,this.pagesArray=[],this.endInt=0}handleClientStylingChange(i,t){i!==t&&a(this.stylingContainer,this.clientStyling)}handleClientStylingChangeURL(i,t){i!==t&&this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)}componentWillRender(){this.offsetInt=this.offset,this.limitInt=this.limit,this.currentPage=this.offsetInt/this.limitInt+1,this.limitInt=this.limit,this.totalInt=this.total,this.endInt=Math.ceil(this.totalInt/this.limitInt)-1,this.lastPage=!(this.offsetInt>=this.endInt*this.limitInt),1==this.currentPage||2==this.currentPage?(this.pagesArray=Array.from({length:4},((i,t)=>t+1)),this.pagesArray.push("...")):this.currentPage>=3&&this.endInt-this.currentPage>=2?(this.pagesArray=Array.from({length:3},((i,t)=>this.currentPage+t-1)),this.pagesArray.push("..."),this.pagesArray.unshift("...")):this.endInt-this.currentPage<3&&(this.pagesArray=Array.from({length:4},((i,t)=>this.endInt-2+t)),this.pagesArray.unshift("..."))}handleClientStyling(){void 0===window.emMessageBus?(this.clientStyling&&a(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)):this.stylingSubscription=h(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription,!0)}componentDidLoad(){this.handleClientStyling()}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}pageHref(i){if(!this.pageQueryParam)return"#";const t=new URL(window.location.href);return t.searchParams.set(this.pageQueryParam,String(i+this.page-1)),`${t.search}${t.hash}`}render(){let i=n("ul",{class:"PaginationArea"},this.pagesArray.map(((i,t)=>{const e="number"==typeof i?i:0===t?Math.max(1,this.currentPage-5):Math.min(this.endInt+1,this.currentPage+5);return n("li",{class:"PaginationItem"+(i===this.currentPage?" ActiveItem":" ")+" "+(c(this.userAgent)?"MobileButtons":"")},n("a",{href:this.pageHref(e),"aria-current":i===this.currentPage?"page":void 0,"aria-disabled":i===this.currentPage?"true":void 0,tabIndex:i===this.currentPage?-1:void 0,onClick:n=>{n.preventDefault(),i!==this.currentPage&&this.paginationNavigation(i,t)}},n("span",null,i)))}))),t=n("a",{href:this.prevPage?this.pageHref(1):"#","aria-disabled":this.prevPage?void 0:"true",tabIndex:this.prevPage?void 0:-1,onClick:i=>{i.preventDefault(),this.prevPage&&this.navigateTo("firstPage")}},n("span",{class:"NavigationButton"},p("firstPage",this.language)),n("span",{class:"NavigationIcon"})),e=n("div",{class:"LeftItems"},this.secondaryArrowsActive&&t,n("a",{href:this.prevPage?this.pageHref(this.currentPage-1):"#",rel:"prev","aria-label":p("previousPage",this.language),"aria-disabled":this.prevPage?void 0:"true",tabIndex:this.prevPage?void 0:-1,onClick:i=>{i.preventDefault(),this.prevPage&&this.navigateTo("previousPage")}},n("span",{class:"NavigationButton"},p("previousPage",this.language)),n("span",{class:"NavigationIcon"})));c(this.userAgent)&&(e=n("div",{class:"LeftItems"},n("a",{href:this.prevPage?this.pageHref(this.currentPage-1):"#",rel:"prev","aria-label":p("previousPage",this.language),"aria-disabled":this.prevPage?void 0:"true",tabIndex:this.prevPage?void 0:-1,onClick:i=>{i.preventDefault(),this.prevPage&&this.navigateTo("previousPage")}},n("span",{class:"NavigationButton"},p("previousPage",this.language)),n("span",{class:"NavigationIcon"}))));let s=n("a",{href:this.nextPage?this.pageHref(this.endInt+1):"#","aria-disabled":this.nextPage?void 0:"true",tabIndex:this.nextPage?void 0:-1,onClick:i=>{i.preventDefault(),this.nextPage&&this.navigateTo("lastPage")}},n("span",{class:"NavigationButton"},p("lastPage",this.language)),n("span",{class:"NavigationIcon"})),o=n("div",{class:"RightItems"},n("a",{href:this.nextPage?this.pageHref(this.currentPage+1):"#",rel:"next","aria-label":p("nextPage",this.language),"aria-disabled":this.nextPage?void 0:"true",tabIndex:this.nextPage?void 0:-1,onClick:i=>{i.preventDefault(),this.nextPage&&this.navigateTo("nextPage")}},n("span",{class:"NavigationButton"},p("nextPage",this.language)),n("span",{class:"NavigationIcon"})),this.secondaryArrowsActive&&s);return c(this.userAgent)&&(o=n("div",{class:"RightItems"},n("a",{href:this.nextPage?this.pageHref(this.currentPage+1):"#",rel:"next","aria-label":p("nextPage",this.language),"aria-disabled":this.nextPage?void 0:"true",tabIndex:this.nextPage?void 0:-1,onClick:i=>{i.preventDefault(),this.nextPage&&this.navigateTo("nextPage")}},n("span",{class:"NavigationButton"},p("nextPage",this.language)),n("span",{class:"NavigationIcon"})))),n("nav",{id:"PaginationContainer",class:"PaginationContainer","aria-label":"Blog pagination",ref:i=>this.stylingContainer=i},this.arrowsActive&&e,this.numberedNavActive&&i,this.arrowsActive&&o)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingChangeURL"]}}};u.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}#PaginationContainer{width:100%;margin:20px 0;display:inline-flex;justify-content:space-between;align-items:center}.LeftItems a:not(:first-child),.RightItems a:not(:last-child){margin:0 10px}.LeftItems a,.RightItems a{padding:0;background-color:#009993;border-color:#009993}.PaginationArea{display:inline-flex;gap:10px;list-style:none}.PaginationArea li{margin:0;padding:0}.PaginationArea li a{width:24px;height:24px;display:flex;border:0;padding:0;justify-content:center;align-items:center;background-color:transparent;color:#000;cursor:pointer;pointer-events:all}.PaginationItem.ActiveItem a{background:#009993;border-color:#009993;color:#fff}.PaginationItem.ActiveItem a[aria-disabled=true]{pointer-events:none;cursor:not-allowed}.PaginationItem a:hover,.PaginationItem a:active{background:#009993;border-color:#009993;color:#fff;opacity:0.8}a{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;text-decoration:none;width:100px;height:32px;border:1px solid #524e52;border-radius:5px;background:#524e52;color:#fff;font-size:14px;font:inherit;cursor:pointer;transition:all 0.1s linear;text-transform:uppercase;text-align:center;letter-spacing:0}a:hover,a:active{background:#004D4A;border-color:#004D4A}a[aria-disabled=true]{background-color:#ccc;border-color:#ccc;color:#fff;cursor:not-allowed}@media screen and (max-width: 720px){a{width:90px;font-size:14px}}@media screen and (max-width: 480px){a{width:70px;font-size:14px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){a{width:58px;font-size:12px}.paginationArea{padding:5px;gap:5px}}@media (hover: none){.paginationItem a:hover{background:inherit;border-color:inherit;color:inherit;opacity:1}.paginationItem.activeItem a:hover{background:#009993;border-color:#009993;color:#fff}}';export{d as blog_articles_grid,u as helper_pagination}
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["blog-articles-grid_2.cjs",[[1,"blog-articles-grid",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"translationUrl":[513,"translation-url"],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showPageTitle":[516,"show-page-title"],"showBreadcrumb":[516,"show-breadcrumb"],"showContent":[516,"show-content"],"showButton":[516,"show-button"],"hideError":[516,"hide-error"],"usePostmessage":[516,"use-postmessage"],"postMessageEvent":[513,"post-message-event"],"blogsLimit":[513,"blogs-limit"],"paginationActive":[516,"pagination-active"],"arrowsActive":[516,"arrows-active"],"secondaryArrowsActive":[516,"secondary-arrows-active"],"numberedNavActive":[516,"numbered-nav-active"],"intlDateTimeFormat":[513,"intl-date-time-format"],"page":[513],"pageQueryParam":[1,"page-query-param"],"eventId":[513,"event-id"],"paginationBlogList":[32],"currentPage":[32],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"nextPage":[32],"previousPage":[32],"device":[32],"displayedBlogResponse":[32],"paginationBlogResponse":[32],"allBlogResponse":[32],"totalBlogs":[32],"customTranslations":[32]},[[8,"BannerMatrixReady","handleBannerReady"],[0,"hpPageChange","hpPageChange"]],{"page":["watchEndpoint"],"hasErrors":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"cmsEnv":["watchEndpoint"],"userRoles":["watchEndpoint"],"blogsLimit":["watchEndpoint"],"eventId":["watchEndpoint"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["loadTranslations"]}],[1,"helper-pagination",{"nextPage":[1537,"next-page"],"prevPage":[1537,"prev-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1537],"mbSource":[1,"mb-source"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[1537,"client-styling-url"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"numberedNavActive":[1540,"numbered-nav-active"],"pageQueryParam":[1,"page-query-param"],"page":[2],"offsetInt":[32],"lastPage":[32],"previousPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
22
+ return index.bootstrapLazy([["blog-articles-grid_2.cjs",[[1,"blog-articles-grid",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"translationUrl":[513,"translation-url"],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showBlogSubcategories":[516,"show-blog-subcategories"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showPageTitle":[516,"show-page-title"],"showBreadcrumb":[516,"show-breadcrumb"],"showContent":[516,"show-content"],"showButton":[516,"show-button"],"hideError":[516,"hide-error"],"usePostmessage":[516,"use-postmessage"],"postMessageEvent":[513,"post-message-event"],"blogsLimit":[513,"blogs-limit"],"paginationActive":[516,"pagination-active"],"arrowsActive":[516,"arrows-active"],"secondaryArrowsActive":[516,"secondary-arrows-active"],"numberedNavActive":[516,"numbered-nav-active"],"intlDateTimeFormat":[513,"intl-date-time-format"],"page":[513],"pageQueryParam":[1,"page-query-param"],"eventId":[513,"event-id"],"paginationBlogList":[32],"currentPage":[32],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"nextPage":[32],"previousPage":[32],"device":[32],"displayedBlogResponse":[32],"paginationBlogResponse":[32],"allBlogResponse":[32],"totalBlogs":[32],"customTranslations":[32],"selectedCategory":[32],"categories":[32]},[[8,"BannerMatrixReady","handleBannerReady"],[0,"hpPageChange","hpPageChange"]],{"page":["watchEndpoint"],"hasErrors":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"cmsEnv":["watchEndpoint"],"userRoles":["watchEndpoint"],"blogsLimit":["watchEndpoint"],"eventId":["watchEndpoint"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["loadTranslations"]}],[1,"helper-pagination",{"nextPage":[1537,"next-page"],"prevPage":[1537,"prev-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1537],"mbSource":[1,"mb-source"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[1537,"client-styling-url"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"numberedNavActive":[1540,"numbered-nav-active"],"pageQueryParam":[1,"page-query-param"],"page":[2],"offsetInt":[32],"lastPage":[32],"previousPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -275,7 +275,7 @@ const getDevicePlatform = () => {
275
275
  return 'mtWeb';
276
276
  };
277
277
 
278
- const blogArticlesGridCss = ":host {\n display: block;\n}\n\n.breadcrumb {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n max-width: 1300px;\n padding: 0 20px;\n margin: 40px auto 20px;\n color: var(--emw--color-white, #FFFFFF);\n}\n.breadcrumb a {\n color: inherit;\n}\n\n.BlogPageTitle {\n max-width: 1300px;\n padding: 0 20px;\n margin: 0 auto;\n color: var(--emw--color-primary);\n font-size: 22px;\n font-weight: 600;\n line-height: 1.2;\n}\n\n.BlogPageContainer {\n background: #0A0A17;\n padding: 20px;\n}\n\n.GridContainerWrapper {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 20px;\n}\n\n.BlogPage-0 .GridContainer.FeaturedPost:first-child {\n width: 100%;\n flex-basis: auto;\n}\n\n.GridContainer {\n position: relative;\n container-type: inline-size;\n container-name: article;\n border-radius: 15px;\n color: #000;\n overflow: hidden;\n}\n.GridContainer.FeaturedPost:first-child {\n grid-column: 1/-1;\n width: 100%;\n}\n.GridContainer .GridWrapper {\n display: flex;\n flex-direction: row;\n height: 280px;\n background: var(--emw--color-white, #FFFFFF);\n}\n.GridContainer .GridSector {\n flex-basis: 50%;\n position: relative;\n}\n.GridContainer .GridSector:first-of-type {\n height: 280px;\n display: flex;\n}\n.GridContainer .GridSector:last-of-type {\n position: static;\n padding: 20px 40px;\n display: flex;\n flex-direction: column;\n}\n.GridContainer .VisualContent {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n.GridContainer .BlogDate {\n position: absolute;\n bottom: 0px;\n left: 30px;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: var(--emw--color-white, #FFFFFF);\n background-color: #CD0B5E;\n z-index: 1;\n pointer-events: none;\n}\n.GridContainer .BlogTitle {\n margin: 0;\n font-size: 24px;\n font-weight: 400;\n color: #000;\n padding-bottom: 10px;\n}\n.GridContainer .BlogTitle .BlogCardLink {\n display: block;\n color: inherit;\n text-decoration: none;\n cursor: pointer;\n}\n.GridContainer .BlogTitle .BlogCardLink::after {\n content: \"\";\n position: absolute;\n inset: 0;\n z-index: 2;\n}\n.GridContainer .BlogContent {\n margin: 0;\n display: -webkit-box;\n font-size: 14px;\n line-height: 1.2em;\n -webkit-line-clamp: 6;\n color: #000;\n -webkit-box-orient: vertical;\n box-sizing: border-box;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.GridContainer .BlogLink {\n color: #22B04E;\n font-size: 14px;\n position: absolute;\n bottom: 16px;\n padding-top: 2.5px;\n}\n\n@container article (max-width: 550px) {\n .GridContainer .GridWrapper {\n height: 380px;\n flex-direction: column;\n }\n .GridContainer .GridWrapper .GridSector:first-of-type {\n height: 120px;\n flex-shrink: 0;\n flex-basis: 150px;\n }\n .GridContainer .GridWrapper .GridSector:last-of-type {\n padding: 20px 20px 40px;\n }\n}\n.LoadingImage {\n width: 100%;\n height: 100%;\n background-color: var(--emw--color-gray-100, #E6E6E6);\n}\n\n.LoadingStripe {\n border: 1px solid var(--emw--color-white, #FFFFFF);\n height: 20%;\n background-color: var(--emw--color-gray-100, #E6E6E6);\n margin-bottom: 5px;\n}\n\n.LoadingSmallStripe {\n width: 40%;\n}\n\n.LoadingMediumStripe {\n width: 70%;\n}\n\n.BlogLink.LoadingLongStripe {\n position: static;\n width: 100%;\n}\n\n.GridContainerWrapper.LoadingGrid .GridSector {\n justify-content: space-around;\n}\n\n.GridContainerWrapper.LoadingGrid .LoadingImage, .GridContainerWrapper.LoadingGrid .LoadingStripe {\n animation: pulsatingLoader 2s ease-in-out 0s infinite reverse;\n -webkit-animation: pulsatingLoader 2s ease-in-out 0s infinite reverse;\n}\n\n@keyframes pulsatingLoader {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n@-webkit-keyframes pulsatingLoader {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}";
278
+ const blogArticlesGridCss = ":host {\n display: block;\n}\n\n.breadcrumb {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n max-width: 1300px;\n padding: 0 20px;\n margin: 40px auto 20px;\n color: var(--emw--color-white, #FFFFFF);\n}\n.breadcrumb a {\n color: inherit;\n}\n\n.BlogPageTitle {\n max-width: 1300px;\n padding: 0 20px;\n margin: 0 auto;\n color: var(--emw--color-primary);\n font-size: 22px;\n font-weight: 600;\n line-height: 1.2;\n}\n\n.BlogPageContainer {\n background: #0A0A17;\n padding: 20px;\n}\n\n.GridContainerWrapper {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 20px;\n}\n\n.BlogPage-0 .GridContainer.FeaturedPost:first-child {\n width: 100%;\n flex-basis: auto;\n}\n\n.GridContainer {\n position: relative;\n container-type: inline-size;\n container-name: article;\n border-radius: 15px;\n color: #000;\n overflow: hidden;\n}\n.GridContainer.FeaturedPost:first-child {\n grid-column: 1/-1;\n width: 100%;\n}\n.GridContainer .GridWrapper {\n display: flex;\n flex-direction: row;\n height: 280px;\n background: var(--emw--color-white, #FFFFFF);\n}\n.GridContainer .GridSector {\n flex-basis: 50%;\n position: relative;\n}\n.GridContainer .GridSector:first-of-type {\n height: 280px;\n display: flex;\n}\n.GridContainer .GridSector:last-of-type {\n position: static;\n padding: 20px 40px;\n display: flex;\n flex-direction: column;\n}\n.GridContainer .VisualContent {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n.GridContainer .BlogDate {\n position: absolute;\n bottom: 0px;\n left: 30px;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: var(--emw--color-white, #FFFFFF);\n background-color: #CD0B5E;\n z-index: 1;\n pointer-events: none;\n}\n.GridContainer .BlogTitle {\n margin: 0;\n font-size: 24px;\n font-weight: 400;\n color: #000;\n padding-bottom: 10px;\n}\n.GridContainer .BlogTitle .BlogCardLink {\n display: block;\n color: inherit;\n text-decoration: none;\n cursor: pointer;\n}\n.GridContainer .BlogTitle .BlogCardLink::after {\n content: \"\";\n position: absolute;\n inset: 0;\n z-index: 2;\n}\n.GridContainer .BlogContent {\n margin: 0;\n display: -webkit-box;\n font-size: 14px;\n line-height: 1.2em;\n -webkit-line-clamp: 6;\n color: #000;\n -webkit-box-orient: vertical;\n box-sizing: border-box;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.GridContainer .BlogLink {\n color: #22B04E;\n font-size: 14px;\n position: absolute;\n bottom: 16px;\n padding-top: 2.5px;\n}\n\n@container article (max-width: 550px) {\n .GridContainer .GridWrapper {\n height: 380px;\n flex-direction: column;\n }\n .GridContainer .GridWrapper .GridSector:first-of-type {\n height: 120px;\n flex-shrink: 0;\n flex-basis: 150px;\n }\n .GridContainer .GridWrapper .GridSector:last-of-type {\n padding: 20px 20px 40px;\n }\n}\n.LoadingImage {\n width: 100%;\n height: 100%;\n background-color: var(--emw--color-gray-100, #E6E6E6);\n}\n\n.LoadingStripe {\n border: 1px solid var(--emw--color-white, #FFFFFF);\n height: 20%;\n background-color: var(--emw--color-gray-100, #E6E6E6);\n margin-bottom: 5px;\n}\n\n.LoadingSmallStripe {\n width: 40%;\n}\n\n.LoadingMediumStripe {\n width: 70%;\n}\n\n.BlogLink.LoadingLongStripe {\n position: static;\n width: 100%;\n}\n\n.GridContainerWrapper.LoadingGrid .GridSector {\n justify-content: space-around;\n}\n\n.GridContainerWrapper.LoadingGrid .LoadingImage, .GridContainerWrapper.LoadingGrid .LoadingStripe {\n animation: pulsatingLoader 2s ease-in-out 0s infinite reverse;\n -webkit-animation: pulsatingLoader 2s ease-in-out 0s infinite reverse;\n}\n\n@keyframes pulsatingLoader {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n@-webkit-keyframes pulsatingLoader {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n.BlogCategoriesWrapper {\n margin-bottom: 24px;\n}\n\n.FilterLabel {\n margin-bottom: 12px;\n color: var(--emw--color-white, #fff);\n font-weight: 600;\n}\n\n.CategoryButtons {\n display: flex;\n flex-wrap: wrap;\n gap: 12px;\n}\n\n.CategoryButton {\n padding: 10px 20px;\n border-radius: 999px;\n border: 1px solid currentColor;\n background: transparent;\n color: var(--emw--color-white, #fff);\n cursor: pointer;\n transition: all 0.2s ease;\n}\n\n.CategoryButton.active {\n background: var(--emw--casino-color-primary, var(--emw--color-primary, #22B04E));\n color: var(--emw--color-background, #fff);\n}";
279
279
  const BlogArticlesGridStyle0 = blogArticlesGridCss;
280
280
 
281
281
  const BlogArticlesGrid = class {
@@ -351,6 +351,7 @@ const BlogArticlesGrid = class {
351
351
  this.clientStyling = '';
352
352
  this.clientStylingUrl = '';
353
353
  this.showPublishingDate = true;
354
+ this.showBlogSubcategories = false;
354
355
  this.showImage = true;
355
356
  this.showTitle = true;
356
357
  this.showPageTitle = false;
@@ -384,6 +385,8 @@ const BlogArticlesGrid = class {
384
385
  this.allBlogResponse = undefined;
385
386
  this.totalBlogs = 0;
386
387
  this.customTranslations = {};
388
+ this.selectedCategory = 'all';
389
+ this.categories = [];
387
390
  }
388
391
  getArticleId(event, post) {
389
392
  var _a;
@@ -485,6 +488,14 @@ const BlogArticlesGrid = class {
485
488
  }
486
489
  async fetchBlogPosts(page, allPosts = false) {
487
490
  const url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts`);
491
+ if (this.showBlogSubcategories &&
492
+ this.selectedCategory &&
493
+ this.selectedCategory !== 'all') {
494
+ const category = this.categories.find(cat => cat.id == this.selectedCategory);
495
+ if (category) {
496
+ url.searchParams.append('category', category.name);
497
+ }
498
+ }
488
499
  url.searchParams.append('per_page', allPosts ? '300' : this.blogsLimit);
489
500
  url.searchParams.append('page', `${page ? page : this.currentPage + 1}`);
490
501
  url.searchParams.append('env', this.cmsEnv);
@@ -518,6 +529,26 @@ const BlogArticlesGrid = class {
518
529
  return {};
519
530
  });
520
531
  }
532
+ async fetchCategories() {
533
+ try {
534
+ const url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts/category`);
535
+ const response = await fetch(url.href);
536
+ if (!response.ok) {
537
+ throw new Error('Failed to fetch categories');
538
+ }
539
+ const categories = await response.json();
540
+ this.categories = [
541
+ {
542
+ id: 'all',
543
+ name: 'All',
544
+ },
545
+ ...categories,
546
+ ];
547
+ }
548
+ catch (error) {
549
+ console.error('Error fetching categories', error);
550
+ }
551
+ }
521
552
  async getBlogArticleGrid(forceFetch = false, page) {
522
553
  var _a, _b, _c, _d, _e, _f, _g;
523
554
  this.isLoading = true;
@@ -567,7 +598,9 @@ const BlogArticlesGrid = class {
567
598
  console.log('Error', err);
568
599
  }
569
600
  }
570
- componentWillLoad() {
601
+ async componentWillLoad() {
602
+ if (this.showBlogSubcategories)
603
+ await this.fetchCategories();
571
604
  if (this.cmsEndpoint && this.language && this.blogsLimit) {
572
605
  if (this.page) {
573
606
  this.currentPage = this.currentPage + +this.page - 1;
@@ -579,6 +612,12 @@ const BlogArticlesGrid = class {
579
612
  }
580
613
  return this.loadTranslations();
581
614
  }
615
+ async handleCategoryChange(categoryId) {
616
+ this.selectedCategory = categoryId;
617
+ this.currentPage = 0;
618
+ this.paginationBlogList = Object.assign(Object.assign({}, this.paginationBlogList), { offset: 0 });
619
+ await this.getBlogArticleGrid(true, 1);
620
+ }
582
621
  handleClientStyling() {
583
622
  if (window.emMessageBus !== undefined) {
584
623
  this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
@@ -628,7 +667,13 @@ const BlogArticlesGrid = class {
628
667
  }
629
668
  const showPagination = Boolean(this.paginationActive) && this.totalBlogs > +this.blogsLimit;
630
669
  const paginationClientStyling = !this.mbSource ? (this.clientStyling || this.paginationDefaultStyling) : undefined;
631
- return (index.h("div", { ref: el => this.stylingContainer = el }, this.showBreadcrumb && (index.h("nav", { class: "breadcrumb", "aria-label": "Breadcrumb" }, index.h("a", { href: `/${encodeURIComponent(this.language)}` }, translate$1('home', this.language, this.customTranslations)), index.h("span", { "aria-hidden": "true" }, "\u203A"), index.h("span", { "aria-current": "page" }, translate$1('blog', this.language, this.customTranslations)))), this.showPageTitle && index.h("h1", { class: "BlogPageTitle" }, translate$1('blogPageTitle', this.language, this.customTranslations)), index.h("div", { class: "BlogPageContainer" }, index.h("div", { class: "BlogGridPaginationWrapper" }, showPagination && index.h("helper-pagination", { "next-page": this.nextPage, "prev-page": this.previousPage, offset: this.paginationBlogList.offset, limit: parseInt(this.blogsLimit, 10), total: this.totalBlogs, language: this.language, "mb-source": this.mbSource, "client-styling": paginationClientStyling, "client-styling-url": this.clientStylingUrl, "arrows-active": this.arrowsActive, "secondary-arrows-active": this.secondaryArrowsActive, "numbered-nav-active": this.numberedNavActive, "page-query-param": this.pageQueryParam, page: +this.page || 1 })), (!this.isLoading) &&
670
+ return (index.h("div", { ref: el => this.stylingContainer = el }, this.showBreadcrumb && (index.h("nav", { class: "breadcrumb", "aria-label": "Breadcrumb" }, index.h("a", { href: `/${encodeURIComponent(this.language)}` }, translate$1('home', this.language, this.customTranslations)), index.h("span", { "aria-hidden": "true" }, "\u203A"), index.h("span", { "aria-current": "page" }, translate$1('blog', this.language, this.customTranslations)))), this.showPageTitle && index.h("h1", { class: "BlogPageTitle" }, translate$1('blogPageTitle', this.language, this.customTranslations)), index.h("div", { class: "BlogPageContainer" }, this.showBlogSubcategories &&
671
+ index.h("div", { class: "BlogCategoriesSliderWrapper" }, index.h("div", { class: "CarouselWrapper" }, index.h("div", { class: "CarouselContainer" }, index.h("div", { class: "BlogCategoriesWrapper" }, index.h("div", { class: "CategoryButtons" }, this.categories.map(category => (index.h("button", { key: category.id, class: {
672
+ CategoryButton: true,
673
+ active: this.selectedCategory === category.id,
674
+ }, onClick: () => {
675
+ this.handleCategoryChange(category.id);
676
+ } }, category.name)))))))), index.h("div", { class: "BlogGridPaginationWrapper" }, showPagination && index.h("helper-pagination", { "next-page": this.nextPage, "prev-page": this.previousPage, offset: this.paginationBlogList.offset, limit: parseInt(this.blogsLimit, 10), total: this.totalBlogs, language: this.language, "mb-source": this.mbSource, "client-styling": paginationClientStyling, "client-styling-url": this.clientStylingUrl, "arrows-active": this.arrowsActive, "secondary-arrows-active": this.secondaryArrowsActive, "numbered-nav-active": this.numberedNavActive, "page-query-param": this.pageQueryParam, page: +this.page || 1 })), (!this.isLoading) &&
632
677
  index.h("div", { class: `GridContainerWrapper BlogPage-${this.currentPage} ${this.device}` }, this.displayedBlogResponse && this.displayedBlogResponse.items.map((data) => {
633
678
  var _a, _b;
634
679
  return index.h("div", { key: data.postID, class: data.isFeaturedPost ? 'GridContainer FeaturedPost' : 'GridContainer' }, index.h("div", { class: "GridWrapper" }, index.h("div", { class: "GridSector" }, this.showPublishingDate &&
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["blog-articles-grid_2.cjs",[[1,"blog-articles-grid",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"translationUrl":[513,"translation-url"],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showPageTitle":[516,"show-page-title"],"showBreadcrumb":[516,"show-breadcrumb"],"showContent":[516,"show-content"],"showButton":[516,"show-button"],"hideError":[516,"hide-error"],"usePostmessage":[516,"use-postmessage"],"postMessageEvent":[513,"post-message-event"],"blogsLimit":[513,"blogs-limit"],"paginationActive":[516,"pagination-active"],"arrowsActive":[516,"arrows-active"],"secondaryArrowsActive":[516,"secondary-arrows-active"],"numberedNavActive":[516,"numbered-nav-active"],"intlDateTimeFormat":[513,"intl-date-time-format"],"page":[513],"pageQueryParam":[1,"page-query-param"],"eventId":[513,"event-id"],"paginationBlogList":[32],"currentPage":[32],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"nextPage":[32],"previousPage":[32],"device":[32],"displayedBlogResponse":[32],"paginationBlogResponse":[32],"allBlogResponse":[32],"totalBlogs":[32],"customTranslations":[32]},[[8,"BannerMatrixReady","handleBannerReady"],[0,"hpPageChange","hpPageChange"]],{"page":["watchEndpoint"],"hasErrors":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"cmsEnv":["watchEndpoint"],"userRoles":["watchEndpoint"],"blogsLimit":["watchEndpoint"],"eventId":["watchEndpoint"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["loadTranslations"]}],[1,"helper-pagination",{"nextPage":[1537,"next-page"],"prevPage":[1537,"prev-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1537],"mbSource":[1,"mb-source"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[1537,"client-styling-url"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"numberedNavActive":[1540,"numbered-nav-active"],"pageQueryParam":[1,"page-query-param"],"page":[2],"offsetInt":[32],"lastPage":[32],"previousPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
11
+ return index.bootstrapLazy([["blog-articles-grid_2.cjs",[[1,"blog-articles-grid",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"translationUrl":[513,"translation-url"],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showBlogSubcategories":[516,"show-blog-subcategories"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showPageTitle":[516,"show-page-title"],"showBreadcrumb":[516,"show-breadcrumb"],"showContent":[516,"show-content"],"showButton":[516,"show-button"],"hideError":[516,"hide-error"],"usePostmessage":[516,"use-postmessage"],"postMessageEvent":[513,"post-message-event"],"blogsLimit":[513,"blogs-limit"],"paginationActive":[516,"pagination-active"],"arrowsActive":[516,"arrows-active"],"secondaryArrowsActive":[516,"secondary-arrows-active"],"numberedNavActive":[516,"numbered-nav-active"],"intlDateTimeFormat":[513,"intl-date-time-format"],"page":[513],"pageQueryParam":[1,"page-query-param"],"eventId":[513,"event-id"],"paginationBlogList":[32],"currentPage":[32],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"nextPage":[32],"previousPage":[32],"device":[32],"displayedBlogResponse":[32],"paginationBlogResponse":[32],"allBlogResponse":[32],"totalBlogs":[32],"customTranslations":[32],"selectedCategory":[32],"categories":[32]},[[8,"BannerMatrixReady","handleBannerReady"],[0,"hpPageChange","hpPageChange"]],{"page":["watchEndpoint"],"hasErrors":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"cmsEnv":["watchEndpoint"],"userRoles":["watchEndpoint"],"blogsLimit":["watchEndpoint"],"eventId":["watchEndpoint"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["loadTranslations"]}],[1,"helper-pagination",{"nextPage":[1537,"next-page"],"prevPage":[1537,"prev-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1537],"mbSource":[1,"mb-source"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[1537,"client-styling-url"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"numberedNavActive":[1540,"numbered-nav-active"],"pageQueryParam":[1,"page-query-param"],"page":[2],"offsetInt":[32],"lastPage":[32],"previousPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -203,4 +203,34 @@
203
203
  100% {
204
204
  opacity: 0.5;
205
205
  }
206
+ }
207
+ .BlogCategoriesWrapper {
208
+ margin-bottom: 24px;
209
+ }
210
+
211
+ .FilterLabel {
212
+ margin-bottom: 12px;
213
+ color: var(--emw--color-white, #fff);
214
+ font-weight: 600;
215
+ }
216
+
217
+ .CategoryButtons {
218
+ display: flex;
219
+ flex-wrap: wrap;
220
+ gap: 12px;
221
+ }
222
+
223
+ .CategoryButton {
224
+ padding: 10px 20px;
225
+ border-radius: 999px;
226
+ border: 1px solid currentColor;
227
+ background: transparent;
228
+ color: var(--emw--color-white, #fff);
229
+ cursor: pointer;
230
+ transition: all 0.2s ease;
231
+ }
232
+
233
+ .CategoryButton.active {
234
+ background: var(--emw--casino-color-primary, var(--emw--color-primary, #22B04E));
235
+ color: var(--emw--color-background, #fff);
206
236
  }
@@ -74,6 +74,7 @@ export class BlogArticlesGrid {
74
74
  this.clientStyling = '';
75
75
  this.clientStylingUrl = '';
76
76
  this.showPublishingDate = true;
77
+ this.showBlogSubcategories = false;
77
78
  this.showImage = true;
78
79
  this.showTitle = true;
79
80
  this.showPageTitle = false;
@@ -107,6 +108,8 @@ export class BlogArticlesGrid {
107
108
  this.allBlogResponse = undefined;
108
109
  this.totalBlogs = 0;
109
110
  this.customTranslations = {};
111
+ this.selectedCategory = 'all';
112
+ this.categories = [];
110
113
  }
111
114
  getArticleId(event, post) {
112
115
  var _a;
@@ -208,6 +211,14 @@ export class BlogArticlesGrid {
208
211
  }
209
212
  async fetchBlogPosts(page, allPosts = false) {
210
213
  const url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts`);
214
+ if (this.showBlogSubcategories &&
215
+ this.selectedCategory &&
216
+ this.selectedCategory !== 'all') {
217
+ const category = this.categories.find(cat => cat.id == this.selectedCategory);
218
+ if (category) {
219
+ url.searchParams.append('category', category.name);
220
+ }
221
+ }
211
222
  url.searchParams.append('per_page', allPosts ? '300' : this.blogsLimit);
212
223
  url.searchParams.append('page', `${page ? page : this.currentPage + 1}`);
213
224
  url.searchParams.append('env', this.cmsEnv);
@@ -241,6 +252,26 @@ export class BlogArticlesGrid {
241
252
  return {};
242
253
  });
243
254
  }
255
+ async fetchCategories() {
256
+ try {
257
+ const url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts/category`);
258
+ const response = await fetch(url.href);
259
+ if (!response.ok) {
260
+ throw new Error('Failed to fetch categories');
261
+ }
262
+ const categories = await response.json();
263
+ this.categories = [
264
+ {
265
+ id: 'all',
266
+ name: 'All',
267
+ },
268
+ ...categories,
269
+ ];
270
+ }
271
+ catch (error) {
272
+ console.error('Error fetching categories', error);
273
+ }
274
+ }
244
275
  async getBlogArticleGrid(forceFetch = false, page) {
245
276
  var _a, _b, _c, _d, _e, _f, _g;
246
277
  this.isLoading = true;
@@ -290,7 +321,9 @@ export class BlogArticlesGrid {
290
321
  console.log('Error', err);
291
322
  }
292
323
  }
293
- componentWillLoad() {
324
+ async componentWillLoad() {
325
+ if (this.showBlogSubcategories)
326
+ await this.fetchCategories();
294
327
  if (this.cmsEndpoint && this.language && this.blogsLimit) {
295
328
  if (this.page) {
296
329
  this.currentPage = this.currentPage + +this.page - 1;
@@ -302,6 +335,12 @@ export class BlogArticlesGrid {
302
335
  }
303
336
  return this.loadTranslations();
304
337
  }
338
+ async handleCategoryChange(categoryId) {
339
+ this.selectedCategory = categoryId;
340
+ this.currentPage = 0;
341
+ this.paginationBlogList = Object.assign(Object.assign({}, this.paginationBlogList), { offset: 0 });
342
+ await this.getBlogArticleGrid(true, 1);
343
+ }
305
344
  handleClientStyling() {
306
345
  if (window.emMessageBus !== undefined) {
307
346
  this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
@@ -351,7 +390,13 @@ export class BlogArticlesGrid {
351
390
  }
352
391
  const showPagination = Boolean(this.paginationActive) && this.totalBlogs > +this.blogsLimit;
353
392
  const paginationClientStyling = !this.mbSource ? (this.clientStyling || this.paginationDefaultStyling) : undefined;
354
- return (h("div", { ref: el => this.stylingContainer = el }, this.showBreadcrumb && (h("nav", { class: "breadcrumb", "aria-label": "Breadcrumb" }, h("a", { href: `/${encodeURIComponent(this.language)}` }, translate('home', this.language, this.customTranslations)), h("span", { "aria-hidden": "true" }, "\u203A"), h("span", { "aria-current": "page" }, translate('blog', this.language, this.customTranslations)))), this.showPageTitle && h("h1", { class: "BlogPageTitle" }, translate('blogPageTitle', this.language, this.customTranslations)), h("div", { class: "BlogPageContainer" }, h("div", { class: "BlogGridPaginationWrapper" }, showPagination && h("helper-pagination", { "next-page": this.nextPage, "prev-page": this.previousPage, offset: this.paginationBlogList.offset, limit: parseInt(this.blogsLimit, 10), total: this.totalBlogs, language: this.language, "mb-source": this.mbSource, "client-styling": paginationClientStyling, "client-styling-url": this.clientStylingUrl, "arrows-active": this.arrowsActive, "secondary-arrows-active": this.secondaryArrowsActive, "numbered-nav-active": this.numberedNavActive, "page-query-param": this.pageQueryParam, page: +this.page || 1 })), (!this.isLoading) &&
393
+ return (h("div", { ref: el => this.stylingContainer = el }, this.showBreadcrumb && (h("nav", { class: "breadcrumb", "aria-label": "Breadcrumb" }, h("a", { href: `/${encodeURIComponent(this.language)}` }, translate('home', this.language, this.customTranslations)), h("span", { "aria-hidden": "true" }, "\u203A"), h("span", { "aria-current": "page" }, translate('blog', this.language, this.customTranslations)))), this.showPageTitle && h("h1", { class: "BlogPageTitle" }, translate('blogPageTitle', this.language, this.customTranslations)), h("div", { class: "BlogPageContainer" }, this.showBlogSubcategories &&
394
+ h("div", { class: "BlogCategoriesSliderWrapper" }, h("div", { class: "CarouselWrapper" }, h("div", { class: "CarouselContainer" }, h("div", { class: "BlogCategoriesWrapper" }, h("div", { class: "CategoryButtons" }, this.categories.map(category => (h("button", { key: category.id, class: {
395
+ CategoryButton: true,
396
+ active: this.selectedCategory === category.id,
397
+ }, onClick: () => {
398
+ this.handleCategoryChange(category.id);
399
+ } }, category.name)))))))), h("div", { class: "BlogGridPaginationWrapper" }, showPagination && h("helper-pagination", { "next-page": this.nextPage, "prev-page": this.previousPage, offset: this.paginationBlogList.offset, limit: parseInt(this.blogsLimit, 10), total: this.totalBlogs, language: this.language, "mb-source": this.mbSource, "client-styling": paginationClientStyling, "client-styling-url": this.clientStylingUrl, "arrows-active": this.arrowsActive, "secondary-arrows-active": this.secondaryArrowsActive, "numbered-nav-active": this.numberedNavActive, "page-query-param": this.pageQueryParam, page: +this.page || 1 })), (!this.isLoading) &&
355
400
  h("div", { class: `GridContainerWrapper BlogPage-${this.currentPage} ${this.device}` }, this.displayedBlogResponse && this.displayedBlogResponse.items.map((data) => {
356
401
  var _a, _b;
357
402
  return h("div", { key: data.postID, class: data.isFeaturedPost ? 'GridContainer FeaturedPost' : 'GridContainer' }, h("div", { class: "GridWrapper" }, h("div", { class: "GridSector" }, this.showPublishingDate &&
@@ -536,6 +581,24 @@ export class BlogArticlesGrid {
536
581
  "reflect": true,
537
582
  "defaultValue": "true"
538
583
  },
584
+ "showBlogSubcategories": {
585
+ "type": "boolean",
586
+ "mutable": false,
587
+ "complexType": {
588
+ "original": "boolean",
589
+ "resolved": "boolean",
590
+ "references": {}
591
+ },
592
+ "required": false,
593
+ "optional": false,
594
+ "docs": {
595
+ "tags": [],
596
+ "text": "Property used to display the subcategories filters"
597
+ },
598
+ "attribute": "show-blog-subcategories",
599
+ "reflect": true,
600
+ "defaultValue": "false"
601
+ },
539
602
  "showImage": {
540
603
  "type": "boolean",
541
604
  "mutable": false,
@@ -872,7 +935,9 @@ export class BlogArticlesGrid {
872
935
  "paginationBlogResponse": {},
873
936
  "allBlogResponse": {},
874
937
  "totalBlogs": {},
875
- "customTranslations": {}
938
+ "customTranslations": {},
939
+ "selectedCategory": {},
940
+ "categories": {}
876
941
  };
877
942
  }
878
943
  static get events() {
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["blog-articles-grid_2",[[1,"blog-articles-grid",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"translationUrl":[513,"translation-url"],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showPageTitle":[516,"show-page-title"],"showBreadcrumb":[516,"show-breadcrumb"],"showContent":[516,"show-content"],"showButton":[516,"show-button"],"hideError":[516,"hide-error"],"usePostmessage":[516,"use-postmessage"],"postMessageEvent":[513,"post-message-event"],"blogsLimit":[513,"blogs-limit"],"paginationActive":[516,"pagination-active"],"arrowsActive":[516,"arrows-active"],"secondaryArrowsActive":[516,"secondary-arrows-active"],"numberedNavActive":[516,"numbered-nav-active"],"intlDateTimeFormat":[513,"intl-date-time-format"],"page":[513],"pageQueryParam":[1,"page-query-param"],"eventId":[513,"event-id"],"paginationBlogList":[32],"currentPage":[32],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"nextPage":[32],"previousPage":[32],"device":[32],"displayedBlogResponse":[32],"paginationBlogResponse":[32],"allBlogResponse":[32],"totalBlogs":[32],"customTranslations":[32]},[[8,"BannerMatrixReady","handleBannerReady"],[0,"hpPageChange","hpPageChange"]],{"page":["watchEndpoint"],"hasErrors":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"cmsEnv":["watchEndpoint"],"userRoles":["watchEndpoint"],"blogsLimit":["watchEndpoint"],"eventId":["watchEndpoint"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["loadTranslations"]}],[1,"helper-pagination",{"nextPage":[1537,"next-page"],"prevPage":[1537,"prev-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1537],"mbSource":[1,"mb-source"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[1537,"client-styling-url"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"numberedNavActive":[1540,"numbered-nav-active"],"pageQueryParam":[1,"page-query-param"],"page":[2],"offsetInt":[32],"lastPage":[32],"previousPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
19
+ return bootstrapLazy([["blog-articles-grid_2",[[1,"blog-articles-grid",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"translationUrl":[513,"translation-url"],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showBlogSubcategories":[516,"show-blog-subcategories"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showPageTitle":[516,"show-page-title"],"showBreadcrumb":[516,"show-breadcrumb"],"showContent":[516,"show-content"],"showButton":[516,"show-button"],"hideError":[516,"hide-error"],"usePostmessage":[516,"use-postmessage"],"postMessageEvent":[513,"post-message-event"],"blogsLimit":[513,"blogs-limit"],"paginationActive":[516,"pagination-active"],"arrowsActive":[516,"arrows-active"],"secondaryArrowsActive":[516,"secondary-arrows-active"],"numberedNavActive":[516,"numbered-nav-active"],"intlDateTimeFormat":[513,"intl-date-time-format"],"page":[513],"pageQueryParam":[1,"page-query-param"],"eventId":[513,"event-id"],"paginationBlogList":[32],"currentPage":[32],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"nextPage":[32],"previousPage":[32],"device":[32],"displayedBlogResponse":[32],"paginationBlogResponse":[32],"allBlogResponse":[32],"totalBlogs":[32],"customTranslations":[32],"selectedCategory":[32],"categories":[32]},[[8,"BannerMatrixReady","handleBannerReady"],[0,"hpPageChange","hpPageChange"]],{"page":["watchEndpoint"],"hasErrors":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"cmsEnv":["watchEndpoint"],"userRoles":["watchEndpoint"],"blogsLimit":["watchEndpoint"],"eventId":["watchEndpoint"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["loadTranslations"]}],[1,"helper-pagination",{"nextPage":[1537,"next-page"],"prevPage":[1537,"prev-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1537],"mbSource":[1,"mb-source"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[1537,"client-styling-url"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"numberedNavActive":[1540,"numbered-nav-active"],"pageQueryParam":[1,"page-query-param"],"page":[2],"offsetInt":[32],"lastPage":[32],"previousPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
20
20
  });
@@ -271,7 +271,7 @@ const getDevicePlatform = () => {
271
271
  return 'mtWeb';
272
272
  };
273
273
 
274
- const blogArticlesGridCss = ":host {\n display: block;\n}\n\n.breadcrumb {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n max-width: 1300px;\n padding: 0 20px;\n margin: 40px auto 20px;\n color: var(--emw--color-white, #FFFFFF);\n}\n.breadcrumb a {\n color: inherit;\n}\n\n.BlogPageTitle {\n max-width: 1300px;\n padding: 0 20px;\n margin: 0 auto;\n color: var(--emw--color-primary);\n font-size: 22px;\n font-weight: 600;\n line-height: 1.2;\n}\n\n.BlogPageContainer {\n background: #0A0A17;\n padding: 20px;\n}\n\n.GridContainerWrapper {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 20px;\n}\n\n.BlogPage-0 .GridContainer.FeaturedPost:first-child {\n width: 100%;\n flex-basis: auto;\n}\n\n.GridContainer {\n position: relative;\n container-type: inline-size;\n container-name: article;\n border-radius: 15px;\n color: #000;\n overflow: hidden;\n}\n.GridContainer.FeaturedPost:first-child {\n grid-column: 1/-1;\n width: 100%;\n}\n.GridContainer .GridWrapper {\n display: flex;\n flex-direction: row;\n height: 280px;\n background: var(--emw--color-white, #FFFFFF);\n}\n.GridContainer .GridSector {\n flex-basis: 50%;\n position: relative;\n}\n.GridContainer .GridSector:first-of-type {\n height: 280px;\n display: flex;\n}\n.GridContainer .GridSector:last-of-type {\n position: static;\n padding: 20px 40px;\n display: flex;\n flex-direction: column;\n}\n.GridContainer .VisualContent {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n.GridContainer .BlogDate {\n position: absolute;\n bottom: 0px;\n left: 30px;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: var(--emw--color-white, #FFFFFF);\n background-color: #CD0B5E;\n z-index: 1;\n pointer-events: none;\n}\n.GridContainer .BlogTitle {\n margin: 0;\n font-size: 24px;\n font-weight: 400;\n color: #000;\n padding-bottom: 10px;\n}\n.GridContainer .BlogTitle .BlogCardLink {\n display: block;\n color: inherit;\n text-decoration: none;\n cursor: pointer;\n}\n.GridContainer .BlogTitle .BlogCardLink::after {\n content: \"\";\n position: absolute;\n inset: 0;\n z-index: 2;\n}\n.GridContainer .BlogContent {\n margin: 0;\n display: -webkit-box;\n font-size: 14px;\n line-height: 1.2em;\n -webkit-line-clamp: 6;\n color: #000;\n -webkit-box-orient: vertical;\n box-sizing: border-box;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.GridContainer .BlogLink {\n color: #22B04E;\n font-size: 14px;\n position: absolute;\n bottom: 16px;\n padding-top: 2.5px;\n}\n\n@container article (max-width: 550px) {\n .GridContainer .GridWrapper {\n height: 380px;\n flex-direction: column;\n }\n .GridContainer .GridWrapper .GridSector:first-of-type {\n height: 120px;\n flex-shrink: 0;\n flex-basis: 150px;\n }\n .GridContainer .GridWrapper .GridSector:last-of-type {\n padding: 20px 20px 40px;\n }\n}\n.LoadingImage {\n width: 100%;\n height: 100%;\n background-color: var(--emw--color-gray-100, #E6E6E6);\n}\n\n.LoadingStripe {\n border: 1px solid var(--emw--color-white, #FFFFFF);\n height: 20%;\n background-color: var(--emw--color-gray-100, #E6E6E6);\n margin-bottom: 5px;\n}\n\n.LoadingSmallStripe {\n width: 40%;\n}\n\n.LoadingMediumStripe {\n width: 70%;\n}\n\n.BlogLink.LoadingLongStripe {\n position: static;\n width: 100%;\n}\n\n.GridContainerWrapper.LoadingGrid .GridSector {\n justify-content: space-around;\n}\n\n.GridContainerWrapper.LoadingGrid .LoadingImage, .GridContainerWrapper.LoadingGrid .LoadingStripe {\n animation: pulsatingLoader 2s ease-in-out 0s infinite reverse;\n -webkit-animation: pulsatingLoader 2s ease-in-out 0s infinite reverse;\n}\n\n@keyframes pulsatingLoader {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n@-webkit-keyframes pulsatingLoader {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}";
274
+ const blogArticlesGridCss = ":host {\n display: block;\n}\n\n.breadcrumb {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n max-width: 1300px;\n padding: 0 20px;\n margin: 40px auto 20px;\n color: var(--emw--color-white, #FFFFFF);\n}\n.breadcrumb a {\n color: inherit;\n}\n\n.BlogPageTitle {\n max-width: 1300px;\n padding: 0 20px;\n margin: 0 auto;\n color: var(--emw--color-primary);\n font-size: 22px;\n font-weight: 600;\n line-height: 1.2;\n}\n\n.BlogPageContainer {\n background: #0A0A17;\n padding: 20px;\n}\n\n.GridContainerWrapper {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 20px;\n}\n\n.BlogPage-0 .GridContainer.FeaturedPost:first-child {\n width: 100%;\n flex-basis: auto;\n}\n\n.GridContainer {\n position: relative;\n container-type: inline-size;\n container-name: article;\n border-radius: 15px;\n color: #000;\n overflow: hidden;\n}\n.GridContainer.FeaturedPost:first-child {\n grid-column: 1/-1;\n width: 100%;\n}\n.GridContainer .GridWrapper {\n display: flex;\n flex-direction: row;\n height: 280px;\n background: var(--emw--color-white, #FFFFFF);\n}\n.GridContainer .GridSector {\n flex-basis: 50%;\n position: relative;\n}\n.GridContainer .GridSector:first-of-type {\n height: 280px;\n display: flex;\n}\n.GridContainer .GridSector:last-of-type {\n position: static;\n padding: 20px 40px;\n display: flex;\n flex-direction: column;\n}\n.GridContainer .VisualContent {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n.GridContainer .BlogDate {\n position: absolute;\n bottom: 0px;\n left: 30px;\n font-size: 12px;\n border-radius: 5px 5px 0 0;\n padding: 10px;\n width: fit-content;\n text-align: center;\n color: var(--emw--color-white, #FFFFFF);\n background-color: #CD0B5E;\n z-index: 1;\n pointer-events: none;\n}\n.GridContainer .BlogTitle {\n margin: 0;\n font-size: 24px;\n font-weight: 400;\n color: #000;\n padding-bottom: 10px;\n}\n.GridContainer .BlogTitle .BlogCardLink {\n display: block;\n color: inherit;\n text-decoration: none;\n cursor: pointer;\n}\n.GridContainer .BlogTitle .BlogCardLink::after {\n content: \"\";\n position: absolute;\n inset: 0;\n z-index: 2;\n}\n.GridContainer .BlogContent {\n margin: 0;\n display: -webkit-box;\n font-size: 14px;\n line-height: 1.2em;\n -webkit-line-clamp: 6;\n color: #000;\n -webkit-box-orient: vertical;\n box-sizing: border-box;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.GridContainer .BlogLink {\n color: #22B04E;\n font-size: 14px;\n position: absolute;\n bottom: 16px;\n padding-top: 2.5px;\n}\n\n@container article (max-width: 550px) {\n .GridContainer .GridWrapper {\n height: 380px;\n flex-direction: column;\n }\n .GridContainer .GridWrapper .GridSector:first-of-type {\n height: 120px;\n flex-shrink: 0;\n flex-basis: 150px;\n }\n .GridContainer .GridWrapper .GridSector:last-of-type {\n padding: 20px 20px 40px;\n }\n}\n.LoadingImage {\n width: 100%;\n height: 100%;\n background-color: var(--emw--color-gray-100, #E6E6E6);\n}\n\n.LoadingStripe {\n border: 1px solid var(--emw--color-white, #FFFFFF);\n height: 20%;\n background-color: var(--emw--color-gray-100, #E6E6E6);\n margin-bottom: 5px;\n}\n\n.LoadingSmallStripe {\n width: 40%;\n}\n\n.LoadingMediumStripe {\n width: 70%;\n}\n\n.BlogLink.LoadingLongStripe {\n position: static;\n width: 100%;\n}\n\n.GridContainerWrapper.LoadingGrid .GridSector {\n justify-content: space-around;\n}\n\n.GridContainerWrapper.LoadingGrid .LoadingImage, .GridContainerWrapper.LoadingGrid .LoadingStripe {\n animation: pulsatingLoader 2s ease-in-out 0s infinite reverse;\n -webkit-animation: pulsatingLoader 2s ease-in-out 0s infinite reverse;\n}\n\n@keyframes pulsatingLoader {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n@-webkit-keyframes pulsatingLoader {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n.BlogCategoriesWrapper {\n margin-bottom: 24px;\n}\n\n.FilterLabel {\n margin-bottom: 12px;\n color: var(--emw--color-white, #fff);\n font-weight: 600;\n}\n\n.CategoryButtons {\n display: flex;\n flex-wrap: wrap;\n gap: 12px;\n}\n\n.CategoryButton {\n padding: 10px 20px;\n border-radius: 999px;\n border: 1px solid currentColor;\n background: transparent;\n color: var(--emw--color-white, #fff);\n cursor: pointer;\n transition: all 0.2s ease;\n}\n\n.CategoryButton.active {\n background: var(--emw--casino-color-primary, var(--emw--color-primary, #22B04E));\n color: var(--emw--color-background, #fff);\n}";
275
275
  const BlogArticlesGridStyle0 = blogArticlesGridCss;
276
276
 
277
277
  const BlogArticlesGrid = class {
@@ -347,6 +347,7 @@ const BlogArticlesGrid = class {
347
347
  this.clientStyling = '';
348
348
  this.clientStylingUrl = '';
349
349
  this.showPublishingDate = true;
350
+ this.showBlogSubcategories = false;
350
351
  this.showImage = true;
351
352
  this.showTitle = true;
352
353
  this.showPageTitle = false;
@@ -380,6 +381,8 @@ const BlogArticlesGrid = class {
380
381
  this.allBlogResponse = undefined;
381
382
  this.totalBlogs = 0;
382
383
  this.customTranslations = {};
384
+ this.selectedCategory = 'all';
385
+ this.categories = [];
383
386
  }
384
387
  getArticleId(event, post) {
385
388
  var _a;
@@ -481,6 +484,14 @@ const BlogArticlesGrid = class {
481
484
  }
482
485
  async fetchBlogPosts(page, allPosts = false) {
483
486
  const url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts`);
487
+ if (this.showBlogSubcategories &&
488
+ this.selectedCategory &&
489
+ this.selectedCategory !== 'all') {
490
+ const category = this.categories.find(cat => cat.id == this.selectedCategory);
491
+ if (category) {
492
+ url.searchParams.append('category', category.name);
493
+ }
494
+ }
484
495
  url.searchParams.append('per_page', allPosts ? '300' : this.blogsLimit);
485
496
  url.searchParams.append('page', `${page ? page : this.currentPage + 1}`);
486
497
  url.searchParams.append('env', this.cmsEnv);
@@ -514,6 +525,26 @@ const BlogArticlesGrid = class {
514
525
  return {};
515
526
  });
516
527
  }
528
+ async fetchCategories() {
529
+ try {
530
+ const url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts/category`);
531
+ const response = await fetch(url.href);
532
+ if (!response.ok) {
533
+ throw new Error('Failed to fetch categories');
534
+ }
535
+ const categories = await response.json();
536
+ this.categories = [
537
+ {
538
+ id: 'all',
539
+ name: 'All',
540
+ },
541
+ ...categories,
542
+ ];
543
+ }
544
+ catch (error) {
545
+ console.error('Error fetching categories', error);
546
+ }
547
+ }
517
548
  async getBlogArticleGrid(forceFetch = false, page) {
518
549
  var _a, _b, _c, _d, _e, _f, _g;
519
550
  this.isLoading = true;
@@ -563,7 +594,9 @@ const BlogArticlesGrid = class {
563
594
  console.log('Error', err);
564
595
  }
565
596
  }
566
- componentWillLoad() {
597
+ async componentWillLoad() {
598
+ if (this.showBlogSubcategories)
599
+ await this.fetchCategories();
567
600
  if (this.cmsEndpoint && this.language && this.blogsLimit) {
568
601
  if (this.page) {
569
602
  this.currentPage = this.currentPage + +this.page - 1;
@@ -575,6 +608,12 @@ const BlogArticlesGrid = class {
575
608
  }
576
609
  return this.loadTranslations();
577
610
  }
611
+ async handleCategoryChange(categoryId) {
612
+ this.selectedCategory = categoryId;
613
+ this.currentPage = 0;
614
+ this.paginationBlogList = Object.assign(Object.assign({}, this.paginationBlogList), { offset: 0 });
615
+ await this.getBlogArticleGrid(true, 1);
616
+ }
578
617
  handleClientStyling() {
579
618
  if (window.emMessageBus !== undefined) {
580
619
  this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
@@ -624,7 +663,13 @@ const BlogArticlesGrid = class {
624
663
  }
625
664
  const showPagination = Boolean(this.paginationActive) && this.totalBlogs > +this.blogsLimit;
626
665
  const paginationClientStyling = !this.mbSource ? (this.clientStyling || this.paginationDefaultStyling) : undefined;
627
- return (h("div", { ref: el => this.stylingContainer = el }, this.showBreadcrumb && (h("nav", { class: "breadcrumb", "aria-label": "Breadcrumb" }, h("a", { href: `/${encodeURIComponent(this.language)}` }, translate$1('home', this.language, this.customTranslations)), h("span", { "aria-hidden": "true" }, "\u203A"), h("span", { "aria-current": "page" }, translate$1('blog', this.language, this.customTranslations)))), this.showPageTitle && h("h1", { class: "BlogPageTitle" }, translate$1('blogPageTitle', this.language, this.customTranslations)), h("div", { class: "BlogPageContainer" }, h("div", { class: "BlogGridPaginationWrapper" }, showPagination && h("helper-pagination", { "next-page": this.nextPage, "prev-page": this.previousPage, offset: this.paginationBlogList.offset, limit: parseInt(this.blogsLimit, 10), total: this.totalBlogs, language: this.language, "mb-source": this.mbSource, "client-styling": paginationClientStyling, "client-styling-url": this.clientStylingUrl, "arrows-active": this.arrowsActive, "secondary-arrows-active": this.secondaryArrowsActive, "numbered-nav-active": this.numberedNavActive, "page-query-param": this.pageQueryParam, page: +this.page || 1 })), (!this.isLoading) &&
666
+ return (h("div", { ref: el => this.stylingContainer = el }, this.showBreadcrumb && (h("nav", { class: "breadcrumb", "aria-label": "Breadcrumb" }, h("a", { href: `/${encodeURIComponent(this.language)}` }, translate$1('home', this.language, this.customTranslations)), h("span", { "aria-hidden": "true" }, "\u203A"), h("span", { "aria-current": "page" }, translate$1('blog', this.language, this.customTranslations)))), this.showPageTitle && h("h1", { class: "BlogPageTitle" }, translate$1('blogPageTitle', this.language, this.customTranslations)), h("div", { class: "BlogPageContainer" }, this.showBlogSubcategories &&
667
+ h("div", { class: "BlogCategoriesSliderWrapper" }, h("div", { class: "CarouselWrapper" }, h("div", { class: "CarouselContainer" }, h("div", { class: "BlogCategoriesWrapper" }, h("div", { class: "CategoryButtons" }, this.categories.map(category => (h("button", { key: category.id, class: {
668
+ CategoryButton: true,
669
+ active: this.selectedCategory === category.id,
670
+ }, onClick: () => {
671
+ this.handleCategoryChange(category.id);
672
+ } }, category.name)))))))), h("div", { class: "BlogGridPaginationWrapper" }, showPagination && h("helper-pagination", { "next-page": this.nextPage, "prev-page": this.previousPage, offset: this.paginationBlogList.offset, limit: parseInt(this.blogsLimit, 10), total: this.totalBlogs, language: this.language, "mb-source": this.mbSource, "client-styling": paginationClientStyling, "client-styling-url": this.clientStylingUrl, "arrows-active": this.arrowsActive, "secondary-arrows-active": this.secondaryArrowsActive, "numbered-nav-active": this.numberedNavActive, "page-query-param": this.pageQueryParam, page: +this.page || 1 })), (!this.isLoading) &&
628
673
  h("div", { class: `GridContainerWrapper BlogPage-${this.currentPage} ${this.device}` }, this.displayedBlogResponse && this.displayedBlogResponse.items.map((data) => {
629
674
  var _a, _b;
630
675
  return h("div", { key: data.postID, class: data.isFeaturedPost ? 'GridContainer FeaturedPost' : 'GridContainer' }, h("div", { class: "GridWrapper" }, h("div", { class: "GridSector" }, this.showPublishingDate &&
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["blog-articles-grid_2",[[1,"blog-articles-grid",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"translationUrl":[513,"translation-url"],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showPageTitle":[516,"show-page-title"],"showBreadcrumb":[516,"show-breadcrumb"],"showContent":[516,"show-content"],"showButton":[516,"show-button"],"hideError":[516,"hide-error"],"usePostmessage":[516,"use-postmessage"],"postMessageEvent":[513,"post-message-event"],"blogsLimit":[513,"blogs-limit"],"paginationActive":[516,"pagination-active"],"arrowsActive":[516,"arrows-active"],"secondaryArrowsActive":[516,"secondary-arrows-active"],"numberedNavActive":[516,"numbered-nav-active"],"intlDateTimeFormat":[513,"intl-date-time-format"],"page":[513],"pageQueryParam":[1,"page-query-param"],"eventId":[513,"event-id"],"paginationBlogList":[32],"currentPage":[32],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"nextPage":[32],"previousPage":[32],"device":[32],"displayedBlogResponse":[32],"paginationBlogResponse":[32],"allBlogResponse":[32],"totalBlogs":[32],"customTranslations":[32]},[[8,"BannerMatrixReady","handleBannerReady"],[0,"hpPageChange","hpPageChange"]],{"page":["watchEndpoint"],"hasErrors":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"cmsEnv":["watchEndpoint"],"userRoles":["watchEndpoint"],"blogsLimit":["watchEndpoint"],"eventId":["watchEndpoint"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["loadTranslations"]}],[1,"helper-pagination",{"nextPage":[1537,"next-page"],"prevPage":[1537,"prev-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1537],"mbSource":[1,"mb-source"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[1537,"client-styling-url"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"numberedNavActive":[1540,"numbered-nav-active"],"pageQueryParam":[1,"page-query-param"],"page":[2],"offsetInt":[32],"lastPage":[32],"previousPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
8
+ return bootstrapLazy([["blog-articles-grid_2",[[1,"blog-articles-grid",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"translationUrl":[513,"translation-url"],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showBlogSubcategories":[516,"show-blog-subcategories"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showPageTitle":[516,"show-page-title"],"showBreadcrumb":[516,"show-breadcrumb"],"showContent":[516,"show-content"],"showButton":[516,"show-button"],"hideError":[516,"hide-error"],"usePostmessage":[516,"use-postmessage"],"postMessageEvent":[513,"post-message-event"],"blogsLimit":[513,"blogs-limit"],"paginationActive":[516,"pagination-active"],"arrowsActive":[516,"arrows-active"],"secondaryArrowsActive":[516,"secondary-arrows-active"],"numberedNavActive":[516,"numbered-nav-active"],"intlDateTimeFormat":[513,"intl-date-time-format"],"page":[513],"pageQueryParam":[1,"page-query-param"],"eventId":[513,"event-id"],"paginationBlogList":[32],"currentPage":[32],"hasErrors":[32],"isLoading":[32],"bannerMatrixReady":[32],"nextPage":[32],"previousPage":[32],"device":[32],"displayedBlogResponse":[32],"paginationBlogResponse":[32],"allBlogResponse":[32],"totalBlogs":[32],"customTranslations":[32],"selectedCategory":[32],"categories":[32]},[[8,"BannerMatrixReady","handleBannerReady"],[0,"hpPageChange","hpPageChange"]],{"page":["watchEndpoint"],"hasErrors":["watchEndpoint"],"cmsEndpoint":["watchEndpoint"],"language":["watchEndpoint"],"cmsEnv":["watchEndpoint"],"userRoles":["watchEndpoint"],"blogsLimit":["watchEndpoint"],"eventId":["watchEndpoint"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"],"translationUrl":["loadTranslations"]}],[1,"helper-pagination",{"nextPage":[1537,"next-page"],"prevPage":[1537,"prev-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1537],"mbSource":[1,"mb-source"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[1537,"client-styling-url"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"numberedNavActive":[1540,"numbered-nav-active"],"pageQueryParam":[1,"page-query-param"],"page":[2],"offsetInt":[32],"lastPage":[32],"previousPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -1,7 +1,7 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { type Device } from "../../../../../../libs/common/src/device/index";
3
3
  import "../../../../../../dist/packages/stencil/helper-pagination/dist/types/index";
4
- import type { BlogPost, BlogPostResponse } from '../../utils/type';
4
+ import type { BlogPost, BlogPostResponse, BlogCategory } from '../../utils/type';
5
5
  export declare class BlogArticlesGrid {
6
6
  /**
7
7
  * Endpoint URL for the source of data
@@ -39,6 +39,10 @@ export declare class BlogArticlesGrid {
39
39
  * Property used to display the publishing date
40
40
  */
41
41
  showPublishingDate: boolean;
42
+ /**
43
+ * Property used to display the subcategories filters
44
+ */
45
+ showBlogSubcategories: boolean;
42
46
  /**
43
47
  * Property used to display the image
44
48
  */
@@ -125,6 +129,8 @@ export declare class BlogArticlesGrid {
125
129
  private customTranslations;
126
130
  lastPage: number;
127
131
  private isInitialized;
132
+ selectedCategory: string;
133
+ categories: BlogCategory[];
128
134
  handleBannerReady(): void;
129
135
  watchEndpoint(newValue: string, oldValue: string): void;
130
136
  handleClientStylingChange(newValue: string, oldValue: string): void;
@@ -138,8 +144,10 @@ export declare class BlogArticlesGrid {
138
144
  findLatestFeatured(blogItems: BlogPost[]): BlogPost;
139
145
  moveLatestFeatureToStart(blogItems: BlogPost[], latestFeatured: BlogPost | null): BlogPost[];
140
146
  fetchBlogPosts(page?: number, allPosts?: boolean): Promise<BlogPostResponse>;
147
+ fetchCategories(): Promise<void>;
141
148
  getBlogArticleGrid(forceFetch?: boolean, page?: number): Promise<void>;
142
149
  componentWillLoad(): Promise<void>;
150
+ handleCategoryChange(categoryId: string): Promise<void>;
143
151
  handleClientStyling(): void;
144
152
  componentDidLoad(): void;
145
153
  disconnectedCallback(): void;
@@ -72,6 +72,10 @@ export namespace Components {
72
72
  * Customize pagination: Activate pagination secondary arrows
73
73
  */
74
74
  "secondaryArrowsActive": boolean;
75
+ /**
76
+ * Property used to display the subcategories filters
77
+ */
78
+ "showBlogSubcategories": boolean;
75
79
  /**
76
80
  * Display breadcrumb navigation
77
81
  */
@@ -208,6 +212,10 @@ declare namespace LocalJSX {
208
212
  * Customize pagination: Activate pagination secondary arrows
209
213
  */
210
214
  "secondaryArrowsActive"?: boolean;
215
+ /**
216
+ * Property used to display the subcategories filters
217
+ */
218
+ "showBlogSubcategories"?: boolean;
211
219
  /**
212
220
  * Display breadcrumb navigation
213
221
  */
@@ -40,3 +40,8 @@ export type BlogPost = {
40
40
  };
41
41
  };
42
42
  };
43
+ export type BlogCategory = {
44
+ id: string;
45
+ name: string;
46
+ count: number;
47
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/blog-articles-grid",
3
- "version": "1.98.30",
3
+ "version": "1.99.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",