uawdijnntqw1x1x1
IP : 216.73.216.109
Hostname : premium160.web-hosting.com
Kernel : Linux premium160.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
batcwwjx
/
www
/
wp-content
/
plugins
/
woocommerce
/
assets
/
.
/
client
/
blocks
/
product-gallery.js
/
/
(()=>{"use strict";const e=window.wp.blocks,t=window.wp.data,o=window.wp.editor,i=window.wc.wcTypes;class r{blocks=new Map;initialized=!1;attemptedRegisteredBlocks=new Set;constructor(){this.initializeSubscriptions()}static getInstance(){return r.instance||(r.instance=new r),r.instance}initializeSubscriptions(){if(this.initialized)return;const e=(0,t.subscribe)((()=>{const i=(0,t.select)(o.store);if(!i)return;const r=i.getCurrentPostType();if(r)if("post"===r||"page"===r)e(),this.blocks.forEach((e=>{if(e.isAvailableOnPostEditor){const t=e.variationName||e.blockName;this.hasAttemptedRegistration(t)||this.registerBlock(e)}})),this.initialized=!0;else{e();const r=String(i.getEditedPostSlug());this.currentTemplateId=r,this.handleTemplateChange(void 0),(0,t.subscribe)((()=>{const e=this.currentTemplateId;this.currentTemplateId=String(i.getEditedPostSlug()),e!==this.currentTemplateId&&this.handleTemplateChange(e)}),o.store),this.initialized=!0}}))}handleTemplateChange(e){(this.currentTemplateId?.includes("single-product")||e?.includes("single-product"))&&this.blocks.forEach((e=>{this.unregisterBlock(e),this.registerBlock(e)}))}hasAttemptedRegistration(e){return this.attemptedRegisteredBlocks.has(e)}unregisterBlock(t){const{blockName:o,isVariationBlock:i,variationName:r}=t;try{i&&r?((0,e.unregisterBlockVariation)(o,r),this.attemptedRegisteredBlocks.delete(r)):((0,e.unregisterBlockType)(o),this.attemptedRegisteredBlocks.delete(o))}catch(e){console.debug(`Failed to unregister block ${o}:`,e)}}registerBlock(o){const{blockName:r,settings:s,isVariationBlock:l,variationName:c,isAvailableOnPostEditor:n}=o;try{const o=c||r;if(this.hasAttemptedRegistration(o))return;const a=(0,t.select)("core/edit-site");if(!a&&!n)return;if(l)(0,e.registerBlockVariation)(r,s);else{const t=(0,i.isEmpty)(s?.ancestor)?["woocommerce/single-product"]:s?.ancestor,o=a&&this.currentTemplateId?.includes("single-product");(0,e.registerBlockType)(r,{...s,ancestor:o?void 0:t})}this.attemptedRegisteredBlocks.add(o)}catch(e){console.error(`Failed to register block ${r}:`,e)}}registerBlockConfig(e){const t=e.variationName||e.blockName;this.blocks.set(t,e),this.registerBlock(e)}}const s=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"woocommerce/product-gallery","title":"Product Gallery (Beta)","description":"Showcase your products relevant images and media.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"align":true,"interactivity":true,"layout":{"default":{"type":"flex","flexWrap":"nowrap","orientation":"horizontal"},"allowOrientation":true,"allowEditing":true,"allowJustification":false}},"textdomain":"woocommerce","usesContext":["postId"],"providesContext":{"hoverZoom":"hoverZoom","fullScreenOnClick":"fullScreenOnClick"},"ancestor":["woocommerce/single-product"],"attributes":{"hoverZoom":{"type":"boolean","default":true},"fullScreenOnClick":{"type":"boolean","default":true}},"viewScript":"wc-product-gallery-frontend","example":{},"viewScriptModule":"woocommerce/product-gallery","style":"file:../woocommerce/product-gallery-style.css"}'),l=window.wp.blockEditor,c=window.wc.wcBlocksSharedHocs,n=window.wp.components,a=window.wp.i18n,d=window.ReactJSXRuntime,u=({attributes:e,setAttributes:t})=>{const{hoverZoom:o,fullScreenOnClick:i}=e;return(0,d.jsx)(l.InspectorControls,{children:(0,d.jsxs)(n.PanelBody,{title:(0,a.__)("Media Settings","woocommerce"),children:[(0,d.jsx)(n.ToggleControl,{label:(0,a.__)("Zoom while hovering","woocommerce"),help:(0,a.__)("While hovering the large image will zoom in by 30%.","woocommerce"),checked:o,onChange:()=>t({hoverZoom:!o})}),(0,d.jsx)(n.ToggleControl,{label:(0,a.__)("Open pop-up when clicked","woocommerce"),help:(0,a.__)("Clicking on the large image will open a full-screen gallery experience.","woocommerce"),checked:i,onChange:()=>t({fullScreenOnClick:!i})})]})})},m=[["woocommerce/product-gallery-thumbnails"],["woocommerce/product-gallery-large-image",{},[["woocommerce/product-image",{showProductLink:!1,showSaleBadge:!1}],["woocommerce/product-sale-badge",{align:"right"}],["woocommerce/product-gallery-large-image-next-previous"]]]];(e=>{const t=e.name;if(!t)return void console.error("registerProductBlockType: Block name is required for registration");const o=(({name:e,...t})=>t)(e),{isVariationBlock:i,variationName:s,isAvailableOnPostEditor:l,...c}={...o,...{isAvailableOnPostEditor:!0}||{}},n={blockName:t,settings:{...c},isVariationBlock:null!=i&&i,variationName:null!=s?s:void 0,isAvailableOnPostEditor:null!=l&&l};r.getInstance().registerBlockConfig(n)})({...s,icon:()=>(0,d.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,d.jsx)("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,d.jsx)("rect",{x:"4.75",y:"15.5",width:"5",height:"4.5",rx:"1",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,d.jsx)("rect",{x:"12.25",y:"15.5",width:"5",height:"4.5",rx:"1",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})]}),edit:(0,c.withProductDataContext)((({attributes:e,setAttributes:t})=>{const o=(0,l.useBlockProps)({className:"wc-block-product-gallery"});return(0,d.jsxs)("div",{...o,children:[(0,d.jsx)(l.InspectorControls,{children:(0,d.jsx)(u,{attributes:e,setAttributes:t})}),(0,d.jsx)(l.InnerBlocks,{allowedBlocks:["woocommerce/product-gallery-large-image","woocommerce/product-gallery-thumbnails"],template:m})]})})),save:()=>{const e=l.useBlockProps.save({className:"wc-block-product-gallery"}),t=l.useInnerBlocksProps.save(e);return(0,d.jsx)("div",{...t})}}),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["product-gallery"]={}})();
/home/batcwwjx/www/wp-content/plugins/woocommerce/assets/./client/blocks/product-gallery.js