"use strict";(self.webpackChunk_genially_view_client=self.webpackChunk_genially_view_client||[]).push([[8736],{94253(e,t,i){i.d(t,{q:()=>h});var n=i(45992),o=i(94310),r=i(37577),l=i(24578),a=i(2521);const d={[a.a.Pill]:"9999px",[a.a.Rounded]:"calc(var(--parent-height) * 0.25 * 1px)",[a.a.Square]:"0"},c=r.Ay.div(Object.assign({width:"100%",height:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"},l.iF.mixins.increaseSpecificity({padding:8}))),s=r.Ay.button((e=>{let{$textColor:t,$backgroundColor:i,$hoverColor:n,$shape:o,$fontFamily:r,$bold:a,$italic:c}=e;return Object.assign(Object.assign({border:"none",fontSize:"calc(var(--parent-height) * 0.5 * 1px)",cursor:"pointer",transition:"padding 0.1s ease"},l.iF.mixins.increaseSpecificity({padding:"calc(var(--parent-height) * 0.25 * 1px) calc(var(--parent-height) * 0.5 * 1px)",backgroundColor:i,borderRadius:d[o],lineHeight:1,color:t,fontFamily:null!==r&&void 0!==r?r:"inherit",fontWeight:a?"bold":"normal",fontStyle:c?"italic":"normal"})),{"&:hover":Object.assign({},l.iF.mixins.increaseSpecificity({backgroundColor:n})),"&:active":Object.assign({},l.iF.mixins.increaseSpecificity({padding:"calc(var(--parent-height) * 0.1875 * 1px) calc(var(--parent-height) * 0.375 * 1px)"}))})})),h=e=>{let{text:t,textColor:i,backgroundColor:r,hoverColor:l,visitedColor:a,showVisitedState:d,visited:h,shape:g,fontFamily:u,bold:p,italic:m,onClick:f}=e;const{ref:v,size:C}=(0,o.r)(),b=d&&h?a:r;return(0,n.jsx)(c,{ref:v,style:{"--parent-height":C.height},children:(0,n.jsx)(s,{type:"button",onClick:f,$textColor:i,$backgroundColor:b,$hoverColor:l,$shape:g,$fontFamily:u,$bold:p,$italic:m,children:t})})}},58736(e,t,i){i.d(t,{geniallyButtonEditorScript:()=>l});var n=i(45992),o=i(57277),r=i(94253);const l=e=>{let{script:t,editor:i}=e;(0,o.x)({getTargetNodeItem:()=>t.item,renderApp:()=>{const{text:e,textColor:i,defaultColor:o,hoverColor:l,visitedColor:a,showVisitedState:d,shape:c,fontFamily:s,bold:h,italic:g}=t.getConfig();return(0,n.jsx)(r.q,{text:e,textColor:i,backgroundColor:o,hoverColor:l,visitedColor:null!==a&&void 0!==a?a:"",showVisitedState:d,visited:!1,shape:c,fontFamily:""===s.name?void 0:s.name,bold:h,italic:g})},nodePrefix:"button"})({script:t,editor:i})}},94310(e,t,i){i.d(t,{r:()=>o});var n=i(17588);const o=()=>{const[e,t]=(0,n.useState)({width:0,height:0}),i=(0,n.useRef)(null);return{ref:(0,n.useCallback)((e=>{if(i.current&&i.current.disconnect(),!e)return;const{width:n,height:o}=e.getBoundingClientRect();t({width:n,height:o}),i.current=new ResizeObserver((e=>{const{contentRect:i}=e[0];t({width:i.width,height:i.height})})),i.current.observe(e)}),[]),size:e}}},57277(e,t,i){i.d(t,{x:()=>o});var n=i(70377);function o(e){let{getTargetNodeItem:t,renderApp:i,renderThumbnailApp:o,nodePrefix:r}=e;return e=>{let{script:l,editor:a}=e,d=null,c=[];function s(e){d&&(n.unmountComponentAtNode(d),d=null),e&&"innerHtml"in e&&(e.innerHtml='<div class="card-iframe"><div style="width: 100%; height: 100%; background: #FF0000; color: #FFFFFF;">Deleted</div><script><\/script></div>')}function h(){d&&n.render(i(),d)}function g(){const e=t(l.getConfig());if(!e)return;const i=`${r}-${e.id}`;"innerHtml"in e&&(e.innerHtml=`<div class="card-iframe"><div id="${i}" class="genially-widget-app" style="width: 100%; height: 100%;"></div></div>`),requestAnimationFrame((()=>{d="idOfFreeNode"in e?document.getElementById(e.idOfFreeNode)||null:document.getElementById(i)||null,h()}))}function u(){o&&c.length&&c.forEach((e=>{const t="true"===e.dataset.critical,{renderingSlideId:i}=e.dataset;n.render(o({important:t,renderingSlideId:i}),e)}))}function p(){const e=t(l.getConfig());e&&"idOfThumbnailFreeNode"in e&&requestAnimationFrame((()=>{const t=document.getElementsByClassName(e.idOfThumbnailFreeNode);c=Array.from(t).filter((e=>e instanceof HTMLElement)),u()}))}l.on("configChange",(e=>{let{config:i,prevConfig:n}=e;const o=t(i),r=n?t(n):void 0;r&&r!==o&&s(r),o&&(o!==r?(g(),p()):(h(),u()))})),l.on("scriptIdChange",(e=>{let{scriptId:t,prevScriptId:i}=e;i!==t&&(s(),g(),p())})),l.on("dispose",(()=>{s(t(l.getConfig()))})),a.on("itemMount",(e=>{let{item:t}=e;t===l.item&&g()})),a.on("slideChange",(()=>{h()})),a.on("itemUnmount",(e=>{let{item:t}=e;t===l.item&&s()})),a.on("itemThumbnailMount",(e=>{let{item:t}=e;t===l.item&&p()}))}}}}]);
//# sourceMappingURL=https://s3-static-genially.genially.com/view/static/js/8736.11dd4e4a.chunk.js.map