Ubuntu

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["product-categories"]=function(e){function t(t){for(var c,a,l=t[0],i=t[1],s=t[2],b=0,p=[];b1&&void 0!==arguments[1]?arguments[1]:0,c=this.props.isPreview,r=void 0!==c&&c,a=this.props.attributes.hasCount,l="parent-"+e[0].term_id;return Object(o.createElement)("ul",{key:l},e.map(function(e){var c=a?Object(o.createElement)("span",null,"(",e.count,")"):null;return[Object(o.createElement)("li",{key:e.term_id},Object(o.createElement)("a",{href:r?null:e.link},e.name)," ",c," "),!!e.children&&!!e.children.length&&t.renderList(e.children,n+1)]}))}},{key:"renderOptions",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=this.props.attributes.hasCount;return e.map(function(e){var r=c?"(".concat(e.count,")"):null;return[Object(o.createElement)("option",{key:e.term_id,value:e.link},"–".repeat(n)," ",e.name," ",r),!!e.children&&!!e.children.length&&t.renderOptions(e.children,n+1)]})}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.categories,c=e.componentId,r=t.className,l=t.isDropdown,i=_()("wc-block-product-categories",r,{"is-dropdown":l,"is-list":!l}),s="prod-categories-".concat(c);return Object(o.createElement)(E.Fragment,null,n.length>0&&Object(o.createElement)("div",{className:i},l?Object(o.createElement)(E.Fragment,null,Object(o.createElement)("div",{className:"wc-block-product-categories__dropdown"},Object(o.createElement)("label",{className:"screen-reader-text",htmlFor:s},Object(a.__)("Select a category",'woocommerce')),Object(o.createElement)("select",{id:s,ref:this.select},Object(o.createElement)("option",{value:"false",hidden:!0},Object(a.__)("Select a category",'woocommerce')),this.renderOptions(n))),Object(o.createElement)("button",{type:"button",className:"wc-block-product-categories__button","aria-label":Object(a.__)("Go to category",'woocommerce'),icon:"arrow-right-alt2",onClick:this.onNavigate},Object(o.createElement)("svg",{"aria-hidden":"true",role:"img",focusable:"false",className:"dashicon dashicons-arrow-right-alt2",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20"},Object(o.createElement)("path",{d:"M6 15l5-5-5-5 1-2 7 7-7 7z"})))):this.renderList(n)))}}]),t}(E.Component),z=Object(C.a)(x),M=n(70),H=n(62),L=n.n(H),N=n(20),P=n.n(N);function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,c)}return n}function I(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(function(e,t,n,c){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.parent;return(e[r]||(e[r]=[])).push(t),e},{}),t=function t(n){return n.map(function(n){var c=e[n.term_id];return delete e[n.term_id],function(e){for(var t=1;t0?Object(o.createElement)(z,{attributes:t,categories:b,isPreview:!0}):Object(o.createElement)(s.Placeholder,{className:"wc-block-product-categories",icon:Object(o.createElement)(S.b,null),label:Object(a.__)("Product Categories List",'woocommerce')},Object(a.__)("This block shows product categories for your store. In order to preview this you'll first need to create a product and assign it to a category.",'woocommerce')))},save:function(e){var t=e.attributes,n=t.hasCount,c=t.hasEmpty,a=t.isDropdown,l=t.isHierarchical,i={};return n&&(i["data-has-count"]=!0),c&&(i["data-has-empty"]=!0),a&&(i["data-is-dropdown"]=!0),l&&(i["data-is-hierarchical"]=!0),Object(o.createElement)("div",r()({className:"is-loading"},i),a?Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-categories__placeholder"}):Object(o.createElement)("ul",{"aria-hidden":!0},Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-product-categories__placeholder"})),Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-product-categories__placeholder"})),Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-product-categories__placeholder"}))))}})},69:function(e,t,n){"use strict";var c=n(16),r=n.n(c),o=n(8),a=n.n(o),l=n(9),i=n.n(l),s=n(10),u=n.n(s),b=n(11),p=n.n(b),h=n(12),d=n.n(h),f=n(0),m=n(13),g=[];t.a=function(e){return function(t){function n(){return a()(this,n),u()(this,p()(n).apply(this,arguments))}return d()(n,t),i()(n,[{key:"generateUniqueID",value:function(){var e=n.name;return g[e]||(g[e]=0),g[e]++,g[e]}},{key:"render",value:function(){var t=this.generateUniqueID();return Object(f.createElement)(e,r()({},this.props,{componentId:t}))}}]),n}(m.Component)}},70:function(e,t,n){"use strict";var c=n(16),r=n.n(c),o=n(8),a=n.n(o),l=n(9),i=n.n(l),s=n(10),u=n.n(s),b=n(11),p=n.n(b),h=n(15),d=n.n(h),f=n(12),m=n.n(f),g=n(0),w=n(4),v=n(6),O=n.n(v),j=n(2),E=n(21),y=(n(132),function(e){function t(){var e;return a()(this,t),(e=u()(this,p()(t).apply(this,arguments))).onClick=e.onClick.bind(d()(e)),e}return m()(t,e),i()(t,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,n=this.props,c=n.label,o=n.checked,a=n.instanceId,l=n.className,i=n.help,s=n.options,u=n.value,b="inspector-toggle-button-control-".concat(a);return i&&(e=Object(w.isFunction)(i)?i(o):i),Object(g.createElement)(j.BaseControl,{id:b,help:e,className:O()("components-toggle-button-control",l)},Object(g.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},c),Object(g.createElement)(j.ButtonGroup,{"aria-labelledby":b+"__label"},s.map(function(e,n){var o={};return u===e.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isDefault=!0,o["aria-pressed"]=!1),Object(g.createElement)(j.Button,r()({key:"".concat(e.label,"-").concat(e.value,"-").concat(n),value:e.value,onClick:t.onClick,"aria-label":c+": "+e.label},o),e.label)})))}}]),t}(g.Component));t.a=Object(E.withInstanceId)(y)}});