this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["featured-product"]=function(o){function i(i){for(var A,r,n=i[0],f=i[1],a=i[2],c=0,C=[];c$&")}var G=function(){var o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return o?Object(n.createElement)(J,null):Object(n.createElement)(W,null)},E={list:Object(f.__)("Products",'woocommerce'),noItems:Object(f.__)("Your store doesn't have any products.",'woocommerce'),search:Object(f.__)("Search for a product to display",'woocommerce'),updated:Object(f.__)("Product search results updated.",'woocommerce')},V=function(o){var i=o.expandedProduct,K=o.error,A=o.isLoading,e=o.onChange,C=o.onSearch,u=o.products,w=o.renderItem,v=o.selected,l=o.showVariations,P=o.variations,b=o.variationsLoading,d=function(o){var K=o.item,A=o.search,t=o.depth,e=void 0===t?0:t,C=o.isSelected,u=o.onSelect,w=K.variations&&Array.isArray(K.variations)?K.variations.length:0,v=s()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(e),{"is-searching":A.length>0,"is-skip-level":0===e&&0!==K.parent,"is-variable":w>0}),l=Object.assign({},o);delete l.isSingle;var P={role:"menuitemradio"};return K.breadcrumbs.length&&(P["aria-label"]="".concat(K.breadcrumbs[0],": ").concat(K.name)),w&&(P["aria-expanded"]=K.id===i),K.breadcrumbs.length?(Object(a.isEmpty)(K.variation)||(K.name=K.variation),Object(n.createElement)(g.b,r()({className:v},o,P))):[Object(n.createElement)(c.MenuItem,r()({key:"product-".concat(K.id),isSelected:C},l,P,{className:v,onClick:function(){u(K)()}}),Object(n.createElement)("span",{className:"woocommerce-search-list__item-state"},G(C)),Object(n.createElement)("span",{className:"woocommerce-search-list__item-label"},Object(n.createElement)("span",{className:"woocommerce-search-list__item-name",dangerouslySetInnerHTML:{__html:z(K.name,A)}})),w?Object(n.createElement)("span",{className:"woocommerce-search-list__item-variation-count"},Object(f.sprintf)(Object(f._n)("%d variation","%d variations",w,'woocommerce'),w)):null),i===K.id&&w>0&&b&&Object(n.createElement)("div",{key:"loading",className:"woocommerce-search-list__item woocommerce-search-product__itemdepth-1 is-loading is-not-active"},Object(n.createElement)(c.Spinner,null))]};if(K)return Object(n.createElement)(Z.a,{error:K});var p=P&&P[i]?P[i]:[],j=[].concat(t()(u),t()(p));return Object(n.createElement)(g.a,{className:"woocommerce-products",list:j,isLoading:A,isSingle:!0,selected:j.filter((function(o){var i=o.id;return v.includes(i)})),onChange:e,renderItem:w||(l?d:null),onSearch:C,messages:E,isHierarchical:!0})};V.defaultProps={expandedProduct:null,selected:[],showVariations:!1};i.a=H(Object(x.a)(T(V)))},18:function(o,i,K){"use strict";K.d(i,"e",(function(){return t})),K.d(i,"r",(function(){return e})),K.d(i,"k",(function(){return r})),K.d(i,"m",(function(){return n})),K.d(i,"b",(function(){return f})),K.d(i,"l",(function(){return a})),K.d(i,"o",(function(){return g})),K.d(i,"d",(function(){return c})),K.d(i,"n",(function(){return C})),K.d(i,"c",(function(){return s})),K.d(i,"p",(function(){return u})),K.d(i,"i",(function(){return w})),K.d(i,"j",(function(){return v})),K.d(i,"f",(function(){return l})),K.d(i,"g",(function(){return P})),K.d(i,"h",(function(){return b})),K.d(i,"q",(function(){return d})),K.d(i,"a",(function(){return p})),K.d(i,"s",(function(){return j}));var A=K(4),t=Object(A.getSetting)("enableReviewRating",!0),e=Object(A.getSetting)("showAvatars",!0),r=Object(A.getSetting)("max_columns",6),n=Object(A.getSetting)("min_columns",1),f=Object(A.getSetting)("default_columns",3),a=Object(A.getSetting)("max_rows",6),g=Object(A.getSetting)("min_rows",1),c=Object(A.getSetting)("default_rows",2),C=Object(A.getSetting)("min_height",500),s=Object(A.getSetting)("default_height",500),u=Object(A.getSetting)("placeholderImgSrc",""),w=(Object(A.getSetting)("thumbnail_size",300),Object(A.getSetting)("isLargeCatalog")),v=Object(A.getSetting)("limitTags"),l=Object(A.getSetting)("hasProducts",!0),P=Object(A.getSetting)("hasTags",!0),b=Object(A.getSetting)("homeUrl",""),d=Object(A.getSetting)("productCount",0),p=Object(A.getSetting)("attributes",[]),j=Object(A.getSetting)("wcBlocksAssetUrl","")},19:function(o,i){!function(){o.exports=this.regeneratorRuntime}()},20:function(o,i){!function(){o.exports=this.moment}()},21:function(o,i){!function(){o.exports=this.wp.compose}()},22:function(o,i){!function(){o.exports=this.wp.editor}()},23:function(o,i){!function(){o.exports=this.wp.blocks}()},27:function(o,i){!function(){o.exports=this.wp.escapeHtml}()},28:function(o,i,K){"use strict";K.d(i,"a",(function(){return e}));var A=K(19),t=K.n(A),e=function(o){var i;return t.a.async((function(K){for(;;)switch(K.prev=K.next){case 0:if("function"!=typeof o.json){K.next=11;break}return K.prev=1,K.next=4,t.a.awrap(o.json());case 4:return i=K.sent,K.abrupt("return",{message:i.message,type:i.type||"api"});case 8:return K.prev=8,K.t0=K.catch(1),K.abrupt("return",{message:K.t0.message,type:"general"});case 11:return K.abrupt("return",{message:o.message,type:o.type||"general"});case 12:case"end":return K.stop()}}),null,null,[[1,8]])}},29:function(o,i,K){"use strict";var A=K(7),t=K.n(A),e=K(9),r=K(8),n=K.n(r),f=K(5),a=K(18),g={root:"/wc/blocks",products:"".concat("/wc/blocks","/products"),categories:"".concat("/wc/blocks","/products/categories")};function c(o,i){var K=Object.keys(o);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(o);i&&(A=A.filter((function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),K.push.apply(K,A)}return K}function C(o){for(var i=1;i$7.99',images:[{id:1,src:t,thumbnail:t,name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,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:Object(A.__)("Add to cart",'woocommerce'),description:Object(A.__)("Add to cart",'woocommerce')},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},600:function(o,i,K){"use strict";var A=K(11),t=K.n(A),e=K(19),r=K.n(e),n=K(13),f=K.n(n),a=K(17),g=K.n(a),c=K(14),C=K.n(c),s=K(15),u=K.n(s),w=K(12),v=K.n(w),l=K(16),P=K.n(l),b=K(7),d=K.n(b),p=K(0),j=K(21),F=K(29),X=K(28),H=Object(j.createHigherOrderComponent)((function(o){return function(i){function K(){var o,i;f()(this,K);for(var A=arguments.length,t=new Array(A),e=0;e0&&void 0!==arguments[0]?arguments[0]:[],i=o[0]?o[0].id:0;F({productId:i,mediaId:0,mediaSrc:""})}}),Object(A.createElement)(g.Button,{isDefault:!0,onClick:function(){F({editMode:!1}),c(Object(t.__)("Showing Featured Product block preview.",'woocommerce'))}},Object(t.__)("Done",'woocommerce'))))):Object(A.createElement)(A.Fragment,null,H(),(i=a.mediaSrc||P(j),K=a.focalPoint,r=void 0===K?{x:.5,y:.5}:K,f="function"==typeof g.FocalPointPicker,Object(A.createElement)(e.InspectorControls,{key:"inspector"},Object(A.createElement)(g.PanelBody,{title:Object(t.__)("Content",'woocommerce')},Object(A.createElement)(g.ToggleControl,{label:Object(t.__)("Show description",'woocommerce'),checked:a.showDesc,onChange:function(){return F({showDesc:!a.showDesc})}}),Object(A.createElement)(g.ToggleControl,{label:Object(t.__)("Show price",'woocommerce'),checked:a.showPrice,onChange:function(){return F({showPrice:!a.showPrice})}})),Object(A.createElement)(e.PanelColorSettings,{title:Object(t.__)("Overlay",'woocommerce'),colorSettings:[{value:p.color,onChange:X,label:Object(t.__)("Overlay Color",'woocommerce')}]},!!i&&Object(A.createElement)(A.Fragment,null,Object(A.createElement)(g.RangeControl,{label:Object(t.__)("Background Opacity",'woocommerce'),value:a.dimRatio,onChange:function(o){return F({dimRatio:o})},min:0,max:100,step:10}),f&&Object(A.createElement)(g.FocalPointPicker,{label:Object(t.__)("Focal Point Picker"),url:i,value:r,onChange:function(o){return F({focalPoint:o})}}))))),j?function(){var o,i,K=a.className,t=a.contentAlign,e=a.dimRatio,r=a.focalPoint,f=a.height,c=a.showDesc,s=a.showPrice,w=C()("wc-block-featured-product",{"is-selected":d&&"preview"!==a.productId,"is-loading":!j&&b,"is-not-found":!j&&!b,"has-background-dim":0!==e},0===(o=e)||50===o?null:"has-background-dim-".concat(10*Math.round(o/10)),"center"!==t&&"has-".concat(t,"-content"),K),v=(i=a.mediaSrc||j,Object(u.isObject)(i)&&(i=P(i)),i?{backgroundImage:"url(".concat(i,")")}:{});if(p.color&&(v.backgroundColor=p.color),r){var l=100*r.x,X=100*r.y;v.backgroundPosition="".concat(l,"% ").concat(X,"%")}return Object(A.createElement)(g.ResizableBox,{className:w,size:{height:f},minHeight:n.n,enable:{bottom:!0},onResizeStop:function(o,i,K){F({height:parseInt(K.style.height)})},style:v},Object(A.createElement)("div",{className:"wc-block-featured-product__wrapper"},Object(A.createElement)("h2",{className:"wc-block-featured-product__title",dangerouslySetInnerHTML:{__html:j.name}}),!Object(u.isEmpty)(j.variation)&&Object(A.createElement)("h3",{className:"wc-block-featured-product__variation",dangerouslySetInnerHTML:{__html:j.variation}}),c&&Object(A.createElement)("div",{className:"wc-block-featured-product__description",dangerouslySetInnerHTML:{__html:j.description}}),s&&Object(A.createElement)("div",{className:"wc-block-featured-product__price",dangerouslySetInnerHTML:{__html:j.price_html}}),Object(A.createElement)("div",{className:"wc-block-featured-product__link"},x())))}():Object(A.createElement)(g.Placeholder,{className:"wc-block-featured-product",icon:"star-filled",label:Object(t.__)("Featured Product",'woocommerce')},b?Object(A.createElement)(g.Spinner,null):Object(t.__)("No product is selected.",'woocommerce')))}));Object(r.registerBlockType)("woocommerce/featured-product",{title:Object(t.__)("Featured Product",'woocommerce'),icon:{src:"star-filled",foreground:"#96588a"},category:"woocommerce",keywords:[Object(t.__)("WooCommerce",'woocommerce')],description:Object(t.__)("Visually highlight a product or variation and encourage prompt action.",'woocommerce'),supports:{align:["wide","full"],html:!1},example:a,attributes:{contentAlign:{type:"string",default:"center"},dimRatio:{type:"number",default:50},editMode:{type:"boolean",default:!0},focalPoint:{type:"object"},height:{type:"number",default:n.c},mediaId:{type:"number",default:0},mediaSrc:{type:"string",default:""},overlayColor:{type:"string"},customOverlayColor:{type:"string"},linkText:{type:"string",default:Object(t.__)("Shop now",'woocommerce')},productId:{type:"number"},showDesc:{type:"boolean",default:!0},showPrice:{type:"boolean",default:!0},previewProduct:{type:"object",default:null}},edit:function(o){return Object(A.createElement)(b,o)},save:function(){return Object(A.createElement)(e.InnerBlocks.Content,null)}})},65:function(o,i){!function(){o.exports=this.wp.date}()},66:function(o,i,K){"use strict";var A=K(0),t=K(1),e=(K(2),K(26)),r=K.n(e),n=K(6),f=K.n(n),a=K(3),g=K(31);K(135);i.a=function(o){var i=o.className,K=o.error,e=o.isLoading,n=o.onRetry;return Object(A.createElement)(a.Placeholder,{icon:Object(A.createElement)(r.a,{icon:"notice"}),label:Object(t.__)("Sorry, an error occurred",'woocommerce'),className:f()("wc-block-api-error",i)},Object(A.createElement)(g.a,{error:K}),n&&Object(A.createElement)(A.Fragment,null,e?Object(A.createElement)(a.Spinner,null):Object(A.createElement)(a.Button,{isDefault:!0,onClick:n},Object(t.__)("Retry",'woocommerce'))))}},68:function(o,i){!function(){o.exports=this.wp.dom}()},72:function(o,i){},75:function(o,i){},76:function(o,i){},77:function(o,i){},78:function(o,i){},8:function(o,i){!function(){o.exports=this.wp.apiFetch}()},9:function(o,i){!function(){o.exports=this.wp.url}()}});