var toolsetCommonEs;toolsetCommonEs=(()=>{"use strict";var e={33:(e,t,r)=>{function n(e,t){for(var r=0;ro,fontToHead:()=>l,styleToHead:()=>i});const o=function(){function e(t){var r=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t){this.CHROME_MAX_NUMBER_ROWS=1e3,this.CHROME_MAX_ROW_SPAN=1e3,this.root=t,this.resizeAllGridItems();var n=Array.from(this.root.querySelectorAll("img")),o=n.length,i=0;n.forEach((function(e){e.addEventListener("load",(function(){++i===o&&r.resizeAllGridItems()}))})),window.addEventListener("resize",this.resizeAllGridItems.bind(this)),window.addEventListener("load",this.resizeAllGridItems.bind(this))}}var t,r;return t=e,(r=[{key:"resizeGridItem",value:function(e,t){var r=e.querySelector(".tb-brick__content");if(r){var n=window.getComputedStyle(this.root),o=parseInt(n.getPropertyValue("grid-row-gap")),i=Math.ceil(r.getBoundingClientRect().height+o),l=Math.ceil(i/t);e.style.gridRowEnd="span ".concat(l)}}},{key:"getMaxItemsHeight",value:function(e){return e.children.length?Array.from(e.children).reduce((function(e,t){return Math.max(e||0,(t.querySelector(".tb-brick__content")||{}).offsetHeight)})):0}},{key:"getMultiplier",value:function(e){var t=window.getComputedStyle(e).gridTemplateColumns.split(" ").length,r=Math.ceil(e.children.length/t),n=this.getMaxItemsHeight(e);if(n>this.CHROME_MAX_ROW_SPAN||r*n>this.CHROME_MAX_NUMBER_ROWS){var o=Math.floor(n*r/this.CHROME_MAX_ROW_SPAN)+1;return e.style.gridAutoRows="".concat(o,"px"),o}return e.style.gridAutoRows="1px",1}},{key:"resizeAllGridItems",value:function(){var e=this;if(this.root){var t=this.getMultiplier(this.root);Array.from(this.root.children).forEach((function(r){return e.resizeGridItem(r,t)}))}}}])&&n(t.prototype,r),e}();function i(){var e=document.getElementById("toolset-blocks-styling");e||(document.head.insertAdjacentHTML("beforeend",''),e=document.getElementById("toolset-blocks-styling"));var t=document.getElementsByClassName("tces-js-style-encoded"),r=t.length?t[t.length-1]:null;if(e&&r){var n=e.innerHTML,o=window.atob(r.innerHTML);-1!==n.indexOf(o)||(-1!==o.indexOf(n)?e.innerHTML=o:e.appendChild(document.createTextNode(o)))}for(;t[0];)t[0].parentNode.removeChild(t[0]);for(var i=document.getElementsByClassName("tces-js-style-to-head");i[0];)i[0].parentNode.removeChild(i[0])}function l(){var e=document.getElementsByClassName("tces-js-font-encoded"),t=e.length?e[e.length-1]:null;if(t){var r="https://fonts.googleapis.com/css?family="+window.atob(t.innerHTML).split("###").join("|");if(!document.querySelector("link[href='"+r+"']")){var n=document.createElement("link");n.href=r,n.rel="stylesheet",document.head.appendChild(n)}}for(;e[0];)e[0].parentNode.removeChild(e[0]);for(var o=document.getElementsByClassName("tces-js-font-to-head");o[0];)o[0].parentNode.removeChild(o[0])}}},t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(33)})();