text: this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["reviews-by-product"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],l=t[2],d=0,b=[];d<i.length;d++)a=i[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&b.push(o[a][0]),o[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);b.length;)b.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={23:0},c=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var u=s;return c.push([650,2,1,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.React}()},100:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},101:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0),a=(r(99),r(49));t.a=function(e){var t=e.attributes,r=t.categoryIds,n=t.imageType,i=t.orderby,s=t.productId,l={"data-image-type":n,"data-orderby":i,"data-reviews-on-page-load":t.reviewsOnPageLoad,"data-reviews-on-load-more":t.reviewsOnLoadMore,"data-show-load-more":t.showLoadMore,"data-show-orderby":t.showOrderby},u="wc-block-all-reviews";return s&&(l["data-product-id"]=s,u="wc-block-reviews-by-product"),Array.isArray(r)&&(l["data-category-ids"]=r.join(","),u="wc-block-reviews-by-category"),Object(c.createElement)("div",o()({className:Object(a.a)(u,t)},l))}},103:function(e,t,r){"use strict";var n=r(13),o=r.n(n),c=r(17),a=r.n(c),i=r(14),s=r.n(i),l=r(15),u=r.n(l),d=r(16),b=r.n(d),p=r(0),g=r(1),w=r(10),h=(r(2),r(5)),v=r(3),m=r(18),f=r(66),O=r(54),j=(r(213),function(e){var t=e.onClick,r=e.label,n=e.screenReaderLabel;return Object(p.createElement)("div",{className:"wp-block-button wc-block-load-more"},Object(p.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(p.createElement)(O.a,{label:r,screenReaderLabel:n})))});j.defaultProps={label:Object(g.__)("Load more",'woocommerce')};var y=j,_=r(7),k=r.n(_),E=r(6),R=r.n(E),A=r(12),P=r.n(A),S=r(120),C=r.n(S),B=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=C()(e,{suffix:r,limit:t});return n.html},N=function(e,t,r,n){var o=x(e,t,r);return B(e,o-n.length,n)},x=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=B(e,n.middle),n=L(n,t.clientHeight,r);return n.middle},L=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e},I=function(e){function t(e){var r;return o()(this,t),(r=s()(this,u()(t).apply(this,arguments))).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},r.reviewSummary=Object(w.createRef)(),r.reviewContent=Object(w.createRef)(),r.getButton=r.getButton.bind(P()(r)),r.onClick=r.onClick.bind(P()(r)),r}return b()(t,e),a()(t,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:N(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,c=e?n:o;if(c)return Object(p.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,c=t.isExpanded;return r?!1===o?Object(p.createElement)("div",{className:e},Object(p.createElement)("div",{ref:this.reviewContent},r)):Object(p.createElement)("div",{className:e},(!c||null===o)&&Object(p.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:n}}),(c||null===o)&&Object(p.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},r),this.getButton()):null}}]),t}(w.Component);I.defaultProps={maxLines:3,ellipsis:"&hellip;",moreText:Object(g.__)("Read more",'woocommerce'),lessText:Object(g.__)("Read less",'woocommerce'),className:"read-more-content"};var D=I;r(212);var T=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,c=t.showReviewDate,a=t.showReviewerName,i=t.showReviewImage,s=t.showReviewRating,l=t.showReviewContent,u=t.showProductName,d=n.rating,b=!Object.keys(n).length>0,w=Number.isFinite(d)&&s;return Object(p.createElement)("li",{className:R()("wc-block-review-list-item__item",{"is-loading":b}),"aria-hidden":b},(u||c||a||i||w)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__info"},i&&function(e,t,r){return r||!e?Object(p.createElement)("div",{className:"wc-block-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("div",{className:"wc-block-review-list-item__image"},"product"===t?Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.product_picture||"",className:"wc-block-review-list-item__image",width:"48",height:"48"}):Object(p.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[48]||"",srcSet:e.reviewer_avatar_urls[96]+" 2x",className:"wc-block-review-list-item__image",width:"48",height:"48"}),e.verified&&Object(p.createElement)("div",{className:"wc-block-review-list-item__verified",title:Object(g.__)("Verified buyer",'woocommerce')},Object(g.__)("Verified buyer",'woocommerce')))}(n,o,b),(u||a||w||c)&&Object(p.createElement)("div",{className:"wc-block-review-list-item__meta"},w&&function(e){var t=e.rating,r={width:t/5*100+"%"};return Object(p.createElement)("div",{className:"wc-block-review-list-item__rating"},Object(p.createElement)("div",{className:"wc-block-review-list-item__rating__stars",role:"img"},Object(p.createElement)("span",{style:r},Object(g.sprintf)(Object(g.__)("Rated %d out of 5",'woocommerce'),t))))}(n),u&&function(e){return Object(p.createElement)("div",{className:"wc-block-review-list-item__product"},Object(p.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),a&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(p.createElement)("div",{className:"wc-block-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(p.createElement)("time",{className:"wc-block-review-list-item__published-date",dateTime:t},r)}(n))),l&&function(e){return Object(p.createElement)(D,{maxLines:10,moreText:Object(g.__)("Read full review",'woocommerce'),lessText:Object(g.__)("Hide full review",'woocommerce'),className:"wc-block-review-list-item__text"},Object(p.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(211);function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Q=function(e){var t=e.attributes,r=e.reviews,n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach((function(t){k()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{showReviewImage:(m.r||"product"===t.imageType)&&t.showReviewImage,showReviewRating:m.e&&t.showReviewRating});return Object(p.createElement)("ul",{className:"wc-block-review-list"},0===r.length?Object(p.createElement)(T,{attributes:n}):r.map((function(e,t){return Object(p.createElement)(T,{key:e.id||t,attributes:n,review:e})})))},F=r(83),U=(r(210),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(p.createElement)(F.a,{className:"wc-block-review-sort-select",defaultValue:t,label:Object(g.__)("Order by",'woocommerce'),onChange:r,options:[{key:"most-recent",label:Object(g.__)("Most recent",'woocommerce')},{key:"highest-rating",label:Object(g.__)("Highest rating",'woocommerce')},{key:"lowest-rating",label:Object(g.__)("Lowest rating",'woocommerce')}],readOnly:n,screenReaderLabel:Object(g.__)("Order reviews by",'woocommerce'),value:o})}),H=r(11),V=r.n(H),W=r(19),J=r.n(W),q=r(44),z=r.n(q),K=r(49),X=r(28),G=function(e){var t=function(t){function r(){var e,t;o()(this,r);for(var n=arguments.length,c=new Array(n),a=0;a<n;a++)c[a]=arguments[a];return t=s()(this,(e=u()(r)).call.apply(e,[this].concat(c))),k()(P()(t),"isPreview",!!t.props.attributes.previewReviews),k()(P()(t),"delayedAppendReviews",t.props.delayFunction(t.appendReviews)),k()(P()(t),"state",{error:null,loading:!0,reviews:t.isPreview?t.props.attributes.previewReviews:[],totalReviews:t.isPreview?t.props.attributes.previewReviews.length:0}),k()(P()(t),"setError",(function(e){var r,n;return J.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return r=t.props.onReviewsLoadError,o.next=3,J.a.awrap(Object(X.a)(e));case 3:n=o.sent,t.setState({reviews:[],loading:!1,error:n}),r(n);case 6:case"end":return o.stop()}}))})),t}return b()(r,t),a()(r,[{key:"componentDidMount",value:function(){this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!z()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnMount",value:function(){this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,a={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(a.category_id=Array.isArray(r)?r.join(","):r),c&&(a.product_id=c),a}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(K.b)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,c=r.reviews,a=r.totalReviews;return Object(p.createElement)(e,V()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:a}))}}]),r}(w.Component);k()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}(function(e){function t(){return o()(this,t),s()(this,u()(t).apply(this,arguments))}return b()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,n=e.isLoading,o=e.noReviewsPlaceholder,c=e.reviews,a=e.totalReviews;return r?Object(p.createElement)(f.a,{className:"wc-block-featured-product-error",error:r,isLoading:n}):0!==c.length||n?Object(p.createElement)(v.Disabled,null,t.showOrderby&&m.e&&Object(p.createElement)(U,{readOnly:!0,value:t.orderby}),Object(p.createElement)(Q,{attributes:t,reviews:c}),t.showLoadMore&&a>c.length&&Object(p.createElement)(y,{screenReaderLabel:Object(g.__)("Load more reviews",'woocommerce')})):Object(p.createElement)(o,{attributes:t})}}]),t}(w.Component)),Y=function(e){function t(){return o()(this,t),s()(this,u()(t).apply(this,arguments))}return b()(t,e),a()(t,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(p.createElement)(v.Placeholder,{icon:t,label:r},Object(g.__)("The content for this block is hidden due to block settings.",'woocommerce'))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.className,n=e.noReviewsPlaceholder,o=t.categoryIds,c=t.productId,a=t.reviewsOnPageLoad,i=t.showProductName,s=t.showReviewDate,l=t.showReviewerName,u=t.showReviewContent,d=t.showReviewImage,b=t.showReviewRating,g=Object(K.c)(t.orderby),w=g.order,v=g.orderby;return!(u||b||s||l||d||i)?this.renderHiddenContentPlaceholder():Object(p.createElement)("div",{className:Object(K.a)(r,t)},Object(p.createElement)(G,{attributes:t,categoryIds:o,delayFunction:function(e){return Object(h.debounce)(e,400)},noReviewsPlaceholder:n,orderby:v,order:w,productId:c,reviewsToDisplay:a}))}}]),t}(w.Component);t.a=Y},121:function(e,t,r){"use strict";var n=r(62),o=r.n(n),c=r(11),a=r.n(c),i=r(0),s=r(1),l=r(5),u=(r(2),r(32)),d=r(3),b=r(6),p=r.n(b),g=r(13),w=r.n(g),h=r(17),v=r.n(h),m=r(14),f=r.n(m),O=r(15),j=r.n(O),y=r(16),_=r.n(y),k=r(21),E=Object(k.createHigherOrderComponent)((function(e){var t=function(t){function r(){return w()(this,r),f()(this,j()(r).apply(this,arguments))}return _()(r,t),v()(r,[{key:"render",value:function(){var t=this.props.selected;return Object(i.createElement)(e,a()({},this.props,{selected:Object(l.isNil)(t)?[]:[t]}))}}]),r}(i.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),R=r(337),A=r(19),P=r.n(A),S=r(12),C=r.n(S),B=r(7),N=r.n(B),x=r(44),L=r.n(x),I=r(29),D=r(28);function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){N()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Q=Object(k.createHigherOrderComponent)((function(e){var t=function(t){function r(){var e,t;w()(this,r);for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return t=f()(this,(e=j()(r)).call.apply(e,[this].concat(o))),N()(C()(t),"state",{error:null,loading:!1,variations:{}}),N()(C()(t),"loadVariations",(function(){var e=t.props.products,r=t.state,n=r.loading,o=r.variations;if(!n){var c=t.getExpandedProduct();if(c&&!o[c]){var a=e.find((function(e){return e.id===c}));a.variations&&0!==a.variations.length?(t.setState({loading:!0}),Object(I.f)(c).then((function(e){var r=e.map((function(e){return M({},e,{parent:c})}));t.setState({variations:M({},t.state.variations,N()({},c,r)),loading:!1,error:null})})).catch((function(e){var r;return P.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,P.a.awrap(Object(D.a)(e));case 2:r=n.sent,t.setState({variations:M({},t.state.variations,N()({},c,null)),loading:!1,error:r});case 4:case"end":return n.stop()}}))}))):t.setState({variations:M({},t.state.variations,N()({},c,null)),loading:!1,error:null})}}})),t}return _()(r,t),v()(r,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!L()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.includes(e)}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,o=this.state,c=o.error,s=o.loading,l=o.variations;return Object(i.createElement)(e,a()({},this.props,{error:c||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:l,variationsLoading:s}))}}]),r}(i.Component);return N()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),F=function(){return Object(i.createElement)(d.Icon,{icon:Object(i.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"#1E8CBE",d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))})},U=function(){return Object(i.createElement)(d.Icon,{icon:Object(i.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)("path",{fill:"#6C7781",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))})},H=r(31);r(338);function V(e,t){if(!t)return e;var r=new RegExp(Object(l.escapeRegExp)(t),"ig");return e.replace(r,"<strong>$&</strong>")}var W=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Object(i.createElement)(F,null):Object(i.createElement)(U,null)},J={list:Object(s.__)("Products",'woocommerce'),noItems:Object(s.__)("Your store doesn't have any products.",'woocommerce'),search:Object(s.__)("Search for a product to display",'woocommerce'),updated:Object(s.__)("Product search results updated.",'woocommerce')},q=function(e){var t=e.expandedProduct,r=e.error,n=e.isLoading,c=e.onChange,b=e.onSearch,g=e.products,w=e.renderItem,h=e.selected,v=e.showVariations,m=e.variations,f=e.variationsLoading,O=function(e){var r=e.item,n=e.search,o=e.depth,c=void 0===o?0:o,b=e.isSelected,g=e.onSelect,w=r.variations&&Array.isArray(r.variations)?r.variations.length:0,h=p()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(c),{"is-searching":n.length>0,"is-skip-level":0===c&&0!==r.parent,"is-variable":w>0}),v=Object.assign({},e);delete v.isSingle;var m={role:"menuitemradio"};return r.breadcrumbs.length&&(m["aria-label"]="".concat(r.breadcrumbs[0],": ").concat(r.name)),w&&(m["aria-expanded"]=r.id===t),r.breadcrumbs.length?(Object(l.isEmpty)(r.variation)||(r.name=r.variation),Object(i.createElement)(u.b,a()({className:h},e,m))):[Object(i.createElement)(d.MenuItem,a()({key:"product-".concat(r.id),isSelected:b},v,m,{className:h,onClick:function(){g(r)()}}),Object(i.createElement)("span",{className:"woocommerce-search-list__item-state"},W(b)),Object(i.createElement)("span",{className:"woocommerce-search-list__item-label"},Object(i.createElement)("span",{className:"woocommerce-search-list__item-name",dangerouslySetInnerHTML:{__html:V(r.name,n)}})),w?Object(i.createElement)("span",{className:"woocommerce-search-list__item-variation-count"},Object(s.sprintf)(Object(s._n)("%d variation","%d variations",w,'woocommerce'),w)):null),t===r.id&&w>0&&f&&Object(i.createElement)("div",{key:"loading",className:"woocommerce-search-list__item woocommerce-search-product__itemdepth-1 is-loading is-not-active"},Object(i.createElement)(d.Spinner,null))]};if(r)return Object(i.createElement)(H.a,{error:r});var j=m&&m[t]?m[t]:[],y=[].concat(o()(g),o()(j));return Object(i.createElement)(u.a,{className:"woocommerce-products",list:y,isLoading:n,isSingle:!0,selected:y.filter((function(e){var t=e.id;return h.includes(t)})),onChange:c,renderItem:w||(v?O:null),onSearch:b,messages:J,isHierarchical:!0})};q.defaultProps={expandedProduct:null,selected:[],showVariations:!1};t.a=E(Object(R.a)(Q(q)))},136:function(e,t,r){},18:function(e,t,r){"use strict";r.d(t,"e",(function(){return o})),r.d(t,"r",(function(){return c})),r.d(t,"k",(function(){return a})),r.d(t,"m",(function(){return i})),r.d(t,"b",(function(){return s})),r.d(t,"l",(function(){return l})),r.d(t,"o",(function(){return u})),r.d(t,"d",(function(){return d})),r.d(t,"n",(function(){return b})),r.d(t,"c",(function(){return p})),r.d(t,"p",(function(){return g})),r.d(t,"i",(function(){return w})),r.d(t,"j",(function(){return h})),r.d(t,"f",(function(){return v})),r.d(t,"g",(function(){return m})),r.d(t,"h",(function(){return f})),r.d(t,"q",(function(){return O})),r.d(t,"a",(function(){return j})),r.d(t,"s",(function(){return y}));var n=r(4),o=Object(n.getSetting)("enableReviewRating",!0),c=Object(n.getSetting)("showAvatars",!0),a=Object(n.getSetting)("max_columns",6),i=Object(n.getSetting)("min_columns",1),s=Object(n.getSetting)("default_columns",3),l=Object(n.getSetting)("max_rows",6),u=Object(n.getSetting)("min_rows",1),d=Object(n.getSetting)("default_rows",2),b=Object(n.getSetting)("min_height",500),p=Object(n.getSetting)("default_height",500),g=Object(n.getSetting)("placeholderImgSrc",""),w=(Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),h=Object(n.getSetting)("limitTags"),v=Object(n.getSetting)("hasProducts",!0),m=Object(n.getSetting)("hasTags",!0),f=Object(n.getSetting)("homeUrl",""),O=Object(n.getSetting)("productCount",0),j=Object(n.getSetting)("attributes",[]),y=Object(n.getSetting)("wcBlocksAssetUrl","")},19:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},20:function(e,t){!function(){e.exports=this.moment}()},21:function(e,t){!function(){e.exports=this.wp.compose}()},22:function(e,t){!function(){e.exports=this.wp.editor}()},23:function(e,t){!function(){e.exports=this.wp.blocks}()},27:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(19),o=r.n(n),c=function(e){var t;return o.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if("function"!=typeof e.json){r.next=11;break}return r.prev=1,r.next=4,o.a.awrap(e.json());case 4:return t=r.sent,r.abrupt("return",{message:t.message,type:t.type||"api"});case 8:return r.prev=8,r.t0=r.catch(1),r.abrupt("return",{message:r.t0.message,type:"general"});case 11:return r.abrupt("return",{message:e.message,type:e.type||"general"});case 12:case"end":return r.stop()}}),null,null,[[1,8]])}},29:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(9),a=r(8),i=r.n(a),s=r(5),l=r(18),u={root:"/wc/blocks",products:"".concat("/wc/blocks","/products"),categories:"".concat("/wc/blocks","/products/categories")};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r.d(t,"g",(function(){return p})),r.d(t,"d",(function(){return g})),r.d(t,"e",(function(){return w})),r.d(t,"c",(function(){return h})),r.d(t,"b",(function(){return v})),r.d(t,"f",(function(){return m})),r.d(t,"a",(function(){return f})),r.d(t,"h",(function(){return O}));var p=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,a=e.queryArgs,d=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,a=e.queryArgs,i=void 0===a?[]:a,s={per_page:l.i?100:-1,catalog_visibility:"any",status:"publish",search:o,orderby:"title",order:"asc"},d=[Object(c.addQueryArgs)(u.products,b({},s,{},i))];return l.i&&r.length&&d.push(Object(c.addQueryArgs)(u.products,{catalog_visibility:"any",status:"publish",include:r})),d}({selected:r,search:o,queryArgs:void 0===a?[]:a});return Promise.all(d.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return b({},e,{parent:0})}))})).catch((function(e){throw e}))},g=function(e){return i()({path:"".concat(u.products,"/").concat(e)})},w=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=[Object(c.addQueryArgs)("".concat(u.products,"/tags"),{per_page:l.j?100:-1,orderby:l.j?"count":"name",order:l.j?"desc":"asc",search:n})];return l.j&&r.length&&o.push(Object(c.addQueryArgs)("".concat(u.products,"/tags"),{include:r})),o}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},h=function(e){return i()({path:"".concat(u.categories,"/").concat(e)})},v=function(e){return i()({path:Object(c.addQueryArgs)("".concat(u.products,"/categories"),b({per_page:-1},e))})},m=function(e){return i()({path:Object(c.addQueryArgs)("".concat(u.products,"/").concat(e,"/variations"),{per_page:-1})})},f=function(){return i()({path:Object(c.addQueryArgs)("".concat(u.products,"/attributes"),{per_page:-1})})},O=function(e){return i()({path:Object(c.addQueryArgs)("".concat(u.products,"/attributes/").concat(e,"/terms"),{per_page:-1})})}},3:function(e,t){!function(){e.exports=this.wp.components}()},31:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(27));t.a=function(e){var t,r,a,i=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=i).message,a=t.type,r?"general"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===a?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},337:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(19),a=r.n(c),i=r(13),s=r.n(i),l=r(17),u=r.n(l),d=r(14),b=r.n(d),p=r(15),g=r.n(p),w=r(12),h=r.n(w),v=r(16),m=r.n(v),f=r(0),O=r(5),j=r(21),y=(r(2),r(18)),_=r(29),k=r(28),E=Object(j.createHigherOrderComponent)((function(e){var t=function(t){function r(){var e;return s()(this,r),(e=b()(this,g()(r).apply(this,arguments))).state={list:[],loading:!0},e.setError=e.setError.bind(h()(e)),e.debouncedOnSearch=Object(O.debounce)(e.onSearch.bind(h()(e)),400),e}return m()(r,t),u()(r,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(_.g)({selected:t}).then((function(t){e.setState({list:t,loading:!1})})).catch(this.setError)}},{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel()}},{key:"onSearch",value:function(e){var t=this,r=this.props.selected;Object(_.g)({selected:r,search:e}).then((function(e){t.setState({list:e,loading:!1})})).catch(this.setError)}},{key:"setError",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,a.a.awrap(Object(k.a)(e));case 2:t=r.sent,this.setState({list:[],loading:!1,error:t});case 4:case"end":return r.stop()}}),null,this)}},{key:"render",value:function(){var t=this,r=this.state,n=r.error,c=r.list,a=r.loading;return Object(f.createElement)(e,o()({},this.props,{error:n,products:c,isLoading:a,onSearch:y.i?function(e){t.setState({loading:!0}),t.debouncedOnSearch(e)}:null}))}}]),r}(f.Component);return t.defaultProps={selected:[]},t}),"withSearchedProducts");t.a=E},37:function(e,t){!function(){e.exports=this.wp.keycodes}()},4:function(e,t){!function(){e.exports=this.wc.wcSettings}()},40:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},44:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},48:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(13),a=r.n(c),i=r(17),s=r.n(i),l=r(14),u=r.n(l),d=r(15),b=r.n(d),p=r(12),g=r.n(p),w=r(16),h=r.n(w),v=r(0),m=r(5),f=r(6),O=r.n(f),j=r(3),y=r(21),_=(r(98),function(e){function t(){var e;return a()(this,t),(e=u()(this,b()(t).apply(this,arguments))).onClick=e.onClick.bind(g()(e)),e}return h()(t,e),s()(t,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,a=r.instanceId,i=r.className,s=r.help,l=r.options,u=r.value,d="inspector-toggle-button-control-".concat(a);return s&&(e=Object(m.isFunction)(s)?s(c):s),Object(v.createElement)(j.BaseControl,{id:d,help:e,className:O()("components-toggle-button-control",i)},Object(v.createElement)("label",{id:d+"__label",htmlFor:d,className:"components-toggle-button-control__label"},n),Object(v.createElement)(j.ButtonGroup,{"aria-labelledby":d+"__label"},l.map((function(e,r){var c={};return u===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isDefault=!0,c["aria-pressed"]=!1),Object(v.createElement)(j.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),t}(v.Component));t.a=Object(y.withInstanceId)(_)},49:function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return u}));var n=r(8),o=r.n(n),c=r(6),a=r.n(c),i=r(18),s=function(e){if(i.e){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=function(e){return o()({path:"/wc/blocks/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},u=function(e,t){var r=t.className,n=t.showReviewDate,o=t.showReviewerName,c=t.showReviewContent,i=t.showProductName,s=t.showReviewImage,l=t.showReviewRating;return a()(e,r,{"has-image":s,"has-name":o,"has-date":n,"has-rating":l,"has-content":c,"has-product-name":i})}},5:function(e,t){!function(){e.exports=this.lodash}()},53:function(e,t){!function(){e.exports=this.ReactDOM}()},54:function(e,t,r){"use strict";var n=r(7),o=r.n(n),c=r(0),a=(r(2),r(10)),i=r(6),s=r.n(i);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var u=function(e){var t,r=e.label,n=e.screenReaderLabel,i=e.wrapperElement,u=e.wrapperProps;return!r&&n?(t=i||"span",u=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},u,{className:s()(u.className,"screen-reader-text")}),Object(c.createElement)(t,u,n)):(t=i||a.Fragment,r&&n&&r!==n?Object(c.createElement)(t,u,Object(c.createElement)("span",{"aria-hidden":"true"},r),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,u,r))};u.defaultProps={wrapperProps:{}},t.a=u},56:function(e,t){!function(){e.exports=this.wp.viewport}()},600:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(19),a=r.n(c),i=r(13),s=r.n(i),l=r(17),u=r.n(l),d=r(14),b=r.n(d),p=r(15),g=r.n(p),w=r(12),h=r.n(w),v=r(16),m=r.n(v),f=r(7),O=r.n(f),j=r(0),y=r(21),_=r(29),k=r(28),E=Object(y.createHigherOrderComponent)((function(e){return function(t){function r(){var e,t;s()(this,r);for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return t=b()(this,(e=g()(r)).call.apply(e,[this].concat(o))),O()(h()(t),"state",{error:null,loading:!1,product:"preview"===t.props.attributes.productId?t.props.attributes.previewProduct:null}),O()(h()(t),"loadProduct",(function(){var e=t.props.attributes.productId;"preview"!==e&&(e?(t.setState({loading:!0}),Object(_.d)(e).then((function(e){t.setState({product:e,loading:!1,error:null})})).catch((function(e){var r;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,a.a.awrap(Object(k.a)(e));case 2:r=n.sent,t.setState({product:null,loading:!1,error:r});case 4:case"end":return n.stop()}}))}))):t.setState({product:null,loading:!1,error:null}))})),t}return m()(r,t),u()(r,[{key:"componentDidMount",value:function(){this.loadProduct()}},{key:"componentDidUpdate",value:function(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,c=t.product;return Object(j.createElement)(e,o()({},this.props,{error:r,getProduct:this.loadProduct,isLoading:n,product:c}))}}]),r}(j.Component)}),"withProduct");t.a=E},61:function(e,t){!function(){e.exports=this.wp.hooks}()},65:function(e,t){!function(){e.exports=this.wp.date}()},650:function(e,t,r){"use strict";r.r(t);var n=r(7),o=r.n(n),c=r(0),a=r(1),i=r(23),s=r(3),l=function(e){var t=e.className;return Object(c.createElement)(s.Icon,{className:t,icon:Object(c.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)("path",{d:"M2.3,17.3h9.3c0.1,0,0.3,0,0.4,0.1l5.9,4.2c0.3,0.2,0.7,0,0.7-0.3v-3.7c0-0.2,0.2-0.4,0.4-0.4H22 c1.1,0,2-0.9,2-2V2.5c0-1.2-0.7-2.2-2-2.2H2.3C0.7,0.2,0,0.9,0,2.5v12.3C0,16.3,0.7,17.3,2.3,17.3z"}),Object(c.createElement)("polygon",{fill:"#ffffff",points:"8.8,12.1 6.5,10.9 4.1,12.1 4.5,9.5 2.6,7.6 5.3,7.2 6.5,4.8 7.6,7.2 10.3,7.6 8.4,9.5"}),Object(c.createElement)("path",{fill:"#ffffff",d:"M20.7,7.9h-7c-0.5,0-0.9-0.4-0.9-0.9S13.2,6,13.7,6h7c0.5,0,0.9,0.4,0.9,0.9S21.2,7.9,20.7,7.9z"}),Object(c.createElement)("path",{fill:"#ffffff",d:"M20.7,11.5h-7c-0.5,0-0.9-0.4-0.9-0.9s0.4-0.9,0.9-0.9h7c0.5,0,0.9,0.4,0.9,0.9S21.2,11.5,20.7,11.5z"}))})},u=(r(99),r(11)),d=r.n(u),b=r(22),p=r(32),g=(r(2),r(121)),w=r(103),h=r(66),v=r(600),m=Object(v.a)((function(e){var t=e.error,r=e.getProduct,n=e.isLoading,o=e.product;if(t)return Object(c.createElement)(h.a,{className:"wc-block-featured-product-error",error:t,isLoading:n,onRetry:r});var i=!o||n?Object(c.createElement)(s.Spinner,null):Object(a.sprintf)(Object(a.__)("This block lists reviews for a selected product. %s doesn't have any reviews yet, but they will show up here when it does.",'woocommerce'),o.name);return Object(c.createElement)(s.Placeholder,{className:"wc-block-reviews-by-product",icon:Object(c.createElement)(l,{className:"block-editor-block-icon"}),label:Object(a.__)("Reviews by Product",'woocommerce')},i)})),f=r(80),O=Object(s.withSpokenMessages)((function(e){var t=e.attributes,r=e.debouncedSpeak,n=e.setAttributes,o=t.editMode,i=t.productId,u=function(e){var t=e.item,r=void 0===t?0:t;return Object(c.createElement)(p.b,d()({},e,{countLabel:Object(a.sprintf)(Object(a._n)("%d Review","%d Reviews",r.review_count,'woocommerce'),r.review_count),showCount:!0,"aria-label":Object(a.sprintf)(Object(a._n)("%s, has %d review","%s, has %d reviews",r.review_count,'woocommerce'),r.name,r.review_count)}))};return!i||o?Object(c.createElement)(s.Placeholder,{icon:Object(c.createElement)(l,{className:"block-editor-block-icon"}),label:Object(a.__)("Reviews by Product",'woocommerce')},Object(a.__)("Show reviews of your product to build trust",'woocommerce'),Object(c.createElement)("div",{className:"wc-block-reviews__selection"},Object(c.createElement)(g.a,{selected:t.productId||0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;n({productId:t})},queryArgs:{orderby:"comment_count",order:"desc"},renderItem:u}),Object(c.createElement)(s.Button,{isDefault:!0,onClick:function(){n({editMode:!1}),r(Object(a.__)("Showing Reviews by Product block preview.",'woocommerce'))}},Object(a.__)("Done",'woocommerce')))):Object(c.createElement)(c.Fragment,null,Object(f.a)(o,n),Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(s.PanelBody,{title:Object(a.__)("Product",'woocommerce'),initialOpen:!1},Object(c.createElement)(g.a,{selected:t.productId||0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;n({productId:t})},renderItem:u})),Object(c.createElement)(s.PanelBody,{title:Object(a.__)("Content",'woocommerce')},Object(f.b)(t,n)),Object(c.createElement)(s.PanelBody,{title:Object(a.__)("List Settings",'woocommerce')},Object(f.c)(t,n))),Object(c.createElement)(w.a,{attributes:t,className:"wc-block-all-reviews",icon:Object(c.createElement)(l,{className:"block-editor-block-icon"}),name:Object(a.__)("Reviews by Product",'woocommerce'),noReviewsPlaceholder:m}))})),j=r(100),y=r(101),_=r(86);function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(i.registerBlockType)("woocommerce/reviews-by-product",{title:Object(a.__)("Reviews by Product",'woocommerce'),icon:{src:Object(c.createElement)(l,null),foreground:"#96588a"},category:"woocommerce",keywords:[Object(a.__)("WooCommerce",'woocommerce')],description:Object(a.__)("Show reviews of your product to build trust.",'woocommerce'),example:E({},_.a,{attributes:E({},_.a.attributes,{productId:1})}),attributes:E({},j.a,{productId:{type:"number"}}),edit:function(e){return Object(c.createElement)(O,e)},save:y.a})},66:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(26)),a=r.n(c),i=r(6),s=r.n(i),l=r(3),u=r(31);r(135);t.a=function(e){var t=e.className,r=e.error,c=e.isLoading,i=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(a.a,{icon:"notice"}),label:Object(o.__)("Sorry, an error occurred",'woocommerce'),className:s()("wc-block-api-error",t)},Object(n.createElement)(u.a,{error:r}),i&&Object(n.createElement)(n.Fragment,null,c?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isDefault:!0,onClick:i},Object(o.__)("Retry",'woocommerce'))))}},68:function(e,t){!function(){e.exports=this.wp.dom}()},72:function(e,t){},75:function(e,t){},76:function(e,t){},77:function(e,t){},78:function(e,t){},79:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(13),a=r.n(c),i=r(17),s=r.n(i),l=r(14),u=r.n(l),d=r(15),b=r.n(d),p=r(12),g=r.n(p),w=r(16),h=r.n(w),v=r(7),m=r.n(v),f=r(0),O=r(10);t.a=function(e){var t=0,r=function(r){function n(){var e,r;a()(this,n);for(var o=arguments.length,c=new Array(o),i=0;i<o;i++)c[i]=arguments[i];return r=u()(this,(e=b()(n)).call.apply(e,[this].concat(c))),m()(g()(r),"instanceId",t++),r}return h()(n,r),s()(n,[{key:"render",value:function(){return Object(f.createElement)(e,o()({},this.props,{componentId:this.instanceId}))}}]),n}(O.Component);return r.displayName="withComponentId",r}},8:function(e,t){!function(){e.exports=this.wp.apiFetch}()},80:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return p}));var n=r(0),o=r(1),c=r(27),a=r(3),i=r(22),s=r(4),l=r(18),u=r(48),d=function(e,t){return Object(n.createElement)(i.BlockControls,null,Object(n.createElement)(a.Toolbar,{controls:[{icon:"edit",title:Object(o.__)("Edit",'woocommerce'),onClick:function(){return t({editMode:!e})},isActive:e}]}))},b=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Product rating",'woocommerce'),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!l.e&&Object(n.createElement)(a.Notice,{className:"wc-block-reviews__notice",isDismissible:!1},Object(n.createElement)(n.RawHTML,null,Object(o.sprintf)(Object(c.escapeHTML)(Object(o.__)("Product rating is disabled in your %sstore settings%s.",'woocommerce')),'<a href="'.concat(Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),'" target="_blank">'),"</a>"))),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Reviewer name",'woocommerce'),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Image",'woocommerce'),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Review date",'woocommerce'),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Review content",'woocommerce'),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(u.a,{label:Object(o.__)("Review image",'woocommerce'),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo",'woocommerce'),value:"reviewer"},{label:Object(o.__)("Product",'woocommerce'),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!l.r&&Object(n.createElement)(a.Notice,{className:"wc-block-reviews__notice",isDismissible:!1},Object(n.createElement)(n.RawHTML,null,Object(o.sprintf)(Object(c.escapeHTML)(Object(o.__)("Reviewer photo is disabled in your %ssite settings%s.",'woocommerce')),'<a href="'.concat(Object(s.getAdminLink)("options-discussion.php"),'" target="_blank">'),"</a>")))))},p=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Order by",'woocommerce'),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Order Product Reviews by",'woocommerce'),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:function(e){return t({orderby:e})}}),Object(n.createElement)(a.RangeControl,{label:Object(o.__)("Starting Number of Reviews",'woocommerce'),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(a.ToggleControl,{label:Object(o.__)("Load more",'woocommerce'),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(a.RangeControl,{label:Object(o.__)("Load More Reviews",'woocommerce'),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},83:function(e,t,r){"use strict";var n=r(0),o=(r(2),r(6)),c=r.n(o),a=r(54),i=r(79);r(161);t.a=Object(i.a)((function(e){var t=e.className,r=e.componentId,o=e.defaultValue,i=e.label,s=e.onChange,l=e.options,u=e.screenReaderLabel,d=e.readOnly,b=e.value,p="wc-block-sort-select__select-".concat(r);return Object(n.createElement)("div",{className:c()("wc-block-sort-select",t)},Object(n.createElement)(a.a,{label:i,screenReaderLabel:u,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label",htmlFor:p}}),Object(n.createElement)("select",{id:p,className:"wc-block-sort-select__select",defaultValue:o,onChange:s,readOnly:d,value:b},l.map((function(e){return Object(n.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))},86:function(e,t,r){"use strict";var n=r(1),o="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NjIpLCBxdWFsaXR5ID0gOTAK/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCAwKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAMAAwAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A+t6KKtaXps2sahBZ24DTTNtXPQepPsBzQBVo/OvddD+H2j6Nbqr2sd7Pj5prhQ2T7A8Cl1z4f6PrNuyrax2c+Plmt1CkH3A4NAHhP50Vb1bTJtG1G4srgASwttOOh9CPYjBqp+VABXX/AAreNfF8If7zROEz/ex/hmuQq1pT3cepW7WAdrxXBiEYyS30oA+kKKp6RPeXOnwyX9strdEfPErBgD9f6UurT3dtp80ljbC7ugPkiZgoJ+tAHkHxWeNvFsgT7ywoHx/e6/yIrj6t6vJdy6lcvfh1vGcmUSDBB+lVKACvbvh/4Qj8PaYlxOgOozrudmHMYPRB/X3+leVeDrBdT8UabbuNyGUMwPcL8xH6V9BUAJRRRQByfxA8IR+IdMe4gjA1GBSyMo5kA6of6e/1rxGvpr/PWvn3xjYLpnijUrdBtQTFlHoGG4D9aAP/2Q==",c=[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(n.__)("July 15, 2019",'woocommerce'),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant",'woocommerce'),product_permalink:"#",reviewer:Object(n.__)("Alice",'woocommerce'),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.",'woocommerce'),"</p>\n"),reviewer_avatar_urls:{48:o,96:o},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019",'woocommerce'),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant",'woocommerce'),product_permalink:"#",reviewer:Object(n.__)("Bob",'woocommerce'),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!",'woocommerce'),"</p>\n"),reviewer_avatar_urls:{48:o,96:o},rating:null,verified:!1}];r.d(t,"a",(function(){return a}));var a={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:c}}},9:function(e,t){!function(){e.exports=this.wp.url}()},99:function(e,t,r){var n=r(136);"string"==typeof n&&(n=[[e.i,n,""]]);var o={insert:"head",singleton:!1};r(30)(n,o);n.locals&&(e.exports=n.locals)}});
  