1 line
No EOL
29 KiB
JavaScript
1 line
No EOL
29 KiB
JavaScript
(()=>{var e,t={900:(e,t,o)=>{"use strict";o.r(t);var r=o(9196);const l=window.wp.blocks;var i=o(5736),n=o(444),s=o(4184),a=o.n(s);const c=(0,r.createElement)((({className:e,height:t,width:o,...l})=>(0,r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 245 145",className:a()("woo-icon",e),width:o,height:t,...l},(0,r.createElement)("path",{fill:"#7f54b3",d:"M22.76 0h199.1a22.77 22.77 0 0 1 22.8 22.76v75.92a22.77 22.77 0 0 1-22.78 22.78h-71.41l9.77 24-43.13-24H22.76C10.1946 121.449.011 111.2654 0 98.7V22.76C.011 10.1946 10.1946.011 22.76 0z"}),(0,r.createElement)("path",{fill:"#FFF",fillRule:"nonzero",d:"M12.32 20.63a8.16 8.16 0 0 1 6.25-3.09c5.0733-.36 7.9867 2.0333 8.74 7.18 3.14 20.86 6.4933 38.5633 10.06 53.11l21.92-41.69c2-3.76 4.49-5.76 7.52-6 4.3867-.3067 7.13 2.49 8.23 8.39a186 186 0 0 0 9.47 34.23c2.62-25.38 7.0133-43.7133 13.18-55a7.73 7.73 0 0 1 6.6-4.43 8.8 8.8 0 0 1 6.32 2 7.75 7.75 0 0 1 3.05 5.74 8.52 8.52 0 0 1-1 4.77c-3.9 7.24-7.12 19.28-9.66 36.12-2.48 16.2533-3.3967 28.9633-2.75 38.13a12.25 12.25 0 0 1-1.16 6.56 6.32 6.32 0 0 1-5.33 3.53c-2.6667.18-5.3033-1.0567-7.91-3.71-9.2933-9.54-16.6567-23.7267-22.09-42.56C57.3 76.7167 52.48 86.3333 49.3 92.76c-5.86 11.3333-10.89 17.13-15.09 17.39-2.7333.1933-5.0667-2.0933-7-6.86-5.1-13.0933-10.5833-38.4033-16.45-75.93a8.56 8.56 0 0 1 1.56-6.73zM227.23 36.34a23.17 23.17 0 0 0-16-11.59 26.25 26.25 0 0 0-5.42-.58c-9.5867 0-17.41 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6167 14.3333 4.85 19.8a23.15 23.15 0 0 0 16 11.59 26.28 26.28 0 0 0 5.42.59c9.68 0 17.5033-5 23.47-15A53.89 53.89 0 0 0 232.08 56c0-7.7333-1.6167-14.2867-4.85-19.66zm-12.61 27.72c-1.3733 6.56-3.9167 11.5-7.63 14.82-2.9267 2.6667-5.6133 3.7433-8.06 3.23-2.4467-.5133-4.4033-2.6667-5.87-6.46a25.68 25.68 0 0 1-1.76-9.09 35.9 35.9 0 0 1 .73-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.68 25.68 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03zM164.57 36.34a23.2 23.2 0 0 0-16-11.59 26.42 26.42 0 0 0-5.43-.58c-9.5933 0-17.4167 5-23.47 15a53 53 0 0 0-7.78 28.16c0 7.7333 1.6133 14.3333 4.84 19.8a23.19 23.19 0 0 0 16 11.59 26.44 26.44 0 0 0 5.43.59c9.68 0 17.5033-5 23.47-15A53.88 53.88 0 0 0 169.4 56c0-7.7333-1.6133-14.2867-4.84-19.66h.01zm-12.61 27.72c-1.3667 6.56-3.91 11.5-7.63 14.82-2.93 2.64-5.63 3.72-8.07 3.23-2.44-.49-4.4-2.64-5.86-6.46a25.7 25.7 0 0 1-1.77-9.09 35.9 35.9 0 0 1 .74-7.34 33 33 0 0 1 5.28-11.88c3.3333-4.8933 6.8067-6.9467 10.42-6.16 2.44.4867 4.3933 2.64 5.86 6.46a25.91 25.91 0 0 1 1.76 9.12 35.73 35.73 0 0 1-.73 7.33v-.03z"}))),null);var u=o(1984),m=(o(7477),o(5605),o(4942)),d=o(9307),g=o(4333);const p=window.wp.hooks,h=(0,g.createHigherOrderComponent)((e=>{class t extends d.Component{constructor(...e){super(...e),(0,m.Z)(this,"mounted",!1)}componentDidMount(){const{block:e,setAttributes:t}=this.props;e.name.startsWith("woocommerce/")&&t(this.getAttributesWithDefaults())}componentDidUpdate(){this.props.block.name.startsWith("woocommerce/")&&!this.mounted&&(this.mounted=!0)}getAttributesWithDefaults(){const e=(0,l.getBlockType)(this.props.block.name);let t=this.props.attributes;return!this.mounted&&this.props.block.name.startsWith("woocommerce/")&&void 0!==e.attributes&&void 0!==e.defaults&&(t=Object.assign({},this.props.attributes||{}),Object.keys(e.attributes).map((o=>(void 0===t[o]&&void 0!==e.defaults[o]&&(t[o]=e.defaults[o]),o)))),t}render(){return(0,r.createElement)(e,{...this.props,attributes:this.getAttributesWithDefaults()})}}return t}),"withDefaultAttributes");(0,p.addFilter)("editor.BlockListBlock","woocommerce-blocks/block-list-block",h),(0,p.addFilter)("blocks.getBlockAttributes","woocommerce-blocks/get-block-attributes",((e,t)=>(t.name.startsWith("woocommerce/")&&Object.keys(t.attributes).map((o=>(void 0===e[o]&&void 0!==t.defaults&&void 0!==t.defaults[o]&&(e[o]=t.defaults[o]),o))),e))),o(1365);const b=window.wp.domReady;var w=o.n(b);class f{register(e,t){return Boolean((0,l.registerBlockType)(e,t))}unregister(e){return Boolean((0,l.unregisterBlockType)(e))}}class k{register(e,t){return Boolean((0,l.registerBlockVariation)(e,t))}unregister(e,t){return Boolean((0,l.unregisterBlockVariation)(e,t))}}const C=window.wp.blockEditor,v=window.wp.data,y=({blocks:e,findCondition:t})=>{for(const o of e){if(t(o))return o;if(o.innerBlocks){const e=y({blocks:o.innerBlocks,findCondition:t});if(e)return e}}},x=()=>(0,r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"49",height:"48",viewBox:"0 0 49 48",fill:"none",className:"wc-block-product-gallery-large-image-next-previous-right--inside-image"},(0,r.createElement)("g",{filter:"url(#filter0_b_397_11354)"},(0,r.createElement)("rect",{x:"0.5",width:"48",height:"48",rx:"5",fill:"black",fillOpacity:"0.5"}),(0,r.createElement)("path",{d:"M21.7001 12L19.3 14L28.5 24L19.3 34L21.7001 36L32.5 24L21.7001 12Z",fill:"white"})),(0,r.createElement)("defs",null,(0,r.createElement)("filter",{id:"filter0_b_397_11354",x:"-9.5",y:"-10",width:"68",height:"68",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},(0,r.createElement)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.createElement)("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:"5"}),(0,r.createElement)("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_397_11354"}),(0,r.createElement)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_backgroundBlur_397_11354",result:"shape"})))),E=()=>(0,r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"49",height:"48",viewBox:"0 0 49 48",fill:"none",className:"wc-block-product-gallery-large-image-next-previous-left--inside-image"},(0,r.createElement)("g",{filter:"url(#filter0_b_397_11356)"},(0,r.createElement)("rect",{x:"0.5",width:"48",height:"48",rx:"5",fill:"black",fillOpacity:"0.5"}),(0,r.createElement)("path",{d:"M28.1 12L30.5 14L21.3 24L30.5 34L28.1 36L17.3 24L28.1 12Z",fill:"white"})),(0,r.createElement)("defs",null,(0,r.createElement)("filter",{id:"filter0_b_397_11356",x:"-9.5",y:"-10",width:"68",height:"68",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},(0,r.createElement)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.createElement)("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:"5"}),(0,r.createElement)("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_397_11356"}),(0,r.createElement)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_backgroundBlur_397_11356",result:"shape"})))),_=()=>(0,r.createElement)(n.SVG,{width:"22",height:"38",viewBox:"0 0 22 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"wc-block-product-gallery-large-image-next-previous-right--outside-image"},(0,r.createElement)("path",{d:"M4.56666 0L0.766663 3.16667L15.3333 19L0.766663 34.8333L4.56666 38L21.6667 19L4.56666 0Z",fill:"black"})),B=()=>(0,r.createElement)(n.SVG,{width:"22",height:"38",viewBox:"0 0 22 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"wc-block-product-gallery-large-image-next-previous-left--outside-image"},(0,r.createElement)("path",{d:"M17.7 0L21.5 3.16667L6.93334 19L21.5 34.8333L17.7 38L0.600002 19L17.7 0Z",fill:"black"})),L=e=>{switch(e){case"bottom":case"off":return{type:"flex",orientation:"vertical"};default:return{type:"flex",flexWrap:"nowrap"}}},I=e=>"lock"===e?{lock:{move:!0,remove:!0}}:{lock:{}},T=(e,t)=>{if(void 0!==t){const o={...t,attributes:{...t.attributes,...e}};(0,v.dispatch)("core/block-editor").updateBlock(t.clientId,o)}},P=({blocks:e,lockBlocks:t})=>{for(const o of e)T(I(t?"lock":"unlock"),o)},O=(e,t)=>{const o=(0,v.select)("core/block-editor").getBlock(t);null==o||o.innerBlocks.forEach((t=>{"core/group"===t.name&&T({layout:L(e)},t)}))},V=e=>{var t;return`wc-block-product-gallery--has-next-previous-buttons-${null===(t=(e=>{switch(e){case"insideTheImage":return{PrevButtonImage:E,NextButtonImage:x,classname:"inside-image"};case"outsideTheImage":return{PrevButtonImage:B,NextButtonImage:_,classname:"outside-image"};default:return null}})(e))||void 0===t?void 0:t.classname}`},G=window.wp.components,S=(0,r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 24",fill:"none"},(0,r.createElement)("g",{clipPath:"url(#clip0_420_11645)"},(0,r.createElement)("path",{d:"M22.5 3H10.5C9.4 3 8.5 3.9 8.5 5V19C8.5 20.1 9.4 21 10.5 21H22.5C23.6 21 24.5 20.1 24.5 19V5C24.5 3.9 23.6 3 22.5 3ZM10.5 4.5H22.5C22.8 4.5 23 4.7 23 5V13.4L21 10.5C20.7 10.2 20.2 10.2 20 10.5L16.4 14L13.5 12C13.2 11.8 12.9 11.8 12.7 12L10.1 14.6V5C10 4.7 10.2 4.5 10.5 4.5ZM22.5 19.5H10.5C10.2 19.5 10 19.3 10 19V16.6L13.1 13.6L16.1 15.5C16.4 15.7 16.8 15.7 17 15.4L20.5 12L23 15.4V19C23 19.3 22.8 19.5 22.5 19.5Z",fill:"currentColor"}),(0,r.createElement)("rect",{x:"1.25",y:"3.75",width:"4.5",height:"4.5",rx:"1.25",stroke:"currentColor",strokeWidth:"1.5"}),(0,r.createElement)("rect",{x:"1.25",y:"10.75",width:"4.5",height:"4.5",rx:"1.25",stroke:"currentColor",strokeWidth:"1.5"})),(0,r.createElement)("defs",null,(0,r.createElement)("clipPath",{id:"clip0_420_11645"},(0,r.createElement)("rect",{width:"24",height:"24",fill:"white",transform:"translate(0.5)"})))),M=(0,r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},(0,r.createElement)("path",{d:"M19 3H5C3.9 3 3 3.9 3 5V12C3 13.1 3.9 14 5 14H19C20.1 14 21 13.1 21 12V5C21 3.9 20.1 3 19 3ZM5 4.5H19C19.3 4.5 19.5 4.7 19.5 5V8.4L16.5 5.5C16.2 5.2 15.7 5.2 15.5 5.5L11.9 9L9 7C8.7 6.8 8.4 6.8 8.2 7L4.6 9.6V5C4.5 4.7 4.7 4.5 5 4.5ZM19 12.5H5C4.7 12.5 4.5 12.3 4.5 12V11.6L8.6 8.6L11.6 10.5C11.9 10.7 12.3 10.7 12.5 10.4L16 7L19.5 10.4V12C19.5 12.3 19.3 12.5 19 12.5Z",fill:"currentColor"}),(0,r.createElement)("rect",{x:"6.25",y:"15.75",width:"4.5",height:"4.5",rx:"1.25",stroke:"currentColor",strokeWidth:"1.5"}),(0,r.createElement)("rect",{x:"13.25",y:"15.75",width:"4.5",height:"4.5",rx:"1.25",stroke:"currentColor",strokeWidth:"1.5"})),Z=(0,r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 24",fill:"none"},(0,r.createElement)("g",{clipPath:"url(#clip0_420_11656)"},(0,r.createElement)("path",{d:"M14.5 3H2.5C1.4 3 0.5 3.9 0.5 5V19C0.5 20.1 1.4 21 2.5 21H14.5C15.6 21 16.5 20.1 16.5 19V5C16.5 3.9 15.6 3 14.5 3ZM2.5 4.5H14.5C14.8 4.5 15 4.7 15 5V13.4L13 10.5C12.7 10.2 12.2 10.2 12 10.5L8.4 14L5.5 12C5.2 11.8 4.9 11.8 4.7 12L2.1 14.6V5C2 4.7 2.2 4.5 2.5 4.5ZM14.5 19.5H2.5C2.2 19.5 2 19.3 2 19V16.6L5.1 13.6L8.1 15.5C8.4 15.7 8.8 15.7 9 15.4L12.5 12L15 15.4V19C15 19.3 14.8 19.5 14.5 19.5Z",fill:"currentColor"}),(0,r.createElement)("rect",{x:"19.25",y:"3.75",width:"4.5",height:"4.5",rx:"1.25",stroke:"currentColor",strokeWidth:"1.5"}),(0,r.createElement)("rect",{x:"19.25",y:"10.75",width:"4.5",height:"4.5",rx:"1.25",stroke:"currentColor",strokeWidth:"1.5"})),(0,r.createElement)("defs",null,(0,r.createElement)("clipPath",{id:"clip0_420_11656"},(0,r.createElement)("rect",{width:"24",height:"24",fill:"currentColor",transform:"translate(0.5)"}))));let H=function(e){return e.OFF="off",e.LEFT="left",e.BOTTOM="bottom",e.RIGHT="right",e}({});const N={[H.OFF]:(0,i.__)("No thumbnails will be displayed.","woocommerce"),[H.LEFT]:(0,i.__)("A strip of small images will appear to the left of the main gallery image.","woocommerce"),[H.BOTTOM]:(0,i.__)("A strip of small images will appear below the main gallery image.","woocommerce"),[H.RIGHT]:(0,i.__)("A strip of small images will appear to the right of the main gallery image.","woocommerce")},A=({context:e})=>{const{productGalleryClientId:t}=e,{updateBlockAttributes:o}=(0,v.useDispatch)(C.store);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(G.__experimentalToggleGroupControl,{className:"wc-block-editor-product-gallery-thumbnails__position-toggle",isBlock:!0,label:(0,i.__)("Thumbnails","woocommerce"),value:e.thumbnailsPosition,help:N[e.thumbnailsPosition],onChange:e=>o(t,{thumbnailsPosition:e})},(0,r.createElement)(G.__experimentalToggleGroupControlOption,{value:H.OFF,label:(0,i.__)("Off","woocommerce")}),(0,r.createElement)(G.__experimentalToggleGroupControlOption,{value:H.LEFT,label:(0,r.createElement)(u.Z,{size:32,icon:S})}),(0,r.createElement)(G.__experimentalToggleGroupControlOption,{value:H.BOTTOM,label:(0,r.createElement)(u.Z,{size:32,icon:M})}),(0,r.createElement)(G.__experimentalToggleGroupControlOption,{value:H.RIGHT,label:(0,r.createElement)(u.Z,{size:32,icon:Z})})),e.thumbnailsPosition!==H.OFF&&(0,r.createElement)(G.RangeControl,{label:(0,i.__)("Number of Thumbnails","woocommerce"),value:e.thumbnailsNumberOfThumbnails,onChange:e=>o(t,{thumbnailsNumberOfThumbnails:e}),help:(0,i.__)("Choose how many thumbnails (2-8) will display. If more images exist, a “View all” button will display.","woocommerce"),max:8,min:2}))};let F=function(e){return e.DIGITS="digits",e.DOTS="dots",e.OFF="off",e}({});(0,r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12"},(0,r.createElement)("circle",{cx:"6",cy:"6",r:"6",fill:"black",fillOpacity:"0.2"})),(0,r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12"},(0,r.createElement)("circle",{cx:"6",cy:"6",r:"6",fill:"black"}));const W=()=>(0,r.createElement)(n.SVG,{width:"80",height:"36",viewBox:"0 0 80 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("circle",{cx:"32.6665",cy:"18",r:"3",fill:"currentColor"}),(0,r.createElement)("circle",{cx:"40.6665",cy:"18",r:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),(0,r.createElement)("circle",{cx:"48.6665",cy:"18",r:"2.25",stroke:"currentColor",strokeWidth:"1.5"})),D=()=>(0,r.createElement)(n.SVG,{width:"80",height:"36",viewBox:"0 0 80 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M30.1417 22H31.9288V14.9541H30.1417L28.3497 16.1748V17.7178L30.0489 16.5703H30.1417V22ZM36.9771 22H41.7231V21.0674H38.4663V20.9697L39.9604 19.4805C41.2397 18.2109 41.6108 17.5957 41.6108 16.7949V16.7803C41.6108 15.6182 40.644 14.7832 39.3306 14.7832C37.9146 14.7832 36.9185 15.6914 36.9136 16.9805L36.9233 16.9902H37.9487L37.9536 16.9756C37.9536 16.2041 38.481 15.6865 39.272 15.6865C40.0435 15.6865 40.5171 16.1943 40.5171 16.8828V16.8975C40.5171 17.4688 40.2485 17.8301 39.3159 18.8018L36.9771 21.2578V22ZM48.7392 22.1318C50.2333 22.1318 51.2929 21.2627 51.2929 20.0518V20.042C51.2929 19.0557 50.5995 18.4307 49.5644 18.3379V18.3135C50.4237 18.1328 51.0487 17.5469 51.0487 16.6729V16.6631C51.0487 15.5742 50.1308 14.8223 48.7294 14.8223C47.3524 14.8223 46.4149 15.6084 46.3075 16.7949L46.3026 16.8486H47.328L47.3329 16.7998C47.4013 16.1357 47.9481 15.7207 48.7294 15.7207C49.5253 15.7207 49.9843 16.1211 49.9843 16.8047V16.8145C49.9843 17.4688 49.4374 17.9424 48.6317 17.9424H47.8065V18.792H48.6659C49.6034 18.792 50.1796 19.2363 50.1796 20.0322V20.042C50.1796 20.7354 49.5985 21.2188 48.7392 21.2188C47.8651 21.2188 47.2743 20.7695 47.206 20.1299L47.2011 20.0811H46.1562L46.161 20.1396C46.2538 21.3066 47.2353 22.1318 48.7392 22.1318Z",fill:"currentColor"})),R=e=>{switch(e){case F.DIGITS:return(0,i.__)("A list of numbers will show to indicate the number of items.","woocommerce");case F.DOTS:return(0,i.__)("A series of dots will show to indicate the number of items.","woocommerce");default:return(0,i.__)("No pager will be displayed.","woocommerce")}},j=({context:e})=>{const{productGalleryClientId:t,pagerDisplayMode:o}=e,{updateBlockAttributes:l}=(0,v.useDispatch)(C.store);return(0,r.createElement)(G.__experimentalToggleGroupControl,{label:(0,i.__)("Pager","woocommerce"),style:{width:"100%"},onChange:e=>{l(t,{pagerDisplayMode:e})},help:R(o),value:o},(0,r.createElement)(G.__experimentalToggleGroupControlOption,{value:F.OFF,label:(0,i.__)("Off","woocommerce")}),(0,r.createElement)(G.__experimentalToggleGroupControlOption,{value:F.DOTS,label:(0,r.createElement)(W,null)}),(0,r.createElement)(G.__experimentalToggleGroupControlOption,{value:F.DIGITS,label:(0,r.createElement)(D,null)}))};let z=function(e){return e.off="off",e.insideTheImage="insideTheImage",e.outsideTheImage="outsideTheImage",e}({});const U={[z.insideTheImage]:(0,r.createElement)((()=>(0,r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"18",viewBox:"0 0 30 18",fill:"none"},(0,r.createElement)("path",{d:"M4.525 8.8L6.825 6.5L5.825 5.5L3.525 7.8C2.825 8.5 2.825 9.6 3.525 10.3L5.825 12.6L6.925 11.5L4.625 9.2C4.425 9.1 4.425 8.9 4.525 8.8Z",fill:"currentColor"}),(0,r.createElement)("path",{d:"M25.4 8.8L23.1 6.5L24.1 5.5L26.4 7.8C27.1 8.5 27.1 9.6 26.4 10.3L24.1 12.6L23 11.5L25.3 9.2C25.5 9.1 25.5 8.9 25.4 8.8Z",fill:"currentColor"}),(0,r.createElement)("rect",{x:"0.75",y:"0.75",width:"28.5",height:"16.5",rx:"1.25",stroke:"currentColor",strokeWidth:"1.5"}))),null),[z.outsideTheImage]:(0,r.createElement)((()=>(0,r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"38",height:"18",viewBox:"0 0 38 18",fill:"none"},(0,r.createElement)("path",{d:"M1.525 8.3L5.825 4L4.825 3L0.525 7.3C-0.175 8 -0.175 9.1 0.525 9.8L4.825 14.1L5.925 13L1.625 8.7C1.425 8.6 1.425 8.4 1.525 8.3Z",fill:"currentColor"}),(0,r.createElement)("path",{d:"M37.325 7.3L33.025 3L31.925 4.1L36.2251 8.4C36.3251 8.5 36.3251 8.7 36.2251 8.8L31.925 13.1L33.025 14.2L37.325 9.9C38.025 9.1 38.025 8 37.325 7.3Z",fill:"currentColor"}),(0,r.createElement)("path",{d:"M25.925 0H11.925C10.825 0 9.92505 0.9 9.92505 2V16C9.92505 17.1 10.825 18 11.925 18H25.925C27.025 18 27.925 17.1 27.925 16V2C27.925 0.9 27.025 0 25.925 0ZM11.925 1.5H25.925C26.225 1.5 26.425 1.7 26.425 2V10.4L23.425 7.5C23.125 7.2 22.625 7.2 22.425 7.5L18.825 11L15.925 9C15.625 8.8 15.325 8.8 15.125 9L11.525 11.6V2C11.425 1.7 11.625 1.5 11.925 1.5ZM25.925 16.5H11.925C11.625 16.5 11.425 16.3 11.425 16V13.6L15.525 10.6L18.525 12.5C18.825 12.7 19.225 12.7 19.425 12.4L22.925 9L26.425 12.4V16C26.425 16.3 26.225 16.5 25.925 16.5Z",fill:"currentColor"}))),null)},J=e=>{switch(e){case z.insideTheImage:return(0,i.__)("Next and previous buttons will appear inside the large image.","woocommerce");case z.outsideTheImage:return(0,i.__)("Next and previous buttons will appear on outside the large image.","woocommerce");default:return(0,i.__)("No next or previous button will be displayed.","woocommerce")}},$=({context:e})=>{const{productGalleryClientId:t,nextPreviousButtonsPosition:o}=e,{updateBlockAttributes:l}=(0,v.useDispatch)(C.store);return(0,r.createElement)(G.__experimentalToggleGroupControl,{label:(0,i.__)("Next/Prev Buttons","woocommerce"),className:"wc-block-editor-product-gallery-large-image-next-previous-settings",style:{width:"100%"},onChange:e=>l(t,{nextPreviousButtonsPosition:e}),help:J(o),value:o},(0,r.createElement)(G.__experimentalToggleGroupControlOption,{value:z.off,label:(0,i.__)("Off","woocommerce")}),(0,r.createElement)(G.__experimentalToggleGroupControlOption,{value:z.insideTheImage,label:U.insideTheImage}),(0,r.createElement)(G.__experimentalToggleGroupControlOption,{value:z.outsideTheImage,label:U.outsideTheImage}))},q=({attributes:e,setAttributes:t,context:o})=>{const{cropImages:l,hoverZoom:n,fullScreenOnClick:s}=e,{productGalleryClientId:a,pagerDisplayMode:c,nextPreviousButtonsPosition:u,thumbnailsNumberOfThumbnails:m,thumbnailsPosition:d}=o;return(0,r.createElement)(C.InspectorControls,null,(0,r.createElement)(G.PanelBody,{title:(0,i.__)("Gallery Navigation","woocommerce")},(0,r.createElement)(j,{context:{productGalleryClientId:a,pagerDisplayMode:c}}),(0,r.createElement)($,{context:{productGalleryClientId:a,nextPreviousButtonsPosition:u}}),(0,r.createElement)(A,{context:{productGalleryClientId:a,thumbnailsNumberOfThumbnails:m,thumbnailsPosition:d}})),(0,r.createElement)(G.PanelBody,{title:(0,i.__)("Media Settings","woocommerce")},(0,r.createElement)(G.ToggleControl,{label:(0,i.__)("Crop images to fit","woocommerce"),help:(0,i.__)("Images will be cropped to fit within a square space.","woocommerce"),checked:l,onChange:()=>t({cropImages:!l}),className:"wc-block-product-gallery__crop-images"}),(0,r.createElement)(G.ToggleControl,{label:(0,i.__)("Zoom while hovering","woocommerce"),help:(0,i.__)("While hovering the large image will zoom in by 30%.","woocommerce"),checked:n,onChange:()=>t({hoverZoom:!n})}),(0,r.createElement)(G.ToggleControl,{label:(0,i.__)("Full-screen when clicked","woocommerce"),help:(0,i.__)("Clicking on the large image will open a full-screen gallery experience.","woocommerce"),checked:s,onChange:()=>t({fullScreenOnClick:!s})})))},K=[["core/group",{layout:{type:"flex",flexWrap:"nowrap"}},[["woocommerce/product-gallery-thumbnails",I("lock")],["core/group",{layout:{type:"flex",orientation:"vertical",justifyContent:"center"},...I("lock")},[["woocommerce/product-gallery-large-image",I("lock"),[["woocommerce/product-sale-badge",{align:"right",style:{spacing:{margin:{top:"4px",right:"4px",bottom:"4px",left:"4px"}}},lock:{move:!0}}],["woocommerce/product-gallery-large-image-next-previous",{layout:{type:"flex",verticalAlignment:"bottom"},lock:{move:!0,remove:!0}}]]],["woocommerce/product-gallery-pager",{lock:{move:!0,remove:!0}}]]]]]],Q={icon:()=>(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M19 3H5C4.4 3 4 3.4 4 4V11C4 11.5 4.4 12 5 12H19C19.5 12 20 11.6 20 11V4C20 3.4 19.6 3 19 3ZM5.5 10.5V10.1L7.3 8.8L8.6 9.6C8.9 9.8 9.3 9.8 9.5 9.5L11 8.1L13.4 10.5H5.5ZM18.5 10.5H15.6L11.6 6.5C11.3 6.2 10.8 6.2 10.5 6.5L8.9 8L7.7 7.2C7.4 7 7.1 7 6.8 7.2L5.5 8.2V4.5H18.5V10.5Z",fill:"currentColor"}),(0,r.createElement)("rect",{x:"4.75",y:"15.5",width:"5",height:"4.5",rx:"1",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,r.createElement)("rect",{x:"12.25",y:"15.5",width:"5",height:"4.5",rx:"1",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})),edit:({clientId:e,attributes:t,setAttributes:o})=>{const l=(0,C.useBlockProps)({className:V(t.nextPreviousButtonsPosition)}),{currentTemplateId:i,templateType:n}=(0,v.useSelect)((e=>({currentTemplateId:e("core/edit-site").getEditedPostId(),templateType:e("core/edit-site").getEditedPostType()})),[]);return(0,d.useEffect)((()=>{const r=((e,t)=>"wp_template_part"===t&&e.includes("product-gallery")?"full":"standard")(i,n);o({...t,mode:r,productGalleryClientId:e}),((e,t)=>{const{getBlock:o,getBlockRootClientId:r,getBlockIndex:l}=(0,v.select)("core/block-editor"),{moveBlockToPosition:i}=(0,v.dispatch)("core/block-editor"),n=o(t);if(n){const o=n.innerBlocks.length?n.innerBlocks[0].attributes.layout:null,s=y({blocks:[n],findCondition:e=>"woocommerce/product-gallery-thumbnails"===e.name}),a=y({blocks:[n],findCondition(e){var t;return Boolean(null===(t=e.innerBlocks)||void 0===t?void 0:t.find((e=>"woocommerce/product-gallery-large-image"===e.name)))}}),c=l((null==a?void 0:a.clientId)||""),u=l((null==s?void 0:s.clientId)||"");if(a&&s&&-1!==c&&-1!==u){P({blocks:[s,a],lockBlocks:!1});const{thumbnailsPosition:l}=e;if(O(l,t),O(l,n.innerBlocks[0].clientId),o){const e=L(l).orientation;T({layout:{...o,orientation:e}},n.innerBlocks[0])}(("bottom"===l||"right"===l)&&u<c||"left"===l&&u>c)&&i(s.clientId,r(s.clientId)||void 0,r(a.clientId)||void 0,c),P({blocks:[s,a],lockBlocks:!0})}}})(t,e)}),[o,t,e,i,n]),(0,r.createElement)("div",{...l},(0,r.createElement)(C.InspectorControls,null,(0,r.createElement)(q,{attributes:t,setAttributes:o,context:{productGalleryClientId:e,pagerDisplayMode:t.pagerDisplayMode,thumbnailsPosition:t.thumbnailsPosition,thumbnailsNumberOfThumbnails:t.thumbnailsNumberOfThumbnails,nextPreviousButtonsPosition:t.nextPreviousButtonsPosition}})),(0,r.createElement)(C.InnerBlocks,{allowedBlocks:["woocommerce/product-gallery-large-image","woocommerce/product-gallery-thumbnails"],templateLock:!1,template:K}))},save:({attributes:e})=>{const t=C.useBlockProps.save({className:a()("wc-block-product-gallery",V(e.nextPreviousButtonsPosition))}),o=C.useInnerBlocksProps.save(t);return(0,r.createElement)("div",{...o})}},X=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce/product-gallery","version":"1.0.0","title":"Product Gallery","description":"Showcase your products relevant images and media.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"align":true,"multiple":false,"interactivity":true},"textdomain":"woocommerce","usesContext":["postId"],"providesContext":{"thumbnailsPosition":"thumbnailsPosition","thumbnailsNumberOfThumbnails":"thumbnailsNumberOfThumbnails","productGalleryClientId":"productGalleryClientId","nextPreviousButtonsPosition":"nextPreviousButtonsPosition","pagerDisplayMode":"pagerDisplayMode","hoverZoom":"hoverZoom","fullScreenOnClick":"fullScreenOnClick","mode":"mode","cropImages":"cropImages"},"attributes":{"thumbnailsPosition":{"type":"string","default":"left"},"thumbnailsNumberOfThumbnails":{"type":"number","default":3},"pagerDisplayMode":{"type":"string","default":"dots"},"productGalleryClientId":{"type":"string","default":""},"cropImages":{"type":"boolean","default":false},"hoverZoom":{"type":"boolean","default":true},"fullScreenOnClick":{"type":"boolean","default":true},"nextPreviousButtonsPosition":{"type":"string","default":"insideTheImage"},"mode":{"type":"string","default":"standard"}},"viewScript":"wc-product-gallery-frontend","example":{}}'),Y={[X.name]:{blockMetadata:X,blockSettings:Q,allowedTemplates:{"single-product":!0},allowedTemplateParts:{"product-gallery":!0},availableInPostOrPageEditor:!1,isVariationBlock:!1}};class ee{constructor(){(0,m.Z)(this,"unregisteredBlocks",[]),(0,m.Z)(this,"blockRegistrationStrategy",void 0),this.blockRegistrationStrategy=new f}shouldBlockBeRegistered({blockWithRestrictionName:e,currentTemplateId:t,isPostOrPage:o}){const{allowedTemplates:r,allowedTemplateParts:l,availableInPostOrPageEditor:i}=Y[e],n=Object.keys(r).some((e=>t.startsWith(e))),s=Object.keys(l).some((e=>t.startsWith(e)));return n||s||o&&i}unregisterBlocksBeforeEnteringRestrictedArea({currentTemplateId:e,isPostOrPage:t}){for(const o of Object.keys(Y))this.shouldBlockBeRegistered({blockWithRestrictionName:o,currentTemplateId:e,isPostOrPage:t})||(0,l.getBlockType)(o)&&(this.blockRegistrationStrategy=Y[o].isVariationBlock?new k:new f,this.blockRegistrationStrategy.unregister(o),this.unregisteredBlocks.push(o))}registerBlocksAfterLeavingRestrictedArea(){for(const e of this.unregisteredBlocks){if(!(0,l.getBlockType)(e))continue;const t=Y[e];this.blockRegistrationStrategy=Y[e].isVariationBlock?new k:new f;const o=this.blockRegistrationStrategy.register(t.blockMetadata,t.blockSettings);this.unregisteredBlocks=o?this.unregisteredBlocks.filter((t=>t!==e)):this.unregisteredBlocks}}run(e){this.registerBlocksAfterLeavingRestrictedArea(),this.unregisterBlocksBeforeEnteringRestrictedArea({currentTemplateId:e.getCurrentTemplateId()||"",isPostOrPage:e.getIsPostOrPage()})}}class te{constructor(){(0,m.Z)(this,"previousTemplateId",void 0),(0,m.Z)(this,"currentTemplateId",void 0),(0,m.Z)(this,"isPostOrPage",void 0),(0,m.Z)(this,"observers",[]),this.isPostOrPage=!1,(0,v.subscribe)((()=>{this.checkIfTemplateHasChangedAndNotifySubscribers()}),"core/edit-site")}add(e){this.observers.push(e)}notify(){for(const e of this.observers)e.run(this)}getPreviousTemplateId(){return this.previousTemplateId}getCurrentTemplateId(){return this.currentTemplateId}getIsPostOrPage(){return this.isPostOrPage}parseTemplateId(e){return"number"==typeof e?String(e):null==e?void 0:e.split("//")[1]}checkIfTemplateHasChangedAndNotifySubscribers(){var e,t;this.previousTemplateId=this.currentTemplateId;const o=null===(e=(0,v.select)("core/editor"))||void 0===e?void 0:e.getCurrentPostId();this.isPostOrPage=Boolean(o);const r=o||(null===(t=(0,v.select)("core/edit-site"))||void 0===t?void 0:t.getEditedPostId());this.currentTemplateId=this.parseTemplateId(r);const l=this.previousTemplateId!==this.currentTemplateId,i=Boolean(this.currentTemplateId);l&&i&&this.notify()}}w()((()=>{const e=new te,t=new ee;e.add(t)})),(0,l.setCategories)([...(0,l.getCategories)().filter((({slug:e})=>"woocommerce"!==e&&"woocommerce-product-elements"!==e)),{slug:"woocommerce",title:(0,i.__)("WooCommerce","woocommerce"),icon:(0,r.createElement)(u.Z,{icon:c})},{slug:"woocommerce-product-elements",title:(0,i.__)("WooCommerce Product Elements","woocommerce"),icon:(0,r.createElement)(u.Z,{icon:c,className:"wc-block-editor-components-block-icon"})}])},7477:()=>{},5605:()=>{},1365:()=>{},9196:e=>{"use strict";e.exports=window.React},4333:e=>{"use strict";e.exports=window.wp.compose},9307:e=>{"use strict";e.exports=window.wp.element},5736:e=>{"use strict";e.exports=window.wp.i18n},444:e=>{"use strict";e.exports=window.wp.primitives}},o={};function r(e){var l=o[e];if(void 0!==l)return l.exports;var i=o[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,o,l,i)=>{if(!o){var n=1/0;for(u=0;u<e.length;u++){for(var[o,l,i]=e[u],s=!0,a=0;a<o.length;a++)(!1&i||n>=i)&&Object.keys(r.O).every((e=>r.O[e](o[a])))?o.splice(a--,1):(s=!1,i<n&&(n=i));if(s){e.splice(u--,1);var c=l();void 0!==c&&(t=c)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[o,l,i]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=1429,(()=>{var e={1429:0};r.O.j=t=>0===e[t];var t=(t,o)=>{var l,i,[n,s,a]=o,c=0;if(n.some((t=>0!==e[t]))){for(l in s)r.o(s,l)&&(r.m[l]=s[l]);if(a)var u=a(r)}for(t&&t(o);c<n.length;c++)i=n[c],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(u)},o=self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var l=r.O(void 0,[2869],(()=>r(900)));l=r.O(l),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["wc-blocks"]=l})(); |