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