"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[426],{43190:(e,n,t)=>{t.d(n,{q:()=>r});var i=t(45992),o=t(17588),l=t(66264),u=t(60708),s=t(34895),d=t(25e3);const r=e=>{let{getItems:n,item:t,menuType:r,theme:a,shouldCloseWhenClickOutside:m=!1,itemSize:c,menuTheme:v,styles:h}=e;const[g,f]=(0,o.useState)(n()),[p,T]=(0,o.useState)(!1),y=(0,o.useCallback)((()=>{T((e=>!e))}),[]);null===t||void 0===t||t.on(l.q.Message,(e=>{e===u.m.Entering&&(f(n()),T(!1))}));const w=function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const t=(0,o.useRef)(null);return(0,o.useEffect)((()=>{const i=n=>{t.current&&!t.current.contains(n.target)&&e(n)};return document.addEventListener("mouseup",i,n),document.addEventListener("touchend",i,n),()=>{document.removeEventListener("mouseup",i,n),document.removeEventListener("touchend",i,n)}}),[t,e,n]),t}((0,o.useCallback)((()=>{m&&p&&T(!1)}),[p,m]),!0);(0,o.useEffect)((()=>{f(n())}),[n]);const E=(0,s.CO)(r);return(0,d.T)({theme:a,children:(0,i.jsx)(E,{items:g,onToggleClick:y,opened:p,ref:w,theme:a,itemSize:c,menuTheme:v,styles:h})})}},933:(e,n,t)=>{t.d(n,{N:()=>l,e:()=>s});var i=t(48237);const o=(e,n)=>""===e?n("__new.view.widget.menu.sidebar.emptyTitlePlaceholder"):e,l=(e,n)=>e.map(((e,t)=>{var l;const u=(null===(l=e.menuItemAction.action)||void 0===l?void 0:l.type)===i.L.GoToSlide;return{text:o(e.menuItemName,n),key:t,onClick:()=>{},isLink:u,isActive:!1,isAllowed:u,altText:e.altText}})),u={active:!1,allowed:!1},s=(e,n)=>e.map(((e,t)=>{var l,s;const d=!!(null===(l=e.menuItemAction)||void 0===l?void 0:l.data)&&(null===(r=e.menuItemAction.data)||void 0===r?void 0:r.type)===i.L.GoToSlide;var r;const{active:a,allowed:m}=d&&(null===(s=e.menuItemAction)||void 0===s?void 0:s.data)?n.getGoToSlideState(e.menuItemAction.data):u;return{text:o(e.menuItemName,n.t),key:t,onClick:()=>{var n;return null===(n=e.menuItemAction)||void 0===n?void 0:n.run()},isLink:d,isActive:a,isAllowed:m,altText:e.altText}}))},70426:(e,n,t)=>{t.r(n),t.d(n,{geniallyMenuViewScript:()=>d});var i=t(45992),o=t(41381),l=t(42511),u=t(43190),s=t(933);const d=(e,n)=>{(0,o.p)({getTargetNodeItem:()=>e.item,initialState:void 0,renderApp:()=>{var t,o;const{config:d,item:r}=e,{menuItems:a,menuType:m,menuTheme:c,styles:v}=d,h=()=>(0,s.e)(a,n),g={width:null!==(t=null===r||void 0===r?void 0:r.width)&&void 0!==t?t:0,height:null!==(o=null===r||void 0===r?void 0:r.height)&&void 0!==o?o:0};return()=>(0,i.jsx)(l.W,{children:(0,i.jsx)(u.q,{getItems:h,item:r,menuType:m,theme:n.theme,itemSize:g,shouldCloseWhenClickOutside:!0,menuTheme:c,styles:v})})}})(e,n)}},41381:(e,n,t)=>{t.d(n,{p:()=>u});var i=t(70377),o=t(66264),l=t(60708);function u(e){let{getTargetNodeItem:n,renderApp:t,renderThumbnailApp:u,initialState:s}=e,d=!1;const r=[],a=e=>{r.push(e)};return e=>{const m=n(e.config),c=null===m||void 0===m?void 0:m.parentSlide;function v(){if(!m)return;let e=null;if("idOfFreeNode"in m)e=document.getElementById(m.idOfFreeNode);else{const n=document.createElement("div");n.innerHTML=m.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(d){const l=t({setState:n,onUnmount:a});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"?')};d=!0,n(s),r.push((()=>{i.unmountComponentAtNode(e)}))}}function h(){d=!1,r.forEach((e=>{e()})),r.length=0}null===m||void 0===m||m.on(o.q.Mount,(()=>{v()})),null===m||void 0===m||m.on(o.q.Unmount,(()=>{h()})),m&&"isTransversal"in m&&m.isTransversal?v():null===c||void 0===c||c.on(l.m.Entering,(()=>{d||v()})),null===c||void 0===c||c.on(l.m.Exited,(()=>{m&&"isTransversal"in m&&m.isTransversal||d&&h()})),null===c||void 0===c||c.on(l.m.ThumbnailMount,(()=>{!function(){if(!u||!m||!("idOfThumbnailFreeNode"in m))return;const e=document.getElementsByClassName(m.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{i.unmountComponentAtNode(e)}))}(),function(){if(!u||!m||!("idOfThumbnailFreeNode"in m))return;const e=document.getElementsByClassName(m.idOfThumbnailFreeNode);Array.from(e).forEach((e=>{i.render(u(),e)}))}()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/426.b7317ed0.chunk.js.map