%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tradesc/www/relax/wp-content/plugins/woocommerce/assets/client/blocks/
Upload File :
Create Path :
Current File : /home/tradesc/www/relax/wp-content/plugins/woocommerce/assets/client/blocks/all-products.js

(()=>{var e,t,o,r,n,c={1579:(e,t,o)=>{"use strict";o.r(t),o.d(t,{Block:()=>i,default:()=>m});var r=o(1609),n=o(851),c=o(2796),a=o(3566),l=o(7723),s=o(1616);const i=e=>{const{textAlign:t}=e,o=(0,a.p)(e),{product:s}=(0,c.useProductDataContext)(),i=(0,n.A)(o.className,"wc-block-components-product-average-rating",{[`has-text-align-${t}`]:t});return(0,r.createElement)("div",{className:i,style:o.style},Number(s.average_rating)>0?s.average_rating:(0,l.__)("No ratings","woocommerce"))},m=(0,s.withProductDataContext)(i)},4078:(e,t,o)=>{"use strict";o.r(t),o.d(t,{Block:()=>w,default:()=>_});var r=o(1609),n=o(851),c=o(7723),a=o(3603),l=o(4436),s=o(3566),i=o(8537),m=o(812),d=o(5703),u=o(2796),p=o(1616);o(1546);const g=({product:e,className:t,style:o})=>{const{id:s,permalink:u,add_to_cart:p,has_options:g,is_purchasable:h,is_in_stock:w}=e,{dispatchStoreEvent:_}=(0,a.y)(),{cartQuantity:b,addingToCart:E,addToCart:y}=(0,l.R)(s),v=Number.isFinite(b)&&b>0,k=!g&&h&&w,f=(0,i.decodeEntities)((null==p?void 0:p.description)||""),x=v?(0,c.sprintf)(/* translators: %s number of products in cart. */ /* translators: %s number of products in cart. */
(0,c._n)("%d in cart","%d in cart",b,"woocommerce"),b):(0,i.decodeEntities)((null==p?void 0:p.text)||(0,c.__)("Add to cart","woocommerce")),C=k?"button":"a",S={};return k?S.onClick=async()=>{await y(),_("cart-add-item",{product:e});const{cartRedirectAfterAdd:t}=(0,d.getSetting)("productsSettings");t&&(window.location.href=m.Vo)}:(S.href=u,S.rel="nofollow",S.onClick=()=>{_("product-view-link",{product:e})}),(0,r.createElement)(C,{...S,"aria-label":f,disabled:E,className:(0,n.A)(t,"wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button",{loading:E,added:v}),style:o},x)},h=({className:e,style:t})=>(0,r.createElement)("button",{className:(0,n.A)("wp-block-button__link","wp-element-button","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder",e),style:t,disabled:!0}),w=e=>{const{className:t,textAlign:o}=e,c=(0,s.p)(e),{parentClassName:a}=(0,u.useInnerBlockLayoutContext)(),{product:l}=(0,u.useProductDataContext)();return(0,r.createElement)("div",{className:(0,n.A)(t,"wp-block-button","wc-block-components-product-button",{[`${a}__product-add-to-cart`]:a,[`align-${o}`]:o})},l.id?(0,r.createElement)(g,{product:l,style:c.style,className:c.className}):(0,r.createElement)(h,{style:c.style,className:c.className}))},_=(0,p.withProductDataContext)(w)},231:(e,t,o)=>{"use strict";o.d(t,{A:()=>w});var r=o(1609),n=o(6087),c=o(7723),a=o(851),l=o(5703),s=o(2796),i=o(3566),m=o(1616),d=o(3603),u=o(6809),p=(o(5183),o(1281));const g=e=>(0,r.createElement)("img",{...e,src:l.PLACEHOLDER_IMG_SRC,alt:"",width:void 0,height:void 0}),h=({image:e,loaded:t,showFullSize:o,fallbackAlt:c,width:a,scale:l,height:s,aspectRatio:i})=>{const{thumbnail:m,src:d,srcset:u,sizes:p,alt:h}=e||{},w={alt:h||c,hidden:!t,src:m,...o&&{src:d,srcSet:u,sizes:p}},_={height:s,width:a,objectFit:l,aspectRatio:i};return(0,r.createElement)(n.Fragment,null,w.src&&(0,r.createElement)("img",{style:_,"data-testid":"product-image",...w}),!e&&(0,r.createElement)(g,{style:_}))},w=(0,m.withProductDataContext)((e=>{const{className:t,imageSizing:o=p.e.SINGLE,showProductLink:l=!0,showSaleBadge:m,saleBadgeAlign:w="right",height:_,width:b,scale:E,aspectRatio:y,...v}=e,k=(0,i.p)(e),{parentClassName:f}=(0,s.useInnerBlockLayoutContext)(),{product:x,isLoading:C}=(0,s.useProductDataContext)(),{dispatchStoreEvent:S}=(0,d.y)();if(!x.id)return(0,r.createElement)("div",{className:(0,a.A)(t,"wc-block-components-product-image",{[`${f}__product-image`]:f},k.className),style:k.style},(0,r.createElement)(g,null));const N=!!x.images.length,P=N?x.images[0]:null,A=l?"a":n.Fragment,T=(0,c.sprintf)(/* translators: %s is referring to the product name */ /* translators: %s is referring to the product name */
(0,c.__)("Link to %s","woocommerce"),x.name),B={href:x.permalink,...!N&&{"aria-label":T},onClick:()=>{S("product-view-link",{product:x})}};return delete v.style,(0,r.createElement)("div",{className:(0,a.A)(t,"wc-block-components-product-image",{[`${f}__product-image`]:f},k.className),style:k.style},(0,r.createElement)(A,{...l&&B},!!m&&(0,r.createElement)(u.default,{align:w,...v}),(0,r.createElement)(h,{fallbackAlt:x.name,image:P,loaded:!C,showFullSize:o!==p.e.THUMBNAIL,width:b,height:_,scale:E,aspectRatio:y})))}))},1281:(e,t,o)=>{"use strict";o.d(t,{e:()=>r});let r=function(e){return e.SINGLE="single",e.THUMBNAIL="thumbnail",e}({})},2519:(e,t,o)=>{"use strict";o.r(t),o.d(t,{Block:()=>m,default:()=>d});var r=o(1609),n=o(851),c=o(6042),a=o(8529),l=o(2796),s=o(3566),i=o(1616);const m=e=>{var t,o;const{className:i,textAlign:m,isDescendentOfSingleProductTemplate:d}=e,u=(0,s.p)(e),{parentName:p,parentClassName:g}=(0,l.useInnerBlockLayoutContext)(),{product:h}=(0,l.useProductDataContext)(),w="woocommerce/all-products"===p,_=(0,n.A)("wc-block-components-product-price",i,u.className,{[`${g}__product-price`]:g});if(!h.id&&!d){const e=(0,r.createElement)(c.A,{align:m,className:_});return w?(0,r.createElement)("div",{className:"wp-block-woocommerce-product-price"},e):e}const b=h.prices,E=d?(0,a.getCurrencyFromPriceResponse)():(0,a.getCurrencyFromPriceResponse)(b),y="5000",v=b.price!==b.regular_price,k=(0,n.A)({[`${g}__product-price__value`]:g,[`${g}__product-price__value--on-sale`]:v}),f=(0,r.createElement)(c.A,{align:m,className:_,style:u.style,regularPriceStyle:u.style,priceStyle:u.style,priceClassName:k,currency:E,price:d?y:b.price,minPrice:null==b||null===(t=b.price_range)||void 0===t?void 0:t.min_amount,maxPrice:null==b||null===(o=b.price_range)||void 0===o?void 0:o.max_amount,regularPrice:d?y:b.regular_price,regularPriceClassName:(0,n.A)({[`${g}__product-price__regular`]:g})});return w?(0,r.createElement)("div",{className:"wp-block-woocommerce-product-price"},f):f},d=e=>e.isDescendentOfSingleProductTemplate?(0,r.createElement)(m,{...e}):(0,i.withProductDataContext)(m)(e)},8614:(e,t,o)=>{"use strict";o.r(t),o.d(t,{Block:()=>u,default:()=>p});var r=o(1609),n=o(7723),c=o(851),a=o(2796),l=o(3566),s=o(1616),i=o(3993),m=o(6427);const d=e=>{const{reviews:t}=e,o=t?(0,n.sprintf)(/* translators: %s is referring to the total of reviews for a product */ /* translators: %s is referring to the total of reviews for a product */
(0,n._n)("(%s customer review)","(%s customer reviews)",t,"woocommerce"),t):(0,n.__)("(X customer reviews)","woocommerce");return(0,r.createElement)("span",{className:"wc-block-components-product-rating-counter__reviews_count"},(0,r.createElement)(m.Disabled,null,(0,r.createElement)("a",{href:"/"},o)))},u=e=>{const{textAlign:t,shouldDisplayMockedReviewsWhenProductHasNoReviews:o}=e,n=(0,l.p)(e),{parentClassName:s}=(0,a.useInnerBlockLayoutContext)(),{product:m}=(0,a.useProductDataContext)(),u=(e=>{const t=(0,i.isNumber)(e.review_count)?e.review_count:parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(m),p=(0,c.A)(n.className,"wc-block-components-product-rating-counter",{[`${s}__product-rating`]:s,[`has-text-align-${t}`]:t});if(u||o)return(0,r.createElement)("div",{className:p,style:n.style},(0,r.createElement)("div",{className:"wc-block-components-product-rating-counter__container"},(0,r.createElement)(d,{reviews:u})))},p=(0,s.withProductDataContext)(u)},9549:(e,t,o)=>{"use strict";o.r(t),o.d(t,{Block:()=>s,default:()=>i});var r=o(1609),n=o(2796),c=o(3566),a=o(1616),l=o(2442);o(7195);const s=e=>{const{textAlign:t="",shouldDisplayMockedReviewsWhenProductHasNoReviews:o}=e,a=(0,c.p)(e),{parentClassName:s}=(0,n.useInnerBlockLayoutContext)(),{product:i}=(0,n.useProductDataContext)(),m=(0,l.p3)(i),d=(0,l.Nm)(i);return(0,r.createElement)(l.fb,{className:"wc-block-components-product-rating-stars",showMockedReviews:o,styleProps:a,parentClassName:s,reviews:d,rating:m,textAlign:t})},i=(0,a.withProductDataContext)(s)},8757:(e,t,o)=>{"use strict";o.r(t),o.d(t,{Block:()=>s,default:()=>i});var r=o(1609),n=o(2796),c=o(3566),a=o(1616),l=o(2442);o(7067);const s=e=>{const{textAlign:t="",isDescendentOfSingleProductBlock:o,shouldDisplayMockedReviewsWhenProductHasNoReviews:a}=e,s=(0,c.p)(e),{parentClassName:i}=(0,n.useInnerBlockLayoutContext)(),{product:m}=(0,n.useProductDataContext)(),d=(0,l.p3)(m),u=(0,l.Nm)(m);if(u||a)return(0,r.createElement)(l.fb,{className:"wc-block-components-product-rating",showReviewCount:o,showMockedReviews:a,styleProps:s,parentClassName:i,reviews:u,rating:d,textAlign:t})},i=(0,a.withProductDataContext)(s)},6809:(e,t,o)=>{"use strict";o.r(t),o.d(t,{Block:()=>m,default:()=>d});var r=o(1609),n=o(7723),c=o(851),a=o(4656),l=o(2796),s=o(3566),i=o(1616);o(6007);const m=e=>{const{className:t,align:o}=e,i=(0,s.p)(e),{parentClassName:m}=(0,l.useInnerBlockLayoutContext)(),{product:d}=(0,l.useProductDataContext)();if(!(d.id&&d.on_sale||e.isDescendentOfSingleProductTemplate))return null;const u="string"==typeof o?`wc-block-components-product-sale-badge--align-${o}`:"";return(0,r.createElement)("div",{className:(0,c.A)("wc-block-components-product-sale-badge",t,u,{[`${m}__product-onsale`]:m},i.className),style:i.style},(0,r.createElement)(a.Label,{label:(0,n.__)("Sale","woocommerce"),screenReaderLabel:(0,n.__)("Product on sale","woocommerce")}))},d=(0,i.withProductDataContext)(m)},3975:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>m});var r=o(1609),n=o(851),c=o(2796),a=o(1616),l=o(3566),s=o(4715);o(7663);const i=({setAttributes:e,parentClassName:t,sku:o,className:c,style:a,prefix:l,suffix:i})=>(0,r.createElement)("div",{className:(0,n.A)(c,{[`${t}__product-sku`]:t}),style:a},(0,r.createElement)(s.RichText,{tagName:"span",placeholder:"Prefix",value:l,onChange:t=>e({prefix:t})}),(0,r.createElement)("strong",null,o),(0,r.createElement)(s.RichText,{tagName:"span",placeholder:"Suffix",value:i,onChange:t=>e({suffix:t})})),m=(0,a.withProductDataContext)((e=>{const{className:t}=e,o=(0,l.p)(e),{parentClassName:a}=(0,c.useInnerBlockLayoutContext)(),{product:s}=(0,c.useProductDataContext)(),m=s.sku;return e.isDescendentOfSingleProductTemplate?(0,r.createElement)(i,{setAttributes:e.setAttributes,parentClassName:a,className:t,sku:"Product SKU",prefix:e.prefix,suffix:e.suffix}):m?(0,r.createElement)(i,{setAttributes:e.setAttributes,className:t,parentClassName:a,sku:m,prefix:e.prefix,suffix:e.suffix,...e.isDescendantOfAllProducts&&{className:(0,n.A)(t,"wc-block-components-product-sku wp-block-woocommerce-product-sku",o.className),style:{...o.style}}}):null}))},2686:(e,t,o)=>{"use strict";o.r(t),o.d(t,{Block:()=>i,default:()=>m});var r=o(1609),n=o(7723),c=o(851),a=o(2796),l=o(3566),s=o(1616);o(9644);const i=e=>{const{className:t}=e,o=(0,l.p)(e),{parentClassName:s}=(0,a.useInnerBlockLayoutContext)(),{product:i}=(0,a.useProductDataContext)();if(!i.id)return null;const m=!!i.is_in_stock,d=i.low_stock_remaining,u=i.is_on_backorder;return(0,r.createElement)("div",{className:(0,c.A)(t,{[`${s}__stock-indicator`]:s,"wc-block-components-product-stock-indicator--in-stock":m,"wc-block-components-product-stock-indicator--out-of-stock":!m,"wc-block-components-product-stock-indicator--low-stock":!!d,"wc-block-components-product-stock-indicator--available-on-backorder":!!u,...e.isDescendantOfAllProducts&&{[o.className]:o.className,"wc-block-components-product-stock-indicator wp-block-woocommerce-product-stock-indicator":!0}}),...e.isDescendantOfAllProducts&&{style:o.style}},(({isInStock:e=!1,isLowStock:t=!1,lowStockAmount:o=null,isOnBackorder:r=!1})=>t&&null!==o?(0,n.sprintf)(/* translators: %d stock amount (number of items in stock for product) */ /* translators: %d stock amount (number of items in stock for product) */
(0,n.__)("%d left in stock","woocommerce"),o):r?(0,n.__)("Available on backorder","woocommerce"):e?(0,n.__)("In stock","woocommerce"):(0,n.__)("Out of stock","woocommerce"))({isInStock:m,isLowStock:!!d,lowStockAmount:d,isOnBackorder:u}))},m=(0,s.withProductDataContext)(i)},3326:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>h});var r=o(1609),n=o(851),c=o(6087),a=o(6004);const l=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),s=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t;var i=o(9446);const m=({source:e,maxLength:t=15,countType:o="words",className:n="",style:m={}})=>{const d=(0,c.useMemo)((()=>((e,t=15,o="words")=>{const r=(0,a.autop)(e);if((0,i.count)(r,o)<=t)return r;const n=(e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)})(r);return(0,i.count)(n,o)<=t?n:"words"===o?((e,t,o="&hellip;",r=!0)=>{const n=l(e),c=n.split(" ").splice(0,t).join(" ");return c===n?r?(0,a.autop)(n):n:r?(0,a.autop)(s(c,o)):s(c,o)})(n,t):((e,t,o=!0,r="&hellip;",n=!0)=>{const c=l(e),i=c.slice(0,t);if(i===c)return n?(0,a.autop)(c):c;if(o)return(0,a.autop)(s(i,r));const m=i.match(/([\s]+)/g),d=m?m.length:0,u=c.slice(0,t+d);return n?(0,a.autop)(s(u,r)):s(u,r)})(n,t,"characters_including_spaces"===o)})(e,t,o)),[e,t,o]);return(0,r.createElement)(c.RawHTML,{style:m,className:n},d)};var d=o(812),u=o(2796),p=o(3566),g=o(1616);o(7766);const h=(0,g.withProductDataContext)((e=>{const{className:t}=e,{parentClassName:o}=(0,u.useInnerBlockLayoutContext)(),{product:c}=(0,u.useProductDataContext)(),a=(0,p.p)(e);if(!c)return(0,r.createElement)("div",{className:(0,n.A)(t,"wc-block-components-product-summary",{[`${o}__product-summary`]:o})});const l=c.short_description?c.short_description:c.description;return l?(0,r.createElement)(m,{className:(0,n.A)(t,a.className,"wc-block-components-product-summary",{[`${o}__product-summary`]:o}),source:l,maxLength:150,countType:d.r7.wordCountType||"words",style:a.style}):null}))},6154:(e,t,o)=>{"use strict";o.d(t,{A:()=>n});let r={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},linkTarget:{type:"string"},productId:{type:"number",default:0}};r={...r,align:{type:"string"}};const n=r},1318:(e,t,o)=>{"use strict";o.d(t,{A:()=>d});var r=o(1609),n=o(851),c=o(2796),a=o(1616),l=o(7102),s=o(3603),i=o(3566);o(7128);const m=({children:e,headingLevel:t,elementType:o=`h${t}`,...n})=>(0,r.createElement)(o,{...n},e),d=(0,a.withProductDataContext)((e=>{const{className:t,headingLevel:o=2,showProductLink:a=!0,linkTarget:d,align:u}=e,p=(0,i.p)(e),{parentClassName:g}=(0,c.useInnerBlockLayoutContext)(),{product:h}=(0,c.useProductDataContext)(),{dispatchStoreEvent:w}=(0,s.y)();return h.id?(0,r.createElement)(m,{headingLevel:o,className:(0,n.A)(t,p.className,"wc-block-components-product-title",{[`${g}__product-title`]:g,[`wc-block-components-product-title--align-${u}`]:u}),style:p.style},(0,r.createElement)(l.A,{disabled:!a,name:h.name,permalink:h.permalink,target:d,onClick:()=>{w("product-view-link",{product:h})}})):(0,r.createElement)(m,{headingLevel:o,className:(0,n.A)(t,p.className,"wc-block-components-product-title",{[`${g}__product-title`]:g,[`wc-block-components-product-title--align-${u}`]:u}),style:p.style})}))},8585:(e,t,o)=>{"use strict";o.d(t,{A:()=>i});var r=o(5703),n=o(7723),c=o(3993),a=o(812);const l=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=(0,n.sprintf)(/* translators: %s Field label. */ /* translators: %s Field label. */
(0,n.__)("%s (optional)","woocommerce"),e.label)),e.priority&&((0,c.isNumber)(e.priority)&&(t.index=e.priority),(0,c.isString)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},s=Object.entries(a.iI).map((([e,t])=>[e,Object.entries(t).map((([e,t])=>[e,l(t)])).reduce(((e,[t,o])=>(e[t]=o,e)),{})])).reduce(((e,[t,o])=>(e[t]=o,e)),{}),i=(e,t,o="")=>{const n=o&&void 0!==s[o]?s[o]:{};return e.map((e=>({key:e,...r.defaultFields[e]||{},...n[e]||{},...t[e]||{}}))).sort(((e,t)=>e.index-t.index))}},7102:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var r=o(1609),n=o(8537),c=o(851);o(6625);const a=({className:e="",disabled:t=!1,name:o,permalink:a="",target:l,rel:s,style:i,onClick:m,...d})=>{const u=(0,c.A)("wc-block-components-product-name",e);if(t){const e=d;return(0,r.createElement)("span",{className:u,...e,dangerouslySetInnerHTML:{__html:(0,n.decodeEntities)(o)}})}return(0,r.createElement)("a",{className:u,href:a,target:l,...d,dangerouslySetInnerHTML:{__html:(0,n.decodeEntities)(o)},style:i})}},6042:(e,t,o)=>{"use strict";o.d(t,{A:()=>d});var r=o(1609),n=o(7723),c=o(4656),a=o(851),l=o(8529),s=o(6087);o(4567);const i=({currency:e,maxPrice:t,minPrice:o,priceClassName:s,priceStyle:i={}})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"screen-reader-text"},(0,n.sprintf)(/* translators: %1$s min price, %2$s max price */ /* translators: %1$s min price, %2$s max price */
(0,n.__)("Price between %1$s and %2$s","woocommerce"),(0,l.formatPrice)(o),(0,l.formatPrice)(t))),(0,r.createElement)("span",{"aria-hidden":!0},(0,r.createElement)(c.FormattedMonetaryAmount,{className:(0,a.A)("wc-block-components-product-price__value",s),currency:e,value:o,style:i})," — ",(0,r.createElement)(c.FormattedMonetaryAmount,{className:(0,a.A)("wc-block-components-product-price__value",s),currency:e,value:t,style:i}))),m=({currency:e,regularPriceClassName:t,regularPriceStyle:o,regularPrice:l,priceClassName:s,priceStyle:i,price:m})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"screen-reader-text"},(0,n.__)("Previous price:","woocommerce")),(0,r.createElement)(c.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,r.createElement)("del",{className:(0,a.A)("wc-block-components-product-price__regular",t),style:o},e),value:l}),(0,r.createElement)("span",{className:"screen-reader-text"},(0,n.__)("Discounted price:","woocommerce")),(0,r.createElement)(c.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,r.createElement)("ins",{className:(0,a.A)("wc-block-components-product-price__value","is-discounted",s),style:i},e),value:m})),d=({align:e,className:t,currency:o,format:n="<price/>",maxPrice:l,minPrice:d,price:u,priceClassName:p,priceStyle:g,regularPrice:h,regularPriceClassName:w,regularPriceStyle:_,style:b})=>{const E=(0,a.A)(t,"price","wc-block-components-product-price",{[`wc-block-components-product-price--align-${e}`]:e});n.includes("<price/>")||(n="<price/>",console.error("Price formats need to include the `<price/>` tag."));const y=h&&u&&u<h;let v=(0,r.createElement)("span",{className:(0,a.A)("wc-block-components-product-price__value",p)});return y?v=(0,r.createElement)(m,{currency:o,price:u,priceClassName:p,priceStyle:g,regularPrice:h,regularPriceClassName:w,regularPriceStyle:_}):void 0!==d&&void 0!==l?v=(0,r.createElement)(i,{currency:o,maxPrice:l,minPrice:d,priceClassName:p,priceStyle:g}):u&&(v=(0,r.createElement)(c.FormattedMonetaryAmount,{className:(0,a.A)("wc-block-components-product-price__value",p),currency:o,value:u,style:g})),(0,r.createElement)("span",{className:E,style:b},(0,s.createInterpolateElement)(n,{price:v}))}},7276:(e,t,o)=>{"use strict";o.d(t,{U:()=>d});var r=o(6087),n=o(7594),c=o(7143),a=o(2983),l=o(4956);const s=e=>{const t=null==e?void 0:e.detail;t&&t.preserveCartData||(0,c.dispatch)(n.CART_STORE_KEY).invalidateResolutionForStore()},i=e=>{(null!=e&&e.persisted||"back_forward"===(0,a.F)())&&(0,c.dispatch)(n.CART_STORE_KEY).invalidateResolutionForStore()},m=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},d=()=>{(0,r.useEffect)((()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),(null===(e=window.wcBlocksStoreCartListeners)||void 0===e?void 0:e.count)>0)return void window.wcBlocksStoreCartListeners.count++;var e;document.body.addEventListener("wc-blocks_added_to_cart",s),document.body.addEventListener("wc-blocks_removed_from_cart",s),window.addEventListener("pageshow",i);const t=(0,l.f2)("added_to_cart","wc-blocks_added_to_cart"),o=(0,l.f2)("removed_from_cart","wc-blocks_removed_from_cart");window.wcBlocksStoreCartListeners.count=1,window.wcBlocksStoreCartListeners.remove=()=>{document.body.removeEventListener("wc-blocks_added_to_cart",s),document.body.removeEventListener("wc-blocks_removed_from_cart",s),window.removeEventListener("pageshow",i),t(),o()}})(),m)),[])}},8509:(e,t,o)=>{"use strict";o.d(t,{V:()=>_});var r=o(458),n=o.n(r),c=o(6087),a=o(7594),l=o(7143),s=o(8537),i=o(5683),m=o(2663),d=o(7276);const u={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},p={...u,email:""},g={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:a.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},h=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(0,s.decodeEntities)(t)]))),w={cartCoupons:a.EMPTY_CART_COUPONS,cartItems:a.EMPTY_CART_ITEMS,cartFees:a.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,crossSellsProducts:a.EMPTY_CART_CROSS_SELLS,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:a.EMPTY_CART_ITEM_ERRORS,cartTotals:g,cartIsLoading:!0,cartErrors:a.EMPTY_CART_ERRORS,billingAddress:p,shippingAddress:u,shippingRates:a.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentMethods:a.EMPTY_PAYMENT_METHODS,paymentRequirements:a.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},receiveCartContents:()=>{},extensions:a.EMPTY_EXTENSIONS},_=(e={shouldSelect:!0})=>{const{isEditor:t,previewData:o}=(0,m.m)(),r=null==o?void 0:o.previewCart,{shouldSelect:s}=e,g=(0,c.useRef)();(0,d.U)();const _=(0,l.useSelect)(((e,{dispatch:o})=>{if(!s)return w;if(t)return{cartCoupons:r.coupons,cartItems:r.items,crossSellsProducts:r.cross_sells,cartFees:r.fees,cartItemsCount:r.items_count,cartItemsWeight:r.items_weight,cartNeedsPayment:r.needs_payment,cartNeedsShipping:r.needs_shipping,cartItemErrors:a.EMPTY_CART_ITEM_ERRORS,cartTotals:r.totals,cartIsLoading:!1,cartErrors:a.EMPTY_CART_ERRORS,billingData:p,billingAddress:p,shippingAddress:u,extensions:a.EMPTY_EXTENSIONS,shippingRates:r.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:r.has_calculated_shipping,paymentRequirements:r.paymentRequirements,receiveCart:"function"==typeof(null==r?void 0:r.receiveCart)?r.receiveCart:()=>{},receiveCartContents:"function"==typeof(null==r?void 0:r.receiveCartContents)?r.receiveCartContents:()=>{}};const n=e(a.CART_STORE_KEY),c=n.getCartData(),l=n.getCartErrors(),m=n.getCartTotals(),d=!n.hasFinishedResolution("getCartData"),g=n.isCustomerDataUpdating(),{receiveCart:_,receiveCartContents:b}=o(a.CART_STORE_KEY),E=h(c.billingAddress),y=c.needsShipping?h(c.shippingAddress):E,v=c.fees.length>0?c.fees.map((e=>h(e))):a.EMPTY_CART_FEES;return{cartCoupons:c.coupons.length>0?c.coupons.map((e=>({...e,label:e.code}))):a.EMPTY_CART_COUPONS,cartItems:c.items,crossSellsProducts:c.crossSells,cartFees:v,cartItemsCount:c.itemsCount,cartItemsWeight:c.itemsWeight,cartNeedsPayment:c.needsPayment,cartNeedsShipping:c.needsShipping,cartItemErrors:c.errors,cartTotals:m,cartIsLoading:d,cartErrors:l,billingData:(0,i.TU)(E),billingAddress:(0,i.TU)(E),shippingAddress:(0,i.TU)(y),extensions:c.extensions,shippingRates:c.shippingRates,isLoadingRates:g,cartHasCalculatedShipping:c.hasCalculatedShipping,paymentRequirements:c.paymentRequirements,receiveCart:_,receiveCartContents:b}}),[s]);return g.current&&n()(g.current,_)||(g.current=_),g.current}},4436:(e,t,o)=>{"use strict";o.d(t,{R:()=>i});var r=o(6087),n=o(7143),c=o(7594),a=o(8537),l=o(8509);const s=(e,t)=>{const o=e.find((({id:e})=>e===t));return o?o.quantity:0},i=e=>{const{addItemToCart:t}=(0,n.useDispatch)(c.CART_STORE_KEY),{cartItems:o,cartIsLoading:i}=(0,l.V)(),{createErrorNotice:m,removeNotice:d}=(0,n.useDispatch)("core/notices"),[u,p]=(0,r.useState)(!1),g=(0,r.useRef)(s(o,e));return(0,r.useEffect)((()=>{const t=s(o,e);t!==g.current&&(g.current=t)}),[o,e]),{cartQuantity:Number.isFinite(g.current)?g.current:0,addingToCart:u,cartIsLoading:i,addToCart:(o=1)=>(p(!0),t(e,o).then((()=>{d("add-to-cart")})).catch((e=>{m((0,a.decodeEntities)(e.message),{id:"add-to-cart",context:"wc/all-products",isDismissible:!0})})).finally((()=>{p(!1)})))}}},3603:(e,t,o)=>{"use strict";o.d(t,{y:()=>a});var r=o(2619),n=o(7143),c=o(6087);const a=()=>({dispatchStoreEvent:(0,c.useCallback)(((e,t={})=>{try{(0,r.doAction)(`experimental__woocommerce_blocks-${e}`,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:(0,c.useCallback)(((e,t={})=>{try{(0,r.doAction)(`experimental__woocommerce_blocks-checkout-${e}`,{...t,storeCart:(0,n.select)("wc/store/cart").getCartData()})}catch(e){console.error(e)}}),[])})},2663:(e,t,o)=>{"use strict";o.d(t,{m:()=>c}),o(1609);var r=o(6087);o(7143);const n=(0,r.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>({})}),c=()=>(0,r.useContext)(n)},3566:(e,t,o)=>{"use strict";o.d(t,{p:()=>l});var r=o(851),n=o(3993),c=o(92),a=o(6032);const l=e=>{const t=(e=>{const t=(0,n.isObject)(e)?e:{style:{}};let o=t.style;return(0,n.isString)(o)&&(o=JSON.parse(o)||{}),(0,n.isObject)(o)||(o={}),{...t,style:o}})(e),o=(0,a.BK)(t),l=(0,a.aR)(t),s=(0,a.fo)(t),i=(0,c.x)(t);return{className:(0,r.A)(i.className,o.className,l.className,s.className),style:{...i.style,...o.style,...l.style,...s.style}}}},92:(e,t,o)=>{"use strict";o.d(t,{x:()=>n});var r=o(3993);const n=e=>{const t=(0,r.isObject)(e.style.typography)?e.style.typography:{},o=(0,r.isString)(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:o,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}}},5683:(e,t,o)=>{"use strict";o.d(t,{TU:()=>c});var r=o(8585),n=(o(3832),o(3993),o(8537),o(812));const c=e=>{const t=(0,r.A)(n.Hw,{},e.country),o=Object.assign({},e);return t.forEach((({key:t="",hidden:r=!1})=>{r&&((e,t)=>e in t)(t,e)&&(o[t]="")})),o}},6032:(e,t,o)=>{"use strict";o.d(t,{BK:()=>i,aR:()=>m,fo:()=>d});var r=o(851),n=o(1194),c=o(9786),a=o(3993);function l(e={}){const t={};return(0,c.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function s(e,t){return e&&t?`has-${(0,n.c)(t)}-${e}`:""}function i(e){var t,o,n,c,i,m,d;const{backgroundColor:u,textColor:p,gradient:g,style:h}=e,w=s("background-color",u),_=s("color",p),b=function(e){if(e)return`has-${e}-gradient-background`}(g),E=b||(null==h||null===(t=h.color)||void 0===t?void 0:t.gradient);return{className:(0,r.A)(_,b,{[w]:!E&&!!w,"has-text-color":p||(null==h||null===(o=h.color)||void 0===o?void 0:o.text),"has-background":u||(null==h||null===(n=h.color)||void 0===n?void 0:n.background)||g||(null==h||null===(c=h.color)||void 0===c?void 0:c.gradient),"has-link-color":(0,a.isObject)(null==h||null===(i=h.elements)||void 0===i?void 0:i.link)?null==h||null===(m=h.elements)||void 0===m||null===(d=m.link)||void 0===d?void 0:d.color:void 0}),style:l({color:(null==h?void 0:h.color)||{}})}}function m(e){var t;const o=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:function(e){var t;const{borderColor:o,style:n}=e,c=o?s("border-color",o):"";return(0,r.A)({"has-border-color":!!o||!(null==n||null===(t=n.border)||void 0===t||!t.color),[c]:!!c})}(e),style:l({border:o})}}function d(e){var t;return{className:void 0,style:l({spacing:(null===(t=e.style)||void 0===t?void 0:t.spacing)||{}})}}},2983:(e,t,o)=>{"use strict";o.d(t,{F:()=>r});const r=()=>window.performance&&window.performance.getEntriesByType("navigation").length?window.performance.getEntriesByType("navigation")[0].type:""},4956:(e,t,o)=>{"use strict";o.d(t,{f2:()=>n});const r=window.CustomEvent||null,n=(e,t,o=!1,n=!1)=>{if("function"!=typeof jQuery)return()=>{};const c=()=>{((e,{bubbles:t=!1,cancelable:o=!1,element:n,detail:c={}})=>{if(!r)return;n||(n=document.body);const a=new r(e,{bubbles:t,cancelable:o,detail:c});n.dispatchEvent(a)})(t,{bubbles:o,cancelable:n})};return jQuery(document).on(e,c),()=>jQuery(document).off(e,c)}},807:(e,t,o)=>{"use strict";o.r(t),o.d(t,{metadata:()=>eo,name:()=>Wo});var r=o(1609);const n=window.wp.blocks;var c=o(7104),a=o(6554),l=o(4715),s=o(7723),i=o(851);const m={category:"woocommerce-product-elements",keywords:[(0,s.__)("WooCommerce","woocommerce")],icon:{src:(0,r.createElement)(c.A,{icon:a.A,className:"wc-block-editor-components-block-icon"})},apiVersion:3,supports:{html:!1},ancestor:["woocommerce/all-products","woocommerce/single-product","woocommerce/product-template","core/post-template"],save:({attributes:e})=>e.isDescendentOfQueryLoop||e.isDescendentOfSingleProductBlock||e.isDescendentOfSingleProductTemplate?null:(0,r.createElement)("div",{className:(0,i.A)("is-loading",e.className)}),deprecated:[{attributes:{},save:()=>null}]};var d=o(6154),u=o(6427),p=o(9491),g=o(6087),h=o(5573);function w({level:e}){const t={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return t.hasOwnProperty(e)?(0,r.createElement)(h.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(h.Path,{d:t[e]})):null}class _ extends g.Component{createLevelControl(e,t,o){const n=e===t;return{icon:(0,r.createElement)(w,{level:e}),title:(0,s.sprintf)(/* translators: %s: heading level e.g: "2", "3", "4" */ /* translators: %s: heading level e.g: "2", "3", "4" */
(0,s.__)("Heading %d","woocommerce"),e),isActive:n,onClick:()=>o(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:o,selectedLevel:n,onChange:c}=this.props,a=Array.from({length:o-t+1},((e,o)=>o+t));return(0,r.createElement)(u.ToolbarGroup,{isCollapsed:e,icon:(0,r.createElement)(w,{level:n}),controls:a.map((e=>this.createLevelControl(e,n,c)))})}}const b=_;var E=o(1318),y=o(3993);function v(e,t,o){const r=new Set(t.map((e=>e[o])));return e.filter((e=>!r.has(e[o])))}var k=o(8537);const f={clear:(0,s.__)("Clear all selected items","woocommerce"),noItems:(0,s.__)("No items found.","woocommerce"),
/* Translators: %s search term */
noResults:(0,s.__)("No results for %s","woocommerce"),search:(0,s.__)("Search for items","woocommerce"),selected:e=>(0,s.sprintf)(/* translators: Number of items selected from list. */ /* translators: Number of items selected from list. */
(0,s._n)("%d item selected","%d items selected",e,"woocommerce"),e),updated:(0,s.__)("Search results updated.","woocommerce")},x=(e,t=e)=>{const o=e.reduce(((e,t)=>{const o=t.parent||0;return e[o]||(e[o]=[]),e[o].push(t),e}),{}),r=("id",t.reduce(((e,t)=>(e[String(t.id)]=t,e)),{}));const n=["0"],c=(e={})=>e.parent?[...c(r[e.parent]),e.name]:e.name?[e.name]:[],a=e=>e.map((e=>{const t=o[e.id];return n.push(""+e.id),{...e,breadcrumbs:c(r[e.parent]),children:t&&t.length?a(t):[]}})),l=a(o[0]||[]);return Object.entries(o).forEach((([e,t])=>{n.includes(e)||l.push(...a(t||[]))})),l},C=(e,t)=>{if(!t)return e;const o=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(o).map(((e,t)=>o.test(e)?(0,r.createElement)("strong",{key:t},e):(0,r.createElement)(g.Fragment,{key:t},e)))},S=({label:e})=>(0,r.createElement)("span",{className:"woocommerce-search-list__item-count"},e),N=e=>{const{item:t,search:o}=e,n=t.breadcrumbs&&t.breadcrumbs.length;return(0,r.createElement)("span",{className:"woocommerce-search-list__item-label"},n?(0,r.createElement)("span",{className:"woocommerce-search-list__item-prefix"},1===(c=t.breadcrumbs).length?c.slice(0,1).toString():2===c.length?c.slice(0,1).toString()+" › "+c.slice(-1).toString():c.slice(0,1).toString()+" … "+c.slice(-1).toString()):null,(0,r.createElement)("span",{className:"woocommerce-search-list__item-name"},C((0,k.decodeEntities)(t.name),o)));var c},P=({countLabel:e,className:t,depth:o=0,controlId:n="",item:c,isSelected:a,isSingle:l,onSelect:s,search:m="",selected:d,useExpandedPanelId:p,...h})=>{var w,_;const[b,E]=p,y=null!=e&&void 0!==c.count&&null!==c.count,f=!(null===(w=c.breadcrumbs)||void 0===w||!w.length),x=!(null===(_=c.children)||void 0===_||!_.length),P=b===c.id,A=(0,i.A)(["woocommerce-search-list__item",`depth-${o}`,t],{"has-breadcrumbs":f,"has-children":x,"has-count":y,"is-expanded":P,"is-radio-button":l});(0,g.useEffect)((()=>{x&&a&&E(c.id)}),[c,x,a,E]);const T=h.name||`search-list-item-${n}`,B=`${T}-${c.id}`,I=(0,g.useCallback)((()=>{E(P?-1:Number(c.id))}),[P,c.id,E]);return x?(0,r.createElement)("div",{className:A,onClick:I,onKeyDown:e=>"Enter"===e.key||" "===e.key?I():null,role:"treeitem",tabIndex:0},l?(0,r.createElement)(r.Fragment,null,(0,r.createElement)("input",{type:"radio",id:B,name:T,value:c.value,onChange:s(c),onClick:e=>e.stopPropagation(),checked:a,className:"woocommerce-search-list__item-input",...h}),(0,r.createElement)(N,{item:c,search:m}),y?(0,r.createElement)(S,{label:e||c.count}):null):(0,r.createElement)(r.Fragment,null,(0,r.createElement)(u.CheckboxControl,{className:"woocommerce-search-list__item-input",checked:a,...!a&&c.children.some((e=>d.find((t=>t.id===e.id))))?{indeterminate:!0}:{},label:C((0,k.decodeEntities)(c.name),m),onChange:()=>{a?s(v(d,c.children,"id"))():s(function(e,t,o){const r=v(t,e,"id");return[...e,...r]}(d,c.children))()},onClick:e=>e.stopPropagation()}),y?(0,r.createElement)(S,{label:e||c.count}):null)):(0,r.createElement)("label",{htmlFor:B,className:A},l?(0,r.createElement)(r.Fragment,null,(0,r.createElement)("input",{...h,type:"radio",id:B,name:T,value:c.value,onChange:s(c),checked:a,className:"woocommerce-search-list__item-input"}),(0,r.createElement)(N,{item:c,search:m})):(0,r.createElement)(u.CheckboxControl,{...h,id:B,name:T,className:"woocommerce-search-list__item-input",value:(0,k.decodeEntities)(c.value),label:C((0,k.decodeEntities)(c.name),m),onChange:s(c),checked:a}),y?(0,r.createElement)(S,{label:e||c.count}):null)},A=P;var T=o(2478),B=o(2370);o(6636);const I=({id:e,label:t,popoverContents:o,remove:n,screenReaderLabel:a,className:l=""})=>{const[m,d]=(0,g.useState)(!1),h=(0,p.useInstanceId)(I);if(a=a||t,!t)return null;t=(0,k.decodeEntities)(t);const w=(0,i.A)("woocommerce-tag",l,{"has-remove":!!n}),_=`woocommerce-tag__label-${h}`,b=(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"screen-reader-text"},a),(0,r.createElement)("span",{"aria-hidden":"true"},t));return(0,r.createElement)("span",{className:w},o?(0,r.createElement)(u.Button,{className:"woocommerce-tag__text",id:_,onClick:()=>d(!0)},b):(0,r.createElement)("span",{className:"woocommerce-tag__text",id:_},b),o&&m&&(0,r.createElement)(u.Popover,{onClose:()=>d(!1)},o),n&&(0,r.createElement)(u.Button,{className:"woocommerce-tag__remove",onClick:n(e),label:(0,s.sprintf)(
// Translators: %s label.
// Translators: %s label.
(0,s.__)("Remove %s","woocommerce"),t),"aria-describedby":_},(0,r.createElement)(c.A,{icon:B.A,size:20,className:"clear-icon",role:"img"})))},O=I;o(8137);const L=e=>(0,r.createElement)(A,{...e}),D=e=>{const{list:t,selected:o,renderItem:n,depth:c=0,onSelect:a,instanceId:l,isSingle:s,search:i,useExpandedPanelId:m}=e,[d]=m;return t?(0,r.createElement)(g.Fragment,null,t.map((t=>{var u,p;const h=null!==(u=t.children)&&void 0!==u&&u.length&&!s?t.children.every((({id:e})=>o.find((t=>t.id===e)))):!!o.find((({id:e})=>e===t.id)),w=(null===(p=t.children)||void 0===p?void 0:p.length)&&d===t.id;return(0,r.createElement)(g.Fragment,{key:t.id},(0,r.createElement)("li",null,n({item:t,isSelected:h,onSelect:a,isSingle:s,selected:o,search:i,depth:c,useExpandedPanelId:m,controlId:l})),w?(0,r.createElement)(D,{...e,list:t.children,depth:c+1}):null)}))):null},R=({isLoading:e,isSingle:t,selected:o,messages:n,onChange:c,onRemove:a})=>{if(e||t||!o)return null;const l=o.length;return(0,r.createElement)("div",{className:"woocommerce-search-list__selected"},(0,r.createElement)("div",{className:"woocommerce-search-list__selected-header"},(0,r.createElement)("strong",null,n.selected(l)),l>0?(0,r.createElement)(u.Button,{variant:"link",isDestructive:!0,onClick:()=>c([]),"aria-label":n.clear},(0,s.__)("Clear all","woocommerce")):null),l>0?(0,r.createElement)("ul",null,o.map(((e,t)=>(0,r.createElement)("li",{key:t},(0,r.createElement)(O,{label:e.name,id:e.id,remove:a}))))):null)},F=({filteredList:e,search:t,onSelect:o,instanceId:n,useExpandedPanelId:a,...l})=>{const{messages:i,renderItem:m,selected:d,isSingle:u}=l,p=m||L;return 0===e.length?(0,r.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},(0,r.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},(0,r.createElement)(c.A,{icon:T.A,role:"img"})),(0,r.createElement)("span",{className:"woocommerce-search-list__not-found-text"},t?(0,s.sprintf)(i.noResults,t):i.noItems)):(0,r.createElement)("ul",{className:"woocommerce-search-list__list"},(0,r.createElement)(D,{useExpandedPanelId:a,list:e,selected:d,renderItem:p,onSelect:o,instanceId:n,isSingle:u,search:t}))},V=e=>{const{className:t="",isCompact:o,isHierarchical:n,isLoading:c,isSingle:a,list:l,messages:m=f,onChange:d,onSearch:h,selected:w,type:_="text",debouncedSpeak:b}=e,[E,y]=(0,g.useState)(""),v=(0,g.useState)(-1),k=(0,p.useInstanceId)(V),C=(0,g.useMemo)((()=>({...f,...m})),[m]),S=(0,g.useMemo)((()=>((e,t,o)=>{if(!t)return o?x(e):e;const r=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),n=e.map((e=>!!r.test(e.name)&&e)).filter(Boolean);return o?x(n,e):n})(l,E,n)),[l,E,n]);(0,g.useEffect)((()=>{b&&b(C.updated)}),[b,C]),(0,g.useEffect)((()=>{"function"==typeof h&&h(E)}),[E,h]);const N=(0,g.useCallback)((e=>()=>{a&&d([]);const t=w.findIndex((({id:t})=>t===e));d([...w.slice(0,t),...w.slice(t+1)])}),[a,w,d]),P=(0,g.useCallback)((e=>()=>{Array.isArray(e)?d(e):-1===w.findIndex((({id:t})=>t===e.id))?d(a?[e]:[...w,e]):N(e.id)()}),[a,N,d,w]),A=(0,g.useCallback)((e=>{const[t]=w.filter((t=>!e.find((e=>t.id===e.id))));N(t.id)()}),[N,w]);return(0,r.createElement)("div",{className:(0,i.A)("woocommerce-search-list",t,{"is-compact":o,"is-loading":c,"is-token":"token"===_})},"text"===_&&(0,r.createElement)(R,{...e,onRemove:N,messages:C}),(0,r.createElement)("div",{className:"woocommerce-search-list__search"},"text"===_?(0,r.createElement)(u.TextControl,{label:C.search,type:"search",value:E,onChange:e=>y(e)}):(0,r.createElement)(u.FormTokenField,{disabled:c,label:C.search,onChange:A,onInputChange:e=>y(e),suggestions:[],__experimentalValidateInput:()=>!1,value:c?[(0,s.__)("Loading…","woocommerce")]:w.map((e=>({...e,value:e.name}))),__experimentalShowHowTo:!1})),c?(0,r.createElement)("div",{className:"woocommerce-search-list__list"},(0,r.createElement)(u.Spinner,null)):(0,r.createElement)(F,{...e,search:E,filteredList:S,messages:C,onSelect:P,instanceId:k,useExpandedPanelId:v}))},$=((0,u.withSpokenMessages)(V),e=>t=>{let{selected:o}=t;o=void 0===o?null:o;const n=null===o;return Array.isArray(o)?(0,r.createElement)(e,{...t}):(0,r.createElement)(e,{...t,selected:n?[]:[o]})});var M=o(812),z=o(3832);const H=window.wp.apiFetch;var j=o.n(H),q=o(5703);const W=({selected:e=[],search:t="",queryArgs:o={}})=>{const r=(({selected:e=[],search:t="",queryArgs:o={}})=>{const r=M.r7.productCount>100,n={per_page:r?100:0,catalog_visibility:"any",search:t,orderby:"title",order:"asc"},c=[(0,z.addQueryArgs)("/wc/store/v1/products",{...n,...o})];return r&&e.length&&c.push((0,z.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:e,per_page:0})),c})({selected:e,search:t,queryArgs:o});return Promise.all(r.map((e=>j()({path:e})))).then((e=>{const t=((e,t)=>{const o=new Map;return e.filter((e=>{const r=t(e);return!o.has(r)&&(o.set(r,e),!0)}))})(e.flat(),(e=>e.id));return t.map((e=>({...e,parent:0})))})).catch((e=>{throw e}))};var G=o(4717);const Q=async e=>{if(!("json"in e))return{message:e.message,type:e.type||"general"};try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}};var Y=o(2294),U=o(923),K=o.n(U);const J=(0,p.createHigherOrderComponent)((e=>{class t extends g.Component{constructor(...e){super(...e),(0,Y.A)(this,"state",{error:null,loading:!1,variations:{}}),(0,Y.A)(this,"prevSelectedItem",void 0),(0,Y.A)(this,"loadVariations",(()=>{const{products:e}=this.props,{loading:t,variations:o}=this.state;if(t)return;const r=this.getExpandedProduct();if(!r||o[r])return;const n=e.find((e=>e.id===r));var c;null!=n&&n.variations&&0!==n.variations.length?(this.setState({loading:!0}),(c=r,j()({path:(0,z.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:c})})).then((e=>{const t=e.map((e=>({...e,parent:r})));this.setState({variations:{...this.state.variations,[r]:t},loading:!1,error:null})})).catch((async e=>{const t=await Q(e);this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:t})}))):this.setState({variations:{...this.state.variations,[r]:null},loading:!1,error:null})}))}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:o,showVariations:r}=this.props;r&&(!K()(e.selected,o)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some((t=>t.id===e))}findParentProduct(e){var t;const{products:o}=this.props;return null===(t=o.filter((t=>t.variations&&t.variations.find((({id:t})=>t===e))))[0])||void 0===t?void 0:t.id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:o}=this.props;if(!o)return null;let r=t&&t.length?t[0]:null;return r?this.prevSelectedItem=r:!this.prevSelectedItem||e||this.isProductId(this.prevSelectedItem)||(r=this.prevSelectedItem),!e&&r?this.isProductId(r)?r:this.findParentProduct(r):null}render(){const{error:t,isLoading:o}=this.props,{error:n,loading:c,variations:a}=this.state;return(0,r.createElement)(e,{...this.props,error:n||t,expandedProduct:this.getExpandedProduct(),isLoading:o,variations:a,variationsLoading:c})}}return t}),"withProductVariations"),Z=J,X=e=>{const{id:t,name:o,parent:r}=e;return{id:t,name:o,parent:r,breadcrumbs:[],children:[],details:e,value:e.slug}},ee=window.wp.escapeHtml,te=({error:e})=>(0,r.createElement)("div",{className:"wc-block-error-message"},(({message:e,type:t})=>e?"general"===t?(0,r.createElement)("span",null,(0,s.__)("The following error was returned","woocommerce"),(0,r.createElement)("br",null),(0,r.createElement)("code",null,(0,ee.escapeHTML)(e))):"api"===t?(0,r.createElement)("span",null,(0,s.__)("The following error was returned from the API","woocommerce"),(0,r.createElement)("br",null),(0,r.createElement)("code",null,(0,ee.escapeHTML)(e))):e:(0,s.__)("An error has prevented the block from being updated.","woocommerce"))(e)),oe=({className:e,item:t,isSelected:o,isLoading:n,onSelect:c,disabled:a,...l})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(P,{...l,key:t.id,className:e,isSelected:o,item:t,onSelect:c,disabled:a}),o&&n&&(0,r.createElement)("div",{key:"loading",className:(0,i.A)("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},(0,r.createElement)(u.Spinner,null)));o(7369);const re={list:(0,s.__)("Products","woocommerce"),noItems:(0,s.__)("Your store doesn't have any products.","woocommerce"),search:(0,s.__)("Search for a product to display","woocommerce"),updated:(0,s.__)("Product search results updated.","woocommerce")},ne=$((ce=Z((0,p.withInstanceId)((e=>{const{expandedProduct:t=null,error:o,instanceId:n,isCompact:c=!1,isLoading:a,onChange:l,onSearch:m,products:d,renderItem:u,selected:p=[],showVariations:g=!1,variations:h,variationsLoading:w}=e;if(o)return(0,r.createElement)(te,{error:o});const _=[...d,...h&&t&&h[t]?h[t]:[]].map(X);return(0,r.createElement)(V,{className:"woocommerce-products",list:_,isCompact:c,isLoading:a,isSingle:!0,selected:_.filter((({id:e})=>p.includes(Number(e)))),onChange:l,renderItem:u||(g?e=>{var t,o,c,l;const{item:m,search:d,depth:u=0,isSelected:p,onSelect:g}=e,h=null!==(t=m.details)&&void 0!==t&&t.variations&&Array.isArray(m.details.variations)?m.details.variations.length:0,_=(0,i.A)("woocommerce-search-product__item","woocommerce-search-list__item",`depth-${u}`,"has-count",{"is-searching":d.length>0,"is-skip-level":0===u&&0!==m.parent,"is-variable":h>0});if(!m.breadcrumbs.length){var b,E,v,k,f;const t=(null===(b=m.details)||void 0===b?void 0:b.variations)&&m.details.variations.length>0;return(0,r.createElement)(oe,{...e,className:(0,i.A)(_,{"is-selected":p}),isSelected:p,item:m,onSelect:()=>()=>{g(m)()},isLoading:a||w,countLabel:t?(0,s.sprintf)(/* translators: %1$d is the number of variations of a product product. */ /* translators: %1$d is the number of variations of a product product. */
(0,s.__)("%1$d variations","woocommerce"),null===(E=m.details)||void 0===E?void 0:E.variations.length):null,name:`products-${n}`,"aria-label":t?(0,s.sprintf)(/* translators: %1$s is the product name, %2$d is the number of variations of that product. */ /* translators: %1$s is the product name, %2$d is the number of variations of that product. */
(0,s._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",null===(v=m.details)||void 0===v||null===(k=v.variations)||void 0===k?void 0:k.length,"woocommerce"),m.name,null===(f=m.details)||void 0===f?void 0:f.variations.length):void 0})}const x=(0,y.isEmpty)(null===(o=m.details)||void 0===o?void 0:o.variation)?e:{...e,item:{...e.item,name:null===(c=m.details)||void 0===c?void 0:c.variation},"aria-label":`${m.breadcrumbs[0]}: ${null===(l=m.details)||void 0===l?void 0:l.variation}`};return(0,r.createElement)(P,{...x,className:_,name:`variations-${n}`})}:void 0),onSearch:m,messages:{...re,...e.messages},isHierarchical:!0})}))),({selected:e,...t})=>{const[o,n]=(0,g.useState)(!0),[c,a]=(0,g.useState)(null),[l,s]=(0,g.useState)([]),i=M.r7.productCount>100,m=async e=>{const t=await Q(e);a(t),n(!1)},d=(0,g.useRef)(e);(0,g.useEffect)((()=>{W({selected:d.current}).then((e=>{s(e),n(!1)})).catch(m)}),[d]);const u=(0,G.YQ)((t=>{W({selected:e,search:t}).then((e=>{s(e),n(!1)})).catch(m)}),400),p=(0,g.useCallback)((e=>{n(!0),u(e)}),[n,u]);return(0,r.createElement)(ce,{...t,selected:e,error:c,products:l,isLoading:o,onSearch:i?p:null})}));var ce;o(4738);const ae=function({className:e="",...t}){const o=(0,i.A)("wc-block-text-toolbar-button",e);return(0,r.createElement)(u.Button,{className:o,...t})};var le=o(2796);o(7947);const se=e=>t=>o=>{var n;const c=(0,le.useProductDataContext)(),{attributes:a,setAttributes:i}=o,{productId:m}=a,[d,p]=(0,g.useState)(!m);return c.hasContext||Number.isFinite(null===(n=o.context)||void 0===n?void 0:n.queryId)?(0,r.createElement)(t,{...o}):(0,r.createElement)(r.Fragment,null,d?(0,r.createElement)(u.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&(0,r.createElement)("div",null,e.description),(0,r.createElement)("div",{className:"wc-atomic-blocks-product__selection"},(0,r.createElement)(ne,{selected:m||0,showVariations:!0,onChange:(e=[])=>{i({productId:e[0]?e[0].id:0})}}),(0,r.createElement)(u.Button,{variant:"secondary",disabled:!m,onClick:()=>{p(!1)}},(0,s.__)("Done","woocommerce")))):(0,r.createElement)(r.Fragment,null,(0,r.createElement)(l.BlockControls,null,(0,r.createElement)(u.ToolbarGroup,null,(0,r.createElement)(ae,{onClick:()=>p(!0)},(0,s.__)("Switch product…","woocommerce")))),(0,r.createElement)(t,{...o})))};var ie=o(4478);const me=(0,s.__)("Product Title","woocommerce"),de=(0,r.createElement)(c.A,{icon:ie.A,className:"wc-block-editor-components-block-icon"}),ue=(0,s.__)("Display the title of a product.","woocommerce");o(6342);const pe=(0,p.compose)([se({icon:de,label:me,description:(0,s.__)("Choose a product to display its title.","woocommerce")})])((({attributes:e,setAttributes:t})=>{const o=(0,l.useBlockProps)(),{headingLevel:n,showProductLink:c,align:a,linkTarget:i}=e;return(0,r.createElement)("div",{...o},(0,r.createElement)(l.BlockControls,null,(0,r.createElement)(b,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:n,onChange:e=>t({headingLevel:e})}),(0,r.createElement)(l.AlignmentToolbar,{value:a,onChange:e=>{t({align:e})}})),(0,r.createElement)(l.InspectorControls,null,(0,r.createElement)(u.PanelBody,{title:(0,s.__)("Link settings","woocommerce")},(0,r.createElement)(u.ToggleControl,{label:(0,s.__)("Make title a link","woocommerce"),checked:c,onChange:()=>t({showProductLink:!c})}),c&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(u.ToggleControl,{label:(0,s.__)("Open in new tab","woocommerce"),onChange:e=>t({linkTarget:e?"_blank":"_self"}),checked:"_blank"===i})))),(0,r.createElement)(u.Disabled,null,(0,r.createElement)(E.A,{...e})))})),ge=pe,he={...m,ancestor:["woocommerce/all-products","woocommerce/single-product"],title:me,description:ue,icon:{src:de},attributes:d.A,edit:ge,save:({attributes:e})=>(0,r.createElement)("div",{...l.useBlockProps.save({className:(0,i.A)("is-loading",e.className)})}),supports:{...m.supports,typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0},color:{text:!0,background:!0,link:!1,gradients:!0,__experimentalSkipSerialization:!0},..."function"==typeof l.__experimentalGetSpacingClassesAndStyles&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-title"}};(0,n.registerBlockType)("woocommerce/product-title",he);var we=o(7143);const _e=new Set,be=({blockName:e,blockMetadata:t,blockSettings:o,isVariationBlock:r=!1,variationName:c,isAvailableOnPostEditor:a})=>{let l="";t||(t=e);const s=(0,we.select)("core/edit-site");(0,we.subscribe)((()=>{var a;const i=l;l=function(e){const t=(0,y.isNumber)(e)?void 0:e;return null==t?void 0:t.split("//")[1]}(null==s?void 0:s.getEditedPostId());const m=i!==l,d=Boolean(l);if(!m||!d||!e)return;let u=Boolean((0,n.getBlockType)(e));if(u&&(null!==(a=l)&&void 0!==a&&a.includes("single-product")||null!=i&&i.includes("single-product"))&&(r&&c?(0,n.unregisterBlockVariation)(e,c):(0,n.unregisterBlockType)(e),u=!1),!u)if(r)(0,n.registerBlockVariation)(e,o);else{var p;const e=(0,y.isEmpty)(null==o?void 0:o.ancestor)?["woocommerce/single-product"]:null==o?void 0:o.ancestor;(0,n.registerBlockType)(t,{...o,ancestor:null!==(p=l)&&void 0!==p&&p.includes("single-product")?void 0:e})}}),"core/edit-site"),(0,we.subscribe)((()=>{(Boolean(c)?_e.has(c):_e.has(e))||!a||s||(r?(_e.add(c),(0,n.registerBlockVariation)(e,o)):(_e.add(e),(0,n.registerBlockType)(t,o)))}),"core/edit-post")};var Ee=o(3576),ye=o(2519);const ve=()=>({isDescendentOfSingleProductTemplate:(0,we.useSelect)((e=>{const t=e("core/edit-site"),o=null==t?void 0:t.getEditedPostId();return Boolean(null==o?void 0:o.includes("//single-product"))}),[])}),ke={...m.supports,color:{text:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalSkipSerialization:!0,__experimentalLetterSpacing:!0},__experimentalSelector:".wp-block-woocommerce-product-price .wc-block-components-product-price",..."function"==typeof l.__experimentalGetSpacingClassesAndStyles&&{spacing:{margin:!0,padding:!0}}},fe=JSON.parse('{"name":"woocommerce/product-price","version":"1.0.0","title":"Product Price","description":"Display the price of a product.","category":"woocommerce-product-elements","attributes":{"productId":{"type":"number","default":0},"isDescendentOfQueryLoop":{"type":"boolean","default":false},"textAlign":{"type":"string","default":""},"isDescendentOfSingleProductTemplate":{"type":"boolean","default":false},"isDescendentOfSingleProductBlock":{"type":"boolean","default":false}},"usesContext":["query","queryId","postId"],"keywords":["WooCommerce"],"textdomain":"woocommerce","apiVersion":3,"supports":{"html":false},"ancestor":["woocommerce/all-products","woocommerce/single-product","woocommerce/product-template","core/post-template"],"$schema":"https://schemas.wp.org/trunk/block.json"}');be({blockName:fe.name,blockMetadata:fe,blockSettings:{...m,supports:ke,icon:(0,r.createElement)(c.A,{icon:Ee.A,className:"wc-block-editor-components-block-icon"}),edit:({attributes:e,setAttributes:t,context:o})=>{const n=(0,l.useBlockProps)(),c={...e,...o},a=Number.isFinite(o.queryId);let{isDescendentOfSingleProductTemplate:s}=ve();return a&&(s=!1),(0,g.useEffect)((()=>t({isDescendentOfQueryLoop:a,isDescendentOfSingleProductTemplate:s})),[a,s,t]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(l.BlockControls,null,(0,r.createElement)(l.AlignmentToolbar,{value:e.textAlign,onChange:e=>{t({textAlign:e})}})),(0,r.createElement)("div",{...n},(0,r.createElement)(ye.default,{...c})))}},isAvailableOnPostEditor:!0});var xe=o(231),Ce=o(4269);const Se=(0,r.createElement)(c.A,{icon:Ce.A,className:"wc-block-editor-components-block-icon"});var Ne=o(7746),Pe=o(1281);const Ae={cover:(0,s.__)("Image is scaled and cropped to fill the entire space without being distorted.","woocommerce"),contain:(0,s.__)("Image is scaled to fill the space without clipping nor distorting.","woocommerce"),fill:(0,s.__)("Image will be stretched and distorted to completely fill the space.","woocommerce")},Te=[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"%",label:"%"},{value:"vw",label:"vw"},{value:"vh",label:"vh"}],Be=({scale:e,width:t,height:o,setAttributes:n})=>(0,r.createElement)(u.__experimentalToolsPanel,{className:"wc-block-product-image__tools-panel",label:(0,s.__)("Image size","woocommerce")},(0,r.createElement)(u.__experimentalUnitControl,{label:(0,s.__)("Height","woocommerce"),onChange:e=>{n({height:e})},value:o,units:Te}),(0,r.createElement)(u.__experimentalUnitControl,{label:(0,s.__)("Width","woocommerce"),onChange:e=>{n({width:e})},value:t,units:Te}),o&&(0,r.createElement)(u.__experimentalToolsPanelItem,{hasValue:()=>!0,label:(0,s.__)("Scale","woocommerce")},(0,r.createElement)(u.__experimentalToggleGroupControl,{label:(0,s.__)("Scale","woocommerce"),value:e,help:Ae[e],onChange:e=>n({scale:e}),isBlock:!0},(0,r.createElement)(r.Fragment,null,(0,r.createElement)(u.__experimentalToggleGroupControlOption,{value:"cover",label:(0,s.__)("Cover","woocommerce")}),(0,r.createElement)(u.__experimentalToggleGroupControlOption,{value:"contain",label:(0,s.__)("Contain","woocommerce")}),(0,r.createElement)(u.__experimentalToggleGroupControlOption,{value:"fill",label:(0,s.__)("Fill","woocommerce")}))))),Ie=se({icon:Se,title:Ne.title,description:Ne.description})((({attributes:e,setAttributes:t,context:o})=>{const{showProductLink:n,imageSizing:c,showSaleBadge:a,saleBadgeAlign:i,width:m,height:d,scale:p}=e,h=(0,l.useBlockProps)({style:{width:m,height:d}}),w=Number.isFinite(o.queryId),_=(0,q.getSettingWithCoercion)("isBlockThemeEnabled",!1,y.isBoolean);return(0,g.useEffect)((()=>t({isDescendentOfQueryLoop:w})),[t,w]),(0,r.createElement)("div",{...h},(0,r.createElement)(l.InspectorControls,null,(0,r.createElement)(Be,{scale:p,width:m,height:d,setAttributes:t}),(0,r.createElement)(u.PanelBody,{title:(0,s.__)("Content","woocommerce")},(0,r.createElement)(u.ToggleControl,{label:(0,s.__)("Link to Product Page","woocommerce"),help:(0,s.__)("Links the image to the single product listing.","woocommerce"),checked:n,onChange:()=>t({showProductLink:!n})}),(0,r.createElement)(u.ToggleControl,{label:(0,s.__)("Show On-Sale Badge","woocommerce"),help:(0,s.__)("Display a “sale” badge if the product is on-sale.","woocommerce"),checked:a,onChange:()=>t({showSaleBadge:!a})}),a&&(0,r.createElement)(u.__experimentalToggleGroupControl,{label:(0,s.__)("Sale Badge Alignment","woocommerce"),value:i,onChange:e=>t({saleBadgeAlign:e})},(0,r.createElement)(u.__experimentalToggleGroupControlOption,{value:"left",label:(0,s.__)("Left","woocommerce")}),(0,r.createElement)(u.__experimentalToggleGroupControlOption,{value:"center",label:(0,s.__)("Center","woocommerce")}),(0,r.createElement)(u.__experimentalToggleGroupControlOption,{value:"right",label:(0,s.__)("Right","woocommerce")})),(0,r.createElement)(u.__experimentalToggleGroupControl,{label:(0,s.__)("Image Sizing","woocommerce"),help:_?null:(0,g.createInterpolateElement)((0,s.__)("Product image cropping can be modified in the <a>Customizer</a>.","woocommerce"),{a:(0,r.createElement)("a",{href:`${(0,q.getAdminLink)("customize.php")}?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images`,target:"_blank",rel:"noopener noreferrer"})}),value:c,onChange:e=>t({imageSizing:e})},(0,r.createElement)(u.__experimentalToggleGroupControlOption,{value:Pe.e.SINGLE,label:(0,s.__)("Full Size","woocommerce")}),(0,r.createElement)(u.__experimentalToggleGroupControlOption,{value:Pe.e.THUMBNAIL,label:(0,s.__)("Cropped","woocommerce")})))),(0,r.createElement)(u.Disabled,null,(0,r.createElement)(xe.A,{...e,...o})))})),Oe={html:!1,__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},..."function"==typeof l.__experimentalGetSpacingClassesAndStyles&&{spacing:{margin:!0,padding:!0}},__experimentalSelector:".wc-block-components-product-image"};(0,n.registerBlockType)(Ne,{...m,icon:Se,supports:Oe,edit:Ie});var Le=o(8757);o(3047);const De=({blockClientId:e})=>{const{isDescendentOfSingleProductBlock:t}=(0,we.useSelect)((t=>{const{getBlockParentsByBlockName:o}=t("core/block-editor");return{isDescendentOfSingleProductBlock:o(null==e?void 0:e.replace("block-",""),["woocommerce/single-product"]).length>0}}),[e]);return{isDescendentOfSingleProductBlock:t}};var Re=o(846);(0,s.__)("Product Rating","woocommerce");const Fe=(0,r.createElement)(c.A,{icon:Re.A,className:"wc-block-editor-components-block-icon"}),Ve=((0,s.__)("Display the average rating of a product.","woocommerce"),JSON.parse('{"name":"woocommerce/product-rating","version":"1.0.0","icon":"info","title":"Product Rating","description":"Display the average rating of a product.","attributes":{"productId":{"type":"number","default":0},"isDescendentOfQueryLoop":{"type":"boolean","default":false},"textAlign":{"type":"string","default":""},"isDescendentOfSingleProductBlock":{"type":"boolean","default":false},"isDescendentOfSingleProductTemplate":{"type":"boolean","default":false}},"usesContext":["query","queryId","postId"],"keywords":["WooCommerce"],"supports":{"align":true},"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}')),$e={color:{text:!0,background:!1,link:!1,__experimentalSkipSerialization:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-rating",..."function"==typeof l.__experimentalGetSpacingClassesAndStyles&&{spacing:{margin:!0}}};be({blockName:"woocommerce/product-rating",blockMetadata:Ve,blockSettings:{...m,icon:{src:Fe},supports:$e,edit:e=>{const{attributes:t,setAttributes:o,context:n}=e,c=(0,l.useBlockProps)({className:"wp-block-woocommerce-product-rating"}),a={...t,...n,shouldDisplayMockedReviewsWhenProductHasNoReviews:!0},s=Number.isFinite(n.queryId),{isDescendentOfSingleProductBlock:i}=De({blockClientId:null==c?void 0:c.id});let{isDescendentOfSingleProductTemplate:m}=ve();return(s||i)&&(m=!1),(0,g.useEffect)((()=>{o({isDescendentOfQueryLoop:s,isDescendentOfSingleProductBlock:i,isDescendentOfSingleProductTemplate:m})}),[o,s,i,m]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(l.BlockControls,null,(0,r.createElement)(l.AlignmentToolbar,{value:t.textAlign,onChange:e=>{o({textAlign:e||""})}})),(0,r.createElement)("div",{...c},(0,r.createElement)(Le.default,{...a})))}},isAvailableOnPostEditor:!0});var Me=o(43);const ze=JSON.parse('{"name":"woocommerce/product-rating-stars","title":"Product Rating Stars","description":"Display the average rating of a product with stars","category":"woocommerce-product-elements","attributes":{"productId":{"type":"number","default":0},"isDescendentOfQueryLoop":{"type":"boolean","default":false},"textAlign":{"type":"string","default":""},"isDescendentOfSingleProductBlock":{"type":"boolean","default":false},"isDescendentOfSingleProductTemplate":{"type":"boolean","default":false}},"usesContext":["query","queryId","postId"],"keywords":["WooCommerce"],"supports":{"align":true},"ancestor":["woocommerce/single-product"],"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}');var He=o(9549);(0,n.registerBlockType)(ze,{apiVersion:3,icon:{src:(0,r.createElement)(c.A,{icon:Me.A,className:"wc-block-editor-components-block-icon"})},supports:{inserter:!1,color:{text:!0,background:!1,link:!1,__experimentalSkipSerialization:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-rating"},edit:e=>{const{attributes:t,setAttributes:o,context:n}=e,c=(0,l.useBlockProps)({className:"wp-block-woocommerce-product-rating"}),a={...t,...n,shouldDisplayMockedReviewsWhenProductHasNoReviews:!0},s=Number.isFinite(n.queryId),{isDescendentOfSingleProductBlock:i}=De({blockClientId:null==c?void 0:c.id});let{isDescendentOfSingleProductTemplate:m}=ve();return(s||i)&&(m=!1),(0,g.useEffect)((()=>{o({isDescendentOfQueryLoop:s,isDescendentOfSingleProductBlock:i,isDescendentOfSingleProductTemplate:m})}),[o,s,i,m]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(l.BlockControls,null,(0,r.createElement)(l.AlignmentToolbar,{value:t.textAlign,onChange:e=>{o({textAlign:e||""})}})),(0,r.createElement)("div",{...c},(0,r.createElement)(He.default,{...a})))}});const je=JSON.parse('{"name":"woocommerce/product-rating-counter","version":"1.0.0","title":"Product Rating Counter","description":"Display the review count of a product","category":"woocommerce-product-elements","attributes":{"productId":{"type":"number","default":0},"isDescendentOfQueryLoop":{"type":"boolean","default":false},"textAlign":{"type":"string","default":""},"isDescendentOfSingleProductBlock":{"type":"boolean","default":false},"isDescendentOfSingleProductTemplate":{"type":"boolean","default":false}},"usesContext":["query","queryId","postId"],"keywords":["WooCommerce"],"supports":{"align":true},"ancestor":["woocommerce/single-product"],"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}');var qe=o(8614);(0,n.registerBlockType)(je,{apiVersion:3,icon:{src:(0,r.createElement)(c.A,{icon:Me.A,className:"wc-block-editor-components-block-icon"})},supports:{inserter:!1,color:{text:!1,background:!1,link:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-rating-counter"},edit:e=>{const{attributes:t,setAttributes:o,context:n}=e,c=(0,l.useBlockProps)({className:"wp-block-woocommerce-product-rating-counter"}),a={...t,...n,shouldDisplayMockedReviewsWhenProductHasNoReviews:!0},s=Number.isFinite(n.queryId),{isDescendentOfSingleProductBlock:i}=De({blockClientId:null==c?void 0:c.id});let{isDescendentOfSingleProductTemplate:m}=ve();return(s||i)&&(m=!1),(0,g.useEffect)((()=>{o({isDescendentOfQueryLoop:s,isDescendentOfSingleProductBlock:i,isDescendentOfSingleProductTemplate:m})}),[o,s,i,m]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(l.BlockControls,null,(0,r.createElement)(l.AlignmentToolbar,{value:t.textAlign,onChange:e=>{o({textAlign:e||""})}})),(0,r.createElement)("div",{...c},(0,r.createElement)(qe.default,{...a})))}});var We=o(6822);const Ge=JSON.parse('{"name":"woocommerce/product-average-rating","title":"Product Average Rating (Beta)","description":"Display the average rating of a product","apiVersion":3,"category":"woocommerce-product-elements","attributes":{"textAlign":{"type":"string"}},"keywords":["WooCommerce"],"ancestor":["woocommerce/single-product"],"textdomain":"woocommerce","$schema":"https://schemas.wp.org/trunk/block.json"}');var Qe=o(1579);(0,n.registerBlockType)(Ge,{apiVersion:3,icon:{src:(0,r.createElement)(c.A,{icon:We.A,className:"wc-block-editor-components-block-icon"})},supports:{color:{text:!0,background:!0,__experimentalSkipSerialization:!0},spacing:{margin:!0,padding:!0,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalFontWeight:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-average-rating"},edit:e=>{const{attributes:t,setAttributes:o}=e,n=(0,l.useBlockProps)({className:"wp-block-woocommerce-product-average-rating"});return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(l.BlockControls,null,(0,r.createElement)(l.AlignmentToolbar,{value:t.textAlign,onChange:e=>{o({textAlign:e||""})}})),(0,r.createElement)("div",{...n},(0,r.createElement)(Qe.default,{...t})))}});var Ye=o(498),Ue=o(4078);function Ke({selectedWidth:e,setAttributes:t}){return(0,r.createElement)(u.PanelBody,{title:(0,s.__)("Width settings","woocommerce")},(0,r.createElement)(u.ButtonGroup,{"aria-label":(0,s.__)("Button width","woocommerce")},[25,50,75,100].map((o=>(0,r.createElement)(u.Button,{key:o,isSmall:!0,variant:o===e?"primary":void 0,onClick:()=>{var r;t({width:e===(r=o)?void 0:r})}},o,"%")))))}const Je=JSON.parse('{"name":"woocommerce/product-button","version":"1.0.0","title":"Add to Cart Button","description":"Display a call to action button which either adds the product to the cart, or links to the product page.","category":"woocommerce-product-elements","keywords":["WooCommerce"],"usesContext":["query","queryId","postId"],"textdomain":"woocommerce","attributes":{"productId":{"type":"number","default":0},"textAlign":{"type":"string","default":""},"width":{"type":"number"},"isDescendentOfSingleProductBlock":{"type":"boolean","default":false},"isDescendentOfQueryLoop":{"type":"boolean","default":false}},"supports":{"align":["wide","full"],"color":{"background":false,"link":true},"interactivity":true,"html":false,"typography":{"fontSize":true,"lineHeight":true}},"ancestor":["woocommerce/all-products","woocommerce/single-product","core/post-template","woocommerce/product-template"],"styles":[{"name":"fill","label":"Fill","isDefault":true},{"name":"outline","label":"Outline"}],"viewScript":["wc-product-button-interactivity-frontend"],"apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}'),Ze={...Je.supports,color:{text:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},..."function"==typeof l.__experimentalGetSpacingClassesAndStyles&&{spacing:{margin:!0,padding:!0,__experimentalSkipSerialization:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:".wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button"},..."function"==typeof l.__experimentalGetSpacingClassesAndStyles&&{spacing:{margin:!0}}};(0,n.registerBlockType)(Je,{apiVersion:3,icon:{src:(0,r.createElement)(c.A,{icon:Ye.A,className:"wc-block-editor-components-block-icon"})},attributes:{...Je.attributes},supports:{...Ze},edit:({attributes:e,setAttributes:t,context:o})=>{const n=(0,l.useBlockProps)(),c=Number.isFinite(null==o?void 0:o.queryId),{width:a}=e;return(0,g.useEffect)((()=>t({isDescendentOfQueryLoop:c})),[t,c]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(l.BlockControls,null,c&&(0,r.createElement)(l.AlignmentToolbar,{value:e.textAlign,onChange:e=>{t({textAlign:e||""})}})),(0,r.createElement)(l.InspectorControls,null,(0,r.createElement)(Ke,{selectedWidth:a,setAttributes:t})),(0,r.createElement)("div",{...n},(0,r.createElement)(u.Disabled,null,(0,r.createElement)(Ue.default,{...e,...o,className:(0,i.A)(e.className,{[`has-custom-width wp-block-button__width-${a}`]:a})}))))},save:({attributes:e})=>e.isDescendentOfQueryLoop||e.isDescendentOfSingleProductBlock?null:(0,r.createElement)("div",{...l.useBlockProps.save({className:(0,i.A)("is-loading",e.className,{[`has-custom-width wp-block-button__width-${e.width}`]:e.width})})})});var Xe=o(3326),et=o(6465);const tt=(0,s.__)("Product Summary","woocommerce"),ot=(0,r.createElement)(c.A,{icon:et.A,className:"wc-block-editor-components-block-icon"}),rt=(0,s.__)("Display a short description about a product.","woocommerce");o(7764);const nt=se({icon:ot,label:tt,description:rt})((({attributes:e})=>{const t=(0,l.useBlockProps)();return(0,r.createElement)("div",{...t},(0,r.createElement)(Xe.default,{...e}))})),ct={...m,ancestor:["woocommerce/all-products"],title:tt,description:rt,icon:{src:ot},attributes:{productId:{type:"number",default:0}},supports:{color:{background:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-summary"},edit:nt,save:({attributes:e})=>(0,r.createElement)("div",{...l.useBlockProps.save({className:(0,i.A)("is-loading",e.className)})})};(0,n.registerBlockType)("woocommerce/product-summary",ct);var at=o(1173),lt=o(6809);const st={html:!1,align:!0,color:{gradients:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalSkipSerialization:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0},..."function"==typeof l.__experimentalGetSpacingClassesAndStyles&&{spacing:{margin:!0,padding:!0}},__experimentalSelector:".wc-block-components-product-sale-badge",..."function"==typeof l.__experimentalGetSpacingClassesAndStyles&&{spacing:{margin:!0}}},it=JSON.parse('{"name":"woocommerce/product-sale-badge","version":"1.0.0","title":"On-Sale Badge","description":"Displays an on-sale badge if the product is on-sale.","category":"woocommerce-product-elements","attributes":{"productId":{"type":"number","default":0},"isDescendentOfQueryLoop":{"type":"boolean","default":false},"isDescendentOfSingleProductTemplate":{"type":"boolean","default":false}},"usesContext":["query","queryId","postId"],"keywords":["WooCommerce"],"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}');(0,n.registerBlockType)(it,{...m,icon:(0,r.createElement)(c.A,{icon:at.A,className:"wc-block-editor-components-block-icon"}),supports:st,edit:({attributes:e,setAttributes:t,context:o})=>{const n=(0,l.useBlockProps)(),c={...e,...o},a=Number.isFinite(o.queryId),{isDescendentOfSingleProductTemplate:s}=ve();return(0,g.useEffect)((()=>t({isDescendentOfQueryLoop:a,isDescendentOfSingleProductTemplate:s})),[t,a,s]),(0,r.createElement)("div",{...n},(0,r.createElement)(lt.default,{...c}))},ancestor:[...m.ancestor||[],"woocommerce/product-gallery"]});var mt=o(4133);const dt=e=>{const t=((0,le.useProductDataContext)().product||{}).id||e.productId||0;return t&&1!==t?(0,r.createElement)(l.InspectorControls,null,(0,r.createElement)("div",{className:"wc-block-single-product__edit-card"},(0,r.createElement)("div",{className:"wc-block-single-product__edit-card-title"},(0,r.createElement)("a",{href:`${q.ADMIN_URL}post.php?post=${t}&action=edit`,target:"_blank",rel:"noopener noreferrer"},(0,s.__)("Edit this product's details","woocommerce"),(0,r.createElement)(c.A,{icon:mt.A,size:16}))),(0,r.createElement)("div",{className:"wc-block-single-product__edit-card-description"},(0,s.__)("Edit details such as title, price, description and more.","woocommerce")))):null};o(1563);var ut=o(3975);const pt={...m.supports,color:{text:!0,background:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0},..."function"==typeof l.__experimentalGetSpacingClassesAndStyles&&{spacing:{margin:!0,padding:!0}}},gt=(0,r.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"})),ht=(0,s.__)("Product SKU","woocommerce"),wt=(0,r.createElement)(c.A,{icon:gt,className:"wc-block-editor-components-block-icon"}),_t=(0,s.__)("Display the SKU of a product.","woocommerce"),bt={...m,title:ht,description:_t,icon:{src:wt},usesContext:["query","queryId","postId"],attributes:{productId:{type:"number",default:0},isDescendentOfQueryLoop:{type:"boolean",default:!1},isDescendentOfSingleProductTemplate:{type:"boolean",default:!1},isDescendantOfAllProducts:{type:"boolean",default:!1},showProductSelector:{type:"boolean",default:!1},prefix:{type:"string",default:"SKU:"},suffix:{type:"string",default:""}},ancestor:[...m.ancestor||[],"woocommerce/product-meta"],edit:({attributes:e,setAttributes:t,context:o})=>{const{style:n,...c}=(0,l.useBlockProps)({className:"wc-block-components-product-sku wp-block-woocommerce-product-sku"}),a={...e,...o},s=Number.isFinite(o.queryId),{isDescendentOfSingleProductBlock:i}=De({blockClientId:c.id});let{isDescendentOfSingleProductTemplate:m}=ve();return s&&(m=!1),(0,g.useEffect)((()=>t({isDescendentOfQueryLoop:s,isDescendentOfSingleProductTemplate:m,isDescendentOfSingleProductBlock:i})),[t,s,m,i]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(dt,null),(0,r.createElement)("div",{...c,style:e.isDescendantOfAllProducts?void 0:n},(0,r.createElement)(ut.default,{...a,setAttributes:t})))},save:()=>null,supports:pt};(0,n.registerBlockType)("woocommerce/product-sku",{...bt});var Et=o(2686),yt=o(885);const vt=(0,s.__)("Product Stock Indicator","woocommerce"),kt=(0,r.createElement)(c.A,{icon:yt.A,className:"wc-block-editor-components-block-icon"}),ft=(0,s.__)("Display product stock status.","woocommerce"),xt=se({icon:kt,label:vt,description:ft})((({attributes:e,setAttributes:t,context:o})=>{const{style:n,...c}=(0,l.useBlockProps)({className:"wc-block-components-product-stock-indicator"}),a={...e,...o},s=Number.isFinite(o.queryId);return(0,g.useEffect)((()=>t({isDescendentOfQueryLoop:s})),[t,s]),(0,r.createElement)("div",{...c,style:e.isDescendantOfAllProducts?void 0:n},(0,r.createElement)(dt,null),(0,r.createElement)(Et.default,{...a}))})),Ct={...m.supports,color:{text:!0,background:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0},..."function"==typeof l.__experimentalGetSpacingClassesAndStyles&&{spacing:{margin:!0,padding:!0}}},St={...m,title:vt,description:ft,icon:{src:kt},attributes:{productId:{type:"number",default:0},isDescendentOfQueryLoop:{type:"boolean",default:!1},isDescendantOfAllProducts:{type:"boolean",default:!1}},supports:Ct,edit:xt,usesContext:["query","queryId","postId"]};(0,n.registerBlockType)("woocommerce/product-stock-indicator",{...St});const Nt=JSON.parse('{"name":"woocommerce/add-to-cart-form","version":"1.0.0","title":"Add to Cart with Options","description":"Display a button so the customer can add a product to their cart. Options will also be displayed depending on product type. e.g. quantity, variation.","category":"woocommerce-product-elements","attributes":{"isDescendentOfSingleProductBlock":{"type":"boolean","default":false}},"keywords":["WooCommerce"],"usesContext":["postId"],"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}');o(6455);const Pt=({numberOfLines:e=1,tag:t="div",maxWidth:o="100%"})=>{const n=Array.from({length:e},((e,t)=>(0,r.createElement)("span",{className:"wc-block-components-skeleton-text-line","aria-hidden":"true",key:t})));return(0,r.createElement)(t,{className:"wc-block-components-skeleton",style:{maxWidth:o}},n)};o(3527);o(5195);const At={edit:e=>{const{setAttributes:t}=e,o=(0,l.useBlockProps)({className:"wc-block-add-to-cart-form"}),{isDescendentOfSingleProductBlock:n}=De({blockClientId:null==o?void 0:o.id});return(0,g.useEffect)((()=>{t({isDescendentOfSingleProductBlock:n})}),[t,n]),(0,r.createElement)("div",{...o},(0,r.createElement)(u.Tooltip,{text:"Customer will see product add-to-cart options in this space, dependent on the product type. ",position:"bottom right"},(0,r.createElement)("div",{className:"wc-block-editor-add-to-cart-form-container"},(0,r.createElement)(Pt,{numberOfLines:3}),(0,r.createElement)(u.Disabled,null,(0,r.createElement)("div",{className:"quantity"},(0,r.createElement)("input",{type:"number",value:"1",className:"input-text qty text",readOnly:!0})),(0,r.createElement)("button",{className:"single_add_to_cart_button button alt wp-element-button"},(0,s.__)("Add to cart","woocommerce"))))))},icon:{src:(0,r.createElement)(c.A,{icon:Ye.A,className:"wc-block-editor-components-block-icon"})},ancestor:["woocommerce/single-product"],save:()=>null};be({blockName:Nt.name,blockMetadata:Nt,blockSettings:At,isAvailableOnPostEditor:!0});var Tt=o(3782);o(3400);const Bt=()=>(0,r.createElement)("div",{className:"wc-block-editor-product-gallery"},(0,r.createElement)("img",{src:`${M.sW}block-placeholders/product-image-gallery.svg`,alt:"Placeholder"}),(0,r.createElement)("div",{className:"wc-block-editor-product-gallery__other-images"},[...Array(4).keys()].map((e=>(0,r.createElement)("img",{key:e,src:`${M.sW}block-placeholders/product-image-gallery.svg`,alt:"Placeholder"}))))),It=JSON.parse('{"name":"woocommerce/product-image-gallery","version":"1.0.0","title":"Product Image Gallery","icon":"gallery","description":"Display a product\'s images.","category":"woocommerce-product-elements","supports":{"align":true,"multiple":false},"keywords":["WooCommerce"],"usesContext":["postId","postType","queryId"],"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}');o(618);const Ot="woocommerce/product-gallery";be({blockName:It.name,blockMetadata:It,blockSettings:{icon:Tt.A,edit:()=>{const e=(0,l.useBlockProps)();return(0,r.createElement)("div",{...e},(0,r.createElement)(u.Disabled,null,(0,r.createElement)(Bt,null)))},transforms:{to:[{type:"block",blocks:[Ot],transform:()=>(0,n.createBlock)(Ot)}]}},isAvailableOnPostEditor:!1});const Lt=(0,r.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor",d:"M5 5.5H19C19.1326 5.5 19.2598 5.55268 19.3536 5.64645C19.4473 5.74021 19.5 5.86739 19.5 6V7.5C19.5 7.63261 19.4473 7.75979 19.3536 7.85355C19.2598 7.94732 19.1326 8 19 8H5C4.86739 8 4.74021 7.94732 4.64645 7.85355C4.55268 7.75979 4.5 7.63261 4.5 7.5V6C4.5 5.86739 4.55268 5.74021 4.64645 5.64645C4.74021 5.55268 4.86739 5.5 5 5.5V5.5ZM4 9.232C3.69597 9.05647 3.4435 8.804 3.26796 8.49997C3.09243 8.19594 3.00001 7.85106 3 7.5V6C3 5.46957 3.21071 4.96086 3.58579 4.58579C3.96086 4.21071 4.46957 4 5 4H19C19.5304 4 20.0391 4.21071 20.4142 4.58579C20.7893 4.96086 21 5.46957 21 6V7.5C21 7.85106 20.9076 8.19594 20.732 8.49997C20.5565 8.804 20.304 9.05647 20 9.232V18C20 18.5304 19.7893 19.0391 19.4142 19.4142C19.0391 19.7893 18.5304 20 18 20H6C5.46957 20 4.96086 19.7893 4.58579 19.4142C4.21071 19.0391 4 18.5304 4 18V9.232ZM5.5 9.5V18C5.5 18.1326 5.55268 18.2598 5.64645 18.3536C5.74021 18.4473 5.86739 18.5 6 18.5H18C18.1326 18.5 18.2598 18.4473 18.3536 18.3536C18.4473 18.2598 18.5 18.1326 18.5 18V9.5H5.5Z"}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 13.25V11.75H16V13.25L8 13.25Z"}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 16.25V14.75H16V16.25H8Z"})),Dt=JSON.parse('{"name":"woocommerce/product-details","version":"1.0.0","icon":"info","title":"Product Details","description":"Display a product\'s description, attributes, and reviews.","category":"woocommerce-product-elements","attributes":{"hideTabTitle":{"type":"boolean","default":false}},"keywords":["WooCommerce"],"supports":{"align":true,"spacing":{"margin":true}},"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}'),Rt=({id:e,title:t,active:o})=>(0,r.createElement)("li",{className:(0,i.A)(`${e}_tab`,{active:o}),id:`tab-title-${e}`,role:"tab","aria-controls":`tab-${e}`},(0,r.createElement)("a",{href:`#tab-${e}`},t)),Ft=({id:e,content:t})=>(0,r.createElement)("div",{className:`${e}_tab`,id:`tab-title-${e}`,role:"tab","aria-controls":`tab-${e}`},t),Vt=({hideTabTitle:e})=>{const t=[{id:"description",title:"Description",active:!0,content:(0,r.createElement)(r.Fragment,null,!e&&(0,r.createElement)("h2",null,(0,s.__)("Description","woocommerce")),(0,r.createElement)("p",null,(0,s.__)("This block lists description, attributes and reviews for a single product.","woocommerce")))},{id:"additional_information",title:"Additional Information",active:!1},{id:"reviews",title:"Reviews",active:!1}],o=t.map((({id:e,title:t,active:o})=>(0,r.createElement)(Rt,{key:e,id:e,title:t,active:o}))),n=t.map((({id:e,content:t})=>(0,r.createElement)(Ft,{key:e,id:e,content:t})));return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("ul",{className:"wc-tabs tabs",role:"tablist"},o),n)};o(6160);o(3778),be({blockName:Dt.name,blockMetadata:Dt,blockSettings:{icon:{src:(0,r.createElement)(c.A,{icon:Lt,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>{const{className:o,hideTabTitle:n}=e,c=(0,l.useBlockProps)({className:o});return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{...c},(0,r.createElement)(l.InspectorControls,{key:"inspector"},(0,r.createElement)(u.PanelBody,{title:(0,s.__)("Settings","woocommerce")},(0,r.createElement)(u.ToggleControl,{label:(0,s.__)("Show tab title in content","woocommerce"),checked:!n,onChange:()=>t({hideTabTitle:!n})}))),(0,r.createElement)(u.Disabled,null,(0,r.createElement)(Vt,{hideTabTitle:n}))))}},isAvailableOnPostEditor:!1});const $t=JSON.parse('{"name":"woocommerce/product-reviews","version":"1.0.0","icon":"admin-comments","title":"Product Reviews","description":"A block that shows the reviews for a product.","category":"woocommerce-product-elements","keywords":["WooCommerce"],"supports":{},"attributes":{},"usesContext":["postId"],"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}'),Mt=()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(u.Notice,{className:"wc-block-editor-related-products__notice",status:"info",isDismissible:!1},(0,r.createElement)("p",null,(0,s.__)("The products reviews and the form to add a new review will be displayed here according to your theme. The look you see here is not representative of what is going to look like, this is just a placeholder.","woocommerce"))),(0,r.createElement)("h2",null,(0,s.__)("3 reviews for this product","woocommerce")),(0,r.createElement)("img",{src:`${M.sW}block-placeholders/product-reviews.svg`,alt:"Placeholder"}),(0,r.createElement)("h3",null,(0,s.__)("Add a review","woocommerce")),(0,r.createElement)("div",{className:"wp-block-woocommerce-product-reviews__editor__form-container"},(0,r.createElement)("div",{className:"wp-block-woocommerce-product-reviews__editor__row"},(0,r.createElement)("span",null,(0,s.__)("Your rating *","woocommerce")),(0,r.createElement)("p",{className:"wp-block-woocommerce-product-reviews__editor__stars"})),(0,r.createElement)("div",{className:"wp-block-woocommerce-product-reviews__editor__row"},(0,r.createElement)("span",null,(0,s.__)("Your review *","woocommerce")),(0,r.createElement)("textarea",null)),(0,r.createElement)("input",{type:"submit",className:"submit wp-block-button__link wp-element-button",value:(0,s.__)("Submit","woocommerce")})));o(445),be({blockName:$t.name,blockMetadata:$t,blockSettings:{edit:({attributes:e})=>{const{className:t}=e,o=(0,l.useBlockProps)({className:t});return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{...o},(0,r.createElement)(u.Disabled,null,(0,r.createElement)(Mt,null))))}},isAvailableOnPostEditor:!1});const zt=(0,r.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 19.375L4.5 7.625C4.5 7.55596 4.55596 7.5 4.625 7.5L16.375 7.5C16.444 7.5 16.5 7.55596 16.5 7.625L16.5 19.375C16.5 19.444 16.444 19.5 16.375 19.5L4.625 19.5C4.55596 19.5 4.5 19.444 4.5 19.375ZM4.625 21C3.72754 21 3 20.2725 3 19.375L3 7.625C3 6.72754 3.72754 6 4.625 6L16.375 6C17.2725 6 18 6.72754 18 7.625L18 19.375C18 20.2725 17.2725 21 16.375 21L4.625 21ZM19 3.75L8 3.75L8 2.25L19 2.25C20.5183 2.25 21.75 3.4796 21.75 4.99891L21.75 18L20.25 18L20.25 4.99891C20.25 4.30909 19.6909 3.75 19 3.75Z"}));function Ht(e,{blockDescription:t,blockIcon:o,blockTitle:r,variationName:c,scope:a}){(0,n.registerBlockVariation)(e,{description:t,name:c,title:r,isActive:e=>e.__woocommerceNamespace===c,icon:{src:o},attributes:{__woocommerceNamespace:c},scope:a})}const jt="woocommerce/product-query/product-title";Ht("core/post-title",{blockDescription:ue,blockIcon:(0,r.createElement)(u.Icon,{icon:ie.A}),blockTitle:me,variationName:jt,scope:["block"]});var qt=o(4396);const Wt="woocommerce/product-query/product-template";Ht("core/post-template",{blockDescription:(0,s.__)("Contains the block elements used to render a product, like its name, featured image, rating, and more.","woocommerce"),blockIcon:(0,r.createElement)(u.Icon,{icon:qt.A}),blockTitle:(0,s.__)("Product template","woocommerce"),variationName:Wt,scope:["block","inserter"]});const Gt=(0,q.getSetting)("stockStatusOptions",[]),Qt=((0,q.getSetting)("hideOutOfStockItems",!1)?Object.keys(function(e,t){const{[t]:o,...r}=e;return r}(Gt,"outofstock")):Object.keys(Gt),(0,q.getSettingWithCoercion)("postTemplateHasSupportForGridView",!1,y.isBoolean),Pe.e.THUMBNAIL,"woocommerce/related-products"),Yt={namespace:Qt,allowedControls:[],displayLayout:{type:"flex",columns:5},query:{perPage:5,pages:0,offset:0,postType:"product",order:"asc",orderBy:"title",author:"",search:"",exclude:[],sticky:"",inherit:!1},lock:{remove:!0,move:!0}},Ut=(0,q.getSettingWithCoercion)("postTemplateHasSupportForGridView",!1,y.isBoolean),Kt=[["core/heading",{level:2,content:(0,s.__)("Related products","woocommerce"),style:{spacing:{margin:{top:"1rem",bottom:"1rem"}}}}],["core/post-template",{__woocommerceNamespace:Wt,...Ut&&{layout:{type:"grid",columnCount:5}}},[["woocommerce/product-image",{productId:0,imageSizing:"cropped"}],["core/post-title",{textAlign:"center",level:3,fontSize:"medium",isLink:!0,__woocommerceNamespace:jt},[]],["woocommerce/product-price",{textAlign:"center",fontSize:"small",style:{spacing:{margin:{bottom:"1rem"}}}},[]],["woocommerce/product-button",{textAlign:"center",fontSize:"small",style:{spacing:{margin:{bottom:"1rem"}}}},[]]]]];be({blockName:"core/query",blockMetadata:{},blockSettings:{description:(0,s.__)("Display related products.","woocommerce"),name:"Related Products Controls",title:(0,s.__)("Related Products Controls","woocommerce"),isActive:e=>e.namespace===Qt,icon:(0,r.createElement)(u.Icon,{icon:zt,className:"wc-block-editor-components-block-icon wc-block-editor-components-block-icon--stacks"}),attributes:Yt,allowedControls:[],innerBlocks:Kt,scope:["block"]},isVariationBlock:!0,variationName:Qt}),o(9278);const Jt=JSON.parse('{"name":"woocommerce/related-products","version":"1.0.0","title":"Related Products","icon":"product","description":"Display related products.","category":"woocommerce","supports":{"align":true,"reusable":false},"keywords":["WooCommerce"],"usesContext":["postId","postType","queryId"],"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}');be({blockName:Jt.name,blockMetadata:Jt,blockSettings:{icon:yt.A,edit:()=>{const e=[["core/query",Yt,Kt]],t=(0,l.useBlockProps)();return(0,r.createElement)("div",{...t},(0,r.createElement)(l.InspectorControls,null,(0,r.createElement)(u.Notice,{className:"wc-block-editor-related-products__notice",status:"warning",isDismissible:!1},(0,r.createElement)("p",null,(0,s.__)("These products will vary depending on the main product in the page","woocommerce")))),(0,r.createElement)(l.InnerBlocks,{template:e}))},save:()=>{const e=l.useBlockProps.save();return(0,r.createElement)("div",{...e},(0,r.createElement)(l.InnerBlocks.Content,null))}},isAvailableOnPostEditor:!1});const Zt=(0,r.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)("path",{id:"icon/action/view_list_24px",fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor",d:"M5 5.5H19C19.1326 5.5 19.2598 5.55268 19.3536 5.64645C19.4473 5.74021 19.5 5.86739 19.5 6V7.5C19.5 7.63261 19.4473 7.75979 19.3536 7.85355C19.2598 7.94732 19.1326 8 19 8H5C4.86739 8 4.74021 7.94732 4.64645 7.85355C4.55268 7.75979 4.5 7.63261 4.5 7.5V6C4.5 5.86739 4.55268 5.74021 4.64645 5.64645C4.74021 5.55268 4.86739 5.5 5 5.5V5.5ZM4 9.232C3.69597 9.05647 3.4435 8.804 3.26796 8.49997C3.09243 8.19594 3.00001 7.85106 3 7.5V6C3 5.46957 3.21071 4.96086 3.58579 4.58579C3.96086 4.21071 4.46957 4 5 4H19C19.5304 4 20.0391 4.21071 20.4142 4.58579C20.7893 4.96086 21 5.46957 21 6V7.5C21 7.85106 20.9076 8.19594 20.732 8.49997C20.5565 8.804 20.304 9.05647 20 9.232V18C20 18.5304 19.7893 19.0391 19.4142 19.4142C19.0391 19.7893 18.5304 20 18 20H6C5.46957 20 4.96086 19.7893 4.58579 19.4142C4.21071 19.0391 4 18.5304 4 18V9.232ZM5.5 9.5V18C5.5 18.1326 5.55268 18.2598 5.64645 18.3536C5.74021 18.4473 5.86739 18.5 6 18.5H18C18.1326 18.5 18.2598 18.4473 18.3536 18.3536C18.4473 18.2598 18.5 18.1326 18.5 18V9.5H5.5Z"}),(0,r.createElement)("circle",{cx:"9",cy:"14",r:"1"}),(0,r.createElement)("circle",{cx:"12",cy:"14",r:"1"}),(0,r.createElement)("circle",{cx:"15",cy:"14",r:"1"}));o(4593);const Xt=JSON.parse('{"name":"woocommerce/product-meta","version":"1.0.0","title":"Product Meta","icon":"product","description":"Display a product’s SKU, categories, tags, and more.","category":"woocommerce-product-elements","supports":{"align":true,"reusable":false},"keywords":["WooCommerce"],"usesContext":["postId","postType","queryId"],"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}');be({blockName:Xt.name,blockMetadata:Xt,blockSettings:{edit:()=>{const e=[["core/group",{layout:{type:"flex",flexWrap:"nowrap"}},[["woocommerce/product-sku",{isDescendentOfSingleProductTemplate:ve()}],["core/post-terms",{prefix:(0,s.__)("Category: ","woocommerce"),term:"product_cat"}],["core/post-terms",{prefix:(0,s.__)("Tags: ","woocommerce"),term:"product_tag"}]]]],t=(0,l.useBlockProps)();return(0,r.createElement)("div",{...t},(0,r.createElement)(l.InnerBlocks,{template:e}))},save:()=>{const e=l.useBlockProps.save();return(0,r.createElement)("div",{...e},(0,r.createElement)(l.InnerBlocks.Content,null))},icon:{src:(0,r.createElement)(c.A,{icon:Zt,className:"wc-block-editor-components-block-icon"})},ancestor:["woocommerce/single-product"]},isAvailableOnPostEditor:!0});const eo=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"textdomain":"woocommerce","name":"woocommerce/all-products","title":"All Products","category":"woocommerce","keywords":["WooCommerce"],"description":"Display products from your store in a grid layout.","supports":{"align":["wide","full"],"html":false,"multiple":false},"attributes":{"columns":{"type":"number"},"rows":{"type":"number"},"alignButtons":{"type":"boolean"},"contentVisibility":{"type":"object"},"orderby":{"type":"string"},"layoutConfig":{"type":"array"},"isPreview":{"type":"boolean","default":false}}}'),to=(e,t)=>{const{className:o,contentVisibility:r}=t;return(0,i.A)(e,o,{"has-image":r&&r.image,"has-title":r&&r.title,"has-rating":r&&r.rating,"has-price":r&&r.price,"has-button":r&&r.button})},{attributes:oo}=eo,ro={attributes:Object.assign({},oo,{rows:{type:"number",default:1}}),save({attributes:e}){const t={"data-attributes":JSON.stringify(e)};return(0,r.createElement)("div",{className:to("wc-block-all-products",e),...t},(0,r.createElement)(l.InnerBlocks.Content,null))}},no=[ro],co=window.wc.wcBlocksRegistry;o.p=M.XK,(0,co.registerBlockComponent)({blockName:"woocommerce/product-price",component:(0,g.lazy)((()=>Promise.all([o.e(94),o.e(2388)]).then(o.bind(o,2519))))}),(0,co.registerBlockComponent)({blockName:"woocommerce/product-image",component:(0,g.lazy)((()=>Promise.all([o.e(94),o.e(4232)]).then(o.bind(o,8110))))}),(0,co.registerBlockComponent)({blockName:"woocommerce/product-title",component:(0,g.lazy)((()=>Promise.all([o.e(94),o.e(2105)]).then(o.bind(o,6143))))}),(0,co.registerBlockComponent)({blockName:"woocommerce/product-rating",component:(0,g.lazy)((()=>Promise.all([o.e(94),o.e(462)]).then(o.bind(o,8757))))}),(0,co.registerBlockComponent)({blockName:"woocommerce/product-rating-stars",component:(0,g.lazy)((()=>Promise.all([o.e(94),o.e(8578)]).then(o.bind(o,9549))))}),(0,co.registerBlockComponent)({blockName:"woocommerce/product-rating-counter",component:(0,g.lazy)((()=>Promise.all([o.e(94),o.e(8553)]).then(o.bind(o,8614))))}),(0,co.registerBlockComponent)({blockName:"woocommerce/product-average-rating",component:(0,g.lazy)((()=>Promise.all([o.e(94),o.e(8647)]).then(o.bind(o,1579))))}),(0,co.registerBlockComponent)({blockName:"woocommerce/product-button",component:(0,g.lazy)((()=>Promise.all([o.e(94),o.e(7409)]).then(o.bind(o,4078))))}),(0,co.registerBlockComponent)({blockName:"woocommerce/product-summary",component:(0,g.lazy)((()=>Promise.all([o.e(94),o.e(3895)]).then(o.bind(o,3326))))}),(0,co.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:(0,g.lazy)((()=>Promise.all([o.e(94),o.e(4442)]).then(o.bind(o,6809))))}),(0,co.registerBlockComponent)({blockName:"woocommerce/product-sku",component:(0,g.lazy)((()=>Promise.all([o.e(94),o.e(2724)]).then(o.bind(o,3975))))}),(0,co.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:(0,g.lazy)((()=>Promise.all([o.e(94),o.e(345)]).then(o.bind(o,2686))))});const ao=e=>(0,co.getRegisteredBlockComponents)(e),lo=(e,t,o)=>o?Math.min(e,t)===e?t:Math.max(e,o)===e?o:e:Math.max(e,t)===t?e:t,so=({columns:e,rows:t,setAttributes:o,alignButtons:n,minColumns:c=1,maxColumns:a=6,minRows:l=1,maxRows:i=6})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(u.RangeControl,{label:(0,s.__)("Columns","woocommerce"),value:e,onChange:e=>{const t=lo(e,c,a);o({columns:Number.isNaN(t)?"":t})},min:c,max:a}),(0,r.createElement)(u.RangeControl,{label:(0,s.__)("Rows","woocommerce"),value:t,onChange:e=>{const t=lo(e,l,i);o({rows:Number.isNaN(t)?"":t})},min:l,max:i}),(0,r.createElement)(u.ToggleControl,{label:(0,s.__)("Align the last block to the bottom","woocommerce"),help:n?(0,s.__)("Align the last block to the bottom.","woocommerce"):(0,s.__)("The last inner block will follow other content.","woocommerce"),checked:n,onChange:()=>o({alignButtons:!n})})),io=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:(0,s.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!","woocommerce"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>7.99</span>',images:[{id:1,src:M.sW+"previews/pennant.jpg",thumbnail:M.sW+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,categories:[{id:1,name:"Decor",slug:"decor",link:"https://example.org"}],review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:(0,s.__)("Add to cart","woocommerce"),description:(0,s.__)("Add to cart","woocommerce")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}],mo=[["woocommerce/product-image",{imageSizing:Pe.e.THUMBNAIL}],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],uo=e=>e&&0!==e.length?e.map((e=>{var t,o;return[e.name,{...e.attributes,product:void 0,children:e.innerBlocks.length>0?uo(e.innerBlocks):[],...e.name===Je.name&&{className:(0,i.A)(e.attributes.className,{[`has-custom-width wp-block-button__width-${null===(t=e.attributes)||void 0===t?void 0:t.width}`]:null===(o=e.attributes)||void 0===o?void 0:o.width})},isDescendantOfAllProducts:!0}]})):[];var po=o(458),go=o.n(po),ho=o(4656);o(4156);const wo=({currentPage:e,displayFirstAndLastPages:t=!0,displayNextAndPreviousArrows:o=!0,pagesToDisplay:n=3,onPageChange:c,totalPages:a})=>{let{minIndex:l,maxIndex:m}=((e,t,o)=>{if(o<=2)return{minIndex:null,maxIndex:null};const r=e-1,n=Math.max(Math.floor(t-r/2),2),c=Math.min(Math.ceil(t+(r-(t-n))),o-1);return{minIndex:Math.max(Math.floor(t-(r-(c-t))),2),maxIndex:c}})(n,e,a);const d=t&&Boolean(1!==l),u=t&&Boolean(m!==a),p=t&&Boolean(l&&l>3),g=t&&Boolean(m&&m<a-2);d&&3===l&&(l-=1),u&&m===a-2&&(m+=1);const h=[];if(l&&m)for(let e=l;e<=m;e++)h.push(e);return(0,r.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},(0,r.createElement)(ho.Label,{screenReaderLabel:(0,s.__)("Navigate to another page","woocommerce")}),o&&(0,r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>c(e-1),title:(0,s.__)("Previous page","woocommerce"),disabled:e<=1},(0,r.createElement)(ho.Label,{label:"←",screenReaderLabel:(0,s.__)("Previous page","woocommerce")})),d&&(0,r.createElement)("button",{className:(0,i.A)("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===e,"wc-block-components-pagination__page--active":1===e}),onClick:()=>c(1),disabled:1===e},(0,r.createElement)(ho.Label,{label:"1",screenReaderLabel:(0,s.sprintf)(/* translators: %d is the page number (1, 2, 3...). */ /* translators: %d is the page number (1, 2, 3...). */
(0,s.__)("Page %d","woocommerce"),1)})),p&&(0,r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},(0,s.__)("…","woocommerce")),h.map((t=>(0,r.createElement)("button",{key:t,className:(0,i.A)("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":e===t,"wc-block-components-pagination__page--active":e===t}),onClick:e===t?void 0:()=>c(t),disabled:e===t},(0,r.createElement)(ho.Label,{label:t.toString(),screenReaderLabel:(0,s.sprintf)(/* translators: %d is the page number (1, 2, 3...). */ /* translators: %d is the page number (1, 2, 3...). */
(0,s.__)("Page %d","woocommerce"),t)})))),g&&(0,r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},(0,s.__)("…","woocommerce")),u&&(0,r.createElement)("button",{className:(0,i.A)("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":e===a,"wc-block-components-pagination__page--active":e===a}),onClick:()=>c(a),disabled:e===a},(0,r.createElement)(ho.Label,{label:a.toString(),screenReaderLabel:(0,s.sprintf)(/* translators: %d is the page number (1, 2, 3...). */ /* translators: %d is the page number (1, 2, 3...). */
(0,s.__)("Page %d","woocommerce"),a)})),o&&(0,r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>c(e+1),title:(0,s.__)("Next page","woocommerce"),disabled:e>=a},(0,r.createElement)(ho.Label,{label:"→",screenReaderLabel:(0,s.__)("Next page","woocommerce")})))};function _o(e,t){const o=(0,g.useRef)();return(0,g.useEffect)((()=>{o.current===e||t&&!t(e,o.current)||(o.current=e)}),[e,t]),o.current}var bo=o(7594);function Eo(e){const t=(0,g.useRef)(e);return K()(e,t.current)||(t.current=e),t.current}const yo=(0,g.createContext)("page"),vo=()=>(0,g.useContext)(yo),ko=(yo.Provider,(e,t,o)=>{const r=vo();o=o||r;const n=(0,we.useSelect)((r=>r(bo.QUERY_STATE_STORE_KEY).getValueForQueryKey(o,e,t)),[o,e]),{setQueryValue:c}=(0,we.useDispatch)(bo.QUERY_STATE_STORE_KEY);return[n,(0,g.useCallback)((t=>{c(o,e,t)}),[o,e,c])]}),fo=e=>{const t={namespace:"/wc/store/v1",resourceName:"products"},{results:o,isLoading:r}=(e=>{const{namespace:t,resourceName:o,resourceValues:r=[],query:n={},shouldSelect:c=!0}=e;if(!t||!o)throw new Error("The options object must have valid values for the namespace and the resource properties.");const a=(0,g.useRef)({results:[],isLoading:!0}),l=Eo(n),s=Eo(r),i=(()=>{const[,e]=(0,g.useState)();return(0,g.useCallback)((t=>{e((()=>{throw t}))}),[])})(),m=(0,we.useSelect)((e=>{if(!c)return null;const r=e(bo.COLLECTIONS_STORE_KEY),n=[t,o,l,s],a=r.getCollectionError(...n);if(a){if(!(0,y.isError)(a))throw new Error("TypeError: `error` object is not an instance of Error constructor");i(a)}return{results:r.getCollection(...n),isLoading:!r.hasFinishedResolution("getCollection",n)}}),[t,o,s,l,c,i]);return null!==m&&(a.current=m),a.current})({...t,query:e}),{value:n}=((e,t)=>{const{namespace:o,resourceName:r,resourceValues:n=[],query:c={}}=t;if(!o||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const a=Eo(c),l=Eo(n),{value:s,isLoading:i=!0}=(0,we.useSelect)((t=>{const n=t(bo.COLLECTIONS_STORE_KEY),c=[e,o,r,a,l];return{value:n.getCollectionHeader(...c),isLoading:n.hasFinishedResolution("getCollectionHeader",c)}}),[e,o,r,l,a]);return{value:s,isLoading:i}})("x-wp-total",{...t,query:e});return{products:o,totalProducts:parseInt(n,10),productsLoading:r}};var xo=o(3603);o(3135);const Co=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};var So=o(195),No=o(3588);const Po=()=>{const{parentClassName:e}=(0,le.useInnerBlockLayoutContext)();return(0,r.createElement)("div",{className:`${e}__no-products`},(0,r.createElement)(c.A,{className:`${e}__no-products-image`,icon:No.A,size:100}),(0,r.createElement)("strong",{className:`${e}__no-products-title`},(0,s.__)("No products","woocommerce")),(0,r.createElement)("p",{className:`${e}__no-products-description`},(0,s.__)("There are currently no products available to display.","woocommerce")))};var Ao=o(7850);const To=({resetCallback:e=(()=>{})})=>{const{parentClassName:t}=(0,le.useInnerBlockLayoutContext)();return(0,r.createElement)("div",{className:`${t}__no-products`},(0,r.createElement)(c.A,{className:`${t}__no-products-image`,icon:Ao.A,size:100}),(0,r.createElement)("strong",{className:`${t}__no-products-title`},(0,s.__)("No products found","woocommerce")),(0,r.createElement)("p",{className:`${t}__no-products-description`},(0,s.__)("We were unable to find any results based on your search.","woocommerce")),(0,r.createElement)("button",{onClick:e},(0,s.__)("Reset Search","woocommerce")))};o(7532);const Bo=({onChange:e,value:t})=>(0,r.createElement)(ho.SortSelect,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",onChange:e,options:[{key:"menu_order",label:(0,s.__)("Default sorting","woocommerce")},{key:"popularity",label:(0,s.__)("Popularity","woocommerce")},{key:"rating",label:(0,s.__)("Average rating","woocommerce")},{key:"date",label:(0,s.__)("Latest","woocommerce")},{key:"price",label:(0,s.__)("Price: low to high","woocommerce")},{key:"price-desc",label:(0,s.__)("Price: high to low","woocommerce")}],screenReaderLabel:(0,s.__)("Order products by","woocommerce"),value:t}),Io=(e,t,o,n)=>{if(!o)return;const c=ao(e);return o.map((([o,a={}],l)=>{let s=[];a.children&&a.children.length>0&&(s=Io(e,t,a.children,n));const i=c[o];if(!i)return null;const m=t.id||0,d=["layout",o,l,n,m];return(0,r.createElement)(g.Suspense,{key:d.join("_"),fallback:(0,r.createElement)("div",{className:"wc-block-placeholder"})},(0,r.createElement)(i,{...a,children:s,product:t}))}))},Oo=(0,p.withInstanceId)((({product:e={},attributes:t,instanceId:o})=>{const{layoutConfig:n}=t,{parentClassName:c,parentName:a}=(0,le.useInnerBlockLayoutContext)(),l=0===Object.keys(e).length,s=(0,i.A)(`${c}__product`,"wc-block-layout",{"is-loading":l});return(0,r.createElement)("li",{className:s,"aria-hidden":l},Io(a,e,n,o))}));o(4458);const Lo=e=>{switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}},Do=({totalQuery:e,totalProducts:t},{totalQuery:o}={})=>!go()(e,o)&&Number.isFinite(t),Ro=(e=>t=>{const o=(0,g.useRef)(null);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:o,"aria-hidden":!0}),(0,r.createElement)(e,{...t,scrollToTop:e=>{null!==o.current&&((e,t)=>{const{focusableSelector:o}=t||{};window&&Number.isFinite(window.innerHeight)&&(o?((e,t)=>{var o;const r=(null===(o=e.parentElement)||void 0===o?void 0:o.querySelectorAll(t))||[];if(r.length){const e=r[0];Co(e),null==e||e.focus()}else Co(e)})(e,o):Co(e))})(o.current,e)}}))})((({attributes:e,currentPage:t,onPageChange:o,onSortChange:n,sortValue:c,scrollToTop:a})=>{const[l,m]=ko("attributes",[]),[d,u]=ko("stock_status",[]),[p,h]=ko("rating",[]),[w,_]=ko("min_price"),[b,E]=ko("max_price"),[y]=((e,t)=>{const o=vo();t=t||o;const[r,n]=(e=>{const t=vo();e=e||t;const o=(0,we.useSelect)((t=>t(bo.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0)),[e]),{setValueForQueryContext:r}=(0,we.useDispatch)(bo.QUERY_STATE_STORE_KEY);return[o,(0,g.useCallback)((t=>{r(e,t)}),[e,r])]})(t),c=Eo(r),a=Eo(e),l=_o(a),s=(0,g.useRef)(!1);return(0,g.useEffect)((()=>{K()(l,a)||(n(Object.assign({},c,a)),s.current=!0)}),[c,a,l,n]),s.current?[r,n]:[e,n]})((({sortValue:e,currentPage:t,attributes:o})=>{const{columns:r,rows:n}=o;return{...Lo(e),catalog_visibility:"catalog",per_page:r*n,page:t}})({attributes:e,sortValue:c,currentPage:t})),{products:v,totalProducts:k,productsLoading:f}=fo(y),{parentClassName:x,parentName:C}=(0,le.useInnerBlockLayoutContext)(),S=(e=>{const{order:t,orderby:o,page:r,per_page:n,...c}=e;return c||{}})(y),{dispatchStoreEvent:N}=(0,xo.y)(),P=_o({totalQuery:S,totalProducts:k},Do);(0,g.useEffect)((()=>{N("product-list-render",{products:v,listName:C})}),[v,C,N]),(0,g.useEffect)((()=>{go()(S,null==P?void 0:P.totalQuery)||(o(1),null!=P&&P.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?(0,So.speak)((0,s.__)("No products found","woocommerce")):(0,So.speak)((0,s.sprintf)(/* translators: %s is an integer higher than 0 (1, 2, 3...) */ /* translators: %s is an integer higher than 0 (1, 2, 3...) */
(0,s._n)("%d product found","%d products found",e,"woocommerce"),e)))})(k))}),[null==P?void 0:P.totalQuery,k,o,S]);const{contentVisibility:A}=e,T=e.columns*e.rows,B=!Number.isFinite(k)&&Number.isFinite(null==P?void 0:P.totalProducts)&&go()(S,null==P?void 0:P.totalQuery)?Math.ceil(((null==P?void 0:P.totalProducts)||0)/T):Math.ceil(k/T),I=v.length?v:Array.from({length:T}),O=0!==v.length||f,L=l.length>0||d.length>0||p.length>0||Number.isFinite(w)||Number.isFinite(b);return(0,r.createElement)("div",{className:(()=>{const{columns:t,rows:o,alignButtons:r,align:n}=e,c=void 0!==n?"align"+n:"";return(0,i.A)(x,c,"has-"+t+"-columns",{"has-multiple-rows":o>1,"has-aligned-buttons":r})})()},(null==A?void 0:A.orderBy)&&O&&(0,r.createElement)(Bo,{onChange:n,value:c}),!O&&L&&(0,r.createElement)(To,{resetCallback:()=>{m([]),u([]),h([]),_(null),E(null)}}),!O&&!L&&(0,r.createElement)(Po,null),O&&(0,r.createElement)("ul",{className:(0,i.A)(`${x}__products`,{"is-loading-products":f})},I.map(((t={},o)=>(0,r.createElement)(Oo,{key:t.id||o,attributes:e,product:t})))),B>1&&(0,r.createElement)(wo,{currentPage:t,onPageChange:e=>{a({focusableSelector:"a, button"}),o(e)},totalPages:B}))})),Fo=({attributes:e})=>{const[t,o]=(0,g.useState)(1),[n,c]=(0,g.useState)(e.orderby);return(0,g.useEffect)((()=>{c(e.orderby)}),[e.orderby]),(0,r.createElement)(Ro,{attributes:e,currentPage:t,onPageChange:e=>{o(e)},onSortChange:e=>{var t;const r=null==e||null===(t=e.target)||void 0===t?void 0:t.value;c(r),o(1)},sortValue:n})},Vo=(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},(0,r.createElement)("title",null,"Grid Block Preview"),(0,r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),(0,r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),(0,r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),(0,r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),(0,r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}));class $o extends g.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?Vo:(0,r.createElement)(le.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},(0,r.createElement)(ho.StoreNoticesContainer,{context:"wc/all-products"}),(0,r.createElement)(Fo,{attributes:e,urlParameterSuffix:t}))}}const Mo=$o;o(6965);const zo=ao("woocommerce/all-products"),Ho=(0,r.createElement)(c.A,{icon:a.A}),jo=(0,p.compose)(u.withSpokenMessages,(0,we.withSelect)(((e,{clientId:t})=>{const{getBlock:o}=e("core/block-editor");return{block:o(t)}})),(0,we.withDispatch)((e=>{const{replaceInnerBlocks:t}=e("core/block-editor");return{replaceInnerBlocks:t}})))((({block:e,attributes:t,setAttributes:o,debouncedSpeak:i,replaceInnerBlocks:m})=>{const[d,p]=(0,g.useState)(!1),[h,w]=(0,g.useState)([]),_=(0,l.useBlockProps)({className:to("wc-block-all-products",t)});if(0===M.r7.productCount)return((e,t)=>(0,r.createElement)(u.Placeholder,{className:"wc-block-products",icon:t,label:e},(0,r.createElement)("p",null,(0,s.__)("You haven't published any products to list here yet.","woocommerce")),(0,r.createElement)(u.Button,{className:"wc-block-products__add-product-button",variant:"secondary",href:q.ADMIN_URL+"post-new.php?post_type=product",target:"_top"},(0,s.__)("Add new product","woocommerce")+" ",(0,r.createElement)(c.A,{icon:mt.A})),(0,r.createElement)(u.Button,{className:"wc-block-products__read_more_button",variant:"tertiary",href:"https://woocommerce.com/document/managing-products/",target:"_blank"},(0,s.__)("Learn more","woocommerce"))))(eo.title,(0,r.createElement)(c.A,{icon:a.A}));const b=()=>{p(!d),d||i((0,s.__)("Showing All Products block preview.","woocommerce"))};return(0,r.createElement)("div",{..._},(0,r.createElement)(l.BlockControls,null,(0,r.createElement)(u.ToolbarGroup,{controls:[{icon:"edit",title:(0,s.__)("Edit the layout of each product","woocommerce"),onClick:()=>b(),isActive:d}]})),(()=>{const{columns:e,rows:n,alignButtons:c}=t;return(0,r.createElement)(l.InspectorControls,{key:"inspector"},(0,r.createElement)(u.PanelBody,{title:(0,s.__)("Layout Settings","woocommerce"),initialOpen:!0},(0,r.createElement)(so,{columns:e,rows:n,alignButtons:c,setAttributes:o,minColumns:(0,q.getSetting)("minColumns",1),maxColumns:(0,q.getSetting)("maxColumns",6),minRows:(0,q.getSetting)("minRows",1),maxRows:(0,q.getSetting)("maxRows",6)})),(0,r.createElement)(u.PanelBody,{title:(0,s.__)("Content Settings","woocommerce")},((e,t)=>{const{contentVisibility:o}=e;return(0,r.createElement)(u.ToggleControl,{label:(0,s.__)("Show Sorting Dropdown","woocommerce"),checked:o.orderBy,onChange:()=>t({contentVisibility:{...o,orderBy:!o.orderBy}})})})(t,o),((e,t)=>(0,r.createElement)(u.SelectControl,{label:(0,s.__)("Order Products By","woocommerce"),value:e.orderby,options:[{label:(0,s.__)("Default sorting (menu order)","woocommerce"),value:"menu_order"},{label:(0,s.__)("Popularity","woocommerce"),value:"popularity"},{label:(0,s.__)("Average rating","woocommerce"),value:"rating"},{label:(0,s.__)("Latest","woocommerce"),value:"date"},{label:(0,s.__)("Price: low to high","woocommerce"),value:"price"},{label:(0,s.__)("Price: high to low","woocommerce"),value:"price-desc"}],onChange:e=>t({orderby:e})}))(t,o)))})(),d?(()=>{const c={template:t.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(zo)};return 0!==t.layoutConfig.length&&(c.renderAppender=!1),(0,r.createElement)(u.Placeholder,{icon:Ho,label:eo.title},(0,s.__)("Display all products from your store as a grid.","woocommerce"),(0,r.createElement)("div",{className:"wc-block-all-products-grid-item-template"},(0,r.createElement)(u.Tip,null,(0,s.__)("Edit the blocks inside the example below to change the content displayed for all products within the product grid.","woocommerce")),(0,r.createElement)(le.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},(0,r.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},(0,r.createElement)("ul",{className:"wc-block-grid__products"},(0,r.createElement)("li",{className:"wc-block-grid__product"},(0,r.createElement)(le.ProductDataContextProvider,{product:io[0]},(0,r.createElement)(l.InnerBlocks,{...c})))))),(0,r.createElement)("div",{className:"wc-block-all-products__actions"},(0,r.createElement)(u.Button,{className:"wc-block-all-products__done-button",variant:"primary",onClick:()=>{o({layoutConfig:uo(e.innerBlocks)}),w(e.innerBlocks),b()}},(0,s.__)("Done","woocommerce")),(0,r.createElement)(u.Button,{className:"wc-block-all-products__cancel-button",variant:"tertiary",onClick:()=>{m(e.clientId,h,!1),b()}},(0,s.__)("Cancel","woocommerce")),(0,r.createElement)(u.Button,{className:"wc-block-all-products__reset-button",icon:Ho,label:(0,s.__)("Reset layout to default","woocommerce"),onClick:()=>{const t=[];mo.map((([e,o])=>(t.push((0,n.createBlock)(e,o)),!0))),m(e.clientId,t,!1),w(e.innerBlocks)}},(0,s.__)("Reset Layout","woocommerce")))))})():(()=>{const{layoutConfig:e}=t,o=e&&0!==e.length,n=eo.title;return o?(0,r.createElement)(u.Disabled,null,(0,r.createElement)(Mo,{attributes:t})):((e,t)=>(0,r.createElement)(u.Placeholder,{className:"wc-block-products",icon:t,label:e},(0,s.__)("The content for this block is hidden due to block settings.","woocommerce")))(n,Ho)})())})),qo={columns:(0,q.getSetting)("defaultColumns",3),rows:(0,q.getSetting)("defaultRows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:mo,isPreview:!1},{name:Wo}=eo,Go={icon:{src:(0,r.createElement)(c.A,{icon:a.A,className:"wc-block-editor-components-block-icon"})},edit:jo,save:function({attributes:e}){const t={};Object.keys(e).sort().forEach((o=>{t[o]=e[o]}));const o=l.useBlockProps.save({className:to("wc-block-all-products",e),"data-attributes":JSON.stringify(t)});return(0,r.createElement)("div",{...o},(0,r.createElement)(l.InnerBlocks.Content,null))},deprecated:no,defaults:qo};(0,n.registerBlockType)(Wo,Go)},2442:(e,t,o)=>{"use strict";o.d(t,{Nm:()=>s,fb:()=>p,p3:()=>l});var r=o(1609),n=o(7723),c=o(851),a=o(3993);const l=e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0},s=e=>{const t=(0,a.isNumber)(e.review_count)?e.review_count:parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0},i=e=>({width:e/5*100+"%"}),m=({className:e,parentClassName:t})=>{const o=i(0);return(0,r.createElement)("div",{className:(0,c.A)(`${e}__norating-container`,`${t}-product-rating__norating-container`)},(0,r.createElement)("div",{className:`${e}__norating`,role:"img"},(0,r.createElement)("span",{style:o})),(0,r.createElement)("span",null,(0,n.__)("No Reviews","woocommerce")))},d=e=>{const{className:t,rating:o,reviews:a,parentClassName:l}=e,s=i(o),m=(0,n.sprintf)(/* translators: %f is referring to the average rating value */ /* translators: %f is referring to the average rating value */
(0,n.__)("Rated %f out of 5","woocommerce"),o),d={__html:(0,n.sprintf)(/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */ /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
(0,n._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",a,"woocommerce"),(0,n.sprintf)('<strong class="rating">%f</strong>',o),(0,n.sprintf)('<span class="rating">%d</span>',a))};return(0,r.createElement)("div",{className:(0,c.A)(`${t}__stars`,`${l}__product-rating__stars`),role:"img","aria-label":m},(0,r.createElement)("span",{style:s,dangerouslySetInnerHTML:d}))},u=e=>{const{className:t,reviews:o}=e,c=(0,n.sprintf)(/* translators: %s is referring to the total of reviews for a product */ /* translators: %s is referring to the total of reviews for a product */
(0,n._n)("(%s customer review)","(%s customer reviews)",o,"woocommerce"),o);return(0,r.createElement)("span",{className:`${t}__reviews_count`},c)},p=e=>{const{className:t="wc-block-components-product-rating",showReviewCount:o,showMockedReviews:n,parentClassName:a="",rating:l,reviews:s,styleProps:i,textAlign:p}=e,g=(0,c.A)(i.className,t,{[`${a}__product-rating`]:a,[`has-text-align-${p}`]:p}),h=n&&(0,r.createElement)(m,{className:t,parentClassName:a}),w=s?(0,r.createElement)(d,{className:t,rating:l,reviews:s,parentClassName:a}):h,_=s&&o;return(0,r.createElement)("div",{className:g,style:i.style},(0,r.createElement)("div",{className:`${t}__container`},w,_?(0,r.createElement)(u,{className:t,reviews:s}):null))}},5849:(e,t,o)=>{"use strict";o.d(t,{Hw:()=>k,Vo:()=>_,XK:()=>w,iI:()=>y,r7:()=>g,sW:()=>h});var r,n,c,a,l,s,i,m,d,u,p=o(5703);const g=(0,p.getSetting)("wcBlocksConfig",{pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),h=g.pluginUrl+"assets/images/",w=g.pluginUrl+"assets/client/blocks/",_=(null===(r=p.STORE_PAGES.shop)||void 0===r||r.permalink,null===(n=p.STORE_PAGES.checkout)||void 0===n||n.id,null===(c=p.STORE_PAGES.checkout)||void 0===c||c.permalink,null===(a=p.STORE_PAGES.privacy)||void 0===a||a.permalink,null===(l=p.STORE_PAGES.privacy)||void 0===l||l.title,null===(s=p.STORE_PAGES.terms)||void 0===s||s.permalink,null===(i=p.STORE_PAGES.terms)||void 0===i||i.title,null===(m=p.STORE_PAGES.cart)||void 0===m||m.id,null===(d=p.STORE_PAGES.cart)||void 0===d?void 0:d.permalink),b=(null!==(u=p.STORE_PAGES.myaccount)&&void 0!==u&&u.permalink?p.STORE_PAGES.myaccount.permalink:(0,p.getSetting)("wpLoginUrl","/wp-login.php"),(0,p.getSetting)("localPickupEnabled",!1),(0,p.getSetting)("countries",{})),E=(0,p.getSetting)("countryData",{}),y=(Object.fromEntries(Object.keys(E).filter((e=>!0===E[e].allowBilling)).map((e=>[e,b[e]||""]))),Object.fromEntries(Object.keys(E).filter((e=>!0===E[e].allowBilling)).map((e=>[e,E[e].states||[]]))),Object.fromEntries(Object.keys(E).filter((e=>!0===E[e].allowShipping)).map((e=>[e,b[e]||""]))),Object.fromEntries(Object.keys(E).filter((e=>!0===E[e].allowShipping)).map((e=>[e,E[e].states||[]]))),Object.fromEntries(Object.keys(E).map((e=>[e,E[e].locale||[]])))),v={address:["first_name","last_name","company","address_1","address_2","city","postcode","country","state","phone"],contact:["email"],order:[]},k=(0,p.getSetting)("addressFieldsLocations",v).address;(0,p.getSetting)("addressFieldsLocations",v).contact,(0,p.getSetting)("addressFieldsLocations",v).order,(0,p.getSetting)("additionalOrderFields",{}),(0,p.getSetting)("additionalContactFields",{}),(0,p.getSetting)("additionalAddressFields",{})},812:(e,t,o)=>{"use strict";o.d(t,{Hw:()=>r.Hw,Vo:()=>r.Vo,XK:()=>r.XK,iI:()=>r.iI,r7:()=>r.r7,sW:()=>r.sW});var r=o(5849)},3527:()=>{},5195:()=>{},1546:()=>{},5183:()=>{},6160:()=>{},3778:()=>{},3400:()=>{},618:()=>{},4593:()=>{},445:()=>{},7195:()=>{},3047:()=>{},7067:()=>{},9278:()=>{},6007:()=>{},7947:()=>{},1563:()=>{},7663:()=>{},9644:()=>{},7764:()=>{},7766:()=>{},6342:()=>{},7128:()=>{},4156:()=>{},7532:()=>{},4458:()=>{},6625:()=>{},4567:()=>{},6455:()=>{},3135:()=>{},6965:()=>{},7369:()=>{},8137:()=>{},6636:()=>{},4738:()=>{},1609:e=>{"use strict";e.exports=window.React},4656:e=>{"use strict";e.exports=window.wc.blocksComponents},8529:e=>{"use strict";e.exports=window.wc.priceFormat},7594:e=>{"use strict";e.exports=window.wc.wcBlocksData},2796:e=>{"use strict";e.exports=window.wc.wcBlocksSharedContext},1616:e=>{"use strict";e.exports=window.wc.wcBlocksSharedHocs},5703:e=>{"use strict";e.exports=window.wc.wcSettings},3993:e=>{"use strict";e.exports=window.wc.wcTypes},195:e=>{"use strict";e.exports=window.wp.a11y},6004:e=>{"use strict";e.exports=window.wp.autop},4715:e=>{"use strict";e.exports=window.wp.blockEditor},6427:e=>{"use strict";e.exports=window.wp.components},9491:e=>{"use strict";e.exports=window.wp.compose},7143:e=>{"use strict";e.exports=window.wp.data},6087:e=>{"use strict";e.exports=window.wp.element},2619:e=>{"use strict";e.exports=window.wp.hooks},8537:e=>{"use strict";e.exports=window.wp.htmlEntities},7723:e=>{"use strict";e.exports=window.wp.i18n},923:e=>{"use strict";e.exports=window.wp.isShallowEqual},5573:e=>{"use strict";e.exports=window.wp.primitives},9786:e=>{"use strict";e.exports=window.wp.styleEngine},3832:e=>{"use strict";e.exports=window.wp.url},9446:e=>{"use strict";e.exports=window.wp.wordcount},7746:e=>{"use strict";e.exports=JSON.parse('{"name":"woocommerce/product-image","version":"1.0.0","title":"Product Image","description":"Display the main product image.","category":"woocommerce-product-elements","attributes":{"showProductLink":{"type":"boolean","default":true},"showSaleBadge":{"type":"boolean","default":true},"saleBadgeAlign":{"type":"string","default":"right"},"imageSizing":{"type":"string","default":"single"},"productId":{"type":"number","default":0},"isDescendentOfQueryLoop":{"type":"boolean","default":false},"isDescendentOfSingleProductBlock":{"type":"boolean","default":false},"width":{"type":"string"},"height":{"type":"string"},"scale":{"type":"string","default":"cover"},"aspectRatio":{"type":"string"}},"usesContext":["query","queryId","postId"],"keywords":["WooCommerce"],"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}')}},a={};function l(e){var t=a[e];if(void 0!==t)return t.exports;var o=a[e]={exports:{}};return c[e].call(o.exports,o,o.exports,l),o.exports}l.m=c,e=[],l.O=(t,o,r,n)=>{if(!o){var c=1/0;for(m=0;m<e.length;m++){for(var[o,r,n]=e[m],a=!0,s=0;s<o.length;s++)(!1&n||c>=n)&&Object.keys(l.O).every((e=>l.O[e](o[s])))?o.splice(s--,1):(a=!1,n<c&&(c=n));if(a){e.splice(m--,1);var i=r();void 0!==i&&(t=i)}}return t}n=n||0;for(var m=e.length;m>0&&e[m-1][2]>n;m--)e[m]=e[m-1];e[m]=[o,r,n]},l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},o=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var n=Object.create(null);l.r(n);var c={};t=t||[null,o({}),o([]),o(o)];for(var a=2&r&&e;"object"==typeof a&&!~t.indexOf(a);a=o(a))Object.getOwnPropertyNames(a).forEach((t=>c[t]=()=>e[t]));return c.default=()=>e,l.d(n,c),n},l.d=(e,t)=>{for(var o in t)l.o(t,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce(((t,o)=>(l.f[o](e,t),t)),[])),l.u=e=>({345:"product-stock-indicator",462:"product-rating",2105:"product-title",2388:"product-price",2724:"product-sku",3895:"product-summary",4232:"product-image",4442:"product-sale-badge",7409:"product-button",8553:"product-rating-counter",8578:"product-rating-stars",8647:"product-average-rating"}[e]+".js?ver="+{345:"04dd5b43a062901677a7",462:"9dde369b1ecc4f2077e0",2105:"5e3f092650cc17da80e1",2388:"121e06120cae715f8c8a",2724:"193fc375d48bf00e6a00",3895:"8fd3f96f6537d4322f3a",4232:"4855cd4728350cdd469a",4442:"172de6d4fa1e3f0ae688",7409:"5badfa04f11f0445ed79",8553:"e53e509865571259b2f8",8578:"05e5244e63c63a44498d",8647:"56ef084f4de0d33860d6"}[e]),l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},n="webpackWcBlocksMainJsonp:",l.l=(e,t,o,c)=>{if(r[e])r[e].push(t);else{var a,s;if(void 0!==o)for(var i=document.getElementsByTagName("script"),m=0;m<i.length;m++){var d=i[m];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==n+o){a=d;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,l.nc&&a.setAttribute("nonce",l.nc),a.setAttribute("data-webpack",n+o),a.src=e),r[e]=[t];var u=(t,o)=>{a.onerror=a.onload=null,clearTimeout(p);var n=r[e];if(delete r[e],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=u.bind(null,a.onerror),a.onload=u.bind(null,a.onload),s&&document.head.appendChild(a)}},l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.j=1001,(()=>{var e;l.g.importScripts&&(e=l.g.location+"");var t=l.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var r=o.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=o[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),l.p=e})(),(()=>{var e={1001:0,2388:0,462:0,8578:0,8553:0,8647:0,7409:0,3895:0,4442:0,2724:0,345:0};l.f.j=(t,o)=>{var r=l.o(e,t)?e[t]:void 0;if(0!==r)if(r)o.push(r[2]);else{var n=new Promise(((o,n)=>r=e[t]=[o,n]));o.push(r[2]=n);var c=l.p+l.u(t),a=new Error;l.l(c,(o=>{if(l.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var n=o&&("load"===o.type?"missing":o.type),c=o&&o.target&&o.target.src;a.message="Loading chunk "+t+" failed.\n("+n+": "+c+")",a.name="ChunkLoadError",a.type=n,a.request=c,r[1](a)}}),"chunk-"+t,t)}},l.O.j=t=>0===e[t];var t=(t,o)=>{var r,n,[c,a,s]=o,i=0;if(c.some((t=>0!==e[t]))){for(r in a)l.o(a,r)&&(l.m[r]=a[r]);if(s)var m=s(l)}for(t&&t(o);i<c.length;i++)n=c[i],l.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return l.O(m)},o=self.webpackChunkwebpackWcBlocksMainJsonp=self.webpackChunkwebpackWcBlocksMainJsonp||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var s=l.O(void 0,[94],(()=>l(807)));s=l.O(s),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["all-products"]=s})();

Zerion Mini Shell 1.0