/home/silvwabw/public_html/wp-content/plugins/gutenverse/assets/js/frontend/video.js
(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e){var r=function(e){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}function r(t,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,e(o.key),o)}}function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}const i=gutenverseCoreFrontend;function u(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(u=function(){return!!t})()}var c=function(e){function c(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),e=this,o=arguments,r=n(r=c),function(e,r){if(r&&("object"==t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e)}(e,u()?Reflect.construct(r,o||[],n(e).constructor):r.apply(e,o));var e,r,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(c,e),a=c,(f=[{key:"init",value:function(){var t=this,e=this._elements,r=window.GutenverseFrontendConfig,n=r.framework_asset,o=r.framework_version;e.length>0&&(0,i.load)(n+"js/ReactPlayer.standalone.js?ver="+o,function(r){r||e.map(function(e){t._renderVideo(e)}),window.addEventListener("resize",function(){e.map(function(e){t._calculateSize(e)})},!0)})}},{key:"_calculateSize",value:function(t){var e=(0,i.u)(t).find(".guten-video-bg-wrapper");if(e.length){var r=(0,i.u)(t).find(".guten-video-bg-wrapper > div"),n=(0,i.u)(e).size(),o=Math.floor(.56*n.width),u=Math.floor(n.height/.56);o>n.height?r.attr("style","width: ".concat(n.width,"px; height: ").concat(o,"px")):r.attr("style","width: ".concat(u,"px; height: ").concat(n.height,"px"))}}},{key:"_renderVideo",value:function(e){var r=this,n=(0,i.u)(e).data("property"),o=n?JSON.parse(n):null;o&&"object"===t(o)&&(renderReactPlayer(e,o),setTimeout(function(){r._calculateSize(e),(0,i.u)(e).find(".guten-video-bg-wrapper").addClass("loaded")},1))}}])&&r(a.prototype,f),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,f}(i.Default),a=(0,i.u)(".guten-video-wrapper");a&&new c(a)})();