|
1
|
|
-(()=>{"use strict";var e={5338:(e,t,r)=>{var o=r(5795);t.H=o.createRoot,o.hydrateRoot},5795:e=>{e.exports=window.ReactDOM}},t={};const r=window.React;var o=function r(o){var a=t[o];if(void 0!==a)return a.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}(5338);const a="bBlocksVideo",n=({attributes:e,id:t})=>{const{width:o,radius:n}=e;return(0,r.createElement)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t#${t} .${a}{\n\t\t\twidth: ${["0px","0%","0em"].includes(o)?"100%":o};\n\t\t\tborder-radius: ${n};\n\t\t}\n\t\t`.replace(/\s+/g," ")}})},s=e=>{const t=[];return Object.keys(e).map((r=>{e[r]&&t.push(r)})),t};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-video").forEach((e=>{const t=JSON.parse(e.dataset.attributes);(0,o.H)(e).render((0,r.createElement)(r.Fragment,null,(0,r.createElement)(n,{attributes:t,id:e.id}),(0,r.createElement)(c,{attributes:t}))),e?.removeAttribute("data-attributes")}))}));const c=({attributes:e})=>{const{source:t,poster:o,controls:n,repeat:c,autoplay:d,muted:l,resetOnEnd:u,autoHideControl:i}=e,p=(0,r.useRef)(null);return(0,r.useEffect)((()=>{new Plyr(p.current,{controls:s(n),clickToPlay:!1,loop:{active:c},muted:l,autoplay:d,resetOnEnd:u,hideControls:i})}),[]),(0,r.createElement)("div",{className:a},(0,r.createElement)("div",{className:"videoWrapper"},(0,r.createElement)("video",{controls:!0,playsInline:!0,"data-poster":o,preload:"metadata",ref:p},"Your browser does not support the video tag.",(0,r.createElement)("source",{src:t,type:"video/mp4"}))))}})(); |
|
1
|
+(()=>{"use strict";const t=window.React,e=window.ReactDOM,r="bBlocksVideo",s=window.ReactJSXRuntime,o=({attributes:t,id:e})=>{const{width:o,radius:n}=t;return(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t#${e} .${r}{\n\t\t\twidth: ${["0px","0%","0em"].includes(o)?"100%":o};\n\t\t\tborder-radius: ${n};\n\t\t}\n\t\t`.replace(/\s+/g," ")}})},n=t=>{const e=[];return Object.keys(t).map((r=>{t[r]&&e.push(r)})),e};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-video").forEach((t=>{const r=JSON.parse(t.dataset.attributes);(0,e.createRoot)(t).render((0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o,{attributes:r,id:t.id}),(0,s.jsx)(a,{attributes:r})]})),t?.removeAttribute("data-attributes")}))}));const a=({attributes:e})=>{const{source:o,poster:a,controls:d,repeat:c,autoplay:i,muted:l,resetOnEnd:u,autoHideControl:p}=e,b=(0,t.useRef)(null);return(0,t.useEffect)((()=>{new Plyr(b.current,{controls:n(d),clickToPlay:!1,loop:{active:c},muted:l,autoplay:i,resetOnEnd:u,hideControls:p})}),[]),(0,s.jsx)("div",{className:r,children:(0,s.jsx)("div",{className:"videoWrapper",children:(0,s.jsxs)("video",{controls:!0,playsInline:!0,"data-poster":a,preload:"metadata",ref:b,children:["Your browser does not support the video tag.",(0,s.jsx)("source",{src:o,type:"video/mp4"})]})})})}})(); |