!function(){"use strict";var t=React,e=ReactDOM,n=function(t){var e=t.attributes,n=t.clientId,r=e.alignment,a=e.width,c=e.height;return React.createElement("style",{dangerouslySetInnerHTML:{__html:"\n\t\t#tdvb3DViewerBlock-".concat(n," .tdvb3DViewerBlock{\n\t\t\ttext-align: ").concat(r,";\n\t\t}\n\t\t#tdvb3DViewerBlock-").concat(n," .tdvb3DViewerBlock model-viewer{\n\t\t\twidth: ").concat(["0px","0%","0em"].includes(a)?"auto":a,";\n\t\t\theight: ").concat("0px"===c||"0%"===c||"0em"===c?"350px":c,";\n\t\t}\n\t\t").replace(/\s+/g," ")}})},r=function(t,e){var n=t.attributes,r=n.sourceType,a=n.model,c=n.modelLink,l=n.loadingType;return React.createElement("div",{className:"tdvb3DViewerBlock",ref:e},React.createElement("model-viewer",{src:"upload"===r?null==a?void 0:a.url:c,alt:"upload"===r?null==a?void 0:a.title:"","camera-controls":!0,loading:l,"auto-rotate":!0}))},a=(0,t.forwardRef)(r);document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll(".wp-block-tdvb-td-viewer").forEach((function(t){var r=JSON.parse(t.dataset.attributes);(0,e.render)(React.createElement(React.Fragment,null,React.createElement(n,{attributes:r,clientId:r.cId}),React.createElement(c,{attributes:r})),t),null==t||t.removeAttribute("data-attributes")}))}));var c=function(e){var n=e.attributes,r=n.isTouchMove,c=n.isZoom,l=(0,t.useRef)(null),o=function(t,e,n,r){e&&(null==t||t.setAttribute(n,r)),!e&&(null==t||t.removeAttribute(n,r))};return(0,t.useEffect)((function(){var t=document.querySelector(".".concat(l.current.classList[0]," model-viewer"));o(t,r,"camera-controls",""),o(t,!c,"disable-zoom","")}),[l.current]),React.createElement(a,{attributes:n,ref:l})}}();
//# sourceMappingURL=script.js.map