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