OwlCyberSecurity - MANAGER
Edit File: product-gallery.js
(()=>{var e,t,r,o={8772:(e,t,r)=>{"use strict";r.r(t);var o=r(2294),l=r(4997);const i=window.wp.data,a=window.wc.wcTypes;class n{constructor(){(0,o.A)(this,"blocks",new Map),(0,o.A)(this,"currentTemplateId",void 0),(0,o.A)(this,"initialized",!1),(0,o.A)(this,"attemptedRegisteredBlocks",new Set),this.initializeSubscriptions()}static getInstance(){return n.instance||(n.instance=new n),n.instance}parseTemplateId(e){const t=(0,a.isNumber)(e)?void 0:e;return null==t?void 0:t.split("//")[1]}initializeSubscriptions(){if(this.initialized)return;const e=(0,i.subscribe)((()=>{const t=(0,i.select)("core/edit-site"),r=(0,i.select)("core/edit-post");if(t||r)if(t){const r=t.getEditedPostId();e(),this.currentTemplateId="string"==typeof r?this.parseTemplateId(r):void 0,(0,i.subscribe)((()=>{const e=this.currentTemplateId;this.currentTemplateId=this.parseTemplateId(t.getEditedPostId()),e!==this.currentTemplateId&&this.handleTemplateChange(e)}),"core/edit-site"),this.initialized=!0}else r&&(e(),this.blocks.forEach((e=>{if(e.isAvailableOnPostEditor){const t=e.variationName||e.blockName;this.hasAttemptedRegistration(t)||this.registerBlock(e)}})),this.initialized=!0)}))}handleTemplateChange(e){var t;((null===(t=this.currentTemplateId)||void 0===t?void 0:t.includes("single-product"))||(null==e?void 0:e.includes("single-product")))&&this.blocks.forEach((e=>{this.unregisterBlock(e),this.registerBlock(e)}))}hasAttemptedRegistration(e){return this.attemptedRegisteredBlocks.has(e)}unregisterBlock(e){const{blockName:t,isVariationBlock:r,variationName:o}=e;try{r&&o?((0,l.unregisterBlockVariation)(t,o),this.attemptedRegisteredBlocks.delete(o)):((0,l.unregisterBlockType)(t),this.attemptedRegisteredBlocks.delete(t))}catch(e){console.debug(`Failed to unregister block ${t}:`,e)}}registerBlock(e){const{blockName:t,settings:r,isVariationBlock:o,variationName:n,isAvailableOnPostEditor:s}=e;try{const e=n||t;if(this.hasAttemptedRegistration(e))return;const m=(0,i.select)("core/edit-site");if(!m&&!s)return;if(o)(0,l.registerBlockVariation)(t,r);else{var c;const e=(0,a.isEmpty)(null==r?void 0:r.ancestor)?["woocommerce/single-product"]:null==r?void 0:r.ancestor,o=m&&(null===(c=this.currentTemplateId)||void 0===c?void 0:c.includes("single-product"));(0,l.registerBlockType)(t,{...r,ancestor:o?void 0:e})}this.attemptedRegisteredBlocks.add(e)}catch(e){console.error(`Failed to register block ${t}:`,e)}}registerBlockConfig(e){const t=e.variationName||e.blockName;this.blocks.set(t,e),this.registerBlock(e)}}(0,o.A)(n,"instance",void 0);const s=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"woocommerce/product-gallery","version":"1.0.0","title":"Product Gallery (Beta)","description":"Showcase your products relevant images and media.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"align":true,"interactivity":true},"textdomain":"woocommerce","usesContext":["postId"],"providesContext":{"hoverZoom":"hoverZoom","fullScreenOnClick":"fullScreenOnClick","cropImages":"cropImages"},"ancestor":["woocommerce/single-product"],"attributes":{"cropImages":{"type":"boolean","default":false},"hoverZoom":{"type":"boolean","default":true},"fullScreenOnClick":{"type":"boolean","default":true}},"viewScript":"wc-product-gallery-frontend","example":{}}');var c=r(1609),m=r(4715),u=r(6427),d=r(7723);const p=({attributes:e,setAttributes:t})=>{const{cropImages:r,hoverZoom:o,fullScreenOnClick:l}=e;return(0,c.createElement)(m.InspectorControls,null,(0,c.createElement)(u.PanelBody,{title:(0,d.__)("Media Settings","woocommerce")},(0,c.createElement)(u.ToggleControl,{label:(0,d.__)("Crop images to fit","woocommerce"),help:(0,d.__)("Images will be cropped to fit within a square space.","woocommerce"),checked:r,onChange:()=>t({cropImages:!r}),className:"wc-block-product-gallery__crop-images"}),(0,c.createElement)(u.ToggleControl,{label:(0,d.__)("Zoom while hovering","woocommerce"),help:(0,d.__)("While hovering the large image will zoom in by 30%.","woocommerce"),checked:o,onChange:()=>t({hoverZoom:!o})}),(0,c.createElement)(u.ToggleControl,{label:(0,d.__)("Open pop-up when clicked","woocommerce"),help:(0,d.__)("Clicking on the large image will open a full-screen gallery experience.","woocommerce"),checked:l,onChange:()=>t({fullScreenOnClick:!l})})))},g=[["core/group",{layout:{type:"flex",flexWrap:"nowrap",verticalAlignment:"top"},metadata:{name:"Gallery Area"}},[["woocommerce/product-gallery-thumbnails"],["core/group",{layout:{type:"flex",orientation:"vertical",justifyContent:"center",verticalAlignment:"top"},style:{layout:{selfStretch:"fixed",flexSize:"100%"}},metadata:{name:"Large Image and Navigation"}},[["woocommerce/product-gallery-large-image",{},[["woocommerce/product-sale-badge",{align:"right",style:{spacing:{margin:{top:"4px",right:"4px",bottom:"4px",left:"4px"}}}}],["woocommerce/product-gallery-large-image-next-previous",{layout:{type:"flex",verticalAlignment:"bottom"}}]]],["woocommerce/product-gallery-pager"]]]]]],h={icon:()=>(0,c.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,c.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,c.createElement)("rect",{x:"4.75",y:"15.5",width:"5",height:"4.5",rx:"1",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,c.createElement)("rect",{x:"12.25",y:"15.5",width:"5",height:"4.5",rx:"1",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})),edit:({attributes:e,setAttributes:t})=>{const r=(0,m.useBlockProps)();return(0,c.createElement)("div",{...r},(0,c.createElement)(m.InspectorControls,null,(0,c.createElement)(p,{attributes:e,setAttributes:t})),(0,c.createElement)(m.InnerBlocks,{allowedBlocks:["woocommerce/product-gallery-large-image","woocommerce/product-gallery-thumbnails"],templateLock:!1,template:g}))},save:()=>{const e=m.useBlockProps.save({className:"wc-block-product-gallery"}),t=m.useInnerBlocksProps.save(e);return(0,c.createElement)("div",{...t})}};r(5478),r(6278),r(1886),r(3113),(e=>{const t=e.name;if(!t)return void console.error("registerProductBlockType: Block name is required for registration");const r=(({name:e,...t})=>t)(e),{isVariationBlock:o,variationName:l,isAvailableOnPostEditor:i,...a}={...r,...{isAvailableOnPostEditor:!0}||{}},s={blockName:t,settings:{...a},isVariationBlock:null!=o&&o,variationName:null!=l?l:void 0,isAvailableOnPostEditor:null!=i&&i};n.getInstance().registerBlockConfig(s)})({...s,...h})},6278:(e,t,r)=>{"use strict";var o=r(4997),l=r(1609),i=r(4715),a=r(851),n=r(5573);const s=()=>(0,l.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"},(0,l.createElement)("g",{filter:"url(#filter0_b_397_11354)"},(0,l.createElement)("rect",{x:"0.5",width:"48",height:"48",rx:"5",fill:"black",fillOpacity:"0.5"}),(0,l.createElement)("path",{d:"M21.7001 12L19.3 14L28.5 24L19.3 34L21.7001 36L32.5 24L21.7001 12Z",fill:"white"})),(0,l.createElement)("defs",null,(0,l.createElement)("filter",{id:"filter0_b_397_11354",x:"-9.5",y:"-10",width:"68",height:"68",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},(0,l.createElement)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,l.createElement)("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:"5"}),(0,l.createElement)("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_397_11354"}),(0,l.createElement)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_backgroundBlur_397_11354",result:"shape"})))),c=()=>(0,l.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"},(0,l.createElement)("g",{filter:"url(#filter0_b_397_11356)"},(0,l.createElement)("rect",{x:"0.5",width:"48",height:"48",rx:"5",fill:"black",fillOpacity:"0.5"}),(0,l.createElement)("path",{d:"M28.1 12L30.5 14L21.3 24L30.5 34L28.1 36L17.3 24L28.1 12Z",fill:"white"})),(0,l.createElement)("defs",null,(0,l.createElement)("filter",{id:"filter0_b_397_11356",x:"-9.5",y:"-10",width:"68",height:"68",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},(0,l.createElement)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,l.createElement)("feGaussianBlur",{in:"BackgroundImageFix",stdDeviation:"5"}),(0,l.createElement)("feComposite",{in2:"SourceAlpha",operator:"in",result:"effect1_backgroundBlur_397_11356"}),(0,l.createElement)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_backgroundBlur_397_11356",result:"shape"})))),m=e=>{switch(e){case"top":return"flex-start";case"center":return"center";default:return"flex-end"}},u=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"woocommerce/product-gallery-large-image-next-previous","version":"1.0.0","title":"Next/Previous Buttons","description":"Display next and previous buttons.","category":"woocommerce","keywords":["WooCommerce"],"usesContext":["postId"],"textdomain":"woocommerce","supports":{"layout":{"default":{"type":"flex","verticalAlignment":"bottom"},"allowVerticalAlignment":true,"allowJustification":false,"allowOrientation":false,"allowInheriting":false}},"ancestor":["woocommerce/product-gallery-large-image"]}');(0,o.registerBlockType)(u,{icon:()=>(0,l.createElement)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.22448 1.5L1.5 6.81504V11.7072L5.12953 9.06066C5.38061 8.87758 5.71858 8.86829 5.97934 9.0373L8.90601 10.9342L12.4772 7.46225C12.7683 7.17925 13.2317 7.17925 13.5228 7.46225L16.5 10.3568V2C16.5 1.72386 16.2761 1.5 16 1.5H6.22448ZM1.5 13.5636V16C1.5 16.2761 1.72386 16.5 2 16.5H16C16.2761 16.5 16.5 16.2761 16.5 16V12.4032L16.4772 12.4266L13 9.04603L9.52279 12.4266C9.27191 12.6706 8.88569 12.7086 8.59206 12.5183L5.59643 10.5766L1.5 13.5636ZM0 2C0 0.89543 0.895431 0 2 0H16C17.1046 0 18 0.895431 18 2V16C18 17.1046 17.1046 18 16 18H2C0.89543 18 0 17.1046 0 16V2Z",fill:"#1E1E1E"})),edit:({attributes:e})=>{var t;const r=(0,i.useBlockProps)({style:{width:"100%",alignItems:m(null===(t=e.layout)||void 0===t?void 0:t.verticalAlignment)},className:(0,a.A)("wc-block-editor-product-gallery-large-image-next-previous","wc-block-product-gallery-large-image-next-previous")});return(0,l.createElement)("div",{...r},(0,l.createElement)("div",{className:(0,a.A)("wc-block-product-gallery-large-image-next-previous-container")},(0,l.createElement)(c,null),(0,l.createElement)(s,null)))},save:()=>(0,l.createElement)("div",{...i.useBlockProps.save()})})},1886:(e,t,r)=>{"use strict";var o=r(4997),l=r(1609),i=r(4715);const a=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"woocommerce/product-gallery-pager","version":"1.0.0","title":"Pager","description":"Display the gallery pager in format \\"current image/total images\\".","category":"woocommerce","keywords":["WooCommerce"],"textdomain":"woocommerce","ancestor":["woocommerce/product-gallery"],"supports":{"color":{"text":true,"background":true},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true,"textAlign":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalLetterSpacing":true}},"usesContext":["postId"]}');(0,o.registerBlockType)(a,{icon:()=>(0,l.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.00018 11L7.00018 11L7.00018 13H5.00018V11ZM11.0002 11L13.0002 11V13H11.0002V11ZM17.0002 11L19.0002 11V13H17.0002V11Z",fill:"currentColor"})),edit:()=>{const e=(0,i.useBlockProps)({className:"wc-block-product-gallery-pager"});return(0,l.createElement)("div",{...e},"3/7")},save:()=>null})},3113:(e,t,r)=>{"use strict";var o=r(4997),l=r(1609);var i=r(4715),a=r(6427);const n=window.wc.wcSettings;var s,c,m,u,d,p,g,h,w,f;const v=(0,n.getSetting)("wcBlocksConfig",{pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),b=v.pluginUrl+"assets/images/",k=(v.pluginUrl,null===(s=n.STORE_PAGES.shop)||void 0===s||s.permalink,null===(c=n.STORE_PAGES.checkout)||void 0===c||c.id,null===(m=n.STORE_PAGES.checkout)||void 0===m||m.permalink,null===(u=n.STORE_PAGES.privacy)||void 0===u||u.permalink,null===(d=n.STORE_PAGES.privacy)||void 0===d||d.title,null===(p=n.STORE_PAGES.terms)||void 0===p||p.permalink,null===(g=n.STORE_PAGES.terms)||void 0===g||g.title,null===(h=n.STORE_PAGES.cart)||void 0===h||h.id,null===(w=n.STORE_PAGES.cart)||void 0===w||w.permalink,null!==(f=n.STORE_PAGES.myaccount)&&void 0!==f&&f.permalink?n.STORE_PAGES.myaccount.permalink:(0,n.getSetting)("wpLoginUrl","/wp-login.php"),(0,n.getSetting)("localPickupEnabled",!1),(0,n.getSetting)("shippingMethodsExist",!1),(0,n.getSetting)("shippingEnabled",!0),(0,n.getSetting)("countries",{})),y=(0,n.getSetting)("countryData",{}),E=(Object.fromEntries(Object.keys(y).filter((e=>!0===y[e].allowBilling)).map((e=>[e,k[e]||""]))),Object.fromEntries(Object.keys(y).filter((e=>!0===y[e].allowBilling)).map((e=>[e,y[e].states||{}]))),Object.fromEntries(Object.keys(y).filter((e=>!0===y[e].allowShipping)).map((e=>[e,k[e]||""]))),Object.fromEntries(Object.keys(y).filter((e=>!0===y[e].allowShipping)).map((e=>[e,y[e].states||{}]))),Object.fromEntries(Object.keys(y).map((e=>[e,y[e].locale||{}]))),{address:["first_name","last_name","company","address_1","address_2","city","postcode","country","state","phone"],contact:["email"],order:[]});(0,n.getSetting)("addressFieldsLocations",E).address,(0,n.getSetting)("addressFieldsLocations",E).contact,(0,n.getSetting)("addressFieldsLocations",E).order,(0,n.getSetting)("additionalOrderFields",{}),(0,n.getSetting)("additionalContactFields",{}),(0,n.getSetting)("additionalAddressFields",{});var _=r(7723);const x=({attributes:e,setAttributes:t})=>{const{numberOfThumbnails:r}=e;return(0,l.createElement)(a.RangeControl,{label:(0,_.__)("Number of Thumbnails","woocommerce"),value:r,onChange:e=>t({numberOfThumbnails:Math.round(e)}),help:(0,_.__)("Choose how many thumbnails (3-8) will display. If more images exist, a “View all” button will display.","woocommerce"),max:8,min:3,step:1})},C=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"woocommerce/product-gallery-thumbnails","version":"1.0.0","title":"Thumbnails","description":"Display the Thumbnails of a product.","category":"woocommerce","keywords":["WooCommerce"],"usesContext":["postId","cropImages"],"textdomain":"woocommerce","ancestor":["woocommerce/product-gallery"],"attributes":{"numberOfThumbnails":{"type":"number","default":3}},"supports":{"spacing":{"margin":true,"__experimentalDefaultControls":{"margin":true}}}}');(0,o.registerBlockType)(C,{icon:()=>(0,l.createElement)("svg",{width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.375 1.5H1.625C1.55596 1.5 1.5 1.55596 1.5 1.625V9.87895L4.35871 8.33965C4.5696 8.22609 4.82204 8.22009 5.03808 8.3235L7.42329 9.46513L10.3126 7.39076C10.574 7.20308 10.926 7.20308 11.1874 7.39076L13.5 9.05108V1.625C13.5 1.55596 13.444 1.5 13.375 1.5ZM13.5 10.8976L10.75 8.92328L7.93741 10.9426C7.71497 11.1023 7.42319 11.1281 7.1762 11.0098L4.73428 9.84105L1.5 11.5826V13.375C1.5 13.444 1.55596 13.5 1.625 13.5H13.375C13.444 13.5 13.5 13.444 13.5 13.375V10.8976ZM1.625 0C0.727537 0 0 0.727538 0 1.625V13.375C0 14.2725 0.727538 15 1.625 15H13.375C14.2725 15 15 14.2725 15 13.375V1.625C15 0.727537 14.2725 0 13.375 0H1.625ZM17.25 5V16C17.25 16.6909 16.6909 17.25 16.0011 17.25H3V18.75H16.0011C17.5204 18.75 18.75 17.5183 18.75 16V5H17.25Z",fill:"#1E1E1E"})),edit:({attributes:e,setAttributes:t})=>{const r=(0,i.useBlockProps)({className:`wc-block-product-gallery-thumbnails wc-block-product-gallery-thumbnails--number-of-thumbnails-${e.numberOfThumbnails}`});return(0,l.createElement)("div",{...r},(0,l.createElement)(i.InspectorControls,null,(0,l.createElement)(a.PanelBody,null,(0,l.createElement)(x,{attributes:e,setAttributes:t}))),[...Array(e.numberOfThumbnails).keys()].map((e=>(0,l.createElement)("div",{className:"wc-block-product-gallery-thumbnails__thumbnail",key:e},(0,l.createElement)("img",{className:"wc-block-product-gallery-thumbnails__image",src:`${b}block-placeholders/product-image-gallery.svg`,alt:""})))))},save:()=>null})},5478:()=>{},1609:e=>{"use strict";e.exports=window.React},4715:e=>{"use strict";e.exports=window.wp.blockEditor},4997:e=>{"use strict";e.exports=window.wp.blocks},6427:e=>{"use strict";e.exports=window.wp.components},7723:e=>{"use strict";e.exports=window.wp.i18n},5573:e=>{"use strict";e.exports=window.wp.primitives}},l={};function i(e){var t=l[e];if(void 0!==t)return t.exports;var r=l[e]={exports:{}};return o[e].call(r.exports,r,r.exports,i),r.exports}i.m=o,e=[],i.O=(t,r,o,l)=>{if(!r){var a=1/0;for(m=0;m<e.length;m++){for(var[r,o,l]=e[m],n=!0,s=0;s<r.length;s++)(!1&l||a>=l)&&Object.keys(i.O).every((e=>i.O[e](r[s])))?r.splice(s--,1):(n=!1,l<a&&(a=l));if(n){e.splice(m--,1);var c=o();void 0!==c&&(t=c)}}return t}l=l||0;for(var m=e.length;m>0&&e[m-1][2]>l;m--)e[m]=e[m-1];e[m]=[r,o,l]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var l=Object.create(null);i.r(l);var a={};t=t||[null,r({}),r([]),r(r)];for(var n=2&o&&e;"object"==typeof n&&!~t.indexOf(n);n=r(n))Object.getOwnPropertyNames(n).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,i.d(l,a),l},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=6749,(()=>{var e={6749:0,5375:0,2631:0,6565:0};i.O.j=t=>0===e[t];var t=(t,r)=>{var o,l,[a,n,s]=r,c=0;if(a.some((t=>0!==e[t]))){for(o in n)i.o(n,o)&&(i.m[o]=n[o]);if(s)var m=s(i)}for(t&&t(r);c<a.length;c++)l=a[c],i.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return i.O(m)},r=self.webpackChunkwebpackWcBlocksMainJsonp=self.webpackChunkwebpackWcBlocksMainJsonp||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a=i.O(void 0,[94],(()=>i(8772)));a=i.O(a),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["product-gallery"]=a})();