@griddo/core 10.2.10 → 10.2.12

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.
@@ -6,7 +6,7 @@ type FilterWithSource = Array<{
6
6
  label: string;
7
7
  }>;
8
8
  type FilterFromEndpoint = Record<string, FilterItemFromFilterEndPoint>;
9
- export declare function getOptions(body: Record<string, unknown>): RequestInit;
9
+ export declare function getOptions(body: Record<string, unknown>, langID?: number): RequestInit;
10
10
  export declare function isArrayOfNumbers(arr?: Array<unknown>): arr is Array<number>;
11
11
  export declare function isSimpleFilter(someFilter?: SimpleFilter | FilterWithSource | FilterFromEndpoint): someFilter is Array<number>;
12
12
  export declare function isFilterWithSource(someFilter?: SimpleFilter | FilterWithSource | FilterFromEndpoint): someFilter is FilterWithSource;
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import*as e from"react";import t from"react";function n(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function r(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))}var o={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"faces:center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]};function i(e){return null==e?void 0:e.toString().split(/cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%/)[0]}function a(e){return Object.fromEntries(Object.entries(e).filter((e=>e[1])))}function l(e){var t;const{damId:r,imageConfig:o}=e,l=n(e,["damId","imageConfig"]),s=(c=o,u=l,Object.assign(Object.assign({},a(c)),a(u)));var c,u;const d=s.crop?`c/${s.crop}`:"",p=s.quality?`q/${s.quality}`:"",g=s.format?`f/${s.format}`:"",f=`${d}/${p}/${s.width?`w/${i(s.width)}`:""}/${s.height?`h/${i(s.height)}`:""}/${s.position?`p/${s.position}`:""}/${(null===(t=s.transforms)||void 0===t?void 0:t.length)?`t/${s.transforms}`:""}/${g}`;return function(e){const[t,n]=e.split(/(^https?:\/\/|^\/\/)/).filter(Boolean);return`${t}${null==n?void 0:n.replace(/\/\/+/g,"/").replace(/\/$/,"")}`}(`${o.domain}/${f}/${r}`)}function s(e){return e&&"string"==typeof e?e.split(/(^[http:|https:|\/\/]*[\S][^\/]*)/)[1]:e}function c(e){if(e&&"string"==typeof e){return e.split("/").filter(Boolean).slice(-1)[0]}return e}const u=()=>Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,8);function d(e){return e.global}function p(e,t){const n=[];if((null==t?void 0:t.global)&&n.push(e.global),null==t?void 0:t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return 1===n.length?n[0]:n}const g=e=>{const t={},n=e=>{e.forEach((e=>{e.values.forEach((({cssVar:e,value:n})=>{t[e]=n}))}))};return Array.isArray(e)?n(e):Object.values(e).forEach((e=>{n(e)})),t},f=(e,t)=>e.map((e=>Object.assign(Object.assign({},e),{values:e.values.map((e=>([...e.value.matchAll(/var\((.*?)\)/g)].forEach((n=>{n.length>=2&&(e.value=e.value.replace(n[0],t[n[1]]))})),Object.assign({},e)))).filter((({value:e})=>CSS.supports("color",e)))}))).filter((e=>e.values.length)),m=e=>{const t=(e=>{let t=Object.assign({},g(e.primitives));return"subthemes"in e&&e.subthemes&&e.subthemes.forEach((e=>{t=Object.assign(Object.assign({},t),g(e.primitives))})),t})(e);if(Array.isArray(e.primitives))return f(e.primitives,t);const{common:n,light:r,dark:o}=e.primitives;return{common:n&&f(n,t),light:f(r,t),dark:f(o,t)}},v=(e,t)=>e.filter((e=>Array.isArray(t)?t.includes(e.id):e.id===t)),h=(e,t)=>{if(Array.isArray(e.primitives))return v(e.primitives,t);const{common:n,light:r,dark:o}=e.primitives;return{common:n&&v(n,t),light:v(r,t),dark:v(o,t)}},b=e=>{if(Array.isArray(e.primitives))return e.primitives.length;const{common:t,light:n,dark:r}=e.primitives;return(null==t?void 0:t.length)||n.length||r.length},y=(e,t,n)=>{const r=void 0===n;return e.map((e=>Object.assign(Object.assign({},e),{primitives:r?m(e):h(e,n),subthemes:"subthemes"in e&&e.subthemes&&e.subthemes.map((e=>Object.assign(Object.assign({},e),{primitives:r?m(e):h(e,n)}))).filter((e=>b(e)&&(!t||e.id===t)))||[]}))).filter((e=>b(e)||e.subthemes.length))},O=(e,t,n)=>y(e,n,t),j=(e,t)=>y(e,t);function S(e,t){const n=[];if((null==t?void 0:t.global)&&n.push(e.global),null==t?void 0:t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return j(n,null==t?void 0:t.subtheme)}function $(e,t){const n=[],{global:r,primitive:o,subtheme:i}=t;if(r&&n.push(e.global),t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return O(n,o,i)}function E(e,t){return $(e,Object.assign(Object.assign({},t),{primitive:["fontFamily","fontSize"]}))}const w=e.createContext({translations:{}});function x(t){const{children:n,translations:r}=t;return e.createElement(w.Provider,{value:{translations:r}},n)}const k={linkComponent:function(t){const{children:r}=t,o=n(t,["children"]);return e.createElement("a",Object.assign({"data-griddo":"link"},o),r)},navigate:()=>null},I=e.createContext(k);function _(t){const{children:r}=t,o=n(t,["children"]),i=Object.assign(Object.assign({},k),o);return e.createElement(I.Provider,{value:i},r)}const L=e.createContext({});function C(t){const{children:r}=t,o=n(t,["children"]),i=e.useContext(I),a=null==i?void 0:i.translations;return e.createElement(L.Provider,{value:Object.assign({},o)},e.createElement(x,{translations:a},r))}function P(){var t,n;const r=e.useContext(L);if(!r)return console.warn("Griddo: You forgot to put <PageProvider>."),{};const o=null===(t=r.pageLanguages)||void 0===t?void 0:t.filter((e=>e.isLive)),i=null===(n=r.pageLanguages)||void 0===n?void 0:n.find((e=>e.languageId===r.languageId)),a=null==i?void 0:i.locale,l=null==i?void 0:i.locale.replace("_","-");return Object.assign(Object.assign({},r),{pageLanguages:o,locale:a,ISOLocale:l})}const z="undefined"!=typeof window;function U(e,t){return(null==t?void 0:t.startsWith(`${e}#`))?`#${t.split("#")[1]}`:t}function N(){const e=localStorage.getItem("persist:app");if(!e||!z)return null;const t=JSON.parse(e);let{token:n}=t;n=JSON.parse(n);return{Authorization:`bearer ${n}`}}function q(){var e;const t=localStorage.getItem("persist:root");if(!z||!t)return 1;const n=JSON.parse(t);let{sites:r}=n;r=JSON.parse(r);return null===(e=r.currentSiteInfo)||void 0===e?void 0:e.id}function A(){const e=localStorage.getItem("langID");return!(!z||!e)&&parseInt(e)}function R({obj:e,searchKey:t,resultsBuffer:n=[],unique:r=!0}={}){if(!e)return[];const o=n;return Object.keys(e).forEach((n=>{const r=e[n];n===t&&"object"!=typeof r?o.push(r):"object"==typeof r&&r&&R({obj:r,searchKey:t,resultsBuffer:o})})),r?[...new Set(o)]:o}function T({baseUrl:e,params:t}){const n=Object.keys(t).map((e=>function(e){return Array.isArray(e)&&e.length>0||"number"==typeof e||"string"==typeof e&&!!e}(t[e])?`${e}/${t[e]}`:"")).join("/");return`${e}${r=n,r.split("/").filter(Boolean).join("/")}`;var r}function D(e){const t=A();return{method:"POST",mode:"cors",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json",lang:null==t?void 0:t.toString()},N()),redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(e)}}function F(e){return!!e&&e.every((e=>"number"==typeof e))}function M(e){return Array.isArray(e)&&F(e)}function B(e){return Array.isArray(e)&&!F(e)}function H(e){return!M(e)&&!B(e)}function G(e){if(!e)return;const t=e?e.reduce(((e,t)=>{const{source:n,id:r}=t;return e[n]||(e[n]=[]),e[n].push(r),e}),{}):{};return Object.keys(t).map((e=>`${e}:${t[e]}`)).join(";")}function V(e){return null==e?void 0:e.join(",")}function J(e){const t=[];for(const n in e){e[n].items.forEach((e=>{t.push({id:e.id,label:e.label,source:n})}))}return G(t)}function W(e){return!!e&&["or","and"].includes(e.toLowerCase())}function K(e){return"boolean"==typeof e?e?"simple":"off":"off"===e||"simple"===e||"full"===e?e:"off"}function Y(t){const[n,r]=e.useState(null),{order:o,quantity:i,source:a,mode:l,fixed:s,filter:c,allLanguages:u,preferenceLanguage:d,fullRelations:p=!1,filterOperator:g="OR",globalOperator:f="AND"}=t||{},{apiUrl:m}=P();return e.useEffect((()=>{const e=!!A(),t=q()||"global",n=`${m}/site/${t}/distributor`,v=D("auto"===l?{mode:l,order:o,quantity:i,source:a,filter:c,fullRelations:p,allLanguages:u,preferenceLanguage:d,filterOperator:g,globalOperator:f}:{mode:l,fixed:s,fullRelations:p});e&&fetch(n,v).then((e=>e.json())).then((e=>r(e))).catch((e=>{console.error("Error:",e)}))}),[l,o,i,s,c,a,p,u,d,g,f]),n}function Z({data:e,queriedData:t}){return e&&Y(e)||t}function Q(t){const[n,r]=e.useState({previous:[],next:[],error:void 0}),{apiUrl:o,canonicalSite:i,structuredDataContent:a}=P(),{order:l="recent-asc",quantity:s=1,fullRelations:c=!1,referenceId:u=(null==a?void 0:a.id)}=t||{};return e.useEffect((()=>{const e=!!A(),t=q()||i||"global",n=`${o}/site/${t}/distributor`,a=D({mode:"navigation",order:l,quantity:s,fullRelations:c,referenceId:u});e&&fetch(n,a).then((e=>e.json())).then((e=>r(e))).catch((e=>{console.error("Error:",e)}))}),[l,s,c,u]),n}function X(t){const[n,r]=e.useState(),[o,i]=e.useState(!0),[a,l]=e.useState(!1),[s,c]=e.useState(!0),[u,d]=e.useState({});return e.useEffect((()=>{t&&(i(!0),fetch(t).then((e=>{if(c(!1),200!==e.status)throw i(!1),l(!0),d({code:e.status,msg:e.statusText}),new Error(e.statusText);return e.json()})).then((e=>{r(e)})).finally((()=>{i(!1),l(!1)})).catch((()=>{l(!0)})))}),[t]),{data:n,isLoading:o,isError:a,isFirstFetch:s,msg:u}}const ee=e.createContext(null);function te(t){return e.createElement(ee.Provider,{value:{isNavigation:!0}},t.children)}const ne=t.createContext([{},()=>null]),re=e=>{const{children:n}=e,r=oe();return t.createElement(ne.Provider,{value:r},n)},oe=()=>{const[e,n]=t.useState({});return[e,e=>n((t=>Object.assign(Object.assign({},t),e)))]},ie=()=>e.useContext(I);function ae(){const{publicApiUrl:t,siteId:n,renderer:r}=ie(),{languageId:o}=P(),[i,a]=e.useState(),l="editor"===r;const{isError:s,isLoading:c,msg:u,data:d,isFirstFetch:p}=X(null==i?void 0:i.queryUrl);return[{query:d,isLoading:c,isError:s,msg:u,isFirstFetch:p},function({apiUrl:e=`${t}`,cached:r,data:i,lang:s=o,site:c=n}){if(!i)return;const u=l?(new Date).valueOf():r,d=T({baseUrl:`${e}/filters/${`${i.source||i.fixed}/`}`,params:{site:c,lang:s,related:(p=i.related,"number"==typeof p?p:M(p)?V(p):B(p)?G(p):H(p)?J(p):void 0),allLanguages:i.allLanguages?"on":"off",filterOperator:i.filterOperator,globalOperator:i.globalOperator,cached:u}});var p;a({queryUrl:d})}]}const le={jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",png:"image/png",avif:"image/avif",webp:"image/webp"},se={quality:75,crop:"cover",loading:"lazy",decoding:"auto",blurSize:"8px",blurCSSTransition:"filter 0s ease-in-out",formats:["webp"]};function ce(t){var{url:r}=t,o=n(t,["url"]);if(!r)return{};const a=e.useContext(I),u=(null==a?void 0:a.griddoDamDefaults)||{},d=s(r),p=c(r),g=Object.assign(Object.assign(Object.assign(Object.assign({},se),u),o),{format:"jpeg",domain:d});void 0===g.responsive&&(g.responsive=[{width:g.width,height:g.height,quality:g.quality,crop:g.crop,position:g.position,transforms:g.transforms}]);const f=g.responsive.map((({width:e,height:t,quality:n,crop:r,position:o,transforms:a})=>`${l({damId:p,imageConfig:g,quality:n,crop:r,width:e,height:t,position:o,transforms:a})} ${e?`${i(e)}w`:""}`.trim())),m=function(e){const t=e.filter((e=>null===e.breakpoint));return[...e.filter((e=>null!==e.breakpoint)),...t]}(g.responsive.reverse()).map(((e,t)=>g.responsive&&t<g.responsive.length-1?`(min-width: ${e.breakpoint}) ${e.width}`:`${e.width}`)).join(", "),v=f.map((e=>null==e?void 0:e.split(" ")[0])),h=g.responsive[0],b=`${l(Object.assign({damId:p,imageConfig:g},h))}`;return{type:(null==g?void 0:g.format)?le[null==g?void 0:g.format]:le.jpeg,srcSet:f,srcSetURL:v,src:b,sizes:m,webpFallback:ue({srcSet:f,srcSetURL:v,format:"jpeg"}),jpeg:ue({srcSet:f,srcSetURL:v,format:"jpeg"}),webp:ue({srcSet:f,srcSetURL:v,format:"webp"}),avif:ue({srcSet:f,srcSetURL:v,format:"avif"}),png:ue({srcSet:f,srcSetURL:v,format:"png"}),gif:ue({srcSet:f,srcSetURL:v,format:"gif"}),svg:ue({srcSet:f,srcSetURL:v,format:"svg"})}}function ue({srcSet:e,srcSetURL:t,format:n}){return{type:le[n],srcSet:null==e?void 0:e.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`))),srcSetURL:null==t?void 0:t.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`)))}}function de(t){const n=null==t?void 0:t.locale,r=e.useContext(w),{siteLangs:o}=ie(),{languageId:i}=P(),a=null==r?void 0:r.translations;a||console.warn("Griddo: <SiteProvider> needs to have the prop translations"),void 0===o&&console.warn("Griddo: <SiteProvider> needs to have the prop siteLangs set with the site languages"),i||console.warn("Griddo: <PageProvider> needs to have the prop languageId set with the page language id"),function(e,t){return!!(null==e?void 0:e.find((e=>e.id===t)))}(o,i)||console.warn(`Griddo: languageId ${i} doesn't exist in this site`),void 0===n||function(e,t){return!!(null==e?void 0:e.find((e=>(null==e?void 0:e.locale)===t)))}(o,n)||console.warn(`Griddo: locale ${n} doesn't exist in this site`);const l=n||function(e,t){var n;return null===(n=null==e?void 0:e.find((e=>e.id===t)))||void 0===n?void 0:n.locale}(o,i),s=a&&l?a[l]:void 0;return l&&i||console.warn("Griddo: You forgot to put <I18nProvider> or exists an error in language id."),{getTranslation:(e,t="")=>s&&s[e]?s[e]:t,getNestedTranslation:(e,t="")=>s&&function(e,t){const n=null==e?void 0:e.split(".").reduce(((e,t)=>e[t]?e[t]:""),t);return n}(e,s)||t}}const pe={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]};function ge(e){var t,r,{publicId:o}=e,a=n(e,["publicId"]);const{cloudinaryCloudName:l,cloudinaryDefaults:s}=ie(),c=Object.assign(Object.assign(Object.assign({},pe),s),a),u=`${c.domain}/${l}/${c.uploadFolder}`,d=`${fe({root:u,imageConfig:Object.assign(Object.assign({},c),{quality:20,width:"512"})})}/${c.fallback404ImageId}`,p=null===(t=null==c?void 0:c.responsive)||void 0===t?void 0:t.map((({width:e,height:t,quality:n,crop:r})=>`${fe({root:u,imageConfig:Object.assign({quality:n,crop:r,width:e,height:t},c)})}/${o} ${i(e)}w`)),g=function(e){if(!e)return[];const t=e.filter((e=>null===e.breakpoint));return[...e.filter((e=>null!==e.breakpoint)),...t]}(null===(r=null==c?void 0:c.responsive)||void 0===r?void 0:r.reverse()).map(((e,t)=>{var n;return c.responsive&&t<(null===(n=null==c?void 0:c.responsive)||void 0===n?void 0:n.length)-1?`(min-width: ${e.breakpoint}) ${e.width}`:`${e.width}`})).join(", "),f=null==p?void 0:p.map((e=>e.split(" ")[0])),m=(null==c?void 0:c.responsive)&&(null==c?void 0:c.responsive[0])||[];return{src:`${fe(Object.assign({root:u,imageConfig:c},m))}/${o}`,srcSet:p,sizes:g,fallbackSrcImage:d,srcSetURL:f}}function fe(e){const{root:t,imageConfig:n}=e,r=(null==n?void 0:n.crop)?`c_${n.crop}`:"",o=(null==n?void 0:n.quality)?`q_${n.quality}`:"",a=(null==n?void 0:n.gravity)?`g_${n.gravity}`:"",l=(null==n?void 0:n.format)?`f_${n.format}`:"",s=(null==n?void 0:n.width)?`w_${i(n.width)}`:"",c=(null==n?void 0:n.height)?`h_${i(n.height)}`:"",u=(null==n?void 0:n.ar)?`ar_${n.ar}`:"";return`${t}/${`${r},${a},${l},${o},${s},${c},${u}`.split(/._null|._undefined|,{1,}|._,|._$|undefined|null/).filter(Boolean).join(",")}`}function me(){const[t,n]=e.useState(!1);return e.useEffect((()=>{n(!0)}),[]),t}function ve(){const t=e.useRef(!0);return t.current?(t.current=!1,!0):t.current}function he(){const t=e.useContext(I);return null==t?void 0:t.linkComponent}function be(){const{publicApiUrl:t,siteId:n,renderer:r}=ie(),{languageId:o}=P(),[i,a]=e.useState(),l="editor"===r;const{isError:s,isLoading:c,msg:u,data:d,isFirstFetch:p}=X(null==i?void 0:i.queryUrl);return[{query:d,isLoading:c,isError:s,msg:u,isFirstFetch:p},function({apiUrl:e=`${t}`,cached:r,data:i,exclude:s,fields:c,filterIds:u,filterOperator:d,globalOperator:p,items:g=10,lang:f=o,operator:m,page:v=1,relations:h,search:b,site:y=n,includePending:O,allLanguages:j,preferenceLanguage:S}){var $;if(!i)return;const E=l?(new Date).valueOf().toString():r,w=null==b?void 0:b.replace(/\s/g,"+"),x="auto"===i.mode,k="manual"===i.mode,I="navigation"===i.mode,_=i.source||i.fixed||`reference/${i.referenceId}`||[],L=T({baseUrl:`${e}${x?"/list/":k?"/list/fixed/":I?"/list/navigations/":""}${_}/`,params:{site:y,lang:f,get:c,page:v,items:g,order:x||I?i.order:void 0,filter:(C=u||i.filter,M(C)?V(C):B(C)?G(C):H(C)?J(C):void 0),maxItems:i.quantity,search:w,operator:W(m)?m:void 0,filterOperator:W(d)?d:void 0,globalOperator:W(p)?p:void 0,exclude:Array.isArray(s)?s:void 0,relations:K(h),includePending:O?"on":void 0,allLanguages:j?"on":void 0,preferenceLanguage:S?"true":void 0,cached:E}});var C;k&&Array.isArray(_)&&_.length<1&&a({queryUrl:void 0,extra:void 0}),a({queryUrl:L,extra:{totalItems:"manual"===i.mode&&(null===($=i.fixed)||void 0===$?void 0:$.length)}})}]}function ye(e){const{items:t,queriedData:n,fields:r,page:o}=e,[{isError:i,isLoading:a,msg:l,query:s,isFirstFetch:c},u]=be(),d={page:o||1,totalItems:null==n?void 0:n.length,totalPages:(null==n?void 0:n.length)&&t&&Math.ceil((null==n?void 0:n.length)/t),items:null==n?void 0:n.slice(0,t||10).map((e=>Object.assign({id:e.id},function(e,t){if(e)return t?Object.fromEntries(Object.keys(e).map((n=>(null==t?void 0:t.includes(n))&&[n,e[n]])).filter(Boolean)):e}(e.content,r))))};return[{isError:i,isLoading:a,msg:l,isFirstFetch:c,query:(s?Object.assign(Object.assign({},s),{totalPages:t&&(null==s?void 0:s.totalItems)&&Math.ceil((null==s?void 0:s.totalItems)/t)}):void 0)||d},u]}function Oe(){return e.useContext(ee)}const je={};function Se(t,n){const[r,o]=e.useState((()=>{var e;return!t||(null==n?void 0:n.shouldPreventLoad)?"idle":"undefined"==typeof window?"loading":null!==(e=je[t])&&void 0!==e?e:"loading"}));return e.useEffect((()=>{var e,r;if(!t||(null==n?void 0:n.shouldPreventLoad))return;const i=je[t];if("ready"===i||"error"===i)return void o(i);const a=function(e){const t=document.querySelector(`script[src="${e}"]`),n=null==t?void 0:t.getAttribute("data-status");return{node:t,status:n}}(t);let l=a.node;if(l)o(null!==(r=null!==(e=a.status)&&void 0!==e?e:i)&&void 0!==r?r:"loading");else{l=document.createElement("script"),l.src=t,l.async=!0,l.setAttribute("data-status","loading"),document.body.appendChild(l);const e=e=>{const t="load"===e.type?"ready":"error";null==l||l.setAttribute("data-status",t)};l.addEventListener("load",e),l.addEventListener("error",e)}const s=e=>{const n="load"===e.type?"ready":"error";o(n),je[t]=n};return l.addEventListener("load",s),l.addEventListener("error",s),()=>{l&&(l.removeEventListener("load",s),l.removeEventListener("error",s)),l&&(null==n?void 0:n.removeOnUnmount)&&l.remove()}}),[t,null==n?void 0:n.shouldPreventLoad,null==n?void 0:n.removeOnUnmount]),r}const $e=()=>t.useContext(ne);function Ee(){const[t,n]=e.useState(),[o,i]=e.useState(!0),{apiUrl:a,header:l,footer:s,fullPath:c}=P(),{siteMetadata:u}=ie();e.useEffect((()=>{d()}),[]);const d=()=>r(this,void 0,void 0,(function*(){var e,t,r;const o={};if(o.topMenu=[{label:null==u?void 0:u.title,children:null===(e=l.topMenu)||void 0===e?void 0:e.elements,url:{linkToURL:!!c&&`${c.domainUrl}${c.site}`}}],!u){const e=q(),t=`${a}/site/${e}`,n=yield fetch(t,function(){const e=A();return{method:"GET",mode:"cors",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json",lang:e},N())}}()),{name:r}=yield n.json();o.topMenu[0].label=r,o.siteName=r}o.mainMenu=null===(t=null==l?void 0:l.mainMenu)||void 0===t?void 0:t.elements;const d=null===(r=null==s?void 0:s.legalMenu)||void 0===r?void 0:r.elements;o.footerMenu=[{label:null,children:d}],o.header=l,o.footer=s,n(o),i(!1)}));return[t,o]}function we(){const e="undefined"!=typeof window&&window.document&&window.document.documentElement;return{isBrowser:e,isServer:!e}}function xe(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}function ke(t){var{backgroundRepeat:r="no-repeat",backgroundSize:i="cover",backgroundPosition:a="50% 50%",children:l,overlayColor:s=null,overlayOpacity:c=0,overlayTransition:d="2s",ratio:p,publicId:g,src:f,customLazyClassName:m="lazy",lazy:v}=t,h=n(t,["backgroundRepeat","backgroundSize","backgroundPosition","children","overlayColor","overlayOpacity","overlayTransition","ratio","publicId","src","customLazyClassName","lazy"]);const{cloudinaryDefaults:b}=ie(),y=Object.assign(Object.assign(Object.assign(Object.assign({},b),o),h),{backgroundLazy:b.backgroundLazy||o.backgroundLazy||v}),{srcSetURL:O}=ge({responsive:[...y.responsive],quality:y.quality,crop:y.crop,gravity:y.gravity,format:y.format,publicId:g,ar:p}),j=f?[f]:O,S=f?[]:y.responsive.map((e=>e.breakpoint)),$=`Griddo-BgImage--${u()}`,E=y.backgroundLazy?m:"",w=function(e,t=0){return Array(e).fill(0).map(((e,n)=>n+t))}(j.length-1,1).map((e=>`@media (min-width: ${S[e]}) {\n .${$} {\n background-image: url(${j[e]});\n }\n }\n `)).join("");return e.createElement(e.Fragment,null,e.createElement("style",{dangerouslySetInnerHTML:{__html:`\n\n .${$} {\n background-repeat: ${r};\n background-position: ${a};\n background-size: ${i};\n background-image: url(${j[0]});\n }\n\n ${w}\n\n .${$}::before {\n transition: all ${d} ease;\n background-color: rgba(0, 0, 0, ${c});\n ${s?`\n background-color: ${s};\n opacity: ${c};\n `:""}\n }`}}),e.createElement("div",{className:`Griddo-BgImage ${$} ${E}`},l))}function Ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _e(e,t){return e(t={exports:{}},t.exports),t.exports}xe('.Griddo-BgImage {\n\tdisplay: flex;\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.Griddo-BgImage::before {\n\tz-index: 0;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tcontent: "";\n\tdisplay: block;\n}\n\n.Griddo-BgImage.lazy {\n\tbackground-image: none;\n}\n');var Le=Symbol.for("react.element"),Ce=Symbol.for("react.fragment"),Pe=Object.prototype.hasOwnProperty,ze=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ue={key:!0,ref:!0,__self:!0,__source:!0};function Ne(e,t,n){var r,o={},i=null,a=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(a=t.ref),t)Pe.call(t,r)&&!Ue.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:Le,type:e,key:i,ref:a,props:o,_owner:ze.current}}var qe={Fragment:Ce,jsx:Ne,jsxs:Ne},Ae=_e((function(e){e.exports=qe})),Re=_e((function(e,n){n.__esModule=!0,n.default=void 0;var r=["className","children","ratio","style"];function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var i="--aspect-ratio";class a extends t.Component{constructor(){super(...arguments),this.node=null,this.setNode=e=>{this.node=e}}componentDidUpdate(){if(this.node){var{node:e}=this;e.style.getPropertyValue(i)||e.style.setProperty(i,"("+this.props.ratio+")")}}render(){var e=this.props,{className:t,children:n,ratio:a,style:l}=e,s=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,r),c=o({},l,{[i]:"("+a+")"});return(0,Ae.jsx)("div",o({className:t,ref:this.setNode,style:c},s,{children:n}))}}a.defaultProps={className:"react-aspect-ratio-placeholder",ratio:1};var l=a;n.default=l}));Ie(Re);var Te=_e((function(e,t){t.__esModule=!0,t.default=void 0;var n=["className","children","ratio","style"];function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}var o="--aspect-ratio",i="react-aspect-ratio-placeholder";var a=function(e){var{className:t=i,children:a,ratio:l=1,style:s}=e,c=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,n),u=r({},s,{[o]:"("+l+")"});return(0,Ae.jsx)("div",r({className:t,style:u},c,{children:a}))};t.default=a}));Ie(Te);var De=_e((function(e,t){t.__esModule=!0,t.default=t.AspectRatio=void 0;var n=o(Re),r=o(Te);function o(e){return e&&e.__esModule?e:{default:e}}var i=n.default;t.default=i;var a=r.default;t.AspectRatio=a}));Ie(De);var Fe=De.AspectRatio;function Me(t){const{alt:n,width:r,height:i,ratio:a,fixed:l,publicId:s,src:c,objectFit:u="cover"}=t,{cloudinaryDefaults:d}=ie(),p=Object.assign(Object.assign(Object.assign({},o),d),t),{srcSet:g,sizes:f,src:m}=ge({crop:p.crop,format:p.format,gravity:p.gravity,quality:p.quality,sizes:p.sizes,responsive:p.responsive,ar:a,publicId:s}),v={alt:n,width:r,height:i,loading:p.loading,style:{objectFit:u},decoding:p.decoding},h=Object.assign(Object.assign({},v),{src:c}),b=Object.assign(Object.assign({},v),{srcSet:g,sizes:f,src:m}),y=c?h:b,O=()=>e.createElement("img",Object.assign({},y));return l?e.createElement(O,null):e.createElement(Fe,{ratio:a||1,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(O,null))}xe('[style*="--aspect-ratio"] > img {\n height: auto;\n}\n\n[style*="--aspect-ratio"] {\n position: relative;\n}\n\n[style*="--aspect-ratio"] > :first-child {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n}\n\n[style*="--aspect-ratio"]::before {\n content: "";\n display: block;\n width: 100%;\n}\n\n@supports not (aspect-ratio: 1/1) {\n [style*="--aspect-ratio"]::before {\n height: 0;\n padding-bottom: calc(100% / (var(--aspect-ratio)));\n }\n}\n\n@supports (aspect-ratio: 1/1) {\n [style*="--aspect-ratio"]::before {\n aspect-ratio: calc(var(--aspect-ratio));\n }\n}\n');const Be=t=>e.createElement("svg",Object.assign({width:24,height:24,fill:"none"},t),e.createElement("path",{d:"M16 9v10H8V9h8zm-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"})),He=t=>e.createElement("svg",Object.assign({width:24,height:24,fill:"none"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5263 2.3158H4.78947C3.80526 2.3158 3 3.12106 3 4.10527V16.6316H4.78947V4.10527H15.5263V2.3158ZM18.2105 5.89475H8.36842C7.38421 5.89475 6.57894 6.70001 6.57894 7.68422V20.2105C6.57894 21.1947 7.38421 22 8.36842 22H18.2105C19.1947 22 20 21.1947 20 20.2105V7.68422C20 6.70001 19.1947 5.89475 18.2105 5.89475ZM8.36843 20.2105H18.2105V7.68422H8.36843V20.2105Z"}));xe('.--not-selected-nameplate {\n\tdisplay: none;\n}\n\n.--selected,\n.--selected-header-footer,\n.--selected-nameplate {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.--selected-header-footer::before,\n.--selected::before {\n\tposition: absolute;\n\theight: calc(100% - 8px);\n\twidth: calc(100% - 8px);\n\tpadding-bottom: 4px;\n\tcontent: "";\n\tborder: 4px solid rgb(80, 87, 255);\n\tpointer-events: none;\n\tz-index: 99;\n}\n\n.--selected-header-footer::after {\n\tposition: absolute;\n\tpadding: 8px 16px;\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\ttop: -34px;\n\tleft: 50%;\n\ttransform: translate(-50%, 0px);\n\tcontent: attr(data-text);\n\tz-index: 9;\n\tbackground: rgb(80, 87, 255);\n\tcolor: rgb(255, 255, 255);\n\tfont-family: "Source Sans Pro", sans-serif;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tline-height: 18px;\n}\n\n.--selected-nameplate {\n\tdisplay: flex;\n\talign-items: center;\n\tposition: absolute;\n\tpadding: 4px 16px;\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\ttop: -34px;\n\tleft: 50%;\n\ttransform: translate(-50%, 0px);\n\tz-index: 9;\n\tbackground: rgb(80, 87, 255);\n\tcolor: rgb(255, 255, 255);\n\tfont-family: "Source Sans Pro", sans-serif;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tline-height: 18px;\n\ttext-align: center;\n}\n\n.span-svg-action {\n\tpadding-left: 4px;\n}\n\n.span-svg-action:first-child {\n\tpadding-left: 16px;\n}\n\n.svg-action {\n\tfill: #dadada;\n}\n\n.svg-action:hover {\n\tfill: #fff;\n\tcursor: pointer;\n}\n');const Ge=t=>{const n=e.useRef(null),[r,o]=e.useState(0),{selectEditorID:i,moduleActions:a}=e.useContext(I),{selectedEditorID:l,editorID:s,component:c,children:u,isSelectionAllowed:d,type:p}=t,g=!!p&&["header","footer"].includes(p);e.useEffect((()=>{n&&n.current&&o(n.current.scrollHeight)}),[u]),e.useEffect((()=>{v&&m()}),[n]);const f=e=>{(s||0===s)&&"undefined"!=typeof window&&d&&i&&i(t,void 0,e)},m=()=>{if(!n.current)return;const e=n.current.style.position,t=n.current.style.top;n.current.style.position="relative",n.current.style.top="-34px",n.current.scrollIntoView({behavior:"smooth",block:"nearest"}),n.current.style.top=t,n.current.style.position=e;0===n.current.offsetTop&&(n.current.style.marginTop="36px")},v=!!l&&l===s;v&&m();return e.createElement(e.Fragment,null,"Header"===c&&e.createElement("style",{dangerouslySetInnerHTML:{__html:`\n [data-text="Header"].--selected::before {\n height: ${r-8}px;\n }`}}),g&&e.createElement("span",{className:""+(v?"--selected-header-footer":""),"data-text":c,ref:n,onClick:f},u),!g&&e.createElement("span",{className:""+(v?"--selected":""),"data-text":c,ref:n,onClick:f},e.createElement("span",{className:""+(v?"--selected-nameplate":"--not-selected-nameplate")},c,e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.duplicateModuleAction(s)}},e.createElement(He,{className:"svg-action"})),e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.deleteModuleAction(s)}},e.createElement(Be,{className:"svg-action"}))),u))},Ve=(e,t)=>{const n=t.component;return void 0!==e[n]?e[n]:(console.warn(`The component <${n}> doesn't exist inside ${JSON.stringify(Object.keys(e))}`),null)};function Je(t){var r,{libComponents:o}=t,i=n(t,["libComponents"]);const{component:a,editorID:l,type:s="",parentEditorID:c}=i,{renderer:u}=ie(),d=null===(r=Oe())||void 0===r?void 0:r.isNavigation,p="undefined"!=typeof window?parseInt(localStorage.getItem("selectedID")||"0"):null,g=Ve(o,Object.assign({},i)),f=d&&!["header","footer"].includes(s);return"editor"===u?e.createElement(re,null,e.createElement(Ge,{selectedEditorID:p,isSelectionAllowed:!f,editorID:l,component:a,type:s,parentEditorID:c},g?e.createElement(g,Object.assign({},i)):e.createElement(e.Fragment,null))):"preview"===u?e.createElement(re,null,g&&e.createElement(g,Object.assign({},i))):g&&e.createElement(g,Object.assign({},i))}xe('.griddo-background-image {\n\tdisplay: flex;\n\twidth: 100%;\n\theight: 100%;\n\n\tposition: relative;\n\n\tbackground-repeat: no-repeat;\n\tbackground-size: cover;\n\tbackground-position: 50% 50%;\n}\n\n.griddo-background-image--lazy .griddo-background-image {\n\tbackground: none !important;\n}\n\n.griddo-background-image::before {\n\tz-index: 0;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tcontent: "";\n\tdisplay: block;\n\ttransition: all var(--veil-transition-time) var(--veil-transition-easing);\n\tbackground-color: var(--veil-opacity);\n}\n');const We="griddo-background-image--lazy",Ke=e.forwardRef((({children:t,format:n,backgroundSize:r,veilOpacity:o=.5,veilColor:i="#000033",veilTransitionTime:a="2s",veilTransitionEasing:u="easing",url:d,src:p,responsive:g,className:f,style:m,quality:v,lazyOffset:h="200px",loading:b},y)=>{const{griddoDamDefaults:O}=ie(),j=e.useRef(null),S=s(d);e.useEffect((()=>{var e;if(IntersectionObserver){if(j.current){let e=new IntersectionObserver((t=>t.forEach((t=>{var n;t.isIntersecting&&(null===(n=j.current)||void 0===n||n.classList.remove(We),e=e.disconnect())}))),{rootMargin:`0px 0px ${h} 0px`});return e.observe(j.current),()=>e=e&&e.disconnect()}}else null===(e=j.current)||void 0===e||e.classList.remove(We)}),[]);const $=g&&Object.fromEntries(Object.keys(g).map((e=>[e,{url:`url("${l({damId:c(d),imageConfig:Object.assign(Object.assign(Object.assign({},O),{quality:v,format:n,domain:S}),g[e])})}")`,customProperty:g[e].customProperty}]))),E=g&&Object.fromEntries(Object.keys(g).map(((e,t)=>[$[e].customProperty?`${$[e].customProperty}`:`--image-${t}`,$[e].url]))),w=p?{"--image-default":`url(${p})`}:E;return e.createElement("div",{ref:j,"data-griddo":"loading-ref",className:`${"lazy"===b?We:""}`},e.createElement("div",{"data-griddo":"image-ref",ref:y,className:`${f} griddo-background-image`,style:Object.assign(Object.assign(Object.assign({},m),{"--veil-opacity":`${i}${Math.round(255/(1/o)).toString(16)}`,"--veil-transition-time":a,"--veil-transition-easing":u,"--background-size":r}),w)},t))}));xe('[style*="--aspect-ratio"] [data-image="griddo"] {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 100%;\n\twidth: 100%;\n\tobject-fit: cover;\n}\n');const Ye=e.forwardRef(((t,r)=>{var{width:o,height:i,ratio:a,fixed:l,url:s,loading:c,decoding:u,responsive:d,quality:p,crop:g,format:f,formats:m,position:v,transforms:h}=t,b=n(t,["width","height","ratio","fixed","url","loading","decoding","responsive","quality","crop","format","formats","position","transforms"]);if(!s)return null;const{griddoDamDefaults:y}=ie()||{},O={loading:c||(null==y?void 0:y.loading),decoding:u||(null==y?void 0:y.decoding),quality:p||(null==y?void 0:y.quality),crop:g||(null==y?void 0:y.crop),format:f,formats:m||(null==y?void 0:y.formats),position:v,transforms:h},{src:j,sizes:S,avif:$,jpeg:E,gif:w,webp:x,svg:k}=ce({url:s,crop:O.crop,format:O.format,quality:O.quality,responsive:d,position:O.position,transforms:O.transforms,width:o,height:i}),I=()=>{var t;return e.createElement("img",Object.assign({"data-image":"griddo",loading:c||O.loading,decoding:u||O.decoding,srcSet:d&&(null===(t=null==w?void 0:w.srcSet)||void 0===t?void 0:t.join(",")),sizes:d&&S,src:(null==w?void 0:w.srcSetURL)&&w.srcSetURL[0],width:o,height:i,fetchpriority:b.fetchpriority},b))},_=()=>e.createElement("img",Object.assign({"data-image":"griddo",loading:c||O.loading,decoding:u||O.decoding,src:(null==k?void 0:k.srcSetURL)&&k.srcSetURL[0],width:o,height:i,fetchpriority:b.fetchpriority},b)),L=()=>{var t,n,a,l,s;return e.createElement("picture",{ref:r},(null===(t=O.formats)||void 0===t?void 0:t.includes("avif"))&&e.createElement("source",{srcSet:null===(n=null==$?void 0:$.srcSet)||void 0===n?void 0:n.join(","),sizes:d&&S,type:"image/avif"}),(null===(a=O.formats)||void 0===a?void 0:a.includes("webp"))&&e.createElement("source",{srcSet:null===(l=null==x?void 0:x.srcSet)||void 0===l?void 0:l.join(","),sizes:d&&S,type:"image/webp"}),e.createElement("img",Object.assign({"data-image":"griddo",loading:c||O.loading,decoding:u||O.decoding,sizes:d&&S,srcSet:null===(s=null==E?void 0:E.srcSet)||void 0===s?void 0:s.join(","),src:j,width:o,height:i,fetchpriority:b.fetchpriority},b)))};return s?"svg"===f?e.createElement(_,null):"gif"===f?e.createElement(I,null):l||!d?e.createElement(L,null):e.createElement(Fe,{ratio:a||1,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(L,null)):null})),Ze={pre:"pre",pro:"pro"};function Qe(t){var{activeClassName:r="",activeStyle:o={},style:i={},children:a,getProps:l,partiallyActive:s,state:c,url:u,title:d,className:p=""}=t,g=n(t,["activeClassName","activeStyle","style","children","getProps","partiallyActive","state","url","title","className"]);const{renderer:f,linkComponent:m}=ie(),{fullPath:v}=P(),h="editor"===f,b=null==u?void 0:u.href,y=null==u?void 0:u.linkToURL,O=(null==u?void 0:u.newTab)||!1,j=(null==u?void 0:u.noFollow)||!1,S=!(null==u?void 0:u.linkToURL)&&!(null==u?void 0:u.href),$=y===`${null==v?void 0:v.domainUrl}${null==v?void 0:v.compose}`,E=function(e){var t;return(null===(t=null==e?void 0:e.domainUrl)||void 0===t?void 0:t.endsWith(`/${e.domain}`))?Ze.pro:Ze.pre}(v),w=function(e,t){return`${t?"nofollow":""} ${e?"noreferrer":""}`.trim()}(O,j),x=function(e){return e?"_blank":"_self"}(O),k=v&&function({env:e,fullPath:t,to:n}){var r,o,i;if("string"!=typeof n)return n;if(e===Ze.pre){const e=null===(r=null==t?void 0:t.domainUrl)||void 0===r?void 0:r.split((null==t?void 0:t.domain)||"").join("");return(null===(o=null==n?void 0:n.split(e||""))||void 0===o?void 0:o.join(""))||n}return e===Ze.pro&&(null===(i=null==n?void 0:n.split((null==t?void 0:t.domainUrl)||""))||void 0===i?void 0:i.join(""))||n}({env:E,fullPath:v,to:y}),I=h||S?"":k;return b||O?e.createElement("a",Object.assign({"data-link":"anchor",target:x,rel:w,href:b||y,className:p,title:d},g),a):e.createElement(m,Object.assign({rel:w,target:x,to:I,getProps:l,partiallyActive:s,state:c,activeStyle:o,activeClassName:r,title:h?k:d,style:$?o:i,className:$?`${p} ${r||""}`.trim():p},g),a)}function Xe(t){const{data:n}=t;return e.createElement("script",{dangerouslySetInnerHTML:{__html:`(function(){\n const ldJsonScript = document.createElement('script');\n ldJsonScript.setAttribute('type', 'application/ld+json');\n ldJsonScript.textContent = \`${JSON.stringify(n)}\`;\n document.head.appendChild(ldJsonScript);\n})();`}})}function et(t){const{url:r,linkProp:o="to",children:i}=t,a=n(t,["url","linkProp","children"]),{fullUrl:l}=P(),s=he()||"a",{href:c,to:u}=function(e){const t=null==e?void 0:e.href,n=null==e?void 0:e.linkToURL,r=null==n?void 0:n.match(/^\/{2}|^https?:/g),o=null==n?void 0:n.match(/^\/\w/g);return{href:t||(r?n:null),to:o?n:null}}(r),d=null==r?void 0:r.newTab,p=null==r?void 0:r.noFollow,g=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),d&&{target:"_blank"}),{rel:`${p?"nofollow":""} ${d?"noreferrer":""}`.trim()}),l&&c&&{href:U(l,c)}),l&&u&&{[o]:U(l,u)});return u?e.createElement(e.Fragment,null,e.createElement("p",null,"Router"),e.createElement(s,Object.assign({},g),i)):e.createElement("a",g,i)}function tt(t){const{component:n,content:r,library:{components:o}}=t;return r?e.createElement(Je,Object.assign({libComponents:o,component:n},r)):null}function nt(t){var n;const{apiUrl:r,content:o,footer:i,header:a,languageId:l,library:{templates:s,components:c},pageLanguages:u,siteMetadata:d}=t,p=s[o.template.templateType],g=o.template.heroSection?o.template.heroSection.modules&&o.template.heroSection.modules[0]:void 0,f=g?g.component:void 0,m=R({obj:o.template,searchKey:"component"}),v=Object.keys(null==o?void 0:o.template).filter((e=>(null==o?void 0:o.template[e])&&o.template[e].component)),h=Object.fromEntries(null==v?void 0:v.map((e=>{var t;return[e,null===(t=null==o?void 0:o.template[e].modules)||void 0===t?void 0:t.map((({component:e})=>e))]})));return e.createElement(C,{activeSectionBase:o.template.activeSectionBase,activeSectionSlug:o.template.activeSectionSlug||"/",apiUrl:r,breadcrumb:o.breadcrumb,canonicalSite:o.canonicalSite,componentList:m,dimensions:null===(n=o.dimensions)||void 0===n?void 0:n.values,firstModule:f,footer:i,fullPath:o.fullPath,fullUrl:o.fullUrl,header:a,isHome:o.isHome,languageId:l,modified:o.modified,origin:o.origin,pageLanguages:u,published:o.published,sectionModules:h,site:o.site,siteMetadata:d,siteSlug:o.siteSlug,structuredData:o.structuredData,structuredDataContent:o.structuredDataContent,title:o.title,template:o.template,headerTheme:o.headerTheme,footerTheme:o.footerTheme,theme:o.theme},e.createElement(e.Fragment,null,!!a&&e.createElement(te,null,e.createElement(Je,Object.assign({libComponents:c},a))),e.createElement(p,Object.assign({},o.template)),!!i&&e.createElement(te,null,e.createElement(Je,Object.assign({libComponents:c},i)))))}function rt(t){const{isPage:r=!1}=t,o=n(t,["isPage"]),i=o,a=o;return r?e.createElement(nt,Object.assign({},i)):e.createElement(tt,Object.assign({},a))}const ot=e=>e,it=e=>e,at=e=>e,lt=e=>e,st=e=>e,ct=e=>e,ut=e=>e,dt=e=>e,pt=e=>e,gt=e=>e,ft=e=>e,mt=e=>e,vt=e=>e,ht=e=>e,bt=e=>e,yt=e=>e;function Ot({area:e,description:t,fullData:n,instantNotification:o=!1,level:i,publicApiUrl:a}){return r(this,void 0,void 0,(function*(){const r=`${a}/alert`,l={level:i,area:e,description:t,fullData:n,instantNotification:o},s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)};try{yield fetch(r,s)}catch(e){console.error("Error creating Griddo alert:",e)}}))}var jt=Object.freeze({__proto__:null}),St=Object.freeze({__proto__:null}),$t=Object.freeze({__proto__:null}),Et=Object.freeze({__proto__:null}),wt=Object.freeze({__proto__:null}),xt=Object.freeze({__proto__:null}),kt=Object.freeze({__proto__:null});export{ke as CloudinaryBackgroundImage,Me as CloudinaryImage,Je as Component,St as Core,jt as Fields,Ke as GriddoBackgroundImage,Ye as GriddoImage,Qe as GriddoLink,Xe as LdJson,et as Link,nt as Page,$t as PageContentTypeFields,L as PageContext,C as PageProvider,rt as Preview,xt as Schema,ne as SessionContext,re as SessionProvider,Et as SimpleContentTypeFields,I as SiteContext,_ as SiteProvider,kt as Theme,wt as UIFields,lt as createCategoryContentTypeSchema,ot as createComponentSchema,st as createDamDefaultsSchema,ct as createDataPackCategorySchema,ut as createDataPackSchema,dt as createFooterSchema,pt as createHeaderSchema,gt as createLanguagesSchema,ft as createMenuSchema,mt as createModuleCategoriesSchema,vt as createModuleSchema,at as createPageContentTypeSchema,it as createSimpleContentTypeSchema,ht as createTemplateSchema,bt as createThemesSchema,yt as createTranslationsSchema,Ve as getComponent,A as getLang,q as getSiteID,N as getToken,Ot as griddoAlertRegister,Z as useContentType,Q as useContentTypeNavigation,ae as useDataFilters,Y as useDistributorData,d as useGlobalTheme,ce as useGriddoImage,de as useI18n,ge as useImage,me as useIsClient,ve as useIsFirstRender,he as useLink,be as useList,ye as useListWithDefaultStaticPage,Oe as useNavigation,P as usePage,Y as useReferenceFieldData,we as useSSR,Se as useScript,$e as useSession,ie as useSite,Ee as useSitemap,p as useTheme,S as useThemeColors,E as useThemeFont,$ as useThemePrimitives};
1
+ import*as e from"react";import t from"react";function n(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function r(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))}var o={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"faces:center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]};function i(e){return null==e?void 0:e.toString().split(/cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%/)[0]}function a(e){return Object.fromEntries(Object.entries(e).filter((e=>e[1])))}function l(e){var t;const{damId:r,imageConfig:o}=e,l=n(e,["damId","imageConfig"]),s=(c=o,u=l,Object.assign(Object.assign({},a(c)),a(u)));var c,u;const d=s.crop?`c/${s.crop}`:"",p=s.quality?`q/${s.quality}`:"",g=s.format?`f/${s.format}`:"",f=`${d}/${p}/${s.width?`w/${i(s.width)}`:""}/${s.height?`h/${i(s.height)}`:""}/${s.position?`p/${s.position}`:""}/${(null===(t=s.transforms)||void 0===t?void 0:t.length)?`t/${s.transforms}`:""}/${g}`;return function(e){const[t,n]=e.split(/(^https?:\/\/|^\/\/)/).filter(Boolean);return`${t}${null==n?void 0:n.replace(/\/\/+/g,"/").replace(/\/$/,"")}`}(`${o.domain}/${f}/${r}`)}function s(e){return e&&"string"==typeof e?e.split(/(^[http:|https:|\/\/]*[\S][^\/]*)/)[1]:e}function c(e){if(e&&"string"==typeof e){return e.split("/").filter(Boolean).slice(-1)[0]}return e}const u=()=>Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,8);function d(e){return e.global}function p(e,t){const n=[];if((null==t?void 0:t.global)&&n.push(e.global),null==t?void 0:t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return 1===n.length?n[0]:n}const g=e=>{const t={},n=e=>{e.forEach((e=>{e.values.forEach((({cssVar:e,value:n})=>{t[e]=n}))}))};return Array.isArray(e)?n(e):Object.values(e).forEach((e=>{n(e)})),t},f=(e,t)=>e.map((e=>Object.assign(Object.assign({},e),{values:e.values.map((e=>([...e.value.matchAll(/var\((.*?)\)/g)].forEach((n=>{n.length>=2&&(e.value=e.value.replace(n[0],t[n[1]]))})),Object.assign({},e)))).filter((({value:e})=>CSS.supports("color",e)))}))).filter((e=>e.values.length)),m=e=>{const t=(e=>{let t=Object.assign({},g(e.primitives));return"subthemes"in e&&e.subthemes&&e.subthemes.forEach((e=>{t=Object.assign(Object.assign({},t),g(e.primitives))})),t})(e);if(Array.isArray(e.primitives))return f(e.primitives,t);const{common:n,light:r,dark:o}=e.primitives;return{common:n&&f(n,t),light:f(r,t),dark:f(o,t)}},v=(e,t)=>e.filter((e=>Array.isArray(t)?t.includes(e.id):e.id===t)),h=(e,t)=>{if(Array.isArray(e.primitives))return v(e.primitives,t);const{common:n,light:r,dark:o}=e.primitives;return{common:n&&v(n,t),light:v(r,t),dark:v(o,t)}},b=e=>{if(Array.isArray(e.primitives))return e.primitives.length;const{common:t,light:n,dark:r}=e.primitives;return(null==t?void 0:t.length)||n.length||r.length},y=(e,t,n)=>{const r=void 0===n;return e.map((e=>Object.assign(Object.assign({},e),{primitives:r?m(e):h(e,n),subthemes:"subthemes"in e&&e.subthemes&&e.subthemes.map((e=>Object.assign(Object.assign({},e),{primitives:r?m(e):h(e,n)}))).filter((e=>b(e)&&(!t||e.id===t)))||[]}))).filter((e=>b(e)||e.subthemes.length))},O=(e,t,n)=>y(e,n,t),j=(e,t)=>y(e,t);function S(e,t){const n=[];if((null==t?void 0:t.global)&&n.push(e.global),null==t?void 0:t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return j(n,null==t?void 0:t.subtheme)}function $(e,t){const n=[],{global:r,primitive:o,subtheme:i}=t;if(r&&n.push(e.global),t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return O(n,o,i)}function E(e,t){return $(e,Object.assign(Object.assign({},t),{primitive:["fontFamily","fontSize"]}))}const w=e.createContext({translations:{}});function x(t){const{children:n,translations:r}=t;return e.createElement(w.Provider,{value:{translations:r}},n)}const k={linkComponent:function(t){const{children:r}=t,o=n(t,["children"]);return e.createElement("a",Object.assign({"data-griddo":"link"},o),r)},navigate:()=>null},I=e.createContext(k);function _(t){const{children:r}=t,o=n(t,["children"]),i=Object.assign(Object.assign({},k),o);return e.createElement(I.Provider,{value:i},r)}const L=e.createContext({});function C(t){const{children:r}=t,o=n(t,["children"]),i=e.useContext(I),a=null==i?void 0:i.translations;return e.createElement(L.Provider,{value:Object.assign({},o)},e.createElement(x,{translations:a},r))}function P(){var t,n;const r=e.useContext(L);if(!r)return console.warn("Griddo: You forgot to put <PageProvider>."),{};const o=null===(t=r.pageLanguages)||void 0===t?void 0:t.filter((e=>e.isLive)),i=null===(n=r.pageLanguages)||void 0===n?void 0:n.find((e=>e.languageId===r.languageId)),a=null==i?void 0:i.locale,l=null==i?void 0:i.locale.replace("_","-");return Object.assign(Object.assign({},r),{pageLanguages:o,locale:a,ISOLocale:l})}const z="undefined"!=typeof window;function U(e,t){return(null==t?void 0:t.startsWith(`${e}#`))?`#${t.split("#")[1]}`:t}function N(){const e=localStorage.getItem("persist:app");if(!e||!z)return null;const t=JSON.parse(e);let{token:n}=t;n=JSON.parse(n);return{Authorization:`bearer ${n}`}}function q(){var e;const t=localStorage.getItem("persist:root");if(!z||!t)return 1;const n=JSON.parse(t);let{sites:r}=n;r=JSON.parse(r);return null===(e=r.currentSiteInfo)||void 0===e?void 0:e.id}function A(){const e=localStorage.getItem("langID");return!(!z||!e)&&parseInt(e)}function R({obj:e,searchKey:t,resultsBuffer:n=[],unique:r=!0}={}){if(!e)return[];const o=n;return Object.keys(e).forEach((n=>{const r=e[n];n===t&&"object"!=typeof r?o.push(r):"object"==typeof r&&r&&R({obj:r,searchKey:t,resultsBuffer:o})})),r?[...new Set(o)]:o}function T({baseUrl:e,params:t}){const n=Object.keys(t).map((e=>function(e){return Array.isArray(e)&&e.length>0||"number"==typeof e||"string"==typeof e&&!!e}(t[e])?`${e}/${t[e]}`:"")).join("/");return`${e}${r=n,r.split("/").filter(Boolean).join("/")}`;var r}function D(e,t){const n=t||A();return{method:"POST",mode:"cors",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json",lang:null==n?void 0:n.toString()},N()),redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(e)}}function F(e){return!!e&&e.every((e=>"number"==typeof e))}function M(e){return Array.isArray(e)&&F(e)}function B(e){return Array.isArray(e)&&!F(e)}function H(e){return!M(e)&&!B(e)}function G(e){if(!e)return;const t=e?e.reduce(((e,t)=>{const{source:n,id:r}=t;return e[n]||(e[n]=[]),e[n].push(r),e}),{}):{};return Object.keys(t).map((e=>`${e}:${t[e]}`)).join(";")}function V(e){return null==e?void 0:e.join(",")}function J(e){const t=[];for(const n in e){e[n].items.forEach((e=>{t.push({id:e.id,label:e.label,source:n})}))}return G(t)}function W(e){return!!e&&["or","and"].includes(e.toLowerCase())}function K(e){return"boolean"==typeof e?e?"simple":"off":"off"===e||"simple"===e||"full"===e?e:"off"}function Y(t){const[n,r]=e.useState(null),{order:o,quantity:i,source:a,mode:l,fixed:s,filter:c,allLanguages:u,preferenceLanguage:d,fullRelations:p=!1,filterOperator:g="OR",globalOperator:f="AND",site:m,lang:v}=t||{},{apiUrl:h}=P();return e.useEffect((()=>{const e=!!(v||A()),t=m||q()||"global",n=`${h}/site/${t}/distributor`,b=D("auto"===l?{mode:l,order:o,quantity:i,source:a,filter:c,fullRelations:p,allLanguages:u,preferenceLanguage:d,filterOperator:g,globalOperator:f}:{mode:l,fixed:s,fullRelations:p},v);e&&fetch(n,b).then((e=>e.json())).then((e=>r(e))).catch((e=>{console.error("Error:",e)}))}),[l,o,i,s,c,a,p,u,d,g,f,m,v]),n}function Z({data:e,queriedData:t}){return e&&Y(e)||t}function Q(t){const[n,r]=e.useState({previous:[],next:[],error:void 0}),{apiUrl:o,canonicalSite:i,structuredDataContent:a}=P(),{order:l="recent-asc",quantity:s=1,fullRelations:c=!1,referenceId:u=(null==a?void 0:a.id)}=t||{};return e.useEffect((()=>{const e=!!A(),t=q()||i||"global",n=`${o}/site/${t}/distributor`,a=D({mode:"navigation",order:l,quantity:s,fullRelations:c,referenceId:u});e&&fetch(n,a).then((e=>e.json())).then((e=>r(e))).catch((e=>{console.error("Error:",e)}))}),[l,s,c,u]),n}function X(t){const[n,r]=e.useState(),[o,i]=e.useState(!0),[a,l]=e.useState(!1),[s,c]=e.useState(!0),[u,d]=e.useState({});return e.useEffect((()=>{t&&(i(!0),fetch(t).then((e=>{if(c(!1),200!==e.status)throw i(!1),l(!0),d({code:e.status,msg:e.statusText}),new Error(e.statusText);return e.json()})).then((e=>{r(e)})).finally((()=>{i(!1),l(!1)})).catch((()=>{l(!0)})))}),[t]),{data:n,isLoading:o,isError:a,isFirstFetch:s,msg:u}}const ee=e.createContext(null);function te(t){return e.createElement(ee.Provider,{value:{isNavigation:!0}},t.children)}const ne=t.createContext([{},()=>null]),re=e=>{const{children:n}=e,r=oe();return t.createElement(ne.Provider,{value:r},n)},oe=()=>{const[e,n]=t.useState({});return[e,e=>n((t=>Object.assign(Object.assign({},t),e)))]},ie=()=>e.useContext(I);function ae(){const{publicApiUrl:t,siteId:n,renderer:r}=ie(),{languageId:o}=P(),[i,a]=e.useState(),l="editor"===r;const{isError:s,isLoading:c,msg:u,data:d,isFirstFetch:p}=X(null==i?void 0:i.queryUrl);return[{query:d,isLoading:c,isError:s,msg:u,isFirstFetch:p},function({apiUrl:e=`${t}`,cached:r,data:i,lang:s=o,site:c=n}){if(!i)return;const u=l?(new Date).valueOf():r,d=T({baseUrl:`${e}/filters/${`${i.source||i.fixed}/`}`,params:{site:c,lang:s,related:(p=i.related,"number"==typeof p?p:M(p)?V(p):B(p)?G(p):H(p)?J(p):void 0),allLanguages:i.allLanguages?"on":"off",filterOperator:i.filterOperator,globalOperator:i.globalOperator,cached:u}});var p;a({queryUrl:d})}]}const le={jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",png:"image/png",avif:"image/avif",webp:"image/webp"},se={quality:75,crop:"cover",loading:"lazy",decoding:"auto",blurSize:"8px",blurCSSTransition:"filter 0s ease-in-out",formats:["webp"]};function ce(t){var{url:r}=t,o=n(t,["url"]);if(!r)return{};const a=e.useContext(I),u=(null==a?void 0:a.griddoDamDefaults)||{},d=s(r),p=c(r),g=Object.assign(Object.assign(Object.assign(Object.assign({},se),u),o),{format:"jpeg",domain:d});void 0===g.responsive&&(g.responsive=[{width:g.width,height:g.height,quality:g.quality,crop:g.crop,position:g.position,transforms:g.transforms}]);const f=g.responsive.map((({width:e,height:t,quality:n,crop:r,position:o,transforms:a})=>`${l({damId:p,imageConfig:g,quality:n,crop:r,width:e,height:t,position:o,transforms:a})} ${e?`${i(e)}w`:""}`.trim())),m=function(e){const t=e.filter((e=>null===e.breakpoint));return[...e.filter((e=>null!==e.breakpoint)),...t]}(g.responsive.reverse()).map(((e,t)=>g.responsive&&t<g.responsive.length-1?`(min-width: ${e.breakpoint}) ${e.width}`:`${e.width}`)).join(", "),v=f.map((e=>null==e?void 0:e.split(" ")[0])),h=g.responsive[0],b=`${l(Object.assign({damId:p,imageConfig:g},h))}`;return{type:(null==g?void 0:g.format)?le[null==g?void 0:g.format]:le.jpeg,srcSet:f,srcSetURL:v,src:b,sizes:m,webpFallback:ue({srcSet:f,srcSetURL:v,format:"jpeg"}),jpeg:ue({srcSet:f,srcSetURL:v,format:"jpeg"}),webp:ue({srcSet:f,srcSetURL:v,format:"webp"}),avif:ue({srcSet:f,srcSetURL:v,format:"avif"}),png:ue({srcSet:f,srcSetURL:v,format:"png"}),gif:ue({srcSet:f,srcSetURL:v,format:"gif"}),svg:ue({srcSet:f,srcSetURL:v,format:"svg"})}}function ue({srcSet:e,srcSetURL:t,format:n}){return{type:le[n],srcSet:null==e?void 0:e.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`))),srcSetURL:null==t?void 0:t.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`)))}}function de(t){const n=null==t?void 0:t.locale,r=e.useContext(w),{siteLangs:o}=ie(),{languageId:i}=P(),a=null==r?void 0:r.translations;a||console.warn("Griddo: <SiteProvider> needs to have the prop translations"),void 0===o&&console.warn("Griddo: <SiteProvider> needs to have the prop siteLangs set with the site languages"),i||console.warn("Griddo: <PageProvider> needs to have the prop languageId set with the page language id"),function(e,t){return!!(null==e?void 0:e.find((e=>e.id===t)))}(o,i)||console.warn(`Griddo: languageId ${i} doesn't exist in this site`),void 0===n||function(e,t){return!!(null==e?void 0:e.find((e=>(null==e?void 0:e.locale)===t)))}(o,n)||console.warn(`Griddo: locale ${n} doesn't exist in this site`);const l=n||function(e,t){var n;return null===(n=null==e?void 0:e.find((e=>e.id===t)))||void 0===n?void 0:n.locale}(o,i),s=a&&l?a[l]:void 0;return l&&i||console.warn("Griddo: You forgot to put <I18nProvider> or exists an error in language id."),{getTranslation:(e,t="")=>s&&s[e]?s[e]:t,getNestedTranslation:(e,t="")=>s&&function(e,t){const n=null==e?void 0:e.split(".").reduce(((e,t)=>e[t]?e[t]:""),t);return n}(e,s)||t}}const pe={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]};function ge(e){var t,r,{publicId:o}=e,a=n(e,["publicId"]);const{cloudinaryCloudName:l,cloudinaryDefaults:s}=ie(),c=Object.assign(Object.assign(Object.assign({},pe),s),a),u=`${c.domain}/${l}/${c.uploadFolder}`,d=`${fe({root:u,imageConfig:Object.assign(Object.assign({},c),{quality:20,width:"512"})})}/${c.fallback404ImageId}`,p=null===(t=null==c?void 0:c.responsive)||void 0===t?void 0:t.map((({width:e,height:t,quality:n,crop:r})=>`${fe({root:u,imageConfig:Object.assign({quality:n,crop:r,width:e,height:t},c)})}/${o} ${i(e)}w`)),g=function(e){if(!e)return[];const t=e.filter((e=>null===e.breakpoint));return[...e.filter((e=>null!==e.breakpoint)),...t]}(null===(r=null==c?void 0:c.responsive)||void 0===r?void 0:r.reverse()).map(((e,t)=>{var n;return c.responsive&&t<(null===(n=null==c?void 0:c.responsive)||void 0===n?void 0:n.length)-1?`(min-width: ${e.breakpoint}) ${e.width}`:`${e.width}`})).join(", "),f=null==p?void 0:p.map((e=>e.split(" ")[0])),m=(null==c?void 0:c.responsive)&&(null==c?void 0:c.responsive[0])||[];return{src:`${fe(Object.assign({root:u,imageConfig:c},m))}/${o}`,srcSet:p,sizes:g,fallbackSrcImage:d,srcSetURL:f}}function fe(e){const{root:t,imageConfig:n}=e,r=(null==n?void 0:n.crop)?`c_${n.crop}`:"",o=(null==n?void 0:n.quality)?`q_${n.quality}`:"",a=(null==n?void 0:n.gravity)?`g_${n.gravity}`:"",l=(null==n?void 0:n.format)?`f_${n.format}`:"",s=(null==n?void 0:n.width)?`w_${i(n.width)}`:"",c=(null==n?void 0:n.height)?`h_${i(n.height)}`:"",u=(null==n?void 0:n.ar)?`ar_${n.ar}`:"";return`${t}/${`${r},${a},${l},${o},${s},${c},${u}`.split(/._null|._undefined|,{1,}|._,|._$|undefined|null/).filter(Boolean).join(",")}`}function me(){const[t,n]=e.useState(!1);return e.useEffect((()=>{n(!0)}),[]),t}function ve(){const t=e.useRef(!0);return t.current?(t.current=!1,!0):t.current}function he(){const t=e.useContext(I);return null==t?void 0:t.linkComponent}function be(){const{publicApiUrl:t,siteId:n,renderer:r}=ie(),{languageId:o}=P(),[i,a]=e.useState(),l="editor"===r;const{isError:s,isLoading:c,msg:u,data:d,isFirstFetch:p}=X(null==i?void 0:i.queryUrl);return[{query:d,isLoading:c,isError:s,msg:u,isFirstFetch:p},function({apiUrl:e=`${t}`,cached:r,data:i,exclude:s,fields:c,filterIds:u,filterOperator:d,globalOperator:p,items:g=10,lang:f=o,operator:m,page:v=1,relations:h,search:b,site:y=n,includePending:O,allLanguages:j,preferenceLanguage:S}){var $;if(!i)return;const E=l?(new Date).valueOf().toString():r,w=null==b?void 0:b.replace(/\s/g,"+"),x="auto"===i.mode,k="manual"===i.mode,I="navigation"===i.mode,_=i.source||i.fixed||`reference/${i.referenceId}`||[],L=T({baseUrl:`${e}${x?"/list/":k?"/list/fixed/":I?"/list/navigations/":""}${_}/`,params:{site:y,lang:f,get:c,page:v,items:g,order:x||I?i.order:void 0,filter:(C=u||i.filter,M(C)?V(C):B(C)?G(C):H(C)?J(C):void 0),maxItems:i.quantity,search:w,operator:W(m)?m:void 0,filterOperator:W(d)?d:void 0,globalOperator:W(p)?p:void 0,exclude:Array.isArray(s)?s:void 0,relations:K(h),includePending:O?"on":void 0,allLanguages:j?"on":void 0,preferenceLanguage:S?"true":void 0,cached:E}});var C;k&&Array.isArray(_)&&_.length<1&&a({queryUrl:void 0,extra:void 0}),a({queryUrl:L,extra:{totalItems:"manual"===i.mode&&(null===($=i.fixed)||void 0===$?void 0:$.length)}})}]}function ye(e){const{items:t,queriedData:n,fields:r,page:o}=e,[{isError:i,isLoading:a,msg:l,query:s,isFirstFetch:c},u]=be(),d={page:o||1,totalItems:null==n?void 0:n.length,totalPages:(null==n?void 0:n.length)&&t&&Math.ceil((null==n?void 0:n.length)/t),items:null==n?void 0:n.slice(0,t||10).map((e=>Object.assign({id:e.id},function(e,t){if(e)return t?Object.fromEntries(Object.keys(e).map((n=>(null==t?void 0:t.includes(n))&&[n,e[n]])).filter(Boolean)):e}(e.content,r))))};return[{isError:i,isLoading:a,msg:l,isFirstFetch:c,query:(s?Object.assign(Object.assign({},s),{totalPages:t&&(null==s?void 0:s.totalItems)&&Math.ceil((null==s?void 0:s.totalItems)/t)}):void 0)||d},u]}function Oe(){return e.useContext(ee)}const je={};function Se(t,n){const[r,o]=e.useState((()=>{var e;return!t||(null==n?void 0:n.shouldPreventLoad)?"idle":"undefined"==typeof window?"loading":null!==(e=je[t])&&void 0!==e?e:"loading"}));return e.useEffect((()=>{var e,r;if(!t||(null==n?void 0:n.shouldPreventLoad))return;const i=je[t];if("ready"===i||"error"===i)return void o(i);const a=function(e){const t=document.querySelector(`script[src="${e}"]`),n=null==t?void 0:t.getAttribute("data-status");return{node:t,status:n}}(t);let l=a.node;if(l)o(null!==(r=null!==(e=a.status)&&void 0!==e?e:i)&&void 0!==r?r:"loading");else{l=document.createElement("script"),l.src=t,l.async=!0,l.setAttribute("data-status","loading"),document.body.appendChild(l);const e=e=>{const t="load"===e.type?"ready":"error";null==l||l.setAttribute("data-status",t)};l.addEventListener("load",e),l.addEventListener("error",e)}const s=e=>{const n="load"===e.type?"ready":"error";o(n),je[t]=n};return l.addEventListener("load",s),l.addEventListener("error",s),()=>{l&&(l.removeEventListener("load",s),l.removeEventListener("error",s)),l&&(null==n?void 0:n.removeOnUnmount)&&l.remove()}}),[t,null==n?void 0:n.shouldPreventLoad,null==n?void 0:n.removeOnUnmount]),r}const $e=()=>t.useContext(ne);function Ee(){const[t,n]=e.useState(),[o,i]=e.useState(!0),{apiUrl:a,header:l,footer:s,fullPath:c}=P(),{siteMetadata:u}=ie();e.useEffect((()=>{d()}),[]);const d=()=>r(this,void 0,void 0,(function*(){var e,t,r;const o={};if(o.topMenu=[{label:null==u?void 0:u.title,children:null===(e=l.topMenu)||void 0===e?void 0:e.elements,url:{linkToURL:!!c&&`${c.domainUrl}${c.site}`}}],!u){const e=q(),t=`${a}/site/${e}`,n=yield fetch(t,function(){const e=A();return{method:"GET",mode:"cors",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json",lang:e},N())}}()),{name:r}=yield n.json();o.topMenu[0].label=r,o.siteName=r}o.mainMenu=null===(t=null==l?void 0:l.mainMenu)||void 0===t?void 0:t.elements;const d=null===(r=null==s?void 0:s.legalMenu)||void 0===r?void 0:r.elements;o.footerMenu=[{label:null,children:d}],o.header=l,o.footer=s,n(o),i(!1)}));return[t,o]}function we(){const e="undefined"!=typeof window&&window.document&&window.document.documentElement;return{isBrowser:e,isServer:!e}}function xe(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}function ke(t){var{backgroundRepeat:r="no-repeat",backgroundSize:i="cover",backgroundPosition:a="50% 50%",children:l,overlayColor:s=null,overlayOpacity:c=0,overlayTransition:d="2s",ratio:p,publicId:g,src:f,customLazyClassName:m="lazy",lazy:v}=t,h=n(t,["backgroundRepeat","backgroundSize","backgroundPosition","children","overlayColor","overlayOpacity","overlayTransition","ratio","publicId","src","customLazyClassName","lazy"]);const{cloudinaryDefaults:b}=ie(),y=Object.assign(Object.assign(Object.assign(Object.assign({},b),o),h),{backgroundLazy:b.backgroundLazy||o.backgroundLazy||v}),{srcSetURL:O}=ge({responsive:[...y.responsive],quality:y.quality,crop:y.crop,gravity:y.gravity,format:y.format,publicId:g,ar:p}),j=f?[f]:O,S=f?[]:y.responsive.map((e=>e.breakpoint)),$=`Griddo-BgImage--${u()}`,E=y.backgroundLazy?m:"",w=function(e,t=0){return Array(e).fill(0).map(((e,n)=>n+t))}(j.length-1,1).map((e=>`@media (min-width: ${S[e]}) {\n .${$} {\n background-image: url(${j[e]});\n }\n }\n `)).join("");return e.createElement(e.Fragment,null,e.createElement("style",{dangerouslySetInnerHTML:{__html:`\n\n .${$} {\n background-repeat: ${r};\n background-position: ${a};\n background-size: ${i};\n background-image: url(${j[0]});\n }\n\n ${w}\n\n .${$}::before {\n transition: all ${d} ease;\n background-color: rgba(0, 0, 0, ${c});\n ${s?`\n background-color: ${s};\n opacity: ${c};\n `:""}\n }`}}),e.createElement("div",{className:`Griddo-BgImage ${$} ${E}`},l))}function Ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _e(e,t){return e(t={exports:{}},t.exports),t.exports}xe('.Griddo-BgImage {\n\tdisplay: flex;\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.Griddo-BgImage::before {\n\tz-index: 0;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tcontent: "";\n\tdisplay: block;\n}\n\n.Griddo-BgImage.lazy {\n\tbackground-image: none;\n}\n');var Le=Symbol.for("react.element"),Ce=Symbol.for("react.fragment"),Pe=Object.prototype.hasOwnProperty,ze=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ue={key:!0,ref:!0,__self:!0,__source:!0};function Ne(e,t,n){var r,o={},i=null,a=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(a=t.ref),t)Pe.call(t,r)&&!Ue.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:Le,type:e,key:i,ref:a,props:o,_owner:ze.current}}var qe={Fragment:Ce,jsx:Ne,jsxs:Ne},Ae=_e((function(e){e.exports=qe})),Re=_e((function(e,n){n.__esModule=!0,n.default=void 0;var r=["className","children","ratio","style"];function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var i="--aspect-ratio";class a extends t.Component{constructor(){super(...arguments),this.node=null,this.setNode=e=>{this.node=e}}componentDidUpdate(){if(this.node){var{node:e}=this;e.style.getPropertyValue(i)||e.style.setProperty(i,"("+this.props.ratio+")")}}render(){var e=this.props,{className:t,children:n,ratio:a,style:l}=e,s=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,r),c=o({},l,{[i]:"("+a+")"});return(0,Ae.jsx)("div",o({className:t,ref:this.setNode,style:c},s,{children:n}))}}a.defaultProps={className:"react-aspect-ratio-placeholder",ratio:1};var l=a;n.default=l}));Ie(Re);var Te=_e((function(e,t){t.__esModule=!0,t.default=void 0;var n=["className","children","ratio","style"];function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}var o="--aspect-ratio",i="react-aspect-ratio-placeholder";var a=function(e){var{className:t=i,children:a,ratio:l=1,style:s}=e,c=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,n),u=r({},s,{[o]:"("+l+")"});return(0,Ae.jsx)("div",r({className:t,style:u},c,{children:a}))};t.default=a}));Ie(Te);var De=_e((function(e,t){t.__esModule=!0,t.default=t.AspectRatio=void 0;var n=o(Re),r=o(Te);function o(e){return e&&e.__esModule?e:{default:e}}var i=n.default;t.default=i;var a=r.default;t.AspectRatio=a}));Ie(De);var Fe=De.AspectRatio;function Me(t){const{alt:n,width:r,height:i,ratio:a,fixed:l,publicId:s,src:c,objectFit:u="cover"}=t,{cloudinaryDefaults:d}=ie(),p=Object.assign(Object.assign(Object.assign({},o),d),t),{srcSet:g,sizes:f,src:m}=ge({crop:p.crop,format:p.format,gravity:p.gravity,quality:p.quality,sizes:p.sizes,responsive:p.responsive,ar:a,publicId:s}),v={alt:n,width:r,height:i,loading:p.loading,style:{objectFit:u},decoding:p.decoding},h=Object.assign(Object.assign({},v),{src:c}),b=Object.assign(Object.assign({},v),{srcSet:g,sizes:f,src:m}),y=c?h:b,O=()=>e.createElement("img",Object.assign({},y));return l?e.createElement(O,null):e.createElement(Fe,{ratio:a||1,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(O,null))}xe('[style*="--aspect-ratio"] > img {\n height: auto;\n}\n\n[style*="--aspect-ratio"] {\n position: relative;\n}\n\n[style*="--aspect-ratio"] > :first-child {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n}\n\n[style*="--aspect-ratio"]::before {\n content: "";\n display: block;\n width: 100%;\n}\n\n@supports not (aspect-ratio: 1/1) {\n [style*="--aspect-ratio"]::before {\n height: 0;\n padding-bottom: calc(100% / (var(--aspect-ratio)));\n }\n}\n\n@supports (aspect-ratio: 1/1) {\n [style*="--aspect-ratio"]::before {\n aspect-ratio: calc(var(--aspect-ratio));\n }\n}\n');const Be=t=>e.createElement("svg",Object.assign({width:24,height:24,fill:"none"},t),e.createElement("path",{d:"M16 9v10H8V9h8zm-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"})),He=t=>e.createElement("svg",Object.assign({width:24,height:24,fill:"none"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5263 2.3158H4.78947C3.80526 2.3158 3 3.12106 3 4.10527V16.6316H4.78947V4.10527H15.5263V2.3158ZM18.2105 5.89475H8.36842C7.38421 5.89475 6.57894 6.70001 6.57894 7.68422V20.2105C6.57894 21.1947 7.38421 22 8.36842 22H18.2105C19.1947 22 20 21.1947 20 20.2105V7.68422C20 6.70001 19.1947 5.89475 18.2105 5.89475ZM8.36843 20.2105H18.2105V7.68422H8.36843V20.2105Z"}));xe('.--not-selected-nameplate {\n\tdisplay: none;\n}\n\n.--selected,\n.--selected-header-footer,\n.--selected-nameplate {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.--selected-header-footer::before,\n.--selected::before {\n\tposition: absolute;\n\theight: calc(100% - 8px);\n\twidth: calc(100% - 8px);\n\tpadding-bottom: 4px;\n\tcontent: "";\n\tborder: 4px solid rgb(80, 87, 255);\n\tpointer-events: none;\n\tz-index: 99;\n}\n\n.--selected-header-footer::after {\n\tposition: absolute;\n\tpadding: 8px 16px;\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\ttop: -34px;\n\tleft: 50%;\n\ttransform: translate(-50%, 0px);\n\tcontent: attr(data-text);\n\tz-index: 9;\n\tbackground: rgb(80, 87, 255);\n\tcolor: rgb(255, 255, 255);\n\tfont-family: "Source Sans Pro", sans-serif;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tline-height: 18px;\n}\n\n.--selected-nameplate {\n\tdisplay: flex;\n\talign-items: center;\n\tposition: absolute;\n\tpadding: 4px 16px;\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\ttop: -34px;\n\tleft: 50%;\n\ttransform: translate(-50%, 0px);\n\tz-index: 9;\n\tbackground: rgb(80, 87, 255);\n\tcolor: rgb(255, 255, 255);\n\tfont-family: "Source Sans Pro", sans-serif;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tline-height: 18px;\n\ttext-align: center;\n}\n\n.span-svg-action {\n\tpadding-left: 4px;\n}\n\n.span-svg-action:first-child {\n\tpadding-left: 16px;\n}\n\n.svg-action {\n\tfill: #dadada;\n}\n\n.svg-action:hover {\n\tfill: #fff;\n\tcursor: pointer;\n}\n');const Ge=t=>{const n=e.useRef(null),[r,o]=e.useState(0),{selectEditorID:i,moduleActions:a}=e.useContext(I),{selectedEditorID:l,editorID:s,component:c,children:u,isSelectionAllowed:d,type:p}=t,g=!!p&&["header","footer"].includes(p);e.useEffect((()=>{n&&n.current&&o(n.current.scrollHeight)}),[u]),e.useEffect((()=>{v&&m()}),[n]);const f=e=>{(s||0===s)&&"undefined"!=typeof window&&d&&i&&i(t,void 0,e)},m=()=>{if(!n.current)return;const e=n.current.style.position,t=n.current.style.top;n.current.style.position="relative",n.current.style.top="-34px",n.current.scrollIntoView({behavior:"smooth",block:"nearest"}),n.current.style.top=t,n.current.style.position=e;0===n.current.offsetTop&&(n.current.style.marginTop="36px")},v=!!l&&l===s;v&&m();return e.createElement(e.Fragment,null,"Header"===c&&e.createElement("style",{dangerouslySetInnerHTML:{__html:`\n [data-text="Header"].--selected::before {\n height: ${r-8}px;\n }`}}),g&&e.createElement("span",{className:""+(v?"--selected-header-footer":""),"data-text":c,ref:n,onClick:f},u),!g&&e.createElement("span",{className:""+(v?"--selected":""),"data-text":c,ref:n,onClick:f},e.createElement("span",{className:""+(v?"--selected-nameplate":"--not-selected-nameplate")},c,e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.duplicateModuleAction(s)}},e.createElement(He,{className:"svg-action"})),e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.deleteModuleAction(s)}},e.createElement(Be,{className:"svg-action"}))),u))},Ve=(e,t)=>{const n=t.component;return void 0!==e[n]?e[n]:(console.warn(`The component <${n}> doesn't exist inside ${JSON.stringify(Object.keys(e))}`),null)};function Je(t){var r,{libComponents:o}=t,i=n(t,["libComponents"]);const{component:a,editorID:l,type:s="",parentEditorID:c}=i,{renderer:u}=ie(),d=null===(r=Oe())||void 0===r?void 0:r.isNavigation,p="undefined"!=typeof window?parseInt(localStorage.getItem("selectedID")||"0"):null,g=Ve(o,Object.assign({},i)),f=d&&!["header","footer"].includes(s);return"editor"===u?e.createElement(re,null,e.createElement(Ge,{selectedEditorID:p,isSelectionAllowed:!f,editorID:l,component:a,type:s,parentEditorID:c},g?e.createElement(g,Object.assign({},i)):e.createElement(e.Fragment,null))):"preview"===u?e.createElement(re,null,g&&e.createElement(g,Object.assign({},i))):g&&e.createElement(g,Object.assign({},i))}xe('.griddo-background-image {\n\tdisplay: flex;\n\twidth: 100%;\n\theight: 100%;\n\n\tposition: relative;\n\n\tbackground-repeat: no-repeat;\n\tbackground-size: cover;\n\tbackground-position: 50% 50%;\n}\n\n.griddo-background-image--lazy .griddo-background-image {\n\tbackground: none !important;\n}\n\n.griddo-background-image::before {\n\tz-index: 0;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tcontent: "";\n\tdisplay: block;\n\ttransition: all var(--veil-transition-time) var(--veil-transition-easing);\n\tbackground-color: var(--veil-opacity);\n}\n');const We="griddo-background-image--lazy",Ke=e.forwardRef((({children:t,format:n,backgroundSize:r,veilOpacity:o=.5,veilColor:i="#000033",veilTransitionTime:a="2s",veilTransitionEasing:u="easing",url:d,src:p,responsive:g,className:f,style:m,quality:v,lazyOffset:h="200px",loading:b},y)=>{const{griddoDamDefaults:O}=ie(),j=e.useRef(null),S=s(d);e.useEffect((()=>{var e;if(IntersectionObserver){if(j.current){let e=new IntersectionObserver((t=>t.forEach((t=>{var n;t.isIntersecting&&(null===(n=j.current)||void 0===n||n.classList.remove(We),e=e.disconnect())}))),{rootMargin:`0px 0px ${h} 0px`});return e.observe(j.current),()=>e=e&&e.disconnect()}}else null===(e=j.current)||void 0===e||e.classList.remove(We)}),[]);const $=g&&Object.fromEntries(Object.keys(g).map((e=>[e,{url:`url("${l({damId:c(d),imageConfig:Object.assign(Object.assign(Object.assign({},O),{quality:v,format:n,domain:S}),g[e])})}")`,customProperty:g[e].customProperty}]))),E=g&&Object.fromEntries(Object.keys(g).map(((e,t)=>[$[e].customProperty?`${$[e].customProperty}`:`--image-${t}`,$[e].url]))),w=p?{"--image-default":`url(${p})`}:E;return e.createElement("div",{ref:j,"data-griddo":"loading-ref",className:`${"lazy"===b?We:""}`},e.createElement("div",{"data-griddo":"image-ref",ref:y,className:`${f} griddo-background-image`,style:Object.assign(Object.assign(Object.assign({},m),{"--veil-opacity":`${i}${Math.round(255/(1/o)).toString(16)}`,"--veil-transition-time":a,"--veil-transition-easing":u,"--background-size":r}),w)},t))}));xe('[style*="--aspect-ratio"] [data-image="griddo"] {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 100%;\n\twidth: 100%;\n\tobject-fit: cover;\n}\n');const Ye=e.forwardRef(((t,r)=>{var{width:o,height:i,ratio:a,fixed:l,url:s,loading:c,decoding:u,responsive:d,quality:p,crop:g,format:f,formats:m,position:v,transforms:h}=t,b=n(t,["width","height","ratio","fixed","url","loading","decoding","responsive","quality","crop","format","formats","position","transforms"]);if(!s)return null;const{griddoDamDefaults:y}=ie()||{},O={loading:c||(null==y?void 0:y.loading),decoding:u||(null==y?void 0:y.decoding),quality:p||(null==y?void 0:y.quality),crop:g||(null==y?void 0:y.crop),format:f,formats:m||(null==y?void 0:y.formats),position:v,transforms:h},{src:j,sizes:S,avif:$,jpeg:E,gif:w,webp:x,svg:k}=ce({url:s,crop:O.crop,format:O.format,quality:O.quality,responsive:d,position:O.position,transforms:O.transforms,width:o,height:i}),I=()=>{var t;return e.createElement("img",Object.assign({"data-image":"griddo",loading:c||O.loading,decoding:u||O.decoding,srcSet:d&&(null===(t=null==w?void 0:w.srcSet)||void 0===t?void 0:t.join(",")),sizes:d&&S,src:(null==w?void 0:w.srcSetURL)&&w.srcSetURL[0],width:o,height:i,fetchpriority:b.fetchpriority},b))},_=()=>e.createElement("img",Object.assign({"data-image":"griddo",loading:c||O.loading,decoding:u||O.decoding,src:(null==k?void 0:k.srcSetURL)&&k.srcSetURL[0],width:o,height:i,fetchpriority:b.fetchpriority},b)),L=()=>{var t,n,a,l,s;return e.createElement("picture",{ref:r},(null===(t=O.formats)||void 0===t?void 0:t.includes("avif"))&&e.createElement("source",{srcSet:null===(n=null==$?void 0:$.srcSet)||void 0===n?void 0:n.join(","),sizes:d&&S,type:"image/avif"}),(null===(a=O.formats)||void 0===a?void 0:a.includes("webp"))&&e.createElement("source",{srcSet:null===(l=null==x?void 0:x.srcSet)||void 0===l?void 0:l.join(","),sizes:d&&S,type:"image/webp"}),e.createElement("img",Object.assign({"data-image":"griddo",loading:c||O.loading,decoding:u||O.decoding,sizes:d&&S,srcSet:null===(s=null==E?void 0:E.srcSet)||void 0===s?void 0:s.join(","),src:j,width:o,height:i,fetchpriority:b.fetchpriority},b)))};return s?"svg"===f?e.createElement(_,null):"gif"===f?e.createElement(I,null):l||!d?e.createElement(L,null):e.createElement(Fe,{ratio:a||1,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(L,null)):null})),Ze={pre:"pre",pro:"pro"};function Qe(t){var{activeClassName:r="",activeStyle:o={},style:i={},children:a,getProps:l,partiallyActive:s,state:c,url:u,title:d,className:p=""}=t,g=n(t,["activeClassName","activeStyle","style","children","getProps","partiallyActive","state","url","title","className"]);const{renderer:f,linkComponent:m}=ie(),{fullPath:v}=P(),h="editor"===f,b=null==u?void 0:u.href,y=null==u?void 0:u.linkToURL,O=(null==u?void 0:u.newTab)||!1,j=(null==u?void 0:u.noFollow)||!1,S=!(null==u?void 0:u.linkToURL)&&!(null==u?void 0:u.href),$=y===`${null==v?void 0:v.domainUrl}${null==v?void 0:v.compose}`,E=function(e){var t;return(null===(t=null==e?void 0:e.domainUrl)||void 0===t?void 0:t.endsWith(`/${e.domain}`))?Ze.pro:Ze.pre}(v),w=function(e,t){return`${t?"nofollow":""} ${e?"noreferrer":""}`.trim()}(O,j),x=function(e){return e?"_blank":"_self"}(O),k=v&&function({env:e,fullPath:t,to:n}){var r,o,i;if("string"!=typeof n)return n;if(e===Ze.pre){const e=null===(r=null==t?void 0:t.domainUrl)||void 0===r?void 0:r.split((null==t?void 0:t.domain)||"").join("");return(null===(o=null==n?void 0:n.split(e||""))||void 0===o?void 0:o.join(""))||n}return e===Ze.pro&&(null===(i=null==n?void 0:n.split((null==t?void 0:t.domainUrl)||""))||void 0===i?void 0:i.join(""))||n}({env:E,fullPath:v,to:y}),I=h||S?"":k;return b||O?e.createElement("a",Object.assign({"data-link":"anchor",target:x,rel:w,href:b||y,className:p,title:d},g),a):e.createElement(m,Object.assign({rel:w,target:x,to:I,getProps:l,partiallyActive:s,state:c,activeStyle:o,activeClassName:r,title:h?k:d,style:$?o:i,className:$?`${p} ${r||""}`.trim():p},g),a)}function Xe(t){const{data:n}=t;return e.createElement("script",{dangerouslySetInnerHTML:{__html:`(function(){\n const ldJsonScript = document.createElement('script');\n ldJsonScript.setAttribute('type', 'application/ld+json');\n ldJsonScript.textContent = \`${JSON.stringify(n)}\`;\n document.head.appendChild(ldJsonScript);\n})();`}})}function et(t){const{url:r,linkProp:o="to",children:i}=t,a=n(t,["url","linkProp","children"]),{fullUrl:l}=P(),s=he()||"a",{href:c,to:u}=function(e){const t=null==e?void 0:e.href,n=null==e?void 0:e.linkToURL,r=null==n?void 0:n.match(/^\/{2}|^https?:/g),o=null==n?void 0:n.match(/^\/\w/g);return{href:t||(r?n:null),to:o?n:null}}(r),d=null==r?void 0:r.newTab,p=null==r?void 0:r.noFollow,g=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),d&&{target:"_blank"}),{rel:`${p?"nofollow":""} ${d?"noreferrer":""}`.trim()}),l&&c&&{href:U(l,c)}),l&&u&&{[o]:U(l,u)});return u?e.createElement(e.Fragment,null,e.createElement("p",null,"Router"),e.createElement(s,Object.assign({},g),i)):e.createElement("a",g,i)}function tt(t){const{component:n,content:r,library:{components:o}}=t;return r?e.createElement(Je,Object.assign({libComponents:o,component:n},r)):null}function nt(t){var n;const{apiUrl:r,content:o,footer:i,header:a,languageId:l,library:{templates:s,components:c},pageLanguages:u,siteMetadata:d}=t,p=s[o.template.templateType],g=o.template.heroSection?o.template.heroSection.modules&&o.template.heroSection.modules[0]:void 0,f=g?g.component:void 0,m=R({obj:o.template,searchKey:"component"}),v=Object.keys(null==o?void 0:o.template).filter((e=>(null==o?void 0:o.template[e])&&o.template[e].component)),h=Object.fromEntries(null==v?void 0:v.map((e=>{var t;return[e,null===(t=null==o?void 0:o.template[e].modules)||void 0===t?void 0:t.map((({component:e})=>e))]})));return e.createElement(C,{activeSectionBase:o.template.activeSectionBase,activeSectionSlug:o.template.activeSectionSlug||"/",apiUrl:r,breadcrumb:o.breadcrumb,canonicalSite:o.canonicalSite,componentList:m,dimensions:null===(n=o.dimensions)||void 0===n?void 0:n.values,firstModule:f,footer:i,fullPath:o.fullPath,fullUrl:o.fullUrl,header:a,isHome:o.isHome,languageId:l,modified:o.modified,origin:o.origin,pageLanguages:u,published:o.published,sectionModules:h,site:o.site,siteMetadata:d,siteSlug:o.siteSlug,structuredData:o.structuredData,structuredDataContent:o.structuredDataContent,title:o.title,template:o.template,headerTheme:o.headerTheme,footerTheme:o.footerTheme,theme:o.theme},e.createElement(e.Fragment,null,!!a&&e.createElement(te,null,e.createElement(Je,Object.assign({libComponents:c},a))),e.createElement(p,Object.assign({},o.template)),!!i&&e.createElement(te,null,e.createElement(Je,Object.assign({libComponents:c},i)))))}function rt(t){const{isPage:r=!1}=t,o=n(t,["isPage"]),i=o,a=o;return r?e.createElement(nt,Object.assign({},i)):e.createElement(tt,Object.assign({},a))}const ot=e=>e,it=e=>e,at=e=>e,lt=e=>e,st=e=>e,ct=e=>e,ut=e=>e,dt=e=>e,pt=e=>e,gt=e=>e,ft=e=>e,mt=e=>e,vt=e=>e,ht=e=>e,bt=e=>e,yt=e=>e;function Ot({area:e,description:t,fullData:n,instantNotification:o=!1,level:i,publicApiUrl:a}){return r(this,void 0,void 0,(function*(){const r=`${a}/alert`,l={level:i,area:e,description:t,fullData:n,instantNotification:o},s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)};try{yield fetch(r,s)}catch(e){console.error("Error creating Griddo alert:",e)}}))}var jt=Object.freeze({__proto__:null}),St=Object.freeze({__proto__:null}),$t=Object.freeze({__proto__:null}),Et=Object.freeze({__proto__:null}),wt=Object.freeze({__proto__:null}),xt=Object.freeze({__proto__:null}),kt=Object.freeze({__proto__:null});export{ke as CloudinaryBackgroundImage,Me as CloudinaryImage,Je as Component,St as Core,jt as Fields,Ke as GriddoBackgroundImage,Ye as GriddoImage,Qe as GriddoLink,Xe as LdJson,et as Link,nt as Page,$t as PageContentTypeFields,L as PageContext,C as PageProvider,rt as Preview,xt as Schema,ne as SessionContext,re as SessionProvider,Et as SimpleContentTypeFields,I as SiteContext,_ as SiteProvider,kt as Theme,wt as UIFields,lt as createCategoryContentTypeSchema,ot as createComponentSchema,st as createDamDefaultsSchema,ct as createDataPackCategorySchema,ut as createDataPackSchema,dt as createFooterSchema,pt as createHeaderSchema,gt as createLanguagesSchema,ft as createMenuSchema,mt as createModuleCategoriesSchema,vt as createModuleSchema,at as createPageContentTypeSchema,it as createSimpleContentTypeSchema,ht as createTemplateSchema,bt as createThemesSchema,yt as createTranslationsSchema,Ve as getComponent,A as getLang,q as getSiteID,N as getToken,Ot as griddoAlertRegister,Z as useContentType,Q as useContentTypeNavigation,ae as useDataFilters,Y as useDistributorData,d as useGlobalTheme,ce as useGriddoImage,de as useI18n,ge as useImage,me as useIsClient,ve as useIsFirstRender,he as useLink,be as useList,ye as useListWithDefaultStaticPage,Oe as useNavigation,P as usePage,Y as useReferenceFieldData,we as useSSR,Se as useScript,$e as useSession,ie as useSite,Ee as useSitemap,p as useTheme,S as useThemeColors,E as useThemeFont,$ as useThemePrimitives};
2
2
  //# sourceMappingURL=index.js.map