!function(e){function t(l){if(n[l])return n[l].exports;var r=n[l]={i:l,l:!1,exports:{}};return e[l].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,l){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:l})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var l=n(2),r=(n.n(l),n(3)),i=(n.n(r),wp.components),a=i.IconButton,o=i.PanelBody,c=i.TextControl,m=i.Toolbar,s=i.withNotices,u=wp.element.Fragment,p=wp.i18n.__,d=wp.blocks.registerBlockType,g=wp.editor,w=g.BlockControls,h=g.InspectorControls,b=g.BlockAlignmentToolbar,f=g.MediaPlaceholder,y=g.MediaUpload,E=g.AlignmentToolbar,_=(g.RichText,{title:{type:"array",source:"children",selector:"p"},url:{type:"string"},align:{type:"string"},width:{type:"number"},height:{type:"number"},contentAlign:{type:"string",default:"center"},id:{type:"number"}});d("cgb/block-algori-360-image",{title:p("360\xb0 Image"),description:p("If an image is worth 1,000 words, imagine how many more words an interactive 360\xb0 image is worth! Insert a single 360\xb0 image."),icon:"format-image",category:"common",keywords:[p("algori panorama image - three sixty degree photo"),p("spherical photo - full-sphere 3D image"),p("equirectangular image - VR (Virtual Reality) photography")],attributes:_,getEditWrapperProps:function(e){var t=e.align,n=e.width;if("left"===t||"center"===t||"right"===t||"wide"===t||"full"===t)return{"data-align":t,"data-resized":!!n}},edit:s(function(e){var t=e.attributes,n=e.setAttributes,l=(e.isSelected,e.className),r=e.noticeOperations,i=e.noticeUI,s=t.url,d=(t.title,t.align),g=t.width,_=t.height,v=t.contentAlign,k=t.id,N=function(e){return n({width:parseInt(e,10)})},I=function(e){return n({height:parseInt(e,10)})},x=function(e){return n({align:e})},C=function(e){if(!e||!e.url)return void n({url:void 0,id:void 0});n({url:e.url,id:e.id})},T=wp.element.createElement(u,null,wp.element.createElement(w,null,wp.element.createElement(b,{value:d,onChange:x}),wp.element.createElement(E,{value:v,onChange:function(e){n({contentAlign:e})}}),wp.element.createElement(m,null,wp.element.createElement(y,{onSelect:C,allowedTypes:["image"],value:k,render:function(e){var t=e.open;return wp.element.createElement(a,{className:"components-toolbar__control",label:p("Edit image"),icon:"edit",onClick:t})}}))),!!s&&wp.element.createElement(h,null,wp.element.createElement(o,{title:p("360\xb0 Image Settings")},wp.element.createElement("div",{className:"core-blocks-image__dimensions"},wp.element.createElement("p",{className:"core-blocks-image__dimensions__row"},p("Image Dimensions")),wp.element.createElement("div",{className:"core-blocks-image__dimensions__row"},wp.element.createElement(c,{type:"number",className:"core-blocks-image__dimensions__width",label:p("Width"),value:void 0!==g?g:"",placeholder:600,min:1,onChange:N}),wp.element.createElement(c,{type:"number",className:"core-blocks-image__dimensions__height",label:p("Height"),value:void 0!==_?_:"",placeholder:300,min:1,onChange:I}))))));return s?wp.element.createElement(u,null,T,wp.element.createElement("div",null,wp.element.createElement("a-scene",{class:"wp-block-cgb-block-algori-360-image-embedded-scene",style:{width:g,height:_},embedded:!0},wp.element.createElement("a-sky",{src:s})))):wp.element.createElement(u,null,T,wp.element.createElement(f,{icon:"format-image",className:l,labels:{title:p("360 Image"),name:p("a 360\xb0 image")},onSelect:C,accept:"image/*",allowedTypes:["image"],notices:i,onError:r.createErrorNotice}))}),save:function(e){var t=e.attributes,n=(e.className,t.url),l=(t.title,t.align,t.width),r=t.height;t.contentAlign,t.id;return wp.element.createElement("div",null,wp.element.createElement("a-scene",{className:"wp-block-cgb-block-algori-360-image-embedded-scene",style:{width:l,height:r},embedded:""},wp.element.createElement("a-sky",{src:n})))}})},function(e,t){},function(e,t){}]);