(()=>{"use strict";const a=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"panorama/parent","version":"1.0.0","title":"Panorama Viewer","category":"widgets","description":"Interactive Viewer for Panorama Image and video.","keywords":["panorama viewer","panorama block","b-blocks panorama"],"textdomain":"panorama","supports":{"align":["wide","full"],"html":false},"example":{"attributes":{}},"editorScript":"file:./index.js","editorStyle":"file:./index.css"}'),e=window.ReactJSXRuntime,{InnerBlocks:s,useBlockProps:o}=wp.blockEditor,{useSelect:n,dispatch:r}=wp.data,{useEffect:t}=wp.element,{registerBlockType:l}=wp.blocks,{InnerBlocks:c,useBlockProps:i}=wp.blockEditor;l(a,{icon:"images-alt2",edit:a=>{const l=o(),{clientId:c,isSelected:i}=a,p=n((a=>a("core/block-editor").getBlock(c).innerBlocks));t((()=>{i&&wp.data.dispatch("core/edit-post").openGeneralSidebar("edit-post/block")}),[i]),r("core/block-editor").setTemplateValidity(!0);const m=a=>{const e=wp.blocks.createBlock("bpgb/panorama"===a?"bpgb/panorama":`panorama/${a}`);return r("core/block-editor").insertBlock(e,0,c)};return p?.length?(0,e.jsx)("div",{...l,children:(0,e.jsx)(s,{templateLock:!1,allowedBlocks:["panorama/image-360","panorama/image-3d","panorama/video","panorama/video-360","panorama/google-street","panorama/gallery","panorama/tour","bpgb/panorama"],renderAppender:()=>0===p.length&&(0,e.jsx)(s.ButtonBlockAppender,{})})}):(0,e.jsx)("div",{...l,children:(0,e.jsxs)("div",{className:"bpl-panorama-editor",children:[(0,e.jsx)("h2",{className:"panorama-title",children:"Choose a viewer "}),(0,e.jsxs)("div",{className:"panorama-buttons",children:[(0,e.jsxs)("button",{className:"panorama-button image-3d",onClick:()=>{m("image-3d")},children:[(0,e.jsx)("span",{className:"icon",children:"🧊"}),(0,e.jsx)("span",{className:"text",children:"Image 3D"})]}),(0,e.jsxs)("button",{className:"panorama-button image-360",onClick:()=>{m("image-360")},children:[(0,e.jsx)("span",{className:"icon",children:"🌐"}),(0,e.jsx)("span",{className:"text",children:"Image 360°"})]}),(0,e.jsxs)("button",{className:"panorama-button video",onClick:()=>{m("video")},children:[(0,e.jsx)("span",{className:"icon",children:"🎥"}),(0,e.jsx)("span",{className:"text",children:"Video"})]}),(0,e.jsxs)("button",{className:"panorama-button video-360",onClick:()=>{m("video-360")},children:[(0,e.jsx)("span",{className:"icon",children:"🎬"}),(0,e.jsx)("span",{className:"text",children:" Video 360°"})]}),(0,e.jsxs)("button",{className:"panorama-button gallery",onClick:()=>{m("gallery")},children:[(0,e.jsx)("span",{className:"icon",children:"🖼️"}),(0,e.jsx)("span",{className:"text",children:"Gallery"})]}),(0,e.jsxs)("button",{className:"panorama-button tour",onClick:()=>{m("tour")},children:[(0,e.jsx)("span",{className:"icon",children:"🏛️"}),(0,e.jsx)("span",{className:"text",children:"Tour 360°"})]}),(0,e.jsxs)("button",{className:"panorama-button google-street",onClick:()=>{m("google-street")},children:[(0,e.jsx)("span",{className:"icon",children:"🗺️"}),(0,e.jsx)("span",{className:"text",children:"Google Street"})]}),(0,e.jsxs)("button",{className:"panorama-button gutenberg-block",onClick:()=>{m("bpgb/panorama")},children:[(0,e.jsx)("span",{className:"icon",children:"🌄"}),(0,e.jsx)("span",{className:"text",children:"Panorama Gutenberg block"})]})]}),(0,e.jsx)(s,{templateLock:!1,allowedBlocks:["panorama/image-360","panorama/image-3d","panorama/video","panorama/video-360","panorama/google-street","panorama/gallery","panorama/tour","panorama/virtual-tour","bpgb/panorama"],renderAppender:()=>!1})]})})},save:()=>{const a=i.save();return(0,e.jsx)("div",{...a,children:(0,e.jsx)(c.Content,{})})}})})();