"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[8938],{68124:(e,n,t)=>{t.d(n,{q:()=>g});var i=t(45992),o=t(37577),l=t(23119),s=t(17588),r=t(66264),a=t(60708);var d=t(29973),u=t(88138);const c=e=>{let{isInEditor:n,slides:t,showControls:o,showPagination:l,autoplay:s,options:r,fit:a,onClickSelectedImage:d,onZoomedOut:c,galleryType:m,viewId:g}=e;if(!m)return null;const h=(0,u.BR)(m);return(0,i.jsx)(h,{isInEditor:n,slides:t,showControls:o,showPagination:l,autoplay:s,options:r,fit:a,onClickSelectedImage:d,onZoomedOut:c,viewId:g})},m=o.Ay.div({display:"flex",alignItems:"center",height:"100%",cursor:"default",".is-dragging":{cursor:"grabbing","& *":{cursor:"grabbing !important"}}}),g=e=>{let{isInEditor:n=!1,fit:t,autoplay:u,widgetItem:g,slides:h,showControls:f,showPagination:p=!0,galleryType:y,viewId:v,theme:w,onZoomed:I,t:T}=e;const E=Object.assign({loop:!0,skipSnaps:!0,watchResize:!0},d.Z),C=((e,n)=>{const[t,i]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{if(!e||!n)return;const t=[n.parentSlide.on(a.m.Entered,(()=>{n.visible&&i(!0)})),n.on(r.q.Visible,(()=>{i(!0)})),n.on(r.q.Hidden,(()=>{i(!1)}))];return()=>{t.forEach((e=>e())),i(!1)}}),[e,n]),t})(u,g);return(0,i.jsx)(l.i.Provider,{value:{t:T},children:(0,i.jsx)(o.NP,{theme:w,children:(0,i.jsx)(m,{style:{display:"flex",alignItems:"center",height:"100%"},children:(0,i.jsx)(c,{isInEditor:n,slides:h,showControls:f,showPagination:p,options:E,autoplay:C,onClickSelectedImage:e=>{null===I||void 0===I||I(void 0!==e)},onZoomedOut:()=>{null===I||void 0===I||I(!1)},fit:t,galleryType:y,viewId:v})})})})}},38938:(e,n,t)=>{t.r(n),t.d(n,{geniallyGalleryViewScript:()=>a});var i=t(45992),o=t(54072),l=t(41381),s=t(68124),r=t(88138);const a=(e,n)=>{const t=e.config.nodeRichContent,{slideList:a,showControls:d,autoplay:u,fit:c,galleryType:m}=e.config,g=e.item;t&&(t.markAsInteractive=!0,t.thumbnail=(0,r.mJ)(m));const{viewId:h}=n,f=e=>{n.setIsExternalModalOpen(e)},p=a.map((e=>({image:e.image.source,title:e.title,id:(0,o.Ak)(),altText:e.image.altText})));(0,l.p)({getTargetNodeItem:e=>e.nodeRichContent,initialState:void 0,renderApp:()=>()=>(0,i.jsx)(s.q,{autoplay:u,slides:p,showControls:d,fit:c,galleryType:m,onZoomed:f,viewId:h,widgetItem:g,theme:n.theme,t:n.t})})(e,n)}},41381:(e,n,t)=>{t.d(n,{p:()=>s});var i=t(70377),o=t(66264),l=t(60708);function s(e){let{getTargetNodeItem:n,renderApp:t,renderThumbnailApp:s,initialState:r}=e,a=!1;const d=[],u=e=>{d.push(e)};return e=>{const c=n(e.config),m=null===c||void 0===c?void 0:c.parentSlide;function g(){if(!c)return;let e=null;if("idOfFreeNode"in c)e=document.getElementById(c.idOfFreeNode);else{const n=document.createElement("div");n.innerHTML=c.source;let t=n.getElementsByClassName("genially-widget-app");t.length||(t=n.getElementsByClassName("genially-widget-gallery"));const{id:i}=t[0];if(!i)return;e=document.getElementById(i)}if(e){const n=o=>{if(a){const l=t({setState:n,onUnmount:u});i.render(l(o),e)}else console.warn('"rerender" was called when the widget was already unmounted. This is a no-op. Did you forget to dispose of an event handler with "onUnmount"?')};a=!0,n(r),d.push((()=>{i.unmountComponentAtNode(e)}))}}function h(){a=!1,d.forEach((e=>{e()})),d.length=0}null===c||void 0===c||c.on(o.q.Mount,(()=>{g()})),null===c||void 0===c||c.on(o.q.Unmount,(()=>{h()})),c&&"isTransversal"in c&&c.isTransversal?g():null===m||void 0===m||m.on(l.m.Entering,(()=>{a||g()})),null===m||void 0===m||m.on(l.m.Exited,(()=>{c&&"isTransversal"in c&&c.isTransversal||a&&h()})),null===m||void 0===m||m.on(l.m.ThumbnailMount,(()=>{!function(){if(!s||!c||!("idOfThumbnailFreeNode"in c))return;const e=document.getElementsByClassName(c.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{i.unmountComponentAtNode(e)}))}(),function(){if(!s||!c||!("idOfThumbnailFreeNode"in c))return;const e=document.getElementsByClassName(c.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{i.render(s(),e)}))}()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/8938.a0ce1077.chunk.js.map